summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxim Moskalets <maximmosk4@gmail.com>2024-05-15 23:13:30 +0300
committerTom Rini <trini@konsulko.com>2024-06-07 16:20:25 -0600
commit2b6c4b66e5df5c82e5197191d32ac7b81e29abcb (patch)
treee5899d24f72068db988f255e72caba9f9ab62ea1 /include
parent4f836fb324ba500ecabdba4146c3ca9e1600cdf5 (diff)
downloadu-boot-2b6c4b66e5df5c82e5197191d32ac7b81e29abcb.tar.gz
u-boot-2b6c4b66e5df5c82e5197191d32ac7b81e29abcb.tar.bz2
u-boot-2b6c4b66e5df5c82e5197191d32ac7b81e29abcb.zip
dm: use newly added linux/compat alloc functions
Signed-off-by: Maxim Moskalets <maximmosk4@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/dm/devres.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/dm/devres.h b/include/dm/devres.h
index 697534aa5b..27761deb6d 100644
--- a/include/dm/devres.h
+++ b/include/dm/devres.h
@@ -266,17 +266,13 @@ static inline void *devm_kzalloc(struct udevice *dev, size_t size, gfp_t gfp)
static inline void *devm_kmalloc_array(struct udevice *dev,
size_t n, size_t size, gfp_t flags)
{
- /* TODO: add kmalloc_array() to linux/compat.h */
- if (size != 0 && n > SIZE_MAX / size)
- return NULL;
- return kmalloc(n * size, flags);
+ return kmalloc_array(n, size, flags);
}
static inline void *devm_kcalloc(struct udevice *dev,
size_t n, size_t size, gfp_t flags)
{
- /* TODO: add kcalloc() to linux/compat.h */
- return kmalloc(n * size, flags | __GFP_ZERO);
+ return kcalloc(n, size, flags);
}
static inline void devm_kfree(struct udevice *dev, void *ptr)