Commit 67db6f05 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Alexandre Belloni

rtc: m41t80: Convert to .probe_new()

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in .probe().
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221021130706.178687-5-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 2611e6d7
...@@ -876,8 +876,7 @@ static struct notifier_block wdt_notifier = { ...@@ -876,8 +876,7 @@ static struct notifier_block wdt_notifier = {
***************************************************************************** *****************************************************************************
*/ */
static int m41t80_probe(struct i2c_client *client, static int m41t80_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct i2c_adapter *adapter = client->adapter; struct i2c_adapter *adapter = client->adapter;
int rc = 0; int rc = 0;
...@@ -897,11 +896,13 @@ static int m41t80_probe(struct i2c_client *client, ...@@ -897,11 +896,13 @@ static int m41t80_probe(struct i2c_client *client,
return -ENOMEM; return -ENOMEM;
m41t80_data->client = client; m41t80_data->client = client;
if (client->dev.of_node) if (client->dev.of_node) {
m41t80_data->features = (unsigned long) m41t80_data->features = (unsigned long)
of_device_get_match_data(&client->dev); 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; m41t80_data->features = id->driver_data;
}
i2c_set_clientdata(client, m41t80_data); i2c_set_clientdata(client, m41t80_data);
m41t80_data->rtc = devm_rtc_allocate_device(&client->dev); m41t80_data->rtc = devm_rtc_allocate_device(&client->dev);
...@@ -1007,7 +1008,7 @@ static struct i2c_driver m41t80_driver = { ...@@ -1007,7 +1008,7 @@ static struct i2c_driver m41t80_driver = {
.of_match_table = of_match_ptr(m41t80_of_match), .of_match_table = of_match_ptr(m41t80_of_match),
.pm = &m41t80_pm, .pm = &m41t80_pm,
}, },
.probe = m41t80_probe, .probe_new = m41t80_probe,
.remove = m41t80_remove, .remove = m41t80_remove,
.id_table = m41t80_id, .id_table = m41t80_id,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment