Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp223707lqp; Tue, 11 Jun 2024 02:32:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCViAyu8j5RDb2nCH9srL/Pk2npDdt7a6yUQIEm3aBecLxp3VfHdwhRF7kDaRst0p+xH6ZahPFUQ5hUHr306w6f9GKEDhGas9IvqDjHUNg== X-Google-Smtp-Source: AGHT+IEclVCSo8mi33vOCcMrXo4MYXBKu9WoZUy+W5ZN59xpLUqC7pDeiPujROkCgXUksPMkPvvQ X-Received: by 2002:a05:6214:311e:b0:6b0:90d8:b6a3 with SMTP id 6a1803df08f44-6b090d8ba30mr2172396d6.41.1718098333131; Tue, 11 Jun 2024 02:32:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718098333; cv=pass; d=google.com; s=arc-20160816; b=alrJ2l3+kubh7baZzarGo2O0dDeHE12PvteQqaGAFKTvSum3RNVAzCYafPm4xrwIE6 WWbQH+rXl81THfEPWr35fERy40NnmrAfI/IES6LdW5YzZFQJyLiagOddt6zZ8OlEcy43 6DKfwmG64uvnIo/3x/pUsm+Ag7t82Df4eLZzuBEo+wBptGBSiJmyqkxUX1pPSXA8bhbK JUWWHZYFbCa+7OMwxuIvetsKy3OlpVoWW/805BmJ1uQ5ozucd2hwi6Y/GLeNTTjEucES kc2h+9yGTLbiLURxvDZUM1f/0XYtLc61GGpDOPwJbjdbSASSJtfuGllApvm/uoYtL+ic /aow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Jcq5FqfyHAX2jhKRK8fFe2CdxLw6ORkJwOlpuvfrmLU=; fh=oRRS8UhzlUUGDnPKKwcnvZ19LvyDOdM2p+E7Bn4ufTA=; b=P5Q6T8RbKLFRlRqMvVPGcLvW+YcrYLoDS8WiJhSiH6XwsqMCGLYtULUJrtcHmIvbZw 5vrtEPwk1IRVns1Ab4TkrLa7LQD8zGuYQAXLnLtgVWWv7VkPjsk4rHQhmBg6JwNeVYHm U7dY5msYF1kF6FKBBlxuEoWhUWju7+Y+H2A4hqZ59o0XMtGDNiDoiQT5WuHT0nxaV0Oq QClS4iqWvrB4MA8d/I+GyOWp0FJIVgsb9d3/FeTwh4wXWRbBmTrBrlAVPIR9kr14OFs7 pPd/X4zQp1Z64Z5Uuxsyi4lMVR6AUGokaaL4SB7gUGl7j2Cb/Cq3zgm3l+12Qx+CvhjA OoAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-209572-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b0873a8d33si24991906d6.332.2024.06.11.02.32.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209572-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-209572-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 146771C233C4 for ; Tue, 11 Jun 2024 09:32:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA0DF179204; Tue, 11 Jun 2024 09:31:37 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBA43176AAE for ; Tue, 11 Jun 2024 09:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718098297; cv=none; b=EkQeokSNZw0nAfulic8+MW10tHxSa+IYGf+toWFAx0u6lHP9tcGNrij+dPKAiu/JAnzL69zv4LPpxq4zAA8OGRU/I445+y2UuU/psVDuDbFMJloptuSvne3era6lXnunGQltdDf3CLHQE0Il5VumdjzhzjaTN0iOzvSm6aH0nME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718098297; c=relaxed/simple; bh=//KiX0A3+2T6SNbx64RCCt5vplrvtiOsRUETqQE7Uw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f8ZzihNeK6wVHE694wDDPphZCAeOMKw3VLqzJ9NnaTc0Y/pzUHhrRrp6uoEgmHkTbhARIlVg0DvCs5rKlAS2smHgslU80KcWam5a/3uU/erSiIAqxKmiexSBNlyKz4PPaCovwVAsPSBrtFYup0bdz8y5eBEswNgLsd39Z/lUPlM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-87.elisa-laajakaista.fi [88.113.25.87]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 63bf090d-27d5-11ef-8d69-005056bd6ce9; Tue, 11 Jun 2024 12:31:33 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jacky Huang , Linus Walleij , Tomer Maimon , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Cc: Shan-Chun Hung , Avi Fishman , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Andy Shevchenko Subject: [PATCH v1 1/4] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Date: Tue, 11 Jun 2024 12:30:22 +0300 Message-ID: <20240611093127.90210-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240611093127.90210-1-andy.shevchenko@gmail.com> References: <20240611093127.90210-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andy Shevchenko 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-npcm7xx.c | 16 ++-------------- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c index 62a46d824b46..2601aacfb976 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c @@ -504,17 +504,6 @@ static const int lkgpo2_pins[] = { 9 }; static const int nprd_smi_pins[] = { 190 }; -/* - * pin: name, number - * group: name, npins, pins - * function: name, ngroups, groups - */ -struct npcm7xx_group { - const char *name; - const unsigned int *pins; - int npins; -}; - #define NPCM7XX_GRPS \ NPCM7XX_GRP(smb0), \ NPCM7XX_GRP(smb0b), \ @@ -642,9 +631,8 @@ enum { #undef NPCM7XX_GRP }; -static struct npcm7xx_group npcm7xx_groups[] = { -#define NPCM7XX_GRP(x) { .name = #x, .pins = x ## _pins, \ - .npins = ARRAY_SIZE(x ## _pins) } +static struct pingroup npcm7xx_groups[] = { +#define NPCM7XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins)) NPCM7XX_GRPS #undef NPCM7XX_GRP }; diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c index a377d36b0eb0..9834a13cf5c9 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -588,17 +588,6 @@ static const int hgpio5_pins[] = { 25 }; static const int hgpio6_pins[] = { 59 }; static const int hgpio7_pins[] = { 60 }; -/* - * pin: name, number - * group: name, npins, pins - * function: name, ngroups, groups - */ -struct npcm8xx_pingroup { - const char *name; - const unsigned int *pins; - int npins; -}; - #define NPCM8XX_GRPS \ NPCM8XX_GRP(gpi36), \ NPCM8XX_GRP(gpi35), \ @@ -832,9 +821,8 @@ enum { #undef NPCM8XX_GRP }; -static struct npcm8xx_pingroup npcm8xx_pingroups[] = { -#define NPCM8XX_GRP(x) { .name = #x, .pins = x ## _pins, \ - .npins = ARRAY_SIZE(x ## _pins) } +static struct pingroup npcm8xx_pingroups[] = { +#define NPCM8XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins)) NPCM8XX_GRPS #undef NPCM8XX_GRP }; -- 2.45.2