Commit 5bd5f00c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: connection: remove lock around ida_simple_* functions

ida_simple_* has a built-in spinlock, no need to grab another lock when
accessing it.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent 6b17492e
......@@ -63,9 +63,7 @@ static bool gb_connection_hd_cport_id_alloc(struct gb_connection *connection)
struct ida *ida = &connection->hd->cport_id_map;
int id;
spin_lock_irq(&gb_connections_lock);
id = ida_simple_get(ida, 0, HOST_DEV_CPORT_ID_MAX, GFP_ATOMIC);
spin_unlock_irq(&gb_connections_lock);
if (id < 0)
return false;
......@@ -81,9 +79,7 @@ static void gb_connection_hd_cport_id_free(struct gb_connection *connection)
{
struct ida *ida = &connection->hd->cport_id_map;
spin_lock_irq(&gb_connections_lock);
ida_simple_remove(ida, connection->hd_cport_id);
spin_unlock_irq(&gb_connections_lock);
connection->hd_cport_id = CPORT_ID_BAD;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment