summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
Commit message (Collapse)AuthorAgeFilesLines
* media: usb: rainshadow-cec: constify serio_device_idArvind Yadav2017-08-201-1/+1
| | | | | | | | | | serio_device_id are not supposed to change at runtime. All functions working with serio_device_id provided by <linux/serio.h> work with const serio_device_id. So mark the non-const structs as const. 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: adv*/vivid/pulse8/rainshadow: cec: use CEC_CAP_DEFAULTSHans Verkuil2017-08-091-2/+1
| | | | | | | | Use the new CEC_CAP_DEFAULTS define in the adv, vivid, pulse8 and rainshadow CEC drivers. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: pulse8-cec/rainshadow-cec: make adapter name uniqueHans Verkuil2017-07-181-1/+1
| | | | | | | | | | | The CEC adapter name used by the pulse8-cec and rainshadow-cec USB device drivers was a fixed string, but it should be unique if you connect multiple of these devices to the same computer. Use dev_name(&serio->dev) instead, which make it unique again. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rainshadow-cec: avoid -Wmaybe-uninitialized warning againArnd Bergmann2017-06-241-10/+8
| | | | | | | | | | | | | | | | | | | | | | Back in April I created a patch to address a false-positive warning: drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_irq_work_handler': drivers/media/usb/rainshadow-cec/rainshadow-cec.c:171:31: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized] My patch was totally wrong and introduced a real bug, and Colin Ian King thankfully noticed it now and fixed my mistake. Unfortunately, fixing the actual uninitialized data in this case brought back the original bogus warning. This is a new version of the patch, which simplifies the code to the point where gcc notices the behavior is correct. Fixes: ca33784ba494 ("[media] rainshadow-cec: ensure exit_loop is intialized") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning") Cc: Colin Ian King <colin.king@canonical.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] stih-cec/vivid/pulse8/rainshadow: use cec_transmit_attempt_doneHans Verkuil2017-06-201-6/+3
| | | | | | | | | Use the helper function cec_transmit_attempt_done instead of cec_transmit_done to simplify the code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* Merge tag 'media/v4.12-2' into patchworkMauro Carvalho Chehab2017-06-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | media fixes for v4.12-rc4 * tag 'media/v4.12-2': (598 commits) [media] rc-core: race condition during ir_raw_event_register() [media] cec: drop MEDIA_CEC_DEBUG [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER [media] cec: select CEC_CORE instead of depend on it [media] rainshadow-cec: ensure exit_loop is intialized [media] atomisp: don't treat warnings as errors Linux 4.12-rc3 x86/ftrace: Make sure that ftrace trampolines are not RWX x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range() selftests/ftrace: Add a testcase for many kprobe events kprobes/x86: Fix to set RWX bits correctly before releasing trampoline ftrace: Fix memory leak in ftrace_graph_release() ipv4: add reference counting to metrics net: ethernet: ax88796: don't call free_irq without request_irq first ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets sctp: fix ICMP processing if skb is non-linear net: llc: add lock_sock in llc_ui_bind to avoid a race condition PCI/msi: fix the pci_alloc_irq_vectors_affinity stub blk-mq: Only register debugfs attributes for blk-mq queues x86/timers: Move simple_udelay_calibration past init_hypervisor_platform ... Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] rainshadow-cec: ensure exit_loop is intializedColin Ian King2017-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | exit_loop is not being initialized, so it contains garbage. Ensure it is initialized to false. Detected by CoverityScan, CID#1436409 ("Uninitialized scalar variable") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning") 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] rainshadow-cec: Fix missing spin_lock_init()Wei Yongjun2017-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver") 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>
* | [media] rainshadow-cec: avoid -Wmaybe-uninitialized warningArnd Bergmann2017-05-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The barrier implied by spin_unlock() in rain_irq_work_handler makes it hard for gcc to figure out the state of the variables, leading to a false-positive warning: drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_irq_work_handler': drivers/media/usb/rainshadow-cec/rainshadow-cec.c:171:31: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized] Slightly rearranging the code makes it easier for the compiler to see that the code is correct, and gets rid of the warning. Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver") 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] rainshadow-cec: use strlcat instead of strncatArnd Bergmann2017-05-181-1/+1
|/ | | | | | | | | | | | | | | | gcc warns about an obviously incorrect use of strncat(): drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_cec_adap_transmit': drivers/media/usb/rainshadow-cec/rainshadow-cec.c:299:4: error: specified bound 48 equals the size of the destination [-Werror=stringop-overflow=] It seems that strlcat was intended here, and using that makes the code correct. Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver") 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] rainshadow-cec: new RainShadow Tech HDMI CEC driverHans Verkuil2017-04-101-0/+388
This driver supports the RainShadow Tech USB HDMI CEC adapter. See: http://rainshadowtech.com/HdmiCecUsb.html Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>