Commit a01633cd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Pavel Machek
Browse files

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: Pavel Machek <pavel@ucw.cz>
Cc: linux-leds@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 92cfc71e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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,
	},
};