Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2479826rdb; Mon, 20 Nov 2023 11:59:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVJls0+S75RryhT0Mrs8vGL8jptDVLHIHDekSG1cOnpfQkQVx9m0QFt4HZhzfR03/Dixle X-Received: by 2002:a17:902:e84b:b0:1cf:56bf:8dd5 with SMTP id t11-20020a170902e84b00b001cf56bf8dd5mr6384107plg.51.1700510353958; Mon, 20 Nov 2023 11:59:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700510353; cv=none; d=google.com; s=arc-20160816; b=VZ8i702Dw1yRh1DHRqJGFuFZ8kNTnmRdTEa47R0QWshSJvWhTovnLIzstCakzrgT3Z Pg3EwVWhlfKmpd0QWf+Igj1tYahEiJJDDMUyKnJc7ZK5TfksMkMaY93JrbTxdoXIs4ni CZ/R/N3ilK5haFH+prakdTry8ovU+XYmI9T8Q1XeuinN6ChSsFOen5mn9eD9AJSjO0DK K1X0SG2jCbuVnXWJDTrO8dR6tOt1XwkLVyqC5MczS5vlzP1wivR0IjQ1yHV/Au2H0e+b dIbhtULBDAIvpe4hJVHvbOYTv44yFtT/bgoJ2Y6HHApW7dVICcWVr5PBg/29AzCLRY9m QY1w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=hke+jSlOJep6/7nf2WslJRJCvE9zaDz07wN6HCzQ+KE=; fh=kMnU3hYzi/ij2NEuDkX9/GnQniADX7nMl39oMCZ0xqE=; b=PR2DV64NulDefxnsVH+vR6M/klYP/Yegq5u/y7HqQGqWK1h52ctBridOlA6Cxa2LRl 3aSts3v6jWXQ/xncGQIAuda+R9phn9kinBdlhrnRcMc/2nCvs1rPlsm+Bb+gCbuwaVMT r13ZxIE3h1Wc2pHKqzHQNQf5VCSt6oyfVjWRmhh8tL8mCONi0lWvmidewR7IGhNy0eSR +7UJL0K+MR2Yl5Vn2J85JYSTQPdt4HDb1pONLgNJpb4X7xh89CnPg3+zpTJ2vQqruHg0 Tc+UPtPaR1MSgVNk4xo8GTRdPoeb7T3KbkzNDHVaAHZp/YWZqeHN/RaESYQIblk7Ga9Z h1Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EUDN8S+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bc1-20020a170902930100b001ce16902d39si8192355plb.449.2023.11.20.11.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 11:59:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EUDN8S+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 1A84580A30E2; Mon, 20 Nov 2023 11:57:52 -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 S229558AbjKTT5B (ORCPT + 99 others); Mon, 20 Nov 2023 14:57:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbjKTT43 (ORCPT ); Mon, 20 Nov 2023 14:56:29 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACC39AA; Mon, 20 Nov 2023 11:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700510185; x=1732046185; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zb7vywnY5jyenAxj9sbtLt+bBMaQnCZHqRqsqRdZ/10=; b=EUDN8S+caPxE19UesPiGzk6D3eROcb+BsscwTMzynqbDsarMWljf3mZH 2KahXLKtGWhw4JSuvJoGY1KZOSbgeYqmNg1g5uOm5W3sGEInSkjwsw7xZ i6Xtty00VFnLFrtVabqqcDYPtp81yvKFJmlYkLXKiwYBfKHiyOXUiVrQ3 g5Y/TQ27YDWwM8MEvBvj+0i6BbMqwdm8Ab5vZu9P0dldtVzsVlnDkefFL Y1/E/fgDDrM+wHSLiSpL8LfgTxwmCuu/0wdC603qSHeBuxHha4QVcsvb2 ydtmnFBd/cuOSkJR2bk7giRKXKYXq5+2qLRptSiGi/B8VV5F+/xmQJyrW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="395622098" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="395622098" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 11:56:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="801298590" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="801298590" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2023 11:56:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 184E813A; Mon, 20 Nov 2023 21:48:05 +0200 (EET) From: Andy Shevchenko To: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Linus Walleij , Andy Shevchenko Subject: [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Date: Mon, 20 Nov 2023 21:48:02 +0200 Message-ID: <20231120194802.1675239-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: 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]); Mon, 20 Nov 2023 11:57:52 -0800 (PST) The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro. Utilize them instead of open coded variants in the driver. 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