spi: Do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> # Link: https://lore.kernel.org/r/20230802093238.975906-1-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3182d49aad
commit
8102d64c04
|
@ -470,8 +470,8 @@ static int spi_engine_probe(struct platform_device *pdev)
|
|||
int ret;
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq <= 0)
|
||||
return -ENXIO;
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
spi_engine = devm_kzalloc(&pdev->dev, sizeof(*spi_engine), GFP_KERNEL);
|
||||
if (!spi_engine)
|
||||
|
|
|
@ -1360,8 +1360,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
|
|||
ctlr->max_speed_hz = clk_get_rate(bs->clk) / 2;
|
||||
|
||||
bs->irq = platform_get_irq(pdev, 0);
|
||||
if (bs->irq <= 0)
|
||||
return bs->irq ? bs->irq : -ENODEV;
|
||||
if (bs->irq < 0)
|
||||
return bs->irq;
|
||||
|
||||
err = clk_prepare_enable(bs->clk);
|
||||
if (err)
|
||||
|
|
|
@ -520,8 +520,8 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
bs->irq = platform_get_irq(pdev, 0);
|
||||
if (bs->irq <= 0)
|
||||
return bs->irq ? bs->irq : -ENODEV;
|
||||
if (bs->irq < 0)
|
||||
return bs->irq;
|
||||
|
||||
/* this also enables the HW block */
|
||||
err = clk_prepare_enable(bs->clk);
|
||||
|
|
|
@ -627,8 +627,8 @@ static int cdns_spi_probe(struct platform_device *pdev)
|
|||
cdns_spi_init_hw(xspi, spi_controller_is_slave(ctlr));
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq <= 0) {
|
||||
ret = -ENXIO;
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto clk_dis_all;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue