Commit d7068318 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

driver core: fix up scsi code to compile due to the class changes.

Yes, this patch is not logically correct, in that the scsi-host class
no longer works, but Mike Anderson has a patch that will be submitted
that fixes all of these problems.
parent 3ba0daed
...@@ -294,7 +294,6 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) ...@@ -294,7 +294,6 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
sht->info ? sht->info(shost) : sht->name); sht->info ? sht->info(shost) : sht->name);
if (dev) { if (dev) {
dev->class_data = shost;
shost->host_gendev = dev; shost->host_gendev = dev;
} }
......
...@@ -495,7 +495,7 @@ struct Scsi_Host ...@@ -495,7 +495,7 @@ struct Scsi_Host
__attribute__ ((aligned (sizeof(unsigned long)))); __attribute__ ((aligned (sizeof(unsigned long))));
}; };
#define to_scsi_host(d) d->class_data #define to_scsi_host(d) d->driver_data /* Major logical breakage, but we compile again... */
/* /*
* These two functions are used to allocate and free a pseudo device * These two functions are used to allocate and free a pseudo device
...@@ -607,7 +607,7 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost, ...@@ -607,7 +607,7 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost,
extern int scsi_upper_driver_register(struct Scsi_Device_Template *); extern int scsi_upper_driver_register(struct Scsi_Device_Template *);
extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *); extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *);
extern struct device_class shost_devclass; extern struct class shost_class;
#endif #endif
/* /*
......
...@@ -183,7 +183,6 @@ static struct device_driver sdebug_driverfs_driver = { ...@@ -183,7 +183,6 @@ static struct device_driver sdebug_driverfs_driver = {
.name = sdebug_proc_name, .name = sdebug_proc_name,
.probe = sdebug_driver_probe, .probe = sdebug_driver_probe,
.remove = sdebug_driver_remove, .remove = sdebug_driver_remove,
.devclass = &shost_devclass,
}; };
static const int check_condition_result = static const int check_condition_result =
......
...@@ -112,4 +112,4 @@ EXPORT_SYMBOL(scsi_delete_timer); ...@@ -112,4 +112,4 @@ EXPORT_SYMBOL(scsi_delete_timer);
/* /*
* sysfs support * sysfs support
*/ */
EXPORT_SYMBOL(shost_devclass); EXPORT_SYMBOL(shost_class);
...@@ -75,30 +75,8 @@ static ssize_t scsi_host_class_name_show(struct device *dev, char *page) ...@@ -75,30 +75,8 @@ static ssize_t scsi_host_class_name_show(struct device *dev, char *page)
DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL); DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL);
static int scsi_host_class_add_dev(struct device * dev) struct class shost_class = {
{
int i;
device_create_file(dev, &dev_attr_class_name);
for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
device_create_file(dev, shost_attrs[i]);
return 0;
}
static void scsi_host_class_rm_dev(struct device * dev)
{
int i;
for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
device_remove_file(dev, shost_attrs[i]);
device_remove_file(dev, &dev_attr_class_name);
}
struct device_class shost_devclass = {
.name = "scsi-host", .name = "scsi-host",
.add_device = scsi_host_class_add_dev,
.remove_device = scsi_host_class_rm_dev,
}; };
/** /**
...@@ -136,14 +114,14 @@ static struct bus_type scsi_bus_type = { ...@@ -136,14 +114,14 @@ static struct bus_type scsi_bus_type = {
int scsi_sysfs_register(void) int scsi_sysfs_register(void)
{ {
bus_register(&scsi_bus_type); bus_register(&scsi_bus_type);
devclass_register(&shost_devclass); class_register(&shost_class);
return 0; return 0;
} }
void scsi_sysfs_unregister(void) void scsi_sysfs_unregister(void)
{ {
devclass_unregister(&shost_devclass); class_unregister(&shost_class);
bus_unregister(&scsi_bus_type); bus_unregister(&scsi_bus_type);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment