aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5521.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 04:02:26 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-06 18:59:26 -0500
commit945c700746cbfa3375bf88123c2cf6c210f4cc2c (patch)
treeec7818d95c466ca92a70aedfb43dde216f77fed7 /drivers/leds/leds-lp5521.c
parentc93d08fa75020835741c7b1d0523ff854e8acde1 (diff)
leds-lp55xx: replace name of data structure
Change the name of chip data structure and platform data. This patch is a preceding step for cleaning up lp5521/5523 probe and remove. These data will be replaced with new lp55xx common data structures in next patch. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
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