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

From: ChunAn Wu

Date: Wed Oct 21 2026 - 05:22:12 EST


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

Set its name before adding it so the serdev core can match the driver
normally, then remove the manual attachment.

Signed-off-by: ChunAn Wu <an.wu@xxxxxxxxxxxxx>
---
drivers/platform/x86/dell/dell-uart-backlight.c | 12 ++----------
1 file changed, 2 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..19ed7f8b12bd 100644
--- a/drivers/platform/x86/dell/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell/dell-uart-backlight.c
@@ -354,6 +354,8 @@ static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
if (!serdev)
return -ENOMEM;

+ serdev_device_set_name(serdev, KBUILD_MODNAME);
+
ret = serdev_device_add(serdev);
if (ret) {
dev_err(&pdev->dev, "error %d adding serdev\n", ret);
@@ -365,20 +367,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