mmc: core: Add helper function to indicate if SDIO IRQs is enabled
authorUlf Hansson <ulf.hansson@linaro.org>
Sun, 8 Sep 2019 10:12:26 +0000 (12:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:09:57 +0000 (13:09 +0200)
commita0dd3d95fb2115425c64c5d861f4d23a9288bf88
tree215beefe92250d11b0dc1710dbd59e1919b51c8f
parent8ba99d50cb61fdb26e66a13d581086f05a83175a
mmc: core: Add helper function to indicate if SDIO IRQs is enabled

[ Upstream commit bd880b00697befb73eff7220ee20bdae4fdd487b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/mmc/host.h