Changeset cd0684d in mainline for uspace/drv/pciintel/pci.c


Ignore:
Timestamp:
2011-02-14T22:14:52Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
659ca07
Parents:
97a62fe
Message:

Remove register_function_wrapper() since it became practically useless.
Provide ddf_fun_add_match_id() instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/pciintel/pci.c

    r97a62fe rcd0684d  
    4545#include <ctype.h>
    4646#include <macros.h>
     47#include <str_error.h>
    4748
    4849#include <driver.h>
     
    217218void pci_fun_create_match_ids(pci_fun_t *fun)
    218219{
    219         match_id_t *match_id = NULL;
    220220        char *match_id_str;
    221        
    222         match_id = create_match_id();
    223         if (match_id != NULL) {
    224                 asprintf(&match_id_str, "pci/ven=%04x&dev=%04x",
    225                     fun->vendor_id, fun->device_id);
    226                 match_id->id = match_id_str;
    227                 match_id->score = 90;
    228                 add_match_id(&fun->fnode->match_ids, match_id);
     221        int rc;
     222       
     223        asprintf(&match_id_str, "pci/ven=%04x&dev=%04x",
     224            fun->vendor_id, fun->device_id);
     225
     226        if (match_id_str == NULL) {
     227                printf(NAME ": out of memory creating match ID.\n");
     228                return;
     229        }
     230
     231        rc = ddf_fun_add_match_id(fun->fnode, match_id_str, 90);
     232        if (rc != EOK) {
     233                printf(NAME ": error adding match ID: %s\n",
     234                    str_error(rc));
    229235        }
    230236       
Note: See TracChangeset for help on using the changeset viewer.