9
0
Fork 0

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>
This commit is contained in:
Alexander Shiyan 2016-06-18 16:28:57 +03:00 committed by Sascha Hauer
parent 5cf7d7014a
commit f296a48612
1 changed files with 10 additions and 9 deletions

View File

@ -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)