提交 073350f7 编写于 作者: R Roland Stigge 提交者: Chris Ball

mmc: mmc_spi: Fix return value evaluation of irq_of_parse_and_map()

When irq_of_parse_and_map() returns an error, it does as zero. But in
mmc_spi_get_pdata(), the error return case is compared against NO_IRQ.
This might work where NO_IRQ is zero (defaults to zero when undefined,
as on MIPS) but not where NO_IRQ is different, e.g. on ARM where it's -1.

This patch changes to comparison with 0 which is the error return value
of irq_of_parse_and_map().

Tested on ARM that mmc_spi is working now.
Signed-off-by: NRoland Stigge <stigge@antcom.de>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 14006bfb
...@@ -146,7 +146,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) ...@@ -146,7 +146,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
oms->pdata.get_ro = of_mmc_spi_get_ro; oms->pdata.get_ro = of_mmc_spi_get_ro;
oms->detect_irq = irq_of_parse_and_map(np, 0); oms->detect_irq = irq_of_parse_and_map(np, 0);
if (oms->detect_irq != NO_IRQ) { if (oms->detect_irq != 0) {
oms->pdata.init = of_mmc_spi_init; oms->pdata.init = of_mmc_spi_init;
oms->pdata.exit = of_mmc_spi_exit; oms->pdata.exit = of_mmc_spi_exit;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册