* [PATCH] dsa: return error code upstream
@ 2018-12-26 4:08 Kangjie Lu
2018-12-26 17:31 ` Florian Fainelli
2018-12-28 0:22 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Kangjie Lu @ 2018-12-26 4:08 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Andrew Lunn, Vivien Didelot, Florian Fainelli,
David S. Miller, netdev, linux-kernel
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 <kjlu@umn.edu>
---
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)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] dsa: return error code upstream
2018-12-26 4:08 [PATCH] dsa: return error code upstream Kangjie Lu
@ 2018-12-26 17:31 ` Florian Fainelli
2018-12-28 0:22 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2018-12-26 17:31 UTC (permalink / raw)
To: Kangjie Lu
Cc: pakki001, Andrew Lunn, Vivien Didelot, David S. Miller, netdev,
linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dsa: return error code upstream
2018-12-26 4:08 [PATCH] dsa: return error code upstream Kangjie Lu
2018-12-26 17:31 ` Florian Fainelli
@ 2018-12-28 0:22 ` David Miller
2018-12-28 1:06 ` Florian Fainelli
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2018-12-28 0:22 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, andrew, vivien.didelot, f.fainelli, netdev, linux-kernel
From: Kangjie Lu <kjlu@umn.edu>
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 <kjlu@umn.edu>
Applied with Subject line adjusted as per Florian's feedback.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dsa: return error code upstream
2018-12-28 0:22 ` David Miller
@ 2018-12-28 1:06 ` Florian Fainelli
2018-12-28 1:53 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2018-12-28 1:06 UTC (permalink / raw)
To: David Miller, kjlu; +Cc: pakki001, andrew, vivien.didelot, netdev, linux-kernel
Le 12/27/18 à 4:22 PM, David Miller a écrit :
> From: Kangjie Lu <kjlu@umn.edu>
> 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 <kjlu@umn.edu>
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dsa: return error code upstream
2018-12-28 1:06 ` Florian Fainelli
@ 2018-12-28 1:53 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-12-28 1:53 UTC (permalink / raw)
To: f.fainelli; +Cc: kjlu, pakki001, andrew, vivien.didelot, netdev, linux-kernel
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 27 Dec 2018 17:06:58 -0800
> Le 12/27/18 à 4:22 PM, David Miller a écrit :
>> From: Kangjie Lu <kjlu@umn.edu>
>> 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 <kjlu@umn.edu>
>>
>> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-12-28 1:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26 4:08 [PATCH] dsa: return error code upstream Kangjie Lu
2018-12-26 17:31 ` Florian Fainelli
2018-12-28 0:22 ` David Miller
2018-12-28 1:06 ` Florian Fainelli
2018-12-28 1:53 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).