@@ -49,6 +49,23 @@ void drm_client_dev_unregister(struct drm_device *dev)
49
49
}
50
50
EXPORT_SYMBOL (drm_client_dev_unregister );
51
51
52
+ static void drm_client_hotplug (struct drm_client_dev * client )
53
+ {
54
+ struct drm_device * dev = client -> dev ;
55
+ int ret ;
56
+
57
+ if (!client -> funcs || !client -> funcs -> hotplug )
58
+ return ;
59
+
60
+ if (client -> hotplug_failed )
61
+ return ;
62
+
63
+ ret = client -> funcs -> hotplug (client );
64
+ drm_dbg_kms (dev , "%s: ret=%d\n" , client -> name , ret );
65
+ if (ret )
66
+ client -> hotplug_failed = true;
67
+ }
68
+
52
69
/**
53
70
* drm_client_dev_hotplug - Send hotplug event to clients
54
71
* @dev: DRM device
@@ -61,7 +78,6 @@ EXPORT_SYMBOL(drm_client_dev_unregister);
61
78
void drm_client_dev_hotplug (struct drm_device * dev )
62
79
{
63
80
struct drm_client_dev * client ;
64
- int ret ;
65
81
66
82
if (!drm_core_check_feature (dev , DRIVER_MODESET ))
67
83
return ;
@@ -72,18 +88,8 @@ void drm_client_dev_hotplug(struct drm_device *dev)
72
88
}
73
89
74
90
mutex_lock (& dev -> clientlist_mutex );
75
- list_for_each_entry (client , & dev -> clientlist , list ) {
76
- if (!client -> funcs || !client -> funcs -> hotplug )
77
- continue ;
78
-
79
- if (client -> hotplug_failed )
80
- continue ;
81
-
82
- ret = client -> funcs -> hotplug (client );
83
- drm_dbg_kms (dev , "%s: ret=%d\n" , client -> name , ret );
84
- if (ret )
85
- client -> hotplug_failed = true;
86
- }
91
+ list_for_each_entry (client , & dev -> clientlist , list )
92
+ drm_client_hotplug (client );
87
93
mutex_unlock (& dev -> clientlist_mutex );
88
94
}
89
95
EXPORT_SYMBOL (drm_client_dev_hotplug );
0 commit comments