Skip to content

Commit

Permalink
Regulators: max8925-regulator - clean up driver data after removal
Browse files Browse the repository at this point in the history
It is a good tone to reset driver data after unbinding the device.
Also change find_regulator_info() fro inline to __devinit - let compiler
figure out if it wants it to be inlined or not.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Dmitry Torokhov authored and Liam Girdwood committed Mar 22, 2010
1 parent 220bf99 commit 3fff6c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/regulator/max8925-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static struct max8925_regulator_info max8925_regulator_info[] = {
MAX8925_LDO(20, 750, 3900, 50),
};

static inline struct max8925_regulator_info *find_regulator_info(int id)
static struct max8925_regulator_info * __devinit find_regulator_info(int id)
{
struct max8925_regulator_info *ri;
int i;
Expand All @@ -247,7 +247,7 @@ static int __devinit max8925_regulator_probe(struct platform_device *pdev)
{
struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct max8925_platform_data *pdata = chip->dev->platform_data;
struct max8925_regulator_info *ri = NULL;
struct max8925_regulator_info *ri;
struct regulator_dev *rdev;

ri = find_regulator_info(pdev->id);
Expand All @@ -274,7 +274,9 @@ static int __devexit max8925_regulator_remove(struct platform_device *pdev)
{
struct regulator_dev *rdev = platform_get_drvdata(pdev);

platform_set_drvdata(pdev, NULL);
regulator_unregister(rdev);

return 0;
}

Expand Down

0 comments on commit 3fff6c0

Please sign in to comment.