diff options
| author | Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> | 2014-03-08 18:30:05 +0200 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-11-24 14:33:57 +0100 |
| commit | 443164cb72f3282808fc5907de0040e71973b623 (patch) | |
| tree | 898a9fba1cc14acf4b84beffcc39d1260b782e6d | |
| parent | d51daac2fc60d7994c44c71b9da957551c41b756 (diff) | |
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 <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/android/timed_gpio.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c index ae9966d1f..df43eea43 100644 --- a/drivers/staging/android/timed_gpio.c +++ b/drivers/staging/android/timed_gpio.c @@ -91,8 +91,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; @@ -132,7 +133,6 @@ err_out: timed_output_dev_unregister(&gpio_data[i].dev); gpio_free(gpio_data[i].gpio); } - kfree(gpio_data); return ret; } @@ -148,8 +148,6 @@ static int timed_gpio_remove(struct platform_device *pdev) gpio_free(gpio_data[i].gpio); } - kfree(gpio_data); - return 0; } |
