public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik•org>
To: akpm@linux-foundation•org, mark@hindley•org.uk
Cc: netdev@vger•kernel.org, klassert@mathematik•tu-chemnitz.de
Subject: Re: [patch 08/18] 3c59x: check return of pci_enable_device()
Date: Tue, 14 Aug 2007 01:33:26 -0400	[thread overview]
Message-ID: <46C13EA6.9090301@garzik.org> (raw)
In-Reply-To: <200708102105.l7AL5Jje008968@imap1.linux-foundation.org>

akpm@linux-foundation•org wrote:
> From: Mark Hindley <mark@hindley•org.uk>
> 
> Check return of pci_enable_device in vortex_up().
> 
> Signed-off-by: Mark Hindley <mark@hindley•org.uk>
> Acked-by: Steffen Klassert <klassert@mathematik•tu-chemnitz.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation•org>
> ---
> 
>  drivers/net/3c59x.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/net/3c59x.c~3c59x-check-return-of-pci_enable_device drivers/net/3c59x.c
> --- a/drivers/net/3c59x.c~3c59x-check-return-of-pci_enable_device
> +++ a/drivers/net/3c59x.c
> @@ -1490,13 +1490,17 @@ vortex_up(struct net_device *dev)
>  	struct vortex_private *vp = netdev_priv(dev);
>  	void __iomem *ioaddr = vp->ioaddr;
>  	unsigned int config;
> -	int i, mii_reg1, mii_reg5;
> +	int i, mii_reg1, mii_reg5, err;
>  
>  	if (VORTEX_PCI(vp)) {
>  		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */
>  		if (vp->pm_state_valid)
>  			pci_restore_state(VORTEX_PCI(vp));
> -		pci_enable_device(VORTEX_PCI(vp));
> +		err = pci_enable_device(VORTEX_PCI(vp));
> +		if (err) {
> +			printk(KERN_WARNING "%s: Could not enable device \n",
> +				dev->name);
> +		}

I would strongly prefer that vortex_up return a value, since all the 
important callers of this function can themselves return an error back 
to the system.

we can definitely return a meaningful return value here, if 
pci_enable_device() fails, and I would rather not apply a patch that 
fails to propagate a serious condition (pci_enable_device failure is 
indeed serious) when it is possible to do so


  reply	other threads:[~2007-08-14  5:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 21:05 [patch 08/18] 3c59x: check return of pci_enable_device() akpm
2007-08-14  5:33 ` Jeff Garzik [this message]
2007-08-14  9:54 ` Mark Hindley
2007-08-15 16:30   ` Steffen Klassert
2007-08-15 20:59     ` Steffen Klassert
2007-08-16 10:28     ` [REVISED PATCH] " Mark Hindley
2007-08-31 13:08       ` Jeff Garzik
2007-08-31 13:21         ` Steffen Klassert
2007-08-31 13:33           ` Jeff Garzik
2007-08-31 13:32       ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C13EA6.9090301@garzik.org \
    --to=jeff@garzik$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=klassert@mathematik$(echo .)tu-chemnitz.de \
    --cc=mark@hindley$(echo .)org.uk \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox