netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
To: Mark Hindley <mark@hindley.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>,
	akpm@linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [patch 08/18] 3c59x: check return of pci_enable_device()
Date: Wed, 15 Aug 2007 18:30:00 +0200	[thread overview]
Message-ID: <20070815163000.GB619@bayes.mathematik.tu-chemnitz.de> (raw)
In-Reply-To: <20070814095432.GA13825@hindley.org.uk>

On Tue, Aug 14, 2007 at 10:54:32AM +0100, Mark Hindley wrote:
> On Tue, Aug 14, 2007 at 01:33:26AM -0400, Jeff Garzik wrote:
> > 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
> > 
> 
> OK. Any comments on this revised version? I have only ignored the return of
> vortex_up in vortex_error. It is not immediately clear what to do if
> vortex_up still fails there after a pci reset.
> 
> Mark
> 
> 
> diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
> index 001c66d..a1dfd6b 100644
> --- a/drivers/net/3c59x.c
> +++ b/drivers/net/3c59x.c
> @@ -705,7 +705,7 @@ static struct {
>  
>  static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
>  				   int chip_idx, int card_idx);
> -static void vortex_up(struct net_device *dev);
> +static int vortex_up(struct net_device *dev);
>  static void vortex_down(struct net_device *dev, int final);
>  static int vortex_open(struct net_device *dev);
>  static void mdio_sync(void __iomem *ioaddr, int bits);
> @@ -841,8 +841,11 @@ static int vortex_resume(struct pci_dev *pdev)
>  			return -EBUSY;
>  		}
>  		if (netif_running(dev)) {
> -			vortex_up(dev);
> -			netif_device_attach(dev);
> +			err = vortex_up(dev);
> +			if (err)
> +				return err;
> +			else  
> +				netif_device_attach(dev);
>  		}
>  	}
>  	return 0;

I think we should free the requested irq if vortex_up really fails here.


Steffen

  reply	other threads:[~2007-08-15 16:30 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
2007-08-14  9:54 ` Mark Hindley
2007-08-15 16:30   ` Steffen Klassert [this message]
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=20070815163000.GB619@bayes.mathematik.tu-chemnitz.de \
    --to=klassert@mathematik.tu-chemnitz.de \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=mark@hindley.org.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).