]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
_exports.h: drop creating dummy i2c entries and fixup config dependency
authorRasmus Villemoes <ravi@prevas.dk>
Fri, 19 Sep 2025 10:09:55 +0000 (12:09 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 26 Sep 2025 17:55:13 +0000 (11:55 -0600)
There's really no good reason to create stub entries that would call a
function that doesn't even return anything sensible.

The existence of these two i2c_* functions depends on
CONFIG_IS_ENABLED(SYS_I2C_LEGACY), which does depend on !DM_I2C, but
is not equivalent to it. They are probably rather hard to use unless
CMD_I2C and something in U-Boot has called "i2c dev foo" to set the
current i2c bus before calling the standalone app, so keep that
dependency.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
include/_exports.h

index 1af946fac327448cea6247838ce9c107f0a1d52a..39278a349424cee87fce72d2c821c4164d2d5c89 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * You need to use #ifdef around functions that may not exist
  * in the final configuration (such as i2c).
- * use a dummyfunction as first parameter to EXPORT_FUNC.
  * As an example see the CONFIG_CMD_I2C section below
  */
 #ifndef EXPORT_FUNC
        EXPORT_FUNC(simple_strtol, long, simple_strtol,
                    const char *, char **, unsigned int)
        EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct)
-#if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C)
+#if defined(CONFIG_CMD_I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
        EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int)
        EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int)
-#else
-       EXPORT_FUNC(dummy, void, i2c_write, void)
-       EXPORT_FUNC(dummy, void, i2c_read, void)
 #endif
 
 #if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI)