net: dsa: don't do devlink port setup early
authorJiri Pirko <jiri@nvidia.com>
Thu, 29 Sep 2022 07:29:01 +0000 (09:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 01:17:16 +0000 (18:17 -0700)
commitc698a5fbf7fd9f5bb909d09626319b59d55db36b
treee9cce6ccbd55520a09d97b56658dfb8024d82aee
parentcf5ca4ddc37a693b17fdb653cb84b920b1185d71
net: dsa: don't do devlink port setup early

Commit 3122433eb533 ("net: dsa: Register devlink ports before calling DSA driver setup()")
moved devlink port setup to be done early before driver setup()
was called. That is no longer needed, so move the devlink port
initialization back to dsa_port_setup(), as the first thing done there.

Note there is no longer needed to reinit port as unused if
dsa_port_setup() fails, as it unregisters the devlink port instance on
the error path.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/dsa2.c