media: mt9m114: Return -EPROBE_DEFER if no endpoint is found

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>
This commit is contained in:
Hans de Goede 2025-12-30 18:03:10 +01:00 committed by Hans Verkuil
parent 46c96eec9a
commit 437e1f6a96

View 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);