Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4698749rdh; Wed, 29 Nov 2023 08:17:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnIm/KqVP1YkAZTRlvJMh2kyku1WX40HebUcRLEt116VPPLp2KmY3ohPr3b5PTxBymmGI9 X-Received: by 2002:a17:90b:4f43:b0:286:19b9:b7f with SMTP id pj3-20020a17090b4f4300b0028619b90b7fmr2802908pjb.6.1701274623032; Wed, 29 Nov 2023 08:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701274623; cv=none; d=google.com; s=arc-20160816; b=i0Rf1LgGmAMdKj7VemCK7CvPMCqe7YMjIdBxNPnjRmLmIQYVeoHc9gf70mKXGB6YRT n8RzP1U86kBlEmSua+AxzN86FXT2WIt2gFeGLp4mRDYGUKlK4rIoWUg9eHmU9lO52xTy aPp0LnYWGWy8uoRYJSjsSoY30TmacxonA/IqftIuasE4DYalJYTDlLuk9GQgU5ooUDDF 7cUY3DkKFzR4nw2bWInJw5VMi0Rdk9spcj0j6j0fohEwEfPfBC0jyibaseoWcfUPdOzR 6TmbXQCOO6co/4wzDjAvuvOFSabXIk5/1NFa+rLkV3RK7vRLdP3oJRMsonzkoeL1za4M Ly3Q== 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=G4SuAT4Rck58ul2KrFX8E50ZzSsFVKE1RogdcGS21NA=; fh=p5qGgOuQ1qdHRKXQ3E7ZkEX+heMqfz4xi8z6J8C0/aQ=; b=es6nCNODfbFZGJCRQ3U8yEZ726AdD0KbS+1c2nOPUFCj3eN9RGzApq7X6jJutD39CU mxryIM/oPS47hmBHYDuEW/sK9xq0K9eV4/w6tHv599tkrlxWF44ejHCX0wyUYnReK9vs mmkySE4LYni+nsgTMOyRyWxzxzlWoivdm5ojFga95lwCRrOBM7vcc3kNZCWWqYj26EvN 5WrUxR8w/7g15EO80Fb3VgejhedXpwZozTe0XeDvit8S5NDWZYH4Wv+jKgp75k+bGUeS iK7lyP0yhXdq2zVUABFi1t4OAr1UFH0CpUK7LyLFBff1EDOD01eeFNaelbPlr82ragFE qQtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YwNlYr1d; 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 d3-20020a17090ad98300b002850f2ced2csi1548118pjv.113.2023.11.29.08.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:17:03 -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=YwNlYr1d; 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 CB93680B87D9; Wed, 29 Nov 2023 08:16:53 -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 S232038AbjK2QPo (ORCPT + 99 others); Wed, 29 Nov 2023 11:15:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbjK2QPU (ORCPT ); Wed, 29 Nov 2023 11:15:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A90D7D; Wed, 29 Nov 2023 08:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701274526; x=1732810526; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tsj37wyW7nCXgooQSC3UG4Yz4bb4c6+0Qg8IYdX3FB0=; b=YwNlYr1d7zY0MhvEQ1g9TEJ+9W7AjcpRx3RmWhESwBI9rH2ZOfGpsbYU /MzR+UPZurseeKBP2h4j3eTtK1E0bD4niN+x0xF6N1WOVPBLmtQ3fIp1w 2sSH+j4HD9ZfcIO9lw3ipideG3VcTr9XX3Anq1WoJyz+PG6piAT5HrloL ew1y5azTAK198G9XaqgJCEtZY5fO0B2Cc2RpSW6QfE9X8VOX4mSt16J8O GCyGumWZbplDa8e3XHKThBUuAl8Bx0SAwNEwLPCrcZa8H3GWyIm52r1YO dT8mcKhm1v/LqoBfhgitCa2dB3vdhTvg4rrGi2nR4NQYHM6rzduoU6x6y g==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="373372702" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="373372702" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 08:15:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="892498878" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="892498878" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 29 Nov 2023 08:15:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BC9B9AA2; Wed, 29 Nov 2023 18:15:01 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Rasmus Villemoes , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Krzysztof Kozlowski , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Biju Das , Claudiu Beznea , Jianlong Huang , 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 , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Bjorn Andersson , Andy Gross , Konrad Dybcio , Emil Renner Berthing , Hal Feng Subject: [PATCH v4 10/23] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC() Date: Wed, 29 Nov 2023 18:06:33 +0200 Message-ID: <20231129161459.1002323-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231129161459.1002323-1-andriy.shevchenko@linux.intel.com> References: <20231129161459.1002323-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 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]); Wed, 29 Nov 2023 08:16:54 -0800 (PST) Add PINCTRL_GROUP_DESC() macro for inline use. Reviewed-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko --- drivers/pinctrl/core.c | 5 +---- drivers/pinctrl/core.h | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 7040d8cea0c3..1e44682db355 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -658,10 +658,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name, if (!group) return -ENOMEM; - group->name = name; - group->pins = pins; - group->num_pins = num_pins; - group->data = data; + *group = PINCTRL_GROUP_DESC(name, pins, num_pins, data); error = radix_tree_insert(&pctldev->pin_group_tree, selector, group); if (error) diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 75797c0b4fde..4689b24e40f0 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -208,6 +208,15 @@ struct group_desc { void *data; }; +/* Convenience macro to define a generic pin group descriptor */ +#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ +(struct group_desc) { \ + .name = _name, \ + .pins = _pins, \ + .num_pins = _num_pins, \ + .data = _data, \ +} + int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev); const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, -- 2.43.0.rc1.1.gbec44491f096