From: Jerome Brunet Date: Tue, 15 May 2018 09:57:48 +0000 (+0200) Subject: mmc: meson-gx: add device reset X-Git-Tag: v4.19~895^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19c6beaa064c4b198e7d774feab7a0851cf606a0;p=platform%2Fkernel%2Flinux-rpi.git mmc: meson-gx: add device reset Trigger the reset line of the mmc controller while probing, if available. The reset should be optional for now, at least until all related DT nodes have the reset property. Reviewed-by: Kevin Hilman Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 55bbd67..c201c37 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1212,6 +1213,14 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + ret = device_reset_optional(&pdev->dev); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "device reset failed: %d\n", ret); + + return ret; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(host->regs)) {