pci: use pci_ioremap_bar() in drivers/net
Use the newly introduced pci_ioremap_bar() function in drivers/net. pci_ioremap_bar() just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
committed by
Jeff Garzik
parent
842e08bd68
commit
275f165fa9
@@ -222,8 +222,7 @@ static int rt2x00pci_alloc_reg(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct pci_dev *pci_dev = to_pci_dev(rt2x00dev->dev);
|
||||
|
||||
rt2x00dev->csr.base = ioremap(pci_resource_start(pci_dev, 0),
|
||||
pci_resource_len(pci_dev, 0));
|
||||
rt2x00dev->csr.base = pci_ioremap_bar(pci_dev, 0);
|
||||
if (!rt2x00dev->csr.base)
|
||||
goto exit;
|
||||
|
||||
|
Reference in New Issue
Block a user