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>
This commit is contained in:
Greg Kroah-Hartman 2019-08-11 23:41:23 -07:00 committed by Dmitry Torokhov
parent 3281ddddc2
commit cf1b2a208d
1 changed files with 2 additions and 11 deletions

View File

@ -351,10 +351,7 @@ static struct attribute *gpio_keys_attrs[] = {
&dev_attr_disabled_switches.attr,
NULL,
};
static const struct attribute_group gpio_keys_attr_group = {
.attrs = gpio_keys_attrs,
};
ATTRIBUTE_GROUPS(gpio_keys);
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
{
@ -851,13 +848,6 @@ static int gpio_keys_probe(struct platform_device *pdev)
fwnode_handle_put(child);
error = devm_device_add_group(dev, &gpio_keys_attr_group);
if (error) {
dev_err(dev, "Unable to export keys/switches, error: %d\n",
error);
return error;
}
error = input_register_device(input);
if (error) {
dev_err(dev, "Unable to register input device, error: %d\n",
@ -1026,6 +1016,7 @@ static struct platform_driver gpio_keys_device_driver = {
.name = "gpio-keys",
.pm = &gpio_keys_pm_ops,
.of_match_table = gpio_keys_of_match,
.dev_groups = gpio_keys_groups,
}
};