forked from Imagelibrary/rtems
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:
@@ -323,7 +323,7 @@ rtems_libi2c_initialize ()
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
sc = rtems_io_register_driver (0, &libi2c_io_ops, &rtems_libi2c_major);
|
sc = rtems_io_register_driver (0, &libi2c_io_ops, &rtems_libi2c_major);
|
||||||
if (RTEMS_SUCCESSFUL != 0) {
|
if (RTEMS_SUCCESSFUL != sc) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
DRVNM " Claiming driver slot failed (rtems status code %i)\n",
|
DRVNM " Claiming driver slot failed (rtems status code %i)\n",
|
||||||
sc);
|
sc);
|
||||||
@@ -366,8 +366,8 @@ rtems_libi2c_register_bus (char *name, rtems_libi2c_bus_t * bus)
|
|||||||
i = stat (nmcpy, &sbuf);
|
i = stat (nmcpy, &sbuf);
|
||||||
*chpt = tmp;
|
*chpt = tmp;
|
||||||
if (i) {
|
if (i) {
|
||||||
fprintf (stderr, "Bad name '%s'; parent directory doesn't exist\n",
|
fprintf (stderr, "Get %s status failed: %s\n",
|
||||||
nmcpy);
|
nmcpy,strerror(errno));
|
||||||
return -RTEMS_INVALID_NAME;
|
return -RTEMS_INVALID_NAME;
|
||||||
}
|
}
|
||||||
/* should be a directory since name terminates in '/' */
|
/* should be a directory since name terminates in '/' */
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ typedef struct rtems_libi2c_bus_ops_
|
|||||||
* (i.e., libi2c) and the minor number encodes a bus# and a i2c address.
|
* (i.e., libi2c) and the minor number encodes a bus# and a i2c address.
|
||||||
*
|
*
|
||||||
* The name will be registered in the filesystem (parent
|
* 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.
|
* the library will pick a default.
|
||||||
*
|
*
|
||||||
* RETURNS: bus # (>=0) or -1 on error (errno set).
|
* RETURNS: bus # (>=0) or -1 on error (errno set).
|
||||||
|
|||||||
Reference in New Issue
Block a user