[PATCH 6/8] adc: Allow use of adc with DM_REGULATOR disabled

Jonas Karlman jonas at kwiboo.se
Thu Oct 17 22:00:25 CEST 2024


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 at kwiboo.se>
---
 drivers/adc/adc-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/adc/adc-uclass.c b/drivers/adc/adc-uclass.c
index 16600be821c9..b02430eb7d7f 100644
--- a/drivers/adc/adc-uclass.c
+++ b/drivers/adc/adc-uclass.c
@@ -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. */
-- 
2.46.2



More information about the U-Boot mailing list