From: Rasmus Villemoes Date: Fri, 19 Sep 2025 10:09:55 +0000 (+0200) Subject: _exports.h: drop creating dummy i2c entries and fixup config dependency X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0933358163a3c0ef13577853194769504cfb39ea;p=thirdparty%2Fu-boot.git _exports.h: drop creating dummy i2c entries and fixup config dependency 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 Reviewed-by: Tom Rini --- diff --git a/include/_exports.h b/include/_exports.h index 1af946fac32..39278a34942 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -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 @@ -43,12 +42,9 @@ 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)