Message ID | 20220720085731.11011-5-irui.wang@mediatek.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Hans Verkuil |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1oE5Ws-00184p-0y; Wed, 20 Jul 2022 08:58:02 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232452AbiGTI57 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 20 Jul 2022 04:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232233AbiGTI5w (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 20 Jul 2022 04:57:52 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B56A6E2FD; Wed, 20 Jul 2022 01:57:49 -0700 (PDT) X-UUID: 3f778e58b0114f0abd5645a9b9cb18fa-20220720 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.8,REQID:9f2f0763-2dc7-449f-b0aa-abd087126937,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,RULE:Release_Ham,AC TION:release,TS:95 X-CID-INFO: VERSION:1.1.8,REQID:9f2f0763-2dc7-449f-b0aa-abd087126937,OB:0,LOB: 0,IP:0,URL:5,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,RULE:Spam_GS981B3D,AC TION:quarantine,TS:95 X-CID-META: VersionHash:0f94e32,CLOUDID:21d0fbd7-5d6d-4eaf-a635-828a3ee48b7c,C OID:7a47de85e8aa,Recheck:0,SF:28|17|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,QS:nil,BEC:nil,COL:0 X-UUID: 3f778e58b0114f0abd5645a9b9cb18fa-20220720 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from <irui.wang@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1342675982; Wed, 20 Jul 2022 16:57:45 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 20 Jul 2022 16:57:43 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Wed, 20 Jul 2022 16:57:43 +0800 From: Irui Wang <irui.wang@mediatek.com> To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, Alexandre Courbot <acourbot@chromium.org>, Tiffany Lin <tiffany.lin@mediatek.com>, Andrew-CT Chen <andrew-ct.chen@mediatek.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, <angelogioacchino.delregno@collabora.com> CC: Maoguang Meng <maoguang.meng@mediatek.com>, Longfei Wang <longfei.wang@mediatek.com>, Yunfei Dong <yunfei.dong@mediatek.com>, Irui Wang <irui.wang@mediatek.com>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <srv_heupstream@mediatek.com>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH v2, 4/6] media: mediatek: vcodec: Remove encoder driver get IRQ resource Date: Wed, 20 Jul 2022 16:57:29 +0800 Message-ID: <20220720085731.11011-5-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720085731.11011-1-irui.wang@mediatek.com> References: <20220720085731.11011-1-irui.wang@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-MTK: N X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, RDNS_NONE,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no |
Series |
support mt8188 h264 encoder
|
|
Commit Message
Irui Wang
July 20, 2022, 8:57 a.m. UTC
The "platform_get_resource(pdev, IORESOURCE_IRQ, 0)" is no longer
used after commit a1a2b7125e107("of/platform: Drop static setup of
IRQ resource from DT core"), so just remove the function in
encoder driver to avoid driver probe failed.
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
.../media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 8 --------
1 file changed, 8 deletions(-)
Comments
Hi, On Wed, Jul 20, 2022 at 4:58 PM Irui Wang <irui.wang@mediatek.com> wrote: > > The "platform_get_resource(pdev, IORESOURCE_IRQ, 0)" is no longer > used after commit a1a2b7125e107("of/platform: Drop static setup of > IRQ resource from DT core"), so just remove the function in > encoder driver to avoid driver probe failed. > > Signed-off-by: Irui Wang <irui.wang@mediatek.com> > --- > .../media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > index ea667b867b56..6d8964fb4fa2 100644 > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > @@ -228,7 +228,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev) > { > struct mtk_vcodec_dev *dev; > struct video_device *vfd_enc; > - struct resource *res; > phandle rproc_phandle; > enum mtk_vcodec_fw_type fw_type; > int ret; > @@ -272,13 +271,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev) > goto err_res; > } > > - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > - if (res == NULL) { > - dev_err(&pdev->dev, "failed to get irq resource"); > - ret = -ENOENT; > - goto err_res; > - } > - > dev->enc_irq = platform_get_irq(pdev, 0); platform_get_irq() returns a negative number on failure. You should check for errors here as the previous check was removed. The description of platform_get_irq() explicitly mentions: Device drivers should check the return value for errors so as to not pass a negative integer value to the request_irq() APIs. Hans has queued up this patch, so maybe you could provide a follow-up patch to fix this? Regards ChenYu > irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN); > ret = devm_request_irq(&pdev->dev, dev->enc_irq, > -- > 2.18.0 >
Dear Chen-Yu, many thanks for your comments. On Fri, 2022-08-26 at 12:08 +0800, Chen-Yu Tsai wrote: > Hi, > > On Wed, Jul 20, 2022 at 4:58 PM Irui Wang <irui.wang@mediatek.com> > wrote: > > > > The "platform_get_resource(pdev, IORESOURCE_IRQ, 0)" is no longer > > used after commit a1a2b7125e107("of/platform: Drop static setup of > > IRQ resource from DT core"), so just remove the function in > > encoder driver to avoid driver probe failed. > > > > Signed-off-by: Irui Wang <irui.wang@mediatek.com> > > --- > > .../media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 8 ---- > > ---- > > 1 file changed, 8 deletions(-) > > > > diff --git > > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > > index ea667b867b56..6d8964fb4fa2 100644 > > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c > > @@ -228,7 +228,6 @@ static int mtk_vcodec_probe(struct > > platform_device *pdev) > > { > > struct mtk_vcodec_dev *dev; > > struct video_device *vfd_enc; > > - struct resource *res; > > phandle rproc_phandle; > > enum mtk_vcodec_fw_type fw_type; > > int ret; > > @@ -272,13 +271,6 @@ static int mtk_vcodec_probe(struct > > platform_device *pdev) > > goto err_res; > > } > > > > - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > > - if (res == NULL) { > > - dev_err(&pdev->dev, "failed to get irq resource"); > > - ret = -ENOENT; > > - goto err_res; > > - } > > - > > dev->enc_irq = platform_get_irq(pdev, 0); > > platform_get_irq() returns a negative number on failure. You should > check for errors here as the previous check was removed. > > The description of platform_get_irq() explicitly mentions: > > Device drivers should check the return value for errors so as to > not pass a negative integer value to the request_irq() APIs. > > Hans has queued up this patch, so maybe you could provide a follow-up > patch to fix this? > Another same patch has been already merged into linux-next tree, so this current patch can be dropped. https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c?id=750a914adb7ded3669b47daed6d9d749110b4107 Thanks Best Regards > > Regards > ChenYu > > > > irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN); > > ret = devm_request_irq(&pdev->dev, dev->enc_irq, > > -- > > 2.18.0 > >
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c index ea667b867b56..6d8964fb4fa2 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c @@ -228,7 +228,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev) { struct mtk_vcodec_dev *dev; struct video_device *vfd_enc; - struct resource *res; phandle rproc_phandle; enum mtk_vcodec_fw_type fw_type; int ret; @@ -272,13 +271,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev) goto err_res; } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (res == NULL) { - dev_err(&pdev->dev, "failed to get irq resource"); - ret = -ENOENT; - goto err_res; - } - dev->enc_irq = platform_get_irq(pdev, 0); irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN); ret = devm_request_irq(&pdev->dev, dev->enc_irq,