Show
Ignore:
Timestamp:
01/21/03 09:08:16 (12 years ago)
Author:
kmalkki
Message:

(Kyösti) More cleanups

Redo i2c-core locks.

No longer pass controlling_mod in i2cproc_register_entry, use
client->driver->owner instead.

Comment out or remove obsolete parts of mkpatch for 2.5.
Currently it does not touch kernel build/configure system at all.

Cleanup #include order. Note that kernel headers are not to be
included for userland utilities, to promote binary compatibility of
utilities across kernel versions.

Remove bus_scans. Remove empty and unused algo_control and
debugging code that would not compile if uncommented.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/kernel/i2c.h

    r3758 r3765  
    3232#define I2C_VERSION "2.7.0" 
    3333 
    34 #include "i2c-id.h"     /* id values of adapters et. al.        */ 
     34#include <linux/module.h> 
    3535#include <linux/types.h> 
    36  
    37  
    38 struct i2c_msg; 
    39  
    40  
    41 #ifdef __KERNEL__ 
    42  
    43 #include <linux/config.h> 
     36#include "i2c-id.h" 
    4437#include <asm/semaphore.h> 
    45  
    4638 
    4739/* --- General options ------------------------------------------------ */ 
     
    5345#define I2C_DUMMY_MAX 4 
    5446 
     47struct i2c_msg; 
    5548struct i2c_algorithm; 
    5649struct i2c_adapter; 
     
    5952struct i2c_client_address_data; 
    6053union i2c_smbus_data; 
    61  
    6254 
    6355/* 
     
    183175 */ 
    184176struct i2c_algorithm { 
     177        struct module *owner;                   /* future use --km      */ 
    185178        char name[32];                          /* textual description  */ 
    186179        unsigned int id; 
     
    207200}; 
    208201 
    209  
    210202/* 
    211203 * i2c_adapter is the structure used to identify a physical i2c bus along 
     
    230222 
    231223                        /* data fields that are valid for all devices   */ 
    232         struct semaphore lock;   
     224        struct semaphore bus; 
     225        struct semaphore list;   
    233226        unsigned int flags;/* flags specifying div. data                */ 
    234227 
    235228        struct i2c_client *clients[I2C_CLIENT_MAX]; 
    236         int client_count; 
    237229 
    238230        int timeout; 
     
    327319                i2c_client_found_addr_proc *found_proc); 
    328320 
     321static inline int i2c_client_command(struct i2c_client *client, 
     322                                     unsigned int cmd, void *arg) 
     323{ 
     324        if (client->driver && client->driver->command) 
     325                return client->driver->command(client, cmd, arg); 
     326        else 
     327                return -EINVAL; 
     328} 
     329 
    329330/* An ioctl like call to set div. parameters of the adapter. 
    330331 */ 
     
    343344/* Return 1 if adapter supports everything we need, 0 if not. */ 
    344345extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); 
    345  
    346 #endif /* __KERNEL__ */ 
    347346 
    348347/* 
     
    497496#define I2C_MAJOR       89              /* Device major number          */ 
    498497 
    499 #ifdef __KERNEL__ 
    500  
    501 #  ifndef NULL 
    502 #    define NULL ( (void *) 0 ) 
    503 #  endif 
    504  
    505 #  ifndef ENODEV 
    506 #    include <asm/errno.h> 
    507 #  endif 
    508  
    509498/* These defines are used for probing i2c client addresses */ 
    510499/* Default fill of many variables */ 
     
    568557        ((adapptr)->algo->id == I2C_ALGO_ISA) 
    569558 
    570 #endif /* def __KERNEL__ */ 
    571559#endif /* _LINUX_I2C_H */