mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
gpio: ich: Use devm_gpiochip_add_data() to simplify remove path
Use devm version of gpiochip add function to handle removal for us. Signed-off-by: Andrew Davis <afd@ti.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
9409d8cf78
commit
56b16a9a80
@ -457,7 +457,7 @@ static int ichx_gpio_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
init:
|
init:
|
||||||
ichx_gpiolib_setup(&ichx_priv.chip);
|
ichx_gpiolib_setup(&ichx_priv.chip);
|
||||||
err = gpiochip_add_data(&ichx_priv.chip, NULL);
|
err = devm_gpiochip_add_data(dev, &ichx_priv.chip, NULL);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to register GPIOs\n");
|
dev_err(dev, "Failed to register GPIOs\n");
|
||||||
return err;
|
return err;
|
||||||
@ -469,19 +469,11 @@ init:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ichx_gpio_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
gpiochip_remove(&ichx_priv.chip);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver ichx_gpio_driver = {
|
static struct platform_driver ichx_gpio_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
},
|
},
|
||||||
.probe = ichx_gpio_probe,
|
.probe = ichx_gpio_probe,
|
||||||
.remove = ichx_gpio_remove,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_platform_driver(ichx_gpio_driver);
|
module_platform_driver(ichx_gpio_driver);
|
||||||
|
Loading…
Reference in New Issue
Block a user