1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Sat, 7 Jan 2017 23:43:45 +0100
3 Subject: [PATCH] brcmfmac: make brcmf_of_probe more generic
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
8 We may want to use Open Firmware for other devices than just SDIO ones.
9 In future we may want to support more Broadcom properties so there is
10 really no reason for such limitation.
12 Call brcmf_of_probe for all kind of devices & move extra conditions to
13 the body of that funcion.
15 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
18 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
19 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
20 @@ -299,11 +299,9 @@ struct brcmf_mp_device *brcmf_get_module
24 - if ((bus_type == BRCMF_BUSTYPE_SDIO) && (!found)) {
25 - /* No platform data for this device. In case of SDIO try OF
26 - * (Open Firwmare) Device Tree.
28 - brcmf_of_probe(dev, &settings->bus.sdio);
30 + /* No platform data for this device, try OF (Open Firwmare) */
31 + brcmf_of_probe(dev, bus_type, settings);
35 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
36 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
41 -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio)
42 +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
43 + struct brcmf_mp_device *settings)
45 + struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
46 struct device_node *np = dev->of_node;
51 - if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
52 + if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
53 + !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
56 if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
57 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h
58 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h
60 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
63 -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio);
64 +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
65 + struct brcmf_mp_device *settings);
67 -static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio)
68 +static void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
69 + struct brcmf_mp_device *settings)
72 #endif /* CONFIG_OF */