Browse Source

touch: pt: Stop panel notifier callbacks

Stop panel notifier callbacks upon probe failure.

Change-Id: I8c01d32b8b967cd630e226f45a0c882e3a88e603
Signed-off-by: Surya Teja Kudiri <[email protected]>
Surya Teja Kudiri 2 years ago
parent
commit
040e6ca732
2 changed files with 6 additions and 2 deletions
  1. 3 2
      pt/pt_core.c
  2. 3 0
      pt/pt_regs.h

+ 3 - 2
pt/pt_core.c

@@ -12961,6 +12961,7 @@ static void pt_setup_panel_event_notifier(struct pt_core_data *cd)
 		pt_debug(cd->dev, DL_ERROR,
 				"%s: Register notifier failed!\n", __func__);
 	}
+	cd->entry = cookie;
 }
 #else
 
@@ -15061,7 +15062,7 @@ static int pt_device_exit(struct i2c_client *client)
 		pt_debug(dev, DL_INFO,"%s: Start pt_device_exit\n", __func__);
 
 		if (active_panel)
-			panel_event_notifier_unregister(&cd->fb_notifier);
+			panel_event_notifier_unregister(cd->entry);
 		pt_core_state = STATE_SUSPEND;
 
 		pm_runtime_suspend(dev);
@@ -18435,7 +18436,7 @@ int pt_release(struct pt_core_data *cd)
 	unregister_early_suspend(&cd->es);
 #elif defined(CONFIG_PANEL_NOTIFIER)
 	if (active_panel)
-		panel_event_notifier_unregister(&cd->fb_notifier);
+		panel_event_notifier_unregister(cd->entry);
 #elif defined(CONFIG_DRM)
 	if (active_panel)
 		drm_panel_notifier_unregister(active_panel, &cd->fb_notifier);

+ 3 - 0
pt/pt_regs.h

@@ -1525,6 +1525,9 @@ struct pt_core_data {
 	int raw_cmd_status;
 #ifdef CONFIG_HAS_EARLYSUSPEND
 	struct early_suspend es;
+#elif defined(CONFIG_PANEL_NOTIFIER)
+	struct panel_event_notifier_entry *entry;
+	enum pt_fb_state fb_state;
 #elif defined(CONFIG_FB) || defined(CONFIG_DRM) || defined(CONFIG_PANEL_NOTIFIER)
 	struct notifier_block fb_notifier;
 	enum pt_fb_state fb_state;