Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83895bed authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by David S. Miller
Browse files

net: mvneta: add support for fixed links



Following the introduction of of_phy_register_fixed_link(), this patch
introduces fixed link support in the mvneta driver, for Marvell Armada
370/XP SOCs.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3be2a49e
Loading
Loading
Loading
Loading
+16 −3
Original line number Original line Diff line number Diff line
@@ -2797,11 +2797,24 @@ static int mvneta_probe(struct platform_device *pdev)


	phy_node = of_parse_phandle(dn, "phy", 0);
	phy_node = of_parse_phandle(dn, "phy", 0);
	if (!phy_node) {
	if (!phy_node) {
		dev_err(&pdev->dev, "no associated PHY\n");
		if (!of_phy_is_fixed_link(dn)) {
			dev_err(&pdev->dev, "no PHY specified\n");
			err = -ENODEV;
			err = -ENODEV;
			goto err_free_irq;
			goto err_free_irq;
		}
		}


		err = of_phy_register_fixed_link(dn);
		if (err < 0) {
			dev_err(&pdev->dev, "cannot register fixed PHY\n");
			goto err_free_irq;
		}

		/* In the case of a fixed PHY, the DT node associated
		 * to the PHY is the Ethernet MAC DT node.
		 */
		phy_node = dn;
	}

	phy_mode = of_get_phy_mode(dn);
	phy_mode = of_get_phy_mode(dn);
	if (phy_mode < 0) {
	if (phy_mode < 0) {
		dev_err(&pdev->dev, "incorrect phy-mode\n");
		dev_err(&pdev->dev, "incorrect phy-mode\n");