diff options
author | Johan Hovold <johan@kernel.org> | 2014-06-25 13:08:44 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-06-25 17:55:03 -0400 |
commit | d0d480cce8f522b37c2c1de38230fc9ad15fa506 (patch) | |
tree | c02d866399ddfe0e4c4d3c09ec1cb26343b9d925 /drivers/leds/led-class.c | |
parent | a497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff) |
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>
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r-- | drivers/leds/led-class.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index f37d63cf726b..aa29198fca3e 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -210,8 +210,9 @@ static const struct dev_pm_ops leds_class_dev_pm_ops = { | |||
210 | */ | 210 | */ |
211 | int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) | 211 | int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) |
212 | { | 212 | { |
213 | led_cdev->dev = device_create(leds_class, parent, 0, led_cdev, | 213 | led_cdev->dev = device_create_with_groups(leds_class, parent, 0, |
214 | "%s", led_cdev->name); | 214 | led_cdev, led_cdev->groups, |
215 | "%s", led_cdev->name); | ||
215 | if (IS_ERR(led_cdev->dev)) | 216 | if (IS_ERR(led_cdev->dev)) |
216 | return PTR_ERR(led_cdev->dev); | 217 | return PTR_ERR(led_cdev->dev); |
217 | 218 | ||