From nobody Fri Sep 20 01:33:30 2024 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0A9E18508F for ; Thu, 30 May 2024 08:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717059520; cv=none; b=LkGKIHkUfNFIRh54s24YbtX6G8bklPGaVp/VOedKcPzmgiLj32gtxBbIen2znErwWjU1sVDvyF9BZWg9vJtxrRax06P2yzQHW8wrePqi/r8VCHVfmxmZ7UkEvwrE44QZCkCti/p+uFM9IHCdxExhfNz5umFIL4yYt2DGfoAxoc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717059520; c=relaxed/simple; bh=/LiSEQG+njMYAteIWAP1DID2MkGU7RNK5JsYIWD5POA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cV/C9dUNFaC2alJvPK2BLsgLkvcf3l/yduIUS6D4Pln7pO3+So6HcR/1iNWnjf9NyligRKt9OUPxc8rdgYJouV1G3biKpAlNHS1umS2g2iRtHHakiFBM6/GOJMyKf2OI1+/ZYh5c5TDaV5hRPp5qj3b+4PeiAcOe+GFkJf3Lnmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id cc94fb57-1e62-11ef-8e2e-005056bdf889; Thu, 30 May 2024 11:58:36 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , AngeloGioacchino Del Regno , 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 , Paul Cercueil , Lakshmi Sowjanya D , Andy Shevchenko Subject: [PATCH v3 09/11] pinctrl: keembay: Convert to use func member Date: Thu, 30 May 2024 11:55:18 +0300 Message-ID: <20240530085745.1539925-10-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530085745.1539925-1-andy.shevchenko@gmail.com> References: <20240530085745.1539925-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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-ke= embay.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_pinct= rl *kpc, unsigned int grp_idx =3D 0; int j; =20 - group_names =3D devm_kcalloc(kpc->dev, func->num_group_names, + group_names =3D 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_pin= ctrl *kpc, struct keembay_mux_desc *mux; =20 for (mux =3D pdesc->drv_data; mux->name; mux++) { - if (!strcmp(mux->name, func->name)) + if (!strcmp(mux->name, func->func.name)) group_names[grp_idx++] =3D pdesc->name; } } =20 - func->group_names =3D group_names; + func->func.groups =3D group_names; } =20 /* Add all functions */ for (i =3D 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); } =20 @@ -1619,17 +1619,17 @@ static int keembay_build_functions(struct keembay_p= inctrl *kpc) struct function_desc *fdesc; =20 /* Check if we already have function for this mux */ - for (fdesc =3D keembay_funcs; fdesc->name; fdesc++) { - if (!strcmp(mux->name, fdesc->name)) { - fdesc->num_group_names++; + for (fdesc =3D keembay_funcs; fdesc->func.name; fdesc++) { + if (!strcmp(mux->name, fdesc->func.name)) { + fdesc->func.ngroups++; break; } } =20 /* Setup new function for this mux we didn't see before */ if (!fdesc->name) { - fdesc->name =3D mux->name; - fdesc->num_group_names =3D 1; + fdesc->func.name =3D mux->name; + fdesc->func.ngroups =3D 1; fdesc->data =3D &mux->mode; kpc->nfuncs++; } --=20 2.45.1