Commit 95bcaa39 authored by Shengzhou Liu's avatar Shengzhou Liu Committed by Herbert Xu

crypto: caam - add backward compatible string sec4.0

In some device trees of previous version, there were string "fsl,sec4.0".
To be backward compatible with device trees, we first check "fsl,sec-v4.0",
if it fails, then check for "fsl,sec4.0".
Signed-off-by: default avatarShengzhou Liu <Shengzhou.Liu@freescale.com>

extended to include new hash and rng code, which was omitted from
the previous version of this patch during a rebase of the SDK
version.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4a905077
...@@ -1736,8 +1736,11 @@ static void __exit caam_algapi_hash_exit(void) ...@@ -1736,8 +1736,11 @@ static void __exit caam_algapi_hash_exit(void)
struct caam_hash_alg *t_alg, *n; struct caam_hash_alg *t_alg, *n;
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
if (!dev_node) {
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
if (!dev_node) if (!dev_node)
return; return;
}
pdev = of_find_device_by_node(dev_node); pdev = of_find_device_by_node(dev_node);
if (!pdev) if (!pdev)
...@@ -1812,8 +1815,11 @@ static int __init caam_algapi_hash_init(void) ...@@ -1812,8 +1815,11 @@ static int __init caam_algapi_hash_init(void)
int i = 0, err = 0; int i = 0, err = 0;
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
if (!dev_node) {
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
if (!dev_node) if (!dev_node)
return -ENODEV; return -ENODEV;
}
pdev = of_find_device_by_node(dev_node); pdev = of_find_device_by_node(dev_node);
if (!pdev) if (!pdev)
......
...@@ -284,8 +284,11 @@ static int __init caam_rng_init(void) ...@@ -284,8 +284,11 @@ static int __init caam_rng_init(void)
struct caam_drv_private *priv; struct caam_drv_private *priv;
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
if (!dev_node) {
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
if (!dev_node) if (!dev_node)
return -ENODEV; return -ENODEV;
}
pdev = of_find_device_by_node(dev_node); pdev = of_find_device_by_node(dev_node);
if (!pdev) if (!pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment