Staging: vc04_services: Fix a couple error codes
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 13 May 2019 11:07:18 +0000 (14:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:15:15 +0000 (08:15 +0200)
[ Upstream commit ca4e4efbefbbdde0a7bb3023ea08d491f4daf9b9 ]

These are accidentally returning positive EINVAL instead of negative
-EINVAL.  Some of the callers treat positive values as success.

Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/vc04_services/bcm2835-camera/controls.c

index cff7b1e..b688ebc 100644 (file)
@@ -576,7 +576,7 @@ exit:
                                dev->colourfx.enable ? "true" : "false",
                                dev->colourfx.u, dev->colourfx.v,
                                ret, (ret == 0 ? 0 : -EINVAL));
-       return (ret == 0 ? 0 : EINVAL);
+       return (ret == 0 ? 0 : -EINVAL);
 }
 
 static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
@@ -600,7 +600,7 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
                 "%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n",
                        __func__, mmal_ctrl, ctrl->id, ctrl->val, ret,
                        (ret == 0 ? 0 : -EINVAL));
-       return (ret == 0 ? 0 : EINVAL);
+       return (ret == 0 ? 0 : -EINVAL);
 }
 
 static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev,