aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorMichal Suchanek2022-10-12 21:57:56 +0200
committerSimon Glass2022-10-17 21:17:12 -0600
commitf42642347120d988e7cf6986139e7ec68e36bc6b (patch)
tree8e17d031e8d4d4e76c009997848e6bed6a27ae59 /drivers/video
parent7ff12631b44cdbb86c868ce02efd5a06429c7683 (diff)
video: ipuv3: Fix error handling when getting the display
The code checks that uclass_first_device returned a device but the returned value that is assigned is never used. Use uclass_first_device_err instead, and move the error return outside of the if block. Fixes: f4ec1ae08e ("mxc_ipuv3_fb.c: call display_enable") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/imx/mxc_ipuv3_fb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 49bbeefdd8e..8b01a1be112 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -609,12 +609,11 @@ static int ipuv3_video_probe(struct udevice *dev)
return ret;
#if defined(CONFIG_DISPLAY)
- ret = uclass_first_device(UCLASS_DISPLAY, &disp_dev);
- if (disp_dev) {
+ ret = uclass_first_device_err(UCLASS_DISPLAY, &disp_dev);
+ if (!ret)
ret = display_enable(disp_dev, 16, NULL);
- if (ret < 0)
- return ret;
- }
+ if (ret < 0)
+ return ret;
#endif
if (CONFIG_IS_ENABLED(PANEL)) {
struct udevice *panel_dev;