video: Let video_sync to return error value

This patch is preparation for follow up one to support cases where
synchronization can fail.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 3a07f36..f29c0e5 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -89,9 +89,7 @@
 		if (priv->ycur < 0)
 			priv->ycur = 0;
 	}
-	video_sync(dev->parent, false);
-
-	return 0;
+	return video_sync(dev->parent, false);
 }
 
 /* Move to a newline, scrolling the display if necessary */
@@ -101,7 +99,7 @@
 	struct udevice *vid_dev = dev->parent;
 	struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
 	const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-	int i;
+	int i, ret;
 
 	priv->xcur_frac = priv->xstart_frac;
 	priv->ycur += priv->y_charsize;
@@ -116,7 +114,12 @@
 	}
 	priv->last_ch = 0;
 
-	video_sync(dev->parent, false);
+	ret = video_sync(dev->parent, false);
+	if (ret) {
+#ifdef DEBUG
+		console_puts_select_stderr(true, "[vc err: video_sync]");
+#endif
+	}
 }
 
 static const struct vid_rgb colors[VID_COLOR_COUNT] = {
@@ -348,8 +351,15 @@
 		parsenum(priv->escape_buf + 1, &mode);
 
 		if (mode == 2) {
+			int ret;
+
 			video_clear(dev->parent);
-			video_sync(dev->parent, false);
+			ret = video_sync(dev->parent, false);
+			if (ret) {
+#ifdef DEBUG
+				console_puts_select_stderr(true, "[vc err: video_sync]");
+#endif
+			}
 			priv->ycur = 0;
 			priv->xcur_frac = priv->xstart_frac;
 		} else {
@@ -565,7 +575,12 @@
 		console_puts_select_stderr(true, "[vc err: putc]");
 #endif
 	}
-	video_sync(dev->parent, false);
+	ret = video_sync(dev->parent, false);
+	if (ret) {
+#ifdef DEBUG
+		console_puts_select_stderr(true, "[vc err: video_sync]");
+#endif
+	}
 }
 
 static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
@@ -582,7 +597,12 @@
 		console_puts_select_stderr(true, str);
 #endif
 	}
-	video_sync(dev->parent, false);
+	ret = video_sync(dev->parent, false);
+	if (ret) {
+#ifdef DEBUG
+		console_puts_select_stderr(true, "[vc err: video_sync]");
+#endif
+	}
 }
 
 /* Set up the number of rows and colours (rotated drivers override this) */
@@ -691,9 +711,7 @@
 	for (s = argv[1]; *s; s++)
 		vidconsole_put_char(dev, *s);
 
-	video_sync(dev->parent, false);
-
-	return 0;
+	return video_sync(dev->parent, false);
 }
 
 U_BOOT_CMD(