API: Add binding accessors to generic struct mctp_binding
Rather than have every binding include their own wrappers around
binding<->core functions, introduce an accessor to retrieve the struct
mctp_binding from each.
This means we no longer need the binding-specific registration
callbacks. However, we do now need a ->start callback, to allow bindings
to perform post-registration init.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: I6cee9e93f37520f85c155a0ca34017cc0675552c
diff --git a/astlpc.c b/astlpc.c
index 4e6485c..cf75534 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -298,12 +298,6 @@
return 0;
}
-void mctp_astlpc_register_bus(struct mctp_binding_astlpc *astlpc,
- struct mctp *mctp, mctp_eid_t eid)
-{
- mctp_register_bus(mctp, &astlpc->binding, eid);
-}
-
static int mctp_astlpc_init_bmc(struct mctp_binding_astlpc *astlpc)
{
struct mctp_lpcmap_hdr *hdr;
@@ -355,6 +349,11 @@
return astlpc;
}
+struct mctp_binding *mctp_binding_astlpc_core(struct mctp_binding_astlpc *b)
+{
+ return &b->binding;
+}
+
struct mctp_binding_astlpc *mctp_astlpc_init_ops(
struct mctp_binding_astlpc_ops *ops,
void *ops_data, void *lpc_map)