提交 0a782cb1 编写于 作者: M Masahiro Yamada 提交者: Ulf Hansson

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: NMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 0b2ed795
......@@ -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))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册