]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: xilinx: prevent probing on non-xilinx hardware
authorCorentin Labbe <clabbe@baylibre.com>
Fri, 4 Mar 2022 07:36:48 +0000 (07:36 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 9 Mar 2022 03:12:31 +0000 (15:12 +1200)
commit17b15adc96ff47cea1b5e0dbac9ad32d739ededf
treeb0310066678caae62e0f5c063a86e196323bcfa5
parent3e330b23719c7c100b1654c25d7193883034785c
crypto: xilinx: prevent probing on non-xilinx hardware

The zynqmp-sha driver is always loaded and register its algorithm even on
platform which do not have the proper hardware.
This lead to a stacktrace due to zynqmp-sha3-384 failing its crypto
self tests.
So check if hardware is present via the firmware API call get_version.

While at it, simplify the platform_driver by using module_platform_driver()

Furthermore the driver should depend on ZYNQMP_FIRMWARE since it cannot
work without it.

Fixes: ab3cb1a9703d ("crypto: xilinx - Add Xilinx SHA3 driver")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/Kconfig
drivers/crypto/xilinx/zynqmp-sha.c