staging: vc04_services: Drop g_once_init global variable
g_once_init is not used in a meaningful way anywhere. Drop it along with connected_init() which sets it. Suggested-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org/r/20240412075743.60712-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e0279bb86b
commit
e82b22539a
@@ -11,16 +11,8 @@
|
||||
static int g_connected;
|
||||
static int g_num_deferred_callbacks;
|
||||
static void (*g_deferred_callback[MAX_CALLBACKS])(void);
|
||||
static int g_once_init;
|
||||
static DEFINE_MUTEX(g_connected_mutex);
|
||||
|
||||
/* Function to initialize our lock */
|
||||
static void connected_init(void)
|
||||
{
|
||||
if (!g_once_init)
|
||||
g_once_init = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is used to defer initialization until the vchiq stack is
|
||||
* initialized. If the stack is already initialized, then the callback will
|
||||
@@ -29,8 +21,6 @@ static void connected_init(void)
|
||||
*/
|
||||
void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void))
|
||||
{
|
||||
connected_init();
|
||||
|
||||
if (mutex_lock_killable(&g_connected_mutex))
|
||||
return;
|
||||
|
||||
@@ -60,8 +50,6 @@ void vchiq_call_connected_callbacks(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
connected_init();
|
||||
|
||||
if (mutex_lock_killable(&g_connected_mutex))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user