From 6b029336d93d8f9a94b0256b1f7d9c1768eedba7 Mon Sep 17 00:00:00 2001 From: Surendra Patil Date: Mon, 3 Mar 2014 23:57:47 -0800 Subject: drivers:staging:ozwpan Replaced wrapper functions with actual spin lock function * Replaced all the spin lock/unlock wrappers from oz_polling_lock_bh() and oz_polllin_unlock_bh() with spin_lock_bh(&g_polling_lock) and spin_unlock_bh(&g_polling_lock).Completely erased the wrappers defination and declaration. * declared g_polling_lock as global variable in header file and added comments to it. Module builded successfully with sparse without warnings. Signed-off-by: Surendra Patil Acked-by: Rupesh Gujare Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ozwpan/ozpd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers/staging/ozwpan/ozpd.c') diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c index 7436950..29a23a3 100644 --- a/drivers/staging/ozwpan/ozpd.c +++ b/drivers/staging/ozwpan/ozpd.c @@ -284,11 +284,11 @@ int oz_services_start(struct oz_pd *pd, u16 apps, int resume) ai->app_id); break; } - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); pd->total_apps |= (1<app_id); if (resume) pd->paused_apps &= ~(1<app_id); - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); } } return rc; @@ -304,14 +304,14 @@ void oz_services_stop(struct oz_pd *pd, u16 apps, int pause) oz_pd_dbg(pd, ON, "%s: (0x%x) pause(%d)\n", __func__, apps, pause); for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { if (apps & (1<app_id)) { - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); if (pause) { pd->paused_apps |= (1<app_id); } else { pd->total_apps &= ~(1<app_id); pd->paused_apps &= ~(1<app_id); } - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); ai->stop(pd, pause); } } @@ -349,17 +349,17 @@ void oz_pd_stop(struct oz_pd *pd) oz_dbg(ON, "oz_pd_stop() State = 0x%x\n", pd->state); oz_pd_indicate_farewells(pd); - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); stop_apps = pd->total_apps; pd->total_apps = 0; pd->paused_apps = 0; - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); oz_services_stop(pd, stop_apps, 0); - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); oz_pd_set_state(pd, OZ_PD_S_STOPPED); /* Remove from PD list.*/ list_del(&pd->link); - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); oz_dbg(ON, "pd ref count = %d\n", atomic_read(&pd->ref_count)); oz_pd_put(pd); } @@ -372,9 +372,9 @@ int oz_pd_sleep(struct oz_pd *pd) int do_stop = 0; u16 stop_apps; - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); if (pd->state & (OZ_PD_S_SLEEP | OZ_PD_S_STOPPED)) { - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); return 0; } if (pd->keep_alive && pd->session_id) @@ -383,7 +383,7 @@ int oz_pd_sleep(struct oz_pd *pd) do_stop = 1; stop_apps = pd->total_apps; - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); if (do_stop) { oz_pd_stop(pd); } else { @@ -999,15 +999,15 @@ void oz_pd_indicate_farewells(struct oz_pd *pd) const struct oz_app_if *ai = &g_app_if[OZ_APPID_USB-1]; while (1) { - oz_polling_lock_bh(); + spin_lock_bh(&g_polling_lock); if (list_empty(&pd->farewell_list)) { - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); break; } f = list_first_entry(&pd->farewell_list, struct oz_farewell, link); list_del(&f->link); - oz_polling_unlock_bh(); + spin_unlock_bh(&g_polling_lock); if (ai->farewell) ai->farewell(pd, f->ep_num, f->report, f->len); kfree(f); -- cgit v1.1