diff options
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-i2c-core.c')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-i2c-core.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c index d7e9ffabb..b45463a2d 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c +++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-core.c,v 1.4 2006/01/22 03:51:19 mcisely Exp $ + * $Id: pvrusb2-i2c-core.c,v 1.5 2006/01/23 06:58:06 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -334,15 +334,15 @@ int pvr2_i2c_core_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg) if (!hdw) return stat; - down(&hdw->i2c_list_lock); + mutex_lock(&hdw->i2c_list_lock); list_for_each_safe(item,nc,&hdw->i2c_clients) { cp = list_entry(item,struct pvr2_i2c_client,list); if (!cp->recv_enable) continue; - up(&hdw->i2c_list_lock); + mutex_unlock(&hdw->i2c_list_lock); stat = pvr2_i2c_client_cmd(cp,cmd,arg); - down(&hdw->i2c_list_lock); + mutex_lock(&hdw->i2c_list_lock); } - up(&hdw->i2c_list_lock); + mutex_unlock(&hdw->i2c_list_lock); return stat; } @@ -368,7 +368,7 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw) if (!(hdw->i2c_pend_types & PVR2_I2C_PEND_ALL)) { return; } - down(&hdw->i2c_list_lock); do { + mutex_lock(&hdw->i2c_list_lock); do { pvr2_trace(PVR2_TRACE_I2C_CORE,"i2c: core_sync BEGIN"); if (hdw->i2c_pend_types & PVR2_I2C_PEND_DETECT) { /* One or more I2C clients have attached since we @@ -448,10 +448,10 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw) if (!cp->handler->func_table->update) continue; pvr2_trace(PVR2_TRACE_I2C_CORE, "i2c: cp=%p update",cp); - up(&hdw->i2c_list_lock); + mutex_unlock(&hdw->i2c_list_lock); cp->handler->func_table->update( cp->handler->func_data); - down(&hdw->i2c_list_lock); + mutex_lock(&hdw->i2c_list_lock); /* If client's update function set some additional pending bits, account for that here. */ @@ -488,13 +488,13 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw) } opf = pvr2_i2c_get_op(idx); if (!opf) continue; - up(&hdw->i2c_list_lock); + mutex_unlock(&hdw->i2c_list_lock); opf->update(hdw); - down(&hdw->i2c_list_lock); + mutex_lock(&hdw->i2c_list_lock); } } pvr2_trace(PVR2_TRACE_I2C_CORE,"i2c: core_sync END"); - } while (0); up(&hdw->i2c_list_lock); + } while (0); mutex_unlock(&hdw->i2c_list_lock); } int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw) @@ -528,11 +528,11 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw) } if (pt) { - down(&hdw->i2c_list_lock); do { + mutex_lock(&hdw->i2c_list_lock); do { hdw->i2c_pend_types |= pt; hdw->i2c_stale_mask |= sm; hdw->i2c_pend_mask |= hdw->i2c_stale_mask; - } while (0); up(&hdw->i2c_list_lock); + } while (0); mutex_unlock(&hdw->i2c_list_lock); } pvr2_trace(PVR2_TRACE_I2C_CORE, @@ -616,7 +616,7 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *hdw, struct list_head *item; struct pvr2_i2c_client *cp; ccnt = 0; - down(&hdw->i2c_list_lock); do { + mutex_lock(&hdw->i2c_list_lock); do { list_for_each(item,&hdw->i2c_clients) { cp = list_entry(item,struct pvr2_i2c_client,list); bcnt = pvr2_i2c_client_describe( @@ -628,7 +628,7 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *hdw, bcnt = scnprintf(buf,maxlen,"\n"); ccnt += bcnt; buf += bcnt; maxlen -= bcnt; } - } while (0); up(&hdw->i2c_list_lock); + } while (0); mutex_unlock(&hdw->i2c_list_lock); return ccnt; } @@ -645,10 +645,10 @@ static int pvr2_i2c_attach_inform(struct i2c_client *client) memset(cp,0,sizeof(*cp)); INIT_LIST_HEAD(&cp->list); cp->client = client; - down(&hdw->i2c_list_lock); do { + mutex_lock(&hdw->i2c_list_lock); do { list_add_tail(&cp->list,&hdw->i2c_clients); hdw->i2c_pend_types |= PVR2_I2C_PEND_DETECT; - } while (0); up(&hdw->i2c_list_lock); + } while (0); mutex_unlock(&hdw->i2c_list_lock); if (fl) pvr2_hdw_poll_trigger_unlocked(hdw); return 0; } @@ -660,7 +660,7 @@ static int pvr2_i2c_detach_inform(struct i2c_client *client) struct list_head *item,*nc; unsigned long amask = 0; int foundfl = 0; - down(&hdw->i2c_list_lock); do { + mutex_lock(&hdw->i2c_list_lock); do { list_for_each_safe(item,nc,&hdw->i2c_clients) { cp = list_entry(item,struct pvr2_i2c_client,list); if (cp->client == client) { @@ -681,7 +681,7 @@ static int pvr2_i2c_detach_inform(struct i2c_client *client) amask |= cp->ctl_mask; } hdw->i2c_active_mask = amask; - } while (0); up(&hdw->i2c_list_lock); + } while (0); mutex_unlock(&hdw->i2c_list_lock); if (!foundfl) { trace_i2c("pvr2_i2c_detach [client=%s @ 0x%x ctxt=<unknown>]", client->name, @@ -744,7 +744,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw) hdw->i2c_stale_mask = 0; hdw->i2c_active_mask = 0; INIT_LIST_HEAD(&hdw->i2c_clients); - init_MUTEX(&hdw->i2c_list_lock); + mutex_init(&hdw->i2c_list_lock); hdw->i2c_linked = !0; i2c_add_adapter(&hdw->i2c_adap); if (i2c_scan) do_i2c_scan(hdw); |