Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692373

Re: [PATCH v2 5/7] Input: gpio_keys - use devm_device_add_group() for attributes

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject Re: [PATCH v2 5/7] Input: gpio_keys - use devm_device_add_group() for attributes
Date 2017-07-20 05:30 +0200
Message-ID <u5ak1-1ov-11@gated-at.bofh.it> (permalink)
References <u57vQ-7Pa-5@gated-at.bofh.it> <u57vQ-7Pa-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07/19/2017 05:24 PM, Dmitry Torokhov wrote:
> Now that we have proper managed API to create device attributes, let's
> start using it instead of the manual unwinding.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/input/keyboard/gpio_keys.c | 16 ++--------------
>   1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index f52812db91bc..e9f0ebf3267a 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -827,7 +827,7 @@ static int gpio_keys_probe(struct platform_device *pdev)
>   
>   	fwnode_handle_put(child);
>   
> -	error = sysfs_create_group(&dev->kobj, &gpio_keys_attr_group);
> +	error = devm_device_add_group(dev, &gpio_keys_attr_group);
>   	if (error) {
>   		dev_err(dev, "Unable to export keys/switches, error: %d\n",
>   			error);
> @@ -838,22 +838,11 @@ static int gpio_keys_probe(struct platform_device *pdev)
>   	if (error) {
>   		dev_err(dev, "Unable to register input device, error: %d\n",
>   			error);
> -		goto err_remove_group;
> +		return error;
>   	}
>   
>   	device_init_wakeup(dev, wakeup);
>   
> -	return 0;
> -
> -err_remove_group:
> -	sysfs_remove_group(&dev->kobj, &gpio_keys_attr_group);
> -	return error;
> -}
> -
> -static int gpio_keys_remove(struct platform_device *pdev)
> -{
> -	sysfs_remove_group(&pdev->dev.kobj, &gpio_keys_attr_group);
> -
>   	return 0;
>   }
>   
> @@ -912,7 +901,6 @@ static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
>   
>   static struct platform_driver gpio_keys_device_driver = {
>   	.probe		= gpio_keys_probe,
> -	.remove		= gpio_keys_remove,
>   	.driver		= {
>   		.name	= "gpio-keys",
>   		.pm	= &gpio_keys_pm_ops,
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v2 5/7] Input: gpio_keys - use devm_device_add_group() for attributes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-07-20 02:30 +0200
  Re: [PATCH v2 5/7] Input: gpio_keys - use devm_device_add_group() for  attributes Guenter Roeck <linux@roeck-us.net> - 2017-07-20 05:30 +0200

csiph-web