mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
ACPI: fan: Store ACPI device pointer in struct acpi_fan
In preparation for subsequent changes, instead of storing a fan ACPI handle in struct acpi_fan, store a pointer to the corresponding struct acpi_device in it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/8772267.NyiUUSuA9g@rafael.j.wysocki
This commit is contained in:
parent
d1b25eb2d8
commit
520aac33ff
|
|
@ -52,7 +52,7 @@ struct acpi_fan_fst {
|
|||
};
|
||||
|
||||
struct acpi_fan {
|
||||
acpi_handle handle;
|
||||
struct acpi_device *adev;
|
||||
bool acpi4;
|
||||
bool has_fst;
|
||||
struct acpi_fan_fif fif;
|
||||
|
|
|
|||
|
|
@ -340,17 +340,18 @@ static int acpi_fan_dsm_init(struct device *dev)
|
|||
},
|
||||
};
|
||||
struct acpi_fan *fan = dev_get_drvdata(dev);
|
||||
acpi_handle fan_handle = fan->adev->handle;
|
||||
union acpi_object *obj;
|
||||
int ret = 0;
|
||||
|
||||
if (!acpi_check_dsm(fan->handle, &acpi_fan_microsoft_guid, 0,
|
||||
if (!acpi_check_dsm(fan_handle, &acpi_fan_microsoft_guid, 0,
|
||||
BIT(ACPI_FAN_DSM_GET_TRIP_POINT_GRANULARITY) |
|
||||
BIT(ACPI_FAN_DSM_SET_TRIP_POINTS)))
|
||||
return 0;
|
||||
|
||||
dev_info(dev, "Using Microsoft fan extensions\n");
|
||||
|
||||
obj = acpi_evaluate_dsm_typed(fan->handle, &acpi_fan_microsoft_guid, 0,
|
||||
obj = acpi_evaluate_dsm_typed(fan_handle, &acpi_fan_microsoft_guid, 0,
|
||||
ACPI_FAN_DSM_GET_TRIP_POINT_GRANULARITY, &dummy,
|
||||
ACPI_TYPE_INTEGER);
|
||||
if (!obj)
|
||||
|
|
@ -392,8 +393,8 @@ static int acpi_fan_dsm_set_trip_points(struct device *dev, u64 upper, u64 lower
|
|||
};
|
||||
union acpi_object *obj;
|
||||
|
||||
obj = acpi_evaluate_dsm(fan->handle, &acpi_fan_microsoft_guid, 0,
|
||||
ACPI_FAN_DSM_SET_TRIP_POINTS, &in);
|
||||
obj = acpi_evaluate_dsm(fan->adev->handle, &acpi_fan_microsoft_guid,
|
||||
0, ACPI_FAN_DSM_SET_TRIP_POINTS, &in);
|
||||
kfree(obj);
|
||||
|
||||
return 0;
|
||||
|
|
@ -503,7 +504,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
fan->handle = device->handle;
|
||||
fan->adev = device;
|
||||
device->driver_data = fan;
|
||||
platform_set_drvdata(pdev, fan);
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ static int acpi_fan_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
|||
struct acpi_fan_fst fst;
|
||||
int ret;
|
||||
|
||||
ret = acpi_fan_get_fst(fan->handle, &fst);
|
||||
ret = acpi_fan_get_fst(fan->adev->handle, &fst);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user