aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-01-08 12:08:08 +0100
committerTakashi Iwai <tiwai@suse.de>2022-01-08 12:08:08 +0100
commitc8e3cf77dc1a05c2799d03847144c7e58fe7c1ce (patch)
tree23e8c25ffbc99e3629cde5f100014f41e364a7e4
parentdb2803ca9694d2a500e5ac56970b3530db7da826 (diff)
downloadhda-emu-c8e3cf77dc1a05c2799d03847144c7e58fe7c1ce.tar.gz
Add linux/component.h wrapper
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/linux/component.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/component.h b/include/linux/component.h
new file mode 100644
index 0000000..10a657e
--- /dev/null
+++ b/include/linux/component.h
@@ -0,0 +1,48 @@
+#ifndef _LINUX_COMPONENT_H
+#define _LINUX_COMPONENT_H
+
+struct device;
+
+struct component_ops {
+ int (*bind)(struct device *comp, struct device *master,
+ void *master_data);
+ void (*unbind)(struct device *comp, struct device *master,
+ void *master_data);
+};
+
+static inline int component_add(struct device *dev, const struct component_ops *ops) { return -ENODEV; }
+static inline void component_del(struct device *dev, const struct component_ops *ops) {}
+
+static inline int component_bind_all(struct device *master, void *master_data) { return -ENODEV; }
+static inline void component_unbind_all(struct device *master, void *master_data) {}
+
+struct master;
+
+struct component_master_ops {
+ int (*bind)(struct device *master);
+ void (*unbind)(struct device *master);
+};
+
+static inline void component_master_del(struct device *dev, const struct component_master_ops *ops) {}
+
+struct component_match;
+
+static inline int component_master_add_with_match(struct device *dev,
+ const struct component_master_ops *ops, struct component_match *match) { return -ENODEV; }
+static inline void component_match_add_release(struct device *master,
+ struct component_match **matchptr,
+ void (*release)(struct device *, void *),
+ int (*compare)(struct device *, void *), void *compare_data) {}
+static inline void component_match_add_typed(struct device *master,
+ struct component_match **matchptr,
+ int (*compare_typed)(struct device *, int, void *), void *compare_data) {}
+
+static inline void component_match_add(struct device *master,
+ struct component_match **matchptr,
+ int (*compare)(struct device *, void *), void *compare_data)
+{
+ component_match_add_release(master, matchptr, NULL, compare,
+ compare_data);
+}
+
+#endif