]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'staging/staging-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:52:43 +0000 (14:52 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:52:43 +0000 (14:52 +1100)
46 files changed:
1  2 
Documentation/devicetree/bindings/vendor-prefixes.txt
MAINTAINERS
drivers/iio/adc/max1027.c
drivers/iio/adc/mcp320x.c
drivers/iio/adc/ti-adc128s052.c
drivers/iio/amplifiers/ad8366.c
drivers/iio/dac/ad5504.c
drivers/iio/dac/ad7303.c
drivers/iio/frequency/adf4350.c
drivers/iio/proximity/as3935.c
drivers/staging/fbtft/fbtft.h
drivers/staging/fbtft/flexfb.c
drivers/staging/iio/accel/lis3l02dq_core.c
drivers/staging/iio/accel/sca3000_core.c
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7280a.c
drivers/staging/iio/adc/ad7606_spi.c
drivers/staging/iio/adc/ad7780.c
drivers/staging/iio/adc/ad7816.c
drivers/staging/iio/frequency/ad9834.c
drivers/staging/iio/gyro/adis16060_core.c
drivers/staging/iio/magnetometer/hmc5843_spi.c
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7754.c
drivers/staging/iio/meter/ade7758_core.c
drivers/staging/iio/meter/ade7759.c
drivers/staging/iio/meter/ade7854-spi.c
drivers/staging/iio/resolver/ad2s1210.c
drivers/staging/iio/resolver/ad2s90.c
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/media/lirc/lirc_sasem.c
drivers/staging/media/omap4iss/iss.c
drivers/staging/media/omap4iss/iss_video.c
drivers/staging/mt29f_spinand/mt29f_spinand.c
drivers/staging/rdma/amso1100/c2_qp.c
drivers/staging/rdma/hfi1/mr.c
drivers/staging/rdma/hfi1/rc.c
drivers/staging/rdma/hfi1/ruc.c
drivers/staging/rdma/hfi1/verbs.c
drivers/staging/rdma/hfi1/verbs.h
drivers/staging/rdma/ipath/ipath_ruc.c
drivers/staging/rdma/ipath/ipath_ud.c
drivers/staging/rdma/ipath/ipath_verbs.c
include/linux/fb.h

index abc34e3652eaa9cf65c016a37c2da60ea0eaecae,13e54a0e78b9b50878226a479693d3f37863ea16..55df1d444e9f82c150ef144c02357d13169ead31
@@@ -34,7 -34,6 +34,7 @@@ avago Avago Technologie
  avic  Shanghai AVIC Optoelectronics Co., Ltd.
  axis  Axis Communications AB
  bosch Bosch Sensortec GmbH
 +boundary      Boundary Devices Inc.
  brcm  Broadcom Corporation
  buffalo       Buffalo, Inc.
  calxeda       Calxeda
@@@ -52,7 -51,6 +52,7 @@@ cirrus        Cirrus Logic, Inc
  cloudengines  Cloud Engines, Inc.
  cnm   Chips&Media, Inc.
  cnxt  Conexant Systems, Inc.
 +compulab      CompuLab Ltd.
  cortina       Cortina Systems, Inc.
  cosmic        Cosmic Circuits
  crystalfontz  Crystalfontz America, Inc.
@@@ -84,7 -82,6 +84,7 @@@ everspin      Everspin Technologies, Inc
  excito        Excito
  fcs   Fairchild Semiconductor
  firefly       Firefly
 +focaltech     FocalTech Systems Co.,Ltd
  fsl   Freescale Semiconductor
  GEFanuc       GE Fanuc Intelligent Platforms Embedded Systems, Inc.
  gef   GE Fanuc Intelligent Platforms Embedded Systems, Inc.
@@@ -104,6 -101,7 +104,7 @@@ himax      Himax Technologies, Inc
  hisilicon     Hisilicon Limited.
  hit   Hitachi Ltd.
  hitex Hitex Development Tools
+ holt  Holt Integrated Circuits, Inc.
  honeywell     Honeywell
  hp    Hewlett Packard
  i2se  I2SE GmbH
@@@ -171,8 -169,8 +172,9 @@@ pericom    Pericom Technology Inc
  phytec        PHYTEC Messtechnik GmbH
  picochip      Picochip Ltd
  plathome      Plat'Home Co., Ltd.
 +plda  PLDA
  pixcir  PIXCIR MICROELECTRONICS Co., Ltd
+ pulsedlight   PulsedLight, Inc
  powervr       PowerVR (deprecated, use img)
  qca   Qualcomm Atheros, Inc.
  qcom  Qualcomm Technologies, Inc
@@@ -195,8 -193,8 +197,9 @@@ sbs        Smart Battery Syste
  schindler     Schindler
  seagate       Seagate Technology PLC
  semtech       Semtech Corporation
+ sgx   SGX Sensortech
  sharp Sharp Corporation
 +sigma Sigma Designs, Inc.
  sil   Silicon Image
  silabs        Silicon Laboratories
  siliconmitus  Silicon Mitus, Inc.
@@@ -227,8 -225,8 +230,9 @@@ toradex    Toradex A
  toshiba       Toshiba Corporation
  toumaz        Toumaz
  tplink        TP-LINK Technologies Co., Ltd.
 +tronfy        Tronfy
  truly Truly Semiconductors Limited
+ upisemi       uPI Semiconductor Corp.
  usi   Universal Scientific Industrial Co., Ltd.
  v3    V3 Semiconductor
  variscite     Variscite Ltd.
diff --combined MAINTAINERS
index e059bae82c07da28d15023dcdcb1922e655edfb8,cc27aef2c906d26a14e9cfd1085800429f7660f7..40423a912f9da749859f3e9de20d9e05fae3f89a
@@@ -240,12 -240,6 +240,12 @@@ L:       lm-sensors@lm-sensors.or
  S:    Maintained
  F:    drivers/hwmon/abituguru3.c
  
 +ACCES 104-IDIO-16 GPIO DRIVER
 +M:    "William Breathitt Gray" <vilhelm.gray@gmail.com>
 +L:    linux-gpio@vger.kernel.org
 +S:    Maintained
 +F:    drivers/gpio/gpio-104-idio-16.c
 +
  ACENIC DRIVER
  M:    Jes Sorensen <jes@trained-monkey.org>
  L:    linux-acenic@sunsite.dk
@@@ -660,6 -654,11 +660,6 @@@ F:        drivers/gpu/drm/radeon/radeon_kfd.
  F:    drivers/gpu/drm/radeon/radeon_kfd.h
  F:    include/uapi/linux/kfd_ioctl.h
  
 -AMD MICROCODE UPDATE SUPPORT
 -M:    Borislav Petkov <bp@alien8.de>
 -S:    Maintained
 -F:    arch/x86/kernel/cpu/microcode/amd*
 -
  AMD XGBE DRIVER
  M:    Tom Lendacky <thomas.lendacky@amd.com>
  L:    netdev@vger.kernel.org
@@@ -789,11 -788,6 +789,11 @@@ S:       Maintaine
  F:    drivers/net/appletalk/
  F:    net/appletalk/
  
 +APPLIED MICRO (APM) X-GENE DEVICE TREE SUPPORT
 +M:    Duc Dang <dhdang@apm.com>
 +S:    Supported
 +F:    arch/arm64/boot/dts/apm/
 +
  APPLIED MICRO (APM) X-GENE SOC ETHERNET DRIVER
  M:    Iyappan Subramanian <isubramanian@apm.com>
  M:    Keyur Chudgar <kchudgar@apm.com>
@@@ -828,13 -822,12 +828,13 @@@ F:      arch/arm/include/asm/floppy.
  
  ARM PMU PROFILING AND DEBUGGING
  M:    Will Deacon <will.deacon@arm.com>
 +R:    Mark Rutland <mark.rutland@arm.com>
  S:    Maintained
 -F:    arch/arm/kernel/perf_*
 +F:    arch/arm*/kernel/perf_*
  F:    arch/arm/oprofile/common.c
 -F:    arch/arm/kernel/hw_breakpoint.c
 -F:    arch/arm/include/asm/hw_breakpoint.h
 -F:    arch/arm/include/asm/perf_event.h
 +F:    arch/arm*/kernel/hw_breakpoint.c
 +F:    arch/arm*/include/asm/hw_breakpoint.h
 +F:    arch/arm*/include/asm/perf_event.h
  F:    drivers/perf/arm_pmu.c
  F:    include/linux/perf/arm_pmu.h
  
@@@ -925,7 -918,7 +925,7 @@@ M: Tsahee Zidenberg <tsahee@annapurnala
  S:    Maintained
  F:    arch/arm/mach-alpine/
  
 -ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES
 +ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT
  M:    Nicolas Ferre <nicolas.ferre@atmel.com>
  M:    Alexandre Belloni <alexandre.belloni@free-electrons.com>
  M:    Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
@@@ -1238,13 -1231,6 +1238,13 @@@ ARM/LPC18XX ARCHITECTUR
  M:    Joachim Eastwood <manabian@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    arch/arm/boot/dts/lpc43*
 +F:    drivers/clk/nxp/clk-lpc18xx*
 +F:    drivers/clocksource/time-lpc32xx.c
 +F:    drivers/i2c/busses/i2c-lpc2k.c
 +F:    drivers/memory/pl172.c
 +F:    drivers/mtd/spi-nor/nxp-spifi.c
 +F:    drivers/rtc/rtc-lpc24xx.c
  N:    lpc18xx
  
  ARM/MAGICIAN MACHINE SUPPORT
@@@ -1312,13 -1298,6 +1312,13 @@@ F:    arch/arm/mach-mediatek
  N:    mtk
  K:    mediatek
  
 +ARM/Mediatek USB3 PHY DRIVER
 +M:    Chunfeng Yun <chunfeng.yun@mediatek.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    linux-mediatek@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/phy/phy-mt65xx-usb3.c
 +
  ARM/MICREL KS8695 ARCHITECTURE
  M:    Greg Ungerer <gerg@uclinux.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1466,12 -1445,7 +1466,12 @@@ F:    arch/arm/mach-exynos*
  F:    drivers/*/*s3c2410*
  F:    drivers/*/*/*s3c2410*
  F:    drivers/spi/spi-s3c*
 +F:    drivers/soc/samsung/*
  F:    sound/soc/samsung/*
 +F:    Documentation/arm/Samsung/
 +F:    Documentation/devicetree/bindings/arm/samsung/
 +F:    Documentation/devicetree/bindings/sram/samsung-sram.txt
 +F:    Documentation/devicetree/bindings/power/pd-samsung.txt
  N:    exynos
  
  ARM/SAMSUNG MOBILE MACHINE SUPPORT
@@@ -1506,14 -1480,6 +1506,14 @@@ L:    linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/media/platform/s5p-tv/
  
 +ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
 +M:    Andrzej Pietrasiewicz <andrzej.p@samsung.com>
 +M:    Jacek Anaszewski <j.anaszewski@samsung.com>
 +L:    linux-arm-kernel@lists.infradead.org
 +L:    linux-media@vger.kernel.org
 +S:    Maintained
 +F:    drivers/media/platform/s5p-jpeg/
 +
  ARM/SHMOBILE ARM ARCHITECTURE
  M:    Simon Horman <horms@verge.net.au>
  M:    Magnus Damm <magnus.damm@gmail.com>
@@@ -1526,6 -1492,8 +1526,6 @@@ F:      arch/arm/boot/dts/emev2
  F:    arch/arm/boot/dts/r7s*
  F:    arch/arm/boot/dts/r8a*
  F:    arch/arm/boot/dts/sh*
 -F:    arch/arm/configs/bockw_defconfig
 -F:    arch/arm/configs/marzen_defconfig
  F:    arch/arm/configs/shmobile_defconfig
  F:    arch/arm/include/debug/renesas-scif.S
  F:    arch/arm/mach-shmobile/
@@@ -1560,7 -1528,6 +1560,7 @@@ W:      http://www.stlinux.co
  S:    Maintained
  F:    arch/arm/mach-sti/
  F:    arch/arm/boot/dts/sti*
 +F:    drivers/char/hw_random/st-rng.c
  F:    drivers/clocksource/arm_global_timer.c
  F:    drivers/clocksource/clksrc_st_lpc.c
  F:    drivers/i2c/busses/i2c-st.c
@@@ -1640,10 -1607,7 +1640,10 @@@ M:    Masahiro Yamada <yamada.masahiro@soc
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/boot/dts/uniphier*
 +F:    arch/arm/include/asm/hardware/cache-uniphier.h
  F:    arch/arm/mach-uniphier/
 +F:    arch/arm/mm/cache-uniphier.c
 +F:    drivers/i2c/busses/i2c-uniphier*
  F:    drivers/pinctrl/uniphier/
  F:    drivers/tty/serial/8250/8250_uniphier.c
  N:    uniphier
@@@ -1816,14 -1780,6 +1816,14 @@@ S:    Supporte
  F:    Documentation/aoe/
  F:    drivers/block/aoe/
  
 +ATHEROS 71XX/9XXX GPIO DRIVER
 +M:    Alban Bedel <albeu@free.fr>
 +W:    https://github.com/AlbanBedel/linux
 +T:    git git://github.com/AlbanBedel/linux
 +S:    Maintained
 +F:    drivers/gpio/gpio-ath79.c
 +F:    Documentation/devicetree/bindings/gpio/gpio-ath79.txt
 +
  ATHEROS ATH GENERIC UTILITIES
  M:    "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
  L:    linux-wireless@vger.kernel.org
@@@ -2405,27 -2361,19 +2405,27 @@@ L:   linux-scsi@vger.kernel.or
  S:    Supported
  F:    drivers/scsi/bnx2i/
  
 -BROADCOM CYGNUS/IPROC ARM ARCHITECTURE
 +BROADCOM IPROC ARM ARCHITECTURE
  M:    Ray Jui <rjui@broadcom.com>
  M:    Scott Branden <sbranden@broadcom.com>
 +M:    Jon Mason <jonmason@broadcom.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://github.com/broadcom/cygnus-linux.git
  S:    Maintained
  N:    iproc
  N:    cygnus
 +N:    nsp
  N:    bcm9113*
  N:    bcm9583*
 -N:    bcm583*
 +N:    bcm9585*
 +N:    bcm9586*
 +N:    bcm988312
  N:    bcm113*
 +N:    bcm583*
 +N:    bcm585*
 +N:    bcm586*
 +N:    bcm88312
  
  BROADCOM BRCMSTB GPIO DRIVER
  M:    Gregory Fong <gregory.0xf0@gmail.com>
@@@ -2783,10 -2731,9 +2783,10 @@@ S:    Supporte
  F:    drivers/net/ethernet/cisco/enic/
  
  CISCO VIC LOW LATENCY NIC DRIVER
 -M:    Upinder Malhi <umalhi@cisco.com>
 +M:    Christian Benvenuti <benve@cisco.com>
 +M:    Dave Goodell <dgoodell@cisco.com>
  S:    Supported
 -F:    drivers/infiniband/hw/usnic
 +F:    drivers/infiniband/hw/usnic/
  
  CIRRUS LOGIC EP93XX ETHERNET DRIVER
  M:    Hartley Sweeten <hsweeten@visionengravers.com>
@@@ -3421,7 -3368,6 +3421,7 @@@ M:      Support Opensource <support.opensour
  W:    http://www.dialog-semiconductor.com/products
  S:    Supported
  F:    Documentation/hwmon/da90??
 +F:    Documentation/devicetree/bindings/sound/da[79]*.txt
  F:    drivers/gpio/gpio-da90??.c
  F:    drivers/hwmon/da90??-hwmon.c
  F:    drivers/iio/adc/da91??-*.c
@@@ -3556,15 -3502,13 +3556,15 @@@ M:   Jonathan Corbet <corbet@lwn.net
  L:    linux-doc@vger.kernel.org
  S:    Maintained
  F:    Documentation/
 +F:    scripts/docproc.c
 +F:    scripts/kernel-doc*
  X:    Documentation/ABI/
  X:    Documentation/devicetree/
  X:    Documentation/acpi
  X:    Documentation/power
  X:    Documentation/spi
  X:    Documentation/DocBook/media
 -T:    git git://git.lwn.net/linux-2.6.git docs-next
 +T:    git git://git.lwn.net/linux.git docs-next
  
  DOUBLETALK DRIVER
  M:    "James R. Van Zandt" <jrv@vanzandt.mv.com>
@@@ -3641,7 -3585,6 +3641,7 @@@ M:      Daniel Vetter <daniel.vetter@intel.c
  M:    Jani Nikula <jani.nikula@linux.intel.com>
  L:    intel-gfx@lists.freedesktop.org
  L:    dri-devel@lists.freedesktop.org
 +W:    https://01.org/linuxgraphics/
  Q:    http://patchwork.freedesktop.org/project/intel-gfx/
  T:    git git://anongit.freedesktop.org/drm-intel
  S:    Supported
@@@ -4485,14 -4428,6 +4485,14 @@@ L:    linuxppc-dev@lists.ozlabs.or
  S:    Maintained
  F:    drivers/net/ethernet/freescale/ucc_geth*
  
 +FREESCALE eTSEC ETHERNET DRIVER (GIANFAR)
 +M:    Claudiu Manoil <claudiu.manoil@freescale.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/ethernet/freescale/gianfar*
 +X:    drivers/net/ethernet/freescale/gianfar_ptp.c
 +F:    Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
 +
  FREESCALE QUICC ENGINE UCC UART DRIVER
  M:    Timur Tabi <timur@tabi.org>
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -5170,7 -5105,6 +5170,7 @@@ S:      Maintaine
  F:    Documentation/devicetree/bindings/i2c/
  F:    Documentation/i2c/
  F:    drivers/i2c/
 +F:    drivers/i2c/*/
  F:    include/linux/i2c.h
  F:    include/linux/i2c-*.h
  F:    include/uapi/linux/i2c.h
@@@ -5512,6 -5446,12 +5512,6 @@@ W:     https://01.org/linux-acp
  S:    Supported
  F:    drivers/platform/x86/intel_menlow.c
  
 -INTEL IA32 MICROCODE UPDATE SUPPORT
 -M:    Borislav Petkov <bp@alien8.de>
 -S:    Maintained
 -F:    arch/x86/kernel/cpu/microcode/core*
 -F:    arch/x86/kernel/cpu/microcode/intel*
 -
  INTEL I/OAT DMA DRIVER
  M:    Dave Jiang <dave.jiang@intel.com>
  R:    Dan Williams <dan.j.williams@intel.com>
@@@ -5622,7 -5562,7 +5622,7 @@@ F:      drivers/net/wireless/iwlegacy
  INTEL WIRELESS WIFI LINK (iwlwifi)
  M:    Johannes Berg <johannes.berg@intel.com>
  M:    Emmanuel Grumbach <emmanuel.grumbach@intel.com>
 -M:    Intel Linux Wireless <ilw@linux.intel.com>
 +M:    Intel Linux Wireless <linuxwifi@intel.com>
  L:    linux-wireless@vger.kernel.org
  W:    http://intellinuxwireless.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git
@@@ -6169,13 -6109,6 +6169,13 @@@ F:    Documentation/auxdisplay/ks010
  F:    drivers/auxdisplay/ks0108.c
  F:    include/linux/ks0108.h
  
 +L3MDEV
 +M:    David Ahern <dsa@cumulusnetworks.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    net/l3mdev
 +F:    include/net/l3mdev.h
 +
  LAPB module
  L:    linux-x25@vger.kernel.org
  S:    Orphan
@@@ -6326,14 -6259,6 +6326,14 @@@ F:    drivers/nvdimm/pmem.
  F:    include/linux/pmem.h
  F:    arch/*/include/asm/pmem.h
  
 +LIGHTNVM PLATFORM SUPPORT
 +M:    Matias Bjorling <mb@lightnvm.io>
 +W:    http://github/OpenChannelSSD
 +S:    Maintained
 +F:    drivers/lightnvm/
 +F:    include/linux/lightnvm.h
 +F:    include/uapi/linux/lightnvm.h
 +
  LINUX FOR IBM pSERIES (RS/6000)
  M:    Paul Mackerras <paulus@au.ibm.com>
  W:    http://www.ibm.com/linux/ltc/projects/ppc
@@@ -6651,13 -6576,6 +6651,13 @@@ M:    Guenter Roeck <linux@roeck-us.net
  S:    Maintained
  F:    drivers/net/dsa/mv88e6352.c
  
 +MARVELL CRYPTO DRIVER
 +M:    Boris Brezillon <boris.brezillon@free-electrons.com>
 +M:    Arnaud Ebalard <arno@natisbad.org>
 +F:    drivers/crypto/marvell/
 +S:    Maintained
 +L:    linux-crypto@vger.kernel.org
 +
  MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
  M:    Mirko Lindner <mlindner@marvell.com>
  M:    Stephen Hemminger <stephen@networkplumber.org>
@@@ -6780,6 -6698,12 +6780,12 @@@ W:    http://linuxtv.or
  S:    Maintained
  F:    drivers/media/radio/radio-maxiradio*
  
+ MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVER
+ M:    Peter Rosin <peda@axentia.se>
+ L:    linux-iio@vger.kernel.org
+ S:    Maintained
+ F:    drivers/iio/potentiometer/mcp4531.c
  MEDIA DRIVERS FOR RENESAS - VSP1
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  L:    linux-media@vger.kernel.org
@@@ -7015,6 -6939,13 +7021,13 @@@ S:    Supporte
  F:    include/linux/mlx5/
  F:    drivers/infiniband/hw/mlx5/
  
+ MELEXIS MLX90614 DRIVER
+ M:    Crt Mori <cmo@melexis.com>
+ L:    linux-iio@vger.kernel.org
+ W:    http://www.melexis.com
+ S:    Supported
+ F:    drivers/iio/temperature/mlx90614.c
  MN88472 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
  L:    linux-media@vger.kernel.org
@@@ -7068,7 -6999,6 +7081,7 @@@ M:      Alan Ott <alan@signal11.us
  L:    linux-wpan@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ieee802154/mrf24j40.c
 +F:    Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt
  
  MSI LAPTOP SUPPORT
  M:    "Lee, Chun-Yi" <jlee@suse.com>
@@@ -7141,6 -7071,7 +7154,6 @@@ F:      drivers/media/i2c/mt9v032.
  F:    include/media/mt9v032.h
  
  MULTIFUNCTION DEVICES (MFD)
 -M:    Samuel Ortiz <sameo@linux.intel.com>
  M:    Lee Jones <lee.jones@linaro.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
  S:    Supported
@@@ -7402,6 -7333,7 +7415,6 @@@ S:      Odd Fixe
  F:    drivers/net/
  F:    include/linux/if_*
  F:    include/linux/netdevice.h
 -F:    include/linux/arcdevice.h
  F:    include/linux/etherdevice.h
  F:    include/linux/fcdevice.h
  F:    include/linux/fddidevice.h
@@@ -7494,10 -7426,10 +7507,10 @@@ NOKIA N900 POWER SUPPLY DRIVER
  M:    Pali Rohár <pali.rohar@gmail.com>
  S:    Maintained
  F:    include/linux/power/bq2415x_charger.h
 -F:    include/linux/power/bq27x00_battery.h
 +F:    include/linux/power/bq27xxx_battery.h
  F:    include/linux/power/isp1704_charger.h
  F:    drivers/power/bq2415x_charger.c
 -F:    drivers/power/bq27x00_battery.c
 +F:    drivers/power/bq27xxx_battery.c
  F:    drivers/power/isp1704_charger.c
  F:    drivers/power/rx51_battery.c
  
@@@ -7540,13 -7472,11 +7553,13 @@@ F:   drivers/video/fbdev/riva
  F:    drivers/video/fbdev/nvidia/
  
  NVM EXPRESS DRIVER
 -M:    Matthew Wilcox <willy@linux.intel.com>
 +M:    Keith Busch <keith.busch@intel.com>
 +M:    Jens Axboe <axboe@fb.com>
  L:    linux-nvme@lists.infradead.org
 -T:    git git://git.infradead.org/users/willy/linux-nvme.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
 +W:    https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block/
  S:    Supported
 -F:    drivers/block/nvme*
 +F:    drivers/nvme/host/
  F:    include/linux/nvme.h
  
  NVMEM FRAMEWORK
@@@ -8041,14 -7971,6 +8054,14 @@@ F:    include/linux/pci
  F:    arch/x86/pci/
  F:    arch/x86/kernel/quirks.c
  
 +PCI DRIVER FOR ALTERA PCIE IP
 +M:    Ley Foon Tan <lftan@altera.com>
 +L:    rfi@lists.rocketboards.org (moderated for non-subscribers)
 +L:    linux-pci@vger.kernel.org
 +S:    Supported
 +F:    Documentation/devicetree/bindings/pci/altera-pcie.txt
 +F:    drivers/pci/host/pcie-altera.c
 +
  PCI DRIVER FOR ARM VERSATILE PLATFORM
  M:    Rob Herring <robh@kernel.org>
  L:    linux-pci@vger.kernel.org
@@@ -8150,14 -8072,6 +8163,14 @@@ L:    linux-pci@vger.kernel.or
  S:    Maintained
  F:    drivers/pci/host/*spear*
  
 +PCI MSI DRIVER FOR ALTERA MSI IP
 +M:    Ley Foon Tan <lftan@altera.com>
 +L:    rfi@lists.rocketboards.org (moderated for non-subscribers)
 +L:    linux-pci@vger.kernel.org
 +S:    Supported
 +F:    Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
 +F:    drivers/pci/host/pcie-altera-msi.c
 +
  PCI MSI DRIVER FOR APPLIEDMICRO XGENE
  M:    Duc Dang <dhdang@apm.com>
  L:    linux-pci@vger.kernel.org
@@@ -8166,13 -8080,6 +8179,13 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/pci/xgene-pci-msi.txt
  F:    drivers/pci/host/pci-xgene-msi.c
  
 +PCIE DRIVER FOR HISILICON
 +M:    Zhou Wang <wangzhou1@hisilicon.com>
 +L:    linux-pci@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
 +F:    drivers/pci/host/pcie-hisi.c
 +
  PCMCIA SUBSYSTEM
  P:    Linux PCMCIA Team
  L:    linux-pcmcia@lists.infradead.org
@@@ -8279,13 -8186,6 +8292,13 @@@ L:    linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    drivers/pinctrl/pinctrl-at91.*
  
 +PIN CONTROLLER - ATMEL AT91 PIO4
 +M:    Ludovic Desroches <ludovic.desroches@atmel.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    linux-gpio@vger.kernel.org
 +S:    Supported
 +F:    drivers/pinctrl/pinctrl-at91-pio4.*
 +
  PIN CONTROLLER - INTEL
  M:    Mika Westerberg <mika.westerberg@linux.intel.com>
  M:    Heikki Krogerus <heikki.krogerus@linux.intel.com>
@@@ -8389,6 -8289,12 +8402,6 @@@ M:     "Rafael J. Wysocki" <rafael.j.wysock
  S:    Maintained
  F:    drivers/pnp/
  
 -PNXxxxx I2C DRIVER
 -M:    Vitaly Wool <vitalywool@gmail.com>
 -L:    linux-i2c@vger.kernel.org
 -S:    Maintained
 -F:    drivers/i2c/busses/i2c-pnx.c
 -
  PPP PROTOCOL DRIVERS AND COMPRESSORS
  M:    Paul Mackerras <paulus@samba.org>
  L:    linux-ppp@vger.kernel.org
@@@ -8641,16 -8547,6 +8654,16 @@@ L:    netdev@vger.kernel.or
  S:    Supported
  F:    drivers/net/ethernet/qlogic/qlge/
  
 +QLOGIC QL4xxx ETHERNET DRIVER
 +M:    Yuval Mintz <Yuval.Mintz@qlogic.com>
 +M:    Ariel Elior <Ariel.Elior@qlogic.com>
 +M:    everest-linux-l2@qlogic.com
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    drivers/net/ethernet/qlogic/qed/
 +F:    include/linux/qed/
 +F:    drivers/net/ethernet/qlogic/qede/
 +
  QNX4 FILESYSTEM
  M:    Anders Larsen <al@alarsen.net>
  W:    http://www.alarsen.net/linux/qnx4fs/
@@@ -9002,13 -8898,6 +9015,13 @@@ S:    Maintaine
  F:    drivers/net/wireless/rtlwifi/
  F:    drivers/net/wireless/rtlwifi/rtl8192ce/
  
 +RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
 +M:    Jes Sorensen <Jes.Sorensen@redhat.com>
 +L:    linux-wireless@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jes/linux.git rtl8723au-mac80211
 +S:    Maintained
 +F:    drivers/net/wireless/realtek/rtl8xxxu/
 +
  S3 SAVAGE FRAMEBUFFER DRIVER
  M:    Antonino Daplas <adaplas@gmail.com>
  L:    linux-fbdev@vger.kernel.org
@@@ -9082,13 -8971,6 +9095,13 @@@ F:    drivers/s390/net/*iucv
  F:    include/net/iucv/
  F:    net/iucv/
  
 +S390 IOMMU (PCI)
 +M:    Gerald Schaefer <gerald.schaefer@de.ibm.com>
 +L:    linux-s390@vger.kernel.org
 +W:    http://www.ibm.com/developerworks/linux/linux390/
 +S:    Supported
 +F:    drivers/iommu/s390-iommu.c
 +
  S3C24XX SD/MMC Driver
  M:    Ben Dooks <ben-linux@fluff.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -9308,16 -9190,6 +9321,16 @@@ W:    http://www.sunplus.co
  S:    Supported
  F:    arch/score/
  
 +SYSTEM CONTROL & POWER INTERFACE (SCPI) Message Protocol drivers
 +M:    Sudeep Holla <sudeep.holla@arm.com>
 +L:    linux-arm-kernel@lists.infradead.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/arm/arm,scpi.txt
 +F:    drivers/clk/clk-scpi.c
 +F:    drivers/cpufreq/scpi-cpufreq.c
 +F:    drivers/firmware/arm_scpi.c
 +F:    include/linux/scpi_protocol.h
 +
  SCSI CDROM DRIVER
  M:    Jens Axboe <axboe@kernel.dk>
  L:    linux-scsi@vger.kernel.org
@@@ -10142,9 -10014,11 +10155,11 @@@ F: drivers/staging/vt665?
  
  STAGING - WILC1000 WIFI DRIVER
  M:    Johnny Kim <johnny.kim@atmel.com>
- M:    Rachel Kim <rachel.kim@atmel.com>
- M:    Dean Lee <dean.lee@atmel.com>
+ M:    Austin Shin <austin.shin@atmel.com>
  M:    Chris Park <chris.park@atmel.com>
+ M:    Tony Cho <tony.cho@atmel.com>
+ M:    Glen Lee <glen.lee@atmel.com>
+ M:    Leo Kim <leo.kim@atmel.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
  F:    drivers/staging/wilc1000/
@@@ -10233,7 -10107,6 +10248,7 @@@ F:   include/net/switchdev.
  
  SYNOPSYS ARC ARCHITECTURE
  M:    Vineet Gupta <vgupta@synopsys.com>
 +L:    linux-snps-arc@lists.infraded.org
  S:    Supported
  F:    arch/arc/
  F:    Documentation/devicetree/bindings/arc/*
@@@ -10694,12 -10567,6 +10709,12 @@@ L: platform-driver-x86@vger.kernel.or
  S:    Maintained
  F:    drivers/platform/x86/toshiba_haps.c
  
 +TOSHIBA WMI HOTKEYS DRIVER
 +M:    Azael Avalos <coproscefalo@gmail.com>
 +L:    platform-driver-x86@vger.kernel.org
 +S:    Maintained
 +F:    drivers/platform/x86/toshiba-wmi.c
 +
  TOSHIBA SMM DRIVER
  M:    Jonathan Buzzard <jonathan@buzzard.org.uk>
  W:    http://www.buzzard.org.uk/toshiba/
@@@ -10757,7 -10624,6 +10772,7 @@@ F:   drivers/media/pci/tw68
  TPM DEVICE DRIVER
  M:    Peter Huewe <peterhuewe@gmx.de>
  M:    Marcel Selhorst <tpmdd@selhorst.net>
 +M:    Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
  R:    Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
  W:    http://tpmdd.sourceforge.net
  L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
@@@ -11242,12 -11108,6 +11257,12 @@@ S: Maintaine
  F:    Documentation/fb/uvesafb.txt
  F:    drivers/video/fbdev/uvesafb.*
  
 +VF610 NAND DRIVER
 +M:    Stefan Agner <stefan@agner.ch>
 +L:    linux-mtd@lists.infradead.org
 +S:    Supported
 +F:    drivers/mtd/nand/vf610_nfc.c
 +
  VFAT/FAT/MSDOS FILESYSTEM
  M:    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
  S:    Maintained
@@@ -11278,12 -11138,6 +11293,12 @@@ S: Maintaine
  F:    drivers/media/v4l2-core/videobuf2-*
  F:    include/media/videobuf2-*
  
 +VIRTUAL SERIO DEVICE DRIVER
 +M:    Stephen Chandler Paul <thatslyude@gmail.com>
 +S:    Maintained
 +F:    drivers/input/serio/userio.c
 +F:    include/uapi/linux/userio.h
 +
  VIRTIO CONSOLE DRIVER
  M:    Amit Shah <amit.shah@redhat.com>
  L:    virtualization@lists.linux-foundation.org
@@@ -11361,13 -11215,6 +11376,13 @@@ L: netdev@vger.kernel.or
  S:    Maintained
  F:    drivers/net/ethernet/via/via-velocity.*
  
 +VIRT LIB
 +M:    Alex Williamson <alex.williamson@redhat.com>
 +M:    Paolo Bonzini <pbonzini@redhat.com>
 +L:    kvm@vger.kernel.org
 +S:    Supported
 +F:    virt/lib/
 +
  VIVID VIRTUAL VIDEO DRIVER
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -11456,6 -11303,7 +11471,6 @@@ M:   Shrijeet Mukherjee <shm@cumulusnetwo
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/vrf.c
 -F:    include/net/vrf.h
  F:    Documentation/networking/vrf.txt
  
  VT1211 HARDWARE MONITOR DRIVER
@@@ -11574,9 -11422,6 +11589,9 @@@ T:   git https://github.com/CirrusLogic/l
  W:    https://github.com/CirrusLogic/linux-drivers/wiki
  S:    Supported
  F:    Documentation/hwmon/wm83??
 +F:    Documentation/devicetree/bindings/extcon/extcon-arizona.txt
 +F:    Documentation/devicetree/bindings/regulator/arizona-regulator.txt
 +F:    Documentation/devicetree/bindings/mfd/arizona.txt
  F:    arch/arm/mach-s3c64xx/mach-crag6410*
  F:    drivers/clk/clk-wm83*.c
  F:    drivers/extcon/extcon-arizona.c
@@@ -11637,7 -11482,6 +11652,7 @@@ L:   platform-driver-x86@vger.kernel.or
  T:    git git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git
  S:    Maintained
  F:    drivers/platform/x86/
 +F:    drivers/platform/olpc/
  
  X86 MCE INFRASTRUCTURE
  M:    Tony Luck <tony.luck@intel.com>
@@@ -11646,11 -11490,6 +11661,11 @@@ L: linux-edac@vger.kernel.or
  S:    Maintained
  F:    arch/x86/kernel/cpu/mcheck/*
  
 +X86 MICROCODE UPDATE SUPPORT
 +M:    Borislav Petkov <bp@alien8.de>
 +S:    Maintained
 +F:    arch/x86/kernel/cpu/microcode/*
 +
  X86 VDSO
  M:    Andy Lutomirski <luto@amacapital.net>
  L:    linux-kernel@vger.kernel.org
index 3bc059c698241a46908c9b5047082f0262cdae26,54a8302aaacec518c46fb8d603b4da62e28d505d..41d495c6035e1a882e03b17ca8066224e767cde6
@@@ -508,6 -508,8 +508,7 @@@ static int max1027_remove(struct spi_de
  static struct spi_driver max1027_driver = {
        .driver = {
                .name   = "max1027",
 -              .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(max1027_adc_dt_ids),
        },
        .probe          = max1027_probe,
        .remove         = max1027_remove,
index d5d8b4180914d873a673072c5c377e68cd2e603e,41a21e986c1a326593a4864d53f2d33882342a98..8569c8e1f4b276db3e968356626c67fab9b60c16
@@@ -404,6 -404,8 +404,7 @@@ MODULE_DEVICE_TABLE(spi, mcp320x_id)
  static struct spi_driver mcp320x_driver = {
        .driver = {
                .name = "mcp320x",
 -              .owner = THIS_MODULE,
+               .of_match_table = of_match_ptr(mcp320x_dt_ids),
        },
        .probe = mcp320x_probe,
        .remove = mcp320x_remove,
index 76b619649409a43329719e17668b851b427e3c84,98c0d2b444bff46048fac8c03979661f7a922a95..ff6f7f63c8d9b8c2c7e758ce932912663b7fbc3f
@@@ -174,6 -174,13 +174,13 @@@ static int adc128_remove(struct spi_dev
        return 0;
  }
  
+ static const struct of_device_id adc128_of_match[] = {
+       { .compatible = "ti,adc128s052", },
+       { .compatible = "ti,adc122s021", },
+       { /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, adc128_of_match);
  static const struct spi_device_id adc128_id[] = {
        { "adc128s052", 0},     /* index into adc128_config */
        { "adc122s021", 1},
@@@ -184,6 -191,8 +191,7 @@@ MODULE_DEVICE_TABLE(spi, adc128_id)
  static struct spi_driver adc128_driver = {
        .driver = {
                .name = "adc128s052",
 -              .owner = THIS_MODULE,
+               .of_match_table = of_match_ptr(adc128_of_match),
        },
        .probe = adc128_probe,
        .remove = adc128_remove,
index 6da31e4dbdd4833332a6888115eb29f458c4c3de,32b82a2dc8942126ff1214e83f609e07544037d9..102c7174da5bf2485cc0fb7343cea2e390c1c8f3
@@@ -195,10 -195,12 +195,11 @@@ static const struct spi_device_id ad836
        {"ad8366", 0},
        {}
  };
+ MODULE_DEVICE_TABLE(spi, ad8366_id);
  
  static struct spi_driver ad8366_driver = {
        .driver = {
                .name   = KBUILD_MODNAME,
 -              .owner  = THIS_MODULE,
        },
        .probe          = ad8366_probe,
        .remove         = ad8366_remove,
diff --combined drivers/iio/dac/ad5504.c
index 88b2c92e243bccdb1cb20e0d038853500f8b3fd0,e6e9756580af3e048c510fe92b490e4d65b654a6..4e4c20d6d8b57a763bb043eaf47af0d76709204c
@@@ -214,7 -214,6 +214,6 @@@ static struct attribute *ad5504_ev_attr
  
  static struct attribute_group ad5504_ev_attribute_group = {
        .attrs = ad5504_ev_attributes,
-       .name = "events",
  };
  
  static irqreturn_t ad5504_event_handler(int irq, void *private)
@@@ -364,6 -363,7 +363,6 @@@ MODULE_DEVICE_TABLE(spi, ad5504_id)
  static struct spi_driver ad5504_driver = {
        .driver = {
                   .name = "ad5504",
 -                 .owner = THIS_MODULE,
                   },
        .probe = ad5504_probe,
        .remove = ad5504_remove,
diff --combined drivers/iio/dac/ad7303.c
index 399de2cfeb16b52c75180c88f8435e4102a53be5,18a4ad5ff8c50ccfb87bd4a31ce2ec6ca6dbe79d..e690dd11e99f64fa1270da8132010f34d94d7241
@@@ -281,6 -281,12 +281,12 @@@ static int ad7303_remove(struct spi_dev
        return 0;
  }
  
+ static const struct of_device_id ad7303_spi_of_match[] = {
+       { .compatible = "adi,ad7303", },
+       { /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, ad7303_spi_of_match);
  static const struct spi_device_id ad7303_spi_ids[] = {
        { "ad7303", 0 },
        {}
@@@ -290,6 -296,8 +296,7 @@@ MODULE_DEVICE_TABLE(spi, ad7303_spi_ids
  static struct spi_driver ad7303_driver = {
        .driver = {
                .name = "ad7303",
 -              .owner = THIS_MODULE,
+               .of_match_table = of_match_ptr(ad7303_spi_of_match),
        },
        .probe = ad7303_probe,
        .remove = ad7303_remove,
index b83534cc2ab14bde5fb25819e9a6d854275f2895,73f27e0a08dd3e1313a1160004aae56c1da246af..d2d824b446f5242c09fe8bb9ac276ab8f2fe746f
@@@ -616,15 -616,25 +616,24 @@@ static int adf4350_remove(struct spi_de
        return 0;
  }
  
+ static const struct of_device_id adf4350_of_match[] = {
+       { .compatible = "adi,adf4350", },
+       { .compatible = "adi,adf4351", },
+       { /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, adf4350_of_match);
  static const struct spi_device_id adf4350_id[] = {
        {"adf4350", 4350},
        {"adf4351", 4351},
        {}
  };
+ MODULE_DEVICE_TABLE(spi, adf4350_id);
  
  static struct spi_driver adf4350_driver = {
        .driver = {
                .name   = "adf4350",
 -              .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(adf4350_of_match),
        },
        .probe          = adf4350_probe,
        .remove         = adf4350_remove,
index 2865aa63f4f1de9cf4900700663bbbf617c49e2c,e95035136889342a88f398d33738fe67055e8c1b..f4d29d5dbd5f88d6e5edffef142e86db30076d44
@@@ -434,6 -434,12 +434,12 @@@ static int as3935_remove(struct spi_dev
        return 0;
  }
  
+ static const struct of_device_id as3935_of_match[] = {
+       { .compatible = "ams,as3935", },
+       { /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, as3935_of_match);
  static const struct spi_device_id as3935_id[] = {
        {"as3935", 0},
        {},
@@@ -443,6 -449,8 +449,7 @@@ MODULE_DEVICE_TABLE(spi, as3935_id)
  static struct spi_driver as3935_driver = {
        .driver = {
                .name   = "as3935",
 -              .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(as3935_of_match),
                .pm     = AS3935_PM_OPS,
        },
        .probe          = as3935_probe,
index 0d27daf23228adaeee72dac0027ebd2194f77d9c,20e69f0b5cb047cc810a5aaf284bdcd2a1358160..3ccdec94fee74e60be8652f53bc6043d52cd5432
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
-  *
-  * You should have received a copy of the GNU General Public License
-  * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
  
  #ifndef __LINUX_FBTFT_H
@@@ -24,7 -20,6 +20,6 @@@
  #include <linux/spi/spi.h>
  #include <linux/platform_device.h>
  
  #define FBTFT_NOP             0x00
  #define FBTFT_SWRESET 0x01
  #define FBTFT_RDDID           0x04
@@@ -251,7 -246,7 +246,7 @@@ struct fbtft_par 
        } gamma;
        unsigned long debug;
        bool first_update_done;
-       struct timespec update_time;
+       ktime_t update_time;
        bool bgr;
        void *extra;
  };
@@@ -295,7 -290,6 +290,6 @@@ void fbtft_write_reg8_bus9(struct fbtft
  void fbtft_write_reg16_bus8(struct fbtft_par *par, int len, ...);
  void fbtft_write_reg16_bus16(struct fbtft_par *par, int len, ...);
  
  #define FBTFT_REGISTER_DRIVER(_name, _compatible, _display)                \
                                                                           \
  static int fbtft_driver_probe_spi(struct spi_device *spi)                  \
@@@ -333,6 -327,7 +327,6 @@@ MODULE_DEVICE_TABLE(of, dt_ids)
  static struct spi_driver fbtft_driver_spi_driver = {                       \
        .driver = {                                                        \
                .name   = _name,                                           \
 -              .owner  = THIS_MODULE,                                     \
                .of_match_table = of_match_ptr(dt_ids),                    \
        },                                                                 \
        .probe  = fbtft_driver_probe_spi,                                  \
@@@ -368,7 -363,6 +362,6 @@@ static void __exit fbtft_driver_module_
  module_init(fbtft_driver_module_init);                                     \
  module_exit(fbtft_driver_module_exit);
  
  /* Debug macros */
  
  /* shorthand debug levels */
  #define DEBUG_REQUEST_GPIOS_MATCH   (1<<30)
  #define DEBUG_VERIFY_GPIOS          (1<<31)
  
  #define fbtft_init_dbg(dev, format, arg...)                  \
  do {                                                         \
        if (unlikely((dev)->platform_data &&                 \
@@@ -428,7 -421,6 +420,6 @@@ do 
                dev_info(par->info->device, format, ##arg);  \
  } while (0)
  
  #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \
  do {                                                                       \
        if (unlikely(par->debug & level))                                  \
index 86d9223e4e0c273abbe195ab44b5d5c96591733f,704b78c78f1390fc9f40083e3e3ecaddbc672580..ce0d254148e4d8a8e3498ef33b68f5313e16ecf8
@@@ -233,8 -233,6 +233,6 @@@ static const struct flexfb_lcd_controll
  static void flexfb_set_addr_win_1(struct fbtft_par *par,
                                  int xs, int ys, int xe, int ye)
  {
-       fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
-                     __func__, xs, ys, xe, ye);
        switch (par->info->var.rotate) {
        /* R20h = Horizontal GRAM Start Address */
        /* R21h = Vertical GRAM Start Address */
  static void flexfb_set_addr_win_2(struct fbtft_par *par,
                                  int xs, int ys, int xe, int ye)
  {
-       fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par,
-                     "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
-                     __func__, xs, ys, xe, ye);
        switch (par->info->var.rotate) {
        /* R4Eh - Set GDDRAM X address counter */
        /* R4Fh - Set GDDRAM Y address counter */
  static void set_addr_win_3(struct fbtft_par *par,
                           int xs, int ys, int xe, int ye)
  {
-       fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par,
-                     "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__,
-                     xs, ys, xe, ye);
        write_reg(par, 0x15, xs, xe);
        write_reg(par, 0x75, ys, ye);
        write_reg(par, 0x5C);
@@@ -583,6 -573,7 +573,6 @@@ static int flexfb_remove_pdev(struct pl
  static struct spi_driver flexfb_spi_driver = {
        .driver = {
                .name   = DRVNAME,
 -              .owner  = THIS_MODULE,
        },
        .probe  = flexfb_probe_spi,
        .remove = flexfb_remove_spi,
index 24d90b35d669898bf39522405397f9a6fb6796c9,7a1939a66c935766469b6d6d257ffbad53ce526c..7939ae6378d7876efc1bd162a7185878fb365616
@@@ -406,8 -406,10 +406,10 @@@ static int lis3l02dq_initial_setup(stru
                goto err_ret;
        }
  
-       /* Read back to check this has worked acts as loose test of correct
-        * chip */
+       /*
+        * Read back to check this has worked acts as loose test of correct
+        * chip
+        */
        ret = lis3l02dq_spi_read_reg_8(indio_dev,
                                       LIS3L02DQ_REG_CTRL_1_ADDR,
                                       &valtest);
@@@ -565,7 -567,7 +567,7 @@@ static int lis3l02dq_read_event_config(
  {
        u8 val;
        int ret;
-       u8 mask = (1 << (chan->channel2*2 + (dir == IIO_EV_DIR_RISING)));
+       u8 mask = (1 << (chan->channel2 * 2 + (dir == IIO_EV_DIR_RISING)));
  
        ret = lis3l02dq_spi_read_reg_8(indio_dev,
                                       LIS3L02DQ_REG_WAKE_UP_CFG_ADDR,
@@@ -620,7 -622,7 +622,7 @@@ static int lis3l02dq_write_event_config
        u8 val, control;
        u8 currentlyset;
        bool changed = false;
-       u8 mask = (1 << (chan->channel2*2 + (dir == IIO_EV_DIR_RISING)));
+       u8 mask = (1 << (chan->channel2 * 2 + (dir == IIO_EV_DIR_RISING)));
  
        mutex_lock(&indio_dev->mlock);
        /* read current control */
@@@ -800,6 -802,7 +802,6 @@@ static int lis3l02dq_remove(struct spi_
  static struct spi_driver lis3l02dq_driver = {
        .driver = {
                .name = "lis3l02dq",
 -              .owner = THIS_MODULE,
        },
        .probe = lis3l02dq_probe,
        .remove = lis3l02dq_remove,
index fda646246215c2c3180610c59c86a6f286f9838d,03cb22508a5d157ebfa0e404ca319458db98a818..02e930c55570237817e24c629b3f7df11fbd1fdd
@@@ -88,7 -88,7 +88,7 @@@ int sca3000_write_reg(struct sca3000_st
  }
  
  int sca3000_read_data_short(struct sca3000_state *st,
-                           uint8_t reg_address_high,
+                           u8 reg_address_high,
                            int len)
  {
        struct spi_transfer xfer[2] = {
@@@ -165,10 -165,9 +165,9 @@@ static int __sca3000_unlock_reg_lock(st
   * Lock must be held.
   **/
  static int sca3000_write_ctrl_reg(struct sca3000_state *st,
-                                 uint8_t sel,
+                                 u8 sel,
                                  uint8_t val)
  {
        int ret;
  
        ret = sca3000_reg_lock_on(st);
@@@ -374,7 -373,6 +373,6 @@@ error_ret
        return ret;
  }
  
  /*
   * Not even vaguely standard attributes so defined here rather than
   * in the relevant IIO core headers
@@@ -471,12 -469,13 +469,13 @@@ static int sca3000_read_raw(struct iio_
                                return ret;
                        }
                        *val = (be16_to_cpup((__be16 *)st->rx) >> 3) & 0x1FFF;
-                       *val = ((*val) << (sizeof(*val)*8 - 13)) >>
-                               (sizeof(*val)*8 - 13);
+                       *val = ((*val) << (sizeof(*val) * 8 - 13)) >>
+                               (sizeof(*val) * 8 - 13);
                } else {
                        /* get the temperature when available */
                        ret = sca3000_read_data_short(st,
-                               SCA3000_REG_ADDR_TEMP_MSB, 2);
+                                                     SCA3000_REG_ADDR_TEMP_MSB,
+                                                     2);
                        if (ret < 0) {
                                mutex_unlock(&st->lock);
                                return ret;
   * at all.
   **/
  static ssize_t sca3000_read_av_freq(struct device *dev,
-                            struct device_attribute *attr,
-                            char *buf)
+                                   struct device_attribute *attr,
+                                   char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
        case SCA3000_MEAS_MODE_NORMAL:
                len += sprintf(buf + len, "%d %d %d\n",
                               st->info->measurement_mode_freq,
-                              st->info->measurement_mode_freq/2,
-                              st->info->measurement_mode_freq/4);
+                              st->info->measurement_mode_freq / 2,
+                              st->info->measurement_mode_freq / 4);
                break;
        case SCA3000_MEAS_MODE_OP_1:
                len += sprintf(buf + len, "%d %d %d\n",
                               st->info->option_mode_1_freq,
-                              st->info->option_mode_1_freq/2,
-                              st->info->option_mode_1_freq/4);
+                              st->info->option_mode_1_freq / 2,
+                              st->info->option_mode_1_freq / 4);
                break;
        case SCA3000_MEAS_MODE_OP_2:
                len += sprintf(buf + len, "%d %d %d\n",
                               st->info->option_mode_2_freq,
-                              st->info->option_mode_2_freq/2,
-                              st->info->option_mode_2_freq/4);
+                              st->info->option_mode_2_freq / 2,
+                              st->info->option_mode_2_freq / 4);
                break;
        }
        return len;
  error_ret:
        return ret;
  }
  /**
   * __sca3000_get_base_freq() obtain mode specific base frequency
   *
@@@ -582,8 -582,8 +582,8 @@@ error_ret
   * sca3000_read_frequency() sysfs interface to get the current frequency
   **/
  static ssize_t sca3000_read_frequency(struct device *dev,
-                              struct device_attribute *attr,
-                              char *buf)
+                                     struct device_attribute *attr,
+                                     char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
                        len = sprintf(buf, "%d\n", base_freq);
                        break;
                case 0x01:
-                       len = sprintf(buf, "%d\n", base_freq/2);
+                       len = sprintf(buf, "%d\n", base_freq / 2);
                        break;
                case 0x02:
-                       len = sprintf(buf, "%d\n", base_freq/4);
+                       len = sprintf(buf, "%d\n", base_freq / 4);
                        break;
        }
  
@@@ -623,9 -623,9 +623,9 @@@ error_ret
   * sca3000_set_frequency() sysfs interface to set the current frequency
   **/
  static ssize_t sca3000_set_frequency(struct device *dev,
-                             struct device_attribute *attr,
-                             const char *buf,
-                             size_t len)
+                                    struct device_attribute *attr,
+                                    const char *buf,
+                                    size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
        /* clear the bits */
        ctrlval &= ~0x03;
  
-       if (val == base_freq/2) {
+       if (val == base_freq / 2) {
                ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_2;
-       } else if (val == base_freq/4) {
+       } else if (val == base_freq / 4) {
                ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_4;
        } else if (val != base_freq) {
                ret = -EINVAL;
@@@ -849,9 -849,9 +849,9 @@@ static int sca3000_read_event_config(st
        if (ret)
                goto error_ret;
  
-       if ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET)
+       if ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET) {
                ret = 0;
-       else {
+       else {
                ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_MD_CTRL);
                if (ret < 0)
                        goto error_ret;
@@@ -863,6 -863,7 +863,7 @@@ error_ret
  
        return ret;
  }
  /**
   * sca3000_query_free_fall_mode() is free fall mode enabled
   **/
@@@ -979,14 -980,14 +980,14 @@@ static int sca3000_write_event_config(s
        if (ret)
                goto exit_point;
        /* if off and should be on */
-       if ((st->mo_det_use_count)
-           && ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET))
+       if ((st->mo_det_use_count) &&
+           ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET))
                ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
                                        (st->rx[0] & ~protect_mask)
                                        | SCA3000_MEAS_MODE_MOT_DET);
        /* if on and should be off */
-       else if (!(st->mo_det_use_count)
-                && ((st->rx[0] & protect_mask) == SCA3000_MEAS_MODE_MOT_DET))
+       else if (!(st->mo_det_use_count) &&
+                ((st->rx[0] & protect_mask) == SCA3000_MEAS_MODE_MOT_DET))
                ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
                                        (st->rx[0] & ~protect_mask));
  exit_point:
  
  /* Free fall detector related event attribute */
  static IIO_DEVICE_ATTR_NAMED(accel_xayaz_mag_falling_en,
-                            in_accel_x&y&z_mag_falling_en,
+                            in_accel_x & y & z_mag_falling_en,
                             S_IRUGO | S_IWUSR,
                             sca3000_query_free_fall_mode,
                             sca3000_set_free_fall_mode,
                             0);
  
  static IIO_CONST_ATTR_NAMED(accel_xayaz_mag_falling_period,
-                           in_accel_x&y&z_mag_falling_period,
+                           in_accel_x & y & z_mag_falling_period,
                            "0.226");
  
  static struct attribute *sca3000_event_attributes[] = {
@@@ -1196,6 -1197,7 +1197,6 @@@ MODULE_DEVICE_TABLE(spi, sca3000_id)
  static struct spi_driver sca3000_driver = {
        .driver = {
                .name = "sca3000",
 -              .owner = THIS_MODULE,
        },
        .probe = sca3000_probe,
        .remove = sca3000_remove,
index a3b76559a4f02d03f06da581078bb5d351927f62,5b87049cd3f96345462607b13f65c088e8b0b860..bb40f37287426c4855a70b0b19b124802a52c284
@@@ -88,7 -88,6 +88,6 @@@
  #define AD7192_CLK_INT_CO             3 /* Internal 4.92 MHz Clock available
                                           * at the MCLK2 pin */
  
  /* Configuration Register Bit Designations (AD7192_REG_CONF) */
  
  #define AD7192_CONF_CHOP      BIT(23) /* CHOP enable */
  #define AD7192_GPOCON_P1DAT   BIT(1) /* P1 state */
  #define AD7192_GPOCON_P0DAT   BIT(0) /* P0 state */
  
- #define AD7192_INT_FREQ_MHz   4915200
+ #define AD7192_INT_FREQ_MHZ   4915200
  
  /* NOTE:
   * The AD7190/2/5 features a dual use data out ready DOUT/RDY output.
@@@ -201,7 -200,7 +200,7 @@@ static int ad7192_calibrate_all(struct 
  }
  
  static int ad7192_setup(struct ad7192_state *st,
-       const struct ad7192_platform_data *pdata)
+                       const struct ad7192_platform_data *pdata)
  {
        struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi);
        unsigned long long scale_uv;
  
        if (id != st->devid)
                dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n",
-                       id);
+                        id);
  
        switch (pdata->clock_source_sel) {
        case AD7192_CLK_EXT_MCLK1_2:
        case AD7192_CLK_EXT_MCLK2:
-               st->mclk = AD7192_INT_FREQ_MHz;
+               st->mclk = AD7192_INT_FREQ_MHZ;
                break;
        case AD7192_CLK_INT:
        case AD7192_CLK_INT_CO:
-               if (pdata->ext_clk_Hz)
-                       st->mclk = pdata->ext_clk_Hz;
+               if (pdata->ext_clk_hz)
+                       st->mclk = pdata->ext_clk_hz;
                else
-                       st->mclk = AD7192_INT_FREQ_MHz;
+                       st->mclk = AD7192_INT_FREQ_MHZ;
                        break;
        default:
                ret = -EINVAL;
@@@ -307,8 -306,8 +306,8 @@@ out
  }
  
  static ssize_t ad7192_read_frequency(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                    struct device_attribute *attr,
+                                    char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
  }
  
  static ssize_t ad7192_write_frequency(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t len)
+                                     struct device_attribute *attr,
+                                     const char *buf,
+                                     size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
@@@ -359,8 -358,9 +358,9 @@@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR 
                ad7192_read_frequency,
                ad7192_write_frequency);
  
- static ssize_t ad7192_show_scale_available(struct device *dev,
-                       struct device_attribute *attr, char *buf)
+ static ssize_t
+ ad7192_show_scale_available(struct device *dev,
+                           struct device_attribute *attr, char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
@@@ -383,8 -383,8 +383,8 @@@ static IIO_DEVICE_ATTR(in_voltage_scale
                       ad7192_show_scale_available, NULL, 0);
  
  static ssize_t ad7192_show_ac_excitation(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                        struct device_attribute *attr,
+                                        char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
  }
  
  static ssize_t ad7192_show_bridge_switch(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                        struct device_attribute *attr,
+                                        char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
  }
  
  static ssize_t ad7192_set(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t len)
+                         struct device_attribute *attr,
+                         const char *buf,
+                         size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7192_state *st = iio_priv(indio_dev);
                return -EBUSY;
        }
  
-       switch ((u32) this_attr->address) {
+       switch ((u32)this_attr->address) {
        case AD7192_REG_GPOCON:
                if (val)
                        st->gpocon |= AD7192_GPOCON_BPDSW;
@@@ -529,10 -529,10 +529,10 @@@ static int ad7192_read_raw(struct iio_d
  }
  
  static int ad7192_write_raw(struct iio_dev *indio_dev,
-                              struct iio_chan_spec const *chan,
-                              int val,
-                              int val2,
-                              long mask)
+                           struct iio_chan_spec const *chan,
+                           int val,
+                           int val2,
+                           long mask)
  {
        struct ad7192_state *st = iio_priv(indio_dev);
        int ret, i;
                                if (tmp == st->conf)
                                        break;
                                ad_sd_write_reg(&st->sd, AD7192_REG_CONF,
-                                                3, st->conf);
+                                               3, st->conf);
                                ad7192_calibrate_all(st);
                                break;
                        }
  }
  
  static int ad7192_write_raw_get_fmt(struct iio_dev *indio_dev,
-                              struct iio_chan_spec const *chan,
-                              long mask)
+                                   struct iio_chan_spec const *chan,
+                                   long mask)
  {
        return IIO_VAL_INT_PLUS_NANO;
  }
@@@ -625,7 -625,7 +625,7 @@@ static int ad7192_probe(struct spi_devi
        }
  
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL)
+       if (!indio_dev)
                return -ENOMEM;
  
        st = iio_priv(indio_dev);
                voltage_uv = regulator_get_voltage(st->reg);
        }
  
-       if (pdata && pdata->vref_mv)
+       if (pdata->vref_mv)
                st->int_vref_mv = pdata->vref_mv;
        else if (voltage_uv)
                st->int_vref_mv = voltage_uv / 1000;
@@@ -707,6 -707,7 +707,6 @@@ MODULE_DEVICE_TABLE(spi, ad7192_id)
  static struct spi_driver ad7192_driver = {
        .driver = {
                .name   = "ad7192",
 -              .owner  = THIS_MODULE,
        },
        .probe          = ad7192_probe,
        .remove         = ad7192_remove,
index 8a7c8737adc4d1cd2c0589cab9fed297241ce6aa,45df714cc83af352f3bd85082360a8f3a26b0426..35acb1a4669b30b1cbe0fc565ab3a797b4dc04ae
@@@ -89,7 -89,7 +89,7 @@@
  
  #define AD7280A_ALL_CELLS                             (0xAD << 16)
  
- #define AD7280A_MAX_SPI_CLK_Hz                700000 /* < 1MHz */
+ #define AD7280A_MAX_SPI_CLK_HZ                700000 /* < 1MHz */
  #define AD7280A_MAX_CHAIN             8
  #define AD7280A_CELLS_PER_DEV         6
  #define AD7280A_BITS                  12
@@@ -224,24 -224,24 +224,24 @@@ static int ad7280_write(struct ad7280_s
  }
  
  static int ad7280_read(struct ad7280_state *st, unsigned devaddr,
-                       unsigned addr)
+                      unsigned addr)
  {
        int ret;
        unsigned tmp;
  
        /* turns off the read operation on all parts */
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1,
-                       AD7280A_CTRL_HB_CONV_INPUT_ALL |
-                       AD7280A_CTRL_HB_CONV_RES_READ_NO |
-                       st->ctrl_hb);
+                          AD7280A_CTRL_HB_CONV_INPUT_ALL |
+                          AD7280A_CTRL_HB_CONV_RES_READ_NO |
+                          st->ctrl_hb);
        if (ret)
                return ret;
  
        /* turns on the read operation on the addressed part */
        ret = ad7280_write(st, devaddr, AD7280A_CONTROL_HB, 0,
-                       AD7280A_CTRL_HB_CONV_INPUT_ALL |
-                       AD7280A_CTRL_HB_CONV_RES_READ_ALL |
-                       st->ctrl_hb);
+                          AD7280A_CTRL_HB_CONV_INPUT_ALL |
+                          AD7280A_CTRL_HB_CONV_RES_READ_ALL |
+                          st->ctrl_hb);
        if (ret)
                return ret;
  
@@@ -272,17 -272,17 +272,17 @@@ static int ad7280_read_channel(struct a
                return ret;
  
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1,
-                       AD7280A_CTRL_HB_CONV_INPUT_ALL |
-                       AD7280A_CTRL_HB_CONV_RES_READ_NO |
-                       st->ctrl_hb);
+                          AD7280A_CTRL_HB_CONV_INPUT_ALL |
+                          AD7280A_CTRL_HB_CONV_RES_READ_NO |
+                          st->ctrl_hb);
        if (ret)
                return ret;
  
        ret = ad7280_write(st, devaddr, AD7280A_CONTROL_HB, 0,
-                       AD7280A_CTRL_HB_CONV_INPUT_ALL |
-                       AD7280A_CTRL_HB_CONV_RES_READ_ALL |
-                       AD7280A_CTRL_HB_CONV_START_CS |
-                       st->ctrl_hb);
+                          AD7280A_CTRL_HB_CONV_INPUT_ALL |
+                          AD7280A_CTRL_HB_CONV_RES_READ_ALL |
+                          AD7280A_CTRL_HB_CONV_START_CS |
+                          st->ctrl_hb);
        if (ret)
                return ret;
  
  }
  
  static int ad7280_read_all_channels(struct ad7280_state *st, unsigned cnt,
-                            unsigned *array)
+                                   unsigned *array)
  {
        int i, ret;
        unsigned tmp, sum = 0;
                return ret;
  
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1,
-                       AD7280A_CTRL_HB_CONV_INPUT_ALL |
-                       AD7280A_CTRL_HB_CONV_RES_READ_ALL |
-                       AD7280A_CTRL_HB_CONV_START_CS |
-                       st->ctrl_hb);
+                          AD7280A_CTRL_HB_CONV_INPUT_ALL |
+                          AD7280A_CTRL_HB_CONV_RES_READ_ALL |
+                          AD7280A_CTRL_HB_CONV_START_CS |
+                          st->ctrl_hb);
        if (ret)
                return ret;
  
@@@ -342,24 -342,24 +342,24 @@@ static int ad7280_chain_setup(struct ad
        int ret;
  
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_LB, 1,
-                       AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN |
-                       AD7280A_CTRL_LB_LOCK_DEV_ADDR |
-                       AD7280A_CTRL_LB_MUST_SET |
-                       AD7280A_CTRL_LB_SWRST |
-                       st->ctrl_lb);
+                          AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN |
+                          AD7280A_CTRL_LB_LOCK_DEV_ADDR |
+                          AD7280A_CTRL_LB_MUST_SET |
+                          AD7280A_CTRL_LB_SWRST |
+                          st->ctrl_lb);
        if (ret)
                return ret;
  
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_LB, 1,
-                       AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN |
-                       AD7280A_CTRL_LB_LOCK_DEV_ADDR |
-                       AD7280A_CTRL_LB_MUST_SET |
-                       st->ctrl_lb);
+                          AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN |
+                          AD7280A_CTRL_LB_LOCK_DEV_ADDR |
+                          AD7280A_CTRL_LB_MUST_SET |
+                          st->ctrl_lb);
        if (ret)
                return ret;
  
        ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_READ, 1,
-                       AD7280A_CONTROL_LB << 2);
+                          AD7280A_CONTROL_LB << 2);
        if (ret)
                return ret;
  
  }
  
  static ssize_t ad7280_show_balance_sw(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
+                                     struct device_attribute *attr,
+                                     char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
  }
  
  static ssize_t ad7280_store_balance_sw(struct device *dev,
-                                        struct device_attribute *attr,
-                                        const char *buf,
-                                        size_t len)
+                                      struct device_attribute *attr,
+                                      const char *buf,
+                                      size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
  }
  
  static ssize_t ad7280_show_balance_timer(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
+                                        struct device_attribute *attr,
+                                        char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
  
        mutex_lock(&indio_dev->mlock);
        ret = ad7280_read(st, this_attr->address >> 8,
-                       this_attr->address & 0xFF);
+                         this_attr->address & 0xFF);
        mutex_unlock(&indio_dev->mlock);
  
        if (ret < 0)
  }
  
  static ssize_t ad7280_store_balance_timer(struct device *dev,
-                                        struct device_attribute *attr,
-                                        const char *buf,
-                                        size_t len)
+                                         struct device_attribute *attr,
+                                         const char *buf,
+                                         size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
@@@ -488,12 -488,12 +488,12 @@@ static int ad7280_channel_init(struct a
  
        st->channels = kcalloc((st->slave_num + 1) * 12 + 2,
                               sizeof(*st->channels), GFP_KERNEL);
-       if (st->channels == NULL)
+       if (!st->channels)
                return -ENOMEM;
  
        for (dev = 0, cnt = 0; dev <= st->slave_num; dev++)
-               for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_AUX_ADC_6; ch++,
-                       cnt++) {
+               for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_AUX_ADC_6;
+                       ch++, cnt++) {
                        if (ch < AD7280A_AUX_ADC_1) {
                                st->channels[cnt].type = IIO_VOLTAGE;
                                st->channels[cnt].differential = 1;
@@@ -550,7 -550,7 +550,7 @@@ static int ad7280_attr_init(struct ad72
        st->iio_attr = kcalloc(2, sizeof(*st->iio_attr) *
                               (st->slave_num + 1) * AD7280A_CELLS_PER_DEV,
                               GFP_KERNEL);
-       if (st->iio_attr == NULL)
+       if (!st->iio_attr)
                return -ENOMEM;
  
        for (dev = 0, cnt = 0; dev <= st->slave_num; dev++)
                                ad7280_store_balance_sw;
                        st->iio_attr[cnt].dev_attr.attr.name =
                                kasprintf(GFP_KERNEL,
-                                       "in%d-in%d_balance_switch_en",
-                                       (dev * AD7280A_CELLS_PER_DEV) + ch,
-                                       (dev * AD7280A_CELLS_PER_DEV) + ch + 1);
+                                         "in%d-in%d_balance_switch_en",
+                                         dev * AD7280A_CELLS_PER_DEV + ch,
+                                         dev * AD7280A_CELLS_PER_DEV + ch + 1);
                        ad7280_attributes[cnt] =
                                &st->iio_attr[cnt].dev_attr.attr;
                        cnt++;
                        st->iio_attr[cnt].dev_attr.store =
                                ad7280_store_balance_timer;
                        st->iio_attr[cnt].dev_attr.attr.name =
-                               kasprintf(GFP_KERNEL, "in%d-in%d_balance_timer",
-                                       (dev * AD7280A_CELLS_PER_DEV) + ch,
-                                       (dev * AD7280A_CELLS_PER_DEV) + ch + 1);
+                               kasprintf(GFP_KERNEL,
+                                         "in%d-in%d_balance_timer",
+                                         dev * AD7280A_CELLS_PER_DEV + ch,
+                                         dev * AD7280A_CELLS_PER_DEV + ch + 1);
                        ad7280_attributes[cnt] =
                                &st->iio_attr[cnt].dev_attr.attr;
                }
  }
  
  static ssize_t ad7280_read_channel_config(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
+                                         struct device_attribute *attr,
+                                         char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
        struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
        unsigned val;
  
-       switch ((u32) this_attr->address) {
+       switch ((u32)this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
                val = 1000 + (st->cell_threshhigh * 1568) / 100;
                break;
  }
  
  static ssize_t ad7280_write_channel_config(struct device *dev,
-                                        struct device_attribute *attr,
-                                        const char *buf,
-                                        size_t len)
+                                          struct device_attribute *attr,
+                                          const char *buf,
+                                          size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7280_state *st = iio_priv(indio_dev);
        if (ret)
                return ret;
  
-       switch ((u32) this_attr->address) {
+       switch ((u32)this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
        case AD7280A_CELL_UNDERVOLTAGE:
                val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */
        val = clamp(val, 0L, 0xFFL);
  
        mutex_lock(&indio_dev->mlock);
-       switch ((u32) this_attr->address) {
+       switch ((u32)this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
                st->cell_threshhigh = val;
                break;
@@@ -686,7 -687,7 +687,7 @@@ static irqreturn_t ad7280_event_handler
        int i, ret;
  
        channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL);
-       if (channels == NULL)
+       if (!channels)
                return IRQ_HANDLED;
  
        ret = ad7280_read_all_channels(st, st->scan_cnt, channels);
                        if (((channels[i] >> 11) & 0xFFF) >=
                                st->cell_threshhigh)
                                iio_push_event(indio_dev,
-                                       IIO_EVENT_CODE(IIO_VOLTAGE,
-                                                      1,
-                                                      0,
-                                                      IIO_EV_DIR_RISING,
-                                                      IIO_EV_TYPE_THRESH,
-                                                      0, 0, 0),
-                                       iio_get_time_ns());
+                                              IIO_EVENT_CODE(IIO_VOLTAGE,
+                                                       1,
+                                                       0,
+                                                       IIO_EV_DIR_RISING,
+                                                       IIO_EV_TYPE_THRESH,
+                                                       0, 0, 0),
+                                              iio_get_time_ns());
                        else if (((channels[i] >> 11) & 0xFFF) <=
                                st->cell_threshlow)
                                iio_push_event(indio_dev,
-                                       IIO_EVENT_CODE(IIO_VOLTAGE,
-                                                      1,
-                                                      0,
-                                                      IIO_EV_DIR_FALLING,
-                                                      IIO_EV_TYPE_THRESH,
-                                                      0, 0, 0),
-                                       iio_get_time_ns());
+                                              IIO_EVENT_CODE(IIO_VOLTAGE,
+                                                       1,
+                                                       0,
+                                                       IIO_EV_DIR_FALLING,
+                                                       IIO_EV_TYPE_THRESH,
+                                                       0, 0, 0),
+                                              iio_get_time_ns());
                } else {
                        if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
                                iio_push_event(indio_dev,
-                                       IIO_UNMOD_EVENT_CODE(IIO_TEMP,
-                                       0,
-                                       IIO_EV_TYPE_THRESH,
-                                       IIO_EV_DIR_RISING),
-                                       iio_get_time_ns());
+                                              IIO_UNMOD_EVENT_CODE(
+                                                       IIO_TEMP,
+                                                       0,
+                                                       IIO_EV_TYPE_THRESH,
+                                                       IIO_EV_DIR_RISING),
+                                              iio_get_time_ns());
                        else if (((channels[i] >> 11) & 0xFFF) <=
                                st->aux_threshlow)
                                iio_push_event(indio_dev,
-                                       IIO_UNMOD_EVENT_CODE(IIO_TEMP,
-                                       0,
-                                       IIO_EV_TYPE_THRESH,
-                                       IIO_EV_DIR_FALLING),
-                                       iio_get_time_ns());
+                                              IIO_UNMOD_EVENT_CODE(
+                                                       IIO_TEMP,
+                                                       0,
+                                                       IIO_EV_TYPE_THRESH,
+                                                       IIO_EV_DIR_FALLING),
+                                              iio_get_time_ns());
                }
        }
  
@@@ -766,7 -769,6 +769,6 @@@ static IIO_DEVICE_ATTR(in_temp_thresh_h
                ad7280_write_channel_config,
                AD7280A_AUX_ADC_OVERVOLTAGE);
  
  static struct attribute *ad7280_event_attributes[] = {
        &iio_dev_attr_in_thresh_low_value.dev_attr.attr,
        &iio_dev_attr_in_thresh_high_value.dev_attr.attr,
@@@ -817,7 -819,7 +819,7 @@@ static int ad7280_read_raw(struct iio_d
  }
  
  static const struct iio_info ad7280_info = {
-       .read_raw = &ad7280_read_raw,
+       .read_raw = ad7280_read_raw,
        .event_attrs = &ad7280_event_attrs_group,
        .attrs = &ad7280_attrs_group,
        .driver_module = THIS_MODULE,
@@@ -839,7 -841,7 +841,7 @@@ static int ad7280_probe(struct spi_devi
        struct iio_dev *indio_dev;
  
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL)
+       if (!indio_dev)
                return -ENOMEM;
  
        st = iio_priv(indio_dev);
  
        ad7280_crc8_build_table(st->crc_tab);
  
-       st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_Hz;
+       st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ;
        st->spi->mode = SPI_MODE_1;
        spi_setup(st->spi);
  
@@@ -955,7 -957,7 +957,7 @@@ static int ad7280_remove(struct spi_dev
        iio_device_unregister(indio_dev);
  
        ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1,
-                       AD7280A_CTRL_HB_PWRDN_SW | st->ctrl_hb);
+                    AD7280A_CTRL_HB_PWRDN_SW | st->ctrl_hb);
  
        kfree(st->channels);
        kfree(st->iio_attr);
@@@ -972,6 -974,7 +974,6 @@@ MODULE_DEVICE_TABLE(spi, ad7280_id)
  static struct spi_driver ad7280_driver = {
        .driver = {
                .name   = "ad7280",
 -              .owner  = THIS_MODULE,
        },
        .probe          = ad7280_probe,
        .remove         = ad7280_remove,
index 06b59cbca4438e1f43b466277457a8d7a17719e2,b88f8825797d20643b3704f38cbbdf28fe2be727..cbb36317200e28ca6cb50a85467c03587875f997
@@@ -44,8 -44,8 +44,8 @@@ static int ad7606_spi_probe(struct spi_
        struct iio_dev *indio_dev;
  
        indio_dev = ad7606_probe(&spi->dev, spi->irq, NULL,
-                          spi_get_device_id(spi)->driver_data,
-                          &ad7606_spi_bops);
+                                spi_get_device_id(spi)->driver_data,
+                                &ad7606_spi_bops);
  
        if (IS_ERR(indio_dev))
                return PTR_ERR(indio_dev);
@@@ -85,6 -85,7 +85,7 @@@ static const struct dev_pm_ops ad7606_p
        .suspend = ad7606_spi_suspend,
        .resume  = ad7606_spi_resume,
  };
  #define AD7606_SPI_PM_OPS (&ad7606_pm_ops)
  
  #else
@@@ -102,6 -103,7 +103,6 @@@ MODULE_DEVICE_TABLE(spi, ad7606_id)
  static struct spi_driver ad7606_driver = {
        .driver = {
                .name = "ad7606",
 -              .owner = THIS_MODULE,
                .pm    = AD7606_SPI_PM_OPS,
        },
        .probe = ad7606_spi_probe,
index b76dd15427f5affb5795c539e004ff79398b3640,618b41faa289a54eedd73bba17329075a5eacbe4..3abc7789237f7220945e3df0df0b9f837e7d0c88
@@@ -62,7 -62,7 +62,7 @@@ static struct ad7780_state *ad_sigma_de
  }
  
  static int ad7780_set_mode(struct ad_sigma_delta *sigma_delta,
-       enum ad_sigma_delta_mode mode)
+                          enum ad_sigma_delta_mode mode)
  {
        struct ad7780_state *st = ad_sigma_delta_to_ad7780(sigma_delta);
        unsigned val;
@@@ -107,13 -107,13 +107,13 @@@ static int ad7780_read_raw(struct iio_d
  }
  
  static int ad7780_postprocess_sample(struct ad_sigma_delta *sigma_delta,
-       unsigned int raw_sample)
+                                    unsigned int raw_sample)
  {
        struct ad7780_state *st = ad_sigma_delta_to_ad7780(sigma_delta);
        const struct ad7780_chip_info *chip_info = st->chip_info;
  
        if ((raw_sample & AD7780_ERR) ||
-               ((raw_sample & chip_info->pattern_mask) != chip_info->pattern))
+           ((raw_sample & chip_info->pattern_mask) != chip_info->pattern))
                return -EIO;
  
        if (raw_sample & AD7780_GAIN)
@@@ -206,9 -206,10 +206,10 @@@ static int ad7780_probe(struct spi_devi
        indio_dev->info = &ad7780_info;
  
        if (pdata && gpio_is_valid(pdata->gpio_pdrst)) {
-               ret = devm_gpio_request_one(&spi->dev, pdata->gpio_pdrst,
-                                       GPIOF_OUT_INIT_LOW, "AD7780 /PDRST");
+               ret = devm_gpio_request_one(&spi->dev,
+                                           pdata->gpio_pdrst,
+                                           GPIOF_OUT_INIT_LOW,
+                                           "AD7780 /PDRST");
                if (ret) {
                        dev_err(&spi->dev, "failed to request GPIO PDRST\n");
                        goto error_disable_reg;
@@@ -263,6 -264,7 +264,6 @@@ MODULE_DEVICE_TABLE(spi, ad7780_id)
  static struct spi_driver ad7780_driver = {
        .driver = {
                .name   = "ad7780",
 -              .owner  = THIS_MODULE,
        },
        .probe          = ad7780_probe,
        .remove         = ad7780_remove,
index f3bbb38cdbe48d4d6d75a38513a18e68a76d536e,ccec57c5f70d6235c2621610750c65e352def949..c8e15664652856a331938398bffc597b4a8f0b14
@@@ -38,7 -38,6 +38,6 @@@
  #define AD7816_TEMP_FLOAT_OFFSET      2
  #define AD7816_TEMP_FLOAT_MASK                0x3
  
  /*
   * struct ad7816_chip_info - chip specific information
   */
@@@ -48,7 -47,7 +47,7 @@@ struct ad7816_chip_info 
        u16 rdwr_pin;
        u16 convert_pin;
        u16 busy_pin;
-       u8  oti_data[AD7816_CS_MAX+1];
+       u8  oti_data[AD7816_CS_MAX + 1];
        u8  channel_id; /* 0 always be temperature */
        u8  mode;
  };
@@@ -60,6 -59,7 +59,7 @@@ static int ad7816_spi_read(struct ad781
  {
        struct spi_device *spi_dev = chip->spi_dev;
        int ret = 0;
+       __be16 buf;
  
        gpio_set_value(chip->rdwr_pin, 1);
        gpio_set_value(chip->rdwr_pin, 0);
@@@ -70,7 -70,6 +70,6 @@@
        }
        gpio_set_value(chip->rdwr_pin, 1);
  
        if (chip->mode == AD7816_PD) { /* operating mode 2 */
                gpio_set_value(chip->convert_pin, 1);
                gpio_set_value(chip->convert_pin, 0);
  
        gpio_set_value(chip->rdwr_pin, 0);
        gpio_set_value(chip->rdwr_pin, 1);
-       ret = spi_read(spi_dev, (u8 *)data, sizeof(*data));
+       ret = spi_read(spi_dev, &buf, sizeof(*data));
        if (ret < 0) {
                dev_err(&spi_dev->dev, "SPI data read error\n");
                return ret;
        }
  
-       *data = be16_to_cpu(*data);
+       *data = be16_to_cpu(buf);
  
        return ret;
  }
@@@ -110,8 -109,8 +109,8 @@@ static int ad7816_spi_write(struct ad78
  }
  
  static ssize_t ad7816_show_mode(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                               struct device_attribute *attr,
+                               char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
  }
  
  static ssize_t ad7816_store_mode(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t len)
+                                struct device_attribute *attr,
+                                const char *buf,
+                                size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
@@@ -146,8 -145,8 +145,8 @@@ static IIO_DEVICE_ATTR(mode, S_IRUGO | 
                0);
  
  static ssize_t ad7816_show_available_modes(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                          struct device_attribute *attr,
+                                          char *buf)
  {
        return sprintf(buf, "full\npower-save\n");
  }
@@@ -156,8 -155,8 +155,8 @@@ static IIO_DEVICE_ATTR(available_modes
                        NULL, 0);
  
  static ssize_t ad7816_show_channel(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                  struct device_attribute *attr,
+                                  char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
  }
  
  static ssize_t ad7816_store_channel(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t len)
+                                   struct device_attribute *attr,
+                                   const char *buf,
+                                   size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
@@@ -203,10 -202,9 +202,9 @@@ static IIO_DEVICE_ATTR(channel, S_IRUG
                ad7816_store_channel,
                0);
  
  static ssize_t ad7816_show_value(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                                struct device_attribute *attr,
+                                char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
@@@ -260,8 -258,8 +258,8 @@@ static irqreturn_t ad7816_event_handler
  }
  
  static ssize_t ad7816_show_oti(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
+                              struct device_attribute *attr,
+                              char *buf)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
  }
  
  static inline ssize_t ad7816_set_oti(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t len)
+                                    struct device_attribute *attr,
+                                    const char *buf,
+                                    size_t len)
  {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct ad7816_chip_info *chip = iio_priv(indio_dev);
                return -EINVAL;
        } else if (chip->channel_id == 0) {
                if (ret || value < AD7816_BOUND_VALUE_MIN ||
-                       value > AD7816_BOUND_VALUE_MAX)
+                   value > AD7816_BOUND_VALUE_MAX)
                        return -EINVAL;
  
                data = (u8)(value - AD7816_BOUND_VALUE_MIN +
@@@ -371,7 -369,7 +369,7 @@@ static int ad7816_probe(struct spi_devi
        chip->busy_pin = pins[2];
  
        ret = devm_gpio_request(&spi_dev->dev, chip->rdwr_pin,
-                                       spi_get_device_id(spi_dev)->name);
+                               spi_get_device_id(spi_dev)->name);
        if (ret) {
                dev_err(&spi_dev->dev, "Fail to request rdwr gpio PIN %d.\n",
                        chip->rdwr_pin);
        }
        gpio_direction_input(chip->rdwr_pin);
        ret = devm_gpio_request(&spi_dev->dev, chip->convert_pin,
-                                       spi_get_device_id(spi_dev)->name);
+                               spi_get_device_id(spi_dev)->name);
        if (ret) {
                dev_err(&spi_dev->dev, "Fail to request convert gpio PIN %d.\n",
                        chip->convert_pin);
        }
        gpio_direction_input(chip->convert_pin);
        ret = devm_gpio_request(&spi_dev->dev, chip->busy_pin,
-                                       spi_get_device_id(spi_dev)->name);
+                               spi_get_device_id(spi_dev)->name);
        if (ret) {
                dev_err(&spi_dev->dev, "Fail to request busy gpio PIN %d.\n",
                        chip->busy_pin);
                return ret;
  
        dev_info(&spi_dev->dev, "%s temperature sensor and ADC registered.\n",
-                        indio_dev->name);
+                indio_dev->name);
  
        return 0;
  }
@@@ -434,6 -432,7 +432,6 @@@ MODULE_DEVICE_TABLE(spi, ad7816_id)
  static struct spi_driver ad7816_driver = {
        .driver = {
                .name = "ad7816",
 -              .owner = THIS_MODULE,
        },
        .probe = ad7816_probe,
        .id_table = ad7816_id,
index 15f0cc3b4d3172bb6127b29c4527d9a5c9fa4503,fcffe2c1168512b5ae1c747ffe247c57d4713874..6464f2cbe94b556f2738c39f874574262019ea9a
@@@ -111,7 -111,7 +111,7 @@@ static ssize_t ad9834_write(struct devi
                break;
        case AD9834_FSEL:
        case AD9834_PSEL:
-               if (val == 0) {
+               if (!val) {
                        st->control &= ~(this_attr->address | AD9834_PIN_SW);
                } else if (val == 1) {
                        st->control |= this_attr->address;
@@@ -446,6 -446,7 +446,6 @@@ MODULE_DEVICE_TABLE(spi, ad9834_id)
  static struct spi_driver ad9834_driver = {
        .driver = {
                .name   = "ad9834",
 -              .owner  = THIS_MODULE,
        },
        .probe          = ad9834_probe,
        .remove         = ad9834_remove,
index b8776d638e662a72a013b302dd811a9b608e09b1,981b63f83a7b2d8ee940b5103fb440aeb7f67772..ab816a215eb80f10acb672c905372c977c244d9d
@@@ -67,7 -67,7 +67,7 @@@ static int adis16060_spi_read(struct ii
         * starts to place data MSB first on the DOUT line at
         * the 6th falling edge of SCLK
         */
-       if (ret == 0)
+       if (!ret)
                *val = ((st->buf[0] & 0x3) << 12) |
                        (st->buf[1] << 4) |
                        ((st->buf[2] >> 4) & 0xF);
@@@ -89,11 -89,13 +89,13 @@@ static int adis16060_read_raw(struct ii
                /* Take the iio_dev status lock */
                mutex_lock(&indio_dev->mlock);
                ret = adis16060_spi_write(indio_dev, chan->address);
-               if (ret < 0) {
-                       mutex_unlock(&indio_dev->mlock);
-                       return ret;
-               }
+               if (ret < 0)
+                       goto out_unlock;
                ret = adis16060_spi_read(indio_dev, &tval);
+               if (ret < 0)
+                       goto out_unlock;
                mutex_unlock(&indio_dev->mlock);
                *val = tval;
                return IIO_VAL_INT;
        }
  
        return -EINVAL;
+ out_unlock:
+       mutex_unlock(&indio_dev->mlock);
+       return ret;
  }
  
  static const struct iio_info adis16060_info = {
@@@ -202,6 -208,7 +208,6 @@@ static int adis16060_w_remove(struct sp
  static struct spi_driver adis16060_r_driver = {
        .driver = {
                .name = "adis16060_r",
 -              .owner = THIS_MODULE,
        },
        .probe = adis16060_r_probe,
  };
  static struct spi_driver adis16060_w_driver = {
        .driver = {
                .name = "adis16060_w",
 -              .owner = THIS_MODULE,
        },
        .probe = adis16060_w_probe,
        .remove = adis16060_w_remove,
index 070c918dadcfa1e5887dfe528687f4396036e9db,1549192c0dec0372f5bb5b99611ae22327e2d182..8be198058ea20452cd3623d6e3564c58537b8d15
@@@ -59,6 -59,7 +59,7 @@@ static const struct regmap_config hmc58
  static int hmc5843_spi_probe(struct spi_device *spi)
  {
        int ret;
+       const struct spi_device_id *id = spi_get_device_id(spi);
  
        spi->mode = SPI_MODE_3;
        spi->max_speed_hz = 8000000;
@@@ -69,7 -70,7 +70,7 @@@
  
        return hmc5843_common_probe(&spi->dev,
                        devm_regmap_init_spi(spi, &hmc5843_spi_regmap_config),
-                       HMC5983_ID);
+                       id->driver_data, id->name);
  }
  
  static int hmc5843_spi_remove(struct spi_device *spi)
@@@ -81,11 -82,13 +82,12 @@@ static const struct spi_device_id hmc58
        { "hmc5983", HMC5983_ID },
        { }
  };
+ MODULE_DEVICE_TABLE(spi, hmc5843_id);
  
  static struct spi_driver hmc5843_driver = {
                .driver = {
                                .name = "hmc5843",
                                .pm = HMC5843_PM_OPS,
 -                              .owner = THIS_MODULE,
                },
                .id_table = hmc5843_id,
                .probe = hmc5843_spi_probe,
index 9ca9fef4b8bac7ffa23484550e3449ac24519ffd,188830d7e2574109592fae90d66ab09a4579214d..f129039bece3c74b96fb78e70996ea65279502ea
@@@ -219,7 -219,7 +219,7 @@@ static int ade7753_reset(struct device 
        u16 val;
  
        ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
-       val |= 1 << 6; /* Software Chip Reset */
+       val |= BIT(6); /* Software Chip Reset */
  
        return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
  }
@@@ -328,10 -328,10 +328,10 @@@ static int ade7753_set_irq(struct devic
                goto error_ret;
  
        if (enable)
-               irqen |= 1 << 3; /* Enables an interrupt when a data is
+               irqen |= BIT(3); /* Enables an interrupt when a data is
                                    present in the waveform register */
        else
-               irqen &= ~(1 << 3);
+               irqen &= ~BIT(3);
  
        ret = ade7753_spi_write_reg_8(dev, ADE7753_IRQEN, irqen);
  
@@@ -345,7 -345,7 +345,7 @@@ static int ade7753_stop_device(struct d
        u16 val;
  
        ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
-       val |= 1 << 4;  /* AD converters can be turned off */
+       val |= BIT(4);  /* AD converters can be turned off */
  
        return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
  }
@@@ -406,7 -406,7 +406,7 @@@ static ssize_t ade7753_write_frequency(
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
  
        mutex_lock(&indio_dev->mlock);
@@@ -534,6 -534,7 +534,6 @@@ static int ade7753_remove(struct spi_de
  static struct spi_driver ade7753_driver = {
        .driver = {
                .name = "ade7753",
 -              .owner = THIS_MODULE,
        },
        .probe = ade7753_probe,
        .remove = ade7753_remove,
index 5609872532f11b4a0a6fc8a5d69098dfabd48aea,664c6e5f76b13e872484d19328c163a9446eebcf..1e950685e12f94bf3ee1864b9ff1b60a39845271
@@@ -223,7 -223,7 +223,7 @@@ static int ade7754_reset(struct device 
        if (ret < 0)
                return ret;
  
-       val |= 1 << 6; /* Software Chip Reset */
+       val |= BIT(6); /* Software Chip Reset */
        return ade7754_spi_write_reg_8(dev, ADE7754_OPMODE, val);
  }
  
@@@ -350,10 -350,10 +350,10 @@@ static int ade7754_set_irq(struct devic
                goto error_ret;
  
        if (enable)
-               irqen |= 1 << 14; /* Enables an interrupt when a data is
+               irqen |= BIT(14); /* Enables an interrupt when a data is
                                     present in the waveform register */
        else
-               irqen &= ~(1 << 14);
+               irqen &= ~BIT(14);
  
        ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
        if (ret)
@@@ -438,7 -438,7 +438,7 @@@ static ssize_t ade7754_write_frequency(
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
  
        mutex_lock(&indio_dev->mlock);
@@@ -575,6 -575,7 +575,6 @@@ static int ade7754_remove(struct spi_de
  static struct spi_driver ade7754_driver = {
        .driver = {
                .name = "ade7754",
 -              .owner = THIS_MODULE,
        },
        .probe = ade7754_probe,
        .remove = ade7754_remove,
index d348e161c8484a17ddd6bffc9306844078ba9752,38838085824fc796483eea72919d7ab9df3e5ab2..0db23e4d1852b01936823da0c8c79225667d0049
@@@ -308,7 -308,7 +308,7 @@@ static int ade7758_reset(struct device 
                dev_err(dev, "Failed to read opmode reg\n");
                return ret;
        }
-       val |= 1 << 6; /* Software Chip Reset */
+       val |= BIT(6); /* Software Chip Reset */
        ret = ade7758_spi_write_reg_8(dev, ADE7758_OPMODE, val);
        if (ret < 0)
                dev_err(dev, "Failed to write opmode reg\n");
@@@ -426,10 -426,10 +426,10 @@@ int ade7758_set_irq(struct device *dev
                goto error_ret;
  
        if (enable)
-               irqen |= 1 << 16; /* Enables an interrupt when a data is
+               irqen |= BIT(16); /* Enables an interrupt when a data is
                                     present in the waveform register */
        else
-               irqen &= ~(1 << 16);
+               irqen &= ~BIT(16);
  
        ret = ade7758_spi_write_reg_24(dev, ADE7758_MASK, irqen);
        if (ret)
@@@ -904,6 -904,7 +904,6 @@@ MODULE_DEVICE_TABLE(spi, ade7758_id)
  static struct spi_driver ade7758_driver = {
        .driver = {
                .name = "ade7758",
 -              .owner = THIS_MODULE,
        },
        .probe = ade7758_probe,
        .remove = ade7758_remove,
index f774a62cad4ef945d63f605c3185fd6c73329d17,11c1edcc1ed638478fd2c3ba4ebba477fbd52f60..684e612a88b934f7f3fde54799d2d2a2fe3ebe88
@@@ -224,7 -224,7 +224,7 @@@ static int ade7759_reset(struct device 
        if (ret < 0)
                return ret;
  
-       val |= 1 << 6; /* Software Chip Reset */
+       val |= BIT(6); /* Software Chip Reset */
        return ade7759_spi_write_reg_16(dev,
                        ADE7759_MODE,
                        val);
@@@ -288,10 -288,10 +288,10 @@@ static int ade7759_set_irq(struct devic
                goto error_ret;
  
        if (enable)
-               irqen |= 1 << 3; /* Enables an interrupt when a data is
+               irqen |= BIT(3); /* Enables an interrupt when a data is
                                    present in the waveform register */
        else
-               irqen &= ~(1 << 3);
+               irqen &= ~BIT(3);
  
        ret = ade7759_spi_write_reg_8(dev, ADE7759_IRQEN, irqen);
  
@@@ -314,7 -314,7 +314,7 @@@ static int ade7759_stop_device(struct d
                return ret;
        }
  
-       val |= 1 << 4;  /* AD converters can be turned off */
+       val |= BIT(4);  /* AD converters can be turned off */
  
        return ade7759_spi_write_reg_16(dev, ADE7759_MODE, val);
  }
@@@ -377,7 -377,7 +377,7 @@@ static ssize_t ade7759_write_frequency(
        ret = kstrtou16(buf, 10, &val);
        if (ret)
                return ret;
-       if (val == 0)
+       if (!val)
                return -EINVAL;
  
        mutex_lock(&indio_dev->mlock);
@@@ -490,6 -490,7 +490,6 @@@ static int ade7759_remove(struct spi_de
  static struct spi_driver ade7759_driver = {
        .driver = {
                .name = "ade7759",
 -              .owner = THIS_MODULE,
        },
        .probe = ade7759_probe,
        .remove = ade7759_remove,
index 16f288d8b8f6dc1d9647a0282b5832b29ccff2fc,da774866512c3828d33b0bdffe34e252f71551ea..2413052c5bfb5d23cd880d56e90127d367756528
@@@ -278,7 -278,7 +278,7 @@@ static int ade7854_spi_probe(struct spi
        struct iio_dev *indio_dev;
  
        indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-       if (indio_dev == NULL)
+       if (!indio_dev)
                return -ENOMEM;
        st = iio_priv(indio_dev);
        spi_set_drvdata(spi, indio_dev);
@@@ -314,6 -314,7 +314,6 @@@ MODULE_DEVICE_TABLE(spi, ade7854_id)
  static struct spi_driver ade7854_driver = {
        .driver = {
                .name = "ade7854",
 -              .owner = THIS_MODULE,
        },
        .probe = ade7854_spi_probe,
        .remove = ade7854_spi_remove,
index 95f5426a14d90a449a27433cc29fb48202aefed2,3bd65f5c9cf5a5d9f7109e70e752423ceccc76f5..d97aa2827412a606de57a66e858db205a96f13a0
@@@ -633,7 -633,7 +633,7 @@@ error_ret
  }
  
  static const struct iio_info ad2s1210_info = {
-       .read_raw = &ad2s1210_read_raw,
+       .read_raw = ad2s1210_read_raw,
        .attrs = &ad2s1210_attribute_group,
        .driver_module = THIS_MODULE,
  };
@@@ -735,6 -735,7 +735,6 @@@ MODULE_DEVICE_TABLE(spi, ad2s1210_id)
  static struct spi_driver ad2s1210_driver = {
        .driver = {
                .name = DRV_NAME,
 -              .owner = THIS_MODULE,
        },
        .probe = ad2s1210_probe,
        .remove = ad2s1210_remove,
index cfeedfb7c774e1177a546c370a2ff1747e9dd2cf,c57a29616223ba54b8335691d6b122c7a6553f30..5b1c0db33e7f2dfe4ddbebdc48c117b01f146e5b
@@@ -79,7 -79,7 +79,7 @@@ static int ad2s90_probe(struct spi_devi
        indio_dev->num_channels = 1;
        indio_dev->name = spi_get_device_id(spi)->name;
  
-       ret = iio_device_register(indio_dev);
+       ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
        if (ret)
                return ret;
  
        return 0;
  }
  
- static int ad2s90_remove(struct spi_device *spi)
- {
-       iio_device_unregister(spi_get_drvdata(spi));
-       return 0;
- }
  static const struct spi_device_id ad2s90_id[] = {
        { "ad2s90" },
        {}
@@@ -107,9 -100,9 +100,8 @@@ MODULE_DEVICE_TABLE(spi, ad2s90_id)
  static struct spi_driver ad2s90_driver = {
        .driver = {
                .name = "ad2s90",
 -              .owner = THIS_MODULE,
        },
        .probe = ad2s90_probe,
-       .remove = ad2s90_remove,
        .id_table = ad2s90_id,
  };
  module_spi_driver(ad2s90_driver);
index 993d1ff9ba21987612362d122b7082242314b313,5f78b42b427aef46d8567789ce1cb36bf3fae00e..263db37de7c807821ffe98b2156252b4ecf24ebf
  #define IBLND_N_SCHED_HIGH            4
  
  typedef struct {
-       int          *kib_dev_failover;      /* HCA failover */
-       unsigned int *kib_service;           /* IB service number */
-       int          *kib_min_reconnect_interval; /* first failed connection
-                                                  * retry... */
-       int          *kib_max_reconnect_interval; /* ...exponentially increasing
-                                                  * to this */
-       int          *kib_cksum;             /* checksum kib_msg_t? */
-       int          *kib_timeout;           /* comms timeout (seconds) */
-       int          *kib_keepalive;         /* keepalive timeout (seconds) */
-       int          *kib_ntx;               /* # tx descs */
-       int          *kib_credits;           /* # concurrent sends */
-       int          *kib_peertxcredits;     /* # concurrent sends to 1 peer */
-       int          *kib_peerrtrcredits;    /* # per-peer router buffer
-                                             * credits */
-       int          *kib_peercredits_hiw;   /* # when eagerly to return
-                                             * credits */
-       int          *kib_peertimeout;       /* seconds to consider peer dead */
-       char         **kib_default_ipif;     /* default IPoIB interface */
-       int          *kib_retry_count;
-       int          *kib_rnr_retry_count;
-       int          *kib_concurrent_sends;  /* send work queue sizing */
-       int          *kib_ib_mtu;            /* IB MTU */
-       int          *kib_map_on_demand;     /* map-on-demand if RD has more
-                                             * fragments than this value, 0
-                                             * disable map-on-demand */
-       int          *kib_fmr_pool_size;     /* # FMRs in pool */
-       int          *kib_fmr_flush_trigger; /* When to trigger FMR flush */
-       int          *kib_fmr_cache;         /* enable FMR pool cache? */
-       int          *kib_require_priv_port; /* accept only privileged ports */
-       int          *kib_use_priv_port;     /* use privileged port for active
-                                             * connect */
-       int          *kib_nscheds;           /* # threads on each CPT */
+       int *kib_dev_failover;           /* HCA failover */
+       unsigned int *kib_service;       /* IB service number */
+       int *kib_min_reconnect_interval; /* first failed connection retry... */
+       int *kib_max_reconnect_interval; /* exponentially increasing to this */
+       int *kib_cksum;                  /* checksum kib_msg_t? */
+       int *kib_timeout;                /* comms timeout (seconds) */
+       int *kib_keepalive;              /* keepalive timeout (seconds) */
+       int *kib_ntx;                    /* # tx descs */
+       int *kib_credits;                /* # concurrent sends */
+       int *kib_peertxcredits;          /* # concurrent sends to 1 peer */
+       int *kib_peerrtrcredits;         /* # per-peer router buffer credits */
+       int *kib_peercredits_hiw;        /* # when eagerly to return credits */
+       int *kib_peertimeout;            /* seconds to consider peer dead */
+       char **kib_default_ipif;         /* default IPoIB interface */
+       int *kib_retry_count;
+       int *kib_rnr_retry_count;
+       int *kib_concurrent_sends;       /* send work queue sizing */
+       int *kib_ib_mtu;                 /* IB MTU */
+       int *kib_map_on_demand;          /* map-on-demand if RD has more */
+                                        /* fragments than this value, 0 */
+                                        /* disable map-on-demand */
+       int *kib_fmr_pool_size;          /* # FMRs in pool */
+       int *kib_fmr_flush_trigger;      /* When to trigger FMR flush */
+       int *kib_fmr_cache;              /* enable FMR pool cache? */
+       int *kib_require_priv_port;      /* accept only privileged ports */
+       int *kib_use_priv_port; /* use privileged port for active connect */
+       int *kib_nscheds;                /* # threads on each CPT */
  } kib_tunables_t;
  
  extern kib_tunables_t  kiblnd_tunables;
                                     IBLND_CREDIT_HIGHWATER_V1 : \
                                     *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
  
 -#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt)
 +#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(&init_net, \
 +                                                             cb, dev, \
 +                                                             ps, qpt)
  
  static inline int
  kiblnd_concurrent_sends_v1(void)
@@@ -201,8 -194,7 +196,7 @@@ typedef struct 
        unsigned long      ibd_next_failover;
        int                ibd_failed_failover; /* # failover failures */
        unsigned int       ibd_failover;        /* failover in progress */
-       unsigned int       ibd_can_failover;    /* IPoIB interface is a bonding
-                                                * master */
+       unsigned int ibd_can_failover; /* IPoIB interface is a bonding master */
        struct list_head   ibd_nets;
        struct kib_hca_dev *ibd_hdev;
  } kib_dev_t;
@@@ -251,28 -243,26 +245,26 @@@ typedef struct kib_poolset 
        char                  ps_name[IBLND_POOL_NAME_LEN]; /* pool set name */
        struct list_head      ps_pool_list;       /* list of pools */
        struct list_head      ps_failed_pool_list;/* failed pool list */
-       unsigned long         ps_next_retry;      /* time stamp for retry if
-                                                  * failed to allocate */
+       unsigned long         ps_next_retry;      /* time stamp for retry if */
+                                                 /* failed to allocate */
        int                   ps_increasing;      /* is allocating new pool */
        int                   ps_pool_size;       /* new pool size */
        int                   ps_cpt;             /* CPT id */
  
        kib_ps_pool_create_t  ps_pool_create;     /* create a new pool */
        kib_ps_pool_destroy_t ps_pool_destroy;    /* destroy a pool */
-       kib_ps_node_init_t    ps_node_init;       /* initialize new allocated
-                                                  * node */
+       kib_ps_node_init_t    ps_node_init; /* initialize new allocated node */
        kib_ps_node_fini_t    ps_node_fini;       /* finalize node */
  } kib_poolset_t;
  
  typedef struct kib_pool {
-       struct list_head      po_list;         /* chain on pool list */
-       struct list_head      po_free_list;    /* pre-allocated node */
-       kib_poolset_t         *po_owner;       /* pool_set of this pool */
-       unsigned long         po_deadline;     /* deadline of this pool */
-       int                   po_allocated;    /* # of elements in use */
-       int                   po_failed;       /* pool is created on failed
-                                               * HCA */
-       int                   po_size;         /* # of pre-allocated elements */
+       struct list_head      po_list;       /* chain on pool list */
+       struct list_head      po_free_list;  /* pre-allocated node */
+       kib_poolset_t         *po_owner;     /* pool_set of this pool */
+       unsigned long         po_deadline;   /* deadline of this pool */
+       int                   po_allocated;  /* # of elements in use */
+       int                   po_failed;     /* pool is created on failed HCA */
+       int                   po_size;       /* # of pre-allocated elements */
  } kib_pool_t;
  
  typedef struct {
@@@ -297,8 -287,8 +289,8 @@@ typedef struct 
        int                   fps_pool_size;
        int                   fps_flush_trigger;
        int                   fps_increasing;      /* is allocating new pool */
-       unsigned long         fps_next_retry;      /* time stamp for retry if
-                                                   * failed to allocate */
+       unsigned long         fps_next_retry;      /* time stamp for retry if*/
+                                                  /* failed to allocate */
  } kib_fmr_poolset_t;
  
  typedef struct {
@@@ -346,31 -336,22 +338,22 @@@ struct kib_sched_info 
  };
  
  typedef struct {
-       int                   kib_init;           /* initialisation state */
-       int                   kib_shutdown;       /* shut down? */
-       struct list_head      kib_devs;           /* IB devices extant */
-       struct list_head      kib_failed_devs;    /* list head of failed
-                                                  * devices */
-       wait_queue_head_t     kib_failover_waitq; /* schedulers sleep here */
-       atomic_t              kib_nthreads;       /* # live threads */
-       rwlock_t              kib_global_lock;    /* stabilize net/dev/peer/conn
-                                                  * ops */
-       struct list_head      *kib_peers;         /* hash table of all my known
-                                                  * peers */
-       int                   kib_peer_hash_size; /* size of kib_peers */
-       void                  *kib_connd;         /* the connd task
-                                                  * (serialisation assertions)
-                                                  */
-       struct list_head      kib_connd_conns;    /* connections to
-                                                  * setup/teardown */
-       struct list_head      kib_connd_zombies;  /* connections with zero
-                                                  * refcount */
-       wait_queue_head_t     kib_connd_waitq;    /* connection daemon sleeps
-                                                  * here */
-       spinlock_t            kib_connd_lock;     /* serialise */
-       struct ib_qp_attr     kib_error_qpa;      /* QP->ERROR */
-       struct kib_sched_info **kib_scheds;       /* percpt data for schedulers
-                                                  */
+       int               kib_init;           /* initialisation state */
+       int               kib_shutdown;       /* shut down? */
+       struct list_head  kib_devs;           /* IB devices extant */
+       struct list_head  kib_failed_devs;    /* list head of failed devices */
+       wait_queue_head_t kib_failover_waitq; /* schedulers sleep here */
+       atomic_t kib_nthreads;                /* # live threads */
+       rwlock_t kib_global_lock;    /* stabilize net/dev/peer/conn ops */
+       struct list_head *kib_peers; /* hash table of all my known peers */
+       int  kib_peer_hash_size;     /* size of kib_peers */
+       void *kib_connd; /* the connd task (serialisation assertions) */
+       struct list_head kib_connd_conns;   /* connections to setup/teardown */
+       struct list_head kib_connd_zombies; /* connections with zero refcount */
+       wait_queue_head_t kib_connd_waitq;  /* connection daemon sleeps here */
+       spinlock_t kib_connd_lock;          /* serialise */
+       struct ib_qp_attr kib_error_qpa;    /* QP->ERROR */
+       struct kib_sched_info **kib_scheds; /* percpt data for schedulers */
  } kib_data_t;
  
  #define IBLND_INIT_NOTHING 0
@@@ -482,10 -463,10 +465,10 @@@ typedef struct 
  #define IBLND_REJECT_FATAL          3 /* Anything else */
  #define IBLND_REJECT_CONN_UNCOMPAT  4 /* incompatible version peer */
  #define IBLND_REJECT_CONN_STALE     5 /* stale peer */
- #define IBLND_REJECT_RDMA_FRAGS     6 /* Fatal: peer's rdma frags can't match
-                                      * mine */
- #define IBLND_REJECT_MSG_QUEUE_SIZE 7 /* Fatal: peer's msg queue size can't
-                                      * match mine */
+ #define IBLND_REJECT_RDMA_FRAGS     6 /* Fatal: peer's rdma frags can't match */
+                                     /* mine */
+ #define IBLND_REJECT_MSG_QUEUE_SIZE 7 /* Fatal: peer's msg queue size can't */
+                                     /* match mine */
  
  /***********************************************************************/
  
@@@ -493,8 -474,7 +476,7 @@@ typedef struct kib_r
  {
        struct list_head       rx_list;       /* queue for attention */
        struct kib_conn        *rx_conn;      /* owning conn */
-       int                    rx_nob;        /* # bytes received (-1 while
-                                              * posted) */
+       int                    rx_nob; /* # bytes received (-1 while posted) */
        enum ib_wc_status      rx_status;     /* completion status */
        kib_msg_t              *rx_msg;       /* message buffer (host vaddr) */
        __u64                  rx_msgaddr;    /* message buffer (I/O addr) */
        struct ib_sge          rx_sge;        /* ...and its memory */
  } kib_rx_t;
  
- #define IBLND_POSTRX_DONT_POST    0   /* don't post */
- #define IBLND_POSTRX_NO_CREDIT    1   /* post: no credits */
- #define IBLND_POSTRX_PEER_CREDIT  2   /* post: give peer back 1 credit */
- #define IBLND_POSTRX_RSRVD_CREDIT 3   /* post: give myself back 1 reserved
-                                      * credit */
+ #define IBLND_POSTRX_DONT_POST    0 /* don't post */
+ #define IBLND_POSTRX_NO_CREDIT    1 /* post: no credits */
+ #define IBLND_POSTRX_PEER_CREDIT  2 /* post: give peer back 1 credit */
+ #define IBLND_POSTRX_RSRVD_CREDIT 3 /* post: give self back 1 reserved credit */
  
  typedef struct kib_tx                         /* transmit message */
  {
-       struct list_head       tx_list;       /* queue on idle_txs ibc_tx_queue
-                                              * etc. */
-       kib_tx_pool_t          *tx_pool;      /* pool I'm from */
-       struct kib_conn        *tx_conn;      /* owning conn */
-       short                  tx_sending;    /* # tx callbacks outstanding */
-       short                  tx_queued;     /* queued for sending */
-       short                  tx_waiting;    /* waiting for peer */
-       int                    tx_status;     /* LNET completion status */
-       unsigned long          tx_deadline;   /* completion deadline */
-       __u64                  tx_cookie;     /* completion cookie */
-       lnet_msg_t             *tx_lntmsg[2]; /* lnet msgs to finalize on
-                                              * completion */
-       kib_msg_t              *tx_msg;       /* message buffer (host vaddr) */
-       __u64                  tx_msgaddr;    /* message buffer (I/O addr) */
+       struct list_head      tx_list; /* queue on idle_txs ibc_tx_queue etc. */
+       kib_tx_pool_t         *tx_pool;       /* pool I'm from */
+       struct kib_conn       *tx_conn;       /* owning conn */
+       short                 tx_sending;     /* # tx callbacks outstanding */
+       short                 tx_queued;      /* queued for sending */
+       short                 tx_waiting;     /* waiting for peer */
+       int                   tx_status;      /* LNET completion status */
+       unsigned long         tx_deadline;    /* completion deadline */
+       __u64                 tx_cookie;      /* completion cookie */
+       lnet_msg_t *tx_lntmsg[2]; /* lnet msgs to finalize on completion */
+       kib_msg_t             *tx_msg;        /* message buffer (host vaddr) */
+       __u64                 tx_msgaddr;     /* message buffer (I/O addr) */
        DECLARE_PCI_UNMAP_ADDR(tx_msgunmap);  /* for dma_unmap_single() */
-       int                    tx_nwrq;       /* # send work items */
-       struct ib_rdma_wr      *tx_wrq;       /* send work items... */
-       struct ib_sge          *tx_sge;       /* ...and their memory */
-       kib_rdma_desc_t        *tx_rd;        /* rdma descriptor */
-       int                    tx_nfrags;     /* # entries in... */
-       struct scatterlist     *tx_frags;     /* dma_map_sg descriptor */
-       __u64                  *tx_pages;     /* rdma phys page addrs */
-       kib_fmr_t               fmr;          /* FMR */
-       int                    tx_dmadir;     /* dma direction */
+       int                   tx_nwrq;        /* # send work items */
 -      struct ib_send_wr     *tx_wrq;        /* send work items... */
++      struct ib_rdma_wr     *tx_wrq;        /* send work items... */
+       struct ib_sge         *tx_sge;        /* ...and their memory */
+       kib_rdma_desc_t       *tx_rd;         /* rdma descriptor */
+       int                   tx_nfrags;      /* # entries in... */
+       struct scatterlist    *tx_frags;      /* dma_map_sg descriptor */
+       __u64                 *tx_pages;      /* rdma phys page addrs */
+       kib_fmr_t             fmr;            /* FMR */
+       int                   tx_dmadir;      /* dma direction */
  } kib_tx_t;
  
  typedef struct kib_connvars {
  } kib_connvars_t;
  
  typedef struct kib_conn {
-       struct kib_sched_info *ibc_sched;           /* scheduler information */
-       struct kib_peer       *ibc_peer;            /* owning peer */
-       kib_hca_dev_t         *ibc_hdev;            /* HCA bound on */
-       struct list_head      ibc_list;             /* stash on peer's conn
-                                                    * list */
-       struct list_head      ibc_sched_list;       /* schedule for attention */
-       __u16                 ibc_version;          /* version of connection */
-       __u64                 ibc_incarnation;      /* which instance of the
-                                                    * peer */
-       atomic_t              ibc_refcount;         /* # users */
-       int                   ibc_state;            /* what's happening */
-       int                   ibc_nsends_posted;    /* # uncompleted sends */
-       int                   ibc_noops_posted;     /* # uncompleted NOOPs */
-       int                   ibc_credits;          /* # credits I have */
+       struct kib_sched_info *ibc_sched;      /* scheduler information */
+       struct kib_peer       *ibc_peer;       /* owning peer */
+       kib_hca_dev_t         *ibc_hdev;       /* HCA bound on */
+       struct list_head ibc_list;             /* stash on peer's conn list */
+       struct list_head      ibc_sched_list;  /* schedule for attention */
+       __u16                 ibc_version;     /* version of connection */
+       __u64                 ibc_incarnation; /* which instance of the peer */
+       atomic_t              ibc_refcount;    /* # users */
+       int                   ibc_state;       /* what's happening */
+       int                   ibc_nsends_posted; /* # uncompleted sends */
+       int                   ibc_noops_posted;  /* # uncompleted NOOPs */
+       int                   ibc_credits;     /* # credits I have */
        int                   ibc_outstanding_credits; /* # credits to return */
        int                   ibc_reserved_credits; /* # ACK/DONE msg credits */
-       int                   ibc_comms_error;      /* set on comms error */
-       unsigned int          ibc_nrx:16;           /* receive buffers owned */
-       unsigned int          ibc_scheduled:1;      /* scheduled for attention
-                                                    */
-       unsigned int          ibc_ready:1;          /* CQ callback fired */
-       unsigned long         ibc_last_send;        /* time of last send */
-       struct list_head      ibc_connd_list;       /* link chain for
-                                                    * kiblnd_check_conns only
-                                                    */
-       struct list_head      ibc_early_rxs;        /* rxs completed before
-                                                    * ESTABLISHED */
-       struct list_head      ibc_tx_noops;         /* IBLND_MSG_NOOPs for
-                                                    * IBLND_MSG_VERSION_1 */
-       struct list_head      ibc_tx_queue;         /* sends that need a credit
-                                                    */
-       struct list_head      ibc_tx_queue_nocred;  /* sends that don't need a
-                                                    * credit */
-       struct list_head      ibc_tx_queue_rsrvd;   /* sends that need to
-                                                    * reserve an ACK/DONE msg
-                                                    */
-       struct list_head      ibc_active_txs;       /* active tx awaiting
-                                                    * completion */
-       spinlock_t            ibc_lock;             /* serialise */
-       kib_rx_t              *ibc_rxs;             /* the rx descs */
-       kib_pages_t           *ibc_rx_pages;        /* premapped rx msg pages */
-       struct rdma_cm_id     *ibc_cmid;            /* CM id */
-       struct ib_cq          *ibc_cq;              /* completion queue */
-       kib_connvars_t        *ibc_connvars;        /* in-progress connection
-                                                    * state */
+       int                   ibc_comms_error; /* set on comms error */
+       unsigned int          ibc_nrx:16;      /* receive buffers owned */
+       unsigned int          ibc_scheduled:1; /* scheduled for attention */
+       unsigned int          ibc_ready:1;     /* CQ callback fired */
+       unsigned long         ibc_last_send;   /* time of last send */
+       struct list_head      ibc_connd_list;  /* link chain for */
+                                              /* kiblnd_check_conns only */
+       struct list_head ibc_early_rxs; /* rxs completed before ESTABLISHED */
+       struct list_head ibc_tx_noops;         /* IBLND_MSG_NOOPs for */
+                                              /* IBLND_MSG_VERSION_1 */
+       struct list_head ibc_tx_queue;         /* sends that need a credit */
+       struct list_head ibc_tx_queue_nocred;  /* sends that don't need a */
+                                              /* credit */
+       struct list_head ibc_tx_queue_rsrvd;   /* sends that need to */
+                                              /* reserve an ACK/DONE msg */
+       struct list_head ibc_active_txs; /* active tx awaiting completion */
+       spinlock_t            ibc_lock;        /* serialise */
+       kib_rx_t              *ibc_rxs;        /* the rx descs */
+       kib_pages_t           *ibc_rx_pages;   /* premapped rx msg pages */
+       struct rdma_cm_id     *ibc_cmid;       /* CM id */
+       struct ib_cq          *ibc_cq;         /* completion queue */
+       kib_connvars_t        *ibc_connvars; /* in-progress connection state */
  } kib_conn_t;
  
  #define IBLND_CONN_INIT           0    /* being initialised */
@@@ -782,8 -750,8 +752,8 @@@ kiblnd_queue2str(kib_conn_t *conn, stru
        return NULL;
  }
  
- /* CAVEAT EMPTOR: We rely on descriptor alignment to allow us to use the
 * lowest bits of the work request id to stash the work item type. */
+ /* CAVEAT EMPTOR: We rely on descriptor alignment to allow us to use the */
/* lowest bits of the work request id to stash the work item type. */
  
  #define IBLND_WID_TX    0
  #define IBLND_WID_RDMA  1
@@@ -880,7 -848,6 +850,6 @@@ kiblnd_rd_msg_size(kib_rdma_desc_t *rd
               offsetof(kib_putack_msg_t, ibpam_rd.rd_frags[n]);
  }
  
  static inline __u64
  kiblnd_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
  {
@@@ -930,23 -897,19 +899,19 @@@ static inline unsigned int kiblnd_sg_dm
        return ib_sg_dma_len(dev, sg);
  }
  
- /* XXX We use KIBLND_CONN_PARAM(e) as writable buffer, it's not strictly
-  * right because OFED1.2 defines it as const, to use it we have to add
 * (void *) cast to overcome "const" */
+ /* XXX We use KIBLND_CONN_PARAM(e) as writable buffer, it's not strictly */
+ /* right because OFED1.2 defines it as const, to use it we have to add */
/* (void *) cast to overcome "const" */
  
  #define KIBLND_CONN_PARAM(e)     ((e)->param.conn.private_data)
  #define KIBLND_CONN_PARAM_LEN(e) ((e)->param.conn.private_data_len)
  
  struct ib_mr *kiblnd_find_rd_dma_mr(kib_hca_dev_t *hdev,
                                    kib_rdma_desc_t *rd);
  struct ib_mr *kiblnd_find_dma_mr(kib_hca_dev_t *hdev,
                                 __u64 addr, __u64 size);
  void kiblnd_map_rx_descs(kib_conn_t *conn);
  void kiblnd_unmap_rx_descs(kib_conn_t *conn);
- int kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx,
-                 kib_rdma_desc_t *rd, int nfrags);
- void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx);
  void kiblnd_pool_free_node(kib_pool_t *pool, struct list_head *node);
  struct list_head *kiblnd_pool_alloc_node(kib_poolset_t *ps);
  
index a34f1707c16700accd94ace637cc30f29a5be49e,8989e36091fba7f70b3ddd55c78a2ca49f01cc3d..260750354a41707311aaec9afde6667e34959e5a
@@@ -40,6 -40,8 +40,8 @@@
  
  #include "o2iblnd.h"
  
+ static void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx);
  static void
  kiblnd_tx_done(lnet_ni_t *ni, kib_tx_t *tx)
  {
@@@ -178,24 -180,28 +180,28 @@@ kiblnd_post_rx(kib_rx_t *rx, int credit
  
        rx->rx_nob = -1;                        /* flag posted */
  
+       /* NB: need an extra reference after ib_post_recv because we don't
+        * own this rx (and rx::rx_conn) anymore, LU-5678.
+        */
+       kiblnd_conn_addref(conn);
        rc = ib_post_recv(conn->ibc_cmid->qp, &rx->rx_wrq, &bad_wrq);
-       if (rc != 0) {
+       if (unlikely(rc != 0)) {
                CERROR("Can't post rx for %s: %d, bad_wrq: %p\n",
                       libcfs_nid2str(conn->ibc_peer->ibp_nid), rc, bad_wrq);
                rx->rx_nob = 0;
        }
  
        if (conn->ibc_state < IBLND_CONN_ESTABLISHED) /* Initial post */
-               return rc;
+               goto out;
  
-       if (rc != 0) {
+       if (unlikely(rc != 0)) {
                kiblnd_close_conn(conn, rc);
                kiblnd_drop_rx(rx);          /* No more posts for this rx */
-               return rc;
+               goto out;
        }
  
        if (credit == IBLND_POSTRX_NO_CREDIT)
-               return 0;
+               goto out;
  
        spin_lock(&conn->ibc_lock);
        if (credit == IBLND_POSTRX_PEER_CREDIT)
        spin_unlock(&conn->ibc_lock);
  
        kiblnd_check_sends(conn);
-       return 0;
+ out:
+       kiblnd_conn_decref(conn);
+       return rc;
  }
  
  static kib_tx_t *
@@@ -253,11 -261,10 +261,10 @@@ kiblnd_handle_completion(kib_conn_t *co
        }
  
        if (tx->tx_status == 0) {              /* success so far */
-               if (status < 0) {              /* failed? */
+               if (status < 0) /* failed? */
                        tx->tx_status = status;
-               } else if (txtype == IBLND_MSG_GET_REQ) {
+               else if (txtype == IBLND_MSG_GET_REQ)
                        lnet_set_reply_msg_len(ni, tx->tx_lntmsg[1], status);
-               }
        }
  
        tx->tx_waiting = 0;
@@@ -591,8 -598,7 +598,7 @@@ kiblnd_fmr_map_tx(kib_net_t *net, kib_t
        return 0;
  }
  
- void
- kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx)
+ static void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx)
  {
        kib_net_t *net = ni->ni_data;
  
        }
  }
  
- int
- kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx,
-             kib_rdma_desc_t *rd, int nfrags)
+ static int kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
+                        int nfrags)
  {
        kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
        kib_net_t *net = ni->ni_data;
        return -EINVAL;
  }
  
  static int
  kiblnd_setup_rd_iov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
                    unsigned int niov, struct kvec *iov, int offset, int nob)
@@@ -834,7 -838,7 +838,7 @@@ kiblnd_post_tx_locked(kib_conn_t *conn
                /* close_conn will launch failover */
                rc = -ENETDOWN;
        } else {
 -              rc = ib_post_send(conn->ibc_cmid->qp, tx->tx_wrq, &bad_wrq);
 +              rc = ib_post_send(conn->ibc_cmid->qp, &tx->tx_wrq->wr, &bad_wrq);
        }
  
        conn->ibc_last_send = jiffies;
@@@ -1008,7 -1012,7 +1012,7 @@@ kiblnd_init_tx_msg(lnet_ni_t *ni, kib_t
  {
        kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
        struct ib_sge *sge = &tx->tx_sge[tx->tx_nwrq];
 -      struct ib_send_wr *wrq = &tx->tx_wrq[tx->tx_nwrq];
 +      struct ib_rdma_wr *wrq = &tx->tx_wrq[tx->tx_nwrq];
        int nob = offsetof(kib_msg_t, ibm_u) + body_nob;
        struct ib_mr *mr;
  
  
        memset(wrq, 0, sizeof(*wrq));
  
 -      wrq->next       = NULL;
 -      wrq->wr_id      = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
 -      wrq->sg_list    = sge;
 -      wrq->num_sge    = 1;
 -      wrq->opcode     = IB_WR_SEND;
 -      wrq->send_flags = IB_SEND_SIGNALED;
 +      wrq->wr.next       = NULL;
 +      wrq->wr.wr_id      = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
 +      wrq->wr.sg_list    = sge;
 +      wrq->wr.num_sge    = 1;
 +      wrq->wr.opcode     = IB_WR_SEND;
 +      wrq->wr.send_flags = IB_SEND_SIGNALED;
  
        tx->tx_nwrq++;
  }
@@@ -1044,7 -1048,7 +1048,7 @@@ kiblnd_init_rdma(kib_conn_t *conn, kib_
        kib_msg_t *ibmsg = tx->tx_msg;
        kib_rdma_desc_t *srcrd = tx->tx_rd;
        struct ib_sge *sge = &tx->tx_sge[0];
 -      struct ib_send_wr *wrq = &tx->tx_wrq[0];
 +      struct ib_rdma_wr *wrq = &tx->tx_wrq[0], *next;
        int rc  = resid;
        int srcidx;
        int dstidx;
                sge->length = wrknob;
  
                wrq = &tx->tx_wrq[tx->tx_nwrq];
 +              next = wrq + 1;
  
 -              wrq->next       = wrq + 1;
 -              wrq->wr_id      = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
 -              wrq->sg_list    = sge;
 -              wrq->num_sge    = 1;
 -              wrq->opcode     = IB_WR_RDMA_WRITE;
 -              wrq->send_flags = 0;
 +              wrq->wr.next       = &next->wr;
 +              wrq->wr.wr_id      = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
 +              wrq->wr.sg_list    = sge;
 +              wrq->wr.num_sge    = 1;
 +              wrq->wr.opcode     = IB_WR_RDMA_WRITE;
 +              wrq->wr.send_flags = 0;
  
 -              wrq->wr.rdma.remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
 -              wrq->wr.rdma.rkey        = kiblnd_rd_frag_key(dstrd, dstidx);
 +              wrq->remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
 +              wrq->rkey        = kiblnd_rd_frag_key(dstrd, dstidx);
  
                srcidx = kiblnd_rd_consume_frag(srcrd, srcidx, wrknob);
                dstidx = kiblnd_rd_consume_frag(dstrd, dstidx, wrknob);
@@@ -1423,6 -1426,7 +1427,7 @@@ kiblnd_send(lnet_ni_t *ni, void *privat
        unsigned int payload_offset = lntmsg->msg_offset;
        unsigned int payload_nob = lntmsg->msg_len;
        kib_msg_t *ibmsg;
+       kib_rdma_desc_t  *rd;
        kib_tx_t *tx;
        int nob;
        int rc;
                }
  
                ibmsg = tx->tx_msg;
+               rd = &ibmsg->ibm_u.get.ibgm_rd;
                if ((lntmsg->msg_md->md_options & LNET_MD_KIOV) == 0)
-                       rc = kiblnd_setup_rd_iov(ni, tx,
-                                                &ibmsg->ibm_u.get.ibgm_rd,
+                       rc = kiblnd_setup_rd_iov(ni, tx, rd,
                                                 lntmsg->msg_md->md_niov,
                                                 lntmsg->msg_md->md_iov.iov,
                                                 0, lntmsg->msg_md->md_length);
                else
-                       rc = kiblnd_setup_rd_kiov(ni, tx,
-                                                 &ibmsg->ibm_u.get.ibgm_rd,
+                       rc = kiblnd_setup_rd_kiov(ni, tx, rd,
                                                  lntmsg->msg_md->md_niov,
                                                  lntmsg->msg_md->md_iov.kiov,
                                                  0, lntmsg->msg_md->md_length);
                        return -EIO;
                }
  
-               nob = offsetof(kib_get_msg_t, ibgm_rd.rd_frags[tx->tx_nfrags]);
+               nob = offsetof(kib_get_msg_t, ibgm_rd.rd_frags[rd->rd_nfrags]);
                ibmsg->ibm_u.get.ibgm_cookie = tx->tx_cookie;
                ibmsg->ibm_u.get.ibgm_hdr = *hdr;
  
@@@ -1651,7 -1653,6 +1654,6 @@@ kiblnd_recv(lnet_ni_t *ni, void *privat
        kib_msg_t *rxmsg = rx->rx_msg;
        kib_conn_t *conn = rx->rx_conn;
        kib_tx_t *tx;
-       kib_msg_t *txmsg;
        int nob;
        int post_credit = IBLND_POSTRX_PEER_CREDIT;
        int rc = 0;
                lnet_finalize(ni, lntmsg, 0);
                break;
  
-       case IBLND_MSG_PUT_REQ:
+       case IBLND_MSG_PUT_REQ: {
+               kib_msg_t       *txmsg;
+               kib_rdma_desc_t *rd;
                if (mlen == 0) {
                        lnet_finalize(ni, lntmsg, 0);
                        kiblnd_send_completion(rx->rx_conn, IBLND_MSG_PUT_NAK, 0,
                }
  
                txmsg = tx->tx_msg;
+               rd = &txmsg->ibm_u.putack.ibpam_rd;
                if (kiov == NULL)
-                       rc = kiblnd_setup_rd_iov(ni, tx,
-                                                &txmsg->ibm_u.putack.ibpam_rd,
+                       rc = kiblnd_setup_rd_iov(ni, tx, rd,
                                                 niov, iov, offset, mlen);
                else
-                       rc = kiblnd_setup_rd_kiov(ni, tx,
-                                                 &txmsg->ibm_u.putack.ibpam_rd,
+                       rc = kiblnd_setup_rd_kiov(ni, tx, rd,
                                                  niov, kiov, offset, mlen);
                if (rc != 0) {
                        CERROR("Can't setup PUT sink for %s: %d\n",
                        break;
                }
  
-               nob = offsetof(kib_putack_msg_t, ibpam_rd.rd_frags[tx->tx_nfrags]);
+               nob = offsetof(kib_putack_msg_t, ibpam_rd.rd_frags[rd->rd_nfrags]);
                txmsg->ibm_u.putack.ibpam_src_cookie = rxmsg->ibm_u.putreq.ibprm_cookie;
                txmsg->ibm_u.putack.ibpam_dst_cookie = tx->tx_cookie;
  
                /* reposted buffer reserved for PUT_DONE */
                post_credit = IBLND_POSTRX_NO_CREDIT;
                break;
+               }
  
        case IBLND_MSG_GET_REQ:
                if (lntmsg != NULL) {
@@@ -2149,6 -2153,7 +2154,7 @@@ kiblnd_passive_connect(struct rdma_cm_i
        unsigned long flags;
        int rc;
        struct sockaddr_in *peer_addr;
        LASSERT(!in_interrupt());
  
        /* cmid inherits 'context' from the corresponding listener id */
        if (*kiblnd_tunables.kib_require_priv_port &&
            ntohs(peer_addr->sin_port) >= PROT_SOCK) {
                __u32 ip = ntohl(peer_addr->sin_addr.s_addr);
                CERROR("Peer's port (%pI4h:%hu) is not privileged\n",
                       &ip, ntohs(peer_addr->sin_port));
                goto failed;
@@@ -3228,7 -3234,7 +3235,7 @@@ kiblnd_cq_completion(struct ib_cq *cq, 
         * consuming my CQ I could be called after all completions have
         * occurred.  But in this case, ibc_nrx == 0 && ibc_nsends_posted == 0
         * and this CQ is about to be destroyed so I NOOP. */
-       kib_conn_t *conn = (kib_conn_t *)arg;
+       kib_conn_t *conn = arg;
        struct kib_sched_info *sched = conn->ibc_sched;
        unsigned long flags;
  
index 4edbf46869d47d9f586eb15d46f0506ca84a1d69,11bf2c60c31ae6c319f6f27c2985dcd44c7b59d4..02f27593013e3650e16bd22b511084755b2dc519
@@@ -64,7 -64,7 +64,7 @@@ static struct ll_file_data *ll_file_dat
  {
        struct ll_file_data *fd;
  
-       OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, GFP_NOFS);
+       fd = kmem_cache_alloc(ll_file_data_slab, GFP_NOFS | __GFP_ZERO);
        if (fd == NULL)
                return NULL;
        fd->fd_write_failed = false;
@@@ -74,7 -74,7 +74,7 @@@
  static void ll_file_data_put(struct ll_file_data *fd)
  {
        if (fd != NULL)
-               OBD_SLAB_FREE_PTR(fd, ll_file_data_slab);
+               kmem_cache_free(ll_file_data_slab, fd);
  }
  
  void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
@@@ -92,9 -92,8 +92,8 @@@
        op_data->op_ioepoch = ll_i2info(inode)->lli_ioepoch;
        if (fh)
                op_data->op_handle = *fh;
-       op_data->op_capa1 = ll_mdscapa_get(inode);
  
-       if (LLIF_DATA_MODIFIED & ll_i2info(inode)->lli_flags)
+       if (ll_i2info(inode)->lli_flags & LLIF_DATA_MODIFIED)
                op_data->op_bias |= MDS_DATA_MODIFIED;
  }
  
@@@ -270,7 -269,7 +269,7 @@@ static int ll_md_close(struct obd_expor
        int lockmode;
        __u64 flags = LDLM_FL_BLOCK_GRANTED | LDLM_FL_TEST_LOCK;
        struct lustre_handle lockh;
-       ldlm_policy_data_t policy = {.l_inodebits = {MDS_INODELOCK_OPEN}};
+       ldlm_policy_data_t policy = {.l_inodebits = {MDS_INODELOCK_OPEN} };
        int rc = 0;
  
        /* clear group lock, if present */
  out:
        LUSTRE_FPRIVATE(file) = NULL;
        ll_file_data_put(fd);
-       ll_capa_close(inode);
  
        return rc;
  }
@@@ -679,8 -677,6 +677,6 @@@ restart
        if (!S_ISREG(inode->i_mode))
                goto out_och_free;
  
-       ll_capa_open(inode);
        if (!lli->lli_has_smd &&
            (cl_is_lov_delay_create(file->f_flags) ||
             (file->f_mode & FMODE_WRITE) == 0)) {
@@@ -694,7 -690,7 +690,7 @@@ out_och_free
        if (rc) {
                if (och_p && *och_p) {
                        kfree(*och_p);
-                       *och_p = NULL; /* OBD_FREE writes some magic there */
+                       *och_p = NULL;
                        (*och_usecount)--;
                }
                mutex_unlock(&lli->lli_och_mutex);
@@@ -912,11 -908,10 +908,10 @@@ static int ll_lease_close(struct obd_cl
  
  /* Fills the obdo with the attributes for the lsm */
  static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
-                         struct obd_capa *capa, struct obdo *obdo,
-                         __u64 ioepoch, int sync)
+                         struct obdo *obdo, __u64 ioepoch, int sync)
  {
        struct ptlrpc_request_set *set;
-       struct obd_info     oinfo = { { { 0 } } };
+       struct obd_info     oinfo = { };
        int                     rc;
  
        LASSERT(lsm != NULL);
                               OBD_MD_FLMTIME | OBD_MD_FLCTIME |
                               OBD_MD_FLGROUP | OBD_MD_FLEPOCH |
                               OBD_MD_FLDATAVERSION;
-       oinfo.oi_capa = capa;
        if (sync) {
                oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS;
                oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK;
  int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
                     __u64 ioepoch, int sync)
  {
-       struct obd_capa      *capa = ll_mdscapa_get(inode);
        struct lov_stripe_md *lsm;
        int rc;
  
        lsm = ccc_inode_lsm_get(inode);
        rc = ll_lsm_getattr(lsm, ll_i2dtexp(inode),
-                           capa, obdo, ioepoch, sync);
-       capa_put(capa);
+                           obdo, ioepoch, sync);
        if (rc == 0) {
                struct ost_id *oi = lsm ? &lsm->lsm_oi : &obdo->o_oi;
  
@@@ -1038,7 -1030,7 +1030,7 @@@ int ll_glimpse_ioctl(struct ll_sb_info 
        struct obdo obdo = { 0 };
        int rc;
  
-       rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, NULL, &obdo, 0, 0);
+       rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, &obdo, 0, 0);
        if (rc == 0) {
                st->st_size   = obdo.o_size;
                st->st_blocks = obdo.o_blocks;
@@@ -1268,7 -1260,7 +1260,7 @@@ static int ll_lov_recreate(struct inod
        int rc = 0;
        struct lov_stripe_md *lsm = NULL, *lsm2;
  
-       OBDO_ALLOC(oa);
+       oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
        if (oa == NULL)
                return -ENOMEM;
  
        goto out;
  out:
        ccc_inode_lsm_put(inode, lsm);
-       OBDO_FREE(oa);
+       kmem_cache_free(obdo_cachep, oa);
        return rc;
  }
  
@@@ -1433,7 -1425,7 +1425,7 @@@ int ll_lov_getstripe_ea_info(struct ino
         * little endian.  We convert it to host endian before
         * passing it to userspace.
         */
-       if (LOV_MAGIC != cpu_to_le32(LOV_MAGIC)) {
+       if (cpu_to_le32(LOV_MAGIC) != LOV_MAGIC) {
                int stripe_count;
  
                stripe_count = le16_to_cpu(lmm->lmm_stripe_count);
@@@ -1874,7 -1866,7 +1866,7 @@@ int ll_data_version(struct inode *inode
                goto out;
        }
  
-       rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, NULL, obdo, 0, extent_lock);
+       rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, obdo, 0, extent_lock);
        if (rc == 0) {
                if (!(obdo->o_valid & OBD_MD_FLDATAVERSION))
                        rc = -EOPNOTSUPP;
@@@ -1899,7 -1891,6 +1891,6 @@@ int ll_hsm_release(struct inode *inode
        __u64 data_version = 0;
        int rc;
  
        CDEBUG(D_INODE, "%s: Releasing file "DFID".\n",
               ll_get_fsname(inode->i_sb, NULL, 0),
               PFID(&ll_i2info(inode)->lli_fid));
                                       &data_version);
        och = NULL;
  
  out:
        if (och != NULL && !IS_ERR(och)) /* close the file */
                ll_lease_close(och, inode, NULL);
@@@ -2118,12 -2108,21 +2108,21 @@@ static int ll_hsm_state_set(struct inod
        struct md_op_data       *op_data;
        int                      rc;
  
+       /* Detect out-of range masks */
+       if ((hss->hss_setmask | hss->hss_clearmask) & ~HSM_FLAGS_MASK)
+               return -EINVAL;
        /* Non-root users are forbidden to set or clear flags which are
         * NOT defined in HSM_USER_MASK. */
        if (((hss->hss_setmask | hss->hss_clearmask) & ~HSM_USER_MASK) &&
            !capable(CFS_CAP_SYS_ADMIN))
                return -EPERM;
  
+       /* Detect out-of range archive id */
+       if ((hss->hss_valid & HSS_ARCHIVE_ID) &&
+           (hss->hss_archive_id > LL_HSM_MAX_ARCHIVE))
+               return -EINVAL;
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                     LUSTRE_OPC_ANY, hss);
        if (IS_ERR(op_data))
@@@ -2144,7 -2143,6 +2143,6 @@@ static int ll_hsm_import(struct inode *
        struct iattr            *attr = NULL;
        int                      rc;
  
        if (!S_ISREG(inode->i_mode))
                return -EINVAL;
  
@@@ -2494,8 -2492,8 +2492,8 @@@ ll_file_ioctl(struct file *file, unsign
        default: {
                int err;
  
-               if (LLIOC_STOP ==
-                    ll_iocontrol_call(inode, file, cmd, arg, &err))
+               if (ll_iocontrol_call(inode, file, cmd, arg, &err) ==
+                    LLIOC_STOP)
                        return err;
  
                return obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
        }
  }
  
  static loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
  {
        struct inode *inode = file_inode(file);
@@@ -2565,7 -2562,6 +2562,6 @@@ int cl_sync_file_range(struct inode *in
        struct cl_env_nest nest;
        struct lu_env *env;
        struct cl_io *io;
-       struct obd_capa *capa = NULL;
        struct cl_fsync_io *fio;
        int result;
  
        if (IS_ERR(env))
                return PTR_ERR(env);
  
-       capa = ll_osscapa_get(inode, CAPA_OPC_OSS_WRITE);
        io = ccc_env_thread_io(env);
        io->ci_obj = cl_i2info(inode)->lli_clob;
        io->ci_ignore_layout = ignore_layout;
  
        /* initialize parameters for sync */
        fio = &io->u.ci_fsync;
-       fio->fi_capa = capa;
        fio->fi_start = start;
        fio->fi_end = end;
        fio->fi_fid = ll_inode2fid(inode);
        cl_io_fini(env, io);
        cl_env_nested_put(&nest, env);
  
-       capa_put(capa);
        return result;
  }
  
@@@ -2611,7 -2602,6 +2602,6 @@@ int ll_fsync(struct file *file, loff_t 
        struct inode *inode = file_inode(file);
        struct ll_inode_info *lli = ll_i2info(inode);
        struct ptlrpc_request *req;
-       struct obd_capa *oc;
        int rc, err;
  
        CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
                        rc = err;
        }
  
-       oc = ll_mdscapa_get(inode);
-       err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), oc,
-                     &req);
-       capa_put(oc);
+       err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);
        if (!rc)
                rc = err;
        if (!err)
@@@ -2670,7 -2657,7 +2657,7 @@@ ll_file_flock(struct file *file, int cm
        };
        struct md_op_data *op_data;
        struct lustre_handle lockh = {0};
-       ldlm_policy_data_t flock = {{0}};
+       ldlm_policy_data_t flock = { {0} };
        __u64 flags = 0;
        int rc;
        int rc2 = 0;
        rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL,
                        op_data, &lockh, &flock, 0, NULL /* req */, flags);
  
 -      if ((file_lock->fl_flags & FL_FLOCK) &&
 -          (rc == 0 || file_lock->fl_type == F_UNLCK))
 -              rc2  = flock_lock_file_wait(file, file_lock);
 -      if ((file_lock->fl_flags & FL_POSIX) &&
 -          (rc == 0 || file_lock->fl_type == F_UNLCK) &&
 +      if ((rc == 0 || file_lock->fl_type == F_UNLCK) &&
            !(flags & LDLM_FL_TEST_LOCK))
 -              rc2  = posix_lock_file_wait(file, file_lock);
 +              rc2  = locks_lock_file_wait(file, file_lock);
  
        if (rc2 && file_lock->fl_type != F_UNLCK) {
                einfo.ei_mode = LCK_NL;
@@@ -2846,7 -2837,7 +2833,7 @@@ ldlm_mode_t ll_take_md_lock(struct inod
        fid = &ll_i2info(inode)->lli_fid;
        CDEBUG(D_INFO, "trying to match res "DFID"\n", PFID(fid));
  
-       rc = md_lock_match(ll_i2mdexp(inode), LDLM_FL_BLOCK_GRANTED|flags,
+       rc = md_lock_match(ll_i2mdexp(inode), flags | LDLM_FL_BLOCK_GRANTED,
                           fid, LDLM_IBITS, &policy, mode, lockh);
  
        return rc;
@@@ -2950,9 -2941,6 +2937,6 @@@ static int __ll_inode_revalidate(struc
                        return PTR_ERR(op_data);
  
                op_data->op_valid = valid;
-               /* Once OBD_CONNECT_ATTRFID is not supported, we can't find one
-                * capa for this inode. Because we only keep capas of dirs
-                * fresh. */
                rc = md_getattr(sbi->ll_md_exp, op_data, &req);
                ll_finish_md_op_data(op_data);
                if (rc) {
@@@ -3079,7 -3067,6 +3063,6 @@@ struct posix_acl *ll_get_acl(struct ino
        return acl;
  }
  
  int ll_inode_permission(struct inode *inode, int mask)
  {
        int rc = 0;
@@@ -3177,7 -3164,6 +3160,6 @@@ static struct llioc_ctl_data 
        LIST_HEAD_INIT(llioc.ioc_head)
  };
  
  struct llioc_data {
        struct list_head              iocd_list;
        unsigned int        iocd_size;
@@@ -3303,7 -3289,6 +3285,6 @@@ static int ll_layout_fetch(struct inod
  
  {
        struct ll_sb_info *sbi = ll_i2sbi(inode);
-       struct obd_capa *oc;
        struct ptlrpc_request *req;
        struct mdt_body *body;
        void *lvbdata;
         * blocked and then granted via completion ast, we have to fetch
         * layout here. Please note that we can't use the LVB buffer in
         * completion AST because it doesn't have a large enough buffer */
-       oc = ll_mdscapa_get(inode);
        rc = ll_get_default_mdsize(sbi, &lmmsize);
        if (rc == 0)
-               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
-                               OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0,
-                               lmmsize, 0, &req);
-       capa_put(oc);
+               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
+                                OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0,
+                                lmmsize, 0, &req);
        if (rc < 0)
                return rc;
  
index 904a4667bbb8bebe3cb43bf5201be9d533ada07a,bc78da014c337ab31750582411daa6ec5a85c670..f2dca69c2bc0ed3ea8704e9d9df68ba4d04fc980
@@@ -181,7 -181,7 +181,7 @@@ static void deregister_from_lirc(struc
        if (retval)
                dev_err(&context->dev->dev,
                        "%s: unable to deregister from lirc (%d)\n",
 -                     __func__, retval);
 +                      __func__, retval);
        else
                dev_info(&context->dev->dev,
                         "Deregistered Sasem driver (minor:%d)\n", minor);
@@@ -244,7 -244,7 +244,7 @@@ exit
   */
  static long vfd_ioctl(struct file *file, unsigned cmd, unsigned long arg)
  {
-       struct sasem_context *context = NULL;
+       struct sasem_context *context;
  
        context = (struct sasem_context *) file->private_data;
  
@@@ -697,16 -697,11 +697,11 @@@ static int sasem_probe(struct usb_inter
        for (i = 0; i < num_endpoints && !(ir_ep_found && vfd_ep_found); ++i) {
  
                struct usb_endpoint_descriptor *ep;
-               int ep_dir;
-               int ep_type;
  
                ep = &iface_desc->endpoint [i].desc;
-               ep_dir = ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
-               ep_type = ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
  
                if (!ir_ep_found &&
-                       ep_dir == USB_DIR_IN &&
-                       ep_type == USB_ENDPOINT_XFER_INT) {
+                       usb_endpoint_is_int_in(ep)) {
  
                        rx_endpoint = ep;
                        ir_ep_found = 1;
                                        "%s: found IR endpoint\n", __func__);
  
                } else if (!vfd_ep_found &&
-                       ep_dir == USB_DIR_OUT &&
-                       ep_type == USB_ENDPOINT_XFER_INT) {
+                       usb_endpoint_is_int_out(ep)) {
  
                        tx_endpoint = ep;
                        vfd_ep_found = 1;
index 0b03cb7c59d5c25c06ff1416ef38e62ba1c08e3d,bd3662ab2db0c89c8058d5ed7cda3c2a4bda8983..aa76ccda5b424f73f64776a010afcb9040ecd39f
@@@ -151,7 -151,7 +151,7 @@@ int omap4iss_get_external_info(struct i
  
        ctrl = v4l2_ctrl_find(pipe->external->ctrl_handler,
                              V4L2_CID_PIXEL_RATE);
-       if (ctrl == NULL) {
+       if (!ctrl) {
                dev_warn(iss->dev, "no pixel rate control in subdev %s\n",
                         pipe->external->name);
                return -EPIPE;
@@@ -422,7 -422,7 +422,7 @@@ static int iss_pipeline_pm_power_one(st
        subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
               ? media_entity_to_v4l2_subdev(entity) : NULL;
  
-       if (entity->use_count == 0 && change > 0 && subdev != NULL) {
+       if (entity->use_count == 0 && change > 0 && subdev) {
                int ret;
  
                ret = v4l2_subdev_call(subdev, core, s_power, 1);
        entity->use_count += change;
        WARN_ON(entity->use_count < 0);
  
-       if (entity->use_count == 0 && change < 0 && subdev != NULL)
+       if (entity->use_count == 0 && change < 0 && subdev)
                v4l2_subdev_call(subdev, core, s_power, 0);
  
        return 0;
@@@ -469,8 -469,8 +469,8 @@@ static int iss_pipeline_pm_power(struc
  
        media_entity_graph_walk_start(&graph, first);
  
-       while ((first = media_entity_graph_walk_next(&graph))
-              && first != entity)
+       while ((first = media_entity_graph_walk_next(&graph)) &&
+              first != entity)
                if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
                        iss_pipeline_pm_power_one(first, -change);
  
@@@ -541,7 -541,7 +541,7 @@@ static int iss_pipeline_link_notify(str
        }
  
        if (notification == MEDIA_DEV_NOTIFY_POST_LINK_CH &&
-               (flags & MEDIA_LNK_FL_ENABLED)) {
+           (flags & MEDIA_LNK_FL_ENABLED)) {
                ret = iss_pipeline_pm_power(source, sink_use);
                if (ret < 0)
                        return ret;
@@@ -590,7 -590,7 +590,7 @@@ static int iss_pipeline_disable(struct 
                        break;
  
                pad = media_entity_remote_pad(pad);
-               if (pad == NULL ||
+               if (!pad ||
                    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
                        break;
  
@@@ -658,7 -658,7 +658,7 @@@ static int iss_pipeline_enable(struct i
                        break;
  
                pad = media_entity_remote_pad(pad);
-               if (pad == NULL ||
+               if (!pad ||
                    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
                        break;
  
@@@ -919,7 -919,7 +919,7 @@@ static int __iss_subclk_update(struct i
  }
  
  int omap4iss_subclk_enable(struct iss_device *iss,
-                           enum iss_subclk_resource res)
+                          enum iss_subclk_resource res)
  {
        iss->subclk_resources |= res;
  
  }
  
  int omap4iss_subclk_disable(struct iss_device *iss,
-                            enum iss_subclk_resource res)
+                           enum iss_subclk_resource res)
  {
        iss->subclk_resources &= ~res;
  
@@@ -1050,7 -1050,7 +1050,7 @@@ struct iss_device *omap4iss_get(struct 
  {
        struct iss_device *__iss = iss;
  
-       if (iss == NULL)
+       if (!iss)
                return NULL;
  
        mutex_lock(&iss->iss_mutex);
        iss_enable_interrupts(iss);
  
  out:
-       if (__iss != NULL)
+       if (__iss)
                iss->ref_count++;
        mutex_unlock(&iss->iss_mutex);
  
   */
  void omap4iss_put(struct iss_device *iss)
  {
-       if (iss == NULL)
+       if (!iss)
                return;
  
        mutex_lock(&iss->iss_mutex);
@@@ -1137,12 -1137,12 +1137,12 @@@ static void iss_unregister_entities(str
   */
  static struct v4l2_subdev *
  iss_register_subdev_group(struct iss_device *iss,
-                    struct iss_subdev_i2c_board_info *board_info)
+                         struct iss_subdev_i2c_board_info *board_info)
  {
        struct v4l2_subdev *sensor = NULL;
        unsigned int first;
  
-       if (board_info->board_info == NULL)
+       if (!board_info->board_info)
                return NULL;
  
        for (first = 1; board_info->board_info; ++board_info, first = 0) {
                struct i2c_adapter *adapter;
  
                adapter = i2c_get_adapter(board_info->i2c_adapter_id);
-               if (adapter == NULL) {
+               if (!adapter) {
                        dev_err(iss->dev,
                                "%s: Unable to get I2C adapter %d for device %s\n",
                                __func__, board_info->i2c_adapter_id,
  
                subdev = v4l2_i2c_new_subdev_board(&iss->v4l2_dev, adapter,
                                board_info->board_info, NULL);
-               if (subdev == NULL) {
+               if (!subdev) {
                        dev_err(iss->dev, "Unable to register subdev %s\n",
                                board_info->board_info->type);
                        continue;
@@@ -1228,7 -1228,7 +1228,7 @@@ static int iss_register_entities(struc
                unsigned int pad;
  
                sensor = iss_register_subdev_group(iss, subdevs->subdevs);
-               if (sensor == NULL)
+               if (!sensor)
                        continue;
  
                sensor->host_priv = subdevs;
@@@ -1369,7 -1369,7 +1369,7 @@@ static int iss_probe(struct platform_de
        unsigned int i;
        int ret;
  
-       if (pdata == NULL)
+       if (!pdata)
                return -EINVAL;
  
        iss = devm_kzalloc(&pdev->dev, sizeof(*iss), GFP_KERNEL);
        if (ret < 0)
                goto error;
  
-       if (omap4iss_get(iss) == NULL)
+       if (!omap4iss_get(iss))
                goto error;
  
        ret = iss_reset(iss);
                 iss_reg_read(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_REVISION));
  
        /* Interrupt */
 -      iss->irq_num = platform_get_irq(pdev, 0);
 -      if (iss->irq_num <= 0) {
 +      ret = platform_get_irq(pdev, 0);
 +      if (ret <= 0) {
                dev_err(iss->dev, "No IRQ resource\n");
                ret = -ENODEV;
                goto error_iss;
        }
 +      iss->irq_num = ret;
  
        if (devm_request_irq(iss->dev, iss->irq_num, iss_isr, IRQF_SHARED,
                             "OMAP4 ISS", iss)) {
index 28c067decc27d9c3a695505dde8de3c1536580ab,97d3faa722aa0d1ba2926c320bfc91078d04df33..2a0158bb497420b63f527a45b9bbada740136e37
@@@ -25,7 -25,6 +25,6 @@@
  #include "iss_video.h"
  #include "iss.h"
  
  /* -----------------------------------------------------------------------------
   * Helper functions
   */
@@@ -191,7 -190,7 +190,7 @@@ iss_video_remote_subdev(struct iss_vide
  
        remote = media_entity_remote_pad(&video->pad);
  
-       if (remote == NULL ||
+       if (!remote ||
            media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
                return NULL;
  
@@@ -241,7 -240,7 +240,7 @@@ __iss_video_get_format(struct iss_vide
        int ret;
  
        subdev = iss_video_remote_subdev(video, &pad);
-       if (subdev == NULL)
+       if (!subdev)
                return -EINVAL;
  
        memset(&fmt, 0, sizeof(fmt));
@@@ -288,7 -287,7 +287,7 @@@ iss_video_check_format(struct iss_vide
   */
  
  static int iss_video_queue_setup(struct vb2_queue *vq,
 -                               const struct v4l2_format *fmt,
 +                               const void *parg,
                                 unsigned int *count, unsigned int *num_planes,
                                 unsigned int sizes[], void *alloc_ctxs[])
  {
  
  static void iss_video_buf_cleanup(struct vb2_buffer *vb)
  {
 -      struct iss_buffer *buffer = container_of(vb, struct iss_buffer, vb);
 +      struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
 +      struct iss_buffer *buffer = container_of(vbuf, struct iss_buffer, vb);
  
        if (buffer->iss_addr)
                buffer->iss_addr = 0;
  
  static int iss_video_buf_prepare(struct vb2_buffer *vb)
  {
 +      struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
        struct iss_video_fh *vfh = vb2_get_drv_priv(vb->vb2_queue);
 -      struct iss_buffer *buffer = container_of(vb, struct iss_buffer, vb);
 +      struct iss_buffer *buffer = container_of(vbuf, struct iss_buffer, vb);
        struct iss_video *video = vfh->video;
        unsigned long size = vfh->format.fmt.pix.sizeimage;
        dma_addr_t addr;
  
  static void iss_video_buf_queue(struct vb2_buffer *vb)
  {
 +      struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
        struct iss_video_fh *vfh = vb2_get_drv_priv(vb->vb2_queue);
        struct iss_video *video = vfh->video;
 -      struct iss_buffer *buffer = container_of(vb, struct iss_buffer, vb);
 +      struct iss_buffer *buffer = container_of(vbuf, struct iss_buffer, vb);
        struct iss_pipeline *pipe = to_iss_pipeline(&video->video.entity);
        unsigned long flags;
        bool empty;
@@@ -423,6 -419,7 +422,6 @@@ struct iss_buffer *omap4iss_video_buffe
        enum iss_pipeline_state state;
        struct iss_buffer *buf;
        unsigned long flags;
 -      struct timespec ts;
  
        spin_lock_irqsave(&video->qlock, flags);
        if (WARN_ON(list_empty(&video->dmaqueue))) {
        list_del(&buf->list);
        spin_unlock_irqrestore(&video->qlock, flags);
  
 -      ktime_get_ts(&ts);
 -      buf->vb.v4l2_buf.timestamp.tv_sec = ts.tv_sec;
 -      buf->vb.v4l2_buf.timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
 +      v4l2_get_timestamp(&buf->vb.timestamp);
  
        /* Do frame number propagation only if this is the output video node.
         * Frame number either comes from the CSI receivers or it gets
         * first, so the input number might lag behind by 1 in some cases.
         */
        if (video == pipe->output && !pipe->do_propagation)
 -              buf->vb.v4l2_buf.sequence =
 +              buf->vb.sequence =
                        atomic_inc_return(&pipe->frame_number);
        else
 -              buf->vb.v4l2_buf.sequence = atomic_read(&pipe->frame_number);
 +              buf->vb.sequence = atomic_read(&pipe->frame_number);
  
 -      vb2_buffer_done(&buf->vb, pipe->error ?
 +      vb2_buffer_done(&buf->vb.vb2_buf, pipe->error ?
                        VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
        pipe->error = false;
  
                return NULL;
        }
  
-       if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && pipe->input != NULL) {
+       if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && pipe->input) {
                spin_lock(&pipe->lock);
                pipe->state &= ~ISS_PIPELINE_STREAM;
                spin_unlock(&pipe->lock);
        buf = list_first_entry(&video->dmaqueue, struct iss_buffer,
                               list);
        spin_unlock_irqrestore(&video->qlock, flags);
 -      buf->vb.state = VB2_BUF_STATE_ACTIVE;
 +      buf->vb.vb2_buf.state = VB2_BUF_STATE_ACTIVE;
        return buf;
  }
  
@@@ -503,7 -502,7 +502,7 @@@ void omap4iss_video_cancel_stream(struc
                buf = list_first_entry(&video->dmaqueue, struct iss_buffer,
                                       list);
                list_del(&buf->list);
 -              vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
 +              vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
        }
  
        vb2_queue_error(video->queue);
@@@ -624,7 -623,7 +623,7 @@@ iss_video_try_format(struct file *file
                return -EINVAL;
  
        subdev = iss_video_remote_subdev(video, &pad);
-       if (subdev == NULL)
+       if (!subdev)
                return -EINVAL;
  
        iss_video_pix_to_mbus(&format->fmt.pix, &fmt.format);
@@@ -806,7 -805,7 +805,7 @@@ iss_video_streamon(struct file *file, v
                pipe->input = far_end;
                pipe->output = video;
        } else {
-               if (far_end == NULL) {
+               if (!far_end) {
                        ret = -EPIPE;
                        goto err_iss_video_check_format;
                }
         * to the stream on command. In memory-to-memory mode, it will be
         * started when buffers are queued on both the input and output.
         */
-       if (pipe->input == NULL) {
+       if (!pipe->input) {
                unsigned long flags;
  
                ret = omap4iss_pipeline_set_stream(pipe,
@@@ -974,14 -973,14 +973,14 @@@ static int iss_video_open(struct file *
        int ret = 0;
  
        handle = kzalloc(sizeof(*handle), GFP_KERNEL);
-       if (handle == NULL)
+       if (!handle)
                return -ENOMEM;
  
        v4l2_fh_init(&handle->vfh, &video->video);
        v4l2_fh_add(&handle->vfh);
  
        /* If this is the first user, initialise the pipeline. */
-       if (omap4iss_get(video->iss) == NULL) {
+       if (!omap4iss_get(video->iss)) {
                ret = -EBUSY;
                goto done;
        }
@@@ -1116,7 -1115,7 +1115,7 @@@ int omap4iss_video_init(struct iss_vide
        mutex_init(&video->stream_lock);
  
        /* Initialize the video device. */
-       if (video->ops == NULL)
+       if (!video->ops)
                video->ops = &iss_video_dummy_ops;
  
        video->video.fops = &iss_video_fops;
index b2e6237ae913722e67eaf342d2302b85504d836c,20a3f8eeb264651915530a372861a98aa52a65da..e893d5d8b8628e975982633cdd53d5bf0a5f97f2
@@@ -145,7 -145,7 +145,7 @@@ static int spinand_read_id(struct spi_d
   *    Once the status turns to be ready, the other status bits also are
   *    valid status bits.
   */
- static int spinand_read_status(struct spi_device *spi_nand, uint8_t *status)
+ static int spinand_read_status(struct spi_device *spi_nand, u8 *status)
  {
        struct spinand_cmd cmd = {0};
        int ret;
@@@ -186,6 -186,7 +186,7 @@@ static int wait_till_ready(struct spi_d
  
        return -1;
  }
  /**
   * spinand_get_otp- send command 0xf to read the SPI Nand OTP register
   * Description:
@@@ -321,7 -322,7 +322,7 @@@ static int spinand_read_page_to_cache(s
   *   No tRd delay.
   */
  static int spinand_read_from_cache(struct spi_device *spi_nand, u16 page_id,
-               u16 byte_id, u16 len, u8 *rbuf)
+                                  u16 byte_id, u16 len, u8 *rbuf)
  {
        struct spinand_cmd cmd = {0};
        u16 column;
   *   Poll to read status to wait for tRD time.
   */
  static int spinand_read_page(struct spi_device *spi_nand, u16 page_id,
-               u16 offset, u16 len, u8 *rbuf)
+                            u16 offset, u16 len, u8 *rbuf)
  {
        int ret;
        u8 status = 0;
                ret = spinand_read_status(spi_nand, &status);
                if (ret < 0) {
                        dev_err(&spi_nand->dev,
-                                       "err %d read status register\n", ret);
+                               "err %d read status register\n", ret);
                        return ret;
                }
  
                if ((status & STATUS_OIP_MASK) == STATUS_READY) {
                        if ((status & STATUS_ECC_MASK) == STATUS_ECC_ERROR) {
                                dev_err(&spi_nand->dev, "ecc error, page=%d\n",
-                                               page_id);
+                                       page_id);
                                return 0;
                        }
                        break;
   *   Since it is writing the data to cache, there is no tPROG time.
   */
  static int spinand_program_data_to_cache(struct spi_device *spi_nand,
-               u16 page_id, u16 byte_id, u16 len, u8 *wbuf)
+                                        u16 page_id, u16 byte_id,
+                                        u16 len, u8 *wbuf)
  {
        struct spinand_cmd cmd = {0};
        u16 column;
@@@ -473,11 -475,11 +475,11 @@@ static int spinand_program_execute(stru
   *   Poll to wait for the tPROG time to finish the transaction.
   */
  static int spinand_program_page(struct spi_device *spi_nand,
-               u16 page_id, u16 offset, u16 len, u8 *buf)
+                               u16 page_id, u16 offset, u16 len, u8 *buf)
  {
        int retval;
        u8 status = 0;
-       uint8_t *wbuf;
+       u8 *wbuf;
  #ifdef CONFIG_MTD_SPINAND_ONDIEECC
        unsigned int i, j;
  
                dev_err(&spi_nand->dev, "wait timedout!!!\n");
  
        retval = spinand_program_data_to_cache(spi_nand, page_id,
-                       offset, len, wbuf);
+                                              offset, len, wbuf);
        if (retval < 0)
                return retval;
        retval = spinand_program_execute(spi_nand, page_id);
                retval = spinand_read_status(spi_nand, &status);
                if (retval < 0) {
                        dev_err(&spi_nand->dev,
-                                       "error %d reading status register\n",
-                                       retval);
+                               "error %d reading status register\n", retval);
                        return retval;
                }
  
@@@ -593,8 -594,7 +594,7 @@@ static int spinand_erase_block(struct s
                retval = spinand_read_status(spi_nand, &status);
                if (retval < 0) {
                        dev_err(&spi_nand->dev,
-                                       "error %d reading status register\n",
-                                       (int) retval);
+                               "error %d reading status register\n", retval);
                        return retval;
                }
  
  
  #ifdef CONFIG_MTD_SPINAND_ONDIEECC
  static int spinand_write_page_hwecc(struct mtd_info *mtd,
-               struct nand_chip *chip, const uint8_t *buf, int oob_required,
-               int page)
+                                   struct nand_chip *chip,
 -                                  const u8 *buf, int oob_required)
++                                  const u8 *buf, int oob_required, int page)
  {
-       const uint8_t *p = buf;
+       const u8 *p = buf;
        int eccsize = chip->ecc.size;
        int eccsteps = chip->ecc.steps;
  
  }
  
  static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
-               uint8_t *buf, int oob_required, int page)
+                                  u8 *buf, int oob_required, int page)
  {
        int retval;
        u8 status;
-       uint8_t *p = buf;
+       u8 *p = buf;
        int eccsize = chip->ecc.size;
        int eccsteps = chip->ecc.steps;
        struct spinand_info *info = (struct spinand_info *)chip->priv;
                retval = spinand_read_status(info->spi, &status);
                if (retval < 0) {
                        dev_err(&mtd->dev,
-                                       "error %d reading status register\n",
-                                       retval);
+                               "error %d reading status register\n", retval);
                        return retval;
                }
  
                }
        }
        return 0;
  }
  #endif
  
@@@ -668,7 -666,7 +666,7 @@@ static void spinand_select_chip(struct 
  {
  }
  
- static uint8_t spinand_read_byte(struct mtd_info *mtd)
+ static u8 spinand_read_byte(struct mtd_info *mtd)
  {
        struct spinand_state *state = mtd_to_state(mtd);
        u8 data;
        return data;
  }
  
  static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip)
  {
        struct spinand_info *info = (struct spinand_info *)chip->priv;
                retval = spinand_read_status(info->spi, &status);
                if (retval < 0) {
                        dev_err(&mtd->dev,
-                                       "error %d reading status register\n",
-                                       retval);
+                               "error %d reading status register\n", retval);
                        return retval;
                }
  
        return 0;
  }
  
- static void spinand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
+ static void spinand_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
  {
        struct spinand_state *state = mtd_to_state(mtd);
  
        memcpy(state->buf + state->buf_ptr, buf, len);
        state->buf_ptr += len;
  }
  
- static void spinand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
+ static void spinand_read_buf(struct mtd_info *mtd, u8 *buf, int len)
  {
        struct spinand_state *state = mtd_to_state(mtd);
  
@@@ -739,14 -734,14 +734,14 @@@ static void spinand_reset(struct spi_de
                pr_info("spinand reset failed!\n");
  
        /* elapse 1ms before issuing any other command */
-       udelay(1000);
+       usleep_range(1000, 2000);
  
        if (wait_till_ready(spi_nand))
                dev_err(&spi_nand->dev, "wait timedout!\n");
  }
  
  static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
-               int column, int page)
+                           int column, int page)
  {
        struct nand_chip *chip = (struct nand_chip *)mtd->priv;
        struct spinand_info *info = (struct spinand_info *)chip->priv;
        /* PAGEPROG reuses all of the setup from SEQIN and adds the length */
        case NAND_CMD_PAGEPROG:
                spinand_program_page(info->spi, state->row, state->col,
-                               state->buf_ptr, state->buf);
+                                    state->buf_ptr, state->buf);
                break;
        case NAND_CMD_STATUS:
                spinand_get_otp(info->spi, state->buf);
                if (wait_till_ready(info->spi))
                        dev_err(&info->spi->dev, "WAIT timedout!!!\n");
                /* a minimum of 250us must elapse before issuing RESET cmd*/
-               udelay(250);
+               usleep_range(250, 1000);
                spinand_reset(info->spi);
                break;
        default:
@@@ -840,6 -835,7 +835,7 @@@ static int spinand_lock_block(struct sp
  
        return ret;
  }
  /*
   * spinand_probe - [spinand Interface]
   * @spi_nand: registered device driver.
@@@ -856,7 -852,7 +852,7 @@@ static int spinand_probe(struct spi_dev
        struct mtd_part_parser_data ppdata;
  
        info  = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_info),
-                       GFP_KERNEL);
+                            GFP_KERNEL);
        if (!info)
                return -ENOMEM;
  
        spinand_lock_block(spi_nand, BL_ALL_UNLOCKED);
  
        state = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_state),
-                       GFP_KERNEL);
+                            GFP_KERNEL);
        if (!state)
                return -ENOMEM;
  
                return -ENOMEM;
  
        chip = devm_kzalloc(&spi_nand->dev, sizeof(struct nand_chip),
-                       GFP_KERNEL);
+                           GFP_KERNEL);
        if (!chip)
                return -ENOMEM;
  
        dev_set_drvdata(&spi_nand->dev, mtd);
  
        mtd->priv = chip;
 -      mtd->name = dev_name(&spi_nand->dev);
 -      mtd->owner = THIS_MODULE;
 +      mtd->dev.parent = &spi_nand->dev;
        mtd->oobsize = 64;
  
        if (nand_scan(mtd, 1))
@@@ -941,6 -938,7 +937,7 @@@ static const struct of_device_id spinan
        { .compatible = "spinand,mt29f", },
        {}
  };
+ MODULE_DEVICE_TABLE(of, spinand_dt);
  
  /*
   * Device name structure description
  static struct spi_driver spinand_driver = {
        .driver = {
                .name           = "mt29f",
 -              .owner          = THIS_MODULE,
                .of_match_table = spinand_dt,
        },
        .probe          = spinand_probe,
index 4c43ca935cc7ad5cf1686759e7b663a367ea76b8,e0a7aff0eb2a5a266867287a5a22414971d404c0..ca364dbe369c1c579508849c0551ce9fc38fdac6
@@@ -240,7 -240,7 +240,7 @@@ int c2_qp_modify(struct c2_dev *c2dev, 
        spin_unlock_irqrestore(&qp->lock, flags);
  
        vq_repbuf_free(c2dev, reply);
      bail0:
+ bail0:
        vq_req_free(c2dev, vq_req);
  
        pr_debug("%s:%d qp=%p, cur_state=%s\n",
@@@ -294,7 -294,7 +294,7 @@@ int c2_qp_set_read_limits(struct c2_de
  
        err = c2_errno(reply);
        vq_repbuf_free(c2dev, reply);
      bail0:
+ bail0:
        vq_req_free(c2dev, vq_req);
        return err;
  }
@@@ -373,7 -373,7 +373,7 @@@ static int destroy_qp(struct c2_dev *c2
        spin_unlock_irqrestore(&qp->lock, flags);
  
        vq_repbuf_free(c2dev, reply);
      bail0:
+ bail0:
        vq_req_free(c2dev, vq_req);
        return err;
  }
@@@ -554,19 -554,19 +554,19 @@@ int c2_alloc_qp(struct c2_dev *c2dev
  
        return 0;
  
      bail6:
+ bail6:
        iounmap(qp->sq_mq.peer);
      bail5:
+ bail5:
        destroy_qp(c2dev, qp);
      bail4:
+ bail4:
        vq_repbuf_free(c2dev, reply);
      bail3:
+ bail3:
        vq_req_free(c2dev, vq_req);
      bail2:
+ bail2:
        c2_free_mqsp(qp->rq_mq.shared);
      bail1:
+ bail1:
        c2_free_mqsp(qp->sq_mq.shared);
      bail0:
+ bail0:
        c2_free_qpn(c2dev, qp->qpn);
        return err;
  }
@@@ -860,9 -860,9 +860,9 @@@ int c2_post_send(struct ib_qp *ibqp, st
                                flags |= SQ_READ_FENCE;
                        }
                        wr.sqwr.rdma_write.remote_stag =
 -                          cpu_to_be32(ib_wr->wr.rdma.rkey);
 +                          cpu_to_be32(rdma_wr(ib_wr)->rkey);
                        wr.sqwr.rdma_write.remote_to =
 -                          cpu_to_be64(ib_wr->wr.rdma.remote_addr);
 +                          cpu_to_be64(rdma_wr(ib_wr)->remote_addr);
                        err = move_sgl((struct c2_data_addr *)
                                       & (wr.sqwr.rdma_write.data),
                                       ib_wr->sg_list,
                        wr.sqwr.rdma_read.local_to =
                            cpu_to_be64(ib_wr->sg_list->addr);
                        wr.sqwr.rdma_read.remote_stag =
 -                          cpu_to_be32(ib_wr->wr.rdma.rkey);
 +                          cpu_to_be32(rdma_wr(ib_wr)->rkey);
                        wr.sqwr.rdma_read.remote_to =
 -                          cpu_to_be64(ib_wr->wr.rdma.remote_addr);
 +                          cpu_to_be64(rdma_wr(ib_wr)->remote_addr);
                        wr.sqwr.rdma_read.length =
                            cpu_to_be32(ib_wr->sg_list->length);
                        break;
index 402bd64141769e263e7bc22e67ca86e197464360,0208fc200c1abadbd96f51a11bac2be26df6e5f3..568f185a022dffa5bf24a1af010261a4b4f7b5c0
@@@ -284,20 -284,20 +284,20 @@@ struct ib_mr *hfi1_reg_user_mr(struct i
        m = 0;
        n = 0;
        for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) {
-                       void *vaddr;
-                       vaddr = page_address(sg_page(sg));
-                       if (!vaddr) {
-                               ret = ERR_PTR(-EINVAL);
-                               goto bail;
-                       }
-                       mr->mr.map[m]->segs[n].vaddr = vaddr;
-                       mr->mr.map[m]->segs[n].length = umem->page_size;
-                       n++;
-                       if (n == HFI1_SEGSZ) {
-                               m++;
-                               n = 0;
-                       }
+               void *vaddr;
+               vaddr = page_address(sg_page(sg));
+               if (!vaddr) {
+                       ret = ERR_PTR(-EINVAL);
+                       goto bail;
+               }
+               mr->mr.map[m]->segs[n].vaddr = vaddr;
+               mr->mr.map[m]->segs[n].length = umem->page_size;
+               n++;
+               if (n == HFI1_SEGSZ) {
+                       m++;
+                       n = 0;
+               }
        }
        ret = &mr->ibmr;
  
@@@ -344,10 -344,9 +344,10 @@@ out
  
  /*
   * Allocate a memory region usable with the
 - * IB_WR_FAST_REG_MR send work request.
 + * IB_WR_REG_MR send work request.
   *
   * Return the memory region on success, otherwise return an errno.
 + * FIXME: IB_WR_REG_MR is not supported
   */
  struct ib_mr *hfi1_alloc_mr(struct ib_pd *pd,
                            enum ib_mr_type mr_type,
        return &mr->ibmr;
  }
  
 -struct ib_fast_reg_page_list *
 -hfi1_alloc_fast_reg_page_list(struct ib_device *ibdev, int page_list_len)
 -{
 -      unsigned size = page_list_len * sizeof(u64);
 -      struct ib_fast_reg_page_list *pl;
 -
 -      if (size > PAGE_SIZE)
 -              return ERR_PTR(-EINVAL);
 -
 -      pl = kzalloc(sizeof(*pl), GFP_KERNEL);
 -      if (!pl)
 -              return ERR_PTR(-ENOMEM);
 -
 -      pl->page_list = kzalloc(size, GFP_KERNEL);
 -      if (!pl->page_list)
 -              goto err_free;
 -
 -      return pl;
 -
 -err_free:
 -      kfree(pl);
 -      return ERR_PTR(-ENOMEM);
 -}
 -
 -void hfi1_free_fast_reg_page_list(struct ib_fast_reg_page_list *pl)
 -{
 -      kfree(pl->page_list);
 -      kfree(pl);
 -}
 -
  /**
   * hfi1_alloc_fmr - allocate a fast memory region
   * @pd: the protection domain for this memory region
index fd0ac608c62dca582bef0ef50604c1a2be6fb644,0b19206ff33efd2d594fbd9b7b691688cc798591..5fc93bb312f1b900ead7e1b6ae4f7ed643799f75
@@@ -404,9 -404,9 +404,9 @@@ int hfi1_make_rc_req(struct hfi1_qp *qp
                                goto bail;
                        }
                        ohdr->u.rc.reth.vaddr =
 -                              cpu_to_be64(wqe->wr.wr.rdma.remote_addr);
 +                              cpu_to_be64(wqe->rdma_wr.remote_addr);
                        ohdr->u.rc.reth.rkey =
 -                              cpu_to_be32(wqe->wr.wr.rdma.rkey);
 +                              cpu_to_be32(wqe->rdma_wr.rkey);
                        ohdr->u.rc.reth.length = cpu_to_be32(len);
                        hwords += sizeof(struct ib_reth) / sizeof(u32);
                        wqe->lpsn = wqe->psn;
                                wqe->lpsn = qp->s_next_psn++;
                        }
                        ohdr->u.rc.reth.vaddr =
 -                              cpu_to_be64(wqe->wr.wr.rdma.remote_addr);
 +                              cpu_to_be64(wqe->rdma_wr.remote_addr);
                        ohdr->u.rc.reth.rkey =
 -                              cpu_to_be32(wqe->wr.wr.rdma.rkey);
 +                              cpu_to_be32(wqe->rdma_wr.rkey);
                        ohdr->u.rc.reth.length = cpu_to_be32(len);
                        qp->s_state = OP(RDMA_READ_REQUEST);
                        hwords += sizeof(ohdr->u.rc.reth) / sizeof(u32);
                        if (wqe->wr.opcode == IB_WR_ATOMIC_CMP_AND_SWP) {
                                qp->s_state = OP(COMPARE_SWAP);
                                ohdr->u.atomic_eth.swap_data = cpu_to_be64(
 -                                      wqe->wr.wr.atomic.swap);
 +                                      wqe->atomic_wr.swap);
                                ohdr->u.atomic_eth.compare_data = cpu_to_be64(
 -                                      wqe->wr.wr.atomic.compare_add);
 +                                      wqe->atomic_wr.compare_add);
                        } else {
                                qp->s_state = OP(FETCH_ADD);
                                ohdr->u.atomic_eth.swap_data = cpu_to_be64(
 -                                      wqe->wr.wr.atomic.compare_add);
 +                                      wqe->atomic_wr.compare_add);
                                ohdr->u.atomic_eth.compare_data = 0;
                        }
                        ohdr->u.atomic_eth.vaddr[0] = cpu_to_be32(
 -                              wqe->wr.wr.atomic.remote_addr >> 32);
 +                              wqe->atomic_wr.remote_addr >> 32);
                        ohdr->u.atomic_eth.vaddr[1] = cpu_to_be32(
 -                              wqe->wr.wr.atomic.remote_addr);
 +                              wqe->atomic_wr.remote_addr);
                        ohdr->u.atomic_eth.rkey = cpu_to_be32(
 -                              wqe->wr.wr.atomic.rkey);
 +                              wqe->atomic_wr.rkey);
                        hwords += sizeof(struct ib_atomic_eth) / sizeof(u32);
                        ss = NULL;
                        len = 0;
                 */
                len = (delta_psn(qp->s_psn, wqe->psn)) * pmtu;
                ohdr->u.rc.reth.vaddr =
 -                      cpu_to_be64(wqe->wr.wr.rdma.remote_addr + len);
 +                      cpu_to_be64(wqe->rdma_wr.remote_addr + len);
                ohdr->u.rc.reth.rkey =
 -                      cpu_to_be32(wqe->wr.wr.rdma.rkey);
 +                      cpu_to_be32(wqe->rdma_wr.rkey);
                ohdr->u.rc.reth.length = cpu_to_be32(wqe->length - len);
                qp->s_state = OP(RDMA_READ_REQUEST);
                hwords += sizeof(ohdr->u.rc.reth) / sizeof(u32);
@@@ -697,6 -697,7 +697,7 @@@ void hfi1_send_rc_ack(struct hfi1_ctxtd
        struct pio_buf *pbuf;
        struct hfi1_ib_header hdr;
        struct hfi1_other_headers *ohdr;
+       unsigned long flags;
  
        /* Don't send ACK or NAK if a RDMA read or atomic is pending. */
        if (qp->s_flags & HFI1_S_RESP_PENDING)
  
  queue_ack:
        this_cpu_inc(*ibp->rc_qacks);
-       spin_lock(&qp->s_lock);
+       spin_lock_irqsave(&qp->s_lock, flags);
        qp->s_flags |= HFI1_S_ACK_PENDING | HFI1_S_RESP_PENDING;
        qp->s_nak_state = qp->r_nak_state;
        qp->s_ack_psn = qp->r_ack_psn;
  
        /* Schedule the send tasklet. */
        hfi1_schedule_send(qp);
-       spin_unlock(&qp->s_lock);
+       spin_unlock_irqrestore(&qp->s_lock, flags);
  }
  
  /**
@@@ -926,6 -927,7 +927,7 @@@ static void rc_timeout(unsigned long ar
                ibp->n_rc_timeouts++;
                qp->s_flags &= ~HFI1_S_TIMER;
                del_timer(&qp->s_timer);
+               trace_hfi1_rc_timeout(qp, qp->s_last_psn + 1);
                restart_rc(qp, qp->s_last_psn + 1, 1);
                hfi1_schedule_send(qp);
        }
@@@ -1152,7 -1154,7 +1154,7 @@@ static struct hfi1_swqe *do_rc_completi
   *
   * This is called from rc_rcv_resp() to process an incoming RC ACK
   * for the given QP.
-  * Called at interrupt level with the QP s_lock held.
+  * May be called at interrupt level, with the QP s_lock held.
   * Returns 1 if OK, 0 if current operation should be aborted (NAK).
   */
  static int do_rc_ack(struct hfi1_qp *qp, u32 aeth, u32 psn, int opcode,
@@@ -1441,6 -1443,8 +1443,8 @@@ static void rc_rcv_resp(struct hfi1_ibp
  
        spin_lock_irqsave(&qp->s_lock, flags);
  
+       trace_hfi1_rc_ack(qp, psn);
        /* Ignore invalid responses. */
        if (cmp_psn(psn, qp->s_next_psn) >= 0)
                goto ack_done;
@@@ -1629,6 -1633,7 +1633,7 @@@ static noinline int rc_rcv_error(struc
        u8 i, prev;
        int old_req;
  
+       trace_hfi1_rc_rcv_error(qp, psn);
        if (diff > 0) {
                /*
                 * Packet sequence error.
@@@ -1835,11 -1840,12 +1840,12 @@@ static void log_cca_event(struct hfi1_p
                          u32 lqpn, u32 rqpn, u8 svc_type)
  {
        struct opa_hfi1_cong_log_event_internal *cc_event;
+       unsigned long flags;
  
        if (sl >= OPA_MAX_SLS)
                return;
  
-       spin_lock(&ppd->cc_log_lock);
+       spin_lock_irqsave(&ppd->cc_log_lock, flags);
  
        ppd->threshold_cong_event_map[sl/8] |= 1 << (sl % 8);
        ppd->threshold_event_counter++;
        /* keep timestamp in units of 1.024 usec */
        cc_event->timestamp = ktime_to_ns(ktime_get()) / 1024;
  
-       spin_unlock(&ppd->cc_log_lock);
+       spin_unlock_irqrestore(&ppd->cc_log_lock, flags);
  }
  
  void process_becn(struct hfi1_pportdata *ppd, u8 sl, u16 rlid, u32 lqpn,
        u16 ccti, ccti_incr, ccti_timer, ccti_limit;
        u8 trigger_threshold;
        struct cc_state *cc_state;
+       unsigned long flags;
  
        if (sl >= OPA_MAX_SLS)
                return;
        trigger_threshold =
                cc_state->cong_setting.entries[sl].trigger_threshold;
  
-       spin_lock(&ppd->cca_timer_lock);
+       spin_lock_irqsave(&ppd->cca_timer_lock, flags);
  
        if (cca_timer->ccti < ccti_limit) {
                if (cca_timer->ccti + ccti_incr <= ccti_limit)
                set_link_ipg(ppd);
        }
  
-       spin_unlock(&ppd->cca_timer_lock);
+       spin_unlock_irqrestore(&ppd->cca_timer_lock, flags);
  
        ccti = cca_timer->ccti;
  
   *
   * This is called from qp_rcv() to process an incoming RC packet
   * for the given QP.
-  * Called at interrupt level.
+  * May be called at interrupt level.
   */
  void hfi1_rc_rcv(struct hfi1_packet *packet)
  {
@@@ -2383,7 -2390,7 +2390,7 @@@ void hfi1_rc_hdrerr
        struct hfi1_other_headers *ohdr;
        struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num);
        int diff;
-       u8 opcode;
+       u32 opcode;
        u32 psn;
  
        /* Check for GRH */
index d614474770b31cf7f3bf4424bb85d010858399d7,8614b070545c90d5fc0e56e575ea0f5d1403aa4a..49bc9fd7a51aee2c3e0e57717ff2514a02c2e327
@@@ -481,8 -481,8 +481,8 @@@ again
                if (wqe->length == 0)
                        break;
                if (unlikely(!hfi1_rkey_ok(qp, &qp->r_sge.sge, wqe->length,
 -                                         wqe->wr.wr.rdma.remote_addr,
 -                                         wqe->wr.wr.rdma.rkey,
 +                                         wqe->rdma_wr.remote_addr,
 +                                         wqe->rdma_wr.rkey,
                                           IB_ACCESS_REMOTE_WRITE)))
                        goto acc_err;
                qp->r_sge.sg_list = NULL;
                if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_READ)))
                        goto inv_err;
                if (unlikely(!hfi1_rkey_ok(qp, &sqp->s_sge.sge, wqe->length,
 -                                         wqe->wr.wr.rdma.remote_addr,
 -                                         wqe->wr.wr.rdma.rkey,
 +                                         wqe->rdma_wr.remote_addr,
 +                                         wqe->rdma_wr.rkey,
                                           IB_ACCESS_REMOTE_READ)))
                        goto acc_err;
                release = 0;
                if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
                        goto inv_err;
                if (unlikely(!hfi1_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
 -                                         wqe->wr.wr.atomic.remote_addr,
 -                                         wqe->wr.wr.atomic.rkey,
 +                                         wqe->atomic_wr.remote_addr,
 +                                         wqe->atomic_wr.rkey,
                                           IB_ACCESS_REMOTE_ATOMIC)))
                        goto acc_err;
                /* Perform atomic OP and save result. */
                maddr = (atomic64_t *) qp->r_sge.sge.vaddr;
 -              sdata = wqe->wr.wr.atomic.compare_add;
 +              sdata = wqe->atomic_wr.compare_add;
                *(u64 *) sqp->s_sge.sge.vaddr =
                        (wqe->wr.opcode == IB_WR_ATOMIC_FETCH_AND_ADD) ?
                        (u64) atomic64_add_return(sdata, maddr) - sdata :
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
 -                                    sdata, wqe->wr.wr.atomic.swap);
 +                                    sdata, wqe->atomic_wr.swap);
                hfi1_put_mr(qp->r_sge.sge.mr);
                qp->r_sge.num_sge = 0;
                goto send_comp;
@@@ -695,19 -695,6 +695,6 @@@ u32 hfi1_make_grh(struct hfi1_ibport *i
        return sizeof(struct ib_grh) / sizeof(u32);
  }
  
- /*
-  * free_ahg - clear ahg from QP
-  */
- void clear_ahg(struct hfi1_qp *qp)
- {
-       qp->s_hdr->ahgcount = 0;
-       qp->s_flags &= ~(HFI1_S_AHG_VALID | HFI1_S_AHG_CLEAR);
-       if (qp->s_sde)
-               sdma_ahg_free(qp->s_sde, qp->s_ahgidx);
-       qp->s_ahgidx = -1;
-       qp->s_sde = NULL;
- }
  #define BTH2_OFFSET (offsetof(struct hfi1_pio_header, hdr.u.oth.bth[2]) / 4)
  
  /**
@@@ -833,6 -820,9 +820,9 @@@ void hfi1_make_ruc_header(struct hfi1_q
        ohdr->bth[2] = cpu_to_be32(bth2);
  }
  
+ /* when sending, force a reschedule every one of these periods */
+ #define SEND_RESCHED_TIMEOUT (5 * HZ)  /* 5s in jiffies */
  /**
   * hfi1_do_send - perform a send on a QP
   * @work: contains a pointer to the QP
@@@ -849,6 -839,7 +839,7 @@@ void hfi1_do_send(struct work_struct *w
        struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
        int (*make_req)(struct hfi1_qp *qp);
        unsigned long flags;
+       unsigned long timeout;
  
        if ((qp->ibqp.qp_type == IB_QPT_RC ||
             qp->ibqp.qp_type == IB_QPT_UC) &&
  
        spin_unlock_irqrestore(&qp->s_lock, flags);
  
+       timeout = jiffies + SEND_RESCHED_TIMEOUT;
        do {
                /* Check for a constructed packet to be sent. */
                if (qp->s_hdrwords != 0) {
                        /* Record that s_hdr is empty. */
                        qp->s_hdrwords = 0;
                }
+               /* allow other tasks to run */
+               if (unlikely(time_after(jiffies, timeout))) {
+                       cond_resched();
+                       ppd->dd->verbs_dev.n_send_schedule++;
+                       timeout = jiffies + SEND_RESCHED_TIMEOUT;
+               }
        } while (make_req(qp));
  }
  
@@@ -913,7 -912,7 +912,7 @@@ void hfi1_send_complete(struct hfi1_qp 
        if (qp->ibqp.qp_type == IB_QPT_UD ||
            qp->ibqp.qp_type == IB_QPT_SMI ||
            qp->ibqp.qp_type == IB_QPT_GSI)
 -              atomic_dec(&to_iah(wqe->wr.wr.ud.ah)->refcount);
 +              atomic_dec(&to_iah(wqe->ud_wr.ah)->refcount);
  
        /* See ch. 11.2.4.1 and 10.7.3.1 */
        if (!(qp->s_flags & HFI1_S_SIGNAL_REQ_WR) ||
index 6e2da7ee6d2f69c9828a1de861a152f25726c017,a13a2b135365f845e825ec5a3cd105aaa13f4160..9beb0aa876f073c8eaad7fd119118b55b77dcf6c
@@@ -129,6 -129,9 +129,9 @@@ static void verbs_sdma_complete
        int status,
        int drained);
  
+ /* Length of buffer to create verbs txreq cache name */
+ #define TXREQ_NAME_LEN 24
  /*
   * Note that it is OK to post send work requests in the SQE and ERR
   * states; hfi1_do_send() will process them and generate error
@@@ -380,7 -383,9 +383,7 @@@ static int post_one_send(struct hfi1_q
         * undefined operations.
         * Make sure buffer is large enough to hold the result for atomics.
         */
 -      if (wr->opcode == IB_WR_FAST_REG_MR) {
 -              return -EINVAL;
 -      } else if (qp->ibqp.qp_type == IB_QPT_UC) {
 +      if (qp->ibqp.qp_type == IB_QPT_UC) {
                if ((unsigned) wr->opcode >= IB_WR_RDMA_READ)
                        return -EINVAL;
        } else if (qp->ibqp.qp_type != IB_QPT_RC) {
                    wr->opcode != IB_WR_SEND_WITH_IMM)
                        return -EINVAL;
                /* Check UD destination address PD */
 -              if (qp->ibqp.pd != wr->wr.ud.ah->pd)
 +              if (qp->ibqp.pd != ud_wr(wr)->ah->pd)
                        return -EINVAL;
        } else if ((unsigned) wr->opcode > IB_WR_ATOMIC_FETCH_AND_ADD)
                return -EINVAL;
        rkt = &to_idev(qp->ibqp.device)->lk_table;
        pd = to_ipd(qp->ibqp.pd);
        wqe = get_swqe_ptr(qp, qp->s_head);
 -      wqe->wr = *wr;
 +
 +
 +      if (qp->ibqp.qp_type != IB_QPT_UC &&
 +          qp->ibqp.qp_type != IB_QPT_RC)
 +              memcpy(&wqe->ud_wr, ud_wr(wr), sizeof(wqe->ud_wr));
 +      else if (wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM ||
 +               wr->opcode == IB_WR_RDMA_WRITE ||
 +               wr->opcode == IB_WR_RDMA_READ)
 +              memcpy(&wqe->rdma_wr, rdma_wr(wr), sizeof(wqe->rdma_wr));
 +      else if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP ||
 +               wr->opcode == IB_WR_ATOMIC_FETCH_AND_ADD)
 +              memcpy(&wqe->atomic_wr, atomic_wr(wr), sizeof(wqe->atomic_wr));
 +      else
 +              memcpy(&wqe->wr, wr, sizeof(wqe->wr));
 +
        wqe->length = 0;
        j = 0;
        if (wr->num_sge) {
                if (wqe->length > 0x80000000U)
                        goto bail_inval_free;
        } else {
 -              struct hfi1_ah *ah = to_iah(wr->wr.ud.ah);
 +              struct hfi1_ah *ah = to_iah(ud_wr(wr)->ah);
  
                atomic_inc(&ah->refcount);
        }
@@@ -609,6 -600,7 +612,7 @@@ void hfi1_ib_rcv(struct hfi1_packet *pa
        u32 tlen = packet->tlen;
        struct hfi1_pportdata *ppd = rcd->ppd;
        struct hfi1_ibport *ibp = &ppd->ibport_data;
+       unsigned long flags;
        u32 qp_num;
        int lnh;
        u8 opcode;
                        goto drop;
                list_for_each_entry_rcu(p, &mcast->qp_list, list) {
                        packet->qp = p->qp;
-                       spin_lock(&packet->qp->r_lock);
+                       spin_lock_irqsave(&packet->qp->r_lock, flags);
                        if (likely((qp_ok(opcode, packet))))
                                opcode_handler_tbl[opcode](packet);
-                       spin_unlock(&packet->qp->r_lock);
+                       spin_unlock_irqrestore(&packet->qp->r_lock, flags);
                }
                /*
                 * Notify hfi1_multicast_detach() if it is waiting for us
                        rcu_read_unlock();
                        goto drop;
                }
-               spin_lock(&packet->qp->r_lock);
+               spin_lock_irqsave(&packet->qp->r_lock, flags);
                if (likely((qp_ok(opcode, packet))))
                        opcode_handler_tbl[opcode](packet);
-               spin_unlock(&packet->qp->r_lock);
+               spin_unlock_irqrestore(&packet->qp->r_lock, flags);
                rcu_read_unlock();
        }
        return;
@@@ -1211,6 -1203,7 +1215,7 @@@ pio_bail
        }
        return 0;
  }
  /*
   * egress_pkey_matches_entry - return 1 if the pkey matches ent (ent
   * being an entry from the ingress partition key table), return 0
@@@ -1896,7 -1889,7 +1901,7 @@@ static void init_ibport(struct hfi1_ppo
  
  static void verbs_txreq_kmem_cache_ctor(void *obj)
  {
-       struct verbs_txreq *tx = (struct verbs_txreq *)obj;
+       struct verbs_txreq *tx = obj;
  
        memset(tx, 0, sizeof(*tx));
  }
@@@ -1915,6 -1908,7 +1920,7 @@@ int hfi1_register_ib_device(struct hfi1
        int ret;
        size_t lcpysz = IB_DEVICE_NAME_MAX;
        u16 descq_cnt;
+       char buf[TXREQ_NAME_LEN];
  
        ret = hfi1_qp_init(dev);
        if (ret)
  
        descq_cnt = sdma_get_descq_cnt();
  
+       snprintf(buf, sizeof(buf), "hfi1_%u_vtxreq_cache", dd->unit);
        /* SLAB_HWCACHE_ALIGN for AHG */
-       dev->verbs_txreq_cache = kmem_cache_create("hfi1_vtxreq_cache",
+       dev->verbs_txreq_cache = kmem_cache_create(buf,
                                                   sizeof(struct verbs_txreq),
                                                   0, SLAB_HWCACHE_ALIGN,
                                                   verbs_txreq_kmem_cache_ctor);
        ibdev->reg_user_mr = hfi1_reg_user_mr;
        ibdev->dereg_mr = hfi1_dereg_mr;
        ibdev->alloc_mr = hfi1_alloc_mr;
 -      ibdev->alloc_fast_reg_page_list = hfi1_alloc_fast_reg_page_list;
 -      ibdev->free_fast_reg_page_list = hfi1_free_fast_reg_page_list;
        ibdev->alloc_fmr = hfi1_alloc_fmr;
        ibdev->map_phys_fmr = hfi1_map_phys_fmr;
        ibdev->unmap_fmr = hfi1_unmap_fmr;
index 159ec08bfcd8d613e92f54c390df05f1c188d14d,e4a8a0d4ccf8b64a3ccf0d3f083276d6320dd43b..041ad07ee699a05c571b833f0469970da4972cae
@@@ -348,12 -348,7 +348,12 @@@ struct hfi1_mr 
   * in qp->s_max_sge.
   */
  struct hfi1_swqe {
 -      struct ib_send_wr wr;   /* don't use wr.sg_list */
 +      union {
 +              struct ib_send_wr wr;   /* don't use wr.sg_list */
 +              struct ib_rdma_wr rdma_wr;
 +              struct ib_atomic_wr atomic_wr;
 +              struct ib_ud_wr ud_wr;
 +      };
        u32 psn;                /* first packet sequence number */
        u32 lpsn;               /* last packet sequence number */
        u32 ssn;                /* send sequence number */
@@@ -759,6 -754,7 +759,7 @@@ struct hfi1_ibdev 
        u64 n_piowait;
        u64 n_txwait;
        u64 n_kmem_wait;
+       u64 n_send_schedule;
  
        u32 n_pds_allocated;    /* number of PDs allocated for device */
        spinlock_t n_pds_lock;
@@@ -1025,6 -1021,13 +1026,6 @@@ struct ib_mr *hfi1_alloc_mr(struct ib_p
                            enum ib_mr_type mr_type,
                            u32 max_entries);
  
 -struct ib_fast_reg_page_list *hfi1_alloc_fast_reg_page_list(
 -                              struct ib_device *ibdev, int page_list_len);
 -
 -void hfi1_free_fast_reg_page_list(struct ib_fast_reg_page_list *pl);
 -
 -int hfi1_fast_reg_mr(struct hfi1_qp *qp, struct ib_send_wr *wr);
 -
  struct ib_fmr *hfi1_alloc_fmr(struct ib_pd *pd, int mr_access_flags,
                              struct ib_fmr_attr *fmr_attr);
  
@@@ -1076,8 -1079,6 +1077,6 @@@ int hfi1_ruc_check_hdr(struct hfi1_ibpo
  u32 hfi1_make_grh(struct hfi1_ibport *ibp, struct ib_grh *hdr,
                  struct ib_global_route *grh, u32 hwords, u32 nwords);
  
- void clear_ahg(struct hfi1_qp *qp);
  void hfi1_make_ruc_header(struct hfi1_qp *qp, struct hfi1_other_headers *ohdr,
                          u32 bth0, u32 bth2, int middle);
  
index 46af8b03d3d461f23c3bade19230df36e0d67b20,2296832f94da868e3c2f884bfbcd2d9e94cc4fed..e541a01f1f6122575260e30a7a1dff5445cbdc15
@@@ -31,7 -31,6 +31,6 @@@
   * SOFTWARE.
   */
  
- #include <linux/sched.h>
  #include <linux/spinlock.h>
  
  #include "ipath_verbs.h"
@@@ -353,8 -352,8 +352,8 @@@ again
                if (wqe->length == 0)
                        break;
                if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, wqe->length,
 -                                          wqe->wr.wr.rdma.remote_addr,
 -                                          wqe->wr.wr.rdma.rkey,
 +                                          wqe->rdma_wr.remote_addr,
 +                                          wqe->rdma_wr.rkey,
                                            IB_ACCESS_REMOTE_WRITE)))
                        goto acc_err;
                break;
                if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_READ)))
                        goto inv_err;
                if (unlikely(!ipath_rkey_ok(qp, &sqp->s_sge, wqe->length,
 -                                          wqe->wr.wr.rdma.remote_addr,
 -                                          wqe->wr.wr.rdma.rkey,
 +                                          wqe->rdma_wr.remote_addr,
 +                                          wqe->rdma_wr.rkey,
                                            IB_ACCESS_REMOTE_READ)))
                        goto acc_err;
                qp->r_sge.sge = wqe->sg_list[0];
                if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
                        goto inv_err;
                if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, sizeof(u64),
 -                                          wqe->wr.wr.atomic.remote_addr,
 -                                          wqe->wr.wr.atomic.rkey,
 +                                          wqe->atomic_wr.remote_addr,
 +                                          wqe->atomic_wr.rkey,
                                            IB_ACCESS_REMOTE_ATOMIC)))
                        goto acc_err;
                /* Perform atomic OP and save result. */
                maddr = (atomic64_t *) qp->r_sge.sge.vaddr;
 -              sdata = wqe->wr.wr.atomic.compare_add;
 +              sdata = wqe->atomic_wr.compare_add;
                *(u64 *) sqp->s_sge.sge.vaddr =
                        (wqe->wr.opcode == IB_WR_ATOMIC_FETCH_AND_ADD) ?
                        (u64) atomic64_add_return(sdata, maddr) - sdata :
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
 -                                    sdata, wqe->wr.wr.atomic.swap);
 +                                    sdata, wqe->atomic_wr.swap);
                goto send_comp;
  
        default:
index 3ffc1565d03d877db7853626f268ee45e8ce4eac,33fcfe206bc90d4613d561f90c51a27c6dae013d..385d9410a51e01478bb5f060c2ecb5d8129ef80f
@@@ -31,7 -31,6 +31,6 @@@
   * SOFTWARE.
   */
  
- #include <linux/sched.h>
  #include <rdma/ib_smi.h>
  
  #include "ipath_verbs.h"
@@@ -65,7 -64,7 +64,7 @@@ static void ipath_ud_loopback(struct ip
        u32 rlen;
        u32 length;
  
 -      qp = ipath_lookup_qpn(&dev->qp_table, swqe->wr.wr.ud.remote_qpn);
 +      qp = ipath_lookup_qpn(&dev->qp_table, swqe->ud_wr.remote_qpn);
        if (!qp || !(ib_ipath_state_ops[qp->state] & IPATH_PROCESS_RECV_OK)) {
                dev->n_pkt_drops++;
                goto done;
@@@ -77,8 -76,8 +76,8 @@@
         * qkey from the QP context instead of the WR (see 10.2.5).
         */
        if (unlikely(qp->ibqp.qp_num &&
 -                   ((int) swqe->wr.wr.ud.remote_qkey < 0 ?
 -                    sqp->qkey : swqe->wr.wr.ud.remote_qkey) != qp->qkey)) {
 +                   ((int) swqe->ud_wr.remote_qkey < 0 ?
 +                    sqp->qkey : swqe->ud_wr.remote_qkey) != qp->qkey)) {
                /* XXX OK to lose a count once in a while. */
                dev->qkey_violations++;
                dev->n_pkt_drops++;
        } else
                spin_unlock_irqrestore(&rq->lock, flags);
  
 -      ah_attr = &to_iah(swqe->wr.wr.ud.ah)->attr;
 +      ah_attr = &to_iah(swqe->ud_wr.ah)->attr;
        if (ah_attr->ah_flags & IB_AH_GRH) {
                ipath_copy_sge(&rsge, &ah_attr->grh, sizeof(struct ib_grh));
                wc.wc_flags |= IB_WC_GRH;
        wc.port_num = 1;
        /* Signal completion event if the solicited bit is set. */
        ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
 -                     swqe->wr.send_flags & IB_SEND_SOLICITED);
 +                     swqe->ud_wr.wr.send_flags & IB_SEND_SOLICITED);
  drop:
        if (atomic_dec_and_test(&qp->refcount))
                wake_up(&qp->wait);
@@@ -280,7 -279,7 +279,7 @@@ int ipath_make_ud_req(struct ipath_qp *
                next_cur = 0;
  
        /* Construct the header. */
 -      ah_attr = &to_iah(wqe->wr.wr.ud.ah)->attr;
 +      ah_attr = &to_iah(wqe->ud_wr.ah)->attr;
        if (ah_attr->dlid >= IPATH_MULTICAST_LID_BASE) {
                if (ah_attr->dlid != IPATH_PERMISSIVE_LID)
                        dev->n_multicast_xmit++;
        qp->s_wqe = wqe;
        qp->s_sge.sge = wqe->sg_list[0];
        qp->s_sge.sg_list = wqe->sg_list + 1;
 -      qp->s_sge.num_sge = wqe->wr.num_sge;
 +      qp->s_sge.num_sge = wqe->ud_wr.wr.num_sge;
  
        if (ah_attr->ah_flags & IB_AH_GRH) {
                /* Header size in 32-bit words. */
                lrh0 = IPATH_LRH_BTH;
                ohdr = &qp->s_hdr.u.oth;
        }
 -      if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) {
 +      if (wqe->ud_wr.wr.opcode == IB_WR_SEND_WITH_IMM) {
                qp->s_hdrwords++;
 -              ohdr->u.ud.imm_data = wqe->wr.ex.imm_data;
 +              ohdr->u.ud.imm_data = wqe->ud_wr.wr.ex.imm_data;
                bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24;
        } else
                bth0 = IB_OPCODE_UD_SEND_ONLY << 24;
                qp->s_hdr.lrh[3] = cpu_to_be16(lid);
        } else
                qp->s_hdr.lrh[3] = IB_LID_PERMISSIVE;
 -      if (wqe->wr.send_flags & IB_SEND_SOLICITED)
 +      if (wqe->ud_wr.wr.send_flags & IB_SEND_SOLICITED)
                bth0 |= 1 << 23;
        bth0 |= extra_bytes << 20;
        bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? IPATH_DEFAULT_P_KEY :
        ohdr->bth[1] = ah_attr->dlid >= IPATH_MULTICAST_LID_BASE &&
                ah_attr->dlid != IPATH_PERMISSIVE_LID ?
                cpu_to_be32(IPATH_MULTICAST_QPN) :
 -              cpu_to_be32(wqe->wr.wr.ud.remote_qpn);
 +              cpu_to_be32(wqe->ud_wr.remote_qpn);
        ohdr->bth[2] = cpu_to_be32(qp->s_next_psn++ & IPATH_PSN_MASK);
        /*
         * Qkeys with the high order bit set mean use the
         * qkey from the QP context instead of the WR (see 10.2.5).
         */
 -      ohdr->u.ud.deth[0] = cpu_to_be32((int)wqe->wr.wr.ud.remote_qkey < 0 ?
 -                                       qp->qkey : wqe->wr.wr.ud.remote_qkey);
 +      ohdr->u.ud.deth[0] = cpu_to_be32((int)wqe->ud_wr.remote_qkey < 0 ?
 +                                       qp->qkey : wqe->ud_wr.remote_qkey);
        ohdr->u.ud.deth[1] = cpu_to_be32(qp->ibqp.qp_num);
  
  done:
index 29e91796fb10965de9d2861fa9aaa4f2e1942a7e,a2fb41bba11711828a9d17e5cbc0c5398c5ee7a5..1778dee13f99269c51cc90f6c4d09a6f46a13a21
@@@ -374,7 -374,7 +374,7 @@@ static int ipath_post_one_send(struct i
                    wr->opcode != IB_WR_SEND_WITH_IMM)
                        goto bail_inval;
                /* Check UD destination address PD */
 -              if (qp->ibqp.pd != wr->wr.ud.ah->pd)
 +              if (qp->ibqp.pd != ud_wr(wr)->ah->pd)
                        goto bail_inval;
        } else if ((unsigned) wr->opcode > IB_WR_ATOMIC_FETCH_AND_ADD)
                goto bail_inval;
        }
  
        wqe = get_swqe_ptr(qp, qp->s_head);
 -      wqe->wr = *wr;
 +
 +      if (qp->ibqp.qp_type != IB_QPT_UC &&
 +          qp->ibqp.qp_type != IB_QPT_RC)
 +              memcpy(&wqe->ud_wr, ud_wr(wr), sizeof(wqe->ud_wr));
 +      else if (wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM ||
 +               wr->opcode == IB_WR_RDMA_WRITE ||
 +               wr->opcode == IB_WR_RDMA_READ)
 +              memcpy(&wqe->rdma_wr, rdma_wr(wr), sizeof(wqe->rdma_wr));
 +      else if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP ||
 +               wr->opcode == IB_WR_ATOMIC_FETCH_AND_ADD)
 +              memcpy(&wqe->atomic_wr, atomic_wr(wr), sizeof(wqe->atomic_wr));
 +      else
 +              memcpy(&wqe->wr, wr, sizeof(wqe->wr));
 +
        wqe->length = 0;
        if (wr->num_sge) {
                acc = wr->opcode >= IB_WR_RDMA_READ ?
@@@ -752,9 -739,9 +752,9 @@@ static void ipath_ib_timer(struct ipath
                        dev->ipath_spkts = tc - dev->ipath_spkts;
                        dev->ipath_rpkts = td - dev->ipath_rpkts;
                        dev->ipath_xmit_wait = te - dev->ipath_xmit_wait;
-               }
-               else
+               } else {
                        dev->pma_sample_interval--;
+               }
        }
        spin_unlock_irqrestore(&dev->pending_lock, flags);
  
@@@ -1969,9 -1956,8 +1969,8 @@@ static int enable_timer(struct ipath_de
                                 dd->ipath_gpio_mask);
        }
  
-       init_timer(&dd->verbs_timer);
-       dd->verbs_timer.function = __verbs_timer;
-       dd->verbs_timer.data = (unsigned long)dd;
+       setup_timer(&dd->verbs_timer, __verbs_timer, (unsigned long)dd);
        dd->verbs_timer.expires = jiffies + 1;
        add_timer(&dd->verbs_timer);
  
@@@ -2038,8 -2024,8 +2037,8 @@@ int ipath_register_ib_device(struct ipa
        dev = &idev->ibdev;
  
        if (dd->ipath_sdma_descq_cnt) {
-               tx = kmalloc(dd->ipath_sdma_descq_cnt * sizeof *tx,
-                            GFP_KERNEL);
+               tx = kmalloc_array(dd->ipath_sdma_descq_cnt, sizeof *tx,
+                                  GFP_KERNEL);
                if (tx == NULL) {
                        ret = -ENOMEM;
                        goto err_tx;
         * the LKEY).  The remaining bits act as a generation number or tag.
         */
        idev->lk_table.max = 1 << ib_ipath_lkey_table_size;
-       idev->lk_table.table = kzalloc(idev->lk_table.max *
+       idev->lk_table.table = kcalloc(idev->lk_table.max,
                                       sizeof(*idev->lk_table.table),
                                       GFP_KERNEL);
        if (idev->lk_table.table == NULL) {
diff --combined include/linux/fb.h
index be40dbaed11e06a93eedd67ccff968d7e1aa39fa,41a3b11f77962dc7a021711a54c22c71fb737a11..3d003805aac32ab1880c432cf556da8c5c29e14c
@@@ -156,7 -156,7 +156,7 @@@ struct fb_cursor_user 
  #define FB_EVENT_GET_REQ                0x0D
  /*      Unbind from the console if possible */
  #define FB_EVENT_FB_UNBIND              0x0E
 -/*      CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */
 +/*      CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */
  #define FB_EVENT_REMAP_ALL_CONSOLE      0x0F
  /*      A hardware display blank early change occured */
  #define FB_EARLY_EVENT_BLANK          0x10
@@@ -483,7 -483,10 +483,10 @@@ struct fb_info 
  #ifdef CONFIG_FB_TILEBLITTING
        struct fb_tile_ops *tileops;    /* Tile Blitting */
  #endif
-       char __iomem *screen_base;      /* Virtual address */
+       union {
+               char __iomem *screen_base;      /* Virtual address */
+               char *screen_buffer;
+       };
        unsigned long screen_size;      /* Amount of ioremapped VRAM or 0 */ 
        void *pseudo_palette;           /* Fake palette of 16 colors */ 
  #define FBINFO_STATE_RUNNING  0