mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
net: stmmac: move stmmac_bus_clks_config() to stmmac_platform.c
stmmac_bus_clks_config() is only used by stmmac_platform.c, so rather than having it in stmmac_main.c and needing to export the symbol, move it to where it's used. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/E1v119j-0000000773s-1R2v@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
1d7e083250
commit
79d6e14e9c
@@ -404,7 +404,6 @@ int stmmac_dvr_probe(struct device *device,
|
||||
struct stmmac_resources *res);
|
||||
int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt);
|
||||
int stmmac_reinit_ringparam(struct net_device *dev, u32 rx_size, u32 tx_size);
|
||||
int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled);
|
||||
int stmmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
|
||||
phy_interface_t interface, int speed);
|
||||
|
||||
|
||||
@@ -147,39 +147,6 @@ static void stmmac_exit_fs(struct net_device *dev);
|
||||
|
||||
#define STMMAC_COAL_TIMER(x) (ns_to_ktime((x) * NSEC_PER_USEC))
|
||||
|
||||
int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
|
||||
{
|
||||
struct plat_stmmacenet_data *plat_dat = priv->plat;
|
||||
int ret;
|
||||
|
||||
if (enabled) {
|
||||
ret = clk_prepare_enable(plat_dat->stmmac_clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = clk_prepare_enable(plat_dat->pclk);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
return ret;
|
||||
}
|
||||
if (plat_dat->clks_config) {
|
||||
ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
clk_disable_unprepare(plat_dat->pclk);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
clk_disable_unprepare(plat_dat->pclk);
|
||||
if (plat_dat->clks_config)
|
||||
plat_dat->clks_config(plat_dat->bsp_priv, enabled);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(stmmac_bus_clks_config);
|
||||
|
||||
/**
|
||||
* stmmac_set_clk_tx_rate() - set the clock rate for the MAC transmit clock
|
||||
* @bsp_priv: BSP private data structure (unused)
|
||||
|
||||
@@ -911,6 +911,38 @@ void stmmac_pltfr_remove(struct platform_device *pdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
|
||||
|
||||
static int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
|
||||
{
|
||||
struct plat_stmmacenet_data *plat_dat = priv->plat;
|
||||
int ret;
|
||||
|
||||
if (enabled) {
|
||||
ret = clk_prepare_enable(plat_dat->stmmac_clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = clk_prepare_enable(plat_dat->pclk);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
return ret;
|
||||
}
|
||||
if (plat_dat->clks_config) {
|
||||
ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
clk_disable_unprepare(plat_dat->pclk);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clk_disable_unprepare(plat_dat->stmmac_clk);
|
||||
clk_disable_unprepare(plat_dat->pclk);
|
||||
if (plat_dat->clks_config)
|
||||
plat_dat->clks_config(plat_dat->bsp_priv, enabled);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused stmmac_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct net_device *ndev = dev_get_drvdata(dev);
|
||||
|
||||
Reference in New Issue
Block a user