diff options
author | Sean Anderson <seanga2@gmail.com> | 2023-11-04 16:37:48 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-16 12:43:49 -0500 |
commit | b37a9208a2ed36b67303e8169539c1a0c42ea0e1 (patch) | |
tree | 5b958efb63b2394b3d959a84eba861cfb2c39e62 /include/linux | |
parent | b35df87ae5c812d09c82e3c329b01275ab5bd41b (diff) | |
download | u-boot-b37a9208a2ed36b67303e8169539c1a0c42ea0e1.tar.gz u-boot-b37a9208a2ed36b67303e8169539c1a0c42ea0e1.tar.bz2 u-boot-b37a9208a2ed36b67303e8169539c1a0c42ea0e1.zip |
mtd: Add some fallbacks for add/del_mtd_device
This allows using these functions without ifdefs. OneNAND depends on MTD,
so this ifdef was redundant in the first place.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mtd/mtd.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 09f5269887..7a66c7af74 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -552,8 +552,20 @@ unsigned mtd_mmap_capabilities(struct mtd_info *mtd); #ifdef __UBOOT__ /* drivers/mtd/mtdcore.h */ +#if CONFIG_IS_ENABLED(MTD) int add_mtd_device(struct mtd_info *mtd); int del_mtd_device(struct mtd_info *mtd); +#else +static inline int add_mtd_device(struct mtd_info *mtd) +{ + return -ENOSYS; +} + +static inline int del_mtd_device(struct mtd_info *mtd) +{ + return -ENOSYS; +} +#endif #ifdef CONFIG_MTD_PARTITIONS int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); |