From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: Re: [PATCH v1] i2c-hid: introduce HID over i2c specification implementation Date: Sat, 6 Oct 2012 21:54:16 +0200 Message-ID: <20121006215416.5fdbb6ef@endymion.delvare> References: <1347630103-4105-1-git-send-email-benjamin.tissoires@gmail.com> <20121003164306.GA18529@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121003164306.GA18529@core.coreip.homeip.net> Sender: linux-input-owner@vger.kernel.org To: Dmitry Torokhov Cc: "benjamin.tissoires" , Jiri Kosina , Stephane Chatty , fabien.andre@gmail.com, scott.liu@emc.com.tw, Ben Dooks , Wolfram Sang , linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-i2c@vger.kernel.org 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