aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.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-lp5523.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-lp5523.c')
-rw-r--r--drivers/leds/leds-lp5523.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index fefe27c3f377..49b976271d96 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -1010,44 +1010,44 @@ static void lp5523_deinit_device(struct lp5523_chip *chip)
1010static int lp5523_probe(struct i2c_client *client, 1010static int lp5523_probe(struct i2c_client *client,
1011 const struct i2c_device_id *id) 1011 const struct i2c_device_id *id)
1012{ 1012{
1013 struct lp5523_chip *chip; 1013 struct lp5523_chip *old_chip;
1014 struct lp5523_platform_data *pdata; 1014 struct lp5523_platform_data *old_pdata;
1015 int ret, i; 1015 int ret, i;
1016 1016
1017 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 1017 old_chip = devm_kzalloc(&client->dev, sizeof(*old_chip), GFP_KERNEL);
1018 if (!chip) 1018 if (!old_chip)
1019 return -ENOMEM; 1019 return -ENOMEM;
1020 1020
1021 i2c_set_clientdata(client, chip); 1021 i2c_set_clientdata(client, old_chip);
1022 chip->client = client; 1022 old_chip->client = client;
1023 1023
1024 pdata = client->dev.platform_data; 1024 old_pdata = client->dev.platform_data;
1025 1025
1026 if (!pdata) { 1026 if (!old_pdata) {
1027 dev_err(&client->dev, "no platform data\n"); 1027 dev_err(&client->dev, "no platform data\n");
1028 return -EINVAL; 1028 return -EINVAL;
1029 } 1029 }
1030 1030
1031 mutex_init(&chip->lock); 1031 mutex_init(&old_chip->lock);
1032 1032
1033 chip->pdata = pdata; 1033 old_chip->pdata = old_pdata;
1034 1034
1035 ret = lp5523_init_device(chip); 1035 ret = lp5523_init_device(old_chip);
1036 if (ret) 1036 if (ret)
1037 goto err_init; 1037 goto err_init;
1038 1038
1039 dev_info(&client->dev, "%s Programmable led chip found\n", id->name); 1039 dev_info(&client->dev, "%s Programmable led chip found\n", id->name);
1040 1040
1041 /* Initialize engines */ 1041 /* Initialize engines */
1042 for (i = 0; i < ARRAY_SIZE(chip->engines); i++) { 1042 for (i = 0; i < ARRAY_SIZE(old_chip->engines); i++) {
1043 ret = lp5523_init_engine(&chip->engines[i], i + 1); 1043 ret = lp5523_init_engine(&old_chip->engines[i], i + 1);
1044 if (ret) { 1044 if (ret) {
1045 dev_err(&client->dev, "error initializing engine\n"); 1045 dev_err(&client->dev, "error initializing engine\n");
1046 goto fail1; 1046 goto fail1;
1047 } 1047 }
1048 } 1048 }
1049 1049
1050 ret = lp5523_register_leds(chip, id->name); 1050 ret = lp5523_register_leds(old_chip, id->name);
1051 if (ret) 1051 if (ret)
1052 goto fail2; 1052 goto fail2;
1053 1053
@@ -1058,25 +1058,25 @@ static int lp5523_probe(struct i2c_client *client,
1058 } 1058 }
1059 return ret; 1059 return ret;
1060fail2: 1060fail2:
1061 lp5523_unregister_leds(chip); 1061 lp5523_unregister_leds(old_chip);
1062fail1: 1062fail1:
1063 lp5523_deinit_device(chip); 1063 lp5523_deinit_device(old_chip);
1064err_init: 1064err_init:
1065 return ret; 1065 return ret;
1066} 1066}
1067 1067
1068static int lp5523_remove(struct i2c_client *client) 1068static int lp5523_remove(struct i2c_client *client)
1069{ 1069{
1070 struct lp5523_chip *chip = i2c_get_clientdata(client); 1070 struct lp5523_chip *old_chip = i2c_get_clientdata(client);
1071 1071
1072 /* Disable engine mode */ 1072 /* Disable engine mode */
1073 lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED); 1073 lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED);
1074 1074
1075 lp5523_unregister_sysfs(client); 1075 lp5523_unregister_sysfs(client);
1076 1076
1077 lp5523_unregister_leds(chip); 1077 lp5523_unregister_leds(old_chip);
1078 1078
1079 lp5523_deinit_device(chip); 1079 lp5523_deinit_device(old_chip);
1080 return 0; 1080 return 0;
1081} 1081}
1082 1082