Changeset 3ad7b1c in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2011-04-09T09:28:08Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26fa82bc
Parents:
033cbf82
Message:

Make devman robust against somebody manually starting a driver. Allow it
if the driver is not running yet. Prevent it if the driver is already
running. Fix phoneid check (zero is valid).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/driver.c

    r033cbf82 r3ad7b1c  
    4747#include <stdlib.h>
    4848#include <str.h>
     49#include <str_error.h>
    4950#include <ctype.h>
    5051#include <errno.h>
     
    675676        rc = devman_driver_register(driver->name, driver_connection);
    676677        if (rc != EOK) {
    677                 printf("Error: Failed to register driver with device manager.\n");
     678                printf("Error: Failed to register driver with device manager "
     679                    "(%s).\n", (rc == EEXISTS) ? "driver already started" :
     680                    str_error(rc));
     681               
    678682                return 1;
    679683        }
Note: See TracChangeset for help on using the changeset viewer.