From patchwork Sun Jul 20 03:43:07 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: 4594661 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 A5F99C0514 for ; Mon, 21 Jul 2014 11:59:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6E0620149 for ; Mon, 21 Jul 2014 11:59:03 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B07C320120 for ; Mon, 21 Jul 2014 11:59:02 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C8FDB2656A9; Mon, 21 Jul 2014 13:59:01 +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 66143264FDF; Mon, 21 Jul 2014 13:57:52 +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 CFAFD264E9F; Sun, 20 Jul 2014 05:43:24 +0200 (CEST) Received: from m12-14.163.com (m12-14.163.com [220.181.12.14]) by alsa0.perex.cz (Postfix) with ESMTP id 84B4D264EAA for ; Sun, 20 Jul 2014 05:43:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=FDBiMLS1mzE8UWomrS alnv/7q15Zhi3hH5ezWsMTi78=; b=Jxi4I8h7lS+a1VpClCBqst7aPWEwcAdMLN t/p/c93lMvye3YMWVfstAQuiu/cAfQ3vBwgeXC0YCAmM20cUFZPD+RwEmV/4U8+1 JnqmAIyI4zloY3kuPeZs882+QfnzEYttEAg3ubT2qMo2cmOVpe9yNbsQYsKkAWyK YHwbY4qG4= Received: from localhost.localdomain.localdomain (unknown [180.110.162.144]) by smtp10 (Coremail) with SMTP id DsCowEBZGlLMOstT5Qr7CA--.1313S2; Sun, 20 Jul 2014 11:43:09 +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:43:07 +0800 Message-Id: <1405827787-26055-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: DsCowEBZGlLMOstT5Qr7CA--.1313S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF1rAF4ktry7ZF18tr4fZrb_yoW8JFy5pr 1vgayDWrW5GFyUZw4fJa18XF48Zr13Ka1aqr48X3W3Z3WfAr1DXw4kAr4Y9FZ3ur90gr15 tr1DtFyYvF45u3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07bS0PhUUUUU= X-Originating-IP: [180.110.162.144] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiNR-O1lHZXdf5fAAAs1 X-Mailman-Approved-At: Mon, 21 Jul 2014 13:57:49 +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 s3c2412_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/s3c2412-i2s.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 9180310..27b339c 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -154,13 +154,9 @@ static int s3c2412_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; - } s3c2412_i2s.regs = devm_ioremap_resource(&pdev->dev, res); - if (s3c2412_i2s.regs == NULL) - return -ENXIO; + if (IS_ERR(s3c2412_i2s.regs)) + return PTR_ERR(s3c2412_i2s.regs); s3c2412_i2s_pcm_stereo_out.dma_addr = res->start + S3C2412_IISTXD; s3c2412_i2s_pcm_stereo_in.dma_addr = res->start + S3C2412_IISRXD;