Skip to content

Commit 7dc7a8b

Browse files
groeckrafaeljw
authored andcommitted
ACPI: fan: Initialize performance state sysfs attribute
The following warning is reported if lock debugging is enabled. DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 1 PID: 1 at kernel/locking/lockdep.c:4617 lockdep_init_map_waits+0x141/0x222 ... Call Trace: __kernfs_create_file+0x7a/0xd8 sysfs_add_file_mode_ns+0x135/0x189 sysfs_create_file_ns+0x70/0xa0 acpi_fan_probe+0x547/0x621 platform_drv_probe+0x67/0x8b ... Dynamically allocated sysfs attributes need to be initialized to avoid the warning. Fixes: d19e470 ("ACPI: fan: Expose fan performance state information") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: 5.6+ <stable@vger.kernel.org> # 5.6+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 09162bc commit 7dc7a8b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/acpi/fan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ static int acpi_fan_get_fps(struct acpi_device *device)
352352
struct acpi_fan_fps *fps = &fan->fps[i];
353353

354354
snprintf(fps->name, ACPI_FPS_NAME_LEN, "state%d", i);
355+
sysfs_attr_init(&fps->dev_attr.attr);
355356
fps->dev_attr.show = show_state;
356357
fps->dev_attr.store = NULL;
357358
fps->dev_attr.attr.name = fps->name;

0 commit comments

Comments
 (0)