[PATCH v6 1/6] cdx: add the cdx headers to include/linux

Shubhrajyoti Datta posted 6 patches 9 months, 3 weeks ago
There is a newer version of this series
[PATCH v6 1/6] cdx: add the cdx headers to include/linux
Posted by Shubhrajyoti Datta 9 months, 3 weeks ago
Move the header files from driver/cdx to the include/linux.
Adding the protocol, mcdi and bitfield header file to
include/linux. This is in preparation for VersalNET EDAC
driver that relies on it.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
---

Changes in v6:
 - Patch added
This patch is compile tested.

 drivers/cdx/controller/cdx_controller.c                       | 1 -
 drivers/cdx/controller/cdx_rpmsg.c                            | 1 -
 drivers/cdx/controller/mcdi.c                                 | 4 +---
 drivers/cdx/controller/mcdi_functions.c                       | 1 -
 drivers/cdx/controller/mcdi_functions.h                       | 2 +-
 .../cdx/controller/bitfield.h => include/linux/mc_bitfield.h  | 0
 {drivers/cdx/controller => include/linux}/mc_cdx_pcol.h       | 0
 {drivers/cdx/controller => include/linux}/mcdi.h              | 4 ++--
 8 files changed, 4 insertions(+), 9 deletions(-)
 rename drivers/cdx/controller/bitfield.h => include/linux/mc_bitfield.h (100%)
 rename {drivers/cdx/controller => include/linux}/mc_cdx_pcol.h (100%)
 rename {drivers/cdx/controller => include/linux}/mcdi.h (99%)

diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index d623f9c7517a..4676adcef010 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -14,7 +14,6 @@
 #include "cdx_controller.h"
 #include "../cdx.h"
 #include "mcdi_functions.h"
-#include "mcdi.h"
 
 static unsigned int cdx_mcdi_rpc_timeout(struct cdx_mcdi *cdx, unsigned int cmd)
 {
diff --git a/drivers/cdx/controller/cdx_rpmsg.c b/drivers/cdx/controller/cdx_rpmsg.c
index 04b578a0be17..ad4a4602b367 100644
--- a/drivers/cdx/controller/cdx_rpmsg.c
+++ b/drivers/cdx/controller/cdx_rpmsg.c
@@ -15,7 +15,6 @@
 #include "../cdx.h"
 #include "cdx_controller.h"
 #include "mcdi_functions.h"
-#include "mcdi.h"
 
 static struct rpmsg_device_id cdx_rpmsg_id_table[] = {
 	{ .name = "mcdi_ipc" },
diff --git a/drivers/cdx/controller/mcdi.c b/drivers/cdx/controller/mcdi.c
index e760f8d347cc..600084e81a86 100644
--- a/drivers/cdx/controller/mcdi.c
+++ b/drivers/cdx/controller/mcdi.c
@@ -23,9 +23,7 @@
 #include <linux/log2.h>
 #include <linux/net_tstamp.h>
 #include <linux/wait.h>
-
-#include "bitfield.h"
-#include "mcdi.h"
+#include "linux/mcdi.h"
 
 static void cdx_mcdi_cancel_cmd(struct cdx_mcdi *cdx, struct cdx_mcdi_cmd *cmd);
 static void cdx_mcdi_wait_for_cleanup(struct cdx_mcdi *cdx);
diff --git a/drivers/cdx/controller/mcdi_functions.c b/drivers/cdx/controller/mcdi_functions.c
index 885c69e6ebe5..8ae2d99be81e 100644
--- a/drivers/cdx/controller/mcdi_functions.c
+++ b/drivers/cdx/controller/mcdi_functions.c
@@ -5,7 +5,6 @@
 
 #include <linux/module.h>
 
-#include "mcdi.h"
 #include "mcdi_functions.h"
 
 int cdx_mcdi_get_num_buses(struct cdx_mcdi *cdx)
diff --git a/drivers/cdx/controller/mcdi_functions.h b/drivers/cdx/controller/mcdi_functions.h
index b9942affdc6b..1b503f42dc40 100644
--- a/drivers/cdx/controller/mcdi_functions.h
+++ b/drivers/cdx/controller/mcdi_functions.h
@@ -8,7 +8,7 @@
 #ifndef CDX_MCDI_FUNCTIONS_H
 #define CDX_MCDI_FUNCTIONS_H
 
-#include "mcdi.h"
+#include "linux/mcdi.h"
 #include "../cdx.h"
 
 /**
diff --git a/drivers/cdx/controller/bitfield.h b/include/linux/mc_bitfield.h
similarity index 100%
rename from drivers/cdx/controller/bitfield.h
rename to include/linux/mc_bitfield.h
diff --git a/drivers/cdx/controller/mc_cdx_pcol.h b/include/linux/mc_cdx_pcol.h
similarity index 100%
rename from drivers/cdx/controller/mc_cdx_pcol.h
rename to include/linux/mc_cdx_pcol.h
diff --git a/drivers/cdx/controller/mcdi.h b/include/linux/mcdi.h
similarity index 99%
rename from drivers/cdx/controller/mcdi.h
rename to include/linux/mcdi.h
index 54a65e9760ae..abe691a501dd 100644
--- a/drivers/cdx/controller/mcdi.h
+++ b/include/linux/mcdi.h
@@ -11,8 +11,8 @@
 #include <linux/kref.h>
 #include <linux/rpmsg.h>
 
-#include "bitfield.h"
-#include "mc_cdx_pcol.h"
+#include "linux/mc_bitfield.h"
+#include "linux/mc_cdx_pcol.h"
 
 #ifdef DEBUG
 #define CDX_WARN_ON_ONCE_PARANOID(x) WARN_ON_ONCE(x)
-- 
2.17.1
Re: [PATCH v6 1/6] cdx: add the cdx headers to include/linux
Posted by Krzysztof Kozlowski 9 months, 2 weeks ago
On Thu, Apr 24, 2025 at 06:51:13PM GMT, Shubhrajyoti Datta wrote:
> Move the header files from driver/cdx to the include/linux.
> Adding the protocol, mcdi and bitfield header file to
> include/linux. This is in preparation for VersalNET EDAC
> driver that relies on it.

You should move only publicly exported pieces, not entire headers.

Best regards,
Krzysztof