diff options
| author | Sean Anderson <[email protected]> | 2023-10-14 16:47:54 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-10-17 20:50:52 -0400 |
| commit | 93caa3efe25bb9d3e6265aa467dc5b6a2201819b (patch) | |
| tree | 02c637fb5f2b374d5f6d2092aff3ce9273446204 /common/spl/spl_mmc.c | |
| parent | acb96c170d7c9f9aed1755efe56387127a7dff0b (diff) | |
spl: Add callbacks to invalidate cached devices
Several SPL functions try to avoid performing initialization twice by
caching devices. This is fine for regular boot, but does not work with
UNIT_TEST, since all devices are torn down after each test. Add some
functions to invalidate the caches which can be called before testing these
load methods.
Signed-off-by: Sean Anderson <[email protected]>
Diffstat (limited to 'common/spl/spl_mmc.c')
| -rw-r--r-- | common/spl/spl_mmc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 67c7ae34a58..03a081fa47e 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -403,13 +403,19 @@ static int spl_mmc_get_mmc_devnum(struct mmc *mmc) return block_dev->devnum; } +static struct mmc *mmc; + +void spl_mmc_clear_cache(void) +{ + mmc = NULL; +} + int spl_mmc_load(struct spl_image_info *spl_image, struct spl_boot_device *bootdev, const char *filename, int raw_part, unsigned long raw_sect) { - static struct mmc *mmc; u32 boot_mode; int err = 0; __maybe_unused int part = 0; |
