aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index bc41e87a969b..a00105cf795e 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -698,6 +698,25 @@ static inline int devm_add_action_or_reset(struct device *dev,
698 return ret; 698 return ret;
699} 699}
700 700
701/**
702 * devm_alloc_percpu - Resource-managed alloc_percpu
703 * @dev: Device to allocate per-cpu memory for
704 * @type: Type to allocate per-cpu memory for
705 *
706 * Managed alloc_percpu. Per-cpu memory allocated with this function is
707 * automatically freed on driver detach.
708 *
709 * RETURNS:
710 * Pointer to allocated memory on success, NULL on failure.
711 */
712#define devm_alloc_percpu(dev, type) \
713 ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \
714 __alignof__(type)))
715
716void __percpu *__devm_alloc_percpu(struct device *dev, size_t size,
717 size_t align);
718void devm_free_percpu(struct device *dev, void __percpu *pdata);
719
701struct device_dma_parameters { 720struct device_dma_parameters {
702 /* 721 /*
703 * a low level driver may set these to teach IOMMU code about 722 * a low level driver may set these to teach IOMMU code about