mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] driver: support Linux device/driver OF struct member names
@ 2022-12-09  7:10 Ahmad Fatoum
  2022-12-09  7:10 ` [PATCH 2/3] clk: add prepare/unprepare helpers Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2022-12-09  7:10 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

When porting drivers from Linux, one of the modifications that needs to
be done is to rename all .of_node to .device_node and of_match_table
to of_compatible. Just accept both names. It comes at no extra cost.

Once all barebox drivers use the Linux naming, we could drop the union
again.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/driver.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/driver.h b/include/driver.h
index 2386949c312a..1c50b79886c1 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -74,7 +74,10 @@ struct device_d {
 	struct list_head cdevs;
 
 	const struct platform_device_id *id_entry;
-	struct device_node *device_node;
+	union {
+		struct device_node *device_node;
+		struct device_node *of_node;
+	};
 
 	const struct of_device_id *of_id_entry;
 
@@ -113,7 +116,10 @@ struct driver_d {
 	struct bus_type *bus;
 
 	const struct platform_device_id *id_table;
-	const struct of_device_id *of_compatible;
+	union {
+		const struct of_device_id *of_compatible;
+		const struct of_device_id *of_match_table;
+	};
 };
 
 /*@}*/	/* do not delete, doxygen relevant */
-- 
2.30.2




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-16  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09  7:10 [PATCH 1/3] driver: support Linux device/driver OF struct member names Ahmad Fatoum
2022-12-09  7:10 ` [PATCH 2/3] clk: add prepare/unprepare helpers Ahmad Fatoum
2022-12-16  6:38   ` Sascha Hauer
2022-12-09  7:10 ` [PATCH 3/3] of: provide of_node_get and of_node_put stubs Ahmad Fatoum
2022-12-09  9:19 ` [PATCH 1/3] driver: support Linux device/driver OF struct member names Marco Felsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox