netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Philips <bphilips@suse.de>
To: Tejun Heo <teheo@suse.de>
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: Re: [patch 2/4] Update e100 driver to use devres.
Date: Thu, 16 Aug 2007 08:54:02 -0700	[thread overview]
Message-ID: <20070816155402.GA4218@ifup.org> (raw)
In-Reply-To: <46C43652.6030609@suse.de>

On 20:34 Thu 16 Aug 2007, Tejun Heo wrote:
> Brandon Philips wrote:
> > @@ -2554,8 +2547,10 @@ static int __devinit e100_probe(struct p
> >  	struct net_device *netdev;
> >  	struct nic *nic;
> >  	int err;
> > +	void __iomem **iomap;
> > +	int bar;
> >  
> > -	if(!(netdev = alloc_etherdev(sizeof(struct nic)))) {
> > +	if (!(netdev = devm_alloc_etherdev(&pdev->dev, sizeof(struct nic)))) {
> >  		if(((1 << debug) - 1) & NETIF_MSG_PROBE)
> >  			printk(KERN_ERR PFX "Etherdev alloc failed, abort.\n");
> >  		return -ENOMEM;
> > @@ -2585,26 +2580,28 @@ static int __devinit e100_probe(struct p
> >  	nic->msg_enable = (1 << debug) - 1;
> >  	pci_set_drvdata(pdev, netdev);
> >  
> > -	if((err = pci_enable_device(pdev))) {
> > +	if ((err = pcim_enable_device(pdev))) {
> >  		DPRINTK(PROBE, ERR, "Cannot enable PCI device, aborting.\n");
> > -		goto err_out_free_dev;
> > +		return err;
> >  	}
> >  
> >  	if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
> >  		DPRINTK(PROBE, ERR, "Cannot find proper PCI device "
> >  			"base address, aborting.\n");
> >  		err = -ENODEV;
> > -		goto err_out_disable_pdev;
> > +		return err;
> >  	}
> >  
> > -	if((err = pci_request_regions(pdev, DRV_NAME))) {
> > +	bar = use_io ? 1 : 0;
> > +	if((err = pcim_iomap_regions(pdev, 1 << bar, DRV_NAME))) {
> >  		DPRINTK(PROBE, ERR, "Cannot obtain PCI resources, aborting.\n");
> > -		goto err_out_disable_pdev;
> > +		return err;
> >  	}
> > +	iomap = pcim_iomap_table(pdev)[bar];
> 
> Type mismatch.  Didn't compiler warn about it?

s/iomap/nic->csr/

> >  
> >  	if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
> >  		DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
> > -		goto err_out_free_res;
> > +		return err;
> >  	}
> >  
> >  	SET_MODULE_OWNER(netdev);
> > @@ -2613,12 +2610,6 @@ static int __devinit e100_probe(struct p
> >  	if (use_io)
> >  		DPRINTK(PROBE, INFO, "using i/o access mode\n");
> >  
> > -	nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr));
> > -	if(!nic->csr) {
> > -		DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
> > -		err = -ENOMEM;
> > -		goto err_out_free_res;
> > -	}
> 
> nic->csr initialization seems missing.  Have you tested the patched code?

No I didn't test it; my e100 box gave up on me.  I shouldn't have sent
this patch since I wasn't able to get it tested.

Thanks,

	Brandon

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

      reply	other threads:[~2007-08-16 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 18:59 [patch 2/4] Update e100 driver to use devres Brandon Philips
2007-08-16 11:34 ` Tejun Heo
2007-08-16 15:54   ` Brandon Philips [this message]

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=20070816155402.GA4218@ifup.org \
    --to=bphilips@suse.de \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=teheo@suse.de \
    /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).