aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2020-06-05 12:42:21 +0200
committerRafał Miłecki <rafal@milecki.pl>2020-06-05 12:42:45 +0200
commit8c31afb978016ef71fa3bf0d4db583cf6970042b (patch)
tree42f9f62aecf6277df1f2229ad8718c671fd49e63 /target/linux
parent5b9ba4a93e83b731b9f315e0afb5fbb6f032b1b8 (diff)
downloadupstream-8c31afb978016ef71fa3bf0d4db583cf6970042b.tar.gz
upstream-8c31afb978016ef71fa3bf0d4db583cf6970042b.tar.bz2
upstream-8c31afb978016ef71fa3bf0d4db583cf6970042b.zip
kernel: b53: fix compilation with kernels 5.5+
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index 670588c84e..030c5c86d6 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -506,7 +506,15 @@ static int b53_configure_ports_of(struct b53_device *dev)
if (fixed_link) {
u32 spd;
u8 po = GMII_PO_LINK;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
+ phy_interface_t mode;
+#else
int mode = of_get_phy_mode(pn);
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
+ of_get_phy_mode(pn, &mode);
+#endif
if (!of_property_read_u32(fixed_link, "speed", &spd)) {
switch (spd) {