summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-12-05 08:23:38 -0500
committerTom Rini <trini@konsulko.com>2018-12-12 12:14:22 -0500
commit91ff6865629c81b8643b4ef6130e3e2130c60400 (patch)
tree000bb0133403698032c8316f4870e8dfc5017940 /drivers
parentb0b1768e1b138204ab07d46cbe7d24d3770f0a12 (diff)
blk: Rework guard around part_init call
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 <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: York Sun <york.sun@nxp.com> Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Cc: Mingkai Hu <mingkai.hu@nxp.com> Cc: Stefan Roese <sr@denx.de> Cc: Marek BehĂșn <marek.behun@nic.cz> Cc: Vanessa Maegima <vanessa.maegima@nxp.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Adam Ford <aford173@gmail.com> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/Makefile3
-rw-r--r--drivers/block/Makefile2
-rw-r--r--drivers/block/blk-uclass.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/Makefile b/drivers/Makefile
index c425831b58..0538b50d01 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -53,8 +53,7 @@ obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
-obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
-obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
+obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/
obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
obj-$(CONFIG_SPL_THERMAL) += thermal/
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);