Skip to content

Commit

Permalink
UPSTREAM: spi: mediatek: fix wrong error return value on probe
Browse files Browse the repository at this point in the history
Commit adcbcfe ("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: adcbcfe ("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>
(cherry picked from commit e26d15f)
Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>

BUG=chrome-os-partner:40544
TEST=build and boot oak-rev3

Change-Id: Ie03c78766c84ce8b2d91e85fd44a6ac0f0cde9a0
Reviewed-on: https://chromium-review.googlesource.com/305890
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
  • Loading branch information
Daniel Kurtz authored and chrome-bot committed Oct 15, 2015

Unverified

No user is associated with the committer email.
1 parent 916f26c commit 85a967b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-mt65xx.c
Original file line number Diff line number Diff line change
@@ -572,14 +572,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;
}

0 comments on commit 85a967b

Please sign in to comment.