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: <SN7PR03MB71321062471405BBF3F9C5188E05A@SN7PR03MB7132.namprd03.prod.outlook.com>
Date:   Mon, 31 Jul 2023 05:23:01 +0000
From:   "Hennerich, Michael" <Michael.Hennerich@...log.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: RE: [PATCH 05/22] Input: ad7877 - use device core to create
 driver-specific device attributes



> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@...il.com>
> Sent: Samstag, 29. Juli 2023 02:51
> To: linux-input@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org; Greg Kroah-Hartman
> <gregkh@...uxfoundation.org>; Hennerich, Michael
> <Michael.Hennerich@...log.com>
> Subject: [PATCH 05/22] Input: ad7877 - use device core to create driver-
> specific device attributes
> 
> 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>

Acked-by: Michael Hennerich <michael.hennerich@...log.com>

> ---
>  drivers/input/touchscreen/ad7877.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ad7877.c
> b/drivers/input/touchscreen/ad7877.c
> index edb36d663f22..a0598e9c7aff 100644
> --- a/drivers/input/touchscreen/ad7877.c
> +++ b/drivers/input/touchscreen/ad7877.c
> @@ -612,10 +612,11 @@ static umode_t ad7877_attr_is_visible(struct
> kobject *kobj,
>  	return mode;
>  }
> 
> -static const struct attribute_group ad7877_attr_group = {
> +static const struct attribute_group ad7877_group = {
>  	.is_visible	= ad7877_attr_is_visible,
>  	.attrs		= ad7877_attributes,
>  };
> +__ATTRIBUTE_GROUPS(ad7877);
> 
>  static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877
> *ts)  { @@ -777,10 +778,6 @@ static int ad7877_probe(struct spi_device
> *spi)
>  		return err;
>  	}
> 
> -	err = devm_device_add_group(&spi->dev, &ad7877_attr_group);
> -	if (err)
> -		return err;
> -
>  	err = input_register_device(input_dev);
>  	if (err)
>  		return err;
> @@ -810,8 +807,9 @@ static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm,
> ad7877_suspend, ad7877_resume);
> 
>  static struct spi_driver ad7877_driver = {
>  	.driver = {
> -		.name	= "ad7877",
> -		.pm	= pm_sleep_ptr(&ad7877_pm),
> +		.name		= "ad7877",
> +		.dev_groups	= ad7877_groups,
> +		.pm		= pm_sleep_ptr(&ad7877_pm),
>  	},
>  	.probe		= ad7877_probe,
>  };
> --
> 2.41.0.487.g6d72f3e995-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ