diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-11 02:40:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-11 05:16:50 -0400 |
commit | 9eb0c4218aa444f863e7f54909351d5b4f0fac06 (patch) | |
tree | bcb7413f475d7e67d93d3bb1826f2eb3ef7479b1 /drivers/regulator/tps6524x-regulator.c | |
parent | d914d81b74fd4e91aed334c3f664be4b94364ee8 (diff) |
regulator: Convert tps65xxx regulator drivers to use devm_kzalloc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps6524x-regulator.c')
-rw-r--r-- | drivers/regulator/tps6524x-regulator.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c index 6616af7d2956..b88b3df82381 100644 --- a/drivers/regulator/tps6524x-regulator.c +++ b/drivers/regulator/tps6524x-regulator.c | |||
@@ -595,7 +595,6 @@ static int pmic_remove(struct spi_device *spi) | |||
595 | hw->rdev[i] = NULL; | 595 | hw->rdev[i] = NULL; |
596 | } | 596 | } |
597 | spi_set_drvdata(spi, NULL); | 597 | spi_set_drvdata(spi, NULL); |
598 | kfree(hw); | ||
599 | return 0; | 598 | return 0; |
600 | } | 599 | } |
601 | 600 | ||
@@ -614,7 +613,7 @@ static int __devinit pmic_probe(struct spi_device *spi) | |||
614 | return -EINVAL; | 613 | return -EINVAL; |
615 | } | 614 | } |
616 | 615 | ||
617 | hw = kzalloc(sizeof(struct tps6524x), GFP_KERNEL); | 616 | hw = devm_kzalloc(&spi->dev, sizeof(struct tps6524x), GFP_KERNEL); |
618 | if (!hw) { | 617 | if (!hw) { |
619 | dev_err(dev, "cannot allocate regulator private data\n"); | 618 | dev_err(dev, "cannot allocate regulator private data\n"); |
620 | return -ENOMEM; | 619 | return -ENOMEM; |