]> www.infradead.org Git - linux.git/commitdiff
staging: vchiq_core: Drop vchiq_bulk_transfer()
authorUmang Jain <umang.jain@ideasonboard.com>
Tue, 10 Sep 2024 05:10:05 +0000 (10:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Sep 2024 13:54:04 +0000 (15:54 +0200)
Drop vchiq_bulk_transfer() as every VCHIQ_BULK_MODE_* mode
now have their own dedicated functions to execute bulk transfers.

Also, drop the temporary label we introduced earlier in vchiq-dev.c
to jump over the vchiq_bulk_transfer() call when each separate mode
helper was being developed.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Tested-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/20240910051007.297227-6-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

index 84e9059202ec1d33c26324c73ed848811b0661d9..29203c510952bed70a3316262e9d0e1d186fb6fb 100644 (file)
@@ -3169,66 +3169,6 @@ error_exit:
        return status;
 }
 
-/*
- * This function may be called by kernel threads or user threads.
- * User threads may receive -EAGAIN to indicate that a signal has been
- * received and the call should be retried after being returned to user
- * context.
- * When called in blocking mode, the userdata field points to a bulk_waiter
- * structure.
- */
-int vchiq_bulk_transfer(struct vchiq_instance *instance, unsigned int handle,
-                       void *offset, void __user *uoffset, int size, void *userdata,
-                       enum vchiq_bulk_mode mode, enum vchiq_bulk_dir dir)
-{
-       struct vchiq_service *service = find_service_by_handle(instance, handle);
-       struct bulk_waiter *bulk_waiter = NULL;
-       struct vchiq_bulk *bulk;
-       int status = -EINVAL;
-
-       if (!service)
-               goto error_exit;
-
-       if (service->srvstate != VCHIQ_SRVSTATE_OPEN)
-               goto error_exit;
-
-       if (!offset && !uoffset)
-               goto error_exit;
-
-       if (vchiq_check_service(service))
-               goto error_exit;
-
-       switch (mode) {
-       case VCHIQ_BULK_MODE_NOCALLBACK:
-       case VCHIQ_BULK_MODE_CALLBACK:
-               break;
-       default:
-               goto error_exit;
-       }
-
-       status = vchiq_bulk_xfer_queue_msg_interruptible(service, offset, uoffset,
-                                                        size, userdata, mode, dir);
-       if (status)
-               goto error_exit;
-
-       vchiq_service_put(service);
-
-       if (bulk_waiter) {
-               bulk_waiter->bulk = bulk;
-               if (wait_for_completion_interruptible(&bulk_waiter->event))
-                       status = -EAGAIN;
-               else if (bulk_waiter->actual == VCHIQ_BULK_ACTUAL_ABORTED)
-                       status = -EINVAL;
-       }
-
-       return 0;
-
-error_exit:
-       if (service)
-               vchiq_service_put(service);
-       return status;
-}
-
 /*
  * This function is called by VCHIQ ioctl interface and is interruptible.
  * It may receive -EAGAIN to indicate that a signal has been received
index 9c8c076eaaeb73b5993e5941bfbf670f2c669a1b..468463f318018ca4ecb6cf6121098ba67934c1aa 100644 (file)
@@ -485,11 +485,6 @@ vchiq_bulk_xfer_callback_interruptible(struct vchiq_instance *instance, unsigned
                                       enum vchiq_bulk_mode mode, void *userdata,
                                       enum vchiq_bulk_dir dir);
 
-extern int
-vchiq_bulk_transfer(struct vchiq_instance *instance, unsigned int handle, void *offset,
-                   void __user *uoffset, int size, void *userdata, enum vchiq_bulk_mode mode,
-                   enum vchiq_bulk_dir dir);
-
 extern void
 vchiq_dump_state(struct seq_file *f, struct vchiq_state *state);
 
index 169a2ffda9966e63508b452604a97eb1ebedc1c7..d41a4624cc92c39eafa1bfdb229b15c3c21ff6aa 100644 (file)
@@ -309,7 +309,6 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
                                                                NULL, args->data, args->size,
                                                                userdata, dir);
 
-               goto bulk_transfer_handled;
        } else if (args->mode == VCHIQ_BULK_MODE_WAITING) {
                mutex_lock(&instance->bulk_waiter_list_mutex);
                list_for_each_entry(iter, &instance->bulk_waiter_list,
@@ -332,8 +331,6 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
                userdata = &waiter->bulk_waiter;
 
                status = vchiq_bulk_xfer_waiting_interruptible(instance, args->handle, userdata);
-
-               goto bulk_transfer_handled;
        } else {
                userdata = args->userdata;
 
@@ -341,13 +338,8 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
                                                                args->data, args->size,
                                                                args->mode, userdata, dir);
 
-               goto bulk_transfer_handled;
        }
 
-       status = vchiq_bulk_transfer(instance, args->handle, NULL, args->data, args->size,
-                                    userdata, args->mode, dir);
-
-bulk_transfer_handled:
        if (!waiter) {
                ret = 0;
                goto out;