| From 345489e3c052bc32e050d1f8b9a855a8972056b9 Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Tue, 1 Oct 2019 20:08:34 +0200 |
| Subject: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional |
| interrupt |
| |
| commit faf97b84fa86d40eba5a30e9071dfb55133fb1b7 upstream. |
| |
| As platform_get_irq() now prints an error when the interrupt does not |
| exist, a scary warning may be printed for an optional interrupt: |
| |
| sh_mmcif ee200000.mmc: IRQ index 1 not found |
| |
| Fix this by calling platform_get_irq_optional() instead for the second |
| interrupt, which is optional. |
| |
| Remove the now superfluous error printing for the first interrupt, which |
| 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: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c |
| index 81bd9afb0980..98c575de43c7 100644 |
| --- a/drivers/mmc/host/sh_mmcif.c |
| +++ b/drivers/mmc/host/sh_mmcif.c |
| @@ -1393,11 +1393,9 @@ static int sh_mmcif_probe(struct platform_device *pdev) |
| const char *name; |
| |
| irq[0] = platform_get_irq(pdev, 0); |
| - irq[1] = platform_get_irq(pdev, 1); |
| - if (irq[0] < 0) { |
| - dev_err(dev, "Get irq error\n"); |
| + irq[1] = platform_get_irq_optional(pdev, 1); |
| + if (irq[0] < 0) |
| return -ENXIO; |
| - } |
| |
| res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| reg = devm_ioremap_resource(dev, res); |
| -- |
| 2.7.4 |
| |