From 9e56b736d036c21ee3eac28d543315c53c9f8a66 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Mon, 7 Oct 2024 21:11:41 +0200 Subject: [PATCH] kernel: update drivers to be compatible with kernel 6.12 Update drivers to be compatible with kernel 6.12. Signed-off-by: Mieczyslaw Nalewaj --- .../ath79/files/drivers/mtd/nand/raw/ar934x_nand.c | 6 ++++++ .../ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c | 6 ++++++ .../ath79/files/drivers/mtd/nand/raw/rb91x_nand.c | 6 ++++++ .../ethernet/atheros/ag71xx/ag71xx_legacy_mdio.c | 7 +++++++ .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 7 +++++++ .../drivers/net/ethernet/broadcom/bcm6348-enet.c | 7 +++++++ .../drivers/net/ethernet/broadcom/bcm6368-enetsw.c | 7 +++++++ .../linux/generic/files/drivers/net/phy/adm6996.c | 6 ++++++ target/linux/generic/files/drivers/net/phy/ar8327.c | 13 +++++++------ .../generic/files/drivers/net/phy/b53/b53_mmap.c | 7 +++++++ .../generic/files/drivers/net/phy/b53/b53_srab.c | 7 +++++++ .../generic/files/drivers/net/phy/rtl8366_smi.c | 6 +++--- .../linux/generic/files/drivers/net/phy/rtl8366rb.c | 7 +++++++ .../linux/generic/files/drivers/net/phy/rtl8366s.c | 7 +++++++ .../linux/generic/files/drivers/net/phy/rtl8367.c | 7 +++++++ .../linux/generic/files/drivers/net/phy/rtl8367b.c | 7 +++++++ .../linux/generic/files/drivers/net/phy/swconfig.c | 2 +- .../files/drivers/net/phy/rtk/rtl8367s_mdio.c | 8 +++++++- .../files/drivers/dma/mediatek/hsdma-mt7621.c | 7 +++++++ target/linux/ramips/files/drivers/dma/ralink-gdma.c | 7 +++++++ .../ramips/files/drivers/mmc/host/mtk-mmc/sd.c | 7 +++++++ .../ramips/files/drivers/mtd/nand/raw/mt7621_nand.c | 7 +++++++ .../files/drivers/net/ethernet/ralink/esw_rt3050.c | 7 +++++++ .../files/drivers/net/ethernet/ralink/ethtool.c | 7 ++++--- .../files/drivers/net/ethernet/ralink/gsw_mt7620.c | 8 ++++++++ .../files/drivers/net/ethernet/ralink/mt7530.c | 3 ++- .../files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 7 +++++++ 27 files changed, 168 insertions(+), 15 deletions(-) diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c index 029142ca61..0e165f28c4 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c @@ -1452,7 +1452,11 @@ err_free_buf: return ret; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int ar934x_nfc_remove(struct platform_device *pdev) +#else +static void ar934x_nfc_remove(struct platform_device *pdev) +#endif { struct ar934x_nfc *nfc; @@ -1463,7 +1467,9 @@ static int ar934x_nfc_remove(struct platform_device *pdev) ar934x_nfc_free_buf(nfc); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id ar934x_nfc_match[] = { diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c index e42631525c..8eebf3047d 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c @@ -214,14 +214,20 @@ static int rb4xx_nand_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rb4xx_nand_remove(struct platform_device *pdev) +#else +static void rb4xx_nand_remove(struct platform_device *pdev) +#endif { struct rb4xx_nand *nand = platform_get_drvdata(pdev); mtd_device_unregister(nand_to_mtd(&nand->chip)); nand_cleanup(&nand->chip); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct platform_device_id rb4xx_nand_id_table[] = { diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c index cf2809bfa3..5502e0d379 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c @@ -335,13 +335,19 @@ static int rb91x_nand_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rb91x_nand_remove(struct platform_device *pdev) +#else +static void rb91x_nand_remove(struct platform_device *pdev) +#endif { struct rb91x_nand_drvdata *drvdata = platform_get_drvdata(pdev); rb91x_nand_release(drvdata); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id rb91x_nand_match[] = { diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_legacy_mdio.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_legacy_mdio.c index fda561a374..3f1efca9c4 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_legacy_mdio.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_legacy_mdio.c @@ -13,6 +13,7 @@ #include #include +#include #include "ag71xx.h" #define AG71XX_MDIO_RETRY 1000 @@ -221,12 +222,18 @@ static int ag71xx_mdio_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int ag71xx_mdio_remove(struct platform_device *pdev) +#else +static void ag71xx_mdio_remove(struct platform_device *pdev) +#endif { struct ag71xx_mdio *am = platform_get_drvdata(pdev); mdiobus_unregister(am->mii_bus); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id ag71xx_mdio_match[] = { diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index c6fcea1abd..3e013d5ec7 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ag71xx.h" #define AG71XX_DEFAULT_MSG_ENABLE \ @@ -1731,7 +1732,11 @@ err_phy_disconnect: return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int ag71xx_remove(struct platform_device *pdev) +#else +static void ag71xx_remove(struct platform_device *pdev) +#endif { struct net_device *dev = platform_get_drvdata(pdev); struct ag71xx *ag; @@ -1744,7 +1749,9 @@ static int ag71xx_remove(struct platform_device *pdev) ag71xx_phy_disconnect(ag); unregister_netdev(dev); platform_set_drvdata(pdev, NULL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id ag71xx_match[] = { diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c index 5e5259a492..0c82c31260 100644 --- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c +++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c @@ -25,6 +25,7 @@ #include #include #include +#include /* DMA channels */ #define DMA_CHAN_WIDTH 0x10 @@ -1675,7 +1676,11 @@ out_disable_clk: return ret; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int bcm6348_emac_remove(struct platform_device *pdev) +#else +static void bcm6348_emac_remove(struct platform_device *pdev) +#endif { struct net_device *ndev = platform_get_drvdata(pdev); struct bcm6348_emac *emac = netdev_priv(ndev); @@ -1689,7 +1694,9 @@ static int bcm6348_emac_remove(struct platform_device *pdev) for (i = 0; i < emac->num_clocks; i++) clk_disable_unprepare(emac->clock[i]); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id bcm6348_emac_of_match[] = { diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c index 7031a74490..cece6f1f5f 100644 --- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c +++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c @@ -20,6 +20,7 @@ #include #include #include +#include /* TODO: Bigger frames may work but we do not trust that they are safe on all * platforms so more research is needed, a max frame size of 2048 has been @@ -1100,7 +1101,11 @@ out_disable_clk: return ret; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int bcm6368_enetsw_remove(struct platform_device *pdev) +#else +static void bcm6368_enetsw_remove(struct platform_device *pdev) +#endif { struct device *dev = &pdev->dev; struct net_device *ndev = platform_get_drvdata(pdev); @@ -1119,7 +1124,9 @@ static int bcm6368_enetsw_remove(struct platform_device *pdev) for (i = 0; i < priv->num_clocks; i++) clk_disable_unprepare(priv->clock[i]); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id bcm6368_enetsw_of_match[] = { diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c index 66013f273d..271df815e2 100644 --- a/target/linux/generic/files/drivers/net/phy/adm6996.c +++ b/target/linux/generic/files/drivers/net/phy/adm6996.c @@ -1199,14 +1199,20 @@ static int adm6996_gpio_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int adm6996_gpio_remove(struct platform_device *pdev) +#else +static void adm6996_gpio_remove(struct platform_device *pdev) +#endif { struct adm6996_priv *priv = platform_get_drvdata(pdev); if (priv && (priv->model == ADM6996M || priv->model == ADM6996L)) unregister_switch(&priv->dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver adm6996_gpio_driver = { diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 3313149559..7bcc317e6a 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -15,6 +15,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -1171,7 +1172,7 @@ ar8327_sw_hw_apply(struct switch_dev *dev) return 0; } -int +static int ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -1189,7 +1190,7 @@ ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev, return 0; } -int +static int ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -1207,7 +1208,7 @@ ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev, return 0; } -int +static int ar8327_sw_get_igmp_snooping(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -1224,7 +1225,7 @@ ar8327_sw_get_igmp_snooping(struct switch_dev *dev, return 0; } -int +static int ar8327_sw_set_igmp_snooping(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -1240,7 +1241,7 @@ ar8327_sw_set_igmp_snooping(struct switch_dev *dev, return 0; } -int +static int ar8327_sw_get_igmp_v3(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -1256,7 +1257,7 @@ ar8327_sw_get_igmp_v3(struct switch_dev *dev, return 0; } -int +static int ar8327_sw_set_igmp_v3(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mmap.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mmap.c index 0a21ff1de5..241ba0f7d2 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_mmap.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mmap.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "b53_priv.h" @@ -217,14 +218,20 @@ static int b53_mmap_probe(struct platform_device *pdev) return b53_swconfig_switch_register(dev); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int b53_mmap_remove(struct platform_device *pdev) +#else +static void b53_mmap_remove(struct platform_device *pdev) +#endif { struct b53_device *dev = platform_get_drvdata(pdev); if (dev) b53_switch_remove(dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver b53_mmap_driver = { diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_srab.c b/target/linux/generic/files/drivers/net/phy/b53/b53_srab.c index ead5209cf0..e63a6c09db 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_srab.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_srab.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "b53_priv.h" @@ -354,14 +355,20 @@ static int b53_srab_probe(struct platform_device *pdev) return b53_swconfig_switch_register(dev); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int b53_srab_remove(struct platform_device *pdev) +#else +static void b53_srab_remove(struct platform_device *pdev) +#endif { struct b53_device *dev = platform_get_drvdata(pdev); if (dev) b53_switch_remove(dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver b53_srab_driver = { diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index a26fd204cb..89fc04fa64 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -254,7 +254,7 @@ static int __rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) #define MDC_MDIO_WRITE_OP 0x0003 #define MDC_REALTEK_PHY_ADDR 0x0 -int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) +static int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) { u32 phy_id = smi->phy_id; struct mii_bus *mbus = smi->ext_mbus; @@ -1527,7 +1527,7 @@ static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active) reset_control_deassert(smi->reset); } -int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi) +static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi) { int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0); int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0); @@ -1577,7 +1577,7 @@ static inline int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8 } #endif -int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi) +static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi) { struct rtl8366_platform_data *pdata = pdev->dev.platform_data; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index 0878ca9f14..8e985f0020 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "rtl8366_smi.h" @@ -1478,7 +1479,11 @@ static int rtl8366rb_probe(struct platform_device *pdev) return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rtl8366rb_remove(struct platform_device *pdev) +#else +static void rtl8366rb_remove(struct platform_device *pdev) +#endif { struct rtl8366_smi *smi = platform_get_drvdata(pdev); @@ -1489,7 +1494,9 @@ static int rtl8366rb_remove(struct platform_device *pdev) kfree(smi); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } #ifdef CONFIG_OF diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index d4045fcc06..9ecedd8e54 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "rtl8366_smi.h" @@ -1266,7 +1267,11 @@ static int rtl8366s_probe(struct platform_device *pdev) return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rtl8366s_remove(struct platform_device *pdev) +#else +static void rtl8366s_remove(struct platform_device *pdev) +#endif { struct rtl8366_smi *smi = platform_get_drvdata(pdev); @@ -1277,7 +1282,9 @@ static int rtl8366s_remove(struct platform_device *pdev) kfree(smi); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } #ifdef CONFIG_OF diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c index 950e9d2767..97dc4d2078 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "rtl8366_smi.h" @@ -1801,7 +1802,11 @@ static int rtl8367_probe(struct platform_device *pdev) return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rtl8367_remove(struct platform_device *pdev) +#else +static void rtl8367_remove(struct platform_device *pdev) +#endif { struct rtl8366_smi *smi = platform_get_drvdata(pdev); @@ -1812,7 +1817,9 @@ static int rtl8367_remove(struct platform_device *pdev) kfree(smi); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static void rtl8367_shutdown(struct platform_device *pdev) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c index 5f885aa5be..6345afb25c 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "rtl8366_smi.h" @@ -1600,7 +1601,11 @@ static int rtl8367b_probe(struct platform_device *pdev) return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rtl8367b_remove(struct platform_device *pdev) +#else +static void rtl8367b_remove(struct platform_device *pdev) +#endif { struct rtl8366_smi *smi = platform_get_drvdata(pdev); @@ -1611,7 +1616,9 @@ static int rtl8367b_remove(struct platform_device *pdev) kfree(smi); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static void rtl8367b_shutdown(struct platform_device *pdev) diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index 10dc8d0607..71dd5b31f5 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -1057,7 +1057,7 @@ static struct genl_family switch_fam = { }; #ifdef CONFIG_OF -void +static void of_switch_load_portmap(struct switch_dev *dev) { struct device_node *port; diff --git a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c index d958d622e0..69dc966b04 100644 --- a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c +++ b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c @@ -19,7 +19,7 @@ #include #include #include - +#include #include "./rtl8367c/include/rtk_switch.h" #include "./rtl8367c/include/port.h" @@ -283,12 +283,18 @@ static int rtk_gsw_probe(struct platform_device *pdev) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int rtk_gsw_remove(struct platform_device *pdev) +#else +static void rtk_gsw_remove(struct platform_device *pdev) +#endif { platform_set_drvdata(pdev, NULL); gsw_debug_proc_exit(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver gsw_driver = { diff --git a/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c b/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c index a3a9a7f4ae..35abdf8514 100644 --- a/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c +++ b/target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "../virt-dma.h" @@ -733,7 +734,11 @@ err_uninit_hsdma: return ret; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int mtk_hsdma_remove(struct platform_device *pdev) +#else +static void mtk_hsdma_remove(struct platform_device *pdev) +#endif { struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev); @@ -742,7 +747,9 @@ static int mtk_hsdma_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&hsdma->ddev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver mtk_hsdma_driver = { diff --git a/target/linux/ramips/files/drivers/dma/ralink-gdma.c b/target/linux/ramips/files/drivers/dma/ralink-gdma.c index e510a05ebb..cd7359ba0e 100644 --- a/target/linux/ramips/files/drivers/dma/ralink-gdma.c +++ b/target/linux/ramips/files/drivers/dma/ralink-gdma.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "virt-dma.h" @@ -890,7 +891,11 @@ err_unregister: return ret; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int gdma_dma_remove(struct platform_device *pdev) +#else +static void gdma_dma_remove(struct platform_device *pdev) +#endif { struct gdma_dma_dev *dma_dev = platform_get_drvdata(pdev); @@ -898,7 +903,9 @@ static int gdma_dma_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&dma_dev->ddev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver gdma_dma_driver = { diff --git a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c index df95900a26..7866dffdbc 100644 --- a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c +++ b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -2352,7 +2353,11 @@ host_free: } /* 4 device share one driver, using "drvdata" to show difference */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int msdc_drv_remove(struct platform_device *pdev) +#else +static void msdc_drv_remove(struct platform_device *pdev) +#endif { struct mmc_host *mmc; struct msdc_host *host; @@ -2378,7 +2383,9 @@ static int msdc_drv_remove(struct platform_device *pdev) mmc_free_host(host->mmc); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } /* Fix me: Power Flow */ diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c index 0ac191ea66..8f2da78ab6 100644 --- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c +++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* NFI core registers */ @@ -1312,7 +1313,11 @@ static int mt7621_nfc_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int mt7621_nfc_remove(struct platform_device *pdev) +#else +static void mt7621_nfc_remove(struct platform_device *pdev) +#endif { struct mt7621_nfc *nfc = platform_get_drvdata(pdev); struct nand_chip *nand = &nfc->nand; @@ -1322,7 +1327,9 @@ static int mt7621_nfc_remove(struct platform_device *pdev) mtd_device_unregister(mtd); nand_cleanup(nand); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id mt7621_nfc_id_table[] = { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c index bbb52d74b2..394325a358 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -1437,7 +1438,11 @@ static int esw_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int esw_remove(struct platform_device *pdev) +#else +static void esw_remove(struct platform_device *pdev) +#endif { struct rt305x_esw *esw = platform_get_drvdata(pdev); @@ -1446,7 +1451,9 @@ static int esw_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static const struct of_device_id ralink_esw_match[] = { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c index 5d4cebb089..63d904e4bf 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c @@ -13,6 +13,7 @@ */ #include "mtk_eth_soc.h" +#include "ethtool.h" static const char fe_gdma_str[][ETH_GSTRING_LEN] = { #define _FE(x...) # x, @@ -70,9 +71,9 @@ static void fe_get_drvinfo(struct net_device *dev, struct fe_priv *priv = netdev_priv(dev); struct fe_soc_data *soc = priv->soc; - strlcpy(info->driver, priv->dev->driver->name, sizeof(info->driver)); - strlcpy(info->version, MTK_FE_DRV_VERSION, sizeof(info->version)); - strlcpy(info->bus_info, dev_name(priv->dev), sizeof(info->bus_info)); + strscpy(info->driver, priv->dev->driver->name, sizeof(info->driver)); + strscpy(info->version, MTK_FE_DRV_VERSION, sizeof(info->version)); + strscpy(info->bus_info, dev_name(priv->dev), sizeof(info->bus_info)); if (soc->reg_table[FE_REG_FE_COUNTER_BASE]) info->n_stats = ARRAY_SIZE(fe_gdma_str); diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c index 154983494e..c8d0e54cd0 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include @@ -284,11 +286,17 @@ static int mt7620_gsw_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int mt7620_gsw_remove(struct platform_device *pdev) +#else +static void mt7620_gsw_remove(struct platform_device *pdev) +#endif { platform_set_drvdata(pdev, NULL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver gsw_driver = { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c index b4632d3990..0722dfb0aa 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -209,7 +210,7 @@ struct mt7530_mapping { }, }; -struct mt7530_mapping* +static struct mt7530_mapping* mt7530_find_mapping(struct device_node *np) { const char *map; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 4dff1340d7..2a943e494d 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -1638,7 +1639,11 @@ static int fe_probe(struct platform_device *pdev) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) static int fe_remove(struct platform_device *pdev) +#else +static void fe_remove(struct platform_device *pdev) +#endif { struct net_device *dev = platform_get_drvdata(pdev); struct fe_priv *priv = netdev_priv(dev); @@ -1649,7 +1654,9 @@ static int fe_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) return 0; +#endif } static struct platform_driver fe_driver = { -- 2.30.2