From: Alessandro Zummo <a.zummo@towertech.it>
To: linux-kernel@vger.kernel.org
Cc: akpm@zip.com.au, akpm@osdl.org
Subject: [PATCH 03/10] RTC subsystem, X1205 sysfs cleanup
Date: Fri, 31 Mar 2006 12:04:26 +0200 [thread overview]
Message-ID: <20060331100423.694555000@towertech.it> (raw)
In-Reply-To: 20060331100423.175139000@towertech.it
[-- Attachment #1: rtc-subsys-x1205-fix-sysfs.patch --]
[-- Type: text/plain, Size: 1604 bytes --]
fixed sysfs show() return code
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
---
drivers/rtc/rtc-x1205.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
--- linux-rtc.orig/drivers/rtc/rtc-x1205.c 2006-03-29 02:14:50.000000000 +0200
+++ linux-rtc/drivers/rtc/rtc-x1205.c 2006-03-29 02:33:57.000000000 +0200
@@ -19,7 +19,7 @@
#include <linux/rtc.h>
#include <linux/delay.h>
-#define DRV_VERSION "1.0.6"
+#define DRV_VERSION "1.0.7"
/* Addresses to scan: none. This chip is located at
* 0x6f and uses a two bytes register addressing.
@@ -473,24 +473,26 @@ static struct rtc_class_ops x1205_rtc_op
static ssize_t x1205_sysfs_show_atrim(struct device *dev,
struct device_attribute *attr, char *buf)
{
- int atrim;
+ int err, atrim;
- if (x1205_get_atrim(to_i2c_client(dev), &atrim) == 0)
- return sprintf(buf, "%d.%02d pF\n",
- atrim / 1000, atrim % 1000);
- return 0;
+ err = x1205_get_atrim(to_i2c_client(dev), &atrim);
+ if (err)
+ return err;
+
+ return sprintf(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000);
}
static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL);
static ssize_t x1205_sysfs_show_dtrim(struct device *dev,
struct device_attribute *attr, char *buf)
{
- int dtrim;
+ int err, dtrim;
- if (x1205_get_dtrim(to_i2c_client(dev), &dtrim) == 0)
- return sprintf(buf, "%d ppm\n", dtrim);
+ err = x1205_get_dtrim(to_i2c_client(dev), &dtrim);
+ if (err)
+ return err;
- return 0;
+ return sprintf(buf, "%d ppm\n", dtrim);
}
static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL);
--
next prev parent reply other threads:[~2006-03-31 10:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-31 10:04 [PATCH 00/10] RTC subsystem Alessandro Zummo
2006-03-31 10:04 ` [PATCH 01/10] RTC subsystem, DS1672 oscillator handling Alessandro Zummo
2006-03-31 10:04 ` [PATCH 02/10] RTC subsystem, DS1672 cleanup Alessandro Zummo
2006-03-31 10:04 ` Alessandro Zummo [this message]
2006-03-31 10:04 ` [PATCH 04/10] RTC subsystem, whitespaces and error messages cleanup Alessandro Zummo
2006-03-31 10:04 ` [PATCH 05/10] RTC subsystem, fix proc output Alessandro Zummo
2006-03-31 10:04 ` [PATCH 06/10] RTC subsystem, RS5C372 sysfs fix Alessandro Zummo
2006-03-31 10:04 ` [PATCH 07/10] RTC subsystem, compact error messages Alessandro Zummo
2006-03-31 10:04 ` [PATCH 08/10] RTC subsystem, SA1100 cleanup Alessandro Zummo
2006-04-02 18:43 ` Pavel Machek
2006-03-31 10:04 ` [PATCH 09/10] RTC subsystem, VR41XX driver Alessandro Zummo
2006-04-01 23:20 ` Andrew Morton
2006-03-31 10:04 ` [PATCH 10/10] RTC subsystem, VR41XX cleanup Alessandro Zummo
[not found] ` <Pine.LNX.4.63.0605030826290.1846@pcgl.dsa-ac.de>
[not found] ` <20060503105816.65f309f8@inspiron>
[not found] ` <Pine.LNX.4.63.0605031120570.1846@pcgl.dsa-ac.de>
[not found] ` <20060503121354.61bf3558@inspiron>
[not found] ` <Pine.LNX.4.63.0605031223350.1846@pcgl.dsa-ac.de>
[not found] ` <20060503122555.5337523f@inspiron>
[not found] ` <Pine.LNX.4.63.0605031242020.1846@pcgl.dsa-ac.de>
[not found] ` <20060503132301.52a75dcd@inspiron>
2006-05-05 18:43 ` drivers/acorn/char/pcf8583.[hc] vs. RTC subsystem Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060331100423.694555000@towertech.it \
--to=a.zummo@towertech.it \
--cc=akpm@osdl.org \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.