88#include <linux/kernel.h>
99#include <linux/of.h>
1010#include <linux/platform_device.h>
11- #include <linux/component.h>
1211#include <linux/pm_runtime.h>
1312#include <drm/drm_fbdev_generic.h>
1413#include <drm/drm_module.h>
@@ -28,13 +27,11 @@ struct komeda_dev *dev_to_mdev(struct device *dev)
2827 return mdrv ? mdrv -> mdev : NULL ;
2928}
3029
31- static void komeda_unbind (struct device * dev )
30+ static void komeda_platform_remove (struct platform_device * pdev )
3231{
32+ struct device * dev = & pdev -> dev ;
3333 struct komeda_drv * mdrv = dev_get_drvdata (dev );
3434
35- if (!mdrv )
36- return ;
37-
3835 komeda_kms_detach (mdrv -> kms );
3936
4037 if (pm_runtime_enabled (dev ))
@@ -48,8 +45,9 @@ static void komeda_unbind(struct device *dev)
4845 devm_kfree (dev , mdrv );
4946}
5047
51- static int komeda_bind (struct device * dev )
48+ static int komeda_platform_probe (struct platform_device * pdev )
5249{
50+ struct device * dev = & pdev -> dev ;
5351 struct komeda_drv * mdrv ;
5452 int err ;
5553
@@ -91,51 +89,6 @@ static int komeda_bind(struct device *dev)
9189 return err ;
9290}
9391
94- static const struct component_master_ops komeda_master_ops = {
95- .bind = komeda_bind ,
96- .unbind = komeda_unbind ,
97- };
98-
99- static void komeda_add_slave (struct device * master ,
100- struct component_match * * match ,
101- struct device_node * np ,
102- u32 port , u32 endpoint )
103- {
104- struct device_node * remote ;
105-
106- remote = of_graph_get_remote_node (np , port , endpoint );
107- if (remote ) {
108- drm_of_component_match_add (master , match , component_compare_of , remote );
109- of_node_put (remote );
110- }
111- }
112-
113- static int komeda_platform_probe (struct platform_device * pdev )
114- {
115- struct device * dev = & pdev -> dev ;
116- struct component_match * match = NULL ;
117- struct device_node * child ;
118-
119- if (!dev -> of_node )
120- return - ENODEV ;
121-
122- for_each_available_child_of_node (dev -> of_node , child ) {
123- if (of_node_cmp (child -> name , "pipeline" ) != 0 )
124- continue ;
125-
126- /* add connector */
127- komeda_add_slave (dev , & match , child , KOMEDA_OF_PORT_OUTPUT , 0 );
128- komeda_add_slave (dev , & match , child , KOMEDA_OF_PORT_OUTPUT , 1 );
129- }
130-
131- return component_master_add_with_match (dev , & komeda_master_ops , match );
132- }
133-
134- static void komeda_platform_remove (struct platform_device * pdev )
135- {
136- component_master_del (& pdev -> dev , & komeda_master_ops );
137- }
138-
13992static const struct of_device_id komeda_of_match [] = {
14093 { .compatible = "arm,mali-d71" , .data = d71_identify , },
14194 { .compatible = "arm,mali-d32" , .data = d71_identify , },
0 commit comments