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)
commit860fe1f87eca4a2dad9ef8a703f2d046db43c2bb
tree6a5f24642eb02efab99b2d8ad063eba5d0f93d7c
parentd52ef12f7d6c016f3b249db95af33f725e3dd065
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: 84cba72956fd ("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