Browse Source

icnss2: Unregister AON event notifier

Unregister AON event notifier.

Change-Id: Ic247f7dc1a2672ccca54dac0dbef1d8dbec22fb1
CRs-Fixed: 3522232
Dundi Raviteja 1 year ago
parent
commit
0fcf684c10
2 changed files with 23 additions and 6 deletions
  1. 21 1
      icnss2/main.c
  2. 2 5
      icnss2/main.h

+ 21 - 1
icnss2/main.c

@@ -2350,6 +2350,8 @@ static int icnss_wpss_ssr_register_notifier(struct icnss_priv *priv)
 static int icnss_slate_event_notifier_nb(struct notifier_block *nb,
 					 unsigned long event, void *data)
 {
+	icnss_pr_info("Received slate event 0x%x\n", event);
+
 	if (event == SLATE_STATUS) {
 		struct icnss_priv *priv = container_of(nb, struct icnss_priv,
 						       seb_nb);
@@ -2384,6 +2386,17 @@ static int icnss_register_slate_event_notifier(struct icnss_priv *priv)
 	return ret;
 }
 
+static int icnss_unregister_slate_event_notifier(struct icnss_priv *priv)
+{
+	int ret = 0;
+
+	ret = seb_unregister_for_slate_event(priv->seb_handle, &priv->seb_nb);
+	if (ret < 0)
+		icnss_pr_err("Slate event unregister failed: %d\n", ret);
+
+	return ret;
+}
+
 static int icnss_slate_notifier_nb(struct notifier_block *nb,
 				   unsigned long code,
 				   void *data)
@@ -2458,6 +2471,11 @@ static int icnss_register_slate_event_notifier(struct icnss_priv *priv)
 	return 0;
 }
 
+static int icnss_unregister_slate_event_notifier(struct icnss_priv *priv)
+{
+	return 0;
+}
+
 static int icnss_slate_ssr_register_notifier(struct icnss_priv *priv)
 {
 	return 0;
@@ -4811,8 +4829,10 @@ static int icnss_remove(struct platform_device *pdev)
 
 	complete_all(&priv->unblock_shutdown);
 
-	if (priv->is_slate_rfa)
+	if (priv->is_slate_rfa) {
 		icnss_slate_ssr_unregister_notifier(priv);
+		icnss_unregister_slate_event_notifier(priv);
+	}
 
 	icnss_destroy_ramdump_device(priv->msa0_dump_dev);
 

+ 2 - 5
icnss2/main.h

@@ -369,11 +369,6 @@ struct icnss_ramdump_info {
 	struct device *dev;
 };
 
-#ifndef SLATE_MODULE_ENABLED
-struct seb_notif_info {
-};
-#endif
-
 struct icnss_priv {
 	uint32_t magic;
 	struct platform_device *pdev;
@@ -511,8 +506,10 @@ struct icnss_priv {
 	u32 rf_subtype;
 	u8 is_slate_rfa;
 	struct completion slate_boot_complete;
+#ifdef SLATE_MODULE_ENABLED
 	struct seb_notif_info *seb_handle;
 	struct notifier_block seb_nb;
+#endif
 	struct timer_list recovery_timer;
 	struct timer_list wpss_ssr_timer;
 	bool wpss_self_recovery_enabled;