Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: axienet: factor out phy_node in struct axienet_local

the struct member `phy_node` of struct axienet_local is not used by the
driver anymore after initialization. It might be a remnent of old code
and could be removed.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Chiu and committed by
David S. Miller
ab3a5d4c d1c4f93e

+5 -10
-2
drivers/net/ethernet/xilinx/xilinx_axienet.h
··· 433 433 struct net_device *ndev; 434 434 struct device *dev; 435 435 436 - struct device_node *phy_node; 437 - 438 436 struct phylink *phylink; 439 437 struct phylink_config phylink_config; 440 438
+5 -8
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 2071 2071 2072 2072 if (lp->phy_mode == PHY_INTERFACE_MODE_SGMII || 2073 2073 lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX) { 2074 - lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); 2075 - if (!lp->phy_node) { 2074 + np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); 2075 + if (!np) { 2076 2076 dev_err(&pdev->dev, "phy-handle required for 1000BaseX/SGMII\n"); 2077 2077 ret = -EINVAL; 2078 2078 goto cleanup_mdio; 2079 2079 } 2080 - lp->pcs_phy = of_mdio_find_device(lp->phy_node); 2080 + lp->pcs_phy = of_mdio_find_device(np); 2081 2081 if (!lp->pcs_phy) { 2082 2082 ret = -EPROBE_DEFER; 2083 + of_node_put(np); 2083 2084 goto cleanup_mdio; 2084 2085 } 2086 + of_node_put(np); 2085 2087 lp->pcs.ops = &axienet_pcs_ops; 2086 2088 lp->pcs.poll = true; 2087 2089 } ··· 2126 2124 put_device(&lp->pcs_phy->dev); 2127 2125 if (lp->mii_bus) 2128 2126 axienet_mdio_teardown(lp); 2129 - of_node_put(lp->phy_node); 2130 - 2131 2127 cleanup_clk: 2132 2128 clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); 2133 2129 clk_disable_unprepare(lp->axi_clk); ··· 2153 2153 2154 2154 clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); 2155 2155 clk_disable_unprepare(lp->axi_clk); 2156 - 2157 - of_node_put(lp->phy_node); 2158 - lp->phy_node = NULL; 2159 2156 2160 2157 free_netdev(ndev); 2161 2158