参照元

説明

引数

返り値

参考

実装

CONFIG_DEBUG_DEVRES 有効: include/linux/device.h

#define devres_alloc_node(release, size, gfp, nid) \
        __devres_alloc_node(release, size, gfp, nid, #release)

CONFIG_DEBUG_DEVRES 無効: drivers/base/devres.c

/**
 * devres_alloc - Allocate device resource data
 * @release: Release function devres will be associated with
 * @size: Allocation size
 * @gfp: Allocation flags
 * @nid: NUMA node
 *
 * Allocate devres of @size bytes.  The allocated area is zeroed, then
 * associated with @release.  The returned pointer can be passed to
 * other devres_*() functions.
 *
 * RETURNS:
 * Pointer to allocated devres on success, NULL on failure.
 */
void * devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid)
{
        struct devres *dr;
        dr = alloc_dr(release, size, gfp | __GFP_ZERO, nid);
        if (unlikely(!dr))
                return NULL;
        return dr->data;
}
EXPORT_SYMBOL_GPL(devres_alloc_node);

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS