diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2022-12-01 11:11:24 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2022-12-07 23:05:20 +0300 |
commit | 3f6fb1cfaf30d0d701d877ffacfd88dd6bcc5841 (patch) | |
tree | 82addfc838c8123f5e3e49a7d8fecd9a875ea510 /drivers/leds/leds-blinkm.c | |
parent | 135780f1048b3f956f5b10bb23dec9c2d2c4ef6d (diff) | |
download | linux-3f6fb1cfaf30d0d701d877ffacfd88dd6bcc5841.tar.xz |
leds: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-blinkm.c')
-rw-r--r-- | drivers/leds/leds-blinkm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c index 3fb6a2fdaefa..e19cc8a7b7ca 100644 --- a/drivers/leds/leds-blinkm.c +++ b/drivers/leds/leds-blinkm.c @@ -139,11 +139,11 @@ static ssize_t show_color_common(struct device *dev, char *buf, int color) return ret; switch (color) { case RED: - return scnprintf(buf, PAGE_SIZE, "%02X\n", data->red); + return sysfs_emit(buf, "%02X\n", data->red); case GREEN: - return scnprintf(buf, PAGE_SIZE, "%02X\n", data->green); + return sysfs_emit(buf, "%02X\n", data->green); case BLUE: - return scnprintf(buf, PAGE_SIZE, "%02X\n", data->blue); + return sysfs_emit(buf, "%02X\n", data->blue); default: return -EINVAL; } @@ -253,7 +253,7 @@ static DEVICE_ATTR_RW(blue); static ssize_t test_show(struct device *dev, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, + return sysfs_emit(buf, "#Write into test to start test sequence!#\n"); } |