summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* media: tuners: add SPDX identifiers to the code I wroteMauro Carvalho Chehab2017-12-116-69/+51Star
| | | | | | | | | | | | | | | As we're now using SPDX identifiers, on the several media drivers I wrote, add the proper SPDX, identifying the license I meant. As we're now using the short license, it doesn't make sense to keep the original license text. Also, fix MODULE_LICENSE to properly identify GPL v2. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rc: add SPDX identifiers to the code I wroteMauro Carvalho Chehab2017-12-116-93/+38Star
| | | | | | | | | | | | | | | As we're now using SPDX identifiers, on the several media drivers I wrote, add the proper SPDX, identifying the license I meant. As we're now using the short license, it doesn't make sense to keep the original license text. Also, fix MODULE_LICENSE to properly identify GPL v2. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: uvcvideo: Stream error events carry no dataLaurent Pinchart2017-12-081-2/+3
| | | | | | | | | | According to the UVC specification, stream error events carry no data. Fix a buffer overflow (that should be harmless given data alignment) when reporting the stream error event by removing the data byte from the message. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: uvcvideo: Mark buffer error where overflowBaoyou Xie2017-12-081-0/+1
| | | | | | | | | | | | Some cameras post inaccurate frame where next frame data overlap it. this results in screen flicker, and it need to be prevented. So this patch marks the buffer error to discard the frame where buffer overflow. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: uvcvideo: Remove duplicate & operationJaejoong Kim2017-12-081-2/+2
| | | | | | | | | | usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: uvcvideo: Add D3DFMT_L8 supportNicolas Dufresne2017-12-082-0/+10
| | | | | | | | | | Microsoft HoloLense UVC sensor uses D3DFMT instead of FOURCC when exposing formats. This adds support for D3DFMT_L8 as exposed from the Acer Windows Mixed Reality Headset. Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: exynos4-is: Use PTR_ERR_OR_ZERO()Vasyl Gomonovych2017-12-081-4/+1Star
| | | | | | | | | | | | | Fix ptr_ret.cocci warnings: drivers/media/platform/exynos4-is/fimc-lite.c:1465:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: venus: cleanup set_property controlsStanimir Varbanov2017-12-081-71/+2Star
| | | | | | | | | Move ptype (property type) initialization out of switch case and save few lines of code. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Restore full DT paths in kernel messagesGeert Uytterhoeven2017-12-081-6/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | As of_node_full_name() now returns only the basename, the endpoint information printed became useless: adv748x 4-0070: Endpoint endpoint on port 7 adv748x 4-0070: Endpoint endpoint on port 8 adv748x 4-0070: Endpoint endpoint on port 10 adv748x 4-0070: Endpoint endpoint on port 11 Restore the old behavior by using "%pOF" instead: adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@7/endpoint on port 7 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@8/endpoint on port 8 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@10/endpoint on port 10 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@11/endpoint on port 11 Fixes: a7e4cfb0a7ca4773 ("of/fdt: only store the device node basename in full_name") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: vivid: use ktime_t for timestamp calculationArnd Bergmann2017-12-085-13/+11Star
| | | | | | | | | | | | | | | timespec is generally deprecated because of the y2038 overflow. In vivid, the usage is fine, since we are dealing with monotonic timestamps, but we can also simplify the code by going to ktime_t. Using ktime_divns() should be roughly as efficient as the old code, since the constant 64-bit division gets turned into a multiplication on modern platforms, and we save multiple 32-bit divisions that can be expensive e.g. on ARMv7. Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: imx: use ktime_t for timestampsArnd Bergmann2017-12-083-20/+20
| | | | | | | | | | | | | | | | | The imx media driver passes around monotonic timestamps in the deprecated 'timespec' format. This is not a problem for the driver, as they won't overflow, but moving to either timespec64 or ktime_t is preferred. I'm picking ktime_t for simplicity here. frame_interval_monitor() is the main function that changes, as it tries to compare a time interval in microseconds. The algorithm slightly changes here, to avoid 64-bit division. The code previously assumed that the error was at most 32-bit worth of microseconds here, so I'm making the same assumption but add an explicit test for it. 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>
* media: solo6x10: use ktime_get_ts64() for time syncArnd Bergmann2017-12-081-8/+9
| | | | | | | | | | | | | | solo6x10 correctly deals with time stamps and will never suffer from overflows, but it uses the deprecated 'struct timespec' type and 'ktime_get_ts()' interface to read the monotonic clock. This changes it to use ktime_get_ts64() instead, so we can eventually remove ktime_get_ts(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: venus: venc: Apply inloop deblocking filterLoic Poulain2017-12-083-4/+26
| | | | | | | | | | | | | Deblocking filter allows to reduce blocking artifacts and improve visual quality. This is configurable via the V4L2 API but eventually not applied to the encoder. Note that alpha and beta deblocking values are 32-bit signed (-6;+6). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: venus: venc: configure entropy modeLoic Poulain2017-12-081-0/+11
| | | | | | | | | | | | | | H264 entropy mode can be selected via V4L2 API but is eventually not applied. Configure encoder with selected mode, CALVC (def) or CABAC. Note that hw/firmware also expects a CABAC model configuration which currently doesn't have existing V4L2 API control. For now, use model_0 which seems always supported and so the default one. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: davinci: vpif_capture: add NULL check on devm_kzalloc return valueGustavo A. R. Silva2017-12-081-0/+2
| | | | | | | | | | | | | Check return value from call to devm_kzalloc() in order to prevent a NULL pointer dereference. This issue was detected with the help of Coccinelle. Fixes: 4a5f8ae50b66 ("[media] davinci: vpif_capture: get subdevs from DT when available") Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: tegra-cec: add missing MODULE_DESCRIPTION/AUTHOR/LICENSEJesse Chan2017-12-081-0/+5
| | | | | | | | | | | | | | | | This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/tegra-cec/tegra_cec.o see include/linux/module.h for more information This adds the license as "GPL v2", which matches the header of the file. MODULE_DESCRIPTION and MODULE_AUTHOR are also added. Signed-off-by: Jesse Chan <jc@linux.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: soc_camera: soc_scale_crop: add missing MODULE_DESCRIPTION/AUTHOR/LICENSEJesse Chan2017-12-081-0/+4
| | | | | | | | | | | | | | | | This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/soc_camera/soc_scale_crop.o see include/linux/module.h for more information This adds the license as "GPL", which matches the header of the file. MODULE_DESCRIPTION and MODULE_AUTHOR are also added. Signed-off-by: Jesse Chan <jc@linux.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: mtk-vcodec: add missing MODULE_LICENSE/DESCRIPTIONJesse Chan2017-12-081-0/+3
| | | | | | | | | | | | | | | | This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o see include/linux/module.h for more information This adds the license as "GPL v2", which matches the header of the file. MODULE_DESCRIPTION is also added. Signed-off-by: Jesse Chan <jc@linux.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: usbvision: remove unneeded DRIVER_LICENSE #defineGreg Kroah-Hartman2017-12-081-2/+1Star
| | | | | | | | | | | | | | | | | | | | There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string. This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. Cc: Hans Verkuil <hverkuil@xs4all.nl> Cc: Johan Hovold <johan@kernel.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Reported-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: vivid: print time in y2038-safe wayArnd Bergmann2017-12-082-2/+2
| | | | | | | | | | | time_to_tm() takes a time_t value that overflows in 2038 on 32-bit systems. time64_to_tm() doesn't have this problem, so let's use that in combination with ktime_get_real_seconds() to read a 64-bit time value. 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>
* media: cpia2: Fix a couple off by one bugsDan Carpenter2017-12-081-2/+2
| | | | | | | | | | | | | The cam->buffers[] array has cam->num_frames elements so the > needs to be changed to >= to avoid going beyond the end of the array. The ->buffers[] array is allocated in cpia2_allocate_buffers() if you want to confirm. Fixes: ab33d5071de7 ("V4L/DVB (3376): Add cpia2 camera support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: coda: remove definition of CODA_STD_MJPGMartin Kepplinger2017-12-081-1/+0Star
| | | | | | | | | | | | | | | | | According to i.MX VPU API Reference Manuals the MJPG video codec is referenced to by number 7, not 3. Also Philipp pointed out that this value is only meant to fill in CMD_ENC_SEQ_COD_STD for encoding, only on i.MX53. It was never written to any register, and even if defined correctly, wouldn't be needed for i.MX6. So avoid confusion and remove this definition. Signed-off-by: Martin Kepplinger <martink@posteo.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: media: imx: fix inconsistent IS_ERR and PTR_ERRGustavo A. R. Silva2017-12-081-1/+1
| | | | | | | | | | | | Fix inconsistent IS_ERR and PTR_ERR in csi_link_validate. The proper pointer to be passed as argument is sensor. This issue was detected with the help of Coccinelle. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cec: disable the hardware when unregisteredHans Verkuil2017-12-083-13/+25
| | | | | | | | | | | When the device is being unregistered disable the hardware, don't wait until cec_delete_adapter is called as the hardware may have disappeared by then. This would be the case for hotplugable devices. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Bård Eirik Winther <bwinther@cisco.com> Tested-by: Bård Eirik Winther <bwinther@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cec-core.rst: document the new adap_monitor_pin_enable opHans Verkuil2017-12-081-0/+14
| | | | | | | Document what this op does. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cec: add the adap_monitor_pin_enable opHans Verkuil2017-12-084-5/+42
| | | | | | | | | | | | | | | | Some devices can monitor the CEC pin using an interrupt, but you only want to enable the interrupt if you actually switch to pin monitoring mode. So add a new op that is called when pin monitoring needs to be switched on or off. Also fix a small bug where the initial CEC pin event was sent again when calling S_MODE twice with the same CEC_MODE_MONITOR_PIN mode. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: pulse8-cec: print time using time64_tArnd Bergmann2017-12-081-2/+2
| | | | | | | | | | | | | | | | The firmware timestamp is an unsigned 32-bit value, but we copy it into a signed 32-bit variable, so we can theoretically get an overflow in the calculation when the timestamp is between 2038 and 2106. This changes the temporary variable to time64_t and changes the deprecated time_to_tm() over to time64_to_tm() accordingly. There is still an overflow in y2106, but that is a limitation of the firmware interface, not a kernel problem. 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>
* media: vimc: add test_pattern and h/vflip controls to the sensorHans Verkuil2017-12-082-1/+67
| | | | | | | | | | | | | | Add support for the test_pattern control and the h/vflip controls. This makes it possible to switch to more interesting test patterns and to test control handling in v4l-subdevs. There are more tpg-related controls that can be added, but this is a good start. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix small whitespace checkpatch warning] Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: s2255drv: update firmware loadDean A2017-12-081-7/+6Star
| | | | | | | | | fixes intermittent soft reboot issue with firmware load increases wait time of reset, as required by HW Signed-off-by: Dean Anderson <dean@sensoray.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cx23885: Handle return value of kasprintfArvind Yadav2017-12-081-2/+13
| | | | | | | | kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: vsp1: Prevent suspending and resuming DRM pipelinesKieran Bingham2017-12-081-2/+14
| | | | | | | | | | | | | | | | When used as part of a display pipeline, the VSP is stopped and restarted explicitly by the DU from its suspend and resume handlers. There is thus no need to stop or restart pipelines in the VSP suspend and resume handlers, and doing so would cause the hardware to be left in a misconfigured state. Ensure that the VSP suspend and resume handlers do not affect DRM-based pipelines. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cec-adap: add '0x' prefix when printing statusHans Verkuil2017-12-081-1/+1
| | | | | | | | It's not clear if the transmit status that is printed when debugging is enabled is hex or decimal. Add 0x prefix to make this explicit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: adv7604.c: add missing returnHans Verkuil2017-12-081-0/+1
| | | | | | | | | | A 'return' was missing when detecting Arbitration Lost and calling transmit_done. With the return transmit_done could be called a second time, confusing the CEC framework. Luckily the Arbitration Lost condition is very rare. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: imx: Remove incorrect check for queue state in start/stop_streamingIan Jamison2017-12-081-6/+0Star
| | | | | | | | | | | | | | | | It is possible to call STREAMON without the minimum number of buffers queued. In this case the vb2_queue state will be set to streaming but the start_streaming vb2_op will not be called. Later when enough buffers are queued, start_streaming will be called but vb2_is_streaming will already return true. Also removed the queue state check in stop_streaming since it's not valid there either. Signed-off-by: Ian Jamison <ian.dev@arkver.com> Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: venus: venc: set correctly GOP size and number of B-framesStanimir Varbanov2017-12-082-6/+68
| | | | | | | | | | This change fixes the calculation of B-frames and GOP size by adopt v4l2 controls with the firmware interface expectations. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fixed two small checkpatch comments] Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cx231xx: Add support for The Imaging Source DFG/USB2proRomain Reignier2017-12-082-0/+29
| | | | | | | | Note that the inputs for the Composite and S-Video are inverted in regard to most of the other boards using a cx231xx chip. Signed-off-by: Romain Reignier <r.reignier@robopec.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
* media: i2c: adv748x: Remove duplicate NULL checkAndy Shevchenko2017-12-081-4/+2Star
| | | | | | | | | | Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: adv7180: Remove duplicate checksAndy Shevchenko2017-12-081-8/+4Star
| | | | | | | | | Since i2c_unregister_device() became NULL-aware we may remove duplicate checks. Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: drivers/media/pci/zoran: remove redundant assignment to pointer hColin Ian King2017-12-081-1/+0Star
| | | | | | | | | | | | | The pointer h is already initialized to codeclist_top so the second identical assignment is redundant and can be removed. Cleans up clang warning: drivers/media/pci/zoran/videocodec.c:322:21: warning: Value stored to 'h' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: pt3: remove redundant assignment to maskColin Ian King2017-12-081-1/+0Star
| | | | | | | | | | | | | Variable mask is being set to 0x80 and then set to this value again in the following for-loop. Remove the extraneous first setting of mask. Cleans up clang warning: drivers/media/pci/pt3/pt3_i2c.c:88:2: warning: Value stored to 'mask' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: use ARRAY_SIZEJérémy Lefaure2017-12-087-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Using the ARRAY_SIZE macro improves the readability of the code. Also, it is not always useful to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: gspca: Convert PDEBUG to gspca_dbgJoe Perches2017-12-0859-687/+742
| | | | | | | | | | | | | | | | | Use a more typical logging style. The current macro hides the gspca_dev argument so add it to the macro uses instead. Miscellanea: o Add missing '\n' terminations to formats o Realign arguments to open parenthesis o Remove commented out uses of PDEBUG Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: gspca: Convert PERR to gspca_errJoe Perches2017-12-0832-156/+174
| | | | | | | | | | | | | | | | Use a more typical kernel logging style. The current macro hides the gspca_dev argument so add it to the macro uses instead. Miscellanea: o Add missing '\n' terminations to formats o Realign arguments to open parenthesis Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: stk-webcam: Fix use after free on disconnectDan Carpenter2017-12-081-1/+1
| | | | | | | | | | | We free the stk_camera device too early. It's allocate first in probe and it should be freed last in stk_camera_disconnect(). Reported-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-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>
* media: hdpvr: Fix an error handling path in hdpvr_probe()Arvind Yadav2017-12-081-11/+15
| | | | | | | | | | | | | | Here, hdpvr_register_videodev() is responsible for setup and register a video device. Also defining and initializing a worker. hdpvr_register_videodev() is calling by hdpvr_probe at last. So no need to flush any work here. Unregister v4l2, free buffers and memory. If hdpvr_probe() will fail. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxusb: pass buf as a const u8 * pointer and make buf static constColin Ian King2017-12-081-2/+3
| | | | | | | | | | | | | | | | | | Don't populate the read-only u8 array buf on the stack at run time but instead make it static const; makes object code smaller saving over 480 bytes: Before: text data bss dec hex filename 33030 65936 192 99158 18356 drivers/media/usb/dvb-usb/cxusb.o After: text data bss dec hex filename 32446 66032 192 98670 1816e drivers/media/usb/dvb-usb/cxusb.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: solo6x10: hide unused variableArnd Bergmann2017-12-081-0/+2
| | | | | | | | | | | | | | | | | | When building without CONFIG_GPIOLIB, we get a harmless warning about an unused variable: drivers/media/pci/solo6x10/solo6x10-gpio.c: In function 'solo_gpio_init': drivers/media/pci/solo6x10/solo6x10-gpio.c:165:6: error: unused variable 'ret' [-Werror=unused-variable] This adds another #ifdef around the declaration. Fixes: d3202d1981dc ("media: solo6x10: export hardware GPIO pins 8:31 to gpiolib interface") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Acked-by: Anton Sviridenko <anton@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: tuners: mxl5005s: make arrays static const, reduces object code sizeColin Ian King2017-12-081-6/+11
| | | | | | | | | | | | | | | | | Don't populate the arrays RegAddr on the stack, instead make them static const. Makes the object code smaller by over 980 bytes: Before: text data bss dec hex filename 64923 304 0 65227 fecb drivers/media/tuners/mxl5005s.o After: text data bss dec hex filename 63779 464 0 64243 faf3 drivers/media/tuners/mxl5005s.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Staging: media: imx: Prefer using BIT macroSrishti Sharma2017-12-081-8/+8
| | | | | | | | Use BIT(x) instead of (1<<x). Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Staging: media: omap4iss: Use WARN_ON() instead of BUG_ON()Srishti Sharma2017-12-081-1/+1
| | | | | | | | Use WARN_ON() instead of BUG_ON() to avoid crashing the kernel. Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>