Re: [RFC Patch net-next v2] net: dsa: microchip: lan937x: enable interrupt for internal phy link detection
From: Andrew Lunn
Date: Mon Aug 22 2022 - 08:56:49 EST
> +static irqreturn_t lan937x_switch_irq_thread(int irq, void *dev_id)
> +{
> + struct ksz_device *dev = dev_id;
> + irqreturn_t result = IRQ_NONE;
> + u32 data;
> + int ret;
> +
> + /* Read global interrupt status register */
> + ret = ksz_read32(dev, REG_SW_INT_STATUS__4, &data);
> + if (ret)
> + return result;
I don't think you can return negative error numbers here.
> +
> + if (data & POR_READY_INT) {
> + ret = ksz_write32(dev, REG_SW_INT_STATUS__4, POR_READY_INT);
> + if (ret)
> + return result;
Returning IRQ_NONE here seems wrong. You handle the interrupt, so
should probably return IRQ_HANDLED.
Andrew