Re: [PATCH]pci/bus.c: check return value of pci_enable_device()

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

 



On Fri, 18 Jun 2010 07:07:33 +0200
Rolf Eike Beer <eike-kernel@xxxxxxxxx> wrote:

> Junchang Wang wrote:
> > pci_enable_device can fail. In that case, a printed warning would be
> > more appropriate.
> > 
> > Signed-off-by: Justin P. Mattock <justinmattock@xxxxxxxxx>
> > Signed-off-by: Junchang Wang <junchangwang@xxxxxxxxx>
> > ---
> >  drivers/pci/bus.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
> > index 628ea20..4e71777 100644
> > --- a/drivers/pci/bus.c
> > +++ b/drivers/pci/bus.c
> > @@ -240,6 +240,9 @@ void pci_enable_bridges(struct pci_bus *bus)
> >  		if (dev->subordinate) {
> >  			if (!pci_is_enabled(dev)) {
> >  				retval = pci_enable_device(dev);
> > +				if (retval)
> > +					dev_err(&dev->dev, "Error opening "
> > +							"device, continuing\n");
> >  				pci_set_master(dev);
> >  			}
> >  			pci_enable_bridges(dev->subordinate);
> 
> In case you print an error message you should really include the error code so 
> one can see what actually went wrong.

Cool how we had an unused return value in that function in the first
place.  The error message could also be more specific, indicating that
we failed to enable a bridge device in particular.  I'll update it and
apply.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux