From patchwork Thu Nov 3 18:22:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13030828 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 8E733C4332F for ; Thu, 3 Nov 2022 18:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=Ri25IvUS2pPcHFFOJFgol0o/A0BIx9Pq2JB/9dyhRA8=; b=K+7Ejrcfc9slaEhDF2yIdQzT4B 5xVh0HSMiMrOZH8/JcYbvfsrYhp3wUvfpYHT/uB8bhc7/DwmiaKDIPMXDxmVmNj+TwqjypWiFeUMJ 01BSh5cwiP28pc41wpIG+9+GO4JG3zUv4Ana6hoDlSakDW0Lkkw/XzWJ0qavyAByMwF/lqbJ5AXWu p1RWWj3TgDSeCuWIXjFIPoe/ch8DcXIGRwRyoptMHfZe0UTjiHo141oWq+5/tsVQaQh4S+at4kQUe EVQlAE049d3+2bHQ9B+AAW8pTN+hiKHek/OwSKSRcsaRJylUxQHuNTJoRGQzZC/5CUTI8xeD0Ikf0 TTttVrXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqesG-001FoL-9z; Thu, 03 Nov 2022 18:23:32 +0000 Received: from mail-am7eur03on2074.outbound.protection.outlook.com ([40.107.105.74] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqerg-001FVe-R0; Thu, 03 Nov 2022 18:22:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCMDq7TrJOKSENYeIVBpljc9xL3M4ILGgyhs1Y4wao/xjN3yodnrb0aIh9TIEMv5A5XI8tN3qE4IV58bYI+/ddJSyIG5a6Caroe3179HTSnnG4dHGr6Bu3XFkAGES/ZTAa8VQTQXKAu3Gyg7MQl539x+OKiWurnPsnPBFHgqTP8zqcwMwsxRvgRxjo/AxKc2DWVvzUOP3+V8WV8GULRQQwhMkXalCzv/ywXGXX+FDM4/EOsKkupXdQDNCqxeiTdkVT3u1xA0oSm+6t8W/dg6kh+/GkHyVhOFkXLRQaUQetis8drqjw+xvZl+8sXdh9dGfz3GDqYr+P33JaAxsYUllQ== 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=Ri25IvUS2pPcHFFOJFgol0o/A0BIx9Pq2JB/9dyhRA8=; b=e9vIT1/x0lKivb3jlZmGwkQlfsmRGce2dUB/bWzV2dnRjSwNhtN93i/np2fD9j4s69c4a++pagYe+kj/wxVJVN4lDERdHkp5JY0b4zn9KkHQmFk9CLyqJX5wZ7oeDXEH/4affs/OEDWXeMUu4pLFutbg9ONt9aF/4PVBy+m73bN95eRXmgLI2qvSsy5OVyPfXN+N/pDBg8Wk2XZOgEqneJvXvZZ8a8HpUdl5eCoXpurriDmjzxDEm3WNfHRCwllxTu1xkSlQuSp4UsYC0ONumpk2bjWr5Htj2PeLLcNvn19TTKJUQ03Glf0mA0c82Vie5QLh2e1yWNbj2AMw41+OzQ== 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=Ri25IvUS2pPcHFFOJFgol0o/A0BIx9Pq2JB/9dyhRA8=; b=CXlL5GpPA+TRQviY8fn3oKaPYC+RXiZ/VA0JnMZtasL9mizUaQz8mRUTJTT/dx2qgV8yNrWeHR8ghX38lq9DhQei8WMzamNsElLgQH6MOqmJG8+RiJDfCUwpDEU5tjnIT1IWtjhYksXZ70pR7Ny3RKu5qUxmGJnB2hnC8btUgPoIlDJNh1QHuPxzHolZopFi2YkOFvQ5cxFouXF4Zni4/v4QjTKpbM++U3ZPflLvqbputD0X9mnPBThb3MjoSrM7MfHcEvEhuZDvTckZAki0DJvRKm0WF9s/7OyYu/RZF9EvC8aNdGzLeYXkFaWBXjSBZ3v6EKv/nzLUCRm8j3mgDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM0PR03MB6195.eurprd03.prod.outlook.com (2603:10a6:20b:159::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Thu, 3 Nov 2022 18:22:45 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 18:22:45 +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 , Jaroslav Kysela , Joerg Roedel , Liam Girdwood , Mark Brown , Matthias Brugger , Robin Murphy , Takashi Iwai , Will Deacon , Yong Wu , alsa-devel@alsa-project.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/2] component: Add helper for device nodes Date: Thu, 3 Nov 2022 14:22:21 -0400 Message-Id: <20221103182222.2247724-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103182222.2247724-1-sean.anderson@seco.com> References: <20221103182222.2247724-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0027.prod.exchangelabs.com (2603:10b6:207:18::40) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|AM0PR03MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: b87612b6-e984-4839-fc6d-08dabdc86786 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7zZCzDZn3/RUncMcDPHVLFw0lZ4NH0do8fwaazPGwNGKD6dyKc0Yvznhv5++skeTumA2Vvay1Hjey7jf/jsy5CI2Ul2/vahV0xt69ViokCeXc/AjeUMNSQl0WP3HfVmGa2r7xgAqegZhZBRPXqw9J8vyPyEjBbZwdQxD2S1aa75Byy1CBPxqEvygDm4UctJ73cxaESvgVu2+EcBVImMjOffp8vmaxWcnNXi+P9aNhSSQks5f1wmSEaRNJc9i9ZwTyRuOl0AwM8pGQjnbQTkc5poQbOjZH8hoGRt85tyU5eE78T3WRkm+OakrAcN3i58Rs3CKkwFnpPVeKaEm5XWv3Ql/L+tiAJQCma6l5TGsGESQI6/BSdAJKI9IUO59PMduPiw6XcY5UR7asw/k36NY0FKqWlmDoZPmOIKaZOxJHld+2tqi3/h6P3IqgWQyk9rB6TZKe+2b+G0sk4Y5THm8ZDJMRr00T6P283C5+3Yy5suxWVVkbS8DD3pZbwFNMabcQr9N2DOv9VRzFJrj2B/wkfsPM2jVBujXNXCV0vSke8J6+2yzur9kojPnquhJ83w3vqtyw0b2q3/1xBshcOnhbXJaKqrNEi0Pw1E4bZXELxCePBZLyLvIufh2EVgcCyOXAYtLXLOBKt5PB09VBsZklFV45HQtAPxKv1/BswyTxCuudZnrucKTNyvCSZ5DKHYUy1Tc4ilQnu9OxSjit/jr/SzZKCH47DKLLFc5cFq7oTJpLaORTtm79HEhC0KQbHNi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(366004)(136003)(396003)(39850400004)(376002)(451199015)(2906002)(8676002)(66556008)(66476007)(66946007)(4326008)(316002)(26005)(6506007)(6512007)(8936002)(36756003)(110136005)(44832011)(54906003)(41300700001)(86362001)(5660300002)(7416002)(478600001)(6666004)(6486002)(38100700002)(83380400001)(38350700002)(52116002)(186003)(2616005)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jtkdx5OKpqKBYuF/1HZuG3O0bhdV1LAEtr3ZdMYz+CnqTve+9iUy0RNzTk6NA2F2RuO4ommKjJzEPAoRVlQPQYXdv+IyHkf80sBFESWH+Dh6XbajOv8fbEOii9F5Jik1XWT0KYhyZVmVNREn3VcuvYaKX4c//COGgcxXheeNdsW9SzrtaAOfQQbNm8tbHopgrDQc0FnO0+m6zD763aIVzRSFS0QNxE7AKK6MseyeqPFa8s6bvNmrDXjkGXrlthU4u5JceR21KHxchjJlAiOEN+S8sAbh5XMtcqsGH1eP54VnvO8g8Br1n5UGw5MgDZPdhZXrPU+J8CdyqAlTYp1fbqPHf2EbFwhwJaPlwAR86cLWGxxhLftAI2PC9GiksWGE+2qyJWLYCqVImvjioLg9DEWyWXbcK32jCguiAO15cqjNeFJXWinuTp6iI1vpKPUbcKLxLFnXE+5RTWWLWp5KeD5hzML9bLEZZBES9Zi5w+dwRAFTniZytBMTIo5LtynSf+l0u20K0jjzPFjAtH0txcbCRLpu7VoL1XAE676yrDHSYiyaPDTHGb8xIjdiQ8Uxnoh2QZybqyhQxAetGH8RyfWIibB9Kvo4qBYjgd6wVW23+/mDwtq8bPfrc8/VoSxirhWLbXJSfSViTvToa18tZykKuiEXSxQbdUWI4ZMeeUMj98X1Zvkay9szL+j1eEzxvplbsdsztj808QmjDujeljGLCuPBmgs1oJUkZYB3oRYgOv/QMiw+UWpY//UqxPrTG8bEVkBY5xK/xnocXZ8yoYckHXTV7hHAeUjxrvO0U99KOyA+LP2+Txq3DMf+A0c4fU0fSazHZV65J65FY0alCtbDKau/I0OsREwD0IR3HStuuFPh4evFFR0fMlHA+nVu1OhG34dcRjPwzVZjFOD7vfFOJJRW8ilxr/JIBQABqEyZpu9vfOZrlSG+3qIwX9jWOhqgKTkLdA2iEVD1OC0taSB22Cof0oOH087HQpBJ9QGXTNePbjrdZVCCk6yhMJgV2ixJpIak5faBOogOM0Ml1bF+a0hCnVb86UtTfI4Qv36ddbPJ5lzz3+Q6NynxP9GkCRZ29+j4Wg8da7WyaUjUDrBOqbayjBHgLGJjNFKjVF87tPPNIdTkNu+Fl4FWO1ysberH3apUY63Sx2R/lsmhLs7nDiSKRe9Maw4G7TLCqNgr/jasv5EJF7FMQBa0/ki8sLlbEkPLqGWdtWhOl0B3TFAixqmlKBkcWOMF3orlW7sZpDiTDLIRwCychgf0RrNelTkAGhB5qPqmWHoA8ZAVYYgb8lygZzWCHfD21M5dnhN5f7rH+Hck2pzYSu0mDaRf3elifGwMuhBqPJOAJHzPNDtXUM2uU7L+No4aDPlgtCdss1TXYrUAdfZueos9Me7YW/P8TB2p8f9dbWcY7XUQeU9OhrHAl6pm9mVge/halKrX9hFd+g1K1l/rg63W5T9kTkJqtXCpGb/wSOoMbPZY2tvcPnSacXVU0NLA5lUsZ7eDUuaw0x6gjsG9DYRtL6OFMxsU1HZWV/QYF2o3ud6+AJqcb0+Oe6atHNXzu0TMaQ2xp2L/BMIg+GJG9KCGpyqjoXplWppqO+IBwiZAeCbgqQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: b87612b6-e984-4839-fc6d-08dabdc86786 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 18:22:45.5604 (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: KsSG3phTEJ1yI9PLG8vB/lA+jgI7nkHh6VoYTrYmdUe7vhtAlykwKT/BaLKjaYnfvXW4wLW0aRbnHMWWpZMBiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB6195 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_112256_913200_E5D7BA59 X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org There is a common case where component_patch_add_release is called with component_release_of/component_compare_of and a device node. Add a helper and convert existing users. Signed-off-by: Sean Anderson Acked-by: Mark Brown --- drivers/iommu/mtk_iommu.c | 3 +-- drivers/iommu/mtk_iommu_v1.c | 3 +-- include/linux/component.h | 9 +++++++++ sound/soc/codecs/wcd938x.c | 6 ++---- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2ab2ecfe01f8..483b7a9e4410 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1079,8 +1079,7 @@ static int mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **m } data->larb_imu[id].dev = &plarbdev->dev; - component_match_add_release(dev, match, component_release_of, - component_compare_of, larbnode); + component_match_add_of(dev, match, larbnode); } /* Get smi-(sub)-common dev from the last larb. */ diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6e0e65831eb7..fb09ed6bf550 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -672,8 +672,7 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev) } data->larb_imu[i].dev = &plarbdev->dev; - component_match_add_release(dev, &match, component_release_of, - component_compare_of, larbnode); + component_match_add_of(dev, &match, larbnode); } platform_set_drvdata(pdev, data); diff --git a/include/linux/component.h b/include/linux/component.h index df4aa75c9e7c..fb5d2dbc34d8 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -6,6 +6,7 @@ struct device; +struct device_node; /** * struct component_ops - callbacks for component drivers @@ -128,4 +129,12 @@ static inline void component_match_add(struct device *parent, compare_data); } +static inline void component_match_add_of(struct device *parent, + struct component_match **matchptr, + struct device_node *node) +{ + component_match_add_release(parent, matchptr, component_release_of, + component_compare_of, node); +} + #endif diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index aca06a4026f3..2f8444e54083 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -4474,8 +4474,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x, } of_node_get(wcd938x->rxnode); - component_match_add_release(dev, matchptr, component_release_of, - component_compare_of, wcd938x->rxnode); + component_match_add_of(dev, matchptr, wcd938x->rxnode); wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0); if (!wcd938x->txnode) { @@ -4483,8 +4482,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x, return -ENODEV; } of_node_get(wcd938x->txnode); - component_match_add_release(dev, matchptr, component_release_of, - component_compare_of, wcd938x->txnode); + component_match_add_of(dev, matchptr, wcd938x->txnode); return 0; } From patchwork Thu Nov 3 18:22:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13030829 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 E6631C4332F for ; Thu, 3 Nov 2022 18:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=xEypwbDE72PNOSHsQ4KOrIxfmlBzUI43Xxc+/tlLyGE=; b=gVwsTPOUGgG6TvhXmbiNV0B81J kNZe//UatvU9L9+EMdp6lcHVPgeghbRMCg7II9SWvyLkq5KNK/7L5rWqMwM3lTXIc7q5vHcSBbJNp GMpyB5gWY1cNSJbbcp5Y2mDQ8IApszobjy1ATfZomIWZcmSblF1rc31MBKRf0g7a/EiNJA0nfEZE/ POujeoDZIGyQjY0o0EzLqOh0tSZdNDcaAJXfODZTNn2Rwzb7kztDtrODn17ah9vYFduEZAzTDS2KR lI65vbALsR9g76C+qamoFL82Up3bT+xI6L4JS0v86qonD2xsMlP5mLqREzkjM78sUJwg9Wm5ceqm4 4g8yhIeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqesf-001Fxs-4r; Thu, 03 Nov 2022 18:23:57 +0000 Received: from mail-am7eur03on2074.outbound.protection.outlook.com ([40.107.105.74] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqerj-001FVe-Cm; Thu, 03 Nov 2022 18:23:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKtm0ahJRkrD+1qlAlBzs1XYoIepzTyV+upmqR48Iyh5EcIW3cjRvjq4pbjYy/qBVfTcMUKK8Cbq4DDLSEyoYPiVYU03Fa0lAotWK6Jn6bYe6xZiLVu4l2d6u2uBQG7WS3cifePM5JtLvdewjepASbKG1/fvIfv0NMief38FId358+wyvlS4TJTxePuVnl/PL0zGn0Mxkcl1RDW/0xIPuVOwKTu2nK1NXTSFWvdwPTcUj9PlBdR4vPehZxijl/TNIvWQgMs/+8yFESTBOYDrVxQnKJ32VvEokOAcHR76UYkdmUr4Gj2X/Ie0rtrZtrj/w3G6PttB/UjC94Dlpm9ONA== 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=xEypwbDE72PNOSHsQ4KOrIxfmlBzUI43Xxc+/tlLyGE=; b=K4k8B4JlyFuxNSCYOZA49L50oeehgo0alCLZkr5T2613xfPpk3YSJXBE1YQ5mg6dpsvLt5Ji25EQ1cr9tEZAv2TCr5xZ2QFKO6CR3usKQMuBir9l3+a20JeWHOyCCiahJU69NrBH9kHoZ+Wx0bcLCU9YaxQS1OszPE3piXPhOhHtvzhJ3pAwaFBgNeCoQSYsw4L3jY4mKYmGCIwZ7YbidGv4qqrNvsQTkW8TaKBOUmmEfpnrZoVS+cg6loU8JuA8XhXJLPoVzLv4kg0ILvgcM/LJ5iheIXH2hu0PDZ7YVTDuWTg4Mq86qA0SNkYgEu/jn/bkpT2aLw++Bo/1dVrqOQ== 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=xEypwbDE72PNOSHsQ4KOrIxfmlBzUI43Xxc+/tlLyGE=; b=zINUvUtTaKwFtxGvHUvnSMkoQQwbQGaAhKAvVo9ATVN+gm2aeX24/R37EM5QKvA72yjMToSK89U2ckmjJqv//CBDs3ft87b9aTicytDJCrl6eHga1c1l6FnEFRXA83AZEb19iwyTZYb4UAznpFIm2/5p0SY3iHeHxlKwKWMdEVUsB2ukzV6hJcL2GBPig8wW1k7/we/uCTwSKP8j8vsGHVMZgKSEEmQqafthOuv+BuoLOaVG69ob+zngH7CMywCRKt0oRebvmA45w61vOSrQgmQptj/3Cojbav0ulqAzXc4jDZTjwWeFBCy32KeKInkIPI3rs6arvsPXp+Ab9638IA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM0PR03MB6195.eurprd03.prod.outlook.com (2603:10a6:20b:159::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Thu, 3 Nov 2022 18:22:49 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 18:22:49 +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 , Abhinav Kumar , Alain Volmat , Brian Starkey , Chen Feng , Chen-Yu Tsai , Christian Gmeiner , Chun-Kuang Hu , Dmitry Baryshkov , Jernej Skrabec , John Stultz , Jyri Sarha , 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 2/2] drm: Convert users of drm_of_component_match_add to component_match_add_of Date: Thu, 3 Nov 2022 14:22:22 -0400 Message-Id: <20221103182222.2247724-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103182222.2247724-1-sean.anderson@seco.com> References: <20221103182222.2247724-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0027.prod.exchangelabs.com (2603:10b6:207:18::40) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|AM0PR03MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c5c91ea-a2b7-43f7-db18-08dabdc86995 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: amDTUUEjnKENVBi/YXX+yw61yWN/UWqjQTYltOHhK2bTkUHlYynL8FhsPXNKupuQfdMtA4Q2I6h5YPoyxbaBt2QeN6pqb8wcMhv47M6skqtoZs20EbQSphAGN6DGGpAucx/Cm9jANZzXUN+uBEURpvbZtFb/msR5FGH/Mg3Esz0C0WHWi3cMrIIMHMSwwPyL5eYMVN+UXO5EuD4qT6A8ecHcKE8ed1Tat6a5vYIfKgVxZXE3BQziFs/ERF2tyBbzDJbTcDm7BbQ8IQbXtps08Ulk15nunOzQI+kFvXYK8L/RQKPdtakarFpdmNMEKjdu+C7sxCawe1YuRdPsIaqcjEWDaEu1AAlCHv9xTzfwIgW4HM8lo2YlTUC288nx6bWCHOwFzdBUhSgtsonShv519eMRisfmzdWxH6cTbXf/8SnhQTl+4TUp6H8E0mHZCtevXI0Fz1rc+2uwFb8yCjt7GqwLves//5hirMmeB9yBaOeQe/IKTFi19z2kV066yUF97UUFLuiO2hpA6gPAiCXM9UH6uG+/8uvyZ5vdKS+jwYPT+c3oIeTqpaMHI0FZ9cQgOmO2Zp/2XgLCyL2oQ144ZWL5hVUzjhBjewDfTOMbbjoPPpRmOwyhuQst6bMlsJo/InGj73a0oU2HjozCgkTLblEawuLc786dGyW1NNkkgJjhjT4df2g6ofngPOFJ274iOcYm+Sq7P+FS/+DsVXCG8pvYOg/Kr0ihsPd+aDm3x1Beh8chUK8q1pQRurRetdzG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(366004)(136003)(396003)(39850400004)(376002)(451199015)(2906002)(8676002)(66556008)(66476007)(66946007)(4326008)(316002)(26005)(6506007)(6512007)(8936002)(36756003)(30864003)(110136005)(44832011)(54906003)(41300700001)(86362001)(5660300002)(7416002)(7406005)(478600001)(6666004)(6486002)(38100700002)(83380400001)(38350700002)(52116002)(186003)(2616005)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DxCnKaejCp/3Y/AOexMoAwSH9u9isLnVxMwzpqxTdPtoUGsHFIftqMmL1hhK9SEt1SMd1J9IfGxRB0ALbjETM4vja3g2DGsFVXu4lo749oZ06kN+ViUQ7s1n25yxbBuRHHaloRi4o0UF7mDPwXE+44o3nx/Si/glWQOLmoahy1SFXsyTbH4voSTdq6e9uDc8za1llH3yz6xNnMTgZgm8dZ0fTj1U47n05WV9RZHIIstM3ocw6cpxv0/v8eozCEqVgi6t74YyIh03WbGSQ3kIEHXikuUpVtOX6njGtUYYAPyjgcObb2Kk4Hl4Z8gVtRoQqb3a5pPfoCk3wMCSY1q4GKqsu+YuN8n7Dbz6LCnoIqEIuV38wuswQG9eDbBpD3f41sxFrePHjZRwvgQbpO2SV7Oxj7LYMmkeivSeRvP/dmfPC6fdOAU1JV8dcqNQfJBwuOg/Frn1ULV//Hn0/c6GRb4do1yFvu+IvuL73mPawPGWSJV08iMcr3a0z7GD0cWYZJ1beKrVxNmradtX9+GU2rA8XfWBv4DU93idpFovKVwQzxjsj9vFHnYeSjLa1r/jviqwYZf/WbiFCu16HO5y7ZxCCAccjKM8vNUkMsl+HO+k3VVRYcpfw1/ltJw3ycNUMySthJACgwamoBIKKdPrSfBBMbzT2SJim2ES2/DRHqQYjysH4ugjHnpzEQ0RwzuaX3A4cYnWWlDigpEeJxjaTgk/dtLEh034jzrlN1Z6b/t6hR1nZ/eov1UlPMapPKiN5Z0aMXafESEMY2fTCY7L/iFJC4epHK/fR8TuG6McZdXwaveFItK11dmtwUE2WHKqcJ0tm5UrbgMEVroYMypoinbyBZ86y0ExGCk6HzUUcGSPOZIpwcmypxf+v/f/mjeXBrZ0zt8qAn60TfdUFqzcE3sRgEGf40mFxkUbHf0FNRkxlJbX35kqRzqsXkIz4+9BuaMiiJSe3NQbZTNpXsuv7v2MjMHxHydzz8jHa8MkJgTgnRbn2+CkSCvtvjntYHWRBgi688uv0zFJs7Q7ITl2PVR2G6v5xi00h9mA59oMI1veDb2GlsBQcia4lLFisan4iK+MvZ7KxvejRmWocitq8GCPzDR/lTcSHsFhjty6zxnd9LUDlMQ4jW50l4NC8jA+duR7TI5QiXSvYSifSdUIrTvEXsBuWF7DB6nLozElbbpWzStAiiEd+JDZW/kZixwVCoRKl636iEji+wIt0RF1SkcA+BlE2LEqRmdaJPtA6Qrnca1lJ74Hre6XSR01GsWzDxVP8T1Me2BTjnswRCoHrHBIujvU+z2+heTOfhkmU+kHrdKi6D4pCPFOCIKpr4jfdd5eEaU9LnK+Wt1IegpI7QvwdPzGa/7U9frXo8zJO2Ge5HehSNt/wJcOQxo5r+xB6CA4IQ2i0XjecHrfUN4yuB8VmWID39yv03h4L8NOwpqyAnWMtaSD5aY+if9DZHJAQ0ZfBCkySWi4QlELOugnWaX4UYAStUlp0mWnwS+pvCsqiuvRF1F0EnxiIxzgAZAZO75gH+EXdXViqcpNvp22MRJiYPhhIROHAliR25RVEc00UkXt+jvmbMP7N+MKEqHLdkW/kjLFfkyxxT77sX31gg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c5c91ea-a2b7-43f7-db18-08dabdc86995 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 18:22:49.0446 (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: j0dMgfXQ7kAoHa7NHfZwmxl9quhp5U6+2XkguCWVQjY4uWcpM/de2RBtbkjVEF6mlExF/DV50w8+Ltf/l8TWhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB6195 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_112259_531061_2AD2B682 X-CRM114-Status: GOOD ( 16.45 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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 --- .../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 9fce4239d4ad..e5bf439b799f 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 a032003c340c..18e58863a2f1 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -352,11 +352,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; @@ -367,9 +362,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 1d0b0c54ccc7..aace8b87c6d3 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -926,13 +926,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; @@ -946,9 +939,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 73ee7f25f734..fc736759274f 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 ab0515d2c420..75a19e6b85c0 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1445,8 +1445,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 91f58db5915f..9ca265129659 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -779,8 +779,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 28034c21f6bc..1152da3d58dc 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 @@ -1148,10 +1149,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; @@ -1180,9 +1180,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 7abf010a3293..3ae4b73dfa92 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 d06ffd99d86e..a67c2010c7a2 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 *),