summaryrefslogtreecommitdiff
path: root/drivers/most/core.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-06-08 16:34:19 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-06-24 22:25:08 -0700
commitb737a221702c7b6080a72ab671eac938f4768318 (patch)
tree4145b4ad1a24de51fcb77666f8191e8f56859c75 /drivers/most/core.c
parent08ab0915831d454ecf220c14df5dea35933468e7 (diff)
downloadlwn-b737a221702c7b6080a72ab671eac938f4768318.tar.gz
lwn-b737a221702c7b6080a72ab671eac938f4768318.zip
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>
Diffstat (limited to 'drivers/most/core.c')
-rw-r--r--drivers/most/core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/most/core.c b/drivers/most/core.c
index f13d0e14a48b..10342e8801bf 100644
--- a/drivers/most/core.c
+++ b/drivers/most/core.c
@@ -1286,7 +1286,7 @@ int most_register_interface(struct most_interface *iface)
!iface->poison_channel || (iface->num_channels > MAX_CHANNELS))
return -EINVAL;
- id = ida_simple_get(&mdev_id, 0, 0, GFP_KERNEL);
+ id = ida_alloc(&mdev_id, GFP_KERNEL);
if (id < 0) {
dev_err(iface->dev, "Failed to allocate device ID\n");
return id;
@@ -1294,7 +1294,7 @@ int most_register_interface(struct most_interface *iface)
iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL);
if (!iface->p) {
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
@@ -1308,7 +1308,7 @@ int most_register_interface(struct most_interface *iface)
dev_err(iface->dev, "Failed to register interface device\n");
kfree(iface->p);
put_device(iface->dev);
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
@@ -1366,7 +1366,7 @@ err_free_resources:
}
kfree(iface->p);
device_unregister(iface->dev);
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
EXPORT_SYMBOL_GPL(most_register_interface);
@@ -1397,7 +1397,7 @@ void most_deregister_interface(struct most_interface *iface)
device_unregister(&c->dev);
}
- ida_simple_remove(&mdev_id, iface->p->dev_id);
+ ida_free(&mdev_id, iface->p->dev_id);
kfree(iface->p);
device_unregister(iface->dev);
}