summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2016-12-19 15:19:59 +0100
committerMarco Felsch <m.felsch@pengutronix.de>2020-03-06 15:50:58 +0100
commitf01825ca08470dce27e82878e2278215beab8d84 (patch)
treef6fd33a76f5000b4d67ac85ed2dad44b658e28e2
parent90d81eb7405e6b6d74c297bb4da473634fbcf573 (diff)
downloadlinux-0-day-f01825ca08470dce27e82878e2278215beab8d84.tar.gz
linux-0-day-f01825ca08470dce27e82878e2278215beab8d84.tar.xz
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>
-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 42844839d3505..7fc2c0698f5e7 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1998,6 +1998,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);
@@ -2010,10 +2013,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;