pps: remove usage of the deprecated ida_simple_xx() API

[ Upstream commit 55dbc5b5174d0e7d1fa397d05aa4cb145e8b887e ]

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/9f681747d446b874952a892491387d79ffe565a9.1713089394.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 62c5a01a5711 ("pps: add an error check in parport_attach")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Christophe JAILLET 2024-04-14 12:10:17 +02:00 committed by Ksawlii
parent 784d9ba932
commit f0af490213

View file

@ -144,7 +144,7 @@ static void parport_attach(struct parport *port)
return; return;
} }
index = ida_simple_get(&pps_client_index, 0, 0, GFP_KERNEL); index = ida_alloc(&pps_client_index, GFP_KERNEL);
memset(&pps_client_cb, 0, sizeof(pps_client_cb)); memset(&pps_client_cb, 0, sizeof(pps_client_cb));
pps_client_cb.private = device; pps_client_cb.private = device;
pps_client_cb.irq_func = parport_irq; pps_client_cb.irq_func = parport_irq;
@ -184,7 +184,7 @@ err_release_dev:
err_unregister_dev: err_unregister_dev:
parport_unregister_device(device->pardev); parport_unregister_device(device->pardev);
err_free: err_free:
ida_simple_remove(&pps_client_index, index); ida_free(&pps_client_index, index);
kfree(device); kfree(device);
} }
@ -204,7 +204,7 @@ static void parport_detach(struct parport *port)
pps_unregister_source(device->pps); pps_unregister_source(device->pps);
parport_release(pardev); parport_release(pardev);
parport_unregister_device(pardev); parport_unregister_device(pardev);
ida_simple_remove(&pps_client_index, device->index); ida_free(&pps_client_index, device->index);
kfree(device); kfree(device);
} }