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

Configure Feed

Select the types of activity you want to include in your feed.

most: remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Link: https://lkml.kernel.org/r/ddbb2e3f249ba90417dc7ab01713faa1091fb44c.1717855701.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alistar Popple <alistair@popple.id.au>
Cc: Christian Gromm <christian.gromm@microchip.com>
Cc: Eddie James <eajames@linux.ibm.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christophe JAILLET and committed by
Andrew Morton
b737a221 08ab0915

+8 -8
+5 -5
drivers/most/core.c
··· 1286 1286 !iface->poison_channel || (iface->num_channels > MAX_CHANNELS)) 1287 1287 return -EINVAL; 1288 1288 1289 - id = ida_simple_get(&mdev_id, 0, 0, GFP_KERNEL); 1289 + id = ida_alloc(&mdev_id, GFP_KERNEL); 1290 1290 if (id < 0) { 1291 1291 dev_err(iface->dev, "Failed to allocate device ID\n"); 1292 1292 return id; ··· 1294 1294 1295 1295 iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL); 1296 1296 if (!iface->p) { 1297 - ida_simple_remove(&mdev_id, id); 1297 + ida_free(&mdev_id, id); 1298 1298 return -ENOMEM; 1299 1299 } 1300 1300 ··· 1308 1308 dev_err(iface->dev, "Failed to register interface device\n"); 1309 1309 kfree(iface->p); 1310 1310 put_device(iface->dev); 1311 - ida_simple_remove(&mdev_id, id); 1311 + ida_free(&mdev_id, id); 1312 1312 return -ENOMEM; 1313 1313 } 1314 1314 ··· 1366 1366 } 1367 1367 kfree(iface->p); 1368 1368 device_unregister(iface->dev); 1369 - ida_simple_remove(&mdev_id, id); 1369 + ida_free(&mdev_id, id); 1370 1370 return -ENOMEM; 1371 1371 } 1372 1372 EXPORT_SYMBOL_GPL(most_register_interface); ··· 1397 1397 device_unregister(&c->dev); 1398 1398 } 1399 1399 1400 - ida_simple_remove(&mdev_id, iface->p->dev_id); 1400 + ida_free(&mdev_id, iface->p->dev_id); 1401 1401 kfree(iface->p); 1402 1402 device_unregister(iface->dev); 1403 1403 }
+3 -3
drivers/most/most_cdev.c
··· 100 100 101 101 static void destroy_channel(struct comp_channel *c) 102 102 { 103 - ida_simple_remove(&comp.minor_id, MINOR(c->devno)); 103 + ida_free(&comp.minor_id, MINOR(c->devno)); 104 104 kfifo_free(&c->fifo); 105 105 kfree(c); 106 106 } ··· 425 425 if (c) 426 426 return -EEXIST; 427 427 428 - current_minor = ida_simple_get(&comp.minor_id, 0, 0, GFP_KERNEL); 428 + current_minor = ida_alloc(&comp.minor_id, GFP_KERNEL); 429 429 if (current_minor < 0) 430 430 return current_minor; 431 431 ··· 472 472 err_free_c: 473 473 kfree(c); 474 474 err_remove_ida: 475 - ida_simple_remove(&comp.minor_id, current_minor); 475 + ida_free(&comp.minor_id, current_minor); 476 476 return retval; 477 477 } 478 478