Re: [PATCH v2 2/3] phy: renesas: Add Renesas Multi-Protocol PHY driver for R-Car X5H
From: Geert Uytterhoeven
Date: Tue Dec 01 2026 - 03:04:02 EST
Hi Marek,
On Tue, Dec 1, 2026, at 00:01, Marek Vasut wrote:
> On 11/30/26 5:42 PM, Geert Uytterhoeven wrote:
>>> +static void mp_phy_init_pcie4_ch_req(struct mp_phy_priv *priv, const int chs, const int chd,
>>
>> unsigned int first, unsigned int last
>>
>>> + const u32 cntxt2, const u32 txreq)
>>
>> No need for all the consts
>>
>>> +{
>>> + int ch;
>>> +
>>> + for (ch = chs; ch <= chd; ch++) {
>>
>> unsigned int ch = ...
>>
>> Or perhaps drop ch and just increase first?
>
> Can you please clarify this "Or perhaps ..." part ?
With the const on chs (== first) dropped, you don't need a separate
loop counter but can just do
for (; first < last; first++) { ... }
>>> +static int mp_phy_init(struct phy *phy)
>>> +{
>>> + struct mp_phy_priv *priv = phy_get_drvdata(phy);
>>> + struct mp_phy_chan_priv *chan = &priv->chan[phy->id];
>>> + int ret;
>>> +
>>> + if (chan->initialized)
>>> + return 0;
>>> +
>>> + /*
>>> + * Note: Current source code support for Ethernet, PCIe initialization
>>> + * is based on the bare metal code shared by the board team.
>>> + */
>>> + ret = pm_runtime_get_sync(priv->pd_list->pd_devs[phy->id]);
>>> + if (ret < 0) {
>>> + dev_err(priv->dev,
>>> + "Failed to power on domain for channel %d: %d\n",
>>> + phy->id, ret);
>>
>> %pe and ERR_PTR(ret)?
>
> pm_runtime_get_sync() does not return error pointer ?
Indeed, that's why ERR_PTR(ret) is needed, to convert the error code to
an error pointer, which can be converted to a human-readable symbolic
error string using %pe.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds