Skip to content

Commit bd880b0

Browse files
author
Ulf Hansson
committed
mmc: core: Add helper function to indicate if SDIO IRQs is enabled
To avoid each host driver supporting SDIO IRQs, from keeping track internally about if SDIO IRQs has been claimed, let's introduce a common helper function, sdio_irq_claimed(). The function returns true if SDIO IRQs are claimed, via using the information about the number of claimed irqs. This is safe, even without any locks, as long as the helper function is called only from runtime/system suspend callbacks of the host driver. Tested-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 20964a1 commit bd880b0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎include/linux/mmc/host.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,15 @@ void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq);
493493

494494
void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);
495495

496+
/*
497+
* May be called from host driver's system/runtime suspend/resume callbacks,
498+
* to know if SDIO IRQs has been claimed.
499+
*/
500+
static inline bool sdio_irq_claimed(struct mmc_host *host)
501+
{
502+
return host->sdio_irqs > 0;
503+
}
504+
496505
static inline void mmc_signal_sdio_irq(struct mmc_host *host)
497506
{
498507
host->ops->enable_sdio_irq(host, 0);

0 commit comments

Comments
 (0)