From c57316a40956b00b5d10f19dbb253383069d515a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 Oct 2007 12:46:50 +0000 Subject: 2007-10-11 Daniel Hellstrom * libi2c/libi2c.c, libi2c/libi2c.h: Add message about needing IMFS. Fixed check of status when registering driver. Add use of strerror(). --- cpukit/libi2c/libi2c.c | 6 +++--- cpukit/libi2c/libi2c.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'cpukit/libi2c') diff --git a/cpukit/libi2c/libi2c.c b/cpukit/libi2c/libi2c.c index a33c8d2a5b..0adf2f1ae4 100644 --- a/cpukit/libi2c/libi2c.c +++ b/cpukit/libi2c/libi2c.c @@ -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 '/' */ diff --git a/cpukit/libi2c/libi2c.h b/cpukit/libi2c/libi2c.h index 38677af389..2dfbddd458 100644 --- a/cpukit/libi2c/libi2c.h +++ b/cpukit/libi2c/libi2c.h @@ -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). -- cgit v1.2.3