linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_platform struct resource signness fix
@ 2008-09-25  8:36 Wang Jian
  2008-09-25  8:54 ` Wang Jian
  2008-09-25  9:12 ` Leo Li
  0 siblings, 2 replies; 10+ messages in thread
From: Wang Jian @ 2008-09-25  8:36 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

This patch is to pata_platform.c but at this time, it's powerpc specific
because it can only be triggerred using openfirmware, so I post the patch
here. The patch is against 2.6.26-rc8.

The problem is triggerred when ata device is populated using 
pata_of_platform.c, and no irq is assigned (poll mode, such as CF card).

pata_of_platform_probe() parse device tree and

        if (ret == NO_IRQ)
	                irq_res.start = irq_res.end = -1;

Then irq is 0xffffffff, not NULL. Probe will fail coz irq can't be
requested.


---
(irq_res->start > 0) will be true even when it is (-1). When the device
has no irq, irq_res->start is assigned (-1).

Signed-off-by: Wang Jian <lark@linux.net.cn>
---
 drivers/ata/pata_platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 8f65ad6..b12cd0c 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -123,7 +123,7 @@ int __devinit __pata_platform_probe(struct device *dev,
 	/*
 	 * And the IRQ
 	 */
-	if (irq_res && irq_res->start > 0) {
+	if (irq_res && irq_res->start != -1) {
 		irq = irq_res->start;
 		irq_flags = irq_res->flags;
 	}
-- 
1.5.5.4

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

end of thread, other threads:[~2008-09-29 13:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25  8:36 [PATCH] pata_platform struct resource signness fix Wang Jian
2008-09-25  8:54 ` Wang Jian
2008-09-25 10:40   ` Li Yang
2008-09-25 10:48     ` Anton Vorontsov
2008-09-29  4:19       ` Jeff Garzik
2008-09-29 13:32         ` [PATCH] pata_of_platform: fix no irq handling Anton Vorontsov
2008-09-25 15:33     ` [PATCH] pata_platform struct resource signness fix Wang Jian
2008-09-25 15:47       ` Anton Vorontsov
2008-09-25  9:12 ` Leo Li
2008-09-25  9:30   ` Wang Jian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).