Skip to contentSkip to conversation

vfio: platform: Switch to platform_get_irq_optional()

PATCH In review Eric Auger 2 participants 2 messages Mar 2, 2020 – Mar 4, 2020

Subsystems (4)
lore
Share & tools
lore

Eric Auger

author maintainer
#0 lore raw

PATCH 1/1 vfio: platform: Switch to platform_get_irq_optional()

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() calls dev_err() on an error. As we enumerate all interrupts until platform_get_irq() fails, we now systematically get a message such as:
"vfio-platform fff51000.ethernet: IRQ index 3 not found" which is a false positive.

Let's use platform_get_irq_optional() instead.

---
 drivers/vfio/platform/vfio_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vfio/platform/vfio_platform.c +1 -1
index ae1a5eb98620..1e2769010089 100644
@@ -44,7 +44,7 @@ static int get_platform_irq(struct vfio_platform_device *vdev, int i)
 {
 	struct platform_device *pdev = (struct platform_device *) vdev->opaque;
 
-	return platform_get_irq(pdev, i);
+	return platform_get_irq_optional(pdev, i);
 }
 
 static int vfio_platform_probe(struct platform_device *pdev)
Signature · 1 line
2.20.1
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Mon, 2 Mar 2020 21:37:15 +0100 Eric Auger <[email protected]> wrote:

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() calls dev_err() on an error. As we enumerate all interrupts until platform_get_irq() fails, we now systematically get a message such as:
"vfio-platform fff51000.ethernet: IRQ index 3 not found" which is a false positive.

Let's use platform_get_irq_optional() instead.

Yes, that seems correct to me and avoids the false positive error message I saw before.

Quoted 2 lines

Thanks!
Andre

Quoted 17 lines
---
 drivers/vfio/platform/vfio_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vfio/platform/vfio_platform.c +1 -1
index ae1a5eb98620..1e2769010089 100644
@@ -44,7 +44,7 @@ static int get_platform_irq(struct vfio_platform_device *vdev, int i)
 {
 	struct platform_device *pdev = (struct platform_device *) vdev->opaque;
 
-	return platform_get_irq(pdev, i);
+	return platform_get_irq_optional(pdev, i);
 }
 
 static int vfio_platform_probe(struct platform_device *pdev)