From: Ian Abbott <abbotti@mev.co.uk>
To: linux-fpga@vger.kernel.org
Cc: Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>,
linux-kernel@vger.kernel.org, Ian Abbott <abbotti@mev.co.uk>
Subject: [PATCH v2 4/4] fpga: region: Add dummy definitions of API functions
Date: Wed, 5 Nov 2025 12:31:08 +0000 [thread overview]
Message-ID: <20251105123752.93672-5-abbotti@mev.co.uk> (raw)
In-Reply-To: <20251105123752.93672-1-abbotti@mev.co.uk>
Add dummy definitions of the FPGA region API functions for build
testing.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
v2: Correct conditional compilation test for FPGA_REGION tristate
configuration.
---
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..11263b33f0dc 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)
+
+#if IS_ENABLED(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
prev parent reply other threads:[~2025-11-05 12:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 15:27 [PATCH 0/4] fpga: Add dummy definitions of API functions Ian Abbott
2025-11-04 15:27 ` [PATCH 1/4] fpga: altera-pr-ip: " Ian Abbott
2025-11-05 7:17 ` kernel test robot
2025-11-05 7:39 ` kernel test robot
2025-11-04 15:27 ` [PATCH 2/4] fpga: bridge: " Ian Abbott
2025-11-05 9:13 ` kernel test robot
2025-11-04 15:27 ` [PATCH 3/4] fpga: manager: " Ian Abbott
2025-11-04 15:27 ` [PATCH 4/4] fpga: region: " Ian Abbott
2025-11-05 1:47 ` [PATCH 0/4] fpga: " Xu Yilun
2025-11-05 10:37 ` Ian Abbott
2025-11-05 14:08 ` Xu Yilun
2025-11-05 12:31 ` [PATCH v2 " Ian Abbott
2025-11-05 12:31 ` [PATCH v2 1/4] fpga: altera-pr-ip: " Ian Abbott
2025-11-05 12:31 ` [PATCH v2 2/4] fpga: bridge: " Ian Abbott
2025-11-05 12:31 ` [PATCH v2 3/4] fpga: manager: " Ian Abbott
2025-11-05 12:31 ` Ian Abbott [this message]
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=20251105123752.93672-5-abbotti@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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;
as well as URLs for NNTP newsgroup(s).