Commit 29a449e7 authored by Zhang Shurong's avatar Zhang Shurong Committed by Mark Brown

spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe()

The platform_get_irq might be failed and return a negative result. So
there should have an error handling code.

Fixed this by adding an error handling code.

Fixes: 8528547b ("spi: tegra: add spi driver for sflash controller")
Signed-off-by: default avatarZhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_71FC162D589E4788C2152AAC84CD8D5C6D06@qq.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7ad1c439
......@@ -455,7 +455,11 @@ static int tegra_sflash_probe(struct platform_device *pdev)
goto exit_free_master;
}
tsd->irq = platform_get_irq(pdev, 0);
ret = platform_get_irq(pdev, 0);
if (ret < 0)
goto exit_free_master;
tsd->irq = ret;
ret = request_irq(tsd->irq, tegra_sflash_isr, 0,
dev_name(&pdev->dev), tsd);
if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment