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:
quoted
+ }
+
+ 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