From patchwork Tue Sep 15 12:46:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 7184501 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B52BCBEEC1 for ; Tue, 15 Sep 2015 12:47:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D897020688 for ; Tue, 15 Sep 2015 12:47:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDBB1206AD for ; Tue, 15 Sep 2015 12:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbbIOMrf (ORCPT ); Tue, 15 Sep 2015 08:47:35 -0400 Received: from lists.s-osg.org ([54.187.51.154]:36284 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbbIOMre (ORCPT ); Tue, 15 Sep 2015 08:47:34 -0400 Received: from minerva.sisa.samsung.com (209.51.23.95.dynamic.jazztel.es [95.23.51.209]) by lists.s-osg.org (Postfix) with ESMTPSA id A2E8A462A0; Tue, 15 Sep 2015 05:47:31 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , Mark Brown , linux-spi@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Subject: [RESEND PATCH] spi: mediatek: fix wrong error return value on probe Date: Tue, 15 Sep 2015 14:46:45 +0200 Message-Id: <1442321205-30869-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.4.3 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Matthias Brugger --- 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(-) 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; }