summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-23 16:25:11 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 12:11:42 +0200
commit099053a497638a928dac278bd95f192220c3cde1 (patch)
treeba864c1bd924753b22a498e8d75f645d99722e7a
parent22f9ee756bfd9ce9b066e2f90cf9f002aa7d1d44 (diff)
downloadblackbird-op-linux-099053a497638a928dac278bd95f192220c3cde1.tar.gz
blackbird-op-linux-099053a497638a928dac278bd95f192220c3cde1.zip
mfd: davinci_voicecodec: Convert to managed resources for allocating memory
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/davinci_voicecodec.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index c60ab0c3c4db..b6e297363946 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -50,7 +50,8 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
struct mfd_cell *cell = NULL;
int ret;
- davinci_vc = kzalloc(sizeof(struct davinci_vc), GFP_KERNEL);
+ davinci_vc = devm_kzalloc(&pdev->dev,
+ sizeof(struct davinci_vc), GFP_KERNEL);
if (!davinci_vc) {
dev_dbg(&pdev->dev,
"could not allocate memory for private data\n");
@@ -61,8 +62,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
if (IS_ERR(davinci_vc->clk)) {
dev_dbg(&pdev->dev,
"could not get the clock for voice codec\n");
- ret = -ENODEV;
- goto fail1;
+ return -ENODEV;
}
clk_enable(davinci_vc->clk);
@@ -145,8 +145,6 @@ fail2:
clk_disable(davinci_vc->clk);
clk_put(davinci_vc->clk);
davinci_vc->clk = NULL;
-fail1:
- kfree(davinci_vc);
return ret;
}
@@ -164,8 +162,6 @@ static int davinci_vc_remove(struct platform_device *pdev)
clk_put(davinci_vc->clk);
davinci_vc->clk = NULL;
- kfree(davinci_vc);
-
return 0;
}
OpenPOWER on IntegriCloud