diff options
Diffstat (limited to 'drivers/staging/vc04_services')
23 files changed, 66 insertions, 230 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index f484bb055df7..ec468d5719b1 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #include <linux/platform_device.h> #include <linux/init.h> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index 7e68b3e28246..5f7551fbf5cf 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #include <linux/interrupt.h> #include <linux/slab.h> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 3c6f1d91d22d..a4a48f31f1a3 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #include <linux/device.h> #include <sound/core.h> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index 8f2d508183b2..045d577fe4f8 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #include <linux/platform_device.h> @@ -443,7 +432,6 @@ static struct platform_driver bcm2835_alsa0_driver = { #endif .driver = { .name = "bcm2835_audio", - .owner = THIS_MODULE, .of_match_table = snd_bcm2835_of_match_table, }, }; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h index f1e43e45fd67..dc6ec915f9f5 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #ifndef __SOUND_ARM_BCM2835_H #define __SOUND_ARM_BCM2835_H diff --git a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h index da96f1bc2516..1a7f0884ac9c 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h +++ b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h @@ -1,16 +1,5 @@ -/***************************************************************************** - * Copyright 2011 Broadcom Corporation. All rights reserved. - * - * Unless you and Broadcom execute a separate written software license - * agreement governing use of this software, this software is licensed to you - * under the terms of the GNU General Public License version 2, available at - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). - * - * Notwithstanding the above, under no circumstances may you combine this - * software in any way with any other Broadcom software provided under a - * license other than the GPL, without Broadcom's express prior written - * consent. - *****************************************************************************/ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright 2011 Broadcom Corporation. All rights reserved. */ #ifndef _VC_AUDIO_DEFS_H_ #define _VC_AUDIO_DEFS_H_ diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index be936b8fe317..d2262275a870 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> @@ -328,11 +325,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, pr_debug("Grab another frame"); vchiq_mmal_port_parameter_set( instance, - dev->capture. - camera_port, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, - &dev->capture. - frame_count, + &dev->capture.frame_count, sizeof(dev->capture.frame_count)); } } else { @@ -343,37 +338,17 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, if (dev->capture.frame_count) { if (dev->capture.vc_start_timestamp != -1 && pts != 0) { - struct timeval timestamp; + ktime_t timestamp; s64 runtime_us = pts - dev->capture.vc_start_timestamp; - u32 div = 0; - u32 rem = 0; - - div = - div_u64_rem(runtime_us, USEC_PER_SEC, &rem); - timestamp.tv_sec = - dev->capture.kernel_start_ts.tv_sec + div; - timestamp.tv_usec = - dev->capture.kernel_start_ts.tv_usec + rem; - - if (timestamp.tv_usec >= - USEC_PER_SEC) { - timestamp.tv_sec++; - timestamp.tv_usec -= - USEC_PER_SEC; - } + timestamp = ktime_add_us(dev->capture.kernel_start_ts, + runtime_us); v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, - "Convert start time %d.%06d and %llu " - "with offset %llu to %d.%06d\n", - (int)dev->capture.kernel_start_ts. - tv_sec, - (int)dev->capture.kernel_start_ts. - tv_usec, + "Convert start time %llu and %llu with offset %llu to %llu\n", + ktime_to_ns(dev->capture.kernel_start_ts), dev->capture.vc_start_timestamp, pts, - (int)timestamp.tv_sec, - (int)timestamp.tv_usec); - buf->vb.vb2_buf.timestamp = timestamp.tv_sec * 1000000000ULL + - timestamp.tv_usec * 1000ULL; + ktime_to_ns(timestamp)); + buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); } else { buf->vb.vb2_buf.timestamp = ktime_get_ns(); } @@ -387,11 +362,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, "Grab another frame as buffer has EOS"); vchiq_mmal_port_parameter_set( instance, - dev->capture. - camera_port, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, - &dev->capture. - frame_count, + &dev->capture.frame_count, sizeof(dev->capture.frame_count)); } } else { @@ -547,7 +520,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) "Start time %lld size %d\n", dev->capture.vc_start_timestamp, parameter_size); - v4l2_get_timestamp(&dev->capture.kernel_start_ts); + dev->capture.kernel_start_ts = ktime_get(); /* enable the camera port */ dev->capture.port->cb_ctx = dev; @@ -555,8 +528,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb); if (ret) { v4l2_err(&dev->v4l2_dev, - "Failed to enable capture port - error %d. " - "Disabling camera port again\n", ret); + "Failed to enable capture port - error %d. Disabling camera port again\n", + ret); vchiq_mmal_port_disable(dev->instance, dev->capture.camera_port); @@ -1213,8 +1186,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, port->current_buffer.size = (f->fmt.pix.sizeimage < (100 << 10)) - ? (100 << 10) : f->fmt.pix. - sizeimage; + ? (100 << 10) + : f->fmt.pix.sizeimage; } v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index 404037476bc5..2b5679eb5b4a 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> @@ -92,7 +89,7 @@ struct bm2835_mmal_dev { /* VC start timestamp for streaming */ s64 vc_start_timestamp; /* Kernel start timestamp for streaming */ - struct timeval kernel_start_ts; + ktime_t kernel_start_ts; struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 77a5d6f4e1eb..0736214e1422 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h index 840fd139e033..800e4e7e5f96 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h index e71d9600b278..129203597f91 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h index 66e8a6edf628..ec8455639d49 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h index 24b002e8df0c..c9d6fbe25fe4 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h index 84a0f4b717ef..dd4b4ce72081 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h index 5a1b2a7d8eb0..d1c57edbe2b8 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h index e7300229842d..1607bc4c0347 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 6ea7fb0ea50e..a91ef6ea29ce 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> @@ -618,8 +615,8 @@ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, struct mmal_msg_context *msg_context; u32 handle; - pr_debug("buffer_to_host_cb: instance:%p msg:%p msg_len:%d\n", - instance, msg, msg_len); + pr_debug("%s: instance:%p msg:%p msg_len:%d\n", + __func__, instance, msg, msg_len); if (msg->u.buffer_from_host.drvbuf.magic == MMAL_MAGIC) { handle = msg->u.buffer_from_host.drvbuf.client_context; @@ -1360,8 +1357,7 @@ static int port_action_handle(struct vchiq_mmal_instance *instance, ret = -rmsg->u.port_action_reply.status; - pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d)" \ - " connect component:0x%x connect port:%d\n", + pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d) connect component:0x%x connect port:%d\n", __func__, ret, port->component->handle, port->handle, port_action_type_names[action_type], diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h index db39900c9d91..b1f22b6dca10 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Broadcom BM2835 V4L2 driver * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk> * Dave Stevenson <dsteve@broadcom.com> * Simon Mellor <simellor@broadcom.com> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 315b49c1de3b..b59ef14890aa 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -224,8 +224,7 @@ vchiq_platform_get_arm_state(VCHIQ_STATE_T *state) platform_state = (struct vchiq_2835_state *)state->platform_state; - if (!platform_state->inited) - BUG(); + WARN_ON_ONCE(!platform_state->inited); return &platform_state->arm_state; } @@ -485,8 +484,7 @@ create_pagelist(char __user *buf, size_t count, unsigned short type) __func__, actual_pages, num_pages); /* This is probably due to the process being killed */ - while (actual_pages > 0) - { + while (actual_pages > 0) { actual_pages--; put_page(pages[actual_pages]); } diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 411539f8ff8c..c2c440009cac 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -682,8 +682,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (user_service->close_pending && down_interruptible(&user_service->close_event)) status = VCHIQ_RETRY; - } - else + } else ret = -EINVAL; } break; @@ -708,8 +707,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (user_service->close_pending && down_interruptible(&user_service->close_event)) status = VCHIQ_RETRY; - } - else + } else ret = -EINVAL; } break; @@ -1171,8 +1169,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) USER_SERVICE_T *user_service = (USER_SERVICE_T *)service->base.userdata; close_delivered(user_service); - } - else + } else ret = -EINVAL; } break; @@ -1810,8 +1807,7 @@ vchiq_release(struct inode *inode, struct file *file) instance->completion_remove & (MAX_COMPLETIONS - 1)]; service = completion->service_userdata; - if (completion->reason == VCHIQ_SERVICE_CLOSED) - { + if (completion->reason == VCHIQ_SERVICE_CLOSED) { USER_SERVICE_T *user_service = service->base.userdata; diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index ecff92bae200..5d28fff46557 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -66,8 +66,7 @@ struct vchiq_openack_payload { short version; }; -enum -{ +enum { QMFLAGS_IS_BLOCKING = (1 << 0), QMFLAGS_NO_MUTEX_LOCK = (1 << 1), QMFLAGS_NO_MUTEX_UNLOCK = (1 << 2) @@ -212,7 +211,8 @@ find_service_by_port(VCHIQ_STATE_T *state, int localport) VCHIQ_SERVICE_T * find_service_for_instance(VCHIQ_INSTANCE_T instance, - VCHIQ_SERVICE_HANDLE_T handle) { + VCHIQ_SERVICE_HANDLE_T handle) +{ VCHIQ_SERVICE_T *service; spin_lock(&service_spinlock); @@ -235,7 +235,8 @@ find_service_for_instance(VCHIQ_INSTANCE_T instance, VCHIQ_SERVICE_T * find_closed_service_for_instance(VCHIQ_INSTANCE_T instance, - VCHIQ_SERVICE_HANDLE_T handle) { + VCHIQ_SERVICE_HANDLE_T handle) +{ VCHIQ_SERVICE_T *service; spin_lock(&service_spinlock); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c index 34f746db19cd..43c89a08bda9 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c @@ -64,11 +64,6 @@ static VCHIQ_STATUS_T vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data, unsigned int size, VCHIQ_BULK_DIR_T dir); -/**************************************************************************** -* -* vchiq_initialise -* -***************************************************************************/ #define VCHIQ_INIT_RETRIES 10 VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out) { @@ -80,7 +75,9 @@ VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out) vchiq_log_trace(vchiq_core_log_level, "%s called", __func__); /* VideoCore may not be ready due to boot up timing. - It may never be ready if kernel and firmware are mismatched, so don't block forever. */ + * It may never be ready if kernel and firmware are mismatched,so don't + * block forever. + */ for (i = 0; i < VCHIQ_INIT_RETRIES; i++) { state = vchiq_get_state(); if (state) @@ -93,7 +90,8 @@ VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out) goto failed; } else if (i > 0) { vchiq_log_warning(vchiq_core_log_level, - "%s: videocore initialized after %d retries\n", __func__, i); + "%s: videocore initialized after %d retries\n", + __func__, i); } instance = kzalloc(sizeof(*instance), GFP_KERNEL); @@ -120,12 +118,6 @@ failed: } EXPORT_SYMBOL(vchiq_initialise); -/**************************************************************************** -* -* vchiq_shutdown -* -***************************************************************************/ - VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance) { VCHIQ_STATUS_T status; @@ -168,23 +160,11 @@ VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance) } EXPORT_SYMBOL(vchiq_shutdown); -/**************************************************************************** -* -* vchiq_is_connected -* -***************************************************************************/ - static int vchiq_is_connected(VCHIQ_INSTANCE_T instance) { return instance->connected; } -/**************************************************************************** -* -* vchiq_connect -* -***************************************************************************/ - VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance) { VCHIQ_STATUS_T status; @@ -214,12 +194,6 @@ failed: } EXPORT_SYMBOL(vchiq_connect); -/**************************************************************************** -* -* vchiq_add_service -* -***************************************************************************/ - VCHIQ_STATUS_T vchiq_add_service( VCHIQ_INSTANCE_T instance, const VCHIQ_SERVICE_PARAMS_T *params, @@ -259,12 +233,6 @@ VCHIQ_STATUS_T vchiq_add_service( } EXPORT_SYMBOL(vchiq_add_service); -/**************************************************************************** -* -* vchiq_open_service -* -***************************************************************************/ - VCHIQ_STATUS_T vchiq_open_service( VCHIQ_INSTANCE_T instance, const VCHIQ_SERVICE_PARAMS_T *params, @@ -414,8 +382,9 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data, if ((bulk->data != data) || (bulk->size != size)) { /* This is not a retry of the previous one. - ** Cancel the signal when the transfer - ** completes. */ + * Cancel the signal when the transfer + * completes. + */ spin_lock(&bulk_waiter_spinlock); bulk->userdata = NULL; spin_unlock(&bulk_waiter_spinlock); @@ -441,7 +410,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data, if (bulk) { /* Cancel the signal when the transfer - ** completes. */ + * completes. + */ spin_lock(&bulk_waiter_spinlock); bulk->userdata = NULL; spin_unlock(&bulk_waiter_spinlock); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c index d465e1cf5db9..29984f9795c7 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c @@ -800,8 +800,7 @@ int32_t vchi_get_peer_version(const VCHI_SERVICE_HANDLE_T handle, short *peer_ve int32_t ret = -1; struct shim_service *service = (struct shim_service *)handle; - if (service) - { + if (service) { VCHIQ_STATUS_T status; status = vchiq_get_peer_version(service->handle, peer_version); |