mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 19:43:43 -04:00
media: rc: Directly use ida_free()
Use ida_alloc() and ida_free() instead of the deprecated ida_simple_get() and ida_simple_remove(). Signed-off-by: keliu <liuke94@huawei.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
07456325a3
commit
cd54ff9380
@@ -715,7 +715,7 @@ int lirc_register(struct rc_dev *dev)
|
||||
const char *rx_type, *tx_type;
|
||||
int err, minor;
|
||||
|
||||
minor = ida_simple_get(&lirc_ida, 0, RC_DEV_MAX, GFP_KERNEL);
|
||||
minor = ida_alloc_max(&lirc_ida, RC_DEV_MAX - 1, GFP_KERNEL);
|
||||
if (minor < 0)
|
||||
return minor;
|
||||
|
||||
@@ -760,7 +760,7 @@ int lirc_register(struct rc_dev *dev)
|
||||
return 0;
|
||||
|
||||
out_ida:
|
||||
ida_simple_remove(&lirc_ida, minor);
|
||||
ida_free(&lirc_ida, minor);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -778,7 +778,7 @@ void lirc_unregister(struct rc_dev *dev)
|
||||
spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
|
||||
|
||||
cdev_device_del(&dev->lirc_cdev, &dev->lirc_dev);
|
||||
ida_simple_remove(&lirc_ida, MINOR(dev->lirc_dev.devt));
|
||||
ida_free(&lirc_ida, MINOR(dev->lirc_dev.devt));
|
||||
}
|
||||
|
||||
int __init lirc_dev_init(void)
|
||||
|
||||
Reference in New Issue
Block a user