From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marco Felsch Subject: [PATCH v7 08/13] media: tvp5150: initialize subdev before parsing device tree Date: Thu, 15 Aug 2019 13:57:42 +0200 Message-Id: <20190815115747.24018-9-m.felsch@pengutronix.de> In-Reply-To: <20190815115747.24018-1-m.felsch@pengutronix.de> References: <20190815115747.24018-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de, Michael Tretter List-ID: From: Michael Tretter 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 Signed-off-by: Marco Felsch --- drivers/media/i2c/tvp5150.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index ad59e65e6771..26a156da3ab4 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1959,6 +1959,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); @@ -1971,10 +1974,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; -- 2.20.1