diff mbox series

[v2] tpm: Switch to platform_get_irq_optional()

Message ID 20191025091448.4424-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] tpm: Switch to platform_get_irq_optional() | expand

Commit Message

Hans de Goede Oct. 25, 2019, 9:14 a.m. UTC
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: <stable@vger.kernel.org> # 5.4.x
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Slightly reword commit msg, add Fixes tag
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jerry Snitselaar Oct. 25, 2019, 2:12 p.m. UTC | #1
On Fri Oct 25 19, Hans de Goede wrote:
>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: <stable@vger.kernel.org> # 5.4.x
>Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>

>---
>Changes in v2:
>- Slightly reword commit msg, add Fixes tag
>---
> drivers/char/tpm/tpm_tis.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
>index e4fdde93ed4c..e7df342a317d 100644
>--- a/drivers/char/tpm/tpm_tis.c
>+++ b/drivers/char/tpm/tpm_tis.c
>@@ -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;
>-- 
>2.23.0
>
Jarkko Sakkinen Oct. 28, 2019, 8:47 p.m. UTC | #2
On Fri, Oct 25, 2019 at 11:14:48AM +0200, Hans de Goede wrote:
> 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: <stable@vger.kernel.org> # 5.4.x
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko
diff mbox series

Patch

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index e4fdde93ed4c..e7df342a317d 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -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;