lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 11 Aug 2019 23:59:15 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org,
        Richard Gong <richard.gong@...ux.intel.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org
Subject: Re: [PATCH v2 03/10] input: keyboard: gpio_keys: convert platform
 driver to use dev_groups

On Wed, Jul 31, 2019 at 02:43:42PM +0200, Greg Kroah-Hartman wrote:
> Platform drivers now have the option to have the platform 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.
> 
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
> Cc: dri-devel@...ts.freedesktop.org
> Cc: linux-fbdev@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Applied, thank you.

> ---
>  drivers/input/keyboard/gpio_keys.c | 13 ++-----------
>  1 file 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[] = {
>  	&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,
>  	}
>  };
>  
> -- 
> 2.22.0
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ