Skip to content

Commit bbb16fe

Browse files
spandruvadarafaeljw
authored andcommitted
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>
1 parent b2776bf commit bbb16fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/acpi/fan.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
325325
struct thermal_cooling_device *cdev;
326326
struct acpi_fan *fan;
327327
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
328+
char *name;
328329

329330
fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
330331
if (!fan) {
@@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
346347
}
347348
}
348349

349-
cdev = thermal_cooling_device_register("Fan", device,
350+
if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
351+
name = "Fan";
352+
else
353+
name = acpi_device_bid(device);
354+
355+
cdev = thermal_cooling_device_register(name, device,
350356
&fan_cooling_ops);
351357
if (IS_ERR(cdev)) {
352358
result = PTR_ERR(cdev);

0 commit comments

Comments
 (0)