OSDN Git Service

enetc: Clean up local mdio bus allocation
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Thu, 1 Aug 2019 11:52:49 +0000 (14:52 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Aug 2019 01:22:18 +0000 (18:22 -0700)
commit2152e7a2d9a8c29e8850adabd2175fa042ad5bb8
tree755fcfdfbac926ecf70a89ed2ebb438a5b908987
parent4a9866179d51ca0df9779364c33d5869a1c6311c
enetc: Clean up local mdio bus allocation

What's needed is basically a pointer to the mdio registers.
This is one way to store it inside bus->priv allocated space,
without upsetting sparse.
Reworked accessors to avoid __iomem casting.
Used devm_* variant to further clean up the init error /
remove paths.

Fixes following sparse warning:
 warning: incorrect type in assignment (different address spaces)
    expected void *priv
    got struct enetc_mdio_regs [noderef] <asn:2>*[assigned] regs

Fixes: ebfcb23d62ab ("enetc: Add ENETC PF level external MDIO support")

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc_mdio.c