]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: error checking when calling ocelot_init()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 18 Sep 2020 01:07:27 +0000 (04:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 20:52:34 +0000 (13:52 -0700)
commitc00d557a06df01a6dc743289011a9552768c0e31
treec156bc3b48b2cb7e4a68b360c3765c943bacff64
parentc35db7f3c4ed1bd211f33b647f5b27b241fab1d1
net: mscc: ocelot: error checking when calling ocelot_init()

ocelot_init() allocates memory, resets the switch and polls for a status
register, things which can fail. Stop probing the driver in that case,
and propagate the error result.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/ethernet/mscc/ocelot_vsc7514.c