if (!sgdma->queued_sglist)
{
spin_unlock(&cam->sg_lock);
- printk(KERN_ERR CAM_NAME ": SGDMA completed when none queued\n");
+ dev_err(&cam->dev, "SGDMA completed when none queued\n");
return;
}
if (!--sgdma->queued_sglist) {
* scatter-gather DMA slots as video buffers so that can't
* happen.
*/
- printk(KERN_DEBUG CAM_NAME
- ": Failed to queue a video buffer for SGDMA\n");
+ dev_dbg(&cam->dev, "Failed to queue a video buffer for SGDMA\n");
vb->state = state;
}
}
GFP_KERNEL | GFP_DMA);
}
if (!cam->capture_base) {
- printk(KERN_ERR CAM_NAME
- ": cannot allocate capture buffer\n");
+ dev_err(&cam->dev, "cannot allocate capture buffer\n");
return 0;
}
timeout = interruptible_sleep_on_timeout
(&cam->new_video_frame, timeout);
if (timeout == 0) {
- printk(KERN_ERR CAM_NAME ": timeout waiting video frame\n");
+ dev_err(&cam->dev, "timeout waiting video frame\n");
return -EIO; /* time out */
}
}
spin_lock(&cam->img_lock);
if (cam->active == 1) {
- printk (KERN_ERR CAM_NAME ": Camera device Active\n");
+ dev_err(&cam->dev, "Camera device Active\n");
spin_unlock(&cam->img_lock);
return -EPERM;
}
if (cam->cam_hardware->open(cam->hardware_data))
{
- printk (KERN_ERR CAM_NAME ": Camera IF configuration failed\n");
+ dev_err(&cam->dev, "Camera IF configuration failed\n");
cam->active = 0;
return -ENODEV;
}
cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data);
/* program the sensor for the capture format and rate */
- if (cam->cam_sensor->configure(&cam->pix, cam->xclk,
+ if (cam->cam_sensor->configure(&cam->pix, cam->xclk,
&cam->cparm.timeperframe, cam->sensor_data))
{
- printk (KERN_ERR CAM_NAME ": Camera sensor configuration failed\n");
+ dev_err(&cam->dev, "Camera sensor configuration failed\n");
cam->cam_hardware->close(cam->hardware_data);
cam->active = 0;
return -ENODEV;
cam = kzalloc(sizeof(struct camera_device), GFP_KERNEL);
if (!cam) {
- printk(KERN_ERR CAM_NAME ": could not allocate memory\n");
+ dev_err(&cam->dev, "could not allocate memory\n");
status = -ENOMEM;
goto err0;
}
/* initialize the video_device struct */
vfd = cam->vfd = video_device_alloc();
if (!vfd) {
- printk(KERN_ERR CAM_NAME
- ": could not allocate video device struct\n");
+ dev_err(&cam->dev, " could not allocate video device struct\n");
status = -ENOMEM;
goto err1;
}
(dma_addr_t *) &cam->overlay_base_phys,
GFP_KERNEL | GFP_DMA);
if (!cam->overlay_base) {
- printk(KERN_ERR CAM_NAME
- ": cannot allocate overlay framebuffer\n");
+ dev_err(&cam->dev, "cannot allocate overlay framebuffer\n");
status = -ENOMEM;
goto err2;
}
/* initialize the camera interface */
cam->hardware_data = cam->cam_hardware->init();
if (!cam->hardware_data) {
- printk(KERN_ERR CAM_NAME ": cannot initialize interface hardware\n");
+ dev_err(&cam->dev, "cannot initialize interface hardware\n");
status = -ENODEV;
goto err3;
}
cam->sensor_data = cam->cam_sensor->init(&cam->pix);
if (!cam->sensor_data) {
cam->cam_hardware->disable(cam->hardware_data);
- printk(KERN_ERR CAM_NAME ": cannot initialize sensor\n");
+ dev_err(&cam->dev, "cannot initialize sensor\n");
status = -ENODEV;
goto err4;
}
- printk(KERN_INFO CAM_NAME ": %s interface with %s sensor\n",
+ dev_info(&cam->dev, "%s interface with %s sensor\n",
cam->cam_hardware->name, cam->cam_sensor->name);
/* select an arbitrary default capture frame rate of 15fps */
platform_set_drvdata(pdev, cam);
if (video_register_device(vfd, VFL_TYPE_GRABBER, video_nr) < 0) {
- printk(KERN_ERR CAM_NAME
- ": could not register Video for Linux device\n");
+ dev_err(&cam->dev, "could not register Video for Linux device\n");
status = -ENODEV;
goto err5;
}
- printk(KERN_INFO CAM_NAME
- ": registered device video%d [v4l2]\n", vfd->minor);
+ dev_info(&cam->dev, "registered device video%d [v4l2]\n", vfd->minor);
return 0;