From: Hans Verkuil <hans.verkuil@xxxxxxxxx> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> --- drivers/media/i2c/Kconfig | 2 +- drivers/media/i2c/ov2640.c | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 159ef64..1859783 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -522,7 +522,7 @@ config VIDEO_SMIAPP_PLL config VIDEO_OV2640 tristate "OmniVision OV2640 sensor support" - depends on VIDEO_V4L2 && I2C + depends on GPIOLIB && VIDEO_V4L2 && I2C depends on MEDIA_CAMERA_SUPPORT help This is a Video4Linux2 sensor-level driver for the OmniVision diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 565742b..bd96889 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -1031,15 +1031,11 @@ static int ov2640_probe(struct i2c_client *client, return -ENOMEM; } - priv->clk = clk_get(&client->dev, "xvclk"); - if (IS_ERR(priv->clk)) - return -EPROBE_DEFER; - clk_prepare_enable(priv->clk); - - if (!client->dev.of_node) { - dev_err(&client->dev, "Missing platform_data for driver\n"); - ret = -EINVAL; - goto err_clk; + if (client->dev.of_node) { + priv->clk = clk_get(&client->dev, "xvclk"); + if (IS_ERR(priv->clk)) + return -EPROBE_DEFER; + clk_prepare_enable(priv->clk); } ret = ov2640_init_gpio(client, priv); -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html