diff options
author | 2022-11-28 14:03:33 +0000 | |
---|---|---|
committer | 2022-12-06 07:16:39 +0000 | |
commit | bc0cd1080a035ea64fd141f7f8138ca5373fb47b (patch) | |
tree | 44b90713eae3942791dfa4dc26fe63682d053923 /drivers/media/platform/sunxi | |
parent | media: i2c: tc358746: make DEFINE_RUNTIME_DEV_PM_OPS static (diff) | |
download | linux-bc0cd1080a035ea64fd141f7f8138ca5373fb47b.tar.gz linux-bc0cd1080a035ea64fd141f7f8138ca5373fb47b.tar.bz2 linux-bc0cd1080a035ea64fd141f7f8138ca5373fb47b.zip |
media: sun6i-csi: clarify return value, fix uninited variable and add missing static
This fixes three smatch warnings:
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c:629:15: warning: 'enabled' may be used uninitialized [-Wmaybe-uninitialized]
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c:439 sun6i_csi_bridge_s_stream() warn: missing error code 'ret'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c:682 sun6i_csi_bridge_notifier_bound() error: uninitialized symbol 'enabled'.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/sunxi')
-rw-r--r-- | drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c index 86d20c1c35ed..ebfc870d2af5 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -415,8 +415,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on) struct sun6i_csi_bridge_source *source; struct v4l2_subdev *source_subdev; struct media_pad *remote_pad; - /* Initialize to 0 to use both in disable label (ret != 0) and off. */ - int ret = 0; + int ret; /* Source */ @@ -436,6 +435,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on) if (!on) { v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; } @@ -587,7 +587,7 @@ static const struct v4l2_subdev_pad_ops sun6i_csi_bridge_pad_ops = { .set_fmt = sun6i_csi_bridge_set_fmt, }; -const struct v4l2_subdev_ops sun6i_csi_bridge_subdev_ops = { +static const struct v4l2_subdev_ops sun6i_csi_bridge_subdev_ops = { .video = &sun6i_csi_bridge_video_ops, .pad = &sun6i_csi_bridge_pad_ops, }; @@ -652,7 +652,7 @@ sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier, async_subdev); struct sun6i_csi_bridge *bridge = &csi_dev->bridge; struct sun6i_csi_bridge_source *source = bridge_async_subdev->source; - bool enabled; + bool enabled = false; int ret; switch (source->endpoint.base.port) { |