Changeset bebf97d in mainline


Ignore:
Timestamp:
2012-11-21T22:59:09Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c739102
Parents:
878b764
Message:

rootamdm37x: Don't use data implant.

File:
1 edited

Legend:

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

    r878b764 rbebf97d  
    3535/** @file
    3636 */
    37 #define _DDF_DATA_IMPLANT
    3837
    3938#define DEBUG_CM 0
     
    5251} rootamdm37x_fun_t;
    5352
     53/* See amdm37x TRM page. 3316 for these values */
    5454#define OHCI_BASE_ADDRESS  0x48064400
    5555#define OHCI_SIZE  1024
     
    6060        {
    6161                .type = MEM_RANGE,
    62                 /* See amdm37x TRM page. 3316 for these values */
    6362                .res.io_range = {
    6463                        .address = OHCI_BASE_ADDRESS,
     
    7170                .res.interrupt = { .irq = 76 },
    7271        },
    73 };
    74 
    75 static const rootamdm37x_fun_t ohci = {
    76         .hw_resources = {
    77             .resources = ohci_res,
    78             .count = sizeof(ohci_res)/sizeof(ohci_res[0]),
    79         }
    8072};
    8173
     
    9688};
    9789
     90static const rootamdm37x_fun_t ohci = {
     91        .hw_resources = {
     92            .resources = ohci_res,
     93            .count = sizeof(ohci_res)/sizeof(ohci_res[0]),
     94        }
     95};
     96
    9897static const rootamdm37x_fun_t ehci = {
    9998        .hw_resources = {
     
    111110};
    112111
    113 static ddf_dev_ops_t rootamdm37x_fun_ops =
    114 {
     112static ddf_dev_ops_t rootamdm37x_fun_ops = {
    115113        .interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops
    116114};
     
    126124                return ENOMEM;
    127125       
    128        
    129126        /* Add match id */
    130127        int ret = ddf_fun_add_match_id(fnode, str_match_id, 100);
     
    134131        }
    135132       
     133        /* Alloc needed data */
     134        rootamdm37x_fun_t *rf =
     135            ddf_fun_data_alloc(fnode, sizeof(rootamdm37x_fun_t));
     136        if (!rf) {
     137                ddf_fun_destroy(fnode);
     138                return ENOMEM;
     139        }
     140        *rf = *fun;
     141
    136142        /* Set provided operations to the device. */
    137         ddf_fun_data_implant(fnode, (void*)fun);
    138143        ddf_fun_set_ops(fnode, &rootamdm37x_fun_ops);
    139144       
     
    142147        if (ret != EOK) {
    143148                ddf_msg(LVL_ERROR, "Failed binding function %s.", name);
    144                 // TODO This will try to free our data!
    145149                ddf_fun_destroy(fnode);
    146150                return ret;
Note: See TracChangeset for help on using the changeset viewer.