Procházet zdrojové kódy

mm-drivers: hw_fence: silently fail registration when feature disabled

Current hw-fencing feature is disabled by default through kernel command line
argument, therefore it is expected that clients receive an error when trying
to register a client while feature is disabled.
This change silence any print error messages during the clients registration
when feature is disabled.

Change-Id: Ie57adb52a975f9541e485039a582407cf21c11cd
Signed-off-by: Ingrid Gallardo <[email protected]>
Ingrid Gallardo před 2 roky
rodič
revize
0219a76630
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      hw_fence/src/msm_hw_fence.c

+ 3 - 0
hw_fence/src/msm_hw_fence.c

@@ -24,6 +24,9 @@ void *msm_hw_fence_register(enum hw_fence_client_id client_id_ext,
 	enum hw_fence_client_id client_id;
 	int ret;
 
+	if (!hw_fence_driver_enable)
+		return ERR_PTR(-ENODEV);
+
 	HWFNC_DBG_H("++ client_id_ext:%d\n", client_id_ext);
 
 	if (IS_ERR_OR_NULL(hw_fence_drv_data) || !hw_fence_drv_data->resources_ready) {