From patchwork Fri Aug 14 07:11:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Jiang X-Patchwork-Id: 256173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A21EC433DF for ; Fri, 14 Aug 2020 07:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61A482074D for ; Fri, 14 Aug 2020 07:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="FyZ1d3rg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgHNHNO (ORCPT ); Fri, 14 Aug 2020 03:13:14 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:48571 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726632AbgHNHNM (ORCPT ); Fri, 14 Aug 2020 03:13:12 -0400 X-UUID: f17502b2b9574d2baa9bb5381f015245-20200814 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Vb7NedaUcamWhU8OO/PHG9OLc0h6LhhMPwEh8KEE3UA=; b=FyZ1d3rgyaBD2OMc7BmkxUuFKLOR/EbF5lWiWheL99Xp1hH93QNjaUYCQJ2PK84ig9ENGj+89rSqqLIkwMmxYnvMZfYV3PhvmGCasQlzxE1LEfu9EESzrzD0BTpg6e3gOxUM52GT98QFVbov5m7imldlg78hAL3wClm2/hBoDT0=; X-UUID: f17502b2b9574d2baa9bb5381f015245-20200814 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1021002251; Fri, 14 Aug 2020 15:13:08 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 15:13:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 14 Aug 2020 15:13:05 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang CC: , , , , , Marek Szyprowski , Tomasz Figa , , , , , , Xia Jiang Subject: [PATCH v12 03/29] media: platform: Improve getting and requesting irq flow for bug fixing Date: Fri, 14 Aug 2020 15:11:36 +0800 Message-ID: <20200814071202.25067-5-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200814071202.25067-1-xia.jiang@mediatek.com> References: <20200814071202.25067-1-xia.jiang@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Delete platform_get_resource operation for irq. Return actual value rather than EINVAL when fail to get and request irq. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.18.0 diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 67a022d04df7..2677580941b0 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1103,12 +1103,10 @@ static int mtk_jpeg_probe(struct platform_device *pdev) return ret; } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); dec_irq = platform_get_irq(pdev, 0); - if (!res || dec_irq < 0) { + if (dec_irq < 0) { dev_err(&pdev->dev, "Failed to get dec_irq %d.\n", dec_irq); - ret = -EINVAL; - return ret; + return dec_irq; } ret = devm_request_irq(&pdev->dev, dec_irq, mtk_jpeg_dec_irq, 0, @@ -1116,7 +1114,6 @@ static int mtk_jpeg_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Failed to request dec_irq %d (%d)\n", dec_irq, ret); - ret = -EINVAL; goto err_req_irq; }