]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccp - Fix device IRQ counting by using platform_irq_count()
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 13 Jun 2022 19:16:27 +0000 (14:16 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Jun 2022 09:09:01 +0000 (17:09 +0800)
commit971ff3129b9bb275d7bf569efa9e4f5819da5693
treecba05893fe027ff10d88a3b4d4e563aac91679f8
parente92012f302658cfc99ca61f9a2fd5081a9a0be02
crypto: ccp - Fix device IRQ counting by using platform_irq_count()

The ccp driver loops through the platform device resources array to get
the IRQ count for the device. With commit 55098b87fc23 ("of/platform: Drop
static setup of IRQ resource from DT core"), the IRQ resources are no
longer stored in the platform device resource array. As a result, the IRQ
count is now always zero. This causes the driver to issue a second call to
platform_get_irq(), which fails if the IRQ count is really 1, causing the
loading of the driver to fail.

Replace looping through the resources array to count the number of IRQs
with a call to platform_irq_count().

Fixes: 55098b87fc23 ("of/platform: Drop static setup of IRQ resource from DT core")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/sp-platform.c