Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'thermal-core'

Merge changes that make the thermal core use ida_alloc()/free()
directly instead of ida_simple_get()/ida_simple_remove() that have been
deprecated.

* thermal-core:
thermal: Directly use ida_alloc()/free()

+9 -9
+9 -9
drivers/thermal/thermal_core.c
··· 667 667 dev->target = THERMAL_NO_TARGET; 668 668 dev->weight = weight; 669 669 670 - result = ida_simple_get(&tz->ida, 0, 0, GFP_KERNEL); 670 + result = ida_alloc(&tz->ida, GFP_KERNEL); 671 671 if (result < 0) 672 672 goto free_mem; 673 673 ··· 721 721 remove_symbol_link: 722 722 sysfs_remove_link(&tz->device.kobj, dev->name); 723 723 release_ida: 724 - ida_simple_remove(&tz->ida, dev->id); 724 + ida_free(&tz->ida, dev->id); 725 725 free_mem: 726 726 kfree(dev); 727 727 return result; ··· 768 768 device_remove_file(&tz->device, &pos->weight_attr); 769 769 device_remove_file(&tz->device, &pos->attr); 770 770 sysfs_remove_link(&tz->device.kobj, pos->name); 771 - ida_simple_remove(&tz->ida, pos->id); 771 + ida_free(&tz->ida, pos->id); 772 772 kfree(pos); 773 773 return 0; 774 774 } ··· 901 901 if (!cdev) 902 902 return ERR_PTR(-ENOMEM); 903 903 904 - ret = ida_simple_get(&thermal_cdev_ida, 0, 0, GFP_KERNEL); 904 + ret = ida_alloc(&thermal_cdev_ida, GFP_KERNEL); 905 905 if (ret < 0) 906 906 goto out_kfree_cdev; 907 907 cdev->id = ret; ··· 952 952 put_device(&cdev->device); 953 953 cdev = NULL; 954 954 out_ida_remove: 955 - ida_simple_remove(&thermal_cdev_ida, id); 955 + ida_free(&thermal_cdev_ida, id); 956 956 out_kfree_cdev: 957 957 kfree(cdev); 958 958 return ERR_PTR(ret); ··· 1111 1111 1112 1112 mutex_unlock(&thermal_list_lock); 1113 1113 1114 - ida_simple_remove(&thermal_cdev_ida, cdev->id); 1114 + ida_free(&thermal_cdev_ida, cdev->id); 1115 1115 device_del(&cdev->device); 1116 1116 thermal_cooling_device_destroy_sysfs(cdev); 1117 1117 kfree(cdev->type); ··· 1228 1228 INIT_LIST_HEAD(&tz->thermal_instances); 1229 1229 ida_init(&tz->ida); 1230 1230 mutex_init(&tz->lock); 1231 - id = ida_simple_get(&thermal_tz_ida, 0, 0, GFP_KERNEL); 1231 + id = ida_alloc(&thermal_tz_ida, GFP_KERNEL); 1232 1232 if (id < 0) { 1233 1233 result = id; 1234 1234 goto free_tz; ··· 1319 1319 put_device(&tz->device); 1320 1320 tz = NULL; 1321 1321 remove_id: 1322 - ida_simple_remove(&thermal_tz_ida, id); 1322 + ida_free(&thermal_tz_ida, id); 1323 1323 free_tz: 1324 1324 kfree(tz); 1325 1325 return ERR_PTR(result); ··· 1379 1379 thermal_set_governor(tz, NULL); 1380 1380 1381 1381 thermal_remove_hwmon_sysfs(tz); 1382 - ida_simple_remove(&thermal_tz_ida, tz->id); 1382 + ida_free(&thermal_tz_ida, tz->id); 1383 1383 ida_destroy(&tz->ida); 1384 1384 mutex_destroy(&tz->lock); 1385 1385 device_unregister(&tz->device);