diff options
author | Fabio Estevam <festevam@gmail.com> | 2011-12-29 17:05:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-29 21:06:29 -0500 |
commit | 4fef21eaacb9d739f0120c930c78dac4f6875b9f (patch) | |
tree | 278968f2e1c4aa1d99072822dc3023e378f5ba7c /drivers/regulator | |
parent | cbe10a3674ba1cfa227d0d4e990353bada85fa09 (diff) |
regulator: mc13892: Convert to devm_kzalloc()
Convert mc13892-regulator driver to use devm_kzalloc().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/mc13892-regulator.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index 46bfa4ae2afd..e8cfc99dd8f0 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c | |||
@@ -538,7 +538,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
538 | if (num_regulators <= 0) | 538 | if (num_regulators <= 0) |
539 | return -EINVAL; | 539 | return -EINVAL; |
540 | 540 | ||
541 | priv = kzalloc(sizeof(*priv) + | 541 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv) + |
542 | num_regulators * sizeof(priv->regulators[0]), | 542 | num_regulators * sizeof(priv->regulators[0]), |
543 | GFP_KERNEL); | 543 | GFP_KERNEL); |
544 | if (!priv) | 544 | if (!priv) |
@@ -615,7 +615,6 @@ err: | |||
615 | 615 | ||
616 | err_free: | 616 | err_free: |
617 | mc13xxx_unlock(mc13892); | 617 | mc13xxx_unlock(mc13892); |
618 | kfree(priv); | ||
619 | 618 | ||
620 | return ret; | 619 | return ret; |
621 | } | 620 | } |
@@ -630,7 +629,6 @@ static int __devexit mc13892_regulator_remove(struct platform_device *pdev) | |||
630 | for (i = 0; i < priv->num_regulators; i++) | 629 | for (i = 0; i < priv->num_regulators; i++) |
631 | regulator_unregister(priv->regulators[i]); | 630 | regulator_unregister(priv->regulators[i]); |
632 | 631 | ||
633 | kfree(priv); | ||
634 | return 0; | 632 | return 0; |
635 | } | 633 | } |
636 | 634 | ||