From patchwork Thu Jun 4 07:26:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Jiang X-Patchwork-Id: 209631 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=-9.8 required=3.0 tests=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=ham 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 19679C433E1 for ; Thu, 4 Jun 2020 07:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E53EC20663 for ; Thu, 4 Jun 2020 07:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="urlwNGJM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728341AbgFDHbH (ORCPT ); Thu, 4 Jun 2020 03:31:07 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36044 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728043AbgFDH30 (ORCPT ); Thu, 4 Jun 2020 03:29:26 -0400 X-UUID: 5327963303df4aa5804250a63c17ce6c-20200604 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=QieJajFUSDAATn0RLbYQatSFJzOR4F4C/wwtZYRLLOI=; b=urlwNGJMglfiOfVBtiNVNFvRQHANpd6QP7IEQ7h9SFbaZ6A6H9F0q0P7Z1zrtZ4uuLkY7w+P53Q4zCzA61+mCJAK7vjctUIDJ7FP0Yk/wVxKZEjb3iVa8mHXxKOAHxzG6cK87pjWAvelQthuzcYTWW3YQuY6EzwE3PTscMi+yp0=; X-UUID: 5327963303df4aa5804250a63c17ce6c-20200604 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 831859998; Thu, 04 Jun 2020 15:29:21 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Jun 2020 15:29:18 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 4 Jun 2020 15:29:16 +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 v9 04/18] media: platform: Change the fixed device node number to unfixed value Date: Thu, 4 Jun 2020 15:26:54 +0800 Message-ID: <20200604072708.9468-5-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200604072708.9468-1-xia.jiang@mediatek.com> References: <20200604072708.9468-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 The driver can be instantiated multiple times, e.g. for a decoder and an encoder. Moreover, other drivers could coexist on the same system. This makes the static video node number assignment pointless, so switch to automatic assignment instead. Signed-off-by: Xia Jiang --- v9: change the commit message --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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 2677580941b0..12609ca46fd9 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1154,7 +1154,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) jpeg->dec_vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; - ret = video_register_device(jpeg->dec_vdev, VFL_TYPE_VIDEO, 3); + ret = video_register_device(jpeg->dec_vdev, VFL_TYPE_VIDEO, -1); if (ret) { v4l2_err(&jpeg->v4l2_dev, "Failed to register video device\n"); goto err_dec_vdev_register;