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 e655dc1b5b85a6de248209026bb93a92fd66794c..c8768726d9251c249c49884f36d96b39532582c7 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 303e825ecfd8b4a050114d11e58a1ba82f0f8aca..05e907451df905113da314cb91ef451c26c70ff2 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 ebfaeb33bc8c063e684ab351edf4e8bca26fcc15..f01fecd75833d8a9f05fee959ce7a39cf290f35e 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 1f02f54f09c04b210a2c5ee9879d35e6d45e94c7..951f76dc1ddd9277869394e6802f7c51276526c8 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 caaa4687de938079305a81846223d8f42c320619..39bc4d9f148bf3a9a5d35b98efcccafb73f1f6d9 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 b2bbcb09a49e68bf724ad16441651c3a09bf0068..d38982abd26d8109ba05985e0a75fba5ddd71521 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 bce9c33bc4b55caeff41bbe3aceb42587508ea3b..1e616ae56b132a74d50b3003c9bbab7a5ba6b600 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 105e73d4a3b9c2160497c63588284600c0b89663..dd908577a9dccb196a9d9d9ec91f8cf9503e91f1 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 3be9739fec30a6bb067406453cf709520a34f7b5..382f25b2fa458da7667dc158226059344c9828c3 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 acefb76b4e153211c7e8dfe823ae2359590bef88..53496111883da037ffc5999e5eab214b2da14cd7 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 e431432233204c9ca0d4674773753e01b678de88..f4b05dd6c20a164b026f74c5d399982430cd31e7 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 916b5b09c3d138034f3a096a8fe1575c0be18fcc..141dd3847411506fae61648e99742c1ee87ba8ea 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 c4a1d49fbea471747b57510f4bfee0d3e90af0cd..d68bc4e3891da17283935a15a0d26183805ffe55 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 0de3d7c016cdae8cf2b6ec1c78e7619181b2409e..4ae2f2908f9938a65b7b5a612cd5390f4dcf6c53 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);