X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fleds%2Fleds-lm3533.c;h=6e2e02035dd7b9c43c00e4bf19145152efdacc0c;hb=6f06c7f87cf54fa0fa6f95963d7c0d436eb56f43;hp=e2c642c1169b93aef41014fc0a2100bb8a7f8057;hpb=170b5910d9fbea79de1bb40df22eda5f98250c0c;p=cascardo%2Flinux.git diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c index e2c642c1169b..6e2e02035dd7 100644 --- a/drivers/leds/leds-lm3533.c +++ b/drivers/leds/leds-lm3533.c @@ -645,6 +645,11 @@ static struct attribute_group lm3533_led_attribute_group = { .attrs = lm3533_led_attributes }; +static const struct attribute_group *lm3533_led_attribute_groups[] = { + &lm3533_led_attribute_group, + NULL +}; + static int lm3533_led_setup(struct lm3533_led *led, struct lm3533_led_platform_data *pdata) { @@ -692,6 +697,7 @@ static int lm3533_led_probe(struct platform_device *pdev) led->cdev.brightness_get = lm3533_led_get; led->cdev.blink_set = lm3533_led_blink_set; led->cdev.brightness = LED_OFF; + led->cdev.groups = lm3533_led_attribute_groups, led->id = pdev->id; mutex_init(&led->mutex); @@ -715,25 +721,16 @@ static int lm3533_led_probe(struct platform_device *pdev) led->cb.dev = led->cdev.dev; - ret = sysfs_create_group(&led->cdev.dev->kobj, - &lm3533_led_attribute_group); - if (ret < 0) { - dev_err(&pdev->dev, "failed to create sysfs attributes\n"); - goto err_unregister; - } - ret = lm3533_led_setup(led, pdata); if (ret) - goto err_sysfs_remove; + goto err_unregister; ret = lm3533_ctrlbank_enable(&led->cb); if (ret) - goto err_sysfs_remove; + goto err_unregister; return 0; -err_sysfs_remove: - sysfs_remove_group(&led->cdev.dev->kobj, &lm3533_led_attribute_group); err_unregister: led_classdev_unregister(&led->cdev); flush_work(&led->work); @@ -748,7 +745,6 @@ static int lm3533_led_remove(struct platform_device *pdev) dev_dbg(&pdev->dev, "%s\n", __func__); lm3533_ctrlbank_disable(&led->cb); - sysfs_remove_group(&led->cdev.dev->kobj, &lm3533_led_attribute_group); led_classdev_unregister(&led->cdev); flush_work(&led->work); @@ -770,7 +766,6 @@ static void lm3533_led_shutdown(struct platform_device *pdev) static struct platform_driver lm3533_led_driver = { .driver = { .name = "lm3533-leds", - .owner = THIS_MODULE, }, .probe = lm3533_led_probe, .remove = lm3533_led_remove,