mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
mfd: pcf50633-adc: Use devm_*() functions
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>
This commit is contained in:
parent
bba078273e
commit
8a105ca202
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user