diff mbox series

[36/75] headers: backport mmc_sw_reset and mmc_hw_reset API changes

Message ID 20240627234808.1253337-37-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>

mmc_sw_reset() was added in kernel 4.18, do not add it to earlier
versions.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[Update the kernel version checks]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/mmc/core.h | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 backport/backport-include/linux/mmc/core.h
diff mbox series

Patch

diff --git a/backport/backport-include/linux/mmc/core.h b/backport/backport-include/linux/mmc/core.h
new file mode 100644
index 00000000..83b7aced
--- /dev/null
+++ b/backport/backport-include/linux/mmc/core.h
@@ -0,0 +1,26 @@ 
+#ifndef __BACKPORT_LINUX_MMC_CORE_H
+#define __BACKPORT_LINUX_MMC_CORE_H
+
+#include_next <linux/mmc/card.h>
+#include_next <linux/mmc/core.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,19,0)
+#if LINUX_VERSION_IS_GEQ(4,18,0)
+static inline int backport_mmc_sw_reset(struct mmc_card *card)
+{
+	return mmc_sw_reset(card->host);
+}
+#define mmc_sw_reset LINUX_BACKPORT(mmc_sw_reset)
+#endif /* >4.18 */
+#endif /* <5.19 */
+
+#if LINUX_VERSION_IS_LESS(5,18,0)
+static inline int backport_mmc_hw_reset(struct mmc_card *card)
+{
+	return mmc_hw_reset(card->host);
+}
+#define mmc_hw_reset LINUX_BACKPORT(mmc_hw_reset)
+#endif /* <5.18 */
+
+#endif