Changeset 5200

Show
Ignore:
Timestamp:
04/24/08 14:08:02 (6 years ago)
Author:
khali
Message:

Don't print the list of i2c buses as part of the help.

Location:
i2c-tools/trunk/tools
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/tools/i2cbusses.c

    r5196 r5200  
    296296 
    297297/* 
    298    this just prints out the installed i2c busses in a consistent format, whether 
    299    on a 2.4 kernel using /proc or a 2.6 kernel using /sys. 
    300    If procfmt == 1, print out exactly /proc/bus/i2c format on stdout. 
    301    This allows this to be used in a program to emulate /proc/bus/i2c on a 
    302    sysfs system. 
    303 */ 
    304 void print_i2c_busses(int procfmt) 
     298 * Print the installed i2c busses. The format is those of Linux 2.4's 
     299 * /proc/bus/i2c for historical compatibility reasons. 
     300 */ 
     301void print_i2c_busses(void) 
    305302{ 
    306303        struct i2c_adap *adapters; 
     
    314311 
    315312        for (count = 0; adapters[count].name; count++) { 
    316                 if (count == 0 && !procfmt) 
    317                         fprintf(stderr,"  Installed I2C busses:\n"); 
    318                 if (procfmt) 
    319                         /* match 2.4 /proc/bus/i2c format as closely as possible */ 
    320                         printf("i2c-%d\t%-10s\t%-32s\t%s\n", 
    321                                 adapters[count].nr, 
    322                                 adapters[count].funcs, 
    323                                 adapters[count].name, 
    324                                 adapters[count].algo); 
    325                 else 
    326                         fprintf(stderr, "    i2c-%d\t%-10s\t%s\n", 
    327                                 adapters[count].nr, 
    328                                 adapters[count].funcs, 
    329                                 adapters[count].name); 
    330         } 
    331  
    332         if(count == 0 && !procfmt) 
    333                 fprintf(stderr,"Error: No I2C busses found!\n" 
    334                                "Be sure you have done 'modprobe i2c-dev'\n" 
    335                                "and also modprobed your i2c bus drivers\n"); 
     313                printf("i2c-%d\t%-10s\t%-32s\t%s\n", 
     314                        adapters[count].nr, adapters[count].funcs, 
     315                        adapters[count].name, adapters[count].algo); 
     316        } 
    336317 
    337318        free_adapters(adapters); 
  • i2c-tools/trunk/tools/i2cbusses.h

    r5193 r5200  
    2323#define _I2CBUSSES_H 
    2424 
    25 void print_i2c_busses(int procfmt); 
     25void print_i2c_busses(void); 
    2626 
    2727int lookup_i2c_bus(const char *i2cbus_arg); 
  • i2c-tools/trunk/tools/i2cdetect.c

    r5199 r5200  
    5050                "  If provided, FIRST and LAST limit the probing range.\n" 
    5151                "  With -l, lists installed busses only\n"); 
    52         print_i2c_busses(0); 
    5352} 
    5453 
     
    227226 
    228227        if (list) { 
    229                 print_i2c_busses(1); 
     228                print_i2c_busses(); 
    230229                exit(0); 
    231230        } 
  • i2c-tools/trunk/tools/i2cdump.c

    r5199 r5200  
    4949                "bank 0, reg 0x4e)\n" 
    5050                "  BANK is the command for smbusblock accesses (default 0)\n"); 
    51         print_i2c_busses(0); 
    5251} 
    5352 
  • i2c-tools/trunk/tools/i2cget.c

    r5199 r5200  
    4848                "  Append 'p' to MODE for PEC checking\n" 
    4949                "  I2CBUS is an integer\n"); 
    50         print_i2c_busses(0); 
    5150        exit(1); 
    5251} 
  • i2c-tools/trunk/tools/i2cset.c

    r5199 r5200  
    4141                "  Append 'p' to MODE for PEC checking\n" 
    4242                "  I2CBUS is an integer\n"); 
    43         print_i2c_busses(0); 
    4443        exit(1); 
    4544}