mmc: sdhci-brcmstb: handle mmc_of_parse() errors during probe
authorStefan Wahren <stefan.wahren@i2se.com>
Sun, 23 Dec 2018 20:59:18 +0000 (21:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:17 +0000 (10:24 +0100)
[ Upstream commit 1e20186e706da8446f9435f2924cd65ab1397e73 ]

We need to handle mmc_of_parse() errors during probe otherwise the
MMC driver could start without proper initialization (e.g. power sequence).

Fixes: 476bf3d62d5c ("mmc: sdhci-brcmstb: Add driver for Broadcom BRCMSTB SoCs")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/sdhci-brcmstb.c

index 159f6f64c68e78fb11cd86c9472df97aae9e6ad8..ed6473731b458af3fd1a83fee78c69205fa37562 100644 (file)
@@ -90,7 +90,9 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
        host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ;
 
        sdhci_get_of_property(pdev);
-       mmc_of_parse(host->mmc);
+       res = mmc_of_parse(host->mmc);
+       if (res)
+               goto err;
 
        /*
         * Supply the existing CAPS, but clear the UHS modes. This