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>
This commit is contained in:
Masahiro Yamada 2016-04-20 11:16:26 +09:00 committed by Ulf Hansson
parent 0b2ed795e1
commit 0a782cb1fc

View File

@ -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))) {