[RFC,2/5] wireless: mwifiex: signal firmware readiness using notify-device
Commit Message
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
drivers/net/wireless/marvell/mwifiex/main.c | 14 ++++++++++++++
drivers/net/wireless/marvell/mwifiex/main.h | 1 +
2 files changed, 15 insertions(+)
@@ -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;
@@ -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;