From 2e8996b236aff218476b14b78b740e3238801338 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 3 Apr 2012 23:20:56 +0100 Subject: [PATCH] --- yaml --- r: 302147 b: refs/heads/master c: 02b552160f955a6dd6a54600f262365dc8916d69 h: refs/heads/master i: 302145: 10e2e59f3ad980cc569cfb2af7ae1103dbb133cb 302143: 04905db0639720a908dbd3b9dc148c038880763f v: v3 --- [refs] | 2 +- trunk/drivers/regulator/gpio-regulator.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 754e452fdaf8..8e55730fdfd9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 69d715a142f393bbcf1c05b440c074bed2aa0416 +refs/heads/master: 02b552160f955a6dd6a54600f262365dc8916d69 diff --git a/trunk/drivers/regulator/gpio-regulator.c b/trunk/drivers/regulator/gpio-regulator.c index 5f9b6add5d1d..ad0fc78c3cb4 100644 --- a/trunk/drivers/regulator/gpio-regulator.c +++ b/trunk/drivers/regulator/gpio-regulator.c @@ -174,7 +174,8 @@ static int __devinit gpio_regulator_probe(struct platform_device *pdev) struct gpio_regulator_data *drvdata; int ptr, ret, state; - drvdata = kzalloc(sizeof(struct gpio_regulator_data), GFP_KERNEL); + drvdata = devm_kzalloc(&pdev->dev, sizeof(struct gpio_regulator_data), + GFP_KERNEL); if (drvdata == NULL) { dev_err(&pdev->dev, "Failed to allocate device data\n"); return -ENOMEM; @@ -307,7 +308,6 @@ static int __devinit gpio_regulator_probe(struct platform_device *pdev) err_name: kfree(drvdata->desc.name); err: - kfree(drvdata); return ret; } @@ -326,7 +326,6 @@ static int __devexit gpio_regulator_remove(struct platform_device *pdev) gpio_free(drvdata->enable_gpio); kfree(drvdata->desc.name); - kfree(drvdata); return 0; }