From nobody Thu Nov 14 05:09:09 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B738C4332F for ; Mon, 11 Dec 2023 19:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344352AbjLKTD1 (ORCPT ); Mon, 11 Dec 2023 14:03:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKTD0 (ORCPT ); Mon, 11 Dec 2023 14:03:26 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82BB19B; Mon, 11 Dec 2023 11:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321412; x=1733857412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LiqBDpyusmg3WhaebVfG+XnzpgrEpQqtzwlk9RFgoFg=; b=KS1SCDrXLSDNGecFAC1F9x87cMCOBC7egCBxlNLJBRfxmg3zKPTCWeHS H3QGAUbjohQxBqi0kGCYPcQW/5Tji9nWgNle1yS06X/YStmW7Pj85PXvx 86gzwKiV6sFYUegrmwTdQL0ulknctQfNW9fNmVCyaqkxjgqTj4OqWzbJG XC/7omnXONUm7KXIfDc8k5CA4jkslghdb5sAqPZsjybrEtP/medEXV8YZ xDBXGIinSuULnyzXR2Wx/v1W8ZpIo3CGvJ/yH31XlKKdLPlJ3DhI5F95D 0VX0ASoxVc1Kdbna80KDmNMZ4hyA5B/VvXJzcOY28A/Qw9ysqRhvnnnN0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692467" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692467" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445046" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445046" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 58B9CE7; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , 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, linux-mips@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 , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 01/13] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC() Date: Mon, 11 Dec 2023 20:57:54 +0200 Message-ID: <20231211190321.307330-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 6380e1fa6509..75f2689c3bad 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -658,10 +658,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctl= dev, const char *name, if (!group) return -ENOMEM; =20 - group->name =3D name; - group->pins =3D pins; - group->num_pins =3D num_pins; - group->data =3D data; + *group =3D PINCTRL_GROUP_DESC(name, pins, num_pins, data); =20 error =3D radix_tree_insert(&pctldev->pin_group_tree, selector, group); if (error) diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 8ef4b536bca5..bf971e6a7846 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -208,6 +208,15 @@ struct group_desc { void *data; }; =20 +/* Convenience macro to define a generic pin group descriptor */ +#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ +(struct group_desc) { \ + .name =3D _name, \ + .pins =3D _pins, \ + .num_pins =3D _num_pins, \ + .data =3D _data, \ +} + int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev); =20 const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, --=20 2.43.0.rc1.1.gbec44491f096