Skip to content

Commit 718fbfa

Browse files
keliugroeck
authored andcommitted
hwmon: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu <liuke94@huawei.com> Link: https://lore.kernel.org/r/20220517063126.2142637-1-liuke94@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 5b4285c commit 718fbfa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/hwmon/hwmon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
764764
"hwmon: '%s' is not a valid name attribute, please fix\n",
765765
name);
766766

767-
id = ida_simple_get(&hwmon_ida, 0, 0, GFP_KERNEL);
767+
id = ida_alloc(&hwmon_ida, GFP_KERNEL);
768768
if (id < 0)
769769
return ERR_PTR(id);
770770

@@ -856,7 +856,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
856856
free_hwmon:
857857
hwmon_dev_release(hdev);
858858
ida_remove:
859-
ida_simple_remove(&hwmon_ida, id);
859+
ida_free(&hwmon_ida, id);
860860
return ERR_PTR(err);
861861
}
862862

@@ -968,7 +968,7 @@ void hwmon_device_unregister(struct device *dev)
968968

969969
if (likely(sscanf(dev_name(dev), HWMON_ID_FORMAT, &id) == 1)) {
970970
device_unregister(dev);
971-
ida_simple_remove(&hwmon_ida, id);
971+
ida_free(&hwmon_ida, id);
972972
} else
973973
dev_dbg(dev->parent,
974974
"hwmon_device_unregister() failed: bad class ID!\n");

0 commit comments

Comments
 (0)