From patchwork Sat Jul 11 12:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 241359 List-Id: U-Boot discussion From: marek.vasut at gmail.com (Marek Vasut) Date: Sat, 11 Jul 2020 14:36:01 +0200 Subject: [PATCH 05/12] net: dc2114x: Use standard I/O accessors In-Reply-To: <20200711123608.6541-1-marek.vasut+renesas@gmail.com> References: <20200711123608.6541-1-marek.vasut+renesas@gmail.com> Message-ID: <20200711123608.6541-5-marek.vasut+renesas@gmail.com> The current dc21x4x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on some systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros. Signed-off-by: Marek Vasut Cc: Joe Hershberger Cc: Ramon Fried --- drivers/net/dc2114x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c index af582c5415..9dd36e74de 100644 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include +#include #include #include #include @@ -104,12 +105,12 @@ static char tx_ring_size; static u32 dc2114x_inl(struct eth_device *dev, u32 addr) { - return le32_to_cpu(*(volatile u32 *)(addr + dev->iobase)); + return le32_to_cpu(readl(dev->iobase + addr)); } static void dc2114x_outl(struct eth_device *dev, u32 command, u32 addr) { - *(volatile u32 *)(addr + dev->iobase) = cpu_to_le32(command); + writel(cpu_to_le32(command), dev->iobase + addr); } static void reset_de4x5(struct eth_device *dev)