[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ccbf862-2b3e-4c08-b6bd-d9571e88a675@kernel.org>
Date: Tue, 19 Nov 2024 10:26:07 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Andrei Stefanescu <andrei.stefanescu@....nxp.com>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski
<brgl@...ev.pl>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Chester Lin <chester62515@...il.com>,
Matthias Brugger <mbrugger@...e.com>,
Ghennadi Procopciuc <Ghennadi.Procopciuc@....com>,
Larisa Grigore <larisa.grigore@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Lee Jones <lee@...nel.org>,
Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Dong Aisheng <aisheng.dong@....com>,
Jacky Bai <ping.bai@....com>
Cc: linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
NXP S32 Linux Team <s32@....com>, Christophe Lizzi <clizzi@...hat.com>,
Alberto Ruiz <aruizrui@...hat.com>, Enric Balletbo <eballetb@...hat.com>,
Pengutronix Kernel Team <kernel@...gutronix.de>, imx@...ts.linux.dev
Subject: Re: [PATCH v6 4/7] pinctrl: s32: convert the driver into an mfd cell
On 13/11/2024 11:10, Andrei Stefanescu wrote:
>
> -static inline void s32_pin_set_pull(enum pin_config_param param,
> - unsigned int *mask, unsigned int *config)
> +static void s32_pin_set_pull(enum pin_config_param param,
> + unsigned int *mask, unsigned int *config)
> {
> switch (param) {
> case PIN_CONFIG_BIAS_DISABLE:
> @@ -762,15 +757,15 @@ static int s32_pinctrl_parse_groups(struct device_node *np,
> grp->data.name = np->name;
>
> npins = of_property_count_elems_of_size(np, "pinmux", sizeof(u32));
> - if (npins < 0) {
> - dev_err(dev, "Failed to read 'pinmux' property in node %s.\n",
> - grp->data.name);
> - return -EINVAL;
> - }
> - if (!npins) {
> - dev_err(dev, "The group %s has no pins.\n", grp->data.name);
> - return -EINVAL;
> - }
> + if (npins < 0)
> + return dev_err_probe(dev, -EINVAL,
> + "Failed to read 'pinmux' in node %s\n",
> + grp->data.name);
I do not see how this change is related. Looks you are mixing cleanups
with refactoring into MFD cell. These are two different things.
> +
> + if (!npins)
> + return dev_err_probe(dev, -EINVAL,
> + "The group %s has no pins\n",
> + grp->data.name);
>
> grp->data.npins = npins;
>
> @@ -811,11 +806,9 @@ static int s32_pinctrl_parse_functions(struct device_node *np,
> /* Initialise function */
> func->name = np->name;
> func->ngroups = of_get_child_count(np);
> - if (func->ngroups == 0) {
> - dev_err(info->dev, "no groups defined in %pOF\n", np);
> - return -EINVAL;
> - }
> -
> + if (func->ngroups == 0)
> + return dev_err_probe(info->dev, -EINVAL,
> + "No groups defined in %pOF\n", np);
> groups = devm_kcalloc(info->dev, func->ngroups,
> sizeof(*func->groups), GFP_KERNEL);
> if (!groups)
> @@ -838,57 +831,42 @@ static int s32_pinctrl_parse_functions(struct device_node *np,
> static int s32_pinctrl_probe_dt(struct platform_device *pdev,
> struct s32_pinctrl *ipctl)
> {
> + struct nxp_siul2_mfd *mfd = dev_get_drvdata(pdev->dev.parent);
> struct s32_pinctrl_soc_info *info = ipctl->info;
> - struct device_node *np = pdev->dev.of_node;
> - struct resource *res;
> - struct regmap *map;
> - void __iomem *base;
> - unsigned int mem_regions = info->soc_data->mem_regions;
> + unsigned int mem_regions;
> + struct device_node *np;
> + u32 nfuncs = 0, i = 0, j;
> + u8 regmap_type;
> int ret;
> - u32 nfuncs = 0;
> - u32 i = 0;
>
> + np = pdev->dev.parent->of_node;
> if (!np)
> return -ENODEV;
>
> - if (mem_regions == 0 || mem_regions >= 10000) {
> - dev_err(&pdev->dev, "mem_regions is invalid: %u\n", mem_regions);
> - return -EINVAL;
> - }
> + /* one MSCR and one IMCR region per SIUL2 module */
How is this related to converion into MFD cell?
Still looks like an ABI break.
Best regards,
Krzysztof
Powered by blists - more mailing lists