From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C56CC433FE for ; Wed, 27 Oct 2021 18:35:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BF8866103C for ; Wed, 27 Oct 2021 18:35:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF8866103C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D479E8356D; Wed, 27 Oct 2021 20:35:09 +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="RNvYPY6Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CEAC283569; Wed, 27 Oct 2021 20:35:07 +0200 (CEST) Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) (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 19FDD83499 for ; Wed, 27 Oct 2021 20:34:59 +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@google.com Received: by mail-ua1-x930.google.com with SMTP id ba32so6751712uab.6 for ; Wed, 27 Oct 2021 11:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CF7xTfZ77afy8ixoz9IiZHdz9uoIiFF/aDPgLlb/47k=; b=RNvYPY6Qts5Brh7N3In4Qxiq1sizr1zdvVkSadHNosFvovD38Iok7Se8xjSY8HLCf0 tgpWG8a3mNumcmQQ2soUCYGvMr7FxogiD7rlLW5JtvJmeHkO8c0IMfET1dv+4pIDP9oj TEpGspws8chnDmkBIGwXvcpM6dsa4yv8hE+XY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CF7xTfZ77afy8ixoz9IiZHdz9uoIiFF/aDPgLlb/47k=; b=ukFGMWMRIeoQbJfZNi1ca2vpkD3Z1o6TROFZjjeYXhUq4EYValPf1nxqcSwDtJcPCV IEK11o9fLIuvHWeEn6RVJaBh2gRwrPKl60m5/P5ygBKhzBtkKl9eXnY5Q0oq+CiJggGa rxu4s8+VjZrTlYPf3kdYrDYxPnB0v6L8TS5FE4Nom60SKP/VDInat5z+kvyHN4d1DhI7 0GiMltK85xVPWwjDnBgU6dHGgdaz5HABfrjvjSfD+JA5Iqch682r92ieKOqw46yTPf9C BlRkfeIPYMfREIkVxoq8MOCsCYqovUsN/cSO2Wig+7taLJQ5/h+uSCroXFW0VKpZlygp QayA== X-Gm-Message-State: AOAM532KqxWF0lioHItF7KEX9+sTWB4cgynk39vqHuku98vsHJW7jXkp u+/1/T61J9F54AnwYfB4uJ0u1FrSyaXiQkBMmL1F/Oj/c94= X-Google-Smtp-Source: ABdhPJwzEOIktCvAi+XlgFw6UQh8w7ULxCpneLLzlC+yEx0hA50A4/kMCYtv3mZdvyH6IiVoXlDHKcBKVZZWAi+319U= X-Received: by 2002:a67:3087:: with SMTP id w129mr4350220vsw.15.1635359697674; Wed, 27 Oct 2021 11:34:57 -0700 (PDT) MIME-Version: 1.0 References: <20211027142338.77161-1-andriy.shevchenko@linux.intel.com> <20211027142338.77161-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20211027142338.77161-2-andriy.shevchenko@linux.intel.com> From: Simon Glass Date: Wed, 27 Oct 2021 12:34:46 -0600 Message-ID: Subject: Re: [PATCH v1 2/2] x86: tangier: pinmux: Move error message to the caller To: Andy Shevchenko Cc: U-Boot Mailing List , Bin Meng Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On Wed, 27 Oct 2021 at 08:23, Andy Shevchenko wrote: > > Move error message to the caller of mrfld_pinconfig*() in order > to unify them in the future. > > Signed-off-by: Andy Shevchenko > --- > arch/x86/cpu/tangier/pinmux.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) Reviewed-by: Simon Glass > > diff --git a/arch/x86/cpu/tangier/pinmux.c b/arch/x86/cpu/tangier/pinmux.c > index 883860f75e28..7b2c35fbf794 100644 > --- a/arch/x86/cpu/tangier/pinmux.c > +++ b/arch/x86/cpu/tangier/pinmux.c > @@ -117,13 +117,7 @@ static int mrfld_pinconfig_protected(unsigned int pin, u32 mask, u32 bits) > debug("scu: v: 0x%x p: 0x%x bits: %d, mask: %d bufcfg: 0x%p\n", > v, (u32)bufcfg, bits, mask, bufcfg); > > - ret = scu_ipc_raw_command(IPCMSG_INDIRECT_WRITE, 0, &v, 4, > - NULL, 0, (u32)bufcfg, 0); > - if (ret) > - pr_err("Failed to set mode via SCU for pin %u (%d)\n", > - pin, ret); > - > - return ret; > + return scu_ipc_raw_command(IPCMSG_INDIRECT_WRITE, 0, &v, 4, NULL, 0, (u32)bufcfg, 0); In general I like to separate out the error return so we can use something like: ret = scu_... if (ret) return log_msg_ret("scu", ret); return 0; > } > > static int mrfld_pinconfig(unsigned int pin, u32 mask, u32 bits) > @@ -181,6 +175,8 @@ static int mrfld_pinctrl_cfg_pin(ofnode pin_node) > ret = mrfld_pinconfig_protected(pad_offset, mask, mode); > else > ret = mrfld_pinconfig(pad_offset, mask, mode); > + if (ret) > + pr_err("Failed to set mode for pin %u (%d)\n", pad_offset, ret); > > return ret; > } > -- > 2.33.0 >