Re: [PATCH] pata-rb532-cf: platform_get_irq() failure ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Mar 05, 2009 at 07:23:22AM -0500, Jeff Garzik wrote:
> Roel Kluin wrote:
> >------------------------------>8-------------8<---------------------------------
> >platform_get_irq() can return -ENXIO, but since 'irq' is an unsigned int, 
> >it
> >does not show when the IRQ resource wasn't found.
> >
> >Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> >---
> >diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
> >index ebfcda2..fe8178c 100644
> >--- a/drivers/ata/pata_rb532_cf.c
> >+++ b/drivers/ata/pata_rb532_cf.c
> >@@ -173,11 +173,12 @@ static __devinit int rb532_pata_driver_probe(struct 
> >platform_device *pdev)
> > 		return -EINVAL;
> > 	}
> > 
> >-	irq = platform_get_irq(pdev, 0);
> >-	if (irq <= 0) {
> >+	ret = platform_get_irq(pdev, 0);
> >+	if (ret <= 0) {
> > 		dev_err(&pdev->dev, "no IRQ resource found\n");
> > 		return -ENOENT;
> > 	}
> >+	irq = ret;
> > 
> > 	gpio = irq_to_gpio(irq);
> 
> ACK from Phil or Florian?

That's fine for me, though I didn't test it (I managed to break my
build-machine somehow, in an attempt to having the mainboard properly
grounded).

One could simplify the patch by making the variable 'irq' be signed
instead of unsigned. This would also prevent "abusing" the variable
'ret'. What do you think?

Greetings, Phil
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux