From patchwork Mon Jun 13 14:32:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9173217 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 85E156044F for ; Mon, 13 Jun 2016 14:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772E420223 for ; Mon, 13 Jun 2016 14:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ACE1262AE; Mon, 13 Jun 2016 14:32: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_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 6154120223 for ; Mon, 13 Jun 2016 14:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422860AbcFMOcl (ORCPT ); Mon, 13 Jun 2016 10:32:41 -0400 Received: from m12-15.163.com ([220.181.12.15]:55384 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423590AbcFMOcj (ORCPT ); Mon, 13 Jun 2016 10:32:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=HpG/z 8kvBwcwhrS9I1Mrp+xNkQjMAnDcTxFsUkOf7+w=; b=pT1QxAo1BYQATm9JGanjl XKkkLayvf+uHO4cdsH2DKDyvfGcJc69uEHroJnz7JSS6XOlUqtAlhXMgNvwFK+Om aHNqET+C73cGp6FjPpi0MpEo2Ff3ZFaPv2NmNF/dlUpjHMabeD6Xy6nFaS7y5WIt bFpaQ//3yvTFQvH1DpWWY4= Received: from localhost.localdomain.localdomain (unknown [180.102.102.213]) by smtp11 (Coremail) with SMTP id D8CowABXr6f3w15XfowiAw--.10373S3; Mon, 13 Jun 2016 22:32:25 +0800 (CST) From: weiyj_lk@163.com To: Mark Brown Cc: Wei Yongjun , linux-spi@vger.kernel.org Subject: [PATCH -next] spi: orion: Fix return value check in orion_spi_probe() Date: Mon, 13 Jun 2016 14:32:23 +0000 Message-Id: <1465828343-17298-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: D8CowABXr6f3w15XfowiAw--.10373S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DuFWfAryDZFW8XF45Awb_yoWftFgEkr ZY9r13WrZ2gr17t3W29F13Ary2vryDWrW0gwnxtasxtryqv39Iqry5Zr1DGF42v39akFZI k34UZr12vr15CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0ltC7UUUUU== X-Originating-IP: [180.102.102.213] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiRxmH1lc63yu+jwAAsn 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 In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/spi/spi-orion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 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-orion.c b/drivers/spi/spi-orion.c index d0d9c86..ded3702 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -655,8 +655,8 @@ static int orion_spi_probe(struct platform_device *pdev) spi->direct_access[cs].vaddr = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE); - if (IS_ERR(spi->direct_access[cs].vaddr)) { - status = PTR_ERR(spi->direct_access[cs].vaddr); + if (!spi->direct_access[cs].vaddr) { + status = -ENOMEM; goto out_rel_clk; } spi->direct_access[cs].size = PAGE_SIZE;