Skip to content

Commit

Permalink
rtc: pcf8563: remove leftover code
Browse files Browse the repository at this point in the history
Remove some code that was left from before block read/write was used.

Signed-off-by: Jan Kardell <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Vincent Donnefort <[email protected]>
Cc: Dan Carpenter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jan-kardell authored and torvalds committed Dec 11, 2014
1 parent 672e2b1 commit 17a1e5e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/rtc/rtc-pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,21 @@ static int pcf8563_write_block_data(struct i2c_client *client,

static int pcf8563_set_alarm_mode(struct i2c_client *client, bool on)
{
unsigned char buf[2];
unsigned char buf;
int err;

err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, buf + 1);
err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf);
if (err < 0)
return err;

if (on)
buf[1] |= PCF8563_BIT_AIE;
buf |= PCF8563_BIT_AIE;
else
buf[1] &= ~PCF8563_BIT_AIE;
buf &= ~PCF8563_BIT_AIE;

buf[1] &= ~PCF8563_BIT_AF;
buf[0] = PCF8563_REG_ST2;
buf &= ~PCF8563_BIT_AF;

err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, buf + 1);
err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, &buf);
if (err < 0) {
dev_err(&client->dev, "%s: write error\n", __func__);
return -EIO;
Expand Down

0 comments on commit 17a1e5e

Please sign in to comment.