~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to drivers/media/dvb/dvb-usb/dib0700_core.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        int ret;
32
32
 
33
33
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
34
 
                deb_info("could not acquire lock");
 
34
                err("could not acquire lock");
35
35
                return 0;
36
36
        }
37
37
 
117
117
        int ret;
118
118
 
119
119
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
120
 
                deb_info("could not acquire lock");
 
120
                err("could not acquire lock");
121
121
                return 0;
122
122
        }
123
123
 
138
138
 
139
139
        if (st->fw_version >= 0x10201) {
140
140
                if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
141
 
                        deb_info("could not acquire lock");
 
141
                        err("could not acquire lock");
142
142
                        return 0;
143
143
                }
144
144
 
227
227
                } else {
228
228
                        /* Write request */
229
229
                        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
230
 
                                deb_info("could not acquire lock");
 
230
                                err("could not acquire lock");
231
231
                                return 0;
232
232
                        }
233
233
                        st->buf[0] = REQUEST_NEW_I2C_WRITE;
273
273
        if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
274
274
                return -EAGAIN;
275
275
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
276
 
                deb_info("could not acquire lock");
 
276
                err("could not acquire lock");
277
277
                return 0;
278
278
        }
279
279
 
368
368
        int ret;
369
369
 
370
370
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
371
 
                deb_info("could not acquire lock");
 
371
                err("could not acquire lock");
372
372
                return 0;
373
373
        }
374
374
 
400
400
                return -EINVAL;
401
401
 
402
402
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
403
 
                deb_info("could not acquire lock");
 
403
                err("could not acquire lock");
404
404
                return 0;
405
405
        }
406
406
 
528
528
                for (adap_num = 0; adap_num < dib0700_devices[i].num_adapters;
529
529
                                adap_num++) {
530
530
                        if (fw_version >= 0x10201) {
531
 
                                dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 188*nb_packet_buffer_size;
 
531
                                dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = 188*nb_packet_buffer_size;
532
532
                        } else {
533
533
                                /* for fw version older than 1.20.1,
534
534
                                 * the buffersize has to be n times 512 */
535
 
                                dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = ((188*nb_packet_buffer_size+188/2)/512)*512;
536
 
                                if (dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize < 512)
537
 
                                        dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 512;
 
535
                                dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = ((188*nb_packet_buffer_size+188/2)/512)*512;
 
536
                                if (dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize < 512)
 
537
                                        dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = 512;
538
538
                        }
539
539
                }
540
540
        }
560
560
        }
561
561
 
562
562
        if (mutex_lock_interruptible(&adap->dev->usb_mutex) < 0) {
563
 
                deb_info("could not acquire lock");
 
563
                err("could not acquire lock");
564
564
                return 0;
565
565
        }
566
566
 
579
579
        deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id);
580
580
 
581
581
        st->channel_state &= ~0x3;
582
 
        if ((adap->stream.props.endpoint != 2)
583
 
                        && (adap->stream.props.endpoint != 3)) {
584
 
                deb_info("the endpoint number (%i) is not correct, use the adapter id instead", adap->stream.props.endpoint);
 
582
        if ((adap->fe_adap[0].stream.props.endpoint != 2)
 
583
                        && (adap->fe_adap[0].stream.props.endpoint != 3)) {
 
584
                deb_info("the endpoint number (%i) is not correct, use the adapter id instead", adap->fe_adap[0].stream.props.endpoint);
585
585
                if (onoff)
586
586
                        st->channel_state |=    1 << (adap->id);
587
587
                else
588
588
                        st->channel_state |=    1 << ~(adap->id);
589
589
        } else {
590
590
                if (onoff)
591
 
                        st->channel_state |=    1 << (adap->stream.props.endpoint-2);
 
591
                        st->channel_state |=    1 << (adap->fe_adap[0].stream.props.endpoint-2);
592
592
                else
593
 
                        st->channel_state |=    1 << (3-adap->stream.props.endpoint);
 
593
                        st->channel_state |=    1 << (3-adap->fe_adap[0].stream.props.endpoint);
594
594
        }
595
595
 
596
596
        st->buf[2] |= st->channel_state;
610
610
        int new_proto, ret;
611
611
 
612
612
        if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
613
 
                deb_info("could not acquire lock");
 
613
                err("could not acquire lock");
614
614
                return 0;
615
615
        }
616
616