Skip to content

Commit 73b41dc

Browse files
Sakari Ailusmchehab
authored andcommitted
media: ov5670: Fix probe on ACPI
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: 8004c91 ("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>
1 parent 20af6be commit 73b41dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/media/i2c/ov5670.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ static int ov5670_probe(struct i2c_client *client)
26912691
if (!ov5670)
26922692
return -ENOMEM;
26932693

2694-
ov5670->xvclk = devm_clk_get(&client->dev, NULL);
2694+
ov5670->xvclk = devm_clk_get_optional(&client->dev, NULL);
26952695
if (!IS_ERR_OR_NULL(ov5670->xvclk))
26962696
input_clk = clk_get_rate(ov5670->xvclk);
26972697
else if (!ov5670->xvclk || PTR_ERR(ov5670->xvclk) == -ENOENT)

0 commit comments

Comments
 (0)