mmc: Simplify poll CD logic in case cyclic framework is enabled
Simplify 90cc07fd786d ("mmc: Poll CD in case cyclic framework is enabled")
according to suggestions by Rasmus. The struct cyclic_info is zero-size in
case CONFIG_CYCLIC is not enabled and does not add any size to struct mmc,
so it can unconditionally be part of that structure. This allows clean up
of all the other conditionals in mmc.c which can now be unconditionally
present, as they also add no extra space.
Suggested-by: Rasmus Villemoes <ravi@prevas.dk>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
diff --git a/include/mmc.h b/include/mmc.h
index 81bccb4..233a1d6 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -759,7 +759,11 @@
enum bus_mode user_speed_mode; /* input speed mode from user */
- CONFIG_IS_ENABLED(CYCLIC, (struct cyclic_info cyclic));
+ /*
+ * If CONFIG_CYCLIC is not set, struct cyclic_info is
+ * zero-size structure and does not add any space here.
+ */
+ struct cyclic_info cyclic;
};
#if CONFIG_IS_ENABLED(DM_MMC)