Skip to contentSkip to conversation

Staging: media: vino: Replace printk() and dprintk() with dev_dbg().

PATCH Superseded Ksenija Stanojevic 2 participants 8 messages Feb 17, 2015 – Feb 18, 2015

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: media: vino: Replace printk() and dprintk() with dev_dbg().

Making variants of existing macros is against kernel coding style. This patch removes all definitions made by macro dprinkt() and replaces them with dev_dbg().

---
 drivers/staging/media/vino/saa7191.c | 58 ++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 32 deletions(-)
drivers/staging/media/vino/saa7191.c +26 -32
index 087acab..2aa68c6 100644
@@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <[email protected]>");
 MODULE_LICENSE("GPL");
 
 
-/* #define SAA7191_DEBUG */
 
-#ifdef SAA7191_DEBUG
-#define dprintk(x...) printk("SAA7191: " x);
-#else
-#define dprintk(x...)
-#endif
 
 #define SAA7191_SYNC_COUNT	30
 #define SAA7191_SYNC_DELAY	100	/* milliseconds */
@@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev *sd, u8 *value)
 
 	ret = i2c_master_recv(client, value, 1);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed\n");
+		dev_dbg("saa7191_read_status(): read failed\n");
 		return ret;
 	}
 
@@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev *sd,
 
 	ret = i2c_master_send(client, data, length);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
+		dev_dbg("saa7191_write_block(): "
 		       "write failed\n");
 		return ret;
 	}
@@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
 
 	decoder->norm = norm;
 
-	dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
+	dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
 		stdc, chcv);
-	dprintk("norm: %llx\n", norm);
+	dev_dbg("norm: %llx\n", norm);
 
 	return 0;
 }
@@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
 {
 	int i = 0;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
 		if (saa7191_read_status(sd, status))
 			return -EIO;
 
 		if (((*status) & SAA7191_STATUS_HLCK) == 0) {
-			dprintk("Signal found\n");
+			dev_dbg("Signal found\n");
 			return 0;
 		}
 
 		msleep(SAA7191_SYNC_DELAY);
 	}
 
-	dprintk("No signal\n");
+	dev_dbg("No signal\n");
 
 	return -EBUSY;
 }
@@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 	v4l2_std_id old_norm = decoder->norm;
 	int err = 0;
 
-	dprintk("SAA7191 extended signal auto-detection...\n");
+	dev_dbg("SAA7191 extended signal auto-detection...\n");
 
 	*norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
 	stdc &= ~SAA7191_STDC_SECS;
@@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60Hz signal -> NTSC */
-		dprintk("60Hz signal: NTSC\n");
+		dev_dbg("60Hz signal: NTSC\n");
 		*norm &= V4L2_STD_NTSC;
 		return 0;
 	}
 
 	/* 50Hz signal */
-	dprintk("50Hz signal: Trying PAL...\n");
+	dev_dbg("50Hz signal: Trying PAL...\n");
 
 	/* try PAL first */
 	err = saa7191_s_std(sd, V4L2_STD_PAL);
@@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		saa7191_s_std(sd, old_norm);
 		*norm = V4L2_STD_UNKNOWN;
 		return 0;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		*norm &= V4L2_STD_PAL;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with PAL - Trying SECAM...\n");
+	dev_dbg("No color detected with PAL - Trying SECAM...\n");
 
 	/* no color detected ? -> try SECAM */
 	err = saa7191_s_std(sd, V4L2_STD_SECAM);
@@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		*norm = V4L2_STD_UNKNOWN;
 		goto out;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
 		/* Color detected -> SECAM */
-		dprintk("SECAM\n");
+		dev_dbg("SECAM\n");
 		*norm &= V4L2_STD_SECAM;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with SECAM - Going back to PAL.\n");
+	dev_dbg("No color detected with SECAM - Going back to PAL.\n");
 	*norm = V4L2_STD_UNKNOWN;
 
 out:
@@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)
 {
 	u8 status;
 
-	dprintk("SAA7191 signal auto-detection...\n");
+	dev_dbg("SAA7191 signal auto-detection...\n");
 
-	dprintk("Reading status...\n");
+	dev_dbg("Reading status...\n");
 
 	if (saa7191_read_status(sd, &status))
 		return -EIO;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	/* no signal ? */
 	if (status & SAA7191_STATUS_HLCK) {
-		dprintk("No signal\n");
+		dev_dbg("No signal\n");
 		return -EBUSY;
 	}
 
-	dprintk("Signal found\n");
+	dev_dbg("Signal found\n");
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60hz signal -> NTSC */
-		dprintk("NTSC\n");
+		dev_dbg("NTSC\n");
 		return saa7191_s_std(sd, V4L2_STD_NTSC);
 	} else {
 		/* 50hz signal -> PAL */
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		return saa7191_s_std(sd, V4L2_STD_PAL);
 	}
 }
@@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
 
 	err = saa7191_write_block(sd, sizeof(initseq), initseq);
 	if (err) {
-		printk(KERN_ERR "SAA7191 initialization failed\n");
+		dev_dbg("SAA7191 initialization failed\n");
 		return err;
 	}
 
-	printk(KERN_INFO "SAA7191 initialized\n");
+	dev_dbg("SAA7191 initialized\n");
 
 	decoder->input = SAA7191_INPUT_COMPOSITE;
 	decoder->norm = V4L2_STD_PAL;
 
 	err = saa7191_autodetect_norm(sd);
 	if (err && (err != -EBUSY))
-		printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
+		dev_dbg("SAA7191: Signal auto-detection failed\n");
 
 	return 0;
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Ksenija Stanojevic

Making variants of existing macros is against kernel coding style. This patch removes all definitions made by macro dprinkt() and replaces them with dev_dbg().

---

What change is made for v2?

julia

Quoted 217 lines
 drivers/staging/media/vino/saa7191.c | 58 ++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 32 deletions(-)
drivers/staging/media/vino/saa7191.c +26 -32
index 087acab..2aa68c6 100644
@@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <[email protected]>");
 MODULE_LICENSE("GPL");
 
 
-/* #define SAA7191_DEBUG */
 
-#ifdef SAA7191_DEBUG
-#define dprintk(x...) printk("SAA7191: " x);
-#else
-#define dprintk(x...)
-#endif
 
 #define SAA7191_SYNC_COUNT	30
 #define SAA7191_SYNC_DELAY	100	/* milliseconds */
@@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev *sd, u8 *value)
 
 	ret = i2c_master_recv(client, value, 1);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed\n");
+		dev_dbg("saa7191_read_status(): read failed\n");
 		return ret;
 	}
 
@@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev *sd,
 
 	ret = i2c_master_send(client, data, length);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
+		dev_dbg("saa7191_write_block(): "
 		       "write failed\n");
 		return ret;
 	}
@@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
 
 	decoder->norm = norm;
 
-	dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
+	dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
 		stdc, chcv);
-	dprintk("norm: %llx\n", norm);
+	dev_dbg("norm: %llx\n", norm);
 
 	return 0;
 }
@@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
 {
 	int i = 0;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
 		if (saa7191_read_status(sd, status))
 			return -EIO;
 
 		if (((*status) & SAA7191_STATUS_HLCK) == 0) {
-			dprintk("Signal found\n");
+			dev_dbg("Signal found\n");
 			return 0;
 		}
 
 		msleep(SAA7191_SYNC_DELAY);
 	}
 
-	dprintk("No signal\n");
+	dev_dbg("No signal\n");
 
 	return -EBUSY;
 }
@@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 	v4l2_std_id old_norm = decoder->norm;
 	int err = 0;
 
-	dprintk("SAA7191 extended signal auto-detection...\n");
+	dev_dbg("SAA7191 extended signal auto-detection...\n");
 
 	*norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
 	stdc &= ~SAA7191_STDC_SECS;
@@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60Hz signal -> NTSC */
-		dprintk("60Hz signal: NTSC\n");
+		dev_dbg("60Hz signal: NTSC\n");
 		*norm &= V4L2_STD_NTSC;
 		return 0;
 	}
 
 	/* 50Hz signal */
-	dprintk("50Hz signal: Trying PAL...\n");
+	dev_dbg("50Hz signal: Trying PAL...\n");
 
 	/* try PAL first */
 	err = saa7191_s_std(sd, V4L2_STD_PAL);
@@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		saa7191_s_std(sd, old_norm);
 		*norm = V4L2_STD_UNKNOWN;
 		return 0;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		*norm &= V4L2_STD_PAL;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with PAL - Trying SECAM...\n");
+	dev_dbg("No color detected with PAL - Trying SECAM...\n");
 
 	/* no color detected ? -> try SECAM */
 	err = saa7191_s_std(sd, V4L2_STD_SECAM);
@@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		*norm = V4L2_STD_UNKNOWN;
 		goto out;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
 		/* Color detected -> SECAM */
-		dprintk("SECAM\n");
+		dev_dbg("SECAM\n");
 		*norm &= V4L2_STD_SECAM;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with SECAM - Going back to PAL.\n");
+	dev_dbg("No color detected with SECAM - Going back to PAL.\n");
 	*norm = V4L2_STD_UNKNOWN;
 
 out:
@@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)
 {
 	u8 status;
 
-	dprintk("SAA7191 signal auto-detection...\n");
+	dev_dbg("SAA7191 signal auto-detection...\n");
 
-	dprintk("Reading status...\n");
+	dev_dbg("Reading status...\n");
 
 	if (saa7191_read_status(sd, &status))
 		return -EIO;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	/* no signal ? */
 	if (status & SAA7191_STATUS_HLCK) {
-		dprintk("No signal\n");
+		dev_dbg("No signal\n");
 		return -EBUSY;
 	}
 
-	dprintk("Signal found\n");
+	dev_dbg("Signal found\n");
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60hz signal -> NTSC */
-		dprintk("NTSC\n");
+		dev_dbg("NTSC\n");
 		return saa7191_s_std(sd, V4L2_STD_NTSC);
 	} else {
 		/* 50hz signal -> PAL */
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		return saa7191_s_std(sd, V4L2_STD_PAL);
 	}
 }
@@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
 
 	err = saa7191_write_block(sd, sizeof(initseq), initseq);
 	if (err) {
-		printk(KERN_ERR "SAA7191 initialization failed\n");
+		dev_dbg("SAA7191 initialization failed\n");
 		return err;
 	}
 
-	printk(KERN_INFO "SAA7191 initialized\n");
+	dev_dbg("SAA7191 initialized\n");
 
 	decoder->input = SAA7191_INPUT_COMPOSITE;
 	decoder->norm = V4L2_STD_PAL;
 
 	err = saa7191_autodetect_norm(sd);
 	if (err && (err != -EBUSY))
-		printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
+		dev_dbg("SAA7191: Signal auto-detection failed\n");
 
 	return 0;
 }
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-send-email-ksenija.stanojevic%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
#2 lore raw

I removed variables KERN_ERR and KERN_INFO
and added device argument to dev_dbg in line 230, I don't know where else
to put that argument.

Quoted 248 lines · Julia Lawall
Quoted 6 lines · Ksenija Stanojevic

Making variants of existing macros is against kernel coding style. This patch removes all definitions made by macro dprinkt() and replaces them with dev_dbg().

---

What change is made for v2?

julia

Quoted 1 line
 drivers/staging/media/vino/saa7191.c | 58

++++++++++++++++--------------------

Review

Quoted 3 lines
 1 file changed, 26 insertions(+), 32 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/media/vino/saa7191.c

drivers/staging/media/vino/saa7191.c static int saa7191_read_status(struct v4l2_subdev

Quoted 19 lines

index 087acab..2aa68c6 100644

drivers/staging/media/vino/saa7191.c +0 -6
@@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <[email protected]
 ");
 MODULE_LICENSE("GPL");
 
 
-/* #define SAA7191_DEBUG */
 
-#ifdef SAA7191_DEBUG
-#define dprintk(x...) printk("SAA7191: " x);
-#else
-#define dprintk(x...)
-#endif
 
 #define SAA7191_SYNC_COUNT   30

#define SAA7191_SYNC_DELAY 100 /* milliseconds */

drivers/staging/media/vino/saa7191.c +0 -0
@@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev

*sd, u8 *value)

drivers/staging/media/vino/saa7191.c static int saa7191_read_status(struct v4l2_subdev *sd, u8 *value)

Quoted 4 lines
drivers/staging/media/vino/saa7191.c +0 -1
      ret = i2c_master_recv(client, value, 1);
      if (ret < 0) {
-             printk(KERN_ERR "SAA7191: saa7191_read_status(): read

failed\n");

drivers/staging/media/vino/saa7191.c static int saa7191_write_block(struct v4l2_subdev

Quoted 5 lines
drivers/staging/media/vino/saa7191.c +1 -0
+             dev_dbg("saa7191_read_status(): read failed\n");
              return ret;
      }
 
@@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev

*sd,

drivers/staging/media/vino/saa7191.c static int saa7191_s_std(struct v4l2_subdev *sd,

Quoted 9 lines
drivers/staging/media/vino/saa7191.c +1 -1
      ret = i2c_master_send(client, data, length);
      if (ret < 0) {
-             printk(KERN_ERR "SAA7191: saa7191_write_block(): "
+             dev_dbg("saa7191_write_block(): "
                     "write failed\n");
              return ret;
      }
@@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd,

v4l2_std_id norm)

drivers/staging/media/vino/saa7191.c static int saa7191_wait_for_signal(struct

Quoted 12 lines
drivers/staging/media/vino/saa7191.c +2 -2
      decoder->norm = norm;
 
-     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
+     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
              stdc, chcv);
-     dprintk("norm: %llx\n", norm);
+     dev_dbg("norm: %llx\n", norm);
 
      return 0;
 }
@@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct

v4l2_subdev *sd, u8 *status)

drivers/staging/media/vino/saa7191.c static int saa7191_querystd(struct v4l2_subdev *sd,

Quoted 25 lines
drivers/staging/media/vino/saa7191.c +3 -3
 {
      int i = 0;
 
-     dprintk("Checking for signal...\n");
+     dev_dbg("Checking for signal...\n");
 
      for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
              if (saa7191_read_status(sd, status))
                      return -EIO;
 
              if (((*status) & SAA7191_STATUS_HLCK) == 0) {
-                     dprintk("Signal found\n");
+                     dev_dbg("Signal found\n");
                      return 0;
              }
 
              msleep(SAA7191_SYNC_DELAY);
      }
 
-     dprintk("No signal\n");
+     dev_dbg("No signal\n");
 
      return -EBUSY;
 }
@@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd,

v4l2_std_id *norm)

drivers/staging/media/vino/saa7191.c static int saa7191_querystd(struct v4l2_subdev

Quoted 9 lines
drivers/staging/media/vino/saa7191.c +1 -1
      v4l2_std_id old_norm = decoder->norm;
      int err = 0;
 
-     dprintk("SAA7191 extended signal auto-detection...\n");
+     dev_dbg("SAA7191 extended signal auto-detection...\n");
 
      *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
      stdc &= ~SAA7191_STDC_SECS;
@@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev

*sd, v4l2_std_id *norm)

drivers/staging/media/vino/saa7191.c static int saa7191_querystd(struct v4l2_subdev

Quoted 16 lines
drivers/staging/media/vino/saa7191.c +2 -2
      if (status & SAA7191_STATUS_FIDT) {
              /* 60Hz signal -> NTSC */
-             dprintk("60Hz signal: NTSC\n");
+             dev_dbg("60Hz signal: NTSC\n");
              *norm &= V4L2_STD_NTSC;
              return 0;
      }
 
      /* 50Hz signal */
-     dprintk("50Hz signal: Trying PAL...\n");
+     dev_dbg("50Hz signal: Trying PAL...\n");
 
      /* try PAL first */
      err = saa7191_s_std(sd, V4L2_STD_PAL);
@@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev

*sd, v4l2_std_id *norm)

drivers/staging/media/vino/saa7191.c static int saa7191_querystd(struct v4l2_subdev

Quoted 23 lines
drivers/staging/media/vino/saa7191.c +3 -3
      /* not 50Hz ? */
      if (status & SAA7191_STATUS_FIDT) {
-             dprintk("No 50Hz signal\n");
+             dev_dbg("No 50Hz signal\n");
              saa7191_s_std(sd, old_norm);
              *norm = V4L2_STD_UNKNOWN;
              return 0;
      }
 
      if (status & SAA7191_STATUS_CODE) {
-             dprintk("PAL\n");
+             dev_dbg("PAL\n");
              *norm &= V4L2_STD_PAL;
              return saa7191_s_std(sd, old_norm);
      }
 
-     dprintk("No color detected with PAL - Trying SECAM...\n");
+     dev_dbg("No color detected with PAL - Trying SECAM...\n");
 
      /* no color detected ? -> try SECAM */
      err = saa7191_s_std(sd, V4L2_STD_SECAM);
@@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev

*sd, v4l2_std_id *norm)

drivers/staging/media/vino/saa7191.c static int saa7191_autodetect_norm(struct

Quoted 23 lines
drivers/staging/media/vino/saa7191.c +3 -3
      /* not 50Hz ? */
      if (status & SAA7191_STATUS_FIDT) {
-             dprintk("No 50Hz signal\n");
+             dev_dbg("No 50Hz signal\n");
              *norm = V4L2_STD_UNKNOWN;
              goto out;
      }
 
      if (status & SAA7191_STATUS_CODE) {
              /* Color detected -> SECAM */
-             dprintk("SECAM\n");
+             dev_dbg("SECAM\n");
              *norm &= V4L2_STD_SECAM;
              return saa7191_s_std(sd, old_norm);
      }
 
-     dprintk("No color detected with SECAM - Going back to PAL.\n");
+     dev_dbg("No color detected with SECAM - Going back to PAL.\n");
      *norm = V4L2_STD_UNKNOWN;
 
 out:
@@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct

v4l2_subdev *sd)

Quoted 62 lines
drivers/staging/media/vino/saa7191.c +10 -11
 {
      u8 status;
 
-     dprintk("SAA7191 signal auto-detection...\n");
+     dev_dbg("SAA7191 signal auto-detection...\n");
 
-     dprintk("Reading status...\n");
+     dev_dbg("Reading status...\n");
 
      if (saa7191_read_status(sd, &status))
              return -EIO;
 
-     dprintk("Checking for signal...\n");
+     dev_dbg("Checking for signal...\n");
 
      /* no signal ? */
      if (status & SAA7191_STATUS_HLCK) {
-             dprintk("No signal\n");
+             dev_dbg("No signal\n");
              return -EBUSY;
      }
 
-     dprintk("Signal found\n");
+     dev_dbg("Signal found\n");
 
      if (status & SAA7191_STATUS_FIDT) {
              /* 60hz signal -> NTSC */
-             dprintk("NTSC\n");
+             dev_dbg("NTSC\n");
              return saa7191_s_std(sd, V4L2_STD_NTSC);
      } else {
              /* 50hz signal -> PAL */
-             dprintk("PAL\n");
+             dev_dbg("PAL\n");
              return saa7191_s_std(sd, V4L2_STD_PAL);
      }
 }
@@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
 
      err = saa7191_write_block(sd, sizeof(initseq), initseq);
      if (err) {
-             printk(KERN_ERR "SAA7191 initialization failed\n");
+             dev_dbg("SAA7191 initialization failed\n");
              return err;
      }
 
-     printk(KERN_INFO "SAA7191 initialized\n");
+     dev_dbg("SAA7191 initialized\n");
 
      decoder->input = SAA7191_INPUT_COMPOSITE;
      decoder->norm = V4L2_STD_PAL;
 
      err = saa7191_autodetect_norm(sd);
      if (err && (err != -EBUSY))
-             printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
+             dev_dbg("SAA7191: Signal auto-detection failed\n");
 
      return 0;
 }
--

1.9.1

Quoted 2 lines

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-send-email-ksenija.stanojevic%40gmail.com
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 2 lines · Ksenija Stanojević

I removed variables KERN_ERR and KERN_INFO and added device argument to dev_dbg in line 230,

When you send a v2 patch, you could describe the change that you have made as compared to the previous patch under the ---

Quoted 1 line

I don't know where else to put that argument.

Every call to dev_dbg needs a pointer to a device structure as the first argument.

Did you compile your code? If so, perhaps this file was not selected in your configuration and thus it was not compiled. You can see if it was compiled by looking to see if it has a corresponding .o file. If not, you can try selecting the driver in your configuration.

julia

Quoted 277 lines

On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall <[email protected]> wrote:

      On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:

      > Making variants of existing macros is against kernel coding
      style. This
      > patch removes all definitions made by macro dprinkt() and
      replaces them
      > with dev_dbg().
      >
      > Signed-off-by: Ksenija Stanojevic
      <[email protected]>
      > ---

      What change is made for v2?

      julia

      >  drivers/staging/media/vino/saa7191.c | 58
      ++++++++++++++++--------------------
      >  1 file changed, 26 insertions(+), 32 deletions(-)
      >
      > diff --git a/drivers/staging/media/vino/saa7191.c
      b/drivers/staging/media/vino/saa7191.c
      > index 087acab..2aa68c6 100644
      > --- a/drivers/staging/media/vino/saa7191.c
      > +++ b/drivers/staging/media/vino/saa7191.c
      > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen
      <[email protected]>");
      >  MODULE_LICENSE("GPL");
      >
      >
      > -/* #define SAA7191_DEBUG */
      >
      > -#ifdef SAA7191_DEBUG
      > -#define dprintk(x...) printk("SAA7191: " x);
      > -#else
      > -#define dprintk(x...)
      > -#endif
      >
      >  #define SAA7191_SYNC_COUNT   30
      >  #define SAA7191_SYNC_DELAY   100     /* milliseconds */
      > @@ -116,7 +110,7 @@ static int saa7191_read_status(struct
      v4l2_subdev *sd, u8 *value)
      >
      >       ret = i2c_master_recv(client, value, 1);
      >       if (ret < 0) {
      > -             printk(KERN_ERR "SAA7191:
      saa7191_read_status(): read failed\n");
      > +             dev_dbg("saa7191_read_status(): read
      failed\n");
      >               return ret;
      >       }
      >
      > @@ -147,7 +141,7 @@ static int saa7191_write_block(struct
      v4l2_subdev *sd,
      >
      >       ret = i2c_master_send(client, data, length);
      >       if (ret < 0) {
      > -             printk(KERN_ERR "SAA7191:
      saa7191_write_block(): "
      > +             dev_dbg("saa7191_write_block(): "
      >                      "write failed\n");
      >               return ret;
      >       }
      > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct
      v4l2_subdev *sd, v4l2_std_id norm)
      >
      >       decoder->norm = norm;
      >
      > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
      > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n",
      ctl3,
      >               stdc, chcv);
      > -     dprintk("norm: %llx\n", norm);
      > +     dev_dbg("norm: %llx\n", norm);
      >
      >       return 0;
      >  }
      > @@ -241,21 +235,21 @@ static int
      saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
      >  {
      >       int i = 0;
      >
      > -     dprintk("Checking for signal...\n");
      > +     dev_dbg("Checking for signal...\n");
      >
      >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
      >               if (saa7191_read_status(sd, status))
      >                       return -EIO;
      >
      >               if (((*status) & SAA7191_STATUS_HLCK) == 0) {
      > -                     dprintk("Signal found\n");
      > +                     dev_dbg("Signal found\n");
      >                       return 0;
      >               }
      >
      >               msleep(SAA7191_SYNC_DELAY);
      >       }
      >
      > -     dprintk("No signal\n");
      > +     dev_dbg("No signal\n");
      >
      >       return -EBUSY;
      >  }
      > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct
      v4l2_subdev *sd, v4l2_std_id *norm)
      >       v4l2_std_id old_norm = decoder->norm;
      >       int err = 0;
      >
      > -     dprintk("SAA7191 extended signal auto-detection...\n");
      > +     dev_dbg("SAA7191 extended signal auto-detection...\n");
      >
      >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
      >       stdc &= ~SAA7191_STDC_SECS;
      > @@ -301,13 +295,13 @@ static int saa7191_querystd(struct
      v4l2_subdev *sd, v4l2_std_id *norm)
      >
      >       if (status & SAA7191_STATUS_FIDT) {
      >               /* 60Hz signal -> NTSC */
      > -             dprintk("60Hz signal: NTSC\n");
      > +             dev_dbg("60Hz signal: NTSC\n");
      >               *norm &= V4L2_STD_NTSC;
      >               return 0;
      >       }
      >
      >       /* 50Hz signal */
      > -     dprintk("50Hz signal: Trying PAL...\n");
      > +     dev_dbg("50Hz signal: Trying PAL...\n");
      >
      >       /* try PAL first */
      >       err = saa7191_s_std(sd, V4L2_STD_PAL);
      > @@ -322,19 +316,19 @@ static int saa7191_querystd(struct
      v4l2_subdev *sd, v4l2_std_id *norm)
      >
      >       /* not 50Hz ? */
      >       if (status & SAA7191_STATUS_FIDT) {
      > -             dprintk("No 50Hz signal\n");
      > +             dev_dbg("No 50Hz signal\n");
      >               saa7191_s_std(sd, old_norm);
      >               *norm = V4L2_STD_UNKNOWN;
      >               return 0;
      >       }
      >
      >       if (status & SAA7191_STATUS_CODE) {
      > -             dprintk("PAL\n");
      > +             dev_dbg("PAL\n");
      >               *norm &= V4L2_STD_PAL;
      >               return saa7191_s_std(sd, old_norm);
      >       }
      >
      > -     dprintk("No color detected with PAL - Trying
      SECAM...\n");
      > +     dev_dbg("No color detected with PAL - Trying
      SECAM...\n");
      >
      >       /* no color detected ? -> try SECAM */
      >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
      > @@ -349,19 +343,19 @@ static int saa7191_querystd(struct
      v4l2_subdev *sd, v4l2_std_id *norm)
      >
      >       /* not 50Hz ? */
      >       if (status & SAA7191_STATUS_FIDT) {
      > -             dprintk("No 50Hz signal\n");
      > +             dev_dbg("No 50Hz signal\n");
      >               *norm = V4L2_STD_UNKNOWN;
      >               goto out;
      >       }
      >
      >       if (status & SAA7191_STATUS_CODE) {
      >               /* Color detected -> SECAM */
      > -             dprintk("SECAM\n");
      > +             dev_dbg("SECAM\n");
      >               *norm &= V4L2_STD_SECAM;
      >               return saa7191_s_std(sd, old_norm);
      >       }
      >
      > -     dprintk("No color detected with SECAM - Going back to
      PAL.\n");
      > +     dev_dbg("No color detected with SECAM - Going back to
      PAL.\n");
      >       *norm = V4L2_STD_UNKNOWN;
      >
      >  out:
      > @@ -372,30 +366,30 @@ static int
      saa7191_autodetect_norm(struct v4l2_subdev *sd)
      >  {
      >       u8 status;
      >
      > -     dprintk("SAA7191 signal auto-detection...\n");
      > +     dev_dbg("SAA7191 signal auto-detection...\n");
      >
      > -     dprintk("Reading status...\n");
      > +     dev_dbg("Reading status...\n");
      >
      >       if (saa7191_read_status(sd, &status))
      >               return -EIO;
      >
      > -     dprintk("Checking for signal...\n");
      > +     dev_dbg("Checking for signal...\n");
      >
      >       /* no signal ? */
      >       if (status & SAA7191_STATUS_HLCK) {
      > -             dprintk("No signal\n");
      > +             dev_dbg("No signal\n");
      >               return -EBUSY;
      >       }
      >
      > -     dprintk("Signal found\n");
      > +     dev_dbg("Signal found\n");
      >
      >       if (status & SAA7191_STATUS_FIDT) {
      >               /* 60hz signal -> NTSC */
      > -             dprintk("NTSC\n");
      > +             dev_dbg("NTSC\n");
      >               return saa7191_s_std(sd, V4L2_STD_NTSC);
      >       } else {
      >               /* 50hz signal -> PAL */
      > -             dprintk("PAL\n");
      > +             dev_dbg("PAL\n");
      >               return saa7191_s_std(sd, V4L2_STD_PAL);
      >       }
      >  }
      > @@ -606,18 +600,18 @@ static int saa7191_probe(struct
      i2c_client *client,
      >
      >       err = saa7191_write_block(sd, sizeof(initseq),
      initseq);
      >       if (err) {
      > -             printk(KERN_ERR "SAA7191 initialization
      failed\n");
      > +             dev_dbg("SAA7191 initialization failed\n");
      >               return err;
      >       }
      >
      > -     printk(KERN_INFO "SAA7191 initialized\n");
      > +     dev_dbg("SAA7191 initialized\n");
      >
      >       decoder->input = SAA7191_INPUT_COMPOSITE;
      >       decoder->norm = V4L2_STD_PAL;
      >
      >       err = saa7191_autodetect_norm(sd);
      >       if (err && (err != -EBUSY))
      > -             printk(KERN_ERR "SAA7191: Signal auto-detection
      failed\n");
      > +             dev_dbg("SAA7191: Signal auto-detection
      failed\n");
      >
      >       return 0;
      >  }
      > --
      > 1.9.1
      >
Quoted 2 lines

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

Quoted 1 line

To post to this group, send email to

[email protected].

Quoted 1 line

To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-

send-email-ksenija.stanojevic%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7uApK y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw

I missunderstood how dev_dbg works.
i did compile my code and it haven't shown any errors, but I don't have corresponding .ko file

Quoted 304 lines · Julia Lawall
Quoted 2 lines · Ksenija Stanojević

I removed variables KERN_ERR and KERN_INFO
and added device argument to dev_dbg in line 230,

When you send a v2 patch, you could describe the change that you have made as compared to the previous patch under the ---

Quoted 1 line

I don't know where else to put that argument.

Every call to dev_dbg needs a pointer to a device structure as the first argument.

Did you compile your code? If so, perhaps this file was not selected in your configuration and thus it was not compiled. You can see if it was compiled by looking to see if it has a corresponding .o file. If not, you can try selecting the driver in your configuration.

julia

Quoted 1 line

On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall <[email protected]

<javascript:>>

Quoted 252 lines

wrote:

      On Tue, 17 Feb 2015, Ksenija Stanojevic wrote: 

      > Making variants of existing macros is against kernel coding 
      style. This 
      > patch removes all definitions made by macro dprinkt() and 
      replaces them 
      > with dev_dbg(). 
      > 
      > Signed-off-by: Ksenija Stanojevic 
      <[email protected] <javascript:>> 
      > --- 

      What change is made for v2? 

      julia 

      >  drivers/staging/media/vino/saa7191.c | 58 
      ++++++++++++++++-------------------- 
      >  1 file changed, 26 insertions(+), 32 deletions(-) 
      > 
      > diff --git a/drivers/staging/media/vino/saa7191.c 
      b/drivers/staging/media/vino/saa7191.c 
      > index 087acab..2aa68c6 100644 
      > --- a/drivers/staging/media/vino/saa7191.c 
      > +++ b/drivers/staging/media/vino/saa7191.c 
      > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen 
      <[email protected] <javascript:>>"); 
      >  MODULE_LICENSE("GPL"); 
      > 
      > 
      > -/* #define SAA7191_DEBUG */ 
      > 
      > -#ifdef SAA7191_DEBUG 
      > -#define dprintk(x...) printk("SAA7191: " x); 
      > -#else 
      > -#define dprintk(x...) 
      > -#endif 
      > 
      >  #define SAA7191_SYNC_COUNT   30 
      >  #define SAA7191_SYNC_DELAY   100     /* milliseconds */ 
      > @@ -116,7 +110,7 @@ static int saa7191_read_status(struct 
      v4l2_subdev *sd, u8 *value) 
      > 
      >       ret = i2c_master_recv(client, value, 1); 
      >       if (ret < 0) { 
      > -             printk(KERN_ERR "SAA7191: 
      saa7191_read_status(): read failed\n"); 
      > +             dev_dbg("saa7191_read_status(): read 
      failed\n"); 
      >               return ret; 
      >       } 
      > 
      > @@ -147,7 +141,7 @@ static int saa7191_write_block(struct 
      v4l2_subdev *sd, 
      > 
      >       ret = i2c_master_send(client, data, length); 
      >       if (ret < 0) { 
      > -             printk(KERN_ERR "SAA7191: 
      saa7191_write_block(): " 
      > +             dev_dbg("saa7191_write_block(): " 
      >                      "write failed\n"); 
      >               return ret; 
      >       } 
      > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct 
      v4l2_subdev *sd, v4l2_std_id norm) 
      > 
      >       decoder->norm = norm; 
      > 
      > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3, 
      > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", 
      ctl3, 
      >               stdc, chcv); 
      > -     dprintk("norm: %llx\n", norm); 
      > +     dev_dbg("norm: %llx\n", norm); 
      > 
      >       return 0; 
      >  } 
      > @@ -241,21 +235,21 @@ static int 
      saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status) 
      >  { 
      >       int i = 0; 
      > 
      > -     dprintk("Checking for signal...\n"); 
      > +     dev_dbg("Checking for signal...\n"); 
      > 
      >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) { 
      >               if (saa7191_read_status(sd, status)) 
      >                       return -EIO; 
      > 
      >               if (((*status) & SAA7191_STATUS_HLCK) == 0) { 
      > -                     dprintk("Signal found\n"); 
      > +                     dev_dbg("Signal found\n"); 
      >                       return 0; 
      >               } 
      > 
      >               msleep(SAA7191_SYNC_DELAY); 
      >       } 
      > 
      > -     dprintk("No signal\n"); 
      > +     dev_dbg("No signal\n"); 
      > 
      >       return -EBUSY; 
      >  } 
      > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct 
      v4l2_subdev *sd, v4l2_std_id *norm) 
      >       v4l2_std_id old_norm = decoder->norm; 
      >       int err = 0; 
      > 
      > -     dprintk("SAA7191 extended signal auto-detection...\n"); 
      > +     dev_dbg("SAA7191 extended signal auto-detection...\n"); 
      > 
      >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM; 
      >       stdc &= ~SAA7191_STDC_SECS; 
      > @@ -301,13 +295,13 @@ static int saa7191_querystd(struct 
      v4l2_subdev *sd, v4l2_std_id *norm) 
      > 
      >       if (status & SAA7191_STATUS_FIDT) { 
      >               /* 60Hz signal -> NTSC */ 
      > -             dprintk("60Hz signal: NTSC\n"); 
      > +             dev_dbg("60Hz signal: NTSC\n"); 
      >               *norm &= V4L2_STD_NTSC; 
      >               return 0; 
      >       } 
      > 
      >       /* 50Hz signal */ 
      > -     dprintk("50Hz signal: Trying PAL...\n"); 
      > +     dev_dbg("50Hz signal: Trying PAL...\n"); 
      > 
      >       /* try PAL first */ 
      >       err = saa7191_s_std(sd, V4L2_STD_PAL); 
      > @@ -322,19 +316,19 @@ static int saa7191_querystd(struct 
      v4l2_subdev *sd, v4l2_std_id *norm) 
      > 
      >       /* not 50Hz ? */ 
      >       if (status & SAA7191_STATUS_FIDT) { 
      > -             dprintk("No 50Hz signal\n"); 
      > +             dev_dbg("No 50Hz signal\n"); 
      >               saa7191_s_std(sd, old_norm); 
      >               *norm = V4L2_STD_UNKNOWN; 
      >               return 0; 
      >       } 
      > 
      >       if (status & SAA7191_STATUS_CODE) { 
      > -             dprintk("PAL\n"); 
      > +             dev_dbg("PAL\n"); 
      >               *norm &= V4L2_STD_PAL; 
      >               return saa7191_s_std(sd, old_norm); 
      >       } 
      > 
      > -     dprintk("No color detected with PAL - Trying 
      SECAM...\n"); 
      > +     dev_dbg("No color detected with PAL - Trying 
      SECAM...\n"); 
      > 
      >       /* no color detected ? -> try SECAM */ 
      >       err = saa7191_s_std(sd, V4L2_STD_SECAM); 
      > @@ -349,19 +343,19 @@ static int saa7191_querystd(struct 
      v4l2_subdev *sd, v4l2_std_id *norm) 
      > 
      >       /* not 50Hz ? */ 
      >       if (status & SAA7191_STATUS_FIDT) { 
      > -             dprintk("No 50Hz signal\n"); 
      > +             dev_dbg("No 50Hz signal\n"); 
      >               *norm = V4L2_STD_UNKNOWN; 
      >               goto out; 
      >       } 
      > 
      >       if (status & SAA7191_STATUS_CODE) { 
      >               /* Color detected -> SECAM */ 
      > -             dprintk("SECAM\n"); 
      > +             dev_dbg("SECAM\n"); 
      >               *norm &= V4L2_STD_SECAM; 
      >               return saa7191_s_std(sd, old_norm); 
      >       } 
      > 
      > -     dprintk("No color detected with SECAM - Going back to 
      PAL.\n"); 
      > +     dev_dbg("No color detected with SECAM - Going back to 
      PAL.\n"); 
      >       *norm = V4L2_STD_UNKNOWN; 
      > 
      >  out: 
      > @@ -372,30 +366,30 @@ static int 
      saa7191_autodetect_norm(struct v4l2_subdev *sd) 
      >  { 
      >       u8 status; 
      > 
      > -     dprintk("SAA7191 signal auto-detection...\n"); 
      > +     dev_dbg("SAA7191 signal auto-detection...\n"); 
      > 
      > -     dprintk("Reading status...\n"); 
      > +     dev_dbg("Reading status...\n"); 
      > 
      >       if (saa7191_read_status(sd, &status)) 
      >               return -EIO; 
      > 
      > -     dprintk("Checking for signal...\n"); 
      > +     dev_dbg("Checking for signal...\n"); 
      > 
      >       /* no signal ? */ 
      >       if (status & SAA7191_STATUS_HLCK) { 
      > -             dprintk("No signal\n"); 
      > +             dev_dbg("No signal\n"); 
      >               return -EBUSY; 
      >       } 
      > 
      > -     dprintk("Signal found\n"); 
      > +     dev_dbg("Signal found\n"); 
      > 
      >       if (status & SAA7191_STATUS_FIDT) { 
      >               /* 60hz signal -> NTSC */ 
      > -             dprintk("NTSC\n"); 
      > +             dev_dbg("NTSC\n"); 
      >               return saa7191_s_std(sd, V4L2_STD_NTSC); 
      >       } else { 
      >               /* 50hz signal -> PAL */ 
      > -             dprintk("PAL\n"); 
      > +             dev_dbg("PAL\n"); 
      >               return saa7191_s_std(sd, V4L2_STD_PAL); 
      >       } 
      >  } 
      > @@ -606,18 +600,18 @@ static int saa7191_probe(struct 
      i2c_client *client, 
      > 
      >       err = saa7191_write_block(sd, sizeof(initseq), 
      initseq); 
      >       if (err) { 
      > -             printk(KERN_ERR "SAA7191 initialization 
      failed\n"); 
      > +             dev_dbg("SAA7191 initialization failed\n"); 
      >               return err; 
      >       } 
      > 
      > -     printk(KERN_INFO "SAA7191 initialized\n"); 
      > +     dev_dbg("SAA7191 initialized\n"); 
      > 
      >       decoder->input = SAA7191_INPUT_COMPOSITE; 
      >       decoder->norm = V4L2_STD_PAL; 
      > 
      >       err = saa7191_autodetect_norm(sd); 
      >       if (err && (err != -EBUSY)) 
      > -             printk(KERN_ERR "SAA7191: Signal auto-detection 
      failed\n"); 
      > +             dev_dbg("SAA7191: Signal auto-detection 
      failed\n"); 
      > 
      >       return 0; 
      >  } 
      > -- 
      > 1.9.1 
      > 
Quoted 8 lines
Quoted 2 lines
Signature · 1 line
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to

[email protected] <javascript:>.

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-

Quoted 7 lines

send-email-ksenija.stanojevic%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

Signature · 1 line
You received this message because you are subscribed to the Google 

Groups

Quoted 2 lines

"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send

an

Quoted 2 lines

email to [email protected] <javascript:>. To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7uApK

Quoted 4 lines

y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

#5 lore raw
Quoted 3 lines · Ksenija Stanojevic

I missunderstood how dev_dbg works.
i did compile my code and it haven't shown any errors, but I don't have corresponding .ko file

OK, you can try

make drivers/staging/media/vino/saa7191.o

julia

Quoted 343 lines · Julia Lawall
      On Tue, 17 Feb 2015, Ksenija Stanojević wrote:

      > I removed variables KERN_ERR and KERN_INFO
      >  and added device argument to dev_dbg in line 230,

      When you send a v2 patch, you could describe the change that you
      have made
      as compared to the previous patch under the ---

      > I don't know where else to put that argument.

      Every call to dev_dbg needs a pointer to a device structure as
      the first
      argument.

      Did you compile your code?  If so, perhaps this file was not
      selected in
      your configuration and thus it was not compiled.  You can see if
      it was
      compiled by looking to see if it has a corresponding .o file.
       If not, you
      can try selecting the driver in your configuration.

      julia

      > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall
      <[email protected]>
      > wrote:
      >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
      >
      >       > Making variants of existing macros is against kernel
      coding
      >       style. This
      >       > patch removes all definitions made by macro dprinkt()
      and
      >       replaces them
      >       > with dev_dbg().
      >       >
      >       > Signed-off-by: Ksenija Stanojevic
      >       <[email protected]>
      >       > ---
      >
      >       What change is made for v2?
      >
      >       julia
      >
      >       >  drivers/staging/media/vino/saa7191.c | 58
      >       ++++++++++++++++--------------------
      >       >  1 file changed, 26 insertions(+), 32 deletions(-)
      >       >
      >       > diff --git a/drivers/staging/media/vino/saa7191.c
      >       b/drivers/staging/media/vino/saa7191.c
      >       > index 087acab..2aa68c6 100644
      >       > --- a/drivers/staging/media/vino/saa7191.c
      >       > +++ b/drivers/staging/media/vino/saa7191.c
      >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen
      >       <[email protected]>");
      >       >  MODULE_LICENSE("GPL");
      >       >
      >       >
      >       > -/* #define SAA7191_DEBUG */
      >       >
      >       > -#ifdef SAA7191_DEBUG
      >       > -#define dprintk(x...) printk("SAA7191: " x);
      >       > -#else
      >       > -#define dprintk(x...)
      >       > -#endif
      >       >
      >       >  #define SAA7191_SYNC_COUNT   30
      >       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds
      */
      >       > @@ -116,7 +110,7 @@ static int
      saa7191_read_status(struct
      >       v4l2_subdev *sd, u8 *value)
      >       >
      >       >       ret = i2c_master_recv(client, value, 1);
      >       >       if (ret < 0) {
      >       > -             printk(KERN_ERR "SAA7191:
      >       saa7191_read_status(): read failed\n");
      >       > +             dev_dbg("saa7191_read_status(): read
      >       failed\n");
      >       >               return ret;
      >       >       }
      >       >
      >       > @@ -147,7 +141,7 @@ static int
      saa7191_write_block(struct
      >       v4l2_subdev *sd,
      >       >
      >       >       ret = i2c_master_send(client, data, length);
      >       >       if (ret < 0) {
      >       > -             printk(KERN_ERR "SAA7191:
      >       saa7191_write_block(): "
      >       > +             dev_dbg("saa7191_write_block(): "
      >       >                      "write failed\n");
      >       >               return ret;
      >       >       }
      >       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct
      >       v4l2_subdev *sd, v4l2_std_id norm)
      >       >
      >       >       decoder->norm = norm;
      >       >
      >       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n",
      ctl3,
      >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv:
      %02x\n",
      >       ctl3,
      >       >               stdc, chcv);
      >       > -     dprintk("norm: %llx\n", norm);
      >       > +     dev_dbg("norm: %llx\n", norm);
      >       >
      >       >       return 0;
      >       >  }
      >       > @@ -241,21 +235,21 @@ static int
      >       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8
      *status)
      >       >  {
      >       >       int i = 0;
      >       >
      >       > -     dprintk("Checking for signal...\n");
      >       > +     dev_dbg("Checking for signal...\n");
      >       >
      >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
      >       >               if (saa7191_read_status(sd, status))
      >       >                       return -EIO;
      >       >
      >       >               if (((*status) & SAA7191_STATUS_HLCK) ==
      0) {
      >       > -                     dprintk("Signal found\n");
      >       > +                     dev_dbg("Signal found\n");
      >       >                       return 0;
      >       >               }
      >       >
      >       >               msleep(SAA7191_SYNC_DELAY);
      >       >       }
      >       >
      >       > -     dprintk("No signal\n");
      >       > +     dev_dbg("No signal\n");
      >       >
      >       >       return -EBUSY;
      >       >  }
      >       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct
      >       v4l2_subdev *sd, v4l2_std_id *norm)
      >       >       v4l2_std_id old_norm = decoder->norm;
      >       >       int err = 0;
      >       >
      >       > -     dprintk("SAA7191 extended signal
      auto-detection...\n");
      >       > +     dev_dbg("SAA7191 extended signal
      auto-detection...\n");
      >       >
      >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL |
      V4L2_STD_SECAM;
      >       >       stdc &= ~SAA7191_STDC_SECS;
      >       > @@ -301,13 +295,13 @@ static int
      saa7191_querystd(struct
      >       v4l2_subdev *sd, v4l2_std_id *norm)
      >       >
      >       >       if (status & SAA7191_STATUS_FIDT) {
      >       >               /* 60Hz signal -> NTSC */
      >       > -             dprintk("60Hz signal: NTSC\n");
      >       > +             dev_dbg("60Hz signal: NTSC\n");
      >       >               *norm &= V4L2_STD_NTSC;
      >       >               return 0;
      >       >       }
      >       >
      >       >       /* 50Hz signal */
      >       > -     dprintk("50Hz signal: Trying PAL...\n");
      >       > +     dev_dbg("50Hz signal: Trying PAL...\n");
      >       >
      >       >       /* try PAL first */
      >       >       err = saa7191_s_std(sd, V4L2_STD_PAL);
      >       > @@ -322,19 +316,19 @@ static int
      saa7191_querystd(struct
      >       v4l2_subdev *sd, v4l2_std_id *norm)
      >       >
      >       >       /* not 50Hz ? */
      >       >       if (status & SAA7191_STATUS_FIDT) {
      >       > -             dprintk("No 50Hz signal\n");
      >       > +             dev_dbg("No 50Hz signal\n");
      >       >               saa7191_s_std(sd, old_norm);
      >       >               *norm = V4L2_STD_UNKNOWN;
      >       >               return 0;
      >       >       }
      >       >
      >       >       if (status & SAA7191_STATUS_CODE) {
      >       > -             dprintk("PAL\n");
      >       > +             dev_dbg("PAL\n");
      >       >               *norm &= V4L2_STD_PAL;
      >       >               return saa7191_s_std(sd, old_norm);
      >       >       }
      >       >
      >       > -     dprintk("No color detected with PAL - Trying
      >       SECAM...\n");
      >       > +     dev_dbg("No color detected with PAL - Trying
      >       SECAM...\n");
      >       >
      >       >       /* no color detected ? -> try SECAM */
      >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
      >       > @@ -349,19 +343,19 @@ static int
      saa7191_querystd(struct
      >       v4l2_subdev *sd, v4l2_std_id *norm)
      >       >
      >       >       /* not 50Hz ? */
      >       >       if (status & SAA7191_STATUS_FIDT) {
      >       > -             dprintk("No 50Hz signal\n");
      >       > +             dev_dbg("No 50Hz signal\n");
      >       >               *norm = V4L2_STD_UNKNOWN;
      >       >               goto out;
      >       >       }
      >       >
      >       >       if (status & SAA7191_STATUS_CODE) {
      >       >               /* Color detected -> SECAM */
      >       > -             dprintk("SECAM\n");
      >       > +             dev_dbg("SECAM\n");
      >       >               *norm &= V4L2_STD_SECAM;
      >       >               return saa7191_s_std(sd, old_norm);
      >       >       }
      >       >
      >       > -     dprintk("No color detected with SECAM - Going
      back to
      >       PAL.\n");
      >       > +     dev_dbg("No color detected with SECAM - Going
      back to
      >       PAL.\n");
      >       >       *norm = V4L2_STD_UNKNOWN;
      >       >
      >       >  out:
      >       > @@ -372,30 +366,30 @@ static int
      >       saa7191_autodetect_norm(struct v4l2_subdev *sd)
      >       >  {
      >       >       u8 status;
      >       >
      >       > -     dprintk("SAA7191 signal auto-detection...\n");
      >       > +     dev_dbg("SAA7191 signal auto-detection...\n");
      >       >
      >       > -     dprintk("Reading status...\n");
      >       > +     dev_dbg("Reading status...\n");
      >       >
      >       >       if (saa7191_read_status(sd, &status))
      >       >               return -EIO;
      >       >
      >       > -     dprintk("Checking for signal...\n");
      >       > +     dev_dbg("Checking for signal...\n");
      >       >
      >       >       /* no signal ? */
      >       >       if (status & SAA7191_STATUS_HLCK) {
      >       > -             dprintk("No signal\n");
      >       > +             dev_dbg("No signal\n");
      >       >               return -EBUSY;
      >       >       }
      >       >
      >       > -     dprintk("Signal found\n");
      >       > +     dev_dbg("Signal found\n");
      >       >
      >       >       if (status & SAA7191_STATUS_FIDT) {
      >       >               /* 60hz signal -> NTSC */
      >       > -             dprintk("NTSC\n");
      >       > +             dev_dbg("NTSC\n");
      >       >               return saa7191_s_std(sd, V4L2_STD_NTSC);
      >       >       } else {
      >       >               /* 50hz signal -> PAL */
      >       > -             dprintk("PAL\n");
      >       > +             dev_dbg("PAL\n");
      >       >               return saa7191_s_std(sd, V4L2_STD_PAL);
      >       >       }
      >       >  }
      >       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct
      >       i2c_client *client,
      >       >
      >       >       err = saa7191_write_block(sd, sizeof(initseq),
      >       initseq);
      >       >       if (err) {
      >       > -             printk(KERN_ERR "SAA7191 initialization
      >       failed\n");
      >       > +             dev_dbg("SAA7191 initialization
      failed\n");
      >       >               return err;
      >       >       }
      >       >
      >       > -     printk(KERN_INFO "SAA7191 initialized\n");
      >       > +     dev_dbg("SAA7191 initialized\n");
      >       >
      >       >       decoder->input = SAA7191_INPUT_COMPOSITE;
      >       >       decoder->norm = V4L2_STD_PAL;
      >       >
      >       >       err = saa7191_autodetect_norm(sd);
      >       >       if (err && (err != -EBUSY))
      >       > -             printk(KERN_ERR "SAA7191: Signal
      auto-detection
      >       failed\n");
      >       > +             dev_dbg("SAA7191: Signal auto-detection
      >       failed\n");
      >       >
      >       >       return 0;
      >       >  }
      >       > --
      >       > 1.9.1
      >       >
      > > --
      > > You received this message because you are subscribed to the
      Google
      > Groups "outreachy-kernel" group.
      > > To unsubscribe from this group and stop receiving emails
      from it,
      > send an email to [email protected].
      > > To post to this group, send email to
      > [email protected].
      > > To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-
      git-
      > send-email-ksenija.stanojevic%40gmail.com.
      > > For more options, visit https://groups.google.com/d/optout.
      > >
      >
      >
      > --
      > You received this message because you are subscribed to the
      Google Groups
      > "outreachy-kernel" group.
      > To unsubscribe from this group and stop receiving emails from
      it, send an
      > email to [email protected].
      > To post to this group, send email to
      [email protected].
      > To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7
      uApK
      > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
      > For more options, visit https://groups.google.com/d/optout.
      >
      >

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c-9da8- a898799af64c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw

make drivers/staging/media/vino/saa7191.o shows me errors. I fixed them, and hope now is fine.
I'll be sending v3.

Quoted 363 lines · Julia Lawall
Quoted 3 lines · Ksenija Stanojevic

I missunderstood how dev_dbg works.
i did compile my code and it haven't shown any errors, but I don't have corresponding .ko file

OK, you can try

make drivers/staging/media/vino/saa7191.o

julia

Quoted 302 lines · Julia Lawall
      On Tue, 17 Feb 2015, Ksenija Stanojević wrote: 

      > I removed variables KERN_ERR and KERN_INFO 
      >  and added device argument to dev_dbg in line 230, 

      When you send a v2 patch, you could describe the change that you 
      have made 
      as compared to the previous patch under the --- 

      > I don't know where else to put that argument. 

      Every call to dev_dbg needs a pointer to a device structure as 
      the first 
      argument. 

      Did you compile your code?  If so, perhaps this file was not 
      selected in 
      your configuration and thus it was not compiled.  You can see if 
      it was 
      compiled by looking to see if it has a corresponding .o file. 
       If not, you 
      can try selecting the driver in your configuration. 

      julia 

      > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall 
      <[email protected]> 
      > wrote: 
      >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote: 
      > 
      >       > Making variants of existing macros is against kernel 
      coding 
      >       style. This 
      >       > patch removes all definitions made by macro dprinkt() 
      and 
      >       replaces them 
      >       > with dev_dbg(). 
      >       > 
      >       > Signed-off-by: Ksenija Stanojevic 
      >       <[email protected]> 
      >       > --- 
      > 
      >       What change is made for v2? 
      > 
      >       julia 
      > 
      >       >  drivers/staging/media/vino/saa7191.c | 58 
      >       ++++++++++++++++-------------------- 
      >       >  1 file changed, 26 insertions(+), 32 deletions(-) 
      >       > 
      >       > diff --git a/drivers/staging/media/vino/saa7191.c 
      >       b/drivers/staging/media/vino/saa7191.c 
      >       > index 087acab..2aa68c6 100644 
      >       > --- a/drivers/staging/media/vino/saa7191.c 
      >       > +++ b/drivers/staging/media/vino/saa7191.c 
      >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen 
      >       <[email protected]>"); 
      >       >  MODULE_LICENSE("GPL"); 
      >       > 
      >       > 
      >       > -/* #define SAA7191_DEBUG */ 
      >       > 
      >       > -#ifdef SAA7191_DEBUG 
      >       > -#define dprintk(x...) printk("SAA7191: " x); 
      >       > -#else 
      >       > -#define dprintk(x...) 
      >       > -#endif 
      >       > 
      >       >  #define SAA7191_SYNC_COUNT   30 
      >       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds 
      */ 
      >       > @@ -116,7 +110,7 @@ static int 
      saa7191_read_status(struct 
      >       v4l2_subdev *sd, u8 *value) 
      >       > 
      >       >       ret = i2c_master_recv(client, value, 1); 
      >       >       if (ret < 0) { 
      >       > -             printk(KERN_ERR "SAA7191: 
      >       saa7191_read_status(): read failed\n"); 
      >       > +             dev_dbg("saa7191_read_status(): read 
      >       failed\n"); 
      >       >               return ret; 
      >       >       } 
      >       > 
      >       > @@ -147,7 +141,7 @@ static int 
      saa7191_write_block(struct 
      >       v4l2_subdev *sd, 
      >       > 
      >       >       ret = i2c_master_send(client, data, length); 
      >       >       if (ret < 0) { 
      >       > -             printk(KERN_ERR "SAA7191: 
      >       saa7191_write_block(): " 
      >       > +             dev_dbg("saa7191_write_block(): " 
      >       >                      "write failed\n"); 
      >       >               return ret; 
      >       >       } 
      >       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct 
      >       v4l2_subdev *sd, v4l2_std_id norm) 
      >       > 
      >       >       decoder->norm = norm; 
      >       > 
      >       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", 
      ctl3, 
      >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: 
      %02x\n", 
      >       ctl3, 
      >       >               stdc, chcv); 
      >       > -     dprintk("norm: %llx\n", norm); 
      >       > +     dev_dbg("norm: %llx\n", norm); 
      >       > 
      >       >       return 0; 
      >       >  } 
      >       > @@ -241,21 +235,21 @@ static int 
      >       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 
      *status) 
      >       >  { 
      >       >       int i = 0; 
      >       > 
      >       > -     dprintk("Checking for signal...\n"); 
      >       > +     dev_dbg("Checking for signal...\n"); 
      >       > 
      >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) { 
      >       >               if (saa7191_read_status(sd, status)) 
      >       >                       return -EIO; 
      >       > 
      >       >               if (((*status) & SAA7191_STATUS_HLCK) == 
      0) { 
      >       > -                     dprintk("Signal found\n"); 
      >       > +                     dev_dbg("Signal found\n"); 
      >       >                       return 0; 
      >       >               } 
      >       > 
      >       >               msleep(SAA7191_SYNC_DELAY); 
      >       >       } 
      >       > 
      >       > -     dprintk("No signal\n"); 
      >       > +     dev_dbg("No signal\n"); 
      >       > 
      >       >       return -EBUSY; 
      >       >  } 
      >       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct 
      >       v4l2_subdev *sd, v4l2_std_id *norm) 
      >       >       v4l2_std_id old_norm = decoder->norm; 
      >       >       int err = 0; 
      >       > 
      >       > -     dprintk("SAA7191 extended signal 
      auto-detection...\n"); 
      >       > +     dev_dbg("SAA7191 extended signal 
      auto-detection...\n"); 
      >       > 
      >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | 
      V4L2_STD_SECAM; 
      >       >       stdc &= ~SAA7191_STDC_SECS; 
      >       > @@ -301,13 +295,13 @@ static int 
      saa7191_querystd(struct 
      >       v4l2_subdev *sd, v4l2_std_id *norm) 
      >       > 
      >       >       if (status & SAA7191_STATUS_FIDT) { 
      >       >               /* 60Hz signal -> NTSC */ 
      >       > -             dprintk("60Hz signal: NTSC\n"); 
      >       > +             dev_dbg("60Hz signal: NTSC\n"); 
      >       >               *norm &= V4L2_STD_NTSC; 
      >       >               return 0; 
      >       >       } 
      >       > 
      >       >       /* 50Hz signal */ 
      >       > -     dprintk("50Hz signal: Trying PAL...\n"); 
      >       > +     dev_dbg("50Hz signal: Trying PAL...\n"); 
      >       > 
      >       >       /* try PAL first */ 
      >       >       err = saa7191_s_std(sd, V4L2_STD_PAL); 
      >       > @@ -322,19 +316,19 @@ static int 
      saa7191_querystd(struct 
      >       v4l2_subdev *sd, v4l2_std_id *norm) 
      >       > 
      >       >       /* not 50Hz ? */ 
      >       >       if (status & SAA7191_STATUS_FIDT) { 
      >       > -             dprintk("No 50Hz signal\n"); 
      >       > +             dev_dbg("No 50Hz signal\n"); 
      >       >               saa7191_s_std(sd, old_norm); 
      >       >               *norm = V4L2_STD_UNKNOWN; 
      >       >               return 0; 
      >       >       } 
      >       > 
      >       >       if (status & SAA7191_STATUS_CODE) { 
      >       > -             dprintk("PAL\n"); 
      >       > +             dev_dbg("PAL\n"); 
      >       >               *norm &= V4L2_STD_PAL; 
      >       >               return saa7191_s_std(sd, old_norm); 
      >       >       } 
      >       > 
      >       > -     dprintk("No color detected with PAL - Trying 
      >       SECAM...\n"); 
      >       > +     dev_dbg("No color detected with PAL - Trying 
      >       SECAM...\n"); 
      >       > 
      >       >       /* no color detected ? -> try SECAM */ 
      >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM); 
      >       > @@ -349,19 +343,19 @@ static int 
      saa7191_querystd(struct 
      >       v4l2_subdev *sd, v4l2_std_id *norm) 
      >       > 
      >       >       /* not 50Hz ? */ 
      >       >       if (status & SAA7191_STATUS_FIDT) { 
      >       > -             dprintk("No 50Hz signal\n"); 
      >       > +             dev_dbg("No 50Hz signal\n"); 
      >       >               *norm = V4L2_STD_UNKNOWN; 
      >       >               goto out; 
      >       >       } 
      >       > 
      >       >       if (status & SAA7191_STATUS_CODE) { 
      >       >               /* Color detected -> SECAM */ 
      >       > -             dprintk("SECAM\n"); 
      >       > +             dev_dbg("SECAM\n"); 
      >       >               *norm &= V4L2_STD_SECAM; 
      >       >               return saa7191_s_std(sd, old_norm); 
      >       >       } 
      >       > 
      >       > -     dprintk("No color detected with SECAM - Going 
      back to 
      >       PAL.\n"); 
      >       > +     dev_dbg("No color detected with SECAM - Going 
      back to 
      >       PAL.\n"); 
      >       >       *norm = V4L2_STD_UNKNOWN; 
      >       > 
      >       >  out: 
      >       > @@ -372,30 +366,30 @@ static int 
      >       saa7191_autodetect_norm(struct v4l2_subdev *sd) 
      >       >  { 
      >       >       u8 status; 
      >       > 
      >       > -     dprintk("SAA7191 signal auto-detection...\n"); 
      >       > +     dev_dbg("SAA7191 signal auto-detection...\n"); 
      >       > 
      >       > -     dprintk("Reading status...\n"); 
      >       > +     dev_dbg("Reading status...\n"); 
      >       > 
      >       >       if (saa7191_read_status(sd, &status)) 
      >       >               return -EIO; 
      >       > 
      >       > -     dprintk("Checking for signal...\n"); 
      >       > +     dev_dbg("Checking for signal...\n"); 
      >       > 
      >       >       /* no signal ? */ 
      >       >       if (status & SAA7191_STATUS_HLCK) { 
      >       > -             dprintk("No signal\n"); 
      >       > +             dev_dbg("No signal\n"); 
      >       >               return -EBUSY; 
      >       >       } 
      >       > 
      >       > -     dprintk("Signal found\n"); 
      >       > +     dev_dbg("Signal found\n"); 
      >       > 
      >       >       if (status & SAA7191_STATUS_FIDT) { 
      >       >               /* 60hz signal -> NTSC */ 
      >       > -             dprintk("NTSC\n"); 
      >       > +             dev_dbg("NTSC\n"); 
      >       >               return saa7191_s_std(sd, V4L2_STD_NTSC); 
      >       >       } else { 
      >       >               /* 50hz signal -> PAL */ 
      >       > -             dprintk("PAL\n"); 
      >       > +             dev_dbg("PAL\n"); 
      >       >               return saa7191_s_std(sd, V4L2_STD_PAL); 
      >       >       } 
      >       >  } 
      >       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct 
      >       i2c_client *client, 
      >       > 
      >       >       err = saa7191_write_block(sd, sizeof(initseq), 
      >       initseq); 
      >       >       if (err) { 
      >       > -             printk(KERN_ERR "SAA7191 initialization 
      >       failed\n"); 
      >       > +             dev_dbg("SAA7191 initialization 
      failed\n"); 
      >       >               return err; 
      >       >       } 
      >       > 
      >       > -     printk(KERN_INFO "SAA7191 initialized\n"); 
      >       > +     dev_dbg("SAA7191 initialized\n"); 
      >       > 
      >       >       decoder->input = SAA7191_INPUT_COMPOSITE; 
      >       >       decoder->norm = V4L2_STD_PAL; 
      >       > 
      >       >       err = saa7191_autodetect_norm(sd); 
      >       >       if (err && (err != -EBUSY)) 
      >       > -             printk(KERN_ERR "SAA7191: Signal 
      auto-detection 
      >       failed\n"); 
      >       > +             dev_dbg("SAA7191: Signal auto-detection 
      >       failed\n"); 
      >       > 
      >       >       return 0; 
      >       >  } 
      >       > -- 
      >       > 1.9.1 
      >       > 
      > > -- 
      > > You received this message because you are subscribed to the 
Quoted 8 lines
      Google 
      > Groups "outreachy-kernel" group. 
      > > To unsubscribe from this group and stop receiving emails 
      from it, 
      > send an email to [email protected]. 
      > > To post to this group, send email to 
      > [email protected]. 
      > > To view this discussion on the webvisithttps://

groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-

Quoted 8 lines

git-
> send-email-ksenija.stanojevic%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
> --
> You received this message because you are subscribed to the

Quoted 8 lines

Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the webvisithttps://

groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7

Quoted 8 lines
      uApK 
      > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com. 
      > For more options, visit https://groups.google.com/d/optout. 
      > 
      > 
Signature · 1 line
You received this message because you are subscribed to the Google 

Groups

Quoted 2 lines

"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send

an

Quoted 2 lines

email to [email protected] <javascript:>. To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c-9da8-

Quoted 4 lines

a898799af64c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw
Quoted 3 lines · Ksenija Stanojevic

make drivers/staging/media/vino/saa7191.o shows me errors. I fixed them, and hope now is fine.
I'll be sending v3.

Sounds good :)

julia

Quoted 423 lines · Julia Lawall

On Wed, 18 Feb 2015, Ksenija Stanojevic wrote:

> I missunderstood how dev_dbg works.
> i did compile my code and it haven't shown any errors, but I don't have
> corresponding .ko file

OK, you can try

make drivers/staging/media/vino/saa7191.o

julia

>
> On Tuesday, February 17, 2015 at 11:04:31 PM UTC+1, Julia
Lawall wrote:
>       On Tue, 17 Feb 2015, Ksenija Stanojević wrote:
>
>       > I removed variables KERN_ERR and KERN_INFO
>       >  and added device argument to dev_dbg in line 230,
>
>       When you send a v2 patch, you could describe the change
that you
>       have made
>       as compared to the previous patch under the ---
>
>       > I don't know where else to put that argument.
>
>       Every call to dev_dbg needs a pointer to a device
structure as
>       the first
>       argument.
>
>       Did you compile your code?  If so, perhaps this file was
not
>       selected in
>       your configuration and thus it was not compiled.  You
can see if
>       it was
>       compiled by looking to see if it has a corresponding .o
file.
>        If not, you
>       can try selecting the driver in your configuration.
>
>       julia
>
>       > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall
>       <[email protected]>
>       > wrote:
>       >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
>       >
>       >       > Making variants of existing macros is against
kernel
>       coding
>       >       style. This
>       >       > patch removes all definitions made by macro
dprinkt()
>       and
>       >       replaces them
>       >       > with dev_dbg().
>       >       >
>       >       > Signed-off-by: Ksenija Stanojevic
>       >       <[email protected]>
>       >       > ---
>       >
>       >       What change is made for v2?
>       >
>       >       julia
>       >
>       >       >  drivers/staging/media/vino/saa7191.c | 58
>       >       ++++++++++++++++--------------------
>       >       >  1 file changed, 26 insertions(+), 32
deletions(-)
>       >       >
>       >       > diff --git
a/drivers/staging/media/vino/saa7191.c
>       >       b/drivers/staging/media/vino/saa7191.c
>       >       > index 087acab..2aa68c6 100644
>       >       > --- a/drivers/staging/media/vino/saa7191.c
>       >       > +++ b/drivers/staging/media/vino/saa7191.c
>       >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael
Nousiainen
>       >       <[email protected]>");
>       >       >  MODULE_LICENSE("GPL");
>       >       >
>       >       >
>       >       > -/* #define SAA7191_DEBUG */
>       >       >
>       >       > -#ifdef SAA7191_DEBUG
>       >       > -#define dprintk(x...) printk("SAA7191: " x);
>       >       > -#else
>       >       > -#define dprintk(x...)
>       >       > -#endif
>       >       >
>       >       >  #define SAA7191_SYNC_COUNT   30
>       >       >  #define SAA7191_SYNC_DELAY   100     /*
milliseconds
>       */
>       >       > @@ -116,7 +110,7 @@ static int
>       saa7191_read_status(struct
>       >       v4l2_subdev *sd, u8 *value)
>       >       >
>       >       >       ret = i2c_master_recv(client, value, 1);
>       >       >       if (ret < 0) {
>       >       > -             printk(KERN_ERR "SAA7191:
>       >       saa7191_read_status(): read failed\n");
>       >       > +             dev_dbg("saa7191_read_status():
read
>       >       failed\n");
>       >       >               return ret;
>       >       >       }
>       >       >
>       >       > @@ -147,7 +141,7 @@ static int
>       saa7191_write_block(struct
>       >       v4l2_subdev *sd,
>       >       >
>       >       >       ret = i2c_master_send(client, data,
length);
>       >       >       if (ret < 0) {
>       >       > -             printk(KERN_ERR "SAA7191:
>       >       saa7191_write_block(): "
>       >       > +             dev_dbg("saa7191_write_block():
"
>       >       >                      "write failed\n");
>       >       >               return ret;
>       >       >       }
>       >       > @@ -230,9 +224,9 @@ static int
saa7191_s_std(struct
>       >       v4l2_subdev *sd, v4l2_std_id norm)
>       >       >
>       >       >       decoder->norm = norm;
>       >       >
>       >       > -     dprintk("ctl3: %02x stdc: %02x chcv:
%02x\n",
>       ctl3,
>       >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x
chcv:
>       %02x\n",
>       >       ctl3,
>       >       >               stdc, chcv);
>       >       > -     dprintk("norm: %llx\n", norm);
>       >       > +     dev_dbg("norm: %llx\n", norm);
>       >       >
>       >       >       return 0;
>       >       >  }
>       >       > @@ -241,21 +235,21 @@ static int
>       >       saa7191_wait_for_signal(struct v4l2_subdev *sd,
u8
>       *status)
>       >       >  {
>       >       >       int i = 0;
>       >       >
>       >       > -     dprintk("Checking for signal...\n");
>       >       > +     dev_dbg("Checking for signal...\n");
>       >       >
>       >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++)
{
>       >       >               if (saa7191_read_status(sd,
status))
>       >       >                       return -EIO;
>       >       >
>       >       >               if (((*status) &
SAA7191_STATUS_HLCK) ==
>       0) {
>       >       > -                     dprintk("Signal
found\n");
>       >       > +                     dev_dbg("Signal
found\n");
>       >       >                       return 0;
>       >       >               }
>       >       >
>       >       >               msleep(SAA7191_SYNC_DELAY);
>       >       >       }
>       >       >
>       >       > -     dprintk("No signal\n");
>       >       > +     dev_dbg("No signal\n");
>       >       >
>       >       >       return -EBUSY;
>       >       >  }
>       >       > @@ -269,7 +263,7 @@ static int
saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       v4l2_std_id old_norm = decoder->norm;
>       >       >       int err = 0;
>       >       >
>       >       > -     dprintk("SAA7191 extended signal
>       auto-detection...\n");
>       >       > +     dev_dbg("SAA7191 extended signal
>       auto-detection...\n");
>       >       >
>       >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL |
>       V4L2_STD_SECAM;
>       >       >       stdc &= ~SAA7191_STDC_SECS;
>       >       > @@ -301,13 +295,13 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >               /* 60Hz signal -> NTSC */
>       >       > -             dprintk("60Hz signal: NTSC\n");
>       >       > +             dev_dbg("60Hz signal: NTSC\n");
>       >       >               *norm &= V4L2_STD_NTSC;
>       >       >               return 0;
>       >       >       }
>       >       >
>       >       >       /* 50Hz signal */
>       >       > -     dprintk("50Hz signal: Trying PAL...\n");
>       >       > +     dev_dbg("50Hz signal: Trying PAL...\n");
>       >       >
>       >       >       /* try PAL first */
>       >       >       err = saa7191_s_std(sd, V4L2_STD_PAL);
>       >       > @@ -322,19 +316,19 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       /* not 50Hz ? */
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       > -             dprintk("No 50Hz signal\n");
>       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >               saa7191_s_std(sd, old_norm);
>       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >               return 0;
>       >       >       }
>       >       >
>       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       > -             dprintk("PAL\n");
>       >       > +             dev_dbg("PAL\n");
>       >       >               *norm &= V4L2_STD_PAL;
>       >       >               return saa7191_s_std(sd,
old_norm);
>       >       >       }
>       >       >
>       >       > -     dprintk("No color detected with PAL -
Trying
>       >       SECAM...\n");
>       >       > +     dev_dbg("No color detected with PAL -
Trying
>       >       SECAM...\n");
>       >       >
>       >       >       /* no color detected ? -> try SECAM */
>       >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
>       >       > @@ -349,19 +343,19 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       /* not 50Hz ? */
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       > -             dprintk("No 50Hz signal\n");
>       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >               goto out;
>       >       >       }
>       >       >
>       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       >               /* Color detected -> SECAM */
>       >       > -             dprintk("SECAM\n");
>       >       > +             dev_dbg("SECAM\n");
>       >       >               *norm &= V4L2_STD_SECAM;
>       >       >               return saa7191_s_std(sd,
old_norm);
>       >       >       }
>       >       >
>       >       > -     dprintk("No color detected with SECAM -
Going
>       back to
>       >       PAL.\n");
>       >       > +     dev_dbg("No color detected with SECAM -
Going
>       back to
>       >       PAL.\n");
>       >       >       *norm = V4L2_STD_UNKNOWN;
>       >       >
>       >       >  out:
>       >       > @@ -372,30 +366,30 @@ static int
>       >       saa7191_autodetect_norm(struct v4l2_subdev *sd)
>       >       >  {
>       >       >       u8 status;
>       >       >
>       >       > -     dprintk("SAA7191 signal
auto-detection...\n");
>       >       > +     dev_dbg("SAA7191 signal
auto-detection...\n");
>       >       >
>       >       > -     dprintk("Reading status...\n");
>       >       > +     dev_dbg("Reading status...\n");
>       >       >
>       >       >       if (saa7191_read_status(sd, &status))
>       >       >               return -EIO;
>       >       >
>       >       > -     dprintk("Checking for signal...\n");
>       >       > +     dev_dbg("Checking for signal...\n");
>       >       >
>       >       >       /* no signal ? */
>       >       >       if (status & SAA7191_STATUS_HLCK) {
>       >       > -             dprintk("No signal\n");
>       >       > +             dev_dbg("No signal\n");
>       >       >               return -EBUSY;
>       >       >       }
>       >       >
>       >       > -     dprintk("Signal found\n");
>       >       > +     dev_dbg("Signal found\n");
>       >       >
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >               /* 60hz signal -> NTSC */
>       >       > -             dprintk("NTSC\n");
>       >       > +             dev_dbg("NTSC\n");
>       >       >               return saa7191_s_std(sd,
V4L2_STD_NTSC);
>       >       >       } else {
>       >       >               /* 50hz signal -> PAL */
>       >       > -             dprintk("PAL\n");
>       >       > +             dev_dbg("PAL\n");
>       >       >               return saa7191_s_std(sd,
V4L2_STD_PAL);
>       >       >       }
>       >       >  }
>       >       > @@ -606,18 +600,18 @@ static int
saa7191_probe(struct
>       >       i2c_client *client,
>       >       >
>       >       >       err = saa7191_write_block(sd,
sizeof(initseq),
>       >       initseq);
>       >       >       if (err) {
>       >       > -             printk(KERN_ERR "SAA7191
initialization
>       >       failed\n");
>       >       > +             dev_dbg("SAA7191 initialization
>       failed\n");
>       >       >               return err;
>       >       >       }
>       >       >
>       >       > -     printk(KERN_INFO "SAA7191
initialized\n");
>       >       > +     dev_dbg("SAA7191 initialized\n");
>       >       >
>       >       >       decoder->input =
SAA7191_INPUT_COMPOSITE;
>       >       >       decoder->norm = V4L2_STD_PAL;
>       >       >
>       >       >       err = saa7191_autodetect_norm(sd);
>       >       >       if (err && (err != -EBUSY))
>       >       > -             printk(KERN_ERR "SAA7191: Signal
>       auto-detection
>       >       failed\n");
>       >       > +             dev_dbg("SAA7191: Signal
auto-detection
>       >       failed\n");
>       >       >
>       >       >       return 0;
>       >       >  }
>       >       > --
>       >       > 1.9.1
>       >       >
>       > > --
>       > > You received this message because you are subscribed
to the
>       Google
>       > Groups "outreachy-kernel" group.
>       > > To unsubscribe from this group and stop receiving
emails
>       from it,
>       > send an email to [email protected].
>       > > To post to this group, send email to
>       > [email protected].
>       > > To view this discussion on thewebvisithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960 -1-
>       git-
>       > send-email-ksenija.stanojevic%40gmail.com.
>       > > For more options, visit
https://groups.google.com/d/optout.
>       > >
>       >
>       >
>       > --
>       > You received this message because you are subscribed
to the
>       Google Groups
>       > "outreachy-kernel" group.
>       > To unsubscribe from this group and stop receiving
emails from
>       it, send an
>       > email to [email protected].
>       > To post to this group, send email to
>       [email protected].
>       > To view this discussion on thewebvisithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTr JE7
>       uApK
>       > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
>       > For more options, visit
https://groups.google.com/d/optout.
>       >
>       >
>
> --
> You received this message because you are subscribed to the
Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from
it, send an
> email to [email protected].
> To post to this group, send email to
[email protected].
> To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c- 9da8-
> a898799af64c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/11edf72c-1a1c-4af8-838a- b9600d9fc1a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.