From nobody Sun Sep 22 11:40:53 2024 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 F2081C433F5 for ; Mon, 14 Feb 2022 06:09:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240620AbiBNGJt (ORCPT ); Mon, 14 Feb 2022 01:09:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240621AbiBNGJr (ORCPT ); Mon, 14 Feb 2022 01:09:47 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78D3C527F7 for ; Sun, 13 Feb 2022 22:09:40 -0800 (PST) X-UUID: a6bf5cf8c9854c499b42223f49772842-20220214 X-UUID: a6bf5cf8c9854c499b42223f49772842-20220214 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1471447973; Mon, 14 Feb 2022 14:09:35 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 14 Feb 2022 14:09:34 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 14 Feb 2022 14:09:33 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 14 Feb 2022 14:09:32 +0800 From: Yong Wu To: Greg Kroah-Hartman , David Airlie , Daniel Vetter , CC: James Wang , Liviu Dudau , , Matthias Brugger , Krzysztof Kozlowski , , "Joerg Roedel" , Will Deacon , Arnd Bergmann , Laurent Pinchart , , Chun-Kuang Hu , , "Stephen Boyd" , AngeloGioacchino Del Regno , Hsin-Yi Wang , Robin Murphy , Tomasz Figa , , Rob Clark , Srinivas Kandagatla , Sebastian Reichel , Yong Wu , "Lucas Stach" , Russell King , Christian Gmeiner , Subject: [PATCH 04/23] drm/etnaviv: Make use of the helper component_compare_of/dev_name Date: Mon, 14 Feb 2022 14:08:00 +0800 Message-ID: <20220214060819.7334-5-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220214060819.7334-1-yong.wu@mediatek.com> References: <20220214060819.7334-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the common compare helpers from component. Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: etnaviv@lists.freedesktop.org Signed-off-by: Yong Wu --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnavi= v/etnaviv_drv.c index 0b756ecb1bc2..1d2b4fb4bcf8 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -574,18 +574,6 @@ static const struct component_master_ops etnaviv_maste= r_ops =3D { .unbind =3D etnaviv_unbind, }; =20 -static int compare_of(struct device *dev, void *data) -{ - struct device_node *np =3D data; - - return dev->of_node =3D=3D np; -} - -static int compare_str(struct device *dev, void *data) -{ - return !strcmp(dev_name(dev), data); -} - static int etnaviv_pdev_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -603,14 +591,14 @@ static int etnaviv_pdev_probe(struct platform_device = *pdev) first_node =3D core_node; =20 drm_of_component_match_add(&pdev->dev, &match, - compare_of, core_node); + component_compare_of, core_node); } } else { char **names =3D dev->platform_data; unsigned i; =20 for (i =3D 0; names[i]; i++) - component_match_add(dev, &match, compare_str, names[i]); + component_match_add(dev, &match, component_compare_dev_name, names[i]); } =20 /* --=20 2.18.0