Skip to content

Commit 03117a4

Browse files
baekseunghwan8267storulf
authored andcommitted
mmc: cqhci: Make use of cqhci_halted() routine
Make use of cqhci_halted() in couple places to avoid open-coding. Signed-off-by: Seunghwan Baek <[email protected]> Reviewed-by: Ritesh Harjani <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 64515b8 commit 03117a4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/mmc/host/cqhci-core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ struct cqhci_slot {
3333
#define CQHCI_HOST_OTHER BIT(4)
3434
};
3535

36+
static bool cqhci_halted(struct cqhci_host *cq_host)
37+
{
38+
return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
39+
}
40+
3641
static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
3742
{
3843
return cq_host->desc_base + (tag * cq_host->slot_sz);
@@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
282287

283288
cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
284289

285-
if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
290+
if (cqhci_halted(cq_host))
286291
cqhci_writel(cq_host, 0, CQHCI_CTL);
287292

288293
mmc->cqe_on = true;
@@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
617622
cqhci_writel(cq_host, 0, CQHCI_CTL);
618623
mmc->cqe_on = true;
619624
pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
620-
if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
625+
if (cqhci_halted(cq_host)) {
621626
pr_err("%s: cqhci: CQE failed to exit halt state\n",
622627
mmc_hostname(mmc));
623628
}
@@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
953958
return ret;
954959
}
955960

956-
static bool cqhci_halted(struct cqhci_host *cq_host)
957-
{
958-
return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
959-
}
960-
961961
static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
962962
{
963963
struct cqhci_host *cq_host = mmc->cqe_private;

0 commit comments

Comments
 (0)