summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2022-06-28 14:29:51 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2022-06-28 14:29:51 +1000
commit44a0cad9d329369ff5f704d4bc9d9d27af5fa3fa (patch)
tree92a291470c9a0c2c3a3f0b0b70898c1060aa8da9
parent822e04241e85619e6cb1d2a7cfd2cf23390fd27b (diff)
parentc0c725d7350ec8b8453257676a440bb4b2df2422 (diff)
downloadlinux-next-44a0cad9d329369ff5f704d4bc9d9d27af5fa3fa.tar.gz
linux-next-44a0cad9d329369ff5f704d4bc9d9d27af5fa3fa.zip
Merge branch 'gnss-next' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
-rw-r--r--drivers/gnss/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c
index e6f94501cb28..1e82b7967570 100644
--- a/drivers/gnss/core.c
+++ b/drivers/gnss/core.c
@@ -217,7 +217,7 @@ static void gnss_device_release(struct device *dev)
kfree(gdev->write_buf);
kfifo_free(&gdev->read_fifo);
- ida_simple_remove(&gnss_minors, gdev->id);
+ ida_free(&gnss_minors, gdev->id);
kfree(gdev);
}
@@ -232,7 +232,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent)
if (!gdev)
return NULL;
- id = ida_simple_get(&gnss_minors, 0, GNSS_MINORS, GFP_KERNEL);
+ id = ida_alloc_max(&gnss_minors, GNSS_MINORS - 1, GFP_KERNEL);
if (id < 0) {
kfree(gdev);
return NULL;