public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	jirislaby@kernel.org, andriy.shevchenko@linux.intel.com,
	ilpo.jarvinen@linux.intel.com, macro@orcam.me.uk,
	jay.dolan@accesio.com, cang1@live.co.uk,
	u.kleine-koenig@pengutronix.de, wander@redhat.com,
	etremblay@distech-controls.com, jk@ozlabs.org,
	biju.das.jz@bp.renesas.com, geert+renesas@glider.be,
	phil.edworthy@renesas.com, lukas@wunner.de,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v3 tty-next 1/3] 8250: microchip: pci1xxxx: Add driver for quad-uart support.
Date: Wed, 9 Nov 2022 13:01:02 +0100	[thread overview]
Message-ID: <Y2uWftt5b2AWyTtX@kroah.com> (raw)
In-Reply-To: <20221107124517.1364484-2-kumaravel.thiagarajan@microchip.com>

On Mon, Nov 07, 2022 at 06:15:15PM +0530, Kumaravel Thiagarajan wrote:
> +++ b/drivers/tty/serial/8250/8250_pcilib.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Microchip pci1xxxx 8250 library. */

Better name and a copyright line?

> +
> +#include <linux/pci.h>
> +#include "8250.h"
> +
> +int pci_setup_port(struct pci_dev *dev, struct uart_8250_port *port,
> +		   u8 bar, unsigned int offset, int regshift)
> +{
> +	if (bar >= PCI_STD_NUM_BARS)
> +		return -EINVAL;
> +
> +	if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
> +		if (!pcim_iomap(dev, bar, 0) && !pcim_iomap_table(dev))
> +			return -ENOMEM;
> +
> +		port->port.iotype = UPIO_MEM;
> +		port->port.iobase = 0;
> +		port->port.mapbase = pci_resource_start(dev, bar) + offset;
> +		port->port.membase = pcim_iomap_table(dev)[bar] + offset;
> +		port->port.regshift = regshift;
> +	} else {
> +		port->port.iotype = UPIO_PORT;
> +		port->port.iobase = pci_resource_start(dev, bar) + offset;
> +		port->port.mapbase = 0;
> +		port->port.membase = NULL;
> +		port->port.regshift = 0;
> +	}
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(pci_setup_port);

This needs a better name, 8250_pci_setup_port()?  This is not a pci core
function.

thanks,

greg k-h

  reply	other threads:[~2022-11-09 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 12:45 [PATCH v3 tty-next 0/3] 8250: microchip: pci1xxxx: Add driver for the pci1xxxx's quad-uart function Kumaravel Thiagarajan
2022-11-07 12:45 ` [PATCH v3 tty-next 1/3] 8250: microchip: pci1xxxx: Add driver for quad-uart support Kumaravel Thiagarajan
2022-11-09 12:01   ` Greg KH [this message]
2022-11-10 17:18     ` Kumaravel.Thiagarajan
2022-11-10 18:06       ` Greg KH
2022-11-07 12:45 ` [PATCH v3 tty-next 2/3] 8250: microchip: pci1xxxx: Add rs485 support to quad-uart driver Kumaravel Thiagarajan
2022-11-07 12:45 ` [PATCH v3 tty-next 3/3] 8250: microchip: pci1xxxx: Add power management functions " Kumaravel Thiagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y2uWftt5b2AWyTtX@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cang1@live.co.uk \
    --cc=etremblay@distech-controls.com \
    --cc=geert+renesas@glider.be \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jay.dolan@accesio.com \
    --cc=jirislaby@kernel.org \
    --cc=jk@ozlabs.org \
    --cc=kumaravel.thiagarajan@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=macro@orcam.me.uk \
    --cc=phil.edworthy@renesas.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wander@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox