浏览代码

gpio: janz-ttl: 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>
Laxman Dewangan 9 年之前
父节点
当前提交
abeb3f4029
共有 1 个文件被更改,包括 1 次插入11 次删除
  1. 1 11
      drivers/gpio/gpio-janz-ttl.c

+ 1 - 11
drivers/gpio/gpio-janz-ttl.c

@@ -182,7 +182,7 @@ static int ttl_probe(struct platform_device *pdev)
 	gpio->base = -1;
 	gpio->base = -1;
 	gpio->ngpio = 20;
 	gpio->ngpio = 20;
 
 
-	ret = gpiochip_add_data(gpio, NULL);
+	ret = devm_gpiochip_add_data(dev, gpio, NULL);
 	if (ret) {
 	if (ret) {
 		dev_err(dev, "unable to add GPIO chip\n");
 		dev_err(dev, "unable to add GPIO chip\n");
 		return ret;
 		return ret;
@@ -191,21 +191,11 @@ static int ttl_probe(struct platform_device *pdev)
 	return 0;
 	return 0;
 }
 }
 
 
-static int ttl_remove(struct platform_device *pdev)
-{
-	struct ttl_module *mod = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&mod->gpio);
-
-	return 0;
-}
-
 static struct platform_driver ttl_driver = {
 static struct platform_driver ttl_driver = {
 	.driver		= {
 	.driver		= {
 		.name	= DRV_NAME,
 		.name	= DRV_NAME,
 	},
 	},
 	.probe		= ttl_probe,
 	.probe		= ttl_probe,
-	.remove		= ttl_remove,
 };
 };
 
 
 module_platform_driver(ttl_driver);
 module_platform_driver(ttl_driver);