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;
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;
}
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);
* 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 */