From: Fabio Estevam <festevam@gmail.com>
To: broonie@opensource.wolfsonmicro.com
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH v2 2/2] regulator: mc13892: Convert to devm_kzalloc()
Date: Thu, 29 Dec 2011 20:05:00 -0200 [thread overview]
Message-ID: <1325196300-3930-1-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1325174163-27955-2-git-send-email-festevam@gmail .com>
Convert mc13892-regulator driver to use devm_kzalloc().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Rebased against latest linux-next
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 46bfa4a..e8cfc99 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)
if (num_regulators <= 0)
return -EINVAL;
- priv = kzalloc(sizeof(*priv) +
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv) +
num_regulators * sizeof(priv->regulators[0]),
GFP_KERNEL);
if (!priv)
@@ -615,7 +615,6 @@ err:
err_free:
mc13xxx_unlock(mc13892);
- kfree(priv);
return ret;
}
@@ -630,7 +629,6 @@ static int __devexit mc13892_regulator_remove(struct platform_device *pdev)
for (i = 0; i < priv->num_regulators; i++)
regulator_unregister(priv->regulators[i]);
- kfree(priv);
return 0;
}
--
1.7.1
next parent reply other threads:[~2011-12-29 22:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1325174163-27955-2-git-send-email-festevam@gmail .com>
2011-12-29 22:05 ` Fabio Estevam [this message]
2011-12-30 2:07 ` Mark Brown
2011-12-29 15:56 [PATCH 1/2] regulator: mc13783: " Fabio Estevam
2011-12-29 15:56 ` [PATCH 2/2] regulator: mc13892: " Fabio Estevam
2011-12-29 17:59 ` Mark Brown
2011-12-29 17:59 ` [PATCH 1/2] regulator: mc13783: " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325196300-3930-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome