diff options
Diffstat (limited to 'drivers/scsi')
33 files changed, 1441 insertions, 1223 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 51c3ebf1c7d..b31faeccb9c 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -140,9 +140,10 @@ static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id); /* Functions */ /* Show some statistics about the card */ -static ssize_t twa_show_stats(struct class_device *class_dev, char *buf) +static ssize_t twa_show_stats(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *host = class_to_shost(class_dev); + struct Scsi_Host *host = class_to_shost(dev); TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; unsigned long flags = 0; ssize_t len; @@ -184,7 +185,7 @@ static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth) } /* End twa_change_queue_depth() */ /* Create sysfs 'stats' entry */ -static struct class_device_attribute twa_host_stats_attr = { +static struct device_attribute twa_host_stats_attr = { .attr = { .name = "stats", .mode = S_IRUGO, @@ -193,7 +194,7 @@ static struct class_device_attribute twa_host_stats_attr = { }; /* Host attributes initializer */ -static struct class_device_attribute *twa_host_attrs[] = { +static struct device_attribute *twa_host_attrs[] = { &twa_host_stats_attr, NULL, }; diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index adb98a29721..8c22329aa85 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -484,9 +484,10 @@ static void tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id) } /* End tw_state_request_start() */ /* Show some statistics about the card */ -static ssize_t tw_show_stats(struct class_device *class_dev, char *buf) +static ssize_t tw_show_stats(struct device *dev, struct device_attribute *attr, + char *buf) { - struct Scsi_Host *host = class_to_shost(class_dev); + struct Scsi_Host *host = class_to_shost(dev); TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; unsigned long flags = 0; ssize_t len; @@ -528,7 +529,7 @@ static int tw_change_queue_depth(struct scsi_device *sdev, int queue_depth) } /* End tw_change_queue_depth() */ /* Create sysfs 'stats' entry */ -static struct class_device_attribute tw_host_stats_attr = { +static struct device_attribute tw_host_stats_attr = { .attr = { .name = "stats", .mode = S_IRUGO, @@ -537,7 +538,7 @@ static struct class_device_attribute tw_host_stats_attr = { }; /* Host attributes initializer */ -static struct class_device_attribute *tw_host_attrs[] = { +static struct device_attribute *tw_host_attrs[] = { &tw_host_stats_attr, NULL, }; diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 369fcf78f39..439fd814665 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1316,7 +1316,7 @@ int aac_get_adapter_info(struct aac_dev* dev) tmp>>24,(tmp>>16)&0xff,tmp&0xff, le32_to_cpu(dev->adapter_info.biosbuild)); buffer[0] = '\0'; - if (aac_show_serial_number( + if (aac_get_serial_number( shost_to_class(dev->scsi_host_ptr), buffer)) printk(KERN_INFO "%s%d: serial %s", dev->name, dev->id, buffer); diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index ace0b751c13..113ca9c8934 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -1850,9 +1850,9 @@ int aac_get_containers(struct aac_dev *dev); int aac_scsi_cmd(struct scsi_cmnd *cmd); int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg); #ifndef shost_to_class -#define shost_to_class(shost) &shost->shost_classdev +#define shost_to_class(shost) &shost->shost_dev #endif -ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf); +ssize_t aac_get_serial_number(struct device *dev, char *buf); int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg); int aac_rx_init(struct aac_dev *dev); int aac_rkt_init(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index ae5f74fb62d..c6391838b2c 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -755,10 +755,10 @@ static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long } #endif -static ssize_t aac_show_model(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_model(struct device *device, + struct device_attribute *attr, char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len; if (dev->supplement_adapter_info.AdapterTypeText[0]) { @@ -774,10 +774,10 @@ static ssize_t aac_show_model(struct class_device *class_dev, return len; } -static ssize_t aac_show_vendor(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_vendor(struct device *device, + struct device_attribute *attr, char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len; if (dev->supplement_adapter_info.AdapterTypeText[0]) { @@ -793,10 +793,11 @@ static ssize_t aac_show_vendor(struct class_device *class_dev, return len; } -static ssize_t aac_show_flags(struct class_device *class_dev, char *buf) +static ssize_t aac_show_flags(struct device *cdev, + struct device_attribute *attr, char *buf) { int len = 0; - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(cdev)->hostdata; if (nblank(dprintk(x))) len = snprintf(buf, PAGE_SIZE, "dprintk\n"); @@ -812,10 +813,11 @@ static ssize_t aac_show_flags(struct class_device *class_dev, char *buf) return len; } -static ssize_t aac_show_kernel_version(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_kernel_version(struct device *device, + struct device_attribute *attr, + char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len, tmp; tmp = le32_to_cpu(dev->adapter_info.kernelrev); @@ -825,10 +827,11 @@ static ssize_t aac_show_kernel_version(struct class_device *class_dev, return len; } -static ssize_t aac_show_monitor_version(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_monitor_version(struct device *device, + struct device_attribute *attr, + char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len, tmp; tmp = le32_to_cpu(dev->adapter_info.monitorrev); @@ -838,10 +841,11 @@ static ssize_t aac_show_monitor_version(struct class_device *class_dev, return len; } -static ssize_t aac_show_bios_version(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_bios_version(struct device *device, + struct device_attribute *attr, + char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len, tmp; tmp = le32_to_cpu(dev->adapter_info.biosrev); @@ -851,9 +855,10 @@ static ssize_t aac_show_bios_version(struct class_device *class_dev, return len; } -ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf) +ssize_t aac_show_serial_number(struct device *device, + struct device_attribute *attr, char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len = 0; if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0) @@ -869,35 +874,39 @@ ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf) return len; } -static ssize_t aac_show_max_channel(struct class_device *class_dev, char *buf) +static ssize_t aac_show_max_channel(struct device *device, + struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%d\n", - class_to_shost(class_dev)->max_channel); + class_to_shost(device)->max_channel); } -static ssize_t aac_show_max_id(struct class_device *class_dev, char *buf) +static ssize_t aac_show_max_id(struct device *device, + struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%d\n", - class_to_shost(class_dev)->max_id); + class_to_shost(device)->max_id); } -static ssize_t aac_store_reset_adapter(struct class_device *class_dev, - const char *buf, size_t count) +static ssize_t aac_store_reset_adapter(struct device *device, + struct device_attribute *attr, + const char *buf, size_t count) { int retval = -EACCES; if (!capable(CAP_SYS_ADMIN)) return retval; - retval = aac_reset_adapter((struct aac_dev*)class_to_shost(class_dev)->hostdata, buf[0] == '!'); + retval = aac_reset_adapter((struct aac_dev*)class_to_shost(device)->hostdata, buf[0] == '!'); if (retval >= 0) retval = count; return retval; } -static ssize_t aac_show_reset_adapter(struct class_device *class_dev, - char *buf) +static ssize_t aac_show_reset_adapter(struct device *device, + struct device_attribute *attr, + char *buf) { - struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; + struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; int len, tmp; tmp = aac_adapter_check_health(dev); @@ -907,70 +916,70 @@ static ssize_t aac_show_reset_adapter(struct class_device *class_dev, return len; } -static struct class_device_attribute aac_model = { +static struct device_attribute aac_model = { .attr = { .name = "model", .mode = S_IRUGO, }, .show = aac_show_model, }; -static struct class_device_attribute aac_vendor = { +static struct device_attribute aac_vendor = { .attr = { .name = "vendor", .mode = S_IRUGO, }, .show = aac_show_vendor, }; -static struct class_device_attribute aac_flags = { +static struct device_attribute aac_flags = { .attr = { .name = "flags", .mode = S_IRUGO, }, .show = aac_show_flags, }; -static struct class_device_attribute aac_kernel_version = { +static struct device_attribute aac_kernel_version = { .attr = { .name = "hba_kernel_version", .mode = S_IRUGO, }, .show = aac_show_kernel_version, }; -static struct class_device_attribute aac_monitor_version = { +static struct device_attribute aac_monitor_version = { .attr = { .name = "hba_monitor_version", .mode = S_IRUGO, }, .show = aac_show_monitor_version, }; -static struct class_device_attribute aac_bios_version = { +static struct device_attribute aac_bios_version = { .attr = { .name = "hba_bios_version", .mode = S_IRUGO, }, .show = aac_show_bios_version, }; -static struct class_device_attribute aac_serial_number = { +static struct device_attribute aac_serial_number = { .attr = { .name = "serial_number", .mode = S_IRUGO, }, .show = aac_show_serial_number, }; -static struct class_device_attribute aac_max_channel = { +static struct device_attribute aac_max_channel = { .attr = { .name = "max_channel", .mode = S_IRUGO, }, .show = aac_show_max_channel, }; -static struct class_device_attribute aac_max_id = { +static struct device_attribute aac_max_id = { .attr = { .name = "max_id", .mode = S_IRUGO, }, .show = aac_show_max_id, }; -static struct class_device_attribute aac_reset = { +static struct device_attribute aac_reset = { .attr = { .name = "reset_host", .mode = S_IWUSR|S_IRUGO, @@ -979,7 +988,7 @@ static struct class_device_attribute aac_reset = { .show = aac_show_reset_adapter, }; -static struct class_device_attribute *aac_attrs[] = { +static struct device_attribute *aac_attrs[] = { &aac_model, &aac_vendor, &aac_flags, @@ -993,6 +1002,10 @@ static struct class_device_attribute *aac_attrs[] = { NULL }; +ssize_t aac_get_serial_number(struct device *device, char *buf) +{ + return aac_show_serial_number(device, &aac_serial_number, buf); +} static const struct file_operations aac_cfg_fops = { .owner = THIS_MODULE, diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h index 3288be2e49f..ab646e580d6 100644 --- a/drivers/scsi/arcmsr/arcmsr.h +++ b/drivers/scsi/arcmsr/arcmsr.h @@ -44,7 +44,7 @@ */ #include <linux/interrupt.h> -struct class_device_attribute; +struct device_attribute; /*The limit of outstanding scsi command that firmware can handle*/ #define ARCMSR_MAX_OUTSTANDING_CMD 256 #define ARCMSR_MAX_FREECCB_NUM 320 @@ -556,6 +556,6 @@ struct SENSE_DATA extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *); extern void arcmsr_iop_message_read(struct AdapterControlBlock *); extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); -extern struct class_device_attribute *arcmsr_host_attrs[]; +extern struct device_attribute *arcmsr_host_attrs[]; extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb); diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c index 7d7b0a55427..69f8346aa28 100644 --- a/drivers/scsi/arcmsr/arcmsr_attr.c +++ b/drivers/scsi/arcmsr/arcmsr_attr.c @@ -57,15 +57,15 @@ #include <scsi/scsi_transport.h> #include "arcmsr.h" -struct class_device_attribute *arcmsr_host_attrs[]; +struct device_attribute *arcmsr_host_attrs[]; static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj, struct bin_attribute *bin, char *buf, loff_t off, size_t count) { - struct class_device *cdev = container_of(kobj,struct class_device,kobj); - struct Scsi_Host *host = class_to_shost(cdev); + struct device *dev = container_of(kobj,struct device,kobj); + struct Scsi_Host *host = class_to_shost(dev); struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; uint8_t *pQbuffer,*ptmpQbuffer; int32_t allxfer_len = 0; @@ -110,8 +110,8 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct kobject *kobj, char *buf, loff_t off, size_t count) { - struct class_device *cdev = container_of(kobj,struct class_device,kobj); - struct Scsi_Host *host = class_to_shost(cdev); + struct device *dev = container_of(kobj,struct device,kobj); + struct Scsi_Host *host = class_to_shost(dev); struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; uint8_t *pQbuffer, *ptmpuserbuffer; @@ -158,8 +158,8 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct kobject *kobj, char *buf, loff_t off, size_t count) { - struct class_device *cdev = container_of(kobj,struct class_device,kobj); - struct Scsi_Host *host = class_to_shost(cdev); + struct device *dev = container_of(kobj,struct device,kobj); + struct Scsi_Host *host = class_to_shost(dev); struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; uint8_t *pQbuffer; @@ -220,87 +220,104 @@ int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *acb) struct Scsi_Host *host = acb->host; int error; - error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); + error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr); if (error) { printk(KERN_ERR "arcmsr: alloc sysfs mu_read failed\n"); goto error_bin_file_message_read; } - error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); + error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr); if (error) { printk(KERN_ERR "arcmsr: alloc sysfs mu_write failed\n"); goto error_bin_file_message_write; } - error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr); + error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr); if (error) { printk(KERN_ERR "arcmsr: alloc sysfs mu_clear failed\n"); goto error_bin_file_message_clear; } return 0; error_bin_file_message_clear: - sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); + sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr); error_bin_file_message_write: - sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); + sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr); error_bin_file_message_read: return error; } -void -arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb) { +void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb) +{ struct Scsi_Host *host = acb->host; - sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr); - sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr); - sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr); + sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr); + sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr); + sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr); } static ssize_t -arcmsr_attr_host_driver_version(struct class_device *cdev, char *buf) { +arcmsr_attr_host_driver_version(struct device *dev, + struct device_attribute *attr, char *buf) +{ return snprintf(buf, PAGE_SIZE, "%s\n", ARCMSR_DRIVER_VERSION); } static ssize_t -arcmsr_attr_host_driver_posted_cmd(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_driver_posted_cmd(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", atomic_read(&acb->ccboutstandingcount)); } static ssize_t -arcmsr_attr_host_driver_reset(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_driver_reset(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", acb->num_resets); } static ssize_t -arcmsr_attr_host_driver_abort(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_driver_abort(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", acb->num_aborts); } static ssize_t -arcmsr_attr_host_fw_model(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_model(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%s\n", acb->firm_model); } static ssize_t -arcmsr_attr_host_fw_version(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_version(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%s\n", @@ -308,9 +325,12 @@ arcmsr_attr_host_fw_version(struct class_device *cdev, char *buf) { } static ssize_t -arcmsr_attr_host_fw_request_len(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_request_len(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", @@ -318,9 +338,12 @@ arcmsr_attr_host_fw_request_len(struct class_device *cdev, char *buf) { } static ssize_t -arcmsr_attr_host_fw_numbers_queue(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_numbers_queue(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", @@ -328,9 +351,12 @@ arcmsr_attr_host_fw_numbers_queue(struct class_device *cdev, char *buf) { } static ssize_t -arcmsr_attr_host_fw_sdram_size(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_sdram_size(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", @@ -338,36 +364,39 @@ arcmsr_attr_host_fw_sdram_size(struct class_device *cdev, char *buf) { } static ssize_t -arcmsr_attr_host_fw_hd_channels(struct class_device *cdev, char *buf) { - struct Scsi_Host *host = class_to_shost(cdev); - struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +arcmsr_attr_host_fw_hd_channels(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = + (struct AdapterControlBlock *) host->hostdata; return snprintf(buf, PAGE_SIZE, "%4d\n", acb->firm_hd_channels); } -static CLASS_DEVICE_ATTR(host_driver_version, S_IRUGO, arcmsr_attr_host_driver_version, NULL); -static CLASS_DEVICE_ATTR(host_driver_posted_cmd, S_IRUGO, arcmsr_attr_host_driver_posted_cmd, NULL); -static CLASS_DEVICE_ATTR(host_driver_reset, S_IRUGO, arcmsr_attr_host_driver_reset, NULL); -static CLASS_DEVICE_ATTR(host_driver_abort, S_IRUGO, arcmsr_attr_host_driver_abort, NULL); -static CLASS_DEVICE_ATTR(host_fw_model, S_IRUGO, arcmsr_attr_host_fw_model, NULL); -static CLASS_DEVICE_ATTR(host_fw_version, S_IRUGO, arcmsr_attr_host_fw_version, NULL); -static CLASS_DEVICE_ATTR(host_fw_request_len, S_IRUGO, arcmsr_attr_host_fw_request_len, NULL); -static CLASS_DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_queue, NULL); -static CLASS_DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL); -static CLASS_DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL); - -struct class_device_attribute *arcmsr_host_attrs[] = { - &class_device_attr_host_driver_version, - &class_device_attr_host_driver_posted_cmd, - &class_device_attr_host_driver_reset, - &class_device_attr_host_driver_abort, - &class_device_attr_host_fw_model, - &class_device_attr_host_fw_version, - &class_device_attr_host_fw_request_len, - &class_device_attr_host_fw_numbers_queue, - &class_device_attr_host_fw_sdram_size, - &class_device_attr_host_fw_hd_channels, +static DEVICE_ATTR(host_driver_version, S_IRUGO, arcmsr_attr_host_driver_version, NULL); +static DEVICE_ATTR(host_driver_posted_cmd, S_IRUGO, arcmsr_attr_host_driver_posted_cmd, NULL); +static DEVICE_ATTR(host_driver_reset, S_IRUGO, arcmsr_attr_host_driver_reset, NULL); +static DEVICE_ATTR(host_driver_abort, S_IRUGO, arcmsr_attr_host_driver_abort, NULL); +static DEVICE_ATTR(host_fw_model, S_IRUGO, arcmsr_attr_host_fw_model, NULL); +static DEVICE_ATTR(host_fw_version, S_IRUGO, arcmsr_attr_host_fw_version, NULL); +static DEVICE_ATTR(host_fw_request_len, S_IRUGO, arcmsr_attr_host_fw_request_len, NULL); +static DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_queue, NULL); +static DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL); +static DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL); + +struct device_attribute *arcmsr_host_attrs[] = { + &dev_attr_host_driver_version, + &dev_attr_host_driver_posted_cmd, + &dev_attr_host_driver_reset, + &dev_attr_host_driver_abort, + &dev_attr_host_fw_model, + &dev_attr_host_fw_version, + &dev_attr_host_fw_request_len, + &dev_attr_host_fw_numbers_queue, + &dev_attr_host_fw_sdram_size, + &dev_attr_host_fw_hd_channels, NULL, }; diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 92d1cb1b21c..75c84d7b9ce 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -881,7 +881,7 @@ static long ch_ioctl_compat(struct file * file, static int ch_probe(struct device *dev) { struct scsi_device *sd = to_scsi_device(dev); - struct class_device *class_dev; + struct device *class_dev; int minor, ret = -ENOMEM; scsi_changer *ch; @@ -910,11 +910,11 @@ static int ch_probe(struct device *dev) ch->minor = minor; sprintf(ch->name,"ch%d",ch->minor); - class_dev = class_device_create(ch_sysfs_class, NULL, - MKDEV(SCSI_CHANGER_MAJOR, ch->minor), - dev, "s%s", ch->name); + class_dev = device_create(ch_sysfs_class, dev, + MKDEV(SCSI_CHANGER_MAJOR,ch->minor), + "s%s", ch->name); if (IS_ERR(class_dev)) { - printk(KERN_WARNING "ch%d: class_device_create failed\n", + printk(KERN_WARNING "ch%d: device_create failed\n", ch->minor); ret = PTR_ERR(class_dev); goto remove_idr; @@ -945,8 +945,7 @@ static int ch_remove(struct device *dev) idr_remove(&ch_index_idr, ch->minor); spin_unlock(&ch_index_lock); - class_device_destroy(ch_sysfs_class, - MKDEV(SCSI_CHANGER_MAJOR,ch->minor)); + device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR,ch->minor)); kfree(ch->dt); kfree(ch); return 0; diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 1592640a87b..c264a8c5f01 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -43,14 +43,14 @@ static int scsi_host_next_hn; /* host_no for next new host */ -static void scsi_host_cls_release(struct class_device *class_dev) +static void scsi_host_cls_release(struct device *dev) { - put_device(&class_to_shost(class_dev)->shost_gendev); + put_device(&class_to_shost(dev)->shost_gendev); } static struct class shost_class = { .name = "scsi_host", - .release = scsi_host_cls_release, + .dev_release = scsi_host_cls_release, }; /** @@ -174,7 +174,7 @@ void scsi_remove_host(struct Scsi_Host *shost) spin_unlock_irqrestore(shost->host_lock, flags); transport_unregister_device(&shost->shost_gendev); - class_device_unregister(&shost->shost_classdev); + device_unregister(&shost->shost_dev); device_del(&shost->shost_gendev); scsi_proc_hostdir_rm(shost->hostt); } @@ -212,7 +212,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) scsi_host_set_state(shost, SHOST_RUNNING); get_device(shost->shost_gendev.parent); - error = class_device_add(&shost->shost_classdev); + error = device_add(&shost->shost_dev); if (error) goto out_de |