summaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-08-08 10:03:16 +0200
committerRoger Quadros <rogerq@ti.com>2016-08-29 11:00:23 +0300
commit525fe43f55ff6d110680bb3d750bed3dda01b989 (patch)
tree886ca74b239c94fd4d243fc8058e50e9c649b07b /drivers/memory
parent3f41a3c46727283a353f9a3fd510a4fc3d1c26b5 (diff)
downloadop-kernel-dev-525fe43f55ff6d110680bb3d750bed3dda01b989.zip
op-kernel-dev-525fe43f55ff6d110680bb3d750bed3dda01b989.tar.gz
memory: omap-gpmc: use devm_gpiochip_add_data()
This saves a few codelines in the driver. Cc: Roger Quadros <rogerq@ti.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Roger Quadros <rogerq@ti.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/omap-gpmc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index e138875..e5f9c17 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2264,7 +2264,7 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc)
gpmc->gpio_chip.get = gpmc_gpio_get;
gpmc->gpio_chip.base = -1;
- ret = gpiochip_add(&gpmc->gpio_chip);
+ ret = devm_gpiochip_add_data(gpmc->dev, &gpmc->gpio_chip, NULL);
if (ret < 0) {
dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret);
return ret;
@@ -2273,11 +2273,6 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc)
return 0;
}
-static void gpmc_gpio_exit(struct gpmc_device *gpmc)
-{
- gpiochip_remove(&gpmc->gpio_chip);
-}
-
static int gpmc_probe(struct platform_device *pdev)
{
int rc;
@@ -2364,7 +2359,7 @@ static int gpmc_probe(struct platform_device *pdev)
rc = gpmc_setup_irq(gpmc);
if (rc) {
dev_err(gpmc->dev, "gpmc_setup_irq failed\n");
- goto setup_irq_failed;
+ goto gpio_init_failed;
}
rc = gpmc_probe_dt_children(pdev);
@@ -2377,8 +2372,6 @@ static int gpmc_probe(struct platform_device *pdev)
dt_children_failed:
gpmc_free_irq(gpmc);
-setup_irq_failed:
- gpmc_gpio_exit(gpmc);
gpio_init_failed:
gpmc_mem_exit();
pm_runtime_put_sync(&pdev->dev);
@@ -2392,7 +2385,6 @@ static int gpmc_remove(struct platform_device *pdev)
struct gpmc_device *gpmc = platform_get_drvdata(pdev);
gpmc_free_irq(gpmc);
- gpmc_gpio_exit(gpmc);
gpmc_mem_exit();
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
OpenPOWER on IntegriCloud