lkml.org 
[lkml]   [2023]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH net 13/13] net: dwmac-loongson: Perceive zero IRQ as invalid
    Date
    Linux kernel defines zero IRQ number as invalid in case if IRQ couldn't be
    mapped. Fix that for Loongson PCI MAC specific IRQs request procedure.

    Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
    Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
    ---
    drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
    index a25c187d3185..907bdfcc07e9 100644
    --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
    +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
    @@ -127,20 +127,20 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
    res.addr = pcim_iomap_table(pdev)[0];

    res.irq = of_irq_get_byname(np, "macirq");
    - if (res.irq < 0) {
    + if (res.irq <= 0) {
    dev_err(&pdev->dev, "IRQ macirq not found\n");
    ret = -ENODEV;
    goto err_disable_msi;
    }

    res.wol_irq = of_irq_get_byname(np, "eth_wake_irq");
    - if (res.wol_irq < 0) {
    + if (res.wol_irq <= 0) {
    dev_info(&pdev->dev, "IRQ eth_wake_irq not found, using macirq\n");
    res.wol_irq = res.irq;
    }

    res.lpi_irq = of_irq_get_byname(np, "eth_lpi");
    - if (res.lpi_irq < 0) {
    + if (res.lpi_irq <= 0) {
    dev_err(&pdev->dev, "IRQ eth_lpi not found\n");
    ret = -ENODEV;
    goto err_disable_msi;
    --
    2.39.2

    \
     
     \ /
      Last update: 2023-03-27 00:57    [W:2.321 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site