From: Kurt Borja <kuurtb@gmail.com>
To: "Jorge Lopez" <jorge.lopez2@hp.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Mark Pearson" <mpearson-lenovo@squebb.ca>,
"Prasanth Ksr" <prasanth.ksr@dell.com>,
"Mario Limonciello" <mario.limonciello@amd.com>,
"Divya Bharathi" <divya.bharathi@dell.com>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Dell.Client.Kernel@dell.com,
Kurt Borja <kuurtb@gmail.com>
Subject: [PATCH 2/3] platform/x86: think-lmi: Fix class device unregistration
Date: Wed, 25 Jun 2025 22:17:36 -0300 [thread overview]
Message-ID: <20250625-dest-fix-v1-2-3a0f342312bb@gmail.com> (raw)
In-Reply-To: <20250625-dest-fix-v1-0-3a0f342312bb@gmail.com>
Devices under the firmware_attributes_class do not have unique a dev_t.
Therefore, device_unregister() should be used instead of
device_destroy(), since the latter may match any device with a given
dev_t.
Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
drivers/platform/x86/lenovo/think-lmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index 34a47269e3d34d2eda6b71af73892656cd2bf67d..085d6fb8ff6a61009217dc2a397f73116bceeb61 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1556,7 +1556,7 @@ static int tlmi_sysfs_init(void)
fail_create_attr:
tlmi_release_attr();
fail_device_created:
- device_destroy(&firmware_attributes_class, MKDEV(0, 0));
+ device_unregister(tlmi_priv.class_dev);
fail_class_created:
return ret;
}
@@ -1783,7 +1783,7 @@ static int tlmi_analyze(struct wmi_device *wdev)
static void tlmi_remove(struct wmi_device *wdev)
{
tlmi_release_attr();
- device_destroy(&firmware_attributes_class, MKDEV(0, 0));
+ device_unregister(tlmi_priv.class_dev);
}
static int tlmi_probe(struct wmi_device *wdev, const void *context)
--
2.50.0
next prev parent reply other threads:[~2025-06-26 1:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 1:17 [PATCH 0/3] platform/x86: Fix fiwmare_attributes_class device unregistration Kurt Borja
2025-06-26 1:17 ` [PATCH 1/3] platform/x86: hp-bioscfg: Fix class " Kurt Borja
2025-06-26 1:17 ` Kurt Borja [this message]
2025-06-26 1:17 ` [PATCH 3/3] platform/x86: dell-wmi-sysman: " Kurt Borja
2025-06-30 9:19 ` [PATCH 0/3] platform/x86: Fix fiwmare_attributes_class " Ilpo Järvinen
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=20250625-dest-fix-v1-2-3a0f342312bb@gmail.com \
--to=kuurtb@gmail.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=divya.bharathi@dell.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jorge.lopez2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=mario.limonciello@amd.com \
--cc=mpearson-lenovo@squebb.ca \
--cc=platform-driver-x86@vger.kernel.org \
--cc=prasanth.ksr@dell.com \
/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;
as well as URLs for NNTP newsgroup(s).