Commit 37d5efb0 authored by Joe Perches's avatar Joe Perches Committed by Mauro Carvalho Chehab
Browse files

media: gspca: Convert PDEBUG to gspca_dbg



Use a more typical logging style.

The current macro hides the gspca_dev argument so add it to the
macro uses instead.

Miscellanea:

o Add missing '\n' terminations to formats
o Realign arguments to open parenthesis
o Remove commented out uses of PDEBUG

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 52173c5f
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ int gspca_expo_autogain(
	   desired lumination fast (with the risc of a slight overshoot) */
	steps = abs(desired_avg_lum - avg_lum) / deadzone;

	PDEBUG(D_FRAM, "autogain: lum: %d, desired: %d, steps: %d",
	gspca_dbg(gspca_dev, D_FRAM, "autogain: lum: %d, desired: %d, steps: %d\n",
		  avg_lum, desired_avg_lum, steps);

	for (i = 0; i < steps; i++) {
@@ -84,7 +84,7 @@ int gspca_expo_autogain(
	}

	if (retval)
		PDEBUG(D_FRAM, "autogain: changed gain: %d, expo: %d",
		gspca_dbg(gspca_dev, D_FRAM, "autogain: changed gain: %d, expo: %d\n",
			  gain, exposure);
	return retval;
}
@@ -126,7 +126,7 @@ int gspca_coarse_grained_expo_autogain(
	   desired lumination fast (with the risc of a slight overshoot) */
	steps = (desired_avg_lum - avg_lum) / deadzone;

	PDEBUG(D_FRAM, "autogain: lum: %d, desired: %d, steps: %d",
	gspca_dbg(gspca_dev, D_FRAM, "autogain: lum: %d, desired: %d, steps: %d\n",
		  avg_lum, desired_avg_lum, steps);

	if ((gain + steps) > gain_high &&
@@ -167,7 +167,7 @@ int gspca_coarse_grained_expo_autogain(
	}

	if (retval)
		PDEBUG(D_FRAM, "autogain: changed gain: %d, expo: %d",
		gspca_dbg(gspca_dev, D_FRAM, "autogain: changed gain: %d, expo: %d\n",
			  gain, exposure);
	return retval;
}
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static void sd_isoc_irq(struct urb *urb)
	u8 *data;
	int i, st;

	PDEBUG(D_PACK, "sd isoc irq");
	gspca_dbg(gspca_dev, D_PACK, "sd isoc irq\n");
	if (!gspca_dev->streaming)
		return;
	if (urb->status != 0) {
+4 −3
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static void reg_r(struct gspca_dev *gspca_dev,
			0,
			index, gspca_dev->usb_buf, len,
			500);
	PDEBUG(D_USBI, "reg read [%02x] -> %02x ..",
	gspca_dbg(gspca_dev, D_USBI, "reg read [%02x] -> %02x ..\n",
		  index, gspca_dev->usb_buf[0]);
}

@@ -112,7 +112,8 @@ static void reg_w(struct gspca_dev *gspca_dev,
		gspca_err(gspca_dev, "reg_w: buffer overflow\n");
		return;
	}
	PDEBUG(D_USBO, "reg write [%02x] = %02x..", index, *buffer);
	gspca_dbg(gspca_dev, D_USBO, "reg write [%02x] = %02x..\n",
		  index, *buffer);

	memcpy(gspca_dev->usb_buf, buffer, len);
	usb_control_msg(dev,
+25 −25
Original line number Diff line number Diff line
@@ -701,7 +701,7 @@ static void reset_camera_params(struct gspca_dev *gspca_dev)

static void printstatus(struct gspca_dev *gspca_dev, struct cam_params *params)
{
	PDEBUG(D_PROBE, "status: %02x %02x %02x %02x %02x %02x %02x %02x",
	gspca_dbg(gspca_dev, D_PROBE, "status: %02x %02x %02x %02x %02x %02x %02x %02x\n",
		  params->status.systemState, params->status.grabState,
		  params->status.streamState, params->status.fatalError,
		  params->status.cmdError, params->status.debugFlags,
@@ -730,7 +730,7 @@ static int goto_low_power(struct gspca_dev *gspca_dev)
		return -EIO;
	}

	PDEBUG(D_CONF, "camera now in LOW power state");
	gspca_dbg(gspca_dev, D_CONF, "camera now in LOW power state\n");
	return 0;
}

@@ -759,7 +759,7 @@ static int goto_high_power(struct gspca_dev *gspca_dev)
		return -EIO;
	}

	PDEBUG(D_CONF, "camera now in HIGH power state");
	gspca_dbg(gspca_dev, D_CONF, "camera now in HIGH power state\n");
	return 0;
}

@@ -1302,7 +1302,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
			sd->params.exposure.coarseExpHi = new_exposure >> 8;
			setexp = 1;
			sd->exposure_status = EXPOSURE_NORMAL;
			PDEBUG(D_CONF, "Automatically decreasing sensor_fps");
			gspca_dbg(gspca_dev, D_CONF, "Automatically decreasing sensor_fps\n");

		} else if ((sd->exposure_status == EXPOSURE_VERY_LIGHT ||
			    sd->exposure_status == EXPOSURE_LIGHT) &&
@@ -1331,7 +1331,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
			sd->params.exposure.coarseExpHi = new_exposure >> 8;
			setexp = 1;
			sd->exposure_status = EXPOSURE_NORMAL;
			PDEBUG(D_CONF, "Automatically increasing sensor_fps");
			gspca_dbg(gspca_dev, D_CONF, "Automatically increasing sensor_fps\n");
		}
	} else {
		/* Flicker control off */
@@ -1349,7 +1349,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
				setexp = 1;
			}
			sd->exposure_status = EXPOSURE_NORMAL;
			PDEBUG(D_CONF, "Automatically decreasing sensor_fps");
			gspca_dbg(gspca_dev, D_CONF, "Automatically decreasing sensor_fps\n");

		} else if ((sd->exposure_status == EXPOSURE_VERY_LIGHT ||
			    sd->exposure_status == EXPOSURE_LIGHT) &&
@@ -1366,7 +1366,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
				setexp = 1;
			}
			sd->exposure_status = EXPOSURE_NORMAL;
			PDEBUG(D_CONF, "Automatically increasing sensor_fps");
			gspca_dbg(gspca_dev, D_CONF, "Automatically increasing sensor_fps\n");
		}
	}

@@ -1434,7 +1434,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
	sd->mainsFreq = FREQ_DEF == V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
	reset_camera_params(gspca_dev);

	PDEBUG(D_PROBE, "cpia CPiA camera detected (vid/pid 0x%04X:0x%04X)",
	gspca_dbg(gspca_dev, D_PROBE, "cpia CPiA camera detected (vid/pid 0x%04X:0x%04X)\n",
		  id->idVendor, id->idProduct);

	cam = &gspca_dev->cam;
@@ -1669,15 +1669,15 @@ static int sd_init(struct gspca_dev *gspca_dev)

	sd_stopN(gspca_dev);

	PDEBUG(D_PROBE, "CPIA Version:             %d.%02d (%d.%d)",
	gspca_dbg(gspca_dev, D_PROBE, "CPIA Version:             %d.%02d (%d.%d)\n",
		  sd->params.version.firmwareVersion,
		  sd->params.version.firmwareRevision,
		  sd->params.version.vcVersion,
		  sd->params.version.vcRevision);
	PDEBUG(D_PROBE, "CPIA PnP-ID:              %04x:%04x:%04x",
	gspca_dbg(gspca_dev, D_PROBE, "CPIA PnP-ID:              %04x:%04x:%04x",
		  sd->params.pnpID.vendor, sd->params.pnpID.product,
		  sd->params.pnpID.deviceRevision);
	PDEBUG(D_PROBE, "VP-Version:               %d.%d %04x",
	gspca_dbg(gspca_dev, D_PROBE, "VP-Version:               %d.%d %04x",
		  sd->params.vpVersion.vpVersion,
		  sd->params.vpVersion.vpRevision,
		  sd->params.vpVersion.cameraHeadID);
+8 −8
Original line number Diff line number Diff line
@@ -75,8 +75,8 @@ static int reg_reqs(struct gspca_dev *gspca_dev,
				  i, n_reqs);
		} else if (preq->bRequestType & USB_DIR_IN) {

			PDEBUG(D_STREAM,
			"USB IN (%d) returned[%d] %02X %02X %02X %s",
			gspca_dbg(gspca_dev, D_STREAM,
				  "USB IN (%d) returned[%d] %02X %02X %02X %s\n",
				  i,
				  preq->wLength,
				  gspca_dev->usb_buf[0],
Loading