From: Georgiana Rodica Chelu Date: Sat, 8 Mar 2014 16:30:05 +0000 (+0200) Subject: staging: android: Use devm_kzalloc instead of kzalloc X-Git-Tag: firefly_0821_release~176^2~4193^2~499 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=48be81830eb72ce95b33075cce9fdfa39443dce6;p=firefly-linux-kernel-4.4.55.git staging: android: Use devm_kzalloc instead of kzalloc Use devm_kzalloc instead of kzalloc in staging/android/timed_gpio.c Signed-off-by: Georgiana Rodica Chelu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c index e81451425c01..3f69b3481779 100644 --- a/drivers/staging/android/timed_gpio.c +++ b/drivers/staging/android/timed_gpio.c @@ -90,8 +90,9 @@ static int timed_gpio_probe(struct platform_device *pdev) if (!pdata) return -EBUSY; - gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios, - GFP_KERNEL); + gpio_data = devm_kzalloc(&pdev->dev, + sizeof(struct timed_gpio_data) * pdata->num_gpios, + GFP_KERNEL); if (!gpio_data) return -ENOMEM; @@ -131,7 +132,6 @@ err_out: timed_output_dev_unregister(&gpio_data[i].dev); gpio_free(gpio_data[i].gpio); } - kfree(gpio_data); return ret; } @@ -147,8 +147,6 @@ static int timed_gpio_remove(struct platform_device *pdev) gpio_free(gpio_data[i].gpio); } - kfree(gpio_data); - return 0; }