]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit09f90ef378bb2147902be582149b59df818b2bdf
tree755fcfdfbac926ecf70a89ed2ebb438a5b908987
parent1daca57aa8a10fe25edd4c9437e2c69ecf24571f
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: d21db514f64c ("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