Commit 66e3f10c authored by Sachin Kamat's avatar Sachin Kamat Committed by Linus Torvalds

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0218bcf6
......@@ -215,12 +215,14 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm,
buf[i] |= 0x80;
/* this sequence is required to unlock the chip */
if ((xfer = i2c_master_send(client, wel, 3)) != 3) {
xfer = i2c_master_send(client, wel, 3);
if (xfer != 3) {
dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer);
return -EIO;
}
if ((xfer = i2c_master_send(client, rwel, 3)) != 3) {
xfer = i2c_master_send(client, rwel, 3);
if (xfer != 3) {
dev_err(&client->dev, "%s: rwel - %d\n", __func__, xfer);
return -EIO;
}
......@@ -269,7 +271,8 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm,
}
/* disable further writes */
if ((xfer = i2c_master_send(client, diswe, 3)) != 3) {
xfer = i2c_master_send(client, diswe, 3);
if (xfer != 3) {
dev_err(&client->dev, "%s: diswe - %d\n", __func__, xfer);
return -EIO;
}
......@@ -375,8 +378,7 @@ static int x1205_get_atrim(struct i2c_client *client, int *trim)
return 0;
}
struct x1205_limit
{
struct x1205_limit {
unsigned char reg, mask, min, max;
};
......@@ -430,7 +432,8 @@ static int x1205_validate_client(struct i2c_client *client)
},
};
if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) {
xfer = i2c_transfer(client->adapter, msgs, 2);
if (xfer != 2) {
dev_err(&client->dev,
"%s: could not read register %x\n",
__func__, probe_zero_pattern[i]);
......@@ -467,7 +470,8 @@ static int x1205_validate_client(struct i2c_client *client)
},
};
if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) {
xfer = i2c_transfer(client->adapter, msgs, 2);
if (xfer != 2) {
dev_err(&client->dev,
"%s: could not read register %x\n",
__func__, probe_limits_pattern[i].reg);
......@@ -548,10 +552,12 @@ static int x1205_rtc_proc(struct device *dev, struct seq_file *seq)
{
int err, dtrim, atrim;
if ((err = x1205_get_dtrim(to_i2c_client(dev), &dtrim)) == 0)
err = x1205_get_dtrim(to_i2c_client(dev), &dtrim);
if (!err)
seq_printf(seq, "digital_trim\t: %d ppm\n", dtrim);
if ((err = x1205_get_atrim(to_i2c_client(dev), &atrim)) == 0)
err = x1205_get_atrim(to_i2c_client(dev), &atrim);
if (!err)
seq_printf(seq, "analog_trim\t: %d.%02d pF\n",
atrim / 1000, atrim % 1000);
return 0;
......@@ -639,7 +645,8 @@ static int x1205_probe(struct i2c_client *client,
i2c_set_clientdata(client, rtc);
/* Check for power failures and eventually enable the osc */
if ((err = x1205_get_status(client, &sr)) == 0) {
err = x1205_get_status(client, &sr);
if (!err) {
if (sr & X1205_SR_RTCF) {
dev_err(&client->dev,
"power failure detected, "
......@@ -647,9 +654,9 @@ static int x1205_probe(struct i2c_client *client,
udelay(50);
x1205_fix_osc(client);
}
}
else
} else {
dev_err(&client->dev, "couldn't read status\n");
}
err = x1205_sysfs_register(&client->dev);
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment