diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/mc13783-regulator.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index 56d4a677c404..8e9b90ad88ae 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c | |||
@@ -344,7 +344,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) | |||
344 | 344 | ||
345 | dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); | 345 | dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); |
346 | 346 | ||
347 | priv = kzalloc(sizeof(*priv) + | 347 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv) + |
348 | pdata->num_regulators * sizeof(priv->regulators[0]), | 348 | pdata->num_regulators * sizeof(priv->regulators[0]), |
349 | GFP_KERNEL); | 349 | GFP_KERNEL); |
350 | if (!priv) | 350 | if (!priv) |
@@ -374,8 +374,6 @@ err: | |||
374 | while (--i >= 0) | 374 | while (--i >= 0) |
375 | regulator_unregister(priv->regulators[i]); | 375 | regulator_unregister(priv->regulators[i]); |
376 | 376 | ||
377 | kfree(priv); | ||
378 | |||
379 | return ret; | 377 | return ret; |
380 | } | 378 | } |
381 | 379 | ||
@@ -391,7 +389,6 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev) | |||
391 | for (i = 0; i < pdata->num_regulators; i++) | 389 | for (i = 0; i < pdata->num_regulators; i++) |
392 | regulator_unregister(priv->regulators[i]); | 390 | regulator_unregister(priv->regulators[i]); |
393 | 391 | ||
394 | kfree(priv); | ||
395 | return 0; | 392 | return 0; |
396 | } | 393 | } |
397 | 394 | ||