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-octeon.c | |
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-octeon.c')
-rw-r--r-- | drivers/net/phy/mdio-octeon.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c index 8327382aa568..a2f93948db97 100644 --- a/drivers/net/phy/mdio-octeon.c +++ b/drivers/net/phy/mdio-octeon.c @@ -44,8 +44,7 @@ static int octeon_mdiobus_probe(struct platform_device *pdev) return -ENXIO; } - bus->register_base = - (u64)devm_ioremap(&pdev->dev, mdio_phys, regsize); + bus->register_base = devm_ioremap(&pdev->dev, mdio_phys, regsize); if (!bus->register_base) { dev_err(&pdev->dev, "dev_ioremap failed\n"); return -ENOMEM; @@ -56,7 +55,7 @@ static int octeon_mdiobus_probe(struct platform_device *pdev) oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); bus->mii_bus->name = KBUILD_MODNAME; - snprintf(bus->mii_bus->id, MII_BUS_ID_SIZE, "%llx", bus->register_base); + snprintf(bus->mii_bus->id, MII_BUS_ID_SIZE, "%px", bus->register_base); bus->mii_bus->parent = &pdev->dev; bus->mii_bus->read = cavium_mdiobus_read; |