[RFC 2/5] wireless: mwifiex: signal firmware readiness using notify-device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 14 ++++++++++++++
 drivers/net/wireless/marvell/mwifiex/main.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index da2e6557e684..92176e90b11e 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -5,6 +5,7 @@
  * Copyright 2011-2020 NXP
  */
 
+#include <linux/notify-device.h>
 #include <linux/suspend.h>
 
 #include "main.h"
@@ -661,6 +662,16 @@ static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 	mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
 	mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt);
 	adapter->is_up = true;
+
+	adapter->notify_dev = notify_device_create(adapter->dev, "firmware-notifier");
+	if (IS_ERR(adapter->notify_dev)) {
+		/* This error is not fatal */
+		mwifiex_dbg(adapter, ERROR,
+			    "cannot create firmware notify device: %d\n",
+			    PTR_ERR(adapter->notify_dev));
+		adapter->notify_dev = NULL;
+	}
+
 	goto done;
 
 err_add_intf:
@@ -1482,6 +1493,9 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter)
 		rtnl_unlock();
 	}
 
+	notify_device_destroy(adapter->notify_dev);
+	adapter->notify_dev = NULL;
+
 	wiphy_unregister(adapter->wiphy);
 	wiphy_free(adapter->wiphy);
 	adapter->wiphy = NULL;
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 63f861e6b28a..b28e90db3128 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -870,6 +870,7 @@ struct mwifiex_adapter {
 	int winner;
 	struct device *dev;
 	struct wiphy *wiphy;
+	struct device *notify_dev;
 	u8 perm_addr[ETH_ALEN];
 	unsigned long work_flags;
 	u32 fw_release_number;
-- 
2.25.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux