Re: [PATCH v5 net-next 08/13] net: phy: marvell-88q2xxx: add support for temperature sensor
From: Dimitri Fedrau <hidden>
Date: 2024-02-01 16:17:53
Also in:
linux-hwmon, lkml
From: Dimitri Fedrau <hidden>
Date: 2024-02-01 16:17:53
Also in:
linux-hwmon, lkml
Am Thu, Feb 01, 2024 at 05:18:23AM -0800 schrieb Guenter Roeck: [...]
quoted
+ +static int mv88q2xxx_hwmon_write(struct device *dev, + enum hwmon_sensor_types type, u32 attr, + int channel, long val) +{ + struct phy_device *phydev = dev_get_drvdata(dev); + + switch (attr) { + case hwmon_temp_max: + if (val < -75000 || val > 180000) + return -EINVAL; +Not that it matters much, but we typically use clamp_val() to limit the range of temperature limits because the valid range differs for each chip and is otherwise difficult to determine for the user.
Will fix it. Dimitri