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

scsi: core: bsg: Remove usage of the deprecated ida_simple_xxx() API

Use ida_alloc_xxx()/ida_free() instead of
ida_simple_get()/ida_simple_remove().

The latter is deprecated and more verbose.

Link: https://lore.kernel.org/r/20220617020430.2300-1-liubo03@inspur.com
Signed-off-by: Bo Liu <liubo03@inspur.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bo Liu and committed by
Martin K. Petersen
873cdda1 6e637b72

+2 -2
+2 -2
block/bsg.c
··· 169 169 { 170 170 struct bsg_device *bd = container_of(dev, struct bsg_device, device); 171 171 172 - ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt)); 172 + ida_free(&bsg_minor_ida, MINOR(bd->device.devt)); 173 173 kfree(bd); 174 174 } 175 175 ··· 196 196 bd->queue = q; 197 197 bd->sg_io_fn = sg_io_fn; 198 198 199 - ret = ida_simple_get(&bsg_minor_ida, 0, BSG_MAX_DEVS, GFP_KERNEL); 199 + ret = ida_alloc_max(&bsg_minor_ida, BSG_MAX_DEVS - 1, GFP_KERNEL); 200 200 if (ret < 0) { 201 201 if (ret == -ENOSPC) 202 202 dev_err(parent, "bsg: too many bsg devices\n");