From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
linux-renesas-soc@vger.kernel.org, linux-serial@vger.kernel.org,
Milan Stevanovic <milan.stevanovic@se.com>,
Jimmy Lalande <jimmy.lalande@se.com>,
Pascal Eberhard <pascal.eberhard@se.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Herve Codina <herve.codina@bootlin.com>,
Clement Leger <clement.leger@bootlin.com>,
Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v5 08/11] serial: 8250: dw: Move the IO accessors to 8250_dwlib.h
Date: Wed, 13 Apr 2022 13:55:20 +0300 [thread overview]
Message-ID: <YlasGPvSUGUDqcfM@smile.fi.intel.com> (raw)
In-Reply-To: <20220413075141.72777-9-miquel.raynal@bootlin.com>
On Wed, Apr 13, 2022 at 09:51:38AM +0200, Miquel Raynal wrote:
> These accessors should be used instead of the regular readl/writel()
> helpers. In order to use them also from 8250_dw.c in this directory,
> move the helpers to 8250_dwlib.h
>
> There is no functional change.
>
> There is no need for declaring `struct uart_port` or even UPIO_MEM32BE
> which both are already included in the 8250_dwlib.h header by 8250.h.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/tty/serial/8250/8250_dwlib.c | 16 ----------------
> drivers/tty/serial/8250/8250_dwlib.h | 16 ++++++++++++++++
> 2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c
> index 22154b5848d5..02b6422c26c7 100644
> --- a/drivers/tty/serial/8250/8250_dwlib.c
> +++ b/drivers/tty/serial/8250/8250_dwlib.c
> @@ -3,7 +3,6 @@
>
> #include <linux/bitops.h>
> #include <linux/device.h>
> -#include <linux/io.h>
> #include <linux/kernel.h>
> #include <linux/serial_8250.h>
> #include <linux/serial_core.h>
> @@ -32,21 +31,6 @@
> /* Helper for FIFO size calculation */
> #define DW_UART_CPR_FIFO_SIZE(a) (((a >> 16) & 0xff) * 16)
>
> -static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
> -{
> - if (p->iotype == UPIO_MEM32BE)
> - return ioread32be(p->membase + offset);
> - return readl(p->membase + offset);
> -}
> -
> -static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg)
> -{
> - if (p->iotype == UPIO_MEM32BE)
> - iowrite32be(reg, p->membase + offset);
> - else
> - writel(reg, p->membase + offset);
> -}
> -
> /*
> * divisor = div(I) + div(F)
> * "I" means integer, "F" means fractional
> diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h
> index 412f4e83e0b3..b2a7cff671bf 100644
> --- a/drivers/tty/serial/8250/8250_dwlib.h
> +++ b/drivers/tty/serial/8250/8250_dwlib.h
> @@ -1,6 +1,7 @@
> /* SPDX-License-Identifier: GPL-2.0+ */
> /* Synopsys DesignWare 8250 library header file. */
>
> +#include <linux/io.h>
> #include <linux/notifier.h>
> #include <linux/types.h>
> #include <linux/workqueue.h>
> @@ -50,3 +51,18 @@ static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
> {
> return container_of(data, struct dw8250_data, data);
> }
> +
> +static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
> +{
> + if (p->iotype == UPIO_MEM32BE)
> + return ioread32be(p->membase + offset);
> + return readl(p->membase + offset);
> +}
> +
> +static inline void dw8250_writel_ext(struct uart_port *p, int offset, u32 reg)
> +{
> + if (p->iotype == UPIO_MEM32BE)
> + iowrite32be(reg, p->membase + offset);
> + else
> + writel(reg, p->membase + offset);
> +}
> --
> 2.27.0
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-04-13 10:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 7:51 [PATCH v5 00/11] serial: 8250: dw: RZN1 DMA support Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 01/11] serial: 8250: dw: Move definitions to the shared header Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 02/11] serial: 8250: dw: Use the device API Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 03/11] serial: 8250: dw: Create a more generic platform data structure Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 04/11] serial: 8250: dw: Move the USR register to pdata Miquel Raynal
2022-04-13 10:50 ` Andy Shevchenko
2022-04-13 7:51 ` [PATCH v5 05/11] serial: 8250: dw: Allow to use a fallback CPR value if not synthesized Miquel Raynal
2022-04-13 10:53 ` Andy Shevchenko
2022-04-13 7:51 ` [PATCH v5 06/11] serial: 8250: dma: Allow driver operations before starting DMA transfers Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 07/11] serial: 8250: dw: Introduce an rx_timeout variable in the IRQ path Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 08/11] serial: 8250: dw: Move the IO accessors to 8250_dwlib.h Miquel Raynal
2022-04-13 10:55 ` Andy Shevchenko [this message]
2022-04-13 7:51 ` [PATCH v5 09/11] serial: 8250: dw: Add support for DMA flow controlling devices Miquel Raynal
2022-04-13 10:58 ` Andy Shevchenko
2022-04-13 7:51 ` [PATCH v5 10/11] serial: 8250: dw: Improve RZN1 support Miquel Raynal
2022-04-13 7:51 ` [PATCH v5 11/11] ARM: dts: r9a06g032: Fill the UART DMA properties Miquel Raynal
2022-04-15 9:36 ` [PATCH v5 00/11] serial: 8250: dw: RZN1 DMA support Greg Kroah-Hartman
2022-04-20 8:56 ` Miquel Raynal
2022-04-21 9:30 ` Miquel Raynal
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=YlasGPvSUGUDqcfM@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=clement.leger@bootlin.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=herve.codina@bootlin.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jimmy.lalande@se.com \
--cc=jirislaby@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=milan.stevanovic@se.com \
--cc=miquel.raynal@bootlin.com \
--cc=pascal.eberhard@se.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).