提交 f4e9f3d2 编写于 作者: F Fabio Estevam 提交者: David S. Miller

fec: Place the phy regulator in the private structure

Instead of using a local reg_phy structure, let's put it inside the private
structure, so that we are able to have access to the regulator structure even
when we are outside fec_probe().

This is in preparation for controlling the FEC PHY regulator in the suspend and
resume functions.
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3904dcc4
...@@ -272,6 +272,7 @@ struct fec_enet_private { ...@@ -272,6 +272,7 @@ struct fec_enet_private {
int hwts_tx_en; int hwts_tx_en;
struct timer_list time_keep; struct timer_list time_keep;
struct fec_enet_delayed_work delay_work; struct fec_enet_delayed_work delay_work;
struct regulator *reg_phy;
}; };
void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev); void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev);
......
...@@ -1840,7 +1840,6 @@ fec_probe(struct platform_device *pdev) ...@@ -1840,7 +1840,6 @@ fec_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
const struct of_device_id *of_id; const struct of_device_id *of_id;
static int dev_id; static int dev_id;
struct regulator *reg_phy;
of_id = of_match_device(fec_dt_ids, &pdev->dev); of_id = of_match_device(fec_dt_ids, &pdev->dev);
if (of_id) if (of_id)
...@@ -1919,9 +1918,9 @@ fec_probe(struct platform_device *pdev) ...@@ -1919,9 +1918,9 @@ fec_probe(struct platform_device *pdev)
clk_prepare_enable(fep->clk_enet_out); clk_prepare_enable(fep->clk_enet_out);
clk_prepare_enable(fep->clk_ptp); clk_prepare_enable(fep->clk_ptp);
reg_phy = devm_regulator_get(&pdev->dev, "phy"); fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
if (!IS_ERR(reg_phy)) { if (!IS_ERR(fep->reg_phy)) {
ret = regulator_enable(reg_phy); ret = regulator_enable(fep->reg_phy);
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to enable phy regulator: %d\n", ret); "Failed to enable phy regulator: %d\n", ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册