siflower: 6.12: apply trivial driver fixes
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 <mx@kevinmx.top> Tested-by: Zhu Yujie <libriunc@gmail.com> Tested-by: Chuanhong Guo gch981213@gmail.com Signed-off-by: Zhu Yujie <libriunc@gmail.com> [ improve commit description ] Link: https://github.com/openwrt/openwrt/pull/20555 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
c5e8ee681b
commit
25c6c2678e
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
obj-$(CONFIG_NET_SIFLOWER_ETH_XPCS) += sfxpcs.o
|
||||
|
||||
@ -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__ */
|
||||
#endif /* __SF_DPNS_H__ */
|
||||
|
||||
@ -779,4 +779,4 @@ enum {
|
||||
};
|
||||
#define XGMAC_RDES3_IOC BIT(30)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
|
||||
@ -47,4 +47,4 @@ int dpns_se_init(struct dpns_priv *priv) {
|
||||
|
||||
ret = dpns_populate_table(priv);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,4 +74,4 @@
|
||||
#define SE_TCAM_CLR_ACL_SPL BIT(5)
|
||||
#define SE_TCAM_CLR_BLK(x) BIT(x)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -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 <qingfang.deng@siflower.com.cn>");
|
||||
MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
|
||||
MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
|
||||
|
||||
@ -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
|
||||
#endif
|
||||
|
||||
@ -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 <qingfang.deng@siflower.com.cn>");
|
||||
MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");
|
||||
MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user