Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove().
Unified · Split
| @@ -180,7 +180,7 @@ static void fixed_phy_del(int phy_addr) · 179 unmodified lines | ||
| 180 | 180 | if (fp->link_gpiod) |
| 181 | 181 | gpiod_put(fp->link_gpiod); |
| 182 | 182 | kfree(fp); |
| 183 | − ida_simple_remove(&phy_fixed_ida, phy_addr); | |
| 183 | + ida_free(&phy_fixed_ida, phy_addr); | |
| 184 | 184 | return; |
| 185 | 185 | } |
| 186 | 186 | } |
| @@ -244,13 +244,13 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, · 57 unmodified lines | ||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /* Get the next available PHY address, up to PHY_MAX_ADDR */ |
| 247 | − phy_addr = ida_simple_get(&phy_fixed_ida, 0, PHY_MAX_ADDR, GFP_KERNEL); | |
| 247 | + phy_addr = ida_alloc_max(&phy_fixed_ida, PHY_MAX_ADDR - 1, GFP_KERNEL); | |
| 248 | 248 | if (phy_addr < 0) |
| 249 | 249 | return ERR_PTR(phy_addr); |
| 250 | 250 | |
| 251 | 251 | ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod); |
| 252 | 252 | if (ret < 0) { |
| 253 | − ida_simple_remove(&phy_fixed_ida, phy_addr); | |
| 253 | + ida_free(&phy_fixed_ida, phy_addr); | |
| 254 | 254 | return ERR_PTR(ret); |
| 255 | 255 | } |
| 256 | 256 | |