diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 14:45:58 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 14:45:58 -0700 |
| commit | 6866d52ad99a8c2c5301c7371fce365d25b2d0be (patch) | |
| tree | f39adaa4087fd91ed21e7fd81c09ace7b2d9228d /pwm-convert-class-code-to-use-dev_groups.patch | |
| parent | e275d064f56be8b9dec6fc2e33d6b075dcc2ac62 (diff) | |
| download | patches-6866d52ad99a8c2c5301c7371fce365d25b2d0be.tar.gz | |
move applied patches to applied/ and add a pwm patch
Diffstat (limited to 'pwm-convert-class-code-to-use-dev_groups.patch')
| -rw-r--r-- | pwm-convert-class-code-to-use-dev_groups.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pwm-convert-class-code-to-use-dev_groups.patch b/pwm-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..ec507cc32af9dc --- /dev/null +++ b/pwm-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,65 @@ +From foo@baz Wed Jul 24 14:30:57 PDT 2013 +Date: Wed, 24 Jul 2013 14:30:57 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: pwm: 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 pwm class code to use the +correct field. + +Cc: Thierry Reding <thierry.reding@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/pwm/sysfs.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/pwm/sysfs.c ++++ b/drivers/pwm/sysfs.c +@@ -268,6 +268,7 @@ static ssize_t pwm_export_store(struct d + + return ret ? : len; + } ++static DEVICE_ATTR(export, 0200, NULL, pwm_export_store); + + static ssize_t pwm_unexport_store(struct device *parent, + struct device_attribute *attr, +@@ -288,27 +289,29 @@ static ssize_t pwm_unexport_store(struct + + return ret ? : len; + } ++static DEVICE_ATTR(unexport, 0200, NULL, pwm_unexport_store); + +-static ssize_t pwm_npwm_show(struct device *parent, +- struct device_attribute *attr, +- char *buf) ++static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, ++ char *buf) + { + const struct pwm_chip *chip = dev_get_drvdata(parent); + + return sprintf(buf, "%u\n", chip->npwm); + } ++static DEVICE_ATTR_RO(npwm); + +-static struct device_attribute pwm_chip_attrs[] = { +- __ATTR(export, 0200, NULL, pwm_export_store), +- __ATTR(unexport, 0200, NULL, pwm_unexport_store), +- __ATTR(npwm, 0444, pwm_npwm_show, NULL), +- __ATTR_NULL, ++static struct attribute *pwm_chip_attrs[] = { ++ &dev_attr_export.attr, ++ &dev_attr_unexport.attr, ++ &dev_attr_npwm.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(pwm_chip); + + static struct class pwm_class = { + .name = "pwm", + .owner = THIS_MODULE, +- .dev_attrs = pwm_chip_attrs, ++ .dev_groups = pwm_chip_groups, + }; + + static int pwmchip_sysfs_match(struct device *parent, const void *data) |
