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

From: Andrew Lunn
Date: Thu Oct 31 2024 - 18:01:14 EST


> +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?

Andrew