Changeset 08135c85 in rtems for cpukit/dev/i2c/i2c-dev.c


Ignore:
Timestamp:
Jul 23, 2015, 7:00:31 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
98a41f41
Parents:
19078dc6
Message:

i2c: Fix return status of i2c dev read/write

File:
1 edited

Legend:

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

    r19078dc6 r08135c85  
    4444
    4545  n = (*dev->read)(dev, buffer, count, iop->offset);
    46   if (n > 0) {
     46  if (n >= 0) {
    4747    iop->offset += n;
    48   }
    49 
    50   return n;
     48
     49    return n;
     50  } else {
     51    rtems_set_errno_and_return_minus_one(-n);
     52  }
    5153}
    5254
     
    6163
    6264  n = (*dev->write)(dev, buffer, count, iop->offset);
    63   if (n > 0) {
     65  if (n >= 0) {
    6466    iop->offset += n;
    65   }
    66 
    67   return n;
     67
     68    return n;
     69  } else {
     70    rtems_set_errno_and_return_minus_one(-n);
     71  }
    6872}
    6973
Note: See TracChangeset for help on using the changeset viewer.