sdio: add SDIO_FBR_BASE(f) macro
authorDavid Vrabel <david.vrabel@csr.com>
Wed, 8 Aug 2007 13:23:05 +0000 (14:23 +0100)
committerPierre Ossman <drzeus@drzeus.cx>
Sun, 23 Sep 2007 19:16:27 +0000 (21:16 +0200)
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio_cis.c
include/linux/mmc/sdio.h

index 48c465a..58cf36e 100644 (file)
@@ -30,7 +30,7 @@ static int sdio_read_fbr(struct sdio_func *func)
        unsigned char data;
 
        ret = mmc_io_rw_direct(func->card, 0, 0,
-               func->num * 0x100 + SDIO_FBR_STD_IF, 0, &data);
+               SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data);
        if (ret)
                goto out;
 
@@ -38,7 +38,7 @@ static int sdio_read_fbr(struct sdio_func *func)
 
        if (data == 0x0f) {
                ret = mmc_io_rw_direct(func->card, 0, 0,
-                       func->num * 0x100 + SDIO_FBR_STD_IF_EXT, 0, &data);
+                       SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF_EXT, 0, &data);
                if (ret)
                        goto out;
        }
index ec806a1..d050c40 100644 (file)
@@ -145,7 +145,7 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
                        fn = 0;
 
                ret = mmc_io_rw_direct(card, 0, 0,
-                                      fn * 0x100 + SDIO_FBR_CIS + i, 0, &x);
+                       SDIO_FBR_BASE(fn) + SDIO_FBR_CIS + i, 0, &x);
                if (ret)
                        return ret;
                ptr |= x << (i * 8);
index 9b1ec76..47ba464 100644 (file)
  * Function Basic Registers (FBR)
  */
 
+#define SDIO_FBR_BASE(f)       ((f) * 0x100) /* base of function f's FBRs */
+
 #define SDIO_FBR_STD_IF                0x00
 
 #define  SDIO_FBR_SUPPORTS_CSA 0x40    /* supports Code Storage Area */