leds: add led-class attribute-group support
Allow led-class devices to be created with optional attribute groups. This is needed in order to allow led drivers to create custom device attributes in a race-free manner. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
@@ -210,8 +210,9 @@ static const struct dev_pm_ops leds_class_dev_pm_ops = {
|
||||
*/
|
||||
int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
|
||||
{
|
||||
led_cdev->dev = device_create(leds_class, parent, 0, led_cdev,
|
||||
"%s", led_cdev->name);
|
||||
led_cdev->dev = device_create_with_groups(leds_class, parent, 0,
|
||||
led_cdev, led_cdev->groups,
|
||||
"%s", led_cdev->name);
|
||||
if (IS_ERR(led_cdev->dev))
|
||||
return PTR_ERR(led_cdev->dev);
|
||||
|
||||
|
Reference in New Issue
Block a user