diff mbox series

[v5,3/8] net-next: mvpp2: relax return value check for IRQ get

Message ID 7c7b1a123d6d5c15c8b37754f1f0c4bd1cad5a01.1684493615.git.mazziesaccount@gmail.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series fix fwnode_irq_get[_byname()] returnvalue | expand

Commit Message

Matti Vaittinen May 19, 2023, 11:01 a.m. UTC
fwnode_irq_get[_byname]() were changed to not return 0 anymore.

Drop check for return value 0.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

---
Revision history:
v4 = v5:
Fix the subject, mb1232 => mvpp2

The first patch of the series changes the fwnode_irq_get() so this depends
on the first patch of the series and should not be applied alone.
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andy Shevchenko May 21, 2023, 5:19 p.m. UTC | #1
Fri, May 19, 2023 at 02:01:47PM +0300, Matti Vaittinen kirjoitti:
> fwnode_irq_get[_byname]() were changed to not return 0 anymore.
> 
> Drop check for return value 0.

...

> -		if (v->irq <= 0) {
> +		if (v->irq < 0) {
>  			ret = -EINVAL;

			ret = v->irq;

?

>  			goto err;
>  		}
Matti Vaittinen May 22, 2023, 5:15 a.m. UTC | #2
Hi Andy,

On 5/21/23 20:19, andy.shevchenko@gmail.com wrote:
> Fri, May 19, 2023 at 02:01:47PM +0300, Matti Vaittinen kirjoitti:
>> fwnode_irq_get[_byname]() were changed to not return 0 anymore.
>>
>> Drop check for return value 0.
> 
> ...
> 
>> -		if (v->irq <= 0) {
>> +		if (v->irq < 0) {
>>   			ret = -EINVAL;
> 
> 			ret = v->irq;
> 
> ?

For me that seems to be correct, yes. This, however, would be a 
functional change and in my opinion it should be done separately from 
this API change.

> 
>>   			goto err;
>>   		}
>
Jonathan Cameron May 28, 2023, 7:14 p.m. UTC | #3
On Mon, 22 May 2023 08:15:01 +0300
Matti Vaittinen <mazziesaccount@gmail.com> wrote:

> Hi Andy,
> 
> On 5/21/23 20:19, andy.shevchenko@gmail.com wrote:
> > Fri, May 19, 2023 at 02:01:47PM +0300, Matti Vaittinen kirjoitti:  
> >> fwnode_irq_get[_byname]() were changed to not return 0 anymore.
> >>
> >> Drop check for return value 0.  
> > 
> > ...
> >   
> >> -		if (v->irq <= 0) {
> >> +		if (v->irq < 0) {
> >>   			ret = -EINVAL;  
> > 
> > 			ret = v->irq;
> > 
> > ?  
> 
> For me that seems to be correct, yes. This, however, would be a 
> functional change and in my opinion it should be done separately from 
> this API change.
Ah. I commented on this as well in v6.  Roll us that separate patch
and I expect we'll both be happy ;)

Jonathan

> 
> >   
> >>   			goto err;
> >>   		}  
> >   
>
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 adc953611913..5b987af306a5 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5833,7 +5833,7 @@  static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port,
 			v->irq = of_irq_get_byname(port_node, irqname);
 		else
 			v->irq = fwnode_irq_get(port->fwnode, i);
-		if (v->irq <= 0) {
+		if (v->irq < 0) {
 			ret = -EINVAL;
 			goto err;
 		}
@@ -6764,7 +6764,7 @@  static int mvpp2_port_probe(struct platform_device *pdev,
 		err = -EPROBE_DEFER;
 		goto err_deinit_qvecs;
 	}
-	if (port->port_irq <= 0)
+	if (port->port_irq < 0)
 		/* the link irq is optional */
 		port->port_irq = 0;