lkml.org 
[lkml]   [2015]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] i2c: iproc: Add Broadcom iProc I2C Driver


On 1/15/2015 3:59 AM, Wolfram Sang wrote:
>>>> + case M_CMD_STATUS_LOST_ARB:
>>>> + dev_err(dev->device, "lost bus arbitration\n");
>>> I wouldn't dev_err that, only dev_dbg. I'm not sure how usual the errors
>>> for the next two cases is, maybe degrade them to dev_dbg, too?
>>>
>> These errors are rare, and it's nice to keep them at the dev_err level
>> so the user will be more aware.
>
> This is wrong. Arbitration lost and NACK is pretty standard stuff on an
> I2C bus. User doesn't need to know about it, it is just noise in the
> logs. Timeout is different, you can report that (although I should
> probably move such a message into the core). Please also use the proper
> errno codes defined in Documentation/i2c/fault-codes. They should be
> distinct enough to drop the messages.
>
Okay will do.

>>
>>>> + return -EREMOTEIO;
>>>> +
>>>> + case M_CMD_STATUS_NACK_ADDR:
>>>> + dev_err(dev->device, "NAK addr:0x%02x\n", dev->msg->addr);
>>>> + return -EREMOTEIO;
>>>> +
>>>> + case M_CMD_STATUS_NACK_DATA:
>>>> + dev_err(dev->device, "NAK data\n");
>>>> + return -EREMOTEIO;
>>>> +
>>>> + case M_CMD_STATUS_TIMEOUT:
>>>> + dev_err(dev->device, "bus timeout\n");
>>>> + return -ETIMEDOUT;
>>>> +
>>>> + default:
>>>> + dev_err(dev->device, "unknown error code=%d\n", val);
>>>> + return -EREMOTEIO;
>>>> + }
>>>> +
>>>> + return -EREMOTEIO;
>>>> +}


\
 
 \ /
  Last update: 2015-01-17 00:01    [W:1.182 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site