gpio: rc5t583: Use devm_gpiochip_add_data() for gpio registration

Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
This commit is contained in:
Laxman Dewangan 2016-02-22 17:43:28 +05:30
parent 297bf067ec
commit bc72f7f7b8
1 changed files with 2 additions and 10 deletions

View File

@ -136,15 +136,8 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rc5t583_gpio); platform_set_drvdata(pdev, rc5t583_gpio);
return gpiochip_add_data(&rc5t583_gpio->gpio_chip, rc5t583_gpio); return devm_gpiochip_add_data(&pdev->dev, &rc5t583_gpio->gpio_chip,
} rc5t583_gpio);
static int rc5t583_gpio_remove(struct platform_device *pdev)
{
struct rc5t583_gpio *rc5t583_gpio = platform_get_drvdata(pdev);
gpiochip_remove(&rc5t583_gpio->gpio_chip);
return 0;
} }
static struct platform_driver rc5t583_gpio_driver = { static struct platform_driver rc5t583_gpio_driver = {
@ -152,7 +145,6 @@ static struct platform_driver rc5t583_gpio_driver = {
.name = "rc5t583-gpio", .name = "rc5t583-gpio",
}, },
.probe = rc5t583_gpio_probe, .probe = rc5t583_gpio_probe,
.remove = rc5t583_gpio_remove,
}; };
static int __init rc5t583_gpio_init(void) static int __init rc5t583_gpio_init(void)