mmc: host: Return an error when ->enable_sdio_irq() ops is missing
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 3 Mar 2022 16:51:42 +0000 (17:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:24:02 +0000 (14:24 +0200)
commit251a11699fe5007363cb1ae9700256a3c777a551
tree23ec10758e7a531fad6752011e72be845389823d
parent7c6bd60999f32138e3b73fd97ea11ef47a94de25
mmc: host: Return an error when ->enable_sdio_irq() ops is missing

[ Upstream commit d6c9219ca1139b74541b2a98cee47a3426d754a9 ]

Even if the current WARN() notifies the user that something is severely
wrong, we can still end up in a PANIC() when trying to invoke the missing
->enable_sdio_irq() ops. Therefore, let's also return an error code and
prevent the host from being added.

While at it, move the code into a separate function to prepare for
subsequent changes and for further host caps validations.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20220303165142.129745-1-ulf.hansson@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/core/host.c