diff mbox series

[5/6] staging: vchiq_core: Pass vchiq_bulk pointer to make_service_callback()

Message ID 20241023110406.885199-6-umang.jain@ideasonboard.com (mailing list archive)
State New
Headers show
Series staging: vc04_services: Clarify bulk 'userdata' usage | expand

Commit Message

Umang Jain Oct. 23, 2024, 11:04 a.m. UTC
Pass struct vchiq_bulk pointer to make_service_callback() instead of
just passing the bulk->cb_data. This is a preparatory change when we
need to pass the callback data user pointer (__user) in a subsequent
commit.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../vc04_services/interface/vchiq_arm/vchiq_core.c  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 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 6095adaf0cf6..3c811b8f210c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -455,10 +455,18 @@  mark_service_closing(struct vchiq_service *service)
 
 static inline int
 make_service_callback(struct vchiq_service *service, enum vchiq_reason reason,
-		      struct vchiq_header *header, void *cb_data)
+		      struct vchiq_header *header, struct vchiq_bulk *bulk)
 {
+	void *cb_data = NULL;
 	int status;
 
+	/*
+	 * If a bulk transfer is in progress, pass bulk->cb_data to the
+	 * callback function.
+	 */
+	if (bulk)
+		cb_data = bulk->cb_data;
+
 	dev_dbg(service->state->dev, "core: %d: callback:%d (%s, %pK, %pK)\n",
 		service->state->id, service->localport, reason_names[reason],
 		header, cb_data);
@@ -1339,8 +1347,7 @@  static int service_notify_bulk(struct vchiq_service *service,
 	} else if (bulk->mode == VCHIQ_BULK_MODE_CALLBACK) {
 		enum vchiq_reason reason = get_bulk_reason(bulk);
 
-		return make_service_callback(service, reason, NULL,
-					     bulk->cb_data);
+		return make_service_callback(service, reason, NULL, bulk);
 	}
 
 	return 0;