Commit graph

634947 commits

Author SHA1 Message Date
Hans Verkuil adc0c62278 [media] cec: add CEC_MSG_FL_REPLY_TO_FOLLOWERS
Give the caller more control over how replies to a transmit are
handled. By default the reply will only go to the filehandle that
called CEC_TRANSMIT. If this new flag is set, then the reply will
also go to all followers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:32:56 -02:00
Hans Verkuil f4062625ed [media] cec: add flag to cec_log_addrs to enable RC passthrough
By default the CEC_MSG_USER_CONTROL_PRESSED/RELEASED messages
are passed on to the follower(s) only. If the new
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU flag is set in the
flags field of struct cec_log_addrs then these messages are also
passed on to the remote control input subsystem and they will appear
as keystrokes.

This used to be the default behavior, but now you have to explicitly
enable it. This is done to force the caller to think about possible
security issues (e.g. if these messages are used to enter passwords).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:32:07 -02:00
Hans Verkuil 77edf603f2 [media] cec rst: convert tables and drop the 'row' comments
This uses Laurent's python script to convert all tables, dropping
the useless 'row' comments.

See commit c2b66cafdf ("[media] v4l: doc: Remove row numbers from tables")
for the script that was used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:30:54 -02:00
Hans Verkuil acd4973563 [media] pulse8-cec: set all_device_types when restoring config
When the persistent state is restored, the all_device_types field
was never filled in. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:29:37 -02:00
Hans Verkuil 9f750b2b15 [media] cobalt: fix copy-and-paste error
The vmr_stat variable was filled with the contents of the control register,
not the status register. Classic copy-and-paste error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:28:13 -02:00
Wu-Cheng Li b7ccb9fb79 [media] mtk-vcodec: add index check in decoder vidioc_qbuf
vb2_qbuf will check the buffer index. If a driver overrides
vidioc_qbuf and use the buffer index, the driver needs to check
the index.

Signed-off-by: Wu-Cheng Li <wuchengli@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:27:43 -02:00
Hans Verkuil 93d39efdb1 [media] control.rst: improve the queryctrl code examples
The code examples on how to enumerate controls were really long in the
tooth. Update them.

Using FLAG_NEXT_CTRL is preferred these days, so give that example first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:27:11 -02:00
Hans Verkuil e92ca73b70 [media] cec-core.rst: improve documentation
Improve the internal CEC documentation. In particular add a section
that specifies that transmit-related interrupts should be processed
before receive interrupts.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:26:13 -02:00
Markus Elfring e91b6006bf [media] DaVinci-VPFE-Capture: Replace a memcpy() call by an assignment in vpfe_enum_input()
Use a direct assignment for an array element which can be set over the
pointer variable "inp" instead of calling the function "memcpy" here.

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:25:06 -02:00
Markus Elfring 2eaa68f33b [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()
* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

  Fixes: 9a7f95ad1c ("[media] davinci vpbe: add dm365 VPBE display driver changes")

* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:24:37 -02:00
Maninder Singh 64bab1a20c [media] staging: st-cec: add parentheses around complex macros
This patch fixes the following checkpatch.pl error:
ERROR: Macros with complex values should be enclosed in parentheses

Signed-off-by: Maninder Singh <maninder.s2@samsung.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:23:10 -02:00
Hans Verkuil 827c1f525a [media] adv7604: add vic detect
Obtain the correct timings based on the VIC code from the AVI InfoFrame.

It does a sanity check to see if at least the measured width and height
are in line with what the VIC code reports. If not, then use the timings
instead of the VIC code (as per the CEA-861 spec).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:20:59 -02:00
Hans Verkuil d736e348a0 [media] cobalt: add cropcap support
Now that the timings contain picture aspect ratio information,
we can support cropcap to return the pixel aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:20:49 -02:00
Hans Verkuil 652430763f [media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio
Add a helper to find timings based on the CEA-861 VIC code. Also,
add a helper that returns the pixel aspect ratio based on the
v4l2_dv_timings struct.

[mchehab@s-opensource.com: fix coding style]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:20:03 -02:00
Hans Verkuil cf0381205d [media] v4l2-dv-timings: add VICs and picture aspect ratio
Add the CEA-861 VIC, the HDMI VIC and the picture aspect ratio information
where applicable.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:13:18 -02:00
Hans Verkuil a5e18f1401 [media] vidioc-g-dv-timings.rst: document the new dv_timings flags
Document the new flags.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 14:37:57 -02:00
Hans Verkuil 4f100ff659 [media] videodev2.h: add VICs and picture aspect ratio
Add picture aspect ratio information, the CEA-861 VIC (Video Identification
Code) and the HDMI VIC to struct v4l2_bt_timings.

The picture aspect was chosen rather than the pixel aspect since 1) the
CEA-861 standard uses picture aspect, and 2) pixel aspect ratio can become
tricky when dealing with pixel repeat timings. While we don't support those
yet at the moment, this might become necessary. And in that case using
picture aspect ratio makes more sense. And converting picture aspect ratio
to pixel aspect ratio is easy enough.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 14:30:47 -02:00
Hans Verkuil 8fbe91e791 [media] videodev2.h: checkpatch cleanup
Format comments according to what checkpatch wants.

No other changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:32:04 -02:00
Jonathan Sims a503ff8124 [media] hdpvr: fix interrupted recording
This is a reworking of a patch originally submitted by Ryley Angus,
modified by Hans Verkuil and then seemingly forgotten before changes
suggested by Keith Pyle here:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg75163.html

were made and tested.

I have implemented the suggested changes and have been testing for the
last 2 months. I am no longer experiencing lockups while recording
(with blue light on, requiring power cycling) which had been a long
standing problem with the HD-PVR. I have not noticed any other problems
since applying the patch.

Signed-off-by: Jonathan Sims <jonathan.625266@earthlink.net>
Reported-by: Ryley Angus <ryleyjangus@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:30:30 -02:00
Sakari Ailus 708f48e76d [media] v4l: Document that m2m devices have a file handle specific context
Memory-to-memory V4L2 devices all have file handle specific context.
Say this in the API documentation so that the user space may rely on it
being the case.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:29:44 -02:00
Colin Ian King 20d93338bf [media] st-hva: fix a copy-and-paste variable name error
The second check for an error on hva->lmi_err_reg appears
to be a copy-and-paste error, it should be hva->emi_err_reg
instead.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:29:04 -02:00
Masahiro Yamada 29a8d97925 [media] squash lines for simple wrapper functions
Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:28:40 -02:00
Wei Yongjun 4a3229834d [media] s5p-cec: remove unused including <linux/version.h>
Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:27:39 -02:00
Fengguang Wu f76fb34a25 [media] media: fix platform_no_drv_owner.cocci warnings
drivers/media/platform/mtk-mdp/mtk_mdp_core.c:284:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:27:19 -02:00
Vincent Stehlé 55d80506c5 [media] media: mtk-mdp: NULL-terminate mtk_mdp_comp_dt_ids
The mtk_mdp_comp_dt_ids[] array should be NULL-terminated; add therefore an
empty entry in the end.

Fixes: c8eb2d7e82 ("[media] media: Add Mediatek MDP Driver")

Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:26:58 -02:00
Andrey Utkin 5fc4b067ec [media] media: solo6x10: fix lockup by avoiding delayed register write
This fixes a lockup at device probing which happens on some solo6010
hardware samples. This is a regression introduced by commit e1ceb25a15
("[media] SOLO6x10: remove unneeded register locking and barriers")

The observed lockup happens in solo_set_motion_threshold() called from
solo_motion_config().

This extra "flushing" is not fundamentally needed for every write, but
apparently the code in driver assumes such behaviour at last in some
places.

Actual fix was proposed by Hans Verkuil.

Fixes: e1ceb25a15 ("[media] SOLO6x10: remove unneeded register locking and barriers")

Cc: stable@vger.kernel.org  # 4.3 and up
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:23:04 -02:00
Masanari Iida 84512f3e1c [media] v4l: doc: Fix typo in vidioc-g-tuner.rst
This patch fix spelling typos found in vidioc-g-tuner.rst

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:22:02 -02:00
Javier Martinez Canillas 2411434a2b [media] st-cec: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
alias:          of:N*T*Cst,stih-cecC*
alias:          of:N*T*Cst,stih-cec

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:21:05 -02:00
Javier Martinez Canillas 0dc5fb0a0b [media] s5p-cec: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
alias:          of:N*T*Csamsung,s5p-cecC*
alias:          of:N*T*Csamsung,s5p-cec

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:20:36 -02:00
Javier Martinez Canillas 5bb50fe731 [media] rc: meson-ir: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
$

After this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
alias:          of:N*T*Camlogic,meson-gxbb-irC*
alias:          of:N*T*Camlogic,meson-gxbb-ir
alias:          of:N*T*Camlogic,meson8b-irC*
alias:          of:N*T*Camlogic,meson8b-ir
alias:          of:N*T*Camlogic,meson6-irC*
alias:          of:N*T*Camlogic,meson6-ir

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:20:11 -02:00
Javier Martinez Canillas d6023d33a4 [media] v4l: rcar-fcp: Fix module autoload for OF registration
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:          rcar-fcp

After this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:          rcar-fcp
alias:          of:N*T*Crenesas,fcpvC*
alias:          of:N*T*Crenesas,fcpv
alias:          of:N*T*Crenesas,fcpfC*
alias:          of:N*T*Crenesas,fcpf

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:17:07 -02:00
Javier Martinez Canillas 3184c3bf67 [media] v4l: vsp1: Fix module autoload for OF registration
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:          vsp1

After this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:          vsp1
alias:          of:N*T*Crenesas,vsp2C*
alias:          of:N*T*Crenesas,vsp2
alias:          of:N*T*Crenesas,vsp1C*
alias:          of:N*T*Crenesas,vsp1

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:16:23 -02:00
Mauro Carvalho Chehab 62de7d99dc [media] usbtv: don't do DMA on stack
As reported by smatch:
	drivers/media/usb/usbtv/usbtv-video.c:716 usbtv_s_ctrl() error: doing dma on the stack (data)
	drivers/media/usb/usbtv/usbtv-video.c:758 usbtv_s_ctrl() error: doing dma on the stack (data)

We should not do it, as it won't work on Kernels 4.9 and upper.
So, alloc a buffer for it.

Fixes: c53a846c48 ("[media] usbtv: add video controls")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:16:22 -02:00
Lubomir Rintel c53a846c48 [media] usbtv: add video controls
Brightness, Contrast, Hue and Color Saturation are supported.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:06:18 -02:00
Dan Carpenter 6b2bed8912 [media] st-hva: fix some error handling in hva_hw_probe()
The devm_ioremap_resource() returns error pointers, never NULL.  The
platform_get_resource() returns NULL on error, never error pointers.
The error code needs to be set, as well.  The current code returns
PTR_ERR(NULL) which is success.

Fixes: 57b2c0628b ("[media] st-hva: multi-format video encoder V4L2 driver")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:05:36 -02:00
Arnd Bergmann eadf081146 [media] s5p-cec: mark PM functions as __maybe_unused again
A bugfix removed the two callers of s5p_cec_runtime_suspend
and s5p_cec_runtime_resume, leading to the return of a harmless
warning that I had previously fixed in commit aee8937089
("[media] s5p_cec: mark suspend/resume as __maybe_unused"):

staging/media/s5p-cec/s5p_cec.c:234:12: error: ‘s5p_cec_runtime_suspend’ defined but not used [-Werror=unused-function]
staging/media/s5p-cec/s5p_cec.c:242:12: error: ‘s5p_cec_runtime_resume’ defined but not used [-Werror=unused-function]

This adds the __maybe_unused annotations to the function that
were not removed and that are now unused when CONFIG_PM
is disabled.

Fixes: 57b978ada0 ("[media] s5p-cec: fix system and runtime PM integration")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:04:47 -02:00
Markus Elfring ea0e437cf9 [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode()
The local variable "addr" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:04:14 -02:00
Markus Elfring 3ce5f66014 [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr()
The local variable "channel_id" will be reassigned with the following
statement at the beginning. Thus omit the explicit initialisation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:03:47 -02:00
Markus Elfring 396c88e6c8 [media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers
The script "checkpatch.pl" pointed information out like the following.

Comparison to NULL could be written...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:03:25 -02:00
Markus Elfring ded1c8fa75 [media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation
Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:02:25 -02:00
Markus Elfring d5cf467ece [media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()
* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kcalloc".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:01:44 -02:00
Markus Elfring c64d61df9a [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_channel_isr()
The local variable "channel_id" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:01:12 -02:00
Markus Elfring 6a842cc29d [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_querystd()
The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:00:51 -02:00
Markus Elfring 03161cdb69 [media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers
The script "checkpatch.pl" pointed information out like the following.

Comparison to NULL could be written ...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:00:30 -02:00
Markus Elfring bc285799f7 [media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation
Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:00:06 -02:00
Markus Elfring b442c46f1b [media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe()
* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kcalloc".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 12:59:44 -02:00
Markus Elfring 96ca884236 [media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregister_ccdc_device()
The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement here.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 12:56:36 -02:00
Markus Elfring b899065640 [media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr()
Do not use curly brackets at one source code place
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 12:56:13 -02:00
Markus Elfring 19d4695a4f [media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()
Move assignments for two local variables into an else branch so that
their setting will only be performed after corresponding data processing
succeeded by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 12:55:50 -02:00
Markus Elfring 2a0de2c842 [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11 functions
The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 12:53:42 -02:00