diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/fixed.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 40f38030b394..7d4f381d55af 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c | |||
@@ -176,7 +176,8 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev) | |||
176 | if (!config) | 176 | if (!config) |
177 | return -ENOMEM; | 177 | return -ENOMEM; |
178 | 178 | ||
179 | drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL); | 179 | drvdata = devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data), |
180 | GFP_KERNEL); | ||
180 | if (drvdata == NULL) { | 181 | if (drvdata == NULL) { |
181 | dev_err(&pdev->dev, "Failed to allocate device data\n"); | 182 | dev_err(&pdev->dev, "Failed to allocate device data\n"); |
182 | ret = -ENOMEM; | 183 | ret = -ENOMEM; |
@@ -270,7 +271,6 @@ err_gpio: | |||
270 | err_name: | 271 | err_name: |
271 | kfree(drvdata->desc.name); | 272 | kfree(drvdata->desc.name); |
272 | err: | 273 | err: |
273 | kfree(drvdata); | ||
274 | return ret; | 274 | return ret; |
275 | } | 275 | } |
276 | 276 | ||
@@ -282,7 +282,6 @@ static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev) | |||
282 | if (gpio_is_valid(drvdata->gpio)) | 282 | if (gpio_is_valid(drvdata->gpio)) |
283 | gpio_free(drvdata->gpio); | 283 | gpio_free(drvdata->gpio); |
284 | kfree(drvdata->desc.name); | 284 | kfree(drvdata->desc.name); |
285 | kfree(drvdata); | ||
286 | 285 | ||
287 | return 0; | 286 | return 0; |
288 | } | 287 | } |