diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-06-16 10:54:24 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-07-28 12:55:51 +0300 |
commit | bef11f1edc40cee156c60f9dbbbd9725a56b3639 (patch) | |
tree | b00e0708cd671d719cfa7e0860a45f8f05884ae5 /drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | |
parent | 70c898d4bad1a21e0889ae12f355ff8c68ce5b9f (diff) |
wifi: brcmfmac: use strreplace() in brcmf_of_probe()
The for loop in brcmf_of_probe() would ideally end with something like
"i <= strlen(board_type)" instead of "i < board_type[i]". But
fortunately, the two are equivalent.
Anyway, it's simpler to use strreplace() instead.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/YqrhsKcjEA7B2pC4@kili
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index 083ac58f466d..811bd55f0d62 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -72,7 +72,6 @@ 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) { - int i; char *board_type; const char *tmp; @@ -84,10 +83,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, of_node_put(root); return; } - for (i = 0; i < board_type[i]; i++) { - if (board_type[i] == '/') - board_type[i] = '-'; - } + strreplace(board_type, '/', '-'); settings->board_type = board_type; of_node_put(root); |