mmc: meson-gx: fix error path in meson_mmc_clk_init / meson_mmc_probe
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 4 Mar 2017 12:25:14 +0000 (13:25 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 Apr 2017 19:41:10 +0000 (21:41 +0200)
commitcac3a47855c24bf060e58977473747ef3de7dedf
tree0833795bd5314ae430ff8ae1e3d01ab0481af9f6
parente9883ef228e5c128d34143ae87c97f555f79620c
mmc: meson-gx: fix error path in meson_mmc_clk_init / meson_mmc_probe

The condition should be "if (ret)" as the disable/unprepare is
supposed to be executed if the previous command fails.
In addition adjust the error path in probe to properly deal
with the case that cfg_div_clk can be registered successfully
but enable/prepare fails.
In this case we shouldn't call clk_disable_unprepare.

Reported-by: MichaƂ Zegan <webczat_200@poczta.onet.pl>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/meson-gx-mmc.c