diff options
author | Andrew Lunn <andrew@lunn.ch> | 2020-07-07 03:49:38 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-07 21:47:11 +0200 |
commit | c7b04d1030f505f2d883612ed31a6ddd70182705 (patch) | |
tree | bdcfa226199a1b00f75300a4ba2458353446277a /drivers/net/phy/mdio-cavium.h | |
parent | net: phy: dp83640: Fixup cast to restricted __be16 warning (diff) | |
download | linux-c7b04d1030f505f2d883612ed31a6ddd70182705.tar.xz linux-c7b04d1030f505f2d883612ed31a6ddd70182705.zip |
net: phy: cavium: Improve __iomem mess
The MIPS low level register access functions seem to be missing
__iomem annotation. This causes lots of sparse warnings, when code
casts off the __iomem. Make the Cavium MDIO drivers cleaner by pushing
the casts lower down into the helpers, allow the drivers to work as
normal, with __iomem.
bus->register_base is now an void *, rather than a u64. So forming the
mii_bus->id string cannot use %llx any more. Use %px, so this kernel
address is still exposed to user space, as it was before.
v2: s/cases/causes/g
Cc: Sunil Goutham <sgoutham@marvell.com>
Cc: Robert Richter <rrichter@marvell.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-cavium.h')
-rw-r--r-- | drivers/net/phy/mdio-cavium.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/phy/mdio-cavium.h b/drivers/net/phy/mdio-cavium.h index e33d3ea9a907..a2245d436f5d 100644 --- a/drivers/net/phy/mdio-cavium.h +++ b/drivers/net/phy/mdio-cavium.h @@ -90,7 +90,7 @@ union cvmx_smix_wr_dat { struct cavium_mdiobus { struct mii_bus *mii_bus; - u64 register_base; + void __iomem *register_base; enum cavium_mdiobus_mode mode; }; @@ -98,20 +98,20 @@ struct cavium_mdiobus { #include <asm/octeon/octeon.h> -static inline void oct_mdio_writeq(u64 val, u64 addr) +static inline void oct_mdio_writeq(u64 val, void __iomem *addr) { - cvmx_write_csr(addr, val); + cvmx_write_csr((u64 __force)addr, val); } -static inline u64 oct_mdio_readq(u64 addr) +static inline u64 oct_mdio_readq(void __iomem *addr) { - return cvmx_read_csr(addr); + return cvmx_read_csr((u64 __force)addr); } #else #include <linux/io-64-nonatomic-lo-hi.h> -#define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) -#define oct_mdio_readq(addr) readq((void *)addr) +#define oct_mdio_writeq(val, addr) writeq(val, addr) +#define oct_mdio_readq(addr) readq(addr) #endif int cavium_mdiobus_read(struct mii_bus *bus, int phy_id, int regnum); |