diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 44 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvstgt.c | 25 |
2 files changed, 39 insertions, 30 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 78d46a900bb..4a922c57125 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1456,9 +1456,10 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth) /* ------------------------------------------------------------ * sysfs attributes */ -static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) +static ssize_t show_host_srp_version(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); int len; @@ -1467,7 +1468,7 @@ static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) return len; } -static struct class_device_attribute ibmvscsi_host_srp_version = { +static struct device_attribute ibmvscsi_host_srp_version = { .attr = { .name = "srp_version", .mode = S_IRUGO, @@ -1475,10 +1476,11 @@ static struct class_device_attribute ibmvscsi_host_srp_version = { .show = show_host_srp_version, }; -static ssize_t show_host_partition_name(struct class_device *class_dev, +static ssize_t show_host_partition_name(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); int len; @@ -1487,7 +1489,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev, return len; } -static struct class_device_attribute ibmvscsi_host_partition_name = { +static struct device_attribute ibmvscsi_host_partition_name = { .attr = { .name = "partition_name", .mode = S_IRUGO, @@ -1495,10 +1497,11 @@ static struct class_device_attribute ibmvscsi_host_partition_name = { .show = show_host_partition_name, }; -static ssize_t show_host_partition_number(struct class_device *class_dev, +static ssize_t show_host_partition_number(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); int len; @@ -1507,7 +1510,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev, return len; } -static struct class_device_attribute ibmvscsi_host_partition_number = { +static struct device_attribute ibmvscsi_host_partition_number = { .attr = { .name = "partition_number", .mode = S_IRUGO, @@ -1515,9 +1518,10 @@ static struct class_device_attribute ibmvscsi_host_partition_number = { .show = show_host_partition_number, }; -static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) +static ssize_t show_host_mad_version(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); int len; @@ -1526,7 +1530,7 @@ static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) return len; } -static struct class_device_attribute ibmvscsi_host_mad_version = { +static struct device_attribute ibmvscsi_host_mad_version = { .attr = { .name = "mad_version", .mode = S_IRUGO, @@ -1534,9 +1538,10 @@ static struct class_device_attribute ibmvscsi_host_mad_version = { .show = show_host_mad_version, }; -static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) +static ssize_t show_host_os_type(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); int len; @@ -1544,7 +1549,7 @@ static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) return len; } -static struct class_device_attribute ibmvscsi_host_os_type = { +static struct device_attribute ibmvscsi_host_os_type = { .attr = { .name = "os_type", .mode = S_IRUGO, @@ -1552,9 +1557,10 @@ static struct class_device_attribute ibmvscsi_host_os_type = { .show = show_host_os_type, }; -static ssize_t show_host_config(struct class_device *class_dev, char *buf) +static ssize_t show_host_config(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(class_dev); + struct Scsi_Host *shost = class_to_shost(dev); struct ibmvscsi_host_data *hostdata = shost_priv(shost); /* returns null-terminated host config data */ @@ -1564,7 +1570,7 @@ static ssize_t show_host_config(struct class_device *class_dev, char *buf) return 0; } -static struct class_device_attribute ibmvscsi_host_config = { +static struct device_attribute ibmvscsi_host_config = { .attr = { .name = "config", .mode = S_IRUGO, @@ -1572,7 +1578,7 @@ static struct class_device_attribute ibmvscsi_host_config = { .show = show_host_config, }; -static struct class_device_attribute *ibmvscsi_attrs[] = { +static struct device_attribute *ibmvscsi_attrs[] = { &ibmvscsi_host_srp_version, &ibmvscsi_host_partition_name, &ibmvscsi_host_partition_number, diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index e5881e92d0f..3b9514c8f1f 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c @@ -780,32 +780,35 @@ static int ibmvstgt_it_nexus_response(struct Scsi_Host *shost, u64 itn_id, return 0; } -static ssize_t system_id_show(struct class_device *cdev, char *buf) +static ssize_t system_id_show(struct device *dev, + struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%s\n", system_id); } -static ssize_t partition_number_show(struct class_device *cdev, char *buf) +static ssize_t partition_number_show(struct device *dev, + struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%x\n", partition_number); } -static ssize_t unit_address_show(struct class_device *cdev, char *buf) +static ssize_t unit_address_show(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(cdev); + struct Scsi_Host *shost = class_to_shost(dev); struct srp_target *target = host_to_srp_target(shost); struct vio_port *vport = target_to_port(target); return snprintf(buf, PAGE_SIZE, "%x\n", vport->dma_dev->unit_address); } -static CLASS_DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL); -static CLASS_DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL); -static CLASS_DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL); +static DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL); +static DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL); +static DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL); -static struct class_device_attribute *ibmvstgt_attrs[] = { - &class_device_attr_system_id, - &class_device_attr_partition_number, - &class_device_attr_unit_address, +static struct device_attribute *ibmvstgt_attrs[] = { + &dev_attr_system_id, + &dev_attr_partition_number, + &dev_attr_unit_address, NULL, }; |