siflower: 6.12: apply trivial driver fixes
authorZhu Yujie <[email protected]>
Wed, 19 Nov 2025 09:09:52 +0000 (17:09 +0800)
committerChristian Marangi <[email protected]>
Wed, 19 Nov 2025 19:57:32 +0000 (20:57 +0100)
Apply trivial fixes for 6.12 files:
- Make functions static
- Add lots of missing header in drivers
- Fix no newline at end of file error and other new line error
- Drop deprecated validate function for xgmac
- Use devm for stmmac probe
- Remove host_ prefix from pcie_host_ops

Tested-by: Jingkun Zheng <[email protected]>
Tested-by: Zhu Yujie <[email protected]>
Tested-by: Chuanhong Guo [email protected]
Signed-off-by: Zhu Yujie <[email protected]>
[ improve commit description ]
Link: https://github.com/openwrt/openwrt/pull/20555
Signed-off-by: Christian Marangi <[email protected]>
15 files changed:
target/linux/siflower/files-6.12/drivers/clk/siflower/clk-sf19a2890.c
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/Makefile
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/dpns.h
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/eth.h
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sf_dpns.c
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sf_dpns_se.c
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sf_dpns_se.h
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sfxgmac-dma.c
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sfxgmac-ext.h
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sfxgmac.c
target/linux/siflower/files-6.12/drivers/net/ethernet/siflower/sfxpcs.c
target/linux/siflower/files-6.12/drivers/net/ethernet/stmicro/stmmac/dwmac-sf19a2890.c
target/linux/siflower/files-6.12/drivers/net/phy/siflower.c
target/linux/siflower/files-6.12/drivers/pci/controller/dwc/pcie-sf21.c
target/linux/siflower/files-6.12/drivers/phy/siflower/Kconfig

index a8644156aadea381d11013f9916d5682ae111547..30afd3279a9d946a551b3c819fcd88b8a27653dc 100644 (file)
@@ -209,7 +209,7 @@ static unsigned long sf19a28_muxdiv_recalc_rate(struct clk_hw *hw,
        return parent_rate / div;
 }
 
-int sf19a28_muxdiv_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
+static int sf19a28_muxdiv_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
 {
        unsigned int div;
 
index 557edb5abc90d5acc8d4d9caea2f3f4bf25fb083..8149666b08fac1ce0f097477b2321090c19052c7 100644 (file)
@@ -8,4 +8,4 @@ obj-$(CONFIG_NET_SIFLOWER_ETH_DPNS) += sf_dpns.o
 
 obj-$(CONFIG_NET_SIFLOWER_ETH_XGMAC) += sfxgmac.o
 obj-$(CONFIG_NET_SIFLOWER_ETH_DMA) += sfxgmac-dma.o
-obj-$(CONFIG_NET_SIFLOWER_ETH_XPCS) += sfxpcs.o
\ No newline at end of file
+obj-$(CONFIG_NET_SIFLOWER_ETH_XPCS) += sfxpcs.o
index 1db8139b08304d6927d263ee897774f65409cb12..59d97b89557094c21d2f925ed69e0b016a670021 100644 (file)
@@ -56,4 +56,4 @@ int dpns_se_init(struct dpns_priv *priv);
 int dpns_tmu_init(struct dpns_priv *priv);
 void sf_dpns_debugfs_init(struct dpns_priv *priv);
 
-#endif /* __SF_DPNS_H__ */
\ No newline at end of file
+#endif /* __SF_DPNS_H__ */
index 0a813d9489de1d05c932efb27e5bd9f4ff77aad6..a065c46eba7f0f707173d3c9344e99d69bc2a17f 100644 (file)
@@ -779,4 +779,4 @@ enum {
 };
 #define XGMAC_RDES3_IOC                        BIT(30)
 
-#endif
\ No newline at end of file
+#endif
index 4e00b5b7dd9c6f487894cc8ffedd08c4133754f4..1cd5262c0ae5f7bb70c79a8c52405f70c9a83ba4 100644 (file)
@@ -1,13 +1,18 @@
-#include "linux/delay.h"
-#include "linux/reset.h"
 #include <linux/bitfield.h>
 #include <linux/clk.h>
+#include <linux/debugfs.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_net.h>
 #include <linux/of_platform.h>
-#include <linux/device.h>
-#include <linux/debugfs.h>
+#include <linux/platform_device.h>
+#include <linux/reset.h>
+
 #include "dpns.h"
 
 
index 2b5e13e56b3b0f4b92df218ef6cfc73bb1fa95fd..df8119721229699c52329624797f328e6e1a3e9c 100644 (file)
@@ -47,4 +47,4 @@ int dpns_se_init(struct dpns_priv *priv) {
 
        ret = dpns_populate_table(priv);
        return ret;
-}
\ No newline at end of file
+}
index 2e29092f20373483ca48a43f6468aa167bc6b033..56afe7104ed98842a012d113ba64dd95912a9859 100644 (file)
@@ -74,4 +74,4 @@
 #define  SE_TCAM_CLR_ACL_SPL           BIT(5)
 #define  SE_TCAM_CLR_BLK(x)            BIT(x)
 
-#endif
\ No newline at end of file
+#endif
index 3061b89e42849ec32a4dc05b214534d8b6180ca7..2575ea180f7adbcfecbef28da72c26c2c204e7f7 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/debugfs.h>
 #include <linux/dma-mapping.h>
 #include <linux/if_ether.h>
+#include <linux/platform_device.h>
 #include <linux/of_platform.h>
 #include <linux/seq_file.h>
 #include <linux/tcp.h>
@@ -737,7 +738,7 @@ static int xgmac_dma_alloc_rx_descs(struct xgmac_dma_priv *priv)
        int ret = -ENOMEM;
        u32 i;
 
-       pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV | PP_FLAG_PAGE_FRAG;
+       pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
        pp_params.pool_size = DMA_RX_SIZE;
        pp_params.order = 0;
        pp_params.max_len = PAGE_SIZE;
@@ -1116,7 +1117,7 @@ drop:
 }
 
 
-netdev_tx_t xgmac_dma_xmit(struct sk_buff *skb, struct xgmac_dma_priv *priv)
+static netdev_tx_t xgmac_dma_xmit(struct sk_buff *skb, struct xgmac_dma_priv *priv)
 {
        u16 queue = skb_get_queue_mapping(skb);
        u16 channel = queue;
@@ -1615,4 +1616,4 @@ module_platform_driver(xgmac_dma_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Qingfang Deng <[email protected]>");
-MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
\ No newline at end of file
+MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
index 4524daddfd0c80c75b8e601c314283060aa850d4..59efff011862699fa551e0d1ebe05696fc10a5d9 100644 (file)
@@ -1,4 +1,4 @@
-#ifndef __XGMAC_EXT_H_
+#ifndef __XGMAC_EXT_H__
 #define __XGMAC_EXT_H__
 
 #include <linux/clk.h>
@@ -28,4 +28,4 @@ struct gmac_common {
        GMAC_COMMON_STRUCT;
 };
 
-#endif
\ No newline at end of file
+#endif
index 5eec4ff66755f95c5390d2952846e18dd93cc170..bd111ae5bb27ab49bf4005b7a7384b1d9e81b792 100644 (file)
@@ -9,6 +9,9 @@
 #include <linux/if.h>
 #include <linux/if_vlan.h>
 #include <linux/crc32.h>
+#include <linux/platform_device.h>
+#include <linux/phylink.h>
+#include <linux/reset.h>
 
 #include "dma.h"
 #include "eth.h"
@@ -676,31 +679,6 @@ static const struct net_device_ops xgmac_netdev_ops = {
        .ndo_change_mtu         = xgmac_change_mtu,
 };
 
-static void xgmac_validate(struct phylink_config *config,
-                          unsigned long *supported,
-                          struct phylink_link_state *state)
-{
-       __ETHTOOL_DECLARE_LINK_MODE_MASK(mac_supported) = {};
-
-       phylink_set(mac_supported, 10baseT_Half);
-       phylink_set(mac_supported, 10baseT_Full);
-       phylink_set(mac_supported, 100baseT_Half);
-       phylink_set(mac_supported, 100baseT_Full);
-       phylink_set(mac_supported, 1000baseT_Full);
-       phylink_set(mac_supported, 1000baseX_Full);
-       phylink_set(mac_supported, 1000baseKX_Full);
-       phylink_set(mac_supported, 2500baseT_Full);
-       phylink_set(mac_supported, 2500baseX_Full);
-
-       phylink_set(mac_supported, Autoneg);
-       phylink_set(mac_supported, Pause);
-       phylink_set(mac_supported, Asym_Pause);
-       phylink_set_port_modes(mac_supported);
-
-       linkmode_and(supported, supported, mac_supported);
-       linkmode_and(state->advertising, state->advertising, mac_supported);
-}
-
 static struct xgmac_priv *sfxgmac_phylink_to_port(struct phylink_config *config)
 {
        return container_of(config, struct xgmac_priv, phylink_config);
@@ -875,7 +853,6 @@ static void xgmac_mac_link_up(struct phylink_config *config,
 }
 
 static const struct phylink_mac_ops xgmac_phylink_mac_ops = {
-       .validate       = xgmac_validate,
        .mac_select_pcs = xgmac_mac_selct_pcs,
        .mac_config     = xgmac_mac_config,
        .mac_link_down  = xgmac_mac_link_down,
@@ -980,37 +957,37 @@ static int xgmac_ethtool_get_link_ksettings(struct net_device *dev,
        return phylink_ethtool_ksettings_get(priv->phylink, cmd);
 }
 
-static int xgmac_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *e)
+static int xgmac_ethtool_get_eee(struct net_device *dev, struct ethtool_keee *eee)
 {
        struct xgmac_priv *priv = netdev_priv(dev);
        int ret;
 
-       ret = phylink_ethtool_get_eee(priv->phylink, e);
+       ret = phylink_ethtool_get_eee(priv->phylink, eee);
        if (ret)
                return ret;
 
-       e->tx_lpi_enabled = priv->tx_lpi_enabled;
-       e->tx_lpi_timer = reg_read(priv, XGMAC_LPI_AUTO_EN);
+       eee->tx_lpi_enabled = priv->tx_lpi_enabled;
+       eee->tx_lpi_timer = reg_read(priv, XGMAC_LPI_AUTO_EN);
 
        return 0;
 }
 
-static int xgmac_ethtool_set_eee(struct net_device *dev, struct ethtool_eee *e)
+static int xgmac_ethtool_set_eee(struct net_device *dev, struct ethtool_keee *eee)
 {
        struct xgmac_priv *priv = netdev_priv(dev);
        int ret;
 
-       if (e->tx_lpi_timer > XGMAC_LPI_AUTO_EN_MAX)
+       if (eee->tx_lpi_timer > XGMAC_LPI_AUTO_EN_MAX)
                return -EINVAL;
 
-       ret = phylink_ethtool_set_eee(priv->phylink, e);
+       ret = phylink_ethtool_set_eee(priv->phylink, eee);
        if (ret)
                return ret;
 
-       priv->tx_lpi_enabled = e->tx_lpi_enabled;
+       priv->tx_lpi_enabled = eee->tx_lpi_enabled;
        xgmac_toggle_tx_lpi(priv);
 
-       reg_write(priv, XGMAC_LPI_AUTO_EN, e->tx_lpi_timer);
+       reg_write(priv, XGMAC_LPI_AUTO_EN, eee->tx_lpi_timer);
 
        return 0;
 }
@@ -1221,7 +1198,7 @@ static int xgmac_probe(struct platform_device *pdev)
        ndev->netdev_ops = &xgmac_netdev_ops;
        ndev->ethtool_ops = &xgmac_ethtool_ops;
        ndev->features = NETIF_F_RXHASH | NETIF_F_RXCSUM | NETIF_F_GRO |
-                        NETIF_F_SG | NETIF_F_LLTX | NETIF_F_HW_TC |
+                        NETIF_F_SG | NETIF_F_HW_TC |
                         NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO |
                         NETIF_F_TSO6;
        ndev->hw_features = (ndev->features & ~NETIF_F_RXHASH) |
@@ -1321,4 +1298,4 @@ module_platform_driver(xgmac_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Qingfang Deng <[email protected]>");
-MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");
\ No newline at end of file
+MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");
index 9c75076cdc3d57515c9ae74678be9b39f351467d..ae20940f5acac86705d87612a0e9c0d89ece1f38 100644 (file)
@@ -1,5 +1,9 @@
 #define pr_fmt(fmt)    "xpcs: " fmt
 
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/interrupt.h> 
 #include <linux/clk.h>
 #include <linux/mfd/syscon.h>
 #include <linux/phylink.h>
index 05067e9a43816930604b6a40b3b07c75de6cfa74..5a0024f82774b1233b36616c02d94fc30570d43e 100644 (file)
@@ -145,7 +145,7 @@ static int sf19a2890_gmac_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
+       plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
        if (IS_ERR(plat_dat)) {
                dev_err(&pdev->dev, "dt configuration failed\n");
                return PTR_ERR(plat_dat);
@@ -160,14 +160,6 @@ static int sf19a2890_gmac_probe(struct platform_device *pdev)
        plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;
 
        ret = stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
-       if (ret)
-               goto err_remove_config_dt;
-
-       return 0;
-
-err_remove_config_dt:
-       if (pdev->dev.of_node)
-               stmmac_remove_config_dt(pdev, plat_dat);
 
        return ret;
 }
index b23335408fae898ef51fc2d18db93882f9e79456..22acb5b67e89d43d177ab0269e843dc653e58c58 100644 (file)
@@ -410,7 +410,7 @@ static int sfphy_restart_aneg(struct phy_device *phydev)
        return 0;
 }
 
-int sf1211f_config_aneg(struct phy_device *phydev)
+static int sf1211f_config_aneg(struct phy_device *phydev)
 {
        int ret, phymode, oldpage = 0;
 
@@ -450,7 +450,7 @@ int sf1211f_config_aneg(struct phy_device *phydev)
        return 0;
 }
 
-int sf1211f_aneg_done(struct phy_device *phydev)
+static int sf1211f_aneg_done(struct phy_device *phydev)
 {
        int val = 0;
 
@@ -757,7 +757,7 @@ static int phy_mode_set(struct phy_device *phydev, u16 phyMode)
 }
 #endif
 
-int sf1240_config_init(struct phy_device *phydev)
+static int sf1240_config_init(struct phy_device *phydev)
 {
        int ret;
                ret = genphy_read_abilities(phydev);
@@ -771,7 +771,7 @@ int sf1240_config_init(struct phy_device *phydev)
        return 0;
 }
 
-int sf1211f_config_init(struct phy_device *phydev)
+static int sf1211f_config_init(struct phy_device *phydev)
 {
        int ret, phymode;
 
index ce9c05710df3cacc6047e6f04b13d825f450409f..a32695260f7c3a3d144446161c56c8807491b50c 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
@@ -221,7 +220,7 @@ static int sf_pcie_host_init(struct dw_pcie_rp *pp)
        return 0;
 }
 
-void sf_pcie_host_deinit(struct dw_pcie_rp *pp) {
+static void sf_pcie_host_deinit(struct dw_pcie_rp *pp) {
        struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
        struct sf_pcie *sf_pcie = to_sf_pcie(pci);
 
@@ -235,8 +234,8 @@ void sf_pcie_host_deinit(struct dw_pcie_rp *pp) {
 }
 
 static const struct dw_pcie_host_ops sf_pcie_host_ops = {
-       .host_init = sf_pcie_host_init,
-       .host_deinit = sf_pcie_host_deinit,
+       .init = sf_pcie_host_init,
+       .deinit = sf_pcie_host_deinit,
 };
 
 static int sf_pcie_start_link(struct dw_pcie *pci)
index 5124c81f7953d07ad674737435da2abfae3f0bc8..6b815a3c47dcb10e6678ca9bb93b0d518aeaa802 100644 (file)
@@ -13,7 +13,6 @@ config PHY_SF21_PCIE
        help
          Enable this to support the PCIE PHY on the Siflower SF21A6826 SoC.
 
-
 config PHY_SF21_USB
        tristate "Siflower SF21A6826/SF21H8898 USB2.0 PHY driver"
        default n