Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7cba9f7 in mainline


Ignore:
Timestamp:
2018-02-03T10:30:48Z (4 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial
Children:
298e010
Parents:
f5718c79
git-author:
Petr Manek <petr.manek@…> (2018-02-03 10:30:37)
git-committer:
Petr Manek <petr.manek@…> (2018-02-03 10:30:48)
Message:

usbdiag: refactor to errno_t

Location:
uspace/drv/bus/usb/usbdiag
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbdiag/device.c

    rf5718c79 r7cba9f7  
    5454};
    5555
    56 static int device_init(usbdiag_dev_t *dev, const usb_endpoint_description_t **endpoints)
     56static errno_t device_init(usbdiag_dev_t *dev, const usb_endpoint_description_t **endpoints)
    5757{
    58         int rc;
     58        errno_t rc;
    5959        ddf_fun_t *fun = usb_device_ddf_fun_create(dev->usb_dev, fun_exposed, "tmon");
    6060        if (!fun) {
     
    104104}
    105105
    106 int usbdiag_dev_create(usb_device_t *dev, usbdiag_dev_t **out_diag_dev, const usb_endpoint_description_t **endpoints)
     106errno_t usbdiag_dev_create(usb_device_t *dev, usbdiag_dev_t **out_diag_dev, const usb_endpoint_description_t **endpoints)
    107107{
    108108        assert(dev);
     
    115115        diag_dev->usb_dev = dev;
    116116
    117         int err;
     117        errno_t err;
    118118        if ((err = device_init(diag_dev, endpoints)))
    119119                goto err_init;
  • uspace/drv/bus/usb/usbdiag/device.h

    rf5718c79 r7cba9f7  
    7777} usbdiag_dev_t;
    7878
    79 int usbdiag_dev_create(usb_device_t *, usbdiag_dev_t **, const usb_endpoint_description_t **);
     79errno_t usbdiag_dev_create(usb_device_t *, usbdiag_dev_t **, const usb_endpoint_description_t **);
    8080void usbdiag_dev_destroy(usbdiag_dev_t *);
    8181
  • uspace/drv/bus/usb/usbdiag/main.c

    rf5718c79 r7cba9f7  
    4747static const usb_endpoint_description_t *diag_endpoints[];
    4848
    49 static int device_add(usb_device_t *dev)
    50 {
    51         int rc;
     49static errno_t device_add(usb_device_t *dev)
     50{
     51        errno_t rc;
    5252        usb_log_info("Adding device '%s'", usb_device_get_name(dev));
    5353
     
    7979}
    8080
    81 static int device_cleanup(usbdiag_dev_t *diag_dev)
     81static errno_t device_cleanup(usbdiag_dev_t *diag_dev)
    8282{
    8383        /* TODO: Join some fibrils? */
     
    8888}
    8989
    90 static int device_remove(usb_device_t *dev)
    91 {
    92         int rc;
     90static errno_t device_remove(usb_device_t *dev)
     91{
     92        errno_t rc;
    9393        usb_log_info("Removing device '%s'", usb_device_get_name(dev));
    9494
     
    109109}
    110110
    111 static int device_gone(usb_device_t *dev)
    112 {
    113         int rc;
     111static errno_t device_gone(usb_device_t *dev)
     112{
     113        errno_t rc;
    114114        usb_log_info("Device '%s' gone.", usb_device_get_name(dev));
    115115
     
    129129}
    130130
    131 static int function_online(ddf_fun_t *fun)
     131static errno_t function_online(ddf_fun_t *fun)
    132132{
    133133        return ddf_fun_online(fun);
    134134}
    135135
    136 static int function_offline(ddf_fun_t *fun)
     136static errno_t function_offline(ddf_fun_t *fun)
    137137{
    138138        return ddf_fun_offline(fun);
  • uspace/drv/bus/usb/usbdiag/tests.c

    rf5718c79 r7cba9f7  
    4646static const uint32_t test_data_src = 0xDEADBEEF;
    4747
    48 static int test_in(usb_pipe_t *pipe, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
     48static errno_t test_in(usb_pipe_t *pipe, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
    4949{
    5050        if (!pipe)
     
    6969        usb_log_info("Performing %s IN test with duration %ld ms.", usb_str_transfer_type(pipe->desc.transfer_type), params->min_duration);
    7070
    71         int rc = EOK;
     71        errno_t rc = EOK;
    7272        uint32_t transfer_count = 0;
    7373
     
    138138}
    139139
    140 static int test_out(usb_pipe_t *pipe, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
     140static errno_t test_out(usb_pipe_t *pipe, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
    141141{
    142142        if (!pipe)
     
    167167        usb_log_info("Performing %s OUT test.", usb_str_transfer_type(pipe->desc.transfer_type));
    168168
    169         int rc = EOK;
     169        errno_t rc = EOK;
    170170        uint32_t transfer_count = 0;
    171171
     
    203203}
    204204
    205 int usbdiag_dev_test_in(ddf_fun_t *fun, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
     205errno_t usbdiag_dev_test_in(ddf_fun_t *fun, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
    206206{
    207207        usbdiag_dev_t *dev = ddf_fun_to_usbdiag_dev(fun);
     
    228228}
    229229
    230 int usbdiag_dev_test_out(ddf_fun_t *fun, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
     230errno_t usbdiag_dev_test_out(ddf_fun_t *fun, const usbdiag_test_params_t *params, usbdiag_test_results_t *results)
    231231{
    232232        usbdiag_dev_t *dev = ddf_fun_to_usbdiag_dev(fun);
  • uspace/drv/bus/usb/usbdiag/tests.h

    rf5718c79 r7cba9f7  
    3939#include <ddf/driver.h>
    4040
    41 int usbdiag_dev_test_in(ddf_fun_t *, const usbdiag_test_params_t *, usbdiag_test_results_t *);
    42 int usbdiag_dev_test_out(ddf_fun_t *, const usbdiag_test_params_t *, usbdiag_test_results_t *);
     41errno_t usbdiag_dev_test_in(ddf_fun_t *, const usbdiag_test_params_t *, usbdiag_test_results_t *);
     42errno_t usbdiag_dev_test_out(ddf_fun_t *, const usbdiag_test_params_t *, usbdiag_test_results_t *);
    4343
    4444#endif /* USBDIAG_TESTS_H_ */
Note: See TracChangeset for help on using the changeset viewer.