mmc: core: Remove mmc_gpiod_request_*(invert_gpio)
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 11 Dec 2019 02:40:56 +0000 (03:40 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 18 Dec 2019 12:37:07 +0000 (13:37 +0100)
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>
14 files changed:
drivers/mmc/core/host.c
drivers/mmc/core/slot-gpio.c
drivers/mmc/host/davinci_mmc.c
drivers/mmc/host/mmc_spi.c
drivers/mmc/host/mmci.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci-acpi.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-pci-core.c
drivers/mmc/host/sdhci-sirf.c
drivers/mmc/host/sdhci-spear.c
drivers/mmc/host/tmio_mmc_core.c
include/linux/mmc/slot-gpio.h

index e655dc1..c876872 100644 (file)
@@ -232,8 +232,7 @@ int mmc_of_parse(struct mmc_host *host)
                        host->caps |= MMC_CAP_NEEDS_POLL;
 
                ret = mmc_gpiod_request_cd(host, "cd", 0, false,
-                                          cd_debounce_delay_ms * 1000,
-                                          NULL);
+                                          cd_debounce_delay_ms * 1000);
                if (!ret)
                        dev_info(host->parent, "Got CD GPIO\n");
                else if (ret != -ENOENT && ret != -ENOSYS)
@@ -245,7 +244,7 @@ int mmc_of_parse(struct mmc_host *host)
        if (device_property_read_bool(dev, "wp-inverted"))
                host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
-       ret = mmc_gpiod_request_ro(host, "wp", 0, 0, NULL);
+       ret = mmc_gpiod_request_ro(host, "wp", 0, 0);
        if (!ret)
                dev_info(host->parent, "Got WP GPIO\n");
        else if (ret != -ENOENT && ret != -ENOSYS)
index 303e825..05e9074 100644 (file)
@@ -160,8 +160,6 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_isr);
  * @idx: index of the GPIO to obtain in the consumer
  * @override_active_level: ignore %GPIO_ACTIVE_LOW flag
  * @debounce: debounce time in microseconds
- * @gpio_invert: will return whether the GPIO line is inverted or not, set
- * to NULL to ignore
  *
  * Note that this must be called prior to mmc_add_host()
  * otherwise the caller must also call mmc_gpiod_request_cd_irq().
@@ -170,7 +168,7 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_isr);
  */
 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
                         unsigned int idx, bool override_active_level,
-                        unsigned int debounce, bool *gpio_invert)
+                        unsigned int debounce)
 {
        struct mmc_gpio *ctx = host->slot.handler_priv;
        struct gpio_desc *desc;
@@ -194,9 +192,6 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
        if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH)
                gpiod_toggle_active_low(desc);
 
-       if (gpio_invert)
-               *gpio_invert = !gpiod_is_active_low(desc);
-
        ctx->cd_gpio = desc;
 
        return 0;
@@ -217,14 +212,11 @@ EXPORT_SYMBOL(mmc_can_gpio_cd);
  * @con_id: function within the GPIO consumer
  * @idx: index of the GPIO to obtain in the consumer
  * @debounce: debounce time in microseconds
- * @gpio_invert: will return whether the GPIO line is inverted or not,
- * set to NULL to ignore
  *
  * Returns zero on success, else an error.
  */
 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
-                        unsigned int idx,
-                        unsigned int debounce, bool *gpio_invert)
+                        unsigned int idx, unsigned int debounce)
 {
        struct mmc_gpio *ctx = host->slot.handler_priv;
        struct gpio_desc *desc;
@@ -243,9 +235,6 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
        if (host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH)
                gpiod_toggle_active_low(desc);
 
-       if (gpio_invert)
-               *gpio_invert = !gpiod_is_active_low(desc);
-
        ctx->ro_gpio = desc;
 
        return 0;
index ebfaeb3..f01fecd 100644 (file)
@@ -1174,13 +1174,13 @@ static int mmc_davinci_parse_pdata(struct mmc_host *mmc)
                mmc->caps |= pdata->caps;
 
        /* Register a cd gpio, if there is not one, enable polling */
-       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
+       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
        if (ret == -EPROBE_DEFER)
                return ret;
        else if (ret)
                mmc->caps |= MMC_CAP_NEEDS_POLL;
 
-       ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
+       ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
        if (ret == -EPROBE_DEFER)
                return ret;
 
index 1f02f54..951f76d 100644 (file)
@@ -1426,7 +1426,7 @@ static int mmc_spi_probe(struct spi_device *spi)
         * Index 0 is card detect
         * Old boardfiles were specifying 1 ms as debounce
         */
-       status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000, NULL);
+       status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000);
        if (status == -EPROBE_DEFER)
                goto fail_add_host;
        if (!status) {
@@ -1441,7 +1441,7 @@ static int mmc_spi_probe(struct spi_device *spi)
        mmc_detect_change(mmc, 0);
 
        /* Index 1 is write protect/read only */
-       status = mmc_gpiod_request_ro(mmc, NULL, 1, 0, NULL);
+       status = mmc_gpiod_request_ro(mmc, NULL, 1, 0);
        if (status == -EPROBE_DEFER)
                goto fail_add_host;
        if (!status)
index caaa468..39bc4d9 100644 (file)
@@ -2054,11 +2054,11 @@ static int mmci_probe(struct amba_device *dev,
         * silently of these do not exist
         */
        if (!np) {
-               ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
+               ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
                if (ret == -EPROBE_DEFER)
                        goto clk_disable;
 
-               ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
+               ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
                if (ret == -EPROBE_DEFER)
                        goto clk_disable;
        }
index b2bbcb0..d38982a 100644 (file)
@@ -734,7 +734,7 @@ static int pxamci_probe(struct platform_device *pdev)
                }
 
                /* FIXME: should we pass detection delay to debounce? */
-               ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
+               ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
                if (ret && ret != -ENOENT) {
                        dev_err(dev, "Failed requesting gpio_cd\n");
                        goto out;
@@ -743,7 +743,7 @@ static int pxamci_probe(struct platform_device *pdev)
                if (!host->pdata->gpio_card_ro_invert)
                        mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
-               ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL);
+               ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
                if (ret && ret != -ENOENT) {
                        dev_err(dev, "Failed requesting gpio_ro\n");
                        goto out;
index bce9c33..1e616ae 100644 (file)
@@ -1505,14 +1505,14 @@ static int s3cmci_probe_pdata(struct s3cmci_host *host)
                mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
        /* If we get -ENOENT we have no card detect GPIO line */
-       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
+       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
        if (ret != -ENOENT) {
                dev_err(&pdev->dev, "error requesting GPIO for CD %d\n",
                        ret);
                return ret;
        }
 
-       ret = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0, NULL);
+       ret = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0);
        if (ret != -ENOENT) {
                dev_err(&pdev->dev, "error requesting GPIO for WP %d\n",
                        ret);
index 105e73d..dd90857 100644 (file)
@@ -752,7 +752,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
        if (sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD)) {
                bool v = sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD_OVERRIDE_LEVEL);
 
-               err = mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0, NULL);
+               err = mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0);
                if (err) {
                        if (err == -EPROBE_DEFER)
                                goto err_free;
index 3be9739..382f25b 100644 (file)
@@ -1381,7 +1381,7 @@ static int sdhci_esdhc_imx_probe_nondt(struct platform_device *pdev,
        if (boarddata->wp_type == ESDHC_WP_GPIO) {
                host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
-               err = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0, NULL);
+               err = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0);
                if (err) {
                        dev_err(mmc_dev(host->mmc),
                                "failed to request write-protect gpio!\n");
@@ -1392,7 +1392,7 @@ static int sdhci_esdhc_imx_probe_nondt(struct platform_device *pdev,
        /* card_detect */
        switch (boarddata->cd_type) {
        case ESDHC_CD_GPIO:
-               err = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL);
+               err = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0);
                if (err) {
                        dev_err(mmc_dev(host->mmc),
                                "failed to request card-detect gpio!\n");
index acefb76..5349611 100644 (file)
@@ -1983,12 +1983,12 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
 
        if (slot->cd_idx >= 0) {
                ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx,
-                                          slot->cd_override_level, 0, NULL);
+                                          slot->cd_override_level, 0);
                if (ret && ret != -EPROBE_DEFER)
                        ret = mmc_gpiod_request_cd(host->mmc, NULL,
                                                   slot->cd_idx,
                                                   slot->cd_override_level,
-                                                  0, NULL);
+                                                  0);
                if (ret == -EPROBE_DEFER)
                        goto remove;
 
index e431432..f4b05dd 100644 (file)
@@ -194,7 +194,7 @@ static int sdhci_sirf_probe(struct platform_device *pdev)
         * We must request the IRQ after sdhci_add_host(), as the tasklet only
         * gets setup in sdhci_add_host() and we oops.
         */
-       ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL);
+       ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0);
        if (ret == -EPROBE_DEFER)
                goto err_request_cd;
        if (!ret)
index 916b5b0..141dd38 100644 (file)
@@ -98,7 +98,7 @@ static int sdhci_probe(struct platform_device *pdev)
         * It is optional to use GPIOs for sdhci card detection. If we
         * find a descriptor using slot GPIO, we use it.
         */
-       ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0, NULL);
+       ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0);
        if (ret == -EPROBE_DEFER)
                goto disable_clk;
 
index c4a1d49..d68bc4e 100644 (file)
@@ -1181,7 +1181,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
         * Look for a card detect GPIO, if it fails with anything
         * else than a probe deferral, just live without it.
         */
-       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL);
+       ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
        if (ret == -EPROBE_DEFER)
                return ret;
 
index 0de3d7c..4ae2f29 100644 (file)
@@ -17,10 +17,9 @@ int mmc_gpio_get_ro(struct mmc_host *host);
 int mmc_gpio_get_cd(struct mmc_host *host);
 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
                         unsigned int idx, bool override_active_level,
-                        unsigned int debounce, bool *gpio_invert);
+                        unsigned int debounce);
 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
-                        unsigned int idx,
-                        unsigned int debounce, bool *gpio_invert);
+                        unsigned int idx, unsigned int debounce);
 void mmc_gpio_set_cd_isr(struct mmc_host *host,
                         irqreturn_t (*isr)(int irq, void *dev_id));
 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);