From 3f603cbbb8e175e545d6037a783e1ef82bab30f9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 11 Feb 2016 13:23:26 -0700 Subject: 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 --- drivers/video/vidconsole-uclass.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 832e90a..c8cc05e 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -240,8 +240,7 @@ static int do_video_setcursor(cmd_tbl_t *cmdtp, int flag, int argc, if (argc != 3) return CMD_RET_USAGE; - uclass_first_device(UCLASS_VIDEO_CONSOLE, &dev); - if (!dev) + if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; col = simple_strtoul(argv[1], NULL, 10); row = simple_strtoul(argv[2], NULL, 10); @@ -259,8 +258,7 @@ static int do_video_puts(cmd_tbl_t *cmdtp, int flag, int argc, if (argc != 2) return CMD_RET_USAGE; - uclass_first_device(UCLASS_VIDEO_CONSOLE, &dev); - if (!dev) + if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; for (s = argv[1]; *s; s++) vidconsole_put_char(dev, *s); -- cgit v1.1