linux/drivers/mmc
Linus Walleij 479d8e61f6 mmc: mmci: Unwind big if() clause
This does two things: firsr replace the hard-to-read long
if-expression:

  if (!host->busy_status && !(status & err_msk) &&
      (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) {

With the more readable:

  if (!host->busy_status && !(status & err_msk)) {
     status = readl(base + MMCISTATUS);
     if (status & host->variant->busy_detect_flag) {

Second notice that the re-read MMCISTATUS register is now
stored into the status variable, using logic OR because what
if something else changed too?

While we are at it, explain what the function is doing.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-2-69a7164f2a61@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-06-19 13:14:26 +02:00
..
core mmc: core: Allow mmc_start_host() synchronously detect a card 2023-06-13 16:08:16 +02:00
host mmc: mmci: Unwind big if() clause 2023-06-19 13:14:26 +02:00
Kconfig
Makefile