]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: Manage fixed PHY address space using IDA
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 24 Jun 2016 23:25:24 +0000 (16:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2016 07:51:40 +0000 (03:51 -0400)
commit14ad8ed92a76037718f803a5eedea85cbda0d346
tree765e38a7aa3f81cdf02fd0750e810e729ecfa084
parent2f4839b993aaef4fccf3bf7fa5cdce3f610becaa
net: phy: Manage fixed PHY address space using IDA

If we have a system which uses fixed PHY devices and calls
fixed_phy_register() then fixed_phy_unregister() we can exhaust the
number of fixed PHYs available after a while, since we keep incrementing
the variable phy_fixed_addr, but we never decrement it.

This patch fixes that by converting the fixed PHY allocation to using
IDA, which takes care of the allocation/dealloaction of the PHY
addresses for us.

Fixes: 3909f01dc2f5 ("net: phy: extend fixed driver with fixed_phy_register()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/fixed_phy.c