]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mmc: cqhci: Make use of cqhci_halted() routine
authorSeunghwan Baek <sh8267.baek@samsung.com>
Thu, 29 Aug 2024 06:18:23 +0000 (15:18 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 3 Sep 2024 12:22:10 +0000 (14:22 +0200)
Make use of cqhci_halted() in couple places to avoid open-coding.

Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>
Reviewed-by: Ritesh Harjani <ritesh.list@gmail.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20240829061823.3718-3-sh8267.baek@samsung.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cqhci-core.c

index a02da26a1efd1ed743e0155f9f408f76c7277a4f..178277d90c31c52b3e0df13421457c664d57d1a9 100644 (file)
@@ -33,6 +33,11 @@ struct cqhci_slot {
 #define CQHCI_HOST_OTHER       BIT(4)
 };
 
+static bool cqhci_halted(struct cqhci_host *cq_host)
+{
+       return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
+}
+
 static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
 {
        return cq_host->desc_base + (tag * cq_host->slot_sz);
@@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
 
        cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
 
-       if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
+       if (cqhci_halted(cq_host))
                cqhci_writel(cq_host, 0, CQHCI_CTL);
 
        mmc->cqe_on = true;
@@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
                cqhci_writel(cq_host, 0, CQHCI_CTL);
                mmc->cqe_on = true;
                pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
-               if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
+               if (cqhci_halted(cq_host)) {
                        pr_err("%s: cqhci: CQE failed to exit halt state\n",
                               mmc_hostname(mmc));
                }
@@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
        return ret;
 }
 
-static bool cqhci_halted(struct cqhci_host *cq_host)
-{
-       return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
-}
-
 static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
 {
        struct cqhci_host *cq_host = mmc->cqe_private;