[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061001193616.GF16272@parisc-linux.org>
Date: Sun, 1 Oct 2006 13:36:16 -0600
From: Matthew Wilcox <matthew@....cx>
To: Arjan van de Ven <arjan@...radead.org>
Cc: linux-scsi@...r.kernel.org,
"Linux-Kernel," <linux-kernel@...r.kernel.org>,
"J.A. Magall??n" <jamagallon@....com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Andrew Morton <akpm@...l.org>,
Frederik Deweerdt <deweerdt@...e.fr>,
Jeff Garzik <jeff@...zik.org>
Subject: Re: [-mm patch] aic7xxx: check irq validity (was Re: 2.6.18-mm2)
On Sun, Oct 01, 2006 at 09:05:23PM +0200, Arjan van de Ven wrote:
> > int pci_request_irq(struct pci_dev *pdev, irq_handler_t handler,
> > unsigned long flags, const char *name, void *data)
> > {
> > if (!valid_irq(pdev->irq)) {
> > dev_printk(KERN_ERR, &pdev->dev, "invalid irq\n");
> > return -EINVAL;
> > }
> >
> > return request_irq(pdev->irq, handler, flags | IRQF_SHARED, name, data);
> > }
>
> well... why not go one step further and eliminate the flags argument
> entirely? And use pci_name() for the name (so eliminate the argument ;)
> and always pass pdev as data, so that that argument can go away too....
>
> that'll cover 99% of the request_irq() users for pci devices.. and makes
> it really nicely simple and consistent.
hmm. $ echo `cut -c34- /proc/interrupts`
timer i8042 cascade acpi yenta, ehci_hcd:usb1, Intel 82801DB-ICH4 yenta,
uhci_hcd:usb2 uhci_hcd:usb4, eth0 ide0 uhci_hcd:usb3, eth1
Network drivers use their eth%d name. USB drivers use [eu]hci_hcd:usb%d.
Others tend to use the driver name. Changing them all to be 0000:00:1d.2
isn't really an improvement in the readability of /proc/interrupts, IMO.
Passing pdev as the data is a good idea for practically no device driver.
It's rare to actually want the pci_device down in the interrupt handler;
normally you want the device private data. Using pci_get_drvdata(pdev)
as the data would make sense for both sym2 and tg3. I don't feel like
auditing other drivers to see if it'd make sense for them too.
So, current proposal:
int pci_request_irq(struct pci_dev *pdev, irq_handler_t handler,
const char *name)
{
if (!valid_irq(pdev->irq)) {
dev_printk(KERN_ERR, &pdev->dev, "invalid irq\n");
return -EINVAL;
}
return request_irq(pdev->irq, handler, IRQF_SHARED, name,
pci_get_drvdata(pdev));
}
But what about IRQF_SAMPLE_RANDOM?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists