diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-07-03 18:06:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:48 -0400 |
commit | 66e3f10c993845e0118f4232911b40068ad91886 (patch) | |
tree | 6ea47470dd3a4b332b598f2813815cfc8dd6bbb9 | |
parent | 0218bcf658d0faf98582856b7176e25bdf3fd129 (diff) |
drivers/rtc/rtc-x1205.c: fix checkpatch issues
Fixes the following types of issues:
ERROR: do not use assignment in if condition
ERROR: open brace '{' following struct go on the same line
ERROR: else should follow close brace '}'
WARNING: please, no space before tabs
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.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-x1205.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index fa9b0679fb60..365dc6505148 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright 2005 Alessandro Zummo | 4 | * Copyright 2005 Alessandro Zummo |
5 | * | 5 | * |
6 | * please send all reports to: | 6 | * please send all reports to: |
7 | * Karen Spearel <kas111 at gmail dot com> | 7 | * Karen Spearel <kas111 at gmail dot com> |
8 | * Alessandro Zummo <a.zummo@towertech.it> | 8 | * Alessandro Zummo <a.zummo@towertech.it> |
9 | * | 9 | * |
10 | * based on a lot of other RTC drivers. | 10 | * based on a lot of other RTC drivers. |
@@ -215,12 +215,14 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
215 | buf[i] |= 0x80; | 215 | buf[i] |= 0x80; |
216 | 216 | ||
217 | /* this sequence is required to unlock the chip */ | 217 | /* this sequence is required to unlock the chip */ |
218 | if ((xfer = i2c_master_send(client, wel, 3)) != 3) { | 218 | xfer = i2c_master_send(client, wel, 3); |
219 | if (xfer != 3) { | ||
219 | dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer); | 220 | dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer); |
220 | return -EIO; | 221 | return -EIO; |
221 | } | 222 | } |
222 | 223 | ||
223 | if ((xfer = i2c_master_send(client, rwel, 3)) != 3) { | 224 | xfer = i2c_master_send(client, rwel, 3); |
225 | if (xfer != 3) { | ||
224 | dev_err(&client->dev, "%s: rwel - %d\n", __func__, xfer); | 226 | dev_err(&client->dev, "%s: rwel - %d\n", __func__, xfer); |
225 | return -EIO; | 227 | return -EIO; |
226 | } | 228 | } |
@@ -269,7 +271,8 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
269 | } | 271 | } |
270 | 272 | ||
271 | /* disable further writes */ | 273 | /* disable further writes */ |
272 | if ((xfer = i2c_master_send(client, diswe, 3)) != 3) { | 274 | xfer = i2c_master_send(client, diswe, 3); |
275 | if (xfer != 3) { | ||
273 | dev_err(&client->dev, "%s: diswe - %d\n", __func__, xfer); | 276 | dev_err(&client->dev, "%s: diswe - %d\n", __func__, xfer); |
274 | return -EIO; | 277 | return -EIO; |
275 | } | 278 | } |
@@ -375,8 +378,7 @@ static int x1205_get_atrim(struct i2c_client *client, int *trim) | |||
375 | return 0; | 378 | return 0; |
376 | } | 379 | } |
377 | 380 | ||
378 | struct x1205_limit | 381 | struct x1205_limit { |
379 | { | ||
380 | unsigned char reg, mask, min, max; | 382 | unsigned char reg, mask, min, max; |
381 | }; | 383 | }; |
382 | 384 | ||
@@ -430,7 +432,8 @@ static int x1205_validate_client(struct i2c_client *client) | |||
430 | }, | 432 | }, |
431 | }; | 433 | }; |
432 | 434 | ||
433 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { | 435 | xfer = i2c_transfer(client->adapter, msgs, 2); |
436 | if (xfer != 2) { | ||
434 | dev_err(&client->dev, | 437 | dev_err(&client->dev, |
435 | "%s: could not read register %x\n", | 438 | "%s: could not read register %x\n", |
436 | __func__, probe_zero_pattern[i]); | 439 | __func__, probe_zero_pattern[i]); |
@@ -467,7 +470,8 @@ static int x1205_validate_client(struct i2c_client *client) | |||
467 | }, | 470 | }, |
468 | }; | 471 | }; |
469 | 472 | ||
470 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { | 473 | xfer = i2c_transfer(client->adapter, msgs, 2); |
474 | if (xfer != 2) { | ||
471 | dev_err(&client->dev, | 475 | dev_err(&client->dev, |
472 | "%s: could not read register %x\n", | 476 | "%s: could not read register %x\n", |
473 | __func__, probe_limits_pattern[i].reg); | 477 | __func__, probe_limits_pattern[i].reg); |
@@ -548,10 +552,12 @@ static int x1205_rtc_proc(struct device *dev, struct seq_file *seq) | |||
548 | { | 552 | { |
549 | int err, dtrim, atrim; | 553 | int err, dtrim, atrim; |
550 | 554 | ||
551 | if ((err = x1205_get_dtrim(to_i2c_client(dev), &dtrim)) == 0) | 555 | err = x1205_get_dtrim(to_i2c_client(dev), &dtrim); |
556 | if (!err) | ||
552 | seq_printf(seq, "digital_trim\t: %d ppm\n", dtrim); | 557 | seq_printf(seq, "digital_trim\t: %d ppm\n", dtrim); |
553 | 558 | ||
554 | if ((err = x1205_get_atrim(to_i2c_client(dev), &atrim)) == 0) | 559 | err = x1205_get_atrim(to_i2c_client(dev), &atrim); |
560 | if (!err) | ||
555 | seq_printf(seq, "analog_trim\t: %d.%02d pF\n", | 561 | seq_printf(seq, "analog_trim\t: %d.%02d pF\n", |
556 | atrim / 1000, atrim % 1000); | 562 | atrim / 1000, atrim % 1000); |
557 | return 0; | 563 | return 0; |
@@ -639,7 +645,8 @@ static int x1205_probe(struct i2c_client *client, | |||
639 | i2c_set_clientdata(client, rtc); | 645 | i2c_set_clientdata(client, rtc); |
640 | 646 | ||
641 | /* Check for power failures and eventually enable the osc */ | 647 | /* Check for power failures and eventually enable the osc */ |
642 | if ((err = x1205_get_status(client, &sr)) == 0) { | 648 | err = x1205_get_status(client, &sr); |
649 | if (!err) { | ||
643 | if (sr & X1205_SR_RTCF) { | 650 | if (sr & X1205_SR_RTCF) { |
644 | dev_err(&client->dev, | 651 | dev_err(&client->dev, |
645 | "power failure detected, " | 652 | "power failure detected, " |
@@ -647,9 +654,9 @@ static int x1205_probe(struct i2c_client *client, | |||
647 | udelay(50); | 654 | udelay(50); |
648 | x1205_fix_osc(client); | 655 | x1205_fix_osc(client); |
649 | } | 656 | } |
650 | } | 657 | } else { |
651 | else | ||
652 | dev_err(&client->dev, "couldn't read status\n"); | 658 | dev_err(&client->dev, "couldn't read status\n"); |
659 | } | ||
653 | 660 | ||
654 | err = x1205_sysfs_register(&client->dev); | 661 | err = x1205_sysfs_register(&client->dev); |
655 | if (err) | 662 | if (err) |