diff mbox series

[v2,1/8] staging: vc04_services: Pass struct device to vchiq_log_dump_mem()

Message ID 20231024114428.443528-2-umang.jain@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series staging: vc04: Drop custom logging based on printk | expand

Commit Message

Umang Jain Oct. 24, 2023, 11:44 a.m. UTC
Pass struct device pointer to vchiq_log_dump_mem(). In subsequent
commits, vchiq_log_* macros will be ported to use dynamic debug
(dev_dbg()), hence they need access to a struct device pointer.

No functional changes intended in this commit.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../vc04_services/interface/vchiq_arm/vchiq_core.c    | 11 ++++++-----
 .../vc04_services/interface/vchiq_arm/vchiq_core.h    |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 596894338cb4..a12afac95dcd 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1052,7 +1052,7 @@  queue_message(struct vchiq_state *state, struct vchiq_service *service,
 
 		if (SRVTRACE_ENABLED(service,
 				     VCHIQ_LOG_INFO))
-			vchiq_log_dump_mem("Sent", 0,
+			vchiq_log_dump_mem(state->dev, "Sent", 0,
 					   header->data,
 					   min_t(size_t, 16, callback_result));
 
@@ -1201,7 +1201,7 @@  queue_message_sync(struct vchiq_state *state, struct vchiq_service *service,
 	if (service) {
 		if (SRVTRACE_ENABLED(service,
 				     VCHIQ_LOG_INFO))
-			vchiq_log_dump_mem("Sent", 0,
+			vchiq_log_dump_mem(state->dev, "Sent", 0,
 					   header->data,
 					   min_t(size_t, 16, callback_result));
 
@@ -1653,7 +1653,7 @@  parse_message(struct vchiq_state *state, struct vchiq_header *header)
 			       msg_type_str(type), type, VCHIQ_FOURCC_AS_4CHARS(svc_fourcc),
 			       remoteport, localport, size);
 		if (size > 0)
-			vchiq_log_dump_mem("Rcvd", 0, header->data, min(16, size));
+			vchiq_log_dump_mem(state->dev, "Rcvd", 0, header->data, min(16, size));
 	}
 
 	if (((unsigned long)header & VCHIQ_SLOT_MASK) +
@@ -2065,7 +2065,7 @@  sync_func(void *v)
 					msg_type_str(type), VCHIQ_FOURCC_AS_4CHARS(svc_fourcc),
 					remoteport, localport, size);
 			if (size > 0)
-				vchiq_log_dump_mem("Rcvd", 0, header->data, min(16, size));
+				vchiq_log_dump_mem(state->dev, "Rcvd", 0, header->data, min(16, size));
 		}
 
 		switch (type) {
@@ -3665,7 +3665,8 @@  int vchiq_send_remote_use_active(struct vchiq_state *state)
 			     NULL, NULL, 0, 0);
 }
 
-void vchiq_log_dump_mem(const char *label, u32 addr, const void *void_mem, size_t num_bytes)
+void vchiq_log_dump_mem(struct device *dev, const char *label, u32 addr,
+			const void *void_mem, size_t num_bytes)
 {
 	const u8 *mem = void_mem;
 	size_t offset;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index ec1a3caefaea..8b234cad24ea 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -600,7 +600,8 @@  void vchiq_platform_conn_state_changed(struct vchiq_state *state,
 
 void vchiq_set_conn_state(struct vchiq_state *state, enum vchiq_connstate newstate);
 
-void vchiq_log_dump_mem(const char *label, u32 addr, const void *void_mem, size_t num_bytes);
+void vchiq_log_dump_mem(struct device *dev, const char *label, u32 addr,
+			const void *void_mem, size_t num_bytes);
 
 int vchiq_remove_service(struct vchiq_instance *instance, unsigned int service);