mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Azael Avalos <coproscefalo@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] toshiba_bluetooth: Change BT status message to debug
Date: Tue, 28 Apr 2015 09:36:19 +0200	[thread overview]
Message-ID: <87pp6oiu18.fsf@nemi.mork.no> (raw)
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")

Azael Avalos <coproscefalo@gmail.com> 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 <coproscefalo@gmail.com>
> ---
>  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

  reply	other threads:[~2015-04-28  7:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 20:32 [PATCH 0/6] toshiba_bluetooth: Add rfkill code to driver Azael Avalos
2015-04-27 20:32 ` [PATCH 1/6] toshiba_bluetooth: Add a container struct named toshiba_bluetooth_dev Azael Avalos
2015-04-27 20:32 ` [PATCH 2/6] toshiba_bluetooth: Add RFKill handler functions Azael Avalos
2015-04-27 20:32 ` [PATCH 3/6] toshiba_bluetooth: Clean toshiba_bluetooth_enable function Azael Avalos
2015-05-03 19:43   ` Darren Hart
2015-04-27 20:32 ` [PATCH 4/6] toshiba_bluetooth: Adapt *_notify and *_resume functions to rfkill Azael Avalos
2015-04-27 20:32 ` [PATCH 5/6] toshiba_bluetooth: Change BT status message to debug Azael Avalos
2015-04-28  7:36   ` Bjørn Mork [this message]
2015-04-28 15:08     ` Azael Avalos
2015-04-28 15:16       ` Bjørn Mork
2015-05-03 19:49   ` Darren Hart
2015-04-27 20:32 ` [PATCH 6/6] platform/x86: Add RFKILL dependency to toshiba_bluetooth driver Azael Avalos
2015-05-03 19:47   ` Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp6oiu18.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=coproscefalo@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome