diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-04-20 04:16:26 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-05-02 10:33:32 +0200 |
commit | 0a782cb1fc2407163123fccd01f65da70d4d2cd8 (patch) | |
tree | 8b20c897a1bef847e6c5e0f3c05de8b177a7e3fe /drivers/mmc | |
parent | mmc: sdhci-pltfm: drop error message for too small MMIO resource size (diff) | |
download | linux-0a782cb1fc2407163123fccd01f65da70d4d2cd8.tar.xz linux-0a782cb1fc2407163123fccd01f65da70d4d2cd8.zip |
mmc: sdhci-pltfm: check return value of platform_get_irq()
The function platform_get_irq() can fail; it returns a negative error
code on failure. A negative IRQ number will make sdhci_add_host() fail
to request IRQ anyway, but it makes sense to let it fail earlier here.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-pltfm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 03dbdeb2aab2..24377a34db41 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -146,6 +146,11 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, } host->irq = platform_get_irq(pdev, 0); + if (host->irq < 0) { + dev_err(&pdev->dev, "failed to get IRQ number\n"); + ret = host->irq; + goto err_request; + } if (!request_mem_region(iomem->start, resource_size(iomem), mmc_hostname(host->mmc))) { |