2d4134ea3e622ee767f2716d1097d9020dda2e62
[openwrt/staging/wigyori.git] /
1 From c6cf0e080fcd24679c1ca26eb26896893f7f306b Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 13 Feb 2019 12:51:03 +0000
4 Subject: [PATCH 355/773] staging: mmal-vchiq: If the VPU returns an error,
5 don't negate it
6
7 There is an enum for the errors that the VPU can return.
8 port_parameter_get was negating that value, but also using -EINVAL
9 from the Linux error codes.
10 Pass the VPU error code as positive values. Should the function
11 need to pass a Linux failure, then return that as negative.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 ---
15 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
19 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
20 @@ -1401,7 +1401,8 @@ static int port_parameter_get(struct vch
21 goto release_msg;
22 }
23
24 - ret = -rmsg->u.port_parameter_get_reply.status;
25 + ret = rmsg->u.port_parameter_get_reply.status;
26 +
27 /* port_parameter_get_reply.size includes the header,
28 * whilst *value_size doesn't.
29 */