]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: brcm80211: remove conditional BCMSDIO code from bcmsrom.c
authorArend van Spriel <arend@broadcom.com>
Fri, 25 Mar 2011 10:26:00 +0000 (11:26 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Apr 2011 05:36:14 +0000 (22:36 -0700)
The source file is only used by the softmac driver and will never be
compiled with the BCMSDIO flag enabled so there is no need to have code
ifdef for this flag.

Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/util/bcmsrom.c

index de9f79929a8db8b460e0c0c4ca9e80e5d73b1493..b029ecd92f5a01e3e288f6dac2c288164a23456a 100644 (file)
 #include <siutils.h>
 #include <bcmsrom.h>
 #include <bcmsrom_tbl.h>
-#ifdef BCMSDIO
-#include <bcmsdh.h>
-#include <sdio.h>
-#endif
 
 #include <bcmnvram.h>
 #include <bcmotp.h>
 
-#if defined(BCMSDIO)
-#include <sbsdio.h>
-#include <sbhnddma.h>
-#include <sbsdpcmdev.h>
-#endif
-
 #define SROM_OFFSET(sih) ((sih->ccrev > 31) ? \
        (((sih->cccaps & CC_CAP_SROM) == 0) ? NULL : \
         ((u8 *)curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP)) : \
@@ -64,11 +54,6 @@ static int initvars_srom_si(si_t *sih, void *curmap, char **vars, uint *count);
 static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b);
 static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count);
 static int initvars_flash_si(si_t *sih, char **vars, uint *count);
-#ifdef BCMSDIO
-static int initvars_cis_sdio(char **vars, uint *count);
-static int sprom_cmd_sdio(u8 cmd);
-static int sprom_read_sdio(u16 addr, u16 *data);
-#endif                         /* BCMSDIO */
 static int sprom_read_pci(si_t *sih, u16 *sprom,
                          uint wordoff, u16 *buf, uint nwords, bool check_crc);
 #if defined(BCMNVRAMR)
@@ -173,11 +158,6 @@ int srom_var_init(si_t *sih, uint bustype, void *curmap,
 
                return initvars_srom_pci(sih, curmap, vars, count);
 
-#ifdef BCMSDIO
-       case SDIO_BUS:
-               return initvars_cis_sdio(vars, count);
-#endif                         /* BCMSDIO */
-
        default:
                ASSERT(0);
        }
@@ -1974,92 +1954,6 @@ static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count)
        return err;
 }
 
-#ifdef BCMSDIO
-/*
- * Read the SDIO cis and call parsecis to initialize the vars.
- * Return 0 on success, nonzero on error.
- */
-static int initvars_cis_sdio(char **vars, uint *count)
-{
-       u8 *cis[SBSDIO_NUM_FUNCTION + 1];
-       uint fn, numfn;
-       int rc = 0;
-
-       numfn = bcmsdh_query_iofnum(NULL);
-       ASSERT(numfn <= SDIOD_MAX_IOFUNCS);
-
-       for (fn = 0; fn <= numfn; fn++) {
-               cis[fn] = kzalloc(SBSDIO_CIS_SIZE_LIMIT, GFP_ATOMIC);
-               if (cis[fn] == NULL) {
-                       rc = -1;
-                       break;
-               }
-
-               if (bcmsdh_cis_read(NULL, fn, cis[fn], SBSDIO_CIS_SIZE_LIMIT) !=
-                   0) {
-                       kfree(cis[fn]);
-                       rc = -2;
-                       break;
-               }
-       }
-
-       if (!rc)
-               rc = srom_parsecis(cis, fn, vars, count);
-
-       while (fn-- > 0)
-               kfree(cis[fn]);
-
-       return rc;
-}
-
-/* set SDIO sprom command register */
-static int sprom_cmd_sdio(u8 cmd)
-{
-       u8 status = 0;
-       uint wait_cnt = 1000;
-
-       /* write sprom command register */
-       bcmsdh_cfg_write(NULL, SDIO_FUNC_1, SBSDIO_SPROM_CS, cmd, NULL);
-
-       /* wait status */
-       while (wait_cnt--) {
-               status =
-                   bcmsdh_cfg_read(NULL, SDIO_FUNC_1, SBSDIO_SPROM_CS, NULL);
-               if (status & SBSDIO_SPROM_DONE)
-                       return 0;
-       }
-
-       return 1;
-}
-
-/* read a word from the SDIO srom */
-static int sprom_read_sdio(u16 addr, u16 *data)
-{
-       u8 addr_l, addr_h, data_l, data_h;
-
-       addr_l = (u8) ((addr * 2) & 0xff);
-       addr_h = (u8) (((addr * 2) >> 8) & 0xff);
-
-       /* set address */
-       bcmsdh_cfg_write(NULL, SDIO_FUNC_1, SBSDIO_SPROM_ADDR_HIGH, addr_h,
-                        NULL);
-       bcmsdh_cfg_write(NULL, SDIO_FUNC_1, SBSDIO_SPROM_ADDR_LOW, addr_l,
-                        NULL);
-
-       /* do read */
-       if (sprom_cmd_sdio(SBSDIO_SPROM_READ))
-               return 1;
-
-       /* read data */
-       data_h =
-           bcmsdh_cfg_read(NULL, SDIO_FUNC_1, SBSDIO_SPROM_DATA_HIGH, NULL);
-       data_l =
-           bcmsdh_cfg_read(NULL, SDIO_FUNC_1, SBSDIO_SPROM_DATA_LOW, NULL);
-
-       *data = (data_h << 8) | data_l;
-       return 0;
-}
-#endif                         /* BCMSDIO */
 
 static int initvars_srom_si(si_t *sih, void *curmap, char **vars, uint *varsz)
 {