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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58B68C433E2 for ; Sat, 5 Sep 2020 22:09:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 725CE20760 for ; Sat, 5 Sep 2020 22:09:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TUKGbYnd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 725CE20760 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WpJdxKKlT9hcOrDSMU1r9mlpwDeg0wrqCW9EERKYKX8=; b=TUKGbYndQMXfbv+DVaI43tk4i fYzoQj14Uq//oGj69tKDLFBJE0fK2YpNNBnTvXkwuddf1BR6Fv1vgs2BIzaqElvtHvkvWZmSoiXVz 17OGc+qxSuWZxj7fzDzZ3QX0r0G/t1kfbm66Z7PA76AThH4cLkvPDQ7Va9jVppqqyybv+1nl8Rv6U K3xxai/3NZmnzPw/QyT8DBjhdE9O24eGZkvu3p4K3QT9ydVZgu0KfNpLtz92HMNsGa1kfaVgFkCJp kK041oKY+7Fnahv4llyiqiK1PB9aHmBk0+nau6AiGPysWtq18SJ7pOah5moGO2+1S4eHaA0fIN90D fsKoFnlPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEgNG-0006lN-Fm; Sat, 05 Sep 2020 22:09:30 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEgNE-0006kx-Rq for linux-rockchip@lists.infradead.org; Sat, 05 Sep 2020 22:09:29 +0000 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEgNC-0005mD-Pd; Sun, 06 Sep 2020 00:09:26 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: linus.walleij@linaro.org, Jianqun Xu Subject: Re: [PATCH 4/6] pinctrl: rockchip: do not set gpio if bank invalid Date: Sun, 06 Sep 2020 00:09:26 +0200 Message-ID: <1687104.4lZP0y4C37@diego> In-Reply-To: <20200831084753.7115-5-jay.xu@rock-chips.com> References: <20200831084753.7115-1-jay.xu@rock-chips.com> <20200831084753.7115-5-jay.xu@rock-chips.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_180928_912412_4D966007 X-CRM114-Status: GOOD ( 16.48 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Jianqun Xu , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Am Montag, 31. August 2020, 10:47:51 CEST schrieb Jianqun Xu: > Add valid check for gpio bank. As this obviously fixes a problem you encountered please elaborate a bit more. Just so that people reading the log later understand when this issue surfaced. Also - maybe even more important - why is this limited to PIN_CONFIG_OUTPUT? Like when the whole bank is not valid, you should be able to return the -ENOTSUPP even before entering the "for" loop in these functions. > Change-Id: Ib03e2910a7316bd61df18236151e371c4d04077a Please remove the changeId. Thanks Heiko > Signed-off-by: Jianqun Xu > --- > drivers/pinctrl/pinctrl-rockchip.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c > index 265d64b8c4f5..6080573155f6 100644 > --- a/drivers/pinctrl/pinctrl-rockchip.c > +++ b/drivers/pinctrl/pinctrl-rockchip.c > @@ -2687,6 +2687,9 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, > return rc; > break; > case PIN_CONFIG_OUTPUT: > + if (!bank->valid) > + return -ENOTSUPP; > + > rockchip_gpio_set(&bank->gpio_chip, > pin - bank->pin_base, arg); > rc = _rockchip_pmx_gpio_set_direction(&bank->gpio_chip, > @@ -2752,6 +2755,9 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, > arg = 1; > break; > case PIN_CONFIG_OUTPUT: > + if (!bank->valid) > + return -ENOTSUPP; > + > rc = rockchip_get_mux(bank, pin - bank->pin_base); > if (rc != RK_FUNC_GPIO) > return -EINVAL; > _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip