]> git.baikalelectronics.ru Git - kernel.git/commit
amd-xgbe: Perform phy connect/disconnect at dev open/stop
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Tue, 5 Aug 2014 18:30:44 +0000 (13:30 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Aug 2014 23:47:02 +0000 (16:47 -0700)
commit5f2fbda9e659d48d3455cc95221cc0b1186eeb04
tree19519ab7ec4444ccdd97e05b22a126ee6f511985
parentd87c8292be227f439e25ad6f3a0d5793ac1b6839
amd-xgbe: Perform phy connect/disconnect at dev open/stop

A change added to the mdiobus/phy api added a module_get/module_put
during phy connect/disconnect processing. Currently, the driver
performs a phy connect during module probe and a phy disconnect during
module remove. With the addition of the module_get during phy connect
the amd-xgbe module use count is incremented and can no longer be
unloaded.

Move the phy connect/disconnect from the driver probe/remove functions
to the net_device_ops ndo_open/ndo_stop functions.  This allows the
module use count to be decremented when the device(s) are brought down
and allows the module to be unloaded.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c