Skip to content

Commit 44f0fb8

Browse files
elkablokuba-moo
authored andcommitted
leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded'
Commit b655892 ("leds: trigger: netdev: expose hw_control status via sysfs") exposed to sysfs the flag that tells whether the LED trigger is offloaded to hardware, under the name "hw_control", since that is the name under which this setting is called in the code. Everywhere else in kernel when some work that is normally done in software can be made to be done by hardware instead, we use the word "offloading" to describe this, e.g. "LED blinking is offloaded to hardware". Normally renaming sysfs entries is a no-go because of backwards compatibility. But since this patch was not yet released in a stable kernel, I think it is still possible to rename it, if there is consensus. Fixes: b655892 ("leds: trigger: netdev: expose hw_control status via sysfs") Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230821121453.30203-1-kabel@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 604204f commit 44f0fb8

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Documentation/ABI/testing/sysfs-class-led-trigger-netdev

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Description:
1313
Specifies the duration of the LED blink in milliseconds.
1414
Defaults to 50 ms.
1515

16-
With hw_control ON, the interval value MUST be set to the
16+
When offloaded is true, the interval value MUST be set to the
1717
default value and cannot be changed.
1818
Trying to set any value in this specific mode will return
1919
an EINVAL error.
@@ -44,8 +44,8 @@ Description:
4444
If set to 1, the LED will blink for the milliseconds specified
4545
in interval to signal transmission.
4646

47-
With hw_control ON, the blink interval is controlled by hardware
48-
and won't reflect the value set in interval.
47+
When offloaded is true, the blink interval is controlled by
48+
hardware and won't reflect the value set in interval.
4949

5050
What: /sys/class/leds/<led>/rx
5151
Date: Dec 2017
@@ -59,21 +59,21 @@ Description:
5959
If set to 1, the LED will blink for the milliseconds specified
6060
in interval to signal reception.
6161

62-
With hw_control ON, the blink interval is controlled by hardware
63-
and won't reflect the value set in interval.
62+
When offloaded is true, the blink interval is controlled by
63+
hardware and won't reflect the value set in interval.
6464

65-
What: /sys/class/leds/<led>/hw_control
65+
What: /sys/class/leds/<led>/offloaded
6666
Date: Jun 2023
6767
KernelVersion: 6.5
6868
Contact: linux-leds@vger.kernel.org
6969
Description:
70-
Communicate whether the LED trigger modes are driven by hardware
71-
or software fallback is used.
70+
Communicate whether the LED trigger modes are offloaded to
71+
hardware or whether software fallback is used.
7272

7373
If 0, the LED is using software fallback to blink.
7474

75-
If 1, the LED is using hardware control to blink and signal the
76-
requested modes.
75+
If 1, the LED blinking in requested mode is offloaded to
76+
hardware.
7777

7878
What: /sys/class/leds/<led>/link_10
7979
Date: Jun 2023

drivers/leds/trigger/ledtrig-netdev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,15 @@ static ssize_t interval_store(struct device *dev,
406406

407407
static DEVICE_ATTR_RW(interval);
408408

409-
static ssize_t hw_control_show(struct device *dev,
410-
struct device_attribute *attr, char *buf)
409+
static ssize_t offloaded_show(struct device *dev,
410+
struct device_attribute *attr, char *buf)
411411
{
412412
struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
413413

414414
return sprintf(buf, "%d\n", trigger_data->hw_control);
415415
}
416416

417-
static DEVICE_ATTR_RO(hw_control);
417+
static DEVICE_ATTR_RO(offloaded);
418418

419419
static struct attribute *netdev_trig_attrs[] = {
420420
&dev_attr_device_name.attr,
@@ -427,7 +427,7 @@ static struct attribute *netdev_trig_attrs[] = {
427427
&dev_attr_rx.attr,
428428
&dev_attr_tx.attr,
429429
&dev_attr_interval.attr,
430-
&dev_attr_hw_control.attr,
430+
&dev_attr_offloaded.attr,
431431
NULL
432432
};
433433
ATTRIBUTE_GROUPS(netdev_trig);

0 commit comments

Comments
 (0)