diff options
| -rw-r--r-- | backing-dev-convert-class-code-to-use-dev_groups.patch (renamed from d4.patch) | 15 | ||||
| -rw-r--r-- | cuse-convert-class-code-to-use-dev_groups.patch | 54 | ||||
| -rw-r--r-- | d1.patch | 83 | ||||
| -rw-r--r-- | d10.patch | 882 | ||||
| -rw-r--r-- | d2.patch | 618 | ||||
| -rw-r--r-- | d5.patch | 1272 | ||||
| -rw-r--r-- | scsi-osd-convert-class-code-to-use-dev_groups.patch | 54 | ||||
| -rw-r--r-- | scsi-sd-convert-class-code-to-use-dev_groups.patch | 314 | ||||
| -rw-r--r-- | scsi-st-convert-class-code-to-use-dev_groups.patch | 96 | ||||
| -rw-r--r-- | series | 12 | ||||
| -rw-r--r-- | staging-comedi-convert-class-code-to-use-dev_groups.patch (renamed from d3.patch) | 14 | ||||
| -rw-r--r-- | uio-convert-class-code-to-use-dev_groups.patch | 71 | ||||
| -rw-r--r-- | video-backlight-convert-class-code-to-use-dev_groups.patch | 135 | ||||
| -rw-r--r-- | video-backlight-lcd-convert-class-code-to-use-dev_groups.patch | 104 |
14 files changed, 1505 insertions, 2219 deletions
diff --git a/d4.patch b/backing-dev-convert-class-code-to-use-dev_groups.patch index 68b153f0add2c8..710d2624e8a5d4 100644 --- a/d4.patch +++ b/backing-dev-convert-class-code-to-use-dev_groups.patch @@ -1,3 +1,18 @@ +From foo@baz Tue Jul 9 15:34:49 PDT 2013 +Date: Tue, 09 Jul 2013 15:34:49 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: backing-dev: 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 backing device class code to +use the correct field. + +Cc: Andrew Morton <akpm@linux-foundation.org> +Cc: Jan Kara <jack@suse.cz> +Cc: Tejun Heo <tj@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + --- mm/backing-dev.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cuse-convert-class-code-to-use-dev_groups.patch b/cuse-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..b11e4401de6b64 --- /dev/null +++ b/cuse-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,54 @@ +From foo@baz Tue Jul 9 15:33:17 PDT 2013 +Date: Tue, 09 Jul 2013 15:33:17 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: cuse: 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 cuse class code to use the +correct field. + +Cc: Miklos Szeredi <miklos@szeredi.hu> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + fs/fuse/cuse.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/fs/fuse/cuse.c ++++ b/fs/fuse/cuse.c +@@ -568,6 +568,7 @@ static ssize_t cuse_class_waiting_show(s + + return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting)); + } ++static DEVICE_ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL); + + static ssize_t cuse_class_abort_store(struct device *dev, + struct device_attribute *attr, +@@ -578,12 +579,14 @@ static ssize_t cuse_class_abort_store(st + fuse_abort_conn(&cc->fc); + return count; + } ++static DEVICE_ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store); + +-static struct device_attribute cuse_class_dev_attrs[] = { +- __ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL), +- __ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store), +- { } ++static struct attribute *cuse_class_dev_attrs[] = { ++ &dev_attr_waiting.attr, ++ &dev_attr_abort.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(cuse_class_dev); + + static struct miscdevice cuse_miscdev = { + .minor = MISC_DYNAMIC_MINOR, +@@ -609,7 +612,7 @@ static int __init cuse_init(void) + if (IS_ERR(cuse_class)) + return PTR_ERR(cuse_class); + +- cuse_class->dev_attrs = cuse_class_dev_attrs; ++ cuse_class->dev_groups = cuse_class_dev_groups; + + rc = misc_register(&cuse_miscdev); + if (rc) { diff --git a/d1.patch b/d1.patch index 6bf4190b627b6f..776bd82d31b325 100644 --- a/d1.patch +++ b/d1.patch @@ -1,58 +1,59 @@ --- - drivers/uio/uio.c | 22 +++++++++++++--------- - 1 file changed, 13 insertions(+), 9 deletions(-) + drivers/video/output.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) ---- a/drivers/uio/uio.c -+++ b/drivers/uio/uio.c -@@ -224,38 +224,42 @@ static struct kobj_type portio_attr_type - .default_attrs = portio_attrs, - }; +--- a/drivers/video/output.c ++++ b/drivers/video/output.c +@@ -32,8 +32,8 @@ MODULE_DESCRIPTION("Display Output Switc + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); --static ssize_t show_name(struct device *dev, -+static ssize_t name_show(struct device *dev, - struct device_attribute *attr, char *buf) +-static ssize_t video_output_show_state(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t state_show(struct device *dev, struct device_attribute *attr, ++ char *buf) { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", idev->info->name); + ssize_t ret_size = 0; + struct output_device *od = to_output_device(dev); +@@ -42,9 +42,8 @@ static ssize_t video_output_show_state(s + return ret_size; } -+static DEVICE_ATTR_RO(name); --static ssize_t show_version(struct device *dev, -+static ssize_t version_show(struct device *dev, - struct device_attribute *attr, char *buf) +-static ssize_t video_output_store_state(struct device *dev, +- struct device_attribute *attr, +- const char *buf,size_t count) ++static ssize_t state_store(struct device *dev, struct device_attribute *attr, ++ const char *buf,size_t count) { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", idev->info->version); + char *endp; + struct output_device *od = to_output_device(dev); +@@ -62,6 +61,7 @@ static ssize_t video_output_store_state( + } + return count; } -+static DEVICE_ATTR_RO(version); ++static DEVICE_ATTR_RW(state); --static ssize_t show_event(struct device *dev, -+static ssize_t event_show(struct device *dev, - struct device_attribute *attr, char *buf) + static void video_output_release(struct device *dev) { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event)); +@@ -69,16 +69,16 @@ static void video_output_release(struct + kfree(od); } -+static DEVICE_ATTR_RO(event); --static struct device_attribute uio_class_attributes[] = { -- __ATTR(name, S_IRUGO, show_name, NULL), -- __ATTR(version, S_IRUGO, show_version, NULL), -- __ATTR(event, S_IRUGO, show_event, NULL), -- {} -+static struct attribute *uio_attrs[] = { -+ &dev_attr_name.attr, -+ &dev_attr_version.attr, -+ &dev_attr_event.attr, +-static struct device_attribute video_output_attributes[] = { +- __ATTR(state, 0644, video_output_show_state, video_output_store_state), +- __ATTR_NULL, ++static struct attribute *video_output_attrs[] = { ++ &dev_attr_state.attr, + NULL, }; -+ATTRIBUTE_GROUPS(uio); +- ++ATTRIBUTE_GROUPS(video_output); - /* UIO class infrastructure */ - static struct class uio_class = { - .name = "uio", -- .dev_attrs = uio_class_attributes, -+ .dev_groups = uio_groups, + static struct class video_output_class = { + .name = "video_output", + .dev_release = video_output_release, +- .dev_attrs = video_output_attributes, ++ .dev_groups = video_output_groups, }; - /* + struct output_device *video_output_register(const char *name, diff --git a/d10.patch b/d10.patch index 0dea7e687b140e..e99021f81a85a1 100644 --- a/d10.patch +++ b/d10.patch @@ -1,799 +1,11 @@ --- - drivers/scsi/osd/osd_uld.c | 13 +-- - drivers/scsi/sd.c | 147 +++++++++++++++++------------------ - drivers/scsi/st.c | 25 +++-- - drivers/staging/comedi/comedi_fops.c | 39 ++++----- - drivers/uio/uio.c | 22 +++-- - drivers/video/backlight/backlight.c | 44 +++++----- - drivers/video/backlight/lcd.c | 26 +++--- - drivers/video/output.c | 20 ++-- - fs/fuse/cuse.c | 13 +-- - mm/backing-dev.c | 19 ++-- - net/core/net-sysfs.c | 134 +++++++++++++++++-------------- - net/ieee802154/wpan-class.c | 21 ++--- - net/rfkill/core.c | 88 +++++++++----------- - net/wireless/sysfs.c | 23 +++-- - 14 files changed, 337 insertions(+), 297 deletions(-) + drivers/video/output.c | 20 +++--- + net/core/net-sysfs.c | 134 ++++++++++++++++++++++++-------------------- + net/ieee802154/wpan-class.c | 21 +++--- + net/rfkill/core.c | 88 +++++++++++++--------------- + net/wireless/sysfs.c | 23 ++++--- + 5 files changed, 149 insertions(+), 137 deletions(-) ---- a/drivers/scsi/osd/osd_uld.c -+++ b/drivers/scsi/osd/osd_uld.c -@@ -107,6 +107,7 @@ static ssize_t osdname_show(struct devic - class_dev); - return sprintf(buf, "%s\n", ould->odi.osdname); - } -+static DEVICE_ATTR_RO(osdname); - - static ssize_t systemid_show(struct device *dev, struct device_attribute *attr, - char *buf) -@@ -117,17 +118,19 @@ static ssize_t systemid_show(struct devi - memcpy(buf, ould->odi.systemid, ould->odi.systemid_len); - return ould->odi.systemid_len; - } -+static DEVICE_ATTR_RO(systemid); - --static struct device_attribute osd_uld_attrs[] = { -- __ATTR(osdname, S_IRUGO, osdname_show, NULL), -- __ATTR(systemid, S_IRUGO, systemid_show, NULL), -- __ATTR_NULL, -+static struct attribute *osd_uld_attrs[] = { -+ &dev_attr_osdname.attr, -+ &dev_attr_systemid.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(osd_uld); - - static struct class osd_uld_class = { - .owner = THIS_MODULE, - .name = "scsi_osd", -- .dev_attrs = osd_uld_attrs, -+ .dev_groups = osd_uld_groups, - }; - - /* ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -132,8 +132,8 @@ static const char *sd_cache_types[] = { - }; - - static ssize_t --sd_store_cache_type(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+cache_type_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - int i, ct = -1, rcd, wce, sp; - struct scsi_disk *sdkp = to_scsi_disk(dev); -@@ -199,8 +199,18 @@ sd_store_cache_type(struct device *dev, - } - - static ssize_t --sd_store_manage_start_stop(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+manage_start_stop_show(struct device *dev, struct device_attribute *attr, -+ char *buf) -+{ -+ struct scsi_disk *sdkp = to_scsi_disk(dev); -+ struct scsi_device *sdp = sdkp->device; -+ -+ return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); -+} -+ -+static ssize_t -+manage_start_stop_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -212,10 +222,19 @@ sd_store_manage_start_stop(struct device - - return count; - } -+static DEVICE_ATTR_RW(manage_start_stop); -+ -+static ssize_t -+allow_restart_show(struct device *dev, struct device_attribute *attr, char *buf) -+{ -+ struct scsi_disk *sdkp = to_scsi_disk(dev); -+ -+ return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); -+} - - static ssize_t --sd_store_allow_restart(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+allow_restart_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -230,47 +249,30 @@ sd_store_allow_restart(struct device *de - - return count; - } -+static DEVICE_ATTR_RW(allow_restart); - - static ssize_t --sd_show_cache_type(struct device *dev, struct device_attribute *attr, -- char *buf) -+cache_type_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - int ct = sdkp->RCD + 2*sdkp->WCE; - - return snprintf(buf, 40, "%s\n", sd_cache_types[ct]); - } -+static DEVICE_ATTR_RW(cache_type); - - static ssize_t --sd_show_fua(struct device *dev, struct device_attribute *attr, char *buf) -+FUA_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->DPOFUA); - } -+static DEVICE_ATTR_RO(FUA); - - static ssize_t --sd_show_manage_start_stop(struct device *dev, struct device_attribute *attr, -- char *buf) --{ -- struct scsi_disk *sdkp = to_scsi_disk(dev); -- struct scsi_device *sdp = sdkp->device; -- -- return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); --} -- --static ssize_t --sd_show_allow_restart(struct device *dev, struct device_attribute *attr, -- char *buf) --{ -- struct scsi_disk *sdkp = to_scsi_disk(dev); -- -- return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); --} -- --static ssize_t --sd_show_protection_type(struct device *dev, struct device_attribute *attr, -- char *buf) -+protection_type_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -278,8 +280,8 @@ sd_show_protection_type(struct device *d - } - - static ssize_t --sd_store_protection_type(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+protection_type_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - unsigned int val; -@@ -298,10 +300,11 @@ sd_store_protection_type(struct device * - - return count; - } -+static DEVICE_ATTR_RW(protection_type); - - static ssize_t --sd_show_protection_mode(struct device *dev, struct device_attribute *attr, -- char *buf) -+protection_mode_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -320,24 +323,26 @@ sd_show_protection_mode(struct device *d - - return snprintf(buf, 20, "%s%u\n", dix ? "dix" : "dif", dif); - } -+static DEVICE_ATTR_RO(protection_mode); - - static ssize_t --sd_show_app_tag_own(struct device *dev, struct device_attribute *attr, -- char *buf) -+app_tag_own_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->ATO); - } -+static DEVICE_ATTR_RO(app_tag_own); - - static ssize_t --sd_show_thin_provisioning(struct device *dev, struct device_attribute *attr, -- char *buf) -+thin_provisioning_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->lbpme); - } -+static DEVICE_ATTR_RO(thin_provisioning); - - static const char *lbp_mode[] = { - [SD_LBP_FULL] = "full", -@@ -349,8 +354,8 @@ static const char *lbp_mode[] = { - }; - - static ssize_t --sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr, -- char *buf) -+provisioning_mode_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -358,8 +363,8 @@ sd_show_provisioning_mode(struct device - } - - static ssize_t --sd_store_provisioning_mode(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+provisioning_mode_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -385,10 +390,11 @@ sd_store_provisioning_mode(struct device - - return count; - } -+static DEVICE_ATTR_RW(provisioning_mode); - - static ssize_t --sd_show_max_medium_access_timeouts(struct device *dev, -- struct device_attribute *attr, char *buf) -+max_medium_access_timeouts_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -396,9 +402,9 @@ sd_show_max_medium_access_timeouts(struc - } - - static ssize_t --sd_store_max_medium_access_timeouts(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+max_medium_access_timeouts_store(struct device *dev, -+ struct device_attribute *attr, const char *buf, -+ size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - int err; -@@ -410,10 +416,11 @@ sd_store_max_medium_access_timeouts(stru - - return err ? err : count; - } -+static DEVICE_ATTR_RW(max_medium_access_timeouts); - - static ssize_t --sd_show_write_same_blocks(struct device *dev, struct device_attribute *attr, -- char *buf) -+max_write_same_blocks_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -421,8 +428,8 @@ sd_show_write_same_blocks(struct device - } - - static ssize_t --sd_store_write_same_blocks(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+max_write_same_blocks_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -451,35 +458,29 @@ sd_store_write_same_blocks(struct device - - return count; - } -+static DEVICE_ATTR_RW(max_write_same_blocks); - --static struct device_attribute sd_disk_attrs[] = { -- __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, -- sd_store_cache_type), -- __ATTR(FUA, S_IRUGO, sd_show_fua, NULL), -- __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart, -- sd_store_allow_restart), -- __ATTR(manage_start_stop, S_IRUGO|S_IWUSR, sd_show_manage_start_stop, -- sd_store_manage_start_stop), -- __ATTR(protection_type, S_IRUGO|S_IWUSR, sd_show_protection_type, -- sd_store_protection_type), -- __ATTR(protection_mode, S_IRUGO, sd_show_protection_mode, NULL), -- __ATTR(app_tag_own, S_IRUGO, sd_show_app_tag_own, NULL), -- __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL), -- __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode, -- sd_store_provisioning_mode), -- __ATTR(max_write_same_blocks, S_IRUGO|S_IWUSR, -- sd_show_write_same_blocks, sd_store_write_same_blocks), -- __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR, -- sd_show_max_medium_access_timeouts, -- sd_store_max_medium_access_timeouts), -- __ATTR_NULL, -+static struct attribute *sd_disk_attrs[] = { -+ &dev_attr_cache_type.attr, -+ &dev_attr_FUA.attr, -+ &dev_attr_allow_restart.attr, -+ &dev_attr_manage_start_stop.attr, -+ &dev_attr_protection_type.attr, -+ &dev_attr_protection_mode.attr, -+ &dev_attr_app_tag_own.attr, -+ &dev_attr_thin_provisioning.attr, -+ &dev_attr_provisioning_mode.attr, -+ &dev_attr_max_write_same_blocks.attr, -+ &dev_attr_max_medium_access_timeouts.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(sd_disk); - - static struct class sd_disk_class = { - .name = "scsi_disk", - .owner = THIS_MODULE, - .dev_release = scsi_disk_release, -- .dev_attrs = sd_disk_attrs, -+ .dev_groups = sd_disk_groups, - }; - - static const struct dev_pm_ops sd_pm_ops = { ---- a/drivers/scsi/st.c -+++ b/drivers/scsi/st.c -@@ -82,7 +82,7 @@ static int try_rdio = 1; - static int try_wdio = 1; - - static struct class st_sysfs_class; --static struct device_attribute st_dev_attrs[]; -+static const struct attribute_group *st_dev_groups[]; - - MODULE_AUTHOR("Kai Makisara"); - MODULE_DESCRIPTION("SCSI tape (st) driver"); -@@ -4274,7 +4274,7 @@ static void scsi_tape_release(struct kre - - static struct class st_sysfs_class = { - .name = "scsi_tape", -- .dev_attrs = st_dev_attrs, -+ .dev_groups = st_dev_groups, - }; - - static int __init init_st(void) -@@ -4408,6 +4408,7 @@ defined_show(struct device *dev, struct - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); - return l; - } -+static DEVICE_ATTR_RO(defined); - - static ssize_t - default_blksize_show(struct device *dev, struct device_attribute *attr, -@@ -4419,7 +4420,7 @@ default_blksize_show(struct device *dev, - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); - return l; - } -- -+static DEVICE_ATTR_RO(default_blksize); - - static ssize_t - default_density_show(struct device *dev, struct device_attribute *attr, -@@ -4433,6 +4434,7 @@ default_density_show(struct device *dev, - l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); - return l; - } -+static DEVICE_ATTR_RO(default_density); - - static ssize_t - default_compression_show(struct device *dev, struct device_attribute *attr, -@@ -4444,6 +4446,7 @@ default_compression_show(struct device * - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); - return l; - } -+static DEVICE_ATTR_RO(default_compression); - - static ssize_t - options_show(struct device *dev, struct device_attribute *attr, char *buf) -@@ -4472,15 +4475,17 @@ options_show(struct device *dev, struct - l = snprintf(buf, PAGE_SIZE, "0x%08x\n", options); - return l; - } -+static DEVICE_ATTR_RO(options); - --static struct device_attribute st_dev_attrs[] = { -- __ATTR_RO(defined), -- __ATTR_RO(default_blksize), -- __ATTR_RO(default_density), -- __ATTR_RO(default_compression), -- __ATTR_RO(options), -- __ATTR_NULL, -+static struct attribute *st_dev_attrs[] = { -+ &dev_attr_defined.attr, -+ &dev_attr_default_blksize.attr, -+ &dev_attr_default_density.attr, -+ &dev_attr_default_compression.attr, -+ &dev_attr_options.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(st_dev); - - /* The following functions may be useful for a larger audience. */ - static int sgl_map_user_pages(struct st_buffer *STbp, ---- a/drivers/staging/comedi/comedi_fops.c -+++ b/drivers/staging/comedi/comedi_fops.c -@@ -262,7 +262,7 @@ static int resize_async_buffer(struct co - - /* sysfs attribute files */ - --static ssize_t show_max_read_buffer_kb(struct device *csdev, -+static ssize_t max_read_buffer_kb_show(struct device *csdev, - struct device_attribute *attr, char *buf) - { - unsigned int minor = MINOR(csdev->devt); -@@ -283,7 +283,7 @@ static ssize_t show_max_read_buffer_kb(s - return snprintf(buf, PAGE_SIZE, "%i\n", size); - } - --static ssize_t store_max_read_buffer_kb(struct device *csdev, -+static ssize_t max_read_buffer_kb_store(struct device *csdev, - struct device_attribute *attr, - const char *buf, size_t count) - { -@@ -314,8 +314,9 @@ static ssize_t store_max_read_buffer_kb( - - return err ? err : count; - } -+static DEVICE_ATTR_RW(max_read_buffer_kb); - --static ssize_t show_read_buffer_kb(struct device *csdev, -+static ssize_t read_buffer_kb_show(struct device *csdev, - struct device_attribute *attr, char *buf) - { - unsigned int minor = MINOR(csdev->devt); -@@ -336,7 +337,7 @@ static ssize_t show_read_buffer_kb(struc - return snprintf(buf, PAGE_SIZE, "%i\n", size); - } - --static ssize_t store_read_buffer_kb(struct device *csdev, -+static ssize_t read_buffer_kb_store(struct device *csdev, - struct device_attribute *attr, - const char *buf, size_t count) - { -@@ -367,8 +368,9 @@ static ssize_t store_read_buffer_kb(stru - - return err ? err : count; - } -+static DEVICE_ATTR_RW(read_buffer_kb); - --static ssize_t show_max_write_buffer_kb(struct device *csdev, -+static ssize_t max_write_buffer_kb_show(struct device *csdev, - struct device_attribute *attr, - char *buf) - { -@@ -390,7 +392,7 @@ static ssize_t show_max_write_buffer_kb( - return snprintf(buf, PAGE_SIZE, "%i\n", size); - } - --static ssize_t store_max_write_buffer_kb(struct device *csdev, -+static ssize_t max_write_buffer_kb_store(struct device *csdev, - struct device_attribute *attr, - const char *buf, size_t count) - { -@@ -421,8 +423,9 @@ static ssize_t store_max_write_buffer_kb - - return err ? err : count; - } -+static DEVICE_ATTR_RW(max_write_buffer_kb); - --static ssize_t show_write_buffer_kb(struct device *csdev, -+static ssize_t write_buffer_kb_show(struct device *csdev, - struct device_attribute *attr, char *buf) - { - unsigned int minor = MINOR(csdev->devt); -@@ -443,7 +446,7 @@ static ssize_t show_write_buffer_kb(stru - return snprintf(buf, PAGE_SIZE, "%i\n", size); - } - --static ssize_t store_write_buffer_kb(struct device *csdev, -+static ssize_t write_buffer_kb_store(struct device *csdev, - struct device_attribute *attr, - const char *buf, size_t count) - { -@@ -474,18 +477,16 @@ static ssize_t store_write_buffer_kb(str - - return err ? err : count; - } -+static DEVICE_ATTR_RW(write_buffer_kb); - --static struct device_attribute comedi_dev_attrs[] = { -- __ATTR(max_read_buffer_kb, S_IRUGO | S_IWUSR, -- show_max_read_buffer_kb, store_max_read_buffer_kb), -- __ATTR(read_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP, -- show_read_buffer_kb, store_read_buffer_kb), -- __ATTR(max_write_buffer_kb, S_IRUGO | S_IWUSR, -- show_max_write_buffer_kb, store_max_write_buffer_kb), -- __ATTR(write_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP, -- show_write_buffer_kb, store_write_buffer_kb), -- __ATTR_NULL -+static struct attribute *comedi_dev_attrs[] = { -+ &dev_attr_max_read_buffer_kb.attr, -+ &dev_attr_read_buffer_kb.attr, -+ &dev_attr_max_write_buffer_kb.attr, -+ &dev_attr_write_buffer_kb.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(comedi_dev); - - static void comedi_set_subdevice_runflags(struct comedi_subdevice *s, - unsigned mask, unsigned bits) -@@ -2554,7 +2555,7 @@ static int __init comedi_init(void) - return PTR_ERR(comedi_class); - } - -- comedi_class->dev_attrs = comedi_dev_attrs; -+ comedi_class->dev_groups = comedi_dev_groups; - - /* XXX requires /proc interface */ - comedi_proc_init(); ---- a/drivers/uio/uio.c -+++ b/drivers/uio/uio.c -@@ -224,38 +224,42 @@ static struct kobj_type portio_attr_type - .default_attrs = portio_attrs, - }; - --static ssize_t show_name(struct device *dev, -+static ssize_t name_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", idev->info->name); - } -+static DEVICE_ATTR_RO(name); - --static ssize_t show_version(struct device *dev, -+static ssize_t version_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", idev->info->version); - } -+static DEVICE_ATTR_RO(version); - --static ssize_t show_event(struct device *dev, -+static ssize_t event_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct uio_device *idev = dev_get_drvdata(dev); - return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event)); - } -+static DEVICE_ATTR_RO(event); - --static struct device_attribute uio_class_attributes[] = { -- __ATTR(name, S_IRUGO, show_name, NULL), -- __ATTR(version, S_IRUGO, show_version, NULL), -- __ATTR(event, S_IRUGO, show_event, NULL), -- {} -+static struct attribute *uio_attrs[] = { -+ &dev_attr_name.attr, -+ &dev_attr_version.attr, -+ &dev_attr_event.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(uio); - - /* UIO class infrastructure */ - static struct class uio_class = { - .name = "uio", -- .dev_attrs = uio_class_attributes, -+ .dev_groups = uio_groups, - }; - - /* ---- a/drivers/video/backlight/backlight.c -+++ b/drivers/video/backlight/backlight.c -@@ -103,16 +103,16 @@ static void backlight_generate_event(str - sysfs_notify(&bd->dev.kobj, NULL, "actual_brightness"); - } - --static ssize_t backlight_show_power(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t bl_power_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%d\n", bd->props.power); - } - --static ssize_t backlight_store_power(struct device *dev, -- struct device_attribute *attr, const char *buf, size_t count) -+static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - int rc; - struct backlight_device *bd = to_backlight_device(dev); -@@ -136,8 +136,9 @@ static ssize_t backlight_store_power(str - - return rc; - } -+static DEVICE_ATTR_RW(bl_power); - --static ssize_t backlight_show_brightness(struct device *dev, -+static ssize_t brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); -@@ -145,7 +146,7 @@ static ssize_t backlight_show_brightness - return sprintf(buf, "%d\n", bd->props.brightness); - } - --static ssize_t backlight_store_brightness(struct device *dev, -+static ssize_t brightness_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -175,24 +176,27 @@ static ssize_t backlight_store_brightnes - - return rc; - } -+static DEVICE_ATTR_RW(brightness); - --static ssize_t backlight_show_type(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t type_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%s\n", backlight_types[bd->props.type]); - } -+static DEVICE_ATTR_RO(type); - --static ssize_t backlight_show_max_brightness(struct device *dev, -+static ssize_t max_brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%d\n", bd->props.max_brightness); - } -+static DEVICE_ATTR_RO(max_brightness); - --static ssize_t backlight_show_actual_brightness(struct device *dev, -+static ssize_t actual_brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - int rc = -ENXIO; -@@ -205,6 +209,7 @@ static ssize_t backlight_show_actual_bri - - return rc; - } -+static DEVICE_ATTR_RO(actual_brightness); - - static struct class *backlight_class; - -@@ -247,16 +252,15 @@ static void bl_device_release(struct dev - kfree(bd); - } - --static struct device_attribute bl_device_attributes[] = { -- __ATTR(bl_power, 0644, backlight_show_power, backlight_store_power), -- __ATTR(brightness, 0644, backlight_show_brightness, -- backlight_store_brightness), -- __ATTR(actual_brightness, 0444, backlight_show_actual_brightness, -- NULL), -- __ATTR(max_brightness, 0444, backlight_show_max_brightness, NULL), -- __ATTR(type, 0444, backlight_show_type, NULL), -- __ATTR_NULL, -+static struct attribute *bl_device_attrs[] = { -+ &dev_attr_bl_power.attr, -+ &dev_attr_brightness.attr, -+ &dev_attr_actual_brightness.attr, -+ &dev_attr_max_brightness.attr, -+ &dev_attr_type.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(bl_device); - - /** - * backlight_force_update - tell the backlight subsystem that hardware state -@@ -493,7 +497,7 @@ static int __init backlight_class_init(v - return PTR_ERR(backlight_class); - } - -- backlight_class->dev_attrs = bl_device_attributes; -+ backlight_class->dev_groups = bl_device_groups; - backlight_class->pm = &backlight_class_dev_pm_ops; - return 0; - } ---- a/drivers/video/backlight/lcd.c -+++ b/drivers/video/backlight/lcd.c -@@ -89,7 +89,7 @@ static inline void lcd_unregister_fb(str - } - #endif /* CONFIG_FB */ - --static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, -+static ssize_t lcd_power_show(struct device *dev, struct device_attribute *attr, - char *buf) - { - int rc; -@@ -105,7 +105,7 @@ static ssize_t lcd_show_power(struct dev - return rc; - } - --static ssize_t lcd_store_power(struct device *dev, -+static ssize_t lcd_power_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -128,8 +128,9 @@ static ssize_t lcd_store_power(struct de - - return rc; - } -+static DEVICE_ATTR_RW(lcd_power); - --static ssize_t lcd_show_contrast(struct device *dev, -+static ssize_t contrast_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - int rc = -ENXIO; -@@ -143,7 +144,7 @@ static ssize_t lcd_show_contrast(struct - return rc; - } - --static ssize_t lcd_store_contrast(struct device *dev, -+static ssize_t contrast_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -166,14 +167,16 @@ static ssize_t lcd_store_contrast(struct - - return rc; - } -+static DEVICE_ATTR_RW(contrast); - --static ssize_t lcd_show_max_contrast(struct device *dev, -+static ssize_t max_contrast_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct lcd_device *ld = to_lcd_device(dev); - - return sprintf(buf, "%d\n", ld->props.max_contrast); - } -+static DEVICE_ATTR_RO(max_contrast); - - static struct class *lcd_class; - -@@ -183,12 +186,13 @@ static void lcd_device_release(struct de - kfree(ld); - } - --static struct device_attribute lcd_device_attributes[] = { -- __ATTR(lcd_power, 0644, lcd_show_power, lcd_store_power), -- __ATTR(contrast, 0644, lcd_show_contrast, lcd_store_contrast), -- __ATTR(max_contrast, 0444, lcd_show_max_contrast, NULL), -- __ATTR_NULL, -+static struct attribute *lcd_device_attrs[] = { -+ &dev_attr_lcd_power.attr, -+ &dev_attr_contrast.attr, -+ &dev_attr_max_contrast.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(lcd_device); - - /** - * lcd_device_register - register a new object of lcd_device class. -@@ -344,7 +348,7 @@ static int __init lcd_class_init(void) - return PTR_ERR(lcd_class); - } - -- lcd_class->dev_attrs = lcd_device_attributes; -+ lcd_class->dev_groups = lcd_device_groups; - return 0; - } - --- a/drivers/video/output.c +++ b/drivers/video/output.c @@ -32,8 +32,8 @@ MODULE_DESCRIPTION("Display Output Switc @@ -849,88 +61,6 @@ }; struct output_device *video_output_register(const char *name, ---- a/fs/fuse/cuse.c -+++ b/fs/fuse/cuse.c -@@ -568,6 +568,7 @@ static ssize_t cuse_class_waiting_show(s - - return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting)); - } -+static DEVICE_ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL); - - static ssize_t cuse_class_abort_store(struct device *dev, - struct device_attribute *attr, -@@ -578,12 +579,14 @@ static ssize_t cuse_class_abort_store(st - fuse_abort_conn(&cc->fc); - return count; - } -+static DEVICE_ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store); - --static struct device_attribute cuse_class_dev_attrs[] = { -- __ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL), -- __ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store), -- { } -+static struct attribute *cuse_class_dev_attrs[] = { -+ &dev_attr_waiting.attr, -+ &dev_attr_abort.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(cuse_class_dev); - - static struct miscdevice cuse_miscdev = { - .minor = MISC_DYNAMIC_MINOR, -@@ -609,7 +612,7 @@ static int __init cuse_init(void) - if (IS_ERR(cuse_class)) - return PTR_ERR(cuse_class); - -- cuse_class->dev_attrs = cuse_class_dev_attrs; -+ cuse_class->dev_groups = cuse_class_dev_groups; - - rc = misc_register(&cuse_miscdev); - if (rc) { ---- a/mm/backing-dev.c -+++ b/mm/backing-dev.c -@@ -180,7 +180,8 @@ static ssize_t name##_show(struct device - struct backing_dev_info *bdi = dev_get_drvdata(dev); \ - \ - return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \ --} -+} \ -+static DEVICE_ATTR_RW(name); - - BDI_SHOW(read_ahead_kb, K(bdi->ra_pages)) - -@@ -231,14 +232,16 @@ static ssize_t stable_pages_required_sho - return snprintf(page, PAGE_SIZE-1, "%d\n", - bdi_cap_stable_pages_required(bdi) ? 1 : 0); - } -+static DEVICE_ATTR_RO(stable_pages_required); - --static struct device_attribute bdi_dev_attrs[] = { -- __ATTR_RW(read_ahead_kb), -- __ATTR_RW(min_ratio), -- __ATTR_RW(max_ratio), -- __ATTR_RO(stable_pages_required), -- __ATTR_NULL, -+static struct attribute *bdi_dev_attrs[] = { -+ &dev_attr_read_ahead_kb.attr, -+ &dev_attr_min_ratio.attr, -+ &dev_attr_max_ratio.attr, -+ &dev_attr_stable_pages_required.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(bdi_dev); - - static __init int bdi_class_init(void) - { -@@ -246,7 +249,7 @@ static __init int bdi_class_init(void) - if (IS_ERR(bdi_class)) - return PTR_ERR(bdi_class); - -- bdi_class->dev_attrs = bdi_dev_attrs; -+ bdi_class->dev_groups = bdi_dev_groups; - bdi_debug_init(); - return 0; - } --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -60,12 +60,19 @@ static ssize_t format_##field(const stru diff --git a/d2.patch b/d2.patch index 509cf6956cdc98..e7fb43fd6edcba 100644 --- a/d2.patch +++ b/d2.patch @@ -1,42 +1,602 @@ --- - fs/fuse/cuse.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) + net/core/net-sysfs.c | 134 ++++++++++++++++++++++++-------------------- + net/ieee802154/wpan-class.c | 21 +++--- + net/rfkill/core.c | 88 +++++++++++++--------------- + net/wireless/sysfs.c | 23 ++++--- + 4 files changed, 139 insertions(+), 127 deletions(-) ---- a/fs/fuse/cuse.c -+++ b/fs/fuse/cuse.c -@@ -568,6 +568,7 @@ static ssize_t cuse_class_waiting_show(s +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -60,12 +60,19 @@ static ssize_t format_##field(const stru + { \ + return sprintf(buf, format_string, net->field); \ + } \ +-static ssize_t show_##field(struct device *dev, \ ++static ssize_t field##_show(struct device *dev, \ + struct device_attribute *attr, char *buf) \ + { \ + return netdev_show(dev, attr, buf, format_##field); \ +-} ++} \ - return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting)); ++#define NETDEVICE_SHOW_RO(field, format_string) \ ++NETDEVICE_SHOW(field, format_string); \ ++static DEVICE_ATTR_RO(field) ++ ++#define NETDEVICE_SHOW_RW(field, format_string) \ ++NETDEVICE_SHOW(field, format_string); \ ++static DEVICE_ATTR_RW(field) + + /* use same locking and permission rules as SIF* ioctl's */ + static ssize_t netdev_store(struct device *dev, struct device_attribute *attr, +@@ -96,16 +103,16 @@ static ssize_t netdev_store(struct devic + return ret; + } + +-NETDEVICE_SHOW(dev_id, fmt_hex); +-NETDEVICE_SHOW(addr_assign_type, fmt_dec); +-NETDEVICE_SHOW(addr_len, fmt_dec); +-NETDEVICE_SHOW(iflink, fmt_dec); +-NETDEVICE_SHOW(ifindex, fmt_dec); +-NETDEVICE_SHOW(type, fmt_dec); +-NETDEVICE_SHOW(link_mode, fmt_dec); ++NETDEVICE_SHOW_RO(dev_id, fmt_hex); ++NETDEVICE_SHOW_RO(addr_assign_type, fmt_dec); ++NETDEVICE_SHOW_RO(addr_len, fmt_dec); ++NETDEVICE_SHOW_RO(iflink, fmt_dec); ++NETDEVICE_SHOW_RO(ifindex, fmt_dec); ++NETDEVICE_SHOW_RO(type, fmt_dec); ++NETDEVICE_SHOW_RO(link_mode, fmt_dec); + + /* use same locking rules as GIFHWADDR ioctl's */ +-static ssize_t show_address(struct device *dev, struct device_attribute *attr, ++static ssize_t address_show(struct device *dev, struct device_attribute *attr, + char *buf) + { + struct net_device *net = to_net_dev(dev); +@@ -117,15 +124,17 @@ static ssize_t show_address(struct devic + read_unlock(&dev_base_lock); + return ret; + } ++static DEVICE_ATTR_RO(address); + +-static ssize_t show_broadcast(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t broadcast_show(struct device *dev, ++ struct device_attribute *attr, char *buf) + { + struct net_device *net = to_net_dev(dev); + if (dev_isalive(net)) + return sysfs_format_mac(buf, net->broadcast, net->addr_len); + return -EINVAL; + } ++static DEVICE_ATTR_RO(broadcast); + + static int change_carrier(struct net_device *net, unsigned long new_carrier) + { +@@ -134,13 +143,13 @@ static int change_carrier(struct net_dev + return dev_change_carrier(net, (bool) new_carrier); + } + +-static ssize_t store_carrier(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t len) ++static ssize_t carrier_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t len) + { + return netdev_store(dev, attr, buf, len, change_carrier); + } + +-static ssize_t show_carrier(struct device *dev, ++static ssize_t carrier_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct net_device *netdev = to_net_dev(dev); +@@ -149,8 +158,9 @@ static ssize_t show_carrier(struct devic + } + return -EINVAL; + } ++static DEVICE_ATTR_RW(carrier); + +-static ssize_t show_speed(struct device *dev, ++static ssize_t speed_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct net_device *netdev = to_net_dev(dev); +@@ -167,8 +177,9 @@ static ssize_t show_speed(struct device + rtnl_unlock(); + return ret; + } ++static DEVICE_ATTR_RO(speed); + +-static ssize_t show_duplex(struct device *dev, ++static ssize_t duplex_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct net_device *netdev = to_net_dev(dev); +@@ -198,8 +209,9 @@ static ssize_t show_duplex(struct device + rtnl_unlock(); + return ret; + } ++static DEVICE_ATTR_RO(duplex); + +-static ssize_t show_dormant(struct device *dev, ++static ssize_t dormant_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct net_device *netdev = to_net_dev(dev); +@@ -209,6 +221,7 @@ static ssize_t show_dormant(struct devic + + return -EINVAL; + } ++static DEVICE_ATTR_RO(dormant); + + static const char *const operstates[] = { + "unknown", +@@ -220,7 +233,7 @@ static const char *const operstates[] = + "up" + }; + +-static ssize_t show_operstate(struct device *dev, ++static ssize_t operstate_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + const struct net_device *netdev = to_net_dev(dev); +@@ -237,35 +250,33 @@ static ssize_t show_operstate(struct dev + + return sprintf(buf, "%s\n", operstates[operstate]); + } ++static DEVICE_ATTR_RO(operstate); + + /* read-write attributes */ +-NETDEVICE_SHOW(mtu, fmt_dec); + + static int change_mtu(struct net_device *net, unsigned long new_mtu) + { + return dev_set_mtu(net, (int) new_mtu); + } + +-static ssize_t store_mtu(struct device *dev, struct device_attribute *attr, ++static ssize_t mtu_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) + { + return netdev_store(dev, attr, buf, len, change_mtu); + } +- +-NETDEVICE_SHOW(flags, fmt_hex); ++NETDEVICE_SHOW_RW(mtu, fmt_dec); + + static int change_flags(struct net_device *net, unsigned long new_flags) + { + return dev_change_flags(net, (unsigned int) new_flags); + } + +-static ssize_t store_flags(struct device *dev, struct device_attribute *attr, ++static ssize_t flags_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) + { + return netdev_store(dev, attr, buf, len, change_flags); + } +- +-NETDEVICE_SHOW(tx_queue_len, fmt_ulong); ++NETDEVICE_SHOW_RW(flags, fmt_hex); + + static int change_tx_queue_len(struct net_device *net, unsigned long new_len) + { +@@ -273,7 +284,7 @@ static int change_tx_queue_len(struct ne + return 0; + } + +-static ssize_t store_tx_queue_len(struct device *dev, ++static ssize_t tx_queue_len_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) + { +@@ -282,8 +293,9 @@ static ssize_t store_tx_queue_len(struct + + return netdev_store(dev, attr, buf, len, change_tx_queue_len); + } ++NETDEVICE_SHOW_RW(tx_queue_len, fmt_ulong); + +-static ssize_t store_ifalias(struct device *dev, struct device_attribute *attr, ++static ssize_t ifalias_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) + { + struct net_device *netdev = to_net_dev(dev); +@@ -306,7 +318,7 @@ static ssize_t store_ifalias(struct devi + return ret < 0 ? ret : len; + } + +-static ssize_t show_ifalias(struct device *dev, ++static ssize_t ifalias_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + const struct net_device *netdev = to_net_dev(dev); +@@ -319,8 +331,7 @@ static ssize_t show_ifalias(struct devic + rtnl_unlock(); + return ret; + } +- +-NETDEVICE_SHOW(group, fmt_dec); ++static DEVICE_ATTR_RW(ifalias); + + static int change_group(struct net_device *net, unsigned long new_group) + { +@@ -328,35 +339,37 @@ static int change_group(struct net_devic + return 0; + } + +-static ssize_t store_group(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t len) ++static ssize_t group_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t len) + { + return netdev_store(dev, attr, buf, len, change_group); + } ++NETDEVICE_SHOW(group, fmt_dec); ++static DEVICE_ATTR(netdev_group, S_IRUGO | S_IWUSR, group_show, group_store); + +-static struct device_attribute net_class_attributes[] = { +- __ATTR(addr_assign_type, S_IRUGO, show_addr_assign_type, NULL), +- __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), +- __ATTR(dev_id, S_IRUGO, show_dev_id, NULL), +- __ATTR(ifalias, S_IRUGO | S_IWUSR, show_ifalias, store_ifalias), +- __ATTR(iflink, S_IRUGO, show_iflink, NULL), +- __ATTR(ifindex, S_IRUGO, show_ifindex, NULL), +- __ATTR(type, S_IRUGO, show_type, NULL), +- __ATTR(link_mode, S_IRUGO, show_link_mode, NULL), +- __ATTR(address, S_IRUGO, show_address, NULL), +- __ATTR(broadcast, S_IRUGO, show_broadcast, NULL), +- __ATTR(carrier, S_IRUGO | S_IWUSR, show_carrier, store_carrier), +- __ATTR(speed, S_IRUGO, show_speed, NULL), +- __ATTR(duplex, S_IRUGO, show_duplex, NULL), +- __ATTR(dormant, S_IRUGO, show_dormant, NULL), +- __ATTR(operstate, S_IRUGO, show_operstate, NULL), +- __ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu), +- __ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags), +- __ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, +- store_tx_queue_len), +- __ATTR(netdev_group, S_IRUGO | S_IWUSR, show_group, store_group), +- {} ++static struct attribute *net_class_attrs[] = { ++ &dev_attr_netdev_group.attr, ++ &dev_attr_type.attr, ++ &dev_attr_dev_id.attr, ++ &dev_attr_iflink.attr, ++ &dev_attr_ifindex.attr, ++ &dev_attr_addr_assign_type.attr, ++ &dev_attr_addr_len.attr, ++ &dev_attr_link_mode.attr, ++ &dev_attr_address.attr, ++ &dev_attr_broadcast.attr, ++ &dev_attr_speed.attr, ++ &dev_attr_duplex.attr, ++ &dev_attr_dormant.attr, ++ &dev_attr_operstate.attr, ++ &dev_attr_ifalias.attr, ++ &dev_attr_carrier.attr, ++ &dev_attr_mtu.attr, ++ &dev_attr_flags.attr, ++ &dev_attr_tx_queue_len.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(net_class); + + /* Show a given an attribute in the statistics group */ + static ssize_t netstat_show(const struct device *d, +@@ -382,13 +395,13 @@ static ssize_t netstat_show(const struct + + /* generate a read-only statistics attribute */ + #define NETSTAT_ENTRY(name) \ +-static ssize_t show_##name(struct device *d, \ ++static ssize_t name##_show(struct device *d, \ + struct device_attribute *attr, char *buf) \ + { \ + return netstat_show(d, attr, buf, \ + offsetof(struct rtnl_link_stats64, name)); \ + } \ +-static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) ++static DEVICE_ATTR_RO(name) + + NETSTAT_ENTRY(rx_packets); + NETSTAT_ENTRY(tx_packets); +@@ -457,6 +470,9 @@ static struct attribute_group wireless_g + .attrs = wireless_attrs, + }; + #endif ++ ++#else /* CONFIG_SYSFS */ ++#define net_class_groups NULL + #endif /* CONFIG_SYSFS */ + + #ifdef CONFIG_RPS +@@ -1229,9 +1245,7 @@ static const void *net_namespace(struct + static struct class net_class = { + .name = "net", + .dev_release = netdev_release, +-#ifdef CONFIG_SYSFS +- .dev_attrs = net_class_attributes, +-#endif /* CONFIG_SYSFS */ ++ .dev_groups = net_class_groups, + .dev_uevent = netdev_uevent, + .ns_type = &net_ns_type_operations, + .namespace = net_namespace, +--- a/net/ieee802154/wpan-class.c ++++ b/net/ieee802154/wpan-class.c +@@ -36,7 +36,8 @@ static ssize_t name ## _show(struct devi + ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \ + mutex_unlock(&phy->pib_lock); \ + return ret; \ +-} ++} \ ++static DEVICE_ATTR_RO(name); + + #define MASTER_SHOW(field, format_string) \ + MASTER_SHOW_COMPLEX(field, format_string, phy->field) +@@ -66,15 +67,17 @@ static ssize_t channels_supported_show(s + mutex_unlock(&phy->pib_lock); + return len; + } ++static DEVICE_ATTR_RO(channels_supported); + +-static struct device_attribute pmib_attrs[] = { +- __ATTR_RO(current_channel), +- __ATTR_RO(current_page), +- __ATTR_RO(channels_supported), +- __ATTR_RO(transmit_power), +- __ATTR_RO(cca_mode), +- {}, ++static struct attribute *pmib_attrs[] = { ++ &dev_attr_current_channel.attr, ++ &dev_attr_current_page.attr, ++ &dev_attr_channels_supported.attr, ++ &dev_attr_transmit_power.attr, ++ &dev_attr_cca_mode.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(pmib); + + static void wpan_phy_release(struct device *d) + { +@@ -85,7 +88,7 @@ static void wpan_phy_release(struct devi + static struct class wpan_phy_class = { + .name = "ieee802154", + .dev_release = wpan_phy_release, +- .dev_attrs = pmib_attrs, ++ .dev_groups = pmib_groups, + }; + + static DEFINE_MUTEX(wpan_phy_mutex); +--- a/net/rfkill/core.c ++++ b/net/rfkill/core.c +@@ -576,14 +576,14 @@ void rfkill_set_states(struct rfkill *rf + } + EXPORT_SYMBOL(rfkill_set_states); + +-static ssize_t rfkill_name_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t name_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%s\n", rfkill->name); + } ++static DEVICE_ATTR_RO(name); + + static const char *rfkill_get_type_str(enum rfkill_type type) + { +@@ -611,54 +611,52 @@ static const char *rfkill_get_type_str(e + } + } + +-static ssize_t rfkill_type_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t type_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%s\n", rfkill_get_type_str(rfkill->type)); + } ++static DEVICE_ATTR_RO(type); + +-static ssize_t rfkill_idx_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t index_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%d\n", rfkill->idx); + } ++static DEVICE_ATTR_RO(index); + +-static ssize_t rfkill_persistent_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t persistent_show(struct device *dev, ++ struct device_attribute *attr, char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%d\n", rfkill->persistent); } -+static DEVICE_ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL); ++static DEVICE_ATTR_RO(persistent); + +-static ssize_t rfkill_hard_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t hard_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 ); + } ++static DEVICE_ATTR_RO(hard); + +-static ssize_t rfkill_soft_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t soft_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0 ); + } + +-static ssize_t rfkill_soft_store(struct device *dev, +- struct device_attribute *attr, +- const char *buf, size_t count) ++static ssize_t soft_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct rfkill *rfkill = to_rfkill(dev); + unsigned long state; +@@ -680,6 +678,7 @@ static ssize_t rfkill_soft_store(struct - static ssize_t cuse_class_abort_store(struct device *dev, - struct device_attribute *attr, -@@ -578,12 +579,14 @@ static ssize_t cuse_class_abort_store(st - fuse_abort_conn(&cc->fc); return count; } -+static DEVICE_ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store); ++static DEVICE_ATTR_RW(soft); + + static u8 user_state_from_blocked(unsigned long state) + { +@@ -691,18 +690,16 @@ static u8 user_state_from_blocked(unsign + return RFKILL_USER_STATE_UNBLOCKED; + } + +-static ssize_t rfkill_state_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t state_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct rfkill *rfkill = to_rfkill(dev); + + return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state)); + } + +-static ssize_t rfkill_state_store(struct device *dev, +- struct device_attribute *attr, +- const char *buf, size_t count) ++static ssize_t state_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct rfkill *rfkill = to_rfkill(dev); + unsigned long state; +@@ -725,32 +722,27 @@ static ssize_t rfkill_state_store(struct --static struct device_attribute cuse_class_dev_attrs[] = { -- __ATTR(waiting, S_IFREG | 0400, cuse_class_waiting_show, NULL), -- __ATTR(abort, S_IFREG | 0200, NULL, cuse_class_abort_store), -- { } -+static struct attribute *cuse_class_dev_attrs[] = { -+ &dev_attr_waiting.attr, -+ &dev_attr_abort.attr, + return count; + } ++static DEVICE_ATTR_RW(state); + +-static ssize_t rfkill_claim_show(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t claim_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + return sprintf(buf, "%d\n", 0); + } ++static DEVICE_ATTR_RO(claim); + +-static ssize_t rfkill_claim_store(struct device *dev, +- struct device_attribute *attr, +- const char *buf, size_t count) +-{ +- return -EOPNOTSUPP; +-} +- +-static struct device_attribute rfkill_dev_attrs[] = { +- __ATTR(name, S_IRUGO, rfkill_name_show, NULL), +- __ATTR(type, S_IRUGO, rfkill_type_show, NULL), +- __ATTR(index, S_IRUGO, rfkill_idx_show, NULL), +- __ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL), +- __ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store), +- __ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store), +- __ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store), +- __ATTR(hard, S_IRUGO, rfkill_hard_show, NULL), +- __ATTR_NULL ++static struct attribute *rfkill_dev_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_type.attr, ++ &dev_attr_index.attr, ++ &dev_attr_persistent.attr, ++ &dev_attr_state.attr, ++ &dev_attr_claim.attr, ++ &dev_attr_soft.attr, ++ &dev_attr_hard.attr, + NULL, }; -+ATTRIBUTE_GROUPS(cuse_class_dev); ++ATTRIBUTE_GROUPS(rfkill_dev); + + static void rfkill_release(struct device *dev) + { +@@ -830,7 +822,7 @@ static int rfkill_resume(struct device * + static struct class rfkill_class = { + .name = "rfkill", + .dev_release = rfkill_release, +- .dev_attrs = rfkill_dev_attrs, ++ .dev_groups = rfkill_dev_groups, + .dev_uevent = rfkill_dev_uevent, + .suspend = rfkill_suspend, + .resume = rfkill_resume, +--- a/net/wireless/sysfs.c ++++ b/net/wireless/sysfs.c +@@ -30,7 +30,8 @@ static ssize_t name ## _show(struct devi + char *buf) \ + { \ + return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \ +-} ++} \ ++static DEVICE_ATTR_RO(name) - static struct miscdevice cuse_miscdev = { - .minor = MISC_DYNAMIC_MINOR, -@@ -609,7 +612,7 @@ static int __init cuse_init(void) - if (IS_ERR(cuse_class)) - return PTR_ERR(cuse_class); + SHOW_FMT(index, "%d", wiphy_idx); + SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); +@@ -42,7 +43,7 @@ static ssize_t name_show(struct device * + struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; + return sprintf(buf, "%s\n", dev_name(&wiphy->dev)); + } +- ++static DEVICE_ATTR_RO(name); + + static ssize_t addresses_show(struct device *dev, + struct device_attribute *attr, +@@ -60,15 +61,17 @@ static ssize_t addresses_show(struct dev + + return buf - start; + } ++static DEVICE_ATTR_RO(addresses); -- cuse_class->dev_attrs = cuse_class_dev_attrs; -+ cuse_class->dev_groups = cuse_class_dev_groups; +-static struct device_attribute ieee80211_dev_attrs[] = { +- __ATTR_RO(index), +- __ATTR_RO(macaddress), +- __ATTR_RO(address_mask), +- __ATTR_RO(addresses), +- __ATTR_RO(name), +- {} ++static struct attribute *ieee80211_attrs[] = { ++ &dev_attr_index.attr, ++ &dev_attr_macaddress.attr, ++ &dev_attr_address_mask.attr, ++ &dev_attr_addresses.attr, ++ &dev_attr_name.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ieee80211); - rc = misc_register(&cuse_miscdev); - if (rc) { + static void wiphy_dev_release(struct device *dev) + { +@@ -144,7 +147,7 @@ struct class ieee80211_class = { + .name = "ieee80211", + .owner = THIS_MODULE, + .dev_release = wiphy_dev_release, +- .dev_attrs = ieee80211_dev_attrs, ++ .dev_groups = ieee80211_groups, + .dev_uevent = wiphy_uevent, + .suspend = wiphy_suspend, + .resume = wiphy_resume, diff --git a/d5.patch b/d5.patch deleted file mode 100644 index ae3bd2dd4a842f..00000000000000 --- a/d5.patch +++ /dev/null @@ -1,1272 +0,0 @@ ---- - drivers/scsi/osd/osd_uld.c | 13 +-- - drivers/scsi/sd.c | 147 ++++++++++++++++++------------------ - drivers/scsi/st.c | 25 +++--- - drivers/video/backlight/backlight.c | 44 +++++----- - drivers/video/backlight/lcd.c | 26 +++--- - drivers/video/output.c | 20 ++-- - net/core/net-sysfs.c | 134 ++++++++++++++++++-------------- - net/ieee802154/wpan-class.c | 21 ++--- - net/rfkill/core.c | 88 +++++++++------------ - net/wireless/sysfs.c | 23 +++-- - 10 files changed, 285 insertions(+), 256 deletions(-) - ---- a/drivers/scsi/osd/osd_uld.c -+++ b/drivers/scsi/osd/osd_uld.c -@@ -107,6 +107,7 @@ static ssize_t osdname_show(struct devic - class_dev); - return sprintf(buf, "%s\n", ould->odi.osdname); - } -+static DEVICE_ATTR_RO(osdname); - - static ssize_t systemid_show(struct device *dev, struct device_attribute *attr, - char *buf) -@@ -117,17 +118,19 @@ static ssize_t systemid_show(struct devi - memcpy(buf, ould->odi.systemid, ould->odi.systemid_len); - return ould->odi.systemid_len; - } -+static DEVICE_ATTR_RO(systemid); - --static struct device_attribute osd_uld_attrs[] = { -- __ATTR(osdname, S_IRUGO, osdname_show, NULL), -- __ATTR(systemid, S_IRUGO, systemid_show, NULL), -- __ATTR_NULL, -+static struct attribute *osd_uld_attrs[] = { -+ &dev_attr_osdname.attr, -+ &dev_attr_systemid.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(osd_uld); - - static struct class osd_uld_class = { - .owner = THIS_MODULE, - .name = "scsi_osd", -- .dev_attrs = osd_uld_attrs, -+ .dev_groups = osd_uld_groups, - }; - - /* ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -132,8 +132,8 @@ static const char *sd_cache_types[] = { - }; - - static ssize_t --sd_store_cache_type(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+cache_type_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - int i, ct = -1, rcd, wce, sp; - struct scsi_disk *sdkp = to_scsi_disk(dev); -@@ -199,8 +199,18 @@ sd_store_cache_type(struct device *dev, - } - - static ssize_t --sd_store_manage_start_stop(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+manage_start_stop_show(struct device *dev, struct device_attribute *attr, -+ char *buf) -+{ -+ struct scsi_disk *sdkp = to_scsi_disk(dev); -+ struct scsi_device *sdp = sdkp->device; -+ -+ return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); -+} -+ -+static ssize_t -+manage_start_stop_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -212,10 +222,19 @@ sd_store_manage_start_stop(struct device - - return count; - } -+static DEVICE_ATTR_RW(manage_start_stop); -+ -+static ssize_t -+allow_restart_show(struct device *dev, struct device_attribute *attr, char *buf) -+{ -+ struct scsi_disk *sdkp = to_scsi_disk(dev); -+ -+ return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); -+} - - static ssize_t --sd_store_allow_restart(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+allow_restart_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -230,47 +249,30 @@ sd_store_allow_restart(struct device *de - - return count; - } -+static DEVICE_ATTR_RW(allow_restart); - - static ssize_t --sd_show_cache_type(struct device *dev, struct device_attribute *attr, -- char *buf) -+cache_type_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - int ct = sdkp->RCD + 2*sdkp->WCE; - - return snprintf(buf, 40, "%s\n", sd_cache_types[ct]); - } -+static DEVICE_ATTR_RW(cache_type); - - static ssize_t --sd_show_fua(struct device *dev, struct device_attribute *attr, char *buf) -+FUA_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->DPOFUA); - } -+static DEVICE_ATTR_RO(FUA); - - static ssize_t --sd_show_manage_start_stop(struct device *dev, struct device_attribute *attr, -- char *buf) --{ -- struct scsi_disk *sdkp = to_scsi_disk(dev); -- struct scsi_device *sdp = sdkp->device; -- -- return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); --} -- --static ssize_t --sd_show_allow_restart(struct device *dev, struct device_attribute *attr, -- char *buf) --{ -- struct scsi_disk *sdkp = to_scsi_disk(dev); -- -- return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); --} -- --static ssize_t --sd_show_protection_type(struct device *dev, struct device_attribute *attr, -- char *buf) -+protection_type_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -278,8 +280,8 @@ sd_show_protection_type(struct device *d - } - - static ssize_t --sd_store_protection_type(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+protection_type_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - unsigned int val; -@@ -298,10 +300,11 @@ sd_store_protection_type(struct device * - - return count; - } -+static DEVICE_ATTR_RW(protection_type); - - static ssize_t --sd_show_protection_mode(struct device *dev, struct device_attribute *attr, -- char *buf) -+protection_mode_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -320,24 +323,26 @@ sd_show_protection_mode(struct device *d - - return snprintf(buf, 20, "%s%u\n", dix ? "dix" : "dif", dif); - } -+static DEVICE_ATTR_RO(protection_mode); - - static ssize_t --sd_show_app_tag_own(struct device *dev, struct device_attribute *attr, -- char *buf) -+app_tag_own_show(struct device *dev, struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->ATO); - } -+static DEVICE_ATTR_RO(app_tag_own); - - static ssize_t --sd_show_thin_provisioning(struct device *dev, struct device_attribute *attr, -- char *buf) -+thin_provisioning_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - - return snprintf(buf, 20, "%u\n", sdkp->lbpme); - } -+static DEVICE_ATTR_RO(thin_provisioning); - - static const char *lbp_mode[] = { - [SD_LBP_FULL] = "full", -@@ -349,8 +354,8 @@ static const char *lbp_mode[] = { - }; - - static ssize_t --sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr, -- char *buf) -+provisioning_mode_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -358,8 +363,8 @@ sd_show_provisioning_mode(struct device - } - - static ssize_t --sd_store_provisioning_mode(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+provisioning_mode_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -385,10 +390,11 @@ sd_store_provisioning_mode(struct device - - return count; - } -+static DEVICE_ATTR_RW(provisioning_mode); - - static ssize_t --sd_show_max_medium_access_timeouts(struct device *dev, -- struct device_attribute *attr, char *buf) -+max_medium_access_timeouts_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -396,9 +402,9 @@ sd_show_max_medium_access_timeouts(struc - } - - static ssize_t --sd_store_max_medium_access_timeouts(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+max_medium_access_timeouts_store(struct device *dev, -+ struct device_attribute *attr, const char *buf, -+ size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - int err; -@@ -410,10 +416,11 @@ sd_store_max_medium_access_timeouts(stru - - return err ? err : count; - } -+static DEVICE_ATTR_RW(max_medium_access_timeouts); - - static ssize_t --sd_show_write_same_blocks(struct device *dev, struct device_attribute *attr, -- char *buf) -+max_write_same_blocks_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - -@@ -421,8 +428,8 @@ sd_show_write_same_blocks(struct device - } - - static ssize_t --sd_store_write_same_blocks(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t count) -+max_write_same_blocks_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct scsi_disk *sdkp = to_scsi_disk(dev); - struct scsi_device *sdp = sdkp->device; -@@ -451,35 +458,29 @@ sd_store_write_same_blocks(struct device - - return count; - } -+static DEVICE_ATTR_RW(max_write_same_blocks); - --static struct device_attribute sd_disk_attrs[] = { -- __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, -- sd_store_cache_type), -- __ATTR(FUA, S_IRUGO, sd_show_fua, NULL), -- __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart, -- sd_store_allow_restart), -- __ATTR(manage_start_stop, S_IRUGO|S_IWUSR, sd_show_manage_start_stop, -- sd_store_manage_start_stop), -- __ATTR(protection_type, S_IRUGO|S_IWUSR, sd_show_protection_type, -- sd_store_protection_type), -- __ATTR(protection_mode, S_IRUGO, sd_show_protection_mode, NULL), -- __ATTR(app_tag_own, S_IRUGO, sd_show_app_tag_own, NULL), -- __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL), -- __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode, -- sd_store_provisioning_mode), -- __ATTR(max_write_same_blocks, S_IRUGO|S_IWUSR, -- sd_show_write_same_blocks, sd_store_write_same_blocks), -- __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR, -- sd_show_max_medium_access_timeouts, -- sd_store_max_medium_access_timeouts), -- __ATTR_NULL, -+static struct attribute *sd_disk_attrs[] = { -+ &dev_attr_cache_type.attr, -+ &dev_attr_FUA.attr, -+ &dev_attr_allow_restart.attr, -+ &dev_attr_manage_start_stop.attr, -+ &dev_attr_protection_type.attr, -+ &dev_attr_protection_mode.attr, -+ &dev_attr_app_tag_own.attr, -+ &dev_attr_thin_provisioning.attr, -+ &dev_attr_provisioning_mode.attr, -+ &dev_attr_max_write_same_blocks.attr, -+ &dev_attr_max_medium_access_timeouts.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(sd_disk); - - static struct class sd_disk_class = { - .name = "scsi_disk", - .owner = THIS_MODULE, - .dev_release = scsi_disk_release, -- .dev_attrs = sd_disk_attrs, -+ .dev_groups = sd_disk_groups, - }; - - static const struct dev_pm_ops sd_pm_ops = { ---- a/drivers/scsi/st.c -+++ b/drivers/scsi/st.c -@@ -82,7 +82,7 @@ static int try_rdio = 1; - static int try_wdio = 1; - - static struct class st_sysfs_class; --static struct device_attribute st_dev_attrs[]; -+static const struct attribute_group *st_dev_groups[]; - - MODULE_AUTHOR("Kai Makisara"); - MODULE_DESCRIPTION("SCSI tape (st) driver"); -@@ -4274,7 +4274,7 @@ static void scsi_tape_release(struct kre - - static struct class st_sysfs_class = { - .name = "scsi_tape", -- .dev_attrs = st_dev_attrs, -+ .dev_groups = st_dev_groups, - }; - - static int __init init_st(void) -@@ -4408,6 +4408,7 @@ defined_show(struct device *dev, struct - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); - return l; - } -+static DEVICE_ATTR_RO(defined); - - static ssize_t - default_blksize_show(struct device *dev, struct device_attribute *attr, -@@ -4419,7 +4420,7 @@ default_blksize_show(struct device *dev, - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); - return l; - } -- -+static DEVICE_ATTR_RO(default_blksize); - - static ssize_t - default_density_show(struct device *dev, struct device_attribute *attr, -@@ -4433,6 +4434,7 @@ default_density_show(struct device *dev, - l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); - return l; - } -+static DEVICE_ATTR_RO(default_density); - - static ssize_t - default_compression_show(struct device *dev, struct device_attribute *attr, -@@ -4444,6 +4446,7 @@ default_compression_show(struct device * - l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); - return l; - } -+static DEVICE_ATTR_RO(default_compression); - - static ssize_t - options_show(struct device *dev, struct device_attribute *attr, char *buf) -@@ -4472,15 +4475,17 @@ options_show(struct device *dev, struct - l = snprintf(buf, PAGE_SIZE, "0x%08x\n", options); - return l; - } -+static DEVICE_ATTR_RO(options); - --static struct device_attribute st_dev_attrs[] = { -- __ATTR_RO(defined), -- __ATTR_RO(default_blksize), -- __ATTR_RO(default_density), -- __ATTR_RO(default_compression), -- __ATTR_RO(options), -- __ATTR_NULL, -+static struct attribute *st_dev_attrs[] = { -+ &dev_attr_defined.attr, -+ &dev_attr_default_blksize.attr, -+ &dev_attr_default_density.attr, -+ &dev_attr_default_compression.attr, -+ &dev_attr_options.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(st_dev); - - /* The following functions may be useful for a larger audience. */ - static int sgl_map_user_pages(struct st_buffer *STbp, ---- a/drivers/video/backlight/backlight.c -+++ b/drivers/video/backlight/backlight.c -@@ -103,16 +103,16 @@ static void backlight_generate_event(str - sysfs_notify(&bd->dev.kobj, NULL, "actual_brightness"); - } - --static ssize_t backlight_show_power(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t bl_power_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%d\n", bd->props.power); - } - --static ssize_t backlight_store_power(struct device *dev, -- struct device_attribute *attr, const char *buf, size_t count) -+static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - int rc; - struct backlight_device *bd = to_backlight_device(dev); -@@ -136,8 +136,9 @@ static ssize_t backlight_store_power(str - - return rc; - } -+static DEVICE_ATTR_RW(bl_power); - --static ssize_t backlight_show_brightness(struct device *dev, -+static ssize_t brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); -@@ -145,7 +146,7 @@ static ssize_t backlight_show_brightness - return sprintf(buf, "%d\n", bd->props.brightness); - } - --static ssize_t backlight_store_brightness(struct device *dev, -+static ssize_t brightness_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -175,24 +176,27 @@ static ssize_t backlight_store_brightnes - - return rc; - } -+static DEVICE_ATTR_RW(brightness); - --static ssize_t backlight_show_type(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t type_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%s\n", backlight_types[bd->props.type]); - } -+static DEVICE_ATTR_RO(type); - --static ssize_t backlight_show_max_brightness(struct device *dev, -+static ssize_t max_brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct backlight_device *bd = to_backlight_device(dev); - - return sprintf(buf, "%d\n", bd->props.max_brightness); - } -+static DEVICE_ATTR_RO(max_brightness); - --static ssize_t backlight_show_actual_brightness(struct device *dev, -+static ssize_t actual_brightness_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - int rc = -ENXIO; -@@ -205,6 +209,7 @@ static ssize_t backlight_show_actual_bri - - return rc; - } -+static DEVICE_ATTR_RO(actual_brightness); - - static struct class *backlight_class; - -@@ -247,16 +252,15 @@ static void bl_device_release(struct dev - kfree(bd); - } - --static struct device_attribute bl_device_attributes[] = { -- __ATTR(bl_power, 0644, backlight_show_power, backlight_store_power), -- __ATTR(brightness, 0644, backlight_show_brightness, -- backlight_store_brightness), -- __ATTR(actual_brightness, 0444, backlight_show_actual_brightness, -- NULL), -- __ATTR(max_brightness, 0444, backlight_show_max_brightness, NULL), -- __ATTR(type, 0444, backlight_show_type, NULL), -- __ATTR_NULL, -+static struct attribute *bl_device_attrs[] = { -+ &dev_attr_bl_power.attr, -+ &dev_attr_brightness.attr, -+ &dev_attr_actual_brightness.attr, -+ &dev_attr_max_brightness.attr, -+ &dev_attr_type.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(bl_device); - - /** - * backlight_force_update - tell the backlight subsystem that hardware state -@@ -493,7 +497,7 @@ static int __init backlight_class_init(v - return PTR_ERR(backlight_class); - } - -- backlight_class->dev_attrs = bl_device_attributes; -+ backlight_class->dev_groups = bl_device_groups; - backlight_class->pm = &backlight_class_dev_pm_ops; - return 0; - } ---- a/drivers/video/backlight/lcd.c -+++ b/drivers/video/backlight/lcd.c -@@ -89,7 +89,7 @@ static inline void lcd_unregister_fb(str - } - #endif /* CONFIG_FB */ - --static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, -+static ssize_t lcd_power_show(struct device *dev, struct device_attribute *attr, - char *buf) - { - int rc; -@@ -105,7 +105,7 @@ static ssize_t lcd_show_power(struct dev - return rc; - } - --static ssize_t lcd_store_power(struct device *dev, -+static ssize_t lcd_power_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -128,8 +128,9 @@ static ssize_t lcd_store_power(struct de - - return rc; - } -+static DEVICE_ATTR_RW(lcd_power); - --static ssize_t lcd_show_contrast(struct device *dev, -+static ssize_t contrast_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - int rc = -ENXIO; -@@ -143,7 +144,7 @@ static ssize_t lcd_show_contrast(struct - return rc; - } - --static ssize_t lcd_store_contrast(struct device *dev, -+static ssize_t contrast_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) - { - int rc; -@@ -166,14 +167,16 @@ static ssize_t lcd_store_contrast(struct - - return rc; - } -+static DEVICE_ATTR_RW(contrast); - --static ssize_t lcd_show_max_contrast(struct device *dev, -+static ssize_t max_contrast_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct lcd_device *ld = to_lcd_device(dev); - - return sprintf(buf, "%d\n", ld->props.max_contrast); - } -+static DEVICE_ATTR_RO(max_contrast); - - static struct class *lcd_class; - -@@ -183,12 +186,13 @@ static void lcd_device_release(struct de - kfree(ld); - } - --static struct device_attribute lcd_device_attributes[] = { -- __ATTR(lcd_power, 0644, lcd_show_power, lcd_store_power), -- __ATTR(contrast, 0644, lcd_show_contrast, lcd_store_contrast), -- __ATTR(max_contrast, 0444, lcd_show_max_contrast, NULL), -- __ATTR_NULL, -+static struct attribute *lcd_device_attrs[] = { -+ &dev_attr_lcd_power.attr, -+ &dev_attr_contrast.attr, -+ &dev_attr_max_contrast.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(lcd_device); - - /** - * lcd_device_register - register a new object of lcd_device class. -@@ -344,7 +348,7 @@ static int __init lcd_class_init(void) - return PTR_ERR(lcd_class); - } - -- lcd_class->dev_attrs = lcd_device_attributes; -+ lcd_class->dev_groups = lcd_device_groups; - return 0; - } - ---- a/drivers/video/output.c -+++ b/drivers/video/output.c -@@ -32,8 +32,8 @@ MODULE_DESCRIPTION("Display Output Switc - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); - --static ssize_t video_output_show_state(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t state_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - ssize_t ret_size = 0; - struct output_device *od = to_output_device(dev); -@@ -42,9 +42,8 @@ static ssize_t video_output_show_state(s - return ret_size; - } - --static ssize_t video_output_store_state(struct device *dev, -- struct device_attribute *attr, -- const char *buf,size_t count) -+static ssize_t state_store(struct device *dev, struct device_attribute *attr, -+ const char *buf,size_t count) - { - char *endp; - struct output_device *od = to_output_device(dev); -@@ -62,6 +61,7 @@ static ssize_t video_output_store_state( - } - return count; - } -+static DEVICE_ATTR_RW(state); - - static void video_output_release(struct device *dev) - { -@@ -69,16 +69,16 @@ static void video_output_release(struct - kfree(od); - } - --static struct device_attribute video_output_attributes[] = { -- __ATTR(state, 0644, video_output_show_state, video_output_store_state), -- __ATTR_NULL, -+static struct attribute *video_output_attrs[] = { -+ &dev_attr_state.attr, -+ NULL, - }; -- -+ATTRIBUTE_GROUPS(video_output); - - static struct class video_output_class = { - .name = "video_output", - .dev_release = video_output_release, -- .dev_attrs = video_output_attributes, -+ .dev_groups = video_output_groups, - }; - - struct output_device *video_output_register(const char *name, ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -60,12 +60,19 @@ static ssize_t format_##field(const stru - { \ - return sprintf(buf, format_string, net->field); \ - } \ --static ssize_t show_##field(struct device *dev, \ -+static ssize_t field##_show(struct device *dev, \ - struct device_attribute *attr, char *buf) \ - { \ - return netdev_show(dev, attr, buf, format_##field); \ --} -+} \ - -+#define NETDEVICE_SHOW_RO(field, format_string) \ -+NETDEVICE_SHOW(field, format_string); \ -+static DEVICE_ATTR_RO(field) -+ -+#define NETDEVICE_SHOW_RW(field, format_string) \ -+NETDEVICE_SHOW(field, format_string); \ -+static DEVICE_ATTR_RW(field) - - /* use same locking and permission rules as SIF* ioctl's */ - static ssize_t netdev_store(struct device *dev, struct device_attribute *attr, -@@ -96,16 +103,16 @@ static ssize_t netdev_store(struct devic - return ret; - } - --NETDEVICE_SHOW(dev_id, fmt_hex); --NETDEVICE_SHOW(addr_assign_type, fmt_dec); --NETDEVICE_SHOW(addr_len, fmt_dec); --NETDEVICE_SHOW(iflink, fmt_dec); --NETDEVICE_SHOW(ifindex, fmt_dec); --NETDEVICE_SHOW(type, fmt_dec); --NETDEVICE_SHOW(link_mode, fmt_dec); -+NETDEVICE_SHOW_RO(dev_id, fmt_hex); -+NETDEVICE_SHOW_RO(addr_assign_type, fmt_dec); -+NETDEVICE_SHOW_RO(addr_len, fmt_dec); -+NETDEVICE_SHOW_RO(iflink, fmt_dec); -+NETDEVICE_SHOW_RO(ifindex, fmt_dec); -+NETDEVICE_SHOW_RO(type, fmt_dec); -+NETDEVICE_SHOW_RO(link_mode, fmt_dec); - - /* use same locking rules as GIFHWADDR ioctl's */ --static ssize_t show_address(struct device *dev, struct device_attribute *attr, -+static ssize_t address_show(struct device *dev, struct device_attribute *attr, - char *buf) - { - struct net_device *net = to_net_dev(dev); -@@ -117,15 +124,17 @@ static ssize_t show_address(struct devic - read_unlock(&dev_base_lock); - return ret; - } -+static DEVICE_ATTR_RO(address); - --static ssize_t show_broadcast(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t broadcast_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct net_device *net = to_net_dev(dev); - if (dev_isalive(net)) - return sysfs_format_mac(buf, net->broadcast, net->addr_len); - return -EINVAL; - } -+static DEVICE_ATTR_RO(broadcast); - - static int change_carrier(struct net_device *net, unsigned long new_carrier) - { -@@ -134,13 +143,13 @@ static int change_carrier(struct net_dev - return dev_change_carrier(net, (bool) new_carrier); - } - --static ssize_t store_carrier(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t len) -+static ssize_t carrier_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t len) - { - return netdev_store(dev, attr, buf, len, change_carrier); - } - --static ssize_t show_carrier(struct device *dev, -+static ssize_t carrier_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct net_device *netdev = to_net_dev(dev); -@@ -149,8 +158,9 @@ static ssize_t show_carrier(struct devic - } - return -EINVAL; - } -+static DEVICE_ATTR_RW(carrier); - --static ssize_t show_speed(struct device *dev, -+static ssize_t speed_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct net_device *netdev = to_net_dev(dev); -@@ -167,8 +177,9 @@ static ssize_t show_speed(struct device - rtnl_unlock(); - return ret; - } -+static DEVICE_ATTR_RO(speed); - --static ssize_t show_duplex(struct device *dev, -+static ssize_t duplex_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct net_device *netdev = to_net_dev(dev); -@@ -198,8 +209,9 @@ static ssize_t show_duplex(struct device - rtnl_unlock(); - return ret; - } -+static DEVICE_ATTR_RO(duplex); - --static ssize_t show_dormant(struct device *dev, -+static ssize_t dormant_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - struct net_device *netdev = to_net_dev(dev); -@@ -209,6 +221,7 @@ static ssize_t show_dormant(struct devic - - return -EINVAL; - } -+static DEVICE_ATTR_RO(dormant); - - static const char *const operstates[] = { - "unknown", -@@ -220,7 +233,7 @@ static const char *const operstates[] = - "up" - }; - --static ssize_t show_operstate(struct device *dev, -+static ssize_t operstate_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - const struct net_device *netdev = to_net_dev(dev); -@@ -237,35 +250,33 @@ static ssize_t show_operstate(struct dev - - return sprintf(buf, "%s\n", operstates[operstate]); - } -+static DEVICE_ATTR_RO(operstate); - - /* read-write attributes */ --NETDEVICE_SHOW(mtu, fmt_dec); - - static int change_mtu(struct net_device *net, unsigned long new_mtu) - { - return dev_set_mtu(net, (int) new_mtu); - } - --static ssize_t store_mtu(struct device *dev, struct device_attribute *attr, -+static ssize_t mtu_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t len) - { - return netdev_store(dev, attr, buf, len, change_mtu); - } -- --NETDEVICE_SHOW(flags, fmt_hex); -+NETDEVICE_SHOW_RW(mtu, fmt_dec); - - static int change_flags(struct net_device *net, unsigned long new_flags) - { - return dev_change_flags(net, (unsigned int) new_flags); - } - --static ssize_t store_flags(struct device *dev, struct device_attribute *attr, -+static ssize_t flags_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t len) - { - return netdev_store(dev, attr, buf, len, change_flags); - } -- --NETDEVICE_SHOW(tx_queue_len, fmt_ulong); -+NETDEVICE_SHOW_RW(flags, fmt_hex); - - static int change_tx_queue_len(struct net_device *net, unsigned long new_len) - { -@@ -273,7 +284,7 @@ static int change_tx_queue_len(struct ne - return 0; - } - --static ssize_t store_tx_queue_len(struct device *dev, -+static ssize_t tx_queue_len_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t len) - { -@@ -282,8 +293,9 @@ static ssize_t store_tx_queue_len(struct - - return netdev_store(dev, attr, buf, len, change_tx_queue_len); - } -+NETDEVICE_SHOW_RW(tx_queue_len, fmt_ulong); - --static ssize_t store_ifalias(struct device *dev, struct device_attribute *attr, -+static ssize_t ifalias_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t len) - { - struct net_device *netdev = to_net_dev(dev); -@@ -306,7 +318,7 @@ static ssize_t store_ifalias(struct devi - return ret < 0 ? ret : len; - } - --static ssize_t show_ifalias(struct device *dev, -+static ssize_t ifalias_show(struct device *dev, - struct device_attribute *attr, char *buf) - { - const struct net_device *netdev = to_net_dev(dev); -@@ -319,8 +331,7 @@ static ssize_t show_ifalias(struct devic - rtnl_unlock(); - return ret; - } -- --NETDEVICE_SHOW(group, fmt_dec); -+static DEVICE_ATTR_RW(ifalias); - - static int change_group(struct net_device *net, unsigned long new_group) - { -@@ -328,35 +339,37 @@ static int change_group(struct net_devic - return 0; - } - --static ssize_t store_group(struct device *dev, struct device_attribute *attr, -- const char *buf, size_t len) -+static ssize_t group_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t len) - { - return netdev_store(dev, attr, buf, len, change_group); - } -+NETDEVICE_SHOW(group, fmt_dec); -+static DEVICE_ATTR(netdev_group, S_IRUGO | S_IWUSR, group_show, group_store); - --static struct device_attribute net_class_attributes[] = { -- __ATTR(addr_assign_type, S_IRUGO, show_addr_assign_type, NULL), -- __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), -- __ATTR(dev_id, S_IRUGO, show_dev_id, NULL), -- __ATTR(ifalias, S_IRUGO | S_IWUSR, show_ifalias, store_ifalias), -- __ATTR(iflink, S_IRUGO, show_iflink, NULL), -- __ATTR(ifindex, S_IRUGO, show_ifindex, NULL), -- __ATTR(type, S_IRUGO, show_type, NULL), -- __ATTR(link_mode, S_IRUGO, show_link_mode, NULL), -- __ATTR(address, S_IRUGO, show_address, NULL), -- __ATTR(broadcast, S_IRUGO, show_broadcast, NULL), -- __ATTR(carrier, S_IRUGO | S_IWUSR, show_carrier, store_carrier), -- __ATTR(speed, S_IRUGO, show_speed, NULL), -- __ATTR(duplex, S_IRUGO, show_duplex, NULL), -- __ATTR(dormant, S_IRUGO, show_dormant, NULL), -- __ATTR(operstate, S_IRUGO, show_operstate, NULL), -- __ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu), -- __ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags), -- __ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, -- store_tx_queue_len), -- __ATTR(netdev_group, S_IRUGO | S_IWUSR, show_group, store_group), -- {} -+static struct attribute *net_class_attrs[] = { -+ &dev_attr_netdev_group.attr, -+ &dev_attr_type.attr, -+ &dev_attr_dev_id.attr, -+ &dev_attr_iflink.attr, -+ &dev_attr_ifindex.attr, -+ &dev_attr_addr_assign_type.attr, -+ &dev_attr_addr_len.attr, -+ &dev_attr_link_mode.attr, -+ &dev_attr_address.attr, -+ &dev_attr_broadcast.attr, -+ &dev_attr_speed.attr, -+ &dev_attr_duplex.attr, -+ &dev_attr_dormant.attr, -+ &dev_attr_operstate.attr, -+ &dev_attr_ifalias.attr, -+ &dev_attr_carrier.attr, -+ &dev_attr_mtu.attr, -+ &dev_attr_flags.attr, -+ &dev_attr_tx_queue_len.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(net_class); - - /* Show a given an attribute in the statistics group */ - static ssize_t netstat_show(const struct device *d, -@@ -382,13 +395,13 @@ static ssize_t netstat_show(const struct - - /* generate a read-only statistics attribute */ - #define NETSTAT_ENTRY(name) \ --static ssize_t show_##name(struct device *d, \ -+static ssize_t name##_show(struct device *d, \ - struct device_attribute *attr, char *buf) \ - { \ - return netstat_show(d, attr, buf, \ - offsetof(struct rtnl_link_stats64, name)); \ - } \ --static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) -+static DEVICE_ATTR_RO(name) - - NETSTAT_ENTRY(rx_packets); - NETSTAT_ENTRY(tx_packets); -@@ -457,6 +470,9 @@ static struct attribute_group wireless_g - .attrs = wireless_attrs, - }; - #endif -+ -+#else /* CONFIG_SYSFS */ -+#define net_class_groups NULL - #endif /* CONFIG_SYSFS */ - - #ifdef CONFIG_RPS -@@ -1229,9 +1245,7 @@ static const void *net_namespace(struct - static struct class net_class = { - .name = "net", - .dev_release = netdev_release, --#ifdef CONFIG_SYSFS -- .dev_attrs = net_class_attributes, --#endif /* CONFIG_SYSFS */ -+ .dev_groups = net_class_groups, - .dev_uevent = netdev_uevent, - .ns_type = &net_ns_type_operations, - .namespace = net_namespace, ---- a/net/ieee802154/wpan-class.c -+++ b/net/ieee802154/wpan-class.c -@@ -36,7 +36,8 @@ static ssize_t name ## _show(struct devi - ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \ - mutex_unlock(&phy->pib_lock); \ - return ret; \ --} -+} \ -+static DEVICE_ATTR_RO(name); - - #define MASTER_SHOW(field, format_string) \ - MASTER_SHOW_COMPLEX(field, format_string, phy->field) -@@ -66,15 +67,17 @@ static ssize_t channels_supported_show(s - mutex_unlock(&phy->pib_lock); - return len; - } -+static DEVICE_ATTR_RO(channels_supported); - --static struct device_attribute pmib_attrs[] = { -- __ATTR_RO(current_channel), -- __ATTR_RO(current_page), -- __ATTR_RO(channels_supported), -- __ATTR_RO(transmit_power), -- __ATTR_RO(cca_mode), -- {}, -+static struct attribute *pmib_attrs[] = { -+ &dev_attr_current_channel.attr, -+ &dev_attr_current_page.attr, -+ &dev_attr_channels_supported.attr, -+ &dev_attr_transmit_power.attr, -+ &dev_attr_cca_mode.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(pmib); - - static void wpan_phy_release(struct device *d) - { -@@ -85,7 +88,7 @@ static void wpan_phy_release(struct devi - static struct class wpan_phy_class = { - .name = "ieee802154", - .dev_release = wpan_phy_release, -- .dev_attrs = pmib_attrs, -+ .dev_groups = pmib_groups, - }; - - static DEFINE_MUTEX(wpan_phy_mutex); ---- a/net/rfkill/core.c -+++ b/net/rfkill/core.c -@@ -576,14 +576,14 @@ void rfkill_set_states(struct rfkill *rf - } - EXPORT_SYMBOL(rfkill_set_states); - --static ssize_t rfkill_name_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t name_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%s\n", rfkill->name); - } -+static DEVICE_ATTR_RO(name); - - static const char *rfkill_get_type_str(enum rfkill_type type) - { -@@ -611,54 +611,52 @@ static const char *rfkill_get_type_str(e - } - } - --static ssize_t rfkill_type_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t type_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%s\n", rfkill_get_type_str(rfkill->type)); - } -+static DEVICE_ATTR_RO(type); - --static ssize_t rfkill_idx_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t index_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", rfkill->idx); - } -+static DEVICE_ATTR_RO(index); - --static ssize_t rfkill_persistent_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t persistent_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", rfkill->persistent); - } -+static DEVICE_ATTR_RO(persistent); - --static ssize_t rfkill_hard_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t hard_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 ); - } -+static DEVICE_ATTR_RO(hard); - --static ssize_t rfkill_soft_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t soft_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0 ); - } - --static ssize_t rfkill_soft_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t soft_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct rfkill *rfkill = to_rfkill(dev); - unsigned long state; -@@ -680,6 +678,7 @@ static ssize_t rfkill_soft_store(struct - - return count; - } -+static DEVICE_ATTR_RW(soft); - - static u8 user_state_from_blocked(unsigned long state) - { -@@ -691,18 +690,16 @@ static u8 user_state_from_blocked(unsign - return RFKILL_USER_STATE_UNBLOCKED; - } - --static ssize_t rfkill_state_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t state_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state)); - } - --static ssize_t rfkill_state_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t state_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) - { - struct rfkill *rfkill = to_rfkill(dev); - unsigned long state; -@@ -725,32 +722,27 @@ static ssize_t rfkill_state_store(struct - - return count; - } -+static DEVICE_ATTR_RW(state); - --static ssize_t rfkill_claim_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t claim_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - return sprintf(buf, "%d\n", 0); - } -+static DEVICE_ATTR_RO(claim); - --static ssize_t rfkill_claim_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) --{ -- return -EOPNOTSUPP; --} -- --static struct device_attribute rfkill_dev_attrs[] = { -- __ATTR(name, S_IRUGO, rfkill_name_show, NULL), -- __ATTR(type, S_IRUGO, rfkill_type_show, NULL), -- __ATTR(index, S_IRUGO, rfkill_idx_show, NULL), -- __ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL), -- __ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store), -- __ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store), -- __ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store), -- __ATTR(hard, S_IRUGO, rfkill_hard_show, NULL), -- __ATTR_NULL -+static struct attribute *rfkill_dev_attrs[] = { -+ &dev_attr_name.attr, -+ &dev_attr_type.attr, -+ &dev_attr_index.attr, -+ &dev_attr_persistent.attr, -+ &dev_attr_state.attr, -+ &dev_attr_claim.attr, -+ &dev_attr_soft.attr, -+ &dev_attr_hard.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(rfkill_dev); - - static void rfkill_release(struct device *dev) - { -@@ -830,7 +822,7 @@ static int rfkill_resume(struct device * - static struct class rfkill_class = { - .name = "rfkill", - .dev_release = rfkill_release, -- .dev_attrs = rfkill_dev_attrs, -+ .dev_groups = rfkill_dev_groups, - .dev_uevent = rfkill_dev_uevent, - .suspend = rfkill_suspend, - .resume = rfkill_resume, ---- a/net/wireless/sysfs.c -+++ b/net/wireless/sysfs.c -@@ -30,7 +30,8 @@ static ssize_t name ## _show(struct devi - char *buf) \ - { \ - return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \ --} -+} \ -+static DEVICE_ATTR_RO(name) - - SHOW_FMT(index, "%d", wiphy_idx); - SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); -@@ -42,7 +43,7 @@ static ssize_t name_show(struct device * - struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; - return sprintf(buf, "%s\n", dev_name(&wiphy->dev)); - } -- -+static DEVICE_ATTR_RO(name); - - static ssize_t addresses_show(struct device *dev, - struct device_attribute *attr, -@@ -60,15 +61,17 @@ static ssize_t addresses_show(struct dev - - return buf - start; - } -+static DEVICE_ATTR_RO(addresses); - --static struct device_attribute ieee80211_dev_attrs[] = { -- __ATTR_RO(index), -- __ATTR_RO(macaddress), -- __ATTR_RO(address_mask), -- __ATTR_RO(addresses), -- __ATTR_RO(name), -- {} -+static struct attribute *ieee80211_attrs[] = { -+ &dev_attr_index.attr, -+ &dev_attr_macaddress.attr, -+ &dev_attr_address_mask.attr, -+ &dev_attr_addresses.attr, -+ &dev_attr_name.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(ieee80211); - - static void wiphy_dev_release(struct device *dev) - { -@@ -144,7 +147,7 @@ struct class ieee80211_class = { - .name = "ieee80211", - .owner = THIS_MODULE, - .dev_release = wiphy_dev_release, -- .dev_attrs = ieee80211_dev_attrs, -+ .dev_groups = ieee80211_groups, - .dev_uevent = wiphy_uevent, - .suspend = wiphy_suspend, - .resume = wiphy_resume, diff --git a/scsi-osd-convert-class-code-to-use-dev_groups.patch b/scsi-osd-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..f569b9a7080e1b --- /dev/null +++ b/scsi-osd-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,54 @@ +From foo@baz Tue Jul 9 15:35:52 PDT 2013 +Date: Tue, 09 Jul 2013 15:35:52 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: SCSI: OSD: 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 osd class code to use +the correct field. + +Cc: Boaz Harrosh <bharrosh@panasas.com> +Cc: Benny Halevy <bhalevy@tonian.com> +Cc: James E.J. Bottomley <JBottomley@parallels.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/scsi/osd/osd_uld.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/osd/osd_uld.c ++++ b/drivers/scsi/osd/osd_uld.c +@@ -107,6 +107,7 @@ static ssize_t osdname_show(struct devic + class_dev); + return sprintf(buf, "%s\n", ould->odi.osdname); + } ++static DEVICE_ATTR_RO(osdname); + + static ssize_t systemid_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -117,17 +118,19 @@ static ssize_t systemid_show(struct devi + memcpy(buf, ould->odi.systemid, ould->odi.systemid_len); + return ould->odi.systemid_len; + } ++static DEVICE_ATTR_RO(systemid); + +-static struct device_attribute osd_uld_attrs[] = { +- __ATTR(osdname, S_IRUGO, osdname_show, NULL), +- __ATTR(systemid, S_IRUGO, systemid_show, NULL), +- __ATTR_NULL, ++static struct attribute *osd_uld_attrs[] = { ++ &dev_attr_osdname.attr, ++ &dev_attr_systemid.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(osd_uld); + + static struct class osd_uld_class = { + .owner = THIS_MODULE, + .name = "scsi_osd", +- .dev_attrs = osd_uld_attrs, ++ .dev_groups = osd_uld_groups, + }; + + /* diff --git a/scsi-sd-convert-class-code-to-use-dev_groups.patch b/scsi-sd-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..42effba73bc6d1 --- /dev/null +++ b/scsi-sd-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,314 @@ +From foo@baz Tue Jul 9 15:36:59 PDT 2013 +Date: Tue, 09 Jul 2013 15:36:59 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: SCSI: sd: 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 disk class code to use +the correct field. + +It required some functions to be moved around to place the show and +store functions next to each other, the old order seemed to make no +sense at all. + +Cc: James E.J. Bottomley <JBottomley@parallels.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/scsi/sd.c | 147 +++++++++++++++++++++++++++--------------------------- + 1 file changed, 74 insertions(+), 73 deletions(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -132,8 +132,8 @@ static const char *sd_cache_types[] = { + }; + + static ssize_t +-sd_store_cache_type(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++cache_type_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + int i, ct = -1, rcd, wce, sp; + struct scsi_disk *sdkp = to_scsi_disk(dev); +@@ -199,8 +199,18 @@ sd_store_cache_type(struct device *dev, + } + + static ssize_t +-sd_store_manage_start_stop(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++manage_start_stop_show(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct scsi_disk *sdkp = to_scsi_disk(dev); ++ struct scsi_device *sdp = sdkp->device; ++ ++ return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); ++} ++ ++static ssize_t ++manage_start_stop_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; +@@ -212,10 +222,19 @@ sd_store_manage_start_stop(struct device + + return count; + } ++static DEVICE_ATTR_RW(manage_start_stop); ++ ++static ssize_t ++allow_restart_show(struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ struct scsi_disk *sdkp = to_scsi_disk(dev); ++ ++ return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); ++} + + static ssize_t +-sd_store_allow_restart(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++allow_restart_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; +@@ -230,47 +249,30 @@ sd_store_allow_restart(struct device *de + + return count; + } ++static DEVICE_ATTR_RW(allow_restart); + + static ssize_t +-sd_show_cache_type(struct device *dev, struct device_attribute *attr, +- char *buf) ++cache_type_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + int ct = sdkp->RCD + 2*sdkp->WCE; + + return snprintf(buf, 40, "%s\n", sd_cache_types[ct]); + } ++static DEVICE_ATTR_RW(cache_type); + + static ssize_t +-sd_show_fua(struct device *dev, struct device_attribute *attr, char *buf) ++FUA_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + + return snprintf(buf, 20, "%u\n", sdkp->DPOFUA); + } ++static DEVICE_ATTR_RO(FUA); + + static ssize_t +-sd_show_manage_start_stop(struct device *dev, struct device_attribute *attr, +- char *buf) +-{ +- struct scsi_disk *sdkp = to_scsi_disk(dev); +- struct scsi_device *sdp = sdkp->device; +- +- return snprintf(buf, 20, "%u\n", sdp->manage_start_stop); +-} +- +-static ssize_t +-sd_show_allow_restart(struct device *dev, struct device_attribute *attr, +- char *buf) +-{ +- struct scsi_disk *sdkp = to_scsi_disk(dev); +- +- return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); +-} +- +-static ssize_t +-sd_show_protection_type(struct device *dev, struct device_attribute *attr, +- char *buf) ++protection_type_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + +@@ -278,8 +280,8 @@ sd_show_protection_type(struct device *d + } + + static ssize_t +-sd_store_protection_type(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++protection_type_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + unsigned int val; +@@ -298,10 +300,11 @@ sd_store_protection_type(struct device * + + return count; + } ++static DEVICE_ATTR_RW(protection_type); + + static ssize_t +-sd_show_protection_mode(struct device *dev, struct device_attribute *attr, +- char *buf) ++protection_mode_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; +@@ -320,24 +323,26 @@ sd_show_protection_mode(struct device *d + + return snprintf(buf, 20, "%s%u\n", dix ? "dix" : "dif", dif); + } ++static DEVICE_ATTR_RO(protection_mode); + + static ssize_t +-sd_show_app_tag_own(struct device *dev, struct device_attribute *attr, +- char *buf) ++app_tag_own_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + + return snprintf(buf, 20, "%u\n", sdkp->ATO); + } ++static DEVICE_ATTR_RO(app_tag_own); + + static ssize_t +-sd_show_thin_provisioning(struct device *dev, struct device_attribute *attr, +- char *buf) ++thin_provisioning_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + + return snprintf(buf, 20, "%u\n", sdkp->lbpme); + } ++static DEVICE_ATTR_RO(thin_provisioning); + + static const char *lbp_mode[] = { + [SD_LBP_FULL] = "full", +@@ -349,8 +354,8 @@ static const char *lbp_mode[] = { + }; + + static ssize_t +-sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr, +- char *buf) ++provisioning_mode_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + +@@ -358,8 +363,8 @@ sd_show_provisioning_mode(struct device + } + + static ssize_t +-sd_store_provisioning_mode(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++provisioning_mode_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; +@@ -385,10 +390,11 @@ sd_store_provisioning_mode(struct device + + return count; + } ++static DEVICE_ATTR_RW(provisioning_mode); + + static ssize_t +-sd_show_max_medium_access_timeouts(struct device *dev, +- struct device_attribute *attr, char *buf) ++max_medium_access_timeouts_show(struct device *dev, ++ struct device_attribute *attr, char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + +@@ -396,9 +402,9 @@ sd_show_max_medium_access_timeouts(struc + } + + static ssize_t +-sd_store_max_medium_access_timeouts(struct device *dev, +- struct device_attribute *attr, +- const char *buf, size_t count) ++max_medium_access_timeouts_store(struct device *dev, ++ struct device_attribute *attr, const char *buf, ++ size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + int err; +@@ -410,10 +416,11 @@ sd_store_max_medium_access_timeouts(stru + + return err ? err : count; + } ++static DEVICE_ATTR_RW(max_medium_access_timeouts); + + static ssize_t +-sd_show_write_same_blocks(struct device *dev, struct device_attribute *attr, +- char *buf) ++max_write_same_blocks_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + +@@ -421,8 +428,8 @@ sd_show_write_same_blocks(struct device + } + + static ssize_t +-sd_store_write_same_blocks(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++max_write_same_blocks_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; +@@ -451,35 +458,29 @@ sd_store_write_same_blocks(struct device + + return count; + } ++static DEVICE_ATTR_RW(max_write_same_blocks); + +-static struct device_attribute sd_disk_attrs[] = { +- __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, +- sd_store_cache_type), +- __ATTR(FUA, S_IRUGO, sd_show_fua, NULL), +- __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart, +- sd_store_allow_restart), +- __ATTR(manage_start_stop, S_IRUGO|S_IWUSR, sd_show_manage_start_stop, +- sd_store_manage_start_stop), +- __ATTR(protection_type, S_IRUGO|S_IWUSR, sd_show_protection_type, +- sd_store_protection_type), +- __ATTR(protection_mode, S_IRUGO, sd_show_protection_mode, NULL), +- __ATTR(app_tag_own, S_IRUGO, sd_show_app_tag_own, NULL), +- __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL), +- __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode, +- sd_store_provisioning_mode), +- __ATTR(max_write_same_blocks, S_IRUGO|S_IWUSR, +- sd_show_write_same_blocks, sd_store_write_same_blocks), +- __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR, +- sd_show_max_medium_access_timeouts, +- sd_store_max_medium_access_timeouts), +- __ATTR_NULL, ++static struct attribute *sd_disk_attrs[] = { ++ &dev_attr_cache_type.attr, ++ &dev_attr_FUA.attr, ++ &dev_attr_allow_restart.attr, ++ &dev_attr_manage_start_stop.attr, ++ &dev_attr_protection_type.attr, ++ &dev_attr_protection_mode.attr, ++ &dev_attr_app_tag_own.attr, ++ &dev_attr_thin_provisioning.attr, ++ &dev_attr_provisioning_mode.attr, ++ &dev_attr_max_write_same_blocks.attr, ++ &dev_attr_max_medium_access_timeouts.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(sd_disk); + + static struct class sd_disk_class = { + .name = "scsi_disk", + .owner = THIS_MODULE, + .dev_release = scsi_disk_release, +- .dev_attrs = sd_disk_attrs, ++ .dev_groups = sd_disk_groups, + }; + + static const struct dev_pm_ops sd_pm_ops = { diff --git a/scsi-st-convert-class-code-to-use-dev_groups.patch b/scsi-st-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..bf3a01ed1b5e2e --- /dev/null +++ b/scsi-st-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,96 @@ +From foo@baz Tue Jul 9 15:38:50 PDT 2013 +Date: Tue, 09 Jul 2013 15:38:50 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: 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> +Cc: James E.J. Bottomley <JBottomley@parallels.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/scsi/st.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +--- a/drivers/scsi/st.c ++++ b/drivers/scsi/st.c +@@ -82,7 +82,7 @@ static int try_rdio = 1; + static int try_wdio = 1; + + static struct class st_sysfs_class; +-static struct device_attribute st_dev_attrs[]; ++static const struct attribute_group *st_dev_groups[]; + + MODULE_AUTHOR("Kai Makisara"); + MODULE_DESCRIPTION("SCSI tape (st) driver"); +@@ -4274,7 +4274,7 @@ static void scsi_tape_release(struct kre + + static struct class st_sysfs_class = { + .name = "scsi_tape", +- .dev_attrs = st_dev_attrs, ++ .dev_groups = st_dev_groups, + }; + + static int __init init_st(void) +@@ -4408,6 +4408,7 @@ defined_show(struct device *dev, struct + l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); + return l; + } ++static DEVICE_ATTR_RO(defined); + + static ssize_t + default_blksize_show(struct device *dev, struct device_attribute *attr, +@@ -4419,7 +4420,7 @@ default_blksize_show(struct device *dev, + l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); + return l; + } +- ++static DEVICE_ATTR_RO(default_blksize); + + static ssize_t + default_density_show(struct device *dev, struct device_attribute *attr, +@@ -4433,6 +4434,7 @@ default_density_show(struct device *dev, + l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); + return l; + } ++static DEVICE_ATTR_RO(default_density); + + static ssize_t + default_compression_show(struct device *dev, struct device_attribute *attr, +@@ -4444,6 +4446,7 @@ default_compression_show(struct device * + l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); + return l; + } ++static DEVICE_ATTR_RO(default_compression); + + static ssize_t + options_show(struct device *dev, struct device_attribute *attr, char *buf) +@@ -4472,15 +4475,17 @@ options_show(struct device *dev, struct + l = snprintf(buf, PAGE_SIZE, "0x%08x\n", options); + return l; + } ++static DEVICE_ATTR_RO(options); + +-static struct device_attribute st_dev_attrs[] = { +- __ATTR_RO(defined), +- __ATTR_RO(default_blksize), +- __ATTR_RO(default_density), +- __ATTR_RO(default_compression), +- __ATTR_RO(options), +- __ATTR_NULL, ++static struct attribute *st_dev_attrs[] = { ++ &dev_attr_defined.attr, ++ &dev_attr_default_blksize.attr, ++ &dev_attr_default_density.attr, ++ &dev_attr_default_compression.attr, ++ &dev_attr_options.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(st_dev); + + /* The following functions may be useful for a larger audience. */ + static int sgl_map_user_pages(struct st_buffer *STbp, @@ -25,6 +25,16 @@ pps-convert-class-code-to-use-dev_groups.patch ptp-convert-class-code-to-use-dev_groups.patch regulator-convert-class-code-to-use-dev_groups.patch rtc-convert-class-code-to-use-dev_groups.patch +uio-convert-class-code-to-use-dev_groups.patch +cuse-convert-class-code-to-use-dev_groups.patch +staging-comedi-convert-class-code-to-use-dev_groups.patch +backing-dev-convert-class-code-to-use-dev_groups.patch +scsi-osd-convert-class-code-to-use-dev_groups.patch +scsi-sd-convert-class-code-to-use-dev_groups.patch +scsi-st-convert-class-code-to-use-dev_groups.patch +video-backlight-convert-class-code-to-use-dev_groups.patch +video-backlight-lcd-convert-class-code-to-use-dev_groups.patch + d1.patch @@ -37,7 +47,7 @@ d7.patch d8.patch d9.patch - +d10.patch usb-ldusb-remove-custom-dbg_info-macro.patch usb-legotower-remove-unneeded-tracing-macros.patch diff --git a/d3.patch b/staging-comedi-convert-class-code-to-use-dev_groups.patch index 164e7c56c1e4ec..bbc4252592b8bf 100644 --- a/d3.patch +++ b/staging-comedi-convert-class-code-to-use-dev_groups.patch @@ -1,3 +1,17 @@ +From foo@baz Tue Jul 9 15:33:57 PDT 2013 +Date: Tue, 09 Jul 2013 15:33:57 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: staging: comedi: 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 comedi class code to use the +correct field. + +Cc: Ian Abbott <abbotti@mev.co.uk> +Cc: H Hartley Sweeten <hsweeten@visionengravers.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + --- drivers/staging/comedi/comedi_fops.c | 39 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/uio-convert-class-code-to-use-dev_groups.patch b/uio-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..5e49b44d55aee1 --- /dev/null +++ b/uio-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,71 @@ +From foo@baz Tue Jul 9 15:32:28 PDT 2013 +Date: Tue, 09 Jul 2013 15:32:28 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: UIO: 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 uio class code to use the +correct field. + +Cc: Hans J. Koch <hjk@hansjkoch.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/uio/uio.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +--- a/drivers/uio/uio.c ++++ b/drivers/uio/uio.c +@@ -224,38 +224,42 @@ static struct kobj_type portio_attr_type + .default_attrs = portio_attrs, + }; + +-static ssize_t show_name(struct device *dev, ++static ssize_t name_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct uio_device *idev = dev_get_drvdata(dev); + return sprintf(buf, "%s\n", idev->info->name); + } ++static DEVICE_ATTR_RO(name); + +-static ssize_t show_version(struct device *dev, ++static ssize_t version_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct uio_device *idev = dev_get_drvdata(dev); + return sprintf(buf, "%s\n", idev->info->version); + } ++static DEVICE_ATTR_RO(version); + +-static ssize_t show_event(struct device *dev, ++static ssize_t event_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct uio_device *idev = dev_get_drvdata(dev); + return sprintf(buf, "%u\n", (unsigned int)atomic_read(&idev->event)); + } ++static DEVICE_ATTR_RO(event); + +-static struct device_attribute uio_class_attributes[] = { +- __ATTR(name, S_IRUGO, show_name, NULL), +- __ATTR(version, S_IRUGO, show_version, NULL), +- __ATTR(event, S_IRUGO, show_event, NULL), +- {} ++static struct attribute *uio_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_version.attr, ++ &dev_attr_event.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(uio); + + /* UIO class infrastructure */ + static struct class uio_class = { + .name = "uio", +- .dev_attrs = uio_class_attributes, ++ .dev_groups = uio_groups, + }; + + /* diff --git a/video-backlight-convert-class-code-to-use-dev_groups.patch b/video-backlight-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..3f649fee2c02ae --- /dev/null +++ b/video-backlight-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,135 @@ +From foo@baz Tue Jul 9 15:39:32 PDT 2013 +Date: Tue, 09 Jul 2013 15:39:32 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: video: backlight: 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 video backlight class code to +use the correct field. + +Cc: Richard Purdie <rpurdie@rpsys.net> +Cc: Jingoo Han <jg1.han@samsung.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/video/backlight/backlight.c | 44 +++++++++++++++++++----------------- + 1 file changed, 24 insertions(+), 20 deletions(-) + +--- a/drivers/video/backlight/backlight.c ++++ b/drivers/video/backlight/backlight.c +@@ -103,16 +103,16 @@ static void backlight_generate_event(str + sysfs_notify(&bd->dev.kobj, NULL, "actual_brightness"); + } + +-static ssize_t backlight_show_power(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t bl_power_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct backlight_device *bd = to_backlight_device(dev); + + return sprintf(buf, "%d\n", bd->props.power); + } + +-static ssize_t backlight_store_power(struct device *dev, +- struct device_attribute *attr, const char *buf, size_t count) ++static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + int rc; + struct backlight_device *bd = to_backlight_device(dev); +@@ -136,8 +136,9 @@ static ssize_t backlight_store_power(str + + return rc; + } ++static DEVICE_ATTR_RW(bl_power); + +-static ssize_t backlight_show_brightness(struct device *dev, ++static ssize_t brightness_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct backlight_device *bd = to_backlight_device(dev); +@@ -145,7 +146,7 @@ static ssize_t backlight_show_brightness + return sprintf(buf, "%d\n", bd->props.brightness); + } + +-static ssize_t backlight_store_brightness(struct device *dev, ++static ssize_t brightness_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + int rc; +@@ -175,24 +176,27 @@ static ssize_t backlight_store_brightnes + + return rc; + } ++static DEVICE_ATTR_RW(brightness); + +-static ssize_t backlight_show_type(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t type_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct backlight_device *bd = to_backlight_device(dev); + + return sprintf(buf, "%s\n", backlight_types[bd->props.type]); + } ++static DEVICE_ATTR_RO(type); + +-static ssize_t backlight_show_max_brightness(struct device *dev, ++static ssize_t max_brightness_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct backlight_device *bd = to_backlight_device(dev); + + return sprintf(buf, "%d\n", bd->props.max_brightness); + } ++static DEVICE_ATTR_RO(max_brightness); + +-static ssize_t backlight_show_actual_brightness(struct device *dev, ++static ssize_t actual_brightness_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + int rc = -ENXIO; +@@ -205,6 +209,7 @@ static ssize_t backlight_show_actual_bri + + return rc; + } ++static DEVICE_ATTR_RO(actual_brightness); + + static struct class *backlight_class; + +@@ -247,16 +252,15 @@ static void bl_device_release(struct dev + kfree(bd); + } + +-static struct device_attribute bl_device_attributes[] = { +- __ATTR(bl_power, 0644, backlight_show_power, backlight_store_power), +- __ATTR(brightness, 0644, backlight_show_brightness, +- backlight_store_brightness), +- __ATTR(actual_brightness, 0444, backlight_show_actual_brightness, +- NULL), +- __ATTR(max_brightness, 0444, backlight_show_max_brightness, NULL), +- __ATTR(type, 0444, backlight_show_type, NULL), +- __ATTR_NULL, ++static struct attribute *bl_device_attrs[] = { ++ &dev_attr_bl_power.attr, ++ &dev_attr_brightness.attr, ++ &dev_attr_actual_brightness.attr, ++ &dev_attr_max_brightness.attr, ++ &dev_attr_type.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(bl_device); + + /** + * backlight_force_update - tell the backlight subsystem that hardware state +@@ -493,7 +497,7 @@ static int __init backlight_class_init(v + return PTR_ERR(backlight_class); + } + +- backlight_class->dev_attrs = bl_device_attributes; ++ backlight_class->dev_groups = bl_device_groups; + backlight_class->pm = &backlight_class_dev_pm_ops; + return 0; + } diff --git a/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch b/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..96a7bd0fa70e16 --- /dev/null +++ b/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,104 @@ +From foo@baz Tue Jul 9 15:40:31 PDT 2013 +Date: Tue, 09 Jul 2013 15:40:31 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: video: backlight: lcd: 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 video backlight lcd class +code to use the correct field. + +Cc: Richard Purdie <rpurdie@rpsys.net> +Cc: Jingoo Han <jg1.han@samsung.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/video/backlight/lcd.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +--- a/drivers/video/backlight/lcd.c ++++ b/drivers/video/backlight/lcd.c +@@ -89,7 +89,7 @@ static inline void lcd_unregister_fb(str + } + #endif /* CONFIG_FB */ + +-static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, ++static ssize_t lcd_power_show(struct device *dev, struct device_attribute *attr, + char *buf) + { + int rc; +@@ -105,7 +105,7 @@ static ssize_t lcd_show_power(struct dev + return rc; + } + +-static ssize_t lcd_store_power(struct device *dev, ++static ssize_t lcd_power_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + int rc; +@@ -128,8 +128,9 @@ static ssize_t lcd_store_power(struct de + + return rc; + } ++static DEVICE_ATTR_RW(lcd_power); + +-static ssize_t lcd_show_contrast(struct device *dev, ++static ssize_t contrast_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + int rc = -ENXIO; +@@ -143,7 +144,7 @@ static ssize_t lcd_show_contrast(struct + return rc; + } + +-static ssize_t lcd_store_contrast(struct device *dev, ++static ssize_t contrast_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + int rc; +@@ -166,14 +167,16 @@ static ssize_t lcd_store_contrast(struct + + return rc; + } ++static DEVICE_ATTR_RW(contrast); + +-static ssize_t lcd_show_max_contrast(struct device *dev, ++static ssize_t max_contrast_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct lcd_device *ld = to_lcd_device(dev); + + return sprintf(buf, "%d\n", ld->props.max_contrast); + } ++static DEVICE_ATTR_RO(max_contrast); + + static struct class *lcd_class; + +@@ -183,12 +186,13 @@ static void lcd_device_release(struct de + kfree(ld); + } + +-static struct device_attribute lcd_device_attributes[] = { +- __ATTR(lcd_power, 0644, lcd_show_power, lcd_store_power), +- __ATTR(contrast, 0644, lcd_show_contrast, lcd_store_contrast), +- __ATTR(max_contrast, 0444, lcd_show_max_contrast, NULL), +- __ATTR_NULL, ++static struct attribute *lcd_device_attrs[] = { ++ &dev_attr_lcd_power.attr, ++ &dev_attr_contrast.attr, ++ &dev_attr_max_contrast.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(lcd_device); + + /** + * lcd_device_register - register a new object of lcd_device class. +@@ -344,7 +348,7 @@ static int __init lcd_class_init(void) + return PTR_ERR(lcd_class); + } + +- lcd_class->dev_attrs = lcd_device_attributes; ++ lcd_class->dev_groups = lcd_device_groups; + return 0; + } + |
