[media] staging: lirc: clean error handling in probe()

We have reorganized the error handling into a simpler and more canonical
format.
Additionally we removed extra empty lines, switched to devm_kzalloc(), and
substitute 'minor' by 'ret' in the igorplugusb_remote_probe() function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] ene_ir: Fix interrupt line passthrough to hardware

While we can delay IRQ intialization, we need the interrupt number
right away because unusually hardware have programable interrupt number,
and thus we give it the number that was allocated by BIOS

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] ene_ir: disable the device if wake is disabled

It doesn't hurt and on my notebook despite clearing the
wake flag the remote still wakes up the system.

This way it doesn't.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] ene_ir: don't use pr_debug after all

This way to only way to get debug info is to use dynamic debug, but I
left debugging prints to debug hardware issues, and so I want this to be
enabled by module param.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L: Drop bus_type check in v4l2-async match functions

These match_* functions are internal callbacks and are always
invoked only after checking asd->bus_type. So drop redundant
checks in match_i2c() and match_platform() functions.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*

enum v4l2_async_bus_type also selects a method subdevs are matched
in the notification handlers, rename it to v4l2_async_match_type
so V4L2_ASYNC_MATCH_OF entry can be further added for matching by
device tree node pointer.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type

Add support for matching by device_node pointer. This allows
the notifier user to simply pass a list of device_node pointers
corresponding to sub-devices.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L: Rename subdev field of struct v4l2_async_notifier

This is a purely cosmetic change. Since the 'subdev' member
points to an array of subdevs make it more explicit by
renaming to the plural form.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev

By integrating the v4l2-async API internals a bit more with
the core overall the v4l2-async code becomes a bit simpler
and easier to follow.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] DocBook: Fix typo in V4L2_CID_JPEG_COMPRESSION_QUALITY reference

Replace the erroneous V4L2_CID_JPEG_IMAGE_QUALITY control name
with V4L2_CID_JPEG_COMPRESSION_QUALITY.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] redrat3: errors on unplug

In an usb disconnect handler, the urbs have already been cancelled so the
attempt to disable the IR receiver just results in errors:
[  899.638862] redrat3 7-2:1.0: redrat3_send_cmd: Error sending rr3 cmd res -110, data 0
[  899.638870] redrat3 7-2:1.0: redrat3_disable_detector: detector status: 251, should be 0

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] rc: allowed_protos now is a bit field

This one must have missed the conversion "c003ab1b [media] rc-core:
add separate defines for protocol bitmaps and numbers".

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] lirc: validate transmission ir data

The lirc interface allows 255 u32 spaces and pulses, which are usec. If
the driver can handle this (e.g. winbond-cir) you can produce hours of
meaningless IR data and there is no method of interrupting it.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] lirc: make transmit interface consistent

All lirc drivers that can transmit, return EINVAL when they are passed
more than IR data than they can send. That is, except for two drivers
which I touched.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] cx23885: Fix TeVii S471 regression since introduction of ts2020

Patch to make TeVii S471 cards use the ts2020 tuner, since ds3000 driver no
longer contains tuning code.

Signed-off-by: Johannes Koch <johannes@ortsraum.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Merge remote-tracking branch 'r_media_tree/master' into cx24117