* [PATCH] platform/x86: dell-uart-backlight: switch to devm_mutex_init()
@ 2026-10-26 4:23 chitranshmandhaniya
0 siblings, 0 replies; only message in thread
From: chitranshmandhaniya @ 2026-10-26 4:23 UTC (permalink / raw)
To: hansg, ilpo.jarvinen
Cc: platform-driver-x86, linux-kernel, Chitransh_Mandhaniya
From: Chitransh Mandhaniya <Chitransh_Mandhaniya@dell.com>
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.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Chitransh Mandhaniya <Chitransh_Mandhaniya@dell.com>
---
drivers/platform/x86/dell/dell-uart-backlight.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/dell/dell-uart-backlight.c b/drivers/platform/x86/dell/dell-uart-backlight.c
index f323a667dc2d..2ed2f00d8c49 100644
--- a/drivers/platform/x86/dell/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell/dell-uart-backlight.c
@@ -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;
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-26 4:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 4:23 [PATCH] platform/x86: dell-uart-backlight: switch to devm_mutex_init() chitranshmandhaniya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®