Skip to content

Commit b2504f6

Browse files
xhackerustcdavem330
authored andcommitted
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: Jisheng Zhang <jszhang@kernel.org> Suggested-by: Russell King <linux@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2c9fc83 commit b2504f6

2 files changed

Lines changed: 17 additions & 34 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,22 @@ static int stmmac_of_get_mac_mode(struct device_node *np)
387387
return -ENODEV;
388388
}
389389

390+
/**
391+
* stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt()
392+
* @pdev: platform_device structure
393+
* @plat: driver data platform structure
394+
*
395+
* Release resources claimed by stmmac_probe_config_dt().
396+
*/
397+
static void stmmac_remove_config_dt(struct platform_device *pdev,
398+
struct plat_stmmacenet_data *plat)
399+
{
400+
clk_disable_unprepare(plat->stmmac_clk);
401+
clk_disable_unprepare(plat->pclk);
402+
of_node_put(plat->phy_node);
403+
of_node_put(plat->mdio_node);
404+
}
405+
390406
/**
391407
* stmmac_probe_config_dt - parse device-tree driver parameters
392408
* @pdev: platform_device structure
@@ -395,7 +411,7 @@ static int stmmac_of_get_mac_mode(struct device_node *np)
395411
* this function is to read the driver parameters from device-tree and
396412
* set some private fields that will be used by the main at runtime.
397413
*/
398-
struct plat_stmmacenet_data *
414+
static struct plat_stmmacenet_data *
399415
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
400416
{
401417
struct device_node *np = pdev->dev.of_node;
@@ -665,43 +681,14 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
665681

666682
return plat;
667683
}
668-
669-
/**
670-
* stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt()
671-
* @pdev: platform_device structure
672-
* @plat: driver data platform structure
673-
*
674-
* Release resources claimed by stmmac_probe_config_dt().
675-
*/
676-
void stmmac_remove_config_dt(struct platform_device *pdev,
677-
struct plat_stmmacenet_data *plat)
678-
{
679-
clk_disable_unprepare(plat->stmmac_clk);
680-
clk_disable_unprepare(plat->pclk);
681-
of_node_put(plat->phy_node);
682-
of_node_put(plat->mdio_node);
683-
}
684684
#else
685-
struct plat_stmmacenet_data *
686-
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
687-
{
688-
return ERR_PTR(-EINVAL);
689-
}
690-
691685
struct plat_stmmacenet_data *
692686
devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
693687
{
694688
return ERR_PTR(-EINVAL);
695689
}
696-
697-
void stmmac_remove_config_dt(struct platform_device *pdev,
698-
struct plat_stmmacenet_data *plat)
699-
{
700-
}
701690
#endif /* CONFIG_OF */
702-
EXPORT_SYMBOL_GPL(stmmac_probe_config_dt);
703691
EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
704-
EXPORT_SYMBOL_GPL(stmmac_remove_config_dt);
705692

706693
int stmmac_get_platform_resources(struct platform_device *pdev,
707694
struct stmmac_resources *stmmac_res)

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@
1111

1212
#include "stmmac.h"
1313

14-
struct plat_stmmacenet_data *
15-
stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
1614
struct plat_stmmacenet_data *
1715
devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
18-
void stmmac_remove_config_dt(struct platform_device *pdev,
19-
struct plat_stmmacenet_data *plat);
2016

2117
int stmmac_get_platform_resources(struct platform_device *pdev,
2218
struct stmmac_resources *stmmac_res);

0 commit comments

Comments
 (0)