Commit a65f3159 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (12612): si4713: simplify the code to remove a compiler warning.

The compiler warned about an uninitialized stereo variable. By simplifying
the code it 1) improved readability and 2) fixed the compiler warning.
Acked-by: default avatarEduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a4c1cbc7
...@@ -1841,15 +1841,11 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm) ...@@ -1841,15 +1841,11 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm)
u16 stereo, rds; u16 stereo, rds;
u32 p; u32 p;
if (!sdev) { if (!sdev)
rval = -ENODEV; return -ENODEV;
goto exit;
}
if (vm->index > 0) { if (vm->index > 0)
rval = -EINVAL; return -EINVAL;
goto exit;
}
/* Set audio mode: mono or stereo */ /* Set audio mode: mono or stereo */
if (vm->txsubchans & V4L2_TUNER_SUB_STEREO) if (vm->txsubchans & V4L2_TUNER_SUB_STEREO)
...@@ -1857,9 +1853,7 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm) ...@@ -1857,9 +1853,7 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm)
else if (vm->txsubchans & V4L2_TUNER_SUB_MONO) else if (vm->txsubchans & V4L2_TUNER_SUB_MONO)
stereo = 0; stereo = 0;
else else
rval = -EINVAL; return -EINVAL;
if (rval < 0)
goto exit;
rds = !!(vm->txsubchans & V4L2_TUNER_SUB_RDS); rds = !!(vm->txsubchans & V4L2_TUNER_SUB_RDS);
...@@ -1885,7 +1879,6 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm) ...@@ -1885,7 +1879,6 @@ static int si4713_s_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm)
unlock: unlock:
mutex_unlock(&sdev->mutex); mutex_unlock(&sdev->mutex);
exit:
return rval; return rval;
} }
......
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