]> git.baikalelectronics.ru Git - kernel.git/commit
net: dpaa2-switch: call dpaa2_switch_port_disconnect_mac on probe error path
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 19 Aug 2021 14:40:19 +0000 (17:40 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Aug 2021 13:34:49 +0000 (14:34 +0100)
commita15ec4be22082a267818de5ebbafe9deaf492ec4
tree6a5f24642eb02efab99b2d8ad063eba5d0f93d7c
parent721df485a26a2f7a271c30f9c92a969879d5603d
net: dpaa2-switch: call dpaa2_switch_port_disconnect_mac on probe error path

Currently when probing returns an error, the netdev is freed but
phylink_disconnect is not called.

Create a common function between the unbind path and the error path,
call it the opposite of dpaa2_switch_probe_port: dpaa2_switch_remove_port,
and call it from both the unbind and the error path.

Fixes: 8e9853b6585b ("dpaa2-switch: integrate the MAC endpoint support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c