diff options
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 74dc208fb99f..dd4526e168fa 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c | |||
@@ -689,16 +689,6 @@ static void lp5521_unregister_sysfs(struct i2c_client *client) | |||
689 | &lp5521_led_attribute_group); | 689 | &lp5521_led_attribute_group); |
690 | } | 690 | } |
691 | 691 | ||
692 | static void lp5521_deinit_device(struct lp5521_chip *chip) | ||
693 | { | ||
694 | struct lp5521_platform_data *pdata = chip->pdata; | ||
695 | |||
696 | if (pdata->enable) | ||
697 | pdata->enable(0); | ||
698 | if (pdata->release_resources) | ||
699 | pdata->release_resources(); | ||
700 | } | ||
701 | |||
702 | static int lp5521_init_led(struct lp5521_led *led, | 692 | static int lp5521_init_led(struct lp5521_led *led, |
703 | struct i2c_client *client, | 693 | struct i2c_client *client, |
704 | int chan, struct lp5521_platform_data *pdata) | 694 | int chan, struct lp5521_platform_data *pdata) |
@@ -858,7 +848,7 @@ static int lp5521_probe(struct i2c_client *client, | |||
858 | return ret; | 848 | return ret; |
859 | fail2: | 849 | fail2: |
860 | lp5521_unregister_leds(old_chip); | 850 | lp5521_unregister_leds(old_chip); |
861 | lp5521_deinit_device(old_chip); | 851 | lp55xx_deinit_device(chip); |
862 | err_init: | 852 | err_init: |
863 | return ret; | 853 | return ret; |
864 | } | 854 | } |
@@ -866,13 +856,15 @@ err_init: | |||
866 | static int lp5521_remove(struct i2c_client *client) | 856 | static int lp5521_remove(struct i2c_client *client) |
867 | { | 857 | { |
868 | struct lp5521_chip *old_chip = i2c_get_clientdata(client); | 858 | struct lp5521_chip *old_chip = i2c_get_clientdata(client); |
859 | struct lp55xx_led *led = i2c_get_clientdata(client); | ||
860 | struct lp55xx_chip *chip = led->chip; | ||
869 | 861 | ||
870 | lp5521_run_led_pattern(PATTERN_OFF, old_chip); | 862 | lp5521_run_led_pattern(PATTERN_OFF, old_chip); |
871 | lp5521_unregister_sysfs(client); | 863 | lp5521_unregister_sysfs(client); |
872 | 864 | ||
873 | lp5521_unregister_leds(old_chip); | 865 | lp5521_unregister_leds(old_chip); |
866 | lp55xx_deinit_device(chip); | ||
874 | 867 | ||
875 | lp5521_deinit_device(old_chip); | ||
876 | return 0; | 868 | return 0; |
877 | } | 869 | } |
878 | 870 | ||