public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Borja <kuurtb@gmail.com>
To: kuurtb@gmail.com
Cc: Dell.Client.Kernel@dell.com, hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org,
	mario.limonciello@amd.com, platform-driver-x86@vger.kernel.org,
	w_armin@gmx.de
Subject: [PATCH v2 4/4] alienware-wmi: Remove unnecessary check at module exit
Date: Wed, 20 Nov 2024 13:44:11 -0300	[thread overview]
Message-ID: <20241120164411.7471-1-kuurtb@gmail.com> (raw)
In-Reply-To: <20241120163834.6446-3-kuurtb@gmail.com>

Module initialization fails if platform device fails to register so it's
always not NULL at exit.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
v2:
 - Unchanged
---
 drivers/platform/x86/dell/alienware-wmi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
index 512f6b22585c..5e0acaf35952 100644
--- a/drivers/platform/x86/dell/alienware-wmi.c
+++ b/drivers/platform/x86/dell/alienware-wmi.c
@@ -1197,11 +1197,9 @@ module_init(alienware_wmi_init);
 
 static void __exit alienware_wmi_exit(void)
 {
-	if (platform_device) {
-		remove_thermal_profile();
-		platform_device_unregister(platform_device);
-		platform_driver_unregister(&platform_driver);
-	}
+	remove_thermal_profile();
+	platform_device_unregister(platform_device);
+	platform_driver_unregister(&platform_driver);
 }
 
 module_exit(alienware_wmi_exit);
-- 
2.47.0


  parent reply	other threads:[~2024-11-20 16:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 16:38 [PATCH v2 0/4] alienware-wmi: Improvements Kurt Borja
2024-11-20 16:41 ` [PATCH v2 1/4] alienware-wmi: Migrate to device managed resources Kurt Borja
2024-11-20 16:43 ` [PATCH v2 2/4] alienware-wmi: Improves sysfs groups creation Kurt Borja
2024-11-21 15:37   ` Kurt Borja
2024-11-20 16:43 ` [PATCH v2 3/4] alienware-wmi: Simplify platform device creation Kurt Borja
2024-11-20 16:44 ` Kurt Borja [this message]
2024-11-20 18:08 ` [PATCH v2 0/4] alienware-wmi: Improvements Mario Limonciello

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=20241120164411.7471-1-kuurtb@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=w_armin@gmx.de \
    /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