[rtems commit] libchip: Correct error handling in dwmac driver

Sebastian Huber sebh at rtems.org
Thu Apr 17 11:21:09 UTC 2014


Module:    rtems
Branch:    master
Commit:    a38d4a37bc553c8e9f007196cca8fe075a77cefb
Changeset: http://git.rtems.org/rtems/commit/?id=a38d4a37bc553c8e9f007196cca8fe075a77cefb

Author:    Ralf Kirchner <ralf.kirchner at embedded-brains.de>
Date:      Wed Apr 16 14:22:42 2014 +0200

libchip: Correct error handling in dwmac driver

By fault an rtems_status_code has been expected instead of an errno error number.

---

 c/src/libchip/network/dwmac.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/c/src/libchip/network/dwmac.c b/c/src/libchip/network/dwmac.c
index eda1433..bf3898e 100644
--- a/c/src/libchip/network/dwmac.c
+++ b/c/src/libchip/network/dwmac.c
@@ -314,9 +314,6 @@ static int dwmac_control_request(
     nest_count = rtems_bsdnet_semaphore_release_recursive();
     sc         = rtems_event_transient_receive( RTEMS_WAIT, RTEMS_NO_TIMEOUT );
     eno        = rtems_status_code_to_errno( sc );
-  }
-
-  if ( eno == 0 ) {
     rtems_bsdnet_semaphore_obtain_recursive( nest_count );
     self->task_id_control = 0;
   }
@@ -1835,15 +1832,13 @@ static int dwmac_if_up_or_down(
 
     if ( eno == 0 ) {
       /* Start the ball rolling ... */
-      sc  = dwmac_control_request(
+      eno = dwmac_control_request(
         self, self->task_id_tx, DWMAC_COMMON_EVENT_TASK_INIT );
-      eno = rtems_status_code_to_errno( sc );
     }
 
     if ( eno == 0 ) {
-      sc  = dwmac_control_request(
+      eno = dwmac_control_request(
         self, self->task_id_rx, DWMAC_COMMON_EVENT_TASK_INIT );
-      eno = rtems_status_code_to_errno( sc );
     }
 
     if ( eno == 0 ) {
@@ -1878,15 +1873,13 @@ static int dwmac_if_up_or_down(
     }
   } else if ( !up && self->state == DWMAC_COMMON_STATE_UP ) {
     if ( eno == 0 ) {
-      sc  = dwmac_control_request(
+      eno = dwmac_control_request(
         self, self->task_id_tx, DWMAC_COMMON_EVENT_TASK_STOP );
-      eno = rtems_status_code_to_errno( sc );
     }
 
     if ( eno == 0 ) {
-      sc  = dwmac_control_request(
+      eno = dwmac_control_request(
         self, self->task_id_rx, DWMAC_COMMON_EVENT_TASK_STOP );
-      eno = rtems_status_code_to_errno( sc );
     }
 
     if ( eno == 0 ) {




More information about the vc mailing list