diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2020-07-08 06:31:54 +0200 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2020-07-25 11:24:02 +0200 |
commit | 02b95a4b4133cff79d72cafc2c19b1154504ac56 (patch) | |
tree | 682b1290ec1ae0a45f322e7c8955964fb200c18e /drivers/net | |
parent | 9b98f20494c279389a4a6e80a6a4ca170653b49f (diff) |
net: dc2114x: Use standard I/O accessors
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 <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dc2114x.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c index dcbd818581..9cafa3b23d 100644 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <asm/io.h> #include <env.h> #include <malloc.h> #include <net.h> @@ -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) |