Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pca953x: Drop unused fields in struct pca953x_platform_data

New code should solely use firmware nodes for the specifics and
not any callbacks.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
2f4d3e29 0bb80ecc

+8 -42
+8 -29
drivers/gpio/gpio-pca953x.c
··· 211 211 212 212 struct i2c_client *client; 213 213 struct gpio_chip gpio_chip; 214 - const char *const *names; 215 214 unsigned long driver_data; 216 215 struct regulator *regulator; 217 216 ··· 711 712 gc->label = dev_name(&chip->client->dev); 712 713 gc->parent = &chip->client->dev; 713 714 gc->owner = THIS_MODULE; 714 - gc->names = chip->names; 715 715 } 716 716 717 717 #ifdef CONFIG_GPIO_PCA953X_IRQ ··· 996 998 } 997 999 #endif 998 1000 999 - static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert) 1001 + static int device_pca95xx_init(struct pca953x_chip *chip) 1000 1002 { 1001 1003 DECLARE_BITMAP(val, MAX_LINE); 1002 1004 u8 regaddr; ··· 1014 1016 if (ret) 1015 1017 goto out; 1016 1018 1017 - /* set platform specific polarity inversion */ 1018 - if (invert) 1019 - bitmap_fill(val, MAX_LINE); 1020 - else 1021 - bitmap_zero(val, MAX_LINE); 1019 + /* clear polarity inversion */ 1020 + bitmap_zero(val, MAX_LINE); 1022 1021 1023 1022 ret = pca953x_write_regs(chip, chip->regs->invert, val); 1024 1023 out: 1025 1024 return ret; 1026 1025 } 1027 1026 1028 - static int device_pca957x_init(struct pca953x_chip *chip, u32 invert) 1027 + static int device_pca957x_init(struct pca953x_chip *chip) 1029 1028 { 1030 1029 DECLARE_BITMAP(val, MAX_LINE); 1031 1030 unsigned int i; 1032 1031 int ret; 1033 1032 1034 - ret = device_pca95xx_init(chip, invert); 1033 + ret = device_pca95xx_init(chip); 1035 1034 if (ret) 1036 1035 goto out; 1037 1036 ··· 1049 1054 { 1050 1055 struct pca953x_platform_data *pdata; 1051 1056 struct pca953x_chip *chip; 1052 - int irq_base = 0; 1057 + int irq_base; 1053 1058 int ret; 1054 - u32 invert = 0; 1055 1059 struct regulator *reg; 1056 1060 const struct regmap_config *regmap_config; 1057 1061 ··· 1062 1068 if (pdata) { 1063 1069 irq_base = pdata->irq_base; 1064 1070 chip->gpio_start = pdata->gpio_base; 1065 - invert = pdata->invert; 1066 - chip->names = pdata->names; 1067 1071 } else { 1068 1072 struct gpio_desc *reset_gpio; 1069 1073 ··· 1150 1158 */ 1151 1159 if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) { 1152 1160 chip->regs = &pca957x_regs; 1153 - ret = device_pca957x_init(chip, invert); 1161 + ret = device_pca957x_init(chip); 1154 1162 } else { 1155 1163 chip->regs = &pca953x_regs; 1156 - ret = device_pca95xx_init(chip, invert); 1164 + ret = device_pca95xx_init(chip); 1157 1165 } 1158 1166 if (ret) 1159 1167 goto err_exit; ··· 1166 1174 if (ret) 1167 1175 goto err_exit; 1168 1176 1169 - if (pdata && pdata->setup) { 1170 - ret = pdata->setup(client, chip->gpio_chip.base, 1171 - chip->gpio_chip.ngpio, pdata->context); 1172 - if (ret < 0) 1173 - dev_warn(&client->dev, "setup failed, %d\n", ret); 1174 - } 1175 - 1176 1177 return 0; 1177 1178 1178 1179 err_exit: ··· 1175 1190 1176 1191 static void pca953x_remove(struct i2c_client *client) 1177 1192 { 1178 - struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev); 1179 1193 struct pca953x_chip *chip = i2c_get_clientdata(client); 1180 - 1181 - if (pdata && pdata->teardown) { 1182 - pdata->teardown(client, chip->gpio_chip.base, 1183 - chip->gpio_chip.ngpio, pdata->context); 1184 - } 1185 1194 1186 1195 regulator_disable(chip->regulator); 1187 1196 }
-13
include/linux/platform_data/pca953x.h
··· 11 11 /* number of the first GPIO */ 12 12 unsigned gpio_base; 13 13 14 - /* initial polarity inversion setting */ 15 - u32 invert; 16 - 17 14 /* interrupt base */ 18 15 int irq_base; 19 - 20 - void *context; /* param to setup/teardown */ 21 - 22 - int (*setup)(struct i2c_client *client, 23 - unsigned gpio, unsigned ngpio, 24 - void *context); 25 - void (*teardown)(struct i2c_client *client, 26 - unsigned gpio, unsigned ngpio, 27 - void *context); 28 - const char *const *names; 29 16 }; 30 17 31 18 #endif /* _LINUX_PCA953X_H */