mmc: fixes vendor_storage initialization failure

The key parameter (this_card) is invalid if the mmc_host drivers were
built as module.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I250ce59591da542d7fc1e4afcd6d8442a82b1d17
This commit is contained in:
Ziyuan Xu
2020-11-04 19:59:50 +08:00
committed by Tao Huang
parent d47ae5dcbe
commit 798f90523f
3 changed files with 8 additions and 3 deletions

View File

@@ -2876,7 +2876,8 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card,
#endif /* CONFIG_DEBUG_FS */
extern struct mmc_card *this_card;
struct mmc_card *this_card;
EXPORT_SYMBOL(this_card);
static int mmc_blk_probe(struct mmc_card *card)
{
struct mmc_blk_data *md, *part_md;
@@ -2912,7 +2913,7 @@ static int mmc_blk_probe(struct mmc_card *card)
dev_set_drvdata(&card->dev, md);
#if defined(CONFIG_MMC_DW_ROCKCHIP) || defined(CONFIG_MMC_SDHCI_OF_ARASAN)
#if IS_ENABLED(CONFIG_MMC_DW_ROCKCHIP) || IS_ENABLED(CONFIG_MMC_SDHCI_OF_ARASAN)
if (card->host->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
this_card = card;
#endif

View File

@@ -17,4 +17,8 @@ struct work_struct;
void mmc_blk_mq_complete_work(struct work_struct *work);
struct mmc_card;
extern struct mmc_card *this_card;
#endif

View File

@@ -23,13 +23,13 @@
#include <linux/mutex.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include "../core/block.h"
#include "../core/card.h"
#include "../core/core.h"
#include "../core/mmc_ops.h"
#define BLKSZ 512
struct mmc_card *this_card = NULL;
enum emmc_area_type {
MMC_DATA_AREA_MAIN,
MMC_DATA_AREA_BOOT1,