Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Jan 2011 00:04:53 +0000 (16:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Jan 2011 00:04:53 +0000 (16:04 -0800)
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (510 commits)
  staging: speakup: fix failure handling
  staging: usbip: remove double giveback of URB
  Staging: batman-adv: Remove batman-adv from staging
  Staging: hv: Use only one txf buffer per channel and kmalloc/GFP_KERNEL on initialize
  staging: hv: remove unneeded osd_schedule_callback
  staging: hv: convert channel_mgmt.c to not call osd_schedule_callback
  staging: hv: convert vmbus_on_msg_dpc to not call osd_schedule_callback
  staging: brcm80211: Fix WL_<type> logging macros
  Staging: IIO: DDS: AD9833 / AD9834 driver
  Staging: IIO: dds.h convenience macros
  Staging: IIO: Direct digital synthesis abi documentation
  staging: brcm80211: Convert ETHER_TYPE_802_1X to ETH_P_PAE
  staging: brcm80211: Remove unused ETHER_TYPE_<foo> #defines
  staging: brcm80211: Remove ETHER_HDR_LEN, use ETH_HLEN
  staging: brcm80211: Convert ETHER_ADDR_LEN to ETH_ALEN
  staging: brcm80211: Convert ETHER_IS<FOO> to is_<foo>_ether_addr
  staging: brcm80211: Remove unused ether_<foo> #defines and struct
  staging: brcm80211: Convert ETHER_IS_MULTI to is_multicast_ether_addr
  staging: brcm80211: Remove unused #defines ETHER_<foo>_LOCALADDR
  Staging: comedi: Fix checkpatch.pl issues in file s526.c
  ...

Fix up trivial conflict in drivers/video/udlfb.c

1  2 
MAINTAINERS
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/bcm/InterfaceInit.c
drivers/staging/cx25821/cx25821-alsa.c
drivers/staging/zram/zram_drv.c
drivers/usb/serial/option.c
drivers/video/udlfb.c

diff --combined MAINTAINERS
@@@ -166,8 -166,9 +166,8 @@@ F: drivers/serial/8250
  F:    include/linux/serial_8250.h
  
  8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
 -M:    Paul Gortmaker <p_gortmaker@yahoo.com>
  L:    netdev@vger.kernel.org
 -S:    Maintained
 +S:    Orphan / Obsolete
  F:    drivers/net/*8390*
  F:    drivers/net/ax88796.c
  
@@@ -404,7 -405,7 +404,7 @@@ S: Supporte
  F:    drivers/usb/gadget/amd5536udc.*
  
  AMD GEODE PROCESSOR/CHIPSET SUPPORT
 -P:    Jordan Crouse
 +P:    Andres Salomon <dilinger@queued.net>
  L:    linux-geode@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
  S:    Supported
@@@ -558,14 -559,14 +558,14 @@@ W:      http://maxim.org.za/at91_26.htm
  S:    Maintained
  
  ARM/BCMRING ARM ARCHITECTURE
 -M:    Leo Chen <leochen@broadcom.com>
 +M:    Jiandong Zheng <jdzheng@broadcom.com>
  M:    Scott Branden <sbranden@broadcom.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-bcmring
  
  ARM/BCMRING MTD NAND DRIVER
 -M:    Leo Chen <leochen@broadcom.com>
 +M:    Jiandong Zheng <jdzheng@broadcom.com>
  M:    Scott Branden <sbranden@broadcom.com>
  L:    linux-mtd@lists.infradead.org
  S:    Maintained
@@@ -791,14 -792,11 +791,14 @@@ S:      Maintaine
  
  ARM/NOMADIK ARCHITECTURE
  M:    Alessandro Rubini <rubini@unipv.it>
 +M:    Linus Walleij <linus.walleij@stericsson.com>
  M:    STEricsson <STEricsson_nomadik_linux@list.st.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-nomadik/
  F:    arch/arm/plat-nomadik/
 +F:    drivers/i2c/busses/i2c-nomadik.c
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git
  
  ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
  M:    Nelson Castillo <arhuaco@freaks-unidos.net>
@@@ -817,7 -815,7 +817,7 @@@ F: drivers/mmc/host/msm_sdcc.
  F:    drivers/mmc/host/msm_sdcc.h
  F:    drivers/serial/msm_serial.h
  F:    drivers/serial/msm_serial.c
 -T:    git git://codeaurora.org/quic/kernel/dwalker/linux-msm.git
 +T:    git git://codeaurora.org/quic/kernel/davidb/linux-msm.git
  S:    Maintained
  
  ARM/TOSA MACHINE SUPPORT
@@@ -1000,24 -998,12 +1000,24 @@@ F:    drivers/i2c/busses/i2c-stu300.
  F:    drivers/rtc/rtc-coh901331.c
  F:    drivers/watchdog/coh901327_wdt.c
  F:    drivers/dma/coh901318*
 +F:    drivers/mfd/ab3100*
 +F:    drivers/rtc/rtc-ab3100.c
 +F:    drivers/rtc/rtc-coh901331.c
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git
  
 -ARM/U8500 ARM ARCHITECTURE
 +ARM/Ux500 ARM ARCHITECTURE
  M:    Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
 +M:    Linus Walleij <linus.walleij@stericsson.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-ux500/
 +F:    drivers/dma/ste_dma40*
 +F:    drivers/mfd/ab3550*
 +F:    drivers/mfd/abx500*
 +F:    drivers/mfd/ab8500*
 +F:    drivers/mfd/stmpe*
 +F:    drivers/rtc/rtc-ab8500.c
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git
  
  ARM/VFP SUPPORT
  M:    Russell King <linux@arm.linux.org.uk>
@@@ -1094,12 -1080,6 +1094,12 @@@ S:    Supporte
  F:    Documentation/aoe/
  F:    drivers/block/aoe/
  
 +ATHEROS ATH GENERIC UTILITIES
 +M:    "Luis R. Rodriguez" <lrodriguez@atheros.com>
 +L:    linux-wireless@vger.kernel.org
 +S:    Supported
 +F:    drivers/net/wireless/ath/*
 +
  ATHEROS ATH5K WIRELESS DRIVER
  M:    Jiri Slaby <jirislaby@gmail.com>
  M:    Nick Kossifidis <mickflemm@gmail.com>
@@@ -1278,15 -1258,6 +1278,15 @@@ S:    Maintaine
  F:    drivers/video/backlight/
  F:    include/linux/backlight.h
  
 +BATMAN ADVANCED
 +M:    Marek Lindner <lindner_marek@yahoo.de>
 +M:    Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
 +M:    Sven Eckelmann <sven@narfation.org>
 +L:    b.a.t.m.a.n@lists.open-mesh.org
 +W:    http://www.open-mesh.org/
 +S:    Maintained
 +F:    net/batman-adv/
 +
  BAYCOM/HDLCDRV DRIVERS FOR AX.25
  M:    Thomas Sailer <t.sailer@alumni.ethz.ch>
  L:    linux-hams@vger.kernel.org
@@@ -1423,7 -1394,9 +1423,9 @@@ F:      drivers/net/tg3.
  BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
  M:    Brett Rudley <brudley@broadcom.com>
  M:    Henry Ptasinski <henryp@broadcom.com>
- M:    Nohee Ko <noheek@broadcom.com>
+ M:    Dowan Kim <dowan@broadcom.com>
+ M:    Roland Vossen <rvossen@broadcom.com>
+ M:    Arend van Spriel <arend@broadcom.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
  F:    drivers/staging/brcm80211/
@@@ -2271,14 -2244,6 +2273,14 @@@ W:    http://acpi4asus.sf.ne
  S:    Maintained
  F:    drivers/platform/x86/eeepc-laptop.c
  
 +EEEPC WMI EXTRAS DRIVER
 +M:    Corentin Chary <corentincj@iksaif.net>
 +L:    acpi4asus-user@lists.sourceforge.net
 +L:    platform-driver-x86@vger.kernel.org
 +W:    http://acpi4asus.sf.net
 +S:    Maintained
 +F:    drivers/platform/x86/eeepc-wmi.c
 +
  EFIFB FRAMEBUFFER DRIVER
  L:    linux-fbdev@vger.kernel.org
  M:    Peter Jones <pjones@redhat.com>
@@@ -2834,10 -2799,6 +2836,10 @@@ M:    Thomas Gleixner <tglx@linutronix.de
  S:    Maintained
  F:    Documentation/timers/
  F:    kernel/hrtimer.c
 +F:    kernel/time/clockevents.c
 +F:    kernel/time/tick*.*
 +F:    kernel/time/timer_*.c
 +F     include/linux/clockevents.h
  F:    include/linux/hrtimer.h
  
  HIGH-SPEED SCC DRIVER FOR AX.25
@@@ -3073,10 -3034,8 +3075,10 @@@ F:    drivers/input
  INPUT MULTITOUCH (MT) PROTOCOL
  M:    Henrik Rydberg <rydberg@euromail.se>
  L:    linux-input@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt.git
  S:    Maintained
  F:    Documentation/input/multi-touch-protocol.txt
 +F:    drivers/input/input-mt.c
  K:    \b(ABS|SYN)_MT_
  
  INTEL IDLE DRIVER
@@@ -3163,8 -3122,6 +3165,8 @@@ M:      Alex Duyck <alexander.h.duyck@intel.
  M:    John Ronciak <john.ronciak@intel.com>
  L:    e1000-devel@lists.sourceforge.net
  W:    http://e1000.sourceforge.net/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-2.6.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next-2.6.git
  S:    Supported
  F:    Documentation/networking/e100.txt
  F:    Documentation/networking/e1000.txt
@@@ -4276,7 -4233,6 +4278,7 @@@ NILFS2 FILESYSTE
  M:    KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
  L:    linux-nilfs@vger.kernel.org
  W:    http://www.nilfs.org/en/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2.git
  S:    Supported
  F:    Documentation/filesystems/nilfs2.txt
  F:    fs/nilfs2/
@@@ -4374,20 -4330,6 +4376,20 @@@ M:    Deepak Saxena <dsaxena@plexity.net
  S:    Maintained
  F:    drivers/char/hw_random/omap-rng.c
  
 +OMAP HWMOD SUPPORT
 +M:    Benoît Cousson <b-cousson@ti.com>
 +M:    Paul Walmsley <paul@pwsan.com>
 +L:    linux-omap@vger.kernel.org
 +S:    Maintained
 +F:    arch/arm/mach-omap2/omap_hwmod.c
 +F:    arch/arm/plat-omap/include/plat/omap_hwmod.h
 +
 +OMAP HWMOD DATA FOR OMAP4-BASED DEVICES
 +M:    Benoît Cousson <b-cousson@ti.com>
 +L:    linux-omap@vger.kernel.org
 +S:    Maintained
 +F:    arch/arm/mach-omap2/omap_hwmod_44xx_data.c
 +
  OMAP USB SUPPORT
  M:    Felipe Balbi <balbi@ti.com>
  M:    David Brownell <dbrownell@users.sourceforge.net>
@@@ -4650,7 -4592,7 +4652,7 @@@ F:      drivers/pcmcia
  F:    include/pcmcia/
  
  PCNET32 NETWORK DRIVER
 -M:    Don Fry <pcnet32@verizon.net>
 +M:    Don Fry <pcnet32@frontier.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/pcnet32.c
@@@ -4662,16 -4604,6 +4664,16 @@@ S:    Maintaine
  F:    crypto/pcrypt.c
  F:    include/crypto/pcrypt.h
  
 +PER-CPU MEMORY ALLOCATOR
 +M:    Tejun Heo <tj@kernel.org>
 +M:    Christoph Lameter <cl@linux-foundation.org>
 +L:    linux-kernel@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git
 +S:    Maintained
 +F:    include/linux/percpu*.h
 +F:    mm/percpu*.c
 +F:    arch/*/include/asm/percpu.h
 +
  PER-TASK DELAY ACCOUNTING
  M:    Balbir Singh <balbir@linux.vnet.ibm.com>
  S:    Maintained
@@@ -4682,7 -4614,7 +4684,7 @@@ PERFORMANCE EVENTS SUBSYSTE
  M:    Peter Zijlstra <a.p.zijlstra@chello.nl>
  M:    Paul Mackerras <paulus@samba.org>
  M:    Ingo Molnar <mingo@elte.hu>
 -M:    Arnaldo Carvalho de Melo <acme@redhat.com>
 +M:    Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
  S:    Supported
  F:    kernel/perf_event*.c
  F:    include/linux/perf_event.h
@@@ -5107,7 -5039,7 +5109,7 @@@ L:      linux-wireless@vger.kernel.or
  W:    http://linuxwireless.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
 -F:    drivers/net/wireless/rtl818x/rtl8180*
 +F:    drivers/net/wireless/rtl818x/rtl8180/
  
  RTL8187 WIRELESS DRIVER
  M:    Herton Ronaldo Krzesinski <herton@mandriva.com.br>
@@@ -5117,17 -5049,7 +5119,17 @@@ L:    linux-wireless@vger.kernel.or
  W:    http://linuxwireless.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
 -F:    drivers/net/wireless/rtl818x/rtl8187*
 +F:    drivers/net/wireless/rtl818x/rtl8187/
 +
 +RTL8192CE WIRELESS DRIVER
 +M:    Larry Finger <Larry.Finger@lwfinger.net>
 +M:    Chaoming Li <chaoming_li@realsil.com.cn>
 +L:    linux-wireless@vger.kernel.org
 +W:    http://linuxwireless.org/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
 +S:    Maintained
 +F:    drivers/net/wireless/rtlwifi/
 +F:    drivers/net/wireless/rtlwifi/rtl8192ce/
  
  S3 SAVAGE FRAMEBUFFER DRIVER
  M:    Antonino Daplas <adaplas@gmail.com>
@@@ -5207,18 -5129,6 +5209,18 @@@ L:    alsa-devel@alsa-project.org (moderat
  S:    Supported
  F:    sound/soc/s3c24xx
  
 +TIMEKEEPING, NTP
 +M:    John Stultz <johnstul@us.ibm.com>
 +M:    Thomas Gleixner <tglx@linutronix.de>
 +S:    Supported
 +F:    include/linux/clocksource.h
 +F:    include/linux/time.h
 +F:    include/linux/timex.h
 +F:    include/linux/timekeeping.h
 +F:    kernel/time/clocksource.c
 +F:    kernel/time/time*.c
 +F:    kernel/time/ntp.c
 +
  TLG2300 VIDEO4LINUX-2 DRIVER
  M:    Huang Shijie <shijie8@gmail.com>
  M:    Kang Yong <kangyong@telegent.com>
@@@ -5789,6 -5699,12 +5791,6 @@@ M:     Ion Badulescu <ionut@badula.org
  S:    Odd Fixes
  F:    drivers/net/starfire*
  
 -STRADIS MPEG-2 DECODER DRIVER
 -M:    Nathan Laredo <laredo@gnu.org>
 -W:    http://www.stradis.com/
 -S:    Maintained
 -F:    drivers/media/video/stradis.c
 -
  SUN3/3X
  M:    Sam Creasey <sammy@sammy.net>
  W:    http://sammy.net/sun3/
@@@ -5938,8 -5854,7 +5940,8 @@@ F:      drivers/net/tlan.
  TOMOYO SECURITY MODULE
  M:    Kentaro Takeda <takedakn@nttdata.co.jp>
  M:    Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
 -L:    tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for developers and users in English)
 +L:    tomoyo-dev-en@lists.sourceforge.jp (subscribers-only, for developers in English)
 +L:    tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for users in English)
  L:    tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese)
  L:    tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese)
  W:    http://tomoyo.sourceforge.jp/
@@@ -6019,6 -5934,7 +6021,6 @@@ F:      include/linux/tty.
  
  TULIP NETWORK DRIVERS
  M:    Grant Grundler <grundler@parisc-linux.org>
 -M:    Kyle McMartin <kyle@mcmartin.ca>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/tulip/
@@@ -6670,15 -6586,6 +6672,15 @@@ F:    include/linux/mfd/wm8400
  F:    include/sound/wm????.h
  F:    sound/soc/codecs/wm*
  
 +WORKQUEUE
 +M:    Tejun Heo <tj@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git
 +S:    Maintained
 +F:    include/linux/workqueue.h
 +F:    kernel/workqueue.c
 +F:    Documentation/workqueue.txt
 +
  X.25 NETWORK LAYER
  M:    Andrew Hendry <andrew.hendry@gmail.com>
  L:    linux-x25@vger.kernel.org
diff --combined drivers/staging/Kconfig
@@@ -51,11 -51,9 +51,11 @@@ source "drivers/staging/cx25821/Kconfig
  
  source "drivers/staging/tm6000/Kconfig"
  
 -source "drivers/staging/cpia/Kconfig"
 +source "drivers/staging/dabusb/Kconfig"
  
 -source "drivers/staging/stradis/Kconfig"
 +source "drivers/staging/se401/Kconfig"
 +
 +source "drivers/staging/usbvideo/Kconfig"
  
  source "drivers/staging/usbip/Kconfig"
  
@@@ -113,12 -111,16 +113,14 @@@ source "drivers/staging/vt6655/Kconfig
  
  source "drivers/staging/vt6656/Kconfig"
  
 -source "drivers/staging/udlfb/Kconfig"
 -
  source "drivers/staging/hv/Kconfig"
  
  source "drivers/staging/vme/Kconfig"
  
  source "drivers/staging/memrar/Kconfig"
  
+ source "drivers/staging/sep/Kconfig"
  source "drivers/staging/iio/Kconfig"
  
  source "drivers/staging/zram/Kconfig"
@@@ -127,8 -129,6 +129,6 @@@ source "drivers/staging/wlags49_h2/Kcon
  
  source "drivers/staging/wlags49_h25/Kconfig"
  
- source "drivers/staging/batman-adv/Kconfig"
  source "drivers/staging/samsung-laptop/Kconfig"
  
  source "drivers/staging/sm7xx/Kconfig"
@@@ -141,8 -141,6 +141,6 @@@ source "drivers/staging/cxt1e1/Kconfig
  
  source "drivers/staging/ti-st/Kconfig"
  
- source "drivers/staging/adis16255/Kconfig"
  source "drivers/staging/xgifb/Kconfig"
  
  source "drivers/staging/msm/Kconfig"
@@@ -175,5 -173,9 +173,9 @@@ source "drivers/staging/intel_sst/Kconf
  
  source "drivers/staging/speakup/Kconfig"
  
+ source "drivers/staging/cptm1217/Kconfig"
+ source "drivers/staging/ste_rmi4/Kconfig"
  endif # !STAGING_EXCLUDE_BUILD
  endif # STAGING
diff --combined drivers/staging/Makefile
@@@ -8,9 -8,8 +8,9 @@@ 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_USB_DABUSB)        += dabusb/
 +obj-$(CONFIG_USB_VICAM)         += usbvideo/
 +obj-$(CONFIG_USB_SE401)         += se401/
  obj-$(CONFIG_LIRC_STAGING)    += lirc/
  obj-$(CONFIG_USB_IP_COMMON)   += usbip/
  obj-$(CONFIG_W35UND)          += winbond/
@@@ -39,21 -38,21 +39,20 @@@ obj-$(CONFIG_USB_SERIAL_QUATECH_USB2)      +
  obj-$(CONFIG_OCTEON_ETHERNET) += octeon/
  obj-$(CONFIG_VT6655)          += vt6655/
  obj-$(CONFIG_VT6656)          += vt6656/
 -obj-$(CONFIG_FB_UDL)          += udlfb/
  obj-$(CONFIG_HYPERV)          += hv/
  obj-$(CONFIG_VME_BUS)         += vme/
  obj-$(CONFIG_MRST_RAR_HANDLER)        += memrar/
+ obj-$(CONFIG_DX_SEP)            += sep/
  obj-$(CONFIG_IIO)             += iio/
  obj-$(CONFIG_ZRAM)            += zram/
  obj-$(CONFIG_WLAGS49_H2)      += wlags49_h2/
  obj-$(CONFIG_WLAGS49_H25)     += wlags49_h25/
- obj-$(CONFIG_BATMAN_ADV)      += batman-adv/
  obj-$(CONFIG_SAMSUNG_LAPTOP)  += samsung-laptop/
  obj-$(CONFIG_FB_SM7XX)                += sm7xx/
  obj-$(CONFIG_VIDEO_DT3155)    += dt3155v4l/
  obj-$(CONFIG_CRYSTALHD)               += crystalhd/
  obj-$(CONFIG_CXT1E1)          += cxt1e1/
  obj-$(CONFIG_TI_ST)           += ti-st/
- obj-$(CONFIG_ADIS16255)               += adis16255/
  obj-$(CONFIG_FB_XGI)          += xgifb/
  obj-$(CONFIG_MSM_STAGING)     += msm/
  obj-$(CONFIG_EASYCAP)         += easycap/
@@@ -68,3 -67,5 +67,5 @@@ obj-$(CONFIG_BCM_WIMAX)       += bcm
  obj-$(CONFIG_FT1000)          += ft1000/
  obj-$(CONFIG_SND_INTEL_SST)           += intel_sst/
  obj-$(CONFIG_SPEAKUP) += speakup/
+ obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217)     += cptm1217/
+ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)  += ste_rmi4/
@@@ -1,54 -1,63 +1,63 @@@
  #include "headers.h"
  
  static struct usb_device_id InterfaceUsbtable[] = {
-     { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3) },
+       { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3) },
        { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3B) },
        { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3L) },
-       { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_226) },
+       { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_SM250) },
+       { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_226) },
        { USB_DEVICE(BCM_USB_VENDOR_ID_FOXCONN, BCM_USB_PRODUCT_ID_1901) },
-     {}
+       { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_ZTE_TU25) },
+       { }
  };
+ MODULE_DEVICE_TABLE(usb, InterfaceUsbtable);
  
- VOID InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter)
+ static int debug = -1;
+ module_param(debug, uint, 0600);
+ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+ static const u32 default_msg =
+       NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK
+       | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR
+       | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN;
+ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER Adapter);
+ static void InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter)
  {
-       INT i = 0;
-       // Wake up the wait_queue...
-       if(psIntfAdapter->psAdapter->LEDInfo.led_thread_running & BCM_LED_THREAD_RUNNING_ACTIVELY)
-       {
+       int i = 0;
+       /* Wake up the wait_queue... */
+       if (psIntfAdapter->psAdapter->LEDInfo.led_thread_running & BCM_LED_THREAD_RUNNING_ACTIVELY) {
                psIntfAdapter->psAdapter->DriverState = DRIVER_HALT;
                wake_up(&psIntfAdapter->psAdapter->LEDInfo.notify_led_event);
        }
        reset_card_proc(psIntfAdapter->psAdapter);
  
-       //worst case time taken by the RDM/WRM will be 5 sec. will check after every 100 ms
-       //to accertain the device is not being accessed. After this No RDM/WRM should be made.
-       while(psIntfAdapter->psAdapter->DeviceAccess)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Device is being Accessed \n");
+       /*
+        * worst case time taken by the RDM/WRM will be 5 sec. will check after every 100 ms
+        * to accertain the device is not being accessed. After this No RDM/WRM should be made.
+        */
+       while (psIntfAdapter->psAdapter->DeviceAccess) {
+               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                       "Device is being accessed.\n");
                msleep(100);
        }
        /* Free interrupt URB */
-       //psIntfAdapter->psAdapter->device_removed = TRUE;
-       if(psIntfAdapter->psInterruptUrb)
-       {
-               usb_free_urb(psIntfAdapter->psInterruptUrb);
-       }
+       /* psIntfAdapter->psAdapter->device_removed = TRUE; */
+       usb_free_urb(psIntfAdapter->psInterruptUrb);
  
        /* Free transmit URBs */
-       for(i = 0; i < MAXIMUM_USB_TCB; i++)
-       {
-               if(psIntfAdapter->asUsbTcb[i].urb  != NULL)
-               {
+       for (i = 0; i < MAXIMUM_USB_TCB; i++) {
+               if (psIntfAdapter->asUsbTcb[i].urb  != NULL) {
                        usb_free_urb(psIntfAdapter->asUsbTcb[i].urb);
                        psIntfAdapter->asUsbTcb[i].urb = NULL;
                }
        }
        /* Free receive URB and buffers */
-       for(i = 0; i < MAXIMUM_USB_RCB; i++)
-       {
-               if (psIntfAdapter->asUsbRcb[i].urb != NULL)
-               {
-                       bcm_kfree(psIntfAdapter->asUsbRcb[i].urb->transfer_buffer);
+       for (i = 0; i < MAXIMUM_USB_RCB; i++) {
+               if (psIntfAdapter->asUsbRcb[i].urb != NULL) {
+                       kfree(psIntfAdapter->asUsbRcb[i].urb->transfer_buffer);
                        usb_free_urb(psIntfAdapter->asUsbRcb[i].urb);
                        psIntfAdapter->asUsbRcb[i].urb = NULL;
                }
        AdapterFree(psIntfAdapter->psAdapter);
  }
  
- static int usbbcm_open(struct inode *inode, struct file *file)
- {
-       return 0;
- }
- static int usbbcm_release(struct inode *inode, struct file *file)
- {
-       return 0;
- }
- static ssize_t usbbcm_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
- {
-       return 0;
- }
- static ssize_t usbbcm_write(struct file *file, const char __user *user_buffer, size_t count, loff_t *ppos)
+ static void ConfigureEndPointTypesThroughEEPROM(PMINI_ADAPTER Adapter)
  {
-       return 0;
- }
+       unsigned long ulReg = 0;
+       int ret;
  
- VOID ConfigureEndPointTypesThroughEEPROM(PMINI_ADAPTER Adapter)
- {
-       ULONG ulReg = 0;
- // Program EP2 MAX_PKT_SIZE
+       /* Program EP2 MAX_PKT_SIZE */
        ulReg = ntohl(EP2_MPS_REG);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x128,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x128, 4, TRUE);
        ulReg = ntohl(EP2_MPS);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x12C,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x12C, 4, TRUE);
  
        ulReg = ntohl(EP2_CFG_REG);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x132,4,TRUE);
-       if(((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter))->bHighSpeedDevice == TRUE)
-       {
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x132, 4, TRUE);
+       if (((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter))->bHighSpeedDevice == TRUE) {
                ulReg = ntohl(EP2_CFG_INT);
-               BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x136,4,TRUE);
-       }
-       else
-       {
- // USE BULK EP as TX in FS mode.
+               BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x136, 4, TRUE);
+       } else {
+               /* USE BULK EP as TX in FS mode. */
                ulReg = ntohl(EP2_CFG_BULK);
-               BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x136,4,TRUE);
+               BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x136, 4, TRUE);
        }
  
- // Program EP4 MAX_PKT_SIZE.
+       /* Program EP4 MAX_PKT_SIZE. */
        ulReg = ntohl(EP4_MPS_REG);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x13C,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x13C, 4, TRUE);
        ulReg = ntohl(EP4_MPS);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x140,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x140, 4, TRUE);
  
- //    Program TX EP as interrupt (Alternate Setting)
-       if( rdmalt(Adapter,0x0F0110F8, (PUINT)&ulReg,4))
-       {
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reading of Tx EP is failing");
-               return ;
+       /* Program TX EP as interrupt(Alternate Setting) */
+       ret = rdmalt(Adapter, 0x0F0110F8, (u32 *)&ulReg, sizeof(u32));
+       if (ret) {
+               BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                       "reading of Tx EP failed\n");
+               return;
        }
        ulReg |= 0x6;
  
        ulReg = ntohl(ulReg);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1CC,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1CC, 4, TRUE);
  
        ulReg = ntohl(EP4_CFG_REG);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1C8,4,TRUE);
- // Program ISOCHRONOUS EP size to zero.
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1C8, 4, TRUE);
+       /* Program ISOCHRONOUS EP size to zero. */
        ulReg = ntohl(ISO_MPS_REG);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1D2,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1D2, 4, TRUE);
        ulReg = ntohl(ISO_MPS);
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1D6,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1D6, 4, TRUE);
  
- // Update EEPROM Version.
- // Read 4 bytes from 508 and modify 511 and 510.
- //
-       ReadBeceemEEPROM(Adapter,0x1FC,(PUINT)&ulReg);
+       /*
+        * Update EEPROM Version.
+        * Read 4 bytes from 508 and modify 511 and 510.
+        */
+       ReadBeceemEEPROM(Adapter, 0x1FC, (PUINT)&ulReg);
        ulReg &= 0x0101FFFF;
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1FC,4,TRUE);
- //
- //Update length field if required. Also make the string NULL terminated.
- //
-       ReadBeceemEEPROM(Adapter,0xA8,(PUINT)&ulReg);
-       if((ulReg&0x00FF0000)>>16 > 0x30)
-       {
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1FC, 4, TRUE);
+       /* Update length field if required. Also make the string NULL terminated. */
+       ReadBeceemEEPROM(Adapter, 0xA8, (PUINT)&ulReg);
+       if ((ulReg&0x00FF0000)>>16 > 0x30) {
                ulReg = (ulReg&0xFF00FFFF)|(0x30<<16);
-               BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0xA8,4,TRUE);
+               BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0xA8, 4, TRUE);
        }
-       ReadBeceemEEPROM(Adapter,0x148,(PUINT)&ulReg);
-       if((ulReg&0x00FF0000)>>16 > 0x30)
-       {
+       ReadBeceemEEPROM(Adapter, 0x148, (PUINT)&ulReg);
+       if ((ulReg&0x00FF0000)>>16 > 0x30) {
                ulReg = (ulReg&0xFF00FFFF)|(0x30<<16);
-               BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x148,4,TRUE);
+               BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x148, 4, TRUE);
        }
        ulReg = 0;
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x122,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x122, 4, TRUE);
        ulReg = 0;
-       BeceemEEPROMBulkWrite(Adapter,(PUCHAR)&ulReg,0x1C2,4,TRUE);
+       BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1C2, 4, TRUE);
  }
  
- static struct file_operations usbbcm_fops = {
-     .open    =  usbbcm_open,
-     .release =  usbbcm_release,
-     .read    =  usbbcm_read,
-     .write   =  usbbcm_write,
-     .owner   =  THIS_MODULE,
-       .llseek = no_llseek,
- };
- static struct usb_class_driver usbbcm_class = {
-     .name =           "usbbcm",
-     .fops =           &usbbcm_fops,
-     .minor_base =   BCM_USB_MINOR_BASE,
- };
  static int
  usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id)
  {
-       int retval =0 ;
-       PMINI_ADAPTER psAdapter = NULL;
-       PS_INTERFACE_ADAPTER psIntfAdapter = NULL;
-       struct usb_device      *udev = NULL;
- //    BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Usbbcm probe!!");
-       if((intf == NULL) || (id == NULL))
-       {
-       //      BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "intf or id is NULL");
-               return -EINVAL;
-       }
+       struct usb_device *udev = interface_to_usbdev(intf);
+       int retval;
+       PMINI_ADAPTER psAdapter;
+       PS_INTERFACE_ADAPTER psIntfAdapter;
+       struct net_device *ndev;
  
-       /* Allocate Adapter structure */
-       if((psAdapter = kzalloc(sizeof(MINI_ADAPTER), GFP_KERNEL)) == NULL)
-       {
-               BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory");
+       /* Reserve one extra queue for the bit-bucket */
+       ndev = alloc_etherdev_mq(sizeof(MINI_ADAPTER), NO_OF_QUEUES+1);
+       if (ndev == NULL) {
+               dev_err(&udev->dev, DRV_NAME ": no memory for device\n");
                return -ENOMEM;
        }
  
-     /* Init default driver debug state */
+       SET_NETDEV_DEV(ndev, &intf->dev);
  
-     psAdapter->stDebugState.debug_level = DBG_LVL_CURR;
+       psAdapter = netdev_priv(ndev);
+       psAdapter->dev = ndev;
+       psAdapter->msg_enable = netif_msg_init(debug, default_msg);
+       /* Init default driver debug state */
+       psAdapter->stDebugState.debug_level = DBG_LVL_CURR;
        psAdapter->stDebugState.type = DBG_TYPE_INITEXIT;
-       memset (psAdapter->stDebugState.subtype, 0, sizeof (psAdapter->stDebugState.subtype));
  
-     /* Technically, one can start using BCM_DEBUG_PRINT after this point.
+       /*
+        * Technically, one can start using BCM_DEBUG_PRINT after this point.
         * However, realize that by default the Type/Subtype bitmaps are all zero now;
         * so no prints will actually appear until the TestApp turns on debug paths via
         * the ioctl(); so practically speaking, in early init, no logging happens.
         * Further, we turn this OFF once init_module() completes.
         */
  
-     psAdapter->stDebugState.subtype[DBG_TYPE_INITEXIT] = 0xff;
+       psAdapter->stDebugState.subtype[DBG_TYPE_INITEXIT] = 0xff;
        BCM_SHOW_DEBUG_BITMAP(psAdapter);
  
        retval = InitAdapter(psAdapter);
-       if(retval)
-       {
-               BCM_DEBUG_PRINT (psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InitAdapter Failed\n");
+       if (retval) {
+               dev_err(&udev->dev, DRV_NAME ": InitAdapter Failed\n");
                AdapterFree(psAdapter);
                return retval;
        }
  
        /* Allocate interface adapter structure */
-       if((psAdapter->pvInterfaceAdapter =
-               kmalloc(sizeof(S_INTERFACE_ADAPTER), GFP_KERNEL)) == NULL)
-       {
-               BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory");
-               AdapterFree (psAdapter);
+       psIntfAdapter = kzalloc(sizeof(S_INTERFACE_ADAPTER), GFP_KERNEL);
+       if (psIntfAdapter == NULL) {
+               dev_err(&udev->dev, DRV_NAME ": no memory for Interface adapter\n");
+               AdapterFree(psAdapter);
                return -ENOMEM;
        }
-       memset(psAdapter->pvInterfaceAdapter, 0, sizeof(S_INTERFACE_ADAPTER));
  
-       psIntfAdapter = InterfaceAdapterGet(psAdapter);
+       psAdapter->pvInterfaceAdapter = psIntfAdapter;
        psIntfAdapter->psAdapter = psAdapter;
  
        /* Store usb interface in Interface Adapter */
        psIntfAdapter->interface = intf;
        usb_set_intfdata(intf, psIntfAdapter);
  
-       BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter);
+       BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+               "psIntfAdapter 0x%p\n", psIntfAdapter);
        retval = InterfaceAdapterInit(psIntfAdapter);
-       if(retval)
-       {
+       if (retval) {
                /* If the Firmware/Cfg File is not present
-                * then return success, let the application
-                * download the files.
-                */
-               if(-ENOENT == retval){
-                       BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "File Not Found, Use App to Download\n");
+                * then return success, let the application
+                * download the files.
+                */
+               if (-ENOENT == retval) {
+                       BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                               "File Not Found.  Use app to download.\n");
                        return STATUS_SUCCESS;
                }
-               BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapterInit Failed \n");
+               BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                       "InterfaceAdapterInit failed.\n");
                usb_set_intfdata(intf, NULL);
-               udev = interface_to_usbdev (intf);
+               udev = interface_to_usbdev(intf);
                usb_put_dev(udev);
-               if(psAdapter->bUsbClassDriverRegistered == TRUE)
-                               usb_deregister_dev (intf, &usbbcm_class);
                InterfaceAdapterFree(psIntfAdapter);
-               return retval ;
+               return retval;
        }
-       if(psAdapter->chip_id > T3)
-       {
-               uint32_t uiNackZeroLengthInt=4;
-               if(wrmalt(psAdapter, DISABLE_USB_ZERO_LEN_INT, &uiNackZeroLengthInt, sizeof(uiNackZeroLengthInt)))
-               {
-                       return -EIO;;
-               }
+       if (psAdapter->chip_id > T3) {
+               uint32_t uiNackZeroLengthInt = 4;
+               retval = wrmalt(psAdapter, DISABLE_USB_ZERO_LEN_INT, &uiNackZeroLengthInt, sizeof(uiNackZeroLengthInt));
+               if (retval)
+                       return retval;
        }
  
-       udev = interface_to_usbdev (intf);
        /* Check whether the USB-Device Supports remote Wake-Up */
-       if(USB_CONFIG_ATT_WAKEUP & udev->actconfig->desc.bmAttributes)
-       {
+       if (USB_CONFIG_ATT_WAKEUP & udev->actconfig->desc.bmAttributes) {
                /* If Suspend then only support dynamic suspend */
-               if(psAdapter->bDoSuspend)
-               {
+               if (psAdapter->bDoSuspend) {
  #ifdef CONFIG_PM
 -                      udev->autosuspend_delay = 0;
 +                      pm_runtime_set_autosuspend_delay(&udev->dev, 0);
                        intf->needs_remote_wakeup = 1;
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
-                       udev->autosuspend_disabled = 0;
- #else
                        usb_enable_autosuspend(udev);
- #endif
-                       device_init_wakeup(&intf->dev,1);
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
-                       usb_autopm_disable(intf);
- #endif
+                       device_init_wakeup(&intf->dev, 1);
                        INIT_WORK(&psIntfAdapter->usbSuspendWork, putUsbSuspend);
-                       BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Enabling USB Auto-Suspend\n");
+                       BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                               "Enabling USB Auto-Suspend\n");
  #endif
-               }
-               else
-               {
+               } else {
                        intf->needs_remote_wakeup = 0;
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
-                       udev->autosuspend_disabled = 1;
- #else
                        usb_disable_autosuspend(udev);
- #endif
                }
        }
  
-     psAdapter->stDebugState.subtype[DBG_TYPE_INITEXIT] = 0x0;
-     return retval;
+       psAdapter->stDebugState.subtype[DBG_TYPE_INITEXIT] = 0x0;
+       return retval;
  }
  
- static void usbbcm_disconnect (struct usb_interface *intf)
+ static void usbbcm_disconnect(struct usb_interface *intf)
  {
-       PS_INTERFACE_ADAPTER psIntfAdapter = NULL;
-       PMINI_ADAPTER psAdapter = NULL;
-       struct usb_device       *udev = NULL;
-     PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
-       BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Usb disconnected");
-       if(intf == NULL)
-       {
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "intf pointer is NULL");
-               return;
-       }
-       psIntfAdapter = usb_get_intfdata(intf);
-       BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p",psIntfAdapter);
-       if(psIntfAdapter == NULL)
-       {
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapter pointer is NULL");
+       PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf);
+       PMINI_ADAPTER psAdapter;
+       struct usb_device  *udev = interface_to_usbdev(intf);
+       if (psIntfAdapter == NULL)
                return;
-       }
        psAdapter = psIntfAdapter->psAdapter;
-       if(psAdapter->bDoSuspend)
+       netif_device_detach(psAdapter->dev);
+       if (psAdapter->bDoSuspend)
                intf->needs_remote_wakeup = 0;
  
        psAdapter->device_removed = TRUE ;
        usb_set_intfdata(intf, NULL);
        InterfaceAdapterFree(psIntfAdapter);
-       udev = interface_to_usbdev (intf);
        usb_put_dev(udev);
-       usb_deregister_dev (intf, &usbbcm_class);
  }
  
- static __inline int AllocUsbCb(PS_INTERFACE_ADAPTER psIntfAdapter)
+ static int AllocUsbCb(PS_INTERFACE_ADAPTER psIntfAdapter)
  {
        int i = 0;
-       for(i = 0; i < MAXIMUM_USB_TCB; i++)
-       {
-               if((psIntfAdapter->asUsbTcb[i].urb =
-                               usb_alloc_urb(0, GFP_KERNEL)) == NULL)
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cant allocate Tx urb for index %d", i);
+       for (i = 0; i < MAXIMUM_USB_TCB; i++) {
+               if ((psIntfAdapter->asUsbTcb[i].urb =
+                               usb_alloc_urb(0, GFP_KERNEL)) == NULL) {
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0,
+                               "Can't allocate Tx urb for index %d\n", i);
                        return -ENOMEM;
                }
        }
  
-       for(i = 0; i < MAXIMUM_USB_RCB; i++)
-       {
+       for (i = 0; i < MAXIMUM_USB_RCB; i++) {
                if ((psIntfAdapter->asUsbRcb[i].urb =
-                               usb_alloc_urb(0, GFP_KERNEL)) == NULL)
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cant allocate Rx urb for index %d", i);
+                               usb_alloc_urb(0, GFP_KERNEL)) == NULL) {
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0,
+                               "Can't allocate Rx urb for index %d\n", i);
                        return -ENOMEM;
                }
-               if((psIntfAdapter->asUsbRcb[i].urb->transfer_buffer =
-                       kmalloc(MAX_DATA_BUFFER_SIZE, GFP_KERNEL)) == NULL)
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cant allocate Rx buffer for index %d", i);
+               if ((psIntfAdapter->asUsbRcb[i].urb->transfer_buffer =
+                       kmalloc(MAX_DATA_BUFFER_SIZE, GFP_KERNEL)) == NULL) {
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0,
+                               "Can't allocate Rx buffer for index %d\n", i);
                        return -ENOMEM;
                }
                psIntfAdapter->asUsbRcb[i].urb->transfer_buffer_length = MAX_DATA_BUFFER_SIZE;
        return 0;
  }
  
  static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter)
  {
-       INT value = 0;
+       int value = 0;
        UINT status = STATUS_SUCCESS;
  
        status = InitCardAndDownloadFirmware(psIntfAdapter->psAdapter);
-       if(status != STATUS_SUCCESS)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "InitCardAndDownloadFirmware failed.\n");
+       if (status != STATUS_SUCCESS) {
+               pr_err(DRV_NAME "InitCardAndDownloadFirmware failed.\n");
                return status;
        }
-       if(TRUE == psIntfAdapter->psAdapter->fw_download_done)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Sending first interrupt URB down......");
-               if(StartInterruptUrb(psIntfAdapter))
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Cannot send interrupt in URB");
+       if (TRUE == psIntfAdapter->psAdapter->fw_download_done) {
+               if (StartInterruptUrb(psIntfAdapter)) {
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                       "Cannot send interrupt in URB\n");
                }
-               //now register the cntrl interface.
-               //after downloading the f/w waiting for 5 sec to get the mailbox interrupt.
  
+               /*
+                * now register the cntrl interface.
+                * after downloading the f/w waiting for 5 sec to get the mailbox interrupt.
+                */
                psIntfAdapter->psAdapter->waiting_to_fw_download_done = FALSE;
                value = wait_event_timeout(psIntfAdapter->psAdapter->ioctl_fw_dnld_wait_queue,
                                        psIntfAdapter->psAdapter->waiting_to_fw_download_done, 5*HZ);
  
-               if(value == 0)
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Mailbox Interrupt has not reached to Driver..");
-               }
-               else
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Got the mailbox interrupt ...Registering control interface...\n ");
-               }
-               if(register_control_device_interface(psIntfAdapter->psAdapter) < 0)
-               {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Register Control Device failed...");
+               if (value == 0)
+                       pr_err(DRV_NAME ": Timeout waiting for mailbox interrupt.\n");
+               if (register_control_device_interface(psIntfAdapter->psAdapter) < 0) {
+                       pr_err(DRV_NAME ": Register Control Device failed.\n");
                        return -EIO;
                }
        }
        return 0;
  }
  
- #if 0
- static void   print_usb_interface_desc(struct usb_interface_descriptor *usb_intf_desc)
- {
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "**************** INTERFACE DESCRIPTOR *********************");
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bLength: %x", usb_intf_desc->bLength);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bDescriptorType: %x", usb_intf_desc->bDescriptorType);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bInterfaceNumber: %x", usb_intf_desc->bInterfaceNumber);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bAlternateSetting: %x", usb_intf_desc->bAlternateSetting);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bNumEndpoints: %x", usb_intf_desc->bNumEndpoints);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bInterfaceClass: %x", usb_intf_desc->bInterfaceClass);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bInterfaceSubClass: %x", usb_intf_desc->bInterfaceSubClass);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bInterfaceProtocol: %x", usb_intf_desc->bInterfaceProtocol);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "iInterface :%x\n",usb_intf_desc->iInterface);
- }
- static void   print_usb_endpoint_descriptor(struct usb_endpoint_descriptor *usb_ep_desc)
- {
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "**************** ENDPOINT DESCRIPTOR *********************");
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bLength  :%x ", usb_ep_desc->bLength);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bDescriptorType  :%x ", usb_ep_desc->bDescriptorType);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bEndpointAddress  :%x ", usb_ep_desc->bEndpointAddress);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bmAttributes  :%x ", usb_ep_desc->bmAttributes);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "wMaxPacketSize  :%x ",usb_ep_desc->wMaxPacketSize);
-               BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "bInterval  :%x ",usb_ep_desc->bInterval);
- }
- #endif
  
  static inline int bcm_usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
  {
@@@ -518,124 -417,111 +417,111 @@@ static inline int bcm_usb_endpoint_is_i
        return (bcm_usb_endpoint_xfer_isoc(epd) && bcm_usb_endpoint_dir_out(epd));
  }
  
INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
  {
        struct usb_host_interface *iface_desc;
        struct usb_endpoint_descriptor *endpoint;
        size_t buffer_size;
-       ULONG value;
-       INT retval = 0;
-       INT usedIntOutForBulkTransfer = 0 ;
+       unsigned long value;
+       int retval = 0;
+       int usedIntOutForBulkTransfer = 0 ;
        BOOLEAN bBcm16 = FALSE;
        UINT uiData = 0;
  
        /* Store the usb dev into interface adapter */
-       psIntfAdapter->udev = usb_get_dev(interface_to_usbdev(
-                                                               psIntfAdapter->interface));
-       if((psIntfAdapter->udev->speed == USB_SPEED_HIGH))
-       {
-               psIntfAdapter->bHighSpeedDevice = TRUE ;
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "MODEM IS CONFIGURED TO HIGH_SPEED ");
-       }
-       else
-       {
-               psIntfAdapter->bHighSpeedDevice = FALSE ;
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "MODEM IS CONFIGURED TO FULL_SPEED ");
-       }
+       psIntfAdapter->udev = usb_get_dev(interface_to_usbdev(psIntfAdapter->interface));
  
+       psIntfAdapter->bHighSpeedDevice = (psIntfAdapter->udev->speed == USB_SPEED_HIGH);
        psIntfAdapter->psAdapter->interface_rdm = BcmRDM;
        psIntfAdapter->psAdapter->interface_wrm = BcmWRM;
  
-       if(rdmalt(psIntfAdapter->psAdapter, CHIP_ID_REG, (PUINT)&(psIntfAdapter->psAdapter->chip_id), sizeof(UINT)) < 0)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "CHIP ID Read Failed\n");
-               return STATUS_FAILURE;
-       }
-     if(0xbece3200==(psIntfAdapter->psAdapter->chip_id&~(0xF0)))
-       {
-               psIntfAdapter->psAdapter->chip_id=(psIntfAdapter->psAdapter->chip_id&~(0xF0));
+       retval = rdmalt(psIntfAdapter->psAdapter, CHIP_ID_REG,
+                       (u32 *)&(psIntfAdapter->psAdapter->chip_id), sizeof(u32));
+       if (retval) {
+               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "CHIP ID Read Failed\n");
+               return retval;
        }
  
-       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "First RDM Chip ID 0x%lx\n", psIntfAdapter->psAdapter->chip_id);
+       if (0xbece3200 == (psIntfAdapter->psAdapter->chip_id & ~(0xF0)))
+               psIntfAdapter->psAdapter->chip_id &= ~0xF0;
  
-     iface_desc = psIntfAdapter->interface->cur_altsetting;
-       //print_usb_interface_desc(&(iface_desc->desc));
+       dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n",
+                psIntfAdapter->psAdapter->chip_id);
  
-       if(psIntfAdapter->psAdapter->chip_id == T3B)
-       {
+       iface_desc = psIntfAdapter->interface->cur_altsetting;
  
-               //
-               //T3B device will have EEPROM,check if EEPROM is proper and BCM16 can be done or not.
-               //
-               BeceemEEPROMBulkRead(psIntfAdapter->psAdapter,&uiData,0x0,4);
-               if(uiData == BECM)
-               {
+       if (psIntfAdapter->psAdapter->chip_id == T3B) {
+               /* T3B device will have EEPROM, check if EEPROM is proper and BCM16 can be done or not. */
+               BeceemEEPROMBulkRead(psIntfAdapter->psAdapter, &uiData, 0x0, 4);
+               if (uiData == BECM)
                        bBcm16 = TRUE;
-               }
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Number of Altsetting aviailable for This Modem 0x%x\n", psIntfAdapter->interface->num_altsetting);
-               if(bBcm16 == TRUE)
-               {
-                       //selecting alternate setting one as a default setting for High Speed  modem.
-                       if(psIntfAdapter->bHighSpeedDevice)
-                               retval= usb_set_interface(psIntfAdapter->udev,DEFAULT_SETTING_0,ALTERNATE_SETTING_1);
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "BCM16 is Applicable on this dongle");
-                       if(retval || (psIntfAdapter->bHighSpeedDevice == FALSE))
-                       {
+               dev_info(&psIntfAdapter->udev->dev, "number of alternate setting %d\n",
+                        psIntfAdapter->interface->num_altsetting);
+               if (bBcm16 == TRUE) {
+                       /* selecting alternate setting one as a default setting for High Speed  modem. */
+                       if (psIntfAdapter->bHighSpeedDevice)
+                               retval= usb_set_interface(psIntfAdapter->udev, DEFAULT_SETTING_0, ALTERNATE_SETTING_1);
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                               "BCM16 is applicable on this dongle\n");
+                       if (retval || (psIntfAdapter->bHighSpeedDevice == FALSE)) {
                                usedIntOutForBulkTransfer = EP2 ;
                                endpoint = &iface_desc->endpoint[EP2].desc;
-                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Interface altsetting  got failed or Moemd is configured to FS.hence will work on default setting 0 \n");
+                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                        "Interface altsetting failed or modem is configured to Full Speed, hence will work on default setting 0\n");
                                /*
-                               If Modem is high speed device EP2 should be INT OUT End point
-                               If Mode is FS then EP2 should be bulk end point
-                               */
-                               if(((psIntfAdapter->bHighSpeedDevice ==TRUE ) && (bcm_usb_endpoint_is_int_out(endpoint)== FALSE))
-                                       ||((psIntfAdapter->bHighSpeedDevice == FALSE)&& (bcm_usb_endpoint_is_bulk_out(endpoint)== FALSE)))
-                               {
-                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Configuring the EEPROM ");
-                                       //change the EP2, EP4 to INT OUT end point
+                                * If Modem is high speed device EP2 should be INT OUT End point
+                                * If Mode is FS then EP2 should be bulk end point
+                                */
+                               if (((psIntfAdapter->bHighSpeedDevice == TRUE) && (bcm_usb_endpoint_is_int_out(endpoint) == FALSE))
+                                       || ((psIntfAdapter->bHighSpeedDevice == FALSE) && (bcm_usb_endpoint_is_bulk_out(endpoint) == FALSE))) {
+                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                               "Configuring the EEPROM\n");
+                                       /* change the EP2, EP4 to INT OUT end point */
                                        ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter);
  
                                        /*
-                                       It resets the device and if any thing gets changed in USB descriptor it will show fail and
-                                       re-enumerate the device
-                                       */
+                                        * It resets the device and if any thing gets changed
+                                        *  in USB descriptor it will show fail and re-enumerate
+                                        * the device
+                                        */
                                        retval = usb_reset_device(psIntfAdapter->udev);
-                                       if(retval)
-                                       {
-                                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reset got failed. hence Re-enumerating the device \n");
+                                       if (retval) {
+                                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                                       "reset failed.  Re-enumerating the device.\n");
                                                return retval ;
                                        }
  
                                }
-                               if((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint))
-                               {
-                                       // Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail.
+                               if ((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint)) {
+                                       /* Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. */
                                        UINT _uiData = ntohl(EP2_CFG_INT);
-                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Reverting Bulk to INT as it is FS MODE");
-                                       BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter,(PUCHAR)&_uiData,0x136,4,TRUE);
+                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, 
+                                               "Reverting Bulk to INT as it is in Full Speed mode.\n");
+                                       BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter, (PUCHAR)&_uiData, 0x136, 4, TRUE);
                                }
-                       }
-                       else
-                       {
+                       } else {
                                usedIntOutForBulkTransfer = EP4 ;
                                endpoint = &iface_desc->endpoint[EP4].desc;
-                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Choosing AltSetting as a default setting");
-                               if( bcm_usb_endpoint_is_int_out(endpoint) == FALSE)
-                               {
-                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, " Dongle does not have BCM16 Fix");
-                                       //change the EP2, EP4 to INT OUT end point and use EP4 in altsetting
+                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                       "Choosing AltSetting as a default setting.\n");
+                               if (bcm_usb_endpoint_is_int_out(endpoint) == FALSE) {
+                                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                               "Dongle does not have BCM16 Fix.\n");
+                                       /* change the EP2, EP4 to INT OUT end point and use EP4 in altsetting */
                                        ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter);
  
                                        /*
-                                       It resets the device and if any thing gets changed in USB descriptor it will show fail and
-                                       re-enumerate the device
-                                       */
+                                        * It resets the device and if any thing gets changed in
+                                        *  USB descriptor it will show fail and re-enumerate the
+                                        * device
+                                        */
                                        retval = usb_reset_device(psIntfAdapter->udev);
-                                       if(retval)
-                                       {
-                                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reset got failed. hence Re-enumerating the device \n");
-                                               return retval ;
+                                       if (retval) {
+                                               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                                                       "reset failed.  Re-enumerating the device.\n");
+                                               return retval;
                                        }
  
                                }
        }
  
        iface_desc = psIntfAdapter->interface->cur_altsetting;
-       //print_usb_interface_desc(&(iface_desc->desc));
-       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Current number of endpoints :%x \n", iface_desc->desc.bNumEndpoints);
-     for (value = 0; value < iface_desc->desc.bNumEndpoints; ++value)
-       {
-         endpoint = &iface_desc->endpoint[value].desc;
-               //print_usb_endpoint_descriptor(endpoint);
-         if (!psIntfAdapter->sBulkIn.bulk_in_endpointAddr && bcm_usb_endpoint_is_bulk_in(endpoint))
-         {
-             buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-             psIntfAdapter->sBulkIn.bulk_in_size = buffer_size;
-             psIntfAdapter->sBulkIn.bulk_in_endpointAddr =
-                                                               endpoint->bEndpointAddress;
-               psIntfAdapter->sBulkIn.bulk_in_pipe =
+       for (value = 0; value < iface_desc->desc.bNumEndpoints; ++value) {
+               endpoint = &iface_desc->endpoint[value].desc;
+               if (!psIntfAdapter->sBulkIn.bulk_in_endpointAddr && bcm_usb_endpoint_is_bulk_in(endpoint)) {
+                       buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                       psIntfAdapter->sBulkIn.bulk_in_size = buffer_size;
+                       psIntfAdapter->sBulkIn.bulk_in_endpointAddr = endpoint->bEndpointAddress;
+                       psIntfAdapter->sBulkIn.bulk_in_pipe =
                                        usb_rcvbulkpipe(psIntfAdapter->udev,
                                                                psIntfAdapter->sBulkIn.bulk_in_endpointAddr);
-         }
-         if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr && bcm_usb_endpoint_is_bulk_out(endpoint))
-         {
+               }
  
-                       psIntfAdapter->sBulkOut.bulk_out_endpointAddr =
-                                                                               endpoint->bEndpointAddress;
-               psIntfAdapter->sBulkOut.bulk_out_pipe =
-                       usb_sndbulkpipe(psIntfAdapter->udev,
+               if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr && bcm_usb_endpoint_is_bulk_out(endpoint)) {
+                       psIntfAdapter->sBulkOut.bulk_out_endpointAddr = endpoint->bEndpointAddress;
+                       psIntfAdapter->sBulkOut.bulk_out_pipe =
+                               usb_sndbulkpipe(psIntfAdapter->udev,
                                        psIntfAdapter->sBulkOut.bulk_out_endpointAddr);
-         }
-         if (!psIntfAdapter->sIntrIn.int_in_endpointAddr && bcm_usb_endpoint_is_int_in(endpoint))
-         {
-             buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-             psIntfAdapter->sIntrIn.int_in_size = buffer_size;
-             psIntfAdapter->sIntrIn.int_in_endpointAddr =
-                                                               endpoint->bEndpointAddress;
-             psIntfAdapter->sIntrIn.int_in_interval = endpoint->bInterval;
-             psIntfAdapter->sIntrIn.int_in_buffer =
+               }
+               if (!psIntfAdapter->sIntrIn.int_in_endpointAddr && bcm_usb_endpoint_is_int_in(endpoint)) {
+                       buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                       psIntfAdapter->sIntrIn.int_in_size = buffer_size;
+                       psIntfAdapter->sIntrIn.int_in_endpointAddr = endpoint->bEndpointAddress;
+                       psIntfAdapter->sIntrIn.int_in_interval = endpoint->bInterval;
+                       psIntfAdapter->sIntrIn.int_in_buffer =
                                                kmalloc(buffer_size, GFP_KERNEL);
-             if (!psIntfAdapter->sIntrIn.int_in_buffer) {
-                 BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Could not allocate interrupt_in_buffer");
-                 return -EINVAL;
-             }
-                       //psIntfAdapter->sIntrIn.int_in_pipe =
-         }
-         if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && bcm_usb_endpoint_is_int_out(endpoint))
-         {
-                       if( !psIntfAdapter->sBulkOut.bulk_out_endpointAddr &&
-                               (psIntfAdapter->psAdapter->chip_id == T3B) && (value == usedIntOutForBulkTransfer))
-                       {
-                               //use first intout end point as a bulk out end point
-               buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-               psIntfAdapter->sBulkOut.bulk_out_size = buffer_size;
-                               //printk("\nINT OUT Endpoing buffer size :%x endpoint :%x\n", buffer_size, value +1);
-                               psIntfAdapter->sBulkOut.bulk_out_endpointAddr =
-                                                                               endpoint->bEndpointAddress;
-                       psIntfAdapter->sBulkOut.bulk_out_pipe =
-                               usb_sndintpipe(psIntfAdapter->udev,
-                                       psIntfAdapter->sBulkOut.bulk_out_endpointAddr);
-                       psIntfAdapter->sBulkOut.int_out_interval = endpoint->bInterval;
+                       if (!psIntfAdapter->sIntrIn.int_in_buffer) {
+                               dev_err(&psIntfAdapter->udev->dev,
+                                       "could not allocate interrupt_in_buffer\n");
+                               return -EINVAL;
+                       }
+               }
  
+               if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && bcm_usb_endpoint_is_int_out(endpoint)) {
+                       if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr &&
+                               (psIntfAdapter->psAdapter->chip_id == T3B) && (value == usedIntOutForBulkTransfer)) {
+                               /* use first intout end point as a bulk out end point */
+                               buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                               psIntfAdapter->sBulkOut.bulk_out_size = buffer_size;
+                               psIntfAdapter->sBulkOut.bulk_out_endpointAddr = endpoint->bEndpointAddress;
+                               psIntfAdapter->sBulkOut.bulk_out_pipe = usb_sndintpipe(psIntfAdapter->udev,
+                                                                       psIntfAdapter->sBulkOut.bulk_out_endpointAddr);
+                               psIntfAdapter->sBulkOut.int_out_interval = endpoint->bInterval;
+                       } else if (value == EP6) {
+                               buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                               psIntfAdapter->sIntrOut.int_out_size = buffer_size;
+                               psIntfAdapter->sIntrOut.int_out_endpointAddr = endpoint->bEndpointAddress;
+                               psIntfAdapter->sIntrOut.int_out_interval = endpoint->bInterval;
+                               psIntfAdapter->sIntrOut.int_out_buffer= kmalloc(buffer_size, GFP_KERNEL);
+                               if (!psIntfAdapter->sIntrOut.int_out_buffer) {
+                                       dev_err(&psIntfAdapter->udev->dev,
+                                               "could not allocate interrupt_out_buffer\n");
+                                       return -EINVAL;
+                               }
                        }
-                       else if(value == EP6)
-                       {
-                   buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-                   psIntfAdapter->sIntrOut.int_out_size = buffer_size;
-                   psIntfAdapter->sIntrOut.int_out_endpointAddr =
-                                                                               endpoint->bEndpointAddress;
-                   psIntfAdapter->sIntrOut.int_out_interval = endpoint->bInterval;
-                   psIntfAdapter->sIntrOut.int_out_buffer= kmalloc(buffer_size,
-                                                                                                               GFP_KERNEL);
-                       if (!psIntfAdapter->sIntrOut.int_out_buffer)
-                                       {
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Could not allocate interrupt_out_buffer");
-                       return -EINVAL;
-             }
-         }
-     }
-       }
-     usb_set_intfdata(psIntfAdapter->interface, psIntfAdapter);
-     retval = usb_register_dev(psIntfAdapter->interface, &usbbcm_class);
-       if(retval)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "usb register dev failed = %d", retval);
-               psIntfAdapter->psAdapter->bUsbClassDriverRegistered = FALSE;
-               return retval;
-       }
-       else
-       {
-               psIntfAdapter->psAdapter->bUsbClassDriverRegistered = TRUE;
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "usb dev registered");
+               }
        }
  
+       usb_set_intfdata(psIntfAdapter->interface, psIntfAdapter);
        psIntfAdapter->psAdapter->bcm_file_download = InterfaceFileDownload;
        psIntfAdapter->psAdapter->bcm_file_readback_from_chip =
                                InterfaceFileReadbackFromChip;
  
        retval = CreateInterruptUrb(psIntfAdapter);
  
-       if(retval)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cannot create interrupt urb");
+       if (retval) {
+               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0,
+                       "Cannot create interrupt urb\n");
                return retval;
        }
  
        retval = AllocUsbCb(psIntfAdapter);
-       if(retval)
-       {
+       if (retval)
                return retval;
-       }
  
-       retval = device_run(psIntfAdapter);
-       if(retval)
-       {
-               return retval;
-       }
-       return 0;
+       return device_run(psIntfAdapter);
  }
  
- static int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
+ static int InterfaceSuspend(struct usb_interface *intf, pm_message_t message)
  {
        PS_INTERFACE_ADAPTER  psIntfAdapter = usb_get_intfdata(intf);
-       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=================================\n");
-       //Bcm_kill_all_URBs(psIntfAdapter);
        psIntfAdapter->bSuspended = TRUE;
  
-       if(TRUE == psIntfAdapter->bPreparingForBusSuspend)
-       {
+       if (TRUE == psIntfAdapter->bPreparingForBusSuspend) {
                psIntfAdapter->bPreparingForBusSuspend = FALSE;
  
-               if(psIntfAdapter->psAdapter->LinkStatus == LINKUP_DONE)
-               {
+               if (psIntfAdapter->psAdapter->LinkStatus == LINKUP_DONE) {
                        psIntfAdapter->psAdapter->IdleMode = TRUE ;
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Host Entered in PMU Idle Mode..");
-               }
-               else
-               {
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                               "Host Entered in PMU Idle Mode.\n");
+               } else {
                        psIntfAdapter->psAdapter->bShutStatus = TRUE;
-                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Host Entered in PMU Shutdown Mode..");
+                       BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
+                               "Host Entered in PMU Shutdown Mode.\n");
                }
        }
        psIntfAdapter->psAdapter->bPreparingForLowPowerMode = FALSE;
  
-       //Signaling the control pkt path
+       /* Signaling the control pkt path */
        wake_up(&psIntfAdapter->psAdapter->lowpower_mode_wait_queue);
  
        return 0;
  }
  
- static int InterfaceResume (struct usb_interface *intf)
+ static int InterfaceResume(struct usb_interface *intf)
  {
-     PS_INTERFACE_ADAPTER  psIntfAdapter = usb_get_intfdata(intf);
-       printk("=================================\n");
+       PS_INTERFACE_ADAPTER  psIntfAdapter = usb_get_intfdata(intf);
        mdelay(100);
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
-       intf->pm_usage_cnt =1 ;
- #endif
        psIntfAdapter->bSuspended = FALSE;
  
        StartInterruptUrb(psIntfAdapter);
        return 0;
  }
  
- static int InterfacePreReset(struct usb_interface *intf)
- {
-     printk("====================>");
-       return STATUS_SUCCESS;
- }
- static int InterfacePostReset(struct usb_interface *intf)
- {
-     printk("Do Post chip reset setting here if it is required");
-       return STATUS_SUCCESS;
- }
  static struct usb_driver usbbcm_driver = {
-     .name = "usbbcm",
-     .probe = usbbcm_device_probe,
-     .disconnect = usbbcm_disconnect,
-     .suspend = InterfaceSuspend,
-     .resume = InterfaceResume,
-       .pre_reset=InterfacePreReset,
-       .post_reset=InterfacePostReset,
-     .id_table = InterfaceUsbtable,
-     .supports_autosuspend = 1,
+       .name = "usbbcm",
+       .probe = usbbcm_device_probe,
+       .disconnect = usbbcm_disconnect,
+       .suspend = InterfaceSuspend,
+       .resume = InterfaceResume,
+       .id_table = InterfaceUsbtable,
+       .supports_autosuspend = 1,
  };
  
+ struct class *bcm_class;
  
- /*
- Function:                             InterfaceInitialize
- Description:                  This is the hardware specific initialization Function.
-                                               Registering the driver with NDIS , other device specific NDIS
-                                               and hardware initializations are done here.
- Input parameters:             IN PMINI_ADAPTER Adapter   - Miniport Adapter Context
+ static __init int bcm_init(void)
+ {
+       printk(KERN_INFO "%s: %s, %s\n", DRV_NAME, DRV_DESCRIPTION, DRV_VERSION);
+       printk(KERN_INFO "%s\n", DRV_COPYRIGHT);
  
+       bcm_class = class_create(THIS_MODULE, DRV_NAME);
+       if (IS_ERR(bcm_class)) {
+               printk(KERN_ERR DRV_NAME ": could not create class\n");
+               return PTR_ERR(bcm_class);
+       }
  
- Return:                                       BCM_STATUS_SUCCESS - If Initialization of the
-                                               HW Interface was successful.
-                                               Other           - If an error occured.
- */
- INT InterfaceInitialize(void)
- {
- //    BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Registering Usb driver!!");
        return usb_register(&usbbcm_driver);
  }
  
INT InterfaceExit(void)
static __exit void bcm_exit(void)
  {
-       //PMINI_ADAPTER psAdapter = NULL;
-       int status = 0;
-       //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Deregistering Usb driver!!");
        usb_deregister(&usbbcm_driver);
-       return status;
+       class_destroy(bcm_class);
  }
- MODULE_LICENSE ("GPL");
+ module_init(bcm_init);
+ module_exit(bcm_exit);
+ MODULE_DESCRIPTION(DRV_DESCRIPTION);
+ MODULE_VERSION(DRV_VERSION);
+ MODULE_LICENSE("GPL");
@@@ -20,8 -20,6 +20,8 @@@
   *
   */
  
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/device.h>
  
  #define AUDIO_SRAM_CHANNEL    SRAM_CH08
  
 -#define dprintk(level, fmt, arg...)   if (debug >= level) \
 -      printk(KERN_INFO "%s/1: " fmt, chip->dev->name , ## arg)
 -
 -#define dprintk_core(level, fmt, arg...)      if (debug >= level) \
 -      printk(KERN_DEBUG "%s/1: " fmt, chip->dev->name , ## arg)
 +#define dprintk(level, fmt, arg...)                           \
 +do {                                                          \
 +      if (debug >= level)                                     \
 +              pr_info("%s/1: " fmt, chip->dev->name, ##arg);  \
 +} while (0)
 +#define dprintk_core(level, fmt, arg...)                              \
 +do {                                                                  \
 +      if (debug >= level)                                             \
 +              printk(KERN_DEBUG "%s/1: " fmt, chip->dev->name, ##arg); \
 +} while (0)
  
  /****************************************************************************
        Data type declarations - Can be moded to a header file later
@@@ -180,11 -173,12 +180,11 @@@ static int _cx25821_start_audio_dma(str
                 tmp | FLD_AUD_DST_PK_MODE | FLD_AUD_DST_ENABLE |
                 FLD_AUD_CLK_ENABLE);
  
 -      /* printk(KERN_INFO "DEBUG: Start audio DMA, %d B/line,"
 -                              "cmds_start(0x%x)= %d lines/FIFO, %d periods, "
 -                              "%d byte buffer\n", buf->bpl,
 -                              audio_ch->cmds_start,
 -                              cx_read(audio_ch->cmds_start + 12)>>1,
 -                              chip->num_periods, buf->bpl *chip->num_periods);
 +      /*
 +      pr_info("DEBUG: Start audio DMA, %d B/line, cmds_start(0x%x)= %d lines/FIFO, %d periods, %d byte buffer\n",
 +              buf->bpl, audio_ch->cmds_start,
 +              cx_read(audio_ch->cmds_start + 12)>>1,
 +              chip->num_periods, buf->bpl * chip->num_periods);
        */
  
        /* Enables corresponding bits at AUD_INT_STAT */
@@@ -265,7 -259,8 +265,7 @@@ static void cx25821_aud_irq(struct cx25
  
        /* risc op code error */
        if (status & AUD_INT_OPC_ERR) {
 -              printk(KERN_WARNING "WARNING %s/1: Audio risc op code error\n",
 -                     dev->name);
 +              pr_warn("WARNING %s/1: Audio risc op code error\n", dev->name);
  
                cx_clear(AUD_INT_DMA_CTL,
                         FLD_AUD_DST_A_RISC_EN | FLD_AUD_DST_A_FIFO_EN);
                                                [AUDIO_SRAM_CHANNEL]);
        }
        if (status & AUD_INT_DN_SYNC) {
 -              printk(KERN_WARNING "WARNING %s: Downstream sync error!\n",
 -                     dev->name);
 +              pr_warn("WARNING %s: Downstream sync error!\n", dev->name);
                cx_write(AUD_A_GPCNT_CTL, GP_COUNT_CONTROL_RESET);
                return;
        }
@@@ -392,7 -388,8 +392,7 @@@ static int snd_cx25821_pcm_open(struct 
        unsigned int bpl = 0;
  
        if (!chip) {
 -              printk(KERN_ERR "DEBUG: cx25821 can't find device struct."
 -                     " Can't proceed with open\n");
 +              pr_err("DEBUG: cx25821 can't find device struct. Can't proceed with open\n");
                return -ENODEV;
        }
  
@@@ -482,7 -479,8 +482,7 @@@ static int snd_cx25821_hw_params(struc
                                          chip->period_size, chip->num_periods,
                                          1);
        if (ret < 0) {
 -              printk(KERN_INFO
 -                      "DEBUG: ERROR after cx25821_risc_databuffer_audio()\n");
 +              pr_info("DEBUG: ERROR after cx25821_risc_databuffer_audio()\n");
                goto error;
        }
  
@@@ -610,7 -608,8 +610,7 @@@ static int snd_cx25821_pcm(struct cx258
  
        err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm);
        if (err < 0) {
 -              printk(KERN_INFO "ERROR: FAILED snd_pcm_new() in %s\n",
 -                     __func__);
 +              pr_info("ERROR: FAILED snd_pcm_new() in %s\n", __func__);
                return err;
        }
        pcm->private_data = chip;
   * Only boards with eeprom and byte 1 at eeprom=1 have it
   */
  
- static const struct pci_device_id cx25821_audio_pci_tbl[] __devinitdata = {
+ static DEFINE_PCI_DEVICE_TABLE(cx25821_audio_pci_tbl) = {
        {0x14f1, 0x0920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {0,}
  };
@@@ -675,21 -674,23 +675,21 @@@ static int cx25821_audio_initdev(struc
        int err;
  
        if (devno >= SNDRV_CARDS) {
 -              printk(KERN_INFO "DEBUG ERROR: devno >= SNDRV_CARDS %s\n",
 -                     __func__);
 +              pr_info("DEBUG ERROR: devno >= SNDRV_CARDS %s\n", __func__);
                return -ENODEV;
        }
  
        if (!enable[devno]) {
                ++devno;
 -              printk(KERN_INFO "DEBUG ERROR: !enable[devno] %s\n", __func__);
 +              pr_info("DEBUG ERROR: !enable[devno] %s\n", __func__);
                return -ENOENT;
        }
  
        err = snd_card_create(index[devno], id[devno], THIS_MODULE,
                         sizeof(struct cx25821_audio_dev), &card);
        if (err < 0) {
 -              printk(KERN_INFO
 -                     "DEBUG ERROR: cannot create snd_card_new in %s\n",
 -                     __func__);
 +              pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n",
 +                      __func__);
                return err;
        }
  
                          IRQF_SHARED | IRQF_DISABLED, chip->dev->name, chip);
  
        if (err < 0) {
 -              printk(KERN_ERR "ERROR %s: can't get IRQ %d for ALSA\n",
 +              pr_err("ERROR %s: can't get IRQ %d for ALSA\n",
                       chip->dev->name, dev->pci->irq);
                goto error;
        }
  
        err = snd_cx25821_pcm(chip, 0, "cx25821 Digital");
        if (err < 0) {
 -              printk(KERN_INFO
 -                     "DEBUG ERROR: cannot create snd_cx25821_pcm %s\n",
 -                     __func__);
 +              pr_info("DEBUG ERROR: cannot create snd_cx25821_pcm %s\n",
 +                      __func__);
                goto error;
        }
  
                chip->iobase, chip->irq);
        strcpy(card->mixername, "CX25821");
  
 -      printk(KERN_INFO "%s/%i: ALSA support for cx25821 boards\n",
 -             card->driver, devno);
 +      pr_info("%s/%i: ALSA support for cx25821 boards\n",
 +              card->driver, devno);
  
        err = snd_card_register(card);
        if (err < 0) {
 -              printk(KERN_INFO "DEBUG ERROR: cannot register sound card %s\n",
 -                     __func__);
 +              pr_info("DEBUG ERROR: cannot register sound card %s\n",
 +                      __func__);
                goto error;
        }
  
@@@ -776,7 -778,8 +776,7 @@@ static int cx25821_alsa_init(void
        }
  
        if (dev == NULL)
 -              printk(KERN_INFO
 -                     "cx25821 ERROR ALSA: no cx25821 cards found\n");
 +              pr_info("ERROR ALSA: no cx25821 cards found\n");
  
        return 0;
  
@@@ -435,6 -435,12 +435,6 @@@ static int zram_make_request(struct req
        int ret = 0;
        struct zram *zram = queue->queuedata;
  
 -      if (unlikely(!zram->init_done)) {
 -              set_bit(BIO_UPTODATE, &bio->bi_flags);
 -              bio_endio(bio, 0);
 -              return 0;
 -      }
 -
        if (!valid_io_request(zram, bio)) {
                zram_stat64_inc(zram, &zram->stats.invalid_io);
                bio_io_error(bio);
@@@ -527,7 -533,7 +527,7 @@@ int zram_init_device(struct zram *zram
        }
  
        num_pages = zram->disksize >> PAGE_SHIFT;
-       zram->table = vmalloc(num_pages * sizeof(*zram->table));
+       zram->table = vzalloc(num_pages * sizeof(*zram->table));
        if (!zram->table) {
                pr_err("Error allocating zram address table\n");
                /* To prevent accessing table entries during cleanup */
                ret = -ENOMEM;
                goto fail;
        }
-       memset(zram->table, 0, num_pages * sizeof(*zram->table));
  
        set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
  
@@@ -615,7 -615,6 +615,6 @@@ static const struct usb_device_id optio
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0004, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0005, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0006, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0007, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0008, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0009, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000a, 0xff, 0xff, 0xff) },
@@@ -989,7 -988,6 +988,7 @@@ static struct usb_serial_driver option_
        .set_termios       = usb_wwan_set_termios,
        .tiocmget          = usb_wwan_tiocmget,
        .tiocmset          = usb_wwan_tiocmset,
 +      .ioctl             = usb_wwan_ioctl,
        .attach            = usb_wwan_startup,
        .disconnect        = usb_wwan_disconnect,
        .release           = usb_wwan_release,
diff --combined drivers/video/udlfb.c
@@@ -16,8 -16,6 +16,8 @@@
   * from Florian Echtler, Henrik Bjerregaard Pedersen, and others.
   */
  
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
@@@ -28,8 -26,8 +28,8 @@@
  #include <linux/vmalloc.h>
  #include <linux/slab.h>
  #include <linux/delay.h>
 -
 -#include "udlfb.h"
 +#include <video/udlfb.h>
 +#include "edid.h"
  
  static struct fb_fix_screeninfo dlfb_fix = {
        .id =           "udlfb",
@@@ -42,7 -40,9 +42,7 @@@
  };
  
  static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST |
 -#ifdef FBINFO_VIRTFB
                FBINFO_VIRTFB |
 -#endif
                FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT |
                FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR;
  
@@@ -293,7 -293,7 +293,7 @@@ static int dlfb_ops_mmap(struct fb_inf
  
        pos = (unsigned long)info->fix.smem_start + offset;
  
 -      dl_notice("mmap() framebuffer addr:%lu size:%lu\n",
 +      pr_notice("mmap() framebuffer addr:%lu size:%lu\n",
                  pos, size);
  
        while (size > 0) {
@@@ -595,6 -595,18 +595,6 @@@ error
        return 0;
  }
  
 -static ssize_t dlfb_ops_read(struct fb_info *info, char __user *buf,
 -                       size_t count, loff_t *ppos)
 -{
 -      ssize_t result = -ENOSYS;
 -
 -#if defined CONFIG_FB_SYS_FOPS || defined CONFIG_FB_SYS_FOPS_MODULE
 -      result = fb_sys_read(info, buf, count, ppos);
 -#endif
 -
 -      return result;
 -}
 -
  /*
   * Path triggered by usermode clients who write to filesystem
   * e.g. cat filename > /dev/fb1
  static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf,
                          size_t count, loff_t *ppos)
  {
 -      ssize_t result = -ENOSYS;
 +      ssize_t result;
        struct dlfb_data *dev = info->par;
        u32 offset = (u32) *ppos;
  
 -#if defined CONFIG_FB_SYS_FOPS || defined CONFIG_FB_SYS_FOPS_MODULE
 -
        result = fb_sys_write(info, buf, count, ppos);
  
        if (result > 0) {
                dlfb_handle_damage(dev, 0, start, info->var.xres,
                        lines, info->screen_base);
        }
 -#endif
  
        return result;
  }
@@@ -629,10 -644,14 +629,10 @@@ static void dlfb_ops_copyarea(struct fb
  
        struct dlfb_data *dev = info->par;
  
 -#if defined CONFIG_FB_SYS_COPYAREA || defined CONFIG_FB_SYS_COPYAREA_MODULE
 -
        sys_copyarea(info, area);
  
        dlfb_handle_damage(dev, area->dx, area->dy,
                        area->width, area->height, info->screen_base);
 -#endif
 -
  }
  
  static void dlfb_ops_imageblit(struct fb_info *info,
  {
        struct dlfb_data *dev = info->par;
  
 -#if defined CONFIG_FB_SYS_IMAGEBLIT || defined CONFIG_FB_SYS_IMAGEBLIT_MODULE
 -
        sys_imageblit(info, image);
  
        dlfb_handle_damage(dev, image->dx, image->dy,
                        image->width, image->height, info->screen_base);
 -
 -#endif
 -
  }
  
  static void dlfb_ops_fillrect(struct fb_info *info,
  {
        struct dlfb_data *dev = info->par;
  
 -#if defined CONFIG_FB_SYS_FILLRECT || defined CONFIG_FB_SYS_FILLRECT_MODULE
 -
        sys_fillrect(info, rect);
  
        dlfb_handle_damage(dev, rect->dx, rect->dy, rect->width,
                              rect->height, info->screen_base);
 -#endif
 -
  }
  
 -#ifdef CONFIG_FB_DEFERRED_IO
  /*
   * NOTE: fb_defio.c is holding info->fbdefio.mutex
   *   Touching ANY framebuffer memory that triggers a page fault
@@@ -718,6 -747,8 +718,6 @@@ error
                   &dev->cpu_kcycles_used);
  }
  
 -#endif
 -
  static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len)
  {
        int i;
                                    (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
                                    HZ);
                if (ret < 1) {
 -                      dl_err("Read EDID byte %d failed err %x\n", i, ret);
 +                      pr_err("Read EDID byte %d failed err %x\n", i, ret);
                        i--;
                        break;
                }
@@@ -850,6 -881,7 +850,6 @@@ static int dlfb_ops_open(struct fb_inf
  
        kref_get(&dev->kref);
  
 -#ifdef CONFIG_FB_DEFERRED_IO
        if (fb_defio && (info->fbdefio == NULL)) {
                /* enable defio at last moment if not disabled by client */
  
                info->fbdefio = fbdefio;
                fb_deferred_io_init(info);
        }
 -#endif
  
 -      dl_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
 +      pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
            info->node, user, info, dev->fb_count);
  
        return 0;
@@@ -890,7 -923,7 +890,7 @@@ static void dlfb_free(struct kref *kref
  
        kfree(dev->edid);
  
 -      dl_warn("freeing dlfb_data %p\n", dev);
 +      pr_warn("freeing dlfb_data %p\n", dev);
  
        kfree(dev);
  }
@@@ -926,7 -959,7 +926,7 @@@ static void dlfb_free_framebuffer_work(
        /* Assume info structure is freed after this point */
        framebuffer_release(info);
  
 -      dl_warn("fb_info for /dev/fb%d has been freed\n", node);
 +      pr_warn("fb_info for /dev/fb%d has been freed\n", node);
  
        /* ref taken in probe() as part of registering framebfufer */
        kref_put(&dev->kref, dlfb_free);
@@@ -945,14 -978,16 +945,14 @@@ static int dlfb_ops_release(struct fb_i
        if (dev->virtualized && (dev->fb_count == 0))
                schedule_delayed_work(&dev->free_framebuffer_work, HZ);
  
 -#ifdef CONFIG_FB_DEFERRED_IO
        if ((dev->fb_count == 0) && (info->fbdefio)) {
                fb_deferred_io_cleanup(info);
                kfree(info->fbdefio);
                info->fbdefio = NULL;
                info->fbops->fb_mmap = dlfb_ops_mmap;
        }
 -#endif
  
 -      dl_warn("released /dev/fb%d user=%d count=%d\n",
 +      pr_warn("released /dev/fb%d user=%d count=%d\n",
                  info->node, user, dev->fb_count);
  
        kref_put(&dev->kref, dlfb_free);
@@@ -970,12 -1005,12 +970,12 @@@ static int dlfb_is_valid_mode(struct fb
        struct dlfb_data *dev = info->par;
  
        if (mode->xres * mode->yres > dev->sku_pixel_limit) {
 -              dl_warn("%dx%d beyond chip capabilities\n",
 +              pr_warn("%dx%d beyond chip capabilities\n",
                       mode->xres, mode->yres);
                return 0;
        }
  
 -      dl_info("%dx%d valid mode\n", mode->xres, mode->yres);
 +      pr_info("%dx%d valid mode\n", mode->xres, mode->yres);
  
        return 1;
  }
@@@ -1019,7 -1054,7 +1019,7 @@@ static int dlfb_ops_set_par(struct fb_i
        u16 *pix_framebuffer;
        int i;
  
 -      dl_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres);
 +      pr_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres);
  
        result = dlfb_set_video_mode(dev, &info->var);
  
@@@ -1069,7 -1104,7 +1069,7 @@@ static int dlfb_ops_blank(int blank_mod
  
  static struct fb_ops dlfb_ops = {
        .owner = THIS_MODULE,
 -      .fb_read = dlfb_ops_read,
 +      .fb_read = fb_sys_read,
        .fb_write = dlfb_ops_write,
        .fb_setcolreg = dlfb_ops_setcolreg,
        .fb_fillrect = dlfb_ops_fillrect,
@@@ -1098,7 -1133,7 +1098,7 @@@ static int dlfb_realloc_framebuffer(str
        unsigned char *new_fb;
        unsigned char *new_back;
  
 -      dl_warn("Reallocating framebuffer. Addresses will change!\n");
 +      pr_warn("Reallocating framebuffer. Addresses will change!\n");
  
        new_len = info->fix.line_length * info->var.yres;
  
                 */
                new_fb = vmalloc(new_len);
                if (!new_fb) {
 -                      dl_err("Virtual framebuffer alloc failed\n");
 +                      pr_err("Virtual framebuffer alloc failed\n");
                        goto error;
                }
  
                 * But with imperfect damage info we may send pixels over USB
                 * that were, in fact, unchanged - wasting limited USB bandwidth
                 */
-               new_back = vmalloc(new_len);
+               new_back = vzalloc(new_len);
                if (!new_back)
-                       pr_info("No shadow/backing buffer allcoated\n");
 -                      dl_info("No shadow/backing buffer allocated\n");
++                      pr_info("No shadow/backing buffer allocated\n");
                else {
                        if (dev->backing_buffer)
                                vfree(dev->backing_buffer);
                        dev->backing_buffer = new_back;
-                       memset(dev->backing_buffer, 0, new_len);
                }
        }
  
@@@ -1172,7 -1206,7 +1171,7 @@@ static int dlfb_setup_modes(struct dlfb
        if (info->dev) /* only use mutex if info has been registered */
                mutex_lock(&info->lock);
  
 -      edid = kmalloc(MAX_EDID_SIZE, GFP_KERNEL);
 +      edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
        if (!edid) {
                result = -ENOMEM;
                goto error;
         */
        while (tries--) {
  
 -              i = dlfb_get_edid(dev, edid, MAX_EDID_SIZE);
 +              i = dlfb_get_edid(dev, edid, EDID_LENGTH);
  
 -              if (i >= MIN_EDID_SIZE)
 +              if (i >= EDID_LENGTH)
                        fb_edid_to_monspecs(edid, &info->monspecs);
  
                if (info->monspecs.modedb_len > 0) {
        /* If that fails, use a previously returned EDID if available */
        if (info->monspecs.modedb_len == 0) {
  
 -              dl_err("Unable to get valid EDID from device/display\n");
 +              pr_err("Unable to get valid EDID from device/display\n");
  
                if (dev->edid) {
                        fb_edid_to_monspecs(dev->edid, &info->monspecs);
                        if (info->monspecs.modedb_len > 0)
 -                              dl_err("Using previously queried EDID\n");
 +                              pr_err("Using previously queried EDID\n");
                }
        }
  
        /* If that fails, use the default EDID we were handed */
        if (info->monspecs.modedb_len == 0) {
 -              if (default_edid_size >= MIN_EDID_SIZE) {
 +              if (default_edid_size >= EDID_LENGTH) {
                        fb_edid_to_monspecs(default_edid, &info->monspecs);
                        if (info->monspecs.modedb_len > 0) {
                                memcpy(edid, default_edid, default_edid_size);
                                dev->edid = edid;
                                dev->edid_size = default_edid_size;
 -                              dl_err("Using default/backup EDID\n");
 +                              pr_err("Using default/backup EDID\n");
                        }
                }
        }
@@@ -1346,7 -1380,7 +1345,7 @@@ static ssize_t edid_show
        if (off + count > dev->edid_size)
                count = dev->edid_size - off;
  
 -      dl_info("sysfs edid copy %p to %p, %d bytes\n",
 +      pr_info("sysfs edid copy %p to %p, %d bytes\n",
                dev->edid, buf, (int) count);
  
        memcpy(buf, dev->edid, count);
@@@ -1363,13 -1397,15 +1362,13 @@@ static ssize_t edid_store
        struct dlfb_data *dev = fb_info->par;
  
        /* We only support write of entire EDID at once, no offset*/
 -      if ((src_size < MIN_EDID_SIZE) ||
 -          (src_size > MAX_EDID_SIZE) ||
 -          (src_off != 0))
 +      if ((src_size != EDID_LENGTH) || (src_off != 0))
                return 0;
  
        dlfb_setup_modes(dev, fb_info, src, src_size);
  
        if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) {
 -              dl_info("sysfs written EDID is new default\n");
 +              pr_info("sysfs written EDID is new default\n");
                dlfb_ops_set_par(fb_info);
                return src_size;
        } else
@@@ -1394,7 -1430,7 +1393,7 @@@ static ssize_t metrics_reset_store(stru
  static struct bin_attribute edid_attr = {
        .attr.name = "edid",
        .attr.mode = 0666,
 -      .size = MAX_EDID_SIZE,
 +      .size = EDID_LENGTH,
        .read = edid_show,
        .write = edid_store
  };
@@@ -1442,7 -1478,7 +1441,7 @@@ static int dlfb_parse_vendor_descriptor
        total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */
                                    0, desc, MAX_VENDOR_DESCRIPTOR_SIZE);
        if (total_len > 5) {
 -              dl_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \
 +              pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \
                        "%02x %02x %02x %02x %02x %02x %02x\n",
                        total_len, desc[0],
                        desc[1], desc[2], desc[3], desc[4], desc[5], desc[6],
                        case 0x0200: { /* max_area */
                                u32 max_area;
                                max_area = le32_to_cpu(*((u32 *)desc));
 -                              dl_warn("DL chip limited to %d pixel modes\n",
 +                              pr_warn("DL chip limited to %d pixel modes\n",
                                        max_area);
                                dev->sku_pixel_limit = max_area;
                                break;
  
  unrecognized:
        /* allow udlfb to load for now even if firmware unrecognized */
 -      dl_err("Unrecognized vendor firmware descriptor\n");
 +      pr_err("Unrecognized vendor firmware descriptor\n");
  
  success:
        kfree(buf);
@@@ -1520,24 -1556,24 +1519,24 @@@ static int dlfb_usb_probe(struct usb_in
        dev->gdev = &usbdev->dev; /* our generic struct device * */
        usb_set_intfdata(interface, dev);
  
 -      dl_info("%s %s - serial #%s\n",
 +      pr_info("%s %s - serial #%s\n",
                usbdev->manufacturer, usbdev->product, usbdev->serial);
 -      dl_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n",
 +      pr_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n",
                usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
                usbdev->descriptor.bcdDevice, dev);
 -      dl_info("console enable=%d\n", console);
 -      dl_info("fb_defio enable=%d\n", fb_defio);
 +      pr_info("console enable=%d\n", console);
 +      pr_info("fb_defio enable=%d\n", fb_defio);
  
        dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */
  
        if (!dlfb_parse_vendor_descriptor(dev, usbdev)) {
 -              dl_err("firmware not recognized. Assume incompatible device\n");
 +              pr_err("firmware not recognized. Assume incompatible device\n");
                goto error;
        }
  
        if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
                retval = -ENOMEM;
 -              dl_err("dlfb_alloc_urb_list failed\n");
 +              pr_err("dlfb_alloc_urb_list failed\n");
                goto error;
        }
  
        info = framebuffer_alloc(0, &usbdev->dev);
        if (!info) {
                retval = -ENOMEM;
 -              dl_err("framebuffer_alloc failed\n");
 +              pr_err("framebuffer_alloc failed\n");
                goto error;
        }
  
  
        retval = fb_alloc_cmap(&info->cmap, 256, 0);
        if (retval < 0) {
 -              dl_err("fb_alloc_cmap failed %x\n", retval);
 +              pr_err("fb_alloc_cmap failed %x\n", retval);
                goto error;
        }
  
  
        retval = dlfb_setup_modes(dev, info, NULL, 0);
        if (retval != 0) {
 -              dl_err("unable to find common mode for display and adapter\n");
 +              pr_err("unable to find common mode for display and adapter\n");
                goto error;
        }
  
  
        retval = register_framebuffer(info);
        if (retval < 0) {
 -              dl_err("register_framebuffer failed %d\n", retval);
 +              pr_err("register_framebuffer failed %d\n", retval);
                goto error;
        }
  
  
        device_create_bin_file(info->dev, &edid_attr);
  
 -      dl_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
 +      pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
                        " Using %dK framebuffer memory\n", info->node,
                        info->var.xres, info->var.yres,
                        ((dev->backing_buffer) ?
@@@ -1636,7 -1672,7 +1635,7 @@@ static void dlfb_usb_disconnect(struct 
        dev = usb_get_intfdata(interface);
        info = dev->info;
  
 -      dl_info("USB disconnect starting\n");
 +      pr_info("USB disconnect starting\n");
  
        /* we virtualize until all fb clients release. Then we free */
        dev->virtualized = true;
@@@ -1700,7 -1736,7 +1699,7 @@@ static void dlfb_urb_completion(struct 
                if (!(urb->status == -ENOENT ||
                    urb->status == -ECONNRESET ||
                    urb->status == -ESHUTDOWN)) {
 -                      dl_err("%s - nonzero write bulk status received: %d\n",
 +                      pr_err("%s - nonzero write bulk status received: %d\n",
                                __func__, urb->status);
                        atomic_set(&dev->lost_pixels, 1);
                }
@@@ -1732,7 -1768,7 +1731,7 @@@ static void dlfb_free_urb_list(struct d
        int ret;
        unsigned long flags;
  
 -      dl_notice("Waiting for completes and freeing all render urbs\n");
 +      pr_notice("Waiting for completes and freeing all render urbs\n");
  
        /* keep waiting and freeing, until we've got 'em all */
        while (count--) {
@@@ -1811,7 -1847,7 +1810,7 @@@ static int dlfb_alloc_urb_list(struct d
        dev->urbs.count = i;
        dev->urbs.available = i;
  
 -      dl_notice("allocated %d %d byte urbs\n", i, (int) size);
 +      pr_notice("allocated %d %d byte urbs\n", i, (int) size);
  
        return i;
  }
@@@ -1828,7 -1864,7 +1827,7 @@@ static struct urb *dlfb_get_urb(struct 
        ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT);
        if (ret) {
                atomic_set(&dev->lost_pixels, 1);
 -              dl_warn("wait for urb interrupted: %x available: %d\n",
 +              pr_warn("wait for urb interrupted: %x available: %d\n",
                       ret, dev->urbs.available);
                goto error;
        }
@@@ -1860,7 -1896,7 +1859,7 @@@ static int dlfb_submit_urb(struct dlfb_
        if (ret) {
                dlfb_urb_completion(urb); /* because no one else will */
                atomic_set(&dev->lost_pixels, 1);
 -              dl_err("usb_submit_urb error %x\n", ret);
 +              pr_err("usb_submit_urb error %x\n", ret);
        }
        return ret;
  }