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

Commit ea664b1b authored by Josua Mayer's avatar Josua Mayer Committed by David S. Miller
Browse files

net: mvmdio: print warning when orion-mdio has too many clocks



Print a warning when device tree specifies more than the maximum of four
clocks supported by orion-mdio. Because reading from mdio can lock up
the Armada 8k when a required clock is not initialized, it is important
to notify the user when a specified clock is ignored.

Signed-off-by: default avatarJosua Mayer <josua@solid-run.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4aabed69
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -326,6 +326,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
		clk_prepare_enable(dev->clk[i]);
	}

	if (!IS_ERR(of_clk_get(pdev->dev.of_node, ARRAY_SIZE(dev->clk))))
		dev_warn(&pdev->dev, "unsupported number of clocks, limiting to the first "
			 __stringify(ARRAY_SIZE(dev->clk)) "\n");

	dev->err_interrupt = platform_get_irq(pdev, 0);
	if (dev->err_interrupt > 0 &&
	    resource_size(r) < MVMDIO_ERR_INT_MASK + 4) {