]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
adc: Allow use of adc with DM_REGULATOR disabled
authorJonas Karlman <jonas@kwiboo.se>
Thu, 17 Oct 2024 20:00:25 +0000 (20:00 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 26 Oct 2024 02:46:48 +0000 (10:46 +0800)
When DM_REGULATOR=n is used the device_get_supply_regulator() function
always return -ENOSYS.

Change to treat missing support for regulators as a missing optional
vdd/vss-supply regulator to reduce error messages being logged.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/adc/adc-uclass.c

index 16600be821c9fc4fdd1488504ae29a7cd004c1ca..b02430eb7d7f1b0716159a084030085ba33af3ed 100644 (file)
@@ -382,7 +382,7 @@ static int adc_vdd_plat_set(struct udevice *dev)
        if (!ret)
                return adc_vdd_plat_update(dev);
 
-       if (ret != -ENOENT)
+       if (ret != -ENOSYS && ret != -ENOENT)
                return ret;
 
        /* No vdd-supply phandle. */
@@ -406,7 +406,7 @@ static int adc_vss_plat_set(struct udevice *dev)
        if (!ret)
                return adc_vss_plat_update(dev);
 
-       if (ret != -ENOENT)
+       if (ret != -ENOSYS && ret != -ENOENT)
                return ret;
 
        /* No vss-supply phandle. */