--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
-@@ -429,6 +429,7 @@ struct brcmf_fw {
- struct brcmf_fw_request *req;
+@@ -459,6 +459,7 @@ struct brcmf_fw {
u32 curpos;
+ unsigned int board_index;
void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
+ struct completion *completion;
};
#ifdef CONFIG_EFI
-@@ -653,6 +654,8 @@ static void brcmf_fw_request_done(const
+@@ -686,6 +687,8 @@ static void brcmf_fw_request_done(const
fwctx->req = NULL;
}
fwctx->done(fwctx->dev, ret, fwctx->req);
kfree(fwctx);
}
-@@ -693,6 +696,8 @@ int brcmf_fw_get_firmwares(struct device
+@@ -751,6 +754,8 @@ int brcmf_fw_get_firmwares(struct device
{
struct brcmf_fw_item *first = &req->items[0];
struct brcmf_fw *fwctx;
+ struct completion completion;
+ unsigned long time_left;
- char *alt_path;
+ char *alt_path = NULL;
int ret;
-@@ -710,6 +715,9 @@ int brcmf_fw_get_firmwares(struct device
+@@ -768,6 +773,9 @@ int brcmf_fw_get_firmwares(struct device
fwctx->dev = dev;
fwctx->req = req;
fwctx->done = fw_cb;
+ fwctx->completion = &completion;
/* First try alternative board-specific path if any */
- alt_path = brcm_alt_fw_path(first->path, fwctx->req->board_type);
-@@ -726,6 +734,12 @@ int brcmf_fw_get_firmwares(struct device
+ if (fwctx->req->board_types[0])
+@@ -787,6 +795,12 @@ int brcmf_fw_get_firmwares(struct device
if (ret < 0)
brcmf_fw_request_done(NULL, fwctx);