Skip to contentSkip to conversation

spi: mpc512x: fix error return code in mpc512x_psc_spi_do_probe()

PATCH Applied Wei Yongjun 2 participants 2 messages Sep 11, 2013 – Sep 12, 2013 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: mpc512x: fix error return code in mpc512x_psc_spi_do_probe()

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/spi/spi-mpc512x-psc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-mpc512x-psc.c +3 -1
index dbc5e99..6adf4e3 100644
@@ -522,8 +522,10 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
 	psc_num = master->bus_num;
 	snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
 	clk = devm_clk_get(dev, clk_name);
-	if (IS_ERR(clk))
+	if (IS_ERR(clk)) {
+		ret = PTR_ERR(clk);
 		goto free_irq;
+	}
 	ret = clk_prepare_enable(clk);
 	if (ret)
 		goto free_irq;
maintainer Applied
#1 lore raw
Quoted 4 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Applied, thanks.