lkml.org 
[lkml]   [2015]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 04/10] USB: f81232: implement read IIR/MSR with endpoint
Hello,

Johan Hovold 於 2015/3/14 下午 08:02 寫道:
> On Thu, Feb 26, 2015 at 06:02:10PM +0800, Peter Hung wrote:
>> + if (status != sizeof(*val)) {
>> + dev_err(&port->dev, "%s failed status: %d\n", __func__, status);
>> +
>> + if (status == 0)
>> + status = -EIO;
>> + else
>> + status = usb_translate_errors(status);
>
> Could you rewrite this as
>
> if (status < 0)
> status = usb_translate_errors(status);
> else
> status = 0;

In my definition the return value of set/getregister(), 0 is success,
negative values are errors. The function usb_control_msg() return value
is success transmited/received byte. It's maybe return 0. I want to
treat 0 with error(-EIO). But if pass 0 to usb_translate_errors(), It
will return 0 back. So I need especially handle with status == 0.

I'll keep this sections.

Thanks for review
--
With Best Regards,
Peter Hung


\
 
 \ /
  Last update: 2015-03-16 04:21    [W:0.064 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site