public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] OneNAND: OMAP2: Switch to generic gpio calls
       [not found] ` <1228289844-5897-3-git-send-email-jarkko.nikula@nokia.com>
@ 2008-12-05 12:24   ` Adrian Hunter
  2008-12-05 18:14     ` David Brownell
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Hunter @ 2008-12-05 12:24 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Jarkko Nikula, linux-omap Mailing List, linux-mtd Mailing List

From: Jarkko Nikula <jarkko.nikula@nokia.com>

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
---
 drivers/mtd/onenand/omap2.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index a7e4d98..c260e2d 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -149,7 +149,7 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 
 		INIT_COMPLETION(c->irq_done);
 		if (c->gpio_irq) {
-			result = omap_get_gpio_datain(c->gpio_irq);
+			result = gpio_get_value(c->gpio_irq);
 			if (result == -1) {
 				ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
 				intr = read_reg(c, ONENAND_REG_INTERRUPT);
@@ -629,14 +629,14 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
 	}
 
 	if (c->gpio_irq) {
-		if ((r = omap_request_gpio(c->gpio_irq)) < 0) {
+		if ((r = gpio_request(c->gpio_irq, "OneNAND irq")) < 0) {
 			dev_err(&pdev->dev,  "Failed to request GPIO%d for "
 				"OneNAND\n", c->gpio_irq);
 			goto err_iounmap;
 	}
-	omap_set_gpio_direction(c->gpio_irq, 1);
+	gpio_direction_input(c->gpio_irq);
 
-	if ((r = request_irq(OMAP_GPIO_IRQ(c->gpio_irq),
+	if ((r = request_irq(gpio_to_irq(c->gpio_irq),
 			     omap2_onenand_interrupt, IRQF_TRIGGER_RISING,
 			     pdev->dev.driver->name, c)) < 0)
 		goto err_release_gpio;
@@ -723,10 +723,10 @@ err_release_dma:
 	if (c->dma_channel != -1)
 		omap_free_dma(c->dma_channel);
 	if (c->gpio_irq)
-		free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
+		free_irq(gpio_to_irq(c->gpio_irq), c);
 err_release_gpio:
 	if (c->gpio_irq)
-		omap_free_gpio(c->gpio_irq);
+		gpio_free(c->gpio_irq);
 err_iounmap:
 	iounmap(c->onenand.base);
 err_release_mem_region:
@@ -760,8 +760,8 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev)
 	omap2_onenand_shutdown(pdev);
 	platform_set_drvdata(pdev, NULL);
 	if (c->gpio_irq) {
-		free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
-		omap_free_gpio(c->gpio_irq);
+		free_irq(gpio_to_irq(c->gpio_irq), c);
+		gpio_free(c->gpio_irq);
 	}
 	iounmap(c->onenand.base);
 	release_mem_region(c->phys_base, ONENAND_IO_SIZE);
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] OneNAND: OMAP2: Switch to generic gpio calls
  2008-12-05 12:24   ` [PATCH] OneNAND: OMAP2: Switch to generic gpio calls Adrian Hunter
@ 2008-12-05 18:14     ` David Brownell
  0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2008-12-05 18:14 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: linux-mtd Mailing List, linux-omap Mailing List, David Woodhouse,
	Jarkko Nikula

On Friday 05 December 2008, Adrian Hunter wrote:
> -               if ((r = omap_request_gpio(c->gpio_irq)) < 0) {
> +               if ((r = gpio_request(c->gpio_irq, "OneNAND irq")) < 0) {

Worth noting that this depends on the OMAP patches which 
make those calls be equivalent.  Those patches are going
into 2.6.29-early via the ARM tree, as I recall; getting
the merge order wrong would break bisectability -- but
not buildability.

- Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-05 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1228289844-5897-1-git-send-email-jarkko.nikula@nokia.com>
     [not found] ` <1228289844-5897-3-git-send-email-jarkko.nikula@nokia.com>
2008-12-05 12:24   ` [PATCH] OneNAND: OMAP2: Switch to generic gpio calls Adrian Hunter
2008-12-05 18:14     ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox