drivers/base/property.c
Source file repositories/reference/linux-study-clean/drivers/base/property.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/base/property.c- Extension
.c- Size
- 47989 bytes
- Lines
- 1494
- Domain
- Driver Families
- Bucket
- drivers/base
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/err.hlinux/export.hlinux/kconfig.hlinux/of.hlinux/property.hlinux/phy.hlinux/slab.hlinux/string.hlinux/types.h
Detected Declarations
function Copyrightfunction device_property_presentfunction fwnode_property_presentfunction device_property_presentfunction fwnode_property_presentfunction device_property_read_u8_arrayfunction device_property_read_u16_arrayfunction device_property_read_u32_arrayfunction device_property_read_u64_arrayfunction device_property_read_string_arrayfunction device_property_read_stringfunction device_property_match_stringfunction fwnode_property_read_int_arrayfunction fwnode_property_read_u8_arrayfunction fwnode_property_read_u16_arrayfunction fwnode_property_read_u32_arrayfunction fwnode_property_read_u64_arrayfunction fwnode_property_read_string_arrayfunction fwnode_property_read_stringfunction fwnode_property_match_stringfunction fwnode_property_match_property_stringfunction fwnode_property_get_reference_argsfunction fwnode_handle_putfunction fwnode_name_eqfunction fwnode_handle_putfunction fwnode_get_parentfunction fwnode_count_parentsfunction fwnode_handle_putfunction fwnode_for_each_parent_nodefunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_device_is_availablefunction fwnode_get_child_node_countfunction fwnode_get_named_child_node_countfunction device_dma_supportedfunction device_get_dma_attrfunction fwnode_get_phy_modefunction device_get_phy_modefunction fwnode_irq_getfunction fwnode_irq_get_bynamefunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_putfunction fwnode_handle_put
Annotated Snippet
if (fwnode_ep.id == endpoint) {
fwnode_handle_put(best_ep);
return ep;
}
if (!endpoint_next)
continue;
/*
* If the endpoint that has just been found is not the first
* matching one and the ID of the one found previously is closer
* to the requested endpoint ID, skip it.
*/
if (fwnode_ep.id < endpoint ||
(best_ep && best_ep_id < fwnode_ep.id))
continue;
fwnode_handle_put(best_ep);
best_ep = fwnode_handle_get(ep);
best_ep_id = fwnode_ep.id;
}
return best_ep;
}
EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
/**
* fwnode_graph_get_endpoint_count - Count endpoints on a device node
* @fwnode: The node related to a device
* @flags: fwnode lookup flags
* Count endpoints in a device node.
*
* If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
* and endpoints connected to disabled devices are counted.
*/
unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
unsigned long flags)
{
struct fwnode_handle *ep;
unsigned int count = 0;
fwnode_graph_for_each_endpoint(fwnode, ep) {
if (flags & FWNODE_GRAPH_DEVICE_DISABLED ||
fwnode_graph_remote_available(ep))
count++;
}
return count;
}
EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_count);
/**
* fwnode_graph_parse_endpoint - parse common endpoint node properties
* @fwnode: pointer to endpoint fwnode_handle
* @endpoint: pointer to the fwnode endpoint data structure
*
* Parse @fwnode representing a graph endpoint node and store the
* information in @endpoint. The caller must hold a reference to
* @fwnode.
*/
int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint)
{
memset(endpoint, 0, sizeof(*endpoint));
return fwnode_call_int_op(fwnode, graph_parse_endpoint, endpoint);
}
EXPORT_SYMBOL(fwnode_graph_parse_endpoint);
const void *device_get_match_data(const struct device *dev)
{
return fwnode_call_ptr_op(dev_fwnode(dev), device_get_match_data, dev);
}
EXPORT_SYMBOL_GPL(device_get_match_data);
static unsigned int fwnode_graph_devcon_matches(const struct fwnode_handle *fwnode,
const char *con_id, void *data,
devcon_match_fn_t match,
void **matches,
unsigned int matches_len)
{
struct fwnode_handle *node;
struct fwnode_handle *ep;
unsigned int count = 0;
void *ret;
fwnode_graph_for_each_endpoint(fwnode, ep) {
if (matches && count >= matches_len) {
fwnode_handle_put(ep);
break;
Annotation
- Immediate include surface: `linux/device.h`, `linux/err.h`, `linux/export.h`, `linux/kconfig.h`, `linux/of.h`, `linux/property.h`, `linux/phy.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function device_property_present`, `function fwnode_property_present`, `function device_property_present`, `function fwnode_property_present`, `function device_property_read_u8_array`, `function device_property_read_u16_array`, `function device_property_read_u32_array`, `function device_property_read_u64_array`, `function device_property_read_string_array`.
- Atlas domain: Driver Families / drivers/base.
- Implementation status: integration 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.