Commit 06c839d5 authored by Dave Stevenson's avatar Dave Stevenson Committed by Phil Elwell
Browse files

staging: bcm2835-camera: Fix multiple line dereference errors



Fix checkpatch errors "Avoid multiple line dereference"

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.org>
parent b365a74a
Loading
Loading
Loading
Loading
+14 −27
Original line number Diff line number Diff line
@@ -320,8 +320,7 @@ static void buffer_cleanup(struct vb2_buffer *vb)
static inline bool is_capturing(struct bm2835_mmal_dev *dev)
{
	return dev->capture.camera_port ==
	    &dev->
	    component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
	    &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
}

static void buffer_cb(struct vchiq_mmal_instance *instance,
@@ -803,8 +802,7 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
		return 0;	/* already in requested state */

	src =
	    &dev->component[COMP_CAMERA]->
	    output[CAM_PORT_PREVIEW];
	    &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];

	if (!on) {
		/* disconnect preview ports and disable component */
@@ -859,8 +857,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
	 */
	struct bm2835_mmal_dev *dev = video_drvdata(file);
	struct vchiq_mmal_port *preview_port =
		&dev->component[COMP_CAMERA]->
		output[CAM_PORT_PREVIEW];
		&dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];

	a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
			V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1052,8 +1049,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
					       dev->capture.camera_port, NULL);
		dev->capture.camera_port = NULL;
		ret = vchiq_mmal_component_disable(dev->instance,
						   dev->capture.
						   encode_component);
						   dev->capture.encode_component);
		if (ret)
			v4l2_err(&dev->v4l2_dev,
				 "Failed to disable encode component %d\n",
@@ -1068,26 +1064,22 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
		if (f->fmt.pix.width <= max_video_width
		    && f->fmt.pix.height <= max_video_height)
			camera_port = port =
			    &dev->component[COMP_CAMERA]->
			    output[CAM_PORT_VIDEO];
			    &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
		else
			camera_port = port =
			    &dev->component[COMP_CAMERA]->
			    output[CAM_PORT_CAPTURE];
			    &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
		break;
	case COMP_IMAGE_ENCODE:
		encode_component = dev->component[COMP_IMAGE_ENCODE];
		port = &dev->component[COMP_IMAGE_ENCODE]->output[0];
		camera_port =
		    &dev->component[COMP_CAMERA]->
		    output[CAM_PORT_CAPTURE];
		    &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
		break;
	case COMP_VIDEO_ENCODE:
		encode_component = dev->component[COMP_VIDEO_ENCODE];
		port = &dev->component[COMP_VIDEO_ENCODE]->output[0];
		camera_port =
		    &dev->component[COMP_CAMERA]->
		    output[CAM_PORT_VIDEO];
		    &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
		break;
	default:
		break;
@@ -1129,8 +1121,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,

	if (!ret
	    && camera_port ==
	    &dev->component[COMP_CAMERA]->
	    output[CAM_PORT_VIDEO]) {
	    &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]) {
		bool overlay_enabled =
		    !!dev->component[COMP_PREVIEW]->enabled;
		struct vchiq_mmal_port *preview_port =
@@ -1267,9 +1258,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
						 port->current_buffer.size);
					port->current_buffer.size =
					    (f->fmt.pix.sizeimage <
					     (100 << 10))
					    ? (100 << 10)
					    : f->fmt.pix.sizeimage;
					     (100 << 10)) ?
					    (100 << 10) : f->fmt.pix.sizeimage;
				}
				v4l2_dbg(1, bcm2835_v4l2_debug,
					 &dev->v4l2_dev,
@@ -1720,8 +1710,7 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev)

	/* get the video encoder component ready */
	ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
					&dev->
					component[COMP_VIDEO_ENCODE]);
					&dev->component[COMP_VIDEO_ENCODE]);
	if (ret < 0)
		goto unreg_image_encoder;

@@ -1841,12 +1830,10 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev)
				     dev->component[COMP_CAMERA]);

	vchiq_mmal_component_finalise(dev->instance,
				      dev->
				      component[COMP_VIDEO_ENCODE]);
				      dev->component[COMP_VIDEO_ENCODE]);

	vchiq_mmal_component_finalise(dev->instance,
				      dev->
				      component[COMP_IMAGE_ENCODE]);
				      dev->component[COMP_IMAGE_ENCODE]);

	vchiq_mmal_component_finalise(dev->instance,
				      dev->component[COMP_PREVIEW]);