aboutsummaryrefslogtreecommitdiff
path: root/cmd/bmp.c
diff options
context:
space:
mode:
authorSimon Glass2016-02-11 13:23:26 -0700
committerSimon Glass2016-03-14 15:34:50 -0600
commit3f603cbbb8e175e545d6037a783e1ef82bab30f9 (patch)
treec3122b2be426be9bcfd3285bda86cb175fb9aaeb /cmd/bmp.c
parentb06750501f5c0eef7fef094f13d2f2e313c60b79 (diff)
dm: Use uclass_first_device_err() where it is useful
Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/bmp.c')
-rw-r--r--cmd/bmp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 01b3d39e9c8..fb6fe3f286c 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -246,18 +246,14 @@ int bmp_display(ulong addr, int x, int y)
addr = map_to_sysmem(bmp);
#ifdef CONFIG_DM_VIDEO
- ret = uclass_first_device(UCLASS_VIDEO, &dev);
+ ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
if (!ret) {
- if (!dev)
- ret = -ENODEV;
- if (!ret) {
- bool align = false;
+ bool align = false;
# ifdef CONFIG_SPLASH_SCREEN_ALIGN
- align = true;
+ align = true;
# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
- ret = video_bmp_display(dev, addr, x, y, align);
- }
+ ret = video_bmp_display(dev, addr, x, y, align);
}
#elif defined(CONFIG_LCD)
ret = lcd_display_bitmap(addr, x, y);