From patchwork Tue Dec 9 13:14:37 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: 5462661 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 77564BEEA8 for ; Tue, 9 Dec 2014 13:15:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67E8B20121 for ; Tue, 9 Dec 2014 13:15:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3DA082010C for ; Tue, 9 Dec 2014 13:15:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ACD6D261563; Tue, 9 Dec 2014 14:15:07 +0100 (CET) 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, NO_DNS_FOR_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 874C0260556; Tue, 9 Dec 2014 14:14:57 +0100 (CET) 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 4723626055A; Tue, 9 Dec 2014 14:14:56 +0100 (CET) Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by alsa0.perex.cz (Postfix) with ESMTP id 571B526054C for ; Tue, 9 Dec 2014 14:14:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=464hpUcMTq8PEW/Z4U fGxPwWW0iPFj7722w1t8858bQ=; b=ImDG7E6wsdGNFOCLWlfrbcwoYM0E8BUxxM RBNlsVQE1a7W0NxMZeiZQjci7kYPPXyIZIY6BVfQNHMatMeVItKpKyPFpD7C0S8Q JRGMMFK7F+Z111qrb6efPor30KZnA3is2aeUOrKZtSLFc6TJeS39UqSoR9wAAckr P5E97RxUE= Received: from localhost.localdomain.localdomain (unknown [117.88.175.67]) by smtp14 (Coremail) with SMTP id EsCowEBJzUnA9YZU_BKIAw--.62S2; Tue, 09 Dec 2014 21:14:41 +0800 (CST) X-Coremail-DSSMTP: 117.88.175.67 From: weiyj_lk@163.com To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vinod Koul , kbuild test robot , Mengdong Lin , "Subhransu S. Prusty" Date: Tue, 9 Dec 2014 21:14:37 +0800 Message-Id: <1418130877-28923-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: EsCowEBJzUnA9YZU_BKIAw--.62S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF1rCF4DXrW7XFyftF45trb_yoW8Gryrpa yDWFWqqrya9F4S9343t3WUXF15ZryI9a1fGr18AwsFk3Z5GrnYgrWaqayUtayrZ3yvqF1q vayDWrW8ZF45ZaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jt18QUUUUU= X-Originating-IP: [117.88.175.67] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiGQFd1lEAQCV9uQAAsj Cc: Wei Yongjun , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH -next] ASoC: Intel: fix return value check in sst_acpi_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 platform_device_register_data() 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/intel/sst/sst_acpi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c index 31124aa..f59972a 100644 --- a/sound/soc/intel/sst/sst_acpi.c +++ b/sound/soc/intel/sst/sst_acpi.c @@ -277,16 +277,16 @@ int sst_acpi_probe(struct platform_device *pdev) dev_dbg(dev, "ACPI device id: %x\n", dev_id); plat_dev = platform_device_register_data(dev, mach->pdata->platform, -1, NULL, 0); - if (plat_dev == NULL) { + if (IS_ERR(plat_dev)) { dev_err(dev, "Failed to create machine device: %s\n", mach->pdata->platform); - return -ENODEV; + return PTR_ERR(plat_dev); } /* Create platform device for sst machine driver */ mdev = platform_device_register_data(dev, mach->machine, -1, NULL, 0); - if (mdev == NULL) { + if (IS_ERR(mdev)) { dev_err(dev, "Failed to create machine device: %s\n", mach->machine); - return -ENODEV; + return PTR_ERR(mdev); } ret = sst_alloc_drv_context(&ctx, dev, dev_id);