spi: mediatek: fix wrong error return value on probe
diff mbox

Message ID 1441320656-8666-1-git-send-email-javier@osg.samsung.com
State New
Headers show

Commit Message

Javier Martinez Canillas Sept. 3, 2015, 10:50 p.m. UTC
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>

---

 drivers/spi/spi-mt65xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown Sept. 14, 2015, 6:39 p.m. UTC | #1
On Fri, Sep 04, 2015 at 12:50:56AM +0200, Javier Martinez Canillas wrote:
> 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().

This doesn't apply against current code, please check and resend.
Javier Martinez Canillas Sept. 15, 2015, 11:49 a.m. UTC | #2
Hello Mark,

On 09/14/2015 08:39 PM, Mark Brown wrote:
> On Fri, Sep 04, 2015 at 12:50:56AM +0200, Javier Martinez Canillas wrote:
>> 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().
> 
> This doesn't apply against current code, please check and resend.
> 

Which branch should I use as a baseline then? The patch applies cleanly
on both today's linux-next (next-20150915) and your for-linus branch:

https://git.kernel.org/cgit/linux/kernel/git/broonie/spi.git/log/?h=for-linus

Best regards,
Mark Brown Sept. 15, 2015, 12:34 p.m. UTC | #3
On Tue, Sep 15, 2015 at 01:49:11PM +0200, Javier Martinez Canillas wrote:
> On 09/14/2015 08:39 PM, Mark Brown wrote:
> > On Fri, Sep 04, 2015 at 12:50:56AM +0200, Javier Martinez Canillas wrote:
> >> 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().

> > This doesn't apply against current code, please check and resend.

> Which branch should I use as a baseline then? The patch applies cleanly
> on both today's linux-next (next-20150915) and your for-linus branch:

> https://git.kernel.org/cgit/linux/kernel/git/broonie/spi.git/log/?h=for-linus

On the relevant fix brach (so mediatek in this case) or my -linus
branch - I don't think there's any development fixes queued for this
driver yet.

Patch
diff mbox

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 6fbb5e5132b0..e9839a4e0175 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -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;
 	}