From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932588AbdBGWkY (ORCPT ); Tue, 7 Feb 2017 17:40:24 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:33575 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752702AbdBGWkW (ORCPT ); Tue, 7 Feb 2017 17:40:22 -0500 MIME-Version: 1.0 In-Reply-To: <52dc04249d65a55fbf1e58c262ca23c4fcc20777.1486483803.git.jan.kiszka@siemens.com> References: <52dc04249d65a55fbf1e58c262ca23c4fcc20777.1486483803.git.jan.kiszka@siemens.com> From: Andy Shevchenko Date: Wed, 8 Feb 2017 00:40:21 +0200 Message-ID: Subject: Re: [PATCH 1/7] serial: exar: Fix mapping of port I/O resources To: Jan Kiszka Cc: Greg Kroah-Hartman , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , Sudip Mukherjee Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 7, 2017 at 6:09 PM, Jan Kiszka wrote: > 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. Basically by this change you answered to one of my question during review. FWIW: Reviewed-by: Andy Shevchenko > Fixes: d0aeaa83f0b0 ("serial: exar: split out the exar code from 8250_pci") > Signed-off-by: Jan Kiszka > --- > 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 > -- With Best Regards, Andy Shevchenko