Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3176654imw; Mon, 11 Jul 2022 03:36:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uIBV0h+Mesi9Rnt4b93Wo+saCVdVLrlYU7hvd1sF/rsT9LukyrkHW9cb2jEmsw7VXwFu/e X-Received: by 2002:a17:906:794e:b0:726:3fbb:5761 with SMTP id l14-20020a170906794e00b007263fbb5761mr17559550ejo.346.1657535813916; Mon, 11 Jul 2022 03:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657535813; cv=none; d=google.com; s=arc-20160816; b=j2O3A2FEVxT8syEQHzwBc47Qta8VA/rGlkNtCKae7EyobiLmdas+BqvbAhK/fsW801 CDsE4RSDdOl0LDmn2Iq9MVfyd4ekcDyWMkwqF4Kfg5IDcx3M1fBz63GB84FR1OqHKqRD /Gazj6Zjb33fss1GGAl7jytXkyjsThUxrq8SqO46CaLNjbSSJUycI4sGYwicICKaXKkW KTaB0mXyj6GxcR34nmFU3e1M747PIbGnDntjl6sh7PbjPA73KyhegUabfqtReFgyJnPr +H9LLWU9eOvuD7O7vpOUNkcVDncBySbnZtMV/8zZEHT53QiRwT0iwvwvkBPicU7z4tcv mDgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y+OHhcac+P6cikCarrRf/XtWdZmbejgsB7W/Xg3pomA=; b=nsrnLS04FQo06HDByTzMlXlA8+YS6aWrllPqiZzTksibrNBR1322nfXEdTr3W8nKhm ouuFdIuBCf9o2UPXVbIWt5BLb9yjTz4LMJk/SCZ+QOimE7JE8jX7bYJO+dW/UVi67t02 +UV5Csoc5aRPEOZkDV2jLrCwKKrntMf5mvF7Hxx/71CxntW8lZETM+vaPYZayDfiIgqF ONwndBauCRzHkq1/s7+2Pcm94aJm9hNU2NIcGNhAoMT5CZ2/ML8Qq5BcrBQ/BDYrZicf 7o0g54qR/86r/fGzZJj1HsVT44CsGnNK1fNx6vsVZfTnxgnf8UDipPBnSU68kDc6x16i VtzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LY++gFRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji11-20020a170907980b00b00722f49011f0si10887840ejc.1.2022.07.11.03.36.27; Mon, 11 Jul 2022 03:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LY++gFRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231698AbiGKJRp (ORCPT + 99 others); Mon, 11 Jul 2022 05:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiGKJRR (ORCPT ); Mon, 11 Jul 2022 05:17:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E57BDF1A; Mon, 11 Jul 2022 02:11:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A54C2B80E5E; Mon, 11 Jul 2022 09:11:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11DDEC34115; Mon, 11 Jul 2022 09:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530677; bh=TQ1o81IdEGrKyEmd0iBY/iyi7Ilq6/KNstQRS2Mu2Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LY++gFRGpr8ehvo+oGaeAF/OSGU63hL3BjMiH7BHVFD+zR3qiSIiyUVvP2ZXUE0ps 5gnjJa39X2v5vKxtuMc42woafxjoE79EhugXsNDizC0JrUqWMN3/dHYpAIOxNMsht2 x7PfRy9ujolqMpx6YChb8LhlKzBLI3MHVXh1+efM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrei Lalaev , Samuel Holland , Linus Walleij , Sasha Levin Subject: [PATCH 5.4 21/38] pinctrl: sunxi: sunxi_pconf_set: use correct offset Date: Mon, 11 Jul 2022 11:07:03 +0200 Message-Id: <20220711090539.357246146@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090538.722676354@linuxfoundation.org> References: <20220711090538.722676354@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Lalaev [ Upstream commit cd4c1e65a32afd003b08ad4aafe1e4d3e4e8e61b ] Some Allwinner SoCs have 2 pinctrls (PIO and R_PIO). Previous implementation used absolute pin numbering and it was incorrect for R_PIO pinctrl. It's necessary to take into account the base pin number. Fixes: 90be64e27621 ("pinctrl: sunxi: implement pin_config_set") Signed-off-by: Andrei Lalaev Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220525190423.410609-1-andrey.lalaev@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 77783582080c..c4052eab6bfc 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -536,6 +536,8 @@ static int sunxi_pconf_set(struct pinctrl_dev *pctldev, unsigned pin, struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); int i; + pin -= pctl->desc->pin_base; + for (i = 0; i < num_configs; i++) { enum pin_config_param param; unsigned long flags; -- 2.35.1