diff mbox series

[v8,8/8] net-next: mvpp2: don't shadow error

Message ID 8c5b976a4ef9ba38fc952e9cf61848baa3e9dfe7.1690890774.git.mazziesaccount@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series fix fwnode_irq_get[_byname()] returnvalue | expand

Commit Message

Matti Vaittinen Aug. 1, 2023, 12:04 p.m. UTC
Do not overwrite error from lower layers but return the actual error to
user if obtaining an IRQ fails.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Russell King (Oracle) Aug. 1, 2023, 12:31 p.m. UTC | #1
On Tue, Aug 01, 2023 at 03:04:40PM +0300, Matti Vaittinen wrote:
> Do not overwrite error from lower layers but return the actual error to
> user if obtaining an IRQ fails.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

Since your previous patch is incorrect, this one is too.

NAK.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 2632ffe91ca5..2aba34a2ca76 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5830,13 +5830,13 @@  static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port,
 		}
 
 		if (port_node)
-			v->irq = of_irq_get_byname(port_node, irqname);
+			ret = of_irq_get_byname(port_node, irqname);
 		else
-			v->irq = fwnode_irq_get(port->fwnode, i);
-		if (v->irq < 0) {
-			ret = -EINVAL;
+			ret = fwnode_irq_get(port->fwnode, i);
+		if (ret < 0)
 			goto err;
-		}
+
+		v->irq = ret;
 
 		netif_napi_add(port->dev, &v->napi, mvpp2_poll);
 	}