aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5521.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r--drivers/leds/leds-lp5521.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index e042a094a07f..8ef8f44bf86e 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -872,35 +872,35 @@ static void lp5521_unregister_leds(struct lp5521_chip *chip)
872static int lp5521_probe(struct i2c_client *client, 872static int lp5521_probe(struct i2c_client *client,
873 const struct i2c_device_id *id) 873 const struct i2c_device_id *id)
874{ 874{
875 struct lp5521_chip *chip; 875 struct lp5521_chip *old_chip;
876 struct lp5521_platform_data *pdata; 876 struct lp5521_platform_data *old_pdata;
877 int ret; 877 int ret;
878 878
879 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 879 old_chip = devm_kzalloc(&client->dev, sizeof(*old_chip), GFP_KERNEL);
880 if (!chip) 880 if (!old_chip)
881 return -ENOMEM; 881 return -ENOMEM;
882 882
883 i2c_set_clientdata(client, chip); 883 i2c_set_clientdata(client, old_chip);
884 chip->client = client; 884 old_chip->client = client;
885 885
886 pdata = client->dev.platform_data; 886 old_pdata = client->dev.platform_data;
887 887
888 if (!pdata) { 888 if (!old_pdata) {
889 dev_err(&client->dev, "no platform data\n"); 889 dev_err(&client->dev, "no platform data\n");
890 return -EINVAL; 890 return -EINVAL;
891 } 891 }
892 892
893 mutex_init(&chip->lock); 893 mutex_init(&old_chip->lock);
894 894
895 chip->pdata = pdata; 895 old_chip->pdata = old_pdata;
896 896
897 ret = lp5521_init_device(chip); 897 ret = lp5521_init_device(old_chip);
898 if (ret) 898 if (ret)
899 goto err_init; 899 goto err_init;
900 900
901 dev_info(&client->dev, "%s programmable led chip found\n", id->name); 901 dev_info(&client->dev, "%s programmable led chip found\n", id->name);
902 902
903 ret = lp5521_register_leds(chip); 903 ret = lp5521_register_leds(old_chip);
904 if (ret) 904 if (ret)
905 goto fail2; 905 goto fail2;
906 906
@@ -911,22 +911,22 @@ static int lp5521_probe(struct i2c_client *client,
911 } 911 }
912 return ret; 912 return ret;
913fail2: 913fail2:
914 lp5521_unregister_leds(chip); 914 lp5521_unregister_leds(old_chip);
915 lp5521_deinit_device(chip); 915 lp5521_deinit_device(old_chip);
916err_init: 916err_init:
917 return ret; 917 return ret;
918} 918}
919 919
920static int lp5521_remove(struct i2c_client *client) 920static int lp5521_remove(struct i2c_client *client)
921{ 921{
922 struct lp5521_chip *chip = i2c_get_clientdata(client); 922 struct lp5521_chip *old_chip = i2c_get_clientdata(client);
923 923
924 lp5521_run_led_pattern(PATTERN_OFF, chip); 924 lp5521_run_led_pattern(PATTERN_OFF, old_chip);
925 lp5521_unregister_sysfs(client); 925 lp5521_unregister_sysfs(client);
926 926
927 lp5521_unregister_leds(chip); 927 lp5521_unregister_leds(old_chip);
928 928
929 lp5521_deinit_device(chip); 929 lp5521_deinit_device(old_chip);
930 return 0; 930 return 0;
931} 931}
932 932