From patchwork Sun Jul 20 03:42:52 2014 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: 4594651 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CEECAC0514 for ; Mon, 21 Jul 2014 11:58:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B5712012D for ; Mon, 21 Jul 2014 11:58:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6CA7520107 for ; Mon, 21 Jul 2014 11:58:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7247A265694; Mon, 21 Jul 2014 13:58:28 +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, T_DKIM_INVALID, UNPARSEABLE_RELAY, URIBL_RED autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7697E262632; Mon, 21 Jul 2014 13:57:51 +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 5A483264E9F; Sun, 20 Jul 2014 05:43:08 +0200 (CEST) Received: from m12-14.163.com (m12-14.163.com [220.181.12.14]) by alsa0.perex.cz (Postfix) with ESMTP id 4276D262632 for ; Sun, 20 Jul 2014 05:42:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=plWTqnEYV36Ld7m4cQ JhE8syRFggzm2HQGU+mcpPxyI=; b=h/oT4nnVwnBFPpdtyG3QUy2qeMgF4wSpZJ gl9Fb8F4a5dClxGiUbcrA8Y0WP5sbAmcuqyRXN0MNpA1INkCfDSULhsYBDF7TJ3f e/4GPBTqSe54CEx0LqMALlecywWE6seAQzj6WxVpWLh9/yu/KYd7Z8UvfiR1UP09 JZ5/brAxQ= Received: from localhost.localdomain.localdomain (unknown [180.110.162.144]) by smtp10 (Coremail) with SMTP id DsCowEB5q1K8OstTZQf7CA--.1320S2; Sun, 20 Jul 2014 11:42:53 +0800 (CST) X-Coremail-DSSMTP: 180.110.162.144 From: weiyj_lk@163.com To: Ben Dooks , Kukjin Kim , Sangbeom Kim , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Sun, 20 Jul 2014 11:42:52 +0800 Message-Id: <1405827772-25980-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: DsCowEB5q1K8OstTZQf7CA--.1320S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF1rAF4ktry7CF1Utw45GFg_yoW8JFy7pr 1vgayDW3y5GFyUAw1fJF18XF48ZF18Ka13Jr4UJwnxA3W3XFsrZwsruF4jkFZ8Gr98Kw4r tr4UtFyYvFWY9FUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07bSeHgUUUUU= X-Originating-IP: [180.110.162.144] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiRx7O1lD+Uynw3wAAs6 X-Mailman-Approved-At: Mon, 21 Jul 2014 13:57:48 +0200 Cc: Wei Yongjun , linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH -next] ASoC: samsung: 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(). Also remove redundant return value check of platform_get_resource(). Signed-off-by: Wei Yongjun --- sound/soc/samsung/s3c24xx-i2s.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index e87d9a2..36dbc17 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -456,13 +456,9 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "Can't get IO resource.\n"); - 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;