drm/sprd: Make use of the helper component_compare_of
authorYong Wu <yong.wu@mediatek.com>
Mon, 14 Feb 2022 06:08:06 +0000 (14:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 11:16:12 +0000 (12:16 +0100)
Use the common compare helper from component.

Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Kevin Tang <kevin3.tang@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20220214060819.7334-11-yong.wu@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/sprd/sprd_drm.c

index a077e2d4d72179ca4bd07de5ece07ae953a5736b..5d534a8db9130888bca20111c30b37b32235df82 100644 (file)
@@ -134,14 +134,9 @@ static const struct component_master_ops drm_component_ops = {
        .unbind = sprd_drm_unbind,
 };
 
-static int compare_of(struct device *dev, void *data)
-{
-       return dev->of_node == data;
-}
-
 static int sprd_drm_probe(struct platform_device *pdev)
 {
-       return drm_of_component_probe(&pdev->dev, compare_of, &drm_component_ops);
+       return drm_of_component_probe(&pdev->dev, component_compare_of, &drm_component_ops);
 }
 
 static int sprd_drm_remove(struct platform_device *pdev)