Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755400AbdC3DZx (ORCPT ); Wed, 29 Mar 2017 23:25:53 -0400 Received: from mail.kernel.org ([198.145.29.136]:52066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755301AbdC3DZj (ORCPT ); Wed, 29 Mar 2017 23:25:39 -0400 From: "Luis R. Rodriguez" To: gregkh@linuxfoundation.org Cc: wagi@monom.org, dwmw2@infradead.org, rafal@milecki.pl, arend.vanspriel@broadcom.com, rjw@rjwysocki.net, yi1.li@linux.intel.com, atull@opensource.altera.com, moritz.fischer@ettus.com, pmladek@suse.com, johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, kvalo@codeaurora.org, luto@kernel.org, takahiro.akashi@linaro.org, dhowells@redhat.com, pjones@redhat.com, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH v6 5/5] brcmfmac: don't warn user if requested nvram fails Date: Wed, 29 Mar 2017 20:25:14 -0700 Message-Id: <20170330032514.17173-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170330032514.17173-1-mcgrof@kernel.org> References: <20170330032514.17173-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2109 Lines: 58 The requested nvram is optional, don't nag users about this. Additionally, the new driver data API enables us to let the API deal with the freeing of the nvram for us if we happen to free it immediately on the consumer callback, this driver does that so take advantage of this feature. Originally based on patches by Rafał Miłecki. Signed-off-by: Luis R. Rodriguez --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index c7c1e9906500..d77ab264b5c1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -473,7 +473,6 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) if (raw_nvram) bcm47xx_nvram_release_contents(data); - release_firmware(fw); if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) goto fail; @@ -491,6 +490,9 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx) { struct brcmf_fw *fwctx = ctx; + struct driver_data_req_params params = { + DRIVER_DATA_DEFAULT_ASYNC_OPT(brcmf_fw_request_nvram_done, fwctx), + }; int ret; brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev)); @@ -504,10 +506,7 @@ static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx) return; } fwctx->code = fw; - ret = request_firmware_nowait(THIS_MODULE, true, fwctx->nvram_name, - fwctx->dev, GFP_KERNEL, fwctx, - brcmf_fw_request_nvram_done); - + ret = driver_data_request_async(fwctx->nvram_name, ¶ms, fwctx->dev); if (!ret) return; -- 2.11.0