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

Commit c85012ad authored by Russell King's avatar Russell King Committed by Mark Brown
Browse files

spi: spi-orion: check return value from clk_prepare()/clk_enable()



clk_prepare()/clk_enable() can fail, and it's return value should
be checked.  Add the proper checking, and while we're here, convert
to clk_prepare_enable().

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 7171511e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -382,8 +382,10 @@ static int orion_spi_probe(struct platform_device *pdev)
		goto out;
	}

	clk_prepare(spi->clk);
	clk_enable(spi->clk);
	status = clk_prepare_enable(spi->clk);
	if (status)
		goto out;

	tclk_hz = clk_get_rate(spi->clk);
	master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4);
	master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30);