aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds-lp5523.c')
-rw-r--r--drivers/leds/leds-lp5523.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 4b1ad9013a51..4192a1ec6062 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -484,18 +484,6 @@ static const struct attribute_group lp5523_group = {
484 .attrs = lp5523_attributes, 484 .attrs = lp5523_attributes,
485}; 485};
486 486
487static int lp5523_register_sysfs(struct i2c_client *client)
488{
489 struct device *dev = &client->dev;
490 int ret;
491
492 ret = sysfs_create_group(&dev->kobj, &lp5523_group);
493 if (ret < 0)
494 return ret;
495
496 return 0;
497}
498
499static void lp5523_unregister_sysfs(struct i2c_client *client) 487static void lp5523_unregister_sysfs(struct i2c_client *client)
500{ 488{
501 struct device *dev = &client->dev; 489 struct device *dev = &client->dev;
@@ -519,6 +507,7 @@ static struct lp55xx_device_config lp5523_cfg = {
519 .set_led_current = lp5523_set_led_current, 507 .set_led_current = lp5523_set_led_current,
520 .firmware_cb = lp5523_firmware_loaded, 508 .firmware_cb = lp5523_firmware_loaded,
521 .run_engine = lp5523_run_engine, 509 .run_engine = lp5523_run_engine,
510 .dev_attr_group = &lp5523_group,
522}; 511};
523 512
524static int lp5523_probe(struct i2c_client *client, 513static int lp5523_probe(struct i2c_client *client,
@@ -561,13 +550,15 @@ static int lp5523_probe(struct i2c_client *client,
561 if (ret) 550 if (ret)
562 goto err_register_leds; 551 goto err_register_leds;
563 552
564 ret = lp5523_register_sysfs(client); 553 ret = lp55xx_register_sysfs(chip);
565 if (ret) { 554 if (ret) {
566 dev_err(&client->dev, "registering sysfs failed\n"); 555 dev_err(&client->dev, "registering sysfs failed\n");
567 goto fail2; 556 goto err_register_sysfs;
568 } 557 }
569 return ret; 558
570fail2: 559 return 0;
560
561err_register_sysfs:
571 lp55xx_unregister_leds(led, chip); 562 lp55xx_unregister_leds(led, chip);
572err_register_leds: 563err_register_leds:
573 lp55xx_deinit_device(chip); 564 lp55xx_deinit_device(chip);