drivers/acpi/fan_attr.c
Source file repositories/reference/linux-study-clean/drivers/acpi/fan_attr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/fan_attr.c- Extension
.c- Size
- 4101 bytes
- Lines
- 145
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/init.hlinux/acpi.hfan.h
Detected Declarations
function show_statefunction show_fan_speedfunction show_fine_grain_controlfunction acpi_fan_create_attributesfunction acpi_fan_delete_attributes
Annotated Snippet
if (status) {
int j;
for (j = 0; j < i; ++j)
sysfs_remove_file(&device->dev.kobj, &fan->fps[j].dev_attr.attr);
goto rem_fine_grain_attr;
}
}
return 0;
rem_fine_grain_attr:
sysfs_remove_file(&device->dev.kobj, &fan->fine_grain_control.attr);
rem_fst_attr:
sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
return status;
}
void acpi_fan_delete_attributes(struct acpi_device *device)
{
struct acpi_fan *fan = acpi_driver_data(device);
int i;
sysfs_remove_file(&device->dev.kobj, &fan->fst_speed.attr);
if (!fan->acpi4)
return;
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);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/acpi.h`, `fan.h`.
- Detected declarations: `function show_state`, `function show_fan_speed`, `function show_fine_grain_control`, `function acpi_fan_create_attributes`, `function acpi_fan_delete_attributes`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.