summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mci-core.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2016-06-18 16:28:57 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2016-06-20 08:32:36 +0200
commitf296a486120044f97b62c0a70b10502448096386 (patch)
tree64297e71636f31c0d029743ff5993122125ff0f8 /drivers/mci/mci-core.c
parent5cf7d7014afd7d6ec9c2bcc611dae1e5439b42aa (diff)
downloadbarebox-f296a486120044f97b62c0a70b10502448096386.tar.gz
barebox-f296a486120044f97b62c0a70b10502448096386.tar.xz
mci: core: Do not fail if vmmc regulator fail
The vmmc regulator can be an usupported device for barebox, the specific MFD regulator type, for example. Just lets think is all ok. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/mci-core.c')
-rw-r--r--drivers/mci/mci-core.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 42dde06c3c..4e176f7b3c 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1589,11 +1589,13 @@ static int mci_card_probe(struct mci *mci)
return -ENODEV;
}
- ret = regulator_enable(host->supply);
- if (ret) {
- dev_err(&mci->dev, "failed to enable regulator: %s\n",
+ if (!IS_ERR(host->supply)) {
+ ret = regulator_enable(host->supply);
+ if (ret) {
+ dev_err(&mci->dev, "failed to enable regulator: %s\n",
strerror(-ret));
- return ret;
+ return ret;
+ }
}
/* start with a host interface reset */
@@ -1684,7 +1686,8 @@ on_error:
if (rc != 0) {
host->clock = 0; /* disable the MCI clock */
mci_set_ios(mci);
- regulator_disable(host->supply);
+ if (!IS_ERR(host->supply))
+ regulator_disable(host->supply);
}
return rc;
@@ -1771,10 +1774,8 @@ int mci_register(struct mci_host *host)
mci->dev.detect = mci_detect;
host->supply = regulator_get(host->hw_dev, "vmmc");
- if (IS_ERR(host->supply)) {
- ret = PTR_ERR(host->supply);
- goto err_free;
- }
+ if (IS_ERR(host->supply))
+ dev_err(&mci->dev, "Failed to get 'vmmc' regulator.\n");
ret = register_device(&mci->dev);
if (ret)