Changeset 5571

Show
Ignore:
Timestamp:
12/15/08 14:29:18 (4 years ago)
Author:
khali
Message:

Rename adapter locking and unlocking macros to match what upstream
has.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/kernel/i2c-core.c

    r5570 r5571  
    3636/* ----- global defines ---------------------------------------------------- */ 
    3737 
    38 #define I2C_LOCK_LIST(adap) down(&adap->lock) 
    39 #define I2C_UNLOCK_LIST(adap) up(&adap->lock) 
     38/* exclusive access to the bus */ 
     39#define I2C_LOCK(adap) down(&adap->lock) 
     40#define I2C_UNLOCK(adap) up(&adap->lock)  
    4041 
    4142#define DEB(x) if (i2c_debug>=1) x; 
     
    314315        int rval; 
    315316 
    316         I2C_LOCK_LIST(adapter); 
     317        I2C_LOCK(adapter); 
    317318        rval = __i2c_check_addr(adapter, addr); 
    318         I2C_UNLOCK_LIST(adapter); 
     319        I2C_UNLOCK(adapter); 
    319320 
    320321        return rval; 
     
    329330                return -EBUSY; 
    330331 
    331         I2C_LOCK_LIST(adapter); 
     332        I2C_LOCK(adapter); 
    332333        for (i = 0; i < I2C_CLIENT_MAX; i++) 
    333334                if (NULL == adapter->clients[i]) 
     
    337338                       " i2c-core.o: attach_client(%s) - enlarge I2C_CLIENT_MAX.\n", 
    338339                        client->name); 
    339                 I2C_UNLOCK_LIST(adapter); 
     340                I2C_UNLOCK(adapter); 
    340341                return -ENOMEM; 
    341342        } 
    342343        adapter->clients[i] = client; 
    343         I2C_UNLOCK_LIST(adapter); 
     344        I2C_UNLOCK(adapter); 
    344345         
    345346        if (adapter->client_register)  
     
    374375                } 
    375376 
    376         I2C_LOCK_LIST(adapter); 
     377        I2C_LOCK(adapter); 
    377378        for (i = 0; i < I2C_CLIENT_MAX; i++) 
    378379                if (client == adapter->clients[i]) 
     
    382383                                    "[%s] not found\n", 
    383384                        client->name); 
    384                 I2C_UNLOCK_LIST(adapter); 
     385                I2C_UNLOCK(adapter); 
    385386                return -ENODEV; 
    386387        } 
    387388        adapter->clients[i] = NULL; 
    388         I2C_UNLOCK_LIST(adapter); 
     389        I2C_UNLOCK(adapter); 
    389390 
    390391        DEB(printk(KERN_DEBUG "i2c-core.o: client [%s] unregistered.\n",client->name)); 
     
    583584           sorted by address */ 
    584585        order_nr=0; 
    585         I2C_LOCK_LIST(adap); 
     586        I2C_LOCK(adap); 
    586587        for (j = 0; j < I2C_CLIENT_MAX; j++) { 
    587588            if ((client = adap->clients[j]) &&  
     
    606607                           client->driver->name); 
    607608        } 
    608         I2C_UNLOCK_LIST(adap); 
     609        I2C_UNLOCK(adap); 
    609610        up(&core_lists); 
    610611         
     
    693694                } 
    694695 
    695                 down(&adap->lock); 
     696                I2C_LOCK(adap); 
    696697                ret = adap->algo->master_xfer(adap,msgs,num); 
    697                 up(&adap->lock); 
     698                I2C_UNLOCK(adap); 
    698699 
    699700                return ret; 
     
    720721                        count,client->adapter->name)); 
    721722         
    722                 down(&adap->lock); 
     723                I2C_LOCK(adap); 
    723724                ret = adap->algo->master_xfer(adap,&msg,1); 
    724                 up(&adap->lock); 
     725                I2C_UNLOCK(adap); 
    725726 
    726727                /* if everything went ok (i.e. 1 msg transmitted), return #bytes 
     
    750751                        count,client->adapter->name)); 
    751752         
    752                 down(&adap->lock); 
     753                I2C_LOCK(adap); 
    753754                ret = adap->algo->master_xfer(adap,&msg,1); 
    754                 up(&adap->lock); 
     755                I2C_UNLOCK(adap); 
    755756         
    756757                DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n", 
     
    13471348 
    13481349        if (adapter->algo->smbus_xfer) { 
    1349                 down(&adapter->lock); 
     1350                I2C_LOCK(adapter); 
    13501351                res = adapter->algo->smbus_xfer(adapter,addr,flags,read_write, 
    13511352                                                command,size,data); 
    1352                 up(&adapter->lock); 
     1353                I2C_UNLOCK(adapter); 
    13531354        } else 
    13541355                res = i2c_smbus_xfer_emulated(adapter,addr,flags,read_write,