tee: optee: take DT status property into account
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 1 Aug 2018 09:48:33 +0000 (11:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 16:59:34 +0000 (17:59 +0100)
[ Upstream commit db878f76b9ff7487da9bb0f686153f81829f1230 ]

DT nodes may have a 'status' property which, if set to anything other
than 'ok' or 'okay', indicates to the OS that the DT node should be
treated as if it was not present. So add that missing logic to the
OP-TEE driver.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tee/optee/core.c

index edb6e4e9ef3acb8d18fcf9de4280e10fcbda5f14..ca79c2ba2ef2acf40fb8bb509cadf86085a93a9c 100644 (file)
@@ -590,7 +590,7 @@ static int __init optee_driver_init(void)
                return -ENODEV;
 
        np = of_find_matching_node(fw_np, optee_match);
-       if (!np)
+       if (!np || !of_device_is_available(np))
                return -ENODEV;
 
        optee = optee_probe(np);