Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262381

[PATCH 7/9] rtc-pcf2123: allow sysfs to accept hexidecimal

From Joshua Clayton <stillcompiling@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 7/9] rtc-pcf2123: allow sysfs to accept hexidecimal
Date 2015-11-04 16:40 +0100
Message-ID <qr8kk-2go-67@gated-at.bofh.it> (permalink)
References <qr8kh-2go-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


pcf2123 registers store their values in bcd.
sysfs sensibly displays them in hexidecimal.
Up to now, the sysfs store functions only accept base 10, which
makes no sense.

Add support for hexidecimal without removing base10 support.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
---
 drivers/rtc/rtc-pcf2123.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c
index 4964d5c..6701e6d 100644
--- a/drivers/rtc/rtc-pcf2123.c
+++ b/drivers/rtc/rtc-pcf2123.c
@@ -178,7 +178,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
 	if (ret)
 		return ret;
 
-	ret = kstrtoul(buffer, 10, &val);
+	ret = kstrtoul(buffer, 0, &val);
 	if (ret)
 		return ret;
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] rtc-2123: access the clock offset feature Joshua Clayton <stillcompiling@gmail.com> - 2015-11-04 16:40 +0100
  [PATCH 2/9] rtc-pcf2123: clean up reads from the chip Joshua Clayton <stillcompiling@gmail.com> - 2015-11-04 16:40 +0100
  [PATCH 5/9] rtc-pcf2123: put the chip reset into a function Joshua Clayton <stillcompiling@gmail.com> - 2015-11-04 16:40 +0100
  [PATCH 7/9] rtc-pcf2123: allow sysfs to accept hexidecimal Joshua Clayton <stillcompiling@gmail.com> - 2015-11-04 16:40 +0100
  [PATCH 9/9] rtc-pcf2123: adjust the clock rate via sysfs Joshua Clayton <stillcompiling@gmail.com> - 2015-11-04 16:40 +0100

csiph-web