public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Michal Wilczynski <michal.wilczynski@intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 7/7] ACPI: thermal: Drop struct acpi_thermal_flags
Date: Sun, 04 Jun 2023 14:21:13 +0200	[thread overview]
Message-ID: <2581616.Lt9SDvczpP@kreacher> (raw)
In-Reply-To: <2703629.mvXUDI8C0e@kreacher>

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

Drop struct acpi_thermal_flags which is not really used (only one
flag in it is ever set, but it is never read) and call
acpi_execute_simple_method() directly to evaluate _SCP instead of
using acpi_thermal_set_cooling_mode(), which has no callers after
that change, so drop it.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v1 -> v2: New patch

---
 drivers/acpi/thermal.c |   24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

Index: linux-pm/drivers/acpi/thermal.c
===================================================================
--- linux-pm.orig/drivers/acpi/thermal.c
+++ linux-pm/drivers/acpi/thermal.c
@@ -129,12 +129,6 @@ struct acpi_thermal_trips {
 	struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE];
 };
 
-struct acpi_thermal_flags {
-	u8 cooling_mode:1;	/* _SCP */
-	u8 devices:1;		/* _TZD */
-	u8 reserved:6;
-};
-
 struct acpi_thermal {
 	struct acpi_device *device;
 	acpi_bus_id name;
@@ -142,7 +136,6 @@ struct acpi_thermal {
 	unsigned long last_temperature;
 	unsigned long polling_frequency;
 	volatile u8 zombie;
-	struct acpi_thermal_flags flags;
 	struct acpi_thermal_trips trips;
 	struct acpi_handle_list devices;
 	struct thermal_zone_device *thermal_zone;
@@ -197,18 +190,6 @@ static int acpi_thermal_get_polling_freq
 	return 0;
 }
 
-static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
-{
-	if (!tz)
-		return -EINVAL;
-
-	if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
-						    "_SCP", mode)))
-		return -ENODEV;
-
-	return 0;
-}
-
 static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
 {
 	acpi_status status;
@@ -926,9 +907,8 @@ static int acpi_thermal_get_info(struct
 		return result;
 
 	/* Set the cooling mode [_SCP] to active cooling (default) */
-	result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
-	if (!result)
-		tz->flags.cooling_mode = 1;
+	acpi_execute_simple_method(tz->device->handle, "_SCP",
+				   ACPI_THERMAL_MODE_ACTIVE);
 
 	/* Get default polling frequency [_TZP] (optional) */
 	if (tzp)




  parent reply	other threads:[~2023-06-04 12:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04 12:05 [PATCH v2 0/7] ACPI: thermal: Assorted cleanups Rafael J. Wysocki
2023-06-04 12:07 ` [PATCH v2 1/7] ACPI: thermal: Use BIT() macro for defining flags Rafael J. Wysocki
2023-06-06 15:45   ` Daniel Lezcano
2023-06-04 12:13 ` [PATCH v2 2/7] ACPI: thermal: Drop redundant ACPI_TRIPS_REFRESH_DEVICES symbol Rafael J. Wysocki
2023-06-06 15:45   ` Daniel Lezcano
2023-06-04 12:15 ` [PATCH v2 3/7] ACPI: thermal: Move symbol definitions to one place Rafael J. Wysocki
2023-06-06 16:41   ` Daniel Lezcano
2023-06-04 12:15 ` [PATCH v2 4/7] ACPI: thermal: Move acpi_thermal_driver definition Rafael J. Wysocki
2023-06-06 16:41   ` Daniel Lezcano
2023-06-04 12:18 ` [PATCH v2 5/7] ACPI: thermal: Eliminate struct acpi_thermal_state_flags Rafael J. Wysocki
2023-06-06 16:44   ` Daniel Lezcano
2023-06-04 12:19 ` [PATCH v2 6/7] ACPI: thermal: Drop struct acpi_thermal_state Rafael J. Wysocki
2023-06-06 16:44   ` Daniel Lezcano
2023-06-04 12:21 ` Rafael J. Wysocki [this message]
2023-06-06 16:46   ` [PATCH v2 7/7] ACPI: thermal: Drop struct acpi_thermal_flags Daniel Lezcano

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=2581616.Lt9SDvczpP@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.wilczynski@intel.com \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.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