Subject: Re: [patch 4/4] Update e1000 driver to use devres.

From: Tejun Heo <[email-masked]>
Date: Thu, 16 Aug 2007 20:44:17 +0900

Brandon Philips wrote:
> -	mmio_start = pci_resource_start(pdev, BAR_0);
>  	mmio_len = pci_resource_len(pdev, BAR_0);

You don't need mmio_len either.

> -	err = -EIO;
> -	adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
> +	adapter->hw.hw_addr = pcim_iomap(pdev, BAR_0, mmio_len);

Passing 0 as @max_len tells pci[m]_iomap() to use pci_resource_len() of
the BAR.

> @@ -952,16 +948,15 @@ e1000_probe(struct pci_dev *pdev,
>  	/* setup the private structure */
>  
>  	if ((err = e1000_sw_init(adapter)))
> -		goto err_sw_init;
> +		return err;
>  
>  	err = -EIO;
>  	/* Flash BAR mapping must happen after e1000_sw_init
>  	 * because it depends on mac_type */
>  	if ((adapter->hw.mac_type == e1000_ich8lan) &&
>  	   (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
> -		flash_start = pci_resource_start(pdev, 1);
>  		flash_len = pci_resource_len(pdev, 1);

Ditto.

> -		adapter->hw.flash_address = ioremap(flash_start, flash_len);
> +		adapter->hw.flash_address = pcim_iomap(pdev, 1, flash_len);
>  		if (!adapter->hw.flash_address)
>  			goto err_flashmap;
>  	}

-- 
tejun

-------------------------------------------------------------------------
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/