Commit ae694028 authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman

staging: vchiq_2835_arm: drop enum vchiq_status

Replace the custom set of return values with proper Linux error codes.
As a result we need to initialize vchiq_status in vchiq_init_state.
Reviewed-by: default avatarNicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1619347863-16080-8-git-send-email-stefan.wahren@i2se.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c74541f7
......@@ -169,21 +169,21 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
return 0;
}
enum vchiq_status
int
vchiq_platform_init_state(struct vchiq_state *state)
{
struct vchiq_2835_state *platform_state;
state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL);
if (!state->platform_state)
return VCHIQ_ERROR;
return -ENOMEM;
platform_state = (struct vchiq_2835_state *)state->platform_state;
platform_state->inited = 1;
vchiq_arm_init_state(state, &platform_state->arm_state);
return VCHIQ_SUCCESS;
return 0;
}
struct vchiq_arm_state*
......@@ -211,7 +211,7 @@ remote_event_signal(struct remote_event *event)
writel(0, g_regs + BELL2); /* trigger vc interrupt */
}
enum vchiq_status
int
vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset,
void __user *uoffset, int size, int dir)
{
......@@ -223,7 +223,7 @@ vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset,
: PAGELIST_WRITE);
if (!pagelistinfo)
return VCHIQ_ERROR;
return -ENOMEM;
bulk->data = pagelistinfo->dma_addr;
......@@ -233,7 +233,7 @@ vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset,
*/
bulk->remote_data = pagelistinfo;
return VCHIQ_SUCCESS;
return 0;
}
void
......
......@@ -2162,9 +2162,9 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero)
{
struct vchiq_shared_state *local;
struct vchiq_shared_state *remote;
enum vchiq_status status;
enum vchiq_status status = VCHIQ_SUCCESS;
char threadname[16];
int i;
int i, ret;
if (vchiq_states[0]) {
pr_err("%s: VCHIQ state already initialized\n", __func__);
......@@ -2246,8 +2246,8 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero)
local->debug[DEBUG_ENTRIES] = DEBUG_MAX;
status = vchiq_platform_init_state(state);
if (status != VCHIQ_SUCCESS)
ret = vchiq_platform_init_state(state);
if (ret)
return VCHIQ_ERROR;
/*
......@@ -3141,8 +3141,7 @@ enum vchiq_status vchiq_bulk_transfer(unsigned int handle,
bulk->size = size;
bulk->actual = VCHIQ_BULK_ACTUAL_ABORTED;
if (vchiq_prepare_bulk_data(bulk, offset, uoffset, size, dir)
!= VCHIQ_SUCCESS)
if (vchiq_prepare_bulk_data(bulk, offset, uoffset, size, dir))
goto unlock_error_exit;
wmb();
......
......@@ -644,7 +644,7 @@ vchiq_queue_message(unsigned int handle,
* implementations must be provided.
*/
extern enum vchiq_status
extern int
vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset,
void __user *uoffset, int size, int dir);
......@@ -679,7 +679,7 @@ vchiq_on_remote_use(struct vchiq_state *state);
extern void
vchiq_on_remote_release(struct vchiq_state *state);
extern enum vchiq_status
extern int
vchiq_platform_init_state(struct vchiq_state *state);
extern enum vchiq_status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment