mmc: am654_sdhci: Allow driver to probe without PDs specified

We would like to use the driver even without power domains being
specified for cases such as during early boot when the required power
domains have already gotten enabled by the SoC's boot ROM and such
explicit initialization is not needed and possible.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Andreas Dannenberg 2019-06-04 17:55:44 -05:00 committed by Tom Rini
parent c7d7e556f2
commit 70942db4dd

View File

@ -215,14 +215,14 @@ static int am654_sdhci_probe(struct udevice *dev)
int ret;
ret = power_domain_get_by_index(dev, &sdhci_pwrdmn, 0);
if (ret) {
dev_err(dev, "failed to get power domain\n");
return ret;
}
ret = power_domain_on(&sdhci_pwrdmn);
if (ret) {
dev_err(dev, "Power domain on failed\n");
if (!ret) {
ret = power_domain_on(&sdhci_pwrdmn);
if (ret) {
dev_err(dev, "Power domain on failed (%d)\n", ret);
return ret;
}
} else if (ret != -ENOENT && ret != -ENODEV && ret != -ENOSYS) {
dev_err(dev, "failed to get power domain (%d)\n", ret);
return ret;
}