mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
mmc: omap: fix broken slot switch lookup
The lookup is done before host->dev is initialized. It will always just
fail silently, and the MMC behaviour is totally unpredictable as the switch
is left in an undefined state. Fix that.
Fixes: e519f0bb64
("ARM/mmc: Convert old mmci-omap to GPIO descriptors")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Message-ID: <20240223181439.1099750-4-aaro.koskinen@iki.fi>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
480d44d082
commit
d4debbcbff
1 changed files with 6 additions and 7 deletions
|
@ -1384,13 +1384,6 @@ static int mmc_omap_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(host->virt_base))
|
||||
return PTR_ERR(host->virt_base);
|
||||
|
||||
host->slot_switch = 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),
|
||||
"error looking up slot switch GPIO\n");
|
||||
|
||||
|
||||
INIT_WORK(&host->slot_release_work, mmc_omap_slot_release_work);
|
||||
INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);
|
||||
|
||||
|
@ -1409,6 +1402,12 @@ 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",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(host->slot_switch))
|
||||
return dev_err_probe(host->dev, PTR_ERR(host->slot_switch),
|
||||
"error looking up slot switch GPIO\n");
|
||||
|
||||
host->id = pdev->id;
|
||||
host->irq = irq;
|
||||
host->phys_base = res->start;
|
||||
|
|
Loading…
Reference in a new issue