ppa/fm/qe: use block layer in ppa/fm/qe driver
authorYinbo Zhu <yinbo.zhu@nxp.com>
Tue, 25 Sep 2018 06:47:06 +0000 (14:47 +0800)
committerYork Sun <york.sun@nxp.com>
Thu, 27 Sep 2018 15:48:51 +0000 (08:48 -0700)
At present the MMC subsystem maintains its own list of MMC devices.
This cannot work with driver model when CONFIG_BLK is enabled, use
blk_dread to replace previous mmc read interface, use
mmc_get_blk_desc to get the mmc device property.

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
[York S: reformatted commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/ppa.c
drivers/net/fm/fm.c
drivers/qe/qe.c

index a31c4d93ab2387d41221735afe0e6a56dcc877d0..d391f93041528b7591baafaf4162abfe70def8b2 100644 (file)
@@ -99,7 +99,7 @@ int ppa_init(void)
        cnt = DIV_ROUND_UP(fdt_header_len, 512);
        debug("%s: MMC read PPA FIT header: dev # %u, block # %u, count %u\n",
              __func__, dev, blk, cnt);
-       ret = mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, fitp);
+       ret = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, fitp);
        if (ret != cnt) {
                free(fitp);
                printf("MMC/SD read of PPA FIT header at offset 0x%x failed\n",
@@ -123,7 +123,7 @@ int ppa_init(void)
 
        blk = CONFIG_SYS_LS_PPA_ESBC_ADDR >> 9;
        cnt = DIV_ROUND_UP(CONFIG_LS_PPA_ESBC_HDR_SIZE, 512);
-       ret = mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, ppa_hdr_ddr);
+       ret = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, ppa_hdr_ddr);
        if (ret != cnt) {
                free(ppa_hdr_ddr);
                printf("MMC/SD read of PPA header failed\n");
@@ -149,8 +149,7 @@ int ppa_init(void)
        cnt = DIV_ROUND_UP(fw_length, 512);
        debug("%s: MMC read PPA FIT image: dev # %u, block # %u, count %u\n",
              __func__, dev, blk, cnt);
-       ret = mmc->block_dev.block_read(&mmc->block_dev,
-                                       blk, cnt, ppa_fit_addr);
+       ret = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, ppa_fit_addr);
        if (ret != cnt) {
                free(ppa_fit_addr);
                printf("MMC/SD read of PPA FIT header at offset 0x%x failed\n",
index 3327073bf1fc28a510f4a1e0edb0e445eae2d4fe..c5cf188f051b88080d89fe14141c7be9daaad106 100644 (file)
@@ -402,7 +402,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
                printf("\nMMC read: dev # %u, block # %u, count %u ...\n",
                                dev, blk, cnt);
                mmc_init(mmc);
-               (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
+               (void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt,
                                                addr);
        }
 #elif defined(CONFIG_SYS_QE_FMAN_FW_IN_REMOTE)
index 7654df80083ede5d723ce12939871786fdd39ba2..7010bbc2308bbd87873360cb8244e9376045bf99 100644 (file)
@@ -218,7 +218,7 @@ void u_qe_init(void)
                printf("\nMMC read: dev # %u, block # %u, count %u ...\n",
                       dev, blk, cnt);
                mmc_init(mmc);
-               (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
+               (void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt,
                                                addr);
        }
 #endif