spi: mediatek: fix wrong error return value on probe
authorJavier Martinez Canillas <javier@osg.samsung.com>
Tue, 15 Sep 2015 12:46:45 +0000 (14:46 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 16 Sep 2015 19:45:11 +0000 (20:45 +0100)
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")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mt65xx.c

index 6fbb5e5132b08eb3351435c6e3b3358c99ee15e6..e9839a4e017552493111fae1341aa2ec087b2a07 100644 (file)
@@ -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;
        }