diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/blk-uclass.c | 9 | ||||
-rw-r--r-- | drivers/block/blkcache.c | 15 |
2 files changed, 14 insertions, 10 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index b19375cbc8..b46a1ac8d2 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -644,11 +644,12 @@ int blk_unbind_all(int if_type) static int blk_post_probe(struct udevice *dev) { -#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE) - struct blk_desc *desc = dev_get_uclass_platdata(dev); + if (IS_ENABLED(CONFIG_PARTITIONS) && + IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE)) { + struct blk_desc *desc = dev_get_uclass_platdata(dev); - part_init(desc); -#endif + part_init(desc); + } return 0; } diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c index b6fc72fe98..eca66198ed 100644 --- a/drivers/block/blkcache.c +++ b/drivers/block/blkcache.c @@ -12,6 +12,10 @@ #include <linux/ctype.h> #include <linux/list.h> +#ifdef CONFIG_NEEDS_MANUAL_RELOC +DECLARE_GLOBAL_DATA_PTR; +#endif + struct block_cache_node { struct list_head lh; int iftype; @@ -22,21 +26,20 @@ struct block_cache_node { char *cache; }; -#ifndef CONFIG_M68K static LIST_HEAD(block_cache); -#else -static struct list_head block_cache; -#endif static struct block_cache_stats _stats = { .max_blocks_per_entry = 8, .max_entries = 32 }; -#ifdef CONFIG_M68K +#ifdef CONFIG_NEEDS_MANUAL_RELOC int blkcache_init(void) { - INIT_LIST_HEAD(&block_cache); + struct list_head *head = &block_cache; + + head->next = (uintptr_t)head->next + gd->reloc_off; + head->prev = (uintptr_t)head->prev + gd->reloc_off; return 0; } |