Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576718 > unrolled thread

[PATCH v2 1/7] serial: exar: Fix mapping of port I/O resources

Started byJan Kiszka <jan.kiszka@siemens.com>
First post2017-02-08 18:00 +0100
Last post2017-02-08 18:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/7] serial: exar: Fix mapping of port I/O resources Jan Kiszka <jan.kiszka@siemens.com> - 2017-02-08 18:00 +0100

#1576718 — [PATCH v2 1/7] serial: exar: Fix mapping of port I/O resources

FromJan Kiszka <jan.kiszka@siemens.com>
Date2017-02-08 18:00 +0100
Subject[PATCH v2 1/7] serial: exar: Fix mapping of port I/O resources
Message-ID<t8DL3-2L3-11@gated-at.bofh.it>
pcim_iomap_table only returns the table of mapping, it does not perform
them. For that, we need to call pcim_iomap, but only if that mapping was
not done before.

Fixes: d0aeaa83f0b0 ("serial: exar: split out the exar code from 8250_pci")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/tty/serial/8250/8250_exar.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index e6b44a7..58469d9 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -72,6 +72,9 @@ static int default_setup(struct exar8250 *priv, struct pci_dev *pcidev,
 	const struct exar8250_board *board = priv->board;
 	unsigned int bar = 0;
 
+	if (!pcim_iomap_table(pcidev)[bar] && !pcim_iomap(pcidev, bar, 0))
+		return -ENOMEM;
+
 	port->port.iotype = UPIO_MEM;
 	port->port.mapbase = pci_resource_start(pcidev, bar) + offset;
 	port->port.membase = pcim_iomap_table(pcidev)[bar] + offset;
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web