Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i3c: Add stub functions when I3C support is disabled

When I3C is disabled, unused functions are removed by the linker because
the driver relies on regmap and no I3C devices are registered, so normal
I3C paths are never called.

However, some drivers may still call low-level I3C transfer helpers.
Provide stub implementations to avoid adding conditional ifdefs everywhere.

Add stubs for i3c_device_do_xfers() and
i3c_device_get_supported_xfer_mode() only. Other stubs will be introduced
when they are actually needed.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512230418.nu3V6Yua-lkp@intel.com/
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251230145718.4088694-1-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Frank Li and committed by
Alexandre Belloni
8564f88d ceff3bc1

+15 -1
+15 -1
include/linux/i3c/device.h
··· 305 305 i3c_i2c_driver_unregister, \ 306 306 __i2cdrv) 307 307 308 + #if IS_ENABLED(CONFIG_I3C) 308 309 int i3c_device_do_xfers(struct i3c_device *dev, struct i3c_xfer *xfers, 309 310 int nxfers, enum i3c_xfer_mode mode); 311 + u32 i3c_device_get_supported_xfer_mode(struct i3c_device *dev); 312 + #else 313 + static inline int 314 + i3c_device_do_xfers(struct i3c_device *dev, struct i3c_xfer *xfers, 315 + int nxfers, enum i3c_xfer_mode mode) 316 + { 317 + return -EOPNOTSUPP; 318 + } 319 + 320 + static inline u32 i3c_device_get_supported_xfer_mode(struct i3c_device *dev) 321 + { 322 + return 0; 323 + } 324 + #endif 310 325 311 326 int i3c_device_do_setdasa(struct i3c_device *dev); 312 327 ··· 363 348 void i3c_device_free_ibi(struct i3c_device *dev); 364 349 int i3c_device_enable_ibi(struct i3c_device *dev); 365 350 int i3c_device_disable_ibi(struct i3c_device *dev); 366 - u32 i3c_device_get_supported_xfer_mode(struct i3c_device *dev); 367 351 368 352 #endif /* I3C_DEV_H */