platform/x86: dell-uart-backlight: switch to devm_mutex_init()
PATCH 1/1 platform/x86: dell-uart-backlight: switch to devm_mutex_init()
From: Chitransh Mandhaniya <[email protected]>
Replace mutex_init() with devm_mutex_init() so that the mutex is automatically destroyed on driver removal via devres. The driver was missing a mutex_destroy() call on the teardown path.
--- drivers/platform/x86/dell/dell-uart-backlight.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/dell/dell-uart-backlight.c +3 -1
@@ -279,7 +279,9 @@ static int dell_uart_bl_serdev_probe(struct serdev_device *serdev)if (!dell_bl)return -ENOMEM ; -mutex_init (&dell_bl->mutex); + ret =devm_mutex_init (dev, &dell_bl->mutex); +if (ret) +return ret;init_waitqueue_head (&dell_bl->wait_queue); dell_bl->dev = dev;
Signature · 1 line
2.43.0
Hi,
Quoted 8 lines · On 26-Oct-26 5:23 AM, [email protected] wrote:
From: Chitransh Mandhaniya <[email protected]>
Replace
mutex_init()withdevm_mutex_init()so that the mutex is automatically destroyed on driver removal via devres. The driver was missing amutex_destroy()call on the teardown path.Suggested-by Ilpo Järvinen <[email protected]>Signed-off-by Chitransh Mandhaniya <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 19 lines
--- drivers/platform/x86/dell/dell-uart-backlight.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/platform/x86/dell/dell-uart-backlight.c +3
-1@@ -279,7 +279,9 @@ static int dell_uart_bl_serdev_probe(struct serdev_device *serdev)if (!dell_bl)return -ENOMEM ; -mutex_init (&dell_bl->mutex); + ret =devm_mutex_init (dev, &dell_bl->mutex); +if (ret) +return ret;init_waitqueue_head (&dell_bl->wait_queue); dell_bl->dev = dev;
Hi Ilpo,
Just a gentle reminder about this patch. Hans has reviewed it, and it still applies cleanly on top of for-next.
Please let me know if anything else is needed from my side.
Thanks,
Chitransh
Ilpo Järvinen
maintainerQuoted 3 lines · On Mon, 26 Oct 2026 09:53:10 +0530, [email protected] wrote:
Replace
mutex_init()withdevm_mutex_init()so that the mutex is automatically destroyed on driver removal via devres. The driver was missing amutex_destroy()call on the teardown path.
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.
The list of commits applied:
[1/1] platform/x86: dell-uart-backlight: switch to devm_mutex_init()
commit: b2ee01b0b19b3e7b3f1facfdad30c73bc69a3e51
--
i.