* RE: [PATCH 05/22] Input: ad7877 - use device core to create driver-specific device attributes
From: Hennerich, Michael @ 2023-07-31 5:23 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-5-dmitry.torokhov@gmail.com>
> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Sent: Samstag, 29. Juli 2023 02:51
> To: linux-input@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Hennerich, Michael
> <Michael.Hennerich@analog.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@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.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
^ permalink raw reply
* Re: [PATCH] hid-mcp2200: added driver for GPIOs of MCP2200
From: Johannes Roith @ 2023-07-30 19:37 UTC (permalink / raw)
To: christophe.jaillet
Cc: andi.shyti, benjamin.tissoires, jikos, johannes, linux-input,
linux-kernel, ak
In-Reply-To: <df1acc44-62c3-1ac6-103e-561baf8e38e4@wanadoo.fr>
Hello Andi, hello Christophe,
thanks for the feedback and the hints. I will add most of your suggestions to
the driver and submit a new patch, this time with a correct Version Label.
I need to use dynamic memory allocation for the data passed to
hid_hw_output_report, overwise the function doesn't work, 0 bytes will be sent.
The memory has to be allocated dynamically because of the DMA usage in the
background.
But all the over feedback looks good and will be added to the driver.
Best regards,
Johannes
^ permalink raw reply
* Re: Fwd: 6.5 - 6.4.7 Regression : ASUS UM5302TA Keyboard don't work
From: Mario Limonciello @ 2023-07-30 18:07 UTC (permalink / raw)
To: Linux regressions mailing list
Cc: Linux Input Devices, ACPI Asus, Linux x86 Platform Drivers,
Linux Kernel Mailing List, Bagas Sanjaya, Dmitry Torokhov,
Corentin Chary, Guilhem Lettron
In-Reply-To: <8ee87fe1-684f-ad59-21c7-4401a4e70bee@leemhuis.info>
On 7/29/23 23:49, Linux regression tracking (Thorsten Leemhuis) wrote:
> Lo!
>
> On 30.07.23 04:41, Bagas Sanjaya wrote:
>>
>> I notice a regression report on Bugzilla [1]. Quoting from it:
>>
>>> On a kernel 6.4.5 and less, the keyboard is working fine.
>>>
>>> Beginning with 6.5 rc1 and 6.4.7 any key don't respond.
>
> That is a AMD Ryzen Laptop. And if that really started from
> v6.4.6..v6.4.7 then I guess there is a decent chance that this is caused
> by ```ACPI: resource: Remove "Zen" specific match and quirks``` from
> Mario. Hence adding him to the list of recipients.
>
> Guilhem Lettron: if you have a minute, could you try if reverting that
> patch ontop of 6.4.7 fixes things?
>
That looks the most likely to me too.
If it helps, I would like the artifacts I requested added to the kernel
bugzilla.
> Ciao, Thorsten
>
>>> [ 0.668850] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input5
>>> ...
>>> [ 1.930328] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input13
>>
>> See Bugzilla for the full thread.
>>
>> Anyway, I'm adding this regression to regzbot:
>>
>> #regzbot introduced: v6.4..v6.5-rc1 https://bugzilla.kernel.org/show_bug.cgi?id=217726
>> #regzbot title: ASUE140D:00 04F3:31B9 doesn't respond to input
>>
>> Thanks.
>>
>> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217726
>
^ permalink raw reply
* Re: [PATCH 19/22] Input: s6sy761 - use device core to create driver-specific device attributes
From: Andi Shyti @ 2023-07-30 13:02 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-19-dmitry.torokhov@gmail.com>
Hi Dmitry,
On Fri, Jul 28, 2023 at 05:51:28PM -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@gmail.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Andi
> ---
> drivers/input/touchscreen/s6sy761.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c
> index 998d99d18911..149cc2c4925e 100644
> --- a/drivers/input/touchscreen/s6sy761.c
> +++ b/drivers/input/touchscreen/s6sy761.c
> @@ -286,10 +286,7 @@ static struct attribute *s6sy761_sysfs_attrs[] = {
> &dev_attr_devid.attr,
> NULL
> };
> -
> -static struct attribute_group s6sy761_attribute_group = {
> - .attrs = s6sy761_sysfs_attrs
> -};
> +ATTRIBUTE_GROUPS(s6sy761_sysfs);
>
> static int s6sy761_power_on(struct s6sy761_data *sdata)
> {
> @@ -465,10 +462,6 @@ static int s6sy761_probe(struct i2c_client *client)
> if (err)
> return err;
>
> - err = devm_device_add_group(&client->dev, &s6sy761_attribute_group);
> - if (err)
> - return err;
> -
> pm_runtime_enable(&client->dev);
>
> return 0;
> @@ -535,6 +528,7 @@ MODULE_DEVICE_TABLE(i2c, s6sy761_id);
> static struct i2c_driver s6sy761_driver = {
> .driver = {
> .name = S6SY761_DEV_NAME,
> + .dev_groups = s6sy761_sysfs_groups,
> .of_match_table = of_match_ptr(s6sy761_of_match),
> .pm = pm_ptr(&s6sy761_pm_ops),
> },
> --
> 2.41.0.487.g6d72f3e995-goog
>
^ permalink raw reply
* Re: [PATCH 20/22] Input: stmfts - use device core to create driver-specific device attributes
From: Andi Shyti @ 2023-07-30 13:02 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, Greg Kroah-Hartman, Maxime Coquelin,
Alexandre Torgue
In-Reply-To: <20230729005133.1095051-20-dmitry.torokhov@gmail.com>
Hi Dmitry,
On Fri, Jul 28, 2023 at 05:51:29PM -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@gmail.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Andi
^ permalink raw reply
* Re: [PATCH 13/22] Input: ili210x - use device core to create driver-specific device attributes
From: Marek Vasut @ 2023-07-30 12:24 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Dmitry Torokhov, linux-input, linux-kernel
In-Reply-To: <2023073010-debunk-tripping-270a@gregkh>
On 7/30/23 13:38, Greg Kroah-Hartman wrote:
> On Sat, Jul 29, 2023 at 05:07:17PM +0200, Marek Vasut wrote:
>> On 7/29/23 02:51, 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@gmail.com>
>>> ---
>>> drivers/input/touchscreen/ili210x.c | 15 +++++----------
>>> 1 file changed, 5 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
>>> index ad6828e4f2e2..31ffdc2a93f3 100644
>>> --- a/drivers/input/touchscreen/ili210x.c
>>> +++ b/drivers/input/touchscreen/ili210x.c
>>> @@ -876,7 +876,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
>>> static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store);
>>> -static struct attribute *ili210x_attributes[] = {
>>> +static struct attribute *ili210x_attrs[] = {
>>> &dev_attr_calibrate.attr,
>>> &dev_attr_firmware_update.attr,
>>> &dev_attr_firmware_version.attr,
>>> @@ -904,10 +904,11 @@ static umode_t ili210x_attributes_visible(struct kobject *kobj,
>>> return attr->mode;
>>> }
>>> -static const struct attribute_group ili210x_attr_group = {
>>> - .attrs = ili210x_attributes,
>>> +static const struct attribute_group ili210x_group = {
>>> + .attrs = ili210x_attrs,
>>
>> Is all the renaming really necessary and relevant to this patch ?
>
> Yes, it's needed for the __ATTRIBUTE_GROUPS() macro.
Ah ok
^ permalink raw reply
* Re: [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes
From: Greg Kroah-Hartman @ 2023-07-30 11:39 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, Benson Leung, Guenter Roeck,
chrome-platform
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
On Fri, Jul 28, 2023 at 05:51:10PM -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@gmail.com>
> ---
> drivers/input/keyboard/cros_ec_keyb.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
All of these look great, thanks for doing them:
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply
* Re: [PATCH 13/22] Input: ili210x - use device core to create driver-specific device attributes
From: Greg Kroah-Hartman @ 2023-07-30 11:38 UTC (permalink / raw)
To: Marek Vasut; +Cc: Dmitry Torokhov, linux-input, linux-kernel
In-Reply-To: <fd975ac8-bea4-22ae-cb5f-cbdaa3566d25@denx.de>
On Sat, Jul 29, 2023 at 05:07:17PM +0200, Marek Vasut wrote:
> On 7/29/23 02:51, 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@gmail.com>
> > ---
> > drivers/input/touchscreen/ili210x.c | 15 +++++----------
> > 1 file changed, 5 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
> > index ad6828e4f2e2..31ffdc2a93f3 100644
> > --- a/drivers/input/touchscreen/ili210x.c
> > +++ b/drivers/input/touchscreen/ili210x.c
> > @@ -876,7 +876,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
> > static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store);
> > -static struct attribute *ili210x_attributes[] = {
> > +static struct attribute *ili210x_attrs[] = {
> > &dev_attr_calibrate.attr,
> > &dev_attr_firmware_update.attr,
> > &dev_attr_firmware_version.attr,
> > @@ -904,10 +904,11 @@ static umode_t ili210x_attributes_visible(struct kobject *kobj,
> > return attr->mode;
> > }
> > -static const struct attribute_group ili210x_attr_group = {
> > - .attrs = ili210x_attributes,
> > +static const struct attribute_group ili210x_group = {
> > + .attrs = ili210x_attrs,
>
> Is all the renaming really necessary and relevant to this patch ?
Yes, it's needed for the __ATTRIBUTE_GROUPS() macro.
thanks,
greg k-h
^ permalink raw reply
* Re: Fwd: 6.5 - 6.4.7 Regression : ASUS UM5302TA Keyboard don't work
From: Linux regression tracking (Thorsten Leemhuis) @ 2023-07-30 4:49 UTC (permalink / raw)
To: Mario Limonciello
Cc: Linux Input Devices, ACPI Asus, Linux x86 Platform Drivers,
Linux Kernel Mailing List, Linux Regressions, Bagas Sanjaya,
Dmitry Torokhov, Corentin Chary, Guilhem Lettron
In-Reply-To: <bdc6cb4d-a853-72b2-b132-989b64740ad9@gmail.com>
Lo!
On 30.07.23 04:41, Bagas Sanjaya wrote:
>
> I notice a regression report on Bugzilla [1]. Quoting from it:
>
>> On a kernel 6.4.5 and less, the keyboard is working fine.
>>
>> Beginning with 6.5 rc1 and 6.4.7 any key don't respond.
That is a AMD Ryzen Laptop. And if that really started from
v6.4.6..v6.4.7 then I guess there is a decent chance that this is caused
by ```ACPI: resource: Remove "Zen" specific match and quirks``` from
Mario. Hence adding him to the list of recipients.
Guilhem Lettron: if you have a minute, could you try if reverting that
patch ontop of 6.4.7 fixes things?
Ciao, Thorsten
>> [ 0.668850] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input5
>> ...
>> [ 1.930328] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input13
>
> See Bugzilla for the full thread.
>
> Anyway, I'm adding this regression to regzbot:
>
> #regzbot introduced: v6.4..v6.5-rc1 https://bugzilla.kernel.org/show_bug.cgi?id=217726
> #regzbot title: ASUE140D:00 04F3:31B9 doesn't respond to input
>
> Thanks.
>
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217726
^ permalink raw reply
* Fwd: 6.5 - 6.4.7 Regression : ASUS UM5302TA Keyboard don't work
From: Bagas Sanjaya @ 2023-07-30 2:41 UTC (permalink / raw)
To: Dmitry Torokhov, Corentin Chary, Guilhem Lettron
Cc: Linux Input Devices, ACPI Asus, Linux x86 Platform Drivers,
Linux Kernel Mailing List, Linux Regressions
Hi,
I notice a regression report on Bugzilla [1]. Quoting from it:
> On a kernel 6.4.5 and less, the keyboard is working fine.
>
> Beginning with 6.5 rc1 and 6.4.7 any key don't respond.
>
> [ 0.668850] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input5
> ...
> [ 1.930328] input: ASUE140D:00 04F3:31B9 Keyboard as /devices/platform/AMDI0010:01/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input13
See Bugzilla for the full thread.
Anyway, I'm adding this regression to regzbot:
#regzbot introduced: v6.4..v6.5-rc1 https://bugzilla.kernel.org/show_bug.cgi?id=217726
#regzbot title: ASUE140D:00 04F3:31B9 doesn't respond to input
Thanks.
[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217726
--
An old man doll... just what I always wanted! - Clara
^ permalink raw reply
* Re: [PATCH 13/22] Input: ili210x - use device core to create driver-specific device attributes
From: Marek Vasut @ 2023-07-29 15:07 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-13-dmitry.torokhov@gmail.com>
On 7/29/23 02:51, 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@gmail.com>
> ---
> drivers/input/touchscreen/ili210x.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
> index ad6828e4f2e2..31ffdc2a93f3 100644
> --- a/drivers/input/touchscreen/ili210x.c
> +++ b/drivers/input/touchscreen/ili210x.c
> @@ -876,7 +876,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
>
> static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store);
>
> -static struct attribute *ili210x_attributes[] = {
> +static struct attribute *ili210x_attrs[] = {
> &dev_attr_calibrate.attr,
> &dev_attr_firmware_update.attr,
> &dev_attr_firmware_version.attr,
> @@ -904,10 +904,11 @@ static umode_t ili210x_attributes_visible(struct kobject *kobj,
> return attr->mode;
> }
>
> -static const struct attribute_group ili210x_attr_group = {
> - .attrs = ili210x_attributes,
> +static const struct attribute_group ili210x_group = {
> + .attrs = ili210x_attrs,
Is all the renaming really necessary and relevant to this patch ?
btw since I have your attention, could you also look at discussion
[PATCH] Input: pwm-beeper - Support volume setting via sysfs
? I've been waiting for any maintainer input for over two months now.
Thanks
^ permalink raw reply
* Re: [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes
From: Guenter Roeck @ 2023-07-29 2:40 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, Greg Kroah-Hartman, Benson Leung,
Guenter Roeck, chrome-platform
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
On Fri, Jul 28, 2023 at 5:51 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> 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@gmail.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> drivers/input/keyboard/cros_ec_keyb.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index e7ecfca838df..313b7a69dd69 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -686,10 +686,11 @@ static umode_t cros_ec_keyb_attr_is_visible(struct kobject *kobj,
> return attr->mode;
> }
>
> -static const struct attribute_group cros_ec_keyb_attr_group = {
> +static const struct attribute_group cros_ec_keyb_group = {
> .is_visible = cros_ec_keyb_attr_is_visible,
> .attrs = cros_ec_keyb_attrs,
> };
> +__ATTRIBUTE_GROUPS(cros_ec_keyb);
>
> static int cros_ec_keyb_probe(struct platform_device *pdev)
> {
> @@ -730,12 +731,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
> return err;
> }
>
> - err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
> - if (err) {
> - dev_err(dev, "failed to create attributes: %d\n", err);
> - return err;
> - }
> -
> ckdev->notifier.notifier_call = cros_ec_keyb_work;
> err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
> &ckdev->notifier);
> @@ -782,6 +777,7 @@ static struct platform_driver cros_ec_keyb_driver = {
> .remove = cros_ec_keyb_remove,
> .driver = {
> .name = "cros-ec-keyb",
> + .dev_groups = cros_ec_keyb_groups,
> .of_match_table = of_match_ptr(cros_ec_keyb_of_match),
> .acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
> .pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
> --
> 2.41.0.487.g6d72f3e995-goog
>
^ permalink raw reply
* [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Greg Kroah-Hartman, Benson Leung, Guenter Roeck,
chrome-platform
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@gmail.com>
---
drivers/input/keyboard/cros_ec_keyb.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index e7ecfca838df..313b7a69dd69 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -686,10 +686,11 @@ static umode_t cros_ec_keyb_attr_is_visible(struct kobject *kobj,
return attr->mode;
}
-static const struct attribute_group cros_ec_keyb_attr_group = {
+static const struct attribute_group cros_ec_keyb_group = {
.is_visible = cros_ec_keyb_attr_is_visible,
.attrs = cros_ec_keyb_attrs,
};
+__ATTRIBUTE_GROUPS(cros_ec_keyb);
static int cros_ec_keyb_probe(struct platform_device *pdev)
{
@@ -730,12 +731,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
return err;
}
- err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
- if (err) {
- dev_err(dev, "failed to create attributes: %d\n", err);
- return err;
- }
-
ckdev->notifier.notifier_call = cros_ec_keyb_work;
err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
&ckdev->notifier);
@@ -782,6 +777,7 @@ static struct platform_driver cros_ec_keyb_driver = {
.remove = cros_ec_keyb_remove,
.driver = {
.name = "cros-ec-keyb",
+ .dev_groups = cros_ec_keyb_groups,
.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 02/22] Input: cyapa - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/mouse/cyapa.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index 6a876ba617ef..f9b4a7458b4e 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -1225,7 +1225,7 @@ static DEVICE_ATTR(baseline, S_IRUGO, cyapa_show_baseline, NULL);
static DEVICE_ATTR(calibrate, S_IWUSR, NULL, cyapa_calibrate_store);
static DEVICE_ATTR(mode, S_IRUGO, cyapa_show_mode, NULL);
-static struct attribute *cyapa_sysfs_entries[] = {
+static struct attribute *cyapa_attrs[] = {
&dev_attr_firmware_version.attr,
&dev_attr_product_id.attr,
&dev_attr_update_fw.attr,
@@ -1234,10 +1234,7 @@ static struct attribute *cyapa_sysfs_entries[] = {
&dev_attr_mode.attr,
NULL,
};
-
-static const struct attribute_group cyapa_sysfs_group = {
- .attrs = cyapa_sysfs_entries,
-};
+ATTRIBUTE_GROUPS(cyapa);
static void cyapa_disable_regulator(void *data)
{
@@ -1304,12 +1301,6 @@ static int cyapa_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(dev, &cyapa_sysfs_group);
- if (error) {
- dev_err(dev, "failed to create sysfs entries: %d\n", error);
- return error;
- }
-
error = cyapa_prepare_wakeup_controls(cyapa);
if (error) {
dev_err(dev, "failed to prepare wakeup controls: %d\n", error);
@@ -1486,6 +1477,7 @@ MODULE_DEVICE_TABLE(of, cyapa_of_match);
static struct i2c_driver cyapa_driver = {
.driver = {
.name = "cyapa",
+ .dev_groups = cyapa_groups,
.pm = pm_ptr(&cyapa_pm_ops),
.acpi_match_table = ACPI_PTR(cyapa_acpi_id),
.of_match_table = of_match_ptr(cyapa_of_match),
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 13/22] Input: ili210x - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman, Marek Vasut
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/ili210x.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index ad6828e4f2e2..31ffdc2a93f3 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -876,7 +876,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store);
-static struct attribute *ili210x_attributes[] = {
+static struct attribute *ili210x_attrs[] = {
&dev_attr_calibrate.attr,
&dev_attr_firmware_update.attr,
&dev_attr_firmware_version.attr,
@@ -904,10 +904,11 @@ static umode_t ili210x_attributes_visible(struct kobject *kobj,
return attr->mode;
}
-static const struct attribute_group ili210x_attr_group = {
- .attrs = ili210x_attributes,
+static const struct attribute_group ili210x_group = {
+ .attrs = ili210x_attrs,
.is_visible = ili210x_attributes_visible,
};
+__ATTRIBUTE_GROUPS(ili210x);
static void ili210x_power_down(void *data)
{
@@ -1013,13 +1014,6 @@ static int ili210x_i2c_probe(struct i2c_client *client)
if (error)
return error;
- error = devm_device_add_group(dev, &ili210x_attr_group);
- if (error) {
- dev_err(dev, "Unable to create sysfs attributes, err: %d\n",
- error);
- return error;
- }
-
error = input_register_device(priv->input);
if (error) {
dev_err(dev, "Cannot register input device, err: %d\n", error);
@@ -1050,6 +1044,7 @@ MODULE_DEVICE_TABLE(of, ili210x_dt_ids);
static struct i2c_driver ili210x_ts_driver = {
.driver = {
.name = "ili210x_i2c",
+ .dev_groups = ili210x_groups,
.of_match_table = ili210x_dt_ids,
},
.id_table = ili210x_i2c_id,
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 12/22] Input: hycon-hy46xx - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman, Giulio Benetti
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/hycon-hy46xx.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/input/touchscreen/hycon-hy46xx.c b/drivers/input/touchscreen/hycon-hy46xx.c
index 2450cfa14de9..d0f257989fd6 100644
--- a/drivers/input/touchscreen/hycon-hy46xx.c
+++ b/drivers/input/touchscreen/hycon-hy46xx.c
@@ -274,10 +274,7 @@ static struct attribute *hycon_hy46xx_attrs[] = {
&hycon_hy46xx_attr_bootloader_version.dattr.attr,
NULL
};
-
-static const struct attribute_group hycon_hy46xx_attr_group = {
- .attrs = hycon_hy46xx_attrs,
-};
+ATTRIBUTE_GROUPS(hycon_hy46xx);
static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata)
{
@@ -535,10 +532,6 @@ static int hycon_hy46xx_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &hycon_hy46xx_attr_group);
- if (error)
- return error;
-
error = input_register_device(input);
if (error)
return error;
@@ -576,6 +569,7 @@ MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match);
static struct i2c_driver hycon_hy46xx_driver = {
.driver = {
.name = "hycon_hy46xx",
+ .dev_groups = hycon_hy46xx_groups,
.of_match_table = hycon_hy46xx_of_match,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 21/22] Input: tsc2004/5 - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
Instead of creating driver-specific device attributes with
sysfs_create_group() have device core do this by setting up dev_groups
pointer in the driver structure.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/touchscreen/tsc2004.c | 7 ++++---
drivers/input/touchscreen/tsc2005.c | 7 ++++---
drivers/input/touchscreen/tsc200x-core.c | 18 +++++++-----------
drivers/input/touchscreen/tsc200x-core.h | 1 +
4 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c
index b5e904c5b7c4..89c5248f66f6 100644
--- a/drivers/input/touchscreen/tsc2004.c
+++ b/drivers/input/touchscreen/tsc2004.c
@@ -63,9 +63,10 @@ MODULE_DEVICE_TABLE(of, tsc2004_of_match);
static struct i2c_driver tsc2004_driver = {
.driver = {
- .name = "tsc2004",
- .of_match_table = of_match_ptr(tsc2004_of_match),
- .pm = pm_sleep_ptr(&tsc200x_pm_ops),
+ .name = "tsc2004",
+ .dev_groups = tsc200x_groups,
+ .of_match_table = of_match_ptr(tsc2004_of_match),
+ .pm = pm_sleep_ptr(&tsc200x_pm_ops),
},
.id_table = tsc2004_idtable,
.probe = tsc2004_probe,
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index b6dfbcfc8c19..1b40ce0ca1b9 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -79,9 +79,10 @@ MODULE_DEVICE_TABLE(of, tsc2005_of_match);
static struct spi_driver tsc2005_driver = {
.driver = {
- .name = "tsc2005",
- .of_match_table = of_match_ptr(tsc2005_of_match),
- .pm = pm_sleep_ptr(&tsc200x_pm_ops),
+ .name = "tsc2005",
+ .dev_groups = tsc200x_groups,
+ .of_match_table = of_match_ptr(tsc2005_of_match),
+ .pm = pm_sleep_ptr(&tsc200x_pm_ops),
},
.probe = tsc2005_probe,
.remove = tsc2005_remove,
diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c
index b799f26fcf8f..a4c0e9db9bb9 100644
--- a/drivers/input/touchscreen/tsc200x-core.c
+++ b/drivers/input/touchscreen/tsc200x-core.c
@@ -356,6 +356,12 @@ static const struct attribute_group tsc200x_attr_group = {
.attrs = tsc200x_attrs,
};
+const struct attribute_group *tsc200x_groups[] = {
+ &tsc200x_attr_group,
+ NULL
+};
+EXPORT_SYMBOL_GPL(tsc200x_groups);
+
static void tsc200x_esd_work(struct work_struct *work)
{
struct tsc200x *ts = container_of(work, struct tsc200x, esd_work.work);
@@ -553,25 +559,17 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
return error;
dev_set_drvdata(dev, ts);
- error = sysfs_create_group(&dev->kobj, &tsc200x_attr_group);
- if (error) {
- dev_err(dev,
- "Failed to create sysfs attributes, err: %d\n", error);
- goto disable_regulator;
- }
error = input_register_device(ts->idev);
if (error) {
dev_err(dev,
"Failed to register input device, err: %d\n", error);
- goto err_remove_sysfs;
+ goto disable_regulator;
}
irq_set_irq_wake(irq, 1);
return 0;
-err_remove_sysfs:
- sysfs_remove_group(&dev->kobj, &tsc200x_attr_group);
disable_regulator:
regulator_disable(ts->vio);
return error;
@@ -582,8 +580,6 @@ void tsc200x_remove(struct device *dev)
{
struct tsc200x *ts = dev_get_drvdata(dev);
- sysfs_remove_group(&dev->kobj, &tsc200x_attr_group);
-
regulator_disable(ts->vio);
}
EXPORT_SYMBOL_GPL(tsc200x_remove);
diff --git a/drivers/input/touchscreen/tsc200x-core.h b/drivers/input/touchscreen/tsc200x-core.h
index 4ded34425b21..37de91efd78e 100644
--- a/drivers/input/touchscreen/tsc200x-core.h
+++ b/drivers/input/touchscreen/tsc200x-core.h
@@ -70,6 +70,7 @@
extern const struct regmap_config tsc200x_regmap_config;
extern const struct dev_pm_ops tsc200x_pm_ops;
+extern const struct attribute_group *tsc200x_groups[];
int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
struct regmap *regmap,
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 09/22] Input: elants_i2c - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Greg Kroah-Hartman, Douglas Anderson, Raul E Rangel
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/elants_i2c.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index a1af3de9f310..365765d40e62 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1299,7 +1299,7 @@ static ELANTS_VERSION_ATTR(solution_version);
static ELANTS_VERSION_ATTR(bc_version);
static ELANTS_VERSION_ATTR(iap_version);
-static struct attribute *elants_attributes[] = {
+static struct attribute *elants_i2c_attrs[] = {
&dev_attr_calibrate.attr,
&dev_attr_update_fw.attr,
&dev_attr_iap_mode.attr,
@@ -1313,10 +1313,7 @@ static struct attribute *elants_attributes[] = {
&elants_ver_attr_iap_version.dattr.attr,
NULL
};
-
-static const struct attribute_group elants_attribute_group = {
- .attrs = elants_attributes,
-};
+ATTRIBUTE_GROUPS(elants_i2c);
static int elants_i2c_power_on(struct elants_data *ts)
{
@@ -1552,13 +1549,6 @@ static int elants_i2c_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &elants_attribute_group);
- if (error) {
- dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
- error);
- return error;
- }
-
return 0;
}
@@ -1667,6 +1657,7 @@ static struct i2c_driver elants_i2c_driver = {
.id_table = elants_i2c_id,
.driver = {
.name = DEVICE_NAME,
+ .dev_groups = elants_i2c_groups,
.pm = pm_sleep_ptr(&elants_i2c_pm_ops),
.acpi_match_table = ACPI_PTR(elants_acpi_id),
.of_match_table = of_match_ptr(elants_of_match),
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 08/22] Input: edt-ft5x06 - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/edt-ft5x06.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 457d53337fbb..3e102bcc4a1c 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -580,10 +580,7 @@ static struct attribute *edt_ft5x06_attrs[] = {
&dev_attr_crc_errors.attr,
NULL
};
-
-static const struct attribute_group edt_ft5x06_attr_group = {
- .attrs = edt_ft5x06_attrs,
-};
+ATTRIBUTE_GROUPS(edt_ft5x06);
static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata)
{
@@ -1330,10 +1327,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group);
- if (error)
- return error;
-
error = input_register_device(input);
if (error)
return error;
@@ -1502,6 +1495,7 @@ MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match);
static struct i2c_driver edt_ft5x06_ts_driver = {
.driver = {
.name = "edt_ft5x06",
+ .dev_groups = edt_ft5x06_groups,
.of_match_table = edt_ft5x06_of_match,
.pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops),
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 07/22] Input: ads7846 - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/ads7846.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index bb1058b1e7fd..5601ceb7e26b 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -628,15 +628,12 @@ static ssize_t ads7846_disable_store(struct device *dev,
static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
-static struct attribute *ads784x_attributes[] = {
+static struct attribute *ads784x_attrs[] = {
&dev_attr_pen_down.attr,
&dev_attr_disable.attr,
NULL,
};
-
-static const struct attribute_group ads784x_attr_group = {
- .attrs = ads784x_attributes,
-};
+ATTRIBUTE_GROUPS(ads784x);
/*--------------------------------------------------------------------------*/
@@ -1395,10 +1392,6 @@ static int ads7846_probe(struct spi_device *spi)
else
(void) ads7846_read12_ser(dev, READ_12BIT_SER(vaux));
- err = devm_device_add_group(dev, &ads784x_attr_group);
- if (err)
- return err;
-
err = input_register_device(input_dev);
if (err)
return err;
@@ -1424,9 +1417,10 @@ static void ads7846_remove(struct spi_device *spi)
static struct spi_driver ads7846_driver = {
.driver = {
- .name = "ads7846",
- .pm = pm_sleep_ptr(&ads7846_pm),
- .of_match_table = of_match_ptr(ads7846_dt_ids),
+ .name = "ads7846",
+ .dev_groups = ads784x_groups,
+ .pm = pm_sleep_ptr(&ads7846_pm),
+ .of_match_table = of_match_ptr(ads7846_dt_ids),
},
.probe = ads7846_probe,
.remove = ads7846_remove,
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 11/22] Input: hideep - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/hideep.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c
index 404153338df7..0f58258306bf 100644
--- a/drivers/input/touchscreen/hideep.c
+++ b/drivers/input/touchscreen/hideep.c
@@ -954,16 +954,13 @@ static DEVICE_ATTR(version, 0664, hideep_fw_version_show, NULL);
static DEVICE_ATTR(product_id, 0664, hideep_product_id_show, NULL);
static DEVICE_ATTR(update_fw, 0664, NULL, hideep_update_fw);
-static struct attribute *hideep_ts_sysfs_entries[] = {
+static struct attribute *hideep_ts_attrs[] = {
&dev_attr_version.attr,
&dev_attr_product_id.attr,
&dev_attr_update_fw.attr,
NULL,
};
-
-static const struct attribute_group hideep_ts_attr_group = {
- .attrs = hideep_ts_sysfs_entries,
-};
+ATTRIBUTE_GROUPS(hideep_ts);
static void hideep_set_work_mode(struct hideep_ts *ts)
{
@@ -1096,13 +1093,6 @@ static int hideep_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &hideep_ts_attr_group);
- if (error) {
- dev_err(&client->dev,
- "failed to add sysfs attributes: %d\n", error);
- return error;
- }
-
return 0;
}
@@ -1131,6 +1121,7 @@ MODULE_DEVICE_TABLE(of, hideep_match_table);
static struct i2c_driver hideep_driver = {
.driver = {
.name = HIDEEP_I2C_NAME,
+ .dev_groups = hideep_ts_groups,
.of_match_table = of_match_ptr(hideep_match_table),
.acpi_match_table = ACPI_PTR(hideep_acpi_id),
.pm = pm_sleep_ptr(&hideep_pm_ops),
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 22/22] Input: wdt87xx_i2c - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/wdt87xx_i2c.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index cbc4750c53f9..128341a6696b 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -944,10 +944,7 @@ static struct attribute *wdt87xx_attrs[] = {
&dev_attr_update_fw.attr,
NULL
};
-
-static const struct attribute_group wdt87xx_attr_group = {
- .attrs = wdt87xx_attrs,
-};
+ATTRIBUTE_GROUPS(wdt87xx);
static void wdt87xx_report_contact(struct input_dev *input,
struct wdt87xx_sys_param *param,
@@ -1104,12 +1101,6 @@ static int wdt87xx_ts_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &wdt87xx_attr_group);
- if (error) {
- dev_err(&client->dev, "create sysfs failed: %d\n", error);
- return error;
- }
-
return 0;
}
@@ -1172,8 +1163,9 @@ static struct i2c_driver wdt87xx_driver = {
.probe = wdt87xx_ts_probe,
.id_table = wdt87xx_dev_id,
.driver = {
- .name = WDT87XX_NAME,
- .pm = pm_sleep_ptr(&wdt87xx_pm_ops),
+ .name = WDT87XX_NAME,
+ .dev_groups = wdt87xx_groups,
+ .pm = pm_sleep_ptr(&wdt87xx_pm_ops),
.acpi_match_table = ACPI_PTR(wdt87xx_acpi_id),
},
};
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 20/22] Input: stmfts - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Greg Kroah-Hartman, Maxime Coquelin,
Alexandre Torgue
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/stmfts.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index 56e371fd88fa..85010fa07908 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -517,10 +517,7 @@ static struct attribute *stmfts_sysfs_attrs[] = {
&dev_attr_hover_enable.attr,
NULL
};
-
-static struct attribute_group stmfts_attribute_group = {
- .attrs = stmfts_sysfs_attrs
-};
+ATTRIBUTE_GROUPS(stmfts_sysfs);
static int stmfts_power_on(struct stmfts_data *sdata)
{
@@ -727,10 +724,6 @@ static int stmfts_probe(struct i2c_client *client)
}
}
- err = devm_device_add_group(&client->dev, &stmfts_attribute_group);
- if (err)
- return err;
-
pm_runtime_enable(&client->dev);
device_enable_async_suspend(&client->dev);
@@ -804,6 +797,7 @@ MODULE_DEVICE_TABLE(i2c, stmfts_id);
static struct i2c_driver stmfts_driver = {
.driver = {
.name = STMFTS_DEV_NAME,
+ .dev_groups = stmfts_sysfs_groups,
.of_match_table = of_match_ptr(stmfts_of_match),
.pm = pm_ptr(&stmfts_pm_ops),
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 10/22] Input: exc3000 - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/exc3000.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 4c0d99aae9e0..a4030cc9ff60 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -325,16 +325,13 @@ static ssize_t type_show(struct device *dev,
}
static DEVICE_ATTR_RO(type);
-static struct attribute *sysfs_attrs[] = {
+static struct attribute *exc3000_attrs[] = {
&dev_attr_fw_version.attr,
&dev_attr_model.attr,
&dev_attr_type.attr,
NULL
};
-
-static struct attribute_group exc3000_attribute_group = {
- .attrs = sysfs_attrs
-};
+ATTRIBUTE_GROUPS(exc3000);
static int exc3000_probe(struct i2c_client *client)
{
@@ -437,10 +434,6 @@ static int exc3000_probe(struct i2c_client *client)
i2c_set_clientdata(client, data);
- error = devm_device_add_group(&client->dev, &exc3000_attribute_group);
- if (error)
- return error;
-
return 0;
}
@@ -473,6 +466,7 @@ MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match);
static struct i2c_driver exc3000_driver = {
.driver = {
.name = "exc3000",
+ .dev_groups = exc3000_groups,
.of_match_table = of_match_ptr(exc3000_of_match),
.acpi_match_table = ACPI_PTR(exc3000_acpi_match),
},
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
* [PATCH 19/22] Input: s6sy761 - use device core to create driver-specific device attributes
From: Dmitry Torokhov @ 2023-07-29 0:51 UTC (permalink / raw)
To: linux-input; +Cc: linux-kernel, Greg Kroah-Hartman, Andi Shyti
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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@gmail.com>
---
drivers/input/touchscreen/s6sy761.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c
index 998d99d18911..149cc2c4925e 100644
--- a/drivers/input/touchscreen/s6sy761.c
+++ b/drivers/input/touchscreen/s6sy761.c
@@ -286,10 +286,7 @@ static struct attribute *s6sy761_sysfs_attrs[] = {
&dev_attr_devid.attr,
NULL
};
-
-static struct attribute_group s6sy761_attribute_group = {
- .attrs = s6sy761_sysfs_attrs
-};
+ATTRIBUTE_GROUPS(s6sy761_sysfs);
static int s6sy761_power_on(struct s6sy761_data *sdata)
{
@@ -465,10 +462,6 @@ static int s6sy761_probe(struct i2c_client *client)
if (err)
return err;
- err = devm_device_add_group(&client->dev, &s6sy761_attribute_group);
- if (err)
- return err;
-
pm_runtime_enable(&client->dev);
return 0;
@@ -535,6 +528,7 @@ MODULE_DEVICE_TABLE(i2c, s6sy761_id);
static struct i2c_driver s6sy761_driver = {
.driver = {
.name = S6SY761_DEV_NAME,
+ .dev_groups = s6sy761_sysfs_groups,
.of_match_table = of_match_ptr(s6sy761_of_match),
.pm = pm_ptr(&s6sy761_pm_ops),
},
--
2.41.0.487.g6d72f3e995-goog
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox