mmc: core: refactor debugfs code
PATCH 1/1 mmc: core: refactor debugfs code
From: Ye Bin <[email protected]>
Now, CONFIG_DEBUG_FS is scattered in various functions, to make code clean centralized processing CONFIG_DEBUG_FS in mmc debugfs module.
Signed-off-by Ye Bin <[email protected]>
--- drivers/mmc/core/bus.c | 4 ---- drivers/mmc/core/core.h | 15 +++++++++++++++ drivers/mmc/core/host.c | 4 ---- 3 files changed, 15 insertions(+), 8 deletions(-)
drivers/mmc/core/bus.c +0 -4
@@ -359,9 +359,7 @@ int mmc_add_card(struct mmc_card *card) uhs_bus_speed_mode, type, card->rca); } -#ifdef CONFIG_DEBUG_FS mmc_add_card_debugfs (card); -#endif card->dev.of_node =mmc_of_find_child_device (card->host,0 );device_enable_async_suspend (&card->dev);
@@ -383,9 +381,7 @@ void mmc_remove_card(struct mmc_card *card) {struct mmc_host *host = card->host; -#ifdef CONFIG_DEBUG_FS mmc_remove_card_debugfs (card); -#endif if (mmc_card_present (card)) {if (mmc_host_is_spi (card->host)) {
drivers/mmc/core/core.h +15 -0
@@ -86,11 +86,26 @@ int mmc_attach_sdio(struct mmc_host *host);extern bool use_spi_crc;/* Debugfs information for hosts and cards */ +#ifdef CONFIG_DEBUG_FS void mmc_add_host_debugfs (struct mmc_host *host);void mmc_remove_host_debugfs (struct mmc_host *host);void mmc_add_card_debugfs (struct mmc_card *card);void mmc_remove_card_debugfs (struct mmc_card *card); +#else +static inline void mmc_add_host_debugfs (struct mmc_host *host) +{ +} +static inline void mmc_remove_host_debugfs (struct mmc_host *host) +{ +} +static inline void mmc_add_card_debugfs (struct mmc_card *card) +{ +} +static inline void mmc_remove_card_debugfs (struct mmc_card *card) +{ +} +#endif int mmc_execute_tuning (struct mmc_card *card);int mmc_hs200_to_hs400 (struct mmc_card *card);
drivers/mmc/core/host.c +0 -4
@@ -629,9 +629,7 @@ int mmc_add_host(struct mmc_host *host)led_trigger_register_simple (dev_name (&host->class_dev), &host->led); -#ifdef CONFIG_DEBUG_FS mmc_add_host_debugfs (host); -#endif mmc_start_host (host);return 0 ;
@@ -651,9 +649,7 @@ void mmc_remove_host(struct mmc_host *host) {mmc_stop_host (host); -#ifdef CONFIG_DEBUG_FS mmc_remove_host_debugfs (host); -#endif device_del (&host->class_dev);
Signature · 1 line
2.31.1
Quoted 7 lines · Ye Bin
From: Ye Bin <[email protected]>
Now,
CONFIG_DEBUG_FSis scattered in various functions, to make code clean centralized processingCONFIG_DEBUG_FSin mmc debugfs module.Signed-off-by Ye Bin <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 88 lines
--- drivers/mmc/core/bus.c | 4 ---- drivers/mmc/core/core.h | 15 +++++++++++++++ drivers/mmc/core/host.c | 4 ---- 3 files changed, 15 insertions(+), 8 deletions(-)drivers/mmc/core/bus.c +0
-4@@ -359,9 +359,7 @@ int mmc_add_card(struct mmc_card *card) uhs_bus_speed_mode, type, card->rca); } -#ifdef CONFIG_DEBUG_FS mmc_add_card_debugfs (card); -#endif card->dev.of_node =mmc_of_find_child_device (card->host,0 );device_enable_async_suspend (&card->dev);@@ -383,9 +381,7 @@ void mmc_remove_card(struct mmc_card *card) {struct mmc_host *host = card->host; -#ifdef CONFIG_DEBUG_FS mmc_remove_card_debugfs (card); -#endif if (mmc_card_present (card)) {if (mmc_host_is_spi (card->host)) {drivers/mmc/core/core.h +15
-0@@ -86,11 +86,26 @@ int mmc_attach_sdio(struct mmc_host *host);extern bool use_spi_crc;/* Debugfs information for hosts and cards */ +#ifdef CONFIG_DEBUG_FS void mmc_add_host_debugfs (struct mmc_host *host);void mmc_remove_host_debugfs (struct mmc_host *host);void mmc_add_card_debugfs (struct mmc_card *card);void mmc_remove_card_debugfs (struct mmc_card *card); +#else +static inline void mmc_add_host_debugfs (struct mmc_host *host) +{ +} +static inline void mmc_remove_host_debugfs (struct mmc_host *host) +{ +} +static inline void mmc_add_card_debugfs (struct mmc_card *card) +{ +} +static inline void mmc_remove_card_debugfs (struct mmc_card *card) +{ +} +#endif int mmc_execute_tuning (struct mmc_card *card);int mmc_hs200_to_hs400 (struct mmc_card *card);drivers/mmc/core/host.c +0
-5@@ -629,9 +629,7 @@ int mmc_add_host(struct mmc_host *host)led_trigger_register_simple (dev_name (&host->class_dev), &host->led); -#ifdef CONFIG_DEBUG_FS mmc_add_host_debugfs (host); -#endif mmc_start_host (host);return 0 ;@@ -651,9 +649,7 @@ void mmc_remove_host(struct mmc_host *host) {mmc_stop_host (host); -#ifdef CONFIG_DEBUG_FS mmc_remove_host_debugfs (host); -#endif device_del (&host->class_dev); --2.31.1