Skip to content
Commit a6aaa003 authored by Dinh Nguyen's avatar Dinh Nguyen Committed by David S. Miller
Browse files

net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link



When using a fixed-link, the altr_tse_pcs driver crashes
due to null-pointer dereference as no phy_device is provided to
tse_pcs_fix_mac_speed function. Fix this by adding a check for
phy_dev before calling the tse_pcs_fix_mac_speed() function.

Also clean up the tse_pcs_fix_mac_speed function a bit. There is
no need to check for splitter_base and sgmii_adapter_base
because the driver will fail if these 2 variables are not
derived from the device tree.

Fixes: fb3bbdb8 ("net: ethernet: Add TSE PCS support to dwmac-socfpga")
Signed-off-by: default avatarDinh Nguyen <dinguyen@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2cd2cde
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment