* [PATCH v2 1/5] ACPI: fan: Pass struct acpi_fan pointers to functions
2026-11-25 14:01 [PATCH v2 0/5] ACPI: fan: Assorted cleanups Rafael J. Wysocki
@ 2026-11-25 14:07 ` 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
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-11-25 14:07 UTC (permalink / raw)
To: Linux ACPI; +Cc: Linux PM, Armin Wolf, Andy Shevchenko
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Pass a struct acpi_fan pointer as an argument to several functions in
the ACPI fan driver either instead of or in addition to a struct
acpi_device or a struct device pointer.
This allows acpi_driver_data() usage to be reduced and some other
simplifications to be made.
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:
* Pass acpi_fan as the first argument to functions (Andy)
* Add R-by from Armin (thanks!)
---
drivers/acpi/fan.h | 4 ++--
drivers/acpi/fan_attr.c | 8 ++++----
drivers/acpi/fan_core.c | 42 ++++++++++++++++++-----------------------
3 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/drivers/acpi/fan.h b/drivers/acpi/fan.h
index 3faa247af514..66dbcc138ddd 100644
--- a/drivers/acpi/fan.h
+++ b/drivers/acpi/fan.h
@@ -101,8 +101,8 @@ static inline bool acpi_fan_power_valid(u64 power)
}
int acpi_fan_get_fst(acpi_handle handle, struct acpi_fan_fst *fst);
-int acpi_fan_create_attributes(struct acpi_device *device);
-void acpi_fan_delete_attributes(struct acpi_device *device);
+int acpi_fan_create_attributes(struct acpi_fan *fan);
+void acpi_fan_delete_attributes(struct acpi_fan *fan);
#if IS_REACHABLE(CONFIG_HWMON)
int devm_acpi_fan_create_hwmon(struct device *dev);
diff --git a/drivers/acpi/fan_attr.c b/drivers/acpi/fan_attr.c
index 9b7fa52f3c2a..5b43b7bb0ab4 100644
--- a/drivers/acpi/fan_attr.c
+++ b/drivers/acpi/fan_attr.c
@@ -70,9 +70,9 @@ static ssize_t show_fine_grain_control(struct device *dev, struct device_attribu
return sysfs_emit(buf, "%d\n", fan->fif.fine_grain_ctrl);
}
-int acpi_fan_create_attributes(struct acpi_device *device)
+int acpi_fan_create_attributes(struct acpi_fan *fan)
{
- struct acpi_fan *fan = acpi_driver_data(device);
+ struct acpi_device *device = fan->adev;
int i, status;
/* _FST is present if we are here */
@@ -127,9 +127,9 @@ int acpi_fan_create_attributes(struct acpi_device *device)
return status;
}
-void acpi_fan_delete_attributes(struct acpi_device *device)
+void acpi_fan_delete_attributes(struct acpi_fan *fan)
{
- struct acpi_fan *fan = acpi_driver_data(device);
+ struct acpi_device *device = fan->adev;
int i;
sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 4324ff5d9c4c..9b4b57614d66 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -222,10 +222,9 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
* --------------------------------------------------------------------------
*/
-static int acpi_fan_get_fif(struct acpi_device *device)
+static int acpi_fan_get_fif(struct acpi_fan *fan, struct acpi_device *device)
{
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_buffer format = { sizeof("NNNN"), "NNNN" };
u64 fields[4];
struct acpi_buffer fif = { sizeof(fields), fields };
@@ -269,9 +268,9 @@ static int acpi_fan_speed_cmp(const void *a, const void *b)
return fps1->speed - fps2->speed;
}
-static int acpi_fan_get_fps(struct device *dev, struct acpi_device *device)
+static int acpi_fan_get_fps(struct acpi_fan *fan, struct device *dev,
+ struct acpi_device *device)
{
- struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_status status;
int i;
@@ -310,7 +309,7 @@ static int acpi_fan_get_fps(struct device *dev, struct acpi_device *device)
return 0;
}
-static int acpi_fan_dsm_init(struct device *dev)
+static int acpi_fan_dsm_init(struct acpi_fan *fan, struct device *dev)
{
union acpi_object dummy = {
.package = {
@@ -319,7 +318,6 @@ static int acpi_fan_dsm_init(struct device *dev)
.elements = NULL,
},
};
- struct acpi_fan *fan = dev_get_drvdata(dev);
acpi_handle fan_handle = fan->adev->handle;
if (!acpi_check_dsm(fan_handle, &acpi_fan_microsoft_guid, 0,
@@ -344,7 +342,7 @@ static int acpi_fan_dsm_init(struct device *dev)
return 0;
}
-static int acpi_fan_dsm_set_trip_points(struct device *dev, u64 upper, u64 lower)
+static int acpi_fan_dsm_set_trip_points(struct acpi_fan *fan, u64 upper, u64 lower)
{
union acpi_object args[2] = {
{
@@ -360,7 +358,6 @@ static int acpi_fan_dsm_set_trip_points(struct device *dev, u64 upper, u64 lower
},
},
};
- struct acpi_fan *fan = dev_get_drvdata(dev);
union acpi_object in = {
.package = {
.type = ACPI_TYPE_PACKAGE,
@@ -377,9 +374,8 @@ static int acpi_fan_dsm_set_trip_points(struct device *dev, u64 upper, u64 lower
return 0;
}
-static int acpi_fan_dsm_start(struct device *dev)
+static int acpi_fan_dsm_start(struct acpi_fan *fan)
{
- struct acpi_fan *fan = dev_get_drvdata(dev);
int ret;
if (!fan->fan_trip_granularity)
@@ -401,11 +397,11 @@ static int acpi_fan_dsm_start(struct device *dev)
* overlap, meaning that the current fan speed needs to be outside at
* least one range.
*/
- ret = acpi_fan_dsm_set_trip_points(dev, fan->fan_trip_granularity, 0);
+ ret = acpi_fan_dsm_set_trip_points(fan, fan->fan_trip_granularity, 0);
if (ret < 0)
return ret;
- return acpi_fan_dsm_set_trip_points(dev, fan->fan_trip_granularity * 3,
+ return acpi_fan_dsm_set_trip_points(fan, fan->fan_trip_granularity * 3,
fan->fan_trip_granularity * 2);
}
@@ -431,7 +427,7 @@ static int acpi_fan_dsm_update_trips_points(struct device *dev, struct acpi_fan_
lower = rounddown((u32)fst->speed - min_trip_distance, fan->fan_trip_granularity);
}
- return acpi_fan_dsm_set_trip_points(dev, upper, lower);
+ return acpi_fan_dsm_set_trip_points(fan, upper, lower);
}
static void acpi_fan_notify_handler(acpi_handle handle, u32 event, void *context)
@@ -493,17 +489,17 @@ static int acpi_fan_probe(struct platform_device *pdev)
}
if (fan->acpi4) {
- result = acpi_fan_get_fif(device);
+ result = acpi_fan_get_fif(fan, device);
if (result)
return result;
- result = acpi_fan_get_fps(&pdev->dev, device);
+ result = acpi_fan_get_fps(fan, &pdev->dev, device);
if (result)
return result;
}
if (fan->has_fst) {
- result = acpi_fan_dsm_init(&pdev->dev);
+ result = acpi_fan_dsm_init(fan, &pdev->dev);
if (result)
return result;
@@ -518,13 +514,13 @@ static int acpi_fan_probe(struct platform_device *pdev)
if (result)
return result;
- result = acpi_fan_dsm_start(&pdev->dev);
+ result = acpi_fan_dsm_start(fan);
if (result) {
dev_err(&pdev->dev, "Failed to start Microsoft fan extensions\n");
return result;
}
- result = acpi_fan_create_attributes(device);
+ result = acpi_fan_create_attributes(fan);
if (result)
return result;
}
@@ -556,7 +552,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
err_end:
if (fan->has_fst)
- acpi_fan_delete_attributes(device);
+ acpi_fan_delete_attributes(fan);
return result;
}
@@ -565,11 +561,9 @@ static void acpi_fan_remove(struct platform_device *pdev)
{
struct acpi_fan *fan = platform_get_drvdata(pdev);
- if (fan->has_fst) {
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+ if (fan->has_fst)
+ acpi_fan_delete_attributes(fan);
- acpi_fan_delete_attributes(device);
- }
thermal_cooling_device_unregister(fan->cdev);
}
@@ -591,7 +585,7 @@ static int acpi_fan_resume(struct device *dev)
int result;
if (fan->has_fst) {
- result = acpi_fan_dsm_start(dev);
+ result = acpi_fan_dsm_start(fan);
if (result)
dev_err(dev, "Failed to start Microsoft fan extensions: %d\n", result);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 2/5] ACPI: fan: Stop using driver_data pointer from struct acpi_device
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 ` Rafael J. Wysocki
2026-11-25 14:08 ` [PATCH v2 3/5] ACPI: fan: Adjust driver removal code ordering Rafael J. Wysocki
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-11-25 14:07 UTC (permalink / raw)
To: Linux ACPI; +Cc: Linux PM, Armin Wolf, Andy Shevchenko
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Instead of using the driver_data pointer under struct acpi_device,
make the ACPI fan driver use the driver data under the dev member of
struct acpi_device and clean it up properly on driver removal and on
probe failures.
While at it, unify the code ordering of acpi_fan_delete_attributes()
with the rollback path in acpi_fan_create_attributes().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
---
v1 -> v2:
* Use dev directly in show_fine_grain_control() (Andy)
* Use for (int i = 0; ...) in acpi_fan_delete_attributes() (Andy)
* Add R-by from Armin (thanks!)
---
drivers/acpi/fan_attr.c | 20 ++++++++++----------
drivers/acpi/fan_core.c | 1 -
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/fan_attr.c b/drivers/acpi/fan_attr.c
index 5b43b7bb0ab4..9af73f81ec5e 100644
--- a/drivers/acpi/fan_attr.c
+++ b/drivers/acpi/fan_attr.c
@@ -64,8 +64,7 @@ static ssize_t show_fan_speed(struct device *dev, struct device_attribute *attr,
static ssize_t show_fine_grain_control(struct device *dev, struct device_attribute *attr, char *buf)
{
- struct acpi_device *acpi_dev = container_of(dev, struct acpi_device, dev);
- struct acpi_fan *fan = acpi_driver_data(acpi_dev);
+ struct acpi_fan *fan = dev_get_drvdata(dev);
return sysfs_emit(buf, "%d\n", fan->fif.fine_grain_ctrl);
}
@@ -88,6 +87,7 @@ int acpi_fan_create_attributes(struct acpi_fan *fan)
if (!fan->acpi4)
return 0;
+ dev_set_drvdata(&device->dev, fan);
sysfs_attr_init(&fan->fine_grain_control.attr);
fan->fine_grain_control.show = show_fine_grain_control;
fan->fine_grain_control.store = NULL;
@@ -122,6 +122,7 @@ int acpi_fan_create_attributes(struct acpi_fan *fan)
sysfs_remove_file(&device->dev.kobj, &fan->fine_grain_control.attr);
rem_fst_attr:
+ dev_set_drvdata(&device->dev, NULL);
sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
return status;
@@ -130,15 +131,14 @@ int acpi_fan_create_attributes(struct acpi_fan *fan)
void acpi_fan_delete_attributes(struct acpi_fan *fan)
{
struct acpi_device *device = fan->adev;
- int i;
-
- sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
- if (!fan->acpi4)
- return;
+ if (fan->acpi4) {
+ for (int i = 0; i < fan->fps_count; ++i)
+ sysfs_remove_file(&device->dev.kobj, &fan->fps[i].dev_attr.attr);
- for (i = 0; i < fan->fps_count; ++i)
- sysfs_remove_file(&device->dev.kobj, &fan->fps[i].dev_attr.attr);
+ sysfs_remove_file(&device->dev.kobj, &fan->fine_grain_control.attr);
+ dev_set_drvdata(&device->dev, NULL);
+ }
- sysfs_remove_file(&device->dev.kobj, &fan->fine_grain_control.attr);
+ sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
}
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 9b4b57614d66..d4f1d9a1d62d 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -478,7 +478,6 @@ static int acpi_fan_probe(struct platform_device *pdev)
}
fan->adev = device;
- device->driver_data = fan;
platform_set_drvdata(pdev, fan);
if (acpi_has_method(device->handle, "_FST")) {
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 3/5] ACPI: fan: Adjust driver removal code ordering
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
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
4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-11-25 14:08 UTC (permalink / raw)
To: Linux ACPI; +Cc: Linux PM, Armin Wolf, Andy Shevchenko
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 4/5] ACPI: fan: Add local variable dev to acpi_fan_probe()
2026-11-25 14:01 [PATCH v2 0/5] ACPI: fan: Assorted cleanups Rafael J. Wysocki
` (2 preceding siblings ...)
2026-11-25 14:08 ` [PATCH v2 3/5] ACPI: fan: Adjust driver removal code ordering Rafael J. Wysocki
@ 2026-11-25 14:09 ` 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
4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-11-25 14:09 UTC (permalink / raw)
To: Linux ACPI; +Cc: Linux PM, Armin Wolf, Andy Shevchenko
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
In acpi_fan_probe(), use a new local variable called "dev" to store
a pointer to the dev field in the platform device object passed to it
and use that variable wherever the pointer held by it is needed.
While at it, adjust a leftover message printing statement that printed
a message relative to the fan device's ACPI companion by mistake and
remove a redundant error message after a memory allocation failure,
also printed relative to the fan device's ACPI companion.
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 | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index d000bf0ef58c..f1efa0db9958 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -462,20 +462,19 @@ static void acpi_fan_notify_handler(acpi_handle handle, u32 event, void *context
static int acpi_fan_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
+ struct acpi_device *device = ACPI_COMPANION(dev);
int result = 0;
struct thermal_cooling_device *cdev;
struct acpi_fan *fan;
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
char *name;
if (!device)
return -ENODEV;
- fan = devm_kzalloc_obj(&pdev->dev, *fan);
- if (!fan) {
- dev_err(&device->dev, "No memory for fan\n");
+ fan = devm_kzalloc_obj(dev, *fan);
+ if (!fan)
return -ENOMEM;
- }
fan->adev = device;
platform_set_drvdata(pdev, fan);
@@ -492,30 +491,29 @@ static int acpi_fan_probe(struct platform_device *pdev)
if (result)
return result;
- result = acpi_fan_get_fps(fan, &pdev->dev, device);
+ result = acpi_fan_get_fps(fan, dev, device);
if (result)
return result;
}
if (fan->has_fst) {
- result = acpi_fan_dsm_init(fan, &pdev->dev);
+ result = acpi_fan_dsm_init(fan, dev);
if (result)
return result;
- result = devm_acpi_fan_create_hwmon(&pdev->dev);
+ result = devm_acpi_fan_create_hwmon(dev);
if (result)
return result;
- result = devm_acpi_install_notify_handler(&pdev->dev,
- ACPI_DEVICE_NOTIFY,
+ result = devm_acpi_install_notify_handler(dev, ACPI_DEVICE_NOTIFY,
acpi_fan_notify_handler,
- &pdev->dev);
+ dev);
if (result)
return result;
result = acpi_fan_dsm_start(fan);
if (result) {
- dev_err(&pdev->dev, "Failed to start Microsoft fan extensions\n");
+ dev_err(dev, "Failed to start Microsoft fan extensions\n");
return result;
}
@@ -527,7 +525,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
if (!fan->acpi4) {
result = acpi_device_update_power(device, NULL);
if (result) {
- dev_err(&device->dev, "Failed to set initial power state\n");
+ dev_err(dev, "Failed to set initial power state\n");
goto err_end;
}
}
@@ -537,13 +535,13 @@ static int acpi_fan_probe(struct platform_device *pdev)
else
name = acpi_device_bid(device);
- cdev = thermal_cooling_device_create(&pdev->dev, name, fan, &fan_cooling_ops);
+ cdev = thermal_cooling_device_create(dev, name, fan, &fan_cooling_ops);
if (IS_ERR(cdev)) {
result = PTR_ERR(cdev);
goto err_end;
}
- dev_dbg(&pdev->dev, "registered as cooling_device%d\n", cdev->id);
+ dev_dbg(dev, "registered as cooling_device%d\n", cdev->id);
fan->cdev = cdev;
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 5/5] ACPI: fan: Use acpi_handle_debug/err() for diagnostic messages
2026-11-25 14:01 [PATCH v2 0/5] ACPI: fan: Assorted cleanups Rafael J. Wysocki
` (3 preceding siblings ...)
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 ` Rafael J. Wysocki
4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-11-25 14:10 UTC (permalink / raw)
To: Linux ACPI; +Cc: Linux PM, Armin Wolf, Andy Shevchenko
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Use acpi_handle_debug() or acpi_handle_err() for printing all of the
remaining diagnostic messages in the ACPI fan driver core code that
are still printed relative to the fan ACPI device object.
It is better to print them relative the device object's path in the
ACPI namespace because that's where the problems actually happen.
Also, add FW_BUG to error messages printed on errors that cause probe
to fail.
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 | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index f1efa0db9958..95ffacfa22c9 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -109,7 +109,8 @@ static int fan_get_state_acpi4(struct acpi_fan *fan, unsigned long *state)
if (fan->fif.fine_grain_ctrl) {
/* This control should be same what we set using _FSL by spec */
if (fst.control > 100) {
- dev_dbg(&device->dev, "Invalid control value returned\n");
+ acpi_handle_debug(device->handle,
+ "Invalid control value returned\n");
goto match_fps;
}
@@ -123,7 +124,7 @@ static int fan_get_state_acpi4(struct acpi_fan *fan, unsigned long *state)
break;
}
if (i == fan->fps_count) {
- dev_dbg(&device->dev, "No matching fps control value\n");
+ acpi_handle_debug(device->handle, "No matching fps control value\n");
return -EINVAL;
}
@@ -193,7 +194,7 @@ static int fan_set_state_acpi4(struct acpi_fan *fan, unsigned long state)
status = acpi_execute_simple_method(device->handle, "_FSL", value);
if (ACPI_FAILURE(status)) {
- dev_dbg(&device->dev, "Failed to set state by _FSL\n");
+ acpi_handle_debug(device->handle, "Failed to set state by _FSL\n");
return -ENODEV;
}
@@ -236,13 +237,13 @@ static int acpi_fan_get_fif(struct acpi_fan *fan, struct acpi_device *device)
union acpi_object *obj __free(acpi_object_free) = buffer.pointer;
if (!obj || obj->type != ACPI_TYPE_PACKAGE) {
- dev_err(&device->dev, "Invalid _FIF data\n");
+ acpi_handle_err(device->handle, FW_BUG "Invalid _FIF data\n");
return -ENODATA;
}
status = acpi_extract_package(obj, &format, &fif);
if (ACPI_FAILURE(status)) {
- dev_err(&device->dev, "Invalid _FIF element\n");
+ acpi_handle_err(device->handle, FW_BUG "Invalid _FIF element\n");
return -ENODATA;
}
@@ -281,7 +282,7 @@ static int acpi_fan_get_fps(struct acpi_fan *fan, struct device *dev,
union acpi_object *obj __free(acpi_object_free) = buffer.pointer;
if (!obj || obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
- dev_err(&device->dev, "Invalid _FPS data\n");
+ acpi_handle_err(device->handle, FW_BUG "Invalid _FPS data\n");
return -ENODATA;
}
@@ -297,7 +298,8 @@ static int acpi_fan_get_fps(struct acpi_fan *fan, struct device *dev,
status = acpi_extract_package(&obj->package.elements[i + 1],
&format, &fps);
if (ACPI_FAILURE(status)) {
- dev_err(&device->dev, "Invalid _FPS element\n");
+ acpi_handle_err(device->handle,
+ FW_BUG "Invalid _FPS element\n");
return -ENODATA;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread