Changeset c5be39b in mainline for uspace/drv/test/test1/test1.c


Ignore:
Timestamp:
2011-08-29T21:53:18Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5f6e25e
Parents:
bfe7867
Message:

Add interface for allocating driver-specific device and function data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/test/test1/test1.c

    rbfe7867 rc5be39b  
    148148            dev->name, (int) dev->handle);
    149149
    150         test1 = calloc(1, sizeof(test1_t));
     150        test1 = ddf_dev_data_alloc(dev, sizeof(test1_t));
    151151        if (test1 == NULL) {
    152                 ddf_msg(LVL_ERROR, "Failed allocating softstate.\n");
     152                ddf_msg(LVL_ERROR, "Failed allocating soft state.\n");
    153153                return ENOMEM;
    154154        }
     
    159159                return ENOMEM;
    160160        }
     161
     162        test1->fun_a = fun_a;
    161163
    162164        rc = ddf_fun_bind(fun_a);
     
    187189        ddf_msg(LVL_DEBUG, "Device `%s' accepted.", dev->name);
    188190
    189         test1->fun_a = fun_a;
    190         dev->driver_data = test1;
    191191        return EOK;
    192192}
Note: See TracChangeset for help on using the changeset viewer.