From patchwork Thu Feb 2 12:16:55 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: 9551735 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 40A2060405 for ; Thu, 2 Feb 2017 12:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 372CC280CF for ; Thu, 2 Feb 2017 12:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A1C328425; Thu, 2 Feb 2017 12:17:34 +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 C20AE280CF for ; Thu, 2 Feb 2017 12:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751572AbdBBMRc (ORCPT ); Thu, 2 Feb 2017 07:17:32 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33273 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751540AbdBBMRa (ORCPT ); Thu, 2 Feb 2017 07:17:30 -0500 Received: by mail-lf0-f68.google.com with SMTP id x1so1239126lff.0 for ; Thu, 02 Feb 2017 04:17:24 -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=EbAkZCggqMweNSu8r2oLVvZwfgqhnwehd+/M9C4VeM0=; b=qwbO6ml08U2iCK/klRWbRGYRKbu1eK7VQNYCDrDmGkXesLlmm3bBEdSEk5hLTejM+s 0hco66SHtZVGE41cohM3ql4brPE2NWsDAmA+OG/e0k9wGNLX8KZlN87B8asCZcSh6z3y 8jMg+CGP5Ch1t1jIsQQH8lFg7IUGiyY31+sIU1uAosPlqBSLNWF6t2NdxisRPP8ftc6k C+72isBBX1VntwNk5HzalZEL2eWyxelYJaCaE343JTYLMr+io+y9SqSCNDlvA9k1YKtO L3JdG2q87n2xneLX0LI3uCrDP8opsMo42po9+o1nGp//ExgrfdjwRCnKLRBDXPkL4/ok nbJA== 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=EbAkZCggqMweNSu8r2oLVvZwfgqhnwehd+/M9C4VeM0=; b=Gyq10+LiwBhtQUeDHNTrHtc6wk0sbXZTyXXbBlWI96nrQwlfdvkdso407fx3QezlDL 8/tB2pcL7qIqTwjmN9fZYFIrFmNVnuwTQ/eY3sAkuW/FE75L7J/BXiPGZU+a1SKp49uW U9DAg6krLPtCW3jUnQaHmymxGogZOipOYCKde5uKk8265tLyAJbAjF+WB28WKvYFhyFr VE//3iivCsMUflorl/cTWP9ZOLxfr7Vbg8Uigjw/G0rH7sPSRV28gWrdI21ov5K+SdOs SS1aZIsYe296BhdLE7QyWZ5pLI1ebbri3Z/jUj9Ut+AewEtL6MNpZtofXP0EqskKelij NlZg== X-Gm-Message-State: AIkVDXK7KIKTsfhgvkhXLArG0ff0k3qFJMIiT8YGT909NjBr9E9ehtTL1stcAZbgbzownw== X-Received: by 10.46.69.137 with SMTP id s131mr3234489lja.71.1486037838379; Thu, 02 Feb 2017 04:17:18 -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 t10sm2878398lja.48.2017.02.02.04.17.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 04:17:17 -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 V2 3/7] brcmfmac: pcie: store private pointer to struct brcmf_pub Date: Thu, 2 Feb 2017 13:16:55 +0100 Message-Id: <20170202121659.21130-3-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202121659.21130-1-zajec5@gmail.com> References: <20170202121659.21130-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 6fae4cf3f6ab..8a3c6e2e4b38 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 { @@ -1564,14 +1565,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"); }