]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 19:13:00 +0000 (12:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 19:13:00 +0000 (12:13 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (841 commits)
  Staging: brcm80211: fix usage of roundup in structures
  Staging: bcm: fix up network device reference counting
  Staging: keucr: fix up US_ macro change
  staging: brcm80211: brcmfmac: Removed codeversion from firmware filenames.
  staging: brcm80211: Remove unnecessary header files.
  staging: brcm80211: Remove unnecessary includes from bcmutils.c
  staging: brcm80211: Removed unnecessary pktsetprio() function.
  Staging: brcm80211: remove typedefs.h
  Staging: brcm80211: remove uintptr typedef usage
  Staging: hv: remove struct vmbus_channel_interface
  Staging: hv: remove Open from struct vmbus_channel_interface
  Staging: hv: storvsc: call vmbus_open directly
  Staging: hv: netvsc: call vmbus_open directly
  Staging: hv: channel: export vmbus_open to modules
  Staging: hv: remove Close from struct vmbus_channel_interface
  Staging: hv: netvsc: call vmbus_close directly
  Staging: hv: storvsc: call vmbus_close directly
  Staging: hv: channel: export vmbus_close to modules
  Staging: hv: remove SendPacket from struct vmbus_channel_interface
  Staging: hv: storvsc: call vmbus_sendpacket directly
  ...

Fix up conflicts in
drivers/staging/cx25821/cx25821-audio-upstream.c
drivers/staging/cx25821/cx25821-audio.h
due to warring whitespace cleanups (neither of which were all that great)

1  2 
Documentation/ioctl/ioctl-number.txt
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/cx25821/cx25821-audio-upstream.c
drivers/staging/cx25821/cx25821-audio.h
drivers/staging/cx25821/cx25821-core.c
drivers/staging/lirc/lirc_parallel.c
drivers/staging/lirc/lirc_zilog.c
drivers/staging/tm6000/tm6000-alsa.c
drivers/staging/tm6000/tm6000-core.c
include/linux/Kbuild

index 10f5af8b73f71c76b7b7f495296b0640b6affa73,d15834a6e461906f7d0274a33ed6ff7f6ab77aa1..63ffd78824d8f63ce7c6d1d38fccf9d7b8f9720b
@@@ -259,7 -259,7 +259,7 @@@ Code  Seq#(hex)    Include File            Comment
  't'   00-7F   linux/if_ppp.h
  't'   80-8F   linux/isdn_ppp.h
  't'   90      linux/toshiba.h
- 'u'   00-1F   linux/smb_fs.h
+ 'u'   00-1F   linux/smb_fs.h          gone
  'v'   all     linux/videodev.h        conflict!
  'v'   00-1F   linux/ext2_fs.h         conflict!
  'v'   00-1F   linux/fs.h              conflict!
                                        <mailto:oe@port.de>
  'z'   10-4F   drivers/s390/crypto/zcrypt_api.h        conflict!
  0x80  00-1F   linux/fb.h
 -0x81  00-1F   linux/videotext.h
  0x88  00-3F   media/ovcamchip.h
  0x89  00-06   arch/x86/include/asm/sockios.h
  0x89  0B-DF   linux/sockios.h
diff --combined drivers/staging/Kconfig
index 2ea91e04925577e1e336f1f478e1672c6863e9d1,7069eb66f888c7470be91e2604d38b9f9b74428e..f9c9c8a397db10ab028fca13ef8be45ceb09be51
@@@ -51,10 -51,6 +51,10 @@@ source "drivers/staging/cx25821/Kconfig
  
  source "drivers/staging/tm6000/Kconfig"
  
 +source "drivers/staging/cpia/Kconfig"
 +
 +source "drivers/staging/stradis/Kconfig"
 +
  source "drivers/staging/usbip/Kconfig"
  
  source "drivers/staging/winbond/Kconfig"
@@@ -63,7 -59,7 +63,7 @@@ source "drivers/staging/wlan-ng/Kconfig
  
  source "drivers/staging/echo/Kconfig"
  
- source "drivers/staging/otus/Kconfig"
+ source "drivers/staging/brcm80211/Kconfig"
  
  source "drivers/staging/rt2860/Kconfig"
  
@@@ -71,24 -67,28 +71,28 @@@ source "drivers/staging/rt2870/Kconfig
  
  source "drivers/staging/comedi/Kconfig"
  
+ source "drivers/staging/olpc_dcon/Kconfig"
  source "drivers/staging/asus_oled/Kconfig"
  
  source "drivers/staging/panel/Kconfig"
  
  source "drivers/staging/rtl8187se/Kconfig"
  
- source "drivers/staging/rtl8192su/Kconfig"
  source "drivers/staging/rtl8192u/Kconfig"
  
  source "drivers/staging/rtl8192e/Kconfig"
  
+ source "drivers/staging/rtl8712/Kconfig"
  source "drivers/staging/frontier/Kconfig"
  
  source "drivers/staging/dream/Kconfig"
  
  source "drivers/staging/pohmelfs/Kconfig"
  
+ source "drivers/staging/autofs/Kconfig"
  source "drivers/staging/phison/Kconfig"
  
  source "drivers/staging/line6/Kconfig"
@@@ -147,6 -147,8 +151,8 @@@ source "drivers/staging/msm/Kconfig
  
  source "drivers/staging/lirc/Kconfig"
  
+ source "drivers/staging/smbfs/Kconfig"
  source "drivers/staging/easycap/Kconfig"
  
  source "drivers/staging/solo6x10/Kconfig"
@@@ -155,5 -157,21 +161,21 @@@ source "drivers/staging/tidspbridge/Kco
  
  source "drivers/staging/quickstart/Kconfig"
  
+ source "drivers/staging/westbridge/Kconfig"
+ source "drivers/staging/sbe-2t3e3/Kconfig"
+ source "drivers/staging/ath6kl/Kconfig"
+ source "drivers/staging/keucr/Kconfig"
+ source "drivers/staging/bcm/Kconfig"
+ source "drivers/staging/ft1000/Kconfig"
+ source "drivers/staging/intel_sst/Kconfig"
+ source "drivers/staging/speakup/Kconfig"
  endif # !STAGING_EXCLUDE_BUILD
  endif # STAGING
diff --combined drivers/staging/Makefile
index c359fbb0e04a5a5b763180c67bfb5bbfad1b1bfa,97d58b64381f5741547e9d9995e86c882fbb8085..a85074f8321b436e7cc255d60e2c0dc26a8d701c
@@@ -8,30 -8,31 +8,33 @@@ obj-$(CONFIG_SLICOSS)         += slicoss
  obj-$(CONFIG_VIDEO_GO7007)    += go7007/
  obj-$(CONFIG_VIDEO_CX25821)   += cx25821/
  obj-$(CONFIG_VIDEO_TM6000)    += tm6000/
 +obj-$(CONFIG_VIDEO_CPIA)      += cpia/
 +obj-$(CONFIG_VIDEO_STRADIS)   += stradis/
  obj-$(CONFIG_LIRC_STAGING)    += lirc/
  obj-$(CONFIG_USB_IP_COMMON)   += usbip/
  obj-$(CONFIG_W35UND)          += winbond/
  obj-$(CONFIG_PRISM2_USB)      += wlan-ng/
  obj-$(CONFIG_ECHO)            += echo/
- obj-$(CONFIG_OTUS)            += otus/
+ obj-$(CONFIG_BRCM80211)               += brcm80211/
  obj-$(CONFIG_RT2860)          += rt2860/
  obj-$(CONFIG_RT2870)          += rt2870/
  obj-$(CONFIG_COMEDI)          += comedi/
+ obj-$(CONFIG_FB_OLPC_DCON)    += olpc_dcon/
  obj-$(CONFIG_ASUS_OLED)               += asus_oled/
  obj-$(CONFIG_PANEL)           += panel/
  obj-$(CONFIG_R8187SE)         += rtl8187se/
- obj-$(CONFIG_RTL8192SU)               += rtl8192su/
  obj-$(CONFIG_RTL8192U)                += rtl8192u/
  obj-$(CONFIG_RTL8192E)                += rtl8192e/
+ obj-$(CONFIG_R8712U)          += rtl8712/
  obj-$(CONFIG_SPECTRA)         += spectra/
  obj-$(CONFIG_TRANZPORT)               += frontier/
  obj-$(CONFIG_DREAM)           += dream/
  obj-$(CONFIG_POHMELFS)                += pohmelfs/
+ obj-$(CONFIG_AUTOFS_FS)               += autofs/
  obj-$(CONFIG_IDE_PHISON)      += phison/
  obj-$(CONFIG_LINE6_USB)               += line6/
  obj-$(CONFIG_USB_SERIAL_QUATECH2)     += serqt_usb2/
+ obj-$(CONFIG_SMB_FS)          += smbfs/
  obj-$(CONFIG_USB_SERIAL_QUATECH_USB2) += quatech_usb2/
  obj-$(CONFIG_OCTEON_ETHERNET) += octeon/
  obj-$(CONFIG_VT6655)          += vt6655/
@@@ -58,3 -59,11 +61,11 @@@ obj-$(CONFIG_EASYCAP)               += easycap
  obj-$(CONFIG_SOLO6X10)                += solo6x10/
  obj-$(CONFIG_TIDSPBRIDGE)     += tidspbridge/
  obj-$(CONFIG_ACPI_QUICKSTART) += quickstart/
+ obj-$(CONFIG_WESTBRIDGE_ASTORIA)      += westbridge/astoria/
+ obj-$(CONFIG_SBE_2T3E3)       += sbe-2t3e3/
+ obj-$(CONFIG_ATH6K_LEGACY)    += ath6kl/
+ obj-$(CONFIG_USB_ENESTORAGE)  += keucr/
+ obj-$(CONFIG_BCM_WIMAX)       += bcm/
+ obj-$(CONFIG_FT1000)          += ft1000/
+ obj-$(CONFIG_SND_INTEL_SST)           += intel_sst/
+ obj-$(CONFIG_SPEAKUP) += speakup/
index 6f3200666c9325c20856705f05490d07c1d81617,27087dbe5b7d98dcb86a7975dd5e96d072b7bf47..1607b0d86e6f8d2dae2cb84a71b53b65167ab984
@@@ -39,9 -39,8 +39,8 @@@ MODULE_DESCRIPTION("v4l2 driver module 
  MODULE_AUTHOR("Hiep Huynh <hiep.huynh@conexant.com>");
  MODULE_LICENSE("GPL");
  
--static int _intr_msk =
-       FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF | FLD_AUD_SRC_SYNC |
-       FLD_AUD_SRC_OPC_ERR;
 -FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF | FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR;
++static int _intr_msk = FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF |
++                      FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR;
  
  int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev,
                                              struct sram_channel *ch,
@@@ -608,8 -607,8 +607,7 @@@ static irqreturn_t cx25821_upstream_irq
        if (!dev)
                return -1;
  
--      sram_ch = dev->channels[dev->_audio_upstream_channel_select].
-                                      sram_channels;
 -                                      sram_channels;
++      sram_ch = dev->channels[dev->_audio_upstream_channel_select].sram_channels;
  
        msk_stat = cx_read(sram_ch->int_mstat);
        audio_status = cx_read(sram_ch->int_stat);
@@@ -766,6 -765,7 +764,6 @@@ int cx25821_audio_upstream_init(struct 
                /* Default if filename is empty string */
                if (strcmp(dev->input_audiofilename, "") == 0)
                        dev->_audiofilename = "/root/audioGOOD.wav";
 -
        } else {
                str_length = strlen(_defaultAudioName);
                dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
index a702a0db21d3271d080d5671b3294828285a7a5a,aa5725b093283bece1bc03556fc8039e1751ccbe..27717253227dab838d6884677a2d986b7f53618d
  #define NUMBER_OF_PROGRAMS  8
  
  /*
 -* Max size of the RISC program for a buffer. - worst case is 2 writes per line
 -* Space is also added for the 4 no-op instructions added on the end.
 -*/
 + * Max size of the RISC program for a buffer. - worst case is 2 writes per line
 + * Space is also added for the 4 no-op instructions added on the end.
 + */
  #ifndef USE_RISC_NOOP
 -#define MAX_BUFFER_PROGRAM_SIZE               \
 -(2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE +     \
 -                      RISC_WRITECR_INSTRUCTION_SIZE*4)
 -
 +#define MAX_BUFFER_PROGRAM_SIZE     \
 +      (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE*4)
  #endif
  
  /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
  #ifdef USE_RISC_NOOP
  #define MAX_BUFFER_PROGRAM_SIZE     \
 -(2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4l)
 -
 +      (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4)
  #endif
  
  /* Sizes of various instructions in bytes.  Used when adding instructions. */
@@@ -53,6 -56,7 +53,7 @@@
  #define RISC_WRITECR_INSTRUCTION_SIZE  16
  #define RISC_NOOP_INSTRUCTION_SIZE 4
  
- #define MAX_AUDIO_DMA_BUFFER_SIZE (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + RISC_SYNC_INSTRUCTION_SIZE)
+ #define MAX_AUDIO_DMA_BUFFER_SIZE     \
+ (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + RISC_SYNC_INSTRUCTION_SIZE)
  
  #endif
index ca1eece3df0df93cb031bcf9a6a4adf101ee66c4,ad7ce013ba50cba5e8fc81f96849408977c5d90b..300da319b0650d1b6dcc74eff20c7d4f129f0f2b
@@@ -42,7 -42,7 +42,7 @@@ static unsigned int card[] = {[0 ... (C
  module_param_array(card, int, NULL, 0444);
  MODULE_PARM_DESC(card, "card type");
  
 -static unsigned int cx25821_devcount = 0;
 +static unsigned int cx25821_devcount;
  
  static DEFINE_MUTEX(devlist);
  LIST_HEAD(cx25821_devlist);
@@@ -781,14 -781,14 +781,14 @@@ static void cx25821_shutdown(struct cx2
  
        /* Disable Video A/B activity */
        for (i = 0; i < VID_CHANNEL_NUM; i++) {
 -             cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
 -             cx_write(dev->channels[i].sram_channels->int_msk, 0);
 +              cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
 +              cx_write(dev->channels[i].sram_channels->int_msk, 0);
        }
  
 -      for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
 -           i++) {
 -             cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
 -             cx_write(dev->channels[i].sram_channels->int_msk, 0);
 +      for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
 +              i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
 +              cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
 +              cx_write(dev->channels[i].sram_channels->int_msk, 0);
        }
  
        /* Disable Audio activity */
@@@ -806,9 -806,9 +806,9 @@@ void cx25821_set_pixel_format(struct cx
                              u32 format)
  {
        if (channel_select <= 7 && channel_select >= 0) {
 -             cx_write(dev->channels[channel_select].
 -                             sram_channels->pix_frmt, format);
 -             dev->channels[channel_select].pixel_formats = format;
 +              cx_write(dev->channels[channel_select].
 +                      sram_channels->pix_frmt, format);
 +              dev->channels[channel_select].pixel_formats = format;
        }
  }
  
@@@ -829,7 -829,7 +829,7 @@@ static void cx25821_initialize(struct c
        cx_write(PCI_INT_STAT, 0xffffffff);
  
        for (i = 0; i < VID_CHANNEL_NUM; i++)
 -             cx_write(dev->channels[i].sram_channels->int_stat, 0xffffffff);
 +              cx_write(dev->channels[i].sram_channels->int_stat, 0xffffffff);
  
        cx_write(AUD_A_INT_STAT, 0xffffffff);
        cx_write(AUD_B_INT_STAT, 0xffffffff);
        mdelay(100);
  
        for (i = 0; i < VID_CHANNEL_NUM; i++) {
 -             cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
 -             cx25821_sram_channel_setup(dev, dev->channels[i].sram_channels,
 -                                             1440, 0);
 -             dev->channels[i].pixel_formats = PIXEL_FRMT_422;
 -             dev->channels[i].use_cif_resolution = FALSE;
 +              cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
 +              cx25821_sram_channel_setup(dev, dev->channels[i].sram_channels,
 +                                              1440, 0);
 +              dev->channels[i].pixel_formats = PIXEL_FRMT_422;
 +              dev->channels[i].use_cif_resolution = FALSE;
        }
  
        /* Probably only affect Downstream */
 -      for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
 -           i++) {
 -             cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
 +      for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
 +              i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
 +              cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
        }
  
 -       cx25821_sram_channel_setup_audio(dev,
 -                             dev->channels[SRAM_CH08].sram_channels,
 -                             128, 0);
 +      cx25821_sram_channel_setup_audio(dev,
 +                              dev->channels[SRAM_CH08].sram_channels,
 +                              128, 0);
  
        cx25821_gpio_init(dev);
  }
@@@ -931,8 -931,8 +931,8 @@@ static int cx25821_dev_setup(struct cx2
  
        /* Apply a sensible clock frequency for the PCIe bridge */
        dev->clk_freq = 28000000;
 -       for (i = 0; i < MAX_VID_CHANNEL_NUM; i++)
 -             dev->channels[i].sram_channels = &cx25821_sram_channels[i];
 +      for (i = 0; i < MAX_VID_CHANNEL_NUM; i++)
 +              dev->channels[i].sram_channels = &cx25821_sram_channels[i];
  
        if (dev->nr > 1)
                CX25821_INFO("dev->nr > 1!");
                       dev->pci->subsystem_device);
  
                cx25821_devcount--;
-               return -ENODEV;
+               return -EBUSY;
        }
  
        /* PCIe stuff */
  
        cx25821_card_setup(dev);
  
 -       if (medusa_video_init(dev) < 0)
 -             CX25821_ERR("%s() Failed to initialize medusa!\n"
 -             , __func__);
 +      if (medusa_video_init(dev) < 0)
 +              CX25821_ERR("%s() Failed to initialize medusa!\n"
 +              , __func__);
  
 -       cx25821_video_register(dev);
 +      cx25821_video_register(dev);
  
        /* register IOCTL device */
        dev->ioctl_dev =
@@@ -1319,7 -1319,7 +1319,7 @@@ void cx25821_free_buffer(struct videobu
        struct videobuf_dmabuf *dma = videobuf_to_dma(&buf->vb);
  
        BUG_ON(in_interrupt());
 -      videobuf_waiton(&buf->vb, 0, 0);
 +      videobuf_waiton(q, &buf->vb, 0, 0);
        videobuf_dma_unmap(q->dev, dma);
        videobuf_dma_free(dma);
        btcx_riscmem_free(to_pci_dev(q->dev), &buf->risc);
@@@ -1342,12 -1342,12 +1342,12 @@@ static irqreturn_t cx25821_irq(int irq
  
        for (i = 0; i < VID_CHANNEL_NUM; i++) {
                if (pci_status & mask[i]) {
 -                     vid_status = cx_read(dev->channels[i].
 -                             sram_channels->int_stat);
 +                      vid_status = cx_read(dev->channels[i].
 +                              sram_channels->int_stat);
  
                        if (vid_status)
                                handled +=
 -                                  cx25821_video_irq(dev, i, vid_status);
 +                              cx25821_video_irq(dev, i, vid_status);
  
                        cx_write(PCI_INT_STAT, mask[i]);
                }
@@@ -1412,9 -1412,12 +1412,12 @@@ static int __devinit cx25821_initdev(st
  
        printk(KERN_INFO "cx25821 Athena pci enable !\n");
  
-       if (cx25821_dev_setup(dev) < 0) {
-               err = -EINVAL;
-               goto fail_unregister_device;
+       err = cx25821_dev_setup(dev);
+       if (err) {
+               if (err == -EBUSY)
+                       goto fail_unregister_device;
+               else
+                       goto fail_unregister_pci;
        }
  
        /* print pci info */
@@@ -1448,6 -1451,8 +1451,8 @@@ fail_irq
        printk(KERN_INFO "cx25821 cx25821_initdev() can't get IRQ !\n");
        cx25821_dev_unregister(dev);
  
+ fail_unregister_pci:
+       pci_disable_device(pci_dev);
  fail_unregister_device:
        v4l2_device_unregister(&dev->v4l2_dev);
  
index 884904c782d1fd8e8883a8e816b3dd3595f24815,0c831f5858b527e4d653fd31ecbb1e9df9a4ae9b..dfd2c447e67d38aca01dfc833ee23ab6f1e77486
  
  /*** Includes ***/
  
 -#ifdef CONFIG_SMP
 -#error "--- Sorry, this driver is not SMP safe. ---"
 -#endif
 -
  #include <linux/module.h>
  #include <linux/sched.h>
  #include <linux/errno.h>
@@@ -36,7 -40,6 +36,6 @@@
  #include <linux/delay.h>
  
  #include <linux/io.h>
- #include <linux/signal.h>
  #include <linux/irq.h>
  #include <linux/uaccess.h>
  #include <asm/div64.h>
@@@ -297,9 -300,9 +296,9 @@@ static void irq_handler(void *blah
  
        if (signal != 0) {
                /* ajust value to usecs */
 -              unsigned long long helper;
 +              __u64 helper;
  
 -              helper = ((unsigned long long) signal)*1000000;
 +              helper = ((__u64) signal)*1000000;
                do_div(helper, timer);
                signal = (long) helper;
  
@@@ -400,9 -403,9 +399,9 @@@ static ssize_t lirc_write(struct file *
  
        /* adjust values from usecs */
        for (i = 0; i < count; i++) {
 -              unsigned long long helper;
 +              __u64 helper;
  
 -              helper = ((unsigned long long) wbuf[i])*timer;
 +              helper = ((__u64) wbuf[i])*timer;
                do_div(helper, 1000000);
                wbuf[i] = (int) helper;
        }
@@@ -460,48 -463,48 +459,48 @@@ static unsigned int lirc_poll(struct fi
  static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
  {
        int result;
 -      unsigned long features = LIRC_CAN_SET_TRANSMITTER_MASK |
 -                               LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
 -      unsigned long mode;
 -      unsigned int ivalue;
 +      __u32 features = LIRC_CAN_SET_TRANSMITTER_MASK |
 +                       LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
 +      __u32 mode;
 +      __u32 value;
  
        switch (cmd) {
        case LIRC_GET_FEATURES:
 -              result = put_user(features, (unsigned long *) arg);
 +              result = put_user(features, (__u32 *) arg);
                if (result)
                        return result;
                break;
        case LIRC_GET_SEND_MODE:
 -              result = put_user(LIRC_MODE_PULSE, (unsigned long *) arg);
 +              result = put_user(LIRC_MODE_PULSE, (__u32 *) arg);
                if (result)
                        return result;
                break;
        case LIRC_GET_REC_MODE:
 -              result = put_user(LIRC_MODE_MODE2, (unsigned long *) arg);
 +              result = put_user(LIRC_MODE_MODE2, (__u32 *) arg);
                if (result)
                        return result;
                break;
        case LIRC_SET_SEND_MODE:
 -              result = get_user(mode, (unsigned long *) arg);
 +              result = get_user(mode, (__u32 *) arg);
                if (result)
                        return result;
                if (mode != LIRC_MODE_PULSE)
                        return -EINVAL;
                break;
        case LIRC_SET_REC_MODE:
 -              result = get_user(mode, (unsigned long *) arg);
 +              result = get_user(mode, (__u32 *) arg);
                if (result)
                        return result;
                if (mode != LIRC_MODE_MODE2)
                        return -ENOSYS;
                break;
        case LIRC_SET_TRANSMITTER_MASK:
 -              result = get_user(ivalue, (unsigned int *) arg);
 +              result = get_user(value, (__u32 *) arg);
                if (result)
                        return result;
 -              if ((ivalue & LIRC_PARALLEL_TRANSMITTER_MASK) != ivalue)
 +              if ((value & LIRC_PARALLEL_TRANSMITTER_MASK) != value)
                        return LIRC_PARALLEL_MAX_TRANSMITTERS;
 -              tx_mask = ivalue;
 +              tx_mask = value;
                break;
        default:
                return -ENOIOCTLCMD;
@@@ -542,9 -545,6 +541,9 @@@ static const struct file_operations lir
        .write          = lirc_write,
        .poll           = lirc_poll,
        .unlocked_ioctl = lirc_ioctl,
 +#ifdef CONFIG_COMPAT
 +      .compat_ioctl   = lirc_ioctl,
 +#endif
        .open           = lirc_open,
        .release        = lirc_close
  };
@@@ -575,6 -575,28 +574,6 @@@ static struct lirc_driver driver = 
  static int pf(void *handle);
  static void kf(void *handle);
  
 -static struct timer_list poll_timer;
 -static void poll_state(unsigned long ignored);
 -
 -static void poll_state(unsigned long ignored)
 -{
 -      printk(KERN_NOTICE "%s: time\n",
 -             LIRC_DRIVER_NAME);
 -      del_timer(&poll_timer);
 -      if (is_claimed)
 -              return;
 -      kf(NULL);
 -      if (!is_claimed) {
 -              printk(KERN_NOTICE "%s: could not claim port, giving up\n",
 -                     LIRC_DRIVER_NAME);
 -              init_timer(&poll_timer);
 -              poll_timer.expires = jiffies + HZ;
 -              poll_timer.data = (unsigned long)current;
 -              poll_timer.function = poll_state;
 -              add_timer(&poll_timer);
 -      }
 -}
 -
  static int pf(void *handle)
  {
        parport_disable_irq(pport);
index d920644985235e452a51ffbee891a3946171837b,9b77552f566e17a5fdb0c260f3d168446796483e..f0076eb025f1a0e9d412080caab87f627dda4970
@@@ -716,7 -716,7 +716,7 @@@ static loff_t lseek(struct file *filep
  /* copied from lirc_dev */
  static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
  {
-       struct IR *ir = (struct IR *)filep->private_data;
+       struct IR *ir = filep->private_data;
        unsigned char buf[ir->buf.chunk_size];
        int ret = 0, written = 0;
        DECLARE_WAITQUEUE(wait, current);
@@@ -898,7 -898,7 +898,7 @@@ done
  static ssize_t write(struct file *filep, const char *buf, size_t n,
                          loff_t *ppos)
  {
-       struct IR *ir = (struct IR *)filep->private_data;
+       struct IR *ir = filep->private_data;
        size_t i;
        int failures = 0;
  
  /* copied from lirc_dev */
  static unsigned int poll(struct file *filep, poll_table *wait)
  {
-       struct IR *ir = (struct IR *)filep->private_data;
+       struct IR *ir = filep->private_data;
        unsigned int ret;
  
        dprintk("poll called\n");
  
  static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
  {
-       struct IR *ir = (struct IR *)filep->private_data;
+       struct IR *ir = filep->private_data;
        int result;
        unsigned long mode, features = 0;
  
@@@ -1086,7 -1086,7 +1086,7 @@@ static int open(struct inode *node, str
  static int close(struct inode *node, struct file *filep)
  {
        /* find our IR struct */
-       struct IR *ir = (struct IR *)filep->private_data;
+       struct IR *ir = filep->private_data;
        if (ir == NULL) {
                zilog_error("close: no private_data attached to the file!\n");
                return -ENODEV;
@@@ -1139,9 -1139,6 +1139,9 @@@ static const struct file_operations lir
        .write          = write,
        .poll           = poll,
        .unlocked_ioctl = ioctl,
 +#ifdef CONFIG_COMPAT
 +      .compat_ioctl   = ioctl,
 +#endif
        .open           = open,
        .release        = close
  };
index e379e3ec444295a2153fa0821d2925b5522b836e,6c09ef3c71ea58f4f451bc514907a1c2f8977eb4..184cc505ed86c86370e24e0328e12fd253c10d54
@@@ -160,15 -160,15 +160,15 @@@ static struct snd_pcm_hardware snd_tm60
                SNDRV_PCM_INFO_MMAP_VALID,
        .formats = SNDRV_PCM_FMTBIT_S16_LE,
  
 -      .rates =                SNDRV_PCM_RATE_48000,
 +      .rates =                SNDRV_PCM_RATE_CONTINUOUS,
        .rate_min =             48000,
        .rate_max =             48000,
        .channels_min = 2,
        .channels_max = 2,
 -      .period_bytes_min = 62720,
 -      .period_bytes_max = 62720,
 +      .period_bytes_min = 64,
 +      .period_bytes_max = 12544,
        .periods_min = 1,
 -      .periods_max = 1024,
 +      .periods_max = 98,
        .buffer_bytes_max = 62720 * 8,
  };
  
@@@ -201,14 -201,6 +201,14 @@@ _error
   */
  static int snd_tm6000_close(struct snd_pcm_substream *substream)
  {
 +      struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
 +      struct tm6000_core *core = chip->core;
 +
 +      if (atomic_read(&core->stream_started) > 0) {
 +              atomic_set(&core->stream_started, 0);
 +              schedule_work(&core->wq_trigger);
 +      }
 +
        return 0;
  }
  
@@@ -219,67 -211,38 +219,67 @@@ static int tm6000_fillbuf(struct tm6000
        struct snd_pcm_runtime *runtime;
        int period_elapsed = 0;
        unsigned int stride, buf_pos;
 +      int length;
 +
 +      if (atomic_read(&core->stream_started) == 0)
 +              return 0;
  
 -      if (!size || !substream)
 +      if (!size || !substream) {
 +              dprintk(1, "substream was NULL\n");
                return -EINVAL;
 +      }
  
        runtime = substream->runtime;
 -      if (!runtime || !runtime->dma_area)
 +      if (!runtime || !runtime->dma_area) {
 +              dprintk(1, "runtime was NULL\n");
                return -EINVAL;
 +      }
  
        buf_pos = chip->buf_pos;
        stride = runtime->frame_bits >> 3;
  
 +      if (stride == 0) {
 +              dprintk(1, "stride is zero\n");
 +              return -EINVAL;
 +      }
 +
 +      length = size / stride;
 +      if (length == 0) {
 +              dprintk(1, "%s: length was zero\n", __func__);
 +              return -EINVAL;
 +      }
 +
        dprintk(1, "Copying %d bytes at %p[%d] - buf size=%d x %d\n", size,
                runtime->dma_area, buf_pos,
                (unsigned int)runtime->buffer_size, stride);
  
 -      if (buf_pos + size >= runtime->buffer_size * stride) {
 -              unsigned int cnt = runtime->buffer_size * stride - buf_pos;
 -              memcpy(runtime->dma_area + buf_pos, buf, cnt);
 -              memcpy(runtime->dma_area, buf + cnt, size - cnt);
 +      if (buf_pos + length >= runtime->buffer_size) {
 +              unsigned int cnt = runtime->buffer_size - buf_pos;
 +              memcpy(runtime->dma_area + buf_pos * stride, buf, cnt * stride);
 +              memcpy(runtime->dma_area, buf + cnt * stride,
 +                      length * stride - cnt * stride);
        } else
 -              memcpy(runtime->dma_area + buf_pos, buf, size);
 +              memcpy(runtime->dma_area + buf_pos * stride, buf,
 +                      length * stride);
  
 -      chip->buf_pos += size;
 -      if (chip->buf_pos >= runtime->buffer_size * stride)
 -              chip->buf_pos -= runtime->buffer_size * stride;
 +#ifndef NO_PCM_LOCK
 +       snd_pcm_stream_lock(substream);
 +#endif
  
 -      chip->period_pos += size;
 +      chip->buf_pos += length;
 +      if (chip->buf_pos >= runtime->buffer_size)
 +              chip->buf_pos -= runtime->buffer_size;
 +
 +      chip->period_pos += length;
        if (chip->period_pos >= runtime->period_size) {
                chip->period_pos -= runtime->period_size;
                period_elapsed = 1;
        }
  
 +#ifndef NO_PCM_LOCK
 +       snd_pcm_stream_unlock(substream);
 +#endif
 +
        if (period_elapsed)
                snd_pcm_period_elapsed(substream);
  
@@@ -309,12 -272,8 +309,12 @@@ static int snd_tm6000_hw_params(struct 
  static int snd_tm6000_hw_free(struct snd_pcm_substream *substream)
  {
        struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
 +      struct tm6000_core *core = chip->core;
  
 -      _tm6000_stop_audio_dma(chip);
 +      if (atomic_read(&core->stream_started) > 0) {
 +              atomic_set(&core->stream_started, 0);
 +              schedule_work(&core->wq_trigger);
 +      }
  
        return 0;
  }
@@@ -336,42 -295,30 +336,42 @@@ static int snd_tm6000_prepare(struct sn
  /*
   * trigger callback
   */
 +static void audio_trigger(struct work_struct *work)
 +{
 +      struct tm6000_core *core = container_of(work, struct tm6000_core,
 +                                              wq_trigger);
 +      struct snd_tm6000_card *chip = core->adev;
 +
 +      if (atomic_read(&core->stream_started)) {
 +              dprintk(1, "starting capture");
 +              _tm6000_start_audio_dma(chip);
 +      } else {
 +              dprintk(1, "stopping capture");
 +              _tm6000_stop_audio_dma(chip);
 +      }
 +}
 +
  static int snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int cmd)
  {
        struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
 -      int err;
 -
 -      spin_lock(&chip->reg_lock);
 +      struct tm6000_core *core = chip->core;
 +      int err = 0;
  
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
 -              err = _tm6000_start_audio_dma(chip);
 +              atomic_set(&core->stream_started, 1);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
 -              err = _tm6000_stop_audio_dma(chip);
 +              atomic_set(&core->stream_started, 0);
                break;
        default:
                err = -EINVAL;
                break;
        }
 -
 -      spin_unlock(&chip->reg_lock);
 +      schedule_work(&core->wq_trigger);
  
        return err;
  }
 -
  /*
   * pointer callback
   */
@@@ -456,7 -403,7 +456,7 @@@ int tm6000_audio_init(struct tm6000_cor
  
        rc = snd_pcm_new(card, "TM6000 Audio", 0, 0, 1, &pcm);
        if (rc < 0)
-               goto error;
+               goto error_chip;
  
        pcm->info_flags = 0;
        pcm->private_data = chip;
  
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_tm6000_pcm_ops);
  
 +      INIT_WORK(&dev->wq_trigger, audio_trigger);
        rc = snd_card_register(card);
        if (rc < 0)
-               goto error;
+               goto error_chip;
  
        dprintk(1,"Registered audio driver for %s\n", card->longname);
  
        return 0;
  
+ error_chip:
+       kfree(chip);
+       dev->adev = NULL;
  error:
        snd_card_free(card);
        return rc;
index df3f187959b9e780eec5248c0cec9313010c0abe,80f2bf084505469a6728cfc839cffcc4edc3c057..40a0206e2432a15f0766649aea0287b9d967976d
@@@ -1,23 -1,23 +1,23 @@@
  /*
 -   tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices
 -
 -   Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
 -
 -   Copyright (C) 2007 Michel Ludwig <michel.ludwig@gmail.com>
 -       - DVB-T support
 -
 -   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 version 2
 -
 -   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.
 + *  tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices
 + *
 + *  Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
 + *
 + *  Copyright (C) 2007 Michel Ludwig <michel.ludwig@gmail.com>
 + *      - DVB-T support
 + *
 + *  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 version 2
 + *
 + *  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.
   */
  
  #include <linux/module.h>
  #include <media/v4l2-common.h>
  #include <media/tuner.h>
  
 -#define USB_TIMEOUT   5*HZ /* ms */
 +#define USB_TIMEOUT   (5 * HZ) /* ms */
  
  int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
                          u16 value, u16 index, u8 *buf, u16 len)
  {
        int          ret, i;
        unsigned int pipe;
 -      static int   ini = 0, last = 0, n = 0;
        u8           *data = NULL;
  
        if (len)
        }
  
        if (tm6000_debug & V4L2_DEBUG_I2C) {
 -              if (!ini)
 -                      last = ini = jiffies;
 -
 -              printk("%06i (dev %p, pipe %08x): ", n, dev->udev, pipe);
 +              printk("(dev %p, pipe %08x): ", dev->udev, pipe);
  
 -              printk("%s: %06u ms %06u ms %02x %02x %02x %02x %02x %02x %02x %02x ",
 +              printk("%s: %02x %02x %02x %02x %02x %02x %02x %02x ",
                        (req_type & USB_DIR_IN) ? " IN" : "OUT",
 -                      jiffies_to_msecs(jiffies-last),
 -                      jiffies_to_msecs(jiffies-ini),
                        req_type, req, value&0xff, value>>8, index&0xff,
                        index>>8, len&0xff, len>>8);
 -              last = jiffies;
 -              n++;
  
                if (!(req_type & USB_DIR_IN)) {
                        printk(">>> ");
@@@ -178,17 -186,21 +178,17 @@@ void tm6000_set_fourcc_format(struct tm
        }
  }
  
 -int tm6000_init_analog_mode(struct tm6000_core *dev)
 +static void tm6000_set_vbi(struct tm6000_core *dev)
  {
 -      if (dev->dev_type == TM6010) {
 -              int val;
 +      /*
 +       * FIXME:
 +       * VBI lines and start/end are different between 60Hz and 50Hz
 +       * So, it is very likely that we need to change the config to
 +       * something that takes it into account, doing something different
 +       * if (dev->norm & V4L2_STD_525_60)
 +       */
  
 -              /* Enable video */
 -              val = tm6000_get_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0);
 -              val |= 0x60;
 -              tm6000_set_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);
 -              val = tm6000_get_reg(dev,
 -                      TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0);
 -              val &= ~0x40;
 -              tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, val);
 -
 -              /* Init teletext */
 +      if (dev->dev_type == TM6010) {
                tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01);
                tm6000_set_reg(dev, TM6010_REQ07_R41_TELETEXT_VBI_CODE1, 0x27);
                tm6000_set_reg(dev, TM6010_REQ07_R42_VBI_DATA_HIGH_LEVEL, 0x55);
                tm6000_set_reg(dev, TM6010_REQ07_R5B_VBI_TELETEXT_DTO0, 0x4c);
                tm6000_set_reg(dev, TM6010_REQ07_R40_TELETEXT_VBI_CODE0, 0x01);
                tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x00);
 +      }
 +}
  
 +int tm6000_init_analog_mode(struct tm6000_core *dev)
 +{
 +      struct v4l2_frequency f;
 +
 +      if (dev->dev_type == TM6010) {
 +              int val;
 +
 +              /* Enable video */
 +              val = tm6000_get_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0);
 +              val |= 0x60;
 +              tm6000_set_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);
 +              val = tm6000_get_reg(dev,
 +                      TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0);
 +              val &= ~0x40;
 +              tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, val);
  
 -              /* Init audio */
 -              tm6000_set_reg(dev, TM6010_REQ08_R01_A_INIT, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R02_A_FIX_GAIN_CTRL, 0x04);
 -              tm6000_set_reg(dev, TM6010_REQ08_R03_A_AUTO_GAIN_CTRL, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R04_A_SIF_AMP_CTRL, 0xa0);
 -              tm6000_set_reg(dev, TM6010_REQ08_R05_A_STANDARD_MOD, 0x05);
 -              tm6000_set_reg(dev, TM6010_REQ08_R06_A_SOUND_MOD, 0x06);
 -              tm6000_set_reg(dev, TM6010_REQ08_R07_A_LEFT_VOL, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R08_A_RIGHT_VOL, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R09_A_MAIN_VOL, 0x08);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0A_A_I2S_MOD, 0x91);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0B_A_ASD_THRES1, 0x20);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0C_A_ASD_THRES2, 0x12);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0D_A_AMD_THRES, 0x20);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0E_A_MONO_THRES1, 0xf0);
 -              tm6000_set_reg(dev, TM6010_REQ08_R0F_A_MONO_THRES2, 0x80);
 -              tm6000_set_reg(dev, TM6010_REQ08_R10_A_MUTE_THRES1, 0xc0);
 -              tm6000_set_reg(dev, TM6010_REQ08_R11_A_MUTE_THRES2, 0x80);
 -              tm6000_set_reg(dev, TM6010_REQ08_R12_A_AGC_U, 0x12);
 -              tm6000_set_reg(dev, TM6010_REQ08_R13_A_AGC_ERR_T, 0xfe);
 -              tm6000_set_reg(dev, TM6010_REQ08_R14_A_AGC_GAIN_INIT, 0x20);
 -              tm6000_set_reg(dev, TM6010_REQ08_R15_A_AGC_STEP_THR, 0x14);
 -              tm6000_set_reg(dev, TM6010_REQ08_R16_A_AGC_GAIN_MAX, 0xfe);
 -              tm6000_set_reg(dev, TM6010_REQ08_R17_A_AGC_GAIN_MIN, 0x01);
 -              tm6000_set_reg(dev, TM6010_REQ08_R18_A_TR_CTRL, 0xa0);
 -              tm6000_set_reg(dev, TM6010_REQ08_R19_A_FH_2FH_GAIN, 0x32);
 -              tm6000_set_reg(dev, TM6010_REQ08_R1A_A_NICAM_SER_MAX, 0x64);
 -              tm6000_set_reg(dev, TM6010_REQ08_R1B_A_NICAM_SER_MIN, 0x20);
 -              tm6000_set_reg(dev, REQ_08_SET_GET_AVREG_BIT, 0x1c, 0x00);
 -              tm6000_set_reg(dev, REQ_08_SET_GET_AVREG_BIT, 0x1d, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R1E_A_GAIN_DEEMPH_OUT, 0x13);
 -              tm6000_set_reg(dev, TM6010_REQ08_R1F_A_TEST_INTF_SEL, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R20_A_TEST_PIN_SEL, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_RE4_ADC_IN2_SEL, 0xf3);
 -              tm6000_set_reg(dev, TM6010_REQ08_R06_A_SOUND_MOD, 0x00);
 -              tm6000_set_reg(dev, TM6010_REQ08_R01_A_INIT, 0x80);
 +              tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc);
  
        } else {
                /* Enables soft reset */
  
        /* Tuner firmware can now be loaded */
  
 -      /*FIXME: Hack!!! */
 -      struct v4l2_frequency f;
 -      mutex_lock(&dev->lock);
 +      /*
 +       * FIXME: This is a hack! xc3028 "sleeps" when no channel is detected
 +       * for more than a few seconds. Not sure why, as this behavior does
 +       * not happen on other devices with xc3028. So, I suspect that it
 +       * is yet another bug at tm6000. After start sleeping, decoding 
 +       * doesn't start automatically. Instead, it requires some
 +       * I2C commands to wake it up. As we want to have image at the
 +       * beginning, we needed to add this hack. The better would be to
 +       * discover some way to make tm6000 to wake up without this hack.
 +       */
        f.frequency = dev->freq;
        v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
 -      mutex_unlock(&dev->lock);
  
        msleep(100);
        tm6000_set_standard(dev, &dev->norm);
 +      tm6000_set_vbi(dev);
        tm6000_set_audio_bitrate(dev, 48000);
  
        /* switch dvb led off */
@@@ -338,6 -361,7 +338,6 @@@ int tm6000_init_digital_mode(struct tm6
                tm6000_set_reg(dev, TM6010_REQ07_RFE_POWER_DOWN, 0x28);
                tm6000_set_reg(dev, TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xfc);
                tm6000_set_reg(dev, TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0xff);
 -              tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe);
                tm6000_read_write_usb(dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2);
                printk(KERN_INFO"buf %#x %#x\n", buf[0], buf[1]);
        } else  {
@@@ -636,6 -660,7 +636,6 @@@ void tm6000_add_into_devlist(struct tm6
   */
  
  static LIST_HEAD(tm6000_extension_devlist);
 -static DEFINE_MUTEX(tm6000_extension_devlist_lock);
  
  int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
                        char *buf, int size)
@@@ -659,12 -684,14 +659,12 @@@ int tm6000_register_extension(struct tm
        struct tm6000_core *dev = NULL;
  
        mutex_lock(&tm6000_devlist_mutex);
 -      mutex_lock(&tm6000_extension_devlist_lock);
        list_add_tail(&ops->next, &tm6000_extension_devlist);
        list_for_each_entry(dev, &tm6000_devlist, devlist) {
                ops->init(dev);
                printk(KERN_INFO "%s: Initialized (%s) extension\n",
                       dev->name, ops->name);
        }
 -      mutex_unlock(&tm6000_extension_devlist_lock);
        mutex_unlock(&tm6000_devlist_mutex);
        return 0;
  }
@@@ -675,13 -702,13 +675,11 @@@ void tm6000_unregister_extension(struc
        struct tm6000_core *dev = NULL;
  
        mutex_lock(&tm6000_devlist_mutex);
-       list_for_each_entry(dev, &tm6000_devlist, devlist) {
-               if (dev)
-                       ops->fini(dev);
-       }
+       list_for_each_entry(dev, &tm6000_devlist, devlist)
+               ops->fini(dev);
  
 -      mutex_lock(&tm6000_extension_devlist_lock);
        printk(KERN_INFO "tm6000: Remove (%s) extension\n", ops->name);
        list_del(&ops->next);
 -      mutex_unlock(&tm6000_extension_devlist_lock);
        mutex_unlock(&tm6000_devlist_mutex);
  }
  EXPORT_SYMBOL(tm6000_unregister_extension);
@@@ -690,26 -717,26 +688,26 @@@ void tm6000_init_extension(struct tm600
  {
        struct tm6000_ops *ops = NULL;
  
 -      mutex_lock(&tm6000_extension_devlist_lock);
 +      mutex_lock(&tm6000_devlist_mutex);
        if (!list_empty(&tm6000_extension_devlist)) {
                list_for_each_entry(ops, &tm6000_extension_devlist, next) {
                        if (ops->init)
                                ops->init(dev);
                }
        }
 -      mutex_unlock(&tm6000_extension_devlist_lock);
 +      mutex_unlock(&tm6000_devlist_mutex);
  }
  
  void tm6000_close_extension(struct tm6000_core *dev)
  {
        struct tm6000_ops *ops = NULL;
  
 -      mutex_lock(&tm6000_extension_devlist_lock);
 +      mutex_lock(&tm6000_devlist_mutex);
        if (!list_empty(&tm6000_extension_devlist)) {
                list_for_each_entry(ops, &tm6000_extension_devlist, next) {
                        if (ops->fini)
                                ops->fini(dev);
                }
        }
 -      mutex_unlock(&tm6000_extension_devlist_lock);
 +      mutex_lock(&tm6000_devlist_mutex);
  }
diff --combined include/linux/Kbuild
index 05a59f0ce37a50c78c740f120eb327eeb6d988bb,9c1683e473cbdc634b6f60838b7ad65b299f391a..90e3ed3a314494ef69cc3cd9e86274f703f2c8b7
@@@ -326,10 -326,6 +326,6 @@@ header-y += serio.
  header-y += shm.h
  header-y += signal.h
  header-y += signalfd.h
- header-y += smb.h
- header-y += smb_fs.h
- header-y += smb_mount.h
- header-y += smbno.h
  header-y += snmp.h
  header-y += socket.h
  header-y += sockios.h
@@@ -372,6 -368,7 +368,6 @@@ header-y += veth.
  header-y += vhost.h
  header-y += videodev.h
  header-y += videodev2.h
 -header-y += videotext.h
  header-y += virtio_9p.h
  header-y += virtio_balloon.h
  header-y += virtio_blk.h