]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: mt9m114: Return -EPROBE_DEFER if no endpoint is found
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Tue, 30 Dec 2025 17:03:10 +0000 (18:03 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:04 +0000 (23:33 +0100)
With IPU# bridges, endpoints may only be created when the IPU bridge is
initialized. This may happen after the sensor driver's first probe().

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/mt9m114.c

index 4be81fe3c82799e407bedf918a0e5fe2c1086f5d..2c41169c0212c32963c4a0f8e5114d85b3d44aee 100644 (file)
@@ -2460,11 +2460,17 @@ static int mt9m114_parse_dt(struct mt9m114 *sensor)
        struct fwnode_handle *ep;
        int ret;
 
+       /*
+        * On ACPI systems the fwnode graph can be initialized by a bridge
+        * driver, which may not have probed yet. Wait for this.
+        *
+        * TODO: Return an error once bridge driver code will have moved
+        * to the ACPI core.
+        */
        ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
-       if (!ep) {
-               dev_err(&sensor->client->dev, "No endpoint found\n");
-               return -EINVAL;
-       }
+       if (!ep)
+               return dev_err_probe(&sensor->client->dev, -EPROBE_DEFER,
+                                    "waiting for fwnode graph endpoint\n");
 
        sensor->bus_cfg.bus_type = V4L2_MBUS_UNKNOWN;
        ret = v4l2_fwnode_endpoint_alloc_parse(ep, &sensor->bus_cfg);