From patchwork Wed Sep 28 14:50:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9354027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74BF360756 for ; Wed, 28 Sep 2016 14:50:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6243829645 for ; Wed, 28 Sep 2016 14:50:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5332429655; Wed, 28 Sep 2016 14:50:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9F5929645 for ; Wed, 28 Sep 2016 14:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932319AbcI1Ou3 (ORCPT ); Wed, 28 Sep 2016 10:50:29 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33498 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932814AbcI1Ou1 (ORCPT ); Wed, 28 Sep 2016 10:50:27 -0400 Received: by mail-pf0-f194.google.com with SMTP id q2so2251827pfj.0 for ; Wed, 28 Sep 2016 07:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OTZIpgQaQjgwhm/cZMXTIWqXVnhtdWYiu5UzifUyfMk=; b=cSwDDk7s5wCXtvdGABZAHQ2/N7Pcdw3ADJu9ai3OYuNAOURkq9mYGigRtQjIAYbeww 8LPtlBpgMAkGOPzTX4/lKDHruMPwSxQjGG54zkCCHkfkbSXApSLjUv4IWQGdaeRMzwcE z4tJBwFgywt5kKSPLe2kLy7GJamTLX3cfu2Ovc/8mpnY49tZVyBd4hhLp1Y+ZlsQsgS6 J8jedXVIB32x/KpTtqvncg2AnBgIbf4lKex+V3/wB9rutsFG2NXU5LyEqg0W0S2zHFKa 7ITuJEOHdOdZcU8nenKQ1wbdlaTXdp66y4bnkekl3uqpUvmweMaQy9zgT9SFrxspnyCi KHBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OTZIpgQaQjgwhm/cZMXTIWqXVnhtdWYiu5UzifUyfMk=; b=j0l9Dsffy2Al5daJsWAaA+HrPEQYkHA6Ncgqkn06+4ylfKak798xXEpVtsDYvWtDkj kYL05hGMRqeQkCnX+ZjgLW/8tzKUzdmpuChc4yNZvEU/I1ciI0E993/Wv2fkYo+9s/f+ 9oiNxoxlVl33QAx4CjryqzFBF+3FpzVGi2ya2W/r+JUPR4p6BvzXjLSMtYYlrd5nDbA9 3BfmyNJciIvZVeKdJX2hEghbTk9wnf0dRlq1gYthVFDOsmEA5PBSIgLqK1gDiWb1t/fA DZ4zsS613zDZAQUi2F3DaZEfDlDtQK3p++4Ny43TdygmI5HxaljOLka5nKXsZ7qbMTvm aT5g== X-Gm-Message-State: AE9vXwNLeg3YWsk7MCQXtreoSE5pz77i4Uzxslo04OqHIji3qRNphxiHS4mOnGk/sbDiuA== X-Received: by 10.98.34.221 with SMTP id p90mr58659003pfj.18.1475074226219; Wed, 28 Sep 2016 07:50:26 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id k80sm13308512pfk.27.2016.09.28.07.50.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Sep 2016 07:50:25 -0700 (PDT) From: Wei Yongjun To: Mark Brown , Marek Vasut Cc: Wei Yongjun , linux-spi@vger.kernel.org Subject: [PATCH -next] spi: imx: fix error return code in spi_imx_probe() Date: Wed, 28 Sep 2016 14:50:18 +0000 Message-Id: <1475074218-13164-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return error code -EINVAL if no CS GPIOs available instead of 0, as done elsewhere in this function. Fixes: f13d4e189d20 ("spi: imx: Gracefully handle NULL master->cs_gpios") Signed-off-by: Wei Yongjun Acked-by: Marek Vasut --- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 1ef5429..deb782f 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1270,6 +1270,7 @@ static int spi_imx_probe(struct platform_device *pdev) if (!master->cs_gpios) { dev_err(&pdev->dev, "No CS GPIOs available\n"); + ret = -EINVAL; goto out_clk_put; }