From 91ff6865629c81b8643b4ef6130e3e2130c60400 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 5 Dec 2018 08:23:38 -0500 Subject: blk: Rework guard around part_init call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function part_init() will only be built when we have both CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set. Protect the call to this function with both of these tests now. Cc: Simon Glass Cc: Philipp Tomsich Cc: Michal Simek Cc: York Sun Cc: Prabhakar Kushwaha Cc: Mingkai Hu Cc: Stefan Roese Cc: Marek BehĂșn Cc: Vanessa Maegima Cc: Eugen Hristev Cc: Adam Ford Cc: Jagan Teki Cc: Tom Warren Cc: Stephen Warren Cc: Vitaly Andrianov Signed-off-by: Tom Rini Reviewed-by: Simon Glass --- drivers/block/Makefile | 2 ++ drivers/block/blk-uclass.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/block') diff --git a/drivers/block/Makefile b/drivers/block/Makefile index 055d42f7d4..3feb0aa997 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -9,6 +9,8 @@ ifndef CONFIG_$(SPL_)BLK obj-y += blk_legacy.o endif +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_IDE) += ide.o +endif obj-$(CONFIG_SANDBOX) += sandbox.o obj-$(CONFIG_$(SPL_TPL_)BLOCK_CACHE) += blkcache.o diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 65a766e586..baaf431e5e 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -639,7 +639,7 @@ int blk_unbind_all(int if_type) static int blk_post_probe(struct udevice *dev) { -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT) +#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE) struct blk_desc *desc = dev_get_uclass_platdata(dev); part_init(desc); -- cgit