[PATCH v2 1/8] spi: stub device_spi_driver if SPI is disabled
Michael Tretter
m.tretter at pengutronix.de
Thu Dec 23 08:03:57 PST 2021
This allows drivers that support multiple buses to keep the code for
registering their SPI variant even if SPI is disabled.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
Changelog:
v2:
- new patch
---
include/spi/spi.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/spi/spi.h b/include/spi/spi.h
index c5efca1cc31c..bca996d8d8f9 100644
--- a/include/spi/spi.h
+++ b/include/spi/spi.h
@@ -515,9 +515,14 @@ static inline int spi_driver_register(struct driver_d *drv)
return register_driver(drv);
}
+#ifdef CONFIG_SPI
#define coredevice_spi_driver(drv) \
register_driver_macro(coredevice,spi,drv)
#define device_spi_driver(drv) \
register_driver_macro(device,spi,drv)
+#else
+#define coredevice_spi_driver(drv)
+#define device_spi_driver(drv)
+#endif
#endif /* __INCLUDE_SPI_H */
--
2.30.2
More information about the barebox
mailing list