[U-Boot] [PATCH 01/13] mmc: k3_arasan: Allow driver to probe without PDs specified

Andreas Dannenberg dannenberg at ti.com
Tue May 7 17:25:30 UTC 2019


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 at ti.com>
---
 drivers/mmc/k3_arsan_sdhci.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/k3_arsan_sdhci.c b/drivers/mmc/k3_arsan_sdhci.c
index d5f2857382..785ba135c7 100644
--- a/drivers/mmc/k3_arsan_sdhci.c
+++ b/drivers/mmc/k3_arsan_sdhci.c
@@ -31,14 +31,14 @@ static int k3_arasan_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\n");
+			return ret;
+		}
+	} else if (ret != -ENOENT && ret != -ENODEV && ret != -ENOSYS) {
+		dev_err(dev, "power_domain_get() failed: %d\n", ret);
 		return ret;
 	}
 
-- 
2.17.1



More information about the U-Boot mailing list