rtc: pcf2127: Convert to .probe_new()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183349 commit 5418e595f30bf4fde83ebb0121417c0c95cff98e Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Date: Fri Oct 21 15:07:03 2022 +0200 rtc: pcf2127: Convert to .probe_new() .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in .probe(). The device_id array has to move up for that to work. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221021130706.178687-7-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 5418e595f30bf4fde83ebb0121417c0c95cff98e) Signed-off-by: Gavin Shan <gshan@redhat.com>
This commit is contained in:
parent
5391466d29
commit
9acb72ffb6
|
@ -885,9 +885,17 @@ static const struct regmap_bus pcf2127_i2c_regmap = {
|
||||||
|
|
||||||
static struct i2c_driver pcf2127_i2c_driver;
|
static struct i2c_driver pcf2127_i2c_driver;
|
||||||
|
|
||||||
static int pcf2127_i2c_probe(struct i2c_client *client,
|
static const struct i2c_device_id pcf2127_i2c_id[] = {
|
||||||
const struct i2c_device_id *id)
|
{ "pcf2127", 1 },
|
||||||
|
{ "pcf2129", 0 },
|
||||||
|
{ "pca2129", 0 },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(i2c, pcf2127_i2c_id);
|
||||||
|
|
||||||
|
static int pcf2127_i2c_probe(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
|
const struct i2c_device_id *id = i2c_match_id(pcf2127_i2c_id, client);
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
static const struct regmap_config config = {
|
static const struct regmap_config config = {
|
||||||
.reg_bits = 8,
|
.reg_bits = 8,
|
||||||
|
@ -910,20 +918,12 @@ static int pcf2127_i2c_probe(struct i2c_client *client,
|
||||||
pcf2127_i2c_driver.driver.name, id->driver_data);
|
pcf2127_i2c_driver.driver.name, id->driver_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct i2c_device_id pcf2127_i2c_id[] = {
|
|
||||||
{ "pcf2127", 1 },
|
|
||||||
{ "pcf2129", 0 },
|
|
||||||
{ "pca2129", 0 },
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
MODULE_DEVICE_TABLE(i2c, pcf2127_i2c_id);
|
|
||||||
|
|
||||||
static struct i2c_driver pcf2127_i2c_driver = {
|
static struct i2c_driver pcf2127_i2c_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "rtc-pcf2127-i2c",
|
.name = "rtc-pcf2127-i2c",
|
||||||
.of_match_table = of_match_ptr(pcf2127_of_match),
|
.of_match_table = of_match_ptr(pcf2127_of_match),
|
||||||
},
|
},
|
||||||
.probe = pcf2127_i2c_probe,
|
.probe_new = pcf2127_i2c_probe,
|
||||||
.id_table = pcf2127_i2c_id,
|
.id_table = pcf2127_i2c_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue