Unverified Commit 77e29598 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20200109155808.22003-1-axel.lin@ingics.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7eec6786
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -131,8 +131,7 @@ static const struct of_device_id da9210_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, da9210_dt_ids);

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

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

+2 −3
Original line number Diff line number Diff line
@@ -137,8 +137,7 @@ static const struct regmap_config isl9305_regmap = {
	.cache_type = REGCACHE_RBTREE,
};

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

+2 −3
Original line number Diff line number Diff line
@@ -400,8 +400,7 @@ static int setup_regulators(struct lp3971 *lp3971,
	return 0;
}

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

+2 −3
Original line number Diff line number Diff line
@@ -301,8 +301,7 @@ static irqreturn_t ltc3676_isr(int irq, void *dev_id)
	return IRQ_HANDLED;
}

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