aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rs5c372.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 48aecb890272..5e5cc10c675e 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -169,24 +169,26 @@ static struct rtc_class_ops rs5c372_rtc_ops = {
169static ssize_t rs5c372_sysfs_show_trim(struct device *dev, 169static ssize_t rs5c372_sysfs_show_trim(struct device *dev,
170 struct device_attribute *attr, char *buf) 170 struct device_attribute *attr, char *buf)
171{ 171{
172 int trim; 172 int err, trim;
173 173
174 if (rs5c372_get_trim(to_i2c_client(dev), NULL, &trim) == 0) 174 err = rs5c372_get_trim(to_i2c_client(dev), NULL, &trim);
175 return sprintf(buf, "0x%2x\n", trim); 175 if (err)
176 return err;
176 177
177 return 0; 178 return sprintf(buf, "0x%2x\n", trim);
178} 179}
179static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL); 180static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL);
180 181
181static ssize_t rs5c372_sysfs_show_osc(struct device *dev, 182static ssize_t rs5c372_sysfs_show_osc(struct device *dev,
182 struct device_attribute *attr, char *buf) 183 struct device_attribute *attr, char *buf)
183{ 184{
184 int osc; 185 int err, osc;
185 186
186 if (rs5c372_get_trim(to_i2c_client(dev), &osc, NULL) == 0) 187 err = rs5c372_get_trim(to_i2c_client(dev), &osc, NULL);
187 return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000); 188 if (err)
189 return err;
188 190
189 return 0; 191 return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
190} 192}
191static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL); 193static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL);
192 194