diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-12 02:41:23 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-08-12 03:02:38 -0400 |
commit | cf1b2a208d2e1b4c436a56672d09d12c34c06384 (patch) | |
tree | 574daeabf72c670e2618af0bed96705bfc3a96d1 | |
parent | 3281ddddc205012fa3484ddd3abdfaab781af000 (diff) |
Input: gpio_keys - convert driver to use dev_groups
Drivers now have the option to have the driver core create and remove any
needed sysfs attribute files. So take advantage of that and do not
register "by hand" a bunch of sysfs files.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 03f4d152f6b7..1373dc5b0765 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -351,10 +351,7 @@ static struct attribute *gpio_keys_attrs[] = { | |||
351 | &dev_attr_disabled_switches.attr, | 351 | &dev_attr_disabled_switches.attr, |
352 | NULL, | 352 | NULL, |
353 | }; | 353 | }; |
354 | 354 | ATTRIBUTE_GROUPS(gpio_keys); | |
355 | static const struct attribute_group gpio_keys_attr_group = { | ||
356 | .attrs = gpio_keys_attrs, | ||
357 | }; | ||
358 | 355 | ||
359 | static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) | 356 | static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) |
360 | { | 357 | { |
@@ -851,13 +848,6 @@ static int gpio_keys_probe(struct platform_device *pdev) | |||
851 | 848 | ||
852 | fwnode_handle_put(child); | 849 | fwnode_handle_put(child); |
853 | 850 | ||
854 | error = devm_device_add_group(dev, &gpio_keys_attr_group); | ||
855 | if (error) { | ||
856 | dev_err(dev, "Unable to export keys/switches, error: %d\n", | ||
857 | error); | ||
858 | return error; | ||
859 | } | ||
860 | |||
861 | error = input_register_device(input); | 851 | error = input_register_device(input); |
862 | if (error) { | 852 | if (error) { |
863 | dev_err(dev, "Unable to register input device, error: %d\n", | 853 | dev_err(dev, "Unable to register input device, error: %d\n", |
@@ -1026,6 +1016,7 @@ static struct platform_driver gpio_keys_device_driver = { | |||
1026 | .name = "gpio-keys", | 1016 | .name = "gpio-keys", |
1027 | .pm = &gpio_keys_pm_ops, | 1017 | .pm = &gpio_keys_pm_ops, |
1028 | .of_match_table = gpio_keys_of_match, | 1018 | .of_match_table = gpio_keys_of_match, |
1019 | .dev_groups = gpio_keys_groups, | ||
1029 | } | 1020 | } |
1030 | }; | 1021 | }; |
1031 | 1022 | ||