[OpenWrt-Devel] [RFT PATCH 5/6] ath25: fix compilation with kernel 5.4

Adrian Schmutzler freifunk at adrianschmutzler.de
Mon Apr 13 13:11:22 EDT 2020


1. Kernel commit e7bfb3fdbde3 ("mtd: Stop updating erase_info->state
   and calling mtd_erase_callback()") removed erase_info->state
   updates and calls of mtd_erase_callback(). Do the same for our
   local MTD driver

2. Use phy_set_max_speed() to limit advertised speed. This is needed
   to suppress compilation errors:

   drivers/net/ethernet/atheros/ar231x/ar231x.c:1153:20: ...
     error: assignment to expression with array type
     phydev->supported &= (SUPPORTED_10baseT_Half
                       ^~

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../ath25/patches-5.4/110-ar2313_ethernet.patch    | 14 ++------------
 target/linux/ath25/patches-5.4/120-spiflash.patch  |  5 +----
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch b/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch
index 916e57cb36..130569ea0e 100644
--- a/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch
+++ b/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch
@@ -33,7 +33,7 @@
 +obj-$(CONFIG_NET_AR231X) += ar231x.o
 --- /dev/null
 +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
-@@ -0,0 +1,1119 @@
+@@ -0,0 +1,1109 @@
 +/*
 + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
 + *
@@ -1133,17 +1133,7 @@
 +		return PTR_ERR(phydev);
 +	}
 +
-+	/* mask with MAC supported features */
-+	phydev->supported &= (SUPPORTED_10baseT_Half
-+		| SUPPORTED_10baseT_Full
-+		| SUPPORTED_100baseT_Half
-+		| SUPPORTED_100baseT_Full
-+		| SUPPORTED_Autoneg
-+		/* | SUPPORTED_Pause | SUPPORTED_Asym_Pause */
-+		| SUPPORTED_MII
-+		| SUPPORTED_TP);
-+
-+	phydev->advertising = phydev->supported;
++	phy_set_max_speed(phydev, SPEED_100);
 +
 +	sp->phy_dev = phydev;
 +
diff --git a/target/linux/ath25/patches-5.4/120-spiflash.patch b/target/linux/ath25/patches-5.4/120-spiflash.patch
index d49669b976..52460f89dd 100644
--- a/target/linux/ath25/patches-5.4/120-spiflash.patch
+++ b/target/linux/ath25/patches-5.4/120-spiflash.patch
@@ -23,7 +23,7 @@
  obj-$(CONFIG_MTD_POWERNV_FLASH)	+= powernv_flash.o
 --- /dev/null
 +++ b/drivers/mtd/devices/ar2315.c
-@@ -0,0 +1,459 @@
+@@ -0,0 +1,456 @@
 +
 +/*
 + * MTD driver for the SPI Flash Memory support on Atheros AR2315
@@ -284,9 +284,6 @@
 +
 +	mutex_unlock(&priv->lock);
 +
-+	instr->state = MTD_ERASE_DONE;
-+	mtd_erase_callback(instr);
-+
 +	return 0;
 +}
 +
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list