]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: cavium: Prevent crash with incomplete DT
authorJan Glauber <jglauber@cavium.com>
Mon, 22 May 2017 11:09:19 +0000 (13:09 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 22 May 2017 16:01:46 +0000 (18:01 +0200)
commit054a2c0909d4ea51d1c7b5994174cd10ebaede88
treed071beb9bc6e7cb30a8d7b4fcd5b0587f8f44e5c
parent25d9065f9beb9ffc21a4f9a889f9156c36dc0f1b
mmc: cavium: Prevent crash with incomplete DT

In case the DT specifies neither a regulator nor a gpio
for the shared power the driver will crash accessing the regulator.
Prevent the crash by checking the regulator before use.

Use mmc_regulator_get_supply() instead of open coding the same
logic.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cavium.c