Commit b2504f64 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by David S. Miller

net: stmmac: make stmmac_{probe|remove}_config_dt static

Now there's no external users of these two functions, make them static
so that there aren't any new usages of stmmac_probe_config_dt().

To avoid forward declaration, move stmmac_remove_config_dt() location.
Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Suggested-by: default avatarRussell King <linux@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c9fc838
...@@ -387,6 +387,22 @@ static int stmmac_of_get_mac_mode(struct device_node *np) ...@@ -387,6 +387,22 @@ static int stmmac_of_get_mac_mode(struct device_node *np)
return -ENODEV; return -ENODEV;
} }
/**
* stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt()
* @pdev: platform_device structure
* @plat: driver data platform structure
*
* Release resources claimed by stmmac_probe_config_dt().
*/
static void stmmac_remove_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat)
{
clk_disable_unprepare(plat->stmmac_clk);
clk_disable_unprepare(plat->pclk);
of_node_put(plat->phy_node);
of_node_put(plat->mdio_node);
}
/** /**
* stmmac_probe_config_dt - parse device-tree driver parameters * stmmac_probe_config_dt - parse device-tree driver parameters
* @pdev: platform_device structure * @pdev: platform_device structure
...@@ -395,7 +411,7 @@ static int stmmac_of_get_mac_mode(struct device_node *np) ...@@ -395,7 +411,7 @@ static int stmmac_of_get_mac_mode(struct device_node *np)
* this function is to read the driver parameters from device-tree and * this function is to read the driver parameters from device-tree and
* set some private fields that will be used by the main at runtime. * set some private fields that will be used by the main at runtime.
*/ */
struct plat_stmmacenet_data * static struct plat_stmmacenet_data *
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
...@@ -665,43 +681,14 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) ...@@ -665,43 +681,14 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
return plat; return plat;
} }
/**
* stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt()
* @pdev: platform_device structure
* @plat: driver data platform structure
*
* Release resources claimed by stmmac_probe_config_dt().
*/
void stmmac_remove_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat)
{
clk_disable_unprepare(plat->stmmac_clk);
clk_disable_unprepare(plat->pclk);
of_node_put(plat->phy_node);
of_node_put(plat->mdio_node);
}
#else #else
struct plat_stmmacenet_data *
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
{
return ERR_PTR(-EINVAL);
}
struct plat_stmmacenet_data * struct plat_stmmacenet_data *
devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
{ {
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
void stmmac_remove_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat)
{
}
#endif /* CONFIG_OF */ #endif /* CONFIG_OF */
EXPORT_SYMBOL_GPL(stmmac_probe_config_dt);
EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt); EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
EXPORT_SYMBOL_GPL(stmmac_remove_config_dt);
int stmmac_get_platform_resources(struct platform_device *pdev, int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res) struct stmmac_resources *stmmac_res)
......
...@@ -11,12 +11,8 @@ ...@@ -11,12 +11,8 @@
#include "stmmac.h" #include "stmmac.h"
struct plat_stmmacenet_data *
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
struct plat_stmmacenet_data * struct plat_stmmacenet_data *
devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac); devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
void stmmac_remove_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat);
int stmmac_get_platform_resources(struct platform_device *pdev, int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res); struct stmmac_resources *stmmac_res);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment