[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <000e01ceb9c4$bf4d5d10$3de81730$%han@samsung.com>
Date: Wed, 25 Sep 2013 16:56:31 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Mark Brown' <broonie@...nel.org>
Cc: 'Liam Girdwood' <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, 'Jingoo Han' <jg1.han@...sung.com>,
'Steve Twiss' <stwiss.opensource@...semi.com>,
'David Dajun Chen' <david.chen@...semi.com>
Subject: [PATCH 05/20] regulator: da9210: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: Jingoo Han <jg1.han@...sung.com>
---
drivers/regulator/da9210-regulator.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
index f0fe54b..82368a3 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -152,7 +152,7 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
config.driver_data = chip;
config.regmap = chip->regmap;
- rdev = regulator_register(&da9210_reg, &config);
+ rdev = devm_regulator_register(&i2c->dev, &da9210_reg, &config);
if (IS_ERR(rdev)) {
dev_err(&i2c->dev, "Failed to register DA9210 regulator\n");
return PTR_ERR(rdev);
@@ -165,13 +165,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
return 0;
}
-static int da9210_i2c_remove(struct i2c_client *i2c)
-{
- struct da9210 *chip = i2c_get_clientdata(i2c);
- regulator_unregister(chip->rdev);
- return 0;
-}
-
static const struct i2c_device_id da9210_i2c_id[] = {
{"da9210", 0},
{},
@@ -185,7 +178,6 @@ static struct i2c_driver da9210_regulator_driver = {
.owner = THIS_MODULE,
},
.probe = da9210_i2c_probe,
- .remove = da9210_i2c_remove,
.id_table = da9210_i2c_id,
};
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists