[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1378273082-28305-7-git-send-email-sachin.kamat@linaro.org>
Date: Wed, 4 Sep 2013 11:08:00 +0530
From: Sachin Kamat <sachin.kamat@...aro.org>
To: linux-kernel@...r.kernel.org
Cc: broonie@...nel.org, sachin.kamat@...aro.org,
kyungmin.park@...sung.com, myungjoo.ham@...sung.com,
ldewangan@...dia.com, jack.yoo@...im-ic.com,
haojian.zhuang@...vell.com, jonghwa3.lee@...sung.com
Subject: [PATCH 7/9] regulator: max8973-regulator: Use devm_regulator_register
devm_* simplifies the code.
Signed-off-by: Sachin Kamat <sachin.kamat@...aro.org>
---
drivers/regulator/max8973-regulator.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index 0c5195a..04de63d 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -467,7 +467,7 @@ static int max8973_probe(struct i2c_client *client,
config.regmap = max->regmap;
/* Register the regulators */
- rdev = regulator_register(&max->desc, &config);
+ rdev = devm_regulator_register(&client->dev, &max->desc, &config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(max->dev, "regulator register failed, err %d\n", ret);
@@ -478,14 +478,6 @@ static int max8973_probe(struct i2c_client *client,
return 0;
}
-static int max8973_remove(struct i2c_client *client)
-{
- struct max8973_chip *max = i2c_get_clientdata(client);
-
- regulator_unregister(max->rdev);
- return 0;
-}
-
static const struct i2c_device_id max8973_id[] = {
{.name = "max8973",},
{},
@@ -499,7 +491,6 @@ static struct i2c_driver max8973_i2c_driver = {
.owner = THIS_MODULE,
},
.probe = max8973_probe,
- .remove = max8973_remove,
.id_table = max8973_id,
};
--
1.7.9.5
--
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