Browse Source

touch: synaptics_tcm: skip creating sysfs nodes

Sysfs nodes are defined as device type. If they
are accessed through kobj type, it leads to CFI
failure.

This change skip creating sysfs node as its not
required for touch functionality.

Ideally all the sysfs node should be refactored
with kobj attribute.

Change-Id: I9ca69799231b0df7b10b637d669b64f5bba76918
Signed-off-by: Ritesh Kumar <[email protected]>
Ritesh Kumar 1 year ago
parent
commit
340864a169
1 changed files with 8 additions and 0 deletions
  1. 8 0
      synaptics_tcm/synaptics_tcm_core.c

+ 8 - 0
synaptics_tcm/synaptics_tcm_core.c

@@ -94,6 +94,8 @@
 
 #define HOST_DOWNLOAD_TIMEOUT_MS 1000
 
+/* #define CREATE_SYSFS */
+
 #define DYNAMIC_CONFIG_SYSFS_DIR_NAME "dynamic_config"
 
 #define dynamic_config_sysfs(c_name, id) \
@@ -3350,7 +3352,9 @@ err_pinctrl_get:
 static int syna_tcm_probe(struct platform_device *pdev)
 {
 	int retval;
+#ifdef CREATE_SYSFS
 	int idx;
+#endif
 	struct syna_tcm_hcd *tcm_hcd;
 	const struct syna_tcm_board_data *bdata;
 	const struct syna_tcm_hw_interface *hw_if;
@@ -3489,6 +3493,7 @@ static int syna_tcm_probe(struct platform_device *pdev)
 		}
 	}
 
+#ifdef CREATE_SYSFS
 	sysfs_dir = kobject_create_and_add(PLATFORM_DRIVER_NAME,
 			&pdev->dev.kobj);
 	if (!sysfs_dir) {
@@ -3529,6 +3534,7 @@ static int syna_tcm_probe(struct platform_device *pdev)
 			goto err_sysfs_create_dynamic_config_file;
 		}
 	}
+#endif
 
 #ifdef CONFIG_DRM
 	if (active_panel) {
@@ -3592,6 +3598,7 @@ err_create_run_kthread:
 	fb_unregister_client(&tcm_hcd->fb_notifier);
 #endif
 
+#ifdef CREATE_SYSFS
 err_sysfs_create_dynamic_config_file:
 	for (idx--; idx >= 0; idx--) {
 		sysfs_remove_file(tcm_hcd->dynamnic_config_sysfs_dir,
@@ -3619,6 +3626,7 @@ err_sysfs_create_dir:
 	if (bdata->reset_gpio >= 0)
 		syna_tcm_set_gpio(tcm_hcd, bdata->reset_gpio, false, 0, 0);
 
+#endif
 err_config_gpio:
 	syna_tcm_enable_regulator(tcm_hcd, false);