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

mmc: core: Remove mmc_gpiod_request_*(invert_gpio)

Now that invert_gpio arguments are unused, let's remove them.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/64d766d1f8af2e22bce32f4ffa453f7234207ad6.1576031637.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Michał Mirosław and committed by
Ulf Hansson
d0052ad9 0f7c815d

+24 -37
+2 -3
drivers/mmc/core/host.c
··· 232 232 host->caps |= MMC_CAP_NEEDS_POLL; 233 233 234 234 ret = mmc_gpiod_request_cd(host, "cd", 0, false, 235 - cd_debounce_delay_ms * 1000, 236 - NULL); 235 + cd_debounce_delay_ms * 1000); 237 236 if (!ret) 238 237 dev_info(host->parent, "Got CD GPIO\n"); 239 238 else if (ret != -ENOENT && ret != -ENOSYS) ··· 244 245 if (device_property_read_bool(dev, "wp-inverted")) 245 246 host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 246 247 247 - ret = mmc_gpiod_request_ro(host, "wp", 0, 0, NULL); 248 + ret = mmc_gpiod_request_ro(host, "wp", 0, 0); 248 249 if (!ret) 249 250 dev_info(host->parent, "Got WP GPIO\n"); 250 251 else if (ret != -ENOENT && ret != -ENOSYS)
+2 -13
drivers/mmc/core/slot-gpio.c
··· 160 160 * @idx: index of the GPIO to obtain in the consumer 161 161 * @override_active_level: ignore %GPIO_ACTIVE_LOW flag 162 162 * @debounce: debounce time in microseconds 163 - * @gpio_invert: will return whether the GPIO line is inverted or not, set 164 - * to NULL to ignore 165 163 * 166 164 * Note that this must be called prior to mmc_add_host() 167 165 * otherwise the caller must also call mmc_gpiod_request_cd_irq(). ··· 168 170 */ 169 171 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, 170 172 unsigned int idx, bool override_active_level, 171 - unsigned int debounce, bool *gpio_invert) 173 + unsigned int debounce) 172 174 { 173 175 struct mmc_gpio *ctx = host->slot.handler_priv; 174 176 struct gpio_desc *desc; ··· 192 194 if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) 193 195 gpiod_toggle_active_low(desc); 194 196 195 - if (gpio_invert) 196 - *gpio_invert = !gpiod_is_active_low(desc); 197 - 198 197 ctx->cd_gpio = desc; 199 198 200 199 return 0; ··· 212 217 * @con_id: function within the GPIO consumer 213 218 * @idx: index of the GPIO to obtain in the consumer 214 219 * @debounce: debounce time in microseconds 215 - * @gpio_invert: will return whether the GPIO line is inverted or not, 216 - * set to NULL to ignore 217 220 * 218 221 * Returns zero on success, else an error. 219 222 */ 220 223 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, 221 - unsigned int idx, 222 - unsigned int debounce, bool *gpio_invert) 224 + unsigned int idx, unsigned int debounce) 223 225 { 224 226 struct mmc_gpio *ctx = host->slot.handler_priv; 225 227 struct gpio_desc *desc; ··· 234 242 235 243 if (host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH) 236 244 gpiod_toggle_active_low(desc); 237 - 238 - if (gpio_invert) 239 - *gpio_invert = !gpiod_is_active_low(desc); 240 245 241 246 ctx->ro_gpio = desc; 242 247
+2 -2
drivers/mmc/host/davinci_mmc.c
··· 1174 1174 mmc->caps |= pdata->caps; 1175 1175 1176 1176 /* Register a cd gpio, if there is not one, enable polling */ 1177 - ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 1177 + ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); 1178 1178 if (ret == -EPROBE_DEFER) 1179 1179 return ret; 1180 1180 else if (ret) 1181 1181 mmc->caps |= MMC_CAP_NEEDS_POLL; 1182 1182 1183 - ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL); 1183 + ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); 1184 1184 if (ret == -EPROBE_DEFER) 1185 1185 return ret; 1186 1186
+2 -2
drivers/mmc/host/mmc_spi.c
··· 1426 1426 * Index 0 is card detect 1427 1427 * Old boardfiles were specifying 1 ms as debounce 1428 1428 */ 1429 - status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000, NULL); 1429 + status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000); 1430 1430 if (status == -EPROBE_DEFER) 1431 1431 goto fail_add_host; 1432 1432 if (!status) { ··· 1441 1441 mmc_detect_change(mmc, 0); 1442 1442 1443 1443 /* Index 1 is write protect/read only */ 1444 - status = mmc_gpiod_request_ro(mmc, NULL, 1, 0, NULL); 1444 + status = mmc_gpiod_request_ro(mmc, NULL, 1, 0); 1445 1445 if (status == -EPROBE_DEFER) 1446 1446 goto fail_add_host; 1447 1447 if (!status)
+2 -2
drivers/mmc/host/mmci.c
··· 2054 2054 * silently of these do not exist 2055 2055 */ 2056 2056 if (!np) { 2057 - ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 2057 + ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); 2058 2058 if (ret == -EPROBE_DEFER) 2059 2059 goto clk_disable; 2060 2060 2061 - ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL); 2061 + ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); 2062 2062 if (ret == -EPROBE_DEFER) 2063 2063 goto clk_disable; 2064 2064 }
+2 -2
drivers/mmc/host/pxamci.c
··· 734 734 } 735 735 736 736 /* FIXME: should we pass detection delay to debounce? */ 737 - ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 737 + ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); 738 738 if (ret && ret != -ENOENT) { 739 739 dev_err(dev, "Failed requesting gpio_cd\n"); 740 740 goto out; ··· 743 743 if (!host->pdata->gpio_card_ro_invert) 744 744 mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 745 745 746 - ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL); 746 + ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); 747 747 if (ret && ret != -ENOENT) { 748 748 dev_err(dev, "Failed requesting gpio_ro\n"); 749 749 goto out;
+2 -2
drivers/mmc/host/s3cmci.c
··· 1505 1505 mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 1506 1506 1507 1507 /* If we get -ENOENT we have no card detect GPIO line */ 1508 - ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 1508 + ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); 1509 1509 if (ret != -ENOENT) { 1510 1510 dev_err(&pdev->dev, "error requesting GPIO for CD %d\n", 1511 1511 ret); 1512 1512 return ret; 1513 1513 } 1514 1514 1515 - ret = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0, NULL); 1515 + ret = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0); 1516 1516 if (ret != -ENOENT) { 1517 1517 dev_err(&pdev->dev, "error requesting GPIO for WP %d\n", 1518 1518 ret);
+1 -1
drivers/mmc/host/sdhci-acpi.c
··· 752 752 if (sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD)) { 753 753 bool v = sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD_OVERRIDE_LEVEL); 754 754 755 - err = mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0, NULL); 755 + err = mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0); 756 756 if (err) { 757 757 if (err == -EPROBE_DEFER) 758 758 goto err_free;
+2 -2
drivers/mmc/host/sdhci-esdhc-imx.c
··· 1381 1381 if (boarddata->wp_type == ESDHC_WP_GPIO) { 1382 1382 host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 1383 1383 1384 - err = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0, NULL); 1384 + err = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0); 1385 1385 if (err) { 1386 1386 dev_err(mmc_dev(host->mmc), 1387 1387 "failed to request write-protect gpio!\n"); ··· 1392 1392 /* card_detect */ 1393 1393 switch (boarddata->cd_type) { 1394 1394 case ESDHC_CD_GPIO: 1395 - err = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL); 1395 + err = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0); 1396 1396 if (err) { 1397 1397 dev_err(mmc_dev(host->mmc), 1398 1398 "failed to request card-detect gpio!\n");
+2 -2
drivers/mmc/host/sdhci-pci-core.c
··· 1983 1983 1984 1984 if (slot->cd_idx >= 0) { 1985 1985 ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx, 1986 - slot->cd_override_level, 0, NULL); 1986 + slot->cd_override_level, 0); 1987 1987 if (ret && ret != -EPROBE_DEFER) 1988 1988 ret = mmc_gpiod_request_cd(host->mmc, NULL, 1989 1989 slot->cd_idx, 1990 1990 slot->cd_override_level, 1991 - 0, NULL); 1991 + 0); 1992 1992 if (ret == -EPROBE_DEFER) 1993 1993 goto remove; 1994 1994
+1 -1
drivers/mmc/host/sdhci-sirf.c
··· 194 194 * We must request the IRQ after sdhci_add_host(), as the tasklet only 195 195 * gets setup in sdhci_add_host() and we oops. 196 196 */ 197 - ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL); 197 + ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0); 198 198 if (ret == -EPROBE_DEFER) 199 199 goto err_request_cd; 200 200 if (!ret)
+1 -1
drivers/mmc/host/sdhci-spear.c
··· 98 98 * It is optional to use GPIOs for sdhci card detection. If we 99 99 * find a descriptor using slot GPIO, we use it. 100 100 */ 101 - ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL); 101 + ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0); 102 102 if (ret == -EPROBE_DEFER) 103 103 goto disable_clk; 104 104
+1 -1
drivers/mmc/host/tmio_mmc_core.c
··· 1181 1181 * Look for a card detect GPIO, if it fails with anything 1182 1182 * else than a probe deferral, just live without it. 1183 1183 */ 1184 - ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); 1184 + ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); 1185 1185 if (ret == -EPROBE_DEFER) 1186 1186 return ret; 1187 1187
+2 -3
include/linux/mmc/slot-gpio.h
··· 17 17 int mmc_gpio_get_cd(struct mmc_host *host); 18 18 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, 19 19 unsigned int idx, bool override_active_level, 20 - unsigned int debounce, bool *gpio_invert); 20 + unsigned int debounce); 21 21 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, 22 - unsigned int idx, 23 - unsigned int debounce, bool *gpio_invert); 22 + unsigned int idx, unsigned int debounce); 24 23 void mmc_gpio_set_cd_isr(struct mmc_host *host, 25 24 irqreturn_t (*isr)(int irq, void *dev_id)); 26 25 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);