diff options
author | Robert Kmiec <robert.r.kmiec@gmail.com> | 2015-04-16 21:45:01 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 15:03:59 +0200 |
commit | b0c57b5941c4a42698d845ada6a76feeba2d1be9 (patch) | |
tree | a2f830b8f23cf73df60e5580966280af6ebba34d | |
parent | kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y (diff) | |
download | linux-b0c57b5941c4a42698d845ada6a76feeba2d1be9.tar.xz linux-b0c57b5941c4a42698d845ada6a76feeba2d1be9.zip |
drivers/rtc/rtc-pcf8563.c: simplify return from function
This commit does not change any logic here. It just makes the code easier
to read.
This is how it looked like:
If err != 0 return err;
else return 0;
Signed-off-by: Robert Kmiec <robert.r.kmiec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-pcf8563.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 96fb32e7d6f8..0ba7e59929be 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -246,7 +246,6 @@ static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) { struct pcf8563 *pcf8563 = i2c_get_clientdata(client); - int err; unsigned char buf[9]; dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " @@ -272,12 +271,8 @@ static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; - err = pcf8563_write_block_data(client, PCF8563_REG_SC, + return pcf8563_write_block_data(client, PCF8563_REG_SC, 9 - PCF8563_REG_SC, buf + PCF8563_REG_SC); - if (err) - return err; - - return 0; } #ifdef CONFIG_RTC_INTF_DEV |