All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: [PATCH 5.10.y-cip 12/15] rtc: isl1208: Fix incorrect logic in isl1208_set_xtoscb()
Date: Mon, 11 Sep 2023 15:46:59 +0100	[thread overview]
Message-ID: <20230911144702.948246-13-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20230911144702.948246-1-biju.das.jz@bp.renesas.com>

commit f45d32d2cd183c09b6c9aa8689a91d6f2760b557 upstream.

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>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/rtc/rtc-isl1208.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index 92ee75fbf4b7..5b0a161f9552 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)
-- 
2.25.1



  parent reply	other threads:[~2023-09-11 14:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 14:46 [PATCH 5.10.y-cip 00/15] Enable Renesas PMIC RAA215300 and RTC builtin support Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 01/15] rtc: isl1208: Fix clock tick timed out message Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 02/15] rtc: destroy mutex when releasing the device Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 03/15] clk: fixed-rate: add devm_clk_hw_register_fixed_rate Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 04/15] i2c: Add i2c_get_match_data() Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 05/15] regulator: raa215300: Update help description Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 06/15] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name} Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 07/15] regulator: raa215300: Fix resource leak in case of error Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 08/15] regulator: raa215300: Add const definition Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 09/15] regulator: raa215300: Change rate from 32000->32768 Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 10/15] regulator: raa215300: Add missing blank space Biju Das
2023-09-11 14:46 ` [PATCH 5.10.y-cip 11/15] rtc: isl1208: Simplify probe() Biju Das
2023-09-11 14:46 ` Biju Das [this message]
2023-09-11 14:47 ` [PATCH 5.10.y-cip 13/15] arm64: defconfig: Enable PMIC RAA215300 and RTC ISL 1208 configs Biju Das
2023-09-11 14:47 ` [PATCH 5.10.y-cip 14/15] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
2023-09-11 14:47 ` [PATCH 5.10.y-cip 15/15] arm64: dts: renesas: rzg2lc-smarc-som: " Biju Das
2023-09-12 21:09 ` [PATCH 5.10.y-cip 00/15] Enable Renesas PMIC RAA215300 and RTC builtin support Pavel Machek
2023-09-13  2:25   ` nobuhiro1.iwamatsu
2023-09-13 13:55     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230911144702.948246-13-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.