staging: bcm2835-v4l2: Update the driver to the current VCHI API.
authorEric Anholt <eric@anholt.net>
Fri, 27 Jan 2017 21:54:59 +0000 (13:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Jan 2017 09:44:27 +0000 (10:44 +0100)
49bec49fd7f2 ("staging: vc04_services: remove vchiq_copy_from_user")
removed the flags/msg_handle arguments, which were unused, and pushed
the implementation of copying using memcpy vs copy_from_user to the
caller.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/platform/bcm2835/mmal-vchiq.c

index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..24bd2948136c82ea3cfdc67f59cc134c98b0a07f 100644 (file)
@@ -378,6 +378,14 @@ static int inline_receive(struct vchiq_mmal_instance *instance,
        return 0;
 }
 
+static ssize_t mmal_memcpy_wrapper(void *src, void *dst,
+                                  size_t offset, size_t size)
+{
+       memcpy(dst + offset, src + offset, size);
+
+       return size;
+}
+
 /* queue the buffer availability with MMAL_MSG_TYPE_BUFFER_FROM_HOST */
 static int
 buffer_from_host(struct vchiq_mmal_instance *instance,
@@ -442,10 +450,9 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
 
        vchi_service_use(instance->handle);
 
-       ret = vchi_msg_queue(instance->handle, &m,
+       ret = vchi_msg_queue(instance->handle, mmal_memcpy_wrapper, &m,
                             sizeof(struct mmal_msg_header) +
-                            sizeof(m.u.buffer_from_host),
-                            VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
+                            sizeof(m.u.buffer_from_host));
 
        if (ret != 0) {
                release_msg_context(msg_context);
@@ -731,9 +738,9 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance,
        vchi_service_use(instance->handle);
 
        ret = vchi_msg_queue(instance->handle,
+                            mmal_memcpy_wrapper,
                             msg,
-                            sizeof(struct mmal_msg_header) + payload_len,
-                            VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
+                            sizeof(struct mmal_msg_header) + payload_len);
 
        vchi_service_release(instance->handle);