Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: ov2659: Use the v4l2 helper for obtaining the clock

devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.

Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.

Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Mehdi Djait and committed by
Hans Verkuil
33df67eb 52b0a078

+3 -2
+3 -2
drivers/media/i2c/ov2659.c
··· 1437 1437 ov2659->pdata = pdata; 1438 1438 ov2659->client = client; 1439 1439 1440 - ov2659->clk = devm_clk_get(&client->dev, "xvclk"); 1440 + ov2659->clk = devm_v4l2_sensor_clk_get(&client->dev, "xvclk"); 1441 1441 if (IS_ERR(ov2659->clk)) 1442 - return PTR_ERR(ov2659->clk); 1442 + return dev_err_probe(&client->dev, PTR_ERR(ov2659->clk), 1443 + "failed to get xvclk\n"); 1443 1444 1444 1445 ov2659->xvclk_frequency = clk_get_rate(ov2659->clk); 1445 1446 if (ov2659->xvclk_frequency < 6000000 ||