[PATCH v2 05/11] mtd: ubi: block: build only with CONFIG_CMD_UBI

Daniel Golle <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <72719d1e913f6863a1f06992c4ae8deb000df0dd.1787673209.git.daniel@makrotopia.org>
The UBI block driver calls ubi_volume_read() and ubi_volume_write(),
which are defined in cmd/ubi.c and thus only built with CONFIG_CMD_UBI.
Selecting UBI_BLOCK without CMD_UBI, for example in a CONFIG_CMDLINE=n
build, fails to link:

  drivers/mtd/ubi/block.c: undefined reference to `ubi_volume_read'
  drivers/mtd/ubi/block.c: undefined reference to `ubi_volume_write'

Make the dependency explicit so UBI_BLOCK is only offered when CMD_UBI is
enabled. The only in-tree user, topic_miami_defconfig, already enables
CMD_UBI, so no board is affected.

Fixes: 9daad11ad17 ("drivers: introduce UBI block abstraction")
Signed-off-by: Daniel Golle <[email protected]>
---
 drivers/mtd/ubi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
index e523a4c4707..bde8664fe80 100644
--- a/drivers/mtd/ubi/Kconfig
+++ b/drivers/mtd/ubi/Kconfig
@@ -116,6 +116,7 @@ config MTD_UBI_FM_DEBUG
 
 config UBI_BLOCK
 	bool "Enable UBI block device support"
+	depends on CMD_UBI
 	select BLK
 	help
 	  Enable UBI block device support using blk_ops abstraction.
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.