linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: "Arend van Spriel" <arend.vanspriel@broadcom.com>,
	"Franky Lin" <franky.lin@broadcom.com>,
	"Hante Meuleman" <hante.meuleman@broadcom.com>,
	"Pieter-Paul Giesberts" <pieter-paul.giesberts@broadcom.com>,
	"Franky Lin" <frankyl@broadcom.com>,
	linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH 4/6] brcmfmac: usb: store private pointer to struct brcmf_pub
Date: Tue, 24 Jan 2017 16:06:10 +0100	[thread overview]
Message-ID: <20170124150612.25138-4-zajec5@gmail.com> (raw)
In-Reply-To: <20170124150612.25138-1-zajec5@gmail.com>

From: Rafał Miłecki <rafal@milecki.pl>

Having access to this struct is useful for using generic stuff and e.g.
improving logging messages.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index d93ebbdc7737..523949c44861 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -174,6 +174,7 @@ struct brcmf_usbdev_info {
 
 	bool wowl_enabled;
 	struct brcmf_mp_device *settings;
+	struct brcmf_pub *pub;
 };
 
 static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo,
@@ -1135,26 +1136,29 @@ static const struct brcmf_bus_ops brcmf_usb_bus_ops = {
 
 static int brcmf_usb_bus_setup(struct brcmf_usbdev_info *devinfo)
 {
+	struct device *dev = devinfo->dev;
+	struct brcmf_bus *bus = dev_get_drvdata(dev);
 	int ret;
 
 	/* Attach to the common driver interface */
-	ret = brcmf_attach(devinfo->dev, devinfo->settings);
+	ret = brcmf_attach(dev, devinfo->settings);
 	if (ret) {
 		brcmf_err("brcmf_attach failed\n");
 		return ret;
 	}
+	devinfo->pub = bus->drvr;
 
-	ret = brcmf_usb_up(devinfo->dev);
+	ret = brcmf_usb_up(dev);
 	if (ret)
 		goto fail;
 
-	ret = brcmf_bus_started(devinfo->dev);
+	ret = brcmf_bus_started(dev);
 	if (ret)
 		goto fail;
 
 	return 0;
 fail:
-	brcmf_detach(devinfo->dev);
+	brcmf_detach(dev);
 	return ret;
 }
 
-- 
2.11.0

  parent reply	other threads:[~2017-01-24 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 15:06 [PATCH 1/6] brcmfmac: switch to C function (__brcmf_err) for printing errors Rafał Miłecki
2017-01-24 15:06 ` [PATCH 2/6] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Rafał Miłecki
2017-01-24 23:41   ` kbuild test robot
2017-01-24 15:06 ` [PATCH 3/6] brcmfmac: pcie: store private pointer to struct brcmf_pub Rafał Miłecki
2017-01-24 15:06 ` Rafał Miłecki [this message]
2017-01-24 15:06 ` [PATCH 5/6] brcmfmac: modify all brcmf_err calls adding " Rafał Miłecki
2017-01-24 22:02   ` kbuild test robot
2017-01-24 22:08     ` Rafał Miłecki
2017-01-24 23:55   ` kbuild test robot
2017-01-24 15:06 ` [PATCH 6/6] brcmfmac: use dev_err to print errors Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170124150612.25138-4-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=franky.lin@broadcom.com \
    --cc=frankyl@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pieter-paul.giesberts@broadcom.com \
    --cc=rafal@milecki.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).