From patchwork Tue Jul 12 11:00:55 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: 9225045 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 D13B260572 for ; Tue, 12 Jul 2016 11:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C08E327C39 for ; Tue, 12 Jul 2016 11:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B31D127F7A; Tue, 12 Jul 2016 11:01:33 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C6BEC27C39 for ; Tue, 12 Jul 2016 11:01:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMvRS-0004av-Pj; Tue, 12 Jul 2016 11:01:30 +0000 Received: from m12-18.163.com ([220.181.12.18]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMvRJ-0004TE-3L; Tue, 12 Jul 2016 11:01:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=O9AR0 wAjILwsdmvYB2qUUMAYtBzw0fJ5JAKyCu5akPY=; b=l8XbH+xL/VN/G9kFsvitc W3/QZOxwLZZPfBMW/JJC+ixeWYwr4HFsBLNpNGRBm5QUltJJ815rNI2IDHyygmCu kZicsnfFj1a4zptC/66g+TqIC3zR5wInt514LVwYSd+YzGVhW0QRY/s6PWfDiZN0 mVRBvF2GLBN5YwwWQ7rfDw= Received: from localhost.localdomain.localdomain (unknown [180.110.253.144]) by smtp14 (Coremail) with SMTP id EsCowABHBB7ozYRXV2V9BQ--.49342S2; Tue, 12 Jul 2016 19:00:56 +0800 (CST) From: weiyj_lk@163.com To: Mauro Carvalho Chehab , "Mauro Carvalho Chehab mchehab @ s-opensource . com Matthias Brugger" , Andrew-CT Chen Subject: [PATCH -next] [media] VPU: mediatek: fix return value check in mtk_vpu_probe() Date: Tue, 12 Jul 2016 11:00:55 +0000 Message-Id: <1468321255-15840-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CM-TRANSID: EsCowABHBB7ozYRXV2V9BQ--.49342S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUZryktF4kXr1DtFW5KFg_yoWfKFb_u3 4a9FnrXr109rnIqF4Iyr1ak343JFs09r1Fqa43t3y3ta98Gw15JasFvw43XFZFyr4FyFWD Ar95WFyxCwnxCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnh0ePUUUUU== X-Originating-IP: [180.110.253.144] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiGQik1lXlT1DUMwAAsr X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160712_040121_526655_ACFEA082 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yongjun , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_clk_get() returns ERR_PTR() and not returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index b60d02c..c8b2c72 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -788,9 +788,9 @@ static int mtk_vpu_probe(struct platform_device *pdev) /* Get VPU clock */ vpu->clk = devm_clk_get(dev, "main"); - if (!vpu->clk) { + if (IS_ERR(vpu->clk)) { dev_err(dev, "get vpu clock failed\n"); - return -EINVAL; + return PTR_ERR(vpu->clk); } platform_set_drvdata(pdev, vpu);