aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-core.c
diff options
context:
space:
mode:
authorHans Verkuil <[email protected]>2019-03-08 13:02:26 +0000
committerMauro Carvalho Chehab <[email protected]>2019-03-19 17:30:32 +0000
commitf74267b51cb36321f777807b2e04ca02167ecc08 (patch)
treeece98a2aafca3a6cf39376beb2c2ab2e7f8ec00e /drivers/media/platform/vimc/vimc-core.c
parentmedia: v4l2-subdev: handle module refcounting here (diff)
downloadkernel-f74267b51cb36321f777807b2e04ca02167ecc08.tar.gz
kernel-f74267b51cb36321f777807b2e04ca02167ecc08.zip
media: vimc: zero the media_device on probe
The media_device is part of a static global vimc_device struct. The media framework expects this to be zeroed before it is used, however, since this is a global this is not the case if vimc is unbound and then bound again. So call memset to ensure any left-over values are cleared. Signed-off-by: Hans Verkuil <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-core.c')
-rw-r--r--drivers/media/platform/vimc/vimc-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index 0fbb7914098f..3aa62d7e3d0e 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -304,6 +304,8 @@ static int vimc_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "probe");
+ memset(&vimc->mdev, 0, sizeof(vimc->mdev));
+
/* Create platform_device for each entity in the topology*/
vimc->subdevs = devm_kcalloc(&vimc->pdev.dev, vimc->pipe_cfg->num_ents,
sizeof(*vimc->subdevs), GFP_KERNEL);