Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933127AbbD1HiU (ORCPT ); Tue, 28 Apr 2015 03:38:20 -0400 Received: from canardo.mork.no ([148.122.252.1]:60109 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753326AbbD1HiS convert rfc822-to-8bit (ORCPT ); Tue, 28 Apr 2015 03:38:18 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Azael Avalos Cc: Darren Hart , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/6] toshiba_bluetooth: Change BT status message to debug Organization: m References: <1430166770-15060-1-git-send-email-coproscefalo@gmail.com> <1430166770-15060-6-git-send-email-coproscefalo@gmail.com> Date: Tue, 28 Apr 2015 09:36:19 +0200 In-Reply-To: <1430166770-15060-6-git-send-email-coproscefalo@gmail.com> (Azael Avalos's message of "Mon, 27 Apr 2015 14:32:49 -0600") Message-ID: <87pp6oiu18.fsf@nemi.mork.no> User-Agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (canardo.mork.no [IPv6:2001:4641::1]); Tue, 28 Apr 2015 09:36:25 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2305 Lines: 59 Azael Avalos writes: > The function toshiba_bluetooth_status s currently printing the status > of the device whenever it is queried, but since the introduction of > the rfkill poll code, this value will get printed everytime the poll > occurs. > > This patch changes the level of the printed message from info to > debug, and also adds a few more debug messages printing the > killswitch, plug and power status of the device as well. > > Signed-off-by: Azael Avalos > --- > drivers/platform/x86/toshiba_bluetooth.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c > index 9867ccd..93b9688 100644 > --- a/drivers/platform/x86/toshiba_bluetooth.c > +++ b/drivers/platform/x86/toshiba_bluetooth.c > @@ -99,7 +99,7 @@ static int toshiba_bluetooth_status(acpi_handle handle) > return -ENXIO; > } > > - pr_info("Bluetooth status %llu\n", status); > + pr_debug("Bluetooth status %llu\n", status); > > return status; > } > @@ -157,6 +157,10 @@ static int toshiba_bluetooth_sync_status(struct toshiba_bluetooth_dev *bt_dev) > bt_dev->plugged = (status & BT_PLUGGED_MASK) ? true : false; > bt_dev->powered = (status & BT_POWER_MASK) ? true : false; > > + pr_debug("killswitch %d\n", bt_dev->killswitch); > + pr_debug("plugged %d\n", bt_dev->plugged); > + pr_debug("powered %d\n", bt_dev->powered); Those are terribly generic messages. I don't think I would have guessed which device was trying to tell me "powered 1" if I found it in the logs... How about using e.g dev_dbg() to get a bit more context here? You might also want to put all three into a single call, so that they make a single dynamic debug entry when dynamic debugging is enabled. And looking at toshiba_bluetooth_status() I see that all callers have a device. How about propagating the device to be able to use the dev_* printk's there as well? Let the device identify itself instead of having to guess. Bjørn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/