[PATCH v2 3/7] drivers: video: simple_panel: make simple panel independent of backlight

Nikhil M Jain n-jain1 at ti.com
Tue Jan 31 11:05:16 CET 2023


This patch updates the necessary Kconfigs to make simple panel
driver independent of backlight driver  and compiling backlight
related code in simple-panel driver conditionally to when user
has set CONFIG_BACKLIGHT.

Signed-off-by: Nikhil M Jain <n-jain1 at ti.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 drivers/video/simple_panel.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c
index c8f7022ea6..91c91ee75d 100644
--- a/drivers/video/simple_panel.c
+++ b/drivers/video/simple_panel.c
@@ -63,12 +63,15 @@ static int simple_panel_of_to_plat(struct udevice *dev)
 				return ret;
 		}
 	}
+
 	ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev,
-					   "backlight", &priv->backlight);
+						   "backlight", &priv->backlight);
 	if (ret) {
 		debug("%s: Cannot get backlight: ret=%d\n", __func__, ret);
-		return log_ret(ret);
+		if (ret != -ENOENT)
+			return log_ret(ret);
 	}
+
 	ret = gpio_request_by_name(dev, "enable-gpios", 0, &priv->enable,
 				   GPIOD_IS_OUT);
 	if (ret) {
-- 
2.34.1



More information about the U-Boot mailing list