V4L/DVB (8479): tveeprom/ivtv: fix usage of has_ir field

Previous thread: V4L/DVB (8477): v4l: remove obsolete audiochip.h by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:02 am. (1 message)

Next thread: V4L/DVB (8483): Remove obsolete owner field from video_device struct. by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:02 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:02 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b654fc...
Commit:     b654fcdc0ea3b6e5724c9873ae062bdfe7f28efe
Parent:     38f9d308597fe3f8d52bfa30e7ed6c742b85a1db
Author:     Hans Verkuil <hverkuil@xs4all.nl>
AuthorDate: Tue Jul 22 15:50:31 2008 -0300
Committer:  Mauro Carvalho Chehab <mchehab@infradead.org>
CommitDate: Sat Jul 26 12:54:42 2008 -0300

    V4L/DVB (8479): tveeprom/ivtv: fix usage of has_ir field
    
    has_ir was set to and compared to -1 in several cases, even though it is
    an u32. ivtv also contained a FIXME for an old kernel that could be
    removed.
    
    Thanks to Roel Kluin for creating an initial patch for this. Although
    I chose a different solution here it did help in pointing out the problem.
    
    Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
 drivers/media/video/ivtv/ivtv-driver.c |    5 ++---
 drivers/media/video/tveeprom.c         |   16 ++++++++--------
 include/media/tveeprom.h               |    7 ++++++-
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 41fd792..aea1664 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -465,9 +465,8 @@ static void ivtv_process_eeprom(struct ivtv *itv)
 	if (itv->options.radio == -1)
 		itv->options.radio = (tv.has_radio != 0);
 	/* only enable newi2c if an IR blaster is present */
-	/* FIXME: for 2.6.20 the test against 2 should be removed */
-	if (itv->options.newi2c == -1 && tv.has_ir != -1 && tv.has_ir != 2) {
-		itv->options.newi2c = (tv.has_ir & 2) ? 1 : 0;
+	if (itv->options.newi2c == -1 && tv.has_ir) {
+		itv->options.newi2c = (tv.has_ir & 4) ? 1 : 0;
 		if (itv->options.newi2c) {
 		    IVTV_INFO("Reopen i2c bus for IR-blaster support\n");
 		    exit_ivtv_i2c(itv);
diff --git ...
Previous thread: V4L/DVB (8477): v4l: remove obsolete audiochip.h by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:02 am. (1 message)

Next thread: V4L/DVB (8483): Remove obsolete owner field from video_device struct. by Linux Kernel Mailing List on Monday, July 28, 2008 - 10:02 am. (1 message)