Changeset cf36b70 in rtems for cpukit/dev/i2c


Ignore:
Timestamp:
Dec 31, 2014, 9:56:05 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
29fa241
Parents:
369328f0
git-author:
Sebastian Huber <sebastian.huber@…> (12/31/14 09:56:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/27/15 05:54:22)
Message:

IMFS: Replace node union with individual struct

This reduces the average node size.

Add and use IMFS_GENERIC_INITIALIZER().

Location:
cpukit/dev/i2c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/dev/i2c/i2c-bus.c

    r369328f0 rcf36b70  
    224224};
    225225
    226 static IMFS_jnode_t *i2c_bus_node_destroy(IMFS_jnode_t *node)
     226static void i2c_bus_node_destroy(IMFS_jnode_t *node)
    227227{
    228228  i2c_bus *bus;
     
    231231  (*bus->destroy)(bus);
    232232
    233   return node;
    234 }
    235 
    236 static const IMFS_node_control i2c_bus_node_control = {
    237   .imfs_type = IMFS_GENERIC,
    238   .handlers = &i2c_bus_handler,
    239   .node_initialize = IMFS_node_initialize_generic,
    240   .node_remove = IMFS_node_remove_default,
    241   .node_destroy = i2c_bus_node_destroy
    242 };
     233  IMFS_node_destroy_default(node);
     234}
     235
     236static const IMFS_node_control i2c_bus_node_control = IMFS_GENERIC_INITIALIZER(
     237  &i2c_bus_handler,
     238  IMFS_node_initialize_generic,
     239  i2c_bus_node_destroy
     240);
    243241
    244242int i2c_bus_register(
  • cpukit/dev/i2c/i2c-dev.c

    r369328f0 rcf36b70  
    117117};
    118118
    119 static IMFS_jnode_t *i2c_dev_node_destroy(IMFS_jnode_t *node)
     119static void i2c_dev_node_destroy(IMFS_jnode_t *node)
    120120{
    121121  i2c_dev *dev;
     
    124124  (*dev->destroy)(dev);
    125125
    126   return node;
    127 }
    128 
    129 static const IMFS_node_control i2c_dev_node_control = {
    130   .imfs_type = IMFS_GENERIC,
    131   .handlers = &i2c_dev_handler,
    132   .node_initialize = IMFS_node_initialize_generic,
    133   .node_remove = IMFS_node_remove_default,
    134   .node_destroy = i2c_dev_node_destroy
    135 };
     126  IMFS_node_destroy_default(node);
     127}
     128
     129static const IMFS_node_control i2c_dev_node_control = IMFS_GENERIC_INITIALIZER(
     130  &i2c_dev_handler,
     131  IMFS_node_initialize_generic,
     132  i2c_dev_node_destroy
     133);
    136134
    137135int i2c_dev_register(
Note: See TracChangeset for help on using the changeset viewer.