diff mbox series

[41/75] headers: backport hwrng_msleep

Message ID 20240627234808.1253337-42-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
From: Felix Fietkau <nbd@nbd.name>

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/hw_random.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 backport/backport-include/linux/hw_random.h
diff mbox series

Patch

diff --git a/backport/backport-include/linux/hw_random.h b/backport/backport-include/linux/hw_random.h
new file mode 100644
index 00000000..293621df
--- /dev/null
+++ b/backport/backport-include/linux/hw_random.h
@@ -0,0 +1,18 @@ 
+#ifndef __BACKPORT_HW_RANDOM_H
+#define __BACKPORT_HW_RANDOM_H
+
+#include_next <linux/hw_random.h>
+#include <linux/version.h>
+#include <linux/delay.h>
+
+#if LINUX_VERSION_IS_LESS(6,1,0)
+
+#define hwrng_msleep LINUX_BACKPORT(hwrng_msleep)
+static inline long hwrng_msleep(struct hwrng *rng, unsigned int msecs)
+{
+	return msleep_interruptible(msecs);
+}
+
+#endif /* < 6.1.0 */
+
+#endif