astlpc: Consolidate direct vs indirect LPC access

Use helpers to wrap up LPC accessors so we're not littering the code
with conditional checks for direct or indirect access. As a result, drop
the priv_hdr pointer from struct mctp_binding_astlpc as we're utilising
the buffers provided by the caller, which in turn removes a heap
allocation.

Change-Id: Iab9ca4295879a3f3a0209fb23163c0383476c223
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/libmctp-astlpc.h b/libmctp-astlpc.h
index a3e7ffb..7bfa623 100644
--- a/libmctp-astlpc.h
+++ b/libmctp-astlpc.h
@@ -22,10 +22,10 @@
 struct mctp_binding_astlpc_ops {
 	int	(*kcs_read)(void *data, enum mctp_binding_astlpc_kcs_reg reg,
 			uint8_t *val);
-	int	(*kcs_write)(void *data, enum mctp_binding_astlpc_kcs_reg reg,
-			uint8_t val);
-	int	(*lpc_read)(void *data, void *buf, long offset, size_t len);
-	int	(*lpc_write)(void *data, void *buf, long offset, size_t len);
+	int (*kcs_write)(void *data, enum mctp_binding_astlpc_kcs_reg reg,
+			 uint8_t val);
+	int (*lpc_read)(void *data, void *buf, long offset, size_t len);
+	int (*lpc_write)(void *data, const void *buf, long offset, size_t len);
 };
 
 #define MCTP_BINDING_ASTLPC_MODE_BMC 0