Commit f6862c7f authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Tony Lindgren
Browse files

mmc: omap: fix deferred probe



After a deferred probe, GPIO descriptor lookup will fail with EBUSY. Fix by
using managed descriptors.

Fixes: e519f0bb ("ARM/mmc: Convert old mmci-omap to GPIO descriptors")
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Message-ID: <20240223181439.1099750-5-aaro.koskinen@iki.fi>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent d4debbcb
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1259,17 +1259,17 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)
	slot->pdata = &host->pdata->slots[id];

	/* Check for some optional GPIO controls */
	slot->vsd = gpiod_get_index_optional(host->dev, "vsd",
	slot->vsd = devm_gpiod_get_index_optional(host->dev, "vsd",
						  id, GPIOD_OUT_LOW);
	if (IS_ERR(slot->vsd))
		return dev_err_probe(host->dev, PTR_ERR(slot->vsd),
				     "error looking up VSD GPIO\n");
	slot->vio = gpiod_get_index_optional(host->dev, "vio",
	slot->vio = devm_gpiod_get_index_optional(host->dev, "vio",
						  id, GPIOD_OUT_LOW);
	if (IS_ERR(slot->vio))
		return dev_err_probe(host->dev, PTR_ERR(slot->vio),
				     "error looking up VIO GPIO\n");
	slot->cover = gpiod_get_index_optional(host->dev, "cover",
	slot->cover = devm_gpiod_get_index_optional(host->dev, "cover",
						    id, GPIOD_IN);
	if (IS_ERR(slot->cover))
		return dev_err_probe(host->dev, PTR_ERR(slot->cover),
@@ -1402,7 +1402,7 @@ static int mmc_omap_probe(struct platform_device *pdev)
	host->dev = &pdev->dev;
	platform_set_drvdata(pdev, host);

	host->slot_switch = gpiod_get_optional(host->dev, "switch",
	host->slot_switch = devm_gpiod_get_optional(host->dev, "switch",
						    GPIOD_OUT_LOW);
	if (IS_ERR(host->slot_switch))
		return dev_err_probe(host->dev, PTR_ERR(host->slot_switch),