On Tue Mar 31 10:43:40 2026 +0200, Paul Cercueil wrote:
> If we need to register a dummy fixed-frequency clock, always register it
> using a device-specific name.
>
> This supports the use case where a system has two of the same sensor,
> meaning two instances of the same driver, which previously both tried
> (and failed) to create a clock with the same name.
>
> Signed-off-by: Paul Cercueil <[email protected]>
> Reviewed-by: Mehdi Djait <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/v4l2-core/v4l2-common.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/drivers/media/v4l2-core/v4l2-common.c
b/drivers/media/v4l2-core/v4l2-common.c
index 55bcd5975d9f..bceafc4e92c8 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -793,14 +793,15 @@ struct clk *__devm_v4l2_sensor_clk_get(struct device
*dev, const char *id,
if (ret)
return ERR_PTR(ret == -EINVAL ? -EPROBE_DEFER : ret);
- if (!id) {
+ if (id)
+ clk_id = kasprintf(GFP_KERNEL, "clk-%s-%s", dev_name(dev), id);
+ else
clk_id = kasprintf(GFP_KERNEL, "clk-%s", dev_name(dev));
- if (!clk_id)
- return ERR_PTR(-ENOMEM);
- id = clk_id;
- }
- clk_hw = devm_clk_hw_register_fixed_rate(dev, id, NULL, 0, rate);
+ if (!clk_id)
+ return ERR_PTR(-ENOMEM);
+
+ clk_hw = devm_clk_hw_register_fixed_rate(dev, clk_id, NULL, 0, rate);
if (IS_ERR(clk_hw))
return ERR_CAST(clk_hw);
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]