Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp565688rdh; Thu, 23 Nov 2023 11:35:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IF05dxomkgB3PNdOzorx26nZxTp4ogX89eyWoBpZNyVq0BWZdra2YXDZfBECqc+LDutnCMm X-Received: by 2002:a17:903:234c:b0:1cf:7e0b:e808 with SMTP id c12-20020a170903234c00b001cf7e0be808mr420035plh.53.1700768125442; Thu, 23 Nov 2023 11:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700768125; cv=none; d=google.com; s=arc-20160816; b=S6psHEm41pWxGesmQFfVsugRBnZqNqg+ggnqKrvnI2SfixtIsjsnvzBdnBuuHmL8VB NDt5yFhymEO0Wq8xr1eC7H7bZQiPt2r5RKfFsEfrKYtrEBBsB9eeITaG5byd8MfeDBWu hVGHDhdzws6f4JgTyN5UvfUvagRkelN5ebRm3meIbTTlbI3gsIM7VftMspKKZFqYjWcJ glCxdUyfM6pSzO1CB308hV9aBc/VB5H/8SL+ARHLL4ICXaVNpe9kFlHKE4i/gjjz3hSZ zzoivblEHtjGyF1LaNnl46fNXyW+Ar4zGUkMZPvcDOHNNO8xFH0bFLOIt2NL3IwlDZ8h jroQ== 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=fwTzVujtnIwL6WGX4xLEAiyORsnd+eY24pOXivSpIt4=; fh=o6/j60XBkz0cs1N8PQkcSMZ4tgCM5mUF5G/ULMywbv8=; b=moYB1hhvXl9hOOxMHo6aYGTOWplPNL4BCB2waHm7k0yK5YEPh6RqfeO6IWVkHwIFTf GHTefqymrBQJPGsCcbvWpRmWF/Fct/t+9kf2UiEAieHDxu1igEAacUQUUn3GJDBy24Ub hX9jMg/xBhY0gQC+nT4P3cHxpW1kLZXydIyqr4Lv3eO5Fzy6/9fOKNbZpsNWjTtQK8RB V5Qaa00M/OaT8B9YdfCpToUvSV9l953N6Pc6HPQCpXD3DhnxseecMtdeO85rX9hNq18k zHDTSoxoNz4V5PEllPT6HVa2Dd4mH6fC9i+kIbtfjTj0bk9tkCdfTruPdepwmnrI7M6k znVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ONhcjsi5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id e13-20020a17090301cd00b001c7249f5e40si1752523plh.469.2023.11.23.11.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 11:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ONhcjsi5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id BD9828362D88; Thu, 23 Nov 2023 11:35:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbjKWTew (ORCPT + 99 others); Thu, 23 Nov 2023 14:34:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjKWTeU (ORCPT ); Thu, 23 Nov 2023 14:34:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E2AF10F8; Thu, 23 Nov 2023 11:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700768060; x=1732304060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AdFjMuClohqBUYL/nDsewEobDAXp1hIEsDTJLpD8JyY=; b=ONhcjsi56p7zR7Yvz4Kp/vdtP8XAMrNpJKPO3p688uG8wfbt8MwxfOgu OwI6zZKWXx5dBw4J2/dCEWA51XM15r8+xA4BuSjZkO6QP2BjfsfEy3I13 5wW0FHt/eSzV8d+pdPVbVIB6o8RFGe6Yxt7m10TDNGhXXNPuxBkwzyvM2 RSF8wUC2ke8ruf2obRbq5b/tpdBVlinQRP7Nurcqls7FRk7Ogbb2wpO7/ LoHEVBxccKdHdtZFk4zZpV59KKSXedkV7loaoPgVs2FaeuWZVfZq1x7pw pZEY0V96djOgvNWVF0DYzv1fWAyJygtEx8Pn8G41qSFnr06ACv6bndpMn A==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="372482191" X-IronPort-AV: E=Sophos;i="6.04,222,1695711600"; d="scan'208";a="372482191" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 11:34:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833506170" X-IronPort-AV: E=Sophos;i="6.04,222,1695711600"; d="scan'208";a="833506170" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 23 Nov 2023 11:34:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0F0B9592; Thu, 23 Nov 2023 21:33:59 +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 , Andy Gross , Bjorn Andersson , Konrad Dybcio , Emil Renner Berthing , Hal Feng Subject: [PATCH v2 09/21] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC() Date: Thu, 23 Nov 2023 21:31:37 +0200 Message-ID: <20231123193355.3400852-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231123193355.3400852-1-andriy.shevchenko@linux.intel.com> References: <20231123193355.3400852-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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 11:35:19 -0800 (PST) Add PINCTRL_GROUP_DESC() macro for inline use. 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 d20e3aad923e..3f1fd50fbb10 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -660,10 +660,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 01ea1ce99fe8..276a631fd49c 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