]> git.itanic.dy.fi Git - linux-stable/commitdiff
ppdev: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 19 Dec 2023 05:01:47 +0000 (06:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jan 2024 15:43:20 +0000 (16:43 +0100)
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/ba9da12fdd5cdb2c28180b7160af5042447d803f.1702962092.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ppdev.c

index 4c188e9e477cdfebec5fa237e0c30fe6e1289ef9..ee951b265213fbb3bf5519ad4b1b02efd0e0fb5b 100644 (file)
@@ -299,7 +299,7 @@ static int register_device(int minor, struct pp_struct *pp)
                goto err;
        }
 
-       index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
+       index = ida_alloc(&ida_index, GFP_KERNEL);
        memset(&ppdev_cb, 0, sizeof(ppdev_cb));
        ppdev_cb.irq_func = pp_irq;
        ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
@@ -310,7 +310,7 @@ static int register_device(int minor, struct pp_struct *pp)
        if (!pdev) {
                pr_warn("%s: failed to register device!\n", name);
                rc = -ENXIO;
-               ida_simple_remove(&ida_index, index);
+               ida_free(&ida_index, index);
                goto err;
        }
 
@@ -750,7 +750,7 @@ static int pp_release(struct inode *inode, struct file *file)
 
        if (pp->pdev) {
                parport_unregister_device(pp->pdev);
-               ida_simple_remove(&ida_index, pp->index);
+               ida_free(&ida_index, pp->index);
                pp->pdev = NULL;
                pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
        }