aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-x1205.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index 621d17afc0d9..e2630659f04f 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -19,7 +19,7 @@
19#include <linux/rtc.h> 19#include <linux/rtc.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21 21
22#define DRV_VERSION "1.0.6" 22#define DRV_VERSION "1.0.7"
23 23
24/* Addresses to scan: none. This chip is located at 24/* Addresses to scan: none. This chip is located at
25 * 0x6f and uses a two bytes register addressing. 25 * 0x6f and uses a two bytes register addressing.
@@ -473,24 +473,26 @@ static struct rtc_class_ops x1205_rtc_ops = {
473static ssize_t x1205_sysfs_show_atrim(struct device *dev, 473static ssize_t x1205_sysfs_show_atrim(struct device *dev,
474 struct device_attribute *attr, char *buf) 474 struct device_attribute *attr, char *buf)
475{ 475{
476 int atrim; 476 int err, atrim;
477 477
478 if (x1205_get_atrim(to_i2c_client(dev), &atrim) == 0) 478 err = x1205_get_atrim(to_i2c_client(dev), &atrim);
479 return sprintf(buf, "%d.%02d pF\n", 479 if (err)
480 atrim / 1000, atrim % 1000); 480 return err;
481 return 0; 481
482 return sprintf(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000);
482} 483}
483static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL); 484static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL);
484 485
485static ssize_t x1205_sysfs_show_dtrim(struct device *dev, 486static ssize_t x1205_sysfs_show_dtrim(struct device *dev,
486 struct device_attribute *attr, char *buf) 487 struct device_attribute *attr, char *buf)
487{ 488{
488 int dtrim; 489 int err, dtrim;
489 490
490 if (x1205_get_dtrim(to_i2c_client(dev), &dtrim) == 0) 491 err = x1205_get_dtrim(to_i2c_client(dev), &dtrim);
491 return sprintf(buf, "%d ppm\n", dtrim); 492 if (err)
493 return err;
492 494
493 return 0; 495 return sprintf(buf, "%d ppm\n", dtrim);
494} 496}
495static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL); 497static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL);
496 498