ACPI / Fan: Use bus id as the name for non PNP0C0B (Fan) devices
The _ART (Active Cooling Relationship Table), specifies relationship among heat generating sources to a target active cooling device like fan. The _ART table refers to actual bus id name for specifying relationship. Naming "Fan" is not enough as name in the _ART table can change on every platform, to establish relationship for user space thermal controllers. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
b2776bf714
commit
bbb16fef19
|
@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
|
||||||
struct thermal_cooling_device *cdev;
|
struct thermal_cooling_device *cdev;
|
||||||
struct acpi_fan *fan;
|
struct acpi_fan *fan;
|
||||||
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
|
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
|
||||||
|
char *name;
|
||||||
|
|
||||||
fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
|
fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
|
||||||
if (!fan) {
|
if (!fan) {
|
||||||
|
@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cdev = thermal_cooling_device_register("Fan", device,
|
if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
|
||||||
|
name = "Fan";
|
||||||
|
else
|
||||||
|
name = acpi_device_bid(device);
|
||||||
|
|
||||||
|
cdev = thermal_cooling_device_register(name, device,
|
||||||
&fan_cooling_ops);
|
&fan_cooling_ops);
|
||||||
if (IS_ERR(cdev)) {
|
if (IS_ERR(cdev)) {
|
||||||
result = PTR_ERR(cdev);
|
result = PTR_ERR(cdev);
|
||||||
|
|
Loading…
Reference in a new issue