From patchwork Tue Jan 24 15:06:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9535379 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 F2969604A0 for ; Tue, 24 Jan 2017 15:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E767528343 for ; Tue, 24 Jan 2017 15:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E62F328354; Tue, 24 Jan 2017 15:06:42 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 8A6F428388 for ; Tue, 24 Jan 2017 15:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751106AbdAXPGg (ORCPT ); Tue, 24 Jan 2017 10:06:36 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33269 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbdAXPGe (ORCPT ); Tue, 24 Jan 2017 10:06:34 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so17837350lff.0 for ; Tue, 24 Jan 2017 07:06:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2WSZCNiTq9ZdLg4mh9nkA7oGnxT1jkwJILH6+gzLwaY=; b=ji97mdvXU9gxnyb+lT2ez1m94QvD6XyPD0klY7zixx7esZv4iB3CxrqqXo3r7waXPq DGofxH46qgUu05y6eEI+0VrXN416IephTYNj4BCgLGFoWyF1vzZ1GLuIuU62KBwliUud uEV/m+hrcTUQCKGkRaRmz/PLvAhSUiF0HAIdp8J0lrMxGPEdNIIPPnVGGl3FEck3eUrX drjc8ApW8TCwD03J3HNYXve5GtJeSOhVr0jSVubKTlG0Di+sUWkIKBgAdwz9Pr5buqr6 YdUlu1FOrLaJWgG5km/MAZMhfY2wa83jWO+3vcC9a4qNY4dMLuaTopL8E1dmDbMdPrfU rVlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2WSZCNiTq9ZdLg4mh9nkA7oGnxT1jkwJILH6+gzLwaY=; b=CAFsxudLhG2B4YXaVSUHu0EI727T8b7K5CMvqxqMBjGryR/1m5RVC2dutzYlF+quE9 ZUZgZHgXZ7PrnQ8weQ6qf0b65gnl2LJ7ugLzAPWriI+Zvll//m47UXn2Lyp2BZkmlJp/ RaMFyNNAIIrolboxWhQe33bV+sV8dchsnsKQBN1NbN1PnE2Kqwz7LTR230MRyWm/FatJ 8RzQ6vknSLABVy5j5CvDhmcuR5q7DRxTU8w2XGGwhILCCqwHF+kRo1AKAA57fNCcwxz0 QsbjXPCFHzR9iJpxMkJGp7bhVw2jaT72o88yLSYAy3Ane6/SCC12sPQ/G5sLd9x0+AeI vE4g== X-Gm-Message-State: AIkVDXIjZDM5nrXwsb9fQnY89w8QfRLIbmzfknjmhNwmHaIqgXj4Et2ZLBU4HswL5YdwWw== X-Received: by 10.25.211.132 with SMTP id k126mr10028550lfg.61.1485270387390; Tue, 24 Jan 2017 07:06:27 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 66sm7485352lfy.42.2017.01.24.07.06.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 07:06:26 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 3/6] brcmfmac: pcie: store private pointer to struct brcmf_pub Date: Tue, 24 Jan 2017 16:06:09 +0100 Message-Id: <20170124150612.25138-3-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170124150612.25138-1-zajec5@gmail.com> References: <20170124150612.25138-1-zajec5@gmail.com> MIME-Version: 1.0 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 From: Rafał Miłecki Getting this pointer in PCIe code is not trivial and requires using dev_get_drvdata helper which adds extra line of code. Having access to this struct is useful for using generic stuff and e.g. improving logging messages. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 19db8f26729a..a6e7f670d893 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -265,6 +265,7 @@ struct brcmf_pciedev_info { void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, u16 value); struct brcmf_mp_device *settings; + struct brcmf_pub *pub; }; struct brcmf_pcie_ringbuf { @@ -1565,14 +1566,18 @@ static void brcmf_pcie_release_resource(struct brcmf_pciedev_info *devinfo) static int brcmf_pcie_attach_bus(struct brcmf_pciedev_info *devinfo) { + struct device *dev = &devinfo->pdev->dev; + struct brcmf_bus *bus = dev_get_drvdata(dev); int ret; /* Attach to the common driver interface */ - ret = brcmf_attach(&devinfo->pdev->dev, devinfo->settings); + ret = brcmf_attach(dev, devinfo->settings); if (ret) { brcmf_err("brcmf_attach failed\n"); } else { - ret = brcmf_bus_started(&devinfo->pdev->dev); + devinfo->pub = bus->drvr; + + ret = brcmf_bus_started(dev); if (ret) brcmf_err("dongle is not responding\n"); }