From patchwork Tue Jul 12 15:14:52 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: 9225621 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 367AF60868 for ; Tue, 12 Jul 2016 15:15:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 266EB2793D for ; Tue, 12 Jul 2016 15:15:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AFEB27E78; Tue, 12 Jul 2016 15:15:25 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EEDB27BFC for ; Tue, 12 Jul 2016 15:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933384AbcGLPPV (ORCPT ); Tue, 12 Jul 2016 11:15:21 -0400 Received: from m12-17.163.com ([220.181.12.17]:46087 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932428AbcGLPPU (ORCPT ); Tue, 12 Jul 2016 11:15:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=mEUry DVF4QcUvghOwgYUa7Hcb7fv2ivkISVtboWvm7s=; b=M4/bulkfgRVtrassaGXQy 35MjXr11dDtWmqEOZLk0BPz7QOqgsPlZWnl5O2RoZaMdOdbTenQjzjIsuk5Jk5k8 9cW9JT1OPc6dv2H4R88xfhpGvZe8P7dfCXOJamzglKEmLE8YeizMCfMQgkfsnkRw B4sZG9TUKSYVUBYgGTJk6M= Received: from localhost.localdomain.localdomain (unknown [180.102.101.186]) by smtp13 (Coremail) with SMTP id EcCowACXn6NtCYVXswydAg--.3251S2; Tue, 12 Jul 2016 23:14:54 +0800 (CST) From: weiyj_lk@163.com To: Guennadi Liakhovetski , Mauro Carvalho Chehab Cc: Wei Yongjun , linux-media@vger.kernel.org Subject: [PATCH -next] [media] rcar_vin: remove redundant return value check of platform_get_resource() Date: Tue, 12 Jul 2016 15:14:52 +0000 Message-Id: <1468336492-10389-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CM-TRANSID: EcCowACXn6NtCYVXswydAg--.3251S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF1rJF4DXF13Cw43Cw1fCrg_yoW8Jw4kpr WFgFW8ArWUKFyftas5JayUuFW5A34aqa1F9ryfZw1fZas3JFyDJF4xtFWrAFyxJryv93W5 J3Z0vrW5AF4YvFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jgtxDUUUUU= X-Originating-IP: [180.102.101.186] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/xtbBDQCk1laDoBh0ugABsd Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Remove unneeded error handling on the result of a call to platform_get_resource() when the value is passed to devm_ioremap_resource(). And move those two call together to make the connection between them more clear. Signed-off-by: Wei Yongjun --- drivers/media/platform/soc_camera/rcar_vin.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 9c13752..bf52262 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -1888,10 +1888,6 @@ static int rcar_vin_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "pdata_flags = %08x\n", pdata_flags); - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (mem == NULL) - return -EINVAL; - irq = platform_get_irq(pdev, 0); if (irq <= 0) return -EINVAL; @@ -1901,6 +1897,7 @@ static int rcar_vin_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->base = devm_ioremap_resource(&pdev->dev, mem); if (IS_ERR(priv->base)) return PTR_ERR(priv->base);