mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user