Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a94a2e3b authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Greg Kroah-Hartman
Browse files

media: ov7670: make "xclk" clock optional



commit 786fa584eda86d6598db3b87c61dc81f68808d11 upstream.

When the "xclk" clock was added, it was made mandatory. This broke the
driver on an OLPC plaform which doesn't know such clock. Make it
optional.

Tested on a OLPC XO-1 laptop.

Fixes: 0a024d63 ("[media] ov7670: get xclk")

Cc: stable@vger.kernel.org # 4.11+
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f882a6b
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -1808,9 +1808,15 @@ static int ov7670_probe(struct i2c_client *client,
			info->pclk_hb_disable = true;
	}

	info->clk = devm_clk_get(&client->dev, "xclk");
	if (IS_ERR(info->clk))
		return PTR_ERR(info->clk);
	info->clk = devm_clk_get(&client->dev, "xclk"); /* optional */
	if (IS_ERR(info->clk)) {
		ret = PTR_ERR(info->clk);
		if (ret == -ENOENT)
			info->clk = NULL;
		else
			return ret;
	}
	if (info->clk) {
		ret = clk_prepare_enable(info->clk);
		if (ret)
			return ret;
@@ -1820,6 +1826,7 @@ static int ov7670_probe(struct i2c_client *client,
			ret = -EINVAL;
			goto clk_disable;
		}
	}

	ret = ov7670_init_gpio(client, info);
	if (ret)