From patchwork Tue May 30 12:35:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 9754495 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50FAA602BF for ; Tue, 30 May 2017 12:36:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43DB12846A for ; Tue, 30 May 2017 12:36:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38FD92847B; Tue, 30 May 2017 12:36:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D64932846A for ; Tue, 30 May 2017 12:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbdE3MgS (ORCPT ); Tue, 30 May 2017 08:36:18 -0400 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170]:37520 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbdE3MgK (ORCPT ); Tue, 30 May 2017 08:36:10 -0400 Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 1BAE230C41B; Tue, 30 May 2017 05:36:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 1BAE230C41B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1496147769; bh=dNQXBQOGXNJSKnCYSKIMMToMuj/uiHw+0GM5KmNg+3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2k+FlOAvUHawVjfpf7lK86/88/Cn6VftGXMVXci0e/zdjRzeMgQ9nDeFMVv2JdiE 8R/frDy7pXAEqVFwX3mBEFz6/ohDX3JUFd83o+Ix+8fmW7bDX4GdxC3X0sgZXaBFSG ntzv8c36bhQ90w2YVWbnnNQcA0jN3iKFg7w14GaY= Received: from jenkins-cam-14.cam.broadcom.com (jenkins-cam-14.cam.broadcom.com [10.177.128.77]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id E2932820E5; Tue, 30 May 2017 05:36:07 -0700 (PDT) Received: by jenkins-cam-14.cam.broadcom.com (Postfix, from userid 25152) id 1CFBFB8287E; Tue, 30 May 2017 13:35:58 +0100 (BST) From: Arend van Spriel To: Enric Balletbo i Serra Cc: linux-wireless@vger.kernel.org, Arend van Spriel Subject: [RFT 3/3] brcmfmac: unbind all devices upon failure in firmware callback Date: Tue, 30 May 2017 13:35:54 +0100 Message-Id: <1496147754-2303-4-git-send-email-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496147754-2303-1-git-send-email-arend.vanspriel@broadcom.com> References: <1496147754-2303-1-git-send-email-arend.vanspriel@broadcom.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In brcmf_sdio_firmware_callback() we need to unbind the driver from both sdio_func devices. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 270c0ad..a5b27a4 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3988,14 +3988,14 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, u8 saveclk; brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err); + bus_if = dev_get_drvdata(dev); + sdiodev = bus_if->bus_priv.sdio; if (err) goto fail; - bus_if = dev_get_drvdata(dev); if (!bus_if->drvr) return; - sdiodev = bus_if->bus_priv.sdio; bus = sdiodev->bus; /* try to download image and nvram to the dongle */ @@ -4084,6 +4084,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, fail: brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err); device_release_driver(dev); + device_release_driver(&sdiodev->func[1]->dev); } struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)