Skip to contentSkip to conversation

mfd: pcf50633-adc: use devm_*() functions

PATCH In review Jingoo Han 1 participant 1 message Aug 20, 2013 Multifunction devices (MFD)

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 4/6 mfd: pcf50633-adc: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

---
 drivers/mfd/pcf50633-adc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/pcf50633-adc.c +1 -2
index 18b53cb..b8941a5 100644
@@ -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;
 }
Signature · 1 line
1.7.10.4