Re: [PATCH net-next v6 2/2] net: pse-pd: Add Si3474 PSE controller driver

From: Kory Maincent
Date: Tue Aug 12 2025 - 09:14:41 EST


Le Tue, 12 Aug 2025 11:12:22 +0000,
Piotr Kubik <piotr.kubik@xxxxxxxxxx> a écrit :

> From: Piotr Kubik <piotr.kubik@xxxxxxxxxx>
>
> Add a driver for the Skyworks Si3474 I2C Power Sourcing Equipment
> controller.
>
> Driver supports basic features of Si3474 IC:
> - get port status,
> - get port power,
> - get port voltage,
> - enable/disable port power.
>
> Only 4p configurations are supported at this moment.
>
> Signed-off-by: Piotr Kubik <piotr.kubik@xxxxxxxxxx>

...

> +static int si3474_get_of_channels(struct si3474_priv *priv)
> +{
> + struct pse_pi *pi;
> + u32 chan_id;
> + u8 pi_no;
> + s32 ret;
> +
> + for (pi_no = 0; pi_no < SI3474_MAX_CHANS; pi_no++) {
> + pi = &priv->pcdev.pi[pi_no];
> + u8 pairset_no;
> +
> + for (pairset_no = 0; pairset_no < 2; pairset_no++) {
> + if (!pi->pairset[pairset_no].np)
> + continue;
> +
> + ret =
> of_property_read_u32(pi->pairset[pairset_no].np,
> + "reg", &chan_id);
> + if (ret) {
> + dev_err(&priv->client[0]->dev,
> + "Failed to read channel reg
> property\n");
> + return ret;
> + }
> + if (chan_id > SI3474_MAX_CHANS) {
> + dev_err(&priv->client[0]->dev,
> + "Incorrect channel number: %d\n",
> chan_id);
> + return -EINVAL;
> + }
> +
> + priv->pi[pi_no].chan[pairset_no] = chan_id;
> + /* Mark as 4-pair if second pairset is present */
> + priv->pi[pi_no].is_4p = (pairset_no == 1);

I think we should return and report an error if a PI is configured as a 2 pairs
PoE as long as it is not supported by the driver. This could avoid any future
mistakes from users.

Except from that it seems ok for me.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com