regulator: Convert i2c drivers to use .probe_new

Use the new .probe_new for i2c drivers.
These drivers do not use const struct i2c_device_id * argument, so convert
them to utilise the simplified i2c driver registration.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20200109155808.22003-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Axel Lin 2020-01-09 23:58:08 +08:00 коммит произвёл Mark Brown
Родитель 7eec678698
Коммит 77e29598ca
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
12 изменённых файлов: 24 добавлений и 36 удалений

Просмотреть файл

@ -131,8 +131,7 @@ static const struct of_device_id da9210_dt_ids[] = {
}; };
MODULE_DEVICE_TABLE(of, da9210_dt_ids); MODULE_DEVICE_TABLE(of, da9210_dt_ids);
static int da9210_i2c_probe(struct i2c_client *i2c, static int da9210_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct da9210 *chip; struct da9210 *chip;
struct device *dev = &i2c->dev; struct device *dev = &i2c->dev;
@ -228,7 +227,7 @@ static struct i2c_driver da9210_regulator_driver = {
.name = "da9210", .name = "da9210",
.of_match_table = of_match_ptr(da9210_dt_ids), .of_match_table = of_match_ptr(da9210_dt_ids),
}, },
.probe = da9210_i2c_probe, .probe_new = da9210_i2c_probe,
.id_table = da9210_i2c_id, .id_table = da9210_i2c_id,
}; };

Просмотреть файл

@ -416,8 +416,7 @@ static int da9211_regulator_init(struct da9211 *chip)
/* /*
* I2C driver interface functions * I2C driver interface functions
*/ */
static int da9211_i2c_probe(struct i2c_client *i2c, static int da9211_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct da9211 *chip; struct da9211 *chip;
int error, ret; int error, ret;
@ -526,7 +525,7 @@ static struct i2c_driver da9211_regulator_driver = {
.name = "da9211", .name = "da9211",
.of_match_table = of_match_ptr(da9211_dt_ids), .of_match_table = of_match_ptr(da9211_dt_ids),
}, },
.probe = da9211_i2c_probe, .probe_new = da9211_i2c_probe,
.id_table = da9211_i2c_id, .id_table = da9211_i2c_id,
}; };

Просмотреть файл

@ -137,8 +137,7 @@ static const struct regmap_config isl9305_regmap = {
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
static int isl9305_i2c_probe(struct i2c_client *i2c, static int isl9305_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct regulator_config config = { }; struct regulator_config config = { };
struct isl9305_pdata *pdata = i2c->dev.platform_data; struct isl9305_pdata *pdata = i2c->dev.platform_data;
@ -198,7 +197,7 @@ static struct i2c_driver isl9305_regulator_driver = {
.name = "isl9305", .name = "isl9305",
.of_match_table = of_match_ptr(isl9305_dt_ids), .of_match_table = of_match_ptr(isl9305_dt_ids),
}, },
.probe = isl9305_i2c_probe, .probe_new = isl9305_i2c_probe,
.id_table = isl9305_i2c_id, .id_table = isl9305_i2c_id,
}; };

Просмотреть файл

@ -400,8 +400,7 @@ static int setup_regulators(struct lp3971 *lp3971,
return 0; return 0;
} }
static int lp3971_i2c_probe(struct i2c_client *i2c, static int lp3971_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct lp3971 *lp3971; struct lp3971 *lp3971;
struct lp3971_platform_data *pdata = dev_get_platdata(&i2c->dev); struct lp3971_platform_data *pdata = dev_get_platdata(&i2c->dev);
@ -449,7 +448,7 @@ static struct i2c_driver lp3971_i2c_driver = {
.driver = { .driver = {
.name = "LP3971", .name = "LP3971",
}, },
.probe = lp3971_i2c_probe, .probe_new = lp3971_i2c_probe,
.id_table = lp3971_i2c_id, .id_table = lp3971_i2c_id,
}; };

Просмотреть файл

@ -301,8 +301,7 @@ static irqreturn_t ltc3676_isr(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int ltc3676_regulator_probe(struct i2c_client *client, static int ltc3676_regulator_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct regulator_init_data *init_data = dev_get_platdata(dev); struct regulator_init_data *init_data = dev_get_platdata(dev);
@ -380,7 +379,7 @@ static struct i2c_driver ltc3676_driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.of_match_table = of_match_ptr(ltc3676_of_match), .of_match_table = of_match_ptr(ltc3676_of_match),
}, },
.probe = ltc3676_regulator_probe, .probe_new = ltc3676_regulator_probe,
.id_table = ltc3676_i2c_id, .id_table = ltc3676_i2c_id,
}; };
module_i2c_driver(ltc3676_driver); module_i2c_driver(ltc3676_driver);

Просмотреть файл

@ -85,8 +85,7 @@ static const struct regulator_desc mt6311_regulators[] = {
/* /*
* I2C driver interface functions * I2C driver interface functions
*/ */
static int mt6311_i2c_probe(struct i2c_client *i2c, static int mt6311_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct regulator_config config = { }; struct regulator_config config = { };
struct regulator_dev *rdev; struct regulator_dev *rdev;
@ -154,7 +153,7 @@ static struct i2c_driver mt6311_regulator_driver = {
.name = "mt6311", .name = "mt6311",
.of_match_table = of_match_ptr(mt6311_dt_ids), .of_match_table = of_match_ptr(mt6311_dt_ids),
}, },
.probe = mt6311_i2c_probe, .probe_new = mt6311_i2c_probe,
.id_table = mt6311_i2c_id, .id_table = mt6311_i2c_id,
}; };

Просмотреть файл

@ -279,8 +279,7 @@ error_i2c:
/* /*
* I2C driver interface functions * I2C driver interface functions
*/ */
static int pv88060_i2c_probe(struct i2c_client *i2c, static int pv88060_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev); struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev);
struct pv88060 *chip; struct pv88060 *chip;
@ -385,7 +384,7 @@ static struct i2c_driver pv88060_regulator_driver = {
.name = "pv88060", .name = "pv88060",
.of_match_table = of_match_ptr(pv88060_dt_ids), .of_match_table = of_match_ptr(pv88060_dt_ids),
}, },
.probe = pv88060_i2c_probe, .probe_new = pv88060_i2c_probe,
.id_table = pv88060_i2c_id, .id_table = pv88060_i2c_id,
}; };

Просмотреть файл

@ -272,8 +272,7 @@ error_i2c:
/* /*
* I2C driver interface functions * I2C driver interface functions
*/ */
static int pv88090_i2c_probe(struct i2c_client *i2c, static int pv88090_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev); struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev);
struct pv88090 *chip; struct pv88090 *chip;
@ -406,7 +405,7 @@ static struct i2c_driver pv88090_regulator_driver = {
.name = "pv88090", .name = "pv88090",
.of_match_table = of_match_ptr(pv88090_dt_ids), .of_match_table = of_match_ptr(pv88090_dt_ids),
}, },
.probe = pv88090_i2c_probe, .probe_new = pv88090_i2c_probe,
.id_table = pv88090_i2c_id, .id_table = pv88090_i2c_id,
}; };

Просмотреть файл

@ -439,8 +439,7 @@ static void slg51000_clear_fault_log(struct slg51000 *chip)
dev_dbg(chip->dev, "Fault log: FLT_POR\n"); dev_dbg(chip->dev, "Fault log: FLT_POR\n");
} }
static int slg51000_i2c_probe(struct i2c_client *client, static int slg51000_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct slg51000 *chip; struct slg51000 *chip;
@ -509,7 +508,7 @@ static struct i2c_driver slg51000_regulator_driver = {
.driver = { .driver = {
.name = "slg51000-regulator", .name = "slg51000-regulator",
}, },
.probe = slg51000_i2c_probe, .probe_new = slg51000_i2c_probe,
.id_table = slg51000_i2c_id, .id_table = slg51000_i2c_id,
}; };

Просмотреть файл

@ -61,8 +61,7 @@ static const struct regulator_desc sy8106a_reg = {
/* /*
* I2C driver interface functions * I2C driver interface functions
*/ */
static int sy8106a_i2c_probe(struct i2c_client *i2c, static int sy8106a_i2c_probe(struct i2c_client *i2c)
const struct i2c_device_id *id)
{ {
struct device *dev = &i2c->dev; struct device *dev = &i2c->dev;
struct regulator_dev *rdev; struct regulator_dev *rdev;
@ -141,7 +140,7 @@ static struct i2c_driver sy8106a_regulator_driver = {
.name = "sy8106a", .name = "sy8106a",
.of_match_table = of_match_ptr(sy8106a_i2c_of_match), .of_match_table = of_match_ptr(sy8106a_i2c_of_match),
}, },
.probe = sy8106a_i2c_probe, .probe_new = sy8106a_i2c_probe,
.id_table = sy8106a_i2c_id, .id_table = sy8106a_i2c_id,
}; };

Просмотреть файл

@ -112,8 +112,7 @@ static const struct regmap_config sy8824_regmap_config = {
.val_bits = 8, .val_bits = 8,
}; };
static int sy8824_i2c_probe(struct i2c_client *client, static int sy8824_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
@ -222,7 +221,7 @@ static struct i2c_driver sy8824_regulator_driver = {
.name = "sy8824-regulator", .name = "sy8824-regulator",
.of_match_table = of_match_ptr(sy8824_dt_ids), .of_match_table = of_match_ptr(sy8824_dt_ids),
}, },
.probe = sy8824_i2c_probe, .probe_new = sy8824_i2c_probe,
.id_table = sy8824_id, .id_table = sy8824_id,
}; };
module_i2c_driver(sy8824_regulator_driver); module_i2c_driver(sy8824_regulator_driver);

Просмотреть файл

@ -220,8 +220,7 @@ static const struct regmap_config tps65132_regmap_config = {
.wr_table = &tps65132_no_reg_table, .wr_table = &tps65132_no_reg_table,
}; };
static int tps65132_probe(struct i2c_client *client, static int tps65132_probe(struct i2c_client *client)
const struct i2c_device_id *client_id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct tps65132_regulator *tps; struct tps65132_regulator *tps;
@ -272,7 +271,7 @@ static struct i2c_driver tps65132_i2c_driver = {
.driver = { .driver = {
.name = "tps65132", .name = "tps65132",
}, },
.probe = tps65132_probe, .probe_new = tps65132_probe,
.id_table = tps65132_id, .id_table = tps65132_id,
}; };