diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 36 | ||||
-rw-r--r-- | drivers/leds/leds-lp5523.c | 38 |
2 files changed, 37 insertions, 37 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) | |||
872 | static int lp5521_probe(struct i2c_client *client, | 872 | static 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; |
913 | fail2: | 913 | fail2: |
914 | lp5521_unregister_leds(chip); | 914 | lp5521_unregister_leds(old_chip); |
915 | lp5521_deinit_device(chip); | 915 | lp5521_deinit_device(old_chip); |
916 | err_init: | 916 | err_init: |
917 | return ret; | 917 | return ret; |
918 | } | 918 | } |
919 | 919 | ||
920 | static int lp5521_remove(struct i2c_client *client) | 920 | static 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 | ||
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) | |||
1010 | static int lp5523_probe(struct i2c_client *client, | 1010 | static 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; |
1060 | fail2: | 1060 | fail2: |
1061 | lp5523_unregister_leds(chip); | 1061 | lp5523_unregister_leds(old_chip); |
1062 | fail1: | 1062 | fail1: |
1063 | lp5523_deinit_device(chip); | 1063 | lp5523_deinit_device(old_chip); |
1064 | err_init: | 1064 | err_init: |
1065 | return ret; | 1065 | return ret; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | static int lp5523_remove(struct i2c_client *client) | 1068 | static 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 | ||