Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>, Armin Wolf <w_armin@gmx.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 3/5] ACPI: fan: Adjust driver removal code ordering
Date: Wed, 25 Nov 2026 15:08:48 +0100	[thread overview]
Message-ID: <3445012.aeNJFYEL58@rafael.j.wysocki> (raw)
In-Reply-To: <2859850.mvXUDI8C0e@rafael.j.wysocki>

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

Change the ordering of acpi_fan_remove() code so that it reflects the
ordering of the rollback path in acpi_fan_probe() where the sysfs
attributes are removed when the thermal class cooling device is not
there.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
---

v1 -> v2:
   * Add R-by from Armin (thanks!)

---
 drivers/acpi/fan_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index d4f1d9a1d62d..d000bf0ef58c 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -560,10 +560,10 @@ static void acpi_fan_remove(struct platform_device *pdev)
 {
 	struct acpi_fan *fan = platform_get_drvdata(pdev);
 
+	thermal_cooling_device_unregister(fan->cdev);
+
 	if (fan->has_fst)
 		acpi_fan_delete_attributes(fan);
-
-	thermal_cooling_device_unregister(fan->cdev);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.51.0





  parent reply	other threads:[~2026-11-25 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 14:01 [PATCH v2 0/5] ACPI: fan: Assorted cleanups Rafael J. Wysocki
2026-11-25 14:07 ` [PATCH v2 1/5] ACPI: fan: Pass struct acpi_fan pointers to functions Rafael J. Wysocki
2026-11-25 14:07 ` [PATCH v2 2/5] ACPI: fan: Stop using driver_data pointer from struct acpi_device Rafael J. Wysocki
2026-11-25 14:08 ` Rafael J. Wysocki [this message]
2026-11-25 14:09 ` [PATCH v2 4/5] ACPI: fan: Add local variable dev to acpi_fan_probe() Rafael J. Wysocki
2026-11-25 14:10 ` [PATCH v2 5/5] ACPI: fan: Use acpi_handle_debug/err() for diagnostic messages Rafael J. Wysocki

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=3445012.aeNJFYEL58@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@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