Message ID | 20231122164040.2262742-9-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1462033vqb; Wed, 22 Nov 2023 08:54:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCJVGolHtqLQgqCE50KP2M2XpHJnedIW1a6fpHv1wFC6HvQu8vGcO//5NKllR/SBb3zvBq X-Received: by 2002:a17:902:6ac3:b0:1cc:2a23:cbab with SMTP id i3-20020a1709026ac300b001cc2a23cbabmr2832726plt.27.1700672087878; Wed, 22 Nov 2023 08:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700672087; cv=none; d=google.com; s=arc-20160816; b=xZukDXMHqKa/p/BnbnHipkJwfppAiDZpgcoQp5ZfUlUrTM73DOuQWGmMvEqJpDvLj6 NDcbm4w3sP1agpxNHbGv4bl0Jzbix8EHFQtCEZjh5m1EfrxW1mM3mT3Vbht8htWfAE7N /Wt+/xZZT0+8lRpYC8rsdN8bgYwZkmI2+SNSuup67QhVOP4pa3h7rxw6cGceIEBUznLr kCUaMH3VEJ0BRukLpvWJsq2ZIOmz+QN76jlVMHFhOes9D6b+dN0W7ubcvZtubYXVQrmk CIWUW7QoE9kWaeBxoZMBnQAFG0EDa78FgxKkXtHGYylFljl5D2fKM0rpKLpAh6Sbagjk EoSA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2fQboedVdAk1EMsmXFcxE717evOmB4nUQoXbOwCQO7U=; fh=sxmBgIg3TktvEv2YZkVPRGvTPPCg6dr/2rID5e1JPXk=; b=UhqrslqX1DCZ6mhIs148PKJs4BlI40Fk16w+eKVLToHF9n5CgqQXy9lhB/WYBizSu5 X9WjrrIWvswM0XXRlUU6wg+mM3Sq4kE2SvlQOS7yWgxzCQ3YwZwdBeHleVfRfm+Lz9eg zMvPdYCnLvl1zvxohazHreXgTh8Fav42AFtiuTh0+p3eRrIfET/xrqaTYGaA0CvOMbyK qEsaAw9gnz/+wY3BBkm2qeWFg00VBzouG1+N4vAWJgcMMhnOyJr+G1FZuEerrvOaC9hd 401BG+v9RoMErxH9sqq9A+ljbzF7x924dM0WoxaX+Bj3WA5yJOnrAvi4mKscLoKQrbOI Icjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QkMJVAU1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f1-20020a170902ff0100b001c61a231d33si12265698plj.292.2023.11.22.08.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:54:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QkMJVAU1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6D1FD8077557; Wed, 22 Nov 2023 08:52:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343647AbjKVQwF (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 11:52:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbjKVQwA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 11:52:00 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FDED40; Wed, 22 Nov 2023 08:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700671916; x=1732207916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d7RiC36q0FYTd81POcZES8vkSbp1GvRz+YFDhzV1grg=; b=QkMJVAU1GXt43bNVeFNBoWhjaSdVIy3l/C5431XVNDl51yJOx+Xy6+Hb RAj3lKxUYP2Gt70wiTI4MvMpv/A8hjlFAkwNnLirA2r5jxkJyFZcGo0+J GbZ5nWmRM90/AwxTMvHCUB+EMp3MR+YePseu1JRGlUeQZPFrOkFwWcCCj F7wKQCiKlkguux46+QGJfZGzQ0Bqz9BtMtRZ7MNNaKKfhxGrFz4uJ3k3K a2P5A4blETTfrms0Fs6uZgQ2IdXHouMQpmVtOMe+6T2AxCXz2h2cF/1FJ R6X/iT3TD8MK5BgBdHUf5I1503Hu6a2o5aJO9UBRydhaMEdR1ByFHbYYQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="5233367" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="5233367" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 08:51:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="910887970" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="910887970" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2023 08:51:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5B248592; Wed, 22 Nov 2023 18:40:45 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Geert Uytterhoeven <geert+renesas@glider.be>, Biju Das <biju.das.jz@bp.renesas.com>, Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>, Jianlong Huang <jianlong.huang@starfivetech.com>, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org, linux-mips@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Dong Aisheng <aisheng.dong@nxp.com>, Fabio Estevam <festevam@gmail.com>, Shawn Guo <shawnguo@kernel.org>, Jacky Bai <ping.bai@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Sascha Hauer <s.hauer@pengutronix.de>, NXP Linux Team <linux-imx@nxp.com>, Sean Wang <sean.wang@kernel.org>, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= <j.neuschaefer@gmx.net>, Paul Cercueil <paul@crapouillou.net>, Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>, Bjorn Andersson <andersson@kernel.org>, Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Emil Renner Berthing <kernel@esmil.dk>, Hal Feng <hal.feng@starfivetech.com> Subject: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc Date: Wed, 22 Nov 2023 18:35:40 +0200 Message-ID: <20231122164040.2262742-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231122164040.2262742-1-andriy.shevchenko@linux.intel.com> References: <20231122164040.2262742-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 08:52:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783283935330376425 X-GMAIL-MSGID: 1783283935330376425 |
Series |
pinctrl: Convert struct group_desc to use struct pingroup
|
|
Commit Message
Andy Shevchenko
Nov. 22, 2023, 4:35 p.m. UTC
struct group_desc is a particular version of the struct pingroup
with associated opaque data. Start switching pin control core and
drivers to use it explicitly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/core.c | 15 ++++++++++++---
drivers/pinctrl/core.h | 5 +++++
2 files changed, 17 insertions(+), 3 deletions(-)
Comments
Hi Andy, kernel test robot noticed the following build errors: [auto build test ERROR on linusw-pinctrl/devel] [also build test ERROR on linusw-pinctrl/for-next next-20231122] [cannot apply to geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/pinctrl-equilibrium-Convert-to-use-struct-pingroup/20231123-005932 base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel patch link: https://lore.kernel.org/r/20231122164040.2262742-9-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc config: i386-buildonly-randconfig-004-20231123 (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202311230849.YPJuLoNP-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21, from drivers/pinctrl/mediatek/pinctrl-mt7981.c:9: >> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 795 | PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1), | ^~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7981_groups') 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 795 | PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1), | ^~~~~~~~~~~~~~~~~ -- In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21, from drivers/pinctrl/mediatek/pinctrl-mt7623.c:11: >> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 1079 | PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0), | ^~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7623_groups') 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 1079 | PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0), | ^~~~~~~~~~~~~~~~~ -- In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21, from drivers/pinctrl/mediatek/pinctrl-mt7629.c:9: >> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 312 | PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds), | ^~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7629_groups') 217 | (struct group_desc) { \ | ^ drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC' 41 | PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs) | ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP' 312 | PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds), | ^~~~~~~~~~~~~~~~~ vim +217 drivers/pinctrl/mediatek/../core.h c7059c5ac70aea1 Tony Lindgren 2016-12-27 214 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 215 /* Convenience macro to define a generic pin group descriptor */ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 216 #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 @217 (struct group_desc) { \ 4930128932e4e5e Andy Shevchenko 2023-11-22 218 .grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 219 .name = _name, \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 220 .pins = _pins, \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 221 .num_pins = _num_pins, \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 222 .data = _data, \ 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 223 } 3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 224
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index c0354ea0597a..981e2e375a39 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -559,7 +559,10 @@ const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, if (!group) return NULL; - return group->name; + if (group->name) + return group->name; + + return group->grp.name; } EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name); @@ -585,8 +588,14 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev, return -EINVAL; } - *pins = group->pins; - *num_pins = group->num_pins; + if (group->pins) { + *pins = group->pins; + *num_pins = group->num_pins; + return 0; + } + + *pins = group->grp.pins; + *num_pins = group->grp.npins; return 0; } diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 179948e44016..7a21af2b437e 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -194,14 +194,18 @@ struct pinctrl_maps { #ifdef CONFIG_GENERIC_PINCTRL_GROUPS +#include <linux/pinctrl/pinctrl.h> + /** * struct group_desc - generic pin group descriptor + * @grp: generic data of the pin group (name and pins) * @name: name of the pin group * @pins: array of pins that belong to the group * @num_pins: number of pins in the group * @data: pin controller driver specific data */ struct group_desc { + struct pingroup grp; const char *name; int *pins; int num_pins; @@ -211,6 +215,7 @@ struct group_desc { /* Convenience macro to define a generic pin group descriptor */ #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ (struct group_desc) { \ + .grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \ .name = _name, \ .pins = _pins, \ .num_pins = _num_pins, \