diff -Nru media-build-dkms-0004~trusty/create_all_ubuntu.sh media-build-dkms-0005~trusty/create_all_ubuntu.sh --- media-build-dkms-0004~trusty/create_all_ubuntu.sh 2017-09-10 22:33:33.000000000 +0000 +++ media-build-dkms-0005~trusty/create_all_ubuntu.sh 2018-06-01 18:18:56.000000000 +0000 @@ -31,4 +31,5 @@ do_prepare_Ubuntu precise do_prepare_Ubuntu trusty binary do_prepare_Ubuntu xenial +do_prepare_Ubuntu bionic diff -Nru media-build-dkms-0004~trusty/debian/changelog media-build-dkms-0005~trusty/debian/changelog --- media-build-dkms-0004~trusty/debian/changelog 2017-09-10 22:34:12.000000000 +0000 +++ media-build-dkms-0005~trusty/debian/changelog 2018-06-01 18:19:09.000000000 +0000 @@ -1,4 +1,12 @@ -media-build-dkms (0004~trusty) trusty; urgency=medium +media-build-dkms (0005~trusty) trusty; urgency=medium + + * Used upstream packages: + https://github.com/jasmin-j/media_build/tree/dkms/0005-01_Jun_2018 + https://github.com/jasmin-j/dddvb-linux-kernel/tree/dkms/0005-01_Jun_2018 + + -- Jasmin Jessich Fri, 01 Jun 2018 19:50:48 +0200 + +media-build-dkms (0005~trusty) trusty; urgency=medium * Used upstream packages: https://github.com/jasmin-j/media_build/tree/dkms/0004-10_Sep_2017 @@ -10,7 +18,7 @@ -- Jasmin Jessich Sun, 10 Sep 2017 23:30:43 +0200 -media-build-dkms (0004~trusty) trusty; urgency=medium +media-build-dkms (0005~trusty) trusty; urgency=medium * initial build Used upstream packages: diff -Nru media-build-dkms-0004~trusty/debian/prerm media-build-dkms-0005~trusty/debian/prerm --- media-build-dkms-0004~trusty/debian/prerm 2017-09-10 22:34:12.000000000 +0000 +++ media-build-dkms-0005~trusty/debian/prerm 2018-06-01 18:19:09.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh NAME=media-build -VERSION=0004 +VERSION=0005 set -e diff -Nru media-build-dkms-0004~trusty/debian/rules media-build-dkms-0005~trusty/debian/rules --- media-build-dkms-0004~trusty/debian/rules 2017-09-10 22:34:12.000000000 +0000 +++ media-build-dkms-0005~trusty/debian/rules 2018-06-01 18:19:09.000000000 +0000 @@ -6,7 +6,7 @@ DEB_NAME=media-build NAME=media-build -VERSION=0004 +VERSION=0005 configure: configure-stamp configure-stamp: diff -Nru media-build-dkms-0004~trusty/media-build-0004/00_opt_default.inc media-build-dkms-0005~trusty/media-build-0004/00_opt_default.inc --- media-build-dkms-0004~trusty/media-build-0004/00_opt_default.inc 2017-09-03 17:58:07.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/00_opt_default.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -# With VDR this gives tons of loggings -disable_opt CONFIG_DVB_DEMUX_SECTION_LOSS_LOG - -# builds fine with this drivers, but keep them for later -#disable_opt CONFIG_VIDEOBUF2_MEMOPS - -# CONFIG_FRAME_VECTOR causes troubles on some systems/distros -disable_opt CONFIG_FRAME_VECTOR - -# MSI is currently still not reliable on Digital Devices cards -disable_opt CONFIG_DVB_DDBRIDGE_MSIENABLE - -# There are systems with more high end Digital Devices cards with lots -# of tuners -set_opt_value CONFIG_DVB_MAX_ADAPTERS 64 diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/api_version.patch media-build-dkms-0005~trusty/media-build-0004/backports/api_version.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/api_version.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/api_version.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c -index 0860fb458757..60fd48214142 100644 ---- a/drivers/media/cec/cec-api.c -+++ b/drivers/media/cec/cec-api.c -@@ -93,7 +93,7 @@ static long cec_adap_g_caps(struct cec_adapter *adap, - strlcpy(caps.name, adap->name, sizeof(caps.name)); - caps.available_log_addrs = adap->available_log_addrs; - caps.capabilities = adap->capabilities; -- caps.version = LINUX_VERSION_CODE; -+ caps.version = V4L2_VERSION; - if (copy_to_user(parg, &caps, sizeof(caps))) - return -EFAULT; - return 0; -diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c -index 4f27cfa134a1..e0fb14c851d5 100644 ---- a/drivers/media/v4l2-core/v4l2-ioctl.c -+++ b/drivers/media/v4l2-core/v4l2-ioctl.c -@@ -1000,7 +1000,7 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops, - struct video_device *vfd = video_devdata(file); - int ret; - -- cap->version = LINUX_VERSION_CODE; -+ cap->version = V4L2_VERSION; - cap->device_caps = vfd->device_caps; - cap->capabilities = vfd->device_caps | V4L2_CAP_DEVICE_CAPS; - -diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c -index e79f72b8b858..77c2abad24b7 100644 ---- a/drivers/media/media-device.c -+++ b/drivers/media/media-device.c -@@ -69,7 +69,7 @@ static int media_device_get_info(struct media_device *dev, - strlcpy(info->serial, dev->serial, sizeof(info->serial)); - strlcpy(info->bus_info, dev->bus_info, sizeof(info->bus_info)); - -- info->media_version = LINUX_VERSION_CODE; -+ info->media_version = V4L2_VERSION; - info->driver_version = info->media_version; - info->hw_revision = dev->hw_revision; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/backports.txt media-build-dkms-0005~trusty/media-build-0004/backports/backports.txt --- media-build-dkms-0004~trusty/media-build-0004/backports/backports.txt 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/backports.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -################################################# -# Backport patches needed for each kernel version -################################################# -# The patches for a given kernel version is calculated -# by summing the patches needed to backport to all kernel -# versions higher or equal to the desired one. For example, -# if this file has: -# [3.255.255] -# add patch_for_upstream.patch -# [2.6.38] -# add patch_for_2.6.38.patch -# -# That means that both patch_for_2.6.38.patch and patch_for_upstream.patch -# are needed for 2.6.38. -# -# It is possible to remove one patch from the accumulated series with -# by adding a "delete foo.patch" line -# -# In order to test what patches will be applied for a given kernel version, -# use linux/patches_for_kernel.pl - -# All supported versions need those patches -[9.255.255] -add api_version.patch -add pr_fmt.patch -add debug.patch -add drx39xxj.patch - -[4.12.255] -add v4.12_revert_solo6x10_copykerneluser.patch - -[4.10.255] -add v4.10_sched_signal.patch -add v4.10_fault_page.patch -add v4.10_refcount.patch - -[4.9.255] -add v4.9_mm_address.patch -add v4.9_dvb_net_max_mtu.patch -add v4.9_ktime_cleanups.patch -add v4.9_cec_pin.patch - -[4.8.255] -add v4.8_user_pages_flag.patch - -[4.7.255] -add v4.7_dma_attrs.patch -add v4.7_pci_alloc_irq_vectors.patch - -[4.6.255] -add v4.6_i2c_mux.patch - -[4.5.255] -add v4.5_gpiochip_data_pointer.patch -add v4.5_get_user_pages.patch -add v4.5_uvc_super_plus.patch - -[4.4.255] -add v4.4_gpio_chip_parent.patch - -[4.2.255] -add v4.2_atomic64.patch -add v4.2_frame_vector.patch - -[4.1.255] -add v4.1_pat_enabled.patch -add v4.1_drop_fwnode.patch - -[4.0.255] -add v4.0_dma_buf_export.patch -add v4.0_drop_trace.patch -add v4.0_fwnode.patch - -[3.19.255] -add v3.19_get_user_pages_locked.patch - -[3.18.255] -add v3.18_drop_property_h.patch - -[3.17.255] -add v3.17_fix_clamp.patch - -[3.16.255] -add v3.16_netdev.patch -add v3.16_wait_on_bit.patch -add v3.16_void_gpiochip_remove.patch - -[3.13.255] -add v3.13_ddbridge_pcimsi.patch - -[3.12.255] -add v3.12_kfifo_in.patch - -[3.11.255] -add v3.11_dev_groups.patch - -[3.10.255] -add v3.10_fw_driver_probe.patch -add v3.10_ir_hix5hd2.patch - -[3.9.255] -add v3.9_drxj_warnings.patch - -[3.8.255] -add v3.8_config_of.patch - -[3.6.255] -add v3.6_pci_error_handlers.patch -add v3.6_i2c_add_mux_adapter.patch - -[3.4.255] -add v3.4_i2c_add_mux_adapter.patch - -[3.3.255] -add v3.3_eprobe_defer.patch - -[3.2.255] -add v3.2_devnode_uses_mode_t.patch -add v3.2_alloc_ordered_workqueue.patch - -[3.1.255] -add v3.1_no_export_h.patch -add v3.1_no_dma_buf_h.patch -add v3.1_no_pm_qos.patch - -[3.0.255] -add no_atomic_include.patch -add v4l2-compat-timespec.patch -add v3.0_ida2bit.patch - -[2.6.38] -add v2.6.38_use_getkeycode_new_setkeycode_new.patch -add v2.6.38_config_of_for_of_node.patch - -[2.6.37] -add v2.6.37_dont_use_alloc_ordered_workqueue.patch - -[2.6.36] -delete v2.6.38_use_getkeycode_new_setkeycode_new.patch -add v2.6.36_input_getkeycode.patch -add v2.6.36_dvb_usb_input_getkeycode.patch -add tda18271_debug_fix.patch -add v2.6.36_kmap_atomic.patch -add v2.6.36_fence.patch - -[2.6.35] -add v2.6.35_firedtv_handle_fcp.patch -add v2.6.35_i2c_new_probed_device.patch -add v2.6.35_work_handler.patch -add v2.6.35_kfifo.patch - -[2.6.34] -add v2.6.34_dvb_net.patch -add v2.6.34_fix_define_warnings.patch -add v2.6.34_usb_ss_ep_comp.patch - -[2.6.33] -add v2.6.33_input_handlers_are_int.patch -add v2.6.33_pvrusb2_sysfs.patch -add v2.6.33_no_gpio_request_one.patch - -[2.6.32] -add v2.6.32_dvb_net.patch -add v2.6.32_kfifo.patch -add v2.6.32_request_firmware_nowait.patch - -[2.6.31] -add v2.6.31_nodename.patch -add v2.6.31_vm_ops.patch -add v2.6.31_rc.patch diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/debug.patch media-build-dkms-0005~trusty/media-build-0004/backports/debug.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/debug.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/debug.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h -index 5936923..a6d487c 100644 ---- a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h -+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h -@@ -15,6 +15,7 @@ - #ifndef S5P_MFC_DEBUG_H_ - #define S5P_MFC_DEBUG_H_ - -+#undef DEBUG - #define DEBUG - - #ifdef DEBUG diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/drx39xxj.patch media-build-dkms-0005~trusty/media-build-0004/backports/drx39xxj.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/drx39xxj.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/drx39xxj.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c -index d4986bd..16d8565 100644 ---- a/drivers/media/usb/em28xx/em28xx-dvb.c -+++ b/drivers/media/usb/em28xx/em28xx-dvb.c -@@ -41,7 +41,7 @@ - #include "mt352.h" - #include "mt352_priv.h" /* FIXME */ - #include "tda1002x.h" --#include "drx39xyj/drx39xxj.h" -+#include "drx39xxj.h" - #include "tda18271.h" - #include "s921.h" - #include "drxd.h" diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/no_atomic_include.patch media-build-dkms-0005~trusty/media-build-0004/backports/no_atomic_include.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/no_atomic_include.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/no_atomic_include.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -diff --git a/drivers/media/pci/pt3/pt3.h b/drivers/media/pci/pt3/pt3.h -index 1b3f2ad25db3..44ba0f4c298d 100644 ---- a/drivers/media/pci/pt3/pt3.h -+++ b/drivers/media/pci/pt3/pt3.h -@@ -17,7 +17,6 @@ - #ifndef PT3_H - #define PT3_H - --#include - #include - - #include "dvb_demux.h" -diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h -index 3f8da5e8c430..291ec932e1bf 100644 ---- a/drivers/media/pci/solo6x10/solo6x10.h -+++ b/drivers/media/pci/solo6x10/solo6x10.h -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - #include - -diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c -index 271f725b17e8..e39c9717016c 100644 ---- a/drivers/media/radio/radio-si476x.c -+++ b/drivers/media/radio/radio-si476x.c -@@ -21,7 +21,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c -index 15f016ad5b89..d4030e6fdf13 100644 ---- a/drivers/media/usb/hdpvr/hdpvr-core.c -+++ b/drivers/media/usb/hdpvr/hdpvr-core.c -@@ -17,7 +17,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c -index c2ee6e39fd0c..5a24edfe64aa 100644 ---- a/drivers/media/usb/uvc/uvc_ctrl.c -+++ b/drivers/media/usb/uvc/uvc_ctrl.c -@@ -20,7 +20,6 @@ - #include - #include - #include --#include - #include - - #include "uvcvideo.h" -diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c -index 70842c5af05b..20ebfd17503a 100644 ---- a/drivers/media/usb/uvc/uvc_driver.c -+++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -11,7 +11,6 @@ - * - */ - --#include - #include - #include - #include -diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c -index aa2199775cb8..c155671702b3 100644 ---- a/drivers/media/usb/uvc/uvc_queue.c -+++ b/drivers/media/usb/uvc/uvc_queue.c -@@ -11,7 +11,6 @@ - * - */ - --#include - #include - #include - #include -diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c -index 3e7e283a44a8..17d85bfaee08 100644 ---- a/drivers/media/usb/uvc/uvc_v4l2.c -+++ b/drivers/media/usb/uvc/uvc_v4l2.c -@@ -21,7 +21,6 @@ - #include - #include - #include --#include - - #include - #include -diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c -index fb86d6af398d..3fa820f2ffae 100644 ---- a/drivers/media/usb/uvc/uvc_video.c -+++ b/drivers/media/usb/uvc/uvc_video.c -@@ -19,7 +19,6 @@ - #include - #include - #include --#include - #include - - #include -diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c -index 297e10e69898..5019e2a9fcc8 100644 ---- a/drivers/media/v4l2-core/v4l2-clk.c -+++ b/drivers/media/v4l2-core/v4l2-clk.c -@@ -8,7 +8,6 @@ - * published by the Free Software Foundation. - */ - --#include - #include - #include - #include -diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h -index d3ed44072544..573b909f1113 100644 ---- a/include/media/v4l2-clk.h -+++ b/include/media/v4l2-clk.h -@@ -14,7 +14,6 @@ - #ifndef MEDIA_V4L2_CLK_H - #define MEDIA_V4L2_CLK_H - --#include - #include - #include - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/pr_fmt.patch media-build-dkms-0005~trusty/media-build-0004/backports/pr_fmt.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/pr_fmt.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/pr_fmt.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1629 +0,0 @@ -diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c -index 9f7c5b0a6b45..03b3af5d8495 100644 ---- a/drivers/media/common/saa7146/saa7146_core.c -+++ b/drivers/media/common/saa7146/saa7146_core.c -@@ -18,6 +18,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c -index 930d2c94d5d3..97d9da79c774 100644 ---- a/drivers/media/common/saa7146/saa7146_fops.c -+++ b/drivers/media/common/saa7146/saa7146_fops.c -@@ -1,3 +1,4 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c -index 6ebcbc6450f5..a06dc4d69a37 100644 ---- a/drivers/media/common/saa7146/saa7146_hlp.c -+++ b/drivers/media/common/saa7146/saa7146_hlp.c -@@ -1,3 +1,4 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/common/saa7146/saa7146_i2c.c b/drivers/media/common/saa7146/saa7146_i2c.c -index 75897f95e4b4..6d5c3ea28e1c 100644 ---- a/drivers/media/common/saa7146/saa7146_i2c.c -+++ b/drivers/media/common/saa7146/saa7146_i2c.c -@@ -1,3 +1,4 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c -index b3b29d4f36ed..9f679334437e 100644 ---- a/drivers/media/common/saa7146/saa7146_video.c -+++ b/drivers/media/common/saa7146/saa7146_video.c -@@ -1,3 +1,4 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h -index 4cc39e4a8318..cfc102e5cc68 100644 ---- a/drivers/media/common/siano/smscoreapi.h -+++ b/drivers/media/common/siano/smscoreapi.h -@@ -22,6 +22,7 @@ along with this program. If not, see . - #ifndef __SMS_CORE_API_H__ - #define __SMS_CORE_API_H__ - -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__ - - #include -diff --git a/drivers/media/common/tveeprom.c b/drivers/media/common/tveeprom.c -index ccf2d3b12aec..f684cf3bded7 100644 ---- a/drivers/media/common/tveeprom.c -+++ b/drivers/media/common/tveeprom.c -@@ -24,6 +24,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c -index 45e91add73ba..1284c09054d4 100644 ---- a/drivers/media/dvb-core/dmxdev.c -+++ b/drivers/media/dvb-core/dmxdev.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "dmxdev: " fmt - - #include -diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c -index 95b3723282f4..a5abf8be130a 100644 ---- a/drivers/media/dvb-core/dvb_ca_en50221.c -+++ b/drivers/media/dvb-core/dvb_ca_en50221.c -@@ -25,6 +25,7 @@ - * http://www.gnu.org/copyleft/gpl.html - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "dvb_ca_en50221: " fmt - - #include -diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c -index 6628f80d184f..5419366bf6a6 100644 ---- a/drivers/media/dvb-core/dvb_demux.c -+++ b/drivers/media/dvb-core/dvb_demux.c -@@ -17,6 +17,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "dvb_demux: " fmt - - #include -diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c -index e3fff8f64d37..fc5614317ff9 100644 ---- a/drivers/media/dvb-core/dvb_frontend.c -+++ b/drivers/media/dvb-core/dvb_frontend.c -@@ -25,6 +25,7 @@ - /* Enables DVBv3 compatibility bits at the headers */ - #define __DVB_CORE__ - -+#undef pr_fmt - #define pr_fmt(fmt) "dvb_frontend: " fmt - - #include -diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c -index 06b0dcc13695..1bf636bfb763 100644 ---- a/drivers/media/dvb-core/dvb_net.c -+++ b/drivers/media/dvb-core/dvb_net.c -@@ -51,6 +51,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "dvb_net: " fmt - - #include -diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c -index 41aad0f99d73..cfd248d50283 100644 ---- a/drivers/media/dvb-core/dvbdev.c -+++ b/drivers/media/dvb-core/dvbdev.c -@@ -17,6 +17,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) "dvbdev: " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib0070.c b/drivers/media/dvb-frontends/dib0070.c -index d7614b8b8782..87ff97722e69 100644 ---- a/drivers/media/dvb-frontends/dib0070.c -+++ b/drivers/media/dvb-frontends/dib0070.c -@@ -20,6 +20,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c -index ae53a199b7af..490114540923 100644 ---- a/drivers/media/dvb-frontends/dib0090.c -+++ b/drivers/media/dvb-frontends/dib0090.c -@@ -20,6 +20,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib3000mb.c b/drivers/media/dvb-frontends/dib3000mb.c -index 068bec104e29..1ca6da9f3a88 100644 ---- a/drivers/media/dvb-frontends/dib3000mb.c -+++ b/drivers/media/dvb-frontends/dib3000mb.c -@@ -21,6 +21,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib3000mc.c b/drivers/media/dvb-frontends/dib3000mc.c -index 224283fe100a..f62dfcb19a1c 100644 ---- a/drivers/media/dvb-frontends/dib3000mc.c -+++ b/drivers/media/dvb-frontends/dib3000mc.c -@@ -11,6 +11,7 @@ - * published by the Free Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib7000m.c b/drivers/media/dvb-frontends/dib7000m.c -index 5ce9f93a65c3..b15ab787b40c 100644 ---- a/drivers/media/dvb-frontends/dib7000m.c -+++ b/drivers/media/dvb-frontends/dib7000m.c -@@ -9,6 +9,7 @@ - * published by the Free Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c -index 0fbaabe43682..44566cc0a8a1 100644 ---- a/drivers/media/dvb-frontends/dib7000p.c -+++ b/drivers/media/dvb-frontends/dib7000p.c -@@ -8,6 +8,7 @@ - * published by the Free Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c -index a179a3f6563d..ba3de71804d9 100644 ---- a/drivers/media/dvb-frontends/dib8000.c -+++ b/drivers/media/dvb-frontends/dib8000.c -@@ -8,6 +8,7 @@ - * published by the Free Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c -index 17c6f15c7e68..23539298e254 100644 ---- a/drivers/media/dvb-frontends/dib9000.c -+++ b/drivers/media/dvb-frontends/dib9000.c -@@ -8,6 +8,7 @@ - * published by the Free Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dibx000_common.c b/drivers/media/dvb-frontends/dibx000_common.c -index bc28184c7fb0..a7479559813f 100644 ---- a/drivers/media/dvb-frontends/dibx000_common.c -+++ b/drivers/media/dvb-frontends/dibx000_common.c -@@ -1,3 +1,4 @@ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c -index 499ccff557bf..c344c39a8349 100644 ---- a/drivers/media/dvb-frontends/drx39xyj/drxj.c -+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c -@@ -53,6 +53,7 @@ - INCLUDE FILES - ----------------------------------------------------------------------------*/ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ - - #include -diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c -index 48a8aad47a74..5b284a036485 100644 ---- a/drivers/media/dvb-frontends/drxk_hard.c -+++ b/drivers/media/dvb-frontends/drxk_hard.c -@@ -17,6 +17,7 @@ - * http://www.gnu.org/copyleft/gpl.html - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c -index 7bec3e028bee..e8b06b73f8c9 100644 ---- a/drivers/media/dvb-frontends/dvb-pll.c -+++ b/drivers/media/dvb-frontends/dvb-pll.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/gp8psk-fe.c b/drivers/media/dvb-frontends/gp8psk-fe.c -index efe015df7f1d..c90ee92a183b 100644 ---- a/drivers/media/dvb-frontends/gp8psk-fe.c -+++ b/drivers/media/dvb-frontends/gp8psk-fe.c -@@ -13,6 +13,7 @@ - * Software Foundation, version 2. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "gp8psk-fe.h" -diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c -index c9b1eb38444e..1964da83bfaf 100644 ---- a/drivers/media/dvb-frontends/lgdt3306a.c -+++ b/drivers/media/dvb-frontends/lgdt3306a.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c -index bf6e5cd572c5..442eafcd1e50 100644 ---- a/drivers/media/dvb-frontends/nxt200x.c -+++ b/drivers/media/dvb-frontends/nxt200x.c -@@ -33,6 +33,7 @@ - * /usr/lib/hotplug/firmware/ or /lib/firmware/ - * (depending on configuration of firmware hotplug). - */ -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - /* Max transfer size done by I2C transfer functions */ -diff --git a/drivers/media/dvb-frontends/nxt6000.c b/drivers/media/dvb-frontends/nxt6000.c -index 1ce5ea28489b..9765cb0efc4a 100644 ---- a/drivers/media/dvb-frontends/nxt6000.c -+++ b/drivers/media/dvb-frontends/nxt6000.c -@@ -19,6 +19,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/dvb-frontends/or51211.c b/drivers/media/dvb-frontends/or51211.c -index d14fa9736ae5..ce6f5fc7dafd 100644 ---- a/drivers/media/dvb-frontends/or51211.c -+++ b/drivers/media/dvb-frontends/or51211.c -@@ -18,6 +18,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ - - /* -diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c -index 423248f577b6..06bf97d61b42 100644 ---- a/drivers/media/media-devnode.c -+++ b/drivers/media/media-devnode.c -@@ -26,6 +26,7 @@ - * counting. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/btcx-risc.c b/drivers/media/pci/bt8xx/btcx-risc.c -index 70bdf93fc020..1f12fc4f32e2 100644 ---- a/drivers/media/pci/bt8xx/btcx-risc.c -+++ b/drivers/media/pci/bt8xx/btcx-risc.c -@@ -22,6 +22,7 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c -index 5cc42b426715..69318faac49b 100644 ---- a/drivers/media/pci/bt8xx/bttv-cards.c -+++ b/drivers/media/pci/bt8xx/bttv-cards.c -@@ -25,6 +25,7 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c -index 40110be4e986..b5ec5e748cc4 100644 ---- a/drivers/media/pci/bt8xx/bttv-driver.c -+++ b/drivers/media/pci/bt8xx/bttv-driver.c -@@ -34,6 +34,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c -index 25b9916906d5..654001e019b7 100644 ---- a/drivers/media/pci/bt8xx/bttv-gpio.c -+++ b/drivers/media/pci/bt8xx/bttv-gpio.c -@@ -26,6 +26,7 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c -index 274fd036b306..1c7b9542ae13 100644 ---- a/drivers/media/pci/bt8xx/bttv-i2c.c -+++ b/drivers/media/pci/bt8xx/bttv-i2c.c -@@ -27,6 +27,7 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c -index 73d655d073d6..a1b91cc8b8cb 100644 ---- a/drivers/media/pci/bt8xx/bttv-input.c -+++ b/drivers/media/pci/bt8xx/bttv-input.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-risc.c b/drivers/media/pci/bt8xx/bttv-risc.c -index 3859dde98be2..6e7b92bc28e0 100644 ---- a/drivers/media/pci/bt8xx/bttv-risc.c -+++ b/drivers/media/pci/bt8xx/bttv-risc.c -@@ -24,6 +24,7 @@ - - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/bttv-vbi.c b/drivers/media/pci/bt8xx/bttv-vbi.c -index e77129c92fa0..30c1e492c5b4 100644 ---- a/drivers/media/pci/bt8xx/bttv-vbi.c -+++ b/drivers/media/pci/bt8xx/bttv-vbi.c -@@ -23,6 +23,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/dst.c b/drivers/media/pci/bt8xx/dst.c -index 7166d2279465..110fc3a00792 100644 ---- a/drivers/media/pci/bt8xx/dst.c -+++ b/drivers/media/pci/bt8xx/dst.c -@@ -18,6 +18,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c -index ad617871ce9b..13ad2380f88a 100644 ---- a/drivers/media/pci/bt8xx/dvb-bt8xx.c -+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c -@@ -15,6 +15,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c -index 5c94e312cba3..369e277de9bc 100644 ---- a/drivers/media/pci/cx23885/altera-ci.c -+++ b/drivers/media/pci/cx23885/altera-ci.c -@@ -49,6 +49,7 @@ - * +-------+-------+-------+-------+-------+-------+-------+-------+ - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h -index cb714ab60d69..a3837b7cdd83 100644 ---- a/drivers/media/pci/cx23885/cx23885.h -+++ b/drivers/media/pci/cx23885/cx23885.h -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c -index 2b34990e86f2..8afe896edd78 100644 ---- a/drivers/media/pci/cx25821/cx25821-alsa.c -+++ b/drivers/media/pci/cx25821/cx25821-alsa.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c -index b94eb1c0023d..024bdf193594 100644 ---- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c -+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "cx25821-video.h" -diff --git a/drivers/media/pci/cx25821/cx25821-cards.c b/drivers/media/pci/cx25821/cx25821-cards.c -index f3b4d89d90c8..96beae119691 100644 ---- a/drivers/media/pci/cx25821/cx25821-cards.c -+++ b/drivers/media/pci/cx25821/cx25821-cards.c -@@ -17,6 +17,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c -index 04aa4a68a0ae..4ba96019dbbc 100644 ---- a/drivers/media/pci/cx25821/cx25821-core.c -+++ b/drivers/media/pci/cx25821/cx25821-core.c -@@ -17,6 +17,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx25821/cx25821-i2c.c b/drivers/media/pci/cx25821/cx25821-i2c.c -index 263a1cf36ef1..a7392ea69eae 100644 ---- a/drivers/media/pci/cx25821/cx25821-i2c.c -+++ b/drivers/media/pci/cx25821/cx25821-i2c.c -@@ -17,6 +17,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.c b/drivers/media/pci/cx25821/cx25821-medusa-video.c -index 0a9db050b175..ff7a29325977 100644 ---- a/drivers/media/pci/cx25821/cx25821-medusa-video.c -+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "cx25821.h" -diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c -index 6c838c8a7924..6c23d6ae5644 100644 ---- a/drivers/media/pci/cx25821/cx25821-video-upstream.c -+++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "cx25821-video.h" -diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c -index dbaf42ec26cd..8f2845672f9a 100644 ---- a/drivers/media/pci/cx25821/cx25821-video.c -+++ b/drivers/media/pci/cx25821/cx25821-video.c -@@ -20,6 +20,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "cx25821-video.h" -diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h -index 6777926f20f2..74358ade87f2 100644 ---- a/drivers/media/pci/cx88/cx88.h -+++ b/drivers/media/pci/cx88/cx88.h -@@ -17,6 +17,7 @@ - #ifndef CX88_H - #define CX88_H - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c -index ccac7fe31336..bd85e92ad349 100644 ---- a/drivers/media/pci/ddbridge/ddbridge-main.c -+++ b/drivers/media/pci/ddbridge/ddbridge-main.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h -index d27c5c2c07ea..f0aa5efecfa3 100644 ---- a/drivers/media/pci/ivtv/ivtv-driver.h -+++ b/drivers/media/pci/ivtv/ivtv-driver.h -@@ -22,6 +22,7 @@ - #ifndef IVTV_DRIVER_H - #define IVTV_DRIVER_H - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - /* Internal header for ivtv project: -diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h -index 816b5282d671..4acb66442dfa 100644 ---- a/drivers/media/pci/saa7134/saa7134.h -+++ b/drivers/media/pci/saa7134/saa7134.h -@@ -17,6 +17,7 @@ - - #define SAA7134_VERSION "0, 2, 17" - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c -index f708cab01fef..6492217a12fe 100644 ---- a/drivers/media/pci/saa7146/hexium_gemini.c -+++ b/drivers/media/pci/saa7146/hexium_gemini.c -@@ -21,6 +21,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define DEBUG_VARIABLE debug -diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c -index 01f01580c7ca..0d4e94257b62 100644 ---- a/drivers/media/pci/saa7146/hexium_orion.c -+++ b/drivers/media/pci/saa7146/hexium_orion.c -@@ -21,6 +21,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define DEBUG_VARIABLE debug -diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c -index 930218cc2de1..2452e59ed6c4 100644 ---- a/drivers/media/pci/saa7146/mxb.c -+++ b/drivers/media/pci/saa7146/mxb.c -@@ -21,6 +21,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define DEBUG_VARIABLE debug -diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c -index e4cf42c32284..540102811bb5 100644 ---- a/drivers/media/pci/ttpci/av7110_v4l.c -+++ b/drivers/media/pci/ttpci/av7110_v4l.c -@@ -22,6 +22,7 @@ - * the project's page is at https://linuxtv.org - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c -index ac83fff9fe0b..91e8c982c634 100644 ---- a/drivers/media/pci/ttpci/budget-av.c -+++ b/drivers/media/pci/ttpci/budget-av.c -@@ -30,6 +30,7 @@ - * the project's page is at https://linuxtv.org - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "budget.h" -diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c b/drivers/media/platform/exynos4-is/fimc-is-param.c -index 72b9b436c5c0..e08e90046f16 100644 ---- a/drivers/media/platform/exynos4-is/fimc-is-param.c -+++ b/drivers/media/platform/exynos4-is/fimc-is-param.c -@@ -10,6 +10,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c -index 5ddb2321e9e4..045d7af5cede 100644 ---- a/drivers/media/platform/exynos4-is/fimc-is.c -+++ b/drivers/media/platform/exynos4-is/fimc-is.c -@@ -10,6 +10,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c -index fd793d3ac072..ae6c53d251ca 100644 ---- a/drivers/media/platform/exynos4-is/fimc-isp.c -+++ b/drivers/media/platform/exynos4-is/fimc-isp.c -@@ -10,6 +10,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c -index 25c7a7d42292..3dba7dcb8e3a 100644 ---- a/drivers/media/platform/s3c-camif/camif-capture.c -+++ b/drivers/media/platform/s3c-camif/camif-capture.c -@@ -11,6 +11,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c -index c4ab63986c8f..c9d1069e7790 100644 ---- a/drivers/media/platform/s3c-camif/camif-core.c -+++ b/drivers/media/platform/s3c-camif/camif-core.c -@@ -9,6 +9,7 @@ - * by the Free Software Foundation, either version 2 of the License, - * or (at your option) any later version. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/platform/s3c-camif/camif-regs.c b/drivers/media/platform/s3c-camif/camif-regs.c -index 812fb3a7c4e3..8241eb481845 100644 ---- a/drivers/media/platform/s3c-camif/camif-regs.c -+++ b/drivers/media/platform/s3c-camif/camif-regs.c -@@ -8,6 +8,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#undef pr_fmt - #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ - - #include -diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c -index af7ba23e16e1..cce034d8471c 100644 ---- a/drivers/media/rc/ene_ir.c -+++ b/drivers/media/rc/ene_ir.c -@@ -25,6 +25,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c -index f2639d0c2fca..1040fa1794f5 100644 ---- a/drivers/media/rc/fintek-cir.c -+++ b/drivers/media/rc/fintek-cir.c -@@ -18,6 +18,7 @@ - * General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c -index 7b3f31cc63d2..6a4d0f7c3267 100644 ---- a/drivers/media/rc/imon.c -+++ b/drivers/media/rc/imon.c -@@ -22,6 +22,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ - - #include -diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c -index db1e7b70c998..d7979b987d1a 100644 ---- a/drivers/media/rc/lirc_dev.c -+++ b/drivers/media/rc/lirc_dev.c -@@ -15,6 +15,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c -index 5e1d866a61a5..418d57a28a7e 100644 ---- a/drivers/media/rc/nuvoton-cir.c -+++ b/drivers/media/rc/nuvoton-cir.c -@@ -20,6 +20,7 @@ - * General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index 981cccd6b988..1bf4c19e3f79 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -12,6 +12,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c -index 4b8d5f38baf6..efbbba848249 100644 ---- a/drivers/media/rc/serial_ir.c -+++ b/drivers/media/rc/serial_ir.c -@@ -21,6 +21,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c -index bc906fb128d5..9769bf7b4172 100644 ---- a/drivers/media/rc/sir_ir.c -+++ b/drivers/media/rc/sir_ir.c -@@ -10,6 +10,7 @@ - * (at your option) any later version. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c -index 3ca7ab48293d..6d36633e80a0 100644 ---- a/drivers/media/rc/winbond-cir.c -+++ b/drivers/media/rc/winbond-cir.c -@@ -36,6 +36,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/tuners/tda18271-priv.h b/drivers/media/tuners/tda18271-priv.h -index 0bcc735a0427..b9f0963febf1 100644 ---- a/drivers/media/tuners/tda18271-priv.h -+++ b/drivers/media/tuners/tda18271-priv.h -@@ -21,6 +21,7 @@ - #ifndef __TDA18271_PRIV_H__ - #define __TDA18271_PRIV_H__ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c -index 525b7ab90c80..07a17d0053b5 100644 ---- a/drivers/media/tuners/tea5767.c -+++ b/drivers/media/tuners/tea5767.c -@@ -10,6 +10,7 @@ - * from their contributions on DScaler. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h -index 05e445fe0b77..d6e99f714455 100644 ---- a/drivers/media/usb/au0828/au0828.h -+++ b/drivers/media/usb/au0828/au0828.h -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c -index ed9bcaf08d5e..91a9d4674db2 100644 ---- a/drivers/media/usb/go7007/go7007-usb.c -+++ b/drivers/media/usb/go7007/go7007-usb.c -@@ -11,6 +11,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/gspca/benq.c b/drivers/media/usb/gspca/benq.c -index 60a728203b3b..e52b6b6358cb 100644 ---- a/drivers/media/usb/gspca/benq.c -+++ b/drivers/media/usb/gspca/benq.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "benq" -diff --git a/drivers/media/usb/gspca/conex.c b/drivers/media/usb/gspca/conex.c -index bdcdf7999c56..d90d559bedde 100644 ---- a/drivers/media/usb/gspca/conex.c -+++ b/drivers/media/usb/gspca/conex.c -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "conex" -diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c -index e91d00762e94..584497ce12ef 100644 ---- a/drivers/media/usb/gspca/cpia1.c -+++ b/drivers/media/usb/gspca/cpia1.c -@@ -22,6 +22,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "cpia1" -diff --git a/drivers/media/usb/gspca/dtcs033.c b/drivers/media/usb/gspca/dtcs033.c -index 96bfd4e0f0eb..eac0337d4190 100644 ---- a/drivers/media/usb/gspca/dtcs033.c -+++ b/drivers/media/usb/gspca/dtcs033.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #define MODULE_NAME "dtcs033" - #include "gspca.h" -diff --git a/drivers/media/usb/gspca/etoms.c b/drivers/media/usb/gspca/etoms.c -index 8f84292936e9..d9d3a6336538 100644 ---- a/drivers/media/usb/gspca/etoms.c -+++ b/drivers/media/usb/gspca/etoms.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "etoms" -diff --git a/drivers/media/usb/gspca/finepix.c b/drivers/media/usb/gspca/finepix.c -index 7bb469aa61a7..56a2a23c60ad 100644 ---- a/drivers/media/usb/gspca/finepix.c -+++ b/drivers/media/usb/gspca/finepix.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "finepix" -diff --git a/drivers/media/usb/gspca/gl860/gl860.c b/drivers/media/usb/gspca/gl860/gl860.c -index cea8d7f51c3c..760d4a6a8bb2 100644 ---- a/drivers/media/usb/gspca/gl860/gl860.c -+++ b/drivers/media/usb/gspca/gl860/gl860.c -@@ -19,6 +19,7 @@ - * along with this program. If not, see . - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "gspca.h" -diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c -index 0f141762abf1..c84971cc45d7 100644 ---- a/drivers/media/usb/gspca/gspca.c -+++ b/drivers/media/usb/gspca/gspca.c -@@ -17,6 +17,7 @@ - * for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define GSPCA_VERSION "2.14.0" -diff --git a/drivers/media/usb/gspca/jeilinj.c b/drivers/media/usb/gspca/jeilinj.c -index 34e043b7d1bc..b257917b70d2 100644 ---- a/drivers/media/usb/gspca/jeilinj.c -+++ b/drivers/media/usb/gspca/jeilinj.c -@@ -20,6 +20,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "jeilinj" -diff --git a/drivers/media/usb/gspca/kinect.c b/drivers/media/usb/gspca/kinect.c -index 2f28b38c5479..1a020dfc9083 100644 ---- a/drivers/media/usb/gspca/kinect.c -+++ b/drivers/media/usb/gspca/kinect.c -@@ -20,6 +20,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "kinect" -diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c -index 31b2117e8f1d..4e2cfd622201 100644 ---- a/drivers/media/usb/gspca/konica.c -+++ b/drivers/media/usb/gspca/konica.c -@@ -24,6 +24,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "konica" -diff --git a/drivers/media/usb/gspca/m5602/m5602_core.c b/drivers/media/usb/gspca/m5602/m5602_core.c -index f1dcd9021983..eed2e6bb927b 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_core.c -+++ b/drivers/media/usb/gspca/m5602/m5602_core.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_ov9650.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c -index 7d01ddd7ed01..2ad8340f70fa 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c -+++ b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_mt9m111.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_ov7660.c b/drivers/media/usb/gspca/m5602/m5602_ov7660.c -index 672b7a520695..32a6d9cf773c 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_ov7660.c -+++ b/drivers/media/usb/gspca/m5602/m5602_ov7660.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_ov7660.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_ov9650.c b/drivers/media/usb/gspca/m5602/m5602_ov9650.c -index 4544d3a1ad58..9b7fce366211 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_ov9650.c -+++ b/drivers/media/usb/gspca/m5602/m5602_ov9650.c -@@ -17,6 +17,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_ov9650.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_po1030.c b/drivers/media/usb/gspca/m5602/m5602_po1030.c -index a0a90dd34ca8..ce1d619c4edb 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_po1030.c -+++ b/drivers/media/usb/gspca/m5602/m5602_po1030.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_po1030.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c b/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c -index 8447b9c5f8e0..b7afa503a277 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c -+++ b/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "m5602_s5k4aa.h" -diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c -index 6ad8d4849680..743eaf04cec8 100644 ---- a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c -+++ b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c -@@ -16,6 +16,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/gspca/mars.c b/drivers/media/usb/gspca/mars.c -index 25df55e840c7..f6c162da658b 100644 ---- a/drivers/media/usb/gspca/mars.c -+++ b/drivers/media/usb/gspca/mars.c -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "mars" -diff --git a/drivers/media/usb/gspca/mr97310a.c b/drivers/media/usb/gspca/mr97310a.c -index 8b0e32a649ac..72b0b04944b3 100644 ---- a/drivers/media/usb/gspca/mr97310a.c -+++ b/drivers/media/usb/gspca/mr97310a.c -@@ -36,6 +36,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "mr97310a" -diff --git a/drivers/media/usb/gspca/nw80x.c b/drivers/media/usb/gspca/nw80x.c -index 5d2d0bcb038d..82a4a0850991 100644 ---- a/drivers/media/usb/gspca/nw80x.c -+++ b/drivers/media/usb/gspca/nw80x.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "nw80x" -diff --git a/drivers/media/usb/gspca/ov519.c b/drivers/media/usb/gspca/ov519.c -index cdb79c5f0c38..cafff1265b9a 100644 ---- a/drivers/media/usb/gspca/ov519.c -+++ b/drivers/media/usb/gspca/ov519.c -@@ -33,6 +33,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "ov519" -diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c -index 32849ff86b09..bb17c5619746 100644 ---- a/drivers/media/usb/gspca/ov534.c -+++ b/drivers/media/usb/gspca/ov534.c -@@ -26,6 +26,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "ov534" -diff --git a/drivers/media/usb/gspca/ov534_9.c b/drivers/media/usb/gspca/ov534_9.c -index b2a92e518118..7e9b2b8262db 100644 ---- a/drivers/media/usb/gspca/ov534_9.c -+++ b/drivers/media/usb/gspca/ov534_9.c -@@ -20,6 +20,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "ov534_9" -diff --git a/drivers/media/usb/gspca/pac207.c b/drivers/media/usb/gspca/pac207.c -index 01c185d367e5..ab1bbbf8eb43 100644 ---- a/drivers/media/usb/gspca/pac207.c -+++ b/drivers/media/usb/gspca/pac207.c -@@ -19,6 +19,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "pac207" -diff --git a/drivers/media/usb/gspca/pac7302.c b/drivers/media/usb/gspca/pac7302.c -index 595535e143e6..0687934e9b05 100644 ---- a/drivers/media/usb/gspca/pac7302.c -+++ b/drivers/media/usb/gspca/pac7302.c -@@ -86,6 +86,7 @@ - * 3 | 0x21 | sethvflip() - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/gspca/pac7311.c b/drivers/media/usb/gspca/pac7311.c -index 8bac2d9326bf..1e6f28fb11cd 100644 ---- a/drivers/media/usb/gspca/pac7311.c -+++ b/drivers/media/usb/gspca/pac7311.c -@@ -53,6 +53,7 @@ - * for max gain, 0x14 for minimal gain. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "pac7311" -diff --git a/drivers/media/usb/gspca/se401.c b/drivers/media/usb/gspca/se401.c -index 477da0664b7d..fb7cc415c37b 100644 ---- a/drivers/media/usb/gspca/se401.c -+++ b/drivers/media/usb/gspca/se401.c -@@ -19,6 +19,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "se401" -diff --git a/drivers/media/usb/gspca/sn9c2028.c b/drivers/media/usb/gspca/sn9c2028.c -index 5d32dd359d84..2efc288276cc 100644 ---- a/drivers/media/usb/gspca/sn9c2028.c -+++ b/drivers/media/usb/gspca/sn9c2028.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sn9c2028" -diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c -index c605f78d6186..854082c0d103 100644 ---- a/drivers/media/usb/gspca/sn9c20x.c -+++ b/drivers/media/usb/gspca/sn9c20x.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/gspca/sonixj.c b/drivers/media/usb/gspca/sonixj.c -index 5eeaf16ac5e8..d2cdcb8a6be3 100644 ---- a/drivers/media/usb/gspca/sonixj.c -+++ b/drivers/media/usb/gspca/sonixj.c -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sonixj" -diff --git a/drivers/media/usb/gspca/spca1528.c b/drivers/media/usb/gspca/spca1528.c -index 327ec901abe1..d97bad1c9fc1 100644 ---- a/drivers/media/usb/gspca/spca1528.c -+++ b/drivers/media/usb/gspca/spca1528.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca1528" -diff --git a/drivers/media/usb/gspca/spca500.c b/drivers/media/usb/gspca/spca500.c -index da2d9027914c..6d20b4ffcefc 100644 ---- a/drivers/media/usb/gspca/spca500.c -+++ b/drivers/media/usb/gspca/spca500.c -@@ -15,6 +15,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca500" -diff --git a/drivers/media/usb/gspca/spca501.c b/drivers/media/usb/gspca/spca501.c -index ae5a80987553..fee8f5996303 100644 ---- a/drivers/media/usb/gspca/spca501.c -+++ b/drivers/media/usb/gspca/spca501.c -@@ -15,6 +15,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca501" -diff --git a/drivers/media/usb/gspca/spca505.c b/drivers/media/usb/gspca/spca505.c -index 1553cc766c04..42a867b999c7 100644 ---- a/drivers/media/usb/gspca/spca505.c -+++ b/drivers/media/usb/gspca/spca505.c -@@ -15,6 +15,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca505" -diff --git a/drivers/media/usb/gspca/spca508.c b/drivers/media/usb/gspca/spca508.c -index 1e0ba6b24e21..99505bc535f4 100644 ---- a/drivers/media/usb/gspca/spca508.c -+++ b/drivers/media/usb/gspca/spca508.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca508" -diff --git a/drivers/media/usb/gspca/spca561.c b/drivers/media/usb/gspca/spca561.c -index 4ff704cf9ed6..aceb8ed63eb4 100644 ---- a/drivers/media/usb/gspca/spca561.c -+++ b/drivers/media/usb/gspca/spca561.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "spca561" -diff --git a/drivers/media/usb/gspca/sq905.c b/drivers/media/usb/gspca/sq905.c -index f1da34a10ce8..28193e810836 100644 ---- a/drivers/media/usb/gspca/sq905.c -+++ b/drivers/media/usb/gspca/sq905.c -@@ -29,6 +29,7 @@ - * drivers. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sq905" -diff --git a/drivers/media/usb/gspca/sq905c.c b/drivers/media/usb/gspca/sq905c.c -index 8b4e4948a0cb..49c7ebb3094e 100644 ---- a/drivers/media/usb/gspca/sq905c.c -+++ b/drivers/media/usb/gspca/sq905c.c -@@ -23,6 +23,7 @@ - * and may contain code fragments from it. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sq905c" -diff --git a/drivers/media/usb/gspca/sq930x.c b/drivers/media/usb/gspca/sq930x.c -index aa9a9411b801..d83fdf12ee37 100644 ---- a/drivers/media/usb/gspca/sq930x.c -+++ b/drivers/media/usb/gspca/sq930x.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sq930x" -diff --git a/drivers/media/usb/gspca/stk014.c b/drivers/media/usb/gspca/stk014.c -index daf45db6c404..b3ff51f121c4 100644 ---- a/drivers/media/usb/gspca/stk014.c -+++ b/drivers/media/usb/gspca/stk014.c -@@ -14,6 +14,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "stk014" -diff --git a/drivers/media/usb/gspca/stk1135.c b/drivers/media/usb/gspca/stk1135.c -index 3ab5ec2ca4bd..783d1c2af637 100644 ---- a/drivers/media/usb/gspca/stk1135.c -+++ b/drivers/media/usb/gspca/stk1135.c -@@ -17,6 +17,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "stk1135" -diff --git a/drivers/media/usb/gspca/stv0680.c b/drivers/media/usb/gspca/stv0680.c -index 29a65d05cbb2..c56f444ca163 100644 ---- a/drivers/media/usb/gspca/stv0680.c -+++ b/drivers/media/usb/gspca/stv0680.c -@@ -23,6 +23,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "stv0680" -diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx.c b/drivers/media/usb/gspca/stv06xx/stv06xx.c -index e72c3e1ab9ff..13b1d8eaa989 100644 ---- a/drivers/media/usb/gspca/stv06xx/stv06xx.c -+++ b/drivers/media/usb/gspca/stv06xx/stv06xx.c -@@ -23,6 +23,7 @@ - * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c -index 28252f6c4afd..a8206b2a940b 100644 ---- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c -+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c -@@ -24,6 +24,7 @@ - * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "stv06xx_hdcs.h" -diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c -index e1ce96e9405f..cde42c2b3078 100644 ---- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c -+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c -@@ -40,6 +40,7 @@ - * PB_CFILLIN = R5 = 0x0E (14 dec) : Sets the frame rate - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "stv06xx_pb0100.h" -diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c -index 4b76070515b5..e859b2123b42 100644 ---- a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c -+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c -@@ -22,6 +22,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "stv06xx_st6422.h" -diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c -index d265e6b00994..fa0fe5f296b5 100644 ---- a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c -+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c -@@ -23,6 +23,7 @@ - * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "stv06xx_vv6410.h" -diff --git a/drivers/media/usb/gspca/sunplus.c b/drivers/media/usb/gspca/sunplus.c -index 8c2785aea3cd..68b4b6084e7a 100644 ---- a/drivers/media/usb/gspca/sunplus.c -+++ b/drivers/media/usb/gspca/sunplus.c -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "sunplus" -diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c -index 46fb76349000..39116d84f9b1 100644 ---- a/drivers/media/usb/gspca/t613.c -+++ b/drivers/media/usb/gspca/t613.c -@@ -22,6 +22,7 @@ - * Costantino Leandro - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "t613" -diff --git a/drivers/media/usb/gspca/topro.c b/drivers/media/usb/gspca/topro.c -index 983fc6b500af..9030ed76150d 100644 ---- a/drivers/media/usb/gspca/topro.c -+++ b/drivers/media/usb/gspca/topro.c -@@ -19,6 +19,7 @@ - * along with this program; If not, see . - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "gspca.h" -diff --git a/drivers/media/usb/gspca/vc032x.c b/drivers/media/usb/gspca/vc032x.c -index b935febf7146..6258b26d5643 100644 ---- a/drivers/media/usb/gspca/vc032x.c -+++ b/drivers/media/usb/gspca/vc032x.c -@@ -16,6 +16,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "vc032x" -diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c -index 554b90ef2200..3f8c48c585ce 100644 ---- a/drivers/media/usb/gspca/vicam.c -+++ b/drivers/media/usb/gspca/vicam.c -@@ -22,6 +22,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "vicam" -diff --git a/drivers/media/usb/gspca/w996Xcf.c b/drivers/media/usb/gspca/w996Xcf.c -index 728d2322c433..0ae8017f5558 100644 ---- a/drivers/media/usb/gspca/w996Xcf.c -+++ b/drivers/media/usb/gspca/w996Xcf.c -@@ -27,6 +27,7 @@ - the sensor drivers to v4l2 sub drivers, and properly split of this - driver from ov519.c */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define W9968CF_I2C_BUS_DELAY 4 /* delay in us for I2C bit r/w operations */ -diff --git a/drivers/media/usb/gspca/xirlink_cit.c b/drivers/media/usb/gspca/xirlink_cit.c -index 68656e7986c7..bb3870c69805 100644 ---- a/drivers/media/usb/gspca/xirlink_cit.c -+++ b/drivers/media/usb/gspca/xirlink_cit.c -@@ -23,6 +23,7 @@ - * - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #define MODULE_NAME "xirlink-cit" -diff --git a/drivers/media/usb/gspca/zc3xx.c b/drivers/media/usb/gspca/zc3xx.c -index e2d486bd8c28..1a1e7a609ed5 100644 ---- a/drivers/media/usb/gspca/zc3xx.c -+++ b/drivers/media/usb/gspca/zc3xx.c -@@ -15,6 +15,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include -diff --git a/drivers/media/usb/stkwebcam/stk-sensor.c b/drivers/media/usb/stkwebcam/stk-sensor.c -index c1d4505f84ea..b3ad8561410b 100644 ---- a/drivers/media/usb/stkwebcam/stk-sensor.c -+++ b/drivers/media/usb/stkwebcam/stk-sensor.c -@@ -41,6 +41,7 @@ - - /* It seems the i2c bus is controlled with these registers */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include "stk-webcam.h" -diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c -index 39abb58c65dd..2b147db306e6 100644 ---- a/drivers/media/usb/stkwebcam/stk-webcam.c -+++ b/drivers/media/usb/stkwebcam/stk-webcam.c -@@ -18,6 +18,7 @@ - * GNU General Public License for more details. - */ - -+#undef pr_fmt - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/tda18271_debug_fix.patch media-build-dkms-0005~trusty/media-build-0004/backports/tda18271_debug_fix.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/tda18271_debug_fix.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/tda18271_debug_fix.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c -index 86e5e31..9f7a0eb 100644 ---- a/drivers/media/tuners/tda18271-common.c -+++ b/drivers/media/tuners/tda18271-common.c -@@ -713,26 +713,3 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq) - fail: - return ret; - } -- --void _tda_printk(struct tda18271_priv *state, const char *level, -- const char *func, const char *fmt, ...) --{ -- struct va_format vaf; -- va_list args; -- -- va_start(args, fmt); -- -- vaf.fmt = fmt; -- vaf.va = &args; -- -- if (state) -- printk("%s%s: [%d-%04x|%c] %pV", -- level, func, i2c_adapter_id(state->i2c_props.adap), -- state->i2c_props.addr, -- (state->role == TDA18271_MASTER) ? 'M' : 'S', -- &vaf); -- else -- printk("%s%s: %pV", level, func, &vaf); -- -- va_end(args); --} -diff --git a/drivers/media/tuners/tda18271-priv.h b/drivers/media/tuners/tda18271-priv.h -index b36a7b7..3bc5b1c 100644 ---- a/drivers/media/tuners/tda18271-priv.h -+++ b/drivers/media/tuners/tda18271-priv.h -@@ -138,12 +138,17 @@ extern int tda18271_debug; - #define DBG_ADV 8 - #define DBG_CAL 16 - --__attribute__((format(printf, 4, 5))) --void _tda_printk(struct tda18271_priv *state, const char *level, -- const char *func, const char *fmt, ...); -- --#define tda_printk(st, lvl, fmt, arg...) \ -- _tda_printk(st, lvl, __func__, fmt, ##arg) -+#define tda_printk(st, kern, fmt, arg...) do {\ -+ if (st) { \ -+ struct tda18271_priv *state = st; \ -+ printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \ -+ i2c_adapter_id(state->i2c_props.adap), \ -+ state->i2c_props.addr, \ -+ (state->role == TDA18271_MASTER) \ -+ ? "M" : "S", ##arg); \ -+ } else \ -+ printk(kern "%s: " fmt, __func__, ##arg); \ -+} while (0) - - #define tda_dprintk(st, lvl, fmt, arg...) \ - do { \ diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_nodename.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_nodename.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_nodename.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_nodename.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c -index 401ef64..3683ae0 100644 ---- a/drivers/media/dvb-core/dvbdev.c -+++ b/drivers/media/dvb-core/dvbdev.c -@@ -449,7 +449,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) - return 0; - } - --static char *dvb_devnode(struct device *dev, mode_t *mode) -+static char *dvb_nodename(struct device *dev) - { - struct dvb_device *dvbdev = dev_get_drvdata(dev); - -@@ -480,7 +480,7 @@ static int __init init_dvbdev(void) - goto error; - } - dvb_class->dev_uevent = dvb_uevent; -- dvb_class->devnode = dvb_devnode; -+ dvb_class->nodename = dvb_nodename; - return 0; - - error: -diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c -index 36e3452..2565057 100644 ---- a/drivers/media/pci/ddbridge/ddbridge-core.c -+++ b/drivers/media/pci/ddbridge/ddbridge-core.c -@@ -1479,7 +1479,7 @@ static const struct file_operations ddb_fops = { - .open = ddb_open, - }; - --static char *ddb_devnode(struct device *device, mode_t *mode) -+static char *ddb_devnode(struct device *device) - { - struct ddb *dev = dev_get_drvdata(device); - -@@ -1499,7 +1499,7 @@ static int ddb_class_create(void) - unregister_chrdev(ddb_major, DDB_NAME); - return PTR_ERR(ddb_class); - } -- ddb_class->devnode = ddb_devnode; -+ ddb_class->nodename = ddb_devnode; - return 0; - } - -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index f304792..c276faa 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -715,14 +715,14 @@ static void ir_close(struct input_dev *idev) - } - - /* class for /sys/class/rc */ --static char *rc_devnode(struct device *dev, mode_t *mode) -+static char *rc_devnode(struct device *dev) - { - return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); - } - - static struct class rc_class = { - .name = "rc", -- .devnode = rc_devnode, -+ .nodename = rc_devnode, - }; - - /* diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_rc.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_rc.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_rc.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_rc.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index 970b93d..dea22d2 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -1312,7 +1312,7 @@ int rc_register_device(struct rc_dev *dev) - return -ENOMEM; - } while (test_and_set_bit(devno, ir_core_dev_number)); - -- dev->dev.groups = dev->sysfs_groups; -+ dev->dev.groups = (struct attribute_group **)dev->sysfs_groups; - dev->sysfs_groups[attr++] = &rc_dev_protocol_attr_grp; - if (dev->s_filter) - dev->sysfs_groups[attr++] = &rc_dev_filter_attr_grp; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_vm_ops.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_vm_ops.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.31_vm_ops.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.31_vm_ops.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c -index 301084b..1776383 100644 ---- a/drivers/media/i2c/as3645a.c -+++ b/drivers/media/i2c/as3645a.c -@@ -863,7 +863,7 @@ static const struct i2c_device_id as3645a_id_table[] = { - }; - MODULE_DEVICE_TABLE(i2c, as3645a_id_table); - --static const struct dev_pm_ops as3645a_pm_ops = { -+static struct dev_pm_ops as3645a_pm_ops = { - .suspend = as3645a_suspend, - .resume = as3645a_resume, - }; -diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c -index 8190fec..9ed1198c 100644 ---- a/drivers/media/i2c/msp3400-driver.c -+++ b/drivers/media/i2c/msp3400-driver.c -@@ -882,7 +882,7 @@ static int msp_remove(struct i2c_client *client) - - /* ----------------------------------------------------------------------- */ - --static const struct dev_pm_ops msp3400_pm_ops = { -+static struct dev_pm_ops msp3400_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(msp_suspend, msp_resume) - }; - -diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c -index 2381b05..09b4a49 100644 ---- a/drivers/media/pci/meye/meye.c -+++ b/drivers/media/pci/meye/meye.c -@@ -1461,7 +1461,7 @@ static void meye_vm_close(struct vm_area_struct *vma) - meye.vma_use_count[idx]--; - } - --static const struct vm_operations_struct meye_vm_ops = { -+static struct vm_operations_struct meye_vm_ops = { - .open = meye_vm_open, - .close = meye_vm_close, - }; -diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c -index e7e9840..1a3ee0f 100644 ---- a/drivers/media/pci/zoran/zoran_driver.c -+++ b/drivers/media/pci/zoran/zoran_driver.c -@@ -2838,7 +2838,7 @@ zoran_vm_close (struct vm_area_struct *vma) - mutex_unlock(&zr->resource_lock); - } - --static const struct vm_operations_struct zoran_vm_ops = { -+static struct vm_operations_struct zoran_vm_ops = { - .open = zoran_vm_open, - .close = zoran_vm_close, - }; -diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c -index b7ae872..30a450e 100644 ---- a/drivers/media/usb/gspca/gspca.c -+++ b/drivers/media/usb/gspca/gspca.c -@@ -107,7 +107,7 @@ static void gspca_vm_close(struct vm_area_struct *vma) - frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_MAPPED; - } - --static const struct vm_operations_struct gspca_vm_ops = { -+static struct vm_operations_struct gspca_vm_ops = { - .open = gspca_vm_open, - .close = gspca_vm_close, - }; -diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c -index c43c8d3..6d14f20 100644 ---- a/drivers/media/usb/stkwebcam/stk-webcam.c -+++ b/drivers/media/usb/stkwebcam/stk-webcam.c -@@ -747,7 +747,7 @@ static void stk_v4l_vm_close(struct vm_area_struct *vma) - if (sbuf->mapcount == 0) - sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_MAPPED; - } --static const struct vm_operations_struct stk_v4l_vm_ops = { -+static struct vm_operations_struct stk_v4l_vm_ops = { - .open = stk_v4l_vm_open, - .close = stk_v4l_vm_close - }; -diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c -index ddc9379..f4ef7f5 100644 ---- a/drivers/media/v4l2-core/tuner-core.c -+++ b/drivers/media/v4l2-core/tuner-core.c -@@ -1324,7 +1324,7 @@ static const struct v4l2_subdev_ops tuner_ops = { - * I2C structs and module init functions - */ - --static const struct dev_pm_ops tuner_pm_ops = { -+static struct dev_pm_ops tuner_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(tuner_suspend, tuner_resume) - }; - -diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c -index 65411ad..7365adc 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-contig.c -+++ b/drivers/media/v4l2-core/videobuf-dma-contig.c -@@ -132,7 +132,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) - videobuf_queue_unlock(q); - } - --static const struct vm_operations_struct videobuf_vm_ops = { -+static struct vm_operations_struct videobuf_vm_ops = { - .open = videobuf_vm_open, - .close = videobuf_vm_close, - }; -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index 9db674c..7cc4d4b 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -405,7 +405,7 @@ static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) - return 0; - } - --static const struct vm_operations_struct videobuf_vm_ops = { -+static struct vm_operations_struct videobuf_vm_ops = { - .open = videobuf_vm_open, - .close = videobuf_vm_close, - .fault = videobuf_vm_fault, -diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c -index 1365c65..dfc24343 100644 ---- a/drivers/media/v4l2-core/videobuf-vmalloc.c -+++ b/drivers/media/v4l2-core/videobuf-vmalloc.c -@@ -122,7 +122,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) - return; - } - --static const struct vm_operations_struct videobuf_vm_ops = { -+static struct vm_operations_struct videobuf_vm_ops = { - .open = videobuf_vm_open, - .close = videobuf_vm_close, - }; -diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c -index 81c1ad8..4912aa1 100644 ---- a/drivers/media/v4l2-core/videobuf2-memops.c -+++ b/drivers/media/v4l2-core/videobuf2-memops.c -@@ -176,7 +176,7 @@ static void vb2_common_vm_close(struct vm_area_struct *vma) - * vb2_common_vm_ops - common vm_ops used for tracking refcount of mmaped - * video buffers - */ --const struct vm_operations_struct vb2_common_vm_ops = { -+struct vm_operations_struct vb2_common_vm_ops = { - .open = vb2_common_vm_open, - .close = vb2_common_vm_close, - }; -diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h -index f05444c..c395259 100644 ---- a/include/media/videobuf2-memops.h -+++ b/include/media/videobuf2-memops.h -@@ -28,7 +28,7 @@ struct vb2_vmarea_handler { - void *arg; - }; - --extern const struct vm_operations_struct vb2_common_vm_ops; -+extern struct vm_operations_struct vb2_common_vm_ops; - - int vb2_get_contig_userptr(unsigned long vaddr, unsigned long size, - struct vm_area_struct **res_vma, dma_addr_t *res_pa); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_dvb_net.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_dvb_net.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_dvb_net.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_dvb_net.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c -index f91c80c..d487c15 100644 ---- a/drivers/media/dvb-core/dvb_net.c -+++ b/drivers/media/dvb-core/dvb_net.c -@@ -653,7 +653,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) - dev_kfree_skb(priv->ule_skb); - } else { - /* CRC32 verified OK. */ -- u8 dest_addr[ETH_ALEN]; -+ u8 dest_addr[ETH_ALEN] = { 0 }; - static const u8 bc_addr[ETH_ALEN] = - { [ 0 ... ETH_ALEN-1] = 0xff }; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_kfifo.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_kfifo.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_kfifo.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_kfifo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,565 +0,0 @@ -diff --git a/drivers/media/i2c/cx25840/cx25840-ir.c b/drivers/media/i2c/cx25840/cx25840-ir.c -index 4cf8f18..facb846 100644 ---- a/drivers/media/i2c/cx25840/cx25840-ir.c -+++ b/drivers/media/i2c/cx25840/cx25840-ir.c -@@ -117,7 +117,7 @@ struct cx25840_ir_state { - atomic_t rxclk_divider; - atomic_t rx_invert; - -- struct kfifo rx_kfifo; -+ struct kfifo *rx_kfifo; - spinlock_t rx_kfifo_lock; /* protect Rx data kfifo */ - - struct v4l2_subdev_ir_parameters tx_params; -@@ -524,7 +524,6 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) - struct cx25840_state *state = to_state(sd); - struct cx25840_ir_state *ir_state = to_ir_state(sd); - struct i2c_client *c = NULL; -- unsigned long flags; - - union cx25840_ir_fifo_rec rx_data[FIFO_RX_DEPTH]; - unsigned int i, j, k; -@@ -610,9 +609,8 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) - if (i == 0) - break; - j = i * sizeof(union cx25840_ir_fifo_rec); -- k = kfifo_in_locked(&ir_state->rx_kfifo, -- (unsigned char *) rx_data, j, -- &ir_state->rx_kfifo_lock); -+ k = kfifo_put(ir_state->rx_kfifo, -+ (unsigned char *) rx_data, j); - if (k != j) - kror++; /* rx_kfifo over run */ - } -@@ -648,10 +646,8 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) - cx25840_write4(c, CX25840_IR_CNTRL_REG, cntrl); - *handled = true; - } -- spin_lock_irqsave(&ir_state->rx_kfifo_lock, flags); -- if (kfifo_len(&ir_state->rx_kfifo) >= CX25840_IR_RX_KFIFO_SIZE / 2) -+ if (kfifo_len(ir_state->rx_kfifo) >= CX25840_IR_RX_KFIFO_SIZE / 2) - events |= V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ; -- spin_unlock_irqrestore(&ir_state->rx_kfifo_lock, flags); - - if (events) - v4l2_subdev_notify(sd, V4L2_SUBDEV_IR_RX_NOTIFY, &events); -@@ -682,8 +678,7 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, - return 0; - } - -- n = kfifo_out_locked(&ir_state->rx_kfifo, buf, n, -- &ir_state->rx_kfifo_lock); -+ n = kfifo_get(ir_state->rx_kfifo, buf, n); - - n /= sizeof(union cx25840_ir_fifo_rec); - *num = n * sizeof(union cx25840_ir_fifo_rec); -@@ -839,11 +834,7 @@ static int cx25840_ir_rx_s_parameters(struct v4l2_subdev *sd, - o->interrupt_enable = p->interrupt_enable; - o->enable = p->enable; - if (p->enable) { -- unsigned long flags; -- -- spin_lock_irqsave(&ir_state->rx_kfifo_lock, flags); -- kfifo_reset(&ir_state->rx_kfifo); -- spin_unlock_irqrestore(&ir_state->rx_kfifo_lock, flags); -+ kfifo_reset(ir_state->rx_kfifo); - if (p->interrupt_enable) - irqenable_rx(sd, IRQEN_RSE | IRQEN_RTE | IRQEN_ROE); - control_rx_enable(c, p->enable); -@@ -1235,8 +1226,9 @@ int cx25840_ir_probe(struct v4l2_subdev *sd) - return -ENOMEM; - - spin_lock_init(&ir_state->rx_kfifo_lock); -- if (kfifo_alloc(&ir_state->rx_kfifo, -- CX25840_IR_RX_KFIFO_SIZE, GFP_KERNEL)) -+ ir_state->rx_kfifo = kfifo_alloc(CX25840_IR_RX_KFIFO_SIZE, GFP_KERNEL, -+ &ir_state->rx_kfifo_lock); -+ if (IS_ERR(ir_state->rx_kfifo)) - return -ENOMEM; - - ir_state->c = state->c; -@@ -1270,7 +1262,7 @@ int cx25840_ir_remove(struct v4l2_subdev *sd) - cx25840_ir_rx_shutdown(sd); - cx25840_ir_tx_shutdown(sd); - -- kfifo_free(&ir_state->rx_kfifo); -+ kfifo_free(ir_state->rx_kfifo); - state->ir_state = NULL; - return 0; - } -diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c -index c1aa888..b04d70c 100644 ---- a/drivers/media/pci/cx23885/cx23888-ir.c -+++ b/drivers/media/pci/cx23885/cx23888-ir.c -@@ -131,7 +131,7 @@ struct cx23888_ir_state { - atomic_t rxclk_divider; - atomic_t rx_invert; - -- struct kfifo rx_kfifo; -+ struct kfifo *rx_kfifo; - spinlock_t rx_kfifo_lock; - - struct v4l2_subdev_ir_parameters tx_params; -@@ -531,7 +531,6 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, - { - struct cx23888_ir_state *state = to_state(sd); - struct cx23885_dev *dev = state->dev; -- unsigned long flags; - - u32 cntrl = cx23888_ir_read4(dev, CX23888_IR_CNTRL_REG); - u32 irqen = cx23888_ir_read4(dev, CX23888_IR_IRQEN_REG); -@@ -604,10 +603,9 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, - } - if (i == 0) - break; -- j = i * sizeof(union cx23888_ir_fifo_rec); -- k = kfifo_in_locked(&state->rx_kfifo, -- (unsigned char *) rx_data, j, -- &state->rx_kfifo_lock); -+ j = i * sizeof(u32); -+ k = kfifo_put(state->rx_kfifo, -+ (unsigned char *) rx_data, j); - if (k != j) - kror++; /* rx_kfifo over run */ - } -@@ -644,10 +642,8 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, - *handled = true; - } - -- spin_lock_irqsave(&state->rx_kfifo_lock, flags); -- if (kfifo_len(&state->rx_kfifo) >= CX23888_IR_RX_KFIFO_SIZE / 2) -+ if (kfifo_len(state->rx_kfifo) >= CX23888_IR_RX_KFIFO_SIZE / 2) - events |= V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ; -- spin_unlock_irqrestore(&state->rx_kfifo_lock, flags); - - if (events) - v4l2_subdev_notify(sd, V4L2_SUBDEV_IR_RX_NOTIFY, &events); -@@ -673,7 +669,7 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, - return 0; - } - -- n = kfifo_out_locked(&state->rx_kfifo, buf, n, &state->rx_kfifo_lock); -+ n = kfifo_get(state->rx_kfifo, buf, n); - - n /= sizeof(union cx23888_ir_fifo_rec); - *num = n * sizeof(union cx23888_ir_fifo_rec); -@@ -812,12 +808,7 @@ static int cx23888_ir_rx_s_parameters(struct v4l2_subdev *sd, - o->interrupt_enable = p->interrupt_enable; - o->enable = p->enable; - if (p->enable) { -- unsigned long flags; -- -- spin_lock_irqsave(&state->rx_kfifo_lock, flags); -- kfifo_reset(&state->rx_kfifo); -- /* reset tx_fifo too if there is one... */ -- spin_unlock_irqrestore(&state->rx_kfifo_lock, flags); -+ kfifo_reset(state->rx_kfifo); - if (p->interrupt_enable) - irqenable_rx(dev, IRQEN_RSE | IRQEN_RTE | IRQEN_ROE); - control_rx_enable(dev, p->enable); -@@ -1179,8 +1170,10 @@ int cx23888_ir_probe(struct cx23885_dev *dev) - return -ENOMEM; - - spin_lock_init(&state->rx_kfifo_lock); -- if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL)) -- return -ENOMEM; -+ state->rx_kfifo = kfifo_alloc(CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL, -+ &state->rx_kfifo_lock); -+ if (IS_ERR(state->rx_kfifo)) -+ return IS_ERR(state->rx_kfifo); - - state->dev = dev; - sd = &state->sd; -@@ -1208,7 +1201,7 @@ int cx23888_ir_probe(struct cx23885_dev *dev) - default_params = default_tx_params; - v4l2_subdev_call(sd, ir, tx_s_parameters, &default_params); - } else { -- kfifo_free(&state->rx_kfifo); -+ kfifo_free(state->rx_kfifo); - } - return ret; - } -@@ -1227,7 +1220,7 @@ int cx23888_ir_remove(struct cx23885_dev *dev) - - state = to_state(sd); - v4l2_device_unregister_subdev(sd); -- kfifo_free(&state->rx_kfifo); -+ kfifo_free(state->rx_kfifo); - kfree(state); - /* Nothing more to free() as state held the actual v4l2_subdev object */ - return 0; -diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c -index aeae547..3d85fff 100644 ---- a/drivers/media/pci/meye/meye.c -+++ b/drivers/media/pci/meye/meye.c -@@ -804,8 +804,8 @@ again: - return IRQ_HANDLED; - - if (meye.mchip_mode == MCHIP_HIC_MODE_CONT_OUT) { -- if (kfifo_out_locked(&meye.grabq, (unsigned char *)&reqnr, -- sizeof(int), &meye.grabq_lock) != sizeof(int)) { -+ if (kfifo_get(meye.grabq, (unsigned char *)&reqnr, -+ sizeof(int)) != sizeof(int)) { - mchip_free_frame(); - return IRQ_HANDLED; - } -@@ -815,8 +815,7 @@ again: - meye.grab_buffer[reqnr].state = MEYE_BUF_DONE; - v4l2_get_timestamp(&meye.grab_buffer[reqnr].timestamp); - meye.grab_buffer[reqnr].sequence = sequence++; -- kfifo_in_locked(&meye.doneq, (unsigned char *)&reqnr, -- sizeof(int), &meye.doneq_lock); -+ kfifo_put(meye.doneq, (unsigned char *)&reqnr, sizeof(int)); - wake_up_interruptible(&meye.proc_list); - } else { - int size; -@@ -825,8 +824,8 @@ again: - mchip_free_frame(); - goto again; - } -- if (kfifo_out_locked(&meye.grabq, (unsigned char *)&reqnr, -- sizeof(int), &meye.grabq_lock) != sizeof(int)) { -+ if (kfifo_get(meye.grabq, (unsigned char *)&reqnr, -+ sizeof(int)) != sizeof(int)) { - mchip_free_frame(); - goto again; - } -@@ -836,8 +835,7 @@ again: - meye.grab_buffer[reqnr].state = MEYE_BUF_DONE; - v4l2_get_timestamp(&meye.grab_buffer[reqnr].timestamp); - meye.grab_buffer[reqnr].sequence = sequence++; -- kfifo_in_locked(&meye.doneq, (unsigned char *)&reqnr, -- sizeof(int), &meye.doneq_lock); -+ kfifo_put(meye.doneq, (unsigned char *)&reqnr, sizeof(int)); - wake_up_interruptible(&meye.proc_list); - } - mchip_free_frame(); -@@ -865,8 +863,8 @@ static int meye_open(struct file *file) - - for (i = 0; i < MEYE_MAX_BUFNBRS; i++) - meye.grab_buffer[i].state = MEYE_BUF_UNUSED; -- kfifo_reset(&meye.grabq); -- kfifo_reset(&meye.doneq); -+ kfifo_reset(meye.grabq); -+ kfifo_reset(meye.doneq); - return v4l2_fh_open(file); - } - -@@ -939,8 +937,7 @@ static int meyeioc_qbuf_capt(int *nb) - mchip_cont_compression_start(); - - meye.grab_buffer[*nb].state = MEYE_BUF_USING; -- kfifo_in_locked(&meye.grabq, (unsigned char *)nb, sizeof(int), -- &meye.grabq_lock); -+ kfifo_put(meye.grabq, (unsigned char *)nb, sizeof(int)); - mutex_unlock(&meye.lock); - - return 0; -@@ -972,9 +969,7 @@ static int meyeioc_sync(struct file *file, void *fh, int *i) - /* fall through */ - case MEYE_BUF_DONE: - meye.grab_buffer[*i].state = MEYE_BUF_UNUSED; -- if (kfifo_out_locked(&meye.doneq, (unsigned char *)&unused, -- sizeof(int), &meye.doneq_lock) != sizeof(int)) -- break; -+ kfifo_get(meye.doneq, (unsigned char *)&unused, sizeof(int)); - } - *i = meye.grab_buffer[*i].size; - mutex_unlock(&meye.lock); -@@ -1319,8 +1314,7 @@ static int vidioc_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf) - buf->flags |= V4L2_BUF_FLAG_QUEUED; - buf->flags &= ~V4L2_BUF_FLAG_DONE; - meye.grab_buffer[buf->index].state = MEYE_BUF_USING; -- kfifo_in_locked(&meye.grabq, (unsigned char *)&buf->index, -- sizeof(int), &meye.grabq_lock); -+ kfifo_put(meye.grabq, (unsigned char *)&buf->index, sizeof(int)); - mutex_unlock(&meye.lock); - - return 0; -@@ -1335,19 +1329,19 @@ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf) - - mutex_lock(&meye.lock); - -- if (kfifo_len(&meye.doneq) == 0 && file->f_flags & O_NONBLOCK) { -+ if (kfifo_len(meye.doneq) == 0 && file->f_flags & O_NONBLOCK) { - mutex_unlock(&meye.lock); - return -EAGAIN; - } - - if (wait_event_interruptible(meye.proc_list, -- kfifo_len(&meye.doneq) != 0) < 0) { -+ kfifo_len(meye.doneq) != 0) < 0) { - mutex_unlock(&meye.lock); - return -EINTR; - } - -- if (!kfifo_out_locked(&meye.doneq, (unsigned char *)&reqnr, -- sizeof(int), &meye.doneq_lock)) { -+ if (!kfifo_get(meye.doneq, (unsigned char *)&reqnr, -+ sizeof(int))) { - mutex_unlock(&meye.lock); - return -EBUSY; - } -@@ -1397,8 +1391,8 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i) - { - mutex_lock(&meye.lock); - mchip_hic_stop(); -- kfifo_reset(&meye.grabq); -- kfifo_reset(&meye.doneq); -+ kfifo_reset(meye.grabq); -+ kfifo_reset(meye.doneq); - - for (i = 0; i < MEYE_MAX_BUFNBRS; i++) - meye.grab_buffer[i].state = MEYE_BUF_UNUSED; -@@ -1441,7 +1435,7 @@ static unsigned int meye_poll(struct file *file, poll_table *wait) - - mutex_lock(&meye.lock); - poll_wait(file, &meye.proc_list, wait); -- if (kfifo_len(&meye.doneq)) -+ if (kfifo_len(meye.doneq)) - res |= POLLIN | POLLRDNORM; - mutex_unlock(&meye.lock); - return res; -@@ -1649,14 +1643,16 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) - } - - spin_lock_init(&meye.grabq_lock); -- if (kfifo_alloc(&meye.grabq, sizeof(int) * MEYE_MAX_BUFNBRS, -- GFP_KERNEL)) { -+ meye.grabq = kfifo_alloc(sizeof(int) * MEYE_MAX_BUFNBRS, GFP_KERNEL, -+ &meye.grabq_lock); -+ if (IS_ERR(meye.grabq)) { - v4l2_err(v4l2_dev, "fifo allocation failed\n"); - goto outkfifoalloc1; - } - spin_lock_init(&meye.doneq_lock); -- if (kfifo_alloc(&meye.doneq, sizeof(int) * MEYE_MAX_BUFNBRS, -- GFP_KERNEL)) { -+ meye.doneq = kfifo_alloc(sizeof(int) * MEYE_MAX_BUFNBRS, GFP_KERNEL, -+ &meye.doneq_lock); -+ if (IS_ERR(meye.doneq)) { - v4l2_err(v4l2_dev, "fifo allocation failed\n"); - goto outkfifoalloc2; - } -@@ -1774,9 +1770,9 @@ outregions: - outenabledev: - sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 0); - outsonypienable: -- kfifo_free(&meye.doneq); -+ kfifo_free(meye.doneq); - outkfifoalloc2: -- kfifo_free(&meye.grabq); -+ kfifo_free(meye.grabq); - outkfifoalloc1: - vfree(meye.grab_temp); - outvmalloc: -@@ -1807,8 +1803,8 @@ static void meye_remove(struct pci_dev *pcidev) - - sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 0); - -- kfifo_free(&meye.doneq); -- kfifo_free(&meye.grabq); -+ kfifo_free(meye.doneq); -+ kfifo_free(meye.grabq); - - vfree(meye.grab_temp); - -diff --git a/drivers/media/pci/meye/meye.h b/drivers/media/pci/meye/meye.h -index 6fed927..77aad1f 100644 ---- a/drivers/media/pci/meye/meye.h -+++ b/drivers/media/pci/meye/meye.h -@@ -306,9 +306,9 @@ struct meye { - struct meye_grab_buffer grab_buffer[MEYE_MAX_BUFNBRS]; - int vma_use_count[MEYE_MAX_BUFNBRS]; /* mmap count */ - struct mutex lock; /* mutex for open/mmap... */ -- struct kfifo grabq; /* queue for buffers to be grabbed */ -+ struct kfifo *grabq; /* queue for buffers to be grabbed */ - spinlock_t grabq_lock; /* lock protecting the queue */ -- struct kfifo doneq; /* queue for grabbed buffers */ -+ struct kfifo *doneq; /* queue for grabbed buffers */ - spinlock_t doneq_lock; /* lock protecting the queue */ - wait_queue_head_t proc_list; /* wait queue */ - struct video_device *vdev; /* video device parameters */ -diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h -index 84967ca..2aca801 100644 ---- a/drivers/media/rc/rc-core-priv.h -+++ b/drivers/media/rc/rc-core-priv.h -@@ -35,7 +35,7 @@ struct ir_raw_event_ctrl { - struct list_head list; /* to keep track of raw clients */ - struct task_struct *thread; - spinlock_t lock; -- struct kfifo kfifo; /* fifo for the pulse/space durations */ -+ struct kfifo *kfifo; /* fifo for the pulse/space durations */ - ktime_t last_event; /* when last event occurred */ - enum raw_event_type last_type; /* last event type */ - struct rc_dev *dev; /* pointer to the parent rc_dev */ -diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c -index e8fff2a..7709c32 100644 ---- a/drivers/media/rc/rc-ir-raw.c -+++ b/drivers/media/rc/rc-ir-raw.c -@@ -41,7 +41,7 @@ static int ir_raw_event_thread(void *data) - while (!kthread_should_stop()) { - - spin_lock_irq(&raw->lock); -- retval = kfifo_len(&raw->kfifo); -+ retval = kfifo_len(raw->kfifo); - - if (retval < sizeof(ev)) { - set_current_state(TASK_INTERRUPTIBLE); -@@ -54,7 +54,7 @@ static int ir_raw_event_thread(void *data) - continue; - } - -- retval = kfifo_out(&raw->kfifo, &ev, sizeof(ev)); -+ retval = __kfifo_get(raw->kfifo, (void *)&ev, sizeof(ev)); - spin_unlock_irq(&raw->lock); - - mutex_lock(&ir_raw_handler_lock); -@@ -85,7 +85,7 @@ int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev) - IR_dprintk(2, "sample: (%05dus %s)\n", - TO_US(ev->duration), TO_STR(ev->pulse)); - -- if (kfifo_in(&dev->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) -+ if (__kfifo_put(dev->raw->kfifo, (void *)ev, sizeof(*ev)) != sizeof(*ev)) - return -ENOMEM; - - return 0; -@@ -264,11 +264,11 @@ int ir_raw_event_register(struct rc_dev *dev) - dev->raw->dev = dev; - dev->enabled_protocols = ~0; - dev->change_protocol = change_protocol; -- rc = kfifo_alloc(&dev->raw->kfifo, -- sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, -- GFP_KERNEL); -- if (rc < 0) -+ dev->raw->kfifo = kfifo_alloc(sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, GFP_KERNEL, NULL); -+ if (IS_ERR(dev->raw->kfifo)) { -+ rc = PTR_ERR(dev->raw->kfifo); - goto out; -+ } - - spin_lock_init(&dev->raw->lock); - dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw, -@@ -310,7 +310,7 @@ void ir_raw_event_unregister(struct rc_dev *dev) - handler->raw_unregister(dev); - mutex_unlock(&ir_raw_handler_lock); - -- kfifo_free(&dev->raw->kfifo); -+ kfifo_free(dev->raw->kfifo); - kfree(dev->raw); - dev->raw = NULL; - } -diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c -index 1ccf626..b0e514b 100644 ---- a/drivers/staging/media/lirc/lirc_zilog.c -+++ b/drivers/staging/media/lirc/lirc_zilog.c -@@ -199,7 +199,7 @@ static void release_ir_device(struct kref *ref) - lirc_unregister_driver(ir->l.minor); - ir->l.minor = MAX_IRCTL_DEVICES; - } -- if (kfifo_initialized(&ir->rbuf.fifo)) -+ if (ir->rbuf.fifo) - lirc_buffer_free(&ir->rbuf); - list_del(&ir->list); - kfree(ir); -diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h -index 05e7ad5..f40097c 100644 ---- a/include/media/lirc_dev.h -+++ b/include/media/lirc_dev.h -@@ -28,18 +28,14 @@ struct lirc_buffer { - unsigned int size; /* in chunks */ - /* Using chunks instead of bytes pretends to simplify boundary checking - * And should allow for some performance fine tunning later */ -- struct kfifo fifo; -+ struct kfifo *fifo; - }; - - static inline void lirc_buffer_clear(struct lirc_buffer *buf) - { -- unsigned long flags; -- -- if (kfifo_initialized(&buf->fifo)) { -- spin_lock_irqsave(&buf->fifo_lock, flags); -- kfifo_reset(&buf->fifo); -- spin_unlock_irqrestore(&buf->fifo_lock, flags); -- } else -+ if (buf->fifo) -+ kfifo_reset(buf->fifo); -+ else - WARN(1, "calling %s on an uninitialized lirc_buffer\n", - __func__); - } -@@ -48,22 +44,23 @@ static inline int lirc_buffer_init(struct lirc_buffer *buf, - unsigned int chunk_size, - unsigned int size) - { -- int ret; -- - init_waitqueue_head(&buf->wait_poll); - spin_lock_init(&buf->fifo_lock); - buf->chunk_size = chunk_size; - buf->size = size; -- ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); -+ buf->fifo = kfifo_alloc(size * chunk_size, GFP_KERNEL, -+ &buf->fifo_lock); -+ if (IS_ERR(buf->fifo)) -+ return IS_ERR(buf->fifo); - -- return ret; -+ return 0; - } - - static inline void lirc_buffer_free(struct lirc_buffer *buf) - { -- if (kfifo_initialized(&buf->fifo)) { -- kfifo_free(&buf->fifo); -- } else -+ if (buf->fifo) -+ kfifo_free(buf->fifo); -+ else - WARN(1, "calling %s on an uninitialized lirc_buffer\n", - __func__); - } -@@ -71,11 +68,8 @@ static inline void lirc_buffer_free(struct lirc_buffer *buf) - static inline int lirc_buffer_len(struct lirc_buffer *buf) - { - int len; -- unsigned long flags; - -- spin_lock_irqsave(&buf->fifo_lock, flags); -- len = kfifo_len(&buf->fifo); -- spin_unlock_irqrestore(&buf->fifo_lock, flags); -+ len = kfifo_len(buf->fifo); - - return len; - } -@@ -98,24 +92,19 @@ static inline int lirc_buffer_available(struct lirc_buffer *buf) - static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, - unsigned char *dest) - { -- unsigned int ret = 0; -- - if (lirc_buffer_len(buf) >= buf->chunk_size) -- ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, -- &buf->fifo_lock); -- return ret; -+ kfifo_get(buf->fifo, dest, buf->chunk_size); -+ -+ return 0; - - } - - static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, - unsigned char *orig) - { -- unsigned int ret; -- -- ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, -- &buf->fifo_lock); -+ kfifo_put(buf->fifo, orig, buf->chunk_size); - -- return ret; -+ return 0; - } - - struct lirc_driver { diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_request_firmware_nowait.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_request_firmware_nowait.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.32_request_firmware_nowait.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.32_request_firmware_nowait.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c -index f88f948..8591799 100644 ---- a/drivers/media/tuners/tuner-xc2028.c -+++ b/drivers/media/tuners/tuner-xc2028.c -@@ -1408,7 +1408,6 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) - rc = request_firmware_nowait(THIS_MODULE, 1, - priv->fname, - priv->i2c_props.adap->dev.parent, -- GFP_KERNEL, - fe, load_firmware_cb); - if (rc < 0) { - tuner_err("Failed to request firmware %s\n", diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_input_handlers_are_int.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_input_handlers_are_int.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_input_handlers_are_int.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_input_handlers_are_int.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ ---- - drivers/media/usb/dvb-usb/dvb-usb-remote.c | 4 ++-- - drivers/media/rc/rc-main.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - ---- linux.orig/drivers/media/rc/rc-main.c -+++ linux/drivers/media/rc/rc-main.c -@@ -318,7 +318,7 @@ static unsigned int ir_establish_scancod - * This routine is used to handle evdev EVIOCSKEY ioctl. - */ - static int ir_setkeycode(struct input_dev *idev, -- unsigned int scancode, unsigned int keycode) -+ int scancode, int keycode) - { - struct rc_dev *rdev = input_get_drvdata(idev); - struct rc_map *rc_map = &rdev->rc_map; -@@ -422,7 +422,7 @@ static unsigned int ir_lookup_by_scancod - * This routine is used to handle evdev EVIOCGKEY ioctl. - */ - static int ir_getkeycode(struct input_dev *idev, -- unsigned int scancode, unsigned int *keycode) -+ int scancode, int *keycode) - { - struct rc_dev *rdev = input_get_drvdata(idev); - struct rc_map *rc_map = &rdev->rc_map; ---- linux.orig/drivers/media/usb/dvb-usb/dvb-usb-remote.c -+++ linux/drivers/media/usb/dvb-usb/dvb-usb-remote.c -@@ -9,7 +9,7 @@ - #include - - static int legacy_dvb_usb_getkeycode(struct input_dev *dev, -- unsigned int scancode, unsigned int *keycode) -+ int scancode, int *keycode) - { - struct dvb_usb_device *d = input_get_drvdata(dev); - -@@ -39,7 +39,7 @@ static int legacy_dvb_usb_getkeycode(str - } - - static int legacy_dvb_usb_setkeycode(struct input_dev *dev, -- unsigned int scancode, unsigned int keycode) -+ int scancode, int keycode) - { - struct dvb_usb_device *d = input_get_drvdata(dev); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_no_gpio_request_one.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_no_gpio_request_one.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_no_gpio_request_one.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_no_gpio_request_one.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c -index 71e1fca..bc55d98 100644 ---- a/drivers/media/usb/em28xx/em28xx-dvb.c -+++ b/drivers/media/usb/em28xx/em28xx-dvb.c -@@ -719,7 +719,7 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) - struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv; - struct em28xx *dev = i2c_bus->dev; --#ifdef CONFIG_GPIOLIB -+#if 0 - struct em28xx_dvb *dvb = dev->dvb; - int ret; - unsigned long flags; -@@ -1220,7 +1220,7 @@ static int em28xx_dvb_init(struct em28xx *dev) - goto out_free; - } - --#ifdef CONFIG_GPIOLIB -+#if 0 - /* enable LNA for DVB-T, DVB-T2 and DVB-C */ - result = gpio_request_one(dvb->lna_gpio, - GPIOF_OUT_INIT_LOW, NULL); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_pvrusb2_sysfs.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_pvrusb2_sysfs.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.33_pvrusb2_sysfs.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.33_pvrusb2_sysfs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ ---- - drivers/media/usb/pvrusb2/pvrusb2-sysfs.c | 14 -------------- - 1 file changed, 14 deletions(-) - ---- linux.orig/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c -+++ linux/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c -@@ -432,12 +432,10 @@ static void pvr2_sysfs_add_debugifc(stru - - dip = kzalloc(sizeof(*dip),GFP_KERNEL); - if (!dip) return; -- sysfs_attr_init(&dip->attr_debugcmd.attr); - dip->attr_debugcmd.attr.name = "debugcmd"; - dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; - dip->attr_debugcmd.show = debugcmd_show; - dip->attr_debugcmd.store = debugcmd_store; -- sysfs_attr_init(&dip->attr_debuginfo.attr); - dip->attr_debuginfo.attr.name = "debuginfo"; - dip->attr_debuginfo.attr.mode = S_IRUGO; - dip->attr_debuginfo.show = debuginfo_show; -@@ -659,8 +657,6 @@ static void class_dev_create(struct pvr2 - put_device(class_dev); - return; - } -- -- sysfs_attr_init(&sfp->attr_v4l_minor_number.attr); - sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; - sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; - sfp->attr_v4l_minor_number.show = v4l_minor_number_show; -@@ -674,8 +670,6 @@ static void class_dev_create(struct pvr2 - } else { - sfp->v4l_minor_number_created_ok = !0; - } -- -- sysfs_attr_init(&sfp->attr_v4l_radio_minor_number.attr); - sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number"; - sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO; - sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show; -@@ -689,8 +683,6 @@ static void class_dev_create(struct pvr2 - } else { - sfp->v4l_radio_minor_number_created_ok = !0; - } -- -- sysfs_attr_init(&sfp->attr_unit_number.attr); - sfp->attr_unit_number.attr.name = "unit_number"; - sfp->attr_unit_number.attr.mode = S_IRUGO; - sfp->attr_unit_number.show = unit_number_show; -@@ -703,8 +695,6 @@ static void class_dev_create(struct pvr2 - } else { - sfp->unit_number_created_ok = !0; - } -- -- sysfs_attr_init(&sfp->attr_bus_info.attr); - sfp->attr_bus_info.attr.name = "bus_info_str"; - sfp->attr_bus_info.attr.mode = S_IRUGO; - sfp->attr_bus_info.show = bus_info_show; -@@ -718,8 +708,6 @@ static void class_dev_create(struct pvr2 - } else { - sfp->bus_info_created_ok = !0; - } -- -- sysfs_attr_init(&sfp->attr_hdw_name.attr); - sfp->attr_hdw_name.attr.name = "device_hardware_type"; - sfp->attr_hdw_name.attr.mode = S_IRUGO; - sfp->attr_hdw_name.show = hdw_name_show; -@@ -733,8 +721,6 @@ static void class_dev_create(struct pvr2 - } else { - sfp->hdw_name_created_ok = !0; - } -- -- sysfs_attr_init(&sfp->attr_hdw_desc.attr); - sfp->attr_hdw_desc.attr.name = "device_hardware_description"; - sfp->attr_hdw_desc.attr.mode = S_IRUGO; - sfp->attr_hdw_desc.show = hdw_desc_show; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_dvb_net.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_dvb_net.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_dvb_net.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_dvb_net.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c -index 686d327..eabf882 100644 ---- a/drivers/media/dvb-core/dvb_net.c -+++ b/drivers/media/dvb-core/dvb_net.c -@@ -1087,14 +1087,14 @@ static int dvb_net_feed_stop(struct net_device *dev) - } - - --static int dvb_set_mc_filter(struct net_device *dev, unsigned char *addr) -+static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) - { - struct dvb_net_priv *priv = netdev_priv(dev); - - if (priv->multi_num == DVB_NET_MULTICAST_MAX) - return -ENOMEM; - -- memcpy(priv->multi_macs[priv->multi_num], addr, ETH_ALEN); -+ memcpy(priv->multi_macs[priv->multi_num], mc->dmi_addr, 6); - - priv->multi_num++; - return 0; -@@ -1118,7 +1118,7 @@ static void wq_set_multicast_list (struct work_struct *work) - netdev_dbg(dev, "allmulti mode\n"); - priv->rx_mode = RX_MODE_ALL_MULTI; - } else if (!netdev_mc_empty(dev)) { -- struct netdev_hw_addr *ha; -+ struct dev_mc_list *mc; - - netdev_dbg(dev, "set_mc_list, %d entries\n", - netdev_mc_count(dev)); -@@ -1126,8 +1126,8 @@ static void wq_set_multicast_list (struct work_struct *work) - priv->rx_mode = RX_MODE_MULTI; - priv->multi_num = 0; - -- netdev_for_each_mc_addr(ha, dev) -- dvb_set_mc_filter(dev, ha->addr); -+ netdev_for_each_mc_addr(mc, dev) -+ dvb_set_mc_filter(dev, mc); - } - - netif_addr_unlock_bh(dev); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_fix_define_warnings.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_fix_define_warnings.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_fix_define_warnings.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_fix_define_warnings.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -diff -r a0ea01e58ec5 drivers/media/dvb-frontends/tua6100.c ---- a/drivers/media/dvb-frontends/tua6100.c Wed Oct 27 20:58:38 2010 -0200 -+++ b/drivers/media/dvb-frontends/tua6100.c Wed Oct 27 21:07:04 2010 -0200 -@@ -80,6 +80,7 @@ - struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 }; - struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 }; - -+#undef _P - #define _R 4 - #define _P 32 - #define _ri 4000000 diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_usb_ss_ep_comp.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_usb_ss_ep_comp.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.34_usb_ss_ep_comp.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.34_usb_ss_ep_comp.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c -index 7e350d7..9c3aed2 100644 ---- a/drivers/media/usb/uvc/uvc_video.c -+++ b/drivers/media/usb/uvc/uvc_video.c -@@ -1463,7 +1463,7 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev, - - switch (dev->speed) { - case USB_SPEED_SUPER: -- return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval); -+ return le16_to_cpu(ep->ss_ep_comp->desc.wBytesPerInterval); - case USB_SPEED_HIGH: - psize = usb_endpoint_maxp(&ep->desc); - return (psize & 0x07ff) * (1 + ((psize >> 11) & 3)); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_firedtv_handle_fcp.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_firedtv_handle_fcp.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_firedtv_handle_fcp.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_firedtv_handle_fcp.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ ---- - drivers/media/firewire/firedtv-fw.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- linux.orig/drivers/media/firewire/firedtv-fw.c -+++ linux/drivers/media/firewire/firedtv-fw.c -@@ -192,9 +192,9 @@ void fdtv_stop_iso(struct firedtv *fdtv) - } - - static void handle_fcp(struct fw_card *card, struct fw_request *request, -- int tcode, int destination, int source, int generation, -- unsigned long long offset, void *payload, size_t length, -- void *callback_data) -+ int tcode, int destination, int source, int generation, -+ int speed, unsigned long long offset, -+ void *payload, size_t length, void *callback_data) - { - struct firedtv *f, *fdtv = NULL; - struct fw_device *device; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_i2c_new_probed_device.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_i2c_new_probed_device.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_i2c_new_probed_device.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_i2c_new_probed_device.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c -index f368213..c4069f2 100644 ---- a/drivers/media/pci/bt8xx/bttv-input.c -+++ b/drivers/media/pci/bt8xx/bttv-input.c -@@ -405,7 +405,7 @@ void init_bttv_i2c_ir(struct bttv *btv) - * internal. - * That's why we probe 0x1a (~0x34) first. CB - */ -- i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); -+ i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); - } - if (NULL == i2c_dev) - return; -diff --git a/drivers/media/pci/cx18/cx18-i2c.c b/drivers/media/pci/cx18/cx18-i2c.c -index 4af8cd6..0747788 100644 ---- a/drivers/media/pci/cx18/cx18-i2c.c -+++ b/drivers/media/pci/cx18/cx18-i2c.c -@@ -104,7 +104,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw, - break; - } - -- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ? -+ return i2c_new_probed_device(adap, &info, addr_list) == NULL ? - -1 : 0; - } - -diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c -index 4887314..8551b42 100644 ---- a/drivers/media/pci/cx23885/cx23885-i2c.c -+++ b/drivers/media/pci/cx23885/cx23885-i2c.c -@@ -339,7 +339,8 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) - } else - printk(KERN_WARNING "%s: i2c bus %d register FAILED\n", - dev->name, bus->nr); -- -+#if 0 -+ /* This probe function won't work on older devices */ - /* Instantiate the IR receiver device, if present */ - if (0 == bus->i2c_rc) { - struct i2c_board_info info; -@@ -354,7 +355,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) - i2c_new_probed_device(&bus->i2c_adap, &info, addr_list, - i2c_probe_func_quick_read); - } -- -+#endif - return bus->i2c_rc; - } - -diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c -index ceed2d8..11a94d1 100644 ---- a/drivers/media/pci/ivtv/ivtv-i2c.c -+++ b/drivers/media/pci/ivtv/ivtv-i2c.c -@@ -186,7 +186,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) - return -1; - memset(&info, 0, sizeof(struct i2c_board_info)); - strlcpy(info.type, type, I2C_NAME_SIZE); -- return i2c_new_probed_device(adap, &info, addr_list, NULL) -+ return i2c_new_probed_device(adap, &info, addr_list) - == NULL ? -1 : 0; - } - -@@ -230,7 +230,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) - info.platform_data = init_data; - strlcpy(info.type, type, I2C_NAME_SIZE); - -- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ? -+ return i2c_new_probed_device(adap, &info, addr_list) == NULL ? - -1 : 0; - } - -@@ -257,7 +257,7 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv) - - memset(&info, 0, sizeof(struct i2c_board_info)); - strlcpy(info.type, "ir_video", I2C_NAME_SIZE); -- return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list, NULL); -+ return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list); - } - - int ivtv_i2c_register(struct ivtv *itv, unsigned idx) -diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c -index aa044f4..d971158 100644 ---- a/drivers/media/v4l2-core/v4l2-common.c -+++ b/drivers/media/v4l2-core/v4l2-common.c -@@ -318,8 +318,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, - - /* Create the i2c client */ - if (info->addr == 0 && probe_addrs) -- client = i2c_new_probed_device(adapter, info, probe_addrs, -- NULL); -+ client = i2c_new_probed_device(adapter, info, probe_addrs); - else - client = i2c_new_device(adapter, info); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_kfifo.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_kfifo.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_kfifo.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_kfifo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ ---- - drivers/media/rc/rc-core-priv.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h -index 96f0a8b..b72f858 100644 ---- a/drivers/media/rc/rc-core-priv.h -+++ b/drivers/media/rc/rc-core-priv.h -@@ -35,7 +35,7 @@ struct ir_raw_event_ctrl { - struct list_head list; /* to keep track of raw clients */ - struct task_struct *thread; - spinlock_t lock; -- struct kfifo_rec_ptr_1 kfifo; /* fifo for the pulse/space durations */ -+ struct kfifo kfifo; /* fifo for the pulse/space durations */ - ktime_t last_event; /* when last event occurred */ - enum raw_event_type last_type; /* last event type */ - struct rc_dev *dev; /* pointer to the parent rc_dev */ diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_work_handler.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_work_handler.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.35_work_handler.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.35_work_handler.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,149 +0,0 @@ -diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c -index c08ae3e..2e453ff 100644 ---- a/drivers/media/pci/ivtv/ivtv-driver.c -+++ b/drivers/media/pci/ivtv/ivtv-driver.c -@@ -737,8 +737,6 @@ done: - */ - static int ivtv_init_struct1(struct ivtv *itv) - { -- struct sched_param param = { .sched_priority = 99 }; -- - itv->base_addr = pci_resource_start(itv->pdev, 0); - itv->enc_mbox.max_mbox = 2; /* the encoder has 3 mailboxes (0-2) */ - itv->dec_mbox.max_mbox = 1; /* the decoder has 2 mailboxes (0-1) */ -@@ -750,17 +748,12 @@ static int ivtv_init_struct1(struct ivtv *itv) - spin_lock_init(&itv->lock); - spin_lock_init(&itv->dma_reg_lock); - -- init_kthread_worker(&itv->irq_worker); -- itv->irq_worker_task = kthread_run(kthread_worker_fn, &itv->irq_worker, -- "%s", itv->v4l2_dev.name); -- if (IS_ERR(itv->irq_worker_task)) { -- IVTV_ERR("Could not create ivtv task\n"); -+ itv->irq_work_queues = create_singlethread_workqueue(itv->v4l2_dev.name); -+ if (itv->irq_work_queues == NULL) { -+ IVTV_ERR("Could not create ivtv workqueue\n"); - return -1; - } -- /* must use the FIFO scheduler as it is realtime sensitive */ -- sched_setscheduler(itv->irq_worker_task, SCHED_FIFO, ¶m); -- -- init_kthread_work(&itv->irq_work, ivtv_irq_work_handler); -+ INIT_WORK(&itv->irq_work_queue, ivtv_irq_work_handler); - - /* Initial settings */ - itv->cxhdl.port = CX2341X_PORT_MEMORY; -@@ -1037,7 +1030,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) - /* PCI Device Setup */ - retval = ivtv_setup_pci(itv, pdev, pci_id); - if (retval == -EIO) -- goto free_worker; -+ goto free_workqueue; - if (retval == -ENXIO) - goto free_mem; - -@@ -1297,8 +1290,8 @@ free_mem: - release_mem_region(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); - if (itv->has_cx23415) - release_mem_region(itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); --free_worker: -- kthread_stop(itv->irq_worker_task); -+free_workqueue: -+ destroy_workqueue(itv->irq_work_queues); - err: - if (retval == 0) - retval = -ENODEV; -@@ -1440,9 +1433,9 @@ static void ivtv_remove(struct pci_dev *pdev) - ivtv_set_irq_mask(itv, 0xffffffff); - del_timer_sync(&itv->dma_timer); - -- /* Kill irq worker */ -- flush_kthread_worker(&itv->irq_worker); -- kthread_stop(itv->irq_worker_task); -+ /* Stop all Work Queues */ -+ flush_workqueue(itv->irq_work_queues); -+ destroy_workqueue(itv->irq_work_queues); - - ivtv_streams_cleanup(itv, 1); - ivtv_udma_free(itv); -diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h -index bc309f42c..6c0fa73 100644 ---- a/drivers/media/pci/ivtv/ivtv-driver.h -+++ b/drivers/media/pci/ivtv/ivtv-driver.h -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -260,6 +260,7 @@ struct ivtv_mailbox_data { - #define IVTV_F_I_INITED 21 /* set after first open */ - #define IVTV_F_I_FAILED 22 /* set if first open failed */ - #define IVTV_F_I_WORK_HANDLER_PCM 23 /* there is work to be done for PCM */ -+#define IVTV_F_I_WORK_INITED 24 /* worker thread was initialized */ - - /* Event notifications */ - #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ -@@ -681,9 +682,8 @@ struct ivtv { - /* Interrupts & DMA */ - u32 irqmask; /* active interrupts */ - u32 irq_rr_idx; /* round-robin stream index */ -- struct kthread_worker irq_worker; /* kthread worker for PIO/YUV/VBI actions */ -- struct task_struct *irq_worker_task; /* task for irq_worker */ -- struct kthread_work irq_work; /* kthread work entry */ -+ struct workqueue_struct *irq_work_queues; /* workqueue for PIO/YUV/VBI actions */ -+ struct work_struct irq_work_queue; /* work entry */ - spinlock_t dma_reg_lock; /* lock access to DMA engine registers */ - int cur_dma_stream; /* index of current stream doing DMA (-1 if none) */ - int cur_pio_stream; /* index of current stream doing PIO (-1 if none) */ -diff --git a/drivers/media/pci/ivtv/ivtv-irq.c b/drivers/media/pci/ivtv/ivtv-irq.c -index 19a7c9b..ed51a8b 100644 ---- a/drivers/media/pci/ivtv/ivtv-irq.c -+++ b/drivers/media/pci/ivtv/ivtv-irq.c -@@ -99,10 +99,19 @@ static void ivtv_pio_work_handler(struct ivtv *itv) - write_reg(IVTV_IRQ_ENC_PIO_COMPLETE, 0x44); - } - --void ivtv_irq_work_handler(struct kthread_work *work) -+void ivtv_irq_work_handler(struct work_struct *work) - { -- struct ivtv *itv = container_of(work, struct ivtv, irq_work); -+ struct ivtv *itv = container_of(work, struct ivtv, irq_work_queue); - -+ DEFINE_WAIT(wait); -+ -+ if (test_and_clear_bit(IVTV_F_I_WORK_INITED, &itv->i_flags)) { -+ struct sched_param param = { .sched_priority = 99 }; -+ -+ /* This thread must use the FIFO scheduler as it -+ is realtime sensitive. */ -+ sched_setscheduler(current, SCHED_FIFO, ¶m); -+ } - if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) - ivtv_pio_work_handler(itv); - -@@ -1060,7 +1069,7 @@ irqreturn_t ivtv_irq_handler(int irq, void *dev_id) - } - - if (test_and_clear_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags)) { -- queue_kthread_work(&itv->irq_worker, &itv->irq_work); -+ queue_work(itv->irq_work_queues, &itv->irq_work_queue); - } - - spin_unlock(&itv->dma_reg_lock); -diff --git a/drivers/media/pci/ivtv/ivtv-irq.h b/drivers/media/pci/ivtv/ivtv-irq.h -index 1e84433..f879a58 100644 ---- a/drivers/media/pci/ivtv/ivtv-irq.h -+++ b/drivers/media/pci/ivtv/ivtv-irq.h -@@ -46,7 +46,7 @@ - - irqreturn_t ivtv_irq_handler(int irq, void *dev_id); - --void ivtv_irq_work_handler(struct kthread_work *work); -+void ivtv_irq_work_handler(struct work_struct *work); - void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock); - void ivtv_unfinished_dma(unsigned long arg); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_dvb_usb_input_getkeycode.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_dvb_usb_input_getkeycode.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_dvb_usb_input_getkeycode.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_dvb_usb_input_getkeycode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ ---- - drivers/media/usb/dvb-usb/dvb-usb-remote.c | 111 ++++++++++------------------- - 1 file changed, 42 insertions(+), 69 deletions(-) - ---- linux.orig/drivers/media/usb/dvb-usb/dvb-usb-remote.c -+++ linux/drivers/media/usb/dvb-usb/dvb-usb-remote.c -@@ -8,71 +8,60 @@ - #include "dvb-usb-common.h" - #include - --static unsigned int --legacy_dvb_usb_get_keymap_index(const struct input_keymap_entry *ke, -- struct rc_map_table *keymap, -- unsigned int keymap_size) --{ -- unsigned int index; -- unsigned int scancode; -- -- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { -- index = ke->index; -- } else { -- if (input_scancode_to_scalar(ke, &scancode)) -- return keymap_size; -- -- /* See if we can match the raw key code. */ -- for (index = 0; index < keymap_size; index++) -- if (keymap[index].scancode == scancode) -- break; -- -- /* See if there is an unused hole in the map */ -- if (index >= keymap_size) { -- for (index = 0; index < keymap_size; index++) { -- if (keymap[index].keycode == KEY_RESERVED || -- keymap[index].keycode == KEY_UNKNOWN) { -- break; -- } -- } -- } -- } -- -- return index; --} -- - static int legacy_dvb_usb_getkeycode(struct input_dev *dev, -- struct input_keymap_entry *ke) -+ unsigned int scancode, unsigned int *keycode) - { - struct dvb_usb_device *d = input_get_drvdata(dev); -+ - struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; -- unsigned int keymap_size = d->props.rc.legacy.rc_map_size; -- unsigned int index; -+ int i; - -- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size); -- if (index >= keymap_size) -- return -EINVAL; -- -- ke->keycode = keymap[index].keycode; -- if (ke->keycode == KEY_UNKNOWN) -- ke->keycode = KEY_RESERVED; -- ke->len = sizeof(keymap[index].scancode); -- memcpy(&ke->scancode, &keymap[index].scancode, ke->len); -- ke->index = index; -+ /* See if we can match the raw key code. */ -+ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) -+ if (keymap[i].scancode == scancode) { -+ *keycode = keymap[i].keycode; -+ return 0; -+ } - -- return 0; -+ /* -+ * If is there extra space, returns KEY_RESERVED, -+ * otherwise, input core won't let legacy_dvb_usb_setkeycode -+ * to work -+ */ -+ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) -+ if (keymap[i].keycode == KEY_RESERVED || -+ keymap[i].keycode == KEY_UNKNOWN) { -+ *keycode = KEY_RESERVED; -+ return 0; -+ } -+ -+ return -EINVAL; - } - - static int legacy_dvb_usb_setkeycode(struct input_dev *dev, -- const struct input_keymap_entry *ke, -- unsigned int *old_keycode) -+ unsigned int scancode, unsigned int keycode) - { - struct dvb_usb_device *d = input_get_drvdata(dev); -+ - struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; -- unsigned int keymap_size = d->props.rc.legacy.rc_map_size; -- unsigned int index; -+ int i; -+ -+ /* Search if it is replacing an existing keycode */ -+ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) -+ if (keymap[i].scancode == scancode) { -+ keymap[i].keycode = keycode; -+ return 0; -+ } -+ -+ /* Search if is there a clean entry. If so, use it */ -+ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) -+ if (keymap[i].keycode == KEY_RESERVED || -+ keymap[i].keycode == KEY_UNKNOWN) { -+ keymap[i].scancode = scancode; -+ keymap[i].keycode = keycode; -+ return 0; -+ } - -- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size); - /* - * FIXME: Currently, it is not possible to increase the size of - * scancode table. For it to happen, one possibility -@@ -80,24 +69,8 @@ static int legacy_dvb_usb_setkeycode(str - * copying data, appending the new key on it, and freeing - * the old one - or maybe just allocating some spare space - */ -- if (index >= keymap_size) -- return -EINVAL; - -- *old_keycode = keymap[index].keycode; -- keymap->keycode = ke->keycode; -- __set_bit(ke->keycode, dev->keybit); -- -- if (*old_keycode != KEY_RESERVED) { -- __clear_bit(*old_keycode, dev->keybit); -- for (index = 0; index < keymap_size; index++) { -- if (keymap[index].keycode == *old_keycode) { -- __set_bit(*old_keycode, dev->keybit); -- break; -- } -- } -- } -- -- return 0; -+ return -EINVAL; - } - - /* Remote-control poll function - called every dib->rc_query_interval ms to see diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_fence.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_fence.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_fence.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_fence.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h -index d174585..6f60f55 100644 ---- a/include/linux/dma-fence.h -+++ b/include/linux/dma-fence.h -@@ -27,7 +27,6 @@ - #include - #include - #include --#include - #include - - struct fence; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_input_getkeycode.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_input_getkeycode.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_input_getkeycode.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_input_getkeycode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ ---- - drivers/media/rc/rc-main.c | 69 ++++++++++----------------------------------- - 1 file changed, 16 insertions(+), 53 deletions(-) - ---- linux.orig/drivers/media/rc/rc-main.c -+++ linux/drivers/media/rc/rc-main.c -@@ -318,37 +318,23 @@ static unsigned int ir_establish_scancod - * This routine is used to handle evdev EVIOCSKEY ioctl. - */ - static int ir_setkeycode(struct input_dev *idev, -- const struct input_keymap_entry *ke, -- unsigned int *old_keycode) -+ unsigned int scancode, unsigned int keycode) - { - struct rc_dev *rdev = input_get_drvdata(idev); - struct rc_map *rc_map = &rdev->rc_map; - unsigned int index; -- unsigned int scancode; - int retval = 0; - unsigned long flags; - - spin_lock_irqsave(&rc_map->lock, flags); - -- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { -- index = ke->index; -- if (index >= rc_map->len) { -- retval = -EINVAL; -- goto out; -- } -- } else { -- retval = input_scancode_to_scalar(ke, &scancode); -- if (retval) -- goto out; -- -- index = ir_establish_scancode(rdev, rc_map, scancode, true); -- if (index >= rc_map->len) { -- retval = -ENOMEM; -- goto out; -- } -+ index = ir_establish_scancode(rdev, rc_map, scancode, true); -+ if (index >= rc_map->len) { -+ retval = -ENOMEM; -+ goto out; - } - -- *old_keycode = ir_update_mapping(rdev, rc_map, index, ke->keycode); -+ ir_update_mapping(rdev, rc_map, index, keycode); - - out: - spin_unlock_irqrestore(&rc_map->lock, flags); -@@ -436,48 +422,25 @@ static unsigned int ir_lookup_by_scancod - * This routine is used to handle evdev EVIOCGKEY ioctl. - */ - static int ir_getkeycode(struct input_dev *idev, -- struct input_keymap_entry *ke) -+ unsigned int scancode, unsigned int *keycode) - { - struct rc_dev *rdev = input_get_drvdata(idev); - struct rc_map *rc_map = &rdev->rc_map; -- struct rc_map_table *entry; - unsigned long flags; - unsigned int index; -- unsigned int scancode; - int retval; - - spin_lock_irqsave(&rc_map->lock, flags); - -- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { -- index = ke->index; -- } else { -- retval = input_scancode_to_scalar(ke, &scancode); -- if (retval) -- goto out; -- -- index = ir_lookup_by_scancode(rc_map, scancode); -- } -- -- if (index < rc_map->len) { -- entry = &rc_map->scan[index]; -- -- ke->index = index; -- ke->keycode = entry->keycode; -- ke->len = sizeof(entry->scancode); -- memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); -- -- } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { -- /* -- * We do not really know the valid range of scancodes -- * so let's respond with KEY_RESERVED to anything we -- * do not have mapping for [yet]. -- */ -- ke->index = index; -- ke->keycode = KEY_RESERVED; -- } else { -- retval = -EINVAL; -- goto out; -- } -+ index = ir_lookup_by_scancode(rc_map, scancode); -+ -+ if (index >= rc_map->len) { -+ *keycode = KEY_RESERVED; -+ retval = 0; -+ goto out; -+ } -+ -+ *keycode = rc_map->scan[index].keycode; - - retval = 0; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_kmap_atomic.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_kmap_atomic.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.36_kmap_atomic.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.36_kmap_atomic.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c -index 7338cb2..69cc816 100644 ---- a/drivers/media/pci/ivtv/ivtv-udma.c -+++ b/drivers/media/pci/ivtv/ivtv-udma.c -@@ -57,9 +57,9 @@ int ivtv_udma_fill_sg_list (struct ivtv_user_dma *dma, struct ivtv_dma_page_info - if (dma->bouncemap[map_offset] == NULL) - return -1; - local_irq_save(flags); -- src = kmap_atomic(dma->map[map_offset]) + offset; -+ src = kmap_atomic(dma->map[map_offset], KM_BOUNCE_READ) + offset; - memcpy(page_address(dma->bouncemap[map_offset]) + offset, src, len); -- kunmap_atomic(src); -+ kunmap_atomic(src, KM_BOUNCE_READ); - local_irq_restore(flags); - sg_set_page(&dma->SGlist[map_offset], dma->bouncemap[map_offset], len, offset); - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c -index 004d8ac..6508785 100644 ---- a/drivers/media/pci/cx18/cx18-driver.c -+++ b/drivers/media/pci/cx18/cx18-driver.c -@@ -695,7 +695,7 @@ static int cx18_create_in_workq(struct cx18 *cx) - { - snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", - cx->v4l2_dev.name); -- cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0); -+ cx->in_work_queue = create_singlethread_workqueue(cx->in_workq_name); - if (cx->in_work_queue == NULL) { - CX18_ERR("Unable to create incoming mailbox handler thread\n"); - return -ENOMEM; -@@ -703,6 +703,18 @@ static int cx18_create_in_workq(struct cx18 *cx) - return 0; - } - -+static int cx18_create_out_workq(struct cx18 *cx) -+{ -+ snprintf(cx->out_workq_name, sizeof(cx->out_workq_name), "%s-out", -+ cx->v4l2_dev.name); -+ cx->out_work_queue = create_workqueue(cx->out_workq_name); -+ if (cx->out_work_queue == NULL) { -+ CX18_ERR("Unable to create outgoing mailbox handler threads\n"); -+ return -ENOMEM; -+ } -+ return 0; -+} -+ - static void cx18_init_in_work_orders(struct cx18 *cx) - { - int i; -@@ -729,10 +741,16 @@ static int cx18_init_struct1(struct cx18 *cx) - mutex_init(&cx->epu2apu_mb_lock); - mutex_init(&cx->epu2cpu_mb_lock); - -- ret = cx18_create_in_workq(cx); -+ ret = cx18_create_out_workq(cx); - if (ret) - return ret; - -+ ret = cx18_create_in_workq(cx); -+ if (ret) { -+ destroy_workqueue(cx->out_work_queue); -+ return ret; -+ } -+ - cx18_init_in_work_orders(cx); - - /* start counting open_id at 1 */ -@@ -1138,6 +1156,7 @@ free_mem: - release_mem_region(cx->base_addr, CX18_MEM_SIZE); - free_workqueues: - destroy_workqueue(cx->in_work_queue); -+ destroy_workqueue(cx->out_work_queue); - err: - if (retval == 0) - retval = -ENODEV; -@@ -1291,6 +1310,7 @@ static void cx18_remove(struct pci_dev *pci_dev) - cx18_halt_firmware(cx); - - destroy_workqueue(cx->in_work_queue); -+ destroy_workqueue(cx->out_work_queue); - - cx18_streams_cleanup(cx, 1); - -diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h -index 2767c64..30404fa 100644 ---- a/drivers/media/pci/cx18/cx18-driver.h -+++ b/drivers/media/pci/cx18/cx18-driver.h -@@ -647,6 +647,9 @@ struct cx18 { - struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS]; - char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */ - -+ struct workqueue_struct *out_work_queue; -+ char out_workq_name[12]; /* "cx18-NN-out" */ -+ - /* i2c */ - struct i2c_adapter i2c_adap[2]; - struct i2c_algo_bit_data i2c_algo[2]; -diff --git a/drivers/media/pci/cx18/cx18-streams.h b/drivers/media/pci/cx18/cx18-streams.h -index 713b0e6..51765eb 100644 ---- a/drivers/media/pci/cx18/cx18-streams.h -+++ b/drivers/media/pci/cx18/cx18-streams.h -@@ -42,7 +42,8 @@ static inline bool cx18_stream_enabled(struct cx18_stream *s) - /* Related to submission of mdls to firmware */ - static inline void cx18_stream_load_fw_queue(struct cx18_stream *s) - { -- schedule_work(&s->out_work_order); -+ struct cx18 *cx = s->cx; -+ queue_work(cx->out_work_queue, &s->out_work_order); - } - - static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s, diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.38_config_of_for_of_node.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.38_config_of_for_of_node.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.38_config_of_for_of_node.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.38_config_of_for_of_node.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c -index 9ed59da..2efb88a 100644 ---- a/drivers/media/v4l2-core/v4l2-device.c -+++ b/drivers/media/v4l2-core/v4l2-device.c -@@ -130,8 +130,11 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) - * registered by us, and would not be - * re-created by just probing the V4L2 driver. - */ -- if (client && -- !client->dev.of_node) -+#ifdef CONFIG_OF -+ if (client && !client->dev.of_node) -+#else -+ if (client) -+#endif - i2c_unregister_device(client); - continue; - } -@@ -140,7 +143,11 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) - if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) { - struct spi_device *spi = v4l2_get_subdevdata(sd); - -+#ifdef CONFIG_OF - if (spi && !spi->dev.of_node) -+#else -+ if (spi) -+#endif - spi_unregister_device(spi); - continue; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index 2424946..bcede3b 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -1591,8 +1591,8 @@ struct rc_dev *rc_allocate_device(enum rc_driver_type type) - return NULL; - } - -- dev->input_dev->getkeycode = ir_getkeycode; -- dev->input_dev->setkeycode = ir_setkeycode; -+ dev->input_dev->getkeycode_new = ir_getkeycode; -+ dev->input_dev->setkeycode_new = ir_setkeycode; - input_set_drvdata(dev->input_dev, dev); - - setup_timer(&dev->timer_keyup, ir_timer_keyup, -diff --git a/drivers/media/usb/dvb-usb/dvb-usb-remote.c b/drivers/media/usb/dvb-usb/dvb-usb-remote.c -index 059ded5..6bf4dd0 100644 ---- a/drivers/media/usb/dvb-usb/dvb-usb-remote.c -+++ b/drivers/media/usb/dvb-usb/dvb-usb-remote.c -@@ -198,8 +198,8 @@ static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d) - d->input_dev = input_dev; - d->rc_dev = NULL; - -- input_dev->getkeycode = legacy_dvb_usb_getkeycode; -- input_dev->setkeycode = legacy_dvb_usb_setkeycode; -+ input_dev->getkeycode_new = legacy_dvb_usb_getkeycode; -+ input_dev->setkeycode_new = legacy_dvb_usb_setkeycode; - - /* set the bits for the keys */ - deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.0_ida2bit.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.0_ida2bit.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.0_ida2bit.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.0_ida2bit.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index a9eba0013525..1594060806b5 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -20,11 +20,14 @@ - #include - #include - #include --#include - #include - #include - #include "rc-core-priv.h" - -+/* Bitmap to store allocated device numbers from 0 to IRRCV_NUM_DEVICES - 1 */ -+#define IRRCV_NUM_DEVICES 256 -+static DECLARE_BITMAP(ir_core_dev_number, IRRCV_NUM_DEVICES); -+ - /* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */ - #define IR_TAB_MIN_SIZE 256 - #define IR_TAB_MAX_SIZE 8192 -@@ -38,9 +41,6 @@ static LIST_HEAD(rc_map_list); - static DEFINE_SPINLOCK(rc_map_lock); - static struct led_trigger *led_feedback; - --/* Used to keep track of rc devices */ --static DEFINE_IDA(rc_ida); -- - static struct rc_map_list *seek_rc_map(const char *name) - { - struct rc_map_list *map = NULL; -@@ -1723,9 +1723,13 @@ int rc_register_device(struct rc_dev *dev) - if (!dev) - return -EINVAL; - -- minor = ida_simple_get(&rc_ida, 0, RC_DEV_MAX, GFP_KERNEL); -- if (minor < 0) -- return minor; -+ do { -+ minor = find_first_zero_bit(ir_core_dev_number, -+ IRRCV_NUM_DEVICES); -+ /* No free device slots */ -+ if (minor >= IRRCV_NUM_DEVICES) -+ return -ENOMEM; -+ } while (test_and_set_bit(minor, ir_core_dev_number)); - - dev->minor = minor; - dev_set_name(&dev->dev, "rc%u", dev->minor); -@@ -1790,7 +1794,7 @@ int rc_register_device(struct rc_dev *dev) - out_raw: - ir_raw_event_free(dev); - out_minor: -- ida_simple_remove(&rc_ida, minor); -+ clear_bit(dev->minor, ir_core_dev_number); - return rc; - } - EXPORT_SYMBOL_GPL(rc_register_device); -@@ -1836,7 +1840,7 @@ void rc_unregister_device(struct rc_dev *dev) - - device_del(&dev->dev); - -- ida_simple_remove(&rc_ida, dev->minor); -+ clear_bit(dev->minor, ir_core_dev_number); - - if (!dev->managed_alloc) - rc_free_device(dev); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.10_fw_driver_probe.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.10_fw_driver_probe.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.10_fw_driver_probe.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.10_fw_driver_probe.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ ---- a/drivers/media/firewire/firedtv-fw.c 2013-07-24 14:34:38.319443243 +0200 -+++ b/drivers/media/firewire/firedtv-fw.c 2013-05-11 16:19:28.000000000 +0200 -@@ -248,7 +248,7 @@ - /* Adjust the template string if models with longer names appear. */ - #define MAX_MODEL_NAME_LEN sizeof("FireDTV ????") - --static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) -+static int node_probe(struct device *dev) - { - struct firedtv *fdtv; - char name[MAX_MODEL_NAME_LEN]; -@@ -258,8 +258,8 @@ - if (!fdtv) - return -ENOMEM; - -- dev_set_drvdata(&unit->device, fdtv); -- fdtv->device = &unit->device; -+ dev_set_drvdata(dev, fdtv); -+ fdtv->device = dev; - fdtv->isochannel = -1; - fdtv->voltage = 0xff; - fdtv->tone = 0xff; -@@ -269,7 +269,7 @@ - mutex_init(&fdtv->demux_mutex); - INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work); - -- name_len = fw_csr_string(unit->directory, CSR_MODEL, -+ name_len = fw_csr_string(fw_unit(dev)->directory, CSR_MODEL, - name, sizeof(name)); - for (i = ARRAY_SIZE(model_names); --i; ) - if (strlen(model_names[i]) <= name_len && -@@ -277,7 +277,7 @@ - break; - fdtv->type = i; - -- err = fdtv_register_rc(fdtv, &unit->device); -+ err = fdtv_register_rc(fdtv, dev); - if (err) - goto fail_free; - -@@ -307,9 +307,9 @@ - return err; - } - --static void node_remove(struct fw_unit *unit) -+static int node_remove(struct device *dev) - { -- struct firedtv *fdtv = dev_get_drvdata(&unit->device); -+ struct firedtv *fdtv = dev_get_drvdata(dev); - - fdtv_dvb_unregister(fdtv); - -@@ -320,6 +320,7 @@ - fdtv_unregister_rc(fdtv); - - kfree(fdtv); -+ return 0; - } - - static void node_update(struct fw_unit *unit) -@@ -390,10 +391,10 @@ - .owner = THIS_MODULE, - .name = "firedtv", - .bus = &fw_bus_type, -+ .probe = node_probe, -+ .remove = node_remove, - }, -- .probe = node_probe, - .update = node_update, -- .remove = node_remove, - .id_table = fdtv_id_table, - }; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.10_ir_hix5hd2.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.10_ir_hix5hd2.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.10_ir_hix5hd2.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.10_ir_hix5hd2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c -index c555ca2..37cfb68 100644 ---- a/drivers/media/rc/ir-hix5hd2.c -+++ b/drivers/media/rc/ir-hix5hd2.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.11_dev_groups.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.11_dev_groups.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.11_dev_groups.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.11_dev_groups.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c -index b5aaaac..b2f207f 100644 ---- a/drivers/media/v4l2-core/v4l2-dev.c -+++ b/drivers/media/v4l2-core/v4l2-dev.c -@@ -38,25 +38,24 @@ - * sysfs stuff - */ - --static ssize_t index_show(struct device *cd, -- struct device_attribute *attr, char *buf) -+static ssize_t show_index(struct device *cd, -+ struct device_attribute *attr, char *buf) - { - struct video_device *vdev = to_video_device(cd); - - return sprintf(buf, "%i\n", vdev->index); - } --static DEVICE_ATTR_RO(index); - --static ssize_t dev_debug_show(struct device *cd, -- struct device_attribute *attr, char *buf) -+static ssize_t show_dev_debug(struct device *cd, -+ struct device_attribute *attr, char *buf) - { - struct video_device *vdev = to_video_device(cd); - - return sprintf(buf, "%i\n", vdev->dev_debug); - } - --static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr, -- const char *buf, size_t len) -+static ssize_t set_dev_debug(struct device *cd, struct device_attribute *attr, -+ const char *buf, size_t len) - { - struct video_device *vdev = to_video_device(cd); - int res = 0; -@@ -69,24 +68,21 @@ static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr, - vdev->dev_debug = value; - return len; - } --static DEVICE_ATTR_RW(dev_debug); - --static ssize_t name_show(struct device *cd, -+static ssize_t show_name(struct device *cd, - struct device_attribute *attr, char *buf) - { - struct video_device *vdev = to_video_device(cd); - - return sprintf(buf, "%.*s\n", (int)sizeof(vdev->name), vdev->name); - } --static DEVICE_ATTR_RO(name); - --static struct attribute *video_device_attrs[] = { -- &dev_attr_name.attr, -- &dev_attr_dev_debug.attr, -- &dev_attr_index.attr, -- NULL, -+static struct device_attribute video_device_attrs[] = { -+ __ATTR(name, S_IRUGO, show_name, NULL), -+ __ATTR(dev_debug, 0644, show_dev_debug, set_dev_debug), -+ __ATTR(index, S_IRUGO, show_index, NULL), -+ __ATTR_NULL - }; --ATTRIBUTE_GROUPS(video_device); - - /* - * Active devices -@@ -221,7 +217,7 @@ static void v4l2_device_release(struct device *cd) - - static struct class video_class = { - .name = VIDEO_NAME, -- .dev_groups = video_device_groups, -+ .dev_attrs = video_device_attrs, - }; - - struct video_device *video_devdata(struct file *file) diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.12_kfifo_in.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.12_kfifo_in.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.12_kfifo_in.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.12_kfifo_in.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c -index 144304c..7d9cfce 100644 ---- a/drivers/media/rc/rc-ir-raw.c -+++ b/drivers/media/rc/rc-ir-raw.c -@@ -83,7 +83,7 @@ int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev) - IR_dprintk(2, "sample: (%05dus %s)\n", - TO_US(ev->duration), TO_STR(ev->pulse)); - -- if (!kfifo_put(&dev->raw->kfifo, *ev)) { -+ if (kfifo_in(&dev->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) { - dev_err(&dev->dev, "IR event FIFO is full!\n"); - return -ENOSPC; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.13_ddbridge_pcimsi.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.13_ddbridge_pcimsi.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.13_ddbridge_pcimsi.patch 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.13_ddbridge_pcimsi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c -index 9ab4736..50c3b4f 100644 ---- a/drivers/media/pci/ddbridge/ddbridge-main.c -+++ b/drivers/media/pci/ddbridge/ddbridge-main.c -@@ -129,13 +129,18 @@ static void ddb_irq_msi(struct ddb *dev, int nr) - int stat; - - if (msi && pci_msi_enabled()) { -- stat = pci_enable_msi_range(dev->pdev, 1, nr); -- if (stat >= 1) { -- dev->msi = stat; -- dev_info(dev->dev, "using %d MSI interrupt(s)\n", -- dev->msi); -- } else -+ stat = pci_enable_msi_block(dev->pdev, nr); -+ if (stat == 0) { -+ dev->msi = nr; -+ } else if (stat == 1) { -+ stat = pci_enable_msi(dev->pdev); -+ dev->msi = 1; -+ } -+ if (stat < 0) - dev_info(dev->dev, "MSI not available.\n"); -+ else -+ dev_info(dev->dev, "using %d MSI interrupts\n", -+ dev->msi); - } - } - #endif diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_netdev.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_netdev.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_netdev.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_netdev.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c -index 059e611..5e7052e 100644 ---- a/drivers/media/dvb-core/dvb_net.c -+++ b/drivers/media/dvb-core/dvb_net.c -@@ -1277,7 +1277,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) - return -EINVAL; - - net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", -- NET_NAME_UNKNOWN, dvb_net_setup); -+ dvb_net_setup); - if (!net) - return -ENOMEM; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_void_gpiochip_remove.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_void_gpiochip_remove.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_void_gpiochip_remove.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_void_gpiochip_remove.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c -index 95267c6..6583f29 100644 ---- a/drivers/media/dvb-frontends/cxd2820r_core.c -+++ b/drivers/media/dvb-frontends/cxd2820r_core.c -@@ -726,8 +726,10 @@ static int cxd2820r_remove(struct i2c_client *client) - dev_dbg(&client->dev, "\n"); - - #ifdef CONFIG_GPIOLIB -- if (priv->gpio_chip.label) -- gpiochip_remove(&priv->gpio_chip); -+ if (priv->gpio_chip.label) { -+ int ret = gpiochip_remove(&priv->gpio_chip); -+ (void)ret; -+ } - #endif - regmap_exit(priv->regmap[1]); - i2c_unregister_device(priv->client[1]); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_wait_on_bit.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_wait_on_bit.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.16_wait_on_bit.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.16_wait_on_bit.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c -index 2e90310..c13e604f 100644 ---- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c -+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c -@@ -253,6 +253,13 @@ static int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap) - return usb_urb_exitv2(&adap->stream); - } - -+static int wait_schedule(void *ptr) -+{ -+ schedule(); -+ -+ return 0; -+} -+ - static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) - { - struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv; -@@ -266,7 +273,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) - dvbdmxfeed->pid, dvbdmxfeed->index); - - /* wait init is done */ -- wait_on_bit(&adap->state_bits, ADAP_INIT, TASK_UNINTERRUPTIBLE); -+ wait_on_bit(&adap->state_bits, ADAP_INIT, wait_schedule, TASK_UNINTERRUPTIBLE); - - if (adap->active_fe == -1) - return -EINVAL; -@@ -561,7 +568,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) - if (!adap->suspend_resume_active) { - set_bit(ADAP_SLEEP, &adap->state_bits); - wait_on_bit(&adap->state_bits, ADAP_STREAMING, -- TASK_UNINTERRUPTIBLE); -+ wait_schedule, TASK_UNINTERRUPTIBLE); - } - - if (adap->fe_sleep[fe->id]) { diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.17_fix_clamp.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.17_fix_clamp.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.17_fix_clamp.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.17_fix_clamp.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c -index 1b184c3..3537c6f 100644 ---- a/drivers/media/pci/saa7164/saa7164-encoder.c -+++ b/drivers/media/pci/saa7164/saa7164-encoder.c -@@ -389,7 +389,7 @@ int saa7164_s_frequency(struct saa7164_port *port, - if (f->tuner != 0) - return -EINVAL; - -- port->freq = clamp(f->frequency, -+ port->freq = clamp_t(u32, f->frequency, - SAA7164_TV_MIN_FREQ, SAA7164_TV_MAX_FREQ); - - /* Update the hardware */ -diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c -index e05bfec..b132ecb 100644 ---- a/drivers/media/usb/hackrf/hackrf.c -+++ b/drivers/media/usb/hackrf/hackrf.c -@@ -1108,7 +1108,7 @@ static int hackrf_s_frequency(struct file *file, void *priv, - f->tuner, f->type, f->frequency); - - if (f->tuner == 0) { -- uitmp = clamp(f->frequency, bands_adc_dac[0].rangelow, -+ uitmp = clamp_t(u32, f->frequency, bands_adc_dac[0].rangelow, - bands_adc_dac[0].rangehigh); - if (vdev->vfl_dir == VFL_DIR_RX) { - dev->f_adc = uitmp; -@@ -1118,7 +1118,7 @@ static int hackrf_s_frequency(struct file *file, void *priv, - set_bit(TX_DAC_FREQUENCY, &dev->flags); - } - } else if (f->tuner == 1) { -- uitmp = clamp(f->frequency, bands_rx_tx[0].rangelow, -+ uitmp = clamp_t(u32, f->frequency, bands_rx_tx[0].rangelow, - bands_rx_tx[0].rangehigh); - if (vdev->vfl_dir == VFL_DIR_RX) { - dev->f_rx = uitmp; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.18_drop_property_h.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.18_drop_property_h.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.18_drop_property_h.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.18_drop_property_h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c -index dd0f0ead9516..c5b37a56b4e2 100644 ---- a/drivers/media/media-entity.c -+++ b/drivers/media/media-entity.c -@@ -18,7 +18,6 @@ - - #include - #include --#include - #include - #include - #include diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.19_get_user_pages_locked.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.19_get_user_pages_locked.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.19_get_user_pages_locked.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.19_get_user_pages_locked.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -diff --git a/mm/frame_vector.c b/mm/frame_vector.c -index 7cf2b71..1199a59 100644 ---- a/mm/frame_vector.c -+++ b/mm/frame_vector.c -@@ -58,8 +58,8 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, - if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { - vec->got_ref = true; - vec->is_pfns = false; -- ret = get_user_pages_locked(current, mm, start, nr_frames, -- write, force, (struct page **)(vec->ptrs), &locked); -+ ret = get_user_pages(current, mm, start, nr_frames, -+ write, force, (struct page **)(vec->ptrs), NULL); - goto out; - } - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_dma_buf_h.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_dma_buf_h.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_dma_buf_h.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_dma_buf_h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h -index e0b0741..707f69e 100644 ---- a/include/linux/dma-buf.h -+++ b/include/linux/dma-buf.h -@@ -214,6 +214,7 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) - get_file(dmabuf->file); - } - -+#ifdef CONFIG_DMA_SHARED_BUFFER - struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, - struct device *dev); - void dma_buf_detach(struct dma_buf *dmabuf, -@@ -242,4 +243,102 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, - unsigned long); - void *dma_buf_vmap(struct dma_buf *); - void dma_buf_vunmap(struct dma_buf *, void *vaddr); -+#else -+ -+static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, -+ struct device *dev) -+{ -+ return ERR_PTR(-ENODEV); -+} -+ -+static inline void dma_buf_detach(struct dma_buf *dmabuf, -+ struct dma_buf_attachment *dmabuf_attach) -+{ -+ return; -+} -+ -+static inline struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, -+ size_t size, int flags, struct reservation_object *resv) -+{ -+ return ERR_PTR(-ENODEV); -+} -+ -+static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags) -+{ -+ return -ENODEV; -+} -+ -+static inline struct dma_buf *dma_buf_get(int fd) -+{ -+ return ERR_PTR(-ENODEV); -+} -+ -+static inline void dma_buf_put(struct dma_buf *dmabuf) -+{ -+ return; -+} -+ -+static inline struct sg_table *dma_buf_map_attachment( -+ struct dma_buf_attachment *attach, enum dma_data_direction write) -+{ -+ return ERR_PTR(-ENODEV); -+} -+ -+static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, -+ struct sg_table *sg, enum dma_data_direction dir) -+{ -+ return; -+} -+ -+static inline int dma_buf_begin_cpu_access(struct dma_buf *dmabuf, -+ size_t start, size_t len, -+ enum dma_data_direction dir) -+{ -+ return -ENODEV; -+} -+ -+static inline void dma_buf_end_cpu_access(struct dma_buf *dmabuf, -+ size_t start, size_t len, -+ enum dma_data_direction dir) -+{ -+} -+ -+static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, -+ unsigned long pnum) -+{ -+ return NULL; -+} -+ -+static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, -+ unsigned long pnum, void *vaddr) -+{ -+} -+ -+static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum) -+{ -+ return NULL; -+} -+ -+static inline void dma_buf_kunmap(struct dma_buf *dmabuf, -+ unsigned long pnum, void *vaddr) -+{ -+} -+ -+static inline int dma_buf_mmap(struct dma_buf *dmabuf, -+ struct vm_area_struct *vma, -+ unsigned long pgoff) -+{ -+ return -ENODEV; -+} -+ -+static inline void *dma_buf_vmap(struct dma_buf *dmabuf) -+{ -+ return NULL; -+} -+ -+static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) -+{ -+} -+#endif /* CONFIG_DMA_SHARED_BUFFER */ -+ - #endif /* __DMA_BUF_H__ */ diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_export_h.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_export_h.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_export_h.patch 2017-05-08 17:35:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_export_h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -diff --git a/drivers/media/cec/cec-notifier.c b/drivers/media/cec/cec-notifier.c -index 5f5209a73665..894399639fe5 100644 ---- a/drivers/media/cec/cec-notifier.c -+++ b/drivers/media/cec/cec-notifier.c -@@ -18,7 +18,6 @@ - * SOFTWARE. - */ - --#include - #include - #include - #include -diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c -index 6ebcbc6450f5..b193ab3e8835 100644 ---- a/drivers/media/common/saa7146/saa7146_hlp.c -+++ b/drivers/media/common/saa7146/saa7146_hlp.c -@@ -1,7 +1,6 @@ - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include --#include - #include - - static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) -diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c -index bfe831c10b1c..d1aa20e6f0cd 100644 ---- a/drivers/media/common/siano/smsendian.c -+++ b/drivers/media/common/siano/smsendian.c -@@ -19,7 +19,6 @@ - - ****************************************************************/ - --#include - #include - - #include "smsendian.h" -diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c -index 760e3e424e23..feb5d759711b 100644 ---- a/drivers/media/media-device.c -+++ b/drivers/media/media-device.c -@@ -20,7 +20,6 @@ - #define __NEED_MEDIA_LEGACY_API - - #include --#include - #include - #include - #include -diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c -index 71423f45c05c..5d5bbe2a79ef 100644 ---- a/drivers/media/radio/wl128x/fmdrv_v4l2.c -+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c -@@ -24,7 +24,6 @@ - * - */ - --#include - - #include "fmdrv.h" - #include "fmdrv_v4l2.h" -diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c -index 90f66dc7c0d7..28dbe9dec42f 100644 ---- a/drivers/media/rc/rc-ir-raw.c -+++ b/drivers/media/rc/rc-ir-raw.c -@@ -12,7 +12,6 @@ - * GNU General Public License for more details. - */ - --#include - #include - #include - #include -diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c -index fcab55038d99..2b74078d60c5 100644 ---- a/drivers/media/usb/hdpvr/hdpvr-i2c.c -+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c -@@ -17,7 +17,6 @@ - - #include - #include --#include - - #include "hdpvr.h" - -diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c -index b4b364f68695..65a2cc850f0a 100644 ---- a/drivers/media/v4l2-core/v4l2-ctrls.c -+++ b/drivers/media/v4l2-core/v4l2-ctrls.c -@@ -20,7 +20,6 @@ - - #include - #include --#include - #include - #include - #include -diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c -index a75df6cb141f..2c75b64cd0f0 100644 ---- a/drivers/media/v4l2-core/v4l2-event.c -+++ b/drivers/media/v4l2-core/v4l2-event.c -@@ -23,7 +23,6 @@ - - #include - #include --#include - - static unsigned sev_pos(const struct v4l2_subscribed_event *sev, unsigned idx) - { -diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c -index 3895999bf880..02b7880b8aeb 100644 ---- a/drivers/media/v4l2-core/v4l2-fh.c -+++ b/drivers/media/v4l2-core/v4l2-fh.c -@@ -19,7 +19,6 @@ - - #include - #include --#include - #include - #include - #include -diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c -index da78497ae5ed..41e0fc1b5a69 100644 ---- a/drivers/media/v4l2-core/v4l2-subdev.c -+++ b/drivers/media/v4l2-core/v4l2-subdev.c -@@ -20,7 +20,6 @@ - #include - #include - #include --#include - - #include - #include -diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h -index 2b94662d005c..d3ed44072544 100644 ---- a/include/media/v4l2-clk.h -+++ b/include/media/v4l2-clk.h -@@ -15,7 +15,6 @@ - #define MEDIA_V4L2_CLK_H - - #include --#include - #include - #include - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_pm_qos.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_pm_qos.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.1_no_pm_qos.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.1_no_pm_qos.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c -index f1452da..6996f5e 100644 ---- a/drivers/media/pci/saa7134/saa7134-video.c -+++ b/drivers/media/pci/saa7134/saa7134-video.c -@@ -972,17 +972,6 @@ int saa7134_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) - return -EBUSY; - } - -- /* The SAA7134 has a 1K FIFO; the datasheet suggests that when -- * configured conservatively, there's 22 usec of buffering for video. -- * We therefore request a DMA latency of 20 usec, giving us 2 usec of -- * margin in case the FIFO is configured differently to the datasheet. -- * Unfortunately, I lack register-level documentation to check the -- * Linux FIFO setup and confirm the perfect value. -- */ -- if ((dmaq == &dev->video_q && !vb2_is_streaming(&dev->vbi_vbq)) || -- (dmaq == &dev->vbi_q && !vb2_is_streaming(&dev->video_vbq))) -- pm_qos_add_request(&dev->qos_request, -- PM_QOS_CPU_DMA_LATENCY, 20); - dmaq->seq_nr = 0; - - return 0; -@@ -994,10 +983,6 @@ void saa7134_vb2_stop_streaming(struct vb2_queue *vq) - struct saa7134_dev *dev = dmaq->dev; - - saa7134_stop_streaming(dev, dmaq); -- -- if ((dmaq == &dev->video_q && !vb2_is_streaming(&dev->vbi_vbq)) || -- (dmaq == &dev->vbi_q && !vb2_is_streaming(&dev->video_vbq))) -- pm_qos_remove_request(&dev->qos_request); - } - - static struct vb2_ops vb2_qops = { -diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h -index e47edd4..ad5a673 100644 ---- a/drivers/media/pci/saa7134/saa7134.h -+++ b/drivers/media/pci/saa7134/saa7134.h -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - - #include - -@@ -591,7 +590,6 @@ struct saa7134_dev { - struct saa7134_format *fmt; - unsigned int width, height; - unsigned int vbi_hlen, vbi_vlen; -- struct pm_qos_request qos_request; - - /* SAA7134_MPEG_* */ - struct saa7134_ts ts; -diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c -index b4f9d03..d91b2f9 100644 ---- a/drivers/media/platform/via-camera.c -+++ b/drivers/media/platform/via-camera.c -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -71,7 +70,6 @@ struct via_camera { - struct mutex lock; - enum viacam_opstate opstate; - unsigned long flags; -- struct pm_qos_request qos_request; - /* - * GPIO info for power/reset management - */ -@@ -1064,13 +1062,6 @@ static int viacam_streamon(struct file *filp, void *priv, enum v4l2_buf_type t) - goto out; - } - /* -- * If the CPU goes into C3, the DMA transfer gets corrupted and -- * users start filing unsightly bug reports. Put in a "latency" -- * requirement which will keep the CPU out of the deeper sleep -- * states. -- */ -- pm_qos_add_request(&cam->qos_request, PM_QOS_CPU_DMA_LATENCY, 50); -- /* - * Fire things up. - */ - INIT_LIST_HEAD(&cam->buffer_queue); -@@ -1094,7 +1085,6 @@ static int viacam_streamoff(struct file *filp, void *priv, enum v4l2_buf_type t) - ret = -EINVAL; - goto out; - } -- pm_qos_remove_request(&cam->qos_request); - viacam_stop_engine(cam); - /* - * Videobuf will recycle all of the outstanding buffers, but diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.2_alloc_ordered_workqueue.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.2_alloc_ordered_workqueue.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.2_alloc_ordered_workqueue.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.2_alloc_ordered_workqueue.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c -index 004d8ac..11ae526 100644 ---- a/drivers/media/pci/cx18/cx18-driver.c -+++ b/drivers/media/pci/cx18/cx18-driver.c -@@ -695,7 +695,7 @@ static int cx18_create_in_workq(struct cx18 *cx) - { - snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", - cx->v4l2_dev.name); -- cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name); -+ cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0); - if (cx->in_work_queue == NULL) { - CX18_ERR("Unable to create incoming mailbox handler thread\n"); - return -ENOMEM; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.2_devnode_uses_mode_t.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.2_devnode_uses_mode_t.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.2_devnode_uses_mode_t.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.2_devnode_uses_mode_t.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c -index 401ef64..fddb485 100644 ---- a/drivers/media/dvb-core/dvbdev.c -+++ b/drivers/media/dvb-core/dvbdev.c -@@ -449,7 +449,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) - return 0; - } - --static char *dvb_devnode(struct device *dev, umode_t *mode) -+static char *dvb_devnode(struct device *dev, mode_t *mode) - { - struct dvb_device *dvbdev = dev_get_drvdata(dev); - -diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c -index 36e3452..624833d 100644 ---- a/drivers/media/pci/ddbridge/ddbridge-core.c -+++ b/drivers/media/pci/ddbridge/ddbridge-core.c -@@ -1481,7 +1481,7 @@ static const struct file_operations ddb_fops = { - .open = ddb_open, - }; - --static char *ddb_devnode(struct device *device, umode_t *mode) -+static char *ddb_devnode(struct device *device, mode_t *mode) - { - struct ddb *dev = dev_get_drvdata(device); - -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index 1cf382a..7b71836 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -715,7 +715,7 @@ static void ir_close(struct input_dev *idev) - } - - /* class for /sys/class/rc */ --static char *rc_devnode(struct device *dev, umode_t *mode) -+static char *rc_devnode(struct device *dev, mode_t *mode) - { - return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.3_eprobe_defer.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.3_eprobe_defer.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.3_eprobe_defer.patch 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.3_eprobe_defer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c -index 297e10e69898..0ea394e985c7 100644 ---- a/drivers/media/v4l2-core/v4l2-clk.c -+++ b/drivers/media/v4l2-core/v4l2-clk.c -@@ -39,6 +39,7 @@ static struct v4l2_clk *v4l2_clk_find(const char *dev_id) - struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) - { - struct v4l2_clk *clk; -+#if 0 - struct clk *ccf_clk = clk_get(dev, id); - char clk_name[V4L2_CLK_NAME_SIZE]; - -@@ -55,16 +56,16 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) - - return clk; - } -- -+#endif - mutex_lock(&clk_lock); - clk = v4l2_clk_find(dev_name(dev)); -- -+#if 0 - /* if dev_name is not found, try use the OF name to find again */ - if (PTR_ERR(clk) == -ENODEV && dev->of_node) { - v4l2_clk_name_of(clk_name, sizeof(clk_name), dev->of_node); - clk = v4l2_clk_find(clk_name); - } -- -+#endif - if (!IS_ERR(clk)) - atomic_inc(&clk->use_count); - mutex_unlock(&clk_lock); -@@ -125,8 +126,10 @@ int v4l2_clk_enable(struct v4l2_clk *clk) - { - int ret; - -+#if 0 - if (clk->clk) - return clk_prepare_enable(clk->clk); -+#endif - - ret = v4l2_clk_lock_driver(clk); - if (ret < 0) -@@ -154,8 +157,10 @@ void v4l2_clk_disable(struct v4l2_clk *clk) - { - int enable; - -+#if 0 - if (clk->clk) - return clk_disable_unprepare(clk->clk); -+#endif - - mutex_lock(&clk->lock); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.4_i2c_add_mux_adapter.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.4_i2c_add_mux_adapter.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.4_i2c_add_mux_adapter.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.4_i2c_add_mux_adapter.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c -index f893cfc..abecdac 100644 ---- a/drivers/media/dvb-frontends/m88ds3103.c -+++ b/drivers/media/dvb-frontends/m88ds3103.c -@@ -1587,7 +1587,7 @@ static int m88ds3103_probe(struct i2c_client *client, - goto err_kfree; - - /* create mux i2c adapter for tuner */ -- dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, - dev, 0, 0, m88ds3103_select, - NULL); - if (dev->i2c_adapter == NULL) { -diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c -index fac1a1d..cf5d8cf 100644 ---- a/drivers/media/dvb-frontends/rtl2830.c -+++ b/drivers/media/dvb-frontends/rtl2830.c -@@ -865,7 +865,7 @@ static int rtl2830_probe(struct i2c_client *client, - goto err_regmap_exit; - - /* create muxed i2c adapter for tuner */ -- dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ dev->adapter = i2c_add_mux_adapter(client->adapter, - client, 0, 0, rtl2830_select, NULL); - if (dev->adapter == NULL) { - ret = -ENODEV; -diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c -index 87e66a8..a1e6cd2 100644 ---- a/drivers/media/dvb-frontends/rtl2832.c -+++ b/drivers/media/dvb-frontends/rtl2832.c -@@ -1262,7 +1262,7 @@ static int rtl2832_probe(struct i2c_client *client, - goto err_regmap_exit; - - /* create muxed i2c adapter for demod tuner bus */ -- dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, -+ dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, dev, - 0, 0, rtl2832_select, rtl2832_deselect); - if (dev->i2c_adapter_tuner == NULL) { - ret = -ENODEV; -diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c -index ee0a202..7df7e6b 100644 ---- a/drivers/media/dvb-frontends/si2168.c -+++ b/drivers/media/dvb-frontends/si2168.c -@@ -682,7 +682,7 @@ static int si2168_probe(struct i2c_client *client, - mutex_init(&dev->i2c_mutex); - - /* create mux i2c adapter for tuner */ -- dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ dev->adapter = i2c_add_mux_adapter(client->adapter, - client, 0, 0, si2168_select, si2168_deselect); - if (dev->adapter == NULL) { - ret = -ENODEV; -diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c -index 725c13a..35e3ac1 100644 ---- a/drivers/media/usb/cx231xx/cx231xx-i2c.c -+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c -@@ -568,11 +568,8 @@ static int cx231xx_i2c_mux_select(struct i2c_adapter *adap, - int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) - { - struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; -- /* what is the correct mux_dev? */ -- struct device *mux_dev = dev->dev; - - dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, -- mux_dev, - dev /* mux_priv */, - 0, - mux_no /* chan_id */, diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.6_i2c_add_mux_adapter.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.6_i2c_add_mux_adapter.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.6_i2c_add_mux_adapter.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.6_i2c_add_mux_adapter.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c -index 01b9ded..f893cfc 100644 ---- a/drivers/media/dvb-frontends/m88ds3103.c -+++ b/drivers/media/dvb-frontends/m88ds3103.c -@@ -1588,7 +1588,7 @@ static int m88ds3103_probe(struct i2c_client *client, - - /* create mux i2c adapter for tuner */ - dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -- dev, 0, 0, 0, m88ds3103_select, -+ dev, 0, 0, m88ds3103_select, - NULL); - if (dev->i2c_adapter == NULL) { - ret = -ENOMEM; -diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c -index e1b8df6..fac1a1d 100644 ---- a/drivers/media/dvb-frontends/rtl2830.c -+++ b/drivers/media/dvb-frontends/rtl2830.c -@@ -866,7 +866,7 @@ static int rtl2830_probe(struct i2c_client *client, - - /* create muxed i2c adapter for tuner */ - dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -- client, 0, 0, 0, rtl2830_select, NULL); -+ client, 0, 0, rtl2830_select, NULL); - if (dev->adapter == NULL) { - ret = -ENODEV; - goto err_regmap_exit; -diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c -index a57c478..87e66a8 100644 ---- a/drivers/media/dvb-frontends/rtl2832.c -+++ b/drivers/media/dvb-frontends/rtl2832.c -@@ -1263,7 +1263,7 @@ static int rtl2832_probe(struct i2c_client *client, - - /* create muxed i2c adapter for demod tuner bus */ - dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, -- 0, 0, 0, rtl2832_select, rtl2832_deselect); -+ 0, 0, rtl2832_select, rtl2832_deselect); - if (dev->i2c_adapter_tuner == NULL) { - ret = -ENODEV; - goto err_regmap_exit; -diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c -index b68ab34..ee0a202 100644 ---- a/drivers/media/dvb-frontends/si2168.c -+++ b/drivers/media/dvb-frontends/si2168.c -@@ -683,7 +683,7 @@ static int si2168_probe(struct i2c_client *client, - - /* create mux i2c adapter for tuner */ - dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -- client, 0, 0, 0, si2168_select, si2168_deselect); -+ client, 0, 0, si2168_select, si2168_deselect); - if (dev->adapter == NULL) { - ret = -ENODEV; - goto err_kfree; -diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c -index a29c345..725c13a 100644 ---- a/drivers/media/usb/cx231xx/cx231xx-i2c.c -+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c -@@ -576,7 +576,6 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) - dev /* mux_priv */, - 0, - mux_no /* chan_id */, -- 0 /* class */, - &cx231xx_i2c_mux_select, - NULL); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.6_pci_error_handlers.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.6_pci_error_handlers.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.6_pci_error_handlers.patch 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.6_pci_error_handlers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c -index 9e82d21..ea51b28 100644 ---- a/drivers/media/pci/ngene/ngene-cards.c -+++ b/drivers/media/pci/ngene/ngene-cards.c -@@ -798,7 +798,7 @@ static void ngene_resume(struct pci_dev *dev) - printk(KERN_INFO DEVICE_NAME ": resume\n"); - } - --static const struct pci_error_handlers ngene_errors = { -+static struct pci_error_handlers ngene_errors = { - .error_detected = ngene_error_detected, - .link_reset = ngene_link_reset, - .slot_reset = ngene_slot_reset, diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.8_config_of.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.8_config_of.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.8_config_of.patch 2017-06-19 18:28:36.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.8_config_of.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c -index cbd919d4edd2..e4050151f3c8 100644 ---- a/drivers/media/v4l2-core/v4l2-async.c -+++ b/drivers/media/v4l2-core/v4l2-async.c -@@ -43,12 +43,16 @@ static bool match_devname(struct v4l2_subdev *sd, - - static bool match_fwnode(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) - { -+#ifdef CONFIG_OF - if (!is_of_node(sd->fwnode) || !is_of_node(asd->match.fwnode.fwnode)) - return sd->fwnode == asd->match.fwnode.fwnode; - - return !of_node_cmp(of_node_full_name(to_of_node(sd->fwnode)), - of_node_full_name( - to_of_node(asd->match.fwnode.fwnode))); -+#else -+ return false; -+#endif - } - - static bool match_custom(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) -@@ -285,8 +289,10 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) - * (struct v4l2_subdev.dev), and async sub-device does not - * exist independently of the device at any point of time. - */ -+#ifdef CONFIG_OF - if (!sd->fwnode && sd->dev) - sd->fwnode = dev_fwnode(sd->dev); -+#endif - - mutex_lock(&list_lock); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v3.9_drxj_warnings.patch media-build-dkms-0005~trusty/media-build-0004/backports/v3.9_drxj_warnings.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v3.9_drxj_warnings.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v3.9_drxj_warnings.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c -index 7ca7a21..0ffd69b 100644 ---- a/drivers/media/dvb-frontends/drx39xyj/drxj.c -+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c -@@ -10666,8 +10666,8 @@ ctrl_sig_quality(struct drx_demod_instance *demod, - struct dtv_frontend_properties *p = &state->frontend.dtv_property_cache; - enum drx_standard standard = ext_attr->standard; - int rc; -- u32 ber, cnt, err, pkt; -- u16 mer, strength = 0; -+ u32 ber = 0, cnt, err = 0, pkt; -+ u16 mer = 0, strength = 0; - - rc = get_sig_strength(demod, &strength); - if (rc < 0) { diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_dma_buf_export.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_dma_buf_export.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_dma_buf_export.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_dma_buf_export.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c -index 620c4aa..4b62c9c 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-contig.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c -@@ -402,12 +402,6 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) - { - struct vb2_dc_buf *buf = buf_priv; - struct dma_buf *dbuf; -- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -- -- exp_info.ops = &vb2_dc_dmabuf_ops; -- exp_info.size = buf->size; -- exp_info.flags = flags; -- exp_info.priv = buf; - - if (!buf->sgt_base) - buf->sgt_base = vb2_dc_get_base_sgt(buf); -@@ -415,7 +409,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) - if (WARN_ON(!buf->sgt_base)) - return NULL; - -- dbuf = dma_buf_export(&exp_info); -+ dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL); - if (IS_ERR(dbuf)) - return NULL; - -diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c -index afd4b51..71510e4 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c -@@ -589,17 +589,11 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags - { - struct vb2_dma_sg_buf *buf = buf_priv; - struct dma_buf *dbuf; -- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -- -- exp_info.ops = &vb2_dma_sg_dmabuf_ops; -- exp_info.size = buf->size; -- exp_info.flags = flags; -- exp_info.priv = buf; - - if (WARN_ON(!buf->dma_sgt)) - return NULL; - -- dbuf = dma_buf_export(&exp_info); -+ dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL); - if (IS_ERR(dbuf)) - return NULL; - -diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c -index 0ba40be..c060cf9 100644 ---- a/drivers/media/v4l2-core/videobuf2-vmalloc.c -+++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c -@@ -372,17 +372,11 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag - { - struct vb2_vmalloc_buf *buf = buf_priv; - struct dma_buf *dbuf; -- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); -- -- exp_info.ops = &vb2_vmalloc_dmabuf_ops; -- exp_info.size = buf->size; -- exp_info.flags = flags; -- exp_info.priv = buf; - - if (WARN_ON(!buf->vaddr)) - return NULL; - -- dbuf = dma_buf_export(&exp_info); -+ dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL); - if (IS_ERR(dbuf)) - return NULL; - -diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h -index 2f0b431..e287e66 100644 ---- a/include/linux/dma-buf.h -+++ b/include/linux/dma-buf.h -@@ -208,7 +208,12 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, - void dma_buf_detach(struct dma_buf *dmabuf, - struct dma_buf_attachment *dmabuf_attach); - --struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info); -+struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, -+ size_t size, int flags, const char *, -+ struct reservation_object *); -+ -+#define dma_buf_export(priv, ops, size, flags, resv) \ -+ dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv) - - int dma_buf_fd(struct dma_buf *dmabuf, int flags); - struct dma_buf *dma_buf_get(int fd); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_drop_trace.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_drop_trace.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_drop_trace.patch 2017-08-25 07:56:26.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_drop_trace.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile -index 098ad5fd5231..2c3c61af8224 100644 ---- a/drivers/media/v4l2-core/Makefile -+++ b/drivers/media/v4l2-core/Makefile -@@ -11,9 +11,6 @@ ifeq ($(CONFIG_COMPAT),y) - videodev-objs += v4l2-compat-ioctl32.o - endif - #obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o --ifeq ($(CONFIG_TRACEPOINTS),y) -- videodev-objs += vb2-trace.o v4l2-trace.o --endif - videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o - - obj-$(CONFIG_VIDEO_V4L2) += videodev.o -diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c -index 4f27cfa134a1..3789a80f977e 100644 ---- a/drivers/media/v4l2-core/v4l2-ioctl.c -+++ b/drivers/media/v4l2-core/v4l2-ioctl.c -@@ -29,8 +29,6 @@ - #include - #include - --#include -- - /* Zero out the end of the struct pointed to by p. Everything after, but - * not including, the specified field is cleared. */ - #define CLEAR_AFTER_FIELD(p, field) \ -@@ -2877,12 +2875,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, - err = func(file, cmd, parg); - if (err == -ENOIOCTLCMD) - err = -ENOTTY; -- if (err == 0) { -- if (cmd == VIDIOC_DQBUF) -- trace_v4l2_dqbuf(video_devdata(file)->minor, parg); -- else if (cmd == VIDIOC_QBUF) -- trace_v4l2_qbuf(video_devdata(file)->minor, parg); -- } - - if (has_array_args) { - *kernel_ptr = (void __force *)user_ptr; -diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c -index c0175ea7e7ad..bf9fee755ae4 100644 ---- a/drivers/media/v4l2-core/videobuf2-core.c -+++ b/drivers/media/v4l2-core/videobuf2-core.c -@@ -27,8 +27,6 @@ - #include - #include - --#include -- - static int debug; - module_param(debug, int, 0644); - -@@ -926,7 +924,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) - atomic_dec(&q->owned_by_drv_count); - spin_unlock_irqrestore(&q->done_lock, flags); - -- trace_vb2_buf_done(q, vb); - - switch (state) { - case VB2_BUF_STATE_QUEUED: -@@ -1232,7 +1229,6 @@ static void __enqueue_in_driver(struct vb2_buffer *vb) - vb->state = VB2_BUF_STATE_ACTIVE; - atomic_inc(&q->owned_by_drv_count); - -- trace_vb2_buf_queue(q, vb); - - /* sync buffers */ - for (plane = 0; plane < vb->num_planes; ++plane) -@@ -1398,7 +1394,6 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) - if (pb) - call_void_bufop(q, copy_timestamp, vb, pb); - -- trace_vb2_qbuf(q, vb); - - /* - * If already streaming, give the buffer to driver for processing. -@@ -1614,7 +1609,6 @@ int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, - list_del(&vb->queued_entry); - q->queued_count--; - -- trace_vb2_dqbuf(q, vb); - - /* go back to dequeued state */ - __vb2_dqbuf(vb); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_fwnode.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_fwnode.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.0_fwnode.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.0_fwnode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c -index 7129e43..9ed59da 100644 ---- a/drivers/media/v4l2-core/v4l2-device.c -+++ b/drivers/media/v4l2-core/v4l2-device.c -@@ -131,7 +131,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) - * re-created by just probing the V4L2 driver. - */ - if (client && -- !client->dev.of_node && !client->dev.fwnode) -+ !client->dev.of_node) - i2c_unregister_device(client); - continue; - } -@@ -140,7 +140,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) - if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) { - struct spi_device *spi = v4l2_get_subdevdata(sd); - -- if (spi && !spi->dev.of_node && !spi->dev.fwnode) -+ if (spi && !spi->dev.of_node) - spi_unregister_device(spi); - continue; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_fault_page.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_fault_page.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_fault_page.patch 2017-03-10 00:28:25.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_fault_page.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index 0b5c43f7e020..7bb08a741fee 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -434,9 +434,8 @@ static void videobuf_vm_close(struct vm_area_struct *vma) - * now ...). Bounce buffers don't work very well for the data rates - * video capture has. - */ --static int videobuf_vm_fault(struct vm_fault *vmf) -+static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) - { -- struct vm_area_struct *vma = vmf->vma; - struct page *page; - - dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n", diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_refcount.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_refcount.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_refcount.patch 2017-04-29 07:13:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_refcount.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c -index 73cc7a67a8bc..61e1803882d9 100644 ---- a/drivers/media/pci/cx88/cx88-cards.c -+++ b/drivers/media/pci/cx88/cx88-cards.c -@@ -3670,7 +3670,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) - if (!core) - return NULL; - -- refcount_set(&core->refcount, 1); -+ atomic_inc(&core->refcount); - core->pci_bus = pci->bus->number; - core->pci_slot = PCI_SLOT(pci->devfn); - core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT | -diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c -index 8bfa5b7ed91b..973a9cd4c635 100644 ---- a/drivers/media/pci/cx88/cx88-core.c -+++ b/drivers/media/pci/cx88/cx88-core.c -@@ -1052,7 +1052,7 @@ struct cx88_core *cx88_core_get(struct pci_dev *pci) - mutex_unlock(&devlist); - return NULL; - } -- refcount_inc(&core->refcount); -+ atomic_inc(&core->refcount); - mutex_unlock(&devlist); - return core; - } -@@ -1073,7 +1073,7 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) - release_mem_region(pci_resource_start(pci, 0), - pci_resource_len(pci, 0)); - -- if (!refcount_dec_and_test(&core->refcount)) -+ if (!atomic_dec_and_test(&core->refcount)) - return; - - mutex_lock(&devlist); -diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h -index 6777926f20f2..115414cf520f 100644 ---- a/drivers/media/pci/cx88/cx88.h -+++ b/drivers/media/pci/cx88/cx88.h -@@ -24,7 +24,6 @@ - #include - #include - #include --#include - - #include - #include -@@ -340,7 +339,7 @@ struct cx8802_dev; - - struct cx88_core { - struct list_head devlist; -- refcount_t refcount; -+ atomic_t refcount; - - /* board name */ - int nr; -diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c -index d29a07f3b048..fb6a177be461 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-contig.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c -@@ -12,7 +12,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -35,7 +34,7 @@ struct vb2_dc_buf { - - /* MMAP related */ - struct vb2_vmarea_handler handler; -- refcount_t refcount; -+ atomic_t refcount; - struct sg_table *sgt_base; - - /* DMABUF related */ -@@ -87,7 +86,7 @@ static unsigned int vb2_dc_num_users(void *buf_priv) - { - struct vb2_dc_buf *buf = buf_priv; - -- return refcount_read(&buf->refcount); -+ return atomic_read(&buf->refcount); - } - - static void vb2_dc_prepare(void *buf_priv) -@@ -123,7 +122,7 @@ static void vb2_dc_put(void *buf_priv) - { - struct vb2_dc_buf *buf = buf_priv; - -- if (!refcount_dec_and_test(&buf->refcount)) -+ if (!atomic_dec_and_test(&buf->refcount)) - return; - - if (buf->sgt_base) { -@@ -171,7 +170,7 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, - buf->handler.put = vb2_dc_put; - buf->handler.arg = buf; - -- refcount_set(&buf->refcount, 1); -+ atomic_inc(&buf->refcount); - - return buf; - } -@@ -408,7 +407,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) - return NULL; - - /* dmabuf keeps reference to vb2 buffer */ -- refcount_inc(&buf->refcount); -+ atomic_inc(&buf->refcount); - - return dbuf; - } -diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c -index 29fde1a58a79..ecff8f492c4f 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c -@@ -12,7 +12,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -47,7 +46,7 @@ struct vb2_dma_sg_buf { - struct sg_table *dma_sgt; - size_t size; - unsigned int num_pages; -- refcount_t refcount; -+ atomic_t refcount; - struct vb2_vmarea_handler handler; - - struct dma_buf_attachment *db_attach; -@@ -151,7 +150,7 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, - buf->handler.put = vb2_dma_sg_put; - buf->handler.arg = buf; - -- refcount_set(&buf->refcount, 1); -+ atomic_inc(&buf->refcount); - - dprintk(1, "%s: Allocated buffer of %d pages\n", - __func__, buf->num_pages); -@@ -177,7 +176,7 @@ static void vb2_dma_sg_put(void *buf_priv) - struct sg_table *sgt = &buf->sg_table; - int i = buf->num_pages; - -- if (refcount_dec_and_test(&buf->refcount)) { -+ if (atomic_dec_and_test(&buf->refcount)) { - dprintk(1, "%s: Freeing buffer of %d pages\n", __func__, - buf->num_pages); - dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -@@ -321,7 +320,7 @@ static unsigned int vb2_dma_sg_num_users(void *buf_priv) - { - struct vb2_dma_sg_buf *buf = buf_priv; - -- return refcount_read(&buf->refcount); -+ return atomic_read(&buf->refcount); - } - - static int vb2_dma_sg_mmap(void *buf_priv, struct vm_area_struct *vma) -@@ -531,7 +530,7 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags - return NULL; - - /* dmabuf keeps reference to vb2 buffer */ -- refcount_inc(&buf->refcount); -+ atomic_inc(&buf->refcount); - - return dbuf; - } -diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c -index 4bb8424114ce..1cd322e939c7 100644 ---- a/drivers/media/v4l2-core/videobuf2-memops.c -+++ b/drivers/media/v4l2-core/videobuf2-memops.c -@@ -96,10 +96,10 @@ static void vb2_common_vm_open(struct vm_area_struct *vma) - struct vb2_vmarea_handler *h = vma->vm_private_data; - - pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n", -- __func__, h, refcount_read(h->refcount), vma->vm_start, -+ __func__, h, atomic_read(h->refcount), vma->vm_start, - vma->vm_end); - -- refcount_inc(h->refcount); -+ atomic_inc(h->refcount); - } - - /** -@@ -114,7 +114,7 @@ static void vb2_common_vm_close(struct vm_area_struct *vma) - struct vb2_vmarea_handler *h = vma->vm_private_data; - - pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n", -- __func__, h, refcount_read(h->refcount), vma->vm_start, -+ __func__, h, atomic_read(h->refcount), vma->vm_start, - vma->vm_end); - - h->put(h->arg); -diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c -index f83253a233ca..3f778147cdef 100644 ---- a/drivers/media/v4l2-core/videobuf2-vmalloc.c -+++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -27,7 +26,7 @@ struct vb2_vmalloc_buf { - struct frame_vector *vec; - enum dma_data_direction dma_dir; - unsigned long size; -- refcount_t refcount; -+ atomic_t refcount; - struct vb2_vmarea_handler handler; - struct dma_buf *dbuf; - }; -@@ -57,7 +56,7 @@ static void *vb2_vmalloc_alloc(struct device *dev, unsigned long attrs, - return ERR_PTR(-ENOMEM); - } - -- refcount_set(&buf->refcount, 1); -+ atomic_inc(&buf->refcount); - return buf; - } - -@@ -65,7 +64,7 @@ static void vb2_vmalloc_put(void *buf_priv) - { - struct vb2_vmalloc_buf *buf = buf_priv; - -- if (refcount_dec_and_test(&buf->refcount)) { -+ if (atomic_dec_and_test(&buf->refcount)) { - vfree(buf->vaddr); - kfree(buf); - } -@@ -162,7 +161,7 @@ static void *vb2_vmalloc_vaddr(void *buf_priv) - static unsigned int vb2_vmalloc_num_users(void *buf_priv) - { - struct vb2_vmalloc_buf *buf = buf_priv; -- return refcount_read(&buf->refcount); -+ return atomic_read(&buf->refcount); - } - - static int vb2_vmalloc_mmap(void *buf_priv, struct vm_area_struct *vma) -@@ -369,7 +368,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag - return NULL; - - /* dmabuf keeps reference to vb2 buffer */ -- refcount_inc(&buf->refcount); -+ atomic_inc(&buf->refcount); - - return dbuf; - } -diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h -index a6ed091b79ce..36565c7acb54 100644 ---- a/include/media/videobuf2-memops.h -+++ b/include/media/videobuf2-memops.h -@@ -16,7 +16,6 @@ - - #include - #include --#include - - /** - * struct vb2_vmarea_handler - common vma refcount tracking handler -@@ -26,7 +25,7 @@ - * @arg: argument for @put callback - */ - struct vb2_vmarea_handler { -- refcount_t *refcount; -+ atomic_t *refcount; - void (*put)(void *arg); - void *arg; - }; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_sched_signal.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_sched_signal.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.10_sched_signal.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.10_sched_signal.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c -index d38bf9bce480..bf07e367bc4e 100644 ---- a/drivers/media/dvb-core/dvb_ca_en50221.c -+++ b/drivers/media/dvb-core/dvb_ca_en50221.c -@@ -34,7 +34,7 @@ - #include - #include - #include --#include -+#include - #include - - #include "dvb_ca_en50221.h" -diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c -index 6628f80d184f..4eac71e50c5f 100644 ---- a/drivers/media/dvb-core/dvb_demux.c -+++ b/drivers/media/dvb-core/dvb_demux.c -@@ -19,7 +19,7 @@ - - #define pr_fmt(fmt) "dvb_demux: " fmt - --#include -+#include - #include - #include - #include -diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c -index e3fff8f64d37..85ae3669aa66 100644 ---- a/drivers/media/dvb-core/dvb_frontend.c -+++ b/drivers/media/dvb-core/dvb_frontend.c -@@ -29,7 +29,7 @@ - - #include - #include --#include -+#include - #include - #include - #include -diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h -index 7be2088c45fe..fef3c736fcba 100644 ---- a/drivers/media/pci/cx18/cx18-driver.h -+++ b/drivers/media/pci/cx18/cx18-driver.h -@@ -24,7 +24,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c -index e8fa99b6c7b4..e8dc69102f97 100644 ---- a/drivers/media/pci/ivtv/ivtv-driver.c -+++ b/drivers/media/pci/ivtv/ivtv-driver.c -@@ -59,7 +59,6 @@ - #include - #include - #include "tuner-xc2028.h" --#include - - /* If you have already X v4l cards, then set this to X. This way - the device numbers stay matched. Example: you have a WinTV card -diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h -index d27c5c2c07ea..cde452e30746 100644 ---- a/drivers/media/pci/ivtv/ivtv-driver.h -+++ b/drivers/media/pci/ivtv/ivtv-driver.h -@@ -38,38 +38,37 @@ - * using information provided by Jiun-Kuei Jung @ AVerMedia. - */ - --#include --#include -+#include - #include --#include -+#include - #include --#include --#include --#include - #include - #include -+#include -+#include -+#include -+#include -+#include - #include --#include -+#include -+#include - #include -+#include - #include --#include --#include -+#include - #include -+#include - #include --#include -+#include - --#include --#include -+#include -+#include -+#include - #include --#include - #include - #include - #include --#include --#include --#include -- --#include -+#include - - /* Memory layout */ - #define IVTV_ENCODER_OFFSET 0x00000000 -diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c -index 3219d2f3271e..da1eebd2016f 100644 ---- a/drivers/media/pci/pt1/pt1.c -+++ b/drivers/media/pci/pt1/pt1.c -@@ -18,7 +18,6 @@ - */ - - #include --#include - #include - #include - #include -diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c -index e8b5d0992157..77f4d15f322b 100644 ---- a/drivers/media/pci/pt3/pt3.c -+++ b/drivers/media/pci/pt3/pt3.c -@@ -21,7 +21,6 @@ - #include - #include - #include --#include - - #include "dmxdev.h" - #include "dvbdev.h" -diff --git a/drivers/media/pci/solo6x10/solo6x10-i2c.c b/drivers/media/pci/solo6x10/solo6x10-i2c.c -index 89f2f2a493c2..0456f2db5878 100644 ---- a/drivers/media/pci/solo6x10/solo6x10-i2c.c -+++ b/drivers/media/pci/solo6x10/solo6x10-i2c.c -@@ -27,7 +27,6 @@ - * thread context, ACK the interrupt, and move on. -- BenC */ - - #include --#include - - #include "solo6x10.h" - -diff --git a/drivers/media/pci/zoran/zoran_device.c b/drivers/media/pci/zoran/zoran_device.c -index 40adceebca7e..671907a6e6b6 100644 ---- a/drivers/media/pci/zoran/zoran_device.c -+++ b/drivers/media/pci/zoran/zoran_device.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - - #include - #include -diff --git a/drivers/media/platform/vivid/vivid-radio-rx.c b/drivers/media/platform/vivid/vivid-radio-rx.c -index 47c36c26096b..f99092ca8f5c 100644 ---- a/drivers/media/platform/vivid/vivid-radio-rx.c -+++ b/drivers/media/platform/vivid/vivid-radio-rx.c -@@ -22,8 +22,6 @@ - #include - #include - #include --#include -- - #include - #include - #include -diff --git a/drivers/media/platform/vivid/vivid-radio-tx.c b/drivers/media/platform/vivid/vivid-radio-tx.c -index 0e8025b7b4dd..8c59d4f53200 100644 ---- a/drivers/media/platform/vivid/vivid-radio-tx.c -+++ b/drivers/media/platform/vivid/vivid-radio-tx.c -@@ -19,7 +19,6 @@ - - #include - #include --#include - #include - #include - #include -diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c -index db1e7b70c998..fc03068e22b5 100644 ---- a/drivers/media/rc/lirc_dev.c -+++ b/drivers/media/rc/lirc_dev.c -@@ -18,7 +18,7 @@ - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - - #include --#include -+#include - #include - #include - #include -diff --git a/drivers/media/usb/cpia2/cpia2_core.c b/drivers/media/usb/cpia2/cpia2_core.c -index 0efba0da0a45..5d8aa65ab40b 100644 ---- a/drivers/media/usb/cpia2/cpia2_core.c -+++ b/drivers/media/usb/cpia2/cpia2_core.c -@@ -32,7 +32,6 @@ - #include - #include - #include --#include - - #define FIRMWARE "cpia2/stv0672_vp4.bin" - MODULE_FIRMWARE(FIRMWARE); -diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c -index e91d00762e94..23d3285f182a 100644 ---- a/drivers/media/usb/gspca/cpia1.c -+++ b/drivers/media/usb/gspca/cpia1.c -@@ -27,8 +27,6 @@ - #define MODULE_NAME "cpia1" - - #include --#include -- - #include "gspca.h" - - MODULE_AUTHOR("Hans de Goede "); -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index 0b5c43f7e020..36bd904946bd 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -21,7 +21,7 @@ - #include - #include - #include --#include -+#include - #include - #include - -diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c -index 015e41bd036e..fd61081b47d9 100644 ---- a/drivers/staging/media/lirc/lirc_zilog.c -+++ b/drivers/staging/media/lirc/lirc_zilog.c -@@ -42,7 +42,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h -index bd5312118013..b6433cc5964b 100644 ---- a/include/media/v4l2-ioctl.h -+++ b/include/media/v4l2-ioctl.h -@@ -12,7 +12,6 @@ - #include - #include - #include --#include - #include /* need __user */ - #include - -diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c -index 03f800e5ec1f..c9527804537b 100644 ---- a/drivers/media/cec/cec-pin.c -+++ b/drivers/media/cec/cec-pin.c -@@ -17,7 +17,6 @@ - - #include - #include --#include - - #include - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.12_revert_solo6x10_copykerneluser.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.12_revert_solo6x10_copykerneluser.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.12_revert_solo6x10_copykerneluser.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.12_revert_solo6x10_copykerneluser.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -commit bbf3d164ec2723f090533c14ec1dc166eaca46f8 -Author: Daniel Scheller -Date: Fri Jul 21 20:41:49 2017 +0200 - - Revert "[media] solo6x10: Convert to the new PCM ops" - - This reverts commit 1facf21e8b903524b34f09c39a7d27b4b71a07f7. - -diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c -index 3ca947092775..36e93540bb49 100644 ---- a/drivers/media/pci/solo6x10/solo6x10-g723.c -+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c -@@ -223,9 +223,9 @@ static snd_pcm_uframes_t snd_solo_pcm_pointer(struct snd_pcm_substream *ss) - return idx * G723_FRAMES_PER_PAGE; - } - --static int __snd_solo_pcm_copy(struct snd_pcm_substream *ss, -- unsigned long pos, void *dst, -- unsigned long count, bool in_kernel) -+static int snd_solo_pcm_copy(struct snd_pcm_substream *ss, int channel, -+ snd_pcm_uframes_t pos, void __user *dst, -+ snd_pcm_uframes_t count) - { - struct solo_snd_pcm *solo_pcm = snd_pcm_substream_chip(ss); - struct solo_dev *solo_dev = solo_pcm->solo_dev; -@@ -242,31 +242,16 @@ static int __snd_solo_pcm_copy(struct snd_pcm_substream *ss, - if (err) - return err; - -- if (in_kernel) -- memcpy(dst, solo_pcm->g723_buf, G723_PERIOD_BYTES); -- else if (copy_to_user((void __user *)dst, -- solo_pcm->g723_buf, G723_PERIOD_BYTES)) -+ err = copy_to_user(dst + (i * G723_PERIOD_BYTES), -+ solo_pcm->g723_buf, G723_PERIOD_BYTES); -+ -+ if (err) - return -EFAULT; -- dst += G723_PERIOD_BYTES; - } - - return 0; - } - --static int snd_solo_pcm_copy_user(struct snd_pcm_substream *ss, int channel, -- unsigned long pos, void __user *dst, -- unsigned long count) --{ -- return __snd_solo_pcm_copy(ss, pos, (void *)dst, count, false); --} -- --static int snd_solo_pcm_copy_kernel(struct snd_pcm_substream *ss, int channel, -- unsigned long pos, void *dst, -- unsigned long count) --{ -- return __snd_solo_pcm_copy(ss, pos, dst, count, true); --} -- - static const struct snd_pcm_ops snd_solo_pcm_ops = { - .open = snd_solo_pcm_open, - .close = snd_solo_pcm_close, -@@ -276,8 +261,7 @@ static const struct snd_pcm_ops snd_solo_pcm_ops = { - .prepare = snd_solo_pcm_prepare, - .trigger = snd_solo_pcm_trigger, - .pointer = snd_solo_pcm_pointer, -- .copy_user = snd_solo_pcm_copy_user, -- .copy_kernel = snd_solo_pcm_copy_kernel, -+ .copy = snd_solo_pcm_copy, - }; - - static int snd_solo_capture_volume_info(struct snd_kcontrol *kcontrol, diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.1_drop_fwnode.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.1_drop_fwnode.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.1_drop_fwnode.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.1_drop_fwnode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile -index 098ad5fd5231..c70b8d7a02b5 100644 ---- a/drivers/media/v4l2-core/Makefile -+++ b/drivers/media/v4l2-core/Makefile -@@ -10,7 +10,7 @@ videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \ - ifeq ($(CONFIG_COMPAT),y) - videodev-objs += v4l2-compat-ioctl32.o - endif --obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o -+#obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o - ifeq ($(CONFIG_TRACEPOINTS),y) - videodev-objs += vb2-trace.o v4l2-trace.o - endif -diff --git a/include/media/media-entity.h b/include/media/media-entity.h -index 754182d29668..03be03031df2 100644 ---- a/include/media/media-entity.h -+++ b/include/media/media-entity.h -@@ -21,7 +21,6 @@ - - #include - #include --#include - #include - #include - #include -diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h -index ecc1233a873e..af0a10f15d1d 100644 ---- a/include/media/v4l2-fwnode.h -+++ b/include/media/v4l2-fwnode.h -@@ -18,7 +18,6 @@ - #define _V4L2_FWNODE_H - - #include --#include - #include - #include - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.1_pat_enabled.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.1_pat_enabled.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.1_pat_enabled.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.1_pat_enabled.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c -index 8b95eef..d3372ed 100644 ---- a/drivers/media/pci/ivtv/ivtvfb.c -+++ b/drivers/media/pci/ivtv/ivtvfb.c -@@ -1174,11 +1174,13 @@ static int ivtvfb_init_card(struct ivtv *itv) - int rc; - - #ifdef CONFIG_X86_64 -- if (pat_enabled()) { -- pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n"); -+#ifdef CONFIG_X86_PAT -+ if (WARN(pat_enabled, -+ "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) { - return -ENODEV; - } - #endif -+#endif - - if (itv->osd_info) { - IVTVFB_ERR("Card %d already initialised\n", ivtvfb_card_id); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.2_atomic64.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.2_atomic64.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.2_atomic64.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.2_atomic64.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c -index 1c42a9f..205ecc6 100644 ---- a/drivers/media/rc/rc-ir-raw.c -+++ b/drivers/media/rc/rc-ir-raw.c -@@ -26,7 +26,8 @@ static LIST_HEAD(ir_raw_client_list); - /* Used to handle IR raw handler extensions */ - static DEFINE_MUTEX(ir_raw_handler_lock); - static LIST_HEAD(ir_raw_handler_list); --static atomic64_t available_protocols = ATOMIC64_INIT(0); -+static DEFINE_MUTEX(available_protocols_lock); -+static u64 available_protocols; - - static int ir_raw_event_thread(void *data) - { -@@ -233,7 +234,11 @@ EXPORT_SYMBOL_GPL(ir_raw_event_handle); - u64 - ir_raw_get_allowed_protocols(void) - { -- return atomic64_read(&available_protocols); -+ u64 protocols; -+ mutex_lock(&available_protocols_lock); -+ protocols = available_protocols; -+ mutex_unlock(&available_protocols_lock); -+ return protocols; - } - - static int change_protocol(struct rc_dev *dev, u64 *rc_type) -@@ -326,7 +331,9 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler) - if (ir_raw_handler->raw_register) - list_for_each_entry(raw, &ir_raw_client_list, list) - ir_raw_handler->raw_register(raw->dev); -- atomic64_or(ir_raw_handler->protocols, &available_protocols); -+ mutex_lock(&available_protocols_lock); -+ available_protocols |= ir_raw_handler->protocols; -+ mutex_unlock(&available_protocols_lock); - mutex_unlock(&ir_raw_handler_lock); - - return 0; -@@ -345,7 +352,9 @@ void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) - if (ir_raw_handler->raw_unregister) - ir_raw_handler->raw_unregister(raw->dev); - } -- atomic64_andnot(protocols, &available_protocols); -+ mutex_lock(&available_protocols_lock); -+ available_protocols &= ~protocols; -+ mutex_unlock(&available_protocols_lock); - mutex_unlock(&ir_raw_handler_lock); - } - EXPORT_SYMBOL(ir_raw_handler_unregister); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.2_frame_vector.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.2_frame_vector.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.2_frame_vector.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.2_frame_vector.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,250 +0,0 @@ -From fe6a2319288c1f4a66b4ffa6c8e9bf4b39349d11 Mon Sep 17 00:00:00 2001 -From: Hans Verkuil -Date: Mon, 21 Nov 2016 10:21:30 +0100 -Subject: [PATCH] Add frame_vector.c - -Signed-off-by: Hans Verkuil ---- - mm/frame_vector.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 230 insertions(+) - create mode 100644 mm/frame_vec.c - -diff --git a/mm/frame_vector.c b/mm/frame_vector.c -new file mode 100644 -index 0000000..cdabcb9 ---- /dev/null -+++ b/mm/frame_vector.c -@@ -0,0 +1,230 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * get_vaddr_frames() - map virtual addresses to pfns -+ * @start: starting user address -+ * @nr_frames: number of pages / pfns from start to map -+ * @write: whether pages will be written to by the caller -+ * @force: whether to force write access even if user mapping is -+ * readonly. See description of the same argument of -+ get_user_pages(). -+ * @vec: structure which receives pages / pfns of the addresses mapped. -+ * It should have space for at least nr_frames entries. -+ * -+ * This function maps virtual addresses from @start and fills @vec structure -+ * with page frame numbers or page pointers to corresponding pages (choice -+ * depends on the type of the vma underlying the virtual address). If @start -+ * belongs to a normal vma, the function grabs reference to each of the pages -+ * to pin them in memory. If @start belongs to VM_IO | VM_PFNMAP vma, we don't -+ * touch page structures and the caller must make sure pfns aren't reused for -+ * anything else while he is using them. -+ * -+ * The function returns number of pages mapped which may be less than -+ * @nr_frames. In particular we stop mapping if there are more vmas of -+ * different type underlying the specified range of virtual addresses. -+ * When the function isn't able to map a single page, it returns error. -+ * -+ * This function takes care of grabbing mmap_sem as necessary. -+ */ -+int get_vaddr_frames(unsigned long start, unsigned int nr_frames, -+ bool write, bool force, struct frame_vector *vec) -+{ -+ struct mm_struct *mm = current->mm; -+ struct vm_area_struct *vma; -+ int ret = 0; -+ int err; -+ int locked; -+ -+ if (nr_frames == 0) -+ return 0; -+ -+ if (WARN_ON_ONCE(nr_frames > vec->nr_allocated)) -+ nr_frames = vec->nr_allocated; -+ -+ down_read(&mm->mmap_sem); -+ locked = 1; -+ vma = find_vma_intersection(mm, start, start + 1); -+ if (!vma) { -+ ret = -EFAULT; -+ goto out; -+ } -+ if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { -+ vec->got_ref = true; -+ vec->is_pfns = false; -+ ret = get_user_pages_locked(current, mm, start, nr_frames, -+ write, force, (struct page **)(vec->ptrs), &locked); -+ goto out; -+ } -+ -+ vec->got_ref = false; -+ vec->is_pfns = true; -+ do { -+ unsigned long *nums = frame_vector_pfns(vec); -+ -+ while (ret < nr_frames && start + PAGE_SIZE <= vma->vm_end) { -+ err = follow_pfn(vma, start, &nums[ret]); -+ if (err) { -+ if (ret == 0) -+ ret = err; -+ goto out; -+ } -+ start += PAGE_SIZE; -+ ret++; -+ } -+ /* -+ * We stop if we have enough pages or if VMA doesn't completely -+ * cover the tail page. -+ */ -+ if (ret >= nr_frames || start < vma->vm_end) -+ break; -+ vma = find_vma_intersection(mm, start, start + 1); -+ } while (vma && vma->vm_flags & (VM_IO | VM_PFNMAP)); -+out: -+ if (locked) -+ up_read(&mm->mmap_sem); -+ if (!ret) -+ ret = -EFAULT; -+ if (ret > 0) -+ vec->nr_frames = ret; -+ return ret; -+} -+EXPORT_SYMBOL(get_vaddr_frames); -+ -+/** -+ * put_vaddr_frames() - drop references to pages if get_vaddr_frames() acquired -+ * them -+ * @vec: frame vector to put -+ * -+ * Drop references to pages if get_vaddr_frames() acquired them. We also -+ * invalidate the frame vector so that it is prepared for the next call into -+ * get_vaddr_frames(). -+ */ -+void put_vaddr_frames(struct frame_vector *vec) -+{ -+ int i; -+ struct page **pages; -+ -+ if (!vec->got_ref) -+ goto out; -+ pages = frame_vector_pages(vec); -+ /* -+ * frame_vector_pages() might needed to do a conversion when -+ * get_vaddr_frames() got pages but vec was later converted to pfns. -+ * But it shouldn't really fail to convert pfns back... -+ */ -+ if (WARN_ON(IS_ERR(pages))) -+ goto out; -+ for (i = 0; i < vec->nr_frames; i++) -+ put_page(pages[i]); -+ vec->got_ref = false; -+out: -+ vec->nr_frames = 0; -+} -+EXPORT_SYMBOL(put_vaddr_frames); -+ -+/** -+ * frame_vector_to_pages - convert frame vector to contain page pointers -+ * @vec: frame vector to convert -+ * -+ * Convert @vec to contain array of page pointers. If the conversion is -+ * successful, return 0. Otherwise return an error. Note that we do not grab -+ * page references for the page structures. -+ */ -+int frame_vector_to_pages(struct frame_vector *vec) -+{ -+ int i; -+ unsigned long *nums; -+ struct page **pages; -+ -+ if (!vec->is_pfns) -+ return 0; -+ nums = frame_vector_pfns(vec); -+ for (i = 0; i < vec->nr_frames; i++) -+ if (!pfn_valid(nums[i])) -+ return -EINVAL; -+ pages = (struct page **)nums; -+ for (i = 0; i < vec->nr_frames; i++) -+ pages[i] = pfn_to_page(nums[i]); -+ vec->is_pfns = false; -+ return 0; -+} -+EXPORT_SYMBOL(frame_vector_to_pages); -+ -+/** -+ * frame_vector_to_pfns - convert frame vector to contain pfns -+ * @vec: frame vector to convert -+ * -+ * Convert @vec to contain array of pfns. -+ */ -+void frame_vector_to_pfns(struct frame_vector *vec) -+{ -+ int i; -+ unsigned long *nums; -+ struct page **pages; -+ -+ if (vec->is_pfns) -+ return; -+ pages = (struct page **)(vec->ptrs); -+ nums = (unsigned long *)pages; -+ for (i = 0; i < vec->nr_frames; i++) -+ nums[i] = page_to_pfn(pages[i]); -+ vec->is_pfns = true; -+} -+EXPORT_SYMBOL(frame_vector_to_pfns); -+ -+/** -+ * frame_vector_create() - allocate & initialize structure for pinned pfns -+ * @nr_frames: number of pfns slots we should reserve -+ * -+ * Allocate and initialize struct pinned_pfns to be able to hold @nr_pfns -+ * pfns. -+ */ -+struct frame_vector *frame_vector_create(unsigned int nr_frames) -+{ -+ struct frame_vector *vec; -+ int size = sizeof(struct frame_vector) + sizeof(void *) * nr_frames; -+ -+ if (WARN_ON_ONCE(nr_frames == 0)) -+ return NULL; -+ /* -+ * This is absurdly high. It's here just to avoid strange effects when -+ * arithmetics overflows. -+ */ -+ if (WARN_ON_ONCE(nr_frames > INT_MAX / sizeof(void *) / 2)) -+ return NULL; -+ /* -+ * Avoid higher order allocations, use vmalloc instead. It should -+ * be rare anyway. -+ */ -+ if (size <= PAGE_SIZE) -+ vec = kmalloc(size, GFP_KERNEL); -+ else -+ vec = vmalloc(size); -+ if (!vec) -+ return NULL; -+ vec->nr_allocated = nr_frames; -+ vec->nr_frames = 0; -+ return vec; -+} -+EXPORT_SYMBOL(frame_vector_create); -+ -+/** -+ * frame_vector_destroy() - free memory allocated to carry frame vector -+ * @vec: Frame vector to free -+ * -+ * Free structure allocated by frame_vector_create() to carry frames. -+ */ -+void frame_vector_destroy(struct frame_vector *vec) -+{ -+ /* Make sure put_vaddr_frames() got called properly... */ -+ VM_BUG_ON(vec->nr_frames > 0); -+ kvfree(vec); -+} -+EXPORT_SYMBOL(frame_vector_destroy); --- -2.10.1 - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.4_gpio_chip_parent.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.4_gpio_chip_parent.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.4_gpio_chip_parent.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.4_gpio_chip_parent.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c -index 95267c6..7c378de 100644 ---- a/drivers/media/dvb-frontends/cxd2820r_core.c -+++ b/drivers/media/dvb-frontends/cxd2820r_core.c -@@ -662,7 +662,7 @@ static int cxd2820r_probe(struct i2c_client *client, - #ifdef CONFIG_GPIOLIB - /* Add GPIOs */ - priv->gpio_chip.label = KBUILD_MODNAME; -- priv->gpio_chip.parent = &client->dev; -+ priv->gpio_chip.dev = &client->dev; - priv->gpio_chip.owner = THIS_MODULE; - priv->gpio_chip.direction_output = cxd2820r_gpio_direction_output; - priv->gpio_chip.set = cxd2820r_gpio_set; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_get_user_pages.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_get_user_pages.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_get_user_pages.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_get_user_pages.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c -index 4769469fe842..24152accc66c 100644 ---- a/drivers/media/pci/ivtv/ivtv-udma.c -+++ b/drivers/media/pci/ivtv/ivtv-udma.c -@@ -124,8 +124,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, - } - - /* Get user pages for DMA Xfer */ -- err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, 0, -- 1, dma->map); -+ err = get_user_pages_unlocked(current, current->mm, -+ user_dma.uaddr, user_dma.page_count, 0, 1, dma->map); - - if (user_dma.page_count != err) { - IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n", -diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c -index b094054cda6e..2b8e7b2f2b86 100644 ---- a/drivers/media/pci/ivtv/ivtv-yuv.c -+++ b/drivers/media/pci/ivtv/ivtv-yuv.c -@@ -75,12 +75,14 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, - ivtv_udma_get_page_info (&uv_dma, (unsigned long)args->uv_source, 360 * uv_decode_height); - - /* Get user pages for DMA Xfer */ -- y_pages = get_user_pages_unlocked(y_dma.uaddr, -- y_dma.page_count, 0, 1, &dma->map[0]); -+ y_pages = get_user_pages_unlocked(current, current->mm, -+ y_dma.uaddr, y_dma.page_count, 0, 1, -+ &dma->map[0]); - uv_pages = 0; /* silence gcc. value is set and consumed only if: */ - if (y_pages == y_dma.page_count) { -- uv_pages = get_user_pages_unlocked(uv_dma.uaddr, -- uv_dma.page_count, 0, 1, &dma->map[y_pages]); -+ uv_pages = get_user_pages_unlocked(current, current->mm, -+ uv_dma.uaddr, uv_dma.page_count, 0, 1, -+ &dma->map[y_pages]); - } - - if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index df4c052c6bd6..f669cedca8bd 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -181,7 +181,8 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, - dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n", - data, size, dma->nr_pages); - -- err = get_user_pages(data & PAGE_MASK, dma->nr_pages, -+ err = get_user_pages(current, current->mm, -+ data & PAGE_MASK, dma->nr_pages, - rw == READ, 1, /* force */ - dma->pages, NULL); - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_gpiochip_data_pointer.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_gpiochip_data_pointer.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_gpiochip_data_pointer.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_gpiochip_data_pointer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c -index 95267c6..d980d6b 100644 ---- a/drivers/media/dvb-frontends/cxd2820r_core.c -+++ b/drivers/media/dvb-frontends/cxd2820r_core.c -@@ -434,7 +434,8 @@ static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) - static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, - int val) - { -- struct cxd2820r_priv *priv = gpiochip_get_data(chip); -+ struct cxd2820r_priv *priv = -+ container_of(chip, struct cxd2820r_priv, gpio_chip); - struct i2c_client *client = priv->client[0]; - u8 gpio[GPIO_COUNT]; - -@@ -448,7 +449,8 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, - - static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) - { -- struct cxd2820r_priv *priv = gpiochip_get_data(chip); -+ struct cxd2820r_priv *priv = -+ container_of(chip, struct cxd2820r_priv, gpio_chip); - struct i2c_client *client = priv->client[0]; - u8 gpio[GPIO_COUNT]; - -@@ -464,7 +466,8 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) - - static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr) - { -- struct cxd2820r_priv *priv = gpiochip_get_data(chip); -+ struct cxd2820r_priv *priv = -+ container_of(chip, struct cxd2820r_priv, gpio_chip); - struct i2c_client *client = priv->client[0]; - - dev_dbg(&client->dev, "nr=%u\n", nr); -@@ -670,7 +673,7 @@ static int cxd2820r_probe(struct i2c_client *client, - priv->gpio_chip.base = -1; /* Dynamic allocation */ - priv->gpio_chip.ngpio = GPIO_COUNT; - priv->gpio_chip.can_sleep = 1; -- ret = gpiochip_add_data(&priv->gpio_chip, priv); -+ ret = gpiochip_add(&priv->gpio_chip); - if (ret) - goto err_regmap_1_regmap_exit; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_uvc_super_plus.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_uvc_super_plus.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.5_uvc_super_plus.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.5_uvc_super_plus.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c -index b5589d5..075a0fe 100644 ---- a/drivers/media/usb/uvc/uvc_video.c -+++ b/drivers/media/usb/uvc/uvc_video.c -@@ -1470,7 +1470,6 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev, - - switch (dev->speed) { - case USB_SPEED_SUPER: -- case USB_SPEED_SUPER_PLUS: - return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval); - case USB_SPEED_HIGH: - psize = usb_endpoint_maxp(&ep->desc); diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.6_i2c_mux.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.6_i2c_mux.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.6_i2c_mux.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.6_i2c_mux.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1457 +0,0 @@ -diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c -index 50bce68ffd66..58440264d142 100644 ---- a/drivers/media/dvb-frontends/m88ds3103.c -+++ b/drivers/media/dvb-frontends/m88ds3103.c -@@ -1232,9 +1232,9 @@ static void m88ds3103_release(struct dvb_frontend *fe) - i2c_unregister_device(client); - } - --static int m88ds3103_select(struct i2c_mux_core *muxc, u32 chan) -+static int m88ds3103_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) - { -- struct m88ds3103_dev *dev = i2c_mux_priv(muxc); -+ struct m88ds3103_dev *dev = mux_priv; - struct i2c_client *client = dev->client; - int ret; - struct i2c_msg msg = { -@@ -1355,7 +1355,7 @@ static struct i2c_adapter *m88ds3103_get_i2c_adapter(struct i2c_client *client) - - dev_dbg(&client->dev, "\n"); - -- return dev->muxc->adapter[0]; -+ return dev->i2c_adapter; - } - - static int m88ds3103_probe(struct i2c_client *client, -@@ -1453,16 +1453,13 @@ static int m88ds3103_probe(struct i2c_client *client, - goto err_kfree; - - /* create mux i2c adapter for tuner */ -- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, 1, 0, 0, -- m88ds3103_select, NULL); -- if (!dev->muxc) { -+ dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ dev, 0, 0, 0, m88ds3103_select, -+ NULL); -+ if (dev->i2c_adapter == NULL) { - ret = -ENOMEM; - goto err_kfree; - } -- dev->muxc->priv = dev; -- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); -- if (ret) -- goto err_kfree; - - /* create dvb_frontend */ - memcpy(&dev->fe.ops, &m88ds3103_ops, sizeof(struct dvb_frontend_ops)); -@@ -1491,7 +1488,7 @@ static int m88ds3103_remove(struct i2c_client *client) - - dev_dbg(&client->dev, "\n"); - -- i2c_mux_del_adapters(dev->muxc); -+ i2c_del_mux_adapter(dev->i2c_adapter); - - kfree(dev); - return 0; -diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h b/drivers/media/dvb-frontends/m88ds3103_priv.h -index 07f20c269c67..022afcc94401 100644 ---- a/drivers/media/dvb-frontends/m88ds3103_priv.h -+++ b/drivers/media/dvb-frontends/m88ds3103_priv.h -@@ -41,7 +41,7 @@ struct m88ds3103_dev { - enum fe_status fe_status; - u32 dvbv3_ber; /* for old DVBv3 API read_ber */ - bool warm; /* FW running */ -- struct i2c_mux_core *muxc; -+ struct i2c_adapter *i2c_adapter; - /* auto detect chip id to do different config */ - u8 chip_id; - /* main mclk is calculated for M88RS6000 dynamically */ -diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c -index 7bbfe11d11ed..56e9e5b5fb51 100644 ---- a/drivers/media/dvb-frontends/rtl2830.c -+++ b/drivers/media/dvb-frontends/rtl2830.c -@@ -655,9 +655,9 @@ static int rtl2830_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, int on - * adapter lock is already taken by tuner driver. - * Gate is closed automatically after single I2C transfer. - */ --static int rtl2830_select(struct i2c_mux_core *muxc, u32 chan_id) -+static int rtl2830_select(struct i2c_adapter *adap, void *mux_priv, u32 chan_id) - { -- struct i2c_client *client = i2c_mux_priv(muxc); -+ struct i2c_client *client = mux_priv; - struct rtl2830_dev *dev = i2c_get_clientdata(client); - int ret; - -@@ -690,7 +690,7 @@ static struct i2c_adapter *rtl2830_get_i2c_adapter(struct i2c_client *client) - - dev_dbg(&client->dev, "\n"); - -- return dev->muxc->adapter[0]; -+ return dev->adapter; - } - - /* -@@ -842,16 +842,12 @@ static int rtl2830_probe(struct i2c_client *client, - goto err_regmap_exit; - - /* create muxed i2c adapter for tuner */ -- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, 1, 0, 0, -- rtl2830_select, NULL); -- if (!dev->muxc) { -- ret = -ENOMEM; -+ dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ client, 0, 0, 0, rtl2830_select, NULL); -+ if (dev->adapter == NULL) { -+ ret = -ENODEV; - goto err_regmap_exit; - } -- dev->muxc->priv = client; -- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); -- if (ret) -- goto err_regmap_exit; - - /* create dvb frontend */ - memcpy(&dev->fe.ops, &rtl2830_ops, sizeof(dev->fe.ops)); -@@ -881,7 +877,7 @@ static int rtl2830_remove(struct i2c_client *client) - - dev_dbg(&client->dev, "\n"); - -- i2c_mux_del_adapters(dev->muxc); -+ i2c_del_mux_adapter(dev->adapter); - regmap_exit(dev->regmap); - kfree(dev); - -diff --git a/drivers/media/dvb-frontends/rtl2830_priv.h b/drivers/media/dvb-frontends/rtl2830_priv.h -index 8ec4721d79ac..aa6316bb5799 100644 ---- a/drivers/media/dvb-frontends/rtl2830_priv.h -+++ b/drivers/media/dvb-frontends/rtl2830_priv.h -@@ -30,7 +30,7 @@ struct rtl2830_dev { - struct rtl2830_platform_data *pdata; - struct i2c_client *client; - struct regmap *regmap; -- struct i2c_mux_core *muxc; -+ struct i2c_adapter *adapter; - struct dvb_frontend fe; - bool sleeping; - unsigned long filters; -diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c -index 94bf5b7d6f3f..8a318a7e66a8 100644 ---- a/drivers/media/dvb-frontends/rtl2832.c -+++ b/drivers/media/dvb-frontends/rtl2832.c -@@ -153,6 +153,43 @@ static const struct rtl2832_reg_entry registers[] = { - [DVBT_REG_4MSEL] = {0x013, 0, 0}, - }; - -+/* Our regmap is bypassing I2C adapter lock, thus we do it! */ -+static int rtl2832_bulk_write(struct i2c_client *client, unsigned int reg, -+ const void *val, size_t val_count) -+{ -+ struct rtl2832_dev *dev = i2c_get_clientdata(client); -+ int ret; -+ -+ i2c_lock_adapter(client->adapter); -+ ret = regmap_bulk_write(dev->regmap, reg, val, val_count); -+ i2c_unlock_adapter(client->adapter); -+ return ret; -+} -+ -+static int rtl2832_update_bits(struct i2c_client *client, unsigned int reg, -+ unsigned int mask, unsigned int val) -+{ -+ struct rtl2832_dev *dev = i2c_get_clientdata(client); -+ int ret; -+ -+ i2c_lock_adapter(client->adapter); -+ ret = regmap_update_bits(dev->regmap, reg, mask, val); -+ i2c_unlock_adapter(client->adapter); -+ return ret; -+} -+ -+static int rtl2832_bulk_read(struct i2c_client *client, unsigned int reg, -+ void *val, size_t val_count) -+{ -+ struct rtl2832_dev *dev = i2c_get_clientdata(client); -+ int ret; -+ -+ i2c_lock_adapter(client->adapter); -+ ret = regmap_bulk_read(dev->regmap, reg, val, val_count); -+ i2c_unlock_adapter(client->adapter); -+ return ret; -+} -+ - static int rtl2832_rd_demod_reg(struct rtl2832_dev *dev, int reg, u32 *val) - { - struct i2c_client *client = dev->client; -@@ -167,7 +204,7 @@ static int rtl2832_rd_demod_reg(struct rtl2832_dev *dev, int reg, u32 *val) - len = (msb >> 3) + 1; - mask = REG_MASK(msb - lsb); - -- ret = regmap_bulk_read(dev->regmap, reg_start_addr, reading, len); -+ ret = rtl2832_bulk_read(client, reg_start_addr, reading, len); - if (ret) - goto err; - -@@ -197,7 +234,7 @@ static int rtl2832_wr_demod_reg(struct rtl2832_dev *dev, int reg, u32 val) - len = (msb >> 3) + 1; - mask = REG_MASK(msb - lsb); - -- ret = regmap_bulk_read(dev->regmap, reg_start_addr, reading, len); -+ ret = rtl2832_bulk_read(client, reg_start_addr, reading, len); - if (ret) - goto err; - -@@ -211,7 +248,7 @@ static int rtl2832_wr_demod_reg(struct rtl2832_dev *dev, int reg, u32 val) - for (i = 0; i < len; i++) - writing[i] = (writing_tmp >> ((len - 1 - i) * 8)) & 0xff; - -- ret = regmap_bulk_write(dev->regmap, reg_start_addr, writing, len); -+ ret = rtl2832_bulk_write(client, reg_start_addr, writing, len); - if (ret) - goto err; - -@@ -488,8 +525,7 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe) - } - - for (j = 0; j < sizeof(bw_params[0]); j++) { -- ret = regmap_bulk_write(dev->regmap, -- 0x11c + j, &bw_params[i][j], 1); -+ ret = rtl2832_bulk_write(client, 0x11c + j, &bw_params[i][j], 1); - if (ret) - goto err; - } -@@ -545,11 +581,11 @@ static int rtl2832_get_frontend(struct dvb_frontend *fe, - if (dev->sleeping) - return 0; - -- ret = regmap_bulk_read(dev->regmap, 0x33c, buf, 2); -+ ret = rtl2832_bulk_read(client, 0x33c, buf, 2); - if (ret) - goto err; - -- ret = regmap_bulk_read(dev->regmap, 0x351, &buf[2], 1); -+ ret = rtl2832_bulk_read(client, 0x351, &buf[2], 1); - if (ret) - goto err; - -@@ -680,7 +716,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) - /* signal strength */ - if (dev->fe_status & FE_HAS_SIGNAL) { - /* read digital AGC */ -- ret = regmap_bulk_read(dev->regmap, 0x305, &u8tmp, 1); -+ ret = rtl2832_bulk_read(client, 0x305, &u8tmp, 1); - if (ret) - goto err; - -@@ -706,7 +742,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) - {87659938, 87659938, 87885178, 88241743}, - }; - -- ret = regmap_bulk_read(dev->regmap, 0x33c, &u8tmp, 1); -+ ret = rtl2832_bulk_read(client, 0x33c, &u8tmp, 1); - if (ret) - goto err; - -@@ -718,7 +754,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) - if (hierarchy > HIERARCHY_NUM - 1) - goto err; - -- ret = regmap_bulk_read(dev->regmap, 0x40c, buf, 2); -+ ret = rtl2832_bulk_read(client, 0x40c, buf, 2); - if (ret) - goto err; - -@@ -739,7 +775,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) - - /* BER */ - if (dev->fe_status & FE_HAS_LOCK) { -- ret = regmap_bulk_read(dev->regmap, 0x34e, buf, 2); -+ ret = rtl2832_bulk_read(client, 0x34e, buf, 2); - if (ret) - goto err; - -@@ -789,6 +825,8 @@ static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber) - - /* - * I2C gate/mux/repeater logic -+ * We must use unlocked __i2c_transfer() here (through regmap) because of I2C -+ * adapter lock is already taken by tuner driver. - * There is delay mechanism to avoid unneeded I2C gate open / close. Gate close - * is delayed here a little bit in order to see if there is sequence of I2C - * messages sent to same I2C bus. -@@ -800,7 +838,7 @@ static void rtl2832_i2c_gate_work(struct work_struct *work) - int ret; - - /* close gate */ -- ret = regmap_update_bits(dev->regmap, 0x101, 0x08, 0x00); -+ ret = rtl2832_update_bits(dev->client, 0x101, 0x08, 0x00); - if (ret) - goto err; - -@@ -809,16 +847,19 @@ static void rtl2832_i2c_gate_work(struct work_struct *work) - dev_dbg(&client->dev, "failed=%d\n", ret); - } - --static int rtl2832_select(struct i2c_mux_core *muxc, u32 chan_id) -+static int rtl2832_select(struct i2c_adapter *adap, void *mux_priv, u32 chan_id) - { -- struct rtl2832_dev *dev = i2c_mux_priv(muxc); -+ struct rtl2832_dev *dev = mux_priv; - struct i2c_client *client = dev->client; - int ret; - - /* terminate possible gate closing */ - cancel_delayed_work(&dev->i2c_gate_work); - -- /* open gate */ -+ /* -+ * I2C adapter lock is already taken and due to that we will use -+ * regmap_update_bits() which does not lock again I2C adapter. -+ */ - ret = regmap_update_bits(dev->regmap, 0x101, 0x08, 0x08); - if (ret) - goto err; -@@ -829,9 +870,10 @@ static int rtl2832_select(struct i2c_mux_core *muxc, u32 chan_id) - return ret; - } - --static int rtl2832_deselect(struct i2c_mux_core *muxc, u32 chan_id) -+static int rtl2832_deselect(struct i2c_adapter *adap, void *mux_priv, -+ u32 chan_id) - { -- struct rtl2832_dev *dev = i2c_mux_priv(muxc); -+ struct rtl2832_dev *dev = mux_priv; - - schedule_delayed_work(&dev->i2c_gate_work, usecs_to_jiffies(100)); - return 0; -@@ -890,6 +932,120 @@ static bool rtl2832_volatile_reg(struct device *dev, unsigned int reg) - return false; - } - -+/* -+ * We implement own I2C access routines for regmap in order to get manual access -+ * to I2C adapter lock, which is needed for I2C mux adapter. -+ */ -+static int rtl2832_regmap_read(void *context, const void *reg_buf, -+ size_t reg_size, void *val_buf, size_t val_size) -+{ -+ struct i2c_client *client = context; -+ int ret; -+ struct i2c_msg msg[2] = { -+ { -+ .addr = client->addr, -+ .flags = 0, -+ .len = reg_size, -+ .buf = (u8 *)reg_buf, -+ }, { -+ .addr = client->addr, -+ .flags = I2C_M_RD, -+ .len = val_size, -+ .buf = val_buf, -+ } -+ }; -+ -+ ret = __i2c_transfer(client->adapter, msg, 2); -+ if (ret != 2) { -+ dev_warn(&client->dev, "i2c reg read failed %d reg %02x\n", -+ ret, *(u8 *)reg_buf); -+ if (ret >= 0) -+ ret = -EREMOTEIO; -+ return ret; -+ } -+ return 0; -+} -+ -+static int rtl2832_regmap_write(void *context, const void *data, size_t count) -+{ -+ struct i2c_client *client = context; -+ int ret; -+ struct i2c_msg msg[1] = { -+ { -+ .addr = client->addr, -+ .flags = 0, -+ .len = count, -+ .buf = (u8 *)data, -+ } -+ }; -+ -+ ret = __i2c_transfer(client->adapter, msg, 1); -+ if (ret != 1) { -+ dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", -+ ret, *(u8 *)data); -+ if (ret >= 0) -+ ret = -EREMOTEIO; -+ return ret; -+ } -+ return 0; -+} -+ -+static int rtl2832_regmap_gather_write(void *context, const void *reg, -+ size_t reg_len, const void *val, -+ size_t val_len) -+{ -+ struct i2c_client *client = context; -+ int ret; -+ u8 buf[256]; -+ struct i2c_msg msg[1] = { -+ { -+ .addr = client->addr, -+ .flags = 0, -+ .len = 1 + val_len, -+ .buf = buf, -+ } -+ }; -+ -+ buf[0] = *(u8 const *)reg; -+ memcpy(&buf[1], val, val_len); -+ -+ ret = __i2c_transfer(client->adapter, msg, 1); -+ if (ret != 1) { -+ dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", -+ ret, *(u8 const *)reg); -+ if (ret >= 0) -+ ret = -EREMOTEIO; -+ return ret; -+ } -+ return 0; -+} -+ -+/* -+ * FIXME: Hack. Implement own regmap locking in order to silence lockdep -+ * recursive lock warning. That happens when regmap I2C client calls I2C mux -+ * adapter, which leads demod I2C repeater enable via demod regmap. Operation -+ * takes two regmap locks recursively - but those are different regmap instances -+ * in a two different I2C drivers, so it is not deadlock. Proper fix is to make -+ * regmap aware of lockdep. -+ */ -+static void rtl2832_regmap_lock(void *__dev) -+{ -+ struct rtl2832_dev *dev = __dev; -+ struct i2c_client *client = dev->client; -+ -+ dev_dbg(&client->dev, "\n"); -+ mutex_lock(&dev->regmap_mutex); -+} -+ -+static void rtl2832_regmap_unlock(void *__dev) -+{ -+ struct rtl2832_dev *dev = __dev; -+ struct i2c_client *client = dev->client; -+ -+ dev_dbg(&client->dev, "\n"); -+ mutex_unlock(&dev->regmap_mutex); -+} -+ - static struct dvb_frontend *rtl2832_get_dvb_frontend(struct i2c_client *client) - { - struct rtl2832_dev *dev = i2c_get_clientdata(client); -@@ -903,7 +1059,7 @@ static struct i2c_adapter *rtl2832_get_i2c_adapter(struct i2c_client *client) - struct rtl2832_dev *dev = i2c_get_clientdata(client); - - dev_dbg(&client->dev, "\n"); -- return dev->muxc->adapter[0]; -+ return dev->i2c_adapter_tuner; - } - - static int rtl2832_slave_ts_ctrl(struct i2c_client *client, bool enable) -@@ -917,29 +1073,29 @@ static int rtl2832_slave_ts_ctrl(struct i2c_client *client, bool enable) - ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x0); - if (ret) - goto err; -- ret = regmap_bulk_write(dev->regmap, 0x10c, "\x5f\xff", 2); -+ ret = rtl2832_bulk_write(client, 0x10c, "\x5f\xff", 2); - if (ret) - goto err; - ret = rtl2832_wr_demod_reg(dev, DVBT_PIP_ON, 0x1); - if (ret) - goto err; -- ret = regmap_bulk_write(dev->regmap, 0x0bc, "\x18", 1); -+ ret = rtl2832_bulk_write(client, 0x0bc, "\x18", 1); - if (ret) - goto err; -- ret = regmap_bulk_write(dev->regmap, 0x192, "\x7f\xf7\xff", 3); -+ ret = rtl2832_bulk_write(client, 0x192, "\x7f\xf7\xff", 3); - if (ret) - goto err; - } else { -- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\x0f\xff", 3); -+ ret = rtl2832_bulk_write(client, 0x192, "\x00\x0f\xff", 3); - if (ret) - goto err; -- ret = regmap_bulk_write(dev->regmap, 0x0bc, "\x08", 1); -+ ret = rtl2832_bulk_write(client, 0x0bc, "\x08", 1); - if (ret) - goto err; - ret = rtl2832_wr_demod_reg(dev, DVBT_PIP_ON, 0x0); - if (ret) - goto err; -- ret = regmap_bulk_write(dev->regmap, 0x10c, "\x00\x00", 2); -+ ret = rtl2832_bulk_write(client, 0x10c, "\x00\x00", 2); - if (ret) - goto err; - ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x1); -@@ -971,9 +1127,9 @@ static int rtl2832_pid_filter_ctrl(struct dvb_frontend *fe, int onoff) - u8tmp = 0x00; - - if (dev->slave_ts) -- ret = regmap_update_bits(dev->regmap, 0x021, 0xc0, u8tmp); -+ ret = rtl2832_update_bits(client, 0x021, 0xc0, u8tmp); - else -- ret = regmap_update_bits(dev->regmap, 0x061, 0xc0, u8tmp); -+ ret = rtl2832_update_bits(client, 0x061, 0xc0, u8tmp); - if (ret) - goto err; - -@@ -1010,9 +1166,9 @@ static int rtl2832_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, - buf[3] = (dev->filters >> 24) & 0xff; - - if (dev->slave_ts) -- ret = regmap_bulk_write(dev->regmap, 0x022, buf, 4); -+ ret = rtl2832_bulk_write(client, 0x022, buf, 4); - else -- ret = regmap_bulk_write(dev->regmap, 0x062, buf, 4); -+ ret = rtl2832_bulk_write(client, 0x062, buf, 4); - if (ret) - goto err; - -@@ -1021,9 +1177,9 @@ static int rtl2832_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, - buf[1] = (pid >> 0) & 0xff; - - if (dev->slave_ts) -- ret = regmap_bulk_write(dev->regmap, 0x026 + 2 * index, buf, 2); -+ ret = rtl2832_bulk_write(client, 0x026 + 2 * index, buf, 2); - else -- ret = regmap_bulk_write(dev->regmap, 0x066 + 2 * index, buf, 2); -+ ret = rtl2832_bulk_write(client, 0x066 + 2 * index, buf, 2); - if (ret) - goto err; - -@@ -1041,6 +1197,12 @@ static int rtl2832_probe(struct i2c_client *client, - struct rtl2832_dev *dev; - int ret; - u8 tmp; -+ static const struct regmap_bus regmap_bus = { -+ .read = rtl2832_regmap_read, -+ .write = rtl2832_regmap_write, -+ .gather_write = rtl2832_regmap_gather_write, -+ .val_format_endian_default = REGMAP_ENDIAN_NATIVE, -+ }; - static const struct regmap_range_cfg regmap_range_cfg[] = { - { - .selector_reg = 0x00, -@@ -1069,35 +1231,36 @@ static int rtl2832_probe(struct i2c_client *client, - dev->sleeping = true; - INIT_DELAYED_WORK(&dev->i2c_gate_work, rtl2832_i2c_gate_work); - /* create regmap */ -+ mutex_init(&dev->regmap_mutex); - dev->regmap_config.reg_bits = 8, - dev->regmap_config.val_bits = 8, -+ dev->regmap_config.lock = rtl2832_regmap_lock, -+ dev->regmap_config.unlock = rtl2832_regmap_unlock, -+ dev->regmap_config.lock_arg = dev, - dev->regmap_config.volatile_reg = rtl2832_volatile_reg, - dev->regmap_config.max_register = 5 * 0x100, - dev->regmap_config.ranges = regmap_range_cfg, - dev->regmap_config.num_ranges = ARRAY_SIZE(regmap_range_cfg), - dev->regmap_config.cache_type = REGCACHE_NONE, -- dev->regmap = regmap_init_i2c(client, &dev->regmap_config); -+ dev->regmap = regmap_init(&client->dev, ®map_bus, client, -+ &dev->regmap_config); - if (IS_ERR(dev->regmap)) { - ret = PTR_ERR(dev->regmap); - goto err_kfree; - } - - /* check if the demod is there */ -- ret = regmap_bulk_read(dev->regmap, 0x000, &tmp, 1); -+ ret = rtl2832_bulk_read(client, 0x000, &tmp, 1); - if (ret) - goto err_regmap_exit; - - /* create muxed i2c adapter for demod tuner bus */ -- dev->muxc = i2c_mux_alloc(i2c, &i2c->dev, 1, 0, I2C_MUX_LOCKED, -- rtl2832_select, rtl2832_deselect); -- if (!dev->muxc) { -- ret = -ENOMEM; -+ dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, -+ 0, 0, 0, rtl2832_select, rtl2832_deselect); -+ if (dev->i2c_adapter_tuner == NULL) { -+ ret = -ENODEV; - goto err_regmap_exit; - } -- dev->muxc->priv = dev; -- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); -- if (ret) -- goto err_regmap_exit; - - /* create dvb_frontend */ - memcpy(&dev->fe.ops, &rtl2832_ops, sizeof(struct dvb_frontend_ops)); -@@ -1109,7 +1272,9 @@ static int rtl2832_probe(struct i2c_client *client, - pdata->slave_ts_ctrl = rtl2832_slave_ts_ctrl; - pdata->pid_filter = rtl2832_pid_filter; - pdata->pid_filter_ctrl = rtl2832_pid_filter_ctrl; -- pdata->regmap = dev->regmap; -+ pdata->bulk_read = rtl2832_bulk_read; -+ pdata->bulk_write = rtl2832_bulk_write; -+ pdata->update_bits = rtl2832_update_bits; - - dev_info(&client->dev, "Realtek RTL2832 successfully attached\n"); - return 0; -@@ -1130,7 +1295,7 @@ static int rtl2832_remove(struct i2c_client *client) - - cancel_delayed_work_sync(&dev->i2c_gate_work); - -- i2c_mux_del_adapters(dev->muxc); -+ i2c_del_mux_adapter(dev->i2c_adapter_tuner); - - regmap_exit(dev->regmap); - -diff --git a/drivers/media/dvb-frontends/rtl2832.h b/drivers/media/dvb-frontends/rtl2832.h -index 03c0de039fa9..6390af64cf45 100644 ---- a/drivers/media/dvb-frontends/rtl2832.h -+++ b/drivers/media/dvb-frontends/rtl2832.h -@@ -57,7 +57,9 @@ struct rtl2832_platform_data { - int (*pid_filter)(struct dvb_frontend *, u8, u16, int); - int (*pid_filter_ctrl)(struct dvb_frontend *, int); - /* private: Register access for SDR module use only */ -- struct regmap *regmap; -+ int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t); -+ int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t); -+ int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int); - }; - - #endif /* RTL2832_H */ -diff --git a/drivers/media/dvb-frontends/rtl2832_priv.h b/drivers/media/dvb-frontends/rtl2832_priv.h -index 9a6d01a9c690..8eb2e0bc1992 100644 ---- a/drivers/media/dvb-frontends/rtl2832_priv.h -+++ b/drivers/media/dvb-frontends/rtl2832_priv.h -@@ -33,9 +33,10 @@ - struct rtl2832_dev { - struct rtl2832_platform_data *pdata; - struct i2c_client *client; -+ struct mutex regmap_mutex; - struct regmap_config regmap_config; - struct regmap *regmap; -- struct i2c_mux_core *muxc; -+ struct i2c_adapter *i2c_adapter_tuner; - struct dvb_frontend fe; - enum fe_status fe_status; - u64 post_bit_error_prev; /* for old DVBv3 read_ber() calculation */ -diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c -index c6e78d870ccd..6d2863f2525c 100644 ---- a/drivers/media/dvb-frontends/rtl2832_sdr.c -+++ b/drivers/media/dvb-frontends/rtl2832_sdr.c -@@ -35,7 +35,6 @@ - #include - #include - #include --#include - - static bool rtl2832_sdr_emulated_fmt; - module_param_named(emulated_formats, rtl2832_sdr_emulated_fmt, bool, 0644); -@@ -120,7 +119,6 @@ struct rtl2832_sdr_dev { - unsigned long flags; - - struct platform_device *pdev; -- struct regmap *regmap; - - struct video_device vdev; - struct v4l2_device v4l2_dev; -@@ -165,6 +163,47 @@ struct rtl2832_sdr_dev { - unsigned long jiffies_next; - }; - -+/* write multiple registers */ -+static int rtl2832_sdr_wr_regs(struct rtl2832_sdr_dev *dev, u16 reg, -+ const u8 *val, int len) -+{ -+ struct platform_device *pdev = dev->pdev; -+ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; -+ struct i2c_client *client = pdata->i2c_client; -+ -+ return pdata->bulk_write(client, reg, val, len); -+} -+ -+#if 0 -+/* read multiple registers */ -+static int rtl2832_sdr_rd_regs(struct rtl2832_sdr_dev *dev, u16 reg, u8 *val, -+ int len) -+{ -+ struct platform_device *pdev = dev->pdev; -+ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; -+ struct i2c_client *client = pdata->i2c_client; -+ -+ return pdata->bulk_read(client, reg, val, len); -+} -+#endif -+ -+/* write single register */ -+static int rtl2832_sdr_wr_reg(struct rtl2832_sdr_dev *dev, u16 reg, u8 val) -+{ -+ return rtl2832_sdr_wr_regs(dev, reg, &val, 1); -+} -+ -+/* write single register with mask */ -+static int rtl2832_sdr_wr_reg_mask(struct rtl2832_sdr_dev *dev, u16 reg, -+ u8 val, u8 mask) -+{ -+ struct platform_device *pdev = dev->pdev; -+ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; -+ struct i2c_client *client = pdata->i2c_client; -+ -+ return pdata->update_bits(client, reg, mask, val); -+} -+ - /* Private functions */ - static struct rtl2832_sdr_frame_buf *rtl2832_sdr_get_next_fill_buf( - struct rtl2832_sdr_dev *dev) -@@ -518,11 +557,11 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) - - f_sr = dev->f_adc; - -- ret = regmap_bulk_write(dev->regmap, 0x13e, "\x00\x00", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x13e, "\x00\x00", 2); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x115, "\x00\x00\x00\x00", 4); -+ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x00\x00\x00\x00", 4); - if (ret) - goto err; - -@@ -548,7 +587,7 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) - buf[1] = (u32tmp >> 8) & 0xff; - buf[2] = (u32tmp >> 0) & 0xff; - -- ret = regmap_bulk_write(dev->regmap, 0x119, buf, 3); -+ ret = rtl2832_sdr_wr_regs(dev, 0x119, buf, 3); - if (ret) - goto err; - -@@ -562,15 +601,15 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) - u8tmp2 = 0xcd; /* enable ADC I, ADC Q */ - } - -- ret = regmap_write(dev->regmap, 0x1b1, u8tmp1); -+ ret = rtl2832_sdr_wr_reg(dev, 0x1b1, u8tmp1); - if (ret) - goto err; - -- ret = regmap_write(dev->regmap, 0x008, u8tmp2); -+ ret = rtl2832_sdr_wr_reg(dev, 0x008, u8tmp2); - if (ret) - goto err; - -- ret = regmap_write(dev->regmap, 0x006, 0x80); -+ ret = rtl2832_sdr_wr_reg(dev, 0x006, 0x80); - if (ret) - goto err; - -@@ -581,169 +620,168 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) - buf[1] = (u32tmp >> 16) & 0xff; - buf[2] = (u32tmp >> 8) & 0xff; - buf[3] = (u32tmp >> 0) & 0xff; -- ret = regmap_bulk_write(dev->regmap, 0x19f, buf, 4); -+ ret = rtl2832_sdr_wr_regs(dev, 0x19f, buf, 4); - if (ret) - goto err; - - /* low-pass filter */ -- ret = regmap_bulk_write(dev->regmap, 0x11c, -- "\xca\xdc\xd7\xd8\xe0\xf2\x0e\x35\x06\x50\x9c\x0d\x71\x11\x14\x71\x74\x19\x41\xa5", -- 20); -+ ret = rtl2832_sdr_wr_regs(dev, 0x11c, -+ "\xca\xdc\xd7\xd8\xe0\xf2\x0e\x35\x06\x50\x9c\x0d\x71\x11\x14\x71\x74\x19\x41\xa5", -+ 20); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x017, "\x11\x10", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x017, "\x11\x10", 2); - if (ret) - goto err; - - /* mode */ -- ret = regmap_write(dev->regmap, 0x019, 0x05); -+ ret = rtl2832_sdr_wr_regs(dev, 0x019, "\x05", 1); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x01a, -- "\x1b\x16\x0d\x06\x01\xff", 6); -+ ret = rtl2832_sdr_wr_regs(dev, 0x01a, "\x1b\x16\x0d\x06\x01\xff", 6); - if (ret) - goto err; - - /* FSM */ -- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\xf0\x0f", 3); -+ ret = rtl2832_sdr_wr_regs(dev, 0x192, "\x00\xf0\x0f", 3); - if (ret) - goto err; - - /* PID filter */ -- ret = regmap_write(dev->regmap, 0x061, 0x60); -+ ret = rtl2832_sdr_wr_regs(dev, 0x061, "\x60", 1); - if (ret) - goto err; - - /* used RF tuner based settings */ - switch (pdata->tuner) { - case RTL2832_SDR_TUNER_E4000: -- ret = regmap_write(dev->regmap, 0x112, 0x5a); -- ret = regmap_write(dev->regmap, 0x102, 0x40); -- ret = regmap_write(dev->regmap, 0x103, 0x5a); -- ret = regmap_write(dev->regmap, 0x1c7, 0x30); -- ret = regmap_write(dev->regmap, 0x104, 0xd0); -- ret = regmap_write(dev->regmap, 0x105, 0xbe); -- ret = regmap_write(dev->regmap, 0x1c8, 0x18); -- ret = regmap_write(dev->regmap, 0x106, 0x35); -- ret = regmap_write(dev->regmap, 0x1c9, 0x21); -- ret = regmap_write(dev->regmap, 0x1ca, 0x21); -- ret = regmap_write(dev->regmap, 0x1cb, 0x00); -- ret = regmap_write(dev->regmap, 0x107, 0x40); -- ret = regmap_write(dev->regmap, 0x1cd, 0x10); -- ret = regmap_write(dev->regmap, 0x1ce, 0x10); -- ret = regmap_write(dev->regmap, 0x108, 0x80); -- ret = regmap_write(dev->regmap, 0x109, 0x7f); -- ret = regmap_write(dev->regmap, 0x10a, 0x80); -- ret = regmap_write(dev->regmap, 0x10b, 0x7f); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x011, 0xd4); -- ret = regmap_write(dev->regmap, 0x1e5, 0xf0); -- ret = regmap_write(dev->regmap, 0x1d9, 0x00); -- ret = regmap_write(dev->regmap, 0x1db, 0x00); -- ret = regmap_write(dev->regmap, 0x1dd, 0x14); -- ret = regmap_write(dev->regmap, 0x1de, 0xec); -- ret = regmap_write(dev->regmap, 0x1d8, 0x0c); -- ret = regmap_write(dev->regmap, 0x1e6, 0x02); -- ret = regmap_write(dev->regmap, 0x1d7, 0x09); -- ret = regmap_write(dev->regmap, 0x00d, 0x83); -- ret = regmap_write(dev->regmap, 0x010, 0x49); -- ret = regmap_write(dev->regmap, 0x00d, 0x87); -- ret = regmap_write(dev->regmap, 0x00d, 0x85); -- ret = regmap_write(dev->regmap, 0x013, 0x02); -+ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x30", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xd0", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x18", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xd4", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1e5, "\xf0", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d9, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1db, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1dd, "\x14", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1de, "\xec", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d8, "\x0c", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1e6, "\x02", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d7, "\x09", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x83", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x010, "\x49", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x87", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x85", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x013, "\x02", 1); - break; - case RTL2832_SDR_TUNER_FC0012: - case RTL2832_SDR_TUNER_FC0013: -- ret = regmap_write(dev->regmap, 0x112, 0x5a); -- ret = regmap_write(dev->regmap, 0x102, 0x40); -- ret = regmap_write(dev->regmap, 0x103, 0x5a); -- ret = regmap_write(dev->regmap, 0x1c7, 0x2c); -- ret = regmap_write(dev->regmap, 0x104, 0xcc); -- ret = regmap_write(dev->regmap, 0x105, 0xbe); -- ret = regmap_write(dev->regmap, 0x1c8, 0x16); -- ret = regmap_write(dev->regmap, 0x106, 0x35); -- ret = regmap_write(dev->regmap, 0x1c9, 0x21); -- ret = regmap_write(dev->regmap, 0x1ca, 0x21); -- ret = regmap_write(dev->regmap, 0x1cb, 0x00); -- ret = regmap_write(dev->regmap, 0x107, 0x40); -- ret = regmap_write(dev->regmap, 0x1cd, 0x10); -- ret = regmap_write(dev->regmap, 0x1ce, 0x10); -- ret = regmap_write(dev->regmap, 0x108, 0x80); -- ret = regmap_write(dev->regmap, 0x109, 0x7f); -- ret = regmap_write(dev->regmap, 0x10a, 0x80); -- ret = regmap_write(dev->regmap, 0x10b, 0x7f); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_bulk_write(dev->regmap, 0x011, "\xe9\xbf", 2); -- ret = regmap_write(dev->regmap, 0x1e5, 0xf0); -- ret = regmap_write(dev->regmap, 0x1d9, 0x00); -- ret = regmap_write(dev->regmap, 0x1db, 0x00); -- ret = regmap_write(dev->regmap, 0x1dd, 0x11); -- ret = regmap_write(dev->regmap, 0x1de, 0xef); -- ret = regmap_write(dev->regmap, 0x1d8, 0x0c); -- ret = regmap_write(dev->regmap, 0x1e6, 0x02); -- ret = regmap_write(dev->regmap, 0x1d7, 0x09); -+ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x2c", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x16", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xe9\xbf", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1e5, "\xf0", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d9, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1db, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1dd, "\x11", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1de, "\xef", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d8, "\x0c", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1e6, "\x02", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1d7, "\x09", 1); - break; - case RTL2832_SDR_TUNER_R820T: - case RTL2832_SDR_TUNER_R828D: -- ret = regmap_write(dev->regmap, 0x112, 0x5a); -- ret = regmap_write(dev->regmap, 0x102, 0x40); -- ret = regmap_write(dev->regmap, 0x115, 0x01); -- ret = regmap_write(dev->regmap, 0x103, 0x80); -- ret = regmap_write(dev->regmap, 0x1c7, 0x24); -- ret = regmap_write(dev->regmap, 0x104, 0xcc); -- ret = regmap_write(dev->regmap, 0x105, 0xbe); -- ret = regmap_write(dev->regmap, 0x1c8, 0x14); -- ret = regmap_write(dev->regmap, 0x106, 0x35); -- ret = regmap_write(dev->regmap, 0x1c9, 0x21); -- ret = regmap_write(dev->regmap, 0x1ca, 0x21); -- ret = regmap_write(dev->regmap, 0x1cb, 0x00); -- ret = regmap_write(dev->regmap, 0x107, 0x40); -- ret = regmap_write(dev->regmap, 0x1cd, 0x10); -- ret = regmap_write(dev->regmap, 0x1ce, 0x10); -- ret = regmap_write(dev->regmap, 0x108, 0x80); -- ret = regmap_write(dev->regmap, 0x109, 0x7f); -- ret = regmap_write(dev->regmap, 0x10a, 0x80); -- ret = regmap_write(dev->regmap, 0x10b, 0x7f); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x011, 0xf4); -+ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x01", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x24", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x14", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xf4", 1); - break; - case RTL2832_SDR_TUNER_FC2580: -- ret = regmap_write(dev->regmap, 0x112, 0x39); -- ret = regmap_write(dev->regmap, 0x102, 0x40); -- ret = regmap_write(dev->regmap, 0x103, 0x5a); -- ret = regmap_write(dev->regmap, 0x1c7, 0x2c); -- ret = regmap_write(dev->regmap, 0x104, 0xcc); -- ret = regmap_write(dev->regmap, 0x105, 0xbe); -- ret = regmap_write(dev->regmap, 0x1c8, 0x16); -- ret = regmap_write(dev->regmap, 0x106, 0x35); -- ret = regmap_write(dev->regmap, 0x1c9, 0x21); -- ret = regmap_write(dev->regmap, 0x1ca, 0x21); -- ret = regmap_write(dev->regmap, 0x1cb, 0x00); -- ret = regmap_write(dev->regmap, 0x107, 0x40); -- ret = regmap_write(dev->regmap, 0x1cd, 0x10); -- ret = regmap_write(dev->regmap, 0x1ce, 0x10); -- ret = regmap_write(dev->regmap, 0x108, 0x80); -- ret = regmap_write(dev->regmap, 0x109, 0x7f); -- ret = regmap_write(dev->regmap, 0x10a, 0x9c); -- ret = regmap_write(dev->regmap, 0x10b, 0x7f); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_write(dev->regmap, 0x00e, 0xfc); -- ret = regmap_bulk_write(dev->regmap, 0x011, "\xe9\xf4", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x39", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x2c", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x16", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x9c", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); -+ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xe9\xf4", 2); - break; - default: - dev_notice(&pdev->dev, "Unsupported tuner\n"); - } - - /* software reset */ -- ret = regmap_update_bits(dev->regmap, 0x101, 0x04, 0x04); -+ ret = rtl2832_sdr_wr_reg_mask(dev, 0x101, 0x04, 0x04); - if (ret) - goto err; - -- ret = regmap_update_bits(dev->regmap, 0x101, 0x04, 0x00); -+ ret = rtl2832_sdr_wr_reg_mask(dev, 0x101, 0x00, 0x04); - if (ret) - goto err; - err: -@@ -758,29 +796,29 @@ static void rtl2832_sdr_unset_adc(struct rtl2832_sdr_dev *dev) - dev_dbg(&pdev->dev, "\n"); - - /* PID filter */ -- ret = regmap_write(dev->regmap, 0x061, 0xe0); -+ ret = rtl2832_sdr_wr_regs(dev, 0x061, "\xe0", 1); - if (ret) - goto err; - - /* mode */ -- ret = regmap_write(dev->regmap, 0x019, 0x20); -+ ret = rtl2832_sdr_wr_regs(dev, 0x019, "\x20", 1); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x017, "\x11\x10", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x017, "\x11\x10", 2); - if (ret) - goto err; - - /* FSM */ -- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\x0f\xff", 3); -+ ret = rtl2832_sdr_wr_regs(dev, 0x192, "\x00\x0f\xff", 3); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x13e, "\x40\x00", 2); -+ ret = rtl2832_sdr_wr_regs(dev, 0x13e, "\x40\x00", 2); - if (ret) - goto err; - -- ret = regmap_bulk_write(dev->regmap, 0x115, "\x06\x3f\xce\xcc", 4); -+ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x06\x3f\xce\xcc", 4); - if (ret) - goto err; - err: -@@ -1360,7 +1398,6 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) - subdev = pdata->v4l2_subdev; - dev->v4l2_subdev = pdata->v4l2_subdev; - dev->pdev = pdev; -- dev->regmap = pdata->regmap; - dev->udev = pdata->dvb_usb_device->udev; - dev->f_adc = bands_adc[0].rangelow; - dev->f_tuner = bands_fm[0].rangelow; -diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.h b/drivers/media/dvb-frontends/rtl2832_sdr.h -index d8fc7e7212e3..342ea84860df 100644 ---- a/drivers/media/dvb-frontends/rtl2832_sdr.h -+++ b/drivers/media/dvb-frontends/rtl2832_sdr.h -@@ -56,7 +56,10 @@ struct rtl2832_sdr_platform_data { - #define RTL2832_SDR_TUNER_R828D 0x2b - u8 tuner; - -- struct regmap *regmap; -+ struct i2c_client *i2c_client; -+ int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t); -+ int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t); -+ int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int); - struct dvb_frontend *dvb_frontend; - struct v4l2_subdev *v4l2_subdev; - struct dvb_usb_device *dvb_usb_device; -diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c -index 172fc367ccaa..cc4178f80704 100644 ---- a/drivers/media/dvb-frontends/si2168.c -+++ b/drivers/media/dvb-frontends/si2168.c -@@ -18,23 +18,53 @@ - - static const struct dvb_frontend_ops si2168_ops; - -+/* Own I2C adapter locking is needed because of I2C gate logic. */ -+static int si2168_i2c_master_send_unlocked(const struct i2c_client *client, -+ const char *buf, int count) -+{ -+ int ret; -+ struct i2c_msg msg = { -+ .addr = client->addr, -+ .flags = 0, -+ .len = count, -+ .buf = (char *)buf, -+ }; -+ -+ ret = __i2c_transfer(client->adapter, &msg, 1); -+ return (ret == 1) ? count : ret; -+} -+ -+static int si2168_i2c_master_recv_unlocked(const struct i2c_client *client, -+ char *buf, int count) -+{ -+ int ret; -+ struct i2c_msg msg = { -+ .addr = client->addr, -+ .flags = I2C_M_RD, -+ .len = count, -+ .buf = buf, -+ }; -+ -+ ret = __i2c_transfer(client->adapter, &msg, 1); -+ return (ret == 1) ? count : ret; -+} -+ - /* execute firmware command */ --static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) -+static int si2168_cmd_execute_unlocked(struct i2c_client *client, -+ struct si2168_cmd *cmd) - { -- struct si2168_dev *dev = i2c_get_clientdata(client); - int ret; - unsigned long timeout; - -- mutex_lock(&dev->i2c_mutex); -- - if (cmd->wlen) { - /* write cmd and args for firmware */ -- ret = i2c_master_send(client, cmd->args, cmd->wlen); -+ ret = si2168_i2c_master_send_unlocked(client, cmd->args, -+ cmd->wlen); - if (ret < 0) { -- goto err_mutex_unlock; -+ goto err; - } else if (ret != cmd->wlen) { - ret = -EREMOTEIO; -- goto err_mutex_unlock; -+ goto err; - } - } - -@@ -43,12 +73,13 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) - #define TIMEOUT 70 - timeout = jiffies + msecs_to_jiffies(TIMEOUT); - while (!time_after(jiffies, timeout)) { -- ret = i2c_master_recv(client, cmd->args, cmd->rlen); -+ ret = si2168_i2c_master_recv_unlocked(client, cmd->args, -+ cmd->rlen); - if (ret < 0) { -- goto err_mutex_unlock; -+ goto err; - } else if (ret != cmd->rlen) { - ret = -EREMOTEIO; -- goto err_mutex_unlock; -+ goto err; - } - - /* firmware ready? */ -@@ -63,23 +94,32 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) - /* error bit set? */ - if ((cmd->args[0] >> 6) & 0x01) { - ret = -EREMOTEIO; -- goto err_mutex_unlock; -+ goto err; - } - - if (!((cmd->args[0] >> 7) & 0x01)) { - ret = -ETIMEDOUT; -- goto err_mutex_unlock; -+ goto err; - } - } - -- mutex_unlock(&dev->i2c_mutex); - return 0; --err_mutex_unlock: -- mutex_unlock(&dev->i2c_mutex); -+err: - dev_dbg(&client->dev, "failed=%d\n", ret); - return ret; - } - -+static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) -+{ -+ int ret; -+ -+ i2c_lock_adapter(client->adapter); -+ ret = si2168_cmd_execute_unlocked(client, cmd); -+ i2c_unlock_adapter(client->adapter); -+ -+ return ret; -+} -+ - static int si2168_read_status(struct dvb_frontend *fe, enum fe_status *status) - { - struct i2c_client *client = fe->demodulator_priv; -@@ -606,9 +646,14 @@ static int si2168_get_tune_settings(struct dvb_frontend *fe, - return 0; - } - --static int si2168_select(struct i2c_mux_core *muxc, u32 chan) -+/* -+ * I2C gate logic -+ * We must use unlocked I2C I/O because I2C adapter lock is already taken -+ * by the caller (usually tuner driver). -+ */ -+static int si2168_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) - { -- struct i2c_client *client = i2c_mux_priv(muxc); -+ struct i2c_client *client = mux_priv; - int ret; - struct si2168_cmd cmd; - -@@ -616,7 +661,7 @@ static int si2168_select(struct i2c_mux_core *muxc, u32 chan) - memcpy(cmd.args, "\xc0\x0d\x01", 3); - cmd.wlen = 3; - cmd.rlen = 0; -- ret = si2168_cmd_execute(client, &cmd); -+ ret = si2168_cmd_execute_unlocked(client, &cmd); - if (ret) - goto err; - -@@ -626,9 +671,9 @@ static int si2168_select(struct i2c_mux_core *muxc, u32 chan) - return ret; - } - --static int si2168_deselect(struct i2c_mux_core *muxc, u32 chan) -+static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan) - { -- struct i2c_client *client = i2c_mux_priv(muxc); -+ struct i2c_client *client = mux_priv; - int ret; - struct si2168_cmd cmd; - -@@ -636,7 +681,7 @@ static int si2168_deselect(struct i2c_mux_core *muxc, u32 chan) - memcpy(cmd.args, "\xc0\x0d\x00", 3); - cmd.wlen = 3; - cmd.rlen = 0; -- ret = si2168_cmd_execute(client, &cmd); -+ ret = si2168_cmd_execute_unlocked(client, &cmd); - if (ret) - goto err; - -@@ -701,7 +746,6 @@ static int si2168_probe(struct i2c_client *client, - } - - i2c_set_clientdata(client, dev); -- mutex_init(&dev->i2c_mutex); - - /* Initialize */ - memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13); -@@ -754,22 +798,17 @@ static int si2168_probe(struct i2c_client *client, - (cmd.args[4] - '0') << 8 | (cmd.args[5]) << 0; - - /* create mux i2c adapter for tuner */ -- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, -- 1, 0, I2C_MUX_LOCKED, -- si2168_select, si2168_deselect); -- if (!dev->muxc) { -- ret = -ENOMEM; -+ dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, -+ client, 0, 0, 0, si2168_select, si2168_deselect); -+ if (dev->adapter == NULL) { -+ ret = -ENODEV; - goto err_kfree; - } -- dev->muxc->priv = client; -- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); -- if (ret) -- goto err_kfree; - - /* create dvb_frontend */ - memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops)); - dev->fe.demodulator_priv = client; -- *config->i2c_adapter = dev->muxc->adapter[0]; -+ *config->i2c_adapter = dev->adapter; - *config->fe = &dev->fe; - dev->ts_mode = config->ts_mode; - dev->ts_clock_inv = config->ts_clock_inv; -@@ -796,7 +835,7 @@ static int si2168_remove(struct i2c_client *client) - - dev_dbg(&client->dev, "\n"); - -- i2c_mux_del_adapters(dev->muxc); -+ i2c_del_mux_adapter(dev->adapter); - - dev->fe.ops.release = NULL; - dev->fe.demodulator_priv = NULL; -diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h -index 737cf416fbb2..d5c2720f926d 100644 ---- a/drivers/media/dvb-frontends/si2168_priv.h -+++ b/drivers/media/dvb-frontends/si2168_priv.h -@@ -31,8 +31,7 @@ - - /* state struct */ - struct si2168_dev { -- struct mutex i2c_mutex; -- struct i2c_mux_core *muxc; -+ struct i2c_adapter *adapter; - struct dvb_frontend fe; - enum fe_delivery_system delivery_system; - enum fe_status fe_status; -diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c -index f372ad3917a8..8c450dfad905 100644 ---- a/drivers/media/usb/cx231xx/cx231xx-core.c -+++ b/drivers/media/usb/cx231xx/cx231xx-core.c -@@ -1340,12 +1340,6 @@ int cx231xx_dev_init(struct cx231xx *dev) - if (errCode < 0) - return errCode; - -- errCode = cx231xx_i2c_mux_create(dev); -- if (errCode < 0) { -- dev_err(dev->dev, -- "%s: Failed to create I2C mux\n", __func__); -- return errCode; -- } - errCode = cx231xx_i2c_mux_register(dev, 0); - if (errCode < 0) - return errCode; -@@ -1473,7 +1467,8 @@ EXPORT_SYMBOL_GPL(cx231xx_dev_init); - void cx231xx_dev_uninit(struct cx231xx *dev) - { - /* Un Initialize I2C bus */ -- cx231xx_i2c_mux_unregister(dev); -+ cx231xx_i2c_mux_unregister(dev, 1); -+ cx231xx_i2c_mux_unregister(dev, 0); - cx231xx_i2c_unregister(&dev->i2c_bus[2]); - cx231xx_i2c_unregister(&dev->i2c_bus[1]); - cx231xx_i2c_unregister(&dev->i2c_bus[0]); -diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c -index 8ce6b815d16d..5baeff70605f 100644 ---- a/drivers/media/usb/cx231xx/cx231xx-i2c.c -+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c -@@ -561,34 +561,35 @@ void cx231xx_i2c_unregister(struct cx231xx_i2c *bus) - * cx231xx_i2c_mux_select() - * switch i2c master number 1 between port1 and port3 - */ --static int cx231xx_i2c_mux_select(struct i2c_mux_core *muxc, u32 chan_id) -+static int cx231xx_i2c_mux_select(struct i2c_adapter *adap, -+ void *mux_priv, u32 chan_id) - { -- struct cx231xx *dev = i2c_mux_priv(muxc); -+ struct cx231xx *dev = mux_priv; - - return cx231xx_enable_i2c_port_3(dev, chan_id); - } - --int cx231xx_i2c_mux_create(struct cx231xx *dev) --{ -- dev->muxc = i2c_mux_alloc(&dev->i2c_bus[1].i2c_adap, dev->dev, 2, 0, 0, -- cx231xx_i2c_mux_select, NULL); -- if (!dev->muxc) -- return -ENOMEM; -- dev->muxc->priv = dev; -- return 0; --} -- - int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) - { -- return i2c_mux_add_adapter(dev->muxc, -- 0, -- mux_no /* chan_id */, -- 0 /* class */); -+ struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; -+ /* what is the correct mux_dev? */ -+ struct device *mux_dev = dev->dev; -+ -+ dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, -+ mux_dev, -+ dev /* mux_priv */, -+ 0, -+ mux_no /* chan_id */, -+ 0 /* class */, -+ &cx231xx_i2c_mux_select, -+ NULL); -+ return dev->i2c_mux_adap[mux_no] ? 0 : -ENOMEM; - } - --void cx231xx_i2c_mux_unregister(struct cx231xx *dev) -+void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no) - { -- i2c_mux_del_adapters(dev->muxc); -+ i2c_del_mux_adapter(dev->i2c_mux_adap[mux_no]); -+ dev->i2c_mux_adap[mux_no] = NULL; - } - - struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port) -@@ -601,9 +602,9 @@ struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port) - case I2C_2: - return &dev->i2c_bus[2].i2c_adap; - case I2C_1_MUX_1: -- return dev->muxc->adapter[0]; -+ return dev->i2c_mux_adap[0]; - case I2C_1_MUX_3: -- return dev->muxc->adapter[1]; -+ return dev->i2c_mux_adap[1]; - default: - BUG(); - } -diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h -index 72d5937a087e..1c2a589a4048 100644 ---- a/drivers/media/usb/cx231xx/cx231xx.h -+++ b/drivers/media/usb/cx231xx/cx231xx.h -@@ -626,7 +626,6 @@ struct cx231xx { - - /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */ - struct cx231xx_i2c i2c_bus[3]; -- struct i2c_mux_core *muxc; - struct i2c_adapter *i2c_mux_adap[2]; - - unsigned int xc_fw_load_done:1; -@@ -763,9 +762,8 @@ int cx231xx_reset_analog_tuner(struct cx231xx *dev); - void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port); - int cx231xx_i2c_register(struct cx231xx_i2c *bus); - void cx231xx_i2c_unregister(struct cx231xx_i2c *bus); --int cx231xx_i2c_mux_create(struct cx231xx *dev); - int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no); --void cx231xx_i2c_mux_unregister(struct cx231xx *dev); -+void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no); - struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port); - - /* Internal block control functions */ -diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c -index e16ca07acf1d..8372d165fd3e 100644 ---- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c -+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c -@@ -1333,7 +1333,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) - case TUNER_RTL2832_R828D: - pdata.clk = dev->rtl2832_platform_data.clk; - pdata.tuner = dev->tuner; -- pdata.regmap = dev->rtl2832_platform_data.regmap; -+ pdata.i2c_client = dev->i2c_client_demod; -+ pdata.bulk_read = dev->rtl2832_platform_data.bulk_read; -+ pdata.bulk_write = dev->rtl2832_platform_data.bulk_write; -+ pdata.update_bits = dev->rtl2832_platform_data.update_bits; - pdata.dvb_frontend = adap->fe[0]; - pdata.dvb_usb_device = d; - pdata.v4l2_subdev = subdev; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.7_dma_attrs.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.7_dma_attrs.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.7_dma_attrs.patch 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.7_dma_attrs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,321 +0,0 @@ -diff --git a/drivers/media/platform/sti/bdisp/bdisp-hw.c b/drivers/media/platform/sti/bdisp/bdisp-hw.c -index b7892f3..3df66d1 100644 ---- a/drivers/media/platform/sti/bdisp/bdisp-hw.c -+++ b/drivers/media/platform/sti/bdisp/bdisp-hw.c -@@ -430,11 +430,14 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp) - */ - void bdisp_hw_free_nodes(struct bdisp_ctx *ctx) - { -- if (ctx && ctx->node[0]) -+ if (ctx && ctx->node[0]) { -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); - dma_free_attrs(ctx->bdisp_dev->dev, - sizeof(struct bdisp_node) * MAX_NB_NODE, -- ctx->node[0], ctx->node_paddr[0], -- DMA_ATTR_WRITE_COMBINE); -+ ctx->node[0], ctx->node_paddr[0], &attrs); -+ } - } - - /** -@@ -452,10 +455,12 @@ int bdisp_hw_alloc_nodes(struct bdisp_ctx *ctx) - unsigned int i, node_size = sizeof(struct bdisp_node); - void *base; - dma_addr_t paddr; -+ DEFINE_DMA_ATTRS(attrs); - - /* Allocate all the nodes within a single memory page */ -+ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); - base = dma_alloc_attrs(dev, node_size * MAX_NB_NODE, &paddr, -- GFP_KERNEL | GFP_DMA, DMA_ATTR_WRITE_COMBINE); -+ GFP_KERNEL | GFP_DMA, &attrs); - if (!base) { - dev_err(dev, "%s no mem\n", __func__); - return -ENOMEM; -@@ -488,9 +493,13 @@ void bdisp_hw_free_filters(struct device *dev) - { - int size = (BDISP_HF_NB * NB_H_FILTER) + (BDISP_VF_NB * NB_V_FILTER); - -- if (bdisp_h_filter[0].virt) -+ if (bdisp_h_filter[0].virt) { -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); - dma_free_attrs(dev, size, bdisp_h_filter[0].virt, -- bdisp_h_filter[0].paddr, DMA_ATTR_WRITE_COMBINE); -+ bdisp_h_filter[0].paddr, &attrs); -+ } - } - - /** -@@ -507,11 +516,12 @@ int bdisp_hw_alloc_filters(struct device *dev) - unsigned int i, size; - void *base; - dma_addr_t paddr; -+ DEFINE_DMA_ATTRS(attrs); - - /* Allocate all the filters within a single memory page */ - size = (BDISP_HF_NB * NB_H_FILTER) + (BDISP_VF_NB * NB_V_FILTER); -- base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL | GFP_DMA, -- DMA_ATTR_WRITE_COMBINE); -+ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); -+ base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL | GFP_DMA, &attrs); - if (!base) - return -ENOMEM; - -diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c -index fb6a177..e50ef6a 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-contig.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c -@@ -27,7 +27,7 @@ struct vb2_dc_buf { - unsigned long size; - void *cookie; - dma_addr_t dma_addr; -- unsigned long attrs; -+ struct dma_attrs attrs; - enum dma_data_direction dma_dir; - struct sg_table *dma_sgt; - struct frame_vector *vec; -@@ -130,12 +130,12 @@ static void vb2_dc_put(void *buf_priv) - kfree(buf->sgt_base); - } - dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr, -- buf->attrs); -+ &buf->attrs); - put_device(buf->dev); - kfree(buf); - } - --static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, -+static void *vb2_dc_alloc(struct device *dev, const struct dma_attrs *attrs, - unsigned long size, enum dma_data_direction dma_dir, - gfp_t gfp_flags) - { -@@ -149,16 +149,16 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, - return ERR_PTR(-ENOMEM); - - if (attrs) -- buf->attrs = attrs; -+ buf->attrs = *attrs; - buf->cookie = dma_alloc_attrs(dev, size, &buf->dma_addr, -- GFP_KERNEL | gfp_flags, buf->attrs); -+ GFP_KERNEL | gfp_flags, &buf->attrs); - if (!buf->cookie) { - dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size); - kfree(buf); - return ERR_PTR(-ENOMEM); - } - -- if ((buf->attrs & DMA_ATTR_NO_KERNEL_MAPPING) == 0) -+ if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->attrs)) - buf->vaddr = buf->cookie; - - /* Prevent the device from being released while the buffer is used */ -@@ -192,7 +192,7 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma) - vma->vm_pgoff = 0; - - ret = dma_mmap_attrs(buf->dev, vma, buf->cookie, -- buf->dma_addr, buf->size, buf->attrs); -+ buf->dma_addr, buf->size, &buf->attrs); - - if (ret) { - pr_err("Remapping memory failed, error: %d\n", ret); -@@ -375,7 +375,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) - } - - ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr, -- buf->size, buf->attrs); -+ buf->size, &buf->attrs); - if (ret < 0) { - dev_err(buf->dev, "failed to get scatterlist from DMA API\n"); - kfree(sgt); -@@ -424,12 +424,15 @@ static void vb2_dc_put_userptr(void *buf_priv) - struct page **pages; - - if (sgt) { -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - /* - * No need to sync to CPU, it's already synced to the CPU - * since the finish() memop will have been called before this. - */ - dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - pages = frame_vector_pages(buf->vec); - /* sgt should exist only if vector contains pages... */ - BUG_ON(IS_ERR(pages)); -@@ -484,6 +487,9 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, - struct sg_table *sgt; - unsigned long contig_size; - unsigned long dma_align = dma_get_cache_alignment(); -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - - /* Only cache aligned DMA transfers are reliable */ - if (!IS_ALIGNED(vaddr | size, dma_align)) { -@@ -548,7 +554,7 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, - * prepare() memop is called. - */ - sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - if (sgt->nents <= 0) { - pr_err("failed to map scatterlist\n"); - ret = -EIO; -@@ -572,7 +578,7 @@ out: - - fail_map_sg: - dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - - fail_sgt_init: - sg_free_table(sgt); -diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c -index ecff8f4..64a386d 100644 ---- a/drivers/media/v4l2-core/videobuf2-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c -@@ -95,7 +95,7 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, - return 0; - } - --static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, -+static void *vb2_dma_sg_alloc(struct device *dev, const struct dma_attrs *dma_attrs, - unsigned long size, enum dma_data_direction dma_dir, - gfp_t gfp_flags) - { -@@ -103,6 +103,9 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, - struct sg_table *sgt; - int ret; - int num_pages; -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - - if (WARN_ON(!dev)) - return ERR_PTR(-EINVAL); -@@ -142,7 +145,7 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, - * prepare() memop is called. - */ - sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - if (!sgt->nents) - goto fail_map; - -@@ -177,10 +180,13 @@ static void vb2_dma_sg_put(void *buf_priv) - int i = buf->num_pages; - - if (atomic_dec_and_test(&buf->refcount)) { -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - dprintk(1, "%s: Freeing buffer of %d pages\n", __func__, - buf->num_pages); - dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - if (buf->vaddr) - vm_unmap_ram(buf->vaddr, buf->num_pages); - sg_free_table(buf->dma_sgt); -@@ -223,11 +229,13 @@ static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, - { - struct vb2_dma_sg_buf *buf; - struct sg_table *sgt; -+ DEFINE_DMA_ATTRS(attrs); - struct frame_vector *vec; - - if (WARN_ON(!dev)) - return ERR_PTR(-EINVAL); - -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - buf = kzalloc(sizeof *buf, GFP_KERNEL); - if (!buf) - return ERR_PTR(-ENOMEM); -@@ -258,7 +266,7 @@ static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, - * prepare() memop is called. - */ - sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, -- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); -+ buf->dma_dir, &attrs); - if (!sgt->nents) - goto userptr_fail_map; - -@@ -282,11 +290,14 @@ static void vb2_dma_sg_put_userptr(void *buf_priv) - struct vb2_dma_sg_buf *buf = buf_priv; - struct sg_table *sgt = &buf->sg_table; - int i = buf->num_pages; -+ DEFINE_DMA_ATTRS(attrs); -+ -+ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); - - dprintk(1, "%s: Releasing userspace buffer of %d pages\n", - __func__, buf->num_pages); - dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir, -- DMA_ATTR_SKIP_CPU_SYNC); -+ &attrs); - if (buf->vaddr) - vm_unmap_ram(buf->vaddr, buf->num_pages); - sg_free_table(buf->dma_sgt); -diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c -index ab3227b..4fdfefd 100644 ---- a/drivers/media/v4l2-core/videobuf2-vmalloc.c -+++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c -@@ -33,7 +33,7 @@ struct vb2_vmalloc_buf { - - static void vb2_vmalloc_put(void *buf_priv); - --static void *vb2_vmalloc_alloc(struct device *dev, unsigned long attrs, -+static void *vb2_vmalloc_alloc(struct device *dev, const struct dma_attrs *attrs, - unsigned long size, enum dma_data_direction dma_dir, - gfp_t gfp_flags) - { -diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h -index 9a144f2..c5e3113 100644 ---- a/include/media/videobuf2-core.h -+++ b/include/media/videobuf2-core.h -@@ -113,7 +113,7 @@ struct vb2_threadio_data; - * map_dmabuf, unmap_dmabuf. - */ - struct vb2_mem_ops { -- void *(*alloc)(struct device *dev, unsigned long attrs, -+ void *(*alloc)(struct device *dev, const struct dma_attrs *attrs, - unsigned long size, - enum dma_data_direction dma_dir, - gfp_t gfp_flags); -@@ -426,7 +426,7 @@ struct vb2_buf_ops { - * @io_modes: supported io methods (see vb2_io_modes enum) - * @dev: device to use for the default allocation context if the driver - * doesn't fill in the @alloc_devs array. -- * @dma_attrs: DMA attributes to use for the DMA. -+ * @dma_attrs: DMA attributes to use for the DMA. May be NULL. - * @bidirectional: when this flag is set the DMA direction for the buffers of - * this queue will be overridden with DMA_BIDIRECTIONAL direction. - * This is useful in cases where the hardware (firmware) writes to -@@ -494,7 +494,7 @@ struct vb2_queue { - unsigned int type; - unsigned int io_modes; - struct device *dev; -- unsigned long dma_attrs; -+ const struct dma_attrs *dma_attrs; - unsigned bidirectional:1; - unsigned fileio_read_once:1; - unsigned fileio_write_immediately:1; -diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h -index 5604818..df2aabe 100644 ---- a/include/media/videobuf2-dma-contig.h -+++ b/include/media/videobuf2-dma-contig.h -@@ -16,6 +16,8 @@ - #include - #include - -+struct dma_attrs; -+ - static inline dma_addr_t - vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no) - { diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.7_pci_alloc_irq_vectors.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.7_pci_alloc_irq_vectors.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.7_pci_alloc_irq_vectors.patch 2017-08-27 18:23:53.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.7_pci_alloc_irq_vectors.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c -index d5c911c..9796340 100644 ---- a/drivers/media/pci/cobalt/cobalt-driver.c -+++ b/drivers/media/pci/cobalt/cobalt-driver.c -@@ -308,7 +308,9 @@ static void cobalt_pci_iounmap(struct cobalt *cobalt, struct pci_dev *pci_dev) - static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev) - { - free_irq(pci_dev->irq, (void *)cobalt); -- pci_free_irq_vectors(pci_dev); -+ -+ if (cobalt->msi_enabled) -+ pci_disable_msi(pci_dev); - } - - static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, -@@ -385,12 +387,14 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, - from being generated. */ - cobalt_set_interrupt(cobalt, false); - -- if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) { -+ if (pci_enable_msi_range(pci_dev, 1, 1) < 1) { - cobalt_err("Could not enable MSI\n"); -+ cobalt->msi_enabled = false; - ret = -EIO; - goto err_release; - } - msi_config_show(cobalt, pci_dev); -+ cobalt->msi_enabled = true; - - /* Register IRQ */ - if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED, -diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h -index 00f773e..ed00dc9 100644 ---- a/drivers/media/pci/cobalt/cobalt-driver.h -+++ b/drivers/media/pci/cobalt/cobalt-driver.h -@@ -287,6 +287,8 @@ struct cobalt { - u32 irq_none; - u32 irq_full_fifo; - -+ bool msi_enabled; -+ - /* omnitek dma */ - int dma_channels; - int first_fifo_channel; -diff --git a/drivers/media/pci/ddbridge/ddbridge.c b/drivers/media/pci/ddbridge/ddbridge.c -index fab421f..031288a 100644 ---- a/drivers/media/pci/ddbridge/ddbridge-main.c -+++ b/drivers/media/pci/ddbridge/ddbridge-main.c -@@ -109,7 +109,7 @@ static void ddb_irq_msi(struct ddb *dev, int nr) - int stat; - - if (msi && pci_msi_enabled()) { -- stat = pci_alloc_irq_vectors(dev->pdev, 1, nr, PCI_IRQ_MSI); -+ stat = pci_enable_msi_range(dev->pdev, 1, nr); - if (stat >= 1) { - dev->msi = stat; - dev_info(dev->dev, "using %d MSI interrupt(s)\n", diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.8_user_pages_flag.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.8_user_pages_flag.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.8_user_pages_flag.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.8_user_pages_flag.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c -index 2c9232e..4769469 100644 ---- a/drivers/media/pci/ivtv/ivtv-udma.c -+++ b/drivers/media/pci/ivtv/ivtv-udma.c -@@ -124,8 +124,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, - } - - /* Get user pages for DMA Xfer */ -- err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, -- dma->map, FOLL_FORCE); -+ err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, 0, -+ 1, dma->map); - - if (user_dma.page_count != err) { - IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n", -diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c -index 44936d6..a61f632 100644 ---- a/drivers/media/pci/ivtv/ivtv-yuv.c -+++ b/drivers/media/pci/ivtv/ivtv-yuv.c -@@ -76,12 +76,11 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, - - /* Get user pages for DMA Xfer */ - y_pages = get_user_pages_unlocked(y_dma.uaddr, -- y_dma.page_count, &dma->map[0], FOLL_FORCE); -+ y_dma.page_count, 0, 1, &dma->map[0]); - uv_pages = 0; /* silence gcc. value is set and consumed only if: */ - if (y_pages == y_dma.page_count) { - uv_pages = get_user_pages_unlocked(uv_dma.uaddr, -- uv_dma.page_count, &dma->map[y_pages], -- FOLL_FORCE); -+ uv_dma.page_count, 0, 1, &dma->map[y_pages]); - } - - if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index 1db0af6..f300f06 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -156,7 +156,6 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, - { - unsigned long first, last; - int err, rw = 0; -- unsigned int flags = FOLL_FORCE; - - dma->direction = direction; - switch (dma->direction) { -@@ -179,14 +178,12 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, - if (NULL == dma->pages) - return -ENOMEM; - -- if (rw == READ) -- flags |= FOLL_WRITE; -- - dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n", - data, size, dma->nr_pages); - - err = get_user_pages(data & PAGE_MASK, dma->nr_pages, -- flags, dma->pages, NULL); -+ rw == READ, 1, /* force */ -+ dma->pages, NULL); - - if (err != dma->nr_pages) { - dma->nr_pages = (err >= 0) ? err : 0; -diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c -index 1cd322e..3c3b517 100644 ---- a/drivers/media/v4l2-core/videobuf2-memops.c -+++ b/drivers/media/v4l2-core/videobuf2-memops.c -@@ -42,10 +42,6 @@ struct frame_vector *vb2_create_framevec(unsigned long start, - unsigned long first, last; - unsigned long nr; - struct frame_vector *vec; -- unsigned int flags = FOLL_FORCE; -- -- if (write) -- flags |= FOLL_WRITE; - - first = start >> PAGE_SHIFT; - last = (start + length - 1) >> PAGE_SHIFT; -@@ -53,7 +49,7 @@ struct frame_vector *vb2_create_framevec(unsigned long start, - vec = frame_vector_create(nr); - if (!vec) - return ERR_PTR(-ENOMEM); -- ret = get_vaddr_frames(start & PAGE_MASK, nr, flags, vec); -+ ret = get_vaddr_frames(start & PAGE_MASK, nr, write, true, vec); - if (ret < 0) - goto out_destroy; - /* We accept only complete set of PFNs */ diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_cec_pin.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_cec_pin.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_cec_pin.patch 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_cec_pin.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -From 0b0c8153ac3733fafa03d93fb18993ce899bc473 Mon Sep 17 00:00:00 2001 -From: Hans Verkuil -Date: Fri, 1 Sep 2017 10:12:22 +0200 -Subject: [PATCH] fix - -Signed-off-by: Hans Verkuil ---- - drivers/media/cec/cec-pin.c | 37 ++++++++++++++++++++++--------------- - 1 file changed, 22 insertions(+), 15 deletions(-) - -diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c -index c003b8eac617..e2aa5d6e619d 100644 ---- a/drivers/media/cec/cec-pin.c -+++ b/drivers/media/cec/cec-pin.c -@@ -132,7 +132,7 @@ static void cec_pin_to_idle(struct cec_pin *pin) - pin->rx_msg.len = 0; - memset(pin->rx_msg.msg, 0, sizeof(pin->rx_msg.msg)); - pin->state = CEC_ST_IDLE; -- pin->ts = 0; -+ pin->ts = ns_to_ktime(0); - } - - /* -@@ -426,7 +426,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) - v = cec_pin_read(pin); - if (v && pin->rx_eom) { - pin->work_rx_msg = pin->rx_msg; -- pin->work_rx_msg.rx_ts = ts; -+ pin->work_rx_msg.rx_ts = ktime_to_ns(ts); - wake_up_interruptible(&pin->kthread_waitq); - pin->ts = ts; - pin->state = CEC_ST_RX_ACK_FINISH; -@@ -457,7 +457,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) - s32 delta; - - ts = ktime_get(); -- if (pin->timer_ts) { -+ if (ktime_to_ns(pin->timer_ts)) { - delta = ktime_us_delta(ts, pin->timer_ts); - pin->timer_cnt++; - if (delta > 100 && pin->state != CEC_ST_IDLE) { -@@ -481,17 +481,19 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) - if (pin->wait_usecs > 150) { - pin->wait_usecs -= 100; - pin->timer_ts = ktime_add_us(ts, 100); -- hrtimer_forward_now(timer, 100000); -+ hrtimer_forward_now(timer, ns_to_ktime(100000)); - return HRTIMER_RESTART; - } - if (pin->wait_usecs > 100) { - pin->wait_usecs /= 2; - pin->timer_ts = ktime_add_us(ts, pin->wait_usecs); -- hrtimer_forward_now(timer, pin->wait_usecs * 1000); -+ hrtimer_forward_now(timer, -+ ns_to_ktime(pin->wait_usecs * 1000)); - return HRTIMER_RESTART; - } - pin->timer_ts = ktime_add_us(ts, pin->wait_usecs); -- hrtimer_forward_now(timer, pin->wait_usecs * 1000); -+ hrtimer_forward_now(timer, -+ ns_to_ktime(pin->wait_usecs * 1000)); - pin->wait_usecs = 0; - return HRTIMER_RESTART; - } -@@ -531,7 +533,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) - pin->state = CEC_ST_RX_START_BIT_LOW; - break; - } -- if (pin->ts == 0) -+ if (ktime_to_ns(pin->ts) == 0) - pin->ts = ts; - if (pin->tx_msg.len) { - /* -@@ -572,12 +574,13 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) - if (!adap->monitor_pin_cnt || states[pin->state].usecs <= 150) { - pin->wait_usecs = 0; - pin->timer_ts = ktime_add_us(ts, states[pin->state].usecs); -- hrtimer_forward_now(timer, states[pin->state].usecs * 1000); -+ hrtimer_forward_now(timer, -+ ns_to_ktime(states[pin->state].usecs * 1000)); - return HRTIMER_RESTART; - } - pin->wait_usecs = states[pin->state].usecs - 100; - pin->timer_ts = ktime_add_us(ts, 100); -- hrtimer_forward_now(timer, 100000); -+ hrtimer_forward_now(timer, ns_to_ktime(100000)); - return HRTIMER_RESTART; - } - -@@ -596,7 +599,7 @@ static int cec_pin_thread_func(void *_adap) - - if (pin->work_rx_msg.len) { - cec_received_msg_ts(adap, &pin->work_rx_msg, -- pin->work_rx_msg.rx_ts); -+ ns_to_ktime(pin->work_rx_msg.rx_ts)); - pin->work_rx_msg.len = 0; - } - if (pin->work_tx_status) { -@@ -623,13 +626,15 @@ static int cec_pin_thread_func(void *_adap) - pin->ops->disable_irq(adap); - cec_pin_high(pin); - cec_pin_to_idle(pin); -- hrtimer_start(&pin->timer, 0, HRTIMER_MODE_REL); -+ hrtimer_start(&pin->timer, ns_to_ktime(0), -+ HRTIMER_MODE_REL); - break; - case CEC_PIN_IRQ_ENABLE: - pin->enable_irq_failed = !pin->ops->enable_irq(adap); - if (pin->enable_irq_failed) { - cec_pin_to_idle(pin); -- hrtimer_start(&pin->timer, 0, HRTIMER_MODE_REL); -+ hrtimer_start(&pin->timer, ns_to_ktime(0), -+ HRTIMER_MODE_REL); - } - break; - default: -@@ -653,7 +658,7 @@ static int cec_pin_adap_enable(struct cec_adapter *adap, bool enable) - cec_pin_read(pin); - cec_pin_to_idle(pin); - pin->tx_msg.len = 0; -- pin->timer_ts = 0; -+ pin->timer_ts = ns_to_ktime(0); - atomic_set(&pin->work_irq_change, CEC_PIN_IRQ_UNCHANGED); - pin->kthread = kthread_run(cec_pin_thread_func, adap, - "cec-pin"); -@@ -661,7 +666,8 @@ static int cec_pin_adap_enable(struct cec_adapter *adap, bool enable) - pr_err("cec-pin: kernel_thread() failed\n"); - return PTR_ERR(pin->kthread); - } -- hrtimer_start(&pin->timer, 0, HRTIMER_MODE_REL); -+ hrtimer_start(&pin->timer, ns_to_ktime(0), -+ HRTIMER_MODE_REL); - } else { - if (pin->ops->disable_irq) - pin->ops->disable_irq(adap); -@@ -699,7 +705,8 @@ static int cec_pin_adap_transmit(struct cec_adapter *adap, u8 attempts, - pin->ops->disable_irq(adap); - cec_pin_high(pin); - cec_pin_to_idle(pin); -- hrtimer_start(&pin->timer, 0, HRTIMER_MODE_REL); -+ hrtimer_start(&pin->timer, ns_to_ktime(0), -+ HRTIMER_MODE_REL); - } - return 0; - } --- -2.14.1 - diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_dvb_net_max_mtu.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_dvb_net_max_mtu.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_dvb_net_max_mtu.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_dvb_net_max_mtu.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c -index 8f11d7e..de27c2f 100644 ---- a/drivers/media/dvb-core/dvb_net.c -+++ b/drivers/media/dvb-core/dvb_net.c -@@ -1333,6 +1333,7 @@ static const struct net_device_ops dvb_netdev_ops = { - .ndo_start_xmit = dvb_net_tx, - .ndo_set_rx_mode = dvb_net_set_multicast_list, - .ndo_set_mac_address = dvb_net_set_mac, -+ .ndo_change_mtu = eth_change_mtu, - .ndo_validate_addr = eth_validate_addr, - }; - -@@ -1343,7 +1344,6 @@ static void dvb_net_setup(struct net_device *dev) - dev->header_ops = &dvb_header_ops; - dev->netdev_ops = &dvb_netdev_ops; - dev->mtu = 4096; -- dev->max_mtu = 4096; - - dev->flags |= IFF_NOARP; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_ktime_cleanups.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_ktime_cleanups.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_ktime_cleanups.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_ktime_cleanups.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c -index 0c16bb2..0c44479 100644 ---- a/drivers/media/dvb-core/dmxdev.c -+++ b/drivers/media/dvb-core/dmxdev.c -@@ -562,7 +562,7 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev, - struct dmxdev_filter *filter, - struct dmxdev_feed *feed) - { -- ktime_t timeout = 0; -+ ktime_t timeout = ktime_set(0, 0); - struct dmx_pes_filter_params *para = &filter->params.pes; - dmx_output_t otype; - int ret; -diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c -index c7b3cb4..dcfea35 100644 ---- a/drivers/media/pci/cx88/cx88-input.c -+++ b/drivers/media/pci/cx88/cx88-input.c -@@ -178,7 +178,8 @@ static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer) - struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer); - - cx88_ir_handle_key(ir); -- missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000); -+ missed = hrtimer_forward_now(&ir->timer, -+ ktime_set(0, ir->polling * 1000000)); - if (missed > 1) - ir_dprintk("Missed ticks %ld\n", missed - 1); - -@@ -198,7 +199,8 @@ static int __cx88_ir_start(void *priv) - if (ir->polling) { - hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - ir->timer.function = cx88_ir_work; -- hrtimer_start(&ir->timer, ir->polling * 1000000, -+ hrtimer_start(&ir->timer, -+ ktime_set(0, ir->polling * 1000000), - HRTIMER_MODE_REL); - } - if (ir->sampling) { -diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c -index 77f4d15..7fb649e 100644 ---- a/drivers/media/pci/pt3/pt3.c -+++ b/drivers/media/pci/pt3/pt3.c -@@ -463,7 +463,7 @@ static int pt3_fetch_thread(void *data) - - pt3_proc_dma(adap); - -- delay = PT3_FETCH_DELAY * NSEC_PER_MSEC; -+ delay = ktime_set(0, PT3_FETCH_DELAY * NSEC_PER_MSEC); - set_current_state(TASK_UNINTERRUPTIBLE); - freezable_schedule_hrtimeout_range(&delay, - PT3_FETCH_DELAY_DELTA * NSEC_PER_MSEC, -diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c -index e6efa8c..82fb6f2 100644 ---- a/drivers/media/rc/ir-rx51.c -+++ b/drivers/media/rc/ir-rx51.c -@@ -109,7 +109,7 @@ static enum hrtimer_restart lirc_rx51_timer_cb(struct hrtimer *timer) - - now = timer->base->get_time(); - -- } while (hrtimer_get_expires_tv64(timer) < now); -+ } while (hrtimer_get_expires_tv64(timer) < now.tv64); - - return HRTIMER_RESTART; - end: diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_mm_address.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_mm_address.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4.9_mm_address.patch 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4.9_mm_address.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index ba63ca5..1db0af6 100644 ---- a/drivers/media/v4l2-core/videobuf-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c -@@ -439,12 +439,13 @@ static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) - struct page *page; - - dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n", -- vmf->address, vma->vm_start, vma->vm_end); -+ (unsigned long)vmf->virtual_address, -+ vma->vm_start, vma->vm_end); - - page = alloc_page(GFP_USER | __GFP_DMA32); - if (!page) - return VM_FAULT_OOM; -- clear_user_highpage(page, vmf->address); -+ clear_user_highpage(page, (unsigned long)vmf->virtual_address); - vmf->page = page; - - return 0; diff -Nru media-build-dkms-0004~trusty/media-build-0004/backports/v4l2-compat-timespec.patch media-build-dkms-0005~trusty/media-build-0004/backports/v4l2-compat-timespec.patch --- media-build-dkms-0004~trusty/media-build-0004/backports/v4l2-compat-timespec.patch 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/backports/v4l2-compat-timespec.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c ---- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c -+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c -@@ -20,6 +20,10 @@ - - #ifdef CONFIG_COMPAT - -+#define put_compat_timespec(ts, cts) \ -+ (put_user((ts)->tv_sec, &((cts)->tv_sec))) || \ -+ put_user((ts)->tv_nsec, &((cts)->tv_nsec)) -+ - static long native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) - { - long ret = -ENOIOCTLCMD; diff -Nru media-build-dkms-0004~trusty/media-build-0004/build_all.sh media-build-dkms-0005~trusty/media-build-0004/build_all.sh --- media-build-dkms-0004~trusty/media-build-0004/build_all.sh 2017-09-05 21:48:41.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/build_all.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,255 +0,0 @@ -#!/bin/bash - -function usage { - echo "Usage: $0 [-l][-v][-c][-db][-dc][-dt][--help]" - echo " -c ... clean" - echo " -l ... make linux" - echo " -v ... make v4l" - echo " -db .. DKMS build" - echo " -dc .. DKMS clean" - echo " -dt .. DKMS TAR" - echo " Note: If -l and -v are not present, both are executed." - echo " The order of the options needs to be as written above!" - echo " If -db or -dc are present, -c, -l and -v are ignored and" - echo " is used as the installation path." - echo " If -dt is present, all other options are ignored. This will" - echo " do implicite -c and then create the TAR archive." - exit 1 -} - -function disable_opt { - echo Disabling ${1} - sed -i \ - -e s/${1}=[y\|m]/#\ ${1}\ is\ not\ set/ \ - v4l/.config -} - -function set_opt_y { - echo Enabling Y ${1} - sed -i \ - -e s/#\ ${1}\ is\ not\ set/${1}=y/ \ - v4l/.config -} - -function set_opt_m { - echo Enabling M ${1} - sed -i \ - -e s/#\ ${1}\ is\ not\ set/${1}=m/ \ - v4l/.config -} - -function set_opt_value { - echo Setting ${1} to ${2} - sed -i \ - -e s/${1}=.*/${1}=${2}/ \ - v4l/.config -} - -function make_linux { - cd linux - - if [ "${do_clean}" = "y" ] ; then - make ${linux_clean} - # mm remains, should be reportded to media_build maintainers - rm -rf mm - - if [ "${do_tar}" == "y" ] ; then - make tar DIR=../${1} - rm -f git_log - rm -f kernel_version.h - fi - else - if [ "${do_dkms}" != "y" ] ; then - make tar DIR=../${1} - fi - make untar - fi - - cd .. -} - -function import_options { - # we need the list sorted according to the number prefix - inc_files=$(find . -name "*.inc" | sort -u) - if [ -n "${inc_files}" ] ; then - for incfile in ${inc_files} ; do - # we allow only the functions we define in this script - rm -f ${incfile}.tmp - sed -n -e '/^disable_opt/p' -e '/^set_opt_y/p' -e '/^set_opt_m/p' \ - -e '/^set_opt_value/p' ${incfile} > ${incfile}.tmp - source ${incfile}.tmp - rm ${incfile}.tmp - done - fi -} - -function make_v4l { - if [ "${do_clean}" = "y" ] ; then - make ${v4l_clean} - - if [ -d "${dkms_inst_dir}" -a "${do_dkms}" = "y" ] ; then - if [ -d "${dkms_inst_dir}" ] ; then - # additional security to be sure we remove the right directory - if [ -f "${dkms_inst_dir}/DKMS_INST" ] ; then - rm -rf ${dkms_inst_dir} - else - echo "Error: '${dkms_inst_dir}' is no DKMS install path!" - exit 4 - fi - fi - fi - else - make stagingconfig - - import_options - - make -j${job_num} - - if [ "${do_dkms}" = "y" ] ; then - if [ ! -d "${dkms_inst_dir}" ] ; then - make DESTDIR=${dkms_inst_dir} install - if [ $? -eq 0 ] ; then - # additional security to be sure we remove the right directory - # when cleaning (option -dc) - rm -rf ${dkms_inst_dir}/DKMS_INST - date -R > ${dkms_inst_dir}/DKMS_INST - fi - else - echo "Error: DKMS install path '${dkms_inst_dir}' already exists!" - exit 3 - fi - fi - fi -} - -if [ $# -lt 1 ] ; then - usage -fi - -# matches "--help" also -if [[ ${1} =~ ^-.* ]] ; then - usage -fi - -# determine num of available cores for make job control -nProc=$(getconf _NPROCESSORS_ONLN) -job_num=$(( nProc + 1 )) - -kernelsourcedir=${1} -shift - -linux_clean="distclean" -v4l_clean="distclean" -do_dkms="d" -do_linux="d" -do_v4l="d" -do_tar="d" - -# Some DKMS version might need to override jobs, so checking -# for an environment variable JOBS -if [ -n "${JOBS}" ] ; then - # JOBS need to be numeric - case ${JOBS} in - '' | *[!0-9]*) - echo "Error: ENV Variable 'JOBS' ins not numeric!" - exit 2 - ;; - esac - job_num=${JOBS} -fi - -if [ "${1}" = "-l" ] ; then - do_linux="y" - do_v4l="n" - shift -fi - -if [ "${1}" = "-v" ] ; then - do_v4l="y" - if [ "${do_linux}" = "d" ] ; then - do_linux="n" - fi - shift -fi - -if [ "${1}" = "-c" ] ; then - do_clean="y" - do_linux="d" - do_v4l="d" - shift -fi - -if [ "${1}" = "-db" ] ; then - do_clean="n" - do_linux="d" - do_v4l="d" - do_dkms="y" - dkms_inst_dir="${kernelsourcedir}" - shift -fi - -if [ "${1}" = "-dc" ] ; then - do_clean="y" - do_linux="d" - do_v4l="d" - # keep the linux tree tar.bz2 file - linux_clean="clean" - do_dkms="y" - dkms_inst_dir="${kernelsourcedir}" - shift -fi - -if [ "${1}" = "-dt" ] ; then - do_clean="y" - do_linux="d" - do_v4l="d" - do_dkms="d" - do_tar="y" - # default might be overridden already - linux_clean="distclean" - v4l_clean="distclean" - shift -fi - -# needs to be last -if [ "${1}" = "--help" ] ; then - usage -fi - -if [ $# -gt 0 ] ; then - usage -fi - -if [ "${do_dkms}" != "y" ] ; then - if [ ! -d ${kernelsourcedir} ] ; then - echo "Error: Kernel source dir '${kernelsourcedir}' does not exist!" - exit 5 - fi - - txt_body="for kernel sources at ${kernelsourcedir}" - txt_dkms="" -else - txt_body="with installation path ${kernelsourcedir}" - txt_dkms="DKMS: " -fi - -if [ "${do_clean}" != "y" ] ; then - txt_start="${txt_dkms}Running media build ${txt_body}" -else - txt_start="${txt_dkms}Cleaning media build" -fi - -echo "${txt_start}" - -if [ -n "${VER}" -a "${do_clean}" != "y" ] ; then - # generate first ./v4l/.version, which is used by all other scripts - make VER=${VER} release -fi - -if [ "${do_linux}" = "y" -o "${do_linux}" = "d" ] ; then - make_linux ${kernelsourcedir} -fi - -if [ "${do_v4l}" = "y" -o "${do_v4l}" = "d" ] ; then - make_v4l -fi diff -Nru media-build-dkms-0004~trusty/media-build-0004/COPYING media-build-dkms-0005~trusty/media-build-0004/COPYING --- media-build-dkms-0004~trusty/media-build-0004/COPYING 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff -Nru media-build-dkms-0004~trusty/media-build-0004/devel_scripts/analyze_build.pl media-build-dkms-0005~trusty/media-build-0004/devel_scripts/analyze_build.pl --- media-build-dkms-0004~trusty/media-build-0004/devel_scripts/analyze_build.pl 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/devel_scripts/analyze_build.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,303 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2006 Trent Piepho -# Scans a tree of Linux Kernel style Makefiles, and builds lists of what -# builds what. -# Outputs three lists: -# 1. Kconfig variables associated with the kernel module(s) they turn on -# 2. Kernel modules associated with their source file(s) -# 3. Kconfig variables associated with all the source file(s) they turn on -# -# Optional options: -# Prefix relative to source tree root to start scanning in. This -# will be stripped from the beginnings of all filenames printed out. -# Default is 'linux/drivers/media' -# Root of source tree -# Default is to use 'hg root' command and if that fails the cwd -# -# Most usefull with grep, for example -# List of modules and source files used by DVB_BUDGET_AV -# deps.pl | grep DVB_BUDGET_AV -# -# Kconfig variable and kernel module that use dvb-usb-init.c -# deps.pl | grep dvb-usb-init.c -# -# Kconfig variable and source files that make dvb-core.ko -# deps.pl | grep dvb-core.ko -# -# Also has some ability to check Makefiles for errors -use strict; -use FileHandle; -use Getopt::Long; -use Pod::Usage; - -# Controls what will be displayed -my $check; -my $show_modules; -my $show_files_per_module; -my $show_files_per_config; -my $show_all; -my $help; -my $man; - -# Directory to start in. Will be stripped from all filenames printed out. -my $prefix = 'linux/drivers/media/'; - -GetOptions( - "path=s" => \$prefix, - "extra_check" => \$check, - "show_modules" => \$show_modules, - "show_files_per_module" => \$show_files_per_module, - "show_files_per_config" => \$show_files_per_config, - "show_all" => \$show_all, - 'help|?' => \$help, - man => \$man -) or pod2usage(2); - -pod2usage(1) if $help; -pod2usage(-exitstatus => 0, -verbose => 2) if $man; - -if ($show_all) { - $show_modules = 1; - $show_files_per_module = 1; - $show_files_per_config = 1; -} - -# List of Makefile's opened -my %makefiles = (); - -# For each Kconfig variable, a list of modules it builds -my %config = (); - -# For each module that is made up of multiple source files, list of sources -my %multi = (); - -sub open_makefile($) { - my $file = shift; - - # only open a given Makefile once - return if exists $makefiles{$file}; - $makefiles{$file} = 1; - - $file =~ m|^(.*)/[^/]*$|; - my $dir = $1; - - # print STDERR "opening $root$file (dir=$dir)\n"; - my $in = new FileHandle; - open $in, '<', "$file" or die "Unable to open Makefile '$file': $!"; - - while (<$in>) { - # print STDERR "Line: $_"; - # Skip comment and blank lines - next if (/^\s*(#.*)?$/); - m/^\s*\-?include/ and die "Can't handle includes! In $file"; - - # Handle line continuations - if (/\\\n$/) { - $_ .= <$in>; - redo; - } - # Eat line continuations in string we will parse - s/\s*\\\n\s*/ /g; - # Eat comments - s/#.*$//; - - if (/^\s*ccflags-(.*)?\s*([:+]?)=\s*(\S.*?)\s*$/) { - if ($check) { - print STDERR "Should use '+=' with ccflags-$1 in $file:$.\n$_\n" if ($2 ne "+"); - } - next; - } - if (/^\s*obj-(\S+)\s*([:+]?)=\s*(\S.*?)\s*$/) { - print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $2 ne '+'); - my ($var,$targets) = ($1, $3); - if ($var =~ /\$\(CONFIG_(\S+)\)$/) { - $var = $1; - } elsif ($var !~ /^[ym]$/) { - print STDERR "Confused by obj assignment '$var' in $file:$.\n$_"; - } - foreach(split(/\s+/, $targets)) { - if (m|/$|) { # Ends in /, means it's a directory - open_makefile("$dir/$_".'Makefile'); - } elsif (/^(\S+)\.o$/) { - push @{$config{$var}}, "$dir/$1"; - } else { - print STDERR "Confused by target '$_' in $file:$.\n"; - } - } - next; - } - if (/(\S+)-objs\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { - my @files = split(/\s+/, $3); - foreach my $f (@files) { - $f =~ s|^(.*)\.o$|$dir/$1|; - } - if ($2 eq '+') { - # Adding to files - print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); - push @files, split(/\s+/, $multi{"$dir/$1"}); - } else { - print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); - } - $multi{"$dir/$1"} = "@files"; - next; - } - if (/^\s*(\S+)-[ym]?\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { - my @files = split(/\s+/, $3); - foreach my $f (@files) { - $f =~ s|^(.*)\.o$|$dir/$1|; - } - if ($2 eq '+') { - # Adding to files - print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); - push @files, split(/\s+/, $multi{"$dir/$1"}); - } else { - print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); - } - $multi{"$dir/$1"} = "@files"; - next; - } - if (/^\s*(\S+)-\$\((\S+)\)\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { - print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $3 ne '+'); - my ($var, $files, $targets) = ($2, $3, $4); - $multi{"$dir/$1"} = $files; - foreach(split(/\s+/, $targets)) { - if (m|/$|) { # Ends in /, means it's a directory - open_makefile("$dir/$_".'Makefile'); - } elsif (/^(\S+)\.o$/) { - push @{$config{$var}}, "$dir/$1"; - } else { - print STDERR "Confused by target '$_' in $file:$.\n"; - } - } - next; - } - if (/^\s*EXTRA_CFLAGS\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { - if ($check) { - sub allI { /^-I/ or return 0 foreach split(/\s+/, $_[0]);return 1; } - my $use = allI($2) ? ':' : '+'; - print STDERR "Should use '$use=' with EXTRA_CFLAGS in $file:$.\n$_\n" if ($1 ne $use); - } - next; - } - print STDERR "Odd line $file:$.\n$_\n" if ($check); - } -} - -open_makefile($prefix."Makefile"); - -if ($show_modules) { - print "# Kconfig variable = kernel modules built\n"; - foreach my $var (keys %config) { - my @list = @{$config{$var}}; - map { s/^$prefix(.*)$/\1.ko/ } @list; - printf "%-22s= %s\n", $var, join(' ', @list); - } -} - -if ($show_files_per_module) { - print "\n# kernel module = source files\n"; - my %modules = (); - foreach my $mods (values %config) { - $modules{$_} = 1 foreach @$mods; - } - foreach (keys %modules) { - /$prefix(.*)$/; - printf "%-30s = ", "$1.ko"; - if (exists $multi{$_}) { - my @list = split(/\s+/, $multi{$_}); - map { s/^$prefix(.*)$/\1.c/ } @list; - print join(' ', @list), "\n"; - } else { - print "$1.c\n"; - } - } -} - -if ($show_files_per_config) { - print "\n# Kconfig varible = source files\n"; - while (my ($var, $list) = each %config) { - my @outlist = (); - foreach (@$list) { - if (exists $multi{$_}) { - push @outlist, split(/\s+/, $multi{$_}); - } else { - push @outlist, $_; - } - } - map { s/^$prefix(.*)$/\1.c/ } @outlist; - printf "%-22s= %s\n", $var, join(' ', @outlist); - } -} -exit; - -__END__ - -=head1 NAME - -analyze_build.pl - Analyze the Kernel Makefiles to detect its config - -=head1 SYNOPSIS - -B [--path path] [--extra_check] [--show_modules] - [--show_files_per_module] [--show_files_per_config] - -=head1 OPTIONS - -=over 8 - -=item B<--path> path - -Path for the Kernel sub-tree to check. Default: linux/drivers/media. - -=item B<--extra_check> - -Enable extra checks - -=item B<--show_modules> - -Show modules (.ko files) and their corresponding Kconfig option - -=item B<--show_files_per_module> - -Show C source files for each module (.ko file) - -=item B<--show_files_per_config> - -Show C source files for each Kconfig option - -=item B<--show_all> - -Equivalent to B<--show_modules> B<--show_files_per_module B<--show_files_per_config> - -=item B<--help> - -Prints a brief help message and exits. - -=item B<--man> - -Prints the manual page and exits. - -=back - -=head1 DESCRIPTION - -B talk with an IMAP server to read messages with -patches from it. - -=head1 BUGS - -Report bugs to - -=head1 COPYRIGHT - -Copyright (c) 2006 Trent Piepho - -Copyright (c) 2012 by Mauro Carvalho Chehab - -License GPLv2: GNU GPL version 2 . - -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. - -=cut diff -Nru media-build-dkms-0004~trusty/media-build-0004/devel_scripts/gen_rename_patch.pl media-build-dkms-0005~trusty/media-build-0004/devel_scripts/gen_rename_patch.pl --- media-build-dkms-0004~trusty/media-build-0004/devel_scripts/gen_rename_patch.pl 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/devel_scripts/gen_rename_patch.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -#!/usr/bin/perl -use strict; - -my $debug=0; -my $from; -my $to; -my $sed; - -while (<>) { - $from = $1 if (/^rename from (.*)/); - $to = $1 if (/^rename to (.*)/); - - if ($from && $to) { - printf "$from -> $to\n" if ($debug); - $from =~ s/\./\\./g; - $to =~ s/\./\\./g; - $sed .= "\t-e 's,$from,$to,g' \\\n"; - $from = 0; - $to = 0; - } -} - -$sed =~ s/\s*\|\s* \\\s*$//; -$sed =~ s/^\s*//; - -open OUT, ">rename_patch.sh"; -print OUT "#!/bin/bash\n\n"; -print OUT "if [ \"\$1\" == \"\" ]; then echo \"usage: $0 \"; exit -1; fi\n\n"; -print OUT "OLD=\"\$1.old\"\n"; -print OUT "mv \$1 \$OLD && "; -print OUT "cat \$OLD | sed $sed >\$1 && \\\n"; -print OUT "echo -e \"old patch stored as \"\$OLD\"\\n\$1 rewrote.\"\n"; -close OUT; - -chmod(0755, "rename_patch.sh"); diff -Nru media-build-dkms-0004~trusty/media-build-0004/devel_scripts/README media-build-dkms-0005~trusty/media-build-0004/devel_scripts/README --- media-build-dkms-0004~trusty/media-build-0004/devel_scripts/README 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/devel_scripts/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -The files on this directory are ancillary scripts to help developers -to submit patch. They are: - -1) gen_rename_patch.pl - -Function: - This script takes an output of "git diff -M" - command and uses it to produce a script that renames files/patches, - called rename_patch.sh. - -Usage: - git diff 2ea4b44..b3f5260 -M | ./gen_rename_patch.pl - -Description: - After running the script, it will create a small shell script that - will read a patch file and change all occurences there where the - old filenames were used, chaning it to the new filenames. - Only "cat", "sed" and "mv" are needed for the produced rename_patch.sh - script to run. - -2) rename_patch.sh - -Function: - This script was generated via gen_rename_patch.pl. It tracks the - 10-patch series (changesets 2ea4b44..b3f5260) that change the - tree structure for the DVB files. - -Usage: - ./rename_patch.sh - -Description: - - This script will rename the to .old, and write a - new file, that will properly apply to the new tree. - It is useful to convert a patch designed to be applied before - the tree structure changes. diff -Nru media-build-dkms-0004~trusty/media-build-0004/devel_scripts/rename_patch.sh media-build-dkms-0005~trusty/media-build-0004/devel_scripts/rename_patch.sh --- media-build-dkms-0004~trusty/media-build-0004/devel_scripts/rename_patch.sh 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/devel_scripts/rename_patch.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,1441 +0,0 @@ -#!/bin/bash - -if [ "$1" == "" ]; then echo "usage: /home/v4l/media_build/devel_scripts/gen_rename_patch.pl "; exit -1; fi - -OLD="$1.old" -mv $1 $OLD && cat $OLD | sed -e 's,drivers/media/dvb/b2c2/Kconfig,drivers/media/common/b2c2/Kconfig,g' \ - -e 's,include/linux/dvb/ca\.h,include/uapi/linux/dvb/ca\.h,g' \ - -e 's,include/linux/dvb/frontend\.h,include/uapi/linux/dvb/frontend\.h,g' \ - -e 's,include/linux/dvb/net\.h,include/uapi/linux/dvb/net\.h,g' \ - -e 's,include/linux/dvb/osd\.h,include/uapi/linux/dvb/osd\.h,g' \ - -e 's,include/linux/dvb/version\.h,include/uapi/linux/dvb/version\.h,g' \ - -e 's,include/linux/ivtvfb\.h,include/uapi/linux/ivtvfb\.h,g' \ - -e 's,include/linux/ivtv\.h,include/uapi/linux/ivtv\.h,g' \ - -e 's,include/linux/media\.h,include/uapi/linux/media\.h,g' \ - -e 's,include/linux/meye\.h,include/uapi/linux/meye\.h,g' \ - -e 's,include/linux/uvcvideo\.h,include/uapi/linux/uvcvideo\.h,g' \ - -e 's,include/linux/v4l2-common\.h,include/uapi/linux/v4l2-common\.h,g' \ - -e 's,include/linux/v4l2-controls\.h,include/uapi/linux/v4l2-controls\.h,g' \ - -e 's,include/linux/v4l2-dv-timings\.h,include/uapi/linux/v4l2-dv-timings\.h,g' \ - -e 's,include/linux/v4l2-mediabus\.h,include/uapi/linux/v4l2-mediabus\.h,g' \ - -e 's,include/linux/v4l2-subdev\.h,include/uapi/linux/v4l2-subdev\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-common\.h,drivers/media/common/b2c2/flexcop-common\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-eeprom\.c,drivers/media/common/b2c2/flexcop-eeprom\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-fe-tuner\.c,drivers/media/common/b2c2/flexcop-fe-tuner\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-hw-filter\.c,drivers/media/common/b2c2/flexcop-hw-filter\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-i2c\.c,drivers/media/common/b2c2/flexcop-i2c\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-misc\.c,drivers/media/common/b2c2/flexcop-misc\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-reg\.h,drivers/media/common/b2c2/flexcop-reg\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-sram\.c,drivers/media/common/b2c2/flexcop-sram\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop\.c,drivers/media/common/b2c2/flexcop\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop\.h,drivers/media/common/b2c2/flexcop\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop_ibi_value_be\.h,drivers/media/common/b2c2/flexcop_ibi_value_be\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop_ibi_value_le\.h,drivers/media/common/b2c2/flexcop_ibi_value_le\.h,g' \ - -e 's,drivers/media/common/saa7146_core\.c,drivers/media/common/saa7146/saa7146_core\.c,g' \ - -e 's,drivers/media/common/saa7146_fops\.c,drivers/media/common/saa7146/saa7146_fops\.c,g' \ - -e 's,drivers/media/common/saa7146_hlp\.c,drivers/media/common/saa7146/saa7146_hlp\.c,g' \ - -e 's,drivers/media/common/saa7146_i2c\.c,drivers/media/common/saa7146/saa7146_i2c\.c,g' \ - -e 's,drivers/media/common/saa7146_vbi\.c,drivers/media/common/saa7146/saa7146_vbi\.c,g' \ - -e 's,drivers/media/common/saa7146_video\.c,drivers/media/common/saa7146/saa7146_video\.c,g' \ - -e 's,drivers/media/dvb/siano/Kconfig,drivers/media/common/siano/Kconfig,g' \ - -e 's,drivers/media/dvb/siano/Makefile,drivers/media/common/siano/Makefile,g' \ - -e 's,drivers/media/dvb/siano/sms-cards\.c,drivers/media/common/siano/sms-cards\.c,g' \ - -e 's,drivers/media/dvb/siano/sms-cards\.h,drivers/media/common/siano/sms-cards\.h,g' \ - -e 's,drivers/media/dvb/siano/smscoreapi\.c,drivers/media/common/siano/smscoreapi\.c,g' \ - -e 's,drivers/media/dvb/siano/smscoreapi\.h,drivers/media/common/siano/smscoreapi\.h,g' \ - -e 's,drivers/media/dvb/siano/smsdvb\.c,drivers/media/common/siano/smsdvb\.c,g' \ - -e 's,drivers/media/dvb/siano/smsendian\.c,drivers/media/common/siano/smsendian\.c,g' \ - -e 's,drivers/media/dvb/siano/smsendian\.h,drivers/media/common/siano/smsendian\.h,g' \ - -e 's,drivers/media/dvb/siano/smsir\.c,drivers/media/common/siano/smsir\.c,g' \ - -e 's,drivers/media/dvb/siano/smsir\.h,drivers/media/common/siano/smsir\.h,g' \ - -e 's,drivers/media/dvb/Kconfig,drivers/media/dvb-core/Kconfig,g' \ - -e 's,drivers/media/dvb/dvb-core/Makefile,drivers/media/dvb-core/Makefile,g' \ - -e 's,drivers/media/dvb/dvb-core/demux\.h,drivers/media/dvb-core/demux\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dmxdev\.c,drivers/media/dvb-core/dmxdev\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dmxdev\.h,drivers/media/dvb-core/dmxdev\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb-usb-ids\.h,drivers/media/dvb-core/dvb-usb-ids\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_ca_en50221\.c,drivers/media/dvb-core/dvb_ca_en50221\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_ca_en50221\.h,drivers/media/dvb-core/dvb_ca_en50221\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_demux\.c,drivers/media/dvb-core/dvb_demux\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_demux\.h,drivers/media/dvb-core/dvb_demux\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_filter\.c,drivers/media/dvb-core/dvb_filter\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_filter\.h,drivers/media/dvb-core/dvb_filter\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_frontend\.c,drivers/media/dvb-core/dvb_frontend\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_frontend\.h,drivers/media/dvb-core/dvb_frontend\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_math\.c,drivers/media/dvb-core/dvb_math\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_math\.h,drivers/media/dvb-core/dvb_math\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_net\.c,drivers/media/dvb-core/dvb_net\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_net\.h,drivers/media/dvb-core/dvb_net\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_ringbuffer\.c,drivers/media/dvb-core/dvb_ringbuffer\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvb_ringbuffer\.h,drivers/media/dvb-core/dvb_ringbuffer\.h,g' \ - -e 's,drivers/media/dvb/dvb-core/dvbdev\.c,drivers/media/dvb-core/dvbdev\.c,g' \ - -e 's,drivers/media/dvb/dvb-core/dvbdev\.h,drivers/media/dvb-core/dvbdev\.h,g' \ - -e 's,drivers/media/dvb/frontends/Kconfig,drivers/media/dvb-frontends/Kconfig,g' \ - -e 's,drivers/media/dvb/frontends/Makefile,drivers/media/dvb-frontends/Makefile,g' \ - -e 's,drivers/media/dvb/frontends/a8293\.c,drivers/media/dvb-frontends/a8293\.c,g' \ - -e 's,drivers/media/dvb/frontends/a8293\.h,drivers/media/dvb-frontends/a8293\.h,g' \ - -e 's,drivers/media/dvb/frontends/af9013\.c,drivers/media/dvb-frontends/af9013\.c,g' \ - -e 's,drivers/media/dvb/frontends/af9013\.h,drivers/media/dvb-frontends/af9013\.h,g' \ - -e 's,drivers/media/dvb/frontends/af9013_priv\.h,drivers/media/dvb-frontends/af9013_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/af9033\.c,drivers/media/dvb-frontends/af9033\.c,g' \ - -e 's,drivers/media/dvb/frontends/af9033\.h,drivers/media/dvb-frontends/af9033\.h,g' \ - -e 's,drivers/media/dvb/frontends/af9033_priv\.h,drivers/media/dvb-frontends/af9033_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/atbm8830\.c,drivers/media/dvb-frontends/atbm8830\.c,g' \ - -e 's,drivers/media/dvb/frontends/atbm8830\.h,drivers/media/dvb-frontends/atbm8830\.h,g' \ - -e 's,drivers/media/dvb/frontends/atbm8830_priv\.h,drivers/media/dvb-frontends/atbm8830_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/au8522\.h,drivers/media/dvb-frontends/au8522\.h,g' \ - -e 's,drivers/media/dvb/frontends/au8522_common\.c,drivers/media/dvb-frontends/au8522_common\.c,g' \ - -e 's,drivers/media/dvb/frontends/au8522_decoder\.c,drivers/media/dvb-frontends/au8522_decoder\.c,g' \ - -e 's,drivers/media/dvb/frontends/au8522_dig\.c,drivers/media/dvb-frontends/au8522_dig\.c,g' \ - -e 's,drivers/media/dvb/frontends/au8522_priv\.h,drivers/media/dvb-frontends/au8522_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/bcm3510\.c,drivers/media/dvb-frontends/bcm3510\.c,g' \ - -e 's,drivers/media/dvb/frontends/bcm3510\.h,drivers/media/dvb-frontends/bcm3510\.h,g' \ - -e 's,drivers/media/dvb/frontends/bcm3510_priv\.h,drivers/media/dvb-frontends/bcm3510_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/bsbe1-d01a\.h,drivers/media/dvb-frontends/bsbe1-d01a\.h,g' \ - -e 's,drivers/media/dvb/frontends/bsbe1\.h,drivers/media/dvb-frontends/bsbe1\.h,g' \ - -e 's,drivers/media/dvb/frontends/bsru6\.h,drivers/media/dvb-frontends/bsru6\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx22700\.c,drivers/media/dvb-frontends/cx22700\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx22700\.h,drivers/media/dvb-frontends/cx22700\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx22702\.c,drivers/media/dvb-frontends/cx22702\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx22702\.h,drivers/media/dvb-frontends/cx22702\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx24110\.c,drivers/media/dvb-frontends/cx24110\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx24110\.h,drivers/media/dvb-frontends/cx24110\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx24113\.c,drivers/media/dvb-frontends/cx24113\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx24113\.h,drivers/media/dvb-frontends/cx24113\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx24116\.c,drivers/media/dvb-frontends/cx24116\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx24116\.h,drivers/media/dvb-frontends/cx24116\.h,g' \ - -e 's,drivers/media/dvb/frontends/cx24123\.c,drivers/media/dvb-frontends/cx24123\.c,g' \ - -e 's,drivers/media/dvb/frontends/cx24123\.h,drivers/media/dvb-frontends/cx24123\.h,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r\.h,drivers/media/dvb-frontends/cxd2820r\.h,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r_c\.c,drivers/media/dvb-frontends/cxd2820r_c\.c,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r_core\.c,drivers/media/dvb-frontends/cxd2820r_core\.c,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r_priv\.h,drivers/media/dvb-frontends/cxd2820r_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r_t\.c,drivers/media/dvb-frontends/cxd2820r_t\.c,g' \ - -e 's,drivers/media/dvb/frontends/cxd2820r_t2\.c,drivers/media/dvb-frontends/cxd2820r_t2\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib0070\.c,drivers/media/dvb-frontends/dib0070\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib0070\.h,drivers/media/dvb-frontends/dib0070\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib0090\.c,drivers/media/dvb-frontends/dib0090\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib0090\.h,drivers/media/dvb-frontends/dib0090\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib3000\.h,drivers/media/dvb-frontends/dib3000\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib3000mb\.c,drivers/media/dvb-frontends/dib3000mb\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib3000mb_priv\.h,drivers/media/dvb-frontends/dib3000mb_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib3000mc\.c,drivers/media/dvb-frontends/dib3000mc\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib3000mc\.h,drivers/media/dvb-frontends/dib3000mc\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib7000m\.c,drivers/media/dvb-frontends/dib7000m\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib7000m\.h,drivers/media/dvb-frontends/dib7000m\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib7000p\.c,drivers/media/dvb-frontends/dib7000p\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib7000p\.h,drivers/media/dvb-frontends/dib7000p\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib8000\.c,drivers/media/dvb-frontends/dib8000\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib8000\.h,drivers/media/dvb-frontends/dib8000\.h,g' \ - -e 's,drivers/media/dvb/frontends/dib9000\.c,drivers/media/dvb-frontends/dib9000\.c,g' \ - -e 's,drivers/media/dvb/frontends/dib9000\.h,drivers/media/dvb-frontends/dib9000\.h,g' \ - -e 's,drivers/media/dvb/frontends/dibx000_common\.c,drivers/media/dvb-frontends/dibx000_common\.c,g' \ - -e 's,drivers/media/dvb/frontends/dibx000_common\.h,drivers/media/dvb-frontends/dibx000_common\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxd\.h,drivers/media/dvb-frontends/drxd\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxd_firm\.c,drivers/media/dvb-frontends/drxd_firm\.c,g' \ - -e 's,drivers/media/dvb/frontends/drxd_firm\.h,drivers/media/dvb-frontends/drxd_firm\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxd_hard\.c,drivers/media/dvb-frontends/drxd_hard\.c,g' \ - -e 's,drivers/media/dvb/frontends/drxd_map_firm\.h,drivers/media/dvb-frontends/drxd_map_firm\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxk\.h,drivers/media/dvb-frontends/drxk\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxk_hard\.c,drivers/media/dvb-frontends/drxk_hard\.c,g' \ - -e 's,drivers/media/dvb/frontends/drxk_hard\.h,drivers/media/dvb-frontends/drxk_hard\.h,g' \ - -e 's,drivers/media/dvb/frontends/drxk_map\.h,drivers/media/dvb-frontends/drxk_map\.h,g' \ - -e 's,drivers/media/dvb/frontends/ds3000\.c,drivers/media/dvb-frontends/ds3000\.c,g' \ - -e 's,drivers/media/dvb/frontends/ds3000\.h,drivers/media/dvb-frontends/ds3000\.h,g' \ - -e 's,drivers/media/dvb/frontends/dvb-pll\.c,drivers/media/dvb-frontends/dvb-pll\.c,g' \ - -e 's,drivers/media/dvb/frontends/dvb-pll\.h,drivers/media/dvb-frontends/dvb-pll\.h,g' \ - -e 's,drivers/media/dvb/frontends/dvb_dummy_fe\.c,drivers/media/dvb-frontends/dvb_dummy_fe\.c,g' \ - -e 's,drivers/media/dvb/frontends/dvb_dummy_fe\.h,drivers/media/dvb-frontends/dvb_dummy_fe\.h,g' \ - -e 's,drivers/media/dvb/frontends/ec100\.c,drivers/media/dvb-frontends/ec100\.c,g' \ - -e 's,drivers/media/dvb/frontends/ec100\.h,drivers/media/dvb-frontends/ec100\.h,g' \ - -e 's,drivers/media/dvb/frontends/ec100_priv\.h,drivers/media/dvb-frontends/ec100_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/eds1547\.h,drivers/media/dvb-frontends/eds1547\.h,g' \ - -e 's,drivers/media/dvb/frontends/hd29l2\.c,drivers/media/dvb-frontends/hd29l2\.c,g' \ - -e 's,drivers/media/dvb/frontends/hd29l2\.h,drivers/media/dvb-frontends/hd29l2\.h,g' \ - -e 's,drivers/media/dvb/frontends/hd29l2_priv\.h,drivers/media/dvb-frontends/hd29l2_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/isl6405\.c,drivers/media/dvb-frontends/isl6405\.c,g' \ - -e 's,drivers/media/dvb/frontends/isl6405\.h,drivers/media/dvb-frontends/isl6405\.h,g' \ - -e 's,drivers/media/dvb/frontends/isl6421\.c,drivers/media/dvb-frontends/isl6421\.c,g' \ - -e 's,drivers/media/dvb/frontends/isl6421\.h,drivers/media/dvb-frontends/isl6421\.h,g' \ - -e 's,drivers/media/dvb/frontends/isl6423\.c,drivers/media/dvb-frontends/isl6423\.c,g' \ - -e 's,drivers/media/dvb/frontends/isl6423\.h,drivers/media/dvb-frontends/isl6423\.h,g' \ - -e 's,drivers/media/dvb/frontends/it913x-fe-priv\.h,drivers/media/dvb-frontends/it913x-fe-priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/it913x-fe\.c,drivers/media/dvb-frontends/it913x-fe\.c,g' \ - -e 's,drivers/media/dvb/frontends/it913x-fe\.h,drivers/media/dvb-frontends/it913x-fe\.h,g' \ - -e 's,drivers/media/dvb/frontends/itd1000\.c,drivers/media/dvb-frontends/itd1000\.c,g' \ - -e 's,drivers/media/dvb/frontends/itd1000\.h,drivers/media/dvb-frontends/itd1000\.h,g' \ - -e 's,drivers/media/dvb/frontends/itd1000_priv\.h,drivers/media/dvb-frontends/itd1000_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/ix2505v\.c,drivers/media/dvb-frontends/ix2505v\.c,g' \ - -e 's,drivers/media/dvb/frontends/ix2505v\.h,drivers/media/dvb-frontends/ix2505v\.h,g' \ - -e 's,drivers/media/dvb/frontends/l64781\.c,drivers/media/dvb-frontends/l64781\.c,g' \ - -e 's,drivers/media/dvb/frontends/l64781\.h,drivers/media/dvb-frontends/l64781\.h,g' \ - -e 's,drivers/media/dvb/frontends/lg2160\.c,drivers/media/dvb-frontends/lg2160\.c,g' \ - -e 's,drivers/media/dvb/frontends/lg2160\.h,drivers/media/dvb-frontends/lg2160\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgdt3305\.c,drivers/media/dvb-frontends/lgdt3305\.c,g' \ - -e 's,drivers/media/dvb/frontends/lgdt3305\.h,drivers/media/dvb-frontends/lgdt3305\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgdt330x\.c,drivers/media/dvb-frontends/lgdt330x\.c,g' \ - -e 's,drivers/media/dvb/frontends/lgdt330x\.h,drivers/media/dvb-frontends/lgdt330x\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgdt330x_priv\.h,drivers/media/dvb-frontends/lgdt330x_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgs8gl5\.c,drivers/media/dvb-frontends/lgs8gl5\.c,g' \ - -e 's,drivers/media/dvb/frontends/lgs8gl5\.h,drivers/media/dvb-frontends/lgs8gl5\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgs8gxx\.c,drivers/media/dvb-frontends/lgs8gxx\.c,g' \ - -e 's,drivers/media/dvb/frontends/lgs8gxx\.h,drivers/media/dvb-frontends/lgs8gxx\.h,g' \ - -e 's,drivers/media/dvb/frontends/lgs8gxx_priv\.h,drivers/media/dvb-frontends/lgs8gxx_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/lnbh24\.h,drivers/media/dvb-frontends/lnbh24\.h,g' \ - -e 's,drivers/media/dvb/frontends/lnbp21\.c,drivers/media/dvb-frontends/lnbp21\.c,g' \ - -e 's,drivers/media/dvb/frontends/lnbp21\.h,drivers/media/dvb-frontends/lnbp21\.h,g' \ - -e 's,drivers/media/dvb/frontends/lnbp22\.c,drivers/media/dvb-frontends/lnbp22\.c,g' \ - -e 's,drivers/media/dvb/frontends/lnbp22\.h,drivers/media/dvb-frontends/lnbp22\.h,g' \ - -e 's,drivers/media/dvb/frontends/m88rs2000\.c,drivers/media/dvb-frontends/m88rs2000\.c,g' \ - -e 's,drivers/media/dvb/frontends/m88rs2000\.h,drivers/media/dvb-frontends/m88rs2000\.h,g' \ - -e 's,drivers/media/dvb/frontends/mb86a16\.c,drivers/media/dvb-frontends/mb86a16\.c,g' \ - -e 's,drivers/media/dvb/frontends/mb86a16\.h,drivers/media/dvb-frontends/mb86a16\.h,g' \ - -e 's,drivers/media/dvb/frontends/mb86a16_priv\.h,drivers/media/dvb-frontends/mb86a16_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/mb86a20s\.c,drivers/media/dvb-frontends/mb86a20s\.c,g' \ - -e 's,drivers/media/dvb/frontends/mb86a20s\.h,drivers/media/dvb-frontends/mb86a20s\.h,g' \ - -e 's,drivers/media/dvb/frontends/mt312\.c,drivers/media/dvb-frontends/mt312\.c,g' \ - -e 's,drivers/media/dvb/frontends/mt312\.h,drivers/media/dvb-frontends/mt312\.h,g' \ - -e 's,drivers/media/dvb/frontends/mt312_priv\.h,drivers/media/dvb-frontends/mt312_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/mt352\.c,drivers/media/dvb-frontends/mt352\.c,g' \ - -e 's,drivers/media/dvb/frontends/mt352\.h,drivers/media/dvb-frontends/mt352\.h,g' \ - -e 's,drivers/media/dvb/frontends/mt352_priv\.h,drivers/media/dvb-frontends/mt352_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/nxt200x\.c,drivers/media/dvb-frontends/nxt200x\.c,g' \ - -e 's,drivers/media/dvb/frontends/nxt200x\.h,drivers/media/dvb-frontends/nxt200x\.h,g' \ - -e 's,drivers/media/dvb/frontends/nxt6000\.c,drivers/media/dvb-frontends/nxt6000\.c,g' \ - -e 's,drivers/media/dvb/frontends/nxt6000\.h,drivers/media/dvb-frontends/nxt6000\.h,g' \ - -e 's,drivers/media/dvb/frontends/nxt6000_priv\.h,drivers/media/dvb-frontends/nxt6000_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/or51132\.c,drivers/media/dvb-frontends/or51132\.c,g' \ - -e 's,drivers/media/dvb/frontends/or51132\.h,drivers/media/dvb-frontends/or51132\.h,g' \ - -e 's,drivers/media/dvb/frontends/or51211\.c,drivers/media/dvb-frontends/or51211\.c,g' \ - -e 's,drivers/media/dvb/frontends/or51211\.h,drivers/media/dvb-frontends/or51211\.h,g' \ - -e 's,drivers/media/dvb/frontends/rtl2830\.c,drivers/media/dvb-frontends/rtl2830\.c,g' \ - -e 's,drivers/media/dvb/frontends/rtl2830\.h,drivers/media/dvb-frontends/rtl2830\.h,g' \ - -e 's,drivers/media/dvb/frontends/rtl2830_priv\.h,drivers/media/dvb-frontends/rtl2830_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/rtl2832\.c,drivers/media/dvb-frontends/rtl2832\.c,g' \ - -e 's,drivers/media/dvb/frontends/rtl2832\.h,drivers/media/dvb-frontends/rtl2832\.h,g' \ - -e 's,drivers/media/dvb/frontends/rtl2832_priv\.h,drivers/media/dvb-frontends/rtl2832_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/s5h1409\.c,drivers/media/dvb-frontends/s5h1409\.c,g' \ - -e 's,drivers/media/dvb/frontends/s5h1409\.h,drivers/media/dvb-frontends/s5h1409\.h,g' \ - -e 's,drivers/media/dvb/frontends/s5h1411\.c,drivers/media/dvb-frontends/s5h1411\.c,g' \ - -e 's,drivers/media/dvb/frontends/s5h1411\.h,drivers/media/dvb-frontends/s5h1411\.h,g' \ - -e 's,drivers/media/dvb/frontends/s5h1420\.c,drivers/media/dvb-frontends/s5h1420\.c,g' \ - -e 's,drivers/media/dvb/frontends/s5h1420\.h,drivers/media/dvb-frontends/s5h1420\.h,g' \ - -e 's,drivers/media/dvb/frontends/s5h1420_priv\.h,drivers/media/dvb-frontends/s5h1420_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/s5h1432\.c,drivers/media/dvb-frontends/s5h1432\.c,g' \ - -e 's,drivers/media/dvb/frontends/s5h1432\.h,drivers/media/dvb-frontends/s5h1432\.h,g' \ - -e 's,drivers/media/dvb/frontends/s921\.c,drivers/media/dvb-frontends/s921\.c,g' \ - -e 's,drivers/media/dvb/frontends/s921\.h,drivers/media/dvb-frontends/s921\.h,g' \ - -e 's,drivers/media/dvb/frontends/si21xx\.c,drivers/media/dvb-frontends/si21xx\.c,g' \ - -e 's,drivers/media/dvb/frontends/si21xx\.h,drivers/media/dvb-frontends/si21xx\.h,g' \ - -e 's,drivers/media/dvb/frontends/sp8870\.c,drivers/media/dvb-frontends/sp8870\.c,g' \ - -e 's,drivers/media/dvb/frontends/sp8870\.h,drivers/media/dvb-frontends/sp8870\.h,g' \ - -e 's,drivers/media/dvb/frontends/sp887x\.c,drivers/media/dvb-frontends/sp887x\.c,g' \ - -e 's,drivers/media/dvb/frontends/sp887x\.h,drivers/media/dvb-frontends/sp887x\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_algo\.c,drivers/media/dvb-frontends/stb0899_algo\.c,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_cfg\.h,drivers/media/dvb-frontends/stb0899_cfg\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_drv\.c,drivers/media/dvb-frontends/stb0899_drv\.c,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_drv\.h,drivers/media/dvb-frontends/stb0899_drv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_priv\.h,drivers/media/dvb-frontends/stb0899_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb0899_reg\.h,drivers/media/dvb-frontends/stb0899_reg\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb6000\.c,drivers/media/dvb-frontends/stb6000\.c,g' \ - -e 's,drivers/media/dvb/frontends/stb6000\.h,drivers/media/dvb-frontends/stb6000\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb6100\.c,drivers/media/dvb-frontends/stb6100\.c,g' \ - -e 's,drivers/media/dvb/frontends/stb6100\.h,drivers/media/dvb-frontends/stb6100\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb6100_cfg\.h,drivers/media/dvb-frontends/stb6100_cfg\.h,g' \ - -e 's,drivers/media/dvb/frontends/stb6100_proc\.h,drivers/media/dvb-frontends/stb6100_proc\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0288\.c,drivers/media/dvb-frontends/stv0288\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv0288\.h,drivers/media/dvb-frontends/stv0288\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0297\.c,drivers/media/dvb-frontends/stv0297\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv0297\.h,drivers/media/dvb-frontends/stv0297\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0299\.c,drivers/media/dvb-frontends/stv0299\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv0299\.h,drivers/media/dvb-frontends/stv0299\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0367\.c,drivers/media/dvb-frontends/stv0367\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv0367\.h,drivers/media/dvb-frontends/stv0367\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0367_priv\.h,drivers/media/dvb-frontends/stv0367_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0367_regs\.h,drivers/media/dvb-frontends/stv0367_regs\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0900\.h,drivers/media/dvb-frontends/stv0900\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0900_core\.c,drivers/media/dvb-frontends/stv0900_core\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv0900_init\.h,drivers/media/dvb-frontends/stv0900_init\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0900_priv\.h,drivers/media/dvb-frontends/stv0900_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0900_reg\.h,drivers/media/dvb-frontends/stv0900_reg\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv0900_sw\.c,drivers/media/dvb-frontends/stv0900_sw\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv090x\.c,drivers/media/dvb-frontends/stv090x\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv090x\.h,drivers/media/dvb-frontends/stv090x\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv090x_priv\.h,drivers/media/dvb-frontends/stv090x_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv090x_reg\.h,drivers/media/dvb-frontends/stv090x_reg\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv6110\.c,drivers/media/dvb-frontends/stv6110\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv6110\.h,drivers/media/dvb-frontends/stv6110\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv6110x\.c,drivers/media/dvb-frontends/stv6110x\.c,g' \ - -e 's,drivers/media/dvb/frontends/stv6110x\.h,drivers/media/dvb-frontends/stv6110x\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv6110x_priv\.h,drivers/media/dvb-frontends/stv6110x_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/stv6110x_reg\.h,drivers/media/dvb-frontends/stv6110x_reg\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda10021\.c,drivers/media/dvb-frontends/tda10021\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda10023\.c,drivers/media/dvb-frontends/tda10023\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda1002x\.h,drivers/media/dvb-frontends/tda1002x\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda10048\.c,drivers/media/dvb-frontends/tda10048\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda10048\.h,drivers/media/dvb-frontends/tda10048\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda1004x\.c,drivers/media/dvb-frontends/tda1004x\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda1004x\.h,drivers/media/dvb-frontends/tda1004x\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda10071\.c,drivers/media/dvb-frontends/tda10071\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda10071\.h,drivers/media/dvb-frontends/tda10071\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda10071_priv\.h,drivers/media/dvb-frontends/tda10071_priv\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda10086\.c,drivers/media/dvb-frontends/tda10086\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda10086\.h,drivers/media/dvb-frontends/tda10086\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda18271c2dd\.c,drivers/media/dvb-frontends/tda18271c2dd\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda18271c2dd\.h,drivers/media/dvb-frontends/tda18271c2dd\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda18271c2dd_maps\.h,drivers/media/dvb-frontends/tda18271c2dd_maps\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda665x\.c,drivers/media/dvb-frontends/tda665x\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda665x\.h,drivers/media/dvb-frontends/tda665x\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda8083\.c,drivers/media/dvb-frontends/tda8083\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda8083\.h,drivers/media/dvb-frontends/tda8083\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda8261\.c,drivers/media/dvb-frontends/tda8261\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda8261\.h,drivers/media/dvb-frontends/tda8261\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda8261_cfg\.h,drivers/media/dvb-frontends/tda8261_cfg\.h,g' \ - -e 's,drivers/media/dvb/frontends/tda826x\.c,drivers/media/dvb-frontends/tda826x\.c,g' \ - -e 's,drivers/media/dvb/frontends/tda826x\.h,drivers/media/dvb-frontends/tda826x\.h,g' \ - -e 's,drivers/media/dvb/frontends/tdhd1\.h,drivers/media/dvb-frontends/tdhd1\.h,g' \ - -e 's,drivers/media/dvb/frontends/tua6100\.c,drivers/media/dvb-frontends/tua6100\.c,g' \ - -e 's,drivers/media/dvb/frontends/tua6100\.h,drivers/media/dvb-frontends/tua6100\.h,g' \ - -e 's,drivers/media/dvb/frontends/ves1820\.c,drivers/media/dvb-frontends/ves1820\.c,g' \ - -e 's,drivers/media/dvb/frontends/ves1820\.h,drivers/media/dvb-frontends/ves1820\.h,g' \ - -e 's,drivers/media/dvb/frontends/ves1x93\.c,drivers/media/dvb-frontends/ves1x93\.c,g' \ - -e 's,drivers/media/dvb/frontends/ves1x93\.h,drivers/media/dvb-frontends/ves1x93\.h,g' \ - -e 's,drivers/media/dvb/frontends/z0194a\.h,drivers/media/dvb-frontends/z0194a\.h,g' \ - -e 's,drivers/media/dvb/frontends/zl10036\.c,drivers/media/dvb-frontends/zl10036\.c,g' \ - -e 's,drivers/media/dvb/frontends/zl10036\.h,drivers/media/dvb-frontends/zl10036\.h,g' \ - -e 's,drivers/media/dvb/frontends/zl10039\.c,drivers/media/dvb-frontends/zl10039\.c,g' \ - -e 's,drivers/media/dvb/frontends/zl10039\.h,drivers/media/dvb-frontends/zl10039\.h,g' \ - -e 's,drivers/media/dvb/frontends/zl10353\.c,drivers/media/dvb-frontends/zl10353\.c,g' \ - -e 's,drivers/media/dvb/frontends/zl10353\.h,drivers/media/dvb-frontends/zl10353\.h,g' \ - -e 's,drivers/media/dvb/frontends/zl10353_priv\.h,drivers/media/dvb-frontends/zl10353_priv\.h,g' \ - -e 's,drivers/media/dvb/firewire/Kconfig,drivers/media/firewire/Kconfig,g' \ - -e 's,drivers/media/dvb/firewire/Makefile,drivers/media/firewire/Makefile,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-avc\.c,drivers/media/firewire/firedtv-avc\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-ci\.c,drivers/media/firewire/firedtv-ci\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-dvb\.c,drivers/media/firewire/firedtv-dvb\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-fe\.c,drivers/media/firewire/firedtv-fe\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-fw\.c,drivers/media/firewire/firedtv-fw\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv-rc\.c,drivers/media/firewire/firedtv-rc\.c,g' \ - -e 's,drivers/media/dvb/firewire/firedtv\.h,drivers/media/firewire/firedtv\.h,g' \ - -e 's,drivers/media/video/adp1653\.c,drivers/media/i2c/adp1653\.c,g' \ - -e 's,drivers/media/video/adv7170\.c,drivers/media/i2c/adv7170\.c,g' \ - -e 's,drivers/media/video/adv7175\.c,drivers/media/i2c/adv7175\.c,g' \ - -e 's,drivers/media/video/adv7180\.c,drivers/media/i2c/adv7180\.c,g' \ - -e 's,drivers/media/video/adv7183\.c,drivers/media/i2c/adv7183\.c,g' \ - -e 's,drivers/media/video/adv7183_regs\.h,drivers/media/i2c/adv7183_regs\.h,g' \ - -e 's,drivers/media/video/adv7343\.c,drivers/media/i2c/adv7343\.c,g' \ - -e 's,drivers/media/video/adv7343_regs\.h,drivers/media/i2c/adv7343_regs\.h,g' \ - -e 's,drivers/media/video/adv7393\.c,drivers/media/i2c/adv7393\.c,g' \ - -e 's,drivers/media/video/adv7393_regs\.h,drivers/media/i2c/adv7393_regs\.h,g' \ - -e 's,drivers/media/video/ak881x\.c,drivers/media/i2c/ak881x\.c,g' \ - -e 's,drivers/media/video/aptina-pll\.c,drivers/media/i2c/aptina-pll\.c,g' \ - -e 's,drivers/media/video/aptina-pll\.h,drivers/media/i2c/aptina-pll\.h,g' \ - -e 's,drivers/media/video/as3645a\.c,drivers/media/i2c/as3645a\.c,g' \ - -e 's,drivers/media/video/bt819\.c,drivers/media/i2c/bt819\.c,g' \ - -e 's,drivers/media/video/bt856\.c,drivers/media/i2c/bt856\.c,g' \ - -e 's,drivers/media/video/bt866\.c,drivers/media/i2c/bt866\.c,g' \ - -e 's,drivers/media/video/btcx-risc\.c,drivers/media/i2c/btcx-risc\.c,g' \ - -e 's,drivers/media/video/btcx-risc\.h,drivers/media/i2c/btcx-risc\.h,g' \ - -e 's,drivers/media/video/cs5345\.c,drivers/media/i2c/cs5345\.c,g' \ - -e 's,drivers/media/video/cs53l32a\.c,drivers/media/i2c/cs53l32a\.c,g' \ - -e 's,drivers/media/video/cx2341x\.c,drivers/media/i2c/cx2341x\.c,g' \ - -e 's,drivers/media/video/cx25840/Kconfig,drivers/media/i2c/cx25840/Kconfig,g' \ - -e 's,drivers/media/video/cx25840/Makefile,drivers/media/i2c/cx25840/Makefile,g' \ - -e 's,drivers/media/video/cx25840/cx25840-audio\.c,drivers/media/i2c/cx25840/cx25840-audio\.c,g' \ - -e 's,drivers/media/video/cx25840/cx25840-core\.c,drivers/media/i2c/cx25840/cx25840-core\.c,g' \ - -e 's,drivers/media/video/cx25840/cx25840-core\.h,drivers/media/i2c/cx25840/cx25840-core\.h,g' \ - -e 's,drivers/media/video/cx25840/cx25840-firmware\.c,drivers/media/i2c/cx25840/cx25840-firmware\.c,g' \ - -e 's,drivers/media/video/cx25840/cx25840-ir\.c,drivers/media/i2c/cx25840/cx25840-ir\.c,g' \ - -e 's,drivers/media/video/cx25840/cx25840-vbi\.c,drivers/media/i2c/cx25840/cx25840-vbi\.c,g' \ - -e 's,drivers/media/video/ir-kbd-i2c\.c,drivers/media/i2c/ir-kbd-i2c\.c,g' \ - -e 's,drivers/media/video/ks0127\.c,drivers/media/i2c/ks0127\.c,g' \ - -e 's,drivers/media/video/ks0127\.h,drivers/media/i2c/ks0127\.h,g' \ - -e 's,drivers/media/video/m52790\.c,drivers/media/i2c/m52790\.c,g' \ - -e 's,drivers/media/video/m5mols/Kconfig,drivers/media/i2c/m5mols/Kconfig,g' \ - -e 's,drivers/media/video/m5mols/Makefile,drivers/media/i2c/m5mols/Makefile,g' \ - -e 's,drivers/media/video/m5mols/m5mols\.h,drivers/media/i2c/m5mols/m5mols\.h,g' \ - -e 's,drivers/media/video/m5mols/m5mols_capture\.c,drivers/media/i2c/m5mols/m5mols_capture\.c,g' \ - -e 's,drivers/media/video/m5mols/m5mols_controls\.c,drivers/media/i2c/m5mols/m5mols_controls\.c,g' \ - -e 's,drivers/media/video/m5mols/m5mols_core\.c,drivers/media/i2c/m5mols/m5mols_core\.c,g' \ - -e 's,drivers/media/video/m5mols/m5mols_reg\.h,drivers/media/i2c/m5mols/m5mols_reg\.h,g' \ - -e 's,drivers/media/video/msp3400-driver\.c,drivers/media/i2c/msp3400-driver\.c,g' \ - -e 's,drivers/media/video/msp3400-driver\.h,drivers/media/i2c/msp3400-driver\.h,g' \ - -e 's,drivers/media/video/msp3400-kthreads\.c,drivers/media/i2c/msp3400-kthreads\.c,g' \ - -e 's,drivers/media/video/mt9m032\.c,drivers/media/i2c/mt9m032\.c,g' \ - -e 's,drivers/media/video/mt9p031\.c,drivers/media/i2c/mt9p031\.c,g' \ - -e 's,drivers/media/video/mt9t001\.c,drivers/media/i2c/mt9t001\.c,g' \ - -e 's,drivers/media/video/mt9v011\.c,drivers/media/i2c/mt9v011\.c,g' \ - -e 's,drivers/media/video/mt9v032\.c,drivers/media/i2c/mt9v032\.c,g' \ - -e 's,drivers/media/video/noon010pc30\.c,drivers/media/i2c/noon010pc30\.c,g' \ - -e 's,drivers/media/video/ov7670\.c,drivers/media/i2c/ov7670\.c,g' \ - -e 's,drivers/media/video/s5k6aa\.c,drivers/media/i2c/s5k6aa\.c,g' \ - -e 's,drivers/media/video/saa6588\.c,drivers/media/i2c/saa6588\.c,g' \ - -e 's,drivers/media/video/saa7110\.c,drivers/media/i2c/saa7110\.c,g' \ - -e 's,drivers/media/video/saa7115\.c,drivers/media/i2c/saa7115\.c,g' \ - -e 's,drivers/media/video/saa711x_regs\.h,drivers/media/i2c/saa711x_regs\.h,g' \ - -e 's,drivers/media/video/saa7127\.c,drivers/media/i2c/saa7127\.c,g' \ - -e 's,drivers/media/video/saa717x\.c,drivers/media/i2c/saa717x\.c,g' \ - -e 's,drivers/media/video/saa7185\.c,drivers/media/i2c/saa7185\.c,g' \ - -e 's,drivers/media/video/saa7191\.c,drivers/media/i2c/saa7191\.c,g' \ - -e 's,drivers/media/video/saa7191\.h,drivers/media/i2c/saa7191\.h,g' \ - -e 's,drivers/media/video/smiapp-pll\.c,drivers/media/i2c/smiapp-pll\.c,g' \ - -e 's,drivers/media/video/smiapp-pll\.h,drivers/media/i2c/smiapp-pll\.h,g' \ - -e 's,drivers/media/video/smiapp/Kconfig,drivers/media/i2c/smiapp/Kconfig,g' \ - -e 's,drivers/media/video/smiapp/Makefile,drivers/media/i2c/smiapp/Makefile,g' \ - -e 's,drivers/media/video/smiapp/smiapp-core\.c,drivers/media/i2c/smiapp/smiapp-core\.c,g' \ - -e 's,drivers/media/video/smiapp/smiapp-limits\.c,drivers/media/i2c/smiapp/smiapp-limits\.c,g' \ - -e 's,drivers/media/video/smiapp/smiapp-limits\.h,drivers/media/i2c/smiapp/smiapp-limits\.h,g' \ - -e 's,drivers/media/video/smiapp/smiapp-quirk\.c,drivers/media/i2c/smiapp/smiapp-quirk\.c,g' \ - -e 's,drivers/media/video/smiapp/smiapp-quirk\.h,drivers/media/i2c/smiapp/smiapp-quirk\.h,g' \ - -e 's,drivers/media/video/smiapp/smiapp-reg-defs\.h,drivers/media/i2c/smiapp/smiapp-reg-defs\.h,g' \ - -e 's,drivers/media/video/smiapp/smiapp-reg\.h,drivers/media/i2c/smiapp/smiapp-reg\.h,g' \ - -e 's,drivers/media/video/smiapp/smiapp-regs\.c,drivers/media/i2c/smiapp/smiapp-regs\.c,g' \ - -e 's,drivers/media/video/smiapp/smiapp-regs\.h,drivers/media/i2c/smiapp/smiapp-regs\.h,g' \ - -e 's,drivers/media/video/smiapp/smiapp\.h,drivers/media/i2c/smiapp/smiapp\.h,g' \ - -e 's,drivers/media/video/imx074\.c,drivers/media/i2c/soc_camera/imx074\.c,g' \ - -e 's,drivers/media/video/mt9m001\.c,drivers/media/i2c/soc_camera/mt9m001\.c,g' \ - -e 's,drivers/media/video/mt9m111\.c,drivers/media/i2c/soc_camera/mt9m111\.c,g' \ - -e 's,drivers/media/video/mt9t031\.c,drivers/media/i2c/soc_camera/mt9t031\.c,g' \ - -e 's,drivers/media/video/mt9t112\.c,drivers/media/i2c/soc_camera/mt9t112\.c,g' \ - -e 's,drivers/media/video/mt9v022\.c,drivers/media/i2c/soc_camera/mt9v022\.c,g' \ - -e 's,drivers/media/video/ov2640\.c,drivers/media/i2c/soc_camera/ov2640\.c,g' \ - -e 's,drivers/media/video/ov5642\.c,drivers/media/i2c/soc_camera/ov5642\.c,g' \ - -e 's,drivers/media/video/ov6650\.c,drivers/media/i2c/soc_camera/ov6650\.c,g' \ - -e 's,drivers/media/video/ov772x\.c,drivers/media/i2c/soc_camera/ov772x\.c,g' \ - -e 's,drivers/media/video/ov9640\.c,drivers/media/i2c/soc_camera/ov9640\.c,g' \ - -e 's,drivers/media/video/ov9640\.h,drivers/media/i2c/soc_camera/ov9640\.h,g' \ - -e 's,drivers/media/video/ov9740\.c,drivers/media/i2c/soc_camera/ov9740\.c,g' \ - -e 's,drivers/media/video/rj54n1cb0c\.c,drivers/media/i2c/soc_camera/rj54n1cb0c\.c,g' \ - -e 's,drivers/media/video/tw9910\.c,drivers/media/i2c/soc_camera/tw9910\.c,g' \ - -e 's,drivers/media/video/sr030pc30\.c,drivers/media/i2c/sr030pc30\.c,g' \ - -e 's,drivers/media/video/tcm825x\.c,drivers/media/i2c/tcm825x\.c,g' \ - -e 's,drivers/media/video/tcm825x\.h,drivers/media/i2c/tcm825x\.h,g' \ - -e 's,drivers/media/video/tda7432\.c,drivers/media/i2c/tda7432\.c,g' \ - -e 's,drivers/media/video/tda9840\.c,drivers/media/i2c/tda9840\.c,g' \ - -e 's,drivers/media/video/tea6415c\.c,drivers/media/i2c/tea6415c\.c,g' \ - -e 's,drivers/media/video/tea6415c\.h,drivers/media/i2c/tea6415c\.h,g' \ - -e 's,drivers/media/video/tea6420\.c,drivers/media/i2c/tea6420\.c,g' \ - -e 's,drivers/media/video/tea6420\.h,drivers/media/i2c/tea6420\.h,g' \ - -e 's,drivers/media/video/ths7303\.c,drivers/media/i2c/ths7303\.c,g' \ - -e 's,drivers/media/video/tlv320aic23b\.c,drivers/media/i2c/tlv320aic23b\.c,g' \ - -e 's,drivers/media/video/tvaudio\.c,drivers/media/i2c/tvaudio\.c,g' \ - -e 's,drivers/media/video/tveeprom\.c,drivers/media/i2c/tveeprom\.c,g' \ - -e 's,drivers/media/video/tvp514x\.c,drivers/media/i2c/tvp514x\.c,g' \ - -e 's,drivers/media/video/tvp514x_regs\.h,drivers/media/i2c/tvp514x_regs\.h,g' \ - -e 's,drivers/media/video/tvp5150\.c,drivers/media/i2c/tvp5150\.c,g' \ - -e 's,drivers/media/video/tvp5150_reg\.h,drivers/media/i2c/tvp5150_reg\.h,g' \ - -e 's,drivers/media/video/tvp7002\.c,drivers/media/i2c/tvp7002\.c,g' \ - -e 's,drivers/media/video/tvp7002_reg\.h,drivers/media/i2c/tvp7002_reg\.h,g' \ - -e 's,drivers/media/video/upd64031a\.c,drivers/media/i2c/upd64031a\.c,g' \ - -e 's,drivers/media/video/upd64083\.c,drivers/media/i2c/upd64083\.c,g' \ - -e 's,drivers/media/video/vp27smpx\.c,drivers/media/i2c/vp27smpx\.c,g' \ - -e 's,drivers/media/video/vpx3220\.c,drivers/media/i2c/vpx3220\.c,g' \ - -e 's,drivers/media/video/vs6624\.c,drivers/media/i2c/vs6624\.c,g' \ - -e 's,drivers/media/video/vs6624_regs\.h,drivers/media/i2c/vs6624_regs\.h,g' \ - -e 's,drivers/media/video/wm8739\.c,drivers/media/i2c/wm8739\.c,g' \ - -e 's,drivers/media/video/wm8775\.c,drivers/media/i2c/wm8775\.c,g' \ - -e 's,drivers/media/dvb/siano/smssdio\.c,drivers/media/mmc/siano/smssdio\.c,g' \ - -e 's,drivers/media/video/bw-qcam\.c,drivers/media/parport/bw-qcam\.c,g' \ - -e 's,drivers/media/video/c-qcam\.c,drivers/media/parport/c-qcam\.c,g' \ - -e 's,drivers/media/video/pms\.c,drivers/media/parport/pms\.c,g' \ - -e 's,drivers/media/video/w9966\.c,drivers/media/parport/w9966\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-dma\.c,drivers/media/pci/b2c2/flexcop-dma\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-pci\.c,drivers/media/pci/b2c2/flexcop-pci\.c,g' \ - -e 's,drivers/media/dvb/bt8xx/Kconfig,drivers/media/pci/bt8xx/Kconfig,g' \ - -e 's,drivers/media/video/bt8xx/Makefile,drivers/media/pci/bt8xx/Makefile,g' \ - -e 's,drivers/media/video/bt8xx/bt848\.h,drivers/media/pci/bt8xx/bt848\.h,g' \ - -e 's,drivers/media/dvb/bt8xx/bt878\.c,drivers/media/pci/bt8xx/bt878\.c,g' \ - -e 's,drivers/media/dvb/bt8xx/bt878\.h,drivers/media/pci/bt8xx/bt878\.h,g' \ - -e 's,drivers/media/video/bt8xx/bttv-audio-hook\.c,drivers/media/pci/bt8xx/bttv-audio-hook\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-audio-hook\.h,drivers/media/pci/bt8xx/bttv-audio-hook\.h,g' \ - -e 's,drivers/media/video/bt8xx/bttv-cards\.c,drivers/media/pci/bt8xx/bttv-cards\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-driver\.c,drivers/media/pci/bt8xx/bttv-driver\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-gpio\.c,drivers/media/pci/bt8xx/bttv-gpio\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-i2c\.c,drivers/media/pci/bt8xx/bttv-i2c\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-if\.c,drivers/media/pci/bt8xx/bttv-if\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-input\.c,drivers/media/pci/bt8xx/bttv-input\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-risc\.c,drivers/media/pci/bt8xx/bttv-risc\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv-vbi\.c,drivers/media/pci/bt8xx/bttv-vbi\.c,g' \ - -e 's,drivers/media/video/bt8xx/bttv\.h,drivers/media/pci/bt8xx/bttv\.h,g' \ - -e 's,drivers/media/video/bt8xx/bttvp\.h,drivers/media/pci/bt8xx/bttvp\.h,g' \ - -e 's,drivers/media/dvb/bt8xx/dst\.c,drivers/media/pci/bt8xx/dst\.c,g' \ - -e 's,drivers/media/dvb/bt8xx/dst_ca\.c,drivers/media/pci/bt8xx/dst_ca\.c,g' \ - -e 's,drivers/media/dvb/bt8xx/dst_ca\.h,drivers/media/pci/bt8xx/dst_ca\.h,g' \ - -e 's,drivers/media/dvb/bt8xx/dst_common\.h,drivers/media/pci/bt8xx/dst_common\.h,g' \ - -e 's,drivers/media/dvb/bt8xx/dst_priv\.h,drivers/media/pci/bt8xx/dst_priv\.h,g' \ - -e 's,drivers/media/dvb/bt8xx/dvb-bt8xx\.c,drivers/media/pci/bt8xx/dvb-bt8xx\.c,g' \ - -e 's,drivers/media/dvb/bt8xx/dvb-bt8xx\.h,drivers/media/pci/bt8xx/dvb-bt8xx\.h,g' \ - -e 's,drivers/media/video/cx18/Kconfig,drivers/media/pci/cx18/Kconfig,g' \ - -e 's,drivers/media/video/cx18/Makefile,drivers/media/pci/cx18/Makefile,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa-main\.c,drivers/media/pci/cx18/cx18-alsa-main\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa-mixer\.c,drivers/media/pci/cx18/cx18-alsa-mixer\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa-mixer\.h,drivers/media/pci/cx18/cx18-alsa-mixer\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa-pcm\.c,drivers/media/pci/cx18/cx18-alsa-pcm\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa-pcm\.h,drivers/media/pci/cx18/cx18-alsa-pcm\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-alsa\.h,drivers/media/pci/cx18/cx18-alsa\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-audio\.c,drivers/media/pci/cx18/cx18-audio\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-audio\.h,drivers/media/pci/cx18/cx18-audio\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-av-audio\.c,drivers/media/pci/cx18/cx18-av-audio\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-av-core\.c,drivers/media/pci/cx18/cx18-av-core\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-av-core\.h,drivers/media/pci/cx18/cx18-av-core\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-av-firmware\.c,drivers/media/pci/cx18/cx18-av-firmware\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-av-vbi\.c,drivers/media/pci/cx18/cx18-av-vbi\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-cards\.c,drivers/media/pci/cx18/cx18-cards\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-cards\.h,drivers/media/pci/cx18/cx18-cards\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-controls\.c,drivers/media/pci/cx18/cx18-controls\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-controls\.h,drivers/media/pci/cx18/cx18-controls\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-driver\.c,drivers/media/pci/cx18/cx18-driver\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-driver\.h,drivers/media/pci/cx18/cx18-driver\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-dvb\.c,drivers/media/pci/cx18/cx18-dvb\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-dvb\.h,drivers/media/pci/cx18/cx18-dvb\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-fileops\.c,drivers/media/pci/cx18/cx18-fileops\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-fileops\.h,drivers/media/pci/cx18/cx18-fileops\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-firmware\.c,drivers/media/pci/cx18/cx18-firmware\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-firmware\.h,drivers/media/pci/cx18/cx18-firmware\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-gpio\.c,drivers/media/pci/cx18/cx18-gpio\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-gpio\.h,drivers/media/pci/cx18/cx18-gpio\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-i2c\.c,drivers/media/pci/cx18/cx18-i2c\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-i2c\.h,drivers/media/pci/cx18/cx18-i2c\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-io\.c,drivers/media/pci/cx18/cx18-io\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-io\.h,drivers/media/pci/cx18/cx18-io\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-ioctl\.c,drivers/media/pci/cx18/cx18-ioctl\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-ioctl\.h,drivers/media/pci/cx18/cx18-ioctl\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-irq\.c,drivers/media/pci/cx18/cx18-irq\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-irq\.h,drivers/media/pci/cx18/cx18-irq\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-mailbox\.c,drivers/media/pci/cx18/cx18-mailbox\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-mailbox\.h,drivers/media/pci/cx18/cx18-mailbox\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-queue\.c,drivers/media/pci/cx18/cx18-queue\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-queue\.h,drivers/media/pci/cx18/cx18-queue\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-scb\.c,drivers/media/pci/cx18/cx18-scb\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-scb\.h,drivers/media/pci/cx18/cx18-scb\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-streams\.c,drivers/media/pci/cx18/cx18-streams\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-streams\.h,drivers/media/pci/cx18/cx18-streams\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-vbi\.c,drivers/media/pci/cx18/cx18-vbi\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-vbi\.h,drivers/media/pci/cx18/cx18-vbi\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-version\.h,drivers/media/pci/cx18/cx18-version\.h,g' \ - -e 's,drivers/media/video/cx18/cx18-video\.c,drivers/media/pci/cx18/cx18-video\.c,g' \ - -e 's,drivers/media/video/cx18/cx18-video\.h,drivers/media/pci/cx18/cx18-video\.h,g' \ - -e 's,drivers/media/video/cx18/cx23418\.h,drivers/media/pci/cx18/cx23418\.h,g' \ - -e 's,drivers/media/video/cx23885/Kconfig,drivers/media/pci/cx23885/Kconfig,g' \ - -e 's,drivers/media/video/cx23885/Makefile,drivers/media/pci/cx23885/Makefile,g' \ - -e 's,drivers/media/video/cx23885/altera-ci\.c,drivers/media/pci/cx23885/altera-ci\.c,g' \ - -e 's,drivers/media/video/cx23885/altera-ci\.h,drivers/media/pci/cx23885/altera-ci\.h,g' \ - -e 's,drivers/media/video/cx23885/cimax2\.c,drivers/media/pci/cx23885/cimax2\.c,g' \ - -e 's,drivers/media/video/cx23885/cimax2\.h,drivers/media/pci/cx23885/cimax2\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-417\.c,drivers/media/pci/cx23885/cx23885-417\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-alsa\.c,drivers/media/pci/cx23885/cx23885-alsa\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-av\.c,drivers/media/pci/cx23885/cx23885-av\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-av\.h,drivers/media/pci/cx23885/cx23885-av\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-cards\.c,drivers/media/pci/cx23885/cx23885-cards\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-core\.c,drivers/media/pci/cx23885/cx23885-core\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-dvb\.c,drivers/media/pci/cx23885/cx23885-dvb\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-f300\.c,drivers/media/pci/cx23885/cx23885-f300\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-f300\.h,drivers/media/pci/cx23885/cx23885-f300\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-i2c\.c,drivers/media/pci/cx23885/cx23885-i2c\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-input\.c,drivers/media/pci/cx23885/cx23885-input\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-input\.h,drivers/media/pci/cx23885/cx23885-input\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-ioctl\.c,drivers/media/pci/cx23885/cx23885-ioctl\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-ioctl\.h,drivers/media/pci/cx23885/cx23885-ioctl\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-ir\.c,drivers/media/pci/cx23885/cx23885-ir\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-ir\.h,drivers/media/pci/cx23885/cx23885-ir\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-reg\.h,drivers/media/pci/cx23885/cx23885-reg\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23885-vbi\.c,drivers/media/pci/cx23885/cx23885-vbi\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885-video\.c,drivers/media/pci/cx23885/cx23885-video\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23885\.h,drivers/media/pci/cx23885/cx23885\.h,g' \ - -e 's,drivers/media/video/cx23885/cx23888-ir\.c,drivers/media/pci/cx23885/cx23888-ir\.c,g' \ - -e 's,drivers/media/video/cx23885/cx23888-ir\.h,drivers/media/pci/cx23885/cx23888-ir\.h,g' \ - -e 's,drivers/media/video/cx23885/netup-eeprom\.c,drivers/media/pci/cx23885/netup-eeprom\.c,g' \ - -e 's,drivers/media/video/cx23885/netup-eeprom\.h,drivers/media/pci/cx23885/netup-eeprom\.h,g' \ - -e 's,drivers/media/video/cx23885/netup-init\.c,drivers/media/pci/cx23885/netup-init\.c,g' \ - -e 's,drivers/media/video/cx23885/netup-init\.h,drivers/media/pci/cx23885/netup-init\.h,g' \ - -e 's,drivers/media/video/cx25821/Kconfig,drivers/media/pci/cx25821/Kconfig,g' \ - -e 's,drivers/media/video/cx25821/Makefile,drivers/media/pci/cx25821/Makefile,g' \ - -e 's,drivers/media/video/cx25821/cx25821-alsa\.c,drivers/media/pci/cx25821/cx25821-alsa\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-audio-upstream\.c,drivers/media/pci/cx25821/cx25821-audio-upstream\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-audio-upstream\.h,drivers/media/pci/cx25821/cx25821-audio-upstream\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-audio\.h,drivers/media/pci/cx25821/cx25821-audio\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-biffuncs\.h,drivers/media/pci/cx25821/cx25821-biffuncs\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-cards\.c,drivers/media/pci/cx25821/cx25821-cards\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-core\.c,drivers/media/pci/cx25821/cx25821-core\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-gpio\.c,drivers/media/pci/cx25821/cx25821-gpio\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-i2c\.c,drivers/media/pci/cx25821/cx25821-i2c\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-medusa-defines\.h,drivers/media/pci/cx25821/cx25821-medusa-defines\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-medusa-reg\.h,drivers/media/pci/cx25821/cx25821-medusa-reg\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-medusa-video\.c,drivers/media/pci/cx25821/cx25821-medusa-video\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-medusa-video\.h,drivers/media/pci/cx25821/cx25821-medusa-video\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-reg\.h,drivers/media/pci/cx25821/cx25821-reg\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-sram\.h,drivers/media/pci/cx25821/cx25821-sram\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video-upstream-ch2\.c,drivers/media/pci/cx25821/cx25821-video-upstream-ch2\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video-upstream-ch2\.h,drivers/media/pci/cx25821/cx25821-video-upstream-ch2\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video-upstream\.c,drivers/media/pci/cx25821/cx25821-video-upstream\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video-upstream\.h,drivers/media/pci/cx25821/cx25821-video-upstream\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video\.c,drivers/media/pci/cx25821/cx25821-video\.c,g' \ - -e 's,drivers/media/video/cx25821/cx25821-video\.h,drivers/media/pci/cx25821/cx25821-video\.h,g' \ - -e 's,drivers/media/video/cx25821/cx25821\.h,drivers/media/pci/cx25821/cx25821\.h,g' \ - -e 's,drivers/media/video/cx88/Kconfig,drivers/media/pci/cx88/Kconfig,g' \ - -e 's,drivers/media/video/cx88/Makefile,drivers/media/pci/cx88/Makefile,g' \ - -e 's,drivers/media/video/cx88/cx88-alsa\.c,drivers/media/pci/cx88/cx88-alsa\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-blackbird\.c,drivers/media/pci/cx88/cx88-blackbird\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-cards\.c,drivers/media/pci/cx88/cx88-cards\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-core\.c,drivers/media/pci/cx88/cx88-core\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-dsp\.c,drivers/media/pci/cx88/cx88-dsp\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-dvb\.c,drivers/media/pci/cx88/cx88-dvb\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-i2c\.c,drivers/media/pci/cx88/cx88-i2c\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-input\.c,drivers/media/pci/cx88/cx88-input\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-mpeg\.c,drivers/media/pci/cx88/cx88-mpeg\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-reg\.h,drivers/media/pci/cx88/cx88-reg\.h,g' \ - -e 's,drivers/media/video/cx88/cx88-tvaudio\.c,drivers/media/pci/cx88/cx88-tvaudio\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-vbi\.c,drivers/media/pci/cx88/cx88-vbi\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-video\.c,drivers/media/pci/cx88/cx88-video\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-vp3054-i2c\.c,drivers/media/pci/cx88/cx88-vp3054-i2c\.c,g' \ - -e 's,drivers/media/video/cx88/cx88-vp3054-i2c\.h,drivers/media/pci/cx88/cx88-vp3054-i2c\.h,g' \ - -e 's,drivers/media/video/cx88/cx88\.h,drivers/media/pci/cx88/cx88\.h,g' \ - -e 's,drivers/media/dvb/ddbridge/Kconfig,drivers/media/pci/ddbridge/Kconfig,g' \ - -e 's,drivers/media/dvb/ddbridge/Makefile,drivers/media/pci/ddbridge/Makefile,g' \ - -e 's,drivers/media/dvb/ddbridge/ddbridge-core\.c,drivers/media/pci/ddbridge/ddbridge-core\.c,g' \ - -e 's,drivers/media/dvb/ddbridge/ddbridge-regs\.h,drivers/media/pci/ddbridge/ddbridge-regs\.h,g' \ - -e 's,drivers/media/dvb/ddbridge/ddbridge\.h,drivers/media/pci/ddbridge/ddbridge\.h,g' \ - -e 's,drivers/media/dvb/dm1105/Kconfig,drivers/media/pci/dm1105/Kconfig,g' \ - -e 's,drivers/media/dvb/dm1105/Makefile,drivers/media/pci/dm1105/Makefile,g' \ - -e 's,drivers/media/dvb/dm1105/dm1105\.c,drivers/media/pci/dm1105/dm1105\.c,g' \ - -e 's,drivers/media/video/ivtv/Kconfig,drivers/media/pci/ivtv/Kconfig,g' \ - -e 's,drivers/media/video/ivtv/Makefile,drivers/media/pci/ivtv/Makefile,g' \ - -e 's,drivers/media/video/ivtv/ivtv-cards\.c,drivers/media/pci/ivtv/ivtv-cards\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-cards\.h,drivers/media/pci/ivtv/ivtv-cards\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-controls\.c,drivers/media/pci/ivtv/ivtv-controls\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-controls\.h,drivers/media/pci/ivtv/ivtv-controls\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-driver\.c,drivers/media/pci/ivtv/ivtv-driver\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-driver\.h,drivers/media/pci/ivtv/ivtv-driver\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-fileops\.c,drivers/media/pci/ivtv/ivtv-fileops\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-fileops\.h,drivers/media/pci/ivtv/ivtv-fileops\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-firmware\.c,drivers/media/pci/ivtv/ivtv-firmware\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-firmware\.h,drivers/media/pci/ivtv/ivtv-firmware\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-gpio\.c,drivers/media/pci/ivtv/ivtv-gpio\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-gpio\.h,drivers/media/pci/ivtv/ivtv-gpio\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-i2c\.c,drivers/media/pci/ivtv/ivtv-i2c\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-i2c\.h,drivers/media/pci/ivtv/ivtv-i2c\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-ioctl\.c,drivers/media/pci/ivtv/ivtv-ioctl\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-ioctl\.h,drivers/media/pci/ivtv/ivtv-ioctl\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-irq\.c,drivers/media/pci/ivtv/ivtv-irq\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-irq\.h,drivers/media/pci/ivtv/ivtv-irq\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-mailbox\.c,drivers/media/pci/ivtv/ivtv-mailbox\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-mailbox\.h,drivers/media/pci/ivtv/ivtv-mailbox\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-queue\.c,drivers/media/pci/ivtv/ivtv-queue\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-queue\.h,drivers/media/pci/ivtv/ivtv-queue\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-routing\.c,drivers/media/pci/ivtv/ivtv-routing\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-routing\.h,drivers/media/pci/ivtv/ivtv-routing\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-streams\.c,drivers/media/pci/ivtv/ivtv-streams\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-streams\.h,drivers/media/pci/ivtv/ivtv-streams\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-udma\.c,drivers/media/pci/ivtv/ivtv-udma\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-udma\.h,drivers/media/pci/ivtv/ivtv-udma\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-vbi\.c,drivers/media/pci/ivtv/ivtv-vbi\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-vbi\.h,drivers/media/pci/ivtv/ivtv-vbi\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-version\.h,drivers/media/pci/ivtv/ivtv-version\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtv-yuv\.c,drivers/media/pci/ivtv/ivtv-yuv\.c,g' \ - -e 's,drivers/media/video/ivtv/ivtv-yuv\.h,drivers/media/pci/ivtv/ivtv-yuv\.h,g' \ - -e 's,drivers/media/video/ivtv/ivtvfb\.c,drivers/media/pci/ivtv/ivtvfb\.c,g' \ - -e 's,drivers/media/dvb/mantis/Kconfig,drivers/media/pci/mantis/Kconfig,g' \ - -e 's,drivers/media/dvb/mantis/Makefile,drivers/media/pci/mantis/Makefile,g' \ - -e 's,drivers/media/dvb/mantis/hopper_cards\.c,drivers/media/pci/mantis/hopper_cards\.c,g' \ - -e 's,drivers/media/dvb/mantis/hopper_vp3028\.c,drivers/media/pci/mantis/hopper_vp3028\.c,g' \ - -e 's,drivers/media/dvb/mantis/hopper_vp3028\.h,drivers/media/pci/mantis/hopper_vp3028\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_ca\.c,drivers/media/pci/mantis/mantis_ca\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_ca\.h,drivers/media/pci/mantis/mantis_ca\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_cards\.c,drivers/media/pci/mantis/mantis_cards\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_common\.h,drivers/media/pci/mantis/mantis_common\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_core\.c,drivers/media/pci/mantis/mantis_core\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_core\.h,drivers/media/pci/mantis/mantis_core\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_dma\.c,drivers/media/pci/mantis/mantis_dma\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_dma\.h,drivers/media/pci/mantis/mantis_dma\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_dvb\.c,drivers/media/pci/mantis/mantis_dvb\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_dvb\.h,drivers/media/pci/mantis/mantis_dvb\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_evm\.c,drivers/media/pci/mantis/mantis_evm\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_hif\.c,drivers/media/pci/mantis/mantis_hif\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_hif\.h,drivers/media/pci/mantis/mantis_hif\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_i2c\.c,drivers/media/pci/mantis/mantis_i2c\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_i2c\.h,drivers/media/pci/mantis/mantis_i2c\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_input\.c,drivers/media/pci/mantis/mantis_input\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_ioc\.c,drivers/media/pci/mantis/mantis_ioc\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_ioc\.h,drivers/media/pci/mantis/mantis_ioc\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_link\.h,drivers/media/pci/mantis/mantis_link\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_pci\.c,drivers/media/pci/mantis/mantis_pci\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_pci\.h,drivers/media/pci/mantis/mantis_pci\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_pcmcia\.c,drivers/media/pci/mantis/mantis_pcmcia\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_reg\.h,drivers/media/pci/mantis/mantis_reg\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_uart\.c,drivers/media/pci/mantis/mantis_uart\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_uart\.h,drivers/media/pci/mantis/mantis_uart\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1033\.c,drivers/media/pci/mantis/mantis_vp1033\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1033\.h,drivers/media/pci/mantis/mantis_vp1033\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1034\.c,drivers/media/pci/mantis/mantis_vp1034\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1034\.h,drivers/media/pci/mantis/mantis_vp1034\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1041\.c,drivers/media/pci/mantis/mantis_vp1041\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp1041\.h,drivers/media/pci/mantis/mantis_vp1041\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp2033\.c,drivers/media/pci/mantis/mantis_vp2033\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp2033\.h,drivers/media/pci/mantis/mantis_vp2033\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp2040\.c,drivers/media/pci/mantis/mantis_vp2040\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp2040\.h,drivers/media/pci/mantis/mantis_vp2040\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp3028\.c,drivers/media/pci/mantis/mantis_vp3028\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp3028\.h,drivers/media/pci/mantis/mantis_vp3028\.h,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp3030\.c,drivers/media/pci/mantis/mantis_vp3030\.c,g' \ - -e 's,drivers/media/dvb/mantis/mantis_vp3030\.h,drivers/media/pci/mantis/mantis_vp3030\.h,g' \ - -e 's,drivers/media/video/meye\.c,drivers/media/pci/meye/meye\.c,g' \ - -e 's,drivers/media/video/meye\.h,drivers/media/pci/meye/meye\.h,g' \ - -e 's,drivers/media/dvb/ngene/Kconfig,drivers/media/pci/ngene/Kconfig,g' \ - -e 's,drivers/media/dvb/ngene/Makefile,drivers/media/pci/ngene/Makefile,g' \ - -e 's,drivers/media/dvb/ngene/ngene-cards\.c,drivers/media/pci/ngene/ngene-cards\.c,g' \ - -e 's,drivers/media/dvb/ngene/ngene-core\.c,drivers/media/pci/ngene/ngene-core\.c,g' \ - -e 's,drivers/media/dvb/ngene/ngene-dvb\.c,drivers/media/pci/ngene/ngene-dvb\.c,g' \ - -e 's,drivers/media/dvb/ngene/ngene-i2c\.c,drivers/media/pci/ngene/ngene-i2c\.c,g' \ - -e 's,drivers/media/dvb/ngene/ngene\.h,drivers/media/pci/ngene/ngene\.h,g' \ - -e 's,drivers/media/dvb/pluto2/Kconfig,drivers/media/pci/pluto2/Kconfig,g' \ - -e 's,drivers/media/dvb/pluto2/Makefile,drivers/media/pci/pluto2/Makefile,g' \ - -e 's,drivers/media/dvb/pluto2/pluto2\.c,drivers/media/pci/pluto2/pluto2\.c,g' \ - -e 's,drivers/media/dvb/pt1/Kconfig,drivers/media/pci/pt1/Kconfig,g' \ - -e 's,drivers/media/dvb/pt1/Makefile,drivers/media/pci/pt1/Makefile,g' \ - -e 's,drivers/media/dvb/pt1/pt1\.c,drivers/media/pci/pt1/pt1\.c,g' \ - -e 's,drivers/media/dvb/pt1/va1j5jf8007s\.c,drivers/media/pci/pt1/va1j5jf8007s\.c,g' \ - -e 's,drivers/media/dvb/pt1/va1j5jf8007s\.h,drivers/media/pci/pt1/va1j5jf8007s\.h,g' \ - -e 's,drivers/media/dvb/pt1/va1j5jf8007t\.c,drivers/media/pci/pt1/va1j5jf8007t\.c,g' \ - -e 's,drivers/media/dvb/pt1/va1j5jf8007t\.h,drivers/media/pci/pt1/va1j5jf8007t\.h,g' \ - -e 's,drivers/media/video/saa7134/Kconfig,drivers/media/pci/saa7134/Kconfig,g' \ - -e 's,drivers/media/video/saa7134/Makefile,drivers/media/pci/saa7134/Makefile,g' \ - -e 's,drivers/media/video/saa7134/saa6752hs\.c,drivers/media/pci/saa7134/saa6752hs\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-alsa\.c,drivers/media/pci/saa7134/saa7134-alsa\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-cards\.c,drivers/media/pci/saa7134/saa7134-cards\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-core\.c,drivers/media/pci/saa7134/saa7134-core\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-dvb\.c,drivers/media/pci/saa7134/saa7134-dvb\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-empress\.c,drivers/media/pci/saa7134/saa7134-empress\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-i2c\.c,drivers/media/pci/saa7134/saa7134-i2c\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-input\.c,drivers/media/pci/saa7134/saa7134-input\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-reg\.h,drivers/media/pci/saa7134/saa7134-reg\.h,g' \ - -e 's,drivers/media/video/saa7134/saa7134-ts\.c,drivers/media/pci/saa7134/saa7134-ts\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-tvaudio\.c,drivers/media/pci/saa7134/saa7134-tvaudio\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-vbi\.c,drivers/media/pci/saa7134/saa7134-vbi\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134-video\.c,drivers/media/pci/saa7134/saa7134-video\.c,g' \ - -e 's,drivers/media/video/saa7134/saa7134\.h,drivers/media/pci/saa7134/saa7134\.h,g' \ - -e 's,drivers/media/video/hexium_gemini\.c,drivers/media/pci/saa7146/hexium_gemini\.c,g' \ - -e 's,drivers/media/video/hexium_orion\.c,drivers/media/pci/saa7146/hexium_orion\.c,g' \ - -e 's,drivers/media/video/mxb\.c,drivers/media/pci/saa7146/mxb\.c,g' \ - -e 's,drivers/media/video/saa7164/Kconfig,drivers/media/pci/saa7164/Kconfig,g' \ - -e 's,drivers/media/video/saa7164/Makefile,drivers/media/pci/saa7164/Makefile,g' \ - -e 's,drivers/media/video/saa7164/saa7164-api\.c,drivers/media/pci/saa7164/saa7164-api\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-buffer\.c,drivers/media/pci/saa7164/saa7164-buffer\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-bus\.c,drivers/media/pci/saa7164/saa7164-bus\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-cards\.c,drivers/media/pci/saa7164/saa7164-cards\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-cmd\.c,drivers/media/pci/saa7164/saa7164-cmd\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-core\.c,drivers/media/pci/saa7164/saa7164-core\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-dvb\.c,drivers/media/pci/saa7164/saa7164-dvb\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-encoder\.c,drivers/media/pci/saa7164/saa7164-encoder\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-fw\.c,drivers/media/pci/saa7164/saa7164-fw\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-i2c\.c,drivers/media/pci/saa7164/saa7164-i2c\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164-reg\.h,drivers/media/pci/saa7164/saa7164-reg\.h,g' \ - -e 's,drivers/media/video/saa7164/saa7164-types\.h,drivers/media/pci/saa7164/saa7164-types\.h,g' \ - -e 's,drivers/media/video/saa7164/saa7164-vbi\.c,drivers/media/pci/saa7164/saa7164-vbi\.c,g' \ - -e 's,drivers/media/video/saa7164/saa7164\.h,drivers/media/pci/saa7164/saa7164\.h,g' \ - -e 's,drivers/media/video/sta2x11_vip\.c,drivers/media/pci/sta2x11/sta2x11_vip\.c,g' \ - -e 's,drivers/media/video/sta2x11_vip\.h,drivers/media/pci/sta2x11/sta2x11_vip\.h,g' \ - -e 's,drivers/media/dvb/ttpci/Kconfig,drivers/media/pci/ttpci/Kconfig,g' \ - -e 's,drivers/media/dvb/ttpci/Makefile,drivers/media/pci/ttpci/Makefile,g' \ - -e 's,drivers/media/dvb/ttpci/av7110\.c,drivers/media/pci/ttpci/av7110\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110\.h,drivers/media/pci/ttpci/av7110\.h,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_av\.c,drivers/media/pci/ttpci/av7110_av\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_av\.h,drivers/media/pci/ttpci/av7110_av\.h,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_ca\.c,drivers/media/pci/ttpci/av7110_ca\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_ca\.h,drivers/media/pci/ttpci/av7110_ca\.h,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_hw\.c,drivers/media/pci/ttpci/av7110_hw\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_hw\.h,drivers/media/pci/ttpci/av7110_hw\.h,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_ipack\.c,drivers/media/pci/ttpci/av7110_ipack\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_ipack\.h,drivers/media/pci/ttpci/av7110_ipack\.h,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_ir\.c,drivers/media/pci/ttpci/av7110_ir\.c,g' \ - -e 's,drivers/media/dvb/ttpci/av7110_v4l\.c,drivers/media/pci/ttpci/av7110_v4l\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget-av\.c,drivers/media/pci/ttpci/budget-av\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget-ci\.c,drivers/media/pci/ttpci/budget-ci\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget-core\.c,drivers/media/pci/ttpci/budget-core\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget-patch\.c,drivers/media/pci/ttpci/budget-patch\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget\.c,drivers/media/pci/ttpci/budget\.c,g' \ - -e 's,drivers/media/dvb/ttpci/budget\.h,drivers/media/pci/ttpci/budget\.h,g' \ - -e 's,drivers/media/dvb/ttpci/ttpci-eeprom\.c,drivers/media/pci/ttpci/ttpci-eeprom\.c,g' \ - -e 's,drivers/media/dvb/ttpci/ttpci-eeprom\.h,drivers/media/pci/ttpci/ttpci-eeprom\.h,g' \ - -e 's,drivers/media/video/zoran/Kconfig,drivers/media/pci/zoran/Kconfig,g' \ - -e 's,drivers/media/video/zoran/Makefile,drivers/media/pci/zoran/Makefile,g' \ - -e 's,drivers/media/video/zoran/videocodec\.c,drivers/media/pci/zoran/videocodec\.c,g' \ - -e 's,drivers/media/video/zoran/videocodec\.h,drivers/media/pci/zoran/videocodec\.h,g' \ - -e 's,drivers/media/video/zoran/zoran\.h,drivers/media/pci/zoran/zoran\.h,g' \ - -e 's,drivers/media/video/zoran/zoran_card\.c,drivers/media/pci/zoran/zoran_card\.c,g' \ - -e 's,drivers/media/video/zoran/zoran_card\.h,drivers/media/pci/zoran/zoran_card\.h,g' \ - -e 's,drivers/media/video/zoran/zoran_device\.c,drivers/media/pci/zoran/zoran_device\.c,g' \ - -e 's,drivers/media/video/zoran/zoran_device\.h,drivers/media/pci/zoran/zoran_device\.h,g' \ - -e 's,drivers/media/video/zoran/zoran_driver\.c,drivers/media/pci/zoran/zoran_driver\.c,g' \ - -e 's,drivers/media/video/zoran/zoran_procfs\.c,drivers/media/pci/zoran/zoran_procfs\.c,g' \ - -e 's,drivers/media/video/zoran/zoran_procfs\.h,drivers/media/pci/zoran/zoran_procfs\.h,g' \ - -e 's,drivers/media/video/zoran/zr36016\.c,drivers/media/pci/zoran/zr36016\.c,g' \ - -e 's,drivers/media/video/zoran/zr36016\.h,drivers/media/pci/zoran/zr36016\.h,g' \ - -e 's,drivers/media/video/zoran/zr36050\.c,drivers/media/pci/zoran/zr36050\.c,g' \ - -e 's,drivers/media/video/zoran/zr36050\.h,drivers/media/pci/zoran/zr36050\.h,g' \ - -e 's,drivers/media/video/zoran/zr36057\.h,drivers/media/pci/zoran/zr36057\.h,g' \ - -e 's,drivers/media/video/zoran/zr36060\.c,drivers/media/pci/zoran/zr36060\.c,g' \ - -e 's,drivers/media/video/zoran/zr36060\.h,drivers/media/pci/zoran/zr36060\.h,g' \ - -e 's,drivers/media/video/arv\.c,drivers/media/platform/arv\.c,g' \ - -e 's,drivers/media/video/blackfin/Kconfig,drivers/media/platform/blackfin/Kconfig,g' \ - -e 's,drivers/media/video/blackfin/Makefile,drivers/media/platform/blackfin/Makefile,g' \ - -e 's,drivers/media/video/blackfin/bfin_capture\.c,drivers/media/platform/blackfin/bfin_capture\.c,g' \ - -e 's,drivers/media/video/blackfin/ppi\.c,drivers/media/platform/blackfin/ppi\.c,g' \ - -e 's,drivers/media/video/coda\.c,drivers/media/platform/coda\.c,g' \ - -e 's,drivers/media/video/coda\.h,drivers/media/platform/coda\.h,g' \ - -e 's,drivers/media/video/davinci/Kconfig,drivers/media/platform/davinci/Kconfig,g' \ - -e 's,drivers/media/video/davinci/Makefile,drivers/media/platform/davinci/Makefile,g' \ - -e 's,drivers/media/video/davinci/ccdc_hw_device\.h,drivers/media/platform/davinci/ccdc_hw_device\.h,g' \ - -e 's,drivers/media/video/davinci/dm355_ccdc\.c,drivers/media/platform/davinci/dm355_ccdc\.c,g' \ - -e 's,drivers/media/video/davinci/dm355_ccdc_regs\.h,drivers/media/platform/davinci/dm355_ccdc_regs\.h,g' \ - -e 's,drivers/media/video/davinci/dm644x_ccdc\.c,drivers/media/platform/davinci/dm644x_ccdc\.c,g' \ - -e 's,drivers/media/video/davinci/dm644x_ccdc_regs\.h,drivers/media/platform/davinci/dm644x_ccdc_regs\.h,g' \ - -e 's,drivers/media/video/davinci/isif\.c,drivers/media/platform/davinci/isif\.c,g' \ - -e 's,drivers/media/video/davinci/isif_regs\.h,drivers/media/platform/davinci/isif_regs\.h,g' \ - -e 's,drivers/media/video/davinci/vpbe\.c,drivers/media/platform/davinci/vpbe\.c,g' \ - -e 's,drivers/media/video/davinci/vpbe_display\.c,drivers/media/platform/davinci/vpbe_display\.c,g' \ - -e 's,drivers/media/video/davinci/vpbe_osd\.c,drivers/media/platform/davinci/vpbe_osd\.c,g' \ - -e 's,drivers/media/video/davinci/vpbe_osd_regs\.h,drivers/media/platform/davinci/vpbe_osd_regs\.h,g' \ - -e 's,drivers/media/video/davinci/vpbe_venc\.c,drivers/media/platform/davinci/vpbe_venc\.c,g' \ - -e 's,drivers/media/video/davinci/vpbe_venc_regs\.h,drivers/media/platform/davinci/vpbe_venc_regs\.h,g' \ - -e 's,drivers/media/video/davinci/vpfe_capture\.c,drivers/media/platform/davinci/vpfe_capture\.c,g' \ - -e 's,drivers/media/video/davinci/vpif\.c,drivers/media/platform/davinci/vpif\.c,g' \ - -e 's,drivers/media/video/davinci/vpif\.h,drivers/media/platform/davinci/vpif\.h,g' \ - -e 's,drivers/media/video/davinci/vpif_capture\.c,drivers/media/platform/davinci/vpif_capture\.c,g' \ - -e 's,drivers/media/video/davinci/vpif_capture\.h,drivers/media/platform/davinci/vpif_capture\.h,g' \ - -e 's,drivers/media/video/davinci/vpif_display\.c,drivers/media/platform/davinci/vpif_display\.c,g' \ - -e 's,drivers/media/video/davinci/vpif_display\.h,drivers/media/platform/davinci/vpif_display\.h,g' \ - -e 's,drivers/media/video/davinci/vpss\.c,drivers/media/platform/davinci/vpss\.c,g' \ - -e 's,drivers/media/video/fsl-viu\.c,drivers/media/platform/fsl-viu\.c,g' \ - -e 's,drivers/media/video/indycam\.c,drivers/media/platform/indycam\.c,g' \ - -e 's,drivers/media/video/indycam\.h,drivers/media/platform/indycam\.h,g' \ - -e 's,drivers/media/video/m2m-deinterlace\.c,drivers/media/platform/m2m-deinterlace\.c,g' \ - -e 's,drivers/media/video/marvell-ccic/Kconfig,drivers/media/platform/marvell-ccic/Kconfig,g' \ - -e 's,drivers/media/video/marvell-ccic/Makefile,drivers/media/platform/marvell-ccic/Makefile,g' \ - -e 's,drivers/media/video/marvell-ccic/cafe-driver\.c,drivers/media/platform/marvell-ccic/cafe-driver\.c,g' \ - -e 's,drivers/media/video/marvell-ccic/mcam-core\.c,drivers/media/platform/marvell-ccic/mcam-core\.c,g' \ - -e 's,drivers/media/video/marvell-ccic/mcam-core\.h,drivers/media/platform/marvell-ccic/mcam-core\.h,g' \ - -e 's,drivers/media/video/marvell-ccic/mmp-driver\.c,drivers/media/platform/marvell-ccic/mmp-driver\.c,g' \ - -e 's,drivers/media/video/mem2mem_testdev\.c,drivers/media/platform/mem2mem_testdev\.c,g' \ - -e 's,drivers/media/video/mx2_emmaprp\.c,drivers/media/platform/mx2_emmaprp\.c,g' \ - -e 's,drivers/media/video/omap/Kconfig,drivers/media/platform/omap/Kconfig,g' \ - -e 's,drivers/media/video/omap/Makefile,drivers/media/platform/omap/Makefile,g' \ - -e 's,drivers/media/video/omap/omap_vout\.c,drivers/media/platform/omap/omap_vout\.c,g' \ - -e 's,drivers/media/video/omap/omap_vout_vrfb\.c,drivers/media/platform/omap/omap_vout_vrfb\.c,g' \ - -e 's,drivers/media/video/omap/omap_vout_vrfb\.h,drivers/media/platform/omap/omap_vout_vrfb\.h,g' \ - -e 's,drivers/media/video/omap/omap_voutdef\.h,drivers/media/platform/omap/omap_voutdef\.h,g' \ - -e 's,drivers/media/video/omap/omap_voutlib\.c,drivers/media/platform/omap/omap_voutlib\.c,g' \ - -e 's,drivers/media/video/omap/omap_voutlib\.h,drivers/media/platform/omap/omap_voutlib\.h,g' \ - -e 's,drivers/media/video/omap24xxcam-dma\.c,drivers/media/platform/omap24xxcam-dma\.c,g' \ - -e 's,drivers/media/video/omap24xxcam\.c,drivers/media/platform/omap24xxcam\.c,g' \ - -e 's,drivers/media/video/omap24xxcam\.h,drivers/media/platform/omap24xxcam\.h,g' \ - -e 's,drivers/media/video/omap3isp/Makefile,drivers/media/platform/omap3isp/Makefile,g' \ - -e 's,drivers/media/video/omap3isp/cfa_coef_table\.h,drivers/media/platform/omap3isp/cfa_coef_table\.h,g' \ - -e 's,drivers/media/video/omap3isp/gamma_table\.h,drivers/media/platform/omap3isp/gamma_table\.h,g' \ - -e 's,drivers/media/video/omap3isp/isp\.c,drivers/media/platform/omap3isp/isp\.c,g' \ - -e 's,drivers/media/video/omap3isp/isp\.h,drivers/media/platform/omap3isp/isp\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispccdc\.c,drivers/media/platform/omap3isp/ispccdc\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispccdc\.h,drivers/media/platform/omap3isp/ispccdc\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispccp2\.c,drivers/media/platform/omap3isp/ispccp2\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispccp2\.h,drivers/media/platform/omap3isp/ispccp2\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispcsi2\.c,drivers/media/platform/omap3isp/ispcsi2\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispcsi2\.h,drivers/media/platform/omap3isp/ispcsi2\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispcsiphy\.c,drivers/media/platform/omap3isp/ispcsiphy\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispcsiphy\.h,drivers/media/platform/omap3isp/ispcsiphy\.h,g' \ - -e 's,drivers/media/video/omap3isp/isph3a\.h,drivers/media/platform/omap3isp/isph3a\.h,g' \ - -e 's,drivers/media/video/omap3isp/isph3a_aewb\.c,drivers/media/platform/omap3isp/isph3a_aewb\.c,g' \ - -e 's,drivers/media/video/omap3isp/isph3a_af\.c,drivers/media/platform/omap3isp/isph3a_af\.c,g' \ - -e 's,drivers/media/video/omap3isp/isphist\.c,drivers/media/platform/omap3isp/isphist\.c,g' \ - -e 's,drivers/media/video/omap3isp/isphist\.h,drivers/media/platform/omap3isp/isphist\.h,g' \ - -e 's,drivers/media/video/omap3isp/isppreview\.c,drivers/media/platform/omap3isp/isppreview\.c,g' \ - -e 's,drivers/media/video/omap3isp/isppreview\.h,drivers/media/platform/omap3isp/isppreview\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispqueue\.c,drivers/media/platform/omap3isp/ispqueue\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispqueue\.h,drivers/media/platform/omap3isp/ispqueue\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispreg\.h,drivers/media/platform/omap3isp/ispreg\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispresizer\.c,drivers/media/platform/omap3isp/ispresizer\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispresizer\.h,drivers/media/platform/omap3isp/ispresizer\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispstat\.c,drivers/media/platform/omap3isp/ispstat\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispstat\.h,drivers/media/platform/omap3isp/ispstat\.h,g' \ - -e 's,drivers/media/video/omap3isp/ispvideo\.c,drivers/media/platform/omap3isp/ispvideo\.c,g' \ - -e 's,drivers/media/video/omap3isp/ispvideo\.h,drivers/media/platform/omap3isp/ispvideo\.h,g' \ - -e 's,drivers/media/video/omap3isp/luma_enhance_table\.h,drivers/media/platform/omap3isp/luma_enhance_table\.h,g' \ - -e 's,drivers/media/video/omap3isp/noise_filter_table\.h,drivers/media/platform/omap3isp/noise_filter_table\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/Kconfig,drivers/media/platform/s5p-fimc/Kconfig,g' \ - -e 's,drivers/media/video/s5p-fimc/Makefile,drivers/media/platform/s5p-fimc/Makefile,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-capture\.c,drivers/media/platform/s5p-fimc/fimc-capture\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-core\.c,drivers/media/platform/s5p-fimc/fimc-core\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-core\.h,drivers/media/platform/s5p-fimc/fimc-core\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-lite-reg\.c,drivers/media/platform/s5p-fimc/fimc-lite-reg\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-lite-reg\.h,drivers/media/platform/s5p-fimc/fimc-lite-reg\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-lite\.c,drivers/media/platform/s5p-fimc/fimc-lite\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-lite\.h,drivers/media/platform/s5p-fimc/fimc-lite\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-m2m\.c,drivers/media/platform/s5p-fimc/fimc-m2m\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-mdevice\.c,drivers/media/platform/s5p-fimc/fimc-mdevice\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-mdevice\.h,drivers/media/platform/s5p-fimc/fimc-mdevice\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-reg\.c,drivers/media/platform/s5p-fimc/fimc-reg\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/fimc-reg\.h,drivers/media/platform/s5p-fimc/fimc-reg\.h,g' \ - -e 's,drivers/media/video/s5p-fimc/mipi-csis\.c,drivers/media/platform/s5p-fimc/mipi-csis\.c,g' \ - -e 's,drivers/media/video/s5p-fimc/mipi-csis\.h,drivers/media/platform/s5p-fimc/mipi-csis\.h,g' \ - -e 's,drivers/media/video/s5p-g2d/Makefile,drivers/media/platform/s5p-g2d/Makefile,g' \ - -e 's,drivers/media/video/s5p-g2d/g2d-hw\.c,drivers/media/platform/s5p-g2d/g2d-hw\.c,g' \ - -e 's,drivers/media/video/s5p-g2d/g2d-regs\.h,drivers/media/platform/s5p-g2d/g2d-regs\.h,g' \ - -e 's,drivers/media/video/s5p-g2d/g2d\.c,drivers/media/platform/s5p-g2d/g2d\.c,g' \ - -e 's,drivers/media/video/s5p-g2d/g2d\.h,drivers/media/platform/s5p-g2d/g2d\.h,g' \ - -e 's,drivers/media/video/s5p-jpeg/Makefile,drivers/media/platform/s5p-jpeg/Makefile,g' \ - -e 's,drivers/media/video/s5p-jpeg/jpeg-core\.c,drivers/media/platform/s5p-jpeg/jpeg-core\.c,g' \ - -e 's,drivers/media/video/s5p-jpeg/jpeg-core\.h,drivers/media/platform/s5p-jpeg/jpeg-core\.h,g' \ - -e 's,drivers/media/video/s5p-jpeg/jpeg-hw\.h,drivers/media/platform/s5p-jpeg/jpeg-hw\.h,g' \ - -e 's,drivers/media/video/s5p-jpeg/jpeg-regs\.h,drivers/media/platform/s5p-jpeg/jpeg-regs\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/Makefile,drivers/media/platform/s5p-mfc/Makefile,g' \ - -e 's,drivers/media/video/s5p-mfc/regs-mfc\.h,drivers/media/platform/s5p-mfc/regs-mfc\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc\.c,drivers/media/platform/s5p-mfc/s5p_mfc\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_cmd\.c,drivers/media/platform/s5p-mfc/s5p_mfc_cmd\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_cmd\.h,drivers/media/platform/s5p-mfc/s5p_mfc_cmd\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_common\.h,drivers/media/platform/s5p-mfc/s5p_mfc_common\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_ctrl\.c,drivers/media/platform/s5p-mfc/s5p_mfc_ctrl\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_ctrl\.h,drivers/media/platform/s5p-mfc/s5p_mfc_ctrl\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_debug\.h,drivers/media/platform/s5p-mfc/s5p_mfc_debug\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_dec\.c,drivers/media/platform/s5p-mfc/s5p_mfc_dec\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_dec\.h,drivers/media/platform/s5p-mfc/s5p_mfc_dec\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_enc\.c,drivers/media/platform/s5p-mfc/s5p_mfc_enc\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_enc\.h,drivers/media/platform/s5p-mfc/s5p_mfc_enc\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_intr\.c,drivers/media/platform/s5p-mfc/s5p_mfc_intr\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_intr\.h,drivers/media/platform/s5p-mfc/s5p_mfc_intr\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_opr\.c,drivers/media/platform/s5p-mfc/s5p_mfc_opr\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_opr\.h,drivers/media/platform/s5p-mfc/s5p_mfc_opr\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_pm\.c,drivers/media/platform/s5p-mfc/s5p_mfc_pm\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_pm\.h,drivers/media/platform/s5p-mfc/s5p_mfc_pm\.h,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_shm\.c,drivers/media/platform/s5p-mfc/s5p_mfc_shm\.c,g' \ - -e 's,drivers/media/video/s5p-mfc/s5p_mfc_shm\.h,drivers/media/platform/s5p-mfc/s5p_mfc_shm\.h,g' \ - -e 's,drivers/media/video/s5p-tv/Kconfig,drivers/media/platform/s5p-tv/Kconfig,g' \ - -e 's,drivers/media/video/s5p-tv/Makefile,drivers/media/platform/s5p-tv/Makefile,g' \ - -e 's,drivers/media/video/s5p-tv/hdmi_drv\.c,drivers/media/platform/s5p-tv/hdmi_drv\.c,g' \ - -e 's,drivers/media/video/s5p-tv/hdmiphy_drv\.c,drivers/media/platform/s5p-tv/hdmiphy_drv\.c,g' \ - -e 's,drivers/media/video/s5p-tv/mixer\.h,drivers/media/platform/s5p-tv/mixer\.h,g' \ - -e 's,drivers/media/video/s5p-tv/mixer_drv\.c,drivers/media/platform/s5p-tv/mixer_drv\.c,g' \ - -e 's,drivers/media/video/s5p-tv/mixer_grp_layer\.c,drivers/media/platform/s5p-tv/mixer_grp_layer\.c,g' \ - -e 's,drivers/media/video/s5p-tv/mixer_reg\.c,drivers/media/platform/s5p-tv/mixer_reg\.c,g' \ - -e 's,drivers/media/video/s5p-tv/mixer_video\.c,drivers/media/platform/s5p-tv/mixer_video\.c,g' \ - -e 's,drivers/media/video/s5p-tv/mixer_vp_layer\.c,drivers/media/platform/s5p-tv/mixer_vp_layer\.c,g' \ - -e 's,drivers/media/video/s5p-tv/regs-hdmi\.h,drivers/media/platform/s5p-tv/regs-hdmi\.h,g' \ - -e 's,drivers/media/video/s5p-tv/regs-mixer\.h,drivers/media/platform/s5p-tv/regs-mixer\.h,g' \ - -e 's,drivers/media/video/s5p-tv/regs-sdo\.h,drivers/media/platform/s5p-tv/regs-sdo\.h,g' \ - -e 's,drivers/media/video/s5p-tv/regs-vp\.h,drivers/media/platform/s5p-tv/regs-vp\.h,g' \ - -e 's,drivers/media/video/s5p-tv/sdo_drv\.c,drivers/media/platform/s5p-tv/sdo_drv\.c,g' \ - -e 's,drivers/media/video/s5p-tv/sii9234_drv\.c,drivers/media/platform/s5p-tv/sii9234_drv\.c,g' \ - -e 's,drivers/media/video/sh_vou\.c,drivers/media/platform/sh_vou\.c,g' \ - -e 's,drivers/media/video/atmel-isi\.c,drivers/media/platform/soc_camera/atmel-isi\.c,g' \ - -e 's,drivers/media/video/mx1_camera\.c,drivers/media/platform/soc_camera/mx1_camera\.c,g' \ - -e 's,drivers/media/video/mx2_camera\.c,drivers/media/platform/soc_camera/mx2_camera\.c,g' \ - -e 's,drivers/media/video/mx3_camera\.c,drivers/media/platform/soc_camera/mx3_camera\.c,g' \ - -e 's,drivers/media/video/omap1_camera\.c,drivers/media/platform/soc_camera/omap1_camera\.c,g' \ - -e 's,drivers/media/video/pxa_camera\.c,drivers/media/platform/soc_camera/pxa_camera\.c,g' \ - -e 's,drivers/media/video/sh_mobile_ceu_camera\.c,drivers/media/platform/soc_camera/sh_mobile_ceu_camera\.c,g' \ - -e 's,drivers/media/video/sh_mobile_csi2\.c,drivers/media/platform/soc_camera/sh_mobile_csi2\.c,g' \ - -e 's,drivers/media/video/soc_camera\.c,drivers/media/platform/soc_camera/soc_camera\.c,g' \ - -e 's,drivers/media/video/soc_camera_platform\.c,drivers/media/platform/soc_camera/soc_camera_platform\.c,g' \ - -e 's,drivers/media/video/soc_mediabus\.c,drivers/media/platform/soc_camera/soc_mediabus\.c,g' \ - -e 's,drivers/media/video/timblogiw\.c,drivers/media/platform/timblogiw\.c,g' \ - -e 's,drivers/media/video/via-camera\.c,drivers/media/platform/via-camera\.c,g' \ - -e 's,drivers/media/video/via-camera\.h,drivers/media/platform/via-camera\.h,g' \ - -e 's,drivers/media/video/vino\.c,drivers/media/platform/vino\.c,g' \ - -e 's,drivers/media/video/vino\.h,drivers/media/platform/vino\.h,g' \ - -e 's,drivers/media/video/vivi\.c,drivers/media/platform/vivi\.c,g' \ - -e 's,drivers/media/common/tuners/Kconfig,drivers/media/tuners/Kconfig,g' \ - -e 's,drivers/media/common/tuners/Makefile,drivers/media/tuners/Makefile,g' \ - -e 's,drivers/media/common/tuners/fc0011\.c,drivers/media/tuners/fc0011\.c,g' \ - -e 's,drivers/media/common/tuners/fc0011\.h,drivers/media/tuners/fc0011\.h,g' \ - -e 's,drivers/media/common/tuners/fc0012-priv\.h,drivers/media/tuners/fc0012-priv\.h,g' \ - -e 's,drivers/media/common/tuners/fc0012\.c,drivers/media/tuners/fc0012\.c,g' \ - -e 's,drivers/media/common/tuners/fc0012\.h,drivers/media/tuners/fc0012\.h,g' \ - -e 's,drivers/media/common/tuners/fc0013-priv\.h,drivers/media/tuners/fc0013-priv\.h,g' \ - -e 's,drivers/media/common/tuners/fc0013\.c,drivers/media/tuners/fc0013\.c,g' \ - -e 's,drivers/media/common/tuners/fc0013\.h,drivers/media/tuners/fc0013\.h,g' \ - -e 's,drivers/media/common/tuners/fc001x-common\.h,drivers/media/tuners/fc001x-common\.h,g' \ - -e 's,drivers/media/common/tuners/max2165\.c,drivers/media/tuners/max2165\.c,g' \ - -e 's,drivers/media/common/tuners/max2165\.h,drivers/media/tuners/max2165\.h,g' \ - -e 's,drivers/media/common/tuners/max2165_priv\.h,drivers/media/tuners/max2165_priv\.h,g' \ - -e 's,drivers/media/common/tuners/mc44s803\.c,drivers/media/tuners/mc44s803\.c,g' \ - -e 's,drivers/media/common/tuners/mc44s803\.h,drivers/media/tuners/mc44s803\.h,g' \ - -e 's,drivers/media/common/tuners/mc44s803_priv\.h,drivers/media/tuners/mc44s803_priv\.h,g' \ - -e 's,drivers/media/common/tuners/mt2060\.c,drivers/media/tuners/mt2060\.c,g' \ - -e 's,drivers/media/common/tuners/mt2060\.h,drivers/media/tuners/mt2060\.h,g' \ - -e 's,drivers/media/common/tuners/mt2060_priv\.h,drivers/media/tuners/mt2060_priv\.h,g' \ - -e 's,drivers/media/common/tuners/mt2063\.c,drivers/media/tuners/mt2063\.c,g' \ - -e 's,drivers/media/common/tuners/mt2063\.h,drivers/media/tuners/mt2063\.h,g' \ - -e 's,drivers/media/common/tuners/mt20xx\.c,drivers/media/tuners/mt20xx\.c,g' \ - -e 's,drivers/media/common/tuners/mt20xx\.h,drivers/media/tuners/mt20xx\.h,g' \ - -e 's,drivers/media/common/tuners/mt2131\.c,drivers/media/tuners/mt2131\.c,g' \ - -e 's,drivers/media/common/tuners/mt2131\.h,drivers/media/tuners/mt2131\.h,g' \ - -e 's,drivers/media/common/tuners/mt2131_priv\.h,drivers/media/tuners/mt2131_priv\.h,g' \ - -e 's,drivers/media/common/tuners/mt2266\.c,drivers/media/tuners/mt2266\.c,g' \ - -e 's,drivers/media/common/tuners/mt2266\.h,drivers/media/tuners/mt2266\.h,g' \ - -e 's,drivers/media/common/tuners/mxl5005s\.c,drivers/media/tuners/mxl5005s\.c,g' \ - -e 's,drivers/media/common/tuners/mxl5005s\.h,drivers/media/tuners/mxl5005s\.h,g' \ - -e 's,drivers/media/common/tuners/mxl5007t\.c,drivers/media/tuners/mxl5007t\.c,g' \ - -e 's,drivers/media/common/tuners/mxl5007t\.h,drivers/media/tuners/mxl5007t\.h,g' \ - -e 's,drivers/media/common/tuners/qt1010\.c,drivers/media/tuners/qt1010\.c,g' \ - -e 's,drivers/media/common/tuners/qt1010\.h,drivers/media/tuners/qt1010\.h,g' \ - -e 's,drivers/media/common/tuners/qt1010_priv\.h,drivers/media/tuners/qt1010_priv\.h,g' \ - -e 's,drivers/media/common/tuners/tda18212\.c,drivers/media/tuners/tda18212\.c,g' \ - -e 's,drivers/media/common/tuners/tda18212\.h,drivers/media/tuners/tda18212\.h,g' \ - -e 's,drivers/media/common/tuners/tda18218\.c,drivers/media/tuners/tda18218\.c,g' \ - -e 's,drivers/media/common/tuners/tda18218\.h,drivers/media/tuners/tda18218\.h,g' \ - -e 's,drivers/media/common/tuners/tda18218_priv\.h,drivers/media/tuners/tda18218_priv\.h,g' \ - -e 's,drivers/media/common/tuners/tda18271-common\.c,drivers/media/tuners/tda18271-common\.c,g' \ - -e 's,drivers/media/common/tuners/tda18271-fe\.c,drivers/media/tuners/tda18271-fe\.c,g' \ - -e 's,drivers/media/common/tuners/tda18271-maps\.c,drivers/media/tuners/tda18271-maps\.c,g' \ - -e 's,drivers/media/common/tuners/tda18271-priv\.h,drivers/media/tuners/tda18271-priv\.h,g' \ - -e 's,drivers/media/common/tuners/tda18271\.h,drivers/media/tuners/tda18271\.h,g' \ - -e 's,drivers/media/common/tuners/tda827x\.c,drivers/media/tuners/tda827x\.c,g' \ - -e 's,drivers/media/common/tuners/tda827x\.h,drivers/media/tuners/tda827x\.h,g' \ - -e 's,drivers/media/common/tuners/tda8290\.c,drivers/media/tuners/tda8290\.c,g' \ - -e 's,drivers/media/common/tuners/tda8290\.h,drivers/media/tuners/tda8290\.h,g' \ - -e 's,drivers/media/common/tuners/tda9887\.c,drivers/media/tuners/tda9887\.c,g' \ - -e 's,drivers/media/common/tuners/tda9887\.h,drivers/media/tuners/tda9887\.h,g' \ - -e 's,drivers/media/common/tuners/tea5761\.c,drivers/media/tuners/tea5761\.c,g' \ - -e 's,drivers/media/common/tuners/tea5761\.h,drivers/media/tuners/tea5761\.h,g' \ - -e 's,drivers/media/common/tuners/tea5767\.c,drivers/media/tuners/tea5767\.c,g' \ - -e 's,drivers/media/common/tuners/tea5767\.h,drivers/media/tuners/tea5767\.h,g' \ - -e 's,drivers/media/common/tuners/tua9001\.c,drivers/media/tuners/tua9001\.c,g' \ - -e 's,drivers/media/common/tuners/tua9001\.h,drivers/media/tuners/tua9001\.h,g' \ - -e 's,drivers/media/common/tuners/tua9001_priv\.h,drivers/media/tuners/tua9001_priv\.h,g' \ - -e 's,drivers/media/common/tuners/tuner-i2c\.h,drivers/media/tuners/tuner-i2c\.h,g' \ - -e 's,drivers/media/common/tuners/tuner-simple\.c,drivers/media/tuners/tuner-simple\.c,g' \ - -e 's,drivers/media/common/tuners/tuner-simple\.h,drivers/media/tuners/tuner-simple\.h,g' \ - -e 's,drivers/media/common/tuners/tuner-types\.c,drivers/media/tuners/tuner-types\.c,g' \ - -e 's,drivers/media/common/tuners/tuner-xc2028-types\.h,drivers/media/tuners/tuner-xc2028-types\.h,g' \ - -e 's,drivers/media/common/tuners/tuner-xc2028\.c,drivers/media/tuners/tuner-xc2028\.c,g' \ - -e 's,drivers/media/common/tuners/tuner-xc2028\.h,drivers/media/tuners/tuner-xc2028\.h,g' \ - -e 's,drivers/media/common/tuners/xc4000\.c,drivers/media/tuners/xc4000\.c,g' \ - -e 's,drivers/media/common/tuners/xc4000\.h,drivers/media/tuners/xc4000\.h,g' \ - -e 's,drivers/media/common/tuners/xc5000\.c,drivers/media/tuners/xc5000\.c,g' \ - -e 's,drivers/media/common/tuners/xc5000\.h,drivers/media/tuners/xc5000\.h,g' \ - -e 's,drivers/media/video/au0828/Kconfig,drivers/media/usb/au0828/Kconfig,g' \ - -e 's,drivers/media/video/au0828/Makefile,drivers/media/usb/au0828/Makefile,g' \ - -e 's,drivers/media/video/au0828/au0828-cards\.c,drivers/media/usb/au0828/au0828-cards\.c,g' \ - -e 's,drivers/media/video/au0828/au0828-cards\.h,drivers/media/usb/au0828/au0828-cards\.h,g' \ - -e 's,drivers/media/video/au0828/au0828-core\.c,drivers/media/usb/au0828/au0828-core\.c,g' \ - -e 's,drivers/media/video/au0828/au0828-dvb\.c,drivers/media/usb/au0828/au0828-dvb\.c,g' \ - -e 's,drivers/media/video/au0828/au0828-i2c\.c,drivers/media/usb/au0828/au0828-i2c\.c,g' \ - -e 's,drivers/media/video/au0828/au0828-reg\.h,drivers/media/usb/au0828/au0828-reg\.h,g' \ - -e 's,drivers/media/video/au0828/au0828-vbi\.c,drivers/media/usb/au0828/au0828-vbi\.c,g' \ - -e 's,drivers/media/video/au0828/au0828-video\.c,drivers/media/usb/au0828/au0828-video\.c,g' \ - -e 's,drivers/media/video/au0828/au0828\.h,drivers/media/usb/au0828/au0828\.h,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-usb\.c,drivers/media/usb/b2c2/flexcop-usb\.c,g' \ - -e 's,drivers/media/dvb/b2c2/flexcop-usb\.h,drivers/media/usb/b2c2/flexcop-usb\.h,g' \ - -e 's,drivers/media/video/cpia2/Kconfig,drivers/media/usb/cpia2/Kconfig,g' \ - -e 's,drivers/media/video/cpia2/Makefile,drivers/media/usb/cpia2/Makefile,g' \ - -e 's,drivers/media/video/cpia2/cpia2\.h,drivers/media/usb/cpia2/cpia2\.h,g' \ - -e 's,drivers/media/video/cpia2/cpia2_core\.c,drivers/media/usb/cpia2/cpia2_core\.c,g' \ - -e 's,drivers/media/video/cpia2/cpia2_registers\.h,drivers/media/usb/cpia2/cpia2_registers\.h,g' \ - -e 's,drivers/media/video/cpia2/cpia2_usb\.c,drivers/media/usb/cpia2/cpia2_usb\.c,g' \ - -e 's,drivers/media/video/cpia2/cpia2_v4l\.c,drivers/media/usb/cpia2/cpia2_v4l\.c,g' \ - -e 's,drivers/media/video/cx231xx/Kconfig,drivers/media/usb/cx231xx/Kconfig,g' \ - -e 's,drivers/media/video/cx231xx/Makefile,drivers/media/usb/cx231xx/Makefile,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-417\.c,drivers/media/usb/cx231xx/cx231xx-417\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-audio\.c,drivers/media/usb/cx231xx/cx231xx-audio\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-avcore\.c,drivers/media/usb/cx231xx/cx231xx-avcore\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-cards\.c,drivers/media/usb/cx231xx/cx231xx-cards\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-conf-reg\.h,drivers/media/usb/cx231xx/cx231xx-conf-reg\.h,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-core\.c,drivers/media/usb/cx231xx/cx231xx-core\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-dif\.h,drivers/media/usb/cx231xx/cx231xx-dif\.h,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-dvb\.c,drivers/media/usb/cx231xx/cx231xx-dvb\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-i2c\.c,drivers/media/usb/cx231xx/cx231xx-i2c\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-input\.c,drivers/media/usb/cx231xx/cx231xx-input\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-pcb-cfg\.c,drivers/media/usb/cx231xx/cx231xx-pcb-cfg\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-pcb-cfg\.h,drivers/media/usb/cx231xx/cx231xx-pcb-cfg\.h,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-reg\.h,drivers/media/usb/cx231xx/cx231xx-reg\.h,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-vbi\.c,drivers/media/usb/cx231xx/cx231xx-vbi\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-vbi\.h,drivers/media/usb/cx231xx/cx231xx-vbi\.h,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx-video\.c,drivers/media/usb/cx231xx/cx231xx-video\.c,g' \ - -e 's,drivers/media/video/cx231xx/cx231xx\.h,drivers/media/usb/cx231xx/cx231xx\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/Kconfig,drivers/media/usb/dvb-usb-v2/Kconfig,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/Makefile,drivers/media/usb/dvb-usb-v2/Makefile,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/af9015\.c,drivers/media/usb/dvb-usb-v2/af9015\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/af9015\.h,drivers/media/usb/dvb-usb-v2/af9015\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/af9035\.c,drivers/media/usb/dvb-usb-v2/af9035\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/af9035\.h,drivers/media/usb/dvb-usb-v2/af9035\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/anysee\.c,drivers/media/usb/dvb-usb-v2/anysee\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/anysee\.h,drivers/media/usb/dvb-usb-v2/anysee\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/au6610\.c,drivers/media/usb/dvb-usb-v2/au6610\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/au6610\.h,drivers/media/usb/dvb-usb-v2/au6610\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/az6007\.c,drivers/media/usb/dvb-usb-v2/az6007\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/ce6230\.c,drivers/media/usb/dvb-usb-v2/ce6230\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/ce6230\.h,drivers/media/usb/dvb-usb-v2/ce6230\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/cypress_firmware\.c,drivers/media/usb/dvb-usb-v2/cypress_firmware\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/cypress_firmware\.h,drivers/media/usb/dvb-usb-v2/cypress_firmware\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb\.h,drivers/media/usb/dvb-usb-v2/dvb_usb\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_common\.h,drivers/media/usb/dvb-usb-v2/dvb_usb_common\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_core\.c,drivers/media/usb/dvb-usb-v2/dvb_usb_core\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_urb\.c,drivers/media/usb/dvb-usb-v2/dvb_usb_urb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/ec168\.c,drivers/media/usb/dvb-usb-v2/ec168\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/ec168\.h,drivers/media/usb/dvb-usb-v2/ec168\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/gl861\.c,drivers/media/usb/dvb-usb-v2/gl861\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/gl861\.h,drivers/media/usb/dvb-usb-v2/gl861\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/it913x\.c,drivers/media/usb/dvb-usb-v2/it913x\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/lmedm04\.c,drivers/media/usb/dvb-usb-v2/lmedm04\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/lmedm04\.h,drivers/media/usb/dvb-usb-v2/lmedm04\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-demod\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-demod\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-demod\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-demod\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-gpio\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-gpio\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-gpio\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-gpio\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-i2c\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-i2c\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-i2c\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-i2c\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-phy\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-phy\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-phy\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-phy\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-reg\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-reg\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-tuner\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-tuner\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-tuner\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-tuner\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf\.c,drivers/media/usb/dvb-usb-v2/mxl111sf\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf\.h,drivers/media/usb/dvb-usb-v2/mxl111sf\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/rtl28xxu\.c,drivers/media/usb/dvb-usb-v2/rtl28xxu\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/rtl28xxu\.h,drivers/media/usb/dvb-usb-v2/rtl28xxu\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb-v2/usb_urb\.c,drivers/media/usb/dvb-usb-v2/usb_urb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/Kconfig,drivers/media/usb/dvb-usb/Kconfig,g' \ - -e 's,drivers/media/dvb/dvb-usb/Makefile,drivers/media/usb/dvb-usb/Makefile,g' \ - -e 's,drivers/media/dvb/dvb-usb/a800\.c,drivers/media/usb/dvb-usb/a800\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/af9005-fe\.c,drivers/media/usb/dvb-usb/af9005-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/af9005-remote\.c,drivers/media/usb/dvb-usb/af9005-remote\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/af9005-script\.h,drivers/media/usb/dvb-usb/af9005-script\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/af9005\.c,drivers/media/usb/dvb-usb/af9005\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/af9005\.h,drivers/media/usb/dvb-usb/af9005\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/az6027\.c,drivers/media/usb/dvb-usb/az6027\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/az6027\.h,drivers/media/usb/dvb-usb/az6027\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/cinergyT2-core\.c,drivers/media/usb/dvb-usb/cinergyT2-core\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/cinergyT2-fe\.c,drivers/media/usb/dvb-usb/cinergyT2-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/cinergyT2\.h,drivers/media/usb/dvb-usb/cinergyT2\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/cxusb\.c,drivers/media/usb/dvb-usb/cxusb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/cxusb\.h,drivers/media/usb/dvb-usb/cxusb\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dib0700\.h,drivers/media/usb/dvb-usb/dib0700\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dib0700_core\.c,drivers/media/usb/dvb-usb/dib0700_core\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dib0700_devices\.c,drivers/media/usb/dvb-usb/dib0700_devices\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dib07x0\.h,drivers/media/usb/dvb-usb/dib07x0\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dibusb-common\.c,drivers/media/usb/dvb-usb/dibusb-common\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dibusb-mb\.c,drivers/media/usb/dvb-usb/dibusb-mb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dibusb-mc\.c,drivers/media/usb/dvb-usb/dibusb-mc\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dibusb\.h,drivers/media/usb/dvb-usb/dibusb\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/digitv\.c,drivers/media/usb/dvb-usb/digitv\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/digitv\.h,drivers/media/usb/dvb-usb/digitv\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dtt200u-fe\.c,drivers/media/usb/dvb-usb/dtt200u-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dtt200u\.c,drivers/media/usb/dvb-usb/dtt200u\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dtt200u\.h,drivers/media/usb/dvb-usb/dtt200u\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dtv5100\.c,drivers/media/usb/dvb-usb/dtv5100\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dtv5100\.h,drivers/media/usb/dvb-usb/dtv5100\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-common\.h,drivers/media/usb/dvb-usb/dvb-usb-common\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-dvb\.c,drivers/media/usb/dvb-usb/dvb-usb-dvb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-firmware\.c,drivers/media/usb/dvb-usb/dvb-usb-firmware\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-i2c\.c,drivers/media/usb/dvb-usb/dvb-usb-i2c\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-init\.c,drivers/media/usb/dvb-usb/dvb-usb-init\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-remote\.c,drivers/media/usb/dvb-usb/dvb-usb-remote\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb-urb\.c,drivers/media/usb/dvb-usb/dvb-usb-urb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb-usb\.h,drivers/media/usb/dvb-usb/dvb-usb\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb_usb_dvb\.c,drivers/media/usb/dvb-usb/dvb_usb_dvb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dvb_usb_remote\.c,drivers/media/usb/dvb-usb/dvb_usb_remote\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dw2102\.c,drivers/media/usb/dvb-usb/dw2102\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/dw2102\.h,drivers/media/usb/dvb-usb/dw2102\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/friio-fe\.c,drivers/media/usb/dvb-usb/friio-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/friio\.c,drivers/media/usb/dvb-usb/friio\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/friio\.h,drivers/media/usb/dvb-usb/friio\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/gp8psk-fe\.c,drivers/media/usb/dvb-usb/gp8psk-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/gp8psk\.c,drivers/media/usb/dvb-usb/gp8psk\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/gp8psk\.h,drivers/media/usb/dvb-usb/gp8psk\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/m920x\.c,drivers/media/usb/dvb-usb/m920x\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/m920x\.h,drivers/media/usb/dvb-usb/m920x\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/nova-t-usb2\.c,drivers/media/usb/dvb-usb/nova-t-usb2\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/opera1\.c,drivers/media/usb/dvb-usb/opera1\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/pctv452e\.c,drivers/media/usb/dvb-usb/pctv452e\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/technisat-usb2\.c,drivers/media/usb/dvb-usb/technisat-usb2\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/ttusb2\.c,drivers/media/usb/dvb-usb/ttusb2\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/ttusb2\.h,drivers/media/usb/dvb-usb/ttusb2\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/umt-010\.c,drivers/media/usb/dvb-usb/umt-010\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/usb-urb\.c,drivers/media/usb/dvb-usb/usb-urb\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp702x-fe\.c,drivers/media/usb/dvb-usb/vp702x-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp702x\.c,drivers/media/usb/dvb-usb/vp702x\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp702x\.h,drivers/media/usb/dvb-usb/vp702x\.h,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp7045-fe\.c,drivers/media/usb/dvb-usb/vp7045-fe\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp7045\.c,drivers/media/usb/dvb-usb/vp7045\.c,g' \ - -e 's,drivers/media/dvb/dvb-usb/vp7045\.h,drivers/media/usb/dvb-usb/vp7045\.h,g' \ - -e 's,drivers/media/video/em28xx/Kconfig,drivers/media/usb/em28xx/Kconfig,g' \ - -e 's,drivers/media/video/em28xx/Makefile,drivers/media/usb/em28xx/Makefile,g' \ - -e 's,drivers/media/video/em28xx/em28xx-audio\.c,drivers/media/usb/em28xx/em28xx-audio\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-cards\.c,drivers/media/usb/em28xx/em28xx-cards\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-core\.c,drivers/media/usb/em28xx/em28xx-core\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-dvb\.c,drivers/media/usb/em28xx/em28xx-dvb\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-i2c\.c,drivers/media/usb/em28xx/em28xx-i2c\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-input\.c,drivers/media/usb/em28xx/em28xx-input\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-reg\.h,drivers/media/usb/em28xx/em28xx-reg\.h,g' \ - -e 's,drivers/media/video/em28xx/em28xx-vbi\.c,drivers/media/usb/em28xx/em28xx-vbi\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx-video\.c,drivers/media/usb/em28xx/em28xx-video\.c,g' \ - -e 's,drivers/media/video/em28xx/em28xx\.h,drivers/media/usb/em28xx/em28xx\.h,g' \ - -e 's,drivers/media/video/gspca/Kconfig,drivers/media/usb/gspca/Kconfig,g' \ - -e 's,drivers/media/video/gspca/Makefile,drivers/media/usb/gspca/Makefile,g' \ - -e 's,drivers/media/video/gspca/autogain_functions\.c,drivers/media/usb/gspca/autogain_functions\.c,g' \ - -e 's,drivers/media/video/gspca/autogain_functions\.h,drivers/media/usb/gspca/autogain_functions\.h,g' \ - -e 's,drivers/media/video/gspca/benq\.c,drivers/media/usb/gspca/benq\.c,g' \ - -e 's,drivers/media/video/gspca/conex\.c,drivers/media/usb/gspca/conex\.c,g' \ - -e 's,drivers/media/video/gspca/cpia1\.c,drivers/media/usb/gspca/cpia1\.c,g' \ - -e 's,drivers/media/video/gspca/etoms\.c,drivers/media/usb/gspca/etoms\.c,g' \ - -e 's,drivers/media/video/gspca/finepix\.c,drivers/media/usb/gspca/finepix\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/Kconfig,drivers/media/usb/gspca/gl860/Kconfig,g' \ - -e 's,drivers/media/video/gspca/gl860/Makefile,drivers/media/usb/gspca/gl860/Makefile,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860-mi1320\.c,drivers/media/usb/gspca/gl860/gl860-mi1320\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860-mi2020\.c,drivers/media/usb/gspca/gl860/gl860-mi2020\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860-ov2640\.c,drivers/media/usb/gspca/gl860/gl860-ov2640\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860-ov9655\.c,drivers/media/usb/gspca/gl860/gl860-ov9655\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860\.c,drivers/media/usb/gspca/gl860/gl860\.c,g' \ - -e 's,drivers/media/video/gspca/gl860/gl860\.h,drivers/media/usb/gspca/gl860/gl860\.h,g' \ - -e 's,drivers/media/video/gspca/gspca\.c,drivers/media/usb/gspca/gspca\.c,g' \ - -e 's,drivers/media/video/gspca/gspca\.h,drivers/media/usb/gspca/gspca\.h,g' \ - -e 's,drivers/media/video/gspca/jeilinj\.c,drivers/media/usb/gspca/jeilinj\.c,g' \ - -e 's,drivers/media/video/gspca/jl2005bcd\.c,drivers/media/usb/gspca/jl2005bcd\.c,g' \ - -e 's,drivers/media/video/gspca/jpeg\.h,drivers/media/usb/gspca/jpeg\.h,g' \ - -e 's,drivers/media/video/gspca/kinect\.c,drivers/media/usb/gspca/kinect\.c,g' \ - -e 's,drivers/media/video/gspca/konica\.c,drivers/media/usb/gspca/konica\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/Kconfig,drivers/media/usb/gspca/m5602/Kconfig,g' \ - -e 's,drivers/media/video/gspca/m5602/Makefile,drivers/media/usb/gspca/m5602/Makefile,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_bridge\.h,drivers/media/usb/gspca/m5602/m5602_bridge\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_core\.c,drivers/media/usb/gspca/m5602/m5602_core\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_mt9m111\.c,drivers/media/usb/gspca/m5602/m5602_mt9m111\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_mt9m111\.h,drivers/media/usb/gspca/m5602/m5602_mt9m111\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_ov7660\.c,drivers/media/usb/gspca/m5602/m5602_ov7660\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_ov7660\.h,drivers/media/usb/gspca/m5602/m5602_ov7660\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_ov9650\.c,drivers/media/usb/gspca/m5602/m5602_ov9650\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_ov9650\.h,drivers/media/usb/gspca/m5602/m5602_ov9650\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_po1030\.c,drivers/media/usb/gspca/m5602/m5602_po1030\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_po1030\.h,drivers/media/usb/gspca/m5602/m5602_po1030\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_s5k4aa\.c,drivers/media/usb/gspca/m5602/m5602_s5k4aa\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_s5k4aa\.h,drivers/media/usb/gspca/m5602/m5602_s5k4aa\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_s5k83a\.c,drivers/media/usb/gspca/m5602/m5602_s5k83a\.c,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_s5k83a\.h,drivers/media/usb/gspca/m5602/m5602_s5k83a\.h,g' \ - -e 's,drivers/media/video/gspca/m5602/m5602_sensor\.h,drivers/media/usb/gspca/m5602/m5602_sensor\.h,g' \ - -e 's,drivers/media/video/gspca/mars\.c,drivers/media/usb/gspca/mars\.c,g' \ - -e 's,drivers/media/video/gspca/mr97310a\.c,drivers/media/usb/gspca/mr97310a\.c,g' \ - -e 's,drivers/media/video/gspca/nw80x\.c,drivers/media/usb/gspca/nw80x\.c,g' \ - -e 's,drivers/media/video/gspca/ov519\.c,drivers/media/usb/gspca/ov519\.c,g' \ - -e 's,drivers/media/video/gspca/ov534\.c,drivers/media/usb/gspca/ov534\.c,g' \ - -e 's,drivers/media/video/gspca/ov534_9\.c,drivers/media/usb/gspca/ov534_9\.c,g' \ - -e 's,drivers/media/video/gspca/pac207\.c,drivers/media/usb/gspca/pac207\.c,g' \ - -e 's,drivers/media/video/gspca/pac7302\.c,drivers/media/usb/gspca/pac7302\.c,g' \ - -e 's,drivers/media/video/gspca/pac7311\.c,drivers/media/usb/gspca/pac7311\.c,g' \ - -e 's,drivers/media/video/gspca/pac_common\.h,drivers/media/usb/gspca/pac_common\.h,g' \ - -e 's,drivers/media/video/gspca/se401\.c,drivers/media/usb/gspca/se401\.c,g' \ - -e 's,drivers/media/video/gspca/se401\.h,drivers/media/usb/gspca/se401\.h,g' \ - -e 's,drivers/media/video/gspca/sn9c2028\.c,drivers/media/usb/gspca/sn9c2028\.c,g' \ - -e 's,drivers/media/video/gspca/sn9c2028\.h,drivers/media/usb/gspca/sn9c2028\.h,g' \ - -e 's,drivers/media/video/gspca/sn9c20x\.c,drivers/media/usb/gspca/sn9c20x\.c,g' \ - -e 's,drivers/media/video/gspca/sonixb\.c,drivers/media/usb/gspca/sonixb\.c,g' \ - -e 's,drivers/media/video/gspca/sonixj\.c,drivers/media/usb/gspca/sonixj\.c,g' \ - -e 's,drivers/media/video/gspca/spca1528\.c,drivers/media/usb/gspca/spca1528\.c,g' \ - -e 's,drivers/media/video/gspca/spca500\.c,drivers/media/usb/gspca/spca500\.c,g' \ - -e 's,drivers/media/video/gspca/spca501\.c,drivers/media/usb/gspca/spca501\.c,g' \ - -e 's,drivers/media/video/gspca/spca505\.c,drivers/media/usb/gspca/spca505\.c,g' \ - -e 's,drivers/media/video/gspca/spca506\.c,drivers/media/usb/gspca/spca506\.c,g' \ - -e 's,drivers/media/video/gspca/spca508\.c,drivers/media/usb/gspca/spca508\.c,g' \ - -e 's,drivers/media/video/gspca/spca561\.c,drivers/media/usb/gspca/spca561\.c,g' \ - -e 's,drivers/media/video/gspca/sq905\.c,drivers/media/usb/gspca/sq905\.c,g' \ - -e 's,drivers/media/video/gspca/sq905c\.c,drivers/media/usb/gspca/sq905c\.c,g' \ - -e 's,drivers/media/video/gspca/sq930x\.c,drivers/media/usb/gspca/sq930x\.c,g' \ - -e 's,drivers/media/video/gspca/stk014\.c,drivers/media/usb/gspca/stk014\.c,g' \ - -e 's,drivers/media/video/gspca/stv0680\.c,drivers/media/usb/gspca/stv0680\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/Kconfig,drivers/media/usb/gspca/stv06xx/Kconfig,g' \ - -e 's,drivers/media/video/gspca/stv06xx/Makefile,drivers/media/usb/gspca/stv06xx/Makefile,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx\.c,drivers/media/usb/gspca/stv06xx/stv06xx\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx\.h,drivers/media/usb/gspca/stv06xx/stv06xx\.h,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_hdcs\.c,drivers/media/usb/gspca/stv06xx/stv06xx_hdcs\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_hdcs\.h,drivers/media/usb/gspca/stv06xx/stv06xx_hdcs\.h,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_pb0100\.c,drivers/media/usb/gspca/stv06xx/stv06xx_pb0100\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_pb0100\.h,drivers/media/usb/gspca/stv06xx/stv06xx_pb0100\.h,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_sensor\.h,drivers/media/usb/gspca/stv06xx/stv06xx_sensor\.h,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_st6422\.c,drivers/media/usb/gspca/stv06xx/stv06xx_st6422\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_st6422\.h,drivers/media/usb/gspca/stv06xx/stv06xx_st6422\.h,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_vv6410\.c,drivers/media/usb/gspca/stv06xx/stv06xx_vv6410\.c,g' \ - -e 's,drivers/media/video/gspca/stv06xx/stv06xx_vv6410\.h,drivers/media/usb/gspca/stv06xx/stv06xx_vv6410\.h,g' \ - -e 's,drivers/media/video/gspca/sunplus\.c,drivers/media/usb/gspca/sunplus\.c,g' \ - -e 's,drivers/media/video/gspca/t613\.c,drivers/media/usb/gspca/t613\.c,g' \ - -e 's,drivers/media/video/gspca/topro\.c,drivers/media/usb/gspca/topro\.c,g' \ - -e 's,drivers/media/video/gspca/tv8532\.c,drivers/media/usb/gspca/tv8532\.c,g' \ - -e 's,drivers/media/video/gspca/vc032x\.c,drivers/media/usb/gspca/vc032x\.c,g' \ - -e 's,drivers/media/video/gspca/vicam\.c,drivers/media/usb/gspca/vicam\.c,g' \ - -e 's,drivers/media/video/gspca/w996Xcf\.c,drivers/media/usb/gspca/w996Xcf\.c,g' \ - -e 's,drivers/media/video/gspca/xirlink_cit\.c,drivers/media/usb/gspca/xirlink_cit\.c,g' \ - -e 's,drivers/media/video/gspca/zc3xx-reg\.h,drivers/media/usb/gspca/zc3xx-reg\.h,g' \ - -e 's,drivers/media/video/gspca/zc3xx\.c,drivers/media/usb/gspca/zc3xx\.c,g' \ - -e 's,drivers/media/video/hdpvr/Kconfig,drivers/media/usb/hdpvr/Kconfig,g' \ - -e 's,drivers/media/video/hdpvr/Makefile,drivers/media/usb/hdpvr/Makefile,g' \ - -e 's,drivers/media/video/hdpvr/hdpvr-control\.c,drivers/media/usb/hdpvr/hdpvr-control\.c,g' \ - -e 's,drivers/media/video/hdpvr/hdpvr-core\.c,drivers/media/usb/hdpvr/hdpvr-core\.c,g' \ - -e 's,drivers/media/video/hdpvr/hdpvr-i2c\.c,drivers/media/usb/hdpvr/hdpvr-i2c\.c,g' \ - -e 's,drivers/media/video/hdpvr/hdpvr-video\.c,drivers/media/usb/hdpvr/hdpvr-video\.c,g' \ - -e 's,drivers/media/video/hdpvr/hdpvr\.h,drivers/media/usb/hdpvr/hdpvr\.h,g' \ - -e 's,drivers/media/video/pvrusb2/Kconfig,drivers/media/usb/pvrusb2/Kconfig,g' \ - -e 's,drivers/media/video/pvrusb2/Makefile,drivers/media/usb/pvrusb2/Makefile,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-audio\.c,drivers/media/usb/pvrusb2/pvrusb2-audio\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-audio\.h,drivers/media/usb/pvrusb2/pvrusb2-audio\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-context\.c,drivers/media/usb/pvrusb2/pvrusb2-context\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-context\.h,drivers/media/usb/pvrusb2/pvrusb2-context\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-cs53l32a\.c,drivers/media/usb/pvrusb2/pvrusb2-cs53l32a\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-cs53l32a\.h,drivers/media/usb/pvrusb2/pvrusb2-cs53l32a\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-ctrl\.c,drivers/media/usb/pvrusb2/pvrusb2-ctrl\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-ctrl\.h,drivers/media/usb/pvrusb2/pvrusb2-ctrl\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l\.c,drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l\.h,drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-debug\.h,drivers/media/usb/pvrusb2/pvrusb2-debug\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-debugifc\.c,drivers/media/usb/pvrusb2/pvrusb2-debugifc\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-debugifc\.h,drivers/media/usb/pvrusb2/pvrusb2-debugifc\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-devattr\.c,drivers/media/usb/pvrusb2/pvrusb2-devattr\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-devattr\.h,drivers/media/usb/pvrusb2/pvrusb2-devattr\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-dvb\.c,drivers/media/usb/pvrusb2/pvrusb2-dvb\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-dvb\.h,drivers/media/usb/pvrusb2/pvrusb2-dvb\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-eeprom\.c,drivers/media/usb/pvrusb2/pvrusb2-eeprom\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-eeprom\.h,drivers/media/usb/pvrusb2/pvrusb2-eeprom\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-encoder\.c,drivers/media/usb/pvrusb2/pvrusb2-encoder\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-encoder\.h,drivers/media/usb/pvrusb2/pvrusb2-encoder\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-fx2-cmd\.h,drivers/media/usb/pvrusb2/pvrusb2-fx2-cmd\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw-internal\.h,drivers/media/usb/pvrusb2/pvrusb2-hdw-internal\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw\.c,drivers/media/usb/pvrusb2/pvrusb2-hdw\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw\.h,drivers/media/usb/pvrusb2/pvrusb2-hdw\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-i2c-core\.c,drivers/media/usb/pvrusb2/pvrusb2-i2c-core\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-i2c-core\.h,drivers/media/usb/pvrusb2/pvrusb2-i2c-core\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-io\.c,drivers/media/usb/pvrusb2/pvrusb2-io\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-io\.h,drivers/media/usb/pvrusb2/pvrusb2-io\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-ioread\.c,drivers/media/usb/pvrusb2/pvrusb2-ioread\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-ioread\.h,drivers/media/usb/pvrusb2/pvrusb2-ioread\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-main\.c,drivers/media/usb/pvrusb2/pvrusb2-main\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-std\.c,drivers/media/usb/pvrusb2/pvrusb2-std\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-std\.h,drivers/media/usb/pvrusb2/pvrusb2-std\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-sysfs\.c,drivers/media/usb/pvrusb2/pvrusb2-sysfs\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-sysfs\.h,drivers/media/usb/pvrusb2/pvrusb2-sysfs\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-util\.h,drivers/media/usb/pvrusb2/pvrusb2-util\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-v4l2\.c,drivers/media/usb/pvrusb2/pvrusb2-v4l2\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-v4l2\.h,drivers/media/usb/pvrusb2/pvrusb2-v4l2\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-video-v4l\.c,drivers/media/usb/pvrusb2/pvrusb2-video-v4l\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-video-v4l\.h,drivers/media/usb/pvrusb2/pvrusb2-video-v4l\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-wm8775\.c,drivers/media/usb/pvrusb2/pvrusb2-wm8775\.c,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2-wm8775\.h,drivers/media/usb/pvrusb2/pvrusb2-wm8775\.h,g' \ - -e 's,drivers/media/video/pvrusb2/pvrusb2\.h,drivers/media/usb/pvrusb2/pvrusb2\.h,g' \ - -e 's,drivers/media/video/pwc/Kconfig,drivers/media/usb/pwc/Kconfig,g' \ - -e 's,drivers/media/video/pwc/Makefile,drivers/media/usb/pwc/Makefile,g' \ - -e 's,drivers/media/video/pwc/philips\.txt,drivers/media/usb/pwc/philips\.txt,g' \ - -e 's,drivers/media/video/pwc/pwc-ctrl\.c,drivers/media/usb/pwc/pwc-ctrl\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-dec1\.c,drivers/media/usb/pwc/pwc-dec1\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-dec1\.h,drivers/media/usb/pwc/pwc-dec1\.h,g' \ - -e 's,drivers/media/video/pwc/pwc-dec23\.c,drivers/media/usb/pwc/pwc-dec23\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-dec23\.h,drivers/media/usb/pwc/pwc-dec23\.h,g' \ - -e 's,drivers/media/video/pwc/pwc-if\.c,drivers/media/usb/pwc/pwc-if\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-kiara\.c,drivers/media/usb/pwc/pwc-kiara\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-kiara\.h,drivers/media/usb/pwc/pwc-kiara\.h,g' \ - -e 's,drivers/media/video/pwc/pwc-misc\.c,drivers/media/usb/pwc/pwc-misc\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-nala\.h,drivers/media/usb/pwc/pwc-nala\.h,g' \ - -e 's,drivers/media/video/pwc/pwc-timon\.c,drivers/media/usb/pwc/pwc-timon\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-timon\.h,drivers/media/usb/pwc/pwc-timon\.h,g' \ - -e 's,drivers/media/video/pwc/pwc-uncompress\.c,drivers/media/usb/pwc/pwc-uncompress\.c,g' \ - -e 's,drivers/media/video/pwc/pwc-v4l\.c,drivers/media/usb/pwc/pwc-v4l\.c,g' \ - -e 's,drivers/media/video/pwc/pwc\.h,drivers/media/usb/pwc/pwc\.h,g' \ - -e 's,drivers/media/video/s2255drv\.c,drivers/media/usb/s2255/s2255drv\.c,g' \ - -e 's,drivers/media/dvb/siano/smsusb\.c,drivers/media/usb/siano/smsusb\.c,g' \ - -e 's,drivers/media/video/sn9c102/Kconfig,drivers/media/usb/sn9c102/Kconfig,g' \ - -e 's,drivers/media/video/sn9c102/Makefile,drivers/media/usb/sn9c102/Makefile,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102\.h,drivers/media/usb/sn9c102/sn9c102\.h,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_config\.h,drivers/media/usb/sn9c102/sn9c102_config\.h,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_core\.c,drivers/media/usb/sn9c102/sn9c102_core\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_devtable\.h,drivers/media/usb/sn9c102/sn9c102_devtable\.h,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_hv7131d\.c,drivers/media/usb/sn9c102/sn9c102_hv7131d\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_hv7131r\.c,drivers/media/usb/sn9c102/sn9c102_hv7131r\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_mi0343\.c,drivers/media/usb/sn9c102/sn9c102_mi0343\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_mi0360\.c,drivers/media/usb/sn9c102/sn9c102_mi0360\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_mt9v111\.c,drivers/media/usb/sn9c102/sn9c102_mt9v111\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_ov7630\.c,drivers/media/usb/sn9c102/sn9c102_ov7630\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_ov7660\.c,drivers/media/usb/sn9c102/sn9c102_ov7660\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_pas106b\.c,drivers/media/usb/sn9c102/sn9c102_pas106b\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_pas202bcb\.c,drivers/media/usb/sn9c102/sn9c102_pas202bcb\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_sensor\.h,drivers/media/usb/sn9c102/sn9c102_sensor\.h,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_tas5110c1b\.c,drivers/media/usb/sn9c102/sn9c102_tas5110c1b\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_tas5110d\.c,drivers/media/usb/sn9c102/sn9c102_tas5110d\.c,g' \ - -e 's,drivers/media/video/sn9c102/sn9c102_tas5130d1b\.c,drivers/media/usb/sn9c102/sn9c102_tas5130d1b\.c,g' \ - -e 's,drivers/media/video/stk1160/Kconfig,drivers/media/usb/stk1160/Kconfig,g' \ - -e 's,drivers/media/video/stk1160/Makefile,drivers/media/usb/stk1160/Makefile,g' \ - -e 's,drivers/media/video/stk1160/stk1160-ac97\.c,drivers/media/usb/stk1160/stk1160-ac97\.c,g' \ - -e 's,drivers/media/video/stk1160/stk1160-core\.c,drivers/media/usb/stk1160/stk1160-core\.c,g' \ - -e 's,drivers/media/video/stk1160/stk1160-i2c\.c,drivers/media/usb/stk1160/stk1160-i2c\.c,g' \ - -e 's,drivers/media/video/stk1160/stk1160-reg\.h,drivers/media/usb/stk1160/stk1160-reg\.h,g' \ - -e 's,drivers/media/video/stk1160/stk1160-v4l\.c,drivers/media/usb/stk1160/stk1160-v4l\.c,g' \ - -e 's,drivers/media/video/stk1160/stk1160-video\.c,drivers/media/usb/stk1160/stk1160-video\.c,g' \ - -e 's,drivers/media/video/stk1160/stk1160\.h,drivers/media/usb/stk1160/stk1160\.h,g' \ - -e 's,drivers/media/video/stk-sensor\.c,drivers/media/usb/stkwebcam/stk-sensor\.c,g' \ - -e 's,drivers/media/video/stk-webcam\.c,drivers/media/usb/stkwebcam/stk-webcam\.c,g' \ - -e 's,drivers/media/video/stk-webcam\.h,drivers/media/usb/stkwebcam/stk-webcam\.h,g' \ - -e 's,drivers/media/video/tlg2300/Kconfig,drivers/media/usb/tlg2300/Kconfig,g' \ - -e 's,drivers/media/video/tlg2300/Makefile,drivers/media/usb/tlg2300/Makefile,g' \ - -e 's,drivers/media/video/tlg2300/pd-alsa\.c,drivers/media/usb/tlg2300/pd-alsa\.c,g' \ - -e 's,drivers/media/video/tlg2300/pd-common\.h,drivers/media/usb/tlg2300/pd-common\.h,g' \ - -e 's,drivers/media/video/tlg2300/pd-dvb\.c,drivers/media/usb/tlg2300/pd-dvb\.c,g' \ - -e 's,drivers/media/video/tlg2300/pd-main\.c,drivers/media/usb/tlg2300/pd-main\.c,g' \ - -e 's,drivers/media/video/tlg2300/pd-radio\.c,drivers/media/usb/tlg2300/pd-radio\.c,g' \ - -e 's,drivers/media/video/tlg2300/pd-video\.c,drivers/media/usb/tlg2300/pd-video\.c,g' \ - -e 's,drivers/media/video/tlg2300/vendorcmds\.h,drivers/media/usb/tlg2300/vendorcmds\.h,g' \ - -e 's,drivers/media/video/tm6000/Kconfig,drivers/media/usb/tm6000/Kconfig,g' \ - -e 's,drivers/media/video/tm6000/Makefile,drivers/media/usb/tm6000/Makefile,g' \ - -e 's,drivers/media/video/tm6000/tm6000-alsa\.c,drivers/media/usb/tm6000/tm6000-alsa\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-cards\.c,drivers/media/usb/tm6000/tm6000-cards\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-core\.c,drivers/media/usb/tm6000/tm6000-core\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-dvb\.c,drivers/media/usb/tm6000/tm6000-dvb\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-i2c\.c,drivers/media/usb/tm6000/tm6000-i2c\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-input\.c,drivers/media/usb/tm6000/tm6000-input\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-regs\.h,drivers/media/usb/tm6000/tm6000-regs\.h,g' \ - -e 's,drivers/media/video/tm6000/tm6000-stds\.c,drivers/media/usb/tm6000/tm6000-stds\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000-usb-isoc\.h,drivers/media/usb/tm6000/tm6000-usb-isoc\.h,g' \ - -e 's,drivers/media/video/tm6000/tm6000-video\.c,drivers/media/usb/tm6000/tm6000-video\.c,g' \ - -e 's,drivers/media/video/tm6000/tm6000\.h,drivers/media/usb/tm6000/tm6000\.h,g' \ - -e 's,drivers/media/dvb/ttusb-budget/Kconfig,drivers/media/usb/ttusb-budget/Kconfig,g' \ - -e 's,drivers/media/dvb/ttusb-budget/Makefile,drivers/media/usb/ttusb-budget/Makefile,g' \ - -e 's,drivers/media/dvb/ttusb-budget/dvb-ttusb-budget\.c,drivers/media/usb/ttusb-budget/dvb-ttusb-budget\.c,g' \ - -e 's,drivers/media/dvb/ttusb-dec/Kconfig,drivers/media/usb/ttusb-dec/Kconfig,g' \ - -e 's,drivers/media/dvb/ttusb-dec/Makefile,drivers/media/usb/ttusb-dec/Makefile,g' \ - -e 's,drivers/media/dvb/ttusb-dec/ttusb_dec\.c,drivers/media/usb/ttusb-dec/ttusb_dec\.c,g' \ - -e 's,drivers/media/dvb/ttusb-dec/ttusbdecfe\.c,drivers/media/usb/ttusb-dec/ttusbdecfe\.c,g' \ - -e 's,drivers/media/dvb/ttusb-dec/ttusbdecfe\.h,drivers/media/usb/ttusb-dec/ttusbdecfe\.h,g' \ - -e 's,drivers/media/video/usbvision/Kconfig,drivers/media/usb/usbvision/Kconfig,g' \ - -e 's,drivers/media/video/usbvision/Makefile,drivers/media/usb/usbvision/Makefile,g' \ - -e 's,drivers/media/video/usbvision/usbvision-cards\.c,drivers/media/usb/usbvision/usbvision-cards\.c,g' \ - -e 's,drivers/media/video/usbvision/usbvision-cards\.h,drivers/media/usb/usbvision/usbvision-cards\.h,g' \ - -e 's,drivers/media/video/usbvision/usbvision-core\.c,drivers/media/usb/usbvision/usbvision-core\.c,g' \ - -e 's,drivers/media/video/usbvision/usbvision-i2c\.c,drivers/media/usb/usbvision/usbvision-i2c\.c,g' \ - -e 's,drivers/media/video/usbvision/usbvision-video\.c,drivers/media/usb/usbvision/usbvision-video\.c,g' \ - -e 's,drivers/media/video/usbvision/usbvision\.h,drivers/media/usb/usbvision/usbvision\.h,g' \ - -e 's,drivers/media/video/uvc/Kconfig,drivers/media/usb/uvc/Kconfig,g' \ - -e 's,drivers/media/video/uvc/Makefile,drivers/media/usb/uvc/Makefile,g' \ - -e 's,drivers/media/video/uvc/uvc_ctrl\.c,drivers/media/usb/uvc/uvc_ctrl\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_debugfs\.c,drivers/media/usb/uvc/uvc_debugfs\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_driver\.c,drivers/media/usb/uvc/uvc_driver\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_entity\.c,drivers/media/usb/uvc/uvc_entity\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_isight\.c,drivers/media/usb/uvc/uvc_isight\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_queue\.c,drivers/media/usb/uvc/uvc_queue\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_status\.c,drivers/media/usb/uvc/uvc_status\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_v4l2\.c,drivers/media/usb/uvc/uvc_v4l2\.c,g' \ - -e 's,drivers/media/video/uvc/uvc_video\.c,drivers/media/usb/uvc/uvc_video\.c,g' \ - -e 's,drivers/media/video/uvc/uvcvideo\.h,drivers/media/usb/uvc/uvcvideo\.h,g' \ - -e 's,drivers/media/video/zr364xx\.c,drivers/media/usb/zr364xx/zr364xx\.c,g' \ - -e 's,drivers/media/video/tuner-core\.c,drivers/media/v4l2-core/tuner-core\.c,g' \ - -e 's,drivers/media/video/v4l2-common\.c,drivers/media/v4l2-core/v4l2-common\.c,g' \ - -e 's,drivers/media/video/v4l2-compat-ioctl32\.c,drivers/media/v4l2-core/v4l2-compat-ioctl32\.c,g' \ - -e 's,drivers/media/video/v4l2-ctrls\.c,drivers/media/v4l2-core/v4l2-ctrls\.c,g' \ - -e 's,drivers/media/video/v4l2-dev\.c,drivers/media/v4l2-core/v4l2-dev\.c,g' \ - -e 's,drivers/media/video/v4l2-device\.c,drivers/media/v4l2-core/v4l2-device\.c,g' \ - -e 's,drivers/media/video/v4l2-event\.c,drivers/media/v4l2-core/v4l2-event\.c,g' \ - -e 's,drivers/media/video/v4l2-fh\.c,drivers/media/v4l2-core/v4l2-fh\.c,g' \ - -e 's,drivers/media/video/v4l2-int-device\.c,drivers/media/v4l2-core/v4l2-int-device\.c,g' \ - -e 's,drivers/media/video/v4l2-ioctl\.c,drivers/media/v4l2-core/v4l2-ioctl\.c,g' \ - -e 's,drivers/media/video/v4l2-mem2mem\.c,drivers/media/v4l2-core/v4l2-mem2mem\.c,g' \ - -e 's,drivers/media/video/v4l2-subdev\.c,drivers/media/v4l2-core/v4l2-subdev\.c,g' \ - -e 's,drivers/media/video/videobuf-core\.c,drivers/media/v4l2-core/videobuf-core\.c,g' \ - -e 's,drivers/media/video/videobuf-dma-contig\.c,drivers/media/v4l2-core/videobuf-dma-contig\.c,g' \ - -e 's,drivers/media/video/videobuf-dma-sg\.c,drivers/media/v4l2-core/videobuf-dma-sg\.c,g' \ - -e 's,drivers/media/video/videobuf-dvb\.c,drivers/media/v4l2-core/videobuf-dvb\.c,g' \ - -e 's,drivers/media/video/videobuf-vmalloc\.c,drivers/media/v4l2-core/videobuf-vmalloc\.c,g' \ - -e 's,drivers/media/video/videobuf2-core\.c,drivers/media/v4l2-core/videobuf2-core\.c,g' \ - -e 's,drivers/media/video/videobuf2-dma-contig\.c,drivers/media/v4l2-core/videobuf2-dma-contig\.c,g' \ - -e 's,drivers/media/video/videobuf2-dma-sg\.c,drivers/media/v4l2-core/videobuf2-dma-sg\.c,g' \ - -e 's,drivers/media/video/videobuf2-memops\.c,drivers/media/v4l2-core/videobuf2-memops\.c,g' \ - -e 's,drivers/media/video/videobuf2-vmalloc\.c,drivers/media/v4l2-core/videobuf2-vmalloc\.c,g' \ - >$1 && \ -echo -e "old patch stored as "$OLD"\n$1 rewrote." diff -Nru media-build-dkms-0004~trusty/media-build-0004/dkms.conf media-build-dkms-0005~trusty/media-build-0004/dkms.conf --- media-build-dkms-0004~trusty/media-build-0004/dkms.conf 2017-09-10 19:39:49.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/dkms.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -PACKAGE_NAME=media-build - -# Source the media_build DKMS version definition -conf_dir=$(dirname ${BASH_SOURCE[0]}) -. ${conf_dir}/dkms_ver.conf - -[ -n "$module" ] || module=${PACKAGE_NAME} -[ -n "$module_version" ] || module_version=${PACKAGE_VERSION} - -# The base for the module -local dkms_dir="$dkms_tree/$module/$module_version" - -# This is where DKMS stores all of it's data (after the MAKE[0] step!). -local base_dir="$dkms_dir/$kernelver/$arch" - -# We need an existing path during the build step to create the install -# directory, because media build will also install all the modules. The -# install directory will be cleaned just after the POST_BUILD step, so -# this directory is existing very short on the file system. -local media_inst_dir="$dkms_dir/build/_media_inst" - -# The dynamically generated DKMS configuration file name. This gets sourced by -# the top DKMS configuration file (this file), if it exists (see end of this -# script). It defines all the built modules depending on the kernel version or -# configuration options of medial_build. -# -# This dynamically generated DKMS configuration file is generated by a post -# build command script (gen_dkms_dyn_conf.sh). -# -# It is important, that it exists when the DKMS install command is executed. -local dkms_dyn_conf="$base_dir/dkms_dyn.conf" - -# The module directory, where DKMS stores the built modules after the build. -local dkms_mod_dir="$base_dir/module" - -AUTOINSTALL=y - -# The DKMS system will add KERNELRELEASE to the make command line -MAKE[0]="make MEDIA_INST_DIR=$media_inst_dir -f Makefile.dkms build" -CLEAN="make MEDIA_INST_DIR=$media_inst_dir -f Makefile.dkms clean" -POST_BUILD="gen_dkms_dyn_conf.sh $dkms_mod_dir $media_inst_dir $dkms_dyn_conf" -#POST_INSTALL="handle_updated_modules.sh $base_dir $kernelver $arch install" -CHECK_MODULE_VERSION=n - -# There have to be at least one module defined in the top DKMS configuration -# file, otherwise DKMS throws an error. -# Note: This definition gets overridden later by the dynamically generated -# DKMS configuration file. -# -BUILT_MODULE_NAME[0]=dvb-core -# -# We use here the real build location, because the file needs to exist to -# finish the build step. -BUILT_MODULE_LOCATION[0]=./v4l -# -# It is important to use the real module path here, so that the uninstall -# command works correctly -DEST_MODULE_LOCATION[0]=/kernel/drivers/media/dvb-core - -# Source the dynamically generated DKMS configuration file. -if [ -e $dkms_dyn_conf ]; then - . $dkms_dyn_conf -fi diff -Nru media-build-dkms-0004~trusty/media-build-0004/dkms_updated_modules.conf media-build-dkms-0005~trusty/media-build-0004/dkms_updated_modules.conf --- media-build-dkms-0004~trusty/media-build-0004/dkms_updated_modules.conf 2017-09-10 19:05:03.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/dkms_updated_modules.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -# -# List of modules to be removed after DKMS install. -# -# It is intended to list here modules, which may installed in the original -# Kernel tree, but should no longer be there because they are exchanged by -# other modules or no longer supported. -# -REMOVE_MODULE_NAME[0]=lirc_sasem -REMOVE_MODULE_LOCATION[0]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[1]=lirc_parallel -REMOVE_MODULE_LOCATION[1]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[2]=lirc_igorplugusb -REMOVE_MODULE_LOCATION[2]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[3]=lirc_bt829 -REMOVE_MODULE_LOCATION[3]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[4]=lirc_imon -REMOVE_MODULE_LOCATION[4]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[5]=lirc_sir -REMOVE_MODULE_LOCATION[5]=/kernel/drivers/staging/media/lirc -REMOVE_MODULE_NAME[6]=lirc_serial -REMOVE_MODULE_LOCATION[6]=/kernel/drivers/staging/media/lirc - diff -Nru media-build-dkms-0004~trusty/media-build-0004/dkms_ver.conf media-build-dkms-0005~trusty/media-build-0004/dkms_ver.conf --- media-build-dkms-0004~trusty/media-build-0004/dkms_ver.conf 2017-09-10 12:01:37.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/dkms_ver.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -PACKAGE_VERSION=0004 diff -Nru media-build-dkms-0004~trusty/media-build-0004/gen_dkms_dyn_conf.sh media-build-dkms-0005~trusty/media-build-0004/gen_dkms_dyn_conf.sh --- media-build-dkms-0004~trusty/media-build-0004/gen_dkms_dyn_conf.sh 2017-09-06 21:46:16.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/gen_dkms_dyn_conf.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -#!/bin/bash - -# base for the final installation in "/lib/modules/..." (might be changed -# for different distributions) -# Note: DKMS handles most if the distribution specific part already! -mod_dest_loc_base="/kernel" - -# base where media build does install all the modules (defined by media -# build scripts; do not change!) -mod_build_loc_base='/kernel' - -# Valid dummy to be used for the build location (not used by DKMS) -mod_dir='./v4l' - -mod_pattern='*.ko' - - -err_ok=0 -err_usage=1 -err_dir_not_found=2 -err_default=10 - -# Index 0 is the dvb-core.ko module defined in the top DKMS -# configuration file. We override this default by the dynamically -# generated DKMS configuration. -mod_idx=0 - -module_copy_script_name="mod_copy.sh" -module_copy_script="${module_copy_script_name}" - -mod_build_loc="" - -function exit_print { - if [ -z "${2}" ] ; then - code=${err_default} - else - code=${2} - fi - - echo "${1}" - exit ${code} -} - -function err_exit { - exit_print "Error: ${1}" ${2} -} - -function usage { - echo "Usage: $0 [--help]" - echo " : directory where the modules are stored by" - echo " DKMS after the build step." - echo " : directory where the media build has installed all" - echo " the modules with their right location" - echo " : filename of the dynamic part of the DKMS config" - echo " file generated by this script." - echo " Options:" - echo " --help: This text" - exit_print "" ${err_usage} -} - -# Note: This function gets executed in a sub-shell (pipe in find_modules), -# so it is not possible to use mod_idx later! -function found_module { - mod_name=$(basename -s .ko ${1}) - mod_build_dir=$(dirname ${1}) - if [[ ${mod_build_dir} =~ (.*)${mod_build_loc_base}(.*) ]] ; then - mod_dest_location="${mod_dest_loc_base}${BASH_REMATCH[2]}" - echo "BUILT_MODULE_NAME[${mod_idx}]=${mod_name}" >> ${dkms_dyn_conf} - echo "BUILT_MODULE_LOCATION[${mod_idx}]=${mod_dir}" >> ${dkms_dyn_conf} - echo "DEST_MODULE_LOCATION[${mod_idx}]=${mod_dest_location}" >> ${dkms_dyn_conf} - - echo "cp -af ${mod_build_dir}/${mod_name}.ko ${module_dir}/${mod_name}.ko" >> ${module_copy_script} - - mod_idx=$((mod_idx + 1)) - fi -} - -function find_modules { - find ${mod_build_loc} -name ${mod_pattern} | while read file; do found_module "$file"; done -} - -function arg_check_help { - if [ "${1}" = "--help" ] ; then - usage - fi -} - -# main - -if [ $# -lt 3 ] ; then - usage -fi - -arg_check_help "${1}" - -module_dir="${1}" -shift - -arg_check_help "${1}" - -media_inst_dir="${1}" -shift - -arg_check_help "${1}" - -dkms_dyn_conf="${1}" -shift - -# First check, if the target module directory to store also the dynamically -# generated files, does already exist -if [ ! -d ${module_dir} ] ; then - err_exit "Target module directory ${module_dir} doesn't exist!" ${err_dir_not_found} -fi - -# Check if the media build has been installed the new modules -if [ ! -d ${media_inst_dir} -a -f "${media_inst_dir}/DKMS_INST" ] ; then - err_exit "Installed media build modules not found in ${media_inst_dir}!" ${err_dir_not_found} -fi - -# Now check, if the directory of the generated file -# does already exist -dkms_dyn_conf_dir=$(dirname ${dkms_dyn_conf}) -if [ ! -d ${dkms_dyn_conf_dir} ] ; then - err_exit "Target directory for dynamic DKMS config doesn't exist!" ${err_dir_not_found} -fi - -module_copy_script="${dkms_dyn_conf_dir}/${module_copy_script_name}" -mod_build_loc="${media_inst_dir}" - -# we generate it always new -rm -f ${dkms_dyn_conf} -echo "#" > ${dkms_dyn_conf} -echo "# Generated by $(basename ${0})" >> ${dkms_dyn_conf} -echo "# at $(date -R)" >> ${dkms_dyn_conf} -echo "#" >> ${dkms_dyn_conf} - -rm -f ${module_copy_script} -echo "#!/bin/bash" > ${module_copy_script} -echo "#" >> ${module_copy_script} -echo "# Generated by $(basename ${0})" >> ${module_copy_script} -echo "# at $(date -R)" >> ${module_copy_script} -echo "#" >> ${module_copy_script} - -find_modules - -# copy the generated modules -source ${module_copy_script} - -exit_print "Done!" ${err_ok} - diff -Nru media-build-dkms-0004~trusty/media-build-0004/handle_updated_modules.sh media-build-dkms-0005~trusty/media-build-0004/handle_updated_modules.sh --- media-build-dkms-0004~trusty/media-build-0004/handle_updated_modules.sh 2017-09-10 19:40:22.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/handle_updated_modules.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ -#!/bin/bash - -# base for the final installation in "/lib/modules/..." (might be changed -# for different distributions) -# Note: DKMS handles most if the distribution specific part already! -mod_dest_loc_base="/kernel" - -upd_mod_conf_name='dkms_updated_modules.conf' -mod_pattern='*.ko' -module_suffix='.ko' -install_tree="/lib/modules" - - -err_ok=0 -err_usage=1 -err_dir_not_found=2 -err_tmp_failed=3 -err_read_config=4 -err_kernel_tree=5 -err_action=6 -err_default=20 - -modules_removed="" - -readonly update_conf_variables="REMOVE_MODULE_NAME REMOVE_MODULE_LOCATION" - -function exit_print { - if [ -z "${2}" ] ; then - code=${err_default} - else - code=${2} - fi - - echo "${1}" - exit ${code} -} - -function err_exit { - exit_print "Error: ${1}" ${2} -} - -function usage { - echo "Usage: $0 [--help]" - echo " : directory where the DKMS stores the build information" - echo " (there are the 'module' and 'log' directories)." - echo " : kernel version as used by DKMS" - echo " : architecture as used by DKMS" - echo " : install or uninstall" - echo " Options:" - echo " --help: This text" - exit_print "" ${err_usage} -} - -function arg_check_help { - if [ "${1}" = "--help" ] ; then - usage - fi -} - -mktemp_or_die() { - local t - t=$(mktemp "$@") && echo "$t" && return - [[ $* = *-d* ]] && err_exit "Unable to make temporary directory" ${err_tmp_failed} - err_exit "Unable to make temporary file." ${err_tmp_failed} -} - -# copied from dkms shell script -function safe_source { - # $1 = file to source - # $@ = environment variables to echo out - local to_source_file="$1"; shift - declare -a -r export_envs=("$@") - local tmpfile=$(mktemp_or_die) - ( exec >"$tmpfile" - . "$to_source_file" >/dev/null - # This is really ugly, but a neat hack - # Remember, in bash 2.0 and greater all variables are really arrays. - for _export_env in "${export_envs[@]}"; do - for _i in $(eval echo \${!$_export_env[@]}); do - eval echo '$_export_env[$_i]=\"${'$_export_env'[$_i]}\"' - done - done - ) - . "$tmpfile" - rm "$tmpfile" -} - -function read_config_file { - local return_value=0 - - # Clear variables and arrays - for var in ${update_conf_variables}; do - unset $var - done - - # Source in the configuration file - safe_source "${upd_mod_conf}" ${update_conf_variables} - - # Set module naming/location arrays - local index array_size=0 s - for s in ${#REMOVE_MODULE_NAME[@]} \ - ${#REMOVE_MODULE_LOCATION[@]}; do - ((s > array_size)) && array_size=$s - done - for ((index=0; index < array_size; index++)); do - # Set values - remove_module_name[$index]=${REMOVE_MODULE_NAME[$index]} - remove_module_location[$index]=${REMOVE_MODULE_LOCATION[$index]} - - # FAIL if no remove_module_name - if [[ ! ${remove_module_name[$index]} ]]; then - echo "$(basename ${upd_mod_conf}): Error! No 'REMOVE_MODULE_NAME' directive specified for record #$index." - return_value=1 - fi - if [[ ! ${REMOVE_MODULE_LOCATION[$index]} ]]; then - echo "$(basename ${upd_mod_conf}): Error! No 'REMOVE_MODULE_LOCATION' directive specified for record #$index." - return_value=1 - fi - done - - # Fail if absolutely no REMOVE_MODULE_NAME - if ((${#remove_module_name[@]} == 0)); then - echo "upd_mod_conf: Error! No 'REMOVE_MODULE_NAME' directive specified." - return_value=1 - fi - - # Fail if absolutely no REMOVE_MODULE_LOCATION - if ((${#remove_module_location[@]} == 0)); then - echo "upd_mod_conf: Error! No 'REMOVE_MODULE_LOCATION' directive specified." - return_value=1 - fi - - return $return_value -} - -function read_config_file_or_die { - read_config_file "$@" && return - - err_exit "Bad conf file (${1})." ${err_read_config} -} - -function remove_modules { - local kernel_tree="${install_tree}/${kernelver}" - local dkms_original="${dkms_base_dir}/original_module" - - [[ -e ${kernel_tree} ]] || err_exit "Kernel tree ${kernel_tree} doesn't exist." ${err_kernel_tree} - - for ((count=0; count < ${#remove_module_name[@]}; count++)); do - local kernel_mod=${kernel_tree}${remove_module_location[$count]}/${remove_module_name[$count]}${module_suffix} - local dkms_orig=${dkms_original}/${remove_module_name[$count]}${module_suffix} - - echo "" - echo "${remove_module_name[$count]}${module_suffix}:" - if [ -e ${dkms_orig} ]; then - echo " - An original module was already stored during a previous install" - else - if [ -f "${kernel_mod}" ]; then - echo " - Found ${kernel_mod}" - echo " - Storing in ${dkms_original}/" - echo " - Archiving for uninstallation purposes" - mkdir -p "${dkms_original}/" - mv -f "${kernel_mod}" "${dkms_orig}" - modules_removed="true" - fi - fi - done - - echo "" -} - -function restore_modules { - local kernel_tree="${install_tree}/${kernelver}" - local dkms_original="${dkms_base_dir}/original_module" - local moved="" - - [[ -e ${kernel_tree} ]] || err_exit "Kernel tree ${kernel_tree} doesn't exist." ${err_kernel_tree} - - for ((count=0; count < ${#remove_module_name[@]}; count++)); do - local kernel_mod=${kernel_tree}${remove_module_location[$count]}/${remove_module_name[$count]}${module_suffix} - local dkms_orig=${dkms_original}/${remove_module_name[$count]}${module_suffix} - - echo "" - echo "${remove_module_name[$count]}${module_suffix}:" - if [ -e ${dkms_orig} ]; then - local kernel_mod_dir=$(dirname ${kernel_mod}) - echo " - Archived original module found in the DKMS tree" - echo " - Moving it to: ${kernel_mod_dir}/" - mkdir -p "${kernel_mod_dir}/" - mv -f "${dkms_orig}" "${kernel_mod_dir}/" 2> /dev/null - moved="true" - else - echo " - No original module was found for this module on this kernel." - echo " - Use the dkms install command to reinstall any previous module version." - fi - done - - if [ ${moved} ]; then - [[ $(find ${dkms_original}/* -maxdepth 0 -type f 2>/dev/null) ]] || rm -rf "${dkms_original}" - fi - - echo "" -} - -# main - -if [ $# -lt 4 ] ; then - usage -fi - -arg_check_help "${1}" - -dkms_base_dir="${1}" -shift - -arg_check_help "${1}" - -kernelver="${1}" -shift - -arg_check_help "${1}" - -arch="${1}" -shift - -arg_check_help "${1}" - -action="${1}" -shift - -arg_check_help "${1}" - -# First check, if the DKMS base directory, does already exist -if [ ! -d ${dkms_base_dir} ] ; then - err_exit "DKMS base directory ${dkms_base_dir} doesn't exist!" ${err_dir_not_found} -fi - -script_dir=$(dirname ${BASH_SOURCE[0]}) -upd_mod_conf=${script_dir}/${upd_mod_conf_name} - -# Check for the configuration file -if [ -f ${upd_mod_conf} ] ; then - echo "Using configuration file ${upd_mod_conf}" - - read_config_file_or_die ${upd_mod_conf} - - case "${action}" in - install) remove_modules - if [ ${modules_removed} ]; then - echo "!!!! NOTE NOTE NOTE !!!!" - echo " There is NO uninstall hook in DKMS available." - echo " This script has saved some modules to" - echo " ${dkms_base_dir}/original_module" - echo " Prior to uninstalling this DKMS module execute" - echo " $0 ${dkms_base_dir} ${kernelver} ${arch} uninstall" - echo "" - fi - ;; - uninstall) restore_modules ;; - *) err_exit "Invalid action '${action}' given!" ${err_action} - esac - - - exit_print "Done!" ${err_ok} -else - exit_print "Nothing to do!" ${err_ok} -fi - diff -Nru media-build-dkms-0004~trusty/media-build-0004/INSTALL media-build-dkms-0005~trusty/media-build-0004/INSTALL --- media-build-dkms-0004~trusty/media-build-0004/INSTALL 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/INSTALL 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -Mauro Carvalho Chehab 2006 Apr 26 - -V4L/DVB building procedures are based at the use of Makefile rules. -Those rules are close to the ones at Linux Kernel, to allow an easier -usage. - -======================================================================= -Quick building procedure is: - make all -====================================================================== - -For those who may want more than just build all stuff there are some -other interesting parameters to make: - -====================== -Normal building rules: -all - build all modules - -clean - Cleans compiled files from the tree, - but keeping the latest - used configuration and kernel version - -distclean - Cleans compiled files from the tree, - latest used configuration and kernel - version. - -default - Continues building the latest module selection - This is the behavior when just typed: - make - -install - Installs all modules at kernel's default dir - for V4L/DVB. Requires root access. - -rminstall - cleans previous installations of V4L/DVB modules - -sound-install - installs the sound modules related to V4L/DVB - tree. - -====================== -Firmware rules: - -firmware - Create the firmware files that are enclosed at the - tree. - Notice: Only a very few firmwares are currently here - -firmware_install- Install firmware files under /lib/firmware - -======================= -Module selection rules: -(Those may require write access to kernel tree) - -allmodconfig - Called by make all. Selects all modules that are known - to compile against the kernel version used. - -stagingconfig - Select all modules, plus all staging modules. The - staging drivers are there because they may have - bad userspace API's, serious bugs and/or not fill - into Kernel required level of quality. So, be - careful with those drivers. - -xconfig - Generate a xconfig menu. Requires full - kernel source, since it depends on kernel's - qconf stript; - -gconfig - Generate a qt menu. Requires full - kernel source, since it depends on kernel's - gconf stript; - -config - Generate a text-mode menu. Requires full - kernel source, since it depends on kernel's - conf stript; - -menuconfig - Generate a ncurses menu. Requires full - kernel source, since it depends on kernel's - mconf and lxconfig stripts; - -release - Allows changing kernel version. - Typical usage is: - make release VER=2.6.12-18mdk - (to force compiling to 2.6.12-18mdk) - (This will work only if - /lib/modules/2.6.12-18mdk/build/ - points to that kernel version) - Or - make release DIR=~/linux-git - (to force using kernel at a specific dir) - To use current kernel version instead: - make release - -====================== -Module handling rules: -(require root access) - -insmod - inserts all modules from V4L/DVB tree - -rmmod - removes all modules from V4L/DVB tree - -reload - removes then reinserts all modules - -=================== -Tree merging rules: - -ivtv - enable merged ivtv build, using the latest ivtv sources - from ivtvdriver.org (requires subversion) - -cx88-ivtv - enable cx88-blackbird ivtv API emulation - -ivtv-update - update ivtv sources from ivtvdriver.org - -========================================== -Patch preparation and tree handling rules: -(used by developers) - -kernel-links - Generate links to V4L/DVB at kernel tree. - Requires write access to kernel tree. - -cardlist - Updates Documentation/video4linux/CARDLIST.* - -update - updates the tree from master repository - -commit - commits the change, asking for a commit msg - -push - sends outgoing stuff to master repository - -checkemacs - checks codingstyle and reports to emacs - using "make checkemacs" at emacs compile menu, - will report the lines with errors inside emacs. - -checkpatch - checks codingstyle and reports using the same - format as c. This way, c error parsers will - handle it. - -checkterse - checks codingstyle and reports using terse - syntax, used on several compilaton tools. - -mismatch - checks for linker section mismatch. In other words, - check if some driver has functions not properly - declared with __init/__exit, and similar tags. - It will also be more pedantic by dealing with - compilation warnings as if they are errors. Binary files /tmp/tmpQUUe8H/OlPPLNDqLn/media-build-dkms-0004~trusty/media-build-0004/linux/linux-media.tar.bz2 and /tmp/tmpQUUe8H/ovgS0vH0L9/media-build-dkms-0005~trusty/media-build-0004/linux/linux-media.tar.bz2 differ diff -Nru media-build-dkms-0004~trusty/media-build-0004/linux/Makefile media-build-dkms-0005~trusty/media-build-0004/linux/Makefile --- media-build-dkms-0004~trusty/media-build-0004/linux/Makefile 2017-09-03 17:58:07.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/linux/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ -# -# Files that need to be bundled with the building system -# - --include ../v4l/.version - -MAINDIRS += drivers firmware include sound - -# Drivers source code -TARDIR += drivers/media/ -TARDIR += drivers/staging/media/ -TARDIR += drivers/misc/altera-stapl/ -TARFILES += sound/pci/bt87x.c - -# Includes - -# Pure kernel API -TARDIR += include/media/ -TARDIR += include/dt-bindings/media/ -TARDIR += include/linux/platform_data/media/ -TARFILES += include/linux/mmc/sdio_ids.h -TARFILES += include/sound/aci.h -TARFILES += include/uapi/linux/usb/video.h -TARFILES += include/linux/via-core.h -TARFILES += include/linux/ti_wilink_st.h -TARFILES += include/linux/dma-buf.h -TARFILES += include/linux/dma-fence.h -TARFILES += include/linux/of_graph.h -TARFILES += include/linux/kconfig.h -TARFILES += include/linux/hdmi.h -TARFILES += include/linux/compiler-gcc.h -TARFILES += include/linux/dma/xilinx_dma.h -TARFILES += include/trace/events/v4l2.h -TARFILES += include/trace/events/vb2.h -TARFILES += include/linux/pci_ids.h - -TARFILES += include/misc/altera.h - -# Userspace API -TARDIR += include/uapi/linux/dvb/ -TARFILES += include/uapi/linux/ddbridge-ioctl.h -TARFILES += include/uapi/linux/lirc.h -TARFILES += include/uapi/linux/videodev2.h -TARFILES += include/uapi/linux/meye.h -TARFILES += include/uapi/linux/ivtv.h -TARFILES += include/uapi/linux/ivtvfb.h -TARFILES += include/uapi/linux/max2175.h -TARFILES += include/uapi/linux/media.h -TARFILES += include/uapi/linux/media-bus-format.h -TARFILES += include/uapi/linux/v4l2-dv-timings.h -TARFILES += include/uapi/linux/v4l2-controls.h -TARFILES += include/uapi/linux/uvcvideo.h -TARFILES += include/uapi/linux/xilinx-v4l2-controls.h -TARFILES += include/uapi/linux/smiapp.h -TARFILES += include/uapi/linux/v4l2-subdev.h -TARFILES += include/uapi/linux/v4l2-common.h -TARFILES += include/uapi/linux/v4l2-mediabus.h -TARFILES += include/uapi/linux/cec.h -TARFILES += include/uapi/linux/cec-funcs.h - -# Other random files -TARFILES += include/linux/fixp-arith.h - -# Firmware -TARFILES += firmware/av7110/bootcode.bin.ihex -TARFILES += firmware/av7110/Boot.S -TARFILES += firmware/cpia2/stv0672_vp4.bin.ihex -TARFILES += firmware/ihex2fw.c -TARFILES += firmware/vicam/firmware.H16 -TARFILES += firmware/ttusb-budget/dspbootcode.bin.ihex - -DATE := `git --git-dir $(DIR)/.git log -n1 '--pretty=format:%h %ai' |perl -ne 'print "$$2-$$1" if (m/([\da-f]+)\s+(\S+)/)'` -TODAY_TAR := linux-media-${DATE}.tar -TODAY_TAR_MD5 := ${TODAY_TAR}.bz2.md5 -LATEST_TAR := http://linuxtv.org/downloads/drivers/linux-media-LATEST.tar.bz2 -LATEST_TAR_MD5 := http://linuxtv.org/downloads/drivers/linux-media-LATEST.tar.bz2.md5 - -default: - make -C .. - -help: - @echo "Use: make tar DIR=" - @echo " untar|clean|distclean" - -todaytar: - @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi - -rm -f $(PWD)/$(TODAY_TAR).bz2 - tar cf $(PWD)/$(TODAY_TAR) -C $(DIR) $(TARFILES) - git --git-dir $(DIR)/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\1\1,g' >git_log - perl -e 'while (<>) { $$a=$$1 if (m/^\s*VERSION\s*=\s*(\d+)/); $$b=$$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); $$c=$$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); } printf "#define V4L2_VERSION %d\n", ((($$a) << 16) + (($$b) << 8) + ($$c))' $(DIR)/Makefile > kernel_version.h - tar rvf $(PWD)/$(TODAY_TAR) git_log kernel_version.h - - for i in $(TARDIR); do \ - if [ "`echo $$i|grep Documentation`" = "" ]; then \ - dir="`(cd $(DIR); find $$i -type f -name '*.[ch]')`"; \ - dir="$$dir `(cd $(DIR); find $$i -type f -name Makefile)`"; \ - dir="$$dir `(cd $(DIR); find $$i -type f -name Kconfig)`"; \ - tar rvf $(PWD)/$(TODAY_TAR) -C $(DIR) $$dir; \ - else \ - tar rvf $(PWD)/$(TODAY_TAR) -C $(DIR) $$i; \ - fi; done; bzip2 $(PWD)/$(TODAY_TAR) - md5sum $(PWD)/$(TODAY_TAR).bz2 > $(PWD)/$(TODAY_TAR_MD5) - -tar: - @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi - -rm -f $(PWD)/linux-media.tar.bz2 - tar cf $(PWD)/linux-media.tar -C $(DIR) $(TARFILES) - git --git-dir $(DIR)/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\1\1,g' >git_log - perl -e 'while (<>) { $$a=$$1 if (m/^\s*VERSION\s*=\s*(\d+)/); $$b=$$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); $$c=$$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); } printf "#define V4L2_VERSION %d\n", ((($$a) << 16) + (($$b) << 8) + ($$c))' $(DIR)/Makefile > kernel_version.h - tar rvf $(PWD)/linux-media.tar git_log kernel_version.h - for i in $(TARDIR); do \ - if [ "`echo $$i|grep Documentation`" = "" ]; then \ - dir="`(cd $(DIR); find $$i -type f -name '*.[ch]')`"; \ - dir="$$dir `(cd $(DIR); find $$i -type f -name Makefile)`"; \ - dir="$$dir `(cd $(DIR); find $$i -type f -name Kconfig)`"; \ - tar rvf $(PWD)/linux-media.tar -C $(DIR) $$dir; \ - else \ - tar rvf $(PWD)/linux-media.tar -C $(DIR) $$i; \ - fi; done; bzip2 $(PWD)/linux-media.tar - -untar: linux-media.tar.bz2 - tar xfj linux-media.tar.bz2 - -rm -f .patches_applied .linked_dir .git_log.md5 - -clean: - -rm -rf $(MAINDIRS) .patches_applied .linked_dir .git_log.md5 git_log kernel_version.h - -dir: clean - @lsdiff --version >/dev/null # Make 'make dir' fail if lsdiff is not installed - @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi - @if [ ! -f "$(DIR)/include/uapi/linux/videodev2.h" ]; then echo "$(DIR) does not contain kernel sources"; exit -1; fi - @echo "Searching in $(DIR)/Makefile for kernel version." - ./use_dir.pl $(DIR) - -distclean: clean - -rm -f linux-media.tar.bz2 linux-media.tar.bz2.md5 - -apply_patches apply-patches: - @if [ -e .linked_dir ]; then ./use_dir.pl --recheck --silent; fi - @if [ "$(VER)" != "" ]; then \ - dir=$(VER); \ - elif [ "$(KERNELRELEASE)" != "" ]; then \ - dir=$(KERNELRELEASE); \ - fi; \ - PATCHES="`./patches_for_kernel.pl $$dir`"; \ - if [ "$$PATCHES" = "" ]; then echo "Version $$dir not supported"; exit -1; fi; \ - if [ -e .patches_applied ]; then \ - if [ "`cat .patches_applied|grep ^#`" = "#$$dir" ]; then \ - echo "Patches for $$dir already applied."; exit; \ - else \ - $(MAKE) unapply_patches; \ - fi; \ - fi; \ - echo "Applying patches for kernel $$dir"; \ - touch .patches_applied; \ - rm -f mm/frame_vector.c; \ - for i in $$PATCHES; do \ - echo patch -s -f -N -p1 -i ../backports/$$i; \ - patch -s -f -N -p1 -i ../backports/$$i --dry-run || exit 1; \ - patch -s -f -N -p1 -i ../backports/$$i; \ - mv .patches_applied .patches_applied.old; \ - echo $$i > .patches_applied; \ - cat .patches_applied.old >> .patches_applied; \ - done; \ - mv .patches_applied .patches_applied.old; \ - echo "#$$dir" > .patches_applied; \ - cat .patches_applied.old >> .patches_applied; \ - rm -f .patches_applied.old; \ - ./version_patch.pl; \ - if [ -e .linked_dir ]; then ./use_dir.pl --get_patched; fi - -unapply_patches unapply-patches: - @if [ -e .patches_applied ]; then \ - echo "Unapplying patches"; \ - for i in `cat .patches_applied|grep -v '^#'`; do \ - echo patch -s -f -R -p1 -i ../backports/$$i; \ - patch -s -f -R -p1 -i ../backports/$$i || break; \ - done; \ - rm -f mm/frame_vector.c; \ - rm -f .patches_applied; fi - -download: - wget $(LATEST_TAR_MD5) -O linux-media.tar.bz2.md5.tmp - - @if [ "`cat linux-media.tar.bz2.md5.tmp`" != "`cat linux-media.tar.bz2.md5`" ]; then \ - wget $(LATEST_TAR) -O linux-media.tar.bz2; \ - mv linux-media.tar.bz2.md5.tmp linux-media.tar.bz2.md5; \ - fi diff -Nru media-build-dkms-0004~trusty/media-build-0004/linux/patches_for_kernel.pl media-build-dkms-0005~trusty/media-build-0004/linux/patches_for_kernel.pl --- media-build-dkms-0004~trusty/media-build-0004/linux/patches_for_kernel.pl 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/linux/patches_for_kernel.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -#!/usr/bin/perl - -# This script allows checking what patches are needed for a given -# kernel version. -# Use it as ./patches_for_kernel.pl -# The backport files are specified at: ../backports/backports.txt - -use strict; - -my $version = shift or die "Need a version to apply patches"; - -my $file = "../backports/backports.txt"; -open IN, $file or die "can't find $file\n"; - -sub kernel_version($) { - my ($version, $patchlevel, $sublevel) = $_[0] =~ m/^(\d+)\.(\d+)\.?(\d*)/; - - # fix kernel version for distros that 'translated' 3.0 to 2.6.40 - if ($version == 2 && $patchlevel == 6 && $sublevel >= 40) { - $version = 3; - $patchlevel = $sublevel - 40; - $sublevel = 0; - } - $sublevel = 0 if ($sublevel == ""); - return ($version * 65536 + $patchlevel * 256 + $sublevel); -} - -my $kernel = kernel_version($version); - -die "Invalid kernel version" if (!$kernel); - -my $cur; -my @patches; -my $ln; -while () { - $ln++; - s/\#.*//; - next if (m/^\n*$/); - if (m/\[(.*)\]/) { - $cur = kernel_version($1); - next; - } - if (m/add\s+(.*)/) { - next if ($cur < $kernel); - push @patches, $1; - next; - } - if (m/delete\s+(.*)/) { - next if ($cur < $kernel); - for (my $i = 0; $i < @patches; $i++) { - delete $patches[$i] if ($patches[$i] eq $1); - } - next; - } - die "Can't process line $ln\n"; -} -close IN; -die ("Unsupported Kernel version $version") if ($cur > $kernel); - -foreach my $patch (@patches) { - printf "%s ", $patch; -} -print "\n"; diff -Nru media-build-dkms-0004~trusty/media-build-0004/linux/use_dir.pl media-build-dkms-0005~trusty/media-build-0004/linux/use_dir.pl --- media-build-dkms-0004~trusty/media-build-0004/linux/use_dir.pl 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/linux/use_dir.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,343 +0,0 @@ -#!/usr/bin/perl -use strict; -use File::Find; -use File::Path; -use File::Copy; -use Fcntl ':mode'; -use Getopt::Long; -use Digest::SHA; - -my $silent = 0; -my $debug = 0; -my $recheck = 0; -my $get_patched = 0; -GetOptions( "--debug" => \$debug, - "--silent" => \$silent, - "--recheck" => \$recheck, - "--get_patched" => \$get_patched, - ); - -my $dir = shift; - -my $ctlfile = ".linked_dir"; -my $patchfile = ".patches_applied"; - -my $sync_patched = 0; -my %dirs; -my %files; -my $patches_applied; - -######################################### -# Control info stored at the control file -my $path; -my %fhash; -my %fhash_patched; -######################################### - -sub read_ctlfile() -{ - my $line; - - open IN, $ctlfile or return; - while () { - next if (m/^\s*\#/); - next if (m/^\n$/); - if (m/^path:\s*([^\s]+)/) { - $path = $1; - } elsif (m/^hash\:\s*([^\s]+)\s*=\s*([^\s]+)/) { - $fhash{$1} = $2; - } elsif (m/^hash_patched\:\s*([^\s]+)\s*=\s*([^\s]+)/) { - $fhash_patched{$1} = $2; - } else { - printf("Parse error on this line of $ctlfile:\n\t$_"); - die; - } - } - close IN; -} - -sub write_ctlfile() -{ - open OUT, ">$ctlfile" or print "Error: Can't write to $ctlfile\n"; - print OUT "path: $path\n"; - foreach my $file (keys %fhash) { - printf OUT "hash: %s=%s\n", $file, $fhash{$file}; - } - foreach my $file (keys %fhash_patched) { - printf OUT "hash_patched: %s=%s\n", $file, $fhash_patched{$file}; - } - close OUT; -} - -sub add_dirs($) -{ - my $data = shift; - my @dirs = split(' ', $data); - - foreach my $val (@dirs) { - $dirs{$val} = 1; - } -} - -sub add_files($) -{ - my $data = shift; - my @dirs = split(' ', $data); - - foreach my $val (@dirs) { - $files{$val} = 1; - } -} - -sub get_file_dir_names() -{ - open IN, "Makefile" or die "Couldn't open Makefile"; - while () { - if (m/^\s*TARDIR\s*[\+\:]*=\s*([A-Za-z_].*)/) { - add_dirs($1); - } elsif (m/^\s*TARFILES\s*[\+\:]*=\s*([A-Za-z_].*)/) { - add_files($1); - } - } - close IN; -} - - -sub hash_calc($) -{ - my $file = shift; - - my $ctx = Digest::SHA->new; - - my $rc = open INHASH, $file; - if (!$rc) { - print "Couldn't open file $file\n" if ($debug); - return 0; - } - $ctx->addfile(*INHASH); - my $digest = $ctx->hexdigest; - close INHASH; - - return $digest; -} - -sub sync_files($) -{ - my $file = shift; - my $path = $file; - my $check_hash; - my $need_sync; - my $filehash; - my $cpfilehash; - my $patched_file; - - $path =~ s,/[^/]+$,,; - - $filehash = hash_calc("$dir/$file"); - $need_sync = 1 if ($filehash ne $fhash{$file}); - - if (!$need_sync && $recheck) { - $cpfilehash = hash_calc("$file"); - if ($patches_applied && exists($fhash_patched{$file})) { - $patched_file = 1; - $need_sync = 1 if ($cpfilehash ne $fhash_patched{$file}); - } else { - $need_sync = 1 if ($cpfilehash ne $fhash{$file}); - } - } - - if ($need_sync) { - printf "Sync'ing file $file (orig = %s, copy = %s, patched = %s)\n", - $filehash, $cpfilehash, $fhash_patched{$file} if ($debug || $recheck); - - if (exists($fhash_patched{$file})) { - $sync_patched = 1; - } else { - $fhash{$file} = $filehash; - mkpath($path); - copy("$dir/$file", $file); - } - } else { - print "Skipping file $file, as is already synchronized\n" if ($debug); - } -} - -sub get_patched_files() -{ - my %files; - - open IN, $patchfile or return %files; - - # Those files are always patched to add warnings about the usage of experimental version - $files{"drivers/media/dvb-core/dvbdev.c"} = 1; - $files{"drivers/media/v4l2-core/v4l2-dev.c"} = 1; - $files{"drivers/media/rc/rc-main.c"} = 1; - - while () { - next if (/^\s*#/); - - if (m/(.*)\n/) { - print ("Backport ../backports/$1 touch(es) file(s):\n") if ($debug); - open IN2, "lsdiff -h --strip 1 ../backports/$1 |"; - while () { - my $f = $_; - $f =~ s/\n//; - $files{$f} = 1; - print ("\t$f\n") if ($debug); - } - close IN2; - } - } - close IN; - - return %files; -} - -sub sync_patched_files() -{ - my %patches = get_patched_files(); - return if (!%patches); - - foreach my $file (keys %patches) { -printf "sync patched file $file\n"; - $fhash{$file} = hash_calc("$dir/$file"); - mkpath($path); - copy("$dir/$file", $file); - } - close IN; -} - -sub get_patched_hashes() -{ - my %patches = get_patched_files(); - return if (!%patches); - - foreach my $file (keys %patches) { - $fhash_patched{$file} = hash_calc("$file"); - printf "Hash for patched file $file = %s\n", $fhash_patched{$file} if ($debug); - } - close IN; -} - -sub remove_deleted() -{ - my $file = $File::Find::name; - my $mode = (stat($file))[2]; - - return if ($mode & S_IFDIR); - - return if ($file =~ /^\./); - return if ($file =~ /\.mod\.c/); - - if ($file =~ /Makefile$/ || $file =~ /Kconfig$/ || $file =~ /\.[ch]$/ ) { - if (! -e "$dir/$file") { - printf "Removing file $file\n" if (!$silent); - delete $fhash{$file} if exists($fhash{$file}); - delete $fhash_patched{$file} if exists($fhash_patched{$file}); - unlink $file; - return; - } - } -} - -sub parse_dir() -{ - my $file = $File::Find::name; - my $mode = (stat($file))[2]; - - return if ($mode & S_IFDIR); - - $file =~ s,^($dir/),,; - - return if ($file =~ /^\./); - return if ($file =~ /\.mod\.c/); - - if ($file =~ /Makefile$/ || $file =~ /Kconfig$/ || $file =~ /\.[ch]$/ ) { - sync_files $file; - return; - } - - printf "Skipping bogus file $file\n" if ($debug); -} - -sub sync_dirs($) -{ - my $subdir = shift; - - print "sync dir: $subdir\n" if (!$silent); - find({wanted => \&parse_dir, no_chdir => 1}, "$dir/$subdir"); - find({wanted => \&remove_deleted, no_chdir => 1}, "$subdir"); -} - -sub sync_all() -{ - foreach my $val (keys %files) { - print "sync file: $val\n" if (!$silent); - sync_files($val); - } - foreach my $val (keys %dirs) { - sync_dirs($val); - } -} - -sub sync_kernel_version() -{ - my ($source_v4l_version, $a, $b, $c, $ver); - - open IN, "$dir/Makefile" or die "Can't find $dir/Makefile"; - while () { - $a=$1 if (m/^\s*VERSION\s*=\s*(\d+)/); - $b=$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); - $c=$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); - } - close IN; - $source_v4l_version = ((($a) << 16) + (($b) << 8) + ($c)); - - if (open IN, "kernel_version.h") { - while () { - $ver=$1 if (m/^#define\s*V4L2_VERSION* \s*(\d+)/); - } - close IN; - } - - if ($ver ne $source_v4l_version) { - open OUT,">kernel_version.h"; - printf OUT "#define V4L2_VERSION %d\n", $source_v4l_version; - close OUT; - } -} - -# Main - -if (!$dir) { - read_ctlfile(); - die "Please provide a directory to use" if !($path); - $dir = $path; - - printf "Syncing with dir $dir\n"; -} else { - read_ctlfile(); -} -sync_kernel_version(); - -if ($path ne $dir) { - $path = $dir; - %fhash = (); -} - -$patches_applied = 1 if (-e $patchfile); - -if ($get_patched && $patches_applied) { - get_patched_hashes(); -} else { - get_file_dir_names(); - sync_all(); - - if ($sync_patched) { - sync_patched_files(); - unlink $patchfile; - } -} - -write_ctlfile(); -system "git --git-dir $dir/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\\1\\1,g' >git_log" diff -Nru media-build-dkms-0004~trusty/media-build-0004/linux/version_patch.pl media-build-dkms-0005~trusty/media-build-0004/linux/version_patch.pl --- media-build-dkms-0004~trusty/media-build-0004/linux/version_patch.pl 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/linux/version_patch.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -#!/usr/bin/perl -use strict; - - -sub patch_file($$$$) -{ - my $filename = shift; - my $function = shift; - my $after_line = shift; - my $media_build_version = shift; - my $patched; - my $warning = "WARNING: You are using an experimental version of the media stack."; - - open IN, "$filename" or die "can't open $filename"; - my $is_function; - my $file; - my $org_file; - while () { - $org_file .= $_; - next if (m/($warning)/); - $file .= $_; - if (m/($function)/) { - $is_function = 1; - next; - }; - next if (!$is_function); - if (/\}/) { - $is_function--; - next; - }; - if (m/\{/) { - $is_function++; - next; - }; - if ($is_function && m/($after_line)/) { - $file .= "\tprintk(KERN_ERR \"$warning\\n" . - "\\tAs the driver is backported to an older kernel, it doesn't offer\\n" . - "\\tenough quality for its usage in production.\\n" . - "\\tUse it with care.\\n$media_build_version\\n\");\n"; - $is_function = 0; - $patched++; - next; - }; - } - close IN; - if ($org_file ne $file) { - open OUT, ">$filename.new" or die "Can't open $filename.new"; - print OUT $file; - close OUT; - - rename "$filename", "$filename~" or die "Can't rename $filename to $filename~"; - rename "$filename.new", "$filename" or die "Can't rename $filename.new to $filename"; - if ($patched) { - print "Patched $filename\n"; - } else { - die "$filename was not patched.\n"; - } - } else { - print "$filename was already patched\n"; - } -} - -# -# Main -# -open IN, "git_log" or die "can't open git_log"; -my $logs; -$logs.=$_ while (); -close IN; - -if (open IN,".linked_dir") { - while () { - if (m/^path:\s*(.*)/) { - my $dir=$1; - my $new_log = qx(git --git-dir $dir/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\\1\\1,g'); - if ($new_log ne $logs) { - printf("Git version changed.\n"); - open OUT, ">git_log"; - print OUT $new_log; - close OUT; - $logs = $new_log; - } - last; - } - } - close IN; -} - -# Prepare patches message -$logs =~ s/\s+$//; -$logs =~ s,\n,\\n\\t,g; -$logs =~ s,\",\\\",g; -$logs = "Latest git patches (needed if you report a bug to linux-media\@vger.kernel.org):\\n\\t$logs"; - -# Patch dvbdev -patch_file "drivers/media/dvb-core/dvbdev.c", "__init init_dvbdev", "MKDEV", $logs; -# Patch v4l2-dev -patch_file "drivers/media/v4l2-core/v4l2-dev.c", "__init videodev_init", "printk", $logs; -# Patch rc core -patch_file "drivers/media/rc/rc-main.c", "__init rc_core_init", "rc_map_register", $logs; diff -Nru media-build-dkms-0004~trusty/media-build-0004/Makefile media-build-dkms-0005~trusty/media-build-0004/Makefile --- media-build-dkms-0004~trusty/media-build-0004/Makefile 2017-07-23 19:23:16.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -BUILD_DIR := $(shell pwd)/v4l -TMP ?= /tmp - -ifeq ($(EDITOR),) - ifeq ($(VISUAL),) - EDITOR := vi - else - EDITOR := $(VISUAL) -w - endif -endif - -all: - -install: - $(MAKE) -C $(BUILD_DIR) install - -# Hmm, .PHONY does not work with wildcard rules :-( -SPECS = media-specs - -.PHONY: $(SPECS) - -$(SPECS): - $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) - -%:: - $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) - -download untar:: - $(MAKE) -C linux/ $(MAKECMDGOALS) - -dir:: - $(MAKE) -C linux/ $(MAKECMDGOALS) DIR="../$(DIR)" - -cleanall: - $(MAKE) distclean - $(MAKE) -C linux distclean diff -Nru media-build-dkms-0004~trusty/media-build-0004/Makefile.dkms media-build-dkms-0005~trusty/media-build-0004/Makefile.dkms --- media-build-dkms-0004~trusty/media-build-0004/Makefile.dkms 2017-09-06 22:03:54.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/Makefile.dkms 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -# -# Will be executed by the DKMS system, with -# KERNELRELEASE and MEDIA_INST_DIR -# set. -# - -ifneq ($(MAKECMDGOALS),clean) - ifeq ($(KERNELRELEASE),) - $(error KERNELRELEASE not set) - endif -endif -ifeq ($(MEDIA_INST_DIR),) - $(error MEDIA_INST_DIR not set) -endif - -build: - VER=$(KERNELRELEASE) ./build_all.sh $(MEDIA_INST_DIR) -db - -clean: - VER=$(KERNELRELEASE) ./build_all.sh $(MEDIA_INST_DIR) -dc - -.PHONY: build clean diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/compat.h media-build-dkms-0005~trusty/media-build-0004/v4l/compat.h --- media-build-dkms-0004~trusty/media-build-0004/v4l/compat.h 2017-09-10 20:49:48.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/compat.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,2158 +0,0 @@ -/* - * $Id: compat.h,v 1.44 2006/01/15 09:35:16 mchehab Exp $ - */ - -#ifndef _COMPAT_H -#define _COMPAT_H - -#include -#include -#include -#include -#include -#include "config-compat.h" -#include "../linux/kernel_version.h" - -#undef __devinitconst -#define __devinitconst - -#ifndef uninitialized_var -#define uninitialized_var(x) x = x -#endif - -#define SIZE_MAX (~(size_t)0) - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) -#include -#endif - -/* In v2.6.19-rc6-118-g52bad64 struct work_struct was was changed to be only for - * non-delayed work and struct delayed_work was created for delayed work. This - * will rename the structures. Hopefully no one will decide to name something - * delayed_work in the same context as something named work_struct. */ -#ifdef NEED_DELAYED_WORK -#define delayed_work work_struct -#define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c) -#endif - -#define EXPERIMENTAL_TREE - -#ifdef NEED_I2C_SMBUS_WORD_SWAPPED -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) -static inline s32 -i2c_smbus_read_word_swapped(struct i2c_client *client, u8 command) -{ - s32 value = i2c_smbus_read_word_data(client, command); - - return (value < 0) ? value : swab16(value); -} - -static inline s32 -i2c_smbus_write_word_swapped(struct i2c_client *client, u8 command, u16 value) -{ - return i2c_smbus_write_word_data(client, command, swab16(value)); -} -#else -static inline s32 -i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command) -{ - s32 value = i2c_smbus_read_word_data(client, command); - - return (value < 0) ? value : swab16(value); -} - -static inline s32 -i2c_smbus_write_word_swapped(const struct i2c_client *client, - u8 command, u16 value) -{ - return i2c_smbus_write_word_data(client, command, swab16(value)); -} -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) -#include -static inline unsigned long find_next_zero_bit_le(const void *addr, - unsigned long size, unsigned long offset) -{ - return find_next_zero_bit(addr, size, offset); -} - -static inline unsigned long find_next_bit_le(const void *addr, - unsigned long size, unsigned long offset) -{ - return find_next_bit(addr, size, offset); -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) -#define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma) -#define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -#define KERN_CONT "" -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) -#define ir_register_class(a) input_register_device(a) -#define ir_unregister_class(a) input_unregister_device(a) -#endif - -/* To allow I2C compatibility code to work */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) -#include -#endif - -#ifdef NEED_HEX_TO_BIN -#include -static inline int hex_to_bin(char ch) -{ - if ((ch >= '0') && (ch <= '9')) - return ch - '0'; - ch = tolower(ch); - if ((ch >= 'a') && (ch <= 'f')) - return ch - 'a' + 10; - return -1; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) -#define usb_enable_autosuspend(udev) udev->autosuspend_disabled = 0; -#endif - -#ifndef FBIO_WAITFORVSYNC -#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) -#include -#include -#include -static inline void *memdup_user(const void __user *src, size_t len) -{ - void *p; - - /* - * Always use GFP_KERNEL, since copy_from_user() can sleep and - * cause pagefault, which makes it pointless to use GFP_NOFS - * or GFP_ATOMIC. - */ - p = kmalloc_track_caller(len, GFP_KERNEL); - if (!p) - return ERR_PTR(-ENOMEM); - - if (copy_from_user(p, src, len)) { - kfree(p); - return ERR_PTR(-EFAULT); - } - - return p; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) -static inline int pci_msi_enabled(void) -{ -#ifndef CONFIG_PCI_MSI - return 0; -#else - return 1; -#endif -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#ifdef CONFIG_PROC_FS -#include -#include -#include -#endif -#endif - -#ifndef KEY_NUMERIC_0 -#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ -#define KEY_NUMERIC_1 0x201 /* and other keypads */ -#define KEY_NUMERIC_2 0x202 -#define KEY_NUMERIC_3 0x203 -#define KEY_NUMERIC_4 0x204 -#define KEY_NUMERIC_5 0x205 -#define KEY_NUMERIC_6 0x206 -#define KEY_NUMERIC_7 0x207 -#define KEY_NUMERIC_8 0x208 -#define KEY_NUMERIC_9 0x209 -#define KEY_NUMERIC_STAR 0x20a -#define KEY_NUMERIC_POUND 0x20b -#endif - -#ifndef KEY_IMAGES -#define KEY_IMAGES 0x1ba /* AL Image Browser */ -#endif - -#ifdef NEED_DEFINE_PCI_DEVICE_TABLE -#define DEFINE_PCI_DEVICE_TABLE(_table) \ - const struct pci_device_id _table[] -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) -#define netdev_mc_count(dev) ((dev)->mc_count) -#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) -#define netdev_for_each_mc_addr(mclist, dev) \ - for (mclist = dev->mc_list; mclist; mclist = mclist->next) -#endif - -#ifndef KEY_CONTEXT_MENU -#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ -#endif - -#ifndef BIT_MASK -#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) -#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#endif - -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32) && 0 -#include -#undef _P -static inline char *skip_spaces(const char *str) -{ - while (isspace(*str)) - ++str; - return (char *)str; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) -#define valtype unsigned long -static inline int strict_strtoul(const char *cp, unsigned int base, valtype *res) -{ - char *tail; - valtype val; - size_t len; - - *res = 0; - len = strlen(cp); - if (len == 0) - return -EINVAL; - - val = simple_strtoul(cp, &tail, base); - if ((*tail == '\0') || - ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) { - *res = val; - return 0; - } - - return -EINVAL; -} -#endif - -#ifndef KEY_DASHBOARD -#define KEY_DASHBOARD 204 /* AL Dashboard */ -#endif -/* To allow alsa code to work */ -#ifdef NEED_SOUND_DRIVER_H -#include -#endif - -#ifdef NEED_SND_CARD_CREATE -#include -#endif - -#ifdef NEED_ALGO_CONTROL -#include -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) -#define time_is_after_eq_jiffies(a) (time_before_eq(jiffies, a)) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) -#define set_freezable() -#define cancel_delayed_work_sync cancel_rearming_delayed_work -#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) -#endif - -#ifndef __pure -# define __pure __attribute__((pure)) -#endif - -/* device_create/destroy added in 2.6.18 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) -/* on older kernels, class_device_create will in turn be a compat macro */ -# define device_create(a, b, c, d, e, f, g) class_device_create(a, NULL, c, b, d, e, f, g) -# define device_destroy(a, b) class_device_destroy(a, b) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) -#define IRQF_SHARED SA_SHIRQ -#define IRQF_DISABLED SA_INTERRUPT -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -#define PCIAGP_FAIL 0 -#define vmalloc_32_user(a) vmalloc_32(a) -#endif - -#ifndef DIV_ROUND_CLOSEST -#define DIV_ROUND_CLOSEST(x, divisor)( \ -{ \ - typeof(divisor) __divisor = divisor; \ - (((x) + ((__divisor) / 2)) / (__divisor)); \ -} \ -) -#endif - -#ifdef NEED_BOOL_TYPE -/* bool type and enum-based definition of true and false was added in 2.6.19 */ -typedef int bool; -enum { - false = 0, - true = 1 -}; -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) -#define sony_pic_camera_command(a,b) sonypi_camera_command(a,b) - -#define SONY_PIC_COMMAND_SETCAMERAAGC SONYPI_COMMAND_SETCAMERAAGC -#define SONY_PIC_COMMAND_SETCAMERABRIGHTNESS SONYPI_COMMAND_SETCAMERABRIGHTNESS -#define SONY_PIC_COMMAND_SETCAMERACOLOR SONYPI_COMMAND_SETCAMERACOLOR -#define SONY_PIC_COMMAND_SETCAMERACONTRAST SONYPI_COMMAND_SETCAMERACONTRAST -#define SONY_PIC_COMMAND_SETCAMERAHUE SONYPI_COMMAND_SETCAMERAHUE -#define SONY_PIC_COMMAND_SETCAMERAPICTURE SONYPI_COMMAND_SETCAMERAPICTURE -#define SONY_PIC_COMMAND_SETCAMERASHARPNESS SONYPI_COMMAND_SETCAMERASHARPNESS -#define SONY_PIC_COMMAND_SETCAMERA SONYPI_COMMAND_SETCAMERA -#endif - -/* pci_dev got a new revision field in 2.6.23-rc1 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) && defined(LINUX_PCI_H) -/* Just make it easier to subsitute pci_dev->revision with - * v4l_compat_pci_rev(pci_dev). It's too bad there isn't some kind of context - * sensitive macro in C that could do this for us. */ -static inline u8 v4l_compat_pci_rev(struct pci_dev *pci) -{ u8 rev; pci_read_config_byte(pci, PCI_REVISION_ID, &rev); return rev; } -#endif - -#if defined(COMPAT_PCM_TO_RATE_BIT) && defined(__SOUND_PCM_H) -/* New alsa core utility function */ -static inline unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) -{ - static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, - 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 }; - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(rates); i++) - if (rates[i] == rate) - return 1u << i; - return SNDRV_PCM_RATE_KNOT; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) -# define task_pid_nr(current) ((current)->pid) - -# define sg_init_table(a,b) -# define sg_page(p) (sg->page) -# define sg_set_page(sglist,pg,sz,off) \ -do { \ - struct scatterlist *p=sglist; \ - p->page = pg; \ - p->length = sz; \ - p->offset = off; \ -} while (0) -#endif - -#ifndef pr_err -#define pr_err(fmt, arg...) \ - printk(KERN_ERR fmt, ##arg) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) -#define noop_llseek NULL -#endif - -#ifndef pr_warn -#define pr_warn(fmt, arg...) \ - printk(KERN_WARNING fmt, ##arg) -#endif - -#ifndef BIT_MASK -# define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) -# define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) -#define i2c_verify_client(dev) \ - ((dev->bus == &i2c_bus_type) ? to_i2c_client(dev) : NULL) -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) -#define i2c_verify_client(dev) \ - ((dev->bus && 0 == strcmp(dev->bus->name, "i2c")) ? to_i2c_client(dev) : NULL) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) -/* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ -#define I2C_ADDRS(addr, addrs...) \ - ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) -#endif - -#ifndef USB_DEVICE_AND_INTERFACE_INFO -# define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ - .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ - | USB_DEVICE_ID_MATCH_DEVICE, \ - .idVendor = (vend), .idProduct = (prod), \ - .bInterfaceClass = (cl), \ - .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#define get_unaligned_be16(a) \ - be16_to_cpu(get_unaligned((unsigned short *)(a))) -#define put_unaligned_be16(r, a) \ - put_unaligned(cpu_to_be16(r), ((unsigned short *)(a))) -#define get_unaligned_le16(a) \ - le16_to_cpu(get_unaligned((unsigned short *)(a))) -#define put_unaligned_le16(r, a) \ - put_unaligned(cpu_to_le16(r), ((unsigned short *)(a))) -#define get_unaligned_be32(a) \ - be32_to_cpu(get_unaligned((u32 *)(a))) -#define put_unaligned_be32(r, a) \ - put_unaligned(cpu_to_be32(r), ((u32 *)(a))) -#define get_unaligned_le32(a) \ - le32_to_cpu(get_unaligned((u32 *)(a))) -#define put_unaligned_le32(r, a) \ - put_unaligned(cpu_to_le32(r), ((u32 *)(a))) -#define get_unaligned_le64(a) \ - le64_to_cpu(get_unaligned((u64 *)(a))) -#define put_unaligned_le64(r, a) \ - put_unaligned(cpu_to_le64(r), ((u64 *)(a))) -#endif - -#ifdef NEED_PROC_CREATE -#ifdef CONFIG_PROC_FS -static inline struct proc_dir_entry *proc_create(const char *a, - mode_t b, struct proc_dir_entry *c, const struct file_operations *d) -{ - struct proc_dir_entry *e; - - e = create_proc_entry(a, b, c); - if (e) { - e->owner = THIS_MODULE; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) - e->proc_fops = d; -#else - e->proc_fops = (struct file_operations *)d; -#endif - } - return e; -} -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#ifdef CONFIG_PROC_FS -static inline struct proc_dir_entry *proc_create_data(const char *a, - mode_t b, struct proc_dir_entry *c, const struct file_operations *d, - void *f) -{ - struct proc_dir_entry *e; - - e = create_proc_entry(a, b, c); - if (e) { - e->owner = THIS_MODULE; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) - e->proc_fops = d; -#else - e->proc_fops = (struct file_operations *)d; -#endif - e->data = f; - } - return e; -} -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) -#define hweight64(x) generic_hweight64(x) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -typedef unsigned long uintptr_t; -#endif - -#ifdef NEED_IS_SINGULAR -static inline int list_is_singular(const struct list_head *head) -{ - return !list_empty(head) && (head->next == head->prev); -} -#endif - -#ifdef NEED_CLAMP -#define clamp( x, l, h ) max_t( __typeof__( x ), \ - ( l ), \ - min_t( __typeof__( x ), \ - ( h ), \ - ( x ) ) ) -#define clamp_val(val, min, max) ({ \ - typeof(val) __val = (val); \ - typeof(val) __min = (min); \ - typeof(val) __max = (max); \ - __val = __val < __min ? __min : __val; \ - __val > __max ? __max : __val; }) -#endif - -#ifdef NEED_ALGO_CONTROL -static inline int dummy_algo_control(struct i2c_adapter *adapter, - unsigned int cmd, unsigned long arg) -{ - return 0; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#define div64_u64(a,b) div64_64(a,b) - -#define dev_name(dev) ((dev)->bus_id) - -#define dev_set_name(dev, fmt, arg...) ({ \ - snprintf((dev)->bus_id, sizeof((dev)->bus_id), fmt , ## arg); \ - 0; \ -}) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) -#define current_uid() (current->uid) -#endif - -#ifndef WARN -#define WARN(condition, format...) ({ \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printk(KERN_WARNING format); \ - unlikely(__ret_warn_on); \ -}) -#endif - -#ifdef NEED_SND_BUG_ON -#define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) -#endif - -#ifdef NEED_BITOPS -#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) -#endif - -#ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC -#define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 -#endif - -#ifdef __LINUX_USB_H -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) -/* - * usb_endpoint_* functions - * - * Included in Linux 2.6.19 - * Backported to 2.6.18 in Red Hat Enterprise Linux 5.2 - */ - -#ifdef RHEL_RELEASE_CODE -#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 2) -#define RHEL_HAS_USB_ENDPOINT -#endif -#endif - -#ifndef RHEL_HAS_USB_ENDPOINT -static inline int -usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN; -} - -static inline int -usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_INT; -} - -static inline int -usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_ISOC; -} - -static inline int -usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) -{ - return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK; -} - -static inline int -usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) -{ - return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); -} - -static inline int usb_endpoint_dir_out( - const struct usb_endpoint_descriptor *epd) -{ - return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); -} - -static inline int usb_endpoint_is_bulk_in( - const struct usb_endpoint_descriptor *epd) -{ - return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); -} - -static inline int usb_endpoint_is_bulk_out( - const struct usb_endpoint_descriptor *epd) -{ - return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); -} - -static inline int usb_endpoint_is_int_out( - const struct usb_endpoint_descriptor *epd) -{ - return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); -} - -static inline int usb_endpoint_is_isoc_in( - const struct usb_endpoint_descriptor *epd) -{ - return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); -} - -static inline int usb_endpoint_is_isoc_out( - const struct usb_endpoint_descriptor *epd) -{ - return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); -} -#endif /* RHEL_HAS_USB_ENDPOINT */ -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) -#ifndef RHEL_HAS_USB_ENDPOINT -static inline int usb_endpoint_xfer_control( - const struct usb_endpoint_descriptor *epd) -{ - return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_CONTROL); -} -#endif /* RHEL_HAS_USB_ENDPOINT */ -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) -{ - return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; -} -#endif - -#ifdef NEED_USB_ENDPOINT_TYPE -static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) -{ - return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; -} -#endif -#endif /* __LINUX_USB_H */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) -/* - * Linked list API - */ -#define list_first_entry(ptr, type, member) \ - list_entry((ptr)->next, type, member) - -/* - * uninitialized_var() macro - */ -#define uninitialized_var(x) x = x -#endif - -#ifdef NEED_NETDEV_PRIV -#define netdev_priv(dev) ((dev)->priv) -#endif - -#ifdef NEED_PCI_IOREMAP_BAR -#define pci_ioremap_bar(pdev, bar) \ - ioremap_nocache(pci_resource_start(pdev, bar), \ - pci_resource_len(pdev, bar)) -#endif - -#ifdef NEED_POLL_SCHEDULE -#define poll_schedule(pwq, task) \ - do { \ - set_current_state(task); \ - schedule(); \ - set_current_state(TASK_RUNNING); \ - } while (0) -#endif - -/* This macro was added in commit v2.6.23-5792-g34c6538 */ -#ifndef DMA_BIT_MASK -#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) -#endif - -/* __fls() was added for generic code in 2.6.29, existed for just 64-bit arches - * since 2.6.26 (v2.6.25-5228-g56a6b1e), and was x86-64 only before then. We - * only want this compat code when __fls doesn't exist, which 2.6.29 or later, - * non x86-64, and non 64-bit that's 2.6.26 or later. */ -#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) || \ - defined(__x86_64__) || \ - (BITS_PER_LONG == 64 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))) -/* This define will prevent breakage if __fls was already defined. */ -#undef __fls -#define __fls v4l_compat_fls -static inline unsigned long v4l_compat_fls(unsigned long x) -{ - return fls(x) - 1; -} -#endif - -/* - * Compatibility code for hrtimer API - * This will make hrtimer usable for kernels 2.6.22 and later. - * For earlier kernels, not all required functions are exported - * so there's nothing we can do. - */ - -#ifdef _LINUX_HRTIMER_H -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) && \ - LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) -/* Forward a hrtimer so it expires after the hrtimer's current now */ -static inline unsigned long hrtimer_forward_now(struct hrtimer *timer, - ktime_t interval) -{ - return hrtimer_forward(timer, timer->base->get_time(), interval); -} -#endif -#endif /* _LINUX_HRTIMER_H */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) -#define strncasecmp(a, b, c) strnicmp(a, b, c) -#define strcasecmp(a, b) strnicmp(a, b, sizeof(a)) -#endif - -#ifdef NEED_FW_CSR_STRING - -#include -#include - -static inline int fw_csr_string(u32 *directory, int search_key, char *buf, size_t size) -{ - struct fw_csr_iterator ci; - int last_key = 0, key, value; - const u32 *block = NULL; - unsigned int quadlets, i; - - fw_csr_iterator_init(&ci, directory); - while (fw_csr_iterator_next(&ci, &key, &value)) { - if (last_key == search_key && - key == (CSR_DESCRIPTOR | CSR_LEAF)) { - block = ci.p - 1 + value; - break; - } - - last_key = key; - } - - if (!block) - return -ENOENT; - - quadlets = min(block[0] >> 16, 256U); - if (quadlets < 2) - return -ENODATA; - - if (block[1] != 0 || block[2] != 0) - /* unknown language/character set */ - return -ENODATA; - - block += 3; - quadlets -= 2; - for (i = 0; i < quadlets * 4 && i < size - 1; i++) { - char c = block[i / 4] >> (24 - 8 * (i % 4)); - if (c == '\0') - break; - buf[i] = c; - } - buf[i] = '\0'; - - return i; -} -#endif - -#ifdef NEED_POLL_REQUESTED_EVENTS -#include - -static inline bool poll_does_not_wait(const poll_table *p) -{ - return p == NULL; -} - -/* Note: this function was introduced in kernel 3.4. That version relies - on changes in the core poll code in order to be able to get the right - value. For older kernels we use this compatibility function which will - not always get it right: if you pass multiple file descriptors to the - select() call, and if one of the earlier fds found an event, then for any - subsequent file descriptors the poll_table pointer is set to NULL and you - loose the key information. - - You can't make this fool-proof other than by going to kernel 3.4. - */ -static inline unsigned long poll_requested_events(const poll_table *p) -{ - return p ? p->key : ~0UL; -} -#endif - -#ifdef NEED_VZALLOC -#include - -static inline void *vzalloc(unsigned long size) -{ - void *p = vmalloc(size); - if (!p) - return NULL; - memset (p, '\0', size); - return p; -} - -#endif - -#ifdef NEED_KVZALLOC -#include - -static inline void *kvzalloc(size_t size, gfp_t flags) -{ - return vzalloc(size); -} - -static inline void *kvmalloc(size_t size, gfp_t flags) -{ - return vmalloc(size); -} - -static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags) -{ - if (size != 0 && n > SIZE_MAX / size) - return NULL; - - return kvmalloc(n * size, flags); -} -#endif - -#ifdef NEED_FLUSH_WORK_SYNC -#define flush_work_sync(dev) -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - -#ifdef NEED_AUTOSUSPEND_DELAY -#define pm_runtime_set_autosuspend_delay(dev, delay) { \ - struct usb_device *udev = to_usb_device(dev); \ - udev->autosuspend_delay = delay; \ -} -#elif LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 37) -/* usb.h includes this from 2.6.38 onwards */ -#include -#endif -#endif - -#ifndef KEY_10CHANNELSUP -#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ -#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ -#endif - -#ifdef NEED_SND_CTL_ENUM_INFO -#include -static inline int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, - unsigned int items, const char *const names[]) -{ - info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - info->count = channels; - info->value.enumerated.items = items; - if (info->value.enumerated.item >= items) - info->value.enumerated.item = items - 1; - strlcpy(info->value.enumerated.name, - names[info->value.enumerated.item], - sizeof(info->value.enumerated.name)); - return 0; -} -#endif - -#ifdef NEED_SYSFS_ATTR_INIT -#define sysfs_attr_init(a) -#endif - -#ifdef NEED_USLEEP_RANGE -#define usleep_range(min, max) msleep(min/1000) -#endif - -#ifdef NEED_IS_ERR_OR_NULL -#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr))) -#endif - -#ifndef pr_err_ratelimited -#if defined(DEBUG) -#define pr_err_ratelimited(fmt, ...) \ - printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) -#else -#define pr_err_ratelimited(fmt, ...) -#endif -#endif /*pr_debug_ratelimited */ - -#ifdef NEED_DEV_DBG_RATELIMITED -#define dev_dbg_ratelimited dev_dbg -#define dev_err_ratelimited dev_err -#define dev_notice_ratelimited dev_notice -#endif - -#ifdef NEED_MODULE_USB_DRIVER -#define module_usb_driver(drv) \ -static int __init usb_mod_init(void) \ -{ \ - return usb_register(&drv); \ -} \ -static void __exit usb_mod_exit(void) \ -{ \ - usb_deregister(&drv); \ -} \ -module_init(usb_mod_init); \ -module_exit(usb_mod_exit); -#endif /* module_usb_driver */ - -#ifdef NEED_MODULE_PLATFORM_DRIVER -#define module_platform_driver(drv) \ -static int __init plat_mod_init(void) \ -{ \ - return platform_driver_register(&drv); \ -} \ -static void __exit plat_mod_exit(void) \ -{ \ - platform_driver_unregister(&drv); \ -} \ -module_init(plat_mod_init); \ -module_exit(plat_mod_exit); -#endif /* module_platform_driver */ - -#ifdef NEED_DMA_TRANSFER_DIRECTION -#include -#define DMA_DEV_TO_MEM DMA_FROM_DEVICE -#define DMA_MEM_TO_DEV DMA_TO_DEVICE -#endif - -#ifndef module_driver -#define module_driver(__driver, __register, __unregister) \ -static int __init __driver##_init(void) \ -{ \ - return __register(&(__driver)); \ -} \ -module_init(__driver##_init); \ -static void __exit __driver##_exit(void) \ -{ \ - __unregister(&(__driver)); \ -} \ -module_exit(__driver##_exit); -#endif - -#ifndef module_i2c_driver -#define module_i2c_driver(__i2c_driver) \ - module_driver(__i2c_driver, i2c_add_driver, \ - i2c_del_driver) -#endif - -#ifdef NEED_KMALLOC_ARRAY -#include -static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) -{ - if (size != 0 && n > ULONG_MAX / size) - return NULL; - return __kmalloc(n * size, flags); -} -#endif - -#ifdef NEED_DMAENGINE_PREP_SLAVE_SG -#include -static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg( - struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len, - int dir, unsigned long flags) -{ - return chan->device->device_prep_slave_sg(chan, sgl, sg_len, - dir, flags); -} -#endif - -#ifdef NEED_SET_SYSTEM_SLEEP_PM_OPS -#ifdef CONFIG_PM_SLEEP -#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ - .suspend = suspend_fn, \ - .resume = resume_fn, \ - .freeze = suspend_fn, \ - .thaw = resume_fn, \ - .poweroff = suspend_fn, \ - .restore = resume_fn, -#else -#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) -#endif -#endif - -#ifdef NEED_I2C_CLIENT_SCCB -#define I2C_CLIENT_SCCB 0x9000 -#endif - -#ifdef NEED_UNLOCK_I2C_XFER -#include - -static inline int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) -{ - unsigned long orig_jiffies; - int ret, try; - - /* Retry automatically on arbitration loss */ - orig_jiffies = jiffies; - for (ret = 0, try = 0; try <= adap->retries; try++) { - ret = adap->algo->master_xfer(adap, msgs, num); - if (ret != -EAGAIN) - break; - if (time_after(jiffies, orig_jiffies + adap->timeout)) - break; - } - - return ret; -} -#endif - -#ifdef NEED_KSTRTOU16 -#include - -static inline int kstrtou16(const char *s, unsigned int base, u16 *res) -{ - unsigned long val; - int ret; - - ret = strict_strtoul(s, base, &val); - *res = (u16)val; - return ret; -} -#endif - -#ifdef NEED_KSTRTOUL -#include - -#define kstrtoul strict_strtoul - -#endif - -#ifdef NEED_MEMWEIGHT -static inline size_t memweight(const void *ptr, size_t bytes) -{ - size_t ret = 0; - size_t longs; - const unsigned char *bitmap = ptr; - - for (; bytes > 0 && ((unsigned long)bitmap) % sizeof(long); - bytes--, bitmap++) - ret += hweight8(*bitmap); - - longs = bytes / sizeof(long); - if (longs) { - BUG_ON(longs >= INT_MAX / BITS_PER_LONG); - ret += bitmap_weight((unsigned long *)bitmap, - longs * BITS_PER_LONG); - bytes -= longs * sizeof(long); - bitmap += longs * sizeof(long); - } - /* - * The reason that this last loop is distinct from the preceding - * bitmap_weight() call is to compute 1-bits in the last region smaller - * than sizeof(long) properly on big-endian systems. - */ - for (; bytes > 0; bytes--, bitmap++) - ret += hweight8(*bitmap); - - return ret; -} -#endif - -#ifdef NEED_USB_ENDPOINT_MAXP -#define usb_endpoint_maxp(epd) __le16_to_cpu((epd)->wMaxPacketSize) -#endif - -#ifdef NEED_USB_ENDPOINT_MAXP_MULT -#define USB_EP_MAXP_MULT_SHIFT 11 -#define USB_EP_MAXP_MULT_MASK (3 << USB_EP_MAXP_MULT_SHIFT) -#define USB_EP_MAXP_MULT(m) \ - (((m) & USB_EP_MAXP_MULT_MASK) >> USB_EP_MAXP_MULT_SHIFT) - -#define usb_endpoint_maxp_mult(epd) (USB_EP_MAXP_MULT(usb_endpoint_maxp(epd)) + 1) -#endif - -#ifdef NEED_PRINTK_RATELIMITED -#define printk_ratelimited printk -#endif - -#ifndef module_pci_driver -#define module_pci_driver(__pci_driver) \ - module_driver(__pci_driver, pci_register_driver, \ - pci_unregister_driver) -#endif - -#ifdef NEED_LOCK_ADAPTER -static inline void i2c_lock_adapter(struct i2c_adapter *adapter) -{ - mutex_lock(&adapter->bus_lock); -} -static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) -{ - mutex_unlock(&adapter->bus_lock); -} -#endif - -#ifdef NEED_I2C_PROBE_FUNC_QUICK_READ -static inline int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr) -{ - return i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_READ, 0, - I2C_SMBUS_QUICK, NULL) >= 0; -} -#endif - -#ifdef NEED_ABS64 -#define abs64(x) ({ \ - s64 __x = (x); \ - (__x < 0) ? -__x : __x; \ - }) -#endif - -#ifndef module_pci_driver -#define module_pci_driver(__pci_driver) \ - module_driver(__pci_driver, pci_register_driver, \ - pci_unregister_driver) -#endif - -#ifdef NEED_DONTDUMP -#ifdef NEED_NODUMP -/* - * If NODUMP doesn't exist, then this flag was actually called VM_ALWAYSDUMP - * and we have to invert the meaning of the flag. - * So NODUMP == !VM_ALWAYSDUMP == 0. - */ -#define VM_NODUMP (0) -#endif -#define VM_DONTDUMP VM_NODUMP -#endif - -#ifdef NEED_IS_ENABLED -#define __LINUX_KCONFIG_H -#undef IS_ENABLED -#define __ARG_PLACEHOLDER_1 0, -#define config_enabled(cfg) _config_enabled(cfg) -#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value) -#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0) -#define ___config_enabled(__ignored, val, ...) val -#define IS_ENABLED(option) \ - (config_enabled(option) || config_enabled(option##_MODULE)) -#endif - -#ifdef NEED_IS_REACHABLE -#define IS_REACHABLE(option) (config_enabled(option) || \ - (config_enabled(option##_MODULE) && config_enabled(MODULE))) -#endif - -#ifdef NEED_USB_TRANSLATE_ERRORS -static inline int usb_translate_errors(int error_code) -{ - switch (error_code) { - case 0: - case -ENOMEM: - case -ENODEV: - case -EOPNOTSUPP: - return error_code; - default: - return -EIO; - } -} -#endif - -#ifdef NEED_PTR_RET -static inline int __must_check PTR_RET(const void *ptr) -{ - if (IS_ERR(ptr)) - return PTR_ERR(ptr); - else - return 0; -} -#endif - -#ifdef NEED_FILE_INODE -#include -static inline struct inode *file_inode(struct file *f) -{ - return f->f_path.dentry->d_inode; -} -#endif - -#ifdef NEED_ETH_P_802_3_MIN -#define ETH_P_802_3_MIN 0x0600 -#endif - -#ifdef NEED_PROC_SET_SIZE -#ifdef CONFIG_PROC_FS -#include -static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) -{ - de->size = size; -} -static inline void *PDE_DATA(const struct inode *inode) -{ - return PDE(inode)->data; -} -#else -static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {} -#endif -#endif - -#ifdef NEED_SIMPLE_DEV_PM_OPS -#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ - struct dev_pm_ops name = { \ - .suspend = suspend_fn, \ - .resume = resume_fn, \ - .freeze = suspend_fn, \ - .thaw = resume_fn, \ - .poweroff = suspend_fn, \ - .restore = resume_fn, \ - } -#endif - -#ifdef NEED_VM_IOMAP_MEMORY -#include -static inline int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len) -{ - unsigned long vm_len, pfn, pages; - - /* Check that the physical memory area passed in looks valid */ - if (start + len < start) - return -EINVAL; - /* - * You *really* shouldn't map things that aren't page-aligned, - * but we've historically allowed it because IO memory might - * just have smaller alignment. - */ - len += start & ~PAGE_MASK; - pfn = start >> PAGE_SHIFT; - pages = (len + ~PAGE_MASK) >> PAGE_SHIFT; - if (pfn + pages < pfn) - return -EINVAL; - - /* We start the mapping 'vm_pgoff' pages into the area */ - if (vma->vm_pgoff > pages) - return -EINVAL; - pfn += vma->vm_pgoff; - pages -= vma->vm_pgoff; - - /* Can we fit all of the mapping? */ - vm_len = vma->vm_end - vma->vm_start; - if (vm_len >> PAGE_SHIFT > pages) - return -EINVAL; - - /* Ok, let it rip */ - return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot); -} -#endif - -#ifdef NEED_DEVICE_LOCK -#include -static inline void device_lock(struct device *dev) -{ - down(&dev->sem); -} - -static inline int device_trylock(struct device *dev) -{ - return down_trylock(&dev->sem); -} - -static inline void device_unlock(struct device *dev) -{ - up(&dev->sem); -} -#endif - -#ifdef NEED_PTR_ERR_OR_ZERO -static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) -{ - if (IS_ERR(ptr)) - return PTR_ERR(ptr); - else - return 0; -} -#endif - -#ifdef NEED_SG_ALLOC_TABLE_FROM_PAGES -#include -/** - * sg_alloc_table_from_pages - Allocate and initialize an sg table from - * an array of pages - * @sgt: The sg table header to use - * @pages: Pointer to an array of page pointers - * @n_pages: Number of pages in the pages array - * @offset: Offset from start of the first page to the start of a buffer - * @size: Number of valid bytes in the buffer (after offset) - * @gfp_mask: GFP allocation mask - * - * Description: - * Allocate and initialize an sg table from a list of pages. Contiguous - * ranges of the pages are squashed into a single scatterlist node. A user - * may provide an offset at a start and a size of valid data in a buffer - * specified by the page array. The returned sg table is released by - * sg_free_table. - * - * Returns: - * 0 on success, negative error on failure - */ -static inline int sg_alloc_table_from_pages(struct sg_table *sgt, - struct page **pages, unsigned int n_pages, - unsigned long offset, unsigned long size, - gfp_t gfp_mask) -{ - unsigned int chunks; - unsigned int i; - unsigned int cur_page; - int ret; - struct scatterlist *s; - - /* compute number of contiguous chunks */ - chunks = 1; - for (i = 1; i < n_pages; ++i) - if (page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1) - ++chunks; - - ret = sg_alloc_table(sgt, chunks, gfp_mask); - if (unlikely(ret)) - return ret; - - /* merging chunks and putting them into the scatterlist */ - cur_page = 0; - for_each_sg(sgt->sgl, s, sgt->orig_nents, i) { - unsigned long chunk_size; - unsigned int j; - - /* look for the end of the current chunk */ - for (j = cur_page + 1; j < n_pages; ++j) - if (page_to_pfn(pages[j]) != - page_to_pfn(pages[j - 1]) + 1) - break; - - chunk_size = ((j - cur_page) << PAGE_SHIFT) - offset; - sg_set_page(s, pages[cur_page], min(size, chunk_size), offset); - size -= chunk_size; - offset = 0; - cur_page = j; - } - - return 0; -} -#endif - -#ifdef NEED_REPLACE_FOPS -#define replace_fops(f, fops) \ - do { \ - struct file *__file = (f); \ - fops_put(__file->f_op); \ - BUG_ON(!(__file->f_op = (fops))); \ - } while(0) -#endif - -#ifdef NEED_REINIT_COMPLETION -#include -static inline void reinit_completion(struct completion *x) -{ - x->done = 0; -} -#endif - -#ifdef NEED_DMA_SET_MASK_AND_COHERENT -#include - -#ifdef NEED_DMA_SET_COHERENT_MASK -static inline int dma_set_coherent_mask(struct device *dev, u64 mask) -{ - if (!dma_supported(dev, mask)) - return -EIO; - dev->coherent_dma_mask = mask; - return 0; -} -#endif - -static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) -{ - int rc = dma_set_mask(dev, mask); - if (rc == 0) - dma_set_coherent_mask(dev, mask); - return rc; -} -#endif - -#ifdef NEED_BITMAP_CLEAR - -#include - -#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) - -static inline void bitmap_set(unsigned long *map, int start, int nr) -{ - unsigned long *p = map + BIT_WORD(start); - const int size = start + nr; - int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); - unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); - - while (nr - bits_to_set >= 0) { - *p |= mask_to_set; - nr -= bits_to_set; - bits_to_set = BITS_PER_LONG; - mask_to_set = ~0UL; - p++; - } - if (nr) { - mask_to_set &= BITMAP_LAST_WORD_MASK(size); - *p |= mask_to_set; - } -} - -static inline void bitmap_clear(unsigned long *map, int start, int nr) -{ - unsigned long *p = map + BIT_WORD(start); - const int size = start + nr; - int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); - unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); - - while (nr - bits_to_clear >= 0) { - *p &= ~mask_to_clear; - nr -= bits_to_clear; - bits_to_clear = BITS_PER_LONG; - mask_to_clear = ~0UL; - p++; - } - if (nr) { - mask_to_clear &= BITMAP_LAST_WORD_MASK(size); - *p &= ~mask_to_clear; - } -} -#endif - -#ifdef NEED_DEVM_KMALLOC -#define devm_kmalloc devm_kzalloc -#endif - -#ifdef NEED_USB_SPEED_STRING -#include -/* undefine err & dbg since they clash with err/dbg defines from drivers. */ -#undef err -#undef dbg -static inline const char *usb_speed_string(enum usb_device_speed speed) -{ - return "UNKNOWN"; -} -#endif - -#ifdef NEED_USB_SPEED_WIRELESS -#define USB_SPEED_WIRELESS USB_SPEED_VARIABLE -#endif - -#ifdef NEED_ETHER_ADDR_EQUAL -static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) -{ - const u16 *a = (const u16 *)addr1; - const u16 *b = (const u16 *)addr2; - - return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0; -} -#endif - -#ifdef NEED_SND_CARD_NEW -#define snd_card_new(p, idx, id, module, extra_size, ret) \ - snd_card_create(idx, id, module, extra_size, ret) -#endif - -#ifdef NEED_COMPAT_PUT_TIMESPEC -#define compat_put_timespec put_compat_timespec -#endif - -#ifdef NEED_SMP_MB_AFTER_ATOMIC -#define smp_mb__after_atomic smp_mb__after_clear_bit -#endif - -#ifdef NEED_DEVM_KMALLOC_ARRAY -static inline void *devm_kmalloc_array(struct device *dev, - size_t n, size_t size, gfp_t flags) -{ - if (size != 0 && n > (~(size_t)0) / size) - return NULL; - return devm_kmalloc(dev, n * size, flags); -} -#endif - -#ifdef NEED_DEVM_KCALLOC -#include -static inline void *devm_kcalloc(struct device *dev, - size_t n, size_t size, gfp_t flags) -{ - return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); -} -#endif - -#ifdef NEED_PCI_ZALLOC_CONSISTENT -#include -#include - -static inline void * -pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, - size, dma_handle, GFP_ATOMIC | __GFP_ZERO); -} -#endif - -#ifdef NEED_KREF_GET_UNLESS_ZERO -#include -static inline int __must_check kref_get_unless_zero(struct kref *kref) -{ - return atomic_add_unless(&kref->refcount, 1, 0); -} -#endif - -#ifdef NEED_PRANDOM_U32_MAX -#include -#ifdef NEED_PRANDOM_U32 -#define prandom_u32 random32 -#endif - -static inline u32 prandom_u32_max(u32 ep_ro) -{ - return (u32)(((u64) prandom_u32() * ep_ro) >> 32); -} -#endif - -#ifdef NEED_GENMASK -#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) -#endif - -#ifdef NEED_MULT_FRAC -#define mult_frac(x, numer, denom)( \ -{ \ - typeof(x) quot = (x) / (denom); \ - typeof(x) rem = (x) % (denom); \ - (quot * (numer)) + ((rem * (numer)) / (denom)); \ -} \ -) -#endif - -#ifdef NEED_CLK_HELPERS -#include -static inline int clk_prepare_enable(struct clk *clk) -{ - int ret; - - ret = clk_prepare(clk); - if (ret) - return ret; - ret = clk_enable(clk); - if (ret) - clk_unprepare(clk); - - return ret; -} - -static inline void clk_disable_unprepare(struct clk *clk) -{ - clk_disable(clk); - clk_unprepare(clk); -} -#endif - -#ifdef NEED_PCM_STOP_XRUN -#include -static inline int snd_pcm_stop_xrun(struct snd_pcm_substream *substream) -{ - unsigned long flags; - int ret = 0; - - snd_pcm_stream_lock_irqsave(substream, flags); - if (snd_pcm_running(substream)) - ret = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); - snd_pcm_stream_unlock_irqrestore(substream, flags); - return ret; -} -#endif - -#ifdef NEED_IS_MODULE -#define IS_MODULE(option) defined(option ## _MODULE) -#endif - -#ifdef NEED_DMA_ATTR_SKIP_CPU_SYNC -/* - * Works fine for Intel architectures, but this can cause - * problems on ARM. - */ -#define DMA_ATTR_SKIP_CPU_SYNC 0 -#endif - -#ifdef NEED_SIGN_EXTEND32 -static inline __s32 sign_extend32(__u32 value, int index) -{ - __u8 shift = 31 - index; - return (__s32)(value << shift) >> shift; -} -#endif - -#ifdef NEED_NETDEV_DBG -#define netdev_dbg(__dev, format, args...) -#endif - -#ifdef NEED_WRITEL_RELAXED -#define writel_relaxed writel -#endif - -#ifdef NEED_GET_USER_PAGES_UNLOCKED -#include -static inline long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, - unsigned long start, unsigned long nr_pages, - int write, int force, struct page **pages) -{ - long err; - - down_read(&mm->mmap_sem); - err = get_user_pages(tsk, mm, - start, nr_pages, write, force, pages, NULL); - up_read(&mm->mmap_sem); - return err; -} -#endif - -#ifdef NEED_PR_WARN_ONCE -#define pr_warn_once pr_warn -#endif - -#ifdef NEED_DEV_ERR_ONCE -#define dev_err_once dev_err -#endif - -#ifdef NEED_DIV_ROUND_CLOSEST_ULL -#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ -{ \ - typeof(divisor) __d = divisor; \ - unsigned long long _tmp = (x) + (__d) / 2; \ - do_div(_tmp, __d); \ - _tmp; \ -} \ -) -#endif - -#ifdef NEED_PROP_READ_U64_ARRAY -struct device_node; -static inline int of_property_read_u64_array(const struct device_node *np, - const char *propname, - u64 *out_values, size_t sz) -{ - return -ENOSYS; -} -#endif - -#ifdef NEED_MODULE_PNP_DRIVER -#define module_pnp_driver(__pnp_driver) \ - module_driver(__pnp_driver, pnp_register_driver, \ - pnp_unregister_driver) -#endif - -#include -#ifdef NEED_ETH_ZERO_ADDR -static inline void eth_zero_addr(u8 *addr) -{ - memset(addr, 0x00, ETH_ALEN); -} -#endif - -#ifdef NEED_KVFREE -#include -#include -static inline void kvfree(const void *addr) -{ - if (is_vmalloc_addr(addr)) - vfree(addr); - else - kfree(addr); -} -#endif - -#ifdef NEED_FRAME_VECTOR -#include -#include -#include - -/* Container for pinned pfns / pages */ -struct frame_vector { - unsigned int nr_allocated; /* Number of frames we have space for */ - unsigned int nr_frames; /* Number of frames stored in ptrs array */ - bool got_ref; /* Did we pin pages by getting page ref? */ - bool is_pfns; /* Does array contain pages or pfns? */ - void *ptrs[0]; /* Array of pinned pfns / pages. Use - * pfns_vector_pages() or pfns_vector_pfns() - * for access */ -}; - -struct frame_vector *frame_vector_create(unsigned int nr_frames); -void frame_vector_destroy(struct frame_vector *vec); -int get_vaddr_frames(unsigned long start, unsigned int nr_pfns, - bool write, bool force, struct frame_vector *vec); -void put_vaddr_frames(struct frame_vector *vec); -int frame_vector_to_pages(struct frame_vector *vec); -void frame_vector_to_pfns(struct frame_vector *vec); - -static inline unsigned int frame_vector_count(struct frame_vector *vec) -{ - return vec->nr_frames; -} - -static inline struct page **frame_vector_pages(struct frame_vector *vec) -{ - if (vec->is_pfns) { - int err = frame_vector_to_pages(vec); - - if (err) - return ERR_PTR(err); - } - return (struct page **)(vec->ptrs); -} - -static inline unsigned long *frame_vector_pfns(struct frame_vector *vec) -{ - if (!vec->is_pfns) - frame_vector_to_pfns(vec); - return (unsigned long *)(vec->ptrs); -} - -#endif - -#ifdef NEED_KTIME_COMPARE -static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) -{ - if (cmp1.tv64 < cmp2.tv64) - return -1; - if (cmp1.tv64 > cmp2.tv64) - return 1; - return 0; -} -#endif - -#ifdef NEED_KTIME_BEFORE -static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) -{ - return ktime_compare(cmp1, cmp2) < 0; -} -#endif - -#ifdef NEED_KTIME_GET_NS -static inline u64 ktime_get_ns(void) -{ - return ktime_to_ns(ktime_get()); -} -#endif - -#ifdef NEED_OF_NODE_FULL_NAME -#ifdef CONFIG_OF -static inline const char *of_node_full_name(const struct device_node *np) -{ - return np ? np->full_name : ""; -} -#else -static inline const char* of_node_full_name(const struct device_node *np) -{ - return ""; -} -#endif -#elif LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) -#include -#define of_node_full_name(p) of_node_full_name((struct device_node *)(p)) -#endif - -#ifdef NEED_DIV64_U64_REM -#include - -#if BITS_PER_LONG == 64 -static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) -{ - *remainder = dividend % divisor; - return dividend / divisor; -} -#elif BITS_PER_LONG == 32 -static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) -{ - u32 high = divisor >> 32; - u64 quot; - - if (high == 0) { - u32 rem32; - quot = div_u64_rem(dividend, divisor, &rem32); - *remainder = rem32; - } else { - int n = 1 + fls(high); - quot = div_u64(dividend >> n, divisor >> n); - - if (quot != 0) - quot--; - - *remainder = dividend - quot * divisor; - if (*remainder >= divisor) { - quot++; - *remainder -= divisor; - } - } - - return quot; -} -#endif -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) -#ifdef NEED_LED_SET_BRIGHTNESS -#include -void led_trigger_remove(struct led_classdev *led_cdev); -static inline int led_set_brightness_sync(struct led_classdev *led_cdev, - enum led_brightness value) -{ - int ret = 0; - - led_cdev->brightness = min(value, led_cdev->max_brightness); - - if (!(led_cdev->flags & LED_SUSPENDED)) - ret = led_cdev->brightness_set_sync(led_cdev, - led_cdev->brightness); - return ret; -} -#endif -#endif - -#ifdef NEED_GENMASK_ULL -#define BITS_PER_LONG_LONG 64 -#define GENMASK_ULL(h, l) \ - (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) -#endif - -#ifdef NEED_IDA_SIMPLE_REMOVE -#define ida_simple_remove ida_remove -#endif - -#ifdef NEED_KTIME_GET_BOOTTIME -#define ktime_get_boottime ktime_get -#endif - -#ifdef NEED_BUS_CEC -#define BUS_CEC 0x1E -/* Diagonal movement keys */ -#define KEY_RIGHT_UP 0x266 -#define KEY_RIGHT_DOWN 0x267 -#define KEY_LEFT_UP 0x268 -#define KEY_LEFT_DOWN 0x269 - -#define KEY_ROOT_MENU 0x26a /* Show Device's Root Menu */ -/* Show Top Menu of the Media (e.g. DVD) */ -#define KEY_MEDIA_TOP_MENU 0x26b -#define KEY_NUMERIC_11 0x26c -#define KEY_NUMERIC_12 0x26d -/* - * Toggle Audio Description: refers to an audio service that helps blind and - * visually impaired consumers understand the action in a program. Note: in - * some countries this is referred to as "Video Description". - */ -#define KEY_AUDIO_DESC 0x26e -#define KEY_3D_MODE 0x26f -#define KEY_NEXT_FAVORITE 0x270 -#define KEY_STOP_RECORD 0x271 -#define KEY_PAUSE_RECORD 0x272 -#define KEY_VOD 0x273 /* Video on Demand */ -#define KEY_UNMUTE 0x274 -#define KEY_FASTREVERSE 0x275 -#define KEY_SLOWREVERSE 0x276 -/* - * Control a data application associated with the currently viewed channel, - * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.) - */ -#define KEY_DATA 0x275 -#endif - -#ifdef NEED_KTIME_MS_DELTA -static inline s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier) -{ - return ktime_to_ms(ktime_sub(later, earlier)); -} -#endif - -#ifdef NEED_SMP_LOAD_ACQUIRE -#define smp_load_acquire(p) (*(p)) -#define smp_store_release(p, a) (*p) = (a) -#endif - -#define SERIO_PULSE8_CEC 0x40 -#define SERIO_RAINSHADOW_CEC 0x41 - -#ifdef NEED_KTHREAD_INIT_WORKER -#define __kthread_init_worker __init_kthread_worker -#define kthread_init_worker init_kthread_worker -#define kthread_init_work init_kthread_work -#define kthread_insert_work insert_kthread_work -#define kthread_queue_work queue_kthread_work -#define kthread_flush_work flush_kthread_work -#define kthread_flush_worker flush_kthread_worker -#endif - -#ifdef NEED_PRINT_HEX_DUMP_DEBUG -#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ - groupsize, buf, len, ascii) \ - print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ - groupsize, buf, len, ascii) -#endif - -#ifdef NEED_MIN3 -#define min3(x, y, z) min((typeof(x))min(x, y), z) -#define max3(x, y, z) max((typeof(x))max(x, y), z) -#endif - -#ifdef NEED_RCU_POINTER_HANDOFF -#define rcu_pointer_handoff(p) (p) -#endif - -#ifdef NEED_REGMAP_READ_POLL_TIMEOUT -#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ -({ \ - ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ - int pollret; \ - might_sleep_if(sleep_us); \ - for (;;) { \ - pollret = regmap_read((map), (addr), &(val)); \ - if (pollret) \ - break; \ - if (cond) \ - break; \ - if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ - pollret = regmap_read((map), (addr), &(val)); \ - break; \ - } \ - if (sleep_us) \ - usleep_range((sleep_us >> 2) + 1, sleep_us); \ - } \ - pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ -}) -#endif - -#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) - -#define BIT_ULL(nr) (1ULL << (nr)) -#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) -#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) - -#ifdef NEED_DMA_COERCE_MASK -#include -static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) -{ - dev->dma_mask = &dev->coherent_dma_mask; - return dma_set_mask_and_coherent(dev, mask); -} -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 10, 0) -#include -#define snd_pcm_set_ops(pcm, dir, ops) snd_pcm_set_ops(pcm, dir, (struct snd_pcm_ops *)(ops)) -#endif - -#ifdef NEED_CDEV_DEVICE -#include - -static inline void cdev_set_parent(struct cdev *p, struct kobject *kobj) -{ - WARN_ON(!kobj->state_initialized); - p->kobj.parent = kobj; -} - -static inline int cdev_device_add(struct cdev *cdev, struct device *dev) -{ - int rc = 0; - - if (dev->devt) { - cdev_set_parent(cdev, &dev->kobj); - - rc = cdev_add(cdev, dev->devt, 1); - if (rc) - return rc; - } - - rc = device_add(dev); - if (rc) - cdev_del(cdev); - - return rc; -} - -static inline void cdev_device_del(struct cdev *cdev, struct device *dev) -{ - device_del(dev); - if (dev->devt) - cdev_del(cdev); -} -#endif - -#ifdef NEED_MODULE_PARAM_HW -#include -#define module_param_hw(n, t, hwtype, p) module_param(n, t, p) -#define module_param_hw_named(n, v, t, hwtype, p) module_param_named(n, v, t, p) -#define module_param_hw_array(n, t, hwtype, m, p) module_param_array(n, t, m, p) -#endif - -#ifdef NEED_FWNODE - -/* Minimum stuff for drivers to build without OF support */ -#define of_fwnode_handle(node) NULL - -struct fwnode_endpoint { - unsigned int port; - unsigned int id; - const struct fwnode_handle *local_fwnode; -}; - -static inline struct fwnode_handle *fwnode_get_parent(struct fwnode_handle *fwnode) -{ - return NULL; -} - -static inline struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode) -{ - return NULL; -} - -static inline struct fwnode_handle *fwnode_graph_get_next_endpoint( - struct fwnode_handle *fwnode, struct fwnode_handle *prev) -{ - return NULL; -} - -static inline struct fwnode_handle * -fwnode_graph_get_remote_endpoint(struct fwnode_handle *fwnode) -{ - return NULL; -} - -static inline struct fwnode_handle *dev_fwnode(struct device *dev) -{ - return NULL; -} - -static inline int fwnode_graph_parse_endpoint(struct fwnode_handle *fwnode, - struct fwnode_endpoint *endpoint) -{ - return 0; -} - -static inline void fwnode_handle_get(struct fwnode_handle *fwnode) -{ -} - -static inline void fwnode_handle_put(struct fwnode_handle *fwnode) -{ -} - -#endif - -#ifdef NEED_TO_OF_NODE -static inline struct device_node *to_of_node(struct fwnode_handle *fwnode) -{ - return NULL; -} -#endif - -#ifdef NEED_IS_OF_NODE -static inline bool is_of_node(struct fwnode_handle *fwnode) -{ - return false; -} -#endif - -#ifdef NEED_SKB_PUT_DATA -static inline void *skb_put_data(struct sk_buff *skb, const void *data, - unsigned int len) -{ - void *tmp = skb_put(skb, len); - - memcpy(tmp, data, len); - - return tmp; -} -#endif - -#ifdef NEED_PM_RUNTIME_GET -static inline int pm_runtime_get_if_in_use(struct device *dev) -{ - unsigned long flags; - int retval; - - spin_lock_irqsave(&dev->power.lock, flags); - retval = dev->power.disable_depth > 0 ? -EINVAL : - dev->power.runtime_status == RPM_ACTIVE - && atomic_inc_not_zero(&dev->power.usage_count); - spin_unlock_irqrestore(&dev->power.lock, flags); - return retval; -} -#endif - -#ifdef NEED_KEY_APPSELECT -#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ -#endif - -#ifndef __GFP_RETRY_MAYFAIL -#define __GFP_RETRY_MAYFAIL __GFP_REPEAT -#endif - -#ifdef NEED_PCI_DEVICE_SUB -#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ - .vendor = (vend), .device = (dev), \ - .subvendor = (subvend), .subdevice = (subdev) -#endif - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) -/* - * copied from kernel/time/time.c - */ -static inline u64 nsecs_to_jiffies64_static(u64 n) -{ -#if (NSEC_PER_SEC % HZ) == 0 - /* Common case, HZ = 100, 128, 200, 250, 256, 500, 512, 1000 etc. */ - return div_u64(n, NSEC_PER_SEC / HZ); -#elif (HZ % 512) == 0 - /* overflow after 292 years if HZ = 1024 */ - return div_u64(n * HZ / 512, NSEC_PER_SEC / 512); -#else - /* - * Generic case - optimized for cases where HZ is a multiple of 3. - * overflow after 64.99 years, exact for HZ = 60, 72, 90, 120 etc. - */ - return div_u64(n * 9, (9ull * NSEC_PER_SEC + HZ / 2) / HZ); -#endif -} - -static inline unsigned long nsecs_to_jiffies_static(u64 n) -{ - return (unsigned long)nsecs_to_jiffies64_static(n); -} - -/* - * linux/jiffies.h defines nsecs_to_jiffies64 and nsecs_to_jiffies - * as externals. To get rid of the compiler error, we redifine the - * functions to the static variant just defined above. - */ -#define nsecs_to_jiffies64(_n) nsecs_to_jiffies64_static(_n) -#define nsecs_to_jiffies(_n) nsecs_to_jiffies_static(_n) - -#endif - -#endif /* _COMPAT_H */ diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/firmware/Makefile media-build-dkms-0005~trusty/media-build-0004/v4l/firmware/Makefile --- media-build-dkms-0004~trusty/media-build-0004/v4l/firmware/Makefile 2014-03-15 02:06:29.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/firmware/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -TARGETS = vicam/firmware.fw ttusb-budget/dspbootcode.bin cpia2/stv0672_vp4.bin av7110/bootcode.bin -FW_DIR = $(DESTDIR)/lib/firmware - -#### - -DIRS = $(sort $(dir $(TARGETS))) - -.PHONY = default clean distclean install rminstall prep - -default: $(TARGETS) - -$(TARGETS):: ihex2fw - -clean: - -rm -f ihex2fw - -rm -f $(TARGETS) - -distclean: clean - -for i in $(DIRS); do if [ -d $$i ]; then rm -rf $$i; fi; done - - -install: default - @echo -n "Installing firmwares at $(FW_DIR): " - -@for i in $(DIRS); do if [ ! -d $(FW_DIR)/$$i ]; then mkdir -p $(FW_DIR)/$$i; fi; done - -@for i in $(TARGETS) $(wildcard *.fw*); do echo -n "$$i "; cp $$i $(FW_DIR)/$$i; done - @echo - -rminstall: - @echo "Removing firmwares at $(FW_DIR) " - -for i in $(DIRS); do if [ -d $(FW_DIR)/$$i ]; then rm -rf $(FW_DIR)/$$i; fi; done - -###### - -ihex2fw: ../../linux/firmware/ihex2fw.c - @echo " CC $@" - @gcc -Wall -o $@ $< - -prep: - @for i in $(DIRS); do \ - if [ ! -d $$i ]; then mkdir -p $$i; fi; \ - for j in ../../linux/firmware/$$i/*; do \ - n=`echo $$j | sed s,../../linux/firmware/,,`; \ - if [ ! -e $$n ]; then \ - ln -f $$j $$n; \ - fi; \ - done; done - -%.fw: %.H16 - @echo Generating $@ - @./ihex2fw -w $< $@ - -%.fw: %.HEX - @echo Generating $@ - @./ihex2fw $< $@ - -%.bin: %.bin.ihex - @echo Generating $@ - @objcopy -Iihex -Obinary $< $@ - -# TODO: Use the Firmware Kconfig dependencies -#fw-$(CONFIG_USB_VICAM) += vicam/firmware.fw -#fw-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin -#fw-$(CONFIG_VIDEO_CPIA2) += cpia2/stv0672_vp4.bin -#fw-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin - diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.misc media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.misc --- media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.misc 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.misc 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# -# Misc strange devices -# -menuconfig MISC_DEVICES - bool "Misc devices" - ---help--- - Say Y here to get to see options for device drivers from various - different categories. This option alone does not add any kernel code. - - If you say N, all options in this submenu will be skipped and disabled. - -if MISC_DEVICES - -source "../linux/drivers/misc/altera-stapl/Kconfig" - -endif # MISC_DEVICES diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.mm media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.mm --- media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.mm 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.mm 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -config FRAME_VECTOR - tristate diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.sound media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.sound --- media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.sound 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.sound 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -menuconfig AUDIO_SUPPORT -bool "Sound card support" - help - Allow to select the Kconfig options found at Kernel's - sound/pci/Kconfig file. - Currently, only snd-bt87x is available on this backport tree. - -if AUDIO_SUPPORT -# This is part of sound/pci/Kconfig -comment "ALSA sound" - -config SND_BT87X - tristate "Bt87x Audio Capture" - depends on SND && PCI - select SND_PCM - help - If you want to record audio from TV cards based on - Brooktree Bt878/Bt879 chips, say Y here and read - . - - To compile this driver as a module, choose M here: the module - will be called snd-bt87x. - -config SND_BT87X_OVERCLOCK - bool "Bt87x Audio overclocking" - depends on SND_BT87X - help - Say Y here if 448000 Hz isn't enough for you and you want to - record from the analog input with up to 1792000 Hz. - - Higher sample rates won't hurt your hardware, but audio - quality may suffer. - -config SND_FM801_TEA575X - tristate "ForteMedia FM801 TEA5757 tuner" - depends on VIDEO_V4L1 && SND_FM801 - - help - Say Y here to include support for soundcards based on the ForteMedia - FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media - Forte SF256-PCS-02) into the snd-fm801 driver. - - This will enable support for the old V4L1 API. -endif diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.staging media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.staging --- media-build-dkms-0004~trusty/media-build-0004/v4l/Kconfig.staging 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Kconfig.staging 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -menuconfig STAGING - bool "Staging drivers" - default n - ---help--- - This option allows you to select a number of drivers that are - not of the "normal" Linux kernel quality level. These drivers - are placed here in order to get a wider audience for use of - them. Please note that these drivers are under heavy - development, may or may not work, and may contain userspace - interfaces that most likely will be changed in the near - future. - - Using any of these drivers will taint your kernel which might - affect support options from both the community, and various - commercial support orginizations. - - If you wish to work on these drivers, to help improve them, or - to report problems you have with them, please see the - driver_name.README file in the drivers/staging/ directory to - see what needs to be worked on, and who to contact. - - If in doubt, say N here. - -if STAGING -menu "Media devices in staging" - -config STAGING_BROKEN - bool "Enable drivers that are known to not compile" - default n - ---help--- - Say N here, except if you will be fixing the drivers - compilation. - -source "../linux/drivers/staging/media/Kconfig" -# Currently, there are no broken staging drivers with Kernel 2.6.31 -# if STAGING_BROKEN -# endif - -endmenu - -endif # STAGING diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile --- media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile 2017-09-03 17:58:07.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,475 +0,0 @@ -ifeq ($(wildcard ../linux/include/uapi/linux/videodev2.h),) - -# No kernel source! User needs to download one -def: - @echo 'No kernel files. You need to run "make download untar" or "make dir DIR=" first!' - exit 1 -endif - -ifeq ($(obj),) -obj = . -endif - -################################################# -# This Makefile is used from two contexts. It is used directly when one runs -# 'make' from the v4l-dvb tree. It used used again when the kernel build -# process includes this file into the kernel Makefile. -ifneq ($(TOPDIR),) -# We are being include from the Kernel --include $(TOPDIR)/Rules.make -else -# We are running directly, not from the Kernel - -# take version info from last module build if available -# if .version doesn't exist, make will create it for us and restart --include $(obj)/.version - -ifneq ($(SRCDIR),) - OUTDIR ?= $(SRCDIR) -endif -OUTDIR ?= /lib/modules/$(KERNELRELEASE)/build -SRCDIR ?= /lib/modules/$(KERNELRELEASE)/source -ifeq ($(wildcard $(SRCDIR)/Makefile),) - # No kernel source, but headers should be in OUTDIR - SRCDIR := $(OUTDIR) -endif - -ifneq ($(origin KDIR), undefined) -ifneq ($(KDIR),$(SRCDIR)) -KERNELRELEASE := -override DIR := $(KDIR) -.PHONY: $(obj)/.version -endif -endif - -endif # TOPDIR - -################################################# -# default compilation rule - -default:: prepare firmware - @echo Kernel build directory is $(OUTDIR) - $(MAKE) -C ../linux apply_patches - $(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules - ./scripts/rmmod.pl check -# $(MAKE) checkpatch - -mismatch:: prepare firmware - @echo Kernel build directory is $(OUTDIR) - $(MAKE) -Wfatal-errors -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) CONFIG_DEBUG_SECTION_MISMATCH=y modules - ./scripts/rmmod.pl check - -# Anything in this target shouldn't be build in parallel. -prepare:: config-compat.h Makefile.media links - -firmware:: - $(MAKE) -C firmware prep - $(MAKE) -C firmware - -################################################# -# Object specific rules - -# Targets which don't need Makefile.media's rules -no-makefile-media-targets := %config clean distclean snapshot snap \ - tarball release %links start insmod load stop rmmod unload reload \ - card% update push %commit help debug cx88-ivtv lxdialog - -# Targets which don't need .myconfig to exist, to keep us from including it -no-dot-config-targets := $(no-makefile-media-targets) %install remove - -dot-config := 1 -ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) - ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) - dot-config := 0 - endif -endif - -makefile-media := 1 -ifneq ($(filter $(no-makefile-media-targets), $(MAKECMDGOALS)),) - ifeq ($(filter-out $(no-makefile-media-targets), $(MAKECMDGOALS)),) - makefile-media := 0 - endif -endif - -makefile-mm := 1 -ifeq ($(wildcard ../linux/mm/frame_vector.c),) - makefile-mm := 0 -endif - -# If version not yet detected, we can't create/have these files yet -ifeq ($(KERNELRELEASE),) - makefile-media := 0 - makefile-mm := 0 - dot-config := 0 -endif - -ifeq ($(dot-config),1) --include $(obj)/.myconfig -endif - -ifeq ($(makefile-media),1) --include $(obj)/Makefile.media --include $(obj)/Makefile.sound -endif -ifeq ($(makefile-mm),1) --include $(obj)/Makefile.mm -endif - --include $(obj)/.kconfig.dep - -# make will try to automatically rebuild the Makefile and all includes, -# and if any of them change, make will start over with the updated files - -$(obj)/.myconfig: $(obj)/.config $(obj)/Kconfig - ./scripts/make_myconfig.pl - -# If it doesn't exist, this rule will build Makefile.media. If it does -# exist, it will have dependency information in it, and only be rebuilt -# when necessary. -Makefile.media: - scripts/make_makefile.pl - -################################################# -# CFLAGS configuration - -ifeq ($(CONFIG_DVB_FIRESAT),m) - EXTRA_CFLAGS += -I$(srctree)/drivers/ieee1394/ -endif - -EXTRA_CFLAGS += -g - -EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) - -# Make sure to use the backport header for common stuff -EXTRA_CFLAGS += -include $(obj)/compat.h - -################################################# -# Kernel 2.6/3.x specific rules - -ifneq ($(KERNELRELEASE),) - export-objs := - list-multi := -endif - -################################################# -# Directories to be used - -snapshot := $(wildcard $(obj)/.snapshot) -ifneq ($(snapshot),) -SNAPSHOT_CFLAGS := -DSNAPSHOT='$(shell cat $(snapshot))' -EXTRA_CFLAGS += $(SNAPSHOT_CFLAGS) -endif - -PWD := $(shell pwd) -DEST := /lib/modules/$(KERNELRELEASE)/v4l2 -KDIR26 := /lib/modules/$(KERNELRELEASE)/kernel/drivers/media - -################################################# -# Compiler fixup rules - -HOSTCC:=$(CC) -CC += -I$(obj) - -CPPFLAGS := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(CPPFLAGS) -I$(SUBDIRS)/ - -# Needed for kernel 2.6.24 or up -KBUILD_CPPFLAGS := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(KBUILD_CPPFLAGS) -I$(SUBDIRS)/ - -# Needed for kernel 2.6.29 or up -LINUXINCLUDE := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(LINUXINCLUDE) -I$(SUBDIRS)/ - -MYCFLAGS := - - -################################################# -# which files to install? - -inst-m := $(wildcard *.ko) -ifeq ($(inst-m),) - inst-m := $(obj-m) -endif - -v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) - -################################################# -# locales seem to cause trouble sometimes. -LC_ALL = POSIX -export LC_ALL - - -################################################# -# Generic wildcard rules - -%.asm: %.o - objdump -S $< > $@ - -################################################# -# all file compilation rule - -all:: default - -################################################# -# installation invocation rules -INSTALLDEPS := -ifeq ($(makefile-mm),1) -INSTALLDEPS += mm-install -endif -ifeq ($(makefile-media),1) -INSTALLDEPS += media-install -endif -modules_install install:: $(INSTALLDEPS) - -remove rminstall:: media-rminstall - -firmware_install:: - make -C firmware install - -################################################# -# Compiling preparation rules - -.PHONY: release -ifneq ($(filter release,$(MAKECMDGOALS)),) -.PHONY: $(obj)/.version -endif -release: - @true - -$(obj)/.version: -ifneq ($(DIR),) - @echo "Searching in $(DIR)/Makefile for kernel version." - @perl \ - -e '$$d="$(DIR)"; ' \ - -e 'S: open IN,"$$d/Makefile"; ' \ - -e 'while () {' \ - -e ' if (/^VERSION\s*=\s*(\d+)/){ $$version=$$1; }' \ - -e ' elsif (/^PATCHLEVEL\s*=\s*(\d+)/){ $$level=$$1; }' \ - -e ' elsif (/^SUBLEVEL\s*=\s*(\d+)/){ $$sublevel=$$1; }' \ - -e ' elsif (/^EXTRAVERSION\s*=\s*(\d+)\n/){ $$extra=".$$1"; }' \ - -e ' elsif (/^EXTRAVERSION\s*=\s*(\S+)\n/){ $$extra=$$1; }' \ - -e ' elsif (/^KERNELSRC\s*:=\s*(\S.*)\n/ || /^MAKEARGS\s*:=\s*-C\s*(\S.*)\n/)' \ - -e ' { $$o=$$d; $$d=$$1; goto S; }' \ - -e '};' \ - -e 'printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",' \ - -e ' $$version,$$level,$$sublevel,$$version,$$level,$$sublevel,$$extra);' \ - -e 'print "OUTDIR:=$$o\n" if($$o);' \ - -e 'print "SRCDIR:=$$d\n";' > $(obj)/.version - @cat .version|grep KERNELRELEASE:|sed s,'KERNELRELEASE:=','Forcing compiling to version ', - - @if [ ! -f $(DIR)/scripts/kallsyms ]; then \ - echo "*** Warning: You should configure and build kernel before compiling V4L"; \ - fi -else -ifneq ($(VER),) - @echo "Forcing kernel version to $(VER)." - @echo $(VER)|perl -ne 'if (/^([0-9]*)\.([0-9]*)\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version -else - @echo No version yet, using `uname -r` - @uname -r|perl -ne 'if (/^([0-9]*)\.([0-9]*)\.?([0-9]*)(.*)$$/) { $$ver = $$1; $$patch = $$2; $$sub = $$3; if ($$ver == 2 && $$patch == 6 && $$sub >= 40) { $$ver = 3; $$patch = $$sub - 40; $$sub = 0; }; printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s",$$ver,$$patch,$$sub==""?"0":$$sub,$$_); };' > $(obj)/.version -endif -endif - -links:: - @echo creating symbolic links... - @find ../linux/drivers/media -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. - @find ../linux/sound -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. - @if [ -f ../linux/mm/frame_vector.c ]; then find ../linux/mm -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. ; fi - @find ../linux/drivers/staging -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. - @find ../linux/drivers/misc -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. - -config-compat.h:: $(obj)/.version .myconfig scripts/make_config_compat.pl - perl scripts/make_config_compat.pl $(SRCDIR) $(obj)/.myconfig $(obj)/config-compat.h - -kernel-links makelinks:: - cd ..; v4l/scripts/makelinks.sh $(SRCDIR) - - -################################################# -# Cardlist updating rule - -card cardlist cardlists:: - scripts/cardlist - -################################################# -# Cleaning rules - -clean:: - @find . -name '*.c' -type l -exec rm '{}' \; - @find . -name '*.h' -type l -exec rm '{}' \; - -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \ - config-compat.h Module.symvers Module.markers modules.order \ - *.unsigned .*.ko.unsigned.cmd - $(MAKE) -C firmware $@ - -distclean:: clean - -rm -f .version .*.o.flags .*.o.d *.mod.gcno Makefile.media \ - Kconfig Kconfig.kern .config .config.cmd .myconfig \ - .kconfig.dep - -rm -rf .tmp_versions .tmp*.ver .tmp*.o .*.gcno - -rm -f scripts/lxdialog scripts/kconfig - @find .. -name '*.orig' -exec rm '{}' \; - @find .. -name '*.rej' -exec rm '{}' \; - $(MAKE) -C firmware $@ - -################################################# -# Kernel module insert/removal rules - -start insmod load:: - scripts/rmmod.pl load - -stop rmmod unload:: - scripts/rmmod.pl unload - -reload:: - scripts/rmmod.pl reload - -debug:: - scripts/rmmod.pl debug - -################################################# -# Configuration rules - -# Kernel config programs -QCONF := $(OUTDIR)/scripts/kconfig/qconf -GCONF := $(OUTDIR)/scripts/kconfig/gconf -MCONF := $(OUTDIR)/scripts/kconfig/mconf -CONF := $(OUTDIR)/scripts/kconfig/conf - -# lxdialog can be in either scripts/lxdialog or scripts/kconfig/lxdialog -LXDIALOG_DIR := $(shell if [ -d $(OUTDIR)/scripts/kconfig/lxdialog ]; then echo kconfig/ ; fi) -# lxdialog might not be a separate program that needs to be built, check -# for lxdialog/Makefile to find out. -ifneq ($(wildcard $(SRCDIR)/scripts/$(LXDIALOG_DIR)lxdialog/Makefile),) - # lxdialog must be built - LXDIALOG_LNK := $(if $(LXDIALOG_DIR),scripts/kconfig,scripts/lxdialog) - LXDIALOG := $(OUTDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog -endif - -# Ideally, some kind of oldconfig process would be used to update .config -# without destroying the user's configuration. Lacking that, we will -# just touch .config if it already exists, and run make_kconfig if it -# doesn't. -$(obj)/.config: $(obj)/.version - @echo Updating/Creating .config - @if [ -e $(obj)/.config ]; then touch $(obj)/.config ; else \ - $(MAKE) -C ../linux apply_patches; \ - ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR); fi - -$(obj)/Kconfig: $(obj)/.version - @$(MAKE) -C ../linux apply_patches - ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) - -# With make -j, it's possible that both the .config and Kconfig rules -# will run at the same time, running make_kconfig.pl twice. There -# doesn't appear to be any way around this, but it doesn't cause a -# failure. One make_kconfig.pl will just overwrite the other's output. - -xconfig:: $(QCONF) $(obj)/Kconfig - $(QCONF) $(obj)/Kconfig - ./scripts/fix_kconfig.pl - -gconfig:: $(GCONF) $(obj)/Kconfig - $(GCONF) $(obj)/Kconfig - ./scripts/fix_kconfig.pl - -config:: $(CONF) $(obj)/Kconfig - $(CONF) $(obj)/Kconfig - ./scripts/fix_kconfig.pl - -menuconfig:: $(MCONF) lxdialog $(obj)/Kconfig - $(MCONF) $(obj)/Kconfig - ./scripts/fix_kconfig.pl - -allyesconfig allmodconfig:: $(obj)/.version - @$(MAKE) -C ../linux apply_patches - ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) 1 - ./scripts/fix_kconfig.pl - -stagingconfig:: $(obj)/.version - @$(MAKE) -C ../linux apply_patches - ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) 1 1 - ./scripts/fix_kconfig.pl - -# rule to build kernel conf programs -KMAKEVARS := config-targets=1 mixed-targets=0 dot-config=0 SRCDIR=$(SRCDIR) -$(QCONF) $(GCONF) $(MCONF) $(CONF): - $(MAKE) -C $(OUTDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(notdir $@) - -# lxdialog has two parts, a symlink and the actual binary -.PHONY: lxdialog -lxdialog: $(LXDIALOG) $(LXDIALOG_LNK) - -ifdef LXDIALOG -$(LXDIALOG_LNK): - ln -snf $(OUTDIR)/$(LXDIALOG_LNK) $(LXDIALOG_LNK) - -$(LXDIALOG): - $(MAKE) -C $(SRCDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(LXDIALOG) -endif - -cx88-ivtv:: - @echo creating cx88-ivtv symbolic links... - @ln -sf ../v4l_experimental/cx88-ivtv.c . - -################################################# -# Old instalation rule - -old-install:: rminstall - @echo -e "\nInstalling new V4L modules at $(DEST)..." - - @strip --strip-debug $(inst-m) - - -install -d $(DEST) - -install -m 644 -c $(inst-m) $(DEST) - - /sbin/depmod -a ${KERNELRELEASE} - -################################################# -# Tree management rules - -update:: - make -C .. update - -commit cvscommit hgcommit:: - make -C .. commit - -push:: - make -C .. push - -################################################# -# Consistency checks -checkemacs:: - scripts/check.pl - -checketerse:: - scripts/check.pl -t - -checkpatch:: - scripts/check.pl -c - -################################################# -# Help -help:: - @cat ../INSTALL - -################################################# -# build tarballs rules - -RPWD := $(shell cd .. && pwd) -thisdir := $(notdir $(RPWD)) -name := v4l-dvb -date := $(shell date +%Y%m%d) -tardest ?= . - -snapdir := $(HOME)/snapshot -snap := $(name) - -snapshot snap tarball:: update distclean - echo $(thisdir) - echo $(name) - echo $(date) > .snapshot - (cd ..; tar czf $(snapdir)/$(snap)-$(date).tar.gz .) - hg history --style scripts/map-changelog > /$(snapdir)/$(snap)-ChangeLog-$(date) - $(MAKE) -C $(snapdir) - -dir download apply-patches unapply-patches untar:: - make -C ../linux $@ diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.kernel media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.kernel --- media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.kernel 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.kernel 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -# This Makefile is used to build sources that are part of the kernel tree. -# What we want are the various programs used by the kconfig system. We can't -# just directly call the top-level kernel Makefile, as it doesn't provide -# targets to only build the kconfig system. It provides targets to build -# the kconfig system *and then configure the kernel*. - -# What we do is include the top-level kernel Makefile here, to get all the -# variables and rules it defines, and then add our own targets to just build -# the kconfig system. You can think of this file as a modified version of the -# top-level kernel Makefile that has "kconfig build only" targets added to it. -# Each of these new targets has the prefix v4l- so it doesn't conflict with -# any targets in the kernel Makefile. - -# Like the kernel Makefile, this Makefile should have the cwd be the root -# of the kernel source. - -# These should be defined on the command line, to override the kernel Makefile -# config-targets := 1 -# mixed-targets := 0 -# dot-config := 0 - -KBUILD_SRC := $(SRCDIR) -include $(SRCDIR)/Makefile - -# Used by the config target -v4l-conf: scripts_basic - $(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf - -# Used by the xconfig target -v4l-qconf: scripts_basic - $(MAKE) $(build)=scripts/kconfig qconf-target=1 scripts/kconfig/qconf - -# Used by the qconfig target -v4l-gconf: scripts_basic - $(MAKE) $(build)=scripts/kconfig gconf-target=1 scripts/kconfig/gconf - -# Used by the menuconfig target, also needs lxdialog -v4l-mconf: scripts_basic - $(MAKE) $(build)=scripts/kconfig hostprogs-y=mconf scripts/kconfig/mconf - -# Rule used for kernel where lxdialog is in directory scripts/lxdialog -v4l-%/scripts/lxdialog/lxdialog: scripts_basic - $(MAKE) $(build)=scripts/lxdialog - -# Rule used for kernel where lxdialog is in directory scripts/kconfig/lxdialog -v4l-%/scripts/kconfig/lxdialog/lxdialog: scripts_basic - $(MAKE) $(build)=scripts/kconfig/lxdialog diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.mm media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.mm --- media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.mm 2017-03-04 01:42:59.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.mm 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# From mm/Makefile - -obj-$(CONFIG_FRAME_VECTOR) += frame_vector.o - -KDIRA := /lib/modules/$(KERNELRELEASE)/kernel - -mm-install install-mm:: - @dir="mm"; \ - files='frame_vector.ko'; \ - if [ -f $$files ]; then \ - echo -e "\nInstalling $(KDIRA)/$$dir files:"; \ - install -d $(KDIRA)/$$dir; \ - for i in $$files;do if [ -e $$i ]; then echo -n "$$i "; \ - install -m 644 -c $$i $(KDIRA)/$$dir; fi; done; echo; fi diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.sound media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.sound --- media-build-dkms-0004~trusty/media-build-0004/v4l/Makefile.sound 2014-03-14 19:33:42.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/Makefile.sound 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -# From sound/pci/Makefile - -snd-bt87x-objs := bt87x.o -obj-$(CONFIG_SND_BT87X) += snd-bt87x.o - -KDIRA := /lib/modules/$(KERNELRELEASE)/kernel - - -sound-install install-sound:: - @dir="sound/pci"; \ - files='snd-bt87x.ko'; \ - echo -e "\nInstalling $(KDIRA)/$$dir files:"; \ - install -d $(KDIRA)/$$dir; \ - for i in $$files;do if [ -e $$i ]; then echo -n "$$i "; \ - install -m 644 -c $$i $(KDIRA)/$$dir; fi; done; echo; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/obsolete.txt media-build-dkms-0005~trusty/media-build-0004/v4l/obsolete.txt --- media-build-dkms-0004~trusty/media-build-0004/v4l/obsolete.txt 2013-02-08 00:32:44.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/obsolete.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ -# for kernel 3.7 - patches obsoleted due to path renames - -common/saa7146 -common/saa7146_vv -common/tuners/fc0011 -common/tuners/fc0012 -common/tuners/fc0013 -common/tuners/max2165 -common/tuners/mc44s803 -common/tuners/mt2060 -common/tuners/mt2063 -common/tuners/mt20xx -common/tuners/mt2131 -common/tuners/mt2266 -common/tuners/mxl5005s -common/tuners/mxl5007t -common/tuners/qt1010 -common/tuners/tda18212 -common/tuners/tda18218 -common/tuners/tda18271 -common/tuners/tda827x -common/tuners/tda8290 -common/tuners/tda9887 -common/tuners/tea5761 -common/tuners/tea5767 -common/tuners/tua9001 -common/tuners/tuner-simple -common/tuners/tuner-types -common/tuners/tuner-xc2028 -common/tuners/xc4000 -common/tuners/xc5000 -dvb/b2c2/b2c2-flexcop -dvb/b2c2/b2c2-flexcop-pci -dvb/b2c2/b2c2-flexcop-usb -dvb/bt8xx/bt878 -dvb/bt8xx/dst -dvb/bt8xx/dst_ca -dvb/bt8xx/dvb-bt8xx -dvb/ddbridge/ddbridge -dvb/dm1105/dm1105 -dvb/dvb-core/dvb-core -dvb/dvb-usb/dvb-usb -dvb/dvb-usb/dvb-usb-a800 -dvb/dvb-usb/dvb-usb-af9005 -dvb/dvb-usb/dvb-usb-af9005-remote -dvb/dvb-usb/dvb-usb-af9015 -dvb/dvb-usb/dvb-usb-af9035 -dvb/dvb-usb/dvb-usb-anysee -dvb/dvb-usb/dvb-usb-au6610 -dvb/dvb-usb/dvb-usb-az6007 -dvb/dvb-usb/dvb-usb-az6027 -dvb/dvb-usb/dvb-usb-ce6230 -dvb/dvb-usb/dvb-usb-cinergyT2 -dvb/dvb-usb/dvb-usb-cxusb -dvb/dvb-usb/dvb-usb-dib0700 -dvb/dvb-usb/dvb-usb-dibusb-common -dvb/dvb-usb/dvb-usb-dibusb-mb -dvb/dvb-usb/dvb-usb-dibusb-mc -dvb/dvb-usb/dvb-usb-digitv -dvb/dvb-usb/dvb-usb-dtt200u -dvb/dvb-usb/dvb-usb-dtv5100 -dvb/dvb-usb/dvb-usb-dw2102 -dvb/dvb-usb/dvb-usb-ec168 -dvb/dvb-usb/dvb-usb-friio -dvb/dvb-usb/dvb-usb-gl861 -dvb/dvb-usb/dvb-usb-gp8psk -dvb/dvb-usb/dvb-usb-it913x -dvb/dvb-usb/dvb-usb-lmedm04 -dvb/dvb-usb/dvb-usb-m920x -dvb/dvb-usb/dvb-usb-mxl111sf -dvb/dvb-usb/dvb-usb-nova-t-usb2 -dvb/dvb-usb/dvb-usb-opera -dvb/dvb-usb/dvb-usb-pctv452e -dvb/dvb-usb/dvb-usb-rtl28xxu -dvb/dvb-usb/dvb-usb-technisat-usb2 -dvb/dvb-usb/dvb-usb-ttusb2 -dvb/dvb-usb/dvb-usb-umt-010 -dvb/dvb-usb/dvb-usb-vp702x -dvb/dvb-usb/dvb-usb-vp7045 -dvb/dvb-usb/mxl111sf-demod -dvb/dvb-usb/mxl111sf-tuner -dvb/firewire/firedtv -dvb/frontends/a8293 -dvb/frontends/af9013 -dvb/frontends/af9033 -dvb/frontends/atbm8830 -dvb/frontends/au8522_common -dvb/frontends/au8522_decoder -dvb/frontends/au8522_dig -dvb/frontends/bcm3510 -dvb/frontends/cx22700 -dvb/frontends/cx22702 -dvb/frontends/cx24110 -dvb/frontends/cx24113 -dvb/frontends/cx24116 -dvb/frontends/cx24123 -dvb/frontends/cxd2820r -dvb/frontends/dib0070 -dvb/frontends/dib0090 -dvb/frontends/dib3000mb -dvb/frontends/dib3000mc -dvb/frontends/dib7000m -dvb/frontends/dib7000p -dvb/frontends/dib8000 -dvb/frontends/dib9000 -dvb/frontends/dibx000_common -dvb/frontends/drxd -dvb/frontends/drxk -dvb/frontends/ds3000 -dvb/frontends/dvb_dummy_fe -dvb/frontends/dvb-pll -dvb/frontends/ec100 -dvb/frontends/hd29l2 -dvb/frontends/isl6405 -dvb/frontends/isl6421 -dvb/frontends/isl6423 -dvb/frontends/it913x-fe -dvb/frontends/itd1000 -dvb/frontends/ix2505v -dvb/frontends/l64781 -dvb/frontends/lg2160 -dvb/frontends/lgdt3305 -dvb/frontends/lgdt330x -dvb/frontends/lgs8gl5 -dvb/frontends/lgs8gxx -dvb/frontends/lnbp21 -dvb/frontends/lnbp22 -dvb/frontends/m88rs2000 -dvb/frontends/mb86a16 -dvb/frontends/mb86a20s -dvb/frontends/mt312 -dvb/frontends/mt352 -dvb/frontends/nxt200x -dvb/frontends/nxt6000 -dvb/frontends/or51132 -dvb/frontends/or51211 -dvb/frontends/rtl2830 -dvb/frontends/rtl2832 -dvb/frontends/s5h1409 -dvb/frontends/s5h1411 -dvb/frontends/s5h1420 -dvb/frontends/s5h1432 -dvb/frontends/s921 -dvb/frontends/si21xx -dvb/frontends/sp8870 -dvb/frontends/sp887x -dvb/frontends/stb0899 -dvb/frontends/stb6000 -dvb/frontends/stb6100 -dvb/frontends/stv0288 -dvb/frontends/stv0297 -dvb/frontends/stv0299 -dvb/frontends/stv0367 -dvb/frontends/stv0900 -dvb/frontends/stv090x -dvb/frontends/stv6110 -dvb/frontends/stv6110x -dvb/frontends/tda10021 -dvb/frontends/tda10023 -dvb/frontends/tda10048 -dvb/frontends/tda1004x -dvb/frontends/tda10071 -dvb/frontends/tda10086 -dvb/frontends/tda18271c2dd -dvb/frontends/tda665x -dvb/frontends/tda8083 -dvb/frontends/tda8261 -dvb/frontends/tda826x -dvb/frontends/tua6100 -dvb/frontends/ves1820 -dvb/frontends/ves1x93 -dvb/frontends/zl10036 -dvb/frontends/zl10039 -dvb/frontends/zl10353 -dvb/mantis/hopper -dvb/mantis/mantis -dvb/mantis/mantis_core -dvb/ngene/ngene -dvb/pluto2/pluto2 -dvb/pt1/earth-pt1 -dvb/siano/smsdvb -dvb/siano/smsmdtv -dvb/siano/smssdio -dvb/siano/smsusb -dvb/ttpci/budget -dvb/ttpci/budget-av -dvb/ttpci/budget-ci -dvb/ttpci/budget-core -dvb/ttpci/budget-patch -dvb/ttpci/dvb-ttpci -dvb/ttpci/ttpci-eeprom -dvb/ttusb-budget/dvb-ttusb-budget -dvb/ttusb-dec/ttusb_dec -dvb/ttusb-dec/ttusbdecfe -video/adv7170 -video/adv7175 -video/adv7180 -video/au0828/au0828 -video/bt819 -video/bt856 -video/bt866 -video/bt8xx/bttv -video/btcx-risc -video/bw-qcam -video/cpia2/cpia2 -video/c-qcam -video/cs5345 -video/cs53l32a -video/cx18/cx18 -video/cx18/cx18-alsa -video/cx231xx/cx231xx -video/cx231xx/cx231xx-alsa -video/cx231xx/cx231xx-dvb -video/cx2341x -video/cx23885/altera-ci -video/cx23885/cx23885 -video/cx25821/cx25821 -video/cx25821/cx25821-alsa -video/cx25840/cx25840 -video/cx88/cx8800 -video/cx88/cx8802 -video/cx88/cx88-alsa -video/cx88/cx88-blackbird -video/cx88/cx88-dvb -video/cx88/cx88-vp3054-i2c -video/cx88/cx88xx -video/em28xx/em28xx -video/em28xx/em28xx-alsa -video/em28xx/em28xx-dvb -video/em28xx/em28xx-rc -video/gspca/gl860/gspca_gl860 -video/gspca/gspca_benq -video/gspca/gspca_conex -video/gspca/gspca_cpia1 -video/gspca/gspca_etoms -video/gspca/gspca_finepix -video/gspca/gspca_jeilinj -video/gspca/gspca_jl2005bcd -video/gspca/gspca_kinect -video/gspca/gspca_konica -video/gspca/gspca_main -video/gspca/gspca_mars -video/gspca/gspca_mr97310a -video/gspca/gspca_nw80x -video/gspca/gspca_ov519 -video/gspca/gspca_ov534 -video/gspca/gspca_ov534_9 -video/gspca/gspca_pac207 -video/gspca/gspca_pac7302 -video/gspca/gspca_pac7311 -video/gspca/gspca_se401 -video/gspca/gspca_sn9c2028 -video/gspca/gspca_sn9c20x -video/gspca/gspca_sonixb -video/gspca/gspca_sonixj -video/gspca/gspca_spca1528 -video/gspca/gspca_spca500 -video/gspca/gspca_spca501 -video/gspca/gspca_spca505 -video/gspca/gspca_spca506 -video/gspca/gspca_spca508 -video/gspca/gspca_spca561 -video/gspca/gspca_sq905 -video/gspca/gspca_sq905c -video/gspca/gspca_sq930x -video/gspca/gspca_stk014 -video/gspca/gspca_stv0680 -video/gspca/gspca_sunplus -video/gspca/gspca_t613 -video/gspca/gspca_topro -video/gspca/gspca_tv8532 -video/gspca/gspca_vc032x -video/gspca/gspca_vicam -video/gspca/gspca_xirlink_cit -video/gspca/gspca_zc3xx -video/gspca/m5602/gspca_m5602 -video/gspca/stv06xx/gspca_stv06xx -video/hdpvr/hdpvr -video/hexium_gemini -video/hexium_orion -video/imx074 -video/ir-kbd-i2c -video/ivtv/ivtv -video/ivtv/ivtvfb -video/ks0127 -video/m52790 -video/marvell-ccic/cafe_ccic -video/mem2mem_testdev -video/meye -video/msp3400 -video/mt9m001 -video/mt9m111 -video/mt9t031 -video/mt9t112 -video/mt9v011 -video/mt9v022 -video/mxb -video/ov2640 -video/ov5642 -video/ov6650 -video/ov7670 -video/ov772x -video/ov9640 -video/ov9740 -video/pms -video/pvrusb2/pvrusb2 -video/pwc/pwc -video/rj54n1cb0c -video/s2255drv -video/saa6588 -video/saa7110 -video/saa7115 -video/saa7127 -video/saa7134/saa6752hs -video/saa7134/saa7134 -video/saa7134/saa7134-alsa -video/saa7134/saa7134-dvb -video/saa7134/saa7134-empress -video/saa7164/saa7164 -video/saa717x -video/saa7185 -video/sn9c102/sn9c102 -video/soc_camera -video/soc_camera_platform -video/soc_mediabus -video/sta2x11_vip -video/stkwebcam -video/tda7432 -video/tda9840 -video/tea6415c -video/tea6420 -video/timblogiw -video/tlg2300/poseidon -video/tm6000/tm6000 -video/tm6000/tm6000-alsa -video/tm6000/tm6000-dvb -video/tuner -video/tvaudio -video/tveeprom -video/tvp5150 -video/tw9910 -video/upd64031a -video/upd64083 -video/usbvision/usbvision -video/uvc/uvcvideo -video/v4l2-common -video/v4l2-int-device -video/v4l2-mem2mem -video/via-camera -video/videobuf2-core -video/videobuf2-dma-contig -video/videobuf2-memops -video/videobuf2-vmalloc -video/videobuf-core -video/videobuf-dma-contig -video/videobuf-dma-sg -video/videobuf-dvb -video/videobuf-vmalloc -video/videodev -video/vivi -video/vp27smpx -video/vpx3220 -video/w9966 -video/wm8739 -video/wm8775 -video/zoran/videocodec -video/zoran/zr36016 -video/zoran/zr36050 -video/zoran/zr36060 -video/zoran/zr36067 -video/zr364xx diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/au0828.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/au0828.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/au0828.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/au0828.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s+(AU08[\d]._BOARD_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # au0828_boards - if (/\[(AU0828_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; - $data{$id}->{type} = "(au0828)"; -# $data{$id}->{nr} = $nr++; - }; - - next unless defined($id); - - if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*)/ ) { - $subvendor=$1; - $subdevice=$2; - } - - if (/.*driver_info.*(AU08[\d]._BOARD_\w+)/ ) { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - } - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # au0828_USB_tbl - - -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-40s %-15s", $data{$item}->{nr}, $data{$item}->{name},$data{$item}->{type}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/bttv.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/bttv.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/bttv.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/bttv.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; -my $pciid=0; - -while (<>) { - # defines in header file - if (/#define\s+(BTTV_BOARD_\w+)\s+0x([0-9a-fA-F]*).*/) { - $data{$1}->{nr} = hex $2; - - next; - } - # cx88_boards - if (/\[(BTTV_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; -# $data{$id}->{nr} = $nr++; - }; - if (/0x([0-9a-fA-F]...)([0-9a-fA-F]...)/) { - $subvendor = $2; - $subdevice = $1; - if (/(BTTV_BOARD_\w+)/) { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - undef $subvendor; - undef $subdevice; - } - } - - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - if (/0x([0-9]...)([0-9]...)/) { - $subvendor = $1; - $subdevice = $2; - } - -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cardlist media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cardlist --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cardlist 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cardlist 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#!/bin/sh - -scripts/bttv.pl ../linux/drivers/media/pci/bt8xx/bttv.h ../linux/drivers/media/pci/bt8xx/bttv-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.bttv - -scripts/cx88.pl ../linux/drivers/media/pci/cx88/cx88.h ../linux/drivers/media/pci/cx88/cx88-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx88 - -scripts/em28xx.pl ../linux/drivers/media/usb/em28xx/em28xx-cards.c ../linux/drivers/usb/video/em28xx/em28xx.h \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.em28xx - -scripts/tuner.pl ../linux/include/media/tuner.h ../linux/drivers/media/tuners/tuner-types.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.tuner - -scripts/saa7134.pl ../linux/drivers/media/pci/saa7134/saa7134.h ../linux/drivers/media/pci/saa7134/saa7134-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7134 - -scripts/usbvision.pl ../linux/drivers/media/usb/usbvision/usbvision-cards.h ../linux/drivers/media/usb/usbvision/usbvision-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.usbvision - -scripts/cx23885.pl ../linux/drivers/media/pci/cx23885/cx23885.h ../linux/drivers/media/pci/cx23885/cx23885-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx23885 - -scripts/au0828.pl ../linux/drivers/media/usb/au0828/au0828-cards.h ../linux/drivers/media/usb/au0828/au0828-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.au0828 - -scripts/saa7164.pl ../linux/drivers/media/pci/saa7164/saa7164.h ../linux/drivers/media/pci/saa7164/saa7164-cards.c \ - | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7164 diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/changelog.tmpl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/changelog.tmpl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/changelog.tmpl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/changelog.tmpl 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -User #author# -Date #date|date# -#desc# - ---- diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/check_config_defines.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/check_config_defines.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/check_config_defines.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/check_config_defines.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -#!/usr/bin/perl -# Copyright (C) 2006 Trent Piepho -# -# Look for lines in C files like "#ifdef CONFIG_SOME_KCONF_VAR" and make -# sure CONFIG_SOME_KCONF_VAR is something that exists. - -use strict; - -if($#ARGV < 0) { - print "Usage: $0 kernel_dir [files to check ...]\n\n"; - print "If no files are listed, checks all files from hg manifest\n"; - exit; -} -my $kdir = shift; - -if($#ARGV < 0) { - @ARGV = `hg manifest | cut "-d " -f3 | grep \\.[ch]\$`; - $? != 0 and die "Error getting manifest: $!"; - chomp @ARGV; -} - -my %kconfigs; # List of Kconfig files read in already -my %vars; # List of defined variables -sub readkconfig($$) -{ - my $fn = "$_[0]/$_[1]"; - # Don't read the same kconfig file more than once. This also means - # the drivers/media/Kconfig file from kernel won't be read in addition - # to the one from v4l-dvb. - return if exists $kconfigs{$_[1]}; - $kconfigs{$_[1]} = 1; -# print "Reading $fn\n"; - my $fh; - open $fh, '<', "$fn" or die "Can't read Kconfig file $fn: $!"; - while(<$fh>) { - if (/^\s*source\s+"([^"]+)"\s*$/ || /^\s*source\s+(\S+)\s*$/) { - readkconfig($_[0], $1); - } elsif(/^(?:menu)?config\s+(\w+)$/) { - $vars{"CONFIG_$1"}=1; - } - } - close $fh; -} - -readkconfig('linux', 'drivers/media/Kconfig'); -foreach(glob "$kdir/arch/*/Kconfig") { - s|^\Q$kdir/\E||; - next if(m|arch/um/Kconfig|); - readkconfig($kdir, $_); -} - -while(<>) { - if(/^\s*#ifn?def\s+(CONFIG_\w+?)(:?_MODULE)?\W*$/) { -# print "Found $1\n"; - print "Unknown config $1 in $ARGV:$.\n" unless(exists $vars{$1}); - next; - } - if(/^\s*#if/) { - $_ .= <> while(/\\$/); # Handle line continuations - my $last; - while(/defined\(\s*(CONFIG_\w+?)(_MODULE)?\s*\)/) { - $_ = $'; - next if($last eq $1); - $last = $1; - print "Unknown config $1 in $ARGV:$.\n" unless(exists $vars{$1}); - } - } -} continue { - close ARGV if eof; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/check_deps.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/check_deps.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/check_deps.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/check_deps.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2008 Mauro Carvalho Chehab - - -use strict; -use File::Find; -use Fcntl ':mode'; -use FileHandle; - -my $debug=0; - -my $SRC = 'linux'; - -my %export; - -############# -# open_makefile were adapted from analyze_build.pl -# by Copyright (C) 2006 Trent Piepho - -# Print out some extra checks of Makefile correctness -my $check = 0; - -# Root of source tree -my $root; - -# List of Makefile's opened -my %makefiles = (); - -# For each module that is made up of multiple source files, list of sources -my %multi = (); -my $multi_count = 0; - -my %config; - -my %associate; - -sub open_makefile($) { - my $file = shift; - - # only open a given Makefile once - return if exists $makefiles{$file}; - $makefiles{$file} = 1; - - $file =~ m|^(.*)/[^/]*$|; - my $dir = $1; - - print "opening $root$file (dir=$dir)\n" if ($debug > 2); - my $in = new FileHandle; - open $in, '<', "$root$file" or die "Unable to open Makefile '$root$file': $!"; - - while (<$in>) { - # print STDERR "Line: $_"; - # Skip comment and blank lines - next if (/^\s*(#.*)?$/); - m/^\s*\-?include/ and die "Can't handle includes! In $file"; - - # Handle line continuations - if (/\\\n$/) { - $_ .= <$in>; - redo; - } - # Eat line continuations in string we will parse - s/\s*\\\n\s*/ /g; - # Eat comments - s/#.*$//; - - if (/^\s*obj-(\S+)\s*([:+]?)=\s*(\S.*?)\s*$/) { - print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $2 ne '+'); - my ($var,$targets) = ($1, $3); - if ($var =~ /\$\(CONFIG_(\S+)\)$/) { - $var = $1; - } elsif ($var !~ /^[ym]$/) { - print STDERR "Confused by obj assignment '$var' in $file:$.\n$_"; - } - foreach(split(/\s+/, $targets)) { - if (m|/$|) { # Ends in /, means it's a directory - open_makefile("$dir/$_".'Makefile'); - } elsif (/^(\S+)\.o$/) { - $config{"$dir/$1"} = $var; -# printf "%s -> %s\n", $var, $1 if $debug > 1; - } else { - print STDERR "Confused by target '$_' in $file:$.\n"; - } - } - next; - } - if (/(\S+)-objs\s*([:+]?)=\s*(\S.*?)\s*$/) { - my @files = split(/\s+/, $3); - map { s|^(.*)\.o$|$dir/\1| } @files; - if ($2 eq '+') { - # Adding to files - print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); - push @files, @{$multi{"$dir/$1"}}; - } else { - print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); - } - $multi{"$dir/$1"} = \@files; - next; - } - if (/^\s*EXTRA_CFLAGS\s*([:+]?)=\s*(\S.*?)\s*$/) { - if ($check) { - sub allI { /^-I/ or return 0 foreach split(/\s+/, $_[0]);return 1; } - my $use = allI($2) ? ':' : '+'; - print STDERR "Should use '$use=' with EXTRA_CFLAGS in $file:$.\n$_\n" - if ($1 ne $use); - } - next; - } - print STDERR "Odd line $file:$.\n$_\n" if ($check); - } - close IN; -} - -# -############# - -sub associate_multi() -{ - foreach (keys %multi) { - my $name = $_; - my @files = @{$multi{$_}}; - map { s/^(.*)$/\1.c/ } @files; - - foreach (@files) { - my $file = $_; - my $var = $config{$name}; - $associate{$file} = $var; - printf "$var -> $file\n" if $debug > 1; - } - delete $config{$name}; - } - foreach my $file (keys %config) { - my $var = $config{$file}; - $file .= ".c"; - $associate{$file} = $var; - printf "$var -> $file\n" if $debug > 1; - } -} - -sub build_exported_symbol_list { - my $file = $File::Find::name; - - return if (!($file =~ /\.c$/)); - - open IN, $file; - while () { - if (m/EXPORT_SYMBOL.*\(\s*([^\s\)]+)/) { - $export{$1} = $file; - printf "%s -> %s\n", $file , $1 if $debug > 1; - } - } - close IN; -} - - -sub find_usage_list { - my %depend; - my $file = $File::Find::name; - my $s; - - return if (!($file =~ /\.c$/)); - - open IN, $file; - printf "Checking symbols at $file\n" if $debug; - while () { - foreach my $symbol (keys %export) { - my $symb_file = $export{$symbol}; - - # Doesn't search the symbol at the file that defines it - next if ($symb_file eq $file); - - if (m/($symbol)/) { - my $var = $associate{$symb_file}; - if (!$depend{$var}) { - printf "$symbol found at $file. It depends on %s\n", $associate{$symb_file} if $debug; - $depend{$var} = 1; - } - } - } - } - close IN; - - foreach (%depend) { $s .= "$_ && "; }; - $s =~ s/\&\&\ $//; - if ($s ne "") { - print $associate{$file}." depends on $s\n"; - } -} - -print < -This code is licenced under the terms of GPLv2. - -This script seeks all .c files under linux/ for their exported symbols. For -each exported symbol, it will check what Kconfig symbol is associated. Then, it -will cross-check that symbol usage and output a Kconfig depencency table. - -WARNING: The result of this tool should be used just as a hint, since, due to -performance issues, and to simplify the tool, the checks will use a simple grep -for the symbol string at the .c files, instead of a real symbol cross-check. - -Also, the same symbol may appear twice with different dependencies. This is due -to the way it checks for symbols. The final dependency is the union (AND) of -all showed ones for that symbol. - -Further patches improving this tool are welcome. - -EOL - -print "Checking makefile rules..." if $debug; -open_makefile("$SRC/drivers/media/Makefile"); -print " ok\n" if $debug; - -print "Associating symbols with c files..." if $debug; -associate_multi(); -print " ok\n" if $debug; - -print "finding exported symbols at $SRC..." if $debug; -find({wanted => \&build_exported_symbol_list, no_chdir => 1}, $SRC); -print " ok\n" if $debug; - -print "finding usage of symbols at $SRC\n" if $debug; -find({wanted => \&find_usage_list, no_chdir => 1}, $SRC); -print "finished\n" if $debug; - diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/checkpatch.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/checkpatch.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/checkpatch.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/checkpatch.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,2721 +0,0 @@ -#!/usr/bin/perl -w -# (c) 2001, Dave Jones. (the file handling bit) -# (c) 2005, Joel Schopp (the ugly bit) -# (c) 2007,2008, Andy Whitcroft (new conditions, test suite) -# (c) 2008,2009, Andy Whitcroft -# Licensed under the terms of the GNU GPL License version 2 - -use strict; - -my $P = $0; -$P =~ s@.*/@@g; - -my $V = '0.30'; - -use Getopt::Long qw(:config no_auto_abbrev); - -my $quiet = 0; -my $tree = 1; -my $chk_signoff = 1; -my $chk_patch = 1; -my $tst_only; -my $emacs = 0; -my $terse = 0; -my $file = 0; -my $check = 0; -my $summary = 1; -my $mailback = 0; -my $summary_file = 0; -my $root; -my %debug; -my $help = 0; - -sub help { - my ($exitcode) = @_; - - print << "EOM"; -Usage: $P [OPTION]... [FILE]... -Version: $V - -Options: - -q, --quiet quiet - --no-tree run without a kernel tree - --no-signoff do not check for 'Signed-off-by' line - --patch treat FILE as patchfile (default) - --emacs emacs compile window format - --terse one line per report - -f, --file treat FILE as regular source file - --subjective, --strict enable more subjective tests - --root=PATH PATH to the kernel tree root - --no-summary suppress the per-file summary - --mailback only produce a report in case of warnings/errors - --summary-file include the filename in summary - --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of - 'values', 'possible', 'type', and 'attr' (default - is all off) - --test-only=WORD report only warnings/errors containing WORD - literally - -h, --help, --version display this help and exit - -When FILE is - read standard input. -EOM - - exit($exitcode); -} - -GetOptions( - 'q|quiet+' => \$quiet, - 'tree!' => \$tree, - 'signoff!' => \$chk_signoff, - 'patch!' => \$chk_patch, - 'emacs!' => \$emacs, - 'terse!' => \$terse, - 'f|file!' => \$file, - 'subjective!' => \$check, - 'strict!' => \$check, - 'root=s' => \$root, - 'summary!' => \$summary, - 'mailback!' => \$mailback, - 'summary-file!' => \$summary_file, - - 'debug=s' => \%debug, - 'test-only=s' => \$tst_only, - 'h|help' => \$help, - 'version' => \$help -) or help(1); - -help(0) if ($help); - -my $exit = 0; - -if ($#ARGV < 0) { - print "$P: no input files\n"; - exit(1); -} - -my $dbg_values = 0; -my $dbg_possible = 0; -my $dbg_type = 0; -my $dbg_attr = 0; -for my $key (keys %debug) { - ## no critic - eval "\${dbg_$key} = '$debug{$key}';"; - die "$@" if ($@); -} - -if ($terse) { - $emacs = 1; - $quiet++; -} - -if ($tree) { - if (defined $root) { - if (!top_of_kernel_tree($root)) { - die "$P: $root: --root does not point at a valid tree\n"; - } - } else { - if (top_of_kernel_tree('.')) { - $root = '.'; - } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && - top_of_kernel_tree($1)) { - $root = $1; - } - } - - if (!defined $root) { - print "Must be run from the top-level dir. of a kernel tree\n"; - exit(2); - } -} - -my $emitted_corrupt = 0; - -our $Ident = qr{ - [A-Za-z_][A-Za-z\d_]* - (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* - }x; -our $Storage = qr{extern|static|asmlinkage}; -our $Sparse = qr{ - __user| - __kernel| - __force| - __iomem| - __must_check| - __init_refok| - __kprobes| - __ref - }x; -our $Attribute = qr{ - const| - __read_mostly| - __kprobes| - __(?:mem|cpu|dev|)(?:initdata|init)| - ____cacheline_aligned| - ____cacheline_aligned_in_smp| - ____cacheline_internodealigned_in_smp| - __weak - }x; -our $Modifier; -our $Inline = qr{inline|__always_inline|noinline}; -our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; -our $Lval = qr{$Ident(?:$Member)*}; - -our $Constant = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*}; -our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; -our $Compare = qr{<=|>=|==|!=|<|>}; -our $Operators = qr{ - <=|>=|==|!=| - =>|->|<<|>>|<|>|!|~| - &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|% - }x; - -our $NonptrType; -our $Type; -our $Declare; - -our $UTF8 = qr { - [\x09\x0A\x0D\x20-\x7E] # ASCII - | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte - | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs - | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte - | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates - | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 - | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 - | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 -}x; - -our $typeTypedefs = qr{(?x: - (?:__)?(?:u|s|be|le)(?:8|16|32|64)| - atomic_t -)}; - -our @typeList = ( - qr{void}, - qr{(?:unsigned\s+)?char}, - qr{(?:unsigned\s+)?short}, - qr{(?:unsigned\s+)?int}, - qr{(?:unsigned\s+)?long}, - qr{(?:unsigned\s+)?long\s+int}, - qr{(?:unsigned\s+)?long\s+long}, - qr{(?:unsigned\s+)?long\s+long\s+int}, - qr{unsigned}, - qr{float}, - qr{double}, - qr{bool}, - qr{struct\s+$Ident}, - qr{union\s+$Ident}, - qr{enum\s+$Ident}, - qr{${Ident}_t}, - qr{${Ident}_handler}, - qr{${Ident}_handler_fn}, -); -our @modifierList = ( - qr{fastcall}, -); - -sub build_types { - my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; - my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; - $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; - $NonptrType = qr{ - (?:$Modifier\s+|const\s+)* - (?: - (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)| - (?:$typeTypedefs\b)| - (?:${all}\b) - ) - (?:\s+$Modifier|\s+const)* - }x; - $Type = qr{ - $NonptrType - (?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)? - (?:\s+$Inline|\s+$Modifier)* - }x; - $Declare = qr{(?:$Storage\s+)?$Type}; -} -build_types(); - -$chk_signoff = 0 if ($file); - -my @dep_includes = (); -my @dep_functions = (); -my $removal = "Documentation/feature-removal-schedule.txt"; -if ($tree && -f "$root/$removal") { - open(my $REMOVE, '<', "$root/$removal") || - die "$P: $removal: open failed - $!\n"; - while (<$REMOVE>) { - if (/^Check:\s+(.*\S)/) { - for my $entry (split(/[, ]+/, $1)) { - if ($entry =~ m@include/(.*)@) { - push(@dep_includes, $1); - - } elsif ($entry !~ m@/@) { - push(@dep_functions, $entry); - } - } - } - } - close($REMOVE); -} - -my @rawlines = (); -my @lines = (); -my $vname; -for my $filename (@ARGV) { - my $FILE; - if ($file) { - open($FILE, '-|', "diff -u /dev/null $filename") || - die "$P: $filename: diff failed - $!\n"; - } elsif ($filename eq '-') { - open($FILE, '<&STDIN'); - } else { - open($FILE, '<', "$filename") || - die "$P: $filename: open failed - $!\n"; - } - if ($filename eq '-') { - $vname = 'Your patch'; - } else { - $vname = $filename; - } - while (<$FILE>) { - chomp; - push(@rawlines, $_); - } - close($FILE); - if (!process($filename)) { - $exit = 1; - } - @rawlines = (); - @lines = (); -} - -exit($exit); - -sub top_of_kernel_tree { - my ($root) = @_; - - my @tree_check = ( - "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", - "README", "Documentation", "arch", "include", "drivers", - "fs", "init", "ipc", "kernel", "lib", "scripts", - ); - - foreach my $check (@tree_check) { - if (! -e $root . '/' . $check) { - return 0; - } - } - return 1; -} - -sub expand_tabs { - my ($str) = @_; - - my $res = ''; - my $n = 0; - for my $c (split(//, $str)) { - if ($c eq "\t") { - $res .= ' '; - $n++; - for (; ($n % 8) != 0; $n++) { - $res .= ' '; - } - next; - } - $res .= $c; - $n++; - } - - return $res; -} -sub copy_spacing { - (my $res = shift) =~ tr/\t/ /c; - return $res; -} - -sub line_stats { - my ($line) = @_; - - # Drop the diff line leader and expand tabs - $line =~ s/^.//; - $line = expand_tabs($line); - - # Pick the indent from the front of the line. - my ($white) = ($line =~ /^(\s*)/); - - return (length($line), length($white)); -} - -my $sanitise_quote = ''; - -sub sanitise_line_reset { - my ($in_comment) = @_; - - if ($in_comment) { - $sanitise_quote = '*/'; - } else { - $sanitise_quote = ''; - } -} -sub sanitise_line { - my ($line) = @_; - - my $res = ''; - my $l = ''; - - my $qlen = 0; - my $off = 0; - my $c; - - # Always copy over the diff marker. - $res = substr($line, 0, 1); - - for ($off = 1; $off < length($line); $off++) { - $c = substr($line, $off, 1); - - # Comments we are wacking completly including the begin - # and end, all to $;. - if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') { - $sanitise_quote = '*/'; - - substr($res, $off, 2, "$;$;"); - $off++; - next; - } - if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { - $sanitise_quote = ''; - substr($res, $off, 2, "$;$;"); - $off++; - next; - } - if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') { - $sanitise_quote = '//'; - - substr($res, $off, 2, $sanitise_quote); - $off++; - next; - } - - # A \ in a string means ignore the next character. - if (($sanitise_quote eq "'" || $sanitise_quote eq '"') && - $c eq "\\") { - substr($res, $off, 2, 'XX'); - $off++; - next; - } - # Regular quotes. - if ($c eq "'" || $c eq '"') { - if ($sanitise_quote eq '') { - $sanitise_quote = $c; - - substr($res, $off, 1, $c); - next; - } elsif ($sanitise_quote eq $c) { - $sanitise_quote = ''; - } - } - - #print "c<$c> SQ<$sanitise_quote>\n"; - if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") { - substr($res, $off, 1, $;); - } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") { - substr($res, $off, 1, $;); - } elsif ($off != 0 && $sanitise_quote && $c ne "\t") { - substr($res, $off, 1, 'X'); - } else { - substr($res, $off, 1, $c); - } - } - - if ($sanitise_quote eq '//') { - $sanitise_quote = ''; - } - - # The pathname on a #include may be surrounded by '<' and '>'. - if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) { - my $clean = 'X' x length($1); - $res =~ s@\<.*\>@<$clean>@; - - # The whole of a #error is a string. - } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) { - my $clean = 'X' x length($1); - $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@; - } - - return $res; -} - -sub ctx_statement_block { - my ($linenr, $remain, $off) = @_; - my $line = $linenr - 1; - my $blk = ''; - my $soff = $off; - my $coff = $off - 1; - my $coff_set = 0; - - my $loff = 0; - - my $type = ''; - my $level = 0; - my @stack = (); - my $p; - my $c; - my $len = 0; - - my $remainder; - while (1) { - @stack = (['', 0]) if ($#stack == -1); - - #warn "CSB: blk<$blk> remain<$remain>\n"; - # If we are about to drop off the end, pull in more - # context. - if ($off >= $len) { - for (; $remain > 0; $line++) { - last if (!defined $lines[$line]); - next if ($lines[$line] =~ /^-/); - $remain--; - $loff = $len; - $blk .= $lines[$line] . "\n"; - $len = length($blk); - $line++; - last; - } - # Bail if there is no further context. - #warn "CSB: blk<$blk> off<$off> len<$len>\n"; - if ($off >= $len) { - last; - } - } - $p = $c; - $c = substr($blk, $off, 1); - $remainder = substr($blk, $off); - - #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n"; - - # Handle nested #if/#else. - if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) { - push(@stack, [ $type, $level ]); - } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) { - ($type, $level) = @{$stack[$#stack - 1]}; - } elsif ($remainder =~ /^#\s*endif\b/) { - ($type, $level) = @{pop(@stack)}; - } - - # Statement ends at the ';' or a close '}' at the - # outermost level. - if ($level == 0 && $c eq ';') { - last; - } - - # An else is really a conditional as long as its not else if - if ($level == 0 && $coff_set == 0 && - (!defined($p) || $p =~ /(?:\s|\}|\+)/) && - $remainder =~ /^(else)(?:\s|{)/ && - $remainder !~ /^else\s+if\b/) { - $coff = $off + length($1) - 1; - $coff_set = 1; - #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n"; - #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n"; - } - - if (($type eq '' || $type eq '(') && $c eq '(') { - $level++; - $type = '('; - } - if ($type eq '(' && $c eq ')') { - $level--; - $type = ($level != 0)? '(' : ''; - - if ($level == 0 && $coff < $soff) { - $coff = $off; - $coff_set = 1; - #warn "CSB: mark coff<$coff>\n"; - } - } - if (($type eq '' || $type eq '{') && $c eq '{') { - $level++; - $type = '{'; - } - if ($type eq '{' && $c eq '}') { - $level--; - $type = ($level != 0)? '{' : ''; - - if ($level == 0) { - last; - } - } - $off++; - } - # We are truly at the end, so shuffle to the next line. - if ($off == $len) { - $loff = $len + 1; - $line++; - $remain--; - } - - my $statement = substr($blk, $soff, $off - $soff + 1); - my $condition = substr($blk, $soff, $coff - $soff + 1); - - #warn "STATEMENT<$statement>\n"; - #warn "CONDITION<$condition>\n"; - - #print "coff<$coff> soff<$off> loff<$loff>\n"; - - return ($statement, $condition, - $line, $remain + 1, $off - $loff + 1, $level); -} - -sub statement_lines { - my ($stmt) = @_; - - # Strip the diff line prefixes and rip blank lines at start and end. - $stmt =~ s/(^|\n)./$1/g; - $stmt =~ s/^\s*//; - $stmt =~ s/\s*$//; - - my @stmt_lines = ($stmt =~ /\n/g); - - return $#stmt_lines + 2; -} - -sub statement_rawlines { - my ($stmt) = @_; - - my @stmt_lines = ($stmt =~ /\n/g); - - return $#stmt_lines + 2; -} - -sub statement_block_size { - my ($stmt) = @_; - - $stmt =~ s/(^|\n)./$1/g; - $stmt =~ s/^\s*{//; - $stmt =~ s/}\s*$//; - $stmt =~ s/^\s*//; - $stmt =~ s/\s*$//; - - my @stmt_lines = ($stmt =~ /\n/g); - my @stmt_statements = ($stmt =~ /;/g); - - my $stmt_lines = $#stmt_lines + 2; - my $stmt_statements = $#stmt_statements + 1; - - if ($stmt_lines > $stmt_statements) { - return $stmt_lines; - } else { - return $stmt_statements; - } -} - -sub ctx_statement_full { - my ($linenr, $remain, $off) = @_; - my ($statement, $condition, $level); - - my (@chunks); - - # Grab the first conditional/block pair. - ($statement, $condition, $linenr, $remain, $off, $level) = - ctx_statement_block($linenr, $remain, $off); - #print "F: c<$condition> s<$statement> remain<$remain>\n"; - push(@chunks, [ $condition, $statement ]); - if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) { - return ($level, $linenr, @chunks); - } - - # Pull in the following conditional/block pairs and see if they - # could continue the statement. - for (;;) { - ($statement, $condition, $linenr, $remain, $off, $level) = - ctx_statement_block($linenr, $remain, $off); - #print "C: c<$condition> s<$statement> remain<$remain>\n"; - last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s)); - #print "C: push\n"; - push(@chunks, [ $condition, $statement ]); - } - - return ($level, $linenr, @chunks); -} - -sub ctx_block_get { - my ($linenr, $remain, $outer, $open, $close, $off) = @_; - my $line; - my $start = $linenr - 1; - my $blk = ''; - my @o; - my @c; - my @res = (); - - my $level = 0; - my @stack = ($level); - for ($line = $start; $remain > 0; $line++) { - next if ($rawlines[$line] =~ /^-/); - $remain--; - - $blk .= $rawlines[$line]; - - # Handle nested #if/#else. - if ($rawlines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) { - push(@stack, $level); - } elsif ($rawlines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) { - $level = $stack[$#stack - 1]; - } elsif ($rawlines[$line] =~ /^.\s*#\s*endif\b/) { - $level = pop(@stack); - } - - foreach my $c (split(//, $rawlines[$line])) { - ##print "C<$c>L<$level><$open$close>O<$off>\n"; - if ($off > 0) { - $off--; - next; - } - - if ($c eq $close && $level > 0) { - $level--; - last if ($level == 0); - } elsif ($c eq $open) { - $level++; - } - } - - if (!$outer || $level <= 1) { - push(@res, $rawlines[$line]); - } - - last if ($level == 0); - } - - return ($level, @res); -} -sub ctx_block_outer { - my ($linenr, $remain) = @_; - - my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0); - return @r; -} -sub ctx_block { - my ($linenr, $remain) = @_; - - my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0); - return @r; -} -sub ctx_statement { - my ($linenr, $remain, $off) = @_; - - my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off); - return @r; -} -sub ctx_block_level { - my ($linenr, $remain) = @_; - - return ctx_block_get($linenr, $remain, 0, '{', '}', 0); -} -sub ctx_statement_level { - my ($linenr, $remain, $off) = @_; - - return ctx_block_get($linenr, $remain, 0, '(', ')', $off); -} - -sub ctx_locate_comment { - my ($first_line, $end_line) = @_; - - # Catch a comment on the end of the line itself. - my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@); - return $current_comment if (defined $current_comment); - - # Look through the context and try and figure out if there is a - # comment. - my $in_comment = 0; - $current_comment = ''; - for (my $linenr = $first_line; $linenr < $end_line; $linenr++) { - my $line = $rawlines[$linenr - 1]; - #warn " $line\n"; - if ($linenr == $first_line and $line =~ m@^.\s*\*@) { - $in_comment = 1; - } - if ($line =~ m@/\*@) { - $in_comment = 1; - } - if (!$in_comment && $current_comment ne '') { - $current_comment = ''; - } - $current_comment .= $line . "\n" if ($in_comment); - if ($line =~ m@\*/@) { - $in_comment = 0; - } - } - - chomp($current_comment); - return($current_comment); -} -sub ctx_has_comment { - my ($first_line, $end_line) = @_; - my $cmt = ctx_locate_comment($first_line, $end_line); - - ##print "LINE: $rawlines[$end_line - 1 ]\n"; - ##print "CMMT: $cmt\n"; - - return ($cmt ne ''); -} - -sub raw_line { - my ($linenr, $cnt) = @_; - - my $offset = $linenr - 1; - $cnt++; - - my $line; - while ($cnt) { - $line = $rawlines[$offset++]; - next if (defined($line) && $line =~ /^-/); - $cnt--; - } - - return $line; -} - -sub cat_vet { - my ($vet) = @_; - my ($res, $coded); - - $res = ''; - while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) { - $res .= $1; - if ($2 ne '') { - $coded = sprintf("^%c", unpack('C', $2) + 64); - $res .= $coded; - } - } - $res =~ s/$/\$/; - - return $res; -} - -my $av_preprocessor = 0; -my $av_pending; -my @av_paren_type; -my $av_pend_colon; - -sub annotate_reset { - $av_preprocessor = 0; - $av_pending = '_'; - @av_paren_type = ('E'); - $av_pend_colon = 'O'; -} - -sub annotate_values { - my ($stream, $type) = @_; - - my $res; - my $var = '_' x length($stream); - my $cur = $stream; - - print "$stream\n" if ($dbg_values > 1); - - while (length($cur)) { - @av_paren_type = ('E') if ($#av_paren_type < 0); - print " <" . join('', @av_paren_type) . - "> <$type> <$av_pending>" if ($dbg_values > 1); - if ($cur =~ /^(\s+)/o) { - print "WS($1)\n" if ($dbg_values > 1); - if ($1 =~ /\n/ && $av_preprocessor) { - $type = pop(@av_paren_type); - $av_preprocessor = 0; - } - - } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\()/) { - print "DECLARE($1)\n" if ($dbg_values > 1); - $type = 'T'; - - } elsif ($cur =~ /^($Modifier)\s*/) { - print "MODIFIER($1)\n" if ($dbg_values > 1); - $type = 'T'; - - } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) { - print "DEFINE($1,$2)\n" if ($dbg_values > 1); - $av_preprocessor = 1; - push(@av_paren_type, $type); - if ($2 ne '') { - $av_pending = 'N'; - } - $type = 'E'; - - } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) { - print "UNDEF($1)\n" if ($dbg_values > 1); - $av_preprocessor = 1; - push(@av_paren_type, $type); - - } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) { - print "PRE_START($1)\n" if ($dbg_values > 1); - $av_preprocessor = 1; - - push(@av_paren_type, $type); - push(@av_paren_type, $type); - $type = 'E'; - - } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) { - print "PRE_RESTART($1)\n" if ($dbg_values > 1); - $av_preprocessor = 1; - - push(@av_paren_type, $av_paren_type[$#av_paren_type]); - - $type = 'E'; - - } elsif ($cur =~ /^(\#\s*(?:endif))/o) { - print "PRE_END($1)\n" if ($dbg_values > 1); - - $av_preprocessor = 1; - - # Assume all arms of the conditional end as this - # one does, and continue as if the #endif was not here. - pop(@av_paren_type); - push(@av_paren_type, $type); - $type = 'E'; - - } elsif ($cur =~ /^(\\\n)/o) { - print "PRECONT($1)\n" if ($dbg_values > 1); - - } elsif ($cur =~ /^(__attribute__)\s*\(?/o) { - print "ATTR($1)\n" if ($dbg_values > 1); - $av_pending = $type; - $type = 'N'; - - } elsif ($cur =~ /^(sizeof)\s*(\()?/o) { - print "SIZEOF($1)\n" if ($dbg_values > 1); - if (defined $2) { - $av_pending = 'V'; - } - $type = 'N'; - - } elsif ($cur =~ /^(if|while|for)\b/o) { - print "COND($1)\n" if ($dbg_values > 1); - $av_pending = 'E'; - $type = 'N'; - - } elsif ($cur =~/^(case)/o) { - print "CASE($1)\n" if ($dbg_values > 1); - $av_pend_colon = 'C'; - $type = 'N'; - - } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) { - print "KEYWORD($1)\n" if ($dbg_values > 1); - $type = 'N'; - - } elsif ($cur =~ /^(\()/o) { - print "PAREN('$1')\n" if ($dbg_values > 1); - push(@av_paren_type, $av_pending); - $av_pending = '_'; - $type = 'N'; - - } elsif ($cur =~ /^(\))/o) { - my $new_type = pop(@av_paren_type); - if ($new_type ne '_') { - $type = $new_type; - print "PAREN('$1') -> $type\n" - if ($dbg_values > 1); - } else { - print "PAREN('$1')\n" if ($dbg_values > 1); - } - - } elsif ($cur =~ /^($Ident)\s*\(/o) { - print "FUNC($1)\n" if ($dbg_values > 1); - $type = 'V'; - $av_pending = 'V'; - - } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) { - if (defined $2 && $type eq 'C' || $type eq 'T') { - $av_pend_colon = 'B'; - } elsif ($type eq 'E') { - $av_pend_colon = 'L'; - } - print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1); - $type = 'V'; - - } elsif ($cur =~ /^($Ident|$Constant)/o) { - print "IDENT($1)\n" if ($dbg_values > 1); - $type = 'V'; - - } elsif ($cur =~ /^($Assignment)/o) { - print "ASSIGN($1)\n" if ($dbg_values > 1); - $type = 'N'; - - } elsif ($cur =~/^(;|{|})/) { - print "END($1)\n" if ($dbg_values > 1); - $type = 'E'; - $av_pend_colon = 'O'; - - } elsif ($cur =~/^(,)/) { - print "COMMA($1)\n" if ($dbg_values > 1); - $type = 'C'; - - } elsif ($cur =~ /^(\?)/o) { - print "QUESTION($1)\n" if ($dbg_values > 1); - $type = 'N'; - - } elsif ($cur =~ /^(:)/o) { - print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1); - - substr($var, length($res), 1, $av_pend_colon); - if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') { - $type = 'E'; - } else { - $type = 'N'; - } - $av_pend_colon = 'O'; - - } elsif ($cur =~ /^(\[)/o) { - print "CLOSE($1)\n" if ($dbg_values > 1); - $type = 'N'; - - } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) { - my $variant; - - print "OPV($1)\n" if ($dbg_values > 1); - if ($type eq 'V') { - $variant = 'B'; - } else { - $variant = 'U'; - } - - substr($var, length($res), 1, $variant); - $type = 'N'; - - } elsif ($cur =~ /^($Operators)/o) { - print "OP($1)\n" if ($dbg_values > 1); - if ($1 ne '++' && $1 ne '--') { - $type = 'N'; - } - - } elsif ($cur =~ /(^.)/o) { - print "C($1)\n" if ($dbg_values > 1); - } - if (defined $1) { - $cur = substr($cur, length($1)); - $res .= $type x length($1); - } - } - - return ($res, $var); -} - -sub possible { - my ($possible, $line) = @_; - my $notPermitted = qr{(?: - ^(?: - $Modifier| - $Storage| - $Type| - DEFINE_\S+ - )$| - ^(?: - goto| - return| - case| - else| - asm|__asm__| - do - )(?:\s|$)| - ^(?:typedef|struct|enum)\b - )}x; - warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); - if ($possible !~ $notPermitted) { - # Check for modifiers. - $possible =~ s/\s*$Storage\s*//g; - $possible =~ s/\s*$Sparse\s*//g; - if ($possible =~ /^\s*$/) { - - } elsif ($possible =~ /\s/) { - $possible =~ s/\s*$Type\s*//g; - for my $modifier (split(' ', $possible)) { - if ($modifier !~ $notPermitted) { - warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); - push(@modifierList, $modifier); - } - } - - } else { - warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); - push(@typeList, $possible); - } - build_types(); - } else { - warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1); - } -} - -my $prefix = ''; - -sub report { - if (defined $tst_only && $_[0] !~ /\Q$tst_only\E/) { - return 0; - } - my $line = $prefix . $_[0]; - - $line = (split('\n', $line))[0] . "\n" if ($terse); - - push(our @report, $line); - - return 1; -} -sub report_dump { - our @report; -} -sub ERROR { - if (report("ERROR: $_[0]\n")) { - our $clean = 0; - our $cnt_error++; - } -} -sub WARN { - if (report("WARNING: $_[0]\n")) { - our $clean = 0; - our $cnt_warn++; - } -} -sub CHK { - if ($check && report("CHECK: $_[0]\n")) { - our $clean = 0; - our $cnt_chk++; - } -} - -sub check_absolute_file { - my ($absolute, $herecurr) = @_; - my $file = $absolute; - - ##print "absolute<$absolute>\n"; - - # See if any suffix of this path is a path within the tree. - while ($file =~ s@^[^/]*/@@) { - if (-f "$root/$file") { - ##print "file<$file>\n"; - last; - } - } - if (! -f _) { - return 0; - } - - # It is, so see if the prefix is acceptable. - my $prefix = $absolute; - substr($prefix, -length($file)) = ''; - - ##print "prefix<$prefix>\n"; - if ($prefix ne ".../") { - WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr); - } -} - -sub process { - my $filename = shift; - - my $linenr=0; - my $prevline=""; - my $prevrawline=""; - my $stashline=""; - my $stashrawline=""; - - my $length; - my $indent; - my $previndent=0; - my $stashindent=0; - - our $clean = 1; - my $signoff = 0; - my $is_patch = 0; - - our @report = (); - our $cnt_lines = 0; - our $cnt_error = 0; - our $cnt_warn = 0; - our $cnt_chk = 0; - - # Trace the real file/line as we go. - my $realfile = ''; - my $realline = 0; - my $realcnt = 0; - my $here = ''; - my $in_comment = 0; - my $comment_edge = 0; - my $first_line = 0; - my $p1_prefix = ''; - - my $prev_values = 'E'; - - # suppression flags - my %suppress_ifbraces; - my %suppress_whiletrailers; - my %suppress_export; - - # Pre-scan the patch sanitizing the lines. - # Pre-scan the patch looking for any __setup documentation. - # - my @setup_docs = (); - my $setup_docs = 0; - - sanitise_line_reset(); - my $line; - foreach my $rawline (@rawlines) { - $linenr++; - $line = $rawline; - - if ($rawline=~/^\+\+\+\s+(\S+)/) { - $setup_docs = 0; - if ($1 =~ m@Documentation/kernel-parameters.txt$@) { - $setup_docs = 1; - } - #next; - } - if ($rawline=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { - $realline=$1-1; - if (defined $2) { - $realcnt=$3+1; - } else { - $realcnt=1+1; - } - $in_comment = 0; - - # Guestimate if this is a continuing comment. Run - # the context looking for a comment "edge". If this - # edge is a close comment then we must be in a comment - # at context start. - my $edge; - my $cnt = $realcnt; - for (my $ln = $linenr + 1; $cnt > 0; $ln++) { - next if (defined $rawlines[$ln - 1] && - $rawlines[$ln - 1] =~ /^-/); - $cnt--; - #print "RAW<$rawlines[$ln - 1]>\n"; - last if (!defined $rawlines[$ln - 1]); - if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ && - $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) { - ($edge) = $1; - last; - } - } - if (defined $edge && $edge eq '*/') { - $in_comment = 1; - } - - # Guestimate if this is a continuing comment. If this - # is the start of a diff block and this line starts - # ' *' then it is very likely a comment. - if (!defined $edge && - $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@) - { - $in_comment = 1; - } - - ##print "COMMENT:$in_comment edge<$edge> $rawline\n"; - sanitise_line_reset($in_comment); - - } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) { - # Standardise the strings and chars within the input to - # simplify matching -- only bother with positive lines. - $line = sanitise_line($rawline); - } - push(@lines, $line); - - if ($realcnt > 1) { - $realcnt-- if ($line =~ /^(?:\+| |$)/); - } else { - $realcnt = 0; - } - - #print "==>$rawline\n"; - #print "-->$line\n"; - - if ($setup_docs && $line =~ /^\+/) { - push(@setup_docs, $line); - } - } - - $prefix = ''; - - $realcnt = 0; - $linenr = 0; - foreach my $line (@lines) { - $linenr++; - - my $rawline = $rawlines[$linenr - 1]; - -#extract the line range in the file after the patch is applied - if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { - $is_patch = 1; - $first_line = $linenr + 1; - $realline=$1-1; - if (defined $2) { - $realcnt=$3+1; - } else { - $realcnt=1+1; - } - annotate_reset(); - $prev_values = 'E'; - - %suppress_ifbraces = (); - %suppress_whiletrailers = (); - %suppress_export = (); - next; - -# track the line number as we move through the hunk, note that -# new versions of GNU diff omit the leading space on completely -# blank context lines so we need to count that too. - } elsif ($line =~ /^( |\+|$)/) { - $realline++; - $realcnt-- if ($realcnt != 0); - - # Measure the line length and indent. - ($length, $indent) = line_stats($rawline); - - # Track the previous line. - ($prevline, $stashline) = ($stashline, $line); - ($previndent, $stashindent) = ($stashindent, $indent); - ($prevrawline, $stashrawline) = ($stashrawline, $rawline); - - #warn "line<$line>\n"; - - } elsif ($realcnt == 1) { - $realcnt--; - } - - my $hunk_line = ($realcnt != 0); - -#make up the handle for any error we report on this line - $prefix = "$filename:$realline: " if ($emacs && $file); - $prefix = "$filename:$linenr: " if ($emacs && !$file); - - $here = "#$linenr: " if (!$file); - $here = "#$realline: " if ($file); - - # extract the filename as it passes - if ($line=~/^\+\+\+\s+(\S+)/) { - $realfile = $1; - $realfile =~ s@^([^/]*)/@@; - - $p1_prefix = $1; - if (!$file && $tree && $p1_prefix ne '' && - -e "$root/$p1_prefix") { - WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); - } - - if ($realfile =~ m@^include/asm/@) { - ERROR("do not modify files in include/asm, change architecture specific files in include/asm-\n" . "$here$rawline\n"); - } - next; - } - - $here .= "FILE: $realfile:$realline:" if ($realcnt != 0); - - my $hereline = "$here\n$rawline\n"; - my $herecurr = "$here\n$rawline\n"; - my $hereprev = "$here\n$prevrawline\n$rawline\n"; - - $cnt_lines++ if ($realcnt != 0); - -#check the patch for a signoff: - if ($line =~ /^\s*signed-off-by:/i) { - # This is a signoff, if ugly, so do not double report. - $signoff++; - if (!($line =~ /^\s*Signed-off-by:/)) { - WARN("Signed-off-by: is the preferred form\n" . - $herecurr); - } - if ($line =~ /^\s*signed-off-by:\S/i) { - WARN("space required after Signed-off-by:\n" . - $herecurr); - } - } - -# Check for wrappage within a valid hunk of the file - if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { - ERROR("patch seems to be corrupt (line wrapped?)\n" . - $herecurr) if (!$emitted_corrupt++); - } - -# Check for absolute kernel paths. - if ($tree) { - while ($line =~ m{(?:^|\s)(/\S*)}g) { - my $file = $1; - - if ($file =~ m{^(.*?)(?::\d+)+:?$} && - check_absolute_file($1, $herecurr)) { - # - } else { - check_absolute_file($file, $herecurr); - } - } - } - -# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php - if (($realfile =~ /^$/ || $line =~ /^\+/) && - $rawline !~ m/^$UTF8*$/) { - my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/); - - my $blank = copy_spacing($rawline); - my $ptr = substr($blank, 0, length($utf8_prefix)) . "^"; - my $hereptr = "$hereline$ptr\n"; - - ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); - } - -# ignore non-hunk lines and lines being removed - next if (!$hunk_line || $line =~ /^-/); - -#trailing whitespace - if ($line =~ /^\+.*\015/) { - my $herevet = "$here\n" . cat_vet($rawline) . "\n"; - ERROR("DOS line endings\n" . $herevet); - - } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) { - my $herevet = "$here\n" . cat_vet($rawline) . "\n"; - ERROR("trailing whitespace\n" . $herevet); - } - -# check we are in a valid source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); - -#80 column limit - if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && - $rawline !~ /^.\s*\*\s*\@$Ident\s/ && - $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ && - $length > 80) - { - WARN("line over 80 characters\n" . $herecurr); - } - -# check for adding lines without a newline. - if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { - WARN("adding a line without newline at end of file\n" . $herecurr); - } - -# Blackfin: use hi/lo macros - if ($realfile =~ m@arch/blackfin/.*\.S$@) { - if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) { - my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet); - } - if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) { - my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("use the HI() macro, not (... >> 16)\n" . $herevet); - } - } - -# check we are in a valid source file C or perl if not then ignore this hunk - next if ($realfile !~ /\.(h|c|pl)$/); - -# at the beginning of a line any tabs must come first and anything -# more than 8 must use tabs. - if ($rawline =~ /^\+\s* \t\s*\S/ || - $rawline =~ /^\+\s* \s*/) { - my $herevet = "$here\n" . cat_vet($rawline) . "\n"; - ERROR("code indent should use tabs where possible\n" . $herevet); - } - -# check we are in a valid C source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c)$/); - -# check for RCS/CVS revision markers - if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { - WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr); - } - -# Blackfin: don't use __builtin_bfin_[cs]sync - if ($line =~ /__builtin_bfin_csync/) { - my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet); - } - if ($line =~ /__builtin_bfin_ssync/) { - my $herevet = "$here\n" . cat_vet($line) . "\n"; - ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet); - } - -# Check for potential 'bare' types - my ($stat, $cond, $line_nr_next, $remain_next, $off_next, - $realline_next); - if ($realcnt && $line =~ /.\s*\S/) { - ($stat, $cond, $line_nr_next, $remain_next, $off_next) = - ctx_statement_block($linenr, $realcnt, 0); - $stat =~ s/\n./\n /g; - $cond =~ s/\n./\n /g; - - # Find the real next line. - $realline_next = $line_nr_next; - if (defined $realline_next && - (!defined $lines[$realline_next - 1] || - substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) { - $realline_next++; - } - - my $s = $stat; - $s =~ s/{.*$//s; - - # Ignore goto labels. - if ($s =~ /$Ident:\*$/s) { - - # Ignore functions being called - } elsif ($s =~ /^.\s*$Ident\s*\(/s) { - - } elsif ($s =~ /^.\s*else\b/s) { - - # declarations always start with types - } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) { - my $type = $1; - $type =~ s/\s+/ /g; - possible($type, "A:" . $s); - - # definitions in global scope can only start with types - } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) { - possible($1, "B:" . $s); - } - - # any (foo ... *) is a pointer cast, and foo is a type - while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) { - possible($1, "C:" . $s); - } - - # Check for any sort of function declaration. - # int foo(something bar, other baz); - # void (*store_gdt)(x86_descr_ptr *); - if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) { - my ($name_len) = length($1); - - my $ctx = $s; - substr($ctx, 0, $name_len + 1, ''); - $ctx =~ s/\)[^\)]*$//; - - for my $arg (split(/\s*,\s*/, $ctx)) { - if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) { - - possible($1, "D:" . $s); - } - } - } - - } - -# -# Checks which may be anchored in the context. -# - -# Check for switch () and associated case and default -# statements should be at the same indent. - if ($line=~/\bswitch\s*\(.*\)/) { - my $err = ''; - my $sep = ''; - my @ctx = ctx_block_outer($linenr, $realcnt); - shift(@ctx); - for my $ctx (@ctx) { - my ($clen, $cindent) = line_stats($ctx); - if ($ctx =~ /^\+\s*(case\s+|default:)/ && - $indent != $cindent) { - $err .= "$sep$ctx\n"; - $sep = ''; - } else { - $sep = "[...]\n"; - } - } - if ($err ne '') { - ERROR("switch and case should be at the same indent\n$hereline$err"); - } - } - -# if/while/etc brace do not go on next line, unless defining a do while loop, -# or if that brace on the next line is for something else - if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { - my $pre_ctx = "$1$2"; - - my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); - my $ctx_cnt = $realcnt - $#ctx - 1; - my $ctx = join("\n", @ctx); - - my $ctx_ln = $linenr; - my $ctx_skip = $realcnt; - - while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt && - defined $lines[$ctx_ln - 1] && - $lines[$ctx_ln - 1] =~ /^-/)) { - ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n"; - $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/); - $ctx_ln++; - } - - #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; - #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; - - if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { - ERROR("that open brace { should be on the previous line\n" . - "$here\n$ctx\n$lines[$ctx_ln - 1]\n"); - } - if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ && - $ctx =~ /\)\s*\;\s*$/ && - defined $lines[$ctx_ln - 1]) - { - my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]); - if ($nindent > $indent) { - WARN("trailing semicolon indicates no statements, indent implies otherwise\n" . - "$here\n$ctx\n$lines[$ctx_ln - 1]\n"); - } - } - } - -# Check relative indent for conditionals and blocks. - if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { - my ($s, $c) = ($stat, $cond); - - substr($s, 0, length($c), ''); - - # Make sure we remove the line prefixes as we have - # none on the first line, and are going to readd them - # where necessary. - $s =~ s/\n./\n/gs; - - # Find out how long the conditional actually is. - my @newlines = ($c =~ /\n/gs); - my $cond_lines = 1 + $#newlines; - - # We want to check the first line inside the block - # starting at the end of the conditional, so remove: - # 1) any blank line termination - # 2) any opening brace { on end of the line - # 3) any do (...) { - my $continuation = 0; - my $check = 0; - $s =~ s/^.*\bdo\b//; - $s =~ s/^\s*{//; - if ($s =~ s/^\s*\\//) { - $continuation = 1; - } - if ($s =~ s/^\s*?\n//) { - $check = 1; - $cond_lines++; - } - - # Also ignore a loop construct at the end of a - # preprocessor statement. - if (($prevline =~ /^.\s*#\s*define\s/ || - $prevline =~ /\\\s*$/) && $continuation == 0) { - $check = 0; - } - - my $cond_ptr = -1; - $continuation = 0; - while ($cond_ptr != $cond_lines) { - $cond_ptr = $cond_lines; - - # If we see an #else/#elif then the code - # is not linear. - if ($s =~ /^\s*\#\s*(?:else|elif)/) { - $check = 0; - } - - # Ignore: - # 1) blank lines, they should be at 0, - # 2) preprocessor lines, and - # 3) labels. - if ($continuation || - $s =~ /^\s*?\n/ || - $s =~ /^\s*#\s*?/ || - $s =~ /^\s*$Ident\s*:/) { - $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; - if ($s =~ s/^.*?\n//) { - $cond_lines++; - } - } - } - - my (undef, $sindent) = line_stats("+" . $s); - my $stat_real = raw_line($linenr, $cond_lines); - - # Check if either of these lines are modified, else - # this is not this patch's fault. - if (!defined($stat_real) || - $stat !~ /^\+/ && $stat_real !~ /^\+/) { - $check = 0; - } - if (defined($stat_real) && $cond_lines > 1) { - $stat_real = "[...]\n$stat_real"; - } - - #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n"; - - if ($check && (($sindent % 8) != 0 || - ($sindent <= $indent && $s ne ''))) { - WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); - } - } - - # Track the 'values' across context and added lines. - my $opline = $line; $opline =~ s/^./ /; - my ($curr_values, $curr_vars) = - annotate_values($opline . "\n", $prev_values); - $curr_values = $prev_values . $curr_values; - if ($dbg_values) { - my $outline = $opline; $outline =~ s/\t/ /g; - print "$linenr > .$outline\n"; - print "$linenr > $curr_values\n"; - print "$linenr > $curr_vars\n"; - } - $prev_values = substr($curr_values, -1); - -#ignore lines not being added - if ($line=~/^[^\+]/) {next;} - -# TEST: allow direct testing of the type matcher. - if ($dbg_type) { - if ($line =~ /^.\s*$Declare\s*$/) { - ERROR("TEST: is type\n" . $herecurr); - } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { - ERROR("TEST: is not type ($1 is)\n". $herecurr); - } - next; - } -# TEST: allow direct testing of the attribute matcher. - if ($dbg_attr) { - if ($line =~ /^.\s*$Modifier\s*$/) { - ERROR("TEST: is attr\n" . $herecurr); - } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { - ERROR("TEST: is not attr ($1 is)\n". $herecurr); - } - next; - } - -# check for initialisation to aggregates open brace on the next line - if ($line =~ /^.\s*{/ && - $prevline =~ /(?:^|[^=])=\s*$/) { - ERROR("that open brace { should be on the previous line\n" . $hereprev); - } - -# -# Checks which are anchored on the added line. -# - -# check for malformed paths in #include statements (uses RAW line) - if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) { - my $path = $1; - if ($path =~ m{//}) { - ERROR("malformed #include filename\n" . - $herecurr); - } - } - -# no C99 // comments - if ($line =~ m{//}) { - ERROR("do not use C99 // comments\n" . $herecurr); - } - # Remove C99 comments. - $line =~ s@//.*@@; - $opline =~ s@//.*@@; - -# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider -# the whole statement. -#print "APW <$lines[$realline_next - 1]>\n"; - if (defined $realline_next && - exists $lines[$realline_next - 1] && - !defined $suppress_export{$realline_next} && - ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ || - $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { - my $name = $1; - if ($stat !~ /(?: - \n.}\s*$| - ^.DEFINE_$Ident\(\Q$name\E\)| - ^.DECLARE_$Ident\(\Q$name\E\)| - ^.LIST_HEAD\(\Q$name\E\)| - ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| - \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() - )/x) { -#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n"; - $suppress_export{$realline_next} = 2; - } else { - $suppress_export{$realline_next} = 1; - } - } - if (!defined $suppress_export{$linenr} && - $prevline =~ /^.\s*$/ && - ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ || - $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { -#print "FOO B <$lines[$linenr - 1]>\n"; - $suppress_export{$linenr} = 2; - } - if (defined $suppress_export{$linenr} && - $suppress_export{$linenr} == 2) { - WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); - } - -# check for external initialisers. - if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) { - ERROR("do not initialise externals to 0 or NULL\n" . - $herecurr); - } -# check for static initialisers. - if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { - ERROR("do not initialise statics to 0 or NULL\n" . - $herecurr); - } - -# check for new typedefs, only function parameters and sparse annotations -# make sense. - if ($line =~ /\btypedef\s/ && - $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ && - $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && - $line !~ /\b$typeTypedefs\b/ && - $line !~ /\b__bitwise(?:__|)\b/) { - WARN("do not add new typedefs\n" . $herecurr); - } - -# * goes on variable not on type - # (char*[ const]) - if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) { - my ($from, $to) = ($1, $1); - - # Should start with a space. - $to =~ s/^(\S)/ $1/; - # Should not end with a space. - $to =~ s/\s+$//; - # '*'s should not have spaces between. - while ($to =~ s/\*\s+\*/\*\*/) { - } - - #print "from<$from> to<$to>\n"; - if ($from ne $to) { - ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); - } - } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { - my ($from, $to, $ident) = ($1, $1, $2); - - # Should start with a space. - $to =~ s/^(\S)/ $1/; - # Should not end with a space. - $to =~ s/\s+$//; - # '*'s should not have spaces between. - while ($to =~ s/\*\s+\*/\*\*/) { - } - # Modifiers should have spaces. - $to =~ s/(\b$Modifier$)/$1 /; - - #print "from<$from> to<$to> ident<$ident>\n"; - if ($from ne $to && $ident !~ /^$Modifier$/) { - ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr); - } - } - -# # no BUG() or BUG_ON() -# if ($line =~ /\b(BUG|BUG_ON)\b/) { -# print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n"; -# print "$herecurr"; -# $clean = 0; -# } - - if ($line =~ /\bLINUX_VERSION_CODE\b/) { - WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); - } - -# printk should use KERN_* levels. Note that follow on printk's on the -# same line do not need a level, so we use the current block context -# to try and find and validate the current printk. In summary the current -# printk includes all preceeding printk's which have no newline on the end. -# we assume the first bad printk is the one to report. - if ($line =~ /\bprintk\((?!KERN_)\s*"/) { - my $ok = 0; - for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) { - #print "CHECK<$lines[$ln - 1]\n"; - # we have a preceeding printk if it ends - # with "\n" ignore it, else it is to blame - if ($lines[$ln - 1] =~ m{\bprintk\(}) { - if ($rawlines[$ln - 1] !~ m{\\n"}) { - $ok = 1; - } - last; - } - } - if ($ok == 0) { - WARN("printk() should include KERN_ facility level\n" . $herecurr); - } - } - -# function brace can't be on same line, except for #defines of do while, -# or if closed on same line - if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and - !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) { - ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); - } - -# open braces for enum, union and struct go on the same line. - if ($line =~ /^.\s*{/ && - $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { - ERROR("open brace '{' following $1 go on the same line\n" . $hereprev); - } - -# check for spacing round square brackets; allowed: -# 1. with a type on the left -- int [] a; -# 2. at the beginning of a line for slice initialisers -- [0...10] = 5, -# 3. inside a curly brace -- = { [0...10] = 5 } - while ($line =~ /(.*?\s)\[/g) { - my ($where, $prefix) = ($-[1], $1); - if ($prefix !~ /$Type\s+$/ && - ($where != 0 || $prefix !~ /^.\s+$/) && - $prefix !~ /{\s+$/) { - ERROR("space prohibited before open square bracket '['\n" . $herecurr); - } - } - -# check for spaces between functions and their parentheses. - while ($line =~ /($Ident)\s+\(/g) { - my $name = $1; - my $ctx_before = substr($line, 0, $-[1]); - my $ctx = "$ctx_before$name"; - - # Ignore those directives where spaces _are_ permitted. - if ($name =~ /^(?: - if|for|while|switch|return|case| - volatile|__volatile__| - __attribute__|format|__extension__| - asm|__asm__)$/x) - { - - # cpp #define statements have non-optional spaces, ie - # if there is a space between the name and the open - # parenthesis it is simply not a parameter group. - } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) { - - # cpp #elif statement condition may start with a ( - } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) { - - # If this whole things ends with a type its most - # likely a typedef for a function. - } elsif ($ctx =~ /$Type$/) { - - } else { - WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr); - } - } -# Check operator spacing. - if (!($line=~/\#\s*include/)) { - my $ops = qr{ - <<=|>>=|<=|>=|==|!=| - \+=|-=|\*=|\/=|%=|\^=|\|=|&=| - =>|->|<<|>>|<|>|=|!|~| - &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%| - \?|: - }x; - my @elements = split(/($ops|;)/, $opline); - my $off = 0; - - my $blank = copy_spacing($opline); - - for (my $n = 0; $n < $#elements; $n += 2) { - $off += length($elements[$n]); - - # Pick up the preceeding and succeeding characters. - my $ca = substr($opline, 0, $off); - my $cc = ''; - if (length($opline) >= ($off + length($elements[$n + 1]))) { - $cc = substr($opline, $off + length($elements[$n + 1])); - } - my $cb = "$ca$;$cc"; - - my $a = ''; - $a = 'V' if ($elements[$n] ne ''); - $a = 'W' if ($elements[$n] =~ /\s$/); - $a = 'C' if ($elements[$n] =~ /$;$/); - $a = 'B' if ($elements[$n] =~ /(\[|\()$/); - $a = 'O' if ($elements[$n] eq ''); - $a = 'E' if ($ca =~ /^\s*$/); - - my $op = $elements[$n + 1]; - - my $c = ''; - if (defined $elements[$n + 2]) { - $c = 'V' if ($elements[$n + 2] ne ''); - $c = 'W' if ($elements[$n + 2] =~ /^\s/); - $c = 'C' if ($elements[$n + 2] =~ /^$;/); - $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); - $c = 'O' if ($elements[$n + 2] eq ''); - $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/); - } else { - $c = 'E'; - } - - my $ctx = "${a}x${c}"; - - my $at = "(ctx:$ctx)"; - - my $ptr = substr($blank, 0, $off) . "^"; - my $hereptr = "$hereline$ptr\n"; - - # Pull out the value of this operator. - my $op_type = substr($curr_values, $off + 1, 1); - - # Get the full operator variant. - my $opv = $op . substr($curr_vars, $off, 1); - - # Ignore operators passed as parameters. - if ($op_type ne 'V' && - $ca =~ /\s$/ && $cc =~ /^\s*,/) { - -# # Ignore comments -# } elsif ($op =~ /^$;+$/) { - - # ; should have either the end of line or a space or \ after it - } elsif ($op eq ';') { - if ($ctx !~ /.x[WEBC]/ && - $cc !~ /^\\/ && $cc !~ /^;/) { - ERROR("space required after that '$op' $at\n" . $hereptr); - } - - # // is a comment - } elsif ($op eq '//') { - - # No spaces for: - # -> - # : when part of a bitfield - } elsif ($op eq '->' || $opv eq ':B') { - if ($ctx =~ /Wx.|.xW/) { - ERROR("spaces prohibited around that '$op' $at\n" . $hereptr); - } - - # , must have a space on the right. - } elsif ($op eq ',') { - if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { - ERROR("space required after that '$op' $at\n" . $hereptr); - } - - # '*' as part of a type definition -- reported already. - } elsif ($opv eq '*_') { - #warn "'*' is part of type\n"; - - # unary operators should have a space before and - # none after. May be left adjacent to another - # unary operator, or a cast - } elsif ($op eq '!' || $op eq '~' || - $opv eq '*U' || $opv eq '-U' || - $opv eq '&U' || $opv eq '&&U') { - if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { - ERROR("space required before that '$op' $at\n" . $hereptr); - } - if ($op eq '*' && $cc =~/\s*$Modifier\b/) { - # A unary '*' may be const - - } elsif ($ctx =~ /.xW/) { - ERROR("space prohibited after that '$op' $at\n" . $hereptr); - } - - # unary ++ and unary -- are allowed no space on one side. - } elsif ($op eq '++' or $op eq '--') { - if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) { - ERROR("space required one side of that '$op' $at\n" . $hereptr); - } - if ($ctx =~ /Wx[BE]/ || - ($ctx =~ /Wx./ && $cc =~ /^;/)) { - ERROR("space prohibited before that '$op' $at\n" . $hereptr); - } - if ($ctx =~ /ExW/) { - ERROR("space prohibited after that '$op' $at\n" . $hereptr); - } - - - # << and >> may either have or not have spaces both sides - } elsif ($op eq '<<' or $op eq '>>' or - $op eq '&' or $op eq '^' or $op eq '|' or - $op eq '+' or $op eq '-' or - $op eq '*' or $op eq '/' or - $op eq '%') - { - if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { - ERROR("need consistent spacing around '$op' $at\n" . - $hereptr); - } - - # A colon needs no spaces before when it is - # terminating a case value or a label. - } elsif ($opv eq ':C' || $opv eq ':L') { - if ($ctx =~ /Wx./) { - ERROR("space prohibited before that '$op' $at\n" . $hereptr); - } - - # All the others need spaces both sides. - } elsif ($ctx !~ /[EWC]x[CWE]/) { - my $ok = 0; - - # Ignore email addresses - if (($op eq '<' && - $cc =~ /^\S+\@\S+>/) || - ($op eq '>' && - $ca =~ /<\S+\@\S+$/)) - { - $ok = 1; - } - - # Ignore ?: - if (($opv eq ':O' && $ca =~ /\?$/) || - ($op eq '?' && $cc =~ /^:/)) { - $ok = 1; - } - - if ($ok == 0) { - ERROR("spaces required around that '$op' $at\n" . $hereptr); - } - } - $off += length($elements[$n + 1]); - } - } - -# check for multiple assignments - if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { - CHK("multiple assignments should be avoided\n" . $herecurr); - } - -## # check for multiple declarations, allowing for a function declaration -## # continuation. -## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && -## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { -## -## # Remove any bracketed sections to ensure we do not -## # falsly report the parameters of functions. -## my $ln = $line; -## while ($ln =~ s/\([^\(\)]*\)//g) { -## } -## if ($ln =~ /,/) { -## WARN("declaring multiple variables together should be avoided\n" . $herecurr); -## } -## } - -#need space before brace following if, while, etc - if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || - $line =~ /do{/) { - ERROR("space required before the open brace '{'\n" . $herecurr); - } - -# closing brace should have a space following it when it has anything -# on the line - if ($line =~ /}(?!(?:,|;|\)))\S/) { - ERROR("space required after that close brace '}'\n" . $herecurr); - } - -# check spacing on square brackets - if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { - ERROR("space prohibited after that open square bracket '['\n" . $herecurr); - } - if ($line =~ /\s\]/) { - ERROR("space prohibited before that close square bracket ']'\n" . $herecurr); - } - -# check spacing on parentheses - if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && - $line !~ /for\s*\(\s+;/) { - ERROR("space prohibited after that open parenthesis '('\n" . $herecurr); - } - if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && - $line !~ /for\s*\(.*;\s+\)/ && - $line !~ /:\s+\)/) { - ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr); - } - -#goto labels aren't indented, allow a single space however - if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and - !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { - WARN("labels should not be indented\n" . $herecurr); - } - -# Return is not a function. - if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) { - my $spacing = $1; - my $value = $2; - - # Flatten any parentheses - $value =~ s/\)\(/\) \(/g; - while ($value =~ s/\[[^\{\}]*\]/1/ || - $value !~ /(?:$Ident|-?$Constant)\s* - $Compare\s* - (?:$Ident|-?$Constant)/x && - $value =~ s/\([^\(\)]*\)/1/) { - } - - if ($value =~ /^(?:$Ident|-?$Constant)$/) { - ERROR("return is not a function, parentheses are not required\n" . $herecurr); - - } elsif ($spacing !~ /\s+/) { - ERROR("space required before the open parenthesis '('\n" . $herecurr); - } - } - -# Need a space before open parenthesis after if, while etc - if ($line=~/\b(if|while|for|switch)\(/) { - ERROR("space required before the open parenthesis '('\n" . $herecurr); - } - -# Check for illegal assignment in if conditional -- and check for trailing -# statements after the conditional. - if ($line =~ /do\s*(?!{)/) { - my ($stat_next) = ctx_statement_block($line_nr_next, - $remain_next, $off_next); - $stat_next =~ s/\n./\n /g; - ##print "stat<$stat> stat_next<$stat_next>\n"; - - if ($stat_next =~ /^\s*while\b/) { - # If the statement carries leading newlines, - # then count those as offsets. - my ($whitespace) = - ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s); - my $offset = - statement_rawlines($whitespace) - 1; - - $suppress_whiletrailers{$line_nr_next + - $offset} = 1; - } - } - if (!defined $suppress_whiletrailers{$linenr} && - $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { - my ($s, $c) = ($stat, $cond); - - if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { - ERROR("do not use assignment in if condition\n" . $herecurr); - } - - # Find out what is on the end of the line after the - # conditional. - substr($s, 0, length($c), ''); - $s =~ s/\n.*//g; - $s =~ s/$;//g; # Remove any comments - if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && - $c !~ /}\s*while\s*/) - { - # Find out how long the conditional actually is. - my @newlines = ($c =~ /\n/gs); - my $cond_lines = 1 + $#newlines; - - my $stat_real = raw_line($linenr, $cond_lines); - if (defined($stat_real) && $cond_lines > 1) { - $stat_real = "[...]\n$stat_real"; - } - - ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real); - } - } - -# Check for bitwise tests written as boolean - if ($line =~ / - (?: - (?:\[|\(|\&\&|\|\|) - \s*0[xX][0-9]+\s* - (?:\&\&|\|\|) - | - (?:\&\&|\|\|) - \s*0[xX][0-9]+\s* - (?:\&\&|\|\||\)|\]) - )/x) - { - WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr); - } - -# if and else should not have general statements after it - if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) { - my $s = $1; - $s =~ s/$;//g; # Remove any comments - if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) { - ERROR("trailing statements should be on next line\n" . $herecurr); - } - } -# if should not continue a brace - if ($line =~ /}\s*if\b/) { - ERROR("trailing statements should be on next line\n" . - $herecurr); - } -# case and default should not have general statements after them - if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && - $line !~ /\G(?: - (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$| - \s*return\s+ - )/xg) - { - ERROR("trailing statements should be on next line\n" . $herecurr); - } - - # Check for }else {, these must be at the same - # indent level to be relevant to each other. - if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and - $previndent == $indent) { - ERROR("else should follow close brace '}'\n" . $hereprev); - } - - if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and - $previndent == $indent) { - my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0); - - # Find out what is on the end of the line after the - # conditional. - substr($s, 0, length($c), ''); - $s =~ s/\n.*//g; - - if ($s =~ /^\s*;/) { - ERROR("while should follow close brace '}'\n" . $hereprev); - } - } - -#studly caps, commented out until figure out how to distinguish between use of existing and adding new -# if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) { -# print "No studly caps, use _\n"; -# print "$herecurr"; -# $clean = 0; -# } - -#no spaces allowed after \ in define - if ($line=~/\#\s*define.*\\\s$/) { - WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr); - } - -#warn if is #included and is available (uses RAW line) - if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\}) { - my $file = "$1.h"; - my $checkfile = "include/linux/$file"; - if (-f "$root/$checkfile" && - $realfile ne $checkfile && - $1 ne 'irq') - { - if ($realfile =~ m{^arch/}) { - CHK("Consider using #include instead of \n" . $herecurr); - } else { - WARN("Use #include instead of \n" . $herecurr); - } - } - } - -# multi-statement macros should be enclosed in a do while loop, grab the -# first statement and ensure its the whole macro if its not enclosed -# in a known good container - if ($realfile !~ m@/vmlinux.lds.h$@ && - $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) { - my $ln = $linenr; - my $cnt = $realcnt; - my ($off, $dstat, $dcond, $rest); - my $ctx = ''; - - my $args = defined($1); - - # Find the end of the macro and limit our statement - # search to that. - while ($cnt > 0 && defined $lines[$ln - 1] && - $lines[$ln - 1] =~ /^(?:-|..*\\$)/) - { - $ctx .= $rawlines[$ln - 1] . "\n"; - $cnt-- if ($lines[$ln - 1] !~ /^-/); - $ln++; - } - $ctx .= $rawlines[$ln - 1]; - - ($dstat, $dcond, $ln, $cnt, $off) = - ctx_statement_block($linenr, $ln - $linenr + 1, 0); - #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n"; - #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n"; - - # Extract the remainder of the define (if any) and - # rip off surrounding spaces, and trailing \'s. - $rest = ''; - while ($off != 0 || ($cnt > 0 && $rest =~ /\\\s*$/)) { - #print "ADDING cnt<$cnt> $off <" . substr($lines[$ln - 1], $off) . "> rest<$rest>\n"; - if ($off != 0 || $lines[$ln - 1] !~ /^-/) { - $rest .= substr($lines[$ln - 1], $off) . "\n"; - $cnt--; - } - $ln++; - $off = 0; - } - $rest =~ s/\\\n.//g; - $rest =~ s/^\s*//s; - $rest =~ s/\s*$//s; - - # Clean up the original statement. - if ($args) { - substr($dstat, 0, length($dcond), ''); - } else { - $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//; - } - $dstat =~ s/$;//g; - $dstat =~ s/\\\n.//g; - $dstat =~ s/^\s*//s; - $dstat =~ s/\s*$//s; - - # Flatten any parentheses and braces - while ($dstat =~ s/\([^\(\)]*\)/1/ || - $dstat =~ s/\{[^\{\}]*\}/1/ || - $dstat =~ s/\[[^\{\}]*\]/1/) - { - } - - my $exceptions = qr{ - $Declare| - module_param_named| - MODULE_PARAM_DESC| - DECLARE_PER_CPU| - DEFINE_PER_CPU| - __typeof__\(| - \.$Ident\s*=\s*| - ^\"|\"$ - }x; - #print "REST<$rest> dstat<$dstat>\n"; - if ($rest ne '') { - if ($rest !~ /while\s*\(/ && - $dstat !~ /$exceptions/) - { - ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n"); - } - - } elsif ($ctx !~ /;/) { - if ($dstat ne '' && - $dstat !~ /^(?:$Ident|-?$Constant)$/ && - $dstat !~ /$exceptions/ && - $dstat !~ /^\.$Ident\s*=/ && - $dstat =~ /$Operators/) - { - ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n"); - } - } - } - -# make sure symbols are always wrapped with VMLINUX_SYMBOL() ... -# all assignments may have only one of the following with an assignment: -# . -# ALIGN(...) -# VMLINUX_SYMBOL(...) - if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) { - WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr); - } - -# check for redundant bracing round if etc - if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) { - my ($level, $endln, @chunks) = - ctx_statement_full($linenr, $realcnt, 1); - #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n"; - #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n"; - if ($#chunks > 0 && $level == 0) { - my $allowed = 0; - my $seen = 0; - my $herectx = $here . "\n"; - my $ln = $linenr - 1; - for my $chunk (@chunks) { - my ($cond, $block) = @{$chunk}; - - # If the condition carries leading newlines, then count those as offsets. - my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s); - my $offset = statement_rawlines($whitespace) - 1; - - #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n"; - - # We have looked at and allowed this specific line. - $suppress_ifbraces{$ln + $offset} = 1; - - $herectx .= "$rawlines[$ln + $offset]\n[...]\n"; - $ln += statement_rawlines($block) - 1; - - substr($block, 0, length($cond), ''); - - $seen++ if ($block =~ /^\s*{/); - - #print "cond<$cond> block<$block> allowed<$allowed>\n"; - if (statement_lines($cond) > 1) { - #print "APW: ALLOWED: cond<$cond>\n"; - $allowed = 1; - } - if ($block =~/\b(?:if|for|while)\b/) { - #print "APW: ALLOWED: block<$block>\n"; - $allowed = 1; - } - if (statement_block_size($block) > 1) { - #print "APW: ALLOWED: lines block<$block>\n"; - $allowed = 1; - } - } - if ($seen && !$allowed) { - WARN("braces {} are not necessary for any arm of this statement\n" . $herectx); - } - } - } - if (!defined $suppress_ifbraces{$linenr - 1} && - $line =~ /\b(if|while|for|else)\b/) { - my $allowed = 0; - - # Check the pre-context. - if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) { - #print "APW: ALLOWED: pre<$1>\n"; - $allowed = 1; - } - - my ($level, $endln, @chunks) = - ctx_statement_full($linenr, $realcnt, $-[0]); - - # Check the condition. - my ($cond, $block) = @{$chunks[0]}; - #print "CHECKING<$linenr> cond<$cond> block<$block>\n"; - if (defined $cond) { - substr($block, 0, length($cond), ''); - } - if (statement_lines($cond) > 1) { - #print "APW: ALLOWED: cond<$cond>\n"; - $allowed = 1; - } - if ($block =~/\b(?:if|for|while)\b/) { - #print "APW: ALLOWED: block<$block>\n"; - $allowed = 1; - } - if (statement_block_size($block) > 1) { - #print "APW: ALLOWED: lines block<$block>\n"; - $allowed = 1; - } - # Check the post-context. - if (defined $chunks[1]) { - my ($cond, $block) = @{$chunks[1]}; - if (defined $cond) { - substr($block, 0, length($cond), ''); - } - if ($block =~ /^\s*\{/) { - #print "APW: ALLOWED: chunk-1 block<$block>\n"; - $allowed = 1; - } - } - if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) { - my $herectx = $here . "\n";; - my $cnt = statement_rawlines($block); - - for (my $n = 0; $n < $cnt; $n++) { - $herectx .= raw_line($linenr, $n) . "\n";; - } - - WARN("braces {} are not necessary for single statement blocks\n" . $herectx); - } - } - -# don't include deprecated include files (uses RAW line) - for my $inc (@dep_includes) { - if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) { - ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr); - } - } - -# don't use deprecated functions - for my $func (@dep_functions) { - if ($line =~ /\b$func\b/) { - ERROR("Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr); - } - } - -# no volatiles please - my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; - if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { - WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); - } - -# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated - if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) { - ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr); - } - -# warn about #if 0 - if ($line =~ /^.\s*\#\s*if\s+0\b/) { - CHK("if this code is redundant consider removing it\n" . - $herecurr); - } - -# check for needless kfree() checks - if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { - my $expr = $1; - if ($line =~ /\bkfree\(\Q$expr\E\);/) { - WARN("kfree(NULL) is safe this check is probably not required\n" . $hereprev); - } - } -# check for needless usb_free_urb() checks - if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { - my $expr = $1; - if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) { - WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev); - } - } - -# warn about #ifdefs in C files -# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { -# print "#ifdef in C files should be avoided\n"; -# print "$herecurr"; -# $clean = 0; -# } - -# warn about spacing in #ifdefs - if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) { - ERROR("exactly one space required after that #$1\n" . $herecurr); - } - -# check for spinlock_t definitions without a comment. - if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || - $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { - my $which = $1; - if (!ctx_has_comment($first_line, $linenr)) { - CHK("$1 definition without comment\n" . $herecurr); - } - } -# check for memory barriers without a comment. - if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) { - if (!ctx_has_comment($first_line, $linenr)) { - CHK("memory barrier without comment\n" . $herecurr); - } - } -# check of hardware specific defines - if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { - CHK("architecture specific defines should be avoided\n" . $herecurr); - } - -# check the location of the inline attribute, that it is between -# storage class and type. - if ($line =~ /\b$Type\s+$Inline\b/ || - $line =~ /\b$Inline\s+$Storage\b/) { - ERROR("inline keyword should sit between storage class and type\n" . $herecurr); - } - -# Check for __inline__ and __inline, prefer inline - if ($line =~ /\b(__inline__|__inline)\b/) { - WARN("plain inline is preferred over $1\n" . $herecurr); - } - -# check for new externs in .c files. - if ($realfile =~ /\.c$/ && defined $stat && - $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) - { - my $function_name = $1; - my $paren_space = $2; - - my $s = $stat; - if (defined $cond) { - substr($s, 0, length($cond), ''); - } - if ($s =~ /^\s*;/ && - $function_name ne 'uninitialized_var') - { - WARN("externs should be avoided in .c files\n" . $herecurr); - } - - if ($paren_space =~ /\n/) { - WARN("arguments for function declarations should follow identifier\n" . $herecurr); - } - - } elsif ($realfile =~ /\.c$/ && defined $stat && - $stat =~ /^.\s*extern\s+/) - { - WARN("externs should be avoided in .c files\n" . $herecurr); - } - -# checks for new __setup's - if ($rawline =~ /\b__setup\("([^"]*)"/) { - my $name = $1; - - if (!grep(/$name/, @setup_docs)) { - CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr); - } - } - -# check for pointless casting of kmalloc return - if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) { - WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); - } - -# check for gcc specific __FUNCTION__ - if ($line =~ /__FUNCTION__/) { - WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); - } - -# check for semaphores used as mutexes - if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) { - WARN("mutexes are preferred for single holder semaphores\n" . $herecurr); - } -# check for semaphores used as mutexes - if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { - WARN("consider using a completion\n" . $herecurr); - } -# recommend strict_strto* over simple_strto* - if ($line =~ /\bsimple_(strto.*?)\s*\(/) { - WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); - } -# check for __initcall(), use device_initcall() explicitly please - if ($line =~ /^.\s*__initcall\s*\(/) { - WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); - } -# check for struct file_operations, ensure they are const. - if ($line !~ /\bconst\b/ && - $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) { - WARN("struct $1 should normally be const\n" . - $herecurr); - } - -# use of NR_CPUS is usually wrong -# ignore definitions of NR_CPUS and usage to define arrays as likely right - if ($line =~ /\bNR_CPUS\b/ && - $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ && - $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ && - $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ && - $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ && - $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/) - { - WARN("usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr); - } - -# check for %L{u,d,i} in strings - my $string; - while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { - $string = substr($rawline, $-[1], $+[1] - $-[1]); - $string =~ s/%%/__/g; - if ($string =~ /(?] []\n". - "\t-c\tc style\n". - "\t-e\emacs style (default)\n". - "\t-t\terse style (default)\n". - "\t\tfile name to open. If file not specified, uses hg diff\n\n", $name; - - exit -1; -} - -if (not getopts('cet',\%opt) or defined $opt{'h'}) { - usage($0); -} - -my $cmd=shift; - -if ($opt{'c'}) { - $c_syntax=1; -} - -if ($opt{'t'}) { - $fmt="--terse"; - $c_syntax=0; -} - -if ($cmd) { - $cmd="diff -upr /dev/null $cmd"; -} else { - $cmd="hg diff"; -} - -my $checkpatch=$ENV{CHECKPATCH}; - -if (!$checkpatch) { - $checkpatch="/lib/modules/`uname -r`/build/scripts/checkpatch.pl"; -} - -my $cp_version; -open IN,"$checkpatch|"; -while () { - tr/A-Z/a-z/; - if (m/version\s*:\s*([\d\.]+)/) { - $cp_version = $1; - } -} -close IN; - -my $intree_checkpatch = "scripts/checkpatch.pl --version "; -if (!open IN,"$intree_checkpatch|") { - $intree_checkpatch = "v4l/".$intree_checkpatch; - open IN,"$intree_checkpatch|"; -} -$intree_checkpatch =~ s/--version/--no-tree --strict/; - -while () { - tr/A-Z/a-z/; - if (m/version\s*:\s*([\d\.]+)/) { - if ($1 > $cp_version) { - print "# WARNING: $checkpatch version $cp_version is\n" - ."# older than $intree_checkpatch version" - ." $1.\n# Using in-tree one.\n#\n"; - $cp_version = $1; - $checkpatch = $intree_checkpatch; - } - } -} -close IN; - -open IN,"$cmd | $checkpatch -q --nosignoff $fmt -|"; - -my $err=""; -my $errline=""; -my $file=""; -my $ln_numb; - -my $pwd=`pwd`; -$pwd =~ s|/[^/]+\n$||; - -sub print_err() -{ - if ($err =~ m/LINUX_VERSION_CODE/) { - return; - } - - if ($err) { - printf STDERR "%s/%s: In '%s':\n", $pwd, $file, $errline; - printf STDERR "%s/%s:%d: %s\n", $pwd, $file, $ln_numb, $err; - $err=""; - } -} - -if ($c_syntax == 0) { - while () { - s|^#[\d]+:\s*FILE:\s*|../|; - print "$_"; - } -} else { - while () { - if (m/^\+(.*)\n/) { - $errline=$1; - } elsif (m/^\#\s*[\d]+\s*:\s*FILE:\s*([^\:]+)\:([\d]+)/) { - $file=$1; - $ln_numb=$2; - } elsif (m/^\-\s*\:\d+\:\s*(.*)\n/) { - print_err(); - $err = $1; - $err =~ s/WARNING/warning/; - } -# print "# $_"; - } -} -close IN; -print_err(); diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.bttv media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.bttv --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.bttv 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.bttv 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -MDIR := v4l2 -snap := video4linux - -CONFIG_VIDEO_BTTV := m -CONFIG_VIDEO_CX88 := n -CONFIG_VIDEO_SAA7134 := n -CONFIG_VIDEO_IR := m -CONFIG_VIDEO_TUNER := m -CONFIG_VIDEO_TVAUDIO := m diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.cx88 media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.cx88 --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.cx88 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.cx88 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -MDIR := v4l2 -snap := video4linux - -CONFIG_VIDEO_BTTV := n -CONFIG_VIDEO_CX88 := m -CONFIG_VIDEO_SAA7134 := n -CONFIG_VIDEO_IR := n -CONFIG_VIDEO_TUNER := m -CONFIG_VIDEO_TVAUDIO := n diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.saa7134 media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.saa7134 --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/config.saa7134 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/config.saa7134 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -MDIR := v4l2 -snap := video4linux - -CONFIG_VIDEO_BTTV := n -CONFIG_VIDEO_CX88 := n -CONFIG_VIDEO_SAA7134 := m -CONFIG_VIDEO_IR := m -CONFIG_VIDEO_TUNER := m -CONFIG_VIDEO_TVAUDIO := m diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cx23885.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cx23885.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cx23885.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cx23885.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my %map = ( - "PCI_ANY_ID" => "0", -); - -sub fix_id($) { - my $id = shift; - $id = $map{$id} if defined($map{$id}); - $id =~ s/^0x//; - return $id; -} - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s+(CX23885_BOARD_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # cx88_boards - if (/\[(CX23885_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; -# $data{$id}->{nr} = $nr++; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # cx88_pci_tbl - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); - if (/.card\s*=\s*(\w+),/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0") { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - undef $subvendor; - undef $subdevice; - } - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cx88.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cx88.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/cx88.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/cx88.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my %map = ( - "PCI_ANY_ID" => "0", - "PCI_VENDOR_ID_PHILIPS" => "1131", - "PCI_VENDOR_ID_ASUSTEK" => "1043", - "PCI_VENDOR_ID_MATROX" => "102B", - "PCI_VENDOR_ID_ATI" => "1002", -); - -sub fix_id($) { - my $id = shift; - $id = $map{$id} if defined($map{$id}); - $id =~ s/^0x//; - return $id; -} - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s+(CX88_BOARD_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # cx88_boards - if (/\[(CX88_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; -# $data{$id}->{nr} = $nr++; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # cx88_pci_tbl - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); - if (/.card\s*=\s*(\w+),/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0") { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - undef $subvendor; - undef $subdevice; - } - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/diffrev.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/diffrev.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/diffrev.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/diffrev.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -#/bin/bash - -# Set default tree locations, if you want, at the shell ENV -#GIT_TREE=$HOME/v4l-dvb -#HG_TREE=$HOME/v4l-dvb-hg - -# Should be adjusted to the environment -TMP_TREE=/tmp/oldtree -KERNVER_FILE=./v4l/scripts/etc/kern_version -FIXPATCHES=./v4l/scripts/etc/fixdiffs/* -BLACKLIST=./v4l/scripts/etc/blacklist.txt -GENTREE=./v4l/scripts/gentree.pl - -if [ "$1" == "--strip-dead-code" ]; then - GENTREE_ARGS="$1" - shift -fi - -if [ "$2" != "" ]; then - # - # Two arguments were given. One tree should be hg and the other git - # - if [ -e $1/.hg/hgrc ]; then - HG_TREE=$1 - GIT_TREE=$2 - else - HG_TREE=$2 - GIT_TREE=$1 - fi -else - # - # If just one argument is selected, and it is called from one tree - # use the other argument for the other tree type - # otherwise, use default plus the given tree name - # - if [ "$1" != "" ]; then - if [ -e $1/.hg/hgrc ]; then - HG_TREE=$1 - if [ -e .git/config ]; then - GIT_TREE=. - fi - elif [ -e $1/.git/config ]; then - GIT_TREE=$1 - if [ -e .hg/hgrc ]; then - HG_TREE=. - fi - fi - fi -fi - -if [ "$GIT_TREE" == "" ]; then - echo "No git tree were provided." - ERROR=1 -fi - -if [ "$HG_TREE" == "" ]; then - echo "No mercurial tree were provided." - ERROR=1 -fi - -if [ "$ERROR" != "" ]; then - echo "Usage: $0 [--strip-dead-code] []" - exit -1 -fi - -if [ ! -e "$GIT_TREE/.git/config" ]; then - echo "$GIT_TREE is not a git tree. Should specify a git tree to compare with the $HG_TREE mercurial tree" - exit -1 -fi - -if [ ! -e "$HG_TREE/.hg/hgrc" ]; then - echo "$HG_TREE is not a mercurial tree. Should specify -hg tree to compare with the $GIT_TREE git tree" - exit -1 -fi - -echo "comparing $HG_TREE -hg tree with $GIT_TREE -git tree." - - -run() { - echo $@ - $@ -} - -echo removing oldtree.. -run rm -rf $TMP_TREE -echo creating an oldtree.. -run $GENTREE $GENTREE_ARGS `cat $KERNVER_FILE` $HG_TREE/linux $TMP_TREE >/dev/null - -echo applying the fix patches -for i in $FIXPATCHES; do - echo $i - run patch --no-backup-if-mismatch -R -d $TMP_TREE -p2 -i $i -s - diffstat -p1 $i -done - -echo removing rej/orig from $GIT_TREE -run find $GIT_TREE -name '*.rej' -exec rm '{}' \; -run find $GIT_TREE -name '*.orig' -exec rm '{}' \; - -echo removing rej/orig from oldtree -run find $TMP_TREE -name '*.rej' -exec rm '{}' \; -run find $TMP_TREE -name '*.orig' -exec rm '{}' \; - -echo generating "/tmp/diff" -diff -upr $TMP_TREE $GIT_TREE|grep -v ^Somente |grep -v ^Only>/tmp/diff -echo "generating /tmp/diff2 (loose diff0)" -diff -uprBw $TMP_TREE $GIT_TREE|grep -v Somente |grep -v ^Only>/tmp/diff2 -echo generating /tmp/somente2 for a complete oldtree-only files -diff -upr $TMP_TREE $GIT_TREE|grep ^Somente|grep "drivers/media" |grep -vr ".o$" |grep -v ".mod.c"|grep -v ".o.cmd" |grep -v modules.order >/tmp/somente2 -diff -upr $TMP_TREE $GIT_TREE|grep ^Only|grep "drivers/media" |grep -vr ".o$" |grep -v ".mod.c"|grep -v ".o.cmd" |grep -v modules.order >>/tmp/somente2 - -echo generating /tmp/somente for oldtree-only files -cp /tmp/somente2 /tmp/s$$ -for i in `cat $BLACKLIST`; do - cat /tmp/s$$ | grep -v "Somente.* $i" >/tmp/s2$$ - mv /tmp/s2$$ /tmp/s$$ -done -mv /tmp/s$$ /tmp/somente -echo -echo diffstat -p1 /tmp/diff -diffstat -p1 /tmp/diff diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/do_commit.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/do_commit.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/do_commit.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/do_commit.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#!/bin/bash - -EDITOR=$1 -WHITESPCE=$2 - -if [ "$WHITESPCE" == "" ]; then - exit 13 -fi - -TMPMSG=$1 - -scripts/cardlist -scripts/prep_commit_msg.pl $WHITESPCE > $TMPMSG - -#trap 'rm -rf $TMPMSG' EXIT - -CHECKSUM=`md5sum "$TMPMSG"` -$EDITOR $TMPMSG || exit $? -echo "$CHECKSUM" | md5sum -c --status && echo "*** commit message not changed. Aborting. ***" && exit 13 -DATE="`scripts/hghead.pl $TMPMSG|perl -ne 'if (m/\#[dD]ate:\s+(.*)/) { print $1; }'`" - -if [ "$DATE" != "" ]; then - echo Patch date is $DATE - scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -d "$DATE" -l - -else - scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -l - -fi - -if [ "$?" != "0" ]; then - echo "Couldn't apply the patch" - exit 13 -fi - -echo "*** PLEASE CHECK IF LOG IS OK:" -hg log -v -r -1 -echo "*** If not ok, do \"hg rollback\" and \"make commit\" again" diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/do_merge.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/do_merge.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/do_merge.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/do_merge.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -#!/usr/bin/perl - -my $merge_tree=shift or die "Should specify the pulled tree"; - -sub hgrcuser($) -{ - my $file = shift; - my $ui = 0; - open IN, '<', $file; - while () { - $ui = 1 if (/^\s*\[ui\]/); - if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { - close IN; - return($1); - } - } - close IN; - return(""); -} - -sub check_heads() -{ - my $count=0; - open IN, 'hg heads|'; - while () { - if (m/^[Cc]hangeset:/) { - $count++; - } - } - close IN; - return $count; -} - -sub curr_changeset() -{ - my $changeset = -1; - - open IN, 'hg heads|'; - while () { - if (m/^[Cc]hangeset:\s*(\d+)/) { - if ($changeset < 0) { - $changeset = $1; - } else { - if ($1 < $changeset) { - $changeset = $1; - } - } - } - } - close IN; - return $changeset; -} - -sub check_status() -{ - my $count=0; - open IN, 'hg status -m -a -d -r|'; - while () { - $count++; - } - close IN; - return $count; -} - -sub rollback() -{ - print "*** ERROR *** Rolling back hg pull $merge_tree\n"; - system("hg rollback"); - system("hg update -C"); - exit -1; -} - -#################### -# Determine username - -# Get Hg username from environment -my $user = $ENV{HGUSER}; - -# Didn't work? Try the repo's .hgrc file -if ($user eq "") { - my $hgroot = `hg root`; - chomp($hgroot); - $user = hgrcuser("$hgroot/.hg/hgrc"); -} -# Ok, try ~/.hgrc next -if ($user eq "") { - $user = hgrcuser("$ENV{HOME}/.hgrc"); -} - -# Still no luck? Try some other environment variables -if ($user eq "") { - my $name = $ENV{CHANGE_LOG_NAME}; - my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; - $user = "$name <$email>" if ($name ne "" || $email ne ""); -} - -# Last try to come up with something -if ($user eq "") { - print "*** ERROR *** User not known. Can't procceed\n"; - exit -1; -} - -###################### -# Do some sanity tests - -print "Checking if everything is ok, before applying the new tree.\n"; - -my $n_heads = check_heads(); -die "Your tree currently have more than one head (it has $n_heads heads). Can't procceed\n" if ($n_heads > 1); - -my $dirty = check_status(); -die "Your tree currently has changes. Can't procceed\n" if ($dirty); - -my $curr_cs = curr_changeset(); - -########### -# Pull tree - -print "hg pull -u $merge_tree\n"; - -my $ret = system("hg pull $merge_tree"); -die "Couldn't pull from $merge_tree\n" if ($ret); - -############################# -# Merge and commit, if needed - -$n_heads = check_heads(); -if ($n_heads > 2) { - print "The merged tree have more than one head (it has $n_heads heads). Can't procceed.\n"; - rollback(); -} - -if ($n_heads == 2) { - print "Merging the new changesets\n"; - - $ret = system("hg merge"); - if ($ret) { - print "hg merge failed. Can't procceed.\n"; - rollback(); - } - - print "Committing the new tree\n"; - # Write the commit message - $msg= "merge: $merge_tree\n\nFrom: $user\n\nSigned-off-by: $user\n"; - $ret=system("hg commit -m '$msg'"); - if ($ret) { - print "hg commit failed. Can't procceed.\n"; - rollback(); - } -} - -##################### -# Test resulting tree - -print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; -$ret = system ('make allmodconfig'); -if (!ret) { - $ret = system ('make mismatch|egrep -v "^\s*CC"|egrep -v "^\s*LD"'); -} -if ($ret) { - print "*** ERROR *** Build failed. Can't procceed.\n"; - - # To avoid the risk of doing something really bad, let's ask the user to run hg strip - print "Your tree is dirty. Since hg has only one rollback level, you'll need to use, instead:"; - print "\thg strip $curr_cs; hg update -C"; - print "You'll need to have hg mq extension enabled for hg strip to work.\n"; - - exit -1; -} - -############################## -# Everything is ok, let's push - -print "Pushing the new tree at the remote repository specified at .hg/hgrc\n"; -$ret=system ("hg push"); -if ($ret) { - print "hg push failed. Don't forget to do the push later.\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/em28xx.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/em28xx.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/em28xx.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/em28xx.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -my $debug = 0; - -while (<>) { - # defines in header file - if (/#define\s+(EM2[\d][\d][\d]_BOARD_[\w\d_]+)\s+(\d+)/) { - printf("$1 = $2\n") if ($debug); - $data{$1}->{nr} = $2; - next; - } - # em2820_boards - if (/\[(EM2820_BOARD_[\w\d_]+)\]/) { - $id = $1; - printf("ID = $id\n") if $debug; - $data{$id}->{id} = $id; - $data{$id}->{type} = "(em2820/em2840)"; -# $data{$id}->{nr} = $nr++; - } elsif (/\[(EM)(2[\d]..)(_BOARD_[\w\d_]+)\]/) { - $id = "$1$2$3"; - printf("ID = $id\n") if $debug; - $data{$id}->{id} = $id; - $data{$id}->{type} = "(em$2)"; -# $data{$id}->{nr} = $nr++; - }; - - next unless defined($id); - - if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*)/ ) { - $subvendor=$1; - $subdevice=$2; - } - - if (/.*driver_info.*(EM2[\d].._BOARD_[\w\d_]+)/ ) { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - } - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - if (defined $data{$id}->{name} && $debug) { - printf("name[$id] = %s\n", $data{$id}->{name}); - } - } - - # em2820_USB_tbl - - -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-40s %-15s", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{type}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/blacklist.txt media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/blacklist.txt --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/blacklist.txt 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/blacklist.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -\.orig -\.rej -\.cvsignore -bt87x.c -i2c-compat.h -at76c651[.][ch] -tda80xx[.][ch] -tvmixer.c -aci.[ch] -btaudio.c -dvb-ttusb-dspbootcode.h -cpia2patch.h -dabfirmware.h -^firmware/ diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/98.patch media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/98.patch --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/98.patch 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/98.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ - -diff -upr oldtree/drivers/media/dvb-core/dvb_net.c /home/v4l/tokernel/wrk/linux-next/drivers/media/dvb-core/dvb_net.c ---- next/drivers/media/dvb-core/dvb_net.c 2010-01-15 19:05:35.000000000 -0200 -+++ ../oldtree/drivers/media/dvb-core/dvb_net.c 2010-01-15 19:11:43.000000000 -0200 -@@ -949,11 +949,8 @@ static int dvb_net_filter_sec_set(struct - (*secfilter)->filter_mask[10] = mac_mask[1]; - (*secfilter)->filter_mask[11]=mac_mask[0]; - -+ dprintk("%s: filter mac=%pM\n", dev->name, mac); -+ dprintk("%s: filter mask=%pM\n", dev->name, mac_mask); -- dprintk("%s: filter mac=%02x %02x %02x %02x %02x %02x\n", -- dev->name, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); -- dprintk("%s: filter mask=%02x %02x %02x %02x %02x %02x\n", -- dev->name, mac_mask[0], mac_mask[1], mac_mask[2], -- mac_mask[3], mac_mask[4], mac_mask[5]); - - return 0; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/99.patch media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/99.patch --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/99.patch 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/fixdiffs/99.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Whitespace cleanup - ---- git/sound/pci/bt87x.c 2007-10-16 23:42:25.000000000 -0200 -+++ ../oldtree/sound/pci/bt87x.c 2007-10-17 12:46:18.000000000 -0200 -@@ -122,8 +122,8 @@ MODULE_PARM_DESC(load_all, "Allow to loa - /* RISC instruction bits */ - #define RISC_BYTES_ENABLE (0xf << 12) /* byte enable bits */ - #define RISC_RESYNC ( 1 << 15) /* disable FDSR errors */ --#define RISC_SET_STATUS_SHIFT 16 /* set status bits */ --#define RISC_RESET_STATUS_SHIFT 20 /* clear status bits */ -+#define RISC_SET_STATUS_SHIFT 16 /* set status bits */ -+#define RISC_RESET_STATUS_SHIFT 20 /* clear status bits */ - #define RISC_IRQ ( 1 << 24) /* interrupt */ - #define RISC_EOL ( 1 << 26) /* end of line */ - #define RISC_SOL ( 1 << 27) /* start of line */ -@@ -226,7 +226,7 @@ static inline void snd_bt87x_writel(stru - } - - static int snd_bt87x_create_risc(struct snd_bt87x *chip, struct snd_pcm_substream *substream, -- unsigned int periods, unsigned int period_bytes) -+ unsigned int periods, unsigned int period_bytes) - { - struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); - unsigned int i, offset; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/kern_version media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/kern_version --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/etc/kern_version 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/etc/kern_version 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2.6.33 diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/fix_dvb_customise.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/fix_dvb_customise.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/fix_dvb_customise.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/fix_dvb_customise.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,335 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; -use File::Find; -use Fcntl ':mode'; - -my $debug = 0; - -my $SRC = "../linux"; -my $fname = "$SRC/drivers/media/dvb-frontends/Makefile"; - -#################### -# Get Makefile rules -# -sub get_makefile($) -{ - my $file = shift; - my %rules; - my %composite; - - open IN, $file or die "Can't find $file\n"; - while () { - # Handle line continuations - if (/\\\n$/) { - $_ .= ; - redo; - } - # Eat line continuations in string we will parse - s/\s*\\\n\s*/ /g; - - if (m/(^\s*[[\da-zA-Z-_]+)-objs\s*[\:\+]*\=\s*(.*)\n/) { - my $dep=$1; - my $file = $2; - $file =~ s/\.o / /g; - $file =~ s/\.o$//; - - if ($file eq "") { - die "broken dep on file $file for $dep\n"; - } - - $composite{$dep} = $file; - printf "MULTI: $dep = $file\n" if ($debug > 1); - } - - if (m/^\s*obj\-\$\(CONFIG_([^\)]+)\)\s*[\:\+]*\=\s*(.*)\n/) { - my $rule = $1; - my $file = $2; - - $file =~ s/\.o / /g; - $file =~ s/\.o$//; - - $rules{$rule} = $file; - printf "RULE: $rule = $file\n" if ($debug > 1); - } - } - close IN; - - return (\%rules, \%composite); -} - -########################### -# Seeks header dependencies -# -my %header_deps; - -# For a more complete check, use: -# my $hfiles = "*.c"; -my $hfiles = "av7110_av.c av7110.c av7110_ca.c av7110_hw.c av7110_ipack.c av7110_ir.c av7110_v4l.c budget-patch.c dvb_ringbuffer.c nova-t-usb2.c umt-010.c"; - -sub get_header_deps() -{ - my $file = shift; - my %rules; - my %composite; - - open IN, "gcc -I ../linux/include -I . -DCONFIG_PCI -D__LITTLE_ENDIAN -D_COMPAT_H -DKERNEL_VERSION\\(a,b,c\\) -MM $hfiles|"; - while () { - # Handle line continuations - if (/\\\n$/) { - $_ .= ; - redo; - } - # Eat line continuations in string we will parse - s/\s*\\\n\s*/ /g; - - if (m/^([^\:]+)\s*\:\s*(.*)/) { - my $dep = $1; - my $file = $2; - - $dep =~ s|.*/||; - $dep =~ s/\.o$//; - - my @files = split(/\s/, $file); - foreach my $f (@files) { - $f =~ s|.*/||; - - if (!defined($header_deps{$f})) { - $header_deps{$f} = $dep; - } else { - $header_deps{$f} .= " " . $dep; - } - - } - } - } - close IN; - - if ($debug > 1) { - print "Header deps for: "; - print "$_ " foreach %header_deps; - print "\n"; - } -} - - -########################### -# Seeks files for Makefiles -# - -my %driver_config; - -sub parse_makefiles() -{ - my $fname = $File::Find::name; - - return if !($fname =~ m|/Makefile$|); - return if ($fname =~ m|drivers/media/dvb-frontends/|); - - - my ($refs, $mult) = get_makefile($fname); - - foreach my $ref (keys %$refs) { - my $file=$$refs{$ref}; - - my @files = split(/\s/, $file); - foreach my $f (@files) { - if (defined($$mult{$f})) { - $file .= " " . $$mult{$f}; - } - } - - $file =~ s|/||g; - - @files = split(/\s/, $file); - foreach my $f (@files) { - $driver_config{$f} = $ref; - } - if ($debug > 1) { - print "$ref = "; - print "$_ " foreach @files; - print "\n"; - } - } -} - - -######################## -# Seeks files for header -# -my %select; - -sub found_ref($$) -{ - my $file = shift; - my $header = shift; - my $found = 0; - my $name = $file; - $name =~ s|.*/||; - - $name =~ s/flexcop-fe-tuner.c/b2c2-flexcop/; - $name =~ s/av7110.c/av7110.h/; - - if (defined ($header_deps{$name})) { - $name = $header_deps{$name}; - } else { - $name =~ s/\.[ch]$//; - } - - my @files = split(/\s/, $name); - foreach my $n (@files) { - if (defined($driver_config{$n})) { - my $ref = $driver_config{$n}; - printf "$ref needs %s\n", $header if ($debug); - - if ($ref =~ m/(PVRUSB2|CX23885|CX88|EM28XX|SAA3134 - |SAA7164)/) { - $ref .="_DVB"; - } - - if (!defined($select{$ref})) { - $select{$ref} = $header; - } else { - $select{$ref} .= " " . $header; - } - $found = 1; - } - } - - if (!$found) { - printf "$file needs %s\n", $header; - } -} - -######################## -# Seeks files for header -# - -my %header; - -sub parse_headers() -{ - my $file = $File::Find::name; - - return if !($file =~ m/\.[ch]$/); - return if ($file =~ m|drivers/media/dvb-frontends/|); - - open IN, $file or die "Can't open $file\n"; - while () { - if (m/^\s*\#include\s+\"([^\"]+)\"/) { - if (defined($header{$1})) { - my $head = $header{$1}; - found_ref ($file, $head); - } - } - } - close IN; -} - -######################## -# Rewrite Kconfig's -# - -sub parse_kconfigs() -{ - my $file = $File::Find::name; - my $conf; - my $out = ""; - my $tmp = ""; - my $all_sels; - - return if !($file =~ m/Kconfig$/); - return if ($file =~ m|drivers/media/dvb-frontends/|); - - open IN, $file or die "Can't open $file\n"; - while () { - if (m/^config\s([A-Za-z_\-\d]+)/) { - $out .= $tmp; - if (defined($select{$1})) { - $conf = $select{$1}; - $all_sels = " ". $conf. " "; - $tmp = $_; - - printf "$file: rewriting headers for $1. It should select: %s\n", $all_sels if ($debug); - } else { - $conf = ""; - $out .= $_; - $tmp = ""; - } - next; - } - if (!$conf) { - $out .= $_; - next; - } - - if (m/^\s*select\s+([A-Za-z_\-\d]+)/) { - my $op = $1; - - if (!$all_sels =~ m/\s($op)\s/) { - # Drops line - printf "$file: droppingg line $_\n"; - - next; - } else { - $all_sels =~ s/\s($op)\s/ /; - } - } - if (m/^[\s\-]*help/) { - my @sel = split(/\s/, $all_sels); - foreach my $s (@sel) { - if ($s ne "") { - printf "$file: Adding select for $s\n"; - $tmp .= "\tselect $s if !DVB_FE_CUSTOMISE\n"; - } - } - } - $tmp .= $_; - } - close IN; - - $out .=$tmp; - open OUT, ">$file" or die "Can't open $file\n"; - print OUT $out; - close OUT; -} - -##### -#main - -get_header_deps(); - -my ($FEs, $mult) = get_makefile($fname); - -foreach my $fe (keys %$FEs) { - my $file=$$FEs{$fe}; - my $found = 0; - - # Special cases - $file =~ s/tda10021/tda1002x/; - $file =~ s/tda10023/tda1002x/; - $file =~ s/dib3000mb/dib3000/; - - if (defined($$mult{$file})) { - $file .= " ".$$mult{$file}; - } - - my @files = split(/\s/, $file); - foreach my $f (@files) { - if (stat("$f.h")) { - printf "$fe = $f.h\n" if ($debug); - $found = 1; - $header {"$f.h"} = $fe; - last; - } - } - - if (!$found) { - printf "$file.h ($fe) not found in $file\n"; - exit -1; - } -} - -find({wanted => \&parse_makefiles, no_chdir => 1}, $SRC); -find({wanted => \&parse_headers, no_chdir => 1}, $SRC); -find({wanted => \&parse_kconfigs, no_chdir => 1}, $SRC); diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/fix_kconfig.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/fix_kconfig.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/fix_kconfig.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/fix_kconfig.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/usr/bin/perl -use strict; - -my $need_changes = 0; -my $out; - -open IN, '<.config'; -while () { - s/CONFIG_VIDEO_CX88_MPEG=y/CONFIG_VIDEO_CX88_MPEG=m/ and $need_changes=1; - $out .= $_; -} -close IN; - -if ($need_changes) { - printf("There's a known bug with the building system with this kernel. Working around.\n"); - open OUT, '>.config'; - print OUT $out; - close OUT; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/gentree.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/gentree.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/gentree.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/gentree.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,264 +0,0 @@ -#!/usr/bin/perl -# -# Original version were part of Gerd Knorr's v4l scripts. -# -# Several improvements by (c) 2005-2007 Mauro Carvalho Chehab -# -# Largely re-written (C) 2007 Trent Piepho -# -# Theory of Operation -# -# This acts as a sort of mini version of cpp, which will process -# #if/#elif/#ifdef/etc directives to strip out code used to support -# multiple kernel versions or otherwise not wanted to be sent upstream to -# git. -# -# Conditional compilation directives fall into two catagories, -# "processed" and "other". The "other" directives are ignored and simply -# output as they come in without changes (see 'keep' exception). The -# "processed" variaty are evaluated and only the lines in the 'true' part -# are kept, like cpp would do. -# -# If gentree knows the result of an expression, that directive will be -# "processed", otherwise it will be an "other". gentree knows the value -# of LINUX_VERSION_CODE, BTTV_VERSION_CODE, the KERNEL_VERSION(x,y,z) -# macro, numeric constants like 0 and 1, and a few defines like -# I2C_CLASS_TV_DIGITAL -# -# An exception is if the comment "/*KEEP*/" appears after the expression, -# in which case that directive will be considered an "other" and not -# processed, other than to remove the keep comment. -# -# Known bugs: -# don't specify the root directory e.g. '/' or even '////' -# directives continued with a back-slash will always be ignored -# you can't modify a source tree in-place, i.e. source dir == dest dir - -use strict; -use File::Find; -use Fcntl ':mode'; -use Getopt::Long; - -my $DEBUG = 0; -my $dead_code = 0; - -GetOptions( "--debug" => \$DEBUG, - "--strip-dead-code" => \$dead_code ); - -my $VERSION = shift; -my $SRC = shift; -my $DESTDIR = shift; -my $BTTVCODE = KERNEL_VERSION(0,9,17); -my ($LINUXCODE, $extra) = kernel_version($VERSION); - -if (!defined($DESTDIR)) { - print "Usage:\ngentree.pl\t[--debug] \n\n"; - exit; -} - -my %defs = ( - 'LINUX_VERSION_CODE' => $LINUXCODE, - 'BTTV_VERSION_CODE' => $BTTVCODE, - '_COMPAT_H' => 0, - 'I2C_CLASS_TV_ANALOG' => 1, - 'I2C_CLASS_TV_DIGITAL' => 1, - 'OLD_XMIT_LOCK' => 0, - 'COMPAT_SND_CTL_BOOLEAN_MONO' => 0, - 'NEED_SOUND_DRIVER_H' => 0, - 'TTUSB_KERNEL' => 1, - 'NO_PCM_LOCK' => 0, - 'NEED_ALGO_CONTROL' => 0, -); - -################################################################# -# helpers - -sub kernel_version($) { - $_[0] =~ m/(\d+)\.(\d+)\.(\d+)(.*)/; - return ($1*65536 + $2*256 + $3, $4); -} - -# used in eval() -sub KERNEL_VERSION($$$) { return $_[0]*65536 + $_[1]*256 + $_[2]; } - -sub evalexp($) { - local $_ = shift; - s|/\*.*?\*/||go; # delete /* */ comments - s|//.*$||o; # delete // comments - s/\bdefined\s*\(/(/go; # defined(foo) to (foo) - while (/\b([_A-Za-z]\w*)\b/go) { - if (exists $defs{$1}) { - my $id = $1; my $pos = $-[0]; - s/$id/$defs{$id}/; - pos = $-[0]; - } elsif ($1 ne 'KERNEL_VERSION') { - return(undef); - } - } - return(eval($_) ? 1 : 0); -} - -################################################################# -# filter out version-specific code - -sub filter_source ($$) { - my ($in,$out) = @_; - my $line; - my $level=0; - my %if = (); - my %state = (); - - my @dbgargs = \($level, %state, %if, $line); - sub dbgline($\@) { - my $level = ${$_[1][0]}; - printf STDERR ("/* BP %4d $_[0] state=$_[1][1]->{$level} if=$_[1][2]->{$level} level=$level (${$_[1][3]}) */\n", $.) if $DEBUG; - } - - open IN, '<', $in or die "Error opening $in: $!\n"; - open OUT, '>', $out or die "Error opening $out: $!\n"; - - print STDERR "File: $in, for kernel $VERSION($LINUXCODE)/\n" if $DEBUG; - - while ($line = ) { - chomp $line; - next if ($line =~ m/^#include \"compat.h\"/o); -# next if ($line =~ m/[\$]Id:/); - - # For "#if 0 /*KEEP*/;" the ; should be dropped too - if ($line =~ m@^\s*#\s*if(n?def)?\s.*?(\s*/\*\s*(?i)keep\s*\*/;?)@) { - $state{$level} = "ifother"; - $if{$level} = 1; - dbgline "#if$1 (keep)", @dbgargs; - $line =~ s/\Q$2\E//; - $level++; - } - # preserve #if 0/#if 1, if $dead_code = 0 - elsif (!$dead_code && $line =~ m@^\s*#\s*if\s*([01])[^\d]@) { - $state{$level} = "ifother"; - $if{$level} = 1; - dbgline "#if $1", @dbgargs; - $level++; - } - # handle all ifdef/ifndef lines - elsif ($line =~ /^\s*#\s*if(n?)def\s*(\w+)/o) { - if (exists $defs{$2}) { - $state{$level} = 'if'; - $if{$level} = ($1 eq 'n') ? !$defs{$2} : $defs{$2}; - dbgline "#if$1def $2", @dbgargs; - $level++; - next; - } - $state{$level} = "ifother"; - $if{$level} = 1; - dbgline "#if$1def (other)", @dbgargs; - $level++; - } - # handle all ifs - elsif ($line =~ /^\s*#\s*if\s+(.*)$/o) { - my $res = evalexp($1); - if (defined $res) { - $state{$level} = 'if'; - $if{$level} = $res; - dbgline '#if '.($res?'(yes)':'(no)'), @dbgargs; - $level++; - next; - } else { - $state{$level} = 'ifother'; - $if{$level} = 1; - dbgline '#if (other)', @dbgargs; - $level++; - } - } - # handle all elifs - elsif ($line =~ /^\s*#\s*elif\s+(.*)$/o || $line =~ /^\s*#\s*elseif\s+(.*)$/o) { - my $exp = $1; - $level--; - $level < 0 and die "more elifs than ifs"; - $state{$level} =~ /if/ or die "unmatched elif"; - - if ($state{$level} eq 'if' && !$if{$level}) { - my $res = evalexp($exp); - defined $res or die 'moving from if to ifother'; - $state{$level} = 'if'; - $if{$level} = $res; - dbgline '#elif1 '.($res?'(yes)':'(no)'), @dbgargs; - $level++; - next; - } elsif ($state{$level} ne 'ifother') { - $if{$level} = 0; - $state{$level} = 'elif'; - dbgline '#elif0', @dbgargs; - $level++; - next; - } - $level++; - } - elsif ($line =~ /^\s*#\s*else/o) { - $level--; - $level < 0 and die "more elses than ifs"; - $state{$level} =~ /if/ or die "unmatched else"; - $if{$level} = !$if{$level} if ($state{$level} eq 'if'); - $state{$level} =~ s/^if/else/o; # if -> else, ifother -> elseother, elif -> elif - dbgline '#else', @dbgargs; - $level++; - next if $state{$level-1} !~ /other$/o; - } - elsif ($line =~ /^\s*#\s*endif/o) { - $level--; - $level < 0 and die "more endifs than ifs"; - dbgline '#endif', @dbgargs; - next if $state{$level} !~ /other$/o; - } - - my $print = 1; - for (my $i=0;$i<$level;$i++) { - next if $state{$i} =~ /other$/o; # keep code in ifother/elseother blocks - if (!$if{$i}) { - $print = 0; - dbgline 'DEL', @{[\$i, \%state, \%if, \$line]}; - last; - } - } - print OUT "$line\n" if $print; - } - close IN; - close OUT; -} - -################################################################# - -sub parse_dir { - my $file = $File::Find::name; - - return if ($file =~ /CVS/); - return if ($file =~ /~$/); - - my $f2 = $file; - $f2 =~ s/^\Q$SRC\E/$DESTDIR/; - - my $mode = (stat($file))[2]; - if ($mode & S_IFDIR) { - print("mkdir -p '$f2'\n"); - system("mkdir -p '$f2'"); # should check for error - return; - } - print "from $file to $f2\n"; - - if ($file =~ m/.*\.[ch]$/) { - filter_source($file, $f2); - } else { - system("cp $file $f2"); - } -} - - -# main - -printf "kernel is %s (0x%x)\n",$VERSION,$LINUXCODE; - -# remove any trailing slashes from dir names. don't pass in just '/' -$SRC =~ s|/*$||; $DESTDIR =~ s|/*$||; - -print "finding files at $SRC\n"; - -find({wanted => \&parse_dir, no_chdir => 1}, $SRC); diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/headers_convert.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/headers_convert.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/headers_convert.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/headers_convert.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/perl -# -# headers_install prepare the listed header files for use in -# user space and copy the files to their destination. -# - -use strict; -use warnings; - -foreach (@ARGV) { - my $file = $_; - my $tmpfile = $file . ".tmp"; - - open(my $infile, '<', "$file") - or die "$file: $!\n"; - open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; - while (my $line = <$infile>) { - $line =~ s/([\s(])__user\s/$1/g; - $line =~ s/([\s(])__force\s/$1/g; - $line =~ s/([\s(])__iomem\s/$1/g; - $line =~ s/\s__attribute_const__\s/ /g; - $line =~ s/\s__attribute_const__$//g; - $line =~ s/^#include //; - printf $outfile "%s", $line; - } - close $outfile; - close $infile; - system "mv $tmpfile $file"; -} -exit 0; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/hghead.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/hghead.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/hghead.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/hghead.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -#!/usr/bin/perl -use strict; - -################################################################# -# analyse diffs - -my $in = shift; -my $line; -my $subject; -my $sub_ok=0; -my $init=0; -my $num=0; -my $hgimport=0; -my $mmimport=0; -my $maint_ok=0; -my $noblank=1; -my $maintainer_name=$ENV{CHANGE_LOG_NAME}; -my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; -my $from=""; -my $body=""; -my $priority=""; -my $signed=""; -my $fromname=""; - -open IN, "<$in"; - -while ($line = ) { - if ($line =~ m/^\s*Index.*/) { - last; - } - if ($line =~ m/^diff .*/) { - last; - } - if ($line =~ m/^\-\-\- .*/) { - last; - } - if ($line =~ m/^\-\-\-\-.*/) { - $body=""; - next; - } - if ($line =~ m/^\-\-\-.*/) { - last; - } - if ($line =~ m/^\+\+\+ .*/) { - last; - } - - if ($line =~ m/^#\s*Date\s*(.*)/) { - print "#Date: $1\n"; - next; - } - - if ($line =~ m/^Date:\s*(.*)/) { - print "#Date: $1\n"; - next; - } - - $line =~ s/^#\sUser/From:/; - - my $tag=$line; - my $arg=$line; - $tag =~ s/\s*([^\s]+:)\s*(.*)\n/\1/; - $arg =~ s/\s*([^\s]+:)\s*(.*)\n/\2/; - - $tag =~ tr/A-Z/a-z/; - - if ($tag =~ m/^from:/) { - if ($arg =~ m/^[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { - if ($1 eq "") { - next; - } - my $name=$1; - my $email=$2; - $name =~ s/\s+$//; - $email =~ s/\s+$//; - $fromname="$name <$email>"; - $from= "From: $fromname\n"; - next; - } - if ($line =~ m/^From:\sakpm\@osdl.org/) { - $mmimport=1; - next; - } - print "Bad: author line have a wrong syntax: $line\n"; - die; - } - - if ($tag =~ m/^subject:/) { - $subject = "$arg\n"; - $sub_ok = 1; - next; - } - - if ($tag =~ m/^priority:/) { - $arg =~ tr/A-Z/a-z/; - - # Replace the -git branch names for high/normal/low - $arg =~ s/^fixes$/high/; - $arg =~ s/^fix$/high/; - $arg =~ s/^working$/normal/; - $arg =~ s/^work$/normal/; - $arg =~ s/^pending$/low/; - $priority = "Priority: $arg"; - next; - } - - if ($line =~ m;^ .*\/.*\| *[0-9]*;) { - next; - } - if ($line =~m/\d+\s*file.* changed, /) { - next; - } - - if ($tag =~ m/^signed-off-by:.*/) { - $noblank=1; - if ($line =~ m/$maintainer_name/) { - $maint_ok=1; - } - - $signed="$signed$line"; - next; - } - if ( ($line =~ m/^\# HG changeset patch/) || - ($line =~ m/^has been added to the -mm tree. Its filename is/) ) { - $sub_ok=0; - $init=0; - $num=0; - $maint_ok=0; - $noblank=1; - $from=""; - $body=""; - $subject=""; - $hgimport=1; - next; - } - - if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|noticed-by|tested-by|cc):/) { - $signed="$signed$line"; - next; - } - - # Keep review lines together with the signatures - if ($line =~ m/^\[.*\@.*\:.*\]\n/) { - $signed="$signed$line"; - next; - } - - if ($tag =~ m/changeset:\s*(.*)\n/) { - $num=$1; - } - - if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) { - $subject=$1; - $sub_ok = 1; - $line="\n"; - } - - if ($line =~ m/^#/) { - next; - } - if ($sub_ok == 0) { - if ($line =~ m/^\s*\n/) { - next; - } - $sub_ok=1; - if ($subject =~ m|V4L\/DVB\s*(.+)|) { - $subject=$1; - } - $subject=$line; - next; - } - - if ($noblank) { - if ($line =~ m/^\n/) { - next; - } - } - if (!$init) { - $init=1; - $noblank=0; - } - $body="$body$line"; -} -close IN; - -if ($from eq "") { - print "Bad: author doesn't exist!\n"; - die; -} - -if (!$maint_ok && $maintainer_name && $maintainer_email) { - print "#No maintainer's signature. Adding it.\n"; - $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n"; -} - -if (!$signed =~ m/$from/) { - print "Bad: Author didn't signed his patch!\n"; - die; -} - -$from=~s/^[\n\s]+//; -$from=~s/[\n\s]+$//; - -$subject=~s/^[\n\s]+//; -$subject=~s/[\n\s]+$//; - -$body=~s/^[\n]+//; -$body=~s/[\n\s]+$//; - -if ($priority ne "") { - $body="$body\n\n$priority"; -} - -$body="$body\n\n$signed"; - -$body=~s/^[\n\s]+//; -$body=~s/[\n\s]+$//; - -# First from is used by hg to recognize commiter name -print "#Committer: $maintainer_name <$maintainer_email>\n"; -print "$subject\n\n$from\n\n$body\n"; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/hg-pull-req.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/hg-pull-req.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/hg-pull-req.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/hg-pull-req.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2006 Trent Piepho -# Automatic pull request generator - -# Generates a pull request for all changesets in current Hg repository, that -# do not appear in a remote repository. -# -# There are _three_ repositories involved in this operation. -# -# The first is the remote repository that you want your changes to be pulled -# into. The default is the master repository at -# http://linuxtv.org/hg/v4l-dvb, but you can specify something else if you -# want. This repository is called the "to repo". -# -# The next two repositories should be copies of each other. The first is your -# local repository. You must run this script from some directory in that -# repository. The second repository is a remote copy on some public server, -# e.g. linuxtv.org. This is called the "from repo". The default for the from -# repo is the "default-push" path from the Hg configuration, which is where hg -# will push to if you don't specify a path to "hg push". The script will do -# some checks to make sure these two repositories are copies of each other. -# -# The repository used to the changesets are comming from is local repository, -# due to Mercurial's limitations. However, links to your local repository -# would be useless in a pull request, because no one else can see your local -# repository. So, the links are change to use the "from repo" instead. This -# is why your local repo and the from repo must be copies of each other. -# Running "hg push" before generating the pull request should be enough. - -$maintainer = 'Mauro'; -$to_repo = 'http://linuxtv.org/hg/v4l-dvb'; -# Default for when a default-push path wasn't defined -$from_repo_base = 'http://linuxtv.org/hg/~username/'; - -# What to open for the pull request -$output_file = '>&STDOUT'; -# Example, to a local file: '>pull_req' -# Example, file on remote host: '|ssh remote.host.com cat \\> pull_req' - -# Text of the pull request. $nstr is e.g. "changeset" or "42 changesets" -$salutation = <<'EOF'; -$maintainer, - -Please pull from $from_repo - -for the following $nstr: - -EOF - -# The closing of the request, name and fname taken from hg username setting -$valediction = <<'EOF'; - -Thanks, -$fname -EOF - -if($#ARGV < 0) { - if(`hg showconfig paths` =~ m/^paths\.default-push=(.*)$/m) { - $from_repo = $1; - $from_repo =~ s/^ssh:/http:/; - } else { - `hg root` =~ m|/([^/]+)\n$|; - my $repo = $1; - $from_repo = $from_repo_base . $repo; - } -} - -$from_repo = $ARGV[0] if($#ARGV >= 0); -$to_repo = $ARGV[1] if($#ARGV >= 1); - -open OUT, $output_file or die "Opening: $!"; - -if (`hg outgoing $from_repo` !~ /^no changes found$/m || - `hg incoming $from_repo` !~ /^no changes found$/m) { - my $cur = `hg root`; chomp $cur; - print "$cur and $from_repo do not match!\n"; - print "Prehaps you forgot to push your changes?\n"; - exit; -} - -open IN, "hg outgoing -M $to_repo |"; -while() { - if(/^changeset:\s+\d+:([[:xdigit:]]{12})$/) { - push @changesets, $1; - } elsif(/^summary:\s+(\S.*)$/) { - if ($1 =~ /^merge:/) { - # Skip merge changesets - pop @changesets; - } else { - push @summaries, $1; - } - } -} -close IN; -$#changesets == $#summaries or die "Confused by hg outgoing output"; - -foreach (0 .. $#summaries) { - if($summaries[$_] =~ /^merge:/) { - splice @summaries, $_, 1; - splice @changesets, $_, 1; - } -} - -$n = $#changesets + 1; -$n > 0 or die "Nothing to pull!"; -$nstr = ($n==1)?"changeset":"$n changesets"; - -print OUT eval qq("$salutation"); - -for (0 .. $#summaries) { - printf OUT "%02d/%02d: $summaries[$_]\n", $_+1, $n; - print OUT "$from_repo?cmd=changeset;node=$changesets[$_]\n"; - print OUT "\n"; -} - -print OUT "\n"; - -open IN, 'hg export ' . join(' ', @changesets) . '| diffstat |'; -print OUT while(); -close IN; - -`hg showconfig ui.username` =~ m/((\S+).*)\s+ "0", - "PCI_VENDOR_ID_PHILIPS" => "1131", - "PCI_VENDOR_ID_ASUSTEK" => "1043", - "PCI_VENDOR_ID_MATROX" => "102B", - "PCI_VENDOR_ID_ATI" => "1002", -); - -sub fix_id($) { - my $id = shift; - $id = $map{$id} if defined($map{$id}); - $id =~ s/^0x//; - return $id; -} - -open ($input, "../saa7134-cards.c"); - -print ("\n"); -print ("1131 Philips Semiconductors\n"); - -my %data; - -while (<$input>) { - - if (/\[(SAA7134_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; - $data{$id}->{subvendor} = "0"; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # saa7134_pci_tbl - $device = $1 if (/\.device\s*=\s*(\w+),/); - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); - if (/.driver_data\s*=\s*(\w+),/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0" && - defined($device)) { - $data{$1}->{device} = $device; - $data{$1}->{subvendor} = $subvendor; - $data{$1}->{subdevice} = $subdevice; - undef $device; - undef $subvendor; - undef $subdevice; - } - } -} - -sub print_cards ($) { - my $filter = shift; - foreach my $item (sort {$data{$a}->{subvendor} cmp $data{$b}->{subvendor}} keys (%data)) - { - if (defined ($data{$item}->{device}) && ($data{$item}->{device} eq $filter)) { - printf("\t\t"); - printf("%s %s %s", $data{$item}->{subvendor}, $data{$item}->{subdevice}, $data{$item}->{name}); - print "\n"; - } - } -} - -print ("\t7130 SAA7130 Video Broadcast Decoder\n"); -print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7130"); -print ("\t7133 SAA7133/SAA7135 Video Broadcast Decoder\n"); -print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7133"); -print ("\t7134 SAA7134 Video Broadcast Decoder\n"); -print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7134"); - -open ($input, "../cx88-cards.c"); - -%data=(); - -while (<$input>) { - if (/\[(CX88_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; - $data{$id}->{subvendor} = "0"; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); - if (/.card\s*=\s*(\w+),/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0") { - $data{$1}->{subvendor} = $subvendor; - $data{$1}->{subdevice} = $subdevice; - undef $subvendor; - undef $subdevice; - } - } -} - -print ("14f1 Conexant\n"); -print ("\t8800 CX23880/1/2/3 PCI Video and Audio Decoder\n"); - -foreach my $item (sort {$data{$a}->{subvendor} cmp $data{$b}->{subvendor}} keys (%data)) -{ - if (defined ($data{$item}->{subdevice}) && ($data{$item}->{subvendor} ne "0")) { - printf("\t\t"); - printf("%s %s %s", $data{$item}->{subvendor}, $data{$item}->{subdevice}, $data{$item}->{name}); - print "\n"; - } -} - -print ("109e Brooktree Corporation\n"); -print ("\t032e Bt878 Video Capture\n"); -%data=(); - -open ($input, "../bttv-cards.c"); -while (<$input>) { - if (/\{\s*0x(\w{4})(\w{4}),.*\"([^\"]+)\"\s\},/) - { - printf ("\t\t%s %s %s\n", $2, $1, $3); - } -} - -printf ("\n"); diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_config_compat.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_config_compat.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_config_compat.pl 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_config_compat.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,751 +0,0 @@ -#!/usr/bin/perl -use strict; - -my $kdir=shift or die "should specify a kernel dir"; -my $infile=shift or die "should specify an input config file"; -my $outfile=shift or die "should specify an output config file"; - -my $out; - -sub check_spin_lock() -{ - my $file = "$kdir/include/linux/netdevice.h"; - my $old_syntax = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/netif_tx_lock_bh/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define OLD_XMIT_LOCK 1\n"; - } - close INNET; -} - -sub check_sound_driver_h() -{ - my $file = "$kdir/include/sound/driver.h"; - my $old_syntax = 1; - - open INNET, "<$file" or return; - while () { - if (m/This file is deprecated/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define NEED_SOUND_DRIVER_H 1\n"; - } - close INNET; -} - -sub check_snd_pcm_rate_to_rate_bit() -{ - my $file = "$kdir/include/sound/pcm.h"; - my $old_syntax = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/snd_pcm_rate_to_rate_bit/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define COMPAT_PCM_TO_RATE_BIT 1\n"; - } - close INNET; -} - -sub check_snd_pcm_stop_xrun() -{ - my $file = "$kdir/include/sound/pcm.h"; - my $old_syntax = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/snd_pcm_stop_xrun/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define NEED_PCM_STOP_XRUN 1\n"; - } - close INNET; -} - -sub check_snd_ctl_boolean_mono_info() -{ - my $file = "$kdir/include/sound/control.h"; - my $old_syntax = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/snd_ctl_boolean_mono_info/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define COMPAT_SND_CTL_BOOLEAN_MONO 1\n"; - } - close INNET; -} - -sub check_bool() -{ - my $file = "$kdir/include/linux/types.h"; - my $old_syntax = 1; - - open INDEP, "<$file" or die "File not found: $file"; - while () { - if (m/^\s*typedef.*bool;/) { - $old_syntax = 0; - last; - } - } - - if ($old_syntax) { - $out.= "\n#define NEED_BOOL_TYPE 1\n"; - } - close INDEP; -} - -sub check_is_singular() -{ - my $file = "$kdir/include/linux/list.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/list_is_singular/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_IS_SINGULAR 1\n"; - } - close INNET; -} - -sub check_clamp() -{ - my $file = "$kdir/include/linux/kernel.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/define\s+clamp/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_CLAMP 1\n"; - } - close INNET; -} - -sub check_proc_create() -{ - my $file = "$kdir/include/linux/proc_fs.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/proc_create/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_PROC_CREATE 1\n"; - } - close INNET; -} - -sub check_pcm_lock() -{ - my $file = "$kdir/include/sound/pcm.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/pcm_stream_lock/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NO_PCM_LOCK 1\n"; - } - close INNET; -} - -sub check_algo_control() -{ - my $file = "$kdir/include/linux/i2c.h"; - my $need_compat = 0; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/algo_control/) { - $need_compat = 1; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_ALGO_CONTROL 1\n"; - } - close INNET; -} - -sub check_net_dev() -{ - my $file = "$kdir/include/linux/netdevice.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/netdev_priv/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_NETDEV_PRIV 1\n"; - } - close INNET; -} - -sub check_usb_endpoint_type() -{ - my $nfiles = 0; - my @files = ( "$kdir/include/linux/usb.h", - "$kdir/include/linux/usb/ch9.h", - "$kdir/include/uapi/linux/usb/ch9.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - $nfiles++; - while () { - if (m/usb_endpoint_type/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - die "Usb headers not found" if (!$nfiles); - - # definition not found. This means that we need compat - $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; -} - -sub check_pci_ioremap_bar() -{ - my $file = "$kdir/include/linux/pci.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/pci_ioremap_bar/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n"; - } - close INNET; -} - -sub check_snd_card_create() -{ - my $file = "$kdir/include/sound/core.h"; - my $need_compat = 1; - - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/snd_card_create/) { - $need_compat = 0; - last; - } - } - - if ($need_compat) { - $out.= "\n#define NEED_SND_CARD_CREATE\n"; - } - close IN; -} - -sub check_poll_schedule() -{ - my @files = ( "$kdir/include/linux/poll.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/poll_schedule/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_POLL_SCHEDULE 1\n"; -} - -sub check_snd_BUG_ON() -{ - my @files = ( "$kdir/include/sound/core.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/snd_BUG_ON/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_SND_BUG_ON 1\n"; -} - -sub check_bitops() -{ - my @files = ( "$kdir/include/linux/bitops.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/#define\s+BIT\(/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_BITOPS 1\n"; -} - -sub check_fw_csr_string() -{ - my @files = ( "$kdir/include/linux/firewire.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/fw_csr_string\(/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_FW_CSR_STRING 1\n"; -} - - -sub check_delayed_work() -{ - my @files = ( "$kdir//include/linux/workqueue.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/struct\s+delayed_work/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_DELAYED_WORK 1\n"; -} - -sub check_vzalloc() -{ - my @files = ( "$kdir/include/linux/vmalloc.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/vzalloc/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_VZALLOC 1\n"; -} - -sub check_flush_work_sync() -{ - my @files = ( "$kdir/include/linux/workqueue.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; - while () { - if (m/flush_work_sync/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_FLUSH_WORK_SYNC 1\n"; -} - -sub check_autosuspend_delay() -{ - my @files = ( "$kdir/include/linux/pm_runtime.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/pm_runtime_set_autosuspend_delay/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_AUTOSUSPEND_DELAY 1\n"; -} - -sub check_i2c_smbus_read_word_swapped() -{ - my @files = ( "$kdir/include/linux/i2c.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/i2c_smbus_read_word_swapped/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_I2C_SMBUS_WORD_SWAPPED 1\n"; -} - -sub check_printk_ratelimited() -{ - my @files = ( "$kdir/include/linux/kernel.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - # It's either defined in kernel.h, or printk.h - # is included from kernel.h - if (m/printk.h/ || m/printk_ratelimited/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define NEED_PRINTK_RATELIMITED 1\n"; -} - - -sub check_files_for_func($$@) -{ - my $function = shift; - my $define = shift; - my @incfiles = @_; - - for my $incfile (@incfiles) { - my @files = ( "$kdir/$incfile" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/($function)/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - } - - # definition not found. This means that we need compat - $out.= "\n#define $define 1\n"; -} - -sub check_files_for_func_uapi($$@) -{ - my $function = shift; - my $define = shift; - my @incfiles = @_; - - for my $incfile (@incfiles) { - my @files = ( "$kdir/include/linux/$incfile", - "$kdir/include/uapi/linux/$incfile" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/($function)/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - } - - # definition not found. This means that we need compat - $out.= "\n#define $define 1\n"; -} - -sub check_gfp_kswapd_reclaim() -{ - my @files = ( "$kdir/include/linux/gfp.h" ); - - foreach my $file ( @files ) { - open IN, "<$file" or next; - while () { - if (m/__GFP_KSWAPD_RECLAIM/) { - close IN; - # definition found. No need for compat - return; - } - } - close IN; - } - - # definition not found. This means that we need compat - $out.= "\n#define __GFP_KSWAPD_RECLAIM 0\n"; -} - -sub check_other_dependencies() -{ - check_spin_lock(); - check_sound_driver_h(); - check_snd_ctl_boolean_mono_info(); - check_snd_pcm_rate_to_rate_bit(); - check_snd_pcm_stop_xrun(); - check_bool(); - check_is_singular(); - check_clamp(); - check_proc_create(); - check_pcm_lock(); - check_algo_control(); - check_net_dev(); - check_usb_endpoint_type(); - check_pci_ioremap_bar(); - check_snd_card_create(); - check_poll_schedule(); - check_snd_BUG_ON(); - check_bitops(); - check_delayed_work(); - check_fw_csr_string(); - check_vzalloc(); - check_flush_work_sync(); - check_autosuspend_delay(); - check_i2c_smbus_read_word_swapped(); - check_printk_ratelimited(); - check_gfp_kswapd_reclaim(); - check_files_for_func("hex_to_bin", "NEED_HEX_TO_BIN", "include/linux/kernel.h"); - check_files_for_func("snd_ctl_enum_info", "NEED_SND_CTL_ENUM_INFO", "include/sound/control.h"); - check_files_for_func("sysfs_attr_init", "NEED_SYSFS_ATTR_INIT", "include/linux/sysfs.h"); - check_files_for_func("usleep_range", "NEED_USLEEP_RANGE", "include/linux/delay.h"); - check_files_for_func("IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL", "include/linux/err.h"); - check_files_for_func("dma_transfer_direction", "NEED_DMA_TRANSFER_DIRECTION", "include/linux/dmaengine.h"); - check_files_for_func("poll_requested_events", "NEED_POLL_REQUESTED_EVENTS", "include/linux/poll.h"); - check_files_for_func("module_usb_driver", "NEED_MODULE_USB_DRIVER", "include/linux/usb.h"); - check_files_for_func("module_platform_driver", "NEED_MODULE_PLATFORM_DRIVER", "include/linux/platform_device.h"); - check_files_for_func("kmalloc_array", "NEED_KMALLOC_ARRAY", "include/linux/slab.h"); - check_files_for_func("dmaengine_prep_slave_sg", "NEED_DMAENGINE_PREP_SLAVE_SG", "include/linux/dmaengine.h"); - check_files_for_func("SET_SYSTEM_SLEEP_PM_OPS", "NEED_SET_SYSTEM_SLEEP_PM_OPS", "include/linux/pm.h"); - check_files_for_func("__i2c_transfer", "NEED_UNLOCK_I2C_XFER", "include/linux/i2c.h"); - check_files_for_func("I2C_CLIENT_SCCB", "NEED_I2C_CLIENT_SCCB", "include/linux/i2c.h"); - check_files_for_func("kstrtou16", "NEED_KSTRTOU16", "include/linux/kernel.h"); - check_files_for_func("kstrtoul", "NEED_KSTRTOUL", "include/linux/kernel.h"); - check_files_for_func("memweight", "NEED_MEMWEIGHT", "include/linux/string.h"); - check_files_for_func("dev_dbg_ratelimited", "NEED_DEV_DBG_RATELIMITED", "include/linux/device.h"); - check_files_for_func("i2c_lock_adapter", "NEED_LOCK_ADAPTER", "include/linux/i2c.h"); - check_files_for_func("i2c_probe_func_quick_read", "NEED_I2C_PROBE_FUNC_QUICK_READ", "include/linux/i2c.h"); - check_files_for_func("abs64", "NEED_ABS64", "include/linux/kernel.h"); - check_files_for_func("VM_DONTDUMP", "NEED_DONTDUMP", "include/linux/mm.h"); - check_files_for_func("VM_NODUMP", "NEED_NODUMP", "include/linux/mm.h"); - check_files_for_func("config_enabled", "NEED_IS_ENABLED", "include/linux/kconfig.h"); - check_files_for_func("IS_REACHABLE", "NEED_IS_REACHABLE", "include/linux/kconfig.h"); - check_files_for_func("DEFINE_PCI_DEVICE_TABLE", "NEED_DEFINE_PCI_DEVICE_TABLE", "include/linux/pci.h"); - check_files_for_func("usb_translate_errors", "NEED_USB_TRANSLATE_ERRORS", "include/linux/usb.h"); - check_files_for_func("PTR_RET", "NEED_PTR_RET", "include/linux/err.h"); - check_files_for_func("file_inode", "NEED_FILE_INODE", "include/linux/fs.h"); - check_files_for_func("ETH_P_802_3_MIN", "NEED_ETH_P_802_3_MIN", "include/uapi/linux/if_ether.h"); - check_files_for_func("proc_set_size", "NEED_PROC_SET_SIZE", "include/linux/proc_fs.h"); - check_files_for_func("SIMPLE_DEV_PM_OPS", "NEED_SIMPLE_DEV_PM_OPS", "include/linux/pm.h"); - check_files_for_func("vm_iomap_memory", "NEED_VM_IOMAP_MEMORY", "include/linux/mm.h"); - check_files_for_func("device_lock", "NEED_DEVICE_LOCK", "include/linux/device.h"); - check_files_for_func("PTR_ERR_OR_ZERO", "NEED_PTR_ERR_OR_ZERO", "include/linux/err.h"); - check_files_for_func("sg_alloc_table_from_pages", "NEED_SG_ALLOC_TABLE_FROM_PAGES", "include/linux/scatterlist.h"); - check_files_for_func("replace_fops", "NEED_REPLACE_FOPS", "include/linux/fs.h"); - check_files_for_func("reinit_completion", "NEED_REINIT_COMPLETION", "include/linux/completion.h"); - check_files_for_func("dma_set_mask_and_coherent", "NEED_DMA_SET_MASK_AND_COHERENT", "include/linux/dma-mapping.h"); - check_files_for_func("dma_set_coherent_mask", "NEED_DMA_SET_COHERENT_MASK", "include/linux/dma-mapping.h"); - check_files_for_func("bitmap_clear", "NEED_BITMAP_CLEAR", "include/linux/bitmap.h"); - check_files_for_func("devm_kmalloc", "NEED_DEVM_KMALLOC", "include/linux/device.h"); - check_files_for_func("devm_kmalloc_array", "NEED_DEVM_KMALLOC_ARRAY", "include/linux/device.h"); - check_files_for_func("usb_speed_string", "NEED_USB_SPEED_STRING", "include/linux/usb/ch9.h"); - check_files_for_func("USB_SPEED_WIRELESS", "NEED_USB_SPEED_WIRELESS", "include/linux/usb/ch9.h"); - check_files_for_func("ether_addr_equal", "NEED_ETHER_ADDR_EQUAL", "include/linux/etherdevice.h"); - check_files_for_func("snd_card_new", "NEED_SND_CARD_NEW", "include/sound/core.h"); - check_files_for_func("compat_put_timespec", "NEED_COMPAT_PUT_TIMESPEC", "include/linux/compat.h"); - check_files_for_func("mp_mb__after_atomic", "NEED_SMP_MB_AFTER_ATOMIC", "include/asm-generic/barrier.h"); - check_files_for_func("pci_zalloc_consistent", "NEED_PCI_ZALLOC_CONSISTENT", "include/asm-generic/pci-dma-compat.h", "include/linux/pci-dma-compat.h"); - check_files_for_func("kref_get_unless_zero", "NEED_KREF_GET_UNLESS_ZERO", "include/linux/kref.h"); - check_files_for_func("prandom_u32_max", "NEED_PRANDOM_U32_MAX", "include/linux/random.h"); - check_files_for_func("prandom_u32", "NEED_PRANDOM_U32", "include/linux/random.h"); - check_files_for_func("GENMASK", "NEED_GENMASK", "include/linux/bitops.h"); - check_files_for_func("mult_frac", "NEED_MULT_FRAC", "include/linux/kernel.h"); - check_files_for_func("clk_prepare_enable", "NEED_CLOCK_HELPERS", "include/linux/clk.h"); - check_files_for_func("IS_MODULE", "NEED_IS_MODULE", "include/linux/kconfig.h"); - check_files_for_func("DMA_ATTR_SKIP_CPU_SYNC", "NEED_DMA_ATTR_SKIP_CPU_SYNC", "include/linux/dma-attrs.h", "include/linux/dma-mapping.h"); - check_files_for_func("sign_extend32", "NEED_SIGN_EXTEND32", "include/linux/bitops.h"); - check_files_for_func("netdev_dbg", "NEED_NETDEV_DBG", "include/linux/netdevice.h"); - check_files_for_func("writel_relaxed", "NEED_WRITEL_RELAXED", "include/asm-generic/io.h"); - check_files_for_func("get_user_pages_unlocked", "NEED_GET_USER_PAGES_UNLOCKED", "include/linux/mm.h"); - check_files_for_func("pr_warn_once", "NEED_PR_WARN_ONCE", "include/linux/printk.h"); - check_files_for_func("DIV_ROUND_CLOSEST_ULL", "NEED_DIV_ROUND_CLOSEST_ULL", "include/linux/kernel.h"); - check_files_for_func("of_property_read_u64_array", "NEED_PROP_READ_U64_ARRAY", "include/linux/of.h"); - check_files_for_func("module_pnp_driver", "NEED_MODULE_PNP_DRIVER", "include/linux/pnp.h"); - check_files_for_func("eth_zero_addr", "NEED_ETH_ZERO_ADDR", "include/linux/etherdevice.h"); - check_files_for_func("frame_vector_create", "NEED_FRAME_VECTOR", "include/linux/mm.h"); - check_files_for_func("kvfree", "NEED_KVFREE", "include/linux/mm.h"); - check_files_for_func("kvzalloc", "NEED_KVZALLOC", "include/linux/mm.h"); - check_files_for_func("ktime_before", "NEED_KTIME_BEFORE", "include/linux/ktime.h"); - check_files_for_func("ktime_compare", "NEED_KTIME_COMPARE", "include/linux/ktime.h"); - check_files_for_func("ktime_ms_delta", "NEED_KTIME_MS_DELTA", "include/linux/ktime.h"); - check_files_for_func("of_node_full_name", "NEED_OF_NODE_FULL_NAME", "include/linux/of.h"); - check_files_for_func("ktime_get_ns", "NEED_KTIME_GET_NS", "include/linux/timekeeping.h"); - check_files_for_func("div64_u64_rem", "NEED_DIV64_U64_REM", "include/linux/math64.h"); - check_files_for_func("led_set_brightness_sync", "NEED_LED_SET_BRIGHTNESS", "include/linux/leds.h"); - check_files_for_func("GENMASK_ULL", "NEED_GENMASK_ULL", "include/linux/bitops.h"); - check_files_for_func("ida_simple_remove", "NEED_IDA_SIMPLE_REMOVE", "include/linux/idr.h"); - check_files_for_func("ktime_get_boottime", "NEED_KTIME_GET_BOOTTIME", "include/linux/hrtimer.h", "include/linux/timekeeping.h"); - check_files_for_func("BUS_CEC", "NEED_BUS_CEC", "include/uapi/linux/input.h"); - check_files_for_func("smp_load_acquire", "NEED_SMP_LOAD_ACQUIRE", "include/asm-generic/barrier.h"); - check_files_for_func("dev_err_once", "NEED_DEV_ERR_ONCE", "include/linux/device.h"); - check_files_for_func("kthread_init_worker", "NEED_KTHREAD_INIT_WORKER", "include/linux/kthread.h"); - check_files_for_func("print_hex_dump_debug", "NEED_PRINT_HEX_DUMP_DEBUG", "include/linux/printk.h"); - check_files_for_func("min3", "NEED_MIN3", "include/linux/kernel.h"); - check_files_for_func("rcu_pointer_handoff", "NEED_RCU_POINTER_HANDOFF", "include/linux/rcupdate.h"); - check_files_for_func("regmap_read_poll_timeout", "NEED_REGMAP_READ_POLL_TIMEOUT", "include/linux/regmap.h"); - check_files_for_func("dma_coerce_mask_and_coherent", "NEED_DMA_COERCE_MASK", "include/linux/dma-mapping.h"); - check_files_for_func("devm_kcalloc", "NEED_DEVM_KCALLOC", "include/linux/device.h"); - check_files_for_func("cdev_device_add", "NEED_CDEV_DEVICE", "include/linux/cdev.h"); - check_files_for_func("module_param_hw", "NEED_MODULE_PARAM_HW", "include/linux/moduleparam.h"); - check_files_for_func("of_fwnode_handle", "NEED_FWNODE", "include/linux/of.h"); - check_files_for_func("to_of_node", "NEED_TO_OF_NODE", "include/linux/of.h"); - check_files_for_func("is_of_node", "NEED_IS_OF_NODE", "include/linux/of.h"); - check_files_for_func("skb_put_data", "NEED_SKB_PUT_DATA", "include/linux/skbuff.h"); - check_files_for_func("pm_runtime_get_if_in_use", "NEED_PM_RUNTIME_GET", "include/linux/pm_runtime.h"); - check_files_for_func("KEY_APPSELECT", "NEED_KEY_APPSELECT", "include/uapi/linux/input-event-codes.h"); - check_files_for_func("PCI_DEVICE_SUB", "NEED_PCI_DEVICE_SUB", "include/linux/pci.h"); - - # For tests for uapi-dependent logic - check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h"); - check_files_for_func_uapi("usb_endpoint_maxp_mult", "NEED_USB_ENDPOINT_MAXP_MULT", "usb/ch9.h"); -} - -# Do the basic rules -open IN, "<$infile" or die "File not found: $infile"; - -$out.= "#ifndef __CONFIG_COMPAT_H__\n"; -$out.= "#define __CONFIG_COMPAT_H__\n\n"; - -$out.= "#include \n\n"; -$out.= "#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)\n"; -$out.= "#include \n"; -$out.= "#else\n"; -$out.= "#include \n"; -$out.= "#endif\n\n"; - -# mmdebug.h includes autoconf.h. So if this header exists, -# then include it before our config is set. -if (-f "$kdir/include/linux/mmdebug.h") { - $out.= "#include \n\n"; -} - -while() { - next unless /^(\S+)\s*:= (\S+)$/; - $out.= "#undef $1\n"; - $out.= "#undef $1_MODULE\n"; - if($2 eq "n") { - next; - } elsif($2 eq "m") { - $out.= "#define $1_MODULE 1\n"; - } elsif($2 eq "y") { - $out.= "#define $1 1\n"; - } else { - $out.= "#define $1 $2\n"; - } -} -close IN; - -check_other_dependencies(); - -open OUT, ">$outfile" or die 'Unable to write $outfile'; -print OUT "$out\n#endif\n"; -close OUT diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_kconfig.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_kconfig.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_kconfig.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_kconfig.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,722 +0,0 @@ -#!/usr/bin/perl -use FileHandle; -use strict; - -my %depend = (); -my %minver = (); -my %config = (); -my %stringopt = (); -my %intopt = (); -my %hexopt = (); -my %tristate = (); -my %kernopts = (); -my %depmods = (); -my ($version, $level, $sublevel, $kernver); - -my $kernel = shift; -my $kernsrc = shift; -my $force_kconfig = shift; -my $enable_staging = shift; - -my $debug=0; - -########################################################### -# Read a .config file (first argument) and put the resulting options in a -# hash, which is returned. This subroutine should be called in a hash -# context or it will not be very useful. -sub process_config($) -{ - my $filename = shift; - my %conf; - my $in = new FileHandle; - - open $in, $filename or die "File not found: $filename"; - while (<$in>) { - if (/^CONFIG_(\w+)\s*=\s*(\S.*?)\s*$/) { - my $c = \($conf{$1} = $2); - $$c =~ y/nmy/012/ if $$c =~ /^.$/; - next; - } - if (/^# CONFIG_(\w+) is not set$/) { - $conf{$1} = 0; - next; - } - unless (/^#|$/) { - print "Confused by this line in $filename:\n$_"; - } - } - close $in; - return %conf; -} - -sub add_bool($) -{ - my $arg=shift; - - exists $config{$arg} or die "Adding unknown boolean '$arg'"; - print "Boolean: $arg\n" if $debug; - $tristate{$arg} = "bool"; -} - -sub add_tristate($) -{ - my $arg=shift; - - exists $config{$arg} or die "Adding unknown tristate '$arg'"; - print "Tristate: $arg\n" if $debug; - $tristate{$arg}="tristate"; - # tri default is 'm' - $config{$arg} = 1 if($config{$arg}); -} - -sub add_int($) -{ - my $arg=shift; - - print "Int: $arg\n" if $debug; - exists $config{$arg} or die "Adding unknown int '$arg'"; - $intopt{$arg} = 0; -} - -sub add_hex($) -{ - my $arg=shift; - - print "Hex: $arg\n" if $debug; - exists $config{$arg} or die "Adding unknown hex '$arg'"; - $hexopt{$arg} = 0; -} - -sub add_string($) -{ - my $arg=shift; - - print "String: $arg\n" if $debug; - exists $config{$arg} or die "Adding unknown string '$arg'"; - $stringopt{$arg} = ""; -} - -sub set_int_value($$) -{ - my $key = shift; - my $val = shift; - - exists $intopt{$key} or die "Default for unknown int option '$key'"; - $intopt{$key} = $val; -} - -sub set_hex_value($$) -{ - my $key = shift; - my $val = shift; - - exists $hexopt{$key} or die "Default for unknown hex option '$key'"; - $hexopt{$key} = "0x$val"; -} - -sub set_string_value($$) -{ - my $key = shift; - my $val = shift; - - exists $stringopt{$key} or die "Default for unknown string option '$key'"; - $stringopt{$key} = "\"$val\""; -} - -sub add_config($) -{ - my $arg = shift; - - if ($arg =~ /^(\w+)\s*$/) { - $config{$1} = 2; - } else { - die "Do not understand config variable '$arg'"; - } -} - -######################################## -# Turn option off, iff it already exists -sub disable_config($) -{ - my $key = shift; - - $config{$key} = 0 if (exists $config{$key}); -} - -# %{$depend{'FOO'}} lists all variables which depend on FOO. This is the -# reverse of the variables that FOO depends on. -my %depend = (); -sub finddeps($$) -{ - my $key = shift; - my $deps = shift; - - $deps =~ s/^\W+//; - $depend{$_}{$key} = 1 foreach(split(/\W[\Wynm]*/, $deps)); -} - -# @{$depends{'FOO'}} is a list of dependency expressions that FOO depends -# on. This is the reverse of the variables that depend on FOO. -my %depends = (); -sub depends($$) -{ - my $key = shift; - my $deps = shift; - - (!defined $key || $key eq '') and - die "Got bad key with $deps\n"; - finddeps($key, $deps); - push @{$depends{$key}}, $deps; -} - -my %selectdepends = (); -sub selects($$$) -{ - my $key = shift; - my $select = shift; - my $if = shift; - - finddeps($key, $select); - if(defined $if) { - finddeps($key, $if); - # Transform "select X if Y" into "depends on !Y || X" - $select = "!($if) || ($select)"; - } - push @{$selectdepends{$key}}, $select; -} - -# Needs: -# %depend <- %depend{FOO} lists the variables that depend on FOO -# %depends <- %depends{FOO} lists the dependency expressions for FOO -# %config <- the value of all media variables -# %kernopts <- the value of all kernel variables (including media ones) -# -# Checks the dependencies of all media variables, recursively. Returns -# a new hash that has the new values of all media variables. -sub checkdeps() -{ - my %allconfig; - - @allconfig{keys %depend} = @kernopts{keys %depend}; - @allconfig{keys %config} = values %config; - # Set undef values to 0 - map { defined $_ or $_ = 0 } values %allconfig; - - # First run, check deps for all the v4l-dvb variables. Following - # runs, check all variables which depend on a variable that was - # changed. Stop when no more variables change. - for(my %changed = (), my @tocheck = keys %config; @tocheck; - @tocheck = keys %changed, %changed = ()) { - foreach (@tocheck) { - next unless($allconfig{$_}); # skip disabled vars - if (!checkvardeps($_)) { - $changed{$_} = 1 foreach keys %{$depend{$_}}; - } - } - } - return map { $_ => $allconfig{$_} } keys %config; - - # Check the dependencies of a variable, if one fails the variable - # is set to 0. Returns 0 if the variable failed, 1 if it passed. - sub checkvardeps($) { - my $key = shift; - my $deps = $depends{$key}; - foreach (@$deps) { - next if($_ eq ''); - if (!eval(toperl($_))) { - print "Disabling $key, dependency '$_' not met\n" if $debug; - $allconfig{$key} = 0; - return 0; - } - } - my $selectdeps = $selectdepends{$key}; - if ($selectdeps) { - my $found = 0; - foreach (@$selectdeps) { - next if($_ eq ''); - if (eval(toperl($_))) { - $found = 1; - last; - } - } - if ($found == 0) { - print "Disabling $key, select dependency '$_' not met\n" if $debug; - $allconfig{$key} = 0; - return 0; - } - } - - return 1; - } - - # Convert a Kconfig expression to a Perl expression - sub toperl($) - { - local $_ = shift; - - # Turn n,m,y into 0,1,2 - s/\bn\b/0/g; s/\bm\b/1/g; s/\by\b/2/g; - - # Turn = into ==, but keep != as != (ie. not !==) - s/(?) { - $line = $_; - # In our Kconfig files, the first non-help line after the - # help text always has no indention. Technically, the - # help text is ended by just by the indention decreasing, - # but that is a pain to keep track of. - if ($in_help && /^\S/) { - $in_help = 0; - } elsif ($in_help) { - # Still inside help text - next; - } - - # Start of help text - if (/^\s*(---)?help(---)?\s*$/) { - $in_help = 1; - # Insert VIDEO_KERNEL_VERSION dependency, default - # n line, and help text note for disabled drivers. - if ($disabled) { - if(exists $tristate{$key} && !$default_seen) { - print OUT "\tdefault n\n"; - } - print OUT "\tdepends on VIDEO_KERNEL_VERSION\n"; - $line = sprintf($disabled_msg, $minver{$key}); - } - next; - } - # No help text should get processed past this point - $in_help and die "I'm very confused"; - - # start of a new stanza, reset - if (/^\w/) { - $disabled = 0; - $default_seen = 0; - $key = undef; - $if = ""; - } - next if (/^\s*#/ || /^\s*$/); # skip comments and blank lines - - # Erase any comments on this line - s/(? 0) { - $disabled = 1; - disable_config($key); - print "$key: Requires at least kernel $minver{$key}\n"; - print OUT "# $key disabled for insufficient kernel version\n"; - } else { - $disabled=0; - } - # Add dependencies from enclosing if/endif blocks - depends($key, $_) foreach (@kifs); - } elsif (m|^\s*comment\s+"[^"]*"\s*$|) { - $key = 'comment'; - } elsif (m|^\s*menu\s+"[^"]*"\s*$|) { - $key = 'menu'; - push @kifs, ''; # placeholder for any depends on clauses - } elsif (m|^\s*if\s+(.+?)\s*$|) { - push @kifs, $1; - } elsif (/^\s*end(if|menu)\s*(?:#.*)?$/) { - # Won't handle menu/if blocks that aren't strictly - # nested, but no one should do that! - $#kifs >= 0 or die "Unmatched end$1 at $file:$.\n"; - pop @kifs; - } else { - $nothandled = 1; - } - next unless ($nothandled); - # Remaining Kconfig directives only makse sense inside Kconfig blocks - unless(defined $key) { - print "Skipping $file:$. $_" if $debug; - next; - } - - # Don't process any directives in comment blocks - next if ($key eq 'comment'); - - # Only depends on lines are accepted in menus - if ($key eq 'menu') { - if (m|^\s*depends on\s+(.+?)\s*$|) { - my $x = pop @kifs; - $x .= ' && ' if($x ne ''); - $x .= "($1)"; - push @kifs, $x; - } else { - print "Skipping unexpected line in menu stanza $file:$.$_" if $debug; - } - next; - } - - # config type - if(/^\s*bool(ean)?\s/) { - add_bool($key); - if (m|if (.*)\s*$|) { - printf("Boolean $key with if '$1'\n") if $debug; - if ($if eq "") { - $if = "($1)"; - } else { - $if .= " && ($1)"; - } - } - } elsif (/^\s*tristate\s/) { - add_tristate($key); - if (m|if (.*)\s*$|) { - printf("Boolean $key with if '$1'\n") if $debug; - if ($if eq "") { - $if = "($1)"; - } else { - $if .= " && ($1)"; - } - } - } elsif (/^\s*int\s/) { - add_int($key); - } elsif (/^\s*hex\s/) { - add_hex($key); - } elsif (/^\s*string\s/) { - add_string($key); - - # select and depend lines - } elsif (m|^\s*depends on\s+(.+?)\s*$|) { - depends($key, $1); - } elsif (m|^\s*select\s+(\w+)(\s+if\s+(.+?))?\s*$|) { - selects($key, $1, $3); - - # default lines - } elsif (m|^\s*default\s+(.+?)(?:\s+if .*)?\s*$|) { - my $o = $1; - if ($2 ne "") { - if ($if eq "") { - $if = "($2)"; - } else { - $if .= " && ($2)"; - } - } - - # Get default for int options - if ($o =~ m|^"(\d+)"$| && exists $intopt{$key}) { - set_int_value($key, $1); - # Get default for hex options - } elsif ($o =~ m|^"(0x)?([[:xdigit:]]+)"$| && exists $hexopt{$key}) { - set_hex_value($key, $2); - # Get default for string options - } elsif ($o =~ m|^"(.*)"$| && exists $stringopt{$key}) { - set_string_value($key, $1); - - # Override default for disabled tri/bool options - # We don't care about the default for tri/bool options otherwise - } elsif (!$o =~ /^(y|n|m|"yes"|"no")$/i && exists $tristate{$key}) { - print "Default is an expression at $file:$. $_\n" if $debug; - if ($if eq "") { - depends($key, "$o"); - } - } - if ($if ne "") { - # FIXME: What happens if no default clause exists? - # the $if won't be handled - depends($key, "$if || $o"); - } - - if ($disabled) { - $default_seen = 1; - $line = "\tdefault n\n"; - } - } else { - print "Skipping $file:$. $_" if $debug; - } - } continue { - if (cmp_ver($kernver, '2.6.37') < 0 && $line =~ m/visible\sif\s.*/) { - $line =~ s/visible\sif\s(.*)//; - print OUT $line; - print OUT "\tdepends on $1\n"; - } else { - print OUT $line; - } - } - close $in; -} - -sub parse_versions() -{ - my $in = new FileHandle; - my $ver; - - open $in, ') { - if (/\[(\d+\.\d+\.\d+)\]/) { - $ver = $1; - } elsif (/^\s*(\w+)/) { - $minver{$1} = $ver; - print "minimal version for $1 is $ver\n" if $debug; - } - } - close $in; -} - -# Read in the .version file to get the kernel version -sub get_version() -{ - open IN, '<.version' or die 'File not found: .version'; - while () { - if (/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)[\.-](\d+)/) { - $version=$1; - $level=$2; - $sublevel=$3; - return $kernver="$version.$level.$sublevel"; - } - } - close IN; -} - -# Like ver1 <=> ver2, but understands X.Y.Z version strings -sub cmp_ver($$) -{ - shift =~ /(\d+)\.(\d+)\.(\d+)/; - my ($v1_ver,$v1_level,$v1_sublevel) = ($1,$2,$3); - shift =~ /(\d+)\.(\d+)\.(\d+)/; - my ($v2_ver,$v2_level,$v2_sublevel) = ($1,$2,$3); - - my $cmp = $v1_ver <=> $v2_ver; - return $cmp unless($cmp == 0); - $cmp = $v1_level <=> $v2_level; - return $cmp unless($cmp == 0); - return $v1_sublevel <=> $v2_sublevel; -} - -# Get kernel version -get_version(); -print "Preparing to compile for kernel version $kernver\n"; - -# Get Kernel's config settings -%kernopts = process_config("$kernel/.config"); - -# Modules must be on, or building out of tree drivers makes no sense -if(!$kernopts{MODULES}) { - print <<"EOF"; -You appear to have loadable modules turned off in your kernel. You can -not compile the v4l-dvb drivers, as modules, and use them with a kernel -that has modules disabled. - -If you want to compile these drivers into your kernel, you should -use 'make kernel-links' to link the source for these drivers into -your kernel tree. Then configure and compile the kernel. -EOF - exit -1; -} - -# Kernel < 2.6.22 is missing the HAS_IOMEM option -if (!defined $kernopts{HAS_IOMEM} && cmp_ver($kernver, '2.6.22') < 0) { - $kernopts{HAS_IOMEM} = 2; -} - -# Kernel < 2.6.22 is missing the HAS_DMA option -if (!defined $kernopts{HAS_DMA} && cmp_ver($kernver, '2.6.22') < 0) { - $kernopts{HAS_DMA} = 2; -} - -# Kernel < 2.6.23 is missing the VIRT_TO_BUS option -if (!defined $kernopts{VIRT_TO_BUS} && cmp_ver($kernver, '2.6.23') < 0) { - # VIRT_TO_BUS -> !PPC64 - $kernopts{VIRT_TO_BUS} = 2 - $kernopts{PPC64}; -} - -# Kernel < 2.6.37 is missing the BKL option -if (!defined $kernopts{BKL} && cmp_ver($kernver, '2.6.37') < 0) { - $kernopts{BKL} = 2; -} - -# Kernel < 3.2 is missing the DMA_SHARED_BUFFER option -if (!defined $kernopts{DMA_SHARED_BUFFER} && cmp_ver($kernver, '3.2.0') < 0) { - $kernopts{DMA_SHARED_BUFFER} = 2; -} - -# Get minimum kernel version for our variables -parse_versions(); - -kernelcheck(); - -open OUT, ">Kconfig" or die "Cannot write Kconfig file"; -print OUT <<"EOF"; -mainmenu "V4L/DVB menu" -source Kconfig.kern -config VIDEO_KERNEL_VERSION - bool "Enable drivers not supported by this kernel" - default n - ---help--- - Normally drivers that require a kernel newer $version.$level.$sublevel, - the kernel you are compiling for now, will be disabled. - - Turning this switch on will let you enabled them, but be warned - they may not work properly or even compile. - - They may also work fine, and the only reason they are listed as - requiring a newer kernel is that no one has tested them with an - older one yet. - - If the driver works, please post a report to the V4L mailing list: - linux-media\@vger.kernel.org. - - Unless you know what you are doing, you should answer N. - -EOF - -open_kconfig('../linux', '../linux/drivers/media/Kconfig'); -open_kconfig('.', './Kconfig.sound'); -open_kconfig('.', './Kconfig.mm'); -open_kconfig('.', './Kconfig.misc'); -open_kconfig('../linux', './Kconfig.staging'); -close OUT; - -# These options should default to off -disable_config('DVB_AV7110_FIRMWARE'); -disable_config('DVB_CINERGYT2_TUNING'); -disable_config('VIDEO_HELPER_CHIPS_AUTO'); -disable_config('VIDEO_FIXED_MINOR_RANGES'); -disable_config('STAGING') if (!$enable_staging); -disable_config('STAGING_BROKEN'); -$config{'COMPILE_TEST'} = 0; -$intopt { "DVB_MAX_ADAPTERS" } = 8; - -# Check dependencies -my %newconfig = checkdeps(); - -# TODO: tell the user which options were disabled at this point -%config = %newconfig; - -# Create Kconfig.kern, listing all non-media (i.e. kernel) variables -# that something depended on. -$depend{MODULES}{always} = 1; # Make sure MODULES will appear -open OUT, '>Kconfig.kern' or die "Cannot write Kconfig.kern file: $!"; -while (my ($key, $deps) = each %depend) { - next if exists $config{$key}; # Skip media variables - - print OUT "# Needed by ", join(', ', keys %$deps), "\n"; - print OUT "config $key\n\ttristate\n"; - print OUT "\tdefault ", qw(n m y)[$kernopts{$key}], "\n\n"; - print OUT "\toption modules\n" if ($key eq "MODULES"); -} -close OUT; - -# Create make dependency rules for the Kconfig file -open OUT, '>.kconfig.dep' or die "Cannot write .kconfig.dep file: $!"; -print OUT 'Kconfig: '; -print OUT join(" \\\n\t", @kconfigfiles), "\n"; -close OUT; - -# Produce a .config file if forced or one doesn't already exist -if ($force_kconfig==1 || !-e '.config') { - open OUT, '>.config' or die "Cannot write .config file: $!"; - foreach (keys %tristate) { - if ($config{$_}) { - print OUT "CONFIG_$_=", qw(n m y)[$config{$_}], "\n"; - } else { - print OUT "# CONFIG_$_ is not set\n"; - } - } - while (my ($key,$value) = each %intopt) { - print OUT "CONFIG_$key=$value\n" if($config{$key}); - } - while (my ($key,$value) = each %hexopt) { - print OUT "CONFIG_$key=$value\n" if($config{$key}); - } - while (my ($key,$value) = each %stringopt) { - print OUT "CONFIG_$key=$value\n" if($config{$key}); - } - close OUT; - print "Created default (all yes) .config file\n"; -} - -# Check for full kernel sources and print a warning -sub kernelcheck() -{ - my $fullkernel="$kernsrc/fs/fcntl.c"; - if (! -e $fullkernel) { - print <<"EOF2"; - -***WARNING:*** You do not have the full kernel sources installed. -This does not prevent you from building the v4l-dvb tree if you have the -kernel headers, but the full kernel source may be required in order to use -make menuconfig / xconfig / qconfig. - -If you are experiencing problems building the v4l-dvb tree, please try -building against a vanilla kernel before reporting a bug. - -Vanilla kernels are available at http://kernel.org. -On most distros, this will compile a newly downloaded kernel: - -cp /boot/config-`uname -r` /.config -cd -make all modules_install install - -Please see your distro's web site for instructions to build a new kernel. - -EOF2 - } -print << "EOF3"; -WARNING: This is the V4L/DVB backport tree, with experimental drivers - backported to run on legacy kernels from the development tree at: - http://git.linuxtv.org/media-tree.git. - It is generally safe to use it for testing a new driver or - feature, but its usage on production environments is risky. - Don't use it in production. You've been warned. -EOF3 - sleep 5; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/makelinks.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/makelinks.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/makelinks.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/makelinks.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#!/bin/sh -# link drivers sources from CVS or release tarball into your 2.6.x kernel sources; - -if test -z $1 || ! test -d $1 ; then - echo - echo " usage: $0 " - echo - exit -fi - -echo "patching $1..." - -cd linux -PWD=`pwd` -FINDDIR="-name CVS -prune -o -type d" -FINDFILE="-name CVS -prune -o -type f -not -name .cvsignore\ - -not -name '*.rej' -not -name '*.orig'" - -for dir in drivers include Documentation; do - find $dir $FINDDIR -exec mkdir -p -v $1/{} \; - find $dir $FINDFILE -exec ln -f -s $PWD/{} $1/{} \; -done - -for dir in drivers/media include; do - find $dir $FINDDIR -exec ln -f -s $PWD/../v4l/compat.h $1/{} \; \ - -exec touch $1/{}/config-compat.h \; -done - -cat > $1/drivers/media/Kbuild <) { - # print STDERR "Line: $_"; - # Skip comment lines - if (/^\s*#/) { - print OUT $_; - next; - } - m/^\s*-?include/ and die "Can't handle includes! In $file"; - - # Handle line continuations - if (/\\\n$/) { - $_ .= <$in>; - redo; - } - - # $orig is what we will print, $_ is what we will parse - $orig = $_; - # Eat line continuations in string we will parse - s/\s*\\\n\s*/ /g; - # Eat comments - s/#.*$//; - - if (/^\s*obj-.*:?=\s*(\S.*?)\s*$/) { - # print STDERR "obj matched '$1'\n"; - check_line($dir, $1, $orig); # will print line for us - next; - } - if (/^\s*EXTRA_CFLAGS\s+\+?=\s*(\S.*?)\s*$/) { - # print STDERR "cflags matched '$1'\n"; - remove_includes($1, $orig); # will print line for us - next; - } - if (/^\s*ccflags-.*=\s*(\S.*?)\s*$/) { - # print STDERR "cflags matched '$1'\n"; - remove_includes($1, $orig); # will print line for us - next; - } - # Any flags should be added to already existing flags - $orig =~ s/ccflags-y\s*:=/ccflags-y +=/; - print OUT $orig; - } - close $in; -} - -my %obsolete; -sub getobsolete() -{ - open OBSOLETE, ') { - next if (/^\s*#/ || /^\s*$/); - chomp; - if (m|^(.*)/([^/]*)$|) { - $obsolete{$1}{"$2.ko"} = 1; - } else { - print "Unable to parse obsolete.txt:$.\n$_\n"; - } - } - - close OBSOLETE; -} - -sub removeobsolete() -{ - while ( my ($dir, $files) = each(%obsolete) ) { - print OUT "\t\@echo \"\\nRemoving obsolete files from \$(DESTDIR)\$(KDIR26)/$dir:\"\n"; - print OUT "\t\@files='", join(' ', keys %$files), "'; "; - - print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i\" ]; then "; - print OUT "echo -n \"\$\$i \";"; - print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; - - print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz\" ]; then "; - print OUT "echo -n \"\$\$i.gz \";"; - print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; - } -} - -# -# Special hack for Ubuntu with their non-standard dirs -# -sub removeubuntu($) -{ - my $udir = shift; - my $dest = "/lib/modules/\$(KERNELRELEASE)/$udir"; - my $filelist; - - while ( my ($dir, $files) = each(%srcdir) ) { - $filelist .= ' '. join(' ', keys %$files); - } - while ( my ($dir, $files) = each(%obsolete) ) { - $filelist .= ' ' . join(' ', keys %$files); - } - $filelist =~ s/\s+$//; - - print OUT "\t\@if [ -d $dest ]; then "; - print OUT "printf \"\\nHmm... distro kernel with a non-standard place for module backports detected.\\n"; - print OUT "Please always prefer to use vanilla upstream kernel with V4L/DVB\\n"; - print OUT "I'll try to remove old/obsolete LUM files from $dest:\\n\"; "; - print OUT "files='", $filelist, "'; "; - - print OUT "for i in \$\$files;do find \"$dest\" \-name \"\$\$i\" \-exec echo \'{}\' \';\' ;"; - print OUT " find \"$dest\" \-name \"\$\$i\" \-exec rm \'{}\' \';\' ;"; - print OUT " done;"; - print OUT " fi\n"; -} - -sub parse_dir() -{ - my $file = $File::Find::name; - - return if (!($file =~ /Makefile$/)); - open_makefile($file); -} - -############################################################################## - -getobsolete(); - -open OUT, '>Makefile.media' or die 'Unable to write Makefile.media'; -open_makefile('../linux/drivers/media/Makefile'); - -find({wanted => \&parse_dir, no_chdir => 1}, '../linux/drivers/staging'); -find({wanted => \&parse_dir, no_chdir => 1}, '../linux/drivers/misc'); - -# Creating Install rule -print OUT "media-install::\n"; - -removeobsolete(); -removeubuntu("kernel/ubuntu/media"); -removeubuntu("kernel/ubuntu/lirc"); -removeubuntu("/updates/dkms"); - -print OUT "\t\@echo \"Installing kernel modules under \$(DESTDIR)\$(KDIR26)/:\"\n"; - -# change source dirs (relative to v4l dir) -# into install dirs (relative to DESTDIR/KDIR26) -while (my ($dir, $files) = each %srcdir) { - my $idir = $dir; - $idir =~ s|\.\./linux/drivers/|../|; - $idir =~ s|\.\./media/?||; - $instdir{$idir} = $files; -} - -while (my ($dir, $files) = each %instdir) { - print OUT "\t\@n=0;for i in ", join(' ', keys %$files), ";do "; - print OUT "if [ -f \"\$\$i\" ]; then "; - print OUT "if [ \$\$n -eq 0 ]; then "; - print OUT "echo -n \"\t$dir/: \"; "; - print OUT "install -d \$(DESTDIR)\$(KDIR26)/$dir; fi; "; - print OUT "n=\$\$\(\(\$\$n+1\)\); "; - print OUT "if [ \$\$n -eq 4 ]; then echo; echo -n \"\t\t\"; n=1; fi; "; - print OUT "echo -n \"\$\$i \"; "; - print OUT "install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; "; - print OUT "if [ \$\$n -ne 0 ]; then echo; "; - print OUT "strip --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; "; - print OUT "fi;\n\n"; -} -print OUT "\t@echo\n"; -print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; - -# Creating Remove rule -print OUT "media-rminstall::\n"; - -removeobsolete(); -removeubuntu("/ubuntu/media"); -removeubuntu("/updates/dkms"); - -while ( my ($dir, $files) = each(%instdir) ) { - print OUT "\t\@echo \"\\nRemoving old \$(KDIR26)/$dir files:\"\n"; - print OUT "\t\@files='", join(' ', keys %$files), "'; "; - - print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i\" ]; then "; - print OUT "echo -n \"\$\$i \";"; - print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; - - print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz\" ]; then "; - print OUT "echo -n \"\$\$i.gz \";"; - print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; -} - -my $mediadeps = join(" \\\n", map("\t$_/Makefile", keys %srcdir )); -$mediadeps =~ s,\.\./linux/drivers/media/\.\.,..,g; - -# Print dependencies of Makefile.media -print OUT "Makefile.media: ../linux/drivers/media/Makefile \\\n"; -print OUT "\tobsolete.txt \\\n"; -print OUT $mediadeps; -print OUT "\n"; -close OUT; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_myconfig.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_myconfig.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/make_myconfig.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/make_myconfig.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -#!/usr/bin/perl - -# The purpose of this script is to produce a file named '.myconfig', in -# the same style as the '.config' file. Except .myconfig has disabled -# options explicitly set to 'n' rather than just omitted. This is to -# make sure they override any corresponding options that may be turned on -# in the Kernel's config files. -# The .myconfig file is what will be included in the v4l-dvb Makefile -# to control which drivers are built. - -my %config = (); -my %allconfig = (); - -open IN,".config"; -while () { - if (m/\s*(\w+)=\s*(\S*)/) { -#printf "%s=%s\n",$1,$2; - $config { $1 } = $2; - } -} -close IN; - -# Build table of _all_ bool and tristate config variables -my $key = 0; -open IN,"Kconfig"; -while () { - if (/^(?:menu)?config\s+(\w+)\s*$/) { - $key == 0 or die "Couldn't find type of config '$key'"; - $key = "CONFIG_$1"; - } elsif (/^\s+bool(ean)?\s/) { - $allconfig{$key} = 'bool'; - $key = 0; - } elsif (/^\s+tristate\s/) { - $allconfig{$key} = 'tristate'; - $key = 0; - } elsif (/^\s+(int|hex|string)\s/) { - $allconfig{$key} = 'data'; - $key = 0; - } -} -close IN; - -exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; - -# Produce output for including in a Makefile -# Explicitly set bool/tri options that didn't appear in .config to n -# 'data' options are only output if they appeared in .config -open OUT,">.myconfig"; -while ( my ($key, $value) = each(%allconfig) ) { - if ($value eq 'data') { - next unless (exists $config{$key}); - $value = $config{$key}; - } else { - $value = exists $config{$key} ? $config{$key} : 'n'; - } - printf OUT "%-44s := %s\n",$key,$value; -} -close OUT; diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/map-changelog media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/map-changelog --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/map-changelog 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/map-changelog 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -changeset = changelog.tmpl diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/modules.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/modules.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/modules.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/modules.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -#!/bin/sh - -function xrmmod() { - local module regex - module="$1" - regex=`echo $module | sed -e 's/[-_]/[-_]/g'` - grep -qe "$regex" /proc/modules || return 0 - echo "unload $module" - if test "$UID" = "0"; then - /sbin/rmmod $module - else - sudo /sbin/rmmod $module - fi -} - -function xinsmod() { - local module regex file args - module="$1" - shift - args="$*" - regex=`echo $module | sed -e 's/[-_]/[-_]/g'` - grep -qe "$regex" /proc/modules && return - file="" - test -f "$module.o" && file="$module.o" - test -f "$module.ko" && file="$module.ko" - if test "$file" != ""; then - echo "load $file $args" - if test "$UID" = "0"; then - /sbin/insmod $file $args - else - sudo /sbin/insmod $file $args - fi - else - echo "load $module $args" - if test "$UID" = "0"; then - /sbin/modprobe $module $args - else - sudo /sbin/modprobe $module $args - fi - fi -} - -function v4l2basic() { - for module in i2c-core i2c-algo-bit \ - videodev v4l2-common v4l1-compat \ - video-buf \ - soundcore - do - xinsmod $module - done -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/prepare-ChangeLog.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/prepare-ChangeLog.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/prepare-ChangeLog.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/prepare-ChangeLog.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,586 +0,0 @@ -#!/usr/bin/perl -w -# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2 -*- - -# Perl script to create a ChangeLog entry with names of files -# and functions from a hg diff. -# -# Darin Adler , started 20 April 2000 -# Java support added by Maciej Stachowiak -# last updated 28 December 2000 -# -# Mauro Carvalho Chehab : modified to -# allow signed-off-by tags, GMT Time and V4L format. -# CHANVE_LOG Env variables now are mandatory. -# Updated at 15 January 2005 -# -# Mauro Carvalho Chehab : modified to -# work with Mercurial -# Updated at 29 August 2005 -# -# Mauro Carvalho Chehab : modified to -# just generate a changelog entry -# Updated at 01 January 2006 -## -# (Someone put a license in here, like maybe GPL.) -# -# TODO: -# Provide option to put new ChangeLog into a separate file -# instead of editing the ChangeLog. -# For new files, just say "New file" instead of listing -# function names. -# List functions that have been removed too. -# Decide what a good logical order is for the changed files -# other than a normal text "sort" (top level first?) -# (group directories?) (.h before .c?) -# Leave a diff file behind if asked, but in unified format. -# Handle C++ and yacc source files too (other languages?). -# Help merge when there are ChangeLog conflicts or if there's -# already a partly written ChangeLog entry. -# Find appropriate ChangeLog to edit for each changed file -# instead of always using ChangeLog in current directory. -# Add command line option to put the ChangeLog into a separate -# file or just spew it out stdout. -# Figure out how to allow -z options from .cvsrc to work without -# letting other bad options work. Currently the -f disables -# everything from the .cvsrc. -# Add CVS version numbers for each file too (can't do that until -# the changes are checked in, though). -# Work around diff stupidity where deleting a function that starts -# with a comment makes diff think that the following function -# has been changed (if the following function starts with a comment -# with the same first line, such as /**) -# Work around diff stupidity where deleting an entire function and -# the blank lines before it makes diff think you've changed the -# previous function. - -use diagnostics; -use strict; - -use English; -use Text::Wrap; - -# Get environment variables required. -my $name = $ENV{CHANGE_LOG_NAME}; -my $email_address = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; -my $login = $ENV{CHANGE_LOG_LOGIN}; - -my $outfile = shift || ""; - -if (!defined $name) - { - print STDERR "Please, define env var CHANGE_LOG_NAME.\n"; - exit; - } -if (!defined $email_address) - { - print STDERR "Please, define env var CHANGE_LOG_EMAIL_ADDRESS.\n"; - exit; - } -if (!defined $login) - { - print STDERR "Please, define env var CHANGE_LOG_LOGIN.\n"; - exit; - } - -# For each file, build a list of modified lines. -# Use line numbers from the "after" side of each diff. -print STDERR " Running hg diff to find changes.\n"; -my %changed_line_ranges; -my $file; -open DIFF, "hg diff |" or die "The hg diff failed: $OS_ERROR.\n"; -while () - { - $file = $1 if /^diff -r .* (\S+)$/; - if (defined $file) - { - push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ]; - } - } -close DIFF; -if (!%changed_line_ranges) - { - print STDERR " No changes found.\n"; - exit; - } - -# For each ".c" file, convert line range to function list. -print STDERR " Extracting affected function names from C source files.\n"; -my %function_lists; -foreach my $file (keys %changed_line_ranges) - { - # An empty function list still indicates that something changed. - $function_lists{$file} = ""; - - # Only look for function names in .c files. - next unless $file =~ /\.(c|java)/; - - # Find all the functions in the file. - open SOURCE, $file or next; - my @function_ranges = get_function_line_ranges(\*SOURCE, $file); - close SOURCE; - - # Find all the modified functions. - my @functions; - my %saw_function; - my @change_ranges = (@{$changed_line_ranges{$file}}, []); - my @change_range = (0, 0); - FUNCTION: foreach my $function_range_ref (@function_ranges) - { - my @function_range = @$function_range_ref; - - # Advance to successive change ranges. - for (;; @change_range = @{shift @change_ranges}) - { - last FUNCTION unless @change_range; - - # If past this function, move on to the next one. - next FUNCTION if $change_range[0] > $function_range[1]; - - # If an overlap with this function range, record the function name. - if ($change_range[1] >= $function_range[0] - and $change_range[0] <= $function_range[1]) - { - if (!$saw_function{$function_range[2]}) - { - $saw_function{$function_range[2]} = 1; - push @functions, $function_range[2]; - } - next FUNCTION; - } - } - } - - # Format the list of functions now. - $function_lists{$file} = " (" . join("), (", @functions) . "):" if @functions; - } - -# Write out a new ChangeLog file. -print STDERR " Editing the ChangeLog file.\n"; -my $date = sprintf "%d-%02d-%02d %02d:%02d", - 1900 + (gmtime $BASETIME)[5], # year - 1 + (gmtime $BASETIME)[4], # month - (gmtime $BASETIME)[3], # day within month - (gmtime $BASETIME)[2], # hour - (gmtime $BASETIME)[1]; # min - -if ($outfile eq "") { - open CHANGE_LOG, ">&STDOUT"; -} else { - open CHANGE_LOG, "> $outfile" or die "Could not write to $outfile\n."; -} -print CHANGE_LOG "$date $login\n\n"; -foreach my $file (sort keys %function_lists) - { - my $lines = wrap("\t", "\t", "XX$file:$function_lists{$file}"); - $lines =~ s/^\tXX/\t* /; - print CHANGE_LOG "$lines\n"; - } -print CHANGE_LOG "\n\tSigned-off-by: $name <$email_address>\n"; -close CHANGE_LOG; - -# Done. -print STDERR " Done editing ChangeLog.\n"; -exit; - - - -sub get_function_line_ranges - { - my ($file_handle, $file_name) = @_; - - if ($file_name =~ /\.c$/) { - return get_function_line_ranges_for_c ($file_handle, $file_name); - } elsif ($file_name =~ /\.java$/) { - return get_function_line_ranges_for_java ($file_handle, $file_name); - } - return (); - } - -# Read a file and get all the line ranges of the things that look like C functions. -# A function name is the last word before an open parenthesis before the outer -# level open brace. A function starts at the first character after the last close -# brace or semicolon before the function name and ends at the close brace. -# Comment handling is simple-minded but will work for all but pathological cases. -# -# Result is a list of triples: [ start_line, end_line, function_name ]. - -sub get_function_line_ranges_for_c - { - my ($file_handle, $file_name) = @_; - - my @ranges; - - my $in_comment = 0; - my $in_macro = 0; - my $in_parentheses = 0; - my $in_braces = 0; - - my $word = ""; - - my $potential_start = 0; - my $potential_name = ""; - - my $start = 0; - my $name = ""; - - while (<$file_handle>) - { - # Handle continued multi-line comment. - if ($in_comment) - { - next unless s-.*\*/--; - $in_comment = 0; - } - - # Handle continued macro. - if ($in_macro) - { - $in_macro = 0 unless /\\$/; - next; - } - - # Handle start of macro (or any preprocessor directive). - if (/^\s*\#/) - { - $in_macro = 1 if /^([^\\]|\\.)*\\$/; - next; - } - - # Handle comments and quoted text. - while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy - { - my $match = $1; - if ($match eq "/*") - { - if (!s-/\*.*?\*/--) - { - s-/\*.*--; - $in_comment = 1; - } - } - elsif ($match eq "//") - { - s-//.*--; - } - else # ' or " - { - if (!s-$match([^\\]|\\.)*?$match--) - { - warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n"; - s-$match.*--; - } - } - } - - # Find function names. - while (m-(\w+|[(){};])-g) - { - # Open parenthesis. - if ($1 eq "(") - { - $potential_name = $word unless $in_parentheses; - $in_parentheses++; - next; - } - - # Close parenthesis. - if ($1 eq ")") - { - $in_parentheses--; - next; - } - - # Open brace. - if ($1 eq "{") - { - # Promote potiential name to real function name at the - # start of the outer level set of braces (function body?). - if (!$in_braces and $potential_start) - { - $start = $potential_start; - $name = $potential_name; - } - - $in_braces++; - next; - } - - # Close brace. - if ($1 eq "}") - { - $in_braces--; - - # End of an outer level set of braces. - # This could be a function body. - if (!$in_braces and $name) - { - push @ranges, [ $start, $INPUT_LINE_NUMBER, $name ]; - $name = ""; - } - - $potential_start = 0; - $potential_name = ""; - next; - } - - # Semicolon. - if ($1 eq ";") - { - $potential_start = 0; - $potential_name = ""; - next; - } - - # Word. - $word = $1; - if (!$in_parentheses) - { - $potential_start = 0; - $potential_name = ""; - } - if (!$potential_start) - { - $potential_start = $INPUT_LINE_NUMBER; - $potential_name = ""; - } - } - } - - warn "mismatched braces in $file_name\n" if $in_braces; - warn "mismatched parentheses in $file_name\n" if $in_parentheses; - - return @ranges; - } - - - -# Read a file and get all the line ranges of the things that look like Java -# classes, interfaces and methods. -# -# A class or interface name is the word that immediately follows -# `class' or `interface' when followed by an open curly brace and not -# a semicolon. It can appear at the top level, or inside another class -# or interface block, but not inside a function block -# -# A class or interface starts at the first character after the first close -# brace or after the function name and ends at the close brace. -# -# A function name is the last word before an open parenthesis before -# an open brace rather than a semicolon. It can appear at top level or -# inside a class or interface block, but not inside a function block. -# -# A function starts at the first character after the first close -# brace or after the function name and ends at the close brace. -# -# Comment handling is simple-minded but will work for all but pathological cases. -# -# Result is a list of triples: [ start_line, end_line, function_name ]. - -sub get_function_line_ranges_for_java - { - my ($file_handle, $file_name) = @_; - - my @current_scopes; - - my @ranges; - - my $in_comment = 0; - my $in_macro = 0; - my $in_parentheses = 0; - my $in_braces = 0; - my $in_non_block_braces = 0; - my $class_or_interface_just_seen = 0; - - my $word = ""; - - my $potential_start = 0; - my $potential_name = ""; - my $potential_name_is_class_or_interface = 0; - - my $start = 0; - my $name = ""; - my $current_name_is_class_or_interface = 0; - - while (<$file_handle>) - { - # Handle continued multi-line comment. - if ($in_comment) - { - next unless s-.*\*/--; - $in_comment = 0; - } - - # Handle continued macro. - if ($in_macro) - { - $in_macro = 0 unless /\\$/; - next; - } - - # Handle start of macro (or any preprocessor directive). - if (/^\s*\#/) - { - $in_macro = 1 if /^([^\\]|\\.)*\\$/; - next; - } - - # Handle comments and quoted text. - while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy - { - my $match = $1; - if ($match eq "/*") - { - if (!s-/\*.*?\*/--) - { - s-/\*.*--; - $in_comment = 1; - } - } - elsif ($match eq "//") - { - s-//.*--; - } - else # ' or " - { - if (!s-$match([^\\]|\\.)*?$match--) - { - warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n"; - s-$match.*--; - } - } - } - - # Find function names. - while (m-(\w+|[(){};])-g) - { - # Open parenthesis. - if ($1 eq "(") - { - if (!$in_parentheses) { - $potential_name = $word; - $potential_name_is_class_or_interface = 0; - } - $in_parentheses++; - next; - } - - # Close parenthesis. - if ($1 eq ")") - { - $in_parentheses--; - next; - } - - # Open brace. - if ($1 eq "{") - { - # Promote potiential name to real function name at the - # start of the outer level set of braces (function/class/interface body?). - if (!$in_non_block_braces - and (!$in_braces or $current_name_is_class_or_interface) - and $potential_start) - { - if ($name) - { - push @ranges, [ $start, ($INPUT_LINE_NUMBER - 1), - join ('.', @current_scopes) ]; - } - - - $current_name_is_class_or_interface = $potential_name_is_class_or_interface; - - $start = $potential_start; - $name = $potential_name; - - push (@current_scopes, $name); - } else { - $in_non_block_braces++; - } - - $potential_name = ""; - $potential_start = 0; - - $in_braces++; - next; - } - - # Close brace. - if ($1 eq "}") - { - $in_braces--; - - # End of an outer level set of braces. - # This could be a function body. - if (!$in_non_block_braces) - { - if ($name) - { - push @ranges, [ $start, $INPUT_LINE_NUMBER, - join ('.', @current_scopes) ]; - - pop (@current_scopes); - - if (@current_scopes) - { - $current_name_is_class_or_interface = 1; - - $start = $INPUT_LINE_NUMBER + 1; - $name = $current_scopes[$#current_scopes-1]; - } - else - { - $current_name_is_class_or_interface = 0; - $start = 0; - $name = ""; - } - } - } - else - { - $in_non_block_braces-- if $in_non_block_braces; - } - - $potential_start = 0; - $potential_name = ""; - next; - } - - # Semicolon. - if ($1 eq ";") - { - $potential_start = 0; - $potential_name = ""; - next; - } - - if ($1 eq "class" or $1 eq "interface") { - $class_or_interface_just_seen = 1; - next; - } - - # Word. - $word = $1; - if (!$in_parentheses) - { - if ($class_or_interface_just_seen) { - $potential_name = $word; - $potential_start = $INPUT_LINE_NUMBER; - $class_or_interface_just_seen = 0; - $potential_name_is_class_or_interface = 1; - next; - } - } - if (!$potential_start) - { - $potential_start = $INPUT_LINE_NUMBER; - $potential_name = ""; - } - $class_or_interface_just_seen = 0; - } - } - - warn "mismatched braces in $file_name\n" if $in_braces; - warn "mismatched parentheses in $file_name\n" if $in_parentheses; - - return @ranges; - } diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/prep_commit_msg.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/prep_commit_msg.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/prep_commit_msg.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/prep_commit_msg.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -#!/usr/bin/perl - -my $diff = 'diff'; -if ($ARGV[0] eq '-q') { - $diff = 'qdiff'; - shift; -} -my $autopatch = shift; - -# Get Hg username from environment -my $user = $ENV{HGUSER}; - -sub hgrcuser($) -{ - my $file = shift; - my $ui = 0; - open IN, '<', $file; - while () { - $ui = 1 if (/^\s*\[ui\]/); - if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { - close IN; - return($1); - } - } - close IN; - return(""); -} - -# Didn't work? Try the repo's .hgrc file -if ($user eq "") { - my $hgroot = `hg root`; - chomp($hgroot); - $user = hgrcuser("$hgroot/.hg/hgrc"); -} -# Ok, try ~/.hgrc next -if ($user eq "") { - $user = hgrcuser("$ENV{HOME}/.hgrc"); -} - -# Still no luck? Try some other environment variables -if ($user eq "") { - my $name = $ENV{CHANGE_LOG_NAME}; - my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; - $user = "$name <$email>" if ($name ne "" || $email ne ""); -} - -# Last try to come up with something -if ($user eq "") { - $user = "$ENV{USER} <>"; -} - -$checkpatch=$ENV{CHECKPATCH}; - -if (!$checkpatch) { - $checkpatch="/lib/modules/`uname -r`/build/scripts/checkpatch.pl"; -} - -my $cp_version; -open IN,"$checkpatch|"; -while () { - tr/A-Z/a-z/; - if (m/version\s*:\s*([\d\.]+)/) { - $cp_version = $1; - } -} -close IN; - -my $intree_checkpatch = "scripts/checkpatch.pl --no-tree"; -if (!open IN,"$intree_checkpatch|") { - $intree_checkpatch = "v4l/".$intree_checkpatch; - open IN,"$intree_checkpatch|"; -} -while () { - tr/A-Z/a-z/; - if (m/version\s*:\s*([\d\.]+)/) { - if ($1 > $cp_version) { - print "# WARNING: $checkpatch version $cp_version is\n" - ."# older than $intree_checkpatch version" - ." $1.\n# Using in-tree one.\n#\n"; - $cp_version = $1; - $checkpatch = $intree_checkpatch; - } - } -} -close IN; - -print "# Added/removed/changed files:\n"; -system "hg $diff | diffstat -p1 -c"; - -open IN,"hg $diff | $checkpatch -q --nosignoff -|"; -my $err=0; -while () { - if (!$err) { - print "#\n# WARNING: $checkpatch version $cp_version returned ". - "some errors.\n# Please fix.\n#\n"; - - - $err=1; - } - print "# $_"; -} -close IN; - - -if (-s $autopatch) { - print "#\n# Note, a problem with your patch was detected! These changes were made\n"; - print "# automatically: $autopatch\n"; - system "diffstat -p0 -c $autopatch"; - print "#\n# Please review these changes and see if they belong in your patch or not.\n"; -} -if ($diff eq 'qdiff') { - # Use existing mq patch logfile? - open IN, "hg qheader |"; - my @header = ; - close IN; - - if ($#header > 0) { - # Use existing header - print @header; - exit; - } - # No header, use pre-made log message below - - # Hg will strip lines that start with "From: " from mq patch headers! - # In order to stop it, we insert this extra From line at the top, - # Hg will strip it and then leave the real from line alone. - print "From: $user\n\n"; -} -print <<"EOF"; -# -# Patch Subject (a brief description with less than 74 chars): - - -# From Line, identifying the name of the patch author -From: $user - -# A detailed description: - -# NEW: Please change the priority of the patch to "high" if the patch is -# a bug fix, or are meant to be applied at the first upstream -# version of a new driver whose changes don't depend on changes on -# core modules -Priority: normal - -# At the end Signed-off-by: fields by patch author and committer, at least. -Signed-off-by: $user -EOF diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/release.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/release.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/release.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/release.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -#!/bin/sh - -# config -release="$HOME/kernel/release" -ver_bt="0.9.15" -ver_sa="0.2.12" -ver_cx="0.0.4" - -# common files -files_v4l="v4l*.[ch] video-buf.[ch] videodev*.h" -files_tuner="tuner.[ch] tda9887.[ch]" -files_i2c="id.h audiochip.h" -files_common="$files_v4l $files_tuner $files_i2c doc" - -# other files -files_ir="ir-common.[ch]" -files_audio="msp3400.[ch] tvaudio.[ch]" - -files_bttv="bt848.h btcx*.[ch] bttv*.[ch] ir-kbd*.c" -files_saa="saa7134*.[ch] saa6752hs.[ch] ir-kbd-i2c.c" -files_cx="btcx*.[ch] cx*.[ch]" - - -###################################################################################### -# helpers - -function build_release () { - local name="$1"; shift - local version="$1"; shift - local files="$*" - local dest="$WORK/$name-$version" - local tarball="$release/$name-$version.tar.gz" - - # copy / prepare stuff - mkdir "$dest" - cp -av $files "$dest" || exit 1 - cp -v Makefile "$dest" - cp -v "scripts/config.$name" "$dest"/Make.config - - # build test - (cd $dest; make) || exit 1 -# (cd $dest; ls *.o; sleep 5) - (cd $dest; make clean) - - # build tarball - tar czCf "$WORK" "$tarball" "$name-$version" -} - - -###################################################################################### -# main - -# tmp dir for my files -WORK="${TMPDIR-/tmp}/${0##*/}-$$" -mkdir "$WORK" || exit 1 -trap 'rm -rf "$WORK"' EXIT - -build_release "bttv" "$ver_bt" \ - "$files_common" "$files_ir" "$files_audio" "$files_bttv" -build_release "saa7134" "$ver_sa" \ - "$files_common" "$files_ir" "$files_audio" "$files_saa" -build_release "cx88" "$ver_cx" \ - "$files_common" "$files_cx" diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/rmmod.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/rmmod.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/rmmod.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/rmmod.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,291 +0,0 @@ -#!/usr/bin/perl -use strict; -use File::Find; -use Proc::ProcessTable; - - -my %depend = (); -my %depend2 = (); -my %rmlist = (); -my @nodep; -my @modlist; -my @allmodules; -my %reqmodules; -my %loaded = (); -my $i=0; - -# Device debug parameters -# Module name Debug option -my %debug = ( "tuner" => "tuner_debug=1", - "dvb-core" => "cam_debug=1", - "dvb-ttpci" => "debug=247", - "b2c2-flexcop" => "debug=0x01", - "b2c2-flexcop-usb" => "debug=0x01", - "b2c2-flexcop-pci" => "debug=0x01", - "dvb-usb" => "debug=0x33", - "dvb-usb-gp8psk" => "debug=0x03", - "dvb-usb-vp7045" => "debug=0x03", - "dvb-usb-dtt200u" => "debug=0x03", - "dvb-usb-dibusb-common" => "debug=0x03", - ); - -sub getobsolete() -{ - my @obsolete; - open OBSOLETE, ') { - next if (/^\s*#/ || /^\s*$/); - chomp; - m|^.*/([^/]+)$| and push @obsolete, $1; - } - - close OBSOLETE; - return @obsolete; -} - -sub findprog($) -{ - foreach(split(/:/, $ENV{PATH}),qw(/sbin /usr/sbin /usr/local/sbin)) { - return "$_/$_[0]" if(-x "$_/$_[0]"); - } - die "Can't find needed utility '$_[0]'"; -} - -sub parse_dir { - my $file = $File::Find::name; - my $modinfo = findprog('modinfo'); - - if (!($file =~ /[.]ko$/)) { - return; - } - - my $module = $file; - $module =~ s|^[./]*(.*)[.]ko|\1|; - - open IN, "$modinfo $file|grep depends|cut -b 17-|"; - while () { - my $deps = $_; - $deps =~ s/\n//; - $deps =~ s/[,]/ /g; - $deps = " $deps "; - $depend{$module} = $deps; - push @allmodules, $module; - $i++; - } - close IN; -} - -sub parse_loaded { - open IN, "/proc/modules"; - while () { - m/^([\w\d_-]+)/; - $loaded{$1}=1; - } - close IN; -} - -sub cleandep() -{ - my $dep; - - while ( my ($k, $v) = each(%depend) ) { - my $arg=$v; - my $arg2=" "; - while (!($arg =~ m/^\s*$/)) { - if ($arg =~ m/^ ([^ ]+) /) { - my $val=$1; - if (exists($depend{$val})) { - $arg2="$arg2 $val "; - } else { - $reqmodules{$val}=1; - } - } - $arg =~ s/^ [^ ]+//; - $arg2 =~ s/\s\s+/ /; - } - $depend2 { $k } = $arg2; - } - -} - -sub rmdep() -{ - my $dep; - - while ($dep=pop @nodep) { - while ( my ($k, $v) = each(%depend2) ) { - if ($v =~ m/\s($dep)\s/) { - $v =~ s/\s${dep}\s/ /; - $v =~ s/\s${dep}\s/ /; - $v =~ s/\s${dep}\s/ /; - $depend2 {$k} = $v; - } - } - } -} - -sub orderdep () -{ - my $old; - do { - $old=$i; - while ( my ($key, $value) = each(%depend2) ) { - if ($value =~ m/^\s*$/) { - push @nodep, $key; - push @modlist, $key; - $i=$i-1; - delete $depend2 {$key}; - } - } - rmdep(); - } until ($old==$i); - while ( my ($key, $value) = each(%depend2) ) { - printf "ERROR: bad dependencies - $key ($value)\n"; - } -} - -sub insmod ($) -{ - my $debug=shift; - my $modprobe = findprog('modprobe'); - my $insmod = findprog('insmod'); - - while ( my ($key, $value) = each(%reqmodules) ) { - print ("$modprobe $key\n"); - system ("$modprobe $key"); - } - - foreach my $key (@modlist) { - if ($debug) { - my $dbg=$debug{$key}; - - print "$insmod ./$key.ko $dbg\n"; - system "$insmod ./$key.ko $dbg\n"; - } else { - print "$insmod ./$key.ko\n"; - system "$insmod ./$key.ko\n"; - } - } -} - -my @pulse; -my $try_pulseaudio = 1; - -sub check_pulseaudio() -{ - my $t = new Proc::ProcessTable; - foreach my $p ( @{$t->table} ) { - push @pulse, $p->uid if ($p->cmndline =~m,/pulseaudio ,); - } - $try_pulseaudio = 0 if (!@pulse); - - print "Pulseaudio is running with UUID(s): @pulse\n"; -} - -sub unload_pulseaudio($) -{ - my $driver_name = shift; - my $cur_module; - - return if (!$try_pulseaudio); - - check_pulseaudio() if (!@pulse); - return if (!$try_pulseaudio); - - for my $pid (@pulse) { - my $user = getpwuid($pid); - -# printf "LANG=C su $user -c \"pacmd list-sources\" |\n"; - open IN, "LANG=C su $user -c \"pacmd list-sources\" |"; - while () { - $cur_module = $1 if (/^\s*module:\s*(\d+)/); - - if (/^\s*alsa.driver_name\s*=\s*"(.*)"/) { - if ($1 eq $driver_name) { -# print "LANG=C su $user -c \"pactl unload-module $cur_module\"\n"; - system ("LANG=C su $user -c \"pactl unload-module $cur_module\""); - } - next; - } - - # Special case: em28xx sometimes use a Vendor Class at - # the same interface as the video node. Pulseaudio can't - # get the driver name in this case - if (/^\s*alsa.card_name\s*=\s*"Em28xx/) { -# print "LANG=C su $user -c \"pactl unload-module $cur_module\"\n"; - system ("LANG=C su $user -c \"pactl unload-module $cur_module\""); - } - } - close IN; - -# printf "LANG=C su $user -c \"pacmd list-sinks\" |\n"; - open IN, "LANG=C su $user -c \"pacmd list-sinks\" |" or return; - while () { - $cur_module = $1 if (/^\s*module:\s*(\d+)/); - if (/^\s*alsa.driver_name\s*=\s*"(.*)"/) { - if ($1 eq $driver_name) { -# print "LANG=C su $user -c \"pactl unload-module $1\"\n"; - system ("LANG=C su $user -c \"pactl unload-module $1\""); - } - } - } - } - close IN; -} - -sub rmmod(@) -{ - my $rmmod = findprog('rmmod'); - my @not; - foreach (reverse @_) { - s/-/_/g; - if (exists ($loaded{$_})) { - my $module = $_; - print "$rmmod $module\n"; - unload_pulseaudio($module); - unshift @not, $module if (system "$rmmod $module"); - } - } - return @not; -} - -sub prepare_cmd() -{ - find(\&parse_dir, "."); - printf "found $i modules\n"; - - cleandep(); - orderdep(); -} - -# main -my $mode=shift; -if ($mode eq "load") { - prepare_cmd; - insmod(0); -} else { - if ($mode eq "unload") { - prepare_cmd; - parse_loaded; - my @notunloaded = rmmod(@modlist, getobsolete()); - @notunloaded = rmmod(@notunloaded) if (@notunloaded); - if (@notunloaded) { - print "Couldn't unload: ", join(' ', @notunloaded), "\n"; - } - } elsif ($mode eq "reload") { - prepare_cmd; - parse_loaded; - rmmod(@modlist); - insmod(0); - } elsif ($mode eq "debug") { - prepare_cmd; - parse_loaded; - insmod(1); - } elsif ($mode eq "check") { - prepare_cmd; - parse_loaded; - } else { - printf "Usage: $0 [load|unload|reload|debug|check]\n"; - } -} - diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/saa7134.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/saa7134.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/saa7134.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/saa7134.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my %map = ( - "PCI_ANY_ID" => "0", - "PCI_VENDOR_ID_PHILIPS" => "1131", - "PCI_VENDOR_ID_ASUSTEK" => "1043", - "PCI_VENDOR_ID_MATROX" => "102B", -); - -sub fix_id($) { - my $id = shift; - $id = $map{$id} if defined($map{$id}); - $id =~ s/^0x//; - return $id; -} - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s+(SAA7134_BOARD_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # saa7134_boards - if (/\[(SAA7134_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; -# $data{$id}->{nr} = $nr++; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # saa7134_pci_tbl - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+)\s*,*/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+)\s*,*/); - if (/.driver_data\s*=\s*(\w+)\s*,*/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0") { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - undef $subvendor; - undef $subdevice; - } - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-40s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/saa7164.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/saa7164.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/saa7164.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/saa7164.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my %map = ( - "PCI_ANY_ID" => "0", -); - -sub fix_id($) { - my $id = shift; - $id = $map{$id} if defined($map{$id}); - $id =~ s/^0x//; - return $id; -} - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s+(SAA7164_BOARD_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # saa7164_boards - if (/\[(SAA7164_BOARD_\w+)\]/) { - $id = $1; - $data{$id}->{id} = $id; -# $data{$id}->{nr} = $nr++; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } - - # saa7164_pci_tbl - $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); - $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); - if (/.card\s*=\s*(\w+),/) { - if (defined($data{$1}) && - defined($subvendor) && $subvendor ne "0" && - defined($subdevice) && $subdevice ne "0") { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - undef $subvendor; - undef $subdevice; - } - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/strip-trailing-whitespaces.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/strip-trailing-whitespaces.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/strip-trailing-whitespaces.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/strip-trailing-whitespaces.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh -# Strips trailing whitespace. Leading spaces and spaces after tabs are -# converted to the equivalent sequence of tabs only. - -# Use the option "fast" to only check files Hg thinks are new or modified. -# The option "manifest" will use Hg's manifest command to check all files -# under Hg revision control. -# Otherwise, all files under the linux tree are checked, except files in CVS -# directories and .cvsignore files. This is the historical behavior. - - -if [ "x$1" = "xfast" ]; then - files="hg status -man" -elif [ "x$1" = "xqfast" ]; then - files="hg status --rev -2 -man" -elif [ "x$1" = "xmanifest" ]; then - files="hg manifest | cut '-d ' -f3" -else - files="find linux -type f -print" -fi - -for file in `eval $files`; do - case "$file" in - *.gif | *.pdf | *.patch | *.h.xml | *.c.xml) - continue - ;; - esac - - perl -ne ' - s/[ \t]+$//; - s<^ {8}> <\t>; - s<^ {1,7}\t> <\t>; - while( s<\t {8}> <\t\t>g || s<\t {1,7}\t> <\t\t>g ) {}; - print' < "${file}" | \ - diff -u --label="$file" "$file" --label="$file" - -done diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/tuner.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/tuner.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/tuner.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/tuner.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -my $H = shift; -my $C = shift; -my %blacklist; - -open IN, "<$H"; -while () { - # defines in header file - if (/#define\s+(TUNER_\w+)\s+(\d+)/) { - my $num=$2; - $data{$1}->{nr} = $num; - if (/#define\s+TUNER_TDA9887/) { - $blacklist{$num}=1; - } - next; - } -} -close IN; - -open IN, "<$C"; -while () { - # tuners - if (/\[(TUNER_\w+)\]/) { - $id = $1; - if ($id =~ m/TUNER_MAX/) { - next; - } - $data{$id}->{id} = $id; - }; - next unless defined($id); - - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - if ($blacklist{$data{$item}->{nr}}) { - next; - } - - printf("tuner=%d - %s", $data{$item}->{nr}, $data{$item}->{name}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/update media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/update --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/update 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/update 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -#!/bin/sh -source scripts/modules.sh -set -e - -case "`hostname --short`" in - eskarina) -# btopt="card=10" -# btopt="card=6 remote=1" - ;; - bogomips) - saopt="card=7" - ;; -esac - -########################################################################### -# unload - -# bttv -xrmmod dst -xrmmod bt878 -xrmmod ir-kbd-gpio -xrmmod ir-kbd-i2c -xrmmod bttv - -# cx88 -xrmmod cx88-dvb -xrmmod cx88-blackbird -xrmmod cx8802 -xrmmod cx8801 -xrmmod cx8800 -xrmmod cx88xx - -# saa7134 -xrmmod saa7134-dvb -xrmmod saa7134-empress -xrmmod saa7134 - -# saa7146 -xrmmod dvb_ttpci -xrmmod saa7146_vv - -# dvb -xrmmod or51132 -xrmmod cx22702 -xrmmod mt352 -xrmmod dvb-pll - -# common -xrmmod btcx-risc -xrmmod ir-common -xrmmod video-buf-dvb -xrmmod video-buf - -# i2c -xrmmod tuner -xrmmod msp3400 -xrmmod tvaudio -xrmmod tda9887 -xrmmod tveeprom - -########################################################################## -# reload - -sync; sleep 1; - -# common -v4l2basic -#xrmmod video-buf -#xinsmod video-buf debug=0 -#xrmmod v4l1-compat -#xinsmod v4l1-compat debug=1 - -xinsmod tveeprom debug=0 -xinsmod dvb-pll debug=0 -xinsmod btcx-risc debug=0 -xinsmod ir-common debug=0 repeat=0 -xinsmod tuner tuner_debug=0 -xinsmod tda9887 debug=0 qss=1 -xinsmod msp3400 debug=0 - -# bttv -xinsmod ir-kbd-i2c debug=0 -xinsmod bttv bttv_debug=0 vbi_debug=0 irq_debug=0 \ - fdsr=0 chroma_agc=1 vbibufs=4 irq_iswitch=0 i2c_scan=1 $btopt -xinsmod ir-kbd-gpio debug=0 - -# cx88 -xinsmod cx88xx core_debug=0 audio_debug=0 ir_debug=1 \ - i2c_debug=1 i2c_scan=1 -xinsmod cx8800 video_debug=0 vbi_debug=0 -xinsmod cx8801 -xinsmod cx8802 -xinsmod cx88-blackbird - -# saa7134 -xinsmod saa7134 audio_debug=0 i2c_scan=0 i2c_debug=0 oss=1 $saopt -xinsmod saa7134-empress - -# dvb stuff -xinsmod cx22702 debug=0 -xinsmod mt352 debug=1 -xinsmod or51132 -xinsmod tda1004x -xinsmod video-buf-dvb -xinsmod cx88-dvb -xinsmod saa7134-dvb diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/usbaudio_setup.sh media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/usbaudio_setup.sh --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/usbaudio_setup.sh 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/usbaudio_setup.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2006 Markus Rechberger -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -which /usr/bin/dialog >/dev/null -if [ "0" != "$?" ]; then -echo "this tool requires \"dialog\" (http://hightek.org/dialog/)" -exit 1 -fi -uid=`id -u` -if [ "0" != "$uid" ]; then -echo "this tool must be run as root, you can disable this message by editing the script but only do that unless you know what you're doing!" -exit 1 -fi -which gcc > /dev/null -if [ "0" != "$?" ]; then -echo "this tool won't work unless you install gcc" -exit 1 -fi -test -f ossid -if [ "0" != "$?" ]; then -cat > ossid.c <<_EOF -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv){ - int fd; - struct mixer_info *info; - fd=open(argv[1],O_RDONLY); - if(fd>=0){ - info=malloc(sizeof(struct mixer_info)); - ioctl(fd,SOUND_MIXER_INFO,info); - printf("%c \"%s %s\"\n",(argv[1][strlen(argv[1])-1]=='p')?'0':(argv[1][strlen(argv[1])-1]+1),info->name,info->id); - free(info); - close(fd); - } else { - return 1; - } - return 0; -} -_EOF -gcc ossid.c -o ossid -rm ossid.c -fi - -test -f /proc/asound/cards -if [ "0" != "$?" ]; then -dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ ---msgbox "Your system doesn't support ALSA, please have a look at \ -www.alsa-project.org and set it up properly \ - - -Press any key to continue... " 11 50 -exit 1; -fi - -dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ ---msgbox "This tool was written to ease up sound configuration for -* Terratec Hybrid XS -* Terratec Cinergy 250 USB 2.0 -* Hauppauge HVR 900 -* and possible others :) - -first select an usb audio source, as target choose your soundcard -Press any key to continue... " 13 60 - -ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your TV Audio source:" 12 60 5 2>/tmp/em2880_source.$$ -ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your output soundcard device:" 12 60 5 2>/tmp/em2880_dst.$$ - -source=`egrep '^[0-9p]' /tmp/em2880_source.$$` -dst=`egrep '^[0-9p]' /tmp/em2880_dst.$$` - -echo "playing $source to $dst"; -if [ "$source" = "0" ]; then - device="/dev/dsp" -else - device="/dev/dsp`expr $source - 1`" -fi - -if [ "$dst" = "0" ]; then - device2="/dev/dsp" -else - device2="/dev/dsp`expr $source - 1`" -fi -clear -echo "Using command: sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2" -sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2 diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/usbvision.pl media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/usbvision.pl --- media-build-dkms-0004~trusty/media-build-0004/v4l/scripts/usbvision.pl 2017-05-03 21:55:40.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/scripts/usbvision.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $new_entry = -1; -my $nr = 0; -my ($id,$subvendor,$subdevice); -my %data; - -while (<>) { - # defines in header file - if (/#define\s*(\w+)\s*(\d+)/) { - $data{$1}->{nr} = $2; - next; - } - # boards - if (/^\s*\[([\w\d_]+)\]\s*=\s*{/) { - $id = $1; - $data{$id}->{id} = $id; - }; - - next unless defined($id); - - if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*).*/) - { - $subvendor=$1; - $subdevice=$2; - } - if(/driver_info\s*=\s*([\w\d_]+)/) - { - push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; - } - if (!defined($data{$id}) || !defined($data{$id}->{name})) { - $data{$id}->{name} = $1 if (/\.ModelString\s*=\s*\"([^\"]+)\"/); - } -} - -foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { - printf("%3d -> %-56s", $data{$item}->{nr}, $data{$item}->{name}); - printf(" [%s]",join(",",@{$data{$item}->{subid}})) - if defined($data{$item}->{subid}); - print "\n"; -} diff -Nru media-build-dkms-0004~trusty/media-build-0004/v4l/versions.txt media-build-dkms-0005~trusty/media-build-0004/v4l/versions.txt --- media-build-dkms-0004~trusty/media-build-0004/v4l/versions.txt 2017-09-03 17:57:57.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0004/v4l/versions.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,360 +0,0 @@ -# Use this for stuff for drivers that don't compile -[9.255.255] -INTEL_ATOMISP -VIDEO_DW9714 - -[4.13.0] -# Needs multiplexer support -VIDEO_MUX -# skb_put changed prototype in 4.13 -RADIO_WL128X - -[4.12.0] -# needs V4L2_FWNODE -VIDEO_ADV7604 -VIDEO_TC358743 -VIDEO_TVP514X -VIDEO_TVP7002 -VIDEO_OV2659 -VIDEO_OV5645 -VIDEO_OV5647 -VIDEO_MT9V032 -VIDEO_S5K5BAF -VIDEO_S5C73M3 -VIDEO_SMIAPP -VIDEO_OMAP3 -VIDEO_PXA27x -VIDEO_STM32_DCMI -VIDEO_TI_CAL -VIDEO_AM437X_VPFE -VIDEO_ATMEL_ISC -VIDEO_ATMEL_ISI -VIDEO_SAMSUNG_EXYNOS4_IS -VIDEO_S5P_MIPI_CSIS -VIDEO_RCAR_VIN -VIDEO_XILINX - -[4.10.0] -# needs *probe_new in struct i2c_driver -VIDEO_OV5670 - -[4.7.0] -# needs i2c_mux_alloc -VIDEO_CX231XX -DVB_LGDT3306A -DVB_SI2168 -DVB_RTL2830 -DVB_RTL2832 -DVB_M88DS3103 - -[4.6.0] -# needs regmap_write_bits -DVB_CXD2820R - -[4.5.0] -# needs pm_runtime_get_if_in_use -VIDEO_OV13858 -# needs gpiochip_get_data -VIDEO_SOLO6X10 - -[4.2.0] -# needs led_trigger_remove -V4L2_FLASH_LED_CLASS - -[3.19.0] -# needs debugfs_create_devm_seqfile -CEC_CORE -MEDIA_CEC_SUPPORT -# needs fwnode_property_read_u32 -SDR_MAX2175 - -[3.17.0] -# needs GPIOD_OUT_LOW/HIGH -VIDEO_MT9P031 -SOC_CAMERA_OV2640 -VIDEO_XILINX -I2C_SI4713 -VIDEO_ADP1653 -VIDEO_TVP5150 -VIDEO_ADV7180 -VIDEO_ET8EK8 -VIDEO_OV2640 -VIDEO_OV7670 -VIDEO_OV5640 -IR_GPIO_TX -# needs component_match_add -VIDEO_VIMC - -[3.15.0] -# needs reset_control_get_optional -RC_ST - -[3.14.0] -# needs pci_enable_msi_range -VIDEO_COBALT - -[3.13.0] -# needs gpio/consumer.h -RADIO_SI4713 - -[3.12.0] -# BIN_ATTR_RW was changed -IR_NUVOTON - -[3.11.0] -# needs freezable_schedule_hrtimeout_range -DVB_PT3 -# needs arch_phys_wc_add -VIDEO_FB_IVTV - -[3.10.0] -# needs include/linux/mfd/syscon.h -IR_HIX5HD2 - -[3.9.0] -# needs devm_ioremap_resource -VIDEO_SH_VEU -VIDEO_RENESAS_VSP1 -VIDEO_TI_SC -VIDEO_TI_CSC -IR_IMG -# needs spi_sync_transfer -IR_SPI - -[3.8.0] -# needs regmap lock/unlock ops -DVB_TS2020 - -[3.7.0] -# i2c_add_mux_adapter prototype change -# Needs PLATFORM_DEVID_AUTO -DVB_USB_RTL28XXU -DVB_USB_AF9035 -DVB_USB_ZD1301 -# needs pcie_capability_clear_and_set_word -DVB_NETUP_UNIDVB -# needs devm_pwm_get -IR_PWM_TX - -[3.6.0] -# needs include/linux/sizes.h -VIDEO_M5MOLS -# needs dma_mmap_coherent and sg_alloc_table_from_pages. -VIDEOBUF2_DMA_CONTIG - -[3.5.0] -# needs devm_clk_get, clk_enable, clk_disable -VIDEO_CODA -VIDEO_MT9T001 -VIDEO_S5K6A3 -# needs devm_gpio_request_one -VIDEO_OV9650 -VIDEO_ADV7183 -VIDEO_VS6624 -VIDEO_NOON010PC30 -# needs GPIOF_EXPORT -VIDEO_S5K6AA -# needs dev_err_ratelimited -MEDIA_TUNER_E4000 -# regmap_init has different arguments -DVB_AF9013 - -[3.4.0] -# needs devm_regulator_bulk_get -VIDEO_S5K4ECGX -# needs EPROBE_DEFER -IR_GPIO_CIR -VIDEO_AD5820 -VIDEO_MT9M111 -# needs of_property_read_bool -VIDEO_ADV7343 -# needs devm_regmap_init_i2c -VIDEO_LM3560 -VIDEO_LM3646 -MEDIA_TUNER_TDA18212 -MEDIA_TUNER_M88RS6000T -MEDIA_TUNER_TUA9001 -MEDIA_TUNER_FC2580 -DVB_TDA10071 -DVB_SI2165 -# needs spi_finalize_current_message -USB_MSI3101 -MEDIA_TUNER_MSI001 -# needs regmap_bulk_write -MEDIA_TUNER_M88TS2022 -MEDIA_TUNER_IT913X -DVB_AF9033 -DVB_MN88472 -DVB_MN88473 - -[3.3.0] -# Needs struct dma_interleaved_template in dmaengine.h -VIDEO_MEM2MEM_DEINTERLACE - -[3.2.0] -# due to the rename at include/linux from "pm_qos_params.h" to "pm_qos.h" -SOC_CAMERA -SOC_CAMERA_MT9V022 -SOC_CAMERA_MT9M001 -SOC_CAMERA_MT9T031 -SOC_CAMERA_OV772X -SOC_CAMERA_TW9910 -SOC_CAMERA_PLATFORM -# Needs of_match_ptr -VIDEO_THS8200 - -[3.0.0] -# fw_iso_context_queue_flush -DVB_FIREDTV - -[2.6.39] -# mfd header changes for 2.6.39 prevents compilation on 2.6.38. -RADIO_WL1273 -RADIO_TIMBERDALE -VIDEO_TIMBERDALE - -[2.6.37] -# Some stuff at viafb struct -VIDEO_VIA_CAMERA -# needs div64_s64 -MEDIA_TUNER_QM1D1C0042 -DVB_TC90522 - -[2.6.36] - -[2.6.35] -# Needs usb_pipe_endpoint -DVB_USB_LME2510 - -[2.6.34] -MACH_DAVINCI_DM6467_EVM -MFD_TIMBERDALE -RADIO_SAA7706H -# Needs dma_set_coherent_mask -VIDEO_DT3155 -# Needs include/linux/lcm.h -VIDEO_APTINA_PLL -# Depends on VIDEO_APTINA_PLL -VIDEO_MT9M032 -# Needs include/linux/lcm.h -VIDEO_SMIAPP_PLL - -[2.6.33] -VIDEO_AK881X -V4L2_MEM2MEM_DEV -# Requires sound/aci.h introduced in 2.6.33 -RADIO_MIROPCM20 -# Problem with printk_ratelimited -DVB_PT1 - -[2.6.32] -# These rely on arch support that wasn't available until 2.6.32 -VIDEO_SH_MOBILE_CEU -VIDEO_TLG2300 -# Relies on some changes at PnP API -IR_ENE -IR_WINBOND_CIR -IR_ITE_CIR -IR_FINTEK -# Relies on i2c_lock_adapter -DVB_DRXK -# Requires ss_ep_comp in usb_host_endpoint -USB_VIDEO_CLASS - -[2.6.31] -# These rely on arch support that wasn't available until 2.6.31 -VIDEO_VPSS_SYSTEM -VIDEO_VPFE_CAPTURE -VIDEO_DM6446_CCDC -VIDEO_DM355_CCDC -# Start version for those drivers - probably compile with older versions -VIDEO_CX25821 -VIDEO_CX25821_ALSA -RADIO_TEF6862 -# follow_pfn needed by VIDEOBUF_DMA_CONTIG and drivers that use it -VIDEOBUF_DMA_CONTIG -VIDEOBUF_VMALLOC -DISPLAY_DAVINCI_DM646X_EVM -VIDEO_MX1 -VIDEO_MX3 - -[2.6.26] -# requires id_table and new i2c stuff -RADIO_TEA5764 -VIDEO_THS7303 - -[2.6.24] -# Some freezer routines -USB_GSPCA_SN9C20X_EVDEV -# Requires linux/mmc/sdio_func.h -SMS_SDIO_DRV -VIDEO_SAA7164 - -[2.6.23] -# writel/readl headers moved -DVB_MANTIS -MANTIS_CORE - - -[2.6.22] -#This driver requires I2C probe/remove fields -VIDEO_TCM825X -# This driver requires list_first_entry -USB_STKWEBCAM -# This driver needs div64_64 -DVB_DRX397XD -# Assumes struct input_dev has a dev field -DVB_DM1105 -# This driver needs hrtimer API -VIDEO_CX88 - -[2.6.20] -#This driver requires HID_REQ_GET_REPORT -USB_SI470X -RADIO_SI470X -# use of struct delayed_work -USB_GSPCA_FINEPIX -USB_GSPCA_JEILINJ -# due to INIT_WORK changes -USB_GSPCA_SQ905 -USB_GSPCA_SQ905C -VIDEO_HDPVR -# due to device_move -VIDEO_PVRUSB2 -# due to struct file.f_path -VIDEO_CPIA - -[2.6.19] -# requires vmalloc_user/remap_vmalloc_range -VIDEO_CAFE_CCIC -VIDEO_TM6000 -#struct device vs struct class_device issues -USB_ET61X251 -USB_SN9C102 -USB_PWC -USB_PWC_DEBUG -USB_OV511 -USB_STV680 -USB_S2255 -VIDEO_USBVISION -# Uses supports_autosuspend -USB_MR800 -USB_DSBR -# Uses MODULE_FIRMWARE -DVB_AV7110 -# usb_complete_t changed prototype -USB_ZR364XX - -[2.6.18] -# Uses new class interface, which did not start to appear until 2.6.18. -VIDEO_PVRUSB2_SYSFS -# linux/uaccess.h -VIDEO_PMS - -[2.6.17] -# DVB_CORE_ATTACH relies on symbol_put_addr which hangs pre-2.6.17 -DVB_CORE_ATTACH -# Various changes to ALSA structs -VIDEO_CX18_ALSA -# cx18 needs list_for_each_entry_from -VIDEO_CX18 diff -Nru media-build-dkms-0004~trusty/media-build-0005/00_opt_default.inc media-build-dkms-0005~trusty/media-build-0005/00_opt_default.inc --- media-build-dkms-0004~trusty/media-build-0005/00_opt_default.inc 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/00_opt_default.inc 2018-06-01 10:12:33.000000000 +0000 @@ -0,0 +1,15 @@ +# With VDR this gives tons of loggings +disable_opt CONFIG_DVB_DEMUX_SECTION_LOSS_LOG + +# builds fine with this drivers, but keep them for later +#disable_opt CONFIG_VIDEOBUF2_MEMOPS + +# CONFIG_FRAME_VECTOR causes troubles on some systems/distros +disable_opt CONFIG_FRAME_VECTOR + +# MSI is currently still not reliable on Digital Devices cards +disable_opt CONFIG_DVB_DDBRIDGE_MSIENABLE + +# There are systems with more high end Digital Devices cards with lots +# of tuners +set_opt_value CONFIG_DVB_MAX_ADAPTERS 64 diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/api_version.patch media-build-dkms-0005~trusty/media-build-0005/backports/api_version.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/api_version.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/api_version.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,39 @@ +diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c +index 10b67fc..64b0250 100644 +--- a/drivers/media/cec/cec-api.c ++++ b/drivers/media/cec/cec-api.c +@@ -82,7 +82,7 @@ static long cec_adap_g_caps(struct cec_adapter *adap, + strlcpy(caps.name, adap->name, sizeof(caps.name)); + caps.available_log_addrs = adap->available_log_addrs; + caps.capabilities = adap->capabilities; +- caps.version = LINUX_VERSION_CODE; ++ caps.version = V4L2_VERSION; + if (copy_to_user(parg, &caps, sizeof(caps))) + return -EFAULT; + return 0; +diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c +index 35e81f7..9c3361c 100644 +--- a/drivers/media/media-device.c ++++ b/drivers/media/media-device.c +@@ -69,7 +69,7 @@ static int media_device_get_info(struct media_device *dev, + strlcpy(info->serial, dev->serial, sizeof(info->serial)); + strlcpy(info->bus_info, dev->bus_info, sizeof(info->bus_info)); + +- info->media_version = LINUX_VERSION_CODE; ++ info->media_version = V4L2_VERSION; + info->driver_version = info->media_version; + info->hw_revision = dev->hw_revision; + +diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c +index a5dab16..ce0d711 100644 +--- a/drivers/media/v4l2-core/v4l2-ioctl.c ++++ b/drivers/media/v4l2-core/v4l2-ioctl.c +@@ -1004,7 +1004,7 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops, + struct video_device *vfd = video_devdata(file); + int ret; + +- cap->version = LINUX_VERSION_CODE; ++ cap->version = V4L2_VERSION; + cap->device_caps = vfd->device_caps; + cap->capabilities = vfd->device_caps | V4L2_CAP_DEVICE_CAPS; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/backports.txt media-build-dkms-0005~trusty/media-build-0005/backports/backports.txt --- media-build-dkms-0004~trusty/media-build-0005/backports/backports.txt 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/backports.txt 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,193 @@ +################################################# +# Backport patches needed for each kernel version +################################################# +# The patches for a given kernel version is calculated +# by summing the patches needed to backport to all kernel +# versions higher or equal to the desired one. For example, +# if this file has: +# [3.255.255] +# add patch_for_upstream.patch +# [2.6.38] +# add patch_for_2.6.38.patch +# +# That means that both patch_for_2.6.38.patch and patch_for_upstream.patch +# are needed for 2.6.38. +# +# It is possible to remove one patch from the accumulated series with +# by adding a "delete foo.patch" line +# +# In order to test what patches will be applied for a given kernel version, +# use linux/patches_for_kernel.pl + +# All supported versions need those patches +[9.255.255] +add api_version.patch +add pr_fmt.patch +add debug.patch +add drx39xxj.patch +add noretpoline.patch + +[4.14.255] +add v4.14_compiler_h.patch +add v4.14_saa7146_timer_cast.patch +add v4.14_module_param_call.patch + +[4.13.255] +add v4.13_remove_nospec_h.patch + +[4.12.255] +add v4.12_revert_solo6x10_copykerneluser.patch + +[4.10.255] +add v4.10_sched_signal.patch +add v4.10_fault_page.patch +add v4.10_refcount.patch + +[4.9.255] +add v4.9_mm_address.patch +add v4.9_dvb_net_max_mtu.patch + +[4.8.255] +add v4.8_user_pages_flag.patch +add v4.8_em28xx_bitfield.patch + +[4.7.255] +add v4.7_dma_attrs.patch +add v4.7_pci_alloc_irq_vectors.patch +add v4.7_copy_to_user_warning.patch +add v4.7_objtool_warning.patch + +[4.6.255] +add v4.6_i2c_mux.patch + +[4.5.255] +add v4.5_gpiochip_data_pointer.patch +add v4.5_get_user_pages.patch +add v4.5_uvc_super_plus.patch +add v4.5_copy_to_user_warning.patch + +[4.4.255] +add v4.4_gpio_chip_parent.patch + +[4.3.255] +add v4.3_add_autorepeat_handling.patch +add v4.3_bt87x_const_fix.patch + +[4.2.255] +add v4.2_atomic64.patch +add v4.2_frame_vector.patch + +[4.1.255] +add v4.1_pat_enabled.patch +add v4.1_drop_fwnode.patch + +[4.0.255] +add v4.0_dma_buf_export.patch +add v4.0_drop_trace.patch +add v4.0_fwnode.patch + +[3.19.255] +add v3.19_get_user_pages_unlocked.patch +add v3.19_get_user_pages_locked.patch + +[3.18.255] +add v3.18_drop_property_h.patch +add v3.18_ktime_get_real_seconds.patch + +[3.17.255] +add v3.17_fix_clamp.patch + +[3.16.255] +add v3.16_netdev.patch +add v3.16_wait_on_bit.patch +add v3.16_void_gpiochip_remove.patch + +[3.13.255] +add v3.13_ddbridge_pcimsi.patch + +[3.12.255] +add v3.12_kfifo_in.patch + +[3.11.255] +add v3.11_dev_groups.patch + +[3.10.255] +add v3.10_fw_driver_probe.patch +add v3.10_ir_hix5hd2.patch +add v3.10_const_snd_pcm_ops.patch + +[3.9.255] +add v3.9_drxj_warnings.patch + +[3.8.255] +add v3.8_config_of.patch + +[3.6.255] +add v3.6_pci_error_handlers.patch +add v3.6_i2c_add_mux_adapter.patch + +[3.4.255] +add v3.4_i2c_add_mux_adapter.patch +add v3.4_stk_webcam.patch + +[3.3.255] +add v3.3_eprobe_defer.patch + +[3.2.255] +add v3.2_devnode_uses_mode_t.patch +add v3.2_alloc_ordered_workqueue.patch + +[3.1.255] +add v3.1_no_export_h.patch +add v3.1_no_dma_buf_h.patch +add v3.1_no_pm_qos.patch + +[3.0.255] +add no_atomic_include.patch +add v3.0_ida2bit.patch +add v3.0_remove_ida_lird_dev.patch + +[2.6.39] +add v2.6_rc_main_bsearch_h.patch +add v2.6.39_const_rc_main.patch + +[2.6.38] +add v2.6.38_use_getkeycode_new_setkeycode_new.patch +add v2.6.38_config_of_for_of_node.patch + +[2.6.37] +add v2.6.37_dont_use_alloc_ordered_workqueue.patch + +[2.6.36] +delete v2.6.38_use_getkeycode_new_setkeycode_new.patch +add v2.6.36_input_getkeycode.patch +add v2.6.36_dvb_usb_input_getkeycode.patch +add tda18271_debug_fix.patch +add v2.6.36_kmap_atomic.patch +add v2.6.36_fence.patch + +[2.6.35] +add v2.6.35_firedtv_handle_fcp.patch +add v2.6.35_i2c_new_probed_device.patch +add v2.6.35_work_handler.patch +add v2.6.35_kfifo.patch + +[2.6.34] +add v2.6.34_dvb_net.patch +add v2.6.34_fix_define_warnings.patch +add v2.6.34_usb_ss_ep_comp.patch + +[2.6.33] +add v2.6.33_input_handlers_are_int.patch +add v2.6.33_pvrusb2_sysfs.patch +add v2.6.33_no_gpio_request_one.patch + +[2.6.32] +add v2.6.32_dvb_net.patch +add v2.6.32_kfifo.patch +add v2.6.32_request_firmware_nowait.patch + +[2.6.31] +add v2.6.31_nodename.patch +add v2.6.31_vm_ops.patch +add v2.6.31_rc.patch diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/debug.patch media-build-dkms-0005~trusty/media-build-0005/backports/debug.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/debug.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/debug.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h +index 5936923..a6d487c 100644 +--- a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h ++++ b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h +@@ -15,6 +15,7 @@ + #ifndef S5P_MFC_DEBUG_H_ + #define S5P_MFC_DEBUG_H_ + ++#undef DEBUG + #define DEBUG + + #ifdef DEBUG diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/drx39xxj.patch media-build-dkms-0005~trusty/media-build-0005/backports/drx39xxj.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/drx39xxj.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/drx39xxj.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c +index d4986bd..16d8565 100644 +--- a/drivers/media/usb/em28xx/em28xx-dvb.c ++++ b/drivers/media/usb/em28xx/em28xx-dvb.c +@@ -41,7 +41,7 @@ + #include "mt352.h" + #include "mt352_priv.h" /* FIXME */ + #include "tda1002x.h" +-#include "drx39xyj/drx39xxj.h" ++#include "drx39xxj.h" + #include "tda18271.h" + #include "s921.h" + #include "drxd.h" diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/no_atomic_include.patch media-build-dkms-0005~trusty/media-build-0005/backports/no_atomic_include.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/no_atomic_include.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/no_atomic_include.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,132 @@ +diff --git a/drivers/media/pci/pt3/pt3.h b/drivers/media/pci/pt3/pt3.h +index 1b3f2ad25db3..44ba0f4c298d 100644 +--- a/drivers/media/pci/pt3/pt3.h ++++ b/drivers/media/pci/pt3/pt3.h +@@ -17,7 +17,6 @@ + #ifndef PT3_H + #define PT3_H + +-#include + #include + + #include "dvb_demux.h" +diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h +index 3f8da5e8c430..291ec932e1bf 100644 +--- a/drivers/media/pci/solo6x10/solo6x10.h ++++ b/drivers/media/pci/solo6x10/solo6x10.h +@@ -28,7 +28,6 @@ + #include + #include + #include +-#include + #include + #include + +diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c +index 271f725b17e8..e39c9717016c 100644 +--- a/drivers/media/radio/radio-si476x.c ++++ b/drivers/media/radio/radio-si476x.c +@@ -21,7 +21,6 @@ + #include + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c +index 15f016ad5b89..d4030e6fdf13 100644 +--- a/drivers/media/usb/hdpvr/hdpvr-core.c ++++ b/drivers/media/usb/hdpvr/hdpvr-core.c +@@ -17,7 +17,6 @@ + #include + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c +index c2ee6e39fd0c..5a24edfe64aa 100644 +--- a/drivers/media/usb/uvc/uvc_ctrl.c ++++ b/drivers/media/usb/uvc/uvc_ctrl.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + + #include "uvcvideo.h" +diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c +index 70842c5af05b..20ebfd17503a 100644 +--- a/drivers/media/usb/uvc/uvc_driver.c ++++ b/drivers/media/usb/uvc/uvc_driver.c +@@ -11,7 +11,6 @@ + * + */ + +-#include + #include + #include + #include +diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c +index aa2199775cb8..c155671702b3 100644 +--- a/drivers/media/usb/uvc/uvc_queue.c ++++ b/drivers/media/usb/uvc/uvc_queue.c +@@ -11,7 +11,6 @@ + * + */ + +-#include + #include + #include + #include +diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c +index 3e7e283a44a8..17d85bfaee08 100644 +--- a/drivers/media/usb/uvc/uvc_v4l2.c ++++ b/drivers/media/usb/uvc/uvc_v4l2.c +@@ -21,7 +21,6 @@ + #include + #include + #include +-#include + + #include + #include +diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c +index fb86d6af398d..3fa820f2ffae 100644 +--- a/drivers/media/usb/uvc/uvc_video.c ++++ b/drivers/media/usb/uvc/uvc_video.c +@@ -19,7 +19,6 @@ + #include + #include + #include +-#include + #include + + #include +diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c +index 297e10e69898..5019e2a9fcc8 100644 +--- a/drivers/media/v4l2-core/v4l2-clk.c ++++ b/drivers/media/v4l2-core/v4l2-clk.c +@@ -8,7 +8,6 @@ + * published by the Free Software Foundation. + */ + +-#include + #include + #include + #include +diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h +index d3ed44072544..573b909f1113 100644 +--- a/include/media/v4l2-clk.h ++++ b/include/media/v4l2-clk.h +@@ -14,7 +14,6 @@ + #ifndef MEDIA_V4L2_CLK_H + #define MEDIA_V4L2_CLK_H + +-#include + #include + #include + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/noretpoline.patch media-build-dkms-0005~trusty/media-build-0005/backports/noretpoline.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/noretpoline.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/noretpoline.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,15 @@ +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index e2c7f43..901c1cc 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -93,10 +93,6 @@ + #define __weak __attribute__((weak)) + #define __alias(symbol) __attribute__((alias(#symbol))) + +-#ifdef RETPOLINE +-#define __noretpoline __attribute__((indirect_branch("keep"))) +-#endif +- + /* + * it doesn't make sense on ARM (currently the only user of __naked) + * to trace naked functions because then mcount is called without diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/pr_fmt.patch media-build-dkms-0005~trusty/media-build-0005/backports/pr_fmt.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/pr_fmt.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/pr_fmt.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,1714 @@ +diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c +index 9f7c5b0..03b3af5 100644 +--- a/drivers/media/common/saa7146/saa7146_core.c ++++ b/drivers/media/common/saa7146/saa7146_core.c +@@ -18,6 +18,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c +index d4987fd..d139750 100644 +--- a/drivers/media/common/saa7146/saa7146_fops.c ++++ b/drivers/media/common/saa7146/saa7146_fops.c +@@ -1,3 +1,4 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c +index 6ebcbc6..a06dc4d 100644 +--- a/drivers/media/common/saa7146/saa7146_hlp.c ++++ b/drivers/media/common/saa7146/saa7146_hlp.c +@@ -1,3 +1,4 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/saa7146/saa7146_i2c.c b/drivers/media/common/saa7146/saa7146_i2c.c +index f9e099d..8b8ed13 100644 +--- a/drivers/media/common/saa7146/saa7146_i2c.c ++++ b/drivers/media/common/saa7146/saa7146_i2c.c +@@ -1,4 +1,5 @@ + // SPDX-License-Identifier: GPL-2.0 ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c +index 0dfa0c0..76a0f55 100644 +--- a/drivers/media/common/saa7146/saa7146_video.c ++++ b/drivers/media/common/saa7146/saa7146_video.c +@@ -1,3 +1,4 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h +index 134c69f..a25e8a0 100644 +--- a/drivers/media/common/siano/smscoreapi.h ++++ b/drivers/media/common/siano/smscoreapi.h +@@ -22,6 +22,7 @@ along with this program. If not, see . + #ifndef __SMS_CORE_API_H__ + #define __SMS_CORE_API_H__ + ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__ + + #include +diff --git a/drivers/media/common/tveeprom.c b/drivers/media/common/tveeprom.c +index ccf2d3b..f684cf3 100644 +--- a/drivers/media/common/tveeprom.c ++++ b/drivers/media/common/tveeprom.c +@@ -24,6 +24,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c +index d3f7bb3..914b50a 100644 +--- a/drivers/media/common/videobuf2/videobuf2-core.c ++++ b/drivers/media/common/videobuf2/videobuf2-core.c +@@ -14,6 +14,7 @@ + * the Free Software Foundation. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c +index 61a750f..b71b2da 100644 +--- a/drivers/media/dvb-core/dmxdev.c ++++ b/drivers/media/dvb-core/dmxdev.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "dmxdev: " fmt + + #include +diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c +index 97365a8..f0298b5 100644 +--- a/drivers/media/dvb-core/dvb_ca_en50221.c ++++ b/drivers/media/dvb-core/dvb_ca_en50221.c +@@ -25,6 +25,7 @@ + * http://www.gnu.org/copyleft/gpl.html + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "dvb_ca_en50221: " fmt + + #include +diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c +index f450912..9c4e466 100644 +--- a/drivers/media/dvb-core/dvb_demux.c ++++ b/drivers/media/dvb-core/dvb_demux.c +@@ -17,6 +17,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "dvb_demux: " fmt + + #include +diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c +index bc5eaad..4522701 100644 +--- a/drivers/media/dvb-core/dvb_frontend.c ++++ b/drivers/media/dvb-core/dvb_frontend.c +@@ -25,6 +25,7 @@ + /* Enables DVBv3 compatibility bits at the headers */ + #define __DVB_CORE__ + ++#undef pr_fmt + #define pr_fmt(fmt) "dvb_frontend: " fmt + + #include +diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c +index 10f7810..149a2f7 100644 +--- a/drivers/media/dvb-core/dvb_net.c ++++ b/drivers/media/dvb-core/dvb_net.c +@@ -51,6 +51,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "dvb_net: " fmt + + #include +diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c +index 787fe06..9030dfb 100644 +--- a/drivers/media/dvb-core/dvbdev.c ++++ b/drivers/media/dvb-core/dvbdev.c +@@ -17,6 +17,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) "dvbdev: " fmt + + #include +diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c +index bd9101e..fd4cf60 100644 +--- a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c ++++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c +@@ -6,6 +6,7 @@ + * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ + + #include +diff --git a/drivers/media/dvb-frontends/dib0070.c b/drivers/media/dvb-frontends/dib0070.c +index 932d235..f232017 100644 +--- a/drivers/media/dvb-frontends/dib0070.c ++++ b/drivers/media/dvb-frontends/dib0070.c +@@ -20,6 +20,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c +index ee7af34..4255942 100644 +--- a/drivers/media/dvb-frontends/dib0090.c ++++ b/drivers/media/dvb-frontends/dib0090.c +@@ -20,6 +20,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib3000mb.c b/drivers/media/dvb-frontends/dib3000mb.c +index de3ce27..6ee38f2 100644 +--- a/drivers/media/dvb-frontends/dib3000mb.c ++++ b/drivers/media/dvb-frontends/dib3000mb.c +@@ -21,6 +21,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib3000mc.c b/drivers/media/dvb-frontends/dib3000mc.c +index 7e5d4748..407445e 100644 +--- a/drivers/media/dvb-frontends/dib3000mc.c ++++ b/drivers/media/dvb-frontends/dib3000mc.c +@@ -11,6 +11,7 @@ + * published by the Free Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib7000m.c b/drivers/media/dvb-frontends/dib7000m.c +index 6a1d357..438906a 100644 +--- a/drivers/media/dvb-frontends/dib7000m.c ++++ b/drivers/media/dvb-frontends/dib7000m.c +@@ -9,6 +9,7 @@ + * published by the Free Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c +index 902af48..73a61b9 100644 +--- a/drivers/media/dvb-frontends/dib7000p.c ++++ b/drivers/media/dvb-frontends/dib7000p.c +@@ -8,6 +8,7 @@ + * published by the Free Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c +index 6f35173..b7ee741 100644 +--- a/drivers/media/dvb-frontends/dib8000.c ++++ b/drivers/media/dvb-frontends/dib8000.c +@@ -8,6 +8,7 @@ + * published by the Free Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c +index f9289f4..7143a03 100644 +--- a/drivers/media/dvb-frontends/dib9000.c ++++ b/drivers/media/dvb-frontends/dib9000.c +@@ -8,6 +8,7 @@ + * published by the Free Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dibx000_common.c b/drivers/media/dvb-frontends/dibx000_common.c +index 70119c7..18224c9 100644 +--- a/drivers/media/dvb-frontends/dibx000_common.c ++++ b/drivers/media/dvb-frontends/dibx000_common.c +@@ -1,3 +1,4 @@ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c +index 5706898..b2178ae 100644 +--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c ++++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c +@@ -53,6 +53,7 @@ + INCLUDE FILES + ----------------------------------------------------------------------------*/ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ + + #include +diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c +index 5a26ad9..b7da86e 100644 +--- a/drivers/media/dvb-frontends/drxk_hard.c ++++ b/drivers/media/dvb-frontends/drxk_hard.c +@@ -17,6 +17,7 @@ + * http://www.gnu.org/copyleft/gpl.html + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c +index e3894ff..dd753bc 100644 +--- a/drivers/media/dvb-frontends/dvb-pll.c ++++ b/drivers/media/dvb-frontends/dvb-pll.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/gp8psk-fe.c b/drivers/media/dvb-frontends/gp8psk-fe.c +index a772ef8..3c0f22e 100644 +--- a/drivers/media/dvb-frontends/gp8psk-fe.c ++++ b/drivers/media/dvb-frontends/gp8psk-fe.c +@@ -13,6 +13,7 @@ + * Software Foundation, version 2. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "gp8psk-fe.h" +diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c +index 32de824..ee8146f 100644 +--- a/drivers/media/dvb-frontends/lgdt3306a.c ++++ b/drivers/media/dvb-frontends/lgdt3306a.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c +index 7aa7440..c1168eb 100644 +--- a/drivers/media/dvb-frontends/nxt200x.c ++++ b/drivers/media/dvb-frontends/nxt200x.c +@@ -33,6 +33,7 @@ + * /usr/lib/hotplug/firmware/ or /lib/firmware/ + * (depending on configuration of firmware hotplug). + */ ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + /* Max transfer size done by I2C transfer functions */ +diff --git a/drivers/media/dvb-frontends/nxt6000.c b/drivers/media/dvb-frontends/nxt6000.c +index 109a635..44d7887 100644 +--- a/drivers/media/dvb-frontends/nxt6000.c ++++ b/drivers/media/dvb-frontends/nxt6000.c +@@ -19,6 +19,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/dvb-frontends/or51211.c b/drivers/media/dvb-frontends/or51211.c +index a1b7c30..5723906 100644 +--- a/drivers/media/dvb-frontends/or51211.c ++++ b/drivers/media/dvb-frontends/or51211.c +@@ -18,6 +18,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ + + /* +diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c +index 67ac51e..041effa 100644 +--- a/drivers/media/media-devnode.c ++++ b/drivers/media/media-devnode.c +@@ -26,6 +26,7 @@ + * counting. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/btcx-risc.c b/drivers/media/pci/bt8xx/btcx-risc.c +index 70bdf93..1f12fc4 100644 +--- a/drivers/media/pci/bt8xx/btcx-risc.c ++++ b/drivers/media/pci/bt8xx/btcx-risc.c +@@ -22,6 +22,7 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c +index 1902732..06bbbb6 100644 +--- a/drivers/media/pci/bt8xx/bttv-cards.c ++++ b/drivers/media/pci/bt8xx/bttv-cards.c +@@ -25,6 +25,7 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c +index 707f57a..51343f7 100644 +--- a/drivers/media/pci/bt8xx/bttv-driver.c ++++ b/drivers/media/pci/bt8xx/bttv-driver.c +@@ -34,6 +34,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c +index 25b9916..654001e 100644 +--- a/drivers/media/pci/bt8xx/bttv-gpio.c ++++ b/drivers/media/pci/bt8xx/bttv-gpio.c +@@ -26,6 +26,7 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c +index eccd1e3..fe5bd28 100644 +--- a/drivers/media/pci/bt8xx/bttv-i2c.c ++++ b/drivers/media/pci/bt8xx/bttv-i2c.c +@@ -27,6 +27,7 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c +index 08266b2..0552001 100644 +--- a/drivers/media/pci/bt8xx/bttv-input.c ++++ b/drivers/media/pci/bt8xx/bttv-input.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-risc.c b/drivers/media/pci/bt8xx/bttv-risc.c +index 6a6be0b..acfbb58 100644 +--- a/drivers/media/pci/bt8xx/bttv-risc.c ++++ b/drivers/media/pci/bt8xx/bttv-risc.c +@@ -24,6 +24,7 @@ + + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/bttv-vbi.c b/drivers/media/pci/bt8xx/bttv-vbi.c +index 67c6583..abeaeb6 100644 +--- a/drivers/media/pci/bt8xx/bttv-vbi.c ++++ b/drivers/media/pci/bt8xx/bttv-vbi.c +@@ -23,6 +23,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/dst.c b/drivers/media/pci/bt8xx/dst.c +index 2e33b72..d06dc92 100644 +--- a/drivers/media/pci/bt8xx/dst.c ++++ b/drivers/media/pci/bt8xx/dst.c +@@ -18,6 +18,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c +index 5ef6e20..1906fe0 100644 +--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c ++++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c +@@ -15,6 +15,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c +index 70aec9b..cac37d0 100644 +--- a/drivers/media/pci/cx23885/altera-ci.c ++++ b/drivers/media/pci/cx23885/altera-ci.c +@@ -49,6 +49,7 @@ + * +-------+-------+-------+-------+-------+-------+-------+-------+ + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h +index d54c7ee..b54e20c 100644 +--- a/drivers/media/pci/cx23885/cx23885.h ++++ b/drivers/media/pci/cx23885/cx23885.h +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c +index a45bf03..42ba764 100644 +--- a/drivers/media/pci/cx25821/cx25821-alsa.c ++++ b/drivers/media/pci/cx25821/cx25821-alsa.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c +index ada26d4a..1334869 100644 +--- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c ++++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "cx25821-video.h" +diff --git a/drivers/media/pci/cx25821/cx25821-cards.c b/drivers/media/pci/cx25821/cx25821-cards.c +index f3b4d89..96beae1 100644 +--- a/drivers/media/pci/cx25821/cx25821-cards.c ++++ b/drivers/media/pci/cx25821/cx25821-cards.c +@@ -17,6 +17,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c +index 040c6c2..4fce6ba 100644 +--- a/drivers/media/pci/cx25821/cx25821-core.c ++++ b/drivers/media/pci/cx25821/cx25821-core.c +@@ -17,6 +17,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx25821/cx25821-i2c.c b/drivers/media/pci/cx25821/cx25821-i2c.c +index 31479a4..dacef76 100644 +--- a/drivers/media/pci/cx25821/cx25821-i2c.c ++++ b/drivers/media/pci/cx25821/cx25821-i2c.c +@@ -17,6 +17,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.c b/drivers/media/pci/cx25821/cx25821-medusa-video.c +index 0a9db05..ff7a293 100644 +--- a/drivers/media/pci/cx25821/cx25821-medusa-video.c ++++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "cx25821.h" +diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c +index 6c838c8..6c23d6a 100644 +--- a/drivers/media/pci/cx25821/cx25821-video-upstream.c ++++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "cx25821-video.h" +diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c +index dbaf42e..8f28456 100644 +--- a/drivers/media/pci/cx25821/cx25821-video.c ++++ b/drivers/media/pci/cx25821/cx25821-video.c +@@ -20,6 +20,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "cx25821-video.h" +diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h +index 07a33f0..db40b90 100644 +--- a/drivers/media/pci/cx88/cx88.h ++++ b/drivers/media/pci/cx88/cx88.h +@@ -17,6 +17,7 @@ + #ifndef CX88_H + #define CX88_H + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c +index f4748cf..21cce8c 100644 +--- a/drivers/media/pci/ddbridge/ddbridge-main.c ++++ b/drivers/media/pci/ddbridge/ddbridge-main.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h +index cafba6b..6b099da 100644 +--- a/drivers/media/pci/ivtv/ivtv-driver.h ++++ b/drivers/media/pci/ivtv/ivtv-driver.h +@@ -22,6 +22,7 @@ + #ifndef IVTV_DRIVER_H + #define IVTV_DRIVER_H + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + /* Internal header for ivtv project: +diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c +index 7738565..1caf041 100644 +--- a/drivers/media/pci/ngene/ngene-cards.c ++++ b/drivers/media/pci/ngene/ngene-cards.c +@@ -23,6 +23,7 @@ + * http://www.gnu.org/copyleft/gpl.html + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h +index d99e937..6bf824e 100644 +--- a/drivers/media/pci/saa7134/saa7134.h ++++ b/drivers/media/pci/saa7134/saa7134.h +@@ -17,6 +17,7 @@ + + #define SAA7134_VERSION "0, 2, 17" + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c +index 5817d9c..58803dd 100644 +--- a/drivers/media/pci/saa7146/hexium_gemini.c ++++ b/drivers/media/pci/saa7146/hexium_gemini.c +@@ -21,6 +21,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define DEBUG_VARIABLE debug +diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c +index 0a05176..15aa6a4 100644 +--- a/drivers/media/pci/saa7146/hexium_orion.c ++++ b/drivers/media/pci/saa7146/hexium_orion.c +@@ -21,6 +21,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define DEBUG_VARIABLE debug +diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c +index 6b5582b..61da097 100644 +--- a/drivers/media/pci/saa7146/mxb.c ++++ b/drivers/media/pci/saa7146/mxb.c +@@ -21,6 +21,7 @@ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define DEBUG_VARIABLE debug +diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c +index e4cf42c..5401028 100644 +--- a/drivers/media/pci/ttpci/av7110_v4l.c ++++ b/drivers/media/pci/ttpci/av7110_v4l.c +@@ -22,6 +22,7 @@ + * the project's page is at https://linuxtv.org + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c +index abc98f1..6b99e4e9 100644 +--- a/drivers/media/pci/ttpci/budget-av.c ++++ b/drivers/media/pci/ttpci/budget-av.c +@@ -30,6 +30,7 @@ + * the project's page is at https://linuxtv.org + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "budget.h" +diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c b/drivers/media/platform/exynos4-is/fimc-is-param.c +index 72b9b43..e08e900 100644 +--- a/drivers/media/platform/exynos4-is/fimc-is-param.c ++++ b/drivers/media/platform/exynos4-is/fimc-is-param.c +@@ -10,6 +10,7 @@ + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c +index 5ddb232..045d7af 100644 +--- a/drivers/media/platform/exynos4-is/fimc-is.c ++++ b/drivers/media/platform/exynos4-is/fimc-is.c +@@ -10,6 +10,7 @@ + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c +index 9a48c0f..e1f42e0 100644 +--- a/drivers/media/platform/exynos4-is/fimc-isp.c ++++ b/drivers/media/platform/exynos4-is/fimc-isp.c +@@ -10,6 +10,7 @@ + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c +index 9ab8e7e..07d1c47 100644 +--- a/drivers/media/platform/s3c-camif/camif-capture.c ++++ b/drivers/media/platform/s3c-camif/camif-capture.c +@@ -11,6 +11,7 @@ + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c +index 79bc0ef..8b6d6f0 100644 +--- a/drivers/media/platform/s3c-camif/camif-core.c ++++ b/drivers/media/platform/s3c-camif/camif-core.c +@@ -9,6 +9,7 @@ + * by the Free Software Foundation, either version 2 of the License, + * or (at your option) any later version. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/platform/s3c-camif/camif-regs.c b/drivers/media/platform/s3c-camif/camif-regs.c +index 812fb3a..8241eb4 100644 +--- a/drivers/media/platform/s3c-camif/camif-regs.c ++++ b/drivers/media/platform/s3c-camif/camif-regs.c +@@ -8,6 +8,7 @@ + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ ++#undef pr_fmt + #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ + + #include +diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c +index 71b8c9b..1c9e129 100644 +--- a/drivers/media/rc/ene_ir.c ++++ b/drivers/media/rc/ene_ir.c +@@ -25,6 +25,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c +index f2639d0..1040fa1 100644 +--- a/drivers/media/rc/fintek-cir.c ++++ b/drivers/media/rc/fintek-cir.c +@@ -18,6 +18,7 @@ + * General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c +index 1041c056..6194983 100644 +--- a/drivers/media/rc/imon.c ++++ b/drivers/media/rc/imon.c +@@ -22,6 +22,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ + + #include +diff --git a/drivers/media/rc/ir-imon-decoder.c b/drivers/media/rc/ir-imon-decoder.c +index 67c1b0c..8395ca7 100644 +--- a/drivers/media/rc/ir-imon-decoder.c ++++ b/drivers/media/rc/ir-imon-decoder.c +@@ -3,6 +3,7 @@ + // + // Copyright (C) 2018 by Sean Young + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c +index cc58ed7..0b9f81d 100644 +--- a/drivers/media/rc/lirc_dev.c ++++ b/drivers/media/rc/lirc_dev.c +@@ -15,6 +15,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c +index 5e1d866..418d57a 100644 +--- a/drivers/media/rc/nuvoton-cir.c ++++ b/drivers/media/rc/nuvoton-cir.c +@@ -20,6 +20,7 @@ + * General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index b7071bd..0404a15 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -3,6 +3,7 @@ + // + // Copyright (C) 2009-2010 by Mauro Carvalho Chehab + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c +index 8bf5637..90c7f8e 100644 +--- a/drivers/media/rc/serial_ir.c ++++ b/drivers/media/rc/serial_ir.c +@@ -21,6 +21,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c +index 9ee2c91..511e7d8 100644 +--- a/drivers/media/rc/sir_ir.c ++++ b/drivers/media/rc/sir_ir.c +@@ -10,6 +10,7 @@ + * (at your option) any later version. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c +index 0adf099..68b48d5 100644 +--- a/drivers/media/rc/winbond-cir.c ++++ b/drivers/media/rc/winbond-cir.c +@@ -36,6 +36,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c +index 11ce510..a6e3d32 100644 +--- a/drivers/media/spi/cxd2880-spi.c ++++ b/drivers/media/spi/cxd2880-spi.c +@@ -7,6 +7,7 @@ + * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ + + #include +diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c +index 3e14b9e..628d146 100644 +--- a/drivers/media/tuners/r820t.c ++++ b/drivers/media/tuners/r820t.c +@@ -20,6 +20,7 @@ + // + // RF Gain set/get is not implemented. + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/tuners/tda18271-priv.h b/drivers/media/tuners/tda18271-priv.h +index 0bcc735..b9f0963 100644 +--- a/drivers/media/tuners/tda18271-priv.h ++++ b/drivers/media/tuners/tda18271-priv.h +@@ -21,6 +21,7 @@ + #ifndef __TDA18271_PRIV_H__ + #define __TDA18271_PRIV_H__ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c +index 2b2c064..2e367ef 100644 +--- a/drivers/media/tuners/tea5767.c ++++ b/drivers/media/tuners/tea5767.c +@@ -7,6 +7,7 @@ + // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa + // from their contributions on DScaler. + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h +index 004eade..873fca4 100644 +--- a/drivers/media/usb/au0828/au0828.h ++++ b/drivers/media/usb/au0828/au0828.h +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c +index ed9bcaf..91a9d46 100644 +--- a/drivers/media/usb/go7007/go7007-usb.c ++++ b/drivers/media/usb/go7007/go7007-usb.c +@@ -11,6 +11,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/gspca/benq.c b/drivers/media/usb/gspca/benq.c +index 8a8db5e..25ecb82 100644 +--- a/drivers/media/usb/gspca/benq.c ++++ b/drivers/media/usb/gspca/benq.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "benq" +diff --git a/drivers/media/usb/gspca/conex.c b/drivers/media/usb/gspca/conex.c +index 6df4e20..fa68a71 100644 +--- a/drivers/media/usb/gspca/conex.c ++++ b/drivers/media/usb/gspca/conex.c +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "conex" +diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c +index 2b09af8..67afabf 100644 +--- a/drivers/media/usb/gspca/cpia1.c ++++ b/drivers/media/usb/gspca/cpia1.c +@@ -22,6 +22,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "cpia1" +diff --git a/drivers/media/usb/gspca/dtcs033.c b/drivers/media/usb/gspca/dtcs033.c +index 7654c8c..0d0cb5d 100644 +--- a/drivers/media/usb/gspca/dtcs033.c ++++ b/drivers/media/usb/gspca/dtcs033.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #define MODULE_NAME "dtcs033" + #include "gspca.h" +diff --git a/drivers/media/usb/gspca/etoms.c b/drivers/media/usb/gspca/etoms.c +index 48b2889..0a64ab5 100644 +--- a/drivers/media/usb/gspca/etoms.c ++++ b/drivers/media/usb/gspca/etoms.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "etoms" +diff --git a/drivers/media/usb/gspca/finepix.c b/drivers/media/usb/gspca/finepix.c +index 1ef1239..89df74f 100644 +--- a/drivers/media/usb/gspca/finepix.c ++++ b/drivers/media/usb/gspca/finepix.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "finepix" +diff --git a/drivers/media/usb/gspca/gl860/gl860.c b/drivers/media/usb/gspca/gl860/gl860.c +index 262200a..c4403a8 100644 +--- a/drivers/media/usb/gspca/gl860/gl860.c ++++ b/drivers/media/usb/gspca/gl860/gl860.c +@@ -19,6 +19,7 @@ + * along with this program. If not, see . + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "gspca.h" +diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c +index d29773b..c26dc28 100644 +--- a/drivers/media/usb/gspca/gspca.c ++++ b/drivers/media/usb/gspca/gspca.c +@@ -17,6 +17,7 @@ + * for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define GSPCA_VERSION "2.14.0" +diff --git a/drivers/media/usb/gspca/jeilinj.c b/drivers/media/usb/gspca/jeilinj.c +index 86d0a0a..fbc965c 100644 +--- a/drivers/media/usb/gspca/jeilinj.c ++++ b/drivers/media/usb/gspca/jeilinj.c +@@ -20,6 +20,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "jeilinj" +diff --git a/drivers/media/usb/gspca/kinect.c b/drivers/media/usb/gspca/kinect.c +index 0cfdf8a..f5b40503 100644 +--- a/drivers/media/usb/gspca/kinect.c ++++ b/drivers/media/usb/gspca/kinect.c +@@ -20,6 +20,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "kinect" +diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c +index 989ae99..21fc502 100644 +--- a/drivers/media/usb/gspca/konica.c ++++ b/drivers/media/usb/gspca/konica.c +@@ -24,6 +24,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "konica" +diff --git a/drivers/media/usb/gspca/m5602/m5602_core.c b/drivers/media/usb/gspca/m5602/m5602_core.c +index b83ec42..6e0c9d4 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_core.c ++++ b/drivers/media/usb/gspca/m5602/m5602_core.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_ov9650.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c +index c9947c4..3bfa8ab 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_mt9m111.c ++++ b/drivers/media/usb/gspca/m5602/m5602_mt9m111.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_mt9m111.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_ov7660.c b/drivers/media/usb/gspca/m5602/m5602_ov7660.c +index aa1f569..d8ee60a 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_ov7660.c ++++ b/drivers/media/usb/gspca/m5602/m5602_ov7660.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_ov7660.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_ov9650.c b/drivers/media/usb/gspca/m5602/m5602_ov9650.c +index 2ffbb54..467f6e0 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_ov9650.c ++++ b/drivers/media/usb/gspca/m5602/m5602_ov9650.c +@@ -17,6 +17,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_ov9650.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_po1030.c b/drivers/media/usb/gspca/m5602/m5602_po1030.c +index 37d2891..9cddb3b 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_po1030.c ++++ b/drivers/media/usb/gspca/m5602/m5602_po1030.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_po1030.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c b/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c +index cec4a58..0f60b59 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c ++++ b/drivers/media/usb/gspca/m5602/m5602_s5k4aa.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "m5602_s5k4aa.h" +diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c +index 3d8ab18..78aa206 100644 +--- a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c ++++ b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c +@@ -16,6 +16,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/gspca/mars.c b/drivers/media/usb/gspca/mars.c +index a537cb1..e40f485 100644 +--- a/drivers/media/usb/gspca/mars.c ++++ b/drivers/media/usb/gspca/mars.c +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "mars" +diff --git a/drivers/media/usb/gspca/mr97310a.c b/drivers/media/usb/gspca/mr97310a.c +index bea1963..deb34c2 100644 +--- a/drivers/media/usb/gspca/mr97310a.c ++++ b/drivers/media/usb/gspca/mr97310a.c +@@ -36,6 +36,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "mr97310a" +diff --git a/drivers/media/usb/gspca/nw80x.c b/drivers/media/usb/gspca/nw80x.c +index bedc04a..3d61f3a 100644 +--- a/drivers/media/usb/gspca/nw80x.c ++++ b/drivers/media/usb/gspca/nw80x.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "nw80x" +diff --git a/drivers/media/usb/gspca/ov519.c b/drivers/media/usb/gspca/ov519.c +index 10fcbe9..7ad55aa 100644 +--- a/drivers/media/usb/gspca/ov519.c ++++ b/drivers/media/usb/gspca/ov519.c +@@ -33,6 +33,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "ov519" +diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c +index f293921..ed5a366 100644 +--- a/drivers/media/usb/gspca/ov534.c ++++ b/drivers/media/usb/gspca/ov534.c +@@ -26,6 +26,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "ov534" +diff --git a/drivers/media/usb/gspca/ov534_9.c b/drivers/media/usb/gspca/ov534_9.c +index 3d1364d..344c85a 100644 +--- a/drivers/media/usb/gspca/ov534_9.c ++++ b/drivers/media/usb/gspca/ov534_9.c +@@ -20,6 +20,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "ov534_9" +diff --git a/drivers/media/usb/gspca/pac207.c b/drivers/media/usb/gspca/pac207.c +index a1df7af..d4e5db1 100644 +--- a/drivers/media/usb/gspca/pac207.c ++++ b/drivers/media/usb/gspca/pac207.c +@@ -19,6 +19,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "pac207" +diff --git a/drivers/media/usb/gspca/pac7302.c b/drivers/media/usb/gspca/pac7302.c +index b8ff201..05a5027 100644 +--- a/drivers/media/usb/gspca/pac7302.c ++++ b/drivers/media/usb/gspca/pac7302.c +@@ -86,6 +86,7 @@ + * 3 | 0x21 | sethvflip() + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/gspca/pac7311.c b/drivers/media/usb/gspca/pac7311.c +index 44db4f4..2b6bacb 100644 +--- a/drivers/media/usb/gspca/pac7311.c ++++ b/drivers/media/usb/gspca/pac7311.c +@@ -53,6 +53,7 @@ + * for max gain, 0x14 for minimal gain. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "pac7311" +diff --git a/drivers/media/usb/gspca/se401.c b/drivers/media/usb/gspca/se401.c +index 477da06..fb7cc41 100644 +--- a/drivers/media/usb/gspca/se401.c ++++ b/drivers/media/usb/gspca/se401.c +@@ -19,6 +19,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "se401" +diff --git a/drivers/media/usb/gspca/sn9c2028.c b/drivers/media/usb/gspca/sn9c2028.c +index a1f7189..2a003cc 100644 +--- a/drivers/media/usb/gspca/sn9c2028.c ++++ b/drivers/media/usb/gspca/sn9c2028.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sn9c2028" +diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c +index cfa2a04..3d5e61b 100644 +--- a/drivers/media/usb/gspca/sn9c20x.c ++++ b/drivers/media/usb/gspca/sn9c20x.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/gspca/sonixj.c b/drivers/media/usb/gspca/sonixj.c +index df8d848..da017d2 100644 +--- a/drivers/media/usb/gspca/sonixj.c ++++ b/drivers/media/usb/gspca/sonixj.c +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sonixj" +diff --git a/drivers/media/usb/gspca/spca1528.c b/drivers/media/usb/gspca/spca1528.c +index d25924e..abd8d99 100644 +--- a/drivers/media/usb/gspca/spca1528.c ++++ b/drivers/media/usb/gspca/spca1528.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca1528" +diff --git a/drivers/media/usb/gspca/spca500.c b/drivers/media/usb/gspca/spca500.c +index e90d2f3..fa706a1 100644 +--- a/drivers/media/usb/gspca/spca500.c ++++ b/drivers/media/usb/gspca/spca500.c +@@ -15,6 +15,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca500" +diff --git a/drivers/media/usb/gspca/spca501.c b/drivers/media/usb/gspca/spca501.c +index 2cce74b..238bae9 100644 +--- a/drivers/media/usb/gspca/spca501.c ++++ b/drivers/media/usb/gspca/spca501.c +@@ -15,6 +15,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca501" +diff --git a/drivers/media/usb/gspca/spca505.c b/drivers/media/usb/gspca/spca505.c +index 07aae9c..8f5ca2e 100644 +--- a/drivers/media/usb/gspca/spca505.c ++++ b/drivers/media/usb/gspca/spca505.c +@@ -15,6 +15,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca505" +diff --git a/drivers/media/usb/gspca/spca508.c b/drivers/media/usb/gspca/spca508.c +index d80fd39..329f23a 100644 +--- a/drivers/media/usb/gspca/spca508.c ++++ b/drivers/media/usb/gspca/spca508.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca508" +diff --git a/drivers/media/usb/gspca/spca561.c b/drivers/media/usb/gspca/spca561.c +index f389a8d..8fdbe78 100644 +--- a/drivers/media/usb/gspca/spca561.c ++++ b/drivers/media/usb/gspca/spca561.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "spca561" +diff --git a/drivers/media/usb/gspca/sq905.c b/drivers/media/usb/gspca/sq905.c +index ffea9c3..3afd535 100644 +--- a/drivers/media/usb/gspca/sq905.c ++++ b/drivers/media/usb/gspca/sq905.c +@@ -29,6 +29,7 @@ + * drivers. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sq905" +diff --git a/drivers/media/usb/gspca/sq905c.c b/drivers/media/usb/gspca/sq905c.c +index 274921c..187c673 100644 +--- a/drivers/media/usb/gspca/sq905c.c ++++ b/drivers/media/usb/gspca/sq905c.c +@@ -23,6 +23,7 @@ + * and may contain code fragments from it. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sq905c" +diff --git a/drivers/media/usb/gspca/sq930x.c b/drivers/media/usb/gspca/sq930x.c +index d7cbcf2..b4194d4 100644 +--- a/drivers/media/usb/gspca/sq930x.c ++++ b/drivers/media/usb/gspca/sq930x.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sq930x" +diff --git a/drivers/media/usb/gspca/stk014.c b/drivers/media/usb/gspca/stk014.c +index 0d8f489..e009b4e 100644 +--- a/drivers/media/usb/gspca/stk014.c ++++ b/drivers/media/usb/gspca/stk014.c +@@ -14,6 +14,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "stk014" +diff --git a/drivers/media/usb/gspca/stk1135.c b/drivers/media/usb/gspca/stk1135.c +index 6f52a48..13867b7 100644 +--- a/drivers/media/usb/gspca/stk1135.c ++++ b/drivers/media/usb/gspca/stk1135.c +@@ -17,6 +17,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "stk1135" +diff --git a/drivers/media/usb/gspca/stv0680.c b/drivers/media/usb/gspca/stv0680.c +index 3ff5ed7..1223fe9 100644 +--- a/drivers/media/usb/gspca/stv0680.c ++++ b/drivers/media/usb/gspca/stv0680.c +@@ -23,6 +23,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "stv0680" +diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx.c b/drivers/media/usb/gspca/stv06xx/stv06xx.c +index 6080a35..0c72953 100644 +--- a/drivers/media/usb/gspca/stv06xx/stv06xx.c ++++ b/drivers/media/usb/gspca/stv06xx/stv06xx.c +@@ -23,6 +23,7 @@ + * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c +index d8db2c8..fb221d8 100644 +--- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c ++++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c +@@ -24,6 +24,7 @@ + * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "stv06xx_hdcs.h" +diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +index 7374aeb..85c37d7 100644 +--- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c ++++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +@@ -40,6 +40,7 @@ + * PB_CFILLIN = R5 = 0x0E (14 dec) : Sets the frame rate + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "stv06xx_pb0100.h" +diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c +index 51a135c..9577ac5 100644 +--- a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c ++++ b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c +@@ -22,6 +22,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "stv06xx_st6422.h" +diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c +index b2f16c2..a9952fe 100644 +--- a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c ++++ b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c +@@ -23,6 +23,7 @@ + * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "stv06xx_vv6410.h" +diff --git a/drivers/media/usb/gspca/sunplus.c b/drivers/media/usb/gspca/sunplus.c +index 437a336..5258a00 100644 +--- a/drivers/media/usb/gspca/sunplus.c ++++ b/drivers/media/usb/gspca/sunplus.c +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "sunplus" +diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c +index 0ae557c..ea478a7 100644 +--- a/drivers/media/usb/gspca/t613.c ++++ b/drivers/media/usb/gspca/t613.c +@@ -22,6 +22,7 @@ + * Costantino Leandro + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "t613" +diff --git a/drivers/media/usb/gspca/topro.c b/drivers/media/usb/gspca/topro.c +index 82e2be1..da5416e 100644 +--- a/drivers/media/usb/gspca/topro.c ++++ b/drivers/media/usb/gspca/topro.c +@@ -19,6 +19,7 @@ + * along with this program; If not, see . + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "gspca.h" +diff --git a/drivers/media/usb/gspca/vc032x.c b/drivers/media/usb/gspca/vc032x.c +index 6b11597..cde8d4e 100644 +--- a/drivers/media/usb/gspca/vc032x.c ++++ b/drivers/media/usb/gspca/vc032x.c +@@ -16,6 +16,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "vc032x" +diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c +index 8562bda..8d4c3de 100644 +--- a/drivers/media/usb/gspca/vicam.c ++++ b/drivers/media/usb/gspca/vicam.c +@@ -22,6 +22,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "vicam" +diff --git a/drivers/media/usb/gspca/w996Xcf.c b/drivers/media/usb/gspca/w996Xcf.c +index abfab3d..1a5ab87 100644 +--- a/drivers/media/usb/gspca/w996Xcf.c ++++ b/drivers/media/usb/gspca/w996Xcf.c +@@ -27,6 +27,7 @@ + the sensor drivers to v4l2 sub drivers, and properly split of this + driver from ov519.c */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define W9968CF_I2C_BUS_DELAY 4 /* delay in us for I2C bit r/w operations */ +diff --git a/drivers/media/usb/gspca/xirlink_cit.c b/drivers/media/usb/gspca/xirlink_cit.c +index 58deb0c..1a81691 100644 +--- a/drivers/media/usb/gspca/xirlink_cit.c ++++ b/drivers/media/usb/gspca/xirlink_cit.c +@@ -23,6 +23,7 @@ + * + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #define MODULE_NAME "xirlink-cit" +diff --git a/drivers/media/usb/gspca/zc3xx.c b/drivers/media/usb/gspca/zc3xx.c +index 25b4dbe..92919af 100644 +--- a/drivers/media/usb/gspca/zc3xx.c ++++ b/drivers/media/usb/gspca/zc3xx.c +@@ -15,6 +15,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/usb/stkwebcam/stk-sensor.c b/drivers/media/usb/stkwebcam/stk-sensor.c +index 9a7dbef..497fb981 100644 +--- a/drivers/media/usb/stkwebcam/stk-sensor.c ++++ b/drivers/media/usb/stkwebcam/stk-sensor.c +@@ -41,6 +41,7 @@ + + /* It seems the i2c bus is controlled with these registers */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include "stk-webcam.h" +diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c +index 22389b5..ba7fe8e 100644 +--- a/drivers/media/usb/stkwebcam/stk-webcam.c ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c +@@ -18,6 +18,7 @@ + * GNU General Public License for more details. + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c +index 530db8e..de11349 100644 +--- a/drivers/media/v4l2-core/v4l2-dev.c ++++ b/drivers/media/v4l2-core/v4l2-dev.c +@@ -16,6 +16,7 @@ + * - Added procfs support + */ + ++#undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/tda18271_debug_fix.patch media-build-dkms-0005~trusty/media-build-0005/backports/tda18271_debug_fix.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/tda18271_debug_fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/tda18271_debug_fix.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,59 @@ +diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c +index 86e5e31..9f7a0eb 100644 +--- a/drivers/media/tuners/tda18271-common.c ++++ b/drivers/media/tuners/tda18271-common.c +@@ -713,26 +713,3 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq) + fail: + return ret; + } +- +-void _tda_printk(struct tda18271_priv *state, const char *level, +- const char *func, const char *fmt, ...) +-{ +- struct va_format vaf; +- va_list args; +- +- va_start(args, fmt); +- +- vaf.fmt = fmt; +- vaf.va = &args; +- +- if (state) +- printk("%s%s: [%d-%04x|%c] %pV", +- level, func, i2c_adapter_id(state->i2c_props.adap), +- state->i2c_props.addr, +- (state->role == TDA18271_MASTER) ? 'M' : 'S', +- &vaf); +- else +- printk("%s%s: %pV", level, func, &vaf); +- +- va_end(args); +-} +diff --git a/drivers/media/tuners/tda18271-priv.h b/drivers/media/tuners/tda18271-priv.h +index b36a7b7..3bc5b1c 100644 +--- a/drivers/media/tuners/tda18271-priv.h ++++ b/drivers/media/tuners/tda18271-priv.h +@@ -138,12 +138,17 @@ extern int tda18271_debug; + #define DBG_ADV 8 + #define DBG_CAL 16 + +-__attribute__((format(printf, 4, 5))) +-void _tda_printk(struct tda18271_priv *state, const char *level, +- const char *func, const char *fmt, ...); +- +-#define tda_printk(st, lvl, fmt, arg...) \ +- _tda_printk(st, lvl, __func__, fmt, ##arg) ++#define tda_printk(st, kern, fmt, arg...) do {\ ++ if (st) { \ ++ struct tda18271_priv *state = st; \ ++ printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \ ++ i2c_adapter_id(state->i2c_props.adap), \ ++ state->i2c_props.addr, \ ++ (state->role == TDA18271_MASTER) \ ++ ? "M" : "S", ##arg); \ ++ } else \ ++ printk(kern "%s: " fmt, __func__, ##arg); \ ++} while (0) + + #define tda_dprintk(st, lvl, fmt, arg...) \ + do { \ diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_nodename.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_nodename.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_nodename.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_nodename.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,65 @@ +diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c +index 401ef64..3683ae0 100644 +--- a/drivers/media/dvb-core/dvbdev.c ++++ b/drivers/media/dvb-core/dvbdev.c +@@ -449,7 +449,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) + return 0; + } + +-static char *dvb_devnode(struct device *dev, mode_t *mode) ++static char *dvb_nodename(struct device *dev) + { + struct dvb_device *dvbdev = dev_get_drvdata(dev); + +@@ -480,7 +480,7 @@ static int __init init_dvbdev(void) + goto error; + } + dvb_class->dev_uevent = dvb_uevent; +- dvb_class->devnode = dvb_devnode; ++ dvb_class->nodename = dvb_nodename; + return 0; + + error: +diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c +index 36e3452..2565057 100644 +--- a/drivers/media/pci/ddbridge/ddbridge-core.c ++++ b/drivers/media/pci/ddbridge/ddbridge-core.c +@@ -1479,7 +1479,7 @@ static const struct file_operations ddb_fops = { + .open = ddb_open, + }; + +-static char *ddb_devnode(struct device *device, mode_t *mode) ++static char *ddb_devnode(struct device *device) + { + struct ddb *dev = dev_get_drvdata(device); + +@@ -1499,7 +1499,7 @@ static int ddb_class_create(void) + unregister_chrdev(ddb_major, DDB_NAME); + return PTR_ERR(ddb_class); + } +- ddb_class->devnode = ddb_devnode; ++ ddb_class->nodename = ddb_devnode; + return 0; + } + +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index f304792..c276faa 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -715,14 +715,14 @@ static void ir_close(struct input_dev *idev) + } + + /* class for /sys/class/rc */ +-static char *rc_devnode(struct device *dev, mode_t *mode) ++static char *rc_devnode(struct device *dev) + { + return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); + } + + static struct class rc_class = { + .name = "rc", +- .devnode = rc_devnode, ++ .nodename = rc_devnode, + }; + + /* diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_rc.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_rc.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_rc.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_rc.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index 970b93d..dea22d2 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -1312,7 +1312,7 @@ int rc_register_device(struct rc_dev *dev) + return -ENOMEM; + } while (test_and_set_bit(devno, ir_core_dev_number)); + +- dev->dev.groups = dev->sysfs_groups; ++ dev->dev.groups = (struct attribute_group **)dev->sysfs_groups; + dev->sysfs_groups[attr++] = &rc_dev_protocol_attr_grp; + if (dev->s_filter) + dev->sysfs_groups[attr++] = &rc_dev_filter_attr_grp; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_vm_ops.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_vm_ops.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.31_vm_ops.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.31_vm_ops.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,156 @@ +diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c +index 301084b..1776383 100644 +--- a/drivers/media/i2c/as3645a.c ++++ b/drivers/media/i2c/as3645a.c +@@ -863,7 +863,7 @@ static const struct i2c_device_id as3645a_id_table[] = { + }; + MODULE_DEVICE_TABLE(i2c, as3645a_id_table); + +-static const struct dev_pm_ops as3645a_pm_ops = { ++static struct dev_pm_ops as3645a_pm_ops = { + .suspend = as3645a_suspend, + .resume = as3645a_resume, + }; +diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c +index 8190fec..9ed1198c 100644 +--- a/drivers/media/i2c/msp3400-driver.c ++++ b/drivers/media/i2c/msp3400-driver.c +@@ -882,7 +882,7 @@ static int msp_remove(struct i2c_client *client) + + /* ----------------------------------------------------------------------- */ + +-static const struct dev_pm_ops msp3400_pm_ops = { ++static struct dev_pm_ops msp3400_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(msp_suspend, msp_resume) + }; + +diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c +index 2381b05..09b4a49 100644 +--- a/drivers/media/pci/meye/meye.c ++++ b/drivers/media/pci/meye/meye.c +@@ -1461,7 +1461,7 @@ static void meye_vm_close(struct vm_area_struct *vma) + meye.vma_use_count[idx]--; + } + +-static const struct vm_operations_struct meye_vm_ops = { ++static struct vm_operations_struct meye_vm_ops = { + .open = meye_vm_open, + .close = meye_vm_close, + }; +diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c +index e7e9840..1a3ee0f 100644 +--- a/drivers/media/pci/zoran/zoran_driver.c ++++ b/drivers/media/pci/zoran/zoran_driver.c +@@ -2838,7 +2838,7 @@ zoran_vm_close (struct vm_area_struct *vma) + mutex_unlock(&zr->resource_lock); + } + +-static const struct vm_operations_struct zoran_vm_ops = { ++static struct vm_operations_struct zoran_vm_ops = { + .open = zoran_vm_open, + .close = zoran_vm_close, + }; +diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c +index b7ae872..30a450e 100644 +--- a/drivers/media/usb/gspca/gspca.c ++++ b/drivers/media/usb/gspca/gspca.c +@@ -107,7 +107,7 @@ static void gspca_vm_close(struct vm_area_struct *vma) + frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_MAPPED; + } + +-static const struct vm_operations_struct gspca_vm_ops = { ++static struct vm_operations_struct gspca_vm_ops = { + .open = gspca_vm_open, + .close = gspca_vm_close, + }; +diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c +index c43c8d3..6d14f20 100644 +--- a/drivers/media/usb/stkwebcam/stk-webcam.c ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c +@@ -747,7 +747,7 @@ static void stk_v4l_vm_close(struct vm_area_struct *vma) + if (sbuf->mapcount == 0) + sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_MAPPED; + } +-static const struct vm_operations_struct stk_v4l_vm_ops = { ++static struct vm_operations_struct stk_v4l_vm_ops = { + .open = stk_v4l_vm_open, + .close = stk_v4l_vm_close + }; +diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c +index ddc9379..f4ef7f5 100644 +--- a/drivers/media/v4l2-core/tuner-core.c ++++ b/drivers/media/v4l2-core/tuner-core.c +@@ -1324,7 +1324,7 @@ static const struct v4l2_subdev_ops tuner_ops = { + * I2C structs and module init functions + */ + +-static const struct dev_pm_ops tuner_pm_ops = { ++static struct dev_pm_ops tuner_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(tuner_suspend, tuner_resume) + }; + +diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c +index 65411ad..7365adc 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-contig.c ++++ b/drivers/media/v4l2-core/videobuf-dma-contig.c +@@ -132,7 +132,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) + videobuf_queue_unlock(q); + } + +-static const struct vm_operations_struct videobuf_vm_ops = { ++static struct vm_operations_struct videobuf_vm_ops = { + .open = videobuf_vm_open, + .close = videobuf_vm_close, + }; +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index 9db674c..7cc4d4b 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -405,7 +405,7 @@ static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) + return 0; + } + +-static const struct vm_operations_struct videobuf_vm_ops = { ++static struct vm_operations_struct videobuf_vm_ops = { + .open = videobuf_vm_open, + .close = videobuf_vm_close, + .fault = videobuf_vm_fault, +diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c +index 1365c65..dfc24343 100644 +--- a/drivers/media/v4l2-core/videobuf-vmalloc.c ++++ b/drivers/media/v4l2-core/videobuf-vmalloc.c +@@ -122,7 +122,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) + return; + } + +-static const struct vm_operations_struct videobuf_vm_ops = { ++static struct vm_operations_struct videobuf_vm_ops = { + .open = videobuf_vm_open, + .close = videobuf_vm_close, + }; +diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c +index 81c1ad8..4912aa1 100644 +--- a/drivers/media/v4l2-core/videobuf2-memops.c ++++ b/drivers/media/v4l2-core/videobuf2-memops.c +@@ -176,7 +176,7 @@ static void vb2_common_vm_close(struct vm_area_struct *vma) + * vb2_common_vm_ops - common vm_ops used for tracking refcount of mmaped + * video buffers + */ +-const struct vm_operations_struct vb2_common_vm_ops = { ++struct vm_operations_struct vb2_common_vm_ops = { + .open = vb2_common_vm_open, + .close = vb2_common_vm_close, + }; +diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h +index f05444c..c395259 100644 +--- a/include/media/videobuf2-memops.h ++++ b/include/media/videobuf2-memops.h +@@ -28,7 +28,7 @@ struct vb2_vmarea_handler { + void *arg; + }; + +-extern const struct vm_operations_struct vb2_common_vm_ops; ++extern struct vm_operations_struct vb2_common_vm_ops; + + int vb2_get_contig_userptr(unsigned long vaddr, unsigned long size, + struct vm_area_struct **res_vma, dma_addr_t *res_pa); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_dvb_net.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_dvb_net.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_dvb_net.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_dvb_net.patch 2017-12-20 10:54:23.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c +index f91c80c..d487c15 100644 +--- a/drivers/media/dvb-core/dvb_net.c ++++ b/drivers/media/dvb-core/dvb_net.c +@@ -653,7 +653,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) + dev_kfree_skb(priv->ule_skb); + } else { + /* CRC32 verified OK. */ +- u8 dest_addr[ETH_ALEN]; ++ u8 dest_addr[ETH_ALEN] = { 0 }; + static const u8 bc_addr[ETH_ALEN] = + { [ 0 ... ETH_ALEN-1] = 0xff }; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_kfifo.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_kfifo.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_kfifo.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_kfifo.patch 2017-12-20 10:54:23.000000000 +0000 @@ -0,0 +1,565 @@ +diff --git a/drivers/media/i2c/cx25840/cx25840-ir.c b/drivers/media/i2c/cx25840/cx25840-ir.c +index 4cf8f18..facb846 100644 +--- a/drivers/media/i2c/cx25840/cx25840-ir.c ++++ b/drivers/media/i2c/cx25840/cx25840-ir.c +@@ -117,7 +117,7 @@ struct cx25840_ir_state { + atomic_t rxclk_divider; + atomic_t rx_invert; + +- struct kfifo rx_kfifo; ++ struct kfifo *rx_kfifo; + spinlock_t rx_kfifo_lock; /* protect Rx data kfifo */ + + struct v4l2_subdev_ir_parameters tx_params; +@@ -524,7 +524,6 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) + struct cx25840_state *state = to_state(sd); + struct cx25840_ir_state *ir_state = to_ir_state(sd); + struct i2c_client *c = NULL; +- unsigned long flags; + + union cx25840_ir_fifo_rec rx_data[FIFO_RX_DEPTH]; + unsigned int i, j, k; +@@ -610,9 +609,8 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) + if (i == 0) + break; + j = i * sizeof(union cx25840_ir_fifo_rec); +- k = kfifo_in_locked(&ir_state->rx_kfifo, +- (unsigned char *) rx_data, j, +- &ir_state->rx_kfifo_lock); ++ k = kfifo_put(ir_state->rx_kfifo, ++ (unsigned char *) rx_data, j); + if (k != j) + kror++; /* rx_kfifo over run */ + } +@@ -648,10 +646,8 @@ int cx25840_ir_irq_handler(struct v4l2_subdev *sd, u32 status, bool *handled) + cx25840_write4(c, CX25840_IR_CNTRL_REG, cntrl); + *handled = true; + } +- spin_lock_irqsave(&ir_state->rx_kfifo_lock, flags); +- if (kfifo_len(&ir_state->rx_kfifo) >= CX25840_IR_RX_KFIFO_SIZE / 2) ++ if (kfifo_len(ir_state->rx_kfifo) >= CX25840_IR_RX_KFIFO_SIZE / 2) + events |= V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ; +- spin_unlock_irqrestore(&ir_state->rx_kfifo_lock, flags); + + if (events) + v4l2_subdev_notify(sd, V4L2_SUBDEV_IR_RX_NOTIFY, &events); +@@ -682,8 +678,7 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, + return 0; + } + +- n = kfifo_out_locked(&ir_state->rx_kfifo, buf, n, +- &ir_state->rx_kfifo_lock); ++ n = kfifo_get(ir_state->rx_kfifo, buf, n); + + n /= sizeof(union cx25840_ir_fifo_rec); + *num = n * sizeof(union cx25840_ir_fifo_rec); +@@ -839,11 +834,7 @@ static int cx25840_ir_rx_s_parameters(struct v4l2_subdev *sd, + o->interrupt_enable = p->interrupt_enable; + o->enable = p->enable; + if (p->enable) { +- unsigned long flags; +- +- spin_lock_irqsave(&ir_state->rx_kfifo_lock, flags); +- kfifo_reset(&ir_state->rx_kfifo); +- spin_unlock_irqrestore(&ir_state->rx_kfifo_lock, flags); ++ kfifo_reset(ir_state->rx_kfifo); + if (p->interrupt_enable) + irqenable_rx(sd, IRQEN_RSE | IRQEN_RTE | IRQEN_ROE); + control_rx_enable(c, p->enable); +@@ -1235,8 +1226,9 @@ int cx25840_ir_probe(struct v4l2_subdev *sd) + return -ENOMEM; + + spin_lock_init(&ir_state->rx_kfifo_lock); +- if (kfifo_alloc(&ir_state->rx_kfifo, +- CX25840_IR_RX_KFIFO_SIZE, GFP_KERNEL)) ++ ir_state->rx_kfifo = kfifo_alloc(CX25840_IR_RX_KFIFO_SIZE, GFP_KERNEL, ++ &ir_state->rx_kfifo_lock); ++ if (IS_ERR(ir_state->rx_kfifo)) + return -ENOMEM; + + ir_state->c = state->c; +@@ -1270,7 +1262,7 @@ int cx25840_ir_remove(struct v4l2_subdev *sd) + cx25840_ir_rx_shutdown(sd); + cx25840_ir_tx_shutdown(sd); + +- kfifo_free(&ir_state->rx_kfifo); ++ kfifo_free(ir_state->rx_kfifo); + state->ir_state = NULL; + return 0; + } +diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c +index c1aa888..b04d70c 100644 +--- a/drivers/media/pci/cx23885/cx23888-ir.c ++++ b/drivers/media/pci/cx23885/cx23888-ir.c +@@ -131,7 +131,7 @@ struct cx23888_ir_state { + atomic_t rxclk_divider; + atomic_t rx_invert; + +- struct kfifo rx_kfifo; ++ struct kfifo *rx_kfifo; + spinlock_t rx_kfifo_lock; + + struct v4l2_subdev_ir_parameters tx_params; +@@ -531,7 +531,6 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, + { + struct cx23888_ir_state *state = to_state(sd); + struct cx23885_dev *dev = state->dev; +- unsigned long flags; + + u32 cntrl = cx23888_ir_read4(dev, CX23888_IR_CNTRL_REG); + u32 irqen = cx23888_ir_read4(dev, CX23888_IR_IRQEN_REG); +@@ -604,10 +603,9 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, + } + if (i == 0) + break; +- j = i * sizeof(union cx23888_ir_fifo_rec); +- k = kfifo_in_locked(&state->rx_kfifo, +- (unsigned char *) rx_data, j, +- &state->rx_kfifo_lock); ++ j = i * sizeof(u32); ++ k = kfifo_put(state->rx_kfifo, ++ (unsigned char *) rx_data, j); + if (k != j) + kror++; /* rx_kfifo over run */ + } +@@ -644,10 +642,8 @@ static int cx23888_ir_irq_handler(struct v4l2_subdev *sd, u32 status, + *handled = true; + } + +- spin_lock_irqsave(&state->rx_kfifo_lock, flags); +- if (kfifo_len(&state->rx_kfifo) >= CX23888_IR_RX_KFIFO_SIZE / 2) ++ if (kfifo_len(state->rx_kfifo) >= CX23888_IR_RX_KFIFO_SIZE / 2) + events |= V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ; +- spin_unlock_irqrestore(&state->rx_kfifo_lock, flags); + + if (events) + v4l2_subdev_notify(sd, V4L2_SUBDEV_IR_RX_NOTIFY, &events); +@@ -673,7 +669,7 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, + return 0; + } + +- n = kfifo_out_locked(&state->rx_kfifo, buf, n, &state->rx_kfifo_lock); ++ n = kfifo_get(state->rx_kfifo, buf, n); + + n /= sizeof(union cx23888_ir_fifo_rec); + *num = n * sizeof(union cx23888_ir_fifo_rec); +@@ -812,12 +808,7 @@ static int cx23888_ir_rx_s_parameters(struct v4l2_subdev *sd, + o->interrupt_enable = p->interrupt_enable; + o->enable = p->enable; + if (p->enable) { +- unsigned long flags; +- +- spin_lock_irqsave(&state->rx_kfifo_lock, flags); +- kfifo_reset(&state->rx_kfifo); +- /* reset tx_fifo too if there is one... */ +- spin_unlock_irqrestore(&state->rx_kfifo_lock, flags); ++ kfifo_reset(state->rx_kfifo); + if (p->interrupt_enable) + irqenable_rx(dev, IRQEN_RSE | IRQEN_RTE | IRQEN_ROE); + control_rx_enable(dev, p->enable); +@@ -1179,8 +1170,10 @@ int cx23888_ir_probe(struct cx23885_dev *dev) + return -ENOMEM; + + spin_lock_init(&state->rx_kfifo_lock); +- if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL)) +- return -ENOMEM; ++ state->rx_kfifo = kfifo_alloc(CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL, ++ &state->rx_kfifo_lock); ++ if (IS_ERR(state->rx_kfifo)) ++ return IS_ERR(state->rx_kfifo); + + state->dev = dev; + sd = &state->sd; +@@ -1208,7 +1201,7 @@ int cx23888_ir_probe(struct cx23885_dev *dev) + default_params = default_tx_params; + v4l2_subdev_call(sd, ir, tx_s_parameters, &default_params); + } else { +- kfifo_free(&state->rx_kfifo); ++ kfifo_free(state->rx_kfifo); + } + return ret; + } +@@ -1227,7 +1220,7 @@ int cx23888_ir_remove(struct cx23885_dev *dev) + + state = to_state(sd); + v4l2_device_unregister_subdev(sd); +- kfifo_free(&state->rx_kfifo); ++ kfifo_free(state->rx_kfifo); + kfree(state); + /* Nothing more to free() as state held the actual v4l2_subdev object */ + return 0; +diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c +index aeae547..3d85fff 100644 +--- a/drivers/media/pci/meye/meye.c ++++ b/drivers/media/pci/meye/meye.c +@@ -804,8 +804,8 @@ again: + return IRQ_HANDLED; + + if (meye.mchip_mode == MCHIP_HIC_MODE_CONT_OUT) { +- if (kfifo_out_locked(&meye.grabq, (unsigned char *)&reqnr, +- sizeof(int), &meye.grabq_lock) != sizeof(int)) { ++ if (kfifo_get(meye.grabq, (unsigned char *)&reqnr, ++ sizeof(int)) != sizeof(int)) { + mchip_free_frame(); + return IRQ_HANDLED; + } +@@ -815,8 +815,7 @@ again: + meye.grab_buffer[reqnr].state = MEYE_BUF_DONE; + v4l2_get_timestamp(&meye.grab_buffer[reqnr].timestamp); + meye.grab_buffer[reqnr].sequence = sequence++; +- kfifo_in_locked(&meye.doneq, (unsigned char *)&reqnr, +- sizeof(int), &meye.doneq_lock); ++ kfifo_put(meye.doneq, (unsigned char *)&reqnr, sizeof(int)); + wake_up_interruptible(&meye.proc_list); + } else { + int size; +@@ -825,8 +824,8 @@ again: + mchip_free_frame(); + goto again; + } +- if (kfifo_out_locked(&meye.grabq, (unsigned char *)&reqnr, +- sizeof(int), &meye.grabq_lock) != sizeof(int)) { ++ if (kfifo_get(meye.grabq, (unsigned char *)&reqnr, ++ sizeof(int)) != sizeof(int)) { + mchip_free_frame(); + goto again; + } +@@ -836,8 +835,7 @@ again: + meye.grab_buffer[reqnr].state = MEYE_BUF_DONE; + v4l2_get_timestamp(&meye.grab_buffer[reqnr].timestamp); + meye.grab_buffer[reqnr].sequence = sequence++; +- kfifo_in_locked(&meye.doneq, (unsigned char *)&reqnr, +- sizeof(int), &meye.doneq_lock); ++ kfifo_put(meye.doneq, (unsigned char *)&reqnr, sizeof(int)); + wake_up_interruptible(&meye.proc_list); + } + mchip_free_frame(); +@@ -865,8 +863,8 @@ static int meye_open(struct file *file) + + for (i = 0; i < MEYE_MAX_BUFNBRS; i++) + meye.grab_buffer[i].state = MEYE_BUF_UNUSED; +- kfifo_reset(&meye.grabq); +- kfifo_reset(&meye.doneq); ++ kfifo_reset(meye.grabq); ++ kfifo_reset(meye.doneq); + return v4l2_fh_open(file); + } + +@@ -939,8 +937,7 @@ static int meyeioc_qbuf_capt(int *nb) + mchip_cont_compression_start(); + + meye.grab_buffer[*nb].state = MEYE_BUF_USING; +- kfifo_in_locked(&meye.grabq, (unsigned char *)nb, sizeof(int), +- &meye.grabq_lock); ++ kfifo_put(meye.grabq, (unsigned char *)nb, sizeof(int)); + mutex_unlock(&meye.lock); + + return 0; +@@ -972,9 +969,7 @@ static int meyeioc_sync(struct file *file, void *fh, int *i) + /* fall through */ + case MEYE_BUF_DONE: + meye.grab_buffer[*i].state = MEYE_BUF_UNUSED; +- if (kfifo_out_locked(&meye.doneq, (unsigned char *)&unused, +- sizeof(int), &meye.doneq_lock) != sizeof(int)) +- break; ++ kfifo_get(meye.doneq, (unsigned char *)&unused, sizeof(int)); + } + *i = meye.grab_buffer[*i].size; + mutex_unlock(&meye.lock); +@@ -1319,8 +1314,7 @@ static int vidioc_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf) + buf->flags |= V4L2_BUF_FLAG_QUEUED; + buf->flags &= ~V4L2_BUF_FLAG_DONE; + meye.grab_buffer[buf->index].state = MEYE_BUF_USING; +- kfifo_in_locked(&meye.grabq, (unsigned char *)&buf->index, +- sizeof(int), &meye.grabq_lock); ++ kfifo_put(meye.grabq, (unsigned char *)&buf->index, sizeof(int)); + mutex_unlock(&meye.lock); + + return 0; +@@ -1335,19 +1329,19 @@ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf) + + mutex_lock(&meye.lock); + +- if (kfifo_len(&meye.doneq) == 0 && file->f_flags & O_NONBLOCK) { ++ if (kfifo_len(meye.doneq) == 0 && file->f_flags & O_NONBLOCK) { + mutex_unlock(&meye.lock); + return -EAGAIN; + } + + if (wait_event_interruptible(meye.proc_list, +- kfifo_len(&meye.doneq) != 0) < 0) { ++ kfifo_len(meye.doneq) != 0) < 0) { + mutex_unlock(&meye.lock); + return -EINTR; + } + +- if (!kfifo_out_locked(&meye.doneq, (unsigned char *)&reqnr, +- sizeof(int), &meye.doneq_lock)) { ++ if (!kfifo_get(meye.doneq, (unsigned char *)&reqnr, ++ sizeof(int))) { + mutex_unlock(&meye.lock); + return -EBUSY; + } +@@ -1397,8 +1391,8 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i) + { + mutex_lock(&meye.lock); + mchip_hic_stop(); +- kfifo_reset(&meye.grabq); +- kfifo_reset(&meye.doneq); ++ kfifo_reset(meye.grabq); ++ kfifo_reset(meye.doneq); + + for (i = 0; i < MEYE_MAX_BUFNBRS; i++) + meye.grab_buffer[i].state = MEYE_BUF_UNUSED; +@@ -1441,7 +1435,7 @@ static unsigned int meye_poll(struct file *file, poll_table *wait) + + mutex_lock(&meye.lock); + poll_wait(file, &meye.proc_list, wait); +- if (kfifo_len(&meye.doneq)) ++ if (kfifo_len(meye.doneq)) + res |= POLLIN | POLLRDNORM; + mutex_unlock(&meye.lock); + return res; +@@ -1649,14 +1643,16 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) + } + + spin_lock_init(&meye.grabq_lock); +- if (kfifo_alloc(&meye.grabq, sizeof(int) * MEYE_MAX_BUFNBRS, +- GFP_KERNEL)) { ++ meye.grabq = kfifo_alloc(sizeof(int) * MEYE_MAX_BUFNBRS, GFP_KERNEL, ++ &meye.grabq_lock); ++ if (IS_ERR(meye.grabq)) { + v4l2_err(v4l2_dev, "fifo allocation failed\n"); + goto outkfifoalloc1; + } + spin_lock_init(&meye.doneq_lock); +- if (kfifo_alloc(&meye.doneq, sizeof(int) * MEYE_MAX_BUFNBRS, +- GFP_KERNEL)) { ++ meye.doneq = kfifo_alloc(sizeof(int) * MEYE_MAX_BUFNBRS, GFP_KERNEL, ++ &meye.doneq_lock); ++ if (IS_ERR(meye.doneq)) { + v4l2_err(v4l2_dev, "fifo allocation failed\n"); + goto outkfifoalloc2; + } +@@ -1774,9 +1770,9 @@ outregions: + outenabledev: + sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 0); + outsonypienable: +- kfifo_free(&meye.doneq); ++ kfifo_free(meye.doneq); + outkfifoalloc2: +- kfifo_free(&meye.grabq); ++ kfifo_free(meye.grabq); + outkfifoalloc1: + vfree(meye.grab_temp); + outvmalloc: +@@ -1807,8 +1803,8 @@ static void meye_remove(struct pci_dev *pcidev) + + sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 0); + +- kfifo_free(&meye.doneq); +- kfifo_free(&meye.grabq); ++ kfifo_free(meye.doneq); ++ kfifo_free(meye.grabq); + + vfree(meye.grab_temp); + +diff --git a/drivers/media/pci/meye/meye.h b/drivers/media/pci/meye/meye.h +index 6fed927..77aad1f 100644 +--- a/drivers/media/pci/meye/meye.h ++++ b/drivers/media/pci/meye/meye.h +@@ -306,9 +306,9 @@ struct meye { + struct meye_grab_buffer grab_buffer[MEYE_MAX_BUFNBRS]; + int vma_use_count[MEYE_MAX_BUFNBRS]; /* mmap count */ + struct mutex lock; /* mutex for open/mmap... */ +- struct kfifo grabq; /* queue for buffers to be grabbed */ ++ struct kfifo *grabq; /* queue for buffers to be grabbed */ + spinlock_t grabq_lock; /* lock protecting the queue */ +- struct kfifo doneq; /* queue for grabbed buffers */ ++ struct kfifo *doneq; /* queue for grabbed buffers */ + spinlock_t doneq_lock; /* lock protecting the queue */ + wait_queue_head_t proc_list; /* wait queue */ + struct video_device *vdev; /* video device parameters */ +diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h +index 84967ca..2aca801 100644 +--- a/drivers/media/rc/rc-core-priv.h ++++ b/drivers/media/rc/rc-core-priv.h +@@ -35,7 +35,7 @@ struct ir_raw_event_ctrl { + struct list_head list; /* to keep track of raw clients */ + struct task_struct *thread; + spinlock_t lock; +- struct kfifo kfifo; /* fifo for the pulse/space durations */ ++ struct kfifo *kfifo; /* fifo for the pulse/space durations */ + ktime_t last_event; /* when last event occurred */ + enum raw_event_type last_type; /* last event type */ + struct rc_dev *dev; /* pointer to the parent rc_dev */ +diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c +index e8fff2a..7709c32 100644 +--- a/drivers/media/rc/rc-ir-raw.c ++++ b/drivers/media/rc/rc-ir-raw.c +@@ -41,7 +41,7 @@ static int ir_raw_event_thread(void *data) + while (!kthread_should_stop()) { + + spin_lock_irq(&raw->lock); +- retval = kfifo_len(&raw->kfifo); ++ retval = kfifo_len(raw->kfifo); + + if (retval < sizeof(ev)) { + set_current_state(TASK_INTERRUPTIBLE); +@@ -54,7 +54,7 @@ static int ir_raw_event_thread(void *data) + continue; + } + +- retval = kfifo_out(&raw->kfifo, &ev, sizeof(ev)); ++ retval = __kfifo_get(raw->kfifo, (void *)&ev, sizeof(ev)); + spin_unlock_irq(&raw->lock); + + mutex_lock(&ir_raw_handler_lock); +@@ -85,7 +85,7 @@ int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev) + IR_dprintk(2, "sample: (%05dus %s)\n", + TO_US(ev->duration), TO_STR(ev->pulse)); + +- if (kfifo_in(&dev->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) ++ if (__kfifo_put(dev->raw->kfifo, (void *)ev, sizeof(*ev)) != sizeof(*ev)) + return -ENOMEM; + + return 0; +@@ -264,11 +264,11 @@ int ir_raw_event_register(struct rc_dev *dev) + dev->raw->dev = dev; + dev->enabled_protocols = ~0; + dev->change_protocol = change_protocol; +- rc = kfifo_alloc(&dev->raw->kfifo, +- sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, +- GFP_KERNEL); +- if (rc < 0) ++ dev->raw->kfifo = kfifo_alloc(sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, GFP_KERNEL, NULL); ++ if (IS_ERR(dev->raw->kfifo)) { ++ rc = PTR_ERR(dev->raw->kfifo); + goto out; ++ } + + spin_lock_init(&dev->raw->lock); + dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw, +@@ -310,7 +310,7 @@ void ir_raw_event_unregister(struct rc_dev *dev) + handler->raw_unregister(dev); + mutex_unlock(&ir_raw_handler_lock); + +- kfifo_free(&dev->raw->kfifo); ++ kfifo_free(dev->raw->kfifo); + kfree(dev->raw); + dev->raw = NULL; + } +diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c +index 1ccf626..b0e514b 100644 +--- a/drivers/staging/media/lirc/lirc_zilog.c ++++ b/drivers/staging/media/lirc/lirc_zilog.c +@@ -199,7 +199,7 @@ static void release_ir_device(struct kref *ref) + lirc_unregister_driver(ir->l.minor); + ir->l.minor = MAX_IRCTL_DEVICES; + } +- if (kfifo_initialized(&ir->rbuf.fifo)) ++ if (ir->rbuf.fifo) + lirc_buffer_free(&ir->rbuf); + list_del(&ir->list); + kfree(ir); +diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h +index 05e7ad5..f40097c 100644 +--- a/include/media/lirc_dev.h ++++ b/include/media/lirc_dev.h +@@ -28,18 +28,14 @@ struct lirc_buffer { + unsigned int size; /* in chunks */ + /* Using chunks instead of bytes pretends to simplify boundary checking + * And should allow for some performance fine tunning later */ +- struct kfifo fifo; ++ struct kfifo *fifo; + }; + + static inline void lirc_buffer_clear(struct lirc_buffer *buf) + { +- unsigned long flags; +- +- if (kfifo_initialized(&buf->fifo)) { +- spin_lock_irqsave(&buf->fifo_lock, flags); +- kfifo_reset(&buf->fifo); +- spin_unlock_irqrestore(&buf->fifo_lock, flags); +- } else ++ if (buf->fifo) ++ kfifo_reset(buf->fifo); ++ else + WARN(1, "calling %s on an uninitialized lirc_buffer\n", + __func__); + } +@@ -48,22 +44,23 @@ static inline int lirc_buffer_init(struct lirc_buffer *buf, + unsigned int chunk_size, + unsigned int size) + { +- int ret; +- + init_waitqueue_head(&buf->wait_poll); + spin_lock_init(&buf->fifo_lock); + buf->chunk_size = chunk_size; + buf->size = size; +- ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); ++ buf->fifo = kfifo_alloc(size * chunk_size, GFP_KERNEL, ++ &buf->fifo_lock); ++ if (IS_ERR(buf->fifo)) ++ return IS_ERR(buf->fifo); + +- return ret; ++ return 0; + } + + static inline void lirc_buffer_free(struct lirc_buffer *buf) + { +- if (kfifo_initialized(&buf->fifo)) { +- kfifo_free(&buf->fifo); +- } else ++ if (buf->fifo) ++ kfifo_free(buf->fifo); ++ else + WARN(1, "calling %s on an uninitialized lirc_buffer\n", + __func__); + } +@@ -71,11 +68,8 @@ static inline void lirc_buffer_free(struct lirc_buffer *buf) + static inline int lirc_buffer_len(struct lirc_buffer *buf) + { + int len; +- unsigned long flags; + +- spin_lock_irqsave(&buf->fifo_lock, flags); +- len = kfifo_len(&buf->fifo); +- spin_unlock_irqrestore(&buf->fifo_lock, flags); ++ len = kfifo_len(buf->fifo); + + return len; + } +@@ -98,24 +92,19 @@ static inline int lirc_buffer_available(struct lirc_buffer *buf) + static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, + unsigned char *dest) + { +- unsigned int ret = 0; +- + if (lirc_buffer_len(buf) >= buf->chunk_size) +- ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, +- &buf->fifo_lock); +- return ret; ++ kfifo_get(buf->fifo, dest, buf->chunk_size); ++ ++ return 0; + + } + + static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, + unsigned char *orig) + { +- unsigned int ret; +- +- ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, +- &buf->fifo_lock); ++ kfifo_put(buf->fifo, orig, buf->chunk_size); + +- return ret; ++ return 0; + } + + struct lirc_driver { diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_request_firmware_nowait.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_request_firmware_nowait.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.32_request_firmware_nowait.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.32_request_firmware_nowait.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c +index f88f948..8591799 100644 +--- a/drivers/media/tuners/tuner-xc2028.c ++++ b/drivers/media/tuners/tuner-xc2028.c +@@ -1408,7 +1408,6 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) + rc = request_firmware_nowait(THIS_MODULE, 1, + priv->fname, + priv->i2c_props.adap->dev.parent, +- GFP_KERNEL, + fe, load_firmware_cb); + if (rc < 0) { + tuner_err("Failed to request firmware %s\n", diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_input_handlers_are_int.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_input_handlers_are_int.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_input_handlers_are_int.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_input_handlers_are_int.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,45 @@ +--- + drivers/media/usb/dvb-usb/dvb-usb-remote.c | 4 ++-- + drivers/media/rc/rc-main.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- linux.orig/drivers/media/rc/rc-main.c ++++ linux/drivers/media/rc/rc-main.c +@@ -318,7 +318,7 @@ static unsigned int ir_establish_scancod + * This routine is used to handle evdev EVIOCSKEY ioctl. + */ + static int ir_setkeycode(struct input_dev *idev, +- unsigned int scancode, unsigned int keycode) ++ int scancode, int keycode) + { + struct rc_dev *rdev = input_get_drvdata(idev); + struct rc_map *rc_map = &rdev->rc_map; +@@ -422,7 +422,7 @@ static unsigned int ir_lookup_by_scancod + * This routine is used to handle evdev EVIOCGKEY ioctl. + */ + static int ir_getkeycode(struct input_dev *idev, +- unsigned int scancode, unsigned int *keycode) ++ int scancode, int *keycode) + { + struct rc_dev *rdev = input_get_drvdata(idev); + struct rc_map *rc_map = &rdev->rc_map; +--- linux.orig/drivers/media/usb/dvb-usb/dvb-usb-remote.c ++++ linux/drivers/media/usb/dvb-usb/dvb-usb-remote.c +@@ -9,7 +9,7 @@ + #include + + static int legacy_dvb_usb_getkeycode(struct input_dev *dev, +- unsigned int scancode, unsigned int *keycode) ++ int scancode, int *keycode) + { + struct dvb_usb_device *d = input_get_drvdata(dev); + +@@ -39,7 +39,7 @@ static int legacy_dvb_usb_getkeycode(str + } + + static int legacy_dvb_usb_setkeycode(struct input_dev *dev, +- unsigned int scancode, unsigned int keycode) ++ int scancode, int keycode) + { + struct dvb_usb_device *d = input_get_drvdata(dev); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_no_gpio_request_one.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_no_gpio_request_one.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_no_gpio_request_one.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_no_gpio_request_one.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,22 @@ +diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c +index 71e1fca..bc55d98 100644 +--- a/drivers/media/usb/em28xx/em28xx-dvb.c ++++ b/drivers/media/usb/em28xx/em28xx-dvb.c +@@ -719,7 +719,7 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) + struct dtv_frontend_properties *c = &fe->dtv_property_cache; + struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv; + struct em28xx *dev = i2c_bus->dev; +-#ifdef CONFIG_GPIOLIB ++#if 0 + struct em28xx_dvb *dvb = dev->dvb; + int ret; + unsigned long flags; +@@ -1220,7 +1220,7 @@ static int em28xx_dvb_init(struct em28xx *dev) + goto out_free; + } + +-#ifdef CONFIG_GPIOLIB ++#if 0 + /* enable LNA for DVB-T, DVB-T2 and DVB-C */ + result = gpio_request_one(dvb->lna_gpio, + GPIOF_OUT_INIT_LOW, NULL); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_pvrusb2_sysfs.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_pvrusb2_sysfs.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.33_pvrusb2_sysfs.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.33_pvrusb2_sysfs.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,73 @@ +--- + drivers/media/usb/pvrusb2/pvrusb2-sysfs.c | 14 -------------- + 1 file changed, 14 deletions(-) + +--- linux.orig/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c ++++ linux/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c +@@ -432,12 +432,10 @@ static void pvr2_sysfs_add_debugifc(stru + + dip = kzalloc(sizeof(*dip),GFP_KERNEL); + if (!dip) return; +- sysfs_attr_init(&dip->attr_debugcmd.attr); + dip->attr_debugcmd.attr.name = "debugcmd"; + dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; + dip->attr_debugcmd.show = debugcmd_show; + dip->attr_debugcmd.store = debugcmd_store; +- sysfs_attr_init(&dip->attr_debuginfo.attr); + dip->attr_debuginfo.attr.name = "debuginfo"; + dip->attr_debuginfo.attr.mode = S_IRUGO; + dip->attr_debuginfo.show = debuginfo_show; +@@ -659,8 +657,6 @@ static void class_dev_create(struct pvr2 + put_device(class_dev); + return; + } +- +- sysfs_attr_init(&sfp->attr_v4l_minor_number.attr); + sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; + sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; + sfp->attr_v4l_minor_number.show = v4l_minor_number_show; +@@ -674,8 +670,6 @@ static void class_dev_create(struct pvr2 + } else { + sfp->v4l_minor_number_created_ok = !0; + } +- +- sysfs_attr_init(&sfp->attr_v4l_radio_minor_number.attr); + sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number"; + sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO; + sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show; +@@ -689,8 +683,6 @@ static void class_dev_create(struct pvr2 + } else { + sfp->v4l_radio_minor_number_created_ok = !0; + } +- +- sysfs_attr_init(&sfp->attr_unit_number.attr); + sfp->attr_unit_number.attr.name = "unit_number"; + sfp->attr_unit_number.attr.mode = S_IRUGO; + sfp->attr_unit_number.show = unit_number_show; +@@ -703,8 +695,6 @@ static void class_dev_create(struct pvr2 + } else { + sfp->unit_number_created_ok = !0; + } +- +- sysfs_attr_init(&sfp->attr_bus_info.attr); + sfp->attr_bus_info.attr.name = "bus_info_str"; + sfp->attr_bus_info.attr.mode = S_IRUGO; + sfp->attr_bus_info.show = bus_info_show; +@@ -718,8 +708,6 @@ static void class_dev_create(struct pvr2 + } else { + sfp->bus_info_created_ok = !0; + } +- +- sysfs_attr_init(&sfp->attr_hdw_name.attr); + sfp->attr_hdw_name.attr.name = "device_hardware_type"; + sfp->attr_hdw_name.attr.mode = S_IRUGO; + sfp->attr_hdw_name.show = hdw_name_show; +@@ -733,8 +721,6 @@ static void class_dev_create(struct pvr2 + } else { + sfp->hdw_name_created_ok = !0; + } +- +- sysfs_attr_init(&sfp->attr_hdw_desc.attr); + sfp->attr_hdw_desc.attr.name = "device_hardware_description"; + sfp->attr_hdw_desc.attr.mode = S_IRUGO; + sfp->attr_hdw_desc.show = hdw_desc_show; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_dvb_net.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_dvb_net.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_dvb_net.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_dvb_net.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,41 @@ +diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c +index 686d327..eabf882 100644 +--- a/drivers/media/dvb-core/dvb_net.c ++++ b/drivers/media/dvb-core/dvb_net.c +@@ -1087,14 +1087,14 @@ static int dvb_net_feed_stop(struct net_device *dev) + } + + +-static int dvb_set_mc_filter(struct net_device *dev, unsigned char *addr) ++static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) + { + struct dvb_net_priv *priv = netdev_priv(dev); + + if (priv->multi_num == DVB_NET_MULTICAST_MAX) + return -ENOMEM; + +- memcpy(priv->multi_macs[priv->multi_num], addr, ETH_ALEN); ++ memcpy(priv->multi_macs[priv->multi_num], mc->dmi_addr, 6); + + priv->multi_num++; + return 0; +@@ -1118,7 +1118,7 @@ static void wq_set_multicast_list (struct work_struct *work) + netdev_dbg(dev, "allmulti mode\n"); + priv->rx_mode = RX_MODE_ALL_MULTI; + } else if (!netdev_mc_empty(dev)) { +- struct netdev_hw_addr *ha; ++ struct dev_mc_list *mc; + + netdev_dbg(dev, "set_mc_list, %d entries\n", + netdev_mc_count(dev)); +@@ -1126,8 +1126,8 @@ static void wq_set_multicast_list (struct work_struct *work) + priv->rx_mode = RX_MODE_MULTI; + priv->multi_num = 0; + +- netdev_for_each_mc_addr(ha, dev) +- dvb_set_mc_filter(dev, ha->addr); ++ netdev_for_each_mc_addr(mc, dev) ++ dvb_set_mc_filter(dev, mc); + } + + netif_addr_unlock_bh(dev); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_fix_define_warnings.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_fix_define_warnings.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_fix_define_warnings.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_fix_define_warnings.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,11 @@ +diff -r a0ea01e58ec5 drivers/media/dvb-frontends/tua6100.c +--- a/drivers/media/dvb-frontends/tua6100.c Wed Oct 27 20:58:38 2010 -0200 ++++ b/drivers/media/dvb-frontends/tua6100.c Wed Oct 27 21:07:04 2010 -0200 +@@ -80,6 +80,7 @@ + struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 }; + struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 }; + ++#undef _P + #define _R 4 + #define _P 32 + #define _ri 4000000 diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_usb_ss_ep_comp.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_usb_ss_ep_comp.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.34_usb_ss_ep_comp.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.34_usb_ss_ep_comp.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c +index 7e350d7..9c3aed2 100644 +--- a/drivers/media/usb/uvc/uvc_video.c ++++ b/drivers/media/usb/uvc/uvc_video.c +@@ -1463,7 +1463,7 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev, + + switch (dev->speed) { + case USB_SPEED_SUPER: +- return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval); ++ return le16_to_cpu(ep->ss_ep_comp->desc.wBytesPerInterval); + case USB_SPEED_HIGH: + psize = usb_endpoint_maxp(&ep->desc); + return (psize & 0x07ff) * (1 + ((psize >> 11) & 3)); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_firedtv_handle_fcp.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_firedtv_handle_fcp.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_firedtv_handle_fcp.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_firedtv_handle_fcp.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,19 @@ +--- + drivers/media/firewire/firedtv-fw.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- linux.orig/drivers/media/firewire/firedtv-fw.c ++++ linux/drivers/media/firewire/firedtv-fw.c +@@ -192,9 +192,9 @@ void fdtv_stop_iso(struct firedtv *fdtv) + } + + static void handle_fcp(struct fw_card *card, struct fw_request *request, +- int tcode, int destination, int source, int generation, +- unsigned long long offset, void *payload, size_t length, +- void *callback_data) ++ int tcode, int destination, int source, int generation, ++ int speed, unsigned long long offset, ++ void *payload, size_t length, void *callback_data) + { + struct firedtv *f, *fdtv = NULL; + struct fw_device *device; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_i2c_new_probed_device.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_i2c_new_probed_device.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_i2c_new_probed_device.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_i2c_new_probed_device.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,94 @@ +diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c +index f368213..c4069f2 100644 +--- a/drivers/media/pci/bt8xx/bttv-input.c ++++ b/drivers/media/pci/bt8xx/bttv-input.c +@@ -405,7 +405,7 @@ void init_bttv_i2c_ir(struct bttv *btv) + * internal. + * That's why we probe 0x1a (~0x34) first. CB + */ +- i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); ++ i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); + } + if (NULL == i2c_dev) + return; +diff --git a/drivers/media/pci/cx18/cx18-i2c.c b/drivers/media/pci/cx18/cx18-i2c.c +index 4af8cd6..0747788 100644 +--- a/drivers/media/pci/cx18/cx18-i2c.c ++++ b/drivers/media/pci/cx18/cx18-i2c.c +@@ -104,7 +104,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw, + break; + } + +- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ? ++ return i2c_new_probed_device(adap, &info, addr_list) == NULL ? + -1 : 0; + } + +diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c +index 4887314..8551b42 100644 +--- a/drivers/media/pci/cx23885/cx23885-i2c.c ++++ b/drivers/media/pci/cx23885/cx23885-i2c.c +@@ -339,7 +339,8 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) + } else + printk(KERN_WARNING "%s: i2c bus %d register FAILED\n", + dev->name, bus->nr); +- ++#if 0 ++ /* This probe function won't work on older devices */ + /* Instantiate the IR receiver device, if present */ + if (0 == bus->i2c_rc) { + struct i2c_board_info info; +@@ -354,7 +355,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) + i2c_new_probed_device(&bus->i2c_adap, &info, addr_list, + i2c_probe_func_quick_read); + } +- ++#endif + return bus->i2c_rc; + } + +diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c +index ceed2d8..11a94d1 100644 +--- a/drivers/media/pci/ivtv/ivtv-i2c.c ++++ b/drivers/media/pci/ivtv/ivtv-i2c.c +@@ -186,7 +186,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) + return -1; + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, type, I2C_NAME_SIZE); +- return i2c_new_probed_device(adap, &info, addr_list, NULL) ++ return i2c_new_probed_device(adap, &info, addr_list) + == NULL ? -1 : 0; + } + +@@ -230,7 +230,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) + info.platform_data = init_data; + strlcpy(info.type, type, I2C_NAME_SIZE); + +- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ? ++ return i2c_new_probed_device(adap, &info, addr_list) == NULL ? + -1 : 0; + } + +@@ -257,7 +257,7 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv) + + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, "ir_video", I2C_NAME_SIZE); +- return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list, NULL); ++ return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list); + } + + int ivtv_i2c_register(struct ivtv *itv, unsigned idx) +diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c +index aa044f4..d971158 100644 +--- a/drivers/media/v4l2-core/v4l2-common.c ++++ b/drivers/media/v4l2-core/v4l2-common.c +@@ -318,8 +318,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, + + /* Create the i2c client */ + if (info->addr == 0 && probe_addrs) +- client = i2c_new_probed_device(adapter, info, probe_addrs, +- NULL); ++ client = i2c_new_probed_device(adapter, info, probe_addrs); + else + client = i2c_new_device(adapter, info); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_kfifo.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_kfifo.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_kfifo.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_kfifo.patch 2018-02-04 13:15:13.000000000 +0000 @@ -0,0 +1,18 @@ +--- + drivers/media/rc/rc-core-priv.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h +index 96f0a8b..b72f858 100644 +--- a/drivers/media/rc/rc-core-priv.h ++++ b/drivers/media/rc/rc-core-priv.h +@@ -39,7 +39,7 @@ + struct list_head list; /* to keep track of raw clients */ + struct task_struct *thread; + /* fifo for the pulse/space durations */ +- DECLARE_KFIFO(kfifo, struct ir_raw_event, MAX_IR_EVENT_SIZE); ++ struct kfifo kfifo; + ktime_t last_event; /* when last event occurred */ + struct rc_dev *dev; /* pointer to the parent rc_dev */ + /* edge driver */ + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_work_handler.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_work_handler.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.35_work_handler.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.35_work_handler.patch 2018-02-04 13:15:13.000000000 +0000 @@ -0,0 +1,149 @@ +diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c +index c08ae3e..2e453ff 100644 +--- a/drivers/media/pci/ivtv/ivtv-driver.c ++++ b/drivers/media/pci/ivtv/ivtv-driver.c +@@ -737,8 +737,6 @@ done: + */ + static int ivtv_init_struct1(struct ivtv *itv) + { +- struct sched_param param = { .sched_priority = 99 }; +- + itv->base_addr = pci_resource_start(itv->pdev, 0); + itv->enc_mbox.max_mbox = 2; /* the encoder has 3 mailboxes (0-2) */ + itv->dec_mbox.max_mbox = 1; /* the decoder has 2 mailboxes (0-1) */ +@@ -750,17 +748,12 @@ static int ivtv_init_struct1(struct ivtv *itv) + spin_lock_init(&itv->lock); + spin_lock_init(&itv->dma_reg_lock); + +- kthread_init_worker(&itv->irq_worker); +- itv->irq_worker_task = kthread_run(kthread_worker_fn, &itv->irq_worker, +- "%s", itv->v4l2_dev.name); +- if (IS_ERR(itv->irq_worker_task)) { +- IVTV_ERR("Could not create ivtv task\n"); ++ itv->irq_work_queues = create_singlethread_workqueue(itv->v4l2_dev.name); ++ if (itv->irq_work_queues == NULL) { ++ IVTV_ERR("Could not create ivtv workqueue\n"); + return -1; + } +- /* must use the FIFO scheduler as it is realtime sensitive */ +- sched_setscheduler(itv->irq_worker_task, SCHED_FIFO, ¶m); +- +- kthread_init_work(&itv->irq_work, ivtv_irq_work_handler); ++ INIT_WORK(&itv->irq_work_queue, ivtv_irq_work_handler); + + /* Initial settings */ + itv->cxhdl.port = CX2341X_PORT_MEMORY; +@@ -1037,7 +1030,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) + /* PCI Device Setup */ + retval = ivtv_setup_pci(itv, pdev, pci_id); + if (retval == -EIO) +- goto free_worker; ++ goto free_workqueue; + if (retval == -ENXIO) + goto free_mem; + +@@ -1297,8 +1290,8 @@ free_mem: + release_mem_region(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); + if (itv->has_cx23415) + release_mem_region(itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); +-free_worker: +- kthread_stop(itv->irq_worker_task); ++free_workqueue: ++ destroy_workqueue(itv->irq_work_queues); + err: + if (retval == 0) + retval = -ENODEV; +@@ -1440,9 +1433,9 @@ static void ivtv_remove(struct pci_dev *pdev) + ivtv_set_irq_mask(itv, 0xffffffff); + del_timer_sync(&itv->dma_timer); + +- /* Kill irq worker */ +- kthread_flush_worker(&itv->irq_worker); +- kthread_stop(itv->irq_worker_task); ++ /* Stop all Work Queues */ ++ flush_workqueue(itv->irq_work_queues); ++ destroy_workqueue(itv->irq_work_queues); + + ivtv_streams_cleanup(itv, 1); + ivtv_udma_free(itv); +diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h +index bc309f42c..6c0fa73 100644 +--- a/drivers/media/pci/ivtv/ivtv-driver.h ++++ b/drivers/media/pci/ivtv/ivtv-driver.h +@@ -50,7 +50,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -260,6 +260,7 @@ struct ivtv_mailbox_data { + #define IVTV_F_I_INITED 21 /* set after first open */ + #define IVTV_F_I_FAILED 22 /* set if first open failed */ + #define IVTV_F_I_WORK_HANDLER_PCM 23 /* there is work to be done for PCM */ ++#define IVTV_F_I_WORK_INITED 24 /* worker thread was initialized */ + + /* Event notifications */ + #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ +@@ -681,9 +682,8 @@ struct ivtv { + /* Interrupts & DMA */ + u32 irqmask; /* active interrupts */ + u32 irq_rr_idx; /* round-robin stream index */ +- struct kthread_worker irq_worker; /* kthread worker for PIO/YUV/VBI actions */ +- struct task_struct *irq_worker_task; /* task for irq_worker */ +- struct kthread_work irq_work; /* kthread work entry */ ++ struct workqueue_struct *irq_work_queues; /* workqueue for PIO/YUV/VBI actions */ ++ struct work_struct irq_work_queue; /* work entry */ + spinlock_t dma_reg_lock; /* lock access to DMA engine registers */ + int cur_dma_stream; /* index of current stream doing DMA (-1 if none) */ + int cur_pio_stream; /* index of current stream doing PIO (-1 if none) */ +diff --git a/drivers/media/pci/ivtv/ivtv-irq.c b/drivers/media/pci/ivtv/ivtv-irq.c +index 19a7c9b..ed51a8b 100644 +--- a/drivers/media/pci/ivtv/ivtv-irq.c ++++ b/drivers/media/pci/ivtv/ivtv-irq.c +@@ -99,10 +99,19 @@ static void ivtv_pio_work_handler(struct ivtv *itv) + write_reg(IVTV_IRQ_ENC_PIO_COMPLETE, 0x44); + } + +-void ivtv_irq_work_handler(struct kthread_work *work) ++void ivtv_irq_work_handler(struct work_struct *work) + { +- struct ivtv *itv = container_of(work, struct ivtv, irq_work); ++ struct ivtv *itv = container_of(work, struct ivtv, irq_work_queue); + ++ DEFINE_WAIT(wait); ++ ++ if (test_and_clear_bit(IVTV_F_I_WORK_INITED, &itv->i_flags)) { ++ struct sched_param param = { .sched_priority = 99 }; ++ ++ /* This thread must use the FIFO scheduler as it ++ is realtime sensitive. */ ++ sched_setscheduler(current, SCHED_FIFO, ¶m); ++ } + if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) + ivtv_pio_work_handler(itv); + +@@ -1060,7 +1069,7 @@ irqreturn_t ivtv_irq_handler(int irq, void *dev_id) + } + + if (test_and_clear_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags)) { +- kthread_queue_work(&itv->irq_worker, &itv->irq_work); ++ queue_work(itv->irq_work_queues, &itv->irq_work_queue); + } + + spin_unlock(&itv->dma_reg_lock); +diff --git a/drivers/media/pci/ivtv/ivtv-irq.h b/drivers/media/pci/ivtv/ivtv-irq.h +index 1e84433..f879a58 100644 +--- a/drivers/media/pci/ivtv/ivtv-irq.h ++++ b/drivers/media/pci/ivtv/ivtv-irq.h +@@ -46,7 +46,7 @@ + + irqreturn_t ivtv_irq_handler(int irq, void *dev_id); + +-void ivtv_irq_work_handler(struct kthread_work *work); ++void ivtv_irq_work_handler(struct work_struct *work); + void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock); + void ivtv_unfinished_dma(unsigned long arg); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_dvb_usb_input_getkeycode.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_dvb_usb_input_getkeycode.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_dvb_usb_input_getkeycode.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_dvb_usb_input_getkeycode.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,145 @@ +--- + drivers/media/usb/dvb-usb/dvb-usb-remote.c | 111 ++++++++++------------------- + 1 file changed, 42 insertions(+), 69 deletions(-) + +--- linux.orig/drivers/media/usb/dvb-usb/dvb-usb-remote.c ++++ linux/drivers/media/usb/dvb-usb/dvb-usb-remote.c +@@ -8,71 +8,60 @@ + #include "dvb-usb-common.h" + #include + +-static unsigned int +-legacy_dvb_usb_get_keymap_index(const struct input_keymap_entry *ke, +- struct rc_map_table *keymap, +- unsigned int keymap_size) +-{ +- unsigned int index; +- unsigned int scancode; +- +- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { +- index = ke->index; +- } else { +- if (input_scancode_to_scalar(ke, &scancode)) +- return keymap_size; +- +- /* See if we can match the raw key code. */ +- for (index = 0; index < keymap_size; index++) +- if (keymap[index].scancode == scancode) +- break; +- +- /* See if there is an unused hole in the map */ +- if (index >= keymap_size) { +- for (index = 0; index < keymap_size; index++) { +- if (keymap[index].keycode == KEY_RESERVED || +- keymap[index].keycode == KEY_UNKNOWN) { +- break; +- } +- } +- } +- } +- +- return index; +-} +- + static int legacy_dvb_usb_getkeycode(struct input_dev *dev, +- struct input_keymap_entry *ke) ++ unsigned int scancode, unsigned int *keycode) + { + struct dvb_usb_device *d = input_get_drvdata(dev); ++ + struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; +- unsigned int keymap_size = d->props.rc.legacy.rc_map_size; +- unsigned int index; ++ int i; + +- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size); +- if (index >= keymap_size) +- return -EINVAL; +- +- ke->keycode = keymap[index].keycode; +- if (ke->keycode == KEY_UNKNOWN) +- ke->keycode = KEY_RESERVED; +- ke->len = sizeof(keymap[index].scancode); +- memcpy(&ke->scancode, &keymap[index].scancode, ke->len); +- ke->index = index; ++ /* See if we can match the raw key code. */ ++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) ++ if (keymap[i].scancode == scancode) { ++ *keycode = keymap[i].keycode; ++ return 0; ++ } + +- return 0; ++ /* ++ * If is there extra space, returns KEY_RESERVED, ++ * otherwise, input core won't let legacy_dvb_usb_setkeycode ++ * to work ++ */ ++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) ++ if (keymap[i].keycode == KEY_RESERVED || ++ keymap[i].keycode == KEY_UNKNOWN) { ++ *keycode = KEY_RESERVED; ++ return 0; ++ } ++ ++ return -EINVAL; + } + + static int legacy_dvb_usb_setkeycode(struct input_dev *dev, +- const struct input_keymap_entry *ke, +- unsigned int *old_keycode) ++ unsigned int scancode, unsigned int keycode) + { + struct dvb_usb_device *d = input_get_drvdata(dev); ++ + struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; +- unsigned int keymap_size = d->props.rc.legacy.rc_map_size; +- unsigned int index; ++ int i; ++ ++ /* Search if it is replacing an existing keycode */ ++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) ++ if (keymap[i].scancode == scancode) { ++ keymap[i].keycode = keycode; ++ return 0; ++ } ++ ++ /* Search if is there a clean entry. If so, use it */ ++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) ++ if (keymap[i].keycode == KEY_RESERVED || ++ keymap[i].keycode == KEY_UNKNOWN) { ++ keymap[i].scancode = scancode; ++ keymap[i].keycode = keycode; ++ return 0; ++ } + +- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size); + /* + * FIXME: Currently, it is not possible to increase the size of + * scancode table. For it to happen, one possibility +@@ -80,24 +69,8 @@ static int legacy_dvb_usb_setkeycode(str + * copying data, appending the new key on it, and freeing + * the old one - or maybe just allocating some spare space + */ +- if (index >= keymap_size) +- return -EINVAL; + +- *old_keycode = keymap[index].keycode; +- keymap->keycode = ke->keycode; +- __set_bit(ke->keycode, dev->keybit); +- +- if (*old_keycode != KEY_RESERVED) { +- __clear_bit(*old_keycode, dev->keybit); +- for (index = 0; index < keymap_size; index++) { +- if (keymap[index].keycode == *old_keycode) { +- __set_bit(*old_keycode, dev->keybit); +- break; +- } +- } +- } +- +- return 0; ++ return -EINVAL; + } + + /* Remote-control poll function - called every dib->rc_query_interval ms to see diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_fence.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_fence.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_fence.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_fence.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h +index d174585..6f60f55 100644 +--- a/include/linux/dma-fence.h ++++ b/include/linux/dma-fence.h +@@ -27,7 +27,6 @@ + #include + #include + #include +-#include + #include + + struct fence; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_input_getkeycode.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_input_getkeycode.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_input_getkeycode.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_input_getkeycode.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,109 @@ +--- + drivers/media/rc/rc-main.c | 69 ++++++++++----------------------------------- + 1 file changed, 16 insertions(+), 53 deletions(-) + +--- linux.orig/drivers/media/rc/rc-main.c ++++ linux/drivers/media/rc/rc-main.c +@@ -318,37 +318,23 @@ static unsigned int ir_establish_scancod + * This routine is used to handle evdev EVIOCSKEY ioctl. + */ + static int ir_setkeycode(struct input_dev *idev, +- const struct input_keymap_entry *ke, +- unsigned int *old_keycode) ++ unsigned int scancode, unsigned int keycode) + { + struct rc_dev *rdev = input_get_drvdata(idev); + struct rc_map *rc_map = &rdev->rc_map; + unsigned int index; +- unsigned int scancode; + int retval = 0; + unsigned long flags; + + spin_lock_irqsave(&rc_map->lock, flags); + +- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { +- index = ke->index; +- if (index >= rc_map->len) { +- retval = -EINVAL; +- goto out; +- } +- } else { +- retval = input_scancode_to_scalar(ke, &scancode); +- if (retval) +- goto out; +- +- index = ir_establish_scancode(rdev, rc_map, scancode, true); +- if (index >= rc_map->len) { +- retval = -ENOMEM; +- goto out; +- } ++ index = ir_establish_scancode(rdev, rc_map, scancode, true); ++ if (index >= rc_map->len) { ++ retval = -ENOMEM; ++ goto out; + } + +- *old_keycode = ir_update_mapping(rdev, rc_map, index, ke->keycode); ++ ir_update_mapping(rdev, rc_map, index, keycode); + + out: + spin_unlock_irqrestore(&rc_map->lock, flags); +@@ -436,48 +422,25 @@ static unsigned int ir_lookup_by_scancod + * This routine is used to handle evdev EVIOCGKEY ioctl. + */ + static int ir_getkeycode(struct input_dev *idev, +- struct input_keymap_entry *ke) ++ unsigned int scancode, unsigned int *keycode) + { + struct rc_dev *rdev = input_get_drvdata(idev); + struct rc_map *rc_map = &rdev->rc_map; +- struct rc_map_table *entry; + unsigned long flags; + unsigned int index; +- unsigned int scancode; + int retval; + + spin_lock_irqsave(&rc_map->lock, flags); + +- if (ke->flags & INPUT_KEYMAP_BY_INDEX) { +- index = ke->index; +- } else { +- retval = input_scancode_to_scalar(ke, &scancode); +- if (retval) +- goto out; +- +- index = ir_lookup_by_scancode(rc_map, scancode); +- } +- +- if (index < rc_map->len) { +- entry = &rc_map->scan[index]; +- +- ke->index = index; +- ke->keycode = entry->keycode; +- ke->len = sizeof(entry->scancode); +- memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); +- +- } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { +- /* +- * We do not really know the valid range of scancodes +- * so let's respond with KEY_RESERVED to anything we +- * do not have mapping for [yet]. +- */ +- ke->index = index; +- ke->keycode = KEY_RESERVED; +- } else { +- retval = -EINVAL; +- goto out; +- } ++ index = ir_lookup_by_scancode(rc_map, scancode); ++ ++ if (index >= rc_map->len) { ++ *keycode = KEY_RESERVED; ++ retval = 0; ++ goto out; ++ } ++ ++ *keycode = rc_map->scan[index].keycode; + + retval = 0; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_kmap_atomic.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_kmap_atomic.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.36_kmap_atomic.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.36_kmap_atomic.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,16 @@ +diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c +index 7338cb2..69cc816 100644 +--- a/drivers/media/pci/ivtv/ivtv-udma.c ++++ b/drivers/media/pci/ivtv/ivtv-udma.c +@@ -57,9 +57,9 @@ int ivtv_udma_fill_sg_list (struct ivtv_user_dma *dma, struct ivtv_dma_page_info + if (dma->bouncemap[map_offset] == NULL) + return -1; + local_irq_save(flags); +- src = kmap_atomic(dma->map[map_offset]) + offset; ++ src = kmap_atomic(dma->map[map_offset], KM_BOUNCE_READ) + offset; + memcpy(page_address(dma->bouncemap[map_offset]) + offset, src, len); +- kunmap_atomic(src); ++ kunmap_atomic(src, KM_BOUNCE_READ); + local_irq_restore(flags); + sg_set_page(&dma->SGlist[map_offset], dma->bouncemap[map_offset], len, offset); + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.37_dont_use_alloc_ordered_workqueue.patch 2018-02-04 13:15:13.000000000 +0000 @@ -0,0 +1,94 @@ +diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c +index 004d8ac..6508785 100644 +--- a/drivers/media/pci/cx18/cx18-driver.c ++++ b/drivers/media/pci/cx18/cx18-driver.c +@@ -697,7 +697,7 @@ static int cx18_create_in_workq(struct cx18 *cx) + { + snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", + cx->v4l2_dev.name); +- cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0); ++ cx->in_work_queue = create_singlethread_workqueue(cx->in_workq_name); + if (!cx->in_work_queue) { + CX18_ERR("Unable to create incoming mailbox handler thread\n"); + return -ENOMEM; +@@ -703,6 +703,18 @@ static int cx18_create_in_workq(struct cx18 *cx) + return 0; + } + ++static int cx18_create_out_workq(struct cx18 *cx) ++{ ++ snprintf(cx->out_workq_name, sizeof(cx->out_workq_name), "%s-out", ++ cx->v4l2_dev.name); ++ cx->out_work_queue = create_workqueue(cx->out_workq_name); ++ if (cx->out_work_queue == NULL) { ++ CX18_ERR("Unable to create outgoing mailbox handler threads\n"); ++ return -ENOMEM; ++ } ++ return 0; ++} ++ + static void cx18_init_in_work_orders(struct cx18 *cx) + { + int i; +@@ -729,10 +741,16 @@ static int cx18_init_struct1(struct cx18 *cx) + mutex_init(&cx->epu2apu_mb_lock); + mutex_init(&cx->epu2cpu_mb_lock); + +- ret = cx18_create_in_workq(cx); ++ ret = cx18_create_out_workq(cx); + if (ret) + return ret; + ++ ret = cx18_create_in_workq(cx); ++ if (ret) { ++ destroy_workqueue(cx->out_work_queue); ++ return ret; ++ } ++ + cx18_init_in_work_orders(cx); + + /* start counting open_id at 1 */ +@@ -1138,6 +1156,7 @@ free_mem: + release_mem_region(cx->base_addr, CX18_MEM_SIZE); + free_workqueues: + destroy_workqueue(cx->in_work_queue); ++ destroy_workqueue(cx->out_work_queue); + err: + if (retval == 0) + retval = -ENODEV; +@@ -1291,6 +1310,7 @@ static void cx18_remove(struct pci_dev *pci_dev) + cx18_halt_firmware(cx); + + destroy_workqueue(cx->in_work_queue); ++ destroy_workqueue(cx->out_work_queue); + + cx18_streams_cleanup(cx, 1); + +diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h +index 2767c64..30404fa 100644 +--- a/drivers/media/pci/cx18/cx18-driver.h ++++ b/drivers/media/pci/cx18/cx18-driver.h +@@ -647,6 +647,9 @@ struct cx18 { + struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS]; + char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */ + ++ struct workqueue_struct *out_work_queue; ++ char out_workq_name[12]; /* "cx18-NN-out" */ ++ + /* i2c */ + struct i2c_adapter i2c_adap[2]; + struct i2c_algo_bit_data i2c_algo[2]; +diff --git a/drivers/media/pci/cx18/cx18-streams.h b/drivers/media/pci/cx18/cx18-streams.h +index 713b0e6..51765eb 100644 +--- a/drivers/media/pci/cx18/cx18-streams.h ++++ b/drivers/media/pci/cx18/cx18-streams.h +@@ -42,7 +42,8 @@ static inline bool cx18_stream_enabled(struct cx18_stream *s) + /* Related to submission of mdls to firmware */ + static inline void cx18_stream_load_fw_queue(struct cx18_stream *s) + { +- schedule_work(&s->out_work_order); ++ struct cx18 *cx = s->cx; ++ queue_work(cx->out_work_queue, &s->out_work_order); + } + + static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.38_config_of_for_of_node.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.38_config_of_for_of_node.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.38_config_of_for_of_node.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.38_config_of_for_of_node.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,30 @@ +diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c +index 9ed59da..2efb88a 100644 +--- a/drivers/media/v4l2-core/v4l2-device.c ++++ b/drivers/media/v4l2-core/v4l2-device.c +@@ -130,8 +130,11 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) + * registered by us, and would not be + * re-created by just probing the V4L2 driver. + */ +- if (client && +- !client->dev.of_node) ++#ifdef CONFIG_OF ++ if (client && !client->dev.of_node) ++#else ++ if (client) ++#endif + i2c_unregister_device(client); + continue; + } +@@ -140,7 +143,11 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) + if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) { + struct spi_device *spi = v4l2_get_subdevdata(sd); + ++#ifdef CONFIG_OF + if (spi && !spi->dev.of_node) ++#else ++ if (spi) ++#endif + spi_unregister_device(spi); + continue; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.38_use_getkeycode_new_setkeycode_new.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,30 @@ +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index 2424946..bcede3b 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -1591,8 +1591,8 @@ struct rc_dev *rc_allocate_device(enum rc_driver_type type) + return NULL; + } + +- dev->input_dev->getkeycode = ir_getkeycode; +- dev->input_dev->setkeycode = ir_setkeycode; ++ dev->input_dev->getkeycode_new = ir_getkeycode; ++ dev->input_dev->setkeycode_new = ir_setkeycode; + input_set_drvdata(dev->input_dev, dev); + + setup_timer(&dev->timer_keyup, ir_timer_keyup, +diff --git a/drivers/media/usb/dvb-usb/dvb-usb-remote.c b/drivers/media/usb/dvb-usb/dvb-usb-remote.c +index 059ded5..6bf4dd0 100644 +--- a/drivers/media/usb/dvb-usb/dvb-usb-remote.c ++++ b/drivers/media/usb/dvb-usb/dvb-usb-remote.c +@@ -198,8 +198,8 @@ static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d) + d->input_dev = input_dev; + d->rc_dev = NULL; + +- input_dev->getkeycode = legacy_dvb_usb_getkeycode; +- input_dev->setkeycode = legacy_dvb_usb_setkeycode; ++ input_dev->getkeycode_new = legacy_dvb_usb_getkeycode; ++ input_dev->setkeycode_new = legacy_dvb_usb_setkeycode; + + /* set the bits for the keys */ + deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.39_const_rc_main.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.39_const_rc_main.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6.39_const_rc_main.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6.39_const_rc_main.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index 1040f2f..593949c 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -1623,7 +1623,7 @@ static const struct attribute_group rc_dev_wakeup_filter_attr_grp = { + .attrs = rc_dev_wakeup_filter_attrs, + }; + +-static const struct device_type rc_dev_type = { ++static struct device_type rc_dev_type = { + .release = rc_dev_release, + .uevent = rc_dev_uevent, + }; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v2.6_rc_main_bsearch_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v2.6_rc_main_bsearch_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v2.6_rc_main_bsearch_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v2.6_rc_main_bsearch_h.patch 2018-02-04 13:15:13.000000000 +0000 @@ -0,0 +1,10 @@ +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -16,7 +16,6 @@ + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +-#include + #include + #include + #include diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.0_ida2bit.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.0_ida2bit.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.0_ida2bit.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.0_ida2bit.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,65 @@ +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index a9eba0013525..1594060806b5 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -20,11 +20,14 @@ + #include + #include + #include +-#include + #include + #include + #include "rc-core-priv.h" + ++/* Bitmap to store allocated device numbers from 0 to IRRCV_NUM_DEVICES - 1 */ ++#define IRRCV_NUM_DEVICES 256 ++static DECLARE_BITMAP(ir_core_dev_number, IRRCV_NUM_DEVICES); ++ + /* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */ + #define IR_TAB_MIN_SIZE 256 + #define IR_TAB_MAX_SIZE 8192 +@@ -38,9 +41,6 @@ static LIST_HEAD(rc_map_list); + static DEFINE_SPINLOCK(rc_map_lock); + static struct led_trigger *led_feedback; + +-/* Used to keep track of rc devices */ +-static DEFINE_IDA(rc_ida); +- + static struct rc_map_list *seek_rc_map(const char *name) + { + struct rc_map_list *map = NULL; +@@ -1723,9 +1723,13 @@ int rc_register_device(struct rc_dev *dev) + if (!dev) + return -EINVAL; + +- minor = ida_simple_get(&rc_ida, 0, RC_DEV_MAX, GFP_KERNEL); +- if (minor < 0) +- return minor; ++ do { ++ minor = find_first_zero_bit(ir_core_dev_number, ++ IRRCV_NUM_DEVICES); ++ /* No free device slots */ ++ if (minor >= IRRCV_NUM_DEVICES) ++ return -ENOMEM; ++ } while (test_and_set_bit(minor, ir_core_dev_number)); + + dev->minor = minor; + dev_set_name(&dev->dev, "rc%u", dev->minor); +@@ -1790,7 +1794,7 @@ int rc_register_device(struct rc_dev *dev) + out_raw: + ir_raw_event_free(dev); + out_minor: +- ida_simple_remove(&rc_ida, minor); ++ clear_bit(dev->minor, ir_core_dev_number); + return rc; + } + EXPORT_SYMBOL_GPL(rc_register_device); +@@ -1836,7 +1840,7 @@ void rc_unregister_device(struct rc_dev *dev) + + device_del(&dev->dev); + +- ida_simple_remove(&rc_ida, dev->minor); ++ clear_bit(dev->minor, ir_core_dev_number); + + if (!dev->managed_alloc) + rc_free_device(dev); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.0_remove_ida_lird_dev.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.0_remove_ida_lird_dev.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.0_remove_ida_lird_dev.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.0_remove_ida_lird_dev.patch 2018-02-04 13:19:24.000000000 +0000 @@ -0,0 +1,83 @@ +diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c +index 42e7831a77e9..207c50d0325c 100644 +--- a/drivers/media/rc/lirc_dev.c ++++ b/drivers/media/rc/lirc_dev.c +@@ -21,7 +21,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -33,8 +32,10 @@ + + static dev_t lirc_base_dev; + +-/* Used to keep track of allocated lirc devices */ +-static DEFINE_IDA(lirc_ida); ++/* This mutex protects the irctls array */ ++static DEFINE_MUTEX(lirc_dev_lock); ++ ++static struct rc_dev *irctls[RC_DEV_MAX]; + + /* Only used for sysfs but defined to void otherwise */ + static struct class *lirc_class; +@@ -734,6 +735,10 @@ static void lirc_release_device(struct device *ld) + { + struct rc_dev *rcdev = container_of(ld, struct rc_dev, lirc_dev); + ++ mutex_lock(&lirc_dev_lock); ++ irctls[MINOR(rcdev->lirc_dev.devt)] = NULL; ++ mutex_unlock(&lirc_dev_lock); ++ + put_device(&rcdev->dev); + } + +@@ -741,9 +746,20 @@ int ir_lirc_register(struct rc_dev *dev) + { + int err, minor; + +- minor = ida_simple_get(&lirc_ida, 0, RC_DEV_MAX, GFP_KERNEL); +- if (minor < 0) +- return minor; ++ mutex_lock(&lirc_dev_lock); ++ ++ /* find first free slot for driver */ ++ for (minor = 0; minor < RC_DEV_MAX; minor++) ++ if (!irctls[minor]) ++ break; ++ ++ if (minor == RC_DEV_MAX) { ++ dev_err(&dev->dev, "no free slots for drivers!\n"); ++ mutex_unlock(&lirc_dev_lock); ++ return -ENOMEM; ++ } ++ irctls[minor] = dev; ++ mutex_unlock(&lirc_dev_lock); + + device_initialize(&dev->lirc_dev); + dev->lirc_dev.class = lirc_class; +@@ -769,7 +785,10 @@ int ir_lirc_register(struct rc_dev *dev) + return 0; + + out_ida: +- ida_simple_remove(&lirc_ida, minor); ++ mutex_lock(&lirc_dev_lock); ++ irctls[minor] = NULL; ++ mutex_unlock(&lirc_dev_lock); ++ + return err; + } + +@@ -787,7 +806,9 @@ void ir_lirc_unregister(struct rc_dev *dev) + spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); + + cdev_device_del(&dev->lirc_cdev, &dev->lirc_dev); +- ida_simple_remove(&lirc_ida, MINOR(dev->lirc_dev.devt)); ++ mutex_lock(&lirc_dev_lock); ++ irctls[MINOR(dev->lirc_dev.devt)] = NULL; ++ mutex_unlock(&lirc_dev_lock); + } + + int __init lirc_dev_init(void) diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_const_snd_pcm_ops.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_const_snd_pcm_ops.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_const_snd_pcm_ops.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_const_snd_pcm_ops.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,169 @@ +diff --git a/drivers/media/pci/cx18/cx18-alsa-pcm.c b/drivers/media/pci/cx18/cx18-alsa-pcm.c +index 4f31042..c40558c 100644 +--- a/drivers/media/pci/cx18/cx18-alsa-pcm.c ++++ b/drivers/media/pci/cx18/cx18-alsa-pcm.c +@@ -308,7 +308,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, + return vmalloc_to_page(pageptr); + } + +-static const struct snd_pcm_ops snd_cx18_pcm_capture_ops = { ++static struct snd_pcm_ops snd_cx18_pcm_capture_ops = { + .open = snd_cx18_pcm_capture_open, + .close = snd_cx18_pcm_capture_close, + .ioctl = snd_cx18_pcm_ioctl, +diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c +index 20b3cb1..07f0734 100644 +--- a/drivers/media/pci/cx23885/cx23885-alsa.c ++++ b/drivers/media/pci/cx23885/cx23885-alsa.c +@@ -501,7 +501,7 @@ static struct page *snd_cx23885_page(struct snd_pcm_substream *substream, + /* + * operators + */ +-static const struct snd_pcm_ops snd_cx23885_pcm_ops = { ++static struct snd_pcm_ops snd_cx23885_pcm_ops = { + .open = snd_cx23885_pcm_open, + .close = snd_cx23885_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c +index 42ba764..f2684ee 100644 +--- a/drivers/media/pci/cx25821/cx25821-alsa.c ++++ b/drivers/media/pci/cx25821/cx25821-alsa.c +@@ -646,7 +646,7 @@ static struct page *snd_cx25821_page(struct snd_pcm_substream *substream, + /* + * operators + */ +-static const struct snd_pcm_ops snd_cx25821_pcm_ops = { ++static struct snd_pcm_ops snd_cx25821_pcm_ops = { + .open = snd_cx25821_pcm_open, + .close = snd_cx25821_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c +index ab09bb5..e6ccf0c 100644 +--- a/drivers/media/pci/cx88/cx88-alsa.c ++++ b/drivers/media/pci/cx88/cx88-alsa.c +@@ -591,7 +591,7 @@ static struct page *snd_cx88_page(struct snd_pcm_substream *substream, + /* + * operators + */ +-static const struct snd_pcm_ops snd_cx88_pcm_ops = { ++static struct snd_pcm_ops snd_cx88_pcm_ops = { + .open = snd_cx88_pcm_open, + .close = snd_cx88_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c +index 5326d86..dc59e47 100644 +--- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c ++++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c +@@ -313,7 +313,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, + return vmalloc_to_page(pageptr); + } + +-static const struct snd_pcm_ops snd_ivtv_pcm_capture_ops = { ++static struct snd_pcm_ops snd_ivtv_pcm_capture_ops = { + .open = snd_ivtv_pcm_capture_open, + .close = snd_ivtv_pcm_capture_close, + .ioctl = snd_ivtv_pcm_ioctl, +diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c +index 7231144..4a5508d 100644 +--- a/drivers/media/pci/saa7134/saa7134-alsa.c ++++ b/drivers/media/pci/saa7134/saa7134-alsa.c +@@ -871,7 +871,7 @@ static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream, + * ALSA capture callbacks definition + */ + +-static const struct snd_pcm_ops snd_card_saa7134_capture_ops = { ++static struct snd_pcm_ops snd_card_saa7134_capture_ops = { + .open = snd_card_saa7134_capture_open, + .close = snd_card_saa7134_capture_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/pci/tw686x/tw686x-audio.c b/drivers/media/pci/tw686x/tw686x-audio.c +index 7719076..96e444c 100644 +--- a/drivers/media/pci/tw686x/tw686x-audio.c ++++ b/drivers/media/pci/tw686x/tw686x-audio.c +@@ -269,7 +269,7 @@ static snd_pcm_uframes_t tw686x_pcm_pointer(struct snd_pcm_substream *ss) + return bytes_to_frames(ss->runtime, ac->ptr); + } + +-static const struct snd_pcm_ops tw686x_pcm_ops = { ++static struct snd_pcm_ops tw686x_pcm_ops = { + .open = tw686x_pcm_open, + .close = tw686x_pcm_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c +index d96236d..92a573e 100644 +--- a/drivers/media/usb/cx231xx/cx231xx-audio.c ++++ b/drivers/media/usb/cx231xx/cx231xx-audio.c +@@ -631,7 +631,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, + return vmalloc_to_page(pageptr); + } + +-static const struct snd_pcm_ops snd_cx231xx_pcm_capture = { ++static struct snd_pcm_ops snd_cx231xx_pcm_capture = { + .open = snd_cx231xx_capture_open, + .close = snd_cx231xx_pcm_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c +index 8e799ae..535d7f7 100644 +--- a/drivers/media/usb/em28xx/em28xx-audio.c ++++ b/drivers/media/usb/em28xx/em28xx-audio.c +@@ -705,7 +705,7 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev, + /* + * register/unregister code and data + */ +-static const struct snd_pcm_ops snd_em28xx_pcm_capture = { ++static struct snd_pcm_ops snd_em28xx_pcm_capture = { + .open = snd_em28xx_capture_open, + .close = snd_em28xx_pcm_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/usb/go7007/snd-go7007.c b/drivers/media/usb/go7007/snd-go7007.c +index f84a213..8e4006ff 100644 +--- a/drivers/media/usb/go7007/snd-go7007.c ++++ b/drivers/media/usb/go7007/snd-go7007.c +@@ -198,7 +198,7 @@ static struct page *go7007_snd_pcm_page(struct snd_pcm_substream *substream, + return vmalloc_to_page(substream->runtime->dma_area + offset); + } + +-static const struct snd_pcm_ops go7007_snd_capture_ops = { ++static struct snd_pcm_ops go7007_snd_capture_ops = { + .open = go7007_snd_capture_open, + .close = go7007_snd_capture_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/usb/tm6000/tm6000-alsa.c b/drivers/media/usb/tm6000/tm6000-alsa.c +index f18cffae..153732f 100644 +--- a/drivers/media/usb/tm6000/tm6000-alsa.c ++++ b/drivers/media/usb/tm6000/tm6000-alsa.c +@@ -380,7 +380,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, + /* + * operators + */ +-static const struct snd_pcm_ops snd_tm6000_pcm_ops = { ++static struct snd_pcm_ops snd_tm6000_pcm_ops = { + .open = snd_tm6000_pcm_open, + .close = snd_tm6000_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/drivers/media/usb/usbtv/usbtv-audio.c b/drivers/media/usb/usbtv/usbtv-audio.c +index 2c2ca77..14400f3 100644 +--- a/drivers/media/usb/usbtv/usbtv-audio.c ++++ b/drivers/media/usb/usbtv/usbtv-audio.c +@@ -332,7 +332,7 @@ static snd_pcm_uframes_t snd_usbtv_pointer(struct snd_pcm_substream *substream) + return chip->snd_buffer_pos; + } + +-static const struct snd_pcm_ops snd_usbtv_pcm_ops = { ++static struct snd_pcm_ops snd_usbtv_pcm_ops = { + .open = snd_usbtv_pcm_open, + .close = snd_usbtv_pcm_close, + .ioctl = snd_pcm_lib_ioctl, +diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c +index eb3d306..bcc4ec4 100644 +--- a/sound/pci/bt87x.c ++++ b/sound/pci/bt87x.c +@@ -550,7 +550,7 @@ static snd_pcm_uframes_t snd_bt87x_pointer(struct snd_pcm_substream *substream) + return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes); + } + +-static const struct snd_pcm_ops snd_bt87x_pcm_ops = { ++static struct snd_pcm_ops snd_bt87x_pcm_ops = { + .open = snd_bt87x_pcm_open, + .close = snd_bt87x_close, + .ioctl = snd_pcm_lib_ioctl, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_fw_driver_probe.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_fw_driver_probe.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_fw_driver_probe.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_fw_driver_probe.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,73 @@ +--- a/drivers/media/firewire/firedtv-fw.c 2013-07-24 14:34:38.319443243 +0200 ++++ b/drivers/media/firewire/firedtv-fw.c 2013-05-11 16:19:28.000000000 +0200 +@@ -248,7 +248,7 @@ + /* Adjust the template string if models with longer names appear. */ + #define MAX_MODEL_NAME_LEN sizeof("FireDTV ????") + +-static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) ++static int node_probe(struct device *dev) + { + struct firedtv *fdtv; + char name[MAX_MODEL_NAME_LEN]; +@@ -258,8 +258,8 @@ + if (!fdtv) + return -ENOMEM; + +- dev_set_drvdata(&unit->device, fdtv); +- fdtv->device = &unit->device; ++ dev_set_drvdata(dev, fdtv); ++ fdtv->device = dev; + fdtv->isochannel = -1; + fdtv->voltage = 0xff; + fdtv->tone = 0xff; +@@ -269,7 +269,7 @@ + mutex_init(&fdtv->demux_mutex); + INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work); + +- name_len = fw_csr_string(unit->directory, CSR_MODEL, ++ name_len = fw_csr_string(fw_unit(dev)->directory, CSR_MODEL, + name, sizeof(name)); + for (i = ARRAY_SIZE(model_names); --i; ) + if (strlen(model_names[i]) <= name_len && +@@ -277,7 +277,7 @@ + break; + fdtv->type = i; + +- err = fdtv_register_rc(fdtv, &unit->device); ++ err = fdtv_register_rc(fdtv, dev); + if (err) + goto fail_free; + +@@ -307,9 +307,9 @@ + return err; + } + +-static void node_remove(struct fw_unit *unit) ++static int node_remove(struct device *dev) + { +- struct firedtv *fdtv = dev_get_drvdata(&unit->device); ++ struct firedtv *fdtv = dev_get_drvdata(dev); + + fdtv_dvb_unregister(fdtv); + +@@ -320,6 +320,7 @@ + fdtv_unregister_rc(fdtv); + + kfree(fdtv); ++ return 0; + } + + static void node_update(struct fw_unit *unit) +@@ -390,10 +391,10 @@ + .owner = THIS_MODULE, + .name = "firedtv", + .bus = &fw_bus_type, ++ .probe = node_probe, ++ .remove = node_remove, + }, +- .probe = node_probe, + .update = node_update, +- .remove = node_remove, + .id_table = fdtv_id_table, + }; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_ir_hix5hd2.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_ir_hix5hd2.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.10_ir_hix5hd2.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.10_ir_hix5hd2.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c +index c555ca2..37cfb68 100644 +--- a/drivers/media/rc/ir-hix5hd2.c ++++ b/drivers/media/rc/ir-hix5hd2.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.11_dev_groups.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.11_dev_groups.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.11_dev_groups.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.11_dev_groups.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,76 @@ +diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c +index b5aaaac..b2f207f 100644 +--- a/drivers/media/v4l2-core/v4l2-dev.c ++++ b/drivers/media/v4l2-core/v4l2-dev.c +@@ -38,25 +38,24 @@ + * sysfs stuff + */ + +-static ssize_t index_show(struct device *cd, +- struct device_attribute *attr, char *buf) ++static ssize_t show_index(struct device *cd, ++ struct device_attribute *attr, char *buf) + { + struct video_device *vdev = to_video_device(cd); + + return sprintf(buf, "%i\n", vdev->index); + } +-static DEVICE_ATTR_RO(index); + +-static ssize_t dev_debug_show(struct device *cd, +- struct device_attribute *attr, char *buf) ++static ssize_t show_dev_debug(struct device *cd, ++ struct device_attribute *attr, char *buf) + { + struct video_device *vdev = to_video_device(cd); + + return sprintf(buf, "%i\n", vdev->dev_debug); + } + +-static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr, +- const char *buf, size_t len) ++static ssize_t set_dev_debug(struct device *cd, struct device_attribute *attr, ++ const char *buf, size_t len) + { + struct video_device *vdev = to_video_device(cd); + int res = 0; +@@ -69,24 +68,21 @@ static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr, + vdev->dev_debug = value; + return len; + } +-static DEVICE_ATTR_RW(dev_debug); + +-static ssize_t name_show(struct device *cd, ++static ssize_t show_name(struct device *cd, + struct device_attribute *attr, char *buf) + { + struct video_device *vdev = to_video_device(cd); + + return sprintf(buf, "%.*s\n", (int)sizeof(vdev->name), vdev->name); + } +-static DEVICE_ATTR_RO(name); + +-static struct attribute *video_device_attrs[] = { +- &dev_attr_name.attr, +- &dev_attr_dev_debug.attr, +- &dev_attr_index.attr, +- NULL, ++static struct device_attribute video_device_attrs[] = { ++ __ATTR(name, S_IRUGO, show_name, NULL), ++ __ATTR(dev_debug, 0644, show_dev_debug, set_dev_debug), ++ __ATTR(index, S_IRUGO, show_index, NULL), ++ __ATTR_NULL + }; +-ATTRIBUTE_GROUPS(video_device); + + /* + * Active devices +@@ -221,7 +217,7 @@ static void v4l2_device_release(struct device *cd) + + static struct class video_class = { + .name = VIDEO_NAME, +- .dev_groups = video_device_groups, ++ .dev_attrs = video_device_attrs, + }; + + struct video_device *video_devdata(struct file *file) diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.12_kfifo_in.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.12_kfifo_in.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.12_kfifo_in.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.12_kfifo_in.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,51 @@ +diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c +index 2f9e0c1..dc1a534 100644 +--- a/drivers/media/rc/lirc_dev.c ++++ b/drivers/media/rc/lirc_dev.c +@@ -92,9 +92,11 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev) + LIRC_VALUE_MASK); + + spin_lock_irqsave(&dev->lirc_fh_lock, flags); +- list_for_each_entry(fh, &dev->lirc_fh, list) +- kfifo_put(&fh->rawir, +- LIRC_SPACE(dev->gap_duration)); ++ list_for_each_entry(fh, &dev->lirc_fh, list) { ++ unsigned int gap_duration = LIRC_SPACE(dev->gap_duration); ++ kfifo_in(&fh->rawir, &gap_duration, sizeof(gap_duration)); ++ } ++ + spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); + dev->gap = false; + } +@@ -109,7 +111,8 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev) + list_for_each_entry(fh, &dev->lirc_fh, list) { + if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports) + continue; +- if (kfifo_put(&fh->rawir, sample)) ++ ++ if (kfifo_in(&fh->rawir, &sample, sizeof(sample))) + wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM); + } + spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); +@@ -130,7 +133,7 @@ void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc) + + spin_lock_irqsave(&dev->lirc_fh_lock, flags); + list_for_each_entry(fh, &dev->lirc_fh, list) { +- if (kfifo_put(&fh->scancodes, *lsc)) ++ if (kfifo_in(&fh->scancodes, lsc, sizeof(*lsc))) + wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM); + } + spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); +diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c +index 213394b..7fe73f0 100644 +--- a/drivers/media/rc/rc-ir-raw.c ++++ b/drivers/media/rc/rc-ir-raw.c +@@ -69,7 +69,7 @@ int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev) + dev_dbg(&dev->dev, "sample: (%05dus %s)\n", + TO_US(ev->duration), TO_STR(ev->pulse)); + +- if (!kfifo_put(&dev->raw->kfifo, *ev)) { ++ if (kfifo_in(&dev->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) { + dev_err(&dev->dev, "IR event FIFO is full!\n"); + return -ENOSPC; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.13_ddbridge_pcimsi.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.13_ddbridge_pcimsi.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.13_ddbridge_pcimsi.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.13_ddbridge_pcimsi.patch 2018-02-04 13:19:24.000000000 +0000 @@ -0,0 +1,30 @@ +diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c +index 9ab4736..50c3b4f 100644 +--- a/drivers/media/pci/ddbridge/ddbridge-main.c ++++ b/drivers/media/pci/ddbridge/ddbridge-main.c +@@ -129,14 +129,18 @@ static void ddb_irq_msi(struct ddb *dev, int nr) + int stat; + + if (msi && pci_msi_enabled()) { +- stat = pci_enable_msi_range(dev->pdev, 1, nr); +- if (stat >= 1) { +- dev->msi = stat; +- dev_info(dev->dev, "using %d MSI interrupt(s)\n", +- dev->msi); +- } else { +- dev_info(dev->dev, "MSI not available.\n"); ++ stat = pci_enable_msi_block(dev->pdev, nr); ++ if (stat == 0) { ++ dev->msi = nr; ++ } else if (stat == 1) { ++ stat = pci_enable_msi(dev->pdev); ++ dev->msi = 1; + } ++ if (stat < 0) ++ dev_info(dev->dev, "MSI not available.\n"); ++ else ++ dev_info(dev->dev, "using %d MSI interrupts\n", ++ dev->msi); + } + } + #endif diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_netdev.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_netdev.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_netdev.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_netdev.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c +index 059e611..5e7052e 100644 +--- a/drivers/media/dvb-core/dvb_net.c ++++ b/drivers/media/dvb-core/dvb_net.c +@@ -1277,7 +1277,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) + return -EINVAL; + + net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", +- NET_NAME_UNKNOWN, dvb_net_setup); ++ dvb_net_setup); + if (!net) + return -ENOMEM; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_void_gpiochip_remove.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_void_gpiochip_remove.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_void_gpiochip_remove.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_void_gpiochip_remove.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,17 @@ +diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c +index 95267c6..6583f29 100644 +--- a/drivers/media/dvb-frontends/cxd2820r_core.c ++++ b/drivers/media/dvb-frontends/cxd2820r_core.c +@@ -726,8 +726,10 @@ static int cxd2820r_remove(struct i2c_client *client) + dev_dbg(&client->dev, "\n"); + + #ifdef CONFIG_GPIOLIB +- if (priv->gpio_chip.label) +- gpiochip_remove(&priv->gpio_chip); ++ if (priv->gpio_chip.label) { ++ int ret = gpiochip_remove(&priv->gpio_chip); ++ (void)ret; ++ } + #endif + regmap_exit(priv->regmap[1]); + i2c_unregister_device(priv->client[1]); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_wait_on_bit.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_wait_on_bit.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.16_wait_on_bit.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.16_wait_on_bit.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,36 @@ +diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +index 2e90310..c13e604f 100644 +--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c ++++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +@@ -253,6 +253,13 @@ static int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap) + return usb_urb_exitv2(&adap->stream); + } + ++static int wait_schedule(void *ptr) ++{ ++ schedule(); ++ ++ return 0; ++} ++ + static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) + { + struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv; +@@ -266,7 +273,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) + dvbdmxfeed->pid, dvbdmxfeed->index); + + /* wait init is done */ +- wait_on_bit(&adap->state_bits, ADAP_INIT, TASK_UNINTERRUPTIBLE); ++ wait_on_bit(&adap->state_bits, ADAP_INIT, wait_schedule, TASK_UNINTERRUPTIBLE); + + if (adap->active_fe == -1) + return -EINVAL; +@@ -561,7 +568,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) + if (!adap->suspend_resume_active) { + set_bit(ADAP_SLEEP, &adap->state_bits); + wait_on_bit(&adap->state_bits, ADAP_STREAMING, +- TASK_UNINTERRUPTIBLE); ++ wait_schedule, TASK_UNINTERRUPTIBLE); + } + + if (adap->fe_sleep[fe->id]) { diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.17_fix_clamp.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.17_fix_clamp.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.17_fix_clamp.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.17_fix_clamp.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,35 @@ +diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c +index 1b184c3..3537c6f 100644 +--- a/drivers/media/pci/saa7164/saa7164-encoder.c ++++ b/drivers/media/pci/saa7164/saa7164-encoder.c +@@ -389,7 +389,7 @@ int saa7164_s_frequency(struct saa7164_port *port, + if (f->tuner != 0) + return -EINVAL; + +- port->freq = clamp(f->frequency, ++ port->freq = clamp_t(u32, f->frequency, + SAA7164_TV_MIN_FREQ, SAA7164_TV_MAX_FREQ); + + /* Update the hardware */ +diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c +index e05bfec..b132ecb 100644 +--- a/drivers/media/usb/hackrf/hackrf.c ++++ b/drivers/media/usb/hackrf/hackrf.c +@@ -1108,7 +1108,7 @@ static int hackrf_s_frequency(struct file *file, void *priv, + f->tuner, f->type, f->frequency); + + if (f->tuner == 0) { +- uitmp = clamp(f->frequency, bands_adc_dac[0].rangelow, ++ uitmp = clamp_t(u32, f->frequency, bands_adc_dac[0].rangelow, + bands_adc_dac[0].rangehigh); + if (vdev->vfl_dir == VFL_DIR_RX) { + dev->f_adc = uitmp; +@@ -1118,7 +1118,7 @@ static int hackrf_s_frequency(struct file *file, void *priv, + set_bit(TX_DAC_FREQUENCY, &dev->flags); + } + } else if (f->tuner == 1) { +- uitmp = clamp(f->frequency, bands_rx_tx[0].rangelow, ++ uitmp = clamp_t(u32, f->frequency, bands_rx_tx[0].rangelow, + bands_rx_tx[0].rangehigh); + if (vdev->vfl_dir == VFL_DIR_RX) { + dev->f_rx = uitmp; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.18_drop_property_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.18_drop_property_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.18_drop_property_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.18_drop_property_h.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c +index dd0f0ead9516..c5b37a56b4e2 100644 +--- a/drivers/media/media-entity.c ++++ b/drivers/media/media-entity.c +@@ -18,7 +18,6 @@ + + #include + #include +-#include + #include + #include + #include diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.18_ktime_get_real_seconds.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.18_ktime_get_real_seconds.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.18_ktime_get_real_seconds.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.18_ktime_get_real_seconds.patch 2018-02-04 13:15:20.000000000 +0000 @@ -0,0 +1,26 @@ +diff --git a/drivers/media/platform/vivid/vivid-rds-gen.c b/drivers/media/platform/vivid/vivid-rds-gen.c +index 996e35e..53c7777 100644 +--- a/drivers/media/platform/vivid/vivid-rds-gen.c ++++ b/drivers/media/platform/vivid/vivid-rds-gen.c +@@ -103,7 +103,7 @@ void vivid_rds_generate(struct vivid_rds_gen *rds) + * EN 50067:1998 to convert a UTC date to an RDS Modified + * Julian Day. + */ +- time64_to_tm(ktime_get_real_seconds(), 0, &tm); ++ time_to_tm(get_seconds(), 0, &tm); + l = tm.tm_mon <= 1; + date = 14956 + tm.tm_mday + ((tm.tm_year - l) * 1461) / 4 + + ((tm.tm_mon + 2 + l * 12) * 306001) / 10000; +diff --git a/drivers/media/platform/vivid/vivid-vbi-gen.c b/drivers/media/platform/vivid/vivid-vbi-gen.c +index 02c79d7..a2159de 100644 +--- a/drivers/media/platform/vivid/vivid-vbi-gen.c ++++ b/drivers/media/platform/vivid/vivid-vbi-gen.c +@@ -190,7 +190,7 @@ static void vivid_vbi_gen_set_time_of_day(u8 *packet) + struct tm tm; + u8 checksum, i; + +- time64_to_tm(ktime_get_real_seconds(), 0, &tm); ++ time_to_tm(get_seconds(), 0, &tm); + packet[0] = calc_parity(0x07); + packet[1] = calc_parity(0x01); + packet[2] = calc_parity(0x40 | tm.tm_min); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.19_get_user_pages_locked.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.19_get_user_pages_locked.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.19_get_user_pages_locked.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.19_get_user_pages_locked.patch 2018-02-11 00:44:30.000000000 +0000 @@ -0,0 +1,15 @@ +diff --git a/mm/frame_vector.c b/mm/frame_vector.c +index 7cf2b71..1199a59 100644 +--- a/mm/frame_vector.c ++++ b/mm/frame_vector.c +@@ -58,8 +58,8 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, + if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { + vec->got_ref = true; + vec->is_pfns = false; +- ret = get_user_pages_locked(current, mm, start, nr_frames, +- write, force, (struct page **)(vec->ptrs), &locked); ++ ret = get_user_pages(current, mm, start, nr_frames, ++ write, force, (struct page **)(vec->ptrs), NULL); + goto out; + } + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.19_get_user_pages_unlocked.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.19_get_user_pages_unlocked.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.19_get_user_pages_unlocked.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.19_get_user_pages_unlocked.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,43 @@ +diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c +index 02f8652..8c21ab3 100644 +--- a/drivers/media/pci/ivtv/ivtv-udma.c ++++ b/drivers/media/pci/ivtv/ivtv-udma.c +@@ -124,8 +124,10 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, + } + + /* Get user pages for DMA Xfer */ +- err = get_user_pages_unlocked(current, current->mm, +- user_dma.uaddr, user_dma.page_count, 0, 1, dma->map); ++ down_read(¤t->mm->mmap_sem); ++ err = get_user_pages(current, current->mm, ++ user_dma.uaddr, user_dma.page_count, 0, 1, dma->map, NULL); ++ up_read(¤t->mm->mmap_sem); + + if (user_dma.page_count != err) { + IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n", +diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c +index 4e4b3b4..eacca1c 100644 +--- a/drivers/media/pci/ivtv/ivtv-yuv.c ++++ b/drivers/media/pci/ivtv/ivtv-yuv.c +@@ -75,15 +75,15 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, + ivtv_udma_get_page_info (&uv_dma, (unsigned long)args->uv_source, 360 * uv_decode_height); + + /* Get user pages for DMA Xfer */ +- y_pages = get_user_pages_unlocked(current, current->mm, +- y_dma.uaddr, y_dma.page_count, 0, 1, +- &dma->map[0]); ++ down_read(¤t->mm->mmap_sem); ++ y_pages = get_user_pages(current, current->mm, y_dma.uaddr, y_dma.page_count, 0, 1, &dma->map[0], NULL); + uv_pages = 0; /* silence gcc. value is set and consumed only if: */ + if (y_pages == y_dma.page_count) { +- uv_pages = get_user_pages_unlocked(current, current->mm, +- uv_dma.uaddr, uv_dma.page_count, 0, 1, +- &dma->map[y_pages]); ++ uv_pages = get_user_pages(current, current->mm, ++ uv_dma.uaddr, uv_dma.page_count, 0, 1, ++ &dma->map[y_pages], NULL); + } ++ up_read(¤t->mm->mmap_sem); + + if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { + int rc = -EFAULT; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_dma_buf_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_dma_buf_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_dma_buf_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_dma_buf_h.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,115 @@ +diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h +index e0b0741..707f69e 100644 +--- a/include/linux/dma-buf.h ++++ b/include/linux/dma-buf.h +@@ -214,6 +214,7 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) + get_file(dmabuf->file); + } + ++#ifdef CONFIG_DMA_SHARED_BUFFER + struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, + struct device *dev); + void dma_buf_detach(struct dma_buf *dmabuf, +@@ -242,4 +243,102 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, + unsigned long); + void *dma_buf_vmap(struct dma_buf *); + void dma_buf_vunmap(struct dma_buf *, void *vaddr); ++#else ++ ++static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, ++ struct device *dev) ++{ ++ return ERR_PTR(-ENODEV); ++} ++ ++static inline void dma_buf_detach(struct dma_buf *dmabuf, ++ struct dma_buf_attachment *dmabuf_attach) ++{ ++ return; ++} ++ ++static inline struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, ++ size_t size, int flags, struct reservation_object *resv) ++{ ++ return ERR_PTR(-ENODEV); ++} ++ ++static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags) ++{ ++ return -ENODEV; ++} ++ ++static inline struct dma_buf *dma_buf_get(int fd) ++{ ++ return ERR_PTR(-ENODEV); ++} ++ ++static inline void dma_buf_put(struct dma_buf *dmabuf) ++{ ++ return; ++} ++ ++static inline struct sg_table *dma_buf_map_attachment( ++ struct dma_buf_attachment *attach, enum dma_data_direction write) ++{ ++ return ERR_PTR(-ENODEV); ++} ++ ++static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, ++ struct sg_table *sg, enum dma_data_direction dir) ++{ ++ return; ++} ++ ++static inline int dma_buf_begin_cpu_access(struct dma_buf *dmabuf, ++ size_t start, size_t len, ++ enum dma_data_direction dir) ++{ ++ return -ENODEV; ++} ++ ++static inline void dma_buf_end_cpu_access(struct dma_buf *dmabuf, ++ size_t start, size_t len, ++ enum dma_data_direction dir) ++{ ++} ++ ++static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, ++ unsigned long pnum) ++{ ++ return NULL; ++} ++ ++static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, ++ unsigned long pnum, void *vaddr) ++{ ++} ++ ++static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum) ++{ ++ return NULL; ++} ++ ++static inline void dma_buf_kunmap(struct dma_buf *dmabuf, ++ unsigned long pnum, void *vaddr) ++{ ++} ++ ++static inline int dma_buf_mmap(struct dma_buf *dmabuf, ++ struct vm_area_struct *vma, ++ unsigned long pgoff) ++{ ++ return -ENODEV; ++} ++ ++static inline void *dma_buf_vmap(struct dma_buf *dmabuf) ++{ ++ return NULL; ++} ++ ++static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) ++{ ++} ++#endif /* CONFIG_DMA_SHARED_BUFFER */ ++ + #endif /* __DMA_BUF_H__ */ diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_export_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_export_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_export_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_export_h.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,144 @@ +diff --git a/drivers/media/cec/cec-notifier.c b/drivers/media/cec/cec-notifier.c +index 5f5209a73665..894399639fe5 100644 +--- a/drivers/media/cec/cec-notifier.c ++++ b/drivers/media/cec/cec-notifier.c +@@ -18,7 +18,6 @@ + * SOFTWARE. + */ + +-#include + #include + #include + #include +diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c +index 6ebcbc6450f5..b193ab3e8835 100644 +--- a/drivers/media/common/saa7146/saa7146_hlp.c ++++ b/drivers/media/common/saa7146/saa7146_hlp.c +@@ -1,7 +1,6 @@ + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + #include +-#include + #include + + static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) +diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c +index bfe831c10b1c..d1aa20e6f0cd 100644 +--- a/drivers/media/common/siano/smsendian.c ++++ b/drivers/media/common/siano/smsendian.c +@@ -19,7 +19,6 @@ + + ****************************************************************/ + +-#include + #include + + #include "smsendian.h" +diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c +index 760e3e424e23..feb5d759711b 100644 +--- a/drivers/media/media-device.c ++++ b/drivers/media/media-device.c +@@ -20,7 +20,6 @@ + #define __NEED_MEDIA_LEGACY_API + + #include +-#include + #include + #include + #include +diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c +index 71423f45c05c..5d5bbe2a79ef 100644 +--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c ++++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c +@@ -24,7 +24,6 @@ + * + */ + +-#include + + #include "fmdrv.h" + #include "fmdrv_v4l2.h" +diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c +index 90f66dc7c0d7..28dbe9dec42f 100644 +--- a/drivers/media/rc/rc-ir-raw.c ++++ b/drivers/media/rc/rc-ir-raw.c +@@ -12,7 +12,6 @@ + * GNU General Public License for more details. + */ + +-#include + #include + #include + #include +diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c +index fcab55038d99..2b74078d60c5 100644 +--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c ++++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c +@@ -17,7 +17,6 @@ + + #include + #include +-#include + + #include "hdpvr.h" + +diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c +index b4b364f68695..65a2cc850f0a 100644 +--- a/drivers/media/v4l2-core/v4l2-ctrls.c ++++ b/drivers/media/v4l2-core/v4l2-ctrls.c +@@ -20,7 +20,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c +index a75df6cb141f..2c75b64cd0f0 100644 +--- a/drivers/media/v4l2-core/v4l2-event.c ++++ b/drivers/media/v4l2-core/v4l2-event.c +@@ -23,7 +23,6 @@ + + #include + #include +-#include + + static unsigned sev_pos(const struct v4l2_subscribed_event *sev, unsigned idx) + { +diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c +index 3895999bf880..02b7880b8aeb 100644 +--- a/drivers/media/v4l2-core/v4l2-fh.c ++++ b/drivers/media/v4l2-core/v4l2-fh.c +@@ -19,7 +19,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c +index da78497ae5ed..41e0fc1b5a69 100644 +--- a/drivers/media/v4l2-core/v4l2-subdev.c ++++ b/drivers/media/v4l2-core/v4l2-subdev.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + + #include + #include +diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h +index 2b94662d005c..d3ed44072544 100644 +--- a/include/media/v4l2-clk.h ++++ b/include/media/v4l2-clk.h +@@ -15,7 +15,6 @@ + #define MEDIA_V4L2_CLK_H + + #include +-#include + #include + #include + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_pm_qos.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_pm_qos.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.1_no_pm_qos.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.1_no_pm_qos.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,95 @@ +diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c +index f1452da..6996f5e 100644 +--- a/drivers/media/pci/saa7134/saa7134-video.c ++++ b/drivers/media/pci/saa7134/saa7134-video.c +@@ -972,17 +972,6 @@ int saa7134_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) + return -EBUSY; + } + +- /* The SAA7134 has a 1K FIFO; the datasheet suggests that when +- * configured conservatively, there's 22 usec of buffering for video. +- * We therefore request a DMA latency of 20 usec, giving us 2 usec of +- * margin in case the FIFO is configured differently to the datasheet. +- * Unfortunately, I lack register-level documentation to check the +- * Linux FIFO setup and confirm the perfect value. +- */ +- if ((dmaq == &dev->video_q && !vb2_is_streaming(&dev->vbi_vbq)) || +- (dmaq == &dev->vbi_q && !vb2_is_streaming(&dev->video_vbq))) +- pm_qos_add_request(&dev->qos_request, +- PM_QOS_CPU_DMA_LATENCY, 20); + dmaq->seq_nr = 0; + + return 0; +@@ -994,10 +983,6 @@ void saa7134_vb2_stop_streaming(struct vb2_queue *vq) + struct saa7134_dev *dev = dmaq->dev; + + saa7134_stop_streaming(dev, dmaq); +- +- if ((dmaq == &dev->video_q && !vb2_is_streaming(&dev->vbi_vbq)) || +- (dmaq == &dev->vbi_q && !vb2_is_streaming(&dev->video_vbq))) +- pm_qos_remove_request(&dev->qos_request); + } + + static struct vb2_ops vb2_qops = { +diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h +index e47edd4..ad5a673 100644 +--- a/drivers/media/pci/saa7134/saa7134.h ++++ b/drivers/media/pci/saa7134/saa7134.h +@@ -29,7 +29,6 @@ + #include + #include + #include +-#include + + #include + +@@ -591,7 +590,6 @@ struct saa7134_dev { + struct saa7134_format *fmt; + unsigned int width, height; + unsigned int vbi_hlen, vbi_vlen; +- struct pm_qos_request qos_request; + + /* SAA7134_MPEG_* */ + struct saa7134_ts ts; +diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c +index b4f9d03..d91b2f9 100644 +--- a/drivers/media/platform/via-camera.c ++++ b/drivers/media/platform/via-camera.c +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -71,7 +70,6 @@ struct via_camera { + struct mutex lock; + enum viacam_opstate opstate; + unsigned long flags; +- struct pm_qos_request qos_request; + /* + * GPIO info for power/reset management + */ +@@ -1064,13 +1062,6 @@ static int viacam_streamon(struct file *filp, void *priv, enum v4l2_buf_type t) + goto out; + } + /* +- * If the CPU goes into C3, the DMA transfer gets corrupted and +- * users start filing unsightly bug reports. Put in a "latency" +- * requirement which will keep the CPU out of the deeper sleep +- * states. +- */ +- pm_qos_add_request(&cam->qos_request, PM_QOS_CPU_DMA_LATENCY, 50); +- /* + * Fire things up. + */ + INIT_LIST_HEAD(&cam->buffer_queue); +@@ -1094,7 +1085,6 @@ static int viacam_streamoff(struct file *filp, void *priv, enum v4l2_buf_type t) + ret = -EINVAL; + goto out; + } +- pm_qos_remove_request(&cam->qos_request); + viacam_stop_engine(cam); + /* + * Videobuf will recycle all of the outstanding buffers, but diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.2_alloc_ordered_workqueue.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.2_alloc_ordered_workqueue.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.2_alloc_ordered_workqueue.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.2_alloc_ordered_workqueue.patch 2018-02-04 13:15:13.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c +index 8f314ca320c7..6464e3ffd7c1 100644 +--- a/drivers/media/pci/cx18/cx18-driver.c ++++ b/drivers/media/pci/cx18/cx18-driver.c +@@ -697,7 +697,7 @@ static int cx18_create_in_workq(struct cx18 *cx) + { + snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", + cx->v4l2_dev.name); +- cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name); ++ cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0); + if (!cx->in_work_queue) { + CX18_ERR("Unable to create incoming mailbox handler thread\n"); + return -ENOMEM; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.2_devnode_uses_mode_t.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.2_devnode_uses_mode_t.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.2_devnode_uses_mode_t.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.2_devnode_uses_mode_t.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,39 @@ +diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c +index 401ef64..fddb485 100644 +--- a/drivers/media/dvb-core/dvbdev.c ++++ b/drivers/media/dvb-core/dvbdev.c +@@ -449,7 +449,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) + return 0; + } + +-static char *dvb_devnode(struct device *dev, umode_t *mode) ++static char *dvb_devnode(struct device *dev, mode_t *mode) + { + struct dvb_device *dvbdev = dev_get_drvdata(dev); + +diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c +index 36e3452..624833d 100644 +--- a/drivers/media/pci/ddbridge/ddbridge-core.c ++++ b/drivers/media/pci/ddbridge/ddbridge-core.c +@@ -1481,7 +1481,7 @@ static const struct file_operations ddb_fops = { + .open = ddb_open, + }; + +-static char *ddb_devnode(struct device *device, umode_t *mode) ++static char *ddb_devnode(struct device *device, mode_t *mode) + { + struct ddb *dev = dev_get_drvdata(device); + +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c +index 1cf382a..7b71836 100644 +--- a/drivers/media/rc/rc-main.c ++++ b/drivers/media/rc/rc-main.c +@@ -715,7 +715,7 @@ static void ir_close(struct input_dev *idev) + } + + /* class for /sys/class/rc */ +-static char *rc_devnode(struct device *dev, umode_t *mode) ++static char *rc_devnode(struct device *dev, mode_t *mode) + { + return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.3_eprobe_defer.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.3_eprobe_defer.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.3_eprobe_defer.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.3_eprobe_defer.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,54 @@ +diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c +index 297e10e69898..0ea394e985c7 100644 +--- a/drivers/media/v4l2-core/v4l2-clk.c ++++ b/drivers/media/v4l2-core/v4l2-clk.c +@@ -39,6 +39,7 @@ static struct v4l2_clk *v4l2_clk_find(const char *dev_id) + struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) + { + struct v4l2_clk *clk; ++#if 0 + struct clk *ccf_clk = clk_get(dev, id); + char clk_name[V4L2_CLK_NAME_SIZE]; + +@@ -55,16 +56,16 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) + + return clk; + } +- ++#endif + mutex_lock(&clk_lock); + clk = v4l2_clk_find(dev_name(dev)); +- ++#if 0 + /* if dev_name is not found, try use the OF name to find again */ + if (PTR_ERR(clk) == -ENODEV && dev->of_node) { + v4l2_clk_name_of(clk_name, sizeof(clk_name), dev->of_node); + clk = v4l2_clk_find(clk_name); + } +- ++#endif + if (!IS_ERR(clk)) + atomic_inc(&clk->use_count); + mutex_unlock(&clk_lock); +@@ -125,8 +126,10 @@ int v4l2_clk_enable(struct v4l2_clk *clk) + { + int ret; + ++#if 0 + if (clk->clk) + return clk_prepare_enable(clk->clk); ++#endif + + ret = v4l2_clk_lock_driver(clk); + if (ret < 0) +@@ -154,8 +157,10 @@ void v4l2_clk_disable(struct v4l2_clk *clk) + { + int enable; + ++#if 0 + if (clk->clk) + return clk_disable_unprepare(clk->clk); ++#endif + + mutex_lock(&clk->lock); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.4_i2c_add_mux_adapter.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.4_i2c_add_mux_adapter.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.4_i2c_add_mux_adapter.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.4_i2c_add_mux_adapter.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,82 @@ +diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c +index f893cfc..abecdac 100644 +--- a/drivers/media/dvb-frontends/m88ds3103.c ++++ b/drivers/media/dvb-frontends/m88ds3103.c +@@ -1587,7 +1587,7 @@ static int m88ds3103_probe(struct i2c_client *client, + goto err_kfree; + + /* create mux i2c adapter for tuner */ +- dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, + dev, 0, 0, m88ds3103_select, + NULL); + if (dev->i2c_adapter == NULL) { +diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c +index fac1a1d..cf5d8cf 100644 +--- a/drivers/media/dvb-frontends/rtl2830.c ++++ b/drivers/media/dvb-frontends/rtl2830.c +@@ -865,7 +865,7 @@ static int rtl2830_probe(struct i2c_client *client, + goto err_regmap_exit; + + /* create muxed i2c adapter for tuner */ +- dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ dev->adapter = i2c_add_mux_adapter(client->adapter, + client, 0, 0, rtl2830_select, NULL); + if (dev->adapter == NULL) { + ret = -ENODEV; +diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c +index 87e66a8..a1e6cd2 100644 +--- a/drivers/media/dvb-frontends/rtl2832.c ++++ b/drivers/media/dvb-frontends/rtl2832.c +@@ -1262,7 +1262,7 @@ static int rtl2832_probe(struct i2c_client *client, + goto err_regmap_exit; + + /* create muxed i2c adapter for demod tuner bus */ +- dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, ++ dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, dev, + 0, 0, rtl2832_select, rtl2832_deselect); + if (dev->i2c_adapter_tuner == NULL) { + ret = -ENODEV; +diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c +index ee0a202..7df7e6b 100644 +--- a/drivers/media/dvb-frontends/si2168.c ++++ b/drivers/media/dvb-frontends/si2168.c +@@ -682,7 +682,7 @@ static int si2168_probe(struct i2c_client *client, + mutex_init(&dev->i2c_mutex); + + /* create mux i2c adapter for tuner */ +- dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ dev->adapter = i2c_add_mux_adapter(client->adapter, + client, 0, 0, si2168_select, si2168_deselect); + if (dev->adapter == NULL) { + ret = -ENODEV; +diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c +index 725c13a..35e3ac1 100644 +--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c ++++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c +@@ -568,11 +568,8 @@ static int cx231xx_i2c_mux_select(struct i2c_adapter *adap, + int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) + { + struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; +- /* what is the correct mux_dev? */ +- struct device *mux_dev = dev->dev; + + dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, +- mux_dev, + dev /* mux_priv */, + 0, + mux_no /* chan_id */, +diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c +--- a/drivers/media/dvb-frontends/lgdt3306a.c 2018-01-23 22:15:12.146359404 +0000 ++++ b/drivers/media/dvb-frontends/lgdt3306a.c 2018-01-23 22:16:01.055381481 +0000 +@@ -2300,8 +2300,8 @@ static int lgdt3306a_probe(struct i2c_cl + state = fe->demodulator_priv; + + /* create mux i2c adapter for tuner */ +- state->i2c_adap = i2c_add_mux_adapter(client->adapter, &client->dev, +- client, 0, 0, lgdt3306a_select, lgdt3306a_deselect); ++ state->i2c_adap = i2c_add_mux_adapter(client->adapter, client, ++ 0, 0, lgdt3306a_select, lgdt3306a_deselect); + if (state->i2c_adap == NULL) { + ret = -ENODEV; + goto err_kfree; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.4_stk_webcam.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.4_stk_webcam.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.4_stk_webcam.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.4_stk_webcam.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c +index 22389b5..1d331d3 100644 +--- a/drivers/media/usb/stkwebcam/stk-webcam.c ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c +@@ -37,6 +37,7 @@ + + #include "stk-webcam.h" + ++#include + + static int hflip = -1; + module_param(hflip, int, 0444); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.6_i2c_add_mux_adapter.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.6_i2c_add_mux_adapter.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.6_i2c_add_mux_adapter.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.6_i2c_add_mux_adapter.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,76 @@ +diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c +index 01b9ded..f893cfc 100644 +--- a/drivers/media/dvb-frontends/m88ds3103.c ++++ b/drivers/media/dvb-frontends/m88ds3103.c +@@ -1588,7 +1588,7 @@ static int m88ds3103_probe(struct i2c_client *client, + + /* create mux i2c adapter for tuner */ + dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, +- dev, 0, 0, 0, m88ds3103_select, ++ dev, 0, 0, m88ds3103_select, + NULL); + if (dev->i2c_adapter == NULL) { + ret = -ENOMEM; +diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c +index e1b8df6..fac1a1d 100644 +--- a/drivers/media/dvb-frontends/rtl2830.c ++++ b/drivers/media/dvb-frontends/rtl2830.c +@@ -866,7 +866,7 @@ static int rtl2830_probe(struct i2c_client *client, + + /* create muxed i2c adapter for tuner */ + dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, +- client, 0, 0, 0, rtl2830_select, NULL); ++ client, 0, 0, rtl2830_select, NULL); + if (dev->adapter == NULL) { + ret = -ENODEV; + goto err_regmap_exit; +diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c +index a57c478..87e66a8 100644 +--- a/drivers/media/dvb-frontends/rtl2832.c ++++ b/drivers/media/dvb-frontends/rtl2832.c +@@ -1263,7 +1263,7 @@ static int rtl2832_probe(struct i2c_client *client, + + /* create muxed i2c adapter for demod tuner bus */ + dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, +- 0, 0, 0, rtl2832_select, rtl2832_deselect); ++ 0, 0, rtl2832_select, rtl2832_deselect); + if (dev->i2c_adapter_tuner == NULL) { + ret = -ENODEV; + goto err_regmap_exit; +diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c +index b68ab34..ee0a202 100644 +--- a/drivers/media/dvb-frontends/si2168.c ++++ b/drivers/media/dvb-frontends/si2168.c +@@ -683,7 +683,7 @@ static int si2168_probe(struct i2c_client *client, + + /* create mux i2c adapter for tuner */ + dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, +- client, 0, 0, 0, si2168_select, si2168_deselect); ++ client, 0, 0, si2168_select, si2168_deselect); + if (dev->adapter == NULL) { + ret = -ENODEV; + goto err_kfree; +diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c +index a29c345..725c13a 100644 +--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c ++++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c +@@ -576,7 +576,6 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) + dev /* mux_priv */, + 0, + mux_no /* chan_id */, +- 0 /* class */, + &cx231xx_i2c_mux_select, + NULL); + +diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c +--- a/drivers/media/dvb-frontends/lgdt3306a.c 2018-01-23 22:13:14.095893561 +0000 ++++ b/drivers/media/dvb-frontends/lgdt3306a.c 2018-01-23 22:13:52.796701755 +0000 +@@ -2301,7 +2301,7 @@ static int lgdt3306a_probe(struct i2c_cl + + /* create mux i2c adapter for tuner */ + state->i2c_adap = i2c_add_mux_adapter(client->adapter, &client->dev, +- client, 0, 0, 0, lgdt3306a_select, lgdt3306a_deselect); ++ client, 0, 0, lgdt3306a_select, lgdt3306a_deselect); + if (state->i2c_adap == NULL) { + ret = -ENODEV; + goto err_kfree; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.6_pci_error_handlers.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.6_pci_error_handlers.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.6_pci_error_handlers.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.6_pci_error_handlers.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c +index 9e82d21..ea51b28 100644 +--- a/drivers/media/pci/ngene/ngene-cards.c ++++ b/drivers/media/pci/ngene/ngene-cards.c +@@ -798,7 +798,7 @@ static void ngene_resume(struct pci_dev *dev) + printk(KERN_INFO DEVICE_NAME ": resume\n"); + } + +-static const struct pci_error_handlers ngene_errors = { ++static struct pci_error_handlers ngene_errors = { + .error_detected = ngene_error_detected, + .link_reset = ngene_link_reset, + .slot_reset = ngene_slot_reset, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.8_config_of.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.8_config_of.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.8_config_of.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.8_config_of.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,27 @@ +diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c +index 2b08d03..4ca1b6f 100644 +--- a/drivers/media/v4l2-core/v4l2-async.c ++++ b/drivers/media/v4l2-core/v4l2-async.c +@@ -73,7 +73,11 @@ static bool match_devname(struct v4l2_subdev *sd, + + static bool match_fwnode(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) + { ++#ifdef CONFIG_OF + return sd->fwnode == asd->match.fwnode; ++#else ++ return false; ++#endif + } + + static bool match_custom(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) +@@ -539,8 +543,10 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) + * (struct v4l2_subdev.dev), and async sub-device does not + * exist independently of the device at any point of time. + */ ++#ifdef CONFIG_OF + if (!sd->fwnode && sd->dev) + sd->fwnode = dev_fwnode(sd->dev); ++#endif + + mutex_lock(&list_lock); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v3.9_drxj_warnings.patch media-build-dkms-0005~trusty/media-build-0005/backports/v3.9_drxj_warnings.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v3.9_drxj_warnings.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v3.9_drxj_warnings.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,15 @@ +diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c +index 7ca7a21..0ffd69b 100644 +--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c ++++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c +@@ -10666,8 +10666,8 @@ ctrl_sig_quality(struct drx_demod_instance *demod, + struct dtv_frontend_properties *p = &state->frontend.dtv_property_cache; + enum drx_standard standard = ext_attr->standard; + int rc; +- u32 ber, cnt, err, pkt; +- u16 mer, strength = 0; ++ u32 ber = 0, cnt, err = 0, pkt; ++ u16 mer = 0, strength = 0; + + rc = get_sig_strength(demod, &strength); + if (rc < 0) { diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_dma_buf_export.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_dma_buf_export.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_dma_buf_export.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_dma_buf_export.patch 2018-02-04 13:19:24.000000000 +0000 @@ -0,0 +1,90 @@ +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c +index 620c4aa..4b62c9c 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c +@@ -402,12 +402,6 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) + { + struct vb2_dc_buf *buf = buf_priv; + struct dma_buf *dbuf; +- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); +- +- exp_info.ops = &vb2_dc_dmabuf_ops; +- exp_info.size = buf->size; +- exp_info.flags = flags; +- exp_info.priv = buf; + + if (!buf->sgt_base) + buf->sgt_base = vb2_dc_get_base_sgt(buf); +@@ -415,7 +409,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) + if (WARN_ON(!buf->sgt_base)) + return NULL; + +- dbuf = dma_buf_export(&exp_info); ++ dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL); + if (IS_ERR(dbuf)) + return NULL; + +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +index afd4b51..71510e4 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +@@ -589,17 +589,11 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags + { + struct vb2_dma_sg_buf *buf = buf_priv; + struct dma_buf *dbuf; +- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); +- +- exp_info.ops = &vb2_dma_sg_dmabuf_ops; +- exp_info.size = buf->size; +- exp_info.flags = flags; +- exp_info.priv = buf; + + if (WARN_ON(!buf->dma_sgt)) + return NULL; + +- dbuf = dma_buf_export(&exp_info); ++ dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL); + if (IS_ERR(dbuf)) + return NULL; + +diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +index 0ba40be..c060cf9 100644 +--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c ++++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +@@ -372,17 +372,11 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag + { + struct vb2_vmalloc_buf *buf = buf_priv; + struct dma_buf *dbuf; +- DEFINE_DMA_BUF_EXPORT_INFO(exp_info); +- +- exp_info.ops = &vb2_vmalloc_dmabuf_ops; +- exp_info.size = buf->size; +- exp_info.flags = flags; +- exp_info.priv = buf; + + if (WARN_ON(!buf->vaddr)) + return NULL; + +- dbuf = dma_buf_export(&exp_info); ++ dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL); + if (IS_ERR(dbuf)) + return NULL; + +diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h +index 2f0b431..e287e66 100644 +--- a/include/linux/dma-buf.h ++++ b/include/linux/dma-buf.h +@@ -208,7 +208,12 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, + void dma_buf_detach(struct dma_buf *dmabuf, + struct dma_buf_attachment *dmabuf_attach); + +-struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info); ++struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, ++ size_t size, int flags, const char *, ++ struct reservation_object *); ++ ++#define dma_buf_export(priv, ops, size, flags, resv) \ ++ dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv) + + int dma_buf_fd(struct dma_buf *dmabuf, int flags); + struct dma_buf *dma_buf_get(int fd); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_drop_trace.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_drop_trace.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_drop_trace.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_drop_trace.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,86 @@ +diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c +index 914b50a..8429f18 100644 +--- a/drivers/media/common/videobuf2/videobuf2-core.c ++++ b/drivers/media/common/videobuf2/videobuf2-core.c +@@ -30,8 +30,6 @@ + #include + #include + +-#include +- + static int debug; + module_param(debug, int, 0644); + +@@ -933,7 +931,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) + atomic_dec(&q->owned_by_drv_count); + spin_unlock_irqrestore(&q->done_lock, flags); + +- trace_vb2_buf_done(q, vb); + + switch (state) { + case VB2_BUF_STATE_QUEUED: +@@ -1234,7 +1231,6 @@ static void __enqueue_in_driver(struct vb2_buffer *vb) + vb->state = VB2_BUF_STATE_ACTIVE; + atomic_inc(&q->owned_by_drv_count); + +- trace_vb2_buf_queue(q, vb); + + call_void_vb_qop(vb, buf_queue, vb); + } +@@ -1405,7 +1401,6 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) + if (pb) + call_void_bufop(q, copy_timestamp, vb, pb); + +- trace_vb2_qbuf(q, vb); + + /* + * If already streaming, give the buffer to driver for processing. +@@ -1621,7 +1616,6 @@ int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, + list_del(&vb->queued_entry); + q->queued_count--; + +- trace_vb2_dqbuf(q, vb); + + /* go back to dequeued state */ + __vb2_dqbuf(vb); +diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile +index b50c9cc..942c741 100644 +--- a/drivers/media/v4l2-core/Makefile ++++ b/drivers/media/v4l2-core/Makefile +@@ -12,9 +12,6 @@ ifeq ($(CONFIG_COMPAT),y) + videodev-objs += v4l2-compat-ioctl32.o + endif + #obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o +-ifeq ($(CONFIG_TRACEPOINTS),y) +- videodev-objs += v4l2-trace.o +-endif + videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o + + obj-$(CONFIG_VIDEO_V4L2) += videodev.o +diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c +index ce0d711..84cab64 100644 +--- a/drivers/media/v4l2-core/v4l2-ioctl.c ++++ b/drivers/media/v4l2-core/v4l2-ioctl.c +@@ -30,8 +30,6 @@ + #include + #include + +-#include +- + /* Zero out the end of the struct pointed to by p. Everything after, but + * not including, the specified field is cleared. */ + #define CLEAR_AFTER_FIELD(p, field) \ +@@ -2907,13 +2905,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, + goto out; + } + +- if (err == 0) { +- if (cmd == VIDIOC_DQBUF) +- trace_v4l2_dqbuf(video_devdata(file)->minor, parg); +- else if (cmd == VIDIOC_QBUF) +- trace_v4l2_qbuf(video_devdata(file)->minor, parg); +- } +- + if (has_array_args) { + *kernel_ptr = (void __force *)user_ptr; + if (copy_to_user(user_ptr, mbuf, array_size)) diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_fwnode.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_fwnode.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.0_fwnode.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.0_fwnode.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,22 @@ +diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c +index 7129e43..9ed59da 100644 +--- a/drivers/media/v4l2-core/v4l2-device.c ++++ b/drivers/media/v4l2-core/v4l2-device.c +@@ -131,7 +131,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) + * re-created by just probing the V4L2 driver. + */ + if (client && +- !client->dev.of_node && !client->dev.fwnode) ++ !client->dev.of_node) + i2c_unregister_device(client); + continue; + } +@@ -140,7 +140,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) + if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) { + struct spi_device *spi = v4l2_get_subdevdata(sd); + +- if (spi && !spi->dev.of_node && !spi->dev.fwnode) ++ if (spi && !spi->dev.of_node) + spi_unregister_device(spi); + continue; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_fault_page.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_fault_page.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_fault_page.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_fault_page.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,15 @@ +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index 09e86b3..bafd2ab 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -434,9 +434,8 @@ static void videobuf_vm_close(struct vm_area_struct *vma) + * now ...). Bounce buffers don't work very well for the data rates + * video capture has. + */ +-static vm_fault_t videobuf_vm_fault(struct vm_fault *vmf) ++static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) + { +- struct vm_area_struct *vma = vmf->vma; + struct page *page; + + dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n", diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_refcount.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_refcount.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_refcount.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_refcount.patch 2018-02-04 13:19:24.000000000 +0000 @@ -0,0 +1,274 @@ +diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c +index 73cc7a67a8bc..61e1803882d9 100644 +--- a/drivers/media/pci/cx88/cx88-cards.c ++++ b/drivers/media/pci/cx88/cx88-cards.c +@@ -3670,7 +3670,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) + if (!core) + return NULL; + +- refcount_set(&core->refcount, 1); ++ atomic_inc(&core->refcount); + core->pci_bus = pci->bus->number; + core->pci_slot = PCI_SLOT(pci->devfn); + core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT | +diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c +index 8bfa5b7ed91b..973a9cd4c635 100644 +--- a/drivers/media/pci/cx88/cx88-core.c ++++ b/drivers/media/pci/cx88/cx88-core.c +@@ -1052,7 +1052,7 @@ struct cx88_core *cx88_core_get(struct pci_dev *pci) + mutex_unlock(&devlist); + return NULL; + } +- refcount_inc(&core->refcount); ++ atomic_inc(&core->refcount); + mutex_unlock(&devlist); + return core; + } +@@ -1073,7 +1073,7 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) + release_mem_region(pci_resource_start(pci, 0), + pci_resource_len(pci, 0)); + +- if (!refcount_dec_and_test(&core->refcount)) ++ if (!atomic_dec_and_test(&core->refcount)) + return; + + mutex_lock(&devlist); +diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h +index 6777926f20f2..115414cf520f 100644 +--- a/drivers/media/pci/cx88/cx88.h ++++ b/drivers/media/pci/cx88/cx88.h +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + + #include + #include +@@ -340,7 +339,7 @@ struct cx8802_dev; + + struct cx88_core { + struct list_head devlist; +- refcount_t refcount; ++ atomic_t refcount; + + /* board name */ + int nr; +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/vcommon/videobuf2/videobuf2-dma-contig.c +index d29a07f3b048..fb6a177be461 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c +@@ -12,7 +12,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -35,7 +34,7 @@ struct vb2_dc_buf { + + /* MMAP related */ + struct vb2_vmarea_handler handler; +- refcount_t refcount; ++ atomic_t refcount; + struct sg_table *sgt_base; + + /* DMABUF related */ +@@ -87,7 +86,7 @@ static unsigned int vb2_dc_num_users(void *buf_priv) + { + struct vb2_dc_buf *buf = buf_priv; + +- return refcount_read(&buf->refcount); ++ return atomic_read(&buf->refcount); + } + + static void vb2_dc_prepare(void *buf_priv) +@@ -123,7 +122,7 @@ static void vb2_dc_put(void *buf_priv) + { + struct vb2_dc_buf *buf = buf_priv; + +- if (!refcount_dec_and_test(&buf->refcount)) ++ if (!atomic_dec_and_test(&buf->refcount)) + return; + + if (buf->sgt_base) { +@@ -171,7 +170,7 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, + buf->handler.put = vb2_dc_put; + buf->handler.arg = buf; + +- refcount_set(&buf->refcount, 1); ++ atomic_inc(&buf->refcount); + + return buf; + } +@@ -408,7 +407,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) + return NULL; + + /* dmabuf keeps reference to vb2 buffer */ +- refcount_inc(&buf->refcount); ++ atomic_inc(&buf->refcount); + + return dbuf; + } +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +index 29fde1a58a79..ecff8f492c4f 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +@@ -12,7 +12,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -47,7 +46,7 @@ struct vb2_dma_sg_buf { + struct sg_table *dma_sgt; + size_t size; + unsigned int num_pages; +- refcount_t refcount; ++ atomic_t refcount; + struct vb2_vmarea_handler handler; + + struct dma_buf_attachment *db_attach; +@@ -151,7 +150,7 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, + buf->handler.put = vb2_dma_sg_put; + buf->handler.arg = buf; + +- refcount_set(&buf->refcount, 1); ++ atomic_inc(&buf->refcount); + + dprintk(1, "%s: Allocated buffer of %d pages\n", + __func__, buf->num_pages); +@@ -177,7 +176,7 @@ static void vb2_dma_sg_put(void *buf_priv) + struct sg_table *sgt = &buf->sg_table; + int i = buf->num_pages; + +- if (refcount_dec_and_test(&buf->refcount)) { ++ if (atomic_dec_and_test(&buf->refcount)) { + dprintk(1, "%s: Freeing buffer of %d pages\n", __func__, + buf->num_pages); + dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +@@ -321,7 +320,7 @@ static unsigned int vb2_dma_sg_num_users(void *buf_priv) + { + struct vb2_dma_sg_buf *buf = buf_priv; + +- return refcount_read(&buf->refcount); ++ return atomic_read(&buf->refcount); + } + + static int vb2_dma_sg_mmap(void *buf_priv, struct vm_area_struct *vma) +@@ -531,7 +530,7 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags + return NULL; + + /* dmabuf keeps reference to vb2 buffer */ +- refcount_inc(&buf->refcount); ++ atomic_inc(&buf->refcount); + + return dbuf; + } +diff --git a/drivers/media/common/videobuf2/videobuf2-memops.c b/drivers/media/common/videobuf2/videobuf2-memops.c +index 4bb8424114ce..1cd322e939c7 100644 +--- a/drivers/media/common/videobuf2/videobuf2-memops.c ++++ b/drivers/media/common/videobuf2/videobuf2-memops.c +@@ -96,10 +96,10 @@ static void vb2_common_vm_open(struct vm_area_struct *vma) + struct vb2_vmarea_handler *h = vma->vm_private_data; + + pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n", +- __func__, h, refcount_read(h->refcount), vma->vm_start, ++ __func__, h, atomic_read(h->refcount), vma->vm_start, + vma->vm_end); + +- refcount_inc(h->refcount); ++ atomic_inc(h->refcount); + } + + /** +@@ -114,7 +114,7 @@ static void vb2_common_vm_close(struct vm_area_struct *vma) + struct vb2_vmarea_handler *h = vma->vm_private_data; + + pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n", +- __func__, h, refcount_read(h->refcount), vma->vm_start, ++ __func__, h, atomic_read(h->refcount), vma->vm_start, + vma->vm_end); + + h->put(h->arg); +diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +index f83253a233ca..3f778147cdef 100644 +--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c ++++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +@@ -13,7 +13,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -27,7 +26,7 @@ struct vb2_vmalloc_buf { + struct frame_vector *vec; + enum dma_data_direction dma_dir; + unsigned long size; +- refcount_t refcount; ++ atomic_t refcount; + struct vb2_vmarea_handler handler; + struct dma_buf *dbuf; + }; +@@ -57,7 +56,7 @@ static void *vb2_vmalloc_alloc(struct device *dev, unsigned long attrs, + return ERR_PTR(-ENOMEM); + } + +- refcount_set(&buf->refcount, 1); ++ atomic_inc(&buf->refcount); + return buf; + } + +@@ -65,7 +64,7 @@ static void vb2_vmalloc_put(void *buf_priv) + { + struct vb2_vmalloc_buf *buf = buf_priv; + +- if (refcount_dec_and_test(&buf->refcount)) { ++ if (atomic_dec_and_test(&buf->refcount)) { + vfree(buf->vaddr); + kfree(buf); + } +@@ -162,7 +161,7 @@ static void *vb2_vmalloc_vaddr(void *buf_priv) + static unsigned int vb2_vmalloc_num_users(void *buf_priv) + { + struct vb2_vmalloc_buf *buf = buf_priv; +- return refcount_read(&buf->refcount); ++ return atomic_read(&buf->refcount); + } + + static int vb2_vmalloc_mmap(void *buf_priv, struct vm_area_struct *vma) +@@ -369,7 +368,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag + return NULL; + + /* dmabuf keeps reference to vb2 buffer */ +- refcount_inc(&buf->refcount); ++ atomic_inc(&buf->refcount); + + return dbuf; + } +diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h +index a6ed091b79ce..36565c7acb54 100644 +--- a/include/media/videobuf2-memops.h ++++ b/include/media/videobuf2-memops.h +@@ -16,7 +16,6 @@ + + #include + #include +-#include + + /** + * struct vb2_vmarea_handler - common vma refcount tracking handler +@@ -26,7 +25,7 @@ + * @arg: argument for @put callback + */ + struct vb2_vmarea_handler { +- refcount_t *refcount; ++ atomic_t *refcount; + void (*put)(void *arg); + void *arg; + }; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_sched_signal.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_sched_signal.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.10_sched_signal.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.10_sched_signal.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,271 @@ +diff --git a/drivers/media/cec/cec-pin-error-inj.c b/drivers/media/cec/cec-pin-error-inj.c +index 7132a27..93ccdc7 100644 +--- a/drivers/media/cec/cec-pin-error-inj.c ++++ b/drivers/media/cec/cec-pin-error-inj.c +@@ -5,7 +5,6 @@ + + #include + #include +-#include + + #include + #include "cec-pin-priv.h" +diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c +index 6e31142..0f31537 100644 +--- a/drivers/media/cec/cec-pin.c ++++ b/drivers/media/cec/cec-pin.c +@@ -5,7 +5,6 @@ + + #include + #include +-#include + + #include + #include "cec-pin-priv.h" +diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c +index b2bc855..ca29bb7 100644 +--- a/drivers/media/dvb-core/dvb_ca_en50221.c ++++ b/drivers/media/dvb-core/dvb_ca_en50221.c +@@ -36,7 +36,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include +diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c +index 9c4e466..f5eb4ee 100644 +--- a/drivers/media/dvb-core/dvb_demux.c ++++ b/drivers/media/dvb-core/dvb_demux.c +@@ -20,7 +20,7 @@ + #undef pr_fmt + #define pr_fmt(fmt) "dvb_demux: " fmt + +-#include ++#include + #include + #include + #include +diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c +index 3a4abdb..32ff061 100644 +--- a/drivers/media/dvb-core/dvb_frontend.c ++++ b/drivers/media/dvb-core/dvb_frontend.c +@@ -30,7 +30,7 @@ + + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h +index 0b707fa..dfdf65d 100644 +--- a/drivers/media/pci/cx18/cx18-driver.h ++++ b/drivers/media/pci/cx18/cx18-driver.h +@@ -24,7 +24,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c +index 6b2ffdc..01c2292 100644 +--- a/drivers/media/pci/ivtv/ivtv-driver.c ++++ b/drivers/media/pci/ivtv/ivtv-driver.c +@@ -59,7 +59,6 @@ + #include + #include + #include "tuner-xc2028.h" +-#include + + /* If you have already X v4l cards, then set this to X. This way + the device numbers stay matched. Example: you have a WinTV card +diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h +index 6b099da..81f3c19 100644 +--- a/drivers/media/pci/ivtv/ivtv-driver.h ++++ b/drivers/media/pci/ivtv/ivtv-driver.h +@@ -39,38 +39,37 @@ + * using information provided by Jiun-Kuei Jung @ AVerMedia. + */ + +-#include +-#include ++#include + #include +-#include ++#include + #include +-#include +-#include +-#include + #include + #include ++#include ++#include ++#include ++#include ++#include + #include +-#include ++#include ++#include + #include ++#include + #include +-#include +-#include ++#include + #include ++#include + #include +-#include ++#include + +-#include +-#include ++#include ++#include ++#include + #include +-#include + #include + #include + #include +-#include +-#include +-#include +- +-#include ++#include + + /* Memory layout */ + #define IVTV_ENCODER_OFFSET 0x00000000 +diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c +index 5708f69..e306544 100644 +--- a/drivers/media/pci/pt1/pt1.c ++++ b/drivers/media/pci/pt1/pt1.c +@@ -19,7 +19,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c +index 90273b4..e1cdc71 100644 +--- a/drivers/media/pci/pt3/pt3.c ++++ b/drivers/media/pci/pt3/pt3.c +@@ -12,7 +12,6 @@ + #include + #include + #include +-#include + + #include + #include +diff --git a/drivers/media/pci/solo6x10/solo6x10-i2c.c b/drivers/media/pci/solo6x10/solo6x10-i2c.c +index 89f2f2a..0456f2d 100644 +--- a/drivers/media/pci/solo6x10/solo6x10-i2c.c ++++ b/drivers/media/pci/solo6x10/solo6x10-i2c.c +@@ -27,7 +27,6 @@ + * thread context, ACK the interrupt, and move on. -- BenC */ + + #include +-#include + + #include "solo6x10.h" + +diff --git a/drivers/media/platform/vivid/vivid-radio-rx.c b/drivers/media/platform/vivid/vivid-radio-rx.c +index 1f86d7d..854325d 100644 +--- a/drivers/media/platform/vivid/vivid-radio-rx.c ++++ b/drivers/media/platform/vivid/vivid-radio-rx.c +@@ -10,8 +10,6 @@ + #include + #include + #include +-#include +- + #include + #include + #include +diff --git a/drivers/media/platform/vivid/vivid-radio-tx.c b/drivers/media/platform/vivid/vivid-radio-tx.c +index 1a3749b..89a1ee6 100644 +--- a/drivers/media/platform/vivid/vivid-radio-tx.c ++++ b/drivers/media/platform/vivid/vivid-radio-tx.c +@@ -7,7 +7,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/drivers/media/usb/cpia2/cpia2_core.c b/drivers/media/usb/cpia2/cpia2_core.c +index 3dfbb54..30784fa 100644 +--- a/drivers/media/usb/cpia2/cpia2_core.c ++++ b/drivers/media/usb/cpia2/cpia2_core.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + + #define FIRMWARE "cpia2/stv0672_vp4.bin" + MODULE_FIRMWARE(FIRMWARE); +diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c +index 67afabf..272a8bc 100644 +--- a/drivers/media/usb/gspca/cpia1.c ++++ b/drivers/media/usb/gspca/cpia1.c +@@ -28,8 +28,6 @@ + #define MODULE_NAME "cpia1" + + #include +-#include +- + #include "gspca.h" + + MODULE_AUTHOR("Hans de Goede "); +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index 2e5c346..09e86b3 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -21,7 +21,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c +index 40adcee..671907a 100644 +--- a/drivers/staging/media/zoran/zoran_device.c ++++ b/drivers/staging/media/zoran/zoran_device.c +@@ -28,7 +28,6 @@ + #include + #include + #include +-#include + + #include + #include +diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h +index a7b3f7c..a63034b 100644 +--- a/include/media/v4l2-ioctl.h ++++ b/include/media/v4l2-ioctl.h +@@ -13,7 +13,6 @@ + #include + #include + #include +-#include + #include /* need __user */ + #include + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.12_revert_solo6x10_copykerneluser.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.12_revert_solo6x10_copykerneluser.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.12_revert_solo6x10_copykerneluser.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.12_revert_solo6x10_copykerneluser.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,77 @@ +commit bbf3d164ec2723f090533c14ec1dc166eaca46f8 +Author: Daniel Scheller +Date: Fri Jul 21 20:41:49 2017 +0200 + + Revert "[media] solo6x10: Convert to the new PCM ops" + + This reverts commit 1facf21e8b903524b34f09c39a7d27b4b71a07f7. + +Update by Jasmin Jessich + Revert also commit 43e69758e6c0cc05adc4d39316f65abb120a00a0. + +diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c +index 2ac33b5..f9717ed 100644 +--- a/drivers/media/pci/solo6x10/solo6x10-g723.c ++++ b/drivers/media/pci/solo6x10/solo6x10-g723.c +@@ -223,9 +223,9 @@ static snd_pcm_uframes_t snd_solo_pcm_pointer(struct snd_pcm_substream *ss) + return idx * G723_FRAMES_PER_PAGE; + } + +-static int snd_solo_pcm_copy_user(struct snd_pcm_substream *ss, int channel, +- unsigned long pos, void __user *dst, +- unsigned long count) ++static int snd_solo_pcm_copy(struct snd_pcm_substream *ss, int channel, ++ snd_pcm_uframes_t pos, void __user *dst, ++ snd_pcm_uframes_t count) + { + struct solo_snd_pcm *solo_pcm = snd_pcm_substream_chip(ss); + struct solo_dev *solo_dev = solo_pcm->solo_dev; +@@ -242,35 +242,11 @@ static int snd_solo_pcm_copy_user(struct snd_pcm_substream *ss, int channel, + if (err) + return err; + +- if (copy_to_user(dst, solo_pcm->g723_buf, G723_PERIOD_BYTES)) +- return -EFAULT; +- dst += G723_PERIOD_BYTES; +- } +- +- return 0; +-} ++ err = copy_to_user(dst + (i * G723_PERIOD_BYTES), ++ solo_pcm->g723_buf, G723_PERIOD_BYTES); + +-static int snd_solo_pcm_copy_kernel(struct snd_pcm_substream *ss, int channel, +- unsigned long pos, void *dst, +- unsigned long count) +-{ +- struct solo_snd_pcm *solo_pcm = snd_pcm_substream_chip(ss); +- struct solo_dev *solo_dev = solo_pcm->solo_dev; +- int err, i; +- +- for (i = 0; i < (count / G723_FRAMES_PER_PAGE); i++) { +- int page = (pos / G723_FRAMES_PER_PAGE) + i; +- +- err = solo_p2m_dma_t(solo_dev, 0, solo_pcm->g723_dma, +- SOLO_G723_EXT_ADDR(solo_dev) + +- (page * G723_PERIOD_BLOCK) + +- (ss->number * G723_PERIOD_BYTES), +- G723_PERIOD_BYTES, 0, 0); + if (err) +- return err; +- +- memcpy(dst, solo_pcm->g723_buf, G723_PERIOD_BYTES); +- dst += G723_PERIOD_BYTES; ++ return -EFAULT; + } + + return 0; +@@ -285,8 +261,7 @@ static const struct snd_pcm_ops snd_solo_pcm_ops = { + .prepare = snd_solo_pcm_prepare, + .trigger = snd_solo_pcm_trigger, + .pointer = snd_solo_pcm_pointer, +- .copy_user = snd_solo_pcm_copy_user, +- .copy_kernel = snd_solo_pcm_copy_kernel, ++ .copy = snd_solo_pcm_copy, + }; + + static int snd_solo_capture_volume_info(struct snd_kcontrol *kcontrol, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.13_remove_nospec_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.13_remove_nospec_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.13_remove_nospec_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.13_remove_nospec_h.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c +index b2bc855..1cf5c6f3 100644 +--- a/drivers/media/dvb-core/dvb_ca_en50221.c ++++ b/drivers/media/dvb-core/dvb_ca_en50221.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_compiler_h.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_compiler_h.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_compiler_h.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_compiler_h.patch 2018-02-04 13:15:20.000000000 +0000 @@ -0,0 +1,11 @@ +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index 2272ded..744334e 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -1,5 +1,5 @@ + /* SPDX-License-Identifier: GPL-2.0 */ +-#ifndef __LINUX_COMPILER_TYPES_H ++#if (!defined(__LINUX_COMPILER_TYPES_H) && !defined (__LINUX_COMPILER_H)) + #error "Please don't include directly, include instead." + #endif + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_module_param_call.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_module_param_call.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_module_param_call.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_module_param_call.patch 2018-02-04 13:15:20.000000000 +0000 @@ -0,0 +1,41 @@ +diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c +index 7fb3f07bf022..c74c23cf8ced 100644 +--- a/drivers/media/pci/tw686x/tw686x-core.c ++++ b/drivers/media/pci/tw686x/tw686x-core.c +@@ -72,12 +72,12 @@ static const char *dma_mode_name(unsigned int mode) + } + } + +-static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp) ++static int tw686x_dma_mode_get(char *buffer, struct kernel_param *kp) + { + return sprintf(buffer, "%s", dma_mode_name(dma_mode)); + } + +-static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp) ++static int tw686x_dma_mode_set(const char *val, struct kernel_param *kp) + { + if (!strcasecmp(val, dma_mode_name(TW686X_DMA_MODE_MEMCPY))) + dma_mode = TW686X_DMA_MODE_MEMCPY; +diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c +index 07e427d36516..113130b6b2d6 100644 +--- a/drivers/media/usb/uvc/uvc_driver.c ++++ b/drivers/media/usb/uvc/uvc_driver.c +@@ -2235,7 +2235,7 @@ static int uvc_reset_resume(struct usb_interface *intf) + * Module parameters + */ + +-static int uvc_clock_param_get(char *buffer, const struct kernel_param *kp) ++static int uvc_clock_param_get(char *buffer, struct kernel_param *kp) + { + if (uvc_clock_param == CLOCK_MONOTONIC) + return sprintf(buffer, "CLOCK_MONOTONIC"); +@@ -2243,7 +2243,7 @@ static int uvc_clock_param_get(char *buffer, const struct kernel_param *kp) + return sprintf(buffer, "CLOCK_REALTIME"); + } + +-static int uvc_clock_param_set(const char *val, const struct kernel_param *kp) ++static int uvc_clock_param_set(const char *val, struct kernel_param *kp) + { + if (strncasecmp(val, "clock_", strlen("clock_")) == 0) + val += strlen("clock_"); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_saa7146_timer_cast.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_saa7146_timer_cast.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.14_saa7146_timer_cast.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.14_saa7146_timer_cast.patch 2018-02-04 13:15:20.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c +index e1d369b976ed..ce8d78c137f0 100644 +--- a/drivers/media/common/saa7146/saa7146_vbi.c ++++ b/drivers/media/common/saa7146/saa7146_vbi.c +@@ -402,7 +402,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file) + sizeof(struct saa7146_buf), + file, &dev->v4l2_lock); + +- vv->vbi_read_timeout.function = vbi_read_timeout; ++ vv->vbi_read_timeout.function = (TIMER_FUNC_TYPE)vbi_read_timeout; + vv->vbi_read_timeout_file = file; + + /* initialize the brs */ diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.1_drop_fwnode.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.1_drop_fwnode.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.1_drop_fwnode.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.1_drop_fwnode.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,37 @@ +diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile +index 098ad5fd5231..c70b8d7a02b5 100644 +--- a/drivers/media/v4l2-core/Makefile ++++ b/drivers/media/v4l2-core/Makefile +@@ -10,7 +10,7 @@ videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \ + ifeq ($(CONFIG_COMPAT),y) + videodev-objs += v4l2-compat-ioctl32.o + endif +-obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o ++#obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o + ifeq ($(CONFIG_TRACEPOINTS),y) + videodev-objs += vb2-trace.o v4l2-trace.o + endif +diff --git a/include/media/media-entity.h b/include/media/media-entity.h +index 754182d29668..03be03031df2 100644 +--- a/include/media/media-entity.h ++++ b/include/media/media-entity.h +@@ -21,7 +21,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h +index ecc1233a873e..af0a10f15d1d 100644 +--- a/include/media/v4l2-fwnode.h ++++ b/include/media/v4l2-fwnode.h +@@ -18,7 +18,6 @@ + #define _V4L2_FWNODE_H + + #include +-#include + #include + #include + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.1_pat_enabled.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.1_pat_enabled.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.1_pat_enabled.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.1_pat_enabled.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,20 @@ +diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c +index 8b95eef..d3372ed 100644 +--- a/drivers/media/pci/ivtv/ivtvfb.c ++++ b/drivers/media/pci/ivtv/ivtvfb.c +@@ -1174,11 +1174,13 @@ static int ivtvfb_init_card(struct ivtv *itv) + int rc; + + #ifdef CONFIG_X86_64 +- if (pat_enabled()) { +- pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n"); ++#ifdef CONFIG_X86_PAT ++ if (WARN(pat_enabled, ++ "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) { + return -ENODEV; + } + #endif ++#endif + + if (itv->osd_info) { + IVTVFB_ERR("Card %d already initialised\n", ivtvfb_card_id); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.2_atomic64.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.2_atomic64.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.2_atomic64.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.2_atomic64.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,49 @@ +diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c +index 2ab8a2b..c76da2e 100644 +--- a/drivers/media/rc/rc-ir-raw.c ++++ b/drivers/media/rc/rc-ir-raw.c +@@ -16,7 +16,8 @@ static LIST_HEAD(ir_raw_client_list); + /* Used to handle IR raw handler extensions */ + static DEFINE_MUTEX(ir_raw_handler_lock); + static LIST_HEAD(ir_raw_handler_list); +-static atomic64_t available_protocols = ATOMIC64_INIT(0); ++static DEFINE_MUTEX(available_protocols_lock); ++static u64 available_protocols; + + static int ir_raw_event_thread(void *data) + { +@@ -228,7 +229,11 @@ EXPORT_SYMBOL_GPL(ir_raw_event_handle); + u64 + ir_raw_get_allowed_protocols(void) + { +- return atomic64_read(&available_protocols); ++ u64 protocols; ++ mutex_lock(&available_protocols_lock); ++ protocols = available_protocols; ++ mutex_unlock(&available_protocols_lock); ++ return protocols; + } + + static int change_protocol(struct rc_dev *dev, u64 *rc_proto) +@@ -673,7 +678,9 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler) + { + mutex_lock(&ir_raw_handler_lock); + list_add_tail(&ir_raw_handler->list, &ir_raw_handler_list); +- atomic64_or(ir_raw_handler->protocols, &available_protocols); ++ mutex_lock(&available_protocols_lock); ++ available_protocols |= ir_raw_handler->protocols; ++ mutex_unlock(&available_protocols_lock); + mutex_unlock(&ir_raw_handler_lock); + + return 0; +@@ -693,7 +700,9 @@ void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) + ir_raw_handler->raw_unregister(raw->dev); + ir_raw_disable_protocols(raw->dev, protocols); + } +- atomic64_andnot(protocols, &available_protocols); ++ mutex_lock(&available_protocols_lock); ++ available_protocols &= ~protocols; ++ mutex_unlock(&available_protocols_lock); + mutex_unlock(&ir_raw_handler_lock); + } + EXPORT_SYMBOL(ir_raw_handler_unregister); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.2_frame_vector.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.2_frame_vector.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.2_frame_vector.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.2_frame_vector.patch 2018-02-11 00:44:30.000000000 +0000 @@ -0,0 +1,250 @@ +From fe6a2319288c1f4a66b4ffa6c8e9bf4b39349d11 Mon Sep 17 00:00:00 2001 +From: Hans Verkuil +Date: Mon, 21 Nov 2016 10:21:30 +0100 +Subject: [PATCH] Add frame_vector.c + +Signed-off-by: Hans Verkuil +--- + mm/frame_vector.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 230 insertions(+) + create mode 100644 mm/frame_vec.c + +diff --git a/mm/frame_vector.c b/mm/frame_vector.c +new file mode 100644 +index 0000000..cdabcb9 +--- /dev/null ++++ b/mm/frame_vector.c +@@ -0,0 +1,230 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * get_vaddr_frames() - map virtual addresses to pfns ++ * @start: starting user address ++ * @nr_frames: number of pages / pfns from start to map ++ * @write: whether pages will be written to by the caller ++ * @force: whether to force write access even if user mapping is ++ * readonly. See description of the same argument of ++ get_user_pages(). ++ * @vec: structure which receives pages / pfns of the addresses mapped. ++ * It should have space for at least nr_frames entries. ++ * ++ * This function maps virtual addresses from @start and fills @vec structure ++ * with page frame numbers or page pointers to corresponding pages (choice ++ * depends on the type of the vma underlying the virtual address). If @start ++ * belongs to a normal vma, the function grabs reference to each of the pages ++ * to pin them in memory. If @start belongs to VM_IO | VM_PFNMAP vma, we don't ++ * touch page structures and the caller must make sure pfns aren't reused for ++ * anything else while he is using them. ++ * ++ * The function returns number of pages mapped which may be less than ++ * @nr_frames. In particular we stop mapping if there are more vmas of ++ * different type underlying the specified range of virtual addresses. ++ * When the function isn't able to map a single page, it returns error. ++ * ++ * This function takes care of grabbing mmap_sem as necessary. ++ */ ++int get_vaddr_frames(unsigned long start, unsigned int nr_frames, ++ bool write, bool force, struct frame_vector *vec) ++{ ++ struct mm_struct *mm = current->mm; ++ struct vm_area_struct *vma; ++ int ret = 0; ++ int err; ++ int locked; ++ ++ if (nr_frames == 0) ++ return 0; ++ ++ if (WARN_ON_ONCE(nr_frames > vec->nr_allocated)) ++ nr_frames = vec->nr_allocated; ++ ++ down_read(&mm->mmap_sem); ++ locked = 1; ++ vma = find_vma_intersection(mm, start, start + 1); ++ if (!vma) { ++ ret = -EFAULT; ++ goto out; ++ } ++ if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { ++ vec->got_ref = true; ++ vec->is_pfns = false; ++ ret = get_user_pages_locked(current, mm, start, nr_frames, ++ write, force, (struct page **)(vec->ptrs), &locked); ++ goto out; ++ } ++ ++ vec->got_ref = false; ++ vec->is_pfns = true; ++ do { ++ unsigned long *nums = frame_vector_pfns(vec); ++ ++ while (ret < nr_frames && start + PAGE_SIZE <= vma->vm_end) { ++ err = follow_pfn(vma, start, &nums[ret]); ++ if (err) { ++ if (ret == 0) ++ ret = err; ++ goto out; ++ } ++ start += PAGE_SIZE; ++ ret++; ++ } ++ /* ++ * We stop if we have enough pages or if VMA doesn't completely ++ * cover the tail page. ++ */ ++ if (ret >= nr_frames || start < vma->vm_end) ++ break; ++ vma = find_vma_intersection(mm, start, start + 1); ++ } while (vma && vma->vm_flags & (VM_IO | VM_PFNMAP)); ++out: ++ if (locked) ++ up_read(&mm->mmap_sem); ++ if (!ret) ++ ret = -EFAULT; ++ if (ret > 0) ++ vec->nr_frames = ret; ++ return ret; ++} ++EXPORT_SYMBOL(get_vaddr_frames); ++ ++/** ++ * put_vaddr_frames() - drop references to pages if get_vaddr_frames() acquired ++ * them ++ * @vec: frame vector to put ++ * ++ * Drop references to pages if get_vaddr_frames() acquired them. We also ++ * invalidate the frame vector so that it is prepared for the next call into ++ * get_vaddr_frames(). ++ */ ++void put_vaddr_frames(struct frame_vector *vec) ++{ ++ int i; ++ struct page **pages; ++ ++ if (!vec->got_ref) ++ goto out; ++ pages = frame_vector_pages(vec); ++ /* ++ * frame_vector_pages() might needed to do a conversion when ++ * get_vaddr_frames() got pages but vec was later converted to pfns. ++ * But it shouldn't really fail to convert pfns back... ++ */ ++ if (WARN_ON(IS_ERR(pages))) ++ goto out; ++ for (i = 0; i < vec->nr_frames; i++) ++ put_page(pages[i]); ++ vec->got_ref = false; ++out: ++ vec->nr_frames = 0; ++} ++EXPORT_SYMBOL(put_vaddr_frames); ++ ++/** ++ * frame_vector_to_pages - convert frame vector to contain page pointers ++ * @vec: frame vector to convert ++ * ++ * Convert @vec to contain array of page pointers. If the conversion is ++ * successful, return 0. Otherwise return an error. Note that we do not grab ++ * page references for the page structures. ++ */ ++int frame_vector_to_pages(struct frame_vector *vec) ++{ ++ int i; ++ unsigned long *nums; ++ struct page **pages; ++ ++ if (!vec->is_pfns) ++ return 0; ++ nums = frame_vector_pfns(vec); ++ for (i = 0; i < vec->nr_frames; i++) ++ if (!pfn_valid(nums[i])) ++ return -EINVAL; ++ pages = (struct page **)nums; ++ for (i = 0; i < vec->nr_frames; i++) ++ pages[i] = pfn_to_page(nums[i]); ++ vec->is_pfns = false; ++ return 0; ++} ++EXPORT_SYMBOL(frame_vector_to_pages); ++ ++/** ++ * frame_vector_to_pfns - convert frame vector to contain pfns ++ * @vec: frame vector to convert ++ * ++ * Convert @vec to contain array of pfns. ++ */ ++void frame_vector_to_pfns(struct frame_vector *vec) ++{ ++ int i; ++ unsigned long *nums; ++ struct page **pages; ++ ++ if (vec->is_pfns) ++ return; ++ pages = (struct page **)(vec->ptrs); ++ nums = (unsigned long *)pages; ++ for (i = 0; i < vec->nr_frames; i++) ++ nums[i] = page_to_pfn(pages[i]); ++ vec->is_pfns = true; ++} ++EXPORT_SYMBOL(frame_vector_to_pfns); ++ ++/** ++ * frame_vector_create() - allocate & initialize structure for pinned pfns ++ * @nr_frames: number of pfns slots we should reserve ++ * ++ * Allocate and initialize struct pinned_pfns to be able to hold @nr_pfns ++ * pfns. ++ */ ++struct frame_vector *frame_vector_create(unsigned int nr_frames) ++{ ++ struct frame_vector *vec; ++ int size = sizeof(struct frame_vector) + sizeof(void *) * nr_frames; ++ ++ if (WARN_ON_ONCE(nr_frames == 0)) ++ return NULL; ++ /* ++ * This is absurdly high. It's here just to avoid strange effects when ++ * arithmetics overflows. ++ */ ++ if (WARN_ON_ONCE(nr_frames > INT_MAX / sizeof(void *) / 2)) ++ return NULL; ++ /* ++ * Avoid higher order allocations, use vmalloc instead. It should ++ * be rare anyway. ++ */ ++ if (size <= PAGE_SIZE) ++ vec = kmalloc(size, GFP_KERNEL); ++ else ++ vec = vmalloc(size); ++ if (!vec) ++ return NULL; ++ vec->nr_allocated = nr_frames; ++ vec->nr_frames = 0; ++ return vec; ++} ++EXPORT_SYMBOL(frame_vector_create); ++ ++/** ++ * frame_vector_destroy() - free memory allocated to carry frame vector ++ * @vec: Frame vector to free ++ * ++ * Free structure allocated by frame_vector_create() to carry frames. ++ */ ++void frame_vector_destroy(struct frame_vector *vec) ++{ ++ /* Make sure put_vaddr_frames() got called properly... */ ++ VM_BUG_ON(vec->nr_frames > 0); ++ kvfree(vec); ++} ++EXPORT_SYMBOL(frame_vector_destroy); +-- +2.10.1 + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.3_add_autorepeat_handling.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.3_add_autorepeat_handling.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.3_add_autorepeat_handling.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.3_add_autorepeat_handling.patch 2018-02-04 13:15:20.000000000 +0000 @@ -0,0 +1,118 @@ +diff --git a/drivers/media/pci/ttpci/av7110.h b/drivers/media/pci/ttpci/av7110.h +index cbb150d6cbb1..cd09fd6e6548 100644 +--- a/drivers/media/pci/ttpci/av7110.h ++++ b/drivers/media/pci/ttpci/av7110.h +@@ -94,7 +94,7 @@ struct infrared { + u8 inversion; + u16 last_key; + u16 last_toggle; +- bool keypressed; ++ u8 delay_timer_finished; + }; + + +diff --git a/drivers/media/pci/ttpci/av7110_ir.c b/drivers/media/pci/ttpci/av7110_ir.c +index ee414803e6b5..ca05198de2c2 100644 +--- a/drivers/media/pci/ttpci/av7110_ir.c ++++ b/drivers/media/pci/ttpci/av7110_ir.c +@@ -84,16 +84,15 @@ static u16 default_key_map [256] = { + + + /* key-up timer */ +-static void av7110_emit_keyup(struct timer_list *t) ++static void av7110_emit_keyup(unsigned long parm) + { +- struct infrared *ir = from_timer(ir, t, keyup_timer); ++ struct infrared *ir = (struct infrared *) parm; + +- if (!ir || !ir->keypressed) ++ if (!ir || !test_bit(ir->last_key, ir->input_dev->key)) + return; + + input_report_key(ir->input_dev, ir->last_key, 0); + input_sync(ir->input_dev); +- ir->keypressed = false; + } + + +@@ -153,18 +152,29 @@ static void av7110_emit_key(unsigned long parm) + return; + } + +- if (ir->keypressed && +- (ir->last_key != keycode || toggle != ir->last_toggle)) +- input_event(ir->input_dev, EV_KEY, ir->last_key, 0); +- +- input_event(ir->input_dev, EV_KEY, keycode, 1); +- input_sync(ir->input_dev); ++ if (timer_pending(&ir->keyup_timer)) { ++ del_timer(&ir->keyup_timer); ++ if (ir->last_key != keycode || toggle != ir->last_toggle) { ++ ir->delay_timer_finished = 0; ++ input_event(ir->input_dev, EV_KEY, ir->last_key, 0); ++ input_event(ir->input_dev, EV_KEY, keycode, 1); ++ input_sync(ir->input_dev); ++ } else if (ir->delay_timer_finished) { ++ input_event(ir->input_dev, EV_KEY, keycode, 2); ++ input_sync(ir->input_dev); ++ } ++ } else { ++ ir->delay_timer_finished = 0; ++ input_event(ir->input_dev, EV_KEY, keycode, 1); ++ input_sync(ir->input_dev); ++ } + +- ir->keypressed = true; + ir->last_key = keycode; + ir->last_toggle = toggle; + +- mod_timer(&ir->keyup_timer, jiffies + UP_TIMEOUT); ++ ir->keyup_timer.expires = jiffies + UP_TIMEOUT; ++ add_timer(&ir->keyup_timer); ++ + } + + +@@ -194,6 +204,16 @@ static void input_register_keys(struct infrared *ir) + ir->input_dev->keycodemax = ARRAY_SIZE(ir->key_map); + } + ++ ++/* called by the input driver after rep[REP_DELAY] ms */ ++static void input_repeat_key(unsigned long parm) ++{ ++ struct infrared *ir = (struct infrared *) parm; ++ ++ ir->delay_timer_finished = 1; ++} ++ ++ + /* check for configuration changes */ + int av7110_check_ir_config(struct av7110 *av7110, int force) + { +@@ -313,7 +333,8 @@ int av7110_ir_init(struct av7110 *av7110) + av_list[av_cnt++] = av7110; + av7110_check_ir_config(av7110, true); + +- timer_setup(&av7110->ir.keyup_timer, av7110_emit_keyup, 0); ++ setup_timer(&av7110->ir.keyup_timer, av7110_emit_keyup, ++ (unsigned long)&av7110->ir); + + input_dev = input_allocate_device(); + if (!input_dev) +@@ -344,13 +365,8 @@ int av7110_ir_init(struct av7110 *av7110) + input_free_device(input_dev); + return err; + } +- +- /* +- * Input core's default autorepeat is 33 cps with 250 msec +- * delay, let's adjust to numbers more suitable for remote +- * control. +- */ +- input_enable_softrepeat(input_dev, 250, 125); ++ input_dev->timer.function = input_repeat_key; ++ input_dev->timer.data = (unsigned long) &av7110->ir; + + if (av_cnt == 1) { + e = proc_create("av7110_ir", S_IWUSR, NULL, &av7110_ir_proc_fops); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.3_bt87x_const_fix.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.3_bt87x_const_fix.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.3_bt87x_const_fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.3_bt87x_const_fix.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,20 @@ +diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c +index d8ade87..eb3d306 100644 +--- a/sound/pci/bt87x.c ++++ b/sound/pci/bt87x.c +@@ -401,13 +401,13 @@ static int snd_bt87x_set_digital_hw(struct snd_bt87x *chip, struct snd_pcm_runti + + static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_runtime *runtime) + { +- static const struct snd_ratnum analog_clock = { ++ static struct snd_ratnum analog_clock = { + .num = ANALOG_CLOCK, + .den_min = CLOCK_DIV_MIN, + .den_max = CLOCK_DIV_MAX, + .den_step = 1 + }; +- static const struct snd_pcm_hw_constraint_ratnums constraint_rates = { ++ static struct snd_pcm_hw_constraint_ratnums constraint_rates = { + .nrats = 1, + .rats = &analog_clock + }; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.4_gpio_chip_parent.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.4_gpio_chip_parent.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.4_gpio_chip_parent.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.4_gpio_chip_parent.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c +index 95267c6..7c378de 100644 +--- a/drivers/media/dvb-frontends/cxd2820r_core.c ++++ b/drivers/media/dvb-frontends/cxd2820r_core.c +@@ -662,7 +662,7 @@ static int cxd2820r_probe(struct i2c_client *client, + #ifdef CONFIG_GPIOLIB + /* Add GPIOs */ + priv->gpio_chip.label = KBUILD_MODNAME; +- priv->gpio_chip.parent = &client->dev; ++ priv->gpio_chip.dev = &client->dev; + priv->gpio_chip.owner = THIS_MODULE; + priv->gpio_chip.direction_output = cxd2820r_gpio_direction_output; + priv->gpio_chip.set = cxd2820r_gpio_set; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_copy_to_user_warning.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_copy_to_user_warning.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_copy_to_user_warning.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_copy_to_user_warning.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c +index 5b82e63..272473c 100644 +--- a/drivers/media/radio/radio-cadet.c ++++ b/drivers/media/radio/radio-cadet.c +@@ -344,7 +344,7 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo + readbuf[i++] = dev->rdsbuf[dev->rdsout++]; + mutex_unlock(&dev->lock); + +- if (i && copy_to_user(data, readbuf, i)) ++ if (i > sizeof(readbuf) || (i && copy_to_user(data, readbuf, i))) + return -EFAULT; + return i; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_get_user_pages.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_get_user_pages.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_get_user_pages.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_get_user_pages.patch 2017-12-24 11:05:40.000000000 +0000 @@ -0,0 +1,52 @@ +diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c +index 4769469fe842..24152accc66c 100644 +--- a/drivers/media/pci/ivtv/ivtv-udma.c ++++ b/drivers/media/pci/ivtv/ivtv-udma.c +@@ -124,8 +124,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, + } + + /* Get user pages for DMA Xfer */ +- err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, 0, +- 1, dma->map); ++ err = get_user_pages_unlocked(current, current->mm, ++ user_dma.uaddr, user_dma.page_count, 0, 1, dma->map); + + if (user_dma.page_count != err) { + IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n", +diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c +index b094054cda6e..2b8e7b2f2b86 100644 +--- a/drivers/media/pci/ivtv/ivtv-yuv.c ++++ b/drivers/media/pci/ivtv/ivtv-yuv.c +@@ -75,12 +75,14 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, + ivtv_udma_get_page_info (&uv_dma, (unsigned long)args->uv_source, 360 * uv_decode_height); + + /* Get user pages for DMA Xfer */ +- y_pages = get_user_pages_unlocked(y_dma.uaddr, +- y_dma.page_count, 0, 1, &dma->map[0]); ++ y_pages = get_user_pages_unlocked(current, current->mm, ++ y_dma.uaddr, y_dma.page_count, 0, 1, ++ &dma->map[0]); + uv_pages = 0; /* silence gcc. value is set and consumed only if: */ + if (y_pages == y_dma.page_count) { +- uv_pages = get_user_pages_unlocked(uv_dma.uaddr, +- uv_dma.page_count, 0, 1, &dma->map[y_pages]); ++ uv_pages = get_user_pages_unlocked(current, current->mm, ++ uv_dma.uaddr, uv_dma.page_count, 0, 1, ++ &dma->map[y_pages]); + } + + if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index df4c052c6bd6..f669cedca8bd 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -181,7 +181,8 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, + dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n", + data, size, dma->nr_pages); + +- err = get_user_pages(data & PAGE_MASK, dma->nr_pages, ++ err = get_user_pages(current, current->mm, ++ data & PAGE_MASK, dma->nr_pages, + rw == READ, 1, /* force */ + dma->pages, NULL); + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_gpiochip_data_pointer.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_gpiochip_data_pointer.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_gpiochip_data_pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_gpiochip_data_pointer.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,43 @@ +diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c +index 95267c6..d980d6b 100644 +--- a/drivers/media/dvb-frontends/cxd2820r_core.c ++++ b/drivers/media/dvb-frontends/cxd2820r_core.c +@@ -434,7 +434,8 @@ static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) + static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, + int val) + { +- struct cxd2820r_priv *priv = gpiochip_get_data(chip); ++ struct cxd2820r_priv *priv = ++ container_of(chip, struct cxd2820r_priv, gpio_chip); + struct i2c_client *client = priv->client[0]; + u8 gpio[GPIO_COUNT]; + +@@ -448,7 +449,8 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr, + + static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) + { +- struct cxd2820r_priv *priv = gpiochip_get_data(chip); ++ struct cxd2820r_priv *priv = ++ container_of(chip, struct cxd2820r_priv, gpio_chip); + struct i2c_client *client = priv->client[0]; + u8 gpio[GPIO_COUNT]; + +@@ -464,7 +466,8 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val) + + static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr) + { +- struct cxd2820r_priv *priv = gpiochip_get_data(chip); ++ struct cxd2820r_priv *priv = ++ container_of(chip, struct cxd2820r_priv, gpio_chip); + struct i2c_client *client = priv->client[0]; + + dev_dbg(&client->dev, "nr=%u\n", nr); +@@ -670,7 +673,7 @@ static int cxd2820r_probe(struct i2c_client *client, + priv->gpio_chip.base = -1; /* Dynamic allocation */ + priv->gpio_chip.ngpio = GPIO_COUNT; + priv->gpio_chip.can_sleep = 1; +- ret = gpiochip_add_data(&priv->gpio_chip, priv); ++ ret = gpiochip_add(&priv->gpio_chip); + if (ret) + goto err_regmap_1_regmap_exit; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_uvc_super_plus.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_uvc_super_plus.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.5_uvc_super_plus.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.5_uvc_super_plus.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c +index b5589d5..075a0fe 100644 +--- a/drivers/media/usb/uvc/uvc_video.c ++++ b/drivers/media/usb/uvc/uvc_video.c +@@ -1470,7 +1470,6 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev, + + switch (dev->speed) { + case USB_SPEED_SUPER: +- case USB_SPEED_SUPER_PLUS: + return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval); + case USB_SPEED_HIGH: + psize = usb_endpoint_maxp(&ep->desc); diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.6_i2c_mux.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.6_i2c_mux.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.6_i2c_mux.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.6_i2c_mux.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,1670 @@ +diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c +index 65d157f..4ce48ab 100644 +--- a/drivers/media/dvb-frontends/m88ds3103.c ++++ b/drivers/media/dvb-frontends/m88ds3103.c +@@ -1232,9 +1232,9 @@ static void m88ds3103_release(struct dvb_frontend *fe) + i2c_unregister_device(client); + } + +-static int m88ds3103_select(struct i2c_mux_core *muxc, u32 chan) ++static int m88ds3103_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) + { +- struct m88ds3103_dev *dev = i2c_mux_priv(muxc); ++ struct m88ds3103_dev *dev = mux_priv; + struct i2c_client *client = dev->client; + int ret; + struct i2c_msg msg = { +@@ -1356,7 +1356,7 @@ static struct i2c_adapter *m88ds3103_get_i2c_adapter(struct i2c_client *client) + + dev_dbg(&client->dev, "\n"); + +- return dev->muxc->adapter[0]; ++ return dev->i2c_adapter; + } + + static int m88ds3103_probe(struct i2c_client *client, +@@ -1456,16 +1456,13 @@ static int m88ds3103_probe(struct i2c_client *client, + goto err_kfree; + + /* create mux i2c adapter for tuner */ +- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, 1, 0, 0, +- m88ds3103_select, NULL); +- if (!dev->muxc) { ++ dev->i2c_adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ dev, 0, 0, 0, m88ds3103_select, ++ NULL); ++ if (dev->i2c_adapter == NULL) { + ret = -ENOMEM; + goto err_kfree; + } +- dev->muxc->priv = dev; +- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); +- if (ret) +- goto err_kfree; + + /* create dvb_frontend */ + memcpy(&dev->fe.ops, &m88ds3103_ops, sizeof(struct dvb_frontend_ops)); +@@ -1494,7 +1491,7 @@ static int m88ds3103_remove(struct i2c_client *client) + + dev_dbg(&client->dev, "\n"); + +- i2c_mux_del_adapters(dev->muxc); ++ i2c_del_mux_adapter(dev->i2c_adapter); + + kfree(dev); + return 0; +diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h b/drivers/media/dvb-frontends/m88ds3103_priv.h +index 1ba0b79..6c7efd8 100644 +--- a/drivers/media/dvb-frontends/m88ds3103_priv.h ++++ b/drivers/media/dvb-frontends/m88ds3103_priv.h +@@ -41,7 +41,7 @@ struct m88ds3103_dev { + enum fe_status fe_status; + u32 dvbv3_ber; /* for old DVBv3 API read_ber */ + bool warm; /* FW running */ +- struct i2c_mux_core *muxc; ++ struct i2c_adapter *i2c_adapter; + /* auto detect chip id to do different config */ + u8 chip_id; + /* main mclk is calculated for M88RS6000 dynamically */ +diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c +index 7bbfe11..56e9e5b 100644 +--- a/drivers/media/dvb-frontends/rtl2830.c ++++ b/drivers/media/dvb-frontends/rtl2830.c +@@ -655,9 +655,9 @@ static int rtl2830_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, int on + * adapter lock is already taken by tuner driver. + * Gate is closed automatically after single I2C transfer. + */ +-static int rtl2830_select(struct i2c_mux_core *muxc, u32 chan_id) ++static int rtl2830_select(struct i2c_adapter *adap, void *mux_priv, u32 chan_id) + { +- struct i2c_client *client = i2c_mux_priv(muxc); ++ struct i2c_client *client = mux_priv; + struct rtl2830_dev *dev = i2c_get_clientdata(client); + int ret; + +@@ -690,7 +690,7 @@ static struct i2c_adapter *rtl2830_get_i2c_adapter(struct i2c_client *client) + + dev_dbg(&client->dev, "\n"); + +- return dev->muxc->adapter[0]; ++ return dev->adapter; + } + + /* +@@ -842,16 +842,12 @@ static int rtl2830_probe(struct i2c_client *client, + goto err_regmap_exit; + + /* create muxed i2c adapter for tuner */ +- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, 1, 0, 0, +- rtl2830_select, NULL); +- if (!dev->muxc) { +- ret = -ENOMEM; ++ dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ client, 0, 0, 0, rtl2830_select, NULL); ++ if (dev->adapter == NULL) { ++ ret = -ENODEV; + goto err_regmap_exit; + } +- dev->muxc->priv = client; +- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); +- if (ret) +- goto err_regmap_exit; + + /* create dvb frontend */ + memcpy(&dev->fe.ops, &rtl2830_ops, sizeof(dev->fe.ops)); +@@ -881,7 +877,7 @@ static int rtl2830_remove(struct i2c_client *client) + + dev_dbg(&client->dev, "\n"); + +- i2c_mux_del_adapters(dev->muxc); ++ i2c_del_mux_adapter(dev->adapter); + regmap_exit(dev->regmap); + kfree(dev); + +diff --git a/drivers/media/dvb-frontends/rtl2830_priv.h b/drivers/media/dvb-frontends/rtl2830_priv.h +index 72d3f35..dc438c4 100644 +--- a/drivers/media/dvb-frontends/rtl2830_priv.h ++++ b/drivers/media/dvb-frontends/rtl2830_priv.h +@@ -30,7 +30,7 @@ struct rtl2830_dev { + struct rtl2830_platform_data *pdata; + struct i2c_client *client; + struct regmap *regmap; +- struct i2c_mux_core *muxc; ++ struct i2c_adapter *adapter; + struct dvb_frontend fe; + bool sleeping; + unsigned long filters; +diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c +index fa3b816..1c11d50 100644 +--- a/drivers/media/dvb-frontends/rtl2832.c ++++ b/drivers/media/dvb-frontends/rtl2832.c +@@ -153,6 +153,43 @@ static const struct rtl2832_reg_entry registers[] = { + [DVBT_REG_4MSEL] = {0x013, 0, 0}, + }; + ++/* Our regmap is bypassing I2C adapter lock, thus we do it! */ ++static int rtl2832_bulk_write(struct i2c_client *client, unsigned int reg, ++ const void *val, size_t val_count) ++{ ++ struct rtl2832_dev *dev = i2c_get_clientdata(client); ++ int ret; ++ ++ i2c_lock_adapter(client->adapter); ++ ret = regmap_bulk_write(dev->regmap, reg, val, val_count); ++ i2c_unlock_adapter(client->adapter); ++ return ret; ++} ++ ++static int rtl2832_update_bits(struct i2c_client *client, unsigned int reg, ++ unsigned int mask, unsigned int val) ++{ ++ struct rtl2832_dev *dev = i2c_get_clientdata(client); ++ int ret; ++ ++ i2c_lock_adapter(client->adapter); ++ ret = regmap_update_bits(dev->regmap, reg, mask, val); ++ i2c_unlock_adapter(client->adapter); ++ return ret; ++} ++ ++static int rtl2832_bulk_read(struct i2c_client *client, unsigned int reg, ++ void *val, size_t val_count) ++{ ++ struct rtl2832_dev *dev = i2c_get_clientdata(client); ++ int ret; ++ ++ i2c_lock_adapter(client->adapter); ++ ret = regmap_bulk_read(dev->regmap, reg, val, val_count); ++ i2c_unlock_adapter(client->adapter); ++ return ret; ++} ++ + static int rtl2832_rd_demod_reg(struct rtl2832_dev *dev, int reg, u32 *val) + { + struct i2c_client *client = dev->client; +@@ -167,7 +204,7 @@ static int rtl2832_rd_demod_reg(struct rtl2832_dev *dev, int reg, u32 *val) + len = (msb >> 3) + 1; + mask = REG_MASK(msb - lsb); + +- ret = regmap_bulk_read(dev->regmap, reg_start_addr, reading, len); ++ ret = rtl2832_bulk_read(client, reg_start_addr, reading, len); + if (ret) + goto err; + +@@ -197,7 +234,7 @@ static int rtl2832_wr_demod_reg(struct rtl2832_dev *dev, int reg, u32 val) + len = (msb >> 3) + 1; + mask = REG_MASK(msb - lsb); + +- ret = regmap_bulk_read(dev->regmap, reg_start_addr, reading, len); ++ ret = rtl2832_bulk_read(client, reg_start_addr, reading, len); + if (ret) + goto err; + +@@ -211,7 +248,7 @@ static int rtl2832_wr_demod_reg(struct rtl2832_dev *dev, int reg, u32 val) + for (i = 0; i < len; i++) + writing[i] = (writing_tmp >> ((len - 1 - i) * 8)) & 0xff; + +- ret = regmap_bulk_write(dev->regmap, reg_start_addr, writing, len); ++ ret = rtl2832_bulk_write(client, reg_start_addr, writing, len); + if (ret) + goto err; + +@@ -488,8 +525,7 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe) + } + + for (j = 0; j < sizeof(bw_params[0]); j++) { +- ret = regmap_bulk_write(dev->regmap, +- 0x11c + j, &bw_params[i][j], 1); ++ ret = rtl2832_bulk_write(client, 0x11c + j, &bw_params[i][j], 1); + if (ret) + goto err; + } +@@ -545,11 +581,11 @@ static int rtl2832_get_frontend(struct dvb_frontend *fe, + if (dev->sleeping) + return 0; + +- ret = regmap_bulk_read(dev->regmap, 0x33c, buf, 2); ++ ret = rtl2832_bulk_read(client, 0x33c, buf, 2); + if (ret) + goto err; + +- ret = regmap_bulk_read(dev->regmap, 0x351, &buf[2], 1); ++ ret = rtl2832_bulk_read(client, 0x351, &buf[2], 1); + if (ret) + goto err; + +@@ -680,7 +716,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) + /* signal strength */ + if (dev->fe_status & FE_HAS_SIGNAL) { + /* read digital AGC */ +- ret = regmap_bulk_read(dev->regmap, 0x305, &u8tmp, 1); ++ ret = rtl2832_bulk_read(client, 0x305, &u8tmp, 1); + if (ret) + goto err; + +@@ -706,7 +742,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) + {87659938, 87659938, 87885178, 88241743}, + }; + +- ret = regmap_bulk_read(dev->regmap, 0x33c, &u8tmp, 1); ++ ret = rtl2832_bulk_read(client, 0x33c, &u8tmp, 1); + if (ret) + goto err; + +@@ -718,7 +754,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) + if (hierarchy > HIERARCHY_NUM - 1) + goto err; + +- ret = regmap_bulk_read(dev->regmap, 0x40c, buf, 2); ++ ret = rtl2832_bulk_read(client, 0x40c, buf, 2); + if (ret) + goto err; + +@@ -739,7 +775,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status) + + /* BER */ + if (dev->fe_status & FE_HAS_LOCK) { +- ret = regmap_bulk_read(dev->regmap, 0x34e, buf, 2); ++ ret = rtl2832_bulk_read(client, 0x34e, buf, 2); + if (ret) + goto err; + +@@ -789,6 +825,8 @@ static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber) + + /* + * I2C gate/mux/repeater logic ++ * We must use unlocked __i2c_transfer() here (through regmap) because of I2C ++ * adapter lock is already taken by tuner driver. + * There is delay mechanism to avoid unneeded I2C gate open / close. Gate close + * is delayed here a little bit in order to see if there is sequence of I2C + * messages sent to same I2C bus. +@@ -800,7 +838,7 @@ static void rtl2832_i2c_gate_work(struct work_struct *work) + int ret; + + /* close gate */ +- ret = regmap_update_bits(dev->regmap, 0x101, 0x08, 0x00); ++ ret = rtl2832_update_bits(dev->client, 0x101, 0x08, 0x00); + if (ret) + goto err; + +@@ -809,16 +847,19 @@ static void rtl2832_i2c_gate_work(struct work_struct *work) + dev_dbg(&client->dev, "failed=%d\n", ret); + } + +-static int rtl2832_select(struct i2c_mux_core *muxc, u32 chan_id) ++static int rtl2832_select(struct i2c_adapter *adap, void *mux_priv, u32 chan_id) + { +- struct rtl2832_dev *dev = i2c_mux_priv(muxc); ++ struct rtl2832_dev *dev = mux_priv; + struct i2c_client *client = dev->client; + int ret; + + /* terminate possible gate closing */ + cancel_delayed_work(&dev->i2c_gate_work); + +- /* open gate */ ++ /* ++ * I2C adapter lock is already taken and due to that we will use ++ * regmap_update_bits() which does not lock again I2C adapter. ++ */ + ret = regmap_update_bits(dev->regmap, 0x101, 0x08, 0x08); + if (ret) + goto err; +@@ -829,9 +870,10 @@ static int rtl2832_select(struct i2c_mux_core *muxc, u32 chan_id) + return ret; + } + +-static int rtl2832_deselect(struct i2c_mux_core *muxc, u32 chan_id) ++static int rtl2832_deselect(struct i2c_adapter *adap, void *mux_priv, ++ u32 chan_id) + { +- struct rtl2832_dev *dev = i2c_mux_priv(muxc); ++ struct rtl2832_dev *dev = mux_priv; + + schedule_delayed_work(&dev->i2c_gate_work, usecs_to_jiffies(100)); + return 0; +@@ -890,6 +932,120 @@ static bool rtl2832_volatile_reg(struct device *dev, unsigned int reg) + return false; + } + ++/* ++ * We implement own I2C access routines for regmap in order to get manual access ++ * to I2C adapter lock, which is needed for I2C mux adapter. ++ */ ++static int rtl2832_regmap_read(void *context, const void *reg_buf, ++ size_t reg_size, void *val_buf, size_t val_size) ++{ ++ struct i2c_client *client = context; ++ int ret; ++ struct i2c_msg msg[2] = { ++ { ++ .addr = client->addr, ++ .flags = 0, ++ .len = reg_size, ++ .buf = (u8 *)reg_buf, ++ }, { ++ .addr = client->addr, ++ .flags = I2C_M_RD, ++ .len = val_size, ++ .buf = val_buf, ++ } ++ }; ++ ++ ret = __i2c_transfer(client->adapter, msg, 2); ++ if (ret != 2) { ++ dev_warn(&client->dev, "i2c reg read failed %d reg %02x\n", ++ ret, *(u8 *)reg_buf); ++ if (ret >= 0) ++ ret = -EREMOTEIO; ++ return ret; ++ } ++ return 0; ++} ++ ++static int rtl2832_regmap_write(void *context, const void *data, size_t count) ++{ ++ struct i2c_client *client = context; ++ int ret; ++ struct i2c_msg msg[1] = { ++ { ++ .addr = client->addr, ++ .flags = 0, ++ .len = count, ++ .buf = (u8 *)data, ++ } ++ }; ++ ++ ret = __i2c_transfer(client->adapter, msg, 1); ++ if (ret != 1) { ++ dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", ++ ret, *(u8 *)data); ++ if (ret >= 0) ++ ret = -EREMOTEIO; ++ return ret; ++ } ++ return 0; ++} ++ ++static int rtl2832_regmap_gather_write(void *context, const void *reg, ++ size_t reg_len, const void *val, ++ size_t val_len) ++{ ++ struct i2c_client *client = context; ++ int ret; ++ u8 buf[256]; ++ struct i2c_msg msg[1] = { ++ { ++ .addr = client->addr, ++ .flags = 0, ++ .len = 1 + val_len, ++ .buf = buf, ++ } ++ }; ++ ++ buf[0] = *(u8 const *)reg; ++ memcpy(&buf[1], val, val_len); ++ ++ ret = __i2c_transfer(client->adapter, msg, 1); ++ if (ret != 1) { ++ dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n", ++ ret, *(u8 const *)reg); ++ if (ret >= 0) ++ ret = -EREMOTEIO; ++ return ret; ++ } ++ return 0; ++} ++ ++/* ++ * FIXME: Hack. Implement own regmap locking in order to silence lockdep ++ * recursive lock warning. That happens when regmap I2C client calls I2C mux ++ * adapter, which leads demod I2C repeater enable via demod regmap. Operation ++ * takes two regmap locks recursively - but those are different regmap instances ++ * in a two different I2C drivers, so it is not deadlock. Proper fix is to make ++ * regmap aware of lockdep. ++ */ ++static void rtl2832_regmap_lock(void *__dev) ++{ ++ struct rtl2832_dev *dev = __dev; ++ struct i2c_client *client = dev->client; ++ ++ dev_dbg(&client->dev, "\n"); ++ mutex_lock(&dev->regmap_mutex); ++} ++ ++static void rtl2832_regmap_unlock(void *__dev) ++{ ++ struct rtl2832_dev *dev = __dev; ++ struct i2c_client *client = dev->client; ++ ++ dev_dbg(&client->dev, "\n"); ++ mutex_unlock(&dev->regmap_mutex); ++} ++ + static struct dvb_frontend *rtl2832_get_dvb_frontend(struct i2c_client *client) + { + struct rtl2832_dev *dev = i2c_get_clientdata(client); +@@ -903,7 +1059,7 @@ static struct i2c_adapter *rtl2832_get_i2c_adapter(struct i2c_client *client) + struct rtl2832_dev *dev = i2c_get_clientdata(client); + + dev_dbg(&client->dev, "\n"); +- return dev->muxc->adapter[0]; ++ return dev->i2c_adapter_tuner; + } + + static int rtl2832_slave_ts_ctrl(struct i2c_client *client, bool enable) +@@ -917,29 +1073,29 @@ static int rtl2832_slave_ts_ctrl(struct i2c_client *client, bool enable) + ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x0); + if (ret) + goto err; +- ret = regmap_bulk_write(dev->regmap, 0x10c, "\x5f\xff", 2); ++ ret = rtl2832_bulk_write(client, 0x10c, "\x5f\xff", 2); + if (ret) + goto err; + ret = rtl2832_wr_demod_reg(dev, DVBT_PIP_ON, 0x1); + if (ret) + goto err; +- ret = regmap_bulk_write(dev->regmap, 0x0bc, "\x18", 1); ++ ret = rtl2832_bulk_write(client, 0x0bc, "\x18", 1); + if (ret) + goto err; +- ret = regmap_bulk_write(dev->regmap, 0x192, "\x7f\xf7\xff", 3); ++ ret = rtl2832_bulk_write(client, 0x192, "\x7f\xf7\xff", 3); + if (ret) + goto err; + } else { +- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\x0f\xff", 3); ++ ret = rtl2832_bulk_write(client, 0x192, "\x00\x0f\xff", 3); + if (ret) + goto err; +- ret = regmap_bulk_write(dev->regmap, 0x0bc, "\x08", 1); ++ ret = rtl2832_bulk_write(client, 0x0bc, "\x08", 1); + if (ret) + goto err; + ret = rtl2832_wr_demod_reg(dev, DVBT_PIP_ON, 0x0); + if (ret) + goto err; +- ret = regmap_bulk_write(dev->regmap, 0x10c, "\x00\x00", 2); ++ ret = rtl2832_bulk_write(client, 0x10c, "\x00\x00", 2); + if (ret) + goto err; + ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x1); +@@ -971,9 +1127,9 @@ static int rtl2832_pid_filter_ctrl(struct dvb_frontend *fe, int onoff) + u8tmp = 0x00; + + if (dev->slave_ts) +- ret = regmap_update_bits(dev->regmap, 0x021, 0xc0, u8tmp); ++ ret = rtl2832_update_bits(client, 0x021, 0xc0, u8tmp); + else +- ret = regmap_update_bits(dev->regmap, 0x061, 0xc0, u8tmp); ++ ret = rtl2832_update_bits(client, 0x061, 0xc0, u8tmp); + if (ret) + goto err; + +@@ -1010,9 +1166,9 @@ static int rtl2832_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, + buf[3] = (dev->filters >> 24) & 0xff; + + if (dev->slave_ts) +- ret = regmap_bulk_write(dev->regmap, 0x022, buf, 4); ++ ret = rtl2832_bulk_write(client, 0x022, buf, 4); + else +- ret = regmap_bulk_write(dev->regmap, 0x062, buf, 4); ++ ret = rtl2832_bulk_write(client, 0x062, buf, 4); + if (ret) + goto err; + +@@ -1021,9 +1177,9 @@ static int rtl2832_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, + buf[1] = (pid >> 0) & 0xff; + + if (dev->slave_ts) +- ret = regmap_bulk_write(dev->regmap, 0x026 + 2 * index, buf, 2); ++ ret = rtl2832_bulk_write(client, 0x026 + 2 * index, buf, 2); + else +- ret = regmap_bulk_write(dev->regmap, 0x066 + 2 * index, buf, 2); ++ ret = rtl2832_bulk_write(client, 0x066 + 2 * index, buf, 2); + if (ret) + goto err; + +@@ -1041,6 +1197,12 @@ static int rtl2832_probe(struct i2c_client *client, + struct rtl2832_dev *dev; + int ret; + u8 tmp; ++ static const struct regmap_bus regmap_bus = { ++ .read = rtl2832_regmap_read, ++ .write = rtl2832_regmap_write, ++ .gather_write = rtl2832_regmap_gather_write, ++ .val_format_endian_default = REGMAP_ENDIAN_NATIVE, ++ }; + static const struct regmap_range_cfg regmap_range_cfg[] = { + { + .selector_reg = 0x00, +@@ -1069,35 +1231,36 @@ static int rtl2832_probe(struct i2c_client *client, + dev->sleeping = true; + INIT_DELAYED_WORK(&dev->i2c_gate_work, rtl2832_i2c_gate_work); + /* create regmap */ ++ mutex_init(&dev->regmap_mutex); + dev->regmap_config.reg_bits = 8, + dev->regmap_config.val_bits = 8, ++ dev->regmap_config.lock = rtl2832_regmap_lock, ++ dev->regmap_config.unlock = rtl2832_regmap_unlock, ++ dev->regmap_config.lock_arg = dev, + dev->regmap_config.volatile_reg = rtl2832_volatile_reg, + dev->regmap_config.max_register = 5 * 0x100, + dev->regmap_config.ranges = regmap_range_cfg, + dev->regmap_config.num_ranges = ARRAY_SIZE(regmap_range_cfg), + dev->regmap_config.cache_type = REGCACHE_NONE, +- dev->regmap = regmap_init_i2c(client, &dev->regmap_config); ++ dev->regmap = regmap_init(&client->dev, ®map_bus, client, ++ &dev->regmap_config); + if (IS_ERR(dev->regmap)) { + ret = PTR_ERR(dev->regmap); + goto err_kfree; + } + + /* check if the demod is there */ +- ret = regmap_bulk_read(dev->regmap, 0x000, &tmp, 1); ++ ret = rtl2832_bulk_read(client, 0x000, &tmp, 1); + if (ret) + goto err_regmap_exit; + + /* create muxed i2c adapter for demod tuner bus */ +- dev->muxc = i2c_mux_alloc(i2c, &i2c->dev, 1, 0, I2C_MUX_LOCKED, +- rtl2832_select, rtl2832_deselect); +- if (!dev->muxc) { +- ret = -ENOMEM; ++ dev->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, dev, ++ 0, 0, 0, rtl2832_select, rtl2832_deselect); ++ if (dev->i2c_adapter_tuner == NULL) { ++ ret = -ENODEV; + goto err_regmap_exit; + } +- dev->muxc->priv = dev; +- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); +- if (ret) +- goto err_regmap_exit; + + /* create dvb_frontend */ + memcpy(&dev->fe.ops, &rtl2832_ops, sizeof(struct dvb_frontend_ops)); +@@ -1109,7 +1272,9 @@ static int rtl2832_probe(struct i2c_client *client, + pdata->slave_ts_ctrl = rtl2832_slave_ts_ctrl; + pdata->pid_filter = rtl2832_pid_filter; + pdata->pid_filter_ctrl = rtl2832_pid_filter_ctrl; +- pdata->regmap = dev->regmap; ++ pdata->bulk_read = rtl2832_bulk_read; ++ pdata->bulk_write = rtl2832_bulk_write; ++ pdata->update_bits = rtl2832_update_bits; + + dev_info(&client->dev, "Realtek RTL2832 successfully attached\n"); + return 0; +@@ -1130,7 +1295,7 @@ static int rtl2832_remove(struct i2c_client *client) + + cancel_delayed_work_sync(&dev->i2c_gate_work); + +- i2c_mux_del_adapters(dev->muxc); ++ i2c_del_mux_adapter(dev->i2c_adapter_tuner); + + regmap_exit(dev->regmap); + +diff --git a/drivers/media/dvb-frontends/rtl2832.h b/drivers/media/dvb-frontends/rtl2832.h +index 6a124ff..cb56cb2 100644 +--- a/drivers/media/dvb-frontends/rtl2832.h ++++ b/drivers/media/dvb-frontends/rtl2832.h +@@ -56,7 +56,9 @@ struct rtl2832_platform_data { + int (*pid_filter)(struct dvb_frontend *, u8, u16, int); + int (*pid_filter_ctrl)(struct dvb_frontend *, int); + /* private: Register access for SDR module use only */ +- struct regmap *regmap; ++ int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t); ++ int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t); ++ int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int); + }; + + #endif /* RTL2832_H */ +diff --git a/drivers/media/dvb-frontends/rtl2832_priv.h b/drivers/media/dvb-frontends/rtl2832_priv.h +index bd13d9a..6f3b69e 100644 +--- a/drivers/media/dvb-frontends/rtl2832_priv.h ++++ b/drivers/media/dvb-frontends/rtl2832_priv.h +@@ -33,9 +33,10 @@ + struct rtl2832_dev { + struct rtl2832_platform_data *pdata; + struct i2c_client *client; ++ struct mutex regmap_mutex; + struct regmap_config regmap_config; + struct regmap *regmap; +- struct i2c_mux_core *muxc; ++ struct i2c_adapter *i2c_adapter_tuner; + struct dvb_frontend fe; + enum fe_status fe_status; + u64 post_bit_error_prev; /* for old DVBv3 read_ber() calculation */ +diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c +index c6e78d8..6d2863f 100644 +--- a/drivers/media/dvb-frontends/rtl2832_sdr.c ++++ b/drivers/media/dvb-frontends/rtl2832_sdr.c +@@ -35,7 +35,6 @@ + #include + #include + #include +-#include + + static bool rtl2832_sdr_emulated_fmt; + module_param_named(emulated_formats, rtl2832_sdr_emulated_fmt, bool, 0644); +@@ -120,7 +119,6 @@ struct rtl2832_sdr_dev { + unsigned long flags; + + struct platform_device *pdev; +- struct regmap *regmap; + + struct video_device vdev; + struct v4l2_device v4l2_dev; +@@ -165,6 +163,47 @@ struct rtl2832_sdr_dev { + unsigned long jiffies_next; + }; + ++/* write multiple registers */ ++static int rtl2832_sdr_wr_regs(struct rtl2832_sdr_dev *dev, u16 reg, ++ const u8 *val, int len) ++{ ++ struct platform_device *pdev = dev->pdev; ++ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; ++ struct i2c_client *client = pdata->i2c_client; ++ ++ return pdata->bulk_write(client, reg, val, len); ++} ++ ++#if 0 ++/* read multiple registers */ ++static int rtl2832_sdr_rd_regs(struct rtl2832_sdr_dev *dev, u16 reg, u8 *val, ++ int len) ++{ ++ struct platform_device *pdev = dev->pdev; ++ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; ++ struct i2c_client *client = pdata->i2c_client; ++ ++ return pdata->bulk_read(client, reg, val, len); ++} ++#endif ++ ++/* write single register */ ++static int rtl2832_sdr_wr_reg(struct rtl2832_sdr_dev *dev, u16 reg, u8 val) ++{ ++ return rtl2832_sdr_wr_regs(dev, reg, &val, 1); ++} ++ ++/* write single register with mask */ ++static int rtl2832_sdr_wr_reg_mask(struct rtl2832_sdr_dev *dev, u16 reg, ++ u8 val, u8 mask) ++{ ++ struct platform_device *pdev = dev->pdev; ++ struct rtl2832_sdr_platform_data *pdata = pdev->dev.platform_data; ++ struct i2c_client *client = pdata->i2c_client; ++ ++ return pdata->update_bits(client, reg, mask, val); ++} ++ + /* Private functions */ + static struct rtl2832_sdr_frame_buf *rtl2832_sdr_get_next_fill_buf( + struct rtl2832_sdr_dev *dev) +@@ -518,11 +557,11 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) + + f_sr = dev->f_adc; + +- ret = regmap_bulk_write(dev->regmap, 0x13e, "\x00\x00", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x13e, "\x00\x00", 2); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x115, "\x00\x00\x00\x00", 4); ++ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x00\x00\x00\x00", 4); + if (ret) + goto err; + +@@ -548,7 +587,7 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) + buf[1] = (u32tmp >> 8) & 0xff; + buf[2] = (u32tmp >> 0) & 0xff; + +- ret = regmap_bulk_write(dev->regmap, 0x119, buf, 3); ++ ret = rtl2832_sdr_wr_regs(dev, 0x119, buf, 3); + if (ret) + goto err; + +@@ -562,15 +601,15 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) + u8tmp2 = 0xcd; /* enable ADC I, ADC Q */ + } + +- ret = regmap_write(dev->regmap, 0x1b1, u8tmp1); ++ ret = rtl2832_sdr_wr_reg(dev, 0x1b1, u8tmp1); + if (ret) + goto err; + +- ret = regmap_write(dev->regmap, 0x008, u8tmp2); ++ ret = rtl2832_sdr_wr_reg(dev, 0x008, u8tmp2); + if (ret) + goto err; + +- ret = regmap_write(dev->regmap, 0x006, 0x80); ++ ret = rtl2832_sdr_wr_reg(dev, 0x006, 0x80); + if (ret) + goto err; + +@@ -581,169 +620,168 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_dev *dev) + buf[1] = (u32tmp >> 16) & 0xff; + buf[2] = (u32tmp >> 8) & 0xff; + buf[3] = (u32tmp >> 0) & 0xff; +- ret = regmap_bulk_write(dev->regmap, 0x19f, buf, 4); ++ ret = rtl2832_sdr_wr_regs(dev, 0x19f, buf, 4); + if (ret) + goto err; + + /* low-pass filter */ +- ret = regmap_bulk_write(dev->regmap, 0x11c, +- "\xca\xdc\xd7\xd8\xe0\xf2\x0e\x35\x06\x50\x9c\x0d\x71\x11\x14\x71\x74\x19\x41\xa5", +- 20); ++ ret = rtl2832_sdr_wr_regs(dev, 0x11c, ++ "\xca\xdc\xd7\xd8\xe0\xf2\x0e\x35\x06\x50\x9c\x0d\x71\x11\x14\x71\x74\x19\x41\xa5", ++ 20); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x017, "\x11\x10", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x017, "\x11\x10", 2); + if (ret) + goto err; + + /* mode */ +- ret = regmap_write(dev->regmap, 0x019, 0x05); ++ ret = rtl2832_sdr_wr_regs(dev, 0x019, "\x05", 1); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x01a, +- "\x1b\x16\x0d\x06\x01\xff", 6); ++ ret = rtl2832_sdr_wr_regs(dev, 0x01a, "\x1b\x16\x0d\x06\x01\xff", 6); + if (ret) + goto err; + + /* FSM */ +- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\xf0\x0f", 3); ++ ret = rtl2832_sdr_wr_regs(dev, 0x192, "\x00\xf0\x0f", 3); + if (ret) + goto err; + + /* PID filter */ +- ret = regmap_write(dev->regmap, 0x061, 0x60); ++ ret = rtl2832_sdr_wr_regs(dev, 0x061, "\x60", 1); + if (ret) + goto err; + + /* used RF tuner based settings */ + switch (pdata->tuner) { + case RTL2832_SDR_TUNER_E4000: +- ret = regmap_write(dev->regmap, 0x112, 0x5a); +- ret = regmap_write(dev->regmap, 0x102, 0x40); +- ret = regmap_write(dev->regmap, 0x103, 0x5a); +- ret = regmap_write(dev->regmap, 0x1c7, 0x30); +- ret = regmap_write(dev->regmap, 0x104, 0xd0); +- ret = regmap_write(dev->regmap, 0x105, 0xbe); +- ret = regmap_write(dev->regmap, 0x1c8, 0x18); +- ret = regmap_write(dev->regmap, 0x106, 0x35); +- ret = regmap_write(dev->regmap, 0x1c9, 0x21); +- ret = regmap_write(dev->regmap, 0x1ca, 0x21); +- ret = regmap_write(dev->regmap, 0x1cb, 0x00); +- ret = regmap_write(dev->regmap, 0x107, 0x40); +- ret = regmap_write(dev->regmap, 0x1cd, 0x10); +- ret = regmap_write(dev->regmap, 0x1ce, 0x10); +- ret = regmap_write(dev->regmap, 0x108, 0x80); +- ret = regmap_write(dev->regmap, 0x109, 0x7f); +- ret = regmap_write(dev->regmap, 0x10a, 0x80); +- ret = regmap_write(dev->regmap, 0x10b, 0x7f); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x011, 0xd4); +- ret = regmap_write(dev->regmap, 0x1e5, 0xf0); +- ret = regmap_write(dev->regmap, 0x1d9, 0x00); +- ret = regmap_write(dev->regmap, 0x1db, 0x00); +- ret = regmap_write(dev->regmap, 0x1dd, 0x14); +- ret = regmap_write(dev->regmap, 0x1de, 0xec); +- ret = regmap_write(dev->regmap, 0x1d8, 0x0c); +- ret = regmap_write(dev->regmap, 0x1e6, 0x02); +- ret = regmap_write(dev->regmap, 0x1d7, 0x09); +- ret = regmap_write(dev->regmap, 0x00d, 0x83); +- ret = regmap_write(dev->regmap, 0x010, 0x49); +- ret = regmap_write(dev->regmap, 0x00d, 0x87); +- ret = regmap_write(dev->regmap, 0x00d, 0x85); +- ret = regmap_write(dev->regmap, 0x013, 0x02); ++ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x30", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xd0", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x18", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xd4", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1e5, "\xf0", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d9, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1db, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1dd, "\x14", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1de, "\xec", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d8, "\x0c", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1e6, "\x02", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d7, "\x09", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x83", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x010, "\x49", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x87", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00d, "\x85", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x013, "\x02", 1); + break; + case RTL2832_SDR_TUNER_FC0012: + case RTL2832_SDR_TUNER_FC0013: +- ret = regmap_write(dev->regmap, 0x112, 0x5a); +- ret = regmap_write(dev->regmap, 0x102, 0x40); +- ret = regmap_write(dev->regmap, 0x103, 0x5a); +- ret = regmap_write(dev->regmap, 0x1c7, 0x2c); +- ret = regmap_write(dev->regmap, 0x104, 0xcc); +- ret = regmap_write(dev->regmap, 0x105, 0xbe); +- ret = regmap_write(dev->regmap, 0x1c8, 0x16); +- ret = regmap_write(dev->regmap, 0x106, 0x35); +- ret = regmap_write(dev->regmap, 0x1c9, 0x21); +- ret = regmap_write(dev->regmap, 0x1ca, 0x21); +- ret = regmap_write(dev->regmap, 0x1cb, 0x00); +- ret = regmap_write(dev->regmap, 0x107, 0x40); +- ret = regmap_write(dev->regmap, 0x1cd, 0x10); +- ret = regmap_write(dev->regmap, 0x1ce, 0x10); +- ret = regmap_write(dev->regmap, 0x108, 0x80); +- ret = regmap_write(dev->regmap, 0x109, 0x7f); +- ret = regmap_write(dev->regmap, 0x10a, 0x80); +- ret = regmap_write(dev->regmap, 0x10b, 0x7f); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_bulk_write(dev->regmap, 0x011, "\xe9\xbf", 2); +- ret = regmap_write(dev->regmap, 0x1e5, 0xf0); +- ret = regmap_write(dev->regmap, 0x1d9, 0x00); +- ret = regmap_write(dev->regmap, 0x1db, 0x00); +- ret = regmap_write(dev->regmap, 0x1dd, 0x11); +- ret = regmap_write(dev->regmap, 0x1de, 0xef); +- ret = regmap_write(dev->regmap, 0x1d8, 0x0c); +- ret = regmap_write(dev->regmap, 0x1e6, 0x02); +- ret = regmap_write(dev->regmap, 0x1d7, 0x09); ++ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x2c", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x16", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xe9\xbf", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1e5, "\xf0", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d9, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1db, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1dd, "\x11", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1de, "\xef", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d8, "\x0c", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1e6, "\x02", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1d7, "\x09", 1); + break; + case RTL2832_SDR_TUNER_R820T: + case RTL2832_SDR_TUNER_R828D: +- ret = regmap_write(dev->regmap, 0x112, 0x5a); +- ret = regmap_write(dev->regmap, 0x102, 0x40); +- ret = regmap_write(dev->regmap, 0x115, 0x01); +- ret = regmap_write(dev->regmap, 0x103, 0x80); +- ret = regmap_write(dev->regmap, 0x1c7, 0x24); +- ret = regmap_write(dev->regmap, 0x104, 0xcc); +- ret = regmap_write(dev->regmap, 0x105, 0xbe); +- ret = regmap_write(dev->regmap, 0x1c8, 0x14); +- ret = regmap_write(dev->regmap, 0x106, 0x35); +- ret = regmap_write(dev->regmap, 0x1c9, 0x21); +- ret = regmap_write(dev->regmap, 0x1ca, 0x21); +- ret = regmap_write(dev->regmap, 0x1cb, 0x00); +- ret = regmap_write(dev->regmap, 0x107, 0x40); +- ret = regmap_write(dev->regmap, 0x1cd, 0x10); +- ret = regmap_write(dev->regmap, 0x1ce, 0x10); +- ret = regmap_write(dev->regmap, 0x108, 0x80); +- ret = regmap_write(dev->regmap, 0x109, 0x7f); +- ret = regmap_write(dev->regmap, 0x10a, 0x80); +- ret = regmap_write(dev->regmap, 0x10b, 0x7f); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x011, 0xf4); ++ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x01", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x24", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x14", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xf4", 1); + break; + case RTL2832_SDR_TUNER_FC2580: +- ret = regmap_write(dev->regmap, 0x112, 0x39); +- ret = regmap_write(dev->regmap, 0x102, 0x40); +- ret = regmap_write(dev->regmap, 0x103, 0x5a); +- ret = regmap_write(dev->regmap, 0x1c7, 0x2c); +- ret = regmap_write(dev->regmap, 0x104, 0xcc); +- ret = regmap_write(dev->regmap, 0x105, 0xbe); +- ret = regmap_write(dev->regmap, 0x1c8, 0x16); +- ret = regmap_write(dev->regmap, 0x106, 0x35); +- ret = regmap_write(dev->regmap, 0x1c9, 0x21); +- ret = regmap_write(dev->regmap, 0x1ca, 0x21); +- ret = regmap_write(dev->regmap, 0x1cb, 0x00); +- ret = regmap_write(dev->regmap, 0x107, 0x40); +- ret = regmap_write(dev->regmap, 0x1cd, 0x10); +- ret = regmap_write(dev->regmap, 0x1ce, 0x10); +- ret = regmap_write(dev->regmap, 0x108, 0x80); +- ret = regmap_write(dev->regmap, 0x109, 0x7f); +- ret = regmap_write(dev->regmap, 0x10a, 0x9c); +- ret = regmap_write(dev->regmap, 0x10b, 0x7f); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_write(dev->regmap, 0x00e, 0xfc); +- ret = regmap_bulk_write(dev->regmap, 0x011, "\xe9\xf4", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x112, "\x39", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x102, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x103, "\x5a", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c7, "\x2c", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x104, "\xcc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x105, "\xbe", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c8, "\x16", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x106, "\x35", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1c9, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ca, "\x21", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cb, "\x00", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x107, "\x40", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1cd, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x1ce, "\x10", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x108, "\x80", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x109, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10a, "\x9c", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x10b, "\x7f", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x00e, "\xfc", 1); ++ ret = rtl2832_sdr_wr_regs(dev, 0x011, "\xe9\xf4", 2); + break; + default: + dev_notice(&pdev->dev, "Unsupported tuner\n"); + } + + /* software reset */ +- ret = regmap_update_bits(dev->regmap, 0x101, 0x04, 0x04); ++ ret = rtl2832_sdr_wr_reg_mask(dev, 0x101, 0x04, 0x04); + if (ret) + goto err; + +- ret = regmap_update_bits(dev->regmap, 0x101, 0x04, 0x00); ++ ret = rtl2832_sdr_wr_reg_mask(dev, 0x101, 0x00, 0x04); + if (ret) + goto err; + err: +@@ -758,29 +796,29 @@ static void rtl2832_sdr_unset_adc(struct rtl2832_sdr_dev *dev) + dev_dbg(&pdev->dev, "\n"); + + /* PID filter */ +- ret = regmap_write(dev->regmap, 0x061, 0xe0); ++ ret = rtl2832_sdr_wr_regs(dev, 0x061, "\xe0", 1); + if (ret) + goto err; + + /* mode */ +- ret = regmap_write(dev->regmap, 0x019, 0x20); ++ ret = rtl2832_sdr_wr_regs(dev, 0x019, "\x20", 1); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x017, "\x11\x10", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x017, "\x11\x10", 2); + if (ret) + goto err; + + /* FSM */ +- ret = regmap_bulk_write(dev->regmap, 0x192, "\x00\x0f\xff", 3); ++ ret = rtl2832_sdr_wr_regs(dev, 0x192, "\x00\x0f\xff", 3); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x13e, "\x40\x00", 2); ++ ret = rtl2832_sdr_wr_regs(dev, 0x13e, "\x40\x00", 2); + if (ret) + goto err; + +- ret = regmap_bulk_write(dev->regmap, 0x115, "\x06\x3f\xce\xcc", 4); ++ ret = rtl2832_sdr_wr_regs(dev, 0x115, "\x06\x3f\xce\xcc", 4); + if (ret) + goto err; + err: +@@ -1360,7 +1398,6 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) + subdev = pdata->v4l2_subdev; + dev->v4l2_subdev = pdata->v4l2_subdev; + dev->pdev = pdev; +- dev->regmap = pdata->regmap; + dev->udev = pdata->dvb_usb_device->udev; + dev->f_adc = bands_adc[0].rangelow; + dev->f_tuner = bands_fm[0].rangelow; +diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.h b/drivers/media/dvb-frontends/rtl2832_sdr.h +index d28735c..71b73da 100644 +--- a/drivers/media/dvb-frontends/rtl2832_sdr.h ++++ b/drivers/media/dvb-frontends/rtl2832_sdr.h +@@ -52,7 +52,10 @@ struct rtl2832_sdr_platform_data { + #define RTL2832_SDR_TUNER_R828D 0x2b + u8 tuner; + +- struct regmap *regmap; ++ struct i2c_client *i2c_client; ++ int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t); ++ int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t); ++ int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int); + struct dvb_frontend *dvb_frontend; + struct v4l2_subdev *v4l2_subdev; + struct dvb_usb_device *dvb_usb_device; +diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c +index 324493e..ca1637e 100644 +--- a/drivers/media/dvb-frontends/si2168.c ++++ b/drivers/media/dvb-frontends/si2168.c +@@ -20,23 +20,53 @@ + + static const struct dvb_frontend_ops si2168_ops; + ++/* Own I2C adapter locking is needed because of I2C gate logic. */ ++static int si2168_i2c_master_send_unlocked(const struct i2c_client *client, ++ const char *buf, int count) ++{ ++ int ret; ++ struct i2c_msg msg = { ++ .addr = client->addr, ++ .flags = 0, ++ .len = count, ++ .buf = (char *)buf, ++ }; ++ ++ ret = __i2c_transfer(client->adapter, &msg, 1); ++ return (ret == 1) ? count : ret; ++} ++ ++static int si2168_i2c_master_recv_unlocked(const struct i2c_client *client, ++ char *buf, int count) ++{ ++ int ret; ++ struct i2c_msg msg = { ++ .addr = client->addr, ++ .flags = I2C_M_RD, ++ .len = count, ++ .buf = buf, ++ }; ++ ++ ret = __i2c_transfer(client->adapter, &msg, 1); ++ return (ret == 1) ? count : ret; ++} ++ + /* execute firmware command */ +-static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) ++static int si2168_cmd_execute_unlocked(struct i2c_client *client, ++ struct si2168_cmd *cmd) + { +- struct si2168_dev *dev = i2c_get_clientdata(client); + int ret; + unsigned long timeout; + +- mutex_lock(&dev->i2c_mutex); +- + if (cmd->wlen) { + /* write cmd and args for firmware */ +- ret = i2c_master_send(client, cmd->args, cmd->wlen); ++ ret = si2168_i2c_master_send_unlocked(client, cmd->args, ++ cmd->wlen); + if (ret < 0) { +- goto err_mutex_unlock; ++ goto err; + } else if (ret != cmd->wlen) { + ret = -EREMOTEIO; +- goto err_mutex_unlock; ++ goto err; + } + } + +@@ -45,12 +75,13 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) + #define TIMEOUT 70 + timeout = jiffies + msecs_to_jiffies(TIMEOUT); + while (!time_after(jiffies, timeout)) { +- ret = i2c_master_recv(client, cmd->args, cmd->rlen); ++ ret = si2168_i2c_master_recv_unlocked(client, cmd->args, ++ cmd->rlen); + if (ret < 0) { +- goto err_mutex_unlock; ++ goto err; + } else if (ret != cmd->rlen) { + ret = -EREMOTEIO; +- goto err_mutex_unlock; ++ goto err; + } + + /* firmware ready? */ +@@ -65,23 +96,32 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) + /* error bit set? */ + if ((cmd->args[0] >> 6) & 0x01) { + ret = -EREMOTEIO; +- goto err_mutex_unlock; ++ goto err; + } + + if (!((cmd->args[0] >> 7) & 0x01)) { + ret = -ETIMEDOUT; +- goto err_mutex_unlock; ++ goto err; + } + } + +- mutex_unlock(&dev->i2c_mutex); + return 0; +-err_mutex_unlock: +- mutex_unlock(&dev->i2c_mutex); ++err: + dev_dbg(&client->dev, "failed=%d\n", ret); + return ret; + } + ++static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) ++{ ++ int ret; ++ ++ i2c_lock_adapter(client->adapter); ++ ret = si2168_cmd_execute_unlocked(client, cmd); ++ i2c_unlock_adapter(client->adapter); ++ ++ return ret; ++} ++ + static int si2168_ts_bus_ctrl(struct dvb_frontend *fe, int acquire) + { + struct i2c_client *client = fe->demodulator_priv; +@@ -639,9 +679,14 @@ static int si2168_get_tune_settings(struct dvb_frontend *fe, + return 0; + } + +-static int si2168_select(struct i2c_mux_core *muxc, u32 chan) ++/* ++ * I2C gate logic ++ * We must use unlocked I2C I/O because I2C adapter lock is already taken ++ * by the caller (usually tuner driver). ++ */ ++static int si2168_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) + { +- struct i2c_client *client = i2c_mux_priv(muxc); ++ struct i2c_client *client = mux_priv; + int ret; + struct si2168_cmd cmd; + +@@ -649,7 +694,7 @@ static int si2168_select(struct i2c_mux_core *muxc, u32 chan) + memcpy(cmd.args, "\xc0\x0d\x01", 3); + cmd.wlen = 3; + cmd.rlen = 0; +- ret = si2168_cmd_execute(client, &cmd); ++ ret = si2168_cmd_execute_unlocked(client, &cmd); + if (ret) + goto err; + +@@ -659,9 +704,9 @@ static int si2168_select(struct i2c_mux_core *muxc, u32 chan) + return ret; + } + +-static int si2168_deselect(struct i2c_mux_core *muxc, u32 chan) ++static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan) + { +- struct i2c_client *client = i2c_mux_priv(muxc); ++ struct i2c_client *client = mux_priv; + int ret; + struct si2168_cmd cmd; + +@@ -669,7 +714,7 @@ static int si2168_deselect(struct i2c_mux_core *muxc, u32 chan) + memcpy(cmd.args, "\xc0\x0d\x00", 3); + cmd.wlen = 3; + cmd.rlen = 0; +- ret = si2168_cmd_execute(client, &cmd); ++ ret = si2168_cmd_execute_unlocked(client, &cmd); + if (ret) + goto err; + +@@ -733,7 +778,6 @@ static int si2168_probe(struct i2c_client *client, + } + + i2c_set_clientdata(client, dev); +- mutex_init(&dev->i2c_mutex); + + /* Initialize */ + memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13); +@@ -786,22 +830,17 @@ static int si2168_probe(struct i2c_client *client, + (cmd.args[4] - '0') << 8 | (cmd.args[5]) << 0; + + /* create mux i2c adapter for tuner */ +- dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, +- 1, 0, I2C_MUX_LOCKED, +- si2168_select, si2168_deselect); +- if (!dev->muxc) { +- ret = -ENOMEM; ++ dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, ++ client, 0, 0, 0, si2168_select, si2168_deselect); ++ if (dev->adapter == NULL) { ++ ret = -ENODEV; + goto err_kfree; + } +- dev->muxc->priv = client; +- ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); +- if (ret) +- goto err_kfree; + + /* create dvb_frontend */ + memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops)); + dev->fe.demodulator_priv = client; +- *config->i2c_adapter = dev->muxc->adapter[0]; ++ *config->i2c_adapter = dev->adapter; + *config->fe = &dev->fe; + dev->ts_mode = config->ts_mode; + dev->ts_clock_inv = config->ts_clock_inv; +@@ -829,7 +868,7 @@ static int si2168_remove(struct i2c_client *client) + + dev_dbg(&client->dev, "\n"); + +- i2c_mux_del_adapters(dev->muxc); ++ i2c_del_mux_adapter(dev->adapter); + + dev->fe.ops.release = NULL; + dev->fe.demodulator_priv = NULL; +diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h +index 2d362e1..da3cdb6 100644 +--- a/drivers/media/dvb-frontends/si2168_priv.h ++++ b/drivers/media/dvb-frontends/si2168_priv.h +@@ -31,8 +31,7 @@ + + /* state struct */ + struct si2168_dev { +- struct mutex i2c_mutex; +- struct i2c_mux_core *muxc; ++ struct i2c_adapter *adapter; + struct dvb_frontend fe; + enum fe_delivery_system delivery_system; + enum fe_status fe_status; +diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c +index 4f43668..4e34a99 100644 +--- a/drivers/media/usb/cx231xx/cx231xx-core.c ++++ b/drivers/media/usb/cx231xx/cx231xx-core.c +@@ -1340,12 +1340,6 @@ int cx231xx_dev_init(struct cx231xx *dev) + if (errCode < 0) + return errCode; + +- errCode = cx231xx_i2c_mux_create(dev); +- if (errCode < 0) { +- dev_err(dev->dev, +- "%s: Failed to create I2C mux\n", __func__); +- return errCode; +- } + errCode = cx231xx_i2c_mux_register(dev, 0); + if (errCode < 0) + return errCode; +@@ -1473,7 +1467,8 @@ EXPORT_SYMBOL_GPL(cx231xx_dev_init); + void cx231xx_dev_uninit(struct cx231xx *dev) + { + /* Un Initialize I2C bus */ +- cx231xx_i2c_mux_unregister(dev); ++ cx231xx_i2c_mux_unregister(dev, 1); ++ cx231xx_i2c_mux_unregister(dev, 0); + cx231xx_i2c_unregister(&dev->i2c_bus[2]); + cx231xx_i2c_unregister(&dev->i2c_bus[1]); + cx231xx_i2c_unregister(&dev->i2c_bus[0]); +diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c +index 6e1bef2..ad4f36f 100644 +--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c ++++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c +@@ -561,34 +561,35 @@ void cx231xx_i2c_unregister(struct cx231xx_i2c *bus) + * cx231xx_i2c_mux_select() + * switch i2c master number 1 between port1 and port3 + */ +-static int cx231xx_i2c_mux_select(struct i2c_mux_core *muxc, u32 chan_id) ++static int cx231xx_i2c_mux_select(struct i2c_adapter *adap, ++ void *mux_priv, u32 chan_id) + { +- struct cx231xx *dev = i2c_mux_priv(muxc); ++ struct cx231xx *dev = mux_priv; + + return cx231xx_enable_i2c_port_3(dev, chan_id); + } + +-int cx231xx_i2c_mux_create(struct cx231xx *dev) +-{ +- dev->muxc = i2c_mux_alloc(&dev->i2c_bus[1].i2c_adap, dev->dev, 2, 0, 0, +- cx231xx_i2c_mux_select, NULL); +- if (!dev->muxc) +- return -ENOMEM; +- dev->muxc->priv = dev; +- return 0; +-} +- + int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) + { +- return i2c_mux_add_adapter(dev->muxc, +- 0, +- mux_no /* chan_id */, +- 0 /* class */); ++ struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; ++ /* what is the correct mux_dev? */ ++ struct device *mux_dev = dev->dev; ++ ++ dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, ++ mux_dev, ++ dev /* mux_priv */, ++ 0, ++ mux_no /* chan_id */, ++ 0 /* class */, ++ &cx231xx_i2c_mux_select, ++ NULL); ++ return dev->i2c_mux_adap[mux_no] ? 0 : -ENOMEM; + } + +-void cx231xx_i2c_mux_unregister(struct cx231xx *dev) ++void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no) + { +- i2c_mux_del_adapters(dev->muxc); ++ i2c_del_mux_adapter(dev->i2c_mux_adap[mux_no]); ++ dev->i2c_mux_adap[mux_no] = NULL; + } + + struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port) +@@ -601,9 +602,9 @@ struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port) + case I2C_2: + return &dev->i2c_bus[2].i2c_adap; + case I2C_1_MUX_1: +- return dev->muxc->adapter[0]; ++ return dev->i2c_mux_adap[0]; + case I2C_1_MUX_3: +- return dev->muxc->adapter[1]; ++ return dev->i2c_mux_adap[1]; + default: + BUG(); + } +diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h +index 6ffa4bd..fa35642 100644 +--- a/drivers/media/usb/cx231xx/cx231xx.h ++++ b/drivers/media/usb/cx231xx/cx231xx.h +@@ -630,7 +630,6 @@ struct cx231xx { + + /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */ + struct cx231xx_i2c i2c_bus[3]; +- struct i2c_mux_core *muxc; + struct i2c_adapter *i2c_mux_adap[2]; + + unsigned int xc_fw_load_done:1; +@@ -767,9 +766,8 @@ int cx231xx_reset_analog_tuner(struct cx231xx *dev); + void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port); + int cx231xx_i2c_register(struct cx231xx_i2c *bus); + void cx231xx_i2c_unregister(struct cx231xx_i2c *bus); +-int cx231xx_i2c_mux_create(struct cx231xx *dev); + int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no); +-void cx231xx_i2c_mux_unregister(struct cx231xx *dev); ++void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no); + struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port); + + /* Internal block control functions */ +diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +index c76e78f..5c805f8 100644 +--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c ++++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +@@ -1333,7 +1333,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) + case TUNER_RTL2832_R828D: + pdata.clk = dev->rtl2832_platform_data.clk; + pdata.tuner = dev->tuner; +- pdata.regmap = dev->rtl2832_platform_data.regmap; ++ pdata.i2c_client = dev->i2c_client_demod; ++ pdata.bulk_read = dev->rtl2832_platform_data.bulk_read; ++ pdata.bulk_write = dev->rtl2832_platform_data.bulk_write; ++ pdata.update_bits = dev->rtl2832_platform_data.update_bits; + pdata.dvb_frontend = adap->fe[0]; + pdata.dvb_usb_device = d; + pdata.v4l2_subdev = subdev; +diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c +index ab16d3a..2988262 100644 +--- a/drivers/media/dvb-frontends/lgdt3306a.c ++++ b/drivers/media/dvb-frontends/lgdt3306a.c +@@ -79,8 +79,6 @@ struct lgdt3306a_state { + enum fe_modulation current_modulation; + u32 current_frequency; + u32 snr; +- +- struct i2c_mux_core *muxc; + }; + + /* +@@ -2182,20 +2180,142 @@ static const struct dvb_frontend_ops lgdt3306a_ops = { + .search = lgdt3306a_search, + }; + +-static int lgdt3306a_select(struct i2c_mux_core *muxc, u32 chan) ++/* ++ * I2C gate logic ++ * We must use unlocked I2C I/O because I2C adapter lock is already taken ++ * by the caller (usually tuner driver). ++ * select/unselect are unlocked versions of lgdt3306a_i2c_gate_ctrl ++ */ ++static int lgdt3306a_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) + { +- struct i2c_client *client = i2c_mux_priv(muxc); +- struct lgdt3306a_state *state = i2c_get_clientdata(client); ++ struct i2c_client *client = mux_priv; ++ int ret; ++ u8 val; ++ u8 buf[3]; ++ ++ struct i2c_msg read_msg_1 = { ++ .addr = client->addr, ++ .flags = 0, ++ .buf = "\x00\x02", ++ .len = 2, ++ }; ++ struct i2c_msg read_msg_2 = { ++ .addr = client->addr, ++ .flags = I2C_M_RD, ++ .buf = &val, ++ .len = 1, ++ }; ++ ++ struct i2c_msg write_msg = { ++ .addr = client->addr, ++ .flags = 0, ++ .len = 3, ++ .buf = buf, ++ }; ++ ++ ret = __i2c_transfer(client->adapter, &read_msg_1, 1); ++ if (ret != 1) ++ { ++ pr_err("error (addr %02x reg 0x002 error (ret == %i)\n", ++ client->addr, ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } + +- return lgdt3306a_i2c_gate_ctrl(&state->frontend, 1); ++ ret = __i2c_transfer(client->adapter, &read_msg_2, 1); ++ if (ret != 1) ++ { ++ pr_err("error (addr %02x reg 0x002 error (ret == %i)\n", ++ client->addr, ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } ++ ++ buf[0] = 0x00; ++ buf[1] = 0x02; ++ val &= 0x7F; ++ val |= LG3306_TUNERI2C_ON; ++ buf[2] = val; ++ ret = __i2c_transfer(client->adapter, &write_msg, 1); ++ if (ret != 1) { ++ pr_err("error (addr %02x %02x <- %02x, err = %i)\n", ++ write_msg.buf[0], write_msg.buf[1], write_msg.buf[2], ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } ++ return 0; + } + +-static int lgdt3306a_deselect(struct i2c_mux_core *muxc, u32 chan) ++static int lgdt3306a_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan) + { +- struct i2c_client *client = i2c_mux_priv(muxc); +- struct lgdt3306a_state *state = i2c_get_clientdata(client); ++ struct i2c_client *client = mux_priv; ++ int ret; ++ u8 val; ++ u8 buf[3]; ++ ++ struct i2c_msg read_msg_1 = { ++ .addr = client->addr, ++ .flags = 0, ++ .buf = "\x00\x02", ++ .len = 2, ++ }; ++ struct i2c_msg read_msg_2 = { ++ .addr = client->addr, ++ .flags = I2C_M_RD, ++ .buf = &val, ++ .len = 1, ++ }; + +- return lgdt3306a_i2c_gate_ctrl(&state->frontend, 0); ++ struct i2c_msg write_msg = { ++ .addr = client->addr, ++ .flags = 0, ++ .len = 3, ++ .buf = buf, ++ }; ++ ++ ret = __i2c_transfer(client->adapter, &read_msg_1, 1); ++ if (ret != 1) ++ { ++ pr_err("error (addr %02x reg 0x002 error (ret == %i)\n", ++ client->addr, ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } ++ ++ ret = __i2c_transfer(client->adapter, &read_msg_2, 1); ++ if (ret != 1) ++ { ++ pr_err("error (addr %02x reg 0x002 error (ret == %i)\n", ++ client->addr, ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } ++ ++ buf[0] = 0x00; ++ buf[1] = 0x02; ++ val &= 0x7F; ++ val |= LG3306_TUNERI2C_OFF; ++ buf[2] = val; ++ ret = __i2c_transfer(client->adapter, &write_msg, 1); ++ if (ret != 1) { ++ pr_err("error (addr %02x %02x <- %02x, err = %i)\n", ++ write_msg.buf[0], write_msg.buf[1], write_msg.buf[2], ret); ++ if (ret < 0) ++ return ret; ++ else ++ return -EREMOTEIO; ++ } ++ return 0; + } + + static int lgdt3306a_probe(struct i2c_client *client, +@@ -2227,21 +2347,16 @@ static int lgdt3306a_probe(struct i2c_client *client, + state->frontend.ops.release = NULL; + + /* create mux i2c adapter for tuner */ +- state->muxc = i2c_mux_alloc(client->adapter, &client->dev, +- 1, 0, I2C_MUX_LOCKED, +- lgdt3306a_select, lgdt3306a_deselect); +- if (!state->muxc) { +- ret = -ENOMEM; ++ state->i2c_adap = i2c_add_mux_adapter(client->adapter, &client->dev, ++ client, 0, 0, 0, lgdt3306a_select, lgdt3306a_deselect); ++ if (state->i2c_adap == NULL) { ++ ret = -ENODEV; + goto err_kfree; + } +- state->muxc->priv = client; +- ret = i2c_mux_add_adapter(state->muxc, 0, 0, 0); +- if (ret) +- goto err_kfree; + + /* create dvb_frontend */ + fe->ops.i2c_gate_ctrl = NULL; +- *config->i2c_adapter = state->muxc->adapter[0]; ++ *config->i2c_adapter = state->i2c_adap; + *config->fe = fe; + + dev_info(&client->dev, "LG Electronics LGDT3306A successfully identified\n"); +@@ -2261,7 +2376,7 @@ static int lgdt3306a_remove(struct i2c_client *client) + { + struct lgdt3306a_state *state = i2c_get_clientdata(client); + +- i2c_mux_del_adapters(state->muxc); ++ i2c_del_mux_adapter(state->i2c_adap); + + state->frontend.ops.release = NULL; + state->frontend.demodulator_priv = NULL; +diff --git a/drivers/media/dvb-frontends/lgdt3306a.h b/drivers/media/dvb-frontends/lgdt3306a.h +index 8b53044..99b28be 100644 +--- a/drivers/media/dvb-frontends/lgdt3306a.h ++++ b/drivers/media/dvb-frontends/lgdt3306a.h +@@ -21,6 +21,8 @@ + #include + #include + ++#define LG3306_TUNERI2C_ON 0x00 ++#define LG3306_TUNERI2C_OFF 0x80 + + enum lgdt3306a_mpeg_mode { + LGDT3306A_MPEG_PARALLEL = 0, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_copy_to_user_warning.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_copy_to_user_warning.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_copy_to_user_warning.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_copy_to_user_warning.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,16 @@ +diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c +index 97365a8..0330226 100644 +--- a/drivers/media/dvb-core/dvb_ca_en50221.c ++++ b/drivers/media/dvb-core/dvb_ca_en50221.c +@@ -1494,7 +1494,10 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file, + + fragbuf[0] = connection_id; + fragbuf[1] = ((fragpos + fraglen) < count) ? 0x80 : 0x00; +- status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen); ++ /* to fix a warning for older kernels we need to check fraglen explicitly */ ++ status = -1; ++ if (fraglen <= sizeof(fragbuf) - 2) ++ status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen); + if (status) { + status = -EFAULT; + goto exit; diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_dma_attrs.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_dma_attrs.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_dma_attrs.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_dma_attrs.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,321 @@ +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c +index 646b5ae..290327c6 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c +@@ -27,7 +27,7 @@ struct vb2_dc_buf { + unsigned long size; + void *cookie; + dma_addr_t dma_addr; +- unsigned long attrs; ++ struct dma_attrs attrs; + enum dma_data_direction dma_dir; + struct sg_table *dma_sgt; + struct frame_vector *vec; +@@ -130,12 +130,12 @@ static void vb2_dc_put(void *buf_priv) + kfree(buf->sgt_base); + } + dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr, +- buf->attrs); ++ &buf->attrs); + put_device(buf->dev); + kfree(buf); + } + +-static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, ++static void *vb2_dc_alloc(struct device *dev, const struct dma_attrs *attrs, + unsigned long size, enum dma_data_direction dma_dir, + gfp_t gfp_flags) + { +@@ -149,16 +149,16 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs, + return ERR_PTR(-ENOMEM); + + if (attrs) +- buf->attrs = attrs; ++ buf->attrs = *attrs; + buf->cookie = dma_alloc_attrs(dev, size, &buf->dma_addr, +- GFP_KERNEL | gfp_flags, buf->attrs); ++ GFP_KERNEL | gfp_flags, &buf->attrs); + if (!buf->cookie) { + dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size); + kfree(buf); + return ERR_PTR(-ENOMEM); + } + +- if ((buf->attrs & DMA_ATTR_NO_KERNEL_MAPPING) == 0) ++ if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->attrs)) + buf->vaddr = buf->cookie; + + /* Prevent the device from being released while the buffer is used */ +@@ -192,7 +192,7 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma) + vma->vm_pgoff = 0; + + ret = dma_mmap_attrs(buf->dev, vma, buf->cookie, +- buf->dma_addr, buf->size, buf->attrs); ++ buf->dma_addr, buf->size, &buf->attrs); + + if (ret) { + pr_err("Remapping memory failed, error: %d\n", ret); +@@ -375,7 +375,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) + } + + ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr, +- buf->size, buf->attrs); ++ buf->size, &buf->attrs); + if (ret < 0) { + dev_err(buf->dev, "failed to get scatterlist from DMA API\n"); + kfree(sgt); +@@ -424,12 +424,15 @@ static void vb2_dc_put_userptr(void *buf_priv) + struct page **pages; + + if (sgt) { ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + /* + * No need to sync to CPU, it's already synced to the CPU + * since the finish() memop will have been called before this. + */ + dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + pages = frame_vector_pages(buf->vec); + /* sgt should exist only if vector contains pages... */ + BUG_ON(IS_ERR(pages)); +@@ -486,6 +489,9 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, + struct sg_table *sgt; + unsigned long contig_size; + unsigned long dma_align = dma_get_cache_alignment(); ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + + /* Only cache aligned DMA transfers are reliable */ + if (!IS_ALIGNED(vaddr | size, dma_align)) { +@@ -551,7 +557,7 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, + * prepare() memop is called. + */ + sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + if (sgt->nents <= 0) { + pr_err("failed to map scatterlist\n"); + ret = -EIO; +@@ -575,7 +581,7 @@ static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, + + fail_map_sg: + dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + + fail_sgt_init: + sg_free_table(sgt); +diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +index ac49dae..8b79a86 100644 +--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +@@ -95,7 +95,7 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, + return 0; + } + +-static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, ++static void *vb2_dma_sg_alloc(struct device *dev, const struct dma_attrs *dma_attrs, + unsigned long size, enum dma_data_direction dma_dir, + gfp_t gfp_flags) + { +@@ -103,6 +103,9 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, + struct sg_table *sgt; + int ret; + int num_pages; ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + + if (WARN_ON(!dev)) + return ERR_PTR(-EINVAL); +@@ -142,7 +145,7 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs, + * prepare() memop is called. + */ + sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + if (!sgt->nents) + goto fail_map; + +@@ -177,10 +180,13 @@ static void vb2_dma_sg_put(void *buf_priv) + int i = buf->num_pages; + + if (atomic_dec_and_test(&buf->refcount)) { ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + dprintk(1, "%s: Freeing buffer of %d pages\n", __func__, + buf->num_pages); + dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + if (buf->vaddr) + vm_unmap_ram(buf->vaddr, buf->num_pages); + sg_free_table(buf->dma_sgt); +@@ -223,11 +229,13 @@ static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, + { + struct vb2_dma_sg_buf *buf; + struct sg_table *sgt; ++ DEFINE_DMA_ATTRS(attrs); + struct frame_vector *vec; + + if (WARN_ON(!dev)) + return ERR_PTR(-EINVAL); + ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + buf = kzalloc(sizeof *buf, GFP_KERNEL); + if (!buf) + return ERR_PTR(-ENOMEM); +@@ -259,7 +267,7 @@ static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, + * prepare() memop is called. + */ + sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, +- buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); ++ buf->dma_dir, &attrs); + if (!sgt->nents) + goto userptr_fail_map; + +@@ -283,11 +291,14 @@ static void vb2_dma_sg_put_userptr(void *buf_priv) + struct vb2_dma_sg_buf *buf = buf_priv; + struct sg_table *sgt = &buf->sg_table; + int i = buf->num_pages; ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); + + dprintk(1, "%s: Releasing userspace buffer of %d pages\n", + __func__, buf->num_pages); + dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir, +- DMA_ATTR_SKIP_CPU_SYNC); ++ &attrs); + if (buf->vaddr) + vm_unmap_ram(buf->vaddr, buf->num_pages); + sg_free_table(buf->dma_sgt); +diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +index c5b1fa1..d73faa7 100644 +--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c ++++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c +@@ -33,7 +33,7 @@ struct vb2_vmalloc_buf { + + static void vb2_vmalloc_put(void *buf_priv); + +-static void *vb2_vmalloc_alloc(struct device *dev, unsigned long attrs, ++static void *vb2_vmalloc_alloc(struct device *dev, const struct dma_attrs *attrs, + unsigned long size, enum dma_data_direction dma_dir, + gfp_t gfp_flags) + { +diff --git a/drivers/media/platform/sti/bdisp/bdisp-hw.c b/drivers/media/platform/sti/bdisp/bdisp-hw.c +index 26d9fa7..7a1d9f0 100644 +--- a/drivers/media/platform/sti/bdisp/bdisp-hw.c ++++ b/drivers/media/platform/sti/bdisp/bdisp-hw.c +@@ -430,11 +430,14 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp) + */ + void bdisp_hw_free_nodes(struct bdisp_ctx *ctx) + { +- if (ctx && ctx->node[0]) ++ if (ctx && ctx->node[0]) { ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); + dma_free_attrs(ctx->bdisp_dev->dev, + sizeof(struct bdisp_node) * MAX_NB_NODE, +- ctx->node[0], ctx->node_paddr[0], +- DMA_ATTR_WRITE_COMBINE); ++ ctx->node[0], ctx->node_paddr[0], &attrs); ++ } + } + + /** +@@ -452,10 +455,12 @@ int bdisp_hw_alloc_nodes(struct bdisp_ctx *ctx) + unsigned int i, node_size = sizeof(struct bdisp_node); + void *base; + dma_addr_t paddr; ++ DEFINE_DMA_ATTRS(attrs); + + /* Allocate all the nodes within a single memory page */ ++ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); + base = dma_alloc_attrs(dev, node_size * MAX_NB_NODE, &paddr, +- GFP_KERNEL, DMA_ATTR_WRITE_COMBINE); ++ GFP_KERNEL, &attrs); + if (!base) { + dev_err(dev, "%s no mem\n", __func__); + return -ENOMEM; +@@ -488,9 +493,13 @@ void bdisp_hw_free_filters(struct device *dev) + { + int size = (BDISP_HF_NB * NB_H_FILTER) + (BDISP_VF_NB * NB_V_FILTER); + +- if (bdisp_h_filter[0].virt) ++ if (bdisp_h_filter[0].virt) { ++ DEFINE_DMA_ATTRS(attrs); ++ ++ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); + dma_free_attrs(dev, size, bdisp_h_filter[0].virt, +- bdisp_h_filter[0].paddr, DMA_ATTR_WRITE_COMBINE); ++ bdisp_h_filter[0].paddr, &attrs); ++ } + } + + /** +@@ -507,11 +516,12 @@ int bdisp_hw_alloc_filters(struct device *dev) + unsigned int i, size; + void *base; + dma_addr_t paddr; ++ DEFINE_DMA_ATTRS(attrs); + + /* Allocate all the filters within a single memory page */ + size = (BDISP_HF_NB * NB_H_FILTER) + (BDISP_VF_NB * NB_V_FILTER); +- base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL | GFP_DMA, +- DMA_ATTR_WRITE_COMBINE); ++ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); ++ base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL | GFP_DMA, &attrs); + if (!base) + return -ENOMEM; + +diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h +index f6818f73..e7ae732 100644 +--- a/include/media/videobuf2-core.h ++++ b/include/media/videobuf2-core.h +@@ -114,7 +114,7 @@ struct vb2_threadio_data; + * map_dmabuf, unmap_dmabuf. + */ + struct vb2_mem_ops { +- void *(*alloc)(struct device *dev, unsigned long attrs, ++ void *(*alloc)(struct device *dev, const struct dma_attrs *attrs, + unsigned long size, + enum dma_data_direction dma_dir, + gfp_t gfp_flags); +@@ -432,7 +432,7 @@ struct vb2_buf_ops { + * @alloc_devs: &struct device memory type/allocator-specific per-plane device + * @dev: device to use for the default allocation context if the driver + * doesn't fill in the @alloc_devs array. +- * @dma_attrs: DMA attributes to use for the DMA. ++ * @dma_attrs: DMA attributes to use for the DMA. May be NULL. + * @bidirectional: when this flag is set the DMA direction for the buffers of + * this queue will be overridden with %DMA_BIDIRECTIONAL direction. + * This is useful in cases where the hardware (firmware) writes to +@@ -510,7 +510,7 @@ struct vb2_queue { + unsigned int type; + unsigned int io_modes; + struct device *dev; +- unsigned long dma_attrs; ++ const struct dma_attrs *dma_attrs; + unsigned bidirectional:1; + unsigned fileio_read_once:1; + unsigned fileio_write_immediately:1; +diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h +index 5604818..df2aabe 100644 +--- a/include/media/videobuf2-dma-contig.h ++++ b/include/media/videobuf2-dma-contig.h +@@ -16,6 +16,8 @@ + #include + #include + ++struct dma_attrs; ++ + static inline dma_addr_t + vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no) + { diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_objtool_warning.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_objtool_warning.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_objtool_warning.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_objtool_warning.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c +index 44ca66c..c2c7585 100644 +--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c ++++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c +@@ -802,6 +802,8 @@ static void ttusb_dec_process_urb_frame_list(unsigned long data) + kfree(frame); + } + } ++/* to fix a warning for Kernel 4.7 */ ++STACK_FRAME_NON_STANDARD(ttusb_dec_process_urb_frame_list); + + static void ttusb_dec_process_urb(struct urb *urb) + { diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_pci_alloc_irq_vectors.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_pci_alloc_irq_vectors.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.7_pci_alloc_irq_vectors.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.7_pci_alloc_irq_vectors.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,58 @@ +diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c +index c8b1a62..26b08af 100644 +--- a/drivers/media/pci/cobalt/cobalt-driver.c ++++ b/drivers/media/pci/cobalt/cobalt-driver.c +@@ -298,7 +298,9 @@ static void cobalt_pci_iounmap(struct cobalt *cobalt, struct pci_dev *pci_dev) + static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev) + { + free_irq(pci_dev->irq, (void *)cobalt); +- pci_free_irq_vectors(pci_dev); ++ ++ if (cobalt->msi_enabled) ++ pci_disable_msi(pci_dev); + } + + static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, +@@ -375,12 +377,14 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, + from being generated. */ + cobalt_set_interrupt(cobalt, false); + +- if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) { ++ if (pci_enable_msi_range(pci_dev, 1, 1) < 1) { + cobalt_err("Could not enable MSI\n"); ++ cobalt->msi_enabled = false; + ret = -EIO; + goto err_release; + } + msi_config_show(cobalt, pci_dev); ++ cobalt->msi_enabled = true; + + /* Register IRQ */ + if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED, +diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h +index 429bee4..cc33b3a 100644 +--- a/drivers/media/pci/cobalt/cobalt-driver.h ++++ b/drivers/media/pci/cobalt/cobalt-driver.h +@@ -275,6 +275,8 @@ struct cobalt { + u32 irq_none; + u32 irq_full_fifo; + ++ bool msi_enabled; ++ + /* omnitek dma */ + int dma_channels; + int first_fifo_channel; +diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c +index 21cce8c..3db28de 100644 +--- a/drivers/media/pci/ddbridge/ddbridge-main.c ++++ b/drivers/media/pci/ddbridge/ddbridge-main.c +@@ -106,8 +106,7 @@ static void ddb_irq_msi(struct ddb *dev, int nr) + int stat; + + if (msi && pci_msi_enabled()) { +- stat = pci_alloc_irq_vectors(dev->pdev, 1, nr, +- PCI_IRQ_MSI | PCI_IRQ_MSIX); ++ stat = pci_enable_msi_range(dev->pdev, 1, nr); + if (stat >= 1) { + dev->msi = stat; + dev_info(dev->dev, "using %d MSI interrupt(s)\n", diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.8_em28xx_bitfield.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.8_em28xx_bitfield.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.8_em28xx_bitfield.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.8_em28xx_bitfield.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,34 @@ +diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h +index 63c7c61..5fc70d9 100644 +--- a/drivers/media/usb/em28xx/em28xx.h ++++ b/drivers/media/usb/em28xx/em28xx.h +@@ -23,8 +23,6 @@ + #ifndef _EM28XX_H + #define _EM28XX_H + +-#include +- + #define EM28XX_VERSION "0.2.2" + #define DRIVER_DESC "Empia em28xx device driver" + +@@ -382,14 +380,14 @@ enum em28xx_amux { + + enum em28xx_aout { + /* AC97 outputs */ +- EM28XX_AOUT_MASTER = BIT(0), +- EM28XX_AOUT_LINE = BIT(1), +- EM28XX_AOUT_MONO = BIT(2), +- EM28XX_AOUT_LFE = BIT(3), +- EM28XX_AOUT_SURR = BIT(4), ++ EM28XX_AOUT_MASTER = 1 << 0, ++ EM28XX_AOUT_LINE = 1 << 1, ++ EM28XX_AOUT_MONO = 1 << 2, ++ EM28XX_AOUT_LFE = 1 << 3, ++ EM28XX_AOUT_SURR = 1 << 4, + + /* PCM IN Mixer - used by AC97_RECORD_SELECT register */ +- EM28XX_AOUT_PCM_IN = BIT(7), ++ EM28XX_AOUT_PCM_IN = 1 << 7, + + /* Bits 10-8 are used to indicate the PCM IN record select */ + EM28XX_AOUT_PCM_MIC_PCM = 0 << 8, diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.8_user_pages_flag.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.8_user_pages_flag.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.8_user_pages_flag.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.8_user_pages_flag.patch 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,93 @@ +diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c +index 3b33e87..f98f7a0 100644 +--- a/drivers/media/pci/ivtv/ivtv-udma.c ++++ b/drivers/media/pci/ivtv/ivtv-udma.c +@@ -124,8 +124,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, + } + + /* Get user pages for DMA Xfer */ +- err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, +- dma->map, FOLL_FORCE); ++ err = get_user_pages_unlocked(user_dma.uaddr, user_dma.page_count, 0, ++ 1, dma->map); + + if (user_dma.page_count != err) { + IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n", +diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c +index 44936d6..a61f632 100644 +--- a/drivers/media/pci/ivtv/ivtv-yuv.c ++++ b/drivers/media/pci/ivtv/ivtv-yuv.c +@@ -76,12 +76,11 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, + + /* Get user pages for DMA Xfer */ + y_pages = get_user_pages_unlocked(y_dma.uaddr, +- y_dma.page_count, &dma->map[0], FOLL_FORCE); ++ y_dma.page_count, 0, 1, &dma->map[0]); + uv_pages = 0; /* silence gcc. value is set and consumed only if: */ + if (y_pages == y_dma.page_count) { + uv_pages = get_user_pages_unlocked(uv_dma.uaddr, +- uv_dma.page_count, &dma->map[y_pages], +- FOLL_FORCE); ++ uv_dma.page_count, 0, 1, &dma->map[y_pages]); + } + + if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index b6189a4..c799917 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -156,7 +156,6 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, + { + unsigned long first, last; + int err, rw = 0; +- unsigned int flags = FOLL_FORCE; + + dma->direction = direction; + switch (dma->direction) { +@@ -179,18 +178,16 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, + if (NULL == dma->pages) + return -ENOMEM; + +- if (rw == READ) +- flags |= FOLL_WRITE; +- + dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n", + data, size, dma->nr_pages); + +- err = get_user_pages_longterm(data & PAGE_MASK, dma->nr_pages, +- flags, dma->pages, NULL); ++ err = get_user_pages(data & PAGE_MASK, dma->nr_pages, ++ rw == READ, 1, /* force */ ++ dma->pages, NULL); + + if (err != dma->nr_pages) { + dma->nr_pages = (err >= 0) ? err : 0; +- dprintk(1, "get_user_pages_longterm: err=%d [%d]\n", err, ++ dprintk(1, "get_user_pages: err=%d [%d]\n", err, + dma->nr_pages); + return err < 0 ? err : -EINVAL; + } +diff --git a/drivers/media/common/videobuf2/videobuf2-memops.c b/drivers/media/common/videobuf2/videobuf2-memops.c +index 00bb08f..9e65048 100644 +--- a/drivers/media/common/videobuf2/videobuf2-memops.c ++++ b/drivers/media/common/videobuf2/videobuf2-memops.c +@@ -42,10 +42,6 @@ struct frame_vector *vb2_create_framevec(unsigned long start, + unsigned long first, last; + unsigned long nr; + struct frame_vector *vec; +- unsigned int flags = FOLL_FORCE; +- +- if (write) +- flags |= FOLL_WRITE; + + first = start >> PAGE_SHIFT; + last = (start + length - 1) >> PAGE_SHIFT; +@@ -53,7 +49,7 @@ struct frame_vector *vb2_create_framevec(unsigned long start, + vec = frame_vector_create(nr); + if (!vec) + return ERR_PTR(-ENOMEM); +- ret = get_vaddr_frames(start & PAGE_MASK, nr, flags, vec); ++ ret = get_vaddr_frames(start & PAGE_MASK, nr, write, true, vec); + if (ret < 0) + goto out_destroy; + /* We accept only complete set of PFNs */ diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.9_dvb_net_max_mtu.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.9_dvb_net_max_mtu.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.9_dvb_net_max_mtu.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.9_dvb_net_max_mtu.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,20 @@ +diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c +index 8f11d7e..de27c2f 100644 +--- a/drivers/media/dvb-core/dvb_net.c ++++ b/drivers/media/dvb-core/dvb_net.c +@@ -1333,6 +1333,7 @@ static const struct net_device_ops dvb_netdev_ops = { + .ndo_start_xmit = dvb_net_tx, + .ndo_set_rx_mode = dvb_net_set_multicast_list, + .ndo_set_mac_address = dvb_net_set_mac, ++ .ndo_change_mtu = eth_change_mtu, + .ndo_validate_addr = eth_validate_addr, + }; + +@@ -1343,7 +1344,6 @@ static void dvb_net_setup(struct net_device *dev) + dev->header_ops = &dvb_header_ops; + dev->netdev_ops = &dvb_netdev_ops; + dev->mtu = 4096; +- dev->max_mtu = 4096; + + dev->flags |= IFF_NOARP; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/backports/v4.9_mm_address.patch media-build-dkms-0005~trusty/media-build-0005/backports/v4.9_mm_address.patch --- media-build-dkms-0004~trusty/media-build-0005/backports/v4.9_mm_address.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/backports/v4.9_mm_address.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,20 @@ +diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c +index ba63ca5..1db0af6 100644 +--- a/drivers/media/v4l2-core/videobuf-dma-sg.c ++++ b/drivers/media/v4l2-core/videobuf-dma-sg.c +@@ -439,12 +439,13 @@ static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) + struct page *page; + + dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n", +- vmf->address, vma->vm_start, vma->vm_end); ++ (unsigned long)vmf->virtual_address, ++ vma->vm_start, vma->vm_end); + + page = alloc_page(GFP_USER | __GFP_DMA32); + if (!page) + return VM_FAULT_OOM; +- clear_user_highpage(page, vmf->address); ++ clear_user_highpage(page, (unsigned long)vmf->virtual_address); + vmf->page = page; + + return 0; diff -Nru media-build-dkms-0004~trusty/media-build-0005/build_all.sh media-build-dkms-0005~trusty/media-build-0005/build_all.sh --- media-build-dkms-0004~trusty/media-build-0005/build_all.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/build_all.sh 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,255 @@ +#!/bin/bash + +function usage { + echo "Usage: $0 [-l][-v][-c][-db][-dc][-dt][--help]" + echo " -c ... clean" + echo " -l ... make linux" + echo " -v ... make v4l" + echo " -db .. DKMS build" + echo " -dc .. DKMS clean" + echo " -dt .. DKMS TAR" + echo " Note: If -l and -v are not present, both are executed." + echo " The order of the options needs to be as written above!" + echo " If -db or -dc are present, -c, -l and -v are ignored and" + echo " is used as the installation path." + echo " If -dt is present, all other options are ignored. This will" + echo " do implicite -c and then create the TAR archive." + exit 1 +} + +function disable_opt { + echo Disabling ${1} + sed -i \ + -e s/${1}=[y\|m]/#\ ${1}\ is\ not\ set/ \ + v4l/.config +} + +function set_opt_y { + echo Enabling Y ${1} + sed -i \ + -e s/#\ ${1}\ is\ not\ set/${1}=y/ \ + v4l/.config +} + +function set_opt_m { + echo Enabling M ${1} + sed -i \ + -e s/#\ ${1}\ is\ not\ set/${1}=m/ \ + v4l/.config +} + +function set_opt_value { + echo Setting ${1} to ${2} + sed -i \ + -e s/${1}=.*/${1}=${2}/ \ + v4l/.config +} + +function make_linux { + cd linux + + if [ "${do_clean}" = "y" ] ; then + make ${linux_clean} + # mm remains, should be reportded to media_build maintainers + rm -rf mm + + if [ "${do_tar}" == "y" ] ; then + make tar DIR=../${1} + rm -f git_log + rm -f kernel_version.h + fi + else + if [ "${do_dkms}" != "y" ] ; then + make tar DIR=../${1} + fi + make untar + fi + + cd .. +} + +function import_options { + # we need the list sorted according to the number prefix + inc_files=$(find . -name "*.inc" | sort -u) + if [ -n "${inc_files}" ] ; then + for incfile in ${inc_files} ; do + # we allow only the functions we define in this script + rm -f ${incfile}.tmp + sed -n -e '/^disable_opt/p' -e '/^set_opt_y/p' -e '/^set_opt_m/p' \ + -e '/^set_opt_value/p' ${incfile} > ${incfile}.tmp + source ${incfile}.tmp + rm ${incfile}.tmp + done + fi +} + +function make_v4l { + if [ "${do_clean}" = "y" ] ; then + make ${v4l_clean} + + if [ -d "${dkms_inst_dir}" -a "${do_dkms}" = "y" ] ; then + if [ -d "${dkms_inst_dir}" ] ; then + # additional security to be sure we remove the right directory + if [ -f "${dkms_inst_dir}/DKMS_INST" ] ; then + rm -rf ${dkms_inst_dir} + else + echo "Error: '${dkms_inst_dir}' is no DKMS install path!" + exit 4 + fi + fi + fi + else + make stagingconfig + + import_options + + make -j${job_num} + + if [ "${do_dkms}" = "y" ] ; then + if [ ! -d "${dkms_inst_dir}" ] ; then + make DESTDIR=${dkms_inst_dir} install + if [ $? -eq 0 ] ; then + # additional security to be sure we remove the right directory + # when cleaning (option -dc) + rm -rf ${dkms_inst_dir}/DKMS_INST + date -R > ${dkms_inst_dir}/DKMS_INST + fi + else + echo "Error: DKMS install path '${dkms_inst_dir}' already exists!" + exit 3 + fi + fi + fi +} + +if [ $# -lt 1 ] ; then + usage +fi + +# matches "--help" also +if [[ ${1} =~ ^-.* ]] ; then + usage +fi + +# determine num of available cores for make job control +nProc=$(getconf _NPROCESSORS_ONLN) +job_num=$(( nProc + 1 )) + +kernelsourcedir=${1} +shift + +linux_clean="distclean" +v4l_clean="distclean" +do_dkms="d" +do_linux="d" +do_v4l="d" +do_tar="d" + +# Some DKMS version might need to override jobs, so checking +# for an environment variable JOBS +if [ -n "${JOBS}" ] ; then + # JOBS need to be numeric + case ${JOBS} in + '' | *[!0-9]*) + echo "Error: ENV Variable 'JOBS' ins not numeric!" + exit 2 + ;; + esac + job_num=${JOBS} +fi + +if [ "${1}" = "-l" ] ; then + do_linux="y" + do_v4l="n" + shift +fi + +if [ "${1}" = "-v" ] ; then + do_v4l="y" + if [ "${do_linux}" = "d" ] ; then + do_linux="n" + fi + shift +fi + +if [ "${1}" = "-c" ] ; then + do_clean="y" + do_linux="d" + do_v4l="d" + shift +fi + +if [ "${1}" = "-db" ] ; then + do_clean="n" + do_linux="d" + do_v4l="d" + do_dkms="y" + dkms_inst_dir="${kernelsourcedir}" + shift +fi + +if [ "${1}" = "-dc" ] ; then + do_clean="y" + do_linux="d" + do_v4l="d" + # keep the linux tree tar.bz2 file + linux_clean="clean" + do_dkms="y" + dkms_inst_dir="${kernelsourcedir}" + shift +fi + +if [ "${1}" = "-dt" ] ; then + do_clean="y" + do_linux="d" + do_v4l="d" + do_dkms="d" + do_tar="y" + # default might be overridden already + linux_clean="distclean" + v4l_clean="distclean" + shift +fi + +# needs to be last +if [ "${1}" = "--help" ] ; then + usage +fi + +if [ $# -gt 0 ] ; then + usage +fi + +if [ "${do_dkms}" != "y" ] ; then + if [ ! -d ${kernelsourcedir} ] ; then + echo "Error: Kernel source dir '${kernelsourcedir}' does not exist!" + exit 5 + fi + + txt_body="for kernel sources at ${kernelsourcedir}" + txt_dkms="" +else + txt_body="with installation path ${kernelsourcedir}" + txt_dkms="DKMS: " +fi + +if [ "${do_clean}" != "y" ] ; then + txt_start="${txt_dkms}Running media build ${txt_body}" +else + txt_start="${txt_dkms}Cleaning media build" +fi + +echo "${txt_start}" + +if [ -n "${VER}" -a "${do_clean}" != "y" ] ; then + # generate first ./v4l/.version, which is used by all other scripts + make VER=${VER} release +fi + +if [ "${do_linux}" = "y" -o "${do_linux}" = "d" ] ; then + make_linux ${kernelsourcedir} +fi + +if [ "${do_v4l}" = "y" -o "${do_v4l}" = "d" ] ; then + make_v4l +fi diff -Nru media-build-dkms-0004~trusty/media-build-0005/COPYING media-build-dkms-0005~trusty/media-build-0005/COPYING --- media-build-dkms-0004~trusty/media-build-0005/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/COPYING 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -Nru media-build-dkms-0004~trusty/media-build-0005/devel_scripts/analyze_build.pl media-build-dkms-0005~trusty/media-build-0005/devel_scripts/analyze_build.pl --- media-build-dkms-0004~trusty/media-build-0005/devel_scripts/analyze_build.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/devel_scripts/analyze_build.pl 2014-03-14 19:33:42.000000000 +0000 @@ -0,0 +1,303 @@ +#!/usr/bin/perl + +# Copyright (C) 2006 Trent Piepho +# Scans a tree of Linux Kernel style Makefiles, and builds lists of what +# builds what. +# Outputs three lists: +# 1. Kconfig variables associated with the kernel module(s) they turn on +# 2. Kernel modules associated with their source file(s) +# 3. Kconfig variables associated with all the source file(s) they turn on +# +# Optional options: +# Prefix relative to source tree root to start scanning in. This +# will be stripped from the beginnings of all filenames printed out. +# Default is 'linux/drivers/media' +# Root of source tree +# Default is to use 'hg root' command and if that fails the cwd +# +# Most usefull with grep, for example +# List of modules and source files used by DVB_BUDGET_AV +# deps.pl | grep DVB_BUDGET_AV +# +# Kconfig variable and kernel module that use dvb-usb-init.c +# deps.pl | grep dvb-usb-init.c +# +# Kconfig variable and source files that make dvb-core.ko +# deps.pl | grep dvb-core.ko +# +# Also has some ability to check Makefiles for errors +use strict; +use FileHandle; +use Getopt::Long; +use Pod::Usage; + +# Controls what will be displayed +my $check; +my $show_modules; +my $show_files_per_module; +my $show_files_per_config; +my $show_all; +my $help; +my $man; + +# Directory to start in. Will be stripped from all filenames printed out. +my $prefix = 'linux/drivers/media/'; + +GetOptions( + "path=s" => \$prefix, + "extra_check" => \$check, + "show_modules" => \$show_modules, + "show_files_per_module" => \$show_files_per_module, + "show_files_per_config" => \$show_files_per_config, + "show_all" => \$show_all, + 'help|?' => \$help, + man => \$man +) or pod2usage(2); + +pod2usage(1) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $man; + +if ($show_all) { + $show_modules = 1; + $show_files_per_module = 1; + $show_files_per_config = 1; +} + +# List of Makefile's opened +my %makefiles = (); + +# For each Kconfig variable, a list of modules it builds +my %config = (); + +# For each module that is made up of multiple source files, list of sources +my %multi = (); + +sub open_makefile($) { + my $file = shift; + + # only open a given Makefile once + return if exists $makefiles{$file}; + $makefiles{$file} = 1; + + $file =~ m|^(.*)/[^/]*$|; + my $dir = $1; + + # print STDERR "opening $root$file (dir=$dir)\n"; + my $in = new FileHandle; + open $in, '<', "$file" or die "Unable to open Makefile '$file': $!"; + + while (<$in>) { + # print STDERR "Line: $_"; + # Skip comment and blank lines + next if (/^\s*(#.*)?$/); + m/^\s*\-?include/ and die "Can't handle includes! In $file"; + + # Handle line continuations + if (/\\\n$/) { + $_ .= <$in>; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + # Eat comments + s/#.*$//; + + if (/^\s*ccflags-(.*)?\s*([:+]?)=\s*(\S.*?)\s*$/) { + if ($check) { + print STDERR "Should use '+=' with ccflags-$1 in $file:$.\n$_\n" if ($2 ne "+"); + } + next; + } + if (/^\s*obj-(\S+)\s*([:+]?)=\s*(\S.*?)\s*$/) { + print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $2 ne '+'); + my ($var,$targets) = ($1, $3); + if ($var =~ /\$\(CONFIG_(\S+)\)$/) { + $var = $1; + } elsif ($var !~ /^[ym]$/) { + print STDERR "Confused by obj assignment '$var' in $file:$.\n$_"; + } + foreach(split(/\s+/, $targets)) { + if (m|/$|) { # Ends in /, means it's a directory + open_makefile("$dir/$_".'Makefile'); + } elsif (/^(\S+)\.o$/) { + push @{$config{$var}}, "$dir/$1"; + } else { + print STDERR "Confused by target '$_' in $file:$.\n"; + } + } + next; + } + if (/(\S+)-objs\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { + my @files = split(/\s+/, $3); + foreach my $f (@files) { + $f =~ s|^(.*)\.o$|$dir/$1|; + } + if ($2 eq '+') { + # Adding to files + print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); + push @files, split(/\s+/, $multi{"$dir/$1"}); + } else { + print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); + } + $multi{"$dir/$1"} = "@files"; + next; + } + if (/^\s*(\S+)-[ym]?\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { + my @files = split(/\s+/, $3); + foreach my $f (@files) { + $f =~ s|^(.*)\.o$|$dir/$1|; + } + if ($2 eq '+') { + # Adding to files + print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); + push @files, split(/\s+/, $multi{"$dir/$1"}); + } else { + print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); + } + $multi{"$dir/$1"} = "@files"; + next; + } + if (/^\s*(\S+)-\$\((\S+)\)\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { + print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $3 ne '+'); + my ($var, $files, $targets) = ($2, $3, $4); + $multi{"$dir/$1"} = $files; + foreach(split(/\s+/, $targets)) { + if (m|/$|) { # Ends in /, means it's a directory + open_makefile("$dir/$_".'Makefile'); + } elsif (/^(\S+)\.o$/) { + push @{$config{$var}}, "$dir/$1"; + } else { + print STDERR "Confused by target '$_' in $file:$.\n"; + } + } + next; + } + if (/^\s*EXTRA_CFLAGS\s*([:+]?)\s*=\s*(\S.*?)\s*$/) { + if ($check) { + sub allI { /^-I/ or return 0 foreach split(/\s+/, $_[0]);return 1; } + my $use = allI($2) ? ':' : '+'; + print STDERR "Should use '$use=' with EXTRA_CFLAGS in $file:$.\n$_\n" if ($1 ne $use); + } + next; + } + print STDERR "Odd line $file:$.\n$_\n" if ($check); + } +} + +open_makefile($prefix."Makefile"); + +if ($show_modules) { + print "# Kconfig variable = kernel modules built\n"; + foreach my $var (keys %config) { + my @list = @{$config{$var}}; + map { s/^$prefix(.*)$/\1.ko/ } @list; + printf "%-22s= %s\n", $var, join(' ', @list); + } +} + +if ($show_files_per_module) { + print "\n# kernel module = source files\n"; + my %modules = (); + foreach my $mods (values %config) { + $modules{$_} = 1 foreach @$mods; + } + foreach (keys %modules) { + /$prefix(.*)$/; + printf "%-30s = ", "$1.ko"; + if (exists $multi{$_}) { + my @list = split(/\s+/, $multi{$_}); + map { s/^$prefix(.*)$/\1.c/ } @list; + print join(' ', @list), "\n"; + } else { + print "$1.c\n"; + } + } +} + +if ($show_files_per_config) { + print "\n# Kconfig varible = source files\n"; + while (my ($var, $list) = each %config) { + my @outlist = (); + foreach (@$list) { + if (exists $multi{$_}) { + push @outlist, split(/\s+/, $multi{$_}); + } else { + push @outlist, $_; + } + } + map { s/^$prefix(.*)$/\1.c/ } @outlist; + printf "%-22s= %s\n", $var, join(' ', @outlist); + } +} +exit; + +__END__ + +=head1 NAME + +analyze_build.pl - Analyze the Kernel Makefiles to detect its config + +=head1 SYNOPSIS + +B [--path path] [--extra_check] [--show_modules] + [--show_files_per_module] [--show_files_per_config] + +=head1 OPTIONS + +=over 8 + +=item B<--path> path + +Path for the Kernel sub-tree to check. Default: linux/drivers/media. + +=item B<--extra_check> + +Enable extra checks + +=item B<--show_modules> + +Show modules (.ko files) and their corresponding Kconfig option + +=item B<--show_files_per_module> + +Show C source files for each module (.ko file) + +=item B<--show_files_per_config> + +Show C source files for each Kconfig option + +=item B<--show_all> + +Equivalent to B<--show_modules> B<--show_files_per_module B<--show_files_per_config> + +=item B<--help> + +Prints a brief help message and exits. + +=item B<--man> + +Prints the manual page and exits. + +=back + +=head1 DESCRIPTION + +B talk with an IMAP server to read messages with +patches from it. + +=head1 BUGS + +Report bugs to + +=head1 COPYRIGHT + +Copyright (c) 2006 Trent Piepho + +Copyright (c) 2012 by Mauro Carvalho Chehab + +License GPLv2: GNU GPL version 2 . + +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +=cut diff -Nru media-build-dkms-0004~trusty/media-build-0005/devel_scripts/gen_rename_patch.pl media-build-dkms-0005~trusty/media-build-0005/devel_scripts/gen_rename_patch.pl --- media-build-dkms-0004~trusty/media-build-0005/devel_scripts/gen_rename_patch.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/devel_scripts/gen_rename_patch.pl 2013-02-08 00:32:44.000000000 +0000 @@ -0,0 +1,35 @@ +#!/usr/bin/perl +use strict; + +my $debug=0; +my $from; +my $to; +my $sed; + +while (<>) { + $from = $1 if (/^rename from (.*)/); + $to = $1 if (/^rename to (.*)/); + + if ($from && $to) { + printf "$from -> $to\n" if ($debug); + $from =~ s/\./\\./g; + $to =~ s/\./\\./g; + $sed .= "\t-e 's,$from,$to,g' \\\n"; + $from = 0; + $to = 0; + } +} + +$sed =~ s/\s*\|\s* \\\s*$//; +$sed =~ s/^\s*//; + +open OUT, ">rename_patch.sh"; +print OUT "#!/bin/bash\n\n"; +print OUT "if [ \"\$1\" == \"\" ]; then echo \"usage: $0 \"; exit -1; fi\n\n"; +print OUT "OLD=\"\$1.old\"\n"; +print OUT "mv \$1 \$OLD && "; +print OUT "cat \$OLD | sed $sed >\$1 && \\\n"; +print OUT "echo -e \"old patch stored as \"\$OLD\"\\n\$1 rewrote.\"\n"; +close OUT; + +chmod(0755, "rename_patch.sh"); diff -Nru media-build-dkms-0004~trusty/media-build-0005/devel_scripts/README media-build-dkms-0005~trusty/media-build-0005/devel_scripts/README --- media-build-dkms-0004~trusty/media-build-0005/devel_scripts/README 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/devel_scripts/README 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,36 @@ +The files on this directory are ancillary scripts to help developers +to submit patch. They are: + +1) gen_rename_patch.pl + +Function: + This script takes an output of "git diff -M" + command and uses it to produce a script that renames files/patches, + called rename_patch.sh. + +Usage: + git diff 2ea4b44..b3f5260 -M | ./gen_rename_patch.pl + +Description: + After running the script, it will create a small shell script that + will read a patch file and change all occurences there where the + old filenames were used, chaning it to the new filenames. + Only "cat", "sed" and "mv" are needed for the produced rename_patch.sh + script to run. + +2) rename_patch.sh + +Function: + This script was generated via gen_rename_patch.pl. It tracks the + 10-patch series (changesets 2ea4b44..b3f5260) that change the + tree structure for the DVB files. + +Usage: + ./rename_patch.sh + +Description: + + This script will rename the to .old, and write a + new file, that will properly apply to the new tree. + It is useful to convert a patch designed to be applied before + the tree structure changes. diff -Nru media-build-dkms-0004~trusty/media-build-0005/devel_scripts/rename_patch.sh media-build-dkms-0005~trusty/media-build-0005/devel_scripts/rename_patch.sh --- media-build-dkms-0004~trusty/media-build-0005/devel_scripts/rename_patch.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/devel_scripts/rename_patch.sh 2013-02-08 00:32:44.000000000 +0000 @@ -0,0 +1,1441 @@ +#!/bin/bash + +if [ "$1" == "" ]; then echo "usage: /home/v4l/media_build/devel_scripts/gen_rename_patch.pl "; exit -1; fi + +OLD="$1.old" +mv $1 $OLD && cat $OLD | sed -e 's,drivers/media/dvb/b2c2/Kconfig,drivers/media/common/b2c2/Kconfig,g' \ + -e 's,include/linux/dvb/ca\.h,include/uapi/linux/dvb/ca\.h,g' \ + -e 's,include/linux/dvb/frontend\.h,include/uapi/linux/dvb/frontend\.h,g' \ + -e 's,include/linux/dvb/net\.h,include/uapi/linux/dvb/net\.h,g' \ + -e 's,include/linux/dvb/osd\.h,include/uapi/linux/dvb/osd\.h,g' \ + -e 's,include/linux/dvb/version\.h,include/uapi/linux/dvb/version\.h,g' \ + -e 's,include/linux/ivtvfb\.h,include/uapi/linux/ivtvfb\.h,g' \ + -e 's,include/linux/ivtv\.h,include/uapi/linux/ivtv\.h,g' \ + -e 's,include/linux/media\.h,include/uapi/linux/media\.h,g' \ + -e 's,include/linux/meye\.h,include/uapi/linux/meye\.h,g' \ + -e 's,include/linux/uvcvideo\.h,include/uapi/linux/uvcvideo\.h,g' \ + -e 's,include/linux/v4l2-common\.h,include/uapi/linux/v4l2-common\.h,g' \ + -e 's,include/linux/v4l2-controls\.h,include/uapi/linux/v4l2-controls\.h,g' \ + -e 's,include/linux/v4l2-dv-timings\.h,include/uapi/linux/v4l2-dv-timings\.h,g' \ + -e 's,include/linux/v4l2-mediabus\.h,include/uapi/linux/v4l2-mediabus\.h,g' \ + -e 's,include/linux/v4l2-subdev\.h,include/uapi/linux/v4l2-subdev\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-common\.h,drivers/media/common/b2c2/flexcop-common\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-eeprom\.c,drivers/media/common/b2c2/flexcop-eeprom\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-fe-tuner\.c,drivers/media/common/b2c2/flexcop-fe-tuner\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-hw-filter\.c,drivers/media/common/b2c2/flexcop-hw-filter\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-i2c\.c,drivers/media/common/b2c2/flexcop-i2c\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-misc\.c,drivers/media/common/b2c2/flexcop-misc\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-reg\.h,drivers/media/common/b2c2/flexcop-reg\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-sram\.c,drivers/media/common/b2c2/flexcop-sram\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop\.c,drivers/media/common/b2c2/flexcop\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop\.h,drivers/media/common/b2c2/flexcop\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop_ibi_value_be\.h,drivers/media/common/b2c2/flexcop_ibi_value_be\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop_ibi_value_le\.h,drivers/media/common/b2c2/flexcop_ibi_value_le\.h,g' \ + -e 's,drivers/media/common/saa7146_core\.c,drivers/media/common/saa7146/saa7146_core\.c,g' \ + -e 's,drivers/media/common/saa7146_fops\.c,drivers/media/common/saa7146/saa7146_fops\.c,g' \ + -e 's,drivers/media/common/saa7146_hlp\.c,drivers/media/common/saa7146/saa7146_hlp\.c,g' \ + -e 's,drivers/media/common/saa7146_i2c\.c,drivers/media/common/saa7146/saa7146_i2c\.c,g' \ + -e 's,drivers/media/common/saa7146_vbi\.c,drivers/media/common/saa7146/saa7146_vbi\.c,g' \ + -e 's,drivers/media/common/saa7146_video\.c,drivers/media/common/saa7146/saa7146_video\.c,g' \ + -e 's,drivers/media/dvb/siano/Kconfig,drivers/media/common/siano/Kconfig,g' \ + -e 's,drivers/media/dvb/siano/Makefile,drivers/media/common/siano/Makefile,g' \ + -e 's,drivers/media/dvb/siano/sms-cards\.c,drivers/media/common/siano/sms-cards\.c,g' \ + -e 's,drivers/media/dvb/siano/sms-cards\.h,drivers/media/common/siano/sms-cards\.h,g' \ + -e 's,drivers/media/dvb/siano/smscoreapi\.c,drivers/media/common/siano/smscoreapi\.c,g' \ + -e 's,drivers/media/dvb/siano/smscoreapi\.h,drivers/media/common/siano/smscoreapi\.h,g' \ + -e 's,drivers/media/dvb/siano/smsdvb\.c,drivers/media/common/siano/smsdvb\.c,g' \ + -e 's,drivers/media/dvb/siano/smsendian\.c,drivers/media/common/siano/smsendian\.c,g' \ + -e 's,drivers/media/dvb/siano/smsendian\.h,drivers/media/common/siano/smsendian\.h,g' \ + -e 's,drivers/media/dvb/siano/smsir\.c,drivers/media/common/siano/smsir\.c,g' \ + -e 's,drivers/media/dvb/siano/smsir\.h,drivers/media/common/siano/smsir\.h,g' \ + -e 's,drivers/media/dvb/Kconfig,drivers/media/dvb-core/Kconfig,g' \ + -e 's,drivers/media/dvb/dvb-core/Makefile,drivers/media/dvb-core/Makefile,g' \ + -e 's,drivers/media/dvb/dvb-core/demux\.h,drivers/media/dvb-core/demux\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dmxdev\.c,drivers/media/dvb-core/dmxdev\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dmxdev\.h,drivers/media/dvb-core/dmxdev\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb-usb-ids\.h,drivers/media/dvb-core/dvb-usb-ids\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_ca_en50221\.c,drivers/media/dvb-core/dvb_ca_en50221\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_ca_en50221\.h,drivers/media/dvb-core/dvb_ca_en50221\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_demux\.c,drivers/media/dvb-core/dvb_demux\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_demux\.h,drivers/media/dvb-core/dvb_demux\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_filter\.c,drivers/media/dvb-core/dvb_filter\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_filter\.h,drivers/media/dvb-core/dvb_filter\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_frontend\.c,drivers/media/dvb-core/dvb_frontend\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_frontend\.h,drivers/media/dvb-core/dvb_frontend\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_math\.c,drivers/media/dvb-core/dvb_math\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_math\.h,drivers/media/dvb-core/dvb_math\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_net\.c,drivers/media/dvb-core/dvb_net\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_net\.h,drivers/media/dvb-core/dvb_net\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_ringbuffer\.c,drivers/media/dvb-core/dvb_ringbuffer\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvb_ringbuffer\.h,drivers/media/dvb-core/dvb_ringbuffer\.h,g' \ + -e 's,drivers/media/dvb/dvb-core/dvbdev\.c,drivers/media/dvb-core/dvbdev\.c,g' \ + -e 's,drivers/media/dvb/dvb-core/dvbdev\.h,drivers/media/dvb-core/dvbdev\.h,g' \ + -e 's,drivers/media/dvb/frontends/Kconfig,drivers/media/dvb-frontends/Kconfig,g' \ + -e 's,drivers/media/dvb/frontends/Makefile,drivers/media/dvb-frontends/Makefile,g' \ + -e 's,drivers/media/dvb/frontends/a8293\.c,drivers/media/dvb-frontends/a8293\.c,g' \ + -e 's,drivers/media/dvb/frontends/a8293\.h,drivers/media/dvb-frontends/a8293\.h,g' \ + -e 's,drivers/media/dvb/frontends/af9013\.c,drivers/media/dvb-frontends/af9013\.c,g' \ + -e 's,drivers/media/dvb/frontends/af9013\.h,drivers/media/dvb-frontends/af9013\.h,g' \ + -e 's,drivers/media/dvb/frontends/af9013_priv\.h,drivers/media/dvb-frontends/af9013_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/af9033\.c,drivers/media/dvb-frontends/af9033\.c,g' \ + -e 's,drivers/media/dvb/frontends/af9033\.h,drivers/media/dvb-frontends/af9033\.h,g' \ + -e 's,drivers/media/dvb/frontends/af9033_priv\.h,drivers/media/dvb-frontends/af9033_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/atbm8830\.c,drivers/media/dvb-frontends/atbm8830\.c,g' \ + -e 's,drivers/media/dvb/frontends/atbm8830\.h,drivers/media/dvb-frontends/atbm8830\.h,g' \ + -e 's,drivers/media/dvb/frontends/atbm8830_priv\.h,drivers/media/dvb-frontends/atbm8830_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/au8522\.h,drivers/media/dvb-frontends/au8522\.h,g' \ + -e 's,drivers/media/dvb/frontends/au8522_common\.c,drivers/media/dvb-frontends/au8522_common\.c,g' \ + -e 's,drivers/media/dvb/frontends/au8522_decoder\.c,drivers/media/dvb-frontends/au8522_decoder\.c,g' \ + -e 's,drivers/media/dvb/frontends/au8522_dig\.c,drivers/media/dvb-frontends/au8522_dig\.c,g' \ + -e 's,drivers/media/dvb/frontends/au8522_priv\.h,drivers/media/dvb-frontends/au8522_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/bcm3510\.c,drivers/media/dvb-frontends/bcm3510\.c,g' \ + -e 's,drivers/media/dvb/frontends/bcm3510\.h,drivers/media/dvb-frontends/bcm3510\.h,g' \ + -e 's,drivers/media/dvb/frontends/bcm3510_priv\.h,drivers/media/dvb-frontends/bcm3510_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/bsbe1-d01a\.h,drivers/media/dvb-frontends/bsbe1-d01a\.h,g' \ + -e 's,drivers/media/dvb/frontends/bsbe1\.h,drivers/media/dvb-frontends/bsbe1\.h,g' \ + -e 's,drivers/media/dvb/frontends/bsru6\.h,drivers/media/dvb-frontends/bsru6\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx22700\.c,drivers/media/dvb-frontends/cx22700\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx22700\.h,drivers/media/dvb-frontends/cx22700\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx22702\.c,drivers/media/dvb-frontends/cx22702\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx22702\.h,drivers/media/dvb-frontends/cx22702\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx24110\.c,drivers/media/dvb-frontends/cx24110\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx24110\.h,drivers/media/dvb-frontends/cx24110\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx24113\.c,drivers/media/dvb-frontends/cx24113\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx24113\.h,drivers/media/dvb-frontends/cx24113\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx24116\.c,drivers/media/dvb-frontends/cx24116\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx24116\.h,drivers/media/dvb-frontends/cx24116\.h,g' \ + -e 's,drivers/media/dvb/frontends/cx24123\.c,drivers/media/dvb-frontends/cx24123\.c,g' \ + -e 's,drivers/media/dvb/frontends/cx24123\.h,drivers/media/dvb-frontends/cx24123\.h,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r\.h,drivers/media/dvb-frontends/cxd2820r\.h,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r_c\.c,drivers/media/dvb-frontends/cxd2820r_c\.c,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r_core\.c,drivers/media/dvb-frontends/cxd2820r_core\.c,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r_priv\.h,drivers/media/dvb-frontends/cxd2820r_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r_t\.c,drivers/media/dvb-frontends/cxd2820r_t\.c,g' \ + -e 's,drivers/media/dvb/frontends/cxd2820r_t2\.c,drivers/media/dvb-frontends/cxd2820r_t2\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib0070\.c,drivers/media/dvb-frontends/dib0070\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib0070\.h,drivers/media/dvb-frontends/dib0070\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib0090\.c,drivers/media/dvb-frontends/dib0090\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib0090\.h,drivers/media/dvb-frontends/dib0090\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib3000\.h,drivers/media/dvb-frontends/dib3000\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib3000mb\.c,drivers/media/dvb-frontends/dib3000mb\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib3000mb_priv\.h,drivers/media/dvb-frontends/dib3000mb_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib3000mc\.c,drivers/media/dvb-frontends/dib3000mc\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib3000mc\.h,drivers/media/dvb-frontends/dib3000mc\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib7000m\.c,drivers/media/dvb-frontends/dib7000m\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib7000m\.h,drivers/media/dvb-frontends/dib7000m\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib7000p\.c,drivers/media/dvb-frontends/dib7000p\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib7000p\.h,drivers/media/dvb-frontends/dib7000p\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib8000\.c,drivers/media/dvb-frontends/dib8000\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib8000\.h,drivers/media/dvb-frontends/dib8000\.h,g' \ + -e 's,drivers/media/dvb/frontends/dib9000\.c,drivers/media/dvb-frontends/dib9000\.c,g' \ + -e 's,drivers/media/dvb/frontends/dib9000\.h,drivers/media/dvb-frontends/dib9000\.h,g' \ + -e 's,drivers/media/dvb/frontends/dibx000_common\.c,drivers/media/dvb-frontends/dibx000_common\.c,g' \ + -e 's,drivers/media/dvb/frontends/dibx000_common\.h,drivers/media/dvb-frontends/dibx000_common\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxd\.h,drivers/media/dvb-frontends/drxd\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxd_firm\.c,drivers/media/dvb-frontends/drxd_firm\.c,g' \ + -e 's,drivers/media/dvb/frontends/drxd_firm\.h,drivers/media/dvb-frontends/drxd_firm\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxd_hard\.c,drivers/media/dvb-frontends/drxd_hard\.c,g' \ + -e 's,drivers/media/dvb/frontends/drxd_map_firm\.h,drivers/media/dvb-frontends/drxd_map_firm\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxk\.h,drivers/media/dvb-frontends/drxk\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxk_hard\.c,drivers/media/dvb-frontends/drxk_hard\.c,g' \ + -e 's,drivers/media/dvb/frontends/drxk_hard\.h,drivers/media/dvb-frontends/drxk_hard\.h,g' \ + -e 's,drivers/media/dvb/frontends/drxk_map\.h,drivers/media/dvb-frontends/drxk_map\.h,g' \ + -e 's,drivers/media/dvb/frontends/ds3000\.c,drivers/media/dvb-frontends/ds3000\.c,g' \ + -e 's,drivers/media/dvb/frontends/ds3000\.h,drivers/media/dvb-frontends/ds3000\.h,g' \ + -e 's,drivers/media/dvb/frontends/dvb-pll\.c,drivers/media/dvb-frontends/dvb-pll\.c,g' \ + -e 's,drivers/media/dvb/frontends/dvb-pll\.h,drivers/media/dvb-frontends/dvb-pll\.h,g' \ + -e 's,drivers/media/dvb/frontends/dvb_dummy_fe\.c,drivers/media/dvb-frontends/dvb_dummy_fe\.c,g' \ + -e 's,drivers/media/dvb/frontends/dvb_dummy_fe\.h,drivers/media/dvb-frontends/dvb_dummy_fe\.h,g' \ + -e 's,drivers/media/dvb/frontends/ec100\.c,drivers/media/dvb-frontends/ec100\.c,g' \ + -e 's,drivers/media/dvb/frontends/ec100\.h,drivers/media/dvb-frontends/ec100\.h,g' \ + -e 's,drivers/media/dvb/frontends/ec100_priv\.h,drivers/media/dvb-frontends/ec100_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/eds1547\.h,drivers/media/dvb-frontends/eds1547\.h,g' \ + -e 's,drivers/media/dvb/frontends/hd29l2\.c,drivers/media/dvb-frontends/hd29l2\.c,g' \ + -e 's,drivers/media/dvb/frontends/hd29l2\.h,drivers/media/dvb-frontends/hd29l2\.h,g' \ + -e 's,drivers/media/dvb/frontends/hd29l2_priv\.h,drivers/media/dvb-frontends/hd29l2_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/isl6405\.c,drivers/media/dvb-frontends/isl6405\.c,g' \ + -e 's,drivers/media/dvb/frontends/isl6405\.h,drivers/media/dvb-frontends/isl6405\.h,g' \ + -e 's,drivers/media/dvb/frontends/isl6421\.c,drivers/media/dvb-frontends/isl6421\.c,g' \ + -e 's,drivers/media/dvb/frontends/isl6421\.h,drivers/media/dvb-frontends/isl6421\.h,g' \ + -e 's,drivers/media/dvb/frontends/isl6423\.c,drivers/media/dvb-frontends/isl6423\.c,g' \ + -e 's,drivers/media/dvb/frontends/isl6423\.h,drivers/media/dvb-frontends/isl6423\.h,g' \ + -e 's,drivers/media/dvb/frontends/it913x-fe-priv\.h,drivers/media/dvb-frontends/it913x-fe-priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/it913x-fe\.c,drivers/media/dvb-frontends/it913x-fe\.c,g' \ + -e 's,drivers/media/dvb/frontends/it913x-fe\.h,drivers/media/dvb-frontends/it913x-fe\.h,g' \ + -e 's,drivers/media/dvb/frontends/itd1000\.c,drivers/media/dvb-frontends/itd1000\.c,g' \ + -e 's,drivers/media/dvb/frontends/itd1000\.h,drivers/media/dvb-frontends/itd1000\.h,g' \ + -e 's,drivers/media/dvb/frontends/itd1000_priv\.h,drivers/media/dvb-frontends/itd1000_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/ix2505v\.c,drivers/media/dvb-frontends/ix2505v\.c,g' \ + -e 's,drivers/media/dvb/frontends/ix2505v\.h,drivers/media/dvb-frontends/ix2505v\.h,g' \ + -e 's,drivers/media/dvb/frontends/l64781\.c,drivers/media/dvb-frontends/l64781\.c,g' \ + -e 's,drivers/media/dvb/frontends/l64781\.h,drivers/media/dvb-frontends/l64781\.h,g' \ + -e 's,drivers/media/dvb/frontends/lg2160\.c,drivers/media/dvb-frontends/lg2160\.c,g' \ + -e 's,drivers/media/dvb/frontends/lg2160\.h,drivers/media/dvb-frontends/lg2160\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgdt3305\.c,drivers/media/dvb-frontends/lgdt3305\.c,g' \ + -e 's,drivers/media/dvb/frontends/lgdt3305\.h,drivers/media/dvb-frontends/lgdt3305\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgdt330x\.c,drivers/media/dvb-frontends/lgdt330x\.c,g' \ + -e 's,drivers/media/dvb/frontends/lgdt330x\.h,drivers/media/dvb-frontends/lgdt330x\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgdt330x_priv\.h,drivers/media/dvb-frontends/lgdt330x_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgs8gl5\.c,drivers/media/dvb-frontends/lgs8gl5\.c,g' \ + -e 's,drivers/media/dvb/frontends/lgs8gl5\.h,drivers/media/dvb-frontends/lgs8gl5\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgs8gxx\.c,drivers/media/dvb-frontends/lgs8gxx\.c,g' \ + -e 's,drivers/media/dvb/frontends/lgs8gxx\.h,drivers/media/dvb-frontends/lgs8gxx\.h,g' \ + -e 's,drivers/media/dvb/frontends/lgs8gxx_priv\.h,drivers/media/dvb-frontends/lgs8gxx_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/lnbh24\.h,drivers/media/dvb-frontends/lnbh24\.h,g' \ + -e 's,drivers/media/dvb/frontends/lnbp21\.c,drivers/media/dvb-frontends/lnbp21\.c,g' \ + -e 's,drivers/media/dvb/frontends/lnbp21\.h,drivers/media/dvb-frontends/lnbp21\.h,g' \ + -e 's,drivers/media/dvb/frontends/lnbp22\.c,drivers/media/dvb-frontends/lnbp22\.c,g' \ + -e 's,drivers/media/dvb/frontends/lnbp22\.h,drivers/media/dvb-frontends/lnbp22\.h,g' \ + -e 's,drivers/media/dvb/frontends/m88rs2000\.c,drivers/media/dvb-frontends/m88rs2000\.c,g' \ + -e 's,drivers/media/dvb/frontends/m88rs2000\.h,drivers/media/dvb-frontends/m88rs2000\.h,g' \ + -e 's,drivers/media/dvb/frontends/mb86a16\.c,drivers/media/dvb-frontends/mb86a16\.c,g' \ + -e 's,drivers/media/dvb/frontends/mb86a16\.h,drivers/media/dvb-frontends/mb86a16\.h,g' \ + -e 's,drivers/media/dvb/frontends/mb86a16_priv\.h,drivers/media/dvb-frontends/mb86a16_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/mb86a20s\.c,drivers/media/dvb-frontends/mb86a20s\.c,g' \ + -e 's,drivers/media/dvb/frontends/mb86a20s\.h,drivers/media/dvb-frontends/mb86a20s\.h,g' \ + -e 's,drivers/media/dvb/frontends/mt312\.c,drivers/media/dvb-frontends/mt312\.c,g' \ + -e 's,drivers/media/dvb/frontends/mt312\.h,drivers/media/dvb-frontends/mt312\.h,g' \ + -e 's,drivers/media/dvb/frontends/mt312_priv\.h,drivers/media/dvb-frontends/mt312_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/mt352\.c,drivers/media/dvb-frontends/mt352\.c,g' \ + -e 's,drivers/media/dvb/frontends/mt352\.h,drivers/media/dvb-frontends/mt352\.h,g' \ + -e 's,drivers/media/dvb/frontends/mt352_priv\.h,drivers/media/dvb-frontends/mt352_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/nxt200x\.c,drivers/media/dvb-frontends/nxt200x\.c,g' \ + -e 's,drivers/media/dvb/frontends/nxt200x\.h,drivers/media/dvb-frontends/nxt200x\.h,g' \ + -e 's,drivers/media/dvb/frontends/nxt6000\.c,drivers/media/dvb-frontends/nxt6000\.c,g' \ + -e 's,drivers/media/dvb/frontends/nxt6000\.h,drivers/media/dvb-frontends/nxt6000\.h,g' \ + -e 's,drivers/media/dvb/frontends/nxt6000_priv\.h,drivers/media/dvb-frontends/nxt6000_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/or51132\.c,drivers/media/dvb-frontends/or51132\.c,g' \ + -e 's,drivers/media/dvb/frontends/or51132\.h,drivers/media/dvb-frontends/or51132\.h,g' \ + -e 's,drivers/media/dvb/frontends/or51211\.c,drivers/media/dvb-frontends/or51211\.c,g' \ + -e 's,drivers/media/dvb/frontends/or51211\.h,drivers/media/dvb-frontends/or51211\.h,g' \ + -e 's,drivers/media/dvb/frontends/rtl2830\.c,drivers/media/dvb-frontends/rtl2830\.c,g' \ + -e 's,drivers/media/dvb/frontends/rtl2830\.h,drivers/media/dvb-frontends/rtl2830\.h,g' \ + -e 's,drivers/media/dvb/frontends/rtl2830_priv\.h,drivers/media/dvb-frontends/rtl2830_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/rtl2832\.c,drivers/media/dvb-frontends/rtl2832\.c,g' \ + -e 's,drivers/media/dvb/frontends/rtl2832\.h,drivers/media/dvb-frontends/rtl2832\.h,g' \ + -e 's,drivers/media/dvb/frontends/rtl2832_priv\.h,drivers/media/dvb-frontends/rtl2832_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/s5h1409\.c,drivers/media/dvb-frontends/s5h1409\.c,g' \ + -e 's,drivers/media/dvb/frontends/s5h1409\.h,drivers/media/dvb-frontends/s5h1409\.h,g' \ + -e 's,drivers/media/dvb/frontends/s5h1411\.c,drivers/media/dvb-frontends/s5h1411\.c,g' \ + -e 's,drivers/media/dvb/frontends/s5h1411\.h,drivers/media/dvb-frontends/s5h1411\.h,g' \ + -e 's,drivers/media/dvb/frontends/s5h1420\.c,drivers/media/dvb-frontends/s5h1420\.c,g' \ + -e 's,drivers/media/dvb/frontends/s5h1420\.h,drivers/media/dvb-frontends/s5h1420\.h,g' \ + -e 's,drivers/media/dvb/frontends/s5h1420_priv\.h,drivers/media/dvb-frontends/s5h1420_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/s5h1432\.c,drivers/media/dvb-frontends/s5h1432\.c,g' \ + -e 's,drivers/media/dvb/frontends/s5h1432\.h,drivers/media/dvb-frontends/s5h1432\.h,g' \ + -e 's,drivers/media/dvb/frontends/s921\.c,drivers/media/dvb-frontends/s921\.c,g' \ + -e 's,drivers/media/dvb/frontends/s921\.h,drivers/media/dvb-frontends/s921\.h,g' \ + -e 's,drivers/media/dvb/frontends/si21xx\.c,drivers/media/dvb-frontends/si21xx\.c,g' \ + -e 's,drivers/media/dvb/frontends/si21xx\.h,drivers/media/dvb-frontends/si21xx\.h,g' \ + -e 's,drivers/media/dvb/frontends/sp8870\.c,drivers/media/dvb-frontends/sp8870\.c,g' \ + -e 's,drivers/media/dvb/frontends/sp8870\.h,drivers/media/dvb-frontends/sp8870\.h,g' \ + -e 's,drivers/media/dvb/frontends/sp887x\.c,drivers/media/dvb-frontends/sp887x\.c,g' \ + -e 's,drivers/media/dvb/frontends/sp887x\.h,drivers/media/dvb-frontends/sp887x\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_algo\.c,drivers/media/dvb-frontends/stb0899_algo\.c,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_cfg\.h,drivers/media/dvb-frontends/stb0899_cfg\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_drv\.c,drivers/media/dvb-frontends/stb0899_drv\.c,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_drv\.h,drivers/media/dvb-frontends/stb0899_drv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_priv\.h,drivers/media/dvb-frontends/stb0899_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb0899_reg\.h,drivers/media/dvb-frontends/stb0899_reg\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb6000\.c,drivers/media/dvb-frontends/stb6000\.c,g' \ + -e 's,drivers/media/dvb/frontends/stb6000\.h,drivers/media/dvb-frontends/stb6000\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb6100\.c,drivers/media/dvb-frontends/stb6100\.c,g' \ + -e 's,drivers/media/dvb/frontends/stb6100\.h,drivers/media/dvb-frontends/stb6100\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb6100_cfg\.h,drivers/media/dvb-frontends/stb6100_cfg\.h,g' \ + -e 's,drivers/media/dvb/frontends/stb6100_proc\.h,drivers/media/dvb-frontends/stb6100_proc\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0288\.c,drivers/media/dvb-frontends/stv0288\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv0288\.h,drivers/media/dvb-frontends/stv0288\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0297\.c,drivers/media/dvb-frontends/stv0297\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv0297\.h,drivers/media/dvb-frontends/stv0297\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0299\.c,drivers/media/dvb-frontends/stv0299\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv0299\.h,drivers/media/dvb-frontends/stv0299\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0367\.c,drivers/media/dvb-frontends/stv0367\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv0367\.h,drivers/media/dvb-frontends/stv0367\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0367_priv\.h,drivers/media/dvb-frontends/stv0367_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0367_regs\.h,drivers/media/dvb-frontends/stv0367_regs\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0900\.h,drivers/media/dvb-frontends/stv0900\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0900_core\.c,drivers/media/dvb-frontends/stv0900_core\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv0900_init\.h,drivers/media/dvb-frontends/stv0900_init\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0900_priv\.h,drivers/media/dvb-frontends/stv0900_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0900_reg\.h,drivers/media/dvb-frontends/stv0900_reg\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv0900_sw\.c,drivers/media/dvb-frontends/stv0900_sw\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv090x\.c,drivers/media/dvb-frontends/stv090x\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv090x\.h,drivers/media/dvb-frontends/stv090x\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv090x_priv\.h,drivers/media/dvb-frontends/stv090x_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv090x_reg\.h,drivers/media/dvb-frontends/stv090x_reg\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv6110\.c,drivers/media/dvb-frontends/stv6110\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv6110\.h,drivers/media/dvb-frontends/stv6110\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv6110x\.c,drivers/media/dvb-frontends/stv6110x\.c,g' \ + -e 's,drivers/media/dvb/frontends/stv6110x\.h,drivers/media/dvb-frontends/stv6110x\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv6110x_priv\.h,drivers/media/dvb-frontends/stv6110x_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/stv6110x_reg\.h,drivers/media/dvb-frontends/stv6110x_reg\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda10021\.c,drivers/media/dvb-frontends/tda10021\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda10023\.c,drivers/media/dvb-frontends/tda10023\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda1002x\.h,drivers/media/dvb-frontends/tda1002x\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda10048\.c,drivers/media/dvb-frontends/tda10048\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda10048\.h,drivers/media/dvb-frontends/tda10048\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda1004x\.c,drivers/media/dvb-frontends/tda1004x\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda1004x\.h,drivers/media/dvb-frontends/tda1004x\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda10071\.c,drivers/media/dvb-frontends/tda10071\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda10071\.h,drivers/media/dvb-frontends/tda10071\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda10071_priv\.h,drivers/media/dvb-frontends/tda10071_priv\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda10086\.c,drivers/media/dvb-frontends/tda10086\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda10086\.h,drivers/media/dvb-frontends/tda10086\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda18271c2dd\.c,drivers/media/dvb-frontends/tda18271c2dd\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda18271c2dd\.h,drivers/media/dvb-frontends/tda18271c2dd\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda18271c2dd_maps\.h,drivers/media/dvb-frontends/tda18271c2dd_maps\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda665x\.c,drivers/media/dvb-frontends/tda665x\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda665x\.h,drivers/media/dvb-frontends/tda665x\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda8083\.c,drivers/media/dvb-frontends/tda8083\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda8083\.h,drivers/media/dvb-frontends/tda8083\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda8261\.c,drivers/media/dvb-frontends/tda8261\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda8261\.h,drivers/media/dvb-frontends/tda8261\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda8261_cfg\.h,drivers/media/dvb-frontends/tda8261_cfg\.h,g' \ + -e 's,drivers/media/dvb/frontends/tda826x\.c,drivers/media/dvb-frontends/tda826x\.c,g' \ + -e 's,drivers/media/dvb/frontends/tda826x\.h,drivers/media/dvb-frontends/tda826x\.h,g' \ + -e 's,drivers/media/dvb/frontends/tdhd1\.h,drivers/media/dvb-frontends/tdhd1\.h,g' \ + -e 's,drivers/media/dvb/frontends/tua6100\.c,drivers/media/dvb-frontends/tua6100\.c,g' \ + -e 's,drivers/media/dvb/frontends/tua6100\.h,drivers/media/dvb-frontends/tua6100\.h,g' \ + -e 's,drivers/media/dvb/frontends/ves1820\.c,drivers/media/dvb-frontends/ves1820\.c,g' \ + -e 's,drivers/media/dvb/frontends/ves1820\.h,drivers/media/dvb-frontends/ves1820\.h,g' \ + -e 's,drivers/media/dvb/frontends/ves1x93\.c,drivers/media/dvb-frontends/ves1x93\.c,g' \ + -e 's,drivers/media/dvb/frontends/ves1x93\.h,drivers/media/dvb-frontends/ves1x93\.h,g' \ + -e 's,drivers/media/dvb/frontends/z0194a\.h,drivers/media/dvb-frontends/z0194a\.h,g' \ + -e 's,drivers/media/dvb/frontends/zl10036\.c,drivers/media/dvb-frontends/zl10036\.c,g' \ + -e 's,drivers/media/dvb/frontends/zl10036\.h,drivers/media/dvb-frontends/zl10036\.h,g' \ + -e 's,drivers/media/dvb/frontends/zl10039\.c,drivers/media/dvb-frontends/zl10039\.c,g' \ + -e 's,drivers/media/dvb/frontends/zl10039\.h,drivers/media/dvb-frontends/zl10039\.h,g' \ + -e 's,drivers/media/dvb/frontends/zl10353\.c,drivers/media/dvb-frontends/zl10353\.c,g' \ + -e 's,drivers/media/dvb/frontends/zl10353\.h,drivers/media/dvb-frontends/zl10353\.h,g' \ + -e 's,drivers/media/dvb/frontends/zl10353_priv\.h,drivers/media/dvb-frontends/zl10353_priv\.h,g' \ + -e 's,drivers/media/dvb/firewire/Kconfig,drivers/media/firewire/Kconfig,g' \ + -e 's,drivers/media/dvb/firewire/Makefile,drivers/media/firewire/Makefile,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-avc\.c,drivers/media/firewire/firedtv-avc\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-ci\.c,drivers/media/firewire/firedtv-ci\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-dvb\.c,drivers/media/firewire/firedtv-dvb\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-fe\.c,drivers/media/firewire/firedtv-fe\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-fw\.c,drivers/media/firewire/firedtv-fw\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv-rc\.c,drivers/media/firewire/firedtv-rc\.c,g' \ + -e 's,drivers/media/dvb/firewire/firedtv\.h,drivers/media/firewire/firedtv\.h,g' \ + -e 's,drivers/media/video/adp1653\.c,drivers/media/i2c/adp1653\.c,g' \ + -e 's,drivers/media/video/adv7170\.c,drivers/media/i2c/adv7170\.c,g' \ + -e 's,drivers/media/video/adv7175\.c,drivers/media/i2c/adv7175\.c,g' \ + -e 's,drivers/media/video/adv7180\.c,drivers/media/i2c/adv7180\.c,g' \ + -e 's,drivers/media/video/adv7183\.c,drivers/media/i2c/adv7183\.c,g' \ + -e 's,drivers/media/video/adv7183_regs\.h,drivers/media/i2c/adv7183_regs\.h,g' \ + -e 's,drivers/media/video/adv7343\.c,drivers/media/i2c/adv7343\.c,g' \ + -e 's,drivers/media/video/adv7343_regs\.h,drivers/media/i2c/adv7343_regs\.h,g' \ + -e 's,drivers/media/video/adv7393\.c,drivers/media/i2c/adv7393\.c,g' \ + -e 's,drivers/media/video/adv7393_regs\.h,drivers/media/i2c/adv7393_regs\.h,g' \ + -e 's,drivers/media/video/ak881x\.c,drivers/media/i2c/ak881x\.c,g' \ + -e 's,drivers/media/video/aptina-pll\.c,drivers/media/i2c/aptina-pll\.c,g' \ + -e 's,drivers/media/video/aptina-pll\.h,drivers/media/i2c/aptina-pll\.h,g' \ + -e 's,drivers/media/video/as3645a\.c,drivers/media/i2c/as3645a\.c,g' \ + -e 's,drivers/media/video/bt819\.c,drivers/media/i2c/bt819\.c,g' \ + -e 's,drivers/media/video/bt856\.c,drivers/media/i2c/bt856\.c,g' \ + -e 's,drivers/media/video/bt866\.c,drivers/media/i2c/bt866\.c,g' \ + -e 's,drivers/media/video/btcx-risc\.c,drivers/media/i2c/btcx-risc\.c,g' \ + -e 's,drivers/media/video/btcx-risc\.h,drivers/media/i2c/btcx-risc\.h,g' \ + -e 's,drivers/media/video/cs5345\.c,drivers/media/i2c/cs5345\.c,g' \ + -e 's,drivers/media/video/cs53l32a\.c,drivers/media/i2c/cs53l32a\.c,g' \ + -e 's,drivers/media/video/cx2341x\.c,drivers/media/i2c/cx2341x\.c,g' \ + -e 's,drivers/media/video/cx25840/Kconfig,drivers/media/i2c/cx25840/Kconfig,g' \ + -e 's,drivers/media/video/cx25840/Makefile,drivers/media/i2c/cx25840/Makefile,g' \ + -e 's,drivers/media/video/cx25840/cx25840-audio\.c,drivers/media/i2c/cx25840/cx25840-audio\.c,g' \ + -e 's,drivers/media/video/cx25840/cx25840-core\.c,drivers/media/i2c/cx25840/cx25840-core\.c,g' \ + -e 's,drivers/media/video/cx25840/cx25840-core\.h,drivers/media/i2c/cx25840/cx25840-core\.h,g' \ + -e 's,drivers/media/video/cx25840/cx25840-firmware\.c,drivers/media/i2c/cx25840/cx25840-firmware\.c,g' \ + -e 's,drivers/media/video/cx25840/cx25840-ir\.c,drivers/media/i2c/cx25840/cx25840-ir\.c,g' \ + -e 's,drivers/media/video/cx25840/cx25840-vbi\.c,drivers/media/i2c/cx25840/cx25840-vbi\.c,g' \ + -e 's,drivers/media/video/ir-kbd-i2c\.c,drivers/media/i2c/ir-kbd-i2c\.c,g' \ + -e 's,drivers/media/video/ks0127\.c,drivers/media/i2c/ks0127\.c,g' \ + -e 's,drivers/media/video/ks0127\.h,drivers/media/i2c/ks0127\.h,g' \ + -e 's,drivers/media/video/m52790\.c,drivers/media/i2c/m52790\.c,g' \ + -e 's,drivers/media/video/m5mols/Kconfig,drivers/media/i2c/m5mols/Kconfig,g' \ + -e 's,drivers/media/video/m5mols/Makefile,drivers/media/i2c/m5mols/Makefile,g' \ + -e 's,drivers/media/video/m5mols/m5mols\.h,drivers/media/i2c/m5mols/m5mols\.h,g' \ + -e 's,drivers/media/video/m5mols/m5mols_capture\.c,drivers/media/i2c/m5mols/m5mols_capture\.c,g' \ + -e 's,drivers/media/video/m5mols/m5mols_controls\.c,drivers/media/i2c/m5mols/m5mols_controls\.c,g' \ + -e 's,drivers/media/video/m5mols/m5mols_core\.c,drivers/media/i2c/m5mols/m5mols_core\.c,g' \ + -e 's,drivers/media/video/m5mols/m5mols_reg\.h,drivers/media/i2c/m5mols/m5mols_reg\.h,g' \ + -e 's,drivers/media/video/msp3400-driver\.c,drivers/media/i2c/msp3400-driver\.c,g' \ + -e 's,drivers/media/video/msp3400-driver\.h,drivers/media/i2c/msp3400-driver\.h,g' \ + -e 's,drivers/media/video/msp3400-kthreads\.c,drivers/media/i2c/msp3400-kthreads\.c,g' \ + -e 's,drivers/media/video/mt9m032\.c,drivers/media/i2c/mt9m032\.c,g' \ + -e 's,drivers/media/video/mt9p031\.c,drivers/media/i2c/mt9p031\.c,g' \ + -e 's,drivers/media/video/mt9t001\.c,drivers/media/i2c/mt9t001\.c,g' \ + -e 's,drivers/media/video/mt9v011\.c,drivers/media/i2c/mt9v011\.c,g' \ + -e 's,drivers/media/video/mt9v032\.c,drivers/media/i2c/mt9v032\.c,g' \ + -e 's,drivers/media/video/noon010pc30\.c,drivers/media/i2c/noon010pc30\.c,g' \ + -e 's,drivers/media/video/ov7670\.c,drivers/media/i2c/ov7670\.c,g' \ + -e 's,drivers/media/video/s5k6aa\.c,drivers/media/i2c/s5k6aa\.c,g' \ + -e 's,drivers/media/video/saa6588\.c,drivers/media/i2c/saa6588\.c,g' \ + -e 's,drivers/media/video/saa7110\.c,drivers/media/i2c/saa7110\.c,g' \ + -e 's,drivers/media/video/saa7115\.c,drivers/media/i2c/saa7115\.c,g' \ + -e 's,drivers/media/video/saa711x_regs\.h,drivers/media/i2c/saa711x_regs\.h,g' \ + -e 's,drivers/media/video/saa7127\.c,drivers/media/i2c/saa7127\.c,g' \ + -e 's,drivers/media/video/saa717x\.c,drivers/media/i2c/saa717x\.c,g' \ + -e 's,drivers/media/video/saa7185\.c,drivers/media/i2c/saa7185\.c,g' \ + -e 's,drivers/media/video/saa7191\.c,drivers/media/i2c/saa7191\.c,g' \ + -e 's,drivers/media/video/saa7191\.h,drivers/media/i2c/saa7191\.h,g' \ + -e 's,drivers/media/video/smiapp-pll\.c,drivers/media/i2c/smiapp-pll\.c,g' \ + -e 's,drivers/media/video/smiapp-pll\.h,drivers/media/i2c/smiapp-pll\.h,g' \ + -e 's,drivers/media/video/smiapp/Kconfig,drivers/media/i2c/smiapp/Kconfig,g' \ + -e 's,drivers/media/video/smiapp/Makefile,drivers/media/i2c/smiapp/Makefile,g' \ + -e 's,drivers/media/video/smiapp/smiapp-core\.c,drivers/media/i2c/smiapp/smiapp-core\.c,g' \ + -e 's,drivers/media/video/smiapp/smiapp-limits\.c,drivers/media/i2c/smiapp/smiapp-limits\.c,g' \ + -e 's,drivers/media/video/smiapp/smiapp-limits\.h,drivers/media/i2c/smiapp/smiapp-limits\.h,g' \ + -e 's,drivers/media/video/smiapp/smiapp-quirk\.c,drivers/media/i2c/smiapp/smiapp-quirk\.c,g' \ + -e 's,drivers/media/video/smiapp/smiapp-quirk\.h,drivers/media/i2c/smiapp/smiapp-quirk\.h,g' \ + -e 's,drivers/media/video/smiapp/smiapp-reg-defs\.h,drivers/media/i2c/smiapp/smiapp-reg-defs\.h,g' \ + -e 's,drivers/media/video/smiapp/smiapp-reg\.h,drivers/media/i2c/smiapp/smiapp-reg\.h,g' \ + -e 's,drivers/media/video/smiapp/smiapp-regs\.c,drivers/media/i2c/smiapp/smiapp-regs\.c,g' \ + -e 's,drivers/media/video/smiapp/smiapp-regs\.h,drivers/media/i2c/smiapp/smiapp-regs\.h,g' \ + -e 's,drivers/media/video/smiapp/smiapp\.h,drivers/media/i2c/smiapp/smiapp\.h,g' \ + -e 's,drivers/media/video/imx074\.c,drivers/media/i2c/soc_camera/imx074\.c,g' \ + -e 's,drivers/media/video/mt9m001\.c,drivers/media/i2c/soc_camera/mt9m001\.c,g' \ + -e 's,drivers/media/video/mt9m111\.c,drivers/media/i2c/soc_camera/mt9m111\.c,g' \ + -e 's,drivers/media/video/mt9t031\.c,drivers/media/i2c/soc_camera/mt9t031\.c,g' \ + -e 's,drivers/media/video/mt9t112\.c,drivers/media/i2c/soc_camera/mt9t112\.c,g' \ + -e 's,drivers/media/video/mt9v022\.c,drivers/media/i2c/soc_camera/mt9v022\.c,g' \ + -e 's,drivers/media/video/ov2640\.c,drivers/media/i2c/soc_camera/ov2640\.c,g' \ + -e 's,drivers/media/video/ov5642\.c,drivers/media/i2c/soc_camera/ov5642\.c,g' \ + -e 's,drivers/media/video/ov6650\.c,drivers/media/i2c/soc_camera/ov6650\.c,g' \ + -e 's,drivers/media/video/ov772x\.c,drivers/media/i2c/soc_camera/ov772x\.c,g' \ + -e 's,drivers/media/video/ov9640\.c,drivers/media/i2c/soc_camera/ov9640\.c,g' \ + -e 's,drivers/media/video/ov9640\.h,drivers/media/i2c/soc_camera/ov9640\.h,g' \ + -e 's,drivers/media/video/ov9740\.c,drivers/media/i2c/soc_camera/ov9740\.c,g' \ + -e 's,drivers/media/video/rj54n1cb0c\.c,drivers/media/i2c/soc_camera/rj54n1cb0c\.c,g' \ + -e 's,drivers/media/video/tw9910\.c,drivers/media/i2c/soc_camera/tw9910\.c,g' \ + -e 's,drivers/media/video/sr030pc30\.c,drivers/media/i2c/sr030pc30\.c,g' \ + -e 's,drivers/media/video/tcm825x\.c,drivers/media/i2c/tcm825x\.c,g' \ + -e 's,drivers/media/video/tcm825x\.h,drivers/media/i2c/tcm825x\.h,g' \ + -e 's,drivers/media/video/tda7432\.c,drivers/media/i2c/tda7432\.c,g' \ + -e 's,drivers/media/video/tda9840\.c,drivers/media/i2c/tda9840\.c,g' \ + -e 's,drivers/media/video/tea6415c\.c,drivers/media/i2c/tea6415c\.c,g' \ + -e 's,drivers/media/video/tea6415c\.h,drivers/media/i2c/tea6415c\.h,g' \ + -e 's,drivers/media/video/tea6420\.c,drivers/media/i2c/tea6420\.c,g' \ + -e 's,drivers/media/video/tea6420\.h,drivers/media/i2c/tea6420\.h,g' \ + -e 's,drivers/media/video/ths7303\.c,drivers/media/i2c/ths7303\.c,g' \ + -e 's,drivers/media/video/tlv320aic23b\.c,drivers/media/i2c/tlv320aic23b\.c,g' \ + -e 's,drivers/media/video/tvaudio\.c,drivers/media/i2c/tvaudio\.c,g' \ + -e 's,drivers/media/video/tveeprom\.c,drivers/media/i2c/tveeprom\.c,g' \ + -e 's,drivers/media/video/tvp514x\.c,drivers/media/i2c/tvp514x\.c,g' \ + -e 's,drivers/media/video/tvp514x_regs\.h,drivers/media/i2c/tvp514x_regs\.h,g' \ + -e 's,drivers/media/video/tvp5150\.c,drivers/media/i2c/tvp5150\.c,g' \ + -e 's,drivers/media/video/tvp5150_reg\.h,drivers/media/i2c/tvp5150_reg\.h,g' \ + -e 's,drivers/media/video/tvp7002\.c,drivers/media/i2c/tvp7002\.c,g' \ + -e 's,drivers/media/video/tvp7002_reg\.h,drivers/media/i2c/tvp7002_reg\.h,g' \ + -e 's,drivers/media/video/upd64031a\.c,drivers/media/i2c/upd64031a\.c,g' \ + -e 's,drivers/media/video/upd64083\.c,drivers/media/i2c/upd64083\.c,g' \ + -e 's,drivers/media/video/vp27smpx\.c,drivers/media/i2c/vp27smpx\.c,g' \ + -e 's,drivers/media/video/vpx3220\.c,drivers/media/i2c/vpx3220\.c,g' \ + -e 's,drivers/media/video/vs6624\.c,drivers/media/i2c/vs6624\.c,g' \ + -e 's,drivers/media/video/vs6624_regs\.h,drivers/media/i2c/vs6624_regs\.h,g' \ + -e 's,drivers/media/video/wm8739\.c,drivers/media/i2c/wm8739\.c,g' \ + -e 's,drivers/media/video/wm8775\.c,drivers/media/i2c/wm8775\.c,g' \ + -e 's,drivers/media/dvb/siano/smssdio\.c,drivers/media/mmc/siano/smssdio\.c,g' \ + -e 's,drivers/media/video/bw-qcam\.c,drivers/media/parport/bw-qcam\.c,g' \ + -e 's,drivers/media/video/c-qcam\.c,drivers/media/parport/c-qcam\.c,g' \ + -e 's,drivers/media/video/pms\.c,drivers/media/parport/pms\.c,g' \ + -e 's,drivers/media/video/w9966\.c,drivers/media/parport/w9966\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-dma\.c,drivers/media/pci/b2c2/flexcop-dma\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-pci\.c,drivers/media/pci/b2c2/flexcop-pci\.c,g' \ + -e 's,drivers/media/dvb/bt8xx/Kconfig,drivers/media/pci/bt8xx/Kconfig,g' \ + -e 's,drivers/media/video/bt8xx/Makefile,drivers/media/pci/bt8xx/Makefile,g' \ + -e 's,drivers/media/video/bt8xx/bt848\.h,drivers/media/pci/bt8xx/bt848\.h,g' \ + -e 's,drivers/media/dvb/bt8xx/bt878\.c,drivers/media/pci/bt8xx/bt878\.c,g' \ + -e 's,drivers/media/dvb/bt8xx/bt878\.h,drivers/media/pci/bt8xx/bt878\.h,g' \ + -e 's,drivers/media/video/bt8xx/bttv-audio-hook\.c,drivers/media/pci/bt8xx/bttv-audio-hook\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-audio-hook\.h,drivers/media/pci/bt8xx/bttv-audio-hook\.h,g' \ + -e 's,drivers/media/video/bt8xx/bttv-cards\.c,drivers/media/pci/bt8xx/bttv-cards\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-driver\.c,drivers/media/pci/bt8xx/bttv-driver\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-gpio\.c,drivers/media/pci/bt8xx/bttv-gpio\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-i2c\.c,drivers/media/pci/bt8xx/bttv-i2c\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-if\.c,drivers/media/pci/bt8xx/bttv-if\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-input\.c,drivers/media/pci/bt8xx/bttv-input\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-risc\.c,drivers/media/pci/bt8xx/bttv-risc\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv-vbi\.c,drivers/media/pci/bt8xx/bttv-vbi\.c,g' \ + -e 's,drivers/media/video/bt8xx/bttv\.h,drivers/media/pci/bt8xx/bttv\.h,g' \ + -e 's,drivers/media/video/bt8xx/bttvp\.h,drivers/media/pci/bt8xx/bttvp\.h,g' \ + -e 's,drivers/media/dvb/bt8xx/dst\.c,drivers/media/pci/bt8xx/dst\.c,g' \ + -e 's,drivers/media/dvb/bt8xx/dst_ca\.c,drivers/media/pci/bt8xx/dst_ca\.c,g' \ + -e 's,drivers/media/dvb/bt8xx/dst_ca\.h,drivers/media/pci/bt8xx/dst_ca\.h,g' \ + -e 's,drivers/media/dvb/bt8xx/dst_common\.h,drivers/media/pci/bt8xx/dst_common\.h,g' \ + -e 's,drivers/media/dvb/bt8xx/dst_priv\.h,drivers/media/pci/bt8xx/dst_priv\.h,g' \ + -e 's,drivers/media/dvb/bt8xx/dvb-bt8xx\.c,drivers/media/pci/bt8xx/dvb-bt8xx\.c,g' \ + -e 's,drivers/media/dvb/bt8xx/dvb-bt8xx\.h,drivers/media/pci/bt8xx/dvb-bt8xx\.h,g' \ + -e 's,drivers/media/video/cx18/Kconfig,drivers/media/pci/cx18/Kconfig,g' \ + -e 's,drivers/media/video/cx18/Makefile,drivers/media/pci/cx18/Makefile,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa-main\.c,drivers/media/pci/cx18/cx18-alsa-main\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa-mixer\.c,drivers/media/pci/cx18/cx18-alsa-mixer\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa-mixer\.h,drivers/media/pci/cx18/cx18-alsa-mixer\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa-pcm\.c,drivers/media/pci/cx18/cx18-alsa-pcm\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa-pcm\.h,drivers/media/pci/cx18/cx18-alsa-pcm\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-alsa\.h,drivers/media/pci/cx18/cx18-alsa\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-audio\.c,drivers/media/pci/cx18/cx18-audio\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-audio\.h,drivers/media/pci/cx18/cx18-audio\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-av-audio\.c,drivers/media/pci/cx18/cx18-av-audio\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-av-core\.c,drivers/media/pci/cx18/cx18-av-core\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-av-core\.h,drivers/media/pci/cx18/cx18-av-core\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-av-firmware\.c,drivers/media/pci/cx18/cx18-av-firmware\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-av-vbi\.c,drivers/media/pci/cx18/cx18-av-vbi\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-cards\.c,drivers/media/pci/cx18/cx18-cards\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-cards\.h,drivers/media/pci/cx18/cx18-cards\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-controls\.c,drivers/media/pci/cx18/cx18-controls\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-controls\.h,drivers/media/pci/cx18/cx18-controls\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-driver\.c,drivers/media/pci/cx18/cx18-driver\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-driver\.h,drivers/media/pci/cx18/cx18-driver\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-dvb\.c,drivers/media/pci/cx18/cx18-dvb\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-dvb\.h,drivers/media/pci/cx18/cx18-dvb\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-fileops\.c,drivers/media/pci/cx18/cx18-fileops\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-fileops\.h,drivers/media/pci/cx18/cx18-fileops\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-firmware\.c,drivers/media/pci/cx18/cx18-firmware\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-firmware\.h,drivers/media/pci/cx18/cx18-firmware\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-gpio\.c,drivers/media/pci/cx18/cx18-gpio\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-gpio\.h,drivers/media/pci/cx18/cx18-gpio\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-i2c\.c,drivers/media/pci/cx18/cx18-i2c\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-i2c\.h,drivers/media/pci/cx18/cx18-i2c\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-io\.c,drivers/media/pci/cx18/cx18-io\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-io\.h,drivers/media/pci/cx18/cx18-io\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-ioctl\.c,drivers/media/pci/cx18/cx18-ioctl\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-ioctl\.h,drivers/media/pci/cx18/cx18-ioctl\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-irq\.c,drivers/media/pci/cx18/cx18-irq\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-irq\.h,drivers/media/pci/cx18/cx18-irq\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-mailbox\.c,drivers/media/pci/cx18/cx18-mailbox\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-mailbox\.h,drivers/media/pci/cx18/cx18-mailbox\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-queue\.c,drivers/media/pci/cx18/cx18-queue\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-queue\.h,drivers/media/pci/cx18/cx18-queue\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-scb\.c,drivers/media/pci/cx18/cx18-scb\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-scb\.h,drivers/media/pci/cx18/cx18-scb\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-streams\.c,drivers/media/pci/cx18/cx18-streams\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-streams\.h,drivers/media/pci/cx18/cx18-streams\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-vbi\.c,drivers/media/pci/cx18/cx18-vbi\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-vbi\.h,drivers/media/pci/cx18/cx18-vbi\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-version\.h,drivers/media/pci/cx18/cx18-version\.h,g' \ + -e 's,drivers/media/video/cx18/cx18-video\.c,drivers/media/pci/cx18/cx18-video\.c,g' \ + -e 's,drivers/media/video/cx18/cx18-video\.h,drivers/media/pci/cx18/cx18-video\.h,g' \ + -e 's,drivers/media/video/cx18/cx23418\.h,drivers/media/pci/cx18/cx23418\.h,g' \ + -e 's,drivers/media/video/cx23885/Kconfig,drivers/media/pci/cx23885/Kconfig,g' \ + -e 's,drivers/media/video/cx23885/Makefile,drivers/media/pci/cx23885/Makefile,g' \ + -e 's,drivers/media/video/cx23885/altera-ci\.c,drivers/media/pci/cx23885/altera-ci\.c,g' \ + -e 's,drivers/media/video/cx23885/altera-ci\.h,drivers/media/pci/cx23885/altera-ci\.h,g' \ + -e 's,drivers/media/video/cx23885/cimax2\.c,drivers/media/pci/cx23885/cimax2\.c,g' \ + -e 's,drivers/media/video/cx23885/cimax2\.h,drivers/media/pci/cx23885/cimax2\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-417\.c,drivers/media/pci/cx23885/cx23885-417\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-alsa\.c,drivers/media/pci/cx23885/cx23885-alsa\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-av\.c,drivers/media/pci/cx23885/cx23885-av\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-av\.h,drivers/media/pci/cx23885/cx23885-av\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-cards\.c,drivers/media/pci/cx23885/cx23885-cards\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-core\.c,drivers/media/pci/cx23885/cx23885-core\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-dvb\.c,drivers/media/pci/cx23885/cx23885-dvb\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-f300\.c,drivers/media/pci/cx23885/cx23885-f300\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-f300\.h,drivers/media/pci/cx23885/cx23885-f300\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-i2c\.c,drivers/media/pci/cx23885/cx23885-i2c\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-input\.c,drivers/media/pci/cx23885/cx23885-input\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-input\.h,drivers/media/pci/cx23885/cx23885-input\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-ioctl\.c,drivers/media/pci/cx23885/cx23885-ioctl\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-ioctl\.h,drivers/media/pci/cx23885/cx23885-ioctl\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-ir\.c,drivers/media/pci/cx23885/cx23885-ir\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-ir\.h,drivers/media/pci/cx23885/cx23885-ir\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-reg\.h,drivers/media/pci/cx23885/cx23885-reg\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23885-vbi\.c,drivers/media/pci/cx23885/cx23885-vbi\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885-video\.c,drivers/media/pci/cx23885/cx23885-video\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23885\.h,drivers/media/pci/cx23885/cx23885\.h,g' \ + -e 's,drivers/media/video/cx23885/cx23888-ir\.c,drivers/media/pci/cx23885/cx23888-ir\.c,g' \ + -e 's,drivers/media/video/cx23885/cx23888-ir\.h,drivers/media/pci/cx23885/cx23888-ir\.h,g' \ + -e 's,drivers/media/video/cx23885/netup-eeprom\.c,drivers/media/pci/cx23885/netup-eeprom\.c,g' \ + -e 's,drivers/media/video/cx23885/netup-eeprom\.h,drivers/media/pci/cx23885/netup-eeprom\.h,g' \ + -e 's,drivers/media/video/cx23885/netup-init\.c,drivers/media/pci/cx23885/netup-init\.c,g' \ + -e 's,drivers/media/video/cx23885/netup-init\.h,drivers/media/pci/cx23885/netup-init\.h,g' \ + -e 's,drivers/media/video/cx25821/Kconfig,drivers/media/pci/cx25821/Kconfig,g' \ + -e 's,drivers/media/video/cx25821/Makefile,drivers/media/pci/cx25821/Makefile,g' \ + -e 's,drivers/media/video/cx25821/cx25821-alsa\.c,drivers/media/pci/cx25821/cx25821-alsa\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-audio-upstream\.c,drivers/media/pci/cx25821/cx25821-audio-upstream\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-audio-upstream\.h,drivers/media/pci/cx25821/cx25821-audio-upstream\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-audio\.h,drivers/media/pci/cx25821/cx25821-audio\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-biffuncs\.h,drivers/media/pci/cx25821/cx25821-biffuncs\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-cards\.c,drivers/media/pci/cx25821/cx25821-cards\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-core\.c,drivers/media/pci/cx25821/cx25821-core\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-gpio\.c,drivers/media/pci/cx25821/cx25821-gpio\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-i2c\.c,drivers/media/pci/cx25821/cx25821-i2c\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-medusa-defines\.h,drivers/media/pci/cx25821/cx25821-medusa-defines\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-medusa-reg\.h,drivers/media/pci/cx25821/cx25821-medusa-reg\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-medusa-video\.c,drivers/media/pci/cx25821/cx25821-medusa-video\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-medusa-video\.h,drivers/media/pci/cx25821/cx25821-medusa-video\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-reg\.h,drivers/media/pci/cx25821/cx25821-reg\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-sram\.h,drivers/media/pci/cx25821/cx25821-sram\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video-upstream-ch2\.c,drivers/media/pci/cx25821/cx25821-video-upstream-ch2\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video-upstream-ch2\.h,drivers/media/pci/cx25821/cx25821-video-upstream-ch2\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video-upstream\.c,drivers/media/pci/cx25821/cx25821-video-upstream\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video-upstream\.h,drivers/media/pci/cx25821/cx25821-video-upstream\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video\.c,drivers/media/pci/cx25821/cx25821-video\.c,g' \ + -e 's,drivers/media/video/cx25821/cx25821-video\.h,drivers/media/pci/cx25821/cx25821-video\.h,g' \ + -e 's,drivers/media/video/cx25821/cx25821\.h,drivers/media/pci/cx25821/cx25821\.h,g' \ + -e 's,drivers/media/video/cx88/Kconfig,drivers/media/pci/cx88/Kconfig,g' \ + -e 's,drivers/media/video/cx88/Makefile,drivers/media/pci/cx88/Makefile,g' \ + -e 's,drivers/media/video/cx88/cx88-alsa\.c,drivers/media/pci/cx88/cx88-alsa\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-blackbird\.c,drivers/media/pci/cx88/cx88-blackbird\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-cards\.c,drivers/media/pci/cx88/cx88-cards\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-core\.c,drivers/media/pci/cx88/cx88-core\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-dsp\.c,drivers/media/pci/cx88/cx88-dsp\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-dvb\.c,drivers/media/pci/cx88/cx88-dvb\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-i2c\.c,drivers/media/pci/cx88/cx88-i2c\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-input\.c,drivers/media/pci/cx88/cx88-input\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-mpeg\.c,drivers/media/pci/cx88/cx88-mpeg\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-reg\.h,drivers/media/pci/cx88/cx88-reg\.h,g' \ + -e 's,drivers/media/video/cx88/cx88-tvaudio\.c,drivers/media/pci/cx88/cx88-tvaudio\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-vbi\.c,drivers/media/pci/cx88/cx88-vbi\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-video\.c,drivers/media/pci/cx88/cx88-video\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-vp3054-i2c\.c,drivers/media/pci/cx88/cx88-vp3054-i2c\.c,g' \ + -e 's,drivers/media/video/cx88/cx88-vp3054-i2c\.h,drivers/media/pci/cx88/cx88-vp3054-i2c\.h,g' \ + -e 's,drivers/media/video/cx88/cx88\.h,drivers/media/pci/cx88/cx88\.h,g' \ + -e 's,drivers/media/dvb/ddbridge/Kconfig,drivers/media/pci/ddbridge/Kconfig,g' \ + -e 's,drivers/media/dvb/ddbridge/Makefile,drivers/media/pci/ddbridge/Makefile,g' \ + -e 's,drivers/media/dvb/ddbridge/ddbridge-core\.c,drivers/media/pci/ddbridge/ddbridge-core\.c,g' \ + -e 's,drivers/media/dvb/ddbridge/ddbridge-regs\.h,drivers/media/pci/ddbridge/ddbridge-regs\.h,g' \ + -e 's,drivers/media/dvb/ddbridge/ddbridge\.h,drivers/media/pci/ddbridge/ddbridge\.h,g' \ + -e 's,drivers/media/dvb/dm1105/Kconfig,drivers/media/pci/dm1105/Kconfig,g' \ + -e 's,drivers/media/dvb/dm1105/Makefile,drivers/media/pci/dm1105/Makefile,g' \ + -e 's,drivers/media/dvb/dm1105/dm1105\.c,drivers/media/pci/dm1105/dm1105\.c,g' \ + -e 's,drivers/media/video/ivtv/Kconfig,drivers/media/pci/ivtv/Kconfig,g' \ + -e 's,drivers/media/video/ivtv/Makefile,drivers/media/pci/ivtv/Makefile,g' \ + -e 's,drivers/media/video/ivtv/ivtv-cards\.c,drivers/media/pci/ivtv/ivtv-cards\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-cards\.h,drivers/media/pci/ivtv/ivtv-cards\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-controls\.c,drivers/media/pci/ivtv/ivtv-controls\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-controls\.h,drivers/media/pci/ivtv/ivtv-controls\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-driver\.c,drivers/media/pci/ivtv/ivtv-driver\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-driver\.h,drivers/media/pci/ivtv/ivtv-driver\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-fileops\.c,drivers/media/pci/ivtv/ivtv-fileops\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-fileops\.h,drivers/media/pci/ivtv/ivtv-fileops\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-firmware\.c,drivers/media/pci/ivtv/ivtv-firmware\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-firmware\.h,drivers/media/pci/ivtv/ivtv-firmware\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-gpio\.c,drivers/media/pci/ivtv/ivtv-gpio\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-gpio\.h,drivers/media/pci/ivtv/ivtv-gpio\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-i2c\.c,drivers/media/pci/ivtv/ivtv-i2c\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-i2c\.h,drivers/media/pci/ivtv/ivtv-i2c\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-ioctl\.c,drivers/media/pci/ivtv/ivtv-ioctl\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-ioctl\.h,drivers/media/pci/ivtv/ivtv-ioctl\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-irq\.c,drivers/media/pci/ivtv/ivtv-irq\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-irq\.h,drivers/media/pci/ivtv/ivtv-irq\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-mailbox\.c,drivers/media/pci/ivtv/ivtv-mailbox\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-mailbox\.h,drivers/media/pci/ivtv/ivtv-mailbox\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-queue\.c,drivers/media/pci/ivtv/ivtv-queue\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-queue\.h,drivers/media/pci/ivtv/ivtv-queue\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-routing\.c,drivers/media/pci/ivtv/ivtv-routing\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-routing\.h,drivers/media/pci/ivtv/ivtv-routing\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-streams\.c,drivers/media/pci/ivtv/ivtv-streams\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-streams\.h,drivers/media/pci/ivtv/ivtv-streams\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-udma\.c,drivers/media/pci/ivtv/ivtv-udma\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-udma\.h,drivers/media/pci/ivtv/ivtv-udma\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-vbi\.c,drivers/media/pci/ivtv/ivtv-vbi\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-vbi\.h,drivers/media/pci/ivtv/ivtv-vbi\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-version\.h,drivers/media/pci/ivtv/ivtv-version\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtv-yuv\.c,drivers/media/pci/ivtv/ivtv-yuv\.c,g' \ + -e 's,drivers/media/video/ivtv/ivtv-yuv\.h,drivers/media/pci/ivtv/ivtv-yuv\.h,g' \ + -e 's,drivers/media/video/ivtv/ivtvfb\.c,drivers/media/pci/ivtv/ivtvfb\.c,g' \ + -e 's,drivers/media/dvb/mantis/Kconfig,drivers/media/pci/mantis/Kconfig,g' \ + -e 's,drivers/media/dvb/mantis/Makefile,drivers/media/pci/mantis/Makefile,g' \ + -e 's,drivers/media/dvb/mantis/hopper_cards\.c,drivers/media/pci/mantis/hopper_cards\.c,g' \ + -e 's,drivers/media/dvb/mantis/hopper_vp3028\.c,drivers/media/pci/mantis/hopper_vp3028\.c,g' \ + -e 's,drivers/media/dvb/mantis/hopper_vp3028\.h,drivers/media/pci/mantis/hopper_vp3028\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_ca\.c,drivers/media/pci/mantis/mantis_ca\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_ca\.h,drivers/media/pci/mantis/mantis_ca\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_cards\.c,drivers/media/pci/mantis/mantis_cards\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_common\.h,drivers/media/pci/mantis/mantis_common\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_core\.c,drivers/media/pci/mantis/mantis_core\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_core\.h,drivers/media/pci/mantis/mantis_core\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_dma\.c,drivers/media/pci/mantis/mantis_dma\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_dma\.h,drivers/media/pci/mantis/mantis_dma\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_dvb\.c,drivers/media/pci/mantis/mantis_dvb\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_dvb\.h,drivers/media/pci/mantis/mantis_dvb\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_evm\.c,drivers/media/pci/mantis/mantis_evm\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_hif\.c,drivers/media/pci/mantis/mantis_hif\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_hif\.h,drivers/media/pci/mantis/mantis_hif\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_i2c\.c,drivers/media/pci/mantis/mantis_i2c\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_i2c\.h,drivers/media/pci/mantis/mantis_i2c\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_input\.c,drivers/media/pci/mantis/mantis_input\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_ioc\.c,drivers/media/pci/mantis/mantis_ioc\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_ioc\.h,drivers/media/pci/mantis/mantis_ioc\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_link\.h,drivers/media/pci/mantis/mantis_link\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_pci\.c,drivers/media/pci/mantis/mantis_pci\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_pci\.h,drivers/media/pci/mantis/mantis_pci\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_pcmcia\.c,drivers/media/pci/mantis/mantis_pcmcia\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_reg\.h,drivers/media/pci/mantis/mantis_reg\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_uart\.c,drivers/media/pci/mantis/mantis_uart\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_uart\.h,drivers/media/pci/mantis/mantis_uart\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1033\.c,drivers/media/pci/mantis/mantis_vp1033\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1033\.h,drivers/media/pci/mantis/mantis_vp1033\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1034\.c,drivers/media/pci/mantis/mantis_vp1034\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1034\.h,drivers/media/pci/mantis/mantis_vp1034\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1041\.c,drivers/media/pci/mantis/mantis_vp1041\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp1041\.h,drivers/media/pci/mantis/mantis_vp1041\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp2033\.c,drivers/media/pci/mantis/mantis_vp2033\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp2033\.h,drivers/media/pci/mantis/mantis_vp2033\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp2040\.c,drivers/media/pci/mantis/mantis_vp2040\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp2040\.h,drivers/media/pci/mantis/mantis_vp2040\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp3028\.c,drivers/media/pci/mantis/mantis_vp3028\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp3028\.h,drivers/media/pci/mantis/mantis_vp3028\.h,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp3030\.c,drivers/media/pci/mantis/mantis_vp3030\.c,g' \ + -e 's,drivers/media/dvb/mantis/mantis_vp3030\.h,drivers/media/pci/mantis/mantis_vp3030\.h,g' \ + -e 's,drivers/media/video/meye\.c,drivers/media/pci/meye/meye\.c,g' \ + -e 's,drivers/media/video/meye\.h,drivers/media/pci/meye/meye\.h,g' \ + -e 's,drivers/media/dvb/ngene/Kconfig,drivers/media/pci/ngene/Kconfig,g' \ + -e 's,drivers/media/dvb/ngene/Makefile,drivers/media/pci/ngene/Makefile,g' \ + -e 's,drivers/media/dvb/ngene/ngene-cards\.c,drivers/media/pci/ngene/ngene-cards\.c,g' \ + -e 's,drivers/media/dvb/ngene/ngene-core\.c,drivers/media/pci/ngene/ngene-core\.c,g' \ + -e 's,drivers/media/dvb/ngene/ngene-dvb\.c,drivers/media/pci/ngene/ngene-dvb\.c,g' \ + -e 's,drivers/media/dvb/ngene/ngene-i2c\.c,drivers/media/pci/ngene/ngene-i2c\.c,g' \ + -e 's,drivers/media/dvb/ngene/ngene\.h,drivers/media/pci/ngene/ngene\.h,g' \ + -e 's,drivers/media/dvb/pluto2/Kconfig,drivers/media/pci/pluto2/Kconfig,g' \ + -e 's,drivers/media/dvb/pluto2/Makefile,drivers/media/pci/pluto2/Makefile,g' \ + -e 's,drivers/media/dvb/pluto2/pluto2\.c,drivers/media/pci/pluto2/pluto2\.c,g' \ + -e 's,drivers/media/dvb/pt1/Kconfig,drivers/media/pci/pt1/Kconfig,g' \ + -e 's,drivers/media/dvb/pt1/Makefile,drivers/media/pci/pt1/Makefile,g' \ + -e 's,drivers/media/dvb/pt1/pt1\.c,drivers/media/pci/pt1/pt1\.c,g' \ + -e 's,drivers/media/dvb/pt1/va1j5jf8007s\.c,drivers/media/pci/pt1/va1j5jf8007s\.c,g' \ + -e 's,drivers/media/dvb/pt1/va1j5jf8007s\.h,drivers/media/pci/pt1/va1j5jf8007s\.h,g' \ + -e 's,drivers/media/dvb/pt1/va1j5jf8007t\.c,drivers/media/pci/pt1/va1j5jf8007t\.c,g' \ + -e 's,drivers/media/dvb/pt1/va1j5jf8007t\.h,drivers/media/pci/pt1/va1j5jf8007t\.h,g' \ + -e 's,drivers/media/video/saa7134/Kconfig,drivers/media/pci/saa7134/Kconfig,g' \ + -e 's,drivers/media/video/saa7134/Makefile,drivers/media/pci/saa7134/Makefile,g' \ + -e 's,drivers/media/video/saa7134/saa6752hs\.c,drivers/media/pci/saa7134/saa6752hs\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-alsa\.c,drivers/media/pci/saa7134/saa7134-alsa\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-cards\.c,drivers/media/pci/saa7134/saa7134-cards\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-core\.c,drivers/media/pci/saa7134/saa7134-core\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-dvb\.c,drivers/media/pci/saa7134/saa7134-dvb\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-empress\.c,drivers/media/pci/saa7134/saa7134-empress\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-i2c\.c,drivers/media/pci/saa7134/saa7134-i2c\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-input\.c,drivers/media/pci/saa7134/saa7134-input\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-reg\.h,drivers/media/pci/saa7134/saa7134-reg\.h,g' \ + -e 's,drivers/media/video/saa7134/saa7134-ts\.c,drivers/media/pci/saa7134/saa7134-ts\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-tvaudio\.c,drivers/media/pci/saa7134/saa7134-tvaudio\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-vbi\.c,drivers/media/pci/saa7134/saa7134-vbi\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134-video\.c,drivers/media/pci/saa7134/saa7134-video\.c,g' \ + -e 's,drivers/media/video/saa7134/saa7134\.h,drivers/media/pci/saa7134/saa7134\.h,g' \ + -e 's,drivers/media/video/hexium_gemini\.c,drivers/media/pci/saa7146/hexium_gemini\.c,g' \ + -e 's,drivers/media/video/hexium_orion\.c,drivers/media/pci/saa7146/hexium_orion\.c,g' \ + -e 's,drivers/media/video/mxb\.c,drivers/media/pci/saa7146/mxb\.c,g' \ + -e 's,drivers/media/video/saa7164/Kconfig,drivers/media/pci/saa7164/Kconfig,g' \ + -e 's,drivers/media/video/saa7164/Makefile,drivers/media/pci/saa7164/Makefile,g' \ + -e 's,drivers/media/video/saa7164/saa7164-api\.c,drivers/media/pci/saa7164/saa7164-api\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-buffer\.c,drivers/media/pci/saa7164/saa7164-buffer\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-bus\.c,drivers/media/pci/saa7164/saa7164-bus\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-cards\.c,drivers/media/pci/saa7164/saa7164-cards\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-cmd\.c,drivers/media/pci/saa7164/saa7164-cmd\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-core\.c,drivers/media/pci/saa7164/saa7164-core\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-dvb\.c,drivers/media/pci/saa7164/saa7164-dvb\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-encoder\.c,drivers/media/pci/saa7164/saa7164-encoder\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-fw\.c,drivers/media/pci/saa7164/saa7164-fw\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-i2c\.c,drivers/media/pci/saa7164/saa7164-i2c\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164-reg\.h,drivers/media/pci/saa7164/saa7164-reg\.h,g' \ + -e 's,drivers/media/video/saa7164/saa7164-types\.h,drivers/media/pci/saa7164/saa7164-types\.h,g' \ + -e 's,drivers/media/video/saa7164/saa7164-vbi\.c,drivers/media/pci/saa7164/saa7164-vbi\.c,g' \ + -e 's,drivers/media/video/saa7164/saa7164\.h,drivers/media/pci/saa7164/saa7164\.h,g' \ + -e 's,drivers/media/video/sta2x11_vip\.c,drivers/media/pci/sta2x11/sta2x11_vip\.c,g' \ + -e 's,drivers/media/video/sta2x11_vip\.h,drivers/media/pci/sta2x11/sta2x11_vip\.h,g' \ + -e 's,drivers/media/dvb/ttpci/Kconfig,drivers/media/pci/ttpci/Kconfig,g' \ + -e 's,drivers/media/dvb/ttpci/Makefile,drivers/media/pci/ttpci/Makefile,g' \ + -e 's,drivers/media/dvb/ttpci/av7110\.c,drivers/media/pci/ttpci/av7110\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110\.h,drivers/media/pci/ttpci/av7110\.h,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_av\.c,drivers/media/pci/ttpci/av7110_av\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_av\.h,drivers/media/pci/ttpci/av7110_av\.h,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_ca\.c,drivers/media/pci/ttpci/av7110_ca\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_ca\.h,drivers/media/pci/ttpci/av7110_ca\.h,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_hw\.c,drivers/media/pci/ttpci/av7110_hw\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_hw\.h,drivers/media/pci/ttpci/av7110_hw\.h,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_ipack\.c,drivers/media/pci/ttpci/av7110_ipack\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_ipack\.h,drivers/media/pci/ttpci/av7110_ipack\.h,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_ir\.c,drivers/media/pci/ttpci/av7110_ir\.c,g' \ + -e 's,drivers/media/dvb/ttpci/av7110_v4l\.c,drivers/media/pci/ttpci/av7110_v4l\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget-av\.c,drivers/media/pci/ttpci/budget-av\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget-ci\.c,drivers/media/pci/ttpci/budget-ci\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget-core\.c,drivers/media/pci/ttpci/budget-core\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget-patch\.c,drivers/media/pci/ttpci/budget-patch\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget\.c,drivers/media/pci/ttpci/budget\.c,g' \ + -e 's,drivers/media/dvb/ttpci/budget\.h,drivers/media/pci/ttpci/budget\.h,g' \ + -e 's,drivers/media/dvb/ttpci/ttpci-eeprom\.c,drivers/media/pci/ttpci/ttpci-eeprom\.c,g' \ + -e 's,drivers/media/dvb/ttpci/ttpci-eeprom\.h,drivers/media/pci/ttpci/ttpci-eeprom\.h,g' \ + -e 's,drivers/media/video/zoran/Kconfig,drivers/media/pci/zoran/Kconfig,g' \ + -e 's,drivers/media/video/zoran/Makefile,drivers/media/pci/zoran/Makefile,g' \ + -e 's,drivers/media/video/zoran/videocodec\.c,drivers/media/pci/zoran/videocodec\.c,g' \ + -e 's,drivers/media/video/zoran/videocodec\.h,drivers/media/pci/zoran/videocodec\.h,g' \ + -e 's,drivers/media/video/zoran/zoran\.h,drivers/media/pci/zoran/zoran\.h,g' \ + -e 's,drivers/media/video/zoran/zoran_card\.c,drivers/media/pci/zoran/zoran_card\.c,g' \ + -e 's,drivers/media/video/zoran/zoran_card\.h,drivers/media/pci/zoran/zoran_card\.h,g' \ + -e 's,drivers/media/video/zoran/zoran_device\.c,drivers/media/pci/zoran/zoran_device\.c,g' \ + -e 's,drivers/media/video/zoran/zoran_device\.h,drivers/media/pci/zoran/zoran_device\.h,g' \ + -e 's,drivers/media/video/zoran/zoran_driver\.c,drivers/media/pci/zoran/zoran_driver\.c,g' \ + -e 's,drivers/media/video/zoran/zoran_procfs\.c,drivers/media/pci/zoran/zoran_procfs\.c,g' \ + -e 's,drivers/media/video/zoran/zoran_procfs\.h,drivers/media/pci/zoran/zoran_procfs\.h,g' \ + -e 's,drivers/media/video/zoran/zr36016\.c,drivers/media/pci/zoran/zr36016\.c,g' \ + -e 's,drivers/media/video/zoran/zr36016\.h,drivers/media/pci/zoran/zr36016\.h,g' \ + -e 's,drivers/media/video/zoran/zr36050\.c,drivers/media/pci/zoran/zr36050\.c,g' \ + -e 's,drivers/media/video/zoran/zr36050\.h,drivers/media/pci/zoran/zr36050\.h,g' \ + -e 's,drivers/media/video/zoran/zr36057\.h,drivers/media/pci/zoran/zr36057\.h,g' \ + -e 's,drivers/media/video/zoran/zr36060\.c,drivers/media/pci/zoran/zr36060\.c,g' \ + -e 's,drivers/media/video/zoran/zr36060\.h,drivers/media/pci/zoran/zr36060\.h,g' \ + -e 's,drivers/media/video/arv\.c,drivers/media/platform/arv\.c,g' \ + -e 's,drivers/media/video/blackfin/Kconfig,drivers/media/platform/blackfin/Kconfig,g' \ + -e 's,drivers/media/video/blackfin/Makefile,drivers/media/platform/blackfin/Makefile,g' \ + -e 's,drivers/media/video/blackfin/bfin_capture\.c,drivers/media/platform/blackfin/bfin_capture\.c,g' \ + -e 's,drivers/media/video/blackfin/ppi\.c,drivers/media/platform/blackfin/ppi\.c,g' \ + -e 's,drivers/media/video/coda\.c,drivers/media/platform/coda\.c,g' \ + -e 's,drivers/media/video/coda\.h,drivers/media/platform/coda\.h,g' \ + -e 's,drivers/media/video/davinci/Kconfig,drivers/media/platform/davinci/Kconfig,g' \ + -e 's,drivers/media/video/davinci/Makefile,drivers/media/platform/davinci/Makefile,g' \ + -e 's,drivers/media/video/davinci/ccdc_hw_device\.h,drivers/media/platform/davinci/ccdc_hw_device\.h,g' \ + -e 's,drivers/media/video/davinci/dm355_ccdc\.c,drivers/media/platform/davinci/dm355_ccdc\.c,g' \ + -e 's,drivers/media/video/davinci/dm355_ccdc_regs\.h,drivers/media/platform/davinci/dm355_ccdc_regs\.h,g' \ + -e 's,drivers/media/video/davinci/dm644x_ccdc\.c,drivers/media/platform/davinci/dm644x_ccdc\.c,g' \ + -e 's,drivers/media/video/davinci/dm644x_ccdc_regs\.h,drivers/media/platform/davinci/dm644x_ccdc_regs\.h,g' \ + -e 's,drivers/media/video/davinci/isif\.c,drivers/media/platform/davinci/isif\.c,g' \ + -e 's,drivers/media/video/davinci/isif_regs\.h,drivers/media/platform/davinci/isif_regs\.h,g' \ + -e 's,drivers/media/video/davinci/vpbe\.c,drivers/media/platform/davinci/vpbe\.c,g' \ + -e 's,drivers/media/video/davinci/vpbe_display\.c,drivers/media/platform/davinci/vpbe_display\.c,g' \ + -e 's,drivers/media/video/davinci/vpbe_osd\.c,drivers/media/platform/davinci/vpbe_osd\.c,g' \ + -e 's,drivers/media/video/davinci/vpbe_osd_regs\.h,drivers/media/platform/davinci/vpbe_osd_regs\.h,g' \ + -e 's,drivers/media/video/davinci/vpbe_venc\.c,drivers/media/platform/davinci/vpbe_venc\.c,g' \ + -e 's,drivers/media/video/davinci/vpbe_venc_regs\.h,drivers/media/platform/davinci/vpbe_venc_regs\.h,g' \ + -e 's,drivers/media/video/davinci/vpfe_capture\.c,drivers/media/platform/davinci/vpfe_capture\.c,g' \ + -e 's,drivers/media/video/davinci/vpif\.c,drivers/media/platform/davinci/vpif\.c,g' \ + -e 's,drivers/media/video/davinci/vpif\.h,drivers/media/platform/davinci/vpif\.h,g' \ + -e 's,drivers/media/video/davinci/vpif_capture\.c,drivers/media/platform/davinci/vpif_capture\.c,g' \ + -e 's,drivers/media/video/davinci/vpif_capture\.h,drivers/media/platform/davinci/vpif_capture\.h,g' \ + -e 's,drivers/media/video/davinci/vpif_display\.c,drivers/media/platform/davinci/vpif_display\.c,g' \ + -e 's,drivers/media/video/davinci/vpif_display\.h,drivers/media/platform/davinci/vpif_display\.h,g' \ + -e 's,drivers/media/video/davinci/vpss\.c,drivers/media/platform/davinci/vpss\.c,g' \ + -e 's,drivers/media/video/fsl-viu\.c,drivers/media/platform/fsl-viu\.c,g' \ + -e 's,drivers/media/video/indycam\.c,drivers/media/platform/indycam\.c,g' \ + -e 's,drivers/media/video/indycam\.h,drivers/media/platform/indycam\.h,g' \ + -e 's,drivers/media/video/m2m-deinterlace\.c,drivers/media/platform/m2m-deinterlace\.c,g' \ + -e 's,drivers/media/video/marvell-ccic/Kconfig,drivers/media/platform/marvell-ccic/Kconfig,g' \ + -e 's,drivers/media/video/marvell-ccic/Makefile,drivers/media/platform/marvell-ccic/Makefile,g' \ + -e 's,drivers/media/video/marvell-ccic/cafe-driver\.c,drivers/media/platform/marvell-ccic/cafe-driver\.c,g' \ + -e 's,drivers/media/video/marvell-ccic/mcam-core\.c,drivers/media/platform/marvell-ccic/mcam-core\.c,g' \ + -e 's,drivers/media/video/marvell-ccic/mcam-core\.h,drivers/media/platform/marvell-ccic/mcam-core\.h,g' \ + -e 's,drivers/media/video/marvell-ccic/mmp-driver\.c,drivers/media/platform/marvell-ccic/mmp-driver\.c,g' \ + -e 's,drivers/media/video/mem2mem_testdev\.c,drivers/media/platform/mem2mem_testdev\.c,g' \ + -e 's,drivers/media/video/mx2_emmaprp\.c,drivers/media/platform/mx2_emmaprp\.c,g' \ + -e 's,drivers/media/video/omap/Kconfig,drivers/media/platform/omap/Kconfig,g' \ + -e 's,drivers/media/video/omap/Makefile,drivers/media/platform/omap/Makefile,g' \ + -e 's,drivers/media/video/omap/omap_vout\.c,drivers/media/platform/omap/omap_vout\.c,g' \ + -e 's,drivers/media/video/omap/omap_vout_vrfb\.c,drivers/media/platform/omap/omap_vout_vrfb\.c,g' \ + -e 's,drivers/media/video/omap/omap_vout_vrfb\.h,drivers/media/platform/omap/omap_vout_vrfb\.h,g' \ + -e 's,drivers/media/video/omap/omap_voutdef\.h,drivers/media/platform/omap/omap_voutdef\.h,g' \ + -e 's,drivers/media/video/omap/omap_voutlib\.c,drivers/media/platform/omap/omap_voutlib\.c,g' \ + -e 's,drivers/media/video/omap/omap_voutlib\.h,drivers/media/platform/omap/omap_voutlib\.h,g' \ + -e 's,drivers/media/video/omap24xxcam-dma\.c,drivers/media/platform/omap24xxcam-dma\.c,g' \ + -e 's,drivers/media/video/omap24xxcam\.c,drivers/media/platform/omap24xxcam\.c,g' \ + -e 's,drivers/media/video/omap24xxcam\.h,drivers/media/platform/omap24xxcam\.h,g' \ + -e 's,drivers/media/video/omap3isp/Makefile,drivers/media/platform/omap3isp/Makefile,g' \ + -e 's,drivers/media/video/omap3isp/cfa_coef_table\.h,drivers/media/platform/omap3isp/cfa_coef_table\.h,g' \ + -e 's,drivers/media/video/omap3isp/gamma_table\.h,drivers/media/platform/omap3isp/gamma_table\.h,g' \ + -e 's,drivers/media/video/omap3isp/isp\.c,drivers/media/platform/omap3isp/isp\.c,g' \ + -e 's,drivers/media/video/omap3isp/isp\.h,drivers/media/platform/omap3isp/isp\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispccdc\.c,drivers/media/platform/omap3isp/ispccdc\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispccdc\.h,drivers/media/platform/omap3isp/ispccdc\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispccp2\.c,drivers/media/platform/omap3isp/ispccp2\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispccp2\.h,drivers/media/platform/omap3isp/ispccp2\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispcsi2\.c,drivers/media/platform/omap3isp/ispcsi2\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispcsi2\.h,drivers/media/platform/omap3isp/ispcsi2\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispcsiphy\.c,drivers/media/platform/omap3isp/ispcsiphy\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispcsiphy\.h,drivers/media/platform/omap3isp/ispcsiphy\.h,g' \ + -e 's,drivers/media/video/omap3isp/isph3a\.h,drivers/media/platform/omap3isp/isph3a\.h,g' \ + -e 's,drivers/media/video/omap3isp/isph3a_aewb\.c,drivers/media/platform/omap3isp/isph3a_aewb\.c,g' \ + -e 's,drivers/media/video/omap3isp/isph3a_af\.c,drivers/media/platform/omap3isp/isph3a_af\.c,g' \ + -e 's,drivers/media/video/omap3isp/isphist\.c,drivers/media/platform/omap3isp/isphist\.c,g' \ + -e 's,drivers/media/video/omap3isp/isphist\.h,drivers/media/platform/omap3isp/isphist\.h,g' \ + -e 's,drivers/media/video/omap3isp/isppreview\.c,drivers/media/platform/omap3isp/isppreview\.c,g' \ + -e 's,drivers/media/video/omap3isp/isppreview\.h,drivers/media/platform/omap3isp/isppreview\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispqueue\.c,drivers/media/platform/omap3isp/ispqueue\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispqueue\.h,drivers/media/platform/omap3isp/ispqueue\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispreg\.h,drivers/media/platform/omap3isp/ispreg\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispresizer\.c,drivers/media/platform/omap3isp/ispresizer\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispresizer\.h,drivers/media/platform/omap3isp/ispresizer\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispstat\.c,drivers/media/platform/omap3isp/ispstat\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispstat\.h,drivers/media/platform/omap3isp/ispstat\.h,g' \ + -e 's,drivers/media/video/omap3isp/ispvideo\.c,drivers/media/platform/omap3isp/ispvideo\.c,g' \ + -e 's,drivers/media/video/omap3isp/ispvideo\.h,drivers/media/platform/omap3isp/ispvideo\.h,g' \ + -e 's,drivers/media/video/omap3isp/luma_enhance_table\.h,drivers/media/platform/omap3isp/luma_enhance_table\.h,g' \ + -e 's,drivers/media/video/omap3isp/noise_filter_table\.h,drivers/media/platform/omap3isp/noise_filter_table\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/Kconfig,drivers/media/platform/s5p-fimc/Kconfig,g' \ + -e 's,drivers/media/video/s5p-fimc/Makefile,drivers/media/platform/s5p-fimc/Makefile,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-capture\.c,drivers/media/platform/s5p-fimc/fimc-capture\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-core\.c,drivers/media/platform/s5p-fimc/fimc-core\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-core\.h,drivers/media/platform/s5p-fimc/fimc-core\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-lite-reg\.c,drivers/media/platform/s5p-fimc/fimc-lite-reg\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-lite-reg\.h,drivers/media/platform/s5p-fimc/fimc-lite-reg\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-lite\.c,drivers/media/platform/s5p-fimc/fimc-lite\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-lite\.h,drivers/media/platform/s5p-fimc/fimc-lite\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-m2m\.c,drivers/media/platform/s5p-fimc/fimc-m2m\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-mdevice\.c,drivers/media/platform/s5p-fimc/fimc-mdevice\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-mdevice\.h,drivers/media/platform/s5p-fimc/fimc-mdevice\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-reg\.c,drivers/media/platform/s5p-fimc/fimc-reg\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/fimc-reg\.h,drivers/media/platform/s5p-fimc/fimc-reg\.h,g' \ + -e 's,drivers/media/video/s5p-fimc/mipi-csis\.c,drivers/media/platform/s5p-fimc/mipi-csis\.c,g' \ + -e 's,drivers/media/video/s5p-fimc/mipi-csis\.h,drivers/media/platform/s5p-fimc/mipi-csis\.h,g' \ + -e 's,drivers/media/video/s5p-g2d/Makefile,drivers/media/platform/s5p-g2d/Makefile,g' \ + -e 's,drivers/media/video/s5p-g2d/g2d-hw\.c,drivers/media/platform/s5p-g2d/g2d-hw\.c,g' \ + -e 's,drivers/media/video/s5p-g2d/g2d-regs\.h,drivers/media/platform/s5p-g2d/g2d-regs\.h,g' \ + -e 's,drivers/media/video/s5p-g2d/g2d\.c,drivers/media/platform/s5p-g2d/g2d\.c,g' \ + -e 's,drivers/media/video/s5p-g2d/g2d\.h,drivers/media/platform/s5p-g2d/g2d\.h,g' \ + -e 's,drivers/media/video/s5p-jpeg/Makefile,drivers/media/platform/s5p-jpeg/Makefile,g' \ + -e 's,drivers/media/video/s5p-jpeg/jpeg-core\.c,drivers/media/platform/s5p-jpeg/jpeg-core\.c,g' \ + -e 's,drivers/media/video/s5p-jpeg/jpeg-core\.h,drivers/media/platform/s5p-jpeg/jpeg-core\.h,g' \ + -e 's,drivers/media/video/s5p-jpeg/jpeg-hw\.h,drivers/media/platform/s5p-jpeg/jpeg-hw\.h,g' \ + -e 's,drivers/media/video/s5p-jpeg/jpeg-regs\.h,drivers/media/platform/s5p-jpeg/jpeg-regs\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/Makefile,drivers/media/platform/s5p-mfc/Makefile,g' \ + -e 's,drivers/media/video/s5p-mfc/regs-mfc\.h,drivers/media/platform/s5p-mfc/regs-mfc\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc\.c,drivers/media/platform/s5p-mfc/s5p_mfc\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_cmd\.c,drivers/media/platform/s5p-mfc/s5p_mfc_cmd\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_cmd\.h,drivers/media/platform/s5p-mfc/s5p_mfc_cmd\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_common\.h,drivers/media/platform/s5p-mfc/s5p_mfc_common\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_ctrl\.c,drivers/media/platform/s5p-mfc/s5p_mfc_ctrl\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_ctrl\.h,drivers/media/platform/s5p-mfc/s5p_mfc_ctrl\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_debug\.h,drivers/media/platform/s5p-mfc/s5p_mfc_debug\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_dec\.c,drivers/media/platform/s5p-mfc/s5p_mfc_dec\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_dec\.h,drivers/media/platform/s5p-mfc/s5p_mfc_dec\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_enc\.c,drivers/media/platform/s5p-mfc/s5p_mfc_enc\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_enc\.h,drivers/media/platform/s5p-mfc/s5p_mfc_enc\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_intr\.c,drivers/media/platform/s5p-mfc/s5p_mfc_intr\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_intr\.h,drivers/media/platform/s5p-mfc/s5p_mfc_intr\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_opr\.c,drivers/media/platform/s5p-mfc/s5p_mfc_opr\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_opr\.h,drivers/media/platform/s5p-mfc/s5p_mfc_opr\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_pm\.c,drivers/media/platform/s5p-mfc/s5p_mfc_pm\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_pm\.h,drivers/media/platform/s5p-mfc/s5p_mfc_pm\.h,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_shm\.c,drivers/media/platform/s5p-mfc/s5p_mfc_shm\.c,g' \ + -e 's,drivers/media/video/s5p-mfc/s5p_mfc_shm\.h,drivers/media/platform/s5p-mfc/s5p_mfc_shm\.h,g' \ + -e 's,drivers/media/video/s5p-tv/Kconfig,drivers/media/platform/s5p-tv/Kconfig,g' \ + -e 's,drivers/media/video/s5p-tv/Makefile,drivers/media/platform/s5p-tv/Makefile,g' \ + -e 's,drivers/media/video/s5p-tv/hdmi_drv\.c,drivers/media/platform/s5p-tv/hdmi_drv\.c,g' \ + -e 's,drivers/media/video/s5p-tv/hdmiphy_drv\.c,drivers/media/platform/s5p-tv/hdmiphy_drv\.c,g' \ + -e 's,drivers/media/video/s5p-tv/mixer\.h,drivers/media/platform/s5p-tv/mixer\.h,g' \ + -e 's,drivers/media/video/s5p-tv/mixer_drv\.c,drivers/media/platform/s5p-tv/mixer_drv\.c,g' \ + -e 's,drivers/media/video/s5p-tv/mixer_grp_layer\.c,drivers/media/platform/s5p-tv/mixer_grp_layer\.c,g' \ + -e 's,drivers/media/video/s5p-tv/mixer_reg\.c,drivers/media/platform/s5p-tv/mixer_reg\.c,g' \ + -e 's,drivers/media/video/s5p-tv/mixer_video\.c,drivers/media/platform/s5p-tv/mixer_video\.c,g' \ + -e 's,drivers/media/video/s5p-tv/mixer_vp_layer\.c,drivers/media/platform/s5p-tv/mixer_vp_layer\.c,g' \ + -e 's,drivers/media/video/s5p-tv/regs-hdmi\.h,drivers/media/platform/s5p-tv/regs-hdmi\.h,g' \ + -e 's,drivers/media/video/s5p-tv/regs-mixer\.h,drivers/media/platform/s5p-tv/regs-mixer\.h,g' \ + -e 's,drivers/media/video/s5p-tv/regs-sdo\.h,drivers/media/platform/s5p-tv/regs-sdo\.h,g' \ + -e 's,drivers/media/video/s5p-tv/regs-vp\.h,drivers/media/platform/s5p-tv/regs-vp\.h,g' \ + -e 's,drivers/media/video/s5p-tv/sdo_drv\.c,drivers/media/platform/s5p-tv/sdo_drv\.c,g' \ + -e 's,drivers/media/video/s5p-tv/sii9234_drv\.c,drivers/media/platform/s5p-tv/sii9234_drv\.c,g' \ + -e 's,drivers/media/video/sh_vou\.c,drivers/media/platform/sh_vou\.c,g' \ + -e 's,drivers/media/video/atmel-isi\.c,drivers/media/platform/soc_camera/atmel-isi\.c,g' \ + -e 's,drivers/media/video/mx1_camera\.c,drivers/media/platform/soc_camera/mx1_camera\.c,g' \ + -e 's,drivers/media/video/mx2_camera\.c,drivers/media/platform/soc_camera/mx2_camera\.c,g' \ + -e 's,drivers/media/video/mx3_camera\.c,drivers/media/platform/soc_camera/mx3_camera\.c,g' \ + -e 's,drivers/media/video/omap1_camera\.c,drivers/media/platform/soc_camera/omap1_camera\.c,g' \ + -e 's,drivers/media/video/pxa_camera\.c,drivers/media/platform/soc_camera/pxa_camera\.c,g' \ + -e 's,drivers/media/video/sh_mobile_ceu_camera\.c,drivers/media/platform/soc_camera/sh_mobile_ceu_camera\.c,g' \ + -e 's,drivers/media/video/sh_mobile_csi2\.c,drivers/media/platform/soc_camera/sh_mobile_csi2\.c,g' \ + -e 's,drivers/media/video/soc_camera\.c,drivers/media/platform/soc_camera/soc_camera\.c,g' \ + -e 's,drivers/media/video/soc_camera_platform\.c,drivers/media/platform/soc_camera/soc_camera_platform\.c,g' \ + -e 's,drivers/media/video/soc_mediabus\.c,drivers/media/platform/soc_camera/soc_mediabus\.c,g' \ + -e 's,drivers/media/video/timblogiw\.c,drivers/media/platform/timblogiw\.c,g' \ + -e 's,drivers/media/video/via-camera\.c,drivers/media/platform/via-camera\.c,g' \ + -e 's,drivers/media/video/via-camera\.h,drivers/media/platform/via-camera\.h,g' \ + -e 's,drivers/media/video/vino\.c,drivers/media/platform/vino\.c,g' \ + -e 's,drivers/media/video/vino\.h,drivers/media/platform/vino\.h,g' \ + -e 's,drivers/media/video/vivi\.c,drivers/media/platform/vivi\.c,g' \ + -e 's,drivers/media/common/tuners/Kconfig,drivers/media/tuners/Kconfig,g' \ + -e 's,drivers/media/common/tuners/Makefile,drivers/media/tuners/Makefile,g' \ + -e 's,drivers/media/common/tuners/fc0011\.c,drivers/media/tuners/fc0011\.c,g' \ + -e 's,drivers/media/common/tuners/fc0011\.h,drivers/media/tuners/fc0011\.h,g' \ + -e 's,drivers/media/common/tuners/fc0012-priv\.h,drivers/media/tuners/fc0012-priv\.h,g' \ + -e 's,drivers/media/common/tuners/fc0012\.c,drivers/media/tuners/fc0012\.c,g' \ + -e 's,drivers/media/common/tuners/fc0012\.h,drivers/media/tuners/fc0012\.h,g' \ + -e 's,drivers/media/common/tuners/fc0013-priv\.h,drivers/media/tuners/fc0013-priv\.h,g' \ + -e 's,drivers/media/common/tuners/fc0013\.c,drivers/media/tuners/fc0013\.c,g' \ + -e 's,drivers/media/common/tuners/fc0013\.h,drivers/media/tuners/fc0013\.h,g' \ + -e 's,drivers/media/common/tuners/fc001x-common\.h,drivers/media/tuners/fc001x-common\.h,g' \ + -e 's,drivers/media/common/tuners/max2165\.c,drivers/media/tuners/max2165\.c,g' \ + -e 's,drivers/media/common/tuners/max2165\.h,drivers/media/tuners/max2165\.h,g' \ + -e 's,drivers/media/common/tuners/max2165_priv\.h,drivers/media/tuners/max2165_priv\.h,g' \ + -e 's,drivers/media/common/tuners/mc44s803\.c,drivers/media/tuners/mc44s803\.c,g' \ + -e 's,drivers/media/common/tuners/mc44s803\.h,drivers/media/tuners/mc44s803\.h,g' \ + -e 's,drivers/media/common/tuners/mc44s803_priv\.h,drivers/media/tuners/mc44s803_priv\.h,g' \ + -e 's,drivers/media/common/tuners/mt2060\.c,drivers/media/tuners/mt2060\.c,g' \ + -e 's,drivers/media/common/tuners/mt2060\.h,drivers/media/tuners/mt2060\.h,g' \ + -e 's,drivers/media/common/tuners/mt2060_priv\.h,drivers/media/tuners/mt2060_priv\.h,g' \ + -e 's,drivers/media/common/tuners/mt2063\.c,drivers/media/tuners/mt2063\.c,g' \ + -e 's,drivers/media/common/tuners/mt2063\.h,drivers/media/tuners/mt2063\.h,g' \ + -e 's,drivers/media/common/tuners/mt20xx\.c,drivers/media/tuners/mt20xx\.c,g' \ + -e 's,drivers/media/common/tuners/mt20xx\.h,drivers/media/tuners/mt20xx\.h,g' \ + -e 's,drivers/media/common/tuners/mt2131\.c,drivers/media/tuners/mt2131\.c,g' \ + -e 's,drivers/media/common/tuners/mt2131\.h,drivers/media/tuners/mt2131\.h,g' \ + -e 's,drivers/media/common/tuners/mt2131_priv\.h,drivers/media/tuners/mt2131_priv\.h,g' \ + -e 's,drivers/media/common/tuners/mt2266\.c,drivers/media/tuners/mt2266\.c,g' \ + -e 's,drivers/media/common/tuners/mt2266\.h,drivers/media/tuners/mt2266\.h,g' \ + -e 's,drivers/media/common/tuners/mxl5005s\.c,drivers/media/tuners/mxl5005s\.c,g' \ + -e 's,drivers/media/common/tuners/mxl5005s\.h,drivers/media/tuners/mxl5005s\.h,g' \ + -e 's,drivers/media/common/tuners/mxl5007t\.c,drivers/media/tuners/mxl5007t\.c,g' \ + -e 's,drivers/media/common/tuners/mxl5007t\.h,drivers/media/tuners/mxl5007t\.h,g' \ + -e 's,drivers/media/common/tuners/qt1010\.c,drivers/media/tuners/qt1010\.c,g' \ + -e 's,drivers/media/common/tuners/qt1010\.h,drivers/media/tuners/qt1010\.h,g' \ + -e 's,drivers/media/common/tuners/qt1010_priv\.h,drivers/media/tuners/qt1010_priv\.h,g' \ + -e 's,drivers/media/common/tuners/tda18212\.c,drivers/media/tuners/tda18212\.c,g' \ + -e 's,drivers/media/common/tuners/tda18212\.h,drivers/media/tuners/tda18212\.h,g' \ + -e 's,drivers/media/common/tuners/tda18218\.c,drivers/media/tuners/tda18218\.c,g' \ + -e 's,drivers/media/common/tuners/tda18218\.h,drivers/media/tuners/tda18218\.h,g' \ + -e 's,drivers/media/common/tuners/tda18218_priv\.h,drivers/media/tuners/tda18218_priv\.h,g' \ + -e 's,drivers/media/common/tuners/tda18271-common\.c,drivers/media/tuners/tda18271-common\.c,g' \ + -e 's,drivers/media/common/tuners/tda18271-fe\.c,drivers/media/tuners/tda18271-fe\.c,g' \ + -e 's,drivers/media/common/tuners/tda18271-maps\.c,drivers/media/tuners/tda18271-maps\.c,g' \ + -e 's,drivers/media/common/tuners/tda18271-priv\.h,drivers/media/tuners/tda18271-priv\.h,g' \ + -e 's,drivers/media/common/tuners/tda18271\.h,drivers/media/tuners/tda18271\.h,g' \ + -e 's,drivers/media/common/tuners/tda827x\.c,drivers/media/tuners/tda827x\.c,g' \ + -e 's,drivers/media/common/tuners/tda827x\.h,drivers/media/tuners/tda827x\.h,g' \ + -e 's,drivers/media/common/tuners/tda8290\.c,drivers/media/tuners/tda8290\.c,g' \ + -e 's,drivers/media/common/tuners/tda8290\.h,drivers/media/tuners/tda8290\.h,g' \ + -e 's,drivers/media/common/tuners/tda9887\.c,drivers/media/tuners/tda9887\.c,g' \ + -e 's,drivers/media/common/tuners/tda9887\.h,drivers/media/tuners/tda9887\.h,g' \ + -e 's,drivers/media/common/tuners/tea5761\.c,drivers/media/tuners/tea5761\.c,g' \ + -e 's,drivers/media/common/tuners/tea5761\.h,drivers/media/tuners/tea5761\.h,g' \ + -e 's,drivers/media/common/tuners/tea5767\.c,drivers/media/tuners/tea5767\.c,g' \ + -e 's,drivers/media/common/tuners/tea5767\.h,drivers/media/tuners/tea5767\.h,g' \ + -e 's,drivers/media/common/tuners/tua9001\.c,drivers/media/tuners/tua9001\.c,g' \ + -e 's,drivers/media/common/tuners/tua9001\.h,drivers/media/tuners/tua9001\.h,g' \ + -e 's,drivers/media/common/tuners/tua9001_priv\.h,drivers/media/tuners/tua9001_priv\.h,g' \ + -e 's,drivers/media/common/tuners/tuner-i2c\.h,drivers/media/tuners/tuner-i2c\.h,g' \ + -e 's,drivers/media/common/tuners/tuner-simple\.c,drivers/media/tuners/tuner-simple\.c,g' \ + -e 's,drivers/media/common/tuners/tuner-simple\.h,drivers/media/tuners/tuner-simple\.h,g' \ + -e 's,drivers/media/common/tuners/tuner-types\.c,drivers/media/tuners/tuner-types\.c,g' \ + -e 's,drivers/media/common/tuners/tuner-xc2028-types\.h,drivers/media/tuners/tuner-xc2028-types\.h,g' \ + -e 's,drivers/media/common/tuners/tuner-xc2028\.c,drivers/media/tuners/tuner-xc2028\.c,g' \ + -e 's,drivers/media/common/tuners/tuner-xc2028\.h,drivers/media/tuners/tuner-xc2028\.h,g' \ + -e 's,drivers/media/common/tuners/xc4000\.c,drivers/media/tuners/xc4000\.c,g' \ + -e 's,drivers/media/common/tuners/xc4000\.h,drivers/media/tuners/xc4000\.h,g' \ + -e 's,drivers/media/common/tuners/xc5000\.c,drivers/media/tuners/xc5000\.c,g' \ + -e 's,drivers/media/common/tuners/xc5000\.h,drivers/media/tuners/xc5000\.h,g' \ + -e 's,drivers/media/video/au0828/Kconfig,drivers/media/usb/au0828/Kconfig,g' \ + -e 's,drivers/media/video/au0828/Makefile,drivers/media/usb/au0828/Makefile,g' \ + -e 's,drivers/media/video/au0828/au0828-cards\.c,drivers/media/usb/au0828/au0828-cards\.c,g' \ + -e 's,drivers/media/video/au0828/au0828-cards\.h,drivers/media/usb/au0828/au0828-cards\.h,g' \ + -e 's,drivers/media/video/au0828/au0828-core\.c,drivers/media/usb/au0828/au0828-core\.c,g' \ + -e 's,drivers/media/video/au0828/au0828-dvb\.c,drivers/media/usb/au0828/au0828-dvb\.c,g' \ + -e 's,drivers/media/video/au0828/au0828-i2c\.c,drivers/media/usb/au0828/au0828-i2c\.c,g' \ + -e 's,drivers/media/video/au0828/au0828-reg\.h,drivers/media/usb/au0828/au0828-reg\.h,g' \ + -e 's,drivers/media/video/au0828/au0828-vbi\.c,drivers/media/usb/au0828/au0828-vbi\.c,g' \ + -e 's,drivers/media/video/au0828/au0828-video\.c,drivers/media/usb/au0828/au0828-video\.c,g' \ + -e 's,drivers/media/video/au0828/au0828\.h,drivers/media/usb/au0828/au0828\.h,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-usb\.c,drivers/media/usb/b2c2/flexcop-usb\.c,g' \ + -e 's,drivers/media/dvb/b2c2/flexcop-usb\.h,drivers/media/usb/b2c2/flexcop-usb\.h,g' \ + -e 's,drivers/media/video/cpia2/Kconfig,drivers/media/usb/cpia2/Kconfig,g' \ + -e 's,drivers/media/video/cpia2/Makefile,drivers/media/usb/cpia2/Makefile,g' \ + -e 's,drivers/media/video/cpia2/cpia2\.h,drivers/media/usb/cpia2/cpia2\.h,g' \ + -e 's,drivers/media/video/cpia2/cpia2_core\.c,drivers/media/usb/cpia2/cpia2_core\.c,g' \ + -e 's,drivers/media/video/cpia2/cpia2_registers\.h,drivers/media/usb/cpia2/cpia2_registers\.h,g' \ + -e 's,drivers/media/video/cpia2/cpia2_usb\.c,drivers/media/usb/cpia2/cpia2_usb\.c,g' \ + -e 's,drivers/media/video/cpia2/cpia2_v4l\.c,drivers/media/usb/cpia2/cpia2_v4l\.c,g' \ + -e 's,drivers/media/video/cx231xx/Kconfig,drivers/media/usb/cx231xx/Kconfig,g' \ + -e 's,drivers/media/video/cx231xx/Makefile,drivers/media/usb/cx231xx/Makefile,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-417\.c,drivers/media/usb/cx231xx/cx231xx-417\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-audio\.c,drivers/media/usb/cx231xx/cx231xx-audio\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-avcore\.c,drivers/media/usb/cx231xx/cx231xx-avcore\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-cards\.c,drivers/media/usb/cx231xx/cx231xx-cards\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-conf-reg\.h,drivers/media/usb/cx231xx/cx231xx-conf-reg\.h,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-core\.c,drivers/media/usb/cx231xx/cx231xx-core\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-dif\.h,drivers/media/usb/cx231xx/cx231xx-dif\.h,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-dvb\.c,drivers/media/usb/cx231xx/cx231xx-dvb\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-i2c\.c,drivers/media/usb/cx231xx/cx231xx-i2c\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-input\.c,drivers/media/usb/cx231xx/cx231xx-input\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-pcb-cfg\.c,drivers/media/usb/cx231xx/cx231xx-pcb-cfg\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-pcb-cfg\.h,drivers/media/usb/cx231xx/cx231xx-pcb-cfg\.h,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-reg\.h,drivers/media/usb/cx231xx/cx231xx-reg\.h,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-vbi\.c,drivers/media/usb/cx231xx/cx231xx-vbi\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-vbi\.h,drivers/media/usb/cx231xx/cx231xx-vbi\.h,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx-video\.c,drivers/media/usb/cx231xx/cx231xx-video\.c,g' \ + -e 's,drivers/media/video/cx231xx/cx231xx\.h,drivers/media/usb/cx231xx/cx231xx\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/Kconfig,drivers/media/usb/dvb-usb-v2/Kconfig,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/Makefile,drivers/media/usb/dvb-usb-v2/Makefile,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/af9015\.c,drivers/media/usb/dvb-usb-v2/af9015\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/af9015\.h,drivers/media/usb/dvb-usb-v2/af9015\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/af9035\.c,drivers/media/usb/dvb-usb-v2/af9035\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/af9035\.h,drivers/media/usb/dvb-usb-v2/af9035\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/anysee\.c,drivers/media/usb/dvb-usb-v2/anysee\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/anysee\.h,drivers/media/usb/dvb-usb-v2/anysee\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/au6610\.c,drivers/media/usb/dvb-usb-v2/au6610\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/au6610\.h,drivers/media/usb/dvb-usb-v2/au6610\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/az6007\.c,drivers/media/usb/dvb-usb-v2/az6007\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/ce6230\.c,drivers/media/usb/dvb-usb-v2/ce6230\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/ce6230\.h,drivers/media/usb/dvb-usb-v2/ce6230\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/cypress_firmware\.c,drivers/media/usb/dvb-usb-v2/cypress_firmware\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/cypress_firmware\.h,drivers/media/usb/dvb-usb-v2/cypress_firmware\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb\.h,drivers/media/usb/dvb-usb-v2/dvb_usb\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_common\.h,drivers/media/usb/dvb-usb-v2/dvb_usb_common\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_core\.c,drivers/media/usb/dvb-usb-v2/dvb_usb_core\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/dvb_usb_urb\.c,drivers/media/usb/dvb-usb-v2/dvb_usb_urb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/ec168\.c,drivers/media/usb/dvb-usb-v2/ec168\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/ec168\.h,drivers/media/usb/dvb-usb-v2/ec168\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/gl861\.c,drivers/media/usb/dvb-usb-v2/gl861\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/gl861\.h,drivers/media/usb/dvb-usb-v2/gl861\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/it913x\.c,drivers/media/usb/dvb-usb-v2/it913x\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/lmedm04\.c,drivers/media/usb/dvb-usb-v2/lmedm04\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/lmedm04\.h,drivers/media/usb/dvb-usb-v2/lmedm04\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-demod\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-demod\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-demod\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-demod\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-gpio\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-gpio\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-gpio\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-gpio\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-i2c\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-i2c\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-i2c\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-i2c\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-phy\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-phy\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-phy\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-phy\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-reg\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-reg\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-tuner\.c,drivers/media/usb/dvb-usb-v2/mxl111sf-tuner\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf-tuner\.h,drivers/media/usb/dvb-usb-v2/mxl111sf-tuner\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf\.c,drivers/media/usb/dvb-usb-v2/mxl111sf\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/mxl111sf\.h,drivers/media/usb/dvb-usb-v2/mxl111sf\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/rtl28xxu\.c,drivers/media/usb/dvb-usb-v2/rtl28xxu\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/rtl28xxu\.h,drivers/media/usb/dvb-usb-v2/rtl28xxu\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb-v2/usb_urb\.c,drivers/media/usb/dvb-usb-v2/usb_urb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/Kconfig,drivers/media/usb/dvb-usb/Kconfig,g' \ + -e 's,drivers/media/dvb/dvb-usb/Makefile,drivers/media/usb/dvb-usb/Makefile,g' \ + -e 's,drivers/media/dvb/dvb-usb/a800\.c,drivers/media/usb/dvb-usb/a800\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/af9005-fe\.c,drivers/media/usb/dvb-usb/af9005-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/af9005-remote\.c,drivers/media/usb/dvb-usb/af9005-remote\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/af9005-script\.h,drivers/media/usb/dvb-usb/af9005-script\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/af9005\.c,drivers/media/usb/dvb-usb/af9005\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/af9005\.h,drivers/media/usb/dvb-usb/af9005\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/az6027\.c,drivers/media/usb/dvb-usb/az6027\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/az6027\.h,drivers/media/usb/dvb-usb/az6027\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/cinergyT2-core\.c,drivers/media/usb/dvb-usb/cinergyT2-core\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/cinergyT2-fe\.c,drivers/media/usb/dvb-usb/cinergyT2-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/cinergyT2\.h,drivers/media/usb/dvb-usb/cinergyT2\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/cxusb\.c,drivers/media/usb/dvb-usb/cxusb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/cxusb\.h,drivers/media/usb/dvb-usb/cxusb\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dib0700\.h,drivers/media/usb/dvb-usb/dib0700\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dib0700_core\.c,drivers/media/usb/dvb-usb/dib0700_core\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dib0700_devices\.c,drivers/media/usb/dvb-usb/dib0700_devices\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dib07x0\.h,drivers/media/usb/dvb-usb/dib07x0\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dibusb-common\.c,drivers/media/usb/dvb-usb/dibusb-common\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dibusb-mb\.c,drivers/media/usb/dvb-usb/dibusb-mb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dibusb-mc\.c,drivers/media/usb/dvb-usb/dibusb-mc\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dibusb\.h,drivers/media/usb/dvb-usb/dibusb\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/digitv\.c,drivers/media/usb/dvb-usb/digitv\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/digitv\.h,drivers/media/usb/dvb-usb/digitv\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dtt200u-fe\.c,drivers/media/usb/dvb-usb/dtt200u-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dtt200u\.c,drivers/media/usb/dvb-usb/dtt200u\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dtt200u\.h,drivers/media/usb/dvb-usb/dtt200u\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dtv5100\.c,drivers/media/usb/dvb-usb/dtv5100\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dtv5100\.h,drivers/media/usb/dvb-usb/dtv5100\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-common\.h,drivers/media/usb/dvb-usb/dvb-usb-common\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-dvb\.c,drivers/media/usb/dvb-usb/dvb-usb-dvb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-firmware\.c,drivers/media/usb/dvb-usb/dvb-usb-firmware\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-i2c\.c,drivers/media/usb/dvb-usb/dvb-usb-i2c\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-init\.c,drivers/media/usb/dvb-usb/dvb-usb-init\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-remote\.c,drivers/media/usb/dvb-usb/dvb-usb-remote\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb-urb\.c,drivers/media/usb/dvb-usb/dvb-usb-urb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb-usb\.h,drivers/media/usb/dvb-usb/dvb-usb\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb_usb_dvb\.c,drivers/media/usb/dvb-usb/dvb_usb_dvb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dvb_usb_remote\.c,drivers/media/usb/dvb-usb/dvb_usb_remote\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dw2102\.c,drivers/media/usb/dvb-usb/dw2102\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/dw2102\.h,drivers/media/usb/dvb-usb/dw2102\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/friio-fe\.c,drivers/media/usb/dvb-usb/friio-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/friio\.c,drivers/media/usb/dvb-usb/friio\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/friio\.h,drivers/media/usb/dvb-usb/friio\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/gp8psk-fe\.c,drivers/media/usb/dvb-usb/gp8psk-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/gp8psk\.c,drivers/media/usb/dvb-usb/gp8psk\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/gp8psk\.h,drivers/media/usb/dvb-usb/gp8psk\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/m920x\.c,drivers/media/usb/dvb-usb/m920x\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/m920x\.h,drivers/media/usb/dvb-usb/m920x\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/nova-t-usb2\.c,drivers/media/usb/dvb-usb/nova-t-usb2\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/opera1\.c,drivers/media/usb/dvb-usb/opera1\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/pctv452e\.c,drivers/media/usb/dvb-usb/pctv452e\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/technisat-usb2\.c,drivers/media/usb/dvb-usb/technisat-usb2\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/ttusb2\.c,drivers/media/usb/dvb-usb/ttusb2\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/ttusb2\.h,drivers/media/usb/dvb-usb/ttusb2\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/umt-010\.c,drivers/media/usb/dvb-usb/umt-010\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/usb-urb\.c,drivers/media/usb/dvb-usb/usb-urb\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp702x-fe\.c,drivers/media/usb/dvb-usb/vp702x-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp702x\.c,drivers/media/usb/dvb-usb/vp702x\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp702x\.h,drivers/media/usb/dvb-usb/vp702x\.h,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp7045-fe\.c,drivers/media/usb/dvb-usb/vp7045-fe\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp7045\.c,drivers/media/usb/dvb-usb/vp7045\.c,g' \ + -e 's,drivers/media/dvb/dvb-usb/vp7045\.h,drivers/media/usb/dvb-usb/vp7045\.h,g' \ + -e 's,drivers/media/video/em28xx/Kconfig,drivers/media/usb/em28xx/Kconfig,g' \ + -e 's,drivers/media/video/em28xx/Makefile,drivers/media/usb/em28xx/Makefile,g' \ + -e 's,drivers/media/video/em28xx/em28xx-audio\.c,drivers/media/usb/em28xx/em28xx-audio\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-cards\.c,drivers/media/usb/em28xx/em28xx-cards\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-core\.c,drivers/media/usb/em28xx/em28xx-core\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-dvb\.c,drivers/media/usb/em28xx/em28xx-dvb\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-i2c\.c,drivers/media/usb/em28xx/em28xx-i2c\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-input\.c,drivers/media/usb/em28xx/em28xx-input\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-reg\.h,drivers/media/usb/em28xx/em28xx-reg\.h,g' \ + -e 's,drivers/media/video/em28xx/em28xx-vbi\.c,drivers/media/usb/em28xx/em28xx-vbi\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx-video\.c,drivers/media/usb/em28xx/em28xx-video\.c,g' \ + -e 's,drivers/media/video/em28xx/em28xx\.h,drivers/media/usb/em28xx/em28xx\.h,g' \ + -e 's,drivers/media/video/gspca/Kconfig,drivers/media/usb/gspca/Kconfig,g' \ + -e 's,drivers/media/video/gspca/Makefile,drivers/media/usb/gspca/Makefile,g' \ + -e 's,drivers/media/video/gspca/autogain_functions\.c,drivers/media/usb/gspca/autogain_functions\.c,g' \ + -e 's,drivers/media/video/gspca/autogain_functions\.h,drivers/media/usb/gspca/autogain_functions\.h,g' \ + -e 's,drivers/media/video/gspca/benq\.c,drivers/media/usb/gspca/benq\.c,g' \ + -e 's,drivers/media/video/gspca/conex\.c,drivers/media/usb/gspca/conex\.c,g' \ + -e 's,drivers/media/video/gspca/cpia1\.c,drivers/media/usb/gspca/cpia1\.c,g' \ + -e 's,drivers/media/video/gspca/etoms\.c,drivers/media/usb/gspca/etoms\.c,g' \ + -e 's,drivers/media/video/gspca/finepix\.c,drivers/media/usb/gspca/finepix\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/Kconfig,drivers/media/usb/gspca/gl860/Kconfig,g' \ + -e 's,drivers/media/video/gspca/gl860/Makefile,drivers/media/usb/gspca/gl860/Makefile,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860-mi1320\.c,drivers/media/usb/gspca/gl860/gl860-mi1320\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860-mi2020\.c,drivers/media/usb/gspca/gl860/gl860-mi2020\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860-ov2640\.c,drivers/media/usb/gspca/gl860/gl860-ov2640\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860-ov9655\.c,drivers/media/usb/gspca/gl860/gl860-ov9655\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860\.c,drivers/media/usb/gspca/gl860/gl860\.c,g' \ + -e 's,drivers/media/video/gspca/gl860/gl860\.h,drivers/media/usb/gspca/gl860/gl860\.h,g' \ + -e 's,drivers/media/video/gspca/gspca\.c,drivers/media/usb/gspca/gspca\.c,g' \ + -e 's,drivers/media/video/gspca/gspca\.h,drivers/media/usb/gspca/gspca\.h,g' \ + -e 's,drivers/media/video/gspca/jeilinj\.c,drivers/media/usb/gspca/jeilinj\.c,g' \ + -e 's,drivers/media/video/gspca/jl2005bcd\.c,drivers/media/usb/gspca/jl2005bcd\.c,g' \ + -e 's,drivers/media/video/gspca/jpeg\.h,drivers/media/usb/gspca/jpeg\.h,g' \ + -e 's,drivers/media/video/gspca/kinect\.c,drivers/media/usb/gspca/kinect\.c,g' \ + -e 's,drivers/media/video/gspca/konica\.c,drivers/media/usb/gspca/konica\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/Kconfig,drivers/media/usb/gspca/m5602/Kconfig,g' \ + -e 's,drivers/media/video/gspca/m5602/Makefile,drivers/media/usb/gspca/m5602/Makefile,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_bridge\.h,drivers/media/usb/gspca/m5602/m5602_bridge\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_core\.c,drivers/media/usb/gspca/m5602/m5602_core\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_mt9m111\.c,drivers/media/usb/gspca/m5602/m5602_mt9m111\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_mt9m111\.h,drivers/media/usb/gspca/m5602/m5602_mt9m111\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_ov7660\.c,drivers/media/usb/gspca/m5602/m5602_ov7660\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_ov7660\.h,drivers/media/usb/gspca/m5602/m5602_ov7660\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_ov9650\.c,drivers/media/usb/gspca/m5602/m5602_ov9650\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_ov9650\.h,drivers/media/usb/gspca/m5602/m5602_ov9650\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_po1030\.c,drivers/media/usb/gspca/m5602/m5602_po1030\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_po1030\.h,drivers/media/usb/gspca/m5602/m5602_po1030\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_s5k4aa\.c,drivers/media/usb/gspca/m5602/m5602_s5k4aa\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_s5k4aa\.h,drivers/media/usb/gspca/m5602/m5602_s5k4aa\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_s5k83a\.c,drivers/media/usb/gspca/m5602/m5602_s5k83a\.c,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_s5k83a\.h,drivers/media/usb/gspca/m5602/m5602_s5k83a\.h,g' \ + -e 's,drivers/media/video/gspca/m5602/m5602_sensor\.h,drivers/media/usb/gspca/m5602/m5602_sensor\.h,g' \ + -e 's,drivers/media/video/gspca/mars\.c,drivers/media/usb/gspca/mars\.c,g' \ + -e 's,drivers/media/video/gspca/mr97310a\.c,drivers/media/usb/gspca/mr97310a\.c,g' \ + -e 's,drivers/media/video/gspca/nw80x\.c,drivers/media/usb/gspca/nw80x\.c,g' \ + -e 's,drivers/media/video/gspca/ov519\.c,drivers/media/usb/gspca/ov519\.c,g' \ + -e 's,drivers/media/video/gspca/ov534\.c,drivers/media/usb/gspca/ov534\.c,g' \ + -e 's,drivers/media/video/gspca/ov534_9\.c,drivers/media/usb/gspca/ov534_9\.c,g' \ + -e 's,drivers/media/video/gspca/pac207\.c,drivers/media/usb/gspca/pac207\.c,g' \ + -e 's,drivers/media/video/gspca/pac7302\.c,drivers/media/usb/gspca/pac7302\.c,g' \ + -e 's,drivers/media/video/gspca/pac7311\.c,drivers/media/usb/gspca/pac7311\.c,g' \ + -e 's,drivers/media/video/gspca/pac_common\.h,drivers/media/usb/gspca/pac_common\.h,g' \ + -e 's,drivers/media/video/gspca/se401\.c,drivers/media/usb/gspca/se401\.c,g' \ + -e 's,drivers/media/video/gspca/se401\.h,drivers/media/usb/gspca/se401\.h,g' \ + -e 's,drivers/media/video/gspca/sn9c2028\.c,drivers/media/usb/gspca/sn9c2028\.c,g' \ + -e 's,drivers/media/video/gspca/sn9c2028\.h,drivers/media/usb/gspca/sn9c2028\.h,g' \ + -e 's,drivers/media/video/gspca/sn9c20x\.c,drivers/media/usb/gspca/sn9c20x\.c,g' \ + -e 's,drivers/media/video/gspca/sonixb\.c,drivers/media/usb/gspca/sonixb\.c,g' \ + -e 's,drivers/media/video/gspca/sonixj\.c,drivers/media/usb/gspca/sonixj\.c,g' \ + -e 's,drivers/media/video/gspca/spca1528\.c,drivers/media/usb/gspca/spca1528\.c,g' \ + -e 's,drivers/media/video/gspca/spca500\.c,drivers/media/usb/gspca/spca500\.c,g' \ + -e 's,drivers/media/video/gspca/spca501\.c,drivers/media/usb/gspca/spca501\.c,g' \ + -e 's,drivers/media/video/gspca/spca505\.c,drivers/media/usb/gspca/spca505\.c,g' \ + -e 's,drivers/media/video/gspca/spca506\.c,drivers/media/usb/gspca/spca506\.c,g' \ + -e 's,drivers/media/video/gspca/spca508\.c,drivers/media/usb/gspca/spca508\.c,g' \ + -e 's,drivers/media/video/gspca/spca561\.c,drivers/media/usb/gspca/spca561\.c,g' \ + -e 's,drivers/media/video/gspca/sq905\.c,drivers/media/usb/gspca/sq905\.c,g' \ + -e 's,drivers/media/video/gspca/sq905c\.c,drivers/media/usb/gspca/sq905c\.c,g' \ + -e 's,drivers/media/video/gspca/sq930x\.c,drivers/media/usb/gspca/sq930x\.c,g' \ + -e 's,drivers/media/video/gspca/stk014\.c,drivers/media/usb/gspca/stk014\.c,g' \ + -e 's,drivers/media/video/gspca/stv0680\.c,drivers/media/usb/gspca/stv0680\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/Kconfig,drivers/media/usb/gspca/stv06xx/Kconfig,g' \ + -e 's,drivers/media/video/gspca/stv06xx/Makefile,drivers/media/usb/gspca/stv06xx/Makefile,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx\.c,drivers/media/usb/gspca/stv06xx/stv06xx\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx\.h,drivers/media/usb/gspca/stv06xx/stv06xx\.h,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_hdcs\.c,drivers/media/usb/gspca/stv06xx/stv06xx_hdcs\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_hdcs\.h,drivers/media/usb/gspca/stv06xx/stv06xx_hdcs\.h,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_pb0100\.c,drivers/media/usb/gspca/stv06xx/stv06xx_pb0100\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_pb0100\.h,drivers/media/usb/gspca/stv06xx/stv06xx_pb0100\.h,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_sensor\.h,drivers/media/usb/gspca/stv06xx/stv06xx_sensor\.h,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_st6422\.c,drivers/media/usb/gspca/stv06xx/stv06xx_st6422\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_st6422\.h,drivers/media/usb/gspca/stv06xx/stv06xx_st6422\.h,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_vv6410\.c,drivers/media/usb/gspca/stv06xx/stv06xx_vv6410\.c,g' \ + -e 's,drivers/media/video/gspca/stv06xx/stv06xx_vv6410\.h,drivers/media/usb/gspca/stv06xx/stv06xx_vv6410\.h,g' \ + -e 's,drivers/media/video/gspca/sunplus\.c,drivers/media/usb/gspca/sunplus\.c,g' \ + -e 's,drivers/media/video/gspca/t613\.c,drivers/media/usb/gspca/t613\.c,g' \ + -e 's,drivers/media/video/gspca/topro\.c,drivers/media/usb/gspca/topro\.c,g' \ + -e 's,drivers/media/video/gspca/tv8532\.c,drivers/media/usb/gspca/tv8532\.c,g' \ + -e 's,drivers/media/video/gspca/vc032x\.c,drivers/media/usb/gspca/vc032x\.c,g' \ + -e 's,drivers/media/video/gspca/vicam\.c,drivers/media/usb/gspca/vicam\.c,g' \ + -e 's,drivers/media/video/gspca/w996Xcf\.c,drivers/media/usb/gspca/w996Xcf\.c,g' \ + -e 's,drivers/media/video/gspca/xirlink_cit\.c,drivers/media/usb/gspca/xirlink_cit\.c,g' \ + -e 's,drivers/media/video/gspca/zc3xx-reg\.h,drivers/media/usb/gspca/zc3xx-reg\.h,g' \ + -e 's,drivers/media/video/gspca/zc3xx\.c,drivers/media/usb/gspca/zc3xx\.c,g' \ + -e 's,drivers/media/video/hdpvr/Kconfig,drivers/media/usb/hdpvr/Kconfig,g' \ + -e 's,drivers/media/video/hdpvr/Makefile,drivers/media/usb/hdpvr/Makefile,g' \ + -e 's,drivers/media/video/hdpvr/hdpvr-control\.c,drivers/media/usb/hdpvr/hdpvr-control\.c,g' \ + -e 's,drivers/media/video/hdpvr/hdpvr-core\.c,drivers/media/usb/hdpvr/hdpvr-core\.c,g' \ + -e 's,drivers/media/video/hdpvr/hdpvr-i2c\.c,drivers/media/usb/hdpvr/hdpvr-i2c\.c,g' \ + -e 's,drivers/media/video/hdpvr/hdpvr-video\.c,drivers/media/usb/hdpvr/hdpvr-video\.c,g' \ + -e 's,drivers/media/video/hdpvr/hdpvr\.h,drivers/media/usb/hdpvr/hdpvr\.h,g' \ + -e 's,drivers/media/video/pvrusb2/Kconfig,drivers/media/usb/pvrusb2/Kconfig,g' \ + -e 's,drivers/media/video/pvrusb2/Makefile,drivers/media/usb/pvrusb2/Makefile,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-audio\.c,drivers/media/usb/pvrusb2/pvrusb2-audio\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-audio\.h,drivers/media/usb/pvrusb2/pvrusb2-audio\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-context\.c,drivers/media/usb/pvrusb2/pvrusb2-context\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-context\.h,drivers/media/usb/pvrusb2/pvrusb2-context\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-cs53l32a\.c,drivers/media/usb/pvrusb2/pvrusb2-cs53l32a\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-cs53l32a\.h,drivers/media/usb/pvrusb2/pvrusb2-cs53l32a\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-ctrl\.c,drivers/media/usb/pvrusb2/pvrusb2-ctrl\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-ctrl\.h,drivers/media/usb/pvrusb2/pvrusb2-ctrl\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l\.c,drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l\.h,drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-debug\.h,drivers/media/usb/pvrusb2/pvrusb2-debug\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-debugifc\.c,drivers/media/usb/pvrusb2/pvrusb2-debugifc\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-debugifc\.h,drivers/media/usb/pvrusb2/pvrusb2-debugifc\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-devattr\.c,drivers/media/usb/pvrusb2/pvrusb2-devattr\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-devattr\.h,drivers/media/usb/pvrusb2/pvrusb2-devattr\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-dvb\.c,drivers/media/usb/pvrusb2/pvrusb2-dvb\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-dvb\.h,drivers/media/usb/pvrusb2/pvrusb2-dvb\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-eeprom\.c,drivers/media/usb/pvrusb2/pvrusb2-eeprom\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-eeprom\.h,drivers/media/usb/pvrusb2/pvrusb2-eeprom\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-encoder\.c,drivers/media/usb/pvrusb2/pvrusb2-encoder\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-encoder\.h,drivers/media/usb/pvrusb2/pvrusb2-encoder\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-fx2-cmd\.h,drivers/media/usb/pvrusb2/pvrusb2-fx2-cmd\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw-internal\.h,drivers/media/usb/pvrusb2/pvrusb2-hdw-internal\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw\.c,drivers/media/usb/pvrusb2/pvrusb2-hdw\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-hdw\.h,drivers/media/usb/pvrusb2/pvrusb2-hdw\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-i2c-core\.c,drivers/media/usb/pvrusb2/pvrusb2-i2c-core\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-i2c-core\.h,drivers/media/usb/pvrusb2/pvrusb2-i2c-core\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-io\.c,drivers/media/usb/pvrusb2/pvrusb2-io\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-io\.h,drivers/media/usb/pvrusb2/pvrusb2-io\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-ioread\.c,drivers/media/usb/pvrusb2/pvrusb2-ioread\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-ioread\.h,drivers/media/usb/pvrusb2/pvrusb2-ioread\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-main\.c,drivers/media/usb/pvrusb2/pvrusb2-main\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-std\.c,drivers/media/usb/pvrusb2/pvrusb2-std\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-std\.h,drivers/media/usb/pvrusb2/pvrusb2-std\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-sysfs\.c,drivers/media/usb/pvrusb2/pvrusb2-sysfs\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-sysfs\.h,drivers/media/usb/pvrusb2/pvrusb2-sysfs\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-util\.h,drivers/media/usb/pvrusb2/pvrusb2-util\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-v4l2\.c,drivers/media/usb/pvrusb2/pvrusb2-v4l2\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-v4l2\.h,drivers/media/usb/pvrusb2/pvrusb2-v4l2\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-video-v4l\.c,drivers/media/usb/pvrusb2/pvrusb2-video-v4l\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-video-v4l\.h,drivers/media/usb/pvrusb2/pvrusb2-video-v4l\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-wm8775\.c,drivers/media/usb/pvrusb2/pvrusb2-wm8775\.c,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2-wm8775\.h,drivers/media/usb/pvrusb2/pvrusb2-wm8775\.h,g' \ + -e 's,drivers/media/video/pvrusb2/pvrusb2\.h,drivers/media/usb/pvrusb2/pvrusb2\.h,g' \ + -e 's,drivers/media/video/pwc/Kconfig,drivers/media/usb/pwc/Kconfig,g' \ + -e 's,drivers/media/video/pwc/Makefile,drivers/media/usb/pwc/Makefile,g' \ + -e 's,drivers/media/video/pwc/philips\.txt,drivers/media/usb/pwc/philips\.txt,g' \ + -e 's,drivers/media/video/pwc/pwc-ctrl\.c,drivers/media/usb/pwc/pwc-ctrl\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-dec1\.c,drivers/media/usb/pwc/pwc-dec1\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-dec1\.h,drivers/media/usb/pwc/pwc-dec1\.h,g' \ + -e 's,drivers/media/video/pwc/pwc-dec23\.c,drivers/media/usb/pwc/pwc-dec23\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-dec23\.h,drivers/media/usb/pwc/pwc-dec23\.h,g' \ + -e 's,drivers/media/video/pwc/pwc-if\.c,drivers/media/usb/pwc/pwc-if\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-kiara\.c,drivers/media/usb/pwc/pwc-kiara\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-kiara\.h,drivers/media/usb/pwc/pwc-kiara\.h,g' \ + -e 's,drivers/media/video/pwc/pwc-misc\.c,drivers/media/usb/pwc/pwc-misc\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-nala\.h,drivers/media/usb/pwc/pwc-nala\.h,g' \ + -e 's,drivers/media/video/pwc/pwc-timon\.c,drivers/media/usb/pwc/pwc-timon\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-timon\.h,drivers/media/usb/pwc/pwc-timon\.h,g' \ + -e 's,drivers/media/video/pwc/pwc-uncompress\.c,drivers/media/usb/pwc/pwc-uncompress\.c,g' \ + -e 's,drivers/media/video/pwc/pwc-v4l\.c,drivers/media/usb/pwc/pwc-v4l\.c,g' \ + -e 's,drivers/media/video/pwc/pwc\.h,drivers/media/usb/pwc/pwc\.h,g' \ + -e 's,drivers/media/video/s2255drv\.c,drivers/media/usb/s2255/s2255drv\.c,g' \ + -e 's,drivers/media/dvb/siano/smsusb\.c,drivers/media/usb/siano/smsusb\.c,g' \ + -e 's,drivers/media/video/sn9c102/Kconfig,drivers/media/usb/sn9c102/Kconfig,g' \ + -e 's,drivers/media/video/sn9c102/Makefile,drivers/media/usb/sn9c102/Makefile,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102\.h,drivers/media/usb/sn9c102/sn9c102\.h,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_config\.h,drivers/media/usb/sn9c102/sn9c102_config\.h,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_core\.c,drivers/media/usb/sn9c102/sn9c102_core\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_devtable\.h,drivers/media/usb/sn9c102/sn9c102_devtable\.h,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_hv7131d\.c,drivers/media/usb/sn9c102/sn9c102_hv7131d\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_hv7131r\.c,drivers/media/usb/sn9c102/sn9c102_hv7131r\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_mi0343\.c,drivers/media/usb/sn9c102/sn9c102_mi0343\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_mi0360\.c,drivers/media/usb/sn9c102/sn9c102_mi0360\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_mt9v111\.c,drivers/media/usb/sn9c102/sn9c102_mt9v111\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_ov7630\.c,drivers/media/usb/sn9c102/sn9c102_ov7630\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_ov7660\.c,drivers/media/usb/sn9c102/sn9c102_ov7660\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_pas106b\.c,drivers/media/usb/sn9c102/sn9c102_pas106b\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_pas202bcb\.c,drivers/media/usb/sn9c102/sn9c102_pas202bcb\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_sensor\.h,drivers/media/usb/sn9c102/sn9c102_sensor\.h,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_tas5110c1b\.c,drivers/media/usb/sn9c102/sn9c102_tas5110c1b\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_tas5110d\.c,drivers/media/usb/sn9c102/sn9c102_tas5110d\.c,g' \ + -e 's,drivers/media/video/sn9c102/sn9c102_tas5130d1b\.c,drivers/media/usb/sn9c102/sn9c102_tas5130d1b\.c,g' \ + -e 's,drivers/media/video/stk1160/Kconfig,drivers/media/usb/stk1160/Kconfig,g' \ + -e 's,drivers/media/video/stk1160/Makefile,drivers/media/usb/stk1160/Makefile,g' \ + -e 's,drivers/media/video/stk1160/stk1160-ac97\.c,drivers/media/usb/stk1160/stk1160-ac97\.c,g' \ + -e 's,drivers/media/video/stk1160/stk1160-core\.c,drivers/media/usb/stk1160/stk1160-core\.c,g' \ + -e 's,drivers/media/video/stk1160/stk1160-i2c\.c,drivers/media/usb/stk1160/stk1160-i2c\.c,g' \ + -e 's,drivers/media/video/stk1160/stk1160-reg\.h,drivers/media/usb/stk1160/stk1160-reg\.h,g' \ + -e 's,drivers/media/video/stk1160/stk1160-v4l\.c,drivers/media/usb/stk1160/stk1160-v4l\.c,g' \ + -e 's,drivers/media/video/stk1160/stk1160-video\.c,drivers/media/usb/stk1160/stk1160-video\.c,g' \ + -e 's,drivers/media/video/stk1160/stk1160\.h,drivers/media/usb/stk1160/stk1160\.h,g' \ + -e 's,drivers/media/video/stk-sensor\.c,drivers/media/usb/stkwebcam/stk-sensor\.c,g' \ + -e 's,drivers/media/video/stk-webcam\.c,drivers/media/usb/stkwebcam/stk-webcam\.c,g' \ + -e 's,drivers/media/video/stk-webcam\.h,drivers/media/usb/stkwebcam/stk-webcam\.h,g' \ + -e 's,drivers/media/video/tlg2300/Kconfig,drivers/media/usb/tlg2300/Kconfig,g' \ + -e 's,drivers/media/video/tlg2300/Makefile,drivers/media/usb/tlg2300/Makefile,g' \ + -e 's,drivers/media/video/tlg2300/pd-alsa\.c,drivers/media/usb/tlg2300/pd-alsa\.c,g' \ + -e 's,drivers/media/video/tlg2300/pd-common\.h,drivers/media/usb/tlg2300/pd-common\.h,g' \ + -e 's,drivers/media/video/tlg2300/pd-dvb\.c,drivers/media/usb/tlg2300/pd-dvb\.c,g' \ + -e 's,drivers/media/video/tlg2300/pd-main\.c,drivers/media/usb/tlg2300/pd-main\.c,g' \ + -e 's,drivers/media/video/tlg2300/pd-radio\.c,drivers/media/usb/tlg2300/pd-radio\.c,g' \ + -e 's,drivers/media/video/tlg2300/pd-video\.c,drivers/media/usb/tlg2300/pd-video\.c,g' \ + -e 's,drivers/media/video/tlg2300/vendorcmds\.h,drivers/media/usb/tlg2300/vendorcmds\.h,g' \ + -e 's,drivers/media/video/tm6000/Kconfig,drivers/media/usb/tm6000/Kconfig,g' \ + -e 's,drivers/media/video/tm6000/Makefile,drivers/media/usb/tm6000/Makefile,g' \ + -e 's,drivers/media/video/tm6000/tm6000-alsa\.c,drivers/media/usb/tm6000/tm6000-alsa\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-cards\.c,drivers/media/usb/tm6000/tm6000-cards\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-core\.c,drivers/media/usb/tm6000/tm6000-core\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-dvb\.c,drivers/media/usb/tm6000/tm6000-dvb\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-i2c\.c,drivers/media/usb/tm6000/tm6000-i2c\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-input\.c,drivers/media/usb/tm6000/tm6000-input\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-regs\.h,drivers/media/usb/tm6000/tm6000-regs\.h,g' \ + -e 's,drivers/media/video/tm6000/tm6000-stds\.c,drivers/media/usb/tm6000/tm6000-stds\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000-usb-isoc\.h,drivers/media/usb/tm6000/tm6000-usb-isoc\.h,g' \ + -e 's,drivers/media/video/tm6000/tm6000-video\.c,drivers/media/usb/tm6000/tm6000-video\.c,g' \ + -e 's,drivers/media/video/tm6000/tm6000\.h,drivers/media/usb/tm6000/tm6000\.h,g' \ + -e 's,drivers/media/dvb/ttusb-budget/Kconfig,drivers/media/usb/ttusb-budget/Kconfig,g' \ + -e 's,drivers/media/dvb/ttusb-budget/Makefile,drivers/media/usb/ttusb-budget/Makefile,g' \ + -e 's,drivers/media/dvb/ttusb-budget/dvb-ttusb-budget\.c,drivers/media/usb/ttusb-budget/dvb-ttusb-budget\.c,g' \ + -e 's,drivers/media/dvb/ttusb-dec/Kconfig,drivers/media/usb/ttusb-dec/Kconfig,g' \ + -e 's,drivers/media/dvb/ttusb-dec/Makefile,drivers/media/usb/ttusb-dec/Makefile,g' \ + -e 's,drivers/media/dvb/ttusb-dec/ttusb_dec\.c,drivers/media/usb/ttusb-dec/ttusb_dec\.c,g' \ + -e 's,drivers/media/dvb/ttusb-dec/ttusbdecfe\.c,drivers/media/usb/ttusb-dec/ttusbdecfe\.c,g' \ + -e 's,drivers/media/dvb/ttusb-dec/ttusbdecfe\.h,drivers/media/usb/ttusb-dec/ttusbdecfe\.h,g' \ + -e 's,drivers/media/video/usbvision/Kconfig,drivers/media/usb/usbvision/Kconfig,g' \ + -e 's,drivers/media/video/usbvision/Makefile,drivers/media/usb/usbvision/Makefile,g' \ + -e 's,drivers/media/video/usbvision/usbvision-cards\.c,drivers/media/usb/usbvision/usbvision-cards\.c,g' \ + -e 's,drivers/media/video/usbvision/usbvision-cards\.h,drivers/media/usb/usbvision/usbvision-cards\.h,g' \ + -e 's,drivers/media/video/usbvision/usbvision-core\.c,drivers/media/usb/usbvision/usbvision-core\.c,g' \ + -e 's,drivers/media/video/usbvision/usbvision-i2c\.c,drivers/media/usb/usbvision/usbvision-i2c\.c,g' \ + -e 's,drivers/media/video/usbvision/usbvision-video\.c,drivers/media/usb/usbvision/usbvision-video\.c,g' \ + -e 's,drivers/media/video/usbvision/usbvision\.h,drivers/media/usb/usbvision/usbvision\.h,g' \ + -e 's,drivers/media/video/uvc/Kconfig,drivers/media/usb/uvc/Kconfig,g' \ + -e 's,drivers/media/video/uvc/Makefile,drivers/media/usb/uvc/Makefile,g' \ + -e 's,drivers/media/video/uvc/uvc_ctrl\.c,drivers/media/usb/uvc/uvc_ctrl\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_debugfs\.c,drivers/media/usb/uvc/uvc_debugfs\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_driver\.c,drivers/media/usb/uvc/uvc_driver\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_entity\.c,drivers/media/usb/uvc/uvc_entity\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_isight\.c,drivers/media/usb/uvc/uvc_isight\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_queue\.c,drivers/media/usb/uvc/uvc_queue\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_status\.c,drivers/media/usb/uvc/uvc_status\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_v4l2\.c,drivers/media/usb/uvc/uvc_v4l2\.c,g' \ + -e 's,drivers/media/video/uvc/uvc_video\.c,drivers/media/usb/uvc/uvc_video\.c,g' \ + -e 's,drivers/media/video/uvc/uvcvideo\.h,drivers/media/usb/uvc/uvcvideo\.h,g' \ + -e 's,drivers/media/video/zr364xx\.c,drivers/media/usb/zr364xx/zr364xx\.c,g' \ + -e 's,drivers/media/video/tuner-core\.c,drivers/media/v4l2-core/tuner-core\.c,g' \ + -e 's,drivers/media/video/v4l2-common\.c,drivers/media/v4l2-core/v4l2-common\.c,g' \ + -e 's,drivers/media/video/v4l2-compat-ioctl32\.c,drivers/media/v4l2-core/v4l2-compat-ioctl32\.c,g' \ + -e 's,drivers/media/video/v4l2-ctrls\.c,drivers/media/v4l2-core/v4l2-ctrls\.c,g' \ + -e 's,drivers/media/video/v4l2-dev\.c,drivers/media/v4l2-core/v4l2-dev\.c,g' \ + -e 's,drivers/media/video/v4l2-device\.c,drivers/media/v4l2-core/v4l2-device\.c,g' \ + -e 's,drivers/media/video/v4l2-event\.c,drivers/media/v4l2-core/v4l2-event\.c,g' \ + -e 's,drivers/media/video/v4l2-fh\.c,drivers/media/v4l2-core/v4l2-fh\.c,g' \ + -e 's,drivers/media/video/v4l2-int-device\.c,drivers/media/v4l2-core/v4l2-int-device\.c,g' \ + -e 's,drivers/media/video/v4l2-ioctl\.c,drivers/media/v4l2-core/v4l2-ioctl\.c,g' \ + -e 's,drivers/media/video/v4l2-mem2mem\.c,drivers/media/v4l2-core/v4l2-mem2mem\.c,g' \ + -e 's,drivers/media/video/v4l2-subdev\.c,drivers/media/v4l2-core/v4l2-subdev\.c,g' \ + -e 's,drivers/media/video/videobuf-core\.c,drivers/media/v4l2-core/videobuf-core\.c,g' \ + -e 's,drivers/media/video/videobuf-dma-contig\.c,drivers/media/v4l2-core/videobuf-dma-contig\.c,g' \ + -e 's,drivers/media/video/videobuf-dma-sg\.c,drivers/media/v4l2-core/videobuf-dma-sg\.c,g' \ + -e 's,drivers/media/video/videobuf-dvb\.c,drivers/media/v4l2-core/videobuf-dvb\.c,g' \ + -e 's,drivers/media/video/videobuf-vmalloc\.c,drivers/media/v4l2-core/videobuf-vmalloc\.c,g' \ + -e 's,drivers/media/video/videobuf2-core\.c,drivers/media/v4l2-core/videobuf2-core\.c,g' \ + -e 's,drivers/media/video/videobuf2-dma-contig\.c,drivers/media/v4l2-core/videobuf2-dma-contig\.c,g' \ + -e 's,drivers/media/video/videobuf2-dma-sg\.c,drivers/media/v4l2-core/videobuf2-dma-sg\.c,g' \ + -e 's,drivers/media/video/videobuf2-memops\.c,drivers/media/v4l2-core/videobuf2-memops\.c,g' \ + -e 's,drivers/media/video/videobuf2-vmalloc\.c,drivers/media/v4l2-core/videobuf2-vmalloc\.c,g' \ + >$1 && \ +echo -e "old patch stored as "$OLD"\n$1 rewrote." diff -Nru media-build-dkms-0004~trusty/media-build-0005/dkms.conf media-build-dkms-0005~trusty/media-build-0005/dkms.conf --- media-build-dkms-0004~trusty/media-build-0005/dkms.conf 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/dkms.conf 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,63 @@ +PACKAGE_NAME=media-build + +# Source the media_build DKMS version definition +conf_dir=$(dirname ${BASH_SOURCE[0]}) +. ${conf_dir}/dkms_ver.conf + +[ -n "$module" ] || module=${PACKAGE_NAME} +[ -n "$module_version" ] || module_version=${PACKAGE_VERSION} + +# The base for the module +local dkms_dir="$dkms_tree/$module/$module_version" + +# This is where DKMS stores all of it's data (after the MAKE[0] step!). +local base_dir="$dkms_dir/$kernelver/$arch" + +# We need an existing path during the build step to create the install +# directory, because media build will also install all the modules. The +# install directory will be cleaned just after the POST_BUILD step, so +# this directory is existing very short on the file system. +local media_inst_dir="$dkms_dir/build/_media_inst" + +# The dynamically generated DKMS configuration file name. This gets sourced by +# the top DKMS configuration file (this file), if it exists (see end of this +# script). It defines all the built modules depending on the kernel version or +# configuration options of medial_build. +# +# This dynamically generated DKMS configuration file is generated by a post +# build command script (gen_dkms_dyn_conf.sh). +# +# It is important, that it exists when the DKMS install command is executed. +local dkms_dyn_conf="$base_dir/dkms_dyn.conf" + +# The module directory, where DKMS stores the built modules after the build. +local dkms_mod_dir="$base_dir/module" + +AUTOINSTALL=y + +# The DKMS system will add KERNELRELEASE to the make command line +MAKE[0]="make MEDIA_INST_DIR=$media_inst_dir -f Makefile.dkms build" +CLEAN="make MEDIA_INST_DIR=$media_inst_dir -f Makefile.dkms clean" +POST_BUILD="gen_dkms_dyn_conf.sh $dkms_mod_dir $media_inst_dir $dkms_dyn_conf" +#POST_INSTALL="handle_updated_modules.sh $base_dir $kernelver $arch install" +CHECK_MODULE_VERSION=n + +# There have to be at least one module defined in the top DKMS configuration +# file, otherwise DKMS throws an error. +# Note: This definition gets overridden later by the dynamically generated +# DKMS configuration file. +# +BUILT_MODULE_NAME[0]=dvb-core +# +# We use here the real build location, because the file needs to exist to +# finish the build step. +BUILT_MODULE_LOCATION[0]=./v4l +# +# It is important to use the real module path here, so that the uninstall +# command works correctly +DEST_MODULE_LOCATION[0]=/kernel/drivers/media/dvb-core + +# Source the dynamically generated DKMS configuration file. +if [ -e $dkms_dyn_conf ]; then + . $dkms_dyn_conf +fi diff -Nru media-build-dkms-0004~trusty/media-build-0005/dkms_updated_modules.conf media-build-dkms-0005~trusty/media-build-0005/dkms_updated_modules.conf --- media-build-dkms-0004~trusty/media-build-0005/dkms_updated_modules.conf 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/dkms_updated_modules.conf 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,22 @@ +# +# List of modules to be removed after DKMS install. +# +# It is intended to list here modules, which may installed in the original +# Kernel tree, but should no longer be there because they are exchanged by +# other modules or no longer supported. +# +REMOVE_MODULE_NAME[0]=lirc_sasem +REMOVE_MODULE_LOCATION[0]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[1]=lirc_parallel +REMOVE_MODULE_LOCATION[1]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[2]=lirc_igorplugusb +REMOVE_MODULE_LOCATION[2]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[3]=lirc_bt829 +REMOVE_MODULE_LOCATION[3]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[4]=lirc_imon +REMOVE_MODULE_LOCATION[4]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[5]=lirc_sir +REMOVE_MODULE_LOCATION[5]=/kernel/drivers/staging/media/lirc +REMOVE_MODULE_NAME[6]=lirc_serial +REMOVE_MODULE_LOCATION[6]=/kernel/drivers/staging/media/lirc + diff -Nru media-build-dkms-0004~trusty/media-build-0005/dkms_ver.conf media-build-dkms-0005~trusty/media-build-0005/dkms_ver.conf --- media-build-dkms-0004~trusty/media-build-0005/dkms_ver.conf 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/dkms_ver.conf 2018-06-01 10:19:56.000000000 +0000 @@ -0,0 +1 @@ +PACKAGE_VERSION=0005 diff -Nru media-build-dkms-0004~trusty/media-build-0005/gen_dkms_dyn_conf.sh media-build-dkms-0005~trusty/media-build-0005/gen_dkms_dyn_conf.sh --- media-build-dkms-0004~trusty/media-build-0005/gen_dkms_dyn_conf.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/gen_dkms_dyn_conf.sh 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,150 @@ +#!/bin/bash + +# base for the final installation in "/lib/modules/..." (might be changed +# for different distributions) +# Note: DKMS handles most if the distribution specific part already! +mod_dest_loc_base="/kernel" + +# base where media build does install all the modules (defined by media +# build scripts; do not change!) +mod_build_loc_base='/kernel' + +# Valid dummy to be used for the build location (not used by DKMS) +mod_dir='./v4l' + +mod_pattern='*.ko' + + +err_ok=0 +err_usage=1 +err_dir_not_found=2 +err_default=10 + +# Index 0 is the dvb-core.ko module defined in the top DKMS +# configuration file. We override this default by the dynamically +# generated DKMS configuration. +mod_idx=0 + +module_copy_script_name="mod_copy.sh" +module_copy_script="${module_copy_script_name}" + +mod_build_loc="" + +function exit_print { + if [ -z "${2}" ] ; then + code=${err_default} + else + code=${2} + fi + + echo "${1}" + exit ${code} +} + +function err_exit { + exit_print "Error: ${1}" ${2} +} + +function usage { + echo "Usage: $0 [--help]" + echo " : directory where the modules are stored by" + echo " DKMS after the build step." + echo " : directory where the media build has installed all" + echo " the modules with their right location" + echo " : filename of the dynamic part of the DKMS config" + echo " file generated by this script." + echo " Options:" + echo " --help: This text" + exit_print "" ${err_usage} +} + +# Note: This function gets executed in a sub-shell (pipe in find_modules), +# so it is not possible to use mod_idx later! +function found_module { + mod_name=$(basename -s .ko ${1}) + mod_build_dir=$(dirname ${1}) + if [[ ${mod_build_dir} =~ (.*)${mod_build_loc_base}(.*) ]] ; then + mod_dest_location="${mod_dest_loc_base}${BASH_REMATCH[2]}" + echo "BUILT_MODULE_NAME[${mod_idx}]=${mod_name}" >> ${dkms_dyn_conf} + echo "BUILT_MODULE_LOCATION[${mod_idx}]=${mod_dir}" >> ${dkms_dyn_conf} + echo "DEST_MODULE_LOCATION[${mod_idx}]=${mod_dest_location}" >> ${dkms_dyn_conf} + + echo "cp -af ${mod_build_dir}/${mod_name}.ko ${module_dir}/${mod_name}.ko" >> ${module_copy_script} + + mod_idx=$((mod_idx + 1)) + fi +} + +function find_modules { + find ${mod_build_loc} -name ${mod_pattern} | while read file; do found_module "$file"; done +} + +function arg_check_help { + if [ "${1}" = "--help" ] ; then + usage + fi +} + +# main + +if [ $# -lt 3 ] ; then + usage +fi + +arg_check_help "${1}" + +module_dir="${1}" +shift + +arg_check_help "${1}" + +media_inst_dir="${1}" +shift + +arg_check_help "${1}" + +dkms_dyn_conf="${1}" +shift + +# First check, if the target module directory to store also the dynamically +# generated files, does already exist +if [ ! -d ${module_dir} ] ; then + err_exit "Target module directory ${module_dir} doesn't exist!" ${err_dir_not_found} +fi + +# Check if the media build has been installed the new modules +if [ ! -d ${media_inst_dir} -a -f "${media_inst_dir}/DKMS_INST" ] ; then + err_exit "Installed media build modules not found in ${media_inst_dir}!" ${err_dir_not_found} +fi + +# Now check, if the directory of the generated file +# does already exist +dkms_dyn_conf_dir=$(dirname ${dkms_dyn_conf}) +if [ ! -d ${dkms_dyn_conf_dir} ] ; then + err_exit "Target directory for dynamic DKMS config doesn't exist!" ${err_dir_not_found} +fi + +module_copy_script="${dkms_dyn_conf_dir}/${module_copy_script_name}" +mod_build_loc="${media_inst_dir}" + +# we generate it always new +rm -f ${dkms_dyn_conf} +echo "#" > ${dkms_dyn_conf} +echo "# Generated by $(basename ${0})" >> ${dkms_dyn_conf} +echo "# at $(date -R)" >> ${dkms_dyn_conf} +echo "#" >> ${dkms_dyn_conf} + +rm -f ${module_copy_script} +echo "#!/bin/bash" > ${module_copy_script} +echo "#" >> ${module_copy_script} +echo "# Generated by $(basename ${0})" >> ${module_copy_script} +echo "# at $(date -R)" >> ${module_copy_script} +echo "#" >> ${module_copy_script} + +find_modules + +# copy the generated modules +source ${module_copy_script} + +exit_print "Done!" ${err_ok} + diff -Nru media-build-dkms-0004~trusty/media-build-0005/handle_updated_modules.sh media-build-dkms-0005~trusty/media-build-0005/handle_updated_modules.sh --- media-build-dkms-0004~trusty/media-build-0005/handle_updated_modules.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/handle_updated_modules.sh 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,267 @@ +#!/bin/bash + +# base for the final installation in "/lib/modules/..." (might be changed +# for different distributions) +# Note: DKMS handles most if the distribution specific part already! +mod_dest_loc_base="/kernel" + +upd_mod_conf_name='dkms_updated_modules.conf' +mod_pattern='*.ko' +module_suffix='.ko' +install_tree="/lib/modules" + + +err_ok=0 +err_usage=1 +err_dir_not_found=2 +err_tmp_failed=3 +err_read_config=4 +err_kernel_tree=5 +err_action=6 +err_default=20 + +modules_removed="" + +readonly update_conf_variables="REMOVE_MODULE_NAME REMOVE_MODULE_LOCATION" + +function exit_print { + if [ -z "${2}" ] ; then + code=${err_default} + else + code=${2} + fi + + echo "${1}" + exit ${code} +} + +function err_exit { + exit_print "Error: ${1}" ${2} +} + +function usage { + echo "Usage: $0 [--help]" + echo " : directory where the DKMS stores the build information" + echo " (there are the 'module' and 'log' directories)." + echo " : kernel version as used by DKMS" + echo " : architecture as used by DKMS" + echo " : install or uninstall" + echo " Options:" + echo " --help: This text" + exit_print "" ${err_usage} +} + +function arg_check_help { + if [ "${1}" = "--help" ] ; then + usage + fi +} + +mktemp_or_die() { + local t + t=$(mktemp "$@") && echo "$t" && return + [[ $* = *-d* ]] && err_exit "Unable to make temporary directory" ${err_tmp_failed} + err_exit "Unable to make temporary file." ${err_tmp_failed} +} + +# copied from dkms shell script +function safe_source { + # $1 = file to source + # $@ = environment variables to echo out + local to_source_file="$1"; shift + declare -a -r export_envs=("$@") + local tmpfile=$(mktemp_or_die) + ( exec >"$tmpfile" + . "$to_source_file" >/dev/null + # This is really ugly, but a neat hack + # Remember, in bash 2.0 and greater all variables are really arrays. + for _export_env in "${export_envs[@]}"; do + for _i in $(eval echo \${!$_export_env[@]}); do + eval echo '$_export_env[$_i]=\"${'$_export_env'[$_i]}\"' + done + done + ) + . "$tmpfile" + rm "$tmpfile" +} + +function read_config_file { + local return_value=0 + + # Clear variables and arrays + for var in ${update_conf_variables}; do + unset $var + done + + # Source in the configuration file + safe_source "${upd_mod_conf}" ${update_conf_variables} + + # Set module naming/location arrays + local index array_size=0 s + for s in ${#REMOVE_MODULE_NAME[@]} \ + ${#REMOVE_MODULE_LOCATION[@]}; do + ((s > array_size)) && array_size=$s + done + for ((index=0; index < array_size; index++)); do + # Set values + remove_module_name[$index]=${REMOVE_MODULE_NAME[$index]} + remove_module_location[$index]=${REMOVE_MODULE_LOCATION[$index]} + + # FAIL if no remove_module_name + if [[ ! ${remove_module_name[$index]} ]]; then + echo "$(basename ${upd_mod_conf}): Error! No 'REMOVE_MODULE_NAME' directive specified for record #$index." + return_value=1 + fi + if [[ ! ${REMOVE_MODULE_LOCATION[$index]} ]]; then + echo "$(basename ${upd_mod_conf}): Error! No 'REMOVE_MODULE_LOCATION' directive specified for record #$index." + return_value=1 + fi + done + + # Fail if absolutely no REMOVE_MODULE_NAME + if ((${#remove_module_name[@]} == 0)); then + echo "upd_mod_conf: Error! No 'REMOVE_MODULE_NAME' directive specified." + return_value=1 + fi + + # Fail if absolutely no REMOVE_MODULE_LOCATION + if ((${#remove_module_location[@]} == 0)); then + echo "upd_mod_conf: Error! No 'REMOVE_MODULE_LOCATION' directive specified." + return_value=1 + fi + + return $return_value +} + +function read_config_file_or_die { + read_config_file "$@" && return + + err_exit "Bad conf file (${1})." ${err_read_config} +} + +function remove_modules { + local kernel_tree="${install_tree}/${kernelver}" + local dkms_original="${dkms_base_dir}/original_module" + + [[ -e ${kernel_tree} ]] || err_exit "Kernel tree ${kernel_tree} doesn't exist." ${err_kernel_tree} + + for ((count=0; count < ${#remove_module_name[@]}; count++)); do + local kernel_mod=${kernel_tree}${remove_module_location[$count]}/${remove_module_name[$count]}${module_suffix} + local dkms_orig=${dkms_original}/${remove_module_name[$count]}${module_suffix} + + echo "" + echo "${remove_module_name[$count]}${module_suffix}:" + if [ -e ${dkms_orig} ]; then + echo " - An original module was already stored during a previous install" + else + if [ -f "${kernel_mod}" ]; then + echo " - Found ${kernel_mod}" + echo " - Storing in ${dkms_original}/" + echo " - Archiving for uninstallation purposes" + mkdir -p "${dkms_original}/" + mv -f "${kernel_mod}" "${dkms_orig}" + modules_removed="true" + fi + fi + done + + echo "" +} + +function restore_modules { + local kernel_tree="${install_tree}/${kernelver}" + local dkms_original="${dkms_base_dir}/original_module" + local moved="" + + [[ -e ${kernel_tree} ]] || err_exit "Kernel tree ${kernel_tree} doesn't exist." ${err_kernel_tree} + + for ((count=0; count < ${#remove_module_name[@]}; count++)); do + local kernel_mod=${kernel_tree}${remove_module_location[$count]}/${remove_module_name[$count]}${module_suffix} + local dkms_orig=${dkms_original}/${remove_module_name[$count]}${module_suffix} + + echo "" + echo "${remove_module_name[$count]}${module_suffix}:" + if [ -e ${dkms_orig} ]; then + local kernel_mod_dir=$(dirname ${kernel_mod}) + echo " - Archived original module found in the DKMS tree" + echo " - Moving it to: ${kernel_mod_dir}/" + mkdir -p "${kernel_mod_dir}/" + mv -f "${dkms_orig}" "${kernel_mod_dir}/" 2> /dev/null + moved="true" + else + echo " - No original module was found for this module on this kernel." + echo " - Use the dkms install command to reinstall any previous module version." + fi + done + + if [ ${moved} ]; then + [[ $(find ${dkms_original}/* -maxdepth 0 -type f 2>/dev/null) ]] || rm -rf "${dkms_original}" + fi + + echo "" +} + +# main + +if [ $# -lt 4 ] ; then + usage +fi + +arg_check_help "${1}" + +dkms_base_dir="${1}" +shift + +arg_check_help "${1}" + +kernelver="${1}" +shift + +arg_check_help "${1}" + +arch="${1}" +shift + +arg_check_help "${1}" + +action="${1}" +shift + +arg_check_help "${1}" + +# First check, if the DKMS base directory, does already exist +if [ ! -d ${dkms_base_dir} ] ; then + err_exit "DKMS base directory ${dkms_base_dir} doesn't exist!" ${err_dir_not_found} +fi + +script_dir=$(dirname ${BASH_SOURCE[0]}) +upd_mod_conf=${script_dir}/${upd_mod_conf_name} + +# Check for the configuration file +if [ -f ${upd_mod_conf} ] ; then + echo "Using configuration file ${upd_mod_conf}" + + read_config_file_or_die ${upd_mod_conf} + + case "${action}" in + install) remove_modules + if [ ${modules_removed} ]; then + echo "!!!! NOTE NOTE NOTE !!!!" + echo " There is NO uninstall hook in DKMS available." + echo " This script has saved some modules to" + echo " ${dkms_base_dir}/original_module" + echo " Prior to uninstalling this DKMS module execute" + echo " $0 ${dkms_base_dir} ${kernelver} ${arch} uninstall" + echo "" + fi + ;; + uninstall) restore_modules ;; + *) err_exit "Invalid action '${action}' given!" ${err_action} + esac + + + exit_print "Done!" ${err_ok} +else + exit_print "Nothing to do!" ${err_ok} +fi + diff -Nru media-build-dkms-0004~trusty/media-build-0005/INSTALL media-build-dkms-0005~trusty/media-build-0005/INSTALL --- media-build-dkms-0004~trusty/media-build-0005/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/INSTALL 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,140 @@ +Mauro Carvalho Chehab 2006 Apr 26 + +V4L/DVB building procedures are based at the use of Makefile rules. +Those rules are close to the ones at Linux Kernel, to allow an easier +usage. + +======================================================================= +Quick building procedure is: + make all +====================================================================== + +For those who may want more than just build all stuff there are some +other interesting parameters to make: + +====================== +Normal building rules: +all - build all modules + +clean - Cleans compiled files from the tree, + but keeping the latest + used configuration and kernel version + +distclean - Cleans compiled files from the tree, + latest used configuration and kernel + version. + +default - Continues building the latest module selection + This is the behavior when just typed: + make + +install - Installs all modules at kernel's default dir + for V4L/DVB. Requires root access. + +rminstall - cleans previous installations of V4L/DVB modules + +sound-install - installs the sound modules related to V4L/DVB + tree. + +====================== +Firmware rules: + +firmware - Create the firmware files that are enclosed at the + tree. + Notice: Only a very few firmwares are currently here + +firmware_install- Install firmware files under /lib/firmware + +======================= +Module selection rules: +(Those may require write access to kernel tree) + +allmodconfig - Called by make all. Selects all modules that are known + to compile against the kernel version used. + +stagingconfig - Select all modules, plus all staging modules. The + staging drivers are there because they may have + bad userspace API's, serious bugs and/or not fill + into Kernel required level of quality. So, be + careful with those drivers. + +xconfig - Generate a xconfig menu. Requires full + kernel source, since it depends on kernel's + qconf stript; + +gconfig - Generate a qt menu. Requires full + kernel source, since it depends on kernel's + gconf stript; + +config - Generate a text-mode menu. Requires full + kernel source, since it depends on kernel's + conf stript; + +menuconfig - Generate a ncurses menu. Requires full + kernel source, since it depends on kernel's + mconf and lxconfig stripts; + +release - Allows changing kernel version. + Typical usage is: + make release VER=2.6.12-18mdk + (to force compiling to 2.6.12-18mdk) + (This will work only if + /lib/modules/2.6.12-18mdk/build/ + points to that kernel version) + Or + make release DIR=~/linux-git + (to force using kernel at a specific dir) + To use current kernel version instead: + make release + +====================== +Module handling rules: +(require root access) + +insmod - inserts all modules from V4L/DVB tree + +rmmod - removes all modules from V4L/DVB tree + +reload - removes then reinserts all modules + +=================== +Tree merging rules: + +ivtv - enable merged ivtv build, using the latest ivtv sources + from ivtvdriver.org (requires subversion) + +cx88-ivtv - enable cx88-blackbird ivtv API emulation + +ivtv-update - update ivtv sources from ivtvdriver.org + +========================================== +Patch preparation and tree handling rules: +(used by developers) + +kernel-links - Generate links to V4L/DVB at kernel tree. + Requires write access to kernel tree. + +cardlist - Updates Documentation/video4linux/CARDLIST.* + +update - updates the tree from master repository + +commit - commits the change, asking for a commit msg + +push - sends outgoing stuff to master repository + +checkemacs - checks codingstyle and reports to emacs + using "make checkemacs" at emacs compile menu, + will report the lines with errors inside emacs. + +checkpatch - checks codingstyle and reports using the same + format as c. This way, c error parsers will + handle it. + +checkterse - checks codingstyle and reports using terse + syntax, used on several compilaton tools. + +mismatch - checks for linker section mismatch. In other words, + check if some driver has functions not properly + declared with __init/__exit, and similar tags. + It will also be more pedantic by dealing with + compilation warnings as if they are errors. Binary files /tmp/tmpQUUe8H/OlPPLNDqLn/media-build-dkms-0004~trusty/media-build-0005/linux/linux-media.tar.bz2 and /tmp/tmpQUUe8H/ovgS0vH0L9/media-build-dkms-0005~trusty/media-build-0005/linux/linux-media.tar.bz2 differ diff -Nru media-build-dkms-0004~trusty/media-build-0005/linux/Makefile media-build-dkms-0005~trusty/media-build-0005/linux/Makefile --- media-build-dkms-0004~trusty/media-build-0005/linux/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/linux/Makefile 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,180 @@ +# +# Files that need to be bundled with the building system +# + +-include ../v4l/.version + +MAINDIRS += drivers include sound + +# Drivers source code +TARDIR += drivers/media/ +TARDIR += drivers/staging/media/ +TARDIR += drivers/misc/altera-stapl/ +TARFILES += sound/pci/bt87x.c + +# Includes + +# Pure kernel API +TARDIR += include/media/ +TARDIR += include/dt-bindings/media/ +TARDIR += include/linux/platform_data/media/ +TARFILES += include/linux/mmc/sdio_ids.h +TARFILES += include/sound/aci.h +TARFILES += include/uapi/linux/usb/video.h +TARFILES += include/linux/via-core.h +TARFILES += include/linux/ti_wilink_st.h +TARFILES += include/linux/dma-buf.h +TARFILES += include/linux/dma-fence.h +TARFILES += include/linux/of_graph.h +TARFILES += include/linux/kconfig.h +TARFILES += include/linux/hdmi.h +TARFILES += include/linux/compiler-gcc.h +TARFILES += include/linux/dma/xilinx_dma.h +TARFILES += include/trace/events/v4l2.h +TARFILES += include/trace/events/vb2.h +TARFILES += include/linux/pci_ids.h + +TARFILES += include/misc/altera.h + +# Userspace API +TARDIR += include/uapi/linux/dvb/ +TARFILES += include/uapi/linux/ddbridge-ioctl.h +TARFILES += include/uapi/linux/lirc.h +TARFILES += include/uapi/linux/videodev2.h +TARFILES += include/uapi/linux/meye.h +TARFILES += include/uapi/linux/ivtv.h +TARFILES += include/uapi/linux/ivtvfb.h +TARFILES += include/uapi/linux/max2175.h +TARFILES += include/uapi/linux/media.h +TARFILES += include/uapi/linux/media-bus-format.h +TARFILES += include/uapi/linux/v4l2-dv-timings.h +TARFILES += include/uapi/linux/v4l2-controls.h +TARFILES += include/uapi/linux/uvcvideo.h +TARFILES += include/uapi/linux/xilinx-v4l2-controls.h +TARFILES += include/uapi/linux/smiapp.h +TARFILES += include/uapi/linux/v4l2-subdev.h +TARFILES += include/uapi/linux/v4l2-common.h +TARFILES += include/uapi/linux/v4l2-mediabus.h +TARFILES += include/uapi/linux/cec.h +TARFILES += include/uapi/linux/cec-funcs.h + +# Other random files +TARFILES += include/linux/fixp-arith.h + +DATE := `git --git-dir $(DIR)/.git log -n1 '--pretty=format:%h %ai' |perl -ne 'print "$$2-$$1" if (m/([\da-f]+)\s+(\S+)/)'` +TODAY_TAR := linux-media-${DATE}.tar +TODAY_TAR_MD5 := ${TODAY_TAR}.bz2.md5 +LATEST_TAR := http://linuxtv.org/downloads/drivers/linux-media-LATEST.tar.bz2 +LATEST_TAR_MD5 := http://linuxtv.org/downloads/drivers/linux-media-LATEST.tar.bz2.md5 + +default: + make -C .. + +help: + @echo "Use: make tar DIR=" + @echo " untar|clean|distclean" + +todaytar: + @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi + -rm -f $(PWD)/$(TODAY_TAR).bz2 + tar cf $(PWD)/$(TODAY_TAR) -C $(DIR) $(TARFILES) + git --git-dir $(DIR)/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\1\1,g' >git_log + perl -e 'while (<>) { $$a=$$1 if (m/^\s*VERSION\s*=\s*(\d+)/); $$b=$$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); $$c=$$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); } printf "#define V4L2_VERSION %d\n", ((($$a) << 16) + (($$b) << 8) + ($$c))' $(DIR)/Makefile > kernel_version.h + tar rvf $(PWD)/$(TODAY_TAR) git_log kernel_version.h + + for i in $(TARDIR); do \ + if [ "`echo $$i|grep Documentation`" = "" ]; then \ + dir="`(cd $(DIR); find $$i -type f -name '*.[ch]')`"; \ + dir="$$dir `(cd $(DIR); find $$i -type f -name Makefile)`"; \ + dir="$$dir `(cd $(DIR); find $$i -type f -name Kconfig)`"; \ + tar rvf $(PWD)/$(TODAY_TAR) -C $(DIR) $$dir; \ + else \ + tar rvf $(PWD)/$(TODAY_TAR) -C $(DIR) $$i; \ + fi; done; bzip2 $(PWD)/$(TODAY_TAR) + md5sum $(PWD)/$(TODAY_TAR).bz2 > $(PWD)/$(TODAY_TAR_MD5) + +tar: + @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi + -rm -f $(PWD)/linux-media.tar.bz2 + tar cf $(PWD)/linux-media.tar -C $(DIR) $(TARFILES) + git --git-dir $(DIR)/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\1\1,g' >git_log + perl -e 'while (<>) { $$a=$$1 if (m/^\s*VERSION\s*=\s*(\d+)/); $$b=$$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); $$c=$$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); } printf "#define V4L2_VERSION %d\n", ((($$a) << 16) + (($$b) << 8) + ($$c))' $(DIR)/Makefile > kernel_version.h + tar rvf $(PWD)/linux-media.tar git_log kernel_version.h + for i in $(TARDIR); do \ + if [ "`echo $$i|grep Documentation`" = "" ]; then \ + dir="`(cd $(DIR); find $$i -type f -name '*.[ch]')`"; \ + dir="$$dir `(cd $(DIR); find $$i -type f -name Makefile)`"; \ + dir="$$dir `(cd $(DIR); find $$i -type f -name Kconfig)`"; \ + tar rvf $(PWD)/linux-media.tar -C $(DIR) $$dir; \ + else \ + tar rvf $(PWD)/linux-media.tar -C $(DIR) $$i; \ + fi; done; bzip2 $(PWD)/linux-media.tar + +untar: linux-media.tar.bz2 + tar xfj linux-media.tar.bz2 + -rm -f .patches_applied .linked_dir .git_log.md5 + +clean: + -rm -rf $(MAINDIRS) mm .patches_applied .linked_dir .git_log.md5 git_log kernel_version.h + +dir: clean + @lsdiff --version >/dev/null # Make 'make dir' fail if lsdiff is not installed + @if [ "$(DIR)" = "" ]; then echo "make $@ DIR="; exit -1; fi + @if [ ! -f "$(DIR)/include/uapi/linux/videodev2.h" ]; then echo "$(DIR) does not contain kernel sources"; exit -1; fi + @echo "Searching in $(DIR)/Makefile for kernel version." + ./use_dir.pl $(DIR) + +distclean: clean + -rm -f linux-media.tar.bz2 linux-media.tar.bz2.md5 + +apply_patches apply-patches: + @if [ -e .linked_dir ]; then ./use_dir.pl --recheck --silent; fi + @if [ "$(VER)" != "" ]; then \ + dir=$(VER); \ + elif [ "$(KERNELRELEASE)" != "" ]; then \ + dir=$(KERNELRELEASE); \ + fi; \ + PATCHES="`./patches_for_kernel.pl $$dir`"; \ + if [ "$$PATCHES" = "" ]; then echo "Version $$dir not supported"; exit -1; fi; \ + if [ -e .patches_applied ]; then \ + if [ "`cat .patches_applied|grep ^#`" = "#$$dir" ]; then \ + echo "Patches for $$dir already applied."; exit; \ + else \ + $(MAKE) unapply_patches; \ + fi; \ + fi; \ + echo "Applying patches for kernel $$dir"; \ + touch .patches_applied; \ + rm -f mm/frame_vector.c; \ + for i in $$PATCHES; do \ + echo patch -s -f -N -p1 -i ../backports/$$i; \ + patch -s -f -N -p1 -i ../backports/$$i --dry-run || exit 1; \ + patch -s -f -N -p1 -i ../backports/$$i; \ + mv .patches_applied .patches_applied.old; \ + echo $$i > .patches_applied; \ + cat .patches_applied.old >> .patches_applied; \ + done; \ + mv .patches_applied .patches_applied.old; \ + echo "#$$dir" > .patches_applied; \ + cat .patches_applied.old >> .patches_applied; \ + rm -f .patches_applied.old; \ + ./version_patch.pl; \ + if [ -e .linked_dir ]; then ./use_dir.pl --get_patched; fi + +unapply_patches unapply-patches: + @if [ -e .patches_applied ]; then \ + echo "Unapplying patches"; \ + for i in `cat .patches_applied|grep -v '^#'`; do \ + echo patch -s -f -R -p1 -i ../backports/$$i; \ + patch -s -f -R -p1 -i ../backports/$$i || break; \ + done; \ + rm -f mm/frame_vector.c; \ + rm -f .patches_applied; fi + +download: + wget $(LATEST_TAR_MD5) -O linux-media.tar.bz2.md5.tmp + + @if [ "`cat linux-media.tar.bz2.md5.tmp`" != "`cat linux-media.tar.bz2.md5`" ]; then \ + wget $(LATEST_TAR) -O linux-media.tar.bz2; \ + mv linux-media.tar.bz2.md5.tmp linux-media.tar.bz2.md5; \ + fi diff -Nru media-build-dkms-0004~trusty/media-build-0005/linux/patches_for_kernel.pl media-build-dkms-0005~trusty/media-build-0005/linux/patches_for_kernel.pl --- media-build-dkms-0004~trusty/media-build-0005/linux/patches_for_kernel.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/linux/patches_for_kernel.pl 2013-02-08 00:32:44.000000000 +0000 @@ -0,0 +1,63 @@ +#!/usr/bin/perl + +# This script allows checking what patches are needed for a given +# kernel version. +# Use it as ./patches_for_kernel.pl +# The backport files are specified at: ../backports/backports.txt + +use strict; + +my $version = shift or die "Need a version to apply patches"; + +my $file = "../backports/backports.txt"; +open IN, $file or die "can't find $file\n"; + +sub kernel_version($) { + my ($version, $patchlevel, $sublevel) = $_[0] =~ m/^(\d+)\.(\d+)\.?(\d*)/; + + # fix kernel version for distros that 'translated' 3.0 to 2.6.40 + if ($version == 2 && $patchlevel == 6 && $sublevel >= 40) { + $version = 3; + $patchlevel = $sublevel - 40; + $sublevel = 0; + } + $sublevel = 0 if ($sublevel == ""); + return ($version * 65536 + $patchlevel * 256 + $sublevel); +} + +my $kernel = kernel_version($version); + +die "Invalid kernel version" if (!$kernel); + +my $cur; +my @patches; +my $ln; +while () { + $ln++; + s/\#.*//; + next if (m/^\n*$/); + if (m/\[(.*)\]/) { + $cur = kernel_version($1); + next; + } + if (m/add\s+(.*)/) { + next if ($cur < $kernel); + push @patches, $1; + next; + } + if (m/delete\s+(.*)/) { + next if ($cur < $kernel); + for (my $i = 0; $i < @patches; $i++) { + delete $patches[$i] if ($patches[$i] eq $1); + } + next; + } + die "Can't process line $ln\n"; +} +close IN; +die ("Unsupported Kernel version $version") if ($cur > $kernel); + +foreach my $patch (@patches) { + printf "%s ", $patch; +} +print "\n"; diff -Nru media-build-dkms-0004~trusty/media-build-0005/linux/use_dir.pl media-build-dkms-0005~trusty/media-build-0005/linux/use_dir.pl --- media-build-dkms-0004~trusty/media-build-0005/linux/use_dir.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/linux/use_dir.pl 2014-03-14 19:33:42.000000000 +0000 @@ -0,0 +1,343 @@ +#!/usr/bin/perl +use strict; +use File::Find; +use File::Path; +use File::Copy; +use Fcntl ':mode'; +use Getopt::Long; +use Digest::SHA; + +my $silent = 0; +my $debug = 0; +my $recheck = 0; +my $get_patched = 0; +GetOptions( "--debug" => \$debug, + "--silent" => \$silent, + "--recheck" => \$recheck, + "--get_patched" => \$get_patched, + ); + +my $dir = shift; + +my $ctlfile = ".linked_dir"; +my $patchfile = ".patches_applied"; + +my $sync_patched = 0; +my %dirs; +my %files; +my $patches_applied; + +######################################### +# Control info stored at the control file +my $path; +my %fhash; +my %fhash_patched; +######################################### + +sub read_ctlfile() +{ + my $line; + + open IN, $ctlfile or return; + while () { + next if (m/^\s*\#/); + next if (m/^\n$/); + if (m/^path:\s*([^\s]+)/) { + $path = $1; + } elsif (m/^hash\:\s*([^\s]+)\s*=\s*([^\s]+)/) { + $fhash{$1} = $2; + } elsif (m/^hash_patched\:\s*([^\s]+)\s*=\s*([^\s]+)/) { + $fhash_patched{$1} = $2; + } else { + printf("Parse error on this line of $ctlfile:\n\t$_"); + die; + } + } + close IN; +} + +sub write_ctlfile() +{ + open OUT, ">$ctlfile" or print "Error: Can't write to $ctlfile\n"; + print OUT "path: $path\n"; + foreach my $file (keys %fhash) { + printf OUT "hash: %s=%s\n", $file, $fhash{$file}; + } + foreach my $file (keys %fhash_patched) { + printf OUT "hash_patched: %s=%s\n", $file, $fhash_patched{$file}; + } + close OUT; +} + +sub add_dirs($) +{ + my $data = shift; + my @dirs = split(' ', $data); + + foreach my $val (@dirs) { + $dirs{$val} = 1; + } +} + +sub add_files($) +{ + my $data = shift; + my @dirs = split(' ', $data); + + foreach my $val (@dirs) { + $files{$val} = 1; + } +} + +sub get_file_dir_names() +{ + open IN, "Makefile" or die "Couldn't open Makefile"; + while () { + if (m/^\s*TARDIR\s*[\+\:]*=\s*([A-Za-z_].*)/) { + add_dirs($1); + } elsif (m/^\s*TARFILES\s*[\+\:]*=\s*([A-Za-z_].*)/) { + add_files($1); + } + } + close IN; +} + + +sub hash_calc($) +{ + my $file = shift; + + my $ctx = Digest::SHA->new; + + my $rc = open INHASH, $file; + if (!$rc) { + print "Couldn't open file $file\n" if ($debug); + return 0; + } + $ctx->addfile(*INHASH); + my $digest = $ctx->hexdigest; + close INHASH; + + return $digest; +} + +sub sync_files($) +{ + my $file = shift; + my $path = $file; + my $check_hash; + my $need_sync; + my $filehash; + my $cpfilehash; + my $patched_file; + + $path =~ s,/[^/]+$,,; + + $filehash = hash_calc("$dir/$file"); + $need_sync = 1 if ($filehash ne $fhash{$file}); + + if (!$need_sync && $recheck) { + $cpfilehash = hash_calc("$file"); + if ($patches_applied && exists($fhash_patched{$file})) { + $patched_file = 1; + $need_sync = 1 if ($cpfilehash ne $fhash_patched{$file}); + } else { + $need_sync = 1 if ($cpfilehash ne $fhash{$file}); + } + } + + if ($need_sync) { + printf "Sync'ing file $file (orig = %s, copy = %s, patched = %s)\n", + $filehash, $cpfilehash, $fhash_patched{$file} if ($debug || $recheck); + + if (exists($fhash_patched{$file})) { + $sync_patched = 1; + } else { + $fhash{$file} = $filehash; + mkpath($path); + copy("$dir/$file", $file); + } + } else { + print "Skipping file $file, as is already synchronized\n" if ($debug); + } +} + +sub get_patched_files() +{ + my %files; + + open IN, $patchfile or return %files; + + # Those files are always patched to add warnings about the usage of experimental version + $files{"drivers/media/dvb-core/dvbdev.c"} = 1; + $files{"drivers/media/v4l2-core/v4l2-dev.c"} = 1; + $files{"drivers/media/rc/rc-main.c"} = 1; + + while () { + next if (/^\s*#/); + + if (m/(.*)\n/) { + print ("Backport ../backports/$1 touch(es) file(s):\n") if ($debug); + open IN2, "lsdiff -h --strip 1 ../backports/$1 |"; + while () { + my $f = $_; + $f =~ s/\n//; + $files{$f} = 1; + print ("\t$f\n") if ($debug); + } + close IN2; + } + } + close IN; + + return %files; +} + +sub sync_patched_files() +{ + my %patches = get_patched_files(); + return if (!%patches); + + foreach my $file (keys %patches) { +printf "sync patched file $file\n"; + $fhash{$file} = hash_calc("$dir/$file"); + mkpath($path); + copy("$dir/$file", $file); + } + close IN; +} + +sub get_patched_hashes() +{ + my %patches = get_patched_files(); + return if (!%patches); + + foreach my $file (keys %patches) { + $fhash_patched{$file} = hash_calc("$file"); + printf "Hash for patched file $file = %s\n", $fhash_patched{$file} if ($debug); + } + close IN; +} + +sub remove_deleted() +{ + my $file = $File::Find::name; + my $mode = (stat($file))[2]; + + return if ($mode & S_IFDIR); + + return if ($file =~ /^\./); + return if ($file =~ /\.mod\.c/); + + if ($file =~ /Makefile$/ || $file =~ /Kconfig$/ || $file =~ /\.[ch]$/ ) { + if (! -e "$dir/$file") { + printf "Removing file $file\n" if (!$silent); + delete $fhash{$file} if exists($fhash{$file}); + delete $fhash_patched{$file} if exists($fhash_patched{$file}); + unlink $file; + return; + } + } +} + +sub parse_dir() +{ + my $file = $File::Find::name; + my $mode = (stat($file))[2]; + + return if ($mode & S_IFDIR); + + $file =~ s,^($dir/),,; + + return if ($file =~ /^\./); + return if ($file =~ /\.mod\.c/); + + if ($file =~ /Makefile$/ || $file =~ /Kconfig$/ || $file =~ /\.[ch]$/ ) { + sync_files $file; + return; + } + + printf "Skipping bogus file $file\n" if ($debug); +} + +sub sync_dirs($) +{ + my $subdir = shift; + + print "sync dir: $subdir\n" if (!$silent); + find({wanted => \&parse_dir, no_chdir => 1}, "$dir/$subdir"); + find({wanted => \&remove_deleted, no_chdir => 1}, "$subdir"); +} + +sub sync_all() +{ + foreach my $val (keys %files) { + print "sync file: $val\n" if (!$silent); + sync_files($val); + } + foreach my $val (keys %dirs) { + sync_dirs($val); + } +} + +sub sync_kernel_version() +{ + my ($source_v4l_version, $a, $b, $c, $ver); + + open IN, "$dir/Makefile" or die "Can't find $dir/Makefile"; + while () { + $a=$1 if (m/^\s*VERSION\s*=\s*(\d+)/); + $b=$1 if (m/^\s*PATCHLEVEL\s*=\s*(\d+)/); + $c=$1 if (m/^\s*SUBLEVEL\s*=\s*(\d+)/); + } + close IN; + $source_v4l_version = ((($a) << 16) + (($b) << 8) + ($c)); + + if (open IN, "kernel_version.h") { + while () { + $ver=$1 if (m/^#define\s*V4L2_VERSION* \s*(\d+)/); + } + close IN; + } + + if ($ver ne $source_v4l_version) { + open OUT,">kernel_version.h"; + printf OUT "#define V4L2_VERSION %d\n", $source_v4l_version; + close OUT; + } +} + +# Main + +if (!$dir) { + read_ctlfile(); + die "Please provide a directory to use" if !($path); + $dir = $path; + + printf "Syncing with dir $dir\n"; +} else { + read_ctlfile(); +} +sync_kernel_version(); + +if ($path ne $dir) { + $path = $dir; + %fhash = (); +} + +$patches_applied = 1 if (-e $patchfile); + +if ($get_patched && $patches_applied) { + get_patched_hashes(); +} else { + get_file_dir_names(); + sync_all(); + + if ($sync_patched) { + sync_patched_files(); + unlink $patchfile; + } +} + +write_ctlfile(); +system "git --git-dir $dir/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\\1\\1,g' >git_log" diff -Nru media-build-dkms-0004~trusty/media-build-0005/linux/version_patch.pl media-build-dkms-0005~trusty/media-build-0005/linux/version_patch.pl --- media-build-dkms-0004~trusty/media-build-0005/linux/version_patch.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/linux/version_patch.pl 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,100 @@ +#!/usr/bin/perl +use strict; + + +sub patch_file($$$$) +{ + my $filename = shift; + my $function = shift; + my $after_line = shift; + my $media_build_version = shift; + my $patched; + my $warning = "WARNING: You are using an experimental version of the media stack."; + + open IN, "$filename" or die "can't open $filename"; + my $is_function; + my $file; + my $org_file; + while () { + $org_file .= $_; + next if (m/($warning)/); + $file .= $_; + if (m/($function)/) { + $is_function = 1; + next; + }; + next if (!$is_function); + if (/\}/) { + $is_function--; + next; + }; + if (m/\{/) { + $is_function++; + next; + }; + if ($is_function && m/($after_line)/) { + $file .= "\tprintk(KERN_ERR \"$warning\\n" . + "\\tAs the driver is backported to an older kernel, it doesn't offer\\n" . + "\\tenough quality for its usage in production.\\n" . + "\\tUse it with care.\\n$media_build_version\\n\");\n"; + $is_function = 0; + $patched++; + next; + }; + } + close IN; + if ($org_file ne $file) { + open OUT, ">$filename.new" or die "Can't open $filename.new"; + print OUT $file; + close OUT; + + rename "$filename", "$filename~" or die "Can't rename $filename to $filename~"; + rename "$filename.new", "$filename" or die "Can't rename $filename.new to $filename"; + if ($patched) { + print "Patched $filename\n"; + } else { + die "$filename was not patched.\n"; + } + } else { + print "$filename was already patched\n"; + } +} + +# +# Main +# +open IN, "git_log" or die "can't open git_log"; +my $logs; +$logs.=$_ while (); +close IN; + +if (open IN,".linked_dir") { + while () { + if (m/^path:\s*(.*)/) { + my $dir=$1; + my $new_log = qx(git --git-dir $dir/.git log --pretty=oneline -n3 |sed -r 's,([\x22]),,g; s,([\x25\x5c]),\\1\\1,g'); + if ($new_log ne $logs) { + printf("Git version changed.\n"); + open OUT, ">git_log"; + print OUT $new_log; + close OUT; + $logs = $new_log; + } + last; + } + } + close IN; +} + +# Prepare patches message +$logs =~ s/\s+$//; +$logs =~ s,\n,\\n\\t,g; +$logs =~ s,\",\\\",g; +$logs = "Latest git patches (needed if you report a bug to linux-media\@vger.kernel.org):\\n\\t$logs"; + +# Patch dvbdev +patch_file "drivers/media/dvb-core/dvbdev.c", "__init init_dvbdev", "MKDEV", $logs; +# Patch v4l2-dev +patch_file "drivers/media/v4l2-core/v4l2-dev.c", "__init videodev_init", "pr_info", $logs; +# Patch rc core +patch_file "drivers/media/rc/rc-main.c", "__init rc_core_init", "rc_map_register", $logs; diff -Nru media-build-dkms-0004~trusty/media-build-0005/Makefile media-build-dkms-0005~trusty/media-build-0005/Makefile --- media-build-dkms-0004~trusty/media-build-0005/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/Makefile 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,36 @@ +BUILD_DIR := $(shell pwd)/v4l +TMP ?= /tmp + +ifeq ($(EDITOR),) + ifeq ($(VISUAL),) + EDITOR := vi + else + EDITOR := $(VISUAL) -w + endif +endif + +all: + +install: + $(MAKE) -C $(BUILD_DIR) install + +# Hmm, .PHONY does not work with wildcard rules :-( +SPECS = media-specs + +.PHONY: $(SPECS) + +$(SPECS): + $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) + +%:: + $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) + +download untar:: + $(MAKE) -C linux/ $(MAKECMDGOALS) + +dir:: + $(MAKE) -C linux/ $(MAKECMDGOALS) DIR="../$(DIR)" + +cleanall: + $(MAKE) distclean + $(MAKE) -C linux distclean diff -Nru media-build-dkms-0004~trusty/media-build-0005/Makefile.dkms media-build-dkms-0005~trusty/media-build-0005/Makefile.dkms --- media-build-dkms-0004~trusty/media-build-0005/Makefile.dkms 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/Makefile.dkms 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,22 @@ +# +# Will be executed by the DKMS system, with +# KERNELRELEASE and MEDIA_INST_DIR +# set. +# + +ifneq ($(MAKECMDGOALS),clean) + ifeq ($(KERNELRELEASE),) + $(error KERNELRELEASE not set) + endif +endif +ifeq ($(MEDIA_INST_DIR),) + $(error MEDIA_INST_DIR not set) +endif + +build: + VER=$(KERNELRELEASE) ./build_all.sh $(MEDIA_INST_DIR) -db + +clean: + VER=$(KERNELRELEASE) ./build_all.sh $(MEDIA_INST_DIR) -dc + +.PHONY: build clean diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/compat.h media-build-dkms-0005~trusty/media-build-0005/v4l/compat.h --- media-build-dkms-0004~trusty/media-build-0005/v4l/compat.h 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/compat.h 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,2510 @@ +/* + * $Id: compat.h,v 1.44 2006/01/15 09:35:16 mchehab Exp $ + */ + +#ifndef _COMPAT_H +#define _COMPAT_H + +#include + +#include "config-compat.h" +/* + * config-mycompat.h is for use with kernels/distros whose maintainers + * have integrated various backports, which the media_build system does + * not pick up on for whatever reason. At that point there are options + * defined in config-compat.h, which enable backports here, in compat.h, + * but which already exist in the target kernel. This allows disabling of + * specific backports for a particular build, allowing compliation to succeed. + + * For example, if the following three statements exist in config-mycompat.h: + + * #undef NEED_WRITEL_RELAXED + * #undef NEED_PM_RUNTIME_GET + * #undef NEED_PFN_TO_PHYS + + * Those three media_build backports will be disabled in this file and + * compilation on a problematic kernel will succeed without issue. + * conifg-mycompat.h should be used strictly for disabling media_build + * backports causing compilation issues. It will typically be left empty. + * + * WARNING: v4l/config-mycompat.h is removed by distclean, the file + * should be saved externally and copied into v4l/ when required. + */ +#include "config-mycompat.h" + +#ifndef SZ_512 +#define SZ_512 0x00000200 +#endif +#ifndef SZ_4K +#define SZ_4K 0x00001000 +#endif +#ifndef SZ_8K +#define SZ_8K 0x00002000 +#endif + +#ifdef NEED_ANNOTATE_REACHABLE +#define annotate_reachable() +#define annotate_unreachable() +#endif + +#include +#include +#include +#include +#include "../linux/kernel_version.h" + +#ifdef RETPOLINE +#ifndef __noretpoline +#define __noretpoline __attribute__((indirect_branch("keep"))) +#endif +#endif + +#undef __devinitconst +#define __devinitconst + +#ifndef uninitialized_var +#define uninitialized_var(x) x = x +#endif + +#ifdef NEED_POLL_T +typedef unsigned __poll_t; +/* Epoll event masks */ +#define EPOLLIN (__force __poll_t)0x00000001 +#define EPOLLPRI (__force __poll_t)0x00000002 +#define EPOLLOUT (__force __poll_t)0x00000004 +#define EPOLLERR (__force __poll_t)0x00000008 +#define EPOLLHUP (__force __poll_t)0x00000010 +#define EPOLLNVAL (__force __poll_t)0x00000020 +#define EPOLLRDNORM (__force __poll_t)0x00000040 +#define EPOLLRDBAND (__force __poll_t)0x00000080 +#define EPOLLWRNORM (__force __poll_t)0x00000100 +#define EPOLLWRBAND (__force __poll_t)0x00000200 +#define EPOLLMSG (__force __poll_t)0x00000400 +#define EPOLLRDHUP (__force __poll_t)0x00002000 +#endif + +#define SIZE_MAX (~(size_t)0) + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) +#include +#endif + +/* In v2.6.19-rc6-118-g52bad64 struct work_struct was was changed to be only for + * non-delayed work and struct delayed_work was created for delayed work. This + * will rename the structures. Hopefully no one will decide to name something + * delayed_work in the same context as something named work_struct. */ +#ifdef NEED_DELAYED_WORK +#define delayed_work work_struct +#define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c) +#endif + +#define EXPERIMENTAL_TREE + +#ifdef NEED_I2C_SMBUS_WORD_SWAPPED +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) +static inline s32 +i2c_smbus_read_word_swapped(struct i2c_client *client, u8 command) +{ + s32 value = i2c_smbus_read_word_data(client, command); + + return (value < 0) ? value : swab16(value); +} + +static inline s32 +i2c_smbus_write_word_swapped(struct i2c_client *client, u8 command, u16 value) +{ + return i2c_smbus_write_word_data(client, command, swab16(value)); +} +#else +static inline s32 +i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command) +{ + s32 value = i2c_smbus_read_word_data(client, command); + + return (value < 0) ? value : swab16(value); +} + +static inline s32 +i2c_smbus_write_word_swapped(const struct i2c_client *client, + u8 command, u16 value) +{ + return i2c_smbus_write_word_data(client, command, swab16(value)); +} +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) +#include +static inline unsigned long find_next_zero_bit_le(const void *addr, + unsigned long size, unsigned long offset) +{ + return find_next_zero_bit(addr, size, offset); +} + +static inline unsigned long find_next_bit_le(const void *addr, + unsigned long size, unsigned long offset) +{ + return find_next_bit(addr, size, offset); +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma) +#define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +#define KERN_CONT "" +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) +#define ir_register_class(a) input_register_device(a) +#define ir_unregister_class(a) input_unregister_device(a) +#endif + +/* To allow I2C compatibility code to work */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#include +#endif + +#ifdef NEED_HEX_TO_BIN +#include +static inline int hex_to_bin(char ch) +{ + if ((ch >= '0') && (ch <= '9')) + return ch - '0'; + ch = tolower(ch); + if ((ch >= 'a') && (ch <= 'f')) + return ch - 'a' + 10; + return -1; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#define usb_enable_autosuspend(udev) udev->autosuspend_disabled = 0; +#endif + +#ifndef FBIO_WAITFORVSYNC +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) +#include +#include +#include +static inline void *memdup_user(const void __user *src, size_t len) +{ + void *p; + + /* + * Always use GFP_KERNEL, since copy_from_user() can sleep and + * cause pagefault, which makes it pointless to use GFP_NOFS + * or GFP_ATOMIC. + */ + p = kmalloc_track_caller(len, GFP_KERNEL); + if (!p) + return ERR_PTR(-ENOMEM); + + if (copy_from_user(p, src, len)) { + kfree(p); + return ERR_PTR(-EFAULT); + } + + return p; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) +static inline int pci_msi_enabled(void) +{ +#ifndef CONFIG_PCI_MSI + return 0; +#else + return 1; +#endif +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#ifdef CONFIG_PROC_FS +#include +#include +#include +#endif +#endif + +#ifndef KEY_NUMERIC_0 +#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ +#define KEY_NUMERIC_1 0x201 /* and other keypads */ +#define KEY_NUMERIC_2 0x202 +#define KEY_NUMERIC_3 0x203 +#define KEY_NUMERIC_4 0x204 +#define KEY_NUMERIC_5 0x205 +#define KEY_NUMERIC_6 0x206 +#define KEY_NUMERIC_7 0x207 +#define KEY_NUMERIC_8 0x208 +#define KEY_NUMERIC_9 0x209 +#define KEY_NUMERIC_STAR 0x20a +#define KEY_NUMERIC_POUND 0x20b +#endif + +#ifndef KEY_IMAGES +#define KEY_IMAGES 0x1ba /* AL Image Browser */ +#endif + +#ifdef NEED_DEFINE_PCI_DEVICE_TABLE +#define DEFINE_PCI_DEVICE_TABLE(_table) \ + const struct pci_device_id _table[] +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#define netdev_mc_count(dev) ((dev)->mc_count) +#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) +#define netdev_for_each_mc_addr(mclist, dev) \ + for (mclist = dev->mc_list; mclist; mclist = mclist->next) +#endif + +#ifndef KEY_CONTEXT_MENU +#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ +#endif + +#ifndef BIT_MASK +#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#endif + +#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32) && 0 +#include +#undef _P +static inline char *skip_spaces(const char *str) +{ + while (isspace(*str)) + ++str; + return (char *)str; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) +#define valtype unsigned long +static inline int strict_strtoul(const char *cp, unsigned int base, valtype *res) +{ + char *tail; + valtype val; + size_t len; + + *res = 0; + len = strlen(cp); + if (len == 0) + return -EINVAL; + + val = simple_strtoul(cp, &tail, base); + if ((*tail == '\0') || + ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) { + *res = val; + return 0; + } + + return -EINVAL; +} +#endif + +#ifndef KEY_DASHBOARD +#define KEY_DASHBOARD 204 /* AL Dashboard */ +#endif +/* To allow alsa code to work */ +#ifdef NEED_SOUND_DRIVER_H +#include +#endif + +#ifdef NEED_SND_CARD_CREATE +#include +#endif + +#ifdef NEED_ALGO_CONTROL +#include +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) +#define time_is_after_eq_jiffies(a) (time_before_eq(jiffies, a)) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) +#define set_freezable() +#define cancel_delayed_work_sync cancel_rearming_delayed_work +#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) +#endif + +#ifndef __pure +# define __pure __attribute__((pure)) +#endif + +/* device_create/destroy added in 2.6.18 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +/* on older kernels, class_device_create will in turn be a compat macro */ +# define device_create(a, b, c, d, e, f, g) class_device_create(a, NULL, c, b, d, e, f, g) +# define device_destroy(a, b) class_device_destroy(a, b) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +#define IRQF_SHARED SA_SHIRQ +#define IRQF_DISABLED SA_INTERRUPT +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define PCIAGP_FAIL 0 +#define vmalloc_32_user(a) vmalloc_32(a) +#endif + +#ifndef DIV_ROUND_CLOSEST +#define DIV_ROUND_CLOSEST(x, divisor)( \ +{ \ + typeof(divisor) __divisor = divisor; \ + (((x) + ((__divisor) / 2)) / (__divisor)); \ +} \ +) +#endif + +#ifdef NEED_BOOL_TYPE +/* bool type and enum-based definition of true and false was added in 2.6.19 */ +typedef int bool; +enum { + false = 0, + true = 1 +}; +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) +#define sony_pic_camera_command(a,b) sonypi_camera_command(a,b) + +#define SONY_PIC_COMMAND_SETCAMERAAGC SONYPI_COMMAND_SETCAMERAAGC +#define SONY_PIC_COMMAND_SETCAMERABRIGHTNESS SONYPI_COMMAND_SETCAMERABRIGHTNESS +#define SONY_PIC_COMMAND_SETCAMERACOLOR SONYPI_COMMAND_SETCAMERACOLOR +#define SONY_PIC_COMMAND_SETCAMERACONTRAST SONYPI_COMMAND_SETCAMERACONTRAST +#define SONY_PIC_COMMAND_SETCAMERAHUE SONYPI_COMMAND_SETCAMERAHUE +#define SONY_PIC_COMMAND_SETCAMERAPICTURE SONYPI_COMMAND_SETCAMERAPICTURE +#define SONY_PIC_COMMAND_SETCAMERASHARPNESS SONYPI_COMMAND_SETCAMERASHARPNESS +#define SONY_PIC_COMMAND_SETCAMERA SONYPI_COMMAND_SETCAMERA +#endif + +/* pci_dev got a new revision field in 2.6.23-rc1 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) && defined(LINUX_PCI_H) +/* Just make it easier to subsitute pci_dev->revision with + * v4l_compat_pci_rev(pci_dev). It's too bad there isn't some kind of context + * sensitive macro in C that could do this for us. */ +static inline u8 v4l_compat_pci_rev(struct pci_dev *pci) +{ u8 rev; pci_read_config_byte(pci, PCI_REVISION_ID, &rev); return rev; } +#endif + +#if defined(COMPAT_PCM_TO_RATE_BIT) && defined(__SOUND_PCM_H) +/* New alsa core utility function */ +static inline unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) +{ + static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, + 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(rates); i++) + if (rates[i] == rate) + return 1u << i; + return SNDRV_PCM_RATE_KNOT; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +# define task_pid_nr(current) ((current)->pid) + +# define sg_init_table(a,b) +# define sg_page(p) (sg->page) +# define sg_set_page(sglist,pg,sz,off) \ +do { \ + struct scatterlist *p=sglist; \ + p->page = pg; \ + p->length = sz; \ + p->offset = off; \ +} while (0) +#endif + +#ifndef pr_err +#define pr_err(fmt, arg...) \ + printk(KERN_ERR fmt, ##arg) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) +#define noop_llseek NULL +#endif + +#ifndef pr_warn +#define pr_warn(fmt, arg...) \ + printk(KERN_WARNING fmt, ##arg) +#endif + +#ifndef BIT_MASK +# define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +# define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#define i2c_verify_client(dev) \ + ((dev->bus == &i2c_bus_type) ? to_i2c_client(dev) : NULL) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) +#define i2c_verify_client(dev) \ + ((dev->bus && 0 == strcmp(dev->bus->name, "i2c")) ? to_i2c_client(dev) : NULL) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) +/* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ +#define I2C_ADDRS(addr, addrs...) \ + ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) +#endif + +#ifndef USB_DEVICE_AND_INTERFACE_INFO +# define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ + | USB_DEVICE_ID_MATCH_DEVICE, \ + .idVendor = (vend), .idProduct = (prod), \ + .bInterfaceClass = (cl), \ + .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#define get_unaligned_be16(a) \ + be16_to_cpu(get_unaligned((unsigned short *)(a))) +#define put_unaligned_be16(r, a) \ + put_unaligned(cpu_to_be16(r), ((unsigned short *)(a))) +#define get_unaligned_le16(a) \ + le16_to_cpu(get_unaligned((unsigned short *)(a))) +#define put_unaligned_le16(r, a) \ + put_unaligned(cpu_to_le16(r), ((unsigned short *)(a))) +#define get_unaligned_be32(a) \ + be32_to_cpu(get_unaligned((u32 *)(a))) +#define put_unaligned_be32(r, a) \ + put_unaligned(cpu_to_be32(r), ((u32 *)(a))) +#define get_unaligned_le32(a) \ + le32_to_cpu(get_unaligned((u32 *)(a))) +#define put_unaligned_le32(r, a) \ + put_unaligned(cpu_to_le32(r), ((u32 *)(a))) +#define get_unaligned_le64(a) \ + le64_to_cpu(get_unaligned((u64 *)(a))) +#define put_unaligned_le64(r, a) \ + put_unaligned(cpu_to_le64(r), ((u64 *)(a))) +#endif + +#ifdef NEED_PROC_CREATE +#ifdef CONFIG_PROC_FS +static inline struct proc_dir_entry *proc_create(const char *a, + mode_t b, struct proc_dir_entry *c, const struct file_operations *d) +{ + struct proc_dir_entry *e; + + e = create_proc_entry(a, b, c); + if (e) { + e->owner = THIS_MODULE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) + e->proc_fops = d; +#else + e->proc_fops = (struct file_operations *)d; +#endif + } + return e; +} +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#ifdef CONFIG_PROC_FS +static inline struct proc_dir_entry *proc_create_data(const char *a, + mode_t b, struct proc_dir_entry *c, const struct file_operations *d, + void *f) +{ + struct proc_dir_entry *e; + + e = create_proc_entry(a, b, c); + if (e) { + e->owner = THIS_MODULE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) + e->proc_fops = d; +#else + e->proc_fops = (struct file_operations *)d; +#endif + e->data = f; + } + return e; +} +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) +#define hweight64(x) generic_hweight64(x) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +typedef unsigned long uintptr_t; +#endif + +#ifdef NEED_IS_SINGULAR +static inline int list_is_singular(const struct list_head *head) +{ + return !list_empty(head) && (head->next == head->prev); +} +#endif + +#ifdef NEED_CLAMP +#define clamp( x, l, h ) max_t( __typeof__( x ), \ + ( l ), \ + min_t( __typeof__( x ), \ + ( h ), \ + ( x ) ) ) +#define clamp_val(val, min, max) ({ \ + typeof(val) __val = (val); \ + typeof(val) __min = (min); \ + typeof(val) __max = (max); \ + __val = __val < __min ? __min : __val; \ + __val > __max ? __max : __val; }) +#endif + +#ifdef NEED_ALGO_CONTROL +static inline int dummy_algo_control(struct i2c_adapter *adapter, + unsigned int cmd, unsigned long arg) +{ + return 0; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#define div64_u64(a,b) div64_64(a,b) + +#define dev_name(dev) ((dev)->bus_id) + +#define dev_set_name(dev, fmt, arg...) ({ \ + snprintf((dev)->bus_id, sizeof((dev)->bus_id), fmt , ## arg); \ + 0; \ +}) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +#define current_uid() (current->uid) +#endif + +#ifndef WARN +#define WARN(condition, format...) ({ \ + int __ret_warn_on = !!(condition); \ + if (unlikely(__ret_warn_on)) \ + printk(KERN_WARNING format); \ + unlikely(__ret_warn_on); \ +}) +#endif + +#ifdef NEED_SND_BUG_ON +#define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) +#endif + +#ifdef NEED_BITOPS +#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) +#endif + +#ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC +#define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 +#endif + +#ifdef __LINUX_USB_H +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +/* + * usb_endpoint_* functions + * + * Included in Linux 2.6.19 + * Backported to 2.6.18 in Red Hat Enterprise Linux 5.2 + */ + +#ifdef RHEL_RELEASE_CODE +#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 2) +#define RHEL_HAS_USB_ENDPOINT +#endif +#endif + +#ifndef RHEL_HAS_USB_ENDPOINT +static inline int +usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN; +} + +static inline int +usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_INT; +} + +static inline int +usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_ISOC; +} + +static inline int +usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_BULK; +} + +static inline int +usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) +{ + return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); +} + +static inline int usb_endpoint_dir_out( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); +} + +static inline int usb_endpoint_is_bulk_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_bulk_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_int_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_isoc_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_isoc_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); +} +#endif /* RHEL_HAS_USB_ENDPOINT */ +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) +#ifndef RHEL_HAS_USB_ENDPOINT +static inline int usb_endpoint_xfer_control( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_CONTROL); +} +#endif /* RHEL_HAS_USB_ENDPOINT */ +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) +{ + return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; +} +#endif + +#ifdef NEED_USB_ENDPOINT_TYPE +static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) +{ + return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; +} +#endif +#endif /* __LINUX_USB_H */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +/* + * Linked list API + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +/* + * uninitialized_var() macro + */ +#define uninitialized_var(x) x = x +#endif + +#ifdef NEED_NETDEV_PRIV +#define netdev_priv(dev) ((dev)->priv) +#endif + +#ifdef NEED_PCI_IOREMAP_BAR +#define pci_ioremap_bar(pdev, bar) \ + ioremap_nocache(pci_resource_start(pdev, bar), \ + pci_resource_len(pdev, bar)) +#endif + +#ifdef NEED_POLL_SCHEDULE +#define poll_schedule(pwq, task) \ + do { \ + set_current_state(task); \ + schedule(); \ + set_current_state(TASK_RUNNING); \ + } while (0) +#endif + +/* This macro was added in commit v2.6.23-5792-g34c6538 */ +#ifndef DMA_BIT_MASK +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) +#endif + +/* __fls() was added for generic code in 2.6.29, existed for just 64-bit arches + * since 2.6.26 (v2.6.25-5228-g56a6b1e), and was x86-64 only before then. We + * only want this compat code when __fls doesn't exist, which 2.6.29 or later, + * non x86-64, and non 64-bit that's 2.6.26 or later. */ +#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) || \ + defined(__x86_64__) || \ + (BITS_PER_LONG == 64 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))) +/* This define will prevent breakage if __fls was already defined. */ +#undef __fls +#define __fls v4l_compat_fls +static inline unsigned long v4l_compat_fls(unsigned long x) +{ + return fls(x) - 1; +} +#endif + +/* + * Compatibility code for hrtimer API + * This will make hrtimer usable for kernels 2.6.22 and later. + * For earlier kernels, not all required functions are exported + * so there's nothing we can do. + */ + +#ifdef _LINUX_HRTIMER_H +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) && \ + LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) +/* Forward a hrtimer so it expires after the hrtimer's current now */ +static inline unsigned long hrtimer_forward_now(struct hrtimer *timer, + ktime_t interval) +{ + return hrtimer_forward(timer, timer->base->get_time(), interval); +} +#endif +#endif /* _LINUX_HRTIMER_H */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#define strncasecmp(a, b, c) strnicmp(a, b, c) +#define strcasecmp(a, b) strnicmp(a, b, sizeof(a)) +#endif + +#ifdef NEED_FW_CSR_STRING + +#include +#include + +static inline int fw_csr_string(u32 *directory, int search_key, char *buf, size_t size) +{ + struct fw_csr_iterator ci; + int last_key = 0, key, value; + const u32 *block = NULL; + unsigned int quadlets, i; + + fw_csr_iterator_init(&ci, directory); + while (fw_csr_iterator_next(&ci, &key, &value)) { + if (last_key == search_key && + key == (CSR_DESCRIPTOR | CSR_LEAF)) { + block = ci.p - 1 + value; + break; + } + + last_key = key; + } + + if (!block) + return -ENOENT; + + quadlets = min(block[0] >> 16, 256U); + if (quadlets < 2) + return -ENODATA; + + if (block[1] != 0 || block[2] != 0) + /* unknown language/character set */ + return -ENODATA; + + block += 3; + quadlets -= 2; + for (i = 0; i < quadlets * 4 && i < size - 1; i++) { + char c = block[i / 4] >> (24 - 8 * (i % 4)); + if (c == '\0') + break; + buf[i] = c; + } + buf[i] = '\0'; + + return i; +} +#endif + +#ifdef NEED_POLL_REQUESTED_EVENTS +#include + +static inline bool poll_does_not_wait(const poll_table *p) +{ + return p == NULL; +} + +/* Note: this function was introduced in kernel 3.4. That version relies + on changes in the core poll code in order to be able to get the right + value. For older kernels we use this compatibility function which will + not always get it right: if you pass multiple file descriptors to the + select() call, and if one of the earlier fds found an event, then for any + subsequent file descriptors the poll_table pointer is set to NULL and you + loose the key information. + + You can't make this fool-proof other than by going to kernel 3.4. + */ +static inline unsigned long poll_requested_events(const poll_table *p) +{ + return p ? p->key : ~0UL; +} +#endif + +#ifdef NEED_VZALLOC +#include + +static inline void *vzalloc(unsigned long size) +{ + void *p = vmalloc(size); + if (!p) + return NULL; + memset (p, '\0', size); + return p; +} + +#endif + +#ifdef NEED_KVZALLOC +#include +#include + +static inline void *kvzalloc(size_t size, gfp_t flags) +{ + return vzalloc(size); +} + +static inline void *kvmalloc(size_t size, gfp_t flags) +{ + return (flags & __GFP_ZERO) ? vzalloc(size) : vmalloc(size); +} + +static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags) +{ + if (size != 0 && n > SIZE_MAX / size) + return NULL; + + return kvmalloc(n * size, flags); +} +#endif + +#ifdef NEED_FLUSH_WORK_SYNC +#define flush_work_sync(dev) +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) + +#ifdef NEED_AUTOSUSPEND_DELAY +#define pm_runtime_set_autosuspend_delay(dev, delay) { \ + struct usb_device *udev = to_usb_device(dev); \ + udev->autosuspend_delay = delay; \ +} +#elif LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 37) +/* usb.h includes this from 2.6.38 onwards */ +#include +#endif +#endif + +#ifndef KEY_10CHANNELSUP +#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ +#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ +#endif + +#ifdef NEED_SND_CTL_ENUM_INFO +#include +static inline int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, + unsigned int items, const char *const names[]) +{ + info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; + info->count = channels; + info->value.enumerated.items = items; + if (info->value.enumerated.item >= items) + info->value.enumerated.item = items - 1; + strlcpy(info->value.enumerated.name, + names[info->value.enumerated.item], + sizeof(info->value.enumerated.name)); + return 0; +} +#endif + +#ifdef NEED_SYSFS_ATTR_INIT +#define sysfs_attr_init(a) +#endif + +#ifdef NEED_USLEEP_RANGE +#define usleep_range(min, max) msleep(min/1000) +#endif + +#ifdef NEED_IS_ERR_OR_NULL +#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr))) +#endif + +#ifndef pr_err_ratelimited +#if defined(DEBUG) +#define pr_err_ratelimited(fmt, ...) \ + printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_err_ratelimited(fmt, ...) +#endif +#endif /*pr_debug_ratelimited */ + +#ifdef NEED_DEV_DBG_RATELIMITED +#define dev_dbg_ratelimited dev_dbg +#define dev_err_ratelimited dev_err +#define dev_notice_ratelimited dev_notice +#endif + +#ifdef NEED_MODULE_USB_DRIVER +#define module_usb_driver(drv) \ +static int __init usb_mod_init(void) \ +{ \ + return usb_register(&drv); \ +} \ +static void __exit usb_mod_exit(void) \ +{ \ + usb_deregister(&drv); \ +} \ +module_init(usb_mod_init); \ +module_exit(usb_mod_exit); +#endif /* module_usb_driver */ + +#ifdef NEED_MODULE_PLATFORM_DRIVER +#define module_platform_driver(drv) \ +static int __init plat_mod_init(void) \ +{ \ + return platform_driver_register(&drv); \ +} \ +static void __exit plat_mod_exit(void) \ +{ \ + platform_driver_unregister(&drv); \ +} \ +module_init(plat_mod_init); \ +module_exit(plat_mod_exit); +#endif /* module_platform_driver */ + +#ifdef NEED_DMA_TRANSFER_DIRECTION +#include +#define DMA_DEV_TO_MEM DMA_FROM_DEVICE +#define DMA_MEM_TO_DEV DMA_TO_DEVICE +#endif + +#ifndef module_driver +#define module_driver(__driver, __register, __unregister) \ +static int __init __driver##_init(void) \ +{ \ + return __register(&(__driver)); \ +} \ +module_init(__driver##_init); \ +static void __exit __driver##_exit(void) \ +{ \ + __unregister(&(__driver)); \ +} \ +module_exit(__driver##_exit); +#endif + +#ifndef module_i2c_driver +#define module_i2c_driver(__i2c_driver) \ + module_driver(__i2c_driver, i2c_add_driver, \ + i2c_del_driver) +#endif + +#ifdef NEED_KMALLOC_ARRAY +#include +static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) +{ + if (size != 0 && n > ULONG_MAX / size) + return NULL; + return __kmalloc(n * size, flags); +} +#endif + +#ifdef NEED_DMAENGINE_PREP_SLAVE_SG +#include +static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg( + struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len, + int dir, unsigned long flags) +{ + return chan->device->device_prep_slave_sg(chan, sgl, sg_len, + dir, flags); +} +#endif + +#ifdef NEED_SET_SYSTEM_SLEEP_PM_OPS +#ifdef CONFIG_PM_SLEEP +#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ + .suspend = suspend_fn, \ + .resume = resume_fn, \ + .freeze = suspend_fn, \ + .thaw = resume_fn, \ + .poweroff = suspend_fn, \ + .restore = resume_fn, +#else +#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) +#endif +#endif + +#ifdef NEED_I2C_CLIENT_SCCB +#define I2C_CLIENT_SCCB 0x9000 +#endif + +#ifdef NEED_UNLOCK_I2C_XFER +#include + +static inline int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) +{ + unsigned long orig_jiffies; + int ret, try; + + /* Retry automatically on arbitration loss */ + orig_jiffies = jiffies; + for (ret = 0, try = 0; try <= adap->retries; try++) { + ret = adap->algo->master_xfer(adap, msgs, num); + if (ret != -EAGAIN) + break; + if (time_after(jiffies, orig_jiffies + adap->timeout)) + break; + } + + return ret; +} +#endif + +#ifdef NEED_KSTRTOU16 +#include + +static inline int kstrtou16(const char *s, unsigned int base, u16 *res) +{ + unsigned long val; + int ret; + + ret = strict_strtoul(s, base, &val); + *res = (u16)val; + return ret; +} +#endif + +#ifdef NEED_KSTRTOUL +#include + +#define kstrtoul strict_strtoul + +#endif + +#ifdef NEED_MEMWEIGHT +static inline size_t memweight(const void *ptr, size_t bytes) +{ + size_t ret = 0; + size_t longs; + const unsigned char *bitmap = ptr; + + for (; bytes > 0 && ((unsigned long)bitmap) % sizeof(long); + bytes--, bitmap++) + ret += hweight8(*bitmap); + + longs = bytes / sizeof(long); + if (longs) { + BUG_ON(longs >= INT_MAX / BITS_PER_LONG); + ret += bitmap_weight((unsigned long *)bitmap, + longs * BITS_PER_LONG); + bytes -= longs * sizeof(long); + bitmap += longs * sizeof(long); + } + /* + * The reason that this last loop is distinct from the preceding + * bitmap_weight() call is to compute 1-bits in the last region smaller + * than sizeof(long) properly on big-endian systems. + */ + for (; bytes > 0; bytes--, bitmap++) + ret += hweight8(*bitmap); + + return ret; +} +#endif + +#ifdef NEED_USB_ENDPOINT_MAXP +#define usb_endpoint_maxp(epd) __le16_to_cpu((epd)->wMaxPacketSize) +#endif + +#ifdef NEED_USB_ENDPOINT_MAXP_MULT +#define USB_EP_MAXP_MULT_SHIFT 11 +#define USB_EP_MAXP_MULT_MASK (3 << USB_EP_MAXP_MULT_SHIFT) +#define USB_EP_MAXP_MULT(m) \ + (((m) & USB_EP_MAXP_MULT_MASK) >> USB_EP_MAXP_MULT_SHIFT) + +#define usb_endpoint_maxp_mult(epd) (USB_EP_MAXP_MULT(usb_endpoint_maxp(epd)) + 1) +#endif + +#ifdef NEED_PRINTK_RATELIMITED +#define printk_ratelimited printk +#endif + +#ifndef module_pci_driver +#define module_pci_driver(__pci_driver) \ + module_driver(__pci_driver, pci_register_driver, \ + pci_unregister_driver) +#endif + +#ifdef NEED_LOCK_ADAPTER +static inline void i2c_lock_adapter(struct i2c_adapter *adapter) +{ + mutex_lock(&adapter->bus_lock); +} +static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) +{ + mutex_unlock(&adapter->bus_lock); +} +#endif + +#ifdef NEED_I2C_PROBE_FUNC_QUICK_READ +static inline int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr) +{ + return i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_READ, 0, + I2C_SMBUS_QUICK, NULL) >= 0; +} +#endif + +#ifdef NEED_ABS64 +#define abs64(x) ({ \ + s64 __x = (x); \ + (__x < 0) ? -__x : __x; \ + }) +#endif + +#ifndef module_pci_driver +#define module_pci_driver(__pci_driver) \ + module_driver(__pci_driver, pci_register_driver, \ + pci_unregister_driver) +#endif + +#ifdef NEED_DONTDUMP +#ifdef NEED_NODUMP +/* + * If NODUMP doesn't exist, then this flag was actually called VM_ALWAYSDUMP + * and we have to invert the meaning of the flag. + * So NODUMP == !VM_ALWAYSDUMP == 0. + */ +#define VM_NODUMP (0) +#endif +#define VM_DONTDUMP VM_NODUMP +#endif + +#ifdef NEED_IS_ENABLED +#define __LINUX_KCONFIG_H +#undef IS_ENABLED +#define __ARG_PLACEHOLDER_1 0, +#define config_enabled(cfg) _config_enabled(cfg) +#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value) +#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0) +#define ___config_enabled(__ignored, val, ...) val +#define IS_ENABLED(option) \ + (config_enabled(option) || config_enabled(option##_MODULE)) +#endif + +#ifdef NEED_IS_REACHABLE +#define IS_REACHABLE(option) (config_enabled(option) || \ + (config_enabled(option##_MODULE) && config_enabled(MODULE))) +#endif + +#ifdef NEED_USB_TRANSLATE_ERRORS +static inline int usb_translate_errors(int error_code) +{ + switch (error_code) { + case 0: + case -ENOMEM: + case -ENODEV: + case -EOPNOTSUPP: + return error_code; + default: + return -EIO; + } +} +#endif + +#ifdef NEED_PTR_RET +static inline int __must_check PTR_RET(const void *ptr) +{ + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + else + return 0; +} +#endif + +#ifdef NEED_FILE_INODE +#include +static inline struct inode *file_inode(struct file *f) +{ + return f->f_path.dentry->d_inode; +} +#endif + +#ifdef NEED_ETH_P_802_3_MIN +#define ETH_P_802_3_MIN 0x0600 +#endif + +#ifdef NEED_PROC_SET_SIZE +#ifdef CONFIG_PROC_FS +#include +static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) +{ + de->size = size; +} +static inline void *PDE_DATA(const struct inode *inode) +{ + return PDE(inode)->data; +} +#else +static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {} +#endif +#endif + +#ifdef NEED_SIMPLE_DEV_PM_OPS +#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ + struct dev_pm_ops name = { \ + .suspend = suspend_fn, \ + .resume = resume_fn, \ + .freeze = suspend_fn, \ + .thaw = resume_fn, \ + .poweroff = suspend_fn, \ + .restore = resume_fn, \ + } +#endif + +#ifdef NEED_VM_IOMAP_MEMORY +#include +static inline int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len) +{ + unsigned long vm_len, pfn, pages; + + /* Check that the physical memory area passed in looks valid */ + if (start + len < start) + return -EINVAL; + /* + * You *really* shouldn't map things that aren't page-aligned, + * but we've historically allowed it because IO memory might + * just have smaller alignment. + */ + len += start & ~PAGE_MASK; + pfn = start >> PAGE_SHIFT; + pages = (len + ~PAGE_MASK) >> PAGE_SHIFT; + if (pfn + pages < pfn) + return -EINVAL; + + /* We start the mapping 'vm_pgoff' pages into the area */ + if (vma->vm_pgoff > pages) + return -EINVAL; + pfn += vma->vm_pgoff; + pages -= vma->vm_pgoff; + + /* Can we fit all of the mapping? */ + vm_len = vma->vm_end - vma->vm_start; + if (vm_len >> PAGE_SHIFT > pages) + return -EINVAL; + + /* Ok, let it rip */ + return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot); +} +#endif + +#ifdef NEED_DEVICE_LOCK +#include +static inline void device_lock(struct device *dev) +{ + down(&dev->sem); +} + +static inline int device_trylock(struct device *dev) +{ + return down_trylock(&dev->sem); +} + +static inline void device_unlock(struct device *dev) +{ + up(&dev->sem); +} +#endif + +#ifdef NEED_PTR_ERR_OR_ZERO +static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) +{ + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + else + return 0; +} +#endif + +#ifdef NEED_SG_ALLOC_TABLE_FROM_PAGES +#include +/** + * sg_alloc_table_from_pages - Allocate and initialize an sg table from + * an array of pages + * @sgt: The sg table header to use + * @pages: Pointer to an array of page pointers + * @n_pages: Number of pages in the pages array + * @offset: Offset from start of the first page to the start of a buffer + * @size: Number of valid bytes in the buffer (after offset) + * @gfp_mask: GFP allocation mask + * + * Description: + * Allocate and initialize an sg table from a list of pages. Contiguous + * ranges of the pages are squashed into a single scatterlist node. A user + * may provide an offset at a start and a size of valid data in a buffer + * specified by the page array. The returned sg table is released by + * sg_free_table. + * + * Returns: + * 0 on success, negative error on failure + */ +static inline int sg_alloc_table_from_pages(struct sg_table *sgt, + struct page **pages, unsigned int n_pages, + unsigned long offset, unsigned long size, + gfp_t gfp_mask) +{ + unsigned int chunks; + unsigned int i; + unsigned int cur_page; + int ret; + struct scatterlist *s; + + /* compute number of contiguous chunks */ + chunks = 1; + for (i = 1; i < n_pages; ++i) + if (page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1) + ++chunks; + + ret = sg_alloc_table(sgt, chunks, gfp_mask); + if (unlikely(ret)) + return ret; + + /* merging chunks and putting them into the scatterlist */ + cur_page = 0; + for_each_sg(sgt->sgl, s, sgt->orig_nents, i) { + unsigned long chunk_size; + unsigned int j; + + /* look for the end of the current chunk */ + for (j = cur_page + 1; j < n_pages; ++j) + if (page_to_pfn(pages[j]) != + page_to_pfn(pages[j - 1]) + 1) + break; + + chunk_size = ((j - cur_page) << PAGE_SHIFT) - offset; + sg_set_page(s, pages[cur_page], min(size, chunk_size), offset); + size -= chunk_size; + offset = 0; + cur_page = j; + } + + return 0; +} +#endif + +#ifdef NEED_REPLACE_FOPS +#define replace_fops(f, fops) \ + do { \ + struct file *__file = (f); \ + fops_put(__file->f_op); \ + BUG_ON(!(__file->f_op = (fops))); \ + } while(0) +#endif + +#ifdef NEED_REINIT_COMPLETION +#include +static inline void reinit_completion(struct completion *x) +{ + x->done = 0; +} +#endif + +#ifdef NEED_DMA_SET_MASK_AND_COHERENT +#include + +#ifdef NEED_DMA_SET_COHERENT_MASK +static inline int dma_set_coherent_mask(struct device *dev, u64 mask) +{ + if (!dma_supported(dev, mask)) + return -EIO; + dev->coherent_dma_mask = mask; + return 0; +} +#endif + +static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) +{ + int rc = dma_set_mask(dev, mask); + if (rc == 0) + dma_set_coherent_mask(dev, mask); + return rc; +} +#endif + +#ifdef NEED_BITMAP_CLEAR + +#include + +#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) + +static inline void bitmap_set(unsigned long *map, int start, int nr) +{ + unsigned long *p = map + BIT_WORD(start); + const int size = start + nr; + int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); + + while (nr - bits_to_set >= 0) { + *p |= mask_to_set; + nr -= bits_to_set; + bits_to_set = BITS_PER_LONG; + mask_to_set = ~0UL; + p++; + } + if (nr) { + mask_to_set &= BITMAP_LAST_WORD_MASK(size); + *p |= mask_to_set; + } +} + +static inline void bitmap_clear(unsigned long *map, int start, int nr) +{ + unsigned long *p = map + BIT_WORD(start); + const int size = start + nr; + int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); + + while (nr - bits_to_clear >= 0) { + *p &= ~mask_to_clear; + nr -= bits_to_clear; + bits_to_clear = BITS_PER_LONG; + mask_to_clear = ~0UL; + p++; + } + if (nr) { + mask_to_clear &= BITMAP_LAST_WORD_MASK(size); + *p &= ~mask_to_clear; + } +} +#endif + +#ifdef NEED_DEVM_KMALLOC +#define devm_kmalloc devm_kzalloc +#endif + +#ifdef NEED_USB_SPEED_STRING +#include +/* undefine err & dbg since they clash with err/dbg defines from drivers. */ +#undef err +#undef dbg +static inline const char *usb_speed_string(enum usb_device_speed speed) +{ + return "UNKNOWN"; +} +#endif + +#ifdef NEED_USB_SPEED_WIRELESS +#define USB_SPEED_WIRELESS USB_SPEED_VARIABLE +#endif + +#ifdef NEED_ETHER_ADDR_EQUAL +static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) +{ + const u16 *a = (const u16 *)addr1; + const u16 *b = (const u16 *)addr2; + + return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0; +} +#endif + +#ifdef NEED_SND_CARD_NEW +#define snd_card_new(p, idx, id, module, extra_size, ret) \ + snd_card_create(idx, id, module, extra_size, ret) +#endif + +#ifdef NEED_COMPAT_PUT_TIMESPEC +#define compat_put_timespec put_compat_timespec +#endif + +#ifdef NEED_SMP_MB_AFTER_ATOMIC +#define smp_mb__after_atomic smp_mb__after_clear_bit +#endif + +#ifdef NEED_DEVM_KMALLOC_ARRAY +static inline void *devm_kmalloc_array(struct device *dev, + size_t n, size_t size, gfp_t flags) +{ + if (size != 0 && n > (~(size_t)0) / size) + return NULL; + return devm_kmalloc(dev, n * size, flags); +} +#endif + +#ifdef NEED_DEVM_KCALLOC +#include +static inline void *devm_kcalloc(struct device *dev, + size_t n, size_t size, gfp_t flags) +{ + return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); +} +#endif + +#ifdef NEED_PCI_ZALLOC_CONSISTENT +#include +#include + +static inline void * +pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, + dma_addr_t *dma_handle) +{ + return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, + size, dma_handle, GFP_ATOMIC | __GFP_ZERO); +} +#endif + +#ifdef NEED_KREF_GET_UNLESS_ZERO +#include +static inline int __must_check kref_get_unless_zero(struct kref *kref) +{ + return atomic_add_unless(&kref->refcount, 1, 0); +} +#endif + +#ifdef NEED_PRANDOM_U32_MAX +#include +#ifdef NEED_PRANDOM_U32 +#define prandom_u32 random32 +#endif + +static inline u32 prandom_u32_max(u32 ep_ro) +{ + return (u32)(((u64) prandom_u32() * ep_ro) >> 32); +} +#endif + +#ifdef NEED_GENMASK +#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) +#endif + +#ifdef NEED_MULT_FRAC +#define mult_frac(x, numer, denom)( \ +{ \ + typeof(x) quot = (x) / (denom); \ + typeof(x) rem = (x) % (denom); \ + (quot * (numer)) + ((rem * (numer)) / (denom)); \ +} \ +) +#endif + +#ifdef NEED_CLK_HELPERS +#include +static inline int clk_prepare_enable(struct clk *clk) +{ + int ret; + + ret = clk_prepare(clk); + if (ret) + return ret; + ret = clk_enable(clk); + if (ret) + clk_unprepare(clk); + + return ret; +} + +static inline void clk_disable_unprepare(struct clk *clk) +{ + clk_disable(clk); + clk_unprepare(clk); +} +#endif + +#ifdef NEED_PCM_STOP_XRUN +#include +static inline int snd_pcm_stop_xrun(struct snd_pcm_substream *substream) +{ + unsigned long flags; + int ret = 0; + + snd_pcm_stream_lock_irqsave(substream, flags); + if (snd_pcm_running(substream)) + ret = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stream_unlock_irqrestore(substream, flags); + return ret; +} +#endif + +#ifdef NEED_IS_MODULE +#define IS_MODULE(option) defined(option ## _MODULE) +#endif + +#ifdef NEED_DMA_ATTR_SKIP_CPU_SYNC +/* + * Works fine for Intel architectures, but this can cause + * problems on ARM. + */ +#define DMA_ATTR_SKIP_CPU_SYNC 0 +#endif + +#ifdef NEED_SIGN_EXTEND32 +static inline __s32 sign_extend32(__u32 value, int index) +{ + __u8 shift = 31 - index; + return (__s32)(value << shift) >> shift; +} +#endif + +#ifdef NEED_NETDEV_DBG +#define netdev_dbg(__dev, format, args...) +#endif + +#ifdef NEED_WRITEL_RELAXED +#define writel_relaxed writel +#endif + +#ifdef NEED_GET_USER_PAGES_UNLOCKED +#include +static inline long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + int write, int force, struct page **pages) +{ + long err; + + down_read(&mm->mmap_sem); + err = get_user_pages(tsk, mm, + start, nr_pages, write, force, pages, NULL); + up_read(&mm->mmap_sem); + return err; +} +#endif + +#ifdef NEED_PR_WARN_ONCE +#define pr_warn_once pr_warn +#endif + +#ifdef NEED_DEV_ERR_ONCE +#define dev_err_once dev_err +#endif + +#ifdef NEED_DIV_ROUND_CLOSEST_ULL +#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ +{ \ + typeof(divisor) __d = divisor; \ + unsigned long long _tmp = (x) + (__d) / 2; \ + do_div(_tmp, __d); \ + _tmp; \ +} \ +) +#endif + +#ifdef NEED_PROP_READ_U64_ARRAY +struct device_node; +static inline int of_property_read_u64_array(const struct device_node *np, + const char *propname, + u64 *out_values, size_t sz) +{ + return -ENOSYS; +} +#endif + +#ifdef NEED_MODULE_PNP_DRIVER +#define module_pnp_driver(__pnp_driver) \ + module_driver(__pnp_driver, pnp_register_driver, \ + pnp_unregister_driver) +#endif + +#include +#ifdef NEED_ETH_ZERO_ADDR +static inline void eth_zero_addr(u8 *addr) +{ + memset(addr, 0x00, ETH_ALEN); +} +#endif + +#ifdef NEED_KVFREE +#include +#include +static inline void kvfree(const void *addr) +{ + if (is_vmalloc_addr(addr)) + vfree(addr); + else + kfree(addr); +} +#endif + +#ifdef NEED_FRAME_VECTOR +#include +#include +#include + +/* Container for pinned pfns / pages */ +struct frame_vector { + unsigned int nr_allocated; /* Number of frames we have space for */ + unsigned int nr_frames; /* Number of frames stored in ptrs array */ + bool got_ref; /* Did we pin pages by getting page ref? */ + bool is_pfns; /* Does array contain pages or pfns? */ + void *ptrs[0]; /* Array of pinned pfns / pages. Use + * pfns_vector_pages() or pfns_vector_pfns() + * for access */ +}; + +struct frame_vector *frame_vector_create(unsigned int nr_frames); +void frame_vector_destroy(struct frame_vector *vec); +int get_vaddr_frames(unsigned long start, unsigned int nr_pfns, + bool write, bool force, struct frame_vector *vec); +void put_vaddr_frames(struct frame_vector *vec); +int frame_vector_to_pages(struct frame_vector *vec); +void frame_vector_to_pfns(struct frame_vector *vec); + +static inline unsigned int frame_vector_count(struct frame_vector *vec) +{ + return vec->nr_frames; +} + +static inline struct page **frame_vector_pages(struct frame_vector *vec) +{ + if (vec->is_pfns) { + int err = frame_vector_to_pages(vec); + + if (err) + return ERR_PTR(err); + } + return (struct page **)(vec->ptrs); +} + +static inline unsigned long *frame_vector_pfns(struct frame_vector *vec) +{ + if (!vec->is_pfns) + frame_vector_to_pfns(vec); + return (unsigned long *)(vec->ptrs); +} + +#endif + +#ifdef NEED_KTIME_COMPARE +static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) +{ + if (cmp1.tv64 < cmp2.tv64) + return -1; + if (cmp1.tv64 > cmp2.tv64) + return 1; + return 0; +} +#endif + +#ifdef NEED_KTIME_BEFORE +static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) +{ + return ktime_compare(cmp1, cmp2) < 0; +} +#endif + +#ifdef NEED_KTIME_GET_NS +static inline u64 ktime_get_ns(void) +{ + return ktime_to_ns(ktime_get()); +} +#endif + +#ifdef NEED_OF_NODE_FULL_NAME +#ifdef CONFIG_OF +static inline const char *of_node_full_name(const struct device_node *np) +{ + return np ? np->full_name : ""; +} +#else +static inline const char* of_node_full_name(const struct device_node *np) +{ + return ""; +} +#endif +#elif LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) +#include +#define of_node_full_name(p) of_node_full_name((struct device_node *)(p)) +#endif + +#ifdef NEED_DIV64_U64_REM +#include + +#if BITS_PER_LONG == 64 +static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) +{ + *remainder = dividend % divisor; + return dividend / divisor; +} +#elif BITS_PER_LONG == 32 +static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) +{ + u32 high = divisor >> 32; + u64 quot; + + if (high == 0) { + u32 rem32; + quot = div_u64_rem(dividend, divisor, &rem32); + *remainder = rem32; + } else { + int n = 1 + fls(high); + quot = div_u64(dividend >> n, divisor >> n); + + if (quot != 0) + quot--; + + *remainder = dividend - quot * divisor; + if (*remainder >= divisor) { + quot++; + *remainder -= divisor; + } + } + + return quot; +} +#endif +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) +#ifdef NEED_LED_SET_BRIGHTNESS +#include +void led_trigger_remove(struct led_classdev *led_cdev); +static inline int led_set_brightness_sync(struct led_classdev *led_cdev, + enum led_brightness value) +{ + int ret = 0; + + led_cdev->brightness = min(value, led_cdev->max_brightness); + + if (!(led_cdev->flags & LED_SUSPENDED)) + ret = led_cdev->brightness_set_sync(led_cdev, + led_cdev->brightness); + return ret; +} +#endif +#endif + +#ifdef NEED_GENMASK_ULL +#define BITS_PER_LONG_LONG 64 +#define GENMASK_ULL(h, l) \ + (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) +#endif + +#ifdef NEED_IDA_SIMPLE_REMOVE +#define ida_simple_remove ida_remove +#endif + +#ifdef NEED_KTIME_GET_BOOTTIME +#define ktime_get_boottime ktime_get +#endif + +#ifdef NEED_BUS_CEC +#define BUS_CEC 0x1E +/* Diagonal movement keys */ +#define KEY_RIGHT_UP 0x266 +#define KEY_RIGHT_DOWN 0x267 +#define KEY_LEFT_UP 0x268 +#define KEY_LEFT_DOWN 0x269 + +#define KEY_ROOT_MENU 0x26a /* Show Device's Root Menu */ +/* Show Top Menu of the Media (e.g. DVD) */ +#define KEY_MEDIA_TOP_MENU 0x26b +#define KEY_NUMERIC_11 0x26c +#define KEY_NUMERIC_12 0x26d +/* + * Toggle Audio Description: refers to an audio service that helps blind and + * visually impaired consumers understand the action in a program. Note: in + * some countries this is referred to as "Video Description". + */ +#define KEY_AUDIO_DESC 0x26e +#define KEY_3D_MODE 0x26f +#define KEY_NEXT_FAVORITE 0x270 +#define KEY_STOP_RECORD 0x271 +#define KEY_PAUSE_RECORD 0x272 +#define KEY_VOD 0x273 /* Video on Demand */ +#define KEY_UNMUTE 0x274 +#define KEY_FASTREVERSE 0x275 +#define KEY_SLOWREVERSE 0x276 +/* + * Control a data application associated with the currently viewed channel, + * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.) + */ +#define KEY_DATA 0x275 +#endif + +#ifdef NEED_KTIME_MS_DELTA +static inline s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier) +{ + return ktime_to_ms(ktime_sub(later, earlier)); +} +#endif + +#ifdef NEED_SMP_LOAD_ACQUIRE +#define smp_load_acquire(p) (*(p)) +#define smp_store_release(p, a) (*p) = (a) +#endif + +#define SERIO_PULSE8_CEC 0x40 +#define SERIO_RAINSHADOW_CEC 0x41 + +#ifdef NEED_KTHREAD_INIT_WORKER +#define __kthread_init_worker __init_kthread_worker +#define kthread_init_worker init_kthread_worker +#define kthread_init_work init_kthread_work +#define kthread_insert_work insert_kthread_work +#define kthread_queue_work queue_kthread_work +#define kthread_flush_work flush_kthread_work +#define kthread_flush_worker flush_kthread_worker +#endif + +#ifdef NEED_PRINT_HEX_DUMP_DEBUG +#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) \ + print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) +#endif + +#ifdef NEED_MIN3 +#define min3(x, y, z) min((typeof(x))min(x, y), z) +#define max3(x, y, z) max((typeof(x))max(x, y), z) +#endif + +#ifdef NEED_RCU_POINTER_HANDOFF +#define rcu_pointer_handoff(p) (p) +#endif + +#ifdef NEED_REGMAP_READ_POLL_TIMEOUT +#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ +({ \ + ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ + int pollret; \ + might_sleep_if(sleep_us); \ + for (;;) { \ + pollret = regmap_read((map), (addr), &(val)); \ + if (pollret) \ + break; \ + if (cond) \ + break; \ + if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ + pollret = regmap_read((map), (addr), &(val)); \ + break; \ + } \ + if (sleep_us) \ + usleep_range((sleep_us >> 2) + 1, sleep_us); \ + } \ + pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ +}) +#endif + +#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) + +#define BIT_ULL(nr) (1ULL << (nr)) +#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) +#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) + +#ifdef NEED_DMA_COERCE_MASK +#include +static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) +{ + dev->dma_mask = &dev->coherent_dma_mask; + return dma_set_mask_and_coherent(dev, mask); +} +#endif + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 10, 0) +#include +#define snd_pcm_set_ops(pcm, dir, ops) snd_pcm_set_ops(pcm, dir, (struct snd_pcm_ops *)(ops)) +#endif + +#ifdef NEED_CDEV_DEVICE +#include + +static inline void cdev_set_parent(struct cdev *p, struct kobject *kobj) +{ + WARN_ON(!kobj->state_initialized); + p->kobj.parent = kobj; +} + +static inline int cdev_device_add(struct cdev *cdev, struct device *dev) +{ + int rc = 0; + + if (dev->devt) { + cdev_set_parent(cdev, &dev->kobj); + + rc = cdev_add(cdev, dev->devt, 1); + if (rc) + return rc; + } + + rc = device_add(dev); + if (rc) + cdev_del(cdev); + + return rc; +} + +static inline void cdev_device_del(struct cdev *cdev, struct device *dev) +{ + device_del(dev); + if (dev->devt) + cdev_del(cdev); +} +#endif + +#ifdef NEED_MODULE_PARAM_HW +#include +#define module_param_hw(n, t, hwtype, p) module_param(n, t, p) +#define module_param_hw_named(n, v, t, hwtype, p) module_param_named(n, v, t, p) +#define module_param_hw_array(n, t, hwtype, m, p) module_param_array(n, t, m, p) +#endif + +#ifdef NEED_FWNODE + +/* Minimum stuff for drivers to build without OF support */ +#define of_fwnode_handle(node) NULL + +struct fwnode_endpoint { + unsigned int port; + unsigned int id; + const struct fwnode_handle *local_fwnode; +}; + +static inline struct fwnode_handle *fwnode_get_parent(struct fwnode_handle *fwnode) +{ + return NULL; +} + +static inline struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode) +{ + return NULL; +} + +static inline struct fwnode_handle *fwnode_graph_get_next_endpoint( + struct fwnode_handle *fwnode, struct fwnode_handle *prev) +{ + return NULL; +} + +static inline struct fwnode_handle * +fwnode_graph_get_remote_endpoint(struct fwnode_handle *fwnode) +{ + return NULL; +} + +static inline struct fwnode_handle *dev_fwnode(struct device *dev) +{ + return NULL; +} + +static inline int fwnode_graph_parse_endpoint(struct fwnode_handle *fwnode, + struct fwnode_endpoint *endpoint) +{ + return 0; +} + +static inline void fwnode_handle_get(struct fwnode_handle *fwnode) +{ +} + +static inline void fwnode_handle_put(struct fwnode_handle *fwnode) +{ +} + +#endif + +#ifdef NEED_TO_OF_NODE +static inline struct device_node *to_of_node(struct fwnode_handle *fwnode) +{ + return NULL; +} +#endif + +#ifdef NEED_IS_OF_NODE +static inline bool is_of_node(struct fwnode_handle *fwnode) +{ + return false; +} +#endif + +#ifdef NEED_SKB_PUT_DATA +static inline void *skb_put_data(struct sk_buff *skb, const void *data, + unsigned int len) +{ + void *tmp = skb_put(skb, len); + + memcpy(tmp, data, len); + + return tmp; +} +#endif + +#ifdef NEED_PM_RUNTIME_GET +static inline int pm_runtime_get_if_in_use(struct device *dev) +{ + unsigned long flags; + int retval; + + spin_lock_irqsave(&dev->power.lock, flags); + retval = dev->power.disable_depth > 0 ? -EINVAL : + dev->power.runtime_status == RPM_ACTIVE + && atomic_inc_not_zero(&dev->power.usage_count); + spin_unlock_irqrestore(&dev->power.lock, flags); + return retval; +} +#endif + +#ifdef NEED_KEY_APPSELECT +#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ +#endif + +#ifndef __GFP_RETRY_MAYFAIL +#define __GFP_RETRY_MAYFAIL __GFP_REPEAT +#endif + +#ifdef NEED_PCI_DEVICE_SUB +#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ + .vendor = (vend), .device = (dev), \ + .subvendor = (subvend), .subdevice = (subdev) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) + +#include + +/* + * copied from kernel/time/time.c + */ +static inline u64 nsecs_to_jiffies64_static(u64 n) +{ +#if (NSEC_PER_SEC % HZ) == 0 + /* Common case, HZ = 100, 128, 200, 250, 256, 500, 512, 1000 etc. */ + return div_u64(n, NSEC_PER_SEC / HZ); +#elif (HZ % 512) == 0 + /* overflow after 292 years if HZ = 1024 */ + return div_u64(n * HZ / 512, NSEC_PER_SEC / 512); +#else + /* + * Generic case - optimized for cases where HZ is a multiple of 3. + * overflow after 64.99 years, exact for HZ = 60, 72, 90, 120 etc. + */ + return div_u64(n * 9, (9ull * NSEC_PER_SEC + HZ / 2) / HZ); +#endif +} + +static inline unsigned long nsecs_to_jiffies_static(u64 n) +{ + return (unsigned long)nsecs_to_jiffies64_static(n); +} + +/* + * linux/jiffies.h defines nsecs_to_jiffies64 and nsecs_to_jiffies + * as externals. To get rid of the compiler error, we redefine the + * functions to the static variant just defined above. + */ +#define nsecs_to_jiffies64(_n) nsecs_to_jiffies64_static(_n) +#define nsecs_to_jiffies(_n) nsecs_to_jiffies_static(_n) + +#endif + +#ifdef NEED_U32_MAX +#define U32_MAX ((u32)~0U) +#endif + +#ifdef NEED_BSEARCH +static inline void *bsearch(const void *key, const void *base, size_t num, size_t size, + int (*cmp)(const void *key, const void *elt)) +{ + const char *pivot; + int result; + + while (num > 0) { + pivot = base + (num >> 1) * size; + result = cmp(key, pivot); + + if (result == 0) + return (void *)pivot; + + if (result > 0) { + base = pivot + size; + num--; + } + num >>= 1; + } + + return NULL; +} +#endif + +#ifdef NEED_SETUP_TIMER +#define __setup_timer(_timer, _fn, _data, _flags) \ + do { \ + init_timer(_timer); \ + (_timer)->function = (_fn); \ + (_timer)->data = (_data); \ + } while (0) +#endif + +#ifdef NEED_TIMER_SETUP +#define TIMER_DATA_TYPE unsigned long +#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) + +static inline void timer_setup(struct timer_list *timer, + void (*callback)(struct timer_list *), + unsigned int flags) +{ + __setup_timer(timer, (TIMER_FUNC_TYPE)callback, + (TIMER_DATA_TYPE)timer, flags); +} + +#define from_timer(var, callback_timer, timer_fieldname) \ + container_of(callback_timer, typeof(*var), timer_fieldname) + +#endif + +#ifdef NEED_FWNODE_REF_ARGS +#define NR_FWNODE_REFERENCE_ARGS 8 +struct fwnode_handle; +struct fwnode_reference_args { + struct fwnode_handle *fwnode; + unsigned int nargs; + unsigned int args[NR_FWNODE_REFERENCE_ARGS]; +}; + +static inline int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, + const char *prop, const char *nargs_prop, + unsigned int nargs, unsigned int index, + struct fwnode_reference_args *args) +{ + return -ENOENT; +} +#endif + +#ifdef NEED_FWNODE_FOR_EACH_CHILD_NODE +static inline struct fwnode_handle * +fwnode_get_next_child_node(struct fwnode_handle *fwnode, + struct fwnode_handle *child) +{ + return NULL; +} + +#define fwnode_for_each_child_node(fwnode, child) \ + for (child = fwnode_get_next_child_node(fwnode, NULL); child; \ + child = fwnode_get_next_child_node(fwnode, child)) + +static inline struct fwnode_handle * +fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode) +{ + return NULL; +} +#endif + +#ifdef NEED_FWNODE_GRAPH_GET_PORT_PARENT +static inline struct fwnode_handle * +fwnode_graph_get_port_parent(const struct fwnode_handle *fwnode) +{ + return NULL; +} +static inline bool fwnode_device_is_available(struct fwnode_handle *fwnode) +{ + return false; +} +#endif + +#ifdef NEED_TIMER_SETUP_ON_STACK +#define timer_setup_on_stack(timer, callback, flags) \ + setup_timer_on_stack((timer), (TIMER_FUNC_TYPE)(callback), (flags)) +#endif + +#ifdef NEED_TIME64_TO_TM +#define time64_to_tm(totalsecs, offset, result) time_to_tm((time_t)totalsecs, offset, result) +#endif + +#ifdef NEED_READ_ONCE +#define READ_ONCE(x) ACCESS_ONCE(x) +#endif + +#ifdef NEED_USB_EP_CHECK +static inline int usb_urb_ep_type_check(void *urb) +{ + /* This is for security. Backward compat may survive without that */ + return 0; +} +#endif + +/* prototype of get_user_pages changed in Kernel 4.9. For older Kernels + * this will not compile */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) +#ifdef NEED_GET_USER_PAGES_LONGTERM +#include +static inline long get_user_pages_longterm(unsigned long start, + unsigned long nr_pages, unsigned int gup_flags, + struct page **pages, struct vm_area_struct **vmas) +{ + return get_user_pages(start, nr_pages, gup_flags, pages, vmas); +} +#endif +#endif + +#ifdef NEED_PCI_EXP_DEVCTL2_COMP_TIMEOUT +#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f +#endif + +#ifdef NEED_PFN_TO_PHYS +#include +#define __pfn_to_phys(pfn) PFN_PHYS(pfn) +#endif + +#ifdef NEED_NEXT_PSEUDO_RANDOM32 +static inline u32 next_pseudo_random32(u32 seed) +{ + return seed * 1664525 + 1013904223; +} +#endif + +/* of_property_read_u32_index is available since Kernel 3.10. For older Kernels + * this will not compile */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#ifdef NEED_I2C_NEW_SECONDARY_DEV +#include +static inline struct i2c_client *i2c_new_secondary_device(struct i2c_client *client, + const char *name, + u16 default_addr) +{ + struct device_node *np = client->dev.of_node; + u32 addr = default_addr; + int i; + + if (np) { + i = of_property_match_string(np, "reg-names", name); + if (i >= 0) + of_property_read_u32_index(np, "reg", i, &addr); + } + + dev_dbg(&client->adapter->dev, "Address for %s : 0x%x\n", name, addr); + return i2c_new_dummy(client->adapter, addr); +} +#endif +#endif + +#ifdef NEED_MEMDUP_USER_NUL +static inline void *memdup_user_nul(const void __user *src, size_t len) +{ + char *p; + + /* + * Always use GFP_KERNEL, since copy_from_user() can sleep and + * cause pagefault, which makes it pointless to use GFP_NOFS + * or GFP_ATOMIC. + */ + p = kmalloc_track_caller(len + 1, GFP_KERNEL); + if (!p) + return ERR_PTR(-ENOMEM); + + if (copy_from_user(p, src, len)) { + kfree(p); + return ERR_PTR(-EFAULT); + } + p[len] = '\0'; + + return p; +} +#endif + +#ifdef NEED_KEY_SCREENSAVER +#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ +#endif + +#ifdef NEED_STACK_FRAME_NON_STANDARD +#define STACK_FRAME_NON_STANDARD(func) +#else +/* be sure STACK_FRAME_NON_STANDARD is defined */ +#include +#endif + +#ifdef NEED_PCI_FREE_IRQ_VECTORS +#include +static inline void pci_free_irq_vectors(struct pci_dev *dev) +{ +} +#endif + +#ifdef NEED_PCI_IRQ_VECTOR +#include +static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr) +{ + if (WARN_ON_ONCE(nr > 0)) + return -EINVAL; + return dev->irq; +} +#endif + +#ifdef NEED_U8_MAX +#define U8_MAX ((u8)~0U) +#endif + +#ifdef NEED_KTHREAD_FREEZABLE_SHOULD_STOP +#include +#include +static inline bool kthread_freezable_should_stop(bool *was_frozen) +{ + bool frozen = false; + + might_sleep(); + + if (unlikely(freezing(current))) { + /* __refrigerator is not available for Kernels older than 3.3 + * so we can only sa false */ + frozen = false; + } + + if (was_frozen) + *was_frozen = frozen; + + return kthread_should_stop(); +} +#endif + +#ifdef NEED_VM_FAULT_T +typedef int vm_fault_t; +#endif + +/* header location for of_find_i2c_[device,adapter]_by_node */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) +#include +#include +#endif +#endif + +#ifdef NEED_ARRAY_INDEX_NOSPEC +#define array_index_nospec(index, size) index +#else +/* Some older Kernels got a backport, but we removed the include of + * "linux/nospec.h" with patch "v4.13_remove_nospec_h.patch". Thus + * including it again. + */ +#include +#endif + +#ifdef NEED_LIST_FIRST_ENTRY_OR_NULL +#define list_first_entry_or_null(ptr, type, member) \ + (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) +#endif + +#endif /* _COMPAT_H */ diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/firmware/Makefile media-build-dkms-0005~trusty/media-build-0005/v4l/firmware/Makefile --- media-build-dkms-0004~trusty/media-build-0005/v4l/firmware/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/firmware/Makefile 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,65 @@ +TARGETS = vicam/firmware.fw ttusb-budget/dspbootcode.bin cpia2/stv0672_vp4.bin av7110/bootcode.bin +FW_DIR = $(DESTDIR)/lib/firmware + +#### + +DIRS = $(sort $(dir $(TARGETS))) + +.PHONY = default clean distclean install rminstall prep + +default: $(TARGETS) + +$(TARGETS):: ihex2fw + +clean: + -rm -f ihex2fw + -rm -f $(TARGETS) + +distclean: clean + -for i in $(DIRS); do if [ -d $$i ]; then rm -rf $$i; fi; done + + +install: default + @echo -n "Installing firmwares at $(FW_DIR): " + -@for i in $(DIRS); do if [ ! -d $(FW_DIR)/$$i ]; then mkdir -p $(FW_DIR)/$$i; fi; done + -@for i in $(TARGETS) $(wildcard *.fw*); do echo -n "$$i "; cp $$i $(FW_DIR)/$$i; done + @echo + +rminstall: + @echo "Removing firmwares at $(FW_DIR) " + -for i in $(DIRS); do if [ -d $(FW_DIR)/$$i ]; then rm -rf $(FW_DIR)/$$i; fi; done + +###### + +ihex2fw: ../../linux/firmware/ihex2fw.c + @echo " CC $@" + @gcc -Wall -o $@ $< + +prep: + @for i in $(DIRS); do \ + if [ ! -d $$i ]; then mkdir -p $$i; fi; \ + for j in ../../linux/firmware/$$i/*; do \ + n=`echo $$j | sed s,../../linux/firmware/,,`; \ + if [ ! -e $$n ]; then \ + ln -f $$j $$n; \ + fi; \ + done; done + +%.fw: %.H16 + @echo Generating $@ + @./ihex2fw -w $< $@ + +%.fw: %.HEX + @echo Generating $@ + @./ihex2fw $< $@ + +%.bin: %.bin.ihex + @echo Generating $@ + @objcopy -Iihex -Obinary $< $@ + +# TODO: Use the Firmware Kconfig dependencies +#fw-$(CONFIG_USB_VICAM) += vicam/firmware.fw +#fw-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin +#fw-$(CONFIG_VIDEO_CPIA2) += cpia2/stv0672_vp4.bin +#fw-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin + diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.misc media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.misc --- media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.misc 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.misc 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,16 @@ +# +# Misc strange devices +# +menuconfig MISC_DEVICES + bool "Misc devices" + ---help--- + Say Y here to get to see options for device drivers from various + different categories. This option alone does not add any kernel code. + + If you say N, all options in this submenu will be skipped and disabled. + +if MISC_DEVICES + +source "../linux/drivers/misc/altera-stapl/Kconfig" + +endif # MISC_DEVICES diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.mm media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.mm --- media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.mm 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.mm 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,2 @@ +config FRAME_VECTOR + tristate diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.sound media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.sound --- media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.sound 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.sound 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,44 @@ +menuconfig AUDIO_SUPPORT +bool "Sound card support" + help + Allow to select the Kconfig options found at Kernel's + sound/pci/Kconfig file. + Currently, only snd-bt87x is available on this backport tree. + +if AUDIO_SUPPORT +# This is part of sound/pci/Kconfig +comment "ALSA sound" + +config SND_BT87X + tristate "Bt87x Audio Capture" + depends on SND && PCI + select SND_PCM + help + If you want to record audio from TV cards based on + Brooktree Bt878/Bt879 chips, say Y here and read + . + + To compile this driver as a module, choose M here: the module + will be called snd-bt87x. + +config SND_BT87X_OVERCLOCK + bool "Bt87x Audio overclocking" + depends on SND_BT87X + help + Say Y here if 448000 Hz isn't enough for you and you want to + record from the analog input with up to 1792000 Hz. + + Higher sample rates won't hurt your hardware, but audio + quality may suffer. + +config SND_FM801_TEA575X + tristate "ForteMedia FM801 TEA5757 tuner" + depends on VIDEO_V4L1 && SND_FM801 + + help + Say Y here to include support for soundcards based on the ForteMedia + FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media + Forte SF256-PCS-02) into the snd-fm801 driver. + + This will enable support for the old V4L1 API. +endif diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.staging media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.staging --- media-build-dkms-0004~trusty/media-build-0005/v4l/Kconfig.staging 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Kconfig.staging 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,41 @@ +menuconfig STAGING + bool "Staging drivers" + default n + ---help--- + This option allows you to select a number of drivers that are + not of the "normal" Linux kernel quality level. These drivers + are placed here in order to get a wider audience for use of + them. Please note that these drivers are under heavy + development, may or may not work, and may contain userspace + interfaces that most likely will be changed in the near + future. + + Using any of these drivers will taint your kernel which might + affect support options from both the community, and various + commercial support orginizations. + + If you wish to work on these drivers, to help improve them, or + to report problems you have with them, please see the + driver_name.README file in the drivers/staging/ directory to + see what needs to be worked on, and who to contact. + + If in doubt, say N here. + +if STAGING +menu "Media devices in staging" + +config STAGING_BROKEN + bool "Enable drivers that are known to not compile" + default n + ---help--- + Say N here, except if you will be fixing the drivers + compilation. + +source "../linux/drivers/staging/media/Kconfig" +# Currently, there are no broken staging drivers with Kernel 2.6.31 +# if STAGING_BROKEN +# endif + +endmenu + +endif # STAGING diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile --- media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,470 @@ +ifeq ($(wildcard ../linux/include/uapi/linux/videodev2.h),) + +# No kernel source! User needs to download one +def: + @echo 'No kernel files. You need to run "make download untar" or "make dir DIR=" first!' + exit 1 +endif + +ifeq ($(obj),) +obj = . +endif + +################################################# +# This Makefile is used from two contexts. It is used directly when one runs +# 'make' from the v4l-dvb tree. It used used again when the kernel build +# process includes this file into the kernel Makefile. +ifneq ($(TOPDIR),) +# We are being include from the Kernel +-include $(TOPDIR)/Rules.make +else +# We are running directly, not from the Kernel + +# take version info from last module build if available +# if .version doesn't exist, make will create it for us and restart +-include $(obj)/.version + +ifneq ($(SRCDIR),) + OUTDIR ?= $(SRCDIR) +endif +OUTDIR ?= /lib/modules/$(KERNELRELEASE)/build +SRCDIR ?= /lib/modules/$(KERNELRELEASE)/source +ifeq ($(wildcard $(SRCDIR)/Makefile),) + # No kernel source, but headers should be in OUTDIR + SRCDIR := $(OUTDIR) +endif + +ifneq ($(origin KDIR), undefined) +ifneq ($(KDIR),$(SRCDIR)) +KERNELRELEASE := +override DIR := $(KDIR) +.PHONY: $(obj)/.version +endif +endif + +endif # TOPDIR + +################################################# +# default compilation rule + +default:: prepare + @echo Kernel build directory is $(OUTDIR) + $(MAKE) -C ../linux apply_patches + $(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules + ./scripts/rmmod.pl check +# $(MAKE) checkpatch + +mismatch:: prepare + @echo Kernel build directory is $(OUTDIR) + $(MAKE) -Wfatal-errors -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) CONFIG_DEBUG_SECTION_MISMATCH=y modules + ./scripts/rmmod.pl check + +# Anything in this target shouldn't be build in parallel. +prepare:: config-compat.h Makefile.media links + +################################################# +# Object specific rules + +# Targets which don't need Makefile.media's rules +no-makefile-media-targets := %config clean distclean snapshot snap \ + tarball release %links start insmod load stop rmmod unload reload \ + card% update push %commit help debug cx88-ivtv lxdialog + +# Targets which don't need .myconfig to exist, to keep us from including it +no-dot-config-targets := $(no-makefile-media-targets) %install remove + +dot-config := 1 +ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) + ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) + dot-config := 0 + endif +endif + +makefile-media := 1 +ifneq ($(filter $(no-makefile-media-targets), $(MAKECMDGOALS)),) + ifeq ($(filter-out $(no-makefile-media-targets), $(MAKECMDGOALS)),) + makefile-media := 0 + endif +endif + +makefile-mm := 1 +ifeq ("$(wildcard $(obj)/frame_vector.c)","") + makefile-mm := 0 +endif + +# If version not yet detected, we can't create/have these files yet +ifeq ($(KERNELRELEASE),) + makefile-media := 0 + makefile-mm := 0 + dot-config := 0 +endif + +ifeq ($(dot-config),1) +-include $(obj)/.myconfig +endif + +ifeq ($(makefile-media),1) +-include $(obj)/Makefile.media +-include $(obj)/Makefile.sound +endif +ifeq ($(makefile-mm),1) +-include $(obj)/Makefile.mm +endif + +-include $(obj)/.kconfig.dep + +# make will try to automatically rebuild the Makefile and all includes, +# and if any of them change, make will start over with the updated files + +$(obj)/.myconfig: $(obj)/.config $(obj)/Kconfig + ./scripts/make_myconfig.pl + +# If it doesn't exist, this rule will build Makefile.media. If it does +# exist, it will have dependency information in it, and only be rebuilt +# when necessary. +Makefile.media: + scripts/make_makefile.pl + +################################################# +# CFLAGS configuration + +ifeq ($(CONFIG_DVB_FIRESAT),m) + EXTRA_CFLAGS += -I$(srctree)/drivers/ieee1394/ +endif + +EXTRA_CFLAGS += -g + +EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) + +# Make sure to use the backport header for common stuff +EXTRA_CFLAGS += -include $(obj)/compat.h + +# gives too much warnings (false positives) -> disable it +EXTRA_CFLAGS += -Wno-format-truncation + +################################################# +# Kernel 2.6/3.x specific rules + +ifneq ($(KERNELRELEASE),) + export-objs := + list-multi := +endif + +################################################# +# Directories to be used + +snapshot := $(wildcard $(obj)/.snapshot) +ifneq ($(snapshot),) +SNAPSHOT_CFLAGS := -DSNAPSHOT='$(shell cat $(snapshot))' +EXTRA_CFLAGS += $(SNAPSHOT_CFLAGS) +endif + +PWD := $(shell pwd) +DEST := /lib/modules/$(KERNELRELEASE)/v4l2 +KDIR26 := /lib/modules/$(KERNELRELEASE)/kernel/drivers/media + +################################################# +# Compiler fixup rules + +HOSTCC:=$(CC) +CC += -I$(obj) + +CPPFLAGS := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(CPPFLAGS) -I$(SUBDIRS)/ + +# Needed for kernel 2.6.24 or up +KBUILD_CPPFLAGS := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(KBUILD_CPPFLAGS) -I$(SUBDIRS)/ + +# Needed for kernel 2.6.29 or up +LINUXINCLUDE := -I$(SUBDIRS)/../linux/include -I$(SUBDIRS)/../linux/include/uapi $(LINUXINCLUDE) -I$(SUBDIRS)/ + +MYCFLAGS := + + +################################################# +# which files to install? + +inst-m := $(wildcard *.ko) +ifeq ($(inst-m),) + inst-m := $(obj-m) +endif + +v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) + +################################################# +# locales seem to cause trouble sometimes. +LC_ALL = POSIX +export LC_ALL + + +################################################# +# Generic wildcard rules + +%.asm: %.o + objdump -S $< > $@ + +################################################# +# all file compilation rule + +all:: default + +################################################# +# installation invocation rules +INSTALLDEPS := +ifeq ($(makefile-mm),1) +INSTALLDEPS += mm-install +endif +ifeq ($(makefile-media),1) +INSTALLDEPS += media-install +endif +modules_install install:: $(INSTALLDEPS) + +remove rminstall:: media-rminstall + +################################################# +# Compiling preparation rules + +.PHONY: release +ifneq ($(filter release,$(MAKECMDGOALS)),) +.PHONY: $(obj)/.version +endif +release: + @true + +$(obj)/.version: +ifneq ($(DIR),) + @echo "Searching in $(DIR)/Makefile for kernel version." + @perl \ + -e '$$d="$(DIR)"; ' \ + -e 'S: open IN,"$$d/Makefile"; ' \ + -e 'while () {' \ + -e ' if (/^VERSION\s*=\s*(\d+)/){ $$version=$$1; }' \ + -e ' elsif (/^PATCHLEVEL\s*=\s*(\d+)/){ $$level=$$1; }' \ + -e ' elsif (/^SUBLEVEL\s*=\s*(\d+)/){ $$sublevel=$$1; }' \ + -e ' elsif (/^EXTRAVERSION\s*=\s*(\d+)\n/){ $$extra=".$$1"; }' \ + -e ' elsif (/^EXTRAVERSION\s*=\s*(\S+)\n/){ $$extra=$$1; }' \ + -e ' elsif (/^KERNELSRC\s*:=\s*(\S.*)\n/ || /^MAKEARGS\s*:=\s*-C\s*(\S.*)\n/)' \ + -e ' { $$o=$$d; $$d=$$1; goto S; }' \ + -e '};' \ + -e 'printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",' \ + -e ' $$version,$$level,$$sublevel,$$version,$$level,$$sublevel,$$extra);' \ + -e 'print "OUTDIR:=$$o\n" if($$o);' \ + -e 'print "SRCDIR:=$$d\n";' > $(obj)/.version + @cat .version|grep KERNELRELEASE:|sed s,'KERNELRELEASE:=','Forcing compiling to version ', + + @if [ ! -f $(DIR)/scripts/kallsyms ]; then \ + echo "*** Warning: You should configure and build kernel before compiling V4L"; \ + fi +else +ifneq ($(VER),) + @echo "Forcing kernel version to $(VER)." + @echo $(VER)|perl -ne 'if (/^([0-9]*)\.([0-9]*)\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version +else + @echo No version yet, using `uname -r` + @uname -r|perl -ne 'if (/^([0-9]*)\.([0-9]*)\.?([0-9]*)(.*)$$/) { $$ver = $$1; $$patch = $$2; $$sub = $$3; if ($$ver == 2 && $$patch == 6 && $$sub >= 40) { $$ver = 3; $$patch = $$sub - 40; $$sub = 0; }; printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s",$$ver,$$patch,$$sub==""?"0":$$sub,$$_); };' > $(obj)/.version +endif +endif + +links:: + @echo creating symbolic links... + @find ../linux/drivers/media -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. + @find ../linux/sound -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. + @if [ -f ../linux/mm/frame_vector.c ]; then find ../linux/mm -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. ; fi + @find ../linux/drivers/staging -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. + @find ../linux/drivers/misc -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. + +config-compat.h:: $(obj)/.version .myconfig scripts/make_config_compat.pl + [ ! -f "$(obj)/config-mycompat.h" ] && echo "/* empty config-mycompat.h */" > "$(obj)/config-mycompat.h" || true + perl scripts/make_config_compat.pl $(SRCDIR) $(obj)/.myconfig $(obj)/config-compat.h + +kernel-links makelinks:: + cd ..; v4l/scripts/makelinks.sh $(SRCDIR) + + +################################################# +# Cardlist updating rule + +card cardlist cardlists:: + scripts/cardlist + +################################################# +# Cleaning rules + +clean:: + @find . -name '*.c' -type l -exec rm '{}' \; + @find . -name '*.h' -type l -exec rm '{}' \; + -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \ + config-compat.h Module.symvers Module.markers modules.order \ + *.unsigned .*.ko.unsigned.cmd + +distclean:: clean + -rm -f .version .*.o.flags .*.o.d *.mod.gcno Makefile.media \ + Kconfig Kconfig.kern .config .config.cmd .myconfig \ + .kconfig.dep config-mycompat.h + -rm -rf .tmp_versions .tmp*.ver .tmp*.o .*.gcno .cache.mk + -rm -f scripts/lxdialog scripts/kconfig + @find .. -name '*.orig' -exec rm '{}' \; + @find .. -name '*.rej' -exec rm '{}' \; + +################################################# +# Kernel module insert/removal rules + +start insmod load:: + scripts/rmmod.pl load + +stop rmmod unload:: + scripts/rmmod.pl unload + +reload:: + scripts/rmmod.pl reload + +debug:: + scripts/rmmod.pl debug + +################################################# +# Configuration rules + +# Kernel config programs +QCONF := $(OUTDIR)/scripts/kconfig/qconf +GCONF := $(OUTDIR)/scripts/kconfig/gconf +MCONF := $(OUTDIR)/scripts/kconfig/mconf +CONF := $(OUTDIR)/scripts/kconfig/conf + +# lxdialog can be in either scripts/lxdialog or scripts/kconfig/lxdialog +LXDIALOG_DIR := $(shell if [ -d $(OUTDIR)/scripts/kconfig/lxdialog ]; then echo kconfig/ ; fi) +# lxdialog might not be a separate program that needs to be built, check +# for lxdialog/Makefile to find out. +ifneq ($(wildcard $(SRCDIR)/scripts/$(LXDIALOG_DIR)lxdialog/Makefile),) + # lxdialog must be built + LXDIALOG_LNK := $(if $(LXDIALOG_DIR),scripts/kconfig,scripts/lxdialog) + LXDIALOG := $(OUTDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog +endif + +# Ideally, some kind of oldconfig process would be used to update .config +# without destroying the user's configuration. Lacking that, we will +# just touch .config if it already exists, and run make_kconfig if it +# doesn't. +$(obj)/.config: $(obj)/.version + @echo Updating/Creating .config + @if [ -e $(obj)/.config ]; then touch $(obj)/.config ; else \ + $(MAKE) -C ../linux apply_patches; \ + ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR); fi + +$(obj)/Kconfig: $(obj)/.version + @$(MAKE) -C ../linux apply_patches + ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) + +# With make -j, it's possible that both the .config and Kconfig rules +# will run at the same time, running make_kconfig.pl twice. There +# doesn't appear to be any way around this, but it doesn't cause a +# failure. One make_kconfig.pl will just overwrite the other's output. + +xconfig:: $(QCONF) $(obj)/Kconfig + $(QCONF) $(obj)/Kconfig + ./scripts/fix_kconfig.pl + +gconfig:: $(GCONF) $(obj)/Kconfig + $(GCONF) $(obj)/Kconfig + ./scripts/fix_kconfig.pl + +config:: $(CONF) $(obj)/Kconfig + $(CONF) $(obj)/Kconfig + ./scripts/fix_kconfig.pl + +menuconfig:: $(MCONF) lxdialog $(obj)/Kconfig + $(MCONF) $(obj)/Kconfig + ./scripts/fix_kconfig.pl + +allyesconfig allmodconfig:: $(obj)/.version + @$(MAKE) -C ../linux apply_patches + ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) 1 + ./scripts/fix_kconfig.pl + +stagingconfig:: $(obj)/.version + @$(MAKE) -C ../linux apply_patches + ./scripts/make_kconfig.pl $(OUTDIR) $(SRCDIR) 1 1 + ./scripts/fix_kconfig.pl + +# rule to build kernel conf programs +KMAKEVARS := config-targets=1 mixed-targets=0 dot-config=0 SRCDIR=$(SRCDIR) +$(QCONF) $(GCONF) $(MCONF) $(CONF): + $(MAKE) -C $(OUTDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(notdir $@) + +# lxdialog has two parts, a symlink and the actual binary +.PHONY: lxdialog +lxdialog: $(LXDIALOG) $(LXDIALOG_LNK) + +ifdef LXDIALOG +$(LXDIALOG_LNK): + ln -snf $(OUTDIR)/$(LXDIALOG_LNK) $(LXDIALOG_LNK) + +$(LXDIALOG): + $(MAKE) -C $(SRCDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(LXDIALOG) +endif + +cx88-ivtv:: + @echo creating cx88-ivtv symbolic links... + @ln -sf ../v4l_experimental/cx88-ivtv.c . + +################################################# +# Old instalation rule + +old-install:: rminstall + @echo -e "\nInstalling new V4L modules at $(DEST)..." + + @strip --strip-debug $(inst-m) + + -install -d $(DEST) + -install -m 644 -c $(inst-m) $(DEST) + + /sbin/depmod -a ${KERNELRELEASE} + +################################################# +# Tree management rules + +update:: + make -C .. update + +commit cvscommit hgcommit:: + make -C .. commit + +push:: + make -C .. push + +################################################# +# Consistency checks +checkemacs:: + scripts/check.pl + +checketerse:: + scripts/check.pl -t + +checkpatch:: + scripts/check.pl -c + +################################################# +# Help +help:: + @cat ../INSTALL + +################################################# +# build tarballs rules + +RPWD := $(shell cd .. && pwd) +thisdir := $(notdir $(RPWD)) +name := v4l-dvb +date := $(shell date +%Y%m%d) +tardest ?= . + +snapdir := $(HOME)/snapshot +snap := $(name) + +snapshot snap tarball:: update distclean + echo $(thisdir) + echo $(name) + echo $(date) > .snapshot + (cd ..; tar czf $(snapdir)/$(snap)-$(date).tar.gz .) + hg history --style scripts/map-changelog > /$(snapdir)/$(snap)-ChangeLog-$(date) + $(MAKE) -C $(snapdir) + +dir download apply-patches unapply-patches untar:: + make -C ../linux $@ diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.kernel media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.kernel --- media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.kernel 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.kernel 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,47 @@ +# This Makefile is used to build sources that are part of the kernel tree. +# What we want are the various programs used by the kconfig system. We can't +# just directly call the top-level kernel Makefile, as it doesn't provide +# targets to only build the kconfig system. It provides targets to build +# the kconfig system *and then configure the kernel*. + +# What we do is include the top-level kernel Makefile here, to get all the +# variables and rules it defines, and then add our own targets to just build +# the kconfig system. You can think of this file as a modified version of the +# top-level kernel Makefile that has "kconfig build only" targets added to it. +# Each of these new targets has the prefix v4l- so it doesn't conflict with +# any targets in the kernel Makefile. + +# Like the kernel Makefile, this Makefile should have the cwd be the root +# of the kernel source. + +# These should be defined on the command line, to override the kernel Makefile +# config-targets := 1 +# mixed-targets := 0 +# dot-config := 0 + +KBUILD_SRC := $(SRCDIR) +include $(SRCDIR)/Makefile + +# Used by the config target +v4l-conf: scripts_basic + $(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf + +# Used by the xconfig target +v4l-qconf: scripts_basic + $(MAKE) $(build)=scripts/kconfig qconf-target=1 scripts/kconfig/qconf + +# Used by the qconfig target +v4l-gconf: scripts_basic + $(MAKE) $(build)=scripts/kconfig gconf-target=1 scripts/kconfig/gconf + +# Used by the menuconfig target, also needs lxdialog +v4l-mconf: scripts_basic + $(MAKE) $(build)=scripts/kconfig hostprogs-y=mconf scripts/kconfig/mconf + +# Rule used for kernel where lxdialog is in directory scripts/lxdialog +v4l-%/scripts/lxdialog/lxdialog: scripts_basic + $(MAKE) $(build)=scripts/lxdialog + +# Rule used for kernel where lxdialog is in directory scripts/kconfig/lxdialog +v4l-%/scripts/kconfig/lxdialog/lxdialog: scripts_basic + $(MAKE) $(build)=scripts/kconfig/lxdialog diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.mm media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.mm --- media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.mm 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.mm 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,14 @@ +# From mm/Makefile + +obj-$(CONFIG_FRAME_VECTOR) += frame_vector.o + +KDIRA := /lib/modules/$(KERNELRELEASE)/kernel + +mm-install install-mm:: + @dir="mm"; \ + files='frame_vector.ko'; \ + if [ -f $$files ]; then \ + echo -e "\nInstalling $(KDIRA)/$$dir files:"; \ + install -d $(KDIRA)/$$dir; \ + for i in $$files;do if [ -e $$i ]; then echo -n "$$i "; \ + install -m 644 -c $$i $(KDIRA)/$$dir; fi; done; echo; fi diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.sound media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.sound --- media-build-dkms-0004~trusty/media-build-0005/v4l/Makefile.sound 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/Makefile.sound 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,15 @@ +# From sound/pci/Makefile + +snd-bt87x-objs := bt87x.o +obj-$(CONFIG_SND_BT87X) += snd-bt87x.o + +KDIRA := /lib/modules/$(KERNELRELEASE)/kernel + + +sound-install install-sound:: + @dir="sound/pci"; \ + files='snd-bt87x.ko'; \ + echo -e "\nInstalling $(KDIRA)/$$dir files:"; \ + install -d $(KDIRA)/$$dir; \ + for i in $$files;do if [ -e $$i ]; then echo -n "$$i "; \ + install -m 644 -c $$i $(KDIRA)/$$dir; fi; done; echo; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/obsolete.txt media-build-dkms-0005~trusty/media-build-0005/v4l/obsolete.txt --- media-build-dkms-0004~trusty/media-build-0005/v4l/obsolete.txt 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/obsolete.txt 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,371 @@ +# for kernel 3.7 - patches obsoleted due to path renames + +common/saa7146 +common/saa7146_vv +common/tuners/fc0011 +common/tuners/fc0012 +common/tuners/fc0013 +common/tuners/max2165 +common/tuners/mc44s803 +common/tuners/mt2060 +common/tuners/mt2063 +common/tuners/mt20xx +common/tuners/mt2131 +common/tuners/mt2266 +common/tuners/mxl5005s +common/tuners/mxl5007t +common/tuners/qt1010 +common/tuners/tda18212 +common/tuners/tda18218 +common/tuners/tda18271 +common/tuners/tda827x +common/tuners/tda8290 +common/tuners/tda9887 +common/tuners/tea5761 +common/tuners/tea5767 +common/tuners/tua9001 +common/tuners/tuner-simple +common/tuners/tuner-types +common/tuners/tuner-xc2028 +common/tuners/xc4000 +common/tuners/xc5000 +dvb/b2c2/b2c2-flexcop +dvb/b2c2/b2c2-flexcop-pci +dvb/b2c2/b2c2-flexcop-usb +dvb/bt8xx/bt878 +dvb/bt8xx/dst +dvb/bt8xx/dst_ca +dvb/bt8xx/dvb-bt8xx +dvb/ddbridge/ddbridge +dvb/dm1105/dm1105 +dvb/dvb-core/dvb-core +dvb/dvb-usb/dvb-usb +dvb/dvb-usb/dvb-usb-a800 +dvb/dvb-usb/dvb-usb-af9005 +dvb/dvb-usb/dvb-usb-af9005-remote +dvb/dvb-usb/dvb-usb-af9015 +dvb/dvb-usb/dvb-usb-af9035 +dvb/dvb-usb/dvb-usb-anysee +dvb/dvb-usb/dvb-usb-au6610 +dvb/dvb-usb/dvb-usb-az6007 +dvb/dvb-usb/dvb-usb-az6027 +dvb/dvb-usb/dvb-usb-ce6230 +dvb/dvb-usb/dvb-usb-cinergyT2 +dvb/dvb-usb/dvb-usb-cxusb +dvb/dvb-usb/dvb-usb-dib0700 +dvb/dvb-usb/dvb-usb-dibusb-common +dvb/dvb-usb/dvb-usb-dibusb-mb +dvb/dvb-usb/dvb-usb-dibusb-mc +dvb/dvb-usb/dvb-usb-digitv +dvb/dvb-usb/dvb-usb-dtt200u +dvb/dvb-usb/dvb-usb-dtv5100 +dvb/dvb-usb/dvb-usb-dw2102 +dvb/dvb-usb/dvb-usb-ec168 +dvb/dvb-usb/dvb-usb-friio +dvb/dvb-usb/dvb-usb-gl861 +dvb/dvb-usb/dvb-usb-gp8psk +dvb/dvb-usb/dvb-usb-it913x +dvb/dvb-usb/dvb-usb-lmedm04 +dvb/dvb-usb/dvb-usb-m920x +dvb/dvb-usb/dvb-usb-mxl111sf +dvb/dvb-usb/dvb-usb-nova-t-usb2 +dvb/dvb-usb/dvb-usb-opera +dvb/dvb-usb/dvb-usb-pctv452e +dvb/dvb-usb/dvb-usb-rtl28xxu +dvb/dvb-usb/dvb-usb-technisat-usb2 +dvb/dvb-usb/dvb-usb-ttusb2 +dvb/dvb-usb/dvb-usb-umt-010 +dvb/dvb-usb/dvb-usb-vp702x +dvb/dvb-usb/dvb-usb-vp7045 +dvb/dvb-usb/mxl111sf-demod +dvb/dvb-usb/mxl111sf-tuner +dvb/firewire/firedtv +dvb/frontends/a8293 +dvb/frontends/af9013 +dvb/frontends/af9033 +dvb/frontends/atbm8830 +dvb/frontends/au8522_common +dvb/frontends/au8522_decoder +dvb/frontends/au8522_dig +dvb/frontends/bcm3510 +dvb/frontends/cx22700 +dvb/frontends/cx22702 +dvb/frontends/cx24110 +dvb/frontends/cx24113 +dvb/frontends/cx24116 +dvb/frontends/cx24123 +dvb/frontends/cxd2820r +dvb/frontends/dib0070 +dvb/frontends/dib0090 +dvb/frontends/dib3000mb +dvb/frontends/dib3000mc +dvb/frontends/dib7000m +dvb/frontends/dib7000p +dvb/frontends/dib8000 +dvb/frontends/dib9000 +dvb/frontends/dibx000_common +dvb/frontends/drxd +dvb/frontends/drxk +dvb/frontends/ds3000 +dvb/frontends/dvb_dummy_fe +dvb/frontends/dvb-pll +dvb/frontends/ec100 +dvb/frontends/hd29l2 +dvb/frontends/isl6405 +dvb/frontends/isl6421 +dvb/frontends/isl6423 +dvb/frontends/it913x-fe +dvb/frontends/itd1000 +dvb/frontends/ix2505v +dvb/frontends/l64781 +dvb/frontends/lg2160 +dvb/frontends/lgdt3305 +dvb/frontends/lgdt330x +dvb/frontends/lgs8gl5 +dvb/frontends/lgs8gxx +dvb/frontends/lnbp21 +dvb/frontends/lnbp22 +dvb/frontends/m88rs2000 +dvb/frontends/mb86a16 +dvb/frontends/mb86a20s +dvb/frontends/mt312 +dvb/frontends/mt352 +dvb/frontends/nxt200x +dvb/frontends/nxt6000 +dvb/frontends/or51132 +dvb/frontends/or51211 +dvb/frontends/rtl2830 +dvb/frontends/rtl2832 +dvb/frontends/s5h1409 +dvb/frontends/s5h1411 +dvb/frontends/s5h1420 +dvb/frontends/s5h1432 +dvb/frontends/s921 +dvb/frontends/si21xx +dvb/frontends/sp8870 +dvb/frontends/sp887x +dvb/frontends/stb0899 +dvb/frontends/stb6000 +dvb/frontends/stb6100 +dvb/frontends/stv0288 +dvb/frontends/stv0297 +dvb/frontends/stv0299 +dvb/frontends/stv0367 +dvb/frontends/stv0900 +dvb/frontends/stv090x +dvb/frontends/stv6110 +dvb/frontends/stv6110x +dvb/frontends/tda10021 +dvb/frontends/tda10023 +dvb/frontends/tda10048 +dvb/frontends/tda1004x +dvb/frontends/tda10071 +dvb/frontends/tda10086 +dvb/frontends/tda18271c2dd +dvb/frontends/tda665x +dvb/frontends/tda8083 +dvb/frontends/tda8261 +dvb/frontends/tda826x +dvb/frontends/tua6100 +dvb/frontends/ves1820 +dvb/frontends/ves1x93 +dvb/frontends/zl10036 +dvb/frontends/zl10039 +dvb/frontends/zl10353 +dvb/mantis/hopper +dvb/mantis/mantis +dvb/mantis/mantis_core +dvb/ngene/ngene +dvb/pluto2/pluto2 +dvb/pt1/earth-pt1 +dvb/siano/smsdvb +dvb/siano/smsmdtv +dvb/siano/smssdio +dvb/siano/smsusb +dvb/ttpci/budget +dvb/ttpci/budget-av +dvb/ttpci/budget-ci +dvb/ttpci/budget-core +dvb/ttpci/budget-patch +dvb/ttpci/dvb-ttpci +dvb/ttpci/ttpci-eeprom +dvb/ttusb-budget/dvb-ttusb-budget +dvb/ttusb-dec/ttusb_dec +dvb/ttusb-dec/ttusbdecfe +video/adv7170 +video/adv7175 +video/adv7180 +video/au0828/au0828 +video/bt819 +video/bt856 +video/bt866 +video/bt8xx/bttv +video/btcx-risc +video/bw-qcam +video/cpia2/cpia2 +video/c-qcam +video/cs5345 +video/cs53l32a +video/cx18/cx18 +video/cx18/cx18-alsa +video/cx231xx/cx231xx +video/cx231xx/cx231xx-alsa +video/cx231xx/cx231xx-dvb +video/cx2341x +video/cx23885/altera-ci +video/cx23885/cx23885 +video/cx25821/cx25821 +video/cx25821/cx25821-alsa +video/cx25840/cx25840 +video/cx88/cx8800 +video/cx88/cx8802 +video/cx88/cx88-alsa +video/cx88/cx88-blackbird +video/cx88/cx88-dvb +video/cx88/cx88-vp3054-i2c +video/cx88/cx88xx +video/em28xx/em28xx +video/em28xx/em28xx-alsa +video/em28xx/em28xx-dvb +video/em28xx/em28xx-rc +video/gspca/gl860/gspca_gl860 +video/gspca/gspca_benq +video/gspca/gspca_conex +video/gspca/gspca_cpia1 +video/gspca/gspca_etoms +video/gspca/gspca_finepix +video/gspca/gspca_jeilinj +video/gspca/gspca_jl2005bcd +video/gspca/gspca_kinect +video/gspca/gspca_konica +video/gspca/gspca_main +video/gspca/gspca_mars +video/gspca/gspca_mr97310a +video/gspca/gspca_nw80x +video/gspca/gspca_ov519 +video/gspca/gspca_ov534 +video/gspca/gspca_ov534_9 +video/gspca/gspca_pac207 +video/gspca/gspca_pac7302 +video/gspca/gspca_pac7311 +video/gspca/gspca_se401 +video/gspca/gspca_sn9c2028 +video/gspca/gspca_sn9c20x +video/gspca/gspca_sonixb +video/gspca/gspca_sonixj +video/gspca/gspca_spca1528 +video/gspca/gspca_spca500 +video/gspca/gspca_spca501 +video/gspca/gspca_spca505 +video/gspca/gspca_spca506 +video/gspca/gspca_spca508 +video/gspca/gspca_spca561 +video/gspca/gspca_sq905 +video/gspca/gspca_sq905c +video/gspca/gspca_sq930x +video/gspca/gspca_stk014 +video/gspca/gspca_stv0680 +video/gspca/gspca_sunplus +video/gspca/gspca_t613 +video/gspca/gspca_topro +video/gspca/gspca_tv8532 +video/gspca/gspca_vc032x +video/gspca/gspca_vicam +video/gspca/gspca_xirlink_cit +video/gspca/gspca_zc3xx +video/gspca/m5602/gspca_m5602 +video/gspca/stv06xx/gspca_stv06xx +video/hdpvr/hdpvr +video/hexium_gemini +video/hexium_orion +video/imx074 +video/ir-kbd-i2c +video/ivtv/ivtv +video/ivtv/ivtvfb +video/ks0127 +video/m52790 +video/marvell-ccic/cafe_ccic +video/mem2mem_testdev +video/meye +video/msp3400 +video/mt9m001 +video/mt9m111 +video/mt9t031 +video/mt9t112 +video/mt9v011 +video/mt9v022 +video/mxb +video/ov2640 +video/ov5642 +video/ov6650 +video/ov7670 +video/ov772x +video/ov9640 +video/ov9740 +video/pms +video/pvrusb2/pvrusb2 +video/pwc/pwc +video/rj54n1cb0c +video/s2255drv +video/saa6588 +video/saa7110 +video/saa7115 +video/saa7127 +video/saa7134/saa6752hs +video/saa7134/saa7134 +video/saa7134/saa7134-alsa +video/saa7134/saa7134-dvb +video/saa7134/saa7134-empress +video/saa7164/saa7164 +video/saa717x +video/saa7185 +video/sn9c102/sn9c102 +video/soc_camera +video/soc_camera_platform +video/soc_mediabus +video/sta2x11_vip +video/stkwebcam +video/tda7432 +video/tda9840 +video/tea6415c +video/tea6420 +video/timblogiw +video/tlg2300/poseidon +video/tm6000/tm6000 +video/tm6000/tm6000-alsa +video/tm6000/tm6000-dvb +video/tuner +video/tvaudio +video/tveeprom +video/tvp5150 +video/tw9910 +video/upd64031a +video/upd64083 +video/usbvision/usbvision +video/uvc/uvcvideo +video/v4l2-common +video/v4l2-int-device +video/v4l2-mem2mem +video/via-camera +video/videobuf2-core +video/videobuf2-dma-contig +video/videobuf2-memops +video/videobuf2-vmalloc +video/videobuf-core +video/videobuf-dma-contig +video/videobuf-dma-sg +video/videobuf-dvb +video/videobuf-vmalloc +video/videodev +video/vivi +video/vp27smpx +video/vpx3220 +video/w9966 +video/wm8739 +video/wm8775 +video/zoran/videocodec +video/zoran/zr36016 +video/zoran/zr36050 +video/zoran/zr36060 +video/zoran/zr36067 +video/zr364xx diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/au0828.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/au0828.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/au0828.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/au0828.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(AU08[\d]._BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # au0828_boards + if (/\[(AU0828_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; + $data{$id}->{type} = "(au0828)"; +# $data{$id}->{nr} = $nr++; + }; + + next unless defined($id); + + if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*)/ ) { + $subvendor=$1; + $subdevice=$2; + } + + if (/.*driver_info.*(AU08[\d]._BOARD_\w+)/ ) { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + } + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # au0828_USB_tbl + + +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-40s %-15s", $data{$item}->{nr}, $data{$item}->{name},$data{$item}->{type}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/bttv.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/bttv.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/bttv.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/bttv.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; +my $pciid=0; + +while (<>) { + # defines in header file + if (/#define\s+(BTTV_BOARD_\w+)\s+0x([0-9a-fA-F]*).*/) { + $data{$1}->{nr} = hex $2; + + next; + } + # cx88_boards + if (/\[(BTTV_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + if (/0x([0-9a-fA-F]...)([0-9a-fA-F]...)/) { + $subvendor = $2; + $subdevice = $1; + if (/(BTTV_BOARD_\w+)/) { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } + + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + if (/0x([0-9]...)([0-9]...)/) { + $subvendor = $1; + $subdevice = $2; + } + +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cardlist media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cardlist --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cardlist 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cardlist 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,28 @@ +#!/bin/sh + +scripts/bttv.pl ../linux/drivers/media/pci/bt8xx/bttv.h ../linux/drivers/media/pci/bt8xx/bttv-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.bttv + +scripts/cx88.pl ../linux/drivers/media/pci/cx88/cx88.h ../linux/drivers/media/pci/cx88/cx88-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx88 + +scripts/em28xx.pl ../linux/drivers/media/usb/em28xx/em28xx-cards.c ../linux/drivers/usb/video/em28xx/em28xx.h \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.em28xx + +scripts/tuner.pl ../linux/include/media/tuner.h ../linux/drivers/media/tuners/tuner-types.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.tuner + +scripts/saa7134.pl ../linux/drivers/media/pci/saa7134/saa7134.h ../linux/drivers/media/pci/saa7134/saa7134-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7134 + +scripts/usbvision.pl ../linux/drivers/media/usb/usbvision/usbvision-cards.h ../linux/drivers/media/usb/usbvision/usbvision-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.usbvision + +scripts/cx23885.pl ../linux/drivers/media/pci/cx23885/cx23885.h ../linux/drivers/media/pci/cx23885/cx23885-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx23885 + +scripts/au0828.pl ../linux/drivers/media/usb/au0828/au0828-cards.h ../linux/drivers/media/usb/au0828/au0828-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.au0828 + +scripts/saa7164.pl ../linux/drivers/media/pci/saa7164/saa7164.h ../linux/drivers/media/pci/saa7164/saa7164-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7164 diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/changelog.tmpl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/changelog.tmpl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/changelog.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/changelog.tmpl 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,5 @@ +User #author# +Date #date|date# +#desc# + +--- diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/check_config_defines.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/check_config_defines.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/check_config_defines.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/check_config_defines.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,70 @@ +#!/usr/bin/perl +# Copyright (C) 2006 Trent Piepho +# +# Look for lines in C files like "#ifdef CONFIG_SOME_KCONF_VAR" and make +# sure CONFIG_SOME_KCONF_VAR is something that exists. + +use strict; + +if($#ARGV < 0) { + print "Usage: $0 kernel_dir [files to check ...]\n\n"; + print "If no files are listed, checks all files from hg manifest\n"; + exit; +} +my $kdir = shift; + +if($#ARGV < 0) { + @ARGV = `hg manifest | cut "-d " -f3 | grep \\.[ch]\$`; + $? != 0 and die "Error getting manifest: $!"; + chomp @ARGV; +} + +my %kconfigs; # List of Kconfig files read in already +my %vars; # List of defined variables +sub readkconfig($$) +{ + my $fn = "$_[0]/$_[1]"; + # Don't read the same kconfig file more than once. This also means + # the drivers/media/Kconfig file from kernel won't be read in addition + # to the one from v4l-dvb. + return if exists $kconfigs{$_[1]}; + $kconfigs{$_[1]} = 1; +# print "Reading $fn\n"; + my $fh; + open $fh, '<', "$fn" or die "Can't read Kconfig file $fn: $!"; + while(<$fh>) { + if (/^\s*source\s+"([^"]+)"\s*$/ || /^\s*source\s+(\S+)\s*$/) { + readkconfig($_[0], $1); + } elsif(/^(?:menu)?config\s+(\w+)$/) { + $vars{"CONFIG_$1"}=1; + } + } + close $fh; +} + +readkconfig('linux', 'drivers/media/Kconfig'); +foreach(glob "$kdir/arch/*/Kconfig") { + s|^\Q$kdir/\E||; + next if(m|arch/um/Kconfig|); + readkconfig($kdir, $_); +} + +while(<>) { + if(/^\s*#ifn?def\s+(CONFIG_\w+?)(:?_MODULE)?\W*$/) { +# print "Found $1\n"; + print "Unknown config $1 in $ARGV:$.\n" unless(exists $vars{$1}); + next; + } + if(/^\s*#if/) { + $_ .= <> while(/\\$/); # Handle line continuations + my $last; + while(/defined\(\s*(CONFIG_\w+?)(_MODULE)?\s*\)/) { + $_ = $'; + next if($last eq $1); + $last = $1; + print "Unknown config $1 in $ARGV:$.\n" unless(exists $vars{$1}); + } + } +} continue { + close ARGV if eof; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/check_deps.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/check_deps.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/check_deps.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/check_deps.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,228 @@ +#!/usr/bin/perl + +# Copyright (C) 2008 Mauro Carvalho Chehab + + +use strict; +use File::Find; +use Fcntl ':mode'; +use FileHandle; + +my $debug=0; + +my $SRC = 'linux'; + +my %export; + +############# +# open_makefile were adapted from analyze_build.pl +# by Copyright (C) 2006 Trent Piepho + +# Print out some extra checks of Makefile correctness +my $check = 0; + +# Root of source tree +my $root; + +# List of Makefile's opened +my %makefiles = (); + +# For each module that is made up of multiple source files, list of sources +my %multi = (); +my $multi_count = 0; + +my %config; + +my %associate; + +sub open_makefile($) { + my $file = shift; + + # only open a given Makefile once + return if exists $makefiles{$file}; + $makefiles{$file} = 1; + + $file =~ m|^(.*)/[^/]*$|; + my $dir = $1; + + print "opening $root$file (dir=$dir)\n" if ($debug > 2); + my $in = new FileHandle; + open $in, '<', "$root$file" or die "Unable to open Makefile '$root$file': $!"; + + while (<$in>) { + # print STDERR "Line: $_"; + # Skip comment and blank lines + next if (/^\s*(#.*)?$/); + m/^\s*\-?include/ and die "Can't handle includes! In $file"; + + # Handle line continuations + if (/\\\n$/) { + $_ .= <$in>; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + # Eat comments + s/#.*$//; + + if (/^\s*obj-(\S+)\s*([:+]?)=\s*(\S.*?)\s*$/) { + print STDERR "Should use '+=' in $file:$.\n$_\n" if ($check && $2 ne '+'); + my ($var,$targets) = ($1, $3); + if ($var =~ /\$\(CONFIG_(\S+)\)$/) { + $var = $1; + } elsif ($var !~ /^[ym]$/) { + print STDERR "Confused by obj assignment '$var' in $file:$.\n$_"; + } + foreach(split(/\s+/, $targets)) { + if (m|/$|) { # Ends in /, means it's a directory + open_makefile("$dir/$_".'Makefile'); + } elsif (/^(\S+)\.o$/) { + $config{"$dir/$1"} = $var; +# printf "%s -> %s\n", $var, $1 if $debug > 1; + } else { + print STDERR "Confused by target '$_' in $file:$.\n"; + } + } + next; + } + if (/(\S+)-objs\s*([:+]?)=\s*(\S.*?)\s*$/) { + my @files = split(/\s+/, $3); + map { s|^(.*)\.o$|$dir/\1| } @files; + if ($2 eq '+') { + # Adding to files + print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); + push @files, @{$multi{"$dir/$1"}}; + } else { + print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); + } + $multi{"$dir/$1"} = \@files; + next; + } + if (/^\s*EXTRA_CFLAGS\s*([:+]?)=\s*(\S.*?)\s*$/) { + if ($check) { + sub allI { /^-I/ or return 0 foreach split(/\s+/, $_[0]);return 1; } + my $use = allI($2) ? ':' : '+'; + print STDERR "Should use '$use=' with EXTRA_CFLAGS in $file:$.\n$_\n" + if ($1 ne $use); + } + next; + } + print STDERR "Odd line $file:$.\n$_\n" if ($check); + } + close IN; +} + +# +############# + +sub associate_multi() +{ + foreach (keys %multi) { + my $name = $_; + my @files = @{$multi{$_}}; + map { s/^(.*)$/\1.c/ } @files; + + foreach (@files) { + my $file = $_; + my $var = $config{$name}; + $associate{$file} = $var; + printf "$var -> $file\n" if $debug > 1; + } + delete $config{$name}; + } + foreach my $file (keys %config) { + my $var = $config{$file}; + $file .= ".c"; + $associate{$file} = $var; + printf "$var -> $file\n" if $debug > 1; + } +} + +sub build_exported_symbol_list { + my $file = $File::Find::name; + + return if (!($file =~ /\.c$/)); + + open IN, $file; + while () { + if (m/EXPORT_SYMBOL.*\(\s*([^\s\)]+)/) { + $export{$1} = $file; + printf "%s -> %s\n", $file , $1 if $debug > 1; + } + } + close IN; +} + + +sub find_usage_list { + my %depend; + my $file = $File::Find::name; + my $s; + + return if (!($file =~ /\.c$/)); + + open IN, $file; + printf "Checking symbols at $file\n" if $debug; + while () { + foreach my $symbol (keys %export) { + my $symb_file = $export{$symbol}; + + # Doesn't search the symbol at the file that defines it + next if ($symb_file eq $file); + + if (m/($symbol)/) { + my $var = $associate{$symb_file}; + if (!$depend{$var}) { + printf "$symbol found at $file. It depends on %s\n", $associate{$symb_file} if $debug; + $depend{$var} = 1; + } + } + } + } + close IN; + + foreach (%depend) { $s .= "$_ && "; }; + $s =~ s/\&\&\ $//; + if ($s ne "") { + print $associate{$file}." depends on $s\n"; + } +} + +print < +This code is licenced under the terms of GPLv2. + +This script seeks all .c files under linux/ for their exported symbols. For +each exported symbol, it will check what Kconfig symbol is associated. Then, it +will cross-check that symbol usage and output a Kconfig depencency table. + +WARNING: The result of this tool should be used just as a hint, since, due to +performance issues, and to simplify the tool, the checks will use a simple grep +for the symbol string at the .c files, instead of a real symbol cross-check. + +Also, the same symbol may appear twice with different dependencies. This is due +to the way it checks for symbols. The final dependency is the union (AND) of +all showed ones for that symbol. + +Further patches improving this tool are welcome. + +EOL + +print "Checking makefile rules..." if $debug; +open_makefile("$SRC/drivers/media/Makefile"); +print " ok\n" if $debug; + +print "Associating symbols with c files..." if $debug; +associate_multi(); +print " ok\n" if $debug; + +print "finding exported symbols at $SRC..." if $debug; +find({wanted => \&build_exported_symbol_list, no_chdir => 1}, $SRC); +print " ok\n" if $debug; + +print "finding usage of symbols at $SRC\n" if $debug; +find({wanted => \&find_usage_list, no_chdir => 1}, $SRC); +print "finished\n" if $debug; + diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/checkpatch.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/checkpatch.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/checkpatch.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/checkpatch.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,2721 @@ +#!/usr/bin/perl -w +# (c) 2001, Dave Jones. (the file handling bit) +# (c) 2005, Joel Schopp (the ugly bit) +# (c) 2007,2008, Andy Whitcroft (new conditions, test suite) +# (c) 2008,2009, Andy Whitcroft +# Licensed under the terms of the GNU GPL License version 2 + +use strict; + +my $P = $0; +$P =~ s@.*/@@g; + +my $V = '0.30'; + +use Getopt::Long qw(:config no_auto_abbrev); + +my $quiet = 0; +my $tree = 1; +my $chk_signoff = 1; +my $chk_patch = 1; +my $tst_only; +my $emacs = 0; +my $terse = 0; +my $file = 0; +my $check = 0; +my $summary = 1; +my $mailback = 0; +my $summary_file = 0; +my $root; +my %debug; +my $help = 0; + +sub help { + my ($exitcode) = @_; + + print << "EOM"; +Usage: $P [OPTION]... [FILE]... +Version: $V + +Options: + -q, --quiet quiet + --no-tree run without a kernel tree + --no-signoff do not check for 'Signed-off-by' line + --patch treat FILE as patchfile (default) + --emacs emacs compile window format + --terse one line per report + -f, --file treat FILE as regular source file + --subjective, --strict enable more subjective tests + --root=PATH PATH to the kernel tree root + --no-summary suppress the per-file summary + --mailback only produce a report in case of warnings/errors + --summary-file include the filename in summary + --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of + 'values', 'possible', 'type', and 'attr' (default + is all off) + --test-only=WORD report only warnings/errors containing WORD + literally + -h, --help, --version display this help and exit + +When FILE is - read standard input. +EOM + + exit($exitcode); +} + +GetOptions( + 'q|quiet+' => \$quiet, + 'tree!' => \$tree, + 'signoff!' => \$chk_signoff, + 'patch!' => \$chk_patch, + 'emacs!' => \$emacs, + 'terse!' => \$terse, + 'f|file!' => \$file, + 'subjective!' => \$check, + 'strict!' => \$check, + 'root=s' => \$root, + 'summary!' => \$summary, + 'mailback!' => \$mailback, + 'summary-file!' => \$summary_file, + + 'debug=s' => \%debug, + 'test-only=s' => \$tst_only, + 'h|help' => \$help, + 'version' => \$help +) or help(1); + +help(0) if ($help); + +my $exit = 0; + +if ($#ARGV < 0) { + print "$P: no input files\n"; + exit(1); +} + +my $dbg_values = 0; +my $dbg_possible = 0; +my $dbg_type = 0; +my $dbg_attr = 0; +for my $key (keys %debug) { + ## no critic + eval "\${dbg_$key} = '$debug{$key}';"; + die "$@" if ($@); +} + +if ($terse) { + $emacs = 1; + $quiet++; +} + +if ($tree) { + if (defined $root) { + if (!top_of_kernel_tree($root)) { + die "$P: $root: --root does not point at a valid tree\n"; + } + } else { + if (top_of_kernel_tree('.')) { + $root = '.'; + } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && + top_of_kernel_tree($1)) { + $root = $1; + } + } + + if (!defined $root) { + print "Must be run from the top-level dir. of a kernel tree\n"; + exit(2); + } +} + +my $emitted_corrupt = 0; + +our $Ident = qr{ + [A-Za-z_][A-Za-z\d_]* + (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* + }x; +our $Storage = qr{extern|static|asmlinkage}; +our $Sparse = qr{ + __user| + __kernel| + __force| + __iomem| + __must_check| + __init_refok| + __kprobes| + __ref + }x; +our $Attribute = qr{ + const| + __read_mostly| + __kprobes| + __(?:mem|cpu|dev|)(?:initdata|init)| + ____cacheline_aligned| + ____cacheline_aligned_in_smp| + ____cacheline_internodealigned_in_smp| + __weak + }x; +our $Modifier; +our $Inline = qr{inline|__always_inline|noinline}; +our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; +our $Lval = qr{$Ident(?:$Member)*}; + +our $Constant = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*}; +our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; +our $Compare = qr{<=|>=|==|!=|<|>}; +our $Operators = qr{ + <=|>=|==|!=| + =>|->|<<|>>|<|>|!|~| + &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|% + }x; + +our $NonptrType; +our $Type; +our $Declare; + +our $UTF8 = qr { + [\x09\x0A\x0D\x20-\x7E] # ASCII + | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 +}x; + +our $typeTypedefs = qr{(?x: + (?:__)?(?:u|s|be|le)(?:8|16|32|64)| + atomic_t +)}; + +our @typeList = ( + qr{void}, + qr{(?:unsigned\s+)?char}, + qr{(?:unsigned\s+)?short}, + qr{(?:unsigned\s+)?int}, + qr{(?:unsigned\s+)?long}, + qr{(?:unsigned\s+)?long\s+int}, + qr{(?:unsigned\s+)?long\s+long}, + qr{(?:unsigned\s+)?long\s+long\s+int}, + qr{unsigned}, + qr{float}, + qr{double}, + qr{bool}, + qr{struct\s+$Ident}, + qr{union\s+$Ident}, + qr{enum\s+$Ident}, + qr{${Ident}_t}, + qr{${Ident}_handler}, + qr{${Ident}_handler_fn}, +); +our @modifierList = ( + qr{fastcall}, +); + +sub build_types { + my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; + my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; + $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; + $NonptrType = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)| + (?:$typeTypedefs\b)| + (?:${all}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $Type = qr{ + $NonptrType + (?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)? + (?:\s+$Inline|\s+$Modifier)* + }x; + $Declare = qr{(?:$Storage\s+)?$Type}; +} +build_types(); + +$chk_signoff = 0 if ($file); + +my @dep_includes = (); +my @dep_functions = (); +my $removal = "Documentation/feature-removal-schedule.txt"; +if ($tree && -f "$root/$removal") { + open(my $REMOVE, '<', "$root/$removal") || + die "$P: $removal: open failed - $!\n"; + while (<$REMOVE>) { + if (/^Check:\s+(.*\S)/) { + for my $entry (split(/[, ]+/, $1)) { + if ($entry =~ m@include/(.*)@) { + push(@dep_includes, $1); + + } elsif ($entry !~ m@/@) { + push(@dep_functions, $entry); + } + } + } + } + close($REMOVE); +} + +my @rawlines = (); +my @lines = (); +my $vname; +for my $filename (@ARGV) { + my $FILE; + if ($file) { + open($FILE, '-|', "diff -u /dev/null $filename") || + die "$P: $filename: diff failed - $!\n"; + } elsif ($filename eq '-') { + open($FILE, '<&STDIN'); + } else { + open($FILE, '<', "$filename") || + die "$P: $filename: open failed - $!\n"; + } + if ($filename eq '-') { + $vname = 'Your patch'; + } else { + $vname = $filename; + } + while (<$FILE>) { + chomp; + push(@rawlines, $_); + } + close($FILE); + if (!process($filename)) { + $exit = 1; + } + @rawlines = (); + @lines = (); +} + +exit($exit); + +sub top_of_kernel_tree { + my ($root) = @_; + + my @tree_check = ( + "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", + "README", "Documentation", "arch", "include", "drivers", + "fs", "init", "ipc", "kernel", "lib", "scripts", + ); + + foreach my $check (@tree_check) { + if (! -e $root . '/' . $check) { + return 0; + } + } + return 1; +} + +sub expand_tabs { + my ($str) = @_; + + my $res = ''; + my $n = 0; + for my $c (split(//, $str)) { + if ($c eq "\t") { + $res .= ' '; + $n++; + for (; ($n % 8) != 0; $n++) { + $res .= ' '; + } + next; + } + $res .= $c; + $n++; + } + + return $res; +} +sub copy_spacing { + (my $res = shift) =~ tr/\t/ /c; + return $res; +} + +sub line_stats { + my ($line) = @_; + + # Drop the diff line leader and expand tabs + $line =~ s/^.//; + $line = expand_tabs($line); + + # Pick the indent from the front of the line. + my ($white) = ($line =~ /^(\s*)/); + + return (length($line), length($white)); +} + +my $sanitise_quote = ''; + +sub sanitise_line_reset { + my ($in_comment) = @_; + + if ($in_comment) { + $sanitise_quote = '*/'; + } else { + $sanitise_quote = ''; + } +} +sub sanitise_line { + my ($line) = @_; + + my $res = ''; + my $l = ''; + + my $qlen = 0; + my $off = 0; + my $c; + + # Always copy over the diff marker. + $res = substr($line, 0, 1); + + for ($off = 1; $off < length($line); $off++) { + $c = substr($line, $off, 1); + + # Comments we are wacking completly including the begin + # and end, all to $;. + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') { + $sanitise_quote = '*/'; + + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { + $sanitise_quote = ''; + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') { + $sanitise_quote = '//'; + + substr($res, $off, 2, $sanitise_quote); + $off++; + next; + } + + # A \ in a string means ignore the next character. + if (($sanitise_quote eq "'" || $sanitise_quote eq '"') && + $c eq "\\") { + substr($res, $off, 2, 'XX'); + $off++; + next; + } + # Regular quotes. + if ($c eq "'" || $c eq '"') { + if ($sanitise_quote eq '') { + $sanitise_quote = $c; + + substr($res, $off, 1, $c); + next; + } elsif ($sanitise_quote eq $c) { + $sanitise_quote = ''; + } + } + + #print "c<$c> SQ<$sanitise_quote>\n"; + if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote && $c ne "\t") { + substr($res, $off, 1, 'X'); + } else { + substr($res, $off, 1, $c); + } + } + + if ($sanitise_quote eq '//') { + $sanitise_quote = ''; + } + + # The pathname on a #include may be surrounded by '<' and '>'. + if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) { + my $clean = 'X' x length($1); + $res =~ s@\<.*\>@<$clean>@; + + # The whole of a #error is a string. + } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) { + my $clean = 'X' x length($1); + $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@; + } + + return $res; +} + +sub ctx_statement_block { + my ($linenr, $remain, $off) = @_; + my $line = $linenr - 1; + my $blk = ''; + my $soff = $off; + my $coff = $off - 1; + my $coff_set = 0; + + my $loff = 0; + + my $type = ''; + my $level = 0; + my @stack = (); + my $p; + my $c; + my $len = 0; + + my $remainder; + while (1) { + @stack = (['', 0]) if ($#stack == -1); + + #warn "CSB: blk<$blk> remain<$remain>\n"; + # If we are about to drop off the end, pull in more + # context. + if ($off >= $len) { + for (; $remain > 0; $line++) { + last if (!defined $lines[$line]); + next if ($lines[$line] =~ /^-/); + $remain--; + $loff = $len; + $blk .= $lines[$line] . "\n"; + $len = length($blk); + $line++; + last; + } + # Bail if there is no further context. + #warn "CSB: blk<$blk> off<$off> len<$len>\n"; + if ($off >= $len) { + last; + } + } + $p = $c; + $c = substr($blk, $off, 1); + $remainder = substr($blk, $off); + + #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n"; + + # Handle nested #if/#else. + if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, [ $type, $level ]); + } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) { + ($type, $level) = @{$stack[$#stack - 1]}; + } elsif ($remainder =~ /^#\s*endif\b/) { + ($type, $level) = @{pop(@stack)}; + } + + # Statement ends at the ';' or a close '}' at the + # outermost level. + if ($level == 0 && $c eq ';') { + last; + } + + # An else is really a conditional as long as its not else if + if ($level == 0 && $coff_set == 0 && + (!defined($p) || $p =~ /(?:\s|\}|\+)/) && + $remainder =~ /^(else)(?:\s|{)/ && + $remainder !~ /^else\s+if\b/) { + $coff = $off + length($1) - 1; + $coff_set = 1; + #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n"; + #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n"; + } + + if (($type eq '' || $type eq '(') && $c eq '(') { + $level++; + $type = '('; + } + if ($type eq '(' && $c eq ')') { + $level--; + $type = ($level != 0)? '(' : ''; + + if ($level == 0 && $coff < $soff) { + $coff = $off; + $coff_set = 1; + #warn "CSB: mark coff<$coff>\n"; + } + } + if (($type eq '' || $type eq '{') && $c eq '{') { + $level++; + $type = '{'; + } + if ($type eq '{' && $c eq '}') { + $level--; + $type = ($level != 0)? '{' : ''; + + if ($level == 0) { + last; + } + } + $off++; + } + # We are truly at the end, so shuffle to the next line. + if ($off == $len) { + $loff = $len + 1; + $line++; + $remain--; + } + + my $statement = substr($blk, $soff, $off - $soff + 1); + my $condition = substr($blk, $soff, $coff - $soff + 1); + + #warn "STATEMENT<$statement>\n"; + #warn "CONDITION<$condition>\n"; + + #print "coff<$coff> soff<$off> loff<$loff>\n"; + + return ($statement, $condition, + $line, $remain + 1, $off - $loff + 1, $level); +} + +sub statement_lines { + my ($stmt) = @_; + + # Strip the diff line prefixes and rip blank lines at start and end. + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_rawlines { + my ($stmt) = @_; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_block_size { + my ($stmt) = @_; + + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*{//; + $stmt =~ s/}\s*$//; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + my @stmt_statements = ($stmt =~ /;/g); + + my $stmt_lines = $#stmt_lines + 2; + my $stmt_statements = $#stmt_statements + 1; + + if ($stmt_lines > $stmt_statements) { + return $stmt_lines; + } else { + return $stmt_statements; + } +} + +sub ctx_statement_full { + my ($linenr, $remain, $off) = @_; + my ($statement, $condition, $level); + + my (@chunks); + + # Grab the first conditional/block pair. + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "F: c<$condition> s<$statement> remain<$remain>\n"; + push(@chunks, [ $condition, $statement ]); + if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) { + return ($level, $linenr, @chunks); + } + + # Pull in the following conditional/block pairs and see if they + # could continue the statement. + for (;;) { + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "C: c<$condition> s<$statement> remain<$remain>\n"; + last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s)); + #print "C: push\n"; + push(@chunks, [ $condition, $statement ]); + } + + return ($level, $linenr, @chunks); +} + +sub ctx_block_get { + my ($linenr, $remain, $outer, $open, $close, $off) = @_; + my $line; + my $start = $linenr - 1; + my $blk = ''; + my @o; + my @c; + my @res = (); + + my $level = 0; + my @stack = ($level); + for ($line = $start; $remain > 0; $line++) { + next if ($rawlines[$line] =~ /^-/); + $remain--; + + $blk .= $rawlines[$line]; + + # Handle nested #if/#else. + if ($rawlines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, $level); + } elsif ($rawlines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) { + $level = $stack[$#stack - 1]; + } elsif ($rawlines[$line] =~ /^.\s*#\s*endif\b/) { + $level = pop(@stack); + } + + foreach my $c (split(//, $rawlines[$line])) { + ##print "C<$c>L<$level><$open$close>O<$off>\n"; + if ($off > 0) { + $off--; + next; + } + + if ($c eq $close && $level > 0) { + $level--; + last if ($level == 0); + } elsif ($c eq $open) { + $level++; + } + } + + if (!$outer || $level <= 1) { + push(@res, $rawlines[$line]); + } + + last if ($level == 0); + } + + return ($level, @res); +} +sub ctx_block_outer { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0); + return @r; +} +sub ctx_block { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0); + return @r; +} +sub ctx_statement { + my ($linenr, $remain, $off) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off); + return @r; +} +sub ctx_block_level { + my ($linenr, $remain) = @_; + + return ctx_block_get($linenr, $remain, 0, '{', '}', 0); +} +sub ctx_statement_level { + my ($linenr, $remain, $off) = @_; + + return ctx_block_get($linenr, $remain, 0, '(', ')', $off); +} + +sub ctx_locate_comment { + my ($first_line, $end_line) = @_; + + # Catch a comment on the end of the line itself. + my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@); + return $current_comment if (defined $current_comment); + + # Look through the context and try and figure out if there is a + # comment. + my $in_comment = 0; + $current_comment = ''; + for (my $linenr = $first_line; $linenr < $end_line; $linenr++) { + my $line = $rawlines[$linenr - 1]; + #warn " $line\n"; + if ($linenr == $first_line and $line =~ m@^.\s*\*@) { + $in_comment = 1; + } + if ($line =~ m@/\*@) { + $in_comment = 1; + } + if (!$in_comment && $current_comment ne '') { + $current_comment = ''; + } + $current_comment .= $line . "\n" if ($in_comment); + if ($line =~ m@\*/@) { + $in_comment = 0; + } + } + + chomp($current_comment); + return($current_comment); +} +sub ctx_has_comment { + my ($first_line, $end_line) = @_; + my $cmt = ctx_locate_comment($first_line, $end_line); + + ##print "LINE: $rawlines[$end_line - 1 ]\n"; + ##print "CMMT: $cmt\n"; + + return ($cmt ne ''); +} + +sub raw_line { + my ($linenr, $cnt) = @_; + + my $offset = $linenr - 1; + $cnt++; + + my $line; + while ($cnt) { + $line = $rawlines[$offset++]; + next if (defined($line) && $line =~ /^-/); + $cnt--; + } + + return $line; +} + +sub cat_vet { + my ($vet) = @_; + my ($res, $coded); + + $res = ''; + while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) { + $res .= $1; + if ($2 ne '') { + $coded = sprintf("^%c", unpack('C', $2) + 64); + $res .= $coded; + } + } + $res =~ s/$/\$/; + + return $res; +} + +my $av_preprocessor = 0; +my $av_pending; +my @av_paren_type; +my $av_pend_colon; + +sub annotate_reset { + $av_preprocessor = 0; + $av_pending = '_'; + @av_paren_type = ('E'); + $av_pend_colon = 'O'; +} + +sub annotate_values { + my ($stream, $type) = @_; + + my $res; + my $var = '_' x length($stream); + my $cur = $stream; + + print "$stream\n" if ($dbg_values > 1); + + while (length($cur)) { + @av_paren_type = ('E') if ($#av_paren_type < 0); + print " <" . join('', @av_paren_type) . + "> <$type> <$av_pending>" if ($dbg_values > 1); + if ($cur =~ /^(\s+)/o) { + print "WS($1)\n" if ($dbg_values > 1); + if ($1 =~ /\n/ && $av_preprocessor) { + $type = pop(@av_paren_type); + $av_preprocessor = 0; + } + + } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\()/) { + print "DECLARE($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^($Modifier)\s*/) { + print "MODIFIER($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) { + print "DEFINE($1,$2)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + if ($2 ne '') { + $av_pending = 'N'; + } + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) { + print "UNDEF($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + + } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) { + print "PRE_START($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) { + print "PRE_RESTART($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $av_paren_type[$#av_paren_type]); + + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:endif))/o) { + print "PRE_END($1)\n" if ($dbg_values > 1); + + $av_preprocessor = 1; + + # Assume all arms of the conditional end as this + # one does, and continue as if the #endif was not here. + pop(@av_paren_type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\\\n)/o) { + print "PRECONT($1)\n" if ($dbg_values > 1); + + } elsif ($cur =~ /^(__attribute__)\s*\(?/o) { + print "ATTR($1)\n" if ($dbg_values > 1); + $av_pending = $type; + $type = 'N'; + + } elsif ($cur =~ /^(sizeof)\s*(\()?/o) { + print "SIZEOF($1)\n" if ($dbg_values > 1); + if (defined $2) { + $av_pending = 'V'; + } + $type = 'N'; + + } elsif ($cur =~ /^(if|while|for)\b/o) { + print "COND($1)\n" if ($dbg_values > 1); + $av_pending = 'E'; + $type = 'N'; + + } elsif ($cur =~/^(case)/o) { + print "CASE($1)\n" if ($dbg_values > 1); + $av_pend_colon = 'C'; + $type = 'N'; + + } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) { + print "KEYWORD($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(\()/o) { + print "PAREN('$1')\n" if ($dbg_values > 1); + push(@av_paren_type, $av_pending); + $av_pending = '_'; + $type = 'N'; + + } elsif ($cur =~ /^(\))/o) { + my $new_type = pop(@av_paren_type); + if ($new_type ne '_') { + $type = $new_type; + print "PAREN('$1') -> $type\n" + if ($dbg_values > 1); + } else { + print "PAREN('$1')\n" if ($dbg_values > 1); + } + + } elsif ($cur =~ /^($Ident)\s*\(/o) { + print "FUNC($1)\n" if ($dbg_values > 1); + $type = 'V'; + $av_pending = 'V'; + + } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) { + if (defined $2 && $type eq 'C' || $type eq 'T') { + $av_pend_colon = 'B'; + } elsif ($type eq 'E') { + $av_pend_colon = 'L'; + } + print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Ident|$Constant)/o) { + print "IDENT($1)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Assignment)/o) { + print "ASSIGN($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~/^(;|{|})/) { + print "END($1)\n" if ($dbg_values > 1); + $type = 'E'; + $av_pend_colon = 'O'; + + } elsif ($cur =~/^(,)/) { + print "COMMA($1)\n" if ($dbg_values > 1); + $type = 'C'; + + } elsif ($cur =~ /^(\?)/o) { + print "QUESTION($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(:)/o) { + print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1); + + substr($var, length($res), 1, $av_pend_colon); + if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') { + $type = 'E'; + } else { + $type = 'N'; + } + $av_pend_colon = 'O'; + + } elsif ($cur =~ /^(\[)/o) { + print "CLOSE($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) { + my $variant; + + print "OPV($1)\n" if ($dbg_values > 1); + if ($type eq 'V') { + $variant = 'B'; + } else { + $variant = 'U'; + } + + substr($var, length($res), 1, $variant); + $type = 'N'; + + } elsif ($cur =~ /^($Operators)/o) { + print "OP($1)\n" if ($dbg_values > 1); + if ($1 ne '++' && $1 ne '--') { + $type = 'N'; + } + + } elsif ($cur =~ /(^.)/o) { + print "C($1)\n" if ($dbg_values > 1); + } + if (defined $1) { + $cur = substr($cur, length($1)); + $res .= $type x length($1); + } + } + + return ($res, $var); +} + +sub possible { + my ($possible, $line) = @_; + my $notPermitted = qr{(?: + ^(?: + $Modifier| + $Storage| + $Type| + DEFINE_\S+ + )$| + ^(?: + goto| + return| + case| + else| + asm|__asm__| + do + )(?:\s|$)| + ^(?:typedef|struct|enum)\b + )}x; + warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); + if ($possible !~ $notPermitted) { + # Check for modifiers. + $possible =~ s/\s*$Storage\s*//g; + $possible =~ s/\s*$Sparse\s*//g; + if ($possible =~ /^\s*$/) { + + } elsif ($possible =~ /\s/) { + $possible =~ s/\s*$Type\s*//g; + for my $modifier (split(' ', $possible)) { + if ($modifier !~ $notPermitted) { + warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); + push(@modifierList, $modifier); + } + } + + } else { + warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); + push(@typeList, $possible); + } + build_types(); + } else { + warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1); + } +} + +my $prefix = ''; + +sub report { + if (defined $tst_only && $_[0] !~ /\Q$tst_only\E/) { + return 0; + } + my $line = $prefix . $_[0]; + + $line = (split('\n', $line))[0] . "\n" if ($terse); + + push(our @report, $line); + + return 1; +} +sub report_dump { + our @report; +} +sub ERROR { + if (report("ERROR: $_[0]\n")) { + our $clean = 0; + our $cnt_error++; + } +} +sub WARN { + if (report("WARNING: $_[0]\n")) { + our $clean = 0; + our $cnt_warn++; + } +} +sub CHK { + if ($check && report("CHECK: $_[0]\n")) { + our $clean = 0; + our $cnt_chk++; + } +} + +sub check_absolute_file { + my ($absolute, $herecurr) = @_; + my $file = $absolute; + + ##print "absolute<$absolute>\n"; + + # See if any suffix of this path is a path within the tree. + while ($file =~ s@^[^/]*/@@) { + if (-f "$root/$file") { + ##print "file<$file>\n"; + last; + } + } + if (! -f _) { + return 0; + } + + # It is, so see if the prefix is acceptable. + my $prefix = $absolute; + substr($prefix, -length($file)) = ''; + + ##print "prefix<$prefix>\n"; + if ($prefix ne ".../") { + WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr); + } +} + +sub process { + my $filename = shift; + + my $linenr=0; + my $prevline=""; + my $prevrawline=""; + my $stashline=""; + my $stashrawline=""; + + my $length; + my $indent; + my $previndent=0; + my $stashindent=0; + + our $clean = 1; + my $signoff = 0; + my $is_patch = 0; + + our @report = (); + our $cnt_lines = 0; + our $cnt_error = 0; + our $cnt_warn = 0; + our $cnt_chk = 0; + + # Trace the real file/line as we go. + my $realfile = ''; + my $realline = 0; + my $realcnt = 0; + my $here = ''; + my $in_comment = 0; + my $comment_edge = 0; + my $first_line = 0; + my $p1_prefix = ''; + + my $prev_values = 'E'; + + # suppression flags + my %suppress_ifbraces; + my %suppress_whiletrailers; + my %suppress_export; + + # Pre-scan the patch sanitizing the lines. + # Pre-scan the patch looking for any __setup documentation. + # + my @setup_docs = (); + my $setup_docs = 0; + + sanitise_line_reset(); + my $line; + foreach my $rawline (@rawlines) { + $linenr++; + $line = $rawline; + + if ($rawline=~/^\+\+\+\s+(\S+)/) { + $setup_docs = 0; + if ($1 =~ m@Documentation/kernel-parameters.txt$@) { + $setup_docs = 1; + } + #next; + } + if ($rawline=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + $in_comment = 0; + + # Guestimate if this is a continuing comment. Run + # the context looking for a comment "edge". If this + # edge is a close comment then we must be in a comment + # at context start. + my $edge; + my $cnt = $realcnt; + for (my $ln = $linenr + 1; $cnt > 0; $ln++) { + next if (defined $rawlines[$ln - 1] && + $rawlines[$ln - 1] =~ /^-/); + $cnt--; + #print "RAW<$rawlines[$ln - 1]>\n"; + last if (!defined $rawlines[$ln - 1]); + if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ && + $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) { + ($edge) = $1; + last; + } + } + if (defined $edge && $edge eq '*/') { + $in_comment = 1; + } + + # Guestimate if this is a continuing comment. If this + # is the start of a diff block and this line starts + # ' *' then it is very likely a comment. + if (!defined $edge && + $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@) + { + $in_comment = 1; + } + + ##print "COMMENT:$in_comment edge<$edge> $rawline\n"; + sanitise_line_reset($in_comment); + + } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) { + # Standardise the strings and chars within the input to + # simplify matching -- only bother with positive lines. + $line = sanitise_line($rawline); + } + push(@lines, $line); + + if ($realcnt > 1) { + $realcnt-- if ($line =~ /^(?:\+| |$)/); + } else { + $realcnt = 0; + } + + #print "==>$rawline\n"; + #print "-->$line\n"; + + if ($setup_docs && $line =~ /^\+/) { + push(@setup_docs, $line); + } + } + + $prefix = ''; + + $realcnt = 0; + $linenr = 0; + foreach my $line (@lines) { + $linenr++; + + my $rawline = $rawlines[$linenr - 1]; + +#extract the line range in the file after the patch is applied + if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { + $is_patch = 1; + $first_line = $linenr + 1; + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + annotate_reset(); + $prev_values = 'E'; + + %suppress_ifbraces = (); + %suppress_whiletrailers = (); + %suppress_export = (); + next; + +# track the line number as we move through the hunk, note that +# new versions of GNU diff omit the leading space on completely +# blank context lines so we need to count that too. + } elsif ($line =~ /^( |\+|$)/) { + $realline++; + $realcnt-- if ($realcnt != 0); + + # Measure the line length and indent. + ($length, $indent) = line_stats($rawline); + + # Track the previous line. + ($prevline, $stashline) = ($stashline, $line); + ($previndent, $stashindent) = ($stashindent, $indent); + ($prevrawline, $stashrawline) = ($stashrawline, $rawline); + + #warn "line<$line>\n"; + + } elsif ($realcnt == 1) { + $realcnt--; + } + + my $hunk_line = ($realcnt != 0); + +#make up the handle for any error we report on this line + $prefix = "$filename:$realline: " if ($emacs && $file); + $prefix = "$filename:$linenr: " if ($emacs && !$file); + + $here = "#$linenr: " if (!$file); + $here = "#$realline: " if ($file); + + # extract the filename as it passes + if ($line=~/^\+\+\+\s+(\S+)/) { + $realfile = $1; + $realfile =~ s@^([^/]*)/@@; + + $p1_prefix = $1; + if (!$file && $tree && $p1_prefix ne '' && + -e "$root/$p1_prefix") { + WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); + } + + if ($realfile =~ m@^include/asm/@) { + ERROR("do not modify files in include/asm, change architecture specific files in include/asm-\n" . "$here$rawline\n"); + } + next; + } + + $here .= "FILE: $realfile:$realline:" if ($realcnt != 0); + + my $hereline = "$here\n$rawline\n"; + my $herecurr = "$here\n$rawline\n"; + my $hereprev = "$here\n$prevrawline\n$rawline\n"; + + $cnt_lines++ if ($realcnt != 0); + +#check the patch for a signoff: + if ($line =~ /^\s*signed-off-by:/i) { + # This is a signoff, if ugly, so do not double report. + $signoff++; + if (!($line =~ /^\s*Signed-off-by:/)) { + WARN("Signed-off-by: is the preferred form\n" . + $herecurr); + } + if ($line =~ /^\s*signed-off-by:\S/i) { + WARN("space required after Signed-off-by:\n" . + $herecurr); + } + } + +# Check for wrappage within a valid hunk of the file + if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { + ERROR("patch seems to be corrupt (line wrapped?)\n" . + $herecurr) if (!$emitted_corrupt++); + } + +# Check for absolute kernel paths. + if ($tree) { + while ($line =~ m{(?:^|\s)(/\S*)}g) { + my $file = $1; + + if ($file =~ m{^(.*?)(?::\d+)+:?$} && + check_absolute_file($1, $herecurr)) { + # + } else { + check_absolute_file($file, $herecurr); + } + } + } + +# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php + if (($realfile =~ /^$/ || $line =~ /^\+/) && + $rawline !~ m/^$UTF8*$/) { + my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/); + + my $blank = copy_spacing($rawline); + my $ptr = substr($blank, 0, length($utf8_prefix)) . "^"; + my $hereptr = "$hereline$ptr\n"; + + ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); + } + +# ignore non-hunk lines and lines being removed + next if (!$hunk_line || $line =~ /^-/); + +#trailing whitespace + if ($line =~ /^\+.*\015/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + ERROR("DOS line endings\n" . $herevet); + + } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + ERROR("trailing whitespace\n" . $herevet); + } + +# check we are in a valid source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); + +#80 column limit + if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && + $rawline !~ /^.\s*\*\s*\@$Ident\s/ && + $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ && + $length > 80) + { + WARN("line over 80 characters\n" . $herecurr); + } + +# check for adding lines without a newline. + if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { + WARN("adding a line without newline at end of file\n" . $herecurr); + } + +# Blackfin: use hi/lo macros + if ($realfile =~ m@arch/blackfin/.*\.S$@) { + if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet); + } + if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the HI() macro, not (... >> 16)\n" . $herevet); + } + } + +# check we are in a valid source file C or perl if not then ignore this hunk + next if ($realfile !~ /\.(h|c|pl)$/); + +# at the beginning of a line any tabs must come first and anything +# more than 8 must use tabs. + if ($rawline =~ /^\+\s* \t\s*\S/ || + $rawline =~ /^\+\s* \s*/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + ERROR("code indent should use tabs where possible\n" . $herevet); + } + +# check we are in a valid C source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c)$/); + +# check for RCS/CVS revision markers + if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { + WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr); + } + +# Blackfin: don't use __builtin_bfin_[cs]sync + if ($line =~ /__builtin_bfin_csync/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet); + } + if ($line =~ /__builtin_bfin_ssync/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet); + } + +# Check for potential 'bare' types + my ($stat, $cond, $line_nr_next, $remain_next, $off_next, + $realline_next); + if ($realcnt && $line =~ /.\s*\S/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0); + $stat =~ s/\n./\n /g; + $cond =~ s/\n./\n /g; + + # Find the real next line. + $realline_next = $line_nr_next; + if (defined $realline_next && + (!defined $lines[$realline_next - 1] || + substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) { + $realline_next++; + } + + my $s = $stat; + $s =~ s/{.*$//s; + + # Ignore goto labels. + if ($s =~ /$Ident:\*$/s) { + + # Ignore functions being called + } elsif ($s =~ /^.\s*$Ident\s*\(/s) { + + } elsif ($s =~ /^.\s*else\b/s) { + + # declarations always start with types + } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) { + my $type = $1; + $type =~ s/\s+/ /g; + possible($type, "A:" . $s); + + # definitions in global scope can only start with types + } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) { + possible($1, "B:" . $s); + } + + # any (foo ... *) is a pointer cast, and foo is a type + while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) { + possible($1, "C:" . $s); + } + + # Check for any sort of function declaration. + # int foo(something bar, other baz); + # void (*store_gdt)(x86_descr_ptr *); + if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) { + my ($name_len) = length($1); + + my $ctx = $s; + substr($ctx, 0, $name_len + 1, ''); + $ctx =~ s/\)[^\)]*$//; + + for my $arg (split(/\s*,\s*/, $ctx)) { + if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) { + + possible($1, "D:" . $s); + } + } + } + + } + +# +# Checks which may be anchored in the context. +# + +# Check for switch () and associated case and default +# statements should be at the same indent. + if ($line=~/\bswitch\s*\(.*\)/) { + my $err = ''; + my $sep = ''; + my @ctx = ctx_block_outer($linenr, $realcnt); + shift(@ctx); + for my $ctx (@ctx) { + my ($clen, $cindent) = line_stats($ctx); + if ($ctx =~ /^\+\s*(case\s+|default:)/ && + $indent != $cindent) { + $err .= "$sep$ctx\n"; + $sep = ''; + } else { + $sep = "[...]\n"; + } + } + if ($err ne '') { + ERROR("switch and case should be at the same indent\n$hereline$err"); + } + } + +# if/while/etc brace do not go on next line, unless defining a do while loop, +# or if that brace on the next line is for something else + if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { + my $pre_ctx = "$1$2"; + + my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); + my $ctx_cnt = $realcnt - $#ctx - 1; + my $ctx = join("\n", @ctx); + + my $ctx_ln = $linenr; + my $ctx_skip = $realcnt; + + while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt && + defined $lines[$ctx_ln - 1] && + $lines[$ctx_ln - 1] =~ /^-/)) { + ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n"; + $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/); + $ctx_ln++; + } + + #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; + #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; + + if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { + ERROR("that open brace { should be on the previous line\n" . + "$here\n$ctx\n$lines[$ctx_ln - 1]\n"); + } + if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ && + $ctx =~ /\)\s*\;\s*$/ && + defined $lines[$ctx_ln - 1]) + { + my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]); + if ($nindent > $indent) { + WARN("trailing semicolon indicates no statements, indent implies otherwise\n" . + "$here\n$ctx\n$lines[$ctx_ln - 1]\n"); + } + } + } + +# Check relative indent for conditionals and blocks. + if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { + my ($s, $c) = ($stat, $cond); + + substr($s, 0, length($c), ''); + + # Make sure we remove the line prefixes as we have + # none on the first line, and are going to readd them + # where necessary. + $s =~ s/\n./\n/gs; + + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + + # We want to check the first line inside the block + # starting at the end of the conditional, so remove: + # 1) any blank line termination + # 2) any opening brace { on end of the line + # 3) any do (...) { + my $continuation = 0; + my $check = 0; + $s =~ s/^.*\bdo\b//; + $s =~ s/^\s*{//; + if ($s =~ s/^\s*\\//) { + $continuation = 1; + } + if ($s =~ s/^\s*?\n//) { + $check = 1; + $cond_lines++; + } + + # Also ignore a loop construct at the end of a + # preprocessor statement. + if (($prevline =~ /^.\s*#\s*define\s/ || + $prevline =~ /\\\s*$/) && $continuation == 0) { + $check = 0; + } + + my $cond_ptr = -1; + $continuation = 0; + while ($cond_ptr != $cond_lines) { + $cond_ptr = $cond_lines; + + # If we see an #else/#elif then the code + # is not linear. + if ($s =~ /^\s*\#\s*(?:else|elif)/) { + $check = 0; + } + + # Ignore: + # 1) blank lines, they should be at 0, + # 2) preprocessor lines, and + # 3) labels. + if ($continuation || + $s =~ /^\s*?\n/ || + $s =~ /^\s*#\s*?/ || + $s =~ /^\s*$Ident\s*:/) { + $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; + if ($s =~ s/^.*?\n//) { + $cond_lines++; + } + } + } + + my (undef, $sindent) = line_stats("+" . $s); + my $stat_real = raw_line($linenr, $cond_lines); + + # Check if either of these lines are modified, else + # this is not this patch's fault. + if (!defined($stat_real) || + $stat !~ /^\+/ && $stat_real !~ /^\+/) { + $check = 0; + } + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n"; + + if ($check && (($sindent % 8) != 0 || + ($sindent <= $indent && $s ne ''))) { + WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); + } + } + + # Track the 'values' across context and added lines. + my $opline = $line; $opline =~ s/^./ /; + my ($curr_values, $curr_vars) = + annotate_values($opline . "\n", $prev_values); + $curr_values = $prev_values . $curr_values; + if ($dbg_values) { + my $outline = $opline; $outline =~ s/\t/ /g; + print "$linenr > .$outline\n"; + print "$linenr > $curr_values\n"; + print "$linenr > $curr_vars\n"; + } + $prev_values = substr($curr_values, -1); + +#ignore lines not being added + if ($line=~/^[^\+]/) {next;} + +# TEST: allow direct testing of the type matcher. + if ($dbg_type) { + if ($line =~ /^.\s*$Declare\s*$/) { + ERROR("TEST: is type\n" . $herecurr); + } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { + ERROR("TEST: is not type ($1 is)\n". $herecurr); + } + next; + } +# TEST: allow direct testing of the attribute matcher. + if ($dbg_attr) { + if ($line =~ /^.\s*$Modifier\s*$/) { + ERROR("TEST: is attr\n" . $herecurr); + } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { + ERROR("TEST: is not attr ($1 is)\n". $herecurr); + } + next; + } + +# check for initialisation to aggregates open brace on the next line + if ($line =~ /^.\s*{/ && + $prevline =~ /(?:^|[^=])=\s*$/) { + ERROR("that open brace { should be on the previous line\n" . $hereprev); + } + +# +# Checks which are anchored on the added line. +# + +# check for malformed paths in #include statements (uses RAW line) + if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) { + my $path = $1; + if ($path =~ m{//}) { + ERROR("malformed #include filename\n" . + $herecurr); + } + } + +# no C99 // comments + if ($line =~ m{//}) { + ERROR("do not use C99 // comments\n" . $herecurr); + } + # Remove C99 comments. + $line =~ s@//.*@@; + $opline =~ s@//.*@@; + +# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider +# the whole statement. +#print "APW <$lines[$realline_next - 1]>\n"; + if (defined $realline_next && + exists $lines[$realline_next - 1] && + !defined $suppress_export{$realline_next} && + ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { + my $name = $1; + if ($stat !~ /(?: + \n.}\s*$| + ^.DEFINE_$Ident\(\Q$name\E\)| + ^.DECLARE_$Ident\(\Q$name\E\)| + ^.LIST_HEAD\(\Q$name\E\)| + ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| + \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() + )/x) { +#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n"; + $suppress_export{$realline_next} = 2; + } else { + $suppress_export{$realline_next} = 1; + } + } + if (!defined $suppress_export{$linenr} && + $prevline =~ /^.\s*$/ && + ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { +#print "FOO B <$lines[$linenr - 1]>\n"; + $suppress_export{$linenr} = 2; + } + if (defined $suppress_export{$linenr} && + $suppress_export{$linenr} == 2) { + WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); + } + +# check for external initialisers. + if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) { + ERROR("do not initialise externals to 0 or NULL\n" . + $herecurr); + } +# check for static initialisers. + if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { + ERROR("do not initialise statics to 0 or NULL\n" . + $herecurr); + } + +# check for new typedefs, only function parameters and sparse annotations +# make sense. + if ($line =~ /\btypedef\s/ && + $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ && + $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && + $line !~ /\b$typeTypedefs\b/ && + $line !~ /\b__bitwise(?:__|)\b/) { + WARN("do not add new typedefs\n" . $herecurr); + } + +# * goes on variable not on type + # (char*[ const]) + if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) { + my ($from, $to) = ($1, $1); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + + #print "from<$from> to<$to>\n"; + if ($from ne $to) { + ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); + } + } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { + my ($from, $to, $ident) = ($1, $1, $2); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + # Modifiers should have spaces. + $to =~ s/(\b$Modifier$)/$1 /; + + #print "from<$from> to<$to> ident<$ident>\n"; + if ($from ne $to && $ident !~ /^$Modifier$/) { + ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr); + } + } + +# # no BUG() or BUG_ON() +# if ($line =~ /\b(BUG|BUG_ON)\b/) { +# print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n"; +# print "$herecurr"; +# $clean = 0; +# } + + if ($line =~ /\bLINUX_VERSION_CODE\b/) { + WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); + } + +# printk should use KERN_* levels. Note that follow on printk's on the +# same line do not need a level, so we use the current block context +# to try and find and validate the current printk. In summary the current +# printk includes all preceeding printk's which have no newline on the end. +# we assume the first bad printk is the one to report. + if ($line =~ /\bprintk\((?!KERN_)\s*"/) { + my $ok = 0; + for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) { + #print "CHECK<$lines[$ln - 1]\n"; + # we have a preceeding printk if it ends + # with "\n" ignore it, else it is to blame + if ($lines[$ln - 1] =~ m{\bprintk\(}) { + if ($rawlines[$ln - 1] !~ m{\\n"}) { + $ok = 1; + } + last; + } + } + if ($ok == 0) { + WARN("printk() should include KERN_ facility level\n" . $herecurr); + } + } + +# function brace can't be on same line, except for #defines of do while, +# or if closed on same line + if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and + !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) { + ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); + } + +# open braces for enum, union and struct go on the same line. + if ($line =~ /^.\s*{/ && + $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { + ERROR("open brace '{' following $1 go on the same line\n" . $hereprev); + } + +# check for spacing round square brackets; allowed: +# 1. with a type on the left -- int [] a; +# 2. at the beginning of a line for slice initialisers -- [0...10] = 5, +# 3. inside a curly brace -- = { [0...10] = 5 } + while ($line =~ /(.*?\s)\[/g) { + my ($where, $prefix) = ($-[1], $1); + if ($prefix !~ /$Type\s+$/ && + ($where != 0 || $prefix !~ /^.\s+$/) && + $prefix !~ /{\s+$/) { + ERROR("space prohibited before open square bracket '['\n" . $herecurr); + } + } + +# check for spaces between functions and their parentheses. + while ($line =~ /($Ident)\s+\(/g) { + my $name = $1; + my $ctx_before = substr($line, 0, $-[1]); + my $ctx = "$ctx_before$name"; + + # Ignore those directives where spaces _are_ permitted. + if ($name =~ /^(?: + if|for|while|switch|return|case| + volatile|__volatile__| + __attribute__|format|__extension__| + asm|__asm__)$/x) + { + + # cpp #define statements have non-optional spaces, ie + # if there is a space between the name and the open + # parenthesis it is simply not a parameter group. + } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) { + + # cpp #elif statement condition may start with a ( + } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) { + + # If this whole things ends with a type its most + # likely a typedef for a function. + } elsif ($ctx =~ /$Type$/) { + + } else { + WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr); + } + } +# Check operator spacing. + if (!($line=~/\#\s*include/)) { + my $ops = qr{ + <<=|>>=|<=|>=|==|!=| + \+=|-=|\*=|\/=|%=|\^=|\|=|&=| + =>|->|<<|>>|<|>|=|!|~| + &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%| + \?|: + }x; + my @elements = split(/($ops|;)/, $opline); + my $off = 0; + + my $blank = copy_spacing($opline); + + for (my $n = 0; $n < $#elements; $n += 2) { + $off += length($elements[$n]); + + # Pick up the preceeding and succeeding characters. + my $ca = substr($opline, 0, $off); + my $cc = ''; + if (length($opline) >= ($off + length($elements[$n + 1]))) { + $cc = substr($opline, $off + length($elements[$n + 1])); + } + my $cb = "$ca$;$cc"; + + my $a = ''; + $a = 'V' if ($elements[$n] ne ''); + $a = 'W' if ($elements[$n] =~ /\s$/); + $a = 'C' if ($elements[$n] =~ /$;$/); + $a = 'B' if ($elements[$n] =~ /(\[|\()$/); + $a = 'O' if ($elements[$n] eq ''); + $a = 'E' if ($ca =~ /^\s*$/); + + my $op = $elements[$n + 1]; + + my $c = ''; + if (defined $elements[$n + 2]) { + $c = 'V' if ($elements[$n + 2] ne ''); + $c = 'W' if ($elements[$n + 2] =~ /^\s/); + $c = 'C' if ($elements[$n + 2] =~ /^$;/); + $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); + $c = 'O' if ($elements[$n + 2] eq ''); + $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/); + } else { + $c = 'E'; + } + + my $ctx = "${a}x${c}"; + + my $at = "(ctx:$ctx)"; + + my $ptr = substr($blank, 0, $off) . "^"; + my $hereptr = "$hereline$ptr\n"; + + # Pull out the value of this operator. + my $op_type = substr($curr_values, $off + 1, 1); + + # Get the full operator variant. + my $opv = $op . substr($curr_vars, $off, 1); + + # Ignore operators passed as parameters. + if ($op_type ne 'V' && + $ca =~ /\s$/ && $cc =~ /^\s*,/) { + +# # Ignore comments +# } elsif ($op =~ /^$;+$/) { + + # ; should have either the end of line or a space or \ after it + } elsif ($op eq ';') { + if ($ctx !~ /.x[WEBC]/ && + $cc !~ /^\\/ && $cc !~ /^;/) { + ERROR("space required after that '$op' $at\n" . $hereptr); + } + + # // is a comment + } elsif ($op eq '//') { + + # No spaces for: + # -> + # : when part of a bitfield + } elsif ($op eq '->' || $opv eq ':B') { + if ($ctx =~ /Wx.|.xW/) { + ERROR("spaces prohibited around that '$op' $at\n" . $hereptr); + } + + # , must have a space on the right. + } elsif ($op eq ',') { + if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { + ERROR("space required after that '$op' $at\n" . $hereptr); + } + + # '*' as part of a type definition -- reported already. + } elsif ($opv eq '*_') { + #warn "'*' is part of type\n"; + + # unary operators should have a space before and + # none after. May be left adjacent to another + # unary operator, or a cast + } elsif ($op eq '!' || $op eq '~' || + $opv eq '*U' || $opv eq '-U' || + $opv eq '&U' || $opv eq '&&U') { + if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { + ERROR("space required before that '$op' $at\n" . $hereptr); + } + if ($op eq '*' && $cc =~/\s*$Modifier\b/) { + # A unary '*' may be const + + } elsif ($ctx =~ /.xW/) { + ERROR("space prohibited after that '$op' $at\n" . $hereptr); + } + + # unary ++ and unary -- are allowed no space on one side. + } elsif ($op eq '++' or $op eq '--') { + if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) { + ERROR("space required one side of that '$op' $at\n" . $hereptr); + } + if ($ctx =~ /Wx[BE]/ || + ($ctx =~ /Wx./ && $cc =~ /^;/)) { + ERROR("space prohibited before that '$op' $at\n" . $hereptr); + } + if ($ctx =~ /ExW/) { + ERROR("space prohibited after that '$op' $at\n" . $hereptr); + } + + + # << and >> may either have or not have spaces both sides + } elsif ($op eq '<<' or $op eq '>>' or + $op eq '&' or $op eq '^' or $op eq '|' or + $op eq '+' or $op eq '-' or + $op eq '*' or $op eq '/' or + $op eq '%') + { + if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { + ERROR("need consistent spacing around '$op' $at\n" . + $hereptr); + } + + # A colon needs no spaces before when it is + # terminating a case value or a label. + } elsif ($opv eq ':C' || $opv eq ':L') { + if ($ctx =~ /Wx./) { + ERROR("space prohibited before that '$op' $at\n" . $hereptr); + } + + # All the others need spaces both sides. + } elsif ($ctx !~ /[EWC]x[CWE]/) { + my $ok = 0; + + # Ignore email addresses + if (($op eq '<' && + $cc =~ /^\S+\@\S+>/) || + ($op eq '>' && + $ca =~ /<\S+\@\S+$/)) + { + $ok = 1; + } + + # Ignore ?: + if (($opv eq ':O' && $ca =~ /\?$/) || + ($op eq '?' && $cc =~ /^:/)) { + $ok = 1; + } + + if ($ok == 0) { + ERROR("spaces required around that '$op' $at\n" . $hereptr); + } + } + $off += length($elements[$n + 1]); + } + } + +# check for multiple assignments + if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { + CHK("multiple assignments should be avoided\n" . $herecurr); + } + +## # check for multiple declarations, allowing for a function declaration +## # continuation. +## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && +## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { +## +## # Remove any bracketed sections to ensure we do not +## # falsly report the parameters of functions. +## my $ln = $line; +## while ($ln =~ s/\([^\(\)]*\)//g) { +## } +## if ($ln =~ /,/) { +## WARN("declaring multiple variables together should be avoided\n" . $herecurr); +## } +## } + +#need space before brace following if, while, etc + if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || + $line =~ /do{/) { + ERROR("space required before the open brace '{'\n" . $herecurr); + } + +# closing brace should have a space following it when it has anything +# on the line + if ($line =~ /}(?!(?:,|;|\)))\S/) { + ERROR("space required after that close brace '}'\n" . $herecurr); + } + +# check spacing on square brackets + if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { + ERROR("space prohibited after that open square bracket '['\n" . $herecurr); + } + if ($line =~ /\s\]/) { + ERROR("space prohibited before that close square bracket ']'\n" . $herecurr); + } + +# check spacing on parentheses + if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && + $line !~ /for\s*\(\s+;/) { + ERROR("space prohibited after that open parenthesis '('\n" . $herecurr); + } + if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && + $line !~ /for\s*\(.*;\s+\)/ && + $line !~ /:\s+\)/) { + ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr); + } + +#goto labels aren't indented, allow a single space however + if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and + !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { + WARN("labels should not be indented\n" . $herecurr); + } + +# Return is not a function. + if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) { + my $spacing = $1; + my $value = $2; + + # Flatten any parentheses + $value =~ s/\)\(/\) \(/g; + while ($value =~ s/\[[^\{\}]*\]/1/ || + $value !~ /(?:$Ident|-?$Constant)\s* + $Compare\s* + (?:$Ident|-?$Constant)/x && + $value =~ s/\([^\(\)]*\)/1/) { + } + + if ($value =~ /^(?:$Ident|-?$Constant)$/) { + ERROR("return is not a function, parentheses are not required\n" . $herecurr); + + } elsif ($spacing !~ /\s+/) { + ERROR("space required before the open parenthesis '('\n" . $herecurr); + } + } + +# Need a space before open parenthesis after if, while etc + if ($line=~/\b(if|while|for|switch)\(/) { + ERROR("space required before the open parenthesis '('\n" . $herecurr); + } + +# Check for illegal assignment in if conditional -- and check for trailing +# statements after the conditional. + if ($line =~ /do\s*(?!{)/) { + my ($stat_next) = ctx_statement_block($line_nr_next, + $remain_next, $off_next); + $stat_next =~ s/\n./\n /g; + ##print "stat<$stat> stat_next<$stat_next>\n"; + + if ($stat_next =~ /^\s*while\b/) { + # If the statement carries leading newlines, + # then count those as offsets. + my ($whitespace) = + ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = + statement_rawlines($whitespace) - 1; + + $suppress_whiletrailers{$line_nr_next + + $offset} = 1; + } + } + if (!defined $suppress_whiletrailers{$linenr} && + $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { + my ($s, $c) = ($stat, $cond); + + if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { + ERROR("do not use assignment in if condition\n" . $herecurr); + } + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + $s =~ s/$;//g; # Remove any comments + if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && + $c !~ /}\s*while\s*/) + { + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + + my $stat_real = raw_line($linenr, $cond_lines); + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real); + } + } + +# Check for bitwise tests written as boolean + if ($line =~ / + (?: + (?:\[|\(|\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\|) + | + (?:\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\||\)|\]) + )/x) + { + WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr); + } + +# if and else should not have general statements after it + if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) { + my $s = $1; + $s =~ s/$;//g; # Remove any comments + if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) { + ERROR("trailing statements should be on next line\n" . $herecurr); + } + } +# if should not continue a brace + if ($line =~ /}\s*if\b/) { + ERROR("trailing statements should be on next line\n" . + $herecurr); + } +# case and default should not have general statements after them + if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && + $line !~ /\G(?: + (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$| + \s*return\s+ + )/xg) + { + ERROR("trailing statements should be on next line\n" . $herecurr); + } + + # Check for }else {, these must be at the same + # indent level to be relevant to each other. + if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and + $previndent == $indent) { + ERROR("else should follow close brace '}'\n" . $hereprev); + } + + if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and + $previndent == $indent) { + my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0); + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + + if ($s =~ /^\s*;/) { + ERROR("while should follow close brace '}'\n" . $hereprev); + } + } + +#studly caps, commented out until figure out how to distinguish between use of existing and adding new +# if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) { +# print "No studly caps, use _\n"; +# print "$herecurr"; +# $clean = 0; +# } + +#no spaces allowed after \ in define + if ($line=~/\#\s*define.*\\\s$/) { + WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr); + } + +#warn if is #included and is available (uses RAW line) + if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\}) { + my $file = "$1.h"; + my $checkfile = "include/linux/$file"; + if (-f "$root/$checkfile" && + $realfile ne $checkfile && + $1 ne 'irq') + { + if ($realfile =~ m{^arch/}) { + CHK("Consider using #include instead of \n" . $herecurr); + } else { + WARN("Use #include instead of \n" . $herecurr); + } + } + } + +# multi-statement macros should be enclosed in a do while loop, grab the +# first statement and ensure its the whole macro if its not enclosed +# in a known good container + if ($realfile !~ m@/vmlinux.lds.h$@ && + $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) { + my $ln = $linenr; + my $cnt = $realcnt; + my ($off, $dstat, $dcond, $rest); + my $ctx = ''; + + my $args = defined($1); + + # Find the end of the macro and limit our statement + # search to that. + while ($cnt > 0 && defined $lines[$ln - 1] && + $lines[$ln - 1] =~ /^(?:-|..*\\$)/) + { + $ctx .= $rawlines[$ln - 1] . "\n"; + $cnt-- if ($lines[$ln - 1] !~ /^-/); + $ln++; + } + $ctx .= $rawlines[$ln - 1]; + + ($dstat, $dcond, $ln, $cnt, $off) = + ctx_statement_block($linenr, $ln - $linenr + 1, 0); + #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n"; + #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n"; + + # Extract the remainder of the define (if any) and + # rip off surrounding spaces, and trailing \'s. + $rest = ''; + while ($off != 0 || ($cnt > 0 && $rest =~ /\\\s*$/)) { + #print "ADDING cnt<$cnt> $off <" . substr($lines[$ln - 1], $off) . "> rest<$rest>\n"; + if ($off != 0 || $lines[$ln - 1] !~ /^-/) { + $rest .= substr($lines[$ln - 1], $off) . "\n"; + $cnt--; + } + $ln++; + $off = 0; + } + $rest =~ s/\\\n.//g; + $rest =~ s/^\s*//s; + $rest =~ s/\s*$//s; + + # Clean up the original statement. + if ($args) { + substr($dstat, 0, length($dcond), ''); + } else { + $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//; + } + $dstat =~ s/$;//g; + $dstat =~ s/\\\n.//g; + $dstat =~ s/^\s*//s; + $dstat =~ s/\s*$//s; + + # Flatten any parentheses and braces + while ($dstat =~ s/\([^\(\)]*\)/1/ || + $dstat =~ s/\{[^\{\}]*\}/1/ || + $dstat =~ s/\[[^\{\}]*\]/1/) + { + } + + my $exceptions = qr{ + $Declare| + module_param_named| + MODULE_PARAM_DESC| + DECLARE_PER_CPU| + DEFINE_PER_CPU| + __typeof__\(| + \.$Ident\s*=\s*| + ^\"|\"$ + }x; + #print "REST<$rest> dstat<$dstat>\n"; + if ($rest ne '') { + if ($rest !~ /while\s*\(/ && + $dstat !~ /$exceptions/) + { + ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n"); + } + + } elsif ($ctx !~ /;/) { + if ($dstat ne '' && + $dstat !~ /^(?:$Ident|-?$Constant)$/ && + $dstat !~ /$exceptions/ && + $dstat !~ /^\.$Ident\s*=/ && + $dstat =~ /$Operators/) + { + ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n"); + } + } + } + +# make sure symbols are always wrapped with VMLINUX_SYMBOL() ... +# all assignments may have only one of the following with an assignment: +# . +# ALIGN(...) +# VMLINUX_SYMBOL(...) + if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) { + WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr); + } + +# check for redundant bracing round if etc + if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) { + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, 1); + #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n"; + #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n"; + if ($#chunks > 0 && $level == 0) { + my $allowed = 0; + my $seen = 0; + my $herectx = $here . "\n"; + my $ln = $linenr - 1; + for my $chunk (@chunks) { + my ($cond, $block) = @{$chunk}; + + # If the condition carries leading newlines, then count those as offsets. + my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = statement_rawlines($whitespace) - 1; + + #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n"; + + # We have looked at and allowed this specific line. + $suppress_ifbraces{$ln + $offset} = 1; + + $herectx .= "$rawlines[$ln + $offset]\n[...]\n"; + $ln += statement_rawlines($block) - 1; + + substr($block, 0, length($cond), ''); + + $seen++ if ($block =~ /^\s*{/); + + #print "cond<$cond> block<$block> allowed<$allowed>\n"; + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed = 1; + } + } + if ($seen && !$allowed) { + WARN("braces {} are not necessary for any arm of this statement\n" . $herectx); + } + } + } + if (!defined $suppress_ifbraces{$linenr - 1} && + $line =~ /\b(if|while|for|else)\b/) { + my $allowed = 0; + + # Check the pre-context. + if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) { + #print "APW: ALLOWED: pre<$1>\n"; + $allowed = 1; + } + + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, $-[0]); + + # Check the condition. + my ($cond, $block) = @{$chunks[0]}; + #print "CHECKING<$linenr> cond<$cond> block<$block>\n"; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed = 1; + } + # Check the post-context. + if (defined $chunks[1]) { + my ($cond, $block) = @{$chunks[1]}; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if ($block =~ /^\s*\{/) { + #print "APW: ALLOWED: chunk-1 block<$block>\n"; + $allowed = 1; + } + } + if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) { + my $herectx = $here . "\n";; + my $cnt = statement_rawlines($block); + + for (my $n = 0; $n < $cnt; $n++) { + $herectx .= raw_line($linenr, $n) . "\n";; + } + + WARN("braces {} are not necessary for single statement blocks\n" . $herectx); + } + } + +# don't include deprecated include files (uses RAW line) + for my $inc (@dep_includes) { + if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) { + ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr); + } + } + +# don't use deprecated functions + for my $func (@dep_functions) { + if ($line =~ /\b$func\b/) { + ERROR("Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr); + } + } + +# no volatiles please + my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; + if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { + WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); + } + +# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated + if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) { + ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr); + } + +# warn about #if 0 + if ($line =~ /^.\s*\#\s*if\s+0\b/) { + CHK("if this code is redundant consider removing it\n" . + $herecurr); + } + +# check for needless kfree() checks + if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { + my $expr = $1; + if ($line =~ /\bkfree\(\Q$expr\E\);/) { + WARN("kfree(NULL) is safe this check is probably not required\n" . $hereprev); + } + } +# check for needless usb_free_urb() checks + if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { + my $expr = $1; + if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) { + WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev); + } + } + +# warn about #ifdefs in C files +# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { +# print "#ifdef in C files should be avoided\n"; +# print "$herecurr"; +# $clean = 0; +# } + +# warn about spacing in #ifdefs + if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) { + ERROR("exactly one space required after that #$1\n" . $herecurr); + } + +# check for spinlock_t definitions without a comment. + if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || + $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { + my $which = $1; + if (!ctx_has_comment($first_line, $linenr)) { + CHK("$1 definition without comment\n" . $herecurr); + } + } +# check for memory barriers without a comment. + if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) { + if (!ctx_has_comment($first_line, $linenr)) { + CHK("memory barrier without comment\n" . $herecurr); + } + } +# check of hardware specific defines + if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { + CHK("architecture specific defines should be avoided\n" . $herecurr); + } + +# check the location of the inline attribute, that it is between +# storage class and type. + if ($line =~ /\b$Type\s+$Inline\b/ || + $line =~ /\b$Inline\s+$Storage\b/) { + ERROR("inline keyword should sit between storage class and type\n" . $herecurr); + } + +# Check for __inline__ and __inline, prefer inline + if ($line =~ /\b(__inline__|__inline)\b/) { + WARN("plain inline is preferred over $1\n" . $herecurr); + } + +# check for new externs in .c files. + if ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) + { + my $function_name = $1; + my $paren_space = $2; + + my $s = $stat; + if (defined $cond) { + substr($s, 0, length($cond), ''); + } + if ($s =~ /^\s*;/ && + $function_name ne 'uninitialized_var') + { + WARN("externs should be avoided in .c files\n" . $herecurr); + } + + if ($paren_space =~ /\n/) { + WARN("arguments for function declarations should follow identifier\n" . $herecurr); + } + + } elsif ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*extern\s+/) + { + WARN("externs should be avoided in .c files\n" . $herecurr); + } + +# checks for new __setup's + if ($rawline =~ /\b__setup\("([^"]*)"/) { + my $name = $1; + + if (!grep(/$name/, @setup_docs)) { + CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr); + } + } + +# check for pointless casting of kmalloc return + if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) { + WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); + } + +# check for gcc specific __FUNCTION__ + if ($line =~ /__FUNCTION__/) { + WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); + } + +# check for semaphores used as mutexes + if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) { + WARN("mutexes are preferred for single holder semaphores\n" . $herecurr); + } +# check for semaphores used as mutexes + if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { + WARN("consider using a completion\n" . $herecurr); + } +# recommend strict_strto* over simple_strto* + if ($line =~ /\bsimple_(strto.*?)\s*\(/) { + WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); + } +# check for __initcall(), use device_initcall() explicitly please + if ($line =~ /^.\s*__initcall\s*\(/) { + WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); + } +# check for struct file_operations, ensure they are const. + if ($line !~ /\bconst\b/ && + $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) { + WARN("struct $1 should normally be const\n" . + $herecurr); + } + +# use of NR_CPUS is usually wrong +# ignore definitions of NR_CPUS and usage to define arrays as likely right + if ($line =~ /\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/) + { + WARN("usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr); + } + +# check for %L{u,d,i} in strings + my $string; + while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { + $string = substr($rawline, $-[1], $+[1] - $-[1]); + $string =~ s/%%/__/g; + if ($string =~ /(?] []\n". + "\t-c\tc style\n". + "\t-e\emacs style (default)\n". + "\t-t\terse style (default)\n". + "\t\tfile name to open. If file not specified, uses hg diff\n\n", $name; + + exit -1; +} + +if (not getopts('cet',\%opt) or defined $opt{'h'}) { + usage($0); +} + +my $cmd=shift; + +if ($opt{'c'}) { + $c_syntax=1; +} + +if ($opt{'t'}) { + $fmt="--terse"; + $c_syntax=0; +} + +if ($cmd) { + $cmd="diff -upr /dev/null $cmd"; +} else { + $cmd="hg diff"; +} + +my $checkpatch=$ENV{CHECKPATCH}; + +if (!$checkpatch) { + $checkpatch="/lib/modules/`uname -r`/build/scripts/checkpatch.pl"; +} + +my $cp_version; +open IN,"$checkpatch|"; +while () { + tr/A-Z/a-z/; + if (m/version\s*:\s*([\d\.]+)/) { + $cp_version = $1; + } +} +close IN; + +my $intree_checkpatch = "scripts/checkpatch.pl --version "; +if (!open IN,"$intree_checkpatch|") { + $intree_checkpatch = "v4l/".$intree_checkpatch; + open IN,"$intree_checkpatch|"; +} +$intree_checkpatch =~ s/--version/--no-tree --strict/; + +while () { + tr/A-Z/a-z/; + if (m/version\s*:\s*([\d\.]+)/) { + if ($1 > $cp_version) { + print "# WARNING: $checkpatch version $cp_version is\n" + ."# older than $intree_checkpatch version" + ." $1.\n# Using in-tree one.\n#\n"; + $cp_version = $1; + $checkpatch = $intree_checkpatch; + } + } +} +close IN; + +open IN,"$cmd | $checkpatch -q --nosignoff $fmt -|"; + +my $err=""; +my $errline=""; +my $file=""; +my $ln_numb; + +my $pwd=`pwd`; +$pwd =~ s|/[^/]+\n$||; + +sub print_err() +{ + if ($err =~ m/LINUX_VERSION_CODE/) { + return; + } + + if ($err) { + printf STDERR "%s/%s: In '%s':\n", $pwd, $file, $errline; + printf STDERR "%s/%s:%d: %s\n", $pwd, $file, $ln_numb, $err; + $err=""; + } +} + +if ($c_syntax == 0) { + while () { + s|^#[\d]+:\s*FILE:\s*|../|; + print "$_"; + } +} else { + while () { + if (m/^\+(.*)\n/) { + $errline=$1; + } elsif (m/^\#\s*[\d]+\s*:\s*FILE:\s*([^\:]+)\:([\d]+)/) { + $file=$1; + $ln_numb=$2; + } elsif (m/^\-\s*\:\d+\:\s*(.*)\n/) { + print_err(); + $err = $1; + $err =~ s/WARNING/warning/; + } +# print "# $_"; + } +} +close IN; +print_err(); diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.bttv media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.bttv --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.bttv 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.bttv 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,9 @@ +MDIR := v4l2 +snap := video4linux + +CONFIG_VIDEO_BTTV := m +CONFIG_VIDEO_CX88 := n +CONFIG_VIDEO_SAA7134 := n +CONFIG_VIDEO_IR := m +CONFIG_VIDEO_TUNER := m +CONFIG_VIDEO_TVAUDIO := m diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.cx88 media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.cx88 --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.cx88 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.cx88 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,9 @@ +MDIR := v4l2 +snap := video4linux + +CONFIG_VIDEO_BTTV := n +CONFIG_VIDEO_CX88 := m +CONFIG_VIDEO_SAA7134 := n +CONFIG_VIDEO_IR := n +CONFIG_VIDEO_TUNER := m +CONFIG_VIDEO_TVAUDIO := n diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.saa7134 media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.saa7134 --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/config.saa7134 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/config.saa7134 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,9 @@ +MDIR := v4l2 +snap := video4linux + +CONFIG_VIDEO_BTTV := n +CONFIG_VIDEO_CX88 := n +CONFIG_VIDEO_SAA7134 := m +CONFIG_VIDEO_IR := m +CONFIG_VIDEO_TUNER := m +CONFIG_VIDEO_TVAUDIO := m diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cx23885.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cx23885.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cx23885.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cx23885.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w +use strict; + +my %map = ( + "PCI_ANY_ID" => "0", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(CX23885_BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # cx88_boards + if (/\[(CX23885_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # cx88_pci_tbl + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.card\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cx88.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cx88.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/cx88.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/cx88.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w +use strict; + +my %map = ( + "PCI_ANY_ID" => "0", + "PCI_VENDOR_ID_PHILIPS" => "1131", + "PCI_VENDOR_ID_ASUSTEK" => "1043", + "PCI_VENDOR_ID_MATROX" => "102B", + "PCI_VENDOR_ID_ATI" => "1002", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(CX88_BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # cx88_boards + if (/\[(CX88_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # cx88_pci_tbl + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.card\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/diffrev.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/diffrev.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/diffrev.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/diffrev.sh 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,121 @@ +#/bin/bash + +# Set default tree locations, if you want, at the shell ENV +#GIT_TREE=$HOME/v4l-dvb +#HG_TREE=$HOME/v4l-dvb-hg + +# Should be adjusted to the environment +TMP_TREE=/tmp/oldtree +KERNVER_FILE=./v4l/scripts/etc/kern_version +FIXPATCHES=./v4l/scripts/etc/fixdiffs/* +BLACKLIST=./v4l/scripts/etc/blacklist.txt +GENTREE=./v4l/scripts/gentree.pl + +if [ "$1" == "--strip-dead-code" ]; then + GENTREE_ARGS="$1" + shift +fi + +if [ "$2" != "" ]; then + # + # Two arguments were given. One tree should be hg and the other git + # + if [ -e $1/.hg/hgrc ]; then + HG_TREE=$1 + GIT_TREE=$2 + else + HG_TREE=$2 + GIT_TREE=$1 + fi +else + # + # If just one argument is selected, and it is called from one tree + # use the other argument for the other tree type + # otherwise, use default plus the given tree name + # + if [ "$1" != "" ]; then + if [ -e $1/.hg/hgrc ]; then + HG_TREE=$1 + if [ -e .git/config ]; then + GIT_TREE=. + fi + elif [ -e $1/.git/config ]; then + GIT_TREE=$1 + if [ -e .hg/hgrc ]; then + HG_TREE=. + fi + fi + fi +fi + +if [ "$GIT_TREE" == "" ]; then + echo "No git tree were provided." + ERROR=1 +fi + +if [ "$HG_TREE" == "" ]; then + echo "No mercurial tree were provided." + ERROR=1 +fi + +if [ "$ERROR" != "" ]; then + echo "Usage: $0 [--strip-dead-code] []" + exit -1 +fi + +if [ ! -e "$GIT_TREE/.git/config" ]; then + echo "$GIT_TREE is not a git tree. Should specify a git tree to compare with the $HG_TREE mercurial tree" + exit -1 +fi + +if [ ! -e "$HG_TREE/.hg/hgrc" ]; then + echo "$HG_TREE is not a mercurial tree. Should specify -hg tree to compare with the $GIT_TREE git tree" + exit -1 +fi + +echo "comparing $HG_TREE -hg tree with $GIT_TREE -git tree." + + +run() { + echo $@ + $@ +} + +echo removing oldtree.. +run rm -rf $TMP_TREE +echo creating an oldtree.. +run $GENTREE $GENTREE_ARGS `cat $KERNVER_FILE` $HG_TREE/linux $TMP_TREE >/dev/null + +echo applying the fix patches +for i in $FIXPATCHES; do + echo $i + run patch --no-backup-if-mismatch -R -d $TMP_TREE -p2 -i $i -s + diffstat -p1 $i +done + +echo removing rej/orig from $GIT_TREE +run find $GIT_TREE -name '*.rej' -exec rm '{}' \; +run find $GIT_TREE -name '*.orig' -exec rm '{}' \; + +echo removing rej/orig from oldtree +run find $TMP_TREE -name '*.rej' -exec rm '{}' \; +run find $TMP_TREE -name '*.orig' -exec rm '{}' \; + +echo generating "/tmp/diff" +diff -upr $TMP_TREE $GIT_TREE|grep -v ^Somente |grep -v ^Only>/tmp/diff +echo "generating /tmp/diff2 (loose diff0)" +diff -uprBw $TMP_TREE $GIT_TREE|grep -v Somente |grep -v ^Only>/tmp/diff2 +echo generating /tmp/somente2 for a complete oldtree-only files +diff -upr $TMP_TREE $GIT_TREE|grep ^Somente|grep "drivers/media" |grep -vr ".o$" |grep -v ".mod.c"|grep -v ".o.cmd" |grep -v modules.order >/tmp/somente2 +diff -upr $TMP_TREE $GIT_TREE|grep ^Only|grep "drivers/media" |grep -vr ".o$" |grep -v ".mod.c"|grep -v ".o.cmd" |grep -v modules.order >>/tmp/somente2 + +echo generating /tmp/somente for oldtree-only files +cp /tmp/somente2 /tmp/s$$ +for i in `cat $BLACKLIST`; do + cat /tmp/s$$ | grep -v "Somente.* $i" >/tmp/s2$$ + mv /tmp/s2$$ /tmp/s$$ +done +mv /tmp/s$$ /tmp/somente +echo +echo diffstat -p1 /tmp/diff +diffstat -p1 /tmp/diff diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/do_commit.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/do_commit.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/do_commit.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/do_commit.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,36 @@ +#!/bin/bash + +EDITOR=$1 +WHITESPCE=$2 + +if [ "$WHITESPCE" == "" ]; then + exit 13 +fi + +TMPMSG=$1 + +scripts/cardlist +scripts/prep_commit_msg.pl $WHITESPCE > $TMPMSG + +#trap 'rm -rf $TMPMSG' EXIT + +CHECKSUM=`md5sum "$TMPMSG"` +$EDITOR $TMPMSG || exit $? +echo "$CHECKSUM" | md5sum -c --status && echo "*** commit message not changed. Aborting. ***" && exit 13 +DATE="`scripts/hghead.pl $TMPMSG|perl -ne 'if (m/\#[dD]ate:\s+(.*)/) { print $1; }'`" + +if [ "$DATE" != "" ]; then + echo Patch date is $DATE + scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -d "$DATE" -l - +else + scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -l - +fi + +if [ "$?" != "0" ]; then + echo "Couldn't apply the patch" + exit 13 +fi + +echo "*** PLEASE CHECK IF LOG IS OK:" +hg log -v -r -1 +echo "*** If not ok, do \"hg rollback\" and \"make commit\" again" diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/do_merge.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/do_merge.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/do_merge.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/do_merge.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,178 @@ +#!/usr/bin/perl + +my $merge_tree=shift or die "Should specify the pulled tree"; + +sub hgrcuser($) +{ + my $file = shift; + my $ui = 0; + open IN, '<', $file; + while () { + $ui = 1 if (/^\s*\[ui\]/); + if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { + close IN; + return($1); + } + } + close IN; + return(""); +} + +sub check_heads() +{ + my $count=0; + open IN, 'hg heads|'; + while () { + if (m/^[Cc]hangeset:/) { + $count++; + } + } + close IN; + return $count; +} + +sub curr_changeset() +{ + my $changeset = -1; + + open IN, 'hg heads|'; + while () { + if (m/^[Cc]hangeset:\s*(\d+)/) { + if ($changeset < 0) { + $changeset = $1; + } else { + if ($1 < $changeset) { + $changeset = $1; + } + } + } + } + close IN; + return $changeset; +} + +sub check_status() +{ + my $count=0; + open IN, 'hg status -m -a -d -r|'; + while () { + $count++; + } + close IN; + return $count; +} + +sub rollback() +{ + print "*** ERROR *** Rolling back hg pull $merge_tree\n"; + system("hg rollback"); + system("hg update -C"); + exit -1; +} + +#################### +# Determine username + +# Get Hg username from environment +my $user = $ENV{HGUSER}; + +# Didn't work? Try the repo's .hgrc file +if ($user eq "") { + my $hgroot = `hg root`; + chomp($hgroot); + $user = hgrcuser("$hgroot/.hg/hgrc"); +} +# Ok, try ~/.hgrc next +if ($user eq "") { + $user = hgrcuser("$ENV{HOME}/.hgrc"); +} + +# Still no luck? Try some other environment variables +if ($user eq "") { + my $name = $ENV{CHANGE_LOG_NAME}; + my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; + $user = "$name <$email>" if ($name ne "" || $email ne ""); +} + +# Last try to come up with something +if ($user eq "") { + print "*** ERROR *** User not known. Can't procceed\n"; + exit -1; +} + +###################### +# Do some sanity tests + +print "Checking if everything is ok, before applying the new tree.\n"; + +my $n_heads = check_heads(); +die "Your tree currently have more than one head (it has $n_heads heads). Can't procceed\n" if ($n_heads > 1); + +my $dirty = check_status(); +die "Your tree currently has changes. Can't procceed\n" if ($dirty); + +my $curr_cs = curr_changeset(); + +########### +# Pull tree + +print "hg pull -u $merge_tree\n"; + +my $ret = system("hg pull $merge_tree"); +die "Couldn't pull from $merge_tree\n" if ($ret); + +############################# +# Merge and commit, if needed + +$n_heads = check_heads(); +if ($n_heads > 2) { + print "The merged tree have more than one head (it has $n_heads heads). Can't procceed.\n"; + rollback(); +} + +if ($n_heads == 2) { + print "Merging the new changesets\n"; + + $ret = system("hg merge"); + if ($ret) { + print "hg merge failed. Can't procceed.\n"; + rollback(); + } + + print "Committing the new tree\n"; + # Write the commit message + $msg= "merge: $merge_tree\n\nFrom: $user\n\nSigned-off-by: $user\n"; + $ret=system("hg commit -m '$msg'"); + if ($ret) { + print "hg commit failed. Can't procceed.\n"; + rollback(); + } +} + +##################### +# Test resulting tree + +print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; +$ret = system ('make allmodconfig'); +if (!ret) { + $ret = system ('make mismatch|egrep -v "^\s*CC"|egrep -v "^\s*LD"'); +} +if ($ret) { + print "*** ERROR *** Build failed. Can't procceed.\n"; + + # To avoid the risk of doing something really bad, let's ask the user to run hg strip + print "Your tree is dirty. Since hg has only one rollback level, you'll need to use, instead:"; + print "\thg strip $curr_cs; hg update -C"; + print "You'll need to have hg mq extension enabled for hg strip to work.\n"; + + exit -1; +} + +############################## +# Everything is ok, let's push + +print "Pushing the new tree at the remote repository specified at .hg/hgrc\n"; +$ret=system ("hg push"); +if ($ret) { + print "hg push failed. Don't forget to do the push later.\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/em28xx.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/em28xx.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/em28xx.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/em28xx.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +my $debug = 0; + +while (<>) { + # defines in header file + if (/#define\s+(EM2[\d][\d][\d]_BOARD_[\w\d_]+)\s+(\d+)/) { + printf("$1 = $2\n") if ($debug); + $data{$1}->{nr} = $2; + next; + } + # em2820_boards + if (/\[(EM2820_BOARD_[\w\d_]+)\]/) { + $id = $1; + printf("ID = $id\n") if $debug; + $data{$id}->{id} = $id; + $data{$id}->{type} = "(em2820/em2840)"; +# $data{$id}->{nr} = $nr++; + } elsif (/\[(EM)(2[\d]..)(_BOARD_[\w\d_]+)\]/) { + $id = "$1$2$3"; + printf("ID = $id\n") if $debug; + $data{$id}->{id} = $id; + $data{$id}->{type} = "(em$2)"; +# $data{$id}->{nr} = $nr++; + }; + + next unless defined($id); + + if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*)/ ) { + $subvendor=$1; + $subdevice=$2; + } + + if (/.*driver_info.*(EM2[\d].._BOARD_[\w\d_]+)/ ) { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + } + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + if (defined $data{$id}->{name} && $debug) { + printf("name[$id] = %s\n", $data{$id}->{name}); + } + } + + # em2820_USB_tbl + + +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-40s %-15s", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{type}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/blacklist.txt media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/blacklist.txt --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/blacklist.txt 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/blacklist.txt 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,14 @@ +\.orig +\.rej +\.cvsignore +bt87x.c +i2c-compat.h +at76c651[.][ch] +tda80xx[.][ch] +tvmixer.c +aci.[ch] +btaudio.c +dvb-ttusb-dspbootcode.h +cpia2patch.h +dabfirmware.h +^firmware/ diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/98.patch media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/98.patch --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/98.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/98.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,18 @@ + +diff -upr oldtree/drivers/media/dvb-core/dvb_net.c /home/v4l/tokernel/wrk/linux-next/drivers/media/dvb-core/dvb_net.c +--- next/drivers/media/dvb-core/dvb_net.c 2010-01-15 19:05:35.000000000 -0200 ++++ ../oldtree/drivers/media/dvb-core/dvb_net.c 2010-01-15 19:11:43.000000000 -0200 +@@ -949,11 +949,8 @@ static int dvb_net_filter_sec_set(struct + (*secfilter)->filter_mask[10] = mac_mask[1]; + (*secfilter)->filter_mask[11]=mac_mask[0]; + ++ dprintk("%s: filter mac=%pM\n", dev->name, mac); ++ dprintk("%s: filter mask=%pM\n", dev->name, mac_mask); +- dprintk("%s: filter mac=%02x %02x %02x %02x %02x %02x\n", +- dev->name, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); +- dprintk("%s: filter mask=%02x %02x %02x %02x %02x %02x\n", +- dev->name, mac_mask[0], mac_mask[1], mac_mask[2], +- mac_mask[3], mac_mask[4], mac_mask[5]); + + return 0; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/99.patch media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/99.patch --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/99.patch 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/fixdiffs/99.patch 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,24 @@ +Whitespace cleanup + +--- git/sound/pci/bt87x.c 2007-10-16 23:42:25.000000000 -0200 ++++ ../oldtree/sound/pci/bt87x.c 2007-10-17 12:46:18.000000000 -0200 +@@ -122,8 +122,8 @@ MODULE_PARM_DESC(load_all, "Allow to loa + /* RISC instruction bits */ + #define RISC_BYTES_ENABLE (0xf << 12) /* byte enable bits */ + #define RISC_RESYNC ( 1 << 15) /* disable FDSR errors */ +-#define RISC_SET_STATUS_SHIFT 16 /* set status bits */ +-#define RISC_RESET_STATUS_SHIFT 20 /* clear status bits */ ++#define RISC_SET_STATUS_SHIFT 16 /* set status bits */ ++#define RISC_RESET_STATUS_SHIFT 20 /* clear status bits */ + #define RISC_IRQ ( 1 << 24) /* interrupt */ + #define RISC_EOL ( 1 << 26) /* end of line */ + #define RISC_SOL ( 1 << 27) /* start of line */ +@@ -226,7 +226,7 @@ static inline void snd_bt87x_writel(stru + } + + static int snd_bt87x_create_risc(struct snd_bt87x *chip, struct snd_pcm_substream *substream, +- unsigned int periods, unsigned int period_bytes) ++ unsigned int periods, unsigned int period_bytes) + { + struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); + unsigned int i, offset; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/kern_version media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/kern_version --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/etc/kern_version 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/etc/kern_version 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1 @@ +2.6.33 diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/fix_dvb_customise.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/fix_dvb_customise.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/fix_dvb_customise.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/fix_dvb_customise.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,335 @@ +#!/usr/bin/perl +use strict; +use warnings; +use File::Find; +use Fcntl ':mode'; + +my $debug = 0; + +my $SRC = "../linux"; +my $fname = "$SRC/drivers/media/dvb-frontends/Makefile"; + +#################### +# Get Makefile rules +# +sub get_makefile($) +{ + my $file = shift; + my %rules; + my %composite; + + open IN, $file or die "Can't find $file\n"; + while () { + # Handle line continuations + if (/\\\n$/) { + $_ .= ; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + + if (m/(^\s*[[\da-zA-Z-_]+)-objs\s*[\:\+]*\=\s*(.*)\n/) { + my $dep=$1; + my $file = $2; + $file =~ s/\.o / /g; + $file =~ s/\.o$//; + + if ($file eq "") { + die "broken dep on file $file for $dep\n"; + } + + $composite{$dep} = $file; + printf "MULTI: $dep = $file\n" if ($debug > 1); + } + + if (m/^\s*obj\-\$\(CONFIG_([^\)]+)\)\s*[\:\+]*\=\s*(.*)\n/) { + my $rule = $1; + my $file = $2; + + $file =~ s/\.o / /g; + $file =~ s/\.o$//; + + $rules{$rule} = $file; + printf "RULE: $rule = $file\n" if ($debug > 1); + } + } + close IN; + + return (\%rules, \%composite); +} + +########################### +# Seeks header dependencies +# +my %header_deps; + +# For a more complete check, use: +# my $hfiles = "*.c"; +my $hfiles = "av7110_av.c av7110.c av7110_ca.c av7110_hw.c av7110_ipack.c av7110_ir.c av7110_v4l.c budget-patch.c dvb_ringbuffer.c nova-t-usb2.c umt-010.c"; + +sub get_header_deps() +{ + my $file = shift; + my %rules; + my %composite; + + open IN, "gcc -I ../linux/include -I . -DCONFIG_PCI -D__LITTLE_ENDIAN -D_COMPAT_H -DKERNEL_VERSION\\(a,b,c\\) -MM $hfiles|"; + while () { + # Handle line continuations + if (/\\\n$/) { + $_ .= ; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + + if (m/^([^\:]+)\s*\:\s*(.*)/) { + my $dep = $1; + my $file = $2; + + $dep =~ s|.*/||; + $dep =~ s/\.o$//; + + my @files = split(/\s/, $file); + foreach my $f (@files) { + $f =~ s|.*/||; + + if (!defined($header_deps{$f})) { + $header_deps{$f} = $dep; + } else { + $header_deps{$f} .= " " . $dep; + } + + } + } + } + close IN; + + if ($debug > 1) { + print "Header deps for: "; + print "$_ " foreach %header_deps; + print "\n"; + } +} + + +########################### +# Seeks files for Makefiles +# + +my %driver_config; + +sub parse_makefiles() +{ + my $fname = $File::Find::name; + + return if !($fname =~ m|/Makefile$|); + return if ($fname =~ m|drivers/media/dvb-frontends/|); + + + my ($refs, $mult) = get_makefile($fname); + + foreach my $ref (keys %$refs) { + my $file=$$refs{$ref}; + + my @files = split(/\s/, $file); + foreach my $f (@files) { + if (defined($$mult{$f})) { + $file .= " " . $$mult{$f}; + } + } + + $file =~ s|/||g; + + @files = split(/\s/, $file); + foreach my $f (@files) { + $driver_config{$f} = $ref; + } + if ($debug > 1) { + print "$ref = "; + print "$_ " foreach @files; + print "\n"; + } + } +} + + +######################## +# Seeks files for header +# +my %select; + +sub found_ref($$) +{ + my $file = shift; + my $header = shift; + my $found = 0; + my $name = $file; + $name =~ s|.*/||; + + $name =~ s/flexcop-fe-tuner.c/b2c2-flexcop/; + $name =~ s/av7110.c/av7110.h/; + + if (defined ($header_deps{$name})) { + $name = $header_deps{$name}; + } else { + $name =~ s/\.[ch]$//; + } + + my @files = split(/\s/, $name); + foreach my $n (@files) { + if (defined($driver_config{$n})) { + my $ref = $driver_config{$n}; + printf "$ref needs %s\n", $header if ($debug); + + if ($ref =~ m/(PVRUSB2|CX23885|CX88|EM28XX|SAA3134 + |SAA7164)/) { + $ref .="_DVB"; + } + + if (!defined($select{$ref})) { + $select{$ref} = $header; + } else { + $select{$ref} .= " " . $header; + } + $found = 1; + } + } + + if (!$found) { + printf "$file needs %s\n", $header; + } +} + +######################## +# Seeks files for header +# + +my %header; + +sub parse_headers() +{ + my $file = $File::Find::name; + + return if !($file =~ m/\.[ch]$/); + return if ($file =~ m|drivers/media/dvb-frontends/|); + + open IN, $file or die "Can't open $file\n"; + while () { + if (m/^\s*\#include\s+\"([^\"]+)\"/) { + if (defined($header{$1})) { + my $head = $header{$1}; + found_ref ($file, $head); + } + } + } + close IN; +} + +######################## +# Rewrite Kconfig's +# + +sub parse_kconfigs() +{ + my $file = $File::Find::name; + my $conf; + my $out = ""; + my $tmp = ""; + my $all_sels; + + return if !($file =~ m/Kconfig$/); + return if ($file =~ m|drivers/media/dvb-frontends/|); + + open IN, $file or die "Can't open $file\n"; + while () { + if (m/^config\s([A-Za-z_\-\d]+)/) { + $out .= $tmp; + if (defined($select{$1})) { + $conf = $select{$1}; + $all_sels = " ". $conf. " "; + $tmp = $_; + + printf "$file: rewriting headers for $1. It should select: %s\n", $all_sels if ($debug); + } else { + $conf = ""; + $out .= $_; + $tmp = ""; + } + next; + } + if (!$conf) { + $out .= $_; + next; + } + + if (m/^\s*select\s+([A-Za-z_\-\d]+)/) { + my $op = $1; + + if (!$all_sels =~ m/\s($op)\s/) { + # Drops line + printf "$file: droppingg line $_\n"; + + next; + } else { + $all_sels =~ s/\s($op)\s/ /; + } + } + if (m/^[\s\-]*help/) { + my @sel = split(/\s/, $all_sels); + foreach my $s (@sel) { + if ($s ne "") { + printf "$file: Adding select for $s\n"; + $tmp .= "\tselect $s if !DVB_FE_CUSTOMISE\n"; + } + } + } + $tmp .= $_; + } + close IN; + + $out .=$tmp; + open OUT, ">$file" or die "Can't open $file\n"; + print OUT $out; + close OUT; +} + +##### +#main + +get_header_deps(); + +my ($FEs, $mult) = get_makefile($fname); + +foreach my $fe (keys %$FEs) { + my $file=$$FEs{$fe}; + my $found = 0; + + # Special cases + $file =~ s/tda10021/tda1002x/; + $file =~ s/tda10023/tda1002x/; + $file =~ s/dib3000mb/dib3000/; + + if (defined($$mult{$file})) { + $file .= " ".$$mult{$file}; + } + + my @files = split(/\s/, $file); + foreach my $f (@files) { + if (stat("$f.h")) { + printf "$fe = $f.h\n" if ($debug); + $found = 1; + $header {"$f.h"} = $fe; + last; + } + } + + if (!$found) { + printf "$file.h ($fe) not found in $file\n"; + exit -1; + } +} + +find({wanted => \&parse_makefiles, no_chdir => 1}, $SRC); +find({wanted => \&parse_headers, no_chdir => 1}, $SRC); +find({wanted => \&parse_kconfigs, no_chdir => 1}, $SRC); diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/fix_kconfig.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/fix_kconfig.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/fix_kconfig.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/fix_kconfig.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use strict; + +my $need_changes = 0; +my $out; + +open IN, '<.config'; +while () { + s/CONFIG_VIDEO_CX88_MPEG=y/CONFIG_VIDEO_CX88_MPEG=m/ and $need_changes=1; + $out .= $_; +} +close IN; + +if ($need_changes) { + printf("There's a known bug with the building system with this kernel. Working around.\n"); + open OUT, '>.config'; + print OUT $out; + close OUT; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/gentree.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/gentree.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/gentree.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/gentree.pl 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1,264 @@ +#!/usr/bin/perl +# +# Original version were part of Gerd Knorr's v4l scripts. +# +# Several improvements by (c) 2005-2007 Mauro Carvalho Chehab +# +# Largely re-written (C) 2007 Trent Piepho +# +# Theory of Operation +# +# This acts as a sort of mini version of cpp, which will process +# #if/#elif/#ifdef/etc directives to strip out code used to support +# multiple kernel versions or otherwise not wanted to be sent upstream to +# git. +# +# Conditional compilation directives fall into two catagories, +# "processed" and "other". The "other" directives are ignored and simply +# output as they come in without changes (see 'keep' exception). The +# "processed" variaty are evaluated and only the lines in the 'true' part +# are kept, like cpp would do. +# +# If gentree knows the result of an expression, that directive will be +# "processed", otherwise it will be an "other". gentree knows the value +# of LINUX_VERSION_CODE, BTTV_VERSION_CODE, the KERNEL_VERSION(x,y,z) +# macro, numeric constants like 0 and 1, and a few defines like +# I2C_CLASS_TV_DIGITAL +# +# An exception is if the comment "/*KEEP*/" appears after the expression, +# in which case that directive will be considered an "other" and not +# processed, other than to remove the keep comment. +# +# Known bugs: +# don't specify the root directory e.g. '/' or even '////' +# directives continued with a back-slash will always be ignored +# you can't modify a source tree in-place, i.e. source dir == dest dir + +use strict; +use File::Find; +use Fcntl ':mode'; +use Getopt::Long; + +my $DEBUG = 0; +my $dead_code = 0; + +GetOptions( "--debug" => \$DEBUG, + "--strip-dead-code" => \$dead_code ); + +my $VERSION = shift; +my $SRC = shift; +my $DESTDIR = shift; +my $BTTVCODE = KERNEL_VERSION(0,9,17); +my ($LINUXCODE, $extra) = kernel_version($VERSION); + +if (!defined($DESTDIR)) { + print "Usage:\ngentree.pl\t[--debug] \n\n"; + exit; +} + +my %defs = ( + 'LINUX_VERSION_CODE' => $LINUXCODE, + 'BTTV_VERSION_CODE' => $BTTVCODE, + '_COMPAT_H' => 0, + 'I2C_CLASS_TV_ANALOG' => 1, + 'I2C_CLASS_TV_DIGITAL' => 1, + 'OLD_XMIT_LOCK' => 0, + 'COMPAT_SND_CTL_BOOLEAN_MONO' => 0, + 'NEED_SOUND_DRIVER_H' => 0, + 'TTUSB_KERNEL' => 1, + 'NO_PCM_LOCK' => 0, + 'NEED_ALGO_CONTROL' => 0, +); + +################################################################# +# helpers + +sub kernel_version($) { + $_[0] =~ m/(\d+)\.(\d+)\.(\d+)(.*)/; + return ($1*65536 + $2*256 + $3, $4); +} + +# used in eval() +sub KERNEL_VERSION($$$) { return $_[0]*65536 + $_[1]*256 + $_[2]; } + +sub evalexp($) { + local $_ = shift; + s|/\*.*?\*/||go; # delete /* */ comments + s|//.*$||o; # delete // comments + s/\bdefined\s*\(/(/go; # defined(foo) to (foo) + while (/\b([_A-Za-z]\w*)\b/go) { + if (exists $defs{$1}) { + my $id = $1; my $pos = $-[0]; + s/$id/$defs{$id}/; + pos = $-[0]; + } elsif ($1 ne 'KERNEL_VERSION') { + return(undef); + } + } + return(eval($_) ? 1 : 0); +} + +################################################################# +# filter out version-specific code + +sub filter_source ($$) { + my ($in,$out) = @_; + my $line; + my $level=0; + my %if = (); + my %state = (); + + my @dbgargs = \($level, %state, %if, $line); + sub dbgline($\@) { + my $level = ${$_[1][0]}; + printf STDERR ("/* BP %4d $_[0] state=$_[1][1]->{$level} if=$_[1][2]->{$level} level=$level (${$_[1][3]}) */\n", $.) if $DEBUG; + } + + open IN, '<', $in or die "Error opening $in: $!\n"; + open OUT, '>', $out or die "Error opening $out: $!\n"; + + print STDERR "File: $in, for kernel $VERSION($LINUXCODE)/\n" if $DEBUG; + + while ($line = ) { + chomp $line; + next if ($line =~ m/^#include \"compat.h\"/o); +# next if ($line =~ m/[\$]Id:/); + + # For "#if 0 /*KEEP*/;" the ; should be dropped too + if ($line =~ m@^\s*#\s*if(n?def)?\s.*?(\s*/\*\s*(?i)keep\s*\*/;?)@) { + $state{$level} = "ifother"; + $if{$level} = 1; + dbgline "#if$1 (keep)", @dbgargs; + $line =~ s/\Q$2\E//; + $level++; + } + # preserve #if 0/#if 1, if $dead_code = 0 + elsif (!$dead_code && $line =~ m@^\s*#\s*if\s*([01])[^\d]@) { + $state{$level} = "ifother"; + $if{$level} = 1; + dbgline "#if $1", @dbgargs; + $level++; + } + # handle all ifdef/ifndef lines + elsif ($line =~ /^\s*#\s*if(n?)def\s*(\w+)/o) { + if (exists $defs{$2}) { + $state{$level} = 'if'; + $if{$level} = ($1 eq 'n') ? !$defs{$2} : $defs{$2}; + dbgline "#if$1def $2", @dbgargs; + $level++; + next; + } + $state{$level} = "ifother"; + $if{$level} = 1; + dbgline "#if$1def (other)", @dbgargs; + $level++; + } + # handle all ifs + elsif ($line =~ /^\s*#\s*if\s+(.*)$/o) { + my $res = evalexp($1); + if (defined $res) { + $state{$level} = 'if'; + $if{$level} = $res; + dbgline '#if '.($res?'(yes)':'(no)'), @dbgargs; + $level++; + next; + } else { + $state{$level} = 'ifother'; + $if{$level} = 1; + dbgline '#if (other)', @dbgargs; + $level++; + } + } + # handle all elifs + elsif ($line =~ /^\s*#\s*elif\s+(.*)$/o || $line =~ /^\s*#\s*elseif\s+(.*)$/o) { + my $exp = $1; + $level--; + $level < 0 and die "more elifs than ifs"; + $state{$level} =~ /if/ or die "unmatched elif"; + + if ($state{$level} eq 'if' && !$if{$level}) { + my $res = evalexp($exp); + defined $res or die 'moving from if to ifother'; + $state{$level} = 'if'; + $if{$level} = $res; + dbgline '#elif1 '.($res?'(yes)':'(no)'), @dbgargs; + $level++; + next; + } elsif ($state{$level} ne 'ifother') { + $if{$level} = 0; + $state{$level} = 'elif'; + dbgline '#elif0', @dbgargs; + $level++; + next; + } + $level++; + } + elsif ($line =~ /^\s*#\s*else/o) { + $level--; + $level < 0 and die "more elses than ifs"; + $state{$level} =~ /if/ or die "unmatched else"; + $if{$level} = !$if{$level} if ($state{$level} eq 'if'); + $state{$level} =~ s/^if/else/o; # if -> else, ifother -> elseother, elif -> elif + dbgline '#else', @dbgargs; + $level++; + next if $state{$level-1} !~ /other$/o; + } + elsif ($line =~ /^\s*#\s*endif/o) { + $level--; + $level < 0 and die "more endifs than ifs"; + dbgline '#endif', @dbgargs; + next if $state{$level} !~ /other$/o; + } + + my $print = 1; + for (my $i=0;$i<$level;$i++) { + next if $state{$i} =~ /other$/o; # keep code in ifother/elseother blocks + if (!$if{$i}) { + $print = 0; + dbgline 'DEL', @{[\$i, \%state, \%if, \$line]}; + last; + } + } + print OUT "$line\n" if $print; + } + close IN; + close OUT; +} + +################################################################# + +sub parse_dir { + my $file = $File::Find::name; + + return if ($file =~ /CVS/); + return if ($file =~ /~$/); + + my $f2 = $file; + $f2 =~ s/^\Q$SRC\E/$DESTDIR/; + + my $mode = (stat($file))[2]; + if ($mode & S_IFDIR) { + print("mkdir -p '$f2'\n"); + system("mkdir -p '$f2'"); # should check for error + return; + } + print "from $file to $f2\n"; + + if ($file =~ m/.*\.[ch]$/) { + filter_source($file, $f2); + } else { + system("cp $file $f2"); + } +} + + +# main + +printf "kernel is %s (0x%x)\n",$VERSION,$LINUXCODE; + +# remove any trailing slashes from dir names. don't pass in just '/' +$SRC =~ s|/*$||; $DESTDIR =~ s|/*$||; + +print "finding files at $SRC\n"; + +find({wanted => \&parse_dir, no_chdir => 1}, $SRC); diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/headers_convert.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/headers_convert.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/headers_convert.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/headers_convert.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,30 @@ +#!/usr/bin/perl +# +# headers_install prepare the listed header files for use in +# user space and copy the files to their destination. +# + +use strict; +use warnings; + +foreach (@ARGV) { + my $file = $_; + my $tmpfile = $file . ".tmp"; + + open(my $infile, '<', "$file") + or die "$file: $!\n"; + open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; + while (my $line = <$infile>) { + $line =~ s/([\s(])__user\s/$1/g; + $line =~ s/([\s(])__force\s/$1/g; + $line =~ s/([\s(])__iomem\s/$1/g; + $line =~ s/\s__attribute_const__\s/ /g; + $line =~ s/\s__attribute_const__$//g; + $line =~ s/^#include //; + printf $outfile "%s", $line; + } + close $outfile; + close $infile; + system "mv $tmpfile $file"; +} +exit 0; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/hghead.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/hghead.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/hghead.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/hghead.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,221 @@ +#!/usr/bin/perl +use strict; + +################################################################# +# analyse diffs + +my $in = shift; +my $line; +my $subject; +my $sub_ok=0; +my $init=0; +my $num=0; +my $hgimport=0; +my $mmimport=0; +my $maint_ok=0; +my $noblank=1; +my $maintainer_name=$ENV{CHANGE_LOG_NAME}; +my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; +my $from=""; +my $body=""; +my $priority=""; +my $signed=""; +my $fromname=""; + +open IN, "<$in"; + +while ($line = ) { + if ($line =~ m/^\s*Index.*/) { + last; + } + if ($line =~ m/^diff .*/) { + last; + } + if ($line =~ m/^\-\-\- .*/) { + last; + } + if ($line =~ m/^\-\-\-\-.*/) { + $body=""; + next; + } + if ($line =~ m/^\-\-\-.*/) { + last; + } + if ($line =~ m/^\+\+\+ .*/) { + last; + } + + if ($line =~ m/^#\s*Date\s*(.*)/) { + print "#Date: $1\n"; + next; + } + + if ($line =~ m/^Date:\s*(.*)/) { + print "#Date: $1\n"; + next; + } + + $line =~ s/^#\sUser/From:/; + + my $tag=$line; + my $arg=$line; + $tag =~ s/\s*([^\s]+:)\s*(.*)\n/\1/; + $arg =~ s/\s*([^\s]+:)\s*(.*)\n/\2/; + + $tag =~ tr/A-Z/a-z/; + + if ($tag =~ m/^from:/) { + if ($arg =~ m/^[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + if ($1 eq "") { + next; + } + my $name=$1; + my $email=$2; + $name =~ s/\s+$//; + $email =~ s/\s+$//; + $fromname="$name <$email>"; + $from= "From: $fromname\n"; + next; + } + if ($line =~ m/^From:\sakpm\@osdl.org/) { + $mmimport=1; + next; + } + print "Bad: author line have a wrong syntax: $line\n"; + die; + } + + if ($tag =~ m/^subject:/) { + $subject = "$arg\n"; + $sub_ok = 1; + next; + } + + if ($tag =~ m/^priority:/) { + $arg =~ tr/A-Z/a-z/; + + # Replace the -git branch names for high/normal/low + $arg =~ s/^fixes$/high/; + $arg =~ s/^fix$/high/; + $arg =~ s/^working$/normal/; + $arg =~ s/^work$/normal/; + $arg =~ s/^pending$/low/; + $priority = "Priority: $arg"; + next; + } + + if ($line =~ m;^ .*\/.*\| *[0-9]*;) { + next; + } + if ($line =~m/\d+\s*file.* changed, /) { + next; + } + + if ($tag =~ m/^signed-off-by:.*/) { + $noblank=1; + if ($line =~ m/$maintainer_name/) { + $maint_ok=1; + } + + $signed="$signed$line"; + next; + } + if ( ($line =~ m/^\# HG changeset patch/) || + ($line =~ m/^has been added to the -mm tree. Its filename is/) ) { + $sub_ok=0; + $init=0; + $num=0; + $maint_ok=0; + $noblank=1; + $from=""; + $body=""; + $subject=""; + $hgimport=1; + next; + } + + if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|noticed-by|tested-by|cc):/) { + $signed="$signed$line"; + next; + } + + # Keep review lines together with the signatures + if ($line =~ m/^\[.*\@.*\:.*\]\n/) { + $signed="$signed$line"; + next; + } + + if ($tag =~ m/changeset:\s*(.*)\n/) { + $num=$1; + } + + if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) { + $subject=$1; + $sub_ok = 1; + $line="\n"; + } + + if ($line =~ m/^#/) { + next; + } + if ($sub_ok == 0) { + if ($line =~ m/^\s*\n/) { + next; + } + $sub_ok=1; + if ($subject =~ m|V4L\/DVB\s*(.+)|) { + $subject=$1; + } + $subject=$line; + next; + } + + if ($noblank) { + if ($line =~ m/^\n/) { + next; + } + } + if (!$init) { + $init=1; + $noblank=0; + } + $body="$body$line"; +} +close IN; + +if ($from eq "") { + print "Bad: author doesn't exist!\n"; + die; +} + +if (!$maint_ok && $maintainer_name && $maintainer_email) { + print "#No maintainer's signature. Adding it.\n"; + $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n"; +} + +if (!$signed =~ m/$from/) { + print "Bad: Author didn't signed his patch!\n"; + die; +} + +$from=~s/^[\n\s]+//; +$from=~s/[\n\s]+$//; + +$subject=~s/^[\n\s]+//; +$subject=~s/[\n\s]+$//; + +$body=~s/^[\n]+//; +$body=~s/[\n\s]+$//; + +if ($priority ne "") { + $body="$body\n\n$priority"; +} + +$body="$body\n\n$signed"; + +$body=~s/^[\n\s]+//; +$body=~s/[\n\s]+$//; + +# First from is used by hg to recognize commiter name +print "#Committer: $maintainer_name <$maintainer_email>\n"; +print "$subject\n\n$from\n\n$body\n"; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/hg-pull-req.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/hg-pull-req.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/hg-pull-req.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/hg-pull-req.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,125 @@ +#!/usr/bin/perl + +# Copyright (C) 2006 Trent Piepho +# Automatic pull request generator + +# Generates a pull request for all changesets in current Hg repository, that +# do not appear in a remote repository. +# +# There are _three_ repositories involved in this operation. +# +# The first is the remote repository that you want your changes to be pulled +# into. The default is the master repository at +# http://linuxtv.org/hg/v4l-dvb, but you can specify something else if you +# want. This repository is called the "to repo". +# +# The next two repositories should be copies of each other. The first is your +# local repository. You must run this script from some directory in that +# repository. The second repository is a remote copy on some public server, +# e.g. linuxtv.org. This is called the "from repo". The default for the from +# repo is the "default-push" path from the Hg configuration, which is where hg +# will push to if you don't specify a path to "hg push". The script will do +# some checks to make sure these two repositories are copies of each other. +# +# The repository used to the changesets are comming from is local repository, +# due to Mercurial's limitations. However, links to your local repository +# would be useless in a pull request, because no one else can see your local +# repository. So, the links are change to use the "from repo" instead. This +# is why your local repo and the from repo must be copies of each other. +# Running "hg push" before generating the pull request should be enough. + +$maintainer = 'Mauro'; +$to_repo = 'http://linuxtv.org/hg/v4l-dvb'; +# Default for when a default-push path wasn't defined +$from_repo_base = 'http://linuxtv.org/hg/~username/'; + +# What to open for the pull request +$output_file = '>&STDOUT'; +# Example, to a local file: '>pull_req' +# Example, file on remote host: '|ssh remote.host.com cat \\> pull_req' + +# Text of the pull request. $nstr is e.g. "changeset" or "42 changesets" +$salutation = <<'EOF'; +$maintainer, + +Please pull from $from_repo + +for the following $nstr: + +EOF + +# The closing of the request, name and fname taken from hg username setting +$valediction = <<'EOF'; + +Thanks, +$fname +EOF + +if($#ARGV < 0) { + if(`hg showconfig paths` =~ m/^paths\.default-push=(.*)$/m) { + $from_repo = $1; + $from_repo =~ s/^ssh:/http:/; + } else { + `hg root` =~ m|/([^/]+)\n$|; + my $repo = $1; + $from_repo = $from_repo_base . $repo; + } +} + +$from_repo = $ARGV[0] if($#ARGV >= 0); +$to_repo = $ARGV[1] if($#ARGV >= 1); + +open OUT, $output_file or die "Opening: $!"; + +if (`hg outgoing $from_repo` !~ /^no changes found$/m || + `hg incoming $from_repo` !~ /^no changes found$/m) { + my $cur = `hg root`; chomp $cur; + print "$cur and $from_repo do not match!\n"; + print "Prehaps you forgot to push your changes?\n"; + exit; +} + +open IN, "hg outgoing -M $to_repo |"; +while() { + if(/^changeset:\s+\d+:([[:xdigit:]]{12})$/) { + push @changesets, $1; + } elsif(/^summary:\s+(\S.*)$/) { + if ($1 =~ /^merge:/) { + # Skip merge changesets + pop @changesets; + } else { + push @summaries, $1; + } + } +} +close IN; +$#changesets == $#summaries or die "Confused by hg outgoing output"; + +foreach (0 .. $#summaries) { + if($summaries[$_] =~ /^merge:/) { + splice @summaries, $_, 1; + splice @changesets, $_, 1; + } +} + +$n = $#changesets + 1; +$n > 0 or die "Nothing to pull!"; +$nstr = ($n==1)?"changeset":"$n changesets"; + +print OUT eval qq("$salutation"); + +for (0 .. $#summaries) { + printf OUT "%02d/%02d: $summaries[$_]\n", $_+1, $n; + print OUT "$from_repo?cmd=changeset;node=$changesets[$_]\n"; + print OUT "\n"; +} + +print OUT "\n"; + +open IN, 'hg export ' . join(' ', @changesets) . '| diffstat |'; +print OUT while(); +close IN; + +`hg showconfig ui.username` =~ m/((\S+).*)\s+ "0", + "PCI_VENDOR_ID_PHILIPS" => "1131", + "PCI_VENDOR_ID_ASUSTEK" => "1043", + "PCI_VENDOR_ID_MATROX" => "102B", + "PCI_VENDOR_ID_ATI" => "1002", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +open ($input, "../saa7134-cards.c"); + +print ("\n"); +print ("1131 Philips Semiconductors\n"); + +my %data; + +while (<$input>) { + + if (/\[(SAA7134_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; + $data{$id}->{subvendor} = "0"; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # saa7134_pci_tbl + $device = $1 if (/\.device\s*=\s*(\w+),/); + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.driver_data\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0" && + defined($device)) { + $data{$1}->{device} = $device; + $data{$1}->{subvendor} = $subvendor; + $data{$1}->{subdevice} = $subdevice; + undef $device; + undef $subvendor; + undef $subdevice; + } + } +} + +sub print_cards ($) { + my $filter = shift; + foreach my $item (sort {$data{$a}->{subvendor} cmp $data{$b}->{subvendor}} keys (%data)) + { + if (defined ($data{$item}->{device}) && ($data{$item}->{device} eq $filter)) { + printf("\t\t"); + printf("%s %s %s", $data{$item}->{subvendor}, $data{$item}->{subdevice}, $data{$item}->{name}); + print "\n"; + } + } +} + +print ("\t7130 SAA7130 Video Broadcast Decoder\n"); +print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7130"); +print ("\t7133 SAA7133/SAA7135 Video Broadcast Decoder\n"); +print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7133"); +print ("\t7134 SAA7134 Video Broadcast Decoder\n"); +print_cards ("PCI_DEVICE_ID_PHILIPS_SAA7134"); + +open ($input, "../cx88-cards.c"); + +%data=(); + +while (<$input>) { + if (/\[(CX88_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; + $data{$id}->{subvendor} = "0"; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.card\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + $data{$1}->{subvendor} = $subvendor; + $data{$1}->{subdevice} = $subdevice; + undef $subvendor; + undef $subdevice; + } + } +} + +print ("14f1 Conexant\n"); +print ("\t8800 CX23880/1/2/3 PCI Video and Audio Decoder\n"); + +foreach my $item (sort {$data{$a}->{subvendor} cmp $data{$b}->{subvendor}} keys (%data)) +{ + if (defined ($data{$item}->{subdevice}) && ($data{$item}->{subvendor} ne "0")) { + printf("\t\t"); + printf("%s %s %s", $data{$item}->{subvendor}, $data{$item}->{subdevice}, $data{$item}->{name}); + print "\n"; + } +} + +print ("109e Brooktree Corporation\n"); +print ("\t032e Bt878 Video Capture\n"); +%data=(); + +open ($input, "../bttv-cards.c"); +while (<$input>) { + if (/\{\s*0x(\w{4})(\w{4}),.*\"([^\"]+)\"\s\},/) + { + printf ("\t\t%s %s %s\n", $2, $1, $3); + } +} + +printf ("\n"); diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_config_compat.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_config_compat.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_config_compat.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_config_compat.pl 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,779 @@ +#!/usr/bin/perl +use strict; + +my $kdir=shift or die "should specify a kernel dir"; +my $infile=shift or die "should specify an input config file"; +my $outfile=shift or die "should specify an output config file"; + +my $out; + +sub check_spin_lock() +{ + my $file = "$kdir/include/linux/netdevice.h"; + my $old_syntax = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/netif_tx_lock_bh/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define OLD_XMIT_LOCK 1\n"; + } + close INNET; +} + +sub check_sound_driver_h() +{ + my $file = "$kdir/include/sound/driver.h"; + my $old_syntax = 1; + + open INNET, "<$file" or return; + while () { + if (m/This file is deprecated/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define NEED_SOUND_DRIVER_H 1\n"; + } + close INNET; +} + +sub check_snd_pcm_rate_to_rate_bit() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $old_syntax = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/snd_pcm_rate_to_rate_bit/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define COMPAT_PCM_TO_RATE_BIT 1\n"; + } + close INNET; +} + +sub check_snd_pcm_stop_xrun() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $old_syntax = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/snd_pcm_stop_xrun/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define NEED_PCM_STOP_XRUN 1\n"; + } + close INNET; +} + +sub check_snd_ctl_boolean_mono_info() +{ + my $file = "$kdir/include/sound/control.h"; + my $old_syntax = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/snd_ctl_boolean_mono_info/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define COMPAT_SND_CTL_BOOLEAN_MONO 1\n"; + } + close INNET; +} + +sub check_bool() +{ + my $file = "$kdir/include/linux/types.h"; + my $old_syntax = 1; + + open INDEP, "<$file" or die "File not found: $file"; + while () { + if (m/^\s*typedef.*bool;/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define NEED_BOOL_TYPE 1\n"; + } + close INDEP; +} + +sub check_is_singular() +{ + my $file = "$kdir/include/linux/list.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/list_is_singular/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_IS_SINGULAR 1\n"; + } + close INNET; +} + +sub check_clamp() +{ + my $file = "$kdir/include/linux/kernel.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/define\s+clamp/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_CLAMP 1\n"; + } + close INNET; +} + +sub check_proc_create() +{ + my $file = "$kdir/include/linux/proc_fs.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/proc_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PROC_CREATE 1\n"; + } + close INNET; +} + +sub check_pcm_lock() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/pcm_stream_lock/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NO_PCM_LOCK 1\n"; + } + close INNET; +} + +sub check_algo_control() +{ + my $file = "$kdir/include/linux/i2c.h"; + my $need_compat = 0; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/algo_control/) { + $need_compat = 1; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_ALGO_CONTROL 1\n"; + } + close INNET; +} + +sub check_net_dev() +{ + my $file = "$kdir/include/linux/netdevice.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/netdev_priv/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_NETDEV_PRIV 1\n"; + } + close INNET; +} + +sub check_usb_endpoint_type() +{ + my $nfiles = 0; + my @files = ( "$kdir/include/linux/usb.h", + "$kdir/include/linux/usb/ch9.h", + "$kdir/include/uapi/linux/usb/ch9.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + $nfiles++; + while () { + if (m/usb_endpoint_type/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + die "Usb headers not found" if (!$nfiles); + + # definition not found. This means that we need compat + $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; +} + +sub check_pci_ioremap_bar() +{ + my $file = "$kdir/include/linux/pci.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/pci_ioremap_bar/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n"; + } + close INNET; +} + +sub check_snd_card_create() +{ + my $file = "$kdir/include/sound/core.h"; + my $need_compat = 1; + + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/snd_card_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_SND_CARD_CREATE\n"; + } + close IN; +} + +sub check_poll_schedule() +{ + my @files = ( "$kdir/include/linux/poll.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/poll_schedule/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_POLL_SCHEDULE 1\n"; +} + +sub check_snd_BUG_ON() +{ + my @files = ( "$kdir/include/sound/core.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/snd_BUG_ON/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_SND_BUG_ON 1\n"; +} + +sub check_bitops() +{ + my @files = ( "$kdir/include/linux/bitops.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/#define\s+BIT\(/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_BITOPS 1\n"; +} + +sub check_fw_csr_string() +{ + my @files = ( "$kdir/include/linux/firewire.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/fw_csr_string\(/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_FW_CSR_STRING 1\n"; +} + + +sub check_delayed_work() +{ + my @files = ( "$kdir//include/linux/workqueue.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/struct\s+delayed_work/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_DELAYED_WORK 1\n"; +} + +sub check_vzalloc() +{ + my @files = ( "$kdir/include/linux/vmalloc.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/vzalloc/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_VZALLOC 1\n"; +} + +sub check_flush_work_sync() +{ + my @files = ( "$kdir/include/linux/workqueue.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/flush_work_sync/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_FLUSH_WORK_SYNC 1\n"; +} + +sub check_autosuspend_delay() +{ + my @files = ( "$kdir/include/linux/pm_runtime.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/pm_runtime_set_autosuspend_delay/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_AUTOSUSPEND_DELAY 1\n"; +} + +sub check_i2c_smbus_read_word_swapped() +{ + my @files = ( "$kdir/include/linux/i2c.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/i2c_smbus_read_word_swapped/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_I2C_SMBUS_WORD_SWAPPED 1\n"; +} + +sub check_printk_ratelimited() +{ + my @files = ( "$kdir/include/linux/kernel.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + # It's either defined in kernel.h, or printk.h + # is included from kernel.h + if (m/printk.h/ || m/printk_ratelimited/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_PRINTK_RATELIMITED 1\n"; +} + + +sub check_files_for_func($$@) +{ + my $function = shift; + my $define = shift; + my @incfiles = @_; + + for my $incfile (@incfiles) { + my @files = ( "$kdir/$incfile" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/($function)/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + } + + # definition not found. This means that we need compat + $out.= "\n#define $define 1\n"; +} + +sub check_files_for_func_uapi($$@) +{ + my $function = shift; + my $define = shift; + my @incfiles = @_; + + for my $incfile (@incfiles) { + my @files = ( "$kdir/include/linux/$incfile", + "$kdir/include/uapi/linux/$incfile" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/($function)/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + } + + # definition not found. This means that we need compat + $out.= "\n#define $define 1\n"; +} + +sub check_gfp_kswapd_reclaim() +{ + my @files = ( "$kdir/include/linux/gfp.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while () { + if (m/__GFP_KSWAPD_RECLAIM/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define __GFP_KSWAPD_RECLAIM 0\n"; +} + +sub check_other_dependencies() +{ + check_spin_lock(); + check_sound_driver_h(); + check_snd_ctl_boolean_mono_info(); + check_snd_pcm_rate_to_rate_bit(); + check_snd_pcm_stop_xrun(); + check_bool(); + check_is_singular(); + check_clamp(); + check_proc_create(); + check_pcm_lock(); + check_algo_control(); + check_net_dev(); + check_usb_endpoint_type(); + check_pci_ioremap_bar(); + check_snd_card_create(); + check_poll_schedule(); + check_snd_BUG_ON(); + check_bitops(); + check_delayed_work(); + check_fw_csr_string(); + check_vzalloc(); + check_flush_work_sync(); + check_autosuspend_delay(); + check_i2c_smbus_read_word_swapped(); + check_printk_ratelimited(); + check_gfp_kswapd_reclaim(); + check_files_for_func("hex_to_bin", "NEED_HEX_TO_BIN", "include/linux/kernel.h"); + check_files_for_func("snd_ctl_enum_info", "NEED_SND_CTL_ENUM_INFO", "include/sound/control.h"); + check_files_for_func("sysfs_attr_init", "NEED_SYSFS_ATTR_INIT", "include/linux/sysfs.h"); + check_files_for_func("usleep_range", "NEED_USLEEP_RANGE", "include/linux/delay.h"); + check_files_for_func("IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL", "include/linux/err.h"); + check_files_for_func("dma_transfer_direction", "NEED_DMA_TRANSFER_DIRECTION", "include/linux/dmaengine.h"); + check_files_for_func("poll_requested_events", "NEED_POLL_REQUESTED_EVENTS", "include/linux/poll.h"); + check_files_for_func("module_usb_driver", "NEED_MODULE_USB_DRIVER", "include/linux/usb.h"); + check_files_for_func("module_platform_driver", "NEED_MODULE_PLATFORM_DRIVER", "include/linux/platform_device.h"); + check_files_for_func("kmalloc_array", "NEED_KMALLOC_ARRAY", "include/linux/slab.h"); + check_files_for_func("dmaengine_prep_slave_sg", "NEED_DMAENGINE_PREP_SLAVE_SG", "include/linux/dmaengine.h"); + check_files_for_func("SET_SYSTEM_SLEEP_PM_OPS", "NEED_SET_SYSTEM_SLEEP_PM_OPS", "include/linux/pm.h"); + check_files_for_func("__i2c_transfer", "NEED_UNLOCK_I2C_XFER", "include/linux/i2c.h"); + check_files_for_func("I2C_CLIENT_SCCB", "NEED_I2C_CLIENT_SCCB", "include/linux/i2c.h"); + check_files_for_func("kstrtou16", "NEED_KSTRTOU16", "include/linux/kernel.h"); + check_files_for_func("kstrtoul", "NEED_KSTRTOUL", "include/linux/kernel.h"); + check_files_for_func("memweight", "NEED_MEMWEIGHT", "include/linux/string.h"); + check_files_for_func("dev_dbg_ratelimited", "NEED_DEV_DBG_RATELIMITED", "include/linux/device.h"); + check_files_for_func("i2c_lock_adapter", "NEED_LOCK_ADAPTER", "include/linux/i2c.h"); + check_files_for_func("i2c_probe_func_quick_read", "NEED_I2C_PROBE_FUNC_QUICK_READ", "include/linux/i2c.h"); + check_files_for_func("abs64", "NEED_ABS64", "include/linux/kernel.h"); + check_files_for_func("VM_DONTDUMP", "NEED_DONTDUMP", "include/linux/mm.h"); + check_files_for_func("VM_NODUMP", "NEED_NODUMP", "include/linux/mm.h"); + check_files_for_func("config_enabled", "NEED_IS_ENABLED", "include/linux/kconfig.h"); + check_files_for_func("IS_REACHABLE", "NEED_IS_REACHABLE", "include/linux/kconfig.h"); + check_files_for_func("DEFINE_PCI_DEVICE_TABLE", "NEED_DEFINE_PCI_DEVICE_TABLE", "include/linux/pci.h"); + check_files_for_func("usb_translate_errors", "NEED_USB_TRANSLATE_ERRORS", "include/linux/usb.h"); + check_files_for_func("PTR_RET", "NEED_PTR_RET", "include/linux/err.h"); + check_files_for_func("file_inode", "NEED_FILE_INODE", "include/linux/fs.h"); + check_files_for_func("ETH_P_802_3_MIN", "NEED_ETH_P_802_3_MIN", "include/uapi/linux/if_ether.h"); + check_files_for_func("proc_set_size", "NEED_PROC_SET_SIZE", "include/linux/proc_fs.h"); + check_files_for_func("SIMPLE_DEV_PM_OPS", "NEED_SIMPLE_DEV_PM_OPS", "include/linux/pm.h"); + check_files_for_func("vm_iomap_memory", "NEED_VM_IOMAP_MEMORY", "include/linux/mm.h"); + check_files_for_func("device_lock", "NEED_DEVICE_LOCK", "include/linux/device.h"); + check_files_for_func("PTR_ERR_OR_ZERO", "NEED_PTR_ERR_OR_ZERO", "include/linux/err.h"); + check_files_for_func("sg_alloc_table_from_pages", "NEED_SG_ALLOC_TABLE_FROM_PAGES", "include/linux/scatterlist.h"); + check_files_for_func("replace_fops", "NEED_REPLACE_FOPS", "include/linux/fs.h"); + check_files_for_func("reinit_completion", "NEED_REINIT_COMPLETION", "include/linux/completion.h"); + check_files_for_func("dma_set_mask_and_coherent", "NEED_DMA_SET_MASK_AND_COHERENT", "include/linux/dma-mapping.h"); + check_files_for_func("dma_set_coherent_mask", "NEED_DMA_SET_COHERENT_MASK", "include/linux/dma-mapping.h"); + check_files_for_func("bitmap_clear", "NEED_BITMAP_CLEAR", "include/linux/bitmap.h"); + check_files_for_func("devm_kmalloc", "NEED_DEVM_KMALLOC", "include/linux/device.h"); + check_files_for_func("devm_kmalloc_array", "NEED_DEVM_KMALLOC_ARRAY", "include/linux/device.h"); + check_files_for_func("usb_speed_string", "NEED_USB_SPEED_STRING", "include/linux/usb/ch9.h"); + check_files_for_func("USB_SPEED_WIRELESS", "NEED_USB_SPEED_WIRELESS", "include/linux/usb/ch9.h"); + check_files_for_func("ether_addr_equal", "NEED_ETHER_ADDR_EQUAL", "include/linux/etherdevice.h"); + check_files_for_func("snd_card_new", "NEED_SND_CARD_NEW", "include/sound/core.h"); + check_files_for_func("compat_put_timespec", "NEED_COMPAT_PUT_TIMESPEC", "include/linux/compat.h"); + check_files_for_func("mp_mb__after_atomic", "NEED_SMP_MB_AFTER_ATOMIC", "include/asm-generic/barrier.h"); + check_files_for_func("pci_zalloc_consistent", "NEED_PCI_ZALLOC_CONSISTENT", "include/asm-generic/pci-dma-compat.h", "include/linux/pci-dma-compat.h"); + check_files_for_func("kref_get_unless_zero", "NEED_KREF_GET_UNLESS_ZERO", "include/linux/kref.h"); + check_files_for_func("prandom_u32_max", "NEED_PRANDOM_U32_MAX", "include/linux/random.h"); + check_files_for_func("prandom_u32", "NEED_PRANDOM_U32", "include/linux/random.h"); + check_files_for_func("GENMASK", "NEED_GENMASK", "include/linux/bitops.h"); + check_files_for_func("mult_frac", "NEED_MULT_FRAC", "include/linux/kernel.h"); + check_files_for_func("clk_prepare_enable", "NEED_CLOCK_HELPERS", "include/linux/clk.h"); + check_files_for_func("IS_MODULE", "NEED_IS_MODULE", "include/linux/kconfig.h"); + check_files_for_func("DMA_ATTR_SKIP_CPU_SYNC", "NEED_DMA_ATTR_SKIP_CPU_SYNC", "include/linux/dma-attrs.h", "include/linux/dma-mapping.h"); + check_files_for_func("sign_extend32", "NEED_SIGN_EXTEND32", "include/linux/bitops.h"); + check_files_for_func("netdev_dbg", "NEED_NETDEV_DBG", "include/linux/netdevice.h"); + check_files_for_func("writel_relaxed", "NEED_WRITEL_RELAXED", "include/asm-generic/io.h"); + check_files_for_func("get_user_pages_unlocked", "NEED_GET_USER_PAGES_UNLOCKED", "include/linux/mm.h"); + check_files_for_func("pr_warn_once", "NEED_PR_WARN_ONCE", "include/linux/printk.h"); + check_files_for_func("DIV_ROUND_CLOSEST_ULL", "NEED_DIV_ROUND_CLOSEST_ULL", "include/linux/kernel.h"); + check_files_for_func("of_property_read_u64_array", "NEED_PROP_READ_U64_ARRAY", "include/linux/of.h"); + check_files_for_func("module_pnp_driver", "NEED_MODULE_PNP_DRIVER", "include/linux/pnp.h"); + check_files_for_func("eth_zero_addr", "NEED_ETH_ZERO_ADDR", "include/linux/etherdevice.h"); + check_files_for_func("frame_vector_create", "NEED_FRAME_VECTOR", "include/linux/mm.h"); + check_files_for_func("kvfree", "NEED_KVFREE", "include/linux/mm.h"); + check_files_for_func("kvzalloc", "NEED_KVZALLOC", "include/linux/mm.h"); + check_files_for_func("ktime_before", "NEED_KTIME_BEFORE", "include/linux/ktime.h"); + check_files_for_func("ktime_compare", "NEED_KTIME_COMPARE", "include/linux/ktime.h"); + check_files_for_func("ktime_ms_delta", "NEED_KTIME_MS_DELTA", "include/linux/ktime.h"); + check_files_for_func("of_node_full_name", "NEED_OF_NODE_FULL_NAME", "include/linux/of.h"); + check_files_for_func("ktime_get_ns", "NEED_KTIME_GET_NS", "include/linux/timekeeping.h"); + check_files_for_func("div64_u64_rem", "NEED_DIV64_U64_REM", "include/linux/math64.h"); + check_files_for_func("led_set_brightness_sync", "NEED_LED_SET_BRIGHTNESS", "include/linux/leds.h"); + check_files_for_func("GENMASK_ULL", "NEED_GENMASK_ULL", "include/linux/bitops.h"); + check_files_for_func("ida_simple_remove", "NEED_IDA_SIMPLE_REMOVE", "include/linux/idr.h"); + check_files_for_func("ktime_get_boottime", "NEED_KTIME_GET_BOOTTIME", "include/linux/hrtimer.h", "include/linux/timekeeping.h"); + check_files_for_func("BUS_CEC", "NEED_BUS_CEC", "include/uapi/linux/input.h"); + check_files_for_func("smp_load_acquire", "NEED_SMP_LOAD_ACQUIRE", "include/asm-generic/barrier.h"); + check_files_for_func("dev_err_once", "NEED_DEV_ERR_ONCE", "include/linux/device.h"); + check_files_for_func("kthread_init_worker", "NEED_KTHREAD_INIT_WORKER", "include/linux/kthread.h"); + check_files_for_func("print_hex_dump_debug", "NEED_PRINT_HEX_DUMP_DEBUG", "include/linux/printk.h"); + check_files_for_func("min3", "NEED_MIN3", "include/linux/kernel.h"); + check_files_for_func("rcu_pointer_handoff", "NEED_RCU_POINTER_HANDOFF", "include/linux/rcupdate.h"); + check_files_for_func("regmap_read_poll_timeout", "NEED_REGMAP_READ_POLL_TIMEOUT", "include/linux/regmap.h"); + check_files_for_func("dma_coerce_mask_and_coherent", "NEED_DMA_COERCE_MASK", "include/linux/dma-mapping.h"); + check_files_for_func("devm_kcalloc", "NEED_DEVM_KCALLOC", "include/linux/device.h"); + check_files_for_func("cdev_device_add", "NEED_CDEV_DEVICE", "include/linux/cdev.h"); + check_files_for_func("module_param_hw", "NEED_MODULE_PARAM_HW", "include/linux/moduleparam.h"); + check_files_for_func("of_fwnode_handle", "NEED_FWNODE", "include/linux/of.h"); + check_files_for_func("to_of_node", "NEED_TO_OF_NODE", "include/linux/of.h"); + check_files_for_func("is_of_node", "NEED_IS_OF_NODE", "include/linux/of.h"); + check_files_for_func("skb_put_data", "NEED_SKB_PUT_DATA", "include/linux/skbuff.h"); + check_files_for_func("pm_runtime_get_if_in_use", "NEED_PM_RUNTIME_GET", "include/linux/pm_runtime.h"); + check_files_for_func("KEY_APPSELECT", "NEED_KEY_APPSELECT", "include/uapi/linux/input-event-codes.h"); + check_files_for_func("PCI_DEVICE_SUB", "NEED_PCI_DEVICE_SUB", "include/linux/pci.h"); + check_files_for_func("annotate_reachable", "NEED_ANNOTATE_REACHABLE", "include/linux/compiler.h"); + check_files_for_func("U32_MAX", "NEED_U32_MAX", "include/linux/kernel.h"); + check_files_for_func("bsearch", "NEED_BSEARCH", "include/linux/bsearch.h"); + check_files_for_func("timer_setup", "NEED_TIMER_SETUP", "include/linux/timer.h"); + check_files_for_func("__setup_timer", "NEED_SETUP_TIMER", "include/linux/timer.h"); + check_files_for_func("fwnode_reference_args", "NEED_FWNODE_REF_ARGS", "include/linux/fwnode.h"); + check_files_for_func("fwnode_for_each_child_node", "NEED_FWNODE_FOR_EACH_CHILD_NODE", "include/linux/property.h"); + check_files_for_func("fwnode_graph_get_port_parent", "NEED_FWNODE_GRAPH_GET_PORT_PARENT", "include/linux/property.h"); + check_files_for_func("timer_setup_on_stack", "NEED_TIMER_SETUP_ON_STACK", "include/linux/timer.h"); + check_files_for_func("time64_to_tm", "NEED_TIME64_TO_TM", "include/linux/time.h"); + check_files_for_func("READ_ONCE", "NEED_READ_ONCE", "include/linux/compiler.h"); + check_files_for_func("usb_urb_ep_type_check", "NEED_USB_EP_CHECK", "include/linux/usb.h"); + check_files_for_func("get_user_pages_longterm", "NEED_GET_USER_PAGES_LONGTERM", "include/linux/mm.h"); + check_files_for_func("__pfn_to_phys", "NEED_PFN_TO_PHYS", "include/asm-generic/memory_model.h"); + check_files_for_func("next_pseudo_random32", "NEED_NEXT_PSEUDO_RANDOM32", "include/linux/random.h"); + check_files_for_func("i2c_new_secondary_device", "NEED_I2C_NEW_SECONDARY_DEV", "include/linux/i2c.h"); + check_files_for_func("memdup_user_nul", "NEED_MEMDUP_USER_NUL", "include/linux/string.h"); + check_files_for_func("STACK_FRAME_NON_STANDARD", "NEED_STACK_FRAME_NON_STANDARD", "include/linux/frame.h"); + check_files_for_func("pci_free_irq_vectors", "NEED_PCI_FREE_IRQ_VECTORS", "include/linux/pci.h"); + check_files_for_func(" pci_irq_vector", "NEED_PCI_IRQ_VECTOR", "include/linux/pci.h"); + check_files_for_func("U8_MAX", "NEED_U8_MAX", "include/linux/kernel.h"); + check_files_for_func("kthread_freezable_should_stop", "NEED_KTHREAD_FREEZABLE_SHOULD_STOP", "include/linux/kthread.h"); + check_files_for_func(" vm_fault_t;", "NEED_VM_FAULT_T", "include/linux/mm_types.h"); + check_files_for_func("array_index_nospec", "NEED_ARRAY_INDEX_NOSPEC", "include/linux/nospec.h"); + check_files_for_func("list_first_entry_or_null", "NEED_LIST_FIRST_ENTRY_OR_NULL", "include/linux/list.h"); + + # For tests for uapi-dependent logic + check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h"); + check_files_for_func_uapi("usb_endpoint_maxp_mult", "NEED_USB_ENDPOINT_MAXP_MULT", "usb/ch9.h"); + check_files_for_func_uapi("PCI_EXP_DEVCTL2_COMP_TIMEOUT", "NEED_PCI_EXP_DEVCTL2_COMP_TIMEOUT", "pci_regs.h"); + check_files_for_func_uapi("__poll_t", "NEED_POLL_T", "types.h"); + check_files_for_func_uapi("KEY_SCREENSAVER", "NEED_KEY_SCREENSAVER", "input.h"); +} + +# Do the basic rules +open IN, "<$infile" or die "File not found: $infile"; + +$out.= "#ifndef __CONFIG_COMPAT_H__\n"; +$out.= "#define __CONFIG_COMPAT_H__\n\n"; + +$out.= "#include \n\n"; +$out.= "#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)\n"; +$out.= "#include \n"; +$out.= "#else\n"; +$out.= "#include \n"; +$out.= "#endif\n\n"; + +# mmdebug.h includes autoconf.h. So if this header exists, +# then include it before our config is set. +if (-f "$kdir/include/linux/mmdebug.h") { + $out.= "#include \n\n"; +} + +while() { + next unless /^(\S+)\s*:= (\S+)$/; + $out.= "#undef $1\n"; + $out.= "#undef $1_MODULE\n"; + if($2 eq "n") { + next; + } elsif($2 eq "m") { + $out.= "#define $1_MODULE 1\n"; + } elsif($2 eq "y") { + $out.= "#define $1 1\n"; + } else { + $out.= "#define $1 $2\n"; + } +} +close IN; + +check_other_dependencies(); + +open OUT, ">$outfile" or die 'Unable to write $outfile'; +print OUT "$out\n#endif\n"; +close OUT diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_kconfig.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_kconfig.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_kconfig.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_kconfig.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,722 @@ +#!/usr/bin/perl +use FileHandle; +use strict; + +my %depend = (); +my %minver = (); +my %config = (); +my %stringopt = (); +my %intopt = (); +my %hexopt = (); +my %tristate = (); +my %kernopts = (); +my %depmods = (); +my ($version, $level, $sublevel, $kernver); + +my $kernel = shift; +my $kernsrc = shift; +my $force_kconfig = shift; +my $enable_staging = shift; + +my $debug=0; + +########################################################### +# Read a .config file (first argument) and put the resulting options in a +# hash, which is returned. This subroutine should be called in a hash +# context or it will not be very useful. +sub process_config($) +{ + my $filename = shift; + my %conf; + my $in = new FileHandle; + + open $in, $filename or die "File not found: $filename"; + while (<$in>) { + if (/^CONFIG_(\w+)\s*=\s*(\S.*?)\s*$/) { + my $c = \($conf{$1} = $2); + $$c =~ y/nmy/012/ if $$c =~ /^.$/; + next; + } + if (/^# CONFIG_(\w+) is not set$/) { + $conf{$1} = 0; + next; + } + unless (/^#|$/) { + print "Confused by this line in $filename:\n$_"; + } + } + close $in; + return %conf; +} + +sub add_bool($) +{ + my $arg=shift; + + exists $config{$arg} or die "Adding unknown boolean '$arg'"; + print "Boolean: $arg\n" if $debug; + $tristate{$arg} = "bool"; +} + +sub add_tristate($) +{ + my $arg=shift; + + exists $config{$arg} or die "Adding unknown tristate '$arg'"; + print "Tristate: $arg\n" if $debug; + $tristate{$arg}="tristate"; + # tri default is 'm' + $config{$arg} = 1 if($config{$arg}); +} + +sub add_int($) +{ + my $arg=shift; + + print "Int: $arg\n" if $debug; + exists $config{$arg} or die "Adding unknown int '$arg'"; + $intopt{$arg} = 0; +} + +sub add_hex($) +{ + my $arg=shift; + + print "Hex: $arg\n" if $debug; + exists $config{$arg} or die "Adding unknown hex '$arg'"; + $hexopt{$arg} = 0; +} + +sub add_string($) +{ + my $arg=shift; + + print "String: $arg\n" if $debug; + exists $config{$arg} or die "Adding unknown string '$arg'"; + $stringopt{$arg} = ""; +} + +sub set_int_value($$) +{ + my $key = shift; + my $val = shift; + + exists $intopt{$key} or die "Default for unknown int option '$key'"; + $intopt{$key} = $val; +} + +sub set_hex_value($$) +{ + my $key = shift; + my $val = shift; + + exists $hexopt{$key} or die "Default for unknown hex option '$key'"; + $hexopt{$key} = "0x$val"; +} + +sub set_string_value($$) +{ + my $key = shift; + my $val = shift; + + exists $stringopt{$key} or die "Default for unknown string option '$key'"; + $stringopt{$key} = "\"$val\""; +} + +sub add_config($) +{ + my $arg = shift; + + if ($arg =~ /^(\w+)\s*$/) { + $config{$1} = 2; + } else { + die "Do not understand config variable '$arg'"; + } +} + +######################################## +# Turn option off, iff it already exists +sub disable_config($) +{ + my $key = shift; + + $config{$key} = 0 if (exists $config{$key}); +} + +# %{$depend{'FOO'}} lists all variables which depend on FOO. This is the +# reverse of the variables that FOO depends on. +my %depend = (); +sub finddeps($$) +{ + my $key = shift; + my $deps = shift; + + $deps =~ s/^\W+//; + $depend{$_}{$key} = 1 foreach(split(/\W[\Wynm]*/, $deps)); +} + +# @{$depends{'FOO'}} is a list of dependency expressions that FOO depends +# on. This is the reverse of the variables that depend on FOO. +my %depends = (); +sub depends($$) +{ + my $key = shift; + my $deps = shift; + + (!defined $key || $key eq '') and + die "Got bad key with $deps\n"; + finddeps($key, $deps); + push @{$depends{$key}}, $deps; +} + +my %selectdepends = (); +sub selects($$$) +{ + my $key = shift; + my $select = shift; + my $if = shift; + + finddeps($key, $select); + if(defined $if) { + finddeps($key, $if); + # Transform "select X if Y" into "depends on !Y || X" + $select = "!($if) || ($select)"; + } + push @{$selectdepends{$key}}, $select; +} + +# Needs: +# %depend <- %depend{FOO} lists the variables that depend on FOO +# %depends <- %depends{FOO} lists the dependency expressions for FOO +# %config <- the value of all media variables +# %kernopts <- the value of all kernel variables (including media ones) +# +# Checks the dependencies of all media variables, recursively. Returns +# a new hash that has the new values of all media variables. +sub checkdeps() +{ + my %allconfig; + + @allconfig{keys %depend} = @kernopts{keys %depend}; + @allconfig{keys %config} = values %config; + # Set undef values to 0 + map { defined $_ or $_ = 0 } values %allconfig; + + # First run, check deps for all the v4l-dvb variables. Following + # runs, check all variables which depend on a variable that was + # changed. Stop when no more variables change. + for(my %changed = (), my @tocheck = keys %config; @tocheck; + @tocheck = keys %changed, %changed = ()) { + foreach (@tocheck) { + next unless($allconfig{$_}); # skip disabled vars + if (!checkvardeps($_)) { + $changed{$_} = 1 foreach keys %{$depend{$_}}; + } + } + } + return map { $_ => $allconfig{$_} } keys %config; + + # Check the dependencies of a variable, if one fails the variable + # is set to 0. Returns 0 if the variable failed, 1 if it passed. + sub checkvardeps($) { + my $key = shift; + my $deps = $depends{$key}; + foreach (@$deps) { + next if($_ eq ''); + if (!eval(toperl($_))) { + print "Disabling $key, dependency '$_' not met\n" if $debug; + $allconfig{$key} = 0; + return 0; + } + } + my $selectdeps = $selectdepends{$key}; + if ($selectdeps) { + my $found = 0; + foreach (@$selectdeps) { + next if($_ eq ''); + if (eval(toperl($_))) { + $found = 1; + last; + } + } + if ($found == 0) { + print "Disabling $key, select dependency '$_' not met\n" if $debug; + $allconfig{$key} = 0; + return 0; + } + } + + return 1; + } + + # Convert a Kconfig expression to a Perl expression + sub toperl($) + { + local $_ = shift; + + # Turn n,m,y into 0,1,2 + s/\bn\b/0/g; s/\bm\b/1/g; s/\by\b/2/g; + + # Turn = into ==, but keep != as != (ie. not !==) + s/(?) { + $line = $_; + # In our Kconfig files, the first non-help line after the + # help text always has no indention. Technically, the + # help text is ended by just by the indention decreasing, + # but that is a pain to keep track of. + if ($in_help && /^\S/) { + $in_help = 0; + } elsif ($in_help) { + # Still inside help text + next; + } + + # Start of help text + if (/^\s*(---)?help(---)?\s*$/) { + $in_help = 1; + # Insert VIDEO_KERNEL_VERSION dependency, default + # n line, and help text note for disabled drivers. + if ($disabled) { + if(exists $tristate{$key} && !$default_seen) { + print OUT "\tdefault n\n"; + } + print OUT "\tdepends on VIDEO_KERNEL_VERSION\n"; + $line = sprintf($disabled_msg, $minver{$key}); + } + next; + } + # No help text should get processed past this point + $in_help and die "I'm very confused"; + + # start of a new stanza, reset + if (/^\w/) { + $disabled = 0; + $default_seen = 0; + $key = undef; + $if = ""; + } + next if (/^\s*#/ || /^\s*$/); # skip comments and blank lines + + # Erase any comments on this line + s/(? 0) { + $disabled = 1; + disable_config($key); + print "$key: Requires at least kernel $minver{$key}\n"; + print OUT "# $key disabled for insufficient kernel version\n"; + } else { + $disabled=0; + } + # Add dependencies from enclosing if/endif blocks + depends($key, $_) foreach (@kifs); + } elsif (m|^\s*comment\s+"[^"]*"\s*$|) { + $key = 'comment'; + } elsif (m|^\s*menu\s+"[^"]*"\s*$|) { + $key = 'menu'; + push @kifs, ''; # placeholder for any depends on clauses + } elsif (m|^\s*if\s+(.+?)\s*$|) { + push @kifs, $1; + } elsif (/^\s*end(if|menu)\s*(?:#.*)?$/) { + # Won't handle menu/if blocks that aren't strictly + # nested, but no one should do that! + $#kifs >= 0 or die "Unmatched end$1 at $file:$.\n"; + pop @kifs; + } else { + $nothandled = 1; + } + next unless ($nothandled); + # Remaining Kconfig directives only makse sense inside Kconfig blocks + unless(defined $key) { + print "Skipping $file:$. $_" if $debug; + next; + } + + # Don't process any directives in comment blocks + next if ($key eq 'comment'); + + # Only depends on lines are accepted in menus + if ($key eq 'menu') { + if (m|^\s*depends on\s+(.+?)\s*$|) { + my $x = pop @kifs; + $x .= ' && ' if($x ne ''); + $x .= "($1)"; + push @kifs, $x; + } else { + print "Skipping unexpected line in menu stanza $file:$.$_" if $debug; + } + next; + } + + # config type + if(/^\s*bool(ean)?\s/) { + add_bool($key); + if (m|if (.*)\s*$|) { + printf("Boolean $key with if '$1'\n") if $debug; + if ($if eq "") { + $if = "($1)"; + } else { + $if .= " && ($1)"; + } + } + } elsif (/^\s*tristate\s/) { + add_tristate($key); + if (m|if (.*)\s*$|) { + printf("Boolean $key with if '$1'\n") if $debug; + if ($if eq "") { + $if = "($1)"; + } else { + $if .= " && ($1)"; + } + } + } elsif (/^\s*int\s/) { + add_int($key); + } elsif (/^\s*hex\s/) { + add_hex($key); + } elsif (/^\s*string\s/) { + add_string($key); + + # select and depend lines + } elsif (m|^\s*depends on\s+(.+?)\s*$|) { + depends($key, $1); + } elsif (m|^\s*select\s+(\w+)(\s+if\s+(.+?))?\s*$|) { + selects($key, $1, $3); + + # default lines + } elsif (m|^\s*default\s+(.+?)(?:\s+if .*)?\s*$|) { + my $o = $1; + if ($2 ne "") { + if ($if eq "") { + $if = "($2)"; + } else { + $if .= " && ($2)"; + } + } + + # Get default for int options + if ($o =~ m|^"(\d+)"$| && exists $intopt{$key}) { + set_int_value($key, $1); + # Get default for hex options + } elsif ($o =~ m|^"(0x)?([[:xdigit:]]+)"$| && exists $hexopt{$key}) { + set_hex_value($key, $2); + # Get default for string options + } elsif ($o =~ m|^"(.*)"$| && exists $stringopt{$key}) { + set_string_value($key, $1); + + # Override default for disabled tri/bool options + # We don't care about the default for tri/bool options otherwise + } elsif (!$o =~ /^(y|n|m|"yes"|"no")$/i && exists $tristate{$key}) { + print "Default is an expression at $file:$. $_\n" if $debug; + if ($if eq "") { + depends($key, "$o"); + } + } + if ($if ne "") { + # FIXME: What happens if no default clause exists? + # the $if won't be handled + depends($key, "$if || $o"); + } + + if ($disabled) { + $default_seen = 1; + $line = "\tdefault n\n"; + } + } else { + print "Skipping $file:$. $_" if $debug; + } + } continue { + if (cmp_ver($kernver, '2.6.37') < 0 && $line =~ m/visible\sif\s.*/) { + $line =~ s/visible\sif\s(.*)//; + print OUT $line; + print OUT "\tdepends on $1\n"; + } else { + print OUT $line; + } + } + close $in; +} + +sub parse_versions() +{ + my $in = new FileHandle; + my $ver; + + open $in, ') { + if (/\[(\d+\.\d+\.\d+)\]/) { + $ver = $1; + } elsif (/^\s*(\w+)/) { + $minver{$1} = $ver; + print "minimal version for $1 is $ver\n" if $debug; + } + } + close $in; +} + +# Read in the .version file to get the kernel version +sub get_version() +{ + open IN, '<.version' or die 'File not found: .version'; + while () { + if (/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)[\.-](\d+)/) { + $version=$1; + $level=$2; + $sublevel=$3; + return $kernver="$version.$level.$sublevel"; + } + } + close IN; +} + +# Like ver1 <=> ver2, but understands X.Y.Z version strings +sub cmp_ver($$) +{ + shift =~ /(\d+)\.(\d+)\.(\d+)/; + my ($v1_ver,$v1_level,$v1_sublevel) = ($1,$2,$3); + shift =~ /(\d+)\.(\d+)\.(\d+)/; + my ($v2_ver,$v2_level,$v2_sublevel) = ($1,$2,$3); + + my $cmp = $v1_ver <=> $v2_ver; + return $cmp unless($cmp == 0); + $cmp = $v1_level <=> $v2_level; + return $cmp unless($cmp == 0); + return $v1_sublevel <=> $v2_sublevel; +} + +# Get kernel version +get_version(); +print "Preparing to compile for kernel version $kernver\n"; + +# Get Kernel's config settings +%kernopts = process_config("$kernel/.config"); + +# Modules must be on, or building out of tree drivers makes no sense +if(!$kernopts{MODULES}) { + print <<"EOF"; +You appear to have loadable modules turned off in your kernel. You can +not compile the v4l-dvb drivers, as modules, and use them with a kernel +that has modules disabled. + +If you want to compile these drivers into your kernel, you should +use 'make kernel-links' to link the source for these drivers into +your kernel tree. Then configure and compile the kernel. +EOF + exit -1; +} + +# Kernel < 2.6.22 is missing the HAS_IOMEM option +if (!defined $kernopts{HAS_IOMEM} && cmp_ver($kernver, '2.6.22') < 0) { + $kernopts{HAS_IOMEM} = 2; +} + +# Kernel < 2.6.22 is missing the HAS_DMA option +if (!defined $kernopts{HAS_DMA} && cmp_ver($kernver, '2.6.22') < 0) { + $kernopts{HAS_DMA} = 2; +} + +# Kernel < 2.6.23 is missing the VIRT_TO_BUS option +if (!defined $kernopts{VIRT_TO_BUS} && cmp_ver($kernver, '2.6.23') < 0) { + # VIRT_TO_BUS -> !PPC64 + $kernopts{VIRT_TO_BUS} = 2 - $kernopts{PPC64}; +} + +# Kernel < 2.6.37 is missing the BKL option +if (!defined $kernopts{BKL} && cmp_ver($kernver, '2.6.37') < 0) { + $kernopts{BKL} = 2; +} + +# Kernel < 3.2 is missing the DMA_SHARED_BUFFER option +if (!defined $kernopts{DMA_SHARED_BUFFER} && cmp_ver($kernver, '3.2.0') < 0) { + $kernopts{DMA_SHARED_BUFFER} = 2; +} + +# Get minimum kernel version for our variables +parse_versions(); + +kernelcheck(); + +open OUT, ">Kconfig" or die "Cannot write Kconfig file"; +print OUT <<"EOF"; +mainmenu "V4L/DVB menu" +source Kconfig.kern +config VIDEO_KERNEL_VERSION + bool "Enable drivers not supported by this kernel" + default n + ---help--- + Normally drivers that require a kernel newer $version.$level.$sublevel, + the kernel you are compiling for now, will be disabled. + + Turning this switch on will let you enabled them, but be warned + they may not work properly or even compile. + + They may also work fine, and the only reason they are listed as + requiring a newer kernel is that no one has tested them with an + older one yet. + + If the driver works, please post a report to the V4L mailing list: + linux-media\@vger.kernel.org. + + Unless you know what you are doing, you should answer N. + +EOF + +open_kconfig('../linux', '../linux/drivers/media/Kconfig'); +open_kconfig('.', './Kconfig.sound'); +open_kconfig('.', './Kconfig.mm'); +open_kconfig('.', './Kconfig.misc'); +open_kconfig('../linux', './Kconfig.staging'); +close OUT; + +# These options should default to off +disable_config('DVB_AV7110_FIRMWARE'); +disable_config('DVB_CINERGYT2_TUNING'); +disable_config('VIDEO_HELPER_CHIPS_AUTO'); +disable_config('VIDEO_FIXED_MINOR_RANGES'); +disable_config('STAGING') if (!$enable_staging); +disable_config('STAGING_BROKEN'); +$config{'COMPILE_TEST'} = 0; +$intopt { "DVB_MAX_ADAPTERS" } = 8; + +# Check dependencies +my %newconfig = checkdeps(); + +# TODO: tell the user which options were disabled at this point +%config = %newconfig; + +# Create Kconfig.kern, listing all non-media (i.e. kernel) variables +# that something depended on. +$depend{MODULES}{always} = 1; # Make sure MODULES will appear +open OUT, '>Kconfig.kern' or die "Cannot write Kconfig.kern file: $!"; +while (my ($key, $deps) = each %depend) { + next if exists $config{$key}; # Skip media variables + + print OUT "# Needed by ", join(', ', keys %$deps), "\n"; + print OUT "config $key\n\ttristate\n"; + print OUT "\tdefault ", qw(n m y)[$kernopts{$key}], "\n\n"; + print OUT "\toption modules\n" if ($key eq "MODULES"); +} +close OUT; + +# Create make dependency rules for the Kconfig file +open OUT, '>.kconfig.dep' or die "Cannot write .kconfig.dep file: $!"; +print OUT 'Kconfig: '; +print OUT join(" \\\n\t", @kconfigfiles), "\n"; +close OUT; + +# Produce a .config file if forced or one doesn't already exist +if ($force_kconfig==1 || !-e '.config') { + open OUT, '>.config' or die "Cannot write .config file: $!"; + foreach (keys %tristate) { + if ($config{$_}) { + print OUT "CONFIG_$_=", qw(n m y)[$config{$_}], "\n"; + } else { + print OUT "# CONFIG_$_ is not set\n"; + } + } + while (my ($key,$value) = each %intopt) { + print OUT "CONFIG_$key=$value\n" if($config{$key}); + } + while (my ($key,$value) = each %hexopt) { + print OUT "CONFIG_$key=$value\n" if($config{$key}); + } + while (my ($key,$value) = each %stringopt) { + print OUT "CONFIG_$key=$value\n" if($config{$key}); + } + close OUT; + print "Created default (all yes) .config file\n"; +} + +# Check for full kernel sources and print a warning +sub kernelcheck() +{ + my $fullkernel="$kernsrc/fs/fcntl.c"; + if (! -e $fullkernel) { + print <<"EOF2"; + +***WARNING:*** You do not have the full kernel sources installed. +This does not prevent you from building the v4l-dvb tree if you have the +kernel headers, but the full kernel source may be required in order to use +make menuconfig / xconfig / qconfig. + +If you are experiencing problems building the v4l-dvb tree, please try +building against a vanilla kernel before reporting a bug. + +Vanilla kernels are available at http://kernel.org. +On most distros, this will compile a newly downloaded kernel: + +cp /boot/config-`uname -r` /.config +cd +make all modules_install install + +Please see your distro's web site for instructions to build a new kernel. + +EOF2 + } +print << "EOF3"; +WARNING: This is the V4L/DVB backport tree, with experimental drivers + backported to run on legacy kernels from the development tree at: + http://git.linuxtv.org/media-tree.git. + It is generally safe to use it for testing a new driver or + feature, but its usage on production environments is risky. + Don't use it in production. You've been warned. +EOF3 + sleep 5; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/makelinks.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/makelinks.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/makelinks.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/makelinks.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,33 @@ +#!/bin/sh +# link drivers sources from CVS or release tarball into your 2.6.x kernel sources; + +if test -z $1 || ! test -d $1 ; then + echo + echo " usage: $0 " + echo + exit +fi + +echo "patching $1..." + +cd linux +PWD=`pwd` +FINDDIR="-name CVS -prune -o -type d" +FINDFILE="-name CVS -prune -o -type f -not -name .cvsignore\ + -not -name '*.rej' -not -name '*.orig'" + +for dir in drivers include Documentation; do + find $dir $FINDDIR -exec mkdir -p -v $1/{} \; + find $dir $FINDFILE -exec ln -f -s $PWD/{} $1/{} \; +done + +for dir in drivers/media include; do + find $dir $FINDDIR -exec ln -f -s $PWD/../v4l/compat.h $1/{} \; \ + -exec touch $1/{}/config-compat.h \; +done + +cat > $1/drivers/media/Kbuild <) { + # print STDERR "Line: $_"; + # Skip comment lines + if (/^\s*#/) { + print OUT $_; + next; + } + m/^\s*-?include/ and die "Can't handle includes! In $file"; + + # Handle line continuations + if (/\\\n$/) { + $_ .= <$in>; + redo; + } + + # $orig is what we will print, $_ is what we will parse + $orig = $_; + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + # Eat comments + s/#.*$//; + + if (/^\s*obj-.*:?=\s*(\S.*?)\s*$/) { + # print STDERR "obj matched '$1'\n"; + check_line($dir, $1, $orig); # will print line for us + next; + } + if (/^\s*EXTRA_CFLAGS\s+\+?=\s*(\S.*?)\s*$/) { + # print STDERR "cflags matched '$1'\n"; + remove_includes($1, $orig); # will print line for us + next; + } + if (/^\s*ccflags-.*=\s*(\S.*?)\s*$/) { + # print STDERR "cflags matched '$1'\n"; + remove_includes($1, $orig); # will print line for us + next; + } + # Any flags should be added to already existing flags + $orig =~ s/ccflags-y\s*:=/ccflags-y +=/; + print OUT $orig; + } + close $in; +} + +my %obsolete; +sub getobsolete() +{ + open OBSOLETE, ') { + next if (/^\s*#/ || /^\s*$/); + chomp; + if (m|^(.*)/([^/]*)$|) { + $obsolete{$1}{"$2.ko"} = 1; + } else { + print "Unable to parse obsolete.txt:$.\n$_\n"; + } + } + + close OBSOLETE; +} + +sub removeobsolete() +{ + while ( my ($dir, $files) = each(%obsolete) ) { + print OUT "\t\@echo \"\\nRemoving obsolete files from \$(DESTDIR)\$(KDIR26)/$dir:\"\n"; + print OUT "\t\@files='", join(' ', keys %$files), "'; "; + + print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i\" ]; then "; + print OUT "echo -n \"\$\$i \";"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; + + print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz\" ]; then "; + print OUT "echo -n \"\$\$i.gz \";"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; + } +} + +# +# Special hack for Ubuntu with their non-standard dirs +# +sub removeubuntu($) +{ + my $udir = shift; + my $dest = "/lib/modules/\$(KERNELRELEASE)/$udir"; + my $filelist; + + while ( my ($dir, $files) = each(%srcdir) ) { + $filelist .= ' '. join(' ', keys %$files); + } + while ( my ($dir, $files) = each(%obsolete) ) { + $filelist .= ' ' . join(' ', keys %$files); + } + $filelist =~ s/\s+$//; + + print OUT "\t\@if [ -d $dest ]; then "; + print OUT "printf \"\\nHmm... distro kernel with a non-standard place for module backports detected.\\n"; + print OUT "Please always prefer to use vanilla upstream kernel with V4L/DVB\\n"; + print OUT "I'll try to remove old/obsolete LUM files from $dest:\\n\"; "; + print OUT "files='", $filelist, "'; "; + + print OUT "for i in \$\$files;do find \"$dest\" \-name \"\$\$i\" \-exec echo \'{}\' \';\' ;"; + print OUT " find \"$dest\" \-name \"\$\$i\" \-exec rm \'{}\' \';\' ;"; + print OUT " done;"; + print OUT " fi\n"; +} + +sub parse_dir() +{ + my $file = $File::Find::name; + + return if (!($file =~ /Makefile$/)); + open_makefile($file); +} + +############################################################################## + +getobsolete(); + +open OUT, '>Makefile.media' or die 'Unable to write Makefile.media'; +open_makefile('../linux/drivers/media/Makefile'); + +find({wanted => \&parse_dir, no_chdir => 1}, '../linux/drivers/staging'); +find({wanted => \&parse_dir, no_chdir => 1}, '../linux/drivers/misc'); + +# Creating Install rule +print OUT "media-install::\n"; + +removeobsolete(); +removeubuntu("kernel/ubuntu/media"); +removeubuntu("kernel/ubuntu/lirc"); +removeubuntu("/updates/dkms"); + +print OUT "\t\@echo \"Installing kernel modules under \$(DESTDIR)\$(KDIR26)/:\"\n"; + +# change source dirs (relative to v4l dir) +# into install dirs (relative to DESTDIR/KDIR26) +while (my ($dir, $files) = each %srcdir) { + my $idir = $dir; + $idir =~ s|\.\./linux/drivers/|../|; + $idir =~ s|\.\./media/?||; + $instdir{$idir} = $files; +} + +while (my ($dir, $files) = each %instdir) { + print OUT "\t\@n=0;for i in ", join(' ', keys %$files), ";do "; + print OUT "if [ -f \"\$\$i\" ]; then "; + print OUT "if [ \$\$n -eq 0 ]; then "; + print OUT "echo -n \"\t$dir/: \"; "; + print OUT "install -d \$(DESTDIR)\$(KDIR26)/$dir; fi; "; + print OUT "n=\$\$\(\(\$\$n+1\)\); "; + print OUT "if [ \$\$n -eq 4 ]; then echo; echo -n \"\t\t\"; n=1; fi; "; + print OUT "echo -n \"\$\$i \"; "; + print OUT "install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; "; + print OUT "if [ \$\$n -ne 0 ]; then echo; "; + print OUT "strip --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; "; + print OUT "fi;\n\n"; +} +print OUT "\t@echo\n"; +print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; + +# Creating Remove rule +print OUT "media-rminstall::\n"; + +removeobsolete(); +removeubuntu("/ubuntu/media"); +removeubuntu("/updates/dkms"); + +while ( my ($dir, $files) = each(%instdir) ) { + print OUT "\t\@echo \"\\nRemoving old \$(KDIR26)/$dir files:\"\n"; + print OUT "\t\@files='", join(' ', keys %$files), "'; "; + + print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i\" ]; then "; + print OUT "echo -n \"\$\$i \";"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; + + print OUT "for i in \$\$files;do if [ -f \"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz\" ]; then "; + print OUT "echo -n \"\$\$i.gz \";"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; +} + +my $mediadeps = join(" \\\n", map("\t$_/Makefile", keys %srcdir )); +$mediadeps =~ s,\.\./linux/drivers/media/\.\.,..,g; + +# Print dependencies of Makefile.media +print OUT "Makefile.media: ../linux/drivers/media/Makefile \\\n"; +print OUT "\tobsolete.txt \\\n"; +print OUT $mediadeps; +print OUT "\n"; +close OUT; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_myconfig.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_myconfig.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/make_myconfig.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/make_myconfig.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# The purpose of this script is to produce a file named '.myconfig', in +# the same style as the '.config' file. Except .myconfig has disabled +# options explicitly set to 'n' rather than just omitted. This is to +# make sure they override any corresponding options that may be turned on +# in the Kernel's config files. +# The .myconfig file is what will be included in the v4l-dvb Makefile +# to control which drivers are built. + +my %config = (); +my %allconfig = (); + +open IN,".config"; +while () { + if (m/\s*(\w+)=\s*(\S*)/) { +#printf "%s=%s\n",$1,$2; + $config { $1 } = $2; + } +} +close IN; + +# Build table of _all_ bool and tristate config variables +my $key = 0; +open IN,"Kconfig"; +while () { + if (/^(?:menu)?config\s+(\w+)\s*$/) { + $key == 0 or die "Couldn't find type of config '$key'"; + $key = "CONFIG_$1"; + } elsif (/^\s+bool(ean)?\s/) { + $allconfig{$key} = 'bool'; + $key = 0; + } elsif (/^\s+tristate\s/) { + $allconfig{$key} = 'tristate'; + $key = 0; + } elsif (/^\s+(int|hex|string)\s/) { + $allconfig{$key} = 'data'; + $key = 0; + } +} +close IN; + +exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; + +# Produce output for including in a Makefile +# Explicitly set bool/tri options that didn't appear in .config to n +# 'data' options are only output if they appeared in .config +open OUT,">.myconfig"; +while ( my ($key, $value) = each(%allconfig) ) { + if ($value eq 'data') { + next unless (exists $config{$key}); + $value = $config{$key}; + } else { + $value = exists $config{$key} ? $config{$key} : 'n'; + } + printf OUT "%-44s := %s\n",$key,$value; +} +close OUT; diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/map-changelog media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/map-changelog --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/map-changelog 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/map-changelog 2017-12-20 08:29:54.000000000 +0000 @@ -0,0 +1 @@ +changeset = changelog.tmpl diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/modules.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/modules.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/modules.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/modules.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,51 @@ +#!/bin/sh + +function xrmmod() { + local module regex + module="$1" + regex=`echo $module | sed -e 's/[-_]/[-_]/g'` + grep -qe "$regex" /proc/modules || return 0 + echo "unload $module" + if test "$UID" = "0"; then + /sbin/rmmod $module + else + sudo /sbin/rmmod $module + fi +} + +function xinsmod() { + local module regex file args + module="$1" + shift + args="$*" + regex=`echo $module | sed -e 's/[-_]/[-_]/g'` + grep -qe "$regex" /proc/modules && return + file="" + test -f "$module.o" && file="$module.o" + test -f "$module.ko" && file="$module.ko" + if test "$file" != ""; then + echo "load $file $args" + if test "$UID" = "0"; then + /sbin/insmod $file $args + else + sudo /sbin/insmod $file $args + fi + else + echo "load $module $args" + if test "$UID" = "0"; then + /sbin/modprobe $module $args + else + sudo /sbin/modprobe $module $args + fi + fi +} + +function v4l2basic() { + for module in i2c-core i2c-algo-bit \ + videodev v4l2-common v4l1-compat \ + video-buf \ + soundcore + do + xinsmod $module + done +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/prepare-ChangeLog.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/prepare-ChangeLog.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/prepare-ChangeLog.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/prepare-ChangeLog.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,586 @@ +#!/usr/bin/perl -w +# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +# Perl script to create a ChangeLog entry with names of files +# and functions from a hg diff. +# +# Darin Adler , started 20 April 2000 +# Java support added by Maciej Stachowiak +# last updated 28 December 2000 +# +# Mauro Carvalho Chehab : modified to +# allow signed-off-by tags, GMT Time and V4L format. +# CHANVE_LOG Env variables now are mandatory. +# Updated at 15 January 2005 +# +# Mauro Carvalho Chehab : modified to +# work with Mercurial +# Updated at 29 August 2005 +# +# Mauro Carvalho Chehab : modified to +# just generate a changelog entry +# Updated at 01 January 2006 +## +# (Someone put a license in here, like maybe GPL.) +# +# TODO: +# Provide option to put new ChangeLog into a separate file +# instead of editing the ChangeLog. +# For new files, just say "New file" instead of listing +# function names. +# List functions that have been removed too. +# Decide what a good logical order is for the changed files +# other than a normal text "sort" (top level first?) +# (group directories?) (.h before .c?) +# Leave a diff file behind if asked, but in unified format. +# Handle C++ and yacc source files too (other languages?). +# Help merge when there are ChangeLog conflicts or if there's +# already a partly written ChangeLog entry. +# Find appropriate ChangeLog to edit for each changed file +# instead of always using ChangeLog in current directory. +# Add command line option to put the ChangeLog into a separate +# file or just spew it out stdout. +# Figure out how to allow -z options from .cvsrc to work without +# letting other bad options work. Currently the -f disables +# everything from the .cvsrc. +# Add CVS version numbers for each file too (can't do that until +# the changes are checked in, though). +# Work around diff stupidity where deleting a function that starts +# with a comment makes diff think that the following function +# has been changed (if the following function starts with a comment +# with the same first line, such as /**) +# Work around diff stupidity where deleting an entire function and +# the blank lines before it makes diff think you've changed the +# previous function. + +use diagnostics; +use strict; + +use English; +use Text::Wrap; + +# Get environment variables required. +my $name = $ENV{CHANGE_LOG_NAME}; +my $email_address = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; +my $login = $ENV{CHANGE_LOG_LOGIN}; + +my $outfile = shift || ""; + +if (!defined $name) + { + print STDERR "Please, define env var CHANGE_LOG_NAME.\n"; + exit; + } +if (!defined $email_address) + { + print STDERR "Please, define env var CHANGE_LOG_EMAIL_ADDRESS.\n"; + exit; + } +if (!defined $login) + { + print STDERR "Please, define env var CHANGE_LOG_LOGIN.\n"; + exit; + } + +# For each file, build a list of modified lines. +# Use line numbers from the "after" side of each diff. +print STDERR " Running hg diff to find changes.\n"; +my %changed_line_ranges; +my $file; +open DIFF, "hg diff |" or die "The hg diff failed: $OS_ERROR.\n"; +while () + { + $file = $1 if /^diff -r .* (\S+)$/; + if (defined $file) + { + push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ]; + } + } +close DIFF; +if (!%changed_line_ranges) + { + print STDERR " No changes found.\n"; + exit; + } + +# For each ".c" file, convert line range to function list. +print STDERR " Extracting affected function names from C source files.\n"; +my %function_lists; +foreach my $file (keys %changed_line_ranges) + { + # An empty function list still indicates that something changed. + $function_lists{$file} = ""; + + # Only look for function names in .c files. + next unless $file =~ /\.(c|java)/; + + # Find all the functions in the file. + open SOURCE, $file or next; + my @function_ranges = get_function_line_ranges(\*SOURCE, $file); + close SOURCE; + + # Find all the modified functions. + my @functions; + my %saw_function; + my @change_ranges = (@{$changed_line_ranges{$file}}, []); + my @change_range = (0, 0); + FUNCTION: foreach my $function_range_ref (@function_ranges) + { + my @function_range = @$function_range_ref; + + # Advance to successive change ranges. + for (;; @change_range = @{shift @change_ranges}) + { + last FUNCTION unless @change_range; + + # If past this function, move on to the next one. + next FUNCTION if $change_range[0] > $function_range[1]; + + # If an overlap with this function range, record the function name. + if ($change_range[1] >= $function_range[0] + and $change_range[0] <= $function_range[1]) + { + if (!$saw_function{$function_range[2]}) + { + $saw_function{$function_range[2]} = 1; + push @functions, $function_range[2]; + } + next FUNCTION; + } + } + } + + # Format the list of functions now. + $function_lists{$file} = " (" . join("), (", @functions) . "):" if @functions; + } + +# Write out a new ChangeLog file. +print STDERR " Editing the ChangeLog file.\n"; +my $date = sprintf "%d-%02d-%02d %02d:%02d", + 1900 + (gmtime $BASETIME)[5], # year + 1 + (gmtime $BASETIME)[4], # month + (gmtime $BASETIME)[3], # day within month + (gmtime $BASETIME)[2], # hour + (gmtime $BASETIME)[1]; # min + +if ($outfile eq "") { + open CHANGE_LOG, ">&STDOUT"; +} else { + open CHANGE_LOG, "> $outfile" or die "Could not write to $outfile\n."; +} +print CHANGE_LOG "$date $login\n\n"; +foreach my $file (sort keys %function_lists) + { + my $lines = wrap("\t", "\t", "XX$file:$function_lists{$file}"); + $lines =~ s/^\tXX/\t* /; + print CHANGE_LOG "$lines\n"; + } +print CHANGE_LOG "\n\tSigned-off-by: $name <$email_address>\n"; +close CHANGE_LOG; + +# Done. +print STDERR " Done editing ChangeLog.\n"; +exit; + + + +sub get_function_line_ranges + { + my ($file_handle, $file_name) = @_; + + if ($file_name =~ /\.c$/) { + return get_function_line_ranges_for_c ($file_handle, $file_name); + } elsif ($file_name =~ /\.java$/) { + return get_function_line_ranges_for_java ($file_handle, $file_name); + } + return (); + } + +# Read a file and get all the line ranges of the things that look like C functions. +# A function name is the last word before an open parenthesis before the outer +# level open brace. A function starts at the first character after the last close +# brace or semicolon before the function name and ends at the close brace. +# Comment handling is simple-minded but will work for all but pathological cases. +# +# Result is a list of triples: [ start_line, end_line, function_name ]. + +sub get_function_line_ranges_for_c + { + my ($file_handle, $file_name) = @_; + + my @ranges; + + my $in_comment = 0; + my $in_macro = 0; + my $in_parentheses = 0; + my $in_braces = 0; + + my $word = ""; + + my $potential_start = 0; + my $potential_name = ""; + + my $start = 0; + my $name = ""; + + while (<$file_handle>) + { + # Handle continued multi-line comment. + if ($in_comment) + { + next unless s-.*\*/--; + $in_comment = 0; + } + + # Handle continued macro. + if ($in_macro) + { + $in_macro = 0 unless /\\$/; + next; + } + + # Handle start of macro (or any preprocessor directive). + if (/^\s*\#/) + { + $in_macro = 1 if /^([^\\]|\\.)*\\$/; + next; + } + + # Handle comments and quoted text. + while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy + { + my $match = $1; + if ($match eq "/*") + { + if (!s-/\*.*?\*/--) + { + s-/\*.*--; + $in_comment = 1; + } + } + elsif ($match eq "//") + { + s-//.*--; + } + else # ' or " + { + if (!s-$match([^\\]|\\.)*?$match--) + { + warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n"; + s-$match.*--; + } + } + } + + # Find function names. + while (m-(\w+|[(){};])-g) + { + # Open parenthesis. + if ($1 eq "(") + { + $potential_name = $word unless $in_parentheses; + $in_parentheses++; + next; + } + + # Close parenthesis. + if ($1 eq ")") + { + $in_parentheses--; + next; + } + + # Open brace. + if ($1 eq "{") + { + # Promote potiential name to real function name at the + # start of the outer level set of braces (function body?). + if (!$in_braces and $potential_start) + { + $start = $potential_start; + $name = $potential_name; + } + + $in_braces++; + next; + } + + # Close brace. + if ($1 eq "}") + { + $in_braces--; + + # End of an outer level set of braces. + # This could be a function body. + if (!$in_braces and $name) + { + push @ranges, [ $start, $INPUT_LINE_NUMBER, $name ]; + $name = ""; + } + + $potential_start = 0; + $potential_name = ""; + next; + } + + # Semicolon. + if ($1 eq ";") + { + $potential_start = 0; + $potential_name = ""; + next; + } + + # Word. + $word = $1; + if (!$in_parentheses) + { + $potential_start = 0; + $potential_name = ""; + } + if (!$potential_start) + { + $potential_start = $INPUT_LINE_NUMBER; + $potential_name = ""; + } + } + } + + warn "mismatched braces in $file_name\n" if $in_braces; + warn "mismatched parentheses in $file_name\n" if $in_parentheses; + + return @ranges; + } + + + +# Read a file and get all the line ranges of the things that look like Java +# classes, interfaces and methods. +# +# A class or interface name is the word that immediately follows +# `class' or `interface' when followed by an open curly brace and not +# a semicolon. It can appear at the top level, or inside another class +# or interface block, but not inside a function block +# +# A class or interface starts at the first character after the first close +# brace or after the function name and ends at the close brace. +# +# A function name is the last word before an open parenthesis before +# an open brace rather than a semicolon. It can appear at top level or +# inside a class or interface block, but not inside a function block. +# +# A function starts at the first character after the first close +# brace or after the function name and ends at the close brace. +# +# Comment handling is simple-minded but will work for all but pathological cases. +# +# Result is a list of triples: [ start_line, end_line, function_name ]. + +sub get_function_line_ranges_for_java + { + my ($file_handle, $file_name) = @_; + + my @current_scopes; + + my @ranges; + + my $in_comment = 0; + my $in_macro = 0; + my $in_parentheses = 0; + my $in_braces = 0; + my $in_non_block_braces = 0; + my $class_or_interface_just_seen = 0; + + my $word = ""; + + my $potential_start = 0; + my $potential_name = ""; + my $potential_name_is_class_or_interface = 0; + + my $start = 0; + my $name = ""; + my $current_name_is_class_or_interface = 0; + + while (<$file_handle>) + { + # Handle continued multi-line comment. + if ($in_comment) + { + next unless s-.*\*/--; + $in_comment = 0; + } + + # Handle continued macro. + if ($in_macro) + { + $in_macro = 0 unless /\\$/; + next; + } + + # Handle start of macro (or any preprocessor directive). + if (/^\s*\#/) + { + $in_macro = 1 if /^([^\\]|\\.)*\\$/; + next; + } + + # Handle comments and quoted text. + while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy + { + my $match = $1; + if ($match eq "/*") + { + if (!s-/\*.*?\*/--) + { + s-/\*.*--; + $in_comment = 1; + } + } + elsif ($match eq "//") + { + s-//.*--; + } + else # ' or " + { + if (!s-$match([^\\]|\\.)*?$match--) + { + warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n"; + s-$match.*--; + } + } + } + + # Find function names. + while (m-(\w+|[(){};])-g) + { + # Open parenthesis. + if ($1 eq "(") + { + if (!$in_parentheses) { + $potential_name = $word; + $potential_name_is_class_or_interface = 0; + } + $in_parentheses++; + next; + } + + # Close parenthesis. + if ($1 eq ")") + { + $in_parentheses--; + next; + } + + # Open brace. + if ($1 eq "{") + { + # Promote potiential name to real function name at the + # start of the outer level set of braces (function/class/interface body?). + if (!$in_non_block_braces + and (!$in_braces or $current_name_is_class_or_interface) + and $potential_start) + { + if ($name) + { + push @ranges, [ $start, ($INPUT_LINE_NUMBER - 1), + join ('.', @current_scopes) ]; + } + + + $current_name_is_class_or_interface = $potential_name_is_class_or_interface; + + $start = $potential_start; + $name = $potential_name; + + push (@current_scopes, $name); + } else { + $in_non_block_braces++; + } + + $potential_name = ""; + $potential_start = 0; + + $in_braces++; + next; + } + + # Close brace. + if ($1 eq "}") + { + $in_braces--; + + # End of an outer level set of braces. + # This could be a function body. + if (!$in_non_block_braces) + { + if ($name) + { + push @ranges, [ $start, $INPUT_LINE_NUMBER, + join ('.', @current_scopes) ]; + + pop (@current_scopes); + + if (@current_scopes) + { + $current_name_is_class_or_interface = 1; + + $start = $INPUT_LINE_NUMBER + 1; + $name = $current_scopes[$#current_scopes-1]; + } + else + { + $current_name_is_class_or_interface = 0; + $start = 0; + $name = ""; + } + } + } + else + { + $in_non_block_braces-- if $in_non_block_braces; + } + + $potential_start = 0; + $potential_name = ""; + next; + } + + # Semicolon. + if ($1 eq ";") + { + $potential_start = 0; + $potential_name = ""; + next; + } + + if ($1 eq "class" or $1 eq "interface") { + $class_or_interface_just_seen = 1; + next; + } + + # Word. + $word = $1; + if (!$in_parentheses) + { + if ($class_or_interface_just_seen) { + $potential_name = $word; + $potential_start = $INPUT_LINE_NUMBER; + $class_or_interface_just_seen = 0; + $potential_name_is_class_or_interface = 1; + next; + } + } + if (!$potential_start) + { + $potential_start = $INPUT_LINE_NUMBER; + $potential_name = ""; + } + $class_or_interface_just_seen = 0; + } + } + + warn "mismatched braces in $file_name\n" if $in_braces; + warn "mismatched parentheses in $file_name\n" if $in_parentheses; + + return @ranges; + } diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/prep_commit_msg.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/prep_commit_msg.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/prep_commit_msg.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/prep_commit_msg.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,147 @@ +#!/usr/bin/perl + +my $diff = 'diff'; +if ($ARGV[0] eq '-q') { + $diff = 'qdiff'; + shift; +} +my $autopatch = shift; + +# Get Hg username from environment +my $user = $ENV{HGUSER}; + +sub hgrcuser($) +{ + my $file = shift; + my $ui = 0; + open IN, '<', $file; + while () { + $ui = 1 if (/^\s*\[ui\]/); + if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { + close IN; + return($1); + } + } + close IN; + return(""); +} + +# Didn't work? Try the repo's .hgrc file +if ($user eq "") { + my $hgroot = `hg root`; + chomp($hgroot); + $user = hgrcuser("$hgroot/.hg/hgrc"); +} +# Ok, try ~/.hgrc next +if ($user eq "") { + $user = hgrcuser("$ENV{HOME}/.hgrc"); +} + +# Still no luck? Try some other environment variables +if ($user eq "") { + my $name = $ENV{CHANGE_LOG_NAME}; + my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; + $user = "$name <$email>" if ($name ne "" || $email ne ""); +} + +# Last try to come up with something +if ($user eq "") { + $user = "$ENV{USER} <>"; +} + +$checkpatch=$ENV{CHECKPATCH}; + +if (!$checkpatch) { + $checkpatch="/lib/modules/`uname -r`/build/scripts/checkpatch.pl"; +} + +my $cp_version; +open IN,"$checkpatch|"; +while () { + tr/A-Z/a-z/; + if (m/version\s*:\s*([\d\.]+)/) { + $cp_version = $1; + } +} +close IN; + +my $intree_checkpatch = "scripts/checkpatch.pl --no-tree"; +if (!open IN,"$intree_checkpatch|") { + $intree_checkpatch = "v4l/".$intree_checkpatch; + open IN,"$intree_checkpatch|"; +} +while () { + tr/A-Z/a-z/; + if (m/version\s*:\s*([\d\.]+)/) { + if ($1 > $cp_version) { + print "# WARNING: $checkpatch version $cp_version is\n" + ."# older than $intree_checkpatch version" + ." $1.\n# Using in-tree one.\n#\n"; + $cp_version = $1; + $checkpatch = $intree_checkpatch; + } + } +} +close IN; + +print "# Added/removed/changed files:\n"; +system "hg $diff | diffstat -p1 -c"; + +open IN,"hg $diff | $checkpatch -q --nosignoff -|"; +my $err=0; +while () { + if (!$err) { + print "#\n# WARNING: $checkpatch version $cp_version returned ". + "some errors.\n# Please fix.\n#\n"; + + + $err=1; + } + print "# $_"; +} +close IN; + + +if (-s $autopatch) { + print "#\n# Note, a problem with your patch was detected! These changes were made\n"; + print "# automatically: $autopatch\n"; + system "diffstat -p0 -c $autopatch"; + print "#\n# Please review these changes and see if they belong in your patch or not.\n"; +} +if ($diff eq 'qdiff') { + # Use existing mq patch logfile? + open IN, "hg qheader |"; + my @header = ; + close IN; + + if ($#header > 0) { + # Use existing header + print @header; + exit; + } + # No header, use pre-made log message below + + # Hg will strip lines that start with "From: " from mq patch headers! + # In order to stop it, we insert this extra From line at the top, + # Hg will strip it and then leave the real from line alone. + print "From: $user\n\n"; +} +print <<"EOF"; +# +# Patch Subject (a brief description with less than 74 chars): + + +# From Line, identifying the name of the patch author +From: $user + +# A detailed description: + +# NEW: Please change the priority of the patch to "high" if the patch is +# a bug fix, or are meant to be applied at the first upstream +# version of a new driver whose changes don't depend on changes on +# core modules +Priority: normal + +# At the end Signed-off-by: fields by patch author and committer, at least. +Signed-off-by: $user +EOF diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/release.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/release.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/release.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/release.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,63 @@ +#!/bin/sh + +# config +release="$HOME/kernel/release" +ver_bt="0.9.15" +ver_sa="0.2.12" +ver_cx="0.0.4" + +# common files +files_v4l="v4l*.[ch] video-buf.[ch] videodev*.h" +files_tuner="tuner.[ch] tda9887.[ch]" +files_i2c="id.h audiochip.h" +files_common="$files_v4l $files_tuner $files_i2c doc" + +# other files +files_ir="ir-common.[ch]" +files_audio="msp3400.[ch] tvaudio.[ch]" + +files_bttv="bt848.h btcx*.[ch] bttv*.[ch] ir-kbd*.c" +files_saa="saa7134*.[ch] saa6752hs.[ch] ir-kbd-i2c.c" +files_cx="btcx*.[ch] cx*.[ch]" + + +###################################################################################### +# helpers + +function build_release () { + local name="$1"; shift + local version="$1"; shift + local files="$*" + local dest="$WORK/$name-$version" + local tarball="$release/$name-$version.tar.gz" + + # copy / prepare stuff + mkdir "$dest" + cp -av $files "$dest" || exit 1 + cp -v Makefile "$dest" + cp -v "scripts/config.$name" "$dest"/Make.config + + # build test + (cd $dest; make) || exit 1 +# (cd $dest; ls *.o; sleep 5) + (cd $dest; make clean) + + # build tarball + tar czCf "$WORK" "$tarball" "$name-$version" +} + + +###################################################################################### +# main + +# tmp dir for my files +WORK="${TMPDIR-/tmp}/${0##*/}-$$" +mkdir "$WORK" || exit 1 +trap 'rm -rf "$WORK"' EXIT + +build_release "bttv" "$ver_bt" \ + "$files_common" "$files_ir" "$files_audio" "$files_bttv" +build_release "saa7134" "$ver_sa" \ + "$files_common" "$files_ir" "$files_audio" "$files_saa" +build_release "cx88" "$ver_cx" \ + "$files_common" "$files_cx" diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/rmmod.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/rmmod.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/rmmod.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/rmmod.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,291 @@ +#!/usr/bin/perl +use strict; +use File::Find; +use Proc::ProcessTable; + + +my %depend = (); +my %depend2 = (); +my %rmlist = (); +my @nodep; +my @modlist; +my @allmodules; +my %reqmodules; +my %loaded = (); +my $i=0; + +# Device debug parameters +# Module name Debug option +my %debug = ( "tuner" => "tuner_debug=1", + "dvb-core" => "cam_debug=1", + "dvb-ttpci" => "debug=247", + "b2c2-flexcop" => "debug=0x01", + "b2c2-flexcop-usb" => "debug=0x01", + "b2c2-flexcop-pci" => "debug=0x01", + "dvb-usb" => "debug=0x33", + "dvb-usb-gp8psk" => "debug=0x03", + "dvb-usb-vp7045" => "debug=0x03", + "dvb-usb-dtt200u" => "debug=0x03", + "dvb-usb-dibusb-common" => "debug=0x03", + ); + +sub getobsolete() +{ + my @obsolete; + open OBSOLETE, ') { + next if (/^\s*#/ || /^\s*$/); + chomp; + m|^.*/([^/]+)$| and push @obsolete, $1; + } + + close OBSOLETE; + return @obsolete; +} + +sub findprog($) +{ + foreach(split(/:/, $ENV{PATH}),qw(/sbin /usr/sbin /usr/local/sbin)) { + return "$_/$_[0]" if(-x "$_/$_[0]"); + } + die "Can't find needed utility '$_[0]'"; +} + +sub parse_dir { + my $file = $File::Find::name; + my $modinfo = findprog('modinfo'); + + if (!($file =~ /[.]ko$/)) { + return; + } + + my $module = $file; + $module =~ s|^[./]*(.*)[.]ko|\1|; + + open IN, "$modinfo $file|grep depends|cut -b 17-|"; + while () { + my $deps = $_; + $deps =~ s/\n//; + $deps =~ s/[,]/ /g; + $deps = " $deps "; + $depend{$module} = $deps; + push @allmodules, $module; + $i++; + } + close IN; +} + +sub parse_loaded { + open IN, "/proc/modules"; + while () { + m/^([\w\d_-]+)/; + $loaded{$1}=1; + } + close IN; +} + +sub cleandep() +{ + my $dep; + + while ( my ($k, $v) = each(%depend) ) { + my $arg=$v; + my $arg2=" "; + while (!($arg =~ m/^\s*$/)) { + if ($arg =~ m/^ ([^ ]+) /) { + my $val=$1; + if (exists($depend{$val})) { + $arg2="$arg2 $val "; + } else { + $reqmodules{$val}=1; + } + } + $arg =~ s/^ [^ ]+//; + $arg2 =~ s/\s\s+/ /; + } + $depend2 { $k } = $arg2; + } + +} + +sub rmdep() +{ + my $dep; + + while ($dep=pop @nodep) { + while ( my ($k, $v) = each(%depend2) ) { + if ($v =~ m/\s($dep)\s/) { + $v =~ s/\s${dep}\s/ /; + $v =~ s/\s${dep}\s/ /; + $v =~ s/\s${dep}\s/ /; + $depend2 {$k} = $v; + } + } + } +} + +sub orderdep () +{ + my $old; + do { + $old=$i; + while ( my ($key, $value) = each(%depend2) ) { + if ($value =~ m/^\s*$/) { + push @nodep, $key; + push @modlist, $key; + $i=$i-1; + delete $depend2 {$key}; + } + } + rmdep(); + } until ($old==$i); + while ( my ($key, $value) = each(%depend2) ) { + printf "ERROR: bad dependencies - $key ($value)\n"; + } +} + +sub insmod ($) +{ + my $debug=shift; + my $modprobe = findprog('modprobe'); + my $insmod = findprog('insmod'); + + while ( my ($key, $value) = each(%reqmodules) ) { + print ("$modprobe $key\n"); + system ("$modprobe $key"); + } + + foreach my $key (@modlist) { + if ($debug) { + my $dbg=$debug{$key}; + + print "$insmod ./$key.ko $dbg\n"; + system "$insmod ./$key.ko $dbg\n"; + } else { + print "$insmod ./$key.ko\n"; + system "$insmod ./$key.ko\n"; + } + } +} + +my @pulse; +my $try_pulseaudio = 1; + +sub check_pulseaudio() +{ + my $t = new Proc::ProcessTable; + foreach my $p ( @{$t->table} ) { + push @pulse, $p->uid if ($p->cmndline =~m,/pulseaudio ,); + } + $try_pulseaudio = 0 if (!@pulse); + + print "Pulseaudio is running with UUID(s): @pulse\n"; +} + +sub unload_pulseaudio($) +{ + my $driver_name = shift; + my $cur_module; + + return if (!$try_pulseaudio); + + check_pulseaudio() if (!@pulse); + return if (!$try_pulseaudio); + + for my $pid (@pulse) { + my $user = getpwuid($pid); + +# printf "LANG=C su $user -c \"pacmd list-sources\" |\n"; + open IN, "LANG=C su $user -c \"pacmd list-sources\" |"; + while () { + $cur_module = $1 if (/^\s*module:\s*(\d+)/); + + if (/^\s*alsa.driver_name\s*=\s*"(.*)"/) { + if ($1 eq $driver_name) { +# print "LANG=C su $user -c \"pactl unload-module $cur_module\"\n"; + system ("LANG=C su $user -c \"pactl unload-module $cur_module\""); + } + next; + } + + # Special case: em28xx sometimes use a Vendor Class at + # the same interface as the video node. Pulseaudio can't + # get the driver name in this case + if (/^\s*alsa.card_name\s*=\s*"Em28xx/) { +# print "LANG=C su $user -c \"pactl unload-module $cur_module\"\n"; + system ("LANG=C su $user -c \"pactl unload-module $cur_module\""); + } + } + close IN; + +# printf "LANG=C su $user -c \"pacmd list-sinks\" |\n"; + open IN, "LANG=C su $user -c \"pacmd list-sinks\" |" or return; + while () { + $cur_module = $1 if (/^\s*module:\s*(\d+)/); + if (/^\s*alsa.driver_name\s*=\s*"(.*)"/) { + if ($1 eq $driver_name) { +# print "LANG=C su $user -c \"pactl unload-module $1\"\n"; + system ("LANG=C su $user -c \"pactl unload-module $1\""); + } + } + } + } + close IN; +} + +sub rmmod(@) +{ + my $rmmod = findprog('rmmod'); + my @not; + foreach (reverse @_) { + s/-/_/g; + if (exists ($loaded{$_})) { + my $module = $_; + print "$rmmod $module\n"; + unload_pulseaudio($module); + unshift @not, $module if (system "$rmmod $module"); + } + } + return @not; +} + +sub prepare_cmd() +{ + find(\&parse_dir, "."); + printf "found $i modules\n"; + + cleandep(); + orderdep(); +} + +# main +my $mode=shift; +if ($mode eq "load") { + prepare_cmd; + insmod(0); +} else { + if ($mode eq "unload") { + prepare_cmd; + parse_loaded; + my @notunloaded = rmmod(@modlist, getobsolete()); + @notunloaded = rmmod(@notunloaded) if (@notunloaded); + if (@notunloaded) { + print "Couldn't unload: ", join(' ', @notunloaded), "\n"; + } + } elsif ($mode eq "reload") { + prepare_cmd; + parse_loaded; + rmmod(@modlist); + insmod(0); + } elsif ($mode eq "debug") { + prepare_cmd; + parse_loaded; + insmod(1); + } elsif ($mode eq "check") { + prepare_cmd; + parse_loaded; + } else { + printf "Usage: $0 [load|unload|reload|debug|check]\n"; + } +} + diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/saa7134.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/saa7134.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/saa7134.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/saa7134.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,60 @@ +#!/usr/bin/perl -w +use strict; + +my %map = ( + "PCI_ANY_ID" => "0", + "PCI_VENDOR_ID_PHILIPS" => "1131", + "PCI_VENDOR_ID_ASUSTEK" => "1043", + "PCI_VENDOR_ID_MATROX" => "102B", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(SAA7134_BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # saa7134_boards + if (/\[(SAA7134_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # saa7134_pci_tbl + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+)\s*,*/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+)\s*,*/); + if (/.driver_data\s*=\s*(\w+)\s*,*/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-40s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/saa7164.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/saa7164.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/saa7164.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/saa7164.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w +use strict; + +my %map = ( + "PCI_ANY_ID" => "0", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(SAA7164_BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # saa7164_boards + if (/\[(SAA7164_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # saa7164_pci_tbl + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.card\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/strip-trailing-whitespaces.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/strip-trailing-whitespaces.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/strip-trailing-whitespaces.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/strip-trailing-whitespaces.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,36 @@ +#!/bin/sh +# Strips trailing whitespace. Leading spaces and spaces after tabs are +# converted to the equivalent sequence of tabs only. + +# Use the option "fast" to only check files Hg thinks are new or modified. +# The option "manifest" will use Hg's manifest command to check all files +# under Hg revision control. +# Otherwise, all files under the linux tree are checked, except files in CVS +# directories and .cvsignore files. This is the historical behavior. + + +if [ "x$1" = "xfast" ]; then + files="hg status -man" +elif [ "x$1" = "xqfast" ]; then + files="hg status --rev -2 -man" +elif [ "x$1" = "xmanifest" ]; then + files="hg manifest | cut '-d ' -f3" +else + files="find linux -type f -print" +fi + +for file in `eval $files`; do + case "$file" in + *.gif | *.pdf | *.patch | *.h.xml | *.c.xml) + continue + ;; + esac + + perl -ne ' + s/[ \t]+$//; + s<^ {8}> <\t>; + s<^ {1,7}\t> <\t>; + while( s<\t {8}> <\t\t>g || s<\t {1,7}\t> <\t\t>g ) {}; + print' < "${file}" | \ + diff -u --label="$file" "$file" --label="$file" - +done diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/tuner.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/tuner.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/tuner.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/tuner.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +my $H = shift; +my $C = shift; +my %blacklist; + +open IN, "<$H"; +while () { + # defines in header file + if (/#define\s+(TUNER_\w+)\s+(\d+)/) { + my $num=$2; + $data{$1}->{nr} = $num; + if (/#define\s+TUNER_TDA9887/) { + $blacklist{$num}=1; + } + next; + } +} +close IN; + +open IN, "<$C"; +while () { + # tuners + if (/\[(TUNER_\w+)\]/) { + $id = $1; + if ($id =~ m/TUNER_MAX/) { + next; + } + $data{$id}->{id} = $id; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + if ($blacklist{$data{$item}->{nr}}) { + next; + } + + printf("tuner=%d - %s", $data{$item}->{nr}, $data{$item}->{name}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/update media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/update --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/update 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/update 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,106 @@ +#!/bin/sh +source scripts/modules.sh +set -e + +case "`hostname --short`" in + eskarina) +# btopt="card=10" +# btopt="card=6 remote=1" + ;; + bogomips) + saopt="card=7" + ;; +esac + +########################################################################### +# unload + +# bttv +xrmmod dst +xrmmod bt878 +xrmmod ir-kbd-gpio +xrmmod ir-kbd-i2c +xrmmod bttv + +# cx88 +xrmmod cx88-dvb +xrmmod cx88-blackbird +xrmmod cx8802 +xrmmod cx8801 +xrmmod cx8800 +xrmmod cx88xx + +# saa7134 +xrmmod saa7134-dvb +xrmmod saa7134-empress +xrmmod saa7134 + +# saa7146 +xrmmod dvb_ttpci +xrmmod saa7146_vv + +# dvb +xrmmod or51132 +xrmmod cx22702 +xrmmod mt352 +xrmmod dvb-pll + +# common +xrmmod btcx-risc +xrmmod ir-common +xrmmod video-buf-dvb +xrmmod video-buf + +# i2c +xrmmod tuner +xrmmod msp3400 +xrmmod tvaudio +xrmmod tda9887 +xrmmod tveeprom + +########################################################################## +# reload + +sync; sleep 1; + +# common +v4l2basic +#xrmmod video-buf +#xinsmod video-buf debug=0 +#xrmmod v4l1-compat +#xinsmod v4l1-compat debug=1 + +xinsmod tveeprom debug=0 +xinsmod dvb-pll debug=0 +xinsmod btcx-risc debug=0 +xinsmod ir-common debug=0 repeat=0 +xinsmod tuner tuner_debug=0 +xinsmod tda9887 debug=0 qss=1 +xinsmod msp3400 debug=0 + +# bttv +xinsmod ir-kbd-i2c debug=0 +xinsmod bttv bttv_debug=0 vbi_debug=0 irq_debug=0 \ + fdsr=0 chroma_agc=1 vbibufs=4 irq_iswitch=0 i2c_scan=1 $btopt +xinsmod ir-kbd-gpio debug=0 + +# cx88 +xinsmod cx88xx core_debug=0 audio_debug=0 ir_debug=1 \ + i2c_debug=1 i2c_scan=1 +xinsmod cx8800 video_debug=0 vbi_debug=0 +xinsmod cx8801 +xinsmod cx8802 +xinsmod cx88-blackbird + +# saa7134 +xinsmod saa7134 audio_debug=0 i2c_scan=0 i2c_debug=0 oss=1 $saopt +xinsmod saa7134-empress + +# dvb stuff +xinsmod cx22702 debug=0 +xinsmod mt352 debug=1 +xinsmod or51132 +xinsmod tda1004x +xinsmod video-buf-dvb +xinsmod cx88-dvb +xinsmod saa7134-dvb diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/usbaudio_setup.sh media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/usbaudio_setup.sh --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/usbaudio_setup.sh 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/usbaudio_setup.sh 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,106 @@ +#!/bin/bash +# +# Copyright (C) 2006 Markus Rechberger +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +which /usr/bin/dialog >/dev/null +if [ "0" != "$?" ]; then +echo "this tool requires \"dialog\" (http://hightek.org/dialog/)" +exit 1 +fi +uid=`id -u` +if [ "0" != "$uid" ]; then +echo "this tool must be run as root, you can disable this message by editing the script but only do that unless you know what you're doing!" +exit 1 +fi +which gcc > /dev/null +if [ "0" != "$?" ]; then +echo "this tool won't work unless you install gcc" +exit 1 +fi +test -f ossid +if [ "0" != "$?" ]; then +cat > ossid.c <<_EOF +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv){ + int fd; + struct mixer_info *info; + fd=open(argv[1],O_RDONLY); + if(fd>=0){ + info=malloc(sizeof(struct mixer_info)); + ioctl(fd,SOUND_MIXER_INFO,info); + printf("%c \"%s %s\"\n",(argv[1][strlen(argv[1])-1]=='p')?'0':(argv[1][strlen(argv[1])-1]+1),info->name,info->id); + free(info); + close(fd); + } else { + return 1; + } + return 0; +} +_EOF +gcc ossid.c -o ossid +rm ossid.c +fi + +test -f /proc/asound/cards +if [ "0" != "$?" ]; then +dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ +--msgbox "Your system doesn't support ALSA, please have a look at \ +www.alsa-project.org and set it up properly \ + + +Press any key to continue... " 11 50 +exit 1; +fi + +dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ +--msgbox "This tool was written to ease up sound configuration for +* Terratec Hybrid XS +* Terratec Cinergy 250 USB 2.0 +* Hauppauge HVR 900 +* and possible others :) + +first select an usb audio source, as target choose your soundcard +Press any key to continue... " 13 60 + +ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your TV Audio source:" 12 60 5 2>/tmp/em2880_source.$$ +ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your output soundcard device:" 12 60 5 2>/tmp/em2880_dst.$$ + +source=`egrep '^[0-9p]' /tmp/em2880_source.$$` +dst=`egrep '^[0-9p]' /tmp/em2880_dst.$$` + +echo "playing $source to $dst"; +if [ "$source" = "0" ]; then + device="/dev/dsp" +else + device="/dev/dsp`expr $source - 1`" +fi + +if [ "$dst" = "0" ]; then + device2="/dev/dsp" +else + device2="/dev/dsp`expr $source - 1`" +fi +clear +echo "Using command: sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2" +sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2 diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/usbvision.pl media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/usbvision.pl --- media-build-dkms-0004~trusty/media-build-0005/v4l/scripts/usbvision.pl 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/scripts/usbvision.pl 2017-05-03 21:55:40.000000000 +0000 @@ -0,0 +1,42 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s*(\w+)\s*(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # boards + if (/^\s*\[([\w\d_]+)\]\s*=\s*{/) { + $id = $1; + $data{$id}->{id} = $id; + }; + + next unless defined($id); + + if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*).*/) + { + $subvendor=$1; + $subdevice=$2; + } + if(/driver_info\s*=\s*([\w\d_]+)/) + { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + } + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.ModelString\s*=\s*\"([^\"]+)\"/); + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-56s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff -Nru media-build-dkms-0004~trusty/media-build-0005/v4l/versions.txt media-build-dkms-0005~trusty/media-build-0005/v4l/versions.txt --- media-build-dkms-0004~trusty/media-build-0005/v4l/versions.txt 1970-01-01 00:00:00.000000000 +0000 +++ media-build-dkms-0005~trusty/media-build-0005/v4l/versions.txt 2018-06-01 10:12:52.000000000 +0000 @@ -0,0 +1,405 @@ +# Use this for stuff for drivers that don't compile +[9.255.255] +INTEL_ATOMISP +VIDEO_DW9714 + +[4.16.0] +# Needs device_get_match_data +VIDEO_I2C + +[4.13.0] +# Needs multiplexer support +VIDEO_MUX +# skb_put changed prototype in 4.13 +RADIO_WL128X + +[4.10.0] +# needs *probe_new in struct i2c_driver +VIDEO_OV5670 +VIDEO_OV7251 +VIDEO_IMX258 + +[4.8.0] +# needs i2c_new_secondary_device +VIDEO_ADV748X + +[4.7.0] +# needs i2c_mux_alloc +DVB_RTL2830 +DVB_RTL2832 +DVB_M88DS3103 +# needs struct i2c_mux_core +DVB_AF9013 + +[4.6.0] +# needs regmap_write_bits +DVB_CXD2820R + +[4.5.0] +# needs pm_runtime_get_if_in_use +VIDEO_OV13858 +# needs gpiochip_get_data +VIDEO_SOLO6X10 + +[4.3.0] +# needs regmap_write_bits +MEDIA_TUNER_TDA18250 +# needs struct reg_sequence +VIDEO_OV7740 + +[4.2.0] +# needs led_trigger_remove +V4L2_FLASH_LED_CLASS + +[4.0.0] +# needs of_property_read_u64_array +VIDEO_SMIAPP + +[3.19.0] +# needs of_property_read_u64_array +VIDEO_MT9V032 +# needs debugfs_create_devm_seqfile +CEC_CORE +MEDIA_CEC_SUPPORT +# needs fwnode_property_read_u32 +SDR_MAX2175 +# needs dma_wmb +VIDEO_IPU3_CIO2 +# needs fwnode_property_present +VIDEO_OV7670 + +[3.18.0] +# needs LED brightness support +V4L2_FLASH_LED_CLASS + +[3.17.0] +# needs GPIOD_OUT_LOW/HIGH +VIDEO_ADV7604 +VIDEO_MT9P031 +SOC_CAMERA_OV2640 +VIDEO_XILINX +I2C_SI4713 +VIDEO_TC358743 +VIDEO_ADP1653 +VIDEO_TVP5150 +VIDEO_ADV7180 +VIDEO_ET8EK8 +VIDEO_OV2640 +VIDEO_OV5645 +VIDEO_OV5640 +VIDEO_IMX274 +IR_GPIO_TX +IR_GPIO_CIR +VIDEO_OV5695 +VIDEO_OV9650 +VIDEO_OV2685 +VIDEO_TW9910 +SOC_CAMERA_TW9910 +VIDEO_MT9T112 +SOC_CAMERA_MT9T112 +VIDEO_OV772X +SOC_CAMERA_OV772X +# needs component_match_add +VIDEO_VIMC + +[3.15.0] +# needs reset_control_get_optional +RC_ST +# needs of_property_count_u32_elems +VIDEO_TDA1997X + +[3.14.0] +# needs pci_enable_msi_range +VIDEO_COBALT +# requires m2m_ctx in struct v4l2_fh +VIDEO_VIM2M +# requires devm_phy_optional_get +VIDEO_CADENCE_CSI2RX + +[3.13.0] +# needs gpio/consumer.h +RADIO_SI4713 + +[3.12.0] +# BIN_ATTR_RW was changed +IR_NUVOTON + +[3.11.0] +# needs freezable_schedule_hrtimeout_range +DVB_PT3 +# needs arch_phys_wc_add +VIDEO_FB_IVTV + +[3.10.0] +# needs include/linux/mfd/syscon.h +IR_HIX5HD2 + +[3.9.0] +# needs devm_ioremap_resource +VIDEO_SH_VEU +VIDEO_RENESAS_VSP1 +VIDEO_RCAR_VIN +VIDEO_TI_SC +VIDEO_TI_CSC +IR_IMG +VIDEO_CADENCE_CSI2TX +# needs spi_sync_transfer +IR_SPI + +[3.8.0] +# needs regmap lock/unlock ops +DVB_TS2020 + +[3.7.0] +# i2c_add_mux_adapter prototype change +# Needs PLATFORM_DEVID_AUTO +DVB_USB_RTL28XXU +DVB_USB_AF9035 +DVB_USB_ZD1301 +# needs pcie_capability_clear_and_set_word +DVB_NETUP_UNIDVB +# needs devm_pwm_get +IR_PWM_TX + +[3.6.0] +# needs include/linux/sizes.h +VIDEO_M5MOLS +VIDEO_S5C73M3 +# needs dma_mmap_coherent and sg_alloc_table_from_pages. +VIDEOBUF2_DMA_CONTIG + +[3.5.0] +# needs devm_clk_get, clk_enable, clk_disable +VIDEO_CODA +VIDEO_MT9T001 +VIDEO_S5K5BAF +VIDEO_S5K6A3 +VIDEO_OV2659 +VIDEO_OV5647 +# needs devm_gpio_request_one +VIDEO_ADV7183 +VIDEO_VS6624 +VIDEO_NOON010PC30 +# needs GPIOF_EXPORT +VIDEO_S5K6AA +# needs dev_err_ratelimited +MEDIA_TUNER_E4000 +# needs regmap_init with 4 arguments +DVB_USB_AF9015 +# needs of_find_i2c_adapter_by_node +DVB_C8SECTPFE +SOC_CAMERA + +[3.4.0] +# needs devm_regulator_bulk_get +VIDEO_S5K4ECGX +# needs EPROBE_DEFER +VIDEO_AD5820 +VIDEO_MT9M111 +# needs of_property_read_bool +VIDEO_ADV7343 +# needs devm_regmap_init_i2c +VIDEO_LM3560 +VIDEO_LM3646 +MEDIA_TUNER_TDA18212 +MEDIA_TUNER_M88RS6000T +MEDIA_TUNER_TUA9001 +MEDIA_TUNER_FC2580 +DVB_TDA10071 +DVB_SI2165 +# needs spi_finalize_current_message +USB_MSI3101 +USB_MSI2500 +MEDIA_TUNER_MSI001 +# needs regmap_bulk_write +MEDIA_TUNER_M88TS2022 +MEDIA_TUNER_IT913X +DVB_AF9033 +DVB_MN88472 +DVB_MN88473 +# does not compile for older kernels +CXD2880_SPI_DRV + +[3.3.0] +# Needs struct dma_interleaved_template in dmaengine.h +VIDEO_MEM2MEM_DEINTERLACE +# Needs of_node_put +VIDEO_TVP514X +VIDEO_TVP7002 +# requires new interface for alloc_ordered_workqueue +VIDEO_VIVID +# needs SPI driver framework +VIDEO_GS1662 + +[3.2.0] +# due to the rename at include/linux from "pm_qos_params.h" to "pm_qos.h" +SOC_CAMERA_MT9V022 +SOC_CAMERA_MT9M001 +SOC_CAMERA_MT9T031 +SOC_CAMERA_PLATFORM +# Needs of_match_ptr +VIDEO_THS8200 + +[3.0.0] +# fw_iso_context_queue_flush +DVB_FIREDTV + +[2.6.39] +# mfd header changes for 2.6.39 prevents compilation on 2.6.38. +RADIO_WL1273 +RADIO_TIMBERDALE +VIDEO_TIMBERDALE + +[2.6.37] +# Some stuff at viafb struct +VIDEO_VIA_CAMERA +# needs div64_s64 +MEDIA_TUNER_QM1D1C0042 +DVB_TC90522 +# requires linux/atomic.h +DVB_CXD2880 + +[2.6.36] + +[2.6.35] +# Needs usb_pipe_endpoint +DVB_USB_LME2510 + +[2.6.34] +MACH_DAVINCI_DM6467_EVM +MFD_TIMBERDALE +RADIO_SAA7706H +# Needs dma_set_coherent_mask +VIDEO_DT3155 +# Needs include/linux/lcm.h +VIDEO_APTINA_PLL +# Depends on VIDEO_APTINA_PLL +VIDEO_MT9M032 +# Needs include/linux/lcm.h +VIDEO_SMIAPP_PLL + +[2.6.33] +VIDEO_AK881X +V4L2_MEM2MEM_DEV +# Requires sound/aci.h introduced in 2.6.33 +RADIO_MIROPCM20 +# Problem with printk_ratelimited +DVB_PT1 + +[2.6.32] +# These rely on arch support that wasn't available until 2.6.32 +VIDEO_SH_MOBILE_CEU +VIDEO_PXA27x +VIDEO_TLG2300 +# Relies on some changes at PnP API +IR_ENE +IR_WINBOND_CIR +IR_ITE_CIR +IR_FINTEK +# Relies on i2c_lock_adapter +DVB_DRXK +# Requires ss_ep_comp in usb_host_endpoint +USB_VIDEO_CLASS + +[2.6.31] +# These rely on arch support that wasn't available until 2.6.31 +VIDEO_VPSS_SYSTEM +VIDEO_VPFE_CAPTURE +VIDEO_DM6446_CCDC +VIDEO_DM355_CCDC +# Start version for those drivers - probably compile with older versions +VIDEO_CX25821 +VIDEO_CX25821_ALSA +RADIO_TEF6862 +# follow_pfn needed by VIDEOBUF_DMA_CONTIG and drivers that use it +VIDEOBUF_DMA_CONTIG +VIDEOBUF_VMALLOC +DISPLAY_DAVINCI_DM646X_EVM +VIDEO_VPFE_CAPTURE +VIDEO_MX1 +VIDEO_MX3 + +[2.6.26] +# requires id_table and new i2c stuff +RADIO_TEA5764 +VIDEO_THS7303 + +[2.6.24] +# Some freezer routines +USB_GSPCA_SN9C20X_EVDEV +# Requires linux/mmc/sdio_func.h +SMS_SDIO_DRV +VIDEO_SAA7164 + +[2.6.23] +# writel/readl headers moved +DVB_MANTIS +MANTIS_CORE + + +[2.6.22] +#This driver requires I2C probe/remove fields +VIDEO_TCM825X +# This driver requires list_first_entry +USB_STKWEBCAM +# This driver needs div64_64 +DVB_DRX397XD +# Assumes struct input_dev has a dev field +DVB_DM1105 +# This driver needs hrtimer API +VIDEO_CX88 + +[2.6.20] +#This driver requires HID_REQ_GET_REPORT +USB_SI470X +RADIO_SI470X +# use of struct delayed_work +USB_GSPCA_FINEPIX +USB_GSPCA_JEILINJ +# uses linux/hid.h and struct delayed_work +USB_SI470X +# due to INIT_WORK changes +USB_GSPCA_SQ905 +USB_GSPCA_SQ905C +VIDEO_HDPVR +# due to device_move +VIDEO_PVRUSB2 +# due to struct file.f_path +VIDEO_CPIA + +[2.6.19] +# requires vmalloc_user/remap_vmalloc_range +VIDEO_CAFE_CCIC +VIDEO_TM6000 +#struct device vs struct class_device issues +USB_ET61X251 +USB_SN9C102 +USB_PWC +USB_PWC_DEBUG +USB_OV511 +USB_STV680 +USB_S2255 +VIDEO_USBVISION +# Uses supports_autosuspend +USB_MR800 +USB_DSBR +# Uses MODULE_FIRMWARE +DVB_AV7110 +# usb_complete_t changed prototype +USB_ZR364XX + +[2.6.18] +# Uses remap_vmalloc_range() +VIDEOBUF_VMALLOC +# Uses new class interface, which did not start to appear until 2.6.18. +VIDEO_PVRUSB2_SYSFS +# linux/uaccess.h +VIDEO_PMS + +[2.6.17] +# DVB_CORE_ATTACH relies on symbol_put_addr which hangs pre-2.6.17 +DVB_CORE_ATTACH +# Various changes to ALSA structs +VIDEO_CX18_ALSA +# cx18 needs list_for_each_entry_from +VIDEO_CX18