aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
50 struct mfd_cell *cell = NULL; 50 struct mfd_cell *cell = NULL;
51 int ret; 51 int ret;
52 52
53 davinci_vc = kzalloc(sizeof(struct davinci_vc), GFP_KERNEL); 53 davinci_vc = devm_kzalloc(&pdev->dev,
54 sizeof(struct davinci_vc), GFP_KERNEL);
54 if (!davinci_vc) { 55 if (!davinci_vc) {
55 dev_dbg(&pdev->dev, 56 dev_dbg(&pdev->dev,
56 "could not allocate memory for private data\n"); 57 "could not allocate memory for private data\n");
@@ -61,8 +62,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
61 if (IS_ERR(davinci_vc->clk)) { 62 if (IS_ERR(davinci_vc->clk)) {
62 dev_dbg(&pdev->dev, 63 dev_dbg(&pdev->dev,
63 "could not get the clock for voice codec\n"); 64 "could not get the clock for voice codec\n");
64 ret = -ENODEV; 65 return -ENODEV;
65 goto fail1;
66 } 66 }
67 clk_enable(davinci_vc->clk); 67 clk_enable(davinci_vc->clk);
68 68
@@ -145,8 +145,6 @@ fail2:
145 clk_disable(davinci_vc->clk); 145 clk_disable(davinci_vc->clk);
146 clk_put(davinci_vc->clk); 146 clk_put(davinci_vc->clk);
147 davinci_vc->clk = NULL; 147 davinci_vc->clk = NULL;
148fail1:
149 kfree(davinci_vc);
150 148
151 return ret; 149 return ret;
152} 150}
@@ -164,8 +162,6 @@ static int davinci_vc_remove(struct platform_device *pdev)
164 clk_put(davinci_vc->clk); 162 clk_put(davinci_vc->clk);
165 davinci_vc->clk = NULL; 163 davinci_vc->clk = NULL;
166 164
167 kfree(davinci_vc);
168
169 return 0; 165 return 0;
170} 166}
171 167