提交 a718ed2c 编写于 作者: L Laxman Dewangan

gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration

Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.

Also remove the need of driver callback .remove.
Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
上级 77ae582c
...@@ -140,15 +140,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) ...@@ -140,15 +140,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
return gpiochip_add_data(&priv->gc, priv); return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
}
static int mmio_74xx_gpio_remove(struct platform_device *pdev)
{
struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev);
gpiochip_remove(&priv->gc);
return 0;
} }
static struct platform_driver mmio_74xx_gpio_driver = { static struct platform_driver mmio_74xx_gpio_driver = {
...@@ -157,7 +149,6 @@ static struct platform_driver mmio_74xx_gpio_driver = { ...@@ -157,7 +149,6 @@ static struct platform_driver mmio_74xx_gpio_driver = {
.of_match_table = mmio_74xx_gpio_ids, .of_match_table = mmio_74xx_gpio_ids,
}, },
.probe = mmio_74xx_gpio_probe, .probe = mmio_74xx_gpio_probe,
.remove = mmio_74xx_gpio_remove,
}; };
module_platform_driver(mmio_74xx_gpio_driver); module_platform_driver(mmio_74xx_gpio_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册