Commit 24ed3abaa13a9499d7454a1ed9830bb53b689b94
Committed by
Linus Torvalds
1 parent
ce89294c05
Exists in
master
and in
7 other branches
pci: use pci_ioremap_bar() in drivers/serial
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>
Showing 2 changed files with 3 additions and 6 deletions Side-by-side Diff
drivers/serial/8250_pci.c
... | ... | @@ -398,8 +398,7 @@ |
398 | 398 | { |
399 | 399 | u8 __iomem *p; |
400 | 400 | |
401 | - p = ioremap_nocache(pci_resource_start(dev, 0), | |
402 | - pci_resource_len(dev, 0)); | |
401 | + p = pci_ioremap_bar(dev, 0); | |
403 | 402 | |
404 | 403 | if (p == NULL) |
405 | 404 | return -ENOMEM; |
... | ... | @@ -423,8 +422,7 @@ |
423 | 422 | { |
424 | 423 | u8 __iomem *p; |
425 | 424 | |
426 | - p = ioremap_nocache(pci_resource_start(dev, 0), | |
427 | - pci_resource_len(dev, 0)); | |
425 | + p = pci_ioremap_bar(dev, 0); | |
428 | 426 | /* FIXME: What if resource_len < OCT_REG_CR_OFF */ |
429 | 427 | if (p != NULL) |
430 | 428 | writeb(0, p + OCT_REG_CR_OFF); |
drivers/serial/icom.c
... | ... | @@ -1548,8 +1548,7 @@ |
1548 | 1548 | goto probe_exit1; |
1549 | 1549 | } |
1550 | 1550 | |
1551 | - icom_adapter->base_addr = ioremap(icom_adapter->base_addr_pci, | |
1552 | - pci_resource_len(dev, 0)); | |
1551 | + icom_adapter->base_addr = pci_ioremap_bar(dev, 0); | |
1553 | 1552 | |
1554 | 1553 | if (!icom_adapter->base_addr) |
1555 | 1554 | goto probe_exit1; |