From: Manivannan Sadhasivam Date: Thu, 26 Mar 2026 08:06:31 +0000 (+0530) Subject: serdev: Do not return -ENODEV from of_serdev_register_devices() if external connector... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92fa16ecad07dddc5703f7e2ff342441b04c45af;p=thirdparty%2Flinux.git serdev: Do not return -ENODEV from of_serdev_register_devices() if external connector is used If an external connector like M.2 is connected to the serdev controller in DT, then the serdev devices may be created dynamically by the connector driver. So do not return -ENODEV from of_serdev_register_devices() if the static nodes are not found and the graph node is used. Tested-by: Hans de Goede # ThinkPad T14s gen6 (arm64) Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring (Arm) Link: https://patch.msgid.link/20260326-pci-m2-e-v7-3-43324a7866e6@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index bf88b95f7458d..e9d044a331b03 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -561,7 +562,13 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl) } else found = true; } - if (!found) + + /* + * When the serdev controller is connected to an external connector like + * M.2 in DT, then the serdev devices may be created dynamically by the + * connector driver. + */ + if (!found && !of_graph_is_present(dev_of_node(&ctrl->dev))) return -ENODEV; return 0;