[vuplus-wifi-util] fix default ccode
[vuplus_openvuplus_3.0] / meta-bsp / recipes-driver / hmp / hmp-usb-dvb-t2-c-v04arm / vu_kernel_4.1.20.patch
1 diff -Naur media_build-bst-160430.orig/linux/drivers/media/dvb-core/dvbdev.c media_build-bst-160430/linux/drivers/media/dvb-core/dvbdev.c
2 --- media_build-bst-160430.orig/linux/drivers/media/dvb-core/dvbdev.c   2014-12-19 04:09:58.000000000 +0100
3 +++ media_build-bst-160430/linux/drivers/media/dvb-core/dvbdev.c        2017-07-06 14:59:10.952547108 +0200
4 @@ -190,6 +190,7 @@
5         int minor;
6         int id;
7  
8 +       char *vu_name = strstr(name, "_vuplus_");
9         mutex_lock(&dvbdev_register_lock);
10  
11         if ((id = dvbdev_get_free_id (adap, type)) < 0){
12 @@ -296,9 +297,9 @@
13         return 1;
14  }
15  
16 -static int dvbdev_get_free_adapter_num (void)
17 +static int dvbdev_get_free_adapter_num (int start_num)
18  {
19 -       int num = 0;
20 +       int num = start_num;
21  
22         while (num < DVB_MAX_ADAPTERS) {
23                 if (dvbdev_check_free_adapter_num(num))
24 @@ -320,12 +321,12 @@
25  
26         for (i = 0; i < DVB_MAX_ADAPTERS; ++i) {
27                 num = adapter_nums[i];
28 -               if (num >= 0  &&  num < DVB_MAX_ADAPTERS) {
29 +               if (num >= vu_name? 0:1  &&  num < DVB_MAX_ADAPTERS) {
30                 /* use the one the driver asked for */
31                         if (dvbdev_check_free_adapter_num(num))
32                                 break;
33                 } else {
34 -                       num = dvbdev_get_free_adapter_num();
35 +                       num = dvbdev_get_free_adapter_num(vu_name? 0:1);
36                         break;
37                 }
38                 num = -1;
39 @@ -455,7 +456,7 @@
40  {
41         int retval;
42         dev_t dev = MKDEV(DVB_MAJOR, 0);
43 -       printk(KERN_ERR "WARNING: You are using an experimental version of the media stack.\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.\nLatest git patches (needed if you report a bug to linux-media@vger.kernel.org):\n\t427ae153c65ad7a08288d86baf99000569627d03 [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal\n\tea2e813e8cc3492c951b9895724fd47187e04a6f [media] tlg2300: move to staging in preparation for removal\n\tc1d9e03d4ef47de60b414fa25f05f9c867f43c5a [media] vino/saa7191: move to staging in preparation for removal\n");
44 +       //printk(KERN_ERR "WARNING: You are using an experimental version of the media stack.\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.\nLatest git patches (needed if you report a bug to linux-media@vger.kernel.org):\n\t427ae153c65ad7a08288d86baf99000569627d03 [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal\n\tea2e813e8cc3492c951b9895724fd47187e04a6f [media] tlg2300: move to staging in preparation for removal\n\tc1d9e03d4ef47de60b414fa25f05f9c867f43c5a [media] vino/saa7191: move to staging in preparation for removal\n");
45  
46         if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, "DVB")) != 0) {
47                 printk(KERN_ERR "dvb-core: unable to get major %d\n", DVB_MAJOR);
48 diff -Naur media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvbsky.c media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvbsky.c
49 --- media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvbsky.c     2014-12-19 06:46:31.000000000 +0100
50 +++ media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvbsky.c  2017-07-06 15:01:22.810443706 +0200
51 @@ -58,7 +58,7 @@
52         if (wlen != 0)
53                 memcpy(state->obuf, wbuf, wlen);
54  
55 -       ret = dvb_usbv2_generic_rw_locked(d, state->obuf, wlen,
56 +       ret = dvb_usbv2_mediatree_generic_rw_locked(d, state->obuf, wlen,
57                         state->ibuf, rlen);
58  
59         if (!ret && (rlen != 0))
60 @@ -733,11 +733,11 @@
61  static struct usb_driver dvbsky_usb_driver = {
62         .name = KBUILD_MODNAME,
63         .id_table = dvbsky_id_table,
64 -       .probe = dvb_usbv2_probe,
65 -       .disconnect = dvb_usbv2_disconnect,
66 -       .suspend = dvb_usbv2_suspend,
67 -       .resume = dvb_usbv2_resume,
68 -       .reset_resume = dvb_usbv2_reset_resume,
69 +       .probe = dvb_usbv2_mediatree_probe,
70 +       .disconnect = dvb_usbv2_mediatree_disconnect,
71 +       .suspend = dvb_usbv2_mediatree_suspend,
72 +       .resume = dvb_usbv2_mediatree_resume,
73 +       .reset_resume = dvb_usbv2_mediatree_reset_resume,
74         .no_dynamic_id = 1,
75         .soft_unbind = 1,
76  };
77 diff -Naur media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
78 --- media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c       2014-12-19 08:09:03.000000000 +0100
79 +++ media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c    2017-07-06 15:10:19.488125119 +0200
80 @@ -21,8 +21,8 @@
81  
82  #include "dvb_usb_common.h"
83  
84 -static int dvb_usbv2_disable_rc_polling;
85 -module_param_named(disable_rc_polling, dvb_usbv2_disable_rc_polling, int, 0644);
86 +static int dvb_usbv2_mediatree_disable_rc_polling;
87 +module_param_named(disable_rc_polling, dvb_usbv2_mediatree_disable_rc_polling, int, 0644);
88  MODULE_PARM_DESC(disable_rc_polling,
89                 "disable remote control polling (default: 0)");
90  static int dvb_usb_force_pid_filter_usage;
91 @@ -31,7 +31,7 @@
92  MODULE_PARM_DESC(force_pid_filter_usage,
93                 "force all DVB USB devices to use a PID filter, if any (default: 0)");
94  
95 -static int dvb_usbv2_download_firmware(struct dvb_usb_device *d,
96 +static int dvb_usbv2_mediatree_download_firmware(struct dvb_usb_device *d,
97                 const char *name)
98  {
99         int ret;
100 @@ -65,7 +65,7 @@
101         return ret;
102  }
103  
104 -static int dvb_usbv2_i2c_init(struct dvb_usb_device *d)
105 +static int dvb_usbv2_mediatree_i2c_init(struct dvb_usb_device *d)
106  {
107         int ret;
108         dev_dbg(&d->udev->dev, "%s:\n", __func__);
109 @@ -92,7 +92,7 @@
110         return ret;
111  }
112  
113 -static int dvb_usbv2_i2c_exit(struct dvb_usb_device *d)
114 +static int dvb_usbv2_mediatree_i2c_exit(struct dvb_usb_device *d)
115  {
116         dev_dbg(&d->udev->dev, "%s:\n", __func__);
117  
118 @@ -113,7 +113,7 @@
119          * When the parameter has been set to 1 via sysfs while the
120          * driver was running, or when bulk mode is enabled after IR init.
121          */
122 -       if (dvb_usbv2_disable_rc_polling || d->rc.bulk_mode) {
123 +       if (dvb_usbv2_mediatree_disable_rc_polling || d->rc.bulk_mode) {
124                 d->rc_polling_active = false;
125                 return;
126         }
127 @@ -130,13 +130,13 @@
128                         msecs_to_jiffies(d->rc.interval));
129  }
130  
131 -static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
132 +static int dvb_usbv2_mediatree_remote_init(struct dvb_usb_device *d)
133  {
134         int ret;
135         struct rc_dev *dev;
136         dev_dbg(&d->udev->dev, "%s:\n", __func__);
137  
138 -       if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
139 +       if (dvb_usbv2_mediatree_disable_rc_polling || !d->props->get_rc_config)
140                 return 0;
141  
142         d->rc.map_name = d->rc_map;
143 @@ -195,7 +195,7 @@
144         return ret;
145  }
146  
147 -static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
148 +static int dvb_usbv2_mediatree_remote_exit(struct dvb_usb_device *d)
149  {
150         dev_dbg(&d->udev->dev, "%s:\n", __func__);
151  
152 @@ -208,8 +208,8 @@
153         return 0;
154  }
155  #else
156 -       #define dvb_usbv2_remote_init(args...) 0
157 -       #define dvb_usbv2_remote_exit(args...)
158 +       #define dvb_usbv2_mediatree_remote_init(args...) 0
159 +       #define dvb_usbv2_mediatree_remote_exit(args...)
160  #endif
161  
162  static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buf,
163 @@ -233,7 +233,7 @@
164         dvb_dmx_swfilter_raw(&adap->demux, buf, len);
165  }
166  
167 -static int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap)
168 +static int dvb_usbv2_mediatree_adapter_stream_init(struct dvb_usb_adapter *adap)
169  {
170         dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
171                         adap->id);
172 @@ -245,7 +245,7 @@
173         return usb_urb_initv2(&adap->stream, &adap->props->stream);
174  }
175  
176 -static int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap)
177 +static int dvb_usbv2_mediatree_adapter_stream_exit(struct dvb_usb_adapter *adap)
178  {
179         dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
180                         adap->id);
181 @@ -400,7 +400,7 @@
182         return ret;
183  }
184  
185 -static int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap)
186 +static int dvb_usbv2_mediatree_adapter_dvb_init(struct dvb_usb_adapter *adap)
187  {
188         int ret;
189         struct dvb_usb_device *d = adap_to_d(adap);
190 @@ -470,7 +470,7 @@
191         return ret;
192  }
193  
194 -static int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
195 +static int dvb_usbv2_mediatree_adapter_dvb_exit(struct dvb_usb_adapter *adap)
196  {
197         dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
198                         adap->id);
199 @@ -486,7 +486,7 @@
200         return 0;
201  }
202  
203 -static int dvb_usbv2_device_power_ctrl(struct dvb_usb_device *d, int onoff)
204 +static int dvb_usbv2_mediatree_device_power_ctrl(struct dvb_usb_device *d, int onoff)
205  {
206         int ret;
207  
208 @@ -524,7 +524,7 @@
209                 set_bit(ADAP_INIT, &adap->state_bits);
210         }
211  
212 -       ret = dvb_usbv2_device_power_ctrl(d, 1);
213 +       ret = dvb_usbv2_mediatree_device_power_ctrl(d, 1);
214         if (ret < 0)
215                 goto err;
216  
217 @@ -576,7 +576,7 @@
218                         goto err;
219         }
220  
221 -       ret = dvb_usbv2_device_power_ctrl(d, 0);
222 +       ret = dvb_usbv2_mediatree_device_power_ctrl(d, 0);
223         if (ret < 0)
224                 goto err;
225  err:
226 @@ -591,7 +591,7 @@
227         return ret;
228  }
229  
230 -static int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap)
231 +static int dvb_usbv2_mediatree_adapter_frontend_init(struct dvb_usb_adapter *adap)
232  {
233         int ret, i, count_registered = 0;
234         struct dvb_usb_device *d = adap_to_d(adap);
235 @@ -662,7 +662,7 @@
236         return ret;
237  }
238  
239 -static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap)
240 +static int dvb_usbv2_mediatree_adapter_frontend_exit(struct dvb_usb_adapter *adap)
241  {
242         int ret, i;
243         struct dvb_usb_device *d = adap_to_d(adap);
244 @@ -696,7 +696,7 @@
245         return 0;
246  }
247  
248 -static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
249 +static int dvb_usbv2_mediatree_adapter_init(struct dvb_usb_device *d)
250  {
251         struct dvb_usb_adapter *adap;
252         int ret, i, adapter_count;
253 @@ -750,15 +750,15 @@
254                         adap->max_feed_count = adap->props->pid_filter_count;
255                 }
256  
257 -               ret = dvb_usbv2_adapter_stream_init(adap);
258 +               ret = dvb_usbv2_mediatree_adapter_stream_init(adap);
259                 if (ret)
260                         goto err;
261  
262 -               ret = dvb_usbv2_adapter_dvb_init(adap);
263 +               ret = dvb_usbv2_mediatree_adapter_dvb_init(adap);
264                 if (ret)
265                         goto err;
266  
267 -               ret = dvb_usbv2_adapter_frontend_init(adap);
268 +               ret = dvb_usbv2_mediatree_adapter_frontend_init(adap);
269                 if (ret)
270                         goto err;
271  
272 @@ -773,16 +773,16 @@
273         return ret;
274  }
275  
276 -static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
277 +static int dvb_usbv2_mediatree_adapter_exit(struct dvb_usb_device *d)
278  {
279         int i;
280         dev_dbg(&d->udev->dev, "%s:\n", __func__);
281  
282         for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) {
283                 if (d->adapter[i].props) {
284 -                       dvb_usbv2_adapter_dvb_exit(&d->adapter[i]);
285 -                       dvb_usbv2_adapter_stream_exit(&d->adapter[i]);
286 -                       dvb_usbv2_adapter_frontend_exit(&d->adapter[i]);
287 +                       dvb_usbv2_mediatree_adapter_dvb_exit(&d->adapter[i]);
288 +                       dvb_usbv2_mediatree_adapter_stream_exit(&d->adapter[i]);
289 +                       dvb_usbv2_mediatree_adapter_frontend_exit(&d->adapter[i]);
290                 }
291         }
292  
293 @@ -790,25 +790,25 @@
294  }
295  
296  /* general initialization functions */
297 -static int dvb_usbv2_exit(struct dvb_usb_device *d)
298 +static int dvb_usbv2_mediatree_exit(struct dvb_usb_device *d)
299  {
300         dev_dbg(&d->udev->dev, "%s:\n", __func__);
301  
302 -       dvb_usbv2_remote_exit(d);
303 -       dvb_usbv2_adapter_exit(d);
304 -       dvb_usbv2_i2c_exit(d);
305 +       dvb_usbv2_mediatree_remote_exit(d);
306 +       dvb_usbv2_mediatree_adapter_exit(d);
307 +       dvb_usbv2_mediatree_i2c_exit(d);
308         kfree(d->priv);
309         kfree(d);
310  
311         return 0;
312  }
313  
314 -static int dvb_usbv2_init(struct dvb_usb_device *d)
315 +static int dvb_usbv2_mediatree_init(struct dvb_usb_device *d)
316  {
317         int ret;
318         dev_dbg(&d->udev->dev, "%s:\n", __func__);
319  
320 -       dvb_usbv2_device_power_ctrl(d, 1);
321 +       dvb_usbv2_mediatree_device_power_ctrl(d, 1);
322  
323         if (d->props->read_config) {
324                 ret = d->props->read_config(d);
325 @@ -816,11 +816,11 @@
326                         goto err;
327         }
328  
329 -       ret = dvb_usbv2_i2c_init(d);
330 +       ret = dvb_usbv2_mediatree_i2c_init(d);
331         if (ret < 0)
332                 goto err;
333  
334 -       ret = dvb_usbv2_adapter_init(d);
335 +       ret = dvb_usbv2_mediatree_adapter_init(d);
336         if (ret < 0)
337                 goto err;
338  
339 @@ -830,20 +830,20 @@
340                         goto err;
341         }
342  
343 -       ret = dvb_usbv2_remote_init(d);
344 +       ret = dvb_usbv2_mediatree_remote_init(d);
345         if (ret < 0)
346                 goto err;
347  
348 -       dvb_usbv2_device_power_ctrl(d, 0);
349 +       dvb_usbv2_mediatree_device_power_ctrl(d, 0);
350  
351         return 0;
352  err:
353 -       dvb_usbv2_device_power_ctrl(d, 0);
354 +       dvb_usbv2_mediatree_device_power_ctrl(d, 0);
355         dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
356         return ret;
357  }
358  
359 -int dvb_usbv2_probe(struct usb_interface *intf,
360 +int dvb_usbv2_mediatree_probe(struct usb_interface *intf,
361                 const struct usb_device_id *id)
362  {
363         int ret;
364 @@ -905,7 +905,7 @@
365                         if (!name)
366                                 name = d->props->firmware;
367  
368 -                       ret = dvb_usbv2_download_firmware(d, name);
369 +                       ret = dvb_usbv2_mediatree_download_firmware(d, name);
370                         if (ret == 0) {
371                                 /* device is warm, continue initialization */
372                                 ;
373 @@ -930,7 +930,7 @@
374         dev_info(&d->udev->dev, "%s: found a '%s' in warm state\n",
375                         KBUILD_MODNAME, d->name);
376  
377 -       ret = dvb_usbv2_init(d);
378 +       ret = dvb_usbv2_mediatree_init(d);
379         if (ret < 0)
380                 goto err_free_all;
381  
382 @@ -942,14 +942,14 @@
383  
384         return 0;
385  err_free_all:
386 -       dvb_usbv2_exit(d);
387 +       dvb_usbv2_mediatree_exit(d);
388  err:
389         dev_dbg(&udev->dev, "%s: failed=%d\n", __func__, ret);
390         return ret;
391  }
392 -EXPORT_SYMBOL(dvb_usbv2_probe);
393 +EXPORT_SYMBOL(dvb_usbv2_mediatree_probe);
394  
395 -void dvb_usbv2_disconnect(struct usb_interface *intf)
396 +void dvb_usbv2_mediatree_disconnect(struct usb_interface *intf)
397  {
398         struct dvb_usb_device *d = usb_get_intfdata(intf);
399         const char *name = d->name;
400 @@ -960,14 +960,14 @@
401         if (d->props->exit)
402                 d->props->exit(d);
403  
404 -       dvb_usbv2_exit(d);
405 +       dvb_usbv2_mediatree_exit(d);
406  
407         dev_info(&dev, "%s: '%s' successfully deinitialized and disconnected\n",
408                         KBUILD_MODNAME, name);
409  }
410 -EXPORT_SYMBOL(dvb_usbv2_disconnect);
411 +EXPORT_SYMBOL(dvb_usbv2_mediatree_disconnect);
412  
413 -int dvb_usbv2_suspend(struct usb_interface *intf, pm_message_t msg)
414 +int dvb_usbv2_mediatree_suspend(struct usb_interface *intf, pm_message_t msg)
415  {
416         struct dvb_usb_device *d = usb_get_intfdata(intf);
417         int ret = 0, i, active_fe;
418 @@ -996,9 +996,9 @@
419  
420         return ret;
421  }
422 -EXPORT_SYMBOL(dvb_usbv2_suspend);
423 +EXPORT_SYMBOL(dvb_usbv2_mediatree_suspend);
424  
425 -static int dvb_usbv2_resume_common(struct dvb_usb_device *d)
426 +static int dvb_usbv2_mediatree_resume_common(struct dvb_usb_device *d)
427  {
428         int ret = 0, i, active_fe;
429         struct dvb_frontend *fe;
430 @@ -1029,33 +1029,33 @@
431         return ret;
432  }
433  
434 -int dvb_usbv2_resume(struct usb_interface *intf)
435 +int dvb_usbv2_mediatree_resume(struct usb_interface *intf)
436  {
437         struct dvb_usb_device *d = usb_get_intfdata(intf);
438         dev_dbg(&d->udev->dev, "%s:\n", __func__);
439  
440 -       return dvb_usbv2_resume_common(d);
441 +       return dvb_usbv2_mediatree_resume_common(d);
442  }
443 -EXPORT_SYMBOL(dvb_usbv2_resume);
444 +EXPORT_SYMBOL(dvb_usbv2_mediatree_resume);
445  
446 -int dvb_usbv2_reset_resume(struct usb_interface *intf)
447 +int dvb_usbv2_mediatree_reset_resume(struct usb_interface *intf)
448  {
449         struct dvb_usb_device *d = usb_get_intfdata(intf);
450         int ret;
451         dev_dbg(&d->udev->dev, "%s:\n", __func__);
452  
453 -       dvb_usbv2_device_power_ctrl(d, 1);
454 +       dvb_usbv2_mediatree_device_power_ctrl(d, 1);
455  
456         if (d->props->init)
457                 d->props->init(d);
458  
459 -       ret = dvb_usbv2_resume_common(d);
460 +       ret = dvb_usbv2_mediatree_resume_common(d);
461  
462 -       dvb_usbv2_device_power_ctrl(d, 0);
463 +       dvb_usbv2_mediatree_device_power_ctrl(d, 0);
464  
465         return ret;
466  }
467 -EXPORT_SYMBOL(dvb_usbv2_reset_resume);
468 +EXPORT_SYMBOL(dvb_usbv2_mediatree_reset_resume);
469  
470  MODULE_VERSION("2.0");
471  MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
472 diff -Naur media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb.h media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb.h
473 --- media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb.h    2014-09-26 11:57:42.000000000 +0200
474 +++ media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb.h 2017-07-06 15:11:20.500125396 +0200
475 @@ -391,19 +391,19 @@
476         void *priv;
477  };
478  
479 -extern int dvb_usbv2_probe(struct usb_interface *,
480 +extern int dvb_usbv2_mediatree_probe(struct usb_interface *,
481                 const struct usb_device_id *);
482 -extern void dvb_usbv2_disconnect(struct usb_interface *);
483 -extern int dvb_usbv2_suspend(struct usb_interface *, pm_message_t);
484 -extern int dvb_usbv2_resume(struct usb_interface *);
485 -extern int dvb_usbv2_reset_resume(struct usb_interface *);
486 +extern void dvb_usbv2_mediatree_disconnect(struct usb_interface *);
487 +extern int dvb_usbv2_mediatree_suspend(struct usb_interface *, pm_message_t);
488 +extern int dvb_usbv2_mediatree_resume(struct usb_interface *);
489 +extern int dvb_usbv2_mediatree_reset_resume(struct usb_interface *);
490  
491  /* the generic read/write method for device control */
492 -extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16);
493 -extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16);
494 +extern int dvb_usbv2_mediatree_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16);
495 +extern int dvb_usbv2_mediatree_generic_write(struct dvb_usb_device *, u8 *, u16);
496  /* caller must hold lock when locked versions are called */
497 -extern int dvb_usbv2_generic_rw_locked(struct dvb_usb_device *,
498 +extern int dvb_usbv2_mediatree_generic_rw_locked(struct dvb_usb_device *,
499                 u8 *, u16, u8 *, u16);
500 -extern int dvb_usbv2_generic_write_locked(struct dvb_usb_device *, u8 *, u16);
501 +extern int dvb_usbv2_mediatree_generic_write_locked(struct dvb_usb_device *, u8 *, u16);
502  
503  #endif
504 diff -Naur media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c
505 --- media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c        2014-09-03 05:45:14.000000000 +0200
506 +++ media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c     2017-07-06 15:12:26.776125697 +0200
507 @@ -65,7 +65,7 @@
508         return ret;
509  }
510  
511 -int dvb_usbv2_generic_rw(struct dvb_usb_device *d,
512 +int dvb_usbv2_mediatree_generic_rw(struct dvb_usb_device *d,
513                 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
514  {
515         int ret;
516 @@ -76,9 +76,9 @@
517  
518         return ret;
519  }
520 -EXPORT_SYMBOL(dvb_usbv2_generic_rw);
521 +EXPORT_SYMBOL(dvb_usbv2_mediatree_generic_rw);
522  
523 -int dvb_usbv2_generic_write(struct dvb_usb_device *d, u8 *buf, u16 len)
524 +int dvb_usbv2_mediatree_generic_write(struct dvb_usb_device *d, u8 *buf, u16 len)
525  {
526         int ret;
527  
528 @@ -88,17 +88,17 @@
529  
530         return ret;
531  }
532 -EXPORT_SYMBOL(dvb_usbv2_generic_write);
533 +EXPORT_SYMBOL(dvb_usbv2_mediatree_generic_write);
534  
535 -int dvb_usbv2_generic_rw_locked(struct dvb_usb_device *d,
536 +int dvb_usbv2_mediatree_generic_rw_locked(struct dvb_usb_device *d,
537                 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
538  {
539         return dvb_usb_v2_generic_io(d, wbuf, wlen, rbuf, rlen);
540  }
541 -EXPORT_SYMBOL(dvb_usbv2_generic_rw_locked);
542 +EXPORT_SYMBOL(dvb_usbv2_mediatree_generic_rw_locked);
543  
544 -int dvb_usbv2_generic_write_locked(struct dvb_usb_device *d, u8 *buf, u16 len)
545 +int dvb_usbv2_mediatree_generic_write_locked(struct dvb_usb_device *d, u8 *buf, u16 len)
546  {
547         return dvb_usb_v2_generic_io(d, buf, len, NULL, 0);
548  }
549 -EXPORT_SYMBOL(dvb_usbv2_generic_write_locked);
550 +EXPORT_SYMBOL(dvb_usbv2_mediatree_generic_write_locked);
551 diff -Naur media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/Makefile media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/Makefile
552 --- media_build-bst-160430.orig/linux/drivers/media/usb/dvb-usb-v2/Makefile     2014-09-26 11:57:42.000000000 +0200
553 +++ media_build-bst-160430/linux/drivers/media/usb/dvb-usb-v2/Makefile  2017-07-06 14:55:22.353096069 +0200
554 @@ -1,5 +1,5 @@
555 -dvb_usb_v2-objs := dvb_usb_core.o dvb_usb_urb.o usb_urb.o
556 -obj-$(CONFIG_DVB_USB_V2) += dvb_usb_v2.o
557 +dvb_usb_v2_media_tree-objs := dvb_usb_core.o dvb_usb_urb.o usb_urb.o
558 +obj-$(CONFIG_DVB_USB_V2) += dvb_usb_v2_media_tree.o
559  
560  dvb-usb-af9015-objs := af9015.o
561  obj-$(CONFIG_DVB_USB_AF9015) += dvb-usb-af9015.o
562 diff -Naur media_build-bst-160430.orig/v4l/Makefile media_build-bst-160430/v4l/Makefile
563 --- media_build-bst-160430.orig/v4l/Makefile    2015-02-11 04:31:06.000000000 +0100
564 +++ media_build-bst-160430/v4l/Makefile 2017-07-06 15:14:10.452126168 +0200
565 @@ -202,7 +202,7 @@
566  #################################################
567  # installation invocation rules
568  
569 -modules_install install:: media-install firmware_install
570 +modules_install install:: media-install
571  
572  remove rminstall:: media-rminstall
573  
574 diff -Naur media_build-bst-160430.orig/v4l/scripts/make_makefile.pl media_build-bst-160430/v4l/scripts/make_makefile.pl
575 --- media_build-bst-160430.orig/v4l/scripts/make_makefile.pl    2014-12-19 04:07:10.000000000 +0100
576 +++ media_build-bst-160430/v4l/scripts/make_makefile.pl 2017-07-06 15:22:45.025441093 +0200
577 @@ -253,11 +253,11 @@
578         print OUT "echo -n \"\$\$i \"; ";
579         print OUT "install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; ";
580         print OUT "if [  \$\$n -ne 0 ]; then echo; ";
581 -       print OUT "strip --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; ";
582 +       print OUT "\$(CROSS_COMPILE)strip --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; ";
583         print OUT "fi;\n\n";
584  }
585  print OUT "\t@echo\n";
586 -print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n";
587 +
588  
589  # Creating Remove rule
590  print OUT "media-rminstall::\n";