backports: add devm_kmalloc()
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 1 Jan 2014 18:03:52 +0000 (19:03 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 18 Jan 2014 12:42:36 +0000 (13:42 +0100)
devm_kmalloc() was added in kernel 3.13. To backport it we replace the
calls with devm_kzalloc() instead.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/device.h

index fa269d2226ca26247dff5fab6ac974ff1a48a52d..5eda359f2639e2a25610b9e28911cf37f0148b66 100644 (file)
@@ -229,4 +229,8 @@ static inline void *dev_get_platdata(const struct device *dev)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#define devm_kmalloc(dev, size, flags) devm_kzalloc(dev, size, flags) 
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */