]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: omap-des - add COMPILE_TEST and fix CONFIG_OF=n build
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 17 May 2026 10:34:14 +0000 (12:34 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 May 2026 12:25:30 +0000 (20:25 +0800)
CRYPTO_DEV_OMAP_DES only depends on ARCH_OMAP2PLUS, which is ARM-only
and selects OF via ARM's USE_OF, making any non-OF code unreachable.

Add COMPILE_TEST so the driver can be built with CONFIG_OF=n, making the
non-OF code reachable.

Fix the resulting non-OF build failures:

- omap_des_irq() was defined inside a CONFIG_OF block, but is referenced
  unconditionally from omap_des_probe(). Move the CONFIG_OF guard so it
  only covers omap_des_get_of().

- The non-OF omap_des_get_of() stub took a struct device *, while
  omap_des_probe() passes a struct platform_device *. Make the stub
  prototype match the OF implementation and the caller.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/Kconfig
drivers/crypto/omap-des.c

index d23b58b81ca3411d50e6b1738b721769bb69d765..3449b3c9c6adfdaf1ab5740d6b3542c39c7d5745 100644 (file)
@@ -316,7 +316,7 @@ config HW_RANDOM_PPC4XX
 
 config CRYPTO_DEV_OMAP
        tristate "Support for OMAP crypto HW accelerators"
-       depends on ARCH_OMAP2PLUS
+       depends on ARCH_OMAP2PLUS || COMPILE_TEST
        help
          OMAP processors have various crypto HW accelerators. Select this if
          you want to use the OMAP modules for any of the crypto algorithms.
@@ -352,7 +352,7 @@ config CRYPTO_DEV_OMAP_AES
 
 config CRYPTO_DEV_OMAP_DES
        tristate "Support for OMAP DES/3DES hw engine"
-       depends on ARCH_OMAP2PLUS
+       depends on ARCH_OMAP2PLUS || COMPILE_TEST
        select CRYPTO_LIB_DES
        select CRYPTO_SKCIPHER
        select CRYPTO_ENGINE
index 16d5c617d5ee8cc588947949ab457f3bc628d81b..f6f3b22e4ee56ec1eb44a6dd26896b0302e6f417 100644 (file)
@@ -800,7 +800,6 @@ static struct omap_des_algs_info omap_des_algs_info_ecb_cbc[] = {
        },
 };
 
-#ifdef CONFIG_OF
 static const struct omap_des_pdata omap_des_pdata_omap4 = {
        .algs_info      = omap_des_algs_info_ecb_cbc,
        .algs_info_size = ARRAY_SIZE(omap_des_algs_info_ecb_cbc),
@@ -909,6 +908,7 @@ static const struct of_device_id omap_des_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, omap_des_of_match);
 
+#ifdef CONFIG_OF
 static int omap_des_get_of(struct omap_des_dev *dd,
                struct platform_device *pdev)
 {
@@ -923,7 +923,7 @@ static int omap_des_get_of(struct omap_des_dev *dd,
 }
 #else
 static int omap_des_get_of(struct omap_des_dev *dd,
-               struct device *dev)
+               struct platform_device *pdev)
 {
        return -EINVAL;
 }