Patchwork [04/11] at91/pata: use gpio_is_valid to check the gpio

login
register
mail settings
Submitter Jean-Christophe PLAGNIOL-VILLARD
Date Sept. 19, 2011, 12:51 p.m.
Message ID <1316436695-19194-4-git-send-email-plagnioj@jcrosoft.com>
Download mbox | patch
Permalink /patch/115374/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Jean-Christophe PLAGNIOL-VILLARD - Sept. 19, 2011, 12:51 p.m.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: linux-ide@vger.kernel.org
---
 drivers/ata/pata_at91.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index 960c725..3915353 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -360,7 +360,7 @@  static int __devinit pata_at91_probe(struct platform_device *pdev)
 	ap->flags |= ATA_FLAG_SLAVE_POSS;
 	ap->pio_mask = ATA_PIO4;
 
-	if (!irq) {
+	if (!gpio_is_valid(irq)) {
 		ap->flags |= ATA_FLAG_PIO_POLLING;
 		ata_port_desc(ap, "no IRQ, using PIO polling");
 	}
@@ -414,8 +414,8 @@  static int __devinit pata_at91_probe(struct platform_device *pdev)
 
 	host->private_data = info;
 
-	return ata_host_activate(host, irq ? gpio_to_irq(irq) : 0,
-			irq ? ata_sff_interrupt : NULL,
+	return ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0,
+			gpio_is_valid(irq) ? ata_sff_interrupt : NULL,
 			irq_flags, &pata_at91_sht);
 
 err_put: