[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220729140346.2313175-1-gregkh@linuxfoundation.org>
Date: Fri, 29 Jul 2022 16:03:46 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-leds@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Marek BehĂșn <kabel@...nel.org>,
Pavel Machek <pavel@....cz>, linux-kernel@...r.kernel.org
Subject: [PATCH] leds: turris-omnia: convert to use dev_groups
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@...nel.org>
Cc: Pavel Machek <pavel@....cz>
Cc: linux-leds@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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
Powered by blists - more mailing lists