[PATCH 2/3] treewide: export symbols needed for i2c-mux-pca954x.ko
David Dgien
dgienda125 at gmail.com
Fri Mar 28 09:54:23 PDT 2025
On Fri, Mar 28, 2025 at 4:35 AM Ahmad Fatoum <a.fatoum at pengutronix.de> wrote:
>
> The module support in barebox is an experimental feature, but it can
> prove useful in some situations.
>
> Building most drivers as modules currently fails, because e.g. pr_print
> and dev_printf are not exported.
>
> Add EXPORT_SYMBOL annotations for all symbols currently used
> by i2c-mux-pca954x.
>
> Cc: David Dgien <dgienda125 at gmail.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
> David, are you still using the module support? We have added an
> allyesconfig build to CI and an allmodconfig build may be added as well
> if there are users.
No, the program that had been using module support stopped
development, so we have no active users of module support.
There is another program considering using module support, but that
would require fixing modules for aarch64,
and that hasn't been a priority yet, nor do I know if/when it might be.
Thanks,
David Dgien
> ---
> common/console_common.c | 2 ++
> drivers/base/driver.c | 1 +
> drivers/dma/map.c | 6 ++++++
> drivers/i2c/i2c.c | 1 +
> 4 files changed, 10 insertions(+)
>
> diff --git a/common/console_common.c b/common/console_common.c
> index a8527eee1e5a..5b7a64c99c29 100644
> --- a/common/console_common.c
> +++ b/common/console_common.c
> @@ -135,6 +135,7 @@ int pr_print(int level, const char *fmt, ...)
>
> return i;
> }
> +EXPORT_SYMBOL(pr_print);
>
> int dev_printf(int level, const struct device *dev, const char *format, ...)
> {
> @@ -161,6 +162,7 @@ int dev_printf(int level, const struct device *dev, const char *format, ...)
>
> return ret;
> }
> +EXPORT_SYMBOL(dev_printf);
>
> #ifdef CONFIG_CONSOLE_ALLOW_COLOR
> static unsigned int __console_allow_color = 1;
> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
> index 6363b3948f1d..edba037fa2dd 100644
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -725,6 +725,7 @@ const void *device_get_match_data(struct device *dev)
>
> return NULL;
> }
> +EXPORT_SYMBOL(device_get_match_data);
>
> static void device_set_deferred_probe_reason(struct device *dev,
> const struct va_format *vaf)
> diff --git a/drivers/dma/map.c b/drivers/dma/map.c
> index cd0f5c3d3497..2980d4c2e790 100644
> --- a/drivers/dma/map.c
> +++ b/drivers/dma/map.c
> @@ -7,6 +7,7 @@ void *dma_alloc(size_t size)
> {
> return xmemalign(DMA_ALIGNMENT, ALIGN(size, DMA_ALIGNMENT));
> }
> +EXPORT_SYMBOL(dma_alloc);
>
> void *dma_zalloc(size_t size)
> {
> @@ -18,6 +19,7 @@ void *dma_zalloc(size_t size)
>
> return buf;
> }
> +EXPORT_SYMBOL(dma_zalloc);
>
> void dma_sync_single_for_cpu(struct device *dev, dma_addr_t address,
> size_t size, enum dma_data_direction dir)
> @@ -29,6 +31,7 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t address,
> if (!dev_is_dma_coherent(dev))
> arch_sync_dma_for_cpu(ptr, size, dir);
> }
> +EXPORT_SYMBOL(dma_sync_single_for_cpu);
>
> void dma_sync_single_for_device(struct device *dev, dma_addr_t address,
> size_t size, enum dma_data_direction dir)
> @@ -40,6 +43,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t address,
> if (!dev_is_dma_coherent(dev))
> arch_sync_dma_for_device(ptr, size, dir);
> }
> +EXPORT_SYMBOL(dma_sync_single_for_device);
>
> dma_addr_t dma_map_single(struct device *dev, void *ptr,
> size_t size, enum dma_data_direction dir)
> @@ -53,6 +57,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr,
>
> return dma_addr;
> }
> +EXPORT_SYMBOL(dma_map_single);
>
> void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
> size_t size, enum dma_data_direction dir)
> @@ -62,3 +67,4 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
>
> debug_dma_unmap(dev, dma_addr, size, dir);
> }
> +EXPORT_SYMBOL(dma_unmap_single);
> diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> index 7df645ba1c3f..49b87bb47c00 100644
> --- a/drivers/i2c/i2c.c
> +++ b/drivers/i2c/i2c.c
> @@ -765,6 +765,7 @@ struct bus_type i2c_bus = {
> .name = "i2c",
> .match = device_match_of_modalias,
> };
> +EXPORT_SYMBOL(i2c_bus);
>
> static int i2c_bus_init(void)
> {
> --
> 2.39.5
>
More information about the barebox
mailing list