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 6.1.y-cip 08/14] rtc: isl1208: Simplify probe()
Date: Mon, 11 Sep 2023 17:28:34 +0100	[thread overview]
Message-ID: <20230911162840.1115401-9-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20230911162840.1115401-1-biju.das.jz@bp.renesas.com>

commit b7f73b6e921b457a222e86cf53fe3950c6b5aed5 upstream.

Simplify the probe() by replacing of_device_get_match_data() and
i2c_match_id() by i2c_get_match_data() as we have similar I2C
and DT-based matching table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230710114747.106496-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 | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index b8cb99810ce4..2fccfadb5564 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -862,15 +862,9 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	i2c_set_clientdata(client, isl1208);
 
 	/* Determine which chip we have */
-	if (client->dev.of_node) {
-		isl1208->config = of_device_get_match_data(&client->dev);
-		if (!isl1208->config)
-			return -ENODEV;
-	} else {
-		if (!id)
-			return -ENODEV;
-		isl1208->config = (struct isl1208_config *)id->driver_data;
-	}
+	isl1208->config = i2c_get_match_data(client);
+	if (!isl1208->config)
+		return -ENODEV;
 
 	rc = isl1208_clk_present(client, "xin");
 	if (rc < 0)
-- 
2.25.1



  parent reply	other threads:[~2023-09-11 16:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 16:28 [PATCH 6.1.y-cip 00/14] Enable Renesas PMIC RAA215300 and RTC builtin support Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 01/14] i2c: Add i2c_get_match_data() Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 02/14] regulator: raa215300: Update help description Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 03/14] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name} Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 04/14] regulator: raa215300: Fix resource leak in case of error Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 05/14] regulator: raa215300: Add const definition Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 06/14] regulator: raa215300: Change rate from 32000->32768 Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 07/14] regulator: raa215300: Add missing blank space Biju Das
2023-09-11 16:28 ` Biju Das [this message]
2023-09-11 16:28 ` [PATCH 6.1.y-cip 09/14] rtc: isl1208: Fix incorrect logic in isl1208_set_xtoscb() Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 10/14] arm64: defconfig: Enable PMIC RAA215300 and RTC ISL 1208 configs Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 11/14] arm64: dts: renesas: rzg2l: Fix txdv-skew-psec typos Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 12/14] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 13/14] arm64: dts: renesas: rzg2lc-smarc-som: Add PHY interrupt support for ETH0 Biju Das
2023-09-11 16:28 ` [PATCH 6.1.y-cip 14/14] arm64: dts: renesas: rzg2lc-smarc-som: Enable PMIC and built-in RTC Biju Das
2023-09-12 21:14 ` [PATCH 6.1.y-cip 00/14] Enable Renesas PMIC RAA215300 and RTC builtin support Pavel Machek
2023-09-13  6:01   ` Biju Das
2023-09-13 15:17     ` 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=20230911162840.1115401-9-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.