mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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>
This commit is contained in:
parent
0f7c815d83
commit
d0052ad90e
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user