Skip to contentSkip to conversation

spi: mediatek: fix wrong error return value on probe

PATCH RESEND In review Javier Martinez Canillas 2 participants 2 messages Sep 15, 2015 – Sep 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 spi: mediatek: fix wrong error return value on probe

Commit adcbcfea15d62 ("spi: mediatek: fix spi clock usage error") added a new sel_clk but introduced bugs in the error paths since the wrong struct clk pointers are passed to PTR_ERR().

Fixes adcbcfea15d62 ("spi: mediatek: fix spi clock usage error")

---
Patch based on git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
branch fix/mediatek but also applies cleanly to branch for-linus.

It's the exact same patch than before so I don't know what went wrong.

 drivers/spi/spi-mt65xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-mt65xx.c +2 -2
index 6fbb5e5132b0..e9839a4e0175 100644
@@ -585,14 +585,14 @@ static int mtk_spi_probe(struct platform_device *pdev)
 
 	mdata->sel_clk = devm_clk_get(&pdev->dev, "sel-clk");
 	if (IS_ERR(mdata->sel_clk)) {
-		ret = PTR_ERR(mdata->spi_clk);
+		ret = PTR_ERR(mdata->sel_clk);
 		dev_err(&pdev->dev, "failed to get sel-clk: %d\n", ret);
 		goto err_put_master;
 	}
 
 	mdata->spi_clk = devm_clk_get(&pdev->dev, "spi-clk");
 	if (IS_ERR(mdata->spi_clk)) {
-		ret = PTR_ERR(mdata->parent_clk);
+		ret = PTR_ERR(mdata->spi_clk);
 		dev_err(&pdev->dev, "failed to get spi-clk: %d\n", ret);
 		goto err_put_master;
 	}
Signature · 1 line
2.4.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Javier Martinez Canillas

Commit adcbcfea15d62 ("spi: mediatek: fix spi clock usage error") added a new sel_clk but introduced bugs in the error paths since the wrong struct clk pointers are passed to PTR_ERR().

Fixes adcbcfea15d62 ("spi: mediatek: fix spi clock usage error")
Quoted 30 lines

---
Patch based on git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
branch fix/mediatek but also applies cleanly to branch for-linus.

It's the exact same patch than before so I don't know what went wrong.

 drivers/spi/spi-mt65xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-mt65xx.c +2 -2
index 6fbb5e5132b0..e9839a4e0175 100644
@@ -585,14 +585,14 @@ static int mtk_spi_probe(struct platform_device *pdev)
 
 	mdata->sel_clk = devm_clk_get(&pdev->dev, "sel-clk");
 	if (IS_ERR(mdata->sel_clk)) {
-		ret = PTR_ERR(mdata->spi_clk);
+		ret = PTR_ERR(mdata->sel_clk);
 		dev_err(&pdev->dev, "failed to get sel-clk: %d\n", ret);
 		goto err_put_master;
 	}
 
 	mdata->spi_clk = devm_clk_get(&pdev->dev, "spi-clk");
 	if (IS_ERR(mdata->spi_clk)) {
-		ret = PTR_ERR(mdata->parent_clk);
+		ret = PTR_ERR(mdata->spi_clk);
 		dev_err(&pdev->dev, "failed to get spi-clk: %d\n", ret);
 		goto err_put_master;
 	}