From: Sakari Ailus <sakari.ailus@linux.intel.com>
Date: Wed, 29 Mar 2023 15:57:50 +0100
Subject: [PATCH] media: ov5670: Fix probe on ACPI
References: bsc#1012628
Patch-mainline: 6.3.2
Git-commit: 73b41dc51fbeffa4a216b20193274cfe92b5d95b
[ Upstream commit 73b41dc51fbeffa4a216b20193274cfe92b5d95b ]
devm_clk_get() will return either an error or NULL, which the driver
handles, continuing to use the clock of reading the value of the
clock-frequency property.
However, the value of ov5670->xvclk is left as-is and the other clock
framework functions aren't capable of handling error values.
Use devm_clk_get_optional() to obtain NULL instead of -ENOENT.
Fixes: 8004c91e2095 ("media: i2c: ov5670: Use common clock framework")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/i2c/ov5670.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c
index f79d908f..c5e783a0 100644
--- a/drivers/media/i2c/ov5670.c
+++ b/drivers/media/i2c/ov5670.c
@@ -2660,7 +2660,7 @@ static int ov5670_probe(struct i2c_client *client)
goto error_print;
}
- ov5670->xvclk = devm_clk_get(&client->dev, NULL);
+ ov5670->xvclk = devm_clk_get_optional(&client->dev, NULL);
if (!IS_ERR_OR_NULL(ov5670->xvclk))
input_clk = clk_get_rate(ov5670->xvclk);
else if (PTR_ERR(ov5670->xvclk) == -ENOENT)
--
2.35.3