[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241023110406.885199-6-umang.jain@ideasonboard.com>
Date: Wed, 23 Oct 2024 16:34:05 +0530
From: Umang Jain <umang.jain@...asonboard.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>
Cc: linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...aro.org>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Stefan Wahren <wahrenst@....net>,
kernel-list@...pberrypi.com,
Umang Jain <umang.jain@...asonboard.com>
Subject: [PATCH 5/6] staging: vchiq_core: Pass vchiq_bulk pointer to make_service_callback()
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@...asonboard.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_core.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
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;
--
2.45.2
Powered by blists - more mailing lists