Skip to contentSkip to conversation

tpm: Switch to platform_get_irq_optional()

PATCH In review Hans de Goede 3 participants 3 messages Oct 25, 2019 – Oct 28, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tpm: Switch to platform_get_irq_optional()

platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x

---
Changes in v2:
- Slightly reword commit msg, add Fixes tag

---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +1 -1
index e4fdde93ed4c..e7df342a317d 100644
@@ -286,7 +286,7 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
 	}
 	tpm_info.res = *res;
 
-	tpm_info.irq = platform_get_irq(pdev, 0);
+	tpm_info.irq = platform_get_irq_optional(pdev, 0);
 	if (tpm_info.irq <= 0) {
 		if (pdev != force_pdev)
 			tpm_info.irq = -1;
Signature · 1 line
2.23.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Hans de Goede

platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

Quoted 8 lines
[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x
Quoted 23 lines

---
Changes in v2:
- Slightly reword commit msg, add Fixes tag
---
drivers/char/tpm/tpm_tis.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +1 -1
index e4fdde93ed4c..e7df342a317d 100644
@@ -286,7 +286,7 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
 	}
 	tpm_info.res = *res;
 
-	tpm_info.irq = platform_get_irq(pdev, 0);
+	tpm_info.irq = platform_get_irq_optional(pdev, 0);
 	if (tpm_info.irq <= 0) {
 		if (pdev != force_pdev)
 			tpm_info.irq = -1;
Signature · 1 line
2.23.0
Reviewed-by on v2 1/1
#2 lore raw
In reply to Hans de Goede
Quoted 4 lines · Hans de Goede

platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

Quoted 8 lines
[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x

/Jarkko