u-boot/disk
Simon Glass a51eb8de31 blk: Use a function for whether block devices are available
At present we use HAVE_BLOCK_DEVICE to indicate when block devices are
available.

This is a very strange option, since it partially duplicates the BLK
option used by driver model. It also covers both U-Boot proper and SPL,
even though one might have block devices and another not.

As a first step towards correcting this, create a new inline function
called blk_enabled() which indicates if block devices are available.
This cannot be used in Makefiles, or #if clauses, but can be used in C
code.

A function is useful because we cannot use CONFIG_IS_ENABLED(BLK) to
decide if block devices are needed, since we must consider the legacy
block interface, enabled by HAVE_BLOCK_DEVICE

Update a few places where it can be used and drop some unnecessary #if
checks around some functions in disk/part.c - rely on the compiler's
dead-code elimination instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-16 11:05:00 -04:00
..
disk-uclass.c disk: honor CONFIG_SYS_64BIT_LBA 2022-07-02 14:19:09 +02:00
Kconfig disk: Correct help for TPL_PARTITIONS 2022-09-16 11:05:00 -04:00
Makefile disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part.c blk: Use a function for whether block devices are available 2022-09-16 11:05:00 -04:00
part_amiga.c disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part_amiga.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
part_dos.c disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part_dos.h disk: dos: add code for creating MBR partition layout 2021-01-15 15:33:09 -05:00
part_efi.c disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part_iso.c disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part_iso.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
part_mac.c disk: Use Makefile to omit partition drivers 2022-09-16 11:05:00 -04:00
part_mac.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00