From nobody Thu Nov 14 05:02:33 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 767C0C4167D for ; Mon, 11 Dec 2023 19:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344672AbjLKTDp (ORCPT ); Mon, 11 Dec 2023 14:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344353AbjLKTDl (ORCPT ); Mon, 11 Dec 2023 14:03:41 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCBC3D6; Mon, 11 Dec 2023 11:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321420; x=1733857420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jBgMUxoaE0sg0WlUT7okBsBkokT5icXyzOHzcQhn8e4=; b=KBzL0mJuoHnNHSoi0QVeGbRry3vfsHxQgI2Ap50f62hnzDQs3CjgzMRS 4BbI2xpn8MV0IxJLjLVlL5TLM13Zq5raqEPEeRXKVcUhxnJseHnhJXtEd wkPL4zssAO9CNhMBft/kdUG9XsaM42UVCMk/s3M7ErJqNfyfI2t4axH6v WHJM5WDpW7gQtV2xPq4/m1bV9OplbZ20LOmLM7u5ywj+JM7AELtEh042H sF6JYj/5zGBfOcbl/HXJuEV/MCkC1LcFokszHjULKIcE9mYtOl2ndjHpU udxFA+O/hFoWtNgzPr6PRfErj1juImI1wVD7NOBeXQEupJlwRZzIuKKQj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692535" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692535" 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:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445103" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445103" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id ADD346A6; 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 07/13] pinctrl: imx: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:00 +0200 Message-ID: <20231211190321.307330-8-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" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/freescale/pinctrl-imx.c | 31 +++++++++++-------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 28164b04b1be..2d3d80921c0d 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -42,7 +42,7 @@ static inline const struct group_desc *imx_pinctrl_find_g= roup_by_name( =20 for (i =3D 0; i < pctldev->num_groups; i++) { grp =3D pinctrl_generic_get_group(pctldev, i); - if (grp && !strcmp(grp->name, name)) + if (grp && !strcmp(grp->grp.name, name)) break; } =20 @@ -79,9 +79,9 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, } =20 if (info->flags & IMX_USE_SCU) { - map_num +=3D grp->num_pins; + map_num +=3D grp->grp.npins; } else { - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; if (!(pin->conf.mmio.config & IMX_NO_PAD_CTL)) map_num++; @@ -109,7 +109,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctld= ev, =20 /* create config map */ new_map++; - for (i =3D j =3D 0; i < grp->num_pins; i++) { + for (i =3D j =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; =20 /* @@ -263,10 +263,10 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, u= nsigned selector, if (!func) return -EINVAL; =20 - npins =3D grp->num_pins; + npins =3D grp->grp.npins; =20 dev_dbg(ipctl->dev, "enable function %s group %s\n", - func->name, grp->name); + func->name, grp->grp.name); =20 for (i =3D 0; i < npins; i++) { /* @@ -423,7 +423,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_d= ev *pctldev, if (!grp) return; =20 - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { struct imx_pin *pin =3D &((struct imx_pin *)(grp->data))[i]; =20 name =3D pin_get_name(pctldev, pin->pin); @@ -526,7 +526,7 @@ static int imx_pinctrl_parse_groups(struct device_node = *np, pin_size =3D FSL_PIN_SIZE; =20 /* Initialise group */ - grp->name =3D np->name; + grp->grp.name =3D np->name; =20 /* * the binding format is fsl,pins =3D , @@ -554,19 +554,17 @@ static int imx_pinctrl_parse_groups(struct device_nod= e *np, return -EINVAL; } =20 - grp->num_pins =3D size / pin_size; - grp->data =3D devm_kcalloc(ipctl->dev, - grp->num_pins, sizeof(struct imx_pin), - GFP_KERNEL); + grp->grp.npins =3D size / pin_size; + grp->data =3D devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pin), GFP_= KERNEL); if (!grp->data) return -ENOMEM; =20 - pins =3D devm_kcalloc(ipctl->dev, grp->num_pins, sizeof(*pins), GFP_KERNE= L); + pins =3D devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pins), GFP_KERN= EL); if (!pins) return -ENOMEM; - grp->pins =3D pins; + grp->grp.pins =3D pins; =20 - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; if (info->flags & IMX_USE_SCU) info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list); @@ -613,8 +611,7 @@ static int imx_pinctrl_parse_functions(struct device_no= de *np, =20 i =3D 0; for_each_child_of_node(np, child) { - grp =3D devm_kzalloc(ipctl->dev, sizeof(struct group_desc), - GFP_KERNEL); + grp =3D devm_kzalloc(ipctl->dev, sizeof(*grp), GFP_KERNEL); if (!grp) { of_node_put(child); return -ENOMEM; --=20 2.43.0.rc1.1.gbec44491f096