Re: [RFC PATCH 1/2] net: dsa: return early if there is no master

2021-02-23 Thread Michael Walle
I think you can also be more aggressive and remove the checks: if (!master) return -EINVAL; from dsa_port_send and dsa_port_recv. At least it sounds broken to me that this could ever happen. The following comment got me curious: /* * stop master onl

Re: [RFC PATCH 1/2] net: dsa: return early if there is no master

2021-02-23 Thread Michael Walle
Am 2021-02-23 17:32, schrieb Vladimir Oltean: On Tue, Feb 23, 2021 at 05:19:05PM +0100, Michael Walle wrote: It doesn't make sense to have DSA without a master port. Error out early if there is no master port. Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") Signed-off-by

Re: [RFC PATCH 1/2] net: dsa: return early if there is no master

2021-02-23 Thread Vladimir Oltean
On Tue, Feb 23, 2021 at 05:19:05PM +0100, Michael Walle wrote: > It doesn't make sense to have DSA without a master port. Error out early > if there is no master port. > > Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") > Signed-off-by: Michael Walle > --- Reviewed-by: Vla

[RFC PATCH 1/2] net: dsa: return early if there is no master

2021-02-23 Thread Michael Walle
It doesn't make sense to have DSA without a master port. Error out early if there is no master port. Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") Signed-off-by: Michael Walle --- net/dsa-uclass.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git