lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SA1PR02MB856090D65A74C6A47A7D80FCC7E49@SA1PR02MB8560.namprd02.prod.outlook.com>
Date:   Tue, 5 Apr 2022 12:09:40 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Andy Chiu <andy.chiu@...ive.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Michal Simek <michals@...inx.com>
CC:     "andrew@...n.ch" <andrew@...n.ch>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Greentime Hu <greentime.hu@...ive.com>,
        Robert Hancock <robert.hancock@...ian.com>
Subject: RE: [PATCH v8 net-next 2/4] net: axienet: factor out phy_node in
 struct axienet_local

> -----Original Message-----
> From: Andy Chiu <andy.chiu@...ive.com>
> Sent: Tuesday, April 5, 2022 2:49 PM
> To: davem@...emloft.net; Michal Simek <michals@...inx.com>; Radhey
> Shyam Pandey <radheys@...inx.com>
> Cc: andrew@...n.ch; kuba@...nel.org; pabeni@...hat.com;
> robh+dt@...nel.org; krzk+dt@...nel.org; linux@...linux.org.uk;
> netdev@...r.kernel.org; devicetree@...r.kernel.org; Andy Chiu
> <andy.chiu@...ive.com>; Greentime Hu <greentime.hu@...ive.com>; Robert
> Hancock <robert.hancock@...ian.com>
> Subject: [PATCH v8 net-next 2/4] 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@...ive.com>
> Reviewed-by: Greentime Hu <greentime.hu@...ive.com>
> Reviewed-by: Robert Hancock <robert.hancock@...ian.com>

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>

> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet.h      |  2 --
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 13 +++++--------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h
> b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> index 0f9c88dd1a4a..d5c1e5c4a508 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> @@ -433,8 +433,6 @@ struct axienet_local {
>  	struct net_device *ndev;
>  	struct device *dev;
> 
> -	struct device_node *phy_node;
> -
>  	struct phylink *phylink;
>  	struct phylink_config phylink_config;
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 78a991bbbcf9..3daef64a85bd 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -2071,17 +2071,19 @@ static int axienet_probe(struct platform_device
> *pdev)
> 
>  	if (lp->phy_mode == PHY_INTERFACE_MODE_SGMII ||
>  	    lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX) {
> -		lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-
> handle", 0);
> -		if (!lp->phy_node) {
> +		np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
> +		if (!np) {
>  			dev_err(&pdev->dev, "phy-handle required for
> 1000BaseX/SGMII\n");
>  			ret = -EINVAL;
>  			goto cleanup_mdio;
>  		}
> -		lp->pcs_phy = of_mdio_find_device(lp->phy_node);
> +		lp->pcs_phy = of_mdio_find_device(np);
>  		if (!lp->pcs_phy) {
>  			ret = -EPROBE_DEFER;
> +			of_node_put(np);
>  			goto cleanup_mdio;
>  		}
> +		of_node_put(np);
>  		lp->pcs.ops = &axienet_pcs_ops;
>  		lp->pcs.poll = true;
>  	}
> @@ -2124,8 +2126,6 @@ static int axienet_probe(struct platform_device
> *pdev)
>  		put_device(&lp->pcs_phy->dev);
>  	if (lp->mii_bus)
>  		axienet_mdio_teardown(lp);
> -	of_node_put(lp->phy_node);
> -
>  cleanup_clk:
>  	clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks);
>  	clk_disable_unprepare(lp->axi_clk);
> @@ -2154,9 +2154,6 @@ static int axienet_remove(struct platform_device
> *pdev)
>  	clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks);
>  	clk_disable_unprepare(lp->axi_clk);
> 
> -	of_node_put(lp->phy_node);
> -	lp->phy_node = NULL;
> -
>  	free_netdev(ndev);
> 
>  	return 0;
> --
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ