* [PATCH] leds: turris-omnia: convert to use dev_groups
@ 2022-07-29 14:03 Greg Kroah-Hartman
2022-07-29 16:53 ` Marek Behún
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-07-29 14:03 UTC (permalink / raw)
To: linux-leds
Cc: Greg Kroah-Hartman, Marek Behún, Pavel Machek, linux-kernel
The driver core supports the ability to handle the creation and removal
of device-specific sysfs files in a race-free manner. Take advantage of
that by converting this driver to use this by moving the sysfs
attributes into a group and assigning the dev_groups pointer to it.
Cc: "Marek Behún" <kabel@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux-leds@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/leds/leds-turris-omnia.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index 1adfed1c0619..eac6f4a573b2 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -239,9 +239,6 @@ static int omnia_leds_probe(struct i2c_client *client,
led += ret;
}
- if (devm_device_add_groups(dev, omnia_led_controller_groups))
- dev_warn(dev, "Could not add attribute group!\n");
-
return 0;
}
@@ -283,6 +280,7 @@ static struct i2c_driver omnia_leds_driver = {
.driver = {
.name = "leds-turris-omnia",
.of_match_table = of_omnia_leds_match,
+ .dev_groups = omnia_led_controller_groups,
},
};
--
2.37.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] leds: turris-omnia: convert to use dev_groups
2022-07-29 14:03 [PATCH] leds: turris-omnia: convert to use dev_groups Greg Kroah-Hartman
@ 2022-07-29 16:53 ` Marek Behún
2022-07-30 20:57 ` Pavel Machek
0 siblings, 1 reply; 3+ messages in thread
From: Marek Behún @ 2022-07-29 16:53 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-leds, Pavel Machek, linux-kernel
On Fri, 29 Jul 2022 16:03:46 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> The driver core supports the ability to handle the creation and removal
> of device-specific sysfs files in a race-free manner. Take advantage of
> that by converting this driver to use this by moving the sysfs
> attributes into a group and assigning the dev_groups pointer to it.
>
> Cc: "Marek Behún" <kabel@kernel.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: linux-leds@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] leds: turris-omnia: convert to use dev_groups
2022-07-29 16:53 ` Marek Behún
@ 2022-07-30 20:57 ` Pavel Machek
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2022-07-30 20:57 UTC (permalink / raw)
To: Marek Behún; +Cc: Greg Kroah-Hartman, linux-leds, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 833 bytes --]
On Fri 2022-07-29 18:53:38, Marek Behún wrote:
> On Fri, 29 Jul 2022 16:03:46 +0200
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> > The driver core supports the ability to handle the creation and removal
> > of device-specific sysfs files in a race-free manner. Take advantage of
> > that by converting this driver to use this by moving the sysfs
> > attributes into a group and assigning the dev_groups pointer to it.
> >
> > Cc: "Marek Behún" <kabel@kernel.org>
> > Cc: Pavel Machek <pavel@ucw.cz>
> > Cc: linux-leds@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Reviewed-by: Marek Behún <kabel@kernel.org>
Thank you, applied.
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-30 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29 14:03 [PATCH] leds: turris-omnia: convert to use dev_groups Greg Kroah-Hartman
2022-07-29 16:53 ` Marek Behún
2022-07-30 20:57 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).