linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: linux-media@vger.kernel.org
Cc: linux-input@vger.kernel.org
Subject: [PATCH] IR/imon: minor change_protocol fixups
Date: Wed, 28 Apr 2010 13:37:29 -0400	[thread overview]
Message-ID: <20100428173729.GA14256@redhat.com> (raw)

This is a follow-up to my prior patch implementing ir-core's
change_protocol functionality in the imon driver, which eliminates
a false warning when change_protocol is called without a specific
protocol selected yet (i.e., still IR_TYPE_UNKNOWN). It also removes
some extraneous blank lines getting spewn into dmesg.

Signed-off-by: Jarod Wilson <jarod@redhat.com>

---
 drivers/media/IR/imon.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 16e2e7f..6fb3b05 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -999,7 +999,7 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
 	unsigned char ir_proto_packet[] = {
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
 
-	if (!(ir_type & ictx->props->allowed_protos))
+	if (ir_type && !(ir_type & ictx->props->allowed_protos))
 		dev_warn(dev, "Looks like you're trying to use an IR protocol "
 			 "this device does not support\n");
 
@@ -1014,12 +1014,11 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
 		break;
 	case IR_TYPE_UNKNOWN:
 	case IR_TYPE_OTHER:
-		dev_dbg(dev, "Configuring IR receiver for iMON protocol");
-		if (pad_stabilize) {
-			printk(KERN_CONT "\n");
+		dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
+		if (pad_stabilize)
 			pad_mouse = true;
-		} else {
-			printk(KERN_CONT " (without PAD stabilization)\n");
+		else {
+			dev_dbg(dev, "PAD stabilize functionality disabled\n");
 			pad_mouse = false;
 		}
 		/* ir_proto_packet[0] = 0x00; // already the default */
@@ -1027,12 +1026,11 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
 		break;
 	default:
 		dev_warn(dev, "Unsupported IR protocol specified, overriding "
-			 "to iMON IR protocol");
-		if (pad_stabilize) {
-			printk(KERN_CONT "\n");
+			 "to iMON IR protocol\n");
+		if (pad_stabilize)
 			pad_mouse = true;
-		} else {
-			printk(KERN_CONT " (without PAD stabilization)\n");
+		else {
+			dev_dbg(dev, "PAD stabilize functionality disabled\n");
 			pad_mouse = false;
 		}
 		/* ir_proto_packet[0] = 0x00; // already the default */

-- 
Jarod Wilson
jarod@redhat.com

                 reply	other threads:[~2010-04-28 17:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100428173729.GA14256@redhat.com \
    --to=jarod@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@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;
as well as URLs for NNTP newsgroup(s).