Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358591
b: refs/heads/master
c: 1904f83
h: refs/heads/master
i:
  358589: 95f6c05
  358587: 3a27c93
  358583: 2e95e78
  358575: f10e665
  358559: 063ab24
  358527: 25b9d4c
v: v3
  • Loading branch information
Milo(Woogyom) Kim authored and Bryan Wu committed Feb 6, 2013
1 parent b9286d7 commit 4d67324
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 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: f652480802b636f86e194f9680347676b655d856
refs/heads/master: 1904f83d568dba794be9de1311bafb5a4424812a
23 changes: 13 additions & 10 deletions trunk/drivers/leds/leds-lp5521.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,12 +837,22 @@ static int lp5521_register_leds(struct lp5521_chip *chip)
return 0;
}

static void lp5521_unregister_leds(struct lp5521_chip *chip)
{
int i;

for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
cancel_work_sync(&chip->leds[i].brightness_work);
}
}

static int lp5521_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct lp5521_chip *chip;
struct lp5521_platform_data *pdata;
int ret, i;
int ret;

chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
Expand Down Expand Up @@ -885,10 +895,7 @@ static int lp5521_probe(struct i2c_client *client,
}
return ret;
fail2:
for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
cancel_work_sync(&chip->leds[i].brightness_work);
}
lp5521_unregister_leds(chip);
fail1:
lp5521_deinit_device(chip);
return ret;
Expand All @@ -897,15 +904,11 @@ static int lp5521_probe(struct i2c_client *client,
static int lp5521_remove(struct i2c_client *client)
{
struct lp5521_chip *chip = i2c_get_clientdata(client);
int i;

lp5521_run_led_pattern(PATTERN_OFF, chip);
lp5521_unregister_sysfs(client);

for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
cancel_work_sync(&chip->leds[i].brightness_work);
}
lp5521_unregister_leds(chip);

lp5521_deinit_device(chip);
return 0;
Expand Down
21 changes: 12 additions & 9 deletions trunk/drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,16 @@ static int lp5523_register_leds(struct lp5523_chip *chip, const char *name)
return 0;
}

static void lp5523_unregister_leds(struct lp5523_chip *chip)
{
int i;

for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
flush_work(&chip->leds[i].brightness_work);
}
}

static int lp5523_init_device(struct lp5523_chip *chip)
{
struct lp5523_platform_data *pdata = chip->pdata;
Expand Down Expand Up @@ -1029,10 +1039,7 @@ static int lp5523_probe(struct i2c_client *client,
}
return ret;
fail2:
for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
flush_work(&chip->leds[i].brightness_work);
}
lp5523_unregister_leds(chip);
fail1:
lp5523_deinit_device(chip);
return ret;
Expand All @@ -1041,17 +1048,13 @@ static int lp5523_probe(struct i2c_client *client,
static int lp5523_remove(struct i2c_client *client)
{
struct lp5523_chip *chip = i2c_get_clientdata(client);
int i;

/* Disable engine mode */
lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED);

lp5523_unregister_sysfs(client);

for (i = 0; i < chip->num_leds; i++) {
led_classdev_unregister(&chip->leds[i].cdev);
flush_work(&chip->leds[i].brightness_work);
}
lp5523_unregister_leds(chip);

lp5523_deinit_device(chip);
return 0;
Expand Down

0 comments on commit 4d67324

Please sign in to comment.