Commit 48be8183 authored by Georgiana Rodica Chelu's avatar Georgiana Rodica Chelu Committed by Greg Kroah-Hartman

staging: android: Use devm_kzalloc instead of kzalloc

Use devm_kzalloc instead of kzalloc in staging/android/timed_gpio.c
Signed-off-by: default avatarGeorgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f9d25c9
...@@ -90,7 +90,8 @@ static int timed_gpio_probe(struct platform_device *pdev) ...@@ -90,7 +90,8 @@ static int timed_gpio_probe(struct platform_device *pdev)
if (!pdata) if (!pdata)
return -EBUSY; return -EBUSY;
gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios, gpio_data = devm_kzalloc(&pdev->dev,
sizeof(struct timed_gpio_data) * pdata->num_gpios,
GFP_KERNEL); GFP_KERNEL);
if (!gpio_data) if (!gpio_data)
return -ENOMEM; return -ENOMEM;
...@@ -131,7 +132,6 @@ static int timed_gpio_probe(struct platform_device *pdev) ...@@ -131,7 +132,6 @@ static int timed_gpio_probe(struct platform_device *pdev)
timed_output_dev_unregister(&gpio_data[i].dev); timed_output_dev_unregister(&gpio_data[i].dev);
gpio_free(gpio_data[i].gpio); gpio_free(gpio_data[i].gpio);
} }
kfree(gpio_data);
return ret; return ret;
} }
...@@ -147,8 +147,6 @@ static int timed_gpio_remove(struct platform_device *pdev) ...@@ -147,8 +147,6 @@ static int timed_gpio_remove(struct platform_device *pdev)
gpio_free(gpio_data[i].gpio); gpio_free(gpio_data[i].gpio);
} }
kfree(gpio_data);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment