All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Wolfram Sang <wsa@kernel.org>,
	linux-rtc@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 4/9] rtc: m41t80: Convert to .probe_new()
Date: Fri, 21 Oct 2022 15:07:01 +0200	[thread overview]
Message-ID: <20221021130706.178687-5-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20221021130706.178687-1-u.kleine-koenig@pengutronix.de>

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in .probe().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/rtc/rtc-m41t80.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index e0b4d3794320..d3144ffdebb5 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -876,8 +876,7 @@ static struct notifier_block wdt_notifier = {
  *****************************************************************************
  */
 
-static int m41t80_probe(struct i2c_client *client,
-			const struct i2c_device_id *id)
+static int m41t80_probe(struct i2c_client *client)
 {
 	struct i2c_adapter *adapter = client->adapter;
 	int rc = 0;
@@ -897,11 +896,13 @@ static int m41t80_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	m41t80_data->client = client;
-	if (client->dev.of_node)
+	if (client->dev.of_node) {
 		m41t80_data->features = (unsigned long)
 			of_device_get_match_data(&client->dev);
-	else
+	} else {
+		const struct i2c_device_id *id = i2c_match_id(m41t80_id, client);
 		m41t80_data->features = id->driver_data;
+	}
 	i2c_set_clientdata(client, m41t80_data);
 
 	m41t80_data->rtc =  devm_rtc_allocate_device(&client->dev);
@@ -1007,7 +1008,7 @@ static struct i2c_driver m41t80_driver = {
 		.of_match_table = of_match_ptr(m41t80_of_match),
 		.pm = &m41t80_pm,
 	},
-	.probe = m41t80_probe,
+	.probe_new = m41t80_probe,
 	.remove = m41t80_remove,
 	.id_table = m41t80_id,
 };
-- 
2.37.2


  parent reply	other threads:[~2022-10-21 13:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 13:06 [PATCH 0/9] rtc: Convert i2c drivers to .probe_new() Uwe Kleine-König
2022-10-21 13:06 ` Uwe Kleine-König
2022-10-21 13:06 ` [PATCH 1/9] rtc: abx80x: Convert " Uwe Kleine-König
2022-10-21 13:06 ` [PATCH 2/9] rtc: ds1307: " Uwe Kleine-König
2022-11-02 16:24   ` Alexandre Belloni
2022-10-21 13:07 ` [PATCH 3/9] rtc: isl1208: " Uwe Kleine-König
2022-10-21 13:07 ` Uwe Kleine-König [this message]
2022-10-21 13:07 ` [PATCH 5/9] rtc: nct3018y: " Uwe Kleine-König
2022-10-21 13:07   ` Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 6/9] rtc: pcf2127: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 7/9] rtc: rs5c372: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 8/9] rtc: rv8803: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 9/9] rtc: rx8025: " Uwe Kleine-König
2022-11-02 16:23 ` [PATCH 0/9] rtc: Convert i2c drivers " Alexandre Belloni
2022-11-02 16:23   ` Alexandre Belloni

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=20221021130706.178687-5-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-rtc@vger.kernel.org \
    --cc=wsa@kernel.org \
    /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.