Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2810615rdb; Mon, 4 Dec 2023 08:08:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/q2G12Z3XkN+bD5DrWbdnK64uWr1RQLeE7c8qhiHLYr5OLW/xol55snQHVfdfu5EoCXeI X-Received: by 2002:a05:6a00:b56:b0:6ce:5d4a:c970 with SMTP id p22-20020a056a000b5600b006ce5d4ac970mr969562pfo.17.1701706095051; Mon, 04 Dec 2023 08:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701706095; cv=none; d=google.com; s=arc-20160816; b=E8k4FzZv2uLzySc429kwmMm5Pi4DpWpZ7LsGSx2MXpgAIJ/XcCoPCnGrJgtvzheV63 zfP/SPAT8PRP0thhAbZxCi8+Cv1sRuR2CNwekk/7imJF7xvAevd6mvu3a+8W5NJNpuzO znMeHo2eCLaublaYwWUx0jTms0pX9qTIPBbibPyPA/egB5JwQMyeUkqHGgMetDQxbYdh 0Pb0ESjXpDwDbWH5SVvR+n6ycu0TK9HHkmvzdS4qmSHGI0o9npmuf+NsdONN3y8dhgt2 geVdZB2hmnX7+0bBlWXEJ4zUOD7BWxl38dGA7k/FLf2+xb5j3NVx01L9MoPdIgrfGDQk 5iJg== 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=9TzWvOIsd72cmqfqE1B58EzmtMdPGePhdwGf/0CIcbY=; fh=bb00IWANzUrbEims5abAG2NrFRW6cV0KBtrUyXvAr8o=; b=l9H4b6Zf206fFUyEOk3RD14X+Bz5Bk7mxITK91wXikf5AxGRwwDCaVEx6cGTGzwuWn CjEzrpa7hUsfZ02P0TMEl9XQKdGnIEj4mnkVm4Cljrokvq/SqBoc9wN64VhZaK/z1m/C MhXvIsXTNPbUjrOmySiXm1LhQuQ/CougaVoSZ2eKcckfr5dr3ZCYgQyEADXFNsRRWodC r9cbqcVjAan9hdxk+RNTg/YiEB/Z3GwXSCdElqh+3o5Bgo9Bee5ZF5tkUV/X4u+rSztS UURWyQ2TyJBiVzqKDrHkcW+YxxB5mDfXiMH3leqvWDQF2iQIVb5n9A3oEyxPK75clwwa kmOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="nJ/puh3Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x5-20020aa79a45000000b006ce46c5f293si2587927pfj.384.2023.12.04.08.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 08:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="nJ/puh3Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 7F1138062405; Mon, 4 Dec 2023 08:08:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234809AbjLDQH7 (ORCPT + 99 others); Mon, 4 Dec 2023 11:07:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234963AbjLDQHy (ORCPT ); Mon, 4 Dec 2023 11:07:54 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA26A9; Mon, 4 Dec 2023 08:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701706082; x=1733242082; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CyMweha2ZvuLisSoPmNJvwBvM8UVF+24ES7V+e13w7A=; b=nJ/puh3YkMMr4ow4roTP8fCrGxx42pg87in85xDgYJvB1y7Fo6YvlfMY OcV83eHYNa08727X6W0hqakN8VMXMRtLmXdt2nI7LeCrUW6QAb8AUTgWY dUMxRDPuRiRtWvAK0sPRpEfT1lB8bTbeKjiAZCTzm+mXPjhgzcZsoFPEw acwteRsmb+IjskBk9M3z5VWGUb/x9BdNELRpdug3hCRR3sX+kvNuI+SQ5 p3cFXC/9gXbmKcKn+T7sNrO2TlCrBKmFYBdZ++VZorXumfPjcLe/3P5hW Sf0X/iMaMIUqE8K+ys4ZQwcTJ6ThA7DLG3r3XjtWseqVaK1KhswL2LkD3 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="632533" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="632533" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 08:08:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="861422786" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="861422786" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2023 08:07:57 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3C299A7D; Mon, 4 Dec 2023 18:00:43 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Geert Uytterhoeven , Claudiu Beznea , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org Cc: Lakshmi Sowjanya D Subject: [PATCH v1 5/5] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Date: Mon, 4 Dec 2023 17:56:36 +0200 Message-ID: <20231204160033.1872569-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231204160033.1872569-1-andriy.shevchenko@linux.intel.com> References: <20231204160033.1872569-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 08:08:12 -0800 (PST) The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro. Utilize them instead of open coded variants in the driver. Reviewed-by: Jonathan Neuschäfer Signed-off-by: Andy Shevchenko --- drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c index 0cff44b07b29..4589900244c7 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c @@ -474,9 +474,8 @@ enum { #undef WPCM450_GRP }; -static struct group_desc wpcm450_groups[] = { -#define WPCM450_GRP(x) { .name = #x, .pins = x ## _pins, \ - .num_pins = ARRAY_SIZE(x ## _pins) } +static struct pingroup wpcm450_groups[] = { +#define WPCM450_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins)) WPCM450_GRPS #undef WPCM450_GRP }; @@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev, const unsigned int **pins, unsigned int *npins) { - *npins = wpcm450_groups[selector].num_pins; + *npins = wpcm450_groups[selector].npins; *pins = wpcm450_groups[selector].pins; return 0; @@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev, struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins, - wpcm450_groups[group].num_pins, function); + wpcm450_groups[group].npins, function); return 0; } -- 2.43.0.rc1.1.gbec44491f096