lkml.org 
[lkml]   [2024]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH net-next v2 08/15] net: dsa: mt7530: return mt7530_setup_mdio & mt7531_setup_common on error
    From: Arınç ÜNAL <arinc.unal@arinc9.com>

    The mt7530_setup_mdio() and mt7531_setup_common() functions should be
    checked for errors. Return if the functions return a non-zero value.

    Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
    ---
    drivers/net/dsa/mt7530.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
    index 83436723cb16..4e9aa78ca3d0 100644
    --- a/drivers/net/dsa/mt7530.c
    +++ b/drivers/net/dsa/mt7530.c
    @@ -2667,7 +2667,9 @@ mt7531_setup(struct dsa_switch *ds)
    0);
    }

    - mt7531_setup_common(ds);
    + ret = mt7531_setup_common(ds);
    + if (ret)
    + return ret;

    /* Setup VLAN ID 0 for VLAN-unaware bridges */
    ret = mt7530_setup_vlan0(priv);
    @@ -3020,6 +3022,8 @@ mt753x_setup(struct dsa_switch *ds)
    ret = mt7530_setup_mdio(priv);
    if (ret && priv->irq)
    mt7530_free_irq_common(priv);
    + if (ret)
    + return ret;

    /* Initialise the PCS devices */
    for (i = 0; i < priv->ds->num_ports; i++) {
    --
    2.40.1



    \
     
     \ /
      Last update: 2024-05-27 17:55    [W:5.986 / U:20.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site