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 2/4] fpga: bridge: Add dummy definitions of API functions
Date: Wed, 5 Nov 2025 12:31:06 +0000 [thread overview]
Message-ID: <20251105123752.93672-3-abbotti@mev.co.uk> (raw)
In-Reply-To: <20251105123752.93672-1-abbotti@mev.co.uk>
Add dummy versions of the FPGA bridge API functions for build testing.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
v2: Correct conditional compilation test for FPGA_BRIDGE tristate
configuration.
---
include/linux/fpga/fpga-bridge.h | 75 +++++++++++++++++++++++++++++++-
1 file changed, 73 insertions(+), 2 deletions(-)
diff --git a/include/linux/fpga/fpga-bridge.h b/include/linux/fpga/fpga-bridge.h
index 94c4edd047e5..82494cc325f3 100644
--- a/include/linux/fpga/fpga-bridge.h
+++ b/include/linux/fpga/fpga-bridge.h
@@ -5,6 +5,7 @@
#include <linux/device.h>
#include <linux/fpga/fpga-mgr.h>
+#include <linux/err.h>
struct fpga_bridge;
@@ -63,6 +64,10 @@ struct fpga_bridge {
#define to_fpga_bridge(d) container_of(d, struct fpga_bridge, dev)
+#define fpga_bridge_register(parent, name, br_ops, priv) \
+ __fpga_bridge_register(parent, name, br_ops, priv, THIS_MODULE)
+
+#if IS_ENABLED(CONFIG_FPGA_BRIDGE)
struct fpga_bridge *of_fpga_bridge_get(struct device_node *node,
struct fpga_image_info *info);
struct fpga_bridge *fpga_bridge_get(struct device *dev,
@@ -81,12 +86,78 @@ int of_fpga_bridge_get_to_list(struct device_node *np,
struct fpga_image_info *info,
struct list_head *bridge_list);
-#define fpga_bridge_register(parent, name, br_ops, priv) \
- __fpga_bridge_register(parent, name, br_ops, priv, THIS_MODULE)
struct fpga_bridge *
__fpga_bridge_register(struct device *parent, const char *name,
const struct fpga_bridge_ops *br_ops, void *priv,
struct module *owner);
void fpga_bridge_unregister(struct fpga_bridge *br);
+#else
+static inline struct fpga_bridge *
+of_fpga_bridge_get(struct device_node *node, struct fpga_image_info *info)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
+static inline struct fpga_bridge *
+fpga_bridge_get(struct device *dev, struct fpga_image_info *info)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
+static inline void fpga_bridge_put(struct fpga_bridge *bridge)
+{
+}
+
+static inline int fpga_bridge_enable(struct fpga_bridge *bridge)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int fpga_bridge_disable(struct fpga_bridge *bridge)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int fpga_bridges_enable(struct list_head *bridge_list)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int fpga_bridges_disable(struct list_head *bridge_list)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline void fpga_bridges_put(struct list_head *bridge_list)
+{
+}
+
+static inline int fpga_bridge_get_to_list(struct device *dev,
+ struct fpga_image_info *info,
+ struct list_head *bridge_list)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int of_fpga_bridge_get_to_list(struct device_node *np,
+ struct fpga_image_info *info,
+ struct list_head *bridge_list)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline struct fpga_bridge *
+__fpga_bridge_register(struct device *parent, const char *name,
+ const struct fpga_bridge_ops *br_ops, void *priv,
+ struct module *owner)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
+static inline void fpga_bridge_unregister(struct fpga_bridge *br)
+{
+}
+#endif
+
#endif /* _LINUX_FPGA_BRIDGE_H */
--
2.51.0
next 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: " 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 ` Ian Abbott [this message]
2025-11-05 12:31 ` [PATCH v2 3/4] fpga: manager: " Ian Abbott
2025-11-05 12:31 ` [PATCH v2 4/4] fpga: region: " Ian Abbott
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-3-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
all inboxes | Powered by JetHome®