Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | devres_node |
struct | devres |
struct | devres_group |
Macros | |
#define | set_node_dbginfo(node, n, s) do {} while (0) |
#define | devres_log(dev, node, op) do {} while (0) |
devm_kfree - Resource-managed kfree : Device this memory belongs to : Memory to free
Free memory allocated with devm_kzalloc().
devm_kzalloc - Resource-managed kzalloc : Device to allocate memory for : Allocation size : Allocation gfp flags
Managed kzalloc. Memory allocated with this function is automatically freed on driver detach. Like all other devres resources, guaranteed alignment is unsigned long long.
RETURNS: Pointer to allocated memory on success, NULL on failure.
devres_add - Register device resource : Device to add resource to : Resource to register
Register devres to . should have been allocated using devres_alloc(). On driver detach, the associated release function will be invoked and devres will be freed automatically.
void* devres_alloc | ( | dr_release_t | release, |
size_t | size, | ||
gfp_t | gfp | ||
) |
devres_alloc - Allocate device resource data : Release function devres will be associated with : Allocation size : Allocation flags
Allocate devres of bytes. The allocated area is zeroed, then associated with . The returned pointer can be passed to other devres_*() functions.
RETURNS: Pointer to allocated devres on success, NULL on failure.
int devres_destroy | ( | struct device * | dev, |
dr_release_t | release, | ||
dr_match_t | match, | ||
void * | match_data | ||
) |
devres_destroy - Find a device resource and destroy it : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function
Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically and freed.
Note that the release function for the resource will not be called, only the devres-allocated data will be freed. The caller becomes responsible for freeing any other data.
RETURNS: 0 if devres is found and freed, -ENOENT if not found.
void* devres_find | ( | struct device * | dev, |
dr_release_t | release, | ||
dr_match_t | match, | ||
void * | match_data | ||
) |
devres_find - Find device resource : Device to lookup resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function
Find the latest devres of which is associated with and for which returns 1. If is NULL, it's considered to match all.
RETURNS: Pointer to found devres, NULL if not found.
devres_free - Free device resource data : Pointer to devres data to free
Free devres created with devres_alloc().
devres_get - Find devres, if non-existent, add one atomically : Device to lookup or add devres for : Pointer to new initialized devres to add if not found : Match function (optional) : Data for the match function
Find the latest devres of which has the same release function as and for which return 1. If found, is freed; otherwise, is added atomically.
RETURNS: Pointer to found or added devres.
devres_open_group - Open a new devres group : Device to open devres group for : Separator ID : Allocation flags
Open a new devres group for with . For , using a pointer to an object which won't be used for another group is recommended. If is NULL, address-wise unique ID is created.
RETURNS: ID of the new group, NULL on failure.
int devres_release | ( | struct device * | dev, |
dr_release_t | release, | ||
dr_match_t | match, | ||
void * | match_data | ||
) |
devres_release - Find a device resource and destroy it, calling release : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function
Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically, the release function called and the resource freed.
RETURNS: 0 if devres is found and freed, -ENOENT if not found.
devres_release_group - Release resources in a devres group : Device to release group for : ID of target group, can be NULL
Release all resources in the group identified by . If is NULL, the latest open group is selected. The selected group and groups properly nested inside the selected group are removed.
RETURNS: The number of released non-group resources.
void* devres_remove | ( | struct device * | dev, |
dr_release_t | release, | ||
dr_match_t | match, | ||
void * | match_data | ||
) |
devres_remove - Find a device resource and remove it : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function
Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically and returned.
RETURNS: Pointer to removed devres on success, NULL if not found.
EXPORT_SYMBOL_GPL | ( | devres_alloc | ) |
EXPORT_SYMBOL_GPL | ( | devres_for_each_res | ) |
EXPORT_SYMBOL_GPL | ( | devres_free | ) |
EXPORT_SYMBOL_GPL | ( | devres_add | ) |
EXPORT_SYMBOL_GPL | ( | devres_find | ) |
EXPORT_SYMBOL_GPL | ( | devres_get | ) |
EXPORT_SYMBOL_GPL | ( | devres_remove | ) |
EXPORT_SYMBOL_GPL | ( | devres_destroy | ) |
EXPORT_SYMBOL_GPL | ( | devres_release | ) |
EXPORT_SYMBOL_GPL | ( | devres_open_group | ) |
EXPORT_SYMBOL_GPL | ( | devres_close_group | ) |
EXPORT_SYMBOL_GPL | ( | devres_remove_group | ) |
EXPORT_SYMBOL_GPL | ( | devres_release_group | ) |
EXPORT_SYMBOL_GPL | ( | devm_kzalloc | ) |
EXPORT_SYMBOL_GPL | ( | devm_kfree | ) |