diff options
author | Ke Liu <liuke94@huawei.com> | 2022-05-28 04:54:37 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-28 12:40:09 +0100 |
commit | 2f1de254a25bee55600287e2eb2cc12ea389c129 (patch) | |
tree | 43fcafc78ece3ea52453adc015cbb79aa9ca0b59 /drivers/net | |
parent | e225c9a5a74b12e9ef8516f30a3db2c7eb866ee1 (diff) |
net: phy: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove().
Signed-off-by: Ke Liu <liuke94@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/fixed_phy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index c65fb5f5d2dc..03abe6233bbb 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -180,7 +180,7 @@ static void fixed_phy_del(int phy_addr) if (fp->link_gpiod) gpiod_put(fp->link_gpiod); kfree(fp); - ida_simple_remove(&phy_fixed_ida, phy_addr); + ida_free(&phy_fixed_ida, phy_addr); return; } } @@ -244,13 +244,13 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, } /* Get the next available PHY address, up to PHY_MAX_ADDR */ - phy_addr = ida_simple_get(&phy_fixed_ida, 0, PHY_MAX_ADDR, GFP_KERNEL); + phy_addr = ida_alloc_max(&phy_fixed_ida, PHY_MAX_ADDR - 1, GFP_KERNEL); if (phy_addr < 0) return ERR_PTR(phy_addr); ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod); if (ret < 0) { - ida_simple_remove(&phy_fixed_ida, phy_addr); + ida_free(&phy_fixed_ida, phy_addr); return ERR_PTR(ret); } |