Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358589
b: refs/heads/master
c: 1a99148
h: refs/heads/master
i:
  358587: 3a27c93
v: v3
  • Loading branch information
Milo(Woogyom) Kim authored and Bryan Wu committed Feb 6, 2013
1 parent 1f6298b commit 95f6c05
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 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: 944f7b1dedb859f76a88c8d34ce23a90bf6285a0
refs/heads/master: 1a9914855d2868112257dbc5771ddc6ebc9b2cab
20 changes: 12 additions & 8 deletions trunk/drivers/leds/leds-lp5521.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,16 @@ static int lp5521_init_device(struct lp5521_chip *chip)
return ret;
}

static void lp5521_deinit_device(struct lp5521_chip *chip)
{
struct lp5521_platform_data *pdata = chip->pdata;

if (pdata->enable)
pdata->enable(0);
if (pdata->release_resources)
pdata->release_resources();
}

static int lp5521_init_led(struct lp5521_led *led,
struct i2c_client *client,
int chan, struct lp5521_platform_data *pdata)
Expand Down Expand Up @@ -865,10 +875,7 @@ static int lp5521_probe(struct i2c_client *client,
cancel_work_sync(&chip->leds[i].brightness_work);
}
fail1:
if (pdata->enable)
pdata->enable(0);
if (pdata->release_resources)
pdata->release_resources();
lp5521_deinit_device(chip);
return ret;
}

Expand All @@ -885,10 +892,7 @@ static int lp5521_remove(struct i2c_client *client)
cancel_work_sync(&chip->leds[i].brightness_work);
}

if (chip->pdata->enable)
chip->pdata->enable(0);
if (chip->pdata->release_resources)
chip->pdata->release_resources();
lp5521_deinit_device(chip);
return 0;
}

Expand Down
20 changes: 12 additions & 8 deletions trunk/drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,16 @@ static int lp5523_init_device(struct lp5523_chip *chip)
return lp5523_detect(client);
}

static void lp5523_deinit_device(struct lp5523_chip *chip)
{
struct lp5523_platform_data *pdata = chip->pdata;

if (pdata->enable)
pdata->enable(0);
if (pdata->release_resources)
pdata->release_resources();
}

static int lp5523_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -1009,10 +1019,7 @@ static int lp5523_probe(struct i2c_client *client,
flush_work(&chip->leds[i].brightness_work);
}
fail1:
if (pdata->enable)
pdata->enable(0);
if (pdata->release_resources)
pdata->release_resources();
lp5523_deinit_device(chip);
return ret;
}

Expand All @@ -1031,10 +1038,7 @@ static int lp5523_remove(struct i2c_client *client)
flush_work(&chip->leds[i].brightness_work);
}

if (chip->pdata->enable)
chip->pdata->enable(0);
if (chip->pdata->release_resources)
chip->pdata->release_resources();
lp5523_deinit_device(chip);
return 0;
}

Expand Down

0 comments on commit 95f6c05

Please sign in to comment.