Changeset 5570

Show
Ignore:
Timestamp:
12/15/08 13:45:58 (6 years ago)
Author:
khali
Message:

Drop Linux 2.4 binary incompatibility mode. It didn't make any sense
to start with. Dropping it will make the code more simple and the
differences to the mainline kernel smaller.

Location:
i2c/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/CHANGES

    r5377 r5570  
    1212  doc/writing-clients: Cleanups (2.6 backport) 
    1313  i2c.h: Drop I2C_FUNC_SMBUS_*I2C_BLOCK_2 defines 
     14  i2c-core: Drop Linux 2.4 incompatibility mode 
    1415 
    15162.10.5 (20071024) 
  • i2c/trunk/kernel/i2c-core.c

    r4245 r5570  
    3636/* ----- global defines ---------------------------------------------------- */ 
    3737 
    38 #if I2C_LINUX_2_4_BINARY_COMPATIBILITY 
    39 #define I2C_LOCK_LIST(adap) down(&adap->bus) 
    40 #define I2C_UNLOCK_LIST(adap) up(&adap->bus) 
    41 #else 
    42 #define I2C_LOCK_LIST(adap) down(&adap->list) 
    43 #define I2C_UNLOCK_LIST(adap) up(&adap->list) 
    44 #endif 
     38#define I2C_LOCK_LIST(adap) down(&adap->lock) 
     39#define I2C_UNLOCK_LIST(adap) up(&adap->lock) 
    4540 
    4641#define DEB(x) if (i2c_debug>=1) x; 
     
    114109         
    115110        /* init data types */ 
    116         init_MUTEX(&adap->bus); 
    117 #if !I2C_LINUX_2_4_BINARY_COMPATIBILITY 
    118         init_MUTEX(&adap->list); 
    119 #endif 
     111        init_MUTEX(&adap->lock); 
    120112 
    121113        /* inform drivers of new adapters */ 
     
    701693                } 
    702694 
    703                 down(&adap->bus); 
     695                down(&adap->lock); 
    704696                ret = adap->algo->master_xfer(adap,msgs,num); 
    705                 up(&adap->bus); 
     697                up(&adap->lock); 
    706698 
    707699                return ret; 
     
    728720                        count,client->adapter->name)); 
    729721         
    730                 down(&adap->bus); 
     722                down(&adap->lock); 
    731723                ret = adap->algo->master_xfer(adap,&msg,1); 
    732                 up(&adap->bus); 
     724                up(&adap->lock); 
    733725 
    734726                /* if everything went ok (i.e. 1 msg transmitted), return #bytes 
     
    758750                        count,client->adapter->name)); 
    759751         
    760                 down(&adap->bus); 
     752                down(&adap->lock); 
    761753                ret = adap->algo->master_xfer(adap,&msg,1); 
    762                 up(&adap->bus); 
     754                up(&adap->lock); 
    763755         
    764756                DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n", 
     
    13551347 
    13561348        if (adapter->algo->smbus_xfer) { 
    1357                 down(&adapter->bus); 
     1349                down(&adapter->lock); 
    13581350                res = adapter->algo->smbus_xfer(adapter,addr,flags,read_write, 
    13591351                                                command,size,data); 
    1360                 up(&adapter->bus); 
     1352                up(&adapter->lock); 
    13611353        } else 
    13621354                res = i2c_smbus_xfer_emulated(adapter,addr,flags,read_write, 
  • i2c/trunk/kernel/i2c.h

    r5363 r5570  
    3131#define I2C_DATE "SVN" 
    3232#define I2C_VERSION "2.10.5-SVN" 
    33  
    34 /* You can set this to 0 if you patch i2c into your kernel tree 
    35    and have no i2c module that have been compiled using a 
    36    Linux-2.4-compatible i2c.h header file left.  
    37    As a result, you'll get a different code (can't really 
    38    say whether it's any better, but it's different). */ 
    39 #define I2C_LINUX_2_4_BINARY_COMPATIBILITY 1 
    4033 
    4134#include <linux/module.h> 
     
    239232 
    240233                        /* data fields that are valid for all devices   */ 
    241         struct semaphore bus; 
    242 #if !I2C_LINUX_2_4_BINARY_COMPATIBILITY 
    243         struct semaphore list;   
    244 #endif 
     234        struct semaphore lock;   
    245235        unsigned int flags;/* flags specifying div. data                */ 
    246236 
    247237        struct i2c_client *clients[I2C_CLIENT_MAX]; 
    248 #if I2C_LINUX_2_4_BINARY_COMPATIBILITY 
    249         int client_count; /* not used anywhere */ 
    250 #endif 
     238        int client_count; /* not used anywhere, kept for binary compat. */ 
    251239 
    252240        int timeout;