Skip to contentSkip to conversation

leds: turris-omnia: convert to use dev_groups

PATCH Applied Greg Kroah-Hartman 3 participants 3 messages Jul 29, 2022 – Jul 30, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/leds/leds-turris-omnia.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/leds/leds-turris-omnia.c +1 -3
index 1adfed1c0619..eac6f4a573b2 100644
@@ -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,
 	},
 };
 
Signature · 1 line
2.37.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Fri, 29 Jul 2022 16:03:46 +0200 Greg Kroah-Hartman…

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.

Applied
#2 lore raw
Quoted 8 lines · Marek Behún
Quoted 5 lines · On Fri, 29 Jul 2022 16:03:46 +0200 Greg Kroah-Hartman…

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.

Quoted 7 lines
Quoted 5 lines

Thank you, applied.

Pavel

Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.