Ignore:
Timestamp:
2012-02-18T16:47:38Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4449c6c
Parents:
bd5f3b7 (diff), f943dd3 (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:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/root/root.c

    rbd5f3b7 r00aece0  
    6666#define VIRTUAL_FUN_MATCH_SCORE 100
    6767
    68 static int root_add_device(ddf_dev_t *dev);
     68static int root_dev_add(ddf_dev_t *dev);
     69static int root_fun_online(ddf_fun_t *fun);
     70static int root_fun_offline(ddf_fun_t *fun);
    6971
    7072/** The root device driver's standard operations. */
    7173static driver_ops_t root_ops = {
    72         .add_device = &root_add_device
     74        .dev_add = &root_dev_add,
     75        .fun_online = &root_fun_online,
     76        .fun_offline = &root_fun_offline
    7377};
    7478
     
    154158        if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
    155159                ddf_msg(LVL_ERROR, "Memory allocation failed.");
    156                 return ENOMEM;
    157         }
     160                free(platform);
     161                return ENOMEM;
     162        }
     163
     164        free(platform);
    158165
    159166        /* Add function. */
     
    165172        if (fun == NULL) {
    166173                ddf_msg(LVL_ERROR, "Error creating function %s", name);
     174                free(match_id);
    167175                return ENOMEM;
    168176        }
     
    172180                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    173181                    name);
     182                free(match_id);
    174183                ddf_fun_destroy(fun);
    175184                return rc;
     
    194203 *                      of HW and pseudo devices).
    195204 */
    196 static int root_add_device(ddf_dev_t *dev)
    197 {
    198         ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun,
     205static int root_dev_add(ddf_dev_t *dev)
     206{
     207        ddf_msg(LVL_DEBUG, "root_dev_add, device handle=%" PRIun,
    199208            dev->handle);
    200209
     
    204213         * vital for the system.
    205214         */
    206         add_virtual_root_fun(dev);
     215        (void) add_virtual_root_fun(dev);
    207216
    208217        /* Register root device's children. */
     
    214223}
    215224
     225static int root_fun_online(ddf_fun_t *fun)
     226{
     227        ddf_msg(LVL_DEBUG, "root_fun_online()");
     228        return ddf_fun_online(fun);
     229}
     230
     231static int root_fun_offline(ddf_fun_t *fun)
     232{
     233        ddf_msg(LVL_DEBUG, "root_fun_offline()");
     234        return ddf_fun_offline(fun);
     235}
     236
    216237int main(int argc, char *argv[])
    217238{
Note: See TracChangeset for help on using the changeset viewer.