linux-mips
[Top] [All Lists]

Re: [PATCH] IOC3: Switch to pci refcounting safe APIs

To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] IOC3: Switch to pci refcounting safe APIs
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 23 Apr 2007 15:35:07 +0100
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>, linux-mips@linux-mips.org
In-reply-to: <20070423151918.477ffb6a@the-village.bc.nu>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070423150640.1faf693f@the-village.bc.nu> <462CBE33.2060208@ru.mvista.com> <20070423151918.477ffb6a@the-village.bc.nu>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.2i
On Mon, Apr 23, 2007 at 03:19:18PM +0100, Alan Cox wrote:

> > > +static int ioc3_adjacent_is_ioc3(struct pci_dev *pdev, int dev)
> > > +{
> > > + struct pci_dev *dev = pci_get_bus_and_slot(pdev->bus->number, 
> > > +                                                 PCI_DEVFN(dev, 0));
> > 
> >    The same question: isn't pci_get_bus() better in this case?
> 
> Makes no real difference, but if you know the MIPS tree never ends up
> with pdev->bus = NULL for the root bus then its a trivial change

That's the case on MIPS.

> >    I don't see the point of using refcounting API in such cases but well...
> 
> Two reasons
> 
> 1.    It makes the entire system more consistent
> 2.    It means we can remove the (usually) unsafe pci_find_slot API
> 
> (and #3 sort of... it means the pci fake hotplug testing works with this
> device too)

The patch looks ok to me:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

Longer term MENET should be handled differently but this patch certainly
doesn't make things worse.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>