[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01c0ce6be637669ed07cfaf0aa6ef27fed7b8b16.camel@foss.st.com>
Date: Thu, 2 Jan 2025 12:15:15 +0100
From: Antonio Borneo <antonio.borneo@...s.st.com>
To: Marek Vasut <marex@...x.de>, Mingwei Zheng <zmw12306@...il.com>
CC: <linus.walleij@...aro.org>, <mcoquelin.stm32@...il.com>,
<alexandre.torgue@...s.st.com>, <make24@...as.ac.cn>,
<peng.fan@....com>, <fabien.dessenne@...s.st.com>,
<linux-gpio@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
Jiasheng Jiang <jiashengjiangcool@...il.com>
Subject: Re: [PATCH v5] pinctrl: stm32: Add check for clk_enable()
On Mon, 2024-12-16 at 00:41 +0100, Marek Vasut wrote:
> On 12/15/24 9:40 PM, Mingwei Zheng wrote:
>
> [...]
>
> > @@ -1617,10 +1602,18 @@ int stm32_pctl_probe(struct platform_device *pdev)
> > return -EINVAL;
> > }
> > pctl->banks = devm_kcalloc(dev, banks, sizeof(*pctl->banks),
> > - GFP_KERNEL);
> > + GFP_KERNEL);
>
> Please drop this one change.
>
> > if (!pctl->banks)
> > return -ENOMEM;
> >
> > + pctl->clks = devm_kcalloc(dev, banks, sizeof(*pctl->clks),
> > + GFP_KERNEL);
> > + if (!pctl->clks)
> > + return -ENOMEM;
> > +
> > + for (i = 0; i < banks; ++i)
> > + pctl->clks[i].id = "";
>
> Is this ^ assignment necessary ? If so, why ?
The existing DTs don't have the 'clock-names' property, whose value is used to set this struct clk_bulk_data::id.
With this field kept at NULL, the error messages in clk_bulk_enable() and similar should print '(null)'.
This line sets it to empty string.
I would say it's not necessary, but I don't know if it's better to have:
"Failed to enable clk '': %d"
or
"Failed to enable clk '(null)': %d"
Antonio
Powered by blists - more mailing lists