diff options
author | Pavel Roskin <proski@gnu.org> | 2006-04-07 04:10:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-04-24 16:15:52 -0400 |
commit | 3d529962217c3fec36f53f270a37e132b9763c65 (patch) | |
tree | e327ba184a666f4ad2e706912c4eba1c6a4a0947 /drivers/net/wireless/orinoco_pci.c | |
parent | d62274b374ce41dd3a90820b124d28fec292a5b7 (diff) |
[PATCH] orinoco_pci: use pci_iomap() for resources
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco_pci.c')
-rw-r--r-- | drivers/net/wireless/orinoco_pci.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c index e57e92bc6ab8..75df90ff1dc9 100644 --- a/drivers/net/wireless/orinoco_pci.c +++ b/drivers/net/wireless/orinoco_pci.c | |||
@@ -170,9 +170,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
170 | const struct pci_device_id *ent) | 170 | const struct pci_device_id *ent) |
171 | { | 171 | { |
172 | int err = 0; | 172 | int err = 0; |
173 | unsigned long pci_iorange; | 173 | void __iomem *pci_ioaddr = NULL; |
174 | u16 __iomem *pci_ioaddr = NULL; | ||
175 | unsigned long pci_iolen; | ||
176 | struct orinoco_private *priv = NULL; | 174 | struct orinoco_private *priv = NULL; |
177 | struct orinoco_pci_card *card; | 175 | struct orinoco_pci_card *card; |
178 | struct net_device *dev = NULL; | 176 | struct net_device *dev = NULL; |
@@ -190,10 +188,9 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
190 | } | 188 | } |
191 | 189 | ||
192 | /* Resource 0 is mapped to the hermes registers */ | 190 | /* Resource 0 is mapped to the hermes registers */ |
193 | pci_iorange = pci_resource_start(pdev, 0); | 191 | pci_ioaddr = pci_iomap(pdev, 0, 0); |
194 | pci_iolen = pci_resource_len(pdev, 0); | 192 | if (!pci_ioaddr) { |
195 | pci_ioaddr = ioremap(pci_iorange, pci_iolen); | 193 | err = -EIO; |
196 | if (!pci_iorange) { | ||
197 | printk(KERN_ERR PFX "Cannot remap hardware registers\n"); | 194 | printk(KERN_ERR PFX "Cannot remap hardware registers\n"); |
198 | goto fail_map; | 195 | goto fail_map; |
199 | } | 196 | } |
@@ -208,8 +205,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
208 | priv = netdev_priv(dev); | 205 | priv = netdev_priv(dev); |
209 | card = priv->card; | 206 | card = priv->card; |
210 | card->pci_ioaddr = pci_ioaddr; | 207 | card->pci_ioaddr = pci_ioaddr; |
211 | dev->mem_start = pci_iorange; | 208 | dev->mem_start = pci_resource_start(pdev, 0); |
212 | dev->mem_end = pci_iorange + pci_iolen - 1; | 209 | dev->mem_end = dev->mem_start + pci_resource_len(pdev, 0) - 1; |
213 | SET_MODULE_OWNER(dev); | 210 | SET_MODULE_OWNER(dev); |
214 | SET_NETDEV_DEV(dev, &pdev->dev); | 211 | SET_NETDEV_DEV(dev, &pdev->dev); |
215 | 212 | ||