Commit cb0060e8360fe75c98b2c21740fde80a8e1f62ec
Committed by
Tom Rini
1 parent
39e709611d
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
mmc: arm_pl180_mmci: update arm_pl180_mmci_init() prototype
Update arm_pl180_mmci_init() prototype by adding struct mmc** param. This is needed before converting this driver to driver model in order to use arm_pl180_mmci_init() in driver model and in none driver model implementation Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Showing 3 changed files with 8 additions and 7 deletions Side-by-side Diff
board/armltd/vexpress/vexpress_common.c
... | ... | @@ -76,6 +76,7 @@ |
76 | 76 | (void) bis; |
77 | 77 | #ifdef CONFIG_ARM_PL180_MMCI |
78 | 78 | struct pl180_mmc_host *host; |
79 | + struct mmc *mmc; | |
79 | 80 | |
80 | 81 | host = malloc(sizeof(struct pl180_mmc_host)); |
81 | 82 | if (!host) |
... | ... | @@ -91,7 +92,7 @@ |
91 | 92 | host->clock_in = ARM_MCLK; |
92 | 93 | host->clock_min = ARM_MCLK / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1)); |
93 | 94 | host->clock_max = CONFIG_ARM_PL180_MMCI_CLOCK_FREQ; |
94 | - rc = arm_pl180_mmci_init(host); | |
95 | + rc = arm_pl180_mmci_init(host, &mmc); | |
95 | 96 | #endif |
96 | 97 | return rc; |
97 | 98 | } |
drivers/mmc/arm_pl180_mmci.c
... | ... | @@ -348,9 +348,8 @@ |
348 | 348 | * Set initial clock and power for mmc slot. |
349 | 349 | * Initialize mmc struct and register with mmc framework. |
350 | 350 | */ |
351 | -int arm_pl180_mmci_init(struct pl180_mmc_host *host) | |
351 | +int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct mmc **mmc) | |
352 | 352 | { |
353 | - struct mmc *mmc; | |
354 | 353 | u32 sdi_u32; |
355 | 354 | |
356 | 355 | writel(host->pwr_init, &host->base->power); |
357 | 356 | |
... | ... | @@ -373,11 +372,12 @@ |
373 | 372 | else |
374 | 373 | host->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; |
375 | 374 | |
376 | - mmc = mmc_create(&host->cfg, host); | |
377 | - if (mmc == NULL) | |
375 | + *mmc = mmc_create(&host->cfg, host); | |
376 | + if (!*mmc) | |
378 | 377 | return -1; |
379 | 378 | |
380 | - debug("registered mmc interface number is:%d\n", mmc->block_dev.devnum); | |
379 | + debug("registered mmc interface number is:%d\n", | |
380 | + (*mmc)->block_dev.devnum); | |
381 | 381 | |
382 | 382 | return 0; |
383 | 383 | } |