Linux wireless drivers development
 help / color / mirror / Atom feed
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>, "Kalle Valo" <kvalo@codeaurora.org>
Cc: "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: Re: [PATCH V3 5/9] brcmfmac: pcie: store private pointer to struct brcmf_pub
Date: Sun, 5 Feb 2017 20:49:37 +0100	[thread overview]
Message-ID: <701140c2-0d9b-7496-c8e8-db2e6064e742@broadcom.com> (raw)
In-Reply-To: <20170202213321.11591-5-zajec5@gmail.com>

On 2-2-2017 22:33, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> 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.

It is actually by design that getting the pointer is not trivial. We
have made an effort to use struct device pointer as handle between
common and bus-specific code. So I have some reservations about the
approach in this patch series. I had a few days off so I want to look at
it in more detail tomorrow and probably give it a spin.

Regards,
Arend

> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  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");
>  	}
> 

  reply	other threads:[~2017-02-05 19:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 21:33 [PATCH V3 1/9] brcmfmac: merge two brcmf_err macros into one Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 2/9] brcmfmac: switch to C function (__brcmf_err) for printing errors Rafał Miłecki
2017-02-08  9:15   ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 3/9] brcmfmac: merge two remaining brcmf_err macros Rafał Miłecki
2017-02-08  9:52   ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 4/9] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Rafał Miłecki
2017-02-08  9:54   ` Arend Van Spriel
2017-02-08 10:00     ` Rafał Miłecki
2017-02-08 14:52       ` Kalle Valo
2017-02-08 15:09         ` Rafał Miłecki
2017-02-23 21:08     ` Rafał Miłecki
2017-02-23 21:41     ` Rafał Miłecki
2017-03-21 13:49       ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 5/9] brcmfmac: pcie: store private pointer to struct brcmf_pub Rafał Miłecki
2017-02-05 19:49   ` Arend Van Spriel [this message]
2017-02-02 21:33 ` [PATCH V3 6/9] brcmfmac: usb: " Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 7/9] brcmfmac: sdio: " Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 8/9] brcmfmac: modify all brcmf_err calls adding " Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 9/9] brcmfmac: use dev_err to print errors Rafał Miłecki
2017-02-08  9:02 ` [PATCH V3 1/9] brcmfmac: merge two brcmf_err macros into one Arend Van Spriel
2017-02-08 15:24 ` [V3,1/9] " Kalle Valo

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=701140c2-0d9b-7496-c8e8-db2e6064e742@broadcom.com \
    --to=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 \
    --cc=zajec5@gmail.com \
    /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