aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2016-09-24 05:06:29 -0400
committerWolfram Sang <wsa@the-dreams.de>2016-09-24 05:06:29 -0400
commit6212e1d6ed4018ae3d3e6079ea0c45df346c97a6 (patch)
tree09f01bd3d799196f3a398e6552bccc0f92fa4def
parent31158763ef2dba9393ddd205248b9c95d2b5b87c (diff)
gpio: pca953x: variable 'id' was used twice
sparse rightfully said: drivers/gpio/gpio-pca953x.c:771:45: warning: symbol 'id' shadows an earlier one drivers/gpio/gpio-pca953x.c:742:36: originally declared here So, name them explicitly 'i2c_id' and 'acpi_id' to avoid any confusion. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/gpio/gpio-pca953x.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 892dc043f40b..018f39cc19c8 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -739,7 +739,7 @@ out:
739static const struct of_device_id pca953x_dt_ids[]; 739static const struct of_device_id pca953x_dt_ids[];
740 740
741static int pca953x_probe(struct i2c_client *client, 741static int pca953x_probe(struct i2c_client *client,
742 const struct i2c_device_id *id) 742 const struct i2c_device_id *i2c_id)
743{ 743{
744 struct pca953x_platform_data *pdata; 744 struct pca953x_platform_data *pdata;
745 struct pca953x_chip *chip; 745 struct pca953x_chip *chip;
@@ -765,21 +765,21 @@ static int pca953x_probe(struct i2c_client *client,
765 765
766 chip->client = client; 766 chip->client = client;
767 767
768 if (id) { 768 if (i2c_id) {
769 chip->driver_data = id->driver_data; 769 chip->driver_data = i2c_id->driver_data;
770 } else { 770 } else {
771 const struct acpi_device_id *id; 771 const struct acpi_device_id *acpi_id;
772 const struct of_device_id *match; 772 const struct of_device_id *match;
773 773
774 match = of_match_device(pca953x_dt_ids, &client->dev); 774 match = of_match_device(pca953x_dt_ids, &client->dev);
775 if (match) { 775 if (match) {
776 chip->driver_data = (int)(uintptr_t)match->data; 776 chip->driver_data = (int)(uintptr_t)match->data;
777 } else { 777 } else {
778 id = acpi_match_device(pca953x_acpi_ids, &client->dev); 778 acpi_id = acpi_match_device(pca953x_acpi_ids, &client->dev);
779 if (!id) 779 if (!acpi_id)
780 return -ENODEV; 780 return -ENODEV;
781 781
782 chip->driver_data = id->driver_data; 782 chip->driver_data = acpi_id->driver_data;
783 } 783 }
784 } 784 }
785 785