Skip to contentSkip to conversation

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

PATCH In review keliu 2 participants 2 messages May 27, 2022

Subsystems (3)
lore
Share & tools
lore

keliu

author
#0 lore raw

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

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

---
 drivers/net/phy/fixed_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/fixed_phy.c +2 -2
index c65fb5f5d2dc..63e7922bf257 100644
@@ -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;
 		}
 	}
@@ -250,7 +250,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
 
 	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);
 	}
 
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Le 27/05/2022 à 09:40, keliu a écrit :

Quoted 22 lines

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

---
  drivers/net/phy/fixed_phy.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/fixed_phy.c +1 -1
index c65fb5f5d2dc..63e7922bf257 100644
@@ -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;
  		}
  	}

drivers/net/phy/fixed_phy.c static struct phy_device *__fixed_phy_register(unsigned int irq, · line 256

Quoted 8 lines
drivers/net/phy/fixed_phy.c +1 -1
@@ -250,7 +250,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
 
  	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);
  	}
 

Hi,

You missed ida_simple_get() that shoud become ida_alloc_max() here.

CJ