Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3164896imw; Mon, 11 Jul 2022 03:18:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoexLpxUVmQPBB5HFD/RcHXyPhDFHQXe6sTcyXHWh2QWp5AZLqHiXEfKn6jEQOMmCj4udI X-Received: by 2002:a17:906:c152:b0:726:35bd:b3bd with SMTP id dp18-20020a170906c15200b0072635bdb3bdmr17947653ejc.201.1657534733433; Mon, 11 Jul 2022 03:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657534733; cv=none; d=google.com; s=arc-20160816; b=qR0q4HYju0PI2t/W8HvR17OyiC2tNo/adcnKSwYml139HiGSJUUitB/0VjEwinyyYc CZ5KT7Me3svDxYoWLEPTUb1lcw+/PMlzF7IbcUp65pMRDC4F+4yfJ24hDEb45j5/e9iP ZhAznQUkUc1LT37ze8lqNxZSfollCwCei1wJ01G8I0bkc+hZBlQddbYi/ZoTLGN+LTBV BxxBfAhVBlUpMJBkDxa8EJk2jJbwH2miFR7LXgvyA0i0cGbeAGFZN5poDGDkHOSBA79u 8PwwEs+TixIylzGgLn+k5YBAOrXwojcPfZZdcPUHcnUG3vTzWNAg3fyIoFLaWgkias3Q hC3Q== 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=GWsrHfDnMbv2979ZcMf8YzglSGK2PnW459kQLeTptBU=; b=YJkbIMoGIqm5qx4y+LBQq5L7Urm+Hyhe3VK5eTukn1yMLcuzNQshPfJZBV2T0n53tO qRbeo15fbbAg/fQm3gP9UJ3rU3G9qRO1Yblf8AhdAoV4LC4h106/NUU4/sS/Zs12ureg CQuAAZBwzzjIGRo1I8N8icbUKbJdUy8n+363IcCyWSoWfqUXChQVOlYL0vx6ejebc+aT GUtM4CxSN0Rxan4Bz5BbUNqAgExgv5qCAbY+fApAie8R1Jz1RXfMWMnTOb6TMhTNK0IE XmBGyIOtnQON5hTNr89BqXnfZFMNVEOX/YIqj//luou9p+rXH3vDtXp270nJs2NiYPrW e7Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bLtvDCOm; 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 gb41-20020a170907962900b0072b4cba9671si6158930ejc.186.2022.07.11.03.18.28; Mon, 11 Jul 2022 03:18: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=bLtvDCOm; 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 S231971AbiGKJV1 (ORCPT + 99 others); Mon, 11 Jul 2022 05:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231919AbiGKJUv (ORCPT ); Mon, 11 Jul 2022 05:20:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFBA558E0; Mon, 11 Jul 2022 02:12:46 -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 dfw.source.kernel.org (Postfix) with ESMTPS id AEEE16111F; Mon, 11 Jul 2022 09:12:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4360C385A5; Mon, 11 Jul 2022 09:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530765; bh=83a72sjXNaJzb4ILacnxZowX5LjUNTxN6KSv30OSb0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bLtvDCOmWiVpedQvrCiovvMocfsIRyCg47MtWfN6qEbnE/JnJJbWbbkB2+gUo3XBd fXMG3toElnvVp9XCAurqAG8NUlqU9MWz2iY688TewwEk8vVu32lYYs2WaH8l4ymlTv IM9DNgv7ZonuSmtUHAoIXa7Av8OHH/jaB5Y3PYF8= 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.10 32/55] pinctrl: sunxi: sunxi_pconf_set: use correct offset Date: Mon, 11 Jul 2022 11:07:20 +0200 Message-Id: <20220711090542.710329127@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090541.764895984@linuxfoundation.org> References: <20220711090541.764895984@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 be7f4f95f455..24c861434bf1 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -544,6 +544,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