media: i2c: s5c73m3: 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>
This commit is contained in:
Mehdi Djait 2025-06-26 15:34:33 +02:00 committed by Hans Verkuil
parent 1808dd608f
commit 54ec6f9c6f

View File

@ -1556,9 +1556,11 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state)
if (!node)
return -EINVAL;
state->clock = devm_clk_get(dev, S5C73M3_CLK_NAME);
state->clock = devm_v4l2_sensor_clk_get(dev, S5C73M3_CLK_NAME);
if (IS_ERR(state->clock))
return PTR_ERR(state->clock);
return dev_err_probe(dev, PTR_ERR(state->clock),
"Failed to get the clock %s\n",
S5C73M3_CLK_NAME);
if (of_property_read_u32(node, "clock-frequency",
&state->mclk_frequency)) {