Browse Source

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

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5200 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.2
Jean Delvare 18 years ago
parent
commit
b68190b426
  1. 33
      tools/i2cbusses.c
  2. 2
      tools/i2cbusses.h
  3. 3
      tools/i2cdetect.c
  4. 1
      tools/i2cdump.c
  5. 1
      tools/i2cget.c
  6. 1
      tools/i2cset.c

33
tools/i2cbusses.c

@ -295,13 +295,10 @@ done:
}
/*
this just prints out the installed i2c busses in a consistent format, whether
on a 2.4 kernel using /proc or a 2.6 kernel using /sys.
If procfmt == 1, print out exactly /proc/bus/i2c format on stdout.
This allows this to be used in a program to emulate /proc/bus/i2c on a
sysfs system.
*/
void print_i2c_busses(int procfmt)
* Print the installed i2c busses. The format is those of Linux 2.4's
* /proc/bus/i2c for historical compatibility reasons.
*/
void print_i2c_busses(void)
{
struct i2c_adap *adapters;
int count;
@ -313,27 +310,11 @@ void print_i2c_busses(int procfmt)
}
for (count = 0; adapters[count].name; count++) {
if (count == 0 && !procfmt)
fprintf(stderr," Installed I2C busses:\n");
if (procfmt)
/* match 2.4 /proc/bus/i2c format as closely as possible */
printf("i2c-%d\t%-10s\t%-32s\t%s\n",
adapters[count].nr,
adapters[count].funcs,
adapters[count].name,
adapters[count].algo);
else
fprintf(stderr, " i2c-%d\t%-10s\t%s\n",
adapters[count].nr,
adapters[count].funcs,
adapters[count].name);
printf("i2c-%d\t%-10s\t%-32s\t%s\n",
adapters[count].nr, adapters[count].funcs,
adapters[count].name, adapters[count].algo);
}
if(count == 0 && !procfmt)
fprintf(stderr,"Error: No I2C busses found!\n"
"Be sure you have done 'modprobe i2c-dev'\n"
"and also modprobed your i2c bus drivers\n");
free_adapters(adapters);
}

2
tools/i2cbusses.h

@ -22,7 +22,7 @@
#ifndef _I2CBUSSES_H
#define _I2CBUSSES_H
void print_i2c_busses(int procfmt);
void print_i2c_busses(void);
int lookup_i2c_bus(const char *i2cbus_arg);
int open_i2c_dev(const int i2cbus, char *filename, const int quiet);

3
tools/i2cdetect.c

@ -49,7 +49,6 @@ static void help(void)
"RECOMMENDED)\n"
" If provided, FIRST and LAST limit the probing range.\n"
" With -l, lists installed busses only\n");
print_i2c_busses(0);
}
static int scan_i2c_bus(int file, int mode, int first, int last)
@ -226,7 +225,7 @@ int main(int argc, char *argv[])
}
if (list) {
print_i2c_busses(1);
print_i2c_busses();
exit(0);
}

1
tools/i2cdump.c

@ -48,7 +48,6 @@ static void help(void)
" BANK and BANKREG are for byte and word accesses (default "
"bank 0, reg 0x4e)\n"
" BANK is the command for smbusblock accesses (default 0)\n");
print_i2c_busses(0);
}
int main(int argc, char *argv[])

1
tools/i2cget.c

@ -47,7 +47,6 @@ static void help(void)
"issued\n"
" Append 'p' to MODE for PEC checking\n"
" I2CBUS is an integer\n");
print_i2c_busses(0);
exit(1);
}

1
tools/i2cset.c

@ -40,7 +40,6 @@ static void help(void)
" MODE is 'b[yte]' or 'w[ord]' (default b)\n"
" Append 'p' to MODE for PEC checking\n"
" I2CBUS is an integer\n");
print_i2c_busses(0);
exit(1);
}

Loading…
Cancel
Save