Commit fbdc5515 authored by Daniela Mormocea's avatar Daniela Mormocea Committed by Greg Kroah-Hartman

staging: vc04_services: bcm2835-camera: Fix multiple line dereference

Fix multiple line dereference to avoid checkpatch warnings
Signed-off-by: default avatarDaniela Mormocea <daniela.mormocea@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57a633dc
...@@ -312,8 +312,7 @@ static void buffer_cleanup(struct vb2_buffer *vb) ...@@ -312,8 +312,7 @@ static void buffer_cleanup(struct vb2_buffer *vb)
static inline bool is_capturing(struct bm2835_mmal_dev *dev) static inline bool is_capturing(struct bm2835_mmal_dev *dev)
{ {
return dev->capture.camera_port == return dev->capture.camera_port ==
&dev-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
} }
static void buffer_cb(struct vchiq_mmal_instance *instance, static void buffer_cb(struct vchiq_mmal_instance *instance,
...@@ -751,8 +750,7 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on) ...@@ -751,8 +750,7 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
return 0; /* already in requested state */ return 0; /* already in requested state */
src = src =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
output[MMAL_CAMERA_PORT_PREVIEW];
if (!on) { if (!on) {
/* disconnect preview ports and disable component */ /* disconnect preview ports and disable component */
...@@ -807,8 +805,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh, ...@@ -807,8 +805,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
*/ */
struct bm2835_mmal_dev *dev = video_drvdata(file); struct bm2835_mmal_dev *dev = video_drvdata(file);
struct vchiq_mmal_port *preview_port = struct vchiq_mmal_port *preview_port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
output[MMAL_CAMERA_PORT_PREVIEW];
a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
V4L2_FBUF_CAP_GLOBAL_ALPHA; V4L2_FBUF_CAP_GLOBAL_ALPHA;
...@@ -1000,8 +997,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ...@@ -1000,8 +997,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
dev->capture.camera_port, NULL); dev->capture.camera_port, NULL);
dev->capture.camera_port = NULL; dev->capture.camera_port = NULL;
ret = vchiq_mmal_component_disable(dev->instance, ret = vchiq_mmal_component_disable(dev->instance,
dev->capture. dev->capture.encode_component);
encode_component);
if (ret) if (ret)
v4l2_err(&dev->v4l2_dev, v4l2_err(&dev->v4l2_dev,
"Failed to disable encode component %d\n", "Failed to disable encode component %d\n",
...@@ -1016,26 +1012,22 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ...@@ -1016,26 +1012,22 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
if (f->fmt.pix.width <= max_video_width if (f->fmt.pix.width <= max_video_width
&& f->fmt.pix.height <= max_video_height) && f->fmt.pix.height <= max_video_height)
camera_port = port = camera_port = port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
output[MMAL_CAMERA_PORT_VIDEO];
else else
camera_port = port = camera_port = port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
output[MMAL_CAMERA_PORT_CAPTURE];
break; break;
case MMAL_COMPONENT_IMAGE_ENCODE: case MMAL_COMPONENT_IMAGE_ENCODE:
encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE]; encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE];
port = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0]; port = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0];
camera_port = camera_port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
output[MMAL_CAMERA_PORT_CAPTURE];
break; break;
case MMAL_COMPONENT_VIDEO_ENCODE: case MMAL_COMPONENT_VIDEO_ENCODE:
encode_component = dev->component[MMAL_COMPONENT_VIDEO_ENCODE]; encode_component = dev->component[MMAL_COMPONENT_VIDEO_ENCODE];
port = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; port = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
camera_port = camera_port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
output[MMAL_CAMERA_PORT_VIDEO];
break; break;
default: default:
break; break;
...@@ -1077,13 +1069,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ...@@ -1077,13 +1069,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
if (!ret if (!ret
&& camera_port == && camera_port ==
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]) {
output[MMAL_CAMERA_PORT_VIDEO]) {
bool overlay_enabled = bool overlay_enabled =
!!dev->component[MMAL_COMPONENT_PREVIEW]->enabled; !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled;
struct vchiq_mmal_port *preview_port = struct vchiq_mmal_port *preview_port =
&dev->component[MMAL_COMPONENT_CAMERA]-> &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
output[MMAL_CAMERA_PORT_PREVIEW];
/* Preview and encode ports need to match on resolution */ /* Preview and encode ports need to match on resolution */
if (overlay_enabled) { if (overlay_enabled) {
/* Need to disable the overlay before we can update /* Need to disable the overlay before we can update
...@@ -1673,8 +1663,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev) ...@@ -1673,8 +1663,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
/* get the video encoder component ready */ /* get the video encoder component ready */
ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode", ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
&dev-> &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
component[MMAL_COMPONENT_VIDEO_ENCODE]);
if (ret < 0) if (ret < 0)
goto unreg_image_encoder; goto unreg_image_encoder;
...@@ -1797,12 +1786,10 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev) ...@@ -1797,12 +1786,10 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev)
dev->component[MMAL_COMPONENT_CAMERA]); dev->component[MMAL_COMPONENT_CAMERA]);
vchiq_mmal_component_finalise(dev->instance, vchiq_mmal_component_finalise(dev->instance,
dev-> dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
component[MMAL_COMPONENT_VIDEO_ENCODE]);
vchiq_mmal_component_finalise(dev->instance, vchiq_mmal_component_finalise(dev->instance,
dev-> dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
component[MMAL_COMPONENT_IMAGE_ENCODE]);
vchiq_mmal_component_finalise(dev->instance, vchiq_mmal_component_finalise(dev->instance,
dev->component[MMAL_COMPONENT_PREVIEW]); dev->component[MMAL_COMPONENT_PREVIEW]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment