From: Zinc Lim <limzhineng2@gmail.com>
To: Alexander Duyck <alexanderduyck@fb.com>,
Jakub Kicinski <kuba@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Guenter Roeck <linux@roeck-us.net>,
Simon Horman <horms@kernel.org>,
Mohsin Bashir <mohsin.bashr@gmail.com>
Cc: kernel-team@meta.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
zinclim@meta.com, Zinc Lim <limzhineng2@gmail.com>
Subject: [PATCH net-next 2/6] eth: fbnic: expose all hwmon attributes unconditionally as read-only
Date: Tue, 21 Jul 2026 15:15:36 -0700 [thread overview]
Message-ID: <20260721221540.648272-3-limzhineng2@gmail.com> (raw)
In-Reply-To: <20260721221540.648272-1-limzhineng2@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2026-07-21 22:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 22:15 [PATCH net-next 0/6] eth: fbnic: expand hwmon sensor support Zinc Lim
2026-07-21 22:15 ` [PATCH net-next 1/6] eth: fbnic: move sensor read logic out of fbnic_mac Zinc Lim
2026-07-22 22:17 ` sashiko-bot
2026-07-21 22:15 ` Zinc Lim [this message]
2026-07-22 22:18 ` [PATCH net-next 2/6] eth: fbnic: expose all hwmon attributes unconditionally as read-only sashiko-bot
2026-07-21 22:15 ` [PATCH net-next 3/6] eth: fbnic: cache hwmon sensor readings Zinc Lim
2026-07-22 22:17 ` sashiko-bot
2026-07-21 22:15 ` [PATCH net-next 4/6] eth: fbnic: report temperature and voltage thresholds via hwmon Zinc Lim
2026-07-22 22:18 ` sashiko-bot
2026-07-21 22:15 ` [PATCH net-next 5/6] eth: fbnic: report temperature and voltage alarms " Zinc Lim
2026-07-22 22:17 ` sashiko-bot
2026-07-21 22:15 ` [PATCH net-next 6/6] eth: fbnic: firmware notifies hwmon on sensor threshold events Zinc Lim
2026-07-22 22:18 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260721221540.648272-3-limzhineng2@gmail.com \
--to=limzhineng2@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zinclim@meta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox