From patchwork Thu Dec 22 23:37:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13080430 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F36C7C4332F for ; Thu, 22 Dec 2022 23:38:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235758AbiLVXio (ORCPT ); Thu, 22 Dec 2022 18:38:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235701AbiLVXih (ORCPT ); Thu, 22 Dec 2022 18:38:37 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2069.outbound.protection.outlook.com [40.107.6.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631B513F08; Thu, 22 Dec 2022 15:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOB+cp/2ZenWVC56AXYvi0QMqLdjEQZZBxI/yX4ymCSj0bZwUAYrI9TmW/sylFQ++fBBgu9DDupqlTpeBX8rtK6RfVczLDn3rstdWudO4xBsPKc5Ccvzvqt1mWzxTb1HGftWgc/clG2T2XitntV3Ba8YOaV7eCBps4ZNbGPwFjI5cx5b7DiN4nMDmWudptRWXYIjpDRBZ520WDyKbpvXxCpx4c66xaVN9+Jo7C3TwcNjcKQdgyyBWodhzIPgM9wgWFyc+ZewahzNeCU0YXFDObDg1SWgUzeOoaC925nM2hyLZnr3sqmIWpBfAF32O4LZP8Osrrfdp9UECksKGLwj0A== 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=BJBQsgZqHySR5ZJFvpzCoSAiWyJRIXKFYrS/yNJi4yQ=; b=ApyPzopBuElCPf0QfJjnVclcgzjB2uF0LMQsxisQJlcqxUmJQEGB+z3+W8jxc+jSKbRYV6GsgFv7mg3ETzkvFE8c1o3U7gEouq/dJRi9/Zs9zworvZ+5uJWqFb+K/wBvZr7NLqcxNcGxYIsgG8cwt1i5basU7x0OlN/QBOZArT8AXiU/X4ANjAbUCOmdKvAvNw6jVAFj12ugPV7hhUTTgz891KwsK2VCA65GjCSnSrwcLzOoLXhGve1hXFfCRoijx2R2W6jctmLOqgPhDExS7x/1ofAIcqoDCDUx8xtyjmIsnMC6fy+rU62bfodVKxB9PtFuBnbJzp+W9HHUHjU5RA== 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=BJBQsgZqHySR5ZJFvpzCoSAiWyJRIXKFYrS/yNJi4yQ=; b=Kxx5V0tmSntBCR5hSadufXiJxVSI14CMpcTNTBsut77IFRn6JW35ARk4uwSINfjoAnDZ/iC2MIZ2x7W3brA6W+zIqg+5bucsCkArQnh2rVwrAhPqnW/mseH2lstFFQZVbTRvLL9r6byBMuBuVTCDNWV1ba440xGnlVrs6CWTQmjs2UghhluVykWEzIw1hYP0MISQAksrd5iiF8pod7M7zBSMr15370avBpk619nzmWJNz+r//lzLf9moexF+YnpjdhvrHQfUK23qB4hi+gBEKzxc5sxUc8oFoQcnKIwbfcC42OgQUEbZhUrQqRe5PfY9CPi3LkOZW6+JvHXhzRByDg== 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 AS2PR03MB9100.eurprd03.prod.outlook.com (2603:10a6:20b:5fb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Thu, 22 Dec 2022 23:38:27 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2b95:1fe4:5d8f:22fb]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2b95:1fe4:5d8f:22fb%7]) with mapi id 15.20.5944.013; Thu, 22 Dec 2022 23:38:27 +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 v2 3/3] drm: Convert users of drm_of_component_match_add to component_match_add_of Date: Thu, 22 Dec 2022 18:37:59 -0500 Message-Id: <20221222233759.1934852-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221222233759.1934852-1-sean.anderson@seco.com> References: <20221222233759.1934852-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0205.namprd13.prod.outlook.com (2603:10b6:208:2be::30) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9100:EE_ X-MS-Office365-Filtering-Correlation-Id: d0773e21-0506-45e2-4bab-08dae4759fd8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OrRzdtGzlbVhGjlo5VQbmcOe9GYWaj6poLsMUMKqln6CpLCtfojVnZEzlt0EYmhFJE/4bgQSL4Yb3LzedtCSpkEfD8E8yJgYsfW/dkkAoipxnSUUYJS42swEBpOYnZobMbg3Kw5m9ibz/WRuGH5zXbE+8An+gWn5W4n+d+tgcr6yX4ehIB10q/IxtR9fHIGGqYtIr+sH3MUPkcxC/B8X26BcrD0olI5fGTfLv8FFSDRKHpPaPZjOg2AVvsIDi5tBpgi2WnJRgvBLHYiOZB1iqginMqRE8O2xrpR5RRQMt7BMH5YX4CHateWIBGnR8KEec6NVEjH28a9g4uiEidK9XdthCKfhBFSXMkrmQPfLlxXVW9e6TmyDGGb7j2/G4fd8Z7CFoqCfWWZBn0ShHJSnaAwKKZffWivEyBJZqjIOqTy8w9VQJMDdnuS5ESA3QRCMvguNfH8g7aDV2W2IjxBd8KoZ7SfQ9M0aVIE0kbBngEfslCXHNfnIVTypjgtBTdLIzV53EmanjnCphaW57huFo57HCZIRsaisq/Y0xUNYN5SeumHKss/zw0URrz55KH6gcV5gt4eoukOORHjP3mzseOJVTWLXkCx+UaeAHq3PrSWNaOuOuI5ZFmFyF05nSyEeCT91wDN+Z761YRViHPvD2rWBAFcuApnt/5674UylUNUXOB2eZOj29WcUSZGl17OUqErlB22qHUt3i6lOimYufw== 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)(396003)(346002)(366004)(376002)(136003)(39850400004)(451199015)(86362001)(36756003)(110136005)(316002)(7406005)(54906003)(478600001)(38350700002)(52116002)(8936002)(44832011)(41300700001)(30864003)(2906002)(4326008)(6486002)(66946007)(66556008)(7416002)(6666004)(5660300002)(66476007)(38100700002)(26005)(8676002)(6512007)(83380400001)(6506007)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?R3KPfUumMZhwtJrh3RH1rYmhPhfQ?= =?utf-8?q?FH/Q0P84wb/f8N+h7v42Lc69UAMcQ4P6yzJQ4P6x4BtGchupNM+OEnqppbLck9rJ8?= =?utf-8?q?GYDbD00eY4+HliVSpVgxr8e97bj683vUFoExMZxXFXkJc0YPz3m8sQutfBgYwNt4W?= =?utf-8?q?1uh7zhG0VCZsEcNNXL/Es7ZuGF9k2WVaLEYiaJOR4XpeGbnfpPPOhIfHI+idXBEdT?= =?utf-8?q?BNIrecvq4mv85wHZLWz2H1GYctC8w4K4jOAfCseFU/Z/CsM+Qk6I2Z4yApSRswoQK?= =?utf-8?q?7HG2tRgqNJK9hu7WaK8+ZvVl94sYE/c6+Jgx4DNZUcpRtuZ+R0zM7S81/NMwcQsN0?= =?utf-8?q?T1/gFa4X5+tFKa3sBaVUOWDd63yUgLYKYgvqegAbeNsrCl3KRGnV3t36dqp1Fd9D+?= =?utf-8?q?e8TmGEz7t1UnSQaU7pv4QA68zTmDJQQ54DuvjQ16t1w6L3yqPqY/rxC8EDpFGYPjq?= =?utf-8?q?PkDtjydPIuoEX5ezKjygoEmpuHuMuvJs1kLE4D/J6H0tRe/69jaryhtcyLjAxzzEd?= =?utf-8?q?qRc7wF3F4s+ZOyBKeTobzgJ5mN1H0iwZnNfkaqmkLF2dHGvxHWkl1fIpN6Rnp2zUa?= =?utf-8?q?MpsiLWmUD1YHRvDdwPaswhBY+Ve0CVWceWwxc/Q7bsuEAI5CkEWsKnz02EN/9Q0FK?= =?utf-8?q?Lw9xhb6r3LAAR+NFdNCwFoDWnxR9+4eLDopSKixdPj8JHx5qwywMNEI9mYUL5oaye?= =?utf-8?q?XXKdXK/nYhd8R0xGqM6dp/GZ2bsEJJ6izTisUqQBTSJF8linyQGXwdiXPln6jRQbv?= =?utf-8?q?wGJNdUCmewTfB8L4+f76nAl+eudw0BBZgDUN51nrayF8mPbL+clwPBnnlw/6Gf0ct?= =?utf-8?q?v9BZPV5HIHWl7ZPKUpuzLtEOQgbuJ5Tsh6cwFD/VjZMMls+hRtumVFem/ilgacOXz?= =?utf-8?q?NJpx2++2gR9bNA/KWpynsQHPeksvIWsw3INGYj3rjxO5KCVudNjGU+hyTKfkWPzzQ?= =?utf-8?q?SvA56tO0VfOJBkziNseeQXgboy6/svueJFxXulqbft90yoxIa5BP/eUJlQuMRkaXP?= =?utf-8?q?wnuq0HiB7h8XQ5ZbYALCIbqNcre3QeGFj7Jsei480MpCt23hPUHMvXKkXNwhzBPPe?= =?utf-8?q?BwHAcTf8vZbRsTRYOJq7gjmTY2LKtZdSh7kSFjGfzxIFJln1FZ7GvJha3Ys1GLmWB?= =?utf-8?q?9z+OwfylpsRmty2fsF34ppwdYctYF6BcI6gsKOy4UJ7RmZUzBE0AAj56nMtcePjne?= =?utf-8?q?xb8ee+XlhE39XLsyeMb+1XPcp+C48gSzs6NHUli2EztCQYWod5ZyqU9RXP4x3mETR?= =?utf-8?q?hZIT2WpYyPFhP4g/fdZaIf23AKmv0lbmRbsdkgW3oY/jn/q2EdLqKV7f0kFjowtgN?= =?utf-8?q?ccANuG+1YsL00XGvCl832aL4PYVudyNdUyQ63ctG/fpw1/7/LRGmVZx2w2ETD7YrX?= =?utf-8?q?F/qR7yQiDAxW/ESD2Y52zrxp/1xAqoiGhP5nX+w8bP0LXTAKXSdhwVmnwL9lo7o2g?= =?utf-8?q?jPwW+FNr/S9H/Kv86OIJlDClRyFoEsLVyNyKwlSFNTpZ7txTdKSn3H1kGotHJe8wE?= =?utf-8?q?Vkzf+t1W3kMoyLEd56g0QpbTg5//Iu/P2Q=3D=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0773e21-0506-45e2-4bab-08dae4759fd8 X-MS-Exchange-CrossTenant-AuthSource: DB9PR03MB8847.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2022 23:38:27.2123 (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: OoB/31SbI/ndNhK5KWP5CvXNmRWBgy3BSwSe+BIP+B121xOTVy1mGVC7xOz5CUd5661o8h8BpAZpH2o846h00A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9100 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.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 --- (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 7043d1c9ed8f..fa37ca10c80b 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -353,11 +353,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; @@ -368,9 +363,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 *),