diff options
| author | Stefan Wahren <stefan.wahren@i2se.com> | 2021-04-25 12:51:01 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-10 11:19:28 +0200 |
| commit | a2161d1d5e10c879a192e01b16c85f1832b45c57 (patch) | |
| tree | 9770702c2607a1c7ae4f8f31a5d851c2f0e612e7 | |
| parent | a9fbd828be7fb7cf5c1af28d8f7fd34aee48c5ae (diff) | |
| download | linux-a2161d1d5e10c879a192e01b16c85f1832b45c57.tar.bz2 | |
staging: vchiq_core: drop vchiq_status from vchiq_set_service_option
Replace the custom set of return values with proper Linux error codes for
vchiq_set_service_option(). Now we can use the result directly as return
value for vchiq_ioctl().
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1619347863-16080-10-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index b1c58b54452b..8f67b15d81be 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1517,8 +1517,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } - status = vchiq_set_service_option( - args.handle, args.option, args.value); + ret = vchiq_set_service_option(args.handle, args.option, + args.value); } break; case VCHIQ_IOC_LIB_VERSION: { 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 9f9677a229e5..e150feb8ff86 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -3371,21 +3371,21 @@ void vchiq_get_config(struct vchiq_config *config) config->version_min = VCHIQ_VERSION_MIN; } -enum vchiq_status +int vchiq_set_service_option(unsigned int handle, enum vchiq_service_option option, int value) { struct vchiq_service *service = find_service_by_handle(handle); - enum vchiq_status status = VCHIQ_ERROR; struct vchiq_service_quota *quota; + int ret = -EINVAL; if (!service) - return VCHIQ_ERROR; + return -EINVAL; switch (option) { case VCHIQ_SERVICE_OPTION_AUTOCLOSE: service->auto_close = value; - status = VCHIQ_SUCCESS; + ret = 0; break; case VCHIQ_SERVICE_OPTION_SLOT_QUOTA: @@ -3402,7 +3402,7 @@ vchiq_set_service_option(unsigned int handle, * dropped below its quota */ complete("a->quota_event); - status = VCHIQ_SUCCESS; + ret = 0; } break; @@ -3420,7 +3420,7 @@ vchiq_set_service_option(unsigned int handle, * dropped below its quota */ complete("a->quota_event); - status = VCHIQ_SUCCESS; + ret = 0; } break; @@ -3428,13 +3428,13 @@ vchiq_set_service_option(unsigned int handle, if ((service->srvstate == VCHIQ_SRVSTATE_HIDDEN) || (service->srvstate == VCHIQ_SRVSTATE_LISTENING)) { service->sync = value; - status = VCHIQ_SUCCESS; + ret = 0; } break; case VCHIQ_SERVICE_OPTION_TRACE: service->trace = value; - status = VCHIQ_SUCCESS; + ret = 0; break; default: @@ -3442,7 +3442,7 @@ vchiq_set_service_option(unsigned int handle, } unlock_service(service); - return status; + return ret; } static int 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 aad1c5cb9683..bd1f5906846a 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -712,7 +712,7 @@ extern int vchiq_get_client_id(unsigned int service); extern void vchiq_get_config(struct vchiq_config *config); -extern enum vchiq_status +extern int vchiq_set_service_option(unsigned int service, enum vchiq_service_option option, int value); |