diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2022-05-17 12:47:10 +0200 |
---|---|---|
committer | Matthias Brugger <matthias.bgg@gmail.com> | 2022-06-07 18:25:14 +0200 |
commit | 56a468b5f6454aae0e32e4c6ead1abde5cc4dd23 (patch) | |
tree | ecd77262a9d0e697c9d15e7f1ff97fc1619b0e71 /drivers/soc/mediatek | |
parent | soc: mediatek: pwrap: Switch to devm_platform_ioremap_resource_byname() (diff) | |
download | linux-56a468b5f6454aae0e32e4c6ead1abde5cc4dd23.tar.xz linux-56a468b5f6454aae0e32e4c6ead1abde5cc4dd23.zip |
soc: mediatek: pwrap: Check return value of platform_get_irq()
Check for the return value of platform_get_irq(): if no interrupt
is specified, it wouldn't make sense to call devm_request_irq().
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220517104712.24579-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Diffstat (limited to 'drivers/soc/mediatek')
-rw-r--r-- | drivers/soc/mediatek/mtk-pmic-wrap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 852514366f1f..04b51d21a5b0 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2317,6 +2317,11 @@ static int pwrap_probe(struct platform_device *pdev) pwrap_writel(wrp, wrp->master->int1_en_all, PWRAP_INT1_EN); irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto err_out2; + } + ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH, "mt-pmic-pwrap", wrp); |