ChangeSet 1.1162, 2003/04/29 00:12:08-07:00, greg@kroah.com 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. drivers/scsi/hosts.c | 1 - drivers/scsi/hosts.h | 4 ++-- drivers/scsi/scsi_debug.c | 1 - drivers/scsi/scsi_syms.c | 2 +- drivers/scsi/scsi_sysfs.c | 28 +++------------------------- 5 files changed, 6 insertions(+), 30 deletions(-) diff -Nru a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c --- a/drivers/scsi/hosts.c Tue Apr 29 09:47:34 2003 +++ b/drivers/scsi/hosts.c Tue Apr 29 09:47:34 2003 @@ -294,7 +294,6 @@ sht->info ? sht->info(shost) : sht->name); if (dev) { - dev->class_data = shost; shost->host_gendev = dev; } diff -Nru a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h --- a/drivers/scsi/hosts.h Tue Apr 29 09:47:34 2003 +++ b/drivers/scsi/hosts.h Tue Apr 29 09:47:34 2003 @@ -495,7 +495,7 @@ __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 @@ -607,7 +607,7 @@ extern int scsi_upper_driver_register(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 /* diff -Nru a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c --- a/drivers/scsi/scsi_debug.c Tue Apr 29 09:47:34 2003 +++ b/drivers/scsi/scsi_debug.c Tue Apr 29 09:47:34 2003 @@ -183,7 +183,6 @@ .name = sdebug_proc_name, .probe = sdebug_driver_probe, .remove = sdebug_driver_remove, - .devclass = &shost_devclass, }; static const int check_condition_result = diff -Nru a/drivers/scsi/scsi_syms.c b/drivers/scsi/scsi_syms.c --- a/drivers/scsi/scsi_syms.c Tue Apr 29 09:47:34 2003 +++ b/drivers/scsi/scsi_syms.c Tue Apr 29 09:47:34 2003 @@ -112,4 +112,4 @@ /* * sysfs support */ -EXPORT_SYMBOL(shost_devclass); +EXPORT_SYMBOL(shost_class); diff -Nru a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c --- a/drivers/scsi/scsi_sysfs.c Tue Apr 29 09:47:34 2003 +++ b/drivers/scsi/scsi_sysfs.c Tue Apr 29 09:47:34 2003 @@ -75,30 +75,8 @@ DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL); -static int scsi_host_class_add_dev(struct device * dev) -{ - 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 = { +struct class shost_class = { .name = "scsi-host", - .add_device = scsi_host_class_add_dev, - .remove_device = scsi_host_class_rm_dev, }; /** @@ -136,14 +114,14 @@ int scsi_sysfs_register(void) { bus_register(&scsi_bus_type); - devclass_register(&shost_devclass); + class_register(&shost_class); return 0; } void scsi_sysfs_unregister(void) { - devclass_unregister(&shost_devclass); + class_unregister(&shost_class); bus_unregister(&scsi_bus_type); }