From patchwork Thu Jan 19 19:10:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13108706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 093F1C004D4 for ; Thu, 19 Jan 2023 19:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mMV7xPX4UPsf6Z7Hxf5m9xlSFahZO3zBZ6pE83CgCAs=; b=U3hyr/VC/Uax73 xPx2rTrs4AH22fXZojUbReHjlT6Xbdxs9aaFsJoV8NTo0qs4DhmKc4MtL70jGPjrLkk4+F8gC4qJz 0+NY+0GC2VYk1l/Ac1g6jYSU9g7I4nYh+VtABYOV7NRMQ1q9O31LAU74pZN8JM6dcvLwsXSb0PJg8 6c0W7rUqJTShlqkLueeDoatUE6/K9S5vWxWT9MUlaExABnxhz3g9KE0I9RZeGu3WQO8HMooY/ErBu lhWnW5hlrWIGo8X52M9ZF/dSjKtYaIsAkLS+J/Ulgd5anii1CgguASfo9qYFw6Qw5kt9nRMhLvEH+ r4q+tBdjtw53JX5Yjyww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIaSL-006t97-PO; Thu, 19 Jan 2023 19:20:16 +0000 Received: from mail-vi1eur05on2059.outbound.protection.outlook.com ([40.107.21.59] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIaKN-006pLI-9x; Thu, 19 Jan 2023 19:12:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grKoOlF19mtEp/o02zhk8yU/KvR9K/u0XYmC367Tx09zVMcVL4YmL5AI8Wx2C7u6bfbIauC9yoDM0bjU3JzQCpdJub5VXit11uSpHxdtB4jMxJfUJBTbnCx9zxBqN1vD4jLaaoDs8MvA5Ex7y8LPBzxK61zsi1v5eu4wx5X49EdFfaqyF1K78WLwRXdnjqm+OPsrXq/OM7Z+xX+OyfDl3uNNnDIWln62ull9PKgGFXijWW9P6LVPf8Yv8Z3qUT7gy2TuVP7uqlxlJujBtwDU02/vZMqWnD0eU/AEP2G9BoeUZs2ZhzuwikX4zvTCmkn+Z3PT4FQfr2SZ3G7nd72x8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ctN7bLC4xagWRYS2vTOilm/APysMKl5QPDsaPZTszWM=; b=A/OZadjzS4g89v81BlEv8ZYuKtkOpx7NDSBNiYz+kUK8I3QbDU5W8oJWjXhaSYjCdwyzKGZJwFuoZc0EEFs/TTGE3RCtvPGe00KYkMmPvutT+ISFKNe9+uWJisOlYgpJtVSIfEDUwUTNB5xIj72nhDVOOOnUYfvkOtRwrr7cHvyQ2KNFKtQ4/lXLACdk2glehwo0htB92fRxcR7pxALoGAYR/4UydusjVU87QX5jEyFp3GoJE0mHqkvl1RyUoR5fd7sz2HSN5DTwjMjkQBDAotJuR/IdwBe36Xw1PtW1a+1HkaQ9HasxcVdaCR/pjcN1WMtTVRYtpFQpbrFMa0w2yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ctN7bLC4xagWRYS2vTOilm/APysMKl5QPDsaPZTszWM=; b=EEi9Wt2IlUqIRJpfz2XhAcrPTp22WbEXVBGH9d0Mvr2rU/LEAyL2CRTfDqAc7wCaIJbyrnkbK8pnRNlc//5+Ey4ebV7HzaKvzUqvos6b+OH/GcmOCTV0XibcY3OrW2bM8PpxFBHRyGWoMC1CdhWGD3iz7yqWcEW7scKeyGce4d8uXRnYewCUW5vAZkGfYCoE4OLx1NUCoJmJ03q48mcVWkcqHZIx2OB5H2bdwRiSuzbVPQ3QL2JKlxqxXb9bNKXG8eo64DxQfRefIbhI5z2rQJPvsYOxtQgLzdgyzWcjYiV9H5jgdtvH2b+OUMnvkVyTFy4LGJH8KOmd6uzEU+YJsQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by DB9PR03MB8259.eurprd03.prod.outlook.com (2603:10a6:10:307::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Thu, 19 Jan 2023 19:11:55 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::6b03:ac16:24b5:9166]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::6b03:ac16:24b5:9166%2]) with mapi id 15.20.5986.023; Thu, 19 Jan 2023 19:11:55 +0000 From: Sean Anderson To: David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Sean Anderson , Jyri Sarha , Abhinav Kumar , Alain Volmat , Brian Starkey , Chen Feng , Chen-Yu Tsai , Christian Gmeiner , Chun-Kuang Hu , Dmitry Baryshkov , Jernej Skrabec , John Stultz , Liviu Dudau , Lucas Stach , Mali DP Maintainers , Matthias Brugger , Mihail Atanassov , Paul Cercueil , Philipp Zabel , Rob Clark , Russell King , Samuel Holland , Sean Paul , Tian Tao , Tomi Valkeinen , Xinliang Liu , Xinwei Kong , etnaviv@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v3 3/3] drm: Convert users of drm_of_component_match_add to component_match_add_of Date: Thu, 19 Jan 2023 14:10:39 -0500 Message-Id: <20230119191040.1637739-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230119191040.1637739-1-sean.anderson@seco.com> References: <20230119191040.1637739-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR02CA0047.namprd02.prod.outlook.com (2603:10b6:207:3d::24) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8259:EE_ X-MS-Office365-Filtering-Correlation-Id: 742080c8-7378-49df-6427-08dafa51075f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bHq/qaslLXCVpYGH+DMSkiInrCD2vZlz8oEqitzu5PMuq7EqMz5vDhXHqLjnp7nfoZruP7v5QWD4twrlNfkLwViyIyM52LQ6JigmU0m7ltWyZJsfDNZAJRJGZxUYXW2C9EAga2F2OlPhqjkYjJSLWk8XsRzSMzbF0wKCfQw5IHtKACHsv6A5kDidMmMHNJBfjxAhSfLDJ7xaYi2mjoruMEArCtjYIID5ZVvpgBJPhvBcBfetSg7pGHoE4APyvx+yL9ziUytGgt5+5KX2nED6XEWmTNYCbwULA+sIYaNKXo5trta+DKk6MlCD5OWvIcykV5El41DFBDsjcyR+VmSbdHaVeNoTTZtPtbEfu+bHzqfCIMwwTuegC4wxxi83nwGvV9J7+mCX0pcUiuOOW577YHoLBmdFt2qW1iOj60X+tzfhuDrWCvEqxG+1jNd7PNWJpymk1GjK5FxaaQPcZd6wvy6L8ReQ0ASAPTsTs8ubfPkD+MyPHbBA/MP1fEeJJddHLpV2KSI3chKacF89Sj+vm5W4crNYM7zSgVGFI7ItgvFv5N/zUSMLKBVa3PctzurA8c+1O96jwzxB6ArBoh5Mk7nHN5F6AQLByMasaD56GeK7HVesM9DXWiBTi3Y1RJSj+P2zKQraZHGlRB2VuNidiG0jBT3av2vmVGv4Dja3hx9E2juVbCupW1OFa4Ba2MO2tqVxdnkUvX5MGuDbO96Siw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39850400004)(366004)(346002)(136003)(396003)(376002)(451199015)(66556008)(44832011)(5660300002)(8936002)(7416002)(7406005)(54906003)(41300700001)(2906002)(316002)(66946007)(4326008)(110136005)(8676002)(66476007)(478600001)(38350700002)(6486002)(52116002)(38100700002)(26005)(6512007)(6506007)(36756003)(6666004)(186003)(1076003)(30864003)(86362001)(2616005)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?iSuuWYeWHB/76ONVB7zo2SyvF3IC?= =?utf-8?q?sMbqsKnYNF7PvX07TZFEnhpGD6htSxhhr6+R7oYAeRw/9b0uUlZJceSbGIoiM+Taw?= =?utf-8?q?w3P/hdAegwX9A5Kuaxzu4L4lruPjv3fzt1+3TgiHaPUAyRyroUKgJ8Dj0TA3fX/Ah?= =?utf-8?q?rEq7Rztcb82y6IM/37eIjzRgAa8fD3s25Qevm3jbfjC69+/b+BIi5qh3eWaNw9GS3?= =?utf-8?q?gST5k6iLP1QqE29lnk2QigI9kx6de3SalgLW0drCHLxEpRLQN4ZDBfKg8sBmLo43d?= =?utf-8?q?3jlFeo6ASl4Z7KcpIDajMEUXqlv7IaaNkM2KseNuAsCcD8wY6legxEtpsDZMJzcja?= =?utf-8?q?ROTvyEH+qx/4p6D2dnPf/jgFTx8jqHcM2q7OMn5hEj1AojYh04NOxT7Wlsy7hn0yt?= =?utf-8?q?yk5XD9ufjlwN3rMRx9nx9rydEfkaqjUzXYs08jIbga207F+kGHYK7gOsQO/+fcO0E?= =?utf-8?q?Uae/c3Gz6On5HKxfUnqPan6xyxCFUeJdGdFze2lMP9noHP2wWbNQYUkvldJ4EbJfO?= =?utf-8?q?Y5RnQ4t/hRQmuciXSsXsq/4soXJSLIy7Drivoe7lrQYcMxJw3y2fBAtAI+wR4HCDN?= =?utf-8?q?bMX7plp7InbiRg/imWqwVJY/dQBLZhfigCswyZUVNaE8xbP8VJCIamrj5fI6CjrHu?= =?utf-8?q?VF505hfjFyxlaZrmtXc+QI2XYvUInFWNpFK7YKQbg90PRojcGiKjGTzsyRCCZvYIY?= =?utf-8?q?MkVdFOltmQrpg3Si1Cdw05xQvD2pKP4cC9g+C77k9/bVUNaclPh/USWyBNSZzaljE?= =?utf-8?q?aHFrAyMW1YpAef21TtehzWC7zD2P+f1ts/afCmpIpxxhCYJOpC8TmEKGmiNZtDJJ0?= =?utf-8?q?SUUypoGZ4OWFSxMMz8xxDOE6X6oGjoIRlPg09ZTVIRlnEakqBTuEPLXtUW/6iAufz?= =?utf-8?q?kp6EuC9HO2iX7W8rd1tr4qX3LJ/QVL68PxG2kipD8yJcFd3Pv+wYZzdMT4nebs2uh?= =?utf-8?q?FtnNWV56tAbyEWYFUsY5Gv26n+qcKZJNXqpi+JFivZp3DKaNEbWd65lZqDDB5rOYv?= =?utf-8?q?X9cUDaFop7nCEYAf1iO+0x2VlidE5q8aUEZIyYPAKPswm7kUME0HiGIGzODKsyJ72?= =?utf-8?q?jCBMKk5rGQ/FEvqa1XYPSb8Q3H60MB+26A+D7EBKP8eVl6/FxEcz7HHuZa6CHVWM2?= =?utf-8?q?Sa110JVYzzYLzoizlo6yoqK1XUpxPYiQSeHqgiP0EZwRTxi6xMSFeB8q5KJljEXan?= =?utf-8?q?2DmDoR+NVaES3vZd87ysZi6TmpsdEfBUiPOCCJo6hdIpGVnjpBt6XtyegXhhW288a?= =?utf-8?q?78cChX8HapOlCZON9MAx5kHFKTGgh0mzQ51ylaHIhxn2zEEYpUVLeDOy/zanYRGgb?= =?utf-8?q?nc94IvyzThRVzK0jzwxFRBW3rbcXzyi9Yn+EGjpBcFr7rijVKUmHaRnTk9CThxKzb?= =?utf-8?q?gSD+lMC3wVCskQnaoK8qt4ASKXzCJM3tHPwyGfnOvBD6ODAJHWlXkWA879R+sO7A2?= =?utf-8?q?F2oZ7J8SvvgnbVkK2FfvUfgujeJbRTvICuRaUYRRm6WV/aYKZ3CQUyw2HcSV+WQmD?= =?utf-8?q?bWkvPaTcguxV2kZ3XT0Ufc9IL1nLwWL8yw=3D=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 742080c8-7378-49df-6427-08dafa51075f X-MS-Exchange-CrossTenant-AuthSource: DB9PR03MB8847.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 19:11:55.1052 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pnxFucNJVPo6L6GS2uJ5MNC/VS7k6GymeTBKIjuFnQYgoidiTJGWH0gktg6E/+gnFO1qS6QTwlzGKcRBiPWk9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8259 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_111159_657199_6E0BEEC2 X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Every user of this function either uses component_compare_of or something equivalent. Most of them immediately put the device node as well. Convert these users to component_match_add_of and remove drm_of_component_match_add. Signed-off-by: Sean Anderson Acked-by: Jyri Sarha Tested-by: Jyri Sarha Tested-by: AngeloGioacchino Del Regno --- (no changes since v1) .../gpu/drm/arm/display/komeda/komeda_drv.c | 6 ++-- drivers/gpu/drm/arm/hdlcd_drv.c | 9 +----- drivers/gpu/drm/arm/malidp_drv.c | 11 +------ drivers/gpu/drm/armada/armada_drv.c | 10 ++++--- drivers/gpu/drm/drm_of.c | 29 +++---------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 +-- .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +-- drivers/gpu/drm/msm/msm_drv.c | 14 ++++----- drivers/gpu/drm/sti/sti_drv.c | 3 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +- drivers/gpu/drm/tilcdc/tilcdc_external.c | 10 ++----- include/drm/drm_of.h | 12 -------- 14 files changed, 33 insertions(+), 88 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c index 3f4e719eebd8..e3bfc72c378f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c @@ -103,10 +103,8 @@ static void komeda_add_slave(struct device *master, struct device_node *remote; remote = of_graph_get_remote_node(np, port, endpoint); - if (remote) { - drm_of_component_match_add(master, match, component_compare_of, remote); - of_node_put(remote); - } + if (remote) + component_match_add_of(master, match, remote); } static int komeda_platform_probe(struct platform_device *pdev) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index e3507dd6f82a..5f760bb66af4 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -347,11 +347,6 @@ static const struct component_master_ops hdlcd_master_ops = { .unbind = hdlcd_drm_unbind, }; -static int compare_dev(struct device *dev, void *data) -{ - return dev->of_node == data; -} - static int hdlcd_probe(struct platform_device *pdev) { struct device_node *port; @@ -362,9 +357,7 @@ static int hdlcd_probe(struct platform_device *pdev) if (!port) return -ENODEV; - drm_of_component_match_add(&pdev->dev, &match, compare_dev, port); - of_node_put(port); - + component_match_add_of(&pdev->dev, &match, port); return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops, match); } diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 589c1c66a6dc..3a49c29ba5b8 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -909,13 +909,6 @@ static const struct component_master_ops malidp_master_ops = { .unbind = malidp_unbind, }; -static int malidp_compare_dev(struct device *dev, void *data) -{ - struct device_node *np = data; - - return dev->of_node == np; -} - static int malidp_platform_probe(struct platform_device *pdev) { struct device_node *port; @@ -929,9 +922,7 @@ static int malidp_platform_probe(struct platform_device *pdev) if (!port) return -ENODEV; - drm_of_component_match_add(&pdev->dev, &match, malidp_compare_dev, - port); - of_node_put(port); + component_match_add_of(&pdev->dev, &match, port); return component_master_add_with_match(&pdev->dev, &malidp_master_ops, match); } diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 0643887800b4..c0211ad7a45d 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -184,10 +184,12 @@ static void armada_add_endpoints(struct device *dev, for_each_endpoint_of_node(dev_node, ep) { remote = of_graph_get_remote_port_parent(ep); - if (remote && of_device_is_available(remote)) - drm_of_component_match_add(dev, match, component_compare_of, - remote); - of_node_put(remote); + if (remote) { + if (of_device_is_available(remote)) + component_match_add_of(dev, match, remote); + else + of_node_put(remote); + } } } diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 7bbcb999bb75..0a474729ddf6 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -78,24 +78,6 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, } EXPORT_SYMBOL(drm_of_find_possible_crtcs); -/** - * drm_of_component_match_add - Add a component helper OF node match rule - * @master: master device - * @matchptr: component match pointer - * @compare: compare function used for matching component - * @node: of_node - */ -void drm_of_component_match_add(struct device *master, - struct component_match **matchptr, - int (*compare)(struct device *, void *), - struct device_node *node) -{ - of_node_get(node); - component_match_add_release(master, matchptr, component_release_of, - compare, node); -} -EXPORT_SYMBOL_GPL(drm_of_component_match_add); - /** * drm_of_component_probe - Generic probe function for a component based master * @dev: master device containing the OF node @@ -130,10 +112,9 @@ int drm_of_component_probe(struct device *dev, break; if (of_device_is_available(port->parent)) - drm_of_component_match_add(dev, &match, compare_of, - port); - - of_node_put(port); + component_match_add_of(dev, &match, port); + else + of_node_put(port); } if (i == 0) { @@ -171,9 +152,7 @@ int drm_of_component_probe(struct device *dev, continue; } - drm_of_component_match_add(dev, &match, compare_of, - remote); - of_node_put(remote); + component_match_add_of(dev, &match, remote); } of_node_put(port); } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 1d2b4fb4bcf8..4a0dba34a6e7 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -590,8 +590,8 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) if (!first_node) first_node = core_node; - drm_of_component_match_add(&pdev->dev, &match, - component_compare_of, core_node); + of_node_get(core_node); + component_match_add_of(&pdev->dev, &match, core_node); } } else { char **names = dev->platform_data; diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 9c5d49bf40c9..3ee277615c39 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -273,8 +273,7 @@ static int kirin_drm_platform_probe(struct platform_device *pdev) if (!remote) return -ENODEV; - drm_of_component_match_add(dev, &match, component_compare_of, remote); - of_node_put(remote); + component_match_add_of(dev, &match, remote); return component_master_add_with_match(dev, &kirin_drm_ops, match); } diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 3d5af44bf92d..d0c87175dec4 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1444,8 +1444,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) if (!np) return ingenic_drm_bind(dev, false); - drm_of_component_match_add(dev, &match, component_compare_of, np); - of_node_put(np); + component_match_add_of(dev, &match, np); return component_master_add_with_match(dev, &ingenic_master_ops, match); } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index cd5b18ef7951..abead814bfdc 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -787,8 +787,8 @@ static int mtk_drm_probe(struct platform_device *pdev) comp_type == MTK_DSI) { dev_info(dev, "Adding component match for %pOF\n", node); - drm_of_component_match_add(dev, &match, component_compare_of, - node); + of_node_get(node); + component_match_add_of(dev, &match, node); } ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], comp_id); diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 8b0b0ac74a6f..8ccf57def955 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -5,6 +5,7 @@ * Author: Rob Clark */ +#include #include #include #include @@ -1156,10 +1157,9 @@ static int add_components_mdp(struct device *master_dev, continue; if (of_device_is_available(intf)) - drm_of_component_match_add(master_dev, matchptr, - component_compare_of, intf); - - of_node_put(intf); + component_match_add_of(master_dev, matchptr, intf); + else + of_node_put(intf); } return 0; @@ -1188,9 +1188,9 @@ static int add_gpu_components(struct device *dev, return 0; if (of_device_is_available(np)) - drm_of_component_match_add(dev, matchptr, component_compare_of, np); - - of_node_put(np); + component_match_add_of(dev, matchptr, np); + else + of_node_put(np); return 0; } diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index ef6a4e63198f..e3aae4574c75 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -238,8 +238,7 @@ static int sti_platform_probe(struct platform_device *pdev) child_np = of_get_next_available_child(node, NULL); while (child_np) { - drm_of_component_match_add(dev, &match, component_compare_of, - child_np); + component_match_add_of(dev, &match, child_np); child_np = of_get_next_available_child(node, child_np); } diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index cc94efbbf2d4..9b3ddd82f1be 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -323,7 +323,8 @@ static int sun4i_drv_add_endpoints(struct device *dev, of_device_is_available(node))) { /* Add current component */ DRM_DEBUG_DRIVER("Adding component %pOF\n", node); - drm_of_component_match_add(dev, match, component_compare_of, node); + of_node_get(node); + component_match_add_of(dev, match, node); count++; } diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c index 3b86d002ef62..0138ce02a64f 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_external.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c @@ -155,11 +155,6 @@ int tilcdc_attach_external_device(struct drm_device *ddev) return ret; } -static int dev_match_of(struct device *dev, void *data) -{ - return dev->of_node == data; -} - int tilcdc_get_external_components(struct device *dev, struct component_match **match) { @@ -173,7 +168,8 @@ int tilcdc_get_external_components(struct device *dev, } if (match) - drm_of_component_match_add(dev, match, dev_match_of, node); - of_node_put(node); + component_match_add_of(dev, match, node); + else + of_node_put(node); return 1; } diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index 10ab58c40746..685c44dc1dae 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -33,10 +33,6 @@ uint32_t drm_of_crtc_port_mask(struct drm_device *dev, struct device_node *port); uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *port); -void drm_of_component_match_add(struct device *master, - struct component_match **matchptr, - int (*compare)(struct device *, void *), - struct device_node *node); int drm_of_component_probe(struct device *dev, int (*compare_of)(struct device *, void *), const struct component_master_ops *m_ops); @@ -69,14 +65,6 @@ static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, return 0; } -static inline void -drm_of_component_match_add(struct device *master, - struct component_match **matchptr, - int (*compare)(struct device *, void *), - struct device_node *node) -{ -} - static inline int drm_of_component_probe(struct device *dev, int (*compare_of)(struct device *, void *),