[PATCH net-next 2/6] eth: fbnic: expose all hwmon attributes unconditionally as read-only
From: Zinc Lim
Date: Tue Jul 21 2026 - 18:28:27 EST
All fbnic hwmon attributes are read-only and always present, so
fbnic_hwmon_is_visible() can simply return 0444 for everything
instead of matching on the sensor type and attribute. This also
prepares for the threshold and alarm attributes added in the
following patches: they are exposed unconditionally and reads
return attribute values.
Signed-off-by: Zinc Lim <limzhineng2@xxxxxxxxx>
---
drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
index 6c8c66ab86c1..38bb26cb8e6c 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
@@ -20,12 +20,7 @@ static umode_t fbnic_hwmon_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{
- if (type == hwmon_temp && attr == hwmon_temp_input)
- return 0444;
- if (type == hwmon_in && attr == hwmon_in_input)
- return 0444;
-
- return 0;
+ return 0444;
}
static int fbnic_hwmon_sensor_read(struct fbnic_dev *fbd, int id, long *val)
--
2.53.0-Meta