lkml.org 
[lkml]   [2021]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC net-next PATCH 04/16] net: phylink: Move phylink_set_pcs before phylink_create
    Date
    The new pcs-related functions in the next few commits fit better before
    phylink_create, so move phylink_set_pcs in preparation. No functional
    change intended.

    Signed-off-by: Sean Anderson <sean.anderson@seco.com>
    ---

    drivers/net/phy/phylink.c | 42 +++++++++++++++++++--------------------
    1 file changed, 21 insertions(+), 21 deletions(-)

    diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
    index 5a58c77d0002..6387c40c5592 100644
    --- a/drivers/net/phy/phylink.c
    +++ b/drivers/net/phy/phylink.c
    @@ -795,6 +795,27 @@ static int phylink_register_sfp(struct phylink *pl,
    return ret;
    }

    +/**
    + * phylink_set_pcs() - set the current PCS for phylink to use
    + * @pl: a pointer to a &struct phylink returned from phylink_create()
    + * @pcs: a pointer to the &struct phylink_pcs
    + *
    + * Bind the MAC PCS to phylink. This may be called after phylink_create(),
    + * in mac_prepare() or mac_config() methods if it is desired to dynamically
    + * change the PCS.
    + *
    + * Please note that there are behavioural changes with the mac_config()
    + * callback if a PCS is present (denoting a newer setup) so removing a PCS
    + * is not supported, and if a PCS is going to be used, it must be registered
    + * by calling phylink_set_pcs() at the latest in the first mac_config() call.
    + */
    +void phylink_set_pcs(struct phylink *pl, struct phylink_pcs *pcs)
    +{
    + pl->pcs = pcs;
    + pl->pcs_ops = pcs->ops;
    +}
    +EXPORT_SYMBOL_GPL(phylink_set_pcs);
    +
    /**
    * phylink_create() - create a phylink instance
    * @config: a pointer to the target &struct phylink_config
    @@ -881,27 +902,6 @@ struct phylink *phylink_create(struct phylink_config *config,
    }
    EXPORT_SYMBOL_GPL(phylink_create);

    -/**
    - * phylink_set_pcs() - set the current PCS for phylink to use
    - * @pl: a pointer to a &struct phylink returned from phylink_create()
    - * @pcs: a pointer to the &struct phylink_pcs
    - *
    - * Bind the MAC PCS to phylink. This may be called after phylink_create(),
    - * in mac_prepare() or mac_config() methods if it is desired to dynamically
    - * change the PCS.
    - *
    - * Please note that there are behavioural changes with the mac_config()
    - * callback if a PCS is present (denoting a newer setup) so removing a PCS
    - * is not supported, and if a PCS is going to be used, it must be registered
    - * by calling phylink_set_pcs() at the latest in the first mac_config() call.
    - */
    -void phylink_set_pcs(struct phylink *pl, struct phylink_pcs *pcs)
    -{
    - pl->pcs = pcs;
    - pl->pcs_ops = pcs->ops;
    -}
    -EXPORT_SYMBOL_GPL(phylink_set_pcs);
    -
    /**
    * phylink_destroy() - cleanup and destroy the phylink instance
    * @pl: a pointer to a &struct phylink returned from phylink_create()
    --
    2.25.1
    \
     
     \ /
      Last update: 2021-10-04 21:17    [W:4.117 / U:0.212 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site