lkml.org 
[lkml]   [2012]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] i2c-hid: introduce HID over i2c specification implementation
On Wed, 3 Oct 2012 09:43:12 -0700, Dmitry Torokhov wrote:
> On Fri, Sep 14, 2012 at 03:41:43PM +0200, benjamin.tissoires wrote:
> > + }
> > +
> > + do {
> > + ret = i2c_transfer(client->adapter, msg, msg_num);
> > + if (ret > 0)
> > + break;
> > + tries--;
> > + dev_dbg(&client->dev, "retrying i2chid_command:%d (%d)\n",
> > + command, tries);
> > + } while (tries > 0);
> > +
> > + if (wait && ret > 0) {
> > + if (debug)
> > + dev_err(&client->dev, "%s: waiting....\n", __func__);
> > + if (!wait_event_timeout(ihid->wait,
> > + !test_bit(I2C_HID_RESET_PENDING, &ihid->flags),
> > + msecs_to_jiffies(5000)))
> > + ret = -ENODATA;
> > + if (debug)
> > + dev_err(&client->dev, "%s: finished.\n", __func__);
>
> Why do we have error level messages with debug? I know dev_dbg is
> compiled out if !DEBUG, but there must be a better way. Maybe define
> i2c_hid_dbg() via dev_printk() and also check debug condition there?

dev_dbg() is compiled out if !DEBUG only if CONFIG_DYNAMIC_DEBUG isn't
set. These days I think every developer want to enable this option.

--
Jean Delvare


\
 
 \ /
  Last update: 2012-10-06 22:21    [W:1.441 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site