| From ac6e894743527703c04918cad64ec852ae427586 Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Tue, 1 Oct 2019 20:06:22 +0200 |
| Subject: [PATCH] iommu/ipmmu-vmsa: Only call platform_get_irq() when interrupt |
| is mandatory |
| |
| commit ec37d4e999041ae8eb507d8d444a28b338670336 upstream. |
| |
| As platform_get_irq() now prints an error when the interrupt does not |
| exist, calling it gratuitously causes scary messages like: |
| |
| ipmmu-vmsa e6740000.mmu: IRQ index 0 not found |
| |
| Fix this by moving the call to platform_get_irq() down, where the |
| existence of the interrupt is mandatory. |
| |
| Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()") |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> |
| Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> |
| Reviewed-by: Stephen Boyd <swboyd@chromium.org> |
| Signed-off-by: Joerg Roedel <jroedel@suse.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c |
| index 9a380c10655e..1e620f7ee08a 100644 |
| --- a/drivers/iommu/ipmmu-vmsa.c |
| +++ b/drivers/iommu/ipmmu-vmsa.c |
| @@ -1050,8 +1050,6 @@ static int ipmmu_probe(struct platform_device *pdev) |
| mmu->num_ctx = min_t(unsigned int, IPMMU_CTX_MAX, |
| mmu->features->number_of_contexts); |
| |
| - irq = platform_get_irq(pdev, 0); |
| - |
| /* |
| * Determine if this IPMMU instance is a root device by checking for |
| * the lack of has_cache_leaf_nodes flag or renesas,ipmmu-main property. |
| @@ -1070,6 +1068,7 @@ static int ipmmu_probe(struct platform_device *pdev) |
| |
| /* Root devices have mandatory IRQs */ |
| if (ipmmu_is_root(mmu)) { |
| + irq = platform_get_irq(pdev, 0); |
| if (irq < 0) { |
| dev_err(&pdev->dev, "no IRQ found\n"); |
| return irq; |
| -- |
| 2.7.4 |
| |