[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220831134302.366439-1-zhangxuezhi3@gmail.com>
Date: Wed, 31 Aug 2022 21:43:02 +0800
From: Xuezhi Zhang <zhangxuezhi3@...il.com>
To: erazor_de@...rs.sourceforge.net, jikos@...nel.org,
benjamin.tissoires@...hat.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
zhangxuezhi3@...il.com, Xuezhi Zhang <zhangxuezhi1@...lpad.com>
Subject: [PATCH] HID: roccat: convert sysfs snprintf to sysfs_emit
From: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
Fix up all sysfs show entries to use sysfs_emit
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
---
drivers/hid/hid-roccat-pyra.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c
index 4fcc8e7d276f..8b4d2519d4c4 100644
--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -286,7 +286,7 @@ static ssize_t pyra_sysfs_show_actual_cpi(struct device *dev,
{
struct pyra_device *pyra =
hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
- return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
+ return sysfs_emit(buf, "%d\n", pyra->actual_cpi);
}
static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL);
@@ -303,7 +303,7 @@ static ssize_t pyra_sysfs_show_actual_profile(struct device *dev,
&settings, PYRA_SIZE_SETTINGS);
mutex_unlock(&pyra->pyra_lock);
- return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
+ return sysfs_emit(buf, "%d\n", settings.startup_profile);
}
static DEVICE_ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
static DEVICE_ATTR(startup_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
@@ -324,7 +324,7 @@ static ssize_t pyra_sysfs_show_firmware_version(struct device *dev,
&info, PYRA_SIZE_INFO);
mutex_unlock(&pyra->pyra_lock);
- return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+ return sysfs_emit(buf, "%d\n", info.firmware_version);
}
static DEVICE_ATTR(firmware_version, 0440, pyra_sysfs_show_firmware_version,
NULL);
--
2.25.1
Powered by blists - more mailing lists