net: dsa: remove master santiy check
authorMichael Walle <michael@walle.cc>
Wed, 24 Feb 2021 16:40:42 +0000 (17:40 +0100)
committerPriyanka Jain <priyanka.jain@nxp.com>
Fri, 5 Mar 2021 04:55:42 +0000 (10:25 +0530)
commit714555374f2ff889cecbde62938a17e9678a0f09
treeb60217a3d691ce7b7a4c8881e56b6a64873e920e
parent108157c468eed8291c866415b8708eb2a8735dc4
net: dsa: remove master santiy check

Because we probe the master ourselves (and fail if there is no master),
it is not possible that we don't have a master device.

There is one catch though: device removal. We don't support that. It
wasn't supported neither before this patch. Because the master device
was only set in .pre_probe(), if a device was removed master_dev was a
dangling pointer and transmitting a frame cause a panic. I don't see a
good solution without having some sort of notify machanism when a
udevice is removed.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Michael Walle <michael@walle.cc> [DSA unit tests]
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
net/dsa-uclass.c