2007-10-11 Daniel Hellstrom <daniel@gaisler.com>

* libi2c/libi2c.c, libi2c/libi2c.h: Add message about needing IMFS.
	Fixed check of status when registering driver. Add use of strerror().
This commit is contained in:
Joel Sherrill
2007-10-11 12:46:50 +00:00
parent df16b8bf09
commit c57316a409
2 changed files with 5 additions and 4 deletions

View File

@@ -323,7 +323,7 @@ rtems_libi2c_initialize ()
return -1;
sc = rtems_io_register_driver (0, &libi2c_io_ops, &rtems_libi2c_major);
if (RTEMS_SUCCESSFUL != 0) {
if (RTEMS_SUCCESSFUL != sc) {
fprintf (stderr,
DRVNM " Claiming driver slot failed (rtems status code %i)\n",
sc);
@@ -366,8 +366,8 @@ rtems_libi2c_register_bus (char *name, rtems_libi2c_bus_t * bus)
i = stat (nmcpy, &sbuf);
*chpt = tmp;
if (i) {
fprintf (stderr, "Bad name '%s'; parent directory doesn't exist\n",
nmcpy);
fprintf (stderr, "Get %s status failed: %s\n",
nmcpy,strerror(errno));
return -RTEMS_INVALID_NAME;
}
/* should be a directory since name terminates in '/' */

View File

@@ -113,7 +113,8 @@ typedef struct rtems_libi2c_bus_ops_
* (i.e., libi2c) and the minor number encodes a bus# and a i2c address.
*
* The name will be registered in the filesystem (parent
* directories must exist). It may be NULL in which case
* directories must exist, also IMFS filesystem must exist see
* CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM). It may be NULL in which case
* the library will pick a default.
*
* RETURNS: bus # (>=0) or -1 on error (errno set).