[PATCH v3 2/3] platform/x86: dell-uart-backlight: Bind through normal serdev matching

From: ChunAn Wu

Date: Fri Oct 23 2026 - 01:34:47 EST


The driver creates a serdev client without firmware metadata and
force-attaches its driver to it.

Set the modalias of the client before adding it and give the serdev
driver a matching id_table, so that the serdev core binds the two
through normal matching, then drop the manual attachment.

The client now also reports a "serial:dell_uart_backlight" modalias to
userspace instead of failing with -ENODEV. A failing serdev probe no
longer propagates out of the platform probe; as for any other bus, the
client is simply left unbound.

Signed-off-by: ChunAn Wu <an.wu@xxxxxxxxxxxxx>
---
Changes in v3:
- Use serdev_device_set_modalias() instead of ::name; add an id_table
to the serdev driver

Changes in v2:
- New in v2

.../platform/x86/dell/dell-uart-backlight.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/platform/x86/dell/dell-uart-backlight.c b/drivers/platform/x86/dell/dell-uart-backlight.c
index f323a667dc2d..13515ebda3dc 100644
--- a/drivers/platform/x86/dell/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell/dell-uart-backlight.c
@@ -325,11 +325,17 @@ static int dell_uart_bl_serdev_probe(struct serdev_device *serdev)
return PTR_ERR_OR_ZERO(dell_bl->bl);
}

+static const struct serdev_device_id dell_uart_bl_serdev_id_table[] = {
+ { KBUILD_MODNAME },
+ { }
+};
+
static struct serdev_device_driver dell_uart_bl_serdev_driver = {
.probe = dell_uart_bl_serdev_probe,
.driver = {
.name = KBUILD_MODNAME,
},
+ .id_table = dell_uart_bl_serdev_id_table,
};

static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
@@ -354,6 +360,8 @@ static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
if (!serdev)
return -ENOMEM;

+ serdev_device_set_modalias(serdev, KBUILD_MODNAME);
+
ret = serdev_device_add(serdev);
if (ret) {
dev_err(&pdev->dev, "error %d adding serdev\n", ret);
@@ -365,20 +373,10 @@ static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
if (ret)
goto err_remove_serdev;

- /*
- * serdev device <-> driver matching relies on OF or ACPI matches and
- * neither is available here, manually bind the driver.
- */
- ret = device_driver_attach(&dell_uart_bl_serdev_driver.driver, &serdev->dev);
- if (ret)
- goto err_unregister_serdev_driver;
-
/* So that dell_uart_bl_pdev_remove() can remove the serdev */
platform_set_drvdata(pdev, serdev);
return 0;

-err_unregister_serdev_driver:
- serdev_device_driver_unregister(&dell_uart_bl_serdev_driver);
err_remove_serdev:
serdev_device_remove(serdev);
return ret;
--
2.34.1