From patchwork Tue May 28 19:44:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13677310 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDE7CC25B7E for ; Tue, 28 May 2024 19:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k5YoBN47w5IsZg0BgdqxDWyBmssOg1ao0QpWC3Q6PYw=; b=uSE8tPFTpS0rI0IKnSVz1az3S7 u7oDEvbQS3d5hMNg6fcopfF6jmZ5kNi/wlBfTIARxCsQiZ60LqBqzhiMPU3jFDoFYJZ8IV7RZpCwx nLE1jAdYa+eiERd8hWLrfaPPHnjcp3k6/Dz4eK3ADQzML028DS0Rc7Aa/z+NXVT8Vq/edPI2JLtnl nJEjV0fa5t0c9jmq8Fsn6m5ONFqp7tc82/6JOMlxOOLhD07TQDr4dwn+bwRNvOsBOzlez6QnPdYSQ NLdeSu1Dp0g9j85IjAMvKo6sCQwer3UinJTa6EyAVjMRj3dbNMDEJ5UOExJMm19RaYnW7nuRmhJpr Bq9tDjig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sC2qa-00000001t7J-0ePY; Tue, 28 May 2024 19:51:00 +0000 Received: from fgw23-7.mail.saunalahti.fi ([62.142.5.84]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sC2pj-00000001sXu-3kLw for linux-mediatek@lists.infradead.org; Tue, 28 May 2024 19:50:10 +0000 Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 798dced9-1d2b-11ef-aaf5-005056bdd08f; Tue, 28 May 2024 22:50:03 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , Daniel Golle , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org Cc: Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Lakshmi Sowjanya D , Andy Shevchenko Subject: [PATCH v2 07/11] pinctrl: imx: Convert to use func member Date: Tue, 28 May 2024 22:44:58 +0300 Message-ID: <20240528194951.1489887-8-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528194951.1489887-1-andy.shevchenko@gmail.com> References: <20240528194951.1489887-1-andy.shevchenko@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240528_125008_190203_1AB7E112 X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Convert drivers to use func member embedded in struct function_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin function description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/freescale/pinctrl-imx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 2d3d80921c0d..44921e3bdb94 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, npins = grp->grp.npins; dev_dbg(ipctl->dev, "enable function %s group %s\n", - func->name, grp->grp.name); + func->func.name, grp->grp.name); for (i = 0; i < npins; i++) { /* @@ -593,21 +593,21 @@ static int imx_pinctrl_parse_functions(struct device_node *np, return -EINVAL; /* Initialise function */ - func->name = np->name; - func->num_group_names = of_get_child_count(np); - if (func->num_group_names == 0) { + func->func.name = np->name; + func->func.ngroups = of_get_child_count(np); + if (func->func.ngroups == 0) { dev_info(ipctl->dev, "no groups defined in %pOF\n", np); return -EINVAL; } - group_names = devm_kcalloc(ipctl->dev, func->num_group_names, - sizeof(char *), GFP_KERNEL); + group_names = devm_kcalloc(ipctl->dev, func->ngroups, sizeof(*func->func.groups), + GFP_KERNEL); if (!group_names) return -ENOMEM; i = 0; for_each_child_of_node(np, child) group_names[i++] = child->name; - func->group_names = group_names; + func->func.groups = group_names; i = 0; for_each_child_of_node(np, child) {