diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2023-08-17 17:10:38 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-08-27 23:48:32 +0200 |
commit | f45d32d2cd183c09b6c9aa8689a91d6f2760b557 (patch) | |
tree | 348dbbf0b7aa07831967ded23c28781950b24e37 /drivers/rtc | |
parent | 45cc2a7de905a1f3bb38fb7d6f68a204c71630be (diff) | |
download | linux-f45d32d2cd183c09b6c9aa8689a91d6f2760b557.tar.gz linux-f45d32d2cd183c09b6c9aa8689a91d6f2760b557.tar.bz2 linux-f45d32d2cd183c09b6c9aa8689a91d6f2760b557.zip |
rtc: isl1208: Fix incorrect logic in isl1208_set_xtoscb()
The XTOSCB bit is not bit 0, but xtosb_val is either 0 or 1. If it is 1,
test will never succeed. Fix this issue by using double negation.
While at it, remove unnecessary blank line from probe().
Reported-by: Pavel Machek <pavel@denx.de>
Closes: https://lore.kernel.org/all/ZN4BgzG2xmzOzdFZ@duo.ucw.cz/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/r/20230817161038.407960-1-biju.das.jz@bp.renesas.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-isl1208.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index 712ca652d6d3..e50c23ee1646 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -188,7 +188,7 @@ isl1208_i2c_validate_client(struct i2c_client *client) static int isl1208_set_xtoscb(struct i2c_client *client, int sr, int xtosb_val) { /* Do nothing if bit is already set to desired value */ - if ((sr & ISL1208_REG_SR_XTOSCB) == xtosb_val) + if (!!(sr & ISL1208_REG_SR_XTOSCB) == xtosb_val) return 0; if (xtosb_val) @@ -944,7 +944,6 @@ isl1208_probe(struct i2c_client *client) rc = isl1208_setup_irq(client, client->irq); if (rc) return rc; - } else { clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, isl1208->rtc->features); } |