Changeset 3795

Show
Ignore:
Timestamp:
06/04/03 07:27:38 (11 years ago)
Author:
mmh
Message:

Fixed a deadlock in i2c_check_addr().
(mmh) The fix is harmonized to similar code in kernel 2.5.70.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c/branches/lk2-4/kernel/i2c-core.c

    r3769 r3795  
    298298} 
    299299 
    300 int i2c_check_addr (struct i2c_adapter *adapter, int addr) 
     300static int __i2c_check_addr (struct i2c_adapter *adapter, int addr) 
    301301{ 
    302302        int i; 
    303         down(&adapter->list); 
    304303        for (i = 0; i < I2C_CLIENT_MAX ; i++)  
    305304                if (adapter->clients[i] && (adapter->clients[i]->addr == addr)) 
    306305                        return -EBUSY; 
     306 
     307        return 0; 
     308} 
     309 
     310int i2c_check_addr (struct i2c_adapter *adapter, int addr) 
     311{ 
     312        int rval; 
     313 
     314        down(&adapter->list); 
     315        rval = __i2c_check_addr(adapter, addr); 
    307316        up(&adapter->list); 
     317 
    308318        return 0; 
    309319}