From: Hans de Goede <hdegoede@redhat.com>
To: matthias.bgg@kernel.org, arend.vanspriel@broadcom.com,
kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org
Cc: brcm80211-dev-list.pdl@broadcom.com, mbrugger@suse.com,
netdev@vger.kernel.org, chi-hsien.lin@cypress.com,
linux-wireless@vger.kernel.org, hante.meuleman@broadcom.com,
linux-kernel@vger.kernel.org, wright.feng@cypress.com,
brcm80211-dev-list@cypress.com, franky.lin@broadcom.com
Subject: Re: [PATCH v3] brcmfmac: Transform compatible string for FW loading
Date: Wed, 1 Jul 2020 14:12:45 +0200 [thread overview]
Message-ID: <eaf0f098-c73c-10b5-2d75-b35a5fc8dbb4@redhat.com> (raw)
In-Reply-To: <20200701112201.6449-1-matthias.bgg@kernel.org>
Hi,
On 7/1/20 1:22 PM, matthias.bgg@kernel.org wrote:
> From: Matthias Brugger <mbrugger@suse.com>
>
> The driver relies on the compatible string from DT to determine which
> FW configuration file it should load. The DTS spec allows for '/' as
> part of the compatible string. We change this to '-' so that we will
> still be able to load the config file, even when the compatible has a
> '/'. This fixes explicitly the firmware loading for
> "solidrun,cubox-i/q".
>
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
>
> ---
>
> Changes in v3:
> - use len variable to store length of string (Hans de Goede)
> - fix for loop to stop on first NULL-byte (Hans de Goede)
>
> Changes in v2:
> - use strscpy instead of strncpy (Hans de Goede)
> - use strlen(tmp) + 1 for allocation (Hans de Goede, kernel test robot)
v3 looks good to me:
Reviewed-by: Hans deGoede <hdegoede@redhat.com>
Regards,
Hans
>
> .../wireless/broadcom/brcm80211/brcmfmac/of.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> index b886b56a5e5a..a7554265f95f 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> @@ -17,7 +17,6 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
> {
> struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
> struct device_node *root, *np = dev->of_node;
> - struct property *prop;
> int irq;
> u32 irqf;
> u32 val;
> @@ -25,8 +24,22 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
> /* Set board-type to the first string of the machine compatible prop */
> root = of_find_node_by_path("/");
> if (root) {
> - prop = of_find_property(root, "compatible", NULL);
> - settings->board_type = of_prop_next_string(prop, NULL);
> + int i, len;
> + char *board_type;
> + const char *tmp;
> +
> + of_property_read_string_index(root, "compatible", 0, &tmp);
> +
> + /* get rid of '/' in the compatible string to be able to find the FW */
> + len = strlen(tmp) + 1;
> + board_type = devm_kzalloc(dev, len, GFP_KERNEL);
> + strscpy(board_type, tmp, len);
> + for (i = 0; i < board_type[i]; i++) {
> + if (board_type[i] == '/')
> + board_type[i] = '-';
> + }
> + settings->board_type = board_type;
> +
> of_node_put(root);
> }
>
>
next prev parent reply other threads:[~2020-07-01 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 11:22 [PATCH v3] brcmfmac: Transform compatible string for FW loading matthias.bgg
2020-07-01 12:12 ` Hans de Goede [this message]
2020-07-14 9:50 ` 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=eaf0f098-c73c-10b5-2d75-b35a5fc8dbb4@redhat.com \
--to=hdegoede@redhat.com \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211-dev-list@cypress.com \
--cc=chi-hsien.lin@cypress.com \
--cc=davem@davemloft.net \
--cc=franky.lin@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=matthias.bgg@kernel.org \
--cc=mbrugger@suse.com \
--cc=netdev@vger.kernel.org \
--cc=wright.feng@cypress.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;
as well as URLs for NNTP newsgroup(s).