History

net: phy: Directly use ida_alloc()/free()

Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove().

Ke Liu committed 4 years ago

Commit 2f1de251 parent e225c9a1 file · +3 −3Browse files

Unified · Split

drivers/net/phy/fixed_phy.c+3−3
@@ -180,7 +180,7 @@ static void fixed_phy_del(int phy_addr) · 179 unmodified lines
180180 if (fp->link_gpiod)
181181 gpiod_put(fp->link_gpiod);
182182 kfree(fp);
183− ida_simple_remove(&phy_fixed_ida, phy_addr);
183+ ida_free(&phy_fixed_ida, phy_addr);
184184 return;
185185 }
186186 }
@@ -244,13 +244,13 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, · 57 unmodified lines
244244 }
245245
246246 /* 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);
248248 if (phy_addr < 0)
249249 return ERR_PTR(phy_addr);
250250
251251 ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod);
252252 if (ret < 0) {
253− ida_simple_remove(&phy_fixed_ida, phy_addr);
253+ ida_free(&phy_fixed_ida, phy_addr);
254254 return ERR_PTR(ret);
255255 }
256256

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t