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: 13030822 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 625B1C433FE for ; Thu, 3 Nov 2022 18:24:36 +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=Jtgk7vexFb3ZqWVI0tdWCRdtV7E8KnXOVnBisr4r73k=; b=kKJJx6EE42ETWj uxHEAWNyzeDetQrvSR3g/WGhvtGX/BMLHACTgKBuxNHCK3pLf4eyeZEE3ymDf38bHpYCRfoQ4W3Cs MG55eJoeRTB6t5/nbValu+scfID1Lp+c8djgtQOX/K194KWYutuTMC4KOv7gqsOaXBVNIhDsAC+x3 DtJKJutuiWYJgpJ/pyIxcy9YHvimycE1mmwpGG85VfUEGH6oMnmUYSo9FMOqnoFbfIQi3ETQf36Ao obSmvTW19gJdzIVptAokKEbY972L1fcfjCAagL+l25AuZzlR1h4m+Y9Z9Qb5Bn8/GqxUE0l5ha41H 73j5C/EsdMmVUG9NnlGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqes4-001Fkd-5m; Thu, 03 Nov 2022 18:23:20 +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+S8sAbh5XMtcqsGH1e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gtCdss1TXYrUAdfZueos9Me7YW/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-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 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; }