Skip to content

Commit

Permalink
mfd: pcf50633-adc: Use devm_*() functions
Browse files Browse the repository at this point in the history
Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Jingoo Han authored and Lee Jones committed Aug 20, 2013
1 parent bba0782 commit 8a105ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mfd/pcf50633-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static int pcf50633_adc_probe(struct platform_device *pdev)
{
struct pcf50633_adc *adc;

adc = kzalloc(sizeof(*adc), GFP_KERNEL);
adc = devm_kzalloc(&pdev->dev, sizeof(*adc), GFP_KERNEL);
if (!adc)
return -ENOMEM;

Expand Down Expand Up @@ -236,7 +236,6 @@ static int pcf50633_adc_remove(struct platform_device *pdev)
kfree(adc->queue[i]);

mutex_unlock(&adc->queue_mutex);
kfree(adc);

return 0;
}
Expand Down

0 comments on commit 8a105ca

Please sign in to comment.