Re: [PATCH v5 2/3] platform/x86: dell-uart-backlight: Bind through normal serdev matching
From: Markus Probst
Date: Sat Oct 24 2026 - 09:04:04 EST
On Sat, 2026-10-24 at 20:04 +0800, ChunAn Wu wrote:
> The driver creates a serdev client without firmware metadata and
> force-attaches its driver to it.
>
> Pass the modalias to serdev_device_add() 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>
> ---
> .../platform/x86/dell/dell-uart-backlight.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/dell-uart-backlight.c b/drivers/platform/x86/dell/dell-uart-backlight.c
> index f323a667dc2d..9b8ef91bb0a2 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[] = {
> + { 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,
> };
>
> static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
> @@ -354,7 +360,7 @@ static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
> if (!serdev)
> return -ENOMEM;
>
> - ret = serdev_device_add(serdev);
> + ret = serdev_device_add(serdev, KBUILD_MODNAME);
> if (ret) {
> dev_err(&pdev->dev, "error %d adding serdev\n", ret);
> serdev_device_put(serdev);
> @@ -365,20 +371,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;
Reviewed-by: Markus Probst <markus.probst@xxxxxxxxx>
Thanks
- Markus Probst
Attachment:
signature.asc
Description: This is a digitally signed message part