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


Ignore:
Timestamp:
2011-04-17T19:17:55Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63517c2, cfbbe1d3
Parents:
ef354b6 (diff), 8595577b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

new report structure fixes

File:
1 edited

Legend:

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

    ref354b6 re50cd7f  
    4747#include <stdlib.h>
    4848#include <str.h>
     49#include <str_error.h>
    4950#include <ctype.h>
    5051#include <errno.h>
     
    402403                            get_remote_method(rem_iface, iface_method_idx);
    403404                        if (iface_method_ptr == NULL) {
    404                                 // the interface has not such method
     405                                /* The interface has not such method */
    405406                                printf("%s: driver_connection_gen error - "
    406407                                    "invalid interface method.", driver->name);
     
    655656int ddf_driver_main(driver_t *drv)
    656657{
     658        int rc;
     659
    657660        /*
    658661         * Remember the driver structure - driver_ops will be called by generic
     
    668671       
    669672        /*
    670          * Register driver by device manager with generic handler for incoming
    671          * connections.
     673         * Register driver with device manager using generic handler for
     674         * incoming connections.
    672675         */
    673         devman_driver_register(driver->name, driver_connection);
    674        
     676        rc = devman_driver_register(driver->name, driver_connection);
     677        if (rc != EOK) {
     678                printf("Error: Failed to register driver with device manager "
     679                    "(%s).\n", (rc == EEXISTS) ? "driver already started" :
     680                    str_error(rc));
     681               
     682                return 1;
     683        }
     684       
     685        /* Return success from the task since server has started. */
     686        rc = task_retval(0);
     687        if (rc != EOK)
     688                return 1;
     689
    675690        async_manager();
    676691       
Note: See TracChangeset for help on using the changeset viewer.