lkml.org 
[lkml]   [2015]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy
From
Date
Le 03/10/2015 07:26, Neil Armstrong a écrit :
> When unbinding dsa, complete the dsa_switch_destroy to unregister the
> fixed link phy then cleanly unregister and destroy the net devices.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---

[snip]

> + port_dn = cd->port_dn[port];
> + if (of_phy_is_fixed_link(port_dn)) {
> + phydev = of_phy_find_device(port_dn);
> + if (phydev) {
> + int addr = phydev->addr;
> + phy_device_free(phydev);
> + of_node_put(port_dn);
> + fixed_phy_del(addr);

fixed_phy_del() removes the fixed PHY from the platform fixed MDIO bus
list of PHYs, so we should be okay even with switch drivers which
register a link_update callback via fixed_phy_set_link_update(), but I
have not checked that. The sequence of call looks (phy_device_free then
fixed_phy_del) looks sane though.

Eventually this logic might be better moved into net/dsa/slave.c such
that it is easy to see how it balances dsa_slave_phy_setup().

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian


\
 
 \ /
  Last update: 2015-10-03 22:41    [W:1.221 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site