summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-05-29 18:32:37 +0200
committerDavid S. Miller <davem@davemloft.net>2023-05-31 09:42:09 +0100
commitc84c80c7388f887b10dafd70fc55bc6c5fe9fa5a (patch)
treee4045d99ca2f052806534d971758dc48a585e052
parent6352f25f9fadba59d5df2ba7139495759ccc81d5 (diff)
leds: trigger: netdev: reject interval store for hw_control
Reject interval store with hw_control enabled. It's are currently not supported and MUST be set to the default value with hw control enabled. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/leds/trigger/ledtrig-netdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index 2101cbbda707..cb2ec33abc4e 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -265,6 +265,9 @@ static ssize_t interval_store(struct device *dev,
unsigned long value;
int ret;
+ if (trigger_data->hw_control)
+ return -EINVAL;
+
ret = kstrtoul(buf, 0, &value);
if (ret)
return ret;