From 5bcd5d0f01856cc59a60bac82114b1efb12b240e Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 11 Jul 2020 10:19:02 +0300 Subject: updated README and fixed range_show --- hid-tmt300rs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hid-tmt300rs.c') diff --git a/hid-tmt300rs.c b/hid-tmt300rs.c index 5415fa6..8287042 100644 --- a/hid-tmt300rs.c +++ b/hid-tmt300rs.c @@ -662,10 +662,11 @@ static ssize_t t300rs_range_show(struct device *dev, struct device_attribute *at char *buf){ struct hid_device *hdev = to_hid_device(dev); struct t300rs_device_entry *t300rs; + size_t count; t300rs = t300rs_get_device(hdev); - - return t300rs->range; + count = scnprintf(buf, PAGE_SIZE, "%u\n", t300rs->range); + return count; } static DEVICE_ATTR(range, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, t300rs_range_show, t300rs_range_store); -- cgit v1.3