diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2016-08-08 04:03:16 -0400 |
|---|---|---|
| committer | Roger Quadros <rogerq@ti.com> | 2016-08-29 04:00:23 -0400 |
| commit | 525fe43f55ff6d110680bb3d750bed3dda01b989 (patch) | |
| tree | 886ca74b239c94fd4d243fc8058e50e9c649b07b /drivers/memory | |
| parent | 3f41a3c46727283a353f9a3fd510a4fc3d1c26b5 (diff) | |
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.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index e138875a3196..e5f9c1783226 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) | |||
| 2264 | gpmc->gpio_chip.get = gpmc_gpio_get; | 2264 | gpmc->gpio_chip.get = gpmc_gpio_get; |
| 2265 | gpmc->gpio_chip.base = -1; | 2265 | gpmc->gpio_chip.base = -1; |
| 2266 | 2266 | ||
| 2267 | ret = gpiochip_add(&gpmc->gpio_chip); | 2267 | ret = devm_gpiochip_add_data(gpmc->dev, &gpmc->gpio_chip, NULL); |
| 2268 | if (ret < 0) { | 2268 | if (ret < 0) { |
| 2269 | dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret); | 2269 | dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret); |
| 2270 | return ret; | 2270 | return ret; |
| @@ -2273,11 +2273,6 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc) | |||
| 2273 | return 0; | 2273 | return 0; |
| 2274 | } | 2274 | } |
| 2275 | 2275 | ||
| 2276 | static void gpmc_gpio_exit(struct gpmc_device *gpmc) | ||
| 2277 | { | ||
| 2278 | gpiochip_remove(&gpmc->gpio_chip); | ||
| 2279 | } | ||
| 2280 | |||
| 2281 | static int gpmc_probe(struct platform_device *pdev) | 2276 | static int gpmc_probe(struct platform_device *pdev) |
| 2282 | { | 2277 | { |
| 2283 | int rc; | 2278 | int rc; |
| @@ -2364,7 +2359,7 @@ static int gpmc_probe(struct platform_device *pdev) | |||
| 2364 | rc = gpmc_setup_irq(gpmc); | 2359 | rc = gpmc_setup_irq(gpmc); |
| 2365 | if (rc) { | 2360 | if (rc) { |
| 2366 | dev_err(gpmc->dev, "gpmc_setup_irq failed\n"); | 2361 | dev_err(gpmc->dev, "gpmc_setup_irq failed\n"); |
| 2367 | goto setup_irq_failed; | 2362 | goto gpio_init_failed; |
| 2368 | } | 2363 | } |
| 2369 | 2364 | ||
| 2370 | rc = gpmc_probe_dt_children(pdev); | 2365 | rc = gpmc_probe_dt_children(pdev); |
| @@ -2377,8 +2372,6 @@ static int gpmc_probe(struct platform_device *pdev) | |||
| 2377 | 2372 | ||
| 2378 | dt_children_failed: | 2373 | dt_children_failed: |
| 2379 | gpmc_free_irq(gpmc); | 2374 | gpmc_free_irq(gpmc); |
| 2380 | setup_irq_failed: | ||
| 2381 | gpmc_gpio_exit(gpmc); | ||
| 2382 | gpio_init_failed: | 2375 | gpio_init_failed: |
| 2383 | gpmc_mem_exit(); | 2376 | gpmc_mem_exit(); |
| 2384 | pm_runtime_put_sync(&pdev->dev); | 2377 | pm_runtime_put_sync(&pdev->dev); |
| @@ -2392,7 +2385,6 @@ static int gpmc_remove(struct platform_device *pdev) | |||
| 2392 | struct gpmc_device *gpmc = platform_get_drvdata(pdev); | 2385 | struct gpmc_device *gpmc = platform_get_drvdata(pdev); |
| 2393 | 2386 | ||
| 2394 | gpmc_free_irq(gpmc); | 2387 | gpmc_free_irq(gpmc); |
| 2395 | gpmc_gpio_exit(gpmc); | ||
| 2396 | gpmc_mem_exit(); | 2388 | gpmc_mem_exit(); |
| 2397 | pm_runtime_put_sync(&pdev->dev); | 2389 | pm_runtime_put_sync(&pdev->dev); |
| 2398 | pm_runtime_disable(&pdev->dev); | 2390 | pm_runtime_disable(&pdev->dev); |
