]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: brcm80211: remove duplicate set sb window address function
authorFranky Lin <frankyl@broadcom.com>
Thu, 1 Sep 2011 09:17:04 +0000 (11:17 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:38:50 +0000 (16:38 -0700)
In fullmac, brcmf_sdbrcm_set_siaddr_window and brcmf_sdcard_set_sbaddr_window
have identical fucntionality. Remove the one in dhd_sdio.c

Reported-by: Rafal Milecki <zajec5@gmail.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdh.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/sdio_host.h

index 8448b8bb5496b37d00319e42774db869ec1e2a9f..367277608a4fe9536059bbed75ebf982fed36fc6 100644 (file)
@@ -275,7 +275,7 @@ int brcmf_sdcard_cis_read(struct brcmf_sdio_dev *sdiodev, uint func, u8 * cis,
        return status;
 }
 
-static int
+int
 brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
 {
        int err = 0;
index c1647ebafb5e311fe7bfa660536e918436ce3bed..72e5629b1f9f50e0e75ebbf9bd7e6ceace123832 100644 (file)
@@ -948,24 +948,6 @@ static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size)
                bus->ramsize = brcmf_dongle_memsize;
 }
 
-static int brcmf_sdbrcm_set_siaddr_window(struct brcmf_bus *bus, u32 address)
-{
-       int err = 0;
-       brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
-                              SBSDIO_FUNC1_SBADDRLOW,
-                              (address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
-       if (!err)
-               brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
-                                SBSDIO_FUNC1_SBADDRMID,
-                                (address >> 16) & SBSDIO_SBADDRMID_MASK, &err);
-       if (!err)
-               brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
-                                      SBSDIO_FUNC1_SBADDRHIGH,
-                                      (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
-                                      &err);
-       return err;
-}
-
 /* Turn backplane clock on or off */
 static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
 {
@@ -1958,7 +1940,7 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
                dsize = size;
 
        /* Set the backplane window to include the start address */
-       bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
+       bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, address);
        if (bcmerror) {
                brcmf_dbg(ERROR, "window change failed\n");
                goto xfer_done;
@@ -1981,7 +1963,8 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
                if (size) {
                        data += dsize;
                        address += dsize;
-                       bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
+                       bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev,
+                                                                 address);
                        if (bcmerror) {
                                brcmf_dbg(ERROR, "window change failed\n");
                                break;
@@ -1993,7 +1976,7 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
 
 xfer_done:
        /* Return the window to backplane enumeration space for core access */
-       if (brcmf_sdbrcm_set_siaddr_window(bus,
+       if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev,
                                           brcmf_sdcard_cur_sbwad(
                                                        bus->sdiodev)))
                brcmf_dbg(ERROR, "FAILED to set window back to 0x%x\n",
@@ -4838,7 +4821,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
        bus->alp_only = true;
 
        /* Return the window to backplane enumeration space for core access */
-       if (brcmf_sdbrcm_set_siaddr_window(bus, SI_ENUM_BASE))
+       if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, SI_ENUM_BASE))
                brcmf_dbg(ERROR, "FAILED to return to SI_ENUM_BASE\n");
 
 #ifdef BCMDBG
index 03ae16aac321ff48ddbbdbbc1d96d0690319a999..9c55c4a600f0837258a5652daad21a4f9f44783a 100644 (file)
@@ -234,6 +234,9 @@ extern int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
 /* Function to return current window addr */
 extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev);
 
+extern int brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev,
+                                         u32 address);
+
 /* attach, return handler on success, NULL if failed.
  *  The handler shall be provided by all subsequent calls. No local cache
  *  cfghdl points to the starting address of pci device mapped memory