brcmfmac: remove .init() callback for internal bus interface
authorArend van Spriel <arend@broadcom.com>
Tue, 27 May 2014 10:56:16 +0000 (12:56 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 May 2014 17:08:11 +0000 (13:08 -0400)
The .init() callback was the first function called by the common
bus function brcmf_bus_start(). Given that it is not really
necessary and the bus layer can call it before calling the
brcmf_bus_start() function.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
drivers/net/wireless/brcm80211/brcmfmac/usb.c

index c5dcd82e884bf74a8bebb862519219870cc0f38d..7735328fff21e6da15fd8e8a801f63638b6594b9 100644 (file)
@@ -63,7 +63,6 @@ struct brcmf_bus_dcmd {
  */
 struct brcmf_bus_ops {
        int (*preinit)(struct device *dev);
-       int (*init)(struct device *dev);
        void (*stop)(struct device *dev);
        int (*txdata)(struct device *dev, struct sk_buff *skb);
        int (*txctl)(struct device *dev, unsigned char *msg, uint len);
@@ -114,11 +113,6 @@ static inline int brcmf_bus_preinit(struct brcmf_bus *bus)
        return bus->ops->preinit(bus->dev);
 }
 
-static inline int brcmf_bus_init(struct brcmf_bus *bus)
-{
-       return bus->ops->init(bus->dev);
-}
-
 static inline void brcmf_bus_stop(struct brcmf_bus *bus)
 {
        bus->ops->stop(bus->dev);
index 4cacc3d85212dcc58c70dc546c910c11a48dc3da..09dd8c13d8448392372299c6eb8954132fca9c72 100644 (file)
@@ -916,13 +916,6 @@ int brcmf_bus_start(struct device *dev)
 
        brcmf_dbg(TRACE, "\n");
 
-       /* Bring up the bus */
-       ret = brcmf_bus_init(bus_if);
-       if (ret != 0) {
-               brcmf_err("brcmf_sdbrcm_bus_init failed %d\n", ret);
-               return ret;
-       }
-
        /* add primary networking interface */
        ifp = brcmf_add_if(drvr, 0, 0, "wlan%d", NULL);
        if (IS_ERR(ifp))
index 13c89a0c4ba7ec63f8d7a33688caafa3d407b9f7..494371ccf0f7b285e5d41eab50617366e7c33c9f 100644 (file)
@@ -4020,7 +4020,6 @@ brcmf_sdio_watchdog(unsigned long data)
 static struct brcmf_bus_ops brcmf_sdio_bus_ops = {
        .stop = brcmf_sdio_bus_stop,
        .preinit = brcmf_sdio_bus_preinit,
-       .init = brcmf_sdio_bus_init,
        .txdata = brcmf_sdio_bus_txdata,
        .txctl = brcmf_sdio_bus_txctl,
        .rxctl = brcmf_sdio_bus_rxctl,
@@ -4150,6 +4149,10 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
        brcmf_sdio_debugfs_create(bus);
        brcmf_dbg(INFO, "completed!!\n");
 
+       ret = brcmf_sdio_bus_init(sdiodev->dev);
+       if (ret)
+               goto fail;
+
        /* if firmware path present try to download and bring up bus */
        ret = brcmf_bus_start(bus->sdiodev->dev);
        if (ret != 0) {
index 3ce0e7cfd0271513a13fa8897ecb27e42fcbb8d7..1c846c54db23fa3b8bf5b0c316bbf849067539d8 100644 (file)
@@ -1222,7 +1222,6 @@ error:
 
 static struct brcmf_bus_ops brcmf_usb_bus_ops = {
        .txdata = brcmf_usb_tx,
-       .init = brcmf_usb_up,
        .stop = brcmf_usb_down,
        .txctl = brcmf_usb_tx_ctlpkt,
        .rxctl = brcmf_usb_rx_ctlpkt,
@@ -1263,6 +1262,12 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo)
                goto fail;
        }
 
+       ret = brcmf_usb_up(dev);
+       if (ret) {
+               brcmf_detach(dev);
+               goto fail;
+       }
+
        ret = brcmf_bus_start(dev);
        if (ret) {
                brcmf_err("dongle is not responding\n");