static __always_inline struct devres * alloc_dr(dr_release_t release, size_t size, gfp_t gfp, int nid) { size_t tot_size = sizeof(struct devres) + size; struct devres *dr;
dr = kmalloc_node_track_caller(tot_size, gfp, nid); if (unlikely(!dr)) return NULL;
memset(dr, 0, offsetof(struct devres, data)); INIT_LIST_HEAD(&dr->node.entry); dr->node.release = release;
return dr; }