diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2016-06-29 13:24:32 (GMT) |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-07-25 08:34:42 (GMT) |
commit | 56a590dcdc973e05230e9af3bcd4dfefd40d4127 (patch) | |
tree | a12eccef046993d0c0d79bf0ea67003306990fad /drivers | |
parent | 5d0d11c51a599e6c074fdb2d55f6eba307936591 (diff) | |
download | linux-56a590dcdc973e05230e9af3bcd4dfefd40d4127.tar.xz |
mmc: sdhci: Factor out sdhci_data_line_cmd()
Factor out sdhci_data_line_cmd() to improve readability and because it is
used in multiple places.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6e3b4d0..b7b68b3 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -109,6 +109,11 @@ static void sdhci_dumpregs(struct sdhci_host *host) * * \*****************************************************************************/ +static inline bool sdhci_data_line_cmd(struct mmc_command *cmd) +{ + return cmd->data || cmd->flags & MMC_RSP_BUSY; +} + static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) { u32 present; @@ -744,7 +749,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) u8 ctrl; struct mmc_data *data = cmd->data; - if (data || (cmd->flags & MMC_RSP_BUSY)) + if (sdhci_data_line_cmd(cmd)) sdhci_set_timeout(host, cmd); if (!data) @@ -1013,7 +1018,7 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) timeout = 10; mask = SDHCI_CMD_INHIBIT; - if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) + if (sdhci_data_line_cmd(cmd)) mask |= SDHCI_DATA_INHIBIT; /* We shouldn't wait for data inihibit for stop commands, even @@ -1042,7 +1047,7 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) mod_timer(&host->timer, timeout); host->cmd = cmd; - if (cmd->data || cmd->flags & MMC_RSP_BUSY) { + if (sdhci_data_line_cmd(cmd)) { WARN_ON(host->data_cmd); host->data_cmd = cmd; } |