Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F760C433F5 for ; Thu, 6 Oct 2022 14:47:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B08BF84DB6; Thu, 6 Oct 2022 16:47:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YZbUXPyG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4897284E38; Thu, 6 Oct 2022 16:37:06 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7BDB984E41 for ; Thu, 6 Oct 2022 16:36:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id q200so997621iod.7 for ; Thu, 06 Oct 2022 07:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h44QG3Zx8FqIugIxa6pqEKlNYEbP/LeptXDdEHWOCKo=; b=YZbUXPyGedka5ZjJN53xQY6vL24h5poWC7e2/ZsAa9PKspORSSPVksFAt7QkXf1hj7 4u00Nw6g9sX/3t55dEuaIe4XtE4J9gsQ+Nq6c0Kl9s9w2d1i96hyP4ApKedhlS3Z9CZ2 tDVvc/+v4gsU8e79XvJu+2cO45JX13wTH+QiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h44QG3Zx8FqIugIxa6pqEKlNYEbP/LeptXDdEHWOCKo=; b=1hWFczsFuPK6I9CcKk7+SsUxUC5q3si/Gd1BDNdNuPiwcA7rLdAY0KCSuwihXPNP2G J2l5Yooe0tRNrGzgzEaJjCqDEv+tORV8BVCAv9SiZuR0dBtvu6Wn0GzS1CoaKJlmPBFx sDDZykF1BrMrDaFpWhCaO1HlRn/RoiI9xmtFi/ky7odDDRXD1LCZAT39YFOPHx8jZ9sA GBOwv1YbPikViM++kZGfLFxxMoR2Nrlywxwk2fIluszXtIHSoEuyodpPHK8ZkJdkcBRR gMKuk2jKZ8FHrq2weVlXTG7WNS1dpU+T1H8NMdJFndNmqvBK/z4CKN/LcPdZ5ZaLoHiD HXQQ== X-Gm-Message-State: ACrzQf0N2I+wZ9cs9qHVhdjrQSpyIufuvkL2F0hd35UHvAbox64enFrY E/7tqxgg65CTKyqmXtu79iRx17aqgKTfSw== X-Google-Smtp-Source: AMsMyM5AzkRCHnXeXq5fpwEID3oXYcq3MYboS5sgSKX5MkIP70NkxbekMJYHHE8GrJVfPH0l1BkJ7Q== X-Received: by 2002:a5d:965a:0:b0:6a4:5999:fb9e with SMTP id d26-20020a5d965a000000b006a45999fb9emr55592ios.89.1665067008706; Thu, 06 Oct 2022 07:36:48 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id g22-20020a056602073600b006a102cb4900sm388573iox.39.2022.10.06.07.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 07:36:48 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Simon Glass Subject: [PATCH 03/16] video: Use vidconsole_put_string() to write a string Date: Thu, 6 Oct 2022 08:36:05 -0600 Message-Id: <20221006143619.354301-4-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221006143619.354301-1-sjg@chromium.org> References: <20221006143619.354301-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Use the existing function rather that duplicating the code. Also fix up the missing error handling. Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 53263580e3b..d5667191e0a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -652,17 +652,18 @@ static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice *dev; - const char *s; + int ret; if (argc != 2) return CMD_RET_USAGE; if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; - for (s = argv[1]; *s; s++) - vidconsole_put_char(dev, *s); + ret = vidconsole_put_string(dev, argv[1]); + if (!ret) + ret = video_sync(dev->parent, false); - return video_sync(dev->parent, false); + return ret ? CMD_RET_FAILURE : 0; } U_BOOT_CMD( -- 2.38.0.rc1.362.ged0d419d3c-goog