]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: am654_sdhci: Allow driver to probe without PDs specified
authorAndreas Dannenberg <dannenberg@ti.com>
Tue, 4 Jun 2019 22:55:44 +0000 (17:55 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 17 Jul 2019 15:12:54 +0000 (11:12 -0400)
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>
drivers/mmc/am654_sdhci.c

index fe633aa39aad6dddbf727c10ba6468c94d9b9ae8..fb0fb580706c9cf5bcdcf395f0764514cb3c07d6 100644 (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;
        }