mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
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;
|
||||
|
||||
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 '/' */
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user