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]
Message-ID: <ZMfWm6H8IKiyTh0R@nixie71>
Date:   Mon, 31 Jul 2023 10:43:23 -0500
From:   Jeff LaBundy <jeff@...undy.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 15/22] Input: iqs5xx - use device core to create
 driver-specific device attributes

On Fri, Jul 28, 2023 at 05:51:24PM -0700, Dmitry Torokhov wrote:
> Instead of creating driver-specific device attributes with
> devm_device_add_group() have device core do this by setting up dev_groups
> pointer in the driver structure.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

Reviewed-by: Jeff LaBundy <jeff@...undy.com>

> ---
>  drivers/input/touchscreen/iqs5xx.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
> index b4768b66eb10..a3f4fb85bee5 100644
> --- a/drivers/input/touchscreen/iqs5xx.c
> +++ b/drivers/input/touchscreen/iqs5xx.c
> @@ -974,10 +974,11 @@ static umode_t iqs5xx_attr_is_visible(struct kobject *kobj,
>  	return attr->mode;
>  }
>  
> -static const struct attribute_group iqs5xx_attr_group = {
> +static const struct attribute_group iqs5xx_group = {
>  	.is_visible = iqs5xx_attr_is_visible,
>  	.attrs = iqs5xx_attrs,
>  };
> +__ATTRIBUTE_GROUPS(iqs5xx);
>  
>  static int iqs5xx_suspend(struct device *dev)
>  {
> @@ -1053,12 +1054,6 @@ static int iqs5xx_probe(struct i2c_client *client)
>  		return error;
>  	}
>  
> -	error = devm_device_add_group(&client->dev, &iqs5xx_attr_group);
> -	if (error) {
> -		dev_err(&client->dev, "Failed to add attributes: %d\n", error);
> -		return error;
> -	}
> -
>  	if (iqs5xx->input) {
>  		error = input_register_device(iqs5xx->input);
>  		if (error)
> @@ -1089,6 +1084,7 @@ MODULE_DEVICE_TABLE(of, iqs5xx_of_match);
>  static struct i2c_driver iqs5xx_i2c_driver = {
>  	.driver = {
>  		.name		= "iqs5xx",
> +		.dev_groups	= iqs5xx_groups,
>  		.of_match_table	= iqs5xx_of_match,
>  		.pm		= pm_sleep_ptr(&iqs5xx_pm),
>  	},
> -- 
> 2.41.0.487.g6d72f3e995-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ