Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358616
b: refs/heads/master
c: e73c0ce
h: refs/heads/master
v: v3
  • Loading branch information
Milo(Woogyom) Kim authored and Bryan Wu committed Feb 6, 2013
1 parent e0bbe7b commit e33ef09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 240085e255cd2818aff2ccde3066b7db1f29076a
refs/heads/master: e73c0ce6beaa71bee39b2d11bff0253be84c71a9
17 changes: 7 additions & 10 deletions trunk/drivers/leds/leds-lp5521.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,6 @@ static const struct attribute_group lp5521_group = {
.attrs = lp5521_attributes,
};

static int lp5521_register_sysfs(struct i2c_client *client)
{
struct device *dev = &client->dev;
return sysfs_create_group(&dev->kobj, &lp5521_group);
}

static void lp5521_unregister_sysfs(struct i2c_client *client)
{
struct device *dev = &client->dev;
Expand All @@ -535,6 +529,7 @@ static struct lp55xx_device_config lp5521_cfg = {
.set_led_current = lp5521_set_led_current,
.firmware_cb = lp5521_firmware_loaded,
.run_engine = lp5521_run_engine,
.dev_attr_group = &lp5521_group,
};

static int lp5521_probe(struct i2c_client *client,
Expand Down Expand Up @@ -577,13 +572,15 @@ static int lp5521_probe(struct i2c_client *client,
if (ret)
goto err_register_leds;

ret = lp5521_register_sysfs(client);
ret = lp55xx_register_sysfs(chip);
if (ret) {
dev_err(&client->dev, "registering sysfs failed\n");
goto fail2;
goto err_register_sysfs;
}
return ret;
fail2:

return 0;

err_register_sysfs:
lp55xx_unregister_leds(led, chip);
err_register_leds:
lp55xx_deinit_device(chip);
Expand Down
23 changes: 7 additions & 16 deletions trunk/drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,18 +484,6 @@ static const struct attribute_group lp5523_group = {
.attrs = lp5523_attributes,
};

static int lp5523_register_sysfs(struct i2c_client *client)
{
struct device *dev = &client->dev;
int ret;

ret = sysfs_create_group(&dev->kobj, &lp5523_group);
if (ret < 0)
return ret;

return 0;
}

static void lp5523_unregister_sysfs(struct i2c_client *client)
{
struct device *dev = &client->dev;
Expand All @@ -519,6 +507,7 @@ static struct lp55xx_device_config lp5523_cfg = {
.set_led_current = lp5523_set_led_current,
.firmware_cb = lp5523_firmware_loaded,
.run_engine = lp5523_run_engine,
.dev_attr_group = &lp5523_group,
};

static int lp5523_probe(struct i2c_client *client,
Expand Down Expand Up @@ -561,13 +550,15 @@ static int lp5523_probe(struct i2c_client *client,
if (ret)
goto err_register_leds;

ret = lp5523_register_sysfs(client);
ret = lp55xx_register_sysfs(chip);
if (ret) {
dev_err(&client->dev, "registering sysfs failed\n");
goto fail2;
goto err_register_sysfs;
}
return ret;
fail2:

return 0;

err_register_sysfs:
lp55xx_unregister_leds(led, chip);
err_register_leds:
lp55xx_deinit_device(chip);
Expand Down

0 comments on commit e33ef09

Please sign in to comment.