summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/tvp5150.c
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-03-12 11:31:49 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-12 16:38:51 +0100
commit96ca7c412a2cef7e6407836152f62a539a709470 (patch)
tree82ddf7955a8ac95a719cdca664bc966d012a485a /drivers/media/i2c/tvp5150.c
parent46fe6e7dcededcf4aba88163fee80f4f7df23deb (diff)
media: tvp5150: initialize subdev before parsing device tree
There are several debug prints in the tvp5150_parse_dt() function, which do not print the prefix, because the v4l2_subdev is not initialized, yet. Initialize the v4l2_subdev before parsing the device tree to fix the debug messages. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c/tvp5150.c')
-rw-r--r--drivers/media/i2c/tvp5150.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index bb3752078bc1..3a8998d4610d 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -2009,6 +2009,9 @@ static int tvp5150_probe(struct i2c_client *c)
core->regmap = map;
sd = &core->sd;
+ v4l2_i2c_subdev_init(sd, c, &tvp5150_ops);
+ sd->internal_ops = &tvp5150_internal_ops;
+ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
if (IS_ENABLED(CONFIG_OF) && np) {
res = tvp5150_parse_dt(core, np);
@@ -2021,10 +2024,6 @@ static int tvp5150_probe(struct i2c_client *c)
core->mbus_type = V4L2_MBUS_BT656;
}
- v4l2_i2c_subdev_init(sd, c, &tvp5150_ops);
- sd->internal_ops = &tvp5150_internal_ops;
- sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
-
res = tvp5150_mc_init(core);
if (res)
return res;