[PATCH 2/2] regulator: tps65218: Remove unnecessary regulator_unregister call
From: Axel Lin
Date: Tue Feb 18 2014 - 07:23:04 EST
Current code uses devm_regulator_register() so the we don't need to explicitly
call regulator_unregister() in .remove.
And then we don't need to save rdev pointer to tps->rdev[id].
Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
---
drivers/regulator/tps65218-regulator.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 00c0114..cec72fa 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -265,23 +265,6 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
return PTR_ERR(rdev);
}
- /* Save regulator */
- tps->rdev[id] = rdev;
-
- return 0;
-}
-
-static int tps65218_regulator_remove(struct platform_device *pdev)
-{
- struct tps65218 *tps = platform_get_drvdata(pdev);
- const struct of_device_id *match;
- const struct tps_info *template;
-
- match = of_match_device(tps65218_of_match, &pdev->dev);
- template = match->data;
- regulator_unregister(tps->rdev[template->id]);
- platform_set_drvdata(pdev, NULL);
-
return 0;
}
@@ -292,7 +275,6 @@ static struct platform_driver tps65218_regulator_driver = {
.of_match_table = tps65218_of_match,
},
.probe = tps65218_regulator_probe,
- .remove = tps65218_regulator_remove,
};
module_platform_driver(tps65218_regulator_driver);
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/