aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 18:05:29 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-08-21 13:10:50 -0400
commitc69c6be5a825382da93803e48850a42c4e4c16e1 (patch)
treee70e1f5cb077c3ca42ddca064e88424d0c19ed7e /drivers/scsi/st.c
parente1ea2351fba3b96b20107b4483b133137f653717 (diff)
[SCSI] st: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the scsi tape class code to use the correct field. Cc: Kai Mäkisara <Kai.Makisara@kolumbus.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 2a32036a9404..ff44b3c2cff2 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -82,7 +82,7 @@ static int try_rdio = 1;
82static int try_wdio = 1; 82static int try_wdio = 1;
83 83
84static struct class st_sysfs_class; 84static struct class st_sysfs_class;
85static struct device_attribute st_dev_attrs[]; 85static const struct attribute_group *st_dev_groups[];
86 86
87MODULE_AUTHOR("Kai Makisara"); 87MODULE_AUTHOR("Kai Makisara");
88MODULE_DESCRIPTION("SCSI tape (st) driver"); 88MODULE_DESCRIPTION("SCSI tape (st) driver");
@@ -4274,7 +4274,7 @@ static void scsi_tape_release(struct kref *kref)
4274 4274
4275static struct class st_sysfs_class = { 4275static struct class st_sysfs_class = {
4276 .name = "scsi_tape", 4276 .name = "scsi_tape",
4277 .dev_attrs = st_dev_attrs, 4277 .dev_groups = st_dev_groups,
4278}; 4278};
4279 4279
4280static int __init init_st(void) 4280static int __init init_st(void)
@@ -4408,6 +4408,7 @@ defined_show(struct device *dev, struct device_attribute *attr, char *buf)
4408 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); 4408 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined);
4409 return l; 4409 return l;
4410} 4410}
4411static DEVICE_ATTR_RO(defined);
4411 4412
4412static ssize_t 4413static ssize_t
4413default_blksize_show(struct device *dev, struct device_attribute *attr, 4414default_blksize_show(struct device *dev, struct device_attribute *attr,
@@ -4419,7 +4420,7 @@ default_blksize_show(struct device *dev, struct device_attribute *attr,
4419 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); 4420 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize);
4420 return l; 4421 return l;
4421} 4422}
4422 4423static DEVICE_ATTR_RO(default_blksize);
4423 4424
4424static ssize_t 4425static ssize_t
4425default_density_show(struct device *dev, struct device_attribute *attr, 4426default_density_show(struct device *dev, struct device_attribute *attr,
@@ -4433,6 +4434,7 @@ default_density_show(struct device *dev, struct device_attribute *attr,
4433 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); 4434 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density);
4434 return l; 4435 return l;
4435} 4436}
4437static DEVICE_ATTR_RO(default_density);
4436 4438
4437static ssize_t 4439static ssize_t
4438default_compression_show(struct device *dev, struct device_attribute *attr, 4440default_compression_show(struct device *dev, struct device_attribute *attr,
@@ -4444,6 +4446,7 @@ default_compression_show(struct device *dev, struct device_attribute *attr,
4444 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); 4446 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1);
4445 return l; 4447 return l;
4446} 4448}
4449static DEVICE_ATTR_RO(default_compression);
4447 4450
4448static ssize_t 4451static ssize_t
4449options_show(struct device *dev, struct device_attribute *attr, char *buf) 4452options_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -4472,15 +4475,17 @@ options_show(struct device *dev, struct device_attribute *attr, char *buf)
4472 l = snprintf(buf, PAGE_SIZE, "0x%08x\n", options); 4475 l = snprintf(buf, PAGE_SIZE, "0x%08x\n", options);
4473 return l; 4476 return l;
4474} 4477}
4475 4478static DEVICE_ATTR_RO(options);
4476static struct device_attribute st_dev_attrs[] = { 4479
4477 __ATTR_RO(defined), 4480static struct attribute *st_dev_attrs[] = {
4478 __ATTR_RO(default_blksize), 4481 &dev_attr_defined.attr,
4479 __ATTR_RO(default_density), 4482 &dev_attr_default_blksize.attr,
4480 __ATTR_RO(default_compression), 4483 &dev_attr_default_density.attr,
4481 __ATTR_RO(options), 4484 &dev_attr_default_compression.attr,
4482 __ATTR_NULL, 4485 &dev_attr_options.attr,
4486 NULL,
4483}; 4487};
4488ATTRIBUTE_GROUPS(st_dev);
4484 4489
4485/* The following functions may be useful for a larger audience. */ 4490/* The following functions may be useful for a larger audience. */
4486static int sgl_map_user_pages(struct st_buffer *STbp, 4491static int sgl_map_user_pages(struct st_buffer *STbp,