From: Alessandro Zummo <a.zummo@towertech.it>
To: linux-kernel@vger.kernel.org
Cc: akpm@zip.com.au, akpm@osdl.org
Subject: [PATCH 06/10] RTC subsystem, RS5C372 sysfs fix
Date: Fri, 31 Mar 2006 12:04:29 +0200 [thread overview]
Message-ID: <20060331100424.254579000@towertech.it> (raw)
In-Reply-To: 20060331100423.175139000@towertech.it
[-- Attachment #1: rtc-subsys-rs5c372-fix-sysfs.patch --]
[-- Type: text/plain, Size: 1372 bytes --]
fixed sysfs show() return code
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
---
drivers/rtc/rtc-rs5c372.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
--- linux-rtc.orig/drivers/rtc/rtc-rs5c372.c 2006-03-29 02:41:04.000000000 +0200
+++ linux-rtc/drivers/rtc/rtc-rs5c372.c 2006-03-29 02:46:40.000000000 +0200
@@ -169,24 +169,26 @@ static struct rtc_class_ops rs5c372_rtc_
static ssize_t rs5c372_sysfs_show_trim(struct device *dev,
struct device_attribute *attr, char *buf)
{
- int trim;
+ int err, trim;
- if (rs5c372_get_trim(to_i2c_client(dev), NULL, &trim) == 0)
- return sprintf(buf, "0x%2x\n", trim);
+ err = rs5c372_get_trim(to_i2c_client(dev), NULL, &trim);
+ if (err)
+ return err;
- return 0;
+ return sprintf(buf, "0x%2x\n", trim);
}
static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL);
static ssize_t rs5c372_sysfs_show_osc(struct device *dev,
struct device_attribute *attr, char *buf)
{
- int osc;
+ int err, osc;
- if (rs5c372_get_trim(to_i2c_client(dev), &osc, NULL) == 0)
- return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
+ err = rs5c372_get_trim(to_i2c_client(dev), &osc, NULL);
+ if (err)
+ return err;
- return 0;
+ return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
}
static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL);
--
next prev parent reply other threads:[~2006-03-31 10:05 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 ` [PATCH 03/10] RTC subsystem, X1205 sysfs cleanup Alessandro Zummo
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 ` Alessandro Zummo [this message]
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=20060331100424.254579000@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox