From patchwork Tue May 28 19:45:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13677331 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 D0A87C25B7C for ; Tue, 28 May 2024 19:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DZaRe3leBpfRz43lZtFbGrSNweU+rVhGdkHoQddMZV0=; b=Qjk+4YyoI8VbHr UoQJiBA8rryvXGUTP/m9kG+JXbaifrG9/ZP7eJNvSi+5Kf32mqC3R760wkY9xy1KT0SDf6QD1OzZE THdiXYgQ71fgHgD0h4I13SLPoETBeuqFX76wIbWfgeZMdYO59Bzz36ZKV80BYH3ttsz6OiGMkEYRH TvtLbEeG+T1ioeNWdKaxvUpKNPUNn/7OQKE8fPPTjMKtXizDyCIGCzE0KK1mqYanIiGhsjrBe0WW6 UnVDl6ioWmdGjmQJ2w/HfbKSmHIXJXMBJIRz4pa/qiqjHmkirZP6o0UDbQg1WzvV9c9hz+Yu3klmH iCBQEhlhCyP7ayFNzA3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sC2qe-00000001tB7-3v1F; Tue, 28 May 2024 19:51:04 +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-00000001sYf-3mDY for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2024 19:50:11 +0000 Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 7a993cff-1d2b-11ef-8d3a-005056bd6ce9; Tue, 28 May 2024 22:50:05 +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 09/11] pinctrl: keembay: Convert to use func member Date: Tue, 28 May 2024 22:45:00 +0300 Message-ID: <20240528194951.1489887-10-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_234430_0C0A8644 X-CRM114-Status: GOOD ( 15.69 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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/pinctrl-keembay.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c index b1349ee22799..245a74ed97ee 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -1566,7 +1566,7 @@ static int keembay_add_functions(struct keembay_pinctrl *kpc, unsigned int grp_idx = 0; int j; - group_names = devm_kcalloc(kpc->dev, func->num_group_names, + group_names = devm_kcalloc(kpc->dev, func->func.ngroups, sizeof(*group_names), GFP_KERNEL); if (!group_names) return -ENOMEM; @@ -1576,20 +1576,20 @@ static int keembay_add_functions(struct keembay_pinctrl *kpc, struct keembay_mux_desc *mux; for (mux = pdesc->drv_data; mux->name; mux++) { - if (!strcmp(mux->name, func->name)) + if (!strcmp(mux->name, func->func.name)) group_names[grp_idx++] = pdesc->name; } } - func->group_names = group_names; + func->func.groups = group_names; } /* Add all functions */ for (i = 0; i < kpc->nfuncs; i++) { pinmux_generic_add_function(kpc->pctrl, - functions[i].name, - functions[i].group_names, - functions[i].num_group_names, + functions[i].func.name, + functions[i].func.groups, + functions[i].func.ngroups, functions[i].data); } @@ -1619,17 +1619,17 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc) struct function_desc *fdesc; /* Check if we already have function for this mux */ - for (fdesc = keembay_funcs; fdesc->name; fdesc++) { - if (!strcmp(mux->name, fdesc->name)) { - fdesc->num_group_names++; + for (fdesc = keembay_funcs; fdesc->func.name; fdesc++) { + if (!strcmp(mux->name, fdesc->func.name)) { + fdesc->func.ngroups++; break; } } /* Setup new function for this mux we didn't see before */ if (!fdesc->name) { - fdesc->name = mux->name; - fdesc->num_group_names = 1; + fdesc->func.name = mux->name; + fdesc->func.ngroups = 1; fdesc->data = &mux->mode; kpc->nfuncs++; }