Skip to content

Commit

Permalink
pci: use pci_ioremap_bar() in drivers/serial
Browse files Browse the repository at this point in the history
Use the newly introduced pci_ioremap_bar() function in drivers/serial.
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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Jun 24, 2009
1 parent ce89294 commit 24ed3ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/serial/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ static int sbs_init(struct pci_dev *dev)
{
u8 __iomem *p;

p = ioremap_nocache(pci_resource_start(dev, 0),
pci_resource_len(dev, 0));
p = pci_ioremap_bar(dev, 0);

if (p == NULL)
return -ENOMEM;
Expand All @@ -423,8 +422,7 @@ static void __devexit sbs_exit(struct pci_dev *dev)
{
u8 __iomem *p;

p = ioremap_nocache(pci_resource_start(dev, 0),
pci_resource_len(dev, 0));
p = pci_ioremap_bar(dev, 0);
/* FIXME: What if resource_len < OCT_REG_CR_OFF */
if (p != NULL)
writeb(0, p + OCT_REG_CR_OFF);
Expand Down
3 changes: 1 addition & 2 deletions drivers/serial/icom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,7 @@ static int __devinit icom_probe(struct pci_dev *dev,
goto probe_exit1;
}

icom_adapter->base_addr = ioremap(icom_adapter->base_addr_pci,
pci_resource_len(dev, 0));
icom_adapter->base_addr = pci_ioremap_bar(dev, 0);

if (!icom_adapter->base_addr)
goto probe_exit1;
Expand Down

0 comments on commit 24ed3ab

Please sign in to comment.