Re: [PATCH RFC net-next v2 08/18] net: pse-pd: Add support for reporting events

From: Kory Maincent
Date: Tue Nov 05 2024 - 04:41:57 EST


On Thu, 31 Oct 2024 23:00:48 +0100
Andrew Lunn <andrew@xxxxxxx> wrote:

> > +static unsigned long pse_to_regulator_notifs(unsigned long notifs)
> > +{
> > + switch (notifs) {
> > + case ETHTOOL_C33_PSE_EVENT_OVER_CURRENT:
> > + return REGULATOR_EVENT_OVER_CURRENT;
> > + case ETHTOOL_C33_PSE_EVENT_OVER_TEMP:
> > + return REGULATOR_EVENT_OVER_TEMP;
> > + }
> > + return 0;
> > +}
>
>
> https://elixir.bootlin.com/linux/v6.11.5/source/include/uapi/regulator/regulator.h#L36
>
> * NOTE: These events can be OR'ed together when passed into handler.
>
> ETHTOOL_C33_PSE_EVENT_OVER_* are also bits which could be OR'ed
> together, so is this function correct?

You are right, thanks for seeing it.

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