diff options
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r-- | drivers/leds/led-class.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index b3c54be74556..559a40861c39 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -103,13 +103,11 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) | |||
103 | { | 103 | { |
104 | int rc; | 104 | int rc; |
105 | 105 | ||
106 | led_cdev->dev = device_create(leds_class, parent, 0, "%s", | 106 | led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev, |
107 | led_cdev->name); | 107 | "%s", led_cdev->name); |
108 | if (IS_ERR(led_cdev->dev)) | 108 | if (IS_ERR(led_cdev->dev)) |
109 | return PTR_ERR(led_cdev->dev); | 109 | return PTR_ERR(led_cdev->dev); |
110 | 110 | ||
111 | dev_set_drvdata(led_cdev->dev, led_cdev); | ||
112 | |||
113 | /* register the attributes */ | 111 | /* register the attributes */ |
114 | rc = device_create_file(led_cdev->dev, &dev_attr_brightness); | 112 | rc = device_create_file(led_cdev->dev, &dev_attr_brightness); |
115 | if (rc) | 113 | if (rc) |