From: chitranshmandhaniya@gmail.com
To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Chitransh_Mandhaniya@dell.com,
W_Armin@gmx.de
Subject: [PATCH] platform/x86: dell-wmi-ddv: switch sensor mutex to devm_mutex_init()
Date: Tue, 27 Oct 2026 10:18:19 +0530 [thread overview]
Message-ID: <20261027044819.75761-1-chitranshmandhaniya@gmail.com> (raw)
From: Chitransh Mandhaniya <Chitransh_Mandhaniya@dell.com>
Replace mutex_init() with devm_mutex_init() for the sensor caching
mutex so the mutex lifecycle is managed by devres. This allows
removing the manual mutex_destroy() call from the
dell_wmi_ddv_hwmon_cache_destroy() cleanup callback.
The translation_cache_lock in the same driver already uses
devm_mutex_init(); this brings the sensor lock in line.
Signed-off-by: Chitransh Mandhaniya <Chitransh_Mandhaniya@dell.com>
---
drivers/platform/x86/dell/dell-wmi-ddv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
index f8903ced461b..c7f3d07abbc7 100644
--- a/drivers/platform/x86/dell/dell-wmi-ddv.c
+++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
@@ -548,7 +548,6 @@ static void dell_wmi_ddv_hwmon_cache_destroy(void *data)
struct dell_wmi_ddv_sensors *sensors = data;
sensors->active = false;
- mutex_destroy(&sensors->lock);
kfree(sensors->buffer);
}
@@ -566,7 +565,9 @@ static struct hwmon_channel_info *dell_wmi_ddv_channel_init(struct wmi_device *w
if (ret < 0)
return ERR_PTR(ret);
- mutex_init(&sensors->lock);
+ ret = devm_mutex_init(&wdev->dev, &sensors->lock);
+ if (ret < 0)
+ return ERR_PTR(ret);
sensors->active = true;
ret = devm_add_action_or_reset(&wdev->dev, dell_wmi_ddv_hwmon_cache_destroy, sensors);
--
2.43.0
reply other threads:[~2026-10-27 4:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027044819.75761-1-chitranshmandhaniya@gmail.com \
--to=chitranshmandhaniya@gmail.com \
--cc=Chitransh_Mandhaniya@dell.com \
--cc=W_Armin@gmx.de \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®