mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: David Dgien <dgienda125@gmail.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] treewide: export symbols needed for i2c-mux-pca954x.ko
Date: Fri, 28 Mar 2025 09:35:48 +0100	[thread overview]
Message-ID: <20250328083549.514506-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250328083549.514506-1-a.fatoum@pengutronix.de>

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@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@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.
---
 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




  reply	other threads:[~2025-03-28  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28  8:35 [PATCH 1/3] i2c: muxes: pca954x: switch to device_get_match_data Ahmad Fatoum
2025-03-28  8:35 ` Ahmad Fatoum [this message]
2025-03-28 16:54   ` [PATCH 2/3] treewide: export symbols needed for i2c-mux-pca954x.ko David Dgien
2025-03-28  8:35 ` [PATCH 3/3] kbuild: compile *.mod.c files with -fshort-wchar Ahmad Fatoum
2025-03-31  7:05 ` [PATCH 1/3] i2c: muxes: pca954x: switch to device_get_match_data Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250328083549.514506-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=dgienda125@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox