realtek: fix kernel panic in DSA driver for 5.10
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Sat, 8 May 2021 08:28:58 +0000 (17:28 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 25 Sep 2021 22:32:18 +0000 (00:32 +0200)
commit2e676c05dccc7d5c5cf4ab118f479471be52194a
tree6fb3a2396869e0d8ff1e596ebd5a1d51bf587f0b
parent99a658cb71e474abf73ec77aa99b30b7eb2001a3
realtek: fix kernel panic in DSA driver for 5.10

dsa_to_port function in 5.10 returns dsa_port from the port list in
dsa_switch_tree, but the tree is built when the switch is registered
by dsa_register_switch and it's null in rtl83xx_mdio_probe.

So, we need to use dsa_to_port after the registration of the switch.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c