Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2284223lqb; Mon, 27 May 2024 14:30:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVea49BFvPMuYJht22CpCNXnglSbMONIxkoP9NFiY6y1u+ahJwZ/E5874Kb0o8esPZ+TYhMOs5mEpBga9nPNRKNxmhgXouuSIInipNvmg== X-Google-Smtp-Source: AGHT+IHCDINcS4uEmDTdgpgcEGmS0sHfqwcXWEj/HueTdqh+ESJtrUYz6mmff6aPGfJwwx73Jfit X-Received: by 2002:a17:906:c4c6:b0:a59:c28a:7ec2 with SMTP id a640c23a62f3a-a62646ce06amr650340766b.41.1716845402052; Mon, 27 May 2024 14:30:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716845402; cv=pass; d=google.com; s=arc-20160816; b=Y8R+Hr1PWDoEKS4ynB/R/wCpSLFbEP5+TvhpzSagfDl08h9moXUNpbSRU2jP8cq9ID X9Cc5gG5yASyoJ8iLEgohAm5XC/dvDPhuMh6w9Ap0d+bY0p4QBJvkwcB25Mu/C71JL56 fNaipiCXIV3eZPsP9MucmJy/kmhCWc3utZXeUW7iRPOvp9U7V/OooWs1J74gSOfVL2Qe G0pN/5NpO34T+q9ca9F5XBNK3dbIv/4MdzK8G2gRcGpQv3i/ly8/syTkptxKClO66qVX p6fXFGopzGruThexDz+9HYWbRb0QPvdpm+c+YMo1XBfk8aay2x0/cYO8DMQuWNJBaoyH W2BQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RY+WVFLqdM7a+qcWgzDS/sUrunQ9bLGJdi2eK9+Oz8E=; fh=z7aMt8lpfvYPczt5cwX+na7WMHaLGVG5OdTmQLvj1BI=; b=jSW9Ukb92sDSH823XxsIgMg+mX4KAae/cLnwqy/FLC8TohdK0r16QOcTci09nBTY8n DHb5Dq09VsYg/uPZ3cr/n6cHim30D3JzuHFvMGBbDPWm4teXCjMYby3ypAO15V0VZYPU 7E0q0gqNDTiW0E62vz+n/gj7ejQSEzexTFeW7ARWlLrjxD3WIsZpPKRR6preBd/oLu9O N65+wpMfi2m4Gg+MesO2SA0hvcmFg9GWwd2az5Q1Cjmpzi1WzzJzplNhA2yxAmA8gzeu /4uddkpkJE+XM2iWZ5tKQLzsGvjEOClJeLKlvJYRi7+bVYs8Yk7Hiz6DwEvf36m8FzDX K7OA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-191461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c7feb44si416692566b.103.2024.05.27.14.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-191461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C600E1F22EFA for ; Mon, 27 May 2024 21:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EFE016ABE7; Mon, 27 May 2024 21:28:05 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (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 EE584169AF9 for ; Mon, 27 May 2024 21:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716845284; cv=none; b=XqJx5tYAWt/JSqobMP7F4aRYK3FbPM3f5kiPRWultkL8vuMrQmrDP0haBilvfKhUn8tQPD+qWRxyvsM42QdKXuMsHCf+kH7U12IgAADwqJsGwIrS4My8CzsBqsntSCpK3zd8NDH2yxsiviGLlZgOghifAAe2AbSRHpDuUWsu1gM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716845284; c=relaxed/simple; bh=/LiSEQG+njMYAteIWAP1DID2MkGU7RNK5JsYIWD5POA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Smih+ei2MyTm8DkDPNzX8YE0vCUBXhn/4wSunDkNsuzl3fDcAH9aHAOP6orKBC23arHzEcVUbibaOh6RemdYoa8+nm0YnSpWmn6cZZ4BgXSX9zhVeyWoP3QlaqCoVSVLe/jubZ1zM012Q7enm0Aa5aUPqoVG9ZAUd2jtd1112gM= 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.83 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 fgw20.mail.saunalahti.fi (Halon) with ESMTP id fc2e02ae-1c6f-11ef-8d39-005056bd6ce9; Tue, 28 May 2024 00:27:56 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , 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 v1 09/11] pinctrl: keembay: Convert to use func member Date: Tue, 28 May 2024 00:24:44 +0300 Message-ID: <20240527212742.1432960-10-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240527212742.1432960-1-andy.shevchenko@gmail.com> References: <20240527212742.1432960-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: 8bit 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++; } -- 2.45.1