Re: [PATCH] dsa: return error code upstream

2018-12-27 Thread David Miller
From: Florian Fainelli 
Date: Thu, 27 Dec 2018 17:06:58 -0800

> Le 12/27/18 à 4:22 PM, David Miller a écrit :
>> From: Kangjie Lu 
>> Date: Tue, 25 Dec 2018 22:08:18 -0600
>> 
>>> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
>>> return their error codes upstream.
>>>
>>> Signed-off-by: Kangjie Lu 
>> 
>> Applied with Subject line adjusted as per Florian's feedback.
>> 
> 
> Thanks, technically bcm_sf2_sw_indir_rw() cannot fail and checking its
> return value in the write (op == 0) case will always lead to returning 0
> anyway. In case this ever changes in the future, we should be more
> future proof with that change anyway.

Ok, thanks for the insight.


Re: [PATCH] dsa: return error code upstream

2018-12-27 Thread Florian Fainelli
Le 12/27/18 à 4:22 PM, David Miller a écrit :
> From: Kangjie Lu 
> Date: Tue, 25 Dec 2018 22:08:18 -0600
> 
>> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
>> return their error codes upstream.
>>
>> Signed-off-by: Kangjie Lu 
> 
> Applied with Subject line adjusted as per Florian's feedback.
> 

Thanks, technically bcm_sf2_sw_indir_rw() cannot fail and checking its
return value in the write (op == 0) case will always lead to returning 0
anyway. In case this ever changes in the future, we should be more
future proof with that change anyway.
-- 
Florian


Re: [PATCH] dsa: return error code upstream

2018-12-27 Thread David Miller
From: Kangjie Lu 
Date: Tue, 25 Dec 2018 22:08:18 -0600

> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
> return their error codes upstream.
> 
> Signed-off-by: Kangjie Lu 

Applied with Subject line adjusted as per Florian's feedback.


Re: [PATCH] dsa: return error code upstream

2018-12-26 Thread Florian Fainelli
Le 12/25/18 à 8:08 PM, Kangjie Lu a écrit :
> Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
> return their error codes upstream.

Thanks for your patch, the subject should be:

net: dsa: bcm_sf2: Propagate error value from mdio_write

to match existing commits done to that file. Thanks!
-- 
Florian


[PATCH] dsa: return error code upstream

2018-12-25 Thread Kangjie Lu
Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's
return their error codes upstream.

Signed-off-by: Kangjie Lu 
---
 drivers/net/dsa/bcm_sf2.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 2eb68769562c..441fea57a7ea 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -303,11 +303,10 @@ static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int 
addr, int regnum,
 * send them to our master MDIO bus controller
 */
if (addr == BRCM_PSEUDO_PHY_ADDR && priv->indir_phy_mask & BIT(addr))
-   bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
+   return bcm_sf2_sw_indir_rw(priv, 0, addr, regnum, val);
else
-   mdiobus_write_nested(priv->master_mii_bus, addr, regnum, val);
-
-   return 0;
+   return mdiobus_write_nested(priv->master_mii_bus, addr,
+   regnum, val);
 }
 
 static irqreturn_t bcm_sf2_switch_0_isr(int irq, void *dev_id)
-- 
2.17.2 (Apple Git-113)