drivers/hwmon/drivetemp.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/drivetemp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/drivetemp.c- Extension
.c- Size
- 17139 bytes
- Lines
- 620
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ata.hlinux/bits.hlinux/device.hlinux/hwmon.hlinux/kernel.hlinux/list.hlinux/module.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_driver.hscsi/scsi_proto.h
Detected Declarations
struct drivetemp_datafunction ata_id_smart_supportedfunction ata_id_smart_enabledfunction drivetemp_scsi_commandfunction drivetemp_ata_commandfunction drivetemp_get_smarttempfunction drivetemp_get_scttempfunction drivetemp_sct_avoidfunction drivetemp_identify_satafunction drivetemp_identifyfunction drivetemp_readfunction drivetemp_is_visiblefunction drivetemp_addfunction drivetemp_removefunction list_for_each_entry_safefunction drivetemp_initfunction drivetemp_exitmodule init drivetemp_init
Annotated Snippet
module_init(drivetemp_init);
module_exit(drivetemp_exit);
MODULE_AUTHOR("Guenter Roeck <linus@roeck-us.net>");
MODULE_DESCRIPTION("Hard drive temperature monitor");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:drivetemp");
Annotation
- Immediate include surface: `linux/ata.h`, `linux/bits.h`, `linux/device.h`, `linux/hwmon.h`, `linux/kernel.h`, `linux/list.h`, `linux/module.h`, `scsi/scsi_cmnd.h`.
- Detected declarations: `struct drivetemp_data`, `function ata_id_smart_supported`, `function ata_id_smart_enabled`, `function drivetemp_scsi_command`, `function drivetemp_ata_command`, `function drivetemp_get_smarttemp`, `function drivetemp_get_scttemp`, `function drivetemp_sct_avoid`, `function drivetemp_identify_sata`, `function drivetemp_identify`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.