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 4F8F0C433EF for ; Mon, 20 Dec 2021 23:23:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 749E183788; Tue, 21 Dec 2021 00:23:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=dionne-riel.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=dionne-riel-com.20210112.gappssmtp.com header.i=@dionne-riel-com.20210112.gappssmtp.com header.b="wzJtdDdp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F4D38378D; Tue, 21 Dec 2021 00:23:51 +0100 (CET) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (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 1CA3F83787 for ; Tue, 21 Dec 2021 00:23:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=dionne-riel.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@dionne-riel.com Received: by mail-qv1-xf2c.google.com with SMTP id js9so10805070qvb.12 for ; Mon, 20 Dec 2021 15:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dionne-riel-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=vJ1bf1+4NImq6OvHI8q3DSxCkZtcrEUTD2r9k3IJbt8=; b=wzJtdDdpac5idRoGiVl1RI/kr6EGmxEt7wJ2gKvKWRCQkkntav5nPMNBdgKM76fmew 4Gv2A5oCrI1ymGbAR6mdPqeeQLwEUvZNV944yNQb6lBO4mp/JAB3rApj2oMC+LalTYJw l+hX9K1bP5vWfqWhM1wNanoAJoHS7S6+om5+jBJi0PNmPBgopzwtMS8nE7v9P1I7rDBh D6lFujYkoeUoEtiwcJhKGInyY0ytyR+4jBnWOXkyH6Z4KYTkQCmF3SdwOVaNQx+DP0JR XKKev6noLyln5YYHR1VgJUIZYRMI2t3G+ms/ZiwiZ7WErIPuMGI7YuHe9P8fN0R+igZn wtCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=vJ1bf1+4NImq6OvHI8q3DSxCkZtcrEUTD2r9k3IJbt8=; b=y9nNfDROCkpuUDxEal6UB7PgNXQdsoimhcUnEcY5GvGorLlKvvh8uX7r6bFY7F8UPI AB0CeiUCI/dvVQyuHsTFP+N/EXjrxijOdRASyZUmCABC1zRZILUgFEkUjAEZlL4phqA/ gPKBgNHvUcM09pOY9NL+LLGZKBvze3/mi2V+12oJB+b6yhDbMMVBZFDBeUR1TnQsW5N2 6zBJufNDA7m+B51Qz4QxHBNhs7LWelqVdws3hAa6fL+QWj6hjz2TU6ZRD2XqomKmrg43 AIfLH6QejrUx6I8kr4Y11VG8Gd3QDLWf/dYrcfyivNe/yWgfElcHz08txfNgq8j3HKHB fVsQ== X-Gm-Message-State: AOAM5325/DtR0Ktj4OCAlig5pknoJgbY1KFSVtb4uWJrXmvUSsRIRZI7 bjZlqf6CSFDsxTVxx25fJWM7lBEuo+xVoQ== X-Google-Smtp-Source: ABdhPJz2xtxamlqKxM8lXwJzSHTm8GlAT4vfw6Jfet/gsUXTAMtTM/tiJW8Gs7i7+EDh7ufaAGALSA== X-Received: by 2002:a05:6214:e41:: with SMTP id o1mr419080qvc.88.1640042626557; Mon, 20 Dec 2021 15:23:46 -0800 (PST) Received: from DUFFMAN (135-23-195-85.cpe.pppoe.ca. [135.23.195.85]) by smtp.gmail.com with ESMTPSA id u188sm12211237qkh.30.2021.12.20.15.23.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 15:23:46 -0800 (PST) Date: Mon, 20 Dec 2021 18:23:45 -0500 From: Samuel Dionne-Riel To: Subject: [PATCH] cmd: adc: Report return value on error Message-ID: <20211220182345.52e0d6f9.samuel@dionne-riel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean Reporting the return value should always be done on error conditions, this way the developer can start debugging issues with more knowledge in-hand. Signed-off-by: Samuel Dionne-Riel --- cmd/adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/adc.c b/cmd/adc.c index 16f914a030..75739bc8ee 100644 --- a/cmd/adc.c +++ b/cmd/adc.c @@ -81,8 +81,8 @@ static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc, ret = adc_channel_single_shot(argv[1], simple_strtol(argv[2], NULL, 0), &data); if (ret) { - printf("Error getting single shot for device %s channel %s\n", - argv[1], argv[2]); + printf("Error getting single shot for device %s channel %s (ret=%d)\n", + argv[1], argv[2], ret); return CMD_RET_FAILURE; } -- 2.34.0 -- Samuel Dionne-Riel