From: Mehdi Djait Date: Thu, 26 Jun 2025 13:34:07 +0000 (+0200) Subject: media: i2c: imx412: Use the v4l2 helper for obtaining the clock X-Git-Tag: v6.18-rc1~133^2~345 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1d824320d82eb2d65eba9424fc0da067b65506e;p=thirdparty%2Flinux.git media: i2c: imx412: 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 Reviewed-by: Laurent Pinchart Signed-off-by: Mehdi Djait Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil --- diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c index c74097a59c428..7bbd639a9ddfa 100644 --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -933,11 +933,10 @@ static int imx412_parse_hw_config(struct imx412 *imx412) } /* Get sensor input clock */ - imx412->inclk = devm_clk_get(imx412->dev, NULL); - if (IS_ERR(imx412->inclk)) { - dev_err(imx412->dev, "could not get inclk\n"); - return PTR_ERR(imx412->inclk); - } + imx412->inclk = devm_v4l2_sensor_clk_get(imx412->dev, NULL); + if (IS_ERR(imx412->inclk)) + return dev_err_probe(imx412->dev, PTR_ERR(imx412->inclk), + "could not get inclk\n"); rate = clk_get_rate(imx412->inclk); if (rate != IMX412_INCLK_RATE) {