Changeset 878b764 in mainline


Ignore:
Timestamp:
2012-11-21T22:46:50Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bebf97d
Parents:
7a6d91b
Message:

rootamdm37x: Make rootamdm37x_add_fun use erro codes instead of error/bool mix.

File:
1 edited

Legend:

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

    r7a6d91b r878b764  
    116116};
    117117
    118 static bool rootamdm37x_add_fun(ddf_dev_t *dev, const char *name,
     118static int rootamdm37x_add_fun(ddf_dev_t *dev, const char *name,
    119119    const char *str_match_id, const rootamdm37x_fun_t *fun)
    120120{
     
    128128       
    129129        /* Add match id */
    130         if (ddf_fun_add_match_id(fnode, str_match_id, 100) != EOK) {
     130        int ret = ddf_fun_add_match_id(fnode, str_match_id, 100);
     131        if (ret != EOK) {
    131132                ddf_fun_destroy(fnode);
    132                 return false;
     133                return ret;
    133134        }
    134135       
     
    138139       
    139140        /* Register function. */
    140         if (ddf_fun_bind(fnode) != EOK) {
     141        ret = ddf_fun_bind(fnode);
     142        if (ret != EOK) {
    141143                ddf_msg(LVL_ERROR, "Failed binding function %s.", name);
    142144                // TODO This will try to free our data!
    143145                ddf_fun_destroy(fnode);
    144                 return false;
    145         }
    146        
    147         return true;
     146                return ret;
     147        }
     148       
     149        return EOK;
    148150}
    149151
     
    183185
    184186        /* Register functions */
    185         if (!rootamdm37x_add_fun(dev, "ohci", "usb/host=ohci", &ohci))
     187        if (rootamdm37x_add_fun(dev, "ohci", "usb/host=ohci", &ohci) != EOK)
    186188                ddf_msg(LVL_ERROR, "Failed to add OHCI function for "
    187189                    "BeagleBoard-xM platform.");
    188         if (!rootamdm37x_add_fun(dev, "ehci", "usb/host=ehci", &ehci))
     190        if (rootamdm37x_add_fun(dev, "ehci", "usb/host=ehci", &ehci) != EOK)
    189191                ddf_msg(LVL_ERROR, "Failed to add EHCI function for "
    190192                    "BeagleBoard-xM platform.");
Note: See TracChangeset for help on using the changeset viewer.