From patchwork Thu Apr 16 12:18:02 2015 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: 6225561 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1DFD9F313 for ; Thu, 16 Apr 2015 12:18:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAB7E202A1 for ; Thu, 16 Apr 2015 12:18:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BABE52021B for ; Thu, 16 Apr 2015 12:18:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E07C42612E3; Thu, 16 Apr 2015 14:18:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BC9BC261464; Thu, 16 Apr 2015 14:18:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E229E2614C8; Thu, 16 Apr 2015 14:18:40 +0200 (CEST) Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by alsa0.perex.cz (Postfix) with ESMTP id 52817261480 for ; Thu, 16 Apr 2015 14:18:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=GIaxlbGstw0LLTjfve AEPU0fUcXJa7W/zjjXcNM6pzA=; b=DCcqruE1cPDWhwzUfjCl5JGDaadAqwNGs2 cAvJLGFXWOx9UdUOBxB3eyP5AQ4jn/rwvGh5O/7y2AxqjVvtxpZWuroA9aSl47eN h3aLHqxGcY0qxTyfv37bu5H0ot/S1muohUXsg5Z7a7M8AW6920Tqc31HFr5pH6MT MKR4m4TJU= Received: from localhost.localdomain.localdomain (unknown [49.77.26.90]) by smtp14 (Coremail) with SMTP id EsCowECZLE98qC9Vcyl4Ag--.173S2; Thu, 16 Apr 2015 20:18:05 +0800 (CST) X-Coremail-DSSMTP: 49.77.26.90 From: weiyj_lk@163.com To: Kukjin Kim , Sangbeom Kim , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Thu, 16 Apr 2015 20:18:02 +0800 Message-Id: <1429186682-20629-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: EsCowECZLE98qC9Vcyl4Ag--.173S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kAFWDXryfuF1furWxJFb_yoWDurX_A3 yrWw1FgryUZr17tFWxAr45Cr13JFWDCry8Gw1YyasrAFy5C3W3K3Z3Arnruw18W3y0yrZr Gr1DZr9F9FZ3AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUn_MaUUUUUU== X-Originating-IP: [49.77.26.90] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiRx3d1lD+ZssetwAAs7 Cc: Wei Yongjun , linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- sound/soc/samsung/s3c24xx-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 326d3c3..5bf7236 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -461,8 +461,8 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) return -ENOENT; } s3c24xx_i2s.regs = devm_ioremap_resource(&pdev->dev, res); - if (s3c24xx_i2s.regs == NULL) - return -ENXIO; + if (IS_ERR(s3c24xx_i2s.regs)) + return PTR_ERR(s3c24xx_i2s.regs); s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO; s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO;