Skip to contentSkip to conversation

tpm: use phase-specific CONFIG check in tpm_uclass_post_probe

PATCH In review Tycho Kirchner 3 participants 3 messages Oct 27 – Nov 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: use phase-specific CONFIG check in tpm_uclass_post_probe

CONFIG_TPM_RNG has no SPL variant. With CONFIG_SPL_TPM=y and CONFIG_TPM_RNG=y, if a TPM is used in the SPL, device_bind_driver() then fails with ENOENT. Thus, make TPM_RNG a phase-specific symbol.

---
 drivers/tpm/tpm-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tpm/tpm-uclass.c +1 -1
index 0fade2dcc0a..26cfda90ec3 100644
@@ -156,7 +156,7 @@ static int tpm_uclass_post_probe(struct udevice *dev)
 	const char *drv = TPM_RNG_DRV_NAME;
 	struct udevice *child;
 
-	if (IS_ENABLED(CONFIG_TPM_RNG)) {
+	if (CONFIG_IS_ENABLED(TPM_RNG)) {
 		ret = device_find_first_child_by_uclass(dev, UCLASS_RNG,
 							&child);
 
Signature · 1 line
2.47.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tycho Kirchner

CONFIG_TPM_RNG has no SPL variant. With CONFIG_SPL_TPM=y and CONFIG_TPM_RNG=y, if a TPM is used in the SPL, device_bind_driver() then fails with ENOENT. Thus, make TPM_RNG a phase-specific symbol.

Signature · 1 line
Tom
Reviewed-by on v1 1/1
#2 lore raw
In reply to Tycho Kirchner
Quoted 7 lines · Tycho Kirchner

CONFIG_TPM_RNG has no SPL variant. With CONFIG_SPL_TPM=y and CONFIG_TPM_RNG=y, if a TPM is used in the SPL, device_bind_driver() then fails with ENOENT. Thus, make TPM_RNG a phase-specific symbol.

---

Quoted 19 lines
 drivers/tpm/tpm-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tpm/tpm-uclass.c +1 -2
index 0fade2dcc0a..26cfda90ec3 100644
@@ -156,7 +156,7 @@ static int tpm_uclass_post_probe(struct udevice *dev)
        const char *drv = TPM_RNG_DRV_NAME;
        struct udevice *child;
 
-       if (IS_ENABLED(CONFIG_TPM_RNG)) {
+       if (CONFIG_IS_ENABLED(TPM_RNG)) {
                ret = device_find_first_child_by_uclass(dev, UCLASS_RNG,
                                                        &child);
 
--

2.47.3