Netdev List
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write
Date: Wed, 26 Dec 2018 20:13:15 +0100	[thread overview]
Message-ID: <4f6199de-51c4-4446-3ad3-6b036a09a63c@gmail.com> (raw)
In-Reply-To: <20181226182132.76798-1-kjlu@umn.edu>

On 26.12.2018 19:21, Kangjie Lu wrote:
> 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..236815700fba 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);
This is wrong. Please get familiar with what the function does.
And test changes before submitting them!

>  	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)
> 

  reply	other threads:[~2018-12-26 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 18:21 [PATCH] net: dsa: bcm_sf2: Propagate error value from mdio_write Kangjie Lu
2018-12-26 19:13 ` Heiner Kallweit [this message]
     [not found]   ` <CAK8KejrSvuFF546cSTwN_XWD6N8FxbSCjxCUsqaQ_N6S8nTA5A@mail.gmail.com>
2018-12-26 19:41     ` Heiner Kallweit
2018-12-26 20:34   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f6199de-51c4-4446-3ad3-6b036a09a63c@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox