Skip to contentSkip to conversation

video/saa7134: change dprintk() to i2cdprintk()

PATCH Superseded Dan Carpenter 2 participants 3 messages May 25, 2010 – May 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 video/saa7134: change dprintk() to i2cdprintk()

The problem is that dprintk() dereferences "dev" which is null here. The i2cdprintk() uses "ir" so that's OK.

---
v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying dprintk().
v3: V2 had a bonus cleanup that I removed from v3

drivers/media/video/saa7134/saa7134-input.c +4 -4
index e5565e2..7691bf2 100644
@@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 
 	if (dev = NULL) {
-		dprintk("get_key_flydvb_trio: "
-			 "gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_flydvb_trio: "
+			   "gir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
@@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
 	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 	if (dev = NULL) {
-		dprintk("get_key_msi_tvanywhere_plus: "
-			"gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_msi_tvanywhere_plus: "
+			   "gir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
Acked-by on v3 1/2
#1 lore raw

Hi Dan,

Quoted 14 lines · Dan Carpenter

The problem is that dprintk() dereferences "dev" which is null here. The i2cdprintk() uses "ir" so that's OK.

---
v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying dprintk().
v3: V2 had a bonus cleanup that I removed from v3

drivers/media/video/saa7134/saa7134-input.c +0 -0
index e5565e2..7691bf2 100644

drivers/media/video/saa7134/saa7134-input.c static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) · line 145

Quoted 7 lines
drivers/media/video/saa7134/saa7134-input.c +2 -2
@@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 
 	if (dev = NULL) {
-		dprintk("get_key_flydvb_trio: "
-			 "gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_flydvb_trio: "
+			   "gir->c->adapter->algo_data is NULL!\n");

Sorry for noticing only now, but "gir->" in the comment is odd. As seen in the code above, it's actually "ir->". Maybe you want to fix this, as you are already touching that line anyway.

Other than this, this patch is:

Quoted 15 lines
drivers/media/video/saa7134/saa7134-input.c +2 -2
 		return -EIO;
 	}
 
@@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
 	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 	if (dev = NULL) {
-		dprintk("get_key_msi_tvanywhere_plus: "
-			"gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_msi_tvanywhere_plus: "
+			   "gir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
Signature · 1 line
Jean Delvare
#2 lore raw

PATCH v4 1/2 video/saa7134: change dprintk() to i2cdprintk()

The problem is that dprintk() dereferences "dev" which is null here. The i2cdprintk() uses "ir" so that's OK.

Also Jean Delvare pointed out a typo in the comment so we may as well fix that.

---
v2: Jean Delvare suggested that I use i2cdprintk() instead of modifying dprintk().
v3: V2 had a bonus cleanup that I removed from v3
v4: Fixed typo in the comment.

drivers/media/video/saa7134/saa7134-input.c +4 -4
index e5565e2..7691bf2 100644
@@ -141,8 +141,8 @@ static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 
 	if (dev = NULL) {
-		dprintk("get_key_flydvb_trio: "
-			 "gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_flydvb_trio: "
+			   "ir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}
 
@@ -195,8 +195,8 @@ static int get_key_msi_tvanywhere_plus(struct IR_i2c *ir, u32 *ir_key,
 	/* <dev> is needed to access GPIO. Used by the saa_readl macro. */
 	struct saa7134_dev *dev = ir->c->adapter->algo_data;
 	if (dev = NULL) {
-		dprintk("get_key_msi_tvanywhere_plus: "
-			"gir->c->adapter->algo_data is NULL!\n");
+		i2cdprintk("get_key_msi_tvanywhere_plus: "
+			   "ir->c->adapter->algo_data is NULL!\n");
 		return -EIO;
 	}