[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251104153013.154463-5-abbotti@mev.co.uk>
Date: Tue, 4 Nov 2025 15:27:05 +0000
From: Ian Abbott <abbotti@....co.uk>
To: linux-fpga@...r.kernel.org
Cc: Moritz Fischer <mdf@...nel.org>,
Xu Yilun <yilun.xu@...el.com>,
Tom Rix <trix@...hat.com>,
linux-kernel@...r.kernel.org,
Ian Abbott <abbotti@....co.uk>
Subject: [PATCH 4/4] fpga: region: Add dummy definitions of API functions
Add dummy definitions of the FPGA region API functions for build
testing.
Signed-off-by: Ian Abbott <abbotti@....co.uk>
---
include/linux/fpga/fpga-region.h | 44 +++++++++++++++++++++++++++++---
1 file changed, 40 insertions(+), 4 deletions(-)
diff --git a/include/linux/fpga/fpga-region.h b/include/linux/fpga/fpga-region.h
index 5fbc05fe70a6..db4c7c1b9151 100644
--- a/include/linux/fpga/fpga-region.h
+++ b/include/linux/fpga/fpga-region.h
@@ -6,6 +6,7 @@
#include <linux/device.h>
#include <linux/fpga/fpga-mgr.h>
#include <linux/fpga/fpga-bridge.h>
+#include <linux/err.h>
struct fpga_region;
@@ -54,23 +55,58 @@ struct fpga_region {
#define to_fpga_region(d) container_of(d, struct fpga_region, dev)
+#define fpga_region_register_full(parent, info) \
+ __fpga_region_register_full(parent, info, THIS_MODULE)
+
+#define fpga_region_register(parent, mgr, get_bridges) \
+ __fpga_region_register(parent, mgr, get_bridges, THIS_MODULE)
+
+#ifdef CONFIG_FPGA_REGION
struct fpga_region *
fpga_region_class_find(struct device *start, const void *data,
int (*match)(struct device *, const void *));
int fpga_region_program_fpga(struct fpga_region *region);
-#define fpga_region_register_full(parent, info) \
- __fpga_region_register_full(parent, info, THIS_MODULE)
struct fpga_region *
__fpga_region_register_full(struct device *parent, const struct fpga_region_info *info,
struct module *owner);
-#define fpga_region_register(parent, mgr, get_bridges) \
- __fpga_region_register(parent, mgr, get_bridges, THIS_MODULE)
struct fpga_region *
__fpga_region_register(struct device *parent, struct fpga_manager *mgr,
int (*get_bridges)(struct fpga_region *), struct module *owner);
void fpga_region_unregister(struct fpga_region *region);
+#else
+static inline struct fpga_region *
+fpga_region_class_find(struct device *start, const void *data,
+ int (*match)(struct device *, const void *))
+{
+ return NULL;
+}
+
+static inline int fpga_region_program_fpga(struct fpga_region *region)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline struct fpga_region *
+__fpga_region_register_full(struct device *parent, const struct fpga_region_info *info,
+ struct module *owner)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
+static inline struct fpga_region *
+__fpga_region_register(struct device *parent, struct fpga_manager *mgr,
+ int (*get_bridges)(struct fpga_region *), struct module *owner)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
+static inline void fpga_region_unregister(struct fpga_region *region)
+{
+}
+#endif
+
#endif /* _FPGA_REGION_H */
--
2.51.0
Powered by blists - more mailing lists