aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/media/v4l/driver.xml6
-rw-r--r--Documentation/PCI/pci-iov-howto.txt6
-rw-r--r--Documentation/PCI/pci.txt20
-rw-r--r--Documentation/acpi/enumeration.txt2
-rw-r--r--Documentation/devicetree/bindings/clock/imx23-clock.txt5
-rw-r--r--Documentation/devicetree/bindings/clock/imx25-clock.txt4
-rw-r--r--Documentation/devicetree/bindings/clock/imx28-clock.txt5
-rw-r--r--Documentation/devicetree/bindings/clock/imx6q-clock.txt4
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-poweroff.txt20
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt47
-rw-r--r--Documentation/i2c/instantiating-devices2
-rw-r--r--Documentation/networking/ip-sysctl.txt16
-rw-r--r--Documentation/power/runtime_pm.txt9
-rw-r--r--Documentation/rpmsg.txt4
-rw-r--r--Documentation/spi/spi-summary4
-rw-r--r--Documentation/sysctl/kernel.txt32
-rw-r--r--Documentation/video4linux/v4l2-framework.txt3
-rw-r--r--Documentation/zh_CN/video4linux/v4l2-framework.txt3
-rw-r--r--MAINTAINERS230
-rw-r--r--Makefile2
-rw-r--r--arch/alpha/include/asm/parport.h4
-rw-r--r--arch/alpha/kernel/pci.c12
-rw-r--r--arch/alpha/kernel/smp.c6
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/arm/Kconfig7
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi6
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi9
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi8
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78460.dtsi8
-rw-r--r--arch/arm/boot/dts/armada-xp.dtsi14
-rw-r--r--arch/arm/boot/dts/dbx5x0.dtsi4
-rw-r--r--arch/arm/boot/dts/dove.dtsi1
-rw-r--r--arch/arm/boot/dts/ecx-2000.dts4
-rw-r--r--arch/arm/boot/dts/exynos4210-smdkv310.dts2
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi2
-rw-r--r--arch/arm/boot/dts/exynos5440-ssdk5440.dts2
-rw-r--r--arch/arm/boot/dts/highbank.dts20
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts8
-rw-r--r--arch/arm/boot/dts/imx31-bug.dts2
-rw-r--r--arch/arm/boot/dts/imx53.dtsi2
-rw-r--r--arch/arm/boot/dts/kirkwood-6282.dtsi1
-rw-r--r--arch/arm/boot/dts/kirkwood-topkick.dts17
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi1
-rw-r--r--arch/arm/common/sa1111.c5
-rw-r--r--arch/arm/common/scoop.c6
-rw-r--r--arch/arm/common/vic.c9
-rw-r--r--arch/arm/configs/mvebu_defconfig4
-rw-r--r--arch/arm/kernel/bios32.c18
-rw-r--r--arch/arm/kernel/etm.c4
-rw-r--r--arch/arm/kernel/perf_event_cpu.c10
-rw-r--r--arch/arm/kernel/perf_event_v6.c4
-rw-r--r--arch/arm/kernel/perf_event_v7.c12
-rw-r--r--arch/arm/kernel/perf_event_xscale.c4
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c2
-rw-r--r--arch/arm/mach-davinci/cdce949.c4
-rw-r--r--arch/arm/mach-dove/pcie.c2
-rw-r--r--arch/arm/mach-exynos/Kconfig2
-rw-r--r--arch/arm/mach-exynos/common.c7
-rw-r--r--arch/arm/mach-highbank/highbank.c2
-rw-r--r--arch/arm/mach-highbank/hotplug.c2
-rw-r--r--arch/arm/mach-highbank/platsmp.c12
-rw-r--r--arch/arm/mach-highbank/pm.c19
-rw-r--r--arch/arm/mach-highbank/sysregs.h23
-rw-r--r--arch/arm/mach-highbank/system.c4
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/cpufreq.c2
-rw-r--r--arch/arm/mach-imx/mmdc.c2
-rw-r--r--arch/arm/mach-iop13xx/pci.c2
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c4
-rw-r--r--arch/arm/mach-kirkwood/board-usi_topkick.c4
-rw-r--r--arch/arm/mach-kirkwood/pcie.c2
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c2
-rw-r--r--arch/arm/mach-mmp/sram.c4
-rw-r--r--arch/arm/mach-msm/proc_comm.c2
-rw-r--r--arch/arm/mach-msm/smd.c2
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c2
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c1
-rw-r--r--arch/arm/mach-nomadik/include/mach/irqs.h78
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c2
-rw-r--r--arch/arm/mach-omap1/mailbox.c6
-rw-r--r--arch/arm/mach-omap1/usb.c8
-rw-r--r--arch/arm/mach-omap2/cclock3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/gpmc.c12
-rw-r--r--arch/arm/mach-omap2/mailbox.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c6
-rw-r--r--arch/arm/mach-omap2/prm2xxx.c88
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c22
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c28
-rw-r--r--arch/arm/mach-omap2/prm44xx.c6
-rw-r--r--arch/arm/mach-omap2/prm44xx.h4
-rw-r--r--arch/arm/mach-orion5x/pci.c2
-rw-r--r--arch/arm/mach-prima2/pm.c2
-rw-r--r--arch/arm/mach-prima2/rtciobrg.c2
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h3
-rw-r--r--arch/arm/mach-pxa/pxa27x.c4
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c4
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c2
-rw-r--r--arch/arm/mach-pxa/tosa-bt.c4
-rw-r--r--arch/arm/mach-s3c24xx/h1940-bluetooth.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris-dvs.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c68
-rw-r--r--arch/arm/mach-sa1100/jornada720_ssp.c2
-rw-r--r--arch/arm/mach-sa1100/neponset.c8
-rw-r--r--arch/arm/mach-tegra/pcie.c6
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c6
-rw-r--r--arch/arm/mach-u300/dummyspichip.c6
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c3
-rw-r--r--arch/arm/mach-versatile/include/mach/irqs.h6
-rw-r--r--arch/arm/mach-vexpress/Kconfig1
-rw-r--r--arch/arm/mm/cache-l2x0.c34
-rw-r--r--arch/arm/mm/proc-v7.S4
-rw-r--r--arch/arm/plat-omap/counter_32k.c2
-rw-r--r--arch/arm/plat-omap/dma.c6
-rw-r--r--arch/arm/plat-omap/dmtimer.c6
-rw-r--r--arch/arm/plat-omap/sram.c2
-rw-r--r--arch/arm/plat-pxa/ssp.c6
-rw-r--r--arch/arm/plat-samsung/adc.c4
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h2
-rw-r--r--arch/arm64/Kconfig6
-rw-r--r--arch/arm64/boot/dts/Makefile1
-rw-r--r--arch/arm64/include/asm/compat.h1
-rw-r--r--arch/arm64/kernel/perf_event.c2
-rw-r--r--arch/avr32/lib/delay.c2
-rw-r--r--arch/blackfin/mach-common/dpmc.c6
-rw-r--r--arch/cris/arch-v32/drivers/pci/bios.c2
-rw-r--r--arch/cris/arch-v32/kernel/smp.c2
-rw-r--r--arch/frv/kernel/setup.c2
-rw-r--r--arch/frv/mb93090-mb00/pci-vdk.c6
-rw-r--r--arch/ia64/include/asm/acpi.h2
-rw-r--r--arch/ia64/include/asm/iosapic.h11
-rw-r--r--arch/ia64/include/asm/parport.h5
-rw-r--r--arch/ia64/include/asm/smp.h2
-rw-r--r--arch/ia64/include/asm/unistd.h2
-rw-r--r--arch/ia64/include/uapi/asm/unistd.h1
-rw-r--r--arch/ia64/kernel/acpi.c6
-rw-r--r--arch/ia64/kernel/entry.S1
-rw-r--r--arch/ia64/kernel/iosapic.c19
-rw-r--r--arch/ia64/kernel/smpboot.c11
-rw-r--r--arch/ia64/kernel/time.c3
-rw-r--r--arch/ia64/mm/init.c5
-rw-r--r--arch/ia64/mm/tlb.c3
-rw-r--r--arch/ia64/pci/fixup.c2
-rw-r--r--arch/ia64/pci/pci.c31
-rw-r--r--arch/ia64/sn/kernel/io_common.c3
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c2
-rw-r--r--arch/ia64/xen/irq_xen.c5
-rw-r--r--arch/m32r/kernel/smpboot.c2
-rw-r--r--arch/m68k/emu/nfeth.c2
-rw-r--r--arch/m68k/include/asm/parport.h4
-rw-r--r--arch/m68k/kernel/pcibios.c4
-rw-r--r--arch/microblaze/configs/mmu_defconfig52
-rw-r--r--arch/microblaze/configs/nommu_defconfig73
-rw-r--r--arch/microblaze/include/asm/highmem.h2
-rw-r--r--arch/microblaze/include/asm/uaccess.h2
-rw-r--r--arch/microblaze/include/asm/unistd.h2
-rw-r--r--arch/microblaze/include/uapi/asm/unistd.h3
-rw-r--r--arch/microblaze/kernel/syscall_table.S1
-rw-r--r--arch/microblaze/pci/pci-common.c39
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/alchemy/common/time.c25
-rw-r--r--arch/mips/cavium-octeon/serial.c2
-rw-r--r--arch/mips/include/asm/page.h9
-rw-r--r--arch/mips/include/asm/pci.h4
-rw-r--r--arch/mips/include/asm/thread_info.h9
-rw-r--r--arch/mips/include/uapi/asm/unistd.h15
-rw-r--r--arch/mips/kernel/asm-offsets.c3
-rw-r--r--arch/mips/kernel/genex.S5
-rw-r--r--arch/mips/kernel/head.S1
-rw-r--r--arch/mips/kernel/octeon_switch.S1
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c38
-rw-r--r--arch/mips/kernel/r2300_switch.S1
-rw-r--r--arch/mips/kernel/r4k_switch.S1
-rw-r--r--arch/mips/kernel/relocate_kernel.S3
-rw-r--r--arch/mips/kernel/scall32-o32.S1
-rw-r--r--arch/mips/kernel/scall64-64.S1
-rw-r--r--arch/mips/kernel/scall64-n32.S1
-rw-r--r--arch/mips/kernel/scall64-o32.S1
-rw-r--r--arch/mips/kernel/smp.c2
-rw-r--r--arch/mips/kernel/vmlinux.lds.S3
-rw-r--r--arch/mips/lantiq/xway/dma.c2
-rw-r--r--arch/mips/lantiq/xway/gptu.c2
-rw-r--r--arch/mips/lantiq/xway/xrx200_phy_fw.c2
-rw-r--r--arch/mips/mm/ioremap.c6
-rw-r--r--arch/mips/mm/tlbex-fault.S1
-rw-r--r--arch/mips/mm/tlbex.c16
-rw-r--r--arch/mips/mti-sead3/sead3-i2c-drv.c6
-rw-r--r--arch/mips/mti-sead3/sead3-pic32-i2c-drv.c8
-rw-r--r--arch/mips/pci/fixup-cobalt.c8
-rw-r--r--arch/mips/pci/fixup-emma2rh.c4
-rw-r--r--arch/mips/pci/fixup-fuloong2e.c12
-rw-r--r--arch/mips/pci/fixup-lemote2f.c12
-rw-r--r--arch/mips/pci/fixup-malta.c10
-rw-r--r--arch/mips/pci/fixup-rc32434.c6
-rw-r--r--arch/mips/pci/fixup-sb1250.c6
-rw-r--r--arch/mips/pci/ops-bcm63xx.c2
-rw-r--r--arch/mips/pci/ops-tx4927.c6
-rw-r--r--arch/mips/pci/pci-alchemy.c2
-rw-r--r--arch/mips/pci/pci-ip27.c4
-rw-r--r--arch/mips/pci/pci-lantiq.c4
-rw-r--r--arch/mips/pci/pci.c9
-rw-r--r--arch/mips/power/hibernate.S3
-rw-r--r--arch/mips/sni/setup.c2
-rw-r--r--arch/mips/txx9/generic/pci.c11
-rw-r--r--arch/mn10300/Kconfig1
-rw-r--r--arch/mn10300/kernel/smp.c4
-rw-r--r--arch/mn10300/unit-asb2305/pci.c6
-rw-r--r--arch/openrisc/lib/delay.c2
-rw-r--r--arch/parisc/include/asm/parport.h2
-rw-r--r--arch/parisc/kernel/hardware.c7
-rw-r--r--arch/powerpc/include/asm/eeh.h6
-rw-r--r--arch/powerpc/include/asm/io-workarounds.h4
-rw-r--r--arch/powerpc/include/asm/parport.h2
-rw-r--r--arch/powerpc/include/asm/smp.h4
-rw-r--r--arch/powerpc/include/asm/vio.h2
-rw-r--r--arch/powerpc/include/uapi/asm/kvm_para.h2
-rw-r--r--arch/powerpc/kernel/io-workarounds.c9
-rw-r--r--arch/powerpc/kernel/isa-bridge.c12
-rw-r--r--arch/powerpc/kernel/of_platform.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c28
-rw-r--r--arch/powerpc/kernel/pci_32.c2
-rw-r--r--arch/powerpc/kernel/pci_64.c6
-rw-r--r--arch/powerpc/kernel/pci_dn.c4
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c12
-rw-r--r--arch/powerpc/kernel/rtas_pci.c4
-rw-r--r--arch/powerpc/kernel/smp-tbsync.c8
-rw-r--r--arch/powerpc/kernel/smp.c8
-rw-r--r--arch/powerpc/kernel/time.c5
-rw-r--r--arch/powerpc/kernel/vio.c4
-rw-r--r--arch/powerpc/kvm/book3s_hv_ras.c4
-rw-r--r--arch/powerpc/mm/tlb_hash64.c4
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c3
-rw-r--r--arch/powerpc/platforms/44x/currituck.c2
-rw-r--r--arch/powerpc/platforms/44x/virtex_ml510.c2
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpt.c6
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c8
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c2
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c9
-rw-r--r--arch/powerpc/platforms/85xx/corenet_ds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c2
-rw-r--r--arch/powerpc/platforms/85xx/tqm85xx.c2
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c2
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c2
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c2
-rw-r--r--arch/powerpc/platforms/cell/setup.c2
-rw-r--r--arch/powerpc/platforms/cell/smp.c6
-rw-r--r--arch/powerpc/platforms/chrp/pci.c2
-rw-r--r--arch/powerpc/platforms/chrp/smp.c4
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c20
-rw-r--r--arch/powerpc/platforms/maple/pci.c4
-rw-r--r--arch/powerpc/platforms/pasemi/gpio_mdio.c2
-rw-r--r--arch/powerpc/platforms/pasemi/pasemi.h4
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c4
-rw-r--r--arch/powerpc/platforms/powermac/pci.c6
-rw-r--r--arch/powerpc/platforms/powermac/smp.c8
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c48
-rw-r--r--arch/powerpc/platforms/powernv/pci-p5ioc2.c4
-rw-r--r--arch/powerpc/platforms/powernv/pci.c11
-rw-r--r--arch/powerpc/platforms/powernv/smp.c2
-rw-r--r--arch/powerpc/platforms/ps3/repository.c2
-rw-r--r--arch/powerpc/platforms/pseries/eeh_dev.c4
-rw-r--r--arch/powerpc/platforms/pseries/eeh_pe.c2
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/smp.c6
-rw-r--r--arch/powerpc/platforms/wsp/scom_smp.c3
-rw-r--r--arch/powerpc/platforms/wsp/smp.c4
-rw-r--r--arch/powerpc/platforms/wsp/wsp.h2
-rw-r--r--arch/powerpc/platforms/wsp/wsp_pci.c2
-rw-r--r--arch/powerpc/sysdev/bestcomm/bestcomm.c7
-rw-r--r--arch/powerpc/sysdev/fsl_85xx_l2ctlr.c6
-rw-r--r--arch/powerpc/sysdev/fsl_ifc.c4
-rw-r--r--arch/powerpc/sysdev/fsl_lbc.c6
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c7
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c4
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c2
-rw-r--r--arch/powerpc/sysdev/mpic.c2
-rw-r--r--arch/powerpc/sysdev/mpic_msgr.c2
-rw-r--r--arch/powerpc/sysdev/mv64x60_pci.c2
-rw-r--r--arch/powerpc/sysdev/ppc4xx_msi.c2
-rw-r--r--arch/s390/include/asm/dma.h6
-rw-r--r--arch/s390/include/asm/io.h5
-rw-r--r--arch/s390/include/asm/irq.h78
-rw-r--r--arch/s390/include/uapi/asm/unistd.h3
-rw-r--r--arch/s390/kernel/compat_wrapper.S6
-rw-r--r--arch/s390/kernel/debug.c11
-rw-r--r--arch/s390/kernel/irq.c124
-rw-r--r--arch/s390/kernel/nmi.c2
-rw-r--r--arch/s390/kernel/perf_cpum_cf.c2
-rw-r--r--arch/s390/kernel/runtime_instr.c2
-rw-r--r--arch/s390/kernel/setup.c3
-rw-r--r--arch/s390/kernel/smp.c11
-rw-r--r--arch/s390/kernel/syscalls.S1
-rw-r--r--arch/s390/kernel/time.c4
-rw-r--r--arch/s390/kernel/topology.c2
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/s390/oprofile/hwsampler.c2
-rw-r--r--arch/s390/pci/pci.c35
-rw-r--r--arch/s390/pci/pci_dma.c2
-rw-r--r--arch/score/mm/cache.c2
-rw-r--r--arch/sh/drivers/pci/fixups-dreamcast.c2
-rw-r--r--arch/sh/drivers/pci/pci.c6
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c2
-rw-r--r--arch/sparc/include/asm/parport.h6
-rw-r--r--arch/sparc/include/asm/timer_64.h2
-rw-r--r--arch/sparc/include/uapi/asm/unistd.h3
-rw-r--r--arch/sparc/kernel/apc.c4
-rw-r--r--arch/sparc/kernel/auxio_64.c2
-rw-r--r--arch/sparc/kernel/central.c6
-rw-r--r--arch/sparc/kernel/chmc.c34
-rw-r--r--arch/sparc/kernel/ds.c5
-rw-r--r--arch/sparc/kernel/ldc.c2
-rw-r--r--arch/sparc/kernel/leon_pci.c2
-rw-r--r--arch/sparc/kernel/leon_pci_grpci2.c2
-rw-r--r--arch/sparc/kernel/pci.c37
-rw-r--r--arch/sparc/kernel/pci_fire.c6
-rw-r--r--arch/sparc/kernel/pci_psycho.c12
-rw-r--r--arch/sparc/kernel/pci_sabre.c9
-rw-r--r--arch/sparc/kernel/pci_schizo.c16
-rw-r--r--arch/sparc/kernel/pci_sun4v.c15
-rw-r--r--arch/sparc/kernel/pcic.c5
-rw-r--r--arch/sparc/kernel/pmc.c2
-rw-r--r--arch/sparc/kernel/power.c4
-rw-r--r--arch/sparc/kernel/smp_64.c4
-rw-r--r--arch/sparc/kernel/systbls_32.S2
-rw-r--r--arch/sparc/kernel/systbls_64.S4
-rw-r--r--arch/sparc/kernel/time_32.c2
-rw-r--r--arch/sparc/kernel/time_64.c10
-rw-r--r--arch/sparc/mm/init_64.c6
-rw-r--r--arch/tile/include/asm/pci.h2
-rw-r--r--arch/tile/kernel/pci.c23
-rw-r--r--arch/tile/kernel/pci_gx.c33
-rw-r--r--arch/unicore32/kernel/pci.c2
-rw-r--r--arch/x86/include/asm/parport.h4
-rw-r--r--arch/x86/include/asm/pci_x86.h7
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.c6
-rw-r--r--arch/x86/kernel/kvm.c12
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/quirks.c4
-rw-r--r--arch/x86/kvm/x86.c24
-rw-r--r--arch/x86/lib/delay.c2
-rw-r--r--arch/x86/pci/acpi.c11
-rw-r--r--arch/x86/pci/bus_numa.c4
-rw-r--r--arch/x86/pci/common.c26
-rw-r--r--arch/x86/pci/fixup.c30
-rw-r--r--arch/x86/pci/legacy.c4
-rw-r--r--arch/x86/pci/mmconfig-shared.c21
-rw-r--r--arch/x86/pci/mmconfig_32.c2
-rw-r--r--arch/x86/pci/mmconfig_64.c4
-rw-r--r--arch/x86/pci/mrst.c6
-rw-r--r--arch/x86/pci/numaq_32.c2
-rw-r--r--arch/x86/pci/pcbios.c4
-rw-r--r--arch/x86/platform/mrst/mrst.c2
-rw-r--r--arch/x86/platform/olpc/olpc-xo1-pm.c8
-rw-r--r--arch/x86/platform/olpc/olpc-xo1-sci.c18
-rw-r--r--arch/x86/platform/scx200/scx200_32.c6
-rw-r--r--drivers/acpi/acpi_memhotplug.c18
-rw-r--r--drivers/acpi/acpica/Makefile2
-rw-r--r--drivers/acpi/acpica/utclib.c749
-rw-r--r--drivers/acpi/apei/erst-dbg.c11
-rw-r--r--drivers/acpi/device_pm.c3
-rw-r--r--drivers/acpi/glue.c9
-rw-r--r--drivers/acpi/power.c11
-rw-r--r--drivers/acpi/scan.c2
-rw-r--r--drivers/amba/bus.c4
-rw-r--r--drivers/amba/tegra-ahb.c4
-rw-r--r--drivers/ata/ahci_platform.c2
-rw-r--r--drivers/ata/ata_piix.c17
-rw-r--r--drivers/ata/pata_arasan_cf.c6
-rw-r--r--drivers/ata/pata_at91.c6
-rw-r--r--drivers/ata/pata_bf54x.c6
-rw-r--r--drivers/ata/pata_cs5520.c2
-rw-r--r--drivers/ata/pata_ep93xx.c6
-rw-r--r--drivers/ata/pata_icside.c21
-rw-r--r--drivers/ata/pata_imx.c6
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c2
-rw-r--r--drivers/ata/pata_macio.c33
-rw-r--r--drivers/ata/pata_mpc52xx.c10
-rw-r--r--drivers/ata/pata_octeon_cf.c2
-rw-r--r--drivers/ata/pata_of_platform.c2
-rw-r--r--drivers/ata/pata_palmld.c6
-rw-r--r--drivers/ata/pata_pdc2027x.c3
-rw-r--r--drivers/ata/pata_platform.c11
-rw-r--r--drivers/ata/pata_pxa.c6
-rw-r--r--drivers/ata/pata_rb532_cf.c6
-rw-r--r--drivers/ata/pata_rdc.c3
-rw-r--r--drivers/ata/pata_sch.c3
-rw-r--r--drivers/ata/pata_sil680.c3
-rw-r--r--drivers/ata/sata_highbank.c2
-rw-r--r--drivers/ata/sata_mv.c8
-rw-r--r--drivers/ata/sata_vsc.c7
-rw-r--r--drivers/atm/ambassador.c53
-rw-r--r--drivers/atm/eni.c18
-rw-r--r--drivers/atm/firestream.c32
-rw-r--r--drivers/atm/fore200e.c70
-rw-r--r--drivers/atm/he.c36
-rw-r--r--drivers/atm/horizon.c12
-rw-r--r--drivers/atm/idt77252.c16
-rw-r--r--drivers/atm/iphase.c11
-rw-r--r--drivers/atm/lanai.c28
-rw-r--r--drivers/atm/nicstar.c18
-rw-r--r--drivers/atm/solos-pci.c2
-rw-r--r--drivers/atm/zatm.c31
-rw-r--r--drivers/auxdisplay/cfag12864bfb.c10
-rw-r--r--drivers/base/power/main.c9
-rw-r--r--drivers/base/power/qos.c10
-rw-r--r--drivers/bcma/Kconfig3
-rw-r--r--drivers/bcma/bcma_private.h6
-rw-r--r--drivers/bcma/driver_chipcommon_sflash.c2
-rw-r--r--drivers/bcma/driver_gmac_cmn.c2
-rw-r--r--drivers/bcma/driver_pci.c4
-rw-r--r--drivers/bcma/driver_pci_host.c13
-rw-r--r--drivers/bcma/host_pci.c8
-rw-r--r--drivers/bcma/main.c2
-rw-r--r--drivers/block/cciss.c90
-rw-r--r--drivers/block/cpqarray.c16
-rw-r--r--drivers/block/nvme.c17
-rw-r--r--drivers/block/ps3disk.c2
-rw-r--r--drivers/block/ps3vram.c4
-rw-r--r--drivers/block/sunvdc.c9
-rw-r--r--drivers/block/swim.c11
-rw-r--r--drivers/block/swim3.c3
-rw-r--r--drivers/block/umem.c3
-rw-r--r--drivers/block/virtio_blk.c13
-rw-r--r--drivers/block/xsysace.c19
-rw-r--r--drivers/bus/omap-ocp2scp.c6
-rw-r--r--drivers/bus/omap_l3_noc.c6
-rw-r--r--drivers/cdrom/gdrom.c18
-rw-r--r--drivers/char/agp/ali-agp.c3
-rw-r--r--drivers/char/agp/amd-k7-agp.c4
-rw-r--r--drivers/char/agp/amd64-agp.c15
-rw-r--r--drivers/char/agp/ati-agp.c3
-rw-r--r--drivers/char/agp/efficeon-agp.c4
-rw-r--r--drivers/char/agp/i460-agp.c6
-rw-r--r--drivers/char/agp/intel-agp.c6
-rw-r--r--drivers/char/agp/nvidia-agp.c4
-rw-r--r--drivers/char/agp/sgi-agp.c2
-rw-r--r--drivers/char/agp/sis-agp.c5
-rw-r--r--drivers/char/agp/sworks-agp.c4
-rw-r--r--drivers/char/agp/uninorth-agp.c4
-rw-r--r--drivers/char/agp/via-agp.c3
-rw-r--r--drivers/char/hw_random/atmel-rng.c2
-rw-r--r--drivers/char/hw_random/bcm63xx-rng.c4
-rw-r--r--drivers/char/hw_random/exynos-rng.c4
-rw-r--r--drivers/char/hw_random/n2-drv.c6
-rw-r--r--drivers/char/hw_random/octeon-rng.c2
-rw-r--r--drivers/char/hw_random/omap-rng.c2
-rw-r--r--drivers/char/hw_random/pasemi-rng.c2
-rw-r--r--drivers/char/hw_random/picoxcell-rng.c2
-rw-r--r--drivers/char/hw_random/ppc4xx-rng.c2
-rw-r--r--drivers/char/hw_random/timeriomem-rng.c4
-rw-r--r--drivers/char/hw_random/virtio-rng.c2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
-rw-r--r--drivers/char/virtio_console.c6
-rw-r--r--drivers/clk/clk-twl6040.c6
-rw-r--r--drivers/clk/mvebu/clk-gating-ctrl.c2
-rw-r--r--drivers/clk/ux500/abx500-clk.c2
-rw-r--r--drivers/clocksource/acpi_pm.c6
-rw-r--r--drivers/clocksource/em_sti.c8
-rw-r--r--drivers/clocksource/sh_cmt.c6
-rw-r--r--drivers/clocksource/sh_mtu2.c6
-rw-r--r--drivers/clocksource/sh_tmu.c6
-rw-r--r--drivers/connector/connector.c4
-rw-r--r--drivers/cpufreq/Kconfig5
-rw-r--r--drivers/cpufreq/Makefile5
-rw-r--r--drivers/cpufreq/cpufreq_stats.c11
-rw-r--r--drivers/cpufreq/longhaul.c10
-rw-r--r--drivers/cpuidle/coupled.c2
-rw-r--r--drivers/cpuidle/cpuidle.c2
-rw-r--r--drivers/cpuidle/driver.c8
-rw-r--r--drivers/cpuidle/governors/menu.c2
-rw-r--r--drivers/crypto/atmel-aes.c6
-rw-r--r--drivers/crypto/atmel-sha.c6
-rw-r--r--drivers/crypto/atmel-tdes.c6
-rw-r--r--drivers/crypto/bfin_crc.c6
-rw-r--r--drivers/crypto/caam/ctrl.c2
-rw-r--r--drivers/crypto/geode-aes.c8
-rw-r--r--drivers/crypto/hifn_795x.c6
-rw-r--r--drivers/crypto/mv_cesa.c2
-rw-r--r--drivers/crypto/n2_core.c46
-rw-r--r--drivers/crypto/nx/nx.c7
-rw-r--r--drivers/crypto/omap-sham.c4
-rw-r--r--drivers/crypto/picoxcell_crypto.c6
-rw-r--r--drivers/crypto/tegra-aes.c6
-rw-r--r--drivers/devfreq/exynos4_bus.c6
-rw-r--r--drivers/dma/dw_dmac.c2
-rw-r--r--drivers/dma/edma.c2
-rw-r--r--drivers/dma/intel_mid_dma.c2
-rw-r--r--drivers/dma/ioat/dca.c9
-rw-r--r--drivers/dma/ioat/dma.c12
-rw-r--r--drivers/dma/ioat/dma.h13
-rw-r--r--drivers/dma/ioat/dma_v2.c2
-rw-r--r--drivers/dma/ioat/dma_v2.h8
-rw-r--r--drivers/dma/ioat/dma_v3.c8
-rw-r--r--drivers/dma/ioat/pci.c9
-rw-r--r--drivers/dma/iop-adma.c2
-rw-r--r--drivers/dma/mmp_pdma.c2
-rw-r--r--drivers/dma/mmp_tdma.c2
-rw-r--r--drivers/dma/mpc512x_dma.c2
-rw-r--r--drivers/dma/mv_xor.c9
-rw-r--r--drivers/dma/pch_dma.c2
-rw-r--r--drivers/dma/pl330.c2
-rw-r--r--drivers/dma/ppc4xx/adma.c4
-rw-r--r--drivers/dma/sa11x0-dma.c2
-rw-r--r--drivers/dma/sh/shdma.c2
-rw-r--r--drivers/dma/sirf-dma.c2
-rw-r--r--drivers/dma/tegra20-apb-dma.c6
-rw-r--r--drivers/dma/timb_dma.c2
-rw-r--r--drivers/edac/Kconfig8
-rw-r--r--drivers/edac/amd64_edac.c8
-rw-r--r--drivers/edac/amd76x_edac.c8
-rw-r--r--drivers/edac/cell_edac.c8
-rw-r--r--drivers/edac/cpc925_edac.c2
-rw-r--r--drivers/edac/e752x_edac.c7
-rw-r--r--drivers/edac/e7xxx_edac.c7
-rw-r--r--drivers/edac/edac_mc_sysfs.c19
-rw-r--r--drivers/edac/highbank_l2_edac.c2
-rw-r--r--drivers/edac/highbank_mc_edac.c6
-rw-r--r--drivers/edac/i3000_edac.c7
-rw-r--r--drivers/edac/i3200_edac.c7
-rw-r--r--drivers/edac/i5000_edac.c7
-rw-r--r--drivers/edac/i5100_edac.c24
-rw-r--r--drivers/edac/i5400_edac.c7
-rw-r--r--drivers/edac/i7300_edac.c9
-rw-r--r--drivers/edac/i7core_edac.c7
-rw-r--r--drivers/edac/i82443bxgx_edac.c8
-rw-r--r--drivers/edac/i82860_edac.c8
-rw-r--r--drivers/edac/i82875p_edac.c8
-rw-r--r--drivers/edac/i82975x_edac.c8
-rw-r--r--drivers/edac/mpc85xx_edac.c8
-rw-r--r--drivers/edac/mv64x60_edac.c10
-rw-r--r--drivers/edac/octeon_edac-l2c.c2
-rw-r--r--drivers/edac/octeon_edac-lmc.c2
-rw-r--r--drivers/edac/octeon_edac-pc.c2
-rw-r--r--drivers/edac/octeon_edac-pci.c2
-rw-r--r--drivers/edac/pasemi_edac.c8
-rw-r--r--drivers/edac/ppc4xx_edac.c27
-rw-r--r--drivers/edac/r82600_edac.c8
-rw-r--r--drivers/edac/sb_edac.c7
-rw-r--r--drivers/edac/tile_edac.c8
-rw-r--r--drivers/edac/x38_edac.c7
-rw-r--r--drivers/firmware/dcdbas.c6
-rw-r--r--drivers/gpio/gpio-da9055.c8
-rw-r--r--drivers/gpio/gpio-ts5500.c6
-rw-r--r--drivers/gpio/gpio-viperboard.c6
-rw-r--r--drivers/gpu/drm/ast/ast_drv.c3
-rw-r--r--drivers/gpu/drm/cirrus/cirrus_drv.c4
-rw-r--r--drivers/gpu/drm/drm_mm.c45
-rw-r--r--drivers/gpu/drm/exynos/exynos_ddc.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_buf.c79
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_buf.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_connector.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_connector.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_core.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.c52
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.h23
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dmabuf.c29
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dmabuf.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c24
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_encoder.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_encoder.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fb.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fb.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.c44
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimc.c130
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimc.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c38
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gsc.c62
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gsc.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_iommu.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_iommu.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c28
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.h26
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_rotator.c34
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_rotator.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c36
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c8
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.h22
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmiphy.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c45
-rw-r--r--drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c4
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c25
-rw-r--r--drivers/gpu/drm/i915/i915_gem_dmabuf.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c33
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c8
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c25
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c10
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_drv.c3
-rw-r--r--drivers/gpu/drm/nouveau/core/core/client.c4
-rw-r--r--drivers/gpu/drm/nouveau/core/core/handle.c5
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv50.c46
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/client.h3
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/bios/pll.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bios/init.c1
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/instmem/base.c35
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/vm/base.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c30
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c9
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c11
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fence.h1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_pm.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_prime.c1
-rw-r--r--drivers/gpu/drm/nouveau/nv04_dfp.c2
-rw-r--r--drivers/gpu/drm/nouveau/nv10_fence.c8
-rw-r--r--drivers/gpu/drm/nouveau/nv50_fence.c1
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c86
-rw-r--r--drivers/gpu/drm/radeon/evergreend.h14
-rw-r--r--drivers/gpu/drm/radeon/ni.c106
-rw-r--r--drivers/gpu/drm/radeon/nid.h3
-rw-r--r--drivers/gpu/drm/radeon/r600.c99
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c43
-rw-r--r--drivers/gpu/drm/radeon/radeon.h5
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h4
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c51
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c28
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c13
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_i2c.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_encoders.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h5
-rw-r--r--drivers/gpu/drm/radeon/radeon_prime.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c24
-rw-r--r--drivers/gpu/drm/radeon/rv770.c74
-rw-r--r--drivers/gpu/drm/radeon/si.c78
-rw-r--r--drivers/gpu/drm/radeon/sid.h18
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_drv.c10
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c4
-rw-r--r--drivers/gpu/drm/udl/udl_connector.c17
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c12
-rw-r--r--drivers/hsi/clients/hsi_char.c8
-rw-r--r--drivers/hwmon/vexpress.c5
-rw-r--r--drivers/ide/aec62xx.c8
-rw-r--r--drivers/ide/alim15x3.c10
-rw-r--r--drivers/ide/amd74xx.c4
-rw-r--r--drivers/ide/atiixp.c4
-rw-r--r--drivers/ide/cmd64x.c4
-rw-r--r--drivers/ide/cs5520.c4
-rw-r--r--drivers/ide/cs5530.c6
-rw-r--r--drivers/ide/cs5535.c5
-rw-r--r--drivers/ide/cy82c693.c11
-rw-r--r--drivers/ide/delkin_cb.c5
-rw-r--r--drivers/ide/hpt366.c42
-rw-r--r--drivers/ide/icside.c15
-rw-r--r--drivers/ide/ide-pci-generic.c4
-rw-r--r--drivers/ide/ide_platform.c14
-rw-r--r--drivers/ide/it8172.c5
-rw-r--r--drivers/ide/it8213.c4
-rw-r--r--drivers/ide/it821x.c10
-rw-r--r--drivers/ide/jmicron.c4
-rw-r--r--drivers/ide/ns87415.c8
-rw-r--r--drivers/ide/opti621.c4
-rw-r--r--drivers/ide/palm_bk3710.c7
-rw-r--r--drivers/ide/pdc202xx_new.c10
-rw-r--r--drivers/ide/pdc202xx_old.c8
-rw-r--r--drivers/ide/piix.c8
-rw-r--r--drivers/ide/pmac.c16
-rw-r--r--drivers/ide/rapide.c7
-rw-r--r--drivers/ide/rz1000.c6
-rw-r--r--drivers/ide/sc1200.c4
-rw-r--r--drivers/ide/scc_pata.c20
-rw-r--r--drivers/ide/serverworks.c4
-rw-r--r--drivers/ide/sgiioc4.c13
-rw-r--r--drivers/ide/siimage.c13
-rw-r--r--drivers/ide/sis5513.c10
-rw-r--r--drivers/ide/sl82c105.c4
-rw-r--r--drivers/ide/slc90e66.c5
-rw-r--r--drivers/ide/tc86c001.c12
-rw-r--r--drivers/ide/triflex.c5
-rw-r--r--drivers/ide/trm290.c6
-rw-r--r--drivers/ide/via82cxxx.c8
-rw-r--r--drivers/idle/intel_idle.c2
-rw-r--r--drivers/iio/accel/Kconfig1
-rw-r--r--drivers/iio/accel/hid-sensor-accel-3d.c4
-rw-r--r--drivers/iio/adc/ad7266.c14
-rw-r--r--drivers/iio/adc/ad7298.c6
-rw-r--r--drivers/iio/adc/ad7476.c6
-rw-r--r--drivers/iio/adc/ad7791.c10
-rw-r--r--drivers/iio/adc/ad7887.c6
-rw-r--r--drivers/iio/adc/at91_adc.c8
-rw-r--r--drivers/iio/adc/lp8788_adc.c6
-rw-r--r--drivers/iio/adc/max1363.c23
-rw-r--r--drivers/iio/adc/ti_am335x_adc.c6
-rw-r--r--drivers/iio/adc/viperboard_adc.c6
-rw-r--r--drivers/iio/amplifiers/ad8366.c6
-rw-r--r--drivers/iio/common/hid-sensors/Kconfig13
-rw-r--r--drivers/iio/common/hid-sensors/Makefile3
-rw-r--r--drivers/iio/dac/ad5064.c18
-rw-r--r--drivers/iio/dac/ad5360.c8
-rw-r--r--drivers/iio/dac/ad5380.c28
-rw-r--r--drivers/iio/dac/ad5421.c6
-rw-r--r--drivers/iio/dac/ad5446.c24
-rw-r--r--drivers/iio/dac/ad5449.c6
-rw-r--r--drivers/iio/dac/ad5504.c12
-rw-r--r--drivers/iio/dac/ad5624r_spi.c12
-rw-r--r--drivers/iio/dac/ad5686.c12
-rw-r--r--drivers/iio/dac/ad5755.c16
-rw-r--r--drivers/iio/dac/ad5764.c6
-rw-r--r--drivers/iio/dac/ad5791.c19
-rw-r--r--drivers/iio/dac/max517.c6
-rw-r--r--drivers/iio/dac/mcp4725.c8
-rw-r--r--drivers/iio/frequency/ad9523.c6
-rw-r--r--drivers/iio/frequency/adf4350.c8
-rw-r--r--drivers/iio/gyro/Kconfig1
-rw-r--r--drivers/iio/gyro/hid-sensor-gyro-3d.c4
-rw-r--r--drivers/iio/light/Kconfig1
-rw-r--r--drivers/iio/light/adjd_s311.c8
-rw-r--r--drivers/iio/light/hid-sensor-als.c4
-rw-r--r--drivers/iio/light/lm3533-als.c19
-rw-r--r--drivers/iio/light/vcnl4000.c8
-rw-r--r--drivers/iio/magnetometer/Kconfig1
-rw-r--r--drivers/iio/magnetometer/hid-sensor-magn-3d.c4
-rw-r--r--drivers/infiniband/hw/amso1100/c2.c7
-rw-r--r--drivers/infiniband/hw/amso1100/c2.h8
-rw-r--r--drivers/infiniband/hw/amso1100/c2_pd.c4
-rw-r--r--drivers/infiniband/hw/amso1100/c2_qp.c4
-rw-r--r--drivers/infiniband/hw/amso1100/c2_rnic.c4
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c6
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c12
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c9
-rw-r--r--drivers/infiniband/hw/nes/nes.c6
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c12
-rw-r--r--drivers/input/keyboard/gpio_keys.c13
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c13
-rw-r--r--drivers/input/keyboard/tca8418_keypad.c2
-rw-r--r--drivers/input/mouse/sentelic.c2
-rw-r--r--drivers/iommu/intel-iommu.c4
-rw-r--r--drivers/iommu/omap-iommu.c6
-rw-r--r--drivers/iommu/tegra-gart.c4
-rw-r--r--drivers/iommu/tegra-smmu.c4
-rw-r--r--drivers/isdn/hardware/avm/b1pci.c8
-rw-r--r--drivers/isdn/hardware/avm/c4.c3
-rw-r--r--drivers/isdn/hardware/avm/t1pci.c3
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c9
-rw-r--r--drivers/isdn/hardware/mISDN/avmfritz.c10
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c6
-rw-r--r--drivers/isdn/hardware/mISDN/hfcpci.c6
-rw-r--r--drivers/isdn/hardware/mISDN/mISDNinfineon.c16
-rw-r--r--drivers/isdn/hardware/mISDN/netjet.c10
-rw-r--r--drivers/isdn/hardware/mISDN/speedfax.c14
-rw-r--r--drivers/isdn/hardware/mISDN/w6692.c6
-rw-r--r--drivers/isdn/hisax/amd7930_fn.c3
-rw-r--r--drivers/isdn/hisax/asuscom.c9
-rw-r--r--drivers/isdn/hisax/avm_a1.c3
-rw-r--r--drivers/isdn/hisax/avm_a1p.c2
-rw-r--r--drivers/isdn/hisax/avm_pci.c17
-rw-r--r--drivers/isdn/hisax/avma1_cs.c12
-rw-r--r--drivers/isdn/hisax/bkm_a4t.c16
-rw-r--r--drivers/isdn/hisax/bkm_a8.c18
-rw-r--r--drivers/isdn/hisax/config.c26
-rw-r--r--drivers/isdn/hisax/diva.c31
-rw-r--r--drivers/isdn/hisax/elsa.c31
-rw-r--r--drivers/isdn/hisax/elsa_cs.c12
-rw-r--r--drivers/isdn/hisax/enternow_pci.c14
-rw-r--r--drivers/isdn/hisax/gazel.c11
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c16
-rw-r--r--drivers/isdn/hisax/hfc_pci.c4
-rw-r--r--drivers/isdn/hisax/hfc_sx.c9
-rw-r--r--drivers/isdn/hisax/hfcscard.c9
-rw-r--r--drivers/isdn/hisax/hisax_fcpcipnp.c22
-rw-r--r--drivers/isdn/hisax/icc.c3
-rw-r--r--drivers/isdn/hisax/isac.c7
-rw-r--r--drivers/isdn/hisax/isurf.c5
-rw-r--r--drivers/isdn/hisax/ix1_micro.c9
-rw-r--r--drivers/isdn/hisax/mic.c3
-rw-r--r--drivers/isdn/hisax/niccy.c6
-rw-r--r--drivers/isdn/hisax/nj_s.c14
-rw-r--r--drivers/isdn/hisax/nj_u.c14
-rw-r--r--drivers/isdn/hisax/s0box.c3
-rw-r--r--drivers/isdn/hisax/saphir.c3
-rw-r--r--drivers/isdn/hisax/sedlbauer.c23
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c12
-rw-r--r--drivers/isdn/hisax/sportster.c6
-rw-r--r--drivers/isdn/hisax/teleint.c3
-rw-r--r--drivers/isdn/hisax/teles0.c3
-rw-r--r--drivers/isdn/hisax/teles3.c9
-rw-r--r--drivers/isdn/hisax/teles_cs.c12
-rw-r--r--drivers/isdn/hisax/telespci.c5
-rw-r--r--drivers/isdn/hisax/w6692.c5
-rw-r--r--drivers/isdn/hysdn/hysdn_init.c8
-rw-r--r--drivers/isdn/mISDN/core.c4
-rw-r--r--drivers/macintosh/macio_asic.c6
-rw-r--r--drivers/macintosh/mediabay.c3
-rw-r--r--drivers/macintosh/rack-meter.c12
-rw-r--r--drivers/macintosh/windfarm_ad7417_sensor.c18
-rw-r--r--drivers/macintosh/windfarm_fcu_controls.c21
-rw-r--r--drivers/macintosh/windfarm_pm112.c4
-rw-r--r--drivers/macintosh/windfarm_pm121.c4
-rw-r--r--drivers/macintosh/windfarm_pm72.c2
-rw-r--r--drivers/macintosh/windfarm_pm81.c4
-rw-r--r--drivers/macintosh/windfarm_pm91.c4
-rw-r--r--drivers/macintosh/windfarm_rm31.c2
-rw-r--r--drivers/media/i2c/adv7180.c8
-rw-r--r--drivers/media/i2c/adv7183.c2
-rw-r--r--drivers/media/i2c/as3645a.c10
-rw-r--r--drivers/media/i2c/m5mols/m5mols_core.c8
-rw-r--r--drivers/media/i2c/vs6624.c6
-rw-r--r--drivers/media/mmc/siano/smssdio.c4
-rw-r--r--drivers/media/pci/bt8xx/bt878.c11
-rw-r--r--drivers/media/pci/bt8xx/bttv-cards.c34
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c9
-rw-r--r--drivers/media/pci/bt8xx/bttv-i2c.c6
-rw-r--r--drivers/media/pci/bt8xx/bttv-input.c4
-rw-r--r--drivers/media/pci/bt8xx/dvb-bt8xx.c7
-rw-r--r--drivers/media/pci/cx18/cx18-driver.c14
-rw-r--r--drivers/media/pci/cx23885/cx23885-core.c8
-rw-r--r--drivers/media/pci/cx25821/cx25821-core.c8
-rw-r--r--drivers/media/pci/cx88/cx88-alsa.c19
-rw-r--r--drivers/media/pci/cx88/cx88-mpeg.c8
-rw-r--r--drivers/media/pci/cx88/cx88-video.c8
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c9
-rw-r--r--drivers/media/pci/dm1105/dm1105.c20
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.c9
-rw-r--r--drivers/media/pci/mantis/hopper_cards.c9
-rw-r--r--drivers/media/pci/mantis/mantis_cards.c9
-rw-r--r--drivers/media/pci/mantis/mantis_dvb.c4
-rw-r--r--drivers/media/pci/mantis/mantis_i2c.c2
-rw-r--r--drivers/media/pci/mantis/mantis_pci.c2
-rw-r--r--drivers/media/pci/meye/meye.c7
-rw-r--r--drivers/media/pci/ngene/ngene-cards.c4
-rw-r--r--drivers/media/pci/ngene/ngene-core.c5
-rw-r--r--drivers/media/pci/ngene/ngene.h5
-rw-r--r--drivers/media/pci/pluto2/pluto2.c25
-rw-r--r--drivers/media/pci/pt1/pt1.c7
-rw-r--r--drivers/media/pci/saa7134/saa7134-core.c10
-rw-r--r--drivers/media/pci/saa7134/saa7134.h2
-rw-r--r--drivers/media/pci/saa7164/saa7164-core.c8
-rw-r--r--drivers/media/pci/sta2x11/sta2x11_vip.c8
-rw-r--r--drivers/media/pci/ttpci/av7110.c8
-rw-r--r--drivers/media/pci/ttpci/av7110_ir.c4
-rw-r--r--drivers/media/pci/zoran/zoran_card.c20
-rw-r--r--drivers/media/pci/zoran/zoran_driver.c2
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c6
-rw-r--r--drivers/media/platform/coda.c4
-rw-r--r--drivers/media/platform/davinci/dm355_ccdc.c4
-rw-r--r--drivers/media/platform/davinci/dm644x_ccdc.c4
-rw-r--r--drivers/media/platform/davinci/isif.c4
-rw-r--r--drivers/media/platform/davinci/vpbe.c2
-rw-r--r--drivers/media/platform/davinci/vpbe_display.c15
-rw-r--r--drivers/media/platform/davinci/vpfe_capture.c6
-rw-r--r--drivers/media/platform/davinci/vpif.c6
-rw-r--r--drivers/media/platform/davinci/vpss.c6
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-core.c4
-rw-r--r--drivers/media/platform/fsl-viu.c6
-rw-r--r--drivers/media/platform/omap24xxcam.c2
-rw-r--r--drivers/media/platform/omap3isp/isp.c6
-rw-r--r--drivers/media/platform/s3c-camif/camif-core.c4
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-core.c4
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-lite.c6
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-mdevice.c4
-rw-r--r--drivers/media/platform/s5p-fimc/mipi-csis.c6
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c4
-rw-r--r--drivers/media/platform/s5p-tv/hdmi_drv.c6
-rw-r--r--drivers/media/platform/s5p-tv/hdmiphy_drv.c8
-rw-r--r--drivers/media/platform/s5p-tv/mixer.h2
-rw-r--r--drivers/media/platform/s5p-tv/mixer_drv.c18
-rw-r--r--drivers/media/platform/s5p-tv/mixer_video.c4
-rw-r--r--drivers/media/platform/s5p-tv/sdo_drv.c6
-rw-r--r--drivers/media/platform/s5p-tv/sii9234_drv.c8
-rw-r--r--drivers/media/platform/sh_vou.c6
-rw-r--r--drivers/media/platform/soc_camera/atmel-isi.c6
-rw-r--r--drivers/media/platform/soc_camera/mx2_camera.c8
-rw-r--r--drivers/media/platform/soc_camera/mx3_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/pxa_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_csi2.c6
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c6
-rw-r--r--drivers/media/platform/timblogiw.c12
-rw-r--r--drivers/media/platform/via-camera.c6
-rw-r--r--drivers/media/radio/radio-maxiradio.c7
-rw-r--r--drivers/media/radio/radio-sf16fmi.c2
-rw-r--r--drivers/media/radio/radio-sf16fmr2.c19
-rw-r--r--drivers/media/radio/radio-tea5764.c8
-rw-r--r--drivers/media/radio/radio-timb.c6
-rw-r--r--drivers/media/radio/radio-wl1273.c4
-rw-r--r--drivers/media/radio/saa7706h.c8
-rw-r--r--drivers/media/radio/si470x/radio-si470x-i2c.c8
-rw-r--r--drivers/media/radio/tef6862.c8
-rw-r--r--drivers/media/rc/ene_ir.c2
-rw-r--r--drivers/media/rc/fintek-cir.c4
-rw-r--r--drivers/media/rc/gpio-ir-recv.c6
-rw-r--r--drivers/media/rc/iguanair.c8
-rw-r--r--drivers/media/rc/imon.c8
-rw-r--r--drivers/media/rc/ir-rx51.c2
-rw-r--r--drivers/media/rc/ite-cir.c4
-rw-r--r--drivers/media/rc/mceusb.c8
-rw-r--r--drivers/media/rc/nuvoton-cir.c4
-rw-r--r--drivers/media/rc/redrat3.c8
-rw-r--r--drivers/media/rc/streamzap.c4
-rw-r--r--drivers/media/rc/ttusbir.c8
-rw-r--r--drivers/media/rc/winbond-cir.c6
-rw-r--r--drivers/media/usb/gspca/spca506.c3
-rw-r--r--drivers/media/usb/siano/smsusb.c2
-rw-r--r--drivers/media/usb/usbvision/usbvision-video.c10
-rw-r--r--drivers/memory/tegra20-mc.c4
-rw-r--r--drivers/memory/tegra30-mc.c4
-rw-r--r--drivers/message/fusion/mptfc.c7
-rw-r--r--drivers/message/fusion/mptsas.c4
-rw-r--r--drivers/message/fusion/mptspi.c2
-rw-r--r--drivers/message/i2o/pci.c11
-rw-r--r--drivers/mfd/max8997.c2
-rw-r--r--drivers/mfd/retu-mfd.c5
-rw-r--r--drivers/mfd/rtsx_pcr.c8
-rw-r--r--drivers/mfd/sta2x11-mfd.c8
-rw-r--r--drivers/mfd/stmpe.c15
-rw-r--r--drivers/mfd/ti_am335x_tscadc.c6
-rw-r--r--drivers/mfd/tps80031.c11
-rw-r--r--drivers/mfd/twl6040.c8
-rw-r--r--drivers/mfd/vexpress-sysreg.c2
-rw-r--r--drivers/misc/mei/amthif.c6
-rw-r--r--drivers/mmc/host/dw_mmc-pci.c2
-rw-r--r--drivers/mmc/host/dw_mmc-pltfm.c2
-rw-r--r--drivers/mmc/host/sdhci-acpi.c6
-rw-r--r--drivers/mmc/host/wmt-sdmmc.c4
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c10
-rw-r--r--drivers/mtd/devices/spear_smi.c4
-rw-r--r--drivers/mtd/maps/esb2rom.c2
-rw-r--r--drivers/mtd/maps/intel_vr_nor.c3
-rw-r--r--drivers/mtd/maps/pci.c6
-rw-r--r--drivers/mtd/maps/physmap_of.c2
-rw-r--r--drivers/mtd/maps/pismo.c15
-rw-r--r--drivers/mtd/maps/scb2_flash.c10
-rw-r--r--drivers/mtd/nand/atmel_nand.c6
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/main.c4
-rw-r--r--drivers/mtd/nand/fsl_upm.c4
-rw-r--r--drivers/mtd/nand/fsmc_nand.c4
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c7
-rw-r--r--drivers/mtd/nand/jz4740_nand.c3
-rw-r--r--drivers/net/ethernet/adi/Kconfig1
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c30
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c60
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h1
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c29
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c35
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c2
-rw-r--r--drivers/net/ethernet/xilinx/Kconfig2
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet_main.c2
-rw-r--r--drivers/net/tun.c44
-rw-r--r--drivers/net/usb/qmi_wwan.c1
-rw-r--r--drivers/net/vxlan.c1
-rw-r--r--drivers/net/wireless/ath/Kconfig1
-rw-r--r--drivers/net/wireless/ath/Makefile1
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig5
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_hw.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/fw.c6
-rw-r--r--drivers/net/wireless/ath/wil6210/Kconfig29
-rw-r--r--drivers/net/wireless/ath/wil6210/Makefile13
-rw-r--r--drivers/net/wireless/ath/wil6210/cfg80211.c573
-rw-r--r--drivers/net/wireless/ath/wil6210/dbg_hexdump.h30
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c603
-rw-r--r--drivers/net/wireless/ath/wil6210/interrupt.c471
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c407
-rw-r--r--drivers/net/wireless/ath/wil6210/netdev.c157
-rw-r--r--drivers/net/wireless/ath/wil6210/pcie_bus.c223
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.c871
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.h362
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h363
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c975
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.h1116
-rw-r--r--drivers/net/wireless/b43/b43.h5
-rw-r--r--drivers/net/wireless/b43/main.c54
-rw-r--r--drivers/net/wireless/b43/main.h5
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c5
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/debug.h1
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c4
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c24
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c1
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c2
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c21
-rw-r--r--drivers/net/wireless/mwl8k.c4
-rw-r--r--drivers/net/wireless/p54/p54usb.c4
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c11
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.c10
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c13
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8723ae/phy.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8723ae/trx.c10
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c8
-rw-r--r--drivers/net/xen-netfront.c27
-rw-r--r--drivers/nfc/pn544/i2c.c8
-rw-r--r--drivers/parisc/dino.c2
-rw-r--r--drivers/parisc/lba_pci.c2
-rw-r--r--drivers/parport/parport_gsc.c23
-rw-r--r--drivers/parport/parport_pc.c55
-rw-r--r--drivers/parport/parport_serial.c21
-rw-r--r--drivers/parport/parport_sunbpp.c6
-rw-r--r--drivers/pci/iov.c2
-rw-r--r--drivers/pinctrl/core.c2
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-370.c8
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-xp.c8
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-dove.c15
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-kirkwood.c8
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-mvebu.c11
-rw-r--r--drivers/pinctrl/pinctrl-at91.c39
-rw-r--r--drivers/pinctrl/pinctrl-bcm2835.c2
-rw-r--r--drivers/pinctrl/pinctrl-exynos5440.c2
-rw-r--r--drivers/pinctrl/pinctrl-imx.c19
-rw-r--r--drivers/pinctrl/pinctrl-imx23.c2
-rw-r--r--drivers/pinctrl/pinctrl-imx28.c2
-rw-r--r--drivers/pinctrl/pinctrl-imx35.c2
-rw-r--r--drivers/pinctrl/pinctrl-imx51.c2
-rw-r--r--drivers/pinctrl/pinctrl-imx53.c4
-rw-r--r--drivers/pinctrl/pinctrl-imx6q.c2
-rw-r--r--drivers/pinctrl/pinctrl-mmp2.c2
-rw-r--r--drivers/pinctrl/pinctrl-mxs.c14
-rw-r--r--drivers/pinctrl/pinctrl-nomadik-db8500.c3
-rw-r--r--drivers/pinctrl/pinctrl-nomadik-db8540.c3
-rw-r--r--drivers/pinctrl/pinctrl-nomadik-stn8815.c3
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.c15
-rw-r--r--drivers/pinctrl/pinctrl-pxa168.c2
-rw-r--r--drivers/pinctrl/pinctrl-pxa910.c2
-rw-r--r--drivers/pinctrl/pinctrl-samsung.c26
-rw-r--r--drivers/pinctrl/pinctrl-single.c9
-rw-r--r--drivers/pinctrl/pinctrl-sirf.c52
-rw-r--r--drivers/pinctrl/pinctrl-tegra.c2
-rw-r--r--drivers/pinctrl/pinctrl-tegra20.c2
-rw-r--r--drivers/pinctrl/pinctrl-tegra30.c2
-rw-r--r--drivers/pinctrl/pinctrl-u300.c2
-rw-r--r--drivers/pinctrl/pinctrl-xway.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-plgpio.c5
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.c11
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.h11
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1310.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1340.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear300.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear310.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear320.c2
-rw-r--r--drivers/platform/x86/acer-wmi.c68
-rw-r--r--drivers/platform/x86/acerhdf.c2
-rw-r--r--drivers/platform/x86/amilo-rfkill.c4
-rw-r--r--drivers/platform/x86/apple-gmux.c7
-rw-r--r--drivers/platform/x86/asus-laptop.c25
-rw-r--r--drivers/platform/x86/compal-laptop.c10
-rw-r--r--drivers/platform/x86/dell-laptop.c4
-rw-r--r--drivers/platform/x86/eeepc-laptop.c6
-rw-r--r--drivers/platform/x86/fujitsu-tablet.c17
-rw-r--r--drivers/platform/x86/hp-wmi.c8
-rw-r--r--drivers/platform/x86/ideapad-laptop.c13
-rw-r--r--drivers/platform/x86/intel_mid_powerbtn.c6
-rw-r--r--drivers/platform/x86/intel_mid_thermal.c2
-rw-r--r--drivers/platform/x86/intel_oaktrail.c6
-rw-r--r--drivers/platform/x86/intel_pmic_gpio.c2
-rw-r--r--drivers/platform/x86/samsung-laptop.c10
-rw-r--r--drivers/platform/x86/samsung-q10.c6
-rw-r--r--drivers/platform/x86/sony-laptop.c15
-rw-r--r--drivers/platform/x86/tc1100-wmi.c4
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c4
-rw-r--r--drivers/platform/x86/toshiba_acpi.c13
-rw-r--r--drivers/platform/x86/xo1-rfkill.c6
-rw-r--r--drivers/pnp/interface.c105
-rw-r--r--drivers/pnp/manager.c25
-rw-r--r--drivers/power/ab8500_bmdata.c6
-rw-r--r--drivers/power/olpc_battery.c2
-rw-r--r--drivers/power/reset/gpio-poweroff.c39
-rw-r--r--drivers/power/rx51_battery.c6
-rw-r--r--drivers/pps/clients/pps-gpio.c2
-rw-r--r--drivers/ps3/ps3-lpm.c2
-rw-r--r--drivers/ps3/ps3-sys-manager.c2
-rw-r--r--drivers/ps3/ps3av.c2
-rw-r--r--drivers/regulator/anatop-regulator.c2
-rw-r--r--drivers/regulator/core.c15
-rw-r--r--drivers/regulator/da9055-regulator.c12
-rw-r--r--drivers/regulator/fixed.c2
-rw-r--r--drivers/regulator/gpio-regulator.c2
-rw-r--r--drivers/regulator/max8973-regulator.c12
-rw-r--r--drivers/regulator/max8997.c36
-rw-r--r--drivers/regulator/max8998.c44
-rw-r--r--drivers/regulator/palmas-regulator.c2
-rw-r--r--drivers/regulator/s5m8767.c4
-rw-r--r--drivers/regulator/twl-regulator.c2
-rw-r--r--drivers/remoteproc/omap_remoteproc.c6
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c4
-rw-r--r--drivers/rtc/Kconfig8
-rw-r--r--drivers/rtc/Makefile1
-rw-r--r--drivers/rtc/rtc-88pm80x.c6
-rw-r--r--drivers/rtc/rtc-88pm860x.c10
-rw-r--r--drivers/rtc/rtc-ab8500.c6
-rw-r--r--drivers/rtc/rtc-at91sam9.c6
-rw-r--r--drivers/rtc/rtc-au1xxx.c6
-rw-r--r--drivers/rtc/rtc-bfin.c6
-rw-r--r--drivers/rtc/rtc-bq32k.c4
-rw-r--r--drivers/rtc/rtc-bq4802.c6
-rw-r--r--drivers/rtc/rtc-cmos.c9
-rw-r--r--drivers/rtc/rtc-da9052.c6
-rw-r--r--drivers/rtc/rtc-da9055.c2
-rw-r--r--drivers/rtc/rtc-davinci.c4
-rw-r--r--drivers/rtc/rtc-dm355evm.c6
-rw-r--r--drivers/rtc/rtc-ds1286.c6
-rw-r--r--drivers/rtc/rtc-ds1302.c4
-rw-r--r--drivers/rtc/rtc-ds1305.c6
-rw-r--r--drivers/rtc/rtc-ds1307.c8
-rw-r--r--drivers/rtc/rtc-ds1374.c4
-rw-r--r--drivers/rtc/rtc-ds1390.c6
-rw-r--r--drivers/rtc/rtc-ds1511.c8
-rw-r--r--drivers/rtc/rtc-ds1553.c6
-rw-r--r--drivers/rtc/rtc-ds1742.c6
-rw-r--r--drivers/rtc/rtc-ds3232.c8
-rw-r--r--drivers/rtc/rtc-ds3234.c6
-rw-r--r--drivers/rtc/rtc-ep93xx.c6
-rw-r--r--drivers/rtc/rtc-fm3130.c8
-rw-r--r--drivers/rtc/rtc-imxdi.c4
-rw-r--r--drivers/rtc/rtc-jz4740.c6
-rw-r--r--drivers/rtc/rtc-lpc32xx.c6
-rw-r--r--drivers/rtc/rtc-ls1x.c6
-rw-r--r--drivers/rtc/rtc-m41t93.c6
-rw-r--r--drivers/rtc/rtc-m41t94.c6
-rw-r--r--drivers/rtc/rtc-m48t35.c6
-rw-r--r--drivers/rtc/rtc-m48t59.c6
-rw-r--r--drivers/rtc/rtc-m48t86.c6
-rw-r--r--drivers/rtc/rtc-max6902.c6
-rw-r--r--drivers/rtc/rtc-max8907.c6
-rw-r--r--drivers/rtc/rtc-max8925.c6
-rw-r--r--drivers/rtc/rtc-max8998.c6
-rw-r--r--drivers/rtc/rtc-mpc5121.c8
-rw-r--r--drivers/rtc/rtc-mrst.c12
-rw-r--r--drivers/rtc/rtc-mv.c2
-rw-r--r--drivers/rtc/rtc-mxc.c6
-rw-r--r--drivers/rtc/rtc-nuc900.c6
-rw-r--r--drivers/rtc/rtc-pcap.c6
-rw-r--r--drivers/rtc/rtc-pcf2123.c6
-rw-r--r--drivers/rtc/rtc-pcf50633.c6
-rw-r--r--drivers/rtc/rtc-pcf8563.c2
-rw-r--r--drivers/rtc/rtc-pcf8583.c4
-rw-r--r--drivers/rtc/rtc-pm8xxx.c6
-rw-r--r--drivers/rtc/rtc-puv3.c6
-rw-r--r--drivers/rtc/rtc-r9701.c6
-rw-r--r--drivers/rtc/rtc-rc5t583.c6
-rw-r--r--drivers/rtc/rtc-rs5c313.c4
-rw-r--r--drivers/rtc/rtc-rs5c348.c6
-rw-r--r--drivers/rtc/rtc-rv3029c2.c8
-rw-r--r--drivers/rtc/rtc-rx8025.c8
-rw-r--r--drivers/rtc/rtc-rx8581.c8
-rw-r--r--drivers/rtc/rtc-s3c.c6
-rw-r--r--drivers/rtc/rtc-snvs.c8
-rw-r--r--drivers/rtc/rtc-spear.c6
-rw-r--r--drivers/rtc/rtc-stk17ta8.c6
-rw-r--r--drivers/rtc/rtc-tegra.c13
-rw-r--r--drivers/rtc/rtc-test.c4
-rw-r--r--drivers/rtc/rtc-tile.c6
-rw-r--r--drivers/rtc/rtc-tps6586x.c356
-rw-r--r--drivers/rtc/rtc-tps65910.c6
-rw-r--r--drivers/rtc/rtc-twl.c6
-rw-r--r--drivers/rtc/rtc-vr41xx.c6
-rw-r--r--drivers/rtc/rtc-vt8500.c17
-rw-r--r--drivers/rtc/rtc-wm831x.c4
-rw-r--r--drivers/rtc/rtc-wm8350.c4
-rw-r--r--drivers/s390/block/dasd_diag.c2
-rw-r--r--drivers/s390/block/dasd_eckd.c2
-rw-r--r--drivers/s390/block/dasd_fba.c2
-rw-r--r--drivers/s390/char/con3215.c8
-rw-r--r--drivers/s390/char/raw3270.c2
-rw-r--r--drivers/s390/char/sclp.c4
-rw-r--r--drivers/s390/char/tape_34xx.c2
-rw-r--r--drivers/s390/char/tape_3590.c2
-rw-r--r--drivers/s390/char/vmur.c2
-rw-r--r--drivers/s390/cio/chsc_sch.c2
-rw-r--r--drivers/s390/cio/cio.c10
-rw-r--r--drivers/s390/cio/device.c12
-rw-r--r--drivers/s390/cio/device.h5
-rw-r--r--drivers/s390/cio/eadm_sch.c2
-rw-r--r--drivers/s390/cio/qdio_thinint.c2
-rw-r--r--drivers/s390/crypto/ap_bus.c2
-rw-r--r--drivers/s390/kvm/kvm_virtio.c2
-rw-r--r--drivers/s390/net/claw.c2
-rw-r--r--drivers/s390/net/ctcm_main.c2
-rw-r--r--drivers/s390/net/lcs.c2
-rw-r--r--drivers/sbus/char/bbc_i2c.c6
-rw-r--r--drivers/sbus/char/display7seg.c6
-rw-r--r--drivers/sbus/char/envctrl.c6
-rw-r--r--drivers/sbus/char/flash.c6
-rw-r--r--drivers/sbus/char/uctrl.c6
-rw-r--r--drivers/scsi/3w-9xxx.c4
-rw-r--r--drivers/scsi/3w-sas.c4
-rw-r--r--drivers/scsi/3w-xxxx.c4
-rw-r--r--drivers/scsi/BusLogic.c2
-rw-r--r--drivers/scsi/NCR5380.c2
-rw-r--r--drivers/scsi/NCR_D700.c12
-rw-r--r--drivers/scsi/NCR_Q720.c2
-rw-r--r--drivers/scsi/a100u2w.c8
-rw-r--r--drivers/scsi/a2091.c9
-rw-r--r--drivers/scsi/aacraid/linit.c15
-rw-r--r--drivers/scsi/advansys.c152
-rw-r--r--drivers/scsi/aha152x.c2
-rw-r--r--drivers/scsi/aha1740.c4
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c23
-rw-r--r--drivers/scsi/arm/acornscsi.c7
-rw-r--r--drivers/scsi/arm/arxescsi.c7
-rw-r--r--drivers/scsi/arm/cumana_1.c8
-rw-r--r--drivers/scsi/arm/cumana_2.c8
-rw-r--r--drivers/scsi/arm/eesox.c7
-rw-r--r--drivers/scsi/arm/oak.c7
-rw-r--r--drivers/scsi/arm/powertec.c8
-rw-r--r--drivers/scsi/atp870u.c2
-rw-r--r--drivers/scsi/be2iscsi/be_main.c4
-rw-r--r--drivers/scsi/bfa/bfad.c2
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c2
-rw-r--r--drivers/scsi/bnx2i/bnx2i_init.c2
-rw-r--r--drivers/scsi/bvme6000_scsi.c6
-rw-r--r--drivers/scsi/csiostor/csio_init.c17
-rw-r--r--drivers/scsi/dc395x.c51
-rw-r--r--drivers/scsi/dmx3191d.c8
-rw-r--r--drivers/scsi/fdomain.c2
-rw-r--r--drivers/scsi/fnic/fnic_main.c7
-rw-r--r--drivers/scsi/g_NCR5380.c2
-rw-r--r--drivers/scsi/gdth.c17
-rw-r--r--drivers/scsi/gvp11.c11
-rw-r--r--drivers/scsi/hpsa.c92
-rw-r--r--drivers/scsi/hptiop.c3
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvstgt.c2
-rw-r--r--drivers/scsi/initio.c2
-rw-r--r--drivers/scsi/ipr.c32
-rw-r--r--drivers/scsi/ips.c10
-rw-r--r--drivers/scsi/isci/init.c8
-rw-r--r--drivers/scsi/jazz_esp.c6
-rw-r--r--drivers/scsi/lasi700.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c14
-rw-r--r--drivers/scsi/mac_esp.c6
-rw-r--r--drivers/scsi/megaraid.c6
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c6
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c8
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c4
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c5
-rw-r--r--drivers/scsi/mvme16x_scsi.c8
-rw-r--r--drivers/scsi/mvsas/mv_64xx.c8
-rw-r--r--drivers/scsi/mvsas/mv_94xx.c7
-rw-r--r--drivers/scsi/mvsas/mv_chips.h2
-rw-r--r--drivers/scsi/mvsas/mv_init.c19
-rw-r--r--drivers/scsi/mvsas/mv_sas.c4
-rw-r--r--drivers/scsi/mvsas/mv_sas.h4
-rw-r--r--drivers/scsi/mvumi.c5
-rw-r--r--drivers/scsi/nsp32.c16
-rw-r--r--drivers/scsi/pm8001/pm8001_hwi.c36
-rw-r--r--drivers/scsi/pm8001/pm8001_init.c28
-rw-r--r--drivers/scsi/pmcraid.c31
-rw-r--r--drivers/scsi/ps3rom.c2
-rw-r--r--drivers/scsi/qla1280.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c6
-rw-r--r--drivers/scsi/qlogicfas.c2
-rw-r--r--drivers/scsi/qlogicpti.c20
-rw-r--r--drivers/scsi/sgiwd93.c4
-rw-r--r--drivers/scsi/sim710.c11
-rw-r--r--drivers/scsi/sni_53c710.c4
-rw-r--r--drivers/scsi/stex.c5
-rw-r--r--drivers/scsi/sun3x_esp.c6
-rw-r--r--drivers/scsi/sun_esp.c30
-rw-r--r--drivers/scsi/sym53c416.c2
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c23
-rw-r--r--drivers/scsi/tmscsim.c23
-rw-r--r--drivers/scsi/ufs/ufshcd.c5
-rw-r--r--drivers/scsi/virtio_scsi.c6
-rw-r--r--drivers/scsi/vmw_pvscsi.c9
-rw-r--r--drivers/scsi/zalon.c2
-rw-r--r--drivers/scsi/zorro7xx.c12
-rw-r--r--drivers/sh/pfc/gpio.c6
-rw-r--r--drivers/sh/pfc/pinctrl.c20
-rw-r--r--drivers/sn/ioc3.c14
-rw-r--r--drivers/ssb/Kconfig3
-rw-r--r--drivers/ssb/driver_gige.c14
-rw-r--r--drivers/ssb/driver_pcicore.c10
-rw-r--r--drivers/ssb/main.c27
-rw-r--r--drivers/ssb/pcihost_wrapper.c6
-rw-r--r--drivers/staging/comedi/Kconfig1
-rw-r--r--drivers/staging/comedi/comedi_fops.c3
-rw-r--r--drivers/staging/comedi/drivers/comedi_test.c2
-rw-r--r--drivers/staging/comedi/drivers/ni_pcimio.c16
-rw-r--r--drivers/staging/fwserial/Kconfig4
-rw-r--r--drivers/staging/fwserial/TODO14
-rw-r--r--drivers/staging/fwserial/fwserial.c2
-rw-r--r--drivers/staging/fwserial/fwserial.h6
-rw-r--r--drivers/staging/iio/gyro/Kconfig4
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c1
-rw-r--r--drivers/staging/imx-drm/ipu-v3/ipu-common.c5
-rw-r--r--drivers/staging/imx-drm/ipuv3-crtc.c6
-rw-r--r--drivers/staging/omapdrm/Makefile1
-rw-r--r--drivers/staging/omapdrm/TODO3
-rw-r--r--drivers/staging/omapdrm/omap_connector.c111
-rw-r--r--drivers/staging/omapdrm/omap_crtc.c507
-rw-r--r--drivers/staging/omapdrm/omap_drv.c439
-rw-r--r--drivers/staging/omapdrm/omap_drv.h140
-rw-r--r--drivers/staging/omapdrm/omap_encoder.c132
-rw-r--r--drivers/staging/omapdrm/omap_gem_dmabuf.c7
-rw-r--r--drivers/staging/omapdrm/omap_irq.c322
-rw-r--r--drivers/staging/omapdrm/omap_plane.c452
-rw-r--r--drivers/staging/rtl8187se/r8180_core.c3
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c4
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/rtl_core.c11
-rw-r--r--drivers/staging/rtl8712/usb_intf.c2
-rw-r--r--drivers/staging/sb105x/Kconfig1
-rw-r--r--drivers/staging/sb105x/sb_pci_mp.c2
-rw-r--r--drivers/staging/speakup/synth.c4
-rw-r--r--drivers/staging/tidspbridge/core/_tiomap.h2
-rw-r--r--drivers/staging/tidspbridge/core/dsp-clock.c13
-rw-r--r--drivers/staging/tidspbridge/core/wdt.c12
-rw-r--r--drivers/staging/vme/devices/vme_pio2_core.c14
-rw-r--r--drivers/staging/wlan-ng/cfg80211.c7
-rw-r--r--drivers/staging/zram/zram_drv.c39
-rw-r--r--drivers/thermal/exynos_thermal.c6
-rw-r--r--drivers/usb/Kconfig1
-rw-r--r--drivers/usb/chipidea/host.c3
-rw-r--r--drivers/usb/class/cdc-acm.c3
-rw-r--r--drivers/usb/core/hub.c120
-rw-r--r--drivers/usb/core/quirks.c3
-rw-r--r--drivers/usb/dwc3/debugfs.c2
-rw-r--r--drivers/usb/gadget/amd5536udc.c4
-rw-r--r--drivers/usb/gadget/dummy_hcd.c9
-rw-r--r--drivers/usb/gadget/mv_udc_core.c4
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c5
-rw-r--r--drivers/usb/gadget/tcm_usb_gadget.c3
-rw-r--r--drivers/usb/gadget/u_serial.c2
-rw-r--r--drivers/usb/host/ehci-fsl.c9
-rw-r--r--drivers/usb/host/ehci-mv.c4
-rw-r--r--drivers/usb/host/ehci-orion.c2
-rw-r--r--drivers/usb/host/ehci-pci.c39
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c3
-rw-r--r--drivers/usb/host/imx21-hcd.c1
-rw-r--r--drivers/usb/host/ohci-tmio.c3
-rw-r--r--drivers/usb/host/xhci-hub.c38
-rw-r--r--drivers/usb/host/xhci-mem.c2
-rw-r--r--drivers/usb/host/xhci-ring.c9
-rw-r--r--drivers/usb/host/xhci.c10
-rw-r--r--drivers/usb/misc/usbtest.c2
-rw-r--r--drivers/usb/musb/musb_core.c5
-rw-r--r--drivers/usb/musb/musb_dsps.c5
-rw-r--r--drivers/usb/otg/Kconfig2
-rw-r--r--drivers/usb/otg/mv_otg.c4
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c22
-rw-r--r--drivers/usb/renesas_usbhs/mod_host.c3
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h6
-rw-r--r--drivers/usb/serial/option.c18
-rw-r--r--drivers/video/acornfb.c22
-rw-r--r--drivers/video/arcfb.c10
-rw-r--r--drivers/video/arkfb.c10
-rw-r--r--drivers/video/asiliantfb.c18
-rw-r--r--drivers/video/aty/aty128fb.c57
-rw-r--r--drivers/video/aty/atyfb_base.c84
-rw-r--r--drivers/video/aty/mach64_ct.c6
-rw-r--r--drivers/video/aty/mach64_cursor.c2
-rw-r--r--drivers/video/aty/radeon_base.c20
-rw-r--r--drivers/video/aty/radeon_monitor.c24
-rw-r--r--drivers/video/au1100fb.c6
-rw-r--r--drivers/video/au1200fb.c6
-rw-r--r--drivers/video/auo_k1900fb.c6
-rw-r--r--drivers/video/auo_k1901fb.c6
-rw-r--r--drivers/video/auo_k190x.c6
-rw-r--r--drivers/video/bf537-lq035.c18
-rw-r--r--drivers/video/bf54x-lq043fb.c6
-rw-r--r--drivers/video/bfin-lq035q1-fb.c14
-rw-r--r--drivers/video/bfin-t350mcqb-fb.c6
-rw-r--r--drivers/video/bfin_adv7393fb.c10
-rw-r--r--drivers/video/broadsheetfb.c16
-rw-r--r--drivers/video/bw2.c23
-rw-r--r--drivers/video/carminefb.c16
-rw-r--r--drivers/video/cg14.c12
-rw-r--r--drivers/video/cg3.c26
-rw-r--r--drivers/video/cg6.c12
-rw-r--r--drivers/video/chipsfb.c13
-rw-r--r--drivers/video/cirrusfb.c44
-rw-r--r--drivers/video/clps711xfb.c8
-rw-r--r--drivers/video/cobalt_lcdfb.c8
-rw-r--r--drivers/video/console/sticore.c83
-rw-r--r--drivers/video/cyber2000fb.c23
-rw-r--r--drivers/video/da8xx-fb.c10
-rw-r--r--drivers/video/dnfb.c6
-rw-r--r--drivers/video/efifb.c4
-rw-r--r--drivers/video/ep93xx-fb.c8
-rw-r--r--drivers/video/exynos/exynos_dp_core.c6
-rw-r--r--drivers/video/exynos/exynos_mipi_dsi.c4
-rw-r--r--drivers/video/ffb.c6
-rw-r--r--drivers/video/fm2fb.c14
-rw-r--r--drivers/video/fsl-diu-fb.c6
-rw-r--r--drivers/video/gbefb.c24
-rw-r--r--drivers/video/geode/gx1fb_core.c14
-rw-r--r--drivers/video/geode/gxfb_core.c20
-rw-r--r--drivers/video/geode/lxfb_core.c20
-rw-r--r--drivers/video/grvga.c12
-rw-r--r--drivers/video/gxt4500.c13
-rw-r--r--drivers/video/hecubafb.c10
-rw-r--r--drivers/video/hgafb.c12
-rw-r--r--drivers/video/hitfb.c10
-rw-r--r--drivers/video/hpfb.c9
-rw-r--r--drivers/video/i740fb.c15
-rw-r--r--drivers/video/i810/i810_main.c72
-rw-r--r--drivers/video/i810/i810_main.h2
-rw-r--r--drivers/video/igafb.c2
-rw-r--r--drivers/video/imsttfb.c17
-rw-r--r--drivers/video/imxfb.c4
-rw-r--r--drivers/video/intelfb/intelfbdrv.c29
-rw-r--r--drivers/video/jz4740_fb.c8
-rw-r--r--drivers/video/kyro/fbdev.c21
-rw-r--r--drivers/video/leo.c6
-rw-r--r--drivers/video/mb862xx/mb862xxfbdrv.c20
-rw-r--r--drivers/video/mbx/mbxdebugfs.c4
-rw-r--r--drivers/video/mbx/mbxfb.c18
-rw-r--r--drivers/video/metronomefb.c22
-rw-r--r--drivers/video/msm/mddi.c9
-rw-r--r--drivers/video/mxsfb.c15
-rw-r--r--drivers/video/neofb.c26
-rw-r--r--drivers/video/nuc900fb.c4
-rw-r--r--drivers/video/nvidia/nvidia.c49
-rw-r--r--drivers/video/omap/lcd_mipid.c2
-rw-r--r--drivers/video/omap2/displays/panel-acx565akm.c2
-rw-r--r--drivers/video/omap2/displays/panel-lgphilips-lb035q02.c6
-rw-r--r--drivers/video/omap2/displays/panel-n8x0.c2
-rw-r--r--drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c2
-rw-r--r--drivers/video/omap2/displays/panel-tpo-td043mtea1.c4
-rw-r--r--drivers/video/p9100.c6
-rw-r--r--drivers/video/platinumfb.c11
-rw-r--r--drivers/video/pm2fb.c17
-rw-r--r--drivers/video/pm3fb.c17
-rw-r--r--drivers/video/pmag-ba-fb.c6
-rw-r--r--drivers/video/pmagb-b-fb.c12
-rw-r--r--drivers/video/ps3fb.c4
-rw-r--r--drivers/video/pvr2fb.c28
-rw-r--r--drivers/video/pxa168fb.c8
-rw-r--r--drivers/video/pxa3xx-gcu.c8
-rw-r--r--drivers/video/pxafb.c33
-rw-r--r--drivers/video/q40fb.c6
-rw-r--r--drivers/video/riva/fbdev.c45
-rw-r--r--drivers/video/riva/rivafb-i2c.c9
-rw-r--r--drivers/video/s1d13xxxfb.c10
-rw-r--r--drivers/video/s3c-fb.c15
-rw-r--r--drivers/video/s3c2410fb.c16
-rw-r--r--drivers/video/s3fb.c16
-rw-r--r--drivers/video/sa1100fb.c8
-rw-r--r--drivers/video/savage/savagefb_driver.c23
-rw-r--r--drivers/video/sgivwfb.c12
-rw-r--r--drivers/video/sh7760fb.c6
-rw-r--r--drivers/video/sh_mipi_dsi.c4
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c18
-rw-r--r--drivers/video/sh_mobile_meram.c2
-rw-r--r--drivers/video/sis/sis_main.c140
-rw-r--r--drivers/video/sis/sis_main.h20
-rw-r--r--drivers/video/skeletonfb.c17
-rw-r--r--drivers/video/sm501fb.c16
-rw-r--r--drivers/video/ssd1307fb.c15
-rw-r--r--drivers/video/sstfb.c33
-rw-r--r--drivers/video/sunxvr1000.c10
-rw-r--r--drivers/video/sunxvr2500.c12
-rw-r--r--drivers/video/sunxvr500.c12
-rw-r--r--drivers/video/tcx.c6
-rw-r--r--drivers/video/tdfxfb.c30
-rw-r--r--drivers/video/tgafb.c45
-rw-r--r--drivers/video/tmiofb.c8
-rw-r--r--drivers/video/tridentfb.c28
-rw-r--r--drivers/video/uvesafb.c74
-rw-r--r--drivers/video/vermilion/vermilion.c7
-rw-r--r--drivers/video/vfb.c6
-rw-r--r--drivers/video/vga16fb.c10
-rw-r--r--drivers/video/via/dvi.c10
-rw-r--r--drivers/video/via/dvi.h4
-rw-r--r--drivers/video/via/hw.c16
-rw-r--r--drivers/video/via/hw.h4
-rw-r--r--drivers/video/via/lcd.c10
-rw-r--r--drivers/video/via/lcd.h6
-rw-r--r--drivers/video/via/via-core.c19
-rw-r--r--drivers/video/via/via-gpio.c2
-rw-r--r--drivers/video/via/viafbdev.c12
-rw-r--r--drivers/video/vt8500lcdfb.c6
-rw-r--r--drivers/video/vt8623fb.c8
-rw-r--r--drivers/video/w100fb.c10
-rw-r--r--drivers/video/wm8505fb.c6
-rw-r--r--drivers/video/wmt_ge_rops.c6
-rw-r--r--drivers/video/xen-fbfront.c7
-rw-r--r--drivers/video/xilinxfb.c8
-rw-r--r--drivers/virtio/virtio_balloon.c4
-rw-r--r--drivers/virtio/virtio_mmio.c6
-rw-r--r--drivers/virtio/virtio_pci.c8
-rw-r--r--drivers/vlynq/vlynq.c6
-rw-r--r--drivers/w1/masters/mxc_w1.c2
-rw-r--r--drivers/xen/grant-table.c2
-rw-r--r--drivers/xen/platform-pci.c6
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c13
-rw-r--r--drivers/zorro/zorro-driver.c4
-rw-r--r--fs/buffer.c1
-rw-r--r--fs/cifs/cifsfs.c1
-rw-r--r--fs/cifs/cifsglob.h2
-rw-r--r--fs/cifs/file.c141
-rw-r--r--fs/cifs/smb1ops.c8
-rw-r--r--fs/cifs/smb2ops.c2
-rw-r--r--fs/cifs/transport.c6
-rw-r--r--fs/debugfs/inode.c2
-rw-r--r--fs/exec.c3
-rw-r--r--fs/ext4/Kconfig2
-rw-r--r--fs/ext4/namei.c3
-rw-r--r--fs/f2fs/data.c1
-rw-r--r--fs/f2fs/dir.c16
-rw-r--r--fs/f2fs/f2fs.h2
-rw-r--r--fs/f2fs/file.c10
-rw-r--r--fs/f2fs/gc.c34
-rw-r--r--fs/f2fs/hash.c18
-rw-r--r--fs/f2fs/inode.c1
-rw-r--r--fs/f2fs/namei.c34
-rw-r--r--fs/f2fs/node.c37
-rw-r--r--fs/f2fs/recovery.c10
-rw-r--r--fs/f2fs/segment.c46
-rw-r--r--fs/f2fs/segment.h15
-rw-r--r--fs/f2fs/super.c15
-rw-r--r--fs/f2fs/xattr.c5
-rw-r--r--fs/file.c2
-rw-r--r--fs/gfs2/lock_dlm.c1
-rw-r--r--fs/gfs2/rgrp.c35
-rw-r--r--fs/nfs/callback_proc.c2
-rw-r--r--fs/nfs/dir.c16
-rw-r--r--fs/nfs/nfs4proc.c18
-rw-r--r--fs/nfs/pnfs.c2
-rw-r--r--fs/nfs/read.c10
-rw-r--r--fs/nfs/super.c2
-rw-r--r--fs/nfs/write.c10
-rw-r--r--fs/pstore/ram.c14
-rw-r--r--fs/pstore/ram_core.c9
-rw-r--r--fs/seq_file.c2
-rw-r--r--fs/splice.c4
-rw-r--r--include/asm-generic/parport.h4
-rw-r--r--include/asm-generic/tlb.h9
-rw-r--r--include/drm/drm_mm.h2
-rw-r--r--include/drm/exynos_drm.h22
-rw-r--r--include/linux/ata_platform.h12
-rw-r--r--include/linux/audit.h4
-rw-r--r--include/linux/bcma/bcma_driver_gmac_cmn.h2
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/compaction.h4
-rw-r--r--include/linux/cpu_rmap.h13
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/init.h20
-rw-r--r--include/linux/interrupt.h5
-rw-r--r--include/linux/ipc_namespace.h1
-rw-r--r--include/linux/lockdep.h3
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mmzone.h8
-rw-r--r--include/linux/msg.h6
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/netdevice.h3
-rw-r--r--include/linux/pstore_ram.h5
-rw-r--r--include/linux/rbtree_augmented.h14
-rw-r--r--include/linux/rwsem.h9
-rw-r--r--include/net/netns/conntrack.h1
-rw-r--r--include/net/netns/x_tables.h1
-rw-r--r--include/sound/cs4271.h2
-rw-r--r--include/sound/soc.h10
-rw-r--r--include/uapi/drm/exynos_drm.h24
-rw-r--r--include/uapi/linux/audit.h2
-rw-r--r--include/uapi/linux/msg.h1
-rw-r--r--ipc/compat.c46
-rw-r--r--ipc/ipc_sysctl.c32
-rw-r--r--ipc/msg.c123
-rw-r--r--ipc/msgutil.c43
-rw-r--r--ipc/util.c16
-rw-r--r--ipc/util.h2
-rw-r--r--kernel/audit.c40
-rw-r--r--kernel/audit_tree.c26
-rw-r--r--kernel/audit_watch.c2
-rw-r--r--kernel/auditfilter.c1
-rw-r--r--kernel/auditsc.c20
-rw-r--r--kernel/printk.c5
-rw-r--r--kernel/rwsem.c10
-rw-r--r--kernel/signal.c9
-rw-r--r--kernel/trace/trace.c2
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--lib/cpu_rmap.c54
-rw-r--r--lib/rbtree.c20
-rw-r--r--mm/bootmem.c24
-rw-r--r--mm/compaction.c98
-rw-r--r--mm/huge_memory.c15
-rw-r--r--mm/internal.h1
-rw-r--r--mm/memblock.c3
-rw-r--r--mm/memory.c13
-rw-r--r--mm/migrate.c14
-rw-r--r--mm/mmap.c2
-rw-r--r--mm/page_alloc.c64
-rw-r--r--mm/page_isolation.c26
-rw-r--r--mm/vmscan.c4
-rw-r--r--net/bridge/br_multicast.c2
-rw-r--r--net/bridge/br_netlink.c13
-rw-r--r--net/bridge/br_private.h6
-rw-r--r--net/core/dev.c8
-rw-r--r--net/ipv4/devinet.c2
-rw-r--r--net/ipv4/ip_sockglue.c2
-rw-r--r--net/ipv4/ipconfig.c8
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c1
-rw-r--r--net/ipv4/netfilter/iptable_nat.c15
-rw-r--r--net/ipv4/tcp.c15
-rw-r--r--net/ipv4/tcp_input.c4
-rw-r--r--net/ipv6/addrconf.c27
-rw-r--r--net/ipv6/netfilter/ip6t_NPT.c33
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c1
-rw-r--r--net/ipv6/netfilter/ip6table_nat.c15
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c5
-rw-r--r--net/iucv/iucv.c2
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/chan.c38
-rw-r--r--net/mac80211/ibss.c9
-rw-r--r--net/mac80211/ieee80211_i.h16
-rw-r--r--net/mac80211/iface.c48
-rw-r--r--net/mac80211/mesh.c8
-rw-r--r--net/mac80211/mesh.h2
-rw-r--r--net/mac80211/mlme.c75
-rw-r--r--net/mac80211/scan.c46
-rw-r--r--net/mac80211/sta_info.c46
-rw-r--r--net/mac80211/sta_info.h3
-rw-r--r--net/mac802154/wpan.c2
-rw-r--r--net/netfilter/Kconfig7
-rw-r--r--net/netfilter/nf_conntrack_core.c2
-rw-r--r--net/netfilter/nf_conntrack_netlink.c2
-rw-r--r--net/netfilter/nfnetlink_log.c16
-rw-r--r--net/netfilter/xt_CT.c58
-rw-r--r--net/netfilter/xt_hashlimit.c54
-rw-r--r--net/netfilter/xt_recent.c43
-rw-r--r--net/sctp/Kconfig2
-rw-r--r--net/sunrpc/clnt.c7
-rw-r--r--net/sunrpc/sched.c30
-rw-r--r--net/sunrpc/xprt.c12
-rw-r--r--net/wireless/core.c3
-rw-r--r--samples/rpmsg/rpmsg_client_sample.c4
-rwxr-xr-xscripts/kernel-doc1
-rw-r--r--security/integrity/ima/ima.h1
-rw-r--r--security/integrity/ima/ima_main.c12
-rw-r--r--security/integrity/ima/ima_policy.c3
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c26
-rw-r--r--sound/oss/pas2_card.c5
-rw-r--r--sound/pci/au88x0/au88x0_synth.c2
-rw-r--r--sound/pci/hda/hda_codec.c2
-rw-r--r--sound/pci/hda/hda_intel.c13
-rw-r--r--sound/pci/hda/patch_conexant.c16
-rw-r--r--sound/pci/hda/patch_realtek.c54
-rw-r--r--sound/pci/rme9652/hdspm.c17
-rw-r--r--sound/soc/codecs/arizona.c9
-rw-r--r--sound/soc/codecs/arizona.h18
-rw-r--r--sound/soc/codecs/cs4271.c6
-rw-r--r--sound/soc/codecs/cs42l52.c4
-rw-r--r--sound/soc/codecs/lm49453.c106
-rw-r--r--sound/soc/codecs/sgtl5000.c4
-rw-r--r--sound/soc/codecs/sta529.c9
-rw-r--r--sound/soc/codecs/wm2000.c4
-rw-r--r--sound/soc/codecs/wm2200.c8
-rw-r--r--sound/soc/codecs/wm5100.c6
-rw-r--r--sound/soc/codecs/wm5102.c48
-rw-r--r--sound/soc/codecs/wm_adsp.c23
-rw-r--r--sound/soc/soc-core.c35
-rw-r--r--sound/soc/soc-pcm.c1
-rw-r--r--sound/usb/midi.c4
-rw-r--r--sound/usb/mixer_quirks.c2
-rw-r--r--sound/usb/pcm.c10
-rw-r--r--sound/usb/quirks-table.h24
-rw-r--r--sound/usb/quirks.c16
-rw-r--r--sound/usb/usbaudio.h1
-rw-r--r--tools/testing/selftests/ipc/Makefile25
-rw-r--r--tools/testing/selftests/ipc/msgque.c246
1670 files changed, 17417 insertions, 9887 deletions
diff --git a/Documentation/DocBook/media/v4l/driver.xml b/Documentation/DocBook/media/v4l/driver.xml
index eacafe312cd..7c6638baced 100644
--- a/Documentation/DocBook/media/v4l/driver.xml
+++ b/Documentation/DocBook/media/v4l/driver.xml
@@ -116,7 +116,7 @@ my_suspend (struct pci_dev * pci_dev,
116 return 0; /* a negative value on error, 0 on success. */ 116 return 0; /* a negative value on error, 0 on success. */
117} 117}
118 118
119static void __devexit 119static void
120my_remove (struct pci_dev * pci_dev) 120my_remove (struct pci_dev * pci_dev)
121{ 121{
122 my_device *my = pci_get_drvdata (pci_dev); 122 my_device *my = pci_get_drvdata (pci_dev);
@@ -124,7 +124,7 @@ my_remove (struct pci_dev * pci_dev)
124 /* Describe me. */ 124 /* Describe me. */
125} 125}
126 126
127static int __devinit 127static int
128my_probe (struct pci_dev * pci_dev, 128my_probe (struct pci_dev * pci_dev,
129 const struct pci_device_id * pci_id) 129 const struct pci_device_id * pci_id)
130{ 130{
@@ -157,7 +157,7 @@ my_pci_driver = {
157 .id_table = my_pci_device_ids, 157 .id_table = my_pci_device_ids,
158 158
159 .probe = my_probe, 159 .probe = my_probe,
160 .remove = __devexit_p (my_remove), 160 .remove = my_remove,
161 161
162 /* Power management functions. */ 162 /* Power management functions. */
163 .suspend = my_suspend, 163 .suspend = my_suspend,
diff --git a/Documentation/PCI/pci-iov-howto.txt b/Documentation/PCI/pci-iov-howto.txt
index cfaca7e6989..86551cc72e0 100644
--- a/Documentation/PCI/pci-iov-howto.txt
+++ b/Documentation/PCI/pci-iov-howto.txt
@@ -76,7 +76,7 @@ To notify SR-IOV core of Virtual Function Migration:
76 76
77Following piece of code illustrates the usage of the SR-IOV API. 77Following piece of code illustrates the usage of the SR-IOV API.
78 78
79static int __devinit dev_probe(struct pci_dev *dev, const struct pci_device_id *id) 79static int dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
80{ 80{
81 pci_enable_sriov(dev, NR_VIRTFN); 81 pci_enable_sriov(dev, NR_VIRTFN);
82 82
@@ -85,7 +85,7 @@ static int __devinit dev_probe(struct pci_dev *dev, const struct pci_device_id *
85 return 0; 85 return 0;
86} 86}
87 87
88static void __devexit dev_remove(struct pci_dev *dev) 88static void dev_remove(struct pci_dev *dev)
89{ 89{
90 pci_disable_sriov(dev); 90 pci_disable_sriov(dev);
91 91
@@ -131,7 +131,7 @@ static struct pci_driver dev_driver = {
131 .name = "SR-IOV Physical Function driver", 131 .name = "SR-IOV Physical Function driver",
132 .id_table = dev_id_table, 132 .id_table = dev_id_table,
133 .probe = dev_probe, 133 .probe = dev_probe,
134 .remove = __devexit_p(dev_remove), 134 .remove = dev_remove,
135 .suspend = dev_suspend, 135 .suspend = dev_suspend,
136 .resume = dev_resume, 136 .resume = dev_resume,
137 .shutdown = dev_shutdown, 137 .shutdown = dev_shutdown,
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt
index aa09e5476bb..bccf602a87f 100644
--- a/Documentation/PCI/pci.txt
+++ b/Documentation/PCI/pci.txt
@@ -183,12 +183,6 @@ Please mark the initialization and cleanup functions where appropriate
183 initializes. 183 initializes.
184 __exit Exit code. Ignored for non-modular drivers. 184 __exit Exit code. Ignored for non-modular drivers.
185 185
186
187 __devinit Device initialization code.
188 Identical to __init if the kernel is not compiled
189 with CONFIG_HOTPLUG, normal function otherwise.
190 __devexit The same for __exit.
191
192Tips on when/where to use the above attributes: 186Tips on when/where to use the above attributes:
193 o The module_init()/module_exit() functions (and all 187 o The module_init()/module_exit() functions (and all
194 initialization functions called _only_ from these) 188 initialization functions called _only_ from these)
@@ -196,20 +190,6 @@ Tips on when/where to use the above attributes:
196 190
197 o Do not mark the struct pci_driver. 191 o Do not mark the struct pci_driver.
198 192
199 o The ID table array should be marked __devinitconst; this is done
200 automatically if the table is declared with DEFINE_PCI_DEVICE_TABLE().
201
202 o The probe() and remove() functions should be marked __devinit
203 and __devexit respectively. All initialization functions
204 exclusively called by the probe() routine, can be marked __devinit.
205 Ditto for remove() and __devexit.
206
207 o If mydriver_remove() is marked with __devexit(), then all address
208 references to mydriver_remove must use __devexit_p(mydriver_remove)
209 (in the struct pci_driver declaration for example).
210 __devexit_p() will generate the function name _or_ NULL if the
211 function will be discarded. For an example, see drivers/net/tg3.c.
212
213 o Do NOT mark a function if you are not sure which mark to use. 193 o Do NOT mark a function if you are not sure which mark to use.
214 Better to not mark the function than mark the function wrong. 194 Better to not mark the function than mark the function wrong.
215 195
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt
index 4f27785ca0c..54469bc81b1 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -185,7 +185,7 @@ input driver:
185 .acpi_match_table ACPI_PTR(mpu3050_acpi_match), 185 .acpi_match_table ACPI_PTR(mpu3050_acpi_match),
186 }, 186 },
187 .probe = mpu3050_probe, 187 .probe = mpu3050_probe,
188 .remove = __devexit_p(mpu3050_remove), 188 .remove = mpu3050_remove,
189 .id_table = mpu3050_ids, 189 .id_table = mpu3050_ids,
190 }; 190 };
191 191
diff --git a/Documentation/devicetree/bindings/clock/imx23-clock.txt b/Documentation/devicetree/bindings/clock/imx23-clock.txt
index baadbb11fe9..5083c0b834b 100644
--- a/Documentation/devicetree/bindings/clock/imx23-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx23-clock.txt
@@ -60,11 +60,6 @@ clks: clkctrl@80040000 {
60 compatible = "fsl,imx23-clkctrl"; 60 compatible = "fsl,imx23-clkctrl";
61 reg = <0x80040000 0x2000>; 61 reg = <0x80040000 0x2000>;
62 #clock-cells = <1>; 62 #clock-cells = <1>;
63 clock-output-names =
64 ...
65 "uart", /* 32 */
66 ...
67 "end_of_list";
68}; 63};
69 64
70auart0: serial@8006c000 { 65auart0: serial@8006c000 {
diff --git a/Documentation/devicetree/bindings/clock/imx25-clock.txt b/Documentation/devicetree/bindings/clock/imx25-clock.txt
index c2a3525ecb4..db4f2f05c4d 100644
--- a/Documentation/devicetree/bindings/clock/imx25-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx25-clock.txt
@@ -146,10 +146,6 @@ clks: ccm@53f80000 {
146 compatible = "fsl,imx25-ccm"; 146 compatible = "fsl,imx25-ccm";
147 reg = <0x53f80000 0x4000>; 147 reg = <0x53f80000 0x4000>;
148 interrupts = <31>; 148 interrupts = <31>;
149 clock-output-names = ...
150 "uart_ipg",
151 "uart_serial",
152 ...;
153}; 149};
154 150
155uart1: serial@43f90000 { 151uart1: serial@43f90000 {
diff --git a/Documentation/devicetree/bindings/clock/imx28-clock.txt b/Documentation/devicetree/bindings/clock/imx28-clock.txt
index 52a49a4a50b..e6587af62ff 100644
--- a/Documentation/devicetree/bindings/clock/imx28-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx28-clock.txt
@@ -83,11 +83,6 @@ clks: clkctrl@80040000 {
83 compatible = "fsl,imx28-clkctrl"; 83 compatible = "fsl,imx28-clkctrl";
84 reg = <0x80040000 0x2000>; 84 reg = <0x80040000 0x2000>;
85 #clock-cells = <1>; 85 #clock-cells = <1>;
86 clock-output-names =
87 ...
88 "uart", /* 45 */
89 ...
90 "end_of_list";
91}; 86};
92 87
93auart0: serial@8006a000 { 88auart0: serial@8006a000 {
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
index d77b4e68dc4..f73fdf59556 100644
--- a/Documentation/devicetree/bindings/clock/imx6q-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
@@ -211,10 +211,6 @@ clks: ccm@020c4000 {
211 reg = <0x020c4000 0x4000>; 211 reg = <0x020c4000 0x4000>;
212 interrupts = <0 87 0x04 0 88 0x04>; 212 interrupts = <0 87 0x04 0 88 0x04>;
213 #clock-cells = <1>; 213 #clock-cells = <1>;
214 clock-output-names = ...
215 "uart_ipg",
216 "uart_serial",
217 ...;
218}; 214};
219 215
220uart1: serial@02020000 { 216uart1: serial@02020000 {
diff --git a/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt b/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
index 558cdf3c9ab..d4eab9227ea 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
@@ -1,4 +1,19 @@
1GPIO line that should be set high/low to power off a device 1Driver a GPIO line that can be used to turn the power off.
2
3The driver supports both level triggered and edge triggered power off.
4At driver load time, the driver will request the given gpio line and
5install a pm_power_off handler. If the optional properties 'input' is
6not found, the GPIO line will be driven in the inactive
7state. Otherwise its configured as an input.
8
9When the pm_power_off is called, the gpio is configured as an output,
10and drive active, so triggering a level triggered power off
11condition. This will also cause an inactive->active edge condition, so
12triggering positive edge triggered power off. After a delay of 100ms,
13the GPIO is set to inactive, thus causing an active->inactive edge,
14triggering negative edge triggered power off. After another 100ms
15delay the GPIO is driver active again. If the power is still on and
16the CPU still running after a 3000ms delay, a WARN_ON(1) is emitted.
2 17
3Required properties: 18Required properties:
4- compatible : should be "gpio-poweroff". 19- compatible : should be "gpio-poweroff".
@@ -13,10 +28,9 @@ Optional properties:
13 property is not specified, the GPIO is initialized as an output in its 28 property is not specified, the GPIO is initialized as an output in its
14 inactive state. 29 inactive state.
15 30
16
17Examples: 31Examples:
18 32
19gpio-poweroff { 33gpio-poweroff {
20 compatible = "gpio-poweroff"; 34 compatible = "gpio-poweroff";
21 gpios = <&gpio 4 0>; /* GPIO 4 Active Low */ 35 gpios = <&gpio 4 0>;
22}; 36};
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt
new file mode 100644
index 00000000000..c596a6ad328
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt
@@ -0,0 +1,47 @@
1CSR SiRFprimaII pinmux controller
2
3Required properties:
4- compatible : "sirf,prima2-pinctrl"
5- reg : Address range of the pinctrl registers
6- interrupts : Interrupts used by every GPIO group
7- gpio-controller : Indicates this device is a GPIO controller
8- interrupt-controller : Marks the device node as an interrupt controller
9Optional properties:
10- sirf,pullups : if n-th bit of m-th bank is set, set a pullup on GPIO-n of bank m
11- sirf,pulldowns : if n-th bit of m-th bank is set, set a pulldown on GPIO-n of bank m
12
13Please refer to pinctrl-bindings.txt in this directory for details of the common
14pinctrl bindings used by client devices.
15
16SiRFprimaII's pinmux nodes act as a container for an abitrary number of subnodes.
17Each of these subnodes represents some desired configuration for a group of pins.
18
19Required subnode-properties:
20- sirf,pins : An array of strings. Each string contains the name of a group.
21- sirf,function: A string containing the name of the function to mux to the
22 group.
23
24 Valid values for group and function names can be found from looking at the
25 group and function arrays in driver files:
26 drivers/pinctrl/pinctrl-sirf.c
27
28For example, pinctrl might have subnodes like the following:
29 uart2_pins_a: uart2@0 {
30 uart {
31 sirf,pins = "uart2grp";
32 sirf,function = "uart2";
33 };
34 };
35 uart2_noflow_pins_a: uart2@1 {
36 uart {
37 sirf,pins = "uart2_nostreamctrlgrp";
38 sirf,function = "uart2_nostreamctrl";
39 };
40 };
41
42For a specific board, if it wants to use uart2 without hardware flow control,
43it can add the following to its board-specific .dts file.
44uart2: uart@0xb0070000 {
45 pinctrl-names = "default";
46 pinctrl-0 = <&uart2_noflow_pins_a>;
47}
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index abf63615ee0..22182660dda 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -91,7 +91,7 @@ Example (from the nxp OHCI driver):
91 91
92static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; 92static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
93 93
94static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) 94static int usb_hcd_nxp_probe(struct platform_device *pdev)
95{ 95{
96 (...) 96 (...)
97 struct i2c_adapter *i2c_adap; 97 struct i2c_adapter *i2c_adap;
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index dd52d516cb8..dbca6618208 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -36,7 +36,7 @@ neigh/default/unres_qlen_bytes - INTEGER
36 The maximum number of bytes which may be used by packets 36 The maximum number of bytes which may be used by packets
37 queued for each unresolved address by other network layers. 37 queued for each unresolved address by other network layers.
38 (added in linux 3.3) 38 (added in linux 3.3)
39 Seting negative value is meaningless and will retrun error. 39 Setting negative value is meaningless and will return error.
40 Default: 65536 Bytes(64KB) 40 Default: 65536 Bytes(64KB)
41 41
42neigh/default/unres_qlen - INTEGER 42neigh/default/unres_qlen - INTEGER
@@ -215,7 +215,7 @@ tcp_ecn - INTEGER
215 Possible values are: 215 Possible values are:
216 0 Disable ECN. Neither initiate nor accept ECN. 216 0 Disable ECN. Neither initiate nor accept ECN.
217 1 Always request ECN on outgoing connection attempts. 217 1 Always request ECN on outgoing connection attempts.
218 2 Enable ECN when requested by incomming connections 218 2 Enable ECN when requested by incoming connections
219 but do not request ECN on outgoing connections. 219 but do not request ECN on outgoing connections.
220 Default: 2 220 Default: 2
221 221
@@ -503,7 +503,7 @@ tcp_fastopen - INTEGER
503tcp_syn_retries - INTEGER 503tcp_syn_retries - INTEGER
504 Number of times initial SYNs for an active TCP connection attempt 504 Number of times initial SYNs for an active TCP connection attempt
505 will be retransmitted. Should not be higher than 255. Default value 505 will be retransmitted. Should not be higher than 255. Default value
506 is 6, which corresponds to 63seconds till the last restransmission 506 is 6, which corresponds to 63seconds till the last retransmission
507 with the current initial RTO of 1second. With this the final timeout 507 with the current initial RTO of 1second. With this the final timeout
508 for an active TCP connection attempt will happen after 127seconds. 508 for an active TCP connection attempt will happen after 127seconds.
509 509
@@ -1331,6 +1331,12 @@ force_tllao - BOOLEAN
1331 race condition where the sender deletes the cached link-layer address 1331 race condition where the sender deletes the cached link-layer address
1332 prior to receiving a response to a previous solicitation." 1332 prior to receiving a response to a previous solicitation."
1333 1333
1334ndisc_notify - BOOLEAN
1335 Define mode for notification of address and device changes.
1336 0 - (default): do nothing
1337 1 - Generate unsolicited neighbour advertisements when device is brought
1338 up or hardware address changes.
1339
1334icmp/*: 1340icmp/*:
1335ratelimit - INTEGER 1341ratelimit - INTEGER
1336 Limit the maximal rates for sending ICMPv6 packets. 1342 Limit the maximal rates for sending ICMPv6 packets.
@@ -1530,7 +1536,7 @@ cookie_hmac_alg - STRING
1530 * sha1 1536 * sha1
1531 * none 1537 * none
1532 Ability to assign md5 or sha1 as the selected alg is predicated on the 1538 Ability to assign md5 or sha1 as the selected alg is predicated on the
1533 configuarion of those algorithms at build time (CONFIG_CRYPTO_MD5 and 1539 configuration of those algorithms at build time (CONFIG_CRYPTO_MD5 and
1534 CONFIG_CRYPTO_SHA1). 1540 CONFIG_CRYPTO_SHA1).
1535 1541
1536 Default: Dependent on configuration. MD5 if available, else SHA1 if 1542 Default: Dependent on configuration. MD5 if available, else SHA1 if
@@ -1548,7 +1554,7 @@ rcvbuf_policy - INTEGER
1548 blocking. 1554 blocking.
1549 1555
1550 1: rcvbuf space is per association 1556 1: rcvbuf space is per association
1551 0: recbuf space is per socket 1557 0: rcvbuf space is per socket
1552 1558
1553 Default: 0 1559 Default: 0
1554 1560
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 4abe83e1045..03591a750f9 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -642,12 +642,13 @@ out the following operations:
642 * During system suspend it calls pm_runtime_get_noresume() and 642 * During system suspend it calls pm_runtime_get_noresume() and
643 pm_runtime_barrier() for every device right before executing the 643 pm_runtime_barrier() for every device right before executing the
644 subsystem-level .suspend() callback for it. In addition to that it calls 644 subsystem-level .suspend() callback for it. In addition to that it calls
645 pm_runtime_disable() for every device right after executing the 645 __pm_runtime_disable() with 'false' as the second argument for every device
646 subsystem-level .suspend() callback for it. 646 right before executing the subsystem-level .suspend_late() callback for it.
647 647
648 * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync() 648 * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync()
649 for every device right before and right after executing the subsystem-level 649 for every device right after executing the subsystem-level .resume_early()
650 .resume() callback for it, respectively. 650 callback and right after executing the subsystem-level .resume() callback
651 for it, respectively.
651 652
6527. Generic subsystem callbacks 6537. Generic subsystem callbacks
653 654
diff --git a/Documentation/rpmsg.txt b/Documentation/rpmsg.txt
index 409d9f964c5..f7edc3aa1e9 100644
--- a/Documentation/rpmsg.txt
+++ b/Documentation/rpmsg.txt
@@ -236,7 +236,7 @@ static int rpmsg_sample_probe(struct rpmsg_channel *rpdev)
236 return 0; 236 return 0;
237} 237}
238 238
239static void __devexit rpmsg_sample_remove(struct rpmsg_channel *rpdev) 239static void rpmsg_sample_remove(struct rpmsg_channel *rpdev)
240{ 240{
241 dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n"); 241 dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n");
242} 242}
@@ -253,7 +253,7 @@ static struct rpmsg_driver rpmsg_sample_client = {
253 .id_table = rpmsg_driver_sample_id_table, 253 .id_table = rpmsg_driver_sample_id_table,
254 .probe = rpmsg_sample_probe, 254 .probe = rpmsg_sample_probe,
255 .callback = rpmsg_sample_cb, 255 .callback = rpmsg_sample_cb,
256 .remove = __devexit_p(rpmsg_sample_remove), 256 .remove = rpmsg_sample_remove,
257}; 257};
258 258
259static int __init init(void) 259static int __init init(void)
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 7312ec14dd8..2331eb21414 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -345,7 +345,7 @@ SPI protocol drivers somewhat resemble platform device drivers:
345 }, 345 },
346 346
347 .probe = CHIP_probe, 347 .probe = CHIP_probe,
348 .remove = __devexit_p(CHIP_remove), 348 .remove = CHIP_remove,
349 .suspend = CHIP_suspend, 349 .suspend = CHIP_suspend,
350 .resume = CHIP_resume, 350 .resume = CHIP_resume,
351 }; 351 };
@@ -355,7 +355,7 @@ device whose board_info gave a modalias of "CHIP". Your probe() code
355might look like this unless you're creating a device which is managing 355might look like this unless you're creating a device which is managing
356a bus (appearing under /sys/class/spi_master). 356a bus (appearing under /sys/class/spi_master).
357 357
358 static int __devinit CHIP_probe(struct spi_device *spi) 358 static int CHIP_probe(struct spi_device *spi)
359 { 359 {
360 struct CHIP *chip; 360 struct CHIP *chip;
361 struct CHIP_platform_data *pdata; 361 struct CHIP_platform_data *pdata;
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 2907ba6c360..ccd42589e12 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -38,6 +38,7 @@ show up in /proc/sys/kernel:
38- l2cr [ PPC only ] 38- l2cr [ PPC only ]
39- modprobe ==> Documentation/debugging-modules.txt 39- modprobe ==> Documentation/debugging-modules.txt
40- modules_disabled 40- modules_disabled
41- msg_next_id [ sysv ipc ]
41- msgmax 42- msgmax
42- msgmnb 43- msgmnb
43- msgmni 44- msgmni
@@ -62,7 +63,9 @@ show up in /proc/sys/kernel:
62- rtsig-max 63- rtsig-max
63- rtsig-nr 64- rtsig-nr
64- sem 65- sem
66- sem_next_id [ sysv ipc ]
65- sg-big-buff [ generic SCSI device (sg) ] 67- sg-big-buff [ generic SCSI device (sg) ]
68- shm_next_id [ sysv ipc ]
66- shm_rmid_forced 69- shm_rmid_forced
67- shmall 70- shmall
68- shmmax [ sysv ipc ] 71- shmmax [ sysv ipc ]
@@ -320,6 +323,22 @@ to false.
320 323
321============================================================== 324==============================================================
322 325
326msg_next_id, sem_next_id, and shm_next_id:
327
328These three toggles allows to specify desired id for next allocated IPC
329object: message, semaphore or shared memory respectively.
330
331By default they are equal to -1, which means generic allocation logic.
332Possible values to set are in range {0..INT_MAX}.
333
334Notes:
3351) kernel doesn't guarantee, that new object will have desired id. So,
336it's up to userspace, how to handle an object with "wrong" id.
3372) Toggle with non-default value will be set back to -1 by kernel after
338successful IPC object allocation.
339
340==============================================================
341
323nmi_watchdog: 342nmi_watchdog:
324 343
325Enables/Disables the NMI watchdog on x86 systems. When the value is 344Enables/Disables the NMI watchdog on x86 systems. When the value is
@@ -542,6 +561,19 @@ are doing anyway :)
542 561
543============================================================== 562==============================================================
544 563
564shmall:
565
566This parameter sets the total amount of shared memory pages that
567can be used system wide. Hence, SHMALL should always be at least
568ceil(shmmax/PAGE_SIZE).
569
570If you are not sure what the default PAGE_SIZE is on your Linux
571system, you can run the following command:
572
573# getconf PAGE_SIZE
574
575==============================================================
576
545shmmax: 577shmmax:
546 578
547This value can be used to query and set the run time limit 579This value can be used to query and set the run time limit
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index 32bfe926e8d..b89567ad04b 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -174,8 +174,7 @@ The recommended approach is as follows:
174 174
175static atomic_t drv_instance = ATOMIC_INIT(0); 175static atomic_t drv_instance = ATOMIC_INIT(0);
176 176
177static int __devinit drv_probe(struct pci_dev *pdev, 177static int drv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
178 const struct pci_device_id *pci_id)
179{ 178{
180 ... 179 ...
181 state->instance = atomic_inc_return(&drv_instance) - 1; 180 state->instance = atomic_inc_return(&drv_instance) - 1;
diff --git a/Documentation/zh_CN/video4linux/v4l2-framework.txt b/Documentation/zh_CN/video4linux/v4l2-framework.txt
index 3e74f13af42..44c1d934c4e 100644
--- a/Documentation/zh_CN/video4linux/v4l2-framework.txt
+++ b/Documentation/zh_CN/video4linux/v4l2-framework.txt
@@ -182,8 +182,7 @@ int iterate(void *p)
182 182
183static atomic_t drv_instance = ATOMIC_INIT(0); 183static atomic_t drv_instance = ATOMIC_INIT(0);
184 184
185static int __devinit drv_probe(struct pci_dev *pdev, 185static int drv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
186 const struct pci_device_id *pci_id)
187{ 186{
188 ... 187 ...
189 state->instance = atomic_inc_return(&drv_instance) - 1; 188 state->instance = atomic_inc_return(&drv_instance) - 1;
diff --git a/MAINTAINERS b/MAINTAINERS
index fa309ab7ccb..cd5b31fec01 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -228,7 +228,7 @@ S: Maintained
228F: drivers/platform/x86/acerhdf.c 228F: drivers/platform/x86/acerhdf.c
229 229
230ACER WMI LAPTOP EXTRAS 230ACER WMI LAPTOP EXTRAS
231M: Joey Lee <jlee@novell.com> 231M: "Lee, Chun-Yi" <jlee@suse.com>
232L: platform-driver-x86@vger.kernel.org 232L: platform-driver-x86@vger.kernel.org
233S: Maintained 233S: Maintained
234F: drivers/platform/x86/acer-wmi.c 234F: drivers/platform/x86/acer-wmi.c
@@ -449,6 +449,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
449S: Maintained 449S: Maintained
450F: drivers/char/agp/ 450F: drivers/char/agp/
451F: include/linux/agp* 451F: include/linux/agp*
452F: include/uapi/linux/agp*
452 453
453AHA152X SCSI DRIVER 454AHA152X SCSI DRIVER
454M: "Juergen E. Fischer" <fischer@norbit.de> 455M: "Juergen E. Fischer" <fischer@norbit.de>
@@ -589,6 +590,7 @@ M: Jiri Kosina <jkosina@suse.cz>
589S: Odd fixes 590S: Odd fixes
590F: arch/x86/kernel/apm_32.c 591F: arch/x86/kernel/apm_32.c
591F: include/linux/apm_bios.h 592F: include/linux/apm_bios.h
593F: include/uapi/linux/apm_bios.h
592F: drivers/char/apm-emulation.c 594F: drivers/char/apm-emulation.c
593 595
594APPLE BCM5974 MULTITOUCH DRIVER 596APPLE BCM5974 MULTITOUCH DRIVER
@@ -646,7 +648,7 @@ F: arch/arm/
646 648
647ARM SUB-ARCHITECTURES 649ARM SUB-ARCHITECTURES
648L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 650L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
649S: MAINTAINED 651S: Maintained
650F: arch/arm/mach-*/ 652F: arch/arm/mach-*/
651F: arch/arm/plat-*/ 653F: arch/arm/plat-*/
652T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git 654T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
@@ -1005,7 +1007,6 @@ F: drivers/mmc/host/msm_sdcc.c
1005F: drivers/mmc/host/msm_sdcc.h 1007F: drivers/mmc/host/msm_sdcc.h
1006F: drivers/tty/serial/msm_serial.h 1008F: drivers/tty/serial/msm_serial.h
1007F: drivers/tty/serial/msm_serial.c 1009F: drivers/tty/serial/msm_serial.c
1008F: drivers/platform/msm/
1009F: drivers/*/pm8???-* 1010F: drivers/*/pm8???-*
1010F: include/linux/mfd/pm8xxx/ 1011F: include/linux/mfd/pm8xxx/
1011T: git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git 1012T: git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git
@@ -1069,7 +1070,6 @@ M: Russell King <linux@arm.linux.org.uk>
1069L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1070L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1070W: http://www.arm.linux.org.uk/ 1071W: http://www.arm.linux.org.uk/
1071S: Maintained 1072S: Maintained
1072F: arch/arm/common/time-acorn.c
1073F: arch/arm/include/asm/hardware/entry-macro-iomd.S 1073F: arch/arm/include/asm/hardware/entry-macro-iomd.S
1074F: arch/arm/include/asm/hardware/ioc.h 1074F: arch/arm/include/asm/hardware/ioc.h
1075F: arch/arm/include/asm/hardware/iomd.h 1075F: arch/arm/include/asm/hardware/iomd.h
@@ -1094,7 +1094,6 @@ W: http://www.fluff.org/ben/linux/
1094S: Maintained 1094S: Maintained
1095F: arch/arm/plat-samsung/ 1095F: arch/arm/plat-samsung/
1096F: arch/arm/plat-s3c24xx/ 1096F: arch/arm/plat-s3c24xx/
1097F: arch/arm/plat-s5p/
1098F: arch/arm/mach-s3c24*/ 1097F: arch/arm/mach-s3c24*/
1099F: arch/arm/mach-s3c64xx/ 1098F: arch/arm/mach-s3c64xx/
1100F: drivers/*/*s3c2410* 1099F: drivers/*/*s3c2410*
@@ -1125,7 +1124,6 @@ M: Sylwester Nawrocki <s.nawrocki@samsung.com>
1125L: linux-arm-kernel@lists.infradead.org 1124L: linux-arm-kernel@lists.infradead.org
1126L: linux-media@vger.kernel.org 1125L: linux-media@vger.kernel.org
1127S: Maintained 1126S: Maintained
1128F: arch/arm/plat-s5p/dev-fimc*
1129F: arch/arm/plat-samsung/include/plat/*fimc* 1127F: arch/arm/plat-samsung/include/plat/*fimc*
1130F: drivers/media/platform/s5p-fimc/ 1128F: drivers/media/platform/s5p-fimc/
1131 1129
@@ -1136,7 +1134,7 @@ M: Jeongtae Park <jtp.park@samsung.com>
1136L: linux-arm-kernel@lists.infradead.org 1134L: linux-arm-kernel@lists.infradead.org
1137L: linux-media@vger.kernel.org 1135L: linux-media@vger.kernel.org
1138S: Maintained 1136S: Maintained
1139F: arch/arm/plat-s5p/dev-mfc.c 1137F: arch/arm/plat-samsung/s5p-dev-mfc.c
1140F: drivers/media/platform/s5p-mfc/ 1138F: drivers/media/platform/s5p-mfc/
1141 1139
1142ARM/SAMSUNG S5P SERIES TV SUBSYSTEM SUPPORT 1140ARM/SAMSUNG S5P SERIES TV SUBSYSTEM SUPPORT
@@ -1254,7 +1252,7 @@ F: drivers/video/vt8500lcdfb.*
1254F: drivers/video/wm8505fb* 1252F: drivers/video/wm8505fb*
1255F: drivers/video/wmt_ge_rops.* 1253F: drivers/video/wmt_ge_rops.*
1256F: drivers/tty/serial/vt8500_serial.c 1254F: drivers/tty/serial/vt8500_serial.c
1257F: drivers/rtc/rtc-vt8500-c 1255F: drivers/rtc/rtc-vt8500.c
1258F: drivers/mmc/host/wmt-sdmmc.c 1256F: drivers/mmc/host/wmt-sdmmc.c
1259 1257
1260ARM/ZIPIT Z2 SUPPORT 1258ARM/ZIPIT Z2 SUPPORT
@@ -1353,6 +1351,14 @@ W: http://wireless.kernel.org/en/users/Drivers/ath9k
1353S: Supported 1351S: Supported
1354F: drivers/net/wireless/ath/ath9k/ 1352F: drivers/net/wireless/ath/ath9k/
1355 1353
1354WILOCITY WIL6210 WIRELESS DRIVER
1355M: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
1356L: linux-wireless@vger.kernel.org
1357L: wil6210@qca.qualcomm.com
1358S: Supported
1359W: http://wireless.kernel.org/en/users/Drivers/wil6210
1360F: drivers/net/wireless/ath/wil6210/
1361
1356CARL9170 LINUX COMMUNITY WIRELESS DRIVER 1362CARL9170 LINUX COMMUNITY WIRELESS DRIVER
1357M: Christian Lamparter <chunkeey@googlemail.com> 1363M: Christian Lamparter <chunkeey@googlemail.com>
1358L: linux-wireless@vger.kernel.org 1364L: linux-wireless@vger.kernel.org
@@ -1388,6 +1394,7 @@ W: http://linux-atm.sourceforge.net
1388S: Maintained 1394S: Maintained
1389F: drivers/atm/ 1395F: drivers/atm/
1390F: include/linux/atm* 1396F: include/linux/atm*
1397F: include/uapi/linux/atm*
1391 1398
1392ATMEL AT91 / AT32 MCI DRIVER 1399ATMEL AT91 / AT32 MCI DRIVER
1393M: Ludovic Desroches <ludovic.desroches@atmel.com> 1400M: Ludovic Desroches <ludovic.desroches@atmel.com>
@@ -1406,13 +1413,13 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1406S: Supported 1413S: Supported
1407F: drivers/dma/at_hdmac.c 1414F: drivers/dma/at_hdmac.c
1408F: drivers/dma/at_hdmac_regs.h 1415F: drivers/dma/at_hdmac_regs.h
1409F: arch/arm/mach-at91/include/mach/at_hdmac.h 1416F: include/linux/platform_data/dma-atmel.h
1410 1417
1411ATMEL ISI DRIVER 1418ATMEL ISI DRIVER
1412M: Josh Wu <josh.wu@atmel.com> 1419M: Josh Wu <josh.wu@atmel.com>
1413L: linux-media@vger.kernel.org 1420L: linux-media@vger.kernel.org
1414S: Supported 1421S: Supported
1415F: drivers/media/platform/atmel-isi.c 1422F: drivers/media/platform/soc_camera/atmel-isi.c
1416F: include/media/atmel-isi.h 1423F: include/media/atmel-isi.h
1417 1424
1418ATMEL LCDFB DRIVER 1425ATMEL LCDFB DRIVER
@@ -1467,6 +1474,7 @@ W: http://people.redhat.com/sgrubb/audit/
1467T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git 1474T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git
1468S: Maintained 1475S: Maintained
1469F: include/linux/audit.h 1476F: include/linux/audit.h
1477F: include/uapi/linux/audit.h
1470F: kernel/audit* 1478F: kernel/audit*
1471 1479
1472AUXILIARY DISPLAY DRIVERS 1480AUXILIARY DISPLAY DRIVERS
@@ -1497,7 +1505,7 @@ M: Ralf Baechle <ralf@linux-mips.org>
1497L: linux-hams@vger.kernel.org 1505L: linux-hams@vger.kernel.org
1498W: http://www.linux-ax25.org/ 1506W: http://www.linux-ax25.org/
1499S: Maintained 1507S: Maintained
1500F: include/linux/ax25.h 1508F: include/uapi/linux/ax25.h
1501F: include/net/ax25.h 1509F: include/net/ax25.h
1502F: net/ax25/ 1510F: net/ax25/
1503 1511
@@ -1558,7 +1566,7 @@ M: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
1558S: Maintained 1566S: Maintained
1559F: Documentation/filesystems/bfs.txt 1567F: Documentation/filesystems/bfs.txt
1560F: fs/bfs/ 1568F: fs/bfs/
1561F: include/linux/bfs_fs.h 1569F: include/uapi/linux/bfs_fs.h
1562 1570
1563BLACKFIN ARCHITECTURE 1571BLACKFIN ARCHITECTURE
1564M: Mike Frysinger <vapier@gentoo.org> 1572M: Mike Frysinger <vapier@gentoo.org>
@@ -1655,7 +1663,7 @@ L: netdev@vger.kernel.org
1655W: http://sourceforge.net/projects/bonding/ 1663W: http://sourceforge.net/projects/bonding/
1656S: Supported 1664S: Supported
1657F: drivers/net/bonding/ 1665F: drivers/net/bonding/
1658F: include/linux/if_bonding.h 1666F: include/uapi/linux/if_bonding.h
1659 1667
1660BROADCOM B44 10/100 ETHERNET DRIVER 1668BROADCOM B44 10/100 ETHERNET DRIVER
1661M: Gary Zambrano <zambrano@broadcom.com> 1669M: Gary Zambrano <zambrano@broadcom.com>
@@ -1734,6 +1742,7 @@ L: linux-scsi@vger.kernel.org
1734S: Supported 1742S: Supported
1735F: block/bsg.c 1743F: block/bsg.c
1736F: include/linux/bsg.h 1744F: include/linux/bsg.h
1745F: include/uapi/linux/bsg.h
1737 1746
1738BT87X AUDIO DRIVER 1747BT87X AUDIO DRIVER
1739M: Clemens Ladisch <clemens@ladisch.de> 1748M: Clemens Ladisch <clemens@ladisch.de>
@@ -1804,7 +1813,7 @@ L: netdev@vger.kernel.org
1804S: Supported 1813S: Supported
1805F: Documentation/networking/caif/ 1814F: Documentation/networking/caif/
1806F: drivers/net/caif/ 1815F: drivers/net/caif/
1807F: include/linux/caif/ 1816F: include/uapi/linux/caif/
1808F: include/net/caif/ 1817F: include/net/caif/
1809F: net/caif/ 1818F: net/caif/
1810 1819
@@ -1825,11 +1834,11 @@ W: http://gitorious.org/linux-can
1825T: git git://gitorious.org/linux-can/linux-can-next.git 1834T: git git://gitorious.org/linux-can/linux-can-next.git
1826S: Maintained 1835S: Maintained
1827F: net/can/ 1836F: net/can/
1828F: include/linux/can.h
1829F: include/linux/can/core.h 1837F: include/linux/can/core.h
1830F: include/linux/can/bcm.h 1838F: include/uapi/linux/can.h
1831F: include/linux/can/raw.h 1839F: include/uapi/linux/can/bcm.h
1832F: include/linux/can/gw.h 1840F: include/uapi/linux/can/raw.h
1841F: include/uapi/linux/can/gw.h
1833 1842
1834CAN NETWORK DRIVERS 1843CAN NETWORK DRIVERS
1835M: Wolfgang Grandegger <wg@grandegger.com> 1844M: Wolfgang Grandegger <wg@grandegger.com>
@@ -1840,15 +1849,16 @@ T: git git://gitorious.org/linux-can/linux-can-next.git
1840S: Maintained 1849S: Maintained
1841F: drivers/net/can/ 1850F: drivers/net/can/
1842F: include/linux/can/dev.h 1851F: include/linux/can/dev.h
1843F: include/linux/can/error.h
1844F: include/linux/can/netlink.h
1845F: include/linux/can/platform/ 1852F: include/linux/can/platform/
1853F: include/uapi/linux/can/error.h
1854F: include/uapi/linux/can/netlink.h
1846 1855
1847CAPABILITIES 1856CAPABILITIES
1848M: Serge Hallyn <serge.hallyn@canonical.com> 1857M: Serge Hallyn <serge.hallyn@canonical.com>
1849L: linux-security-module@vger.kernel.org 1858L: linux-security-module@vger.kernel.org
1850S: Supported 1859S: Supported
1851F: include/linux/capability.h 1860F: include/linux/capability.h
1861F: include/uapi/linux/capability.h
1852F: security/capability.c 1862F: security/capability.c
1853F: security/commoncap.c 1863F: security/commoncap.c
1854F: kernel/capability.c 1864F: kernel/capability.c
@@ -1861,6 +1871,7 @@ W: http://www.ibm.com/developerworks/power/cell/
1861S: Supported 1871S: Supported
1862F: arch/powerpc/include/asm/cell*.h 1872F: arch/powerpc/include/asm/cell*.h
1863F: arch/powerpc/include/asm/spu*.h 1873F: arch/powerpc/include/asm/spu*.h
1874F: arch/powerpc/include/uapi/asm/spu*.h
1864F: arch/powerpc/oprofile/*cell* 1875F: arch/powerpc/oprofile/*cell*
1865F: arch/powerpc/platforms/cell/ 1876F: arch/powerpc/platforms/cell/
1866 1877
@@ -1909,7 +1920,7 @@ W: http://wireless.kernel.org/
1909T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git 1920T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
1910T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 1921T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
1911S: Maintained 1922S: Maintained
1912F: include/linux/nl80211.h 1923F: include/uapi/linux/nl80211.h
1913F: include/net/cfg80211.h 1924F: include/net/cfg80211.h
1914F: net/wireless/* 1925F: net/wireless/*
1915X: net/wireless/wext* 1926X: net/wireless/wext*
@@ -2012,6 +2023,7 @@ S: Maintained
2012F: Documentation/filesystems/coda.txt 2023F: Documentation/filesystems/coda.txt
2013F: fs/coda/ 2024F: fs/coda/
2014F: include/linux/coda*.h 2025F: include/linux/coda*.h
2026F: include/uapi/linux/coda*.h
2015 2027
2016COMMON CLK FRAMEWORK 2028COMMON CLK FRAMEWORK
2017M: Mike Turquette <mturquette@linaro.org> 2029M: Mike Turquette <mturquette@linaro.org>
@@ -2266,6 +2278,7 @@ W: http://www.cyclades.com/
2266S: Orphan 2278S: Orphan
2267F: drivers/tty/cyclades.c 2279F: drivers/tty/cyclades.c
2268F: include/linux/cyclades.h 2280F: include/linux/cyclades.h
2281F: include/uapi/linux/cyclades.h
2269 2282
2270CYCLADES PC300 DRIVER 2283CYCLADES PC300 DRIVER
2271W: http://www.cyclades.com/ 2284W: http://www.cyclades.com/
@@ -2323,6 +2336,7 @@ L: dccp@vger.kernel.org
2323W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp 2336W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp
2324S: Maintained 2337S: Maintained
2325F: include/linux/dccp.h 2338F: include/linux/dccp.h
2339F: include/uapi/linux/dccp.h
2326F: include/linux/tfrc.h 2340F: include/linux/tfrc.h
2327F: net/dccp/ 2341F: net/dccp/
2328 2342
@@ -2349,7 +2363,7 @@ M: Massimo Dal Zotto <dz@debian.org>
2349W: http://www.debian.org/~dz/i8k/ 2363W: http://www.debian.org/~dz/i8k/
2350S: Maintained 2364S: Maintained
2351F: drivers/char/i8k.c 2365F: drivers/char/i8k.c
2352F: include/linux/i8k.h 2366F: include/uapi/linux/i8k.h
2353 2367
2354DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas) 2368DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas)
2355M: Doug Warzecha <Douglas_Warzecha@dell.com> 2369M: Doug Warzecha <Douglas_Warzecha@dell.com>
@@ -2422,6 +2436,7 @@ S: Maintained
2422F: Documentation/filesystems/quota.txt 2436F: Documentation/filesystems/quota.txt
2423F: fs/quota/ 2437F: fs/quota/
2424F: include/linux/quota*.h 2438F: include/linux/quota*.h
2439F: include/uapi/linux/quota*.h
2425 2440
2426DISPLAYLINK USB 2.0 FRAMEBUFFER DRIVER (UDLFB) 2441DISPLAYLINK USB 2.0 FRAMEBUFFER DRIVER (UDLFB)
2427M: Bernie Thompson <bernie@plugable.com> 2442M: Bernie Thompson <bernie@plugable.com>
@@ -2528,6 +2543,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
2528S: Maintained 2543S: Maintained
2529F: drivers/gpu/drm/ 2544F: drivers/gpu/drm/
2530F: include/drm/ 2545F: include/drm/
2546F: include/uapi/drm/
2531 2547
2532INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) 2548INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
2533M: Daniel Vetter <daniel.vetter@ffwll.ch> 2549M: Daniel Vetter <daniel.vetter@ffwll.ch>
@@ -2537,6 +2553,7 @@ T: git git://people.freedesktop.org/~danvet/drm-intel
2537S: Supported 2553S: Supported
2538F: drivers/gpu/drm/i915 2554F: drivers/gpu/drm/i915
2539F: include/drm/i915* 2555F: include/drm/i915*
2556F: include/uapi/drm/i915*
2540 2557
2541DRM DRIVERS FOR EXYNOS 2558DRM DRIVERS FOR EXYNOS
2542M: Inki Dae <inki.dae@samsung.com> 2559M: Inki Dae <inki.dae@samsung.com>
@@ -2548,6 +2565,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
2548S: Supported 2565S: Supported
2549F: drivers/gpu/drm/exynos 2566F: drivers/gpu/drm/exynos
2550F: include/drm/exynos* 2567F: include/drm/exynos*
2568F: include/uapi/drm/exynos*
2551 2569
2552DRM DRIVERS FOR NVIDIA TEGRA 2570DRM DRIVERS FOR NVIDIA TEGRA
2553M: Thierry Reding <thierry.reding@avionic-design.de> 2571M: Thierry Reding <thierry.reding@avionic-design.de>
@@ -2622,7 +2640,7 @@ W: http://github.com/mkrufky
2622Q: http://patchwork.linuxtv.org/project/linux-media/list/ 2640Q: http://patchwork.linuxtv.org/project/linux-media/list/
2623T: git git://linuxtv.org/media_tree.git 2641T: git git://linuxtv.org/media_tree.git
2624S: Maintained 2642S: Maintained
2625F: drivers/media/usb/dvb-usb-v2/cxusb* 2643F: drivers/media/usb/dvb-usb/cxusb*
2626 2644
2627DVB_USB_CYPRESS_FIRMWARE MEDIA DRIVER 2645DVB_USB_CYPRESS_FIRMWARE MEDIA DRIVER
2628M: Antti Palosaari <crope@iki.fi> 2646M: Antti Palosaari <crope@iki.fi>
@@ -2722,6 +2740,7 @@ L: netfilter-devel@vger.kernel.org
2722W: http://ebtables.sourceforge.net/ 2740W: http://ebtables.sourceforge.net/
2723S: Maintained 2741S: Maintained
2724F: include/linux/netfilter_bridge/ebt_*.h 2742F: include/linux/netfilter_bridge/ebt_*.h
2743F: include/uapi/linux/netfilter_bridge/ebt_*.h
2725F: net/bridge/netfilter/ebt*.c 2744F: net/bridge/netfilter/ebt*.c
2726 2745
2727EC100 MEDIA DRIVER 2746EC100 MEDIA DRIVER
@@ -2933,12 +2952,6 @@ M: Maxim Levitsky <maximlevitsky@gmail.com>
2933S: Maintained 2952S: Maintained
2934F: drivers/media/rc/ene_ir.* 2953F: drivers/media/rc/ene_ir.*
2935 2954
2936EPSON 1355 FRAMEBUFFER DRIVER
2937M: Christopher Hoover <ch@murgatroid.com>
2938M: Christopher Hoover <ch@hpl.hp.com>
2939S: Maintained
2940F: drivers/video/epson1355fb.c
2941
2942EPSON S1D13XXX FRAMEBUFFER DRIVER 2955EPSON S1D13XXX FRAMEBUFFER DRIVER
2943M: Kristoffer Ericson <kristoffer.ericson@gmail.com> 2956M: Kristoffer Ericson <kristoffer.ericson@gmail.com>
2944S: Maintained 2957S: Maintained
@@ -3051,6 +3064,7 @@ M: Eric Paris <eparis@redhat.com>
3051S: Maintained 3064S: Maintained
3052F: fs/notify/fanotify/ 3065F: fs/notify/fanotify/
3053F: include/linux/fanotify.h 3066F: include/linux/fanotify.h
3067F: include/uapi/linux/fanotify.h
3054 3068
3055FARSYNC SYNCHRONOUS DRIVER 3069FARSYNC SYNCHRONOUS DRIVER
3056M: Kevin Curtis <kevin.curtis@farsite.co.uk> 3070M: Kevin Curtis <kevin.curtis@farsite.co.uk>
@@ -3074,6 +3088,7 @@ F: drivers/scsi/fcoe/
3074F: include/scsi/fc/ 3088F: include/scsi/fc/
3075F: include/scsi/libfc.h 3089F: include/scsi/libfc.h
3076F: include/scsi/libfcoe.h 3090F: include/scsi/libfcoe.h
3091F: include/uapi/scsi/fc/
3077 3092
3078FILE LOCKING (flock() and fcntl()/lockf()) 3093FILE LOCKING (flock() and fcntl()/lockf())
3079M: Matthew Wilcox <matthew@wil.cx> 3094M: Matthew Wilcox <matthew@wil.cx>
@@ -3081,6 +3096,8 @@ L: linux-fsdevel@vger.kernel.org
3081S: Maintained 3096S: Maintained
3082F: include/linux/fcntl.h 3097F: include/linux/fcntl.h
3083F: include/linux/fs.h 3098F: include/linux/fs.h
3099F: include/uapi/linux/fcntl.h
3100F: include/uapi/linux/fs.h
3084F: fs/fcntl.c 3101F: fs/fcntl.c
3085F: fs/locks.c 3102F: fs/locks.c
3086 3103
@@ -3170,6 +3187,8 @@ F: Documentation/devicetree/bindings/fb/
3170F: drivers/video/ 3187F: drivers/video/
3171F: include/video/ 3188F: include/video/
3172F: include/linux/fb.h 3189F: include/linux/fb.h
3190F: include/uapi/video/
3191F: include/uapi/linux/fb.h
3173 3192
3174FREESCALE DIU FRAMEBUFFER DRIVER 3193FREESCALE DIU FRAMEBUFFER DRIVER
3175M: Timur Tabi <timur@freescale.com> 3194M: Timur Tabi <timur@freescale.com>
@@ -3196,7 +3215,7 @@ M: Sascha Hauer <kernel@pengutronix.de>
3196L: linux-fbdev@vger.kernel.org 3215L: linux-fbdev@vger.kernel.org
3197L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 3216L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
3198S: Maintained 3217S: Maintained
3199F: arch/arm/plat-mxc/include/mach/imxfb.h 3218F: include/linux/platform_data/video-imxfb.h
3200F: drivers/video/imxfb.c 3219F: drivers/video/imxfb.c
3201 3220
3202FREESCALE SOC FS_ENET DRIVER 3221FREESCALE SOC FS_ENET DRIVER
@@ -3273,6 +3292,16 @@ F: Documentation/filesystems/caching/
3273F: fs/fscache/ 3292F: fs/fscache/
3274F: include/linux/fscache*.h 3293F: include/linux/fscache*.h
3275 3294
3295F2FS FILE SYSTEM
3296M: Jaegeuk Kim <jaegeuk.kim@samsung.com>
3297L: linux-f2fs-devel@lists.sourceforge.net
3298W: http://en.wikipedia.org/wiki/F2FS
3299T: git git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git
3300S: Maintained
3301F: Documentation/filesystems/f2fs.txt
3302F: fs/f2fs/
3303F: include/linux/f2fs_fs.h
3304
3276FUJITSU FR-V (FRV) PORT 3305FUJITSU FR-V (FRV) PORT
3277M: David Howells <dhowells@redhat.com> 3306M: David Howells <dhowells@redhat.com>
3278S: Maintained 3307S: Maintained
@@ -3304,7 +3333,7 @@ L: fuse-devel@lists.sourceforge.net
3304W: http://fuse.sourceforge.net/ 3333W: http://fuse.sourceforge.net/
3305S: Maintained 3334S: Maintained
3306F: fs/fuse/ 3335F: fs/fuse/
3307F: include/linux/fuse.h 3336F: include/uapi/linux/fuse.h
3308 3337
3309FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) 3338FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit)
3310M: Rik Faith <faith@cs.unc.edu> 3339M: Rik Faith <faith@cs.unc.edu>
@@ -3351,6 +3380,7 @@ L: linux-arch@vger.kernel.org
3351T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 3380T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
3352S: Maintained 3381S: Maintained
3353F: include/asm-generic 3382F: include/asm-generic
3383F: include/uapi/asm-generic
3354 3384
3355GENERIC UIO DRIVER FOR PCI DEVICES 3385GENERIC UIO DRIVER FOR PCI DEVICES
3356M: "Michael S. Tsirkin" <mst@redhat.com> 3386M: "Michael S. Tsirkin" <mst@redhat.com>
@@ -3367,7 +3397,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw.git
3367S: Supported 3397S: Supported
3368F: Documentation/filesystems/gfs2*.txt 3398F: Documentation/filesystems/gfs2*.txt
3369F: fs/gfs2/ 3399F: fs/gfs2/
3370F: include/linux/gfs2_ondisk.h 3400F: include/uapi/linux/gfs2_ondisk.h
3371 3401
3372GIGASET ISDN DRIVERS 3402GIGASET ISDN DRIVERS
3373M: Hansjoerg Lipp <hjlipp@web.de> 3403M: Hansjoerg Lipp <hjlipp@web.de>
@@ -3377,7 +3407,7 @@ W: http://gigaset307x.sourceforge.net/
3377S: Maintained 3407S: Maintained
3378F: Documentation/isdn/README.gigaset 3408F: Documentation/isdn/README.gigaset
3379F: drivers/isdn/gigaset/ 3409F: drivers/isdn/gigaset/
3380F: include/linux/gigaset_dev.h 3410F: include/uapi/linux/gigaset_dev.h
3381 3411
3382GPIO SUBSYSTEM 3412GPIO SUBSYSTEM
3383M: Grant Likely <grant.likely@secretlab.ca> 3413M: Grant Likely <grant.likely@secretlab.ca>
@@ -3534,6 +3564,7 @@ S: Supported
3534F: Documentation/scsi/hpsa.txt 3564F: Documentation/scsi/hpsa.txt
3535F: drivers/scsi/hpsa*.[ch] 3565F: drivers/scsi/hpsa*.[ch]
3536F: include/linux/cciss*.h 3566F: include/linux/cciss*.h
3567F: include/uapi/linux/cciss*.h
3537 3568
3538HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) 3569HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
3539M: Mike Miller <mike.miller@hp.com> 3570M: Mike Miller <mike.miller@hp.com>
@@ -3542,6 +3573,7 @@ S: Supported
3542F: Documentation/blockdev/cciss.txt 3573F: Documentation/blockdev/cciss.txt
3543F: drivers/block/cciss* 3574F: drivers/block/cciss*
3544F: include/linux/cciss_ioctl.h 3575F: include/linux/cciss_ioctl.h
3576F: include/uapi/linux/cciss_ioctl.h
3545 3577
3546HFS FILESYSTEM 3578HFS FILESYSTEM
3547L: linux-fsdevel@vger.kernel.org 3579L: linux-fsdevel@vger.kernel.org
@@ -3576,6 +3608,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
3576S: Maintained 3608S: Maintained
3577F: drivers/hid/ 3609F: drivers/hid/
3578F: include/linux/hid* 3610F: include/linux/hid*
3611F: include/uapi/linux/hid*
3579 3612
3580HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 3613HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS
3581M: Thomas Gleixner <tglx@linutronix.de> 3614M: Thomas Gleixner <tglx@linutronix.de>
@@ -3607,7 +3640,7 @@ M: Jes Sorensen <jes@trained-monkey.org>
3607L: linux-hippi@sunsite.dk 3640L: linux-hippi@sunsite.dk
3608S: Maintained 3641S: Maintained
3609F: include/linux/hippidevice.h 3642F: include/linux/hippidevice.h
3610F: include/linux/if_hippi.h 3643F: include/uapi/linux/if_hippi.h
3611F: net/802/hippi.c 3644F: net/802/hippi.c
3612F: drivers/net/hippi/ 3645F: drivers/net/hippi/
3613 3646
@@ -3635,6 +3668,7 @@ S: Maintained
3635F: Documentation/timers/hpet.txt 3668F: Documentation/timers/hpet.txt
3636F: drivers/char/hpet.c 3669F: drivers/char/hpet.c
3637F: include/linux/hpet.h 3670F: include/linux/hpet.h
3671F: include/uapi/linux/hpet.h
3638 3672
3639HPET: x86 3673HPET: x86
3640M: "Venkatesh Pallipadi (Venki)" <venki@google.com> 3674M: "Venkatesh Pallipadi (Venki)" <venki@google.com>
@@ -3735,6 +3769,8 @@ F: Documentation/i2c/
3735F: drivers/i2c/ 3769F: drivers/i2c/
3736F: include/linux/i2c.h 3770F: include/linux/i2c.h
3737F: include/linux/i2c-*.h 3771F: include/linux/i2c-*.h
3772F: include/uapi/linux/i2c.h
3773F: include/uapi/linux/i2c-*.h
3738 3774
3739I2C-TAOS-EVM DRIVER 3775I2C-TAOS-EVM DRIVER
3740M: Jean Delvare <khali@linux-fr.org> 3776M: Jean Delvare <khali@linux-fr.org>
@@ -3850,7 +3886,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git
3850S: Maintained 3886S: Maintained
3851F: net/ieee802154/ 3887F: net/ieee802154/
3852F: net/mac802154/ 3888F: net/mac802154/
3853F: drivers/ieee802154/ 3889F: drivers/net/ieee802154/
3854 3890
3855IGUANAWORKS USB IR TRANSCEIVER 3891IGUANAWORKS USB IR TRANSCEIVER
3856M: Sean Young <sean@mess.org> 3892M: Sean Young <sean@mess.org>
@@ -3901,7 +3937,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
3901S: Supported 3937S: Supported
3902F: Documentation/infiniband/ 3938F: Documentation/infiniband/
3903F: drivers/infiniband/ 3939F: drivers/infiniband/
3904F: include/linux/if_infiniband.h 3940F: include/uapi/linux/if_infiniband.h
3905 3941
3906INOTIFY 3942INOTIFY
3907M: John McCutchan <john@johnmccutchan.com> 3943M: John McCutchan <john@johnmccutchan.com>
@@ -3911,6 +3947,7 @@ S: Maintained
3911F: Documentation/filesystems/inotify.txt 3947F: Documentation/filesystems/inotify.txt
3912F: fs/notify/inotify/ 3948F: fs/notify/inotify/
3913F: include/linux/inotify.h 3949F: include/linux/inotify.h
3950F: include/uapi/linux/inotify.h
3914 3951
3915INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS 3952INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
3916M: Dmitry Torokhov <dmitry.torokhov@gmail.com> 3953M: Dmitry Torokhov <dmitry.torokhov@gmail.com>
@@ -3921,6 +3958,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
3921S: Maintained 3958S: Maintained
3922F: drivers/input/ 3959F: drivers/input/
3923F: include/linux/input.h 3960F: include/linux/input.h
3961F: include/uapi/linux/input.h
3924F: include/linux/input/ 3962F: include/linux/input/
3925 3963
3926INPUT MULTITOUCH (MT) PROTOCOL 3964INPUT MULTITOUCH (MT) PROTOCOL
@@ -3941,7 +3979,6 @@ L: linux-scsi@vger.kernel.org
3941T: git git://git.code.sf.net/p/intel-sas/isci 3979T: git git://git.code.sf.net/p/intel-sas/isci
3942S: Supported 3980S: Supported
3943F: drivers/scsi/isci/ 3981F: drivers/scsi/isci/
3944F: firmware/isci/
3945 3982
3946INTEL IDLE DRIVER 3983INTEL IDLE DRIVER
3947M: Len Brown <lenb@kernel.org> 3984M: Len Brown <lenb@kernel.org>
@@ -4036,12 +4073,6 @@ F: Documentation/networking/ixgbe.txt
4036F: Documentation/networking/ixgbevf.txt 4073F: Documentation/networking/ixgbevf.txt
4037F: drivers/net/ethernet/intel/ 4074F: drivers/net/ethernet/intel/
4038 4075
4039INTEL MRST PMU DRIVER
4040M: Len Brown <len.brown@intel.com>
4041L: linux-pm@vger.kernel.org
4042S: Supported
4043F: arch/x86/platform/mrst/pmu.*
4044
4045INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT 4076INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
4046M: Stanislav Yakovlev <stas.yakovlev@gmail.com> 4077M: Stanislav Yakovlev <stas.yakovlev@gmail.com>
4047L: linux-wireless@vger.kernel.org 4078L: linux-wireless@vger.kernel.org
@@ -4070,7 +4101,7 @@ S: Supported
4070W: http://linuxwimax.org 4101W: http://linuxwimax.org
4071F: Documentation/wimax/README.i2400m 4102F: Documentation/wimax/README.i2400m
4072F: drivers/net/wimax/i2400m/ 4103F: drivers/net/wimax/i2400m/
4073F: include/linux/wimax/i2400m.h 4104F: include/uapi/linux/wimax/i2400m.h
4074 4105
4075INTEL WIRELESS 3945ABG/BG, 4965AGN (iwlegacy) 4106INTEL WIRELESS 3945ABG/BG, 4965AGN (iwlegacy)
4076M: Stanislaw Gruszka <sgruszka@redhat.com> 4107M: Stanislaw Gruszka <sgruszka@redhat.com>
@@ -4092,9 +4123,9 @@ INTEL MANAGEMENT ENGINE (mei)
4092M: Tomas Winkler <tomas.winkler@intel.com> 4123M: Tomas Winkler <tomas.winkler@intel.com>
4093L: linux-kernel@vger.kernel.org 4124L: linux-kernel@vger.kernel.org
4094S: Supported 4125S: Supported
4095F: include/linux/mei.h 4126F: include/uapi/linux/mei.h
4096F: drivers/misc/mei/* 4127F: drivers/misc/mei/*
4097F: Documentation/mei/* 4128F: Documentation/misc-devices/mei/*
4098 4129
4099IOC3 ETHERNET DRIVER 4130IOC3 ETHERNET DRIVER
4100M: Ralf Baechle <ralf@linux-mips.org> 4131M: Ralf Baechle <ralf@linux-mips.org>
@@ -4134,6 +4165,7 @@ S: Supported
4134F: Documentation/IPMI.txt 4165F: Documentation/IPMI.txt
4135F: drivers/char/ipmi/ 4166F: drivers/char/ipmi/
4136F: include/linux/ipmi* 4167F: include/linux/ipmi*
4168F: include/uapi/linux/ipmi*
4137 4169
4138IPS SCSI RAID DRIVER 4170IPS SCSI RAID DRIVER
4139M: Adaptec OEM Raid Solutions <aacraid@adaptec.com> 4171M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
@@ -4151,7 +4183,7 @@ L: lvs-devel@vger.kernel.org
4151S: Maintained 4183S: Maintained
4152F: Documentation/networking/ipvs-sysctl.txt 4184F: Documentation/networking/ipvs-sysctl.txt
4153F: include/net/ip_vs.h 4185F: include/net/ip_vs.h
4154F: include/linux/ip_vs.h 4186F: include/uapi/linux/ip_vs.h
4155F: net/netfilter/ipvs/ 4187F: net/netfilter/ipvs/
4156 4188
4157IPWIRELESS DRIVER 4189IPWIRELESS DRIVER
@@ -4164,8 +4196,8 @@ IPX NETWORK LAYER
4164M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 4196M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
4165L: netdev@vger.kernel.org 4197L: netdev@vger.kernel.org
4166S: Maintained 4198S: Maintained
4167F: include/linux/ipx.h
4168F: include/net/ipx.h 4199F: include/net/ipx.h
4200F: include/uapi/linux/ipx.h
4169F: net/ipx/ 4201F: net/ipx/
4170 4202
4171IRDA SUBSYSTEM 4203IRDA SUBSYSTEM
@@ -4228,6 +4260,8 @@ F: Documentation/isdn/
4228F: drivers/isdn/ 4260F: drivers/isdn/
4229F: include/linux/isdn.h 4261F: include/linux/isdn.h
4230F: include/linux/isdn/ 4262F: include/linux/isdn/
4263F: include/uapi/linux/isdn.h
4264F: include/uapi/linux/isdn/
4231 4265
4232ISDN SUBSYSTEM (Eicon active card driver) 4266ISDN SUBSYSTEM (Eicon active card driver)
4233M: Armin Schindler <mac@melware.de> 4267M: Armin Schindler <mac@melware.de>
@@ -4268,7 +4302,7 @@ W: http://www.ivtvdriver.org
4268S: Maintained 4302S: Maintained
4269F: Documentation/video4linux/*.ivtv 4303F: Documentation/video4linux/*.ivtv
4270F: drivers/media/pci/ivtv/ 4304F: drivers/media/pci/ivtv/
4271F: include/linux/ivtv* 4305F: include/uapi/linux/ivtv*
4272 4306
4273IX2505V MEDIA DRIVER 4307IX2505V MEDIA DRIVER
4274M: Malcolm Priestley <tvboxspy@gmail.com> 4308M: Malcolm Priestley <tvboxspy@gmail.com>
@@ -4306,7 +4340,7 @@ L: linux-mtd@lists.infradead.org
4306W: http://www.linux-mtd.infradead.org/doc/jffs2.html 4340W: http://www.linux-mtd.infradead.org/doc/jffs2.html
4307S: Maintained 4341S: Maintained
4308F: fs/jffs2/ 4342F: fs/jffs2/
4309F: include/linux/jffs2.h 4343F: include/uapi/linux/jffs2.h
4310 4344
4311JOURNALLING LAYER FOR BLOCK DEVICES (JBD) 4345JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
4312M: Andrew Morton <akpm@linux-foundation.org> 4346M: Andrew Morton <akpm@linux-foundation.org>
@@ -4389,11 +4423,13 @@ W: http://nfs.sourceforge.net/
4389S: Supported 4423S: Supported
4390F: fs/nfsd/ 4424F: fs/nfsd/
4391F: include/linux/nfsd/ 4425F: include/linux/nfsd/
4426F: include/uapi/linux/nfsd/
4392F: fs/lockd/ 4427F: fs/lockd/
4393F: fs/nfs_common/ 4428F: fs/nfs_common/
4394F: net/sunrpc/ 4429F: net/sunrpc/
4395F: include/linux/lockd/ 4430F: include/linux/lockd/
4396F: include/linux/sunrpc/ 4431F: include/linux/sunrpc/
4432F: include/uapi/linux/sunrpc/
4397 4433
4398KERNEL VIRTUAL MACHINE (KVM) 4434KERNEL VIRTUAL MACHINE (KVM)
4399M: Marcelo Tosatti <mtosatti@redhat.com> 4435M: Marcelo Tosatti <mtosatti@redhat.com>
@@ -4405,6 +4441,7 @@ F: Documentation/*/kvm.txt
4405F: arch/*/kvm/ 4441F: arch/*/kvm/
4406F: arch/*/include/asm/kvm* 4442F: arch/*/include/asm/kvm*
4407F: include/linux/kvm* 4443F: include/linux/kvm*
4444F: include/uapi/linux/kvm*
4408F: virt/kvm/ 4445F: virt/kvm/
4409 4446
4410KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V 4447KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
@@ -4451,6 +4488,7 @@ W: http://kernel.org/pub/linux/utils/kernel/kexec/
4451L: kexec@lists.infradead.org 4488L: kexec@lists.infradead.org
4452S: Maintained 4489S: Maintained
4453F: include/linux/kexec.h 4490F: include/linux/kexec.h
4491F: include/uapi/linux/kexec.h
4454F: kernel/kexec.c 4492F: kernel/kexec.c
4455 4493
4456KEYS/KEYRINGS: 4494KEYS/KEYRINGS:
@@ -4692,6 +4730,7 @@ LLC (802.2)
4692M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 4730M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
4693S: Maintained 4731S: Maintained
4694F: include/linux/llc.h 4732F: include/linux/llc.h
4733F: include/uapi/linux/llc.h
4695F: include/net/llc* 4734F: include/net/llc*
4696F: net/llc/ 4735F: net/llc/
4697 4736
@@ -4912,7 +4951,7 @@ MATROX FRAMEBUFFER DRIVER
4912L: linux-fbdev@vger.kernel.org 4951L: linux-fbdev@vger.kernel.org
4913S: Orphan 4952S: Orphan
4914F: drivers/video/matrox/matroxfb_* 4953F: drivers/video/matrox/matroxfb_*
4915F: include/linux/matroxfb.h 4954F: include/uapi/linux/matroxfb.h
4916 4955
4917MAX16065 HARDWARE MONITOR DRIVER 4956MAX16065 HARDWARE MONITOR DRIVER
4918M: Guenter Roeck <linux@roeck-us.net> 4957M: Guenter Roeck <linux@roeck-us.net>
@@ -4994,7 +5033,7 @@ T: git git://git.infradead.org/mtd-2.6.git
4994S: Maintained 5033S: Maintained
4995F: drivers/mtd/ 5034F: drivers/mtd/
4996F: include/linux/mtd/ 5035F: include/linux/mtd/
4997F: include/mtd/ 5036F: include/uapi/mtd/
4998 5037
4999MICROBLAZE ARCHITECTURE 5038MICROBLAZE ARCHITECTURE
5000M: Michal Simek <monstr@monstr.eu> 5039M: Michal Simek <monstr@monstr.eu>
@@ -5032,12 +5071,6 @@ F: Documentation/video4linux/meye.txt
5032F: drivers/media/pci/meye/ 5071F: drivers/media/pci/meye/
5033F: include/uapi/linux/meye.h 5072F: include/uapi/linux/meye.h
5034 5073
5035MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
5036M: Pavel Pisa <ppisa@pikron.com>
5037L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
5038S: Maintained
5039F: drivers/mmc/host/imxmmc.*
5040
5041MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 5074MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
5042M: Jiri Slaby <jirislaby@gmail.com> 5075M: Jiri Slaby <jirislaby@gmail.com>
5043S: Maintained 5076S: Maintained
@@ -5052,7 +5085,7 @@ S: Maintained
5052F: drivers/media/radio/radio-mr800.c 5085F: drivers/media/radio/radio-mr800.c
5053 5086
5054MSI LAPTOP SUPPORT 5087MSI LAPTOP SUPPORT
5055M: "Lee, Chun-Yi" <jlee@novell.com> 5088M: "Lee, Chun-Yi" <jlee@suse.com>
5056L: platform-driver-x86@vger.kernel.org 5089L: platform-driver-x86@vger.kernel.org
5057S: Maintained 5090S: Maintained
5058F: drivers/platform/x86/msi-laptop.c 5091F: drivers/platform/x86/msi-laptop.c
@@ -5076,6 +5109,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
5076S: Maintained 5109S: Maintained
5077F: drivers/mmc/ 5110F: drivers/mmc/
5078F: include/linux/mmc/ 5111F: include/linux/mmc/
5112F: include/uapi/linux/mmc/
5079 5113
5080MULTIMEDIA CARD (MMC) ETC. OVER SPI 5114MULTIMEDIA CARD (MMC) ETC. OVER SPI
5081S: Orphan 5115S: Orphan
@@ -5176,6 +5210,8 @@ S: Supported
5176F: include/linux/netfilter* 5210F: include/linux/netfilter*
5177F: include/linux/netfilter/ 5211F: include/linux/netfilter/
5178F: include/net/netfilter/ 5212F: include/net/netfilter/
5213F: include/uapi/linux/netfilter*
5214F: include/uapi/linux/netfilter/
5179F: net/*/netfilter.c 5215F: net/*/netfilter.c
5180F: net/*/netfilter/ 5216F: net/*/netfilter/
5181F: net/netfilter/ 5217F: net/netfilter/
@@ -5194,8 +5230,8 @@ M: Ralf Baechle <ralf@linux-mips.org>
5194L: linux-hams@vger.kernel.org 5230L: linux-hams@vger.kernel.org
5195W: http://www.linux-ax25.org/ 5231W: http://www.linux-ax25.org/
5196S: Maintained 5232S: Maintained
5197F: include/linux/netrom.h
5198F: include/net/netrom.h 5233F: include/net/netrom.h
5234F: include/uapi/linux/netrom.h
5199F: net/netrom/ 5235F: net/netrom/
5200 5236
5201NETWORK BLOCK DEVICE (NBD) 5237NETWORK BLOCK DEVICE (NBD)
@@ -5204,6 +5240,7 @@ S: Maintained
5204F: Documentation/blockdev/nbd.txt 5240F: Documentation/blockdev/nbd.txt
5205F: drivers/block/nbd.c 5241F: drivers/block/nbd.c
5206F: include/linux/nbd.h 5242F: include/linux/nbd.h
5243F: include/uapi/linux/nbd.h
5207 5244
5208NETWORK DROP MONITOR 5245NETWORK DROP MONITOR
5209M: Neil Horman <nhorman@tuxdriver.com> 5246M: Neil Horman <nhorman@tuxdriver.com>
@@ -5225,6 +5262,9 @@ F: include/net/
5225F: include/linux/in.h 5262F: include/linux/in.h
5226F: include/linux/net.h 5263F: include/linux/net.h
5227F: include/linux/netdevice.h 5264F: include/linux/netdevice.h
5265F: include/uapi/linux/in.h
5266F: include/uapi/linux/net.h
5267F: include/uapi/linux/netdevice.h
5228 5268
5229NETWORKING [IPv4/IPv6] 5269NETWORKING [IPv4/IPv6]
5230M: "David S. Miller" <davem@davemloft.net> 5270M: "David S. Miller" <davem@davemloft.net>
@@ -5270,6 +5310,7 @@ F: net/rfkill/
5270F: net/wireless/ 5310F: net/wireless/
5271F: include/net/ieee80211* 5311F: include/net/ieee80211*
5272F: include/linux/wireless.h 5312F: include/linux/wireless.h
5313F: include/uapi/linux/wireless.h
5273F: include/net/iw_handler.h 5314F: include/net/iw_handler.h
5274F: drivers/net/wireless/ 5315F: drivers/net/wireless/
5275 5316
@@ -5289,6 +5330,8 @@ F: include/linux/fcdevice.h
5289F: include/linux/fddidevice.h 5330F: include/linux/fddidevice.h
5290F: include/linux/hippidevice.h 5331F: include/linux/hippidevice.h
5291F: include/linux/inetdevice.h 5332F: include/linux/inetdevice.h
5333F: include/uapi/linux/if_*
5334F: include/uapi/linux/netdevice.h
5292 5335
5293NETXEN (1/10) GbE SUPPORT 5336NETXEN (1/10) GbE SUPPORT
5294M: Sony Chacko <sony.chacko@qlogic.com> 5337M: Sony Chacko <sony.chacko@qlogic.com>
@@ -5306,8 +5349,8 @@ L: linux-wireless@vger.kernel.org
5306L: linux-nfc@lists.01.org (moderated for non-subscribers) 5349L: linux-nfc@lists.01.org (moderated for non-subscribers)
5307S: Maintained 5350S: Maintained
5308F: net/nfc/ 5351F: net/nfc/
5309F: include/linux/nfc.h
5310F: include/net/nfc/ 5352F: include/net/nfc/
5353F: include/uapi/linux/nfc.h
5311F: drivers/nfc/ 5354F: drivers/nfc/
5312F: include/linux/platform_data/pn544.h 5355F: include/linux/platform_data/pn544.h
5313 5356
@@ -5324,6 +5367,8 @@ F: net/sunrpc/
5324F: include/linux/lockd/ 5367F: include/linux/lockd/
5325F: include/linux/nfs* 5368F: include/linux/nfs*
5326F: include/linux/sunrpc/ 5369F: include/linux/sunrpc/
5370F: include/uapi/linux/nfs*
5371F: include/uapi/linux/sunrpc/
5327 5372
5328NI5010 NETWORK DRIVER 5373NI5010 NETWORK DRIVER
5329M: Jan-Pascal van Best <janpascal@vanbest.org> 5374M: Jan-Pascal van Best <janpascal@vanbest.org>
@@ -5470,8 +5515,7 @@ M: Benoît Cousson <b-cousson@ti.com>
5470M: Paul Walmsley <paul@pwsan.com> 5515M: Paul Walmsley <paul@pwsan.com>
5471L: linux-omap@vger.kernel.org 5516L: linux-omap@vger.kernel.org
5472S: Maintained 5517S: Maintained
5473F: arch/arm/mach-omap2/omap_hwmod.c 5518F: arch/arm/mach-omap2/omap_hwmod.*
5474F: arch/arm/plat-omap/include/plat/omap_hwmod.h
5475 5519
5476OMAP HWMOD DATA FOR OMAP4-BASED DEVICES 5520OMAP HWMOD DATA FOR OMAP4-BASED DEVICES
5477M: Benoît Cousson <b-cousson@ti.com> 5521M: Benoît Cousson <b-cousson@ti.com>
@@ -5513,6 +5557,7 @@ M: Harald Welte <laforge@gnumonks.org>
5513S: Maintained 5557S: Maintained
5514F: drivers/char/pcmcia/cm4000_cs.c 5558F: drivers/char/pcmcia/cm4000_cs.c
5515F: include/linux/cm4000_cs.h 5559F: include/linux/cm4000_cs.h
5560F: include/uapi/linux/cm4000_cs.h
5516 5561
5517OMNIKEY CARDMAN 4040 DRIVER 5562OMNIKEY CARDMAN 4040 DRIVER
5518M: Harald Welte <laforge@gnumonks.org> 5563M: Harald Welte <laforge@gnumonks.org>
@@ -5671,7 +5716,7 @@ S: Orphan
5671F: drivers/parport/ 5716F: drivers/parport/
5672F: include/linux/parport*.h 5717F: include/linux/parport*.h
5673F: drivers/char/ppdev.c 5718F: drivers/char/ppdev.c
5674F: include/linux/ppdev.h 5719F: include/uapi/linux/ppdev.h
5675 5720
5676PARAVIRT_OPS INTERFACE 5721PARAVIRT_OPS INTERFACE
5677M: Jeremy Fitzhardinge <jeremy@goop.org> 5722M: Jeremy Fitzhardinge <jeremy@goop.org>
@@ -5812,11 +5857,11 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
5812S: Supported 5857S: Supported
5813F: kernel/events/* 5858F: kernel/events/*
5814F: include/linux/perf_event.h 5859F: include/linux/perf_event.h
5860F: include/uapi/linux/perf_event.h
5815F: arch/*/kernel/perf_event*.c 5861F: arch/*/kernel/perf_event*.c
5816F: arch/*/kernel/*/perf_event*.c 5862F: arch/*/kernel/*/perf_event*.c
5817F: arch/*/kernel/*/*/perf_event*.c 5863F: arch/*/kernel/*/*/perf_event*.c
5818F: arch/*/include/asm/perf_event.h 5864F: arch/*/include/asm/perf_event.h
5819F: arch/*/lib/perf_event*.c
5820F: arch/*/kernel/perf_callchain.c 5865F: arch/*/kernel/perf_callchain.c
5821F: tools/perf/ 5866F: tools/perf/
5822 5867
@@ -5825,6 +5870,7 @@ M: Christoph Hellwig <hch@infradead.org>
5825L: linux-abi-devel@lists.sourceforge.net 5870L: linux-abi-devel@lists.sourceforge.net
5826S: Maintained 5871S: Maintained
5827F: include/linux/personality.h 5872F: include/linux/personality.h
5873F: include/uapi/linux/personality.h
5828 5874
5829PHONET PROTOCOL 5875PHONET PROTOCOL
5830M: Remi Denis-Courmont <courmisch@gmail.com> 5876M: Remi Denis-Courmont <courmisch@gmail.com>
@@ -5832,6 +5878,7 @@ S: Supported
5832F: Documentation/networking/phonet.txt 5878F: Documentation/networking/phonet.txt
5833F: include/linux/phonet.h 5879F: include/linux/phonet.h
5834F: include/net/phonet/ 5880F: include/net/phonet/
5881F: include/uapi/linux/phonet.h
5835F: net/phonet/ 5882F: net/phonet/
5836 5883
5837PHRAM MTD DRIVER 5884PHRAM MTD DRIVER
@@ -5880,6 +5927,7 @@ M: Jiri Kosina <jkosina@suse.cz>
5880S: Maintained 5927S: Maintained
5881F: drivers/block/pktcdvd.c 5928F: drivers/block/pktcdvd.c
5882F: include/linux/pktcdvd.h 5929F: include/linux/pktcdvd.h
5930F: include/uapi/linux/pktcdvd.h
5883 5931
5884PKUNITY SOC DRIVERS 5932PKUNITY SOC DRIVERS
5885M: Guan Xuetao <gxt@mprc.pku.edu.cn> 5933M: Guan Xuetao <gxt@mprc.pku.edu.cn>
@@ -5954,7 +6002,7 @@ PPP OVER ATM (RFC 2364)
5954M: Mitchell Blank Jr <mitch@sfgoth.com> 6002M: Mitchell Blank Jr <mitch@sfgoth.com>
5955S: Maintained 6003S: Maintained
5956F: net/atm/pppoatm.c 6004F: net/atm/pppoatm.c
5957F: include/linux/atmppp.h 6005F: include/uapi/linux/atmppp.h
5958 6006
5959PPP OVER ETHERNET 6007PPP OVER ETHERNET
5960M: Michal Ostrowski <mostrows@earthlink.net> 6008M: Michal Ostrowski <mostrows@earthlink.net>
@@ -5967,6 +6015,7 @@ M: James Chapman <jchapman@katalix.com>
5967S: Maintained 6015S: Maintained
5968F: net/l2tp/l2tp_ppp.c 6016F: net/l2tp/l2tp_ppp.c
5969F: include/linux/if_pppol2tp.h 6017F: include/linux/if_pppol2tp.h
6018F: include/uapi/linux/if_pppol2tp.h
5970 6019
5971PPS SUPPORT 6020PPS SUPPORT
5972M: Rodolfo Giometti <giometti@enneenne.com> 6021M: Rodolfo Giometti <giometti@enneenne.com>
@@ -6064,6 +6113,7 @@ F: include/asm-generic/syscall.h
6064F: include/linux/ptrace.h 6113F: include/linux/ptrace.h
6065F: include/linux/regset.h 6114F: include/linux/regset.h
6066F: include/linux/tracehook.h 6115F: include/linux/tracehook.h
6116F: include/uapi/linux/ptrace.h
6067F: kernel/ptrace.c 6117F: kernel/ptrace.c
6068 6118
6069PVRUSB2 VIDEO4LINUX DRIVER 6119PVRUSB2 VIDEO4LINUX DRIVER
@@ -6092,7 +6142,6 @@ T: git git://gitorious.org/linux-pwm/linux-pwm.git
6092F: Documentation/pwm.txt 6142F: Documentation/pwm.txt
6093F: Documentation/devicetree/bindings/pwm/ 6143F: Documentation/devicetree/bindings/pwm/
6094F: include/linux/pwm.h 6144F: include/linux/pwm.h
6095F: include/linux/of_pwm.h
6096F: drivers/pwm/ 6145F: drivers/pwm/
6097F: drivers/video/backlight/pwm_bl.c 6146F: drivers/video/backlight/pwm_bl.c
6098F: include/linux/pwm_backlight.h 6147F: include/linux/pwm_backlight.h
@@ -6188,8 +6237,8 @@ M: Anders Larsen <al@alarsen.net>
6188W: http://www.alarsen.net/linux/qnx4fs/ 6237W: http://www.alarsen.net/linux/qnx4fs/
6189S: Maintained 6238S: Maintained
6190F: fs/qnx4/ 6239F: fs/qnx4/
6191F: include/linux/qnx4_fs.h 6240F: include/uapi/linux/qnx4_fs.h
6192F: include/linux/qnxtypes.h 6241F: include/uapi/linux/qnxtypes.h
6193 6242
6194QT1010 MEDIA DRIVER 6243QT1010 MEDIA DRIVER
6195M: Antti Palosaari <crope@iki.fi> 6244M: Antti Palosaari <crope@iki.fi>
@@ -6223,7 +6272,7 @@ M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
6223L: linux-fbdev@vger.kernel.org 6272L: linux-fbdev@vger.kernel.org
6224S: Maintained 6273S: Maintained
6225F: drivers/video/aty/radeon* 6274F: drivers/video/aty/radeon*
6226F: include/linux/radeonfb.h 6275F: include/uapi/linux/radeonfb.h
6227 6276
6228RADIOSHARK RADIO DRIVER 6277RADIOSHARK RADIO DRIVER
6229M: Hans de Goede <hdegoede@redhat.com> 6278M: Hans de Goede <hdegoede@redhat.com>
@@ -6324,6 +6373,7 @@ S: Maintained
6324F: Documentation/rtc.txt 6373F: Documentation/rtc.txt
6325F: drivers/rtc/ 6374F: drivers/rtc/
6326F: include/linux/rtc.h 6375F: include/linux/rtc.h
6376F: include/uapi/linux/rtc.h
6327 6377
6328REISERFS FILE SYSTEM 6378REISERFS FILE SYSTEM
6329L: reiserfs-devel@vger.kernel.org 6379L: reiserfs-devel@vger.kernel.org
@@ -6378,8 +6428,8 @@ M: Ralf Baechle <ralf@linux-mips.org>
6378L: linux-hams@vger.kernel.org 6428L: linux-hams@vger.kernel.org
6379W: http://www.linux-ax25.org/ 6429W: http://www.linux-ax25.org/
6380S: Maintained 6430S: Maintained
6381F: include/linux/rose.h
6382F: include/net/rose.h 6431F: include/net/rose.h
6432F: include/uapi/linux/rose.h
6383F: net/rose/ 6433F: net/rose/
6384 6434
6385RTL2830 MEDIA DRIVER 6435RTL2830 MEDIA DRIVER
@@ -6556,6 +6606,8 @@ S: Supported
6556F: include/linux/clocksource.h 6606F: include/linux/clocksource.h
6557F: include/linux/time.h 6607F: include/linux/time.h
6558F: include/linux/timex.h 6608F: include/linux/timex.h
6609F: include/uapi/linux/time.h
6610F: include/uapi/linux/timex.h
6559F: kernel/time/clocksource.c 6611F: kernel/time/clocksource.c
6560F: kernel/time/time*.c 6612F: kernel/time/time*.c
6561F: kernel/time/ntp.c 6613F: kernel/time/ntp.c
@@ -6580,6 +6632,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
6580S: Maintained 6632S: Maintained
6581F: kernel/sched/ 6633F: kernel/sched/
6582F: include/linux/sched.h 6634F: include/linux/sched.h
6635F: include/uapi/linux/sched.h
6583 6636
6584SCORE ARCHITECTURE 6637SCORE ARCHITECTURE
6585M: Chen Liqin <liqin.chen@sunplusct.com> 6638M: Chen Liqin <liqin.chen@sunplusct.com>
@@ -6733,7 +6786,7 @@ SENSABLE PHANTOM
6733M: Jiri Slaby <jirislaby@gmail.com> 6786M: Jiri Slaby <jirislaby@gmail.com>
6734S: Maintained 6787S: Maintained
6735F: drivers/misc/phantom.c 6788F: drivers/misc/phantom.c
6736F: include/linux/phantom.h 6789F: include/uapi/linux/phantom.h
6737 6790
6738SERIAL ATA (SATA) SUBSYSTEM 6791SERIAL ATA (SATA) SUBSYSTEM
6739M: Jeff Garzik <jgarzik@pobox.com> 6792M: Jeff Garzik <jgarzik@pobox.com>
@@ -6991,6 +7044,7 @@ L: linux-raid@vger.kernel.org
6991S: Supported 7044S: Supported
6992F: drivers/md/ 7045F: drivers/md/
6993F: include/linux/raid/ 7046F: include/linux/raid/
7047F: include/uapi/linux/raid/
6994 7048
6995SONIC NETWORK DRIVER 7049SONIC NETWORK DRIVER
6996M: Thomas Bogendoerfer <tsbogend@alpha.franken.de> 7050M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
@@ -7031,6 +7085,7 @@ T: git git://git.alsa-project.org/alsa-kernel.git
7031S: Maintained 7085S: Maintained
7032F: Documentation/sound/ 7086F: Documentation/sound/
7033F: include/sound/ 7087F: include/sound/
7088F: include/uapi/sound/
7034F: sound/ 7089F: sound/
7035 7090
7036SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 7091SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
@@ -7131,6 +7186,7 @@ S: Maintained
7131F: Documentation/spi/ 7186F: Documentation/spi/
7132F: drivers/spi/ 7187F: drivers/spi/
7133F: include/linux/spi/ 7188F: include/linux/spi/
7189F: include/uapi/linux/spi/
7134 7190
7135SPIDERNET NETWORK DRIVER for CELL 7191SPIDERNET NETWORK DRIVER for CELL
7136M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp> 7192M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
@@ -7267,7 +7323,7 @@ F: drivers/staging/rtl8712/
7267STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER 7323STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER
7268M: Teddy Wang <teddy.wang@siliconmotion.com.cn> 7324M: Teddy Wang <teddy.wang@siliconmotion.com.cn>
7269S: Odd Fixes 7325S: Odd Fixes
7270F: drivers/staging/sm7xx/ 7326F: drivers/staging/sm7xxfb/
7271 7327
7272STAGING - SOFTLOGIC 6x10 MPEG CODEC 7328STAGING - SOFTLOGIC 6x10 MPEG CODEC
7273M: Ben Collins <bcollins@bluecherry.net> 7329M: Ben Collins <bcollins@bluecherry.net>
@@ -7285,7 +7341,7 @@ S: Odd Fixes
7285F: drivers/staging/speakup/ 7341F: drivers/staging/speakup/
7286 7342
7287STAGING - TI DSP BRIDGE DRIVERS 7343STAGING - TI DSP BRIDGE DRIVERS
7288M: Omar Ramirez Luna <omar.ramirez@ti.com> 7344M: Omar Ramirez Luna <omar.ramirez@copitl.com>
7289S: Odd Fixes 7345S: Odd Fixes
7290F: drivers/staging/tidspbridge/ 7346F: drivers/staging/tidspbridge/
7291 7347
@@ -7393,8 +7449,8 @@ TC CLASSIFIER
7393M: Jamal Hadi Salim <jhs@mojatatu.com> 7449M: Jamal Hadi Salim <jhs@mojatatu.com>
7394L: netdev@vger.kernel.org 7450L: netdev@vger.kernel.org
7395S: Maintained 7451S: Maintained
7396F: include/linux/pkt_cls.h
7397F: include/net/pkt_cls.h 7452F: include/net/pkt_cls.h
7453F: include/uapi/linux/pkt_cls.h
7398F: net/sched/ 7454F: net/sched/
7399 7455
7400TCP LOW PRIORITY MODULE 7456TCP LOW PRIORITY MODULE
@@ -7486,6 +7542,7 @@ L: netdev@vger.kernel.org
7486S: Supported 7542S: Supported
7487F: drivers/net/team/ 7543F: drivers/net/team/
7488F: include/linux/if_team.h 7544F: include/linux/if_team.h
7545F: include/uapi/linux/if_team.h
7489 7546
7490TECHNOTREND USB IR RECEIVER 7547TECHNOTREND USB IR RECEIVER
7491M: Sean Young <sean@mess.org> 7548M: Sean Young <sean@mess.org>
@@ -7584,7 +7641,7 @@ L: netdev@vger.kernel.org (core kernel code)
7584L: tipc-discussion@lists.sourceforge.net (user apps, general discussion) 7641L: tipc-discussion@lists.sourceforge.net (user apps, general discussion)
7585W: http://tipc.sourceforge.net/ 7642W: http://tipc.sourceforge.net/
7586S: Maintained 7643S: Maintained
7587F: include/linux/tipc*.h 7644F: include/uapi/linux/tipc*.h
7588F: net/tipc/ 7645F: net/tipc/
7589 7646
7590TILE ARCHITECTURE 7647TILE ARCHITECTURE
@@ -7634,6 +7691,7 @@ W: http://www.buzzard.org.uk/toshiba/
7634S: Maintained 7691S: Maintained
7635F: drivers/char/toshiba.c 7692F: drivers/char/toshiba.c
7636F: include/linux/toshiba.h 7693F: include/linux/toshiba.h
7694F: include/uapi/linux/toshiba.h
7637 7695
7638TMIO MMC DRIVER 7696TMIO MMC DRIVER
7639M: Guennadi Liakhovetski <g.liakhovetski@gmx.de> 7697M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
@@ -7701,6 +7759,9 @@ F: drivers/tty/serial/serial_core.c
7701F: include/linux/serial_core.h 7759F: include/linux/serial_core.h
7702F: include/linux/serial.h 7760F: include/linux/serial.h
7703F: include/linux/tty.h 7761F: include/linux/tty.h
7762F: include/uapi/linux/serial_core.h
7763F: include/uapi/linux/serial.h
7764F: include/uapi/linux/tty.h
7704 7765
7705TUA9001 MEDIA DRIVER 7766TUA9001 MEDIA DRIVER
7706M: Antti Palosaari <crope@iki.fi> 7767M: Antti Palosaari <crope@iki.fi>
@@ -7780,7 +7841,7 @@ M: David Herrmann <dh.herrmann@googlemail.com>
7780L: linux-input@vger.kernel.org 7841L: linux-input@vger.kernel.org
7781S: Maintained 7842S: Maintained
7782F: drivers/hid/uhid.c 7843F: drivers/hid/uhid.c
7783F: include/linux/uhid.h 7844F: include/uapi/linux/uhid.h
7784 7845
7785ULTRA-WIDEBAND (UWB) SUBSYSTEM: 7846ULTRA-WIDEBAND (UWB) SUBSYSTEM:
7786L: linux-usb@vger.kernel.org 7847L: linux-usb@vger.kernel.org
@@ -7809,6 +7870,7 @@ S: Maintained
7809F: Documentation/cdrom/ 7870F: Documentation/cdrom/
7810F: drivers/cdrom/cdrom.c 7871F: drivers/cdrom/cdrom.c
7811F: include/linux/cdrom.h 7872F: include/linux/cdrom.h
7873F: include/uapi/linux/cdrom.h
7812 7874
7813UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER 7875UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
7814M: Vinayak Holikatti <vinholikatti@gmail.com> 7876M: Vinayak Holikatti <vinholikatti@gmail.com>
@@ -7826,7 +7888,7 @@ T: git git://git.infradead.org/ubi-2.6.git
7826S: Maintained 7888S: Maintained
7827F: drivers/mtd/ubi/ 7889F: drivers/mtd/ubi/
7828F: include/linux/mtd/ubi.h 7890F: include/linux/mtd/ubi.h
7829F: include/mtd/ubi-user.h 7891F: include/uapi/mtd/ubi-user.h
7830 7892
7831UNSORTED BLOCK IMAGES (UBI) Fastmap 7893UNSORTED BLOCK IMAGES (UBI) Fastmap
7832M: Richard Weinberger <richard@nod.at> 7894M: Richard Weinberger <richard@nod.at>
@@ -7860,7 +7922,7 @@ M: Oliver Neukum <oliver@neukum.org>
7860L: linux-usb@vger.kernel.org 7922L: linux-usb@vger.kernel.org
7861S: Maintained 7923S: Maintained
7862F: drivers/net/usb/cdc_*.c 7924F: drivers/net/usb/cdc_*.c
7863F: include/linux/usb/cdc.h 7925F: include/uapi/linux/usb/cdc.h
7864 7926
7865USB CYPRESS C67X00 DRIVER 7927USB CYPRESS C67X00 DRIVER
7866M: Peter Korsgaard <jacmet@sunsite.dk> 7928M: Peter Korsgaard <jacmet@sunsite.dk>
@@ -8181,6 +8243,7 @@ S: Maintained
8181F: Documentation/vfio.txt 8243F: Documentation/vfio.txt
8182F: drivers/vfio/ 8244F: drivers/vfio/
8183F: include/linux/vfio.h 8245F: include/linux/vfio.h
8246F: include/uapi/linux/vfio.h
8184 8247
8185VIDEOBUF2 FRAMEWORK 8248VIDEOBUF2 FRAMEWORK
8186M: Pawel Osciak <pawel@osciak.com> 8249M: Pawel Osciak <pawel@osciak.com>
@@ -8197,6 +8260,7 @@ L: virtualization@lists.linux-foundation.org
8197S: Maintained 8260S: Maintained
8198F: drivers/char/virtio_console.c 8261F: drivers/char/virtio_console.c
8199F: include/linux/virtio_console.h 8262F: include/linux/virtio_console.h
8263F: include/uapi/linux/virtio_console.h
8200 8264
8201VIRTIO CORE, NET AND BLOCK DRIVERS 8265VIRTIO CORE, NET AND BLOCK DRIVERS
8202M: Rusty Russell <rusty@rustcorp.com.au> 8266M: Rusty Russell <rusty@rustcorp.com.au>
@@ -8215,7 +8279,7 @@ L: virtualization@lists.linux-foundation.org
8215L: netdev@vger.kernel.org 8279L: netdev@vger.kernel.org
8216S: Maintained 8280S: Maintained
8217F: drivers/vhost/ 8281F: drivers/vhost/
8218F: include/linux/vhost.h 8282F: include/uapi/linux/vhost.h
8219 8283
8220VIA RHINE NETWORK DRIVER 8284VIA RHINE NETWORK DRIVER
8221M: Roger Luethi <rl@hellgate.ch> 8285M: Roger Luethi <rl@hellgate.ch>
@@ -8355,6 +8419,7 @@ S: Maintained
8355F: Documentation/watchdog/ 8419F: Documentation/watchdog/
8356F: drivers/watchdog/ 8420F: drivers/watchdog/
8357F: include/linux/watchdog.h 8421F: include/linux/watchdog.h
8422F: include/uapi/linux/watchdog.h
8358 8423
8359WD7000 SCSI DRIVER 8424WD7000 SCSI DRIVER
8360M: Miroslav Zagorac <zaga@fly.cc.fer.hr> 8425M: Miroslav Zagorac <zaga@fly.cc.fer.hr>
@@ -8380,9 +8445,9 @@ L: wimax@linuxwimax.org
8380S: Supported 8445S: Supported
8381W: http://linuxwimax.org 8446W: http://linuxwimax.org
8382F: Documentation/wimax/README.wimax 8447F: Documentation/wimax/README.wimax
8383F: include/linux/wimax.h
8384F: include/linux/wimax/debug.h 8448F: include/linux/wimax/debug.h
8385F: include/net/wimax.h 8449F: include/net/wimax.h
8450F: include/uapi/linux/wimax.h
8386F: net/wimax/ 8451F: net/wimax/
8387 8452
8388WISTRON LAPTOP BUTTON DRIVER 8453WISTRON LAPTOP BUTTON DRIVER
@@ -8468,7 +8533,7 @@ F: Documentation/x86/
8468F: arch/x86/ 8533F: arch/x86/
8469 8534
8470X86 PLATFORM DRIVERS 8535X86 PLATFORM DRIVERS
8471M: Matthew Garrett <mjg@redhat.com> 8536M: Matthew Garrett <matthew.garrett@nebula.com>
8472L: platform-driver-x86@vger.kernel.org 8537L: platform-driver-x86@vger.kernel.org
8473T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86.git 8538T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86.git
8474S: Maintained 8539S: Maintained
@@ -8500,6 +8565,7 @@ F: drivers/*/xen-*front.c
8500F: drivers/xen/ 8565F: drivers/xen/
8501F: arch/x86/include/asm/xen/ 8566F: arch/x86/include/asm/xen/
8502F: include/xen/ 8567F: include/xen/
8568F: include/uapi/xen/
8503 8569
8504XEN HYPERVISOR ARM 8570XEN HYPERVISOR ARM
8505M: Stefano Stabellini <stefano.stabellini@eu.citrix.com> 8571M: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
diff --git a/Makefile b/Makefile
index 80c5694b29f..a1667c4bcce 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 3 1VERSION = 3
2PATCHLEVEL = 8 2PATCHLEVEL = 8
3SUBLEVEL = 0 3SUBLEVEL = 0
4EXTRAVERSION = -rc2 4EXTRAVERSION = -rc3
5NAME = Terrified Chipmunk 5NAME = Terrified Chipmunk
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/alpha/include/asm/parport.h b/arch/alpha/include/asm/parport.h
index c5ee7cbb2fc..6abd0af11f1 100644
--- a/arch/alpha/include/asm/parport.h
+++ b/arch/alpha/include/asm/parport.h
@@ -9,8 +9,8 @@
9#ifndef _ASM_AXP_PARPORT_H 9#ifndef _ASM_AXP_PARPORT_H
10#define _ASM_AXP_PARPORT_H 1 10#define _ASM_AXP_PARPORT_H 1
11 11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); 12static int parport_pc_find_isa_ports (int autoirq, int autodma);
13static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 13static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
14{ 14{
15 return parport_pc_find_isa_ports (autoirq, autodma); 15 return parport_pc_find_isa_ports (autoirq, autodma);
16} 16}
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index ef757147cbf..edb4e0097b7 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -59,13 +59,13 @@ struct pci_controller *pci_isa_hose;
59 * Quirks. 59 * Quirks.
60 */ 60 */
61 61
62static void __devinit quirk_isa_bridge(struct pci_dev *dev) 62static void quirk_isa_bridge(struct pci_dev *dev)
63{ 63{
64 dev->class = PCI_CLASS_BRIDGE_ISA << 8; 64 dev->class = PCI_CLASS_BRIDGE_ISA << 8;
65} 65}
66DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge); 66DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge);
67 67
68static void __devinit quirk_cypress(struct pci_dev *dev) 68static void quirk_cypress(struct pci_dev *dev)
69{ 69{
70 /* The Notorious Cy82C693 chip. */ 70 /* The Notorious Cy82C693 chip. */
71 71
@@ -104,7 +104,7 @@ static void __devinit quirk_cypress(struct pci_dev *dev)
104DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress); 104DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress);
105 105
106/* Called for each device after PCI setup is done. */ 106/* Called for each device after PCI setup is done. */
107static void __devinit pcibios_fixup_final(struct pci_dev *dev) 107static void pcibios_fixup_final(struct pci_dev *dev)
108{ 108{
109 unsigned int class = dev->class >> 8; 109 unsigned int class = dev->class >> 8;
110 110
@@ -198,8 +198,7 @@ subsys_initcall(pcibios_init);
198#ifdef ALPHA_RESTORE_SRM_SETUP 198#ifdef ALPHA_RESTORE_SRM_SETUP
199static struct pdev_srm_saved_conf *srm_saved_configs; 199static struct pdev_srm_saved_conf *srm_saved_configs;
200 200
201void __devinit 201void pdev_save_srm_config(struct pci_dev *dev)
202pdev_save_srm_config(struct pci_dev *dev)
203{ 202{
204 struct pdev_srm_saved_conf *tmp; 203 struct pdev_srm_saved_conf *tmp;
205 static int printed = 0; 204 static int printed = 0;
@@ -241,8 +240,7 @@ pci_restore_srm_config(void)
241} 240}
242#endif 241#endif
243 242
244void __devinit 243void pcibios_fixup_bus(struct pci_bus *bus)
245pcibios_fixup_bus(struct pci_bus *bus)
246{ 244{
247 struct pci_dev *dev = bus->self; 245 struct pci_dev *dev = bus->self;
248 246
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index a41ad90a97a..9603bc234b4 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -68,7 +68,7 @@ enum ipi_message_type {
68}; 68};
69 69
70/* Set to a secondary's cpuid when it comes online. */ 70/* Set to a secondary's cpuid when it comes online. */
71static int smp_secondary_alive __devinitdata = 0; 71static int smp_secondary_alive = 0;
72 72
73int smp_num_probed; /* Internal processor count */ 73int smp_num_probed; /* Internal processor count */
74int smp_num_cpus = 1; /* Number that came online. */ 74int smp_num_cpus = 1; /* Number that came online. */
@@ -172,7 +172,7 @@ smp_callin(void)
172} 172}
173 173
174/* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */ 174/* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
175static int __devinit 175static int
176wait_for_txrdy (unsigned long cpumask) 176wait_for_txrdy (unsigned long cpumask)
177{ 177{
178 unsigned long timeout; 178 unsigned long timeout;
@@ -468,7 +468,7 @@ smp_prepare_cpus(unsigned int max_cpus)
468 smp_num_cpus = smp_num_probed; 468 smp_num_cpus = smp_num_probed;
469} 469}
470 470
471void __devinit 471void
472smp_prepare_boot_cpu(void) 472smp_prepare_boot_cpu(void)
473{ 473{
474} 474}
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 2533db280d9..5cf4a481b8c 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -303,7 +303,7 @@ titan_late_init(void)
303 303
304} 304}
305 305
306static int __devinit 306static int
307titan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 307titan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
308{ 308{
309 u8 intline; 309 u8 intline;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f95ba14ae3d..67874b82a4e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -371,7 +371,6 @@ config ARCH_CNS3XXX
371config ARCH_CLPS711X 371config ARCH_CLPS711X
372 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" 372 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
373 select ARCH_REQUIRE_GPIOLIB 373 select ARCH_REQUIRE_GPIOLIB
374 select ARCH_USES_GETTIMEOFFSET
375 select AUTO_ZRELADDR 374 select AUTO_ZRELADDR
376 select CLKDEV_LOOKUP 375 select CLKDEV_LOOKUP
377 select COMMON_CLK 376 select COMMON_CLK
@@ -1230,6 +1229,7 @@ config ARM_ERRATA_430973
1230config ARM_ERRATA_458693 1229config ARM_ERRATA_458693
1231 bool "ARM errata: Processor deadlock when a false hazard is created" 1230 bool "ARM errata: Processor deadlock when a false hazard is created"
1232 depends on CPU_V7 1231 depends on CPU_V7
1232 depends on !ARCH_MULTIPLATFORM
1233 help 1233 help
1234 This option enables the workaround for the 458693 Cortex-A8 (r2p0) 1234 This option enables the workaround for the 458693 Cortex-A8 (r2p0)
1235 erratum. For very specific sequences of memory operations, it is 1235 erratum. For very specific sequences of memory operations, it is
@@ -1243,6 +1243,7 @@ config ARM_ERRATA_458693
1243config ARM_ERRATA_460075 1243config ARM_ERRATA_460075
1244 bool "ARM errata: Data written to the L2 cache can be overwritten with stale data" 1244 bool "ARM errata: Data written to the L2 cache can be overwritten with stale data"
1245 depends on CPU_V7 1245 depends on CPU_V7
1246 depends on !ARCH_MULTIPLATFORM
1246 help 1247 help
1247 This option enables the workaround for the 460075 Cortex-A8 (r2p0) 1248 This option enables the workaround for the 460075 Cortex-A8 (r2p0)
1248 erratum. Any asynchronous access to the L2 cache may encounter a 1249 erratum. Any asynchronous access to the L2 cache may encounter a
@@ -1255,6 +1256,7 @@ config ARM_ERRATA_460075
1255config ARM_ERRATA_742230 1256config ARM_ERRATA_742230
1256 bool "ARM errata: DMB operation may be faulty" 1257 bool "ARM errata: DMB operation may be faulty"
1257 depends on CPU_V7 && SMP 1258 depends on CPU_V7 && SMP
1259 depends on !ARCH_MULTIPLATFORM
1258 help 1260 help
1259 This option enables the workaround for the 742230 Cortex-A9 1261 This option enables the workaround for the 742230 Cortex-A9
1260 (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction 1262 (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction
@@ -1267,6 +1269,7 @@ config ARM_ERRATA_742230
1267config ARM_ERRATA_742231 1269config ARM_ERRATA_742231
1268 bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption" 1270 bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"
1269 depends on CPU_V7 && SMP 1271 depends on CPU_V7 && SMP
1272 depends on !ARCH_MULTIPLATFORM
1270 help 1273 help
1271 This option enables the workaround for the 742231 Cortex-A9 1274 This option enables the workaround for the 742231 Cortex-A9
1272 (r2p0..r2p2) erratum. Under certain conditions, specific to the 1275 (r2p0..r2p2) erratum. Under certain conditions, specific to the
@@ -1317,6 +1320,7 @@ config PL310_ERRATA_727915
1317config ARM_ERRATA_743622 1320config ARM_ERRATA_743622
1318 bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption" 1321 bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"
1319 depends on CPU_V7 1322 depends on CPU_V7
1323 depends on !ARCH_MULTIPLATFORM
1320 help 1324 help
1321 This option enables the workaround for the 743622 Cortex-A9 1325 This option enables the workaround for the 743622 Cortex-A9
1322 (r2p*) erratum. Under very rare conditions, a faulty 1326 (r2p*) erratum. Under very rare conditions, a faulty
@@ -1330,6 +1334,7 @@ config ARM_ERRATA_743622
1330config ARM_ERRATA_751472 1334config ARM_ERRATA_751472
1331 bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation" 1335 bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
1332 depends on CPU_V7 1336 depends on CPU_V7
1337 depends on !ARCH_MULTIPLATFORM
1333 help 1338 help
1334 This option enables the workaround for the 751472 Cortex-A9 (prior 1339 This option enables the workaround for the 751472 Cortex-A9 (prior
1335 to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the 1340 to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e44da40d984..5ebb44fe826 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -155,6 +155,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
155dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb 155dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
156 156
157targets += dtbs 157targets += dtbs
158targets += $(dtb-y)
158endif 159endif
159 160
160# *.dtb used to be generated in the directory above. Clean out the 161# *.dtb used to be generated in the directory above. Clean out the
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index cf6c48a09ea..4c0abe85405 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -50,17 +50,19 @@
50 ranges; 50 ranges;
51 51
52 serial@d0012000 { 52 serial@d0012000 {
53 compatible = "ns16550"; 53 compatible = "snps,dw-apb-uart";
54 reg = <0xd0012000 0x100>; 54 reg = <0xd0012000 0x100>;
55 reg-shift = <2>; 55 reg-shift = <2>;
56 interrupts = <41>; 56 interrupts = <41>;
57 reg-io-width = <4>;
57 status = "disabled"; 58 status = "disabled";
58 }; 59 };
59 serial@d0012100 { 60 serial@d0012100 {
60 compatible = "ns16550"; 61 compatible = "snps,dw-apb-uart";
61 reg = <0xd0012100 0x100>; 62 reg = <0xd0012100 0x100>;
62 reg-shift = <2>; 63 reg-shift = <2>;
63 interrupts = <42>; 64 interrupts = <42>;
65 reg-io-width = <4>;
64 status = "disabled"; 66 status = "disabled";
65 }; 67 };
66 68
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
index c45c7b4dc35..271855a6e22 100644
--- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -34,7 +34,14 @@
34 reg = <0>; 34 reg = <0>;
35 clocks = <&cpuclk 0>; 35 clocks = <&cpuclk 0>;
36 }; 36 };
37 } 37
38 cpu@1 {
39 device_type = "cpu";
40 compatible = "marvell,sheeva-v7";
41 reg = <1>;
42 clocks = <&cpuclk 1>;
43 };
44 };
38 45
39 soc { 46 soc {
40 pinctrl { 47 pinctrl {
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index a2aee570737..1c1937dbce7 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -85,5 +85,13 @@
85 #interrupts-cells = <2>; 85 #interrupts-cells = <2>;
86 interrupts = <24>; 86 interrupts = <24>;
87 }; 87 };
88
89 ethernet@d0034000 {
90 compatible = "marvell,armada-370-neta";
91 reg = <0xd0034000 0x2500>;
92 interrupts = <14>;
93 clocks = <&gateclk 1>;
94 status = "disabled";
95 };
88 }; 96 };
89}; 97};
diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
index da03a129243..4905cf3a5ef 100644
--- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
@@ -100,5 +100,13 @@
100 #interrupts-cells = <2>; 100 #interrupts-cells = <2>;
101 interrupts = <24>; 101 interrupts = <24>;
102 }; 102 };
103
104 ethernet@d0034000 {
105 compatible = "marvell,armada-370-neta";
106 reg = <0xd0034000 0x2500>;
107 interrupts = <14>;
108 clocks = <&gateclk 1>;
109 status = "disabled";
110 };
103 }; 111 };
104 }; 112 };
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index 367aa3f9491..2e37ef101c9 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -42,17 +42,19 @@
42 42
43 soc { 43 soc {
44 serial@d0012200 { 44 serial@d0012200 {
45 compatible = "ns16550"; 45 compatible = "snps,dw-apb-uart";
46 reg = <0xd0012200 0x100>; 46 reg = <0xd0012200 0x100>;
47 reg-shift = <2>; 47 reg-shift = <2>;
48 interrupts = <43>; 48 interrupts = <43>;
49 reg-io-width = <4>;
49 status = "disabled"; 50 status = "disabled";
50 }; 51 };
51 serial@d0012300 { 52 serial@d0012300 {
52 compatible = "ns16550"; 53 compatible = "snps,dw-apb-uart";
53 reg = <0xd0012300 0x100>; 54 reg = <0xd0012300 0x100>;
54 reg-shift = <2>; 55 reg-shift = <2>;
55 interrupts = <44>; 56 interrupts = <44>;
57 reg-io-width = <4>;
56 status = "disabled"; 58 status = "disabled";
57 }; 59 };
58 60
@@ -93,14 +95,6 @@
93 status = "disabled"; 95 status = "disabled";
94 }; 96 };
95 97
96 ethernet@d0034000 {
97 compatible = "marvell,armada-370-neta";
98 reg = <0xd0034000 0x2500>;
99 interrupts = <14>;
100 clocks = <&gateclk 1>;
101 status = "disabled";
102 };
103
104 xor@d0060900 { 98 xor@d0060900 {
105 compatible = "marvell,orion-xor"; 99 compatible = "marvell,orion-xor";
106 reg = <0xd0060900 0x100 100 reg = <0xd0060900 0x100
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 2efd9c891bc..63f2fbcfe81 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -170,7 +170,9 @@
170 gpio-bank = <8>; 170 gpio-bank = <8>;
171 }; 171 };
172 172
173 pinctrl { 173 pinctrl@80157000 {
174 // This is actually the PRCMU base address
175 reg = <0x80157000 0x2000>;
174 compatible = "stericsson,nmk_pinctrl"; 176 compatible = "stericsson,nmk_pinctrl";
175 }; 177 };
176 178
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index f3f7e9d8adc..42eac1ff3cc 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -117,6 +117,7 @@
117 pinctrl: pinctrl@d0200 { 117 pinctrl: pinctrl@d0200 {
118 compatible = "marvell,dove-pinctrl"; 118 compatible = "marvell,dove-pinctrl";
119 reg = <0xd0200 0x10>; 119 reg = <0xd0200 0x10>;
120 clocks = <&gate_clk 22>;
120 }; 121 };
121 122
122 spi0: spi@10600 { 123 spi0: spi@10600 {
diff --git a/arch/arm/boot/dts/ecx-2000.dts b/arch/arm/boot/dts/ecx-2000.dts
index 46477ac1de9..139b40cc3a2 100644
--- a/arch/arm/boot/dts/ecx-2000.dts
+++ b/arch/arm/boot/dts/ecx-2000.dts
@@ -32,6 +32,7 @@
32 32
33 cpu@0 { 33 cpu@0 {
34 compatible = "arm,cortex-a15"; 34 compatible = "arm,cortex-a15";
35 device_type = "cpu";
35 reg = <0>; 36 reg = <0>;
36 clocks = <&a9pll>; 37 clocks = <&a9pll>;
37 clock-names = "cpu"; 38 clock-names = "cpu";
@@ -39,6 +40,7 @@
39 40
40 cpu@1 { 41 cpu@1 {
41 compatible = "arm,cortex-a15"; 42 compatible = "arm,cortex-a15";
43 device_type = "cpu";
42 reg = <1>; 44 reg = <1>;
43 clocks = <&a9pll>; 45 clocks = <&a9pll>;
44 clock-names = "cpu"; 46 clock-names = "cpu";
@@ -46,6 +48,7 @@
46 48
47 cpu@2 { 49 cpu@2 {
48 compatible = "arm,cortex-a15"; 50 compatible = "arm,cortex-a15";
51 device_type = "cpu";
49 reg = <2>; 52 reg = <2>;
50 clocks = <&a9pll>; 53 clocks = <&a9pll>;
51 clock-names = "cpu"; 54 clock-names = "cpu";
@@ -53,6 +56,7 @@
53 56
54 cpu@3 { 57 cpu@3 {
55 compatible = "arm,cortex-a15"; 58 compatible = "arm,cortex-a15";
59 device_type = "cpu";
56 reg = <3>; 60 reg = <3>;
57 clocks = <&a9pll>; 61 clocks = <&a9pll>;
58 clock-names = "cpu"; 62 clock-names = "cpu";
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 9b23a8255e3..f63490707f3 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -26,7 +26,7 @@
26 }; 26 };
27 27
28 chosen { 28 chosen {
29 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; 29 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
30 }; 30 };
31 31
32 sdhci@12530000 { 32 sdhci@12530000 {
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 2e3b6efaf1a..3acf594ea60 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -574,7 +574,7 @@
574 574
575 hdmi { 575 hdmi {
576 compatible = "samsung,exynos5-hdmi"; 576 compatible = "samsung,exynos5-hdmi";
577 reg = <0x14530000 0x100000>; 577 reg = <0x14530000 0x70000>;
578 interrupts = <0 95 0>; 578 interrupts = <0 95 0>;
579 }; 579 };
580 580
diff --git a/arch/arm/boot/dts/exynos5440-ssdk5440.dts b/arch/arm/boot/dts/exynos5440-ssdk5440.dts
index 921c83cf694..81e2c964a90 100644
--- a/arch/arm/boot/dts/exynos5440-ssdk5440.dts
+++ b/arch/arm/boot/dts/exynos5440-ssdk5440.dts
@@ -21,7 +21,7 @@
21 }; 21 };
22 22
23 chosen { 23 chosen {
24 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC2,115200 init=/linuxrc"; 24 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC0,115200 init=/linuxrc";
25 }; 25 };
26 26
27 spi { 27 spi {
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index a9ae5d32e80..5927a8df562 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -30,33 +30,37 @@
30 #address-cells = <1>; 30 #address-cells = <1>;
31 #size-cells = <0>; 31 #size-cells = <0>;
32 32
33 cpu@0 { 33 cpu@900 {
34 compatible = "arm,cortex-a9"; 34 compatible = "arm,cortex-a9";
35 reg = <0>; 35 device_type = "cpu";
36 reg = <0x900>;
36 next-level-cache = <&L2>; 37 next-level-cache = <&L2>;
37 clocks = <&a9pll>; 38 clocks = <&a9pll>;
38 clock-names = "cpu"; 39 clock-names = "cpu";
39 }; 40 };
40 41
41 cpu@1 { 42 cpu@901 {
42 compatible = "arm,cortex-a9"; 43 compatible = "arm,cortex-a9";
43 reg = <1>; 44 device_type = "cpu";
45 reg = <0x901>;
44 next-level-cache = <&L2>; 46 next-level-cache = <&L2>;
45 clocks = <&a9pll>; 47 clocks = <&a9pll>;
46 clock-names = "cpu"; 48 clock-names = "cpu";
47 }; 49 };
48 50
49 cpu@2 { 51 cpu@902 {
50 compatible = "arm,cortex-a9"; 52 compatible = "arm,cortex-a9";
51 reg = <2>; 53 device_type = "cpu";
54 reg = <0x902>;
52 next-level-cache = <&L2>; 55 next-level-cache = <&L2>;
53 clocks = <&a9pll>; 56 clocks = <&a9pll>;
54 clock-names = "cpu"; 57 clock-names = "cpu";
55 }; 58 };
56 59
57 cpu@3 { 60 cpu@903 {
58 compatible = "arm,cortex-a9"; 61 compatible = "arm,cortex-a9";
59 reg = <3>; 62 device_type = "cpu";
63 reg = <0x903>;
60 next-level-cache = <&L2>; 64 next-level-cache = <&L2>;
61 clocks = <&a9pll>; 65 clocks = <&a9pll>;
62 clock-names = "cpu"; 66 clock-names = "cpu";
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 7c43b8e70b9..e7484e4ea65 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -39,17 +39,17 @@
39 hog_pins_a: hog@0 { 39 hog_pins_a: hog@0 {
40 reg = <0>; 40 reg = <0>;
41 fsl,pinmux-ids = < 41 fsl,pinmux-ids = <
42 0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ 42 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
43 >; 43 >;
44 fsl,drive-strength = <0>; 44 fsl,drive-strength = <0>;
45 fsl,voltage = <1>; 45 fsl,voltage = <1>;
46 fsl,pull-up = <0>; 46 fsl,pull-up = <0>;
47 }; 47 };
48 48
49 led_pin_gpio0_17: led_gpio0_17@0 { 49 led_pin_gpio2_1: led_gpio2_1@0 {
50 reg = <0>; 50 reg = <0>;
51 fsl,pinmux-ids = < 51 fsl,pinmux-ids = <
52 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */ 52 0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
53 >; 53 >;
54 fsl,drive-strength = <0>; 54 fsl,drive-strength = <0>;
55 fsl,voltage = <1>; 55 fsl,voltage = <1>;
@@ -110,7 +110,7 @@
110 leds { 110 leds {
111 compatible = "gpio-leds"; 111 compatible = "gpio-leds";
112 pinctrl-names = "default"; 112 pinctrl-names = "default";
113 pinctrl-0 = <&led_pin_gpio0_17>; 113 pinctrl-0 = <&led_pin_gpio2_1>;
114 114
115 user { 115 user {
116 label = "green"; 116 label = "green";
diff --git a/arch/arm/boot/dts/imx31-bug.dts b/arch/arm/boot/dts/imx31-bug.dts
index 24731cb78e8..7f67402328d 100644
--- a/arch/arm/boot/dts/imx31-bug.dts
+++ b/arch/arm/boot/dts/imx31-bug.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "Buglabs i.MX31 Bug 1.x"; 16 model = "Buglabs i.MX31 Bug 1.x";
17 compatible = "fsl,imx31-bug", "fsl,imx31"; 17 compatible = "buglabs,imx31-bug", "fsl,imx31";
18 18
19 memory { 19 memory {
20 reg = <0x80000000 0x8000000>; /* 128M */ 20 reg = <0x80000000 0x8000000>; /* 128M */
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 552aed4ff98..edc3f1eb669 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -492,7 +492,7 @@
492 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan"; 492 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
493 reg = <0x53fcc000 0x4000>; 493 reg = <0x53fcc000 0x4000>;
494 interrupts = <83>; 494 interrupts = <83>;
495 clocks = <&clks 158>, <&clks 157>; 495 clocks = <&clks 87>, <&clks 86>;
496 clock-names = "ipg", "per"; 496 clock-names = "ipg", "per";
497 status = "disabled"; 497 status = "disabled";
498 }; 498 };
diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi
index 9ae2004d567..4ccea2130a6 100644
--- a/arch/arm/boot/dts/kirkwood-6282.dtsi
+++ b/arch/arm/boot/dts/kirkwood-6282.dtsi
@@ -39,6 +39,7 @@
39 #size-cells = <0>; 39 #size-cells = <0>;
40 interrupts = <32>; 40 interrupts = <32>;
41 clock-frequency = <100000>; 41 clock-frequency = <100000>;
42 clocks = <&gate_clk 7>;
42 status = "disabled"; 43 status = "disabled";
43 }; 44 };
44 }; 45 };
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index c0de5a7f660..cd15452a52a 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -82,4 +82,21 @@
82 gpios = <&gpio1 16 1>; 82 gpios = <&gpio1 16 1>;
83 }; 83 };
84 }; 84 };
85 regulators {
86 compatible = "simple-bus";
87 #address-cells = <1>;
88 #size-cells = <0>;
89
90 sata0_power: regulator@1 {
91 compatible = "regulator-fixed";
92 reg = <1>;
93 regulator-name = "SATA0 Power";
94 regulator-min-microvolt = <5000000>;
95 regulator-max-microvolt = <5000000>;
96 enable-active-high;
97 regulator-always-on;
98 regulator-boot-on;
99 gpio = <&gpio1 4 0>;
100 };
101 };
85}; 102};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 7735cee4a9c..110d6cbb795 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -144,6 +144,7 @@
144 compatible = "marvell,orion-ehci"; 144 compatible = "marvell,orion-ehci";
145 reg = <0x50000 0x1000>; 145 reg = <0x50000 0x1000>;
146 interrupts = <19>; 146 interrupts = <19>;
147 clocks = <&gate_clk 3>;
147 status = "okay"; 148 status = "okay";
148 }; 149 };
149 150
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 9173d112ea0..e57d7e5bf96 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -686,8 +686,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
686 * %-EINVAL no platform data passed 686 * %-EINVAL no platform data passed
687 * %0 successful. 687 * %0 successful.
688 */ 688 */
689static int __devinit 689static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
690__sa1111_probe(struct device *me, struct resource *mem, int irq)
691{ 690{
692 struct sa1111_platform_data *pd = me->platform_data; 691 struct sa1111_platform_data *pd = me->platform_data;
693 struct sa1111 *sachip; 692 struct sa1111 *sachip;
@@ -1011,7 +1010,7 @@ static int sa1111_resume(struct platform_device *dev)
1011#define sa1111_resume NULL 1010#define sa1111_resume NULL
1012#endif 1011#endif
1013 1012
1014static int __devinit sa1111_probe(struct platform_device *pdev) 1013static int sa1111_probe(struct platform_device *pdev)
1015{ 1014{
1016 struct resource *mem; 1015 struct resource *mem;
1017 int irq; 1016 int irq;
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 0c616d5fcb0..a5c3dc38aa1 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -176,7 +176,7 @@ static int scoop_resume(struct platform_device *dev)
176#define scoop_resume NULL 176#define scoop_resume NULL
177#endif 177#endif
178 178
179static int __devinit scoop_probe(struct platform_device *pdev) 179static int scoop_probe(struct platform_device *pdev)
180{ 180{
181 struct scoop_dev *devptr; 181 struct scoop_dev *devptr;
182 struct scoop_config *inf; 182 struct scoop_config *inf;
@@ -243,7 +243,7 @@ err_ioremap:
243 return ret; 243 return ret;
244} 244}
245 245
246static int __devexit scoop_remove(struct platform_device *pdev) 246static int scoop_remove(struct platform_device *pdev)
247{ 247{
248 struct scoop_dev *sdev = platform_get_drvdata(pdev); 248 struct scoop_dev *sdev = platform_get_drvdata(pdev);
249 int ret; 249 int ret;
@@ -268,7 +268,7 @@ static int __devexit scoop_remove(struct platform_device *pdev)
268 268
269static struct platform_driver scoop_driver = { 269static struct platform_driver scoop_driver = {
270 .probe = scoop_probe, 270 .probe = scoop_probe,
271 .remove = __devexit_p(scoop_remove), 271 .remove = scoop_remove,
272 .suspend = scoop_suspend, 272 .suspend = scoop_suspend,
273 .resume = scoop_resume, 273 .resume = scoop_resume,
274 .driver = { 274 .driver = {
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index e4df17ca90c..8f324b99416 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -206,6 +206,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
206 struct device_node *node) 206 struct device_node *node)
207{ 207{
208 struct vic_device *v; 208 struct vic_device *v;
209 int i;
209 210
210 if (vic_id >= ARRAY_SIZE(vic_devices)) { 211 if (vic_id >= ARRAY_SIZE(vic_devices)) {
211 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); 212 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
@@ -220,6 +221,10 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
220 vic_id++; 221 vic_id++;
221 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, 222 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
222 &vic_irqdomain_ops, v); 223 &vic_irqdomain_ops, v);
224 /* create an IRQ mapping for each valid IRQ */
225 for (i = 0; i < fls(valid_sources); i++)
226 if (valid_sources & (1 << i))
227 irq_create_mapping(v->domain, i);
223} 228}
224 229
225static void vic_ack_irq(struct irq_data *d) 230static void vic_ack_irq(struct irq_data *d)
@@ -416,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
416 return -EIO; 421 return -EIO;
417 422
418 /* 423 /*
419 * Passing -1 as first IRQ makes the simple domain allocate descriptors 424 * Passing 0 as first IRQ makes the simple domain allocate descriptors
420 */ 425 */
421 __vic_init(regs, -1, ~0, ~0, node); 426 __vic_init(regs, 0, ~0, ~0, node);
422 427
423 return 0; 428 return 0;
424} 429}
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index a702fb345c0..b5bc96cb65a 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -33,9 +33,7 @@ CONFIG_MVNETA=y
33CONFIG_MARVELL_PHY=y 33CONFIG_MARVELL_PHY=y
34CONFIG_SERIAL_8250=y 34CONFIG_SERIAL_8250=y
35CONFIG_SERIAL_8250_CONSOLE=y 35CONFIG_SERIAL_8250_CONSOLE=y
36CONFIG_SERIAL_OF_PLATFORM=y 36CONFIG_SERIAL_8250_DW=y
37CONFIG_I2C=y
38CONFIG_I2C_MV64XXX=y
39CONFIG_GPIOLIB=y 37CONFIG_GPIOLIB=y
40CONFIG_GPIO_SYSFS=y 38CONFIG_GPIO_SYSFS=y
41# CONFIG_USB_SUPPORT is not set 39# CONFIG_USB_SUPPORT is not set
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 9b722612553..379cf329239 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -78,7 +78,7 @@ void pcibios_report_status(u_int status_mask, int warn)
78 * Bug 3 is responsible for the sound DMA grinding to a halt. We now 78 * Bug 3 is responsible for the sound DMA grinding to a halt. We now
79 * live with bug 2. 79 * live with bug 2.
80 */ 80 */
81static void __devinit pci_fixup_83c553(struct pci_dev *dev) 81static void pci_fixup_83c553(struct pci_dev *dev)
82{ 82{
83 /* 83 /*
84 * Set memory region to start at address 0, and enable IO 84 * Set memory region to start at address 0, and enable IO
@@ -130,7 +130,7 @@ static void __devinit pci_fixup_83c553(struct pci_dev *dev)
130} 130}
131DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, pci_fixup_83c553); 131DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, pci_fixup_83c553);
132 132
133static void __devinit pci_fixup_unassign(struct pci_dev *dev) 133static void pci_fixup_unassign(struct pci_dev *dev)
134{ 134{
135 dev->resource[0].end -= dev->resource[0].start; 135 dev->resource[0].end -= dev->resource[0].start;
136 dev->resource[0].start = 0; 136 dev->resource[0].start = 0;
@@ -142,7 +142,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_89C940F,
142 * if it is the host bridge by marking it as such. These resources are of 142 * if it is the host bridge by marking it as such. These resources are of
143 * no consequence to the PCI layer (they are handled elsewhere). 143 * no consequence to the PCI layer (they are handled elsewhere).
144 */ 144 */
145static void __devinit pci_fixup_dec21285(struct pci_dev *dev) 145static void pci_fixup_dec21285(struct pci_dev *dev)
146{ 146{
147 int i; 147 int i;
148 148
@@ -161,7 +161,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, pci_fixup_d
161/* 161/*
162 * PCI IDE controllers use non-standard I/O port decoding, respect it. 162 * PCI IDE controllers use non-standard I/O port decoding, respect it.
163 */ 163 */
164static void __devinit pci_fixup_ide_bases(struct pci_dev *dev) 164static void pci_fixup_ide_bases(struct pci_dev *dev)
165{ 165{
166 struct resource *r; 166 struct resource *r;
167 int i; 167 int i;
@@ -182,7 +182,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);
182/* 182/*
183 * Put the DEC21142 to sleep 183 * Put the DEC21142 to sleep
184 */ 184 */
185static void __devinit pci_fixup_dec21142(struct pci_dev *dev) 185static void pci_fixup_dec21142(struct pci_dev *dev)
186{ 186{
187 pci_write_config_dword(dev, 0x40, 0x80000000); 187 pci_write_config_dword(dev, 0x40, 0x80000000);
188} 188}
@@ -204,7 +204,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142, pci_fixup_d
204 * functional. However, The CY82C693U _does not work_ in bus 204 * functional. However, The CY82C693U _does not work_ in bus
205 * master mode without locking the PCI bus solid. 205 * master mode without locking the PCI bus solid.
206 */ 206 */
207static void __devinit pci_fixup_cy82c693(struct pci_dev *dev) 207static void pci_fixup_cy82c693(struct pci_dev *dev)
208{ 208{
209 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { 209 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
210 u32 base0, base1; 210 u32 base0, base1;
@@ -254,7 +254,7 @@ static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)
254} 254}
255DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693); 255DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);
256 256
257static void __devinit pci_fixup_it8152(struct pci_dev *dev) 257static void pci_fixup_it8152(struct pci_dev *dev)
258{ 258{
259 int i; 259 int i;
260 /* fixup for ITE 8152 devices */ 260 /* fixup for ITE 8152 devices */
@@ -361,9 +361,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
361 printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n", 361 printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
362 bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis"); 362 bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
363} 363}
364#ifdef CONFIG_HOTPLUG
365EXPORT_SYMBOL(pcibios_fixup_bus); 364EXPORT_SYMBOL(pcibios_fixup_bus);
366#endif
367 365
368/* 366/*
369 * Swizzle the device pin each time we cross a bridge. If a platform does 367 * Swizzle the device pin each time we cross a bridge. If a platform does
@@ -380,7 +378,7 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
380 * PCI standard swizzle is implemented on plug-in cards and Cardbus based 378 * PCI standard swizzle is implemented on plug-in cards and Cardbus based
381 * PCI extenders, so it can not be ignored. 379 * PCI extenders, so it can not be ignored.
382 */ 380 */
383static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin) 381static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
384{ 382{
385 struct pci_sys_data *sys = dev->sysdata; 383 struct pci_sys_data *sys = dev->sysdata;
386 int slot, oldpin = *pin; 384 int slot, oldpin = *pin;
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 36d20bd5012..9b6de8c988f 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -339,7 +339,7 @@ static struct miscdevice etb_miscdev = {
339 .fops = &etb_fops, 339 .fops = &etb_fops,
340}; 340};
341 341
342static int __devinit etb_probe(struct amba_device *dev, const struct amba_id *id) 342static int etb_probe(struct amba_device *dev, const struct amba_id *id)
343{ 343{
344 struct tracectx *t = &tracer; 344 struct tracectx *t = &tracer;
345 int ret = 0; 345 int ret = 0;
@@ -531,7 +531,7 @@ static ssize_t trace_mode_store(struct kobject *kobj,
531static struct kobj_attribute trace_mode_attr = 531static struct kobj_attribute trace_mode_attr =
532 __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store); 532 __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store);
533 533
534static int __devinit etm_probe(struct amba_device *dev, const struct amba_id *id) 534static int etm_probe(struct amba_device *dev, const struct amba_id *id)
535{ 535{
536 struct tracectx *t = &tracer; 536 struct tracectx *t = &tracer;
537 int ret = 0; 537 int ret = 0;
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index 9a4f6307a01..5f6620684e2 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -132,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
132 return 0; 132 return 0;
133} 133}
134 134
135static void __devinit cpu_pmu_init(struct arm_pmu *cpu_pmu) 135static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
136{ 136{
137 int cpu; 137 int cpu;
138 for_each_possible_cpu(cpu) { 138 for_each_possible_cpu(cpu) {
@@ -178,7 +178,7 @@ static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = {
178/* 178/*
179 * PMU platform driver and devicetree bindings. 179 * PMU platform driver and devicetree bindings.
180 */ 180 */
181static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = { 181static struct of_device_id cpu_pmu_of_device_ids[] = {
182 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init}, 182 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init},
183 {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init}, 183 {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init},
184 {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init}, 184 {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init},
@@ -190,7 +190,7 @@ static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = {
190 {}, 190 {},
191}; 191};
192 192
193static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = { 193static struct platform_device_id cpu_pmu_plat_device_ids[] = {
194 {.name = "arm-pmu"}, 194 {.name = "arm-pmu"},
195 {}, 195 {},
196}; 196};
@@ -198,7 +198,7 @@ static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = {
198/* 198/*
199 * CPU PMU identification and probing. 199 * CPU PMU identification and probing.
200 */ 200 */
201static int __devinit probe_current_pmu(struct arm_pmu *pmu) 201static int probe_current_pmu(struct arm_pmu *pmu)
202{ 202{
203 int cpu = get_cpu(); 203 int cpu = get_cpu();
204 unsigned long cpuid = read_cpuid_id(); 204 unsigned long cpuid = read_cpuid_id();
@@ -252,7 +252,7 @@ static int __devinit probe_current_pmu(struct arm_pmu *pmu)
252 return ret; 252 return ret;
253} 253}
254 254
255static int __devinit cpu_pmu_device_probe(struct platform_device *pdev) 255static int cpu_pmu_device_probe(struct platform_device *pdev)
256{ 256{
257 const struct of_device_id *of_id; 257 const struct of_device_id *of_id;
258 int (*init_fn)(struct arm_pmu *); 258 int (*init_fn)(struct arm_pmu *);
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index f3e22ff8b6a..041d0526a28 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -653,7 +653,7 @@ static int armv6_map_event(struct perf_event *event)
653 &armv6_perf_cache_map, 0xFF); 653 &armv6_perf_cache_map, 0xFF);
654} 654}
655 655
656static int __devinit armv6pmu_init(struct arm_pmu *cpu_pmu) 656static int armv6pmu_init(struct arm_pmu *cpu_pmu)
657{ 657{
658 cpu_pmu->name = "v6"; 658 cpu_pmu->name = "v6";
659 cpu_pmu->handle_irq = armv6pmu_handle_irq; 659 cpu_pmu->handle_irq = armv6pmu_handle_irq;
@@ -685,7 +685,7 @@ static int armv6mpcore_map_event(struct perf_event *event)
685 &armv6mpcore_perf_cache_map, 0xFF); 685 &armv6mpcore_perf_cache_map, 0xFF);
686} 686}
687 687
688static int __devinit armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu) 688static int armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu)
689{ 689{
690 cpu_pmu->name = "v6mpcore"; 690 cpu_pmu->name = "v6mpcore";
691 cpu_pmu->handle_irq = armv6pmu_handle_irq; 691 cpu_pmu->handle_irq = armv6pmu_handle_irq;
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 7d0cce85d17..4fbc757d9cf 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -1226,7 +1226,7 @@ static void armv7pmu_init(struct arm_pmu *cpu_pmu)
1226 cpu_pmu->max_period = (1LLU << 32) - 1; 1226 cpu_pmu->max_period = (1LLU << 32) - 1;
1227}; 1227};
1228 1228
1229static u32 __devinit armv7_read_num_pmnc_events(void) 1229static u32 armv7_read_num_pmnc_events(void)
1230{ 1230{
1231 u32 nb_cnt; 1231 u32 nb_cnt;
1232 1232
@@ -1237,7 +1237,7 @@ static u32 __devinit armv7_read_num_pmnc_events(void)
1237 return nb_cnt + 1; 1237 return nb_cnt + 1;
1238} 1238}
1239 1239
1240static int __devinit armv7_a8_pmu_init(struct arm_pmu *cpu_pmu) 1240static int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
1241{ 1241{
1242 armv7pmu_init(cpu_pmu); 1242 armv7pmu_init(cpu_pmu);
1243 cpu_pmu->name = "ARMv7 Cortex-A8"; 1243 cpu_pmu->name = "ARMv7 Cortex-A8";
@@ -1246,7 +1246,7 @@ static int __devinit armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
1246 return 0; 1246 return 0;
1247} 1247}
1248 1248
1249static int __devinit armv7_a9_pmu_init(struct arm_pmu *cpu_pmu) 1249static int armv7_a9_pmu_init(struct arm_pmu *cpu_pmu)
1250{ 1250{
1251 armv7pmu_init(cpu_pmu); 1251 armv7pmu_init(cpu_pmu);
1252 cpu_pmu->name = "ARMv7 Cortex-A9"; 1252 cpu_pmu->name = "ARMv7 Cortex-A9";
@@ -1255,7 +1255,7 @@ static int __devinit armv7_a9_pmu_init(struct arm_pmu *cpu_pmu)
1255 return 0; 1255 return 0;
1256} 1256}
1257 1257
1258static int __devinit armv7_a5_pmu_init(struct arm_pmu *cpu_pmu) 1258static int armv7_a5_pmu_init(struct arm_pmu *cpu_pmu)
1259{ 1259{
1260 armv7pmu_init(cpu_pmu); 1260 armv7pmu_init(cpu_pmu);
1261 cpu_pmu->name = "ARMv7 Cortex-A5"; 1261 cpu_pmu->name = "ARMv7 Cortex-A5";
@@ -1264,7 +1264,7 @@ static int __devinit armv7_a5_pmu_init(struct arm_pmu *cpu_pmu)
1264 return 0; 1264 return 0;
1265} 1265}
1266 1266
1267static int __devinit armv7_a15_pmu_init(struct arm_pmu *cpu_pmu) 1267static int armv7_a15_pmu_init(struct arm_pmu *cpu_pmu)
1268{ 1268{
1269 armv7pmu_init(cpu_pmu); 1269 armv7pmu_init(cpu_pmu);
1270 cpu_pmu->name = "ARMv7 Cortex-A15"; 1270 cpu_pmu->name = "ARMv7 Cortex-A15";
@@ -1274,7 +1274,7 @@ static int __devinit armv7_a15_pmu_init(struct arm_pmu *cpu_pmu)
1274 return 0; 1274 return 0;
1275} 1275}
1276 1276
1277static int __devinit armv7_a7_pmu_init(struct arm_pmu *cpu_pmu) 1277static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
1278{ 1278{
1279 armv7pmu_init(cpu_pmu); 1279 armv7pmu_init(cpu_pmu);
1280 cpu_pmu->name = "ARMv7 Cortex-A7"; 1280 cpu_pmu->name = "ARMv7 Cortex-A7";
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c
index 0c8265e53d5..2b0fe30ec12 100644
--- a/arch/arm/kernel/perf_event_xscale.c
+++ b/arch/arm/kernel/perf_event_xscale.c
@@ -440,7 +440,7 @@ static int xscale_map_event(struct perf_event *event)
440 &xscale_perf_cache_map, 0xFF); 440 &xscale_perf_cache_map, 0xFF);
441} 441}
442 442
443static int __devinit xscale1pmu_init(struct arm_pmu *cpu_pmu) 443static int xscale1pmu_init(struct arm_pmu *cpu_pmu)
444{ 444{
445 cpu_pmu->name = "xscale1"; 445 cpu_pmu->name = "xscale1";
446 cpu_pmu->handle_irq = xscale1pmu_handle_irq; 446 cpu_pmu->handle_irq = xscale1pmu_handle_irq;
@@ -810,7 +810,7 @@ static inline void xscale2pmu_write_counter(struct perf_event *event, u32 val)
810 } 810 }
811} 811}
812 812
813static int __devinit xscale2pmu_init(struct arm_pmu *cpu_pmu) 813static int xscale2pmu_init(struct arm_pmu *cpu_pmu)
814{ 814{
815 cpu_pmu->name = "xscale2"; 815 cpu_pmu->name = "xscale2";
816 cpu_pmu->handle_irq = xscale2pmu_handle_irq; 816 cpu_pmu->handle_irq = xscale2pmu_handle_irq;
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 9211e8800c7..6e2f1631df5 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -358,7 +358,7 @@ static int cpld_video_probe(struct i2c_client *client,
358 return 0; 358 return 0;
359} 359}
360 360
361static int __devexit cpld_video_remove(struct i2c_client *client) 361static int cpld_video_remove(struct i2c_client *client)
362{ 362{
363 cpld_client = NULL; 363 cpld_client = NULL;
364 return 0; 364 return 0;
diff --git a/arch/arm/mach-davinci/cdce949.c b/arch/arm/mach-davinci/cdce949.c
index f2232ca6d07..abafb92031c 100644
--- a/arch/arm/mach-davinci/cdce949.c
+++ b/arch/arm/mach-davinci/cdce949.c
@@ -256,7 +256,7 @@ static int cdce_probe(struct i2c_client *client,
256 return 0; 256 return 0;
257} 257}
258 258
259static int __devexit cdce_remove(struct i2c_client *client) 259static int cdce_remove(struct i2c_client *client)
260{ 260{
261 cdce_i2c_client = NULL; 261 cdce_i2c_client = NULL;
262 return 0; 262 return 0;
@@ -274,7 +274,7 @@ static struct i2c_driver cdce_driver = {
274 .name = "cdce949", 274 .name = "cdce949",
275 }, 275 },
276 .probe = cdce_probe, 276 .probe = cdce_probe,
277 .remove = __devexit_p(cdce_remove), 277 .remove = cdce_remove,
278 .id_table = cdce_id, 278 .id_table = cdce_id,
279}; 279};
280 280
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c
index 0ef4435b165..8a275f29752 100644
--- a/arch/arm/mach-dove/pcie.c
+++ b/arch/arm/mach-dove/pcie.c
@@ -135,7 +135,7 @@ static struct pci_ops pcie_ops = {
135 .write = pcie_wr_conf, 135 .write = pcie_wr_conf,
136}; 136};
137 137
138static void __devinit rc_pci_fixup(struct pci_dev *dev) 138static void rc_pci_fixup(struct pci_dev *dev)
139{ 139{
140 /* 140 /*
141 * Prevent enumeration of root complex. 141 * Prevent enumeration of root complex.
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 91d5b6f1d5a..e103c290bc9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -74,6 +74,8 @@ config SOC_EXYNOS5440
74 depends on ARCH_EXYNOS5 74 depends on ARCH_EXYNOS5
75 select ARM_ARCH_TIMER 75 select ARM_ARCH_TIMER
76 select AUTO_ZRELADDR 76 select AUTO_ZRELADDR
77 select PINCTRL
78 select PINCTRL_EXYNOS5440
77 help 79 help
78 Enable EXYNOS5440 SoC support 80 Enable EXYNOS5440 SoC support
79 81
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index d6d0dc65108..1a89824a5f7 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -424,11 +424,18 @@ static void __init exynos5_init_clocks(int xtal)
424{ 424{
425 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 425 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
426 426
427 /* EXYNOS5440 can support only common clock framework */
428
429 if (soc_is_exynos5440())
430 return;
431
432#ifdef CONFIG_SOC_EXYNOS5250
427 s3c24xx_register_baseclocks(xtal); 433 s3c24xx_register_baseclocks(xtal);
428 s5p_register_clocks(xtal); 434 s5p_register_clocks(xtal);
429 435
430 exynos5_register_clocks(); 436 exynos5_register_clocks();
431 exynos5_setup_clocks(); 437 exynos5_setup_clocks();
438#endif
432} 439}
433 440
434#define COMBINER_ENABLE_SET 0x0 441#define COMBINER_ENABLE_SET 0x0
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index dc248167d20..981dc1e1da5 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -135,7 +135,7 @@ static struct sys_timer highbank_timer = {
135 135
136static void highbank_power_off(void) 136static void highbank_power_off(void)
137{ 137{
138 hignbank_set_pwr_shutdown(); 138 highbank_set_pwr_shutdown();
139 139
140 while (1) 140 while (1)
141 cpu_do_idle(); 141 cpu_do_idle();
diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c
index 7b60faccd55..f30c5284339 100644
--- a/arch/arm/mach-highbank/hotplug.c
+++ b/arch/arm/mach-highbank/hotplug.c
@@ -30,7 +30,7 @@ void __ref highbank_cpu_die(unsigned int cpu)
30{ 30{
31 flush_cache_all(); 31 flush_cache_all();
32 32
33 highbank_set_cpu_jump(cpu, secondary_startup); 33 highbank_set_cpu_jump(cpu, phys_to_virt(0));
34 highbank_set_core_pwr(); 34 highbank_set_core_pwr();
35 35
36 cpu_do_idle(); 36 cpu_do_idle();
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index 1129957f6c1..4ecc864ac8b 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -32,6 +32,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
32 32
33static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) 33static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
34{ 34{
35 highbank_set_cpu_jump(cpu, secondary_startup);
35 gic_raise_softirq(cpumask_of(cpu), 0); 36 gic_raise_softirq(cpumask_of(cpu), 0);
36 return 0; 37 return 0;
37} 38}
@@ -61,19 +62,8 @@ static void __init highbank_smp_init_cpus(void)
61 62
62static void __init highbank_smp_prepare_cpus(unsigned int max_cpus) 63static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
63{ 64{
64 int i;
65
66 if (scu_base_addr) 65 if (scu_base_addr)
67 scu_enable(scu_base_addr); 66 scu_enable(scu_base_addr);
68
69 /*
70 * Write the address of secondary startup into the jump table
71 * The cores are in wfi and wait until they receive a soft interrupt
72 * and a non-zero value to jump to. Then the secondary CPU branches
73 * to this address.
74 */
75 for (i = 1; i < max_cpus; i++)
76 highbank_set_cpu_jump(i, secondary_startup);
77} 67}
78 68
79struct smp_operations highbank_smp_ops __initdata = { 69struct smp_operations highbank_smp_ops __initdata = {
diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c
index 74aa135966f..04eddb4f438 100644
--- a/arch/arm/mach-highbank/pm.c
+++ b/arch/arm/mach-highbank/pm.c
@@ -14,10 +14,12 @@
14 * this program. If not, see <http://www.gnu.org/licenses/>. 14 * this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#include <linux/cpu_pm.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/io.h> 19#include <linux/io.h>
19#include <linux/suspend.h> 20#include <linux/suspend.h>
20 21
22#include <asm/cacheflush.h>
21#include <asm/proc-fns.h> 23#include <asm/proc-fns.h>
22#include <asm/suspend.h> 24#include <asm/suspend.h>
23 25
@@ -26,16 +28,31 @@
26 28
27static int highbank_suspend_finish(unsigned long val) 29static int highbank_suspend_finish(unsigned long val)
28{ 30{
31 outer_flush_all();
32 outer_disable();
33
34 highbank_set_pwr_suspend();
35
29 cpu_do_idle(); 36 cpu_do_idle();
37
38 highbank_clear_pwr_request();
30 return 0; 39 return 0;
31} 40}
32 41
33static int highbank_pm_enter(suspend_state_t state) 42static int highbank_pm_enter(suspend_state_t state)
34{ 43{
35 hignbank_set_pwr_suspend(); 44 cpu_pm_enter();
45 cpu_cluster_pm_enter();
46
36 highbank_set_cpu_jump(0, cpu_resume); 47 highbank_set_cpu_jump(0, cpu_resume);
37 cpu_suspend(0, highbank_suspend_finish); 48 cpu_suspend(0, highbank_suspend_finish);
38 49
50 cpu_cluster_pm_exit();
51 cpu_pm_exit();
52
53 highbank_smc1(0x102, 0x1);
54 if (scu_base_addr)
55 scu_enable(scu_base_addr);
39 return 0; 56 return 0;
40} 57}
41 58
diff --git a/arch/arm/mach-highbank/sysregs.h b/arch/arm/mach-highbank/sysregs.h
index e13e8ea7c6c..70af9d13fce 100644
--- a/arch/arm/mach-highbank/sysregs.h
+++ b/arch/arm/mach-highbank/sysregs.h
@@ -44,28 +44,43 @@ static inline void highbank_set_core_pwr(void)
44 writel_relaxed(1, sregs_base + SREG_CPU_PWR_CTRL(cpu)); 44 writel_relaxed(1, sregs_base + SREG_CPU_PWR_CTRL(cpu));
45} 45}
46 46
47static inline void hignbank_set_pwr_suspend(void) 47static inline void highbank_clear_core_pwr(void)
48{
49 int cpu = cpu_logical_map(smp_processor_id());
50 if (scu_base_addr)
51 scu_power_mode(scu_base_addr, SCU_PM_NORMAL);
52 else
53 writel_relaxed(0, sregs_base + SREG_CPU_PWR_CTRL(cpu));
54}
55
56static inline void highbank_set_pwr_suspend(void)
48{ 57{
49 writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ); 58 writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
50 highbank_set_core_pwr(); 59 highbank_set_core_pwr();
51} 60}
52 61
53static inline void hignbank_set_pwr_shutdown(void) 62static inline void highbank_set_pwr_shutdown(void)
54{ 63{
55 writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ); 64 writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
56 highbank_set_core_pwr(); 65 highbank_set_core_pwr();
57} 66}
58 67
59static inline void hignbank_set_pwr_soft_reset(void) 68static inline void highbank_set_pwr_soft_reset(void)
60{ 69{
61 writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 70 writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
62 highbank_set_core_pwr(); 71 highbank_set_core_pwr();
63} 72}
64 73
65static inline void hignbank_set_pwr_hard_reset(void) 74static inline void highbank_set_pwr_hard_reset(void)
66{ 75{
67 writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 76 writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
68 highbank_set_core_pwr(); 77 highbank_set_core_pwr();
69} 78}
70 79
80static inline void highbank_clear_pwr_request(void)
81{
82 writel(~0UL, sregs_base + HB_SREG_A9_PWR_REQ);
83 highbank_clear_core_pwr();
84}
85
71#endif 86#endif
diff --git a/arch/arm/mach-highbank/system.c b/arch/arm/mach-highbank/system.c
index aed96ad9bd4..37d8384dcf1 100644
--- a/arch/arm/mach-highbank/system.c
+++ b/arch/arm/mach-highbank/system.c
@@ -22,9 +22,9 @@
22void highbank_restart(char mode, const char *cmd) 22void highbank_restart(char mode, const char *cmd)
23{ 23{
24 if (mode == 'h') 24 if (mode == 'h')
25 hignbank_set_pwr_hard_reset(); 25 highbank_set_pwr_hard_reset();
26 else 26 else
27 hignbank_set_pwr_soft_reset(); 27 highbank_set_pwr_soft_reset();
28 28
29 while (1) 29 while (1)
30 cpu_do_idle(); 30 cpu_do_idle();
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 1ad0d76de8c..3e628fd7a67 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -841,8 +841,6 @@ config SOC_IMX6Q
841 select ARCH_HAS_CPUFREQ 841 select ARCH_HAS_CPUFREQ
842 select ARCH_HAS_OPP 842 select ARCH_HAS_OPP
843 select ARM_CPU_SUSPEND if PM 843 select ARM_CPU_SUSPEND if PM
844 select ARM_ERRATA_743622
845 select ARM_ERRATA_751472
846 select ARM_ERRATA_754322 844 select ARM_ERRATA_754322
847 select ARM_ERRATA_764369 if SMP 845 select ARM_ERRATA_764369 if SMP
848 select ARM_ERRATA_775420 846 select ARM_ERRATA_775420
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index 36e8b399447..d8c75c3c925 100644
--- a/arch/arm/mach-imx/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -188,7 +188,7 @@ static struct cpufreq_driver mxc_driver = {
188 .name = "imx", 188 .name = "imx",
189}; 189};
190 190
191static int __devinit mxc_cpufreq_driver_init(void) 191static int mxc_cpufreq_driver_init(void)
192{ 192{
193 return cpufreq_register_driver(&mxc_driver); 193 return cpufreq_register_driver(&mxc_driver);
194} 194}
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index c461e98496c..7a9686ad994 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -21,7 +21,7 @@
21#define BP_MMDC_MAPSR_PSD 0 21#define BP_MMDC_MAPSR_PSD 0
22#define BP_MMDC_MAPSR_PSS 4 22#define BP_MMDC_MAPSR_PSS 4
23 23
24static int __devinit imx_mmdc_probe(struct platform_device *pdev) 24static int imx_mmdc_probe(struct platform_device *pdev)
25{ 25{
26 struct device_node *np = pdev->dev.of_node; 26 struct device_node *np = pdev->dev.of_node;
27 void __iomem *mmdc_base, *reg; 27 void __iomem *mmdc_base, *reg;
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 2f28018c444..9082b84aeeb 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -504,7 +504,7 @@ iop13xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
504 504
505/* Scan an IOP13XX PCI bus. nr selects which ATU we use. 505/* Scan an IOP13XX PCI bus. nr selects which ATU we use.
506 */ 506 */
507struct pci_bus * __devinit iop13xx_scan_bus(int nr, struct pci_sys_data *sys) 507struct pci_bus *iop13xx_scan_bus(int nr, struct pci_sys_data *sys)
508{ 508{
509 int which_atu; 509 int which_atu;
510 struct pci_bus *bus = NULL; 510 struct pci_bus *bus = NULL;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ff4150a2ad0..de4fd2bb1e2 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -67,6 +67,10 @@ static void __init kirkwood_legacy_clk_init(void)
67 orion_clkdev_add(NULL, "mv643xx_eth_port.1", 67 orion_clkdev_add(NULL, "mv643xx_eth_port.1",
68 of_clk_get_from_provider(&clkspec)); 68 of_clk_get_from_provider(&clkspec));
69 69
70 clkspec.args[0] = CGC_BIT_SDIO;
71 orion_clkdev_add(NULL, "mvsdio",
72 of_clk_get_from_provider(&clkspec));
73
70} 74}
71 75
72static void __init kirkwood_of_clk_init(void) 76static void __init kirkwood_of_clk_init(void)
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 15e69fcde9f..23d2dd1b1b1 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {
64 0 64 0
65}; 65};
66 66
67#define TOPKICK_SATA0_PWR_ENABLE 36
68
69void __init usi_topkick_init(void) 67void __init usi_topkick_init(void)
70{ 68{
71 /* 69 /*
@@ -73,8 +71,6 @@ void __init usi_topkick_init(void)
73 */ 71 */
74 kirkwood_mpp_conf(topkick_mpp_config); 72 kirkwood_mpp_conf(topkick_mpp_config);
75 73
76 /* SATA0 power enable */
77 gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
78 74
79 kirkwood_ge00_init(&topkick_ge00_data); 75 kirkwood_ge00_init(&topkick_ge00_data);
80 kirkwood_sdio_init(&topkick_mvsdio_data); 76 kirkwood_sdio_init(&topkick_mvsdio_data);
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index ef102646ba9..a1c3ab6fc80 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -214,7 +214,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
214 * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on 214 * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
215 * the device. Decoding setup is handled by the orion code. 215 * the device. Decoding setup is handled by the orion code.
216 */ 216 */
217static void __devinit rc_pci_fixup(struct pci_dev *dev) 217static void rc_pci_fixup(struct pci_dev *dev)
218{ 218{
219 if (dev->bus->parent == NULL && dev->devfn == 0) { 219 if (dev->bus->parent == NULL && dev->devfn == 0) {
220 int i; 220 int i;
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
index 255502ddd87..b0c306ccbc6 100644
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -92,7 +92,7 @@ static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
92 }, 92 },
93}; 93};
94 94
95static void __devinit acs5k_i2c_init(void) 95static void acs5k_i2c_init(void)
96{ 96{
97 /* The gpio interface */ 97 /* The gpio interface */
98 platform_device_register(&acs5k_i2c_device); 98 platform_device_register(&acs5k_i2c_device);
diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c
index a6c08ede449..bf5e64906e6 100644
--- a/arch/arm/mach-mmp/sram.c
+++ b/arch/arm/mach-mmp/sram.c
@@ -61,7 +61,7 @@ struct gen_pool *sram_get_gpool(char *pool_name)
61} 61}
62EXPORT_SYMBOL(sram_get_gpool); 62EXPORT_SYMBOL(sram_get_gpool);
63 63
64static int __devinit sram_probe(struct platform_device *pdev) 64static int sram_probe(struct platform_device *pdev)
65{ 65{
66 struct sram_platdata *pdata = pdev->dev.platform_data; 66 struct sram_platdata *pdata = pdev->dev.platform_data;
67 struct sram_bank_info *info; 67 struct sram_bank_info *info;
@@ -125,7 +125,7 @@ out:
125 return ret; 125 return ret;
126} 126}
127 127
128static int __devexit sram_remove(struct platform_device *pdev) 128static int sram_remove(struct platform_device *pdev)
129{ 129{
130 struct sram_bank_info *info; 130 struct sram_bank_info *info;
131 131
diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
index 8f1eecd8818..507f5ca8069 100644
--- a/arch/arm/mach-msm/proc_comm.c
+++ b/arch/arm/mach-msm/proc_comm.c
@@ -120,7 +120,7 @@ int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2)
120 * and unknown state. This function should be called early to 120 * and unknown state. This function should be called early to
121 * wait on the ARM9. 121 * wait on the ARM9.
122 */ 122 */
123void __devinit proc_comm_boot_wait(void) 123void proc_comm_boot_wait(void)
124{ 124{
125 void __iomem *base = MSM_SHARED_RAM_BASE; 125 void __iomem *base = MSM_SHARED_RAM_BASE;
126 126
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index c5a2eddc6cd..b1588a1ea2f 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -988,7 +988,7 @@ int smd_core_init(void)
988 return 0; 988 return 0;
989} 989}
990 990
991static int __devinit msm_smd_probe(struct platform_device *pdev) 991static int msm_smd_probe(struct platform_device *pdev)
992{ 992{
993 /* 993 /*
994 * If we haven't waited for the ARM9 to boot up till now, 994 * If we haven't waited for the ARM9 to boot up till now,
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index a9a154a646d..ee8c0b51df2 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -173,7 +173,7 @@ static struct pci_ops pcie_ops = {
173 .write = pcie_wr_conf, 173 .write = pcie_wr_conf,
174}; 174};
175 175
176static void __devinit rc_pci_fixup(struct pci_dev *dev) 176static void rc_pci_fixup(struct pci_dev *dev)
177{ 177{
178 /* 178 /*
179 * Prevent enumeration of root complex. 179 * Prevent enumeration of root complex.
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 98167a4319f..9f19069248d 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -27,7 +27,6 @@
27#include <linux/pinctrl/machine.h> 27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/pinctrl-nomadik.h> 28#include <linux/platform_data/pinctrl-nomadik.h>
29#include <linux/platform_data/clocksource-nomadik-mtu.h> 29#include <linux/platform_data/clocksource-nomadik-mtu.h>
30#include <linux/platform_data/mtd-nomadik-nand.h>
31#include <asm/hardware/vic.h> 30#include <asm/hardware/vic.h>
32#include <asm/sizes.h> 31#include <asm/sizes.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h
index b549d057154..215f8cdb400 100644
--- a/arch/arm/mach-nomadik/include/mach/irqs.h
+++ b/arch/arm/mach-nomadik/include/mach/irqs.h
@@ -22,49 +22,49 @@
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24 24
25#define IRQ_VIC_START 1 /* first VIC interrupt is 1 */ 25#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */
26 26
27/* 27/*
28 * Interrupt numbers generic for all Nomadik Chip cuts 28 * Interrupt numbers generic for all Nomadik Chip cuts
29 */ 29 */
30#define IRQ_WATCHDOG 1 30#define IRQ_WATCHDOG (IRQ_VIC_START+0)
31#define IRQ_SOFTINT 2 31#define IRQ_SOFTINT (IRQ_VIC_START+1)
32#define IRQ_CRYPTO 3 32#define IRQ_CRYPTO (IRQ_VIC_START+2)
33#define IRQ_OWM 4 33#define IRQ_OWM (IRQ_VIC_START+3)
34#define IRQ_MTU0 5 34#define IRQ_MTU0 (IRQ_VIC_START+4)
35#define IRQ_MTU1 6 35#define IRQ_MTU1 (IRQ_VIC_START+5)
36#define IRQ_GPIO0 7 36#define IRQ_GPIO0 (IRQ_VIC_START+6)
37#define IRQ_GPIO1 8 37#define IRQ_GPIO1 (IRQ_VIC_START+7)
38#define IRQ_GPIO2 9 38#define IRQ_GPIO2 (IRQ_VIC_START+8)
39#define IRQ_GPIO3 10 39#define IRQ_GPIO3 (IRQ_VIC_START+9)
40#define IRQ_RTC_RTT 11 40#define IRQ_RTC_RTT (IRQ_VIC_START+10)
41#define IRQ_SSP 12 41#define IRQ_SSP (IRQ_VIC_START+11)
42#define IRQ_UART0 13 42#define IRQ_UART0 (IRQ_VIC_START+12)
43#define IRQ_DMA1 14 43#define IRQ_DMA1 (IRQ_VIC_START+13)
44#define IRQ_CLCD_MDIF 15 44#define IRQ_CLCD_MDIF (IRQ_VIC_START+14)
45#define IRQ_DMA0 16 45#define IRQ_DMA0 (IRQ_VIC_START+15)
46#define IRQ_PWRFAIL 17 46#define IRQ_PWRFAIL (IRQ_VIC_START+16)
47#define IRQ_UART1 18 47#define IRQ_UART1 (IRQ_VIC_START+17)
48#define IRQ_FIRDA 19 48#define IRQ_FIRDA (IRQ_VIC_START+18)
49#define IRQ_MSP0 20 49#define IRQ_MSP0 (IRQ_VIC_START+19)
50#define IRQ_I2C0 21 50#define IRQ_I2C0 (IRQ_VIC_START+20)
51#define IRQ_I2C1 22 51#define IRQ_I2C1 (IRQ_VIC_START+21)
52#define IRQ_SDMMC 23 52#define IRQ_SDMMC (IRQ_VIC_START+22)
53#define IRQ_USBOTG 24 53#define IRQ_USBOTG (IRQ_VIC_START+23)
54#define IRQ_SVA_IT0 25 54#define IRQ_SVA_IT0 (IRQ_VIC_START+24)
55#define IRQ_SVA_IT1 26 55#define IRQ_SVA_IT1 (IRQ_VIC_START+25)
56#define IRQ_SAA_IT0 27 56#define IRQ_SAA_IT0 (IRQ_VIC_START+26)
57#define IRQ_SAA_IT1 28 57#define IRQ_SAA_IT1 (IRQ_VIC_START+27)
58#define IRQ_UART2 29 58#define IRQ_UART2 (IRQ_VIC_START+28)
59#define IRQ_MSP2 30 59#define IRQ_MSP2 (IRQ_VIC_START+29)
60#define IRQ_L2CC 49 60#define IRQ_L2CC (IRQ_VIC_START+30)
61#define IRQ_HPI 50 61#define IRQ_HPI (IRQ_VIC_START+31)
62#define IRQ_SKE 51 62#define IRQ_SKE (IRQ_VIC_START+32)
63#define IRQ_KP 52 63#define IRQ_KP (IRQ_VIC_START+33)
64#define IRQ_MEMST 55 64#define IRQ_MEMST (IRQ_VIC_START+34)
65#define IRQ_SGA_IT 59 65#define IRQ_SGA_IT (IRQ_VIC_START+35)
66#define IRQ_USBM 61 66#define IRQ_USBM (IRQ_VIC_START+36)
67#define IRQ_MSP1 63 67#define IRQ_MSP1 (IRQ_VIC_START+37)
68 68
69#define NOMADIK_GPIO_OFFSET (IRQ_VIC_START+64) 69#define NOMADIK_GPIO_OFFSET (IRQ_VIC_START+64)
70 70
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index a8fce3ccc70..2e98a3ac7c5 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -160,7 +160,7 @@ static struct omap_lcd_config ams_delta_lcd_config __initdata = {
160 .ctrl_name = "internal", 160 .ctrl_name = "internal",
161}; 161};
162 162
163static struct omap_usb_config ams_delta_usb_config = { 163static struct omap_usb_config ams_delta_usb_config __initdata = {
164 .register_host = 1, 164 .register_host = 1,
165 .hmc_mode = 16, 165 .hmc_mode = 16,
166 .pins[0] = 2, 166 .pins[0] = 2,
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index e962926b67b..efc8f207f6f 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -142,7 +142,7 @@ static struct omap_mbox mbox_dsp_info = {
142 142
143static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL }; 143static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
144 144
145static int __devinit omap1_mbox_probe(struct platform_device *pdev) 145static int omap1_mbox_probe(struct platform_device *pdev)
146{ 146{
147 struct resource *mem; 147 struct resource *mem;
148 int ret; 148 int ret;
@@ -165,7 +165,7 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
165 return 0; 165 return 0;
166} 166}
167 167
168static int __devexit omap1_mbox_remove(struct platform_device *pdev) 168static int omap1_mbox_remove(struct platform_device *pdev)
169{ 169{
170 omap_mbox_unregister(); 170 omap_mbox_unregister();
171 iounmap(mbox_base); 171 iounmap(mbox_base);
@@ -174,7 +174,7 @@ static int __devexit omap1_mbox_remove(struct platform_device *pdev)
174 174
175static struct platform_driver omap1_mbox_driver = { 175static struct platform_driver omap1_mbox_driver = {
176 .probe = omap1_mbox_probe, 176 .probe = omap1_mbox_probe,
177 .remove = __devexit_p(omap1_mbox_remove), 177 .remove = omap1_mbox_remove,
178 .driver = { 178 .driver = {
179 .name = "omap-mailbox", 179 .name = "omap-mailbox",
180 }, 180 },
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 104fed366b8..1a1db5971cd 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -629,8 +629,14 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
629static inline void omap_1510_usb_init(struct omap_usb_config *config) {} 629static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
630#endif 630#endif
631 631
632void __init omap1_usb_init(struct omap_usb_config *pdata) 632void __init omap1_usb_init(struct omap_usb_config *_pdata)
633{ 633{
634 struct omap_usb_config *pdata;
635
636 pdata = kmemdup(_pdata, sizeof(*pdata), GFP_KERNEL);
637 if (!pdata)
638 return;
639
634 pdata->usb0_init = omap1_usb0_init; 640 pdata->usb0_init = omap1_usb0_init;
635 pdata->usb1_init = omap1_usb1_init; 641 pdata->usb1_init = omap1_usb1_init;
636 pdata->usb2_init = omap1_usb2_init; 642 pdata->usb2_init = omap1_usb2_init;
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index bdf39481fbd..6ef87580c33 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -1167,6 +1167,8 @@ static const struct clk_ops emu_src_ck_ops = {
1167 .recalc_rate = &omap2_clksel_recalc, 1167 .recalc_rate = &omap2_clksel_recalc,
1168 .get_parent = &omap2_clksel_find_parent_index, 1168 .get_parent = &omap2_clksel_find_parent_index,
1169 .set_parent = &omap2_clksel_set_parent, 1169 .set_parent = &omap2_clksel_set_parent,
1170 .enable = &omap2_clkops_enable_clkdm,
1171 .disable = &omap2_clkops_disable_clkdm,
1170}; 1172};
1171 1173
1172static struct clk emu_src_ck; 1174static struct clk emu_src_ck;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 65468f6d7f0..8033cb747c8 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -744,7 +744,7 @@ static int gpmc_setup_irq(void)
744 return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL); 744 return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL);
745} 745}
746 746
747static __devexit int gpmc_free_irq(void) 747static int gpmc_free_irq(void)
748{ 748{
749 int i; 749 int i;
750 750
@@ -762,7 +762,7 @@ static __devexit int gpmc_free_irq(void)
762 return 0; 762 return 0;
763} 763}
764 764
765static void __devexit gpmc_mem_exit(void) 765static void gpmc_mem_exit(void)
766{ 766{
767 int cs; 767 int cs;
768 768
@@ -774,7 +774,7 @@ static void __devexit gpmc_mem_exit(void)
774 774
775} 775}
776 776
777static int __devinit gpmc_mem_init(void) 777static int gpmc_mem_init(void)
778{ 778{
779 int cs, rc; 779 int cs, rc;
780 unsigned long boot_rom_space = 0; 780 unsigned long boot_rom_space = 0;
@@ -1121,7 +1121,7 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
1121 return 0; 1121 return 0;
1122} 1122}
1123 1123
1124static __devinit int gpmc_probe(struct platform_device *pdev) 1124static int gpmc_probe(struct platform_device *pdev)
1125{ 1125{
1126 int rc; 1126 int rc;
1127 u32 l; 1127 u32 l;
@@ -1177,7 +1177,7 @@ static __devinit int gpmc_probe(struct platform_device *pdev)
1177 return 0; 1177 return 0;
1178} 1178}
1179 1179
1180static __devexit int gpmc_remove(struct platform_device *pdev) 1180static int gpmc_remove(struct platform_device *pdev)
1181{ 1181{
1182 gpmc_free_irq(); 1182 gpmc_free_irq();
1183 gpmc_mem_exit(); 1183 gpmc_mem_exit();
@@ -1187,7 +1187,7 @@ static __devexit int gpmc_remove(struct platform_device *pdev)
1187 1187
1188static struct platform_driver gpmc_driver = { 1188static struct platform_driver gpmc_driver = {
1189 .probe = gpmc_probe, 1189 .probe = gpmc_probe,
1190 .remove = __devexit_p(gpmc_remove), 1190 .remove = gpmc_remove,
1191 .driver = { 1191 .driver = {
1192 .name = DEVICE_NAME, 1192 .name = DEVICE_NAME,
1193 .owner = THIS_MODULE, 1193 .owner = THIS_MODULE,
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 0d974565f8c..0b080267b7f 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -342,7 +342,7 @@ struct omap_mbox mbox_2_info = {
342struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL }; 342struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
343#endif 343#endif
344 344
345static int __devinit omap2_mbox_probe(struct platform_device *pdev) 345static int omap2_mbox_probe(struct platform_device *pdev)
346{ 346{
347 struct resource *mem; 347 struct resource *mem;
348 int ret; 348 int ret;
@@ -395,7 +395,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
395 return 0; 395 return 0;
396} 396}
397 397
398static int __devexit omap2_mbox_remove(struct platform_device *pdev) 398static int omap2_mbox_remove(struct platform_device *pdev)
399{ 399{
400 omap_mbox_unregister(); 400 omap_mbox_unregister();
401 iounmap(mbox_base); 401 iounmap(mbox_base);
@@ -404,7 +404,7 @@ static int __devexit omap2_mbox_remove(struct platform_device *pdev)
404 404
405static struct platform_driver omap2_mbox_driver = { 405static struct platform_driver omap2_mbox_driver = {
406 .probe = omap2_mbox_probe, 406 .probe = omap2_mbox_probe,
407 .remove = __devexit_p(omap2_mbox_remove), 407 .remove = omap2_mbox_remove,
408 .driver = { 408 .driver = {
409 .name = "omap-mailbox", 409 .name = "omap-mailbox",
410 }, 410 },
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 081c71edddf..646c14d9fdb 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -2070,7 +2070,7 @@ static struct omap_hwmod_irq_info am33xx_usbss_mpu_irqs[] = {
2070 { .name = "usbss-irq", .irq = 17 + OMAP_INTC_START, }, 2070 { .name = "usbss-irq", .irq = 17 + OMAP_INTC_START, },
2071 { .name = "musb0-irq", .irq = 18 + OMAP_INTC_START, }, 2071 { .name = "musb0-irq", .irq = 18 + OMAP_INTC_START, },
2072 { .name = "musb1-irq", .irq = 19 + OMAP_INTC_START, }, 2072 { .name = "musb1-irq", .irq = 19 + OMAP_INTC_START, },
2073 { .irq = -1 + OMAP_INTC_START, }, 2073 { .irq = -1, },
2074}; 2074};
2075 2075
2076static struct omap_hwmod am33xx_usbss_hwmod = { 2076static struct omap_hwmod am33xx_usbss_hwmod = {
@@ -2515,7 +2515,7 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {
2515 .user = OCP_USER_MPU, 2515 .user = OCP_USER_MPU,
2516}; 2516};
2517 2517
2518struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = { 2518static struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
2519 { 2519 {
2520 .pa_start = 0x4A101000, 2520 .pa_start = 0x4A101000,
2521 .pa_end = 0x4A101000 + SZ_256 - 1, 2521 .pa_end = 0x4A101000 + SZ_256 - 1,
@@ -2523,7 +2523,7 @@ struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
2523 { } 2523 { }
2524}; 2524};
2525 2525
2526struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = { 2526static struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
2527 .master = &am33xx_cpgmac0_hwmod, 2527 .master = &am33xx_cpgmac0_hwmod,
2528 .slave = &am33xx_mdio_hwmod, 2528 .slave = &am33xx_mdio_hwmod,
2529 .addr = am33xx_mdio_addr_space, 2529 .addr = am33xx_mdio_addr_space,
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c
index cc0e71430af..418de9c3b31 100644
--- a/arch/arm/mach-omap2/prm2xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx.c
@@ -28,6 +28,14 @@
28#include "prm-regbits-24xx.h" 28#include "prm-regbits-24xx.h"
29 29
30/* 30/*
31 * OMAP24xx PM_PWSTCTRL_*.POWERSTATE and PM_PWSTST_*.LASTSTATEENTERED bits -
32 * these are reversed from the bits used on OMAP3+
33 */
34#define OMAP24XX_PWRDM_POWER_ON 0x0
35#define OMAP24XX_PWRDM_POWER_RET 0x1
36#define OMAP24XX_PWRDM_POWER_OFF 0x3
37
38/*
31 * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP 39 * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP
32 * hardware register (which are specific to the OMAP2xxx SoCs) to 40 * hardware register (which are specific to the OMAP2xxx SoCs) to
33 * reset source ID bit shifts (which is an OMAP SoC-independent 41 * reset source ID bit shifts (which is an OMAP SoC-independent
@@ -68,6 +76,34 @@ static u32 omap2xxx_prm_read_reset_sources(void)
68} 76}
69 77
70/** 78/**
79 * omap2xxx_pwrst_to_common_pwrst - convert OMAP2xxx pwrst to common pwrst
80 * @omap2xxx_pwrst: OMAP2xxx hardware power state to convert
81 *
82 * Return the common power state bits corresponding to the OMAP2xxx
83 * hardware power state bits @omap2xxx_pwrst, or -EINVAL upon error.
84 */
85static int omap2xxx_pwrst_to_common_pwrst(u8 omap2xxx_pwrst)
86{
87 u8 pwrst;
88
89 switch (omap2xxx_pwrst) {
90 case OMAP24XX_PWRDM_POWER_OFF:
91 pwrst = PWRDM_POWER_OFF;
92 break;
93 case OMAP24XX_PWRDM_POWER_RET:
94 pwrst = PWRDM_POWER_RET;
95 break;
96 case OMAP24XX_PWRDM_POWER_ON:
97 pwrst = PWRDM_POWER_ON;
98 break;
99 default:
100 return -EINVAL;
101 }
102
103 return pwrst;
104}
105
106/**
71 * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC 107 * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
72 * 108 *
73 * Set the DPLL reset bit, which should reboot the SoC. This is the 109 * Set the DPLL reset bit, which should reboot the SoC. This is the
@@ -97,10 +133,56 @@ int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm)
97 return 0; 133 return 0;
98} 134}
99 135
136static int omap2xxx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
137{
138 u8 omap24xx_pwrst;
139
140 switch (pwrst) {
141 case PWRDM_POWER_OFF:
142 omap24xx_pwrst = OMAP24XX_PWRDM_POWER_OFF;
143 break;
144 case PWRDM_POWER_RET:
145 omap24xx_pwrst = OMAP24XX_PWRDM_POWER_RET;
146 break;
147 case PWRDM_POWER_ON:
148 omap24xx_pwrst = OMAP24XX_PWRDM_POWER_ON;
149 break;
150 default:
151 return -EINVAL;
152 }
153
154 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
155 (omap24xx_pwrst << OMAP_POWERSTATE_SHIFT),
156 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
157 return 0;
158}
159
160static int omap2xxx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
161{
162 u8 omap2xxx_pwrst;
163
164 omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
165 OMAP2_PM_PWSTCTRL,
166 OMAP_POWERSTATE_MASK);
167
168 return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst);
169}
170
171static int omap2xxx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
172{
173 u8 omap2xxx_pwrst;
174
175 omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
176 OMAP2_PM_PWSTST,
177 OMAP_POWERSTATEST_MASK);
178
179 return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst);
180}
181
100struct pwrdm_ops omap2_pwrdm_operations = { 182struct pwrdm_ops omap2_pwrdm_operations = {
101 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst, 183 .pwrdm_set_next_pwrst = omap2xxx_pwrdm_set_next_pwrst,
102 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst, 184 .pwrdm_read_next_pwrst = omap2xxx_pwrdm_read_next_pwrst,
103 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst, 185 .pwrdm_read_pwrst = omap2xxx_pwrdm_read_pwrst,
104 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst, 186 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
105 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst, 187 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
106 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst, 188 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 30517f5af70..a3e121f94a8 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -103,28 +103,6 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
103/* Powerdomain low-level functions */ 103/* Powerdomain low-level functions */
104 104
105/* Common functions across OMAP2 and OMAP3 */ 105/* Common functions across OMAP2 and OMAP3 */
106int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
107{
108 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
109 (pwrst << OMAP_POWERSTATE_SHIFT),
110 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
111 return 0;
112}
113
114int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
115{
116 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
117 OMAP2_PM_PWSTCTRL,
118 OMAP_POWERSTATE_MASK);
119}
120
121int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
122{
123 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
124 OMAP2_PM_PWSTST,
125 OMAP_POWERSTATEST_MASK);
126}
127
128int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, 106int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
129 u8 pwrst) 107 u8 pwrst)
130{ 108{
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 39822aabcff..e648bd55b07 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -277,6 +277,28 @@ static u32 omap3xxx_prm_read_reset_sources(void)
277 277
278/* Powerdomain low-level functions */ 278/* Powerdomain low-level functions */
279 279
280static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
281{
282 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
283 (pwrst << OMAP_POWERSTATE_SHIFT),
284 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
285 return 0;
286}
287
288static int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
289{
290 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
291 OMAP2_PM_PWSTCTRL,
292 OMAP_POWERSTATE_MASK);
293}
294
295static int omap3_pwrdm_read_pwrst(struct powerdomain *pwrdm)
296{
297 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
298 OMAP2_PM_PWSTST,
299 OMAP_POWERSTATEST_MASK);
300}
301
280/* Applicable only for OMAP3. Not supported on OMAP2 */ 302/* Applicable only for OMAP3. Not supported on OMAP2 */
281static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) 303static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
282{ 304{
@@ -355,9 +377,9 @@ static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
355} 377}
356 378
357struct pwrdm_ops omap3_pwrdm_operations = { 379struct pwrdm_ops omap3_pwrdm_operations = {
358 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst, 380 .pwrdm_set_next_pwrst = omap3_pwrdm_set_next_pwrst,
359 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst, 381 .pwrdm_read_next_pwrst = omap3_pwrdm_read_next_pwrst,
360 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst, 382 .pwrdm_read_pwrst = omap3_pwrdm_read_pwrst,
361 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst, 383 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst,
362 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst, 384 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
363 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst, 385 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 7498bc77fe8..c05a343d465 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -56,9 +56,9 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
56 * enumeration) 56 * enumeration)
57 */ 57 */
58static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = { 58static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = {
59 { OMAP4430_RST_GLOBAL_WARM_SW_SHIFT, 59 { OMAP4430_GLOBAL_WARM_SW_RST_SHIFT,
60 OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT }, 60 OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT },
61 { OMAP4430_RST_GLOBAL_COLD_SW_SHIFT, 61 { OMAP4430_GLOBAL_COLD_RST_SHIFT,
62 OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT }, 62 OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },
63 { OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT, 63 { OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT,
64 OMAP_SECU_VIOL_RST_SRC_ID_SHIFT }, 64 OMAP_SECU_VIOL_RST_SRC_ID_SHIFT },
@@ -333,7 +333,7 @@ static u32 omap44xx_prm_read_reset_sources(void)
333 u32 r = 0; 333 u32 r = 0;
334 u32 v; 334 u32 v;
335 335
336 v = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, 336 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
337 OMAP4_RM_RSTST); 337 OMAP4_RM_RSTST);
338 338
339 p = omap44xx_prm_reset_src_map; 339 p = omap44xx_prm_reset_src_map;
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index 22b0979206c..8ee1fbdec56 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -62,8 +62,8 @@
62 62
63/* OMAP4 specific register offsets */ 63/* OMAP4 specific register offsets */
64#define OMAP4_RM_RSTCTRL 0x0000 64#define OMAP4_RM_RSTCTRL 0x0000
65#define OMAP4_RM_RSTTIME 0x0004 65#define OMAP4_RM_RSTST 0x0004
66#define OMAP4_RM_RSTST 0x0008 66#define OMAP4_RM_RSTTIME 0x0008
67#define OMAP4_PM_PWSTCTRL 0x0000 67#define OMAP4_PM_PWSTCTRL 0x0000
68#define OMAP4_PM_PWSTST 0x0004 68#define OMAP4_PM_PWSTST 0x0004
69 69
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index cd50e328db2..d9c7c3bf0d9 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -506,7 +506,7 @@ static int __init pci_setup(struct pci_sys_data *sys)
506/***************************************************************************** 506/*****************************************************************************
507 * General PCIe + PCI 507 * General PCIe + PCI
508 ****************************************************************************/ 508 ****************************************************************************/
509static void __devinit rc_pci_fixup(struct pci_dev *dev) 509static void rc_pci_fixup(struct pci_dev *dev)
510{ 510{
511 /* 511 /*
512 * Prevent enumeration of root complex. 512 * Prevent enumeration of root complex.
diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
index fb5a7910af3..9936c180bf0 100644
--- a/arch/arm/mach-prima2/pm.c
+++ b/arch/arm/mach-prima2/pm.c
@@ -123,7 +123,7 @@ static const struct of_device_id memc_ids[] = {
123 {} 123 {}
124}; 124};
125 125
126static int __devinit sirfsoc_memc_probe(struct platform_device *op) 126static int sirfsoc_memc_probe(struct platform_device *op)
127{ 127{
128 struct device_node *np = op->dev.of_node; 128 struct device_node *np = op->dev.of_node;
129 129
diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c
index 9d80f1e20a9..55735360213 100644
--- a/arch/arm/mach-prima2/rtciobrg.c
+++ b/arch/arm/mach-prima2/rtciobrg.c
@@ -107,7 +107,7 @@ static const struct of_device_id rtciobrg_ids[] = {
107 {} 107 {}
108}; 108};
109 109
110static int __devinit sirfsoc_rtciobrg_probe(struct platform_device *op) 110static int sirfsoc_rtciobrg_probe(struct platform_device *op)
111{ 111{
112 struct device_node *np = op->dev.of_node; 112 struct device_node *np = op->dev.of_node;
113 113
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index 048c4299473..7a39efc5086 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -198,7 +198,7 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
198 198
199static struct platform_device *corgipm_device; 199static struct platform_device *corgipm_device;
200 200
201static int __devinit corgipm_init(void) 201static int corgipm_init(void)
202{ 202{
203 int ret; 203 int ret;
204 204
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index a611ad3153c..b6132aa95dc 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -463,6 +463,9 @@
463 GPIO76_LCD_PCLK, \ 463 GPIO76_LCD_PCLK, \
464 GPIO77_LCD_BIAS 464 GPIO77_LCD_BIAS
465 465
466/* these enable a work-around for a hw bug in pxa27x during ac97 warm reset */
467#define GPIO113_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO113, AF0, DEFAULT)
468#define GPIO95_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO95, AF0, DEFAULT)
466 469
467extern int keypad_set_wake(unsigned int on); 470extern int keypad_set_wake(unsigned int on);
468#endif /* __ASM_ARCH_MFP_PXA27X_H */ 471#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 8047ee0effc..616cb87b617 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -47,9 +47,9 @@ void pxa27x_clear_otgph(void)
47EXPORT_SYMBOL(pxa27x_clear_otgph); 47EXPORT_SYMBOL(pxa27x_clear_otgph);
48 48
49static unsigned long ac97_reset_config[] = { 49static unsigned long ac97_reset_config[] = {
50 GPIO113_GPIO, 50 GPIO113_AC97_nRESET_GPIO_HIGH,
51 GPIO113_AC97_nRESET, 51 GPIO113_AC97_nRESET,
52 GPIO95_GPIO, 52 GPIO95_AC97_nRESET_GPIO_HIGH,
53 GPIO95_AC97_nRESET, 53 GPIO95_AC97_nRESET,
54}; 54};
55 55
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index ec55c575ed1..0a36d3585f2 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -829,7 +829,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {
829}; 829};
830#endif 830#endif
831 831
832static int __devinit sharpsl_pm_probe(struct platform_device *pdev) 832static int sharpsl_pm_probe(struct platform_device *pdev)
833{ 833{
834 int ret, irq; 834 int ret, irq;
835 835
@@ -941,7 +941,7 @@ static struct platform_driver sharpsl_pm_driver = {
941 }, 941 },
942}; 942};
943 943
944static int __devinit sharpsl_pm_init(void) 944static int sharpsl_pm_init(void)
945{ 945{
946 return platform_driver_register(&sharpsl_pm_driver); 946 return platform_driver_register(&sharpsl_pm_driver);
947} 947}
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 842596d4d31..e191f9996b2 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -232,7 +232,7 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
232 232
233static struct platform_device *spitzpm_device; 233static struct platform_device *spitzpm_device;
234 234
235static int __devinit spitzpm_init(void) 235static int spitzpm_init(void)
236{ 236{
237 int ret; 237 int ret;
238 238
diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c
index b9b1e5c2b29..fc3646c2c69 100644
--- a/arch/arm/mach-pxa/tosa-bt.c
+++ b/arch/arm/mach-pxa/tosa-bt.c
@@ -102,7 +102,7 @@ err_reset:
102 return rc; 102 return rc;
103} 103}
104 104
105static int __devexit tosa_bt_remove(struct platform_device *dev) 105static int tosa_bt_remove(struct platform_device *dev)
106{ 106{
107 struct tosa_bt_data *data = dev->dev.platform_data; 107 struct tosa_bt_data *data = dev->dev.platform_data;
108 struct rfkill *rfk = platform_get_drvdata(dev); 108 struct rfkill *rfk = platform_get_drvdata(dev);
@@ -125,7 +125,7 @@ static int __devexit tosa_bt_remove(struct platform_device *dev)
125 125
126static struct platform_driver tosa_bt_driver = { 126static struct platform_driver tosa_bt_driver = {
127 .probe = tosa_bt_probe, 127 .probe = tosa_bt_probe,
128 .remove = __devexit_p(tosa_bt_remove), 128 .remove = tosa_bt_remove,
129 129
130 .driver = { 130 .driver = {
131 .name = "tosa-bt", 131 .name = "tosa-bt",
diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
index 57aee916bdb..3f40c61b6e0 100644
--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
@@ -62,7 +62,7 @@ static const struct rfkill_ops h1940bt_rfkill_ops = {
62 .set_block = h1940bt_set_block, 62 .set_block = h1940bt_set_block,
63}; 63};
64 64
65static int __devinit h1940bt_probe(struct platform_device *pdev) 65static int h1940bt_probe(struct platform_device *pdev)
66{ 66{
67 struct rfkill *rfk; 67 struct rfkill *rfk;
68 int ret = 0; 68 int ret = 0;
diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
index 5876c6ba750..45e74363aaa 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
@@ -93,7 +93,7 @@ static struct notifier_block osiris_dvs_nb = {
93 .notifier_call = osiris_dvs_notify, 93 .notifier_call = osiris_dvs_notify,
94}; 94};
95 95
96static int __devinit osiris_dvs_probe(struct platform_device *pdev) 96static int osiris_dvs_probe(struct platform_device *pdev)
97{ 97{
98 int ret; 98 int ret;
99 99
@@ -126,7 +126,7 @@ err_nogpio:
126 return ret; 126 return ret;
127} 127}
128 128
129static int __devexit osiris_dvs_remove(struct platform_device *pdev) 129static int osiris_dvs_remove(struct platform_device *pdev)
130{ 130{
131 dev_info(&pdev->dev, "exiting\n"); 131 dev_info(&pdev->dev, "exiting\n");
132 132
@@ -167,7 +167,7 @@ static const struct dev_pm_ops osiris_dvs_pm = {
167 167
168static struct platform_driver osiris_dvs_driver = { 168static struct platform_driver osiris_dvs_driver = {
169 .probe = osiris_dvs_probe, 169 .probe = osiris_dvs_probe,
170 .remove = __devexit_p(osiris_dvs_remove), 170 .remove = osiris_dvs_remove,
171 .driver = { 171 .driver = {
172 .name = "osiris-dvs", 172 .name = "osiris-dvs",
173 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index c6d8dba9062..553059f5184 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -290,7 +290,7 @@ static const struct i2c_board_info wm2200_i2c[] = {
290 .platform_data = &wm2200_pdata, }, 290 .platform_data = &wm2200_pdata, },
291}; 291};
292 292
293static __devinitdata const struct { 293static const struct {
294 u8 id; 294 u8 id;
295 u8 rev; 295 u8 rev;
296 const char *name; 296 const char *name;
@@ -343,8 +343,8 @@ static __devinitdata const struct {
343 .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) }, 343 .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) },
344}; 344};
345 345
346static __devinit int wlf_gf_module_probe(struct i2c_client *i2c, 346static int wlf_gf_module_probe(struct i2c_client *i2c,
347 const struct i2c_device_id *i2c_id) 347 const struct i2c_device_id *i2c_id)
348{ 348{
349 int ret, i, j, id, rev; 349 int ret, i, j, id, rev;
350 350
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index cdde249166b..bf6311a28f3 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -171,7 +171,7 @@ static struct fb_videomode crag6410_lcd_timing = {
171}; 171};
172 172
173/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ 173/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
174static struct s3c_fb_platdata crag6410_lcd_pdata __devinitdata = { 174static struct s3c_fb_platdata crag6410_lcd_pdata = {
175 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, 175 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
176 .vtiming = &crag6410_lcd_timing, 176 .vtiming = &crag6410_lcd_timing,
177 .win[0] = &crag6410_fb_win0, 177 .win[0] = &crag6410_fb_win0,
@@ -181,7 +181,7 @@ static struct s3c_fb_platdata crag6410_lcd_pdata __devinitdata = {
181 181
182/* 2x6 keypad */ 182/* 2x6 keypad */
183 183
184static uint32_t crag6410_keymap[] __devinitdata = { 184static uint32_t crag6410_keymap[] = {
185 /* KEY(row, col, keycode) */ 185 /* KEY(row, col, keycode) */
186 KEY(0, 0, KEY_VOLUMEUP), 186 KEY(0, 0, KEY_VOLUMEUP),
187 KEY(0, 1, KEY_HOME), 187 KEY(0, 1, KEY_HOME),
@@ -197,12 +197,12 @@ static uint32_t crag6410_keymap[] __devinitdata = {
197 KEY(1, 5, KEY_CAMERA), 197 KEY(1, 5, KEY_CAMERA),
198}; 198};
199 199
200static struct matrix_keymap_data crag6410_keymap_data __devinitdata = { 200static struct matrix_keymap_data crag6410_keymap_data = {
201 .keymap = crag6410_keymap, 201 .keymap = crag6410_keymap,
202 .keymap_size = ARRAY_SIZE(crag6410_keymap), 202 .keymap_size = ARRAY_SIZE(crag6410_keymap),
203}; 203};
204 204
205static struct samsung_keypad_platdata crag6410_keypad_data __devinitdata = { 205static struct samsung_keypad_platdata crag6410_keypad_data = {
206 .keymap_data = &crag6410_keymap_data, 206 .keymap_data = &crag6410_keymap_data,
207 .rows = 2, 207 .rows = 2,
208 .cols = 6, 208 .cols = 6,
@@ -407,11 +407,11 @@ static struct wm831x_buckv_pdata vddarm_pdata = {
407 .dvs_gpio = S3C64XX_GPK(0), 407 .dvs_gpio = S3C64XX_GPK(0),
408}; 408};
409 409
410static struct regulator_consumer_supply vddarm_consumers[] __devinitdata = { 410static struct regulator_consumer_supply vddarm_consumers[] = {
411 REGULATOR_SUPPLY("vddarm", NULL), 411 REGULATOR_SUPPLY("vddarm", NULL),
412}; 412};
413 413
414static struct regulator_init_data vddarm __devinitdata = { 414static struct regulator_init_data vddarm = {
415 .constraints = { 415 .constraints = {
416 .name = "VDDARM", 416 .name = "VDDARM",
417 .min_uV = 1000000, 417 .min_uV = 1000000,
@@ -425,11 +425,11 @@ static struct regulator_init_data vddarm __devinitdata = {
425 .driver_data = &vddarm_pdata, 425 .driver_data = &vddarm_pdata,
426}; 426};
427 427
428static struct regulator_consumer_supply vddint_consumers[] __devinitdata = { 428static struct regulator_consumer_supply vddint_consumers[] = {
429 REGULATOR_SUPPLY("vddint", NULL), 429 REGULATOR_SUPPLY("vddint", NULL),
430}; 430};
431 431
432static struct regulator_init_data vddint __devinitdata = { 432static struct regulator_init_data vddint = {
433 .constraints = { 433 .constraints = {
434 .name = "VDDINT", 434 .name = "VDDINT",
435 .min_uV = 1000000, 435 .min_uV = 1000000,
@@ -442,27 +442,27 @@ static struct regulator_init_data vddint __devinitdata = {
442 .supply_regulator = "WALLVDD", 442 .supply_regulator = "WALLVDD",
443}; 443};
444 444
445static struct regulator_init_data vddmem __devinitdata = { 445static struct regulator_init_data vddmem = {
446 .constraints = { 446 .constraints = {
447 .name = "VDDMEM", 447 .name = "VDDMEM",
448 .always_on = 1, 448 .always_on = 1,
449 }, 449 },
450}; 450};
451 451
452static struct regulator_init_data vddsys __devinitdata = { 452static struct regulator_init_data vddsys = {
453 .constraints = { 453 .constraints = {
454 .name = "VDDSYS,VDDEXT,VDDPCM,VDDSS", 454 .name = "VDDSYS,VDDEXT,VDDPCM,VDDSS",
455 .always_on = 1, 455 .always_on = 1,
456 }, 456 },
457}; 457};
458 458
459static struct regulator_consumer_supply vddmmc_consumers[] __devinitdata = { 459static struct regulator_consumer_supply vddmmc_consumers[] = {
460 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), 460 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
461 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.1"), 461 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.1"),
462 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"), 462 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
463}; 463};
464 464
465static struct regulator_init_data vddmmc __devinitdata = { 465static struct regulator_init_data vddmmc = {
466 .constraints = { 466 .constraints = {
467 .name = "VDDMMC,UH", 467 .name = "VDDMMC,UH",
468 .always_on = 1, 468 .always_on = 1,
@@ -472,7 +472,7 @@ static struct regulator_init_data vddmmc __devinitdata = {
472 .supply_regulator = "WALLVDD", 472 .supply_regulator = "WALLVDD",
473}; 473};
474 474
475static struct regulator_init_data vddotgi __devinitdata = { 475static struct regulator_init_data vddotgi = {
476 .constraints = { 476 .constraints = {
477 .name = "VDDOTGi", 477 .name = "VDDOTGi",
478 .always_on = 1, 478 .always_on = 1,
@@ -480,7 +480,7 @@ static struct regulator_init_data vddotgi __devinitdata = {
480 .supply_regulator = "WALLVDD", 480 .supply_regulator = "WALLVDD",
481}; 481};
482 482
483static struct regulator_init_data vddotg __devinitdata = { 483static struct regulator_init_data vddotg = {
484 .constraints = { 484 .constraints = {
485 .name = "VDDOTG", 485 .name = "VDDOTG",
486 .always_on = 1, 486 .always_on = 1,
@@ -488,7 +488,7 @@ static struct regulator_init_data vddotg __devinitdata = {
488 .supply_regulator = "WALLVDD", 488 .supply_regulator = "WALLVDD",
489}; 489};
490 490
491static struct regulator_init_data vddhi __devinitdata = { 491static struct regulator_init_data vddhi = {
492 .constraints = { 492 .constraints = {
493 .name = "VDDHI", 493 .name = "VDDHI",
494 .always_on = 1, 494 .always_on = 1,
@@ -496,7 +496,7 @@ static struct regulator_init_data vddhi __devinitdata = {
496 .supply_regulator = "WALLVDD", 496 .supply_regulator = "WALLVDD",
497}; 497};
498 498
499static struct regulator_init_data vddadc __devinitdata = { 499static struct regulator_init_data vddadc = {
500 .constraints = { 500 .constraints = {
501 .name = "VDDADC,VDDDAC", 501 .name = "VDDADC,VDDDAC",
502 .always_on = 1, 502 .always_on = 1,
@@ -504,7 +504,7 @@ static struct regulator_init_data vddadc __devinitdata = {
504 .supply_regulator = "WALLVDD", 504 .supply_regulator = "WALLVDD",
505}; 505};
506 506
507static struct regulator_init_data vddmem0 __devinitdata = { 507static struct regulator_init_data vddmem0 = {
508 .constraints = { 508 .constraints = {
509 .name = "VDDMEM0", 509 .name = "VDDMEM0",
510 .always_on = 1, 510 .always_on = 1,
@@ -512,7 +512,7 @@ static struct regulator_init_data vddmem0 __devinitdata = {
512 .supply_regulator = "WALLVDD", 512 .supply_regulator = "WALLVDD",
513}; 513};
514 514
515static struct regulator_init_data vddpll __devinitdata = { 515static struct regulator_init_data vddpll = {
516 .constraints = { 516 .constraints = {
517 .name = "VDDPLL", 517 .name = "VDDPLL",
518 .always_on = 1, 518 .always_on = 1,
@@ -520,7 +520,7 @@ static struct regulator_init_data vddpll __devinitdata = {
520 .supply_regulator = "WALLVDD", 520 .supply_regulator = "WALLVDD",
521}; 521};
522 522
523static struct regulator_init_data vddlcd __devinitdata = { 523static struct regulator_init_data vddlcd = {
524 .constraints = { 524 .constraints = {
525 .name = "VDDLCD", 525 .name = "VDDLCD",
526 .always_on = 1, 526 .always_on = 1,
@@ -528,7 +528,7 @@ static struct regulator_init_data vddlcd __devinitdata = {
528 .supply_regulator = "WALLVDD", 528 .supply_regulator = "WALLVDD",
529}; 529};
530 530
531static struct regulator_init_data vddalive __devinitdata = { 531static struct regulator_init_data vddalive = {
532 .constraints = { 532 .constraints = {
533 .name = "VDDALIVE", 533 .name = "VDDALIVE",
534 .always_on = 1, 534 .always_on = 1,
@@ -536,28 +536,28 @@ static struct regulator_init_data vddalive __devinitdata = {
536 .supply_regulator = "WALLVDD", 536 .supply_regulator = "WALLVDD",
537}; 537};
538 538
539static struct wm831x_backup_pdata banff_backup_pdata __devinitdata = { 539static struct wm831x_backup_pdata banff_backup_pdata = {
540 .charger_enable = 1, 540 .charger_enable = 1,
541 .vlim = 2500, /* mV */ 541 .vlim = 2500, /* mV */
542 .ilim = 200, /* uA */ 542 .ilim = 200, /* uA */
543}; 543};
544 544
545static struct wm831x_status_pdata banff_red_led __devinitdata = { 545static struct wm831x_status_pdata banff_red_led = {
546 .name = "banff:red:", 546 .name = "banff:red:",
547 .default_src = WM831X_STATUS_MANUAL, 547 .default_src = WM831X_STATUS_MANUAL,
548}; 548};
549 549
550static struct wm831x_status_pdata banff_green_led __devinitdata = { 550static struct wm831x_status_pdata banff_green_led = {
551 .name = "banff:green:", 551 .name = "banff:green:",
552 .default_src = WM831X_STATUS_MANUAL, 552 .default_src = WM831X_STATUS_MANUAL,
553}; 553};
554 554
555static struct wm831x_touch_pdata touch_pdata __devinitdata = { 555static struct wm831x_touch_pdata touch_pdata = {
556 .data_irq = S3C_EINT(26), 556 .data_irq = S3C_EINT(26),
557 .pd_irq = S3C_EINT(27), 557 .pd_irq = S3C_EINT(27),
558}; 558};
559 559
560static struct wm831x_pdata crag_pmic_pdata __devinitdata = { 560static struct wm831x_pdata crag_pmic_pdata = {
561 .wm831x_num = 1, 561 .wm831x_num = 1,
562 .gpio_base = BANFF_PMIC_GPIO_BASE, 562 .gpio_base = BANFF_PMIC_GPIO_BASE,
563 .soft_shutdown = true, 563 .soft_shutdown = true,
@@ -601,7 +601,7 @@ static struct wm831x_pdata crag_pmic_pdata __devinitdata = {
601 .touch = &touch_pdata, 601 .touch = &touch_pdata,
602}; 602};
603 603
604static struct i2c_board_info i2c_devs0[] __devinitdata = { 604static struct i2c_board_info i2c_devs0[] = {
605 { I2C_BOARD_INFO("24c08", 0x50), }, 605 { I2C_BOARD_INFO("24c08", 0x50), },
606 { I2C_BOARD_INFO("tca6408", 0x20), 606 { I2C_BOARD_INFO("tca6408", 0x20),
607 .platform_data = &crag6410_pca_data, 607 .platform_data = &crag6410_pca_data,
@@ -616,13 +616,13 @@ static struct s3c2410_platform_i2c i2c0_pdata = {
616 .frequency = 400000, 616 .frequency = 400000,
617}; 617};
618 618
619static struct regulator_consumer_supply pvdd_1v2_consumers[] __devinitdata = { 619static struct regulator_consumer_supply pvdd_1v2_consumers[] = {
620 REGULATOR_SUPPLY("DCVDD", "spi0.0"), 620 REGULATOR_SUPPLY("DCVDD", "spi0.0"),
621 REGULATOR_SUPPLY("AVDD", "spi0.0"), 621 REGULATOR_SUPPLY("AVDD", "spi0.0"),
622 REGULATOR_SUPPLY("AVDD", "spi0.1"), 622 REGULATOR_SUPPLY("AVDD", "spi0.1"),
623}; 623};
624 624
625static struct regulator_init_data pvdd_1v2 __devinitdata = { 625static struct regulator_init_data pvdd_1v2 = {
626 .constraints = { 626 .constraints = {
627 .name = "PVDD_1V2", 627 .name = "PVDD_1V2",
628 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 628 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
@@ -632,7 +632,7 @@ static struct regulator_init_data pvdd_1v2 __devinitdata = {
632 .num_consumer_supplies = ARRAY_SIZE(pvdd_1v2_consumers), 632 .num_consumer_supplies = ARRAY_SIZE(pvdd_1v2_consumers),
633}; 633};
634 634
635static struct regulator_consumer_supply pvdd_1v8_consumers[] __devinitdata = { 635static struct regulator_consumer_supply pvdd_1v8_consumers[] = {
636 REGULATOR_SUPPLY("LDOVDD", "1-001a"), 636 REGULATOR_SUPPLY("LDOVDD", "1-001a"),
637 REGULATOR_SUPPLY("PLLVDD", "1-001a"), 637 REGULATOR_SUPPLY("PLLVDD", "1-001a"),
638 REGULATOR_SUPPLY("DBVDD", "1-001a"), 638 REGULATOR_SUPPLY("DBVDD", "1-001a"),
@@ -664,7 +664,7 @@ static struct regulator_consumer_supply pvdd_1v8_consumers[] __devinitdata = {
664 REGULATOR_SUPPLY("CPVDD", "wm5110-codec"), 664 REGULATOR_SUPPLY("CPVDD", "wm5110-codec"),
665}; 665};
666 666
667static struct regulator_init_data pvdd_1v8 __devinitdata = { 667static struct regulator_init_data pvdd_1v8 = {
668 .constraints = { 668 .constraints = {
669 .name = "PVDD_1V8", 669 .name = "PVDD_1V8",
670 .always_on = 1, 670 .always_on = 1,
@@ -674,12 +674,12 @@ static struct regulator_init_data pvdd_1v8 __devinitdata = {
674 .num_consumer_supplies = ARRAY_SIZE(pvdd_1v8_consumers), 674 .num_consumer_supplies = ARRAY_SIZE(pvdd_1v8_consumers),
675}; 675};
676 676
677static struct regulator_consumer_supply pvdd_3v3_consumers[] __devinitdata = { 677static struct regulator_consumer_supply pvdd_3v3_consumers[] = {
678 REGULATOR_SUPPLY("MICVDD", "1-001a"), 678 REGULATOR_SUPPLY("MICVDD", "1-001a"),
679 REGULATOR_SUPPLY("AVDD1", "1-001a"), 679 REGULATOR_SUPPLY("AVDD1", "1-001a"),
680}; 680};
681 681
682static struct regulator_init_data pvdd_3v3 __devinitdata = { 682static struct regulator_init_data pvdd_3v3 = {
683 .constraints = { 683 .constraints = {
684 .name = "PVDD_3V3", 684 .name = "PVDD_3V3",
685 .always_on = 1, 685 .always_on = 1,
@@ -689,7 +689,7 @@ static struct regulator_init_data pvdd_3v3 __devinitdata = {
689 .num_consumer_supplies = ARRAY_SIZE(pvdd_3v3_consumers), 689 .num_consumer_supplies = ARRAY_SIZE(pvdd_3v3_consumers),
690}; 690};
691 691
692static struct wm831x_pdata glenfarclas_pmic_pdata __devinitdata = { 692static struct wm831x_pdata glenfarclas_pmic_pdata = {
693 .wm831x_num = 2, 693 .wm831x_num = 2,
694 .irq_base = GLENFARCLAS_PMIC_IRQ_BASE, 694 .irq_base = GLENFARCLAS_PMIC_IRQ_BASE,
695 .gpio_base = GLENFARCLAS_PMIC_GPIO_BASE, 695 .gpio_base = GLENFARCLAS_PMIC_GPIO_BASE,
@@ -721,7 +721,7 @@ static struct wm1250_ev1_pdata wm1250_ev1_pdata = {
721 }, 721 },
722}; 722};
723 723
724static struct i2c_board_info i2c_devs1[] __devinitdata = { 724static struct i2c_board_info i2c_devs1[] = {
725 { I2C_BOARD_INFO("wm8311", 0x34), 725 { I2C_BOARD_INFO("wm8311", 0x34),
726 .irq = S3C_EINT(0), 726 .irq = S3C_EINT(0),
727 .platform_data = &glenfarclas_pmic_pdata }, 727 .platform_data = &glenfarclas_pmic_pdata },
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 7f07f08d896..b143c465934 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -130,7 +130,7 @@ void jornada_ssp_end(void)
130}; 130};
131EXPORT_SYMBOL(jornada_ssp_end); 131EXPORT_SYMBOL(jornada_ssp_end);
132 132
133static int __devinit jornada_ssp_probe(struct platform_device *dev) 133static int jornada_ssp_probe(struct platform_device *dev)
134{ 134{
135 int ret; 135 int ret;
136 136
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 88be0474f3d..400f8033204 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -154,7 +154,7 @@ static u_int neponset_get_mctrl(struct uart_port *port)
154 return ret; 154 return ret;
155} 155}
156 156
157static struct sa1100_port_fns neponset_port_fns __devinitdata = { 157static struct sa1100_port_fns neponset_port_fns = {
158 .set_mctrl = neponset_set_mctrl, 158 .set_mctrl = neponset_set_mctrl,
159 .get_mctrl = neponset_get_mctrl, 159 .get_mctrl = neponset_get_mctrl,
160}; 160};
@@ -233,7 +233,7 @@ static struct sa1111_platform_data sa1111_info = {
233 .disable_devs = SA1111_DEVID_PS2_MSE, 233 .disable_devs = SA1111_DEVID_PS2_MSE,
234}; 234};
235 235
236static int __devinit neponset_probe(struct platform_device *dev) 236static int neponset_probe(struct platform_device *dev)
237{ 237{
238 struct neponset_drvdata *d; 238 struct neponset_drvdata *d;
239 struct resource *nep_res, *sa1111_res, *smc91x_res; 239 struct resource *nep_res, *sa1111_res, *smc91x_res;
@@ -368,7 +368,7 @@ static int __devinit neponset_probe(struct platform_device *dev)
368 return ret; 368 return ret;
369} 369}
370 370
371static int __devexit neponset_remove(struct platform_device *dev) 371static int neponset_remove(struct platform_device *dev)
372{ 372{
373 struct neponset_drvdata *d = platform_get_drvdata(dev); 373 struct neponset_drvdata *d = platform_get_drvdata(dev);
374 int irq = platform_get_irq(dev, 0); 374 int irq = platform_get_irq(dev, 0);
@@ -420,7 +420,7 @@ static const struct dev_pm_ops neponset_pm_ops = {
420 420
421static struct platform_driver neponset_device_driver = { 421static struct platform_driver neponset_device_driver = {
422 .probe = neponset_probe, 422 .probe = neponset_probe,
423 .remove = __devexit_p(neponset_remove), 423 .remove = neponset_remove,
424 .driver = { 424 .driver = {
425 .name = "neponset", 425 .name = "neponset",
426 .owner = THIS_MODULE, 426 .owner = THIS_MODULE,
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index 53d08587179..bffcd643d7a 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -331,7 +331,7 @@ static struct pci_ops tegra_pcie_ops = {
331 .write = tegra_pcie_write_conf, 331 .write = tegra_pcie_write_conf,
332}; 332};
333 333
334static void __devinit tegra_pcie_fixup_bridge(struct pci_dev *dev) 334static void tegra_pcie_fixup_bridge(struct pci_dev *dev)
335{ 335{
336 u16 reg; 336 u16 reg;
337 337
@@ -345,7 +345,7 @@ static void __devinit tegra_pcie_fixup_bridge(struct pci_dev *dev)
345DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge); 345DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge);
346 346
347/* Tegra PCIE root complex wrongly reports device class */ 347/* Tegra PCIE root complex wrongly reports device class */
348static void __devinit tegra_pcie_fixup_class(struct pci_dev *dev) 348static void tegra_pcie_fixup_class(struct pci_dev *dev)
349{ 349{
350 dev->class = PCI_CLASS_BRIDGE_PCI << 8; 350 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
351} 351}
@@ -353,7 +353,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf0, tegra_pcie_fixup_class);
353DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class); 353DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class);
354 354
355/* Tegra PCIE requires relaxed ordering */ 355/* Tegra PCIE requires relaxed ordering */
356static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev) 356static void tegra_pcie_relax_enable(struct pci_dev *dev)
357{ 357{
358 pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN); 358 pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);
359} 359}
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
index 837c7b9ea63..e18aa2f83eb 100644
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -268,7 +268,7 @@ static struct tegra_emc_pdata *tegra_emc_dt_parse_pdata(
268} 268}
269#endif 269#endif
270 270
271static struct tegra_emc_pdata __devinit *tegra_emc_fill_pdata(struct platform_device *pdev) 271static struct tegra_emc_pdata *tegra_emc_fill_pdata(struct platform_device *pdev)
272{ 272{
273 struct clk *c = clk_get_sys(NULL, "emc"); 273 struct clk *c = clk_get_sys(NULL, "emc");
274 struct tegra_emc_pdata *pdata; 274 struct tegra_emc_pdata *pdata;
@@ -296,7 +296,7 @@ static struct tegra_emc_pdata __devinit *tegra_emc_fill_pdata(struct platform_de
296 return pdata; 296 return pdata;
297} 297}
298 298
299static int __devinit tegra_emc_probe(struct platform_device *pdev) 299static int tegra_emc_probe(struct platform_device *pdev)
300{ 300{
301 struct tegra_emc_pdata *pdata; 301 struct tegra_emc_pdata *pdata;
302 struct resource *res; 302 struct resource *res;
@@ -333,7 +333,7 @@ static int __devinit tegra_emc_probe(struct platform_device *pdev)
333 return 0; 333 return 0;
334} 334}
335 335
336static struct of_device_id tegra_emc_of_match[] __devinitdata = { 336static struct of_device_id tegra_emc_of_match[] = {
337 { .compatible = "nvidia,tegra20-emc", }, 337 { .compatible = "nvidia,tegra20-emc", },
338 { }, 338 { },
339}; 339};
diff --git a/arch/arm/mach-u300/dummyspichip.c b/arch/arm/mach-u300/dummyspichip.c
index 03f79361259..2785cb67b5e 100644
--- a/arch/arm/mach-u300/dummyspichip.c
+++ b/arch/arm/mach-u300/dummyspichip.c
@@ -222,7 +222,7 @@ static ssize_t dummy_looptest(struct device *dev,
222 222
223static DEVICE_ATTR(looptest, S_IRUGO, dummy_looptest, NULL); 223static DEVICE_ATTR(looptest, S_IRUGO, dummy_looptest, NULL);
224 224
225static int __devinit pl022_dummy_probe(struct spi_device *spi) 225static int pl022_dummy_probe(struct spi_device *spi)
226{ 226{
227 struct dummy *p_dummy; 227 struct dummy *p_dummy;
228 int status; 228 int status;
@@ -251,7 +251,7 @@ out_dev_create_looptest_failed:
251 return status; 251 return status;
252} 252}
253 253
254static int __devexit pl022_dummy_remove(struct spi_device *spi) 254static int pl022_dummy_remove(struct spi_device *spi)
255{ 255{
256 struct dummy *p_dummy = dev_get_drvdata(&spi->dev); 256 struct dummy *p_dummy = dev_get_drvdata(&spi->dev);
257 257
@@ -269,7 +269,7 @@ static struct spi_driver pl022_dummy_driver = {
269 .owner = THIS_MODULE, 269 .owner = THIS_MODULE,
270 }, 270 },
271 .probe = pl022_dummy_probe, 271 .probe = pl022_dummy_probe,
272 .remove = __devexit_p(pl022_dummy_remove), 272 .remove = pl022_dummy_remove,
273}; 273};
274 274
275static int __init pl022_init_dummy(void) 275static int __init pl022_init_dummy(void)
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index db0bb75e2c7..5b286e06474 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -285,7 +285,8 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
285 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL), 285 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
286 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), 286 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
287 /* Requires device name bindings. */ 287 /* Requires device name bindings. */
288 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), 288 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", U8500_PRCMU_BASE,
289 "pinctrl-db8500", NULL),
289 /* Requires clock name and DMA bindings. */ 290 /* Requires clock name and DMA bindings. */
290 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, 291 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
291 "ux500-msp-i2s.0", &msp0_platform_data), 292 "ux500-msp-i2s.0", &msp0_platform_data),
diff --git a/arch/arm/mach-versatile/include/mach/irqs.h b/arch/arm/mach-versatile/include/mach/irqs.h
index bf44c61bd1f..0fd771ca617 100644
--- a/arch/arm/mach-versatile/include/mach/irqs.h
+++ b/arch/arm/mach-versatile/include/mach/irqs.h
@@ -25,7 +25,7 @@
25 * IRQ interrupts definitions are the same as the INT definitions 25 * IRQ interrupts definitions are the same as the INT definitions
26 * held within platform.h 26 * held within platform.h
27 */ 27 */
28#define IRQ_VIC_START 0 28#define IRQ_VIC_START 32
29#define IRQ_WDOGINT (IRQ_VIC_START + INT_WDOGINT) 29#define IRQ_WDOGINT (IRQ_VIC_START + INT_WDOGINT)
30#define IRQ_SOFTINT (IRQ_VIC_START + INT_SOFTINT) 30#define IRQ_SOFTINT (IRQ_VIC_START + INT_SOFTINT)
31#define IRQ_COMMRx (IRQ_VIC_START + INT_COMMRx) 31#define IRQ_COMMRx (IRQ_VIC_START + INT_COMMRx)
@@ -100,7 +100,7 @@
100/* 100/*
101 * Secondary interrupt controller 101 * Secondary interrupt controller
102 */ 102 */
103#define IRQ_SIC_START 32 103#define IRQ_SIC_START 64
104#define IRQ_SIC_MMCI0B (IRQ_SIC_START + SIC_INT_MMCI0B) 104#define IRQ_SIC_MMCI0B (IRQ_SIC_START + SIC_INT_MMCI0B)
105#define IRQ_SIC_MMCI1B (IRQ_SIC_START + SIC_INT_MMCI1B) 105#define IRQ_SIC_MMCI1B (IRQ_SIC_START + SIC_INT_MMCI1B)
106#define IRQ_SIC_KMI0 (IRQ_SIC_START + SIC_INT_KMI0) 106#define IRQ_SIC_KMI0 (IRQ_SIC_START + SIC_INT_KMI0)
@@ -120,7 +120,7 @@
120#define IRQ_SIC_PCI1 (IRQ_SIC_START + SIC_INT_PCI1) 120#define IRQ_SIC_PCI1 (IRQ_SIC_START + SIC_INT_PCI1)
121#define IRQ_SIC_PCI2 (IRQ_SIC_START + SIC_INT_PCI2) 121#define IRQ_SIC_PCI2 (IRQ_SIC_START + SIC_INT_PCI2)
122#define IRQ_SIC_PCI3 (IRQ_SIC_START + SIC_INT_PCI3) 122#define IRQ_SIC_PCI3 (IRQ_SIC_START + SIC_INT_PCI3)
123#define IRQ_SIC_END 63 123#define IRQ_SIC_END 95
124 124
125#define IRQ_GPIO0_START (IRQ_SIC_END + 1) 125#define IRQ_GPIO0_START (IRQ_SIC_END + 1)
126#define IRQ_GPIO0_END (IRQ_GPIO0_START + 31) 126#define IRQ_GPIO0_END (IRQ_GPIO0_START + 31)
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 99e63f5f99d..52d315b792c 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -42,7 +42,6 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA
42 bool "Enable A5 and A9 only errata work-arounds" 42 bool "Enable A5 and A9 only errata work-arounds"
43 default y 43 default y
44 select ARM_ERRATA_720789 44 select ARM_ERRATA_720789
45 select ARM_ERRATA_751472
46 select PL310_ERRATA_753970 if CACHE_PL310 45 select PL310_ERRATA_753970 if CACHE_PL310
47 help 46 help
48 Provides common dependencies for Versatile Express platforms 47 Provides common dependencies for Versatile Express platforms
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 6911b8b2745..c2f37390308 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -352,7 +352,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
352 /* Unmapped register. */ 352 /* Unmapped register. */
353 sync_reg_offset = L2X0_DUMMY_REG; 353 sync_reg_offset = L2X0_DUMMY_REG;
354#endif 354#endif
355 outer_cache.set_debug = pl310_set_debug; 355 if ((cache_id & L2X0_CACHE_ID_RTL_MASK) <= L2X0_CACHE_ID_RTL_R3P0)
356 outer_cache.set_debug = pl310_set_debug;
356 break; 357 break;
357 case L2X0_CACHE_ID_PART_L210: 358 case L2X0_CACHE_ID_PART_L210:
358 ways = (aux >> 13) & 0xf; 359 ways = (aux >> 13) & 0xf;
@@ -459,8 +460,8 @@ static void aurora_pa_range(unsigned long start, unsigned long end,
459 unsigned long flags; 460 unsigned long flags;
460 461
461 raw_spin_lock_irqsave(&l2x0_lock, flags); 462 raw_spin_lock_irqsave(&l2x0_lock, flags);
462 writel(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG); 463 writel_relaxed(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG);
463 writel(end, l2x0_base + offset); 464 writel_relaxed(end, l2x0_base + offset);
464 raw_spin_unlock_irqrestore(&l2x0_lock, flags); 465 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
465 466
466 cache_sync(); 467 cache_sync();
@@ -505,15 +506,21 @@ static void aurora_clean_range(unsigned long start, unsigned long end)
505 506
506static void aurora_flush_range(unsigned long start, unsigned long end) 507static void aurora_flush_range(unsigned long start, unsigned long end)
507{ 508{
508 if (!l2_wt_override) { 509 start &= ~(CACHE_LINE_SIZE - 1);
509 start &= ~(CACHE_LINE_SIZE - 1); 510 end = ALIGN(end, CACHE_LINE_SIZE);
510 end = ALIGN(end, CACHE_LINE_SIZE); 511 while (start != end) {
511 while (start != end) { 512 unsigned long range_end = calc_range_end(start, end);
512 unsigned long range_end = calc_range_end(start, end); 513 /*
514 * If L2 is forced to WT, the L2 will always be clean and we
515 * just need to invalidate.
516 */
517 if (l2_wt_override)
513 aurora_pa_range(start, range_end - CACHE_LINE_SIZE, 518 aurora_pa_range(start, range_end - CACHE_LINE_SIZE,
514 AURORA_FLUSH_RANGE_REG); 519 AURORA_INVAL_RANGE_REG);
515 start = range_end; 520 else
516 } 521 aurora_pa_range(start, range_end - CACHE_LINE_SIZE,
522 AURORA_FLUSH_RANGE_REG);
523 start = range_end;
517 } 524 }
518} 525}
519 526
@@ -668,8 +675,9 @@ static void pl310_resume(void)
668static void aurora_resume(void) 675static void aurora_resume(void)
669{ 676{
670 if (!(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { 677 if (!(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
671 writel(l2x0_saved_regs.aux_ctrl, l2x0_base + L2X0_AUX_CTRL); 678 writel_relaxed(l2x0_saved_regs.aux_ctrl,
672 writel(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL); 679 l2x0_base + L2X0_AUX_CTRL);
680 writel_relaxed(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL);
673 } 681 }
674} 682}
675 683
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 350f6a74992..3a3c015f8d5 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -169,6 +169,7 @@ __v7_ca15mp_setup:
169 orreq r0, r0, r10 @ Enable CPU-specific SMP bits 169 orreq r0, r0, r10 @ Enable CPU-specific SMP bits
170 mcreq p15, 0, r0, c1, c0, 1 170 mcreq p15, 0, r0, c1, c0, 1
171#endif 171#endif
172 b __v7_setup
172 173
173__v7_pj4b_setup: 174__v7_pj4b_setup:
174#ifdef CONFIG_CPU_PJ4B 175#ifdef CONFIG_CPU_PJ4B
@@ -245,7 +246,8 @@ __v7_setup:
245 ldr r10, =0x00000c08 @ Cortex-A8 primary part number 246 ldr r10, =0x00000c08 @ Cortex-A8 primary part number
246 teq r0, r10 247 teq r0, r10
247 bne 2f 248 bne 2f
248#ifdef CONFIG_ARM_ERRATA_430973 249#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
250
249 teq r5, #0x00100000 @ only present in r1p* 251 teq r5, #0x00100000 @ only present in r1p*
250 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register 252 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register
251 orreq r10, r10, #(1 << 6) @ set IBE to 1 253 orreq r10, r10, #(1 << 6) @ set IBE to 1
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index f3771cdb983..5b0b86bb34b 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -22,6 +22,8 @@
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <asm/sched_clock.h> 23#include <asm/sched_clock.h>
24 24
25#include <plat/counter-32k.h>
26
25/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ 27/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
26#define OMAP2_32KSYNCNT_REV_OFF 0x0 28#define OMAP2_32KSYNCNT_REV_OFF 0x0
27#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30) 29#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 37a488aaa2b..4136b20cba3 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2000,7 +2000,7 @@ void omap_dma_global_context_restore(void)
2000 omap_clear_dma(ch); 2000 omap_clear_dma(ch);
2001} 2001}
2002 2002
2003static int __devinit omap_system_dma_probe(struct platform_device *pdev) 2003static int omap_system_dma_probe(struct platform_device *pdev)
2004{ 2004{
2005 int ch, ret = 0; 2005 int ch, ret = 0;
2006 int dma_irq; 2006 int dma_irq;
@@ -2116,7 +2116,7 @@ exit_dma_lch_fail:
2116 return ret; 2116 return ret;
2117} 2117}
2118 2118
2119static int __devexit omap_system_dma_remove(struct platform_device *pdev) 2119static int omap_system_dma_remove(struct platform_device *pdev)
2120{ 2120{
2121 int dma_irq; 2121 int dma_irq;
2122 2122
@@ -2140,7 +2140,7 @@ static int __devexit omap_system_dma_remove(struct platform_device *pdev)
2140 2140
2141static struct platform_driver omap_system_dma_driver = { 2141static struct platform_driver omap_system_dma_driver = {
2142 .probe = omap_system_dma_probe, 2142 .probe = omap_system_dma_probe,
2143 .remove = __devexit_p(omap_system_dma_remove), 2143 .remove = omap_system_dma_remove,
2144 .driver = { 2144 .driver = {
2145 .name = "omap_dma_system" 2145 .name = "omap_dma_system"
2146 }, 2146 },
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index d51b75bdcad..7b433f3bddc 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -777,7 +777,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timers_active);
777 * Called by driver framework at the end of device registration for all 777 * Called by driver framework at the end of device registration for all
778 * timer devices. 778 * timer devices.
779 */ 779 */
780static int __devinit omap_dm_timer_probe(struct platform_device *pdev) 780static int omap_dm_timer_probe(struct platform_device *pdev)
781{ 781{
782 unsigned long flags; 782 unsigned long flags;
783 struct omap_dm_timer *timer; 783 struct omap_dm_timer *timer;
@@ -864,7 +864,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
864 * In addition to freeing platform resources it also deletes the timer 864 * In addition to freeing platform resources it also deletes the timer
865 * entry from the local list. 865 * entry from the local list.
866 */ 866 */
867static int __devexit omap_dm_timer_remove(struct platform_device *pdev) 867static int omap_dm_timer_remove(struct platform_device *pdev)
868{ 868{
869 struct omap_dm_timer *timer; 869 struct omap_dm_timer *timer;
870 unsigned long flags; 870 unsigned long flags;
@@ -891,7 +891,7 @@ MODULE_DEVICE_TABLE(of, omap_timer_match);
891 891
892static struct platform_driver omap_dm_timer_driver = { 892static struct platform_driver omap_dm_timer_driver = {
893 .probe = omap_dm_timer_probe, 893 .probe = omap_dm_timer_probe,
894 .remove = __devexit_p(omap_dm_timer_remove), 894 .remove = omap_dm_timer_remove,
895 .driver = { 895 .driver = {
896 .name = "omap_timer", 896 .name = "omap_timer",
897 .of_match_table = of_match_ptr(omap_timer_match), 897 .of_match_table = of_match_ptr(omap_timer_match),
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 743fc2836f7..a5bc92d7e47 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -26,6 +26,8 @@
26 26
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <plat/sram.h>
30
29#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) 31#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
30 32
31static void __iomem *omap_sram_base; 33static void __iomem *omap_sram_base;
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 584c9bf8ed2..8e11e96eab5 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -72,7 +72,7 @@ void pxa_ssp_free(struct ssp_device *ssp)
72} 72}
73EXPORT_SYMBOL(pxa_ssp_free); 73EXPORT_SYMBOL(pxa_ssp_free);
74 74
75static int __devinit pxa_ssp_probe(struct platform_device *pdev) 75static int pxa_ssp_probe(struct platform_device *pdev)
76{ 76{
77 const struct platform_device_id *id = platform_get_device_id(pdev); 77 const struct platform_device_id *id = platform_get_device_id(pdev);
78 struct resource *res; 78 struct resource *res;
@@ -164,7 +164,7 @@ err_free:
164 return ret; 164 return ret;
165} 165}
166 166
167static int __devexit pxa_ssp_remove(struct platform_device *pdev) 167static int pxa_ssp_remove(struct platform_device *pdev)
168{ 168{
169 struct resource *res; 169 struct resource *res;
170 struct ssp_device *ssp; 170 struct ssp_device *ssp;
@@ -199,7 +199,7 @@ static const struct platform_device_id ssp_id_table[] = {
199 199
200static struct platform_driver pxa_ssp_driver = { 200static struct platform_driver pxa_ssp_driver = {
201 .probe = pxa_ssp_probe, 201 .probe = pxa_ssp_probe,
202 .remove = __devexit_p(pxa_ssp_remove), 202 .remove = pxa_ssp_remove,
203 .driver = { 203 .driver = {
204 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
205 .name = "pxa2xx-ssp", 205 .name = "pxa2xx-ssp",
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 37542c2689a..2d676ab50f7 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -416,7 +416,7 @@ static int s3c_adc_probe(struct platform_device *pdev)
416 return 0; 416 return 0;
417} 417}
418 418
419static int __devexit s3c_adc_remove(struct platform_device *pdev) 419static int s3c_adc_remove(struct platform_device *pdev)
420{ 420{
421 struct adc_device *adc = platform_get_drvdata(pdev); 421 struct adc_device *adc = platform_get_drvdata(pdev);
422 422
@@ -516,7 +516,7 @@ static struct platform_driver s3c_adc_driver = {
516 .pm = &adc_pm_ops, 516 .pm = &adc_pm_ops,
517 }, 517 },
518 .probe = s3c_adc_probe, 518 .probe = s3c_adc_probe,
519 .remove = __devexit_p(s3c_adc_remove), 519 .remove = s3c_adc_remove,
520}; 520};
521 521
522static int __init adc_init(void) 522static int __init adc_init(void)
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index e0072ce8d6e..b69e11dc679 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -43,7 +43,7 @@ extern unsigned long samsung_cpu_id;
43#define EXYNOS4_CPU_MASK 0xFFFE0000 43#define EXYNOS4_CPU_MASK 0xFFFE0000
44 44
45#define EXYNOS5250_SOC_ID 0x43520000 45#define EXYNOS5250_SOC_ID 0x43520000
46#define EXYNOS5440_SOC_ID 0x54400000 46#define EXYNOS5440_SOC_ID 0xE5440000
47#define EXYNOS5_SOC_MASK 0xFFFFF000 47#define EXYNOS5_SOC_MASK 0xFFFFF000
48 48
49#define IS_SAMSUNG_CPU(name, id, mask) \ 49#define IS_SAMSUNG_CPU(name, id, mask) \
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9c829b00826..f8f362aafee 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2,6 +2,8 @@ config ARM64
2 def_bool y 2 def_bool y
3 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 3 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
4 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 4 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
5 select ARM_AMBA
6 select CLONE_BACKWARDS
5 select COMMON_CLK 7 select COMMON_CLK
6 select GENERIC_CLOCKEVENTS 8 select GENERIC_CLOCKEVENTS
7 select GENERIC_HARDIRQS_NO_DEPRECATED 9 select GENERIC_HARDIRQS_NO_DEPRECATED
@@ -31,7 +33,6 @@ config ARM64
31 select RTC_LIB 33 select RTC_LIB
32 select SPARSE_IRQ 34 select SPARSE_IRQ
33 select SYSCTL_EXCEPTION_TRACE 35 select SYSCTL_EXCEPTION_TRACE
34 select CLONE_BACKWARDS
35 help 36 help
36 ARM 64-bit (AArch64) Linux support. 37 ARM 64-bit (AArch64) Linux support.
37 38
@@ -90,6 +91,9 @@ config SWIOTLB
90config IOMMU_HELPER 91config IOMMU_HELPER
91 def_bool SWIOTLB 92 def_bool SWIOTLB
92 93
94config GENERIC_GPIO
95 def_bool y
96
93source "init/Kconfig" 97source "init/Kconfig"
94 98
95source "kernel/Kconfig.freezer" 99source "kernel/Kconfig.freezer"
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index 801e2d7fcbc..32ac0aef006 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -1,4 +1,5 @@
1targets += dtbs 1targets += dtbs
2targets += $(dtb-y)
2 3
3dtbs: $(addprefix $(obj)/, $(dtb-y)) 4dtbs: $(addprefix $(obj)/, $(dtb-y))
4 5
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index d9ec40217a2..618b450e5a1 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -23,6 +23,7 @@
23 */ 23 */
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/ptrace.h>
26 27
27#define COMPAT_USER_HZ 100 28#define COMPAT_USER_HZ 100
28#define COMPAT_UTS_MACHINE "armv8l\0\0" 29#define COMPAT_UTS_MACHINE "armv8l\0\0"
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index c76c7241125..f7073c7b1ca 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1221,7 +1221,7 @@ static struct of_device_id armpmu_of_device_ids[] = {
1221 {}, 1221 {},
1222}; 1222};
1223 1223
1224static int __devinit armpmu_device_probe(struct platform_device *pdev) 1224static int armpmu_device_probe(struct platform_device *pdev)
1225{ 1225{
1226 if (!cpu_pmu) 1226 if (!cpu_pmu)
1227 return -ENODEV; 1227 return -ENODEV;
diff --git a/arch/avr32/lib/delay.c b/arch/avr32/lib/delay.c
index 9aa8800830f..c2f4a07dcda 100644
--- a/arch/avr32/lib/delay.c
+++ b/arch/avr32/lib/delay.c
@@ -20,7 +20,7 @@
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/sysreg.h> 21#include <asm/sysreg.h>
22 22
23int __devinit read_current_timer(unsigned long *timer_value) 23int read_current_timer(unsigned long *timer_value)
24{ 24{
25 *timer_value = sysreg_read(COUNT); 25 *timer_value = sysreg_read(COUNT);
26 return 0; 26 return 0;
diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c
index 978bb400be0..724a8c5f557 100644
--- a/arch/blackfin/mach-common/dpmc.c
+++ b/arch/blackfin/mach-common/dpmc.c
@@ -129,7 +129,7 @@ static struct notifier_block vreg_cpufreq_notifier_block = {
129 * bfin_dpmc_probe - 129 * bfin_dpmc_probe -
130 * 130 *
131 */ 131 */
132static int __devinit bfin_dpmc_probe(struct platform_device *pdev) 132static int bfin_dpmc_probe(struct platform_device *pdev)
133{ 133{
134 if (pdev->dev.platform_data) 134 if (pdev->dev.platform_data)
135 pdata = pdev->dev.platform_data; 135 pdata = pdev->dev.platform_data;
@@ -143,7 +143,7 @@ static int __devinit bfin_dpmc_probe(struct platform_device *pdev)
143/** 143/**
144 * bfin_dpmc_remove - 144 * bfin_dpmc_remove -
145 */ 145 */
146static int __devexit bfin_dpmc_remove(struct platform_device *pdev) 146static int bfin_dpmc_remove(struct platform_device *pdev)
147{ 147{
148 pdata = NULL; 148 pdata = NULL;
149 return cpufreq_unregister_notifier(&vreg_cpufreq_notifier_block, 149 return cpufreq_unregister_notifier(&vreg_cpufreq_notifier_block,
@@ -152,7 +152,7 @@ static int __devexit bfin_dpmc_remove(struct platform_device *pdev)
152 152
153struct platform_driver bfin_dpmc_device_driver = { 153struct platform_driver bfin_dpmc_device_driver = {
154 .probe = bfin_dpmc_probe, 154 .probe = bfin_dpmc_probe,
155 .remove = __devexit_p(bfin_dpmc_remove), 155 .remove = bfin_dpmc_remove,
156 .driver = { 156 .driver = {
157 .name = DRIVER_NAME, 157 .name = DRIVER_NAME,
158 } 158 }
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index e3dfc72d0cf..64a5fb93767 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -2,7 +2,7 @@
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <arch/hwregs/intr_vect.h> 3#include <arch/hwregs/intr_vect.h>
4 4
5void __devinit pcibios_fixup_bus(struct pci_bus *b) 5void pcibios_fixup_bus(struct pci_bus *b)
6{ 6{
7} 7}
8 8
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index ebe2cb30bd1..04a16edd540 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -84,7 +84,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
84 cpumask_set_cpu(i, &phys_cpu_present_map); 84 cpumask_set_cpu(i, &phys_cpu_present_map);
85} 85}
86 86
87void __devinit smp_prepare_boot_cpu(void) 87void smp_prepare_boot_cpu(void)
88{ 88{
89 /* PGD pointer has moved after per_cpu initialization so 89 /* PGD pointer has moved after per_cpu initialization so
90 * update the MMU. 90 * update the MMU.
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index 3cb3392f799..a5136474c6f 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -852,7 +852,7 @@ void __init setup_arch(char **cmdline_p)
852/* 852/*
853 * 853 *
854 */ 854 */
855static int __devinit setup_arch_serial(void) 855static int setup_arch_serial(void)
856{ 856{
857 /* register those serial ports that are available */ 857 /* register those serial ports that are available */
858#ifndef CONFIG_GDBSTUB_UART0 858#ifndef CONFIG_GDBSTUB_UART0
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index 71e9bcf5810..d186b254ce9 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -268,7 +268,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d)
268 d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO; 268 d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
269} 269}
270 270
271static void __devinit pci_fixup_ide_bases(struct pci_dev *d) 271static void pci_fixup_ide_bases(struct pci_dev *d)
272{ 272{
273 int i; 273 int i;
274 274
@@ -287,7 +287,7 @@ static void __devinit pci_fixup_ide_bases(struct pci_dev *d)
287 } 287 }
288} 288}
289 289
290static void __devinit pci_fixup_ide_trash(struct pci_dev *d) 290static void pci_fixup_ide_trash(struct pci_dev *d)
291{ 291{
292 int i; 292 int i;
293 293
@@ -300,7 +300,7 @@ static void __devinit pci_fixup_ide_trash(struct pci_dev *d)
300 d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0; 300 d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;
301} 301}
302 302
303static void __devinit pci_fixup_latency(struct pci_dev *d) 303static void pci_fixup_latency(struct pci_dev *d)
304{ 304{
305 /* 305 /*
306 * SiS 5597 and 5598 chipsets require latency timer set to 306 * SiS 5597 and 5598 chipsets require latency timer set to
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index 301609c3fce..359e68a03ca 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -153,7 +153,7 @@ extern int additional_cpus;
153#else 153#else
154#define MAX_PXM_DOMAINS (256) 154#define MAX_PXM_DOMAINS (256)
155#endif 155#endif
156extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS]; 156extern int pxm_to_nid_map[MAX_PXM_DOMAINS];
157extern int __initdata nid_to_pxm_map[MAX_NUMNODES]; 157extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
158#endif 158#endif
159 159
diff --git a/arch/ia64/include/asm/iosapic.h b/arch/ia64/include/asm/iosapic.h
index b9c102e15f2..94c89a2d97f 100644
--- a/arch/ia64/include/asm/iosapic.h
+++ b/arch/ia64/include/asm/iosapic.h
@@ -87,18 +87,13 @@ static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
87} 87}
88 88
89extern void __init iosapic_system_init (int pcat_compat); 89extern void __init iosapic_system_init (int pcat_compat);
90extern int __devinit iosapic_init (unsigned long address, 90extern int iosapic_init (unsigned long address, unsigned int gsi_base);
91 unsigned int gsi_base);
92#ifdef CONFIG_HOTPLUG
93extern int iosapic_remove (unsigned int gsi_base); 91extern int iosapic_remove (unsigned int gsi_base);
94#else
95#define iosapic_remove(gsi_base) (-EINVAL)
96#endif /* CONFIG_HOTPLUG */
97extern int gsi_to_irq (unsigned int gsi); 92extern int gsi_to_irq (unsigned int gsi);
98extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, 93extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
99 unsigned long trigger); 94 unsigned long trigger);
100extern void iosapic_unregister_intr (unsigned int irq); 95extern void iosapic_unregister_intr (unsigned int irq);
101extern void __devinit iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, 96extern void iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
102 unsigned long polarity, 97 unsigned long polarity,
103 unsigned long trigger); 98 unsigned long trigger);
104extern int __init iosapic_register_platform_intr (u32 int_type, 99extern int __init iosapic_register_platform_intr (u32 int_type,
@@ -109,7 +104,7 @@ extern int __init iosapic_register_platform_intr (u32 int_type,
109 unsigned long trigger); 104 unsigned long trigger);
110 105
111#ifdef CONFIG_NUMA 106#ifdef CONFIG_NUMA
112extern void __devinit map_iosapic_to_node (unsigned int, int); 107extern void map_iosapic_to_node (unsigned int, int);
113#endif 108#endif
114#else 109#else
115#define iosapic_system_init(pcat_compat) do { } while (0) 110#define iosapic_system_init(pcat_compat) do { } while (0)
diff --git a/arch/ia64/include/asm/parport.h b/arch/ia64/include/asm/parport.h
index 67e16adfcd2..638b4d271b9 100644
--- a/arch/ia64/include/asm/parport.h
+++ b/arch/ia64/include/asm/parport.h
@@ -9,10 +9,9 @@
9#ifndef _ASM_IA64_PARPORT_H 9#ifndef _ASM_IA64_PARPORT_H
10#define _ASM_IA64_PARPORT_H 1 10#define _ASM_IA64_PARPORT_H 1
11 11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); 12static int parport_pc_find_isa_ports(int autoirq, int autodma);
13 13
14static int __devinit 14static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
15parport_pc_find_nonpci_ports (int autoirq, int autodma)
16{ 15{
17 return parport_pc_find_isa_ports(autoirq, autodma); 16 return parport_pc_find_isa_ports(autoirq, autodma);
18} 17}
diff --git a/arch/ia64/include/asm/smp.h b/arch/ia64/include/asm/smp.h
index 0b3b3997dec..fea21e98602 100644
--- a/arch/ia64/include/asm/smp.h
+++ b/arch/ia64/include/asm/smp.h
@@ -55,7 +55,7 @@ extern struct smp_boot_data {
55 int cpu_phys_id[NR_CPUS]; 55 int cpu_phys_id[NR_CPUS];
56} smp_boot_data __initdata; 56} smp_boot_data __initdata;
57 57
58extern char no_int_routing __devinitdata; 58extern char no_int_routing;
59 59
60extern cpumask_t cpu_core_map[NR_CPUS]; 60extern cpumask_t cpu_core_map[NR_CPUS];
61DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); 61DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map);
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index 8b3ff2f5b86..c3cc42a15af 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -11,7 +11,7 @@
11 11
12 12
13 13
14#define NR_syscalls 311 /* length of syscall table */ 14#define NR_syscalls 312 /* length of syscall table */
15 15
16/* 16/*
17 * The following defines stop scripts/checksyscalls.sh from complaining about 17 * The following defines stop scripts/checksyscalls.sh from complaining about
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h
index b706aa54df2..34fd6fe46da 100644
--- a/arch/ia64/include/uapi/asm/unistd.h
+++ b/arch/ia64/include/uapi/asm/unistd.h
@@ -324,5 +324,6 @@
324#define __NR_process_vm_readv 1332 324#define __NR_process_vm_readv 1332
325#define __NR_process_vm_writev 1333 325#define __NR_process_vm_writev 1333
326#define __NR_accept4 1334 326#define __NR_accept4 1334
327#define __NR_finit_module 1335
327 328
328#endif /* _UAPI_ASM_IA64_UNISTD_H */ 329#endif /* _UAPI_ASM_IA64_UNISTD_H */
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index e9682f5be34..335eb07480f 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -422,7 +422,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
422#define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) 422#define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
423 423
424static int __initdata srat_num_cpus; /* number of cpus */ 424static int __initdata srat_num_cpus; /* number of cpus */
425static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; 425static u32 pxm_flag[PXM_FLAG_LEN];
426#define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag)) 426#define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag))
427#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) 427#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
428static struct acpi_table_slit __initdata *slit_table; 428static struct acpi_table_slit __initdata *slit_table;
@@ -956,8 +956,8 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
956#endif /* CONFIG_ACPI_HOTPLUG_CPU */ 956#endif /* CONFIG_ACPI_HOTPLUG_CPU */
957 957
958#ifdef CONFIG_ACPI_NUMA 958#ifdef CONFIG_ACPI_NUMA
959static acpi_status __devinit 959static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
960acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) 960 void *context, void **ret)
961{ 961{
962 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 962 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
963 union acpi_object *obj; 963 union acpi_object *obj;
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index e25b784a2b7..6bfd8429ee0 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1785,6 +1785,7 @@ sys_call_table:
1785 data8 sys_process_vm_readv 1785 data8 sys_process_vm_readv
1786 data8 sys_process_vm_writev 1786 data8 sys_process_vm_writev
1787 data8 sys_accept4 1787 data8 sys_accept4
1788 data8 sys_finit_module // 1335
1788 1789
1789 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1790 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
1790#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ 1791#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index ef4b5d877cf..ee33c3aaa2f 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -147,7 +147,7 @@ static struct iosapic_intr_info {
147 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ 147 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */
148} iosapic_intr_info[NR_IRQS]; 148} iosapic_intr_info[NR_IRQS];
149 149
150static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */ 150static unsigned char pcat_compat; /* 8259 compatibility flag */
151 151
152static inline void 152static inline void
153iosapic_write(struct iosapic *iosapic, unsigned int reg, u32 val) 153iosapic_write(struct iosapic *iosapic, unsigned int reg, u32 val)
@@ -914,10 +914,8 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
914/* 914/*
915 * ACPI calls this when it finds an entry for a legacy ISA IRQ override. 915 * ACPI calls this when it finds an entry for a legacy ISA IRQ override.
916 */ 916 */
917void __devinit 917void iosapic_override_isa_irq(unsigned int isa_irq, unsigned int gsi,
918iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, 918 unsigned long polarity, unsigned long trigger)
919 unsigned long polarity,
920 unsigned long trigger)
921{ 919{
922 int vector, irq; 920 int vector, irq;
923 unsigned int dest = cpu_physical_id(smp_processor_id()); 921 unsigned int dest = cpu_physical_id(smp_processor_id());
@@ -1012,8 +1010,7 @@ iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)
1012 return 0; 1010 return 0;
1013} 1011}
1014 1012
1015int __devinit 1013int iosapic_init(unsigned long phys_addr, unsigned int gsi_base)
1016iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
1017{ 1014{
1018 int num_rte, err, index; 1015 int num_rte, err, index;
1019 unsigned int isa_irq, ver; 1016 unsigned int isa_irq, ver;
@@ -1070,9 +1067,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
1070 return 0; 1067 return 0;
1071} 1068}
1072 1069
1073#ifdef CONFIG_HOTPLUG 1070int iosapic_remove(unsigned int gsi_base)
1074int
1075iosapic_remove (unsigned int gsi_base)
1076{ 1071{
1077 int index, err = 0; 1072 int index, err = 0;
1078 unsigned long flags; 1073 unsigned long flags;
@@ -1098,11 +1093,9 @@ iosapic_remove (unsigned int gsi_base)
1098 spin_unlock_irqrestore(&iosapic_lock, flags); 1093 spin_unlock_irqrestore(&iosapic_lock, flags);
1099 return err; 1094 return err;
1100} 1095}
1101#endif /* CONFIG_HOTPLUG */
1102 1096
1103#ifdef CONFIG_NUMA 1097#ifdef CONFIG_NUMA
1104void __devinit 1098void map_iosapic_to_node(unsigned int gsi_base, int node)
1105map_iosapic_to_node(unsigned int gsi_base, int node)
1106{ 1099{
1107 int index; 1100 int index;
1108 1101
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 6a368cb2043..500f1e4d9f9 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -347,8 +347,7 @@ ia64_sync_itc (unsigned int master)
347/* 347/*
348 * Ideally sets up per-cpu profiling hooks. Doesn't do much now... 348 * Ideally sets up per-cpu profiling hooks. Doesn't do much now...
349 */ 349 */
350static inline void __devinit 350static inline void smp_setup_percpu_timer(void)
351smp_setup_percpu_timer (void)
352{ 351{
353} 352}
354 353
@@ -563,7 +562,7 @@ smp_prepare_cpus (unsigned int max_cpus)
563 } 562 }
564} 563}
565 564
566void __devinit smp_prepare_boot_cpu(void) 565void smp_prepare_boot_cpu(void)
567{ 566{
568 set_cpu_online(smp_processor_id(), true); 567 set_cpu_online(smp_processor_id(), true);
569 cpu_set(smp_processor_id(), cpu_callin_map); 568 cpu_set(smp_processor_id(), cpu_callin_map);
@@ -713,8 +712,7 @@ smp_cpus_done (unsigned int dummy)
713 (int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100); 712 (int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
714} 713}
715 714
716static inline void __devinit 715static inline void set_cpu_sibling_map(int cpu)
717set_cpu_sibling_map(int cpu)
718{ 716{
719 int i; 717 int i;
720 718
@@ -793,8 +791,7 @@ init_smp_config(void)
793 * identify_siblings(cpu) gets called from identify_cpu. This populates the 791 * identify_siblings(cpu) gets called from identify_cpu. This populates the
794 * information related to logical execution units in per_cpu_data structure. 792 * information related to logical execution units in per_cpu_data structure.
795 */ 793 */
796void __devinit 794void identify_siblings(struct cpuinfo_ia64 *c)
797identify_siblings(struct cpuinfo_ia64 *c)
798{ 795{
799 long status; 796 long status;
800 u16 pltid; 797 u16 pltid;
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index b1995efbfd2..88a794536bc 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -243,8 +243,7 @@ static int __init nojitter_setup(char *str)
243__setup("nojitter", nojitter_setup); 243__setup("nojitter", nojitter_setup);
244 244
245 245
246void __devinit 246void ia64_init_itm(void)
247ia64_init_itm (void)
248{ 247{
249 unsigned long platform_base_freq, itc_freq; 248 unsigned long platform_base_freq, itc_freq;
250 struct pal_freq_ratio itc_ratio, proc_ratio; 249 struct pal_freq_ratio itc_ratio, proc_ratio;
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383c1b6..b755ea92aea 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -294,11 +294,10 @@ setup_gate (void)
294 ia64_patch_gate(); 294 ia64_patch_gate();
295} 295}
296 296
297void __devinit 297void ia64_mmu_init(void *my_cpu_data)
298ia64_mmu_init (void *my_cpu_data)
299{ 298{
300 unsigned long pta, impl_va_bits; 299 unsigned long pta, impl_va_bits;
301 extern void __devinit tlb_init (void); 300 extern void tlb_init(void);
302 301
303#ifdef CONFIG_DISABLE_VHPT 302#ifdef CONFIG_DISABLE_VHPT
304# define VHPT_ENABLE_BIT 0 303# define VHPT_ENABLE_BIT 0
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
index 7b3cdc6c6d9..ed612976868 100644
--- a/arch/ia64/mm/tlb.c
+++ b/arch/ia64/mm/tlb.c
@@ -337,8 +337,7 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start,
337} 337}
338EXPORT_SYMBOL(flush_tlb_range); 338EXPORT_SYMBOL(flush_tlb_range);
339 339
340void __devinit 340void ia64_tlb_init(void)
341ia64_tlb_init (void)
342{ 341{
343 ia64_ptce_info_t uninitialized_var(ptce_info); /* GCC be quiet */ 342 ia64_ptce_info_t uninitialized_var(ptce_info); /* GCC be quiet */
344 u64 tr_pgbits; 343 u64 tr_pgbits;
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index eab28e31402..5dc969dd4ac 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -24,7 +24,7 @@
24 * video device at this point. 24 * video device at this point.
25 */ 25 */
26 26
27static void __devinit pci_fixup_video(struct pci_dev *pdev) 27static void pci_fixup_video(struct pci_dev *pdev)
28{ 28{
29 struct pci_dev *bridge; 29 struct pci_dev *bridge;
30 struct pci_bus *bus; 30 struct pci_bus *bus;
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 5faa66c5c2a..55b72ad5732 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -116,8 +116,7 @@ struct pci_ops pci_root_ops = {
116 116
117/* Called by ACPI when it finds a new root bus. */ 117/* Called by ACPI when it finds a new root bus. */
118 118
119static struct pci_controller * __devinit 119static struct pci_controller *alloc_pci_controller(int seg)
120alloc_pci_controller (int seg)
121{ 120{
122 struct pci_controller *controller; 121 struct pci_controller *controller;
123 122
@@ -165,8 +164,8 @@ new_space (u64 phys_base, int sparse)
165 return i; 164 return i;
166} 165}
167 166
168static u64 __devinit 167static u64 add_io_space(struct pci_root_info *info,
169add_io_space (struct pci_root_info *info, struct acpi_resource_address64 *addr) 168 struct acpi_resource_address64 *addr)
170{ 169{
171 struct resource *resource; 170 struct resource *resource;
172 char *name; 171 char *name;
@@ -226,8 +225,8 @@ out:
226 return ~0; 225 return ~0;
227} 226}
228 227
229static acpi_status __devinit resource_to_window(struct acpi_resource *resource, 228static acpi_status resource_to_window(struct acpi_resource *resource,
230 struct acpi_resource_address64 *addr) 229 struct acpi_resource_address64 *addr)
231{ 230{
232 acpi_status status; 231 acpi_status status;
233 232
@@ -249,8 +248,7 @@ static acpi_status __devinit resource_to_window(struct acpi_resource *resource,
249 return AE_ERROR; 248 return AE_ERROR;
250} 249}
251 250
252static acpi_status __devinit 251static acpi_status count_window(struct acpi_resource *resource, void *data)
253count_window (struct acpi_resource *resource, void *data)
254{ 252{
255 unsigned int *windows = (unsigned int *) data; 253 unsigned int *windows = (unsigned int *) data;
256 struct acpi_resource_address64 addr; 254 struct acpi_resource_address64 addr;
@@ -263,7 +261,7 @@ count_window (struct acpi_resource *resource, void *data)
263 return AE_OK; 261 return AE_OK;
264} 262}
265 263
266static __devinit acpi_status add_window(struct acpi_resource *res, void *data) 264static acpi_status add_window(struct acpi_resource *res, void *data)
267{ 265{
268 struct pci_root_info *info = data; 266 struct pci_root_info *info = data;
269 struct pci_window *window; 267 struct pci_window *window;
@@ -324,8 +322,7 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)
324 return AE_OK; 322 return AE_OK;
325} 323}
326 324
327struct pci_bus * __devinit 325struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
328pci_acpi_scan_root(struct acpi_pci_root *root)
329{ 326{
330 struct acpi_device *device = root->device; 327 struct acpi_device *device = root->device;
331 int domain = root->segment; 328 int domain = root->segment;
@@ -396,7 +393,7 @@ out1:
396 return NULL; 393 return NULL;
397} 394}
398 395
399static int __devinit is_valid_resource(struct pci_dev *dev, int idx) 396static int is_valid_resource(struct pci_dev *dev, int idx)
400{ 397{
401 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; 398 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
402 struct resource *devr = &dev->resource[idx], *busr; 399 struct resource *devr = &dev->resource[idx], *busr;
@@ -414,8 +411,7 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
414 return 0; 411 return 0;
415} 412}
416 413
417static void __devinit 414static void pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
418pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
419{ 415{
420 int i; 416 int i;
421 417
@@ -427,13 +423,13 @@ pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
427 } 423 }
428} 424}
429 425
430void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 426void pcibios_fixup_device_resources(struct pci_dev *dev)
431{ 427{
432 pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES); 428 pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
433} 429}
434EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources); 430EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources);
435 431
436static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev) 432static void pcibios_fixup_bridge_resources(struct pci_dev *dev)
437{ 433{
438 pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES); 434 pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);
439} 435}
@@ -441,8 +437,7 @@ static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
441/* 437/*
442 * Called after each bus is probed, but before its children are examined. 438 * Called after each bus is probed, but before its children are examined.
443 */ 439 */
444void __devinit 440void pcibios_fixup_bus(struct pci_bus *b)
445pcibios_fixup_bus (struct pci_bus *b)
446{ 441{
447 struct pci_dev *dev; 442 struct pci_dev *dev;
448 443
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 8630875e74b..11f2275570f 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -435,8 +435,7 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address)
435 geo_slot(geoid)); 435 geo_slot(geoid));
436} 436}
437 437
438void __devinit 438void sn_pci_fixup_bus(struct pci_bus *bus)
439sn_pci_fixup_bus(struct pci_bus *bus)
440{ 439{
441 440
442 if (SN_ACPI_BASE_SUPPORT()) 441 if (SN_ACPI_BASE_SUPPORT())
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index 4554f68b786..b9992571c03 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -977,7 +977,7 @@ int sn_hwperf_get_nearest_node(cnodeid_t node,
977 return e; 977 return e;
978} 978}
979 979
980static int __devinit sn_hwperf_misc_register_init(void) 980static int sn_hwperf_misc_register_init(void)
981{ 981{
982 int e; 982 int e;
983 983
diff --git a/arch/ia64/xen/irq_xen.c b/arch/ia64/xen/irq_xen.c
index 01f479ee1c4..efb74dafec4 100644
--- a/arch/ia64/xen/irq_xen.c
+++ b/arch/ia64/xen/irq_xen.c
@@ -273,9 +273,8 @@ xen_bind_early_percpu_irq(void)
273 */ 273 */
274 274
275#ifdef CONFIG_HOTPLUG_CPU 275#ifdef CONFIG_HOTPLUG_CPU
276static int __devinit 276static int unbind_evtchn_callback(struct notifier_block *nfb,
277unbind_evtchn_callback(struct notifier_block *nfb, 277 unsigned long action, void *hcpu)
278 unsigned long action, void *hcpu)
279{ 278{
280 unsigned int cpu = (unsigned long)hcpu; 279 unsigned int cpu = (unsigned long)hcpu;
281 280
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index a2cfc0abb05..13168a769f8 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -127,7 +127,7 @@ static void unmap_cpu_to_physid(int, int);
127/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ 127/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
128/* Boot up APs Routines : BSP */ 128/* Boot up APs Routines : BSP */
129/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ 129/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
130void __devinit smp_prepare_boot_cpu(void) 130void smp_prepare_boot_cpu(void)
131{ 131{
132 bsp_phys_id = hard_smp_processor_id(); 132 bsp_phys_id = hard_smp_processor_id();
133 physid_set(bsp_phys_id, phys_cpu_present_map); 133 physid_set(bsp_phys_id, phys_cpu_present_map);
diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index a985a7e87d4..695cd737a42 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -39,7 +39,7 @@ enum {
39#define MAX_UNIT 8 39#define MAX_UNIT 8
40 40
41/* These identify the driver base version and may not be removed. */ 41/* These identify the driver base version and may not be removed. */
42static const char version[] __devinitconst = 42static const char version[] =
43 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE 43 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
44 " S.Opichal, M.Jurik, P.Stehlik\n" 44 " S.Opichal, M.Jurik, P.Stehlik\n"
45 KERN_INFO " http://aranym.org/\n"; 45 KERN_INFO " http://aranym.org/\n";
diff --git a/arch/m68k/include/asm/parport.h b/arch/m68k/include/asm/parport.h
index 646b1872f73..5ea75e6a739 100644
--- a/arch/m68k/include/asm/parport.h
+++ b/arch/m68k/include/asm/parport.h
@@ -15,8 +15,8 @@
15#define outsl(port,buf,len) isa_outsb(port,buf,(len)<<2) 15#define outsl(port,buf,len) isa_outsb(port,buf,(len)<<2)
16 16
17/* no dma, or IRQ autoprobing */ 17/* no dma, or IRQ autoprobing */
18static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); 18static int parport_pc_find_isa_ports (int autoirq, int autodma);
19static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 19static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
20{ 20{
21 if (! (MACH_IS_Q40)) 21 if (! (MACH_IS_Q40))
22 return 0; /* count=0 */ 22 return 0; /* count=0 */
diff --git a/arch/m68k/kernel/pcibios.c b/arch/m68k/kernel/pcibios.c
index 73fa0b56a06..931a31ff59d 100644
--- a/arch/m68k/kernel/pcibios.c
+++ b/arch/m68k/kernel/pcibios.c
@@ -87,7 +87,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
87 return 0; 87 return 0;
88} 88}
89 89
90void __devinit pcibios_fixup_bus(struct pci_bus *bus) 90void pcibios_fixup_bus(struct pci_bus *bus)
91{ 91{
92 struct pci_dev *dev; 92 struct pci_dev *dev;
93 93
@@ -97,7 +97,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
97 } 97 }
98} 98}
99 99
100char __devinit *pcibios_setup(char *str) 100char *pcibios_setup(char *str)
101{ 101{
102 return str; 102 return str;
103} 103}
diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
index b3f5eecff2a..d2b097a652d 100644
--- a/arch/microblaze/configs/mmu_defconfig
+++ b/arch/microblaze/configs/mmu_defconfig
@@ -1,25 +1,22 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_FHANDLE=y
5CONFIG_AUDIT=y
6CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
3CONFIG_IKCONFIG=y 7CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y 8CONFIG_IKCONFIG_PROC=y
9CONFIG_SYSFS_DEPRECATED=y
5CONFIG_SYSFS_DEPRECATED_V2=y 10CONFIG_SYSFS_DEPRECATED_V2=y
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_INITRAMFS_SOURCE="rootfs.cpio"
8CONFIG_INITRAMFS_COMPRESSION_GZIP=y
9# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
10CONFIG_EXPERT=y
11CONFIG_KALLSYMS_ALL=y 11CONFIG_KALLSYMS_ALL=y
12CONFIG_KALLSYMS_EXTRA_PASS=y
13# CONFIG_HOTPLUG is not set
14# CONFIG_BASE_FULL is not set 12# CONFIG_BASE_FULL is not set
15# CONFIG_FUTEX is not set 13CONFIG_EMBEDDED=y
16# CONFIG_EPOLL is not set
17# CONFIG_SIGNALFD is not set
18# CONFIG_SHMEM is not set
19CONFIG_SLAB=y 14CONFIG_SLAB=y
20CONFIG_MODULES=y 15CONFIG_MODULES=y
21CONFIG_MODULE_UNLOAD=y 16CONFIG_MODULE_UNLOAD=y
22# CONFIG_BLK_DEV_BSG is not set 17# CONFIG_BLK_DEV_BSG is not set
18CONFIG_PARTITION_ADVANCED=y
19# CONFIG_EFI_PARTITION is not set
23CONFIG_OPT_LIB_ASM=y 20CONFIG_OPT_LIB_ASM=y
24CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 21CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
25CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 22CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
@@ -31,39 +28,62 @@ CONFIG_HZ_100=y
31CONFIG_MMU=y 28CONFIG_MMU=y
32CONFIG_CMDLINE_BOOL=y 29CONFIG_CMDLINE_BOOL=y
33CONFIG_CMDLINE_FORCE=y 30CONFIG_CMDLINE_FORCE=y
31CONFIG_HIGHMEM=y
32CONFIG_PCI=y
33CONFIG_PCI_XILINX=y
34CONFIG_NET=y 34CONFIG_NET=y
35CONFIG_PACKET=y 35CONFIG_PACKET=y
36CONFIG_UNIX=y 36CONFIG_UNIX=y
37CONFIG_INET=y 37CONFIG_INET=y
38# CONFIG_INET_LRO is not set 38# CONFIG_INET_LRO is not set
39# CONFIG_IPV6 is not set 39# CONFIG_IPV6 is not set
40CONFIG_MTD=y
40CONFIG_PROC_DEVICETREE=y 41CONFIG_PROC_DEVICETREE=y
41CONFIG_BLK_DEV_RAM=y 42CONFIG_BLK_DEV_RAM=y
42CONFIG_BLK_DEV_RAM_SIZE=8192 43CONFIG_BLK_DEV_RAM_SIZE=8192
43CONFIG_NETDEVICES=y 44CONFIG_NETDEVICES=y
44CONFIG_NET_ETHERNET=y
45CONFIG_XILINX_EMACLITE=y 45CONFIG_XILINX_EMACLITE=y
46CONFIG_XILINX_LL_TEMAC=y
46# CONFIG_INPUT is not set 47# CONFIG_INPUT is not set
47# CONFIG_SERIO is not set 48# CONFIG_SERIO is not set
48# CONFIG_VT is not set 49# CONFIG_VT is not set
50CONFIG_SERIAL_8250=y
51CONFIG_SERIAL_8250_CONSOLE=y
49CONFIG_SERIAL_UARTLITE=y 52CONFIG_SERIAL_UARTLITE=y
50CONFIG_SERIAL_UARTLITE_CONSOLE=y 53CONFIG_SERIAL_UARTLITE_CONSOLE=y
51# CONFIG_HW_RANDOM is not set 54# CONFIG_HW_RANDOM is not set
55CONFIG_XILINX_HWICAP=y
56CONFIG_I2C=y
57CONFIG_I2C_XILINX=y
58CONFIG_SPI=y
59CONFIG_SPI_XILINX=y
60CONFIG_GPIOLIB=y
61CONFIG_GPIO_SYSFS=y
62CONFIG_GPIO_XILINX=y
52# CONFIG_HWMON is not set 63# CONFIG_HWMON is not set
64CONFIG_WATCHDOG=y
65CONFIG_XILINX_WATCHDOG=y
66CONFIG_FB=y
67CONFIG_FB_XILINX=y
53# CONFIG_USB_SUPPORT is not set 68# CONFIG_USB_SUPPORT is not set
69CONFIG_UIO=y
70CONFIG_UIO_PDRV=y
71CONFIG_UIO_PDRV_GENIRQ=y
72CONFIG_UIO_DMEM_GENIRQ=y
54CONFIG_EXT2_FS=y 73CONFIG_EXT2_FS=y
55# CONFIG_DNOTIFY is not set 74# CONFIG_DNOTIFY is not set
75CONFIG_CRAMFS=y
76CONFIG_ROMFS_FS=y
56CONFIG_NFS_FS=y 77CONFIG_NFS_FS=y
57CONFIG_NFS_V3=y
58CONFIG_CIFS=y 78CONFIG_CIFS=y
59CONFIG_CIFS_STATS=y 79CONFIG_CIFS_STATS=y
60CONFIG_CIFS_STATS2=y 80CONFIG_CIFS_STATS2=y
61CONFIG_PARTITION_ADVANCED=y
62CONFIG_DEBUG_KERNEL=y
63CONFIG_DETECT_HUNG_TASK=y 81CONFIG_DETECT_HUNG_TASK=y
64CONFIG_DEBUG_SLAB=y 82CONFIG_DEBUG_SLAB=y
65CONFIG_DEBUG_SPINLOCK=y 83CONFIG_DEBUG_SPINLOCK=y
66CONFIG_DEBUG_INFO=y 84CONFIG_DEBUG_INFO=y
67# CONFIG_RCU_CPU_STALL_DETECTOR is not set
68CONFIG_EARLY_PRINTK=y 85CONFIG_EARLY_PRINTK=y
86CONFIG_KEYS=y
87CONFIG_ENCRYPTED_KEYS=y
88CONFIG_KEYS_DEBUG_PROC_KEYS=y
69# CONFIG_CRYPTO_ANSI_CPRNG is not set 89# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
index 0249e4b7e1d..10b5172283d 100644
--- a/arch/microblaze/configs/nommu_defconfig
+++ b/arch/microblaze/configs/nommu_defconfig
@@ -1,41 +1,42 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y 3CONFIG_POSIX_MQUEUE=y
4CONFIG_FHANDLE=y
5CONFIG_AUDIT=y
6CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
4CONFIG_BSD_PROCESS_ACCT=y 7CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_BSD_PROCESS_ACCT_V3=y 8CONFIG_BSD_PROCESS_ACCT_V3=y
6CONFIG_IKCONFIG=y 9CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y 10CONFIG_IKCONFIG_PROC=y
11CONFIG_SYSFS_DEPRECATED=y
8CONFIG_SYSFS_DEPRECATED_V2=y 12CONFIG_SYSFS_DEPRECATED_V2=y
9CONFIG_EXPERT=y
10CONFIG_KALLSYMS_ALL=y 13CONFIG_KALLSYMS_ALL=y
11CONFIG_KALLSYMS_EXTRA_PASS=y
12# CONFIG_HOTPLUG is not set
13# CONFIG_BASE_FULL is not set 14# CONFIG_BASE_FULL is not set
15CONFIG_EMBEDDED=y
14CONFIG_SLAB=y 16CONFIG_SLAB=y
15CONFIG_MODULES=y 17CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y 18CONFIG_MODULE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set 19# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_OPT_LIB_FUNCTION is not set 20CONFIG_PARTITION_ADVANCED=y
21# CONFIG_EFI_PARTITION is not set
19CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 22CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
20CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 23CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
21CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1 24CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
22CONFIG_XILINX_MICROBLAZE0_USE_DIV=1 25CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
23CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2 26CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
24CONFIG_XILINX_MICROBLAZE0_USE_FPU=2 27CONFIG_XILINX_MICROBLAZE0_USE_FPU=2
25CONFIG_HIGH_RES_TIMERS=y
26CONFIG_HZ_100=y 28CONFIG_HZ_100=y
27CONFIG_CMDLINE_BOOL=y 29CONFIG_CMDLINE_BOOL=y
28CONFIG_BINFMT_FLAT=y 30CONFIG_CMDLINE_FORCE=y
31CONFIG_PCI=y
32CONFIG_PCI_XILINX=y
29CONFIG_NET=y 33CONFIG_NET=y
30CONFIG_PACKET=y 34CONFIG_PACKET=y
31CONFIG_UNIX=y 35CONFIG_UNIX=y
32CONFIG_INET=y 36CONFIG_INET=y
33# CONFIG_INET_LRO is not set 37# CONFIG_INET_LRO is not set
34# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
35# CONFIG_PREVENT_FIRMWARE_BUILD is not set
36CONFIG_MTD=y 39CONFIG_MTD=y
37CONFIG_MTD_CONCAT=y
38CONFIG_MTD_PARTITIONS=y
39CONFIG_MTD_CMDLINE_PARTS=y 40CONFIG_MTD_CMDLINE_PARTS=y
40CONFIG_MTD_CHAR=y 41CONFIG_MTD_CHAR=y
41CONFIG_MTD_BLOCK=y 42CONFIG_MTD_BLOCK=y
@@ -45,41 +46,55 @@ CONFIG_MTD_CFI_AMDSTD=y
45CONFIG_MTD_RAM=y 46CONFIG_MTD_RAM=y
46CONFIG_MTD_UCLINUX=y 47CONFIG_MTD_UCLINUX=y
47CONFIG_PROC_DEVICETREE=y 48CONFIG_PROC_DEVICETREE=y
48CONFIG_BLK_DEV_NBD=y
49CONFIG_BLK_DEV_RAM=y 49CONFIG_BLK_DEV_RAM=y
50CONFIG_BLK_DEV_RAM_SIZE=8192
50CONFIG_NETDEVICES=y 51CONFIG_NETDEVICES=y
51CONFIG_NET_ETHERNET=y 52CONFIG_XILINX_EMACLITE=y
53CONFIG_XILINX_LL_TEMAC=y
52# CONFIG_INPUT is not set 54# CONFIG_INPUT is not set
53# CONFIG_SERIO is not set 55# CONFIG_SERIO is not set
54# CONFIG_VT is not set 56# CONFIG_VT is not set
57CONFIG_SERIAL_8250=y
58CONFIG_SERIAL_8250_CONSOLE=y
55CONFIG_SERIAL_UARTLITE=y 59CONFIG_SERIAL_UARTLITE=y
56CONFIG_SERIAL_UARTLITE_CONSOLE=y 60CONFIG_SERIAL_UARTLITE_CONSOLE=y
57CONFIG_HW_RANDOM=y 61# CONFIG_HW_RANDOM is not set
62CONFIG_XILINX_HWICAP=y
63CONFIG_I2C=y
64CONFIG_I2C_XILINX=y
65CONFIG_SPI=y
66CONFIG_SPI_XILINX=y
67CONFIG_GPIOLIB=y
68CONFIG_GPIO_SYSFS=y
69CONFIG_GPIO_XILINX=y
58# CONFIG_HWMON is not set 70# CONFIG_HWMON is not set
59CONFIG_VIDEO_OUTPUT_CONTROL=y 71CONFIG_WATCHDOG=y
72CONFIG_XILINX_WATCHDOG=y
73CONFIG_FB=y
74CONFIG_FB_XILINX=y
75# CONFIG_USB_SUPPORT is not set
76CONFIG_UIO=y
77CONFIG_UIO_PDRV=y
78CONFIG_UIO_PDRV_GENIRQ=y
79CONFIG_UIO_DMEM_GENIRQ=y
60CONFIG_EXT2_FS=y 80CONFIG_EXT2_FS=y
61# CONFIG_DNOTIFY is not set 81# CONFIG_DNOTIFY is not set
62CONFIG_CRAMFS=y 82CONFIG_CRAMFS=y
63CONFIG_ROMFS_FS=y 83CONFIG_ROMFS_FS=y
64CONFIG_NFS_FS=y 84CONFIG_NFS_FS=y
65CONFIG_NFS_V3=y
66CONFIG_NFS_V3_ACL=y 85CONFIG_NFS_V3_ACL=y
67CONFIG_UNUSED_SYMBOLS=y 86CONFIG_NLS=y
68CONFIG_DEBUG_FS=y
69CONFIG_DEBUG_KERNEL=y
70CONFIG_DEBUG_SHIRQ=y
71CONFIG_DETECT_HUNG_TASK=y 87CONFIG_DETECT_HUNG_TASK=y
72CONFIG_SCHEDSTATS=y 88CONFIG_DEBUG_SLAB=y
73CONFIG_TIMER_STATS=y 89CONFIG_DEBUG_SPINLOCK=y
74CONFIG_DEBUG_OBJECTS=y
75CONFIG_DEBUG_OBJECTS_SELFTEST=y
76CONFIG_DEBUG_OBJECTS_FREE=y
77CONFIG_DEBUG_OBJECTS_TIMERS=y
78CONFIG_DEBUG_INFO=y 90CONFIG_DEBUG_INFO=y
79CONFIG_DEBUG_LIST=y
80CONFIG_DEBUG_SG=y
81# CONFIG_RCU_CPU_STALL_DETECTOR is not set
82CONFIG_SYSCTL_SYSCALL_CHECK=y
83CONFIG_EARLY_PRINTK=y 91CONFIG_EARLY_PRINTK=y
92CONFIG_KEYS=y
93CONFIG_ENCRYPTED_KEYS=y
94CONFIG_KEYS_DEBUG_PROC_KEYS=y
95CONFIG_CRYPTO_ECB=y
96CONFIG_CRYPTO_MD4=y
97CONFIG_CRYPTO_MD5=y
98CONFIG_CRYPTO_ARC4=y
99CONFIG_CRYPTO_DES=y
84# CONFIG_CRYPTO_ANSI_CPRNG is not set 100# CONFIG_CRYPTO_ANSI_CPRNG is not set
85# CONFIG_CRC32 is not set
diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h
index 2446a73140a..d0463893243 100644
--- a/arch/microblaze/include/asm/highmem.h
+++ b/arch/microblaze/include/asm/highmem.h
@@ -71,7 +71,7 @@ static inline void kunmap(struct page *page)
71 kunmap_high(page); 71 kunmap_high(page);
72} 72}
73 73
74static inline void *__kmap_atomic(struct page *page) 74static inline void *kmap_atomic(struct page *page)
75{ 75{
76 return kmap_atomic_prot(page, kmap_prot); 76 return kmap_atomic_prot(page, kmap_prot);
77} 77}
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 927540d3cb7..a1ab5f0009e 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -108,7 +108,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
108# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n" 108# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n"
109#else 109#else
110# define __FIXUP_SECTION ".section .discard,\"ax\"\n" 110# define __FIXUP_SECTION ".section .discard,\"ax\"\n"
111# define __EX_TABLE_SECTION ".section .discard,\"a\"\n" 111# define __EX_TABLE_SECTION ".section .discard,\"ax\"\n"
112#endif 112#endif
113 113
114extern unsigned long __copy_tofrom_user(void __user *to, 114extern unsigned long __copy_tofrom_user(void __user *to,
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
index a5f06ac9711..10f8ac18685 100644
--- a/arch/microblaze/include/asm/unistd.h
+++ b/arch/microblaze/include/asm/unistd.h
@@ -37,9 +37,7 @@
37#define __ARCH_WANT_SYS_RT_SIGSUSPEND 37#define __ARCH_WANT_SYS_RT_SIGSUSPEND
38#define __ARCH_WANT_SYS_CLONE 38#define __ARCH_WANT_SYS_CLONE
39#define __ARCH_WANT_SYS_VFORK 39#define __ARCH_WANT_SYS_VFORK
40#ifdef CONFIG_MMU
41#define __ARCH_WANT_SYS_FORK 40#define __ARCH_WANT_SYS_FORK
42#endif
43 41
44/* 42/*
45 * "Conditional" syscalls 43 * "Conditional" syscalls
diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h
index ccb6920f3b3..5f7fe7582f3 100644
--- a/arch/microblaze/include/uapi/asm/unistd.h
+++ b/arch/microblaze/include/uapi/asm/unistd.h
@@ -395,7 +395,8 @@
395#define __NR_process_vm_readv 377 395#define __NR_process_vm_readv 377
396#define __NR_process_vm_writev 378 396#define __NR_process_vm_writev 378
397#define __NR_kcmp 379 397#define __NR_kcmp 379
398#define __NR_finit_module 380
398 399
399#define __NR_syscalls 380 400#define __NR_syscalls 381
400 401
401#endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ 402#endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 1cbace29b5e..4fca56cf02f 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -380,3 +380,4 @@ ENTRY(sys_call_table)
380 .long sys_process_vm_readv 380 .long sys_process_vm_readv
381 .long sys_process_vm_writev 381 .long sys_process_vm_writev
382 .long sys_kcmp 382 .long sys_kcmp
383 .long sys_finit_module
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index a1c5b996d66..96416553cb3 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -287,7 +287,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
287 unsigned long io_offset = 0; 287 unsigned long io_offset = 0;
288 int i, res_bit; 288 int i, res_bit;
289 289
290 if (hose == 0) 290 if (!hose)
291 return NULL; /* should never happen */ 291 return NULL; /* should never happen */
292 292
293 /* If memory, add on the PCI bridge address offset */ 293 /* If memory, add on the PCI bridge address offset */
@@ -655,9 +655,8 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
655 * - Some 32 bits platforms such as 4xx can have physical space larger than 655 * - Some 32 bits platforms such as 4xx can have physical space larger than
656 * 32 bits so we need to use 64 bits values for the parsing 656 * 32 bits so we need to use 64 bits values for the parsing
657 */ 657 */
658void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, 658void pci_process_bridge_OF_ranges(struct pci_controller *hose,
659 struct device_node *dev, 659 struct device_node *dev, int primary)
660 int primary)
661{ 660{
662 const u32 *ranges; 661 const u32 *ranges;
663 int rlen; 662 int rlen;
@@ -822,15 +821,13 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
822/* Decide whether to display the domain number in /proc */ 821/* Decide whether to display the domain number in /proc */
823int pci_proc_domain(struct pci_bus *bus) 822int pci_proc_domain(struct pci_bus *bus)
824{ 823{
825 struct pci_controller *hose = pci_bus_to_host(bus);
826
827 return 0; 824 return 0;
828} 825}
829 826
830/* This header fixup will do the resource fixup for all devices as they are 827/* This header fixup will do the resource fixup for all devices as they are
831 * probed, but not for bridge ranges 828 * probed, but not for bridge ranges
832 */ 829 */
833static void __devinit pcibios_fixup_resources(struct pci_dev *dev) 830static void pcibios_fixup_resources(struct pci_dev *dev)
834{ 831{
835 struct pci_controller *hose = pci_bus_to_host(dev->bus); 832 struct pci_controller *hose = pci_bus_to_host(dev->bus);
836 int i; 833 int i;
@@ -871,8 +868,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
871 * things go more smoothly when it gets it right. It should covers cases such 868 * things go more smoothly when it gets it right. It should covers cases such
872 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges 869 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges
873 */ 870 */
874static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus, 871static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
875 struct resource *res) 872 struct resource *res)
876{ 873{
877 struct pci_controller *hose = pci_bus_to_host(bus); 874 struct pci_controller *hose = pci_bus_to_host(bus);
878 struct pci_dev *dev = bus->self; 875 struct pci_dev *dev = bus->self;
@@ -933,7 +930,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
933} 930}
934 931
935/* Fixup resources of a PCI<->PCI bridge */ 932/* Fixup resources of a PCI<->PCI bridge */
936static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) 933static void pcibios_fixup_bridge(struct pci_bus *bus)
937{ 934{
938 struct resource *res; 935 struct resource *res;
939 int i; 936 int i;
@@ -970,14 +967,14 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
970 } 967 }
971} 968}
972 969
973void __devinit pcibios_setup_bus_self(struct pci_bus *bus) 970void pcibios_setup_bus_self(struct pci_bus *bus)
974{ 971{
975 /* Fix up the bus resources for P2P bridges */ 972 /* Fix up the bus resources for P2P bridges */
976 if (bus->self != NULL) 973 if (bus->self != NULL)
977 pcibios_fixup_bridge(bus); 974 pcibios_fixup_bridge(bus);
978} 975}
979 976
980void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) 977void pcibios_setup_bus_devices(struct pci_bus *bus)
981{ 978{
982 struct pci_dev *dev; 979 struct pci_dev *dev;
983 980
@@ -1002,7 +999,7 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
1002 } 999 }
1003} 1000}
1004 1001
1005void __devinit pcibios_fixup_bus(struct pci_bus *bus) 1002void pcibios_fixup_bus(struct pci_bus *bus)
1006{ 1003{
1007 /* When called from the generic PCI probe, read PCI<->PCI bridge 1004 /* When called from the generic PCI probe, read PCI<->PCI bridge
1008 * bases. This is -not- called when generating the PCI tree from 1005 * bases. This is -not- called when generating the PCI tree from
@@ -1124,7 +1121,7 @@ static int __init reparent_resources(struct resource *parent,
1124 * as well. 1121 * as well.
1125 */ 1122 */
1126 1123
1127void pcibios_allocate_bus_resources(struct pci_bus *bus) 1124static void pcibios_allocate_bus_resources(struct pci_bus *bus)
1128{ 1125{
1129 struct pci_bus *b; 1126 struct pci_bus *b;
1130 int i; 1127 int i;
@@ -1179,7 +1176,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1179 } 1176 }
1180 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1177 printk(KERN_WARNING "PCI: Cannot allocate resource region "
1181 "%d of PCI bridge %d, will remap\n", i, bus->number); 1178 "%d of PCI bridge %d, will remap\n", i, bus->number);
1182clear_resource: 1179
1183 res->start = res->end = 0; 1180 res->start = res->end = 0;
1184 res->flags = 0; 1181 res->flags = 0;
1185 } 1182 }
@@ -1188,7 +1185,7 @@ clear_resource:
1188 pcibios_allocate_bus_resources(b); 1185 pcibios_allocate_bus_resources(b);
1189} 1186}
1190 1187
1191static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) 1188static inline void alloc_resource(struct pci_dev *dev, int idx)
1192{ 1189{
1193 struct resource *pr, *r = &dev->resource[idx]; 1190 struct resource *pr, *r = &dev->resource[idx];
1194 1191
@@ -1351,7 +1348,7 @@ void __init pcibios_resource_survey(void)
1351 * rest of the code later, for now, keep it as-is as our main 1348 * rest of the code later, for now, keep it as-is as our main
1352 * resource allocation function doesn't deal with sub-trees yet. 1349 * resource allocation function doesn't deal with sub-trees yet.
1353 */ 1350 */
1354void __devinit pcibios_claim_one_bus(struct pci_bus *bus) 1351void pcibios_claim_one_bus(struct pci_bus *bus)
1355{ 1352{
1356 struct pci_dev *dev; 1353 struct pci_dev *dev;
1357 struct pci_bus *child_bus; 1354 struct pci_bus *child_bus;
@@ -1410,7 +1407,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
1410 return pci_enable_resources(dev, mask); 1407 return pci_enable_resources(dev, mask);
1411} 1408}
1412 1409
1413static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) 1410static void pcibios_setup_phb_resources(struct pci_controller *hose,
1411 struct list_head *resources)
1414{ 1412{
1415 unsigned long io_offset; 1413 unsigned long io_offset;
1416 struct resource *res; 1414 struct resource *res;
@@ -1433,7 +1431,8 @@ static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, s
1433 res->end = res->start + IO_SPACE_LIMIT; 1431 res->end = res->start + IO_SPACE_LIMIT;
1434 res->flags = IORESOURCE_IO; 1432 res->flags = IORESOURCE_IO;
1435 } 1433 }
1436 pci_add_resource_offset(resources, res, hose->io_base_virt - _IO_BASE); 1434 pci_add_resource_offset(resources, res,
1435 (__force resource_size_t)(hose->io_base_virt - _IO_BASE));
1437 1436
1438 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", 1437 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n",
1439 (unsigned long long)res->start, 1438 (unsigned long long)res->start,
@@ -1477,7 +1476,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
1477 return of_node_get(hose->dn); 1476 return of_node_get(hose->dn);
1478} 1477}
1479 1478
1480static void __devinit pcibios_scan_phb(struct pci_controller *hose) 1479static void pcibios_scan_phb(struct pci_controller *hose)
1481{ 1480{
1482 LIST_HEAD(resources); 1481 LIST_HEAD(resources);
1483 struct pci_bus *bus; 1482 struct pci_bus *bus;
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b7dc39c6c84..2ac626ab9d4 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -39,8 +39,8 @@ config MIPS
39 select GENERIC_CLOCKEVENTS 39 select GENERIC_CLOCKEVENTS
40 select GENERIC_CMOS_UPDATE 40 select GENERIC_CMOS_UPDATE
41 select HAVE_MOD_ARCH_SPECIFIC 41 select HAVE_MOD_ARCH_SPECIFIC
42 select MODULES_USE_ELF_REL 42 select MODULES_USE_ELF_REL if MODULES
43 select MODULES_USE_ELF_RELA if 64BIT 43 select MODULES_USE_ELF_RELA if MODULES && 64BIT
44 44
45menu "Machine selection" 45menu "Machine selection"
46 46
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index a7193ae13a5..b67930d1932 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -53,7 +53,7 @@ static struct clocksource au1x_counter1_clocksource = {
53 .read = au1x_counter1_read, 53 .read = au1x_counter1_read,
54 .mask = CLOCKSOURCE_MASK(32), 54 .mask = CLOCKSOURCE_MASK(32),
55 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 55 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
56 .rating = 100, 56 .rating = 1500,
57}; 57};
58 58
59static int au1x_rtcmatch2_set_next_event(unsigned long delta, 59static int au1x_rtcmatch2_set_next_event(unsigned long delta,
@@ -84,7 +84,7 @@ static irqreturn_t au1x_rtcmatch2_irq(int irq, void *dev_id)
84static struct clock_event_device au1x_rtcmatch2_clockdev = { 84static struct clock_event_device au1x_rtcmatch2_clockdev = {
85 .name = "rtcmatch2", 85 .name = "rtcmatch2",
86 .features = CLOCK_EVT_FEAT_ONESHOT, 86 .features = CLOCK_EVT_FEAT_ONESHOT,
87 .rating = 100, 87 .rating = 1500,
88 .set_next_event = au1x_rtcmatch2_set_next_event, 88 .set_next_event = au1x_rtcmatch2_set_next_event,
89 .set_mode = au1x_rtcmatch2_set_mode, 89 .set_mode = au1x_rtcmatch2_set_mode,
90 .cpumask = cpu_all_mask, 90 .cpumask = cpu_all_mask,
@@ -158,20 +158,6 @@ cntr_err:
158 return -1; 158 return -1;
159} 159}
160 160
161static void __init alchemy_setup_c0timer(void)
162{
163 /*
164 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
165 * function is called. Because the Alchemy counters are unusable
166 * the C0 timekeeping code is installed and use of the 'wait'
167 * instruction must be prohibited, which is done most easily by
168 * assigning NULL to cpu_wait.
169 */
170 cpu_wait = NULL;
171 r4k_clockevent_init();
172 init_r4k_clocksource();
173}
174
175static int alchemy_m2inttab[] __initdata = { 161static int alchemy_m2inttab[] __initdata = {
176 AU1000_RTC_MATCH2_INT, 162 AU1000_RTC_MATCH2_INT,
177 AU1500_RTC_MATCH2_INT, 163 AU1500_RTC_MATCH2_INT,
@@ -186,8 +172,7 @@ void __init plat_time_init(void)
186 int t; 172 int t;
187 173
188 t = alchemy_get_cputype(); 174 t = alchemy_get_cputype();
189 if (t == ALCHEMY_CPU_UNKNOWN) 175 if (t == ALCHEMY_CPU_UNKNOWN ||
190 alchemy_setup_c0timer(); 176 alchemy_time_init(alchemy_m2inttab[t]))
191 else if (alchemy_time_init(alchemy_m2inttab[t])) 177 cpu_wait = NULL; /* wait doesn't work with r4k timer */
192 alchemy_setup_c0timer();
193} 178}
diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c
index 569f41bdcc4..f393f65f392 100644
--- a/arch/mips/cavium-octeon/serial.c
+++ b/arch/mips/cavium-octeon/serial.c
@@ -43,7 +43,7 @@ void octeon_serial_out(struct uart_port *up, int offset, int value)
43 cvmx_write_csr((uint64_t)(up->membase + (offset << 3)), (u8)value); 43 cvmx_write_csr((uint64_t)(up->membase + (offset << 3)), (u8)value);
44} 44}
45 45
46static int __devinit octeon_serial_probe(struct platform_device *pdev) 46static int octeon_serial_probe(struct platform_device *pdev)
47{ 47{
48 int irq, res; 48 int irq, res;
49 struct resource *res_mem; 49 struct resource *res_mem;
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 31ab10f02ba..dbaec94046d 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -45,8 +45,6 @@
45#define HUGETLB_PAGE_ORDER ({BUILD_BUG(); 0; }) 45#define HUGETLB_PAGE_ORDER ({BUILD_BUG(); 0; })
46#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */ 46#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
47 47
48#ifndef __ASSEMBLY__
49
50#include <linux/pfn.h> 48#include <linux/pfn.h>
51#include <asm/io.h> 49#include <asm/io.h>
52 50
@@ -139,8 +137,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
139 */ 137 */
140#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) 138#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
141 139
142#endif /* !__ASSEMBLY__ */
143
144/* 140/*
145 * __pa()/__va() should be used only during mem init. 141 * __pa()/__va() should be used only during mem init.
146 */ 142 */
@@ -202,7 +198,10 @@ typedef struct { unsigned long pgprot; } pgprot_t;
202#endif 198#endif
203 199
204#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) 200#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
205#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) 201
202extern int __virt_addr_valid(const volatile void *kaddr);
203#define virt_addr_valid(kaddr) \
204 __virt_addr_valid((const volatile void *) (kaddr))
206 205
207#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 206#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
208 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 207 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 90bf3b3fce1..d69ea743272 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -145,7 +145,7 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
145extern char * (*pcibios_plat_setup)(char *str); 145extern char * (*pcibios_plat_setup)(char *str);
146 146
147/* this function parses memory ranges from a device node */ 147/* this function parses memory ranges from a device node */
148extern void __devinit pci_load_of_ranges(struct pci_controller *hose, 148extern void pci_load_of_ranges(struct pci_controller *hose,
149 struct device_node *node); 149 struct device_node *node);
150 150
151#endif /* _ASM_PCI_H */ 151#endif /* _ASM_PCI_H */
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 18806a52061..b2050b9e64b 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -29,10 +29,11 @@ struct thread_info {
29 __u32 cpu; /* current CPU */ 29 __u32 cpu; /* current CPU */
30 int preempt_count; /* 0 => preemptable, <0 => BUG */ 30 int preempt_count; /* 0 => preemptable, <0 => BUG */
31 31
32 mm_segment_t addr_limit; /* thread address space: 32 mm_segment_t addr_limit; /*
33 0-0xBFFFFFFF for user-thead 33 * thread address space limit:
34 0-0xFFFFFFFF for kernel-thread 34 * 0x7fffffff for user-thead
35 */ 35 * 0xffffffff for kernel-thread
36 */
36 struct restart_block restart_block; 37 struct restart_block restart_block;
37 struct pt_regs *regs; 38 struct pt_regs *regs;
38}; 39};
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
index cc98a9dcb01..0eebf3c3e03 100644
--- a/arch/mips/include/uapi/asm/unistd.h
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -368,16 +368,17 @@
368#define __NR_process_vm_readv (__NR_Linux + 345) 368#define __NR_process_vm_readv (__NR_Linux + 345)
369#define __NR_process_vm_writev (__NR_Linux + 346) 369#define __NR_process_vm_writev (__NR_Linux + 346)
370#define __NR_kcmp (__NR_Linux + 347) 370#define __NR_kcmp (__NR_Linux + 347)
371#define __NR_finit_module (__NR_Linux + 348)
371 372
372/* 373/*
373 * Offset of the last Linux o32 flavoured syscall 374 * Offset of the last Linux o32 flavoured syscall
374 */ 375 */
375#define __NR_Linux_syscalls 347 376#define __NR_Linux_syscalls 348
376 377
377#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 378#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
378 379
379#define __NR_O32_Linux 4000 380#define __NR_O32_Linux 4000
380#define __NR_O32_Linux_syscalls 347 381#define __NR_O32_Linux_syscalls 348
381 382
382#if _MIPS_SIM == _MIPS_SIM_ABI64 383#if _MIPS_SIM == _MIPS_SIM_ABI64
383 384
@@ -692,16 +693,17 @@
692#define __NR_process_vm_readv (__NR_Linux + 304) 693#define __NR_process_vm_readv (__NR_Linux + 304)
693#define __NR_process_vm_writev (__NR_Linux + 305) 694#define __NR_process_vm_writev (__NR_Linux + 305)
694#define __NR_kcmp (__NR_Linux + 306) 695#define __NR_kcmp (__NR_Linux + 306)
696#define __NR_finit_module (__NR_Linux + 307)
695 697
696/* 698/*
697 * Offset of the last Linux 64-bit flavoured syscall 699 * Offset of the last Linux 64-bit flavoured syscall
698 */ 700 */
699#define __NR_Linux_syscalls 306 701#define __NR_Linux_syscalls 307
700 702
701#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 703#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
702 704
703#define __NR_64_Linux 5000 705#define __NR_64_Linux 5000
704#define __NR_64_Linux_syscalls 306 706#define __NR_64_Linux_syscalls 307
705 707
706#if _MIPS_SIM == _MIPS_SIM_NABI32 708#if _MIPS_SIM == _MIPS_SIM_NABI32
707 709
@@ -1021,15 +1023,16 @@
1021#define __NR_process_vm_readv (__NR_Linux + 309) 1023#define __NR_process_vm_readv (__NR_Linux + 309)
1022#define __NR_process_vm_writev (__NR_Linux + 310) 1024#define __NR_process_vm_writev (__NR_Linux + 310)
1023#define __NR_kcmp (__NR_Linux + 311) 1025#define __NR_kcmp (__NR_Linux + 311)
1026#define __NR_finit_module (__NR_Linux + 312)
1024 1027
1025/* 1028/*
1026 * Offset of the last N32 flavoured syscall 1029 * Offset of the last N32 flavoured syscall
1027 */ 1030 */
1028#define __NR_Linux_syscalls 311 1031#define __NR_Linux_syscalls 312
1029 1032
1030#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 1033#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1031 1034
1032#define __NR_N32_Linux 6000 1035#define __NR_N32_Linux 6000
1033#define __NR_N32_Linux_syscalls 311 1036#define __NR_N32_Linux_syscalls 312
1034 1037
1035#endif /* _UAPI_ASM_UNISTD_H */ 1038#endif /* _UAPI_ASM_UNISTD_H */
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 9690998d4ef..50285b2c7ff 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -200,6 +200,9 @@ void output_mm_defines(void)
200 DEFINE(_PTRS_PER_PMD, PTRS_PER_PMD); 200 DEFINE(_PTRS_PER_PMD, PTRS_PER_PMD);
201 DEFINE(_PTRS_PER_PTE, PTRS_PER_PTE); 201 DEFINE(_PTRS_PER_PTE, PTRS_PER_PTE);
202 BLANK(); 202 BLANK();
203 DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
204 DEFINE(_PAGE_SIZE, PAGE_SIZE);
205 BLANK();
203} 206}
204 207
205#ifdef CONFIG_32BIT 208#ifdef CONFIG_32BIT
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 8882e5766f2..8a0096d6281 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -19,7 +19,6 @@
19#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
20#include <asm/stackframe.h> 20#include <asm/stackframe.h>
21#include <asm/war.h> 21#include <asm/war.h>
22#include <asm/page.h>
23#include <asm/thread_info.h> 22#include <asm/thread_info.h>
24 23
25#define PANIC_PIC(msg) \ 24#define PANIC_PIC(msg) \
@@ -483,8 +482,8 @@ NESTED(nmi_handler, PT_SIZE, sp)
483 MFC0 k1, CP0_ENTRYHI 482 MFC0 k1, CP0_ENTRYHI
484 andi k1, 0xff /* ASID_MASK */ 483 andi k1, 0xff /* ASID_MASK */
485 MFC0 k0, CP0_EPC 484 MFC0 k0, CP0_EPC
486 PTR_SRL k0, PAGE_SHIFT + 1 485 PTR_SRL k0, _PAGE_SHIFT + 1
487 PTR_SLL k0, PAGE_SHIFT + 1 486 PTR_SLL k0, _PAGE_SHIFT + 1
488 or k1, k0 487 or k1, k0
489 MTC0 k1, CP0_ENTRYHI 488 MTC0 k1, CP0_ENTRYHI
490 mtc0_tlbw_hazard 489 mtc0_tlbw_hazard
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index ea695d9605e..fcf97312f32 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -21,7 +21,6 @@
21#include <asm/asmmacro.h> 21#include <asm/asmmacro.h>
22#include <asm/irqflags.h> 22#include <asm/irqflags.h>
23#include <asm/regdef.h> 23#include <asm/regdef.h>
24#include <asm/page.h>
25#include <asm/pgtable-bits.h> 24#include <asm/pgtable-bits.h>
26#include <asm/mipsregs.h> 25#include <asm/mipsregs.h>
27#include <asm/stackframe.h> 26#include <asm/stackframe.h>
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
index 0441f54b2a6..207f1341578 100644
--- a/arch/mips/kernel/octeon_switch.S
+++ b/arch/mips/kernel/octeon_switch.S
@@ -15,7 +15,6 @@
15#include <asm/fpregdef.h> 15#include <asm/fpregdef.h>
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/page.h>
19#include <asm/pgtable-bits.h> 18#include <asm/pgtable-bits.h>
20#include <asm/regdef.h> 19#include <asm/regdef.h>
21#include <asm/stackframe.h> 20#include <asm/stackframe.h>
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index b14c14d90fc..d9c81c5a6c9 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -847,7 +847,6 @@ static const struct mips_perf_event xlp_event_map[PERF_COUNT_HW_MAX] = {
847 [PERF_COUNT_HW_CACHE_MISSES] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */ 847 [PERF_COUNT_HW_CACHE_MISSES] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */
848 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x1b, CNTR_ALL }, /* PAPI_BR_CN */ 848 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x1b, CNTR_ALL }, /* PAPI_BR_CN */
849 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */ 849 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */
850 [PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },
851}; 850};
852 851
853/* 24K/34K/1004K cores can share the same cache event map. */ 852/* 24K/34K/1004K cores can share the same cache event map. */
@@ -1115,24 +1114,12 @@ static const struct mips_perf_event xlp_cache_map
1115 [C(RESULT_ACCESS)] = { 0x2f, CNTR_ALL }, /* PAPI_L1_DCW */ 1114 [C(RESULT_ACCESS)] = { 0x2f, CNTR_ALL }, /* PAPI_L1_DCW */
1116 [C(RESULT_MISS)] = { 0x2e, CNTR_ALL }, /* PAPI_L1_STM */ 1115 [C(RESULT_MISS)] = { 0x2e, CNTR_ALL }, /* PAPI_L1_STM */
1117 }, 1116 },
1118 [C(OP_PREFETCH)] = {
1119 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1120 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1121 },
1122}, 1117},
1123[C(L1I)] = { 1118[C(L1I)] = {
1124 [C(OP_READ)] = { 1119 [C(OP_READ)] = {
1125 [C(RESULT_ACCESS)] = { 0x04, CNTR_ALL }, /* PAPI_L1_ICA */ 1120 [C(RESULT_ACCESS)] = { 0x04, CNTR_ALL }, /* PAPI_L1_ICA */
1126 [C(RESULT_MISS)] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */ 1121 [C(RESULT_MISS)] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */
1127 }, 1122 },
1128 [C(OP_WRITE)] = {
1129 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1130 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1131 },
1132 [C(OP_PREFETCH)] = {
1133 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1134 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1135 },
1136}, 1123},
1137[C(LL)] = { 1124[C(LL)] = {
1138 [C(OP_READ)] = { 1125 [C(OP_READ)] = {
@@ -1143,10 +1130,6 @@ static const struct mips_perf_event xlp_cache_map
1143 [C(RESULT_ACCESS)] = { 0x34, CNTR_ALL }, /* PAPI_L2_DCA */ 1130 [C(RESULT_ACCESS)] = { 0x34, CNTR_ALL }, /* PAPI_L2_DCA */
1144 [C(RESULT_MISS)] = { 0x36, CNTR_ALL }, /* PAPI_L2_DCM */ 1131 [C(RESULT_MISS)] = { 0x36, CNTR_ALL }, /* PAPI_L2_DCM */
1145 }, 1132 },
1146 [C(OP_PREFETCH)] = {
1147 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1148 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1149 },
1150}, 1133},
1151[C(DTLB)] = { 1134[C(DTLB)] = {
1152 /* 1135 /*
@@ -1154,45 +1137,24 @@ static const struct mips_perf_event xlp_cache_map
1154 * read and write. 1137 * read and write.
1155 */ 1138 */
1156 [C(OP_READ)] = { 1139 [C(OP_READ)] = {
1157 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1158 [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */ 1140 [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */
1159 }, 1141 },
1160 [C(OP_WRITE)] = { 1142 [C(OP_WRITE)] = {
1161 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1162 [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */ 1143 [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */
1163 }, 1144 },
1164 [C(OP_PREFETCH)] = {
1165 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1166 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1167 },
1168}, 1145},
1169[C(ITLB)] = { 1146[C(ITLB)] = {
1170 [C(OP_READ)] = { 1147 [C(OP_READ)] = {
1171 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1172 [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */ 1148 [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */
1173 }, 1149 },
1174 [C(OP_WRITE)] = { 1150 [C(OP_WRITE)] = {
1175 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1176 [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */ 1151 [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */
1177 }, 1152 },
1178 [C(OP_PREFETCH)] = {
1179 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1180 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1181 },
1182}, 1153},
1183[C(BPU)] = { 1154[C(BPU)] = {
1184 [C(OP_READ)] = { 1155 [C(OP_READ)] = {
1185 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1186 [C(RESULT_MISS)] = { 0x25, CNTR_ALL }, 1156 [C(RESULT_MISS)] = { 0x25, CNTR_ALL },
1187 }, 1157 },
1188 [C(OP_WRITE)] = {
1189 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1190 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1191 },
1192 [C(OP_PREFETCH)] = {
1193 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1194 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1195 },
1196}, 1158},
1197}; 1159};
1198 1160
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 9c51be5a163..8d32d5a6b46 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -15,7 +15,6 @@
15#include <asm/fpregdef.h> 15#include <asm/fpregdef.h>
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/page.h>
19#include <asm/regdef.h> 18#include <asm/regdef.h>
20#include <asm/stackframe.h> 19#include <asm/stackframe.h>
21#include <asm/thread_info.h> 20#include <asm/thread_info.h>
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 42d2a393842..8decdfacb44 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -15,7 +15,6 @@
15#include <asm/fpregdef.h> 15#include <asm/fpregdef.h>
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/page.h>
19#include <asm/pgtable-bits.h> 18#include <asm/pgtable-bits.h>
20#include <asm/regdef.h> 19#include <asm/regdef.h>
21#include <asm/stackframe.h> 20#include <asm/stackframe.h>
diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
index e4142c5f7c2..804ebb2c34a 100644
--- a/arch/mips/kernel/relocate_kernel.S
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -9,7 +9,6 @@
9#include <asm/asm.h> 9#include <asm/asm.h>
10#include <asm/asmmacro.h> 10#include <asm/asmmacro.h>
11#include <asm/regdef.h> 11#include <asm/regdef.h>
12#include <asm/page.h>
13#include <asm/mipsregs.h> 12#include <asm/mipsregs.h>
14#include <asm/stackframe.h> 13#include <asm/stackframe.h>
15#include <asm/addrspace.h> 14#include <asm/addrspace.h>
@@ -50,7 +49,7 @@ process_entry:
50 and s3, s2, 0x8 49 and s3, s2, 0x8
51 beq s3, zero, process_entry 50 beq s3, zero, process_entry
52 and s2, s2, ~0x8 51 and s2, s2, ~0x8
53 li s6, (1 << PAGE_SHIFT) / SZREG 52 li s6, (1 << _PAGE_SHIFT) / SZREG
54 53
55copy_word: 54copy_word:
56 /* copy page word by word */ 55 /* copy page word by word */
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 374f66e05f3..d20a4bc9ed0 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -583,6 +583,7 @@ einval: li v0, -ENOSYS
583 sys sys_process_vm_readv 6 /* 4345 */ 583 sys sys_process_vm_readv 6 /* 4345 */
584 sys sys_process_vm_writev 6 584 sys sys_process_vm_writev 6
585 sys sys_kcmp 5 585 sys sys_kcmp 5
586 sys sys_finit_module 3
586 .endm 587 .endm
587 588
588 /* We pre-compute the number of _instruction_ bytes needed to 589 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 169de6a6d91..b64f642da07 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -422,4 +422,5 @@ sys_call_table:
422 PTR sys_process_vm_readv 422 PTR sys_process_vm_readv
423 PTR sys_process_vm_writev /* 5305 */ 423 PTR sys_process_vm_writev /* 5305 */
424 PTR sys_kcmp 424 PTR sys_kcmp
425 PTR sys_finit_module
425 .size sys_call_table,.-sys_call_table 426 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index ad3de9668da..c29ac197f44 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -416,4 +416,5 @@ EXPORT(sysn32_call_table)
416 PTR compat_sys_process_vm_readv 416 PTR compat_sys_process_vm_readv
417 PTR compat_sys_process_vm_writev /* 6310 */ 417 PTR compat_sys_process_vm_writev /* 6310 */
418 PTR sys_kcmp 418 PTR sys_kcmp
419 PTR sys_finit_module
419 .size sysn32_call_table,.-sysn32_call_table 420 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 9601be6afa3..cf3e75e4665 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -540,4 +540,5 @@ sys_call_table:
540 PTR compat_sys_process_vm_readv /* 4345 */ 540 PTR compat_sys_process_vm_readv /* 4345 */
541 PTR compat_sys_process_vm_writev 541 PTR compat_sys_process_vm_writev
542 PTR sys_kcmp 542 PTR sys_kcmp
543 PTR sys_finit_module
543 .size sys_call_table,.-sys_call_table 544 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 2e6374a589e..66bf4e22d9b 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -188,7 +188,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
188} 188}
189 189
190/* preload SMP state for boot cpu */ 190/* preload SMP state for boot cpu */
191void __devinit smp_prepare_boot_cpu(void) 191void smp_prepare_boot_cpu(void)
192{ 192{
193 set_cpu_possible(0, true); 193 set_cpu_possible(0, true);
194 set_cpu_online(0, true); 194 set_cpu_online(0, true);
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 007ccbe1e26..0a4336b803e 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -1,7 +1,8 @@
1#include <asm/asm-offsets.h> 1#include <asm/asm-offsets.h>
2#include <asm/page.h>
3#include <asm/thread_info.h> 2#include <asm/thread_info.h>
4 3
4#define PAGE_SIZE _PAGE_SIZE
5
5/* 6/*
6 * Put .bss..swapper_pg_dir as the first thing in .bss. This will 7 * Put .bss..swapper_pg_dir as the first thing in .bss. This will
7 * ensure that it has .bss alignment (64K). 8 * ensure that it has .bss alignment (64K).
diff --git a/arch/mips/lantiq/xway/dma.c b/arch/mips/lantiq/xway/dma.c
index 6453962ac89..e44a1866653 100644
--- a/arch/mips/lantiq/xway/dma.c
+++ b/arch/mips/lantiq/xway/dma.c
@@ -210,7 +210,7 @@ ltq_dma_init_port(int p)
210} 210}
211EXPORT_SYMBOL_GPL(ltq_dma_init_port); 211EXPORT_SYMBOL_GPL(ltq_dma_init_port);
212 212
213static int __devinit 213static int
214ltq_dma_init(struct platform_device *pdev) 214ltq_dma_init(struct platform_device *pdev)
215{ 215{
216 struct clk *clk; 216 struct clk *clk;
diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
index cbb56fc022b..e30b1ed1b93 100644
--- a/arch/mips/lantiq/xway/gptu.c
+++ b/arch/mips/lantiq/xway/gptu.c
@@ -133,7 +133,7 @@ static inline void clkdev_add_gptu(struct device *dev, const char *con,
133 clkdev_add(&clk->cl); 133 clkdev_add(&clk->cl);
134} 134}
135 135
136static int __devinit gptu_probe(struct platform_device *pdev) 136static int gptu_probe(struct platform_device *pdev)
137{ 137{
138 struct clk *clk; 138 struct clk *clk;
139 struct resource *res; 139 struct resource *res;
diff --git a/arch/mips/lantiq/xway/xrx200_phy_fw.c b/arch/mips/lantiq/xway/xrx200_phy_fw.c
index fe808bf5366..d4d9d31f152 100644
--- a/arch/mips/lantiq/xway/xrx200_phy_fw.c
+++ b/arch/mips/lantiq/xway/xrx200_phy_fw.c
@@ -54,7 +54,7 @@ static dma_addr_t xway_gphy_load(struct platform_device *pdev)
54 return dev_addr; 54 return dev_addr;
55} 55}
56 56
57static int __devinit xway_phy_fw_probe(struct platform_device *pdev) 57static int xway_phy_fw_probe(struct platform_device *pdev)
58{ 58{
59 dma_addr_t fw_addr; 59 dma_addr_t fw_addr;
60 struct property *pp; 60 struct property *pp;
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index cacfd31e8ec..7657fd21cd3 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -190,3 +190,9 @@ void __iounmap(const volatile void __iomem *addr)
190 190
191EXPORT_SYMBOL(__ioremap); 191EXPORT_SYMBOL(__ioremap);
192EXPORT_SYMBOL(__iounmap); 192EXPORT_SYMBOL(__iounmap);
193
194int __virt_addr_valid(const volatile void *kaddr)
195{
196 return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
197}
198EXPORT_SYMBOL_GPL(__virt_addr_valid);
diff --git a/arch/mips/mm/tlbex-fault.S b/arch/mips/mm/tlbex-fault.S
index e99eaa1fbed..318855eb5f8 100644
--- a/arch/mips/mm/tlbex-fault.S
+++ b/arch/mips/mm/tlbex-fault.S
@@ -7,7 +7,6 @@
7 * Copyright (C) 1999 Silicon Graphics, Inc. 7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */ 8 */
9#include <asm/mipsregs.h> 9#include <asm/mipsregs.h>
10#include <asm/page.h>
11#include <asm/regdef.h> 10#include <asm/regdef.h>
12#include <asm/stackframe.h> 11#include <asm/stackframe.h>
13 12
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 05613355627..1c8ac49ec72 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -976,13 +976,6 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
976#endif 976#endif
977 uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ 977 uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
978 uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); 978 uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr);
979
980 if (cpu_has_mips_r2) {
981 uasm_i_ext(p, tmp, tmp, PGDIR_SHIFT, (32 - PGDIR_SHIFT));
982 uasm_i_ins(p, ptr, tmp, PGD_T_LOG2, (32 - PGDIR_SHIFT));
983 return;
984 }
985
986 uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */ 979 uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */
987 uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); 980 uasm_i_sll(p, tmp, tmp, PGD_T_LOG2);
988 uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ 981 uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */
@@ -1018,15 +1011,6 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx)
1018 1011
1019static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) 1012static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
1020{ 1013{
1021 if (cpu_has_mips_r2) {
1022 /* PTE ptr offset is obtained from BadVAddr */
1023 UASM_i_MFC0(p, tmp, C0_BADVADDR);
1024 UASM_i_LW(p, ptr, 0, ptr);
1025 uasm_i_ext(p, tmp, tmp, PAGE_SHIFT+1, PGDIR_SHIFT-PAGE_SHIFT-1);
1026 uasm_i_ins(p, ptr, tmp, PTE_T_LOG2+1, PGDIR_SHIFT-PAGE_SHIFT-1);
1027 return;
1028 }
1029
1030 /* 1014 /*
1031 * Bug workaround for the Nevada. It seems as if under certain 1015 * Bug workaround for the Nevada. It seems as if under certain
1032 * circumstances the move from cp0_context might produce a 1016 * circumstances the move from cp0_context might produce a
diff --git a/arch/mips/mti-sead3/sead3-i2c-drv.c b/arch/mips/mti-sead3/sead3-i2c-drv.c
index 0375ee66bca..7aa2225e75b 100644
--- a/arch/mips/mti-sead3/sead3-i2c-drv.c
+++ b/arch/mips/mti-sead3/sead3-i2c-drv.c
@@ -297,7 +297,7 @@ static void sead3_i2c_platform_setup(struct pic32_i2c_platform_data *priv)
297 priv->base + PIC32_I2CxSTATCLR); 297 priv->base + PIC32_I2CxSTATCLR);
298} 298}
299 299
300static int __devinit sead3_i2c_platform_probe(struct platform_device *pdev) 300static int sead3_i2c_platform_probe(struct platform_device *pdev)
301{ 301{
302 struct pic32_i2c_platform_data *priv; 302 struct pic32_i2c_platform_data *priv;
303 struct resource *r; 303 struct resource *r;
@@ -345,7 +345,7 @@ out:
345 return ret; 345 return ret;
346} 346}
347 347
348static int __devexit sead3_i2c_platform_remove(struct platform_device *pdev) 348static int sead3_i2c_platform_remove(struct platform_device *pdev)
349{ 349{
350 struct pic32_i2c_platform_data *priv = platform_get_drvdata(pdev); 350 struct pic32_i2c_platform_data *priv = platform_get_drvdata(pdev);
351 351
@@ -383,7 +383,7 @@ static struct platform_driver sead3_i2c_platform_driver = {
383 .owner = THIS_MODULE, 383 .owner = THIS_MODULE,
384 }, 384 },
385 .probe = sead3_i2c_platform_probe, 385 .probe = sead3_i2c_platform_probe,
386 .remove = __devexit_p(sead3_i2c_platform_remove), 386 .remove = sead3_i2c_platform_remove,
387 .suspend = sead3_i2c_platform_suspend, 387 .suspend = sead3_i2c_platform_suspend,
388 .resume = sead3_i2c_platform_resume, 388 .resume = sead3_i2c_platform_resume,
389}; 389};
diff --git a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
index 46509b0a620..514675ed0cd 100644
--- a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
+++ b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c
@@ -304,8 +304,7 @@ static void i2c_platform_disable(struct i2c_platform_data *priv)
304 pr_debug("i2c_platform_disable\n"); 304 pr_debug("i2c_platform_disable\n");
305} 305}
306 306
307static int __devinit 307static int i2c_platform_probe(struct platform_device *pdev)
308i2c_platform_probe(struct platform_device *pdev)
309{ 308{
310 struct i2c_platform_data *priv; 309 struct i2c_platform_data *priv;
311 struct resource *r; 310 struct resource *r;
@@ -362,8 +361,7 @@ out:
362 return ret; 361 return ret;
363} 362}
364 363
365static int __devexit 364static int i2c_platform_remove(struct platform_device *pdev)
366i2c_platform_remove(struct platform_device *pdev)
367{ 365{
368 struct i2c_platform_data *priv = platform_get_drvdata(pdev); 366 struct i2c_platform_data *priv = platform_get_drvdata(pdev);
369 367
@@ -408,7 +406,7 @@ static struct platform_driver i2c_platform_driver = {
408 .owner = THIS_MODULE, 406 .owner = THIS_MODULE,
409 }, 407 },
410 .probe = i2c_platform_probe, 408 .probe = i2c_platform_probe,
411 .remove = __devexit_p(i2c_platform_remove), 409 .remove = i2c_platform_remove,
412 .suspend = i2c_platform_suspend, 410 .suspend = i2c_platform_suspend,
413 .resume = i2c_platform_resume, 411 .resume = i2c_platform_resume,
414}; 412};
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 3e7ce65d776..9553b14002d 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -37,7 +37,7 @@
37#define VIA_COBALT_BRD_ID_REG 0x94 37#define VIA_COBALT_BRD_ID_REG 0x94
38#define VIA_COBALT_BRD_REG_to_ID(reg) ((unsigned char)(reg) >> 4) 38#define VIA_COBALT_BRD_REG_to_ID(reg) ((unsigned char)(reg) >> 4)
39 39
40static void __devinit qube_raq_galileo_early_fixup(struct pci_dev *dev) 40static void qube_raq_galileo_early_fixup(struct pci_dev *dev)
41{ 41{
42 if (dev->devfn == PCI_DEVFN(0, 0) && 42 if (dev->devfn == PCI_DEVFN(0, 0) &&
43 (dev->class >> 8) == PCI_CLASS_MEMORY_OTHER) { 43 (dev->class >> 8) == PCI_CLASS_MEMORY_OTHER) {
@@ -51,7 +51,7 @@ static void __devinit qube_raq_galileo_early_fixup(struct pci_dev *dev)
51DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111, 51DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,
52 qube_raq_galileo_early_fixup); 52 qube_raq_galileo_early_fixup);
53 53
54static void __devinit qube_raq_via_bmIDE_fixup(struct pci_dev *dev) 54static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev)
55{ 55{
56 unsigned short cfgword; 56 unsigned short cfgword;
57 unsigned char lt; 57 unsigned char lt;
@@ -74,7 +74,7 @@ static void __devinit qube_raq_via_bmIDE_fixup(struct pci_dev *dev)
74DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, 74DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1,
75 qube_raq_via_bmIDE_fixup); 75 qube_raq_via_bmIDE_fixup);
76 76
77static void __devinit qube_raq_galileo_fixup(struct pci_dev *dev) 77static void qube_raq_galileo_fixup(struct pci_dev *dev)
78{ 78{
79 if (dev->devfn != PCI_DEVFN(0, 0)) 79 if (dev->devfn != PCI_DEVFN(0, 0))
80 return; 80 return;
@@ -129,7 +129,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,
129 129
130int cobalt_board_id; 130int cobalt_board_id;
131 131
132static void __devinit qube_raq_via_board_id_fixup(struct pci_dev *dev) 132static void qube_raq_via_board_id_fixup(struct pci_dev *dev)
133{ 133{
134 u8 id; 134 u8 id;
135 int retval; 135 int retval;
diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c
index 0d9ccf4dfc5..beaec32b02e 100644
--- a/arch/mips/pci/fixup-emma2rh.c
+++ b/arch/mips/pci/fixup-emma2rh.c
@@ -52,7 +52,7 @@ static unsigned char irq_map[][5] __initdata = {
52 MARKEINS_PCI_IRQ_INTA, MARKEINS_PCI_IRQ_INTB,}, 52 MARKEINS_PCI_IRQ_INTA, MARKEINS_PCI_IRQ_INTB,},
53}; 53};
54 54
55static void __devinit nec_usb_controller_fixup(struct pci_dev *dev) 55static void nec_usb_controller_fixup(struct pci_dev *dev)
56{ 56{
57 if (PCI_SLOT(dev->devfn) == EMMA2RH_USB_SLOT) 57 if (PCI_SLOT(dev->devfn) == EMMA2RH_USB_SLOT)
58 /* on board USB controller configuration */ 58 /* on board USB controller configuration */
@@ -67,7 +67,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
67 * if it is the host bridge by marking it as such. These resources are of 67 * if it is the host bridge by marking it as such. These resources are of
68 * no consequence to the PCI layer (they are handled elsewhere). 68 * no consequence to the PCI layer (they are handled elsewhere).
69 */ 69 */
70static void __devinit emma2rh_pci_host_fixup(struct pci_dev *dev) 70static void emma2rh_pci_host_fixup(struct pci_dev *dev)
71{ 71{
72 int i; 72 int i;
73 73
diff --git a/arch/mips/pci/fixup-fuloong2e.c b/arch/mips/pci/fixup-fuloong2e.c
index 0857ab8c391..63ab4a042cd 100644
--- a/arch/mips/pci/fixup-fuloong2e.c
+++ b/arch/mips/pci/fixup-fuloong2e.c
@@ -48,7 +48,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
48 return 0; 48 return 0;
49} 49}
50 50
51static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev) 51static void loongson2e_nec_fixup(struct pci_dev *pdev)
52{ 52{
53 unsigned int val; 53 unsigned int val;
54 54
@@ -60,7 +60,7 @@ static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev)
60 pci_write_config_dword(pdev, 0xe4, 1 << 5); 60 pci_write_config_dword(pdev, 0xe4, 1 << 5);
61} 61}
62 62
63static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev) 63static void loongson2e_686b_func0_fixup(struct pci_dev *pdev)
64{ 64{
65 unsigned char c; 65 unsigned char c;
66 66
@@ -135,7 +135,7 @@ static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev)
135 printk(KERN_INFO"via686b fix: ISA bridge done\n"); 135 printk(KERN_INFO"via686b fix: ISA bridge done\n");
136} 136}
137 137
138static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev) 138static void loongson2e_686b_func1_fixup(struct pci_dev *pdev)
139{ 139{
140 printk(KERN_INFO"via686b fix: IDE\n"); 140 printk(KERN_INFO"via686b fix: IDE\n");
141 141
@@ -168,19 +168,19 @@ static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev)
168 printk(KERN_INFO"via686b fix: IDE done\n"); 168 printk(KERN_INFO"via686b fix: IDE done\n");
169} 169}
170 170
171static void __devinit loongson2e_686b_func2_fixup(struct pci_dev *pdev) 171static void loongson2e_686b_func2_fixup(struct pci_dev *pdev)
172{ 172{
173 /* irq routing */ 173 /* irq routing */
174 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10); 174 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10);
175} 175}
176 176
177static void __devinit loongson2e_686b_func3_fixup(struct pci_dev *pdev) 177static void loongson2e_686b_func3_fixup(struct pci_dev *pdev)
178{ 178{
179 /* irq routing */ 179 /* irq routing */
180 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11); 180 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11);
181} 181}
182 182
183static void __devinit loongson2e_686b_func5_fixup(struct pci_dev *pdev) 183static void loongson2e_686b_func5_fixup(struct pci_dev *pdev)
184{ 184{
185 unsigned int val; 185 unsigned int val;
186 unsigned char c; 186 unsigned char c;
diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c
index a7b917dcf60..519daaebb5d 100644
--- a/arch/mips/pci/fixup-lemote2f.c
+++ b/arch/mips/pci/fixup-lemote2f.c
@@ -96,21 +96,21 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
96} 96}
97 97
98/* CS5536 SPEC. fixup */ 98/* CS5536 SPEC. fixup */
99static void __devinit loongson_cs5536_isa_fixup(struct pci_dev *pdev) 99static void loongson_cs5536_isa_fixup(struct pci_dev *pdev)
100{ 100{
101 /* the uart1 and uart2 interrupt in PIC is enabled as default */ 101 /* the uart1 and uart2 interrupt in PIC is enabled as default */
102 pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1); 102 pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1);
103 pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1); 103 pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1);
104} 104}
105 105
106static void __devinit loongson_cs5536_ide_fixup(struct pci_dev *pdev) 106static void loongson_cs5536_ide_fixup(struct pci_dev *pdev)
107{ 107{
108 /* setting the mutex pin as IDE function */ 108 /* setting the mutex pin as IDE function */
109 pci_write_config_dword(pdev, PCI_IDE_CFG_REG, 109 pci_write_config_dword(pdev, PCI_IDE_CFG_REG,
110 CS5536_IDE_FLASH_SIGNATURE); 110 CS5536_IDE_FLASH_SIGNATURE);
111} 111}
112 112
113static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev) 113static void loongson_cs5536_acc_fixup(struct pci_dev *pdev)
114{ 114{
115 /* enable the AUDIO interrupt in PIC */ 115 /* enable the AUDIO interrupt in PIC */
116 pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1); 116 pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1);
@@ -118,14 +118,14 @@ static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev)
118 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0); 118 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);
119} 119}
120 120
121static void __devinit loongson_cs5536_ohci_fixup(struct pci_dev *pdev) 121static void loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
122{ 122{
123 /* enable the OHCI interrupt in PIC */ 123 /* enable the OHCI interrupt in PIC */
124 /* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */ 124 /* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */
125 pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1); 125 pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1);
126} 126}
127 127
128static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev) 128static void loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
129{ 129{
130 u32 hi, lo; 130 u32 hi, lo;
131 131
@@ -137,7 +137,7 @@ static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
137 pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000); 137 pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);
138} 138}
139 139
140static void __devinit loongson_nec_fixup(struct pci_dev *pdev) 140static void loongson_nec_fixup(struct pci_dev *pdev)
141{ 141{
142 unsigned int val; 142 unsigned int val;
143 143
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index 9a1a2244522..75d03f6be3b 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -8,7 +8,7 @@
8#define PCID 4 8#define PCID 4
9 9
10/* This table is filled in by interrogating the PIIX4 chip */ 10/* This table is filled in by interrogating the PIIX4 chip */
11static char pci_irq[5] __devinitdata = { 11static char pci_irq[5] = {
12}; 12};
13 13
14static char irq_tab[][5] __initdata = { 14static char irq_tab[][5] __initdata = {
@@ -50,10 +50,10 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
50 return 0; 50 return 0;
51} 51}
52 52
53static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev) 53static void malta_piix_func0_fixup(struct pci_dev *pdev)
54{ 54{
55 unsigned char reg_val; 55 unsigned char reg_val;
56 static int piixirqmap[16] __devinitdata = { /* PIIX PIRQC[A:D] irq mappings */ 56 static int piixirqmap[16] = { /* PIIX PIRQC[A:D] irq mappings */
57 0, 0, 0, 3, 57 0, 0, 0, 3,
58 4, 5, 6, 7, 58 4, 5, 6, 7,
59 0, 9, 10, 11, 59 0, 9, 10, 11,
@@ -84,7 +84,7 @@ static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev)
84DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0, 84DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
85 malta_piix_func0_fixup); 85 malta_piix_func0_fixup);
86 86
87static void __devinit malta_piix_func1_fixup(struct pci_dev *pdev) 87static void malta_piix_func1_fixup(struct pci_dev *pdev)
88{ 88{
89 unsigned char reg_val; 89 unsigned char reg_val;
90 90
@@ -104,7 +104,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB,
104 malta_piix_func1_fixup); 104 malta_piix_func1_fixup);
105 105
106/* Enable PCI 2.1 compatibility in PIIX4 */ 106/* Enable PCI 2.1 compatibility in PIIX4 */
107static void __devinit quirk_dlcsetup(struct pci_dev *dev) 107static void quirk_dlcsetup(struct pci_dev *dev)
108{ 108{
109 u8 odlc, ndlc; 109 u8 odlc, ndlc;
110 110
diff --git a/arch/mips/pci/fixup-rc32434.c b/arch/mips/pci/fixup-rc32434.c
index 76bb1be99d4..d0f6ecbf35f 100644
--- a/arch/mips/pci/fixup-rc32434.c
+++ b/arch/mips/pci/fixup-rc32434.c
@@ -32,12 +32,12 @@
32#include <asm/mach-rc32434/rc32434.h> 32#include <asm/mach-rc32434/rc32434.h>
33#include <asm/mach-rc32434/irq.h> 33#include <asm/mach-rc32434/irq.h>
34 34
35static int __devinitdata irq_map[2][12] = { 35static int irq_map[2][12] = {
36 {0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1}, 36 {0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1},
37 {0, 0, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3} 37 {0, 0, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3}
38}; 38};
39 39
40int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 40int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
41{ 41{
42 int irq = 0; 42 int irq = 0;
43 43
@@ -47,7 +47,7 @@ int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
47 return irq + GROUP4_IRQ_BASE + 4; 47 return irq + GROUP4_IRQ_BASE + 4;
48} 48}
49 49
50static void __devinit rc32434_pci_early_fixup(struct pci_dev *dev) 50static void rc32434_pci_early_fixup(struct pci_dev *dev)
51{ 51{
52 if (PCI_SLOT(dev->devfn) == 6 && dev->bus->number == 0) { 52 if (PCI_SLOT(dev->devfn) == 6 && dev->bus->number == 0) {
53 /* disable prefetched memory range */ 53 /* disable prefetched memory range */
diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c
index d02900a7291..1441becdcb6 100644
--- a/arch/mips/pci/fixup-sb1250.c
+++ b/arch/mips/pci/fixup-sb1250.c
@@ -15,7 +15,7 @@
15 * Set the BCM1250, etc. PCI host bridge's TRDY timeout 15 * Set the BCM1250, etc. PCI host bridge's TRDY timeout
16 * to the finite max. 16 * to the finite max.
17 */ 17 */
18static void __devinit quirk_sb1250_pci(struct pci_dev *dev) 18static void quirk_sb1250_pci(struct pci_dev *dev)
19{ 19{
20 pci_write_config_byte(dev, 0x40, 0xff); 20 pci_write_config_byte(dev, 0x40, 0xff);
21} 21}
@@ -25,7 +25,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_PCI,
25/* 25/*
26 * The BCM1250, etc. PCI/HT bridge reports as a host bridge. 26 * The BCM1250, etc. PCI/HT bridge reports as a host bridge.
27 */ 27 */
28static void __devinit quirk_sb1250_ht(struct pci_dev *dev) 28static void quirk_sb1250_ht(struct pci_dev *dev)
29{ 29{
30 dev->class = PCI_CLASS_BRIDGE_PCI << 8; 30 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
31} 31}
@@ -35,7 +35,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_HT,
35/* 35/*
36 * Set the SP1011 HT/PCI bridge's TRDY timeout to the finite max. 36 * Set the SP1011 HT/PCI bridge's TRDY timeout to the finite max.
37 */ 37 */
38static void __devinit quirk_sp1011(struct pci_dev *dev) 38static void quirk_sp1011(struct pci_dev *dev)
39{ 39{
40 pci_write_config_byte(dev, 0x64, 0xff); 40 pci_write_config_byte(dev, 0x64, 0xff);
41} 41}
diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c
index 65c7bd10048..4a156629e95 100644
--- a/arch/mips/pci/ops-bcm63xx.c
+++ b/arch/mips/pci/ops-bcm63xx.c
@@ -411,7 +411,7 @@ struct pci_ops bcm63xx_cb_ops = {
411 * only one IO window, so it cannot be shared by PCI and cardbus, use 411 * only one IO window, so it cannot be shared by PCI and cardbus, use
412 * fixup to choose and detect unhandled configuration 412 * fixup to choose and detect unhandled configuration
413 */ 413 */
414static void __devinit bcm63xx_fixup(struct pci_dev *dev) 414static void bcm63xx_fixup(struct pci_dev *dev)
415{ 415{
416 static int io_window = -1; 416 static int io_window = -1;
417 int i, found, new_io_window; 417 int i, found, new_io_window;
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
index bc13e29d2bb..0d69d6f4ea4 100644
--- a/arch/mips/pci/ops-tx4927.c
+++ b/arch/mips/pci/ops-tx4927.c
@@ -191,13 +191,13 @@ static struct {
191 u8 trdyto; 191 u8 trdyto;
192 u8 retryto; 192 u8 retryto;
193 u16 gbwc; 193 u16 gbwc;
194} tx4927_pci_opts __devinitdata = { 194} tx4927_pci_opts = {
195 .trdyto = 0, 195 .trdyto = 0,
196 .retryto = 0, 196 .retryto = 0,
197 .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */ 197 .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */
198}; 198};
199 199
200char *__devinit tx4927_pcibios_setup(char *str) 200char *tx4927_pcibios_setup(char *str)
201{ 201{
202 unsigned long val; 202 unsigned long val;
203 203
@@ -495,7 +495,7 @@ irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)
495} 495}
496 496
497#ifdef CONFIG_TOSHIBA_FPCIB0 497#ifdef CONFIG_TOSHIBA_FPCIB0
498static void __devinit tx4927_quirk_slc90e66_bridge(struct pci_dev *dev) 498static void tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
499{ 499{
500 struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus); 500 struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus);
501 501
diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c
index ec125bed721..c4ea6cc55f9 100644
--- a/arch/mips/pci/pci-alchemy.c
+++ b/arch/mips/pci/pci-alchemy.c
@@ -356,7 +356,7 @@ static struct syscore_ops alchemy_pci_pmops = {
356 .resume = alchemy_pci_resume, 356 .resume = alchemy_pci_resume,
357}; 357};
358 358
359static int __devinit alchemy_pci_probe(struct platform_device *pdev) 359static int alchemy_pci_probe(struct platform_device *pdev)
360{ 360{
361 struct alchemy_pci_platdata *pd = pdev->dev.platform_data; 361 struct alchemy_pci_platdata *pd = pdev->dev.platform_data;
362 struct alchemy_pci_context *ctx; 362 struct alchemy_pci_context *ctx;
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index fdc24440294..7f4f49b09b5 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -143,7 +143,7 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
143 * A given PCI device, in general, should be able to intr any of the cpus 143 * A given PCI device, in general, should be able to intr any of the cpus
144 * on any one of the hubs connected to its xbow. 144 * on any one of the hubs connected to its xbow.
145 */ 145 */
146int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 146int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
147{ 147{
148 return 0; 148 return 0;
149} 149}
@@ -212,7 +212,7 @@ static inline void pci_enable_swapping(struct pci_dev *dev)
212 bridge->b_widget.w_tflush; /* Flush */ 212 bridge->b_widget.w_tflush; /* Flush */
213} 213}
214 214
215static void __devinit pci_fixup_ioc3(struct pci_dev *d) 215static void pci_fixup_ioc3(struct pci_dev *d)
216{ 216{
217 pci_disable_swapping(d); 217 pci_disable_swapping(d);
218} 218}
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
index 075d87acd12..95681789b51 100644
--- a/arch/mips/pci/pci-lantiq.c
+++ b/arch/mips/pci/pci-lantiq.c
@@ -95,7 +95,7 @@ static inline u32 ltq_calc_bar11mask(void)
95 return bar11mask; 95 return bar11mask;
96} 96}
97 97
98static int __devinit ltq_pci_startup(struct platform_device *pdev) 98static int ltq_pci_startup(struct platform_device *pdev)
99{ 99{
100 struct device_node *node = pdev->dev.of_node; 100 struct device_node *node = pdev->dev.of_node;
101 const __be32 *req_mask, *bus_clk; 101 const __be32 *req_mask, *bus_clk;
@@ -201,7 +201,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)
201 return 0; 201 return 0;
202} 202}
203 203
204static int __devinit ltq_pci_probe(struct platform_device *pdev) 204static int ltq_pci_probe(struct platform_device *pdev)
205{ 205{
206 struct resource *res_cfg, *res_bridge; 206 struct resource *res_cfg, *res_bridge;
207 207
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 4040416e060..a1843448fad 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -76,7 +76,7 @@ pcibios_align_resource(void *data, const struct resource *res,
76 return start; 76 return start;
77} 77}
78 78
79static void __devinit pcibios_scanbus(struct pci_controller *hose) 79static void pcibios_scanbus(struct pci_controller *hose)
80{ 80{
81 static int next_busno; 81 static int next_busno;
82 static int need_domain_info; 82 static int need_domain_info;
@@ -120,8 +120,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
120} 120}
121 121
122#ifdef CONFIG_OF 122#ifdef CONFIG_OF
123void __devinit pci_load_of_ranges(struct pci_controller *hose, 123void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node)
124 struct device_node *node)
125{ 124{
126 const __be32 *ranges; 125 const __be32 *ranges;
127 int rlen; 126 int rlen;
@@ -174,7 +173,7 @@ void __devinit pci_load_of_ranges(struct pci_controller *hose,
174 173
175static DEFINE_MUTEX(pci_scan_mutex); 174static DEFINE_MUTEX(pci_scan_mutex);
176 175
177void __devinit register_pci_controller(struct pci_controller *hose) 176void register_pci_controller(struct pci_controller *hose)
178{ 177{
179 if (request_resource(&iomem_resource, hose->mem_resource) < 0) 178 if (request_resource(&iomem_resource, hose->mem_resource) < 0)
180 goto out; 179 goto out;
@@ -303,7 +302,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
303 return pcibios_plat_dev_init(dev); 302 return pcibios_plat_dev_init(dev);
304} 303}
305 304
306void __devinit pcibios_fixup_bus(struct pci_bus *bus) 305void pcibios_fixup_bus(struct pci_bus *bus)
307{ 306{
308 struct pci_dev *dev = bus->self; 307 struct pci_dev *dev = bus->self;
309 308
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
index f8a751c0328..61e2558a2dc 100644
--- a/arch/mips/power/hibernate.S
+++ b/arch/mips/power/hibernate.S
@@ -8,7 +8,6 @@
8 * Wu Zhangjin <wuzhangjin@gmail.com> 8 * Wu Zhangjin <wuzhangjin@gmail.com>
9 */ 9 */
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/page.h>
12#include <asm/regdef.h> 11#include <asm/regdef.h>
13#include <asm/asm.h> 12#include <asm/asm.h>
14 13
@@ -35,7 +34,7 @@ LEAF(swsusp_arch_resume)
350: 340:
36 PTR_L t1, PBE_ADDRESS(t0) /* source */ 35 PTR_L t1, PBE_ADDRESS(t0) /* source */
37 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */ 36 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */
38 PTR_ADDU t3, t1, PAGE_SIZE 37 PTR_ADDU t3, t1, _PAGE_SIZE
391: 381:
40 REG_L t8, (t1) 39 REG_L t8, (t1)
41 REG_S t8, (t2) 40 REG_S t8, (t2)
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index d6c7bd4b5ab..2e9c283b8e6 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -236,7 +236,7 @@ void __init plat_mem_setup(void)
236#include <video/vga.h> 236#include <video/vga.h>
237#include <video/cirrus.h> 237#include <video/cirrus.h>
238 238
239static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev) 239static void quirk_cirrus_ram_size(struct pci_dev *dev)
240{ 240{
241 u16 cmd; 241 u16 cmd;
242 242
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index b14ee53581a..ce8f8b9b930 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -256,8 +256,7 @@ static irqreturn_t i8259_interrupt(int irq, void *dev_id)
256 return IRQ_HANDLED; 256 return IRQ_HANDLED;
257} 257}
258 258
259static int __devinit 259static int txx9_i8259_irq_setup(int irq)
260txx9_i8259_irq_setup(int irq)
261{ 260{
262 int err; 261 int err;
263 262
@@ -269,7 +268,7 @@ txx9_i8259_irq_setup(int irq)
269 return err; 268 return err;
270} 269}
271 270
272static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev) 271static void quirk_slc90e66_bridge(struct pci_dev *dev)
273{ 272{
274 int irq; /* PCI/ISA Bridge interrupt */ 273 int irq; /* PCI/ISA Bridge interrupt */
275 u8 reg_64; 274 u8 reg_64;
@@ -304,7 +303,7 @@ static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev)
304 smsc_fdc37m81x_config_end(); 303 smsc_fdc37m81x_config_end();
305} 304}
306 305
307static void __devinit quirk_slc90e66_ide(struct pci_dev *dev) 306static void quirk_slc90e66_ide(struct pci_dev *dev)
308{ 307{
309 unsigned char dat; 308 unsigned char dat;
310 int regs[2] = {0x41, 0x43}; 309 int regs[2] = {0x41, 0x43};
@@ -339,7 +338,7 @@ static void __devinit quirk_slc90e66_ide(struct pci_dev *dev)
339} 338}
340#endif /* CONFIG_TOSHIBA_FPCIB0 */ 339#endif /* CONFIG_TOSHIBA_FPCIB0 */
341 340
342static void __devinit tc35815_fixup(struct pci_dev *dev) 341static void tc35815_fixup(struct pci_dev *dev)
343{ 342{
344 /* This device may have PM registers but not they are not supported. */ 343 /* This device may have PM registers but not they are not supported. */
345 if (dev->pm_cap) { 344 if (dev->pm_cap) {
@@ -348,7 +347,7 @@ static void __devinit tc35815_fixup(struct pci_dev *dev)
348 } 347 }
349} 348}
350 349
351static void __devinit final_fixup(struct pci_dev *dev) 350static void final_fixup(struct pci_dev *dev)
352{ 351{
353 unsigned char bist; 352 unsigned char bist;
354 353
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index aa03f2e1338..e70001cfa05 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -6,6 +6,7 @@ config MN10300
6 select ARCH_WANT_IPC_PARSE_VERSION 6 select ARCH_WANT_IPC_PARSE_VERSION
7 select HAVE_ARCH_TRACEHOOK 7 select HAVE_ARCH_TRACEHOOK
8 select HAVE_ARCH_KGDB 8 select HAVE_ARCH_KGDB
9 select GENERIC_ATOMIC64
9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 10 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
10 select GENERIC_CLOCKEVENTS 11 select GENERIC_CLOCKEVENTS
11 select MODULES_USE_ELF_RELA 12 select MODULES_USE_ELF_RELA
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index 95983cd21e7..5d7e152a23b 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -905,7 +905,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
905 * Set up the cpu_online_mask, cpu_callout_map and cpu_callin_map of the boot 905 * Set up the cpu_online_mask, cpu_callout_map and cpu_callin_map of the boot
906 * processor (CPU 0). 906 * processor (CPU 0).
907 */ 907 */
908void __devinit smp_prepare_boot_cpu(void) 908void smp_prepare_boot_cpu(void)
909{ 909{
910 cpumask_set_cpu(0, &cpu_callout_map); 910 cpumask_set_cpu(0, &cpu_callout_map);
911 cpumask_set_cpu(0, &cpu_callin_map); 911 cpumask_set_cpu(0, &cpu_callin_map);
@@ -930,7 +930,7 @@ void initialize_secondary(void)
930 * __cpu_up - Set smp_commenced_mask for the nominated CPU 930 * __cpu_up - Set smp_commenced_mask for the nominated CPU
931 * @cpu: The target CPU. 931 * @cpu: The target CPU.
932 */ 932 */
933int __devinit __cpu_up(unsigned int cpu, struct task_struct *tidle) 933int __cpu_up(unsigned int cpu, struct task_struct *tidle)
934{ 934{
935 int timeout; 935 int timeout;
936 936
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c
index e2059486d3f..6911e845b8c 100644
--- a/arch/mn10300/unit-asb2305/pci.c
+++ b/arch/mn10300/unit-asb2305/pci.c
@@ -282,7 +282,7 @@ static int __init pci_check_direct(void)
282 return -ENODEV; 282 return -ENODEV;
283} 283}
284 284
285static int __devinit is_valid_resource(struct pci_dev *dev, int idx) 285static int is_valid_resource(struct pci_dev *dev, int idx)
286{ 286{
287 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; 287 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
288 struct resource *devr = &dev->resource[idx], *busr; 288 struct resource *devr = &dev->resource[idx], *busr;
@@ -302,7 +302,7 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
302 return 0; 302 return 0;
303} 303}
304 304
305static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 305static void pcibios_fixup_device_resources(struct pci_dev *dev)
306{ 306{
307 int limit, i; 307 int limit, i;
308 308
@@ -325,7 +325,7 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
325 * Called after each bus is probed, but before its children 325 * Called after each bus is probed, but before its children
326 * are examined. 326 * are examined.
327 */ 327 */
328void __devinit pcibios_fixup_bus(struct pci_bus *bus) 328void pcibios_fixup_bus(struct pci_bus *bus)
329{ 329{
330 struct pci_dev *dev; 330 struct pci_dev *dev;
331 331
diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c
index c330767c921..c82b09f4a10 100644
--- a/arch/openrisc/lib/delay.c
+++ b/arch/openrisc/lib/delay.c
@@ -22,7 +22,7 @@
22#include <asm/timex.h> 22#include <asm/timex.h>
23#include <asm/processor.h> 23#include <asm/processor.h>
24 24
25int __devinit read_current_timer(unsigned long *timer_value) 25int read_current_timer(unsigned long *timer_value)
26{ 26{
27 *timer_value = mfspr(SPR_TTCR); 27 *timer_value = mfspr(SPR_TTCR);
28 return 0; 28 return 0;
diff --git a/arch/parisc/include/asm/parport.h b/arch/parisc/include/asm/parport.h
index 00d9cc3e7b9..c391d7cbc22 100644
--- a/arch/parisc/include/asm/parport.h
+++ b/arch/parisc/include/asm/parport.h
@@ -8,7 +8,7 @@
8#define _ASM_PARPORT_H 1 8#define _ASM_PARPORT_H 1
9 9
10 10
11static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 11static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
12{ 12{
13 /* nothing ! */ 13 /* nothing ! */
14 return 0; 14 return 0;
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index f48a640b55f..f7752f6af29 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
@@ -38,7 +38,7 @@
38 * so don't reference this table after starting the init process 38 * so don't reference this table after starting the init process
39 */ 39 */
40 40
41static struct hp_hardware hp_hardware_list[] __devinitdata = { 41static struct hp_hardware hp_hardware_list[] = {
42 {HPHW_NPROC,0x01,0x4,0x0,"Indigo (840, 930)"}, 42 {HPHW_NPROC,0x01,0x4,0x0,"Indigo (840, 930)"},
43 {HPHW_NPROC,0x8,0x4,0x01,"Firefox(825,925)"}, 43 {HPHW_NPROC,0x8,0x4,0x01,"Firefox(825,925)"},
44 {HPHW_NPROC,0xA,0x4,0x01,"Top Gun (835,834,935,635)"}, 44 {HPHW_NPROC,0xA,0x4,0x01,"Top Gun (835,834,935,635)"},
@@ -1230,7 +1230,7 @@ static struct hp_cpu_type_mask {
1230 unsigned short model; 1230 unsigned short model;
1231 unsigned short mask; 1231 unsigned short mask;
1232 enum cpu_type cpu; 1232 enum cpu_type cpu;
1233} hp_cpu_type_mask_list[] __devinitdata = { 1233} hp_cpu_type_mask_list[] = {
1234 1234
1235 { 0x0000, 0x0ff0, pcx }, /* 0x0000 - 0x000f */ 1235 { 0x0000, 0x0ff0, pcx }, /* 0x0000 - 0x000f */
1236 { 0x0048, 0x0ff0, pcxl }, /* 0x0040 - 0x004f */ 1236 { 0x0048, 0x0ff0, pcxl }, /* 0x0040 - 0x004f */
@@ -1327,8 +1327,7 @@ const char * const cpu_name_version[][2] = {
1327 [mako2] = { "PA8900 (Shortfin)", "2.0" } 1327 [mako2] = { "PA8900 (Shortfin)", "2.0" }
1328}; 1328};
1329 1329
1330const char * __devinit 1330const char *parisc_hardware_description(struct parisc_device_id *id)
1331parisc_hardware_description(struct parisc_device_id *id)
1332{ 1331{
1333 struct hp_hardware *listptr; 1332 struct hp_hardware *listptr;
1334 1333
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index b0ef73882b3..a8fb03e2277 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -183,7 +183,7 @@ static inline void eeh_unlock(void)
183#define EEH_MAX_ALLOWED_FREEZES 5 183#define EEH_MAX_ALLOWED_FREEZES 5
184 184
185typedef void *(*eeh_traverse_func)(void *data, void *flag); 185typedef void *(*eeh_traverse_func)(void *data, void *flag);
186int __devinit eeh_phb_pe_create(struct pci_controller *phb); 186int eeh_phb_pe_create(struct pci_controller *phb);
187int eeh_add_to_parent_pe(struct eeh_dev *edev); 187int eeh_add_to_parent_pe(struct eeh_dev *edev);
188int eeh_rmv_from_parent_pe(struct eeh_dev *edev, int purge_pe); 188int eeh_rmv_from_parent_pe(struct eeh_dev *edev, int purge_pe);
189void *eeh_pe_dev_traverse(struct eeh_pe *root, 189void *eeh_pe_dev_traverse(struct eeh_pe *root,
@@ -191,8 +191,8 @@ void *eeh_pe_dev_traverse(struct eeh_pe *root,
191void eeh_pe_restore_bars(struct eeh_pe *pe); 191void eeh_pe_restore_bars(struct eeh_pe *pe);
192struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe); 192struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe);
193 193
194void * __devinit eeh_dev_init(struct device_node *dn, void *data); 194void *eeh_dev_init(struct device_node *dn, void *data);
195void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb); 195void eeh_dev_phb_init_dynamic(struct pci_controller *phb);
196int __init eeh_ops_register(struct eeh_ops *ops); 196int __init eeh_ops_register(struct eeh_ops *ops);
197int __exit eeh_ops_unregister(const char *name); 197int __exit eeh_ops_unregister(const char *name);
198unsigned long eeh_check_failure(const volatile void __iomem *token, 198unsigned long eeh_check_failure(const volatile void __iomem *token,
diff --git a/arch/powerpc/include/asm/io-workarounds.h b/arch/powerpc/include/asm/io-workarounds.h
index fbae4928692..f96dd096ff4 100644
--- a/arch/powerpc/include/asm/io-workarounds.h
+++ b/arch/powerpc/include/asm/io-workarounds.h
@@ -31,8 +31,8 @@ struct iowa_bus {
31 void *private; 31 void *private;
32}; 32};
33 33
34void __devinit iowa_register_bus(struct pci_controller *, struct ppc_pci_io *, 34void iowa_register_bus(struct pci_controller *, struct ppc_pci_io *,
35 int (*)(struct iowa_bus *, void *), void *); 35 int (*)(struct iowa_bus *, void *), void *);
36struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR); 36struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR);
37struct iowa_bus *iowa_pio_find_bus(unsigned long); 37struct iowa_bus *iowa_pio_find_bus(unsigned long);
38 38
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h
index 1ca1102b4a2..6dc2577932b 100644
--- a/arch/powerpc/include/asm/parport.h
+++ b/arch/powerpc/include/asm/parport.h
@@ -12,7 +12,7 @@
12 12
13#include <asm/prom.h> 13#include <asm/prom.h>
14 14
15static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 15static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
16{ 16{
17 struct device_node *np; 17 struct device_node *np;
18 const u32 *prop; 18 const u32 *prop;
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 5a4e437c238..195ce2ac569 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -54,8 +54,8 @@ struct smp_ops_t {
54 54
55extern void smp_send_debugger_break(void); 55extern void smp_send_debugger_break(void);
56extern void start_secondary_resume(void); 56extern void start_secondary_resume(void);
57extern void __devinit smp_generic_give_timebase(void); 57extern void smp_generic_give_timebase(void);
58extern void __devinit smp_generic_take_timebase(void); 58extern void smp_generic_take_timebase(void);
59 59
60DECLARE_PER_CPU(unsigned int, cpu_pvr); 60DECLARE_PER_CPU(unsigned int, cpu_pvr);
61 61
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h
index df81cb72d1e..68d0cc998b1 100644
--- a/arch/powerpc/include/asm/vio.h
+++ b/arch/powerpc/include/asm/vio.h
@@ -139,7 +139,7 @@ extern void vio_unregister_driver(struct vio_driver *drv);
139extern int vio_cmo_entitlement_update(size_t); 139extern int vio_cmo_entitlement_update(size_t);
140extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired); 140extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired);
141 141
142extern void __devinit vio_unregister_device(struct vio_dev *dev); 142extern void vio_unregister_device(struct vio_dev *dev);
143 143
144extern int vio_h_cop_sync(struct vio_dev *vdev, struct vio_pfo_op *op); 144extern int vio_h_cop_sync(struct vio_dev *vdev, struct vio_pfo_op *op);
145 145
diff --git a/arch/powerpc/include/uapi/asm/kvm_para.h b/arch/powerpc/include/uapi/asm/kvm_para.h
index ed0e0254b47..e3af3286a06 100644
--- a/arch/powerpc/include/uapi/asm/kvm_para.h
+++ b/arch/powerpc/include/uapi/asm/kvm_para.h
@@ -78,7 +78,7 @@ struct kvm_vcpu_arch_shared {
78 78
79#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num) 79#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)
80 80
81#include <uapi/asm/epapr_hcalls.h> 81#include <asm/epapr_hcalls.h>
82 82
83#define KVM_FEATURE_MAGIC_PAGE 1 83#define KVM_FEATURE_MAGIC_PAGE 1
84 84
diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c
index 12d329bcbb9..50e90b7e713 100644
--- a/arch/powerpc/kernel/io-workarounds.c
+++ b/arch/powerpc/kernel/io-workarounds.c
@@ -118,7 +118,7 @@ static void iowa_##name at \
118#undef DEF_PCI_AC_RET 118#undef DEF_PCI_AC_RET
119#undef DEF_PCI_AC_NORET 119#undef DEF_PCI_AC_NORET
120 120
121static const struct ppc_pci_io __devinitconst iowa_pci_io = { 121static const struct ppc_pci_io iowa_pci_io = {
122 122
123#define DEF_PCI_AC_RET(name, ret, at, al, space, aa) .name = iowa_##name, 123#define DEF_PCI_AC_RET(name, ret, at, al, space, aa) .name = iowa_##name,
124#define DEF_PCI_AC_NORET(name, at, al, space, aa) .name = iowa_##name, 124#define DEF_PCI_AC_NORET(name, at, al, space, aa) .name = iowa_##name,
@@ -146,7 +146,7 @@ static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
146} 146}
147 147
148/* Enable IO workaround */ 148/* Enable IO workaround */
149static void __devinit io_workaround_init(void) 149static void io_workaround_init(void)
150{ 150{
151 static int io_workaround_inited; 151 static int io_workaround_inited;
152 152
@@ -158,9 +158,8 @@ static void __devinit io_workaround_init(void)
158} 158}
159 159
160/* Register new bus to support workaround */ 160/* Register new bus to support workaround */
161void __devinit iowa_register_bus(struct pci_controller *phb, 161void iowa_register_bus(struct pci_controller *phb, struct ppc_pci_io *ops,
162 struct ppc_pci_io *ops, 162 int (*initfunc)(struct iowa_bus *, void *), void *data)
163 int (*initfunc)(struct iowa_bus *, void *), void *data)
164{ 163{
165 struct iowa_bus *bus; 164 struct iowa_bus *bus;
166 struct device_node *np = phb->dn; 165 struct device_node *np = phb->dn;
diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c
index d45ec58703c..0f199709796 100644
--- a/arch/powerpc/kernel/isa-bridge.c
+++ b/arch/powerpc/kernel/isa-bridge.c
@@ -41,8 +41,8 @@ EXPORT_SYMBOL_GPL(isa_bridge_pcidev);
41#define ISA_SPACE_MASK 0x1 41#define ISA_SPACE_MASK 0x1
42#define ISA_SPACE_IO 0x1 42#define ISA_SPACE_IO 0x1
43 43
44static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, 44static void pci_process_ISA_OF_ranges(struct device_node *isa_node,
45 unsigned long phb_io_base_phys) 45 unsigned long phb_io_base_phys)
46{ 46{
47 /* We should get some saner parsing here and remove these structs */ 47 /* We should get some saner parsing here and remove these structs */
48 struct pci_address { 48 struct pci_address {
@@ -170,8 +170,8 @@ void __init isa_bridge_find_early(struct pci_controller *hose)
170 * isa_bridge_find_late - Find and map the ISA IO space upon discovery of 170 * isa_bridge_find_late - Find and map the ISA IO space upon discovery of
171 * a new ISA bridge 171 * a new ISA bridge
172 */ 172 */
173static void __devinit isa_bridge_find_late(struct pci_dev *pdev, 173static void isa_bridge_find_late(struct pci_dev *pdev,
174 struct device_node *devnode) 174 struct device_node *devnode)
175{ 175{
176 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 176 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
177 177
@@ -215,8 +215,8 @@ static void isa_bridge_remove(void)
215/** 215/**
216 * isa_bridge_notify - Get notified of PCI devices addition/removal 216 * isa_bridge_notify - Get notified of PCI devices addition/removal
217 */ 217 */
218static int __devinit isa_bridge_notify(struct notifier_block *nb, 218static int isa_bridge_notify(struct notifier_block *nb, unsigned long action,
219 unsigned long action, void *data) 219 void *data)
220{ 220{
221 struct device *dev = data; 221 struct device *dev = data;
222 struct pci_dev *pdev = to_pci_dev(dev); 222 struct pci_dev *pdev = to_pci_dev(dev);
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 9db8ec07ec9..07c12697d70 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -37,7 +37,7 @@
37 * lacking some bits needed here. 37 * lacking some bits needed here.
38 */ 38 */
39 39
40static int __devinit of_pci_phb_probe(struct platform_device *dev) 40static int of_pci_phb_probe(struct platform_device *dev)
41{ 41{
42 struct pci_controller *phb; 42 struct pci_controller *phb;
43 43
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index abc0d085699..7c37379ea9b 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -673,9 +673,8 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
673 * - Some 32 bits platforms such as 4xx can have physical space larger than 673 * - Some 32 bits platforms such as 4xx can have physical space larger than
674 * 32 bits so we need to use 64 bits values for the parsing 674 * 32 bits so we need to use 64 bits values for the parsing
675 */ 675 */
676void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, 676void pci_process_bridge_OF_ranges(struct pci_controller *hose,
677 struct device_node *dev, 677 struct device_node *dev, int primary)
678 int primary)
679{ 678{
680 const u32 *ranges; 679 const u32 *ranges;
681 int rlen; 680 int rlen;
@@ -848,7 +847,7 @@ int pci_proc_domain(struct pci_bus *bus)
848/* This header fixup will do the resource fixup for all devices as they are 847/* This header fixup will do the resource fixup for all devices as they are
849 * probed, but not for bridge ranges 848 * probed, but not for bridge ranges
850 */ 849 */
851static void __devinit pcibios_fixup_resources(struct pci_dev *dev) 850static void pcibios_fixup_resources(struct pci_dev *dev)
852{ 851{
853 struct pci_controller *hose = pci_bus_to_host(dev->bus); 852 struct pci_controller *hose = pci_bus_to_host(dev->bus);
854 int i; 853 int i;
@@ -902,8 +901,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
902 * things go more smoothly when it gets it right. It should covers cases such 901 * things go more smoothly when it gets it right. It should covers cases such
903 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges 902 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges
904 */ 903 */
905static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus, 904static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
906 struct resource *res) 905 struct resource *res)
907{ 906{
908 struct pci_controller *hose = pci_bus_to_host(bus); 907 struct pci_controller *hose = pci_bus_to_host(bus);
909 struct pci_dev *dev = bus->self; 908 struct pci_dev *dev = bus->self;
@@ -967,7 +966,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
967} 966}
968 967
969/* Fixup resources of a PCI<->PCI bridge */ 968/* Fixup resources of a PCI<->PCI bridge */
970static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) 969static void pcibios_fixup_bridge(struct pci_bus *bus)
971{ 970{
972 struct resource *res; 971 struct resource *res;
973 int i; 972 int i;
@@ -1007,7 +1006,7 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
1007 } 1006 }
1008} 1007}
1009 1008
1010void __devinit pcibios_setup_bus_self(struct pci_bus *bus) 1009void pcibios_setup_bus_self(struct pci_bus *bus)
1011{ 1010{
1012 /* Fix up the bus resources for P2P bridges */ 1011 /* Fix up the bus resources for P2P bridges */
1013 if (bus->self != NULL) 1012 if (bus->self != NULL)
@@ -1024,7 +1023,7 @@ void __devinit pcibios_setup_bus_self(struct pci_bus *bus)
1024 ppc_md.pci_dma_bus_setup(bus); 1023 ppc_md.pci_dma_bus_setup(bus);
1025} 1024}
1026 1025
1027void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) 1026void pcibios_setup_bus_devices(struct pci_bus *bus)
1028{ 1027{
1029 struct pci_dev *dev; 1028 struct pci_dev *dev;
1030 1029
@@ -1063,7 +1062,7 @@ void pcibios_set_master(struct pci_dev *dev)
1063 /* No special bus mastering setup handling */ 1062 /* No special bus mastering setup handling */
1064} 1063}
1065 1064
1066void __devinit pcibios_fixup_bus(struct pci_bus *bus) 1065void pcibios_fixup_bus(struct pci_bus *bus)
1067{ 1066{
1068 /* When called from the generic PCI probe, read PCI<->PCI bridge 1067 /* When called from the generic PCI probe, read PCI<->PCI bridge
1069 * bases. This is -not- called when generating the PCI tree from 1068 * bases. This is -not- called when generating the PCI tree from
@@ -1080,7 +1079,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
1080} 1079}
1081EXPORT_SYMBOL(pcibios_fixup_bus); 1080EXPORT_SYMBOL(pcibios_fixup_bus);
1082 1081
1083void __devinit pci_fixup_cardbus(struct pci_bus *bus) 1082void pci_fixup_cardbus(struct pci_bus *bus)
1084{ 1083{
1085 /* Now fixup devices on that bus */ 1084 /* Now fixup devices on that bus */
1086 pcibios_setup_bus_devices(bus); 1085 pcibios_setup_bus_devices(bus);
@@ -1264,7 +1263,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1264 pcibios_allocate_bus_resources(b); 1263 pcibios_allocate_bus_resources(b);
1265} 1264}
1266 1265
1267static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) 1266static inline void alloc_resource(struct pci_dev *dev, int idx)
1268{ 1267{
1269 struct resource *pr, *r = &dev->resource[idx]; 1268 struct resource *pr, *r = &dev->resource[idx];
1270 1269
@@ -1500,7 +1499,8 @@ resource_size_t pcibios_io_space_offset(struct pci_controller *hose)
1500 return (unsigned long) hose->io_base_virt - _IO_BASE; 1499 return (unsigned long) hose->io_base_virt - _IO_BASE;
1501} 1500}
1502 1501
1503static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) 1502static void pcibios_setup_phb_resources(struct pci_controller *hose,
1503 struct list_head *resources)
1504{ 1504{
1505 struct resource *res; 1505 struct resource *res;
1506 int i; 1506 int i;
@@ -1639,7 +1639,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
1639 * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus 1639 * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus
1640 * @hose: Pointer to the PCI host controller instance structure 1640 * @hose: Pointer to the PCI host controller instance structure
1641 */ 1641 */
1642void __devinit pcibios_scan_phb(struct pci_controller *hose) 1642void pcibios_scan_phb(struct pci_controller *hose)
1643{ 1643{
1644 LIST_HEAD(resources); 1644 LIST_HEAD(resources);
1645 struct pci_bus *bus; 1645 struct pci_bus *bus;
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 64f526a321f..e37c2152acf 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -213,7 +213,7 @@ pci_create_OF_bus_map(void)
213 } 213 }
214} 214}
215 215
216void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose) 216void pcibios_setup_phb_io_space(struct pci_controller *hose)
217{ 217{
218 unsigned long io_offset; 218 unsigned long io_offset;
219 struct resource *res = &hose->io_resource; 219 struct resource *res = &hose->io_resource;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 2cbe6768fdd..51a133a78a0 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -122,7 +122,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
122} 122}
123EXPORT_SYMBOL_GPL(pcibios_unmap_io_space); 123EXPORT_SYMBOL_GPL(pcibios_unmap_io_space);
124 124
125static int __devinit pcibios_map_phb_io_space(struct pci_controller *hose) 125static int pcibios_map_phb_io_space(struct pci_controller *hose)
126{ 126{
127 struct vm_struct *area; 127 struct vm_struct *area;
128 unsigned long phys_page; 128 unsigned long phys_page;
@@ -173,7 +173,7 @@ static int __devinit pcibios_map_phb_io_space(struct pci_controller *hose)
173 return 0; 173 return 0;
174} 174}
175 175
176int __devinit pcibios_map_io_space(struct pci_bus *bus) 176int pcibios_map_io_space(struct pci_bus *bus)
177{ 177{
178 WARN_ON(bus == NULL); 178 WARN_ON(bus == NULL);
179 179
@@ -193,7 +193,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
193} 193}
194EXPORT_SYMBOL_GPL(pcibios_map_io_space); 194EXPORT_SYMBOL_GPL(pcibios_map_io_space);
195 195
196void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose) 196void pcibios_setup_phb_io_space(struct pci_controller *hose)
197{ 197{
198 pcibios_map_phb_io_space(hose); 198 pcibios_map_phb_io_space(hose);
199} 199}
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index dd9e4a04bf7..e7af165f8b9 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -36,7 +36,7 @@
36 * Traverse_func that inits the PCI fields of the device node. 36 * Traverse_func that inits the PCI fields of the device node.
37 * NOTE: this *must* be done before read/write config to the device. 37 * NOTE: this *must* be done before read/write config to the device.
38 */ 38 */
39void * __devinit update_dn_pci_info(struct device_node *dn, void *data) 39void *update_dn_pci_info(struct device_node *dn, void *data)
40{ 40{
41 struct pci_controller *phb = data; 41 struct pci_controller *phb = data;
42 const int *type = 42 const int *type =
@@ -129,7 +129,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
129 * subsystem is set up, before kmalloc is valid) and during the 129 * subsystem is set up, before kmalloc is valid) and during the
130 * dynamic lpar operation of adding a PHB to a running system. 130 * dynamic lpar operation of adding a PHB to a running system.
131 */ 131 */
132void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) 132void pci_devs_phb_init_dynamic(struct pci_controller *phb)
133{ 133{
134 struct device_node *dn = phb->dn; 134 struct device_node *dn = phb->dn;
135 struct pci_dn *pdn; 135 struct pci_dn *pdn;
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 30378a19f65..2a67e9baa59 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -204,7 +204,7 @@ EXPORT_SYMBOL(of_create_pci_dev);
204 * this routine in turn call of_scan_bus() recusively to scan for more child 204 * this routine in turn call of_scan_bus() recusively to scan for more child
205 * devices. 205 * devices.
206 */ 206 */
207void __devinit of_scan_pci_bridge(struct pci_dev *dev) 207void of_scan_pci_bridge(struct pci_dev *dev)
208{ 208{
209 struct device_node *node = dev->dev.of_node; 209 struct device_node *node = dev->dev.of_node;
210 struct pci_bus *bus; 210 struct pci_bus *bus;
@@ -299,8 +299,8 @@ EXPORT_SYMBOL(of_scan_pci_bridge);
299 * @bus: pci_bus structure for the PCI bus 299 * @bus: pci_bus structure for the PCI bus
300 * @rescan_existing: Flag indicating bus has already been set up 300 * @rescan_existing: Flag indicating bus has already been set up
301 */ 301 */
302static void __devinit __of_scan_bus(struct device_node *node, 302static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
303 struct pci_bus *bus, int rescan_existing) 303 int rescan_existing)
304{ 304{
305 struct device_node *child; 305 struct device_node *child;
306 const u32 *reg; 306 const u32 *reg;
@@ -348,8 +348,7 @@ static void __devinit __of_scan_bus(struct device_node *node,
348 * @node: device tree node for the PCI bus 348 * @node: device tree node for the PCI bus
349 * @bus: pci_bus structure for the PCI bus 349 * @bus: pci_bus structure for the PCI bus
350 */ 350 */
351void __devinit of_scan_bus(struct device_node *node, 351void of_scan_bus(struct device_node *node, struct pci_bus *bus)
352 struct pci_bus *bus)
353{ 352{
354 __of_scan_bus(node, bus, 0); 353 __of_scan_bus(node, bus, 0);
355} 354}
@@ -363,8 +362,7 @@ EXPORT_SYMBOL_GPL(of_scan_bus);
363 * Same as of_scan_bus, but for a pci_bus structure that has already been 362 * Same as of_scan_bus, but for a pci_bus structure that has already been
364 * setup. 363 * setup.
365 */ 364 */
366void __devinit of_rescan_bus(struct device_node *node, 365void of_rescan_bus(struct device_node *node, struct pci_bus *bus)
367 struct pci_bus *bus)
368{ 366{
369 __of_scan_bus(node, bus, 1); 367 __of_scan_bus(node, bus, 1);
370} 368}
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 6de63e3250b..71cb20d6ec6 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -209,7 +209,7 @@ void __init init_pci_config_tokens (void)
209 ibm_write_pci_config = rtas_token("ibm,write-pci-config"); 209 ibm_write_pci_config = rtas_token("ibm,write-pci-config");
210} 210}
211 211
212unsigned long __devinit get_phb_buid (struct device_node *phb) 212unsigned long get_phb_buid (struct device_node *phb)
213{ 213{
214 struct resource r; 214 struct resource r;
215 215
@@ -237,7 +237,7 @@ static int phb_set_bus_ranges(struct device_node *dev,
237 return 0; 237 return 0;
238} 238}
239 239
240int __devinit rtas_setup_phb(struct pci_controller *phb) 240int rtas_setup_phb(struct pci_controller *phb)
241{ 241{
242 struct device_node *dev = phb->dn; 242 struct device_node *dev = phb->dn;
243 243
diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c
index 640de836e46..e68fd1ae727 100644
--- a/arch/powerpc/kernel/smp-tbsync.c
+++ b/arch/powerpc/kernel/smp-tbsync.c
@@ -36,13 +36,13 @@ static struct {
36 36
37static volatile int running; 37static volatile int running;
38 38
39static void __devinit enter_contest(u64 mark, long add) 39static void enter_contest(u64 mark, long add)
40{ 40{
41 while (get_tb() < mark) 41 while (get_tb() < mark)
42 tbsync->race_result = add; 42 tbsync->race_result = add;
43} 43}
44 44
45void __devinit smp_generic_take_timebase(void) 45void smp_generic_take_timebase(void)
46{ 46{
47 int cmd; 47 int cmd;
48 u64 tb; 48 u64 tb;
@@ -75,7 +75,7 @@ void __devinit smp_generic_take_timebase(void)
75 local_irq_restore(flags); 75 local_irq_restore(flags);
76} 76}
77 77
78static int __devinit start_contest(int cmd, long offset, int num) 78static int start_contest(int cmd, long offset, int num)
79{ 79{
80 int i, score=0; 80 int i, score=0;
81 u64 tb; 81 u64 tb;
@@ -110,7 +110,7 @@ static int __devinit start_contest(int cmd, long offset, int num)
110 return score; 110 return score;
111} 111}
112 112
113void __devinit smp_generic_give_timebase(void) 113void smp_generic_give_timebase(void)
114{ 114{
115 int i, score, score2, old, min=0, max=5000, offset=1000; 115 int i, score, score2, old, min=0, max=5000, offset=1000;
116 116
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index e5b133ebd8a..793401e6508 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -82,7 +82,7 @@ int smt_enabled_at_boot = 1;
82static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL; 82static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
83 83
84#ifdef CONFIG_PPC64 84#ifdef CONFIG_PPC64
85int __devinit smp_generic_kick_cpu(int nr) 85int smp_generic_kick_cpu(int nr)
86{ 86{
87 BUG_ON(nr < 0 || nr >= NR_CPUS); 87 BUG_ON(nr < 0 || nr >= NR_CPUS);
88 88
@@ -311,7 +311,7 @@ void smp_send_stop(void)
311 311
312struct thread_info *current_set[NR_CPUS]; 312struct thread_info *current_set[NR_CPUS];
313 313
314static void __devinit smp_store_cpu_info(int id) 314static void smp_store_cpu_info(int id)
315{ 315{
316 per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR); 316 per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR);
317#ifdef CONFIG_PPC_FSL_BOOK3E 317#ifdef CONFIG_PPC_FSL_BOOK3E
@@ -355,7 +355,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
355 max_cpus = 1; 355 max_cpus = 1;
356} 356}
357 357
358void __devinit smp_prepare_boot_cpu(void) 358void smp_prepare_boot_cpu(void)
359{ 359{
360 BUG_ON(smp_processor_id() != boot_cpuid); 360 BUG_ON(smp_processor_id() != boot_cpuid);
361#ifdef CONFIG_PPC64 361#ifdef CONFIG_PPC64
@@ -610,7 +610,7 @@ static struct device_node *cpu_to_l2cache(int cpu)
610} 610}
611 611
612/* Activate a secondary processor. */ 612/* Activate a secondary processor. */
613void __devinit start_secondary(void *unused) 613void start_secondary(void *unused)
614{ 614{
615 unsigned int cpu = smp_processor_id(); 615 unsigned int cpu = smp_processor_id();
616 struct device_node *l2_cache; 616 struct device_node *l2_cache;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b3b14352b05..6f6b1cccc91 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -770,13 +770,8 @@ void update_vsyscall_old(struct timespec *wall_time, struct timespec *wtm,
770 770
771void update_vsyscall_tz(void) 771void update_vsyscall_tz(void)
772{ 772{
773 /* Make userspace gettimeofday spin until we're done. */
774 ++vdso_data->tb_update_count;
775 smp_mb();
776 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest; 773 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
777 vdso_data->tz_dsttime = sys_tz.tz_dsttime; 774 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
778 smp_mb();
779 ++vdso_data->tb_update_count;
780} 775}
781 776
782static void __init clocksource_init(void) 777static void __init clocksource_init(void)
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 201ba59738b..536016d792b 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1289,7 +1289,7 @@ void vio_unregister_driver(struct vio_driver *viodrv)
1289EXPORT_SYMBOL(vio_unregister_driver); 1289EXPORT_SYMBOL(vio_unregister_driver);
1290 1290
1291/* vio_dev refcount hit 0 */ 1291/* vio_dev refcount hit 0 */
1292static void __devinit vio_dev_release(struct device *dev) 1292static void vio_dev_release(struct device *dev)
1293{ 1293{
1294 struct iommu_table *tbl = get_iommu_table_base(dev); 1294 struct iommu_table *tbl = get_iommu_table_base(dev);
1295 1295
@@ -1545,7 +1545,7 @@ static struct device_attribute vio_dev_attrs[] = {
1545 __ATTR_NULL 1545 __ATTR_NULL
1546}; 1546};
1547 1547
1548void __devinit vio_unregister_device(struct vio_dev *viodev) 1548void vio_unregister_device(struct vio_dev *viodev)
1549{ 1549{
1550 device_unregister(&viodev->dev); 1550 device_unregister(&viodev->dev);
1551} 1551}
diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c
index 35f3cf0269b..a353c485808 100644
--- a/arch/powerpc/kvm/book3s_hv_ras.c
+++ b/arch/powerpc/kvm/book3s_hv_ras.c
@@ -79,7 +79,9 @@ static void flush_tlb_power7(struct kvm_vcpu *vcpu)
79static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) 79static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)
80{ 80{
81 unsigned long srr1 = vcpu->arch.shregs.msr; 81 unsigned long srr1 = vcpu->arch.shregs.msr;
82#ifdef CONFIG_PPC_POWERNV
82 struct opal_machine_check_event *opal_evt; 83 struct opal_machine_check_event *opal_evt;
84#endif
83 long handled = 1; 85 long handled = 1;
84 86
85 if (srr1 & SRR1_MC_LDSTERR) { 87 if (srr1 & SRR1_MC_LDSTERR) {
@@ -117,6 +119,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)
117 handled = 0; 119 handled = 0;
118 } 120 }
119 121
122#ifdef CONFIG_PPC_POWERNV
120 /* 123 /*
121 * See if OPAL has already handled the condition. 124 * See if OPAL has already handled the condition.
122 * We assume that if the condition is recovered then OPAL 125 * We assume that if the condition is recovered then OPAL
@@ -131,6 +134,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)
131 134
132 if (handled) 135 if (handled)
133 opal_evt->in_use = 0; 136 opal_evt->in_use = 0;
137#endif
134 138
135 return handled; 139 return handled;
136} 140}
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index ae758b3ff72..0d82ef50dc3 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -186,8 +186,6 @@ void tlb_flush(struct mmu_gather *tlb)
186 * Because of that usage pattern, it's only available with CONFIG_HOTPLUG 186 * Because of that usage pattern, it's only available with CONFIG_HOTPLUG
187 * and is implemented for small size rather than speed. 187 * and is implemented for small size rather than speed.
188 */ 188 */
189#ifdef CONFIG_HOTPLUG
190
191void __flush_hash_table_range(struct mm_struct *mm, unsigned long start, 189void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,
192 unsigned long end) 190 unsigned long end)
193{ 191{
@@ -221,5 +219,3 @@ void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,
221 arch_leave_lazy_mmu_mode(); 219 arch_leave_lazy_mmu_mode();
222 local_irq_restore(flags); 220 local_irq_restore(flags);
223} 221}
224
225#endif /* CONFIG_HOTPLUG */
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index 969dddcf332..8f3920e5a04 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -57,7 +57,8 @@ static const char * const board[] __initconst = {
57 "amcc,makalu", 57 "amcc,makalu",
58 "apm,klondike", 58 "apm,klondike",
59 "est,hotfoot", 59 "est,hotfoot",
60 "plathome,obs600" 60 "plathome,obs600",
61 NULL
61}; 62};
62 63
63static int __init ppc40x_probe(void) 64static int __init ppc40x_probe(void)
diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c
index 6bd89a0e0de..ecd3890c40d 100644
--- a/arch/powerpc/platforms/44x/currituck.c
+++ b/arch/powerpc/platforms/44x/currituck.c
@@ -46,7 +46,7 @@ static __initdata struct of_device_id ppc47x_of_bus[] = {
46 46
47/* The EEPROM is missing and the default values are bogus. This forces USB in 47/* The EEPROM is missing and the default values are bogus. This forces USB in
48 * to EHCI mode */ 48 * to EHCI mode */
49static void __devinit quirk_ppc_currituck_usb_fixup(struct pci_dev *dev) 49static void quirk_ppc_currituck_usb_fixup(struct pci_dev *dev)
50{ 50{
51 if (of_machine_is_compatible("ibm,currituck")) { 51 if (of_machine_is_compatible("ibm,currituck")) {
52 pci_write_config_dword(dev, 0xe0, 0x0114231f); 52 pci_write_config_dword(dev, 0xe0, 0x0114231f);
diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c
index ba4a6e388a4..1fdb8748638 100644
--- a/arch/powerpc/platforms/44x/virtex_ml510.c
+++ b/arch/powerpc/platforms/44x/virtex_ml510.c
@@ -5,7 +5,7 @@
5/** 5/**
6 * ml510_ail_quirk 6 * ml510_ail_quirk
7 */ 7 */
8static void __devinit ml510_ali_quirk(struct pci_dev *dev) 8static void ml510_ali_quirk(struct pci_dev *dev)
9{ 9{
10 /* Enable the IDE controller */ 10 /* Enable the IDE controller */
11 pci_write_config_byte(dev, 0x58, 0x4c); 11 pci_write_config_byte(dev, 0x58, 0x4c);
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index a51cb07bd66..692998244d2 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -669,7 +669,7 @@ static struct miscdevice mpc52xx_wdt_miscdev = {
669 .fops = &mpc52xx_wdt_fops, 669 .fops = &mpc52xx_wdt_fops,
670}; 670};
671 671
672static int __devinit mpc52xx_gpt_wdt_init(void) 672static int mpc52xx_gpt_wdt_init(void)
673{ 673{
674 int err; 674 int err;
675 675
@@ -704,7 +704,7 @@ static int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
704 704
705#else 705#else
706 706
707static int __devinit mpc52xx_gpt_wdt_init(void) 707static int mpc52xx_gpt_wdt_init(void)
708{ 708{
709 return 0; 709 return 0;
710} 710}
@@ -720,7 +720,7 @@ static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
720/* --------------------------------------------------------------------- 720/* ---------------------------------------------------------------------
721 * of_platform bus binding code 721 * of_platform bus binding code
722 */ 722 */
723static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev) 723static int mpc52xx_gpt_probe(struct platform_device *ofdev)
724{ 724{
725 struct mpc52xx_gpt_priv *gpt; 725 struct mpc52xx_gpt_priv *gpt;
726 726
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
index 16150fa430f..f9f4537f546 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
@@ -470,7 +470,7 @@ void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)
470} 470}
471EXPORT_SYMBOL(mpc52xx_lpbfifo_abort); 471EXPORT_SYMBOL(mpc52xx_lpbfifo_abort);
472 472
473static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op) 473static int mpc52xx_lpbfifo_probe(struct platform_device *op)
474{ 474{
475 struct resource res; 475 struct resource res;
476 int rc = -ENOMEM; 476 int rc = -ENOMEM;
@@ -540,7 +540,7 @@ static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op)
540} 540}
541 541
542 542
543static int __devexit mpc52xx_lpbfifo_remove(struct platform_device *op) 543static int mpc52xx_lpbfifo_remove(struct platform_device *op)
544{ 544{
545 if (lpbfifo.dev != &op->dev) 545 if (lpbfifo.dev != &op->dev)
546 return 0; 546 return 0;
@@ -564,7 +564,7 @@ static int __devexit mpc52xx_lpbfifo_remove(struct platform_device *op)
564 return 0; 564 return 0;
565} 565}
566 566
567static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = { 567static struct of_device_id mpc52xx_lpbfifo_match[] = {
568 { .compatible = "fsl,mpc5200-lpbfifo", }, 568 { .compatible = "fsl,mpc5200-lpbfifo", },
569 {}, 569 {},
570}; 570};
@@ -576,6 +576,6 @@ static struct platform_driver mpc52xx_lpbfifo_driver = {
576 .of_match_table = mpc52xx_lpbfifo_match, 576 .of_match_table = mpc52xx_lpbfifo_match,
577 }, 577 },
578 .probe = mpc52xx_lpbfifo_probe, 578 .probe = mpc52xx_lpbfifo_probe,
579 .remove = __devexit_p(mpc52xx_lpbfifo_remove), 579 .remove = mpc52xx_lpbfifo_remove,
580}; 580};
581module_platform_driver(mpc52xx_lpbfifo_driver); 581module_platform_driver(mpc52xx_lpbfifo_driver);
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 10ff526cd04..79799b29ffe 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -111,7 +111,7 @@ static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
111 .ops = &ep8248e_mdio_ops, 111 .ops = &ep8248e_mdio_ops,
112}; 112};
113 113
114static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev) 114static int ep8248e_mdio_probe(struct platform_device *ofdev)
115{ 115{
116 struct mii_bus *bus; 116 struct mii_bus *bus;
117 struct resource res; 117 struct resource res;
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index ef6537b8ed3..624cb51d19c 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -145,8 +145,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu)
145 return gpiochip_remove(&mcu->gc); 145 return gpiochip_remove(&mcu->gc);
146} 146}
147 147
148static int __devinit mcu_probe(struct i2c_client *client, 148static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)
149 const struct i2c_device_id *id)
150{ 149{
151 struct mcu *mcu; 150 struct mcu *mcu;
152 int ret; 151 int ret;
@@ -188,7 +187,7 @@ err:
188 return ret; 187 return ret;
189} 188}
190 189
191static int __devexit mcu_remove(struct i2c_client *client) 190static int mcu_remove(struct i2c_client *client)
192{ 191{
193 struct mcu *mcu = i2c_get_clientdata(client); 192 struct mcu *mcu = i2c_get_clientdata(client);
194 int ret; 193 int ret;
@@ -216,7 +215,7 @@ static const struct i2c_device_id mcu_ids[] = {
216}; 215};
217MODULE_DEVICE_TABLE(i2c, mcu_ids); 216MODULE_DEVICE_TABLE(i2c, mcu_ids);
218 217
219static struct of_device_id mcu_of_match_table[] __devinitdata = { 218static struct of_device_id mcu_of_match_table[] = {
220 { .compatible = "fsl,mcu-mpc8349emitx", }, 219 { .compatible = "fsl,mcu-mpc8349emitx", },
221 { }, 220 { },
222}; 221};
@@ -228,7 +227,7 @@ static struct i2c_driver mcu_driver = {
228 .of_match_table = mcu_of_match_table, 227 .of_match_table = mcu_of_match_table,
229 }, 228 },
230 .probe = mcu_probe, 229 .probe = mcu_probe,
231 .remove = __devexit_p(mcu_remove), 230 .remove = mcu_remove,
232 .id_table = mcu_ids, 231 .id_table = mcu_ids,
233}; 232};
234 233
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index ed69c925071..6f355d8c92f 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -64,7 +64,7 @@ void __init corenet_ds_setup_arch(void)
64 pr_info("%s board from Freescale Semiconductor\n", ppc_md.name); 64 pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
65} 65}
66 66
67static const struct of_device_id of_device_ids[] __devinitconst = { 67static const struct of_device_id of_device_ids[] = {
68 { 68 {
69 .compatible = "simple-bus" 69 .compatible = "simple-bus"
70 }, 70 },
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index c474505ad0d..7a31a0e1df2 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -154,7 +154,7 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
154 } 154 }
155} 155}
156 156
157static void __devinit skip_fake_bridge(struct pci_dev *dev) 157static void skip_fake_bridge(struct pci_dev *dev)
158{ 158{
159 /* Make it an error to skip the fake bridge 159 /* Make it an error to skip the fake bridge
160 * in pci_setup_device() in probe.c */ 160 * in pci_setup_device() in probe.c */
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index b4e58cdc09a..ec0b7272fae 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -85,7 +85,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
85 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 85 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
86} 86}
87 87
88static void __devinit tqm85xx_ti1520_fixup(struct pci_dev *pdev) 88static void tqm85xx_ti1520_fixup(struct pci_dev *pdev)
89{ 89{
90 unsigned int val; 90 unsigned int val;
91 91
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index bf5338754c5..c23f3443880 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -159,7 +159,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
159 gef_ppc9a_get_vme_is_syscon() ? "yes" : "no"); 159 gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
160} 160}
161 161
162static void __devinit gef_ppc9a_nec_fixup(struct pci_dev *pdev) 162static void gef_ppc9a_nec_fixup(struct pci_dev *pdev)
163{ 163{
164 unsigned int val; 164 unsigned int val;
165 165
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 0b7851330a0..8a6ac20686e 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -146,7 +146,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)
146 146
147} 147}
148 148
149static void __devinit gef_sbc310_nec_fixup(struct pci_dev *pdev) 149static void gef_sbc310_nec_fixup(struct pci_dev *pdev)
150{ 150{
151 unsigned int val; 151 unsigned int val;
152 152
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index b9eb174897b..06c72636f29 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -136,7 +136,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
136 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 136 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
137} 137}
138 138
139static void __devinit gef_sbc610_nec_fixup(struct pci_dev *pdev) 139static void gef_sbc610_nec_fixup(struct pci_dev *pdev)
140{ 140{
141 unsigned int val; 141 unsigned int val;
142 142
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 4ab08767118..6ae25fb6201 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -117,7 +117,7 @@ static void cell_fixup_pcie_rootcomplex(struct pci_dev *dev)
117} 117}
118DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex); 118DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex);
119 119
120static int __devinit cell_setup_phb(struct pci_controller *phb) 120static int cell_setup_phb(struct pci_controller *phb)
121{ 121{
122 const char *model; 122 const char *model;
123 struct device_node *np; 123 struct device_node *np;
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index 49a65e2dfc7..d35dbbc8ec7 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -67,7 +67,7 @@ static cpumask_t of_spin_map;
67 * 0 - failure 67 * 0 - failure
68 * 1 - success 68 * 1 - success
69 */ 69 */
70static inline int __devinit smp_startup_cpu(unsigned int lcpu) 70static inline int smp_startup_cpu(unsigned int lcpu)
71{ 71{
72 int status; 72 int status;
73 unsigned long start_here = __pa((u32)*((unsigned long *) 73 unsigned long start_here = __pa((u32)*((unsigned long *)
@@ -108,7 +108,7 @@ static int __init smp_iic_probe(void)
108 return cpumask_weight(cpu_possible_mask); 108 return cpumask_weight(cpu_possible_mask);
109} 109}
110 110
111static void __devinit smp_cell_setup_cpu(int cpu) 111static void smp_cell_setup_cpu(int cpu)
112{ 112{
113 if (cpu != boot_cpuid) 113 if (cpu != boot_cpuid)
114 iic_setup_cpu(); 114 iic_setup_cpu();
@@ -119,7 +119,7 @@ static void __devinit smp_cell_setup_cpu(int cpu)
119 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER); 119 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);
120} 120}
121 121
122static int __devinit smp_cell_kick_cpu(int nr) 122static int smp_cell_kick_cpu(int nr)
123{ 123{
124 BUG_ON(nr < 0 || nr >= NR_CPUS); 124 BUG_ON(nr < 0 || nr >= NR_CPUS);
125 125
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 83285c5a204..1b87e198faa 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -323,7 +323,7 @@ chrp_find_bridges(void)
323 * ATA controller to be set to fully native mode or bad things 323 * ATA controller to be set to fully native mode or bad things
324 * will happen. 324 * will happen.
325 */ 325 */
326static void __devinit chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105) 326static void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
327{ 327{
328 u8 progif; 328 u8 progif;
329 329
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index feab30bbae2..dead91b177b 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -30,7 +30,7 @@
30#include <asm/mpic.h> 30#include <asm/mpic.h>
31#include <asm/rtas.h> 31#include <asm/rtas.h>
32 32
33static int __devinit smp_chrp_kick_cpu(int nr) 33static int smp_chrp_kick_cpu(int nr)
34{ 34{
35 *(unsigned long *)KERNELBASE = nr; 35 *(unsigned long *)KERNELBASE = nr;
36 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory"); 36 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
@@ -38,7 +38,7 @@ static int __devinit smp_chrp_kick_cpu(int nr)
38 return 0; 38 return 0;
39} 39}
40 40
41static void __devinit smp_chrp_setup_cpu(int cpu_nr) 41static void smp_chrp_setup_cpu(int cpu_nr)
42{ 42{
43 mpic_setup_this_cpu(); 43 mpic_setup_this_cpu();
44} 44}
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 64fde058e54..92ac9b52b32 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -59,7 +59,7 @@ static inline bool is_quirk_valid(void)
59} 59}
60 60
61/* Bridge */ 61/* Bridge */
62static void __devinit early_uli5249(struct pci_dev *dev) 62static void early_uli5249(struct pci_dev *dev)
63{ 63{
64 unsigned char temp; 64 unsigned char temp;
65 65
@@ -82,7 +82,7 @@ static void __devinit early_uli5249(struct pci_dev *dev)
82} 82}
83 83
84 84
85static void __devinit quirk_uli1575(struct pci_dev *dev) 85static void quirk_uli1575(struct pci_dev *dev)
86{ 86{
87 int i; 87 int i;
88 88
@@ -139,7 +139,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
139 pci_write_config_byte(dev, 0x75, ULI_8259_IRQ15); 139 pci_write_config_byte(dev, 0x75, ULI_8259_IRQ15);
140} 140}
141 141
142static void __devinit quirk_final_uli1575(struct pci_dev *dev) 142static void quirk_final_uli1575(struct pci_dev *dev)
143{ 143{
144 /* Set i8259 interrupt trigger 144 /* Set i8259 interrupt trigger
145 * IRQ 3: Level 145 * IRQ 3: Level
@@ -175,7 +175,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
175} 175}
176 176
177/* SATA */ 177/* SATA */
178static void __devinit quirk_uli5288(struct pci_dev *dev) 178static void quirk_uli5288(struct pci_dev *dev)
179{ 179{
180 unsigned char c; 180 unsigned char c;
181 unsigned int d; 181 unsigned int d;
@@ -200,7 +200,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)
200} 200}
201 201
202/* PATA */ 202/* PATA */
203static void __devinit quirk_uli5229(struct pci_dev *dev) 203static void quirk_uli5229(struct pci_dev *dev)
204{ 204{
205 unsigned short temp; 205 unsigned short temp;
206 206
@@ -216,7 +216,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
216} 216}
217 217
218/* We have to do a dummy read on the P2P for the RTC to work, WTF */ 218/* We have to do a dummy read on the P2P for the RTC to work, WTF */
219static void __devinit quirk_final_uli5249(struct pci_dev *dev) 219static void quirk_final_uli5249(struct pci_dev *dev)
220{ 220{
221 int i; 221 int i;
222 u8 *dummy; 222 u8 *dummy;
@@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);
253DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); 253DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);
254DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); 254DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
255 255
256static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) 256static void hpcd_quirk_uli1575(struct pci_dev *dev)
257{ 257{
258 u32 temp32; 258 u32 temp32;
259 259
@@ -269,7 +269,7 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
269 pci_write_config_dword(dev, 0x90, (temp32 | 1<<22)); 269 pci_write_config_dword(dev, 0x90, (temp32 | 1<<22));
270} 270}
271 271
272static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev) 272static void hpcd_quirk_uli5288(struct pci_dev *dev)
273{ 273{
274 unsigned char c; 274 unsigned char c;
275 275
@@ -295,7 +295,7 @@ static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)
295 * IRQ14 is a sideband interrupt from IDE device to CPU and we use this 295 * IRQ14 is a sideband interrupt from IDE device to CPU and we use this
296 * as the interrupt for IDE device. 296 * as the interrupt for IDE device.
297 */ 297 */
298static void __devinit hpcd_quirk_uli5229(struct pci_dev *dev) 298static void hpcd_quirk_uli5229(struct pci_dev *dev)
299{ 299{
300 unsigned char c; 300 unsigned char c;
301 301
@@ -317,7 +317,7 @@ static void __devinit hpcd_quirk_uli5229(struct pci_dev *dev)
317 * bug by re-assigning a correct irq to 5288. 317 * bug by re-assigning a correct irq to 5288.
318 * 318 *
319 */ 319 */
320static void __devinit hpcd_final_uli5288(struct pci_dev *dev) 320static void hpcd_final_uli5288(struct pci_dev *dev)
321{ 321{
322 struct pci_controller *hose = pci_bus_to_host(dev->bus); 322 struct pci_controller *hose = pci_bus_to_host(dev->bus);
323 struct device_node *hosenode = hose ? hose->dn : NULL; 323 struct device_node *hosenode = hose ? hose->dn : NULL;
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 465ee8f5c08..f7136aae8bb 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -543,7 +543,7 @@ static int __init maple_add_bridge(struct device_node *dev)
543} 543}
544 544
545 545
546void __devinit maple_pci_irq_fixup(struct pci_dev *dev) 546void maple_pci_irq_fixup(struct pci_dev *dev)
547{ 547{
548 DBG(" -> maple_pci_irq_fixup\n"); 548 DBG(" -> maple_pci_irq_fixup\n");
549 549
@@ -648,7 +648,7 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
648 return irq; 648 return irq;
649} 649}
650 650
651static void __devinit quirk_ipr_msi(struct pci_dev *dev) 651static void quirk_ipr_msi(struct pci_dev *dev)
652{ 652{
653 /* Something prevents MSIs from the IPR from working on Bimini, 653 /* Something prevents MSIs from the IPR from working on Bimini,
654 * and the driver has no smarts to recover. So disable MSI 654 * and the driver has no smarts to recover. So disable MSI
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 9886296e08d..0237ab782fb 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -216,7 +216,7 @@ static int gpio_mdio_reset(struct mii_bus *bus)
216} 216}
217 217
218 218
219static int __devinit gpio_mdio_probe(struct platform_device *ofdev) 219static int gpio_mdio_probe(struct platform_device *ofdev)
220{ 220{
221 struct device *dev = &ofdev->dev; 221 struct device *dev = &ofdev->dev;
222 struct device_node *np = ofdev->dev.of_node; 222 struct device_node *np = ofdev->dev.of_node;
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
index b1e524f7489..ea65bf0eb89 100644
--- a/arch/powerpc/platforms/pasemi/pasemi.h
+++ b/arch/powerpc/platforms/pasemi/pasemi.h
@@ -3,8 +3,8 @@
3 3
4extern unsigned long pas_get_boot_time(void); 4extern unsigned long pas_get_boot_time(void);
5extern void pas_pci_init(void); 5extern void pas_pci_init(void);
6extern void __devinit pas_pci_irq_fixup(struct pci_dev *dev); 6extern void pas_pci_irq_fixup(struct pci_dev *dev);
7extern void __devinit pas_pci_dma_dev_setup(struct pci_dev *dev); 7extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
8 8
9extern void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset); 9extern void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
10 10
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 2ed9212d7d5..8c54de6d8ec 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -76,7 +76,7 @@ static void pas_restart(char *cmd)
76static arch_spinlock_t timebase_lock; 76static arch_spinlock_t timebase_lock;
77static unsigned long timebase; 77static unsigned long timebase;
78 78
79static void __devinit pas_give_timebase(void) 79static void pas_give_timebase(void)
80{ 80{
81 unsigned long flags; 81 unsigned long flags;
82 82
@@ -94,7 +94,7 @@ static void __devinit pas_give_timebase(void)
94 local_irq_restore(flags); 94 local_irq_restore(flags);
95} 95}
96 96
97static void __devinit pas_take_timebase(void) 97static void pas_take_timebase(void)
98{ 98{
99 while (!timebase) 99 while (!timebase)
100 smp_rmb(); 100 smp_rmb();
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 43bbe1bda93..2b8af75abc2 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -561,7 +561,7 @@ static struct pci_ops u4_pcie_pci_ops =
561 .write = u4_pcie_write_config, 561 .write = u4_pcie_write_config,
562}; 562};
563 563
564static void __devinit pmac_pci_fixup_u4_of_node(struct pci_dev *dev) 564static void pmac_pci_fixup_u4_of_node(struct pci_dev *dev)
565{ 565{
566 /* Apple's device-tree "hides" the root complex virtual P2P bridge 566 /* Apple's device-tree "hides" the root complex virtual P2P bridge
567 * on U4. However, Linux sees it, causing the PCI <-> OF matching 567 * on U4. However, Linux sees it, causing the PCI <-> OF matching
@@ -988,7 +988,7 @@ static int __init pmac_add_bridge(struct device_node *dev)
988 return 0; 988 return 0;
989} 989}
990 990
991void __devinit pmac_pci_irq_fixup(struct pci_dev *dev) 991void pmac_pci_irq_fixup(struct pci_dev *dev)
992{ 992{
993#ifdef CONFIG_PPC32 993#ifdef CONFIG_PPC32
994 /* Fixup interrupt for the modem/ethernet combo controller. 994 /* Fixup interrupt for the modem/ethernet combo controller.
@@ -1138,7 +1138,7 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)
1138 return 0; 1138 return 0;
1139} 1139}
1140 1140
1141void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev) 1141void pmac_pci_fixup_ohci(struct pci_dev *dev)
1142{ 1142{
1143 struct device_node *node = pci_device_to_OF_node(dev); 1143 struct device_node *node = pci_device_to_OF_node(dev);
1144 1144
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index b4ddaa3fbb2..bdb738a69e4 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -484,7 +484,7 @@ static void smp_core99_give_timebase(void)
484} 484}
485 485
486 486
487static void __devinit smp_core99_take_timebase(void) 487static void smp_core99_take_timebase(void)
488{ 488{
489 unsigned long flags; 489 unsigned long flags;
490 490
@@ -669,7 +669,7 @@ static void smp_core99_gpio_tb_freeze(int freeze)
669volatile static long int core99_l2_cache; 669volatile static long int core99_l2_cache;
670volatile static long int core99_l3_cache; 670volatile static long int core99_l3_cache;
671 671
672static void __devinit core99_init_caches(int cpu) 672static void core99_init_caches(int cpu)
673{ 673{
674#ifndef CONFIG_PPC64 674#ifndef CONFIG_PPC64
675 if (!cpu_has_feature(CPU_FTR_L2CR)) 675 if (!cpu_has_feature(CPU_FTR_L2CR))
@@ -801,7 +801,7 @@ static int __init smp_core99_probe(void)
801 return ncpus; 801 return ncpus;
802} 802}
803 803
804static int __devinit smp_core99_kick_cpu(int nr) 804static int smp_core99_kick_cpu(int nr)
805{ 805{
806 unsigned int save_vector; 806 unsigned int save_vector;
807 unsigned long target, flags; 807 unsigned long target, flags;
@@ -844,7 +844,7 @@ static int __devinit smp_core99_kick_cpu(int nr)
844 return 0; 844 return 0;
845} 845}
846 846
847static void __devinit smp_core99_setup_cpu(int cpu_nr) 847static void smp_core99_setup_cpu(int cpu_nr)
848{ 848{
849 /* Setup L2/L3 */ 849 /* Setup L2/L3 */
850 if (cpu_nr != 0) 850 if (cpu_nr != 0)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 53d052e95cf..8e90e8906df 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -76,7 +76,7 @@ static struct pci_dn *pnv_ioda_get_pdn(struct pci_dev *dev)
76 return PCI_DN(np); 76 return PCI_DN(np);
77} 77}
78 78
79static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb) 79static int pnv_ioda_alloc_pe(struct pnv_phb *phb)
80{ 80{
81 unsigned long pe; 81 unsigned long pe;
82 82
@@ -91,7 +91,7 @@ static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb)
91 return pe; 91 return pe;
92} 92}
93 93
94static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe) 94static void pnv_ioda_free_pe(struct pnv_phb *phb, int pe)
95{ 95{
96 WARN_ON(phb->ioda.pe_array[pe].pdev); 96 WARN_ON(phb->ioda.pe_array[pe].pdev);
97 97
@@ -103,7 +103,7 @@ static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe)
103 * but in the meantime, we need to protect them to avoid warnings 103 * but in the meantime, we need to protect them to avoid warnings
104 */ 104 */
105#ifdef CONFIG_PCI_MSI 105#ifdef CONFIG_PCI_MSI
106static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev) 106static struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev)
107{ 107{
108 struct pci_controller *hose = pci_bus_to_host(dev->bus); 108 struct pci_controller *hose = pci_bus_to_host(dev->bus);
109 struct pnv_phb *phb = hose->private_data; 109 struct pnv_phb *phb = hose->private_data;
@@ -117,8 +117,7 @@ static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev)
117} 117}
118#endif /* CONFIG_PCI_MSI */ 118#endif /* CONFIG_PCI_MSI */
119 119
120static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb, 120static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
121 struct pnv_ioda_pe *pe)
122{ 121{
123 struct pci_dev *parent; 122 struct pci_dev *parent;
124 uint8_t bcomp, dcomp, fcomp; 123 uint8_t bcomp, dcomp, fcomp;
@@ -207,8 +206,8 @@ static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,
207 return 0; 206 return 0;
208} 207}
209 208
210static void __devinit pnv_ioda_link_pe_by_weight(struct pnv_phb *phb, 209static void pnv_ioda_link_pe_by_weight(struct pnv_phb *phb,
211 struct pnv_ioda_pe *pe) 210 struct pnv_ioda_pe *pe)
212{ 211{
213 struct pnv_ioda_pe *lpe; 212 struct pnv_ioda_pe *lpe;
214 213
@@ -246,7 +245,7 @@ static unsigned int pnv_ioda_dma_weight(struct pci_dev *dev)
246} 245}
247 246
248#if 0 247#if 0
249static struct pnv_ioda_pe * __devinit pnv_ioda_setup_dev_PE(struct pci_dev *dev) 248static struct pnv_ioda_pe *pnv_ioda_setup_dev_PE(struct pci_dev *dev)
250{ 249{
251 struct pci_controller *hose = pci_bus_to_host(dev->bus); 250 struct pci_controller *hose = pci_bus_to_host(dev->bus);
252 struct pnv_phb *phb = hose->private_data; 251 struct pnv_phb *phb = hose->private_data;
@@ -343,7 +342,7 @@ static void pnv_ioda_setup_same_PE(struct pci_bus *bus, struct pnv_ioda_pe *pe)
343 * subordinate PCI devices and buses. The second type of PE is normally 342 * subordinate PCI devices and buses. The second type of PE is normally
344 * orgiriated by PCIe-to-PCI bridge or PLX switch downstream ports. 343 * orgiriated by PCIe-to-PCI bridge or PLX switch downstream ports.
345 */ 344 */
346static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all) 345static void pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)
347{ 346{
348 struct pci_controller *hose = pci_bus_to_host(bus); 347 struct pci_controller *hose = pci_bus_to_host(bus);
349 struct pnv_phb *phb = hose->private_data; 348 struct pnv_phb *phb = hose->private_data;
@@ -399,7 +398,7 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)
399 pnv_ioda_link_pe_by_weight(phb, pe); 398 pnv_ioda_link_pe_by_weight(phb, pe);
400} 399}
401 400
402static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus) 401static void pnv_ioda_setup_PEs(struct pci_bus *bus)
403{ 402{
404 struct pci_dev *dev; 403 struct pci_dev *dev;
405 404
@@ -423,7 +422,7 @@ static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus)
423 * port to PE# here. The game rule here is expected to be changed 422 * port to PE# here. The game rule here is expected to be changed
424 * as soon as we can detected PLX bridge correctly. 423 * as soon as we can detected PLX bridge correctly.
425 */ 424 */
426static void __devinit pnv_pci_ioda_setup_PEs(void) 425static void pnv_pci_ioda_setup_PEs(void)
427{ 426{
428 struct pci_controller *hose, *tmp; 427 struct pci_controller *hose, *tmp;
429 428
@@ -432,14 +431,12 @@ static void __devinit pnv_pci_ioda_setup_PEs(void)
432 } 431 }
433} 432}
434 433
435static void __devinit pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, 434static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *dev)
436 struct pci_dev *dev)
437{ 435{
438 /* We delay DMA setup after we have assigned all PE# */ 436 /* We delay DMA setup after we have assigned all PE# */
439} 437}
440 438
441static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, 439static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)
442 struct pci_bus *bus)
443{ 440{
444 struct pci_dev *dev; 441 struct pci_dev *dev;
445 442
@@ -450,10 +447,9 @@ static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
450 } 447 }
451} 448}
452 449
453static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb, 450static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
454 struct pnv_ioda_pe *pe, 451 struct pnv_ioda_pe *pe, unsigned int base,
455 unsigned int base, 452 unsigned int segs)
456 unsigned int segs)
457{ 453{
458 454
459 struct page *tce_mem = NULL; 455 struct page *tce_mem = NULL;
@@ -541,7 +537,7 @@ static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
541 __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs)); 537 __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs));
542} 538}
543 539
544static void __devinit pnv_ioda_setup_dma(struct pnv_phb *phb) 540static void pnv_ioda_setup_dma(struct pnv_phb *phb)
545{ 541{
546 struct pci_controller *hose = phb->hose; 542 struct pci_controller *hose = phb->hose;
547 unsigned int residual, remaining, segs, tw, base; 543 unsigned int residual, remaining, segs, tw, base;
@@ -684,8 +680,8 @@ static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { }
684 * to bottom style. So the the I/O or MMIO segment assigned to 680 * to bottom style. So the the I/O or MMIO segment assigned to
685 * parent PE could be overrided by its child PEs if necessary. 681 * parent PE could be overrided by its child PEs if necessary.
686 */ 682 */
687static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose, 683static void pnv_ioda_setup_pe_seg(struct pci_controller *hose,
688 struct pnv_ioda_pe *pe) 684 struct pnv_ioda_pe *pe)
689{ 685{
690 struct pnv_phb *phb = hose->private_data; 686 struct pnv_phb *phb = hose->private_data;
691 struct pci_bus_region region; 687 struct pci_bus_region region;
@@ -753,7 +749,7 @@ static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose,
753 } 749 }
754} 750}
755 751
756static void __devinit pnv_pci_ioda_setup_seg(void) 752static void pnv_pci_ioda_setup_seg(void)
757{ 753{
758 struct pci_controller *tmp, *hose; 754 struct pci_controller *tmp, *hose;
759 struct pnv_phb *phb; 755 struct pnv_phb *phb;
@@ -767,7 +763,7 @@ static void __devinit pnv_pci_ioda_setup_seg(void)
767 } 763 }
768} 764}
769 765
770static void __devinit pnv_pci_ioda_setup_DMA(void) 766static void pnv_pci_ioda_setup_DMA(void)
771{ 767{
772 struct pci_controller *hose, *tmp; 768 struct pci_controller *hose, *tmp;
773 struct pnv_phb *phb; 769 struct pnv_phb *phb;
@@ -781,7 +777,7 @@ static void __devinit pnv_pci_ioda_setup_DMA(void)
781 } 777 }
782} 778}
783 779
784static void __devinit pnv_pci_ioda_fixup(void) 780static void pnv_pci_ioda_fixup(void)
785{ 781{
786 pnv_pci_ioda_setup_PEs(); 782 pnv_pci_ioda_setup_PEs();
787 pnv_pci_ioda_setup_seg(); 783 pnv_pci_ioda_setup_seg();
@@ -829,7 +825,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
829/* Prevent enabling devices for which we couldn't properly 825/* Prevent enabling devices for which we couldn't properly
830 * assign a PE 826 * assign a PE
831 */ 827 */
832static int __devinit pnv_pci_enable_device_hook(struct pci_dev *dev) 828static int pnv_pci_enable_device_hook(struct pci_dev *dev)
833{ 829{
834 struct pci_controller *hose = pci_bus_to_host(dev->bus); 830 struct pci_controller *hose = pci_bus_to_host(dev->bus);
835 struct pnv_phb *phb = hose->private_data; 831 struct pnv_phb *phb = hose->private_data;
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 6b4bef4e9d8..7db8771a40f 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -84,8 +84,8 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb)
84static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { } 84static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
85#endif /* CONFIG_PCI_MSI */ 85#endif /* CONFIG_PCI_MSI */
86 86
87static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb, 87static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
88 struct pci_dev *pdev) 88 struct pci_dev *pdev)
89{ 89{
90 if (phb->p5ioc2.iommu_table.it_map == NULL) 90 if (phb->p5ioc2.iommu_table.it_map == NULL)
91 iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node); 91 iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index c01688a1a74..b8b8e0bd989 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -464,8 +464,7 @@ void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
464 tbl->it_type = TCE_PCI; 464 tbl->it_type = TCE_PCI;
465} 465}
466 466
467static struct iommu_table * __devinit 467static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
468pnv_pci_setup_bml_iommu(struct pci_controller *hose)
469{ 468{
470 struct iommu_table *tbl; 469 struct iommu_table *tbl;
471 const __be64 *basep, *swinvp; 470 const __be64 *basep, *swinvp;
@@ -496,8 +495,8 @@ pnv_pci_setup_bml_iommu(struct pci_controller *hose)
496 return tbl; 495 return tbl;
497} 496}
498 497
499static void __devinit pnv_pci_dma_fallback_setup(struct pci_controller *hose, 498static void pnv_pci_dma_fallback_setup(struct pci_controller *hose,
500 struct pci_dev *pdev) 499 struct pci_dev *pdev)
501{ 500{
502 struct device_node *np = pci_bus_to_OF_node(hose->bus); 501 struct device_node *np = pci_bus_to_OF_node(hose->bus);
503 struct pci_dn *pdn; 502 struct pci_dn *pdn;
@@ -512,7 +511,7 @@ static void __devinit pnv_pci_dma_fallback_setup(struct pci_controller *hose,
512 set_iommu_table_base(&pdev->dev, pdn->iommu_table); 511 set_iommu_table_base(&pdev->dev, pdn->iommu_table);
513} 512}
514 513
515static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev) 514static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)
516{ 515{
517 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 516 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
518 struct pnv_phb *phb = hose->private_data; 517 struct pnv_phb *phb = hose->private_data;
@@ -527,7 +526,7 @@ static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev)
527} 526}
528 527
529/* Fixup wrong class code in p7ioc root complex */ 528/* Fixup wrong class code in p7ioc root complex */
530static void __devinit pnv_p7ioc_rc_quirk(struct pci_dev *dev) 529static void pnv_p7ioc_rc_quirk(struct pci_dev *dev)
531{ 530{
532 dev->class = PCI_CLASS_BRIDGE_PCI << 8; 531 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
533} 532}
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 7698b6e13c5..0bdc735db16 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -62,7 +62,7 @@ static int pnv_smp_cpu_bootable(unsigned int nr)
62 return 1; 62 return 1;
63} 63}
64 64
65int __devinit pnv_smp_kick_cpu(int nr) 65int pnv_smp_kick_cpu(int nr)
66{ 66{
67 unsigned int pcpu = get_hard_smp_processor_id(nr); 67 unsigned int pcpu = get_hard_smp_processor_id(nr);
68 unsigned long start_here = __pa(*((unsigned long *) 68 unsigned long start_here = __pa(*((unsigned long *)
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index 9b47ba7a5de..bfccdc7cb85 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -437,7 +437,7 @@ found_dev:
437 return 0; 437 return 0;
438} 438}
439 439
440int __devinit ps3_repository_find_devices(enum ps3_bus_type bus_type, 440int ps3_repository_find_devices(enum ps3_bus_type bus_type,
441 int (*callback)(const struct ps3_repository_device *repo)) 441 int (*callback)(const struct ps3_repository_device *repo))
442{ 442{
443 int result = 0; 443 int result = 0;
diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c
index 66442341d3a..1efa28f5fc5 100644
--- a/arch/powerpc/platforms/pseries/eeh_dev.c
+++ b/arch/powerpc/platforms/pseries/eeh_dev.c
@@ -49,7 +49,7 @@
49 * It will create EEH device according to the given OF node. The function 49 * It will create EEH device according to the given OF node. The function
50 * might be called by PCI emunation, DR, PHB hotplug. 50 * might be called by PCI emunation, DR, PHB hotplug.
51 */ 51 */
52void * __devinit eeh_dev_init(struct device_node *dn, void *data) 52void *eeh_dev_init(struct device_node *dn, void *data)
53{ 53{
54 struct pci_controller *phb = data; 54 struct pci_controller *phb = data;
55 struct eeh_dev *edev; 55 struct eeh_dev *edev;
@@ -77,7 +77,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data)
77 * Scan the PHB OF node and its child association, then create the 77 * Scan the PHB OF node and its child association, then create the
78 * EEH devices accordingly 78 * EEH devices accordingly
79 */ 79 */
80void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb) 80void eeh_dev_phb_init_dynamic(struct pci_controller *phb)
81{ 81{
82 struct device_node *dn = phb->dn; 82 struct device_node *dn = phb->dn;
83 83
diff --git a/arch/powerpc/platforms/pseries/eeh_pe.c b/arch/powerpc/platforms/pseries/eeh_pe.c
index d16c8ded108..fe43d1aa2cf 100644
--- a/arch/powerpc/platforms/pseries/eeh_pe.c
+++ b/arch/powerpc/platforms/pseries/eeh_pe.c
@@ -66,7 +66,7 @@ static struct eeh_pe *eeh_pe_alloc(struct pci_controller *phb, int type)
66 * The function should be called while the PHB is detected during 66 * The function should be called while the PHB is detected during
67 * system boot or PCI hotplug in order to create PHB PE. 67 * system boot or PCI hotplug in order to create PHB PE.
68 */ 68 */
69int __devinit eeh_phb_pe_create(struct pci_controller *phb) 69int eeh_phb_pe_create(struct pci_controller *phb)
70{ 70{
71 struct eeh_pe *pe; 71 struct eeh_pe *pe;
72 72
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 261a577a3dd..c91b22be928 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -149,7 +149,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
149} 149}
150EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); 150EXPORT_SYMBOL_GPL(pcibios_add_pci_devices);
151 151
152struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) 152struct pci_controller *init_phb_dynamic(struct device_node *dn)
153{ 153{
154 struct pci_controller *phb; 154 struct pci_controller *phb;
155 155
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 9fc0a494190..80cd0be71e0 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -87,7 +87,7 @@ int smp_query_cpu_stopped(unsigned int pcpu)
87 * 0 - failure 87 * 0 - failure
88 * 1 - success 88 * 1 - success
89 */ 89 */
90static inline int __devinit smp_startup_cpu(unsigned int lcpu) 90static inline int smp_startup_cpu(unsigned int lcpu)
91{ 91{
92 int status; 92 int status;
93 unsigned long start_here = __pa((u32)*((unsigned long *) 93 unsigned long start_here = __pa((u32)*((unsigned long *)
@@ -133,7 +133,7 @@ out:
133 return 1; 133 return 1;
134} 134}
135 135
136static void __devinit smp_xics_setup_cpu(int cpu) 136static void smp_xics_setup_cpu(int cpu)
137{ 137{
138 if (cpu != boot_cpuid) 138 if (cpu != boot_cpuid)
139 xics_setup_cpu(); 139 xics_setup_cpu();
@@ -148,7 +148,7 @@ static void __devinit smp_xics_setup_cpu(int cpu)
148#endif 148#endif
149} 149}
150 150
151static int __devinit smp_pSeries_kick_cpu(int nr) 151static int smp_pSeries_kick_cpu(int nr)
152{ 152{
153 BUG_ON(nr < 0 || nr >= NR_CPUS); 153 BUG_ON(nr < 0 || nr >= NR_CPUS);
154 154
diff --git a/arch/powerpc/platforms/wsp/scom_smp.c b/arch/powerpc/platforms/wsp/scom_smp.c
index 141e7803209..b56b70aeb49 100644
--- a/arch/powerpc/platforms/wsp/scom_smp.c
+++ b/arch/powerpc/platforms/wsp/scom_smp.c
@@ -337,8 +337,7 @@ scom_fail:
337 return rc; 337 return rc;
338} 338}
339 339
340int __devinit a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, 340int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, struct device_node *np)
341 struct device_node *np)
342{ 341{
343 u64 init_iar, init_msr, init_ccr2; 342 u64 init_iar, init_msr, init_ccr2;
344 unsigned long start_here; 343 unsigned long start_here;
diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c
index 0ba103ae83a..332a18b8140 100644
--- a/arch/powerpc/platforms/wsp/smp.c
+++ b/arch/powerpc/platforms/wsp/smp.c
@@ -23,7 +23,7 @@
23#include "ics.h" 23#include "ics.h"
24#include "wsp.h" 24#include "wsp.h"
25 25
26static void __devinit smp_a2_setup_cpu(int cpu) 26static void smp_a2_setup_cpu(int cpu)
27{ 27{
28 doorbell_setup_this_cpu(); 28 doorbell_setup_this_cpu();
29 29
@@ -31,7 +31,7 @@ static void __devinit smp_a2_setup_cpu(int cpu)
31 xics_setup_cpu(); 31 xics_setup_cpu();
32} 32}
33 33
34int __devinit smp_a2_kick_cpu(int nr) 34int smp_a2_kick_cpu(int nr)
35{ 35{
36 const char *enable_method; 36 const char *enable_method;
37 struct device_node *np; 37 struct device_node *np;
diff --git a/arch/powerpc/platforms/wsp/wsp.h b/arch/powerpc/platforms/wsp/wsp.h
index 10c1d1fff36..62ef21afb89 100644
--- a/arch/powerpc/platforms/wsp/wsp.h
+++ b/arch/powerpc/platforms/wsp/wsp.h
@@ -18,7 +18,7 @@ extern void a2_setup_smp(void);
18extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, 18extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,
19 struct device_node *np); 19 struct device_node *np);
20extern int smp_a2_cpu_bootable(unsigned int nr); 20extern int smp_a2_cpu_bootable(unsigned int nr);
21extern int __devinit smp_a2_kick_cpu(int nr); 21extern int smp_a2_kick_cpu(int nr);
22 22
23extern void opb_pic_init(void); 23extern void opb_pic_init(void);
24 24
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c
index 1526551f9fe..8e22f561d17 100644
--- a/arch/powerpc/platforms/wsp/wsp_pci.c
+++ b/arch/powerpc/platforms/wsp/wsp_pci.c
@@ -402,7 +402,7 @@ static struct wsp_dma_table *wsp_pci_create_dma32_table(struct wsp_phb *phb,
402 return ERR_PTR(-ENOMEM); 402 return ERR_PTR(-ENOMEM);
403} 403}
404 404
405static void __devinit wsp_pci_dma_dev_setup(struct pci_dev *pdev) 405static void wsp_pci_dma_dev_setup(struct pci_dev *pdev)
406{ 406{
407 struct dev_archdata *archdata = &pdev->dev.archdata; 407 struct dev_archdata *archdata = &pdev->dev.archdata;
408 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 408 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
index b3fbb271be8..d9130630f7e 100644
--- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
+++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
@@ -30,7 +30,7 @@
30#define DRIVER_NAME "bestcomm-core" 30#define DRIVER_NAME "bestcomm-core"
31 31
32/* MPC5200 device tree match tables */ 32/* MPC5200 device tree match tables */
33static struct of_device_id mpc52xx_sram_ids[] __devinitdata = { 33static struct of_device_id mpc52xx_sram_ids[] = {
34 { .compatible = "fsl,mpc5200-sram", }, 34 { .compatible = "fsl,mpc5200-sram", },
35 { .compatible = "mpc5200-sram", }, 35 { .compatible = "mpc5200-sram", },
36 {} 36 {}
@@ -273,8 +273,7 @@ static u32 fdt_ops[] = {
273}; 273};
274 274
275 275
276static int __devinit 276static int bcom_engine_init(void)
277bcom_engine_init(void)
278{ 277{
279 int task; 278 int task;
280 phys_addr_t tdt_pa, ctx_pa, var_pa, fdt_pa; 279 phys_addr_t tdt_pa, ctx_pa, var_pa, fdt_pa;
@@ -365,7 +364,7 @@ bcom_engine_cleanup(void)
365/* OF platform driver */ 364/* OF platform driver */
366/* ======================================================================== */ 365/* ======================================================================== */
367 366
368static int __devinit mpc52xx_bcom_probe(struct platform_device *op) 367static int mpc52xx_bcom_probe(struct platform_device *op)
369{ 368{
370 struct device_node *ofn_sram; 369 struct device_node *ofn_sram;
371 struct resource res_bcom; 370 struct resource res_bcom;
diff --git a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
index d131c8a1cb1..8cf93f029e1 100644
--- a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
+++ b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
@@ -69,7 +69,7 @@ static int __init get_offset_from_cmdline(char *str)
69__setup("cache-sram-size=", get_size_from_cmdline); 69__setup("cache-sram-size=", get_size_from_cmdline);
70__setup("cache-sram-offset=", get_offset_from_cmdline); 70__setup("cache-sram-offset=", get_offset_from_cmdline);
71 71
72static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev) 72static int mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
73{ 73{
74 long rval; 74 long rval;
75 unsigned int rem; 75 unsigned int rem;
@@ -160,7 +160,7 @@ static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
160 return 0; 160 return 0;
161} 161}
162 162
163static int __devexit mpc85xx_l2ctlr_of_remove(struct platform_device *dev) 163static int mpc85xx_l2ctlr_of_remove(struct platform_device *dev)
164{ 164{
165 BUG_ON(!l2ctlr); 165 BUG_ON(!l2ctlr);
166 166
@@ -213,7 +213,7 @@ static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = {
213 .of_match_table = mpc85xx_l2ctlr_of_match, 213 .of_match_table = mpc85xx_l2ctlr_of_match,
214 }, 214 },
215 .probe = mpc85xx_l2ctlr_of_probe, 215 .probe = mpc85xx_l2ctlr_of_probe,
216 .remove = __devexit_p(mpc85xx_l2ctlr_of_remove), 216 .remove = mpc85xx_l2ctlr_of_remove,
217}; 217};
218 218
219static __init int mpc85xx_l2ctlr_of_init(void) 219static __init int mpc85xx_l2ctlr_of_init(void)
diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/arch/powerpc/sysdev/fsl_ifc.c
index 097cc9d2585..2a36fd6a958 100644
--- a/arch/powerpc/sysdev/fsl_ifc.c
+++ b/arch/powerpc/sysdev/fsl_ifc.c
@@ -73,7 +73,7 @@ int fsl_ifc_find(phys_addr_t addr_base)
73} 73}
74EXPORT_SYMBOL(fsl_ifc_find); 74EXPORT_SYMBOL(fsl_ifc_find);
75 75
76static int __devinit fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl) 76static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
77{ 77{
78 struct fsl_ifc_regs __iomem *ifc = ctrl->regs; 78 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
79 79
@@ -211,7 +211,7 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
211 * resources for the NAND banks themselves are allocated 211 * resources for the NAND banks themselves are allocated
212 * in the chip probe function. 212 * in the chip probe function.
213*/ 213*/
214static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev) 214static int fsl_ifc_ctrl_probe(struct platform_device *dev)
215{ 215{
216 int ret = 0; 216 int ret = 0;
217 217
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 483126d7b3c..300be2d06a2 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -185,8 +185,8 @@ int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
185} 185}
186EXPORT_SYMBOL(fsl_upm_run_pattern); 186EXPORT_SYMBOL(fsl_upm_run_pattern);
187 187
188static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl, 188static int fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl,
189 struct device_node *node) 189 struct device_node *node)
190{ 190{
191 struct fsl_lbc_regs __iomem *lbc = ctrl->regs; 191 struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
192 192
@@ -273,7 +273,7 @@ static irqreturn_t fsl_lbc_ctrl_irq(int irqno, void *data)
273 * in the chip probe function. 273 * in the chip probe function.
274*/ 274*/
275 275
276static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev) 276static int fsl_lbc_ctrl_probe(struct platform_device *dev)
277{ 277{
278 int ret; 278 int ret;
279 279
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 63c5f04ea58..6e53d97abd3 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -333,9 +333,8 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
333 return 0; 333 return 0;
334} 334}
335 335
336static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi, 336static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
337 struct platform_device *dev, 337 int offset, int irq_index)
338 int offset, int irq_index)
339{ 338{
340 struct fsl_msi_cascade_data *cascade_data = NULL; 339 struct fsl_msi_cascade_data *cascade_data = NULL;
341 int virt_msir; 340 int virt_msir;
@@ -363,7 +362,7 @@ static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi,
363} 362}
364 363
365static const struct of_device_id fsl_of_msi_ids[]; 364static const struct of_device_id fsl_of_msi_ids[];
366static int __devinit fsl_of_msi_probe(struct platform_device *dev) 365static int fsl_of_msi_probe(struct platform_device *dev)
367{ 366{
368 const struct of_device_id *match; 367 const struct of_device_id *match;
369 struct fsl_msi *msi; 368 struct fsl_msi *msi;
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 5ba325bff3a..92a5915b182 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -36,7 +36,7 @@
36 36
37static int fsl_pcie_bus_fixup, is_mpc83xx_pci; 37static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
38 38
39static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev) 39static void quirk_fsl_pcie_header(struct pci_dev *dev)
40{ 40{
41 u8 hdr_type; 41 u8 hdr_type;
42 42
@@ -871,7 +871,7 @@ void fsl_pci_assign_primary(void)
871 } 871 }
872} 872}
873 873
874static int __devinit fsl_pci_probe(struct platform_device *pdev) 874static int fsl_pci_probe(struct platform_device *pdev)
875{ 875{
876 int ret; 876 int ret;
877 struct device_node *node; 877 struct device_node *node;
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 5b6f556094d..e2fb3171f41 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -644,7 +644,7 @@ err_rio_regs:
644 644
645/* The probe function for RapidIO peer-to-peer network. 645/* The probe function for RapidIO peer-to-peer network.
646 */ 646 */
647static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev) 647static int fsl_of_rio_rpn_probe(struct platform_device *dev)
648{ 648{
649 printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n", 649 printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
650 dev->dev.of_node->full_name); 650 dev->dev.of_node->full_name);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9c6e535daad..3b2efd41abf 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1864,7 +1864,7 @@ int __init smp_mpic_probe(void)
1864 return nr_cpus; 1864 return nr_cpus;
1865} 1865}
1866 1866
1867void __devinit smp_mpic_setup_cpu(int cpu) 1867void smp_mpic_setup_cpu(int cpu)
1868{ 1868{
1869 mpic_setup_this_cpu(); 1869 mpic_setup_this_cpu();
1870} 1870}
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index e961f8c4a8f..c75325865a8 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -160,7 +160,7 @@ static int mpic_msgr_block_number(struct device_node *node)
160 160
161/* The probe function for a single message register block. 161/* The probe function for a single message register block.
162 */ 162 */
163static __devinit int mpic_msgr_probe(struct platform_device *dev) 163static int mpic_msgr_probe(struct platform_device *dev)
164{ 164{
165 void __iomem *msgr_block_addr; 165 void __iomem *msgr_block_addr;
166 int block_number; 166 int block_number;
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 364b14d4754..330d56613c5 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -104,7 +104,7 @@ subsys_initcall(mv64x60_sysfs_init);
104 104
105#endif /* CONFIG_SYSFS */ 105#endif /* CONFIG_SYSFS */
106 106
107static void __devinit mv64x60_pci_fixup_early(struct pci_dev *dev) 107static void mv64x60_pci_fixup_early(struct pci_dev *dev)
108{ 108{
109 /* 109 /*
110 * Set the host bridge hdr_type to an invalid value so that 110 * Set the host bridge hdr_type to an invalid value so that
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c
index 82c6702dcba..43948da837a 100644
--- a/arch/powerpc/sysdev/ppc4xx_msi.c
+++ b/arch/powerpc/sysdev/ppc4xx_msi.c
@@ -220,7 +220,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev)
220 return 0; 220 return 0;
221} 221}
222 222
223static int __devinit ppc4xx_msi_probe(struct platform_device *dev) 223static int ppc4xx_msi_probe(struct platform_device *dev)
224{ 224{
225 struct ppc4xx_msi *msi; 225 struct ppc4xx_msi *msi;
226 struct resource res; 226 struct resource res;
diff --git a/arch/s390/include/asm/dma.h b/arch/s390/include/asm/dma.h
index de015d85e3e..bb9bdcd2086 100644
--- a/arch/s390/include/asm/dma.h
+++ b/arch/s390/include/asm/dma.h
@@ -10,4 +10,10 @@
10 */ 10 */
11#define MAX_DMA_ADDRESS 0x80000000 11#define MAX_DMA_ADDRESS 0x80000000
12 12
13#ifdef CONFIG_PCI
14extern int isa_dma_bridge_buggy;
15#else
16#define isa_dma_bridge_buggy (0)
17#endif
18
13#endif /* _ASM_S390_DMA_H */ 19#endif /* _ASM_S390_DMA_H */
diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index 16c3eb164f4..27cb32185ce 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -85,6 +85,11 @@ static inline void iounmap(volatile void __iomem *addr)
85#define __raw_writel zpci_write_u32 85#define __raw_writel zpci_write_u32
86#define __raw_writeq zpci_write_u64 86#define __raw_writeq zpci_write_u64
87 87
88#define readb_relaxed readb
89#define readw_relaxed readw
90#define readl_relaxed readl
91#define readq_relaxed readq
92
88#endif /* CONFIG_PCI */ 93#endif /* CONFIG_PCI */
89 94
90#include <asm-generic/io.h> 95#include <asm-generic/io.h>
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h
index e6972f85d2b..7def77302d6 100644
--- a/arch/s390/include/asm/irq.h
+++ b/arch/s390/include/asm/irq.h
@@ -2,43 +2,61 @@
2#define _ASM_IRQ_H 2#define _ASM_IRQ_H
3 3
4#include <linux/hardirq.h> 4#include <linux/hardirq.h>
5#include <linux/percpu.h>
6#include <linux/cache.h>
5#include <linux/types.h> 7#include <linux/types.h>
6 8
7enum interruption_class { 9enum interruption_main_class {
8 EXTERNAL_INTERRUPT, 10 EXTERNAL_INTERRUPT,
9 IO_INTERRUPT, 11 IO_INTERRUPT,
10 EXTINT_CLK, 12 NR_IRQS
11 EXTINT_EXC, 13};
12 EXTINT_EMS, 14
13 EXTINT_TMR, 15enum interruption_class {
14 EXTINT_TLA, 16 IRQEXT_CLK,
15 EXTINT_PFL, 17 IRQEXT_EXC,
16 EXTINT_DSD, 18 IRQEXT_EMS,
17 EXTINT_VRT, 19 IRQEXT_TMR,
18 EXTINT_SCP, 20 IRQEXT_TLA,
19 EXTINT_IUC, 21 IRQEXT_PFL,
20 EXTINT_CMS, 22 IRQEXT_DSD,
21 EXTINT_CMC, 23 IRQEXT_VRT,
22 EXTINT_CMR, 24 IRQEXT_SCP,
23 IOINT_CIO, 25 IRQEXT_IUC,
24 IOINT_QAI, 26 IRQEXT_CMS,
25 IOINT_DAS, 27 IRQEXT_CMC,
26 IOINT_C15, 28 IRQEXT_CMR,
27 IOINT_C70, 29 IRQIO_CIO,
28 IOINT_TAP, 30 IRQIO_QAI,
29 IOINT_VMR, 31 IRQIO_DAS,
30 IOINT_LCS, 32 IRQIO_C15,
31 IOINT_CLW, 33 IRQIO_C70,
32 IOINT_CTC, 34 IRQIO_TAP,
33 IOINT_APB, 35 IRQIO_VMR,
34 IOINT_ADM, 36 IRQIO_LCS,
35 IOINT_CSC, 37 IRQIO_CLW,
36 IOINT_PCI, 38 IRQIO_CTC,
37 IOINT_MSI, 39 IRQIO_APB,
40 IRQIO_ADM,
41 IRQIO_CSC,
42 IRQIO_PCI,
43 IRQIO_MSI,
38 NMI_NMI, 44 NMI_NMI,
39 NR_IRQS, 45 CPU_RST,
46 NR_ARCH_IRQS
40}; 47};
41 48
49struct irq_stat {
50 unsigned int irqs[NR_ARCH_IRQS];
51};
52
53DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
54
55static __always_inline void inc_irq_stat(enum interruption_class irq)
56{
57 __get_cpu_var(irq_stat).irqs[irq]++;
58}
59
42struct ext_code { 60struct ext_code {
43 unsigned short subcode; 61 unsigned short subcode;
44 unsigned short code; 62 unsigned short code;
diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h
index 63e6078699f..864f693c237 100644
--- a/arch/s390/include/uapi/asm/unistd.h
+++ b/arch/s390/include/uapi/asm/unistd.h
@@ -279,7 +279,8 @@
279#define __NR_process_vm_writev 341 279#define __NR_process_vm_writev 341
280#define __NR_s390_runtime_instr 342 280#define __NR_s390_runtime_instr 342
281#define __NR_kcmp 343 281#define __NR_kcmp 343
282#define NR_syscalls 344 282#define __NR_finit_module 344
283#define NR_syscalls 345
283 284
284/* 285/*
285 * There are some system calls that are not present on 64 bit, some 286 * There are some system calls that are not present on 64 bit, some
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 827e094a2f4..9b9a805656b 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1659,3 +1659,9 @@ ENTRY(sys_kcmp_wrapper)
1659 llgfr %r5,%r5 # unsigned long 1659 llgfr %r5,%r5 # unsigned long
1660 llgfr %r6,%r6 # unsigned long 1660 llgfr %r6,%r6 # unsigned long
1661 jg sys_kcmp 1661 jg sys_kcmp
1662
1663ENTRY(sys_finit_module_wrapper)
1664 lgfr %r2,%r2 # int
1665 llgtr %r3,%r3 # const char __user *
1666 lgfr %r4,%r4 # int
1667 jg sys_finit_module
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index ba500d8dc39..4e8215e0d4b 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -1127,13 +1127,14 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
1127 if (i == DEBUG_MAX_VIEWS) { 1127 if (i == DEBUG_MAX_VIEWS) {
1128 pr_err("Registering view %s/%s would exceed the maximum " 1128 pr_err("Registering view %s/%s would exceed the maximum "
1129 "number of views %i\n", id->name, view->name, i); 1129 "number of views %i\n", id->name, view->name, i);
1130 debugfs_remove(pde);
1131 rc = -1; 1130 rc = -1;
1132 } else { 1131 } else {
1133 id->views[i] = view; 1132 id->views[i] = view;
1134 id->debugfs_entries[i] = pde; 1133 id->debugfs_entries[i] = pde;
1135 } 1134 }
1136 spin_unlock_irqrestore(&id->lock, flags); 1135 spin_unlock_irqrestore(&id->lock, flags);
1136 if (rc)
1137 debugfs_remove(pde);
1137out: 1138out:
1138 return rc; 1139 return rc;
1139} 1140}
@@ -1146,9 +1147,9 @@ EXPORT_SYMBOL(debug_register_view);
1146int 1147int
1147debug_unregister_view(debug_info_t * id, struct debug_view *view) 1148debug_unregister_view(debug_info_t * id, struct debug_view *view)
1148{ 1149{
1149 int rc = 0; 1150 struct dentry *dentry = NULL;
1150 int i;
1151 unsigned long flags; 1151 unsigned long flags;
1152 int i, rc = 0;
1152 1153
1153 if (!id) 1154 if (!id)
1154 goto out; 1155 goto out;
@@ -1160,10 +1161,12 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view)
1160 if (i == DEBUG_MAX_VIEWS) 1161 if (i == DEBUG_MAX_VIEWS)
1161 rc = -1; 1162 rc = -1;
1162 else { 1163 else {
1163 debugfs_remove(id->debugfs_entries[i]); 1164 dentry = id->debugfs_entries[i];
1164 id->views[i] = NULL; 1165 id->views[i] = NULL;
1166 id->debugfs_entries[i] = NULL;
1165 } 1167 }
1166 spin_unlock_irqrestore(&id->lock, flags); 1168 spin_unlock_irqrestore(&id->lock, flags);
1169 debugfs_remove(dentry);
1167out: 1170out:
1168 return rc; 1171 return rc;
1169} 1172}
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index bf24293970c..9df824ea166 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -24,43 +24,65 @@
24#include <asm/irq.h> 24#include <asm/irq.h>
25#include "entry.h" 25#include "entry.h"
26 26
27DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
28EXPORT_PER_CPU_SYMBOL_GPL(irq_stat);
29
27struct irq_class { 30struct irq_class {
28 char *name; 31 char *name;
29 char *desc; 32 char *desc;
30}; 33};
31 34
32static const struct irq_class intrclass_names[] = { 35/*
36 * The list of "main" irq classes on s390. This is the list of interrrupts
37 * that appear both in /proc/stat ("intr" line) and /proc/interrupts.
38 * Historically only external and I/O interrupts have been part of /proc/stat.
39 * We can't add the split external and I/O sub classes since the first field
40 * in the "intr" line in /proc/stat is supposed to be the sum of all other
41 * fields.
42 * Since the external and I/O interrupt fields are already sums we would end
43 * up with having a sum which accounts each interrupt twice.
44 */
45static const struct irq_class irqclass_main_desc[NR_IRQS] = {
33 [EXTERNAL_INTERRUPT] = {.name = "EXT"}, 46 [EXTERNAL_INTERRUPT] = {.name = "EXT"},
34 [IO_INTERRUPT] = {.name = "I/O"}, 47 [IO_INTERRUPT] = {.name = "I/O"}
35 [EXTINT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, 48};
36 [EXTINT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, 49
37 [EXTINT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, 50/*
38 [EXTINT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, 51 * The list of split external and I/O interrupts that appear only in
39 [EXTINT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, 52 * /proc/interrupts.
40 [EXTINT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, 53 * In addition this list contains non external / I/O events like NMIs.
41 [EXTINT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, 54 */
42 [EXTINT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, 55static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = {
43 [EXTINT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, 56 [IRQEXT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"},
44 [EXTINT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, 57 [IRQEXT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"},
45 [EXTINT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, 58 [IRQEXT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"},
46 [EXTINT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, 59 [IRQEXT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"},
47 [EXTINT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, 60 [IRQEXT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"},
48 [IOINT_CIO] = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, 61 [IRQEXT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"},
49 [IOINT_QAI] = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, 62 [IRQEXT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"},
50 [IOINT_DAS] = {.name = "DAS", .desc = "[I/O] DASD"}, 63 [IRQEXT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"},
51 [IOINT_C15] = {.name = "C15", .desc = "[I/O] 3215"}, 64 [IRQEXT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"},
52 [IOINT_C70] = {.name = "C70", .desc = "[I/O] 3270"}, 65 [IRQEXT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"},
53 [IOINT_TAP] = {.name = "TAP", .desc = "[I/O] Tape"}, 66 [IRQEXT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"},
54 [IOINT_VMR] = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, 67 [IRQEXT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"},
55 [IOINT_LCS] = {.name = "LCS", .desc = "[I/O] LCS"}, 68 [IRQEXT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"},
56 [IOINT_CLW] = {.name = "CLW", .desc = "[I/O] CLAW"}, 69 [IRQIO_CIO] = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"},
57 [IOINT_CTC] = {.name = "CTC", .desc = "[I/O] CTC"}, 70 [IRQIO_QAI] = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"},
58 [IOINT_APB] = {.name = "APB", .desc = "[I/O] AP Bus"}, 71 [IRQIO_DAS] = {.name = "DAS", .desc = "[I/O] DASD"},
59 [IOINT_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, 72 [IRQIO_C15] = {.name = "C15", .desc = "[I/O] 3215"},
60 [IOINT_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, 73 [IRQIO_C70] = {.name = "C70", .desc = "[I/O] 3270"},
61 [IOINT_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, 74 [IRQIO_TAP] = {.name = "TAP", .desc = "[I/O] Tape"},
62 [IOINT_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, 75 [IRQIO_VMR] = {.name = "VMR", .desc = "[I/O] Unit Record Devices"},
76 [IRQIO_LCS] = {.name = "LCS", .desc = "[I/O] LCS"},
77 [IRQIO_CLW] = {.name = "CLW", .desc = "[I/O] CLAW"},
78 [IRQIO_CTC] = {.name = "CTC", .desc = "[I/O] CTC"},
79 [IRQIO_APB] = {.name = "APB", .desc = "[I/O] AP Bus"},
80 [IRQIO_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"},
81 [IRQIO_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"},
82 [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" },
83 [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" },
63 [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, 84 [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"},
85 [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"},
64}; 86};
65 87
66/* 88/*
@@ -68,30 +90,34 @@ static const struct irq_class intrclass_names[] = {
68 */ 90 */
69int show_interrupts(struct seq_file *p, void *v) 91int show_interrupts(struct seq_file *p, void *v)
70{ 92{
71 int i = *(loff_t *) v, j; 93 int irq = *(loff_t *) v;
94 int cpu;
72 95
73 get_online_cpus(); 96 get_online_cpus();
74 if (i == 0) { 97 if (irq == 0) {
75 seq_puts(p, " "); 98 seq_puts(p, " ");
76 for_each_online_cpu(j) 99 for_each_online_cpu(cpu)
77 seq_printf(p, "CPU%d ",j); 100 seq_printf(p, "CPU%d ", cpu);
78 seq_putc(p, '\n'); 101 seq_putc(p, '\n');
79 } 102 }
80 103 if (irq < NR_IRQS) {
81 if (i < NR_IRQS) { 104 seq_printf(p, "%s: ", irqclass_main_desc[irq].name);
82 seq_printf(p, "%s: ", intrclass_names[i].name); 105 for_each_online_cpu(cpu)
83#ifndef CONFIG_SMP 106 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[irq]);
84 seq_printf(p, "%10u ", kstat_irqs(i)); 107 seq_putc(p, '\n');
85#else 108 goto skip_arch_irqs;
86 for_each_online_cpu(j) 109 }
87 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 110 for (irq = 0; irq < NR_ARCH_IRQS; irq++) {
88#endif 111 seq_printf(p, "%s: ", irqclass_sub_desc[irq].name);
89 if (intrclass_names[i].desc) 112 for_each_online_cpu(cpu)
90 seq_printf(p, " %s", intrclass_names[i].desc); 113 seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).irqs[irq]);
91 seq_putc(p, '\n'); 114 if (irqclass_sub_desc[irq].desc)
92 } 115 seq_printf(p, " %s", irqclass_sub_desc[irq].desc);
116 seq_putc(p, '\n');
117 }
118skip_arch_irqs:
93 put_online_cpus(); 119 put_online_cpus();
94 return 0; 120 return 0;
95} 121}
96 122
97/* 123/*
@@ -222,7 +248,7 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code,
222 /* Serve timer interrupts first. */ 248 /* Serve timer interrupts first. */
223 clock_comparator_work(); 249 clock_comparator_work();
224 } 250 }
225 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 251 kstat_incr_irqs_this_cpu(EXTERNAL_INTERRUPT, NULL);
226 if (ext_code.code != 0x1004) 252 if (ext_code.code != 0x1004)
227 __get_cpu_var(s390_idle).nohz_delay = 1; 253 __get_cpu_var(s390_idle).nohz_delay = 1;
228 254
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index a6daa5c5cdb..7918fbea36b 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -254,7 +254,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
254 int umode; 254 int umode;
255 255
256 nmi_enter(); 256 nmi_enter();
257 kstat_cpu(smp_processor_id()).irqs[NMI_NMI]++; 257 inc_irq_stat(NMI_NMI);
258 mci = (struct mci *) &S390_lowcore.mcck_interruption_code; 258 mci = (struct mci *) &S390_lowcore.mcck_interruption_code;
259 mcck = &__get_cpu_var(cpu_mcck); 259 mcck = &__get_cpu_var(cpu_mcck);
260 umode = user_mode(regs); 260 umode = user_mode(regs);
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index c4e7269d4a0..86ec7447e1f 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -229,7 +229,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code,
229 if (!(alert & CPU_MF_INT_CF_MASK)) 229 if (!(alert & CPU_MF_INT_CF_MASK))
230 return; 230 return;
231 231
232 kstat_cpu(smp_processor_id()).irqs[EXTINT_CMC]++; 232 inc_irq_stat(IRQEXT_CMC);
233 cpuhw = &__get_cpu_var(cpu_hw_events); 233 cpuhw = &__get_cpu_var(cpu_hw_events);
234 234
235 /* Measurement alerts are shared and might happen when the PMU 235 /* Measurement alerts are shared and might happen when the PMU
diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c
index 61066f6f71a..077a99389b0 100644
--- a/arch/s390/kernel/runtime_instr.c
+++ b/arch/s390/kernel/runtime_instr.c
@@ -71,7 +71,7 @@ static void runtime_instr_int_handler(struct ext_code ext_code,
71 if (!(param32 & CPU_MF_INT_RI_MASK)) 71 if (!(param32 & CPU_MF_INT_RI_MASK))
72 return; 72 return;
73 73
74 kstat_cpu(smp_processor_id()).irqs[EXTINT_CMR]++; 74 inc_irq_stat(IRQEXT_CMR);
75 75
76 if (!current->thread.ri_cb) 76 if (!current->thread.ri_cb)
77 return; 77 return;
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 2568590973a..a5360de85ec 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -16,7 +16,7 @@
16#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 16#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
17 17
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/module.h> 19#include <linux/export.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/memblock.h> 22#include <linux/memblock.h>
@@ -289,6 +289,7 @@ void machine_power_off(void)
289 * Dummy power off function. 289 * Dummy power off function.
290 */ 290 */
291void (*pm_power_off)(void) = machine_power_off; 291void (*pm_power_off)(void) = machine_power_off;
292EXPORT_SYMBOL_GPL(pm_power_off);
292 293
293static int __init early_parse_mem(char *p) 294static int __init early_parse_mem(char *p)
294{ 295{
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index ea431e551c6..7433a2f9e5c 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -433,9 +433,9 @@ static void do_ext_call_interrupt(struct ext_code ext_code,
433 433
434 cpu = smp_processor_id(); 434 cpu = smp_processor_id();
435 if (ext_code.code == 0x1202) 435 if (ext_code.code == 0x1202)
436 kstat_cpu(cpu).irqs[EXTINT_EXC]++; 436 inc_irq_stat(IRQEXT_EXC);
437 else 437 else
438 kstat_cpu(cpu).irqs[EXTINT_EMS]++; 438 inc_irq_stat(IRQEXT_EMS);
439 /* 439 /*
440 * handle bit signal external calls 440 * handle bit signal external calls
441 */ 441 */
@@ -623,9 +623,9 @@ static struct sclp_cpu_info *smp_get_cpu_info(void)
623 return info; 623 return info;
624} 624}
625 625
626static int __devinit smp_add_present_cpu(int cpu); 626static int __cpuinit smp_add_present_cpu(int cpu);
627 627
628static int __devinit __smp_rescan_cpus(struct sclp_cpu_info *info, 628static int __cpuinit __smp_rescan_cpus(struct sclp_cpu_info *info,
629 int sysfs_add) 629 int sysfs_add)
630{ 630{
631 struct pcpu *pcpu; 631 struct pcpu *pcpu;
@@ -709,6 +709,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
709 pfault_init(); 709 pfault_init();
710 notify_cpu_starting(smp_processor_id()); 710 notify_cpu_starting(smp_processor_id());
711 set_cpu_online(smp_processor_id(), true); 711 set_cpu_online(smp_processor_id(), true);
712 inc_irq_stat(CPU_RST);
712 local_irq_enable(); 713 local_irq_enable();
713 /* cpu_idle will call schedule for us */ 714 /* cpu_idle will call schedule for us */
714 cpu_idle(); 715 cpu_idle();
@@ -986,7 +987,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,
986 return notifier_from_errno(err); 987 return notifier_from_errno(err);
987} 988}
988 989
989static int __devinit smp_add_present_cpu(int cpu) 990static int __cpuinit smp_add_present_cpu(int cpu)
990{ 991{
991 struct cpu *c = &pcpu_devices[cpu].cpu; 992 struct cpu *c = &pcpu_devices[cpu].cpu;
992 struct device *s = &c->dev; 993 struct device *s = &c->dev;
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 48174850f3b..6a6c61f94dd 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -352,3 +352,4 @@ SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv_wr
352SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper) 352SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper)
353SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper) 353SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper)
354SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper) 354SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper)
355SYSCALL(sys_finit_module,sys_finit_module,sys_finit_module_wrapper)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 7fcd690d42c..aff0e350d77 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -168,7 +168,7 @@ static void clock_comparator_interrupt(struct ext_code ext_code,
168 unsigned int param32, 168 unsigned int param32,
169 unsigned long param64) 169 unsigned long param64)
170{ 170{
171 kstat_cpu(smp_processor_id()).irqs[EXTINT_CLK]++; 171 inc_irq_stat(IRQEXT_CLK);
172 if (S390_lowcore.clock_comparator == -1ULL) 172 if (S390_lowcore.clock_comparator == -1ULL)
173 set_clock_comparator(S390_lowcore.clock_comparator); 173 set_clock_comparator(S390_lowcore.clock_comparator);
174} 174}
@@ -179,7 +179,7 @@ static void stp_timing_alert(struct stp_irq_parm *);
179static void timing_alert_interrupt(struct ext_code ext_code, 179static void timing_alert_interrupt(struct ext_code ext_code,
180 unsigned int param32, unsigned long param64) 180 unsigned int param32, unsigned long param64)
181{ 181{
182 kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++; 182 inc_irq_stat(IRQEXT_TLA);
183 if (param32 & 0x00c40000) 183 if (param32 & 0x00c40000)
184 etr_timing_alert((struct etr_irq_parm *) &param32); 184 etr_timing_alert((struct etr_irq_parm *) &param32);
185 if (param32 & 0x00038000) 185 if (param32 & 0x00038000)
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index f1aba87cceb..4b2e3e31700 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -10,6 +10,7 @@
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/cpuset.h> 11#include <linux/cpuset.h>
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/export.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/init.h> 16#include <linux/init.h>
@@ -42,6 +43,7 @@ static struct mask_info socket_info;
42static struct mask_info book_info; 43static struct mask_info book_info;
43 44
44struct cpu_topology_s390 cpu_topology[NR_CPUS]; 45struct cpu_topology_s390 cpu_topology[NR_CPUS];
46EXPORT_SYMBOL_GPL(cpu_topology);
45 47
46static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) 48static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
47{ 49{
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 42601d6e166..2fb9e63b8fc 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -569,7 +569,7 @@ static void pfault_interrupt(struct ext_code ext_code,
569 subcode = ext_code.subcode; 569 subcode = ext_code.subcode;
570 if ((subcode & 0xff00) != __SUBCODE_MASK) 570 if ((subcode & 0xff00) != __SUBCODE_MASK)
571 return; 571 return;
572 kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++; 572 inc_irq_stat(IRQEXT_PFL);
573 /* Get the token (= pid of the affected task). */ 573 /* Get the token (= pid of the affected task). */
574 pid = sizeof(void *) == 4 ? param32 : param64; 574 pid = sizeof(void *) == 4 ? param32 : param64;
575 rcu_read_lock(); 575 rcu_read_lock();
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index 0cb385da202..b5b2916895e 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -233,7 +233,7 @@ static void hws_ext_handler(struct ext_code ext_code,
233 if (!(param32 & CPU_MF_INT_SF_MASK)) 233 if (!(param32 & CPU_MF_INT_SF_MASK))
234 return; 234 return;
235 235
236 kstat_cpu(smp_processor_id()).irqs[EXTINT_CMS]++; 236 inc_irq_stat(IRQEXT_CMS);
237 atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); 237 atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32);
238 238
239 if (hws_wq) 239 if (hws_wq)
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 8fa416b8775..60e0372545d 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -160,35 +160,6 @@ int pci_proc_domain(struct pci_bus *bus)
160} 160}
161EXPORT_SYMBOL_GPL(pci_proc_domain); 161EXPORT_SYMBOL_GPL(pci_proc_domain);
162 162
163/* Store PCI function information block */
164static int zpci_store_fib(struct zpci_dev *zdev, u8 *fc)
165{
166 struct zpci_fib *fib;
167 u8 status, cc;
168
169 fib = (void *) get_zeroed_page(GFP_KERNEL);
170 if (!fib)
171 return -ENOMEM;
172
173 do {
174 cc = __stpcifc(zdev->fh, 0, fib, &status);
175 if (cc == 2) {
176 msleep(ZPCI_INSN_BUSY_DELAY);
177 memset(fib, 0, PAGE_SIZE);
178 }
179 } while (cc == 2);
180
181 if (cc)
182 pr_err_once("%s: cc: %u status: %u\n",
183 __func__, cc, status);
184
185 /* Return PCI function controls */
186 *fc = fib->fc;
187
188 free_page((unsigned long) fib);
189 return (cc) ? -EIO : 0;
190}
191
192/* Modify PCI: Register adapter interruptions */ 163/* Modify PCI: Register adapter interruptions */
193static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb, 164static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb,
194 u64 aibv) 165 u64 aibv)
@@ -385,7 +356,7 @@ unsigned int probe_irq_mask(unsigned long val)
385} 356}
386EXPORT_SYMBOL_GPL(probe_irq_mask); 357EXPORT_SYMBOL_GPL(probe_irq_mask);
387 358
388void __devinit pcibios_fixup_bus(struct pci_bus *bus) 359void pcibios_fixup_bus(struct pci_bus *bus)
389{ 360{
390} 361}
391 362
@@ -469,7 +440,7 @@ static void zpci_irq_handler(void *dont, void *need)
469 int rescan = 0, max = aisb_max; 440 int rescan = 0, max = aisb_max;
470 struct zdev_irq_map *imap; 441 struct zdev_irq_map *imap;
471 442
472 kstat_cpu(smp_processor_id()).irqs[IOINT_PCI]++; 443 inc_irq_stat(IRQIO_PCI);
473 sbit = start; 444 sbit = start;
474 445
475scan: 446scan:
@@ -481,7 +452,7 @@ scan:
481 /* find vector bit */ 452 /* find vector bit */
482 imap = bucket->imap[sbit]; 453 imap = bucket->imap[sbit];
483 for_each_set_bit_left(mbit, &imap->aibv, imap->msi_vecs) { 454 for_each_set_bit_left(mbit, &imap->aibv, imap->msi_vecs) {
484 kstat_cpu(smp_processor_id()).irqs[IOINT_MSI]++; 455 inc_irq_stat(IRQIO_MSI);
485 clear_bit(63 - mbit, &imap->aibv); 456 clear_bit(63 - mbit, &imap->aibv);
486 457
487 spin_lock(&imap->lock); 458 spin_lock(&imap->lock);
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index 6138468b420..a547419907c 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -13,8 +13,6 @@
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <asm/pci_dma.h> 14#include <asm/pci_dma.h>
15 15
16static enum zpci_ioat_dtype zpci_ioat_dt = ZPCI_IOTA_RTTO;
17
18static struct kmem_cache *dma_region_table_cache; 16static struct kmem_cache *dma_region_table_cache;
19static struct kmem_cache *dma_page_table_cache; 17static struct kmem_cache *dma_page_table_cache;
20 18
diff --git a/arch/score/mm/cache.c b/arch/score/mm/cache.c
index b25e9574360..f85ec1a7c88 100644
--- a/arch/score/mm/cache.c
+++ b/arch/score/mm/cache.c
@@ -113,7 +113,7 @@ static inline void setup_protection_map(void)
113 protection_map[15] = PAGE_SHARED; 113 protection_map[15] = PAGE_SHARED;
114} 114}
115 115
116void __devinit cpu_cache_init(void) 116void cpu_cache_init(void)
117{ 117{
118 setup_protection_map(); 118 setup_protection_map();
119} 119}
diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
index a5fe1b54c95..d6cde700e31 100644
--- a/arch/sh/drivers/pci/fixups-dreamcast.c
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c
@@ -28,7 +28,7 @@
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <mach/pci.h> 29#include <mach/pci.h>
30 30
31static void __devinit gapspci_fixup_resources(struct pci_dev *dev) 31static void gapspci_fixup_resources(struct pci_dev *dev)
32{ 32{
33 struct pci_channel *p = dev->sysdata; 33 struct pci_channel *p = dev->sysdata;
34 34
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 81e5dafed3e..102f5d58b03 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -32,7 +32,7 @@ static struct pci_channel *hose_head, **hose_tail = &hose_head;
32 32
33static int pci_initialized; 33static int pci_initialized;
34 34
35static void __devinit pcibios_scanbus(struct pci_channel *hose) 35static void pcibios_scanbus(struct pci_channel *hose)
36{ 36{
37 static int next_busno; 37 static int next_busno;
38 static int need_domain_info; 38 static int need_domain_info;
@@ -82,7 +82,7 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)
82DEFINE_RAW_SPINLOCK(pci_config_lock); 82DEFINE_RAW_SPINLOCK(pci_config_lock);
83static DEFINE_MUTEX(pci_scan_mutex); 83static DEFINE_MUTEX(pci_scan_mutex);
84 84
85int __devinit register_pci_controller(struct pci_channel *hose) 85int register_pci_controller(struct pci_channel *hose)
86{ 86{
87 int i; 87 int i;
88 88
@@ -156,7 +156,7 @@ subsys_initcall(pcibios_init);
156 * Called after each bus is probed, but before its children 156 * Called after each bus is probed, but before its children
157 * are examined. 157 * are examined.
158 */ 158 */
159void __devinit pcibios_fixup_bus(struct pci_bus *bus) 159void pcibios_fixup_bus(struct pci_bus *bus)
160{ 160{
161} 161}
162 162
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 9e702f2f804..c2c85f6cd73 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -132,7 +132,7 @@ static struct clk fixed_pciexclkp = {
132 .rate = 100000000, /* 100 MHz reference clock */ 132 .rate = 100000000, /* 100 MHz reference clock */
133}; 133};
134 134
135static void __devinit sh7786_pci_fixup(struct pci_dev *dev) 135static void sh7786_pci_fixup(struct pci_dev *dev)
136{ 136{
137 /* 137 /*
138 * Prevent enumeration of root complex resources. 138 * Prevent enumeration of root complex resources.
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
index cb33608cc68..c55291e5b83 100644
--- a/arch/sparc/include/asm/parport.h
+++ b/arch/sparc/include/asm/parport.h
@@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)
103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); 103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
104} 104}
105 105
106static int __devinit ecpp_probe(struct platform_device *op) 106static int ecpp_probe(struct platform_device *op)
107{ 107{
108 unsigned long base = op->resource[0].start; 108 unsigned long base = op->resource[0].start;
109 unsigned long config = op->resource[1].start; 109 unsigned long config = op->resource[1].start;
@@ -192,7 +192,7 @@ out_err:
192 return err; 192 return err;
193} 193}
194 194
195static int __devexit ecpp_remove(struct platform_device *op) 195static int ecpp_remove(struct platform_device *op)
196{ 196{
197 struct parport *p = dev_get_drvdata(&op->dev); 197 struct parport *p = dev_get_drvdata(&op->dev);
198 int slot = p->dma; 198 int slot = p->dma;
@@ -242,7 +242,7 @@ static struct platform_driver ecpp_driver = {
242 .of_match_table = ecpp_match, 242 .of_match_table = ecpp_match,
243 }, 243 },
244 .probe = ecpp_probe, 244 .probe = ecpp_probe,
245 .remove = __devexit_p(ecpp_remove), 245 .remove = ecpp_remove,
246}; 246};
247 247
248static int parport_pc_find_nonpci_ports(int autoirq, int autodma) 248static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h
index ef3c3682deb..01197d8215c 100644
--- a/arch/sparc/include/asm/timer_64.h
+++ b/arch/sparc/include/asm/timer_64.h
@@ -24,7 +24,7 @@ struct sparc64_tick_ops {
24extern struct sparc64_tick_ops *tick_ops; 24extern struct sparc64_tick_ops *tick_ops;
25 25
26extern unsigned long sparc64_get_clock_tick(unsigned int cpu); 26extern unsigned long sparc64_get_clock_tick(unsigned int cpu);
27extern void __devinit setup_sparc64_timer(void); 27extern void setup_sparc64_timer(void);
28extern void __init time_init(void); 28extern void __init time_init(void);
29 29
30#endif /* _SPARC64_TIMER_H */ 30#endif /* _SPARC64_TIMER_H */
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h
index cac719d1bc5..62ced589bcf 100644
--- a/arch/sparc/include/uapi/asm/unistd.h
+++ b/arch/sparc/include/uapi/asm/unistd.h
@@ -407,8 +407,9 @@
407#define __NR_process_vm_writev 339 407#define __NR_process_vm_writev 339
408#define __NR_kern_features 340 408#define __NR_kern_features 340
409#define __NR_kcmp 341 409#define __NR_kcmp 341
410#define __NR_finit_module 342
410 411
411#define NR_syscalls 342 412#define NR_syscalls 343
412 413
413/* Bitmask values returned from kern_features system call. */ 414/* Bitmask values returned from kern_features system call. */
414#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 415#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index 812e10bbb0b..348fa1aeabc 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -31,7 +31,7 @@
31#define APC_DEVNAME "apc" 31#define APC_DEVNAME "apc"
32 32
33static u8 __iomem *regs; 33static u8 __iomem *regs;
34static int apc_no_idle __devinitdata = 0; 34static int apc_no_idle = 0;
35 35
36#define apc_readb(offs) (sbus_readb(regs+offs)) 36#define apc_readb(offs) (sbus_readb(regs+offs))
37#define apc_writeb(val, offs) (sbus_writeb(val, regs+offs)) 37#define apc_writeb(val, offs) (sbus_writeb(val, regs+offs))
@@ -138,7 +138,7 @@ static const struct file_operations apc_fops = {
138 138
139static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops }; 139static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
140 140
141static int __devinit apc_probe(struct platform_device *op) 141static int apc_probe(struct platform_device *op)
142{ 142{
143 int err; 143 int err;
144 144
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 773091ac71a..86e55778e4a 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -102,7 +102,7 @@ static const struct of_device_id auxio_match[] = {
102 102
103MODULE_DEVICE_TABLE(of, auxio_match); 103MODULE_DEVICE_TABLE(of, auxio_match);
104 104
105static int __devinit auxio_probe(struct platform_device *dev) 105static int auxio_probe(struct platform_device *dev)
106{ 106{
107 struct device_node *dp = dev->dev.of_node; 107 struct device_node *dp = dev->dev.of_node;
108 unsigned long size; 108 unsigned long size;
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index 9708851a8b9..052b5a44318 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -33,7 +33,7 @@ struct fhc {
33 struct platform_device leds_pdev; 33 struct platform_device leds_pdev;
34}; 34};
35 35
36static int __devinit clock_board_calc_nslots(struct clock_board *p) 36static int clock_board_calc_nslots(struct clock_board *p)
37{ 37{
38 u8 reg = upa_readb(p->clock_regs + CLOCK_STAT1) & 0xc0; 38 u8 reg = upa_readb(p->clock_regs + CLOCK_STAT1) & 0xc0;
39 39
@@ -60,7 +60,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
60 } 60 }
61} 61}
62 62
63static int __devinit clock_board_probe(struct platform_device *op) 63static int clock_board_probe(struct platform_device *op)
64{ 64{
65 struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL); 65 struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
66 int err = -ENOMEM; 66 int err = -ENOMEM;
@@ -157,7 +157,7 @@ static struct platform_driver clock_board_driver = {
157 }, 157 },
158}; 158};
159 159
160static int __devinit fhc_probe(struct platform_device *op) 160static int fhc_probe(struct platform_device *op)
161{ 161{
162 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL); 162 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
163 int err = -ENOMEM; 163 int err = -ENOMEM;
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 5f450260981..dbb210d74e2 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -336,9 +336,9 @@ static int jbusmc_print_dimm(int syndrome_code,
336 return 0; 336 return 0;
337} 337}
338 338
339static u64 __devinit jbusmc_dimm_group_size(u64 base, 339static u64 jbusmc_dimm_group_size(u64 base,
340 const struct linux_prom64_registers *mem_regs, 340 const struct linux_prom64_registers *mem_regs,
341 int num_mem_regs) 341 int num_mem_regs)
342{ 342{
343 u64 max = base + (8UL * 1024 * 1024 * 1024); 343 u64 max = base + (8UL * 1024 * 1024 * 1024);
344 u64 max_seen = base; 344 u64 max_seen = base;
@@ -363,10 +363,10 @@ static u64 __devinit jbusmc_dimm_group_size(u64 base,
363 return max_seen - base; 363 return max_seen - base;
364} 364}
365 365
366static void __devinit jbusmc_construct_one_dimm_group(struct jbusmc *p, 366static void jbusmc_construct_one_dimm_group(struct jbusmc *p,
367 unsigned long index, 367 unsigned long index,
368 const struct linux_prom64_registers *mem_regs, 368 const struct linux_prom64_registers *mem_regs,
369 int num_mem_regs) 369 int num_mem_regs)
370{ 370{
371 struct jbusmc_dimm_group *dp = &p->dimm_groups[index]; 371 struct jbusmc_dimm_group *dp = &p->dimm_groups[index];
372 372
@@ -378,9 +378,9 @@ static void __devinit jbusmc_construct_one_dimm_group(struct jbusmc *p,
378 dp->size = jbusmc_dimm_group_size(dp->base_addr, mem_regs, num_mem_regs); 378 dp->size = jbusmc_dimm_group_size(dp->base_addr, mem_regs, num_mem_regs);
379} 379}
380 380
381static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p, 381static void jbusmc_construct_dimm_groups(struct jbusmc *p,
382 const struct linux_prom64_registers *mem_regs, 382 const struct linux_prom64_registers *mem_regs,
383 int num_mem_regs) 383 int num_mem_regs)
384{ 384{
385 if (p->mc_reg_1 & JB_MC_REG1_DIMM1_BANK0) { 385 if (p->mc_reg_1 & JB_MC_REG1_DIMM1_BANK0) {
386 jbusmc_construct_one_dimm_group(p, 0, mem_regs, num_mem_regs); 386 jbusmc_construct_one_dimm_group(p, 0, mem_regs, num_mem_regs);
@@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
392 } 392 }
393} 393}
394 394
395static int __devinit jbusmc_probe(struct platform_device *op) 395static int jbusmc_probe(struct platform_device *op)
396{ 396{
397 const struct linux_prom64_registers *mem_regs; 397 const struct linux_prom64_registers *mem_regs;
398 struct device_node *mem_node; 398 struct device_node *mem_node;
@@ -689,7 +689,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
689 chmc_read_mcreg(p, CHMCTRL_DECODE4)); 689 chmc_read_mcreg(p, CHMCTRL_DECODE4));
690} 690}
691 691
692static int __devinit chmc_probe(struct platform_device *op) 692static int chmc_probe(struct platform_device *op)
693{ 693{
694 struct device_node *dp = op->dev.of_node; 694 struct device_node *dp = op->dev.of_node;
695 unsigned long ver; 695 unsigned long ver;
@@ -763,7 +763,7 @@ out_free:
763 goto out; 763 goto out;
764} 764}
765 765
766static int __devinit us3mc_probe(struct platform_device *op) 766static int us3mc_probe(struct platform_device *op)
767{ 767{
768 if (mc_type == MC_TYPE_SAFARI) 768 if (mc_type == MC_TYPE_SAFARI)
769 return chmc_probe(op); 769 return chmc_probe(op);
@@ -772,21 +772,21 @@ static int __devinit us3mc_probe(struct platform_device *op)
772 return -ENODEV; 772 return -ENODEV;
773} 773}
774 774
775static void __devexit chmc_destroy(struct platform_device *op, struct chmc *p) 775static void chmc_destroy(struct platform_device *op, struct chmc *p)
776{ 776{
777 list_del(&p->list); 777 list_del(&p->list);
778 of_iounmap(&op->resource[0], p->regs, 0x48); 778 of_iounmap(&op->resource[0], p->regs, 0x48);
779 kfree(p); 779 kfree(p);
780} 780}
781 781
782static void __devexit jbusmc_destroy(struct platform_device *op, struct jbusmc *p) 782static void jbusmc_destroy(struct platform_device *op, struct jbusmc *p)
783{ 783{
784 mc_list_del(&p->list); 784 mc_list_del(&p->list);
785 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE); 785 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);
786 kfree(p); 786 kfree(p);
787} 787}
788 788
789static int __devexit us3mc_remove(struct platform_device *op) 789static int us3mc_remove(struct platform_device *op)
790{ 790{
791 void *p = dev_get_drvdata(&op->dev); 791 void *p = dev_get_drvdata(&op->dev);
792 792
@@ -814,7 +814,7 @@ static struct platform_driver us3mc_driver = {
814 .of_match_table = us3mc_match, 814 .of_match_table = us3mc_match,
815 }, 815 },
816 .probe = us3mc_probe, 816 .probe = us3mc_probe,
817 .remove = __devexit_p(us3mc_remove), 817 .remove = us3mc_remove,
818}; 818};
819 819
820static inline bool us3mc_platform(void) 820static inline bool us3mc_platform(void)
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index f09257c8610..75bb608c423 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -29,7 +29,7 @@
29#define DRV_MODULE_VERSION "1.0" 29#define DRV_MODULE_VERSION "1.0"
30#define DRV_MODULE_RELDATE "Jul 11, 2007" 30#define DRV_MODULE_RELDATE "Jul 11, 2007"
31 31
32static char version[] __devinitdata = 32static char version[] =
33 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 33 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
34MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); 34MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");
35MODULE_DESCRIPTION("Sun LDOM domain services driver"); 35MODULE_DESCRIPTION("Sun LDOM domain services driver");
@@ -1146,8 +1146,7 @@ static void ds_event(void *arg, int event)
1146 spin_unlock_irqrestore(&ds_lock, flags); 1146 spin_unlock_irqrestore(&ds_lock, flags);
1147} 1147}
1148 1148
1149static int __devinit ds_probe(struct vio_dev *vdev, 1149static int ds_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1150 const struct vio_device_id *id)
1151{ 1150{
1152 static int ds_version_printed; 1151 static int ds_version_printed;
1153 struct ldc_channel_config ds_cfg = { 1152 struct ldc_channel_config ds_cfg = {
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 81d92fc9983..9fcc6b4e93b 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -27,7 +27,7 @@
27#define DRV_MODULE_VERSION "1.1" 27#define DRV_MODULE_VERSION "1.1"
28#define DRV_MODULE_RELDATE "July 22, 2008" 28#define DRV_MODULE_RELDATE "July 22, 2008"
29 29
30static char version[] __devinitdata = 30static char version[] =
31 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 31 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
32#define LDC_PACKET_SIZE 64 32#define LDC_PACKET_SIZE 64
33 33
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c
index fc052116156..852dc843052 100644
--- a/arch/sparc/kernel/leon_pci.c
+++ b/arch/sparc/kernel/leon_pci.c
@@ -43,7 +43,7 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info)
43 } 43 }
44} 44}
45 45
46void __devinit pcibios_fixup_bus(struct pci_bus *pbus) 46void pcibios_fixup_bus(struct pci_bus *pbus)
47{ 47{
48 struct pci_dev *dev; 48 struct pci_dev *dev;
49 int i, has_io, has_mem; 49 int i, has_io, has_mem;
diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c
index b1bc38853a3..fc4320886a3 100644
--- a/arch/sparc/kernel/leon_pci_grpci2.c
+++ b/arch/sparc/kernel/leon_pci_grpci2.c
@@ -668,7 +668,7 @@ static irqreturn_t grpci2_err_interrupt(int irq, void *arg)
668 return IRQ_HANDLED; 668 return IRQ_HANDLED;
669} 669}
670 670
671static int __devinit grpci2_of_probe(struct platform_device *ofdev) 671static int grpci2_of_probe(struct platform_device *ofdev)
672{ 672{
673 struct grpci2_regs *regs; 673 struct grpci2_regs *regs;
674 struct grpci2_priv *priv; 674 struct grpci2_priv *priv;
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 75b31bcdead..baf4366e2d6 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -356,7 +356,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
356 return dev; 356 return dev;
357} 357}
358 358
359static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) 359static void apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)
360{ 360{
361 u32 idx, first, last; 361 u32 idx, first, last;
362 362
@@ -378,9 +378,9 @@ static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)
378/* Cook up fake bus resources for SUNW,simba PCI bridges which lack 378/* Cook up fake bus resources for SUNW,simba PCI bridges which lack
379 * a proper 'ranges' property. 379 * a proper 'ranges' property.
380 */ 380 */
381static void __devinit apb_fake_ranges(struct pci_dev *dev, 381static void apb_fake_ranges(struct pci_dev *dev,
382 struct pci_bus *bus, 382 struct pci_bus *bus,
383 struct pci_pbm_info *pbm) 383 struct pci_pbm_info *pbm)
384{ 384{
385 struct pci_bus_region region; 385 struct pci_bus_region region;
386 struct resource *res; 386 struct resource *res;
@@ -404,15 +404,15 @@ static void __devinit apb_fake_ranges(struct pci_dev *dev,
404 pcibios_bus_to_resource(dev, res, &region); 404 pcibios_bus_to_resource(dev, res, &region);
405} 405}
406 406
407static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, 407static void pci_of_scan_bus(struct pci_pbm_info *pbm,
408 struct device_node *node, 408 struct device_node *node,
409 struct pci_bus *bus); 409 struct pci_bus *bus);
410 410
411#define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) 411#define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1])
412 412
413static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, 413static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
414 struct device_node *node, 414 struct device_node *node,
415 struct pci_dev *dev) 415 struct pci_dev *dev)
416{ 416{
417 struct pci_bus *bus; 417 struct pci_bus *bus;
418 const u32 *busrange, *ranges; 418 const u32 *busrange, *ranges;
@@ -503,9 +503,9 @@ after_ranges:
503 pci_of_scan_bus(pbm, node, bus); 503 pci_of_scan_bus(pbm, node, bus);
504} 504}
505 505
506static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, 506static void pci_of_scan_bus(struct pci_pbm_info *pbm,
507 struct device_node *node, 507 struct device_node *node,
508 struct pci_bus *bus) 508 struct pci_bus *bus)
509{ 509{
510 struct device_node *child; 510 struct device_node *child;
511 const u32 *reg; 511 const u32 *reg;
@@ -564,7 +564,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *
564 564
565static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL); 565static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL);
566 566
567static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) 567static void pci_bus_register_of_sysfs(struct pci_bus *bus)
568{ 568{
569 struct pci_dev *dev; 569 struct pci_dev *dev;
570 struct pci_bus *child_bus; 570 struct pci_bus *child_bus;
@@ -585,8 +585,8 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)
585 pci_bus_register_of_sysfs(child_bus); 585 pci_bus_register_of_sysfs(child_bus);
586} 586}
587 587
588struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, 588struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
589 struct device *parent) 589 struct device *parent)
590{ 590{
591 LIST_HEAD(resources); 591 LIST_HEAD(resources);
592 struct device_node *node = pbm->op->dev.of_node; 592 struct device_node *node = pbm->op->dev.of_node;
@@ -618,7 +618,7 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
618 return bus; 618 return bus;
619} 619}
620 620
621void __devinit pcibios_fixup_bus(struct pci_bus *pbus) 621void pcibios_fixup_bus(struct pci_bus *pbus)
622{ 622{
623} 623}
624 624
@@ -949,8 +949,7 @@ static int __init pcibios_init(void)
949subsys_initcall(pcibios_init); 949subsys_initcall(pcibios_init);
950 950
951#ifdef CONFIG_SYSFS 951#ifdef CONFIG_SYSFS
952static void __devinit pci_bus_slot_names(struct device_node *node, 952static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus)
953 struct pci_bus *bus)
954{ 953{
955 const struct pci_slot_names { 954 const struct pci_slot_names {
956 u32 slot_mask; 955 u32 slot_mask;
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index 188f935276f..e60fc6a67e9 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -408,8 +408,8 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
408 upa_writeq(~(u64)0, pbm->pbm_regs + FIRE_PEC_IENAB); 408 upa_writeq(~(u64)0, pbm->pbm_regs + FIRE_PEC_IENAB);
409} 409}
410 410
411static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, 411static int pci_fire_pbm_init(struct pci_pbm_info *pbm,
412 struct platform_device *op, u32 portid) 412 struct platform_device *op, u32 portid)
413{ 413{
414 const struct linux_prom64_registers *regs; 414 const struct linux_prom64_registers *regs;
415 struct device_node *dp = op->dev.of_node; 415 struct device_node *dp = op->dev.of_node;
@@ -454,7 +454,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
454 return 0; 454 return 0;
455} 455}
456 456
457static int __devinit fire_probe(struct platform_device *op) 457static int fire_probe(struct platform_device *op)
458{ 458{
459 struct device_node *dp = op->dev.of_node; 459 struct device_node *dp = op->dev.of_node;
460 struct pci_pbm_info *pbm; 460 struct pci_pbm_info *pbm;
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c
index f4d29e15ce7..c647634ead2 100644
--- a/arch/sparc/kernel/pci_psycho.c
+++ b/arch/sparc/kernel/pci_psycho.c
@@ -366,8 +366,8 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)
366 pci_config_write8(addr, 64); 366 pci_config_write8(addr, 64);
367} 367}
368 368
369static void __devinit psycho_scan_bus(struct pci_pbm_info *pbm, 369static void psycho_scan_bus(struct pci_pbm_info *pbm,
370 struct device *parent) 370 struct device *parent)
371{ 371{
372 pbm_config_busmastering(pbm); 372 pbm_config_busmastering(pbm);
373 pbm->is_66mhz_capable = 0; 373 pbm->is_66mhz_capable = 0;
@@ -483,15 +483,15 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,
483#define PSYCHO_MEMSPACE_B 0x180000000UL 483#define PSYCHO_MEMSPACE_B 0x180000000UL
484#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL 484#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL
485 485
486static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm, 486static void psycho_pbm_init(struct pci_pbm_info *pbm,
487 struct platform_device *op, int is_pbm_a) 487 struct platform_device *op, int is_pbm_a)
488{ 488{
489 psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO); 489 psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO);
490 psycho_pbm_strbuf_init(pbm, is_pbm_a); 490 psycho_pbm_strbuf_init(pbm, is_pbm_a);
491 psycho_scan_bus(pbm, &op->dev); 491 psycho_scan_bus(pbm, &op->dev);
492} 492}
493 493
494static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid) 494static struct pci_pbm_info *psycho_find_sibling(u32 upa_portid)
495{ 495{
496 struct pci_pbm_info *pbm; 496 struct pci_pbm_info *pbm;
497 497
@@ -504,7 +504,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
504 504
505#define PSYCHO_CONFIGSPACE 0x001000000UL 505#define PSYCHO_CONFIGSPACE 0x001000000UL
506 506
507static int __devinit psycho_probe(struct platform_device *op) 507static int psycho_probe(struct platform_device *op)
508{ 508{
509 const struct linux_prom64_registers *pr_regs; 509 const struct linux_prom64_registers *pr_regs;
510 struct device_node *dp = op->dev.of_node; 510 struct device_node *dp = op->dev.of_node;
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c
index 3efaa4644d6..6f00d27e8da 100644
--- a/arch/sparc/kernel/pci_sabre.c
+++ b/arch/sparc/kernel/pci_sabre.c
@@ -403,8 +403,7 @@ static void apb_init(struct pci_bus *sabre_bus)
403 } 403 }
404} 404}
405 405
406static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm, 406static void sabre_scan_bus(struct pci_pbm_info *pbm, struct device *parent)
407 struct device *parent)
408{ 407{
409 static int once; 408 static int once;
410 409
@@ -443,8 +442,8 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm,
443 sabre_register_error_handlers(pbm); 442 sabre_register_error_handlers(pbm);
444} 443}
445 444
446static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, 445static void sabre_pbm_init(struct pci_pbm_info *pbm,
447 struct platform_device *op) 446 struct platform_device *op)
448{ 447{
449 psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE); 448 psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);
450 pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; 449 pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR;
@@ -454,7 +453,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
454} 453}
455 454
456static const struct of_device_id sabre_match[]; 455static const struct of_device_id sabre_match[];
457static int __devinit sabre_probe(struct platform_device *op) 456static int sabre_probe(struct platform_device *op)
458{ 457{
459 const struct of_device_id *match; 458 const struct of_device_id *match;
460 const struct linux_prom64_registers *pr_regs; 459 const struct linux_prom64_registers *pr_regs;
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c
index 13d4aa20b5a..8f76f23dac3 100644
--- a/arch/sparc/kernel/pci_schizo.c
+++ b/arch/sparc/kernel/pci_schizo.c
@@ -1064,8 +1064,7 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)
1064 pci_config_write8(addr, 64); 1064 pci_config_write8(addr, 64);
1065} 1065}
1066 1066
1067static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm, 1067static void schizo_scan_bus(struct pci_pbm_info *pbm, struct device *parent)
1068 struct device *parent)
1069{ 1068{
1070 pbm_config_busmastering(pbm); 1069 pbm_config_busmastering(pbm);
1071 pbm->is_66mhz_capable = 1070 pbm->is_66mhz_capable =
@@ -1307,9 +1306,9 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
1307 } 1306 }
1308} 1307}
1309 1308
1310static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, 1309static int schizo_pbm_init(struct pci_pbm_info *pbm,
1311 struct platform_device *op, u32 portid, 1310 struct platform_device *op, u32 portid,
1312 int chip_type) 1311 int chip_type)
1313{ 1312{
1314 const struct linux_prom64_registers *regs; 1313 const struct linux_prom64_registers *regs;
1315 struct device_node *dp = op->dev.of_node; 1314 struct device_node *dp = op->dev.of_node;
@@ -1400,8 +1399,7 @@ static inline int portid_compare(u32 x, u32 y, int chip_type)
1400 return (x == y); 1399 return (x == y);
1401} 1400}
1402 1401
1403static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid, 1402static struct pci_pbm_info *schizo_find_sibling(u32 portid, int chip_type)
1404 int chip_type)
1405{ 1403{
1406 struct pci_pbm_info *pbm; 1404 struct pci_pbm_info *pbm;
1407 1405
@@ -1412,7 +1410,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,
1412 return NULL; 1410 return NULL;
1413} 1411}
1414 1412
1415static int __devinit __schizo_init(struct platform_device *op, unsigned long chip_type) 1413static int __schizo_init(struct platform_device *op, unsigned long chip_type)
1416{ 1414{
1417 struct device_node *dp = op->dev.of_node; 1415 struct device_node *dp = op->dev.of_node;
1418 struct pci_pbm_info *pbm; 1416 struct pci_pbm_info *pbm;
@@ -1460,7 +1458,7 @@ out_err:
1460} 1458}
1461 1459
1462static const struct of_device_id schizo_match[]; 1460static const struct of_device_id schizo_match[];
1463static int __devinit schizo_probe(struct platform_device *op) 1461static int schizo_probe(struct platform_device *op)
1464{ 1462{
1465 const struct of_device_id *match; 1463 const struct of_device_id *match;
1466 1464
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 051b69caeff..d07f6b29aed 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -536,8 +536,7 @@ static struct dma_map_ops sun4v_dma_ops = {
536 .unmap_sg = dma_4v_unmap_sg, 536 .unmap_sg = dma_4v_unmap_sg,
537}; 537};
538 538
539static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm, 539static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm, struct device *parent)
540 struct device *parent)
541{ 540{
542 struct property *prop; 541 struct property *prop;
543 struct device_node *dp; 542 struct device_node *dp;
@@ -550,8 +549,8 @@ static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm,
550 /* XXX register error interrupt handlers XXX */ 549 /* XXX register error interrupt handlers XXX */
551} 550}
552 551
553static unsigned long __devinit probe_existing_entries(struct pci_pbm_info *pbm, 552static unsigned long probe_existing_entries(struct pci_pbm_info *pbm,
554 struct iommu *iommu) 553 struct iommu *iommu)
555{ 554{
556 struct iommu_arena *arena = &iommu->arena; 555 struct iommu_arena *arena = &iommu->arena;
557 unsigned long i, cnt = 0; 556 unsigned long i, cnt = 0;
@@ -578,7 +577,7 @@ static unsigned long __devinit probe_existing_entries(struct pci_pbm_info *pbm,
578 return cnt; 577 return cnt;
579} 578}
580 579
581static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) 580static int pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
582{ 581{
583 static const u32 vdma_default[] = { 0x80000000, 0x80000000 }; 582 static const u32 vdma_default[] = { 0x80000000, 0x80000000 };
584 struct iommu *iommu = pbm->iommu; 583 struct iommu *iommu = pbm->iommu;
@@ -879,8 +878,8 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
879} 878}
880#endif /* !(CONFIG_PCI_MSI) */ 879#endif /* !(CONFIG_PCI_MSI) */
881 880
882static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, 881static int pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
883 struct platform_device *op, u32 devhandle) 882 struct platform_device *op, u32 devhandle)
884{ 883{
885 struct device_node *dp = op->dev.of_node; 884 struct device_node *dp = op->dev.of_node;
886 int err; 885 int err;
@@ -919,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
919 return 0; 918 return 0;
920} 919}
921 920
922static int __devinit pci_sun4v_probe(struct platform_device *op) 921static int pci_sun4v_probe(struct platform_device *op)
923{ 922{
924 const struct linux_prom64_registers *regs; 923 const struct linux_prom64_registers *regs;
925 static int hvapi_negotiated = 0; 924 static int hvapi_negotiated = 0;
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 521fdf1b20e..09f4fdd8d80 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -439,8 +439,7 @@ int pcic_present(void)
439 return pcic0_up; 439 return pcic0_up;
440} 440}
441 441
442static int __devinit pdev_to_pnode(struct linux_pbm_info *pbm, 442static int pdev_to_pnode(struct linux_pbm_info *pbm, struct pci_dev *pdev)
443 struct pci_dev *pdev)
444{ 443{
445 struct linux_prom_pci_registers regs[PROMREG_MAX]; 444 struct linux_prom_pci_registers regs[PROMREG_MAX];
446 int err; 445 int err;
@@ -595,7 +594,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node)
595/* 594/*
596 * Normally called from {do_}pci_scan_bus... 595 * Normally called from {do_}pci_scan_bus...
597 */ 596 */
598void __devinit pcibios_fixup_bus(struct pci_bus *bus) 597void pcibios_fixup_bus(struct pci_bus *bus)
599{ 598{
600 struct pci_dev *dev; 599 struct pci_dev *dev;
601 int i, has_io, has_mem; 600 int i, has_io, has_mem;
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c
index 0e3202239ff..dcbb62f6306 100644
--- a/arch/sparc/kernel/pmc.c
+++ b/arch/sparc/kernel/pmc.c
@@ -52,7 +52,7 @@ static void pmc_swift_idle(void)
52#endif 52#endif
53} 53}
54 54
55static int __devinit pmc_probe(struct platform_device *op) 55static int pmc_probe(struct platform_device *op)
56{ 56{
57 regs = of_ioremap(&op->resource[0], 0, 57 regs = of_ioremap(&op->resource[0], 0,
58 resource_size(&op->resource[0]), PMC_OBPNAME); 58 resource_size(&op->resource[0]), PMC_OBPNAME);
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 0d39075063b..4cb23c41553 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -23,7 +23,7 @@ static irqreturn_t power_handler(int irq, void *dev_id)
23 return IRQ_HANDLED; 23 return IRQ_HANDLED;
24} 24}
25 25
26static int __devinit has_button_interrupt(unsigned int irq, struct device_node *dp) 26static int has_button_interrupt(unsigned int irq, struct device_node *dp)
27{ 27{
28 if (irq == 0xffffffff) 28 if (irq == 0xffffffff)
29 return 0; 29 return 0;
@@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
33 return 1; 33 return 1;
34} 34}
35 35
36static int __devinit power_probe(struct platform_device *op) 36static int power_probe(struct platform_device *op)
37{ 37{
38 struct resource *res = &op->resource[0]; 38 struct resource *res = &op->resource[0];
39 unsigned int irq = op->archdata.irqs[0]; 39 unsigned int irq = op->archdata.irqs[0];
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index d94b878577b..537eb66abd0 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1180,7 +1180,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1180{ 1180{
1181} 1181}
1182 1182
1183void __devinit smp_prepare_boot_cpu(void) 1183void smp_prepare_boot_cpu(void)
1184{ 1184{
1185} 1185}
1186 1186
@@ -1194,7 +1194,7 @@ void __init smp_setup_processor_id(void)
1194 xcall_deliver_impl = hypervisor_xcall_deliver; 1194 xcall_deliver_impl = hypervisor_xcall_deliver;
1195} 1195}
1196 1196
1197void __devinit smp_fill_in_sib_core_maps(void) 1197void smp_fill_in_sib_core_maps(void)
1198{ 1198{
1199 unsigned int i; 1199 unsigned int i;
1200 1200
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 5147f574f12..6ac43c36bbb 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -85,4 +85,4 @@ sys_call_table:
85/*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init 85/*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
86/*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime 86/*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
87/*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev 87/*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
88/*340*/ .long sys_ni_syscall, sys_kcmp 88/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index cdbd9b81775..1009ecb9267 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -86,7 +86,7 @@ sys_call_table32:
86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init 86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init
87/*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime 87/*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
88 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev 88 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
89/*340*/ .word sys_kern_features, sys_kcmp 89/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module
90 90
91#endif /* CONFIG_COMPAT */ 91#endif /* CONFIG_COMPAT */
92 92
@@ -164,4 +164,4 @@ sys_call_table:
164 .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init 164 .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
165/*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime 165/*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
166 .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev 166 .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
167/*340*/ .word sys_kern_features, sys_kcmp 167/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 953641549e8..c4c27b0f906 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -278,7 +278,7 @@ static struct platform_device m48t59_rtc = {
278 }, 278 },
279}; 279};
280 280
281static int __devinit clock_probe(struct platform_device *op) 281static int clock_probe(struct platform_device *op)
282{ 282{
283 struct device_node *dp = op->dev.of_node; 283 struct device_node *dp = op->dev.of_node;
284 const char *model = of_get_property(dp, "model", NULL); 284 const char *model = of_get_property(dp, "model", NULL);
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index e861072b9c5..c3d82b5f54c 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
419 .num_resources = 1, 419 .num_resources = 1,
420}; 420};
421 421
422static int __devinit rtc_probe(struct platform_device *op) 422static int rtc_probe(struct platform_device *op)
423{ 423{
424 struct resource *r; 424 struct resource *r;
425 425
@@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
477 .num_resources = 1, 477 .num_resources = 1,
478}; 478};
479 479
480static int __devinit bq4802_probe(struct platform_device *op) 480static int bq4802_probe(struct platform_device *op)
481{ 481{
482 482
483 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", 483 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
@@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
534 }, 534 },
535}; 535};
536 536
537static int __devinit mostek_probe(struct platform_device *op) 537static int mostek_probe(struct platform_device *op)
538{ 538{
539 struct device_node *dp = op->dev.of_node; 539 struct device_node *dp = op->dev.of_node;
540 540
@@ -746,7 +746,7 @@ void __irq_entry timer_interrupt(int irq, struct pt_regs *regs)
746 set_irq_regs(old_regs); 746 set_irq_regs(old_regs);
747} 747}
748 748
749void __devinit setup_sparc64_timer(void) 749void setup_sparc64_timer(void)
750{ 750{
751 struct clock_event_device *sevt; 751 struct clock_event_device *sevt;
752 unsigned long pstate; 752 unsigned long pstate;
@@ -844,7 +844,7 @@ unsigned long long sched_clock(void)
844 >> SPARC64_NSEC_PER_CYC_SHIFT; 844 >> SPARC64_NSEC_PER_CYC_SHIFT;
845} 845}
846 846
847int __devinit read_current_timer(unsigned long *timer_val) 847int read_current_timer(unsigned long *timer_val)
848{ 848{
849 *timer_val = tick_ops->get_tick(); 849 *timer_val = tick_ops->get_tick();
850 return 0; 850 return 0;
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 85be1ca539b..c3b72423c84 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -87,8 +87,8 @@ static unsigned long cpu_pgsz_mask;
87 87
88#define MAX_BANKS 32 88#define MAX_BANKS 32
89 89
90static struct linux_prom64_registers pavail[MAX_BANKS] __devinitdata; 90static struct linux_prom64_registers pavail[MAX_BANKS];
91static int pavail_ents __devinitdata; 91static int pavail_ents;
92 92
93static int cmp_p64(const void *a, const void *b) 93static int cmp_p64(const void *a, const void *b)
94{ 94{
@@ -1931,7 +1931,7 @@ void __init paging_init(void)
1931 printk("Booting Linux...\n"); 1931 printk("Booting Linux...\n");
1932} 1932}
1933 1933
1934int __devinit page_in_phys_avail(unsigned long paddr) 1934int page_in_phys_avail(unsigned long paddr)
1935{ 1935{
1936 int i; 1936 int i;
1937 1937
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h
index 302cdf71cee..54a924208d3 100644
--- a/arch/tile/include/asm/pci.h
+++ b/arch/tile/include/asm/pci.h
@@ -188,7 +188,7 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
188int __init tile_pci_init(void); 188int __init tile_pci_init(void);
189int __init pcibios_init(void); 189int __init pcibios_init(void);
190 190
191void __devinit pcibios_fixup_bus(struct pci_bus *bus); 191void pcibios_fixup_bus(struct pci_bus *bus);
192 192
193#define pci_domain_nr(bus) (((struct pci_controller *)(bus)->sysdata)->index) 193#define pci_domain_nr(bus) (((struct pci_controller *)(bus)->sysdata)->index)
194 194
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index aac1cd58696..67237d34c2e 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(pcibios_align_resource);
81 * controller_id is the controller number, config type is 0 or 1 for 81 * controller_id is the controller number, config type is 0 or 1 for
82 * config0 or config1 operations. 82 * config0 or config1 operations.
83 */ 83 */
84static int __devinit tile_pcie_open(int controller_id, int config_type) 84static int tile_pcie_open(int controller_id, int config_type)
85{ 85{
86 char filename[32]; 86 char filename[32];
87 int fd; 87 int fd;
@@ -97,8 +97,7 @@ static int __devinit tile_pcie_open(int controller_id, int config_type)
97/* 97/*
98 * Get the IRQ numbers from the HV and set up the handlers for them. 98 * Get the IRQ numbers from the HV and set up the handlers for them.
99 */ 99 */
100static int __devinit tile_init_irqs(int controller_id, 100static int tile_init_irqs(int controller_id, struct pci_controller *controller)
101 struct pci_controller *controller)
102{ 101{
103 char filename[32]; 102 char filename[32];
104 int fd; 103 int fd;
@@ -237,7 +236,7 @@ static int tile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
237} 236}
238 237
239 238
240static void __devinit fixup_read_and_payload_sizes(void) 239static void fixup_read_and_payload_sizes(void)
241{ 240{
242 struct pci_dev *dev = NULL; 241 struct pci_dev *dev = NULL;
243 int smallest_max_payload = 0x1; /* Tile maxes out at 256 bytes. */ 242 int smallest_max_payload = 0x1; /* Tile maxes out at 256 bytes. */
@@ -379,7 +378,7 @@ subsys_initcall(pcibios_init);
379/* 378/*
380 * No bus fixups needed. 379 * No bus fixups needed.
381 */ 380 */
382void __devinit pcibios_fixup_bus(struct pci_bus *bus) 381void pcibios_fixup_bus(struct pci_bus *bus)
383{ 382{
384 /* Nothing needs to be done. */ 383 /* Nothing needs to be done. */
385} 384}
@@ -458,11 +457,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
458 * specified bus & slot. 457 * specified bus & slot.
459 */ 458 */
460 459
461static int __devinit tile_cfg_read(struct pci_bus *bus, 460static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset,
462 unsigned int devfn, 461 int size, u32 *val)
463 int offset,
464 int size,
465 u32 *val)
466{ 462{
467 struct pci_controller *controller = bus->sysdata; 463 struct pci_controller *controller = bus->sysdata;
468 int busnum = bus->number & 0xff; 464 int busnum = bus->number & 0xff;
@@ -504,11 +500,8 @@ static int __devinit tile_cfg_read(struct pci_bus *bus,
504 * See tile_cfg_read() for relevant comments. 500 * See tile_cfg_read() for relevant comments.
505 * Note that "val" is the value to write, not a pointer to that value. 501 * Note that "val" is the value to write, not a pointer to that value.
506 */ 502 */
507static int __devinit tile_cfg_write(struct pci_bus *bus, 503static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset,
508 unsigned int devfn, 504 int size, u32 val)
509 int offset,
510 int size,
511 u32 val)
512{ 505{
513 struct pci_controller *controller = bus->sysdata; 506 struct pci_controller *controller = bus->sysdata;
514 int busnum = bus->number & 0xff; 507 int busnum = bus->number & 0xff;
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index 94810d4a633..11425633b2d 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -58,10 +58,10 @@
58#define TRACE_CFG_RD(...) 58#define TRACE_CFG_RD(...)
59#endif 59#endif
60 60
61static int __devinitdata pci_probe = 1; 61static int pci_probe = 1;
62 62
63/* Information on the PCIe RC ports configuration. */ 63/* Information on the PCIe RC ports configuration. */
64static int __devinitdata pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES]; 64static int pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
65 65
66/* 66/*
67 * On some platforms with one or more Gx endpoint ports, we need to 67 * On some platforms with one or more Gx endpoint ports, we need to
@@ -72,7 +72,7 @@ static int __devinitdata pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
72 * the delay in seconds. If the delay is not provided, the value 72 * the delay in seconds. If the delay is not provided, the value
73 * will be DEFAULT_RC_DELAY. 73 * will be DEFAULT_RC_DELAY.
74 */ 74 */
75static int __devinitdata rc_delay[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES]; 75static int rc_delay[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
76 76
77/* Default number of seconds that the PCIe RC port probe can be delayed. */ 77/* Default number of seconds that the PCIe RC port probe can be delayed. */
78#define DEFAULT_RC_DELAY 10 78#define DEFAULT_RC_DELAY 10
@@ -137,7 +137,7 @@ static int tile_irq_cpu(int irq)
137/* 137/*
138 * Open a file descriptor to the TRIO shim. 138 * Open a file descriptor to the TRIO shim.
139 */ 139 */
140static int __devinit tile_pcie_open(int trio_index) 140static int tile_pcie_open(int trio_index)
141{ 141{
142 gxio_trio_context_t *context = &trio_contexts[trio_index]; 142 gxio_trio_context_t *context = &trio_contexts[trio_index];
143 int ret; 143 int ret;
@@ -265,7 +265,7 @@ trio_handle_level_irq(unsigned int irq, struct irq_desc *desc)
265 * Create kernel irqs and set up the handlers for the legacy interrupts. 265 * Create kernel irqs and set up the handlers for the legacy interrupts.
266 * Also some minimum initialization for the MSI support. 266 * Also some minimum initialization for the MSI support.
267 */ 267 */
268static int __devinit tile_init_irqs(struct pci_controller *controller) 268static int tile_init_irqs(struct pci_controller *controller)
269{ 269{
270 int i; 270 int i;
271 int j; 271 int j;
@@ -459,8 +459,7 @@ static int tile_map_irq(const struct pci_dev *dev, u8 device, u8 pin)
459} 459}
460 460
461 461
462static void __devinit fixup_read_and_payload_sizes(struct pci_controller * 462static void fixup_read_and_payload_sizes(struct pci_controller *controller)
463 controller)
464{ 463{
465 gxio_trio_context_t *trio_context = controller->trio; 464 gxio_trio_context_t *trio_context = controller->trio;
466 struct pci_bus *root_bus = controller->root_bus; 465 struct pci_bus *root_bus = controller->root_bus;
@@ -541,7 +540,7 @@ static void __devinit fixup_read_and_payload_sizes(struct pci_controller *
541 } 540 }
542} 541}
543 542
544static int __devinit setup_pcie_rc_delay(char *str) 543static int setup_pcie_rc_delay(char *str)
545{ 544{
546 unsigned long delay = 0; 545 unsigned long delay = 0;
547 unsigned long trio_index; 546 unsigned long trio_index;
@@ -1016,7 +1015,7 @@ alloc_mem_map_failed:
1016subsys_initcall(pcibios_init); 1015subsys_initcall(pcibios_init);
1017 1016
1018/* Note: to be deleted after Linux 3.6 merge. */ 1017/* Note: to be deleted after Linux 3.6 merge. */
1019void __devinit pcibios_fixup_bus(struct pci_bus *bus) 1018void pcibios_fixup_bus(struct pci_bus *bus)
1020{ 1019{
1021} 1020}
1022 1021
@@ -1024,7 +1023,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
1024 * This can be called from the generic PCI layer, but doesn't need to 1023 * This can be called from the generic PCI layer, but doesn't need to
1025 * do anything. 1024 * do anything.
1026 */ 1025 */
1027char __devinit *pcibios_setup(char *str) 1026char *pcibios_setup(char *str)
1028{ 1027{
1029 if (!strcmp(str, "off")) { 1028 if (!strcmp(str, "off")) {
1030 pci_probe = 0; 1029 pci_probe = 0;
@@ -1143,11 +1142,8 @@ EXPORT_SYMBOL(pci_iounmap);
1143 * specified bus & device. 1142 * specified bus & device.
1144 */ 1143 */
1145 1144
1146static int __devinit tile_cfg_read(struct pci_bus *bus, 1145static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset,
1147 unsigned int devfn, 1146 int size, u32 *val)
1148 int offset,
1149 int size,
1150 u32 *val)
1151{ 1147{
1152 struct pci_controller *controller = bus->sysdata; 1148 struct pci_controller *controller = bus->sysdata;
1153 gxio_trio_context_t *trio_context = controller->trio; 1149 gxio_trio_context_t *trio_context = controller->trio;
@@ -1271,11 +1267,8 @@ invalid_device:
1271 * See tile_cfg_read() for relevent comments. 1267 * See tile_cfg_read() for relevent comments.
1272 * Note that "val" is the value to write, not a pointer to that value. 1268 * Note that "val" is the value to write, not a pointer to that value.
1273 */ 1269 */
1274static int __devinit tile_cfg_write(struct pci_bus *bus, 1270static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset,
1275 unsigned int devfn, 1271 int size, u32 val)
1276 int offset,
1277 int size,
1278 u32 val)
1279{ 1272{
1280 struct pci_controller *controller = bus->sysdata; 1273 struct pci_controller *controller = bus->sysdata;
1281 gxio_trio_context_t *trio_context = controller->trio; 1274 gxio_trio_context_t *trio_context = controller->trio;
diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c
index 7c4359240b8..ef69c0c8282 100644
--- a/arch/unicore32/kernel/pci.c
+++ b/arch/unicore32/kernel/pci.c
@@ -167,7 +167,7 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev)
167 * pcibios_fixup_bus - Called after each bus is probed, 167 * pcibios_fixup_bus - Called after each bus is probed,
168 * but before its children are examined. 168 * but before its children are examined.
169 */ 169 */
170void __devinit pcibios_fixup_bus(struct pci_bus *bus) 170void pcibios_fixup_bus(struct pci_bus *bus)
171{ 171{
172 struct pci_dev *dev; 172 struct pci_dev *dev;
173 u16 features = PCI_COMMAND_SERR 173 u16 features = PCI_COMMAND_SERR
diff --git a/arch/x86/include/asm/parport.h b/arch/x86/include/asm/parport.h
index 3c4ffeb467e..0d2d3b29118 100644
--- a/arch/x86/include/asm/parport.h
+++ b/arch/x86/include/asm/parport.h
@@ -1,8 +1,8 @@
1#ifndef _ASM_X86_PARPORT_H 1#ifndef _ASM_X86_PARPORT_H
2#define _ASM_X86_PARPORT_H 2#define _ASM_X86_PARPORT_H
3 3
4static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); 4static int parport_pc_find_isa_ports(int autoirq, int autodma);
5static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) 5static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
6{ 6{
7 return parport_pc_find_isa_ports(autoirq, autodma); 7 return parport_pc_find_isa_ports(autoirq, autodma);
8} 8}
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 73e8eeff22e..747e5a38b59 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -140,11 +140,10 @@ struct pci_mmcfg_region {
140 140
141extern int __init pci_mmcfg_arch_init(void); 141extern int __init pci_mmcfg_arch_init(void);
142extern void __init pci_mmcfg_arch_free(void); 142extern void __init pci_mmcfg_arch_free(void);
143extern int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg); 143extern int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg);
144extern void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg); 144extern void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg);
145extern int __devinit pci_mmconfig_insert(struct device *dev, 145extern int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
146 u16 seg, u8 start, 146 phys_addr_t addr);
147 u8 end, phys_addr_t addr);
148extern int pci_mmconfig_delete(u16 seg, u8 start, u8 end); 147extern int pci_mmconfig_delete(u16 seg, u8 start, u8 end);
149extern struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus); 148extern struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus);
150 149
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 3cf3d97cce3..b43200dbfe7 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -2500,7 +2500,7 @@ static bool pcidrv_registered;
2500/* 2500/*
2501 * add a pci uncore device 2501 * add a pci uncore device
2502 */ 2502 */
2503static int __devinit uncore_pci_add(struct intel_uncore_type *type, struct pci_dev *pdev) 2503static int uncore_pci_add(struct intel_uncore_type *type, struct pci_dev *pdev)
2504{ 2504{
2505 struct intel_uncore_pmu *pmu; 2505 struct intel_uncore_pmu *pmu;
2506 struct intel_uncore_box *box; 2506 struct intel_uncore_box *box;
@@ -2571,8 +2571,8 @@ static void uncore_pci_remove(struct pci_dev *pdev)
2571 kfree(box); 2571 kfree(box);
2572} 2572}
2573 2573
2574static int __devinit uncore_pci_probe(struct pci_dev *pdev, 2574static int uncore_pci_probe(struct pci_dev *pdev,
2575 const struct pci_device_id *id) 2575 const struct pci_device_id *id)
2576{ 2576{
2577 struct intel_uncore_type *type; 2577 struct intel_uncore_type *type;
2578 2578
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 08b973f6403..9c2bd8bd4b4 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -43,6 +43,7 @@
43#include <asm/apicdef.h> 43#include <asm/apicdef.h>
44#include <asm/hypervisor.h> 44#include <asm/hypervisor.h>
45#include <asm/kvm_guest.h> 45#include <asm/kvm_guest.h>
46#include <asm/context_tracking.h>
46 47
47static int kvmapf = 1; 48static int kvmapf = 1;
48 49
@@ -121,6 +122,8 @@ void kvm_async_pf_task_wait(u32 token)
121 struct kvm_task_sleep_node n, *e; 122 struct kvm_task_sleep_node n, *e;
122 DEFINE_WAIT(wait); 123 DEFINE_WAIT(wait);
123 124
125 rcu_irq_enter();
126
124 spin_lock(&b->lock); 127 spin_lock(&b->lock);
125 e = _find_apf_task(b, token); 128 e = _find_apf_task(b, token);
126 if (e) { 129 if (e) {
@@ -128,6 +131,8 @@ void kvm_async_pf_task_wait(u32 token)
128 hlist_del(&e->link); 131 hlist_del(&e->link);
129 kfree(e); 132 kfree(e);
130 spin_unlock(&b->lock); 133 spin_unlock(&b->lock);
134
135 rcu_irq_exit();
131 return; 136 return;
132 } 137 }
133 138
@@ -152,13 +157,16 @@ void kvm_async_pf_task_wait(u32 token)
152 /* 157 /*
153 * We cannot reschedule. So halt. 158 * We cannot reschedule. So halt.
154 */ 159 */
160 rcu_irq_exit();
155 native_safe_halt(); 161 native_safe_halt();
162 rcu_irq_enter();
156 local_irq_disable(); 163 local_irq_disable();
157 } 164 }
158 } 165 }
159 if (!n.halted) 166 if (!n.halted)
160 finish_wait(&n.wq, &wait); 167 finish_wait(&n.wq, &wait);
161 168
169 rcu_irq_exit();
162 return; 170 return;
163} 171}
164EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait); 172EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait);
@@ -252,10 +260,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
252 break; 260 break;
253 case KVM_PV_REASON_PAGE_NOT_PRESENT: 261 case KVM_PV_REASON_PAGE_NOT_PRESENT:
254 /* page is swapped out by the host. */ 262 /* page is swapped out by the host. */
255 rcu_irq_enter(); 263 exception_enter(regs);
256 exit_idle(); 264 exit_idle();
257 kvm_async_pf_task_wait((u32)read_cr2()); 265 kvm_async_pf_task_wait((u32)read_cr2());
258 rcu_irq_exit(); 266 exception_exit(regs);
259 break; 267 break;
260 case KVM_PV_REASON_PAGE_READY: 268 case KVM_PV_REASON_PAGE_READY:
261 rcu_irq_enter(); 269 rcu_irq_enter();
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index de2b7ad7027..0f5dec5c80e 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -265,7 +265,7 @@ rootfs_initcall(pci_iommu_init);
265#ifdef CONFIG_PCI 265#ifdef CONFIG_PCI
266/* Many VIA bridges seem to corrupt data for DAC. Disable it here */ 266/* Many VIA bridges seem to corrupt data for DAC. Disable it here */
267 267
268static __devinit void via_no_dac(struct pci_dev *dev) 268static void via_no_dac(struct pci_dev *dev)
269{ 269{
270 if (forbid_dac == 0) { 270 if (forbid_dac == 0) {
271 dev_info(&dev->dev, "disabling DAC on VIA PCI bridge\n"); 271 dev_info(&dev->dev, "disabling DAC on VIA PCI bridge\n");
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 1b27de56356..26ee48a33dc 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -8,7 +8,7 @@
8 8
9#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI) 9#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
10 10
11static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) 11static void quirk_intel_irqbalance(struct pci_dev *dev)
12{ 12{
13 u8 config; 13 u8 config;
14 u16 word; 14 u16 word;
@@ -512,7 +512,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
512 512
513#if defined(CONFIG_PCI) && defined(CONFIG_NUMA) 513#if defined(CONFIG_PCI) && defined(CONFIG_NUMA)
514/* Set correct numa_node information for AMD NB functions */ 514/* Set correct numa_node information for AMD NB functions */
515static void __devinit quirk_amd_nb_node(struct pci_dev *dev) 515static void quirk_amd_nb_node(struct pci_dev *dev)
516{ 516{
517 struct pci_dev *nb_ht; 517 struct pci_dev *nb_ht;
518 unsigned int devfn; 518 unsigned int devfn;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 76f54461f7c..c243b81e3c7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -120,7 +120,7 @@ struct kvm_shared_msrs {
120}; 120};
121 121
122static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; 122static struct kvm_shared_msrs_global __read_mostly shared_msrs_global;
123static DEFINE_PER_CPU(struct kvm_shared_msrs, shared_msrs); 123static struct kvm_shared_msrs __percpu *shared_msrs;
124 124
125struct kvm_stats_debugfs_item debugfs_entries[] = { 125struct kvm_stats_debugfs_item debugfs_entries[] = {
126 { "pf_fixed", VCPU_STAT(pf_fixed) }, 126 { "pf_fixed", VCPU_STAT(pf_fixed) },
@@ -191,10 +191,10 @@ static void kvm_on_user_return(struct user_return_notifier *urn)
191 191
192static void shared_msr_update(unsigned slot, u32 msr) 192static void shared_msr_update(unsigned slot, u32 msr)
193{ 193{
194 struct kvm_shared_msrs *smsr;
195 u64 value; 194 u64 value;
195 unsigned int cpu = smp_processor_id();
196 struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
196 197
197 smsr = &__get_cpu_var(shared_msrs);
198 /* only read, and nobody should modify it at this time, 198 /* only read, and nobody should modify it at this time,
199 * so don't need lock */ 199 * so don't need lock */
200 if (slot >= shared_msrs_global.nr) { 200 if (slot >= shared_msrs_global.nr) {
@@ -226,7 +226,8 @@ static void kvm_shared_msr_cpu_online(void)
226 226
227void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask) 227void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
228{ 228{
229 struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); 229 unsigned int cpu = smp_processor_id();
230 struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
230 231
231 if (((value ^ smsr->values[slot].curr) & mask) == 0) 232 if (((value ^ smsr->values[slot].curr) & mask) == 0)
232 return; 233 return;
@@ -242,7 +243,8 @@ EXPORT_SYMBOL_GPL(kvm_set_shared_msr);
242 243
243static void drop_user_return_notifiers(void *ignore) 244static void drop_user_return_notifiers(void *ignore)
244{ 245{
245 struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); 246 unsigned int cpu = smp_processor_id();
247 struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
246 248
247 if (smsr->registered) 249 if (smsr->registered)
248 kvm_on_user_return(&smsr->urn); 250 kvm_on_user_return(&smsr->urn);
@@ -5233,9 +5235,16 @@ int kvm_arch_init(void *opaque)
5233 goto out; 5235 goto out;
5234 } 5236 }
5235 5237
5238 r = -ENOMEM;
5239 shared_msrs = alloc_percpu(struct kvm_shared_msrs);
5240 if (!shared_msrs) {
5241 printk(KERN_ERR "kvm: failed to allocate percpu kvm_shared_msrs\n");
5242 goto out;
5243 }
5244
5236 r = kvm_mmu_module_init(); 5245 r = kvm_mmu_module_init();
5237 if (r) 5246 if (r)
5238 goto out; 5247 goto out_free_percpu;
5239 5248
5240 kvm_set_mmio_spte_mask(); 5249 kvm_set_mmio_spte_mask();
5241 kvm_init_msr_list(); 5250 kvm_init_msr_list();
@@ -5258,6 +5267,8 @@ int kvm_arch_init(void *opaque)
5258 5267
5259 return 0; 5268 return 0;
5260 5269
5270out_free_percpu:
5271 free_percpu(shared_msrs);
5261out: 5272out:
5262 return r; 5273 return r;
5263} 5274}
@@ -5275,6 +5286,7 @@ void kvm_arch_exit(void)
5275#endif 5286#endif
5276 kvm_x86_ops = NULL; 5287 kvm_x86_ops = NULL;
5277 kvm_mmu_module_exit(); 5288 kvm_mmu_module_exit();
5289 free_percpu(shared_msrs);
5278} 5290}
5279 5291
5280int kvm_emulate_halt(struct kvm_vcpu *vcpu) 5292int kvm_emulate_halt(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index e395693abdb..7c3bee636e2 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -98,7 +98,7 @@ void use_tsc_delay(void)
98 delay_fn = delay_tsc; 98 delay_fn = delay_tsc;
99} 99}
100 100
101int __devinit read_current_timer(unsigned long *timer_val) 101int read_current_timer(unsigned long *timer_val)
102{ 102{
103 if (delay_fn == delay_tsc) { 103 if (delay_fn == delay_tsc) {
104 rdtscll(*timer_val); 104 rdtscll(*timer_val);
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 0c01261fe5a..53ea60458e0 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -145,7 +145,7 @@ void __init pci_acpi_crs_quirks(void)
145} 145}
146 146
147#ifdef CONFIG_PCI_MMCONFIG 147#ifdef CONFIG_PCI_MMCONFIG
148static int __devinit check_segment(u16 seg, struct device *dev, char *estr) 148static int check_segment(u16 seg, struct device *dev, char *estr)
149{ 149{
150 if (seg) { 150 if (seg) {
151 dev_err(dev, 151 dev_err(dev,
@@ -168,9 +168,8 @@ static int __devinit check_segment(u16 seg, struct device *dev, char *estr)
168 return 0; 168 return 0;
169} 169}
170 170
171static int __devinit setup_mcfg_map(struct pci_root_info *info, 171static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start,
172 u16 seg, u8 start, u8 end, 172 u8 end, phys_addr_t addr)
173 phys_addr_t addr)
174{ 173{
175 int result; 174 int result;
176 struct device *dev = &info->bridge->dev; 175 struct device *dev = &info->bridge->dev;
@@ -208,7 +207,7 @@ static void teardown_mcfg_map(struct pci_root_info *info)
208 } 207 }
209} 208}
210#else 209#else
211static int __devinit setup_mcfg_map(struct pci_root_info *info, 210static int setup_mcfg_map(struct pci_root_info *info,
212 u16 seg, u8 start, u8 end, 211 u16 seg, u8 start, u8 end,
213 phys_addr_t addr) 212 phys_addr_t addr)
214{ 213{
@@ -474,7 +473,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
474 info); 473 info);
475} 474}
476 475
477struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) 476struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
478{ 477{
479 struct acpi_device *device = root->device; 478 struct acpi_device *device = root->device;
480 struct pci_root_info *info = NULL; 479 struct pci_root_info *info = NULL;
diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c
index d37e2fec97e..c2735feb250 100644
--- a/arch/x86/pci/bus_numa.c
+++ b/arch/x86/pci/bus_numa.c
@@ -93,8 +93,8 @@ struct pci_root_info __init *alloc_pci_root_info(int bus_min, int bus_max,
93 return info; 93 return info;
94} 94}
95 95
96void __devinit update_res(struct pci_root_info *info, resource_size_t start, 96void update_res(struct pci_root_info *info, resource_size_t start,
97 resource_size_t end, unsigned long flags, int merge) 97 resource_size_t end, unsigned long flags, int merge)
98{ 98{
99 struct resource *res; 99 struct resource *res;
100 struct pci_root_res *root_res; 100 struct pci_root_res *root_res;
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 412e1286d1f..ccd0ab3ab89 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = {
81 */ 81 */
82DEFINE_RAW_SPINLOCK(pci_config_lock); 82DEFINE_RAW_SPINLOCK(pci_config_lock);
83 83
84static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d) 84static int can_skip_ioresource_align(const struct dmi_system_id *d)
85{ 85{
86 pci_probe |= PCI_CAN_SKIP_ISA_ALIGN; 86 pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
87 printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident); 87 printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
88 return 0; 88 return 0;
89} 89}
90 90
91static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst = { 91static const struct dmi_system_id can_skip_pciprobe_dmi_table[] = {
92/* 92/*
93 * Systems where PCI IO resource ISA alignment can be skipped 93 * Systems where PCI IO resource ISA alignment can be skipped
94 * when the ISA enable bit in the bridge control is not set 94 * when the ISA enable bit in the bridge control is not set
@@ -125,7 +125,7 @@ void __init dmi_check_skip_isa_align(void)
125 dmi_check_system(can_skip_pciprobe_dmi_table); 125 dmi_check_system(can_skip_pciprobe_dmi_table);
126} 126}
127 127
128static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 128static void pcibios_fixup_device_resources(struct pci_dev *dev)
129{ 129{
130 struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE]; 130 struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE];
131 struct resource *bar_r; 131 struct resource *bar_r;
@@ -162,7 +162,7 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
162 * are examined. 162 * are examined.
163 */ 163 */
164 164
165void __devinit pcibios_fixup_bus(struct pci_bus *b) 165void pcibios_fixup_bus(struct pci_bus *b)
166{ 166{
167 struct pci_dev *dev; 167 struct pci_dev *dev;
168 168
@@ -176,7 +176,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
176 * on the kernel command line (which was parsed earlier). 176 * on the kernel command line (which was parsed earlier).
177 */ 177 */
178 178
179static int __devinit set_bf_sort(const struct dmi_system_id *d) 179static int set_bf_sort(const struct dmi_system_id *d)
180{ 180{
181 if (pci_bf_sort == pci_bf_sort_default) { 181 if (pci_bf_sort == pci_bf_sort_default) {
182 pci_bf_sort = pci_dmi_bf; 182 pci_bf_sort = pci_dmi_bf;
@@ -185,7 +185,7 @@ static int __devinit set_bf_sort(const struct dmi_system_id *d)
185 return 0; 185 return 0;
186} 186}
187 187
188static void __devinit read_dmi_type_b1(const struct dmi_header *dm, 188static void read_dmi_type_b1(const struct dmi_header *dm,
189 void *private_data) 189 void *private_data)
190{ 190{
191 u8 *d = (u8 *)dm + 4; 191 u8 *d = (u8 *)dm + 4;
@@ -207,7 +207,7 @@ static void __devinit read_dmi_type_b1(const struct dmi_header *dm,
207 } 207 }
208} 208}
209 209
210static int __devinit find_sort_method(const struct dmi_system_id *d) 210static int find_sort_method(const struct dmi_system_id *d)
211{ 211{
212 dmi_walk(read_dmi_type_b1, NULL); 212 dmi_walk(read_dmi_type_b1, NULL);
213 213
@@ -222,7 +222,7 @@ static int __devinit find_sort_method(const struct dmi_system_id *d)
222 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) 222 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
223 */ 223 */
224#ifdef __i386__ 224#ifdef __i386__
225static int __devinit assign_all_busses(const struct dmi_system_id *d) 225static int assign_all_busses(const struct dmi_system_id *d)
226{ 226{
227 pci_probe |= PCI_ASSIGN_ALL_BUSSES; 227 pci_probe |= PCI_ASSIGN_ALL_BUSSES;
228 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" 228 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
@@ -231,7 +231,7 @@ static int __devinit assign_all_busses(const struct dmi_system_id *d)
231} 231}
232#endif 232#endif
233 233
234static int __devinit set_scan_all(const struct dmi_system_id *d) 234static int set_scan_all(const struct dmi_system_id *d)
235{ 235{
236 printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n", 236 printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n",
237 d->ident); 237 d->ident);
@@ -239,7 +239,7 @@ static int __devinit set_scan_all(const struct dmi_system_id *d)
239 return 0; 239 return 0;
240} 240}
241 241
242static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = { 242static const struct dmi_system_id pciprobe_dmi_table[] = {
243#ifdef __i386__ 243#ifdef __i386__
244/* 244/*
245 * Laptops which need pci=assign-busses to see Cardbus cards 245 * Laptops which need pci=assign-busses to see Cardbus cards
@@ -446,7 +446,7 @@ void __init dmi_check_pciprobe(void)
446 dmi_check_system(pciprobe_dmi_table); 446 dmi_check_system(pciprobe_dmi_table);
447} 447}
448 448
449struct pci_bus * __devinit pcibios_scan_root(int busnum) 449struct pci_bus *pcibios_scan_root(int busnum)
450{ 450{
451 struct pci_bus *bus = NULL; 451 struct pci_bus *bus = NULL;
452 452
@@ -665,7 +665,7 @@ int pci_ext_cfg_avail(void)
665 return 0; 665 return 0;
666} 666}
667 667
668struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node) 668struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
669{ 669{
670 LIST_HEAD(resources); 670 LIST_HEAD(resources);
671 struct pci_bus *bus = NULL; 671 struct pci_bus *bus = NULL;
@@ -693,7 +693,7 @@ struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops,
693 return bus; 693 return bus;
694} 694}
695 695
696struct pci_bus * __devinit pci_scan_bus_with_sysdata(int busno) 696struct pci_bus *pci_scan_bus_with_sysdata(int busno)
697{ 697{
698 return pci_scan_bus_on_node(busno, &pci_root_ops, -1); 698 return pci_scan_bus_on_node(busno, &pci_root_ops, -1);
699} 699}
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index af8a224db21..f5809fa2753 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -9,7 +9,7 @@
9#include <linux/vgaarb.h> 9#include <linux/vgaarb.h>
10#include <asm/pci_x86.h> 10#include <asm/pci_x86.h>
11 11
12static void __devinit pci_fixup_i450nx(struct pci_dev *d) 12static void pci_fixup_i450nx(struct pci_dev *d)
13{ 13{
14 /* 14 /*
15 * i450NX -- Find and scan all secondary buses on all PXB's. 15 * i450NX -- Find and scan all secondary buses on all PXB's.
@@ -34,7 +34,7 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
34} 34}
35DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx); 35DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx);
36 36
37static void __devinit pci_fixup_i450gx(struct pci_dev *d) 37static void pci_fixup_i450gx(struct pci_dev *d)
38{ 38{
39 /* 39 /*
40 * i450GX and i450KX -- Find and scan all secondary buses. 40 * i450GX and i450KX -- Find and scan all secondary buses.
@@ -48,7 +48,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d)
48} 48}
49DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); 49DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx);
50 50
51static void __devinit pci_fixup_umc_ide(struct pci_dev *d) 51static void pci_fixup_umc_ide(struct pci_dev *d)
52{ 52{
53 /* 53 /*
54 * UM8886BF IDE controller sets region type bits incorrectly, 54 * UM8886BF IDE controller sets region type bits incorrectly,
@@ -62,7 +62,7 @@ static void __devinit pci_fixup_umc_ide(struct pci_dev *d)
62} 62}
63DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide); 63DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide);
64 64
65static void __devinit pci_fixup_ncr53c810(struct pci_dev *d) 65static void pci_fixup_ncr53c810(struct pci_dev *d)
66{ 66{
67 /* 67 /*
68 * NCR 53C810 returns class code 0 (at least on some systems). 68 * NCR 53C810 returns class code 0 (at least on some systems).
@@ -75,7 +75,7 @@ static void __devinit pci_fixup_ncr53c810(struct pci_dev *d)
75} 75}
76DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); 76DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810);
77 77
78static void __devinit pci_fixup_latency(struct pci_dev *d) 78static void pci_fixup_latency(struct pci_dev *d)
79{ 79{
80 /* 80 /*
81 * SiS 5597 and 5598 chipsets require latency timer set to 81 * SiS 5597 and 5598 chipsets require latency timer set to
@@ -87,7 +87,7 @@ static void __devinit pci_fixup_latency(struct pci_dev *d)
87DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency); 87DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency);
88DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency); 88DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency);
89 89
90static void __devinit pci_fixup_piix4_acpi(struct pci_dev *d) 90static void pci_fixup_piix4_acpi(struct pci_dev *d)
91{ 91{
92 /* 92 /*
93 * PIIX4 ACPI device: hardwired IRQ9 93 * PIIX4 ACPI device: hardwired IRQ9
@@ -163,7 +163,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_
163 * system to PCI bus no matter what are their window settings, so they are 163 * system to PCI bus no matter what are their window settings, so they are
164 * "transparent" (or subtractive decoding) from programmers point of view. 164 * "transparent" (or subtractive decoding) from programmers point of view.
165 */ 165 */
166static void __devinit pci_fixup_transparent_bridge(struct pci_dev *dev) 166static void pci_fixup_transparent_bridge(struct pci_dev *dev)
167{ 167{
168 if ((dev->device & 0xff00) == 0x2400) 168 if ((dev->device & 0xff00) == 0x2400)
169 dev->transparent = 1; 169 dev->transparent = 1;
@@ -317,7 +317,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r
317 * video device at this point. 317 * video device at this point.
318 */ 318 */
319 319
320static void __devinit pci_fixup_video(struct pci_dev *pdev) 320static void pci_fixup_video(struct pci_dev *pdev)
321{ 321{
322 struct pci_dev *bridge; 322 struct pci_dev *bridge;
323 struct pci_bus *bus; 323 struct pci_bus *bus;
@@ -357,7 +357,7 @@ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
357 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); 357 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
358 358
359 359
360static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = { 360static const struct dmi_system_id msi_k8t_dmi_table[] = {
361 { 361 {
362 .ident = "MSI-K8T-Neo2Fir", 362 .ident = "MSI-K8T-Neo2Fir",
363 .matches = { 363 .matches = {
@@ -378,7 +378,7 @@ static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
378 * The soundcard is only enabled, if the mainborad is identified 378 * The soundcard is only enabled, if the mainborad is identified
379 * via DMI-tables and the soundcard is detected to be off. 379 * via DMI-tables and the soundcard is detected to be off.
380 */ 380 */
381static void __devinit pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev) 381static void pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev)
382{ 382{
383 unsigned char val; 383 unsigned char val;
384 if (!dmi_check_system(msi_k8t_dmi_table)) 384 if (!dmi_check_system(msi_k8t_dmi_table))
@@ -414,7 +414,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
414 */ 414 */
415static u16 toshiba_line_size; 415static u16 toshiba_line_size;
416 416
417static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] = { 417static const struct dmi_system_id toshiba_ohci1394_dmi_table[] = {
418 { 418 {
419 .ident = "Toshiba PS5 based laptop", 419 .ident = "Toshiba PS5 based laptop",
420 .matches = { 420 .matches = {
@@ -439,7 +439,7 @@ static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] =
439 { } 439 { }
440}; 440};
441 441
442static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev) 442static void pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)
443{ 443{
444 if (!dmi_check_system(toshiba_ohci1394_dmi_table)) 444 if (!dmi_check_system(toshiba_ohci1394_dmi_table))
445 return; /* only applies to certain Toshibas (so far) */ 445 return; /* only applies to certain Toshibas (so far) */
@@ -450,7 +450,7 @@ static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)
450DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032, 450DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032,
451 pci_pre_fixup_toshiba_ohci1394); 451 pci_pre_fixup_toshiba_ohci1394);
452 452
453static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev) 453static void pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev)
454{ 454{
455 if (!dmi_check_system(toshiba_ohci1394_dmi_table)) 455 if (!dmi_check_system(toshiba_ohci1394_dmi_table))
456 return; /* only applies to certain Toshibas (so far) */ 456 return; /* only applies to certain Toshibas (so far) */
@@ -488,7 +488,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
488 * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller: 488 * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller:
489 * prevent update of the BAR0, which doesn't look like a normal BAR. 489 * prevent update of the BAR0, which doesn't look like a normal BAR.
490 */ 490 */
491static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev) 491static void pci_siemens_interrupt_controller(struct pci_dev *dev)
492{ 492{
493 dev->resource[0].flags |= IORESOURCE_PCI_FIXED; 493 dev->resource[0].flags |= IORESOURCE_PCI_FIXED;
494} 494}
@@ -531,7 +531,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);
531 * 531 *
532 * Match off the LPC and svid/sdid (older kernels lose the bridge subvendor) 532 * Match off the LPC and svid/sdid (older kernels lose the bridge subvendor)
533 */ 533 */
534static void __devinit twinhead_reserve_killing_zone(struct pci_dev *dev) 534static void twinhead_reserve_killing_zone(struct pci_dev *dev)
535{ 535{
536 if (dev->subsystem_vendor == 0x14FF && dev->subsystem_device == 0xA003) { 536 if (dev->subsystem_vendor == 0x14FF && dev->subsystem_device == 0xA003) {
537 pr_info("Reserving memory on Twinhead H12Y\n"); 537 pr_info("Reserving memory on Twinhead H12Y\n");
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index a1df191129d..4a2ab9cb365 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -10,7 +10,7 @@
10 * Discover remaining PCI buses in case there are peer host bridges. 10 * Discover remaining PCI buses in case there are peer host bridges.
11 * We use the number of last PCI bus provided by the PCI BIOS. 11 * We use the number of last PCI bus provided by the PCI BIOS.
12 */ 12 */
13static void __devinit pcibios_fixup_peer_bridges(void) 13static void pcibios_fixup_peer_bridges(void)
14{ 14{
15 int n; 15 int n;
16 16
@@ -34,7 +34,7 @@ int __init pci_legacy_init(void)
34 return 0; 34 return 0;
35} 35}
36 36
37void __devinit pcibios_scan_specific_bus(int busn) 37void pcibios_scan_specific_bus(int busn)
38{ 38{
39 int devfn; 39 int devfn;
40 long node; 40 long node;
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 704b9ec043d..fb29968a7cd 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -49,7 +49,7 @@ static __init void free_all_mmcfg(void)
49 pci_mmconfig_remove(cfg); 49 pci_mmconfig_remove(cfg);
50} 50}
51 51
52static __devinit void list_add_sorted(struct pci_mmcfg_region *new) 52static void list_add_sorted(struct pci_mmcfg_region *new)
53{ 53{
54 struct pci_mmcfg_region *cfg; 54 struct pci_mmcfg_region *cfg;
55 55
@@ -65,9 +65,8 @@ static __devinit void list_add_sorted(struct pci_mmcfg_region *new)
65 list_add_tail_rcu(&new->list, &pci_mmcfg_list); 65 list_add_tail_rcu(&new->list, &pci_mmcfg_list);
66} 66}
67 67
68static __devinit struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, 68static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start,
69 int start, 69 int end, u64 addr)
70 int end, u64 addr)
71{ 70{
72 struct pci_mmcfg_region *new; 71 struct pci_mmcfg_region *new;
73 struct resource *res; 72 struct resource *res;
@@ -371,8 +370,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
371 return !list_empty(&pci_mmcfg_list); 370 return !list_empty(&pci_mmcfg_list);
372} 371}
373 372
374static acpi_status __devinit check_mcfg_resource(struct acpi_resource *res, 373static acpi_status check_mcfg_resource(struct acpi_resource *res, void *data)
375 void *data)
376{ 374{
377 struct resource *mcfg_res = data; 375 struct resource *mcfg_res = data;
378 struct acpi_resource_address64 address; 376 struct acpi_resource_address64 address;
@@ -408,8 +406,8 @@ static acpi_status __devinit check_mcfg_resource(struct acpi_resource *res,
408 return AE_OK; 406 return AE_OK;
409} 407}
410 408
411static acpi_status __devinit find_mboard_resource(acpi_handle handle, u32 lvl, 409static acpi_status find_mboard_resource(acpi_handle handle, u32 lvl,
412 void *context, void **rv) 410 void *context, void **rv)
413{ 411{
414 struct resource *mcfg_res = context; 412 struct resource *mcfg_res = context;
415 413
@@ -422,7 +420,7 @@ static acpi_status __devinit find_mboard_resource(acpi_handle handle, u32 lvl,
422 return AE_OK; 420 return AE_OK;
423} 421}
424 422
425static int __devinit is_acpi_reserved(u64 start, u64 end, unsigned not_used) 423static int is_acpi_reserved(u64 start, u64 end, unsigned not_used)
426{ 424{
427 struct resource mcfg_res; 425 struct resource mcfg_res;
428 426
@@ -693,9 +691,8 @@ static int __init pci_mmcfg_late_insert_resources(void)
693late_initcall(pci_mmcfg_late_insert_resources); 691late_initcall(pci_mmcfg_late_insert_resources);
694 692
695/* Add MMCFG information for host bridges */ 693/* Add MMCFG information for host bridges */
696int __devinit pci_mmconfig_insert(struct device *dev, 694int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
697 u16 seg, u8 start, u8 end, 695 phys_addr_t addr)
698 phys_addr_t addr)
699{ 696{
700 int rc; 697 int rc;
701 struct resource *tmp = NULL; 698 struct resource *tmp = NULL;
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index db63ac23e3d..5c90975cdf0 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -142,7 +142,7 @@ void __init pci_mmcfg_arch_free(void)
142{ 142{
143} 143}
144 144
145int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) 145int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)
146{ 146{
147 return 0; 147 return 0;
148} 148}
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
index d4ebd07c306..bea52496aea 100644
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -95,7 +95,7 @@ const struct pci_raw_ops pci_mmcfg = {
95 .write = pci_mmcfg_write, 95 .write = pci_mmcfg_write,
96}; 96};
97 97
98static void __iomem * __devinit mcfg_ioremap(struct pci_mmcfg_region *cfg) 98static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg)
99{ 99{
100 void __iomem *addr; 100 void __iomem *addr;
101 u64 start, size; 101 u64 start, size;
@@ -133,7 +133,7 @@ void __init pci_mmcfg_arch_free(void)
133 pci_mmcfg_arch_unmap(cfg); 133 pci_mmcfg_arch_unmap(cfg);
134} 134}
135 135
136int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) 136int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)
137{ 137{
138 cfg->virt = mcfg_ioremap(cfg); 138 cfg->virt = mcfg_ioremap(cfg);
139 if (!cfg->virt) { 139 if (!cfg->virt) {
diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index e14a2ff708b..6eb18c42a28 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -247,7 +247,7 @@ int __init pci_mrst_init(void)
247/* Langwell devices are not true pci devices, they are not subject to 10 ms 247/* Langwell devices are not true pci devices, they are not subject to 10 ms
248 * d3 to d0 delay required by pci spec. 248 * d3 to d0 delay required by pci spec.
249 */ 249 */
250static void __devinit pci_d3delay_fixup(struct pci_dev *dev) 250static void pci_d3delay_fixup(struct pci_dev *dev)
251{ 251{
252 /* PCI fixups are effectively decided compile time. If we have a dual 252 /* PCI fixups are effectively decided compile time. If we have a dual
253 SoC/non-SoC kernel we don't want to mangle d3 on non SoC devices */ 253 SoC/non-SoC kernel we don't want to mangle d3 on non SoC devices */
@@ -262,7 +262,7 @@ static void __devinit pci_d3delay_fixup(struct pci_dev *dev)
262} 262}
263DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_d3delay_fixup); 263DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_d3delay_fixup);
264 264
265static void __devinit mrst_power_off_unused_dev(struct pci_dev *dev) 265static void mrst_power_off_unused_dev(struct pci_dev *dev)
266{ 266{
267 pci_set_power_state(dev, PCI_D3hot); 267 pci_set_power_state(dev, PCI_D3hot);
268} 268}
@@ -275,7 +275,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0815, mrst_power_off_unused_dev);
275/* 275/*
276 * Langwell devices reside at fixed offsets, don't try to move them. 276 * Langwell devices reside at fixed offsets, don't try to move them.
277 */ 277 */
278static void __devinit pci_fixed_bar_fixup(struct pci_dev *dev) 278static void pci_fixed_bar_fixup(struct pci_dev *dev)
279{ 279{
280 unsigned long offset; 280 unsigned long offset;
281 u32 size; 281 u32 size;
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 83e125b95ca..b96b14c250b 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -116,7 +116,7 @@ static const struct pci_raw_ops pci_direct_conf1_mq = {
116}; 116};
117 117
118 118
119static void __devinit pci_fixup_i450nx(struct pci_dev *d) 119static void pci_fixup_i450nx(struct pci_dev *d)
120{ 120{
121 /* 121 /*
122 * i450NX -- Find and scan all secondary buses on all PXB's. 122 * i450NX -- Find and scan all secondary buses on all PXB's.
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index da8fe0535ff..c77b24a8b2d 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -124,7 +124,7 @@ static struct {
124 124
125static int pci_bios_present; 125static int pci_bios_present;
126 126
127static int __devinit check_pcibios(void) 127static int check_pcibios(void)
128{ 128{
129 u32 signature, eax, ebx, ecx; 129 u32 signature, eax, ebx, ecx;
130 u8 status, major_ver, minor_ver, hw_mech; 130 u8 status, major_ver, minor_ver, hw_mech;
@@ -312,7 +312,7 @@ static const struct pci_raw_ops pci_bios_access = {
312 * Try to find PCI BIOS. 312 * Try to find PCI BIOS.
313 */ 313 */
314 314
315static const struct pci_raw_ops * __devinit pci_find_bios(void) 315static const struct pci_raw_ops *pci_find_bios(void)
316{ 316{
317 union bios32 *check; 317 union bios32 *check;
318 unsigned char sum; 318 unsigned char sum;
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index fd41a9262d6..e31bcd8f2ee 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -782,7 +782,7 @@ BLOCKING_NOTIFIER_HEAD(intel_scu_notifier);
782EXPORT_SYMBOL_GPL(intel_scu_notifier); 782EXPORT_SYMBOL_GPL(intel_scu_notifier);
783 783
784/* Called by IPC driver */ 784/* Called by IPC driver */
785void __devinit intel_scu_devices_create(void) 785void intel_scu_devices_create(void)
786{ 786{
787 int i; 787 int i;
788 788
diff --git a/arch/x86/platform/olpc/olpc-xo1-pm.c b/arch/x86/platform/olpc/olpc-xo1-pm.c
index d75582d1aa5..ff0174dda81 100644
--- a/arch/x86/platform/olpc/olpc-xo1-pm.c
+++ b/arch/x86/platform/olpc/olpc-xo1-pm.c
@@ -121,7 +121,7 @@ static const struct platform_suspend_ops xo1_suspend_ops = {
121 .enter = xo1_power_state_enter, 121 .enter = xo1_power_state_enter,
122}; 122};
123 123
124static int __devinit xo1_pm_probe(struct platform_device *pdev) 124static int xo1_pm_probe(struct platform_device *pdev)
125{ 125{
126 struct resource *res; 126 struct resource *res;
127 int err; 127 int err;
@@ -154,7 +154,7 @@ static int __devinit xo1_pm_probe(struct platform_device *pdev)
154 return 0; 154 return 0;
155} 155}
156 156
157static int __devexit xo1_pm_remove(struct platform_device *pdev) 157static int xo1_pm_remove(struct platform_device *pdev)
158{ 158{
159 mfd_cell_disable(pdev); 159 mfd_cell_disable(pdev);
160 160
@@ -173,7 +173,7 @@ static struct platform_driver cs5535_pms_driver = {
173 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
174 }, 174 },
175 .probe = xo1_pm_probe, 175 .probe = xo1_pm_probe,
176 .remove = __devexit_p(xo1_pm_remove), 176 .remove = xo1_pm_remove,
177}; 177};
178 178
179static struct platform_driver cs5535_acpi_driver = { 179static struct platform_driver cs5535_acpi_driver = {
@@ -182,7 +182,7 @@ static struct platform_driver cs5535_acpi_driver = {
182 .owner = THIS_MODULE, 182 .owner = THIS_MODULE,
183 }, 183 },
184 .probe = xo1_pm_probe, 184 .probe = xo1_pm_probe,
185 .remove = __devexit_p(xo1_pm_remove), 185 .remove = xo1_pm_remove,
186}; 186};
187 187
188static int __init xo1_pm_init(void) 188static int __init xo1_pm_init(void)
diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c
index 63d4aa40956..74704be7b1f 100644
--- a/arch/x86/platform/olpc/olpc-xo1-sci.c
+++ b/arch/x86/platform/olpc/olpc-xo1-sci.c
@@ -309,7 +309,7 @@ static int xo1_sci_resume(struct platform_device *pdev)
309 return 0; 309 return 0;
310} 310}
311 311
312static int __devinit setup_sci_interrupt(struct platform_device *pdev) 312static int setup_sci_interrupt(struct platform_device *pdev)
313{ 313{
314 u32 lo, hi; 314 u32 lo, hi;
315 u32 sts; 315 u32 sts;
@@ -351,7 +351,7 @@ static int __devinit setup_sci_interrupt(struct platform_device *pdev)
351 return r; 351 return r;
352} 352}
353 353
354static int __devinit setup_ec_sci(void) 354static int setup_ec_sci(void)
355{ 355{
356 int r; 356 int r;
357 357
@@ -395,7 +395,7 @@ static void free_ec_sci(void)
395 gpio_free(OLPC_GPIO_ECSCI); 395 gpio_free(OLPC_GPIO_ECSCI);
396} 396}
397 397
398static int __devinit setup_lid_events(void) 398static int setup_lid_events(void)
399{ 399{
400 int r; 400 int r;
401 401
@@ -432,7 +432,7 @@ static void free_lid_events(void)
432 gpio_free(OLPC_GPIO_LID); 432 gpio_free(OLPC_GPIO_LID);
433} 433}
434 434
435static int __devinit setup_power_button(struct platform_device *pdev) 435static int setup_power_button(struct platform_device *pdev)
436{ 436{
437 int r; 437 int r;
438 438
@@ -463,7 +463,7 @@ static void free_power_button(void)
463 input_free_device(power_button_idev); 463 input_free_device(power_button_idev);
464} 464}
465 465
466static int __devinit setup_ebook_switch(struct platform_device *pdev) 466static int setup_ebook_switch(struct platform_device *pdev)
467{ 467{
468 int r; 468 int r;
469 469
@@ -494,7 +494,7 @@ static void free_ebook_switch(void)
494 input_free_device(ebook_switch_idev); 494 input_free_device(ebook_switch_idev);
495} 495}
496 496
497static int __devinit setup_lid_switch(struct platform_device *pdev) 497static int setup_lid_switch(struct platform_device *pdev)
498{ 498{
499 int r; 499 int r;
500 500
@@ -538,7 +538,7 @@ static void free_lid_switch(void)
538 input_free_device(lid_switch_idev); 538 input_free_device(lid_switch_idev);
539} 539}
540 540
541static int __devinit xo1_sci_probe(struct platform_device *pdev) 541static int xo1_sci_probe(struct platform_device *pdev)
542{ 542{
543 struct resource *res; 543 struct resource *res;
544 int r; 544 int r;
@@ -613,7 +613,7 @@ err_ebook:
613 return r; 613 return r;
614} 614}
615 615
616static int __devexit xo1_sci_remove(struct platform_device *pdev) 616static int xo1_sci_remove(struct platform_device *pdev)
617{ 617{
618 mfd_cell_disable(pdev); 618 mfd_cell_disable(pdev);
619 free_irq(sci_irq, pdev); 619 free_irq(sci_irq, pdev);
@@ -632,7 +632,7 @@ static struct platform_driver xo1_sci_driver = {
632 .name = "olpc-xo1-sci-acpi", 632 .name = "olpc-xo1-sci-acpi",
633 }, 633 },
634 .probe = xo1_sci_probe, 634 .probe = xo1_sci_probe,
635 .remove = __devexit_p(xo1_sci_remove), 635 .remove = xo1_sci_remove,
636 .suspend = xo1_sci_suspend, 636 .suspend = xo1_sci_suspend,
637 .resume = xo1_sci_resume, 637 .resume = xo1_sci_resume,
638}; 638};
diff --git a/arch/x86/platform/scx200/scx200_32.c b/arch/x86/platform/scx200/scx200_32.c
index 7a9ad30d6c9..3dc9aee41d9 100644
--- a/arch/x86/platform/scx200/scx200_32.c
+++ b/arch/x86/platform/scx200/scx200_32.c
@@ -35,7 +35,7 @@ static struct pci_device_id scx200_tbl[] = {
35}; 35};
36MODULE_DEVICE_TABLE(pci,scx200_tbl); 36MODULE_DEVICE_TABLE(pci,scx200_tbl);
37 37
38static int __devinit scx200_probe(struct pci_dev *, const struct pci_device_id *); 38static int scx200_probe(struct pci_dev *, const struct pci_device_id *);
39 39
40static struct pci_driver scx200_pci_driver = { 40static struct pci_driver scx200_pci_driver = {
41 .name = "scx200", 41 .name = "scx200",
@@ -45,7 +45,7 @@ static struct pci_driver scx200_pci_driver = {
45 45
46static DEFINE_MUTEX(scx200_gpio_config_lock); 46static DEFINE_MUTEX(scx200_gpio_config_lock);
47 47
48static void __devinit scx200_init_shadow(void) 48static void scx200_init_shadow(void)
49{ 49{
50 int bank; 50 int bank;
51 51
@@ -54,7 +54,7 @@ static void __devinit scx200_init_shadow(void)
54 scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank); 54 scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank);
55} 55}
56 56
57static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 57static int scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
58{ 58{
59 unsigned base; 59 unsigned base;
60 60
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index eb30e5ab4ca..b679bf8478f 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -226,16 +226,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
226 struct acpi_memory_info *info; 226 struct acpi_memory_info *info;
227 int node; 227 int node;
228 228
229
230 /* Get the range from the _CRS */
231 result = acpi_memory_get_device_resources(mem_device);
232 if (result) {
233 dev_err(&mem_device->device->dev,
234 "get_device_resources failed\n");
235 mem_device->state = MEMORY_INVALID_STATE;
236 return result;
237 }
238
239 node = acpi_get_node(mem_device->device->handle); 229 node = acpi_get_node(mem_device->device->handle);
240 /* 230 /*
241 * Tell the VM there is more memory here... 231 * Tell the VM there is more memory here...
@@ -342,14 +332,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
342 break; 332 break;
343 } 333 }
344 334
345 if (acpi_memory_check_device(mem_device))
346 break;
347
348 if (acpi_memory_enable_device(mem_device)) {
349 acpi_handle_err(handle,"Cannot enable memory device\n");
350 break;
351 }
352
353 ost_code = ACPI_OST_SC_SUCCESS; 335 ost_code = ACPI_OST_SC_SUCCESS;
354 break; 336 break;
355 337
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index c8bc24bd1f7..bc7a03ded06 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -162,5 +162,5 @@ acpi-y += \
162 utxferror.o \ 162 utxferror.o \
163 utxfmutex.o 163 utxfmutex.o
164 164
165acpi-$(ACPI_FUTURE_USAGE) += uttrack.o utcache.o utclib.o 165acpi-$(ACPI_FUTURE_USAGE) += uttrack.o utcache.o
166 166
diff --git a/drivers/acpi/acpica/utclib.c b/drivers/acpi/acpica/utclib.c
deleted file mode 100644
index 19ea4755aa7..00000000000
--- a/drivers/acpi/acpica/utclib.c
+++ /dev/null
@@ -1,749 +0,0 @@
1/******************************************************************************
2 *
3 * Module Name: cmclib - Local implementation of C library functions
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46
47/*
48 * These implementations of standard C Library routines can optionally be
49 * used if a C library is not available. In general, they are less efficient
50 * than an inline or assembly implementation
51 */
52
53#define _COMPONENT ACPI_UTILITIES
54ACPI_MODULE_NAME("cmclib")
55
56#ifndef ACPI_USE_SYSTEM_CLIBRARY
57#define NEGATIVE 1
58#define POSITIVE 0
59/*******************************************************************************
60 *
61 * FUNCTION: acpi_ut_memcmp (memcmp)
62 *
63 * PARAMETERS: buffer1 - First Buffer
64 * buffer2 - Second Buffer
65 * count - Maximum # of bytes to compare
66 *
67 * RETURN: Index where Buffers mismatched, or 0 if Buffers matched
68 *
69 * DESCRIPTION: Compare two Buffers, with a maximum length
70 *
71 ******************************************************************************/
72int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count)
73{
74
75 return ((count == ACPI_SIZE_MAX) ? 0 : ((unsigned char)*buffer1 -
76 (unsigned char)*buffer2));
77}
78
79/*******************************************************************************
80 *
81 * FUNCTION: acpi_ut_memcpy (memcpy)
82 *
83 * PARAMETERS: dest - Target of the copy
84 * src - Source buffer to copy
85 * count - Number of bytes to copy
86 *
87 * RETURN: Dest
88 *
89 * DESCRIPTION: Copy arbitrary bytes of memory
90 *
91 ******************************************************************************/
92
93void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count)
94{
95 char *new = (char *)dest;
96 char *old = (char *)src;
97
98 while (count) {
99 *new = *old;
100 new++;
101 old++;
102 count--;
103 }
104
105 return (dest);
106}
107
108/*******************************************************************************
109 *
110 * FUNCTION: acpi_ut_memset (memset)
111 *
112 * PARAMETERS: dest - Buffer to set
113 * value - Value to set each byte of memory
114 * count - Number of bytes to set
115 *
116 * RETURN: Dest
117 *
118 * DESCRIPTION: Initialize a buffer to a known value.
119 *
120 ******************************************************************************/
121
122void *acpi_ut_memset(void *dest, u8 value, acpi_size count)
123{
124 char *new = (char *)dest;
125
126 while (count) {
127 *new = (char)value;
128 new++;
129 count--;
130 }
131
132 return (dest);
133}
134
135/*******************************************************************************
136 *
137 * FUNCTION: acpi_ut_strlen (strlen)
138 *
139 * PARAMETERS: string - Null terminated string
140 *
141 * RETURN: Length
142 *
143 * DESCRIPTION: Returns the length of the input string
144 *
145 ******************************************************************************/
146
147acpi_size acpi_ut_strlen(const char *string)
148{
149 u32 length = 0;
150
151 /* Count the string until a null is encountered */
152
153 while (*string) {
154 length++;
155 string++;
156 }
157
158 return (length);
159}
160
161/*******************************************************************************
162 *
163 * FUNCTION: acpi_ut_strcpy (strcpy)
164 *
165 * PARAMETERS: dst_string - Target of the copy
166 * src_string - The source string to copy
167 *
168 * RETURN: dst_string
169 *
170 * DESCRIPTION: Copy a null terminated string
171 *
172 ******************************************************************************/
173
174char *acpi_ut_strcpy(char *dst_string, const char *src_string)
175{
176 char *string = dst_string;
177
178 /* Move bytes brute force */
179
180 while (*src_string) {
181 *string = *src_string;
182
183 string++;
184 src_string++;
185 }
186
187 /* Null terminate */
188
189 *string = 0;
190 return (dst_string);
191}
192
193/*******************************************************************************
194 *
195 * FUNCTION: acpi_ut_strncpy (strncpy)
196 *
197 * PARAMETERS: dst_string - Target of the copy
198 * src_string - The source string to copy
199 * count - Maximum # of bytes to copy
200 *
201 * RETURN: dst_string
202 *
203 * DESCRIPTION: Copy a null terminated string, with a maximum length
204 *
205 ******************************************************************************/
206
207char *acpi_ut_strncpy(char *dst_string, const char *src_string, acpi_size count)
208{
209 char *string = dst_string;
210
211 /* Copy the string */
212
213 for (string = dst_string;
214 count && (count--, (*string++ = *src_string++));) {;
215 }
216
217 /* Pad with nulls if necessary */
218
219 while (count--) {
220 *string = 0;
221 string++;
222 }
223
224 /* Return original pointer */
225
226 return (dst_string);
227}
228
229/*******************************************************************************
230 *
231 * FUNCTION: acpi_ut_strcmp (strcmp)
232 *
233 * PARAMETERS: string1 - First string
234 * string2 - Second string
235 *
236 * RETURN: Index where strings mismatched, or 0 if strings matched
237 *
238 * DESCRIPTION: Compare two null terminated strings
239 *
240 ******************************************************************************/
241
242int acpi_ut_strcmp(const char *string1, const char *string2)
243{
244
245 for (; (*string1 == *string2); string2++) {
246 if (!*string1++) {
247 return (0);
248 }
249 }
250
251 return ((unsigned char)*string1 - (unsigned char)*string2);
252}
253
254#ifdef ACPI_FUTURE_IMPLEMENTATION
255/* Not used at this time */
256/*******************************************************************************
257 *
258 * FUNCTION: acpi_ut_strchr (strchr)
259 *
260 * PARAMETERS: string - Search string
261 * ch - character to search for
262 *
263 * RETURN: Ptr to char or NULL if not found
264 *
265 * DESCRIPTION: Search a string for a character
266 *
267 ******************************************************************************/
268
269char *acpi_ut_strchr(const char *string, int ch)
270{
271
272 for (; (*string); string++) {
273 if ((*string) == (char)ch) {
274 return ((char *)string);
275 }
276 }
277
278 return (NULL);
279}
280#endif
281
282/*******************************************************************************
283 *
284 * FUNCTION: acpi_ut_strncmp (strncmp)
285 *
286 * PARAMETERS: string1 - First string
287 * string2 - Second string
288 * count - Maximum # of bytes to compare
289 *
290 * RETURN: Index where strings mismatched, or 0 if strings matched
291 *
292 * DESCRIPTION: Compare two null terminated strings, with a maximum length
293 *
294 ******************************************************************************/
295
296int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count)
297{
298
299 for (; count-- && (*string1 == *string2); string2++) {
300 if (!*string1++) {
301 return (0);
302 }
303 }
304
305 return ((count == ACPI_SIZE_MAX) ? 0 : ((unsigned char)*string1 -
306 (unsigned char)*string2));
307}
308
309/*******************************************************************************
310 *
311 * FUNCTION: acpi_ut_strcat (Strcat)
312 *
313 * PARAMETERS: dst_string - Target of the copy
314 * src_string - The source string to copy
315 *
316 * RETURN: dst_string
317 *
318 * DESCRIPTION: Append a null terminated string to a null terminated string
319 *
320 ******************************************************************************/
321
322char *acpi_ut_strcat(char *dst_string, const char *src_string)
323{
324 char *string;
325
326 /* Find end of the destination string */
327
328 for (string = dst_string; *string++;) {;
329 }
330
331 /* Concatenate the string */
332
333 for (--string; (*string++ = *src_string++);) {;
334 }
335
336 return (dst_string);
337}
338
339/*******************************************************************************
340 *
341 * FUNCTION: acpi_ut_strncat (strncat)
342 *
343 * PARAMETERS: dst_string - Target of the copy
344 * src_string - The source string to copy
345 * count - Maximum # of bytes to copy
346 *
347 * RETURN: dst_string
348 *
349 * DESCRIPTION: Append a null terminated string to a null terminated string,
350 * with a maximum count.
351 *
352 ******************************************************************************/
353
354char *acpi_ut_strncat(char *dst_string, const char *src_string, acpi_size count)
355{
356 char *string;
357
358 if (count) {
359
360 /* Find end of the destination string */
361
362 for (string = dst_string; *string++;) {;
363 }
364
365 /* Concatenate the string */
366
367 for (--string; (*string++ = *src_string++) && --count;) {;
368 }
369
370 /* Null terminate if necessary */
371
372 if (!count) {
373 *string = 0;
374 }
375 }
376
377 return (dst_string);
378}
379
380/*******************************************************************************
381 *
382 * FUNCTION: acpi_ut_strstr (strstr)
383 *
384 * PARAMETERS: string1 - Target string
385 * string2 - Substring to search for
386 *
387 * RETURN: Where substring match starts, Null if no match found
388 *
389 * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
390 * full implementation of strstr, only sufficient for command
391 * matching
392 *
393 ******************************************************************************/
394
395char *acpi_ut_strstr(char *string1, char *string2)
396{
397 char *string;
398
399 if (acpi_ut_strlen(string2) > acpi_ut_strlen(string1)) {
400 return (NULL);
401 }
402
403 /* Walk entire string, comparing the letters */
404
405 for (string = string1; *string2;) {
406 if (*string2 != *string) {
407 return (NULL);
408 }
409
410 string2++;
411 string++;
412 }
413
414 return (string1);
415}
416
417/*******************************************************************************
418 *
419 * FUNCTION: acpi_ut_strtoul (strtoul)
420 *
421 * PARAMETERS: string - Null terminated string
422 * terminater - Where a pointer to the terminating byte is
423 * returned
424 * base - Radix of the string
425 *
426 * RETURN: Converted value
427 *
428 * DESCRIPTION: Convert a string into a 32-bit unsigned value.
429 * Note: use acpi_ut_strtoul64 for 64-bit integers.
430 *
431 ******************************************************************************/
432
433u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base)
434{
435 u32 converted = 0;
436 u32 index;
437 u32 sign;
438 const char *string_start;
439 u32 return_value = 0;
440 acpi_status status = AE_OK;
441
442 /*
443 * Save the value of the pointer to the buffer's first
444 * character, save the current errno value, and then
445 * skip over any white space in the buffer:
446 */
447 string_start = string;
448 while (ACPI_IS_SPACE(*string) || *string == '\t') {
449 ++string;
450 }
451
452 /*
453 * The buffer may contain an optional plus or minus sign.
454 * If it does, then skip over it but remember what is was:
455 */
456 if (*string == '-') {
457 sign = NEGATIVE;
458 ++string;
459 } else if (*string == '+') {
460 ++string;
461 sign = POSITIVE;
462 } else {
463 sign = POSITIVE;
464 }
465
466 /*
467 * If the input parameter Base is zero, then we need to
468 * determine if it is octal, decimal, or hexadecimal:
469 */
470 if (base == 0) {
471 if (*string == '0') {
472 if (acpi_ut_to_lower(*(++string)) == 'x') {
473 base = 16;
474 ++string;
475 } else {
476 base = 8;
477 }
478 } else {
479 base = 10;
480 }
481 } else if (base < 2 || base > 36) {
482 /*
483 * The specified Base parameter is not in the domain of
484 * this function:
485 */
486 goto done;
487 }
488
489 /*
490 * For octal and hexadecimal bases, skip over the leading
491 * 0 or 0x, if they are present.
492 */
493 if (base == 8 && *string == '0') {
494 string++;
495 }
496
497 if (base == 16 &&
498 *string == '0' && acpi_ut_to_lower(*(++string)) == 'x') {
499 string++;
500 }
501
502 /*
503 * Main loop: convert the string to an unsigned long:
504 */
505 while (*string) {
506 if (ACPI_IS_DIGIT(*string)) {
507 index = (u32)((u8)*string - '0');
508 } else {
509 index = (u32)acpi_ut_to_upper(*string);
510 if (ACPI_IS_UPPER(index)) {
511 index = index - 'A' + 10;
512 } else {
513 goto done;
514 }
515 }
516
517 if (index >= base) {
518 goto done;
519 }
520
521 /*
522 * Check to see if value is out of range:
523 */
524
525 if (return_value > ((ACPI_UINT32_MAX - (u32)index) / (u32)base)) {
526 status = AE_ERROR;
527 return_value = 0; /* reset */
528 } else {
529 return_value *= base;
530 return_value += index;
531 converted = 1;
532 }
533
534 ++string;
535 }
536
537 done:
538 /*
539 * If appropriate, update the caller's pointer to the next
540 * unconverted character in the buffer.
541 */
542 if (terminator) {
543 if (converted == 0 && return_value == 0 && string != NULL) {
544 *terminator = (char *)string_start;
545 } else {
546 *terminator = (char *)string;
547 }
548 }
549
550 if (status == AE_ERROR) {
551 return_value = ACPI_UINT32_MAX;
552 }
553
554 /*
555 * If a minus sign was present, then "the conversion is negated":
556 */
557 if (sign == NEGATIVE) {
558 return_value = (ACPI_UINT32_MAX - return_value) + 1;
559 }
560
561 return (return_value);
562}
563
564/*******************************************************************************
565 *
566 * FUNCTION: acpi_ut_to_upper (TOUPPER)
567 *
568 * PARAMETERS: c - Character to convert
569 *
570 * RETURN: Converted character as an int
571 *
572 * DESCRIPTION: Convert character to uppercase
573 *
574 ******************************************************************************/
575
576int acpi_ut_to_upper(int c)
577{
578
579 return (ACPI_IS_LOWER(c) ? ((c) - 0x20) : (c));
580}
581
582/*******************************************************************************
583 *
584 * FUNCTION: acpi_ut_to_lower (TOLOWER)
585 *
586 * PARAMETERS: c - Character to convert
587 *
588 * RETURN: Converted character as an int
589 *
590 * DESCRIPTION: Convert character to lowercase
591 *
592 ******************************************************************************/
593
594int acpi_ut_to_lower(int c)
595{
596
597 return (ACPI_IS_UPPER(c) ? ((c) + 0x20) : (c));
598}
599
600/*******************************************************************************
601 *
602 * FUNCTION: is* functions
603 *
604 * DESCRIPTION: is* functions use the ctype table below
605 *
606 ******************************************************************************/
607
608const u8 _acpi_ctype[257] = {
609 _ACPI_CN, /* 0x00 0 NUL */
610 _ACPI_CN, /* 0x01 1 SOH */
611 _ACPI_CN, /* 0x02 2 STX */
612 _ACPI_CN, /* 0x03 3 ETX */
613 _ACPI_CN, /* 0x04 4 EOT */
614 _ACPI_CN, /* 0x05 5 ENQ */
615 _ACPI_CN, /* 0x06 6 ACK */
616 _ACPI_CN, /* 0x07 7 BEL */
617 _ACPI_CN, /* 0x08 8 BS */
618 _ACPI_CN | _ACPI_SP, /* 0x09 9 TAB */
619 _ACPI_CN | _ACPI_SP, /* 0x0A 10 LF */
620 _ACPI_CN | _ACPI_SP, /* 0x0B 11 VT */
621 _ACPI_CN | _ACPI_SP, /* 0x0C 12 FF */
622 _ACPI_CN | _ACPI_SP, /* 0x0D 13 CR */
623 _ACPI_CN, /* 0x0E 14 SO */
624 _ACPI_CN, /* 0x0F 15 SI */
625 _ACPI_CN, /* 0x10 16 DLE */
626 _ACPI_CN, /* 0x11 17 DC1 */
627 _ACPI_CN, /* 0x12 18 DC2 */
628 _ACPI_CN, /* 0x13 19 DC3 */
629 _ACPI_CN, /* 0x14 20 DC4 */
630 _ACPI_CN, /* 0x15 21 NAK */
631 _ACPI_CN, /* 0x16 22 SYN */
632 _ACPI_CN, /* 0x17 23 ETB */
633 _ACPI_CN, /* 0x18 24 CAN */
634 _ACPI_CN, /* 0x19 25 EM */
635 _ACPI_CN, /* 0x1A 26 SUB */
636 _ACPI_CN, /* 0x1B 27 ESC */
637 _ACPI_CN, /* 0x1C 28 FS */
638 _ACPI_CN, /* 0x1D 29 GS */
639 _ACPI_CN, /* 0x1E 30 RS */
640 _ACPI_CN, /* 0x1F 31 US */
641 _ACPI_XS | _ACPI_SP, /* 0x20 32 ' ' */
642 _ACPI_PU, /* 0x21 33 '!' */
643 _ACPI_PU, /* 0x22 34 '"' */
644 _ACPI_PU, /* 0x23 35 '#' */
645 _ACPI_PU, /* 0x24 36 '$' */
646 _ACPI_PU, /* 0x25 37 '%' */
647 _ACPI_PU, /* 0x26 38 '&' */
648 _ACPI_PU, /* 0x27 39 ''' */
649 _ACPI_PU, /* 0x28 40 '(' */
650 _ACPI_PU, /* 0x29 41 ')' */
651 _ACPI_PU, /* 0x2A 42 '*' */
652 _ACPI_PU, /* 0x2B 43 '+' */
653 _ACPI_PU, /* 0x2C 44 ',' */
654 _ACPI_PU, /* 0x2D 45 '-' */
655 _ACPI_PU, /* 0x2E 46 '.' */
656 _ACPI_PU, /* 0x2F 47 '/' */
657 _ACPI_XD | _ACPI_DI, /* 0x30 48 '0' */
658 _ACPI_XD | _ACPI_DI, /* 0x31 49 '1' */
659 _ACPI_XD | _ACPI_DI, /* 0x32 50 '2' */
660 _ACPI_XD | _ACPI_DI, /* 0x33 51 '3' */
661 _ACPI_XD | _ACPI_DI, /* 0x34 52 '4' */
662 _ACPI_XD | _ACPI_DI, /* 0x35 53 '5' */
663 _ACPI_XD | _ACPI_DI, /* 0x36 54 '6' */
664 _ACPI_XD | _ACPI_DI, /* 0x37 55 '7' */
665 _ACPI_XD | _ACPI_DI, /* 0x38 56 '8' */
666 _ACPI_XD | _ACPI_DI, /* 0x39 57 '9' */
667 _ACPI_PU, /* 0x3A 58 ':' */
668 _ACPI_PU, /* 0x3B 59 ';' */
669 _ACPI_PU, /* 0x3C 60 '<' */
670 _ACPI_PU, /* 0x3D 61 '=' */
671 _ACPI_PU, /* 0x3E 62 '>' */
672 _ACPI_PU, /* 0x3F 63 '?' */
673 _ACPI_PU, /* 0x40 64 '@' */
674 _ACPI_XD | _ACPI_UP, /* 0x41 65 'A' */
675 _ACPI_XD | _ACPI_UP, /* 0x42 66 'B' */
676 _ACPI_XD | _ACPI_UP, /* 0x43 67 'C' */
677 _ACPI_XD | _ACPI_UP, /* 0x44 68 'D' */
678 _ACPI_XD | _ACPI_UP, /* 0x45 69 'E' */
679 _ACPI_XD | _ACPI_UP, /* 0x46 70 'F' */
680 _ACPI_UP, /* 0x47 71 'G' */
681 _ACPI_UP, /* 0x48 72 'H' */
682 _ACPI_UP, /* 0x49 73 'I' */
683 _ACPI_UP, /* 0x4A 74 'J' */
684 _ACPI_UP, /* 0x4B 75 'K' */
685 _ACPI_UP, /* 0x4C 76 'L' */
686 _ACPI_UP, /* 0x4D 77 'M' */
687 _ACPI_UP, /* 0x4E 78 'N' */
688 _ACPI_UP, /* 0x4F 79 'O' */
689 _ACPI_UP, /* 0x50 80 'P' */
690 _ACPI_UP, /* 0x51 81 'Q' */
691 _ACPI_UP, /* 0x52 82 'R' */
692 _ACPI_UP, /* 0x53 83 'S' */
693 _ACPI_UP, /* 0x54 84 'T' */
694 _ACPI_UP, /* 0x55 85 'U' */
695 _ACPI_UP, /* 0x56 86 'V' */
696 _ACPI_UP, /* 0x57 87 'W' */
697 _ACPI_UP, /* 0x58 88 'X' */
698 _ACPI_UP, /* 0x59 89 'Y' */
699 _ACPI_UP, /* 0x5A 90 'Z' */
700 _ACPI_PU, /* 0x5B 91 '[' */
701 _ACPI_PU, /* 0x5C 92 '\' */
702 _ACPI_PU, /* 0x5D 93 ']' */
703 _ACPI_PU, /* 0x5E 94 '^' */
704 _ACPI_PU, /* 0x5F 95 '_' */
705 _ACPI_PU, /* 0x60 96 '`' */
706 _ACPI_XD | _ACPI_LO, /* 0x61 97 'a' */
707 _ACPI_XD | _ACPI_LO, /* 0x62 98 'b' */
708 _ACPI_XD | _ACPI_LO, /* 0x63 99 'c' */
709 _ACPI_XD | _ACPI_LO, /* 0x64 100 'd' */
710 _ACPI_XD | _ACPI_LO, /* 0x65 101 'e' */
711 _ACPI_XD | _ACPI_LO, /* 0x66 102 'f' */
712 _ACPI_LO, /* 0x67 103 'g' */
713 _ACPI_LO, /* 0x68 104 'h' */
714 _ACPI_LO, /* 0x69 105 'i' */
715 _ACPI_LO, /* 0x6A 106 'j' */
716 _ACPI_LO, /* 0x6B 107 'k' */
717 _ACPI_LO, /* 0x6C 108 'l' */
718 _ACPI_LO, /* 0x6D 109 'm' */
719 _ACPI_LO, /* 0x6E 110 'n' */
720 _ACPI_LO, /* 0x6F 111 'o' */
721 _ACPI_LO, /* 0x70 112 'p' */
722 _ACPI_LO, /* 0x71 113 'q' */
723 _ACPI_LO, /* 0x72 114 'r' */
724 _ACPI_LO, /* 0x73 115 's' */
725 _ACPI_LO, /* 0x74 116 't' */
726 _ACPI_LO, /* 0x75 117 'u' */
727 _ACPI_LO, /* 0x76 118 'v' */
728 _ACPI_LO, /* 0x77 119 'w' */
729 _ACPI_LO, /* 0x78 120 'x' */
730 _ACPI_LO, /* 0x79 121 'y' */
731 _ACPI_LO, /* 0x7A 122 'z' */
732 _ACPI_PU, /* 0x7B 123 '{' */
733 _ACPI_PU, /* 0x7C 124 '|' */
734 _ACPI_PU, /* 0x7D 125 '}' */
735 _ACPI_PU, /* 0x7E 126 '~' */
736 _ACPI_CN, /* 0x7F 127 DEL */
737
738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 to 0x8F */
739 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 to 0x9F */
740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 to 0xAF */
741 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 to 0xBF */
742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 to 0xCF */
743 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 to 0xDF */
744 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 to 0xEF */
745 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 to 0xFF */
746 0 /* 0x100 */
747};
748
749#endif /* ACPI_USE_SYSTEM_CLIBRARY */
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 903549df809..04ab5c9d3ce 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -111,8 +111,17 @@ retry_next:
111 if (rc) 111 if (rc)
112 goto out; 112 goto out;
113 /* no more record */ 113 /* no more record */
114 if (id == APEI_ERST_INVALID_RECORD_ID) 114 if (id == APEI_ERST_INVALID_RECORD_ID) {
115 /*
116 * If the persistent store is empty initially, the function
117 * 'erst_read' below will return "-ENOENT" value. This causes
118 * 'retry_next' label is entered again. The returned value
119 * should be zero indicating the read operation is EOF.
120 */
121 len = 0;
122
115 goto out; 123 goto out;
124 }
116retry: 125retry:
117 rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len); 126 rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len);
118 /* The record may be cleared by others, try read next record */ 127 /* The record may be cleared by others, try read next record */
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index f09dc987cf1..c6ff606c6d5 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
358 acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 358 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
359 struct acpi_device *adev; 359 struct acpi_device *adev;
360 360
361 return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ? 361 return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
362 adev : NULL;
363} 362}
364 363
365/** 364/**
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 01551840d23..95af6f674a6 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -18,9 +18,14 @@
18 18
19#define ACPI_GLUE_DEBUG 0 19#define ACPI_GLUE_DEBUG 0
20#if ACPI_GLUE_DEBUG 20#if ACPI_GLUE_DEBUG
21#define DBG(x...) printk(PREFIX x) 21#define DBG(fmt, ...) \
22 printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__)
22#else 23#else
23#define DBG(x...) do { } while(0) 24#define DBG(fmt, ...) \
25do { \
26 if (0) \
27 printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__); \
28} while (0)
24#endif 29#endif
25static LIST_HEAD(bus_type_list); 30static LIST_HEAD(bus_type_list);
26static DECLARE_RWSEM(bus_type_sem); 31static DECLARE_RWSEM(bus_type_sem);
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 7db61b8fa11..6e7b9d52381 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -445,11 +445,8 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
445 return -ENODEV; 445 return -ENODEV;
446 446
447 ret = acpi_bus_get_device(handle, &acpi_dev); 447 ret = acpi_bus_get_device(handle, &acpi_dev);
448 if (ret) 448 if (ret || !acpi_dev->power.flags.power_resources)
449 goto no_power_resource; 449 return -ENODEV;
450
451 if (!acpi_dev->power.flags.power_resources)
452 goto no_power_resource;
453 450
454 powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL); 451 powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL);
455 if (!powered_device) 452 if (!powered_device)
@@ -471,10 +468,6 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
471 } 468 }
472 469
473 return ret; 470 return ret;
474
475no_power_resource:
476 printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!\n");
477 return -ENODEV;
478} 471}
479EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); 472EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);
480 473
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 53502d1bbf2..c88be6c37c3 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1346,7 +1346,7 @@ static void acpi_device_set_id(struct acpi_device *device)
1346 acpi_add_id(device, ACPI_DOCK_HID); 1346 acpi_add_id(device, ACPI_DOCK_HID);
1347 else if (!acpi_ibm_smbus_match(device)) 1347 else if (!acpi_ibm_smbus_match(device))
1348 acpi_add_id(device, ACPI_SMBUS_IBM_HID); 1348 acpi_add_id(device, ACPI_SMBUS_IBM_HID);
1349 else if (!acpi_device_hid(device) && 1349 else if (list_empty(&device->pnp.ids) &&
1350 ACPI_IS_ROOT_DEVICE(device->parent)) { 1350 ACPI_IS_ROOT_DEVICE(device->parent)) {
1351 acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ 1351 acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
1352 strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME); 1352 strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index a2fc56d2e68..cdbad3a454a 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -45,7 +45,6 @@ static int amba_match(struct device *dev, struct device_driver *drv)
45 return amba_lookup(pcdrv->id_table, pcdev) != NULL; 45 return amba_lookup(pcdrv->id_table, pcdev) != NULL;
46} 46}
47 47
48#ifdef CONFIG_HOTPLUG
49static int amba_uevent(struct device *dev, struct kobj_uevent_env *env) 48static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
50{ 49{
51 struct amba_device *pcdev = to_amba_device(dev); 50 struct amba_device *pcdev = to_amba_device(dev);
@@ -58,9 +57,6 @@ static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
58 retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid); 57 retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid);
59 return retval; 58 return retval;
60} 59}
61#else
62#define amba_uevent NULL
63#endif
64 60
65#define amba_attr_func(name,fmt,arg...) \ 61#define amba_attr_func(name,fmt,arg...) \
66static ssize_t name##_show(struct device *_dev, \ 62static ssize_t name##_show(struct device *_dev, \
diff --git a/drivers/amba/tegra-ahb.c b/drivers/amba/tegra-ahb.c
index 0576a7dd32a..536c166f425 100644
--- a/drivers/amba/tegra-ahb.c
+++ b/drivers/amba/tegra-ahb.c
@@ -243,7 +243,7 @@ static void tegra_ahb_gizmo_init(struct tegra_ahb *ahb)
243 gizmo_writel(ahb, val, AHB_MEM_PREFETCH_CFG4); 243 gizmo_writel(ahb, val, AHB_MEM_PREFETCH_CFG4);
244} 244}
245 245
246static int __devinit tegra_ahb_probe(struct platform_device *pdev) 246static int tegra_ahb_probe(struct platform_device *pdev)
247{ 247{
248 struct resource *res; 248 struct resource *res;
249 struct tegra_ahb *ahb; 249 struct tegra_ahb *ahb;
@@ -267,7 +267,7 @@ static int __devinit tegra_ahb_probe(struct platform_device *pdev)
267 return 0; 267 return 0;
268} 268}
269 269
270static const struct of_device_id tegra_ahb_of_match[] __devinitconst = { 270static const struct of_device_id tegra_ahb_of_match[] = {
271 { .compatible = "nvidia,tegra30-ahb", }, 271 { .compatible = "nvidia,tegra30-ahb", },
272 { .compatible = "nvidia,tegra20-ahb", }, 272 { .compatible = "nvidia,tegra20-ahb", },
273 {}, 273 {},
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 1cc467bdb63..7a8a2841fe6 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -86,7 +86,7 @@ static struct scsi_host_template ahci_platform_sht = {
86 AHCI_SHT("ahci_platform"), 86 AHCI_SHT("ahci_platform"),
87}; 87};
88 88
89static int __devinit ahci_probe(struct platform_device *pdev) 89static int ahci_probe(struct platform_device *pdev)
90{ 90{
91 struct device *dev = &pdev->dev; 91 struct device *dev = &pdev->dev;
92 struct ahci_platform_data *pdata = dev_get_platdata(dev); 92 struct ahci_platform_data *pdata = dev_get_platdata(dev);
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index acffcf0b3ad..174eca609b4 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1270,7 +1270,7 @@ static int piix_disable_ahci(struct pci_dev *pdev)
1270 * they are found return an error code so we can turn off DMA 1270 * they are found return an error code so we can turn off DMA
1271 */ 1271 */
1272 1272
1273static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev) 1273static int piix_check_450nx_errata(struct pci_dev *ata_dev)
1274{ 1274{
1275 struct pci_dev *pdev = NULL; 1275 struct pci_dev *pdev = NULL;
1276 u16 cfg; 1276 u16 cfg;
@@ -1296,8 +1296,8 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
1296 return no_piix_dma; 1296 return no_piix_dma;
1297} 1297}
1298 1298
1299static void __devinit piix_init_pcs(struct ata_host *host, 1299static void piix_init_pcs(struct ata_host *host,
1300 const struct piix_map_db *map_db) 1300 const struct piix_map_db *map_db)
1301{ 1301{
1302 struct pci_dev *pdev = to_pci_dev(host->dev); 1302 struct pci_dev *pdev = to_pci_dev(host->dev);
1303 u16 pcs, new_pcs; 1303 u16 pcs, new_pcs;
@@ -1313,9 +1313,9 @@ static void __devinit piix_init_pcs(struct ata_host *host,
1313 } 1313 }
1314} 1314}
1315 1315
1316static const int *__devinit piix_init_sata_map(struct pci_dev *pdev, 1316static const int *piix_init_sata_map(struct pci_dev *pdev,
1317 struct ata_port_info *pinfo, 1317 struct ata_port_info *pinfo,
1318 const struct piix_map_db *map_db) 1318 const struct piix_map_db *map_db)
1319{ 1319{
1320 const int *map; 1320 const int *map;
1321 int i, invalid_map = 0; 1321 int i, invalid_map = 0;
@@ -1392,7 +1392,7 @@ static bool piix_no_sidpr(struct ata_host *host)
1392 return false; 1392 return false;
1393} 1393}
1394 1394
1395static int __devinit piix_init_sidpr(struct ata_host *host) 1395static int piix_init_sidpr(struct ata_host *host)
1396{ 1396{
1397 struct pci_dev *pdev = to_pci_dev(host->dev); 1397 struct pci_dev *pdev = to_pci_dev(host->dev);
1398 struct piix_host_priv *hpriv = host->private_data; 1398 struct piix_host_priv *hpriv = host->private_data;
@@ -1595,8 +1595,7 @@ static void piix_ignore_devices_quirk(struct ata_host *host)
1595 * Zero on success, or -ERRNO value. 1595 * Zero on success, or -ERRNO value.
1596 */ 1596 */
1597 1597
1598static int __devinit piix_init_one(struct pci_dev *pdev, 1598static int piix_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1599 const struct pci_device_id *ent)
1600{ 1599{
1601 struct device *dev = &pdev->dev; 1600 struct device *dev = &pdev->dev;
1602 struct ata_port_info port_info[2]; 1601 struct ata_port_info port_info[2];
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 9764e80f932..405022d302c 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -791,7 +791,7 @@ static struct ata_port_operations arasan_cf_ops = {
791 .set_dmamode = arasan_cf_set_dmamode, 791 .set_dmamode = arasan_cf_set_dmamode,
792}; 792};
793 793
794static int __devinit arasan_cf_probe(struct platform_device *pdev) 794static int arasan_cf_probe(struct platform_device *pdev)
795{ 795{
796 struct arasan_cf_dev *acdev; 796 struct arasan_cf_dev *acdev;
797 struct arasan_cf_pdata *pdata = dev_get_platdata(&pdev->dev); 797 struct arasan_cf_pdata *pdata = dev_get_platdata(&pdev->dev);
@@ -905,7 +905,7 @@ free_clk:
905 return ret; 905 return ret;
906} 906}
907 907
908static int __devexit arasan_cf_remove(struct platform_device *pdev) 908static int arasan_cf_remove(struct platform_device *pdev)
909{ 909{
910 struct ata_host *host = dev_get_drvdata(&pdev->dev); 910 struct ata_host *host = dev_get_drvdata(&pdev->dev);
911 struct arasan_cf_dev *acdev = host->ports[0]->private_data; 911 struct arasan_cf_dev *acdev = host->ports[0]->private_data;
@@ -955,7 +955,7 @@ MODULE_DEVICE_TABLE(of, arasan_cf_id_table);
955 955
956static struct platform_driver arasan_cf_driver = { 956static struct platform_driver arasan_cf_driver = {
957 .probe = arasan_cf_probe, 957 .probe = arasan_cf_probe,
958 .remove = __devexit_p(arasan_cf_remove), 958 .remove = arasan_cf_remove,
959 .driver = { 959 .driver = {
960 .name = DRIVER_NAME, 960 .name = DRIVER_NAME,
961 .owner = THIS_MODULE, 961 .owner = THIS_MODULE,
diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index 2a96bb2c53e..033f3f4c20a 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -313,7 +313,7 @@ static struct ata_port_operations pata_at91_port_ops = {
313 .cable_detect = ata_cable_40wire, 313 .cable_detect = ata_cable_40wire,
314}; 314};
315 315
316static int __devinit pata_at91_probe(struct platform_device *pdev) 316static int pata_at91_probe(struct platform_device *pdev)
317{ 317{
318 struct at91_cf_data *board = pdev->dev.platform_data; 318 struct at91_cf_data *board = pdev->dev.platform_data;
319 struct device *dev = &pdev->dev; 319 struct device *dev = &pdev->dev;
@@ -420,7 +420,7 @@ err_put:
420 return ret; 420 return ret;
421} 421}
422 422
423static int __devexit pata_at91_remove(struct platform_device *pdev) 423static int pata_at91_remove(struct platform_device *pdev)
424{ 424{
425 struct ata_host *host = dev_get_drvdata(&pdev->dev); 425 struct ata_host *host = dev_get_drvdata(&pdev->dev);
426 struct at91_ide_info *info; 426 struct at91_ide_info *info;
@@ -441,7 +441,7 @@ static int __devexit pata_at91_remove(struct platform_device *pdev)
441 441
442static struct platform_driver pata_at91_driver = { 442static struct platform_driver pata_at91_driver = {
443 .probe = pata_at91_probe, 443 .probe = pata_at91_probe,
444 .remove = __devexit_p(pata_at91_remove), 444 .remove = pata_at91_remove,
445 .driver = { 445 .driver = {
446 .name = DRV_NAME, 446 .name = DRV_NAME,
447 .owner = THIS_MODULE, 447 .owner = THIS_MODULE,
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 1e65842e2ca..8d43510c6be 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1538,7 +1538,7 @@ static unsigned short atapi_io_port[] = {
1538 * - IRQ (IORESOURCE_IRQ) 1538 * - IRQ (IORESOURCE_IRQ)
1539 * 1539 *
1540 */ 1540 */
1541static int __devinit bfin_atapi_probe(struct platform_device *pdev) 1541static int bfin_atapi_probe(struct platform_device *pdev)
1542{ 1542{
1543 int board_idx = 0; 1543 int board_idx = 0;
1544 struct resource *res; 1544 struct resource *res;
@@ -1608,7 +1608,7 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
1608 * A bfin atapi device has been unplugged. Perform the needed 1608 * A bfin atapi device has been unplugged. Perform the needed
1609 * cleanup. Also called on module unload for any active devices. 1609 * cleanup. Also called on module unload for any active devices.
1610 */ 1610 */
1611static int __devexit bfin_atapi_remove(struct platform_device *pdev) 1611static int bfin_atapi_remove(struct platform_device *pdev)
1612{ 1612{
1613 struct device *dev = &pdev->dev; 1613 struct device *dev = &pdev->dev;
1614 struct ata_host *host = dev_get_drvdata(dev); 1614 struct ata_host *host = dev_get_drvdata(dev);
@@ -1654,7 +1654,7 @@ static int bfin_atapi_resume(struct platform_device *pdev)
1654 1654
1655static struct platform_driver bfin_atapi_driver = { 1655static struct platform_driver bfin_atapi_driver = {
1656 .probe = bfin_atapi_probe, 1656 .probe = bfin_atapi_probe,
1657 .remove = __devexit_p(bfin_atapi_remove), 1657 .remove = bfin_atapi_remove,
1658 .suspend = bfin_atapi_suspend, 1658 .suspend = bfin_atapi_suspend,
1659 .resume = bfin_atapi_resume, 1659 .resume = bfin_atapi_resume,
1660 .driver = { 1660 .driver = {
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index de74d804f03..bfcf377e8f7 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -115,7 +115,7 @@ static struct ata_port_operations cs5520_port_ops = {
115 .set_piomode = cs5520_set_piomode, 115 .set_piomode = cs5520_set_piomode,
116}; 116};
117 117
118static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 118static int cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
119{ 119{
120 static const unsigned int cmd_port[] = { 0x1F0, 0x170 }; 120 static const unsigned int cmd_port[] = { 0x1F0, 0x170 };
121 static const unsigned int ctl_port[] = { 0x3F6, 0x376 }; 121 static const unsigned int ctl_port[] = { 0x3F6, 0x376 };
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index 3982cef91f3..556222f0473 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -910,7 +910,7 @@ static struct ata_port_operations ep93xx_pata_port_ops = {
910 .port_start = ep93xx_pata_port_start, 910 .port_start = ep93xx_pata_port_start,
911}; 911};
912 912
913static int __devinit ep93xx_pata_probe(struct platform_device *pdev) 913static int ep93xx_pata_probe(struct platform_device *pdev)
914{ 914{
915 struct ep93xx_pata_data *drv_data; 915 struct ep93xx_pata_data *drv_data;
916 struct ata_host *host; 916 struct ata_host *host;
@@ -1011,7 +1011,7 @@ err_rel_gpio:
1011 return err; 1011 return err;
1012} 1012}
1013 1013
1014static int __devexit ep93xx_pata_remove(struct platform_device *pdev) 1014static int ep93xx_pata_remove(struct platform_device *pdev)
1015{ 1015{
1016 struct ata_host *host = platform_get_drvdata(pdev); 1016 struct ata_host *host = platform_get_drvdata(pdev);
1017 struct ep93xx_pata_data *drv_data = host->private_data; 1017 struct ep93xx_pata_data *drv_data = host->private_data;
@@ -1029,7 +1029,7 @@ static struct platform_driver ep93xx_pata_platform_driver = {
1029 .owner = THIS_MODULE, 1029 .owner = THIS_MODULE,
1030 }, 1030 },
1031 .probe = ep93xx_pata_probe, 1031 .probe = ep93xx_pata_probe,
1032 .remove = __devexit_p(ep93xx_pata_remove), 1032 .remove = ep93xx_pata_remove,
1033}; 1033};
1034 1034
1035module_platform_driver(ep93xx_pata_platform_driver); 1035module_platform_driver(ep93xx_pata_platform_driver);
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 52e7e7b8c74..d7c732042a4 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -337,10 +337,9 @@ static struct ata_port_operations pata_icside_port_ops = {
337 .port_start = ATA_OP_NULL, /* don't need PRD table */ 337 .port_start = ATA_OP_NULL, /* don't need PRD table */
338}; 338};
339 339
340static void __devinit 340static void pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base,
341pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base, 341 struct pata_icside_info *info,
342 struct pata_icside_info *info, 342 const struct portinfo *port)
343 const struct portinfo *port)
344{ 343{
345 struct ata_ioports *ioaddr = &ap->ioaddr; 344 struct ata_ioports *ioaddr = &ap->ioaddr;
346 void __iomem *cmd = base + port->dataoffset; 345 void __iomem *cmd = base + port->dataoffset;
@@ -368,7 +367,7 @@ pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base,
368 ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base); 367 ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base);
369} 368}
370 369
371static int __devinit pata_icside_register_v5(struct pata_icside_info *info) 370static int pata_icside_register_v5(struct pata_icside_info *info)
372{ 371{
373 struct pata_icside_state *state = info->state; 372 struct pata_icside_state *state = info->state;
374 void __iomem *base; 373 void __iomem *base;
@@ -391,7 +390,7 @@ static int __devinit pata_icside_register_v5(struct pata_icside_info *info)
391 return 0; 390 return 0;
392} 391}
393 392
394static int __devinit pata_icside_register_v6(struct pata_icside_info *info) 393static int pata_icside_register_v6(struct pata_icside_info *info)
395{ 394{
396 struct pata_icside_state *state = info->state; 395 struct pata_icside_state *state = info->state;
397 struct expansion_card *ec = info->ec; 396 struct expansion_card *ec = info->ec;
@@ -434,7 +433,7 @@ static int __devinit pata_icside_register_v6(struct pata_icside_info *info)
434 return icside_dma_init(info); 433 return icside_dma_init(info);
435} 434}
436 435
437static int __devinit pata_icside_add_ports(struct pata_icside_info *info) 436static int pata_icside_add_ports(struct pata_icside_info *info)
438{ 437{
439 struct expansion_card *ec = info->ec; 438 struct expansion_card *ec = info->ec;
440 struct ata_host *host; 439 struct ata_host *host;
@@ -474,8 +473,8 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info)
474 &pata_icside_sht); 473 &pata_icside_sht);
475} 474}
476 475
477static int __devinit 476static int pata_icside_probe(struct expansion_card *ec,
478pata_icside_probe(struct expansion_card *ec, const struct ecard_id *id) 477 const struct ecard_id *id)
479{ 478{
480 struct pata_icside_state *state; 479 struct pata_icside_state *state;
481 struct pata_icside_info info; 480 struct pata_icside_info info;
@@ -575,7 +574,7 @@ static void pata_icside_shutdown(struct expansion_card *ec)
575 } 574 }
576} 575}
577 576
578static void __devexit pata_icside_remove(struct expansion_card *ec) 577static void pata_icside_remove(struct expansion_card *ec)
579{ 578{
580 struct ata_host *host = ecard_get_drvdata(ec); 579 struct ata_host *host = ecard_get_drvdata(ec);
581 struct pata_icside_state *state = host->private_data; 580 struct pata_icside_state *state = host->private_data;
@@ -602,7 +601,7 @@ static const struct ecard_id pata_icside_ids[] = {
602 601
603static struct ecard_driver pata_icside_driver = { 602static struct ecard_driver pata_icside_driver = {
604 .probe = pata_icside_probe, 603 .probe = pata_icside_probe,
605 .remove = __devexit_p(pata_icside_remove), 604 .remove = pata_icside_remove,
606 .shutdown = pata_icside_shutdown, 605 .shutdown = pata_icside_shutdown,
607 .id_table = pata_icside_ids, 606 .id_table = pata_icside_ids,
608 .drv = { 607 .drv = {
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 7d40b526ef1..40849445a9d 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -91,7 +91,7 @@ static void pata_imx_setup_port(struct ata_ioports *ioaddr)
91 ioaddr->command_addr = ioaddr->cmd_addr + (ATA_REG_CMD << 2); 91 ioaddr->command_addr = ioaddr->cmd_addr + (ATA_REG_CMD << 2);
92} 92}
93 93
94static int __devinit pata_imx_probe(struct platform_device *pdev) 94static int pata_imx_probe(struct platform_device *pdev)
95{ 95{
96 struct ata_host *host; 96 struct ata_host *host;
97 struct ata_port *ap; 97 struct ata_port *ap;
@@ -167,7 +167,7 @@ free_priv:
167 return -ENOMEM; 167 return -ENOMEM;
168} 168}
169 169
170static int __devexit pata_imx_remove(struct platform_device *pdev) 170static int pata_imx_remove(struct platform_device *pdev)
171{ 171{
172 struct ata_host *host = dev_get_drvdata(&pdev->dev); 172 struct ata_host *host = dev_get_drvdata(&pdev->dev);
173 struct pata_imx_priv *priv = host->private_data; 173 struct pata_imx_priv *priv = host->private_data;
@@ -225,7 +225,7 @@ static const struct dev_pm_ops pata_imx_pm_ops = {
225 225
226static struct platform_driver pata_imx_driver = { 226static struct platform_driver pata_imx_driver = {
227 .probe = pata_imx_probe, 227 .probe = pata_imx_probe,
228 .remove = __devexit_p(pata_imx_remove), 228 .remove = pata_imx_remove,
229 .driver = { 229 .driver = {
230 .name = DRV_NAME, 230 .name = DRV_NAME,
231 .owner = THIS_MODULE, 231 .owner = THIS_MODULE,
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 0566e67b5e1..dcc6b243e52 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -137,7 +137,7 @@ static void ixp4xx_setup_port(struct ata_port *ap,
137 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", raw_cmd, raw_ctl); 137 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", raw_cmd, raw_ctl);
138} 138}
139 139
140static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) 140static int ixp4xx_pata_probe(struct platform_device *pdev)
141{ 141{
142 unsigned int irq; 142 unsigned int irq;
143 struct resource *cs0, *cs1; 143 struct resource *cs0, *cs1;
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index b057e3fa44b..e5725edcf51 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -935,7 +935,7 @@ static struct ata_port_operations pata_macio_ops = {
935 .sff_irq_clear = pata_macio_irq_clear, 935 .sff_irq_clear = pata_macio_irq_clear,
936}; 936};
937 937
938static void __devinit pata_macio_invariants(struct pata_macio_priv *priv) 938static void pata_macio_invariants(struct pata_macio_priv *priv)
939{ 939{
940 const int *bidp; 940 const int *bidp;
941 941
@@ -976,9 +976,8 @@ static void __devinit pata_macio_invariants(struct pata_macio_priv *priv)
976 priv->aapl_bus_id = 1; 976 priv->aapl_bus_id = 1;
977} 977}
978 978
979static void __devinit pata_macio_setup_ios(struct ata_ioports *ioaddr, 979static void pata_macio_setup_ios(struct ata_ioports *ioaddr,
980 void __iomem * base, 980 void __iomem * base, void __iomem * dma)
981 void __iomem * dma)
982{ 981{
983 /* cmd_addr is the base of regs for that port */ 982 /* cmd_addr is the base of regs for that port */
984 ioaddr->cmd_addr = base; 983 ioaddr->cmd_addr = base;
@@ -999,8 +998,8 @@ static void __devinit pata_macio_setup_ios(struct ata_ioports *ioaddr,
999 ioaddr->bmdma_addr = dma; 998 ioaddr->bmdma_addr = dma;
1000} 999}
1001 1000
1002static void __devinit pmac_macio_calc_timing_masks(struct pata_macio_priv *priv, 1001static void pmac_macio_calc_timing_masks(struct pata_macio_priv *priv,
1003 struct ata_port_info *pinfo) 1002 struct ata_port_info *pinfo)
1004{ 1003{
1005 int i = 0; 1004 int i = 0;
1006 1005
@@ -1027,11 +1026,11 @@ static void __devinit pmac_macio_calc_timing_masks(struct pata_macio_priv *priv,
1027 pinfo->pio_mask, pinfo->mwdma_mask, pinfo->udma_mask); 1026 pinfo->pio_mask, pinfo->mwdma_mask, pinfo->udma_mask);
1028} 1027}
1029 1028
1030static int __devinit pata_macio_common_init(struct pata_macio_priv *priv, 1029static int pata_macio_common_init(struct pata_macio_priv *priv,
1031 resource_size_t tfregs, 1030 resource_size_t tfregs,
1032 resource_size_t dmaregs, 1031 resource_size_t dmaregs,
1033 resource_size_t fcregs, 1032 resource_size_t fcregs,
1034 unsigned long irq) 1033 unsigned long irq)
1035{ 1034{
1036 struct ata_port_info pinfo; 1035 struct ata_port_info pinfo;
1037 const struct ata_port_info *ppi[] = { &pinfo, NULL }; 1036 const struct ata_port_info *ppi[] = { &pinfo, NULL };
@@ -1113,8 +1112,8 @@ static int __devinit pata_macio_common_init(struct pata_macio_priv *priv,
1113 &pata_macio_sht); 1112 &pata_macio_sht);
1114} 1113}
1115 1114
1116static int __devinit pata_macio_attach(struct macio_dev *mdev, 1115static int pata_macio_attach(struct macio_dev *mdev,
1117 const struct of_device_id *match) 1116 const struct of_device_id *match)
1118{ 1117{
1119 struct pata_macio_priv *priv; 1118 struct pata_macio_priv *priv;
1120 resource_size_t tfregs, dmaregs = 0; 1119 resource_size_t tfregs, dmaregs = 0;
@@ -1190,7 +1189,7 @@ static int __devinit pata_macio_attach(struct macio_dev *mdev,
1190 return rc; 1189 return rc;
1191} 1190}
1192 1191
1193static int __devexit pata_macio_detach(struct macio_dev *mdev) 1192static int pata_macio_detach(struct macio_dev *mdev)
1194{ 1193{
1195 struct ata_host *host = macio_get_drvdata(mdev); 1194 struct ata_host *host = macio_get_drvdata(mdev);
1196 struct pata_macio_priv *priv = host->private_data; 1195 struct pata_macio_priv *priv = host->private_data;
@@ -1257,8 +1256,8 @@ static void pata_macio_mb_event(struct macio_dev* mdev, int mb_state)
1257#endif /* CONFIG_PMAC_MEDIABAY */ 1256#endif /* CONFIG_PMAC_MEDIABAY */
1258 1257
1259 1258
1260static int __devinit pata_macio_pci_attach(struct pci_dev *pdev, 1259static int pata_macio_pci_attach(struct pci_dev *pdev,
1261 const struct pci_device_id *id) 1260 const struct pci_device_id *id)
1262{ 1261{
1263 struct pata_macio_priv *priv; 1262 struct pata_macio_priv *priv;
1264 struct device_node *np; 1263 struct device_node *np;
@@ -1310,7 +1309,7 @@ static int __devinit pata_macio_pci_attach(struct pci_dev *pdev,
1310 return 0; 1309 return 0;
1311} 1310}
1312 1311
1313static void __devexit pata_macio_pci_detach(struct pci_dev *pdev) 1312static void pata_macio_pci_detach(struct pci_dev *pdev)
1314{ 1313{
1315 struct ata_host *host = dev_get_drvdata(&pdev->dev); 1314 struct ata_host *host = dev_get_drvdata(&pdev->dev);
1316 1315
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index ec67f54dc56..652f57e8348 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -621,9 +621,10 @@ static struct ata_port_operations mpc52xx_ata_port_ops = {
621 .qc_prep = ata_noop_qc_prep, 621 .qc_prep = ata_noop_qc_prep,
622}; 622};
623 623
624static int __devinit 624static int mpc52xx_ata_init_one(struct device *dev,
625mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv, 625 struct mpc52xx_ata_priv *priv,
626 unsigned long raw_ata_regs, int mwdma_mask, int udma_mask) 626 unsigned long raw_ata_regs,
627 int mwdma_mask, int udma_mask)
627{ 628{
628 struct ata_host *host; 629 struct ata_host *host;
629 struct ata_port *ap; 630 struct ata_port *ap;
@@ -667,8 +668,7 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv,
667/* OF Platform driver */ 668/* OF Platform driver */
668/* ======================================================================== */ 669/* ======================================================================== */
669 670
670static int __devinit 671static int mpc52xx_ata_probe(struct platform_device *op)
671mpc52xx_ata_probe(struct platform_device *op)
672{ 672{
673 unsigned int ipb_freq; 673 unsigned int ipb_freq;
674 struct resource res_mem; 674 struct resource res_mem;
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 4e1194b4c27..ff2e57f3b59 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -840,7 +840,7 @@ static struct ata_port_operations octeon_cf_ops = {
840 .dev_config = octeon_cf_dev_config, 840 .dev_config = octeon_cf_dev_config,
841}; 841};
842 842
843static int __devinit octeon_cf_probe(struct platform_device *pdev) 843static int octeon_cf_probe(struct platform_device *pdev)
844{ 844{
845 struct resource *res_cs0, *res_cs1; 845 struct resource *res_cs0, *res_cs1;
846 846
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index e5b234c370f..a7e95a54c78 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -16,7 +16,7 @@
16#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
17#include <linux/libata.h> 17#include <linux/libata.h>
18 18
19static int __devinit pata_of_platform_probe(struct platform_device *ofdev) 19static int pata_of_platform_probe(struct platform_device *ofdev)
20{ 20{
21 int ret; 21 int ret;
22 struct device_node *dn = ofdev->dev.of_node; 22 struct device_node *dn = ofdev->dev.of_node;
diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c
index f9f79fc04a8..df2bb7504fc 100644
--- a/drivers/ata/pata_palmld.c
+++ b/drivers/ata/pata_palmld.c
@@ -48,7 +48,7 @@ static struct ata_port_operations palmld_port_ops = {
48 .cable_detect = ata_cable_40wire, 48 .cable_detect = ata_cable_40wire,
49}; 49};
50 50
51static __devinit int palmld_pata_probe(struct platform_device *pdev) 51static int palmld_pata_probe(struct platform_device *pdev)
52{ 52{
53 struct ata_host *host; 53 struct ata_host *host;
54 struct ata_port *ap; 54 struct ata_port *ap;
@@ -109,7 +109,7 @@ err1:
109 return ret; 109 return ret;
110} 110}
111 111
112static __devexit int palmld_pata_remove(struct platform_device *dev) 112static int palmld_pata_remove(struct platform_device *dev)
113{ 113{
114 ata_platform_remove_one(dev); 114 ata_platform_remove_one(dev);
115 115
@@ -127,7 +127,7 @@ static struct platform_driver palmld_pata_platform_driver = {
127 .owner = THIS_MODULE, 127 .owner = THIS_MODULE,
128 }, 128 },
129 .probe = palmld_pata_probe, 129 .probe = palmld_pata_probe,
130 .remove = __devexit_p(palmld_pata_remove), 130 .remove = palmld_pata_remove,
131}; 131};
132 132
133module_platform_driver(palmld_pata_platform_driver); 133module_platform_driver(palmld_pata_platform_driver);
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index c9399c8688c..3f94a886bb3 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -700,7 +700,8 @@ static void pdc_ata_setup_port(struct ata_ioports *port, void __iomem *base)
700 * @pdev: instance of pci_dev found 700 * @pdev: instance of pci_dev found
701 * @ent: matching entry in the id_tbl[] 701 * @ent: matching entry in the id_tbl[]
702 */ 702 */
703static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 703static int pdc2027x_init_one(struct pci_dev *pdev,
704 const struct pci_device_id *ent)
704{ 705{
705 static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 }; 706 static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 };
706 static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 }; 707 static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 };
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index f4372d0c7ce..71e093767f4 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -98,12 +98,9 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr,
98 * 98 *
99 * If no IRQ resource is present, PIO polling mode is used instead. 99 * If no IRQ resource is present, PIO polling mode is used instead.
100 */ 100 */
101int __devinit __pata_platform_probe(struct device *dev, 101int __pata_platform_probe(struct device *dev, struct resource *io_res,
102 struct resource *io_res, 102 struct resource *ctl_res, struct resource *irq_res,
103 struct resource *ctl_res, 103 unsigned int ioport_shift, int __pio_mask)
104 struct resource *irq_res,
105 unsigned int ioport_shift,
106 int __pio_mask)
107{ 104{
108 struct ata_host *host; 105 struct ata_host *host;
109 struct ata_port *ap; 106 struct ata_port *ap;
@@ -178,7 +175,7 @@ int __devinit __pata_platform_probe(struct device *dev,
178} 175}
179EXPORT_SYMBOL_GPL(__pata_platform_probe); 176EXPORT_SYMBOL_GPL(__pata_platform_probe);
180 177
181static int __devinit pata_platform_probe(struct platform_device *pdev) 178static int pata_platform_probe(struct platform_device *pdev)
182{ 179{
183 struct resource *io_res; 180 struct resource *io_res;
184 struct resource *ctl_res; 181 struct resource *ctl_res;
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
index 4b8ba559fe2..b0ac9e0c5e0 100644
--- a/drivers/ata/pata_pxa.c
+++ b/drivers/ata/pata_pxa.c
@@ -229,7 +229,7 @@ static void pxa_ata_dma_irq(int dma, void *port)
229 complete(&pd->dma_done); 229 complete(&pd->dma_done);
230} 230}
231 231
232static int __devinit pxa_ata_probe(struct platform_device *pdev) 232static int pxa_ata_probe(struct platform_device *pdev)
233{ 233{
234 struct ata_host *host; 234 struct ata_host *host;
235 struct ata_port *ap; 235 struct ata_port *ap;
@@ -369,7 +369,7 @@ static int __devinit pxa_ata_probe(struct platform_device *pdev)
369 return ret; 369 return ret;
370} 370}
371 371
372static int __devexit pxa_ata_remove(struct platform_device *pdev) 372static int pxa_ata_remove(struct platform_device *pdev)
373{ 373{
374 struct ata_host *host = dev_get_drvdata(&pdev->dev); 374 struct ata_host *host = dev_get_drvdata(&pdev->dev);
375 struct pata_pxa_data *data = host->ports[0]->private_data; 375 struct pata_pxa_data *data = host->ports[0]->private_data;
@@ -383,7 +383,7 @@ static int __devexit pxa_ata_remove(struct platform_device *pdev)
383 383
384static struct platform_driver pxa_ata_driver = { 384static struct platform_driver pxa_ata_driver = {
385 .probe = pxa_ata_probe, 385 .probe = pxa_ata_probe,
386 .remove = __devexit_p(pxa_ata_remove), 386 .remove = pxa_ata_remove,
387 .driver = { 387 .driver = {
388 .name = DRV_NAME, 388 .name = DRV_NAME,
389 .owner = THIS_MODULE, 389 .owner = THIS_MODULE,
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 9417101bd5c..3c5eb8fa6bd 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -102,7 +102,7 @@ static void rb532_pata_setup_ports(struct ata_host *ah)
102 ap->ioaddr.error_addr = info->iobase + RB500_CF_REG_ERR; 102 ap->ioaddr.error_addr = info->iobase + RB500_CF_REG_ERR;
103} 103}
104 104
105static __devinit int rb532_pata_driver_probe(struct platform_device *pdev) 105static int rb532_pata_driver_probe(struct platform_device *pdev)
106{ 106{
107 int irq; 107 int irq;
108 int gpio; 108 int gpio;
@@ -177,7 +177,7 @@ err_free_gpio:
177 return ret; 177 return ret;
178} 178}
179 179
180static __devexit int rb532_pata_driver_remove(struct platform_device *pdev) 180static int rb532_pata_driver_remove(struct platform_device *pdev)
181{ 181{
182 struct ata_host *ah = platform_get_drvdata(pdev); 182 struct ata_host *ah = platform_get_drvdata(pdev);
183 struct rb532_cf_info *info = ah->private_data; 183 struct rb532_cf_info *info = ah->private_data;
@@ -190,7 +190,7 @@ static __devexit int rb532_pata_driver_remove(struct platform_device *pdev)
190 190
191static struct platform_driver rb532_pata_platform_driver = { 191static struct platform_driver rb532_pata_platform_driver = {
192 .probe = rb532_pata_driver_probe, 192 .probe = rb532_pata_driver_probe,
193 .remove = __devexit_p(rb532_pata_driver_remove), 193 .remove = rb532_pata_driver_remove,
194 .driver = { 194 .driver = {
195 .name = DRV_NAME, 195 .name = DRV_NAME,
196 .owner = THIS_MODULE, 196 .owner = THIS_MODULE,
diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c
index e71f998dd90..6a8665574fe 100644
--- a/drivers/ata/pata_rdc.c
+++ b/drivers/ata/pata_rdc.c
@@ -321,8 +321,7 @@ static struct scsi_host_template rdc_sht = {
321 * Zero on success, or -ERRNO value. 321 * Zero on success, or -ERRNO value.
322 */ 322 */
323 323
324static int __devinit rdc_init_one(struct pci_dev *pdev, 324static int rdc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
325 const struct pci_device_id *ent)
326{ 325{
327 struct device *dev = &pdev->dev; 326 struct device *dev = &pdev->dev;
328 struct ata_port_info port_info[2]; 327 struct ata_port_info port_info[2];
diff --git a/drivers/ata/pata_sch.c b/drivers/ata/pata_sch.c
index db0d18cf1c2..d3830c45a36 100644
--- a/drivers/ata/pata_sch.c
+++ b/drivers/ata/pata_sch.c
@@ -169,8 +169,7 @@ static void sch_set_dmamode(struct ata_port *ap, struct ata_device *adev)
169 * Zero on success, or -ERRNO value. 169 * Zero on success, or -ERRNO value.
170 */ 170 */
171 171
172static int __devinit sch_init_one(struct pci_dev *pdev, 172static int sch_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
173 const struct pci_device_id *ent)
174{ 173{
175 const struct ata_port_info *ppi[] = { &sch_port_info, NULL }; 174 const struct ata_port_info *ppi[] = { &sch_port_info, NULL };
176 175
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 5cfdf94823d..64c5f0d0f81 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -323,8 +323,7 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
323 return tmpbyte & 0x30; 323 return tmpbyte & 0x30;
324} 324}
325 325
326static int __devinit sil680_init_one(struct pci_dev *pdev, 326static int sil680_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
327 const struct pci_device_id *id)
328{ 327{
329 static const struct ata_port_info info = { 328 static const struct ata_port_info info = {
330 .flags = ATA_FLAG_SLAVE_POSS, 329 .flags = ATA_FLAG_SLAVE_POSS,
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index dc7d78eecb1..5dba77ccaa0 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -260,7 +260,7 @@ static const struct of_device_id ahci_of_match[] = {
260}; 260};
261MODULE_DEVICE_TABLE(of, ahci_of_match); 261MODULE_DEVICE_TABLE(of, ahci_of_match);
262 262
263static int __devinit ahci_highbank_probe(struct platform_device *pdev) 263static int ahci_highbank_probe(struct platform_device *pdev)
264{ 264{
265 struct device *dev = &pdev->dev; 265 struct device *dev = &pdev->dev;
266 struct ahci_host_priv *hpriv; 266 struct ahci_host_priv *hpriv;
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 68f4fb54d62..35c6b6d09c2 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4148,7 +4148,7 @@ err:
4148 * A platform bus SATA device has been unplugged. Perform the needed 4148 * A platform bus SATA device has been unplugged. Perform the needed
4149 * cleanup. Also called on module unload for any active devices. 4149 * cleanup. Also called on module unload for any active devices.
4150 */ 4150 */
4151static int __devexit mv_platform_remove(struct platform_device *pdev) 4151static int mv_platform_remove(struct platform_device *pdev)
4152{ 4152{
4153 struct ata_host *host = platform_get_drvdata(pdev); 4153 struct ata_host *host = platform_get_drvdata(pdev);
4154#if defined(CONFIG_HAVE_CLK) 4154#if defined(CONFIG_HAVE_CLK)
@@ -4215,7 +4215,7 @@ static int mv_platform_resume(struct platform_device *pdev)
4215#endif 4215#endif
4216 4216
4217#ifdef CONFIG_OF 4217#ifdef CONFIG_OF
4218static struct of_device_id mv_sata_dt_ids[] __devinitdata = { 4218static struct of_device_id mv_sata_dt_ids[] = {
4219 { .compatible = "marvell,orion-sata", }, 4219 { .compatible = "marvell,orion-sata", },
4220 {}, 4220 {},
4221}; 4221};
@@ -4224,7 +4224,7 @@ MODULE_DEVICE_TABLE(of, mv_sata_dt_ids);
4224 4224
4225static struct platform_driver mv_platform_driver = { 4225static struct platform_driver mv_platform_driver = {
4226 .probe = mv_platform_probe, 4226 .probe = mv_platform_probe,
4227 .remove = __devexit_p(mv_platform_remove), 4227 .remove = mv_platform_remove,
4228 .suspend = mv_platform_suspend, 4228 .suspend = mv_platform_suspend,
4229 .resume = mv_platform_resume, 4229 .resume = mv_platform_resume,
4230 .driver = { 4230 .driver = {
@@ -4429,7 +4429,7 @@ static int mv_pci_device_resume(struct pci_dev *pdev)
4429#endif 4429#endif
4430 4430
4431static int mv_platform_probe(struct platform_device *pdev); 4431static int mv_platform_probe(struct platform_device *pdev);
4432static int __devexit mv_platform_remove(struct platform_device *pdev); 4432static int mv_platform_remove(struct platform_device *pdev);
4433 4433
4434static int __init mv_init(void) 4434static int __init mv_init(void)
4435{ 4435{
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index e8cf88ba145..44f304b3de6 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -312,8 +312,7 @@ static struct ata_port_operations vsc_sata_ops = {
312 .scr_write = vsc_sata_scr_write, 312 .scr_write = vsc_sata_scr_write,
313}; 313};
314 314
315static void __devinit vsc_sata_setup_port(struct ata_ioports *port, 315static void vsc_sata_setup_port(struct ata_ioports *port, void __iomem *base)
316 void __iomem *base)
317{ 316{
318 port->cmd_addr = base + VSC_SATA_TF_CMD_OFFSET; 317 port->cmd_addr = base + VSC_SATA_TF_CMD_OFFSET;
319 port->data_addr = base + VSC_SATA_TF_DATA_OFFSET; 318 port->data_addr = base + VSC_SATA_TF_DATA_OFFSET;
@@ -335,8 +334,8 @@ static void __devinit vsc_sata_setup_port(struct ata_ioports *port,
335} 334}
336 335
337 336
338static int __devinit vsc_sata_init_one(struct pci_dev *pdev, 337static int vsc_sata_init_one(struct pci_dev *pdev,
339 const struct pci_device_id *ent) 338 const struct pci_device_id *ent)
340{ 339{
341 static const struct ata_port_info pi = { 340 static const struct ata_port_info pi = {
342 .flags = ATA_FLAG_SATA, 341 .flags = ATA_FLAG_SATA,
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index ff7bb8a42ed..77a7480dc4d 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1507,9 +1507,9 @@ static void do_housekeeping (unsigned long arg) {
1507 1507
1508/********** creation of communication queues **********/ 1508/********** creation of communication queues **********/
1509 1509
1510static int __devinit create_queues (amb_dev * dev, unsigned int cmds, 1510static int create_queues(amb_dev *dev, unsigned int cmds, unsigned int txs,
1511 unsigned int txs, unsigned int * rxs, 1511 unsigned int *rxs, unsigned int *rx_buffer_sizes)
1512 unsigned int * rx_buffer_sizes) { 1512{
1513 unsigned char pool; 1513 unsigned char pool;
1514 size_t total = 0; 1514 size_t total = 0;
1515 void * memory; 1515 void * memory;
@@ -1737,8 +1737,9 @@ static int decode_loader_result (loader_command cmd, u32 result)
1737 return res; 1737 return res;
1738} 1738}
1739 1739
1740static int __devinit do_loader_command (volatile loader_block * lb, 1740static int do_loader_command(volatile loader_block *lb, const amb_dev *dev,
1741 const amb_dev * dev, loader_command cmd) { 1741 loader_command cmd)
1742{
1742 1743
1743 unsigned long timeout; 1744 unsigned long timeout;
1744 1745
@@ -1793,8 +1794,9 @@ static int __devinit do_loader_command (volatile loader_block * lb,
1793 1794
1794/* loader: determine loader version */ 1795/* loader: determine loader version */
1795 1796
1796static int __devinit get_loader_version (loader_block * lb, 1797static int get_loader_version(loader_block *lb, const amb_dev *dev,
1797 const amb_dev * dev, u32 * version) { 1798 u32 *version)
1799{
1798 int res; 1800 int res;
1799 1801
1800 PRINTD (DBG_FLOW|DBG_LOAD, "get_loader_version"); 1802 PRINTD (DBG_FLOW|DBG_LOAD, "get_loader_version");
@@ -1809,9 +1811,9 @@ static int __devinit get_loader_version (loader_block * lb,
1809 1811
1810/* loader: write memory data blocks */ 1812/* loader: write memory data blocks */
1811 1813
1812static int __devinit loader_write (loader_block* lb, 1814static int loader_write(loader_block *lb, const amb_dev *dev,
1813 const amb_dev *dev, 1815 const struct ihex_binrec *rec)
1814 const struct ihex_binrec *rec) { 1816{
1815 transfer_block * tb = &lb->payload.transfer; 1817 transfer_block * tb = &lb->payload.transfer;
1816 1818
1817 PRINTD (DBG_FLOW|DBG_LOAD, "loader_write"); 1819 PRINTD (DBG_FLOW|DBG_LOAD, "loader_write");
@@ -1824,9 +1826,9 @@ static int __devinit loader_write (loader_block* lb,
1824 1826
1825/* loader: verify memory data blocks */ 1827/* loader: verify memory data blocks */
1826 1828
1827static int __devinit loader_verify (loader_block * lb, 1829static int loader_verify(loader_block *lb, const amb_dev *dev,
1828 const amb_dev *dev, 1830 const struct ihex_binrec *rec)
1829 const struct ihex_binrec *rec) { 1831{
1830 transfer_block * tb = &lb->payload.transfer; 1832 transfer_block * tb = &lb->payload.transfer;
1831 int res; 1833 int res;
1832 1834
@@ -1842,8 +1844,8 @@ static int __devinit loader_verify (loader_block * lb,
1842 1844
1843/* loader: start microcode */ 1845/* loader: start microcode */
1844 1846
1845static int __devinit loader_start (loader_block * lb, 1847static int loader_start(loader_block *lb, const amb_dev *dev, u32 address)
1846 const amb_dev * dev, u32 address) { 1848{
1847 PRINTD (DBG_FLOW|DBG_LOAD, "loader_start"); 1849 PRINTD (DBG_FLOW|DBG_LOAD, "loader_start");
1848 1850
1849 lb->payload.start = cpu_to_be32 (address); 1851 lb->payload.start = cpu_to_be32 (address);
@@ -1918,7 +1920,8 @@ static int amb_reset (amb_dev * dev, int diags) {
1918 1920
1919/********** transfer and start the microcode **********/ 1921/********** transfer and start the microcode **********/
1920 1922
1921static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { 1923static int ucode_init(loader_block *lb, amb_dev *dev)
1924{
1922 const struct firmware *fw; 1925 const struct firmware *fw;
1923 unsigned long start_address; 1926 unsigned long start_address;
1924 const struct ihex_binrec *rec; 1927 const struct ihex_binrec *rec;
@@ -1980,7 +1983,8 @@ static inline __be32 bus_addr(void * addr) {
1980 return cpu_to_be32 (virt_to_bus (addr)); 1983 return cpu_to_be32 (virt_to_bus (addr));
1981} 1984}
1982 1985
1983static int __devinit amb_talk (amb_dev * dev) { 1986static int amb_talk(amb_dev *dev)
1987{
1984 adap_talk_block a; 1988 adap_talk_block a;
1985 unsigned char pool; 1989 unsigned char pool;
1986 unsigned long timeout; 1990 unsigned long timeout;
@@ -2027,7 +2031,8 @@ static int __devinit amb_talk (amb_dev * dev) {
2027} 2031}
2028 2032
2029// get microcode version 2033// get microcode version
2030static void __devinit amb_ucode_version (amb_dev * dev) { 2034static void amb_ucode_version(amb_dev *dev)
2035{
2031 u32 major; 2036 u32 major;
2032 u32 minor; 2037 u32 minor;
2033 command cmd; 2038 command cmd;
@@ -2042,7 +2047,8 @@ static void __devinit amb_ucode_version (amb_dev * dev) {
2042} 2047}
2043 2048
2044// get end station address 2049// get end station address
2045static void __devinit amb_esi (amb_dev * dev, u8 * esi) { 2050static void amb_esi(amb_dev *dev, u8 *esi)
2051{
2046 u32 lower4; 2052 u32 lower4;
2047 u16 upper2; 2053 u16 upper2;
2048 command cmd; 2054 command cmd;
@@ -2088,7 +2094,7 @@ static void fixup_plx_window (amb_dev *dev, loader_block *lb)
2088 return; 2094 return;
2089} 2095}
2090 2096
2091static int __devinit amb_init (amb_dev * dev) 2097static int amb_init(amb_dev *dev)
2092{ 2098{
2093 loader_block lb; 2099 loader_block lb;
2094 2100
@@ -2184,7 +2190,8 @@ static void setup_pci_dev(struct pci_dev *pci_dev)
2184 } 2190 }
2185} 2191}
2186 2192
2187static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) 2193static int amb_probe(struct pci_dev *pci_dev,
2194 const struct pci_device_id *pci_ent)
2188{ 2195{
2189 amb_dev * dev; 2196 amb_dev * dev;
2190 int err; 2197 int err;
@@ -2285,7 +2292,7 @@ out_disable:
2285} 2292}
2286 2293
2287 2294
2288static void __devexit amb_remove_one(struct pci_dev *pci_dev) 2295static void amb_remove_one(struct pci_dev *pci_dev)
2289{ 2296{
2290 struct amb_dev *dev; 2297 struct amb_dev *dev;
2291 2298
@@ -2379,7 +2386,7 @@ MODULE_DEVICE_TABLE(pci, amb_pci_tbl);
2379static struct pci_driver amb_driver = { 2386static struct pci_driver amb_driver = {
2380 .name = "amb", 2387 .name = "amb",
2381 .probe = amb_probe, 2388 .probe = amb_probe,
2382 .remove = __devexit_p(amb_remove_one), 2389 .remove = amb_remove_one,
2383 .id_table = amb_pci_tbl, 2390 .id_table = amb_pci_tbl,
2384}; 2391};
2385 2392
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 81e44f7b0ab..c1eb6fa8ac3 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1567,7 +1567,7 @@ tx_complete++;
1567/*--------------------------------- entries ---------------------------------*/ 1567/*--------------------------------- entries ---------------------------------*/
1568 1568
1569 1569
1570static char * const media_name[] __devinitconst = { 1570static char * const media_name[] = {
1571 "MMF", "SMF", "MMF", "03?", /* 0- 3 */ 1571 "MMF", "SMF", "MMF", "03?", /* 0- 3 */
1572 "UTP", "05?", "06?", "07?", /* 4- 7 */ 1572 "UTP", "05?", "06?", "07?", /* 4- 7 */
1573 "TAXI","09?", "10?", "11?", /* 8-11 */ 1573 "TAXI","09?", "10?", "11?", /* 8-11 */
@@ -1591,7 +1591,7 @@ static char * const media_name[] __devinitconst = {
1591 } }) 1591 } })
1592 1592
1593 1593
1594static int __devinit get_esi_asic(struct atm_dev *dev) 1594static int get_esi_asic(struct atm_dev *dev)
1595{ 1595{
1596 struct eni_dev *eni_dev; 1596 struct eni_dev *eni_dev;
1597 unsigned char tonga; 1597 unsigned char tonga;
@@ -1683,7 +1683,7 @@ static int __devinit get_esi_asic(struct atm_dev *dev)
1683#undef GET_SEPROM 1683#undef GET_SEPROM
1684 1684
1685 1685
1686static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base) 1686static int get_esi_fpga(struct atm_dev *dev, void __iomem *base)
1687{ 1687{
1688 void __iomem *mac_base; 1688 void __iomem *mac_base;
1689 int i; 1689 int i;
@@ -1694,7 +1694,7 @@ static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base)
1694} 1694}
1695 1695
1696 1696
1697static int __devinit eni_do_init(struct atm_dev *dev) 1697static int eni_do_init(struct atm_dev *dev)
1698{ 1698{
1699 struct midway_eprom __iomem *eprom; 1699 struct midway_eprom __iomem *eprom;
1700 struct eni_dev *eni_dev; 1700 struct eni_dev *eni_dev;
@@ -1797,7 +1797,7 @@ static void eni_do_release(struct atm_dev *dev)
1797 iounmap(ed->ioaddr); 1797 iounmap(ed->ioaddr);
1798} 1798}
1799 1799
1800static int __devinit eni_start(struct atm_dev *dev) 1800static int eni_start(struct atm_dev *dev)
1801{ 1801{
1802 struct eni_dev *eni_dev; 1802 struct eni_dev *eni_dev;
1803 1803
@@ -2226,8 +2226,8 @@ static const struct atmdev_ops ops = {
2226}; 2226};
2227 2227
2228 2228
2229static int __devinit eni_init_one(struct pci_dev *pci_dev, 2229static int eni_init_one(struct pci_dev *pci_dev,
2230 const struct pci_device_id *ent) 2230 const struct pci_device_id *ent)
2231{ 2231{
2232 struct atm_dev *dev; 2232 struct atm_dev *dev;
2233 struct eni_dev *eni_dev; 2233 struct eni_dev *eni_dev;
@@ -2292,7 +2292,7 @@ static struct pci_device_id eni_pci_tbl[] = {
2292MODULE_DEVICE_TABLE(pci,eni_pci_tbl); 2292MODULE_DEVICE_TABLE(pci,eni_pci_tbl);
2293 2293
2294 2294
2295static void __devexit eni_remove_one(struct pci_dev *pdev) 2295static void eni_remove_one(struct pci_dev *pdev)
2296{ 2296{
2297 struct atm_dev *dev = pci_get_drvdata(pdev); 2297 struct atm_dev *dev = pci_get_drvdata(pdev);
2298 struct eni_dev *ed = ENI_DEV(dev); 2298 struct eni_dev *ed = ENI_DEV(dev);
@@ -2310,7 +2310,7 @@ static struct pci_driver eni_driver = {
2310 .name = DEV_LABEL, 2310 .name = DEV_LABEL,
2311 .id_table = eni_pci_tbl, 2311 .id_table = eni_pci_tbl,
2312 .probe = eni_init_one, 2312 .probe = eni_init_one,
2313 .remove = __devexit_p(eni_remove_one), 2313 .remove = eni_remove_one,
2314}; 2314};
2315 2315
2316 2316
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 86fed1b9169..b41c9481b67 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -252,7 +252,7 @@ struct reginit_item {
252}; 252};
253 253
254 254
255static struct reginit_item PHY_NTC_INIT[] __devinitdata = { 255static struct reginit_item PHY_NTC_INIT[] = {
256 { PHY_CLEARALL, 0x40 }, 256 { PHY_CLEARALL, 0x40 },
257 { 0x12, 0x0001 }, 257 { 0x12, 0x0001 },
258 { 0x13, 0x7605 }, 258 { 0x13, 0x7605 },
@@ -1295,7 +1295,7 @@ static const struct atmdev_ops ops = {
1295}; 1295};
1296 1296
1297 1297
1298static void __devinit undocumented_pci_fix (struct pci_dev *pdev) 1298static void undocumented_pci_fix(struct pci_dev *pdev)
1299{ 1299{
1300 u32 tint; 1300 u32 tint;
1301 1301
@@ -1319,13 +1319,13 @@ static void __devinit undocumented_pci_fix (struct pci_dev *pdev)
1319 * PHY routines * 1319 * PHY routines *
1320 **************************************************************************/ 1320 **************************************************************************/
1321 1321
1322static void __devinit write_phy (struct fs_dev *dev, int regnum, int val) 1322static void write_phy(struct fs_dev *dev, int regnum, int val)
1323{ 1323{
1324 submit_command (dev, &dev->hp_txq, QE_CMD_PRP_WR | QE_CMD_IMM_INQ, 1324 submit_command (dev, &dev->hp_txq, QE_CMD_PRP_WR | QE_CMD_IMM_INQ,
1325 regnum, val, 0); 1325 regnum, val, 0);
1326} 1326}
1327 1327
1328static int __devinit init_phy (struct fs_dev *dev, struct reginit_item *reginit) 1328static int init_phy(struct fs_dev *dev, struct reginit_item *reginit)
1329{ 1329{
1330 int i; 1330 int i;
1331 1331
@@ -1381,7 +1381,7 @@ static void reset_chip (struct fs_dev *dev)
1381 } 1381 }
1382} 1382}
1383 1383
1384static void __devinit *aligned_kmalloc (int size, gfp_t flags, int alignment) 1384static void *aligned_kmalloc(int size, gfp_t flags, int alignment)
1385{ 1385{
1386 void *t; 1386 void *t;
1387 1387
@@ -1398,8 +1398,8 @@ static void __devinit *aligned_kmalloc (int size, gfp_t flags, int alignment)
1398 return NULL; 1398 return NULL;
1399} 1399}
1400 1400
1401static int __devinit init_q (struct fs_dev *dev, 1401static int init_q(struct fs_dev *dev, struct queue *txq, int queue,
1402 struct queue *txq, int queue, int nentries, int is_rq) 1402 int nentries, int is_rq)
1403{ 1403{
1404 int sz = nentries * sizeof (struct FS_QENTRY); 1404 int sz = nentries * sizeof (struct FS_QENTRY);
1405 struct FS_QENTRY *p; 1405 struct FS_QENTRY *p;
@@ -1434,8 +1434,8 @@ static int __devinit init_q (struct fs_dev *dev,
1434} 1434}
1435 1435
1436 1436
1437static int __devinit init_fp (struct fs_dev *dev, 1437static int init_fp(struct fs_dev *dev, struct freepool *fp, int queue,
1438 struct freepool *fp, int queue, int bufsize, int nr_buffers) 1438 int bufsize, int nr_buffers)
1439{ 1439{
1440 func_enter (); 1440 func_enter ();
1441 1441
@@ -1528,7 +1528,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1528 fs_dprintk (FS_DEBUG_QUEUE, "Added %d entries. \n", n); 1528 fs_dprintk (FS_DEBUG_QUEUE, "Added %d entries. \n", n);
1529} 1529}
1530 1530
1531static void __devexit free_queue (struct fs_dev *dev, struct queue *txq) 1531static void free_queue(struct fs_dev *dev, struct queue *txq)
1532{ 1532{
1533 func_enter (); 1533 func_enter ();
1534 1534
@@ -1544,7 +1544,7 @@ static void __devexit free_queue (struct fs_dev *dev, struct queue *txq)
1544 func_exit (); 1544 func_exit ();
1545} 1545}
1546 1546
1547static void __devexit free_freepool (struct fs_dev *dev, struct freepool *fp) 1547static void free_freepool(struct fs_dev *dev, struct freepool *fp)
1548{ 1548{
1549 func_enter (); 1549 func_enter ();
1550 1550
@@ -1662,7 +1662,7 @@ static void fs_poll (unsigned long data)
1662} 1662}
1663#endif 1663#endif
1664 1664
1665static int __devinit fs_init (struct fs_dev *dev) 1665static int fs_init(struct fs_dev *dev)
1666{ 1666{
1667 struct pci_dev *pci_dev; 1667 struct pci_dev *pci_dev;
1668 int isr, to; 1668 int isr, to;
@@ -1897,8 +1897,8 @@ unmap:
1897 return 1; 1897 return 1;
1898} 1898}
1899 1899
1900static int __devinit firestream_init_one (struct pci_dev *pci_dev, 1900static int firestream_init_one(struct pci_dev *pci_dev,
1901 const struct pci_device_id *ent) 1901 const struct pci_device_id *ent)
1902{ 1902{
1903 struct atm_dev *atm_dev; 1903 struct atm_dev *atm_dev;
1904 struct fs_dev *fs_dev; 1904 struct fs_dev *fs_dev;
@@ -1934,7 +1934,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev,
1934 return -ENODEV; 1934 return -ENODEV;
1935} 1935}
1936 1936
1937static void __devexit firestream_remove_one (struct pci_dev *pdev) 1937static void firestream_remove_one(struct pci_dev *pdev)
1938{ 1938{
1939 int i; 1939 int i;
1940 struct fs_dev *dev, *nxtdev; 1940 struct fs_dev *dev, *nxtdev;
@@ -2038,7 +2038,7 @@ static struct pci_driver firestream_driver = {
2038 .name = "firestream", 2038 .name = "firestream",
2039 .id_table = firestream_pci_tbl, 2039 .id_table = firestream_pci_tbl,
2040 .probe = firestream_init_one, 2040 .probe = firestream_init_one,
2041 .remove = __devexit_p(firestream_remove_one), 2041 .remove = firestream_remove_one,
2042}; 2042};
2043 2043
2044static int __init firestream_init_module (void) 2044static int __init firestream_init_module (void)
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 361f5aee3be..204814e88e4 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -527,8 +527,7 @@ fore200e_pca_reset(struct fore200e* fore200e)
527} 527}
528 528
529 529
530static int __devinit 530static int fore200e_pca_map(struct fore200e* fore200e)
531fore200e_pca_map(struct fore200e* fore200e)
532{ 531{
533 DPRINTK(2, "device %s being mapped in memory\n", fore200e->name); 532 DPRINTK(2, "device %s being mapped in memory\n", fore200e->name);
534 533
@@ -561,8 +560,7 @@ fore200e_pca_unmap(struct fore200e* fore200e)
561} 560}
562 561
563 562
564static int __devinit 563static int fore200e_pca_configure(struct fore200e *fore200e)
565fore200e_pca_configure(struct fore200e* fore200e)
566{ 564{
567 struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev; 565 struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev;
568 u8 master_ctrl, latency; 566 u8 master_ctrl, latency;
@@ -2028,8 +2026,7 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags)
2028} 2026}
2029 2027
2030 2028
2031static int __devinit 2029static int fore200e_irq_request(struct fore200e *fore200e)
2032fore200e_irq_request(struct fore200e* fore200e)
2033{ 2030{
2034 if (request_irq(fore200e->irq, fore200e_interrupt, IRQF_SHARED, fore200e->name, fore200e->atm_dev) < 0) { 2031 if (request_irq(fore200e->irq, fore200e_interrupt, IRQF_SHARED, fore200e->name, fore200e->atm_dev) < 0) {
2035 2032
@@ -2051,8 +2048,7 @@ fore200e_irq_request(struct fore200e* fore200e)
2051} 2048}
2052 2049
2053 2050
2054static int __devinit 2051static int fore200e_get_esi(struct fore200e *fore200e)
2055fore200e_get_esi(struct fore200e* fore200e)
2056{ 2052{
2057 struct prom_data* prom = kzalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); 2053 struct prom_data* prom = kzalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA);
2058 int ok, i; 2054 int ok, i;
@@ -2081,8 +2077,7 @@ fore200e_get_esi(struct fore200e* fore200e)
2081} 2077}
2082 2078
2083 2079
2084static int __devinit 2080static int fore200e_alloc_rx_buf(struct fore200e *fore200e)
2085fore200e_alloc_rx_buf(struct fore200e* fore200e)
2086{ 2081{
2087 int scheme, magn, nbr, size, i; 2082 int scheme, magn, nbr, size, i;
2088 2083
@@ -2146,8 +2141,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e)
2146} 2141}
2147 2142
2148 2143
2149static int __devinit 2144static int fore200e_init_bs_queue(struct fore200e *fore200e)
2150fore200e_init_bs_queue(struct fore200e* fore200e)
2151{ 2145{
2152 int scheme, magn, i; 2146 int scheme, magn, i;
2153 2147
@@ -2209,8 +2203,7 @@ fore200e_init_bs_queue(struct fore200e* fore200e)
2209} 2203}
2210 2204
2211 2205
2212static int __devinit 2206static int fore200e_init_rx_queue(struct fore200e *fore200e)
2213fore200e_init_rx_queue(struct fore200e* fore200e)
2214{ 2207{
2215 struct host_rxq* rxq = &fore200e->host_rxq; 2208 struct host_rxq* rxq = &fore200e->host_rxq;
2216 struct cp_rxq_entry __iomem * cp_entry; 2209 struct cp_rxq_entry __iomem * cp_entry;
@@ -2269,8 +2262,7 @@ fore200e_init_rx_queue(struct fore200e* fore200e)
2269} 2262}
2270 2263
2271 2264
2272static int __devinit 2265static int fore200e_init_tx_queue(struct fore200e *fore200e)
2273fore200e_init_tx_queue(struct fore200e* fore200e)
2274{ 2266{
2275 struct host_txq* txq = &fore200e->host_txq; 2267 struct host_txq* txq = &fore200e->host_txq;
2276 struct cp_txq_entry __iomem * cp_entry; 2268 struct cp_txq_entry __iomem * cp_entry;
@@ -2332,8 +2324,7 @@ fore200e_init_tx_queue(struct fore200e* fore200e)
2332} 2324}
2333 2325
2334 2326
2335static int __devinit 2327static int fore200e_init_cmd_queue(struct fore200e *fore200e)
2336fore200e_init_cmd_queue(struct fore200e* fore200e)
2337{ 2328{
2338 struct host_cmdq* cmdq = &fore200e->host_cmdq; 2329 struct host_cmdq* cmdq = &fore200e->host_cmdq;
2339 struct cp_cmdq_entry __iomem * cp_entry; 2330 struct cp_cmdq_entry __iomem * cp_entry;
@@ -2374,10 +2365,10 @@ fore200e_init_cmd_queue(struct fore200e* fore200e)
2374} 2365}
2375 2366
2376 2367
2377static void __devinit 2368static void fore200e_param_bs_queue(struct fore200e *fore200e,
2378fore200e_param_bs_queue(struct fore200e* fore200e, 2369 enum buffer_scheme scheme,
2379 enum buffer_scheme scheme, enum buffer_magn magn, 2370 enum buffer_magn magn, int queue_length,
2380 int queue_length, int pool_size, int supply_blksize) 2371 int pool_size, int supply_blksize)
2381{ 2372{
2382 struct bs_spec __iomem * bs_spec = &fore200e->cp_queues->init.bs_spec[ scheme ][ magn ]; 2373 struct bs_spec __iomem * bs_spec = &fore200e->cp_queues->init.bs_spec[ scheme ][ magn ];
2383 2374
@@ -2388,8 +2379,7 @@ fore200e_param_bs_queue(struct fore200e* fore200e,
2388} 2379}
2389 2380
2390 2381
2391static int __devinit 2382static int fore200e_initialize(struct fore200e *fore200e)
2392fore200e_initialize(struct fore200e* fore200e)
2393{ 2383{
2394 struct cp_queues __iomem * cpq; 2384 struct cp_queues __iomem * cpq;
2395 int ok, scheme, magn; 2385 int ok, scheme, magn;
@@ -2440,8 +2430,7 @@ fore200e_initialize(struct fore200e* fore200e)
2440} 2430}
2441 2431
2442 2432
2443static void __devinit 2433static void fore200e_monitor_putc(struct fore200e *fore200e, char c)
2444fore200e_monitor_putc(struct fore200e* fore200e, char c)
2445{ 2434{
2446 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; 2435 struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
2447 2436
@@ -2452,8 +2441,7 @@ fore200e_monitor_putc(struct fore200e* fore200e, char c)
2452} 2441}
2453 2442
2454 2443
2455static int __devinit 2444static int fore200e_monitor_getc(struct fore200e *fore200e)
2456fore200e_monitor_getc(struct fore200e* fore200e)
2457{ 2445{
2458 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; 2446 struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
2459 unsigned long timeout = jiffies + msecs_to_jiffies(50); 2447 unsigned long timeout = jiffies + msecs_to_jiffies(50);
@@ -2477,8 +2465,7 @@ fore200e_monitor_getc(struct fore200e* fore200e)
2477} 2465}
2478 2466
2479 2467
2480static void __devinit 2468static void fore200e_monitor_puts(struct fore200e *fore200e, char *str)
2481fore200e_monitor_puts(struct fore200e* fore200e, char* str)
2482{ 2469{
2483 while (*str) { 2470 while (*str) {
2484 2471
@@ -2497,8 +2484,7 @@ fore200e_monitor_puts(struct fore200e* fore200e, char* str)
2497#define FW_EXT "_ecd.bin2" 2484#define FW_EXT "_ecd.bin2"
2498#endif 2485#endif
2499 2486
2500static int __devinit 2487static int fore200e_load_and_start_fw(struct fore200e *fore200e)
2501fore200e_load_and_start_fw(struct fore200e* fore200e)
2502{ 2488{
2503 const struct firmware *firmware; 2489 const struct firmware *firmware;
2504 struct device *device; 2490 struct device *device;
@@ -2566,8 +2552,7 @@ release:
2566} 2552}
2567 2553
2568 2554
2569static int __devinit 2555static int fore200e_register(struct fore200e *fore200e, struct device *parent)
2570fore200e_register(struct fore200e* fore200e, struct device *parent)
2571{ 2556{
2572 struct atm_dev* atm_dev; 2557 struct atm_dev* atm_dev;
2573 2558
@@ -2593,8 +2578,7 @@ fore200e_register(struct fore200e* fore200e, struct device *parent)
2593} 2578}
2594 2579
2595 2580
2596static int __devinit 2581static int fore200e_init(struct fore200e *fore200e, struct device *parent)
2597fore200e_init(struct fore200e* fore200e, struct device *parent)
2598{ 2582{
2599 if (fore200e_register(fore200e, parent) < 0) 2583 if (fore200e_register(fore200e, parent) < 0)
2600 return -ENODEV; 2584 return -ENODEV;
@@ -2644,7 +2628,7 @@ fore200e_init(struct fore200e* fore200e, struct device *parent)
2644 2628
2645#ifdef CONFIG_SBUS 2629#ifdef CONFIG_SBUS
2646static const struct of_device_id fore200e_sba_match[]; 2630static const struct of_device_id fore200e_sba_match[];
2647static int __devinit fore200e_sba_probe(struct platform_device *op) 2631static int fore200e_sba_probe(struct platform_device *op)
2648{ 2632{
2649 const struct of_device_id *match; 2633 const struct of_device_id *match;
2650 const struct fore200e_bus *bus; 2634 const struct fore200e_bus *bus;
@@ -2681,7 +2665,7 @@ static int __devinit fore200e_sba_probe(struct platform_device *op)
2681 return 0; 2665 return 0;
2682} 2666}
2683 2667
2684static int __devexit fore200e_sba_remove(struct platform_device *op) 2668static int fore200e_sba_remove(struct platform_device *op)
2685{ 2669{
2686 struct fore200e *fore200e = dev_get_drvdata(&op->dev); 2670 struct fore200e *fore200e = dev_get_drvdata(&op->dev);
2687 2671
@@ -2707,13 +2691,13 @@ static struct platform_driver fore200e_sba_driver = {
2707 .of_match_table = fore200e_sba_match, 2691 .of_match_table = fore200e_sba_match,
2708 }, 2692 },
2709 .probe = fore200e_sba_probe, 2693 .probe = fore200e_sba_probe,
2710 .remove = __devexit_p(fore200e_sba_remove), 2694 .remove = fore200e_sba_remove,
2711}; 2695};
2712#endif 2696#endif
2713 2697
2714#ifdef CONFIG_PCI 2698#ifdef CONFIG_PCI
2715static int __devinit 2699static int fore200e_pca_detect(struct pci_dev *pci_dev,
2716fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) 2700 const struct pci_device_id *pci_ent)
2717{ 2701{
2718 const struct fore200e_bus* bus = (struct fore200e_bus*) pci_ent->driver_data; 2702 const struct fore200e_bus* bus = (struct fore200e_bus*) pci_ent->driver_data;
2719 struct fore200e* fore200e; 2703 struct fore200e* fore200e;
@@ -2766,7 +2750,7 @@ out_disable:
2766} 2750}
2767 2751
2768 2752
2769static void __devexit fore200e_pca_remove_one(struct pci_dev *pci_dev) 2753static void fore200e_pca_remove_one(struct pci_dev *pci_dev)
2770{ 2754{
2771 struct fore200e *fore200e; 2755 struct fore200e *fore200e;
2772 2756
@@ -2789,7 +2773,7 @@ MODULE_DEVICE_TABLE(pci, fore200e_pca_tbl);
2789static struct pci_driver fore200e_pca_driver = { 2773static struct pci_driver fore200e_pca_driver = {
2790 .name = "fore_200e", 2774 .name = "fore_200e",
2791 .probe = fore200e_pca_detect, 2775 .probe = fore200e_pca_detect,
2792 .remove = __devexit_p(fore200e_pca_remove_one), 2776 .remove = fore200e_pca_remove_one,
2793 .id_table = fore200e_pca_tbl, 2777 .id_table = fore200e_pca_tbl,
2794}; 2778};
2795#endif 2779#endif
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index b182c2f7d77..72b6960fa95 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -349,8 +349,8 @@ __find_vcc(struct he_dev *he_dev, unsigned cid)
349 return NULL; 349 return NULL;
350} 350}
351 351
352static int __devinit 352static int he_init_one(struct pci_dev *pci_dev,
353he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) 353 const struct pci_device_id *pci_ent)
354{ 354{
355 struct atm_dev *atm_dev = NULL; 355 struct atm_dev *atm_dev = NULL;
356 struct he_dev *he_dev = NULL; 356 struct he_dev *he_dev = NULL;
@@ -406,8 +406,7 @@ init_one_failure:
406 return err; 406 return err;
407} 407}
408 408
409static void __devexit 409static void he_remove_one(struct pci_dev *pci_dev)
410he_remove_one (struct pci_dev *pci_dev)
411{ 410{
412 struct atm_dev *atm_dev; 411 struct atm_dev *atm_dev;
413 struct he_dev *he_dev; 412 struct he_dev *he_dev;
@@ -445,8 +444,7 @@ rate_to_atmf(unsigned rate) /* cps to atm forum format */
445 return (NONZERO | (exp << 9) | (rate & 0x1ff)); 444 return (NONZERO | (exp << 9) | (rate & 0x1ff));
446} 445}
447 446
448static void __devinit 447static void he_init_rx_lbfp0(struct he_dev *he_dev)
449he_init_rx_lbfp0(struct he_dev *he_dev)
450{ 448{
451 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 449 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
452 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; 450 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf;
@@ -476,8 +474,7 @@ he_init_rx_lbfp0(struct he_dev *he_dev)
476 he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C); 474 he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C);
477} 475}
478 476
479static void __devinit 477static void he_init_rx_lbfp1(struct he_dev *he_dev)
480he_init_rx_lbfp1(struct he_dev *he_dev)
481{ 478{
482 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 479 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
483 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; 480 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf;
@@ -507,8 +504,7 @@ he_init_rx_lbfp1(struct he_dev *he_dev)
507 he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C); 504 he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C);
508} 505}
509 506
510static void __devinit 507static void he_init_tx_lbfp(struct he_dev *he_dev)
511he_init_tx_lbfp(struct he_dev *he_dev)
512{ 508{
513 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 509 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
514 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; 510 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf;
@@ -537,8 +533,7 @@ he_init_tx_lbfp(struct he_dev *he_dev)
537 he_writel(he_dev, lbufd_index - 1, TLBF_T); 533 he_writel(he_dev, lbufd_index - 1, TLBF_T);
538} 534}
539 535
540static int __devinit 536static int he_init_tpdrq(struct he_dev *he_dev)
541he_init_tpdrq(struct he_dev *he_dev)
542{ 537{
543 he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev, 538 he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev,
544 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), &he_dev->tpdrq_phys); 539 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), &he_dev->tpdrq_phys);
@@ -559,8 +554,7 @@ he_init_tpdrq(struct he_dev *he_dev)
559 return 0; 554 return 0;
560} 555}
561 556
562static void __devinit 557static void he_init_cs_block(struct he_dev *he_dev)
563he_init_cs_block(struct he_dev *he_dev)
564{ 558{
565 unsigned clock, rate, delta; 559 unsigned clock, rate, delta;
566 int reg; 560 int reg;
@@ -655,8 +649,7 @@ he_init_cs_block(struct he_dev *he_dev)
655 649
656} 650}
657 651
658static int __devinit 652static int he_init_cs_block_rcm(struct he_dev *he_dev)
659he_init_cs_block_rcm(struct he_dev *he_dev)
660{ 653{
661 unsigned (*rategrid)[16][16]; 654 unsigned (*rategrid)[16][16];
662 unsigned rate, delta; 655 unsigned rate, delta;
@@ -776,8 +769,7 @@ he_init_cs_block_rcm(struct he_dev *he_dev)
776 return 0; 769 return 0;
777} 770}
778 771
779static int __devinit 772static int he_init_group(struct he_dev *he_dev, int group)
780he_init_group(struct he_dev *he_dev, int group)
781{ 773{
782 struct he_buff *heb, *next; 774 struct he_buff *heb, *next;
783 dma_addr_t mapping; 775 dma_addr_t mapping;
@@ -915,8 +907,7 @@ out_free_rbpl_table:
915 return -ENOMEM; 907 return -ENOMEM;
916} 908}
917 909
918static int __devinit 910static int he_init_irq(struct he_dev *he_dev)
919he_init_irq(struct he_dev *he_dev)
920{ 911{
921 int i; 912 int i;
922 913
@@ -978,8 +969,7 @@ he_init_irq(struct he_dev *he_dev)
978 return 0; 969 return 0;
979} 970}
980 971
981static int __devinit 972static int he_start(struct atm_dev *dev)
982he_start(struct atm_dev *dev)
983{ 973{
984 struct he_dev *he_dev; 974 struct he_dev *he_dev;
985 struct pci_dev *pci_dev; 975 struct pci_dev *pci_dev;
@@ -2879,7 +2869,7 @@ MODULE_DEVICE_TABLE(pci, he_pci_tbl);
2879static struct pci_driver he_driver = { 2869static struct pci_driver he_driver = {
2880 .name = "he", 2870 .name = "he",
2881 .probe = he_init_one, 2871 .probe = he_init_one,
2882 .remove = __devexit_p(he_remove_one), 2872 .remove = he_remove_one,
2883 .id_table = he_pci_tbl, 2873 .id_table = he_pci_tbl,
2884}; 2874};
2885 2875
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 7d01c2a7525..1dc0519333f 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -1789,7 +1789,7 @@ static void CLOCK_IT (const hrz_dev *dev, u32 ctrl)
1789 WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK); 1789 WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK);
1790} 1790}
1791 1791
1792static u16 __devinit read_bia (const hrz_dev * dev, u16 addr) 1792static u16 read_bia(const hrz_dev *dev, u16 addr)
1793{ 1793{
1794 u32 ctrl = rd_regl (dev, CONTROL_0_REG); 1794 u32 ctrl = rd_regl (dev, CONTROL_0_REG);
1795 1795
@@ -1845,7 +1845,8 @@ static u16 __devinit read_bia (const hrz_dev * dev, u16 addr)
1845 1845
1846/********** initialise a card **********/ 1846/********** initialise a card **********/
1847 1847
1848static int __devinit hrz_init (hrz_dev * dev) { 1848static int hrz_init(hrz_dev *dev)
1849{
1849 int onefivefive; 1850 int onefivefive;
1850 1851
1851 u16 chan; 1852 u16 chan;
@@ -2681,7 +2682,8 @@ static const struct atmdev_ops hrz_ops = {
2681 .owner = THIS_MODULE, 2682 .owner = THIS_MODULE,
2682}; 2683};
2683 2684
2684static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) 2685static int hrz_probe(struct pci_dev *pci_dev,
2686 const struct pci_device_id *pci_ent)
2685{ 2687{
2686 hrz_dev * dev; 2688 hrz_dev * dev;
2687 int err = 0; 2689 int err = 0;
@@ -2836,7 +2838,7 @@ out_disable:
2836 goto out; 2838 goto out;
2837} 2839}
2838 2840
2839static void __devexit hrz_remove_one(struct pci_dev *pci_dev) 2841static void hrz_remove_one(struct pci_dev *pci_dev)
2840{ 2842{
2841 hrz_dev *dev; 2843 hrz_dev *dev;
2842 2844
@@ -2901,7 +2903,7 @@ MODULE_DEVICE_TABLE(pci, hrz_pci_tbl);
2901static struct pci_driver hrz_driver = { 2903static struct pci_driver hrz_driver = {
2902 .name = "horizon", 2904 .name = "horizon",
2903 .probe = hrz_probe, 2905 .probe = hrz_probe,
2904 .remove = __devexit_p(hrz_remove_one), 2906 .remove = hrz_remove_one,
2905 .id_table = hrz_pci_tbl, 2907 .id_table = hrz_pci_tbl,
2906}; 2908};
2907 2909
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 8974bd2b961..272f0092776 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3109,8 +3109,7 @@ deinit_card(struct idt77252_dev *card)
3109} 3109}
3110 3110
3111 3111
3112static void __devinit 3112static void init_sram(struct idt77252_dev *card)
3113init_sram(struct idt77252_dev *card)
3114{ 3113{
3115 int i; 3114 int i;
3116 3115
@@ -3257,8 +3256,7 @@ init_sram(struct idt77252_dev *card)
3257 IPRINTK("%s: SRAM initialization complete.\n", card->name); 3256 IPRINTK("%s: SRAM initialization complete.\n", card->name);
3258} 3257}
3259 3258
3260static int __devinit 3259static int init_card(struct atm_dev *dev)
3261init_card(struct atm_dev *dev)
3262{ 3260{
3263 struct idt77252_dev *card = dev->dev_data; 3261 struct idt77252_dev *card = dev->dev_data;
3264 struct pci_dev *pcidev = card->pcidev; 3262 struct pci_dev *pcidev = card->pcidev;
@@ -3537,8 +3535,7 @@ init_card(struct atm_dev *dev)
3537/*****************************************************************************/ 3535/*****************************************************************************/
3538 3536
3539 3537
3540static int __devinit 3538static int idt77252_preset(struct idt77252_dev *card)
3541idt77252_preset(struct idt77252_dev *card)
3542{ 3539{
3543 u16 pci_command; 3540 u16 pci_command;
3544 3541
@@ -3579,8 +3576,7 @@ idt77252_preset(struct idt77252_dev *card)
3579} 3576}
3580 3577
3581 3578
3582static unsigned long __devinit 3579static unsigned long probe_sram(struct idt77252_dev *card)
3583probe_sram(struct idt77252_dev *card)
3584{ 3580{
3585 u32 data, addr; 3581 u32 data, addr;
3586 3582
@@ -3601,8 +3597,8 @@ probe_sram(struct idt77252_dev *card)
3601 return addr * sizeof(u32); 3597 return addr * sizeof(u32);
3602} 3598}
3603 3599
3604static int __devinit 3600static int idt77252_init_one(struct pci_dev *pcidev,
3605idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) 3601 const struct pci_device_id *id)
3606{ 3602{
3607 static struct idt77252_dev **last = &idt77252_chain; 3603 static struct idt77252_dev **last = &idt77252_chain;
3608 static int index = 0; 3604 static int index = 0;
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 96cce6d5319..4217f29a85e 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2299,7 +2299,7 @@ static int reset_sar(struct atm_dev *dev)
2299} 2299}
2300 2300
2301 2301
2302static int __devinit ia_init(struct atm_dev *dev) 2302static int ia_init(struct atm_dev *dev)
2303{ 2303{
2304 IADEV *iadev; 2304 IADEV *iadev;
2305 unsigned long real_base; 2305 unsigned long real_base;
@@ -2492,7 +2492,7 @@ static void ia_free_rx(IADEV *iadev)
2492 iadev->rx_dle_dma); 2492 iadev->rx_dle_dma);
2493} 2493}
2494 2494
2495static int __devinit ia_start(struct atm_dev *dev) 2495static int ia_start(struct atm_dev *dev)
2496{ 2496{
2497 IADEV *iadev; 2497 IADEV *iadev;
2498 int error; 2498 int error;
@@ -3168,8 +3168,7 @@ static const struct atmdev_ops ops = {
3168 .owner = THIS_MODULE, 3168 .owner = THIS_MODULE,
3169}; 3169};
3170 3170
3171static int __devinit ia_init_one(struct pci_dev *pdev, 3171static int ia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3172 const struct pci_device_id *ent)
3173{ 3172{
3174 struct atm_dev *dev; 3173 struct atm_dev *dev;
3175 IADEV *iadev; 3174 IADEV *iadev;
@@ -3229,7 +3228,7 @@ err_out:
3229 return ret; 3228 return ret;
3230} 3229}
3231 3230
3232static void __devexit ia_remove_one(struct pci_dev *pdev) 3231static void ia_remove_one(struct pci_dev *pdev)
3233{ 3232{
3234 struct atm_dev *dev = pci_get_drvdata(pdev); 3233 struct atm_dev *dev = pci_get_drvdata(pdev);
3235 IADEV *iadev = INPH_IA_DEV(dev); 3234 IADEV *iadev = INPH_IA_DEV(dev);
@@ -3270,7 +3269,7 @@ static struct pci_driver ia_driver = {
3270 .name = DEV_LABEL, 3269 .name = DEV_LABEL,
3271 .id_table = ia_pci_tbl, 3270 .id_table = ia_pci_tbl,
3272 .probe = ia_init_one, 3271 .probe = ia_init_one,
3273 .remove = __devexit_p(ia_remove_one), 3272 .remove = ia_remove_one,
3274}; 3273};
3275 3274
3276static int __init ia_module_init(void) 3275static int __init ia_module_init(void)
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 68c75887181..fa7d701933b 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -551,8 +551,8 @@ static inline void sram_write(const struct lanai_dev *lanai,
551 writel(val, sram_addr(lanai, offset)); 551 writel(val, sram_addr(lanai, offset));
552} 552}
553 553
554static int __devinit sram_test_word(const struct lanai_dev *lanai, 554static int sram_test_word(const struct lanai_dev *lanai, int offset,
555 int offset, u32 pattern) 555 u32 pattern)
556{ 556{
557 u32 readback; 557 u32 readback;
558 sram_write(lanai, pattern, offset); 558 sram_write(lanai, pattern, offset);
@@ -566,7 +566,7 @@ static int __devinit sram_test_word(const struct lanai_dev *lanai,
566 return -EIO; 566 return -EIO;
567} 567}
568 568
569static int __devinit sram_test_pass(const struct lanai_dev *lanai, u32 pattern) 569static int sram_test_pass(const struct lanai_dev *lanai, u32 pattern)
570{ 570{
571 int offset, result = 0; 571 int offset, result = 0;
572 for (offset = 0; offset < SRAM_BYTES && result == 0; offset += 4) 572 for (offset = 0; offset < SRAM_BYTES && result == 0; offset += 4)
@@ -574,7 +574,7 @@ static int __devinit sram_test_pass(const struct lanai_dev *lanai, u32 pattern)
574 return result; 574 return result;
575} 575}
576 576
577static int __devinit sram_test_and_clear(const struct lanai_dev *lanai) 577static int sram_test_and_clear(const struct lanai_dev *lanai)
578{ 578{
579#ifdef FULL_MEMORY_TEST 579#ifdef FULL_MEMORY_TEST
580 int result; 580 int result;
@@ -860,7 +860,7 @@ static inline void aal0_buffer_free(struct lanai_dev *lanai)
860#ifndef READ_EEPROM 860#ifndef READ_EEPROM
861 861
862/* Stub functions to use if EEPROM reading is disabled */ 862/* Stub functions to use if EEPROM reading is disabled */
863static int __devinit eeprom_read(struct lanai_dev *lanai) 863static int eeprom_read(struct lanai_dev *lanai)
864{ 864{
865 printk(KERN_INFO DEV_LABEL "(itf %d): *NOT* reading EEPROM\n", 865 printk(KERN_INFO DEV_LABEL "(itf %d): *NOT* reading EEPROM\n",
866 lanai->number); 866 lanai->number);
@@ -868,7 +868,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai)
868 return 0; 868 return 0;
869} 869}
870 870
871static int __devinit eeprom_validate(struct lanai_dev *lanai) 871static int eeprom_validate(struct lanai_dev *lanai)
872{ 872{
873 lanai->serialno = 0; 873 lanai->serialno = 0;
874 lanai->magicno = EEPROM_MAGIC_VALUE; 874 lanai->magicno = EEPROM_MAGIC_VALUE;
@@ -877,7 +877,7 @@ static int __devinit eeprom_validate(struct lanai_dev *lanai)
877 877
878#else /* READ_EEPROM */ 878#else /* READ_EEPROM */
879 879
880static int __devinit eeprom_read(struct lanai_dev *lanai) 880static int eeprom_read(struct lanai_dev *lanai)
881{ 881{
882 int i, address; 882 int i, address;
883 u8 data; 883 u8 data;
@@ -953,7 +953,7 @@ static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)
953} 953}
954 954
955/* Checksum/validate EEPROM contents */ 955/* Checksum/validate EEPROM contents */
956static int __devinit eeprom_validate(struct lanai_dev *lanai) 956static int eeprom_validate(struct lanai_dev *lanai)
957{ 957{
958 int i, s; 958 int i, s;
959 u32 v; 959 u32 v;
@@ -1448,7 +1448,7 @@ static void vcc_rx_aal0(struct lanai_dev *lanai)
1448#include <linux/vmalloc.h> 1448#include <linux/vmalloc.h>
1449#endif 1449#endif
1450 1450
1451static int __devinit vcc_table_allocate(struct lanai_dev *lanai) 1451static int vcc_table_allocate(struct lanai_dev *lanai)
1452{ 1452{
1453#ifdef VCCTABLE_GETFREEPAGE 1453#ifdef VCCTABLE_GETFREEPAGE
1454 APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE, 1454 APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE,
@@ -1588,7 +1588,7 @@ static void lanai_reset(struct lanai_dev *lanai)
1588/* 1588/*
1589 * Allocate service buffer and tell card about it 1589 * Allocate service buffer and tell card about it
1590 */ 1590 */
1591static int __devinit service_buffer_allocate(struct lanai_dev *lanai) 1591static int service_buffer_allocate(struct lanai_dev *lanai)
1592{ 1592{
1593 lanai_buf_allocate(&lanai->service, SERVICE_ENTRIES * 4, 8, 1593 lanai_buf_allocate(&lanai->service, SERVICE_ENTRIES * 4, 8,
1594 lanai->pci); 1594 lanai->pci);
@@ -1942,7 +1942,7 @@ static int check_board_id_and_rev(const char *name, u32 val, int *revp)
1942 1942
1943/* -------------------- PCI INITIALIZATION/SHUTDOWN: */ 1943/* -------------------- PCI INITIALIZATION/SHUTDOWN: */
1944 1944
1945static int __devinit lanai_pci_start(struct lanai_dev *lanai) 1945static int lanai_pci_start(struct lanai_dev *lanai)
1946{ 1946{
1947 struct pci_dev *pci = lanai->pci; 1947 struct pci_dev *pci = lanai->pci;
1948 int result; 1948 int result;
@@ -2123,7 +2123,7 @@ static inline void lanai_cbr_shutdown(struct lanai_dev *lanai)
2123/* -------------------- OPERATIONS: */ 2123/* -------------------- OPERATIONS: */
2124 2124
2125/* setup a newly detected device */ 2125/* setup a newly detected device */
2126static int __devinit lanai_dev_open(struct atm_dev *atmdev) 2126static int lanai_dev_open(struct atm_dev *atmdev)
2127{ 2127{
2128 struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; 2128 struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
2129 unsigned long raw_base; 2129 unsigned long raw_base;
@@ -2566,8 +2566,8 @@ static const struct atmdev_ops ops = {
2566}; 2566};
2567 2567
2568/* initialize one probed card */ 2568/* initialize one probed card */
2569static int __devinit lanai_init_one(struct pci_dev *pci, 2569static int lanai_init_one(struct pci_dev *pci,
2570 const struct pci_device_id *ident) 2570 const struct pci_device_id *ident)
2571{ 2571{
2572 struct lanai_dev *lanai; 2572 struct lanai_dev *lanai;
2573 struct atm_dev *atmdev; 2573 struct atm_dev *atmdev;
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 1c70c45fa04..ed1d2b7f923 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -121,8 +121,8 @@
121static u32 ns_read_sram(ns_dev * card, u32 sram_address); 121static u32 ns_read_sram(ns_dev * card, u32 sram_address);
122static void ns_write_sram(ns_dev * card, u32 sram_address, u32 * value, 122static void ns_write_sram(ns_dev * card, u32 sram_address, u32 * value,
123 int count); 123 int count);
124static int __devinit ns_init_card(int i, struct pci_dev *pcidev); 124static int ns_init_card(int i, struct pci_dev *pcidev);
125static void __devinit ns_init_card_error(ns_dev * card, int error); 125static void ns_init_card_error(ns_dev * card, int error);
126static scq_info *get_scq(ns_dev *card, int size, u32 scd); 126static scq_info *get_scq(ns_dev *card, int size, u32 scd);
127static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc); 127static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc);
128static void push_rxbufs(ns_dev *, struct sk_buff *); 128static void push_rxbufs(ns_dev *, struct sk_buff *);
@@ -180,8 +180,8 @@ MODULE_LICENSE("GPL");
180 180
181/* Functions */ 181/* Functions */
182 182
183static int __devinit nicstar_init_one(struct pci_dev *pcidev, 183static int nicstar_init_one(struct pci_dev *pcidev,
184 const struct pci_device_id *ent) 184 const struct pci_device_id *ent)
185{ 185{
186 static int index = -1; 186 static int index = -1;
187 unsigned int error; 187 unsigned int error;
@@ -200,7 +200,7 @@ err_out:
200 return -ENODEV; 200 return -ENODEV;
201} 201}
202 202
203static void __devexit nicstar_remove_one(struct pci_dev *pcidev) 203static void nicstar_remove_one(struct pci_dev *pcidev)
204{ 204{
205 int i, j; 205 int i, j;
206 ns_dev *card = pci_get_drvdata(pcidev); 206 ns_dev *card = pci_get_drvdata(pcidev);
@@ -262,7 +262,7 @@ static void __devexit nicstar_remove_one(struct pci_dev *pcidev)
262 kfree(card); 262 kfree(card);
263} 263}
264 264
265static struct pci_device_id nicstar_pci_tbl[] __devinitdata = { 265static struct pci_device_id nicstar_pci_tbl[] = {
266 { PCI_VDEVICE(IDT, PCI_DEVICE_ID_IDT_IDT77201), 0 }, 266 { PCI_VDEVICE(IDT, PCI_DEVICE_ID_IDT_IDT77201), 0 },
267 {0,} /* terminate list */ 267 {0,} /* terminate list */
268}; 268};
@@ -273,7 +273,7 @@ static struct pci_driver nicstar_driver = {
273 .name = "nicstar", 273 .name = "nicstar",
274 .id_table = nicstar_pci_tbl, 274 .id_table = nicstar_pci_tbl,
275 .probe = nicstar_init_one, 275 .probe = nicstar_init_one,
276 .remove = __devexit_p(nicstar_remove_one), 276 .remove = nicstar_remove_one,
277}; 277};
278 278
279static int __init nicstar_init(void) 279static int __init nicstar_init(void)
@@ -351,7 +351,7 @@ static void ns_write_sram(ns_dev * card, u32 sram_address, u32 * value,
351 spin_unlock_irqrestore(&card->res_lock, flags); 351 spin_unlock_irqrestore(&card->res_lock, flags);
352} 352}
353 353
354static int __devinit ns_init_card(int i, struct pci_dev *pcidev) 354static int ns_init_card(int i, struct pci_dev *pcidev)
355{ 355{
356 int j; 356 int j;
357 struct ns_dev *card = NULL; 357 struct ns_dev *card = NULL;
@@ -821,7 +821,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
821 return error; 821 return error;
822} 822}
823 823
824static void __devinit ns_init_card_error(ns_dev * card, int error) 824static void ns_init_card_error(ns_dev *card, int error)
825{ 825{
826 if (error >= 17) { 826 if (error >= 17) {
827 writel(0x00000000, card->membase + CFG); 827 writel(0x00000000, card->membase + CFG);
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index d47db401027..0474a89170b 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1462,7 +1462,7 @@ static void fpga_remove(struct pci_dev *dev)
1462 kfree(card); 1462 kfree(card);
1463} 1463}
1464 1464
1465static struct pci_device_id fpga_pci_tbl[] __devinitdata = { 1465static struct pci_device_id fpga_pci_tbl[] = {
1466 { 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 1466 { 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
1467 { 0, } 1467 { 0, }
1468}; 1468};
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index abe4e20b076..969c3c29000 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1094,8 +1094,8 @@ static irqreturn_t zatm_int(int irq,void *dev_id)
1094/*----------------------------- (E)EPROM access -----------------------------*/ 1094/*----------------------------- (E)EPROM access -----------------------------*/
1095 1095
1096 1096
1097static void __devinit eprom_set(struct zatm_dev *zatm_dev,unsigned long value, 1097static void eprom_set(struct zatm_dev *zatm_dev, unsigned long value,
1098 unsigned short cmd) 1098 unsigned short cmd)
1099{ 1099{
1100 int error; 1100 int error;
1101 1101
@@ -1105,8 +1105,7 @@ static void __devinit eprom_set(struct zatm_dev *zatm_dev,unsigned long value,
1105} 1105}
1106 1106
1107 1107
1108static unsigned long __devinit eprom_get(struct zatm_dev *zatm_dev, 1108static unsigned long eprom_get(struct zatm_dev *zatm_dev, unsigned short cmd)
1109 unsigned short cmd)
1110{ 1109{
1111 unsigned int value; 1110 unsigned int value;
1112 int error; 1111 int error;
@@ -1118,8 +1117,8 @@ static unsigned long __devinit eprom_get(struct zatm_dev *zatm_dev,
1118} 1117}
1119 1118
1120 1119
1121static void __devinit eprom_put_bits(struct zatm_dev *zatm_dev, 1120static void eprom_put_bits(struct zatm_dev *zatm_dev, unsigned long data,
1122 unsigned long data,int bits,unsigned short cmd) 1121 int bits, unsigned short cmd)
1123{ 1122{
1124 unsigned long value; 1123 unsigned long value;
1125 int i; 1124 int i;
@@ -1133,8 +1132,8 @@ static void __devinit eprom_put_bits(struct zatm_dev *zatm_dev,
1133} 1132}
1134 1133
1135 1134
1136static void __devinit eprom_get_byte(struct zatm_dev *zatm_dev, 1135static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte,
1137 unsigned char *byte,unsigned short cmd) 1136 unsigned short cmd)
1138{ 1137{
1139 int i; 1138 int i;
1140 1139
@@ -1149,8 +1148,8 @@ static void __devinit eprom_get_byte(struct zatm_dev *zatm_dev,
1149} 1148}
1150 1149
1151 1150
1152static unsigned char __devinit eprom_try_esi(struct atm_dev *dev, 1151static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd,
1153 unsigned short cmd,int offset,int swap) 1152 int offset, int swap)
1154{ 1153{
1155 unsigned char buf[ZEPROM_SIZE]; 1154 unsigned char buf[ZEPROM_SIZE];
1156 struct zatm_dev *zatm_dev; 1155 struct zatm_dev *zatm_dev;
@@ -1170,7 +1169,7 @@ static unsigned char __devinit eprom_try_esi(struct atm_dev *dev,
1170} 1169}
1171 1170
1172 1171
1173static void __devinit eprom_get_esi(struct atm_dev *dev) 1172static void eprom_get_esi(struct atm_dev *dev)
1174{ 1173{
1175 if (eprom_try_esi(dev,ZEPROM_V1_REG,ZEPROM_V1_ESI_OFF,1)) return; 1174 if (eprom_try_esi(dev,ZEPROM_V1_REG,ZEPROM_V1_ESI_OFF,1)) return;
1176 (void) eprom_try_esi(dev,ZEPROM_V2_REG,ZEPROM_V2_ESI_OFF,0); 1175 (void) eprom_try_esi(dev,ZEPROM_V2_REG,ZEPROM_V2_ESI_OFF,0);
@@ -1180,7 +1179,7 @@ static void __devinit eprom_get_esi(struct atm_dev *dev)
1180/*--------------------------------- entries ---------------------------------*/ 1179/*--------------------------------- entries ---------------------------------*/
1181 1180
1182 1181
1183static int __devinit zatm_init(struct atm_dev *dev) 1182static int zatm_init(struct atm_dev *dev)
1184{ 1183{
1185 struct zatm_dev *zatm_dev; 1184 struct zatm_dev *zatm_dev;
1186 struct pci_dev *pci_dev; 1185 struct pci_dev *pci_dev;
@@ -1257,7 +1256,7 @@ static int __devinit zatm_init(struct atm_dev *dev)
1257} 1256}
1258 1257
1259 1258
1260static int __devinit zatm_start(struct atm_dev *dev) 1259static int zatm_start(struct atm_dev *dev)
1261{ 1260{
1262 struct zatm_dev *zatm_dev = ZATM_DEV(dev); 1261 struct zatm_dev *zatm_dev = ZATM_DEV(dev);
1263 struct pci_dev *pdev = zatm_dev->pci_dev; 1262 struct pci_dev *pdev = zatm_dev->pci_dev;
@@ -1584,8 +1583,8 @@ static const struct atmdev_ops ops = {
1584 .change_qos = zatm_change_qos, 1583 .change_qos = zatm_change_qos,
1585}; 1584};
1586 1585
1587static int __devinit zatm_init_one(struct pci_dev *pci_dev, 1586static int zatm_init_one(struct pci_dev *pci_dev,
1588 const struct pci_device_id *ent) 1587 const struct pci_device_id *ent)
1589{ 1588{
1590 struct atm_dev *dev; 1589 struct atm_dev *dev;
1591 struct zatm_dev *zatm_dev; 1590 struct zatm_dev *zatm_dev;
@@ -1636,7 +1635,7 @@ out_free:
1636 1635
1637MODULE_LICENSE("GPL"); 1636MODULE_LICENSE("GPL");
1638 1637
1639static struct pci_device_id zatm_pci_tbl[] __devinitdata = { 1638static struct pci_device_id zatm_pci_tbl[] = {
1640 { PCI_VDEVICE(ZEITNET, PCI_DEVICE_ID_ZEITNET_1221), ZATM_COPPER }, 1639 { PCI_VDEVICE(ZEITNET, PCI_DEVICE_ID_ZEITNET_1221), ZATM_COPPER },
1641 { PCI_VDEVICE(ZEITNET, PCI_DEVICE_ID_ZEITNET_1225), 0 }, 1640 { PCI_VDEVICE(ZEITNET, PCI_DEVICE_ID_ZEITNET_1225), 0 },
1642 { 0, } 1641 { 0, }
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index 5ad3bad2b0a..d585735430d 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -37,7 +37,7 @@
37 37
38#define CFAG12864BFB_NAME "cfag12864bfb" 38#define CFAG12864BFB_NAME "cfag12864bfb"
39 39
40static struct fb_fix_screeninfo cfag12864bfb_fix __devinitdata = { 40static struct fb_fix_screeninfo cfag12864bfb_fix = {
41 .id = "cfag12864b", 41 .id = "cfag12864b",
42 .type = FB_TYPE_PACKED_PIXELS, 42 .type = FB_TYPE_PACKED_PIXELS,
43 .visual = FB_VISUAL_MONO10, 43 .visual = FB_VISUAL_MONO10,
@@ -48,7 +48,7 @@ static struct fb_fix_screeninfo cfag12864bfb_fix __devinitdata = {
48 .accel = FB_ACCEL_NONE, 48 .accel = FB_ACCEL_NONE,
49}; 49};
50 50
51static struct fb_var_screeninfo cfag12864bfb_var __devinitdata = { 51static struct fb_var_screeninfo cfag12864bfb_var = {
52 .xres = CFAG12864B_WIDTH, 52 .xres = CFAG12864B_WIDTH,
53 .yres = CFAG12864B_HEIGHT, 53 .yres = CFAG12864B_HEIGHT,
54 .xres_virtual = CFAG12864B_WIDTH, 54 .xres_virtual = CFAG12864B_WIDTH,
@@ -80,7 +80,7 @@ static struct fb_ops cfag12864bfb_ops = {
80 .fb_mmap = cfag12864bfb_mmap, 80 .fb_mmap = cfag12864bfb_mmap,
81}; 81};
82 82
83static int __devinit cfag12864bfb_probe(struct platform_device *device) 83static int cfag12864bfb_probe(struct platform_device *device)
84{ 84{
85 int ret = -EINVAL; 85 int ret = -EINVAL;
86 struct fb_info *info = framebuffer_alloc(0, &device->dev); 86 struct fb_info *info = framebuffer_alloc(0, &device->dev);
@@ -114,7 +114,7 @@ none:
114 return ret; 114 return ret;
115} 115}
116 116
117static int __devexit cfag12864bfb_remove(struct platform_device *device) 117static int cfag12864bfb_remove(struct platform_device *device)
118{ 118{
119 struct fb_info *info = platform_get_drvdata(device); 119 struct fb_info *info = platform_get_drvdata(device);
120 120
@@ -128,7 +128,7 @@ static int __devexit cfag12864bfb_remove(struct platform_device *device)
128 128
129static struct platform_driver cfag12864bfb_driver = { 129static struct platform_driver cfag12864bfb_driver = {
130 .probe = cfag12864bfb_probe, 130 .probe = cfag12864bfb_probe,
131 .remove = __devexit_p(cfag12864bfb_remove), 131 .remove = cfag12864bfb_remove,
132 .driver = { 132 .driver = {
133 .name = CFAG12864BFB_NAME, 133 .name = CFAG12864BFB_NAME,
134 }, 134 },
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index a3c1404c793..2b7f77d3fcb 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -513,6 +513,8 @@ static int device_resume_early(struct device *dev, pm_message_t state)
513 513
514 Out: 514 Out:
515 TRACE_RESUME(error); 515 TRACE_RESUME(error);
516
517 pm_runtime_enable(dev);
516 return error; 518 return error;
517} 519}
518 520
@@ -589,8 +591,6 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
589 if (!dev->power.is_suspended) 591 if (!dev->power.is_suspended)
590 goto Unlock; 592 goto Unlock;
591 593
592 pm_runtime_enable(dev);
593
594 if (dev->pm_domain) { 594 if (dev->pm_domain) {
595 info = "power domain "; 595 info = "power domain ";
596 callback = pm_op(&dev->pm_domain->ops, state); 596 callback = pm_op(&dev->pm_domain->ops, state);
@@ -930,6 +930,8 @@ static int device_suspend_late(struct device *dev, pm_message_t state)
930 pm_callback_t callback = NULL; 930 pm_callback_t callback = NULL;
931 char *info = NULL; 931 char *info = NULL;
932 932
933 __pm_runtime_disable(dev, false);
934
933 if (dev->power.syscore) 935 if (dev->power.syscore)
934 return 0; 936 return 0;
935 937
@@ -1133,11 +1135,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
1133 1135
1134 Complete: 1136 Complete:
1135 complete_all(&dev->power.completion); 1137 complete_all(&dev->power.completion);
1136
1137 if (error) 1138 if (error)
1138 async_error = error; 1139 async_error = error;
1139 else if (dev->power.is_suspended)
1140 __pm_runtime_disable(dev, false);
1141 1140
1142 return error; 1141 return error;
1143} 1142}
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index ff46387f530..d21349544ce 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -542,19 +542,19 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
542 struct dev_pm_qos_request *req, s32 value) 542 struct dev_pm_qos_request *req, s32 value)
543{ 543{
544 struct device *ancestor = dev->parent; 544 struct device *ancestor = dev->parent;
545 int error = -ENODEV; 545 int ret = -ENODEV;
546 546
547 while (ancestor && !ancestor->power.ignore_children) 547 while (ancestor && !ancestor->power.ignore_children)
548 ancestor = ancestor->parent; 548 ancestor = ancestor->parent;
549 549
550 if (ancestor) 550 if (ancestor)
551 error = dev_pm_qos_add_request(ancestor, req, 551 ret = dev_pm_qos_add_request(ancestor, req,
552 DEV_PM_QOS_LATENCY, value); 552 DEV_PM_QOS_LATENCY, value);
553 553
554 if (error < 0) 554 if (ret < 0)
555 req->dev = NULL; 555 req->dev = NULL;
556 556
557 return error; 557 return ret;
558} 558}
559EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request); 559EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
560 560
diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index d7b56a88c9f..8b4221cfd11 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -67,8 +67,7 @@ config BCMA_DRIVER_GMAC_CMN
67 67
68config BCMA_DRIVER_GPIO 68config BCMA_DRIVER_GPIO
69 bool "BCMA GPIO driver" 69 bool "BCMA GPIO driver"
70 depends on BCMA 70 depends on BCMA && GPIOLIB
71 select GPIOLIB
72 help 71 help
73 Driver to provide access to the GPIO pins of the bcma bus. 72 Driver to provide access to the GPIO pins of the bcma bus.
74 73
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 4a2d72ec6d4..19e3fbfd575 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -22,7 +22,7 @@
22struct bcma_bus; 22struct bcma_bus;
23 23
24/* main.c */ 24/* main.c */
25int __devinit bcma_bus_register(struct bcma_bus *bus); 25int bcma_bus_register(struct bcma_bus *bus);
26void bcma_bus_unregister(struct bcma_bus *bus); 26void bcma_bus_unregister(struct bcma_bus *bus);
27int __init bcma_bus_early_register(struct bcma_bus *bus, 27int __init bcma_bus_early_register(struct bcma_bus *bus,
28 struct bcma_device *core_cc, 28 struct bcma_device *core_cc,
@@ -87,8 +87,8 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
87extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc); 87extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
88 88
89#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE 89#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
90bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc); 90bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
91void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); 91void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
92#endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */ 92#endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
93 93
94#ifdef CONFIG_BCMA_DRIVER_GPIO 94#ifdef CONFIG_BCMA_DRIVER_GPIO
diff --git a/drivers/bcma/driver_chipcommon_sflash.c b/drivers/bcma/driver_chipcommon_sflash.c
index 63e68839382..1e694db4532 100644
--- a/drivers/bcma/driver_chipcommon_sflash.c
+++ b/drivers/bcma/driver_chipcommon_sflash.c
@@ -35,7 +35,7 @@ static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = {
35 { "M25P40", 0x12, 0x10000, 8, }, 35 { "M25P40", 0x12, 0x10000, 8, },
36 36
37 { "M25P16", 0x14, 0x10000, 32, }, 37 { "M25P16", 0x14, 0x10000, 32, },
38 { "M25P32", 0x14, 0x10000, 64, }, 38 { "M25P32", 0x15, 0x10000, 64, },
39 { "M25P64", 0x16, 0x10000, 128, }, 39 { "M25P64", 0x16, 0x10000, 128, },
40 { "M25FL128", 0x17, 0x10000, 256, }, 40 { "M25FL128", 0x17, 0x10000, 256, },
41 { 0 }, 41 { 0 },
diff --git a/drivers/bcma/driver_gmac_cmn.c b/drivers/bcma/driver_gmac_cmn.c
index 834225f65e8..dcb137926d3 100644
--- a/drivers/bcma/driver_gmac_cmn.c
+++ b/drivers/bcma/driver_gmac_cmn.c
@@ -8,7 +8,7 @@
8#include "bcma_private.h" 8#include "bcma_private.h"
9#include <linux/bcma/bcma.h> 9#include <linux/bcma/bcma.h>
10 10
11void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) 11void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
12{ 12{
13 mutex_init(&gc->phy_mutex); 13 mutex_init(&gc->phy_mutex);
14} 14}
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index c39ee6d4585..cf7a476a519 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -207,14 +207,14 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
207 * Init. 207 * Init.
208 **************************************************/ 208 **************************************************/
209 209
210static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc) 210static void bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
211{ 211{
212 bcma_core_pci_fixcfg(pc); 212 bcma_core_pci_fixcfg(pc);
213 bcma_pcicore_serdes_workaround(pc); 213 bcma_pcicore_serdes_workaround(pc);
214 bcma_core_pci_config_fixup(pc); 214 bcma_core_pci_config_fixup(pc);
215} 215}
216 216
217void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) 217void bcma_core_pci_init(struct bcma_drv_pci *pc)
218{ 218{
219 if (pc->setup_done) 219 if (pc->setup_done)
220 return; 220 return;
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index e6b5c89469d..af0c9fabee5 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -24,7 +24,7 @@
24#define BCMA_PCI_SLOT_MAX 16 24#define BCMA_PCI_SLOT_MAX 16
25#define PCI_CONFIG_SPACE_SIZE 256 25#define PCI_CONFIG_SPACE_SIZE 256
26 26
27bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) 27bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
28{ 28{
29 struct bcma_bus *bus = pc->core->bus; 29 struct bcma_bus *bus = pc->core->bus;
30 u16 chipid_top; 30 u16 chipid_top;
@@ -264,10 +264,9 @@ static int bcma_core_pci_hostmode_write_config(struct pci_bus *bus,
264} 264}
265 265
266/* return cap_offset if requested capability exists in the PCI config space */ 266/* return cap_offset if requested capability exists in the PCI config space */
267static u8 __devinit bcma_find_pci_capability(struct bcma_drv_pci *pc, 267static u8 bcma_find_pci_capability(struct bcma_drv_pci *pc, unsigned int dev,
268 unsigned int dev, 268 unsigned int func, u8 req_cap_id,
269 unsigned int func, u8 req_cap_id, 269 unsigned char *buf, u32 *buflen)
270 unsigned char *buf, u32 *buflen)
271{ 270{
272 u8 cap_id; 271 u8 cap_id;
273 u8 cap_ptr = 0; 272 u8 cap_ptr = 0;
@@ -334,7 +333,7 @@ static u8 __devinit bcma_find_pci_capability(struct bcma_drv_pci *pc,
334 * Retry Status (CRS) Completion Status to software then 333 * Retry Status (CRS) Completion Status to software then
335 * enable the feature. 334 * enable the feature.
336 */ 335 */
337static void __devinit bcma_core_pci_enable_crs(struct bcma_drv_pci *pc) 336static void bcma_core_pci_enable_crs(struct bcma_drv_pci *pc)
338{ 337{
339 struct bcma_bus *bus = pc->core->bus; 338 struct bcma_bus *bus = pc->core->bus;
340 u8 cap_ptr, root_ctrl, root_cap, dev; 339 u8 cap_ptr, root_ctrl, root_cap, dev;
@@ -381,7 +380,7 @@ static void __devinit bcma_core_pci_enable_crs(struct bcma_drv_pci *pc)
381 } 380 }
382} 381}
383 382
384void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) 383void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
385{ 384{
386 struct bcma_bus *bus = pc->core->bus; 385 struct bcma_bus *bus = pc->core->bus;
387 struct bcma_drv_pci_host *pc_host; 386 struct bcma_drv_pci_host *pc_host;
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 98fdc3e014e..fbf2759e7e4 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -155,8 +155,8 @@ static const struct bcma_host_ops bcma_host_pci_ops = {
155 .awrite32 = bcma_host_pci_awrite32, 155 .awrite32 = bcma_host_pci_awrite32,
156}; 156};
157 157
158static int __devinit bcma_host_pci_probe(struct pci_dev *dev, 158static int bcma_host_pci_probe(struct pci_dev *dev,
159 const struct pci_device_id *id) 159 const struct pci_device_id *id)
160{ 160{
161 struct bcma_bus *bus; 161 struct bcma_bus *bus;
162 int err = -ENOMEM; 162 int err = -ENOMEM;
@@ -226,7 +226,7 @@ err_kfree_bus:
226 return err; 226 return err;
227} 227}
228 228
229static void __devexit bcma_host_pci_remove(struct pci_dev *dev) 229static void bcma_host_pci_remove(struct pci_dev *dev)
230{ 230{
231 struct bcma_bus *bus = pci_get_drvdata(dev); 231 struct bcma_bus *bus = pci_get_drvdata(dev);
232 232
@@ -284,7 +284,7 @@ static struct pci_driver bcma_pci_bridge_driver = {
284 .name = "bcma-pci-bridge", 284 .name = "bcma-pci-bridge",
285 .id_table = bcma_pci_bridge_tbl, 285 .id_table = bcma_pci_bridge_tbl,
286 .probe = bcma_host_pci_probe, 286 .probe = bcma_host_pci_probe,
287 .remove = __devexit_p(bcma_host_pci_remove), 287 .remove = bcma_host_pci_remove,
288 .driver.pm = BCMA_PM_OPS, 288 .driver.pm = BCMA_PM_OPS,
289}; 289};
290 290
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 53ba20ca17e..4a92f647b58 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -192,7 +192,7 @@ static void bcma_unregister_cores(struct bcma_bus *bus)
192 platform_device_unregister(bus->drv_cc.watchdog); 192 platform_device_unregister(bus->drv_cc.watchdog);
193} 193}
194 194
195int __devinit bcma_bus_register(struct bcma_bus *bus) 195int bcma_bus_register(struct bcma_bus *bus)
196{ 196{
197 int err; 197 int err;
198 struct bcma_device *core; 198 struct bcma_device *core;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6526157edaf..ade58bc8f3c 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -181,8 +181,8 @@ static void cciss_geometry_inquiry(ctlr_info_t *h, int logvol,
181 sector_t total_size, 181 sector_t total_size,
182 unsigned int block_size, InquiryData_struct *inq_buff, 182 unsigned int block_size, InquiryData_struct *inq_buff,
183 drive_info_struct *drv); 183 drive_info_struct *drv);
184static void __devinit cciss_interrupt_mode(ctlr_info_t *); 184static void cciss_interrupt_mode(ctlr_info_t *);
185static int __devinit cciss_enter_simple_mode(struct ctlr_info *h); 185static int cciss_enter_simple_mode(struct ctlr_info *h);
186static void start_io(ctlr_info_t *h); 186static void start_io(ctlr_info_t *h);
187static int sendcmd_withirq(ctlr_info_t *h, __u8 cmd, void *buff, size_t size, 187static int sendcmd_withirq(ctlr_info_t *h, __u8 cmd, void *buff, size_t size,
188 __u8 page_code, unsigned char scsi3addr[], 188 __u8 page_code, unsigned char scsi3addr[],
@@ -199,14 +199,13 @@ static void cciss_device_release(struct device *dev);
199static void cciss_free_gendisk(ctlr_info_t *h, int drv_index); 199static void cciss_free_gendisk(ctlr_info_t *h, int drv_index);
200static void cciss_free_drive_info(ctlr_info_t *h, int drv_index); 200static void cciss_free_drive_info(ctlr_info_t *h, int drv_index);
201static inline u32 next_command(ctlr_info_t *h); 201static inline u32 next_command(ctlr_info_t *h);
202static int __devinit cciss_find_cfg_addrs(struct pci_dev *pdev, 202static int cciss_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
203 void __iomem *vaddr, u32 *cfg_base_addr, u64 *cfg_base_addr_index, 203 u32 *cfg_base_addr, u64 *cfg_base_addr_index,
204 u64 *cfg_offset); 204 u64 *cfg_offset);
205static int __devinit cciss_pci_find_memory_BAR(struct pci_dev *pdev, 205static int cciss_pci_find_memory_BAR(struct pci_dev *pdev,
206 unsigned long *memory_bar); 206 unsigned long *memory_bar);
207static inline u32 cciss_tag_discard_error_bits(ctlr_info_t *h, u32 tag); 207static inline u32 cciss_tag_discard_error_bits(ctlr_info_t *h, u32 tag);
208static __devinit int write_driver_ver_to_cfgtable( 208static int write_driver_ver_to_cfgtable(CfgTable_struct __iomem *cfgtable);
209 CfgTable_struct __iomem *cfgtable);
210 209
211/* performant mode helper functions */ 210/* performant mode helper functions */
212static void calc_bucket_map(int *bucket, int num_buckets, int nsgs, 211static void calc_bucket_map(int *bucket, int num_buckets, int nsgs,
@@ -550,7 +549,7 @@ static const struct file_operations cciss_proc_fops = {
550 .write = cciss_proc_write, 549 .write = cciss_proc_write,
551}; 550};
552 551
553static void __devinit cciss_procinit(ctlr_info_t *h) 552static void cciss_procinit(ctlr_info_t *h)
554{ 553{
555 struct proc_dir_entry *pde; 554 struct proc_dir_entry *pde;
556 555
@@ -2663,8 +2662,8 @@ static int fill_cmd(ctlr_info_t *h, CommandList_struct *c, __u8 cmd, void *buff,
2663 return status; 2662 return status;
2664} 2663}
2665 2664
2666static int __devinit cciss_send_reset(ctlr_info_t *h, unsigned char *scsi3addr, 2665static int cciss_send_reset(ctlr_info_t *h, unsigned char *scsi3addr,
2667 u8 reset_type) 2666 u8 reset_type)
2668{ 2667{
2669 CommandList_struct *c; 2668 CommandList_struct *c;
2670 int return_status; 2669 int return_status;
@@ -3919,7 +3918,7 @@ static void calc_bucket_map(int bucket[], int num_buckets,
3919 } 3918 }
3920} 3919}
3921 3920
3922static void __devinit cciss_wait_for_mode_change_ack(ctlr_info_t *h) 3921static void cciss_wait_for_mode_change_ack(ctlr_info_t *h)
3923{ 3922{
3924 int i; 3923 int i;
3925 3924
@@ -3933,8 +3932,7 @@ static void __devinit cciss_wait_for_mode_change_ack(ctlr_info_t *h)
3933 } 3932 }
3934} 3933}
3935 3934
3936static __devinit void cciss_enter_performant_mode(ctlr_info_t *h, 3935static void cciss_enter_performant_mode(ctlr_info_t *h, u32 use_short_tags)
3937 u32 use_short_tags)
3938{ 3936{
3939 /* This is a bit complicated. There are 8 registers on 3937 /* This is a bit complicated. There are 8 registers on
3940 * the controller which we write to to tell it 8 different 3938 * the controller which we write to to tell it 8 different
@@ -4000,7 +3998,7 @@ static __devinit void cciss_enter_performant_mode(ctlr_info_t *h,
4000 " performant mode\n"); 3998 " performant mode\n");
4001} 3999}
4002 4000
4003static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) 4001static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
4004{ 4002{
4005 __u32 trans_support; 4003 __u32 trans_support;
4006 4004
@@ -4062,7 +4060,7 @@ clean_up:
4062 * controllers that are capable. If not, we use IO-APIC mode. 4060 * controllers that are capable. If not, we use IO-APIC mode.
4063 */ 4061 */
4064 4062
4065static void __devinit cciss_interrupt_mode(ctlr_info_t *h) 4063static void cciss_interrupt_mode(ctlr_info_t *h)
4066{ 4064{
4067#ifdef CONFIG_PCI_MSI 4065#ifdef CONFIG_PCI_MSI
4068 int err; 4066 int err;
@@ -4108,7 +4106,7 @@ default_int_mode:
4108 return; 4106 return;
4109} 4107}
4110 4108
4111static int __devinit cciss_lookup_board_id(struct pci_dev *pdev, u32 *board_id) 4109static int cciss_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
4112{ 4110{
4113 int i; 4111 int i;
4114 u32 subsystem_vendor_id, subsystem_device_id; 4112 u32 subsystem_vendor_id, subsystem_device_id;
@@ -4134,8 +4132,8 @@ static inline bool cciss_board_disabled(ctlr_info_t *h)
4134 return ((command & PCI_COMMAND_MEMORY) == 0); 4132 return ((command & PCI_COMMAND_MEMORY) == 0);
4135} 4133}
4136 4134
4137static int __devinit cciss_pci_find_memory_BAR(struct pci_dev *pdev, 4135static int cciss_pci_find_memory_BAR(struct pci_dev *pdev,
4138 unsigned long *memory_bar) 4136 unsigned long *memory_bar)
4139{ 4137{
4140 int i; 4138 int i;
4141 4139
@@ -4151,8 +4149,8 @@ static int __devinit cciss_pci_find_memory_BAR(struct pci_dev *pdev,
4151 return -ENODEV; 4149 return -ENODEV;
4152} 4150}
4153 4151
4154static int __devinit cciss_wait_for_board_state(struct pci_dev *pdev, 4152static int cciss_wait_for_board_state(struct pci_dev *pdev,
4155 void __iomem *vaddr, int wait_for_ready) 4153 void __iomem *vaddr, int wait_for_ready)
4156#define BOARD_READY 1 4154#define BOARD_READY 1
4157#define BOARD_NOT_READY 0 4155#define BOARD_NOT_READY 0
4158{ 4156{
@@ -4179,9 +4177,9 @@ static int __devinit cciss_wait_for_board_state(struct pci_dev *pdev,
4179 return -ENODEV; 4177 return -ENODEV;
4180} 4178}
4181 4179
4182static int __devinit cciss_find_cfg_addrs(struct pci_dev *pdev, 4180static int cciss_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
4183 void __iomem *vaddr, u32 *cfg_base_addr, u64 *cfg_base_addr_index, 4181 u32 *cfg_base_addr, u64 *cfg_base_addr_index,
4184 u64 *cfg_offset) 4182 u64 *cfg_offset)
4185{ 4183{
4186 *cfg_base_addr = readl(vaddr + SA5_CTCFG_OFFSET); 4184 *cfg_base_addr = readl(vaddr + SA5_CTCFG_OFFSET);
4187 *cfg_offset = readl(vaddr + SA5_CTMEM_OFFSET); 4185 *cfg_offset = readl(vaddr + SA5_CTMEM_OFFSET);
@@ -4195,7 +4193,7 @@ static int __devinit cciss_find_cfg_addrs(struct pci_dev *pdev,
4195 return 0; 4193 return 0;
4196} 4194}
4197 4195
4198static int __devinit cciss_find_cfgtables(ctlr_info_t *h) 4196static int cciss_find_cfgtables(ctlr_info_t *h)
4199{ 4197{
4200 u64 cfg_offset; 4198 u64 cfg_offset;
4201 u32 cfg_base_addr; 4199 u32 cfg_base_addr;
@@ -4224,7 +4222,7 @@ static int __devinit cciss_find_cfgtables(ctlr_info_t *h)
4224 return 0; 4222 return 0;
4225} 4223}
4226 4224
4227static void __devinit cciss_get_max_perf_mode_cmds(struct ctlr_info *h) 4225static void cciss_get_max_perf_mode_cmds(struct ctlr_info *h)
4228{ 4226{
4229 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands)); 4227 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands));
4230 4228
@@ -4245,7 +4243,7 @@ static void __devinit cciss_get_max_perf_mode_cmds(struct ctlr_info *h)
4245 * max commands, max SG elements without chaining, and with chaining, 4243 * max commands, max SG elements without chaining, and with chaining,
4246 * SG chain block size, etc. 4244 * SG chain block size, etc.
4247 */ 4245 */
4248static void __devinit cciss_find_board_params(ctlr_info_t *h) 4246static void cciss_find_board_params(ctlr_info_t *h)
4249{ 4247{
4250 cciss_get_max_perf_mode_cmds(h); 4248 cciss_get_max_perf_mode_cmds(h);
4251 h->nr_cmds = h->max_commands - 4 - cciss_tape_cmds; 4249 h->nr_cmds = h->max_commands - 4 - cciss_tape_cmds;
@@ -4304,7 +4302,7 @@ static inline void cciss_p600_dma_prefetch_quirk(ctlr_info_t *h)
4304 pci_write_config_dword(h->pdev, PCI_COMMAND_PARITY, dma_refetch); 4302 pci_write_config_dword(h->pdev, PCI_COMMAND_PARITY, dma_refetch);
4305} 4303}
4306 4304
4307static int __devinit cciss_pci_init(ctlr_info_t *h) 4305static int cciss_pci_init(ctlr_info_t *h)
4308{ 4306{
4309 int prod_index, err; 4307 int prod_index, err;
4310 4308
@@ -4424,7 +4422,8 @@ static void free_hba(ctlr_info_t *h)
4424} 4422}
4425 4423
4426/* Send a message CDB to the firmware. */ 4424/* Send a message CDB to the firmware. */
4427static __devinit int cciss_message(struct pci_dev *pdev, unsigned char opcode, unsigned char type) 4425static int cciss_message(struct pci_dev *pdev, unsigned char opcode,
4426 unsigned char type)
4428{ 4427{
4429 typedef struct { 4428 typedef struct {
4430 CommandListHeader_struct CommandHeader; 4429 CommandListHeader_struct CommandHeader;
@@ -4571,14 +4570,13 @@ static int cciss_controller_hard_reset(struct pci_dev *pdev,
4571 return 0; 4570 return 0;
4572} 4571}
4573 4572
4574static __devinit void init_driver_version(char *driver_version, int len) 4573static void init_driver_version(char *driver_version, int len)
4575{ 4574{
4576 memset(driver_version, 0, len); 4575 memset(driver_version, 0, len);
4577 strncpy(driver_version, "cciss " DRIVER_NAME, len - 1); 4576 strncpy(driver_version, "cciss " DRIVER_NAME, len - 1);
4578} 4577}
4579 4578
4580static __devinit int write_driver_ver_to_cfgtable( 4579static int write_driver_ver_to_cfgtable(CfgTable_struct __iomem *cfgtable)
4581 CfgTable_struct __iomem *cfgtable)
4582{ 4580{
4583 char *driver_version; 4581 char *driver_version;
4584 int i, size = sizeof(cfgtable->driver_version); 4582 int i, size = sizeof(cfgtable->driver_version);
@@ -4594,8 +4592,8 @@ static __devinit int write_driver_ver_to_cfgtable(
4594 return 0; 4592 return 0;
4595} 4593}
4596 4594
4597static __devinit void read_driver_ver_from_cfgtable( 4595static void read_driver_ver_from_cfgtable(CfgTable_struct __iomem *cfgtable,
4598 CfgTable_struct __iomem *cfgtable, unsigned char *driver_ver) 4596 unsigned char *driver_ver)
4599{ 4597{
4600 int i; 4598 int i;
4601 4599
@@ -4603,8 +4601,7 @@ static __devinit void read_driver_ver_from_cfgtable(
4603 driver_ver[i] = readb(&cfgtable->driver_version[i]); 4601 driver_ver[i] = readb(&cfgtable->driver_version[i]);
4604} 4602}
4605 4603
4606static __devinit int controller_reset_failed( 4604static int controller_reset_failed(CfgTable_struct __iomem *cfgtable)
4607 CfgTable_struct __iomem *cfgtable)
4608{ 4605{
4609 4606
4610 char *driver_ver, *old_driver_ver; 4607 char *driver_ver, *old_driver_ver;
@@ -4627,7 +4624,7 @@ static __devinit int controller_reset_failed(
4627 4624
4628/* This does a hard reset of the controller using PCI power management 4625/* This does a hard reset of the controller using PCI power management
4629 * states or using the doorbell register. */ 4626 * states or using the doorbell register. */
4630static __devinit int cciss_kdump_hard_reset_controller(struct pci_dev *pdev) 4627static int cciss_kdump_hard_reset_controller(struct pci_dev *pdev)
4631{ 4628{
4632 u64 cfg_offset; 4629 u64 cfg_offset;
4633 u32 cfg_base_addr; 4630 u32 cfg_base_addr;
@@ -4772,7 +4769,7 @@ unmap_vaddr:
4772 return rc; 4769 return rc;
4773} 4770}
4774 4771
4775static __devinit int cciss_init_reset_devices(struct pci_dev *pdev) 4772static int cciss_init_reset_devices(struct pci_dev *pdev)
4776{ 4773{
4777 int rc, i; 4774 int rc, i;
4778 4775
@@ -4806,7 +4803,7 @@ static __devinit int cciss_init_reset_devices(struct pci_dev *pdev)
4806 return 0; 4803 return 0;
4807} 4804}
4808 4805
4809static __devinit int cciss_allocate_cmd_pool(ctlr_info_t *h) 4806static int cciss_allocate_cmd_pool(ctlr_info_t *h)
4810{ 4807{
4811 h->cmd_pool_bits = kmalloc(BITS_TO_LONGS(h->nr_cmds) * 4808 h->cmd_pool_bits = kmalloc(BITS_TO_LONGS(h->nr_cmds) *
4812 sizeof(unsigned long), GFP_KERNEL); 4809 sizeof(unsigned long), GFP_KERNEL);
@@ -4825,7 +4822,7 @@ static __devinit int cciss_allocate_cmd_pool(ctlr_info_t *h)
4825 return 0; 4822 return 0;
4826} 4823}
4827 4824
4828static __devinit int cciss_allocate_scatterlists(ctlr_info_t *h) 4825static int cciss_allocate_scatterlists(ctlr_info_t *h)
4829{ 4826{
4830 int i; 4827 int i;
4831 4828
@@ -4893,7 +4890,7 @@ static int cciss_request_irq(ctlr_info_t *h,
4893 return -1; 4890 return -1;
4894} 4891}
4895 4892
4896static int __devinit cciss_kdump_soft_reset(ctlr_info_t *h) 4893static int cciss_kdump_soft_reset(ctlr_info_t *h)
4897{ 4894{
4898 if (cciss_send_reset(h, CTLR_LUNID, CCISS_RESET_TYPE_CONTROLLER)) { 4895 if (cciss_send_reset(h, CTLR_LUNID, CCISS_RESET_TYPE_CONTROLLER)) {
4899 dev_warn(&h->pdev->dev, "Resetting array controller failed.\n"); 4896 dev_warn(&h->pdev->dev, "Resetting array controller failed.\n");
@@ -4952,8 +4949,7 @@ static void cciss_undo_allocations_after_kdump_soft_reset(ctlr_info_t *h)
4952 * stealing all these major device numbers. 4949 * stealing all these major device numbers.
4953 * returns the number of block devices registered. 4950 * returns the number of block devices registered.
4954 */ 4951 */
4955static int __devinit cciss_init_one(struct pci_dev *pdev, 4952static int cciss_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
4956 const struct pci_device_id *ent)
4957{ 4953{
4958 int i; 4954 int i;
4959 int j = 0; 4955 int j = 0;
@@ -5207,7 +5203,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
5207 free_irq(h->intr[h->intr_mode], h); 5203 free_irq(h->intr[h->intr_mode], h);
5208} 5204}
5209 5205
5210static int __devinit cciss_enter_simple_mode(struct ctlr_info *h) 5206static int cciss_enter_simple_mode(struct ctlr_info *h)
5211{ 5207{
5212 u32 trans_support; 5208 u32 trans_support;
5213 5209
@@ -5229,7 +5225,7 @@ static int __devinit cciss_enter_simple_mode(struct ctlr_info *h)
5229} 5225}
5230 5226
5231 5227
5232static void __devexit cciss_remove_one(struct pci_dev *pdev) 5228static void cciss_remove_one(struct pci_dev *pdev)
5233{ 5229{
5234 ctlr_info_t *h; 5230 ctlr_info_t *h;
5235 int i, j; 5231 int i, j;
@@ -5308,7 +5304,7 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
5308static struct pci_driver cciss_pci_driver = { 5304static struct pci_driver cciss_pci_driver = {
5309 .name = "cciss", 5305 .name = "cciss",
5310 .probe = cciss_init_one, 5306 .probe = cciss_init_one,
5311 .remove = __devexit_p(cciss_remove_one), 5307 .remove = cciss_remove_one,
5312 .id_table = cciss_pci_device_id, /* id_table */ 5308 .id_table = cciss_pci_device_id, /* id_table */
5313 .shutdown = cciss_shutdown, 5309 .shutdown = cciss_shutdown,
5314}; 5310};
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 9125bbeacd4..3f087133a25 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -320,7 +320,7 @@ static void release_io_mem(ctlr_info_t *c)
320 c->io_mem_length = 0; 320 c->io_mem_length = 0;
321} 321}
322 322
323static void __devexit cpqarray_remove_one(int i) 323static void cpqarray_remove_one(int i)
324{ 324{
325 int j; 325 int j;
326 char buff[4]; 326 char buff[4];
@@ -352,7 +352,7 @@ static void __devexit cpqarray_remove_one(int i)
352 free_hba(i); 352 free_hba(i);
353} 353}
354 354
355static void __devexit cpqarray_remove_one_pci (struct pci_dev *pdev) 355static void cpqarray_remove_one_pci(struct pci_dev *pdev)
356{ 356{
357 int i; 357 int i;
358 ctlr_info_t *tmp_ptr; 358 ctlr_info_t *tmp_ptr;
@@ -377,7 +377,7 @@ static void __devexit cpqarray_remove_one_pci (struct pci_dev *pdev)
377/* removing an instance that was not removed automatically.. 377/* removing an instance that was not removed automatically..
378 * must be an eisa card. 378 * must be an eisa card.
379 */ 379 */
380static void __devexit cpqarray_remove_one_eisa (int i) 380static void cpqarray_remove_one_eisa(int i)
381{ 381{
382 if (hba[i] == NULL) { 382 if (hba[i] == NULL) {
383 printk(KERN_ERR "cpqarray: controller %d appears to have" 383 printk(KERN_ERR "cpqarray: controller %d appears to have"
@@ -388,7 +388,7 @@ static void __devexit cpqarray_remove_one_eisa (int i)
388} 388}
389 389
390/* pdev is NULL for eisa */ 390/* pdev is NULL for eisa */
391static int __devinit cpqarray_register_ctlr( int i, struct pci_dev *pdev) 391static int cpqarray_register_ctlr(int i, struct pci_dev *pdev)
392{ 392{
393 struct request_queue *q; 393 struct request_queue *q;
394 int j; 394 int j;
@@ -505,8 +505,8 @@ Enomem4:
505 return -1; 505 return -1;
506} 506}
507 507
508static int __devinit cpqarray_init_one( struct pci_dev *pdev, 508static int cpqarray_init_one(struct pci_dev *pdev,
509 const struct pci_device_id *ent) 509 const struct pci_device_id *ent)
510{ 510{
511 int i; 511 int i;
512 512
@@ -536,7 +536,7 @@ static int __devinit cpqarray_init_one( struct pci_dev *pdev,
536static struct pci_driver cpqarray_pci_driver = { 536static struct pci_driver cpqarray_pci_driver = {
537 .name = "cpqarray", 537 .name = "cpqarray",
538 .probe = cpqarray_init_one, 538 .probe = cpqarray_init_one,
539 .remove = __devexit_p(cpqarray_remove_one_pci), 539 .remove = cpqarray_remove_one_pci,
540 .id_table = cpqarray_pci_device_id, 540 .id_table = cpqarray_pci_device_id,
541}; 541};
542 542
@@ -742,7 +742,7 @@ __setup("smart2=", cpqarray_setup);
742/* 742/*
743 * Find an EISA controller's signature. Set up an hba if we find it. 743 * Find an EISA controller's signature. Set up an hba if we find it.
744 */ 744 */
745static int __devinit cpqarray_eisa_detect(void) 745static int cpqarray_eisa_detect(void)
746{ 746{
747 int i=0, j; 747 int i=0, j;
748 __u32 board_id; 748 __u32 board_id;
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 931769e133e..07fb2dfaae1 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -975,8 +975,8 @@ static int queue_request_irq(struct nvme_dev *dev, struct nvme_queue *nvmeq,
975 IRQF_DISABLED | IRQF_SHARED, name, nvmeq); 975 IRQF_DISABLED | IRQF_SHARED, name, nvmeq);
976} 976}
977 977
978static __devinit struct nvme_queue *nvme_create_queue(struct nvme_dev *dev, 978static struct nvme_queue *nvme_create_queue(struct nvme_dev *dev, int qid,
979 int qid, int cq_size, int vector) 979 int cq_size, int vector)
980{ 980{
981 int result; 981 int result;
982 struct nvme_queue *nvmeq = nvme_alloc_queue(dev, qid, cq_size, vector); 982 struct nvme_queue *nvmeq = nvme_alloc_queue(dev, qid, cq_size, vector);
@@ -1011,7 +1011,7 @@ static __devinit struct nvme_queue *nvme_create_queue(struct nvme_dev *dev,
1011 return ERR_PTR(result); 1011 return ERR_PTR(result);
1012} 1012}
1013 1013
1014static int __devinit nvme_configure_admin_queue(struct nvme_dev *dev) 1014static int nvme_configure_admin_queue(struct nvme_dev *dev)
1015{ 1015{
1016 int result = 0; 1016 int result = 0;
1017 u32 aqa; 1017 u32 aqa;
@@ -1408,7 +1408,7 @@ static int set_queue_count(struct nvme_dev *dev, int count)
1408 return min(result & 0xffff, result >> 16) + 1; 1408 return min(result & 0xffff, result >> 16) + 1;
1409} 1409}
1410 1410
1411static int __devinit nvme_setup_io_queues(struct nvme_dev *dev) 1411static int nvme_setup_io_queues(struct nvme_dev *dev)
1412{ 1412{
1413 int result, cpu, i, nr_io_queues, db_bar_size, q_depth; 1413 int result, cpu, i, nr_io_queues, db_bar_size, q_depth;
1414 1414
@@ -1481,7 +1481,7 @@ static void nvme_free_queues(struct nvme_dev *dev)
1481 nvme_free_queue(dev, i); 1481 nvme_free_queue(dev, i);
1482} 1482}
1483 1483
1484static int __devinit nvme_dev_add(struct nvme_dev *dev) 1484static int nvme_dev_add(struct nvme_dev *dev)
1485{ 1485{
1486 int res, nn, i; 1486 int res, nn, i;
1487 struct nvme_ns *ns, *next; 1487 struct nvme_ns *ns, *next;
@@ -1619,8 +1619,7 @@ static void nvme_release_instance(struct nvme_dev *dev)
1619 spin_unlock(&dev_list_lock); 1619 spin_unlock(&dev_list_lock);
1620} 1620}
1621 1621
1622static int __devinit nvme_probe(struct pci_dev *pdev, 1622static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1623 const struct pci_device_id *id)
1624{ 1623{
1625 int bars, result = -ENOMEM; 1624 int bars, result = -ENOMEM;
1626 struct nvme_dev *dev; 1625 struct nvme_dev *dev;
@@ -1702,7 +1701,7 @@ static int __devinit nvme_probe(struct pci_dev *pdev,
1702 return result; 1701 return result;
1703} 1702}
1704 1703
1705static void __devexit nvme_remove(struct pci_dev *pdev) 1704static void nvme_remove(struct pci_dev *pdev)
1706{ 1705{
1707 struct nvme_dev *dev = pci_get_drvdata(pdev); 1706 struct nvme_dev *dev = pci_get_drvdata(pdev);
1708 nvme_dev_remove(dev); 1707 nvme_dev_remove(dev);
@@ -1747,7 +1746,7 @@ static struct pci_driver nvme_driver = {
1747 .name = "nvme", 1746 .name = "nvme",
1748 .id_table = nvme_id_table, 1747 .id_table = nvme_id_table,
1749 .probe = nvme_probe, 1748 .probe = nvme_probe,
1750 .remove = __devexit_p(nvme_remove), 1749 .remove = nvme_remove,
1751 .suspend = nvme_suspend, 1750 .suspend = nvme_suspend,
1752 .resume = nvme_resume, 1751 .resume = nvme_resume,
1753 .err_handler = &nvme_err_handler, 1752 .err_handler = &nvme_err_handler,
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index da0abc1838c..d754a88d758 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -401,7 +401,7 @@ static unsigned long ps3disk_mask;
401 401
402static DEFINE_MUTEX(ps3disk_mask_mutex); 402static DEFINE_MUTEX(ps3disk_mask_mutex);
403 403
404static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) 404static int ps3disk_probe(struct ps3_system_bus_device *_dev)
405{ 405{
406 struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core); 406 struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
407 struct ps3disk_private *priv; 407 struct ps3disk_private *priv;
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index f58cdcfb305..75e112d6600 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -536,7 +536,7 @@ static const struct file_operations ps3vram_proc_fops = {
536 .release = single_release, 536 .release = single_release,
537}; 537};
538 538
539static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev) 539static void ps3vram_proc_init(struct ps3_system_bus_device *dev)
540{ 540{
541 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); 541 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
542 struct proc_dir_entry *pde; 542 struct proc_dir_entry *pde;
@@ -618,7 +618,7 @@ static void ps3vram_make_request(struct request_queue *q, struct bio *bio)
618 } while (bio); 618 } while (bio);
619} 619}
620 620
621static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) 621static int ps3vram_probe(struct ps3_system_bus_device *dev)
622{ 622{
623 struct ps3vram_priv *priv; 623 struct ps3vram_priv *priv;
624 int error, status; 624 int error, status;
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 9dcf76a10bb..564156a8e57 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -25,7 +25,7 @@
25#define DRV_MODULE_VERSION "1.0" 25#define DRV_MODULE_VERSION "1.0"
26#define DRV_MODULE_RELDATE "June 25, 2007" 26#define DRV_MODULE_RELDATE "June 25, 2007"
27 27
28static char version[] __devinitdata = 28static char version[] =
29 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 29 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
30MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); 30MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");
31MODULE_DESCRIPTION("Sun LDOM virtual disk client driver"); 31MODULE_DESCRIPTION("Sun LDOM virtual disk client driver");
@@ -592,7 +592,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
592 return err; 592 return err;
593} 593}
594 594
595static int __devinit vdc_alloc_tx_ring(struct vdc_port *port) 595static int vdc_alloc_tx_ring(struct vdc_port *port)
596{ 596{
597 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING]; 597 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
598 unsigned long len, entry_size; 598 unsigned long len, entry_size;
@@ -725,7 +725,7 @@ static struct vio_driver_ops vdc_vio_ops = {
725 .handshake_complete = vdc_handshake_complete, 725 .handshake_complete = vdc_handshake_complete,
726}; 726};
727 727
728static void __devinit print_version(void) 728static void print_version(void)
729{ 729{
730 static int version_printed; 730 static int version_printed;
731 731
@@ -733,8 +733,7 @@ static void __devinit print_version(void)
733 printk(KERN_INFO "%s", version); 733 printk(KERN_INFO "%s", version);
734} 734}
735 735
736static int __devinit vdc_port_probe(struct vio_dev *vdev, 736static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
737 const struct vio_device_id *id)
738{ 737{
739 struct mdesc_handle *hp; 738 struct mdesc_handle *hp;
740 struct vdc_port *port; 739 struct vdc_port *port;
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 6d5a914b961..765fa2b3d33 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -788,8 +788,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
788 return get_disk(swd->unit[drive].disk); 788 return get_disk(swd->unit[drive].disk);
789} 789}
790 790
791static int __devinit swim_add_floppy(struct swim_priv *swd, 791static int swim_add_floppy(struct swim_priv *swd, enum drive_location location)
792 enum drive_location location)
793{ 792{
794 struct floppy_state *fs = &swd->unit[swd->floppy_count]; 793 struct floppy_state *fs = &swd->unit[swd->floppy_count];
795 struct swim __iomem *base = swd->base; 794 struct swim __iomem *base = swd->base;
@@ -812,7 +811,7 @@ static int __devinit swim_add_floppy(struct swim_priv *swd,
812 return 0; 811 return 0;
813} 812}
814 813
815static int __devinit swim_floppy_init(struct swim_priv *swd) 814static int swim_floppy_init(struct swim_priv *swd)
816{ 815{
817 int err; 816 int err;
818 int drive; 817 int drive;
@@ -875,7 +874,7 @@ exit_put_disks:
875 return err; 874 return err;
876} 875}
877 876
878static int __devinit swim_probe(struct platform_device *dev) 877static int swim_probe(struct platform_device *dev)
879{ 878{
880 struct resource *res; 879 struct resource *res;
881 struct swim __iomem *swim_base; 880 struct swim __iomem *swim_base;
@@ -936,7 +935,7 @@ out:
936 return ret; 935 return ret;
937} 936}
938 937
939static int __devexit swim_remove(struct platform_device *dev) 938static int swim_remove(struct platform_device *dev)
940{ 939{
941 struct swim_priv *swd = platform_get_drvdata(dev); 940 struct swim_priv *swd = platform_get_drvdata(dev);
942 int drive; 941 int drive;
@@ -972,7 +971,7 @@ static int __devexit swim_remove(struct platform_device *dev)
972 971
973static struct platform_driver swim_driver = { 972static struct platform_driver swim_driver = {
974 .probe = swim_probe, 973 .probe = swim_probe,
975 .remove = __devexit_p(swim_remove), 974 .remove = swim_remove,
976 .driver = { 975 .driver = {
977 .name = CARDNAME, 976 .name = CARDNAME,
978 .owner = THIS_MODULE, 977 .owner = THIS_MODULE,
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 89ddab127e3..57763c54363 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1194,7 +1194,8 @@ static int swim3_add_device(struct macio_dev *mdev, int index)
1194 return rc; 1194 return rc;
1195} 1195}
1196 1196
1197static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device_id *match) 1197static int swim3_attach(struct macio_dev *mdev,
1198 const struct of_device_id *match)
1198{ 1199{
1199 struct gendisk *disk; 1200 struct gendisk *disk;
1200 int index, rc; 1201 int index, rc;
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index eb0d8216f55..ad70868f8a9 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -789,8 +789,7 @@ static const struct block_device_operations mm_fops = {
789 .revalidate_disk = mm_revalidate, 789 .revalidate_disk = mm_revalidate,
790}; 790};
791 791
792static int __devinit mm_pci_probe(struct pci_dev *dev, 792static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
793 const struct pci_device_id *id)
794{ 793{
795 int ret = -ENODEV; 794 int ret = -ENODEV;
796 struct cardinfo *card = &cards[num_cards]; 795 struct cardinfo *card = &cards[num_cards];
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 0bdde8fba39..9d8409c0208 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -696,7 +696,7 @@ static const struct device_attribute dev_attr_cache_type_rw =
696 __ATTR(cache_type, S_IRUGO|S_IWUSR, 696 __ATTR(cache_type, S_IRUGO|S_IWUSR,
697 virtblk_cache_type_show, virtblk_cache_type_store); 697 virtblk_cache_type_show, virtblk_cache_type_store);
698 698
699static int __devinit virtblk_probe(struct virtio_device *vdev) 699static int virtblk_probe(struct virtio_device *vdev)
700{ 700{
701 struct virtio_blk *vblk; 701 struct virtio_blk *vblk;
702 struct request_queue *q; 702 struct request_queue *q;
@@ -885,7 +885,7 @@ out:
885 return err; 885 return err;
886} 886}
887 887
888static void __devexit virtblk_remove(struct virtio_device *vdev) 888static void virtblk_remove(struct virtio_device *vdev)
889{ 889{
890 struct virtio_blk *vblk = vdev->priv; 890 struct virtio_blk *vblk = vdev->priv;
891 int index = vblk->index; 891 int index = vblk->index;
@@ -961,19 +961,14 @@ static unsigned int features[] = {
961 VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE 961 VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE
962}; 962};
963 963
964/* 964static struct virtio_driver virtio_blk = {
965 * virtio_blk causes spurious section mismatch warning by
966 * simultaneously referring to a __devinit and a __devexit function.
967 * Use __refdata to avoid this warning.
968 */
969static struct virtio_driver __refdata virtio_blk = {
970 .feature_table = features, 965 .feature_table = features,
971 .feature_table_size = ARRAY_SIZE(features), 966 .feature_table_size = ARRAY_SIZE(features),
972 .driver.name = KBUILD_MODNAME, 967 .driver.name = KBUILD_MODNAME,
973 .driver.owner = THIS_MODULE, 968 .driver.owner = THIS_MODULE,
974 .id_table = id_table, 969 .id_table = id_table,
975 .probe = virtblk_probe, 970 .probe = virtblk_probe,
976 .remove = __devexit_p(virtblk_remove), 971 .remove = virtblk_remove,
977 .config_changed = virtblk_config_changed, 972 .config_changed = virtblk_config_changed,
978#ifdef CONFIG_PM 973#ifdef CONFIG_PM
979 .freeze = virtblk_freeze, 974 .freeze = virtblk_freeze,
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 1a17e338735..1f38643173c 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -961,7 +961,7 @@ static const struct block_device_operations ace_fops = {
961/* -------------------------------------------------------------------- 961/* --------------------------------------------------------------------
962 * SystemACE device setup/teardown code 962 * SystemACE device setup/teardown code
963 */ 963 */
964static int __devinit ace_setup(struct ace_device *ace) 964static int ace_setup(struct ace_device *ace)
965{ 965{
966 u16 version; 966 u16 version;
967 u16 val; 967 u16 val;
@@ -1074,7 +1074,7 @@ err_ioremap:
1074 return -ENOMEM; 1074 return -ENOMEM;
1075} 1075}
1076 1076
1077static void __devexit ace_teardown(struct ace_device *ace) 1077static void ace_teardown(struct ace_device *ace)
1078{ 1078{
1079 if (ace->gd) { 1079 if (ace->gd) {
1080 del_gendisk(ace->gd); 1080 del_gendisk(ace->gd);
@@ -1092,9 +1092,8 @@ static void __devexit ace_teardown(struct ace_device *ace)
1092 iounmap(ace->baseaddr); 1092 iounmap(ace->baseaddr);
1093} 1093}
1094 1094
1095static int __devinit 1095static int ace_alloc(struct device *dev, int id, resource_size_t physaddr,
1096ace_alloc(struct device *dev, int id, resource_size_t physaddr, 1096 int irq, int bus_width)
1097 int irq, int bus_width)
1098{ 1097{
1099 struct ace_device *ace; 1098 struct ace_device *ace;
1100 int rc; 1099 int rc;
@@ -1135,7 +1134,7 @@ err_noreg:
1135 return rc; 1134 return rc;
1136} 1135}
1137 1136
1138static void __devexit ace_free(struct device *dev) 1137static void ace_free(struct device *dev)
1139{ 1138{
1140 struct ace_device *ace = dev_get_drvdata(dev); 1139 struct ace_device *ace = dev_get_drvdata(dev);
1141 dev_dbg(dev, "ace_free(%p)\n", dev); 1140 dev_dbg(dev, "ace_free(%p)\n", dev);
@@ -1151,7 +1150,7 @@ static void __devexit ace_free(struct device *dev)
1151 * Platform Bus Support 1150 * Platform Bus Support
1152 */ 1151 */
1153 1152
1154static int __devinit ace_probe(struct platform_device *dev) 1153static int ace_probe(struct platform_device *dev)
1155{ 1154{
1156 resource_size_t physaddr = 0; 1155 resource_size_t physaddr = 0;
1157 int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */ 1156 int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
@@ -1182,7 +1181,7 @@ static int __devinit ace_probe(struct platform_device *dev)
1182/* 1181/*
1183 * Platform bus remove() method 1182 * Platform bus remove() method
1184 */ 1183 */
1185static int __devexit ace_remove(struct platform_device *dev) 1184static int ace_remove(struct platform_device *dev)
1186{ 1185{
1187 ace_free(&dev->dev); 1186 ace_free(&dev->dev);
1188 return 0; 1187 return 0;
@@ -1190,7 +1189,7 @@ static int __devexit ace_remove(struct platform_device *dev)
1190 1189
1191#if defined(CONFIG_OF) 1190#if defined(CONFIG_OF)
1192/* Match table for of_platform binding */ 1191/* Match table for of_platform binding */
1193static const struct of_device_id ace_of_match[] __devinitconst = { 1192static const struct of_device_id ace_of_match[] = {
1194 { .compatible = "xlnx,opb-sysace-1.00.b", }, 1193 { .compatible = "xlnx,opb-sysace-1.00.b", },
1195 { .compatible = "xlnx,opb-sysace-1.00.c", }, 1194 { .compatible = "xlnx,opb-sysace-1.00.c", },
1196 { .compatible = "xlnx,xps-sysace-1.00.a", }, 1195 { .compatible = "xlnx,xps-sysace-1.00.a", },
@@ -1204,7 +1203,7 @@ MODULE_DEVICE_TABLE(of, ace_of_match);
1204 1203
1205static struct platform_driver ace_platform_driver = { 1204static struct platform_driver ace_platform_driver = {
1206 .probe = ace_probe, 1205 .probe = ace_probe,
1207 .remove = __devexit_p(ace_remove), 1206 .remove = ace_remove,
1208 .driver = { 1207 .driver = {
1209 .owner = THIS_MODULE, 1208 .owner = THIS_MODULE,
1210 .name = "xsysace", 1209 .name = "xsysace",
diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index 0c48b0e05ed..fe7191663bb 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -52,7 +52,7 @@ static int ocp2scp_remove_devices(struct device *dev, void *c)
52 return 0; 52 return 0;
53} 53}
54 54
55static int __devinit omap_ocp2scp_probe(struct platform_device *pdev) 55static int omap_ocp2scp_probe(struct platform_device *pdev)
56{ 56{
57 int ret; 57 int ret;
58 unsigned res_cnt, i; 58 unsigned res_cnt, i;
@@ -116,7 +116,7 @@ err0:
116 return ret; 116 return ret;
117} 117}
118 118
119static int __devexit omap_ocp2scp_remove(struct platform_device *pdev) 119static int omap_ocp2scp_remove(struct platform_device *pdev)
120{ 120{
121 pm_runtime_disable(&pdev->dev); 121 pm_runtime_disable(&pdev->dev);
122 device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices); 122 device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
@@ -134,7 +134,7 @@ MODULE_DEVICE_TABLE(of, omap_ocp2scp_id_table);
134 134
135static struct platform_driver omap_ocp2scp_driver = { 135static struct platform_driver omap_ocp2scp_driver = {
136 .probe = omap_ocp2scp_probe, 136 .probe = omap_ocp2scp_probe,
137 .remove = __devexit_p(omap_ocp2scp_remove), 137 .remove = omap_ocp2scp_remove,
138 .driver = { 138 .driver = {
139 .name = "omap-ocp2scp", 139 .name = "omap-ocp2scp",
140 .owner = THIS_MODULE, 140 .owner = THIS_MODULE,
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index ab911a33f8a..feeecae623f 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -128,7 +128,7 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
128 return IRQ_HANDLED; 128 return IRQ_HANDLED;
129} 129}
130 130
131static int __devinit omap4_l3_probe(struct platform_device *pdev) 131static int omap4_l3_probe(struct platform_device *pdev)
132{ 132{
133 static struct omap4_l3 *l3; 133 static struct omap4_l3 *l3;
134 struct resource *res; 134 struct resource *res;
@@ -219,7 +219,7 @@ err0:
219 return ret; 219 return ret;
220} 220}
221 221
222static int __devexit omap4_l3_remove(struct platform_device *pdev) 222static int omap4_l3_remove(struct platform_device *pdev)
223{ 223{
224 struct omap4_l3 *l3 = platform_get_drvdata(pdev); 224 struct omap4_l3 *l3 = platform_get_drvdata(pdev);
225 225
@@ -245,7 +245,7 @@ MODULE_DEVICE_TABLE(of, l3_noc_match);
245 245
246static struct platform_driver omap4_l3_driver = { 246static struct platform_driver omap4_l3_driver = {
247 .probe = omap4_l3_probe, 247 .probe = omap4_l3_probe,
248 .remove = __devexit_p(omap4_l3_remove), 248 .remove = omap4_l3_remove,
249 .driver = { 249 .driver = {
250 .name = "omap_l3_noc", 250 .name = "omap_l3_noc",
251 .owner = THIS_MODULE, 251 .owner = THIS_MODULE,
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 75d485afe56..d59cdcb8fe3 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -557,7 +557,7 @@ static irqreturn_t gdrom_dma_interrupt(int irq, void *dev_id)
557 return IRQ_HANDLED; 557 return IRQ_HANDLED;
558} 558}
559 559
560static int __devinit gdrom_set_interrupt_handlers(void) 560static int gdrom_set_interrupt_handlers(void)
561{ 561{
562 int err; 562 int err;
563 563
@@ -681,7 +681,7 @@ static void gdrom_request(struct request_queue *rq)
681} 681}
682 682
683/* Print string identifying GD ROM device */ 683/* Print string identifying GD ROM device */
684static int __devinit gdrom_outputversion(void) 684static int gdrom_outputversion(void)
685{ 685{
686 struct gdrom_id *id; 686 struct gdrom_id *id;
687 char *model_name, *manuf_name, *firmw_ver; 687 char *model_name, *manuf_name, *firmw_ver;
@@ -715,7 +715,7 @@ free_id:
715} 715}
716 716
717/* set the default mode for DMA transfer */ 717/* set the default mode for DMA transfer */
718static int __devinit gdrom_init_dma_mode(void) 718static int gdrom_init_dma_mode(void)
719{ 719{
720 __raw_writeb(0x13, GDROM_ERROR_REG); 720 __raw_writeb(0x13, GDROM_ERROR_REG);
721 __raw_writeb(0x22, GDROM_INTSEC_REG); 721 __raw_writeb(0x22, GDROM_INTSEC_REG);
@@ -736,7 +736,7 @@ static int __devinit gdrom_init_dma_mode(void)
736 return 0; 736 return 0;
737} 737}
738 738
739static void __devinit probe_gdrom_setupcd(void) 739static void probe_gdrom_setupcd(void)
740{ 740{
741 gd.cd_info->ops = &gdrom_ops; 741 gd.cd_info->ops = &gdrom_ops;
742 gd.cd_info->capacity = 1; 742 gd.cd_info->capacity = 1;
@@ -745,7 +745,7 @@ static void __devinit probe_gdrom_setupcd(void)
745 CDC_SELECT_DISC; 745 CDC_SELECT_DISC;
746} 746}
747 747
748static void __devinit probe_gdrom_setupdisk(void) 748static void probe_gdrom_setupdisk(void)
749{ 749{
750 gd.disk->major = gdrom_major; 750 gd.disk->major = gdrom_major;
751 gd.disk->first_minor = 1; 751 gd.disk->first_minor = 1;
@@ -753,7 +753,7 @@ static void __devinit probe_gdrom_setupdisk(void)
753 strcpy(gd.disk->disk_name, GDROM_DEV_NAME); 753 strcpy(gd.disk->disk_name, GDROM_DEV_NAME);
754} 754}
755 755
756static int __devinit probe_gdrom_setupqueue(void) 756static int probe_gdrom_setupqueue(void)
757{ 757{
758 blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR); 758 blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR);
759 /* using DMA so memory will need to be contiguous */ 759 /* using DMA so memory will need to be contiguous */
@@ -768,7 +768,7 @@ static int __devinit probe_gdrom_setupqueue(void)
768 * register this as a block device and as compliant with the 768 * register this as a block device and as compliant with the
769 * universal CD Rom driver interface 769 * universal CD Rom driver interface
770 */ 770 */
771static int __devinit probe_gdrom(struct platform_device *devptr) 771static int probe_gdrom(struct platform_device *devptr)
772{ 772{
773 int err; 773 int err;
774 /* Start the device */ 774 /* Start the device */
@@ -838,7 +838,7 @@ probe_fail_no_mem:
838 return err; 838 return err;
839} 839}
840 840
841static int __devexit remove_gdrom(struct platform_device *devptr) 841static int remove_gdrom(struct platform_device *devptr)
842{ 842{
843 flush_work(&work); 843 flush_work(&work);
844 blk_cleanup_queue(gd.gdrom_rq); 844 blk_cleanup_queue(gd.gdrom_rq);
@@ -854,7 +854,7 @@ static int __devexit remove_gdrom(struct platform_device *devptr)
854 854
855static struct platform_driver gdrom_driver = { 855static struct platform_driver gdrom_driver = {
856 .probe = probe_gdrom, 856 .probe = probe_gdrom,
857 .remove = __devexit_p(remove_gdrom), 857 .remove = remove_gdrom,
858 .driver = { 858 .driver = {
859 .name = GDROM_DEV_NAME, 859 .name = GDROM_DEV_NAME,
860 }, 860 },
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
index 478493543b3..443cd6751ca 100644
--- a/drivers/char/agp/ali-agp.c
+++ b/drivers/char/agp/ali-agp.c
@@ -299,8 +299,7 @@ static struct agp_device_ids ali_agp_device_ids[] =
299 { }, /* dummy final entry, always present */ 299 { }, /* dummy final entry, always present */
300}; 300};
301 301
302static int __devinit agp_ali_probe(struct pci_dev *pdev, 302static int agp_ali_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
303 const struct pci_device_id *ent)
304{ 303{
305 struct agp_device_ids *devs = ali_agp_device_ids; 304 struct agp_device_ids *devs = ali_agp_device_ids;
306 struct agp_bridge_data *bridge; 305 struct agp_bridge_data *bridge;
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index 1b2101160e9..779f0ab845a 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -405,8 +405,8 @@ static struct agp_device_ids amd_agp_device_ids[] =
405 { }, /* dummy final entry, always present */ 405 { }, /* dummy final entry, always present */
406}; 406};
407 407
408static int __devinit agp_amdk7_probe(struct pci_dev *pdev, 408static int agp_amdk7_probe(struct pci_dev *pdev,
409 const struct pci_device_id *ent) 409 const struct pci_device_id *ent)
410{ 410{
411 struct agp_bridge_data *bridge; 411 struct agp_bridge_data *bridge;
412 u8 cap_ptr; 412 u8 cap_ptr;
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 061d46209b1..d79d692d05b 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -240,7 +240,7 @@ static const struct agp_bridge_driver amd_8151_driver = {
240}; 240};
241 241
242/* Some basic sanity checks for the aperture. */ 242/* Some basic sanity checks for the aperture. */
243static int __devinit agp_aperture_valid(u64 aper, u32 size) 243static int agp_aperture_valid(u64 aper, u32 size)
244{ 244{
245 if (!aperture_valid(aper, size, 32*1024*1024)) 245 if (!aperture_valid(aper, size, 32*1024*1024))
246 return 0; 246 return 0;
@@ -267,8 +267,7 @@ static int __devinit agp_aperture_valid(u64 aper, u32 size)
267 * to allocate that much memory. But at least error out cleanly instead of 267 * to allocate that much memory. But at least error out cleanly instead of
268 * crashing. 268 * crashing.
269 */ 269 */
270static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, 270static int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, u16 cap)
271 u16 cap)
272{ 271{
273 u32 aper_low, aper_hi; 272 u32 aper_low, aper_hi;
274 u64 aper, nb_aper; 273 u64 aper, nb_aper;
@@ -326,7 +325,7 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
326 return 0; 325 return 0;
327} 326}
328 327
329static __devinit int cache_nbs(struct pci_dev *pdev, u32 cap_ptr) 328static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
330{ 329{
331 int i; 330 int i;
332 331
@@ -352,7 +351,7 @@ static __devinit int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
352} 351}
353 352
354/* Handle AMD 8151 quirks */ 353/* Handle AMD 8151 quirks */
355static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge) 354static void amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge)
356{ 355{
357 char *revstring; 356 char *revstring;
358 357
@@ -390,7 +389,7 @@ static const struct aper_size_info_32 uli_sizes[7] =
390 {8, 2048, 1, 4}, 389 {8, 2048, 1, 4},
391 {4, 1024, 0, 3} 390 {4, 1024, 0, 3}
392}; 391};
393static int __devinit uli_agp_init(struct pci_dev *pdev) 392static int uli_agp_init(struct pci_dev *pdev)
394{ 393{
395 u32 httfea,baseaddr,enuscr; 394 u32 httfea,baseaddr,enuscr;
396 struct pci_dev *dev1; 395 struct pci_dev *dev1;
@@ -513,8 +512,8 @@ put:
513 return ret; 512 return ret;
514} 513}
515 514
516static int __devinit agp_amd64_probe(struct pci_dev *pdev, 515static int agp_amd64_probe(struct pci_dev *pdev,
517 const struct pci_device_id *ent) 516 const struct pci_device_id *ent)
518{ 517{
519 struct agp_bridge_data *bridge; 518 struct agp_bridge_data *bridge;
520 u8 cap_ptr; 519 u8 cap_ptr;
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index ed0433576e7..0628d7b65c7 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -490,8 +490,7 @@ static struct agp_device_ids ati_agp_device_ids[] =
490 { }, /* dummy final entry, always present */ 490 { }, /* dummy final entry, always present */
491}; 491};
492 492
493static int __devinit agp_ati_probe(struct pci_dev *pdev, 493static int agp_ati_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
494 const struct pci_device_id *ent)
495{ 494{
496 struct agp_device_ids *devs = ati_agp_device_ids; 495 struct agp_device_ids *devs = ati_agp_device_ids;
497 struct agp_bridge_data *bridge; 496 struct agp_bridge_data *bridge;
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index 55f3e33a309..6974d503205 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -343,8 +343,8 @@ static const struct agp_bridge_driver efficeon_driver = {
343 .agp_type_to_mask_type = agp_generic_type_to_mask_type, 343 .agp_type_to_mask_type = agp_generic_type_to_mask_type,
344}; 344};
345 345
346static int __devinit agp_efficeon_probe(struct pci_dev *pdev, 346static int agp_efficeon_probe(struct pci_dev *pdev,
347 const struct pci_device_id *ent) 347 const struct pci_device_id *ent)
348{ 348{
349 struct agp_bridge_data *bridge; 349 struct agp_bridge_data *bridge;
350 u8 cap_ptr; 350 u8 cap_ptr;
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c
index d328b662e50..15b240ea484 100644
--- a/drivers/char/agp/i460-agp.c
+++ b/drivers/char/agp/i460-agp.c
@@ -587,8 +587,8 @@ const struct agp_bridge_driver intel_i460_driver = {
587 .cant_use_aperture = true, 587 .cant_use_aperture = true,
588}; 588};
589 589
590static int __devinit agp_intel_i460_probe(struct pci_dev *pdev, 590static int agp_intel_i460_probe(struct pci_dev *pdev,
591 const struct pci_device_id *ent) 591 const struct pci_device_id *ent)
592{ 592{
593 struct agp_bridge_data *bridge; 593 struct agp_bridge_data *bridge;
594 u8 cap_ptr; 594 u8 cap_ptr;
@@ -637,7 +637,7 @@ static struct pci_driver agp_intel_i460_pci_driver = {
637 .name = "agpgart-intel-i460", 637 .name = "agpgart-intel-i460",
638 .id_table = agp_intel_i460_pci_table, 638 .id_table = agp_intel_i460_pci_table,
639 .probe = agp_intel_i460_probe, 639 .probe = agp_intel_i460_probe,
640 .remove = __devexit_p(agp_intel_i460_remove), 640 .remove = agp_intel_i460_remove,
641}; 641};
642 642
643static int __init agp_intel_i460_init(void) 643static int __init agp_intel_i460_init(void)
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index f3a8f52b5a0..a426ee1f57a 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -732,8 +732,8 @@ static const struct intel_agp_driver_description {
732 { 0, NULL, NULL } 732 { 0, NULL, NULL }
733}; 733};
734 734
735static int __devinit agp_intel_probe(struct pci_dev *pdev, 735static int agp_intel_probe(struct pci_dev *pdev,
736 const struct pci_device_id *ent) 736 const struct pci_device_id *ent)
737{ 737{
738 struct agp_bridge_data *bridge; 738 struct agp_bridge_data *bridge;
739 u8 cap_ptr = 0; 739 u8 cap_ptr = 0;
@@ -912,7 +912,7 @@ static struct pci_driver agp_intel_pci_driver = {
912 .name = "agpgart-intel", 912 .name = "agpgart-intel",
913 .id_table = agp_intel_pci_table, 913 .id_table = agp_intel_pci_table,
914 .probe = agp_intel_probe, 914 .probe = agp_intel_probe,
915 .remove = __devexit_p(agp_intel_remove), 915 .remove = agp_intel_remove,
916#ifdef CONFIG_PM 916#ifdef CONFIG_PM
917 .resume = agp_intel_resume, 917 .resume = agp_intel_resume,
918#endif 918#endif
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 66e0868000f..62be3ec0da4 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -332,8 +332,8 @@ static const struct agp_bridge_driver nvidia_driver = {
332 .agp_type_to_mask_type = agp_generic_type_to_mask_type, 332 .agp_type_to_mask_type = agp_generic_type_to_mask_type,
333}; 333};
334 334
335static int __devinit agp_nvidia_probe(struct pci_dev *pdev, 335static int agp_nvidia_probe(struct pci_dev *pdev,
336 const struct pci_device_id *ent) 336 const struct pci_device_id *ent)
337{ 337{
338 struct agp_bridge_data *bridge; 338 struct agp_bridge_data *bridge;
339 u8 cap_ptr; 339 u8 cap_ptr;
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index a18791d7718..05b8d0241bd 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -270,7 +270,7 @@ const struct agp_bridge_driver sgi_tioca_driver = {
270 .num_aperture_sizes = 1, 270 .num_aperture_sizes = 1,
271}; 271};
272 272
273static int __devinit agp_sgi_init(void) 273static int agp_sgi_init(void)
274{ 274{
275 unsigned int j; 275 unsigned int j;
276 struct tioca_kernel *info; 276 struct tioca_kernel *info;
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index 93d1d31f9d0..79c838c434b 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -154,7 +154,7 @@ static int sis_broken_chipsets[] = {
154 0 // terminator 154 0 // terminator
155}; 155};
156 156
157static void __devinit sis_get_driver(struct agp_bridge_data *bridge) 157static void sis_get_driver(struct agp_bridge_data *bridge)
158{ 158{
159 int i; 159 int i;
160 160
@@ -180,8 +180,7 @@ static void __devinit sis_get_driver(struct agp_bridge_data *bridge)
180} 180}
181 181
182 182
183static int __devinit agp_sis_probe(struct pci_dev *pdev, 183static int agp_sis_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
184 const struct pci_device_id *ent)
185{ 184{
186 struct agp_bridge_data *bridge; 185 struct agp_bridge_data *bridge;
187 u8 cap_ptr; 186 u8 cap_ptr;
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 26020fb8d7a..9b163b49d97 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -445,8 +445,8 @@ static const struct agp_bridge_driver sworks_driver = {
445 .agp_type_to_mask_type = agp_generic_type_to_mask_type, 445 .agp_type_to_mask_type = agp_generic_type_to_mask_type,
446}; 446};
447 447
448static int __devinit agp_serverworks_probe(struct pci_dev *pdev, 448static int agp_serverworks_probe(struct pci_dev *pdev,
449 const struct pci_device_id *ent) 449 const struct pci_device_id *ent)
450{ 450{
451 struct agp_bridge_data *bridge; 451 struct agp_bridge_data *bridge;
452 struct pci_dev *bridge_dev; 452 struct pci_dev *bridge_dev;
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 011967ad3ee..a56ee9bedd1 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -592,8 +592,8 @@ static struct agp_device_ids uninorth_agp_device_ids[] = {
592 }, 592 },
593}; 593};
594 594
595static int __devinit agp_uninorth_probe(struct pci_dev *pdev, 595static int agp_uninorth_probe(struct pci_dev *pdev,
596 const struct pci_device_id *ent) 596 const struct pci_device_id *ent)
597{ 597{
598 struct agp_device_ids *devs = uninorth_agp_device_ids; 598 struct agp_device_ids *devs = uninorth_agp_device_ids;
599 struct agp_bridge_data *bridge; 599 struct agp_bridge_data *bridge;
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index 6818595bb86..74d3aa3773b 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -438,8 +438,7 @@ static void check_via_agp3 (struct agp_bridge_data *bridge)
438} 438}
439 439
440 440
441static int __devinit agp_via_probe(struct pci_dev *pdev, 441static int agp_via_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
442 const struct pci_device_id *ent)
443{ 442{
444 struct agp_device_ids *devs = via_agp_device_ids; 443 struct agp_device_ids *devs = via_agp_device_ids;
445 struct agp_bridge_data *bridge; 444 struct agp_bridge_data *bridge;
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 5a4a6e70478..7c73d4aca36 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -138,7 +138,7 @@ static const struct dev_pm_ops atmel_trng_pm_ops = {
138 138
139static struct platform_driver atmel_trng_driver = { 139static struct platform_driver atmel_trng_driver = {
140 .probe = atmel_trng_probe, 140 .probe = atmel_trng_probe,
141 .remove = __devexit_p(atmel_trng_remove), 141 .remove = atmel_trng_remove,
142 .driver = { 142 .driver = {
143 .name = "atmel-trng", 143 .name = "atmel-trng",
144 .owner = THIS_MODULE, 144 .owner = THIS_MODULE,
diff --git a/drivers/char/hw_random/bcm63xx-rng.c b/drivers/char/hw_random/bcm63xx-rng.c
index ae95bcb18d4..f343b7d0dfa 100644
--- a/drivers/char/hw_random/bcm63xx-rng.c
+++ b/drivers/char/hw_random/bcm63xx-rng.c
@@ -61,7 +61,7 @@ static int bcm63xx_rng_data_read(struct hwrng *rng, u32 *data)
61 return 4; 61 return 4;
62} 62}
63 63
64static int __devinit bcm63xx_rng_probe(struct platform_device *pdev) 64static int bcm63xx_rng_probe(struct platform_device *pdev)
65{ 65{
66 struct resource *r; 66 struct resource *r;
67 struct clk *clk; 67 struct clk *clk;
@@ -161,7 +161,7 @@ static int bcm63xx_rng_remove(struct platform_device *pdev)
161 161
162static struct platform_driver bcm63xx_rng_driver = { 162static struct platform_driver bcm63xx_rng_driver = {
163 .probe = bcm63xx_rng_probe, 163 .probe = bcm63xx_rng_probe,
164 .remove = __devexit_p(bcm63xx_rng_remove), 164 .remove = bcm63xx_rng_remove,
165 .driver = { 165 .driver = {
166 .name = "bcm63xx-rng", 166 .name = "bcm63xx-rng",
167 .owner = THIS_MODULE, 167 .owner = THIS_MODULE,
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c
index bdc852ea763..48bbfeca4b5 100644
--- a/drivers/char/hw_random/exynos-rng.c
+++ b/drivers/char/hw_random/exynos-rng.c
@@ -101,7 +101,7 @@ static int exynos_read(struct hwrng *rng, void *buf,
101 return 4; 101 return 4;
102} 102}
103 103
104static int __devinit exynos_rng_probe(struct platform_device *pdev) 104static int exynos_rng_probe(struct platform_device *pdev)
105{ 105{
106 struct exynos_rng *exynos_rng; 106 struct exynos_rng *exynos_rng;
107 107
@@ -172,7 +172,7 @@ static struct platform_driver exynos_rng_driver = {
172 .pm = &exynos_rng_pm_ops, 172 .pm = &exynos_rng_pm_ops,
173 }, 173 },
174 .probe = exynos_rng_probe, 174 .probe = exynos_rng_probe,
175 .remove = __devexit_p(exynos_rng_remove), 175 .remove = exynos_rng_remove,
176}; 176};
177 177
178module_platform_driver(exynos_rng_driver); 178module_platform_driver(exynos_rng_driver);
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index d68a72a08b5..20b962e1d83 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -611,7 +611,7 @@ static void n2rng_work(struct work_struct *work)
611 schedule_delayed_work(&np->work, HZ * 2); 611 schedule_delayed_work(&np->work, HZ * 2);
612} 612}
613 613
614static void __devinit n2rng_driver_version(void) 614static void n2rng_driver_version(void)
615{ 615{
616 static int n2rng_version_printed; 616 static int n2rng_version_printed;
617 617
@@ -620,7 +620,7 @@ static void __devinit n2rng_driver_version(void)
620} 620}
621 621
622static const struct of_device_id n2rng_match[]; 622static const struct of_device_id n2rng_match[];
623static int __devinit n2rng_probe(struct platform_device *op) 623static int n2rng_probe(struct platform_device *op)
624{ 624{
625 const struct of_device_id *match; 625 const struct of_device_id *match;
626 int multi_capable; 626 int multi_capable;
@@ -767,7 +767,7 @@ static struct platform_driver n2rng_driver = {
767 .of_match_table = n2rng_match, 767 .of_match_table = n2rng_match,
768 }, 768 },
769 .probe = n2rng_probe, 769 .probe = n2rng_probe,
770 .remove = __devexit_p(n2rng_remove), 770 .remove = n2rng_remove,
771}; 771};
772 772
773module_platform_driver(n2rng_driver); 773module_platform_driver(n2rng_driver);
diff --git a/drivers/char/hw_random/octeon-rng.c b/drivers/char/hw_random/octeon-rng.c
index 5c34c092af7..1eada566ca7 100644
--- a/drivers/char/hw_random/octeon-rng.c
+++ b/drivers/char/hw_random/octeon-rng.c
@@ -56,7 +56,7 @@ static int octeon_rng_data_read(struct hwrng *rng, u32 *data)
56 return sizeof(u32); 56 return sizeof(u32);
57} 57}
58 58
59static int __devinit octeon_rng_probe(struct platform_device *pdev) 59static int octeon_rng_probe(struct platform_device *pdev)
60{ 60{
61 struct resource *res_ports; 61 struct resource *res_ports;
62 struct resource *res_result; 62 struct resource *res_result;
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 45e467dcc8c..d8c54e25376 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -104,7 +104,7 @@ static struct hwrng omap_rng_ops = {
104 .data_read = omap_rng_data_read, 104 .data_read = omap_rng_data_read,
105}; 105};
106 106
107static int __devinit omap_rng_probe(struct platform_device *pdev) 107static int omap_rng_probe(struct platform_device *pdev)
108{ 108{
109 struct omap_rng_private_data *priv; 109 struct omap_rng_private_data *priv;
110 int ret; 110 int ret;
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c
index a1f70407cc9..c6df5b29af0 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -94,7 +94,7 @@ static struct hwrng pasemi_rng = {
94 .data_read = pasemi_rng_data_read, 94 .data_read = pasemi_rng_data_read,
95}; 95};
96 96
97static int __devinit rng_probe(struct platform_device *ofdev) 97static int rng_probe(struct platform_device *ofdev)
98{ 98{
99 void __iomem *rng_regs; 99 void __iomem *rng_regs;
100 struct device_node *rng_np = ofdev->dev.of_node; 100 struct device_node *rng_np = ofdev->dev.of_node;
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c
index d4b24c1dd48..973b95113ed 100644
--- a/drivers/char/hw_random/picoxcell-rng.c
+++ b/drivers/char/hw_random/picoxcell-rng.c
@@ -181,7 +181,7 @@ static const struct dev_pm_ops picoxcell_trng_pm_ops = {
181 181
182static struct platform_driver picoxcell_trng_driver = { 182static struct platform_driver picoxcell_trng_driver = {
183 .probe = picoxcell_trng_probe, 183 .probe = picoxcell_trng_probe,
184 .remove = __devexit_p(picoxcell_trng_remove), 184 .remove = picoxcell_trng_remove,
185 .driver = { 185 .driver = {
186 .name = "picoxcell-trng", 186 .name = "picoxcell-trng",
187 .owner = THIS_MODULE, 187 .owner = THIS_MODULE,
diff --git a/drivers/char/hw_random/ppc4xx-rng.c b/drivers/char/hw_random/ppc4xx-rng.c
index af6506a69cd..732c330805f 100644
--- a/drivers/char/hw_random/ppc4xx-rng.c
+++ b/drivers/char/hw_random/ppc4xx-rng.c
@@ -90,7 +90,7 @@ static struct hwrng ppc4xx_rng = {
90 .data_read = ppc4xx_rng_data_read, 90 .data_read = ppc4xx_rng_data_read,
91}; 91};
92 92
93static int __devinit ppc4xx_rng_probe(struct platform_device *dev) 93static int ppc4xx_rng_probe(struct platform_device *dev)
94{ 94{
95 void __iomem *rng_regs; 95 void __iomem *rng_regs;
96 int err = 0; 96 int err = 0;
diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index 3a1abc9417e..849db199c02 100644
--- a/drivers/char/hw_random/timeriomem-rng.c
+++ b/drivers/char/hw_random/timeriomem-rng.c
@@ -88,7 +88,7 @@ static struct hwrng timeriomem_rng_ops = {
88 .priv = 0, 88 .priv = 0,
89}; 89};
90 90
91static int __devinit timeriomem_rng_probe(struct platform_device *pdev) 91static int timeriomem_rng_probe(struct platform_device *pdev)
92{ 92{
93 struct resource *res; 93 struct resource *res;
94 int ret; 94 int ret;
@@ -146,7 +146,7 @@ static struct platform_driver timeriomem_rng_driver = {
146 .owner = THIS_MODULE, 146 .owner = THIS_MODULE,
147 }, 147 },
148 .probe = timeriomem_rng_probe, 148 .probe = timeriomem_rng_probe,
149 .remove = __devexit_p(timeriomem_rng_remove), 149 .remove = timeriomem_rng_remove,
150}; 150};
151 151
152module_platform_driver(timeriomem_rng_driver); 152module_platform_driver(timeriomem_rng_driver);
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 621f595f1a9..b65c1039595 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -147,7 +147,7 @@ static struct virtio_driver virtio_rng_driver = {
147 .driver.owner = THIS_MODULE, 147 .driver.owner = THIS_MODULE,
148 .id_table = id_table, 148 .id_table = id_table,
149 .probe = virtrng_probe, 149 .probe = virtrng_probe,
150 .remove = __devexit_p(virtrng_remove), 150 .remove = virtrng_remove,
151#ifdef CONFIG_PM 151#ifdef CONFIG_PM
152 .freeze = virtrng_freeze, 152 .freeze = virtrng_freeze,
153 .restore = virtrng_restore, 153 .restore = virtrng_restore,
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index cfdfecd5bc7..1c7fdcd22a9 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2243,7 +2243,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
2243static struct pnp_driver ipmi_pnp_driver = { 2243static struct pnp_driver ipmi_pnp_driver = {
2244 .name = DEVICE_NAME, 2244 .name = DEVICE_NAME,
2245 .probe = ipmi_pnp_probe, 2245 .probe = ipmi_pnp_probe,
2246 .remove = __devexit_p(ipmi_pnp_remove), 2246 .remove = ipmi_pnp_remove,
2247 .id_table = pnp_dev_table, 2247 .id_table = pnp_dev_table,
2248}; 2248};
2249#endif 2249#endif
@@ -2546,7 +2546,7 @@ static struct pci_driver ipmi_pci_driver = {
2546 .name = DEVICE_NAME, 2546 .name = DEVICE_NAME,
2547 .id_table = ipmi_pci_devices, 2547 .id_table = ipmi_pci_devices,
2548 .probe = ipmi_pci_probe, 2548 .probe = ipmi_pci_probe,
2549 .remove = __devexit_p(ipmi_pci_remove), 2549 .remove = ipmi_pci_remove,
2550}; 2550};
2551#endif /* CONFIG_PCI */ 2551#endif /* CONFIG_PCI */
2552 2552
@@ -2661,7 +2661,7 @@ static struct platform_driver ipmi_driver = {
2661 .of_match_table = ipmi_match, 2661 .of_match_table = ipmi_match,
2662 }, 2662 },
2663 .probe = ipmi_probe, 2663 .probe = ipmi_probe,
2664 .remove = __devexit_p(ipmi_remove), 2664 .remove = ipmi_remove,
2665}; 2665};
2666 2666
2667static int wait_for_msg_done(struct smi_info *smi_info) 2667static int wait_for_msg_done(struct smi_info *smi_info)
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index c594cb16c37..684b0d53764 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -2186,11 +2186,7 @@ static struct virtio_driver virtio_console = {
2186#endif 2186#endif
2187}; 2187};
2188 2188
2189/* 2189static struct virtio_driver virtio_rproc_serial = {
2190 * virtio_rproc_serial refers to __devinit function which causes
2191 * section mismatch warnings. So use __refdata to silence warnings.
2192 */
2193static struct virtio_driver __refdata virtio_rproc_serial = {
2194 .feature_table = rproc_serial_features, 2190 .feature_table = rproc_serial_features,
2195 .feature_table_size = ARRAY_SIZE(rproc_serial_features), 2191 .feature_table_size = ARRAY_SIZE(rproc_serial_features),
2196 .driver.name = "virtio_rproc_serial", 2192 .driver.name = "virtio_rproc_serial",
diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index bc1e713e7b9..3af729b1b89 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -78,7 +78,7 @@ static struct clk_init_data wm831x_clkout_init = {
78 .flags = CLK_IS_ROOT, 78 .flags = CLK_IS_ROOT,
79}; 79};
80 80
81static int __devinit twl6040_clk_probe(struct platform_device *pdev) 81static int twl6040_clk_probe(struct platform_device *pdev)
82{ 82{
83 struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent); 83 struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
84 struct twl6040_clk *clkdata; 84 struct twl6040_clk *clkdata;
@@ -100,7 +100,7 @@ static int __devinit twl6040_clk_probe(struct platform_device *pdev)
100 return 0; 100 return 0;
101} 101}
102 102
103static int __devexit twl6040_clk_remove(struct platform_device *pdev) 103static int twl6040_clk_remove(struct platform_device *pdev)
104{ 104{
105 struct twl6040_clk *clkdata = dev_get_drvdata(&pdev->dev); 105 struct twl6040_clk *clkdata = dev_get_drvdata(&pdev->dev);
106 106
@@ -115,7 +115,7 @@ static struct platform_driver twl6040_clk_driver = {
115 .owner = THIS_MODULE, 115 .owner = THIS_MODULE,
116 }, 116 },
117 .probe = twl6040_clk_probe, 117 .probe = twl6040_clk_probe,
118 .remove = __devexit_p(twl6040_clk_remove), 118 .remove = twl6040_clk_remove,
119}; 119};
120 120
121module_platform_driver(twl6040_clk_driver); 121module_platform_driver(twl6040_clk_driver);
diff --git a/drivers/clk/mvebu/clk-gating-ctrl.c b/drivers/clk/mvebu/clk-gating-ctrl.c
index c6d3c263b07..8fa5408b6c7 100644
--- a/drivers/clk/mvebu/clk-gating-ctrl.c
+++ b/drivers/clk/mvebu/clk-gating-ctrl.c
@@ -32,7 +32,7 @@ struct mvebu_soc_descr {
32 32
33#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw) 33#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
34 34
35static struct clk __init *mvebu_clk_gating_get_src( 35static struct clk *mvebu_clk_gating_get_src(
36 struct of_phandle_args *clkspec, void *data) 36 struct of_phandle_args *clkspec, void *data)
37{ 37{
38 struct mvebu_gating_ctrl *ctrl = (struct mvebu_gating_ctrl *)data; 38 struct mvebu_gating_ctrl *ctrl = (struct mvebu_gating_ctrl *)data;
diff --git a/drivers/clk/ux500/abx500-clk.c b/drivers/clk/ux500/abx500-clk.c
index e27c52317ff..9f7400d74fa 100644
--- a/drivers/clk/ux500/abx500-clk.c
+++ b/drivers/clk/ux500/abx500-clk.c
@@ -34,7 +34,7 @@ static int ab9540_reg_clks(struct device *dev)
34 return 0; 34 return 0;
35} 35}
36 36
37static int __devinit abx500_clk_probe(struct platform_device *pdev) 37static int abx500_clk_probe(struct platform_device *pdev)
38{ 38{
39 struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent); 39 struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent);
40 int ret; 40 int ret;
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 5d1b9268bca..6efe4d1ab3a 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -73,7 +73,7 @@ static struct clocksource clocksource_acpi_pm = {
73 73
74 74
75#ifdef CONFIG_PCI 75#ifdef CONFIG_PCI
76static int __devinitdata acpi_pm_good; 76static int acpi_pm_good;
77static int __init acpi_pm_good_setup(char *__str) 77static int __init acpi_pm_good_setup(char *__str)
78{ 78{
79 acpi_pm_good = 1; 79 acpi_pm_good = 1;
@@ -102,7 +102,7 @@ static inline void acpi_pm_need_workaround(void)
102 * incorrect when read). As a result, the ACPI free running count up 102 * incorrect when read). As a result, the ACPI free running count up
103 * timer specification is violated due to erroneous reads. 103 * timer specification is violated due to erroneous reads.
104 */ 104 */
105static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) 105static void acpi_pm_check_blacklist(struct pci_dev *dev)
106{ 106{
107 if (acpi_pm_good) 107 if (acpi_pm_good)
108 return; 108 return;
@@ -120,7 +120,7 @@ static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev)
120DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, 120DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3,
121 acpi_pm_check_blacklist); 121 acpi_pm_check_blacklist);
122 122
123static void __devinit acpi_pm_check_graylist(struct pci_dev *dev) 123static void acpi_pm_check_graylist(struct pci_dev *dev)
124{ 124{
125 if (acpi_pm_good) 125 if (acpi_pm_good)
126 return; 126 return;
diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
index 372051d1bba..e6a553cb73e 100644
--- a/drivers/clocksource/em_sti.c
+++ b/drivers/clocksource/em_sti.c
@@ -311,7 +311,7 @@ static void em_sti_register_clockevent(struct em_sti_priv *p)
311 clockevents_config_and_register(ced, 1, 2, 0xffffffff); 311 clockevents_config_and_register(ced, 1, 2, 0xffffffff);
312} 312}
313 313
314static int __devinit em_sti_probe(struct platform_device *pdev) 314static int em_sti_probe(struct platform_device *pdev)
315{ 315{
316 struct em_sti_priv *p; 316 struct em_sti_priv *p;
317 struct resource *res; 317 struct resource *res;
@@ -379,12 +379,12 @@ err0:
379 return ret; 379 return ret;
380} 380}
381 381
382static int __devexit em_sti_remove(struct platform_device *pdev) 382static int em_sti_remove(struct platform_device *pdev)
383{ 383{
384 return -EBUSY; /* cannot unregister clockevent and clocksource */ 384 return -EBUSY; /* cannot unregister clockevent and clocksource */
385} 385}
386 386
387static const struct of_device_id em_sti_dt_ids[] __devinitconst = { 387static const struct of_device_id em_sti_dt_ids[] = {
388 { .compatible = "renesas,em-sti", }, 388 { .compatible = "renesas,em-sti", },
389 {}, 389 {},
390}; 390};
@@ -392,7 +392,7 @@ MODULE_DEVICE_TABLE(of, em_sti_dt_ids);
392 392
393static struct platform_driver em_sti_device_driver = { 393static struct platform_driver em_sti_device_driver = {
394 .probe = em_sti_probe, 394 .probe = em_sti_probe,
395 .remove = __devexit_p(em_sti_remove), 395 .remove = em_sti_remove,
396 .driver = { 396 .driver = {
397 .name = "em_sti", 397 .name = "em_sti",
398 .of_match_table = em_sti_dt_ids, 398 .of_match_table = em_sti_dt_ids,
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index a5f7829f279..488c14cc8db 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -726,7 +726,7 @@ err0:
726 return ret; 726 return ret;
727} 727}
728 728
729static int __devinit sh_cmt_probe(struct platform_device *pdev) 729static int sh_cmt_probe(struct platform_device *pdev)
730{ 730{
731 struct sh_cmt_priv *p = platform_get_drvdata(pdev); 731 struct sh_cmt_priv *p = platform_get_drvdata(pdev);
732 struct sh_timer_config *cfg = pdev->dev.platform_data; 732 struct sh_timer_config *cfg = pdev->dev.platform_data;
@@ -767,14 +767,14 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
767 return 0; 767 return 0;
768} 768}
769 769
770static int __devexit sh_cmt_remove(struct platform_device *pdev) 770static int sh_cmt_remove(struct platform_device *pdev)
771{ 771{
772 return -EBUSY; /* cannot unregister clockevent and clocksource */ 772 return -EBUSY; /* cannot unregister clockevent and clocksource */
773} 773}
774 774
775static struct platform_driver sh_cmt_device_driver = { 775static struct platform_driver sh_cmt_device_driver = {
776 .probe = sh_cmt_probe, 776 .probe = sh_cmt_probe,
777 .remove = __devexit_p(sh_cmt_remove), 777 .remove = sh_cmt_remove,
778 .driver = { 778 .driver = {
779 .name = "sh_cmt", 779 .name = "sh_cmt",
780 } 780 }
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index c5eea858054..83943e27cfa 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -321,7 +321,7 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev)
321 return ret; 321 return ret;
322} 322}
323 323
324static int __devinit sh_mtu2_probe(struct platform_device *pdev) 324static int sh_mtu2_probe(struct platform_device *pdev)
325{ 325{
326 struct sh_mtu2_priv *p = platform_get_drvdata(pdev); 326 struct sh_mtu2_priv *p = platform_get_drvdata(pdev);
327 struct sh_timer_config *cfg = pdev->dev.platform_data; 327 struct sh_timer_config *cfg = pdev->dev.platform_data;
@@ -362,14 +362,14 @@ static int __devinit sh_mtu2_probe(struct platform_device *pdev)
362 return 0; 362 return 0;
363} 363}
364 364
365static int __devexit sh_mtu2_remove(struct platform_device *pdev) 365static int sh_mtu2_remove(struct platform_device *pdev)
366{ 366{
367 return -EBUSY; /* cannot unregister clockevent */ 367 return -EBUSY; /* cannot unregister clockevent */
368} 368}
369 369
370static struct platform_driver sh_mtu2_device_driver = { 370static struct platform_driver sh_mtu2_device_driver = {
371 .probe = sh_mtu2_probe, 371 .probe = sh_mtu2_probe,
372 .remove = __devexit_p(sh_mtu2_remove), 372 .remove = sh_mtu2_remove,
373 .driver = { 373 .driver = {
374 .name = "sh_mtu2", 374 .name = "sh_mtu2",
375 } 375 }
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 0cc4add8827..b4502edce2a 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -484,7 +484,7 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev)
484 return ret; 484 return ret;
485} 485}
486 486
487static int __devinit sh_tmu_probe(struct platform_device *pdev) 487static int sh_tmu_probe(struct platform_device *pdev)
488{ 488{
489 struct sh_tmu_priv *p = platform_get_drvdata(pdev); 489 struct sh_tmu_priv *p = platform_get_drvdata(pdev);
490 struct sh_timer_config *cfg = pdev->dev.platform_data; 490 struct sh_timer_config *cfg = pdev->dev.platform_data;
@@ -525,14 +525,14 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
525 return 0; 525 return 0;
526} 526}
527 527
528static int __devexit sh_tmu_remove(struct platform_device *pdev) 528static int sh_tmu_remove(struct platform_device *pdev)
529{ 529{
530 return -EBUSY; /* cannot unregister clockevent and clocksource */ 530 return -EBUSY; /* cannot unregister clockevent and clocksource */
531} 531}
532 532
533static struct platform_driver sh_tmu_device_driver = { 533static struct platform_driver sh_tmu_device_driver = {
534 .probe = sh_tmu_probe, 534 .probe = sh_tmu_probe,
535 .remove = __devexit_p(sh_tmu_remove), 535 .remove = sh_tmu_remove,
536 .driver = { 536 .driver = {
537 .name = "sh_tmu", 537 .name = "sh_tmu",
538 } 538 }
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 965b7811e04..7b695913cb3 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -256,7 +256,7 @@ static struct cn_dev cdev = {
256 .input = cn_rx_skb, 256 .input = cn_rx_skb,
257}; 257};
258 258
259static int __devinit cn_init(void) 259static int cn_init(void)
260{ 260{
261 struct cn_dev *dev = &cdev; 261 struct cn_dev *dev = &cdev;
262 struct netlink_kernel_cfg cfg = { 262 struct netlink_kernel_cfg cfg = {
@@ -281,7 +281,7 @@ static int __devinit cn_init(void)
281 return 0; 281 return 0;
282} 282}
283 283
284static void __devexit cn_fini(void) 284static void cn_fini(void)
285{ 285{
286 struct cn_dev *dev = &cdev; 286 struct cn_dev *dev = &cdev;
287 287
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index ea512f47b78..e0a899f25e3 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -20,6 +20,9 @@ if CPU_FREQ
20config CPU_FREQ_TABLE 20config CPU_FREQ_TABLE
21 tristate 21 tristate
22 22
23config CPU_FREQ_GOV_COMMON
24 bool
25
23config CPU_FREQ_STAT 26config CPU_FREQ_STAT
24 tristate "CPU frequency translation statistics" 27 tristate "CPU frequency translation statistics"
25 select CPU_FREQ_TABLE 28 select CPU_FREQ_TABLE
@@ -141,6 +144,7 @@ config CPU_FREQ_GOV_USERSPACE
141config CPU_FREQ_GOV_ONDEMAND 144config CPU_FREQ_GOV_ONDEMAND
142 tristate "'ondemand' cpufreq policy governor" 145 tristate "'ondemand' cpufreq policy governor"
143 select CPU_FREQ_TABLE 146 select CPU_FREQ_TABLE
147 select CPU_FREQ_GOV_COMMON
144 help 148 help
145 'ondemand' - This driver adds a dynamic cpufreq policy governor. 149 'ondemand' - This driver adds a dynamic cpufreq policy governor.
146 The governor does a periodic polling and 150 The governor does a periodic polling and
@@ -159,6 +163,7 @@ config CPU_FREQ_GOV_ONDEMAND
159config CPU_FREQ_GOV_CONSERVATIVE 163config CPU_FREQ_GOV_CONSERVATIVE
160 tristate "'conservative' cpufreq governor" 164 tristate "'conservative' cpufreq governor"
161 depends on CPU_FREQ 165 depends on CPU_FREQ
166 select CPU_FREQ_GOV_COMMON
162 help 167 help
163 'conservative' - this driver is rather similar to the 'ondemand' 168 'conservative' - this driver is rather similar to the 'ondemand'
164 governor both in its source code and its purpose, the difference is 169 governor both in its source code and its purpose, the difference is
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 1f254ec087c..fadc4d496e2 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -7,8 +7,9 @@ obj-$(CONFIG_CPU_FREQ_STAT) += cpufreq_stats.o
7obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o 7obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o
8obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o 8obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
9obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o 9obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
10obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o cpufreq_governor.o 10obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
11obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o cpufreq_governor.o 11obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
12obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o
12 13
13# CPUfreq cross-arch helpers 14# CPUfreq cross-arch helpers
14obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o 15obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index e40e5080964..9d7732b8104 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -364,18 +364,21 @@ static int __init cpufreq_stats_init(void)
364 if (ret) 364 if (ret)
365 return ret; 365 return ret;
366 366
367 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
368 for_each_online_cpu(cpu)
369 cpufreq_update_policy(cpu);
370
367 ret = cpufreq_register_notifier(&notifier_trans_block, 371 ret = cpufreq_register_notifier(&notifier_trans_block,
368 CPUFREQ_TRANSITION_NOTIFIER); 372 CPUFREQ_TRANSITION_NOTIFIER);
369 if (ret) { 373 if (ret) {
370 cpufreq_unregister_notifier(&notifier_policy_block, 374 cpufreq_unregister_notifier(&notifier_policy_block,
371 CPUFREQ_POLICY_NOTIFIER); 375 CPUFREQ_POLICY_NOTIFIER);
376 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
377 for_each_online_cpu(cpu)
378 cpufreq_stats_free_table(cpu);
372 return ret; 379 return ret;
373 } 380 }
374 381
375 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
376 for_each_online_cpu(cpu) {
377 cpufreq_update_policy(cpu);
378 }
379 return 0; 382 return 0;
380} 383}
381static void __exit cpufreq_stats_exit(void) 384static void __exit cpufreq_stats_exit(void)
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index f1fa500ac10..1180d536d1e 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -77,7 +77,7 @@ static unsigned int longhaul_index;
77static int scale_voltage; 77static int scale_voltage;
78static int disable_acpi_c3; 78static int disable_acpi_c3;
79static int revid_errata; 79static int revid_errata;
80 80static int enable;
81 81
82/* Clock ratios multiplied by 10 */ 82/* Clock ratios multiplied by 10 */
83static int mults[32]; 83static int mults[32];
@@ -965,6 +965,10 @@ static int __init longhaul_init(void)
965 if (!x86_match_cpu(longhaul_id)) 965 if (!x86_match_cpu(longhaul_id))
966 return -ENODEV; 966 return -ENODEV;
967 967
968 if (!enable) {
969 printk(KERN_ERR PFX "Option \"enable\" not set. Aborting.\n");
970 return -ENODEV;
971 }
968#ifdef CONFIG_SMP 972#ifdef CONFIG_SMP
969 if (num_online_cpus() > 1) { 973 if (num_online_cpus() > 1) {
970 printk(KERN_ERR PFX "More than 1 CPU detected, " 974 printk(KERN_ERR PFX "More than 1 CPU detected, "
@@ -1021,6 +1025,10 @@ MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor");
1021 * such. */ 1025 * such. */
1022module_param(revid_errata, int, 0644); 1026module_param(revid_errata, int, 0644);
1023MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID"); 1027MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID");
1028/* By default driver is disabled to prevent incompatible
1029 * system freeze. */
1030module_param(enable, int, 0644);
1031MODULE_PARM_DESC(enable, "Enable driver");
1024 1032
1025MODULE_AUTHOR("Dave Jones <davej@redhat.com>"); 1033MODULE_AUTHOR("Dave Jones <davej@redhat.com>");
1026MODULE_DESCRIPTION("Longhaul driver for VIA Cyrix processors."); 1034MODULE_DESCRIPTION("Longhaul driver for VIA Cyrix processors.");
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index 3265844839b..2a297f86dba 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)
209 int all; 209 int all;
210 int ret; 210 int ret;
211 211
212 all = coupled->online_count || (coupled->online_count << WAITING_BITS); 212 all = coupled->online_count | (coupled->online_count << WAITING_BITS);
213 ret = atomic_add_unless(&coupled->ready_waiting_counts, 213 ret = atomic_add_unless(&coupled->ready_waiting_counts,
214 -MAX_WAITING_CPUS, all); 214 -MAX_WAITING_CPUS, all);
215 215
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 8df53dd8dbe..fb4a7dd57f9 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -70,7 +70,7 @@ int cpuidle_play_dead(void)
70 struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); 70 struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
71 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); 71 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
72 int i, dead_state = -1; 72 int i, dead_state = -1;
73 int power_usage = -1; 73 int power_usage = INT_MAX;
74 74
75 if (!drv) 75 if (!drv)
76 return -ENODEV; 76 return -ENODEV;
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 3af841fb397..c2b281afe0e 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -235,16 +235,10 @@ EXPORT_SYMBOL_GPL(cpuidle_get_driver);
235 */ 235 */
236struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev) 236struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev)
237{ 237{
238 struct cpuidle_driver *drv;
239
240 if (!dev) 238 if (!dev)
241 return NULL; 239 return NULL;
242 240
243 spin_lock(&cpuidle_driver_lock); 241 return __cpuidle_get_cpu_driver(dev->cpu);
244 drv = __cpuidle_get_cpu_driver(dev->cpu);
245 spin_unlock(&cpuidle_driver_lock);
246
247 return drv;
248} 242}
249EXPORT_SYMBOL_GPL(cpuidle_get_cpu_driver); 243EXPORT_SYMBOL_GPL(cpuidle_get_cpu_driver);
250 244
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index bd40b943b6d..20ea33afdda 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -312,7 +312,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
312{ 312{
313 struct menu_device *data = &__get_cpu_var(menu_devices); 313 struct menu_device *data = &__get_cpu_var(menu_devices);
314 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); 314 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
315 int power_usage = -1; 315 int power_usage = INT_MAX;
316 int i; 316 int i;
317 int multiplier; 317 int multiplier;
318 struct timespec t; 318 struct timespec t;
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 8061336e07e..c9d9d5c16f9 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -1036,7 +1036,7 @@ err_aes_algs:
1036 return err; 1036 return err;
1037} 1037}
1038 1038
1039static int __devinit atmel_aes_probe(struct platform_device *pdev) 1039static int atmel_aes_probe(struct platform_device *pdev)
1040{ 1040{
1041 struct atmel_aes_dev *aes_dd; 1041 struct atmel_aes_dev *aes_dd;
1042 struct aes_platform_data *pdata; 1042 struct aes_platform_data *pdata;
@@ -1152,7 +1152,7 @@ aes_dd_err:
1152 return err; 1152 return err;
1153} 1153}
1154 1154
1155static int __devexit atmel_aes_remove(struct platform_device *pdev) 1155static int atmel_aes_remove(struct platform_device *pdev)
1156{ 1156{
1157 static struct atmel_aes_dev *aes_dd; 1157 static struct atmel_aes_dev *aes_dd;
1158 1158
@@ -1185,7 +1185,7 @@ static int __devexit atmel_aes_remove(struct platform_device *pdev)
1185 1185
1186static struct platform_driver atmel_aes_driver = { 1186static struct platform_driver atmel_aes_driver = {
1187 .probe = atmel_aes_probe, 1187 .probe = atmel_aes_probe,
1188 .remove = __devexit_p(atmel_aes_remove), 1188 .remove = atmel_aes_remove,
1189 .driver = { 1189 .driver = {
1190 .name = "atmel_aes", 1190 .name = "atmel_aes",
1191 .owner = THIS_MODULE, 1191 .owner = THIS_MODULE,
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index bcdf55fdc62..4918e9424d3 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -964,7 +964,7 @@ err_sha_algs:
964 return err; 964 return err;
965} 965}
966 966
967static int __devinit atmel_sha_probe(struct platform_device *pdev) 967static int atmel_sha_probe(struct platform_device *pdev)
968{ 968{
969 struct atmel_sha_dev *sha_dd; 969 struct atmel_sha_dev *sha_dd;
970 struct device *dev = &pdev->dev; 970 struct device *dev = &pdev->dev;
@@ -1063,7 +1063,7 @@ sha_dd_err:
1063 return err; 1063 return err;
1064} 1064}
1065 1065
1066static int __devexit atmel_sha_remove(struct platform_device *pdev) 1066static int atmel_sha_remove(struct platform_device *pdev)
1067{ 1067{
1068 static struct atmel_sha_dev *sha_dd; 1068 static struct atmel_sha_dev *sha_dd;
1069 1069
@@ -1093,7 +1093,7 @@ static int __devexit atmel_sha_remove(struct platform_device *pdev)
1093 1093
1094static struct platform_driver atmel_sha_driver = { 1094static struct platform_driver atmel_sha_driver = {
1095 .probe = atmel_sha_probe, 1095 .probe = atmel_sha_probe,
1096 .remove = __devexit_p(atmel_sha_remove), 1096 .remove = atmel_sha_remove,
1097 .driver = { 1097 .driver = {
1098 .name = "atmel_sha", 1098 .name = "atmel_sha",
1099 .owner = THIS_MODULE, 1099 .owner = THIS_MODULE,
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index 7495f98c722..7c73fbb1753 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1053,7 +1053,7 @@ err_tdes_algs:
1053 return err; 1053 return err;
1054} 1054}
1055 1055
1056static int __devinit atmel_tdes_probe(struct platform_device *pdev) 1056static int atmel_tdes_probe(struct platform_device *pdev)
1057{ 1057{
1058 struct atmel_tdes_dev *tdes_dd; 1058 struct atmel_tdes_dev *tdes_dd;
1059 struct device *dev = &pdev->dev; 1059 struct device *dev = &pdev->dev;
@@ -1162,7 +1162,7 @@ tdes_dd_err:
1162 return err; 1162 return err;
1163} 1163}
1164 1164
1165static int __devexit atmel_tdes_remove(struct platform_device *pdev) 1165static int atmel_tdes_remove(struct platform_device *pdev)
1166{ 1166{
1167 static struct atmel_tdes_dev *tdes_dd; 1167 static struct atmel_tdes_dev *tdes_dd;
1168 1168
@@ -1195,7 +1195,7 @@ static int __devexit atmel_tdes_remove(struct platform_device *pdev)
1195 1195
1196static struct platform_driver atmel_tdes_driver = { 1196static struct platform_driver atmel_tdes_driver = {
1197 .probe = atmel_tdes_probe, 1197 .probe = atmel_tdes_probe,
1198 .remove = __devexit_p(atmel_tdes_remove), 1198 .remove = atmel_tdes_remove,
1199 .driver = { 1199 .driver = {
1200 .name = "atmel_tdes", 1200 .name = "atmel_tdes",
1201 .owner = THIS_MODULE, 1201 .owner = THIS_MODULE,
diff --git a/drivers/crypto/bfin_crc.c b/drivers/crypto/bfin_crc.c
index 5398580b431..a22f1a9f895 100644
--- a/drivers/crypto/bfin_crc.c
+++ b/drivers/crypto/bfin_crc.c
@@ -586,7 +586,7 @@ static int bfin_crypto_crc_suspend(struct platform_device *pdev, pm_message_t st
586 * bfin_crypto_crc_probe - Initialize module 586 * bfin_crypto_crc_probe - Initialize module
587 * 587 *
588 */ 588 */
589static int __devinit bfin_crypto_crc_probe(struct platform_device *pdev) 589static int bfin_crypto_crc_probe(struct platform_device *pdev)
590{ 590{
591 struct device *dev = &pdev->dev; 591 struct device *dev = &pdev->dev;
592 struct resource *res; 592 struct resource *res;
@@ -707,7 +707,7 @@ out_error_free_mem:
707 * bfin_crypto_crc_remove - Initialize module 707 * bfin_crypto_crc_remove - Initialize module
708 * 708 *
709 */ 709 */
710static int __devexit bfin_crypto_crc_remove(struct platform_device *pdev) 710static int bfin_crypto_crc_remove(struct platform_device *pdev)
711{ 711{
712 struct bfin_crypto_crc *crc = platform_get_drvdata(pdev); 712 struct bfin_crypto_crc *crc = platform_get_drvdata(pdev);
713 713
@@ -731,7 +731,7 @@ static int __devexit bfin_crypto_crc_remove(struct platform_device *pdev)
731 731
732static struct platform_driver bfin_crypto_crc_driver = { 732static struct platform_driver bfin_crypto_crc_driver = {
733 .probe = bfin_crypto_crc_probe, 733 .probe = bfin_crypto_crc_probe,
734 .remove = __devexit_p(bfin_crypto_crc_remove), 734 .remove = bfin_crypto_crc_remove,
735 .suspend = bfin_crypto_crc_suspend, 735 .suspend = bfin_crypto_crc_suspend,
736 .resume = bfin_crypto_crc_resume, 736 .resume = bfin_crypto_crc_resume,
737 .driver = { 737 .driver = {
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index bf20dd89170..1c56f63524f 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -420,7 +420,7 @@ static struct platform_driver caam_driver = {
420 .of_match_table = caam_match, 420 .of_match_table = caam_match,
421 }, 421 },
422 .probe = caam_probe, 422 .probe = caam_probe,
423 .remove = __devexit_p(caam_remove), 423 .remove = caam_remove,
424}; 424};
425 425
426module_platform_driver(caam_driver); 426module_platform_driver(caam_driver);
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 51f196d77f2..0c9ff497172 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -498,8 +498,7 @@ static struct crypto_alg geode_ecb_alg = {
498 } 498 }
499}; 499};
500 500
501static void __devexit 501static void geode_aes_remove(struct pci_dev *dev)
502geode_aes_remove(struct pci_dev *dev)
503{ 502{
504 crypto_unregister_alg(&geode_alg); 503 crypto_unregister_alg(&geode_alg);
505 crypto_unregister_alg(&geode_ecb_alg); 504 crypto_unregister_alg(&geode_ecb_alg);
@@ -513,8 +512,7 @@ geode_aes_remove(struct pci_dev *dev)
513} 512}
514 513
515 514
516static int __devinit 515static int geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
517geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
518{ 516{
519 int ret; 517 int ret;
520 ret = pci_enable_device(dev); 518 ret = pci_enable_device(dev);
@@ -582,7 +580,7 @@ static struct pci_driver geode_aes_driver = {
582 .name = "Geode LX AES", 580 .name = "Geode LX AES",
583 .id_table = geode_aes_tbl, 581 .id_table = geode_aes_tbl,
584 .probe = geode_aes_probe, 582 .probe = geode_aes_probe,
585 .remove = __devexit_p(geode_aes_remove) 583 .remove = geode_aes_remove,
586}; 584};
587 585
588module_pci_driver(geode_aes_driver); 586module_pci_driver(geode_aes_driver);
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index fda32968a66..ebf130e894b 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -2561,7 +2561,7 @@ static void hifn_tasklet_callback(unsigned long data)
2561 hifn_process_queue(dev); 2561 hifn_process_queue(dev);
2562} 2562}
2563 2563
2564static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) 2564static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2565{ 2565{
2566 int err, i; 2566 int err, i;
2567 struct hifn_device *dev; 2567 struct hifn_device *dev;
@@ -2696,7 +2696,7 @@ err_out_disable_pci_device:
2696 return err; 2696 return err;
2697} 2697}
2698 2698
2699static void __devexit hifn_remove(struct pci_dev *pdev) 2699static void hifn_remove(struct pci_dev *pdev)
2700{ 2700{
2701 int i; 2701 int i;
2702 struct hifn_device *dev; 2702 struct hifn_device *dev;
@@ -2740,7 +2740,7 @@ static struct pci_driver hifn_pci_driver = {
2740 .name = "hifn795x", 2740 .name = "hifn795x",
2741 .id_table = hifn_pci_tbl, 2741 .id_table = hifn_pci_tbl,
2742 .probe = hifn_probe, 2742 .probe = hifn_probe,
2743 .remove = __devexit_p(hifn_remove), 2743 .remove = hifn_remove,
2744}; 2744};
2745 2745
2746static int __init hifn_init(void) 2746static int __init hifn_init(void)
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index 24ccae453e7..ce6290e5471 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -1184,7 +1184,7 @@ MODULE_DEVICE_TABLE(of, mv_cesa_of_match_table);
1184 1184
1185static struct platform_driver marvell_crypto = { 1185static struct platform_driver marvell_crypto = {
1186 .probe = mv_probe, 1186 .probe = mv_probe,
1187 .remove = __devexit_p(mv_remove), 1187 .remove = mv_remove,
1188 .driver = { 1188 .driver = {
1189 .owner = THIS_MODULE, 1189 .owner = THIS_MODULE,
1190 .name = "mv_crypto", 1190 .name = "mv_crypto",
diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index aab257403b4..e1f0ab413c3 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -34,7 +34,7 @@
34#define DRV_MODULE_VERSION "0.2" 34#define DRV_MODULE_VERSION "0.2"
35#define DRV_MODULE_RELDATE "July 28, 2011" 35#define DRV_MODULE_RELDATE "July 28, 2011"
36 36
37static char version[] __devinitdata = 37static char version[] =
38 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 38 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
39 39
40MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); 40MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");
@@ -1388,7 +1388,7 @@ static int n2_cipher_cra_init(struct crypto_tfm *tfm)
1388 return 0; 1388 return 0;
1389} 1389}
1390 1390
1391static int __devinit __n2_register_one_cipher(const struct n2_cipher_tmpl *tmpl) 1391static int __n2_register_one_cipher(const struct n2_cipher_tmpl *tmpl)
1392{ 1392{
1393 struct n2_cipher_alg *p = kzalloc(sizeof(*p), GFP_KERNEL); 1393 struct n2_cipher_alg *p = kzalloc(sizeof(*p), GFP_KERNEL);
1394 struct crypto_alg *alg; 1394 struct crypto_alg *alg;
@@ -1424,7 +1424,7 @@ static int __devinit __n2_register_one_cipher(const struct n2_cipher_tmpl *tmpl)
1424 return err; 1424 return err;
1425} 1425}
1426 1426
1427static int __devinit __n2_register_one_hmac(struct n2_ahash_alg *n2ahash) 1427static int __n2_register_one_hmac(struct n2_ahash_alg *n2ahash)
1428{ 1428{
1429 struct n2_hmac_alg *p = kzalloc(sizeof(*p), GFP_KERNEL); 1429 struct n2_hmac_alg *p = kzalloc(sizeof(*p), GFP_KERNEL);
1430 struct ahash_alg *ahash; 1430 struct ahash_alg *ahash;
@@ -1462,7 +1462,7 @@ static int __devinit __n2_register_one_hmac(struct n2_ahash_alg *n2ahash)
1462 return err; 1462 return err;
1463} 1463}
1464 1464
1465static int __devinit __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl) 1465static int __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl)
1466{ 1466{
1467 struct n2_ahash_alg *p = kzalloc(sizeof(*p), GFP_KERNEL); 1467 struct n2_ahash_alg *p = kzalloc(sizeof(*p), GFP_KERNEL);
1468 struct hash_alg_common *halg; 1468 struct hash_alg_common *halg;
@@ -1517,7 +1517,7 @@ static int __devinit __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl)
1517 return err; 1517 return err;
1518} 1518}
1519 1519
1520static int __devinit n2_register_algs(void) 1520static int n2_register_algs(void)
1521{ 1521{
1522 int i, err = 0; 1522 int i, err = 0;
1523 1523
@@ -1545,7 +1545,7 @@ out:
1545 return err; 1545 return err;
1546} 1546}
1547 1547
1548static void __devexit n2_unregister_algs(void) 1548static void n2_unregister_algs(void)
1549{ 1549{
1550 mutex_lock(&spu_lock); 1550 mutex_lock(&spu_lock);
1551 if (!--algs_registered) 1551 if (!--algs_registered)
@@ -1822,8 +1822,8 @@ static int spu_mdesc_scan(struct mdesc_handle *mdesc, struct platform_device *de
1822 return err; 1822 return err;
1823} 1823}
1824 1824
1825static int __devinit get_irq_props(struct mdesc_handle *mdesc, u64 node, 1825static int get_irq_props(struct mdesc_handle *mdesc, u64 node,
1826 struct spu_mdesc_info *ip) 1826 struct spu_mdesc_info *ip)
1827{ 1827{
1828 const u64 *ino; 1828 const u64 *ino;
1829 int ino_len; 1829 int ino_len;
@@ -1851,10 +1851,10 @@ static int __devinit get_irq_props(struct mdesc_handle *mdesc, u64 node,
1851 return 0; 1851 return 0;
1852} 1852}
1853 1853
1854static int __devinit grab_mdesc_irq_props(struct mdesc_handle *mdesc, 1854static int grab_mdesc_irq_props(struct mdesc_handle *mdesc,
1855 struct platform_device *dev, 1855 struct platform_device *dev,
1856 struct spu_mdesc_info *ip, 1856 struct spu_mdesc_info *ip,
1857 const char *node_name) 1857 const char *node_name)
1858{ 1858{
1859 const unsigned int *reg; 1859 const unsigned int *reg;
1860 u64 node; 1860 u64 node;
@@ -1883,7 +1883,7 @@ static int __devinit grab_mdesc_irq_props(struct mdesc_handle *mdesc,
1883static unsigned long n2_spu_hvapi_major; 1883static unsigned long n2_spu_hvapi_major;
1884static unsigned long n2_spu_hvapi_minor; 1884static unsigned long n2_spu_hvapi_minor;
1885 1885
1886static int __devinit n2_spu_hvapi_register(void) 1886static int n2_spu_hvapi_register(void)
1887{ 1887{
1888 int err; 1888 int err;
1889 1889
@@ -1909,7 +1909,7 @@ static void n2_spu_hvapi_unregister(void)
1909 1909
1910static int global_ref; 1910static int global_ref;
1911 1911
1912static int __devinit grab_global_resources(void) 1912static int grab_global_resources(void)
1913{ 1913{
1914 int err = 0; 1914 int err = 0;
1915 1915
@@ -1973,7 +1973,7 @@ static void release_global_resources(void)
1973 mutex_unlock(&spu_lock); 1973 mutex_unlock(&spu_lock);
1974} 1974}
1975 1975
1976static struct n2_crypto * __devinit alloc_n2cp(void) 1976static struct n2_crypto *alloc_n2cp(void)
1977{ 1977{
1978 struct n2_crypto *np = kzalloc(sizeof(struct n2_crypto), GFP_KERNEL); 1978 struct n2_crypto *np = kzalloc(sizeof(struct n2_crypto), GFP_KERNEL);
1979 1979
@@ -1993,7 +1993,7 @@ static void free_n2cp(struct n2_crypto *np)
1993 kfree(np); 1993 kfree(np);
1994} 1994}
1995 1995
1996static void __devinit n2_spu_driver_version(void) 1996static void n2_spu_driver_version(void)
1997{ 1997{
1998 static int n2_spu_version_printed; 1998 static int n2_spu_version_printed;
1999 1999
@@ -2001,7 +2001,7 @@ static void __devinit n2_spu_driver_version(void)
2001 pr_info("%s", version); 2001 pr_info("%s", version);
2002} 2002}
2003 2003
2004static int __devinit n2_crypto_probe(struct platform_device *dev) 2004static int n2_crypto_probe(struct platform_device *dev)
2005{ 2005{
2006 struct mdesc_handle *mdesc; 2006 struct mdesc_handle *mdesc;
2007 const char *full_name; 2007 const char *full_name;
@@ -2077,7 +2077,7 @@ out_free_n2cp:
2077 return err; 2077 return err;
2078} 2078}
2079 2079
2080static int __devexit n2_crypto_remove(struct platform_device *dev) 2080static int n2_crypto_remove(struct platform_device *dev)
2081{ 2081{
2082 struct n2_crypto *np = dev_get_drvdata(&dev->dev); 2082 struct n2_crypto *np = dev_get_drvdata(&dev->dev);
2083 2083
@@ -2092,7 +2092,7 @@ static int __devexit n2_crypto_remove(struct platform_device *dev)
2092 return 0; 2092 return 0;
2093} 2093}
2094 2094
2095static struct n2_mau * __devinit alloc_ncp(void) 2095static struct n2_mau *alloc_ncp(void)
2096{ 2096{
2097 struct n2_mau *mp = kzalloc(sizeof(struct n2_mau), GFP_KERNEL); 2097 struct n2_mau *mp = kzalloc(sizeof(struct n2_mau), GFP_KERNEL);
2098 2098
@@ -2112,7 +2112,7 @@ static void free_ncp(struct n2_mau *mp)
2112 kfree(mp); 2112 kfree(mp);
2113} 2113}
2114 2114
2115static int __devinit n2_mau_probe(struct platform_device *dev) 2115static int n2_mau_probe(struct platform_device *dev)
2116{ 2116{
2117 struct mdesc_handle *mdesc; 2117 struct mdesc_handle *mdesc;
2118 const char *full_name; 2118 const char *full_name;
@@ -2179,7 +2179,7 @@ out_free_ncp:
2179 return err; 2179 return err;
2180} 2180}
2181 2181
2182static int __devexit n2_mau_remove(struct platform_device *dev) 2182static int n2_mau_remove(struct platform_device *dev)
2183{ 2183{
2184 struct n2_mau *mp = dev_get_drvdata(&dev->dev); 2184 struct n2_mau *mp = dev_get_drvdata(&dev->dev);
2185 2185
@@ -2217,7 +2217,7 @@ static struct platform_driver n2_crypto_driver = {
2217 .of_match_table = n2_crypto_match, 2217 .of_match_table = n2_crypto_match,
2218 }, 2218 },
2219 .probe = n2_crypto_probe, 2219 .probe = n2_crypto_probe,
2220 .remove = __devexit_p(n2_crypto_remove), 2220 .remove = n2_crypto_remove,
2221}; 2221};
2222 2222
2223static struct of_device_id n2_mau_match[] = { 2223static struct of_device_id n2_mau_match[] = {
@@ -2245,7 +2245,7 @@ static struct platform_driver n2_mau_driver = {
2245 .of_match_table = n2_mau_match, 2245 .of_match_table = n2_mau_match,
2246 }, 2246 },
2247 .probe = n2_mau_probe, 2247 .probe = n2_mau_probe,
2248 .remove = __devexit_p(n2_mau_remove), 2248 .remove = n2_mau_remove,
2249}; 2249};
2250 2250
2251static int __init n2_init(void) 2251static int __init n2_init(void)
diff --git a/drivers/crypto/nx/nx.c b/drivers/crypto/nx/nx.c
index f7a8a16aa7d..c767f232e69 100644
--- a/drivers/crypto/nx/nx.c
+++ b/drivers/crypto/nx/nx.c
@@ -634,8 +634,7 @@ void nx_crypto_ctx_exit(struct crypto_tfm *tfm)
634 nx_ctx->out_sg = NULL; 634 nx_ctx->out_sg = NULL;
635} 635}
636 636
637static int __devinit nx_probe(struct vio_dev *viodev, 637static int nx_probe(struct vio_dev *viodev, const struct vio_device_id *id)
638 const struct vio_device_id *id)
639{ 638{
640 dev_dbg(&viodev->dev, "driver probed: %s resource id: 0x%x\n", 639 dev_dbg(&viodev->dev, "driver probed: %s resource id: 0x%x\n",
641 viodev->name, viodev->resource_id); 640 viodev->name, viodev->resource_id);
@@ -653,7 +652,7 @@ static int __devinit nx_probe(struct vio_dev *viodev,
653 return nx_register_algs(); 652 return nx_register_algs();
654} 653}
655 654
656static int __devexit nx_remove(struct vio_dev *viodev) 655static int nx_remove(struct vio_dev *viodev)
657{ 656{
658 dev_dbg(&viodev->dev, "entering nx_remove for UA 0x%x\n", 657 dev_dbg(&viodev->dev, "entering nx_remove for UA 0x%x\n",
659 viodev->unit_address); 658 viodev->unit_address);
@@ -689,7 +688,7 @@ static void __exit nx_fini(void)
689 vio_unregister_driver(&nx_driver.viodriver); 688 vio_unregister_driver(&nx_driver.viodriver);
690} 689}
691 690
692static struct vio_device_id nx_crypto_driver_ids[] __devinitdata = { 691static struct vio_device_id nx_crypto_driver_ids[] = {
693 { "ibm,sym-encryption-v1", "ibm,sym-encryption" }, 692 { "ibm,sym-encryption-v1", "ibm,sym-encryption" },
694 { "", "" } 693 { "", "" }
695}; 694};
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 1d75e6f95a5..90d34adc2a6 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1137,7 +1137,7 @@ static void omap_sham_dma_cleanup(struct omap_sham_dev *dd)
1137 } 1137 }
1138} 1138}
1139 1139
1140static int __devinit omap_sham_probe(struct platform_device *pdev) 1140static int omap_sham_probe(struct platform_device *pdev)
1141{ 1141{
1142 struct omap_sham_dev *dd; 1142 struct omap_sham_dev *dd;
1143 struct device *dev = &pdev->dev; 1143 struct device *dev = &pdev->dev;
@@ -1250,7 +1250,7 @@ data_err:
1250 return err; 1250 return err;
1251} 1251}
1252 1252
1253static int __devexit omap_sham_remove(struct platform_device *pdev) 1253static int omap_sham_remove(struct platform_device *pdev)
1254{ 1254{
1255 static struct omap_sham_dev *dd; 1255 static struct omap_sham_dev *dd;
1256 int i; 1256 int i;
diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c
index c983f869d2b..2096d4685a9 100644
--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1708,7 +1708,7 @@ static bool spacc_is_compatible(struct platform_device *pdev,
1708 return false; 1708 return false;
1709} 1709}
1710 1710
1711static int __devinit spacc_probe(struct platform_device *pdev) 1711static int spacc_probe(struct platform_device *pdev)
1712{ 1712{
1713 int i, err, ret = -EINVAL; 1713 int i, err, ret = -EINVAL;
1714 struct resource *mem, *irq; 1714 struct resource *mem, *irq;
@@ -1841,7 +1841,7 @@ static int __devinit spacc_probe(struct platform_device *pdev)
1841 return ret; 1841 return ret;
1842} 1842}
1843 1843
1844static int __devexit spacc_remove(struct platform_device *pdev) 1844static int spacc_remove(struct platform_device *pdev)
1845{ 1845{
1846 struct spacc_alg *alg, *next; 1846 struct spacc_alg *alg, *next;
1847 struct spacc_engine *engine = platform_get_drvdata(pdev); 1847 struct spacc_engine *engine = platform_get_drvdata(pdev);
@@ -1868,7 +1868,7 @@ static const struct platform_device_id spacc_id_table[] = {
1868 1868
1869static struct platform_driver spacc_driver = { 1869static struct platform_driver spacc_driver = {
1870 .probe = spacc_probe, 1870 .probe = spacc_probe,
1871 .remove = __devexit_p(spacc_remove), 1871 .remove = spacc_remove,
1872 .driver = { 1872 .driver = {
1873 .name = "picochip,spacc", 1873 .name = "picochip,spacc",
1874#ifdef CONFIG_PM 1874#ifdef CONFIG_PM
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c
index eb32fd8cad1..85ea7525fa3 100644
--- a/drivers/crypto/tegra-aes.c
+++ b/drivers/crypto/tegra-aes.c
@@ -1047,7 +1047,7 @@ out:
1047 return err; 1047 return err;
1048} 1048}
1049 1049
1050static int __devexit tegra_aes_remove(struct platform_device *pdev) 1050static int tegra_aes_remove(struct platform_device *pdev)
1051{ 1051{
1052 struct device *dev = &pdev->dev; 1052 struct device *dev = &pdev->dev;
1053 struct tegra_aes_dev *dd = platform_get_drvdata(pdev); 1053 struct tegra_aes_dev *dd = platform_get_drvdata(pdev);
@@ -1074,7 +1074,7 @@ static int __devexit tegra_aes_remove(struct platform_device *pdev)
1074 return 0; 1074 return 0;
1075} 1075}
1076 1076
1077static struct of_device_id tegra_aes_of_match[] __devinitdata = { 1077static struct of_device_id tegra_aes_of_match[] = {
1078 { .compatible = "nvidia,tegra20-aes", }, 1078 { .compatible = "nvidia,tegra20-aes", },
1079 { .compatible = "nvidia,tegra30-aes", }, 1079 { .compatible = "nvidia,tegra30-aes", },
1080 { }, 1080 { },
@@ -1082,7 +1082,7 @@ static struct of_device_id tegra_aes_of_match[] __devinitdata = {
1082 1082
1083static struct platform_driver tegra_aes_driver = { 1083static struct platform_driver tegra_aes_driver = {
1084 .probe = tegra_aes_probe, 1084 .probe = tegra_aes_probe,
1085 .remove = __devexit_p(tegra_aes_remove), 1085 .remove = tegra_aes_remove,
1086 .driver = { 1086 .driver = {
1087 .name = "tegra-aes", 1087 .name = "tegra-aes",
1088 .owner = THIS_MODULE, 1088 .owner = THIS_MODULE,
diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c
index 74183720871..80c745e8308 100644
--- a/drivers/devfreq/exynos4_bus.c
+++ b/drivers/devfreq/exynos4_bus.c
@@ -980,7 +980,7 @@ unlock:
980 return NOTIFY_DONE; 980 return NOTIFY_DONE;
981} 981}
982 982
983static __devinit int exynos4_busfreq_probe(struct platform_device *pdev) 983static int exynos4_busfreq_probe(struct platform_device *pdev)
984{ 984{
985 struct busfreq_data *data; 985 struct busfreq_data *data;
986 struct opp *opp; 986 struct opp *opp;
@@ -1056,7 +1056,7 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
1056 return 0; 1056 return 0;
1057} 1057}
1058 1058
1059static __devexit int exynos4_busfreq_remove(struct platform_device *pdev) 1059static int exynos4_busfreq_remove(struct platform_device *pdev)
1060{ 1060{
1061 struct busfreq_data *data = platform_get_drvdata(pdev); 1061 struct busfreq_data *data = platform_get_drvdata(pdev);
1062 1062
@@ -1087,7 +1087,7 @@ static const struct platform_device_id exynos4_busfreq_id[] = {
1087 1087
1088static struct platform_driver exynos4_busfreq_driver = { 1088static struct platform_driver exynos4_busfreq_driver = {
1089 .probe = exynos4_busfreq_probe, 1089 .probe = exynos4_busfreq_probe,
1090 .remove = __devexit_p(exynos4_busfreq_remove), 1090 .remove = exynos4_busfreq_remove,
1091 .id_table = exynos4_busfreq_id, 1091 .id_table = exynos4_busfreq_id,
1092 .driver = { 1092 .driver = {
1093 .name = "exynos4-busfreq", 1093 .name = "exynos4-busfreq",
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 8f0b111af4d..3e8ba02ba29 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1634,7 +1634,7 @@ static int dw_probe(struct platform_device *pdev)
1634 return 0; 1634 return 0;
1635} 1635}
1636 1636
1637static int __devexit dw_remove(struct platform_device *pdev) 1637static int dw_remove(struct platform_device *pdev)
1638{ 1638{
1639 struct dw_dma *dw = platform_get_drvdata(pdev); 1639 struct dw_dma *dw = platform_get_drvdata(pdev);
1640 struct dw_dma_chan *dwc, *_dwc; 1640 struct dw_dma_chan *dwc, *_dwc;
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 232b4583ae9..f424298f1ac 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -585,7 +585,7 @@ err_reg1:
585 return ret; 585 return ret;
586} 586}
587 587
588static int __devexit edma_remove(struct platform_device *pdev) 588static int edma_remove(struct platform_device *pdev)
589{ 589{
590 struct device *dev = &pdev->dev; 590 struct device *dev = &pdev->dev;
591 struct edma_cc *ecc = dev_get_drvdata(dev); 591 struct edma_cc *ecc = dev_get_drvdata(dev);
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index bc764afacd9..a0de82e21a7 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -1308,7 +1308,7 @@ err_enable_device:
1308 * Free up all resources and data 1308 * Free up all resources and data
1309 * Call shutdown_dma to complete contoller and chan cleanup 1309 * Call shutdown_dma to complete contoller and chan cleanup
1310 */ 1310 */
1311static void __devexit intel_mid_dma_remove(struct pci_dev *pdev) 1311static void intel_mid_dma_remove(struct pci_dev *pdev)
1312{ 1312{
1313 struct middma_device *device = pci_get_drvdata(pdev); 1313 struct middma_device *device = pci_get_drvdata(pdev);
1314 1314
diff --git a/drivers/dma/ioat/dca.c b/drivers/dma/ioat/dca.c
index d6668071bd0..9b041858d10 100644
--- a/drivers/dma/ioat/dca.c
+++ b/drivers/dma/ioat/dca.c
@@ -242,8 +242,7 @@ static struct dca_ops ioat_dca_ops = {
242}; 242};
243 243
244 244
245struct dca_provider * __devinit 245struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
246ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
247{ 246{
248 struct dca_provider *dca; 247 struct dca_provider *dca;
249 struct ioat_dca_priv *ioatdca; 248 struct ioat_dca_priv *ioatdca;
@@ -408,8 +407,7 @@ static int ioat2_dca_count_dca_slots(void __iomem *iobase, u16 dca_offset)
408 return slots; 407 return slots;
409} 408}
410 409
411struct dca_provider * __devinit 410struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase)
412ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase)
413{ 411{
414 struct dca_provider *dca; 412 struct dca_provider *dca;
415 struct ioat_dca_priv *ioatdca; 413 struct ioat_dca_priv *ioatdca;
@@ -621,8 +619,7 @@ static inline int dca3_tag_map_invalid(u8 *tag_map)
621 (tag_map[4] == DCA_TAG_MAP_VALID)); 619 (tag_map[4] == DCA_TAG_MAP_VALID));
622} 620}
623 621
624struct dca_provider * __devinit 622struct dca_provider *ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase)
625ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase)
626{ 623{
627 struct dca_provider *dca; 624 struct dca_provider *dca;
628 struct ioat_dca_priv *ioatdca; 625 struct ioat_dca_priv *ioatdca;
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 73b2b65cb1d..1a68a8ba87e 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -782,7 +782,7 @@ static void ioat1_dma_start_null_desc(struct ioat_dma_chan *ioat)
782 */ 782 */
783#define IOAT_TEST_SIZE 2000 783#define IOAT_TEST_SIZE 2000
784 784
785static void __devinit ioat_dma_test_callback(void *dma_async_param) 785static void ioat_dma_test_callback(void *dma_async_param)
786{ 786{
787 struct completion *cmp = dma_async_param; 787 struct completion *cmp = dma_async_param;
788 788
@@ -793,7 +793,7 @@ static void __devinit ioat_dma_test_callback(void *dma_async_param)
793 * ioat_dma_self_test - Perform a IOAT transaction to verify the HW works. 793 * ioat_dma_self_test - Perform a IOAT transaction to verify the HW works.
794 * @device: device to be tested 794 * @device: device to be tested
795 */ 795 */
796int __devinit ioat_dma_self_test(struct ioatdma_device *device) 796int ioat_dma_self_test(struct ioatdma_device *device)
797{ 797{
798 int i; 798 int i;
799 u8 *src; 799 u8 *src;
@@ -994,7 +994,7 @@ static void ioat_disable_interrupts(struct ioatdma_device *device)
994 writeb(0, device->reg_base + IOAT_INTRCTRL_OFFSET); 994 writeb(0, device->reg_base + IOAT_INTRCTRL_OFFSET);
995} 995}
996 996
997int __devinit ioat_probe(struct ioatdma_device *device) 997int ioat_probe(struct ioatdma_device *device)
998{ 998{
999 int err = -ENODEV; 999 int err = -ENODEV;
1000 struct dma_device *dma = &device->common; 1000 struct dma_device *dma = &device->common;
@@ -1049,7 +1049,7 @@ err_dma_pool:
1049 return err; 1049 return err;
1050} 1050}
1051 1051
1052int __devinit ioat_register(struct ioatdma_device *device) 1052int ioat_register(struct ioatdma_device *device)
1053{ 1053{
1054 int err = dma_async_device_register(&device->common); 1054 int err = dma_async_device_register(&device->common);
1055 1055
@@ -1183,7 +1183,7 @@ void ioat_kobject_del(struct ioatdma_device *device)
1183 } 1183 }
1184} 1184}
1185 1185
1186int __devinit ioat1_dma_probe(struct ioatdma_device *device, int dca) 1186int ioat1_dma_probe(struct ioatdma_device *device, int dca)
1187{ 1187{
1188 struct pci_dev *pdev = device->pdev; 1188 struct pci_dev *pdev = device->pdev;
1189 struct dma_device *dma; 1189 struct dma_device *dma;
@@ -1216,7 +1216,7 @@ int __devinit ioat1_dma_probe(struct ioatdma_device *device, int dca)
1216 return err; 1216 return err;
1217} 1217}
1218 1218
1219void __devexit ioat_dma_remove(struct ioatdma_device *device) 1219void ioat_dma_remove(struct ioatdma_device *device)
1220{ 1220{
1221 struct dma_device *dma = &device->common; 1221 struct dma_device *dma = &device->common;
1222 1222
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 5e8fe01ba69..087935f1565 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -303,13 +303,12 @@ static inline void ioat_unmap(struct pci_dev *pdev, dma_addr_t addr, size_t len,
303 pci_unmap_page(pdev, addr, len, direction); 303 pci_unmap_page(pdev, addr, len, direction);
304} 304}
305 305
306int __devinit ioat_probe(struct ioatdma_device *device); 306int ioat_probe(struct ioatdma_device *device);
307int __devinit ioat_register(struct ioatdma_device *device); 307int ioat_register(struct ioatdma_device *device);
308int __devinit ioat1_dma_probe(struct ioatdma_device *dev, int dca); 308int ioat1_dma_probe(struct ioatdma_device *dev, int dca);
309int __devinit ioat_dma_self_test(struct ioatdma_device *device); 309int ioat_dma_self_test(struct ioatdma_device *device);
310void __devexit ioat_dma_remove(struct ioatdma_device *device); 310void ioat_dma_remove(struct ioatdma_device *device);
311struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev, 311struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase);
312 void __iomem *iobase);
313dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan); 312dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan);
314void ioat_init_channel(struct ioatdma_device *device, 313void ioat_init_channel(struct ioatdma_device *device,
315 struct ioat_chan_common *chan, int idx); 314 struct ioat_chan_common *chan, int idx);
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index b9d66785144..82d4e306c32 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -862,7 +862,7 @@ struct kobj_type ioat2_ktype = {
862 .default_attrs = ioat2_attrs, 862 .default_attrs = ioat2_attrs,
863}; 863};
864 864
865int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) 865int ioat2_dma_probe(struct ioatdma_device *device, int dca)
866{ 866{
867 struct pci_dev *pdev = device->pdev; 867 struct pci_dev *pdev = device->pdev;
868 struct dma_device *dma; 868 struct dma_device *dma;
diff --git a/drivers/dma/ioat/dma_v2.h b/drivers/dma/ioat/dma_v2.h
index be2a55b95c2..e100f644e34 100644
--- a/drivers/dma/ioat/dma_v2.h
+++ b/drivers/dma/ioat/dma_v2.h
@@ -155,10 +155,10 @@ static inline void ioat2_set_chainaddr(struct ioat2_dma_chan *ioat, u64 addr)
155 chan->reg_base + IOAT2_CHAINADDR_OFFSET_HIGH); 155 chan->reg_base + IOAT2_CHAINADDR_OFFSET_HIGH);
156} 156}
157 157
158int __devinit ioat2_dma_probe(struct ioatdma_device *dev, int dca); 158int ioat2_dma_probe(struct ioatdma_device *dev, int dca);
159int __devinit ioat3_dma_probe(struct ioatdma_device *dev, int dca); 159int ioat3_dma_probe(struct ioatdma_device *dev, int dca);
160struct dca_provider * __devinit ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase); 160struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase);
161struct dca_provider * __devinit ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase); 161struct dca_provider *ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase);
162int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs); 162int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs);
163int ioat2_enumerate_channels(struct ioatdma_device *device); 163int ioat2_enumerate_channels(struct ioatdma_device *device);
164struct dma_async_tx_descriptor * 164struct dma_async_tx_descriptor *
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
index f7f1dc62c15..e5fc944de1f 100644
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -836,7 +836,7 @@ ioat3_prep_interrupt_lock(struct dma_chan *c, unsigned long flags)
836 return &desc->txd; 836 return &desc->txd;
837} 837}
838 838
839static void __devinit ioat3_dma_test_callback(void *dma_async_param) 839static void ioat3_dma_test_callback(void *dma_async_param)
840{ 840{
841 struct completion *cmp = dma_async_param; 841 struct completion *cmp = dma_async_param;
842 842
@@ -844,7 +844,7 @@ static void __devinit ioat3_dma_test_callback(void *dma_async_param)
844} 844}
845 845
846#define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */ 846#define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */
847static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) 847static int ioat_xor_val_self_test(struct ioatdma_device *device)
848{ 848{
849 int i, src_idx; 849 int i, src_idx;
850 struct page *dest; 850 struct page *dest;
@@ -1096,7 +1096,7 @@ out:
1096 return err; 1096 return err;
1097} 1097}
1098 1098
1099static int __devinit ioat3_dma_self_test(struct ioatdma_device *device) 1099static int ioat3_dma_self_test(struct ioatdma_device *device)
1100{ 1100{
1101 int rc = ioat_dma_self_test(device); 1101 int rc = ioat_dma_self_test(device);
1102 1102
@@ -1187,7 +1187,7 @@ static bool is_snb_ioat(struct pci_dev *pdev)
1187 } 1187 }
1188} 1188}
1189 1189
1190int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca) 1190int ioat3_dma_probe(struct ioatdma_device *device, int dca)
1191{ 1191{
1192 struct pci_dev *pdev = device->pdev; 1192 struct pci_dev *pdev = device->pdev;
1193 int dca_en = system_has_dca_enabled(pdev); 1193 int dca_en = system_has_dca_enabled(pdev);
diff --git a/drivers/dma/ioat/pci.c b/drivers/dma/ioat/pci.c
index bfa9a3536e0..4f686c527ab 100644
--- a/drivers/dma/ioat/pci.c
+++ b/drivers/dma/ioat/pci.c
@@ -109,9 +109,8 @@ static struct pci_device_id ioat_pci_tbl[] = {
109}; 109};
110MODULE_DEVICE_TABLE(pci, ioat_pci_tbl); 110MODULE_DEVICE_TABLE(pci, ioat_pci_tbl);
111 111
112static int __devinit ioat_pci_probe(struct pci_dev *pdev, 112static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id);
113 const struct pci_device_id *id); 113static void ioat_remove(struct pci_dev *pdev);
114static void __devexit ioat_remove(struct pci_dev *pdev);
115 114
116static int ioat_dca_enabled = 1; 115static int ioat_dca_enabled = 1;
117module_param(ioat_dca_enabled, int, 0644); 116module_param(ioat_dca_enabled, int, 0644);
@@ -141,7 +140,7 @@ alloc_ioatdma(struct pci_dev *pdev, void __iomem *iobase)
141 return d; 140 return d;
142} 141}
143 142
144static int __devinit ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 143static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
145{ 144{
146 void __iomem * const *iomap; 145 void __iomem * const *iomap;
147 struct device *dev = &pdev->dev; 146 struct device *dev = &pdev->dev;
@@ -195,7 +194,7 @@ static int __devinit ioat_pci_probe(struct pci_dev *pdev, const struct pci_devic
195 return 0; 194 return 0;
196} 195}
197 196
198static void __devexit ioat_remove(struct pci_dev *pdev) 197static void ioat_remove(struct pci_dev *pdev)
199{ 198{
200 struct ioatdma_device *device = pci_get_drvdata(pdev); 199 struct ioatdma_device *device = pci_get_drvdata(pdev);
201 200
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index 9072e173b86..eacb8be9981 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -1406,7 +1406,7 @@ out:
1406} 1406}
1407#endif 1407#endif
1408 1408
1409static int __devexit iop_adma_remove(struct platform_device *dev) 1409static int iop_adma_remove(struct platform_device *dev)
1410{ 1410{
1411 struct iop_adma_device *device = platform_get_drvdata(dev); 1411 struct iop_adma_device *device = platform_get_drvdata(dev);
1412 struct dma_chan *chan, *_chan; 1412 struct dma_chan *chan, *_chan;
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 13bdf4a7e1e..c6d98c00f05 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -712,7 +712,7 @@ static void dma_do_tasklet(unsigned long data)
712 } 712 }
713} 713}
714 714
715static int __devexit mmp_pdma_remove(struct platform_device *op) 715static int mmp_pdma_remove(struct platform_device *op)
716{ 716{
717 struct mmp_pdma_device *pdev = platform_get_drvdata(op); 717 struct mmp_pdma_device *pdev = platform_get_drvdata(op);
718 718
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 323821c0c09..a9f1cd56689 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -467,7 +467,7 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
467 mmp_tdma_enable_chan(tdmac); 467 mmp_tdma_enable_chan(tdmac);
468} 468}
469 469
470static int __devexit mmp_tdma_remove(struct platform_device *pdev) 470static int mmp_tdma_remove(struct platform_device *pdev)
471{ 471{
472 struct mmp_tdma_device *tdev = platform_get_drvdata(pdev); 472 struct mmp_tdma_device *tdev = platform_get_drvdata(pdev);
473 473
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 2cd024a91d4..2d956732aa3 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -799,7 +799,7 @@ static int mpc_dma_probe(struct platform_device *op)
799 return retval; 799 return retval;
800} 800}
801 801
802static int __devexit mpc_dma_remove(struct platform_device *op) 802static int mpc_dma_remove(struct platform_device *op)
803{ 803{
804 struct device *dev = &op->dev; 804 struct device *dev = &op->dev;
805 struct mpc_dma *mdma = dev_get_drvdata(dev); 805 struct mpc_dma *mdma = dev_get_drvdata(dev);
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index ac71f555dd7..e17fad03cb8 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1361,13 +1361,16 @@ static int mv_xor_probe(struct platform_device *pdev)
1361err_channel_add: 1361err_channel_add:
1362 for (i = 0; i < MV_XOR_MAX_CHANNELS; i++) 1362 for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
1363 if (xordev->channels[i]) { 1363 if (xordev->channels[i]) {
1364 mv_xor_channel_remove(xordev->channels[i]);
1364 if (pdev->dev.of_node) 1365 if (pdev->dev.of_node)
1365 irq_dispose_mapping(xordev->channels[i]->irq); 1366 irq_dispose_mapping(xordev->channels[i]->irq);
1366 mv_xor_channel_remove(xordev->channels[i]);
1367 } 1367 }
1368 1368
1369 clk_disable_unprepare(xordev->clk); 1369 if (!IS_ERR(xordev->clk)) {
1370 clk_put(xordev->clk); 1370 clk_disable_unprepare(xordev->clk);
1371 clk_put(xordev->clk);
1372 }
1373
1371 return ret; 1374 return ret;
1372} 1375}
1373 1376
diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index eca1c4ddf03..3f2617255ef 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -961,7 +961,7 @@ err_free_mem:
961 return err; 961 return err;
962} 962}
963 963
964static void __devexit pch_dma_remove(struct pci_dev *pdev) 964static void pch_dma_remove(struct pci_dev *pdev)
965{ 965{
966 struct pch_dma *pd = pci_get_drvdata(pdev); 966 struct pch_dma *pd = pci_get_drvdata(pdev);
967 struct pch_dma_chan *pd_chan; 967 struct pch_dma_chan *pd_chan;
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 95555f37ea6..80680eee017 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2988,7 +2988,7 @@ probe_err1:
2988 return ret; 2988 return ret;
2989} 2989}
2990 2990
2991static int __devexit pl330_remove(struct amba_device *adev) 2991static int pl330_remove(struct amba_device *adev)
2992{ 2992{
2993 struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev); 2993 struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev);
2994 struct dma_pl330_chan *pch, *_p; 2994 struct dma_pl330_chan *pch, *_p;
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index b94afc339e7..5d3d95569a1 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4592,7 +4592,7 @@ out:
4592/** 4592/**
4593 * ppc440spe_adma_remove - remove the asynch device 4593 * ppc440spe_adma_remove - remove the asynch device
4594 */ 4594 */
4595static int __devexit ppc440spe_adma_remove(struct platform_device *ofdev) 4595static int ppc440spe_adma_remove(struct platform_device *ofdev)
4596{ 4596{
4597 struct ppc440spe_adma_device *adev = dev_get_drvdata(&ofdev->dev); 4597 struct ppc440spe_adma_device *adev = dev_get_drvdata(&ofdev->dev);
4598 struct device_node *np = ofdev->dev.of_node; 4598 struct device_node *np = ofdev->dev.of_node;
@@ -4905,7 +4905,7 @@ out_free:
4905 return ret; 4905 return ret;
4906} 4906}
4907 4907
4908static const struct of_device_id ppc440spe_adma_of_match[] __devinitconst = { 4908static const struct of_device_id ppc440spe_adma_of_match[] = {
4909 { .compatible = "ibm,dma-440spe", }, 4909 { .compatible = "ibm,dma-440spe", },
4910 { .compatible = "amcc,xor-accelerator", }, 4910 { .compatible = "amcc,xor-accelerator", },
4911 {}, 4911 {},
diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index 2ad628df822..461a91ab70b 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -967,7 +967,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev)
967 return ret; 967 return ret;
968} 968}
969 969
970static int __devexit sa11x0_dma_remove(struct platform_device *pdev) 970static int sa11x0_dma_remove(struct platform_device *pdev)
971{ 971{
972 struct sa11x0_dma_dev *d = platform_get_drvdata(pdev); 972 struct sa11x0_dma_dev *d = platform_get_drvdata(pdev);
973 unsigned pch; 973 unsigned pch;
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c
index 8201bb4e0cd..3315e4be9b8 100644
--- a/drivers/dma/sh/shdma.c
+++ b/drivers/dma/sh/shdma.c
@@ -880,7 +880,7 @@ ermrdmars:
880 return err; 880 return err;
881} 881}
882 882
883static int __devexit sh_dmae_remove(struct platform_device *pdev) 883static int sh_dmae_remove(struct platform_device *pdev)
884{ 884{
885 struct sh_dmae_device *shdev = platform_get_drvdata(pdev); 885 struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
886 struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev; 886 struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index c3de6edb965..94674a96c64 100644
--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -655,7 +655,7 @@ irq_dispose:
655 return ret; 655 return ret;
656} 656}
657 657
658static int __devexit sirfsoc_dma_remove(struct platform_device *op) 658static int sirfsoc_dma_remove(struct platform_device *op)
659{ 659{
660 struct device *dev = &op->dev; 660 struct device *dev = &op->dev;
661 struct sirfsoc_dma *sdma = dev_get_drvdata(dev); 661 struct sirfsoc_dma *sdma = dev_get_drvdata(dev);
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index efdfffa1334..c39e61bc817 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1184,7 +1184,7 @@ static const struct tegra_dma_chip_data tegra30_dma_chip_data = {
1184 .max_dma_count = 1024UL * 64, 1184 .max_dma_count = 1024UL * 64,
1185}; 1185};
1186 1186
1187static const struct of_device_id tegra_dma_of_match[] __devinitconst = { 1187static const struct of_device_id tegra_dma_of_match[] = {
1188 { 1188 {
1189 .compatible = "nvidia,tegra30-apbdma", 1189 .compatible = "nvidia,tegra30-apbdma",
1190 .data = &tegra30_dma_chip_data, 1190 .data = &tegra30_dma_chip_data,
@@ -1360,7 +1360,7 @@ err_pm_disable:
1360 return ret; 1360 return ret;
1361} 1361}
1362 1362
1363static int __devexit tegra_dma_remove(struct platform_device *pdev) 1363static int tegra_dma_remove(struct platform_device *pdev)
1364{ 1364{
1365 struct tegra_dma *tdma = platform_get_drvdata(pdev); 1365 struct tegra_dma *tdma = platform_get_drvdata(pdev);
1366 int i; 1366 int i;
@@ -1403,7 +1403,7 @@ static int tegra_dma_runtime_resume(struct device *dev)
1403 return 0; 1403 return 0;
1404} 1404}
1405 1405
1406static const struct dev_pm_ops tegra_dma_dev_pm_ops __devinitconst = { 1406static const struct dev_pm_ops tegra_dma_dev_pm_ops = {
1407#ifdef CONFIG_PM_RUNTIME 1407#ifdef CONFIG_PM_RUNTIME
1408 .runtime_suspend = tegra_dma_runtime_suspend, 1408 .runtime_suspend = tegra_dma_runtime_suspend,
1409 .runtime_resume = tegra_dma_runtime_resume, 1409 .runtime_resume = tegra_dma_runtime_resume,
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 98cf51e1544..952f823901a 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -798,7 +798,7 @@ err_release_region:
798 798
799} 799}
800 800
801static int __devexit td_remove(struct platform_device *pdev) 801static int td_remove(struct platform_device *pdev)
802{ 802{
803 struct timb_dma *td = platform_get_drvdata(pdev); 803 struct timb_dma *td = platform_get_drvdata(pdev);
804 struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 804 struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index 4c6c876d9dc..66719925970 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -4,6 +4,9 @@
4# Licensed and distributed under the GPL 4# Licensed and distributed under the GPL
5# 5#
6 6
7config EDAC_SUPPORT
8 bool
9
7menuconfig EDAC 10menuconfig EDAC
8 bool "EDAC (Error Detection And Correction) reporting" 11 bool "EDAC (Error Detection And Correction) reporting"
9 depends on HAS_IOMEM 12 depends on HAS_IOMEM
@@ -27,13 +30,8 @@ menuconfig EDAC
27 There is also a mailing list for the EDAC project, which can 30 There is also a mailing list for the EDAC project, which can
28 be found via the sourceforge page. 31 be found via the sourceforge page.
29 32
30config EDAC_SUPPORT
31 bool
32
33if EDAC 33if EDAC
34 34
35comment "Reporting subsystems"
36
37config EDAC_LEGACY_SYSFS 35config EDAC_LEGACY_SYSFS
38 bool "EDAC legacy sysfs" 36 bool "EDAC legacy sysfs"
39 default y 37 default y
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index f74a684269f..ad8bf2aa629 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2563,8 +2563,8 @@ err_ret:
2563 return ret; 2563 return ret;
2564} 2564}
2565 2565
2566static int __devinit amd64_probe_one_instance(struct pci_dev *pdev, 2566static int amd64_probe_one_instance(struct pci_dev *pdev,
2567 const struct pci_device_id *mc_type) 2567 const struct pci_device_id *mc_type)
2568{ 2568{
2569 u8 nid = get_node_id(pdev); 2569 u8 nid = get_node_id(pdev);
2570 struct pci_dev *F3 = node_to_amd_nb(nid)->misc; 2570 struct pci_dev *F3 = node_to_amd_nb(nid)->misc;
@@ -2612,7 +2612,7 @@ err_out:
2612 return ret; 2612 return ret;
2613} 2613}
2614 2614
2615static void __devexit amd64_remove_one_instance(struct pci_dev *pdev) 2615static void amd64_remove_one_instance(struct pci_dev *pdev)
2616{ 2616{
2617 struct mem_ctl_info *mci; 2617 struct mem_ctl_info *mci;
2618 struct amd64_pvt *pvt; 2618 struct amd64_pvt *pvt;
@@ -2686,7 +2686,7 @@ MODULE_DEVICE_TABLE(pci, amd64_pci_table);
2686static struct pci_driver amd64_pci_driver = { 2686static struct pci_driver amd64_pci_driver = {
2687 .name = EDAC_MOD_STR, 2687 .name = EDAC_MOD_STR,
2688 .probe = amd64_probe_one_instance, 2688 .probe = amd64_probe_one_instance,
2689 .remove = __devexit_p(amd64_remove_one_instance), 2689 .remove = amd64_remove_one_instance,
2690 .id_table = amd64_pci_table, 2690 .id_table = amd64_pci_table,
2691}; 2691};
2692 2692
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index 29eeb68a200..96e3ee3460a 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -301,8 +301,8 @@ fail:
301} 301}
302 302
303/* returns count (>= 0), or negative on error */ 303/* returns count (>= 0), or negative on error */
304static int __devinit amd76x_init_one(struct pci_dev *pdev, 304static int amd76x_init_one(struct pci_dev *pdev,
305 const struct pci_device_id *ent) 305 const struct pci_device_id *ent)
306{ 306{
307 edac_dbg(0, "\n"); 307 edac_dbg(0, "\n");
308 308
@@ -318,7 +318,7 @@ static int __devinit amd76x_init_one(struct pci_dev *pdev,
318 * structure for the device then delete the mci and free the 318 * structure for the device then delete the mci and free the
319 * resources. 319 * resources.
320 */ 320 */
321static void __devexit amd76x_remove_one(struct pci_dev *pdev) 321static void amd76x_remove_one(struct pci_dev *pdev)
322{ 322{
323 struct mem_ctl_info *mci; 323 struct mem_ctl_info *mci;
324 324
@@ -350,7 +350,7 @@ MODULE_DEVICE_TABLE(pci, amd76x_pci_tbl);
350static struct pci_driver amd76x_driver = { 350static struct pci_driver amd76x_driver = {
351 .name = EDAC_MOD_STR, 351 .name = EDAC_MOD_STR,
352 .probe = amd76x_init_one, 352 .probe = amd76x_init_one,
353 .remove = __devexit_p(amd76x_remove_one), 353 .remove = amd76x_remove_one,
354 .id_table = amd76x_pci_tbl, 354 .id_table = amd76x_pci_tbl,
355}; 355};
356 356
diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c
index a1bbd8edd25..c2eaf334b90 100644
--- a/drivers/edac/cell_edac.c
+++ b/drivers/edac/cell_edac.c
@@ -124,7 +124,7 @@ static void cell_edac_check(struct mem_ctl_info *mci)
124 } 124 }
125} 125}
126 126
127static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci) 127static void cell_edac_init_csrows(struct mem_ctl_info *mci)
128{ 128{
129 struct csrow_info *csrow = mci->csrows[0]; 129 struct csrow_info *csrow = mci->csrows[0];
130 struct dimm_info *dimm; 130 struct dimm_info *dimm;
@@ -164,7 +164,7 @@ static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci)
164 } 164 }
165} 165}
166 166
167static int __devinit cell_edac_probe(struct platform_device *pdev) 167static int cell_edac_probe(struct platform_device *pdev)
168{ 168{
169 struct cbe_mic_tm_regs __iomem *regs; 169 struct cbe_mic_tm_regs __iomem *regs;
170 struct mem_ctl_info *mci; 170 struct mem_ctl_info *mci;
@@ -233,7 +233,7 @@ static int __devinit cell_edac_probe(struct platform_device *pdev)
233 return 0; 233 return 0;
234} 234}
235 235
236static int __devexit cell_edac_remove(struct platform_device *pdev) 236static int cell_edac_remove(struct platform_device *pdev)
237{ 237{
238 struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev); 238 struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev);
239 if (mci) 239 if (mci)
@@ -247,7 +247,7 @@ static struct platform_driver cell_edac_driver = {
247 .owner = THIS_MODULE, 247 .owner = THIS_MODULE,
248 }, 248 },
249 .probe = cell_edac_probe, 249 .probe = cell_edac_probe,
250 .remove = __devexit_p(cell_edac_remove), 250 .remove = cell_edac_remove,
251}; 251};
252 252
253static int __init cell_edac_init(void) 253static int __init cell_edac_init(void)
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index c2ef1349587..7f3c57113ba 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -932,7 +932,7 @@ static int cpc925_mc_get_channels(void __iomem *vbase)
932 return dual; 932 return dual;
933} 933}
934 934
935static int __devinit cpc925_probe(struct platform_device *pdev) 935static int cpc925_probe(struct platform_device *pdev)
936{ 936{
937 static int edac_mc_idx; 937 static int edac_mc_idx;
938 struct mem_ctl_info *mci; 938 struct mem_ctl_info *mci;
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index a5ed6b795fd..644fec54681 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1390,8 +1390,7 @@ fail:
1390} 1390}
1391 1391
1392/* returns count (>= 0), or negative on error */ 1392/* returns count (>= 0), or negative on error */
1393static int __devinit e752x_init_one(struct pci_dev *pdev, 1393static int e752x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1394 const struct pci_device_id *ent)
1395{ 1394{
1396 edac_dbg(0, "\n"); 1395 edac_dbg(0, "\n");
1397 1396
@@ -1402,7 +1401,7 @@ static int __devinit e752x_init_one(struct pci_dev *pdev,
1402 return e752x_probe1(pdev, ent->driver_data); 1401 return e752x_probe1(pdev, ent->driver_data);
1403} 1402}
1404 1403
1405static void __devexit e752x_remove_one(struct pci_dev *pdev) 1404static void e752x_remove_one(struct pci_dev *pdev)
1406{ 1405{
1407 struct mem_ctl_info *mci; 1406 struct mem_ctl_info *mci;
1408 struct e752x_pvt *pvt; 1407 struct e752x_pvt *pvt;
@@ -1445,7 +1444,7 @@ MODULE_DEVICE_TABLE(pci, e752x_pci_tbl);
1445static struct pci_driver e752x_driver = { 1444static struct pci_driver e752x_driver = {
1446 .name = EDAC_MOD_STR, 1445 .name = EDAC_MOD_STR,
1447 .probe = e752x_init_one, 1446 .probe = e752x_init_one,
1448 .remove = __devexit_p(e752x_remove_one), 1447 .remove = e752x_remove_one,
1449 .id_table = e752x_pci_tbl, 1448 .id_table = e752x_pci_tbl,
1450}; 1449};
1451 1450
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index 9ff57f361a4..1c4056a5038 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -528,8 +528,7 @@ fail0:
528} 528}
529 529
530/* returns count (>= 0), or negative on error */ 530/* returns count (>= 0), or negative on error */
531static int __devinit e7xxx_init_one(struct pci_dev *pdev, 531static int e7xxx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
532 const struct pci_device_id *ent)
533{ 532{
534 edac_dbg(0, "\n"); 533 edac_dbg(0, "\n");
535 534
@@ -538,7 +537,7 @@ static int __devinit e7xxx_init_one(struct pci_dev *pdev,
538 -EIO : e7xxx_probe1(pdev, ent->driver_data); 537 -EIO : e7xxx_probe1(pdev, ent->driver_data);
539} 538}
540 539
541static void __devexit e7xxx_remove_one(struct pci_dev *pdev) 540static void e7xxx_remove_one(struct pci_dev *pdev)
542{ 541{
543 struct mem_ctl_info *mci; 542 struct mem_ctl_info *mci;
544 struct e7xxx_pvt *pvt; 543 struct e7xxx_pvt *pvt;
@@ -579,7 +578,7 @@ MODULE_DEVICE_TABLE(pci, e7xxx_pci_tbl);
579static struct pci_driver e7xxx_driver = { 578static struct pci_driver e7xxx_driver = {
580 .name = EDAC_MOD_STR, 579 .name = EDAC_MOD_STR,
581 .probe = e7xxx_init_one, 580 .probe = e7xxx_init_one,
582 .remove = __devexit_p(e7xxx_remove_one), 581 .remove = e7xxx_remove_one,
583 .id_table = e7xxx_pci_tbl, 582 .id_table = e7xxx_pci_tbl,
584}; 583};
585 584
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index de2df92f9c7..0ca1ca71157 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -472,8 +472,7 @@ static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
472 device_remove_file(&csrow->dev, 472 device_remove_file(&csrow->dev,
473 dynamic_csrow_ce_count_attr[chan]); 473 dynamic_csrow_ce_count_attr[chan]);
474 } 474 }
475 put_device(&mci->csrows[i]->dev); 475 device_unregister(&mci->csrows[i]->dev);
476 device_del(&mci->csrows[i]->dev);
477 } 476 }
478} 477}
479#endif 478#endif
@@ -1055,11 +1054,9 @@ fail:
1055 struct dimm_info *dimm = mci->dimms[i]; 1054 struct dimm_info *dimm = mci->dimms[i];
1056 if (dimm->nr_pages == 0) 1055 if (dimm->nr_pages == 0)
1057 continue; 1056 continue;
1058 put_device(&dimm->dev); 1057 device_unregister(&dimm->dev);
1059 device_del(&dimm->dev);
1060 } 1058 }
1061 put_device(&mci->dev); 1059 device_unregister(&mci->dev);
1062 device_del(&mci->dev);
1063 bus_unregister(&mci->bus); 1060 bus_unregister(&mci->bus);
1064 kfree(mci->bus.name); 1061 kfree(mci->bus.name);
1065 return err; 1062 return err;
@@ -1086,16 +1083,14 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1086 if (dimm->nr_pages == 0) 1083 if (dimm->nr_pages == 0)
1087 continue; 1084 continue;
1088 edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev)); 1085 edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev));
1089 put_device(&dimm->dev); 1086 device_unregister(&dimm->dev);
1090 device_del(&dimm->dev);
1091 } 1087 }
1092} 1088}
1093 1089
1094void edac_unregister_sysfs(struct mem_ctl_info *mci) 1090void edac_unregister_sysfs(struct mem_ctl_info *mci)
1095{ 1091{
1096 edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev)); 1092 edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
1097 put_device(&mci->dev); 1093 device_unregister(&mci->dev);
1098 device_del(&mci->dev);
1099 bus_unregister(&mci->bus); 1094 bus_unregister(&mci->bus);
1100 kfree(mci->bus.name); 1095 kfree(mci->bus.name);
1101} 1096}
@@ -1159,8 +1154,6 @@ int __init edac_mc_sysfs_init(void)
1159 1154
1160void __exit edac_mc_sysfs_exit(void) 1155void __exit edac_mc_sysfs_exit(void)
1161{ 1156{
1162 put_device(mci_pdev); 1157 device_unregister(mci_pdev);
1163 device_del(mci_pdev);
1164 edac_put_sysfs_subsys(); 1158 edac_put_sysfs_subsys();
1165 kfree(mci_pdev);
1166} 1159}
diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c
index e599b00c05a..c2bd8c6a434 100644
--- a/drivers/edac/highbank_l2_edac.c
+++ b/drivers/edac/highbank_l2_edac.c
@@ -50,7 +50,7 @@ static irqreturn_t highbank_l2_err_handler(int irq, void *dev_id)
50 return IRQ_HANDLED; 50 return IRQ_HANDLED;
51} 51}
52 52
53static int __devinit highbank_l2_err_probe(struct platform_device *pdev) 53static int highbank_l2_err_probe(struct platform_device *pdev)
54{ 54{
55 struct edac_device_ctl_info *dci; 55 struct edac_device_ctl_info *dci;
56 struct hb_l2_drvdata *drvdata; 56 struct hb_l2_drvdata *drvdata;
diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c
index 7ea4cc2e8bd..4695dd2d71f 100644
--- a/drivers/edac/highbank_mc_edac.c
+++ b/drivers/edac/highbank_mc_edac.c
@@ -119,7 +119,7 @@ static const struct file_operations highbank_mc_debug_inject_fops = {
119 .llseek = generic_file_llseek, 119 .llseek = generic_file_llseek,
120}; 120};
121 121
122static void __devinit highbank_mc_create_debugfs_nodes(struct mem_ctl_info *mci) 122static void highbank_mc_create_debugfs_nodes(struct mem_ctl_info *mci)
123{ 123{
124 if (mci->debugfs) 124 if (mci->debugfs)
125 debugfs_create_file("inject_ctrl", S_IWUSR, mci->debugfs, mci, 125 debugfs_create_file("inject_ctrl", S_IWUSR, mci->debugfs, mci,
@@ -127,11 +127,11 @@ static void __devinit highbank_mc_create_debugfs_nodes(struct mem_ctl_info *mci)
127; 127;
128} 128}
129#else 129#else
130static void __devinit highbank_mc_create_debugfs_nodes(struct mem_ctl_info *mci) 130static void highbank_mc_create_debugfs_nodes(struct mem_ctl_info *mci)
131{} 131{}
132#endif 132#endif
133 133
134static int __devinit highbank_mc_probe(struct platform_device *pdev) 134static int highbank_mc_probe(struct platform_device *pdev)
135{ 135{
136 struct edac_mc_layer layers[2]; 136 struct edac_mc_layer layers[2];
137 struct mem_ctl_info *mci; 137 struct mem_ctl_info *mci;
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
index d3d19cc4e9a..694efcbf19c 100644
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -455,8 +455,7 @@ fail:
455} 455}
456 456
457/* returns count (>= 0), or negative on error */ 457/* returns count (>= 0), or negative on error */
458static int __devinit i3000_init_one(struct pci_dev *pdev, 458static int i3000_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
459 const struct pci_device_id *ent)
460{ 459{
461 int rc; 460 int rc;
462 461
@@ -472,7 +471,7 @@ static int __devinit i3000_init_one(struct pci_dev *pdev,
472 return rc; 471 return rc;
473} 472}
474 473
475static void __devexit i3000_remove_one(struct pci_dev *pdev) 474static void i3000_remove_one(struct pci_dev *pdev)
476{ 475{
477 struct mem_ctl_info *mci; 476 struct mem_ctl_info *mci;
478 477
@@ -502,7 +501,7 @@ MODULE_DEVICE_TABLE(pci, i3000_pci_tbl);
502static struct pci_driver i3000_driver = { 501static struct pci_driver i3000_driver = {
503 .name = EDAC_MOD_STR, 502 .name = EDAC_MOD_STR,
504 .probe = i3000_init_one, 503 .probe = i3000_init_one,
505 .remove = __devexit_p(i3000_remove_one), 504 .remove = i3000_remove_one,
506 .id_table = i3000_pci_tbl, 505 .id_table = i3000_pci_tbl,
507}; 506};
508 507
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
index b6653a6fc5d..4e8337602e7 100644
--- a/drivers/edac/i3200_edac.c
+++ b/drivers/edac/i3200_edac.c
@@ -419,8 +419,7 @@ fail:
419 return rc; 419 return rc;
420} 420}
421 421
422static int __devinit i3200_init_one(struct pci_dev *pdev, 422static int i3200_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
423 const struct pci_device_id *ent)
424{ 423{
425 int rc; 424 int rc;
426 425
@@ -436,7 +435,7 @@ static int __devinit i3200_init_one(struct pci_dev *pdev,
436 return rc; 435 return rc;
437} 436}
438 437
439static void __devexit i3200_remove_one(struct pci_dev *pdev) 438static void i3200_remove_one(struct pci_dev *pdev)
440{ 439{
441 struct mem_ctl_info *mci; 440 struct mem_ctl_info *mci;
442 struct i3200_priv *priv; 441 struct i3200_priv *priv;
@@ -467,7 +466,7 @@ MODULE_DEVICE_TABLE(pci, i3200_pci_tbl);
467static struct pci_driver i3200_driver = { 466static struct pci_driver i3200_driver = {
468 .name = EDAC_MOD_STR, 467 .name = EDAC_MOD_STR,
469 .probe = i3200_init_one, 468 .probe = i3200_init_one,
470 .remove = __devexit_p(i3200_remove_one), 469 .remove = i3200_remove_one,
471 .id_table = i3200_pci_tbl, 470 .id_table = i3200_pci_tbl,
472}; 471};
473 472
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
index 6a49dd00b81..63b2194e8c2 100644
--- a/drivers/edac/i5000_edac.c
+++ b/drivers/edac/i5000_edac.c
@@ -1489,8 +1489,7 @@ fail0:
1489 * negative on error 1489 * negative on error
1490 * count (>= 0) 1490 * count (>= 0)
1491 */ 1491 */
1492static int __devinit i5000_init_one(struct pci_dev *pdev, 1492static int i5000_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1493 const struct pci_device_id *id)
1494{ 1493{
1495 int rc; 1494 int rc;
1496 1495
@@ -1509,7 +1508,7 @@ static int __devinit i5000_init_one(struct pci_dev *pdev,
1509 * i5000_remove_one destructor for one instance of device 1508 * i5000_remove_one destructor for one instance of device
1510 * 1509 *
1511 */ 1510 */
1512static void __devexit i5000_remove_one(struct pci_dev *pdev) 1511static void i5000_remove_one(struct pci_dev *pdev)
1513{ 1512{
1514 struct mem_ctl_info *mci; 1513 struct mem_ctl_info *mci;
1515 1514
@@ -1547,7 +1546,7 @@ MODULE_DEVICE_TABLE(pci, i5000_pci_tbl);
1547static struct pci_driver i5000_driver = { 1546static struct pci_driver i5000_driver = {
1548 .name = KBUILD_BASENAME, 1547 .name = KBUILD_BASENAME,
1549 .probe = i5000_init_one, 1548 .probe = i5000_init_one,
1550 .remove = __devexit_p(i5000_remove_one), 1549 .remove = i5000_remove_one,
1551 .id_table = i5000_pci_tbl, 1550 .id_table = i5000_pci_tbl,
1552}; 1551};
1553 1552
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index c4b5e5f868e..d6955b2cc99 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -638,8 +638,7 @@ static struct pci_dev *pci_get_device_func(unsigned vendor,
638 return ret; 638 return ret;
639} 639}
640 640
641static unsigned long __devinit i5100_npages(struct mem_ctl_info *mci, 641static unsigned long i5100_npages(struct mem_ctl_info *mci, int csrow)
642 int csrow)
643{ 642{
644 struct i5100_priv *priv = mci->pvt_info; 643 struct i5100_priv *priv = mci->pvt_info;
645 const unsigned chan_rank = i5100_csrow_to_rank(mci, csrow); 644 const unsigned chan_rank = i5100_csrow_to_rank(mci, csrow);
@@ -660,7 +659,7 @@ static unsigned long __devinit i5100_npages(struct mem_ctl_info *mci,
660 ((unsigned long long) (1ULL << addr_lines) / PAGE_SIZE); 659 ((unsigned long long) (1ULL << addr_lines) / PAGE_SIZE);
661} 660}
662 661
663static void __devinit i5100_init_mtr(struct mem_ctl_info *mci) 662static void i5100_init_mtr(struct mem_ctl_info *mci)
664{ 663{
665 struct i5100_priv *priv = mci->pvt_info; 664 struct i5100_priv *priv = mci->pvt_info;
666 struct pci_dev *mms[2] = { priv->ch0mm, priv->ch1mm }; 665 struct pci_dev *mms[2] = { priv->ch0mm, priv->ch1mm };
@@ -732,7 +731,7 @@ static int i5100_read_spd_byte(const struct mem_ctl_info *mci,
732 * o not the only way to may chip selects to dimm slots 731 * o not the only way to may chip selects to dimm slots
733 * o investigate if there is some way to obtain this map from the bios 732 * o investigate if there is some way to obtain this map from the bios
734 */ 733 */
735static void __devinit i5100_init_dimm_csmap(struct mem_ctl_info *mci) 734static void i5100_init_dimm_csmap(struct mem_ctl_info *mci)
736{ 735{
737 struct i5100_priv *priv = mci->pvt_info; 736 struct i5100_priv *priv = mci->pvt_info;
738 int i; 737 int i;
@@ -762,8 +761,8 @@ static void __devinit i5100_init_dimm_csmap(struct mem_ctl_info *mci)
762 } 761 }
763} 762}
764 763
765static void __devinit i5100_init_dimm_layout(struct pci_dev *pdev, 764static void i5100_init_dimm_layout(struct pci_dev *pdev,
766 struct mem_ctl_info *mci) 765 struct mem_ctl_info *mci)
767{ 766{
768 struct i5100_priv *priv = mci->pvt_info; 767 struct i5100_priv *priv = mci->pvt_info;
769 int i; 768 int i;
@@ -784,8 +783,8 @@ static void __devinit i5100_init_dimm_layout(struct pci_dev *pdev,
784 i5100_init_dimm_csmap(mci); 783 i5100_init_dimm_csmap(mci);
785} 784}
786 785
787static void __devinit i5100_init_interleaving(struct pci_dev *pdev, 786static void i5100_init_interleaving(struct pci_dev *pdev,
788 struct mem_ctl_info *mci) 787 struct mem_ctl_info *mci)
789{ 788{
790 u16 w; 789 u16 w;
791 u32 dw; 790 u32 dw;
@@ -830,7 +829,7 @@ static void __devinit i5100_init_interleaving(struct pci_dev *pdev,
830 i5100_init_mtr(mci); 829 i5100_init_mtr(mci);
831} 830}
832 831
833static void __devinit i5100_init_csrows(struct mem_ctl_info *mci) 832static void i5100_init_csrows(struct mem_ctl_info *mci)
834{ 833{
835 int i; 834 int i;
836 struct i5100_priv *priv = mci->pvt_info; 835 struct i5100_priv *priv = mci->pvt_info;
@@ -864,8 +863,7 @@ static void __devinit i5100_init_csrows(struct mem_ctl_info *mci)
864 } 863 }
865} 864}
866 865
867static int __devinit i5100_init_one(struct pci_dev *pdev, 866static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
868 const struct pci_device_id *id)
869{ 867{
870 int rc; 868 int rc;
871 struct mem_ctl_info *mci; 869 struct mem_ctl_info *mci;
@@ -1020,7 +1018,7 @@ bail:
1020 return ret; 1018 return ret;
1021} 1019}
1022 1020
1023static void __devexit i5100_remove_one(struct pci_dev *pdev) 1021static void i5100_remove_one(struct pci_dev *pdev)
1024{ 1022{
1025 struct mem_ctl_info *mci; 1023 struct mem_ctl_info *mci;
1026 struct i5100_priv *priv; 1024 struct i5100_priv *priv;
@@ -1054,7 +1052,7 @@ MODULE_DEVICE_TABLE(pci, i5100_pci_tbl);
1054static struct pci_driver i5100_driver = { 1052static struct pci_driver i5100_driver = {
1055 .name = KBUILD_BASENAME, 1053 .name = KBUILD_BASENAME,
1056 .probe = i5100_init_one, 1054 .probe = i5100_init_one,
1057 .remove = __devexit_p(i5100_remove_one), 1055 .remove = i5100_remove_one,
1058 .id_table = i5100_pci_tbl, 1056 .id_table = i5100_pci_tbl,
1059}; 1057};
1060 1058
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c
index 277246998b8..0a05bbceb08 100644
--- a/drivers/edac/i5400_edac.c
+++ b/drivers/edac/i5400_edac.c
@@ -1373,8 +1373,7 @@ fail0:
1373 * negative on error 1373 * negative on error
1374 * count (>= 0) 1374 * count (>= 0)
1375 */ 1375 */
1376static int __devinit i5400_init_one(struct pci_dev *pdev, 1376static int i5400_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1377 const struct pci_device_id *id)
1378{ 1377{
1379 int rc; 1378 int rc;
1380 1379
@@ -1393,7 +1392,7 @@ static int __devinit i5400_init_one(struct pci_dev *pdev,
1393 * i5400_remove_one destructor for one instance of device 1392 * i5400_remove_one destructor for one instance of device
1394 * 1393 *
1395 */ 1394 */
1396static void __devexit i5400_remove_one(struct pci_dev *pdev) 1395static void i5400_remove_one(struct pci_dev *pdev)
1397{ 1396{
1398 struct mem_ctl_info *mci; 1397 struct mem_ctl_info *mci;
1399 1398
@@ -1431,7 +1430,7 @@ MODULE_DEVICE_TABLE(pci, i5400_pci_tbl);
1431static struct pci_driver i5400_driver = { 1430static struct pci_driver i5400_driver = {
1432 .name = "i5400_edac", 1431 .name = "i5400_edac",
1433 .probe = i5400_init_one, 1432 .probe = i5400_init_one,
1434 .remove = __devexit_p(i5400_remove_one), 1433 .remove = i5400_remove_one,
1435 .id_table = i5400_pci_tbl, 1434 .id_table = i5400_pci_tbl,
1436}; 1435};
1437 1436
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index 9d669cd4361..087c27bc5d4 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -923,7 +923,7 @@ static void i7300_put_devices(struct mem_ctl_info *mci)
923 * Device 21 function 0: PCI_DEVICE_ID_INTEL_I7300_MCH_FB0 923 * Device 21 function 0: PCI_DEVICE_ID_INTEL_I7300_MCH_FB0
924 * Device 22 function 0: PCI_DEVICE_ID_INTEL_I7300_MCH_FB1 924 * Device 22 function 0: PCI_DEVICE_ID_INTEL_I7300_MCH_FB1
925 */ 925 */
926static int __devinit i7300_get_devices(struct mem_ctl_info *mci) 926static int i7300_get_devices(struct mem_ctl_info *mci)
927{ 927{
928 struct i7300_pvt *pvt; 928 struct i7300_pvt *pvt;
929 struct pci_dev *pdev; 929 struct pci_dev *pdev;
@@ -1008,8 +1008,7 @@ error:
1008 * @pdev: struct pci_dev pointer 1008 * @pdev: struct pci_dev pointer
1009 * @id: struct pci_device_id pointer - currently unused 1009 * @id: struct pci_device_id pointer - currently unused
1010 */ 1010 */
1011static int __devinit i7300_init_one(struct pci_dev *pdev, 1011static int i7300_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1012 const struct pci_device_id *id)
1013{ 1012{
1014 struct mem_ctl_info *mci; 1013 struct mem_ctl_info *mci;
1015 struct edac_mc_layer layers[3]; 1014 struct edac_mc_layer layers[3];
@@ -1122,7 +1121,7 @@ fail0:
1122 * i7300_remove_one() - Remove the driver 1121 * i7300_remove_one() - Remove the driver
1123 * @pdev: struct pci_dev pointer 1122 * @pdev: struct pci_dev pointer
1124 */ 1123 */
1125static void __devexit i7300_remove_one(struct pci_dev *pdev) 1124static void i7300_remove_one(struct pci_dev *pdev)
1126{ 1125{
1127 struct mem_ctl_info *mci; 1126 struct mem_ctl_info *mci;
1128 char *tmp; 1127 char *tmp;
@@ -1163,7 +1162,7 @@ MODULE_DEVICE_TABLE(pci, i7300_pci_tbl);
1163static struct pci_driver i7300_driver = { 1162static struct pci_driver i7300_driver = {
1164 .name = "i7300_edac", 1163 .name = "i7300_edac",
1165 .probe = i7300_init_one, 1164 .probe = i7300_init_one,
1166 .remove = __devexit_p(i7300_remove_one), 1165 .remove = i7300_remove_one,
1167 .id_table = i7300_pci_tbl, 1166 .id_table = i7300_pci_tbl,
1168}; 1167};
1169 1168
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 10c8c00d646..e213d030b0d 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -2305,8 +2305,7 @@ fail0:
2305 * < 0 for error code 2305 * < 0 for error code
2306 */ 2306 */
2307 2307
2308static int __devinit i7core_probe(struct pci_dev *pdev, 2308static int i7core_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2309 const struct pci_device_id *id)
2310{ 2309{
2311 int rc, count = 0; 2310 int rc, count = 0;
2312 struct i7core_dev *i7core_dev; 2311 struct i7core_dev *i7core_dev;
@@ -2368,7 +2367,7 @@ fail0:
2368 * i7core_remove destructor for one instance of device 2367 * i7core_remove destructor for one instance of device
2369 * 2368 *
2370 */ 2369 */
2371static void __devexit i7core_remove(struct pci_dev *pdev) 2370static void i7core_remove(struct pci_dev *pdev)
2372{ 2371{
2373 struct i7core_dev *i7core_dev; 2372 struct i7core_dev *i7core_dev;
2374 2373
@@ -2409,7 +2408,7 @@ MODULE_DEVICE_TABLE(pci, i7core_pci_tbl);
2409static struct pci_driver i7core_driver = { 2408static struct pci_driver i7core_driver = {
2410 .name = "i7core_edac", 2409 .name = "i7core_edac",
2411 .probe = i7core_probe, 2410 .probe = i7core_probe,
2412 .remove = __devexit_p(i7core_remove), 2411 .remove = i7core_remove,
2413 .id_table = i7core_pci_tbl, 2412 .id_table = i7core_pci_tbl,
2414}; 2413};
2415 2414
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
index 90f303db5d1..57fdb77903b 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -353,8 +353,8 @@ fail:
353EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_probe1); 353EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_probe1);
354 354
355/* returns count (>= 0), or negative on error */ 355/* returns count (>= 0), or negative on error */
356static int __devinit i82443bxgx_edacmc_init_one(struct pci_dev *pdev, 356static int i82443bxgx_edacmc_init_one(struct pci_dev *pdev,
357 const struct pci_device_id *ent) 357 const struct pci_device_id *ent)
358{ 358{
359 int rc; 359 int rc;
360 360
@@ -369,7 +369,7 @@ static int __devinit i82443bxgx_edacmc_init_one(struct pci_dev *pdev,
369 return rc; 369 return rc;
370} 370}
371 371
372static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev) 372static void i82443bxgx_edacmc_remove_one(struct pci_dev *pdev)
373{ 373{
374 struct mem_ctl_info *mci; 374 struct mem_ctl_info *mci;
375 375
@@ -399,7 +399,7 @@ MODULE_DEVICE_TABLE(pci, i82443bxgx_pci_tbl);
399static struct pci_driver i82443bxgx_edacmc_driver = { 399static struct pci_driver i82443bxgx_edacmc_driver = {
400 .name = EDAC_MOD_STR, 400 .name = EDAC_MOD_STR,
401 .probe = i82443bxgx_edacmc_init_one, 401 .probe = i82443bxgx_edacmc_init_one,
402 .remove = __devexit_p(i82443bxgx_edacmc_remove_one), 402 .remove = i82443bxgx_edacmc_remove_one,
403 .id_table = i82443bxgx_pci_tbl, 403 .id_table = i82443bxgx_pci_tbl,
404}; 404};
405 405
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index 1faa7497151..3e3e431c830 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -254,8 +254,8 @@ fail:
254} 254}
255 255
256/* returns count (>= 0), or negative on error */ 256/* returns count (>= 0), or negative on error */
257static int __devinit i82860_init_one(struct pci_dev *pdev, 257static int i82860_init_one(struct pci_dev *pdev,
258 const struct pci_device_id *ent) 258 const struct pci_device_id *ent)
259{ 259{
260 int rc; 260 int rc;
261 261
@@ -273,7 +273,7 @@ static int __devinit i82860_init_one(struct pci_dev *pdev,
273 return rc; 273 return rc;
274} 274}
275 275
276static void __devexit i82860_remove_one(struct pci_dev *pdev) 276static void i82860_remove_one(struct pci_dev *pdev)
277{ 277{
278 struct mem_ctl_info *mci; 278 struct mem_ctl_info *mci;
279 279
@@ -302,7 +302,7 @@ MODULE_DEVICE_TABLE(pci, i82860_pci_tbl);
302static struct pci_driver i82860_driver = { 302static struct pci_driver i82860_driver = {
303 .name = EDAC_MOD_STR, 303 .name = EDAC_MOD_STR,
304 .probe = i82860_init_one, 304 .probe = i82860_init_one,
305 .remove = __devexit_p(i82860_remove_one), 305 .remove = i82860_remove_one,
306 .id_table = i82860_pci_tbl, 306 .id_table = i82860_pci_tbl,
307}; 307};
308 308
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 3e416b1a6b5..2f8535fc451 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -479,8 +479,8 @@ fail0:
479} 479}
480 480
481/* returns count (>= 0), or negative on error */ 481/* returns count (>= 0), or negative on error */
482static int __devinit i82875p_init_one(struct pci_dev *pdev, 482static int i82875p_init_one(struct pci_dev *pdev,
483 const struct pci_device_id *ent) 483 const struct pci_device_id *ent)
484{ 484{
485 int rc; 485 int rc;
486 486
@@ -498,7 +498,7 @@ static int __devinit i82875p_init_one(struct pci_dev *pdev,
498 return rc; 498 return rc;
499} 499}
500 500
501static void __devexit i82875p_remove_one(struct pci_dev *pdev) 501static void i82875p_remove_one(struct pci_dev *pdev)
502{ 502{
503 struct mem_ctl_info *mci; 503 struct mem_ctl_info *mci;
504 struct i82875p_pvt *pvt = NULL; 504 struct i82875p_pvt *pvt = NULL;
@@ -541,7 +541,7 @@ MODULE_DEVICE_TABLE(pci, i82875p_pci_tbl);
541static struct pci_driver i82875p_driver = { 541static struct pci_driver i82875p_driver = {
542 .name = EDAC_MOD_STR, 542 .name = EDAC_MOD_STR,
543 .probe = i82875p_init_one, 543 .probe = i82875p_init_one,
544 .remove = __devexit_p(i82875p_remove_one), 544 .remove = i82875p_remove_one,
545 .id_table = i82875p_pci_tbl, 545 .id_table = i82875p_pci_tbl,
546}; 546};
547 547
diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
index a98020409fa..0c8d4b0eaa3 100644
--- a/drivers/edac/i82975x_edac.c
+++ b/drivers/edac/i82975x_edac.c
@@ -592,8 +592,8 @@ fail0:
592} 592}
593 593
594/* returns count (>= 0), or negative on error */ 594/* returns count (>= 0), or negative on error */
595static int __devinit i82975x_init_one(struct pci_dev *pdev, 595static int i82975x_init_one(struct pci_dev *pdev,
596 const struct pci_device_id *ent) 596 const struct pci_device_id *ent)
597{ 597{
598 int rc; 598 int rc;
599 599
@@ -610,7 +610,7 @@ static int __devinit i82975x_init_one(struct pci_dev *pdev,
610 return rc; 610 return rc;
611} 611}
612 612
613static void __devexit i82975x_remove_one(struct pci_dev *pdev) 613static void i82975x_remove_one(struct pci_dev *pdev)
614{ 614{
615 struct mem_ctl_info *mci; 615 struct mem_ctl_info *mci;
616 struct i82975x_pvt *pvt; 616 struct i82975x_pvt *pvt;
@@ -643,7 +643,7 @@ MODULE_DEVICE_TABLE(pci, i82975x_pci_tbl);
643static struct pci_driver i82975x_driver = { 643static struct pci_driver i82975x_driver = {
644 .name = EDAC_MOD_STR, 644 .name = EDAC_MOD_STR,
645 .probe = i82975x_init_one, 645 .probe = i82975x_init_one,
646 .remove = __devexit_p(i82975x_remove_one), 646 .remove = i82975x_remove_one,
647 .id_table = i82975x_pci_tbl, 647 .id_table = i82975x_pci_tbl,
648}; 648};
649 649
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 4fe66fa183e..42a840d530a 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -212,7 +212,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
212 return IRQ_HANDLED; 212 return IRQ_HANDLED;
213} 213}
214 214
215int __devinit mpc85xx_pci_err_probe(struct platform_device *op) 215int mpc85xx_pci_err_probe(struct platform_device *op)
216{ 216{
217 struct edac_pci_ctl_info *pci; 217 struct edac_pci_ctl_info *pci;
218 struct mpc85xx_pci_pdata *pdata; 218 struct mpc85xx_pci_pdata *pdata;
@@ -504,7 +504,7 @@ static irqreturn_t mpc85xx_l2_isr(int irq, void *dev_id)
504 return IRQ_HANDLED; 504 return IRQ_HANDLED;
505} 505}
506 506
507static int __devinit mpc85xx_l2_err_probe(struct platform_device *op) 507static int mpc85xx_l2_err_probe(struct platform_device *op)
508{ 508{
509 struct edac_device_ctl_info *edac_dev; 509 struct edac_device_ctl_info *edac_dev;
510 struct mpc85xx_l2_pdata *pdata; 510 struct mpc85xx_l2_pdata *pdata;
@@ -885,7 +885,7 @@ static irqreturn_t mpc85xx_mc_isr(int irq, void *dev_id)
885 return IRQ_HANDLED; 885 return IRQ_HANDLED;
886} 886}
887 887
888static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci) 888static void mpc85xx_init_csrows(struct mem_ctl_info *mci)
889{ 889{
890 struct mpc85xx_mc_pdata *pdata = mci->pvt_info; 890 struct mpc85xx_mc_pdata *pdata = mci->pvt_info;
891 struct csrow_info *csrow; 891 struct csrow_info *csrow;
@@ -964,7 +964,7 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
964 } 964 }
965} 965}
966 966
967static int __devinit mpc85xx_mc_err_probe(struct platform_device *op) 967static int mpc85xx_mc_err_probe(struct platform_device *op)
968{ 968{
969 struct mem_ctl_info *mci; 969 struct mem_ctl_info *mci;
970 struct edac_mc_layer layers[2]; 970 struct edac_mc_layer layers[2];
diff --git a/drivers/edac/mv64x60_edac.c b/drivers/edac/mv64x60_edac.c
index 2b315c2edc3..542fad70e36 100644
--- a/drivers/edac/mv64x60_edac.c
+++ b/drivers/edac/mv64x60_edac.c
@@ -100,7 +100,7 @@ static int __init mv64x60_pci_fixup(struct platform_device *pdev)
100 return 0; 100 return 0;
101} 101}
102 102
103static int __devinit mv64x60_pci_err_probe(struct platform_device *pdev) 103static int mv64x60_pci_err_probe(struct platform_device *pdev)
104{ 104{
105 struct edac_pci_ctl_info *pci; 105 struct edac_pci_ctl_info *pci;
106 struct mv64x60_pci_pdata *pdata; 106 struct mv64x60_pci_pdata *pdata;
@@ -221,7 +221,7 @@ static int mv64x60_pci_err_remove(struct platform_device *pdev)
221 221
222static struct platform_driver mv64x60_pci_err_driver = { 222static struct platform_driver mv64x60_pci_err_driver = {
223 .probe = mv64x60_pci_err_probe, 223 .probe = mv64x60_pci_err_probe,
224 .remove = __devexit_p(mv64x60_pci_err_remove), 224 .remove = mv64x60_pci_err_remove,
225 .driver = { 225 .driver = {
226 .name = "mv64x60_pci_err", 226 .name = "mv64x60_pci_err",
227 } 227 }
@@ -271,7 +271,7 @@ static irqreturn_t mv64x60_sram_isr(int irq, void *dev_id)
271 return IRQ_HANDLED; 271 return IRQ_HANDLED;
272} 272}
273 273
274static int __devinit mv64x60_sram_err_probe(struct platform_device *pdev) 274static int mv64x60_sram_err_probe(struct platform_device *pdev)
275{ 275{
276 struct edac_device_ctl_info *edac_dev; 276 struct edac_device_ctl_info *edac_dev;
277 struct mv64x60_sram_pdata *pdata; 277 struct mv64x60_sram_pdata *pdata;
@@ -439,7 +439,7 @@ static irqreturn_t mv64x60_cpu_isr(int irq, void *dev_id)
439 return IRQ_HANDLED; 439 return IRQ_HANDLED;
440} 440}
441 441
442static int __devinit mv64x60_cpu_err_probe(struct platform_device *pdev) 442static int mv64x60_cpu_err_probe(struct platform_device *pdev)
443{ 443{
444 struct edac_device_ctl_info *edac_dev; 444 struct edac_device_ctl_info *edac_dev;
445 struct resource *r; 445 struct resource *r;
@@ -697,7 +697,7 @@ static void mv64x60_init_csrows(struct mem_ctl_info *mci,
697 dimm->edac_mode = EDAC_SECDED; 697 dimm->edac_mode = EDAC_SECDED;
698} 698}
699 699
700static int __devinit mv64x60_mc_err_probe(struct platform_device *pdev) 700static int mv64x60_mc_err_probe(struct platform_device *pdev)
701{ 701{
702 struct mem_ctl_info *mci; 702 struct mem_ctl_info *mci;
703 struct edac_mc_layer layers[2]; 703 struct edac_mc_layer layers[2];
diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
index 40fde6a51ed..7e98084d364 100644
--- a/drivers/edac/octeon_edac-l2c.c
+++ b/drivers/edac/octeon_edac-l2c.c
@@ -131,7 +131,7 @@ static void octeon_l2c_poll_oct2(struct edac_device_ctl_info *l2c)
131 _octeon_l2c_poll_oct2(l2c, i); 131 _octeon_l2c_poll_oct2(l2c, i);
132} 132}
133 133
134static int __devinit octeon_l2c_probe(struct platform_device *pdev) 134static int octeon_l2c_probe(struct platform_device *pdev)
135{ 135{
136 struct edac_device_ctl_info *l2c; 136 struct edac_device_ctl_info *l2c;
137 137
diff --git a/drivers/edac/octeon_edac-lmc.c b/drivers/edac/octeon_edac-lmc.c
index 33bca766e37..93412d6b3af 100644
--- a/drivers/edac/octeon_edac-lmc.c
+++ b/drivers/edac/octeon_edac-lmc.c
@@ -86,7 +86,7 @@ static void octeon_lmc_edac_poll_o2(struct mem_ctl_info *mci)
86 cvmx_write_csr(CVMX_LMCX_INT(mci->mc_idx), int_reg.u64); 86 cvmx_write_csr(CVMX_LMCX_INT(mci->mc_idx), int_reg.u64);
87} 87}
88 88
89static int __devinit octeon_lmc_edac_probe(struct platform_device *pdev) 89static int octeon_lmc_edac_probe(struct platform_device *pdev)
90{ 90{
91 struct mem_ctl_info *mci; 91 struct mem_ctl_info *mci;
92 struct edac_mc_layer layers[1]; 92 struct edac_mc_layer layers[1];
diff --git a/drivers/edac/octeon_edac-pc.c b/drivers/edac/octeon_edac-pc.c
index 14a5e57f2b3..0f83c33a7d1 100644
--- a/drivers/edac/octeon_edac-pc.c
+++ b/drivers/edac/octeon_edac-pc.c
@@ -82,7 +82,7 @@ static int co_cache_error_event(struct notifier_block *this,
82 return NOTIFY_STOP; 82 return NOTIFY_STOP;
83} 83}
84 84
85static int __devinit co_cache_error_probe(struct platform_device *pdev) 85static int co_cache_error_probe(struct platform_device *pdev)
86{ 86{
87 struct co_cache_error *p = devm_kzalloc(&pdev->dev, sizeof(*p), 87 struct co_cache_error *p = devm_kzalloc(&pdev->dev, sizeof(*p),
88 GFP_KERNEL); 88 GFP_KERNEL);
diff --git a/drivers/edac/octeon_edac-pci.c b/drivers/edac/octeon_edac-pci.c
index 758c1ef5fc9..9ca73cec74e 100644
--- a/drivers/edac/octeon_edac-pci.c
+++ b/drivers/edac/octeon_edac-pci.c
@@ -58,7 +58,7 @@ static void octeon_pci_poll(struct edac_pci_ctl_info *pci)
58 } 58 }
59} 59}
60 60
61static int __devinit octeon_pci_probe(struct platform_device *pdev) 61static int octeon_pci_probe(struct platform_device *pdev)
62{ 62{
63 struct edac_pci_ctl_info *pci; 63 struct edac_pci_ctl_info *pci;
64 int res = 0; 64 int res = 0;
diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c
index 2d35b78ada3..9c971b57553 100644
--- a/drivers/edac/pasemi_edac.c
+++ b/drivers/edac/pasemi_edac.c
@@ -188,8 +188,8 @@ static int pasemi_edac_init_csrows(struct mem_ctl_info *mci,
188 return 0; 188 return 0;
189} 189}
190 190
191static int __devinit pasemi_edac_probe(struct pci_dev *pdev, 191static int pasemi_edac_probe(struct pci_dev *pdev,
192 const struct pci_device_id *ent) 192 const struct pci_device_id *ent)
193{ 193{
194 struct mem_ctl_info *mci = NULL; 194 struct mem_ctl_info *mci = NULL;
195 struct edac_mc_layer layers[2]; 195 struct edac_mc_layer layers[2];
@@ -266,7 +266,7 @@ fail:
266 return -ENODEV; 266 return -ENODEV;
267} 267}
268 268
269static void __devexit pasemi_edac_remove(struct pci_dev *pdev) 269static void pasemi_edac_remove(struct pci_dev *pdev)
270{ 270{
271 struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev); 271 struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev);
272 272
@@ -287,7 +287,7 @@ MODULE_DEVICE_TABLE(pci, pasemi_edac_pci_tbl);
287static struct pci_driver pasemi_edac_driver = { 287static struct pci_driver pasemi_edac_driver = {
288 .name = MODULE_NAME, 288 .name = MODULE_NAME,
289 .probe = pasemi_edac_probe, 289 .probe = pasemi_edac_probe,
290 .remove = __devexit_p(pasemi_edac_remove), 290 .remove = pasemi_edac_remove,
291 .id_table = pasemi_edac_pci_tbl, 291 .id_table = pasemi_edac_pci_tbl,
292}; 292};
293 293
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index bf095763599..ef6b7e08f48 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -838,8 +838,7 @@ ppc4xx_edac_isr(int irq, void *dev_id)
838 * 838 *
839 * Returns a device type width enumeration. 839 * Returns a device type width enumeration.
840 */ 840 */
841static enum dev_type __devinit 841static enum dev_type ppc4xx_edac_get_dtype(u32 mcopt1)
842ppc4xx_edac_get_dtype(u32 mcopt1)
843{ 842{
844 switch (mcopt1 & SDRAM_MCOPT1_WDTH_MASK) { 843 switch (mcopt1 & SDRAM_MCOPT1_WDTH_MASK) {
845 case SDRAM_MCOPT1_WDTH_16: 844 case SDRAM_MCOPT1_WDTH_16:
@@ -862,8 +861,7 @@ ppc4xx_edac_get_dtype(u32 mcopt1)
862 * 861 *
863 * Returns a memory type enumeration. 862 * Returns a memory type enumeration.
864 */ 863 */
865static enum mem_type __devinit 864static enum mem_type ppc4xx_edac_get_mtype(u32 mcopt1)
866ppc4xx_edac_get_mtype(u32 mcopt1)
867{ 865{
868 bool rden = ((mcopt1 & SDRAM_MCOPT1_RDEN_MASK) == SDRAM_MCOPT1_RDEN); 866 bool rden = ((mcopt1 & SDRAM_MCOPT1_RDEN_MASK) == SDRAM_MCOPT1_RDEN);
869 867
@@ -893,8 +891,7 @@ ppc4xx_edac_get_mtype(u32 mcopt1)
893 * Returns 0 if OK; otherwise, -EINVAL if the memory bank size 891 * Returns 0 if OK; otherwise, -EINVAL if the memory bank size
894 * configuration cannot be determined. 892 * configuration cannot be determined.
895 */ 893 */
896static int __devinit 894static int ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
897ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
898{ 895{
899 const struct ppc4xx_edac_pdata *pdata = mci->pvt_info; 896 const struct ppc4xx_edac_pdata *pdata = mci->pvt_info;
900 int status = 0; 897 int status = 0;
@@ -1011,11 +1008,9 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
1011 * 1008 *
1012 * Returns 0 if OK; otherwise, < 0 on error. 1009 * Returns 0 if OK; otherwise, < 0 on error.
1013 */ 1010 */
1014static int __devinit 1011static int ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
1015ppc4xx_edac_mc_init(struct mem_ctl_info *mci, 1012 struct platform_device *op,
1016 struct platform_device *op, 1013 const dcr_host_t *dcr_host, u32 mcopt1)
1017 const dcr_host_t *dcr_host,
1018 u32 mcopt1)
1019{ 1014{
1020 int status = 0; 1015 int status = 0;
1021 const u32 memcheck = (mcopt1 & SDRAM_MCOPT1_MCHK_MASK); 1016 const u32 memcheck = (mcopt1 & SDRAM_MCOPT1_MCHK_MASK);
@@ -1105,8 +1100,8 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
1105 * Returns 0 if OK; otherwise, -ENODEV if the interrupts could not be 1100 * Returns 0 if OK; otherwise, -ENODEV if the interrupts could not be
1106 * mapped and assigned. 1101 * mapped and assigned.
1107 */ 1102 */
1108static int __devinit 1103static int ppc4xx_edac_register_irq(struct platform_device *op,
1109ppc4xx_edac_register_irq(struct platform_device *op, struct mem_ctl_info *mci) 1104 struct mem_ctl_info *mci)
1110{ 1105{
1111 int status = 0; 1106 int status = 0;
1112 int ded_irq, sec_irq; 1107 int ded_irq, sec_irq;
@@ -1183,8 +1178,8 @@ ppc4xx_edac_register_irq(struct platform_device *op, struct mem_ctl_info *mci)
1183 * Returns 0 if the DCRs were successfully mapped; otherwise, < 0 on 1178 * Returns 0 if the DCRs were successfully mapped; otherwise, < 0 on
1184 * error. 1179 * error.
1185 */ 1180 */
1186static int __devinit 1181static int ppc4xx_edac_map_dcrs(const struct device_node *np,
1187ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host) 1182 dcr_host_t *dcr_host)
1188{ 1183{
1189 unsigned int dcr_base, dcr_len; 1184 unsigned int dcr_base, dcr_len;
1190 1185
@@ -1232,7 +1227,7 @@ ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host)
1232 * Returns 0 if the controller instance was successfully bound to the 1227 * Returns 0 if the controller instance was successfully bound to the
1233 * driver; otherwise, < 0 on error. 1228 * driver; otherwise, < 0 on error.
1234 */ 1229 */
1235static int __devinit ppc4xx_edac_probe(struct platform_device *op) 1230static int ppc4xx_edac_probe(struct platform_device *op)
1236{ 1231{
1237 int status = 0; 1232 int status = 0;
1238 u32 mcopt1, memcheck; 1233 u32 mcopt1, memcheck;
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index f854debd553..2fd6a549090 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -359,8 +359,8 @@ fail:
359} 359}
360 360
361/* returns count (>= 0), or negative on error */ 361/* returns count (>= 0), or negative on error */
362static int __devinit r82600_init_one(struct pci_dev *pdev, 362static int r82600_init_one(struct pci_dev *pdev,
363 const struct pci_device_id *ent) 363 const struct pci_device_id *ent)
364{ 364{
365 edac_dbg(0, "\n"); 365 edac_dbg(0, "\n");
366 366
@@ -368,7 +368,7 @@ static int __devinit r82600_init_one(struct pci_dev *pdev,
368 return r82600_probe1(pdev, ent->driver_data); 368 return r82600_probe1(pdev, ent->driver_data);
369} 369}
370 370
371static void __devexit r82600_remove_one(struct pci_dev *pdev) 371static void r82600_remove_one(struct pci_dev *pdev)
372{ 372{
373 struct mem_ctl_info *mci; 373 struct mem_ctl_info *mci;
374 374
@@ -397,7 +397,7 @@ MODULE_DEVICE_TABLE(pci, r82600_pci_tbl);
397static struct pci_driver r82600_driver = { 397static struct pci_driver r82600_driver = {
398 .name = EDAC_MOD_STR, 398 .name = EDAC_MOD_STR,
399 .probe = r82600_init_one, 399 .probe = r82600_init_one,
400 .remove = __devexit_p(r82600_remove_one), 400 .remove = r82600_remove_one,
401 .id_table = r82600_pci_tbl, 401 .id_table = r82600_pci_tbl,
402}; 402};
403 403
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 5715b7c2c51..da7e2986e3d 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -1692,8 +1692,7 @@ fail0:
1692 * < 0 for error code 1692 * < 0 for error code
1693 */ 1693 */
1694 1694
1695static int __devinit sbridge_probe(struct pci_dev *pdev, 1695static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1696 const struct pci_device_id *id)
1697{ 1696{
1698 int rc; 1697 int rc;
1699 u8 mc, num_mc = 0; 1698 u8 mc, num_mc = 0;
@@ -1744,7 +1743,7 @@ fail0:
1744 * sbridge_remove destructor for one instance of device 1743 * sbridge_remove destructor for one instance of device
1745 * 1744 *
1746 */ 1745 */
1747static void __devexit sbridge_remove(struct pci_dev *pdev) 1746static void sbridge_remove(struct pci_dev *pdev)
1748{ 1747{
1749 struct sbridge_dev *sbridge_dev; 1748 struct sbridge_dev *sbridge_dev;
1750 1749
@@ -1785,7 +1784,7 @@ MODULE_DEVICE_TABLE(pci, sbridge_pci_tbl);
1785static struct pci_driver sbridge_driver = { 1784static struct pci_driver sbridge_driver = {
1786 .name = "sbridge_edac", 1785 .name = "sbridge_edac",
1787 .probe = sbridge_probe, 1786 .probe = sbridge_probe,
1788 .remove = __devexit_p(sbridge_remove), 1787 .remove = sbridge_remove,
1789 .id_table = sbridge_pci_tbl, 1788 .id_table = sbridge_pci_tbl,
1790}; 1789};
1791 1790
diff --git a/drivers/edac/tile_edac.c b/drivers/edac/tile_edac.c
index 1e904b7b79a..a0820536b7d 100644
--- a/drivers/edac/tile_edac.c
+++ b/drivers/edac/tile_edac.c
@@ -82,7 +82,7 @@ static void tile_edac_check(struct mem_ctl_info *mci)
82 * Initialize the 'csrows' table within the mci control structure with the 82 * Initialize the 'csrows' table within the mci control structure with the
83 * addressing of memory. 83 * addressing of memory.
84 */ 84 */
85static int __devinit tile_edac_init_csrows(struct mem_ctl_info *mci) 85static int tile_edac_init_csrows(struct mem_ctl_info *mci)
86{ 86{
87 struct csrow_info *csrow = mci->csrows[0]; 87 struct csrow_info *csrow = mci->csrows[0];
88 struct tile_edac_priv *priv = mci->pvt_info; 88 struct tile_edac_priv *priv = mci->pvt_info;
@@ -120,7 +120,7 @@ static int __devinit tile_edac_init_csrows(struct mem_ctl_info *mci)
120 return 0; 120 return 0;
121} 121}
122 122
123static int __devinit tile_edac_mc_probe(struct platform_device *pdev) 123static int tile_edac_mc_probe(struct platform_device *pdev)
124{ 124{
125 char hv_file[32]; 125 char hv_file[32];
126 int hv_devhdl; 126 int hv_devhdl;
@@ -186,7 +186,7 @@ static int __devinit tile_edac_mc_probe(struct platform_device *pdev)
186 return 0; 186 return 0;
187} 187}
188 188
189static int __devexit tile_edac_mc_remove(struct platform_device *pdev) 189static int tile_edac_mc_remove(struct platform_device *pdev)
190{ 190{
191 struct mem_ctl_info *mci = platform_get_drvdata(pdev); 191 struct mem_ctl_info *mci = platform_get_drvdata(pdev);
192 192
@@ -202,7 +202,7 @@ static struct platform_driver tile_edac_mc_driver = {
202 .owner = THIS_MODULE, 202 .owner = THIS_MODULE,
203 }, 203 },
204 .probe = tile_edac_mc_probe, 204 .probe = tile_edac_mc_probe,
205 .remove = __devexit_p(tile_edac_mc_remove), 205 .remove = tile_edac_mc_remove,
206}; 206};
207 207
208/* 208/*
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
index 08a992693e6..c9db24d95ca 100644
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -418,8 +418,7 @@ fail:
418 return rc; 418 return rc;
419} 419}
420 420
421static int __devinit x38_init_one(struct pci_dev *pdev, 421static int x38_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
422 const struct pci_device_id *ent)
423{ 422{
424 int rc; 423 int rc;
425 424
@@ -435,7 +434,7 @@ static int __devinit x38_init_one(struct pci_dev *pdev,
435 return rc; 434 return rc;
436} 435}
437 436
438static void __devexit x38_remove_one(struct pci_dev *pdev) 437static void x38_remove_one(struct pci_dev *pdev)
439{ 438{
440 struct mem_ctl_info *mci; 439 struct mem_ctl_info *mci;
441 440
@@ -464,7 +463,7 @@ MODULE_DEVICE_TABLE(pci, x38_pci_tbl);
464static struct pci_driver x38_driver = { 463static struct pci_driver x38_driver = {
465 .name = EDAC_MOD_STR, 464 .name = EDAC_MOD_STR,
466 .probe = x38_init_one, 465 .probe = x38_init_one,
467 .remove = __devexit_p(x38_remove_one), 466 .remove = x38_remove_one,
468 .id_table = x38_pci_tbl, 467 .id_table = x38_pci_tbl,
469}; 468};
470 469
diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c
index ea5ac2dc123..8e77c02edb2 100644
--- a/drivers/firmware/dcdbas.c
+++ b/drivers/firmware/dcdbas.c
@@ -537,7 +537,7 @@ static struct attribute_group dcdbas_attr_group = {
537 .attrs = dcdbas_dev_attrs, 537 .attrs = dcdbas_dev_attrs,
538}; 538};
539 539
540static int __devinit dcdbas_probe(struct platform_device *dev) 540static int dcdbas_probe(struct platform_device *dev)
541{ 541{
542 int i, error; 542 int i, error;
543 543
@@ -575,7 +575,7 @@ static int __devinit dcdbas_probe(struct platform_device *dev)
575 return 0; 575 return 0;
576} 576}
577 577
578static int __devexit dcdbas_remove(struct platform_device *dev) 578static int dcdbas_remove(struct platform_device *dev)
579{ 579{
580 int i; 580 int i;
581 581
@@ -593,7 +593,7 @@ static struct platform_driver dcdbas_driver = {
593 .owner = THIS_MODULE, 593 .owner = THIS_MODULE,
594 }, 594 },
595 .probe = dcdbas_probe, 595 .probe = dcdbas_probe,
596 .remove = __devexit_p(dcdbas_remove), 596 .remove = dcdbas_remove,
597}; 597};
598 598
599/** 599/**
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index 55d83c7d9c7..fd6dfe382f1 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -126,7 +126,7 @@ static int da9055_gpio_to_irq(struct gpio_chip *gc, u32 offset)
126 DA9055_IRQ_GPI0 + offset); 126 DA9055_IRQ_GPI0 + offset);
127} 127}
128 128
129static struct gpio_chip reference_gp __devinitdata = { 129static struct gpio_chip reference_gp = {
130 .label = "da9055-gpio", 130 .label = "da9055-gpio",
131 .owner = THIS_MODULE, 131 .owner = THIS_MODULE,
132 .get = da9055_gpio_get, 132 .get = da9055_gpio_get,
@@ -139,7 +139,7 @@ static struct gpio_chip reference_gp __devinitdata = {
139 .base = -1, 139 .base = -1,
140}; 140};
141 141
142static int __devinit da9055_gpio_probe(struct platform_device *pdev) 142static int da9055_gpio_probe(struct platform_device *pdev)
143{ 143{
144 struct da9055_gpio *gpio; 144 struct da9055_gpio *gpio;
145 struct da9055_pdata *pdata; 145 struct da9055_pdata *pdata;
@@ -170,7 +170,7 @@ err_mem:
170 return ret; 170 return ret;
171} 171}
172 172
173static int __devexit da9055_gpio_remove(struct platform_device *pdev) 173static int da9055_gpio_remove(struct platform_device *pdev)
174{ 174{
175 struct da9055_gpio *gpio = platform_get_drvdata(pdev); 175 struct da9055_gpio *gpio = platform_get_drvdata(pdev);
176 176
@@ -179,7 +179,7 @@ static int __devexit da9055_gpio_remove(struct platform_device *pdev)
179 179
180static struct platform_driver da9055_gpio_driver = { 180static struct platform_driver da9055_gpio_driver = {
181 .probe = da9055_gpio_probe, 181 .probe = da9055_gpio_probe,
182 .remove = __devexit_p(da9055_gpio_remove), 182 .remove = da9055_gpio_remove,
183 .driver = { 183 .driver = {
184 .name = "da9055-gpio", 184 .name = "da9055-gpio",
185 .owner = THIS_MODULE, 185 .owner = THIS_MODULE,
diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c
index 0634ceea3c2..cc53cab8df2 100644
--- a/drivers/gpio/gpio-ts5500.c
+++ b/drivers/gpio/gpio-ts5500.c
@@ -319,7 +319,7 @@ static void ts5500_disable_irq(struct ts5500_priv *priv)
319 spin_unlock_irqrestore(&priv->lock, flags); 319 spin_unlock_irqrestore(&priv->lock, flags);
320} 320}
321 321
322static int __devinit ts5500_dio_probe(struct platform_device *pdev) 322static int ts5500_dio_probe(struct platform_device *pdev)
323{ 323{
324 enum ts5500_blocks block = platform_get_device_id(pdev)->driver_data; 324 enum ts5500_blocks block = platform_get_device_id(pdev)->driver_data;
325 struct ts5500_dio_platform_data *pdata = pdev->dev.platform_data; 325 struct ts5500_dio_platform_data *pdata = pdev->dev.platform_data;
@@ -432,7 +432,7 @@ cleanup:
432 return ret; 432 return ret;
433} 433}
434 434
435static int __devexit ts5500_dio_remove(struct platform_device *pdev) 435static int ts5500_dio_remove(struct platform_device *pdev)
436{ 436{
437 struct ts5500_priv *priv = platform_get_drvdata(pdev); 437 struct ts5500_priv *priv = platform_get_drvdata(pdev);
438 438
@@ -455,7 +455,7 @@ static struct platform_driver ts5500_dio_driver = {
455 .owner = THIS_MODULE, 455 .owner = THIS_MODULE,
456 }, 456 },
457 .probe = ts5500_dio_probe, 457 .probe = ts5500_dio_probe,
458 .remove = __devexit_p(ts5500_dio_remove), 458 .remove = ts5500_dio_remove,
459 .id_table = ts5500_dio_ids, 459 .id_table = ts5500_dio_ids,
460}; 460};
461 461
diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
index 13772996cf2..59d72391de2 100644
--- a/drivers/gpio/gpio-viperboard.c
+++ b/drivers/gpio/gpio-viperboard.c
@@ -400,7 +400,7 @@ static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
400 400
401/* ----- end of gpio b chip ---------------------------------------------- */ 401/* ----- end of gpio b chip ---------------------------------------------- */
402 402
403static int __devinit vprbrd_gpio_probe(struct platform_device *pdev) 403static int vprbrd_gpio_probe(struct platform_device *pdev)
404{ 404{
405 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent); 405 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent);
406 struct vprbrd_gpio *vb_gpio; 406 struct vprbrd_gpio *vb_gpio;
@@ -456,7 +456,7 @@ err_gpioa:
456 return ret; 456 return ret;
457} 457}
458 458
459static int __devexit vprbrd_gpio_remove(struct platform_device *pdev) 459static int vprbrd_gpio_remove(struct platform_device *pdev)
460{ 460{
461 struct vprbrd_gpio *vb_gpio = platform_get_drvdata(pdev); 461 struct vprbrd_gpio *vb_gpio = platform_get_drvdata(pdev);
462 int ret; 462 int ret;
@@ -472,7 +472,7 @@ static struct platform_driver vprbrd_gpio_driver = {
472 .driver.name = "viperboard-gpio", 472 .driver.name = "viperboard-gpio",
473 .driver.owner = THIS_MODULE, 473 .driver.owner = THIS_MODULE,
474 .probe = vprbrd_gpio_probe, 474 .probe = vprbrd_gpio_probe,
475 .remove = __devexit_p(vprbrd_gpio_remove), 475 .remove = vprbrd_gpio_remove,
476}; 476};
477 477
478static int __init vprbrd_gpio_init(void) 478static int __init vprbrd_gpio_init(void)
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 31123b6a0be..2d2c2f8d6dc 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -60,8 +60,7 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = {
60 60
61MODULE_DEVICE_TABLE(pci, pciidlist); 61MODULE_DEVICE_TABLE(pci, pciidlist);
62 62
63static int __devinit 63static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
64ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
65{ 64{
66 return drm_get_pci_dev(pdev, ent, &driver); 65 return drm_get_pci_dev(pdev, ent, &driver);
67} 66}
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c
index dcd1a8c029e..8ecb601152e 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.c
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.c
@@ -56,8 +56,8 @@ static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
56 return 0; 56 return 0;
57} 57}
58 58
59static int __devinit 59static int cirrus_pci_probe(struct pci_dev *pdev,
60cirrus_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 60 const struct pci_device_id *ent)
61{ 61{
62 int ret; 62 int ret;
63 63
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 2bf9670ba29..2aa331499f8 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -221,11 +221,13 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
221 221
222 BUG_ON(!hole_node->hole_follows || node->allocated); 222 BUG_ON(!hole_node->hole_follows || node->allocated);
223 223
224 if (mm->color_adjust)
225 mm->color_adjust(hole_node, color, &adj_start, &adj_end);
226
227 if (adj_start < start) 224 if (adj_start < start)
228 adj_start = start; 225 adj_start = start;
226 if (adj_end > end)
227 adj_end = end;
228
229 if (mm->color_adjust)
230 mm->color_adjust(hole_node, color, &adj_start, &adj_end);
229 231
230 if (alignment) { 232 if (alignment) {
231 unsigned tmp = adj_start % alignment; 233 unsigned tmp = adj_start % alignment;
@@ -506,7 +508,7 @@ void drm_mm_init_scan(struct drm_mm *mm,
506 mm->scan_size = size; 508 mm->scan_size = size;
507 mm->scanned_blocks = 0; 509 mm->scanned_blocks = 0;
508 mm->scan_hit_start = 0; 510 mm->scan_hit_start = 0;
509 mm->scan_hit_size = 0; 511 mm->scan_hit_end = 0;
510 mm->scan_check_range = 0; 512 mm->scan_check_range = 0;
511 mm->prev_scanned_node = NULL; 513 mm->prev_scanned_node = NULL;
512} 514}
@@ -533,7 +535,7 @@ void drm_mm_init_scan_with_range(struct drm_mm *mm,
533 mm->scan_size = size; 535 mm->scan_size = size;
534 mm->scanned_blocks = 0; 536 mm->scanned_blocks = 0;
535 mm->scan_hit_start = 0; 537 mm->scan_hit_start = 0;
536 mm->scan_hit_size = 0; 538 mm->scan_hit_end = 0;
537 mm->scan_start = start; 539 mm->scan_start = start;
538 mm->scan_end = end; 540 mm->scan_end = end;
539 mm->scan_check_range = 1; 541 mm->scan_check_range = 1;
@@ -552,8 +554,7 @@ int drm_mm_scan_add_block(struct drm_mm_node *node)
552 struct drm_mm *mm = node->mm; 554 struct drm_mm *mm = node->mm;
553 struct drm_mm_node *prev_node; 555 struct drm_mm_node *prev_node;
554 unsigned long hole_start, hole_end; 556 unsigned long hole_start, hole_end;
555 unsigned long adj_start; 557 unsigned long adj_start, adj_end;
556 unsigned long adj_end;
557 558
558 mm->scanned_blocks++; 559 mm->scanned_blocks++;
559 560
@@ -570,14 +571,8 @@ int drm_mm_scan_add_block(struct drm_mm_node *node)
570 node->node_list.next = &mm->prev_scanned_node->node_list; 571 node->node_list.next = &mm->prev_scanned_node->node_list;
571 mm->prev_scanned_node = node; 572 mm->prev_scanned_node = node;
572 573
573 hole_start = drm_mm_hole_node_start(prev_node); 574 adj_start = hole_start = drm_mm_hole_node_start(prev_node);
574 hole_end = drm_mm_hole_node_end(prev_node); 575 adj_end = hole_end = drm_mm_hole_node_end(prev_node);
575
576 adj_start = hole_start;
577 adj_end = hole_end;
578
579 if (mm->color_adjust)
580 mm->color_adjust(prev_node, mm->scan_color, &adj_start, &adj_end);
581 576
582 if (mm->scan_check_range) { 577 if (mm->scan_check_range) {
583 if (adj_start < mm->scan_start) 578 if (adj_start < mm->scan_start)
@@ -586,11 +581,14 @@ int drm_mm_scan_add_block(struct drm_mm_node *node)
586 adj_end = mm->scan_end; 581 adj_end = mm->scan_end;
587 } 582 }
588 583
584 if (mm->color_adjust)
585 mm->color_adjust(prev_node, mm->scan_color,
586 &adj_start, &adj_end);
587
589 if (check_free_hole(adj_start, adj_end, 588 if (check_free_hole(adj_start, adj_end,
590 mm->scan_size, mm->scan_alignment)) { 589 mm->scan_size, mm->scan_alignment)) {
591 mm->scan_hit_start = hole_start; 590 mm->scan_hit_start = hole_start;
592 mm->scan_hit_size = hole_end; 591 mm->scan_hit_end = hole_end;
593
594 return 1; 592 return 1;
595 } 593 }
596 594
@@ -626,19 +624,10 @@ int drm_mm_scan_remove_block(struct drm_mm_node *node)
626 node_list); 624 node_list);
627 625
628 prev_node->hole_follows = node->scanned_preceeds_hole; 626 prev_node->hole_follows = node->scanned_preceeds_hole;
629 INIT_LIST_HEAD(&node->node_list);
630 list_add(&node->node_list, &prev_node->node_list); 627 list_add(&node->node_list, &prev_node->node_list);
631 628
632 /* Only need to check for containement because start&size for the 629 return (drm_mm_hole_node_end(node) > mm->scan_hit_start &&
633 * complete resulting free block (not just the desired part) is 630 node->start < mm->scan_hit_end);
634 * stored. */
635 if (node->start >= mm->scan_hit_start &&
636 node->start + node->size
637 <= mm->scan_hit_start + mm->scan_hit_size) {
638 return 1;
639 }
640
641 return 0;
642} 631}
643EXPORT_SYMBOL(drm_mm_scan_remove_block); 632EXPORT_SYMBOL(drm_mm_scan_remove_block);
644 633
diff --git a/drivers/gpu/drm/exynos/exynos_ddc.c b/drivers/gpu/drm/exynos/exynos_ddc.c
index bef43e0342a..4e9b5ba8edf 100644
--- a/drivers/gpu/drm/exynos/exynos_ddc.c
+++ b/drivers/gpu/drm/exynos/exynos_ddc.c
@@ -66,6 +66,6 @@ struct i2c_driver ddc_driver = {
66 }, 66 },
67 .id_table = ddc_idtable, 67 .id_table = ddc_idtable,
68 .probe = s5p_ddc_probe, 68 .probe = s5p_ddc_probe,
69 .remove = __devexit_p(s5p_ddc_remove), 69 .remove = s5p_ddc_remove,
70 .command = NULL, 70 .command = NULL,
71}; 71};
diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c b/drivers/gpu/drm/exynos/exynos_drm_buf.c
index 9601bad47a2..57affae9568 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_buf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c
@@ -3,24 +3,10 @@
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#include <drm/drmP.h> 12#include <drm/drmP.h>
@@ -29,6 +15,7 @@
29#include "exynos_drm_drv.h" 15#include "exynos_drm_drv.h"
30#include "exynos_drm_gem.h" 16#include "exynos_drm_gem.h"
31#include "exynos_drm_buf.h" 17#include "exynos_drm_buf.h"
18#include "exynos_drm_iommu.h"
32 19
33static int lowlevel_buffer_allocate(struct drm_device *dev, 20static int lowlevel_buffer_allocate(struct drm_device *dev,
34 unsigned int flags, struct exynos_drm_gem_buf *buf) 21 unsigned int flags, struct exynos_drm_gem_buf *buf)
@@ -51,7 +38,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
51 * region will be allocated else physically contiguous 38 * region will be allocated else physically contiguous
52 * as possible. 39 * as possible.
53 */ 40 */
54 if (flags & EXYNOS_BO_CONTIG) 41 if (!(flags & EXYNOS_BO_NONCONTIG))
55 dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs); 42 dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);
56 43
57 /* 44 /*
@@ -66,14 +53,45 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
66 dma_set_attr(attr, &buf->dma_attrs); 53 dma_set_attr(attr, &buf->dma_attrs);
67 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs); 54 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs);
68 55
69 buf->pages = dma_alloc_attrs(dev->dev, buf->size, 56 nr_pages = buf->size >> PAGE_SHIFT;
70 &buf->dma_addr, GFP_KERNEL, &buf->dma_attrs); 57
71 if (!buf->pages) { 58 if (!is_drm_iommu_supported(dev)) {
72 DRM_ERROR("failed to allocate buffer.\n"); 59 dma_addr_t start_addr;
73 return -ENOMEM; 60 unsigned int i = 0;
61
62 buf->pages = kzalloc(sizeof(struct page) * nr_pages,
63 GFP_KERNEL);
64 if (!buf->pages) {
65 DRM_ERROR("failed to allocate pages.\n");
66 return -ENOMEM;
67 }
68
69 buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,
70 &buf->dma_addr, GFP_KERNEL,
71 &buf->dma_attrs);
72 if (!buf->kvaddr) {
73 DRM_ERROR("failed to allocate buffer.\n");
74 kfree(buf->pages);
75 return -ENOMEM;
76 }
77
78 start_addr = buf->dma_addr;
79 while (i < nr_pages) {
80 buf->pages[i] = phys_to_page(start_addr);
81 start_addr += PAGE_SIZE;
82 i++;
83 }
84 } else {
85
86 buf->pages = dma_alloc_attrs(dev->dev, buf->size,
87 &buf->dma_addr, GFP_KERNEL,
88 &buf->dma_attrs);
89 if (!buf->pages) {
90 DRM_ERROR("failed to allocate buffer.\n");
91 return -ENOMEM;
92 }
74 } 93 }
75 94
76 nr_pages = buf->size >> PAGE_SHIFT;
77 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages); 95 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
78 if (!buf->sgt) { 96 if (!buf->sgt) {
79 DRM_ERROR("failed to get sg table.\n"); 97 DRM_ERROR("failed to get sg table.\n");
@@ -92,6 +110,9 @@ err_free_attrs:
92 (dma_addr_t)buf->dma_addr, &buf->dma_attrs); 110 (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
93 buf->dma_addr = (dma_addr_t)NULL; 111 buf->dma_addr = (dma_addr_t)NULL;
94 112
113 if (!is_drm_iommu_supported(dev))
114 kfree(buf->pages);
115
95 return ret; 116 return ret;
96} 117}
97 118
@@ -114,8 +135,14 @@ static void lowlevel_buffer_deallocate(struct drm_device *dev,
114 kfree(buf->sgt); 135 kfree(buf->sgt);
115 buf->sgt = NULL; 136 buf->sgt = NULL;
116 137
117 dma_free_attrs(dev->dev, buf->size, buf->pages, 138 if (!is_drm_iommu_supported(dev)) {
139 dma_free_attrs(dev->dev, buf->size, buf->kvaddr,
118 (dma_addr_t)buf->dma_addr, &buf->dma_attrs); 140 (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
141 kfree(buf->pages);
142 } else
143 dma_free_attrs(dev->dev, buf->size, buf->pages,
144 (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
145
119 buf->dma_addr = (dma_addr_t)NULL; 146 buf->dma_addr = (dma_addr_t)NULL;
120} 147}
121 148
diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.h b/drivers/gpu/drm/exynos/exynos_drm_buf.h
index 25cf1628503..a6412f19673 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_buf.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_buf.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_BUF_H_ 12#ifndef _EXYNOS_DRM_BUF_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index 0f68a287267..ab37437bad8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -5,24 +5,10 @@
5 * Joonyoung Shim <jy0922.shim@samsung.com> 5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#include <drm/drmP.h> 14#include <drm/drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.h b/drivers/gpu/drm/exynos/exynos_drm_connector.h
index 22f6cc442c3..547c6b59035 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.h
@@ -5,24 +5,10 @@
5 * Joonyoung Shim <jy0922.shim@samsung.com> 5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#ifndef _EXYNOS_DRM_CONNECTOR_H_ 14#ifndef _EXYNOS_DRM_CONNECTOR_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 94026ad76a7..4667c9f67ac 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#include <drm/drmP.h> 15#include <drm/drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 2efa4b031d7..e8894bc9e6d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#include <drm/drmP.h> 15#include <drm/drmP.h>
@@ -407,3 +393,33 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
407 exynos_drm_fn_encoder(private->crtc[crtc], &crtc, 393 exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
408 exynos_drm_disable_vblank); 394 exynos_drm_disable_vblank);
409} 395}
396
397void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
398{
399 struct exynos_drm_private *dev_priv = dev->dev_private;
400 struct drm_pending_vblank_event *e, *t;
401 struct timeval now;
402 unsigned long flags;
403
404 DRM_DEBUG_KMS("%s\n", __FILE__);
405
406 spin_lock_irqsave(&dev->event_lock, flags);
407
408 list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
409 base.link) {
410 /* if event's pipe isn't same as crtc then ignore it. */
411 if (crtc != e->pipe)
412 continue;
413
414 do_gettimeofday(&now);
415 e->event.sequence = 0;
416 e->event.tv_sec = now.tv_sec;
417 e->event.tv_usec = now.tv_usec;
418
419 list_move_tail(&e->base.link, &e->base.file_priv->event_list);
420 wake_up_interruptible(&e->base.file_priv->event_wait);
421 drm_vblank_put(dev, crtc);
422 }
423
424 spin_unlock_irqrestore(&dev->event_lock, flags);
425}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
index 6bae8d8c250..3e197e6ae7d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_CRTC_H_ 15#ifndef _EXYNOS_DRM_CRTC_H_
@@ -32,5 +18,6 @@
32int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr); 18int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr);
33int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc); 19int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc);
34void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc); 20void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc);
21void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc);
35 22
36#endif 23#endif
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
index 61d5a8402eb..9df97714b6c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
@@ -3,24 +3,10 @@
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#include <drm/drmP.h> 12#include <drm/drmP.h>
@@ -222,7 +208,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev,
222 struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj); 208 struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
223 209
224 return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops, 210 return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
225 exynos_gem_obj->base.size, 0600); 211 exynos_gem_obj->base.size, flags);
226} 212}
227 213
228struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, 214struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
@@ -246,7 +232,12 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
246 232
247 /* is it from our device? */ 233 /* is it from our device? */
248 if (obj->dev == drm_dev) { 234 if (obj->dev == drm_dev) {
235 /*
236 * Importing dmabuf exported from out own gem increases
237 * refcount on gem itself instead of f_count of dmabuf.
238 */
249 drm_gem_object_reference(obj); 239 drm_gem_object_reference(obj);
240 dma_buf_put(dma_buf);
250 return obj; 241 return obj;
251 } 242 }
252 } 243 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.h b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.h
index 662a8f98ccd..49acfafb4fd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_DMABUF_H_ 12#ifndef _EXYNOS_DRM_DMABUF_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index e0a8e8024b0..3da5c2d214d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -5,24 +5,10 @@
5 * Joonyoung Shim <jy0922.shim@samsung.com> 5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#include <drm/drmP.h> 14#include <drm/drmP.h>
@@ -325,7 +311,7 @@ static int exynos_drm_platform_remove(struct platform_device *pdev)
325 311
326static struct platform_driver exynos_drm_platform_driver = { 312static struct platform_driver exynos_drm_platform_driver = {
327 .probe = exynos_drm_platform_probe, 313 .probe = exynos_drm_platform_probe,
328 .remove = __devexit_p(exynos_drm_platform_remove), 314 .remove = exynos_drm_platform_remove,
329 .driver = { 315 .driver = {
330 .owner = THIS_MODULE, 316 .owner = THIS_MODULE,
331 .name = "exynos-drm", 317 .name = "exynos-drm",
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index f5a97745bf9..b9e51bc09e8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_DRV_H_ 15#ifndef _EXYNOS_DRM_DRV_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 301485215a7..c63721f64ae 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#include <drm/drmP.h> 15#include <drm/drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
index 88bb25a2a91..89e2fb0770a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
@@ -5,24 +5,10 @@
5 * Joonyoung Shim <jy0922.shim@samsung.com> 5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#ifndef _EXYNOS_DRM_ENCODER_H_ 14#ifndef _EXYNOS_DRM_ENCODER_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 5426cc5a5e8..294c0513f58 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#include <drm/drmP.h> 15#include <drm/drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exynos/exynos_drm_fb.h
index 96262e54f76..517471b3756 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h
@@ -5,24 +5,10 @@
5 * Joonyoung Shim <jy0922.shim@samsung.com> 5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#ifndef _EXYNOS_DRM_FB_H_ 14#ifndef _EXYNOS_DRM_FB_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index f433eb7533a..71f867340a8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#include <drm/drmP.h> 15#include <drm/drmP.h>
@@ -34,6 +20,7 @@
34#include "exynos_drm_drv.h" 20#include "exynos_drm_drv.h"
35#include "exynos_drm_fb.h" 21#include "exynos_drm_fb.h"
36#include "exynos_drm_gem.h" 22#include "exynos_drm_gem.h"
23#include "exynos_drm_iommu.h"
37 24
38#define MAX_CONNECTOR 4 25#define MAX_CONNECTOR 4
39#define PREFERRED_BPP 32 26#define PREFERRED_BPP 32
@@ -111,9 +98,18 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
111 98
112 /* map pages with kernel virtual space. */ 99 /* map pages with kernel virtual space. */
113 if (!buffer->kvaddr) { 100 if (!buffer->kvaddr) {
114 unsigned int nr_pages = buffer->size >> PAGE_SHIFT; 101 if (is_drm_iommu_supported(dev)) {
115 buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP, 102 unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
103
104 buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
116 pgprot_writecombine(PAGE_KERNEL)); 105 pgprot_writecombine(PAGE_KERNEL));
106 } else {
107 phys_addr_t dma_addr = buffer->dma_addr;
108 if (dma_addr)
109 buffer->kvaddr = phys_to_virt(dma_addr);
110 else
111 buffer->kvaddr = (void __iomem *)NULL;
112 }
117 if (!buffer->kvaddr) { 113 if (!buffer->kvaddr) {
118 DRM_ERROR("failed to map pages to kernel space.\n"); 114 DRM_ERROR("failed to map pages to kernel space.\n");
119 return -EIO; 115 return -EIO;
@@ -128,8 +124,12 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
128 124
129 dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr; 125 dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
130 fbi->screen_base = buffer->kvaddr + offset; 126 fbi->screen_base = buffer->kvaddr + offset;
131 fbi->fix.smem_start = (unsigned long) 127 if (is_drm_iommu_supported(dev))
128 fbi->fix.smem_start = (unsigned long)
132 (page_to_phys(sg_page(buffer->sgt->sgl)) + offset); 129 (page_to_phys(sg_page(buffer->sgt->sgl)) + offset);
130 else
131 fbi->fix.smem_start = (unsigned long)buffer->dma_addr;
132
133 fbi->screen_size = size; 133 fbi->screen_size = size;
134 fbi->fix.smem_len = size; 134 fbi->fix.smem_len = size;
135 135
@@ -320,7 +320,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
320 struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj; 320 struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
321 struct drm_framebuffer *fb; 321 struct drm_framebuffer *fb;
322 322
323 if (exynos_gem_obj->buffer->kvaddr) 323 if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
324 vunmap(exynos_gem_obj->buffer->kvaddr); 324 vunmap(exynos_gem_obj->buffer->kvaddr);
325 325
326 /* release drm framebuffer and real buffer */ 326 /* release drm framebuffer and real buffer */
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
index ccfce8a1a45..e16d7f0ae19 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_FBDEV_H_ 15#ifndef _EXYNOS_DRM_FBDEV_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 61ea24296b5..67a83e69544 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -25,7 +25,7 @@
25#include "exynos_drm_fimc.h" 25#include "exynos_drm_fimc.h"
26 26
27/* 27/*
28 * FIMC is stand for Fully Interactive Mobile Camera and 28 * FIMC stands for Fully Interactive Mobile Camera and
29 * supports image scaler/rotator and input/output DMA operations. 29 * supports image scaler/rotator and input/output DMA operations.
30 * input DMA reads image data from the memory. 30 * input DMA reads image data from the memory.
31 * output DMA writes image data to memory. 31 * output DMA writes image data to memory.
@@ -163,19 +163,29 @@ struct fimc_context {
163 bool suspended; 163 bool suspended;
164}; 164};
165 165
166static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) 166static void fimc_sw_reset(struct fimc_context *ctx)
167{ 167{
168 u32 cfg; 168 u32 cfg;
169 169
170 DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern); 170 DRM_DEBUG_KMS("%s\n", __func__);
171
172 /* stop dma operation */
173 cfg = fimc_read(EXYNOS_CISTATUS);
174 if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) {
175 cfg = fimc_read(EXYNOS_MSCTRL);
176 cfg &= ~EXYNOS_MSCTRL_ENVID;
177 fimc_write(cfg, EXYNOS_MSCTRL);
178 }
171 179
172 cfg = fimc_read(EXYNOS_CISRCFMT); 180 cfg = fimc_read(EXYNOS_CISRCFMT);
173 cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; 181 cfg |= EXYNOS_CISRCFMT_ITU601_8BIT;
174 if (pattern)
175 cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR;
176
177 fimc_write(cfg, EXYNOS_CISRCFMT); 182 fimc_write(cfg, EXYNOS_CISRCFMT);
178 183
184 /* disable image capture */
185 cfg = fimc_read(EXYNOS_CIIMGCPT);
186 cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN);
187 fimc_write(cfg, EXYNOS_CIIMGCPT);
188
179 /* s/w reset */ 189 /* s/w reset */
180 cfg = fimc_read(EXYNOS_CIGCTRL); 190 cfg = fimc_read(EXYNOS_CIGCTRL);
181 cfg |= (EXYNOS_CIGCTRL_SWRST); 191 cfg |= (EXYNOS_CIGCTRL_SWRST);
@@ -695,7 +705,7 @@ static int fimc_src_set_addr(struct device *dev,
695{ 705{
696 struct fimc_context *ctx = get_fimc_context(dev); 706 struct fimc_context *ctx = get_fimc_context(dev);
697 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 707 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
698 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 708 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
699 struct drm_exynos_ipp_property *property; 709 struct drm_exynos_ipp_property *property;
700 struct drm_exynos_ipp_config *config; 710 struct drm_exynos_ipp_config *config;
701 711
@@ -705,10 +715,6 @@ static int fimc_src_set_addr(struct device *dev,
705 } 715 }
706 716
707 property = &c_node->property; 717 property = &c_node->property;
708 if (!property) {
709 DRM_ERROR("failed to get property.\n");
710 return -EINVAL;
711 }
712 718
713 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, 719 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
714 property->prop_id, buf_id, buf_type); 720 property->prop_id, buf_id, buf_type);
@@ -1206,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
1206 } 1212 }
1207 1213
1208 /* sequence id */ 1214 /* sequence id */
1209 cfg &= (~mask); 1215 cfg &= ~mask;
1210 cfg |= (enable << buf_id); 1216 cfg |= (enable << buf_id);
1211 fimc_write(cfg, EXYNOS_CIFCNTSEQ); 1217 fimc_write(cfg, EXYNOS_CIFCNTSEQ);
1212 1218
@@ -1231,7 +1237,7 @@ static int fimc_dst_set_addr(struct device *dev,
1231{ 1237{
1232 struct fimc_context *ctx = get_fimc_context(dev); 1238 struct fimc_context *ctx = get_fimc_context(dev);
1233 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1239 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1234 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1240 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1235 struct drm_exynos_ipp_property *property; 1241 struct drm_exynos_ipp_property *property;
1236 struct drm_exynos_ipp_config *config; 1242 struct drm_exynos_ipp_config *config;
1237 1243
@@ -1241,10 +1247,6 @@ static int fimc_dst_set_addr(struct device *dev,
1241 } 1247 }
1242 1248
1243 property = &c_node->property; 1249 property = &c_node->property;
1244 if (!property) {
1245 DRM_ERROR("failed to get property.\n");
1246 return -EINVAL;
1247 }
1248 1250
1249 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, 1251 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
1250 property->prop_id, buf_id, buf_type); 1252 property->prop_id, buf_id, buf_type);
@@ -1317,7 +1319,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
1317{ 1319{
1318 struct fimc_context *ctx = dev_id; 1320 struct fimc_context *ctx = dev_id;
1319 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1321 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1320 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1322 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1321 struct drm_exynos_ipp_event_work *event_work = 1323 struct drm_exynos_ipp_event_work *event_work =
1322 c_node->event_work; 1324 c_node->event_work;
1323 int buf_id; 1325 int buf_id;
@@ -1395,6 +1397,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
1395 case EXYNOS_DRM_FLIP_NONE: 1397 case EXYNOS_DRM_FLIP_NONE:
1396 case EXYNOS_DRM_FLIP_VERTICAL: 1398 case EXYNOS_DRM_FLIP_VERTICAL:
1397 case EXYNOS_DRM_FLIP_HORIZONTAL: 1399 case EXYNOS_DRM_FLIP_HORIZONTAL:
1400 case EXYNOS_DRM_FLIP_BOTH:
1398 return true; 1401 return true;
1399 default: 1402 default:
1400 DRM_DEBUG_KMS("%s:invalid flip\n", __func__); 1403 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1543,7 +1546,7 @@ static int fimc_ippdrv_reset(struct device *dev)
1543 DRM_DEBUG_KMS("%s\n", __func__); 1546 DRM_DEBUG_KMS("%s\n", __func__);
1544 1547
1545 /* reset h/w block */ 1548 /* reset h/w block */
1546 fimc_sw_reset(ctx, false); 1549 fimc_sw_reset(ctx);
1547 1550
1548 /* reset scaler capability */ 1551 /* reset scaler capability */
1549 memset(&ctx->sc, 0x0, sizeof(ctx->sc)); 1552 memset(&ctx->sc, 0x0, sizeof(ctx->sc));
@@ -1557,7 +1560,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1557{ 1560{
1558 struct fimc_context *ctx = get_fimc_context(dev); 1561 struct fimc_context *ctx = get_fimc_context(dev);
1559 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1562 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1560 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1563 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1561 struct drm_exynos_ipp_property *property; 1564 struct drm_exynos_ipp_property *property;
1562 struct drm_exynos_ipp_config *config; 1565 struct drm_exynos_ipp_config *config;
1563 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; 1566 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1573,10 +1576,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1573 } 1576 }
1574 1577
1575 property = &c_node->property; 1578 property = &c_node->property;
1576 if (!property) {
1577 DRM_ERROR("failed to get property.\n");
1578 return -EINVAL;
1579 }
1580 1579
1581 fimc_handle_irq(ctx, true, false, true); 1580 fimc_handle_irq(ctx, true, false, true);
1582 1581
@@ -1714,7 +1713,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1714 fimc_write(cfg, EXYNOS_CIGCTRL); 1713 fimc_write(cfg, EXYNOS_CIGCTRL);
1715} 1714}
1716 1715
1717static int __devinit fimc_probe(struct platform_device *pdev) 1716static int fimc_probe(struct platform_device *pdev)
1718{ 1717{
1719 struct device *dev = &pdev->dev; 1718 struct device *dev = &pdev->dev;
1720 struct fimc_context *ctx; 1719 struct fimc_context *ctx;
@@ -1739,93 +1738,64 @@ static int __devinit fimc_probe(struct platform_device *pdev)
1739 platform_get_device_id(pdev)->driver_data; 1738 platform_get_device_id(pdev)->driver_data;
1740 1739
1741 /* clock control */ 1740 /* clock control */
1742 ctx->sclk_fimc_clk = clk_get(dev, "sclk_fimc"); 1741 ctx->sclk_fimc_clk = devm_clk_get(dev, "sclk_fimc");
1743 if (IS_ERR(ctx->sclk_fimc_clk)) { 1742 if (IS_ERR(ctx->sclk_fimc_clk)) {
1744 dev_err(dev, "failed to get src fimc clock.\n"); 1743 dev_err(dev, "failed to get src fimc clock.\n");
1745 ret = PTR_ERR(ctx->sclk_fimc_clk); 1744 return PTR_ERR(ctx->sclk_fimc_clk);
1746 goto err_ctx;
1747 } 1745 }
1748 clk_enable(ctx->sclk_fimc_clk); 1746 clk_enable(ctx->sclk_fimc_clk);
1749 1747
1750 ctx->fimc_clk = clk_get(dev, "fimc"); 1748 ctx->fimc_clk = devm_clk_get(dev, "fimc");
1751 if (IS_ERR(ctx->fimc_clk)) { 1749 if (IS_ERR(ctx->fimc_clk)) {
1752 dev_err(dev, "failed to get fimc clock.\n"); 1750 dev_err(dev, "failed to get fimc clock.\n");
1753 ret = PTR_ERR(ctx->fimc_clk);
1754 clk_disable(ctx->sclk_fimc_clk); 1751 clk_disable(ctx->sclk_fimc_clk);
1755 clk_put(ctx->sclk_fimc_clk); 1752 return PTR_ERR(ctx->fimc_clk);
1756 goto err_ctx;
1757 } 1753 }
1758 1754
1759 ctx->wb_clk = clk_get(dev, "pxl_async0"); 1755 ctx->wb_clk = devm_clk_get(dev, "pxl_async0");
1760 if (IS_ERR(ctx->wb_clk)) { 1756 if (IS_ERR(ctx->wb_clk)) {
1761 dev_err(dev, "failed to get writeback a clock.\n"); 1757 dev_err(dev, "failed to get writeback a clock.\n");
1762 ret = PTR_ERR(ctx->wb_clk);
1763 clk_disable(ctx->sclk_fimc_clk); 1758 clk_disable(ctx->sclk_fimc_clk);
1764 clk_put(ctx->sclk_fimc_clk); 1759 return PTR_ERR(ctx->wb_clk);
1765 clk_put(ctx->fimc_clk);
1766 goto err_ctx;
1767 } 1760 }
1768 1761
1769 ctx->wb_b_clk = clk_get(dev, "pxl_async1"); 1762 ctx->wb_b_clk = devm_clk_get(dev, "pxl_async1");
1770 if (IS_ERR(ctx->wb_b_clk)) { 1763 if (IS_ERR(ctx->wb_b_clk)) {
1771 dev_err(dev, "failed to get writeback b clock.\n"); 1764 dev_err(dev, "failed to get writeback b clock.\n");
1772 ret = PTR_ERR(ctx->wb_b_clk);
1773 clk_disable(ctx->sclk_fimc_clk); 1765 clk_disable(ctx->sclk_fimc_clk);
1774 clk_put(ctx->sclk_fimc_clk); 1766 return PTR_ERR(ctx->wb_b_clk);
1775 clk_put(ctx->fimc_clk);
1776 clk_put(ctx->wb_clk);
1777 goto err_ctx;
1778 } 1767 }
1779 1768
1780 parent_clk = clk_get(dev, ddata->parent_clk); 1769 parent_clk = devm_clk_get(dev, ddata->parent_clk);
1781 1770
1782 if (IS_ERR(parent_clk)) { 1771 if (IS_ERR(parent_clk)) {
1783 dev_err(dev, "failed to get parent clock.\n"); 1772 dev_err(dev, "failed to get parent clock.\n");
1784 ret = PTR_ERR(parent_clk);
1785 clk_disable(ctx->sclk_fimc_clk); 1773 clk_disable(ctx->sclk_fimc_clk);
1786 clk_put(ctx->sclk_fimc_clk); 1774 return PTR_ERR(parent_clk);
1787 clk_put(ctx->fimc_clk);
1788 clk_put(ctx->wb_clk);
1789 clk_put(ctx->wb_b_clk);
1790 goto err_ctx;
1791 } 1775 }
1792 1776
1793 if (clk_set_parent(ctx->sclk_fimc_clk, parent_clk)) { 1777 if (clk_set_parent(ctx->sclk_fimc_clk, parent_clk)) {
1794 dev_err(dev, "failed to set parent.\n"); 1778 dev_err(dev, "failed to set parent.\n");
1795 ret = -EINVAL;
1796 clk_put(parent_clk);
1797 clk_disable(ctx->sclk_fimc_clk); 1779 clk_disable(ctx->sclk_fimc_clk);
1798 clk_put(ctx->sclk_fimc_clk); 1780 return -EINVAL;
1799 clk_put(ctx->fimc_clk);
1800 clk_put(ctx->wb_clk);
1801 clk_put(ctx->wb_b_clk);
1802 goto err_ctx;
1803 } 1781 }
1804 1782
1805 clk_put(parent_clk); 1783 devm_clk_put(dev, parent_clk);
1806 clk_set_rate(ctx->sclk_fimc_clk, pdata->clk_rate); 1784 clk_set_rate(ctx->sclk_fimc_clk, pdata->clk_rate);
1807 1785
1808 /* resource memory */ 1786 /* resource memory */
1809 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1787 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1810 if (!ctx->regs_res) {
1811 dev_err(dev, "failed to find registers.\n");
1812 ret = -ENOENT;
1813 goto err_clk;
1814 }
1815
1816 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res); 1788 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
1817 if (!ctx->regs) { 1789 if (!ctx->regs) {
1818 dev_err(dev, "failed to map registers.\n"); 1790 dev_err(dev, "failed to map registers.\n");
1819 ret = -ENXIO; 1791 return -ENXIO;
1820 goto err_clk;
1821 } 1792 }
1822 1793
1823 /* resource irq */ 1794 /* resource irq */
1824 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1795 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1825 if (!res) { 1796 if (!res) {
1826 dev_err(dev, "failed to request irq resource.\n"); 1797 dev_err(dev, "failed to request irq resource.\n");
1827 ret = -ENOENT; 1798 return -ENOENT;
1828 goto err_get_regs;
1829 } 1799 }
1830 1800
1831 ctx->irq = res->start; 1801 ctx->irq = res->start;
@@ -1833,7 +1803,7 @@ static int __devinit fimc_probe(struct platform_device *pdev)
1833 IRQF_ONESHOT, "drm_fimc", ctx); 1803 IRQF_ONESHOT, "drm_fimc", ctx);
1834 if (ret < 0) { 1804 if (ret < 0) {
1835 dev_err(dev, "failed to request irq.\n"); 1805 dev_err(dev, "failed to request irq.\n");
1836 goto err_get_regs; 1806 return ret;
1837 } 1807 }
1838 1808
1839 /* context initailization */ 1809 /* context initailization */
@@ -1879,19 +1849,11 @@ err_ippdrv_register:
1879 pm_runtime_disable(dev); 1849 pm_runtime_disable(dev);
1880err_get_irq: 1850err_get_irq:
1881 free_irq(ctx->irq, ctx); 1851 free_irq(ctx->irq, ctx);
1882err_get_regs: 1852
1883 devm_iounmap(dev, ctx->regs);
1884err_clk:
1885 clk_put(ctx->sclk_fimc_clk);
1886 clk_put(ctx->fimc_clk);
1887 clk_put(ctx->wb_clk);
1888 clk_put(ctx->wb_b_clk);
1889err_ctx:
1890 devm_kfree(dev, ctx);
1891 return ret; 1853 return ret;
1892} 1854}
1893 1855
1894static int __devexit fimc_remove(struct platform_device *pdev) 1856static int fimc_remove(struct platform_device *pdev)
1895{ 1857{
1896 struct device *dev = &pdev->dev; 1858 struct device *dev = &pdev->dev;
1897 struct fimc_context *ctx = get_fimc_context(dev); 1859 struct fimc_context *ctx = get_fimc_context(dev);
@@ -1905,14 +1867,6 @@ static int __devexit fimc_remove(struct platform_device *pdev)
1905 pm_runtime_disable(dev); 1867 pm_runtime_disable(dev);
1906 1868
1907 free_irq(ctx->irq, ctx); 1869 free_irq(ctx->irq, ctx);
1908 devm_iounmap(dev, ctx->regs);
1909
1910 clk_put(ctx->sclk_fimc_clk);
1911 clk_put(ctx->fimc_clk);
1912 clk_put(ctx->wb_clk);
1913 clk_put(ctx->wb_b_clk);
1914
1915 devm_kfree(dev, ctx);
1916 1870
1917 return 0; 1871 return 0;
1918} 1872}
@@ -1990,7 +1944,7 @@ static const struct dev_pm_ops fimc_pm_ops = {
1990 1944
1991struct platform_driver fimc_driver = { 1945struct platform_driver fimc_driver = {
1992 .probe = fimc_probe, 1946 .probe = fimc_probe,
1993 .remove = __devexit_p(fimc_remove), 1947 .remove = fimc_remove,
1994 .id_table = fimc_driver_ids, 1948 .id_table = fimc_driver_ids,
1995 .driver = { 1949 .driver = {
1996 .name = "exynos-drm-fimc", 1950 .name = "exynos-drm-fimc",
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.h b/drivers/gpu/drm/exynos/exynos_drm_fimc.h
index dc970fa0d88..127a424c5fd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.h
@@ -6,24 +6,10 @@
6 * Jinyoung Jeon <jy0.jeon@samsung.com> 6 * Jinyoung Jeon <jy0.jeon@samsung.com>
7 * Sangmin Lee <lsmin.lee@samsung.com> 7 * Sangmin Lee <lsmin.lee@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_FIMC_H_ 15#ifndef _EXYNOS_DRM_FIMC_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf0d9baca2b..9537761931e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -663,34 +663,6 @@ static struct exynos_drm_manager fimd_manager = {
663 .display_ops = &fimd_display_ops, 663 .display_ops = &fimd_display_ops,
664}; 664};
665 665
666static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
667{
668 struct exynos_drm_private *dev_priv = drm_dev->dev_private;
669 struct drm_pending_vblank_event *e, *t;
670 struct timeval now;
671 unsigned long flags;
672
673 spin_lock_irqsave(&drm_dev->event_lock, flags);
674
675 list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
676 base.link) {
677 /* if event's pipe isn't same as crtc then ignore it. */
678 if (crtc != e->pipe)
679 continue;
680
681 do_gettimeofday(&now);
682 e->event.sequence = 0;
683 e->event.tv_sec = now.tv_sec;
684 e->event.tv_usec = now.tv_usec;
685
686 list_move_tail(&e->base.link, &e->base.file_priv->event_list);
687 wake_up_interruptible(&e->base.file_priv->event_wait);
688 drm_vblank_put(drm_dev, crtc);
689 }
690
691 spin_unlock_irqrestore(&drm_dev->event_lock, flags);
692}
693
694static irqreturn_t fimd_irq_handler(int irq, void *dev_id) 666static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
695{ 667{
696 struct fimd_context *ctx = (struct fimd_context *)dev_id; 668 struct fimd_context *ctx = (struct fimd_context *)dev_id;
@@ -710,7 +682,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
710 goto out; 682 goto out;
711 683
712 drm_handle_vblank(drm_dev, manager->pipe); 684 drm_handle_vblank(drm_dev, manager->pipe);
713 fimd_finish_pageflip(drm_dev, manager->pipe); 685 exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe);
714 686
715 /* set wait vsync event to zero and wake up queue. */ 687 /* set wait vsync event to zero and wake up queue. */
716 if (atomic_read(&ctx->wait_vsync_event)) { 688 if (atomic_read(&ctx->wait_vsync_event)) {
@@ -898,7 +870,7 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
898 return 0; 870 return 0;
899} 871}
900 872
901static int __devinit fimd_probe(struct platform_device *pdev) 873static int fimd_probe(struct platform_device *pdev)
902{ 874{
903 struct device *dev = &pdev->dev; 875 struct device *dev = &pdev->dev;
904 struct fimd_context *ctx; 876 struct fimd_context *ctx;
@@ -997,7 +969,7 @@ static int __devinit fimd_probe(struct platform_device *pdev)
997 return 0; 969 return 0;
998} 970}
999 971
1000static int __devexit fimd_remove(struct platform_device *pdev) 972static int fimd_remove(struct platform_device *pdev)
1001{ 973{
1002 struct device *dev = &pdev->dev; 974 struct device *dev = &pdev->dev;
1003 struct fimd_context *ctx = platform_get_drvdata(pdev); 975 struct fimd_context *ctx = platform_get_drvdata(pdev);
@@ -1046,7 +1018,7 @@ static int fimd_resume(struct device *dev)
1046 * of pm runtime would still be 1 so in this case, fimd driver 1018 * of pm runtime would still be 1 so in this case, fimd driver
1047 * should be on directly not drawing on pm runtime interface. 1019 * should be on directly not drawing on pm runtime interface.
1048 */ 1020 */
1049 if (pm_runtime_suspended(dev)) { 1021 if (!pm_runtime_suspended(dev)) {
1050 int ret; 1022 int ret;
1051 1023
1052 ret = fimd_activate(ctx, true); 1024 ret = fimd_activate(ctx, true);
@@ -1105,7 +1077,7 @@ static const struct dev_pm_ops fimd_pm_ops = {
1105 1077
1106struct platform_driver fimd_driver = { 1078struct platform_driver fimd_driver = {
1107 .probe = fimd_probe, 1079 .probe = fimd_probe,
1108 .remove = __devexit_p(fimd_remove), 1080 .remove = fimd_remove,
1109 .id_table = fimd_driver_ids, 1081 .id_table = fimd_driver_ids,
1110 .driver = { 1082 .driver = {
1111 .name = "exynos4-fb", 1083 .name = "exynos4-fb",
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 6ffa0763c07..36c3905536a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1090,7 +1090,7 @@ static void g2d_close(struct drm_device *drm_dev, struct device *dev,
1090 kfree(file_priv->g2d_priv); 1090 kfree(file_priv->g2d_priv);
1091} 1091}
1092 1092
1093static int __devinit g2d_probe(struct platform_device *pdev) 1093static int g2d_probe(struct platform_device *pdev)
1094{ 1094{
1095 struct device *dev = &pdev->dev; 1095 struct device *dev = &pdev->dev;
1096 struct resource *res; 1096 struct resource *res;
@@ -1188,7 +1188,7 @@ err_destroy_slab:
1188 return ret; 1188 return ret;
1189} 1189}
1190 1190
1191static int __devexit g2d_remove(struct platform_device *pdev) 1191static int g2d_remove(struct platform_device *pdev)
1192{ 1192{
1193 struct g2d_data *g2d = platform_get_drvdata(pdev); 1193 struct g2d_data *g2d = platform_get_drvdata(pdev);
1194 1194
@@ -1242,7 +1242,7 @@ static SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume);
1242 1242
1243struct platform_driver g2d_driver = { 1243struct platform_driver g2d_driver = {
1244 .probe = g2d_probe, 1244 .probe = g2d_probe,
1245 .remove = __devexit_p(g2d_remove), 1245 .remove = g2d_remove,
1246 .driver = { 1246 .driver = {
1247 .name = "s5p-g2d", 1247 .name = "s5p-g2d",
1248 .owner = THIS_MODULE, 1248 .owner = THIS_MODULE,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index d48183e7e05..47318077652 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -3,24 +3,10 @@
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#include <drm/drmP.h> 12#include <drm/drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
index f11f2afd5bf..35ebac47dc2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Authoer: Inki Dae <inki.dae@samsung.com> 4 * Authoer: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_GEM_H_ 12#ifndef _EXYNOS_DRM_GEM_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 5639353d47b..8140753ec9c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -25,7 +25,7 @@
25#include "exynos_drm_gsc.h" 25#include "exynos_drm_gsc.h"
26 26
27/* 27/*
28 * GSC is stand for General SCaler and 28 * GSC stands for General SCaler and
29 * supports image scaler/rotator and input/output DMA operations. 29 * supports image scaler/rotator and input/output DMA operations.
30 * input DMA reads image data from the memory. 30 * input DMA reads image data from the memory.
31 * output DMA writes image data to memory. 31 * output DMA writes image data to memory.
@@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev,
711{ 711{
712 struct gsc_context *ctx = get_gsc_context(dev); 712 struct gsc_context *ctx = get_gsc_context(dev);
713 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 713 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
714 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 714 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
715 struct drm_exynos_ipp_property *property; 715 struct drm_exynos_ipp_property *property;
716 716
717 if (!c_node) { 717 if (!c_node) {
@@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev,
720 } 720 }
721 721
722 property = &c_node->property; 722 property = &c_node->property;
723 if (!property) {
724 DRM_ERROR("failed to get property.\n");
725 return -EFAULT;
726 }
727 723
728 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, 724 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
729 property->prop_id, buf_id, buf_type); 725 property->prop_id, buf_id, buf_type);
@@ -1171,7 +1167,7 @@ static int gsc_dst_set_addr(struct device *dev,
1171{ 1167{
1172 struct gsc_context *ctx = get_gsc_context(dev); 1168 struct gsc_context *ctx = get_gsc_context(dev);
1173 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1169 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1174 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1170 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1175 struct drm_exynos_ipp_property *property; 1171 struct drm_exynos_ipp_property *property;
1176 1172
1177 if (!c_node) { 1173 if (!c_node) {
@@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev,
1180 } 1176 }
1181 1177
1182 property = &c_node->property; 1178 property = &c_node->property;
1183 if (!property) {
1184 DRM_ERROR("failed to get property.\n");
1185 return -EFAULT;
1186 }
1187 1179
1188 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, 1180 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
1189 property->prop_id, buf_id, buf_type); 1181 property->prop_id, buf_id, buf_type);
@@ -1312,7 +1304,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
1312{ 1304{
1313 struct gsc_context *ctx = dev_id; 1305 struct gsc_context *ctx = dev_id;
1314 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1306 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1315 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1307 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1316 struct drm_exynos_ipp_event_work *event_work = 1308 struct drm_exynos_ipp_event_work *event_work =
1317 c_node->event_work; 1309 c_node->event_work;
1318 u32 status; 1310 u32 status;
@@ -1399,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip)
1399 case EXYNOS_DRM_FLIP_NONE: 1391 case EXYNOS_DRM_FLIP_NONE:
1400 case EXYNOS_DRM_FLIP_VERTICAL: 1392 case EXYNOS_DRM_FLIP_VERTICAL:
1401 case EXYNOS_DRM_FLIP_HORIZONTAL: 1393 case EXYNOS_DRM_FLIP_HORIZONTAL:
1402 case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: 1394 case EXYNOS_DRM_FLIP_BOTH:
1403 return true; 1395 return true;
1404 default: 1396 default:
1405 DRM_DEBUG_KMS("%s:invalid flip\n", __func__); 1397 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1549,7 +1541,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1549{ 1541{
1550 struct gsc_context *ctx = get_gsc_context(dev); 1542 struct gsc_context *ctx = get_gsc_context(dev);
1551 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; 1543 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1552 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 1544 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
1553 struct drm_exynos_ipp_property *property; 1545 struct drm_exynos_ipp_property *property;
1554 struct drm_exynos_ipp_config *config; 1546 struct drm_exynos_ipp_config *config;
1555 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; 1547 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1565 } 1557 }
1566 1558
1567 property = &c_node->property; 1559 property = &c_node->property;
1568 if (!property) {
1569 DRM_ERROR("failed to get property.\n");
1570 return -EINVAL;
1571 }
1572 1560
1573 gsc_handle_irq(ctx, true, false, true); 1561 gsc_handle_irq(ctx, true, false, true);
1574 1562
@@ -1604,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1604 exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)&set_wb); 1592 exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)&set_wb);
1605 1593
1606 /* src local path */ 1594 /* src local path */
1607 cfg = readl(GSC_IN_CON); 1595 cfg = gsc_read(GSC_IN_CON);
1608 cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); 1596 cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK);
1609 cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); 1597 cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB);
1610 gsc_write(cfg, GSC_IN_CON); 1598 gsc_write(cfg, GSC_IN_CON);
@@ -1683,7 +1671,7 @@ static void gsc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
1683 gsc_write(cfg, GSC_ENABLE); 1671 gsc_write(cfg, GSC_ENABLE);
1684} 1672}
1685 1673
1686static int __devinit gsc_probe(struct platform_device *pdev) 1674static int gsc_probe(struct platform_device *pdev)
1687{ 1675{
1688 struct device *dev = &pdev->dev; 1676 struct device *dev = &pdev->dev;
1689 struct gsc_context *ctx; 1677 struct gsc_context *ctx;
@@ -1696,34 +1684,25 @@ static int __devinit gsc_probe(struct platform_device *pdev)
1696 return -ENOMEM; 1684 return -ENOMEM;
1697 1685
1698 /* clock control */ 1686 /* clock control */
1699 ctx->gsc_clk = clk_get(dev, "gscl"); 1687 ctx->gsc_clk = devm_clk_get(dev, "gscl");
1700 if (IS_ERR(ctx->gsc_clk)) { 1688 if (IS_ERR(ctx->gsc_clk)) {
1701 dev_err(dev, "failed to get gsc clock.\n"); 1689 dev_err(dev, "failed to get gsc clock.\n");
1702 ret = PTR_ERR(ctx->gsc_clk); 1690 return PTR_ERR(ctx->gsc_clk);
1703 goto err_ctx;
1704 } 1691 }
1705 1692
1706 /* resource memory */ 1693 /* resource memory */
1707 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1694 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1708 if (!ctx->regs_res) {
1709 dev_err(dev, "failed to find registers.\n");
1710 ret = -ENOENT;
1711 goto err_clk;
1712 }
1713
1714 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res); 1695 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
1715 if (!ctx->regs) { 1696 if (!ctx->regs) {
1716 dev_err(dev, "failed to map registers.\n"); 1697 dev_err(dev, "failed to map registers.\n");
1717 ret = -ENXIO; 1698 return -ENXIO;
1718 goto err_clk;
1719 } 1699 }
1720 1700
1721 /* resource irq */ 1701 /* resource irq */
1722 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1702 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1723 if (!res) { 1703 if (!res) {
1724 dev_err(dev, "failed to request irq resource.\n"); 1704 dev_err(dev, "failed to request irq resource.\n");
1725 ret = -ENOENT; 1705 return -ENOENT;
1726 goto err_get_regs;
1727 } 1706 }
1728 1707
1729 ctx->irq = res->start; 1708 ctx->irq = res->start;
@@ -1731,7 +1710,7 @@ static int __devinit gsc_probe(struct platform_device *pdev)
1731 IRQF_ONESHOT, "drm_gsc", ctx); 1710 IRQF_ONESHOT, "drm_gsc", ctx);
1732 if (ret < 0) { 1711 if (ret < 0) {
1733 dev_err(dev, "failed to request irq.\n"); 1712 dev_err(dev, "failed to request irq.\n");
1734 goto err_get_regs; 1713 return ret;
1735 } 1714 }
1736 1715
1737 /* context initailization */ 1716 /* context initailization */
@@ -1775,16 +1754,10 @@ err_ippdrv_register:
1775 pm_runtime_disable(dev); 1754 pm_runtime_disable(dev);
1776err_get_irq: 1755err_get_irq:
1777 free_irq(ctx->irq, ctx); 1756 free_irq(ctx->irq, ctx);
1778err_get_regs:
1779 devm_iounmap(dev, ctx->regs);
1780err_clk:
1781 clk_put(ctx->gsc_clk);
1782err_ctx:
1783 devm_kfree(dev, ctx);
1784 return ret; 1757 return ret;
1785} 1758}
1786 1759
1787static int __devexit gsc_remove(struct platform_device *pdev) 1760static int gsc_remove(struct platform_device *pdev)
1788{ 1761{
1789 struct device *dev = &pdev->dev; 1762 struct device *dev = &pdev->dev;
1790 struct gsc_context *ctx = get_gsc_context(dev); 1763 struct gsc_context *ctx = get_gsc_context(dev);
@@ -1798,11 +1771,6 @@ static int __devexit gsc_remove(struct platform_device *pdev)
1798 pm_runtime_disable(dev); 1771 pm_runtime_disable(dev);
1799 1772
1800 free_irq(ctx->irq, ctx); 1773 free_irq(ctx->irq, ctx);
1801 devm_iounmap(dev, ctx->regs);
1802
1803 clk_put(ctx->gsc_clk);
1804
1805 devm_kfree(dev, ctx);
1806 1774
1807 return 0; 1775 return 0;
1808} 1776}
@@ -1860,7 +1828,7 @@ static const struct dev_pm_ops gsc_pm_ops = {
1860 1828
1861struct platform_driver gsc_driver = { 1829struct platform_driver gsc_driver = {
1862 .probe = gsc_probe, 1830 .probe = gsc_probe,
1863 .remove = __devexit_p(gsc_remove), 1831 .remove = gsc_remove,
1864 .driver = { 1832 .driver = {
1865 .name = "exynos-drm-gsc", 1833 .name = "exynos-drm-gsc",
1866 .owner = THIS_MODULE, 1834 .owner = THIS_MODULE,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.h b/drivers/gpu/drm/exynos/exynos_drm_gsc.h
index b3c3bc618c0..29ec1c5efcf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.h
@@ -6,24 +6,10 @@
6 * Jinyoung Jeon <jy0.jeon@samsung.com> 6 * Jinyoung Jeon <jy0.jeon@samsung.com>
7 * Sangmin Lee <lsmin.lee@samsung.com> 7 * Sangmin Lee <lsmin.lee@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_GSC_H_ 15#ifndef _EXYNOS_DRM_GSC_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index 55793c46e3c..850e9950b7d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -385,7 +385,7 @@ static void hdmi_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
385 mixer_ops->iommu_on(ctx->mixer_ctx->ctx, false); 385 mixer_ops->iommu_on(ctx->mixer_ctx->ctx, false);
386} 386}
387 387
388static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) 388static int exynos_drm_hdmi_probe(struct platform_device *pdev)
389{ 389{
390 struct device *dev = &pdev->dev; 390 struct device *dev = &pdev->dev;
391 struct exynos_drm_subdrv *subdrv; 391 struct exynos_drm_subdrv *subdrv;
@@ -413,7 +413,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
413 return 0; 413 return 0;
414} 414}
415 415
416static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev) 416static int exynos_drm_hdmi_remove(struct platform_device *pdev)
417{ 417{
418 struct drm_hdmi_context *ctx = platform_get_drvdata(pdev); 418 struct drm_hdmi_context *ctx = platform_get_drvdata(pdev);
419 419
@@ -426,7 +426,7 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev)
426 426
427struct platform_driver exynos_drm_common_hdmi_driver = { 427struct platform_driver exynos_drm_common_hdmi_driver = {
428 .probe = exynos_drm_hdmi_probe, 428 .probe = exynos_drm_hdmi_probe,
429 .remove = __devexit_p(exynos_drm_hdmi_remove), 429 .remove = exynos_drm_hdmi_remove,
430 .driver = { 430 .driver = {
431 .name = "exynos-drm-hdmi", 431 .name = "exynos-drm-hdmi",
432 .owner = THIS_MODULE, 432 .owner = THIS_MODULE,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
index fcc3093ec8f..784a7e9a766 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Authoer: Inki Dae <inki.dae@samsung.com> 4 * Authoer: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_HDMI_H_ 12#ifndef _EXYNOS_DRM_HDMI_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index 2482b7f9634..3799d5c2b5d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -3,24 +3,10 @@
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#include <drmP.h> 12#include <drmP.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.h b/drivers/gpu/drm/exynos/exynos_drm_iommu.h
index 18a0ca190b9..53b7deea8ab 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Authoer: Inki Dae <inki.dae@samsung.com> 4 * Authoer: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_IOMMU_H_ 12#ifndef _EXYNOS_DRM_IOMMU_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 49eebe948ed..0bda96454a0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -27,7 +27,7 @@
27#include "exynos_drm_iommu.h" 27#include "exynos_drm_iommu.h"
28 28
29/* 29/*
30 * IPP is stand for Image Post Processing and 30 * IPP stands for Image Post Processing and
31 * supports image scaler/rotator and input/output DMA operations. 31 * supports image scaler/rotator and input/output DMA operations.
32 * using FIMC, GSC, Rotator, so on. 32 * using FIMC, GSC, Rotator, so on.
33 * IPP is integration device driver of same attribute h/w 33 * IPP is integration device driver of same attribute h/w
@@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
1292 DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id); 1292 DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
1293 1293
1294 /* store command info in ippdrv */ 1294 /* store command info in ippdrv */
1295 ippdrv->cmd = c_node; 1295 ippdrv->c_node = c_node;
1296 1296
1297 if (!ipp_check_mem_list(c_node)) { 1297 if (!ipp_check_mem_list(c_node)) {
1298 DRM_DEBUG_KMS("%s:empty memory.\n", __func__); 1298 DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
@@ -1303,7 +1303,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
1303 ret = ipp_set_property(ippdrv, property); 1303 ret = ipp_set_property(ippdrv, property);
1304 if (ret) { 1304 if (ret) {
1305 DRM_ERROR("failed to set property.\n"); 1305 DRM_ERROR("failed to set property.\n");
1306 ippdrv->cmd = NULL; 1306 ippdrv->c_node = NULL;
1307 return ret; 1307 return ret;
1308 } 1308 }
1309 1309
@@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work)
1487 mutex_lock(&c_node->cmd_lock); 1487 mutex_lock(&c_node->cmd_lock);
1488 1488
1489 property = &c_node->property; 1489 property = &c_node->property;
1490 if (!property) {
1491 DRM_ERROR("failed to get property:prop_id[%d]\n",
1492 c_node->property.prop_id);
1493 goto err_unlock;
1494 }
1495 1490
1496 switch (cmd_work->ctrl) { 1491 switch (cmd_work->ctrl) {
1497 case IPP_CTRL_PLAY: 1492 case IPP_CTRL_PLAY:
@@ -1704,7 +1699,7 @@ void ipp_sched_event(struct work_struct *work)
1704 return; 1699 return;
1705 } 1700 }
1706 1701
1707 c_node = ippdrv->cmd; 1702 c_node = ippdrv->c_node;
1708 if (!c_node) { 1703 if (!c_node) {
1709 DRM_ERROR("failed to get command node.\n"); 1704 DRM_ERROR("failed to get command node.\n");
1710 return; 1705 return;
@@ -1888,14 +1883,14 @@ err_clear:
1888 return; 1883 return;
1889} 1884}
1890 1885
1891static int __devinit ipp_probe(struct platform_device *pdev) 1886static int ipp_probe(struct platform_device *pdev)
1892{ 1887{
1893 struct device *dev = &pdev->dev; 1888 struct device *dev = &pdev->dev;
1894 struct ipp_context *ctx; 1889 struct ipp_context *ctx;
1895 struct exynos_drm_subdrv *subdrv; 1890 struct exynos_drm_subdrv *subdrv;
1896 int ret; 1891 int ret;
1897 1892
1898 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 1893 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
1899 if (!ctx) 1894 if (!ctx)
1900 return -ENOMEM; 1895 return -ENOMEM;
1901 1896
@@ -1916,8 +1911,7 @@ static int __devinit ipp_probe(struct platform_device *pdev)
1916 ctx->event_workq = create_singlethread_workqueue("ipp_event"); 1911 ctx->event_workq = create_singlethread_workqueue("ipp_event");
1917 if (!ctx->event_workq) { 1912 if (!ctx->event_workq) {
1918 dev_err(dev, "failed to create event workqueue\n"); 1913 dev_err(dev, "failed to create event workqueue\n");
1919 ret = -EINVAL; 1914 return -EINVAL;
1920 goto err_clear;
1921 } 1915 }
1922 1916
1923 /* 1917 /*
@@ -1958,12 +1952,10 @@ err_cmd_workq:
1958 destroy_workqueue(ctx->cmd_workq); 1952 destroy_workqueue(ctx->cmd_workq);
1959err_event_workq: 1953err_event_workq:
1960 destroy_workqueue(ctx->event_workq); 1954 destroy_workqueue(ctx->event_workq);
1961err_clear:
1962 kfree(ctx);
1963 return ret; 1955 return ret;
1964} 1956}
1965 1957
1966static int __devexit ipp_remove(struct platform_device *pdev) 1958static int ipp_remove(struct platform_device *pdev)
1967{ 1959{
1968 struct ipp_context *ctx = platform_get_drvdata(pdev); 1960 struct ipp_context *ctx = platform_get_drvdata(pdev);
1969 1961
@@ -1985,8 +1977,6 @@ static int __devexit ipp_remove(struct platform_device *pdev)
1985 destroy_workqueue(ctx->cmd_workq); 1977 destroy_workqueue(ctx->cmd_workq);
1986 destroy_workqueue(ctx->event_workq); 1978 destroy_workqueue(ctx->event_workq);
1987 1979
1988 kfree(ctx);
1989
1990 return 0; 1980 return 0;
1991} 1981}
1992 1982
@@ -2050,7 +2040,7 @@ static const struct dev_pm_ops ipp_pm_ops = {
2050 2040
2051struct platform_driver ipp_driver = { 2041struct platform_driver ipp_driver = {
2052 .probe = ipp_probe, 2042 .probe = ipp_probe,
2053 .remove = __devexit_p(ipp_remove), 2043 .remove = ipp_remove,
2054 .driver = { 2044 .driver = {
2055 .name = "exynos-drm-ipp", 2045 .name = "exynos-drm-ipp",
2056 .owner = THIS_MODULE, 2046 .owner = THIS_MODULE,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.h b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
index 28ffac95386..4cadbea7dbd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
@@ -6,24 +6,10 @@
6 * Jinyoung Jeon <jy0.jeon@samsung.com> 6 * Jinyoung Jeon <jy0.jeon@samsung.com>
7 * Sangmin Lee <lsmin.lee@samsung.com> 7 * Sangmin Lee <lsmin.lee@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _EXYNOS_DRM_IPP_H_ 15#ifndef _EXYNOS_DRM_IPP_H_
@@ -160,7 +146,7 @@ struct exynos_drm_ipp_ops {
160 * @dedicated: dedicated ipp device. 146 * @dedicated: dedicated ipp device.
161 * @ops: source, destination operations. 147 * @ops: source, destination operations.
162 * @event_workq: event work queue. 148 * @event_workq: event work queue.
163 * @cmd: current command information. 149 * @c_node: current command information.
164 * @cmd_list: list head for command information. 150 * @cmd_list: list head for command information.
165 * @prop_list: property informations of current ipp driver. 151 * @prop_list: property informations of current ipp driver.
166 * @check_property: check property about format, size, buffer. 152 * @check_property: check property about format, size, buffer.
@@ -178,7 +164,7 @@ struct exynos_drm_ippdrv {
178 bool dedicated; 164 bool dedicated;
179 struct exynos_drm_ipp_ops *ops[EXYNOS_DRM_OPS_MAX]; 165 struct exynos_drm_ipp_ops *ops[EXYNOS_DRM_OPS_MAX];
180 struct workqueue_struct *event_workq; 166 struct workqueue_struct *event_workq;
181 struct drm_exynos_ipp_cmd_node *cmd; 167 struct drm_exynos_ipp_cmd_node *c_node;
182 struct list_head cmd_list; 168 struct list_head cmd_list;
183 struct drm_exynos_ipp_prop_list *prop_list; 169 struct drm_exynos_ipp_prop_list *prop_list;
184 170
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 1c2366083c7..e9e83ef688f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -139,7 +139,7 @@ static irqreturn_t rotator_irq_handler(int irq, void *arg)
139{ 139{
140 struct rot_context *rot = arg; 140 struct rot_context *rot = arg;
141 struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv; 141 struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv;
142 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; 142 struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
143 struct drm_exynos_ipp_event_work *event_work = c_node->event_work; 143 struct drm_exynos_ipp_event_work *event_work = c_node->event_work;
144 enum rot_irq_status irq_status; 144 enum rot_irq_status irq_status;
145 u32 val; 145 u32 val;
@@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip)
513 case EXYNOS_DRM_FLIP_NONE: 513 case EXYNOS_DRM_FLIP_NONE:
514 case EXYNOS_DRM_FLIP_VERTICAL: 514 case EXYNOS_DRM_FLIP_VERTICAL:
515 case EXYNOS_DRM_FLIP_HORIZONTAL: 515 case EXYNOS_DRM_FLIP_HORIZONTAL:
516 case EXYNOS_DRM_FLIP_BOTH:
516 return true; 517 return true;
517 default: 518 default:
518 DRM_DEBUG_KMS("%s:invalid flip\n", __func__); 519 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -638,7 +639,7 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
638 return 0; 639 return 0;
639} 640}
640 641
641static int __devinit rotator_probe(struct platform_device *pdev) 642static int rotator_probe(struct platform_device *pdev)
642{ 643{
643 struct device *dev = &pdev->dev; 644 struct device *dev = &pdev->dev;
644 struct rot_context *rot; 645 struct rot_context *rot;
@@ -655,34 +656,26 @@ static int __devinit rotator_probe(struct platform_device *pdev)
655 platform_get_device_id(pdev)->driver_data; 656 platform_get_device_id(pdev)->driver_data;
656 657
657 rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 658 rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
658 if (!rot->regs_res) {
659 dev_err(dev, "failed to find registers\n");
660 ret = -ENOENT;
661 goto err_get_resource;
662 }
663
664 rot->regs = devm_request_and_ioremap(dev, rot->regs_res); 659 rot->regs = devm_request_and_ioremap(dev, rot->regs_res);
665 if (!rot->regs) { 660 if (!rot->regs) {
666 dev_err(dev, "failed to map register\n"); 661 dev_err(dev, "failed to map register\n");
667 ret = -ENXIO; 662 return -ENXIO;
668 goto err_get_resource;
669 } 663 }
670 664
671 rot->irq = platform_get_irq(pdev, 0); 665 rot->irq = platform_get_irq(pdev, 0);
672 if (rot->irq < 0) { 666 if (rot->irq < 0) {
673 dev_err(dev, "failed to get irq\n"); 667 dev_err(dev, "failed to get irq\n");
674 ret = rot->irq; 668 return rot->irq;
675 goto err_get_irq;
676 } 669 }
677 670
678 ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler, 671 ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
679 IRQF_ONESHOT, "drm_rotator", rot); 672 IRQF_ONESHOT, "drm_rotator", rot);
680 if (ret < 0) { 673 if (ret < 0) {
681 dev_err(dev, "failed to request irq\n"); 674 dev_err(dev, "failed to request irq\n");
682 goto err_get_irq; 675 return ret;
683 } 676 }
684 677
685 rot->clock = clk_get(dev, "rotator"); 678 rot->clock = devm_clk_get(dev, "rotator");
686 if (IS_ERR_OR_NULL(rot->clock)) { 679 if (IS_ERR_OR_NULL(rot->clock)) {
687 dev_err(dev, "failed to get clock\n"); 680 dev_err(dev, "failed to get clock\n");
688 ret = PTR_ERR(rot->clock); 681 ret = PTR_ERR(rot->clock);
@@ -720,17 +713,12 @@ static int __devinit rotator_probe(struct platform_device *pdev)
720err_ippdrv_register: 713err_ippdrv_register:
721 devm_kfree(dev, ippdrv->prop_list); 714 devm_kfree(dev, ippdrv->prop_list);
722 pm_runtime_disable(dev); 715 pm_runtime_disable(dev);
723 clk_put(rot->clock);
724err_clk_get: 716err_clk_get:
725 free_irq(rot->irq, rot); 717 free_irq(rot->irq, rot);
726err_get_irq:
727 devm_iounmap(dev, rot->regs);
728err_get_resource:
729 devm_kfree(dev, rot);
730 return ret; 718 return ret;
731} 719}
732 720
733static int __devexit rotator_remove(struct platform_device *pdev) 721static int rotator_remove(struct platform_device *pdev)
734{ 722{
735 struct device *dev = &pdev->dev; 723 struct device *dev = &pdev->dev;
736 struct rot_context *rot = dev_get_drvdata(dev); 724 struct rot_context *rot = dev_get_drvdata(dev);
@@ -740,12 +728,8 @@ static int __devexit rotator_remove(struct platform_device *pdev)
740 exynos_drm_ippdrv_unregister(ippdrv); 728 exynos_drm_ippdrv_unregister(ippdrv);
741 729
742 pm_runtime_disable(dev); 730 pm_runtime_disable(dev);
743 clk_put(rot->clock);
744 731
745 free_irq(rot->irq, rot); 732 free_irq(rot->irq, rot);
746 devm_iounmap(dev, rot->regs);
747
748 devm_kfree(dev, rot);
749 733
750 return 0; 734 return 0;
751} 735}
@@ -845,7 +829,7 @@ static const struct dev_pm_ops rotator_pm_ops = {
845 829
846struct platform_driver rotator_driver = { 830struct platform_driver rotator_driver = {
847 .probe = rotator_probe, 831 .probe = rotator_probe,
848 .remove = __devexit_p(rotator_remove), 832 .remove = rotator_remove,
849 .id_table = rotator_driver_ids, 833 .id_table = rotator_driver_ids,
850 .driver = { 834 .driver = {
851 .name = "exynos-rot", 835 .name = "exynos-rot",
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.h b/drivers/gpu/drm/exynos/exynos_drm_rotator.h
index a2d7a14a52b..71a0b4c0c1e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.h
@@ -5,24 +5,10 @@
5 * YoungJun Cho <yj44.cho@samsung.com> 5 * YoungJun Cho <yj44.cho@samsung.com>
6 * Eunchul Kim <chulspro.kim@samsung.com> 6 * Eunchul Kim <chulspro.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#ifndef _EXYNOS_DRM_ROTATOR_H_ 14#ifndef _EXYNOS_DRM_ROTATOR_H_
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 99bfc38dfaa..d0ca3c4e06c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -372,34 +372,6 @@ static struct exynos_drm_manager vidi_manager = {
372 .display_ops = &vidi_display_ops, 372 .display_ops = &vidi_display_ops,
373}; 373};
374 374
375static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc)
376{
377 struct exynos_drm_private *dev_priv = drm_dev->dev_private;
378 struct drm_pending_vblank_event *e, *t;
379 struct timeval now;
380 unsigned long flags;
381
382 spin_lock_irqsave(&drm_dev->event_lock, flags);
383
384 list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
385 base.link) {
386 /* if event's pipe isn't same as crtc then ignore it. */
387 if (crtc != e->pipe)
388 continue;
389
390 do_gettimeofday(&now);
391 e->event.sequence = 0;
392 e->event.tv_sec = now.tv_sec;
393 e->event.tv_usec = now.tv_usec;
394
395 list_move_tail(&e->base.link, &e->base.file_priv->event_list);
396 wake_up_interruptible(&e->base.file_priv->event_wait);
397 drm_vblank_put(drm_dev, crtc);
398 }
399
400 spin_unlock_irqrestore(&drm_dev->event_lock, flags);
401}
402
403static void vidi_fake_vblank_handler(struct work_struct *work) 375static void vidi_fake_vblank_handler(struct work_struct *work)
404{ 376{
405 struct vidi_context *ctx = container_of(work, struct vidi_context, 377 struct vidi_context *ctx = container_of(work, struct vidi_context,
@@ -424,7 +396,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
424 396
425 mutex_unlock(&ctx->lock); 397 mutex_unlock(&ctx->lock);
426 398
427 vidi_finish_pageflip(subdrv->drm_dev, manager->pipe); 399 exynos_drm_crtc_finish_pageflip(subdrv->drm_dev, manager->pipe);
428} 400}
429 401
430static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) 402static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
@@ -609,7 +581,7 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
609 return 0; 581 return 0;
610} 582}
611 583
612static int __devinit vidi_probe(struct platform_device *pdev) 584static int vidi_probe(struct platform_device *pdev)
613{ 585{
614 struct device *dev = &pdev->dev; 586 struct device *dev = &pdev->dev;
615 struct vidi_context *ctx; 587 struct vidi_context *ctx;
@@ -645,7 +617,7 @@ static int __devinit vidi_probe(struct platform_device *pdev)
645 return 0; 617 return 0;
646} 618}
647 619
648static int __devexit vidi_remove(struct platform_device *pdev) 620static int vidi_remove(struct platform_device *pdev)
649{ 621{
650 struct vidi_context *ctx = platform_get_drvdata(pdev); 622 struct vidi_context *ctx = platform_get_drvdata(pdev);
651 623
@@ -683,7 +655,7 @@ static const struct dev_pm_ops vidi_pm_ops = {
683 655
684struct platform_driver vidi_driver = { 656struct platform_driver vidi_driver = {
685 .probe = vidi_probe, 657 .probe = vidi_probe,
686 .remove = __devexit_p(vidi_remove), 658 .remove = vidi_remove,
687 .driver = { 659 .driver = {
688 .name = "exynos-drm-vidi", 660 .name = "exynos-drm-vidi",
689 .owner = THIS_MODULE, 661 .owner = THIS_MODULE,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.h b/drivers/gpu/drm/exynos/exynos_drm_vidi.h
index a4babe4e65d..1e5fdaa36cc 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.h
@@ -3,24 +3,10 @@
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Author: Inki Dae <inki.dae@samsung.com> 4 * Author: Inki Dae <inki.dae@samsung.com>
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms of the GNU General Public License as published by the
8 * to deal in the Software without restriction, including without limitation 8 * Free Software Foundation; either version 2 of the License, or (at your
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * option) any later version.
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */ 10 */
25 11
26#ifndef _EXYNOS_DRM_VIDI_H_ 12#ifndef _EXYNOS_DRM_VIDI_H_
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 2c46b6c0b82..41ff79d8ac8 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2305,7 +2305,7 @@ static irqreturn_t hdmi_internal_irq_thread(int irq, void *arg)
2305 return IRQ_HANDLED; 2305 return IRQ_HANDLED;
2306} 2306}
2307 2307
2308static int __devinit hdmi_resources_init(struct hdmi_context *hdata) 2308static int hdmi_resources_init(struct hdmi_context *hdata)
2309{ 2309{
2310 struct device *dev = hdata->dev; 2310 struct device *dev = hdata->dev;
2311 struct hdmi_resources *res = &hdata->res; 2311 struct hdmi_resources *res = &hdata->res;
@@ -2451,7 +2451,7 @@ static struct of_device_id hdmi_match_types[] = {
2451}; 2451};
2452#endif 2452#endif
2453 2453
2454static int __devinit hdmi_probe(struct platform_device *pdev) 2454static int hdmi_probe(struct platform_device *pdev)
2455{ 2455{
2456 struct device *dev = &pdev->dev; 2456 struct device *dev = &pdev->dev;
2457 struct exynos_drm_hdmi_context *drm_hdmi_ctx; 2457 struct exynos_drm_hdmi_context *drm_hdmi_ctx;
@@ -2607,7 +2607,7 @@ err_ddc:
2607 return ret; 2607 return ret;
2608} 2608}
2609 2609
2610static int __devexit hdmi_remove(struct platform_device *pdev) 2610static int hdmi_remove(struct platform_device *pdev)
2611{ 2611{
2612 struct device *dev = &pdev->dev; 2612 struct device *dev = &pdev->dev;
2613 struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev); 2613 struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev);
@@ -2708,7 +2708,7 @@ static const struct dev_pm_ops hdmi_pm_ops = {
2708 2708
2709struct platform_driver hdmi_driver = { 2709struct platform_driver hdmi_driver = {
2710 .probe = hdmi_probe, 2710 .probe = hdmi_probe,
2711 .remove = __devexit_p(hdmi_remove), 2711 .remove = hdmi_remove,
2712 .id_table = hdmi_driver_types, 2712 .id_table = hdmi_driver_types,
2713 .driver = { 2713 .driver = {
2714 .name = "exynos-hdmi", 2714 .name = "exynos-hdmi",
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.h b/drivers/gpu/drm/exynos/exynos_hdmi.h
index 1c3b6d8f1fe..0ddf3957de1 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.h
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.h
@@ -5,24 +5,10 @@
5 * Inki Dae <inki.dae@samsung.com> 5 * Inki Dae <inki.dae@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com> 6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 * 7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a 8 * This program is free software; you can redistribute it and/or modify it
9 * copy of this software and associated documentation files (the "Software"), 9 * under the terms of the GNU General Public License as published by the
10 * to deal in the Software without restriction, including without limitation 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * option) any later version.
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */ 12 */
27 13
28#ifndef _EXYNOS_HDMI_H_ 14#ifndef _EXYNOS_HDMI_H_
diff --git a/drivers/gpu/drm/exynos/exynos_hdmiphy.c b/drivers/gpu/drm/exynos/exynos_hdmiphy.c
index 6206056f4a3..ea49d132ecf 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmiphy.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmiphy.c
@@ -64,7 +64,7 @@ struct i2c_driver hdmiphy_driver = {
64 }, 64 },
65 .id_table = hdmiphy_id, 65 .id_table = hdmiphy_id,
66 .probe = hdmiphy_probe, 66 .probe = hdmiphy_probe,
67 .remove = __devexit_p(hdmiphy_remove), 67 .remove = hdmiphy_remove,
68 .command = NULL, 68 .command = NULL,
69}; 69};
70EXPORT_SYMBOL(hdmiphy_driver); 70EXPORT_SYMBOL(hdmiphy_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 21db89530fc..c187ea33b74 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -35,6 +35,7 @@
35#include <drm/exynos_drm.h> 35#include <drm/exynos_drm.h>
36 36
37#include "exynos_drm_drv.h" 37#include "exynos_drm_drv.h"
38#include "exynos_drm_crtc.h"
38#include "exynos_drm_hdmi.h" 39#include "exynos_drm_hdmi.h"
39#include "exynos_drm_iommu.h" 40#include "exynos_drm_iommu.h"
40 41
@@ -949,35 +950,6 @@ static struct exynos_mixer_ops mixer_ops = {
949 .win_disable = mixer_win_disable, 950 .win_disable = mixer_win_disable,
950}; 951};
951 952
952/* for pageflip event */
953static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
954{
955 struct exynos_drm_private *dev_priv = drm_dev->dev_private;
956 struct drm_pending_vblank_event *e, *t;
957 struct timeval now;
958 unsigned long flags;
959
960 spin_lock_irqsave(&drm_dev->event_lock, flags);
961
962 list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
963 base.link) {
964 /* if event's pipe isn't same as crtc then ignore it. */
965 if (crtc != e->pipe)
966 continue;
967
968 do_gettimeofday(&now);
969 e->event.sequence = 0;
970 e->event.tv_sec = now.tv_sec;
971 e->event.tv_usec = now.tv_usec;
972
973 list_move_tail(&e->base.link, &e->base.file_priv->event_list);
974 wake_up_interruptible(&e->base.file_priv->event_wait);
975 drm_vblank_put(drm_dev, crtc);
976 }
977
978 spin_unlock_irqrestore(&drm_dev->event_lock, flags);
979}
980
981static irqreturn_t mixer_irq_handler(int irq, void *arg) 953static irqreturn_t mixer_irq_handler(int irq, void *arg)
982{ 954{
983 struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; 955 struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;
@@ -1006,7 +978,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
1006 } 978 }
1007 979
1008 drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe); 980 drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe);
1009 mixer_finish_pageflip(drm_hdmi_ctx->drm_dev, ctx->pipe); 981 exynos_drm_crtc_finish_pageflip(drm_hdmi_ctx->drm_dev,
982 ctx->pipe);
1010 983
1011 /* set wait vsync event to zero and wake up queue. */ 984 /* set wait vsync event to zero and wake up queue. */
1012 if (atomic_read(&ctx->wait_vsync_event)) { 985 if (atomic_read(&ctx->wait_vsync_event)) {
@@ -1029,8 +1002,8 @@ out:
1029 return IRQ_HANDLED; 1002 return IRQ_HANDLED;
1030} 1003}
1031 1004
1032static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, 1005static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
1033 struct platform_device *pdev) 1006 struct platform_device *pdev)
1034{ 1007{
1035 struct mixer_context *mixer_ctx = ctx->ctx; 1008 struct mixer_context *mixer_ctx = ctx->ctx;
1036 struct device *dev = &pdev->dev; 1009 struct device *dev = &pdev->dev;
@@ -1081,8 +1054,8 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
1081 return 0; 1054 return 0;
1082} 1055}
1083 1056
1084static int __devinit vp_resources_init(struct exynos_drm_hdmi_context *ctx, 1057static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
1085 struct platform_device *pdev) 1058 struct platform_device *pdev)
1086{ 1059{
1087 struct mixer_context *mixer_ctx = ctx->ctx; 1060 struct mixer_context *mixer_ctx = ctx->ctx;
1088 struct device *dev = &pdev->dev; 1061 struct device *dev = &pdev->dev;
@@ -1155,7 +1128,7 @@ static struct of_device_id mixer_match_types[] = {
1155 } 1128 }
1156}; 1129};
1157 1130
1158static int __devinit mixer_probe(struct platform_device *pdev) 1131static int mixer_probe(struct platform_device *pdev)
1159{ 1132{
1160 struct device *dev = &pdev->dev; 1133 struct device *dev = &pdev->dev;
1161 struct exynos_drm_hdmi_context *drm_hdmi_ctx; 1134 struct exynos_drm_hdmi_context *drm_hdmi_ctx;
@@ -1316,6 +1289,6 @@ struct platform_driver mixer_driver = {
1316 .of_match_table = mixer_match_types, 1289 .of_match_table = mixer_match_types,
1317 }, 1290 },
1318 .probe = mixer_probe, 1291 .probe = mixer_probe,
1319 .remove = __devexit_p(mixer_remove), 1292 .remove = mixer_remove,
1320 .id_table = mixer_driver_types, 1293 .id_table = mixer_driver_types,
1321}; 1294};
diff --git a/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c b/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c
index 4a07ab59617..771ff66711a 100644
--- a/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c
+++ b/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c
@@ -700,7 +700,7 @@ static struct i2c_driver tc35876x_bridge_i2c_driver = {
700 }, 700 },
701 .id_table = tc35876x_bridge_id, 701 .id_table = tc35876x_bridge_id,
702 .probe = tc35876x_bridge_probe, 702 .probe = tc35876x_bridge_probe,
703 .remove = __devexit_p(tc35876x_bridge_remove), 703 .remove = tc35876x_bridge_remove,
704}; 704};
705 705
706/* LCD panel I2C */ 706/* LCD panel I2C */
@@ -741,7 +741,7 @@ static struct i2c_driver cmi_lcd_i2c_driver = {
741 }, 741 },
742 .id_table = cmi_lcd_i2c_id, 742 .id_table = cmi_lcd_i2c_id,
743 .probe = cmi_lcd_i2c_probe, 743 .probe = cmi_lcd_i2c_probe,
744 .remove = __devexit_p(cmi_lcd_i2c_remove), 744 .remove = cmi_lcd_i2c_remove,
745}; 745};
746 746
747/* HACK to create I2C device while it's not created by platform code */ 747/* HACK to create I2C device while it's not created by platform code */
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 530db83ef32..117265840b1 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -877,8 +877,7 @@ int i915_reset(struct drm_device *dev)
877 return 0; 877 return 0;
878} 878}
879 879
880static int __devinit 880static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
881i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
882{ 881{
883 struct intel_device_info *intel_info = 882 struct intel_device_info *intel_info =
884 (struct intel_device_info *) ent->driver_data; 883 (struct intel_device_info *) ent->driver_data;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index da3c82e301b..8febea6daa0 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1717,7 +1717,8 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
1717} 1717}
1718 1718
1719static long 1719static long
1720i915_gem_purge(struct drm_i915_private *dev_priv, long target) 1720__i915_gem_shrink(struct drm_i915_private *dev_priv, long target,
1721 bool purgeable_only)
1721{ 1722{
1722 struct drm_i915_gem_object *obj, *next; 1723 struct drm_i915_gem_object *obj, *next;
1723 long count = 0; 1724 long count = 0;
@@ -1725,7 +1726,7 @@ i915_gem_purge(struct drm_i915_private *dev_priv, long target)
1725 list_for_each_entry_safe(obj, next, 1726 list_for_each_entry_safe(obj, next,
1726 &dev_priv->mm.unbound_list, 1727 &dev_priv->mm.unbound_list,
1727 gtt_list) { 1728 gtt_list) {
1728 if (i915_gem_object_is_purgeable(obj) && 1729 if ((i915_gem_object_is_purgeable(obj) || !purgeable_only) &&
1729 i915_gem_object_put_pages(obj) == 0) { 1730 i915_gem_object_put_pages(obj) == 0) {
1730 count += obj->base.size >> PAGE_SHIFT; 1731 count += obj->base.size >> PAGE_SHIFT;
1731 if (count >= target) 1732 if (count >= target)
@@ -1736,7 +1737,7 @@ i915_gem_purge(struct drm_i915_private *dev_priv, long target)
1736 list_for_each_entry_safe(obj, next, 1737 list_for_each_entry_safe(obj, next,
1737 &dev_priv->mm.inactive_list, 1738 &dev_priv->mm.inactive_list,
1738 mm_list) { 1739 mm_list) {
1739 if (i915_gem_object_is_purgeable(obj) && 1740 if ((i915_gem_object_is_purgeable(obj) || !purgeable_only) &&
1740 i915_gem_object_unbind(obj) == 0 && 1741 i915_gem_object_unbind(obj) == 0 &&
1741 i915_gem_object_put_pages(obj) == 0) { 1742 i915_gem_object_put_pages(obj) == 0) {
1742 count += obj->base.size >> PAGE_SHIFT; 1743 count += obj->base.size >> PAGE_SHIFT;
@@ -1748,6 +1749,12 @@ i915_gem_purge(struct drm_i915_private *dev_priv, long target)
1748 return count; 1749 return count;
1749} 1750}
1750 1751
1752static long
1753i915_gem_purge(struct drm_i915_private *dev_priv, long target)
1754{
1755 return __i915_gem_shrink(dev_priv, target, true);
1756}
1757
1751static void 1758static void
1752i915_gem_shrink_all(struct drm_i915_private *dev_priv) 1759i915_gem_shrink_all(struct drm_i915_private *dev_priv)
1753{ 1760{
@@ -3522,14 +3529,15 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
3522 goto out; 3529 goto out;
3523 } 3530 }
3524 3531
3525 obj->user_pin_count++; 3532 if (obj->user_pin_count == 0) {
3526 obj->pin_filp = file;
3527 if (obj->user_pin_count == 1) {
3528 ret = i915_gem_object_pin(obj, args->alignment, true, false); 3533 ret = i915_gem_object_pin(obj, args->alignment, true, false);
3529 if (ret) 3534 if (ret)
3530 goto out; 3535 goto out;
3531 } 3536 }
3532 3537
3538 obj->user_pin_count++;
3539 obj->pin_filp = file;
3540
3533 /* XXX - flush the CPU caches for pinned objects 3541 /* XXX - flush the CPU caches for pinned objects
3534 * as the X server doesn't manage domains yet 3542 * as the X server doesn't manage domains yet
3535 */ 3543 */
@@ -4395,6 +4403,9 @@ i915_gem_inactive_shrink(struct shrinker *shrinker, struct shrink_control *sc)
4395 if (nr_to_scan) { 4403 if (nr_to_scan) {
4396 nr_to_scan -= i915_gem_purge(dev_priv, nr_to_scan); 4404 nr_to_scan -= i915_gem_purge(dev_priv, nr_to_scan);
4397 if (nr_to_scan > 0) 4405 if (nr_to_scan > 0)
4406 nr_to_scan -= __i915_gem_shrink(dev_priv, nr_to_scan,
4407 false);
4408 if (nr_to_scan > 0)
4398 i915_gem_shrink_all(dev_priv); 4409 i915_gem_shrink_all(dev_priv);
4399 } 4410 }
4400 4411
@@ -4402,7 +4413,7 @@ i915_gem_inactive_shrink(struct shrinker *shrinker, struct shrink_control *sc)
4402 list_for_each_entry(obj, &dev_priv->mm.unbound_list, gtt_list) 4413 list_for_each_entry(obj, &dev_priv->mm.unbound_list, gtt_list)
4403 if (obj->pages_pin_count == 0) 4414 if (obj->pages_pin_count == 0)
4404 cnt += obj->base.size >> PAGE_SHIFT; 4415 cnt += obj->base.size >> PAGE_SHIFT;
4405 list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) 4416 list_for_each_entry(obj, &dev_priv->mm.inactive_list, gtt_list)
4406 if (obj->pin_count == 0 && obj->pages_pin_count == 0) 4417 if (obj->pin_count == 0 && obj->pages_pin_count == 0)
4407 cnt += obj->base.size >> PAGE_SHIFT; 4418 cnt += obj->base.size >> PAGE_SHIFT;
4408 4419
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 7be4241e824..abeaafef6d7 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -266,7 +266,12 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev,
266 obj = dma_buf->priv; 266 obj = dma_buf->priv;
267 /* is it from our device? */ 267 /* is it from our device? */
268 if (obj->base.dev == dev) { 268 if (obj->base.dev == dev) {
269 /*
270 * Importing dmabuf exported from out own gem increases
271 * refcount on gem itself instead of f_count of dmabuf.
272 */
269 drm_gem_object_reference(&obj->base); 273 drm_gem_object_reference(&obj->base);
274 dma_buf_put(dma_buf);
270 return &obj->base; 275 return &obj->base;
271 } 276 }
272 } 277 }
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a9fb046b94a..da1ad9c80bb 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8598,19 +8598,30 @@ int intel_framebuffer_init(struct drm_device *dev,
8598{ 8598{
8599 int ret; 8599 int ret;
8600 8600
8601 if (obj->tiling_mode == I915_TILING_Y) 8601 if (obj->tiling_mode == I915_TILING_Y) {
8602 DRM_DEBUG("hardware does not support tiling Y\n");
8602 return -EINVAL; 8603 return -EINVAL;
8604 }
8603 8605
8604 if (mode_cmd->pitches[0] & 63) 8606 if (mode_cmd->pitches[0] & 63) {
8607 DRM_DEBUG("pitch (%d) must be at least 64 byte aligned\n",
8608 mode_cmd->pitches[0]);
8605 return -EINVAL; 8609 return -EINVAL;
8610 }
8606 8611
8607 /* FIXME <= Gen4 stride limits are bit unclear */ 8612 /* FIXME <= Gen4 stride limits are bit unclear */
8608 if (mode_cmd->pitches[0] > 32768) 8613 if (mode_cmd->pitches[0] > 32768) {
8614 DRM_DEBUG("pitch (%d) must be at less than 32768\n",
8615 mode_cmd->pitches[0]);
8609 return -EINVAL; 8616 return -EINVAL;
8617 }
8610 8618
8611 if (obj->tiling_mode != I915_TILING_NONE && 8619 if (obj->tiling_mode != I915_TILING_NONE &&
8612 mode_cmd->pitches[0] != obj->stride) 8620 mode_cmd->pitches[0] != obj->stride) {
8621 DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n",
8622 mode_cmd->pitches[0], obj->stride);
8613 return -EINVAL; 8623 return -EINVAL;
8624 }
8614 8625
8615 /* Reject formats not supported by any plane early. */ 8626 /* Reject formats not supported by any plane early. */
8616 switch (mode_cmd->pixel_format) { 8627 switch (mode_cmd->pixel_format) {
@@ -8621,8 +8632,10 @@ int intel_framebuffer_init(struct drm_device *dev,
8621 break; 8632 break;
8622 case DRM_FORMAT_XRGB1555: 8633 case DRM_FORMAT_XRGB1555:
8623 case DRM_FORMAT_ARGB1555: 8634 case DRM_FORMAT_ARGB1555:
8624 if (INTEL_INFO(dev)->gen > 3) 8635 if (INTEL_INFO(dev)->gen > 3) {
8636 DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
8625 return -EINVAL; 8637 return -EINVAL;
8638 }
8626 break; 8639 break;
8627 case DRM_FORMAT_XBGR8888: 8640 case DRM_FORMAT_XBGR8888:
8628 case DRM_FORMAT_ABGR8888: 8641 case DRM_FORMAT_ABGR8888:
@@ -8630,18 +8643,22 @@ int intel_framebuffer_init(struct drm_device *dev,
8630 case DRM_FORMAT_ARGB2101010: 8643 case DRM_FORMAT_ARGB2101010:
8631 case DRM_FORMAT_XBGR2101010: 8644 case DRM_FORMAT_XBGR2101010:
8632 case DRM_FORMAT_ABGR2101010: 8645 case DRM_FORMAT_ABGR2101010:
8633 if (INTEL_INFO(dev)->gen < 4) 8646 if (INTEL_INFO(dev)->gen < 4) {
8647 DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
8634 return -EINVAL; 8648 return -EINVAL;
8649 }
8635 break; 8650 break;
8636 case DRM_FORMAT_YUYV: 8651 case DRM_FORMAT_YUYV:
8637 case DRM_FORMAT_UYVY: 8652 case DRM_FORMAT_UYVY:
8638 case DRM_FORMAT_YVYU: 8653 case DRM_FORMAT_YVYU:
8639 case DRM_FORMAT_VYUY: 8654 case DRM_FORMAT_VYUY:
8640 if (INTEL_INFO(dev)->gen < 6) 8655 if (INTEL_INFO(dev)->gen < 5) {
8656 DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
8641 return -EINVAL; 8657 return -EINVAL;
8658 }
8642 break; 8659 break;
8643 default: 8660 default:
8644 DRM_DEBUG_KMS("unsupported pixel format 0x%08x\n", mode_cmd->pixel_format); 8661 DRM_DEBUG("unsupported pixel format 0x%08x\n", mode_cmd->pixel_format);
8645 return -EINVAL; 8662 return -EINVAL;
8646 } 8663 }
8647 8664
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b9a660a5367..17aee74258a 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -776,14 +776,6 @@ static const struct dmi_system_id intel_no_lvds[] = {
776 }, 776 },
777 { 777 {
778 .callback = intel_no_lvds_dmi_callback, 778 .callback = intel_no_lvds_dmi_callback,
779 .ident = "ZOTAC ZBOXSD-ID12/ID13",
780 .matches = {
781 DMI_MATCH(DMI_BOARD_VENDOR, "ZOTAC"),
782 DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"),
783 },
784 },
785 {
786 .callback = intel_no_lvds_dmi_callback,
787 .ident = "Gigabyte GA-D525TUD", 779 .ident = "Gigabyte GA-D525TUD",
788 .matches = { 780 .matches = {
789 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), 781 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index e6f54ffab3b..e83a1179417 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -44,6 +44,14 @@
44 * i915.i915_enable_fbc parameter 44 * i915.i915_enable_fbc parameter
45 */ 45 */
46 46
47static bool intel_crtc_active(struct drm_crtc *crtc)
48{
49 /* Be paranoid as we can arrive here with only partial
50 * state retrieved from the hardware during setup.
51 */
52 return to_intel_crtc(crtc)->active && crtc->fb && crtc->mode.clock;
53}
54
47static void i8xx_disable_fbc(struct drm_device *dev) 55static void i8xx_disable_fbc(struct drm_device *dev)
48{ 56{
49 struct drm_i915_private *dev_priv = dev->dev_private; 57 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -405,9 +413,8 @@ void intel_update_fbc(struct drm_device *dev)
405 * - going to an unsupported config (interlace, pixel multiply, etc.) 413 * - going to an unsupported config (interlace, pixel multiply, etc.)
406 */ 414 */
407 list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { 415 list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) {
408 if (to_intel_crtc(tmp_crtc)->active && 416 if (intel_crtc_active(tmp_crtc) &&
409 !to_intel_crtc(tmp_crtc)->primary_disabled && 417 !to_intel_crtc(tmp_crtc)->primary_disabled) {
410 tmp_crtc->fb) {
411 if (crtc) { 418 if (crtc) {
412 DRM_DEBUG_KMS("more than one pipe active, disabling compression\n"); 419 DRM_DEBUG_KMS("more than one pipe active, disabling compression\n");
413 dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES; 420 dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES;
@@ -992,7 +999,7 @@ static struct drm_crtc *single_enabled_crtc(struct drm_device *dev)
992 struct drm_crtc *crtc, *enabled = NULL; 999 struct drm_crtc *crtc, *enabled = NULL;
993 1000
994 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 1001 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
995 if (to_intel_crtc(crtc)->active && crtc->fb) { 1002 if (intel_crtc_active(crtc)) {
996 if (enabled) 1003 if (enabled)
997 return NULL; 1004 return NULL;
998 enabled = crtc; 1005 enabled = crtc;
@@ -1086,7 +1093,7 @@ static bool g4x_compute_wm0(struct drm_device *dev,
1086 int entries, tlb_miss; 1093 int entries, tlb_miss;
1087 1094
1088 crtc = intel_get_crtc_for_plane(dev, plane); 1095 crtc = intel_get_crtc_for_plane(dev, plane);
1089 if (crtc->fb == NULL || !to_intel_crtc(crtc)->active) { 1096 if (!intel_crtc_active(crtc)) {
1090 *cursor_wm = cursor->guard_size; 1097 *cursor_wm = cursor->guard_size;
1091 *plane_wm = display->guard_size; 1098 *plane_wm = display->guard_size;
1092 return false; 1099 return false;
@@ -1215,7 +1222,7 @@ static bool vlv_compute_drain_latency(struct drm_device *dev,
1215 int entries; 1222 int entries;
1216 1223
1217 crtc = intel_get_crtc_for_plane(dev, plane); 1224 crtc = intel_get_crtc_for_plane(dev, plane);
1218 if (crtc->fb == NULL || !to_intel_crtc(crtc)->active) 1225 if (!intel_crtc_active(crtc))
1219 return false; 1226 return false;
1220 1227
1221 clock = crtc->mode.clock; /* VESA DOT Clock */ 1228 clock = crtc->mode.clock; /* VESA DOT Clock */
@@ -1476,7 +1483,7 @@ static void i9xx_update_wm(struct drm_device *dev)
1476 1483
1477 fifo_size = dev_priv->display.get_fifo_size(dev, 0); 1484 fifo_size = dev_priv->display.get_fifo_size(dev, 0);
1478 crtc = intel_get_crtc_for_plane(dev, 0); 1485 crtc = intel_get_crtc_for_plane(dev, 0);
1479 if (to_intel_crtc(crtc)->active && crtc->fb) { 1486 if (intel_crtc_active(crtc)) {
1480 int cpp = crtc->fb->bits_per_pixel / 8; 1487 int cpp = crtc->fb->bits_per_pixel / 8;
1481 if (IS_GEN2(dev)) 1488 if (IS_GEN2(dev))
1482 cpp = 4; 1489 cpp = 4;
@@ -1490,7 +1497,7 @@ static void i9xx_update_wm(struct drm_device *dev)
1490 1497
1491 fifo_size = dev_priv->display.get_fifo_size(dev, 1); 1498 fifo_size = dev_priv->display.get_fifo_size(dev, 1);
1492 crtc = intel_get_crtc_for_plane(dev, 1); 1499 crtc = intel_get_crtc_for_plane(dev, 1);
1493 if (to_intel_crtc(crtc)->active && crtc->fb) { 1500 if (intel_crtc_active(crtc)) {
1494 int cpp = crtc->fb->bits_per_pixel / 8; 1501 int cpp = crtc->fb->bits_per_pixel / 8;
1495 if (IS_GEN2(dev)) 1502 if (IS_GEN2(dev))
1496 cpp = 4; 1503 cpp = 4;
@@ -2044,7 +2051,7 @@ sandybridge_compute_sprite_wm(struct drm_device *dev, int plane,
2044 int entries, tlb_miss; 2051 int entries, tlb_miss;
2045 2052
2046 crtc = intel_get_crtc_for_plane(dev, plane); 2053 crtc = intel_get_crtc_for_plane(dev, plane);
2047 if (crtc->fb == NULL || !to_intel_crtc(crtc)->active) { 2054 if (!intel_crtc_active(crtc)) {
2048 *sprite_wm = display->guard_size; 2055 *sprite_wm = display->guard_size;
2049 return false; 2056 return false;
2050 } 2057 }
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 827dcd4edf1..d7b060e0a23 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -120,11 +120,10 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
120 I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]); 120 I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
121 I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x); 121 I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x);
122 122
123 linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); 123 linear_offset = y * fb->pitches[0] + x * pixel_size;
124 sprsurf_offset = 124 sprsurf_offset =
125 intel_gen4_compute_offset_xtiled(&x, &y, 125 intel_gen4_compute_offset_xtiled(&x, &y,
126 fb->bits_per_pixel / 8, 126 pixel_size, fb->pitches[0]);
127 fb->pitches[0]);
128 linear_offset -= sprsurf_offset; 127 linear_offset -= sprsurf_offset;
129 128
130 /* HSW consolidates SPRTILEOFF and SPRLINOFF into a single SPROFFSET 129 /* HSW consolidates SPRTILEOFF and SPRLINOFF into a single SPROFFSET
@@ -286,11 +285,10 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
286 I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]); 285 I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]);
287 I915_WRITE(DVSPOS(pipe), (crtc_y << 16) | crtc_x); 286 I915_WRITE(DVSPOS(pipe), (crtc_y << 16) | crtc_x);
288 287
289 linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); 288 linear_offset = y * fb->pitches[0] + x * pixel_size;
290 dvssurf_offset = 289 dvssurf_offset =
291 intel_gen4_compute_offset_xtiled(&x, &y, 290 intel_gen4_compute_offset_xtiled(&x, &y,
292 fb->bits_per_pixel / 8, 291 pixel_size, fb->pitches[0]);
293 fb->pitches[0]);
294 linear_offset -= dvssurf_offset; 292 linear_offset -= dvssurf_offset;
295 293
296 if (obj->tiling_mode != I915_TILING_NONE) 294 if (obj->tiling_mode != I915_TILING_NONE)
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 1e910117b0a..122b571ccc7 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -60,8 +60,7 @@ static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
60} 60}
61 61
62 62
63static int __devinit 63static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
64mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
65{ 64{
66 mgag200_kick_out_firmware_fb(pdev); 65 mgag200_kick_out_firmware_fb(pdev);
67 66
diff --git a/drivers/gpu/drm/nouveau/core/core/client.c b/drivers/gpu/drm/nouveau/core/core/client.c
index c617f048007..8bbb58f94a1 100644
--- a/drivers/gpu/drm/nouveau/core/core/client.c
+++ b/drivers/gpu/drm/nouveau/core/core/client.c
@@ -66,10 +66,8 @@ nouveau_client_create_(const char *name, u64 devname, const char *cfg,
66 66
67 ret = nouveau_handle_create(nv_object(client), ~0, ~0, 67 ret = nouveau_handle_create(nv_object(client), ~0, ~0,
68 nv_object(client), &client->root); 68 nv_object(client), &client->root);
69 if (ret) { 69 if (ret)
70 nouveau_namedb_destroy(&client->base);
71 return ret; 70 return ret;
72 }
73 71
74 /* prevent init/fini being called, os in in charge of this */ 72 /* prevent init/fini being called, os in in charge of this */
75 atomic_set(&nv_object(client)->usecount, 2); 73 atomic_set(&nv_object(client)->usecount, 2);
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c b/drivers/gpu/drm/nouveau/core/core/handle.c
index b8d2cbf8a7a..264c2b338ac 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/core/handle.c
@@ -109,7 +109,7 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
109 while (!nv_iclass(namedb, NV_NAMEDB_CLASS)) 109 while (!nv_iclass(namedb, NV_NAMEDB_CLASS))
110 namedb = namedb->parent; 110 namedb = namedb->parent;
111 111
112 handle = *phandle = kzalloc(sizeof(*handle), GFP_KERNEL); 112 handle = kzalloc(sizeof(*handle), GFP_KERNEL);
113 if (!handle) 113 if (!handle)
114 return -ENOMEM; 114 return -ENOMEM;
115 115
@@ -146,6 +146,9 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
146 } 146 }
147 147
148 hprintk(handle, TRACE, "created\n"); 148 hprintk(handle, TRACE, "created\n");
149
150 *phandle = handle;
151
149 return 0; 152 return 0;
150} 153}
151 154
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index 0f09af13541..ca1a7d76a95 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -851,20 +851,23 @@ exec_script(struct nv50_disp_priv *priv, int head, int id)
851 for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) 851 for (i = 0; !(ctrl & (1 << head)) && i < 3; i++)
852 ctrl = nv_rd32(priv, 0x610b5c + (i * 8)); 852 ctrl = nv_rd32(priv, 0x610b5c + (i * 8));
853 853
854 if (nv_device(priv)->chipset < 0x90 || 854 if (!(ctrl & (1 << head))) {
855 nv_device(priv)->chipset == 0x92 || 855 if (nv_device(priv)->chipset < 0x90 ||
856 nv_device(priv)->chipset == 0xa0) { 856 nv_device(priv)->chipset == 0x92 ||
857 for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) 857 nv_device(priv)->chipset == 0xa0) {
858 ctrl = nv_rd32(priv, 0x610b74 + (i * 8)); 858 for (i = 0; !(ctrl & (1 << head)) && i < 2; i++)
859 i += 3; 859 ctrl = nv_rd32(priv, 0x610b74 + (i * 8));
860 } else { 860 i += 4;
861 for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) 861 } else {
862 ctrl = nv_rd32(priv, 0x610798 + (i * 8)); 862 for (i = 0; !(ctrl & (1 << head)) && i < 4; i++)
863 i += 3; 863 ctrl = nv_rd32(priv, 0x610798 + (i * 8));
864 i += 4;
865 }
864 } 866 }
865 867
866 if (!(ctrl & (1 << head))) 868 if (!(ctrl & (1 << head)))
867 return false; 869 return false;
870 i--;
868 871
869 data = exec_lookup(priv, head, i, ctrl, &dcb, &ver, &hdr, &cnt, &len, &info); 872 data = exec_lookup(priv, head, i, ctrl, &dcb, &ver, &hdr, &cnt, &len, &info);
870 if (data) { 873 if (data) {
@@ -898,20 +901,23 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk,
898 for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) 901 for (i = 0; !(ctrl & (1 << head)) && i < 3; i++)
899 ctrl = nv_rd32(priv, 0x610b58 + (i * 8)); 902 ctrl = nv_rd32(priv, 0x610b58 + (i * 8));
900 903
901 if (nv_device(priv)->chipset < 0x90 || 904 if (!(ctrl & (1 << head))) {
902 nv_device(priv)->chipset == 0x92 || 905 if (nv_device(priv)->chipset < 0x90 ||
903 nv_device(priv)->chipset == 0xa0) { 906 nv_device(priv)->chipset == 0x92 ||
904 for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) 907 nv_device(priv)->chipset == 0xa0) {
905 ctrl = nv_rd32(priv, 0x610b70 + (i * 8)); 908 for (i = 0; !(ctrl & (1 << head)) && i < 2; i++)
906 i += 3; 909 ctrl = nv_rd32(priv, 0x610b70 + (i * 8));
907 } else { 910 i += 4;
908 for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) 911 } else {
909 ctrl = nv_rd32(priv, 0x610794 + (i * 8)); 912 for (i = 0; !(ctrl & (1 << head)) && i < 4; i++)
910 i += 3; 913 ctrl = nv_rd32(priv, 0x610794 + (i * 8));
914 i += 4;
915 }
911 } 916 }
912 917
913 if (!(ctrl & (1 << head))) 918 if (!(ctrl & (1 << head)))
914 return 0x0000; 919 return 0x0000;
920 i--;
915 921
916 data = exec_lookup(priv, head, i, ctrl, outp, &ver, &hdr, &cnt, &len, &info1); 922 data = exec_lookup(priv, head, i, ctrl, outp, &ver, &hdr, &cnt, &len, &info1);
917 if (!data) 923 if (!data)
diff --git a/drivers/gpu/drm/nouveau/core/include/core/client.h b/drivers/gpu/drm/nouveau/core/include/core/client.h
index 0193532ceac..63acc0346ff 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/client.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/client.h
@@ -36,6 +36,9 @@ nouveau_client(void *obj)
36 36
37int nouveau_client_create_(const char *name, u64 device, const char *cfg, 37int nouveau_client_create_(const char *name, u64 device, const char *cfg,
38 const char *dbg, int, void **); 38 const char *dbg, int, void **);
39#define nouveau_client_destroy(p) \
40 nouveau_namedb_destroy(&(p)->base)
41
39int nouveau_client_init(struct nouveau_client *); 42int nouveau_client_init(struct nouveau_client *);
40int nouveau_client_fini(struct nouveau_client *, bool suspend); 43int nouveau_client_fini(struct nouveau_client *, bool suspend);
41 44
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/bios/pll.h b/drivers/gpu/drm/nouveau/core/include/subdev/bios/pll.h
index c345097592f..b2f3d4d0aa4 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/bios/pll.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/bios/pll.h
@@ -38,6 +38,8 @@ enum nvbios_pll_type {
38 PLL_UNK42 = 0x42, 38 PLL_UNK42 = 0x42,
39 PLL_VPLL0 = 0x80, 39 PLL_VPLL0 = 0x80,
40 PLL_VPLL1 = 0x81, 40 PLL_VPLL1 = 0x81,
41 PLL_VPLL2 = 0x82,
42 PLL_VPLL3 = 0x83,
41 PLL_MAX = 0xff 43 PLL_MAX = 0xff
42}; 44};
43 45
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
index 2917d552689..690ed438b2a 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
@@ -1534,7 +1534,6 @@ init_io(struct nvbios_init *init)
1534 mdelay(10); 1534 mdelay(10);
1535 init_wr32(init, 0x614100, 0x10000018); 1535 init_wr32(init, 0x614100, 0x10000018);
1536 init_wr32(init, 0x614900, 0x10000018); 1536 init_wr32(init, 0x614900, 0x10000018);
1537 return;
1538 } 1537 }
1539 1538
1540 value = init_rdport(init, port) & mask; 1539 value = init_rdport(init, port) & mask;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c
index f6962c9b6c3..7c9626258a4 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c
@@ -52,6 +52,8 @@ nvc0_clock_pll_set(struct nouveau_clock *clk, u32 type, u32 freq)
52 switch (info.type) { 52 switch (info.type) {
53 case PLL_VPLL0: 53 case PLL_VPLL0:
54 case PLL_VPLL1: 54 case PLL_VPLL1:
55 case PLL_VPLL2:
56 case PLL_VPLL3:
55 nv_mask(priv, info.reg + 0x0c, 0x00000000, 0x00000100); 57 nv_mask(priv, info.reg + 0x0c, 0x00000000, 0x00000100);
56 nv_wr32(priv, info.reg + 0x04, (P << 16) | (N << 8) | M); 58 nv_wr32(priv, info.reg + 0x04, (P << 16) | (N << 8) | M);
57 nv_wr32(priv, info.reg + 0x10, fN << 16); 59 nv_wr32(priv, info.reg + 0x10, fN << 16);
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
index 306bdf12145..7606ed15b6f 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
@@ -145,14 +145,14 @@ nvc0_fb_vram_new(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
145 mem->memtype = type; 145 mem->memtype = type;
146 mem->size = size; 146 mem->size = size;
147 147
148 mutex_lock(&mm->mutex); 148 mutex_lock(&pfb->base.mutex);
149 do { 149 do {
150 if (back) 150 if (back)
151 ret = nouveau_mm_tail(mm, 1, size, ncmin, align, &r); 151 ret = nouveau_mm_tail(mm, 1, size, ncmin, align, &r);
152 else 152 else
153 ret = nouveau_mm_head(mm, 1, size, ncmin, align, &r); 153 ret = nouveau_mm_head(mm, 1, size, ncmin, align, &r);
154 if (ret) { 154 if (ret) {
155 mutex_unlock(&mm->mutex); 155 mutex_unlock(&pfb->base.mutex);
156 pfb->ram.put(pfb, &mem); 156 pfb->ram.put(pfb, &mem);
157 return ret; 157 return ret;
158 } 158 }
@@ -160,7 +160,7 @@ nvc0_fb_vram_new(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
160 list_add_tail(&r->rl_entry, &mem->regions); 160 list_add_tail(&r->rl_entry, &mem->regions);
161 size -= r->length; 161 size -= r->length;
162 } while (size); 162 } while (size);
163 mutex_unlock(&mm->mutex); 163 mutex_unlock(&pfb->base.mutex);
164 164
165 r = list_first_entry(&mem->regions, struct nouveau_mm_node, rl_entry); 165 r = list_first_entry(&mem->regions, struct nouveau_mm_node, rl_entry);
166 mem->offset = (u64)r->offset << 12; 166 mem->offset = (u64)r->offset << 12;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
index 1188227ca6a..6565f3dbbe0 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
@@ -40,15 +40,21 @@ nouveau_instobj_create_(struct nouveau_object *parent,
40 if (ret) 40 if (ret)
41 return ret; 41 return ret;
42 42
43 mutex_lock(&imem->base.mutex);
43 list_add(&iobj->head, &imem->list); 44 list_add(&iobj->head, &imem->list);
45 mutex_unlock(&imem->base.mutex);
44 return 0; 46 return 0;
45} 47}
46 48
47void 49void
48nouveau_instobj_destroy(struct nouveau_instobj *iobj) 50nouveau_instobj_destroy(struct nouveau_instobj *iobj)
49{ 51{
50 if (iobj->head.prev) 52 struct nouveau_subdev *subdev = nv_subdev(iobj->base.engine);
51 list_del(&iobj->head); 53
54 mutex_lock(&subdev->mutex);
55 list_del(&iobj->head);
56 mutex_unlock(&subdev->mutex);
57
52 return nouveau_object_destroy(&iobj->base); 58 return nouveau_object_destroy(&iobj->base);
53} 59}
54 60
@@ -88,6 +94,8 @@ nouveau_instmem_init(struct nouveau_instmem *imem)
88 if (ret) 94 if (ret)
89 return ret; 95 return ret;
90 96
97 mutex_lock(&imem->base.mutex);
98
91 list_for_each_entry(iobj, &imem->list, head) { 99 list_for_each_entry(iobj, &imem->list, head) {
92 if (iobj->suspend) { 100 if (iobj->suspend) {
93 for (i = 0; i < iobj->size; i += 4) 101 for (i = 0; i < iobj->size; i += 4)
@@ -97,6 +105,8 @@ nouveau_instmem_init(struct nouveau_instmem *imem)
97 } 105 }
98 } 106 }
99 107
108 mutex_unlock(&imem->base.mutex);
109
100 return 0; 110 return 0;
101} 111}
102 112
@@ -104,17 +114,26 @@ int
104nouveau_instmem_fini(struct nouveau_instmem *imem, bool suspend) 114nouveau_instmem_fini(struct nouveau_instmem *imem, bool suspend)
105{ 115{
106 struct nouveau_instobj *iobj; 116 struct nouveau_instobj *iobj;
107 int i; 117 int i, ret = 0;
108 118
109 if (suspend) { 119 if (suspend) {
120 mutex_lock(&imem->base.mutex);
121
110 list_for_each_entry(iobj, &imem->list, head) { 122 list_for_each_entry(iobj, &imem->list, head) {
111 iobj->suspend = vmalloc(iobj->size); 123 iobj->suspend = vmalloc(iobj->size);
112 if (iobj->suspend) { 124 if (!iobj->suspend) {
113 for (i = 0; i < iobj->size; i += 4) 125 ret = -ENOMEM;
114 iobj->suspend[i / 4] = nv_ro32(iobj, i); 126 break;
115 } else 127 }
116 return -ENOMEM; 128
129 for (i = 0; i < iobj->size; i += 4)
130 iobj->suspend[i / 4] = nv_ro32(iobj, i);
117 } 131 }
132
133 mutex_unlock(&imem->base.mutex);
134
135 if (ret)
136 return ret;
118 } 137 }
119 138
120 return nouveau_subdev_fini(&imem->base, suspend); 139 return nouveau_subdev_fini(&imem->base, suspend);
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
index 082c11b75ac..77c67fc970e 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
@@ -352,7 +352,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
352 u64 mm_length = (offset + length) - mm_offset; 352 u64 mm_length = (offset + length) - mm_offset;
353 int ret; 353 int ret;
354 354
355 vm = *pvm = kzalloc(sizeof(*vm), GFP_KERNEL); 355 vm = kzalloc(sizeof(*vm), GFP_KERNEL);
356 if (!vm) 356 if (!vm)
357 return -ENOMEM; 357 return -ENOMEM;
358 358
@@ -376,6 +376,8 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
376 return ret; 376 return ret;
377 } 377 }
378 378
379 *pvm = vm;
380
379 return 0; 381 return 0;
380} 382}
381 383
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 5614c89148c..69d7b1d0b9d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1276,7 +1276,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
1276 if (drm->agp.stat == ENABLED) { 1276 if (drm->agp.stat == ENABLED) {
1277 mem->bus.offset = mem->start << PAGE_SHIFT; 1277 mem->bus.offset = mem->start << PAGE_SHIFT;
1278 mem->bus.base = drm->agp.base; 1278 mem->bus.base = drm->agp.base;
1279 mem->bus.is_iomem = true; 1279 mem->bus.is_iomem = !dev->agp->cant_use_aperture;
1280 } 1280 }
1281#endif 1281#endif
1282 break; 1282 break;
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index ac340ba3201..e620ba8271b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -127,12 +127,26 @@ nouveau_connector_ddc_detect(struct drm_connector *connector,
127 struct nouveau_encoder **pnv_encoder) 127 struct nouveau_encoder **pnv_encoder)
128{ 128{
129 struct drm_device *dev = connector->dev; 129 struct drm_device *dev = connector->dev;
130 struct nouveau_connector *nv_connector = nouveau_connector(connector);
130 struct nouveau_drm *drm = nouveau_drm(dev); 131 struct nouveau_drm *drm = nouveau_drm(dev);
132 struct nouveau_gpio *gpio = nouveau_gpio(drm->device);
131 struct nouveau_i2c *i2c = nouveau_i2c(drm->device); 133 struct nouveau_i2c *i2c = nouveau_i2c(drm->device);
132 int i; 134 struct nouveau_i2c_port *port = NULL;
135 int i, panel = -ENODEV;
136
137 /* eDP panels need powering on by us (if the VBIOS doesn't default it
138 * to on) before doing any AUX channel transactions. LVDS panel power
139 * is handled by the SOR itself, and not required for LVDS DDC.
140 */
141 if (nv_connector->type == DCB_CONNECTOR_eDP) {
142 panel = gpio->get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff);
143 if (panel == 0) {
144 gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1);
145 msleep(300);
146 }
147 }
133 148
134 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { 149 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
135 struct nouveau_i2c_port *port = NULL;
136 struct nouveau_encoder *nv_encoder; 150 struct nouveau_encoder *nv_encoder;
137 struct drm_mode_object *obj; 151 struct drm_mode_object *obj;
138 int id; 152 int id;
@@ -150,11 +164,19 @@ nouveau_connector_ddc_detect(struct drm_connector *connector,
150 port = i2c->find(i2c, nv_encoder->dcb->i2c_index); 164 port = i2c->find(i2c, nv_encoder->dcb->i2c_index);
151 if (port && nv_probe_i2c(port, 0x50)) { 165 if (port && nv_probe_i2c(port, 0x50)) {
152 *pnv_encoder = nv_encoder; 166 *pnv_encoder = nv_encoder;
153 return port; 167 break;
154 } 168 }
169
170 port = NULL;
155 } 171 }
156 172
157 return NULL; 173 /* eDP panel not detected, restore panel power GPIO to previous
174 * state to avoid confusing the SOR for other output types.
175 */
176 if (!port && panel == 0)
177 gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, panel);
178
179 return port;
158} 180}
159 181
160static struct nouveau_encoder * 182static struct nouveau_encoder *
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index e4188f24fc7..508b00a2ce0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -225,15 +225,6 @@ nouveau_display_init(struct drm_device *dev)
225 if (ret) 225 if (ret)
226 return ret; 226 return ret;
227 227
228 /* power on internal panel if it's not already. the init tables of
229 * some vbios default this to off for some reason, causing the
230 * panel to not work after resume
231 */
232 if (gpio && gpio->get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff) == 0) {
233 gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1);
234 msleep(300);
235 }
236
237 /* enable polling for external displays */ 228 /* enable polling for external displays */
238 drm_kms_helper_poll_enable(dev); 229 drm_kms_helper_poll_enable(dev);
239 230
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 01c403ddb99..8b090f1eb51 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -84,11 +84,16 @@ nouveau_cli_create(struct pci_dev *pdev, const char *name,
84 struct nouveau_cli *cli; 84 struct nouveau_cli *cli;
85 int ret; 85 int ret;
86 86
87 *pcli = NULL;
87 ret = nouveau_client_create_(name, nouveau_name(pdev), nouveau_config, 88 ret = nouveau_client_create_(name, nouveau_name(pdev), nouveau_config,
88 nouveau_debug, size, pcli); 89 nouveau_debug, size, pcli);
89 cli = *pcli; 90 cli = *pcli;
90 if (ret) 91 if (ret) {
92 if (cli)
93 nouveau_client_destroy(&cli->base);
94 *pcli = NULL;
91 return ret; 95 return ret;
96 }
92 97
93 mutex_init(&cli->mutex); 98 mutex_init(&cli->mutex);
94 return 0; 99 return 0;
@@ -189,8 +194,8 @@ nouveau_accel_init(struct nouveau_drm *drm)
189 nouveau_bo_move_init(drm); 194 nouveau_bo_move_init(drm);
190} 195}
191 196
192static int __devinit 197static int nouveau_drm_probe(struct pci_dev *pdev,
193nouveau_drm_probe(struct pci_dev *pdev, const struct pci_device_id *pent) 198 const struct pci_device_id *pent)
194{ 199{
195 struct nouveau_device *device; 200 struct nouveau_device *device;
196 struct apertures_struct *aper; 201 struct apertures_struct *aper;
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.h b/drivers/gpu/drm/nouveau/nouveau_fence.h
index bedafd1c953..cdb83acdffe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.h
@@ -60,6 +60,7 @@ u32 nv10_fence_read(struct nouveau_channel *);
60void nv10_fence_context_del(struct nouveau_channel *); 60void nv10_fence_context_del(struct nouveau_channel *);
61void nv10_fence_destroy(struct nouveau_drm *); 61void nv10_fence_destroy(struct nouveau_drm *);
62int nv10_fence_create(struct nouveau_drm *); 62int nv10_fence_create(struct nouveau_drm *);
63void nv17_fence_resume(struct nouveau_drm *drm);
63 64
64int nv50_fence_create(struct nouveau_drm *); 65int nv50_fence_create(struct nouveau_drm *);
65int nv84_fence_create(struct nouveau_drm *); 66int nv84_fence_create(struct nouveau_drm *);
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 5566172774d..a701ff5ffa5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -698,10 +698,10 @@ static int
698nouveau_hwmon_init(struct drm_device *dev) 698nouveau_hwmon_init(struct drm_device *dev)
699{ 699{
700 struct nouveau_pm *pm = nouveau_pm(dev); 700 struct nouveau_pm *pm = nouveau_pm(dev);
701 struct nouveau_drm *drm = nouveau_drm(dev);
702 struct nouveau_therm *therm = nouveau_therm(drm->device);
703 701
704#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE)) 702#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
703 struct nouveau_drm *drm = nouveau_drm(dev);
704 struct nouveau_therm *therm = nouveau_therm(drm->device);
705 struct device *hwmon_dev; 705 struct device *hwmon_dev;
706 int ret = 0; 706 int ret = 0;
707 707
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
index 3543fec2355..b8e05ae3821 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -193,6 +193,7 @@ struct drm_gem_object *nouveau_gem_prime_import(struct drm_device *dev,
193 if (nvbo->gem) { 193 if (nvbo->gem) {
194 if (nvbo->gem->dev == dev) { 194 if (nvbo->gem->dev == dev) {
195 drm_gem_object_reference(nvbo->gem); 195 drm_gem_object_reference(nvbo->gem);
196 dma_buf_put(dma_buf);
196 return nvbo->gem; 197 return nvbo->gem;
197 } 198 }
198 } 199 }
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c
index 184cdf80676..39ffc07f906 100644
--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
+++ b/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -505,7 +505,7 @@ static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)
505 505
506static inline bool is_powersaving_dpms(int mode) 506static inline bool is_powersaving_dpms(int mode)
507{ 507{
508 return (mode != DRM_MODE_DPMS_ON); 508 return mode != DRM_MODE_DPMS_ON && mode != NV_DPMS_CLEARED;
509} 509}
510 510
511static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) 511static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode)
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c
index 7ae7f97a6d4..03017f24d59 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -162,6 +162,13 @@ nv10_fence_destroy(struct nouveau_drm *drm)
162 kfree(priv); 162 kfree(priv);
163} 163}
164 164
165void nv17_fence_resume(struct nouveau_drm *drm)
166{
167 struct nv10_fence_priv *priv = drm->fence;
168
169 nouveau_bo_wr32(priv->bo, 0, priv->sequence);
170}
171
165int 172int
166nv10_fence_create(struct nouveau_drm *drm) 173nv10_fence_create(struct nouveau_drm *drm)
167{ 174{
@@ -197,6 +204,7 @@ nv10_fence_create(struct nouveau_drm *drm)
197 if (ret == 0) { 204 if (ret == 0) {
198 nouveau_bo_wr32(priv->bo, 0x000, 0x00000000); 205 nouveau_bo_wr32(priv->bo, 0x000, 0x00000000);
199 priv->base.sync = nv17_fence_sync; 206 priv->base.sync = nv17_fence_sync;
207 priv->base.resume = nv17_fence_resume;
200 } 208 }
201 } 209 }
202 210
diff --git a/drivers/gpu/drm/nouveau/nv50_fence.c b/drivers/gpu/drm/nouveau/nv50_fence.c
index c20f2727ea0..d889f3ac0d4 100644
--- a/drivers/gpu/drm/nouveau/nv50_fence.c
+++ b/drivers/gpu/drm/nouveau/nv50_fence.c
@@ -122,6 +122,7 @@ nv50_fence_create(struct nouveau_drm *drm)
122 if (ret == 0) { 122 if (ret == 0) {
123 nouveau_bo_wr32(priv->bo, 0x000, 0x00000000); 123 nouveau_bo_wr32(priv->bo, 0x000, 0x00000000);
124 priv->base.sync = nv17_fence_sync; 124 priv->base.sync = nv17_fence_sync;
125 priv->base.resume = nv17_fence_resume;
125 } 126 }
126 127
127 if (ret) 128 if (ret)
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index f95d7fc1f5e..061fa0a2890 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2306,22 +2306,20 @@ bool evergreen_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *rin
2306 return radeon_ring_test_lockup(rdev, ring); 2306 return radeon_ring_test_lockup(rdev, ring);
2307} 2307}
2308 2308
2309static int evergreen_gpu_soft_reset(struct radeon_device *rdev) 2309static void evergreen_gpu_soft_reset_gfx(struct radeon_device *rdev)
2310{ 2310{
2311 struct evergreen_mc_save save;
2312 u32 grbm_reset = 0; 2311 u32 grbm_reset = 0;
2313 2312
2314 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) 2313 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE))
2315 return 0; 2314 return;
2316 2315
2317 dev_info(rdev->dev, "GPU softreset \n"); 2316 dev_info(rdev->dev, " GRBM_STATUS = 0x%08X\n",
2318 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
2319 RREG32(GRBM_STATUS)); 2317 RREG32(GRBM_STATUS));
2320 dev_info(rdev->dev, " GRBM_STATUS_SE0=0x%08X\n", 2318 dev_info(rdev->dev, " GRBM_STATUS_SE0 = 0x%08X\n",
2321 RREG32(GRBM_STATUS_SE0)); 2319 RREG32(GRBM_STATUS_SE0));
2322 dev_info(rdev->dev, " GRBM_STATUS_SE1=0x%08X\n", 2320 dev_info(rdev->dev, " GRBM_STATUS_SE1 = 0x%08X\n",
2323 RREG32(GRBM_STATUS_SE1)); 2321 RREG32(GRBM_STATUS_SE1));
2324 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 2322 dev_info(rdev->dev, " SRBM_STATUS = 0x%08X\n",
2325 RREG32(SRBM_STATUS)); 2323 RREG32(SRBM_STATUS));
2326 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 2324 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
2327 RREG32(CP_STALLED_STAT1)); 2325 RREG32(CP_STALLED_STAT1));
@@ -2331,10 +2329,7 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
2331 RREG32(CP_BUSY_STAT)); 2329 RREG32(CP_BUSY_STAT));
2332 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 2330 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
2333 RREG32(CP_STAT)); 2331 RREG32(CP_STAT));
2334 evergreen_mc_stop(rdev, &save); 2332
2335 if (evergreen_mc_wait_for_idle(rdev)) {
2336 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
2337 }
2338 /* Disable CP parsing/prefetching */ 2333 /* Disable CP parsing/prefetching */
2339 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT); 2334 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT);
2340 2335
@@ -2358,15 +2353,14 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
2358 udelay(50); 2353 udelay(50);
2359 WREG32(GRBM_SOFT_RESET, 0); 2354 WREG32(GRBM_SOFT_RESET, 0);
2360 (void)RREG32(GRBM_SOFT_RESET); 2355 (void)RREG32(GRBM_SOFT_RESET);
2361 /* Wait a little for things to settle down */ 2356
2362 udelay(50); 2357 dev_info(rdev->dev, " GRBM_STATUS = 0x%08X\n",
2363 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
2364 RREG32(GRBM_STATUS)); 2358 RREG32(GRBM_STATUS));
2365 dev_info(rdev->dev, " GRBM_STATUS_SE0=0x%08X\n", 2359 dev_info(rdev->dev, " GRBM_STATUS_SE0 = 0x%08X\n",
2366 RREG32(GRBM_STATUS_SE0)); 2360 RREG32(GRBM_STATUS_SE0));
2367 dev_info(rdev->dev, " GRBM_STATUS_SE1=0x%08X\n", 2361 dev_info(rdev->dev, " GRBM_STATUS_SE1 = 0x%08X\n",
2368 RREG32(GRBM_STATUS_SE1)); 2362 RREG32(GRBM_STATUS_SE1));
2369 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 2363 dev_info(rdev->dev, " SRBM_STATUS = 0x%08X\n",
2370 RREG32(SRBM_STATUS)); 2364 RREG32(SRBM_STATUS));
2371 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 2365 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
2372 RREG32(CP_STALLED_STAT1)); 2366 RREG32(CP_STALLED_STAT1));
@@ -2376,13 +2370,65 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
2376 RREG32(CP_BUSY_STAT)); 2370 RREG32(CP_BUSY_STAT));
2377 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 2371 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
2378 RREG32(CP_STAT)); 2372 RREG32(CP_STAT));
2373}
2374
2375static void evergreen_gpu_soft_reset_dma(struct radeon_device *rdev)
2376{
2377 u32 tmp;
2378
2379 if (RREG32(DMA_STATUS_REG) & DMA_IDLE)
2380 return;
2381
2382 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
2383 RREG32(DMA_STATUS_REG));
2384
2385 /* Disable DMA */
2386 tmp = RREG32(DMA_RB_CNTL);
2387 tmp &= ~DMA_RB_ENABLE;
2388 WREG32(DMA_RB_CNTL, tmp);
2389
2390 /* Reset dma */
2391 WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA);
2392 RREG32(SRBM_SOFT_RESET);
2393 udelay(50);
2394 WREG32(SRBM_SOFT_RESET, 0);
2395
2396 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
2397 RREG32(DMA_STATUS_REG));
2398}
2399
2400static int evergreen_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
2401{
2402 struct evergreen_mc_save save;
2403
2404 if (reset_mask == 0)
2405 return 0;
2406
2407 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
2408
2409 evergreen_mc_stop(rdev, &save);
2410 if (evergreen_mc_wait_for_idle(rdev)) {
2411 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
2412 }
2413
2414 if (reset_mask & (RADEON_RESET_GFX | RADEON_RESET_COMPUTE))
2415 evergreen_gpu_soft_reset_gfx(rdev);
2416
2417 if (reset_mask & RADEON_RESET_DMA)
2418 evergreen_gpu_soft_reset_dma(rdev);
2419
2420 /* Wait a little for things to settle down */
2421 udelay(50);
2422
2379 evergreen_mc_resume(rdev, &save); 2423 evergreen_mc_resume(rdev, &save);
2380 return 0; 2424 return 0;
2381} 2425}
2382 2426
2383int evergreen_asic_reset(struct radeon_device *rdev) 2427int evergreen_asic_reset(struct radeon_device *rdev)
2384{ 2428{
2385 return evergreen_gpu_soft_reset(rdev); 2429 return evergreen_gpu_soft_reset(rdev, (RADEON_RESET_GFX |
2430 RADEON_RESET_COMPUTE |
2431 RADEON_RESET_DMA));
2386} 2432}
2387 2433
2388/* Interrupts */ 2434/* Interrupts */
@@ -3215,7 +3261,7 @@ void evergreen_dma_fence_ring_emit(struct radeon_device *rdev,
3215 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_TRAP, 0, 0, 0)); 3261 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_TRAP, 0, 0, 0));
3216 /* flush HDP */ 3262 /* flush HDP */
3217 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0)); 3263 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0));
3218 radeon_ring_write(ring, (0xf << 16) | HDP_MEM_COHERENCY_FLUSH_CNTL); 3264 radeon_ring_write(ring, (0xf << 16) | (HDP_MEM_COHERENCY_FLUSH_CNTL >> 2));
3219 radeon_ring_write(ring, 1); 3265 radeon_ring_write(ring, 1);
3220} 3266}
3221 3267
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
index cb9baaac9e8..0bfd0e9e469 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -742,8 +742,9 @@
742#define SOFT_RESET_ROM (1 << 14) 742#define SOFT_RESET_ROM (1 << 14)
743#define SOFT_RESET_SEM (1 << 15) 743#define SOFT_RESET_SEM (1 << 15)
744#define SOFT_RESET_VMC (1 << 17) 744#define SOFT_RESET_VMC (1 << 17)
745#define SOFT_RESET_DMA (1 << 20)
745#define SOFT_RESET_TST (1 << 21) 746#define SOFT_RESET_TST (1 << 21)
746#define SOFT_RESET_REGBB (1 << 22) 747#define SOFT_RESET_REGBB (1 << 22)
747#define SOFT_RESET_ORB (1 << 23) 748#define SOFT_RESET_ORB (1 << 23)
748 749
749/* display watermarks */ 750/* display watermarks */
@@ -2027,4 +2028,15 @@
2027/* cayman packet3 addition */ 2028/* cayman packet3 addition */
2028#define CAYMAN_PACKET3_DEALLOC_STATE 0x14 2029#define CAYMAN_PACKET3_DEALLOC_STATE 0x14
2029 2030
2031/* DMA regs common on r6xx/r7xx/evergreen/ni */
2032#define DMA_RB_CNTL 0xd000
2033# define DMA_RB_ENABLE (1 << 0)
2034# define DMA_RB_SIZE(x) ((x) << 1) /* log2 */
2035# define DMA_RB_SWAP_ENABLE (1 << 9) /* 8IN32 */
2036# define DMA_RPTR_WRITEBACK_ENABLE (1 << 12)
2037# define DMA_RPTR_WRITEBACK_SWAP_ENABLE (1 << 13) /* 8IN32 */
2038# define DMA_RPTR_WRITEBACK_TIMER(x) ((x) << 16) /* log2 */
2039#define DMA_STATUS_REG 0xd034
2040# define DMA_IDLE (1 << 0)
2041
2030#endif 2042#endif
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 7bdbcb00aaf..896f1cbc58a 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1306,22 +1306,20 @@ void cayman_dma_fini(struct radeon_device *rdev)
1306 radeon_ring_fini(rdev, &rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX]); 1306 radeon_ring_fini(rdev, &rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX]);
1307} 1307}
1308 1308
1309static int cayman_gpu_soft_reset(struct radeon_device *rdev) 1309static void cayman_gpu_soft_reset_gfx(struct radeon_device *rdev)
1310{ 1310{
1311 struct evergreen_mc_save save;
1312 u32 grbm_reset = 0; 1311 u32 grbm_reset = 0;
1313 1312
1314 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) 1313 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE))
1315 return 0; 1314 return;
1316 1315
1317 dev_info(rdev->dev, "GPU softreset \n"); 1316 dev_info(rdev->dev, " GRBM_STATUS = 0x%08X\n",
1318 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
1319 RREG32(GRBM_STATUS)); 1317 RREG32(GRBM_STATUS));
1320 dev_info(rdev->dev, " GRBM_STATUS_SE0=0x%08X\n", 1318 dev_info(rdev->dev, " GRBM_STATUS_SE0 = 0x%08X\n",
1321 RREG32(GRBM_STATUS_SE0)); 1319 RREG32(GRBM_STATUS_SE0));
1322 dev_info(rdev->dev, " GRBM_STATUS_SE1=0x%08X\n", 1320 dev_info(rdev->dev, " GRBM_STATUS_SE1 = 0x%08X\n",
1323 RREG32(GRBM_STATUS_SE1)); 1321 RREG32(GRBM_STATUS_SE1));
1324 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 1322 dev_info(rdev->dev, " SRBM_STATUS = 0x%08X\n",
1325 RREG32(SRBM_STATUS)); 1323 RREG32(SRBM_STATUS));
1326 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 1324 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
1327 RREG32(CP_STALLED_STAT1)); 1325 RREG32(CP_STALLED_STAT1));
@@ -1331,19 +1329,7 @@ static int cayman_gpu_soft_reset(struct radeon_device *rdev)
1331 RREG32(CP_BUSY_STAT)); 1329 RREG32(CP_BUSY_STAT));
1332 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 1330 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
1333 RREG32(CP_STAT)); 1331 RREG32(CP_STAT));
1334 dev_info(rdev->dev, " VM_CONTEXT0_PROTECTION_FAULT_ADDR 0x%08X\n",
1335 RREG32(0x14F8));
1336 dev_info(rdev->dev, " VM_CONTEXT0_PROTECTION_FAULT_STATUS 0x%08X\n",
1337 RREG32(0x14D8));
1338 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
1339 RREG32(0x14FC));
1340 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
1341 RREG32(0x14DC));
1342 1332
1343 evergreen_mc_stop(rdev, &save);
1344 if (evergreen_mc_wait_for_idle(rdev)) {
1345 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
1346 }
1347 /* Disable CP parsing/prefetching */ 1333 /* Disable CP parsing/prefetching */
1348 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT); 1334 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT);
1349 1335
@@ -1368,16 +1354,14 @@ static int cayman_gpu_soft_reset(struct radeon_device *rdev)
1368 udelay(50); 1354 udelay(50);
1369 WREG32(GRBM_SOFT_RESET, 0); 1355 WREG32(GRBM_SOFT_RESET, 0);
1370 (void)RREG32(GRBM_SOFT_RESET); 1356 (void)RREG32(GRBM_SOFT_RESET);
1371 /* Wait a little for things to settle down */
1372 udelay(50);
1373 1357
1374 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", 1358 dev_info(rdev->dev, " GRBM_STATUS = 0x%08X\n",
1375 RREG32(GRBM_STATUS)); 1359 RREG32(GRBM_STATUS));
1376 dev_info(rdev->dev, " GRBM_STATUS_SE0=0x%08X\n", 1360 dev_info(rdev->dev, " GRBM_STATUS_SE0 = 0x%08X\n",
1377 RREG32(GRBM_STATUS_SE0)); 1361 RREG32(GRBM_STATUS_SE0));
1378 dev_info(rdev->dev, " GRBM_STATUS_SE1=0x%08X\n", 1362 dev_info(rdev->dev, " GRBM_STATUS_SE1 = 0x%08X\n",
1379 RREG32(GRBM_STATUS_SE1)); 1363 RREG32(GRBM_STATUS_SE1));
1380 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 1364 dev_info(rdev->dev, " SRBM_STATUS = 0x%08X\n",
1381 RREG32(SRBM_STATUS)); 1365 RREG32(SRBM_STATUS));
1382 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 1366 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
1383 RREG32(CP_STALLED_STAT1)); 1367 RREG32(CP_STALLED_STAT1));
@@ -1387,13 +1371,81 @@ static int cayman_gpu_soft_reset(struct radeon_device *rdev)
1387 RREG32(CP_BUSY_STAT)); 1371 RREG32(CP_BUSY_STAT));
1388 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 1372 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
1389 RREG32(CP_STAT)); 1373 RREG32(CP_STAT));
1374
1375}
1376
1377static void cayman_gpu_soft_reset_dma(struct radeon_device *rdev)
1378{
1379 u32 tmp;
1380
1381 if (RREG32(DMA_STATUS_REG) & DMA_IDLE)
1382 return;
1383
1384 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
1385 RREG32(DMA_STATUS_REG));
1386
1387 /* dma0 */
1388 tmp = RREG32(DMA_RB_CNTL + DMA0_REGISTER_OFFSET);
1389 tmp &= ~DMA_RB_ENABLE;
1390 WREG32(DMA_RB_CNTL + DMA0_REGISTER_OFFSET, tmp);
1391
1392 /* dma1 */
1393 tmp = RREG32(DMA_RB_CNTL + DMA1_REGISTER_OFFSET);
1394 tmp &= ~DMA_RB_ENABLE;
1395 WREG32(DMA_RB_CNTL + DMA1_REGISTER_OFFSET, tmp);
1396
1397 /* Reset dma */
1398 WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1);
1399 RREG32(SRBM_SOFT_RESET);
1400 udelay(50);
1401 WREG32(SRBM_SOFT_RESET, 0);
1402
1403 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
1404 RREG32(DMA_STATUS_REG));
1405
1406}
1407
1408static int cayman_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
1409{
1410 struct evergreen_mc_save save;
1411
1412 if (reset_mask == 0)
1413 return 0;
1414
1415 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
1416
1417 dev_info(rdev->dev, " VM_CONTEXT0_PROTECTION_FAULT_ADDR 0x%08X\n",
1418 RREG32(0x14F8));
1419 dev_info(rdev->dev, " VM_CONTEXT0_PROTECTION_FAULT_STATUS 0x%08X\n",
1420 RREG32(0x14D8));
1421 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
1422 RREG32(0x14FC));
1423 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
1424 RREG32(0x14DC));
1425
1426 evergreen_mc_stop(rdev, &save);
1427 if (evergreen_mc_wait_for_idle(rdev)) {
1428 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
1429 }
1430
1431 if (reset_mask & (RADEON_RESET_GFX | RADEON_RESET_COMPUTE))
1432 cayman_gpu_soft_reset_gfx(rdev);
1433
1434 if (reset_mask & RADEON_RESET_DMA)
1435 cayman_gpu_soft_reset_dma(rdev);
1436
1437 /* Wait a little for things to settle down */
1438 udelay(50);
1439
1390 evergreen_mc_resume(rdev, &save); 1440 evergreen_mc_resume(rdev, &save);
1391 return 0; 1441 return 0;
1392} 1442}
1393 1443
1394int cayman_asic_reset(struct radeon_device *rdev) 1444int cayman_asic_reset(struct radeon_device *rdev)
1395{ 1445{
1396 return cayman_gpu_soft_reset(rdev); 1446 return cayman_gpu_soft_reset(rdev, (RADEON_RESET_GFX |
1447 RADEON_RESET_COMPUTE |
1448 RADEON_RESET_DMA));
1397} 1449}
1398 1450
1399/** 1451/**
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h
index b93186b8ee4..48e5022ee92 100644
--- a/drivers/gpu/drm/radeon/nid.h
+++ b/drivers/gpu/drm/radeon/nid.h
@@ -65,7 +65,7 @@
65#define SOFT_RESET_VMC (1 << 17) 65#define SOFT_RESET_VMC (1 << 17)
66#define SOFT_RESET_DMA (1 << 20) 66#define SOFT_RESET_DMA (1 << 20)
67#define SOFT_RESET_TST (1 << 21) 67#define SOFT_RESET_TST (1 << 21)
68#define SOFT_RESET_REGBB (1 << 22) 68#define SOFT_RESET_REGBB (1 << 22)
69#define SOFT_RESET_ORB (1 << 23) 69#define SOFT_RESET_ORB (1 << 23)
70 70
71#define VM_CONTEXT0_REQUEST_RESPONSE 0x1470 71#define VM_CONTEXT0_REQUEST_RESPONSE 0x1470
@@ -675,4 +675,3 @@
675#define DMA_PACKET_NOP 0xf 675#define DMA_PACKET_NOP 0xf
676 676
677#endif 677#endif
678
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 2aaf147969b..537e259b383 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1258,9 +1258,8 @@ void r600_vram_scratch_fini(struct radeon_device *rdev)
1258 * reset, it's up to the caller to determine if the GPU needs one. We 1258 * reset, it's up to the caller to determine if the GPU needs one. We
1259 * might add an helper function to check that. 1259 * might add an helper function to check that.
1260 */ 1260 */
1261static int r600_gpu_soft_reset(struct radeon_device *rdev) 1261static void r600_gpu_soft_reset_gfx(struct radeon_device *rdev)
1262{ 1262{
1263 struct rv515_mc_save save;
1264 u32 grbm_busy_mask = S_008010_VC_BUSY(1) | S_008010_VGT_BUSY_NO_DMA(1) | 1263 u32 grbm_busy_mask = S_008010_VC_BUSY(1) | S_008010_VGT_BUSY_NO_DMA(1) |
1265 S_008010_VGT_BUSY(1) | S_008010_TA03_BUSY(1) | 1264 S_008010_VGT_BUSY(1) | S_008010_TA03_BUSY(1) |
1266 S_008010_TC_BUSY(1) | S_008010_SX_BUSY(1) | 1265 S_008010_TC_BUSY(1) | S_008010_SX_BUSY(1) |
@@ -1280,14 +1279,13 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev)
1280 u32 tmp; 1279 u32 tmp;
1281 1280
1282 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) 1281 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE))
1283 return 0; 1282 return;
1284 1283
1285 dev_info(rdev->dev, "GPU softreset \n"); 1284 dev_info(rdev->dev, " R_008010_GRBM_STATUS = 0x%08X\n",
1286 dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n",
1287 RREG32(R_008010_GRBM_STATUS)); 1285 RREG32(R_008010_GRBM_STATUS));
1288 dev_info(rdev->dev, " R_008014_GRBM_STATUS2=0x%08X\n", 1286 dev_info(rdev->dev, " R_008014_GRBM_STATUS2 = 0x%08X\n",
1289 RREG32(R_008014_GRBM_STATUS2)); 1287 RREG32(R_008014_GRBM_STATUS2));
1290 dev_info(rdev->dev, " R_000E50_SRBM_STATUS=0x%08X\n", 1288 dev_info(rdev->dev, " R_000E50_SRBM_STATUS = 0x%08X\n",
1291 RREG32(R_000E50_SRBM_STATUS)); 1289 RREG32(R_000E50_SRBM_STATUS));
1292 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 1290 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
1293 RREG32(CP_STALLED_STAT1)); 1291 RREG32(CP_STALLED_STAT1));
@@ -1297,12 +1295,10 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev)
1297 RREG32(CP_BUSY_STAT)); 1295 RREG32(CP_BUSY_STAT));
1298 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 1296 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
1299 RREG32(CP_STAT)); 1297 RREG32(CP_STAT));
1300 rv515_mc_stop(rdev, &save); 1298
1301 if (r600_mc_wait_for_idle(rdev)) {
1302 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
1303 }
1304 /* Disable CP parsing/prefetching */ 1299 /* Disable CP parsing/prefetching */
1305 WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); 1300 WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1));
1301
1306 /* Check if any of the rendering block is busy and reset it */ 1302 /* Check if any of the rendering block is busy and reset it */
1307 if ((RREG32(R_008010_GRBM_STATUS) & grbm_busy_mask) || 1303 if ((RREG32(R_008010_GRBM_STATUS) & grbm_busy_mask) ||
1308 (RREG32(R_008014_GRBM_STATUS2) & grbm2_busy_mask)) { 1304 (RREG32(R_008014_GRBM_STATUS2) & grbm2_busy_mask)) {
@@ -1332,13 +1328,12 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev)
1332 RREG32(R_008020_GRBM_SOFT_RESET); 1328 RREG32(R_008020_GRBM_SOFT_RESET);
1333 mdelay(15); 1329 mdelay(15);
1334 WREG32(R_008020_GRBM_SOFT_RESET, 0); 1330 WREG32(R_008020_GRBM_SOFT_RESET, 0);
1335 /* Wait a little for things to settle down */ 1331
1336 mdelay(1); 1332 dev_info(rdev->dev, " R_008010_GRBM_STATUS = 0x%08X\n",
1337 dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n",
1338 RREG32(R_008010_GRBM_STATUS)); 1333 RREG32(R_008010_GRBM_STATUS));
1339 dev_info(rdev->dev, " R_008014_GRBM_STATUS2=0x%08X\n", 1334 dev_info(rdev->dev, " R_008014_GRBM_STATUS2 = 0x%08X\n",
1340 RREG32(R_008014_GRBM_STATUS2)); 1335 RREG32(R_008014_GRBM_STATUS2));
1341 dev_info(rdev->dev, " R_000E50_SRBM_STATUS=0x%08X\n", 1336 dev_info(rdev->dev, " R_000E50_SRBM_STATUS = 0x%08X\n",
1342 RREG32(R_000E50_SRBM_STATUS)); 1337 RREG32(R_000E50_SRBM_STATUS));
1343 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", 1338 dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n",
1344 RREG32(CP_STALLED_STAT1)); 1339 RREG32(CP_STALLED_STAT1));
@@ -1348,6 +1343,60 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev)
1348 RREG32(CP_BUSY_STAT)); 1343 RREG32(CP_BUSY_STAT));
1349 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n", 1344 dev_info(rdev->dev, " R_008680_CP_STAT = 0x%08X\n",
1350 RREG32(CP_STAT)); 1345 RREG32(CP_STAT));
1346
1347}
1348
1349static void r600_gpu_soft_reset_dma(struct radeon_device *rdev)
1350{
1351 u32 tmp;
1352
1353 if (RREG32(DMA_STATUS_REG) & DMA_IDLE)
1354 return;
1355
1356 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
1357 RREG32(DMA_STATUS_REG));
1358
1359 /* Disable DMA */
1360 tmp = RREG32(DMA_RB_CNTL);
1361 tmp &= ~DMA_RB_ENABLE;
1362 WREG32(DMA_RB_CNTL, tmp);
1363
1364 /* Reset dma */
1365 if (rdev->family >= CHIP_RV770)
1366 WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA);
1367 else
1368 WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA);
1369 RREG32(SRBM_SOFT_RESET);
1370 udelay(50);
1371 WREG32(SRBM_SOFT_RESET, 0);
1372
1373 dev_info(rdev->dev, " R_00D034_DMA_STATUS_REG = 0x%08X\n",
1374 RREG32(DMA_STATUS_REG));
1375}
1376
1377static int r600_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
1378{
1379 struct rv515_mc_save save;
1380
1381 if (reset_mask == 0)
1382 return 0;
1383
1384 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
1385
1386 rv515_mc_stop(rdev, &save);
1387 if (r600_mc_wait_for_idle(rdev)) {
1388 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
1389 }
1390
1391 if (reset_mask & (RADEON_RESET_GFX | RADEON_RESET_COMPUTE))
1392 r600_gpu_soft_reset_gfx(rdev);
1393
1394 if (reset_mask & RADEON_RESET_DMA)
1395 r600_gpu_soft_reset_dma(rdev);
1396
1397 /* Wait a little for things to settle down */
1398 mdelay(1);
1399
1351 rv515_mc_resume(rdev, &save); 1400 rv515_mc_resume(rdev, &save);
1352 return 0; 1401 return 0;
1353} 1402}
@@ -1395,7 +1444,9 @@ bool r600_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
1395 1444
1396int r600_asic_reset(struct radeon_device *rdev) 1445int r600_asic_reset(struct radeon_device *rdev)
1397{ 1446{
1398 return r600_gpu_soft_reset(rdev); 1447 return r600_gpu_soft_reset(rdev, (RADEON_RESET_GFX |
1448 RADEON_RESET_COMPUTE |
1449 RADEON_RESET_DMA));
1399} 1450}
1400 1451
1401u32 r6xx_remap_render_backend(struct radeon_device *rdev, 1452u32 r6xx_remap_render_backend(struct radeon_device *rdev,
@@ -2595,7 +2646,7 @@ int r600_copy_blit(struct radeon_device *rdev,
2595 * @num_gpu_pages: number of GPU pages to xfer 2646 * @num_gpu_pages: number of GPU pages to xfer
2596 * @fence: radeon fence object 2647 * @fence: radeon fence object
2597 * 2648 *
2598 * Copy GPU paging using the DMA engine (r6xx-r7xx). 2649 * Copy GPU paging using the DMA engine (r6xx).
2599 * Used by the radeon ttm implementation to move pages if 2650 * Used by the radeon ttm implementation to move pages if
2600 * registered as the asic copy callback. 2651 * registered as the asic copy callback.
2601 */ 2652 */
@@ -2618,8 +2669,8 @@ int r600_copy_dma(struct radeon_device *rdev,
2618 } 2669 }
2619 2670
2620 size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4; 2671 size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
2621 num_loops = DIV_ROUND_UP(size_in_dw, 0xffff); 2672 num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFE);
2622 r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8); 2673 r = radeon_ring_lock(rdev, ring, num_loops * 4 + 8);
2623 if (r) { 2674 if (r) {
2624 DRM_ERROR("radeon: moving bo (%d).\n", r); 2675 DRM_ERROR("radeon: moving bo (%d).\n", r);
2625 radeon_semaphore_free(rdev, &sem, NULL); 2676 radeon_semaphore_free(rdev, &sem, NULL);
@@ -2636,14 +2687,14 @@ int r600_copy_dma(struct radeon_device *rdev,
2636 2687
2637 for (i = 0; i < num_loops; i++) { 2688 for (i = 0; i < num_loops; i++) {
2638 cur_size_in_dw = size_in_dw; 2689 cur_size_in_dw = size_in_dw;
2639 if (cur_size_in_dw > 0xFFFF) 2690 if (cur_size_in_dw > 0xFFFE)
2640 cur_size_in_dw = 0xFFFF; 2691 cur_size_in_dw = 0xFFFE;
2641 size_in_dw -= cur_size_in_dw; 2692 size_in_dw -= cur_size_in_dw;
2642 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw)); 2693 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
2643 radeon_ring_write(ring, dst_offset & 0xfffffffc); 2694 radeon_ring_write(ring, dst_offset & 0xfffffffc);
2644 radeon_ring_write(ring, src_offset & 0xfffffffc); 2695 radeon_ring_write(ring, src_offset & 0xfffffffc);
2645 radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff); 2696 radeon_ring_write(ring, (((upper_32_bits(dst_offset) & 0xff) << 16) |
2646 radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff); 2697 (upper_32_bits(src_offset) & 0xff)));
2647 src_offset += cur_size_in_dw * 4; 2698 src_offset += cur_size_in_dw * 4;
2648 dst_offset += cur_size_in_dw * 4; 2699 dst_offset += cur_size_in_dw * 4;
2649 } 2700 }
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 9ea13d07cc5..69ec24ab8d6 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -2476,8 +2476,10 @@ static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error)
2476 kfree(parser->relocs); 2476 kfree(parser->relocs);
2477 for (i = 0; i < parser->nchunks; i++) { 2477 for (i = 0; i < parser->nchunks; i++) {
2478 kfree(parser->chunks[i].kdata); 2478 kfree(parser->chunks[i].kdata);
2479 kfree(parser->chunks[i].kpage[0]); 2479 if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) {
2480 kfree(parser->chunks[i].kpage[1]); 2480 kfree(parser->chunks[i].kpage[0]);
2481 kfree(parser->chunks[i].kpage[1]);
2482 }
2481 } 2483 }
2482 kfree(parser->chunks); 2484 kfree(parser->chunks);
2483 kfree(parser->chunks_array); 2485 kfree(parser->chunks_array);
@@ -2561,16 +2563,16 @@ int r600_dma_cs_next_reloc(struct radeon_cs_parser *p,
2561 struct radeon_cs_chunk *relocs_chunk; 2563 struct radeon_cs_chunk *relocs_chunk;
2562 unsigned idx; 2564 unsigned idx;
2563 2565
2566 *cs_reloc = NULL;
2564 if (p->chunk_relocs_idx == -1) { 2567 if (p->chunk_relocs_idx == -1) {
2565 DRM_ERROR("No relocation chunk !\n"); 2568 DRM_ERROR("No relocation chunk !\n");
2566 return -EINVAL; 2569 return -EINVAL;
2567 } 2570 }
2568 *cs_reloc = NULL;
2569 relocs_chunk = &p->chunks[p->chunk_relocs_idx]; 2571 relocs_chunk = &p->chunks[p->chunk_relocs_idx];
2570 idx = p->dma_reloc_idx; 2572 idx = p->dma_reloc_idx;
2571 if (idx >= relocs_chunk->length_dw) { 2573 if (idx >= p->nrelocs) {
2572 DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", 2574 DRM_ERROR("Relocs at %d after relocations chunk end %d !\n",
2573 idx, relocs_chunk->length_dw); 2575 idx, p->nrelocs);
2574 return -EINVAL; 2576 return -EINVAL;
2575 } 2577 }
2576 *cs_reloc = p->relocs_ptr[idx]; 2578 *cs_reloc = p->relocs_ptr[idx];
@@ -2677,16 +2679,29 @@ int r600_dma_cs_parse(struct radeon_cs_parser *p)
2677 } 2679 }
2678 p->idx += 7; 2680 p->idx += 7;
2679 } else { 2681 } else {
2680 src_offset = ib[idx+2]; 2682 if (p->family >= CHIP_RV770) {
2681 src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32; 2683 src_offset = ib[idx+2];
2682 dst_offset = ib[idx+1]; 2684 src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32;
2683 dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32; 2685 dst_offset = ib[idx+1];
2686 dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
2684 2687
2685 ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc); 2688 ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
2686 ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc); 2689 ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
2687 ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff; 2690 ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff;
2688 ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff; 2691 ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
2689 p->idx += 5; 2692 p->idx += 5;
2693 } else {
2694 src_offset = ib[idx+2];
2695 src_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
2696 dst_offset = ib[idx+1];
2697 dst_offset |= ((u64)(ib[idx+3] & 0xff0000)) << 16;
2698
2699 ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
2700 ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
2701 ib[idx+3] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
2702 ib[idx+3] += (upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff) << 16;
2703 p->idx += 4;
2704 }
2690 } 2705 }
2691 if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) { 2706 if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) {
2692 dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n", 2707 dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n",
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 9b9422c4403..34e52304a52 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -132,6 +132,11 @@ extern int radeon_lockup_timeout;
132#define RADEON_VA_RESERVED_SIZE (8 << 20) 132#define RADEON_VA_RESERVED_SIZE (8 << 20)
133#define RADEON_IB_VM_MAX_SIZE (64 << 10) 133#define RADEON_IB_VM_MAX_SIZE (64 << 10)
134 134
135/* reset flags */
136#define RADEON_RESET_GFX (1 << 0)
137#define RADEON_RESET_COMPUTE (1 << 1)
138#define RADEON_RESET_DMA (1 << 2)
139
135/* 140/*
136 * Errata workarounds. 141 * Errata workarounds.
137 */ 142 */
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index 596bcbe80ed..9056fafb00e 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1140,9 +1140,9 @@ static struct radeon_asic rv770_asic = {
1140 .copy = { 1140 .copy = {
1141 .blit = &r600_copy_blit, 1141 .blit = &r600_copy_blit,
1142 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, 1142 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1143 .dma = &r600_copy_dma, 1143 .dma = &rv770_copy_dma,
1144 .dma_ring_index = R600_RING_TYPE_DMA_INDEX, 1144 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1145 .copy = &r600_copy_dma, 1145 .copy = &rv770_copy_dma,
1146 .copy_ring_index = R600_RING_TYPE_DMA_INDEX, 1146 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1147 }, 1147 },
1148 .surface = { 1148 .surface = {
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 5f4882cc215..15d70e61307 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -403,6 +403,10 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base);
403void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); 403void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
404void r700_cp_stop(struct radeon_device *rdev); 404void r700_cp_stop(struct radeon_device *rdev);
405void r700_cp_fini(struct radeon_device *rdev); 405void r700_cp_fini(struct radeon_device *rdev);
406int rv770_copy_dma(struct radeon_device *rdev,
407 uint64_t src_offset, uint64_t dst_offset,
408 unsigned num_gpu_pages,
409 struct radeon_fence **fence);
406 410
407/* 411/*
408 * evergreen 412 * evergreen
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 4af89126e22..33a56a09ff1 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1548,6 +1548,9 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1548 of_machine_is_compatible("PowerBook6,7")) { 1548 of_machine_is_compatible("PowerBook6,7")) {
1549 /* ibook */ 1549 /* ibook */
1550 rdev->mode_info.connector_table = CT_IBOOK; 1550 rdev->mode_info.connector_table = CT_IBOOK;
1551 } else if (of_machine_is_compatible("PowerMac3,5")) {
1552 /* PowerMac G4 Silver radeon 7500 */
1553 rdev->mode_info.connector_table = CT_MAC_G4_SILVER;
1551 } else if (of_machine_is_compatible("PowerMac4,4")) { 1554 } else if (of_machine_is_compatible("PowerMac4,4")) {
1552 /* emac */ 1555 /* emac */
1553 rdev->mode_info.connector_table = CT_EMAC; 1556 rdev->mode_info.connector_table = CT_EMAC;
@@ -2212,6 +2215,54 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
2212 CONNECTOR_OBJECT_ID_SVIDEO, 2215 CONNECTOR_OBJECT_ID_SVIDEO,
2213 &hpd); 2216 &hpd);
2214 break; 2217 break;
2218 case CT_MAC_G4_SILVER:
2219 DRM_INFO("Connector Table: %d (mac g4 silver)\n",
2220 rdev->mode_info.connector_table);
2221 /* DVI-I - tv dac, int tmds */
2222 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
2223 hpd.hpd = RADEON_HPD_1; /* ??? */
2224 radeon_add_legacy_encoder(dev,
2225 radeon_get_encoder_enum(dev,
2226 ATOM_DEVICE_DFP1_SUPPORT,
2227 0),
2228 ATOM_DEVICE_DFP1_SUPPORT);
2229 radeon_add_legacy_encoder(dev,
2230 radeon_get_encoder_enum(dev,
2231 ATOM_DEVICE_CRT2_SUPPORT,
2232 2),
2233 ATOM_DEVICE_CRT2_SUPPORT);
2234 radeon_add_legacy_connector(dev, 0,
2235 ATOM_DEVICE_DFP1_SUPPORT |
2236 ATOM_DEVICE_CRT2_SUPPORT,
2237 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
2238 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
2239 &hpd);
2240 /* VGA - primary dac */
2241 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
2242 hpd.hpd = RADEON_HPD_NONE;
2243 radeon_add_legacy_encoder(dev,
2244 radeon_get_encoder_enum(dev,
2245 ATOM_DEVICE_CRT1_SUPPORT,
2246 1),
2247 ATOM_DEVICE_CRT1_SUPPORT);
2248 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT,
2249 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
2250 CONNECTOR_OBJECT_ID_VGA,
2251 &hpd);
2252 /* TV - TV DAC */
2253 ddc_i2c.valid = false;
2254 hpd.hpd = RADEON_HPD_NONE;
2255 radeon_add_legacy_encoder(dev,
2256 radeon_get_encoder_enum(dev,
2257 ATOM_DEVICE_TV1_SUPPORT,
2258 2),
2259 ATOM_DEVICE_TV1_SUPPORT);
2260 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
2261 DRM_MODE_CONNECTOR_SVIDEO,
2262 &ddc_i2c,
2263 CONNECTOR_OBJECT_ID_SVIDEO,
2264 &hpd);
2265 break;
2215 default: 2266 default:
2216 DRM_INFO("Connector table: %d (invalid)\n", 2267 DRM_INFO("Connector table: %d (invalid)\n",
2217 rdev->mode_info.connector_table); 2268 rdev->mode_info.connector_table);
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 47bf162ab9c..2399f25ec03 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -741,7 +741,7 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
741 ret = connector_status_disconnected; 741 ret = connector_status_disconnected;
742 742
743 if (radeon_connector->ddc_bus) 743 if (radeon_connector->ddc_bus)
744 dret = radeon_ddc_probe(radeon_connector); 744 dret = radeon_ddc_probe(radeon_connector, false);
745 if (dret) { 745 if (dret) {
746 radeon_connector->detected_by_load = false; 746 radeon_connector->detected_by_load = false;
747 if (radeon_connector->edid) { 747 if (radeon_connector->edid) {
@@ -947,7 +947,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
947 return connector->status; 947 return connector->status;
948 948
949 if (radeon_connector->ddc_bus) 949 if (radeon_connector->ddc_bus)
950 dret = radeon_ddc_probe(radeon_connector); 950 dret = radeon_ddc_probe(radeon_connector, false);
951 if (dret) { 951 if (dret) {
952 radeon_connector->detected_by_load = false; 952 radeon_connector->detected_by_load = false;
953 if (radeon_connector->edid) { 953 if (radeon_connector->edid) {
@@ -1401,7 +1401,8 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1401 if (encoder) { 1401 if (encoder) {
1402 /* setup ddc on the bridge */ 1402 /* setup ddc on the bridge */
1403 radeon_atom_ext_encoder_setup_ddc(encoder); 1403 radeon_atom_ext_encoder_setup_ddc(encoder);
1404 if (radeon_ddc_probe(radeon_connector)) /* try DDC */ 1404 /* bridge chips are always aux */
1405 if (radeon_ddc_probe(radeon_connector, true)) /* try DDC */
1405 ret = connector_status_connected; 1406 ret = connector_status_connected;
1406 else if (radeon_connector->dac_load_detect) { /* try load detection */ 1407 else if (radeon_connector->dac_load_detect) { /* try load detection */
1407 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 1408 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
@@ -1419,7 +1420,8 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1419 if (radeon_dp_getdpcd(radeon_connector)) 1420 if (radeon_dp_getdpcd(radeon_connector))
1420 ret = connector_status_connected; 1421 ret = connector_status_connected;
1421 } else { 1422 } else {
1422 if (radeon_ddc_probe(radeon_connector)) 1423 /* try non-aux ddc (DP to DVI/HMDI/etc. adapter) */
1424 if (radeon_ddc_probe(radeon_connector, false))
1423 ret = connector_status_connected; 1425 ret = connector_status_connected;
1424 } 1426 }
1425 } 1427 }
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 396baba0141..469661fd190 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -279,13 +279,13 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
279 p->chunks[p->chunk_ib_idx].length_dw); 279 p->chunks[p->chunk_ib_idx].length_dw);
280 return -EINVAL; 280 return -EINVAL;
281 } 281 }
282 if ((p->rdev->flags & RADEON_IS_AGP)) { 282 if (p->rdev && (p->rdev->flags & RADEON_IS_AGP)) {
283 p->chunks[p->chunk_ib_idx].kpage[0] = kmalloc(PAGE_SIZE, GFP_KERNEL); 283 p->chunks[p->chunk_ib_idx].kpage[0] = kmalloc(PAGE_SIZE, GFP_KERNEL);
284 p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL); 284 p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL);
285 if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL || 285 if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL ||
286 p->chunks[p->chunk_ib_idx].kpage[1] == NULL) { 286 p->chunks[p->chunk_ib_idx].kpage[1] == NULL) {
287 kfree(p->chunks[i].kpage[0]); 287 kfree(p->chunks[p->chunk_ib_idx].kpage[0]);
288 kfree(p->chunks[i].kpage[1]); 288 kfree(p->chunks[p->chunk_ib_idx].kpage[1]);
289 return -ENOMEM; 289 return -ENOMEM;
290 } 290 }
291 } 291 }
@@ -583,7 +583,8 @@ static int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx)
583 struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx]; 583 struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
584 int i; 584 int i;
585 int size = PAGE_SIZE; 585 int size = PAGE_SIZE;
586 bool copy1 = (p->rdev->flags & RADEON_IS_AGP) ? false : true; 586 bool copy1 = (p->rdev && (p->rdev->flags & RADEON_IS_AGP)) ?
587 false : true;
587 588
588 for (i = ibc->last_copied_page + 1; i < pg_idx; i++) { 589 for (i = ibc->last_copied_page + 1; i < pg_idx; i++) {
589 if (DRM_COPY_FROM_USER(p->ib.ptr + (i * (PAGE_SIZE/4)), 590 if (DRM_COPY_FROM_USER(p->ib.ptr + (i * (PAGE_SIZE/4)),
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index cd756262924..edfc54e4184 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -897,6 +897,25 @@ static void radeon_check_arguments(struct radeon_device *rdev)
897} 897}
898 898
899/** 899/**
900 * radeon_switcheroo_quirk_long_wakeup - return true if longer d3 delay is
901 * needed for waking up.
902 *
903 * @pdev: pci dev pointer
904 */
905static bool radeon_switcheroo_quirk_long_wakeup(struct pci_dev *pdev)
906{
907
908 /* 6600m in a macbook pro */
909 if (pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
910 pdev->subsystem_device == 0x00e2) {
911 printk(KERN_INFO "radeon: quirking longer d3 wakeup delay\n");
912 return true;
913 }
914
915 return false;
916}
917
918/**
900 * radeon_switcheroo_set_state - set switcheroo state 919 * radeon_switcheroo_set_state - set switcheroo state
901 * 920 *
902 * @pdev: pci dev pointer 921 * @pdev: pci dev pointer
@@ -910,10 +929,19 @@ static void radeon_switcheroo_set_state(struct pci_dev *pdev, enum vga_switchero
910 struct drm_device *dev = pci_get_drvdata(pdev); 929 struct drm_device *dev = pci_get_drvdata(pdev);
911 pm_message_t pmm = { .event = PM_EVENT_SUSPEND }; 930 pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
912 if (state == VGA_SWITCHEROO_ON) { 931 if (state == VGA_SWITCHEROO_ON) {
932 unsigned d3_delay = dev->pdev->d3_delay;
933
913 printk(KERN_INFO "radeon: switched on\n"); 934 printk(KERN_INFO "radeon: switched on\n");
914 /* don't suspend or resume card normally */ 935 /* don't suspend or resume card normally */
915 dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; 936 dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
937
938 if (d3_delay < 20 && radeon_switcheroo_quirk_long_wakeup(pdev))
939 dev->pdev->d3_delay = 20;
940
916 radeon_resume_kms(dev); 941 radeon_resume_kms(dev);
942
943 dev->pdev->d3_delay = d3_delay;
944
917 dev->switch_power_state = DRM_SWITCH_POWER_ON; 945 dev->switch_power_state = DRM_SWITCH_POWER_ON;
918 drm_kms_helper_poll_enable(dev); 946 drm_kms_helper_poll_enable(dev);
919 } else { 947 } else {
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 310c0e5254b..1da2386d7cf 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -699,10 +699,15 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
699 if (radeon_connector->router.ddc_valid) 699 if (radeon_connector->router.ddc_valid)
700 radeon_router_select_ddc_port(radeon_connector); 700 radeon_router_select_ddc_port(radeon_connector);
701 701
702 if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) || 702 if (radeon_connector_encoder_get_dp_bridge_encoder_id(&radeon_connector->base) !=
703 (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) || 703 ENCODER_OBJECT_ID_NONE) {
704 (radeon_connector_encoder_get_dp_bridge_encoder_id(&radeon_connector->base) != 704 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
705 ENCODER_OBJECT_ID_NONE)) { 705
706 if (dig->dp_i2c_bus)
707 radeon_connector->edid = drm_get_edid(&radeon_connector->base,
708 &dig->dp_i2c_bus->adapter);
709 } else if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
710 (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)) {
706 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; 711 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
707 712
708 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT || 713 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index ff7593498a7..dff6cf77f95 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -306,8 +306,8 @@ static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
306 return 0; 306 return 0;
307} 307}
308 308
309static int __devinit 309static int radeon_pci_probe(struct pci_dev *pdev,
310radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 310 const struct pci_device_id *ent)
311{ 311{
312 int ret; 312 int ret;
313 313
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
index c5bddd630eb..fc60b74ee30 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -39,7 +39,7 @@ extern u32 radeon_atom_hw_i2c_func(struct i2c_adapter *adap);
39 * radeon_ddc_probe 39 * radeon_ddc_probe
40 * 40 *
41 */ 41 */
42bool radeon_ddc_probe(struct radeon_connector *radeon_connector) 42bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool use_aux)
43{ 43{
44 u8 out = 0x0; 44 u8 out = 0x0;
45 u8 buf[8]; 45 u8 buf[8];
@@ -63,7 +63,13 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector)
63 if (radeon_connector->router.ddc_valid) 63 if (radeon_connector->router.ddc_valid)
64 radeon_router_select_ddc_port(radeon_connector); 64 radeon_router_select_ddc_port(radeon_connector);
65 65
66 ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2); 66 if (use_aux) {
67 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
68 ret = i2c_transfer(&dig->dp_i2c_bus->adapter, msgs, 2);
69 } else {
70 ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2);
71 }
72
67 if (ret != 2) 73 if (ret != 2)
68 /* Couldn't find an accessible DDC on this connector */ 74 /* Couldn't find an accessible DDC on this connector */
69 return false; 75 return false;
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index f5ba2241dac..62cd512f5c8 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -640,6 +640,14 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc
640 enum drm_connector_status found = connector_status_disconnected; 640 enum drm_connector_status found = connector_status_disconnected;
641 bool color = true; 641 bool color = true;
642 642
643 /* just don't bother on RN50 those chip are often connected to remoting
644 * console hw and often we get failure to load detect those. So to make
645 * everyone happy report the encoder as always connected.
646 */
647 if (ASIC_IS_RN50(rdev)) {
648 return connector_status_connected;
649 }
650
643 /* save the regs we need */ 651 /* save the regs we need */
644 vclk_ecp_cntl = RREG32_PLL(RADEON_VCLK_ECP_CNTL); 652 vclk_ecp_cntl = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
645 crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); 653 crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index d818b503b42..4003f5a68c0 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -209,7 +209,8 @@ enum radeon_connector_table {
209 CT_RN50_POWER, 209 CT_RN50_POWER,
210 CT_MAC_X800, 210 CT_MAC_X800,
211 CT_MAC_G5_9600, 211 CT_MAC_G5_9600,
212 CT_SAM440EP 212 CT_SAM440EP,
213 CT_MAC_G4_SILVER
213}; 214};
214 215
215enum radeon_dvo_chip { 216enum radeon_dvo_chip {
@@ -558,7 +559,7 @@ extern void radeon_i2c_put_byte(struct radeon_i2c_chan *i2c,
558 u8 val); 559 u8 val);
559extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector); 560extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector);
560extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector); 561extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector);
561extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector); 562extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool use_aux);
562extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector); 563extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector);
563 564
564extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector); 565extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector);
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c
index e09521858f6..26c23bb651c 100644
--- a/drivers/gpu/drm/radeon/radeon_prime.c
+++ b/drivers/gpu/drm/radeon/radeon_prime.c
@@ -194,6 +194,7 @@ struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev,
194 bo = dma_buf->priv; 194 bo = dma_buf->priv;
195 if (bo->gem_base.dev == dev) { 195 if (bo->gem_base.dev == dev) {
196 drm_gem_object_reference(&bo->gem_base); 196 drm_gem_object_reference(&bo->gem_base);
197 dma_buf_put(dma_buf);
197 return &bo->gem_base; 198 return &bo->gem_base;
198 } 199 }
199 } 200 }
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index ebd69562ef6..141f2b6a9cf 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -770,22 +770,28 @@ static int radeon_debugfs_ring_info(struct seq_file *m, void *data)
770 int ridx = *(int*)node->info_ent->data; 770 int ridx = *(int*)node->info_ent->data;
771 struct radeon_ring *ring = &rdev->ring[ridx]; 771 struct radeon_ring *ring = &rdev->ring[ridx];
772 unsigned count, i, j; 772 unsigned count, i, j;
773 u32 tmp;
773 774
774 radeon_ring_free_size(rdev, ring); 775 radeon_ring_free_size(rdev, ring);
775 count = (ring->ring_size / 4) - ring->ring_free_dw; 776 count = (ring->ring_size / 4) - ring->ring_free_dw;
776 seq_printf(m, "wptr(0x%04x): 0x%08x\n", ring->wptr_reg, RREG32(ring->wptr_reg)); 777 tmp = RREG32(ring->wptr_reg) >> ring->ptr_reg_shift;
777 seq_printf(m, "rptr(0x%04x): 0x%08x\n", ring->rptr_reg, RREG32(ring->rptr_reg)); 778 seq_printf(m, "wptr(0x%04x): 0x%08x [%5d]\n", ring->wptr_reg, tmp, tmp);
779 tmp = RREG32(ring->rptr_reg) >> ring->ptr_reg_shift;
780 seq_printf(m, "rptr(0x%04x): 0x%08x [%5d]\n", ring->rptr_reg, tmp, tmp);
778 if (ring->rptr_save_reg) { 781 if (ring->rptr_save_reg) {
779 seq_printf(m, "rptr next(0x%04x): 0x%08x\n", ring->rptr_save_reg, 782 seq_printf(m, "rptr next(0x%04x): 0x%08x\n", ring->rptr_save_reg,
780 RREG32(ring->rptr_save_reg)); 783 RREG32(ring->rptr_save_reg));
781 } 784 }
782 seq_printf(m, "driver's copy of the wptr: 0x%08x\n", ring->wptr); 785 seq_printf(m, "driver's copy of the wptr: 0x%08x [%5d]\n", ring->wptr, ring->wptr);
783 seq_printf(m, "driver's copy of the rptr: 0x%08x\n", ring->rptr); 786 seq_printf(m, "driver's copy of the rptr: 0x%08x [%5d]\n", ring->rptr, ring->rptr);
784 seq_printf(m, "%u free dwords in ring\n", ring->ring_free_dw); 787 seq_printf(m, "%u free dwords in ring\n", ring->ring_free_dw);
785 seq_printf(m, "%u dwords in ring\n", count); 788 seq_printf(m, "%u dwords in ring\n", count);
786 i = ring->rptr; 789 /* print 8 dw before current rptr as often it's the last executed
787 for (j = 0; j <= count; j++) { 790 * packet that is the root issue
788 seq_printf(m, "r[%04d]=0x%08x\n", i, ring->ring[i]); 791 */
792 i = (ring->rptr + ring->ptr_mask + 1 - 32) & ring->ptr_mask;
793 for (j = 0; j <= (count + 32); j++) {
794 seq_printf(m, "r[%5d]=0x%08x\n", i, ring->ring[i]);
789 i = (i + 1) & ring->ptr_mask; 795 i = (i + 1) & ring->ptr_mask;
790 } 796 }
791 return 0; 797 return 0;
@@ -794,11 +800,15 @@ static int radeon_debugfs_ring_info(struct seq_file *m, void *data)
794static int radeon_ring_type_gfx_index = RADEON_RING_TYPE_GFX_INDEX; 800static int radeon_ring_type_gfx_index = RADEON_RING_TYPE_GFX_INDEX;
795static int cayman_ring_type_cp1_index = CAYMAN_RING_TYPE_CP1_INDEX; 801static int cayman_ring_type_cp1_index = CAYMAN_RING_TYPE_CP1_INDEX;
796static int cayman_ring_type_cp2_index = CAYMAN_RING_TYPE_CP2_INDEX; 802static int cayman_ring_type_cp2_index = CAYMAN_RING_TYPE_CP2_INDEX;
803static int radeon_ring_type_dma1_index = R600_RING_TYPE_DMA_INDEX;
804static int radeon_ring_type_dma2_index = CAYMAN_RING_TYPE_DMA1_INDEX;
797 805
798static struct drm_info_list radeon_debugfs_ring_info_list[] = { 806static struct drm_info_list radeon_debugfs_ring_info_list[] = {
799 {"radeon_ring_gfx", radeon_debugfs_ring_info, 0, &radeon_ring_type_gfx_index}, 807 {"radeon_ring_gfx", radeon_debugfs_ring_info, 0, &radeon_ring_type_gfx_index},
800 {"radeon_ring_cp1", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp1_index}, 808 {"radeon_ring_cp1", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp1_index},
801 {"radeon_ring_cp2", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp2_index}, 809 {"radeon_ring_cp2", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp2_index},
810 {"radeon_ring_dma1", radeon_debugfs_ring_info, 0, &radeon_ring_type_dma1_index},
811 {"radeon_ring_dma2", radeon_debugfs_ring_info, 0, &radeon_ring_type_dma2_index},
802}; 812};
803 813
804static int radeon_debugfs_sa_info(struct seq_file *m, void *data) 814static int radeon_debugfs_sa_info(struct seq_file *m, void *data)
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 87c979c4f72..1b2444f4d8f 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -887,6 +887,80 @@ static int rv770_mc_init(struct radeon_device *rdev)
887 return 0; 887 return 0;
888} 888}
889 889
890/**
891 * rv770_copy_dma - copy pages using the DMA engine
892 *
893 * @rdev: radeon_device pointer
894 * @src_offset: src GPU address
895 * @dst_offset: dst GPU address
896 * @num_gpu_pages: number of GPU pages to xfer
897 * @fence: radeon fence object
898 *
899 * Copy GPU paging using the DMA engine (r7xx).
900 * Used by the radeon ttm implementation to move pages if
901 * registered as the asic copy callback.
902 */
903int rv770_copy_dma(struct radeon_device *rdev,
904 uint64_t src_offset, uint64_t dst_offset,
905 unsigned num_gpu_pages,
906 struct radeon_fence **fence)
907{
908 struct radeon_semaphore *sem = NULL;
909 int ring_index = rdev->asic->copy.dma_ring_index;
910 struct radeon_ring *ring = &rdev->ring[ring_index];
911 u32 size_in_dw, cur_size_in_dw;
912 int i, num_loops;
913 int r = 0;
914
915 r = radeon_semaphore_create(rdev, &sem);
916 if (r) {
917 DRM_ERROR("radeon: moving bo (%d).\n", r);
918 return r;
919 }
920
921 size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
922 num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFF);
923 r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8);
924 if (r) {
925 DRM_ERROR("radeon: moving bo (%d).\n", r);
926 radeon_semaphore_free(rdev, &sem, NULL);
927 return r;
928 }
929
930 if (radeon_fence_need_sync(*fence, ring->idx)) {
931 radeon_semaphore_sync_rings(rdev, sem, (*fence)->ring,
932 ring->idx);
933 radeon_fence_note_sync(*fence, ring->idx);
934 } else {
935 radeon_semaphore_free(rdev, &sem, NULL);
936 }
937
938 for (i = 0; i < num_loops; i++) {
939 cur_size_in_dw = size_in_dw;
940 if (cur_size_in_dw > 0xFFFF)
941 cur_size_in_dw = 0xFFFF;
942 size_in_dw -= cur_size_in_dw;
943 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
944 radeon_ring_write(ring, dst_offset & 0xfffffffc);
945 radeon_ring_write(ring, src_offset & 0xfffffffc);
946 radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
947 radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff);
948 src_offset += cur_size_in_dw * 4;
949 dst_offset += cur_size_in_dw * 4;
950 }
951
952 r = radeon_fence_emit(rdev, fence, ring->idx);
953 if (r) {
954 radeon_ring_unlock_undo(rdev, ring);
955 return r;
956 }
957
958 radeon_ring_unlock_commit(rdev, ring);
959 radeon_semaphore_free(rdev, &sem, *fence);
960
961 return r;
962}
963
890static int rv770_startup(struct radeon_device *rdev) 964static int rv770_startup(struct radeon_device *rdev)
891{ 965{
892 struct radeon_ring *ring; 966 struct radeon_ring *ring;
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index ef683653f0b..3240a3d64f3 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2126,15 +2126,13 @@ bool si_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
2126 return radeon_ring_test_lockup(rdev, ring); 2126 return radeon_ring_test_lockup(rdev, ring);
2127} 2127}
2128 2128
2129static int si_gpu_soft_reset(struct radeon_device *rdev) 2129static void si_gpu_soft_reset_gfx(struct radeon_device *rdev)
2130{ 2130{
2131 struct evergreen_mc_save save;
2132 u32 grbm_reset = 0; 2131 u32 grbm_reset = 0;
2133 2132
2134 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) 2133 if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE))
2135 return 0; 2134 return;
2136 2135
2137 dev_info(rdev->dev, "GPU softreset \n");
2138 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", 2136 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
2139 RREG32(GRBM_STATUS)); 2137 RREG32(GRBM_STATUS));
2140 dev_info(rdev->dev, " GRBM_STATUS2=0x%08X\n", 2138 dev_info(rdev->dev, " GRBM_STATUS2=0x%08X\n",
@@ -2145,10 +2143,7 @@ static int si_gpu_soft_reset(struct radeon_device *rdev)
2145 RREG32(GRBM_STATUS_SE1)); 2143 RREG32(GRBM_STATUS_SE1));
2146 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 2144 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n",
2147 RREG32(SRBM_STATUS)); 2145 RREG32(SRBM_STATUS));
2148 evergreen_mc_stop(rdev, &save); 2146
2149 if (radeon_mc_wait_for_idle(rdev)) {
2150 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
2151 }
2152 /* Disable CP parsing/prefetching */ 2147 /* Disable CP parsing/prefetching */
2153 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT); 2148 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT);
2154 2149
@@ -2173,8 +2168,7 @@ static int si_gpu_soft_reset(struct radeon_device *rdev)
2173 udelay(50); 2168 udelay(50);
2174 WREG32(GRBM_SOFT_RESET, 0); 2169 WREG32(GRBM_SOFT_RESET, 0);
2175 (void)RREG32(GRBM_SOFT_RESET); 2170 (void)RREG32(GRBM_SOFT_RESET);
2176 /* Wait a little for things to settle down */ 2171
2177 udelay(50);
2178 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", 2172 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
2179 RREG32(GRBM_STATUS)); 2173 RREG32(GRBM_STATUS));
2180 dev_info(rdev->dev, " GRBM_STATUS2=0x%08X\n", 2174 dev_info(rdev->dev, " GRBM_STATUS2=0x%08X\n",
@@ -2185,13 +2179,75 @@ static int si_gpu_soft_reset(struct radeon_device *rdev)
2185 RREG32(GRBM_STATUS_SE1)); 2179 RREG32(GRBM_STATUS_SE1));
2186 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", 2180 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n",
2187 RREG32(SRBM_STATUS)); 2181 RREG32(SRBM_STATUS));
2182}
2183
2184static void si_gpu_soft_reset_dma(struct radeon_device *rdev)
2185{
2186 u32 tmp;
2187
2188 if (RREG32(DMA_STATUS_REG) & DMA_IDLE)
2189 return;
2190
2191 dev_info(rdev->dev, " DMA_STATUS_REG = 0x%08X\n",
2192 RREG32(DMA_STATUS_REG));
2193
2194 /* dma0 */
2195 tmp = RREG32(DMA_RB_CNTL + DMA0_REGISTER_OFFSET);
2196 tmp &= ~DMA_RB_ENABLE;
2197 WREG32(DMA_RB_CNTL + DMA0_REGISTER_OFFSET, tmp);
2198
2199 /* dma1 */
2200 tmp = RREG32(DMA_RB_CNTL + DMA1_REGISTER_OFFSET);
2201 tmp &= ~DMA_RB_ENABLE;
2202 WREG32(DMA_RB_CNTL + DMA1_REGISTER_OFFSET, tmp);
2203
2204 /* Reset dma */
2205 WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1);
2206 RREG32(SRBM_SOFT_RESET);
2207 udelay(50);
2208 WREG32(SRBM_SOFT_RESET, 0);
2209
2210 dev_info(rdev->dev, " DMA_STATUS_REG = 0x%08X\n",
2211 RREG32(DMA_STATUS_REG));
2212}
2213
2214static int si_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
2215{
2216 struct evergreen_mc_save save;
2217
2218 if (reset_mask == 0)
2219 return 0;
2220
2221 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
2222
2223 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
2224 RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR));
2225 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
2226 RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS));
2227
2228 evergreen_mc_stop(rdev, &save);
2229 if (radeon_mc_wait_for_idle(rdev)) {
2230 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
2231 }
2232
2233 if (reset_mask & (RADEON_RESET_GFX | RADEON_RESET_COMPUTE))
2234 si_gpu_soft_reset_gfx(rdev);
2235
2236 if (reset_mask & RADEON_RESET_DMA)
2237 si_gpu_soft_reset_dma(rdev);
2238
2239 /* Wait a little for things to settle down */
2240 udelay(50);
2241
2188 evergreen_mc_resume(rdev, &save); 2242 evergreen_mc_resume(rdev, &save);
2189 return 0; 2243 return 0;
2190} 2244}
2191 2245
2192int si_asic_reset(struct radeon_device *rdev) 2246int si_asic_reset(struct radeon_device *rdev)
2193{ 2247{
2194 return si_gpu_soft_reset(rdev); 2248 return si_gpu_soft_reset(rdev, (RADEON_RESET_GFX |
2249 RADEON_RESET_COMPUTE |
2250 RADEON_RESET_DMA));
2195} 2251}
2196 2252
2197/* MC */ 2253/* MC */
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
index 62b46215d42..c056aae814f 100644
--- a/drivers/gpu/drm/radeon/sid.h
+++ b/drivers/gpu/drm/radeon/sid.h
@@ -62,6 +62,22 @@
62 62
63#define SRBM_STATUS 0xE50 63#define SRBM_STATUS 0xE50
64 64
65#define SRBM_SOFT_RESET 0x0E60
66#define SOFT_RESET_BIF (1 << 1)
67#define SOFT_RESET_DC (1 << 5)
68#define SOFT_RESET_DMA1 (1 << 6)
69#define SOFT_RESET_GRBM (1 << 8)
70#define SOFT_RESET_HDP (1 << 9)
71#define SOFT_RESET_IH (1 << 10)
72#define SOFT_RESET_MC (1 << 11)
73#define SOFT_RESET_ROM (1 << 14)
74#define SOFT_RESET_SEM (1 << 15)
75#define SOFT_RESET_VMC (1 << 17)
76#define SOFT_RESET_DMA (1 << 20)
77#define SOFT_RESET_TST (1 << 21)
78#define SOFT_RESET_REGBB (1 << 22)
79#define SOFT_RESET_ORB (1 << 23)
80
65#define CC_SYS_RB_BACKEND_DISABLE 0xe80 81#define CC_SYS_RB_BACKEND_DISABLE 0xe80
66#define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84 82#define GC_USER_SYS_RB_BACKEND_DISABLE 0xe84
67 83
@@ -1013,6 +1029,8 @@
1013# define DATA_SWAP_ENABLE (1 << 3) 1029# define DATA_SWAP_ENABLE (1 << 3)
1014# define FENCE_SWAP_ENABLE (1 << 4) 1030# define FENCE_SWAP_ENABLE (1 << 4)
1015# define CTXEMPTY_INT_ENABLE (1 << 28) 1031# define CTXEMPTY_INT_ENABLE (1 << 28)
1032#define DMA_STATUS_REG 0xd034
1033# define DMA_IDLE (1 << 0)
1016#define DMA_TILING_CONFIG 0xd0b8 1034#define DMA_TILING_CONFIG 0xd0b8
1017 1035
1018#define DMA_PACKET(cmd, b, t, s, n) ((((cmd) & 0xF) << 28) | \ 1036#define DMA_PACKET(cmd, b, t, s, n) ((((cmd) & 0xF) << 28) | \
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 1c350fc4e44..d1d5306ebf2 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -33,7 +33,7 @@
33 * Hardware initialization 33 * Hardware initialization
34 */ 34 */
35 35
36static int __devinit shmob_drm_init_interface(struct shmob_drm_device *sdev) 36static int shmob_drm_init_interface(struct shmob_drm_device *sdev)
37{ 37{
38 static const u32 ldmt1r[] = { 38 static const u32 ldmt1r[] = {
39 [SHMOB_DRM_IFACE_RGB8] = LDMT1R_MIFTYP_RGB8, 39 [SHMOB_DRM_IFACE_RGB8] = LDMT1R_MIFTYP_RGB8,
@@ -67,7 +67,7 @@ static int __devinit shmob_drm_init_interface(struct shmob_drm_device *sdev)
67 return 0; 67 return 0;
68} 68}
69 69
70static int __devinit shmob_drm_setup_clocks(struct shmob_drm_device *sdev, 70static int shmob_drm_setup_clocks(struct shmob_drm_device *sdev,
71 enum shmob_drm_clk_source clksrc) 71 enum shmob_drm_clk_source clksrc)
72{ 72{
73 struct clk *clk; 73 struct clk *clk;
@@ -330,12 +330,12 @@ static const struct dev_pm_ops shmob_drm_pm_ops = {
330 * Platform driver 330 * Platform driver
331 */ 331 */
332 332
333static int __devinit shmob_drm_probe(struct platform_device *pdev) 333static int shmob_drm_probe(struct platform_device *pdev)
334{ 334{
335 return drm_platform_init(&shmob_drm_driver, pdev); 335 return drm_platform_init(&shmob_drm_driver, pdev);
336} 336}
337 337
338static int __devexit shmob_drm_remove(struct platform_device *pdev) 338static int shmob_drm_remove(struct platform_device *pdev)
339{ 339{
340 drm_platform_exit(&shmob_drm_driver, pdev); 340 drm_platform_exit(&shmob_drm_driver, pdev);
341 341
@@ -344,7 +344,7 @@ static int __devexit shmob_drm_remove(struct platform_device *pdev)
344 344
345static struct platform_driver shmob_drm_platform_driver = { 345static struct platform_driver shmob_drm_platform_driver = {
346 .probe = shmob_drm_probe, 346 .probe = shmob_drm_probe,
347 .remove = __devexit_p(shmob_drm_remove), 347 .remove = shmob_drm_remove,
348 .driver = { 348 .driver = {
349 .owner = THIS_MODULE, 349 .owner = THIS_MODULE,
350 .name = "shmob-drm", 350 .name = "shmob-drm",
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 9e9c5d2a5c7..d73d6e3e17b 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
654 */ 654 */
655 655
656 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); 656 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
657
658 /* ttm_buffer_object_transfer accesses bo->sync_obj */
659 ret = ttm_buffer_object_transfer(bo, &ghost_obj);
657 spin_unlock(&bdev->fence_lock); 660 spin_unlock(&bdev->fence_lock);
658 if (tmp_obj) 661 if (tmp_obj)
659 driver->sync_obj_unref(&tmp_obj); 662 driver->sync_obj_unref(&tmp_obj);
660 663
661 ret = ttm_buffer_object_transfer(bo, &ghost_obj);
662 if (ret) 664 if (ret)
663 return ret; 665 return ret;
664 666
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
index 512f44add89..fe5cdbcf263 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -22,13 +22,17 @@
22static u8 *udl_get_edid(struct udl_device *udl) 22static u8 *udl_get_edid(struct udl_device *udl)
23{ 23{
24 u8 *block; 24 u8 *block;
25 char rbuf[3]; 25 char *rbuf;
26 int ret, i; 26 int ret, i;
27 27
28 block = kmalloc(EDID_LENGTH, GFP_KERNEL); 28 block = kmalloc(EDID_LENGTH, GFP_KERNEL);
29 if (block == NULL) 29 if (block == NULL)
30 return NULL; 30 return NULL;
31 31
32 rbuf = kmalloc(2, GFP_KERNEL);
33 if (rbuf == NULL)
34 goto error;
35
32 for (i = 0; i < EDID_LENGTH; i++) { 36 for (i = 0; i < EDID_LENGTH; i++) {
33 ret = usb_control_msg(udl->ddev->usbdev, 37 ret = usb_control_msg(udl->ddev->usbdev,
34 usb_rcvctrlpipe(udl->ddev->usbdev, 0), (0x02), 38 usb_rcvctrlpipe(udl->ddev->usbdev, 0), (0x02),
@@ -36,16 +40,17 @@ static u8 *udl_get_edid(struct udl_device *udl)
36 HZ); 40 HZ);
37 if (ret < 1) { 41 if (ret < 1) {
38 DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret); 42 DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);
39 i--;
40 goto error; 43 goto error;
41 } 44 }
42 block[i] = rbuf[1]; 45 block[i] = rbuf[1];
43 } 46 }
44 47
48 kfree(rbuf);
45 return block; 49 return block;
46 50
47error: 51error:
48 kfree(block); 52 kfree(block);
53 kfree(rbuf);
49 return NULL; 54 return NULL;
50} 55}
51 56
@@ -57,6 +62,14 @@ static int udl_get_modes(struct drm_connector *connector)
57 62
58 edid = (struct edid *)udl_get_edid(udl); 63 edid = (struct edid *)udl_get_edid(udl);
59 64
65 /*
66 * We only read the main block, but if the monitor reports extension
67 * blocks then the drm edid code expects them to be present, so patch
68 * the extension count to 0.
69 */
70 edid->checksum += edid->extensions;
71 edid->extensions = 0;
72
60 drm_mode_connector_update_edid_property(connector, edid); 73 drm_mode_connector_update_edid_property(connector, edid);
61 ret = drm_add_edid_modes(connector, edid); 74 ret = drm_add_edid_modes(connector, edid);
62 kfree(edid); 75 kfree(edid);
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 9ef222442ca..12e4fdc810b 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -731,7 +731,7 @@ static struct hid_ll_driver i2c_hid_ll_driver = {
731 .hidinput_input_event = i2c_hid_hidinput_input_event, 731 .hidinput_input_event = i2c_hid_hidinput_input_event,
732}; 732};
733 733
734static int __devinit i2c_hid_init_irq(struct i2c_client *client) 734static int i2c_hid_init_irq(struct i2c_client *client)
735{ 735{
736 struct i2c_hid *ihid = i2c_get_clientdata(client); 736 struct i2c_hid *ihid = i2c_get_clientdata(client);
737 int ret; 737 int ret;
@@ -753,7 +753,7 @@ static int __devinit i2c_hid_init_irq(struct i2c_client *client)
753 return 0; 753 return 0;
754} 754}
755 755
756static int __devinit i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid) 756static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
757{ 757{
758 struct i2c_client *client = ihid->client; 758 struct i2c_client *client = ihid->client;
759 struct i2c_hid_desc *hdesc = &ihid->hdesc; 759 struct i2c_hid_desc *hdesc = &ihid->hdesc;
@@ -810,8 +810,8 @@ static int __devinit i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
810 return 0; 810 return 0;
811} 811}
812 812
813static int __devinit i2c_hid_probe(struct i2c_client *client, 813static int i2c_hid_probe(struct i2c_client *client,
814 const struct i2c_device_id *dev_id) 814 const struct i2c_device_id *dev_id)
815{ 815{
816 int ret; 816 int ret;
817 struct i2c_hid *ihid; 817 struct i2c_hid *ihid;
@@ -902,7 +902,7 @@ err:
902 return ret; 902 return ret;
903} 903}
904 904
905static int __devexit i2c_hid_remove(struct i2c_client *client) 905static int i2c_hid_remove(struct i2c_client *client)
906{ 906{
907 struct i2c_hid *ihid = i2c_get_clientdata(client); 907 struct i2c_hid *ihid = i2c_get_clientdata(client);
908 struct hid_device *hid; 908 struct hid_device *hid;
@@ -967,7 +967,7 @@ static struct i2c_driver i2c_hid_driver = {
967 }, 967 },
968 968
969 .probe = i2c_hid_probe, 969 .probe = i2c_hid_probe,
970 .remove = __devexit_p(i2c_hid_remove), 970 .remove = i2c_hid_remove,
971 971
972 .id_table = i2c_hid_id_table, 972 .id_table = i2c_hid_id_table,
973}; 973};
diff --git a/drivers/hsi/clients/hsi_char.c b/drivers/hsi/clients/hsi_char.c
index 3ad91f6447d..e61e5f991aa 100644
--- a/drivers/hsi/clients/hsi_char.c
+++ b/drivers/hsi/clients/hsi_char.c
@@ -675,7 +675,7 @@ static const struct file_operations hsc_fops = {
675 .release = hsc_release, 675 .release = hsc_release,
676}; 676};
677 677
678static void __devinit hsc_channel_init(struct hsc_channel *channel) 678static void hsc_channel_init(struct hsc_channel *channel)
679{ 679{
680 init_waitqueue_head(&channel->rx_wait); 680 init_waitqueue_head(&channel->rx_wait);
681 init_waitqueue_head(&channel->tx_wait); 681 init_waitqueue_head(&channel->tx_wait);
@@ -685,7 +685,7 @@ static void __devinit hsc_channel_init(struct hsc_channel *channel)
685 INIT_LIST_HEAD(&channel->tx_msgs_queue); 685 INIT_LIST_HEAD(&channel->tx_msgs_queue);
686} 686}
687 687
688static int __devinit hsc_probe(struct device *dev) 688static int hsc_probe(struct device *dev)
689{ 689{
690 const char devname[] = "hsi_char"; 690 const char devname[] = "hsi_char";
691 struct hsc_client_data *cl_data; 691 struct hsc_client_data *cl_data;
@@ -744,7 +744,7 @@ out1:
744 return ret; 744 return ret;
745} 745}
746 746
747static int __devexit hsc_remove(struct device *dev) 747static int hsc_remove(struct device *dev)
748{ 748{
749 struct hsi_client *cl = to_hsi_client(dev); 749 struct hsi_client *cl = to_hsi_client(dev);
750 struct hsc_client_data *cl_data = hsi_client_drvdata(cl); 750 struct hsc_client_data *cl_data = hsi_client_drvdata(cl);
@@ -763,7 +763,7 @@ static struct hsi_client_driver hsc_driver = {
763 .name = "hsi_char", 763 .name = "hsi_char",
764 .owner = THIS_MODULE, 764 .owner = THIS_MODULE,
765 .probe = hsc_probe, 765 .probe = hsc_probe,
766 .remove = __devexit_p(hsc_remove), 766 .remove = hsc_remove,
767 }, 767 },
768}; 768};
769 769
diff --git a/drivers/hwmon/vexpress.c b/drivers/hwmon/vexpress.c
index 59fd1268e58..d867e6bb2be 100644
--- a/drivers/hwmon/vexpress.c
+++ b/drivers/hwmon/vexpress.c
@@ -19,6 +19,7 @@
19#include <linux/hwmon.h> 19#include <linux/hwmon.h>
20#include <linux/hwmon-sysfs.h> 20#include <linux/hwmon-sysfs.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/of.h>
22#include <linux/of_device.h> 23#include <linux/of_device.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/vexpress.h> 25#include <linux/vexpress.h>
@@ -196,7 +197,7 @@ error:
196 return err; 197 return err;
197} 198}
198 199
199static int __devexit vexpress_hwmon_remove(struct platform_device *pdev) 200static int vexpress_hwmon_remove(struct platform_device *pdev)
200{ 201{
201 struct vexpress_hwmon_data *data = platform_get_drvdata(pdev); 202 struct vexpress_hwmon_data *data = platform_get_drvdata(pdev);
202 const struct of_device_id *match; 203 const struct of_device_id *match;
@@ -213,7 +214,7 @@ static int __devexit vexpress_hwmon_remove(struct platform_device *pdev)
213 214
214static struct platform_driver vexpress_hwmon_driver = { 215static struct platform_driver vexpress_hwmon_driver = {
215 .probe = vexpress_hwmon_probe, 216 .probe = vexpress_hwmon_probe,
216 .remove = __devexit_p(vexpress_hwmon_remove), 217 .remove = vexpress_hwmon_remove,
217 .driver = { 218 .driver = {
218 .name = DRVNAME, 219 .name = DRVNAME,
219 .owner = THIS_MODULE, 220 .owner = THIS_MODULE,
diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c
index 01451940393..c7eaf20af92 100644
--- a/drivers/ide/aec62xx.c
+++ b/drivers/ide/aec62xx.c
@@ -181,7 +181,7 @@ static const struct ide_port_ops atp86x_port_ops = {
181 .cable_detect = atp86x_cable_detect, 181 .cable_detect = atp86x_cable_detect,
182}; 182};
183 183
184static const struct ide_port_info aec62xx_chipsets[] __devinitconst = { 184static const struct ide_port_info aec62xx_chipsets[] = {
185 { /* 0: AEC6210 */ 185 { /* 0: AEC6210 */
186 .name = DRV_NAME, 186 .name = DRV_NAME,
187 .init_chipset = init_chipset_aec62xx, 187 .init_chipset = init_chipset_aec62xx,
@@ -251,7 +251,7 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitconst = {
251 * chips, pass a local copy of 'struct ide_port_info' down the call chain. 251 * chips, pass a local copy of 'struct ide_port_info' down the call chain.
252 */ 252 */
253 253
254static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 254static int aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
255{ 255{
256 const struct chipset_bus_clock_list_entry *bus_clock; 256 const struct chipset_bus_clock_list_entry *bus_clock;
257 struct ide_port_info d; 257 struct ide_port_info d;
@@ -287,7 +287,7 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
287 return err; 287 return err;
288} 288}
289 289
290static void __devexit aec62xx_remove(struct pci_dev *dev) 290static void aec62xx_remove(struct pci_dev *dev)
291{ 291{
292 ide_pci_remove(dev); 292 ide_pci_remove(dev);
293 pci_disable_device(dev); 293 pci_disable_device(dev);
@@ -307,7 +307,7 @@ static struct pci_driver aec62xx_pci_driver = {
307 .name = "AEC62xx_IDE", 307 .name = "AEC62xx_IDE",
308 .id_table = aec62xx_pci_tbl, 308 .id_table = aec62xx_pci_tbl,
309 .probe = aec62xx_init_one, 309 .probe = aec62xx_init_one,
310 .remove = __devexit_p(aec62xx_remove), 310 .remove = aec62xx_remove,
311 .suspend = ide_pci_suspend, 311 .suspend = ide_pci_suspend,
312 .resume = ide_pci_resume, 312 .resume = ide_pci_resume,
313}; 313};
diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c
index 911a27ca356..36f76e28a0b 100644
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -415,7 +415,7 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
415 * Sparc systems. 415 * Sparc systems.
416 */ 416 */
417 417
418static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif) 418static void init_hwif_ali15x3(ide_hwif_t *hwif)
419{ 419{
420 u8 ideic, inmir; 420 u8 ideic, inmir;
421 s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, 421 s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6,
@@ -464,8 +464,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
464 * Set up the DMA functionality on the ALi 15x3. 464 * Set up the DMA functionality on the ALi 15x3.
465 */ 465 */
466 466
467static int __devinit init_dma_ali15x3(ide_hwif_t *hwif, 467static int init_dma_ali15x3(ide_hwif_t *hwif, const struct ide_port_info *d)
468 const struct ide_port_info *d)
469{ 468{
470 struct pci_dev *dev = to_pci_dev(hwif->dev); 469 struct pci_dev *dev = to_pci_dev(hwif->dev);
471 unsigned long base = ide_pci_dma_base(hwif, d); 470 unsigned long base = ide_pci_dma_base(hwif, d);
@@ -512,7 +511,7 @@ static const struct ide_dma_ops ali_dma_ops = {
512 .dma_sff_read_status = ide_dma_sff_read_status, 511 .dma_sff_read_status = ide_dma_sff_read_status,
513}; 512};
514 513
515static const struct ide_port_info ali15x3_chipset __devinitconst = { 514static const struct ide_port_info ali15x3_chipset = {
516 .name = DRV_NAME, 515 .name = DRV_NAME,
517 .init_chipset = init_chipset_ali15x3, 516 .init_chipset = init_chipset_ali15x3,
518 .init_hwif = init_hwif_ali15x3, 517 .init_hwif = init_hwif_ali15x3,
@@ -532,7 +531,8 @@ static const struct ide_port_info ali15x3_chipset __devinitconst = {
532 * hot plug layer. 531 * hot plug layer.
533 */ 532 */
534 533
535static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id) 534static int alim15x3_init_one(struct pci_dev *dev,
535 const struct pci_device_id *id)
536{ 536{
537 struct ide_port_info d = ali15x3_chipset; 537 struct ide_port_info d = ali15x3_chipset;
538 u8 rev = dev->revision, idx = id->driver_data; 538 u8 rev = dev->revision, idx = id->driver_data;
diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c
index 56fc99557ba..cbfe846911d 100644
--- a/drivers/ide/amd74xx.c
+++ b/drivers/ide/amd74xx.c
@@ -223,7 +223,7 @@ static const struct ide_port_ops amd_port_ops = {
223 .udma_mask = udma, \ 223 .udma_mask = udma, \
224 } 224 }
225 225
226static const struct ide_port_info amd74xx_chipsets[] __devinitconst = { 226static const struct ide_port_info amd74xx_chipsets[] = {
227 /* 0: AMD7401 */ DECLARE_AMD_DEV(0x00, ATA_UDMA2), 227 /* 0: AMD7401 */ DECLARE_AMD_DEV(0x00, ATA_UDMA2),
228 /* 1: AMD7409 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4), 228 /* 1: AMD7409 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4),
229 /* 2: AMD7411/7441 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5), 229 /* 2: AMD7411/7441 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5),
@@ -235,7 +235,7 @@ static const struct ide_port_info amd74xx_chipsets[] __devinitconst = {
235 /* 6: AMD5536 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5), 235 /* 6: AMD5536 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5),
236}; 236};
237 237
238static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) 238static int amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
239{ 239{
240 struct ide_port_info d; 240 struct ide_port_info d;
241 u8 idx = id->driver_data; 241 u8 idx = id->driver_data;
diff --git a/drivers/ide/atiixp.c b/drivers/ide/atiixp.c
index cb43480b1bd..dbd0f242ec1 100644
--- a/drivers/ide/atiixp.c
+++ b/drivers/ide/atiixp.c
@@ -139,7 +139,7 @@ static const struct ide_port_ops atiixp_port_ops = {
139 .cable_detect = atiixp_cable_detect, 139 .cable_detect = atiixp_cable_detect,
140}; 140};
141 141
142static const struct ide_port_info atiixp_pci_info[] __devinitconst = { 142static const struct ide_port_info atiixp_pci_info[] = {
143 { /* 0: IXP200/300/400/700 */ 143 { /* 0: IXP200/300/400/700 */
144 .name = DRV_NAME, 144 .name = DRV_NAME,
145 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, 145 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
@@ -168,7 +168,7 @@ static const struct ide_port_info atiixp_pci_info[] __devinitconst = {
168 * finds a device matching our IDE device tables. 168 * finds a device matching our IDE device tables.
169 */ 169 */
170 170
171static int __devinit atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id) 171static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
172{ 172{
173 return ide_pci_init_one(dev, &atiixp_pci_info[id->driver_data], NULL); 173 return ide_pci_init_one(dev, &atiixp_pci_info[id->driver_data], NULL);
174} 174}
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c
index d1fc43802f5..b127ed60c73 100644
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -327,7 +327,7 @@ static const struct ide_dma_ops cmd646_rev1_dma_ops = {
327 .dma_sff_read_status = ide_dma_sff_read_status, 327 .dma_sff_read_status = ide_dma_sff_read_status,
328}; 328};
329 329
330static const struct ide_port_info cmd64x_chipsets[] __devinitconst = { 330static const struct ide_port_info cmd64x_chipsets[] = {
331 { /* 0: CMD643 */ 331 { /* 0: CMD643 */
332 .name = DRV_NAME, 332 .name = DRV_NAME,
333 .init_chipset = init_chipset_cmd64x, 333 .init_chipset = init_chipset_cmd64x,
@@ -373,7 +373,7 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitconst = {
373 } 373 }
374}; 374};
375 375
376static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 376static int cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
377{ 377{
378 struct ide_port_info d; 378 struct ide_port_info d;
379 u8 idx = id->driver_data; 379 u8 idx = id->driver_data;
diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c
index 14447621e60..6250aee3050 100644
--- a/drivers/ide/cs5520.c
+++ b/drivers/ide/cs5520.c
@@ -94,7 +94,7 @@ static const struct ide_port_ops cs5520_port_ops = {
94 .set_dma_mode = cs5520_set_dma_mode, 94 .set_dma_mode = cs5520_set_dma_mode,
95}; 95};
96 96
97static const struct ide_port_info cyrix_chipset __devinitconst = { 97static const struct ide_port_info cyrix_chipset = {
98 .name = DRV_NAME, 98 .name = DRV_NAME,
99 .enablebits = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } }, 99 .enablebits = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } },
100 .port_ops = &cs5520_port_ops, 100 .port_ops = &cs5520_port_ops,
@@ -108,7 +108,7 @@ static const struct ide_port_info cyrix_chipset __devinitconst = {
108 * work longhand. 108 * work longhand.
109 */ 109 */
110 110
111static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) 111static int cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
112{ 112{
113 const struct ide_port_info *d = &cyrix_chipset; 113 const struct ide_port_info *d = &cyrix_chipset;
114 struct ide_hw hw[2], *hws[] = { NULL, NULL }; 114 struct ide_hw hw[2], *hws[] = { NULL, NULL };
diff --git a/drivers/ide/cs5530.c b/drivers/ide/cs5530.c
index 49b40ad59d1..65371599b97 100644
--- a/drivers/ide/cs5530.c
+++ b/drivers/ide/cs5530.c
@@ -226,7 +226,7 @@ out:
226 * performs channel-specific pre-initialization before drive probing. 226 * performs channel-specific pre-initialization before drive probing.
227 */ 227 */
228 228
229static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) 229static void init_hwif_cs5530 (ide_hwif_t *hwif)
230{ 230{
231 unsigned long basereg; 231 unsigned long basereg;
232 u32 d0_timings; 232 u32 d0_timings;
@@ -245,7 +245,7 @@ static const struct ide_port_ops cs5530_port_ops = {
245 .udma_filter = cs5530_udma_filter, 245 .udma_filter = cs5530_udma_filter,
246}; 246};
247 247
248static const struct ide_port_info cs5530_chipset __devinitconst = { 248static const struct ide_port_info cs5530_chipset = {
249 .name = DRV_NAME, 249 .name = DRV_NAME,
250 .init_chipset = init_chipset_cs5530, 250 .init_chipset = init_chipset_cs5530,
251 .init_hwif = init_hwif_cs5530, 251 .init_hwif = init_hwif_cs5530,
@@ -257,7 +257,7 @@ static const struct ide_port_info cs5530_chipset __devinitconst = {
257 .udma_mask = ATA_UDMA2, 257 .udma_mask = ATA_UDMA2,
258}; 258};
259 259
260static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id) 260static int cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
261{ 261{
262 return ide_pci_init_one(dev, &cs5530_chipset, NULL); 262 return ide_pci_init_one(dev, &cs5530_chipset, NULL);
263} 263}
diff --git a/drivers/ide/cs5535.c b/drivers/ide/cs5535.c
index 18d4c852602..3bc5b9a3401 100644
--- a/drivers/ide/cs5535.c
+++ b/drivers/ide/cs5535.c
@@ -170,7 +170,7 @@ static const struct ide_port_ops cs5535_port_ops = {
170 .cable_detect = cs5535_cable_detect, 170 .cable_detect = cs5535_cable_detect,
171}; 171};
172 172
173static const struct ide_port_info cs5535_chipset __devinitconst = { 173static const struct ide_port_info cs5535_chipset = {
174 .name = DRV_NAME, 174 .name = DRV_NAME,
175 .port_ops = &cs5535_port_ops, 175 .port_ops = &cs5535_port_ops,
176 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE, 176 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE,
@@ -179,8 +179,7 @@ static const struct ide_port_info cs5535_chipset __devinitconst = {
179 .udma_mask = ATA_UDMA4, 179 .udma_mask = ATA_UDMA4,
180}; 180};
181 181
182static int __devinit cs5535_init_one(struct pci_dev *dev, 182static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id)
183 const struct pci_device_id *id)
184{ 183{
185 return ide_pci_init_one(dev, &cs5535_chipset, NULL); 184 return ide_pci_init_one(dev, &cs5535_chipset, NULL);
186} 185}
diff --git a/drivers/ide/cy82c693.c b/drivers/ide/cy82c693.c
index 3ffb49dab57..f5820079a28 100644
--- a/drivers/ide/cy82c693.c
+++ b/drivers/ide/cy82c693.c
@@ -145,7 +145,7 @@ static void cy82c693_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
145 pci_dev_put(dev); 145 pci_dev_put(dev);
146} 146}
147 147
148static void __devinit init_iops_cy82c693(ide_hwif_t *hwif) 148static void init_iops_cy82c693(ide_hwif_t *hwif)
149{ 149{
150 static ide_hwif_t *primary; 150 static ide_hwif_t *primary;
151 struct pci_dev *dev = to_pci_dev(hwif->dev); 151 struct pci_dev *dev = to_pci_dev(hwif->dev);
@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c693_port_ops = {
163 .set_dma_mode = cy82c693_set_dma_mode, 163 .set_dma_mode = cy82c693_set_dma_mode,
164}; 164};
165 165
166static const struct ide_port_info cy82c693_chipset __devinitconst = { 166static const struct ide_port_info cy82c693_chipset = {
167 .name = DRV_NAME, 167 .name = DRV_NAME,
168 .init_iops = init_iops_cy82c693, 168 .init_iops = init_iops_cy82c693,
169 .port_ops = &cy82c693_port_ops, 169 .port_ops = &cy82c693_port_ops,
@@ -173,7 +173,8 @@ static const struct ide_port_info cy82c693_chipset __devinitconst = {
173 .mwdma_mask = ATA_MWDMA2, 173 .mwdma_mask = ATA_MWDMA2,
174}; 174};
175 175
176static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id) 176static int cy82c693_init_one(struct pci_dev *dev,
177 const struct pci_device_id *id)
177{ 178{
178 struct pci_dev *dev2; 179 struct pci_dev *dev2;
179 int ret = -ENODEV; 180 int ret = -ENODEV;
@@ -190,7 +191,7 @@ static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_dev
190 return ret; 191 return ret;
191} 192}
192 193
193static void __devexit cy82c693_remove(struct pci_dev *dev) 194static void cy82c693_remove(struct pci_dev *dev)
194{ 195{
195 struct ide_host *host = pci_get_drvdata(dev); 196 struct ide_host *host = pci_get_drvdata(dev);
196 struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL; 197 struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL;
@@ -209,7 +210,7 @@ static struct pci_driver cy82c693_pci_driver = {
209 .name = "Cypress_IDE", 210 .name = "Cypress_IDE",
210 .id_table = cy82c693_pci_tbl, 211 .id_table = cy82c693_pci_tbl,
211 .probe = cy82c693_init_one, 212 .probe = cy82c693_init_one,
212 .remove = __devexit_p(cy82c693_remove), 213 .remove = cy82c693_remove,
213 .suspend = ide_pci_suspend, 214 .suspend = ide_pci_suspend,
214 .resume = ide_pci_resume, 215 .resume = ide_pci_resume,
215}; 216};
diff --git a/drivers/ide/delkin_cb.c b/drivers/ide/delkin_cb.c
index 1e10eba62ce..7e27d3295e5 100644
--- a/drivers/ide/delkin_cb.c
+++ b/drivers/ide/delkin_cb.c
@@ -71,8 +71,7 @@ static const struct ide_port_info delkin_cb_port_info = {
71 .chipset = ide_pci, 71 .chipset = ide_pci,
72}; 72};
73 73
74static int __devinit 74static int delkin_cb_probe(struct pci_dev *dev, const struct pci_device_id *id)
75delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
76{ 75{
77 struct ide_host *host; 76 struct ide_host *host;
78 unsigned long base; 77 unsigned long base;
@@ -158,7 +157,7 @@ static int delkin_cb_resume(struct pci_dev *dev)
158#define delkin_cb_resume NULL 157#define delkin_cb_resume NULL
159#endif 158#endif
160 159
161static struct pci_device_id delkin_cb_pci_tbl[] __devinitdata = { 160static struct pci_device_id delkin_cb_pci_tbl[] = {
162 { 0x1145, 0xf021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 161 { 0x1145, 0xf021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
163 { 0x1145, 0xf024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 162 { 0x1145, 0xf024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
164 { 0, }, 163 { 0, },
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index 4aec3b87ff9..696b6c1ec94 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -443,7 +443,7 @@ static struct hpt_timings hpt37x_timings = {
443 } 443 }
444}; 444};
445 445
446static const struct hpt_info hpt36x __devinitconst = { 446static const struct hpt_info hpt36x = {
447 .chip_name = "HPT36x", 447 .chip_name = "HPT36x",
448 .chip_type = HPT36x, 448 .chip_type = HPT36x,
449 .udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2, 449 .udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2,
@@ -451,7 +451,7 @@ static const struct hpt_info hpt36x __devinitconst = {
451 .timings = &hpt36x_timings 451 .timings = &hpt36x_timings
452}; 452};
453 453
454static const struct hpt_info hpt370 __devinitconst = { 454static const struct hpt_info hpt370 = {
455 .chip_name = "HPT370", 455 .chip_name = "HPT370",
456 .chip_type = HPT370, 456 .chip_type = HPT370,
457 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, 457 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -459,7 +459,7 @@ static const struct hpt_info hpt370 __devinitconst = {
459 .timings = &hpt37x_timings 459 .timings = &hpt37x_timings
460}; 460};
461 461
462static const struct hpt_info hpt370a __devinitconst = { 462static const struct hpt_info hpt370a = {
463 .chip_name = "HPT370A", 463 .chip_name = "HPT370A",
464 .chip_type = HPT370A, 464 .chip_type = HPT370A,
465 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, 465 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -467,7 +467,7 @@ static const struct hpt_info hpt370a __devinitconst = {
467 .timings = &hpt37x_timings 467 .timings = &hpt37x_timings
468}; 468};
469 469
470static const struct hpt_info hpt374 __devinitconst = { 470static const struct hpt_info hpt374 = {
471 .chip_name = "HPT374", 471 .chip_name = "HPT374",
472 .chip_type = HPT374, 472 .chip_type = HPT374,
473 .udma_mask = ATA_UDMA5, 473 .udma_mask = ATA_UDMA5,
@@ -475,7 +475,7 @@ static const struct hpt_info hpt374 __devinitconst = {
475 .timings = &hpt37x_timings 475 .timings = &hpt37x_timings
476}; 476};
477 477
478static const struct hpt_info hpt372 __devinitconst = { 478static const struct hpt_info hpt372 = {
479 .chip_name = "HPT372", 479 .chip_name = "HPT372",
480 .chip_type = HPT372, 480 .chip_type = HPT372,
481 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 481 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -483,7 +483,7 @@ static const struct hpt_info hpt372 __devinitconst = {
483 .timings = &hpt37x_timings 483 .timings = &hpt37x_timings
484}; 484};
485 485
486static const struct hpt_info hpt372a __devinitconst = { 486static const struct hpt_info hpt372a = {
487 .chip_name = "HPT372A", 487 .chip_name = "HPT372A",
488 .chip_type = HPT372A, 488 .chip_type = HPT372A,
489 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 489 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -491,7 +491,7 @@ static const struct hpt_info hpt372a __devinitconst = {
491 .timings = &hpt37x_timings 491 .timings = &hpt37x_timings
492}; 492};
493 493
494static const struct hpt_info hpt302 __devinitconst = { 494static const struct hpt_info hpt302 = {
495 .chip_name = "HPT302", 495 .chip_name = "HPT302",
496 .chip_type = HPT302, 496 .chip_type = HPT302,
497 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 497 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -499,7 +499,7 @@ static const struct hpt_info hpt302 __devinitconst = {
499 .timings = &hpt37x_timings 499 .timings = &hpt37x_timings
500}; 500};
501 501
502static const struct hpt_info hpt371 __devinitconst = { 502static const struct hpt_info hpt371 = {
503 .chip_name = "HPT371", 503 .chip_name = "HPT371",
504 .chip_type = HPT371, 504 .chip_type = HPT371,
505 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 505 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -507,7 +507,7 @@ static const struct hpt_info hpt371 __devinitconst = {
507 .timings = &hpt37x_timings 507 .timings = &hpt37x_timings
508}; 508};
509 509
510static const struct hpt_info hpt372n __devinitconst = { 510static const struct hpt_info hpt372n = {
511 .chip_name = "HPT372N", 511 .chip_name = "HPT372N",
512 .chip_type = HPT372N, 512 .chip_type = HPT372N,
513 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 513 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -515,7 +515,7 @@ static const struct hpt_info hpt372n __devinitconst = {
515 .timings = &hpt37x_timings 515 .timings = &hpt37x_timings
516}; 516};
517 517
518static const struct hpt_info hpt302n __devinitconst = { 518static const struct hpt_info hpt302n = {
519 .chip_name = "HPT302N", 519 .chip_name = "HPT302N",
520 .chip_type = HPT302N, 520 .chip_type = HPT302N,
521 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 521 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -523,7 +523,7 @@ static const struct hpt_info hpt302n __devinitconst = {
523 .timings = &hpt37x_timings 523 .timings = &hpt37x_timings
524}; 524};
525 525
526static const struct hpt_info hpt371n __devinitconst = { 526static const struct hpt_info hpt371n = {
527 .chip_name = "HPT371N", 527 .chip_name = "HPT371N",
528 .chip_type = HPT371N, 528 .chip_type = HPT371N,
529 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 529 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -1197,7 +1197,7 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1197 return (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 1197 return (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
1198} 1198}
1199 1199
1200static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) 1200static void init_hwif_hpt366(ide_hwif_t *hwif)
1201{ 1201{
1202 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 1202 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
1203 u8 chip_type = info->chip_type; 1203 u8 chip_type = info->chip_type;
@@ -1221,7 +1221,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1221 } 1221 }
1222} 1222}
1223 1223
1224static int __devinit init_dma_hpt366(ide_hwif_t *hwif, 1224static int init_dma_hpt366(ide_hwif_t *hwif,
1225 const struct ide_port_info *d) 1225 const struct ide_port_info *d)
1226{ 1226{
1227 struct pci_dev *dev = to_pci_dev(hwif->dev); 1227 struct pci_dev *dev = to_pci_dev(hwif->dev);
@@ -1265,7 +1265,7 @@ static int __devinit init_dma_hpt366(ide_hwif_t *hwif,
1265 return 0; 1265 return 0;
1266} 1266}
1267 1267
1268static void __devinit hpt374_init(struct pci_dev *dev, struct pci_dev *dev2) 1268static void hpt374_init(struct pci_dev *dev, struct pci_dev *dev2)
1269{ 1269{
1270 if (dev2->irq != dev->irq) { 1270 if (dev2->irq != dev->irq) {
1271 /* FIXME: we need a core pci_set_interrupt() */ 1271 /* FIXME: we need a core pci_set_interrupt() */
@@ -1275,7 +1275,7 @@ static void __devinit hpt374_init(struct pci_dev *dev, struct pci_dev *dev2)
1275 } 1275 }
1276} 1276}
1277 1277
1278static void __devinit hpt371_init(struct pci_dev *dev) 1278static void hpt371_init(struct pci_dev *dev)
1279{ 1279{
1280 u8 mcr1 = 0; 1280 u8 mcr1 = 0;
1281 1281
@@ -1290,7 +1290,7 @@ static void __devinit hpt371_init(struct pci_dev *dev)
1290 pci_write_config_byte(dev, 0x50, mcr1 & ~0x04); 1290 pci_write_config_byte(dev, 0x50, mcr1 & ~0x04);
1291} 1291}
1292 1292
1293static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2) 1293static int hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2)
1294{ 1294{
1295 u8 mcr1 = 0, pin1 = 0, pin2 = 0; 1295 u8 mcr1 = 0, pin1 = 0, pin2 = 0;
1296 1296
@@ -1361,7 +1361,7 @@ static const struct ide_dma_ops hpt36x_dma_ops = {
1361 .dma_sff_read_status = ide_dma_sff_read_status, 1361 .dma_sff_read_status = ide_dma_sff_read_status,
1362}; 1362};
1363 1363
1364static const struct ide_port_info hpt366_chipsets[] __devinitconst = { 1364static const struct ide_port_info hpt366_chipsets[] = {
1365 { /* 0: HPT36x */ 1365 { /* 0: HPT36x */
1366 .name = DRV_NAME, 1366 .name = DRV_NAME,
1367 .init_chipset = init_chipset_hpt366, 1367 .init_chipset = init_chipset_hpt366,
@@ -1402,7 +1402,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitconst = {
1402 * Called when the PCI registration layer (or the IDE initialization) 1402 * Called when the PCI registration layer (or the IDE initialization)
1403 * finds a device matching our IDE device tables. 1403 * finds a device matching our IDE device tables.
1404 */ 1404 */
1405static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id) 1405static int hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1406{ 1406{
1407 const struct hpt_info *info = NULL; 1407 const struct hpt_info *info = NULL;
1408 struct hpt_info *dyn_info; 1408 struct hpt_info *dyn_info;
@@ -1499,7 +1499,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1499 return ret; 1499 return ret;
1500} 1500}
1501 1501
1502static void __devexit hpt366_remove(struct pci_dev *dev) 1502static void hpt366_remove(struct pci_dev *dev)
1503{ 1503{
1504 struct ide_host *host = pci_get_drvdata(dev); 1504 struct ide_host *host = pci_get_drvdata(dev);
1505 struct ide_info *info = host->host_priv; 1505 struct ide_info *info = host->host_priv;
@@ -1510,7 +1510,7 @@ static void __devexit hpt366_remove(struct pci_dev *dev)
1510 kfree(info); 1510 kfree(info);
1511} 1511}
1512 1512
1513static const struct pci_device_id hpt366_pci_tbl[] __devinitconst = { 1513static const struct pci_device_id hpt366_pci_tbl[] = {
1514 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, 1514 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 },
1515 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, 1515 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 },
1516 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 }, 1516 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 },
@@ -1525,7 +1525,7 @@ static struct pci_driver hpt366_pci_driver = {
1525 .name = "HPT366_IDE", 1525 .name = "HPT366_IDE",
1526 .id_table = hpt366_pci_tbl, 1526 .id_table = hpt366_pci_tbl,
1527 .probe = hpt366_init_one, 1527 .probe = hpt366_init_one,
1528 .remove = __devexit_p(hpt366_remove), 1528 .remove = hpt366_remove,
1529 .suspend = ide_pci_suspend, 1529 .suspend = ide_pci_suspend,
1530 .resume = ide_pci_resume, 1530 .resume = ide_pci_resume,
1531}; 1531};
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index e640d0ac3af..9f0a48e39b8 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -406,8 +406,8 @@ static const struct ide_port_info icside_v5_port_info = {
406 .chipset = ide_acorn, 406 .chipset = ide_acorn,
407}; 407};
408 408
409static int __devinit 409static int icside_register_v5(struct icside_state *state,
410icside_register_v5(struct icside_state *state, struct expansion_card *ec) 410 struct expansion_card *ec)
411{ 411{
412 void __iomem *base; 412 void __iomem *base;
413 struct ide_host *host; 413 struct ide_host *host;
@@ -460,8 +460,8 @@ static const struct ide_port_info icside_v6_port_info __initconst = {
460 .chipset = ide_acorn, 460 .chipset = ide_acorn,
461}; 461};
462 462
463static int __devinit 463static int icside_register_v6(struct icside_state *state,
464icside_register_v6(struct icside_state *state, struct expansion_card *ec) 464 struct expansion_card *ec)
465{ 465{
466 void __iomem *ioc_base, *easi_base; 466 void __iomem *ioc_base, *easi_base;
467 struct ide_host *host; 467 struct ide_host *host;
@@ -537,8 +537,7 @@ out:
537 return ret; 537 return ret;
538} 538}
539 539
540static int __devinit 540static int icside_probe(struct expansion_card *ec, const struct ecard_id *id)
541icside_probe(struct expansion_card *ec, const struct ecard_id *id)
542{ 541{
543 struct icside_state *state; 542 struct icside_state *state;
544 void __iomem *idmem; 543 void __iomem *idmem;
@@ -604,7 +603,7 @@ icside_probe(struct expansion_card *ec, const struct ecard_id *id)
604 return ret; 603 return ret;
605} 604}
606 605
607static void __devexit icside_remove(struct expansion_card *ec) 606static void icside_remove(struct expansion_card *ec)
608{ 607{
609 struct icside_state *state = ecard_get_drvdata(ec); 608 struct icside_state *state = ecard_get_drvdata(ec);
610 609
@@ -666,7 +665,7 @@ static const struct ecard_id icside_ids[] = {
666 665
667static struct ecard_driver icside_driver = { 666static struct ecard_driver icside_driver = {
668 .probe = icside_probe, 667 .probe = icside_probe,
669 .remove = __devexit_p(icside_remove), 668 .remove = icside_remove,
670 .shutdown = icside_shutdown, 669 .shutdown = icside_shutdown,
671 .id_table = icside_ids, 670 .id_table = icside_ids,
672 .drv = { 671 .drv = {
diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
index dab5b670bfb..673420db953 100644
--- a/drivers/ide/ide-pci-generic.c
+++ b/drivers/ide/ide-pci-generic.c
@@ -53,7 +53,7 @@ static const struct ide_port_ops netcell_port_ops = {
53 .udma_mask = ATA_UDMA6, \ 53 .udma_mask = ATA_UDMA6, \
54 } 54 }
55 55
56static const struct ide_port_info generic_chipsets[] __devinitconst = { 56static const struct ide_port_info generic_chipsets[] = {
57 /* 0: Unknown */ 57 /* 0: Unknown */
58 DECLARE_GENERIC_PCI_DEV(0), 58 DECLARE_GENERIC_PCI_DEV(0),
59 59
@@ -103,7 +103,7 @@ static const struct ide_port_info generic_chipsets[] __devinitconst = {
103 * finds a device matching our IDE device tables. 103 * finds a device matching our IDE device tables.
104 */ 104 */
105 105
106static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) 106static int generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
107{ 107{
108 const struct ide_port_info *d = &generic_chipsets[id->driver_data]; 108 const struct ide_port_info *d = &generic_chipsets[id->driver_data];
109 int ret = -ENODEV; 109 int ret = -ENODEV;
diff --git a/drivers/ide/ide_platform.c b/drivers/ide/ide_platform.c
index 962693b10a1..ba4bfbead24 100644
--- a/drivers/ide/ide_platform.c
+++ b/drivers/ide/ide_platform.c
@@ -22,11 +22,9 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25static void __devinit plat_ide_setup_ports(struct ide_hw *hw, 25static void plat_ide_setup_ports(struct ide_hw *hw, void __iomem *base,
26 void __iomem *base, 26 void __iomem *ctrl,
27 void __iomem *ctrl, 27 struct pata_platform_info *pdata, int irq)
28 struct pata_platform_info *pdata,
29 int irq)
30{ 28{
31 unsigned long port = (unsigned long)base; 29 unsigned long port = (unsigned long)base;
32 int i; 30 int i;
@@ -48,7 +46,7 @@ static const struct ide_port_info platform_ide_port_info = {
48 .chipset = ide_generic, 46 .chipset = ide_generic,
49}; 47};
50 48
51static int __devinit plat_ide_probe(struct platform_device *pdev) 49static int plat_ide_probe(struct platform_device *pdev)
52{ 50{
53 struct resource *res_base, *res_alt, *res_irq; 51 struct resource *res_base, *res_alt, *res_irq;
54 void __iomem *base, *alt_base; 52 void __iomem *base, *alt_base;
@@ -115,7 +113,7 @@ out:
115 return ret; 113 return ret;
116} 114}
117 115
118static int __devexit plat_ide_remove(struct platform_device *pdev) 116static int plat_ide_remove(struct platform_device *pdev)
119{ 117{
120 struct ide_host *host = dev_get_drvdata(&pdev->dev); 118 struct ide_host *host = dev_get_drvdata(&pdev->dev);
121 119
@@ -130,7 +128,7 @@ static struct platform_driver platform_ide_driver = {
130 .owner = THIS_MODULE, 128 .owner = THIS_MODULE,
131 }, 129 },
132 .probe = plat_ide_probe, 130 .probe = plat_ide_probe,
133 .remove = __devexit_p(plat_ide_remove), 131 .remove = plat_ide_remove,
134}; 132};
135 133
136static int __init platform_ide_init(void) 134static int __init platform_ide_init(void)
diff --git a/drivers/ide/it8172.c b/drivers/ide/it8172.c
index d5dd180c4b8..b6f674ab4fb 100644
--- a/drivers/ide/it8172.c
+++ b/drivers/ide/it8172.c
@@ -115,7 +115,7 @@ static const struct ide_port_ops it8172_port_ops = {
115 .set_dma_mode = it8172_set_dma_mode, 115 .set_dma_mode = it8172_set_dma_mode,
116}; 116};
117 117
118static const struct ide_port_info it8172_port_info __devinitconst = { 118static const struct ide_port_info it8172_port_info = {
119 .name = DRV_NAME, 119 .name = DRV_NAME,
120 .port_ops = &it8172_port_ops, 120 .port_ops = &it8172_port_ops,
121 .enablebits = { {0x41, 0x80, 0x80}, {0x00, 0x00, 0x00} }, 121 .enablebits = { {0x41, 0x80, 0x80}, {0x00, 0x00, 0x00} },
@@ -125,8 +125,7 @@ static const struct ide_port_info it8172_port_info __devinitconst = {
125 .udma_mask = ATA_UDMA2, 125 .udma_mask = ATA_UDMA2,
126}; 126};
127 127
128static int __devinit it8172_init_one(struct pci_dev *dev, 128static int it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id)
129 const struct pci_device_id *id)
130{ 129{
131 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) 130 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
132 return -ENODEV; /* IT8172 is more than an IDE controller */ 131 return -ENODEV; /* IT8172 is more than an IDE controller */
diff --git a/drivers/ide/it8213.c b/drivers/ide/it8213.c
index 1847aeb5450..6b92846682f 100644
--- a/drivers/ide/it8213.c
+++ b/drivers/ide/it8213.c
@@ -156,7 +156,7 @@ static const struct ide_port_ops it8213_port_ops = {
156 .cable_detect = it8213_cable_detect, 156 .cable_detect = it8213_cable_detect,
157}; 157};
158 158
159static const struct ide_port_info it8213_chipset __devinitconst = { 159static const struct ide_port_info it8213_chipset = {
160 .name = DRV_NAME, 160 .name = DRV_NAME,
161 .enablebits = { {0x41, 0x80, 0x80} }, 161 .enablebits = { {0x41, 0x80, 0x80} },
162 .port_ops = &it8213_port_ops, 162 .port_ops = &it8213_port_ops,
@@ -177,7 +177,7 @@ static const struct ide_port_info it8213_chipset __devinitconst = {
177 * standard helper functions to do almost all the work for us. 177 * standard helper functions to do almost all the work for us.
178 */ 178 */
179 179
180static int __devinit it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id) 180static int it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id)
181{ 181{
182 return ide_pci_init_one(dev, &it8213_chipset, NULL); 182 return ide_pci_init_one(dev, &it8213_chipset, NULL);
183} 183}
diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c
index c5611dbca34..f01ba4606be 100644
--- a/drivers/ide/it821x.c
+++ b/drivers/ide/it821x.c
@@ -528,7 +528,7 @@ static struct ide_dma_ops it821x_pass_through_dma_ops = {
528 * ide DMA handlers appropriately 528 * ide DMA handlers appropriately
529 */ 529 */
530 530
531static void __devinit init_hwif_it821x(ide_hwif_t *hwif) 531static void init_hwif_it821x(ide_hwif_t *hwif)
532{ 532{
533 struct pci_dev *dev = to_pci_dev(hwif->dev); 533 struct pci_dev *dev = to_pci_dev(hwif->dev);
534 struct ide_host *host = pci_get_drvdata(dev); 534 struct ide_host *host = pci_get_drvdata(dev);
@@ -630,7 +630,7 @@ static const struct ide_port_ops it821x_port_ops = {
630 .cable_detect = it821x_cable_detect, 630 .cable_detect = it821x_cable_detect,
631}; 631};
632 632
633static const struct ide_port_info it821x_chipset __devinitconst = { 633static const struct ide_port_info it821x_chipset = {
634 .name = DRV_NAME, 634 .name = DRV_NAME,
635 .init_chipset = init_chipset_it821x, 635 .init_chipset = init_chipset_it821x,
636 .init_hwif = init_hwif_it821x, 636 .init_hwif = init_hwif_it821x,
@@ -647,7 +647,7 @@ static const struct ide_port_info it821x_chipset __devinitconst = {
647 * We then use the IDE PCI generic helper to do most of the work. 647 * We then use the IDE PCI generic helper to do most of the work.
648 */ 648 */
649 649
650static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 650static int it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
651{ 651{
652 struct it821x_dev *itdevs; 652 struct it821x_dev *itdevs;
653 int rc; 653 int rc;
@@ -667,7 +667,7 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic
667 return rc; 667 return rc;
668} 668}
669 669
670static void __devexit it821x_remove(struct pci_dev *dev) 670static void it821x_remove(struct pci_dev *dev)
671{ 671{
672 struct ide_host *host = pci_get_drvdata(dev); 672 struct ide_host *host = pci_get_drvdata(dev);
673 struct it821x_dev *itdevs = host->host_priv; 673 struct it821x_dev *itdevs = host->host_priv;
@@ -689,7 +689,7 @@ static struct pci_driver it821x_pci_driver = {
689 .name = "ITE821x IDE", 689 .name = "ITE821x IDE",
690 .id_table = it821x_pci_tbl, 690 .id_table = it821x_pci_tbl,
691 .probe = it821x_init_one, 691 .probe = it821x_init_one,
692 .remove = __devexit_p(it821x_remove), 692 .remove = it821x_remove,
693 .suspend = ide_pci_suspend, 693 .suspend = ide_pci_suspend,
694 .resume = ide_pci_resume, 694 .resume = ide_pci_resume,
695}; 695};
diff --git a/drivers/ide/jmicron.c b/drivers/ide/jmicron.c
index efddd7d9f92..ae6480dcbad 100644
--- a/drivers/ide/jmicron.c
+++ b/drivers/ide/jmicron.c
@@ -102,7 +102,7 @@ static const struct ide_port_ops jmicron_port_ops = {
102 .cable_detect = jmicron_cable_detect, 102 .cable_detect = jmicron_cable_detect,
103}; 103};
104 104
105static const struct ide_port_info jmicron_chipset __devinitconst = { 105static const struct ide_port_info jmicron_chipset = {
106 .name = DRV_NAME, 106 .name = DRV_NAME,
107 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, 107 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
108 .port_ops = &jmicron_port_ops, 108 .port_ops = &jmicron_port_ops,
@@ -120,7 +120,7 @@ static const struct ide_port_info jmicron_chipset __devinitconst = {
120 * We then use the IDE PCI generic helper to do most of the work. 120 * We then use the IDE PCI generic helper to do most of the work.
121 */ 121 */
122 122
123static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_device_id *id) 123static int jmicron_init_one(struct pci_dev *dev, const struct pci_device_id *id)
124{ 124{
125 return ide_pci_init_one(dev, &jmicron_chipset, NULL); 125 return ide_pci_init_one(dev, &jmicron_chipset, NULL);
126} 126}
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
index 73f78d872d5..392fd106edf 100644
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -96,7 +96,7 @@ static const struct ide_tp_ops superio_tp_ops = {
96 .output_data = ide_output_data, 96 .output_data = ide_output_data,
97}; 97};
98 98
99static void __devinit superio_init_iops(struct hwif_s *hwif) 99static void superio_init_iops(struct hwif_s *hwif)
100{ 100{
101 struct pci_dev *pdev = to_pci_dev(hwif->dev); 101 struct pci_dev *pdev = to_pci_dev(hwif->dev);
102 u32 dma_stat; 102 u32 dma_stat;
@@ -201,7 +201,7 @@ static int ns87415_dma_end(ide_drive_t *drive)
201 return (dma_stat & 7) != 4; 201 return (dma_stat & 7) != 4;
202} 202}
203 203
204static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) 204static void init_hwif_ns87415 (ide_hwif_t *hwif)
205{ 205{
206 struct pci_dev *dev = to_pci_dev(hwif->dev); 206 struct pci_dev *dev = to_pci_dev(hwif->dev);
207 unsigned int ctrl, using_inta; 207 unsigned int ctrl, using_inta;
@@ -293,7 +293,7 @@ static const struct ide_dma_ops ns87415_dma_ops = {
293 .dma_sff_read_status = superio_dma_sff_read_status, 293 .dma_sff_read_status = superio_dma_sff_read_status,
294}; 294};
295 295
296static const struct ide_port_info ns87415_chipset __devinitconst = { 296static const struct ide_port_info ns87415_chipset = {
297 .name = DRV_NAME, 297 .name = DRV_NAME,
298 .init_hwif = init_hwif_ns87415, 298 .init_hwif = init_hwif_ns87415,
299 .tp_ops = &ns87415_tp_ops, 299 .tp_ops = &ns87415_tp_ops,
@@ -302,7 +302,7 @@ static const struct ide_port_info ns87415_chipset __devinitconst = {
302 IDE_HFLAG_NO_ATAPI_DMA, 302 IDE_HFLAG_NO_ATAPI_DMA,
303}; 303};
304 304
305static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id) 305static int ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
306{ 306{
307 struct ide_port_info d = ns87415_chipset; 307 struct ide_port_info d = ns87415_chipset;
308 308
diff --git a/drivers/ide/opti621.c b/drivers/ide/opti621.c
index 39edc66cb96..26a45007e53 100644
--- a/drivers/ide/opti621.c
+++ b/drivers/ide/opti621.c
@@ -131,7 +131,7 @@ static const struct ide_port_ops opti621_port_ops = {
131 .set_pio_mode = opti621_set_pio_mode, 131 .set_pio_mode = opti621_set_pio_mode,
132}; 132};
133 133
134static const struct ide_port_info opti621_chipset __devinitconst = { 134static const struct ide_port_info opti621_chipset = {
135 .name = DRV_NAME, 135 .name = DRV_NAME,
136 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, 136 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
137 .port_ops = &opti621_port_ops, 137 .port_ops = &opti621_port_ops,
@@ -139,7 +139,7 @@ static const struct ide_port_info opti621_chipset __devinitconst = {
139 .pio_mask = ATA_PIO4, 139 .pio_mask = ATA_PIO4,
140}; 140};
141 141
142static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id) 142static int opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
143{ 143{
144 return ide_pci_init_one(dev, &opti621_chipset, NULL); 144 return ide_pci_init_one(dev, &opti621_chipset, NULL);
145} 145}
diff --git a/drivers/ide/palm_bk3710.c b/drivers/ide/palm_bk3710.c
index 712c7904d03..6107cc4ee01 100644
--- a/drivers/ide/palm_bk3710.c
+++ b/drivers/ide/palm_bk3710.c
@@ -220,7 +220,7 @@ static void palm_bk3710_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
220 palm_bk3710_setpiomode(base, mate, is_slave, cycle_time, pio); 220 palm_bk3710_setpiomode(base, mate, is_slave, cycle_time, pio);
221} 221}
222 222
223static void __devinit palm_bk3710_chipinit(void __iomem *base) 223static void palm_bk3710_chipinit(void __iomem *base)
224{ 224{
225 /* 225 /*
226 * REVISIT: the ATA reset signal needs to be managed through a 226 * REVISIT: the ATA reset signal needs to be managed through a
@@ -282,8 +282,7 @@ static u8 palm_bk3710_cable_detect(ide_hwif_t *hwif)
282 return ATA_CBL_PATA80; 282 return ATA_CBL_PATA80;
283} 283}
284 284
285static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif, 285static int palm_bk3710_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
286 const struct ide_port_info *d)
287{ 286{
288 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name); 287 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
289 288
@@ -301,7 +300,7 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
301 .cable_detect = palm_bk3710_cable_detect, 300 .cable_detect = palm_bk3710_cable_detect,
302}; 301};
303 302
304static struct ide_port_info __devinitdata palm_bk3710_port_info = { 303static struct ide_port_info palm_bk3710_port_info = {
305 .init_dma = palm_bk3710_init_dma, 304 .init_dma = palm_bk3710_init_dma,
306 .port_ops = &palm_bk3710_ports_ops, 305 .port_ops = &palm_bk3710_ports_ops,
307 .dma_ops = &sff_dma_ops, 306 .dma_ops = &sff_dma_ops,
diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c
index 2e5ceb62fb3..df73cbd9387 100644
--- a/drivers/ide/pdc202xx_new.c
+++ b/drivers/ide/pdc202xx_new.c
@@ -422,7 +422,7 @@ static int init_chipset_pdcnew(struct pci_dev *dev)
422 return 0; 422 return 0;
423} 423}
424 424
425static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) 425static struct pci_dev *pdc20270_get_dev2(struct pci_dev *dev)
426{ 426{
427 struct pci_dev *dev2; 427 struct pci_dev *dev2;
428 428
@@ -465,7 +465,7 @@ static const struct ide_port_ops pdcnew_port_ops = {
465 .udma_mask = udma, \ 465 .udma_mask = udma, \
466 } 466 }
467 467
468static const struct ide_port_info pdcnew_chipsets[] __devinitconst = { 468static const struct ide_port_info pdcnew_chipsets[] = {
469 /* 0: PDC202{68,70} */ DECLARE_PDCNEW_DEV(ATA_UDMA5), 469 /* 0: PDC202{68,70} */ DECLARE_PDCNEW_DEV(ATA_UDMA5),
470 /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6), 470 /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6),
471}; 471};
@@ -479,7 +479,7 @@ static const struct ide_port_info pdcnew_chipsets[] __devinitconst = {
479 * finds a device matching our IDE device tables. 479 * finds a device matching our IDE device tables.
480 */ 480 */
481 481
482static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id) 482static int pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id)
483{ 483{
484 const struct ide_port_info *d = &pdcnew_chipsets[id->driver_data]; 484 const struct ide_port_info *d = &pdcnew_chipsets[id->driver_data];
485 struct pci_dev *bridge = dev->bus->self; 485 struct pci_dev *bridge = dev->bus->self;
@@ -514,7 +514,7 @@ static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_de
514 return ide_pci_init_one(dev, d, NULL); 514 return ide_pci_init_one(dev, d, NULL);
515} 515}
516 516
517static void __devexit pdc202new_remove(struct pci_dev *dev) 517static void pdc202new_remove(struct pci_dev *dev)
518{ 518{
519 struct ide_host *host = pci_get_drvdata(dev); 519 struct ide_host *host = pci_get_drvdata(dev);
520 struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL; 520 struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL;
@@ -539,7 +539,7 @@ static struct pci_driver pdc202new_pci_driver = {
539 .name = "Promise_IDE", 539 .name = "Promise_IDE",
540 .id_table = pdc202new_pci_tbl, 540 .id_table = pdc202new_pci_tbl,
541 .probe = pdc202new_init_one, 541 .probe = pdc202new_init_one,
542 .remove = __devexit_p(pdc202new_remove), 542 .remove = pdc202new_remove,
543 .suspend = ide_pci_suspend, 543 .suspend = ide_pci_suspend,
544 .resume = ide_pci_resume, 544 .resume = ide_pci_resume,
545}; 545};
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index 56345109681..224ad46d6cb 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -211,8 +211,7 @@ out:
211 return 0; 211 return 0;
212} 212}
213 213
214static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev, 214static void pdc202ata4_fixup_irq(struct pci_dev *dev, const char *name)
215 const char *name)
216{ 215{
217 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { 216 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
218 u8 irq = 0, irq2 = 0; 217 u8 irq = 0, irq2 = 0;
@@ -270,7 +269,7 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
270 .max_sectors = sectors, \ 269 .max_sectors = sectors, \
271 } 270 }
272 271
273static const struct ide_port_info pdc202xx_chipsets[] __devinitconst = { 272static const struct ide_port_info pdc202xx_chipsets[] = {
274 { /* 0: PDC20246 */ 273 { /* 0: PDC20246 */
275 .name = DRV_NAME, 274 .name = DRV_NAME,
276 .init_chipset = init_chipset_pdc202xx, 275 .init_chipset = init_chipset_pdc202xx,
@@ -297,7 +296,8 @@ static const struct ide_port_info pdc202xx_chipsets[] __devinitconst = {
297 * finds a device matching our IDE device tables. 296 * finds a device matching our IDE device tables.
298 */ 297 */
299 298
300static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 299static int pdc202xx_init_one(struct pci_dev *dev,
300 const struct pci_device_id *id)
301{ 301{
302 const struct ide_port_info *d; 302 const struct ide_port_info *d;
303 u8 idx = id->driver_data; 303 u8 idx = id->driver_data;
diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c
index fe0fd60cfc0..a671cead6ae 100644
--- a/drivers/ide/piix.c
+++ b/drivers/ide/piix.c
@@ -297,7 +297,7 @@ static u8 piix_cable_detect(ide_hwif_t *hwif)
297 * capabilities of the hardware. 297 * capabilities of the hardware.
298 */ 298 */
299 299
300static void __devinit init_hwif_piix(ide_hwif_t *hwif) 300static void init_hwif_piix(ide_hwif_t *hwif)
301{ 301{
302 if (!hwif->dma_base) 302 if (!hwif->dma_base)
303 return; 303 return;
@@ -344,7 +344,7 @@ static const struct ide_port_ops ich_port_ops = {
344 .udma_mask = udma, \ 344 .udma_mask = udma, \
345 } 345 }
346 346
347static const struct ide_port_info piix_pci_info[] __devinitconst = { 347static const struct ide_port_info piix_pci_info[] = {
348 /* 0: MPIIX */ 348 /* 0: MPIIX */
349 { /* 349 { /*
350 * MPIIX actually has only a single IDE channel mapped to 350 * MPIIX actually has only a single IDE channel mapped to
@@ -382,7 +382,7 @@ static const struct ide_port_info piix_pci_info[] __devinitconst = {
382 * finds a device matching our IDE device tables. 382 * finds a device matching our IDE device tables.
383 */ 383 */
384 384
385static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_id *id) 385static int piix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
386{ 386{
387 return ide_pci_init_one(dev, &piix_pci_info[id->driver_data], NULL); 387 return ide_pci_init_one(dev, &piix_pci_info[id->driver_data], NULL);
388} 388}
@@ -394,7 +394,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
394 * they are found, disable use of DMA IDE 394 * they are found, disable use of DMA IDE
395 */ 395 */
396 396
397static void __devinit piix_check_450nx(void) 397static void piix_check_450nx(void)
398{ 398{
399 struct pci_dev *pdev = NULL; 399 struct pci_dev *pdev = NULL;
400 u16 cfg; 400 u16 cfg;
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index e944c7f705f..bf83d7bb6bc 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1025,8 +1025,7 @@ static const struct ide_port_info pmac_port_info = {
1025 * Setup, register & probe an IDE channel driven by this driver, this is 1025 * Setup, register & probe an IDE channel driven by this driver, this is
1026 * called by one of the 2 probe functions (macio or PCI). 1026 * called by one of the 2 probe functions (macio or PCI).
1027 */ 1027 */
1028static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 1028static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
1029 struct ide_hw *hw)
1030{ 1029{
1031 struct device_node *np = pmif->node; 1030 struct device_node *np = pmif->node;
1032 const int *bidp; 1031 const int *bidp;
@@ -1126,7 +1125,7 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif,
1126 return rc; 1125 return rc;
1127} 1126}
1128 1127
1129static void __devinit pmac_ide_init_ports(struct ide_hw *hw, unsigned long base) 1128static void pmac_ide_init_ports(struct ide_hw *hw, unsigned long base)
1130{ 1129{
1131 int i; 1130 int i;
1132 1131
@@ -1139,8 +1138,8 @@ static void __devinit pmac_ide_init_ports(struct ide_hw *hw, unsigned long base)
1139/* 1138/*
1140 * Attach to a macio probed interface 1139 * Attach to a macio probed interface
1141 */ 1140 */
1142static int __devinit 1141static int pmac_ide_macio_attach(struct macio_dev *mdev,
1143pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match) 1142 const struct of_device_id *match)
1144{ 1143{
1145 void __iomem *base; 1144 void __iomem *base;
1146 unsigned long regbase; 1145 unsigned long regbase;
@@ -1262,8 +1261,8 @@ pmac_ide_macio_resume(struct macio_dev *mdev)
1262/* 1261/*
1263 * Attach to a PCI probed interface 1262 * Attach to a PCI probed interface
1264 */ 1263 */
1265static int __devinit 1264static int pmac_ide_pci_attach(struct pci_dev *pdev,
1266pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id) 1265 const struct pci_device_id *id)
1267{ 1266{
1268 struct device_node *np; 1267 struct device_node *np;
1269 pmac_ide_hwif_t *pmif; 1268 pmac_ide_hwif_t *pmif;
@@ -1692,8 +1691,7 @@ static const struct ide_dma_ops pmac_dma_ops = {
1692 * Allocate the data structures needed for using DMA with an interface 1691 * Allocate the data structures needed for using DMA with an interface
1693 * and fill the proper list of functions pointers 1692 * and fill the proper list of functions pointers
1694 */ 1693 */
1695static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif, 1694static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
1696 const struct ide_port_info *d)
1697{ 1695{
1698 pmac_ide_hwif_t *pmif = 1696 pmac_ide_hwif_t *pmif =
1699 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); 1697 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
diff --git a/drivers/ide/rapide.c b/drivers/ide/rapide.c
index 48d976aad7a..d73c3d10087 100644
--- a/drivers/ide/rapide.c
+++ b/drivers/ide/rapide.c
@@ -29,8 +29,7 @@ static void rapide_setup_ports(struct ide_hw *hw, void __iomem *base,
29 hw->irq = irq; 29 hw->irq = irq;
30} 30}
31 31
32static int __devinit 32static int rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
33rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
34{ 33{
35 void __iomem *base; 34 void __iomem *base;
36 struct ide_host *host; 35 struct ide_host *host;
@@ -64,7 +63,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
64 return ret; 63 return ret;
65} 64}
66 65
67static void __devexit rapide_remove(struct expansion_card *ec) 66static void rapide_remove(struct expansion_card *ec)
68{ 67{
69 struct ide_host *host = ecard_get_drvdata(ec); 68 struct ide_host *host = ecard_get_drvdata(ec);
70 69
@@ -82,7 +81,7 @@ static struct ecard_id rapide_ids[] = {
82 81
83static struct ecard_driver rapide_driver = { 82static struct ecard_driver rapide_driver = {
84 .probe = rapide_probe, 83 .probe = rapide_probe,
85 .remove = __devexit_p(rapide_remove), 84 .remove = rapide_remove,
86 .id_table = rapide_ids, 85 .id_table = rapide_ids,
87 .drv = { 86 .drv = {
88 .name = "rapide", 87 .name = "rapide",
diff --git a/drivers/ide/rz1000.c b/drivers/ide/rz1000.c
index c04173e9fc3..f4b66f7ec9f 100644
--- a/drivers/ide/rz1000.c
+++ b/drivers/ide/rz1000.c
@@ -22,7 +22,7 @@
22 22
23#define DRV_NAME "rz1000" 23#define DRV_NAME "rz1000"
24 24
25static int __devinit rz1000_disable_readahead(struct pci_dev *dev) 25static int rz1000_disable_readahead(struct pci_dev *dev)
26{ 26{
27 u16 reg; 27 u16 reg;
28 28
@@ -38,12 +38,12 @@ static int __devinit rz1000_disable_readahead(struct pci_dev *dev)
38 } 38 }
39} 39}
40 40
41static const struct ide_port_info rz1000_chipset __devinitconst = { 41static const struct ide_port_info rz1000_chipset = {
42 .name = DRV_NAME, 42 .name = DRV_NAME,
43 .host_flags = IDE_HFLAG_NO_DMA, 43 .host_flags = IDE_HFLAG_NO_DMA,
44}; 44};
45 45
46static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id) 46static int rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
47{ 47{
48 struct ide_port_info d = rz1000_chipset; 48 struct ide_port_info d = rz1000_chipset;
49 int rc; 49 int rc;
diff --git a/drivers/ide/sc1200.c b/drivers/ide/sc1200.c
index d4758ebe77d..a5b70181840 100644
--- a/drivers/ide/sc1200.c
+++ b/drivers/ide/sc1200.c
@@ -291,7 +291,7 @@ static const struct ide_dma_ops sc1200_dma_ops = {
291 .dma_sff_read_status = ide_dma_sff_read_status, 291 .dma_sff_read_status = ide_dma_sff_read_status,
292}; 292};
293 293
294static const struct ide_port_info sc1200_chipset __devinitconst = { 294static const struct ide_port_info sc1200_chipset = {
295 .name = DRV_NAME, 295 .name = DRV_NAME,
296 .port_ops = &sc1200_port_ops, 296 .port_ops = &sc1200_port_ops,
297 .dma_ops = &sc1200_dma_ops, 297 .dma_ops = &sc1200_dma_ops,
@@ -303,7 +303,7 @@ static const struct ide_port_info sc1200_chipset __devinitconst = {
303 .udma_mask = ATA_UDMA2, 303 .udma_mask = ATA_UDMA2,
304}; 304};
305 305
306static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) 306static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
307{ 307{
308 struct sc1200_saved_state *ss = NULL; 308 struct sc1200_saved_state *ss = NULL;
309 int rc; 309 int rc;
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index 97010381002..2a2d188b5d5 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -585,8 +585,7 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
585 * Perform the initial set up for this device. 585 * Perform the initial set up for this device.
586 */ 586 */
587 587
588static int __devinit init_setup_scc(struct pci_dev *dev, 588static int init_setup_scc(struct pci_dev *dev, const struct ide_port_info *d)
589 const struct ide_port_info *d)
590{ 589{
591 unsigned long ctl_base; 590 unsigned long ctl_base;
592 unsigned long dma_base; 591 unsigned long dma_base;
@@ -718,7 +717,7 @@ static void scc_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
718 * 717 *
719 */ 718 */
720 719
721static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) 720static void init_mmio_iops_scc(ide_hwif_t *hwif)
722{ 721{
723 struct pci_dev *dev = to_pci_dev(hwif->dev); 722 struct pci_dev *dev = to_pci_dev(hwif->dev);
724 struct scc_ports *ports = pci_get_drvdata(dev); 723 struct scc_ports *ports = pci_get_drvdata(dev);
@@ -738,7 +737,7 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)
738 * and then do the MMIO setup. 737 * and then do the MMIO setup.
739 */ 738 */
740 739
741static void __devinit init_iops_scc(ide_hwif_t *hwif) 740static void init_iops_scc(ide_hwif_t *hwif)
742{ 741{
743 struct pci_dev *dev = to_pci_dev(hwif->dev); 742 struct pci_dev *dev = to_pci_dev(hwif->dev);
744 743
@@ -748,8 +747,7 @@ static void __devinit init_iops_scc(ide_hwif_t *hwif)
748 init_mmio_iops_scc(hwif); 747 init_mmio_iops_scc(hwif);
749} 748}
750 749
751static int __devinit scc_init_dma(ide_hwif_t *hwif, 750static int scc_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
752 const struct ide_port_info *d)
753{ 751{
754 return ide_allocate_dma_engine(hwif); 752 return ide_allocate_dma_engine(hwif);
755} 753}
@@ -768,7 +766,7 @@ static u8 scc_cable_detect(ide_hwif_t *hwif)
768 * ide DMA handlers appropriately. 766 * ide DMA handlers appropriately.
769 */ 767 */
770 768
771static void __devinit init_hwif_scc(ide_hwif_t *hwif) 769static void init_hwif_scc(ide_hwif_t *hwif)
772{ 770{
773 /* PTERADD */ 771 /* PTERADD */
774 out_be32((void __iomem *)(hwif->dma_base + 0x018), hwif->dmatable_dma); 772 out_be32((void __iomem *)(hwif->dma_base + 0x018), hwif->dmatable_dma);
@@ -811,7 +809,7 @@ static const struct ide_dma_ops scc_dma_ops = {
811 .dma_sff_read_status = scc_dma_sff_read_status, 809 .dma_sff_read_status = scc_dma_sff_read_status,
812}; 810};
813 811
814static const struct ide_port_info scc_chipset __devinitconst = { 812static const struct ide_port_info scc_chipset = {
815 .name = "sccIDE", 813 .name = "sccIDE",
816 .init_iops = init_iops_scc, 814 .init_iops = init_iops_scc,
817 .init_dma = scc_init_dma, 815 .init_dma = scc_init_dma,
@@ -834,7 +832,7 @@ static const struct ide_port_info scc_chipset __devinitconst = {
834 * We then use the IDE PCI generic helper to do most of the work. 832 * We then use the IDE PCI generic helper to do most of the work.
835 */ 833 */
836 834
837static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id) 835static int scc_init_one(struct pci_dev *dev, const struct pci_device_id *id)
838{ 836{
839 return init_setup_scc(dev, &scc_chipset); 837 return init_setup_scc(dev, &scc_chipset);
840} 838}
@@ -846,7 +844,7 @@ static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_i
846 * Called by the PCI code when it removes an SCC PATA controller. 844 * Called by the PCI code when it removes an SCC PATA controller.
847 */ 845 */
848 846
849static void __devexit scc_remove(struct pci_dev *dev) 847static void scc_remove(struct pci_dev *dev)
850{ 848{
851 struct scc_ports *ports = pci_get_drvdata(dev); 849 struct scc_ports *ports = pci_get_drvdata(dev);
852 struct ide_host *host = ports->host; 850 struct ide_host *host = ports->host;
@@ -869,7 +867,7 @@ static struct pci_driver scc_pci_driver = {
869 .name = "SCC IDE", 867 .name = "SCC IDE",
870 .id_table = scc_pci_tbl, 868 .id_table = scc_pci_tbl,
871 .probe = scc_init_one, 869 .probe = scc_init_one,
872 .remove = __devexit_p(scc_remove), 870 .remove = scc_remove,
873}; 871};
874 872
875static int __init scc_ide_init(void) 873static int __init scc_ide_init(void)
diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c
index 24d72ef23df..a97affca18a 100644
--- a/drivers/ide/serverworks.c
+++ b/drivers/ide/serverworks.c
@@ -337,7 +337,7 @@ static const struct ide_port_ops svwks_port_ops = {
337 .cable_detect = svwks_cable_detect, 337 .cable_detect = svwks_cable_detect,
338}; 338};
339 339
340static const struct ide_port_info serverworks_chipsets[] __devinitconst = { 340static const struct ide_port_info serverworks_chipsets[] = {
341 { /* 0: OSB4 */ 341 { /* 0: OSB4 */
342 .name = DRV_NAME, 342 .name = DRV_NAME,
343 .init_chipset = init_chipset_svwks, 343 .init_chipset = init_chipset_svwks,
@@ -391,7 +391,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitconst = {
391 * finds a device matching our IDE device tables. 391 * finds a device matching our IDE device tables.
392 */ 392 */
393 393
394static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id) 394static int svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id)
395{ 395{
396 struct ide_port_info d; 396 struct ide_port_info d;
397 u8 idx = id->driver_data; 397 u8 idx = id->driver_data;
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c
index e3ea591f66d..a5ca179a83b 100644
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -307,8 +307,7 @@ static u8 sgiioc4_read_status(ide_hwif_t *hwif)
307} 307}
308 308
309/* Creates a DMA map for the scatter-gather list entries */ 309/* Creates a DMA map for the scatter-gather list entries */
310static int __devinit ide_dma_sgiioc4(ide_hwif_t *hwif, 310static int ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
311 const struct ide_port_info *d)
312{ 311{
313 struct pci_dev *dev = to_pci_dev(hwif->dev); 312 struct pci_dev *dev = to_pci_dev(hwif->dev);
314 unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET; 313 unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET;
@@ -520,7 +519,7 @@ static const struct ide_dma_ops sgiioc4_dma_ops = {
520 .dma_lost_irq = sgiioc4_dma_lost_irq, 519 .dma_lost_irq = sgiioc4_dma_lost_irq,
521}; 520};
522 521
523static const struct ide_port_info sgiioc4_port_info __devinitconst = { 522static const struct ide_port_info sgiioc4_port_info = {
524 .name = DRV_NAME, 523 .name = DRV_NAME,
525 .chipset = ide_pci, 524 .chipset = ide_pci,
526 .init_dma = ide_dma_sgiioc4, 525 .init_dma = ide_dma_sgiioc4,
@@ -532,7 +531,7 @@ static const struct ide_port_info sgiioc4_port_info __devinitconst = {
532 .mwdma_mask = ATA_MWDMA2_ONLY, 531 .mwdma_mask = ATA_MWDMA2_ONLY,
533}; 532};
534 533
535static int __devinit sgiioc4_ide_setup_pci_device(struct pci_dev *dev) 534static int sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
536{ 535{
537 unsigned long cmd_base, irqport; 536 unsigned long cmd_base, irqport;
538 unsigned long bar0, cmd_phys_base, ctl; 537 unsigned long bar0, cmd_phys_base, ctl;
@@ -581,7 +580,7 @@ req_mem_rgn_err:
581 return rc; 580 return rc;
582} 581}
583 582
584static unsigned int __devinit pci_init_sgiioc4(struct pci_dev *dev) 583static unsigned int pci_init_sgiioc4(struct pci_dev *dev)
585{ 584{
586 int ret; 585 int ret;
587 586
@@ -601,7 +600,7 @@ out:
601 return ret; 600 return ret;
602} 601}
603 602
604int __devinit ioc4_ide_attach_one(struct ioc4_driver_data *idd) 603int ioc4_ide_attach_one(struct ioc4_driver_data *idd)
605{ 604{
606 /* 605 /*
607 * PCI-RT does not bring out IDE connection. 606 * PCI-RT does not bring out IDE connection.
@@ -613,7 +612,7 @@ int __devinit ioc4_ide_attach_one(struct ioc4_driver_data *idd)
613 return pci_init_sgiioc4(idd->idd_pdev); 612 return pci_init_sgiioc4(idd->idd_pdev);
614} 613}
615 614
616static struct ioc4_submodule __devinitdata ioc4_ide_submodule = { 615static struct ioc4_submodule ioc4_ide_submodule = {
617 .is_name = "IOC4_ide", 616 .is_name = "IOC4_ide",
618 .is_owner = THIS_MODULE, 617 .is_owner = THIS_MODULE,
619 .is_probe = ioc4_ide_attach_one, 618 .is_probe = ioc4_ide_attach_one,
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
index 46f7e30d379..6a1849bb476 100644
--- a/drivers/ide/siimage.c
+++ b/drivers/ide/siimage.c
@@ -546,7 +546,7 @@ static int init_chipset_siimage(struct pci_dev *dev)
546 * extended PRD tables. For better SI3112 support use the libata driver 546 * extended PRD tables. For better SI3112 support use the libata driver
547 */ 547 */
548 548
549static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif) 549static void init_mmio_iops_siimage(ide_hwif_t *hwif)
550{ 550{
551 struct pci_dev *dev = to_pci_dev(hwif->dev); 551 struct pci_dev *dev = to_pci_dev(hwif->dev);
552 struct ide_host *host = pci_get_drvdata(dev); 552 struct ide_host *host = pci_get_drvdata(dev);
@@ -646,7 +646,7 @@ static void sil_quirkproc(ide_drive_t *drive)
646 * can get the iops right before using them. 646 * can get the iops right before using them.
647 */ 647 */
648 648
649static void __devinit init_iops_siimage(ide_hwif_t *hwif) 649static void init_iops_siimage(ide_hwif_t *hwif)
650{ 650{
651 struct pci_dev *dev = to_pci_dev(hwif->dev); 651 struct pci_dev *dev = to_pci_dev(hwif->dev);
652 struct ide_host *host = pci_get_drvdata(dev); 652 struct ide_host *host = pci_get_drvdata(dev);
@@ -719,7 +719,7 @@ static const struct ide_dma_ops sil_dma_ops = {
719 .udma_mask = ATA_UDMA6, \ 719 .udma_mask = ATA_UDMA6, \
720 } 720 }
721 721
722static const struct ide_port_info siimage_chipsets[] __devinitconst = { 722static const struct ide_port_info siimage_chipsets[] = {
723 /* 0: SiI680 */ DECLARE_SII_DEV(&sil_pata_port_ops), 723 /* 0: SiI680 */ DECLARE_SII_DEV(&sil_pata_port_ops),
724 /* 1: SiI3112 */ DECLARE_SII_DEV(&sil_sata_port_ops) 724 /* 1: SiI3112 */ DECLARE_SII_DEV(&sil_sata_port_ops)
725}; 725};
@@ -733,8 +733,7 @@ static const struct ide_port_info siimage_chipsets[] __devinitconst = {
733 * We then use the IDE PCI generic helper to do most of the work. 733 * We then use the IDE PCI generic helper to do most of the work.
734 */ 734 */
735 735
736static int __devinit siimage_init_one(struct pci_dev *dev, 736static int siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id)
737 const struct pci_device_id *id)
738{ 737{
739 void __iomem *ioaddr = NULL; 738 void __iomem *ioaddr = NULL;
740 resource_size_t bar5 = pci_resource_start(dev, 5); 739 resource_size_t bar5 = pci_resource_start(dev, 5);
@@ -790,7 +789,7 @@ static int __devinit siimage_init_one(struct pci_dev *dev,
790 return rc; 789 return rc;
791} 790}
792 791
793static void __devexit siimage_remove(struct pci_dev *dev) 792static void siimage_remove(struct pci_dev *dev)
794{ 793{
795 struct ide_host *host = pci_get_drvdata(dev); 794 struct ide_host *host = pci_get_drvdata(dev);
796 void __iomem *ioaddr = host->host_priv; 795 void __iomem *ioaddr = host->host_priv;
@@ -822,7 +821,7 @@ static struct pci_driver siimage_pci_driver = {
822 .name = "SiI_IDE", 821 .name = "SiI_IDE",
823 .id_table = siimage_pci_tbl, 822 .id_table = siimage_pci_tbl,
824 .probe = siimage_init_one, 823 .probe = siimage_init_one,
825 .remove = __devexit_p(siimage_remove), 824 .remove = siimage_remove,
826 .suspend = ide_pci_suspend, 825 .suspend = ide_pci_suspend,
827 .resume = ide_pci_resume, 826 .resume = ide_pci_resume,
828}; 827};
diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c
index 09e61b4c5e9..247853ea136 100644
--- a/drivers/ide/sis5513.c
+++ b/drivers/ide/sis5513.c
@@ -362,7 +362,7 @@ static u8 sis_ata133_udma_filter(ide_drive_t *drive)
362 return (regdw & 0x08) ? ATA_UDMA6 : ATA_UDMA5; 362 return (regdw & 0x08) ? ATA_UDMA6 : ATA_UDMA5;
363} 363}
364 364
365static int __devinit sis_find_family(struct pci_dev *dev) 365static int sis_find_family(struct pci_dev *dev)
366{ 366{
367 struct pci_dev *host; 367 struct pci_dev *host;
368 int i = 0; 368 int i = 0;
@@ -563,7 +563,7 @@ static const struct ide_port_ops sis_ata133_port_ops = {
563 .cable_detect = sis_cable_detect, 563 .cable_detect = sis_cable_detect,
564}; 564};
565 565
566static const struct ide_port_info sis5513_chipset __devinitconst = { 566static const struct ide_port_info sis5513_chipset = {
567 .name = DRV_NAME, 567 .name = DRV_NAME,
568 .init_chipset = init_chipset_sis5513, 568 .init_chipset = init_chipset_sis5513,
569 .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} }, 569 .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} },
@@ -572,7 +572,7 @@ static const struct ide_port_info sis5513_chipset __devinitconst = {
572 .mwdma_mask = ATA_MWDMA2, 572 .mwdma_mask = ATA_MWDMA2,
573}; 573};
574 574
575static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id) 575static int sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
576{ 576{
577 struct ide_port_info d = sis5513_chipset; 577 struct ide_port_info d = sis5513_chipset;
578 u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; 578 u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };
@@ -595,7 +595,7 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi
595 return ide_pci_init_one(dev, &d, NULL); 595 return ide_pci_init_one(dev, &d, NULL);
596} 596}
597 597
598static void __devexit sis5513_remove(struct pci_dev *dev) 598static void sis5513_remove(struct pci_dev *dev)
599{ 599{
600 ide_pci_remove(dev); 600 ide_pci_remove(dev);
601 pci_disable_device(dev); 601 pci_disable_device(dev);
@@ -613,7 +613,7 @@ static struct pci_driver sis5513_pci_driver = {
613 .name = "SIS_IDE", 613 .name = "SIS_IDE",
614 .id_table = sis5513_pci_tbl, 614 .id_table = sis5513_pci_tbl,
615 .probe = sis5513_init_one, 615 .probe = sis5513_init_one,
616 .remove = __devexit_p(sis5513_remove), 616 .remove = sis5513_remove,
617 .suspend = ide_pci_suspend, 617 .suspend = ide_pci_suspend,
618 .resume = ide_pci_resume, 618 .resume = ide_pci_resume,
619}; 619};
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index d051cd224bd..8755df3330a 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -299,7 +299,7 @@ static const struct ide_dma_ops sl82c105_dma_ops = {
299 .dma_sff_read_status = ide_dma_sff_read_status, 299 .dma_sff_read_status = ide_dma_sff_read_status,
300}; 300};
301 301
302static const struct ide_port_info sl82c105_chipset __devinitconst = { 302static const struct ide_port_info sl82c105_chipset = {
303 .name = DRV_NAME, 303 .name = DRV_NAME,
304 .init_chipset = init_chipset_sl82c105, 304 .init_chipset = init_chipset_sl82c105,
305 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, 305 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
@@ -313,7 +313,7 @@ static const struct ide_port_info sl82c105_chipset __devinitconst = {
313 .mwdma_mask = ATA_MWDMA2, 313 .mwdma_mask = ATA_MWDMA2,
314}; 314};
315 315
316static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id) 316static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
317{ 317{
318 struct ide_port_info d = sl82c105_chipset; 318 struct ide_port_info d = sl82c105_chipset;
319 u8 rev = sl82c105_bridge_revision(dev); 319 u8 rev = sl82c105_bridge_revision(dev);
diff --git a/drivers/ide/slc90e66.c b/drivers/ide/slc90e66.c
index 863a5e9283c..8af92bbb3dc 100644
--- a/drivers/ide/slc90e66.c
+++ b/drivers/ide/slc90e66.c
@@ -132,7 +132,7 @@ static const struct ide_port_ops slc90e66_port_ops = {
132 .cable_detect = slc90e66_cable_detect, 132 .cable_detect = slc90e66_cable_detect,
133}; 133};
134 134
135static const struct ide_port_info slc90e66_chipset __devinitconst = { 135static const struct ide_port_info slc90e66_chipset = {
136 .name = DRV_NAME, 136 .name = DRV_NAME,
137 .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} }, 137 .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} },
138 .port_ops = &slc90e66_port_ops, 138 .port_ops = &slc90e66_port_ops,
@@ -142,7 +142,8 @@ static const struct ide_port_info slc90e66_chipset __devinitconst = {
142 .udma_mask = ATA_UDMA4, 142 .udma_mask = ATA_UDMA4,
143}; 143};
144 144
145static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id) 145static int slc90e66_init_one(struct pci_dev *dev,
146 const struct pci_device_id *id)
146{ 147{
147 return ide_pci_init_one(dev, &slc90e66_chipset, NULL); 148 return ide_pci_init_one(dev, &slc90e66_chipset, NULL);
148} 149}
diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c
index 17946785ebf..17e6132b99b 100644
--- a/drivers/ide/tc86c001.c
+++ b/drivers/ide/tc86c001.c
@@ -144,7 +144,7 @@ static u8 tc86c001_cable_detect(ide_hwif_t *hwif)
144 return (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 144 return (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
145} 145}
146 146
147static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) 147static void init_hwif_tc86c001(ide_hwif_t *hwif)
148{ 148{
149 struct pci_dev *dev = to_pci_dev(hwif->dev); 149 struct pci_dev *dev = to_pci_dev(hwif->dev);
150 unsigned long sc_base = pci_resource_start(dev, 5); 150 unsigned long sc_base = pci_resource_start(dev, 5);
@@ -192,7 +192,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = {
192 .dma_sff_read_status = ide_dma_sff_read_status, 192 .dma_sff_read_status = ide_dma_sff_read_status,
193}; 193};
194 194
195static const struct ide_port_info tc86c001_chipset __devinitconst = { 195static const struct ide_port_info tc86c001_chipset = {
196 .name = DRV_NAME, 196 .name = DRV_NAME,
197 .init_hwif = init_hwif_tc86c001, 197 .init_hwif = init_hwif_tc86c001,
198 .port_ops = &tc86c001_port_ops, 198 .port_ops = &tc86c001_port_ops,
@@ -203,8 +203,8 @@ static const struct ide_port_info tc86c001_chipset __devinitconst = {
203 .udma_mask = ATA_UDMA4, 203 .udma_mask = ATA_UDMA4,
204}; 204};
205 205
206static int __devinit tc86c001_init_one(struct pci_dev *dev, 206static int tc86c001_init_one(struct pci_dev *dev,
207 const struct pci_device_id *id) 207 const struct pci_device_id *id)
208{ 208{
209 int rc; 209 int rc;
210 210
@@ -232,7 +232,7 @@ out:
232 return rc; 232 return rc;
233} 233}
234 234
235static void __devexit tc86c001_remove(struct pci_dev *dev) 235static void tc86c001_remove(struct pci_dev *dev)
236{ 236{
237 ide_pci_remove(dev); 237 ide_pci_remove(dev);
238 pci_release_region(dev, 5); 238 pci_release_region(dev, 5);
@@ -249,7 +249,7 @@ static struct pci_driver tc86c001_pci_driver = {
249 .name = "TC86C001", 249 .name = "TC86C001",
250 .id_table = tc86c001_pci_tbl, 250 .id_table = tc86c001_pci_tbl,
251 .probe = tc86c001_init_one, 251 .probe = tc86c001_init_one,
252 .remove = __devexit_p(tc86c001_remove), 252 .remove = tc86c001_remove,
253}; 253};
254 254
255static int __init tc86c001_ide_init(void) 255static int __init tc86c001_ide_init(void)
diff --git a/drivers/ide/triflex.c b/drivers/ide/triflex.c
index 55ce1b80efc..7f1af9493f0 100644
--- a/drivers/ide/triflex.c
+++ b/drivers/ide/triflex.c
@@ -92,7 +92,7 @@ static const struct ide_port_ops triflex_port_ops = {
92 .set_dma_mode = triflex_set_mode, 92 .set_dma_mode = triflex_set_mode,
93}; 93};
94 94
95static const struct ide_port_info triflex_device __devinitconst = { 95static const struct ide_port_info triflex_device = {
96 .name = DRV_NAME, 96 .name = DRV_NAME,
97 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, 97 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
98 .port_ops = &triflex_port_ops, 98 .port_ops = &triflex_port_ops,
@@ -101,8 +101,7 @@ static const struct ide_port_info triflex_device __devinitconst = {
101 .mwdma_mask = ATA_MWDMA2, 101 .mwdma_mask = ATA_MWDMA2,
102}; 102};
103 103
104static int __devinit triflex_init_one(struct pci_dev *dev, 104static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
105 const struct pci_device_id *id)
106{ 105{
107 return ide_pci_init_one(dev, &triflex_device, NULL); 106 return ide_pci_init_one(dev, &triflex_device, NULL);
108} 107}
diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c
index e494a98a43a..0069f6ce74c 100644
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -231,7 +231,7 @@ static void trm290_dma_host_set(ide_drive_t *drive, int on)
231{ 231{
232} 232}
233 233
234static void __devinit init_hwif_trm290(ide_hwif_t *hwif) 234static void init_hwif_trm290(ide_hwif_t *hwif)
235{ 235{
236 struct pci_dev *dev = to_pci_dev(hwif->dev); 236 struct pci_dev *dev = to_pci_dev(hwif->dev);
237 unsigned int cfg_base = pci_resource_start(dev, 4); 237 unsigned int cfg_base = pci_resource_start(dev, 4);
@@ -324,7 +324,7 @@ static struct ide_dma_ops trm290_dma_ops = {
324 .dma_check = trm290_dma_check, 324 .dma_check = trm290_dma_check,
325}; 325};
326 326
327static const struct ide_port_info trm290_chipset __devinitconst = { 327static const struct ide_port_info trm290_chipset = {
328 .name = DRV_NAME, 328 .name = DRV_NAME,
329 .init_hwif = init_hwif_trm290, 329 .init_hwif = init_hwif_trm290,
330 .tp_ops = &trm290_tp_ops, 330 .tp_ops = &trm290_tp_ops,
@@ -338,7 +338,7 @@ static const struct ide_port_info trm290_chipset __devinitconst = {
338 IDE_HFLAG_NO_LBA48, 338 IDE_HFLAG_NO_LBA48,
339}; 339};
340 340
341static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id) 341static int trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id)
342{ 342{
343 return ide_pci_init_one(dev, &trm290_chipset, NULL); 343 return ide_pci_init_one(dev, &trm290_chipset, NULL);
344} 344}
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index eb7767864d1..01464f1e233 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -403,7 +403,7 @@ static const struct ide_port_ops via_port_ops = {
403 .cable_detect = via82cxxx_cable_detect, 403 .cable_detect = via82cxxx_cable_detect,
404}; 404};
405 405
406static const struct ide_port_info via82cxxx_chipset __devinitconst = { 406static const struct ide_port_info via82cxxx_chipset = {
407 .name = DRV_NAME, 407 .name = DRV_NAME,
408 .init_chipset = init_chipset_via82cxxx, 408 .init_chipset = init_chipset_via82cxxx,
409 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } }, 409 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
@@ -416,7 +416,7 @@ static const struct ide_port_info via82cxxx_chipset __devinitconst = {
416 .mwdma_mask = ATA_MWDMA2, 416 .mwdma_mask = ATA_MWDMA2,
417}; 417};
418 418
419static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id) 419static int via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
420{ 420{
421 struct pci_dev *isa = NULL; 421 struct pci_dev *isa = NULL;
422 struct via_isa_bridge *via_config; 422 struct via_isa_bridge *via_config;
@@ -489,7 +489,7 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
489 return rc; 489 return rc;
490} 490}
491 491
492static void __devexit via_remove(struct pci_dev *dev) 492static void via_remove(struct pci_dev *dev)
493{ 493{
494 struct ide_host *host = pci_get_drvdata(dev); 494 struct ide_host *host = pci_get_drvdata(dev);
495 struct via82cxxx_dev *vdev = host->host_priv; 495 struct via82cxxx_dev *vdev = host->host_priv;
@@ -514,7 +514,7 @@ static struct pci_driver via_pci_driver = {
514 .name = "VIA_IDE", 514 .name = "VIA_IDE",
515 .id_table = via_pci_tbl, 515 .id_table = via_pci_tbl,
516 .probe = via_init_one, 516 .probe = via_init_one,
517 .remove = __devexit_p(via_remove), 517 .remove = via_remove,
518 .suspend = ide_pci_suspend, 518 .suspend = ide_pci_suspend,
519 .resume = ide_pci_resume, 519 .resume = ide_pci_resume,
520}; 520};
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index c49c04d9c2b..4ba384f1ab5 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -506,7 +506,7 @@ static int intel_idle_cpuidle_driver_init(void)
506 if (*cpuidle_state_table[cstate].name == '\0') 506 if (*cpuidle_state_table[cstate].name == '\0')
507 pr_debug(PREFIX "unaware of model 0x%x" 507 pr_debug(PREFIX "unaware of model 0x%x"
508 " MWAIT %d please" 508 " MWAIT %d please"
509 " contact lenb@kernel.org", 509 " contact lenb@kernel.org\n",
510 boot_cpu_data.x86_model, cstate); 510 boot_cpu_data.x86_model, cstate);
511 continue; 511 continue;
512 } 512 }
diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
index fe4bcd7c5b1..05e996fafc9 100644
--- a/drivers/iio/accel/Kconfig
+++ b/drivers/iio/accel/Kconfig
@@ -8,6 +8,7 @@ config HID_SENSOR_ACCEL_3D
8 select IIO_BUFFER 8 select IIO_BUFFER
9 select IIO_TRIGGERED_BUFFER 9 select IIO_TRIGGERED_BUFFER
10 select HID_SENSOR_IIO_COMMON 10 select HID_SENSOR_IIO_COMMON
11 select HID_SENSOR_IIO_TRIGGER
11 tristate "HID Accelerometers 3D" 12 tristate "HID Accelerometers 3D"
12 help 13 help
13 Say yes here to build support for the HID SENSOR 14 Say yes here to build support for the HID SENSOR
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index e67bb912bd1..0b0c3c66f6c 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -278,7 +278,7 @@ static int accel_3d_parse_report(struct platform_device *pdev,
278} 278}
279 279
280/* Function to initialize the processing for usage id */ 280/* Function to initialize the processing for usage id */
281static int __devinit hid_accel_3d_probe(struct platform_device *pdev) 281static int hid_accel_3d_probe(struct platform_device *pdev)
282{ 282{
283 int ret = 0; 283 int ret = 0;
284 static const char *name = "accel_3d"; 284 static const char *name = "accel_3d";
@@ -375,7 +375,7 @@ error_ret:
375} 375}
376 376
377/* Function to deinitialize the processing for usage id */ 377/* Function to deinitialize the processing for usage id */
378static int __devinit hid_accel_3d_remove(struct platform_device *pdev) 378static int hid_accel_3d_remove(struct platform_device *pdev)
379{ 379{
380 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 380 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
381 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 381 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
index a6f4fc5f820..bbad9b94cd7 100644
--- a/drivers/iio/adc/ad7266.c
+++ b/drivers/iio/adc/ad7266.c
@@ -367,7 +367,7 @@ static const struct ad7266_chan_info ad7266_chan_infos[] = {
367 }, 367 },
368}; 368};
369 369
370static void __devinit ad7266_init_channels(struct iio_dev *indio_dev) 370static void ad7266_init_channels(struct iio_dev *indio_dev)
371{ 371{
372 struct ad7266_state *st = iio_priv(indio_dev); 372 struct ad7266_state *st = iio_priv(indio_dev);
373 bool is_differential, is_signed; 373 bool is_differential, is_signed;
@@ -391,7 +391,7 @@ static const char * const ad7266_gpio_labels[] = {
391 "AD0", "AD1", "AD2", 391 "AD0", "AD1", "AD2",
392}; 392};
393 393
394static int __devinit ad7266_probe(struct spi_device *spi) 394static int ad7266_probe(struct spi_device *spi)
395{ 395{
396 struct ad7266_platform_data *pdata = spi->dev.platform_data; 396 struct ad7266_platform_data *pdata = spi->dev.platform_data;
397 struct iio_dev *indio_dev; 397 struct iio_dev *indio_dev;
@@ -411,7 +411,11 @@ static int __devinit ad7266_probe(struct spi_device *spi)
411 if (ret) 411 if (ret)
412 goto error_put_reg; 412 goto error_put_reg;
413 413
414 st->vref_uv = regulator_get_voltage(st->reg); 414 ret = regulator_get_voltage(st->reg);
415 if (ret < 0)
416 goto error_disable_reg;
417
418 st->vref_uv = ret;
415 } else { 419 } else {
416 /* Use internal reference */ 420 /* Use internal reference */
417 st->vref_uv = 2500000; 421 st->vref_uv = 2500000;
@@ -494,7 +498,7 @@ error_put_reg:
494 return ret; 498 return ret;
495} 499}
496 500
497static int __devexit ad7266_remove(struct spi_device *spi) 501static int ad7266_remove(struct spi_device *spi)
498{ 502{
499 struct iio_dev *indio_dev = spi_get_drvdata(spi); 503 struct iio_dev *indio_dev = spi_get_drvdata(spi);
500 struct ad7266_state *st = iio_priv(indio_dev); 504 struct ad7266_state *st = iio_priv(indio_dev);
@@ -525,7 +529,7 @@ static struct spi_driver ad7266_driver = {
525 .owner = THIS_MODULE, 529 .owner = THIS_MODULE,
526 }, 530 },
527 .probe = ad7266_probe, 531 .probe = ad7266_probe,
528 .remove = __devexit_p(ad7266_remove), 532 .remove = ad7266_remove,
529 .id_table = ad7266_id, 533 .id_table = ad7266_id,
530}; 534};
531module_spi_driver(ad7266_driver); 535module_spi_driver(ad7266_driver);
diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c
index 2364807a5d6..b34d754994d 100644
--- a/drivers/iio/adc/ad7298.c
+++ b/drivers/iio/adc/ad7298.c
@@ -292,7 +292,7 @@ static const struct iio_info ad7298_info = {
292 .driver_module = THIS_MODULE, 292 .driver_module = THIS_MODULE,
293}; 293};
294 294
295static int __devinit ad7298_probe(struct spi_device *spi) 295static int ad7298_probe(struct spi_device *spi)
296{ 296{
297 struct ad7298_platform_data *pdata = spi->dev.platform_data; 297 struct ad7298_platform_data *pdata = spi->dev.platform_data;
298 struct ad7298_state *st; 298 struct ad7298_state *st;
@@ -370,7 +370,7 @@ error_free:
370 return ret; 370 return ret;
371} 371}
372 372
373static int __devexit ad7298_remove(struct spi_device *spi) 373static int ad7298_remove(struct spi_device *spi)
374{ 374{
375 struct iio_dev *indio_dev = spi_get_drvdata(spi); 375 struct iio_dev *indio_dev = spi_get_drvdata(spi);
376 struct ad7298_state *st = iio_priv(indio_dev); 376 struct ad7298_state *st = iio_priv(indio_dev);
@@ -398,7 +398,7 @@ static struct spi_driver ad7298_driver = {
398 .owner = THIS_MODULE, 398 .owner = THIS_MODULE,
399 }, 399 },
400 .probe = ad7298_probe, 400 .probe = ad7298_probe,
401 .remove = __devexit_p(ad7298_remove), 401 .remove = ad7298_remove,
402 .id_table = ad7298_id, 402 .id_table = ad7298_id,
403}; 403};
404module_spi_driver(ad7298_driver); 404module_spi_driver(ad7298_driver);
diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
index 330248bfeba..1491fa6debb 100644
--- a/drivers/iio/adc/ad7476.c
+++ b/drivers/iio/adc/ad7476.c
@@ -207,7 +207,7 @@ static const struct iio_info ad7476_info = {
207 .read_raw = &ad7476_read_raw, 207 .read_raw = &ad7476_read_raw,
208}; 208};
209 209
210static int __devinit ad7476_probe(struct spi_device *spi) 210static int ad7476_probe(struct spi_device *spi)
211{ 211{
212 struct ad7476_state *st; 212 struct ad7476_state *st;
213 struct iio_dev *indio_dev; 213 struct iio_dev *indio_dev;
@@ -277,7 +277,7 @@ error_ret:
277 return ret; 277 return ret;
278} 278}
279 279
280static int __devexit ad7476_remove(struct spi_device *spi) 280static int ad7476_remove(struct spi_device *spi)
281{ 281{
282 struct iio_dev *indio_dev = spi_get_drvdata(spi); 282 struct iio_dev *indio_dev = spi_get_drvdata(spi);
283 struct ad7476_state *st = iio_priv(indio_dev); 283 struct ad7476_state *st = iio_priv(indio_dev);
@@ -322,7 +322,7 @@ static struct spi_driver ad7476_driver = {
322 .owner = THIS_MODULE, 322 .owner = THIS_MODULE,
323 }, 323 },
324 .probe = ad7476_probe, 324 .probe = ad7476_probe,
325 .remove = __devexit_p(ad7476_remove), 325 .remove = ad7476_remove,
326 .id_table = ad7476_id, 326 .id_table = ad7476_id,
327}; 327};
328module_spi_driver(ad7476_driver); 328module_spi_driver(ad7476_driver);
diff --git a/drivers/iio/adc/ad7791.c b/drivers/iio/adc/ad7791.c
index e93740843b2..5e8d1da6887 100644
--- a/drivers/iio/adc/ad7791.c
+++ b/drivers/iio/adc/ad7791.c
@@ -325,8 +325,8 @@ static const struct iio_info ad7791_no_filter_info = {
325 .driver_module = THIS_MODULE, 325 .driver_module = THIS_MODULE,
326}; 326};
327 327
328static int __devinit ad7791_setup(struct ad7791_state *st, 328static int ad7791_setup(struct ad7791_state *st,
329 struct ad7791_platform_data *pdata) 329 struct ad7791_platform_data *pdata)
330{ 330{
331 /* Set to poweron-reset default values */ 331 /* Set to poweron-reset default values */
332 st->mode = AD7791_MODE_BUFFER; 332 st->mode = AD7791_MODE_BUFFER;
@@ -349,7 +349,7 @@ static int __devinit ad7791_setup(struct ad7791_state *st,
349 st->mode); 349 st->mode);
350} 350}
351 351
352static int __devinit ad7791_probe(struct spi_device *spi) 352static int ad7791_probe(struct spi_device *spi)
353{ 353{
354 struct ad7791_platform_data *pdata = spi->dev.platform_data; 354 struct ad7791_platform_data *pdata = spi->dev.platform_data;
355 struct iio_dev *indio_dev; 355 struct iio_dev *indio_dev;
@@ -418,7 +418,7 @@ err_iio_free:
418 return ret; 418 return ret;
419} 419}
420 420
421static int __devexit ad7791_remove(struct spi_device *spi) 421static int ad7791_remove(struct spi_device *spi)
422{ 422{
423 struct iio_dev *indio_dev = spi_get_drvdata(spi); 423 struct iio_dev *indio_dev = spi_get_drvdata(spi);
424 struct ad7791_state *st = iio_priv(indio_dev); 424 struct ad7791_state *st = iio_priv(indio_dev);
@@ -450,7 +450,7 @@ static struct spi_driver ad7791_driver = {
450 .owner = THIS_MODULE, 450 .owner = THIS_MODULE,
451 }, 451 },
452 .probe = ad7791_probe, 452 .probe = ad7791_probe,
453 .remove = __devexit_p(ad7791_remove), 453 .remove = ad7791_remove,
454 .id_table = ad7791_spi_ids, 454 .id_table = ad7791_spi_ids,
455}; 455};
456module_spi_driver(ad7791_driver); 456module_spi_driver(ad7791_driver);
diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c
index 81153fafac7..a33d5cd1a53 100644
--- a/drivers/iio/adc/ad7887.c
+++ b/drivers/iio/adc/ad7887.c
@@ -233,7 +233,7 @@ static const struct iio_info ad7887_info = {
233 .driver_module = THIS_MODULE, 233 .driver_module = THIS_MODULE,
234}; 234};
235 235
236static int __devinit ad7887_probe(struct spi_device *spi) 236static int ad7887_probe(struct spi_device *spi)
237{ 237{
238 struct ad7887_platform_data *pdata = spi->dev.platform_data; 238 struct ad7887_platform_data *pdata = spi->dev.platform_data;
239 struct ad7887_state *st; 239 struct ad7887_state *st;
@@ -340,7 +340,7 @@ error_free:
340 return ret; 340 return ret;
341} 341}
342 342
343static int __devexit ad7887_remove(struct spi_device *spi) 343static int ad7887_remove(struct spi_device *spi)
344{ 344{
345 struct iio_dev *indio_dev = spi_get_drvdata(spi); 345 struct iio_dev *indio_dev = spi_get_drvdata(spi);
346 struct ad7887_state *st = iio_priv(indio_dev); 346 struct ad7887_state *st = iio_priv(indio_dev);
@@ -368,7 +368,7 @@ static struct spi_driver ad7887_driver = {
368 .owner = THIS_MODULE, 368 .owner = THIS_MODULE,
369 }, 369 },
370 .probe = ad7887_probe, 370 .probe = ad7887_probe,
371 .remove = __devexit_p(ad7887_remove), 371 .remove = ad7887_remove,
372 .id_table = ad7887_id, 372 .id_table = ad7887_id,
373}; 373};
374module_spi_driver(ad7887_driver); 374module_spi_driver(ad7887_driver);
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 03b85940f4b..a526c0e3aaa 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -80,7 +80,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
80 *timestamp = pf->timestamp; 80 *timestamp = pf->timestamp;
81 } 81 }
82 82
83 iio_push_to_buffers(indio_dev, (u8 *)st->buffer); 83 iio_push_to_buffers(idev, (u8 *)st->buffer);
84 84
85 iio_trigger_notify_done(idev->trig); 85 iio_trigger_notify_done(idev->trig);
86 86
@@ -514,7 +514,7 @@ static const struct iio_info at91_adc_info = {
514 .read_raw = &at91_adc_read_raw, 514 .read_raw = &at91_adc_read_raw,
515}; 515};
516 516
517static int __devinit at91_adc_probe(struct platform_device *pdev) 517static int at91_adc_probe(struct platform_device *pdev)
518{ 518{
519 unsigned int prsc, mstrclk, ticks, adc_clk; 519 unsigned int prsc, mstrclk, ticks, adc_clk;
520 int ret; 520 int ret;
@@ -678,7 +678,7 @@ error_ret:
678 return ret; 678 return ret;
679} 679}
680 680
681static int __devexit at91_adc_remove(struct platform_device *pdev) 681static int at91_adc_remove(struct platform_device *pdev)
682{ 682{
683 struct iio_dev *idev = platform_get_drvdata(pdev); 683 struct iio_dev *idev = platform_get_drvdata(pdev);
684 struct at91_adc_state *st = iio_priv(idev); 684 struct at91_adc_state *st = iio_priv(idev);
@@ -702,7 +702,7 @@ MODULE_DEVICE_TABLE(of, at91_adc_dt_ids);
702 702
703static struct platform_driver at91_adc_driver = { 703static struct platform_driver at91_adc_driver = {
704 .probe = at91_adc_probe, 704 .probe = at91_adc_probe,
705 .remove = __devexit_p(at91_adc_remove), 705 .remove = at91_adc_remove,
706 .driver = { 706 .driver = {
707 .name = "at91_adc", 707 .name = "at91_adc",
708 .of_match_table = of_match_ptr(at91_adc_dt_ids), 708 .of_match_table = of_match_ptr(at91_adc_dt_ids),
diff --git a/drivers/iio/adc/lp8788_adc.c b/drivers/iio/adc/lp8788_adc.c
index a93aaf0bb84..72955e45e9e 100644
--- a/drivers/iio/adc/lp8788_adc.c
+++ b/drivers/iio/adc/lp8788_adc.c
@@ -193,7 +193,7 @@ static inline void lp8788_iio_map_unregister(struct iio_dev *indio_dev,
193 iio_map_array_unregister(indio_dev, adc->map); 193 iio_map_array_unregister(indio_dev, adc->map);
194} 194}
195 195
196static int __devinit lp8788_adc_probe(struct platform_device *pdev) 196static int lp8788_adc_probe(struct platform_device *pdev)
197{ 197{
198 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); 198 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent);
199 struct iio_dev *indio_dev; 199 struct iio_dev *indio_dev;
@@ -236,7 +236,7 @@ err_iio_map:
236 return ret; 236 return ret;
237} 237}
238 238
239static int __devexit lp8788_adc_remove(struct platform_device *pdev) 239static int lp8788_adc_remove(struct platform_device *pdev)
240{ 240{
241 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 241 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
242 struct lp8788_adc *adc = iio_priv(indio_dev); 242 struct lp8788_adc *adc = iio_priv(indio_dev);
@@ -250,7 +250,7 @@ static int __devexit lp8788_adc_remove(struct platform_device *pdev)
250 250
251static struct platform_driver lp8788_adc_driver = { 251static struct platform_driver lp8788_adc_driver = {
252 .probe = lp8788_adc_probe, 252 .probe = lp8788_adc_probe,
253 .remove = __devexit_p(lp8788_adc_remove), 253 .remove = lp8788_adc_remove,
254 .driver = { 254 .driver = {
255 .name = LP8788_DEV_ADC, 255 .name = LP8788_DEV_ADC,
256 .owner = THIS_MODULE, 256 .owner = THIS_MODULE,
diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index 1e84b5b5509..03b25b3dc71 100644
--- a/drivers/iio/adc/max1363.c
+++ b/drivers/iio/adc/max1363.c
@@ -1402,7 +1402,7 @@ static int max1363_initial_setup(struct max1363_state *st)
1402 return max1363_set_scan_mode(st); 1402 return max1363_set_scan_mode(st);
1403} 1403}
1404 1404
1405static int __devinit max1363_alloc_scan_masks(struct iio_dev *indio_dev) 1405static int max1363_alloc_scan_masks(struct iio_dev *indio_dev)
1406{ 1406{
1407 struct max1363_state *st = iio_priv(indio_dev); 1407 struct max1363_state *st = iio_priv(indio_dev);
1408 unsigned long *masks; 1408 unsigned long *masks;
@@ -1525,8 +1525,8 @@ static void max1363_buffer_cleanup(struct iio_dev *indio_dev)
1525 iio_kfifo_free(indio_dev->buffer); 1525 iio_kfifo_free(indio_dev->buffer);
1526} 1526}
1527 1527
1528static int __devinit max1363_probe(struct i2c_client *client, 1528static int max1363_probe(struct i2c_client *client,
1529 const struct i2c_device_id *id) 1529 const struct i2c_device_id *id)
1530{ 1530{
1531 int ret; 1531 int ret;
1532 struct max1363_state *st; 1532 struct max1363_state *st;
@@ -1605,26 +1605,27 @@ static int __devinit max1363_probe(struct i2c_client *client,
1605 1605
1606 return 0; 1606 return 0;
1607error_free_irq: 1607error_free_irq:
1608 free_irq(st->client->irq, indio_dev); 1608 if (client->irq)
1609 free_irq(st->client->irq, indio_dev);
1609error_uninit_buffer: 1610error_uninit_buffer:
1610 iio_buffer_unregister(indio_dev); 1611 iio_buffer_unregister(indio_dev);
1611error_cleanup_buffer: 1612error_cleanup_buffer:
1612 max1363_buffer_cleanup(indio_dev); 1613 max1363_buffer_cleanup(indio_dev);
1613error_free_available_scan_masks: 1614error_free_available_scan_masks:
1614 kfree(indio_dev->available_scan_masks); 1615 kfree(indio_dev->available_scan_masks);
1615error_unregister_map:
1616 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1617error_disable_reg: 1616error_disable_reg:
1618 regulator_disable(st->reg); 1617 regulator_disable(st->reg);
1619error_put_reg: 1618error_put_reg:
1620 regulator_put(st->reg); 1619 regulator_put(st->reg);
1620error_unregister_map:
1621 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1621error_free_device: 1622error_free_device:
1622 iio_device_free(indio_dev); 1623 iio_device_free(indio_dev);
1623error_out: 1624error_out:
1624 return ret; 1625 return ret;
1625} 1626}
1626 1627
1627static int __devexit max1363_remove(struct i2c_client *client) 1628static int max1363_remove(struct i2c_client *client)
1628{ 1629{
1629 struct iio_dev *indio_dev = i2c_get_clientdata(client); 1630 struct iio_dev *indio_dev = i2c_get_clientdata(client);
1630 struct max1363_state *st = iio_priv(indio_dev); 1631 struct max1363_state *st = iio_priv(indio_dev);
@@ -1635,10 +1636,8 @@ static int __devexit max1363_remove(struct i2c_client *client)
1635 iio_buffer_unregister(indio_dev); 1636 iio_buffer_unregister(indio_dev);
1636 max1363_buffer_cleanup(indio_dev); 1637 max1363_buffer_cleanup(indio_dev);
1637 kfree(indio_dev->available_scan_masks); 1638 kfree(indio_dev->available_scan_masks);
1638 if (!IS_ERR(st->reg)) { 1639 regulator_disable(st->reg);
1639 regulator_disable(st->reg); 1640 regulator_put(st->reg);
1640 regulator_put(st->reg);
1641 }
1642 iio_map_array_unregister(indio_dev, client->dev.platform_data); 1641 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1643 iio_device_free(indio_dev); 1642 iio_device_free(indio_dev);
1644 1643
@@ -1690,7 +1689,7 @@ static struct i2c_driver max1363_driver = {
1690 .name = "max1363", 1689 .name = "max1363",
1691 }, 1690 },
1692 .probe = max1363_probe, 1691 .probe = max1363_probe,
1693 .remove = __devexit_p(max1363_remove), 1692 .remove = max1363_remove,
1694 .id_table = max1363_id, 1693 .id_table = max1363_id,
1695}; 1694};
1696module_i2c_driver(max1363_driver); 1695module_i2c_driver(max1363_driver);
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 02a43c87a8a..cd030e100c3 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -136,7 +136,7 @@ static const struct iio_info tiadc_info = {
136 .read_raw = &tiadc_read_raw, 136 .read_raw = &tiadc_read_raw,
137}; 137};
138 138
139static int __devinit tiadc_probe(struct platform_device *pdev) 139static int tiadc_probe(struct platform_device *pdev)
140{ 140{
141 struct iio_dev *indio_dev; 141 struct iio_dev *indio_dev;
142 struct tiadc_device *adc_dev; 142 struct tiadc_device *adc_dev;
@@ -188,7 +188,7 @@ err_ret:
188 return err; 188 return err;
189} 189}
190 190
191static int __devexit tiadc_remove(struct platform_device *pdev) 191static int tiadc_remove(struct platform_device *pdev)
192{ 192{
193 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 193 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
194 194
@@ -250,7 +250,7 @@ static struct platform_driver tiadc_driver = {
250 .pm = TIADC_PM_OPS, 250 .pm = TIADC_PM_OPS,
251 }, 251 },
252 .probe = tiadc_probe, 252 .probe = tiadc_probe,
253 .remove = __devexit_p(tiadc_remove), 253 .remove = tiadc_remove,
254}; 254};
255 255
256module_platform_driver(tiadc_driver); 256module_platform_driver(tiadc_driver);
diff --git a/drivers/iio/adc/viperboard_adc.c b/drivers/iio/adc/viperboard_adc.c
index 10136a8b20d..ad0261533de 100644
--- a/drivers/iio/adc/viperboard_adc.c
+++ b/drivers/iio/adc/viperboard_adc.c
@@ -116,7 +116,7 @@ static const struct iio_info vprbrd_adc_iio_info = {
116 .driver_module = THIS_MODULE, 116 .driver_module = THIS_MODULE,
117}; 117};
118 118
119static int __devinit vprbrd_adc_probe(struct platform_device *pdev) 119static int vprbrd_adc_probe(struct platform_device *pdev)
120{ 120{
121 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent); 121 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent);
122 struct vprbrd_adc *adc; 122 struct vprbrd_adc *adc;
@@ -154,7 +154,7 @@ error:
154 return ret; 154 return ret;
155} 155}
156 156
157static int __devexit vprbrd_adc_remove(struct platform_device *pdev) 157static int vprbrd_adc_remove(struct platform_device *pdev)
158{ 158{
159 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 159 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
160 160
@@ -170,7 +170,7 @@ static struct platform_driver vprbrd_adc_driver = {
170 .owner = THIS_MODULE, 170 .owner = THIS_MODULE,
171 }, 171 },
172 .probe = vprbrd_adc_probe, 172 .probe = vprbrd_adc_probe,
173 .remove = __devexit_p(vprbrd_adc_remove), 173 .remove = vprbrd_adc_remove,
174}; 174};
175 175
176module_platform_driver(vprbrd_adc_driver); 176module_platform_driver(vprbrd_adc_driver);
diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index d8281cdbfc4..d6c0af23a2a 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -133,7 +133,7 @@ static const struct iio_chan_spec ad8366_channels[] = {
133 AD8366_CHAN(1), 133 AD8366_CHAN(1),
134}; 134};
135 135
136static int __devinit ad8366_probe(struct spi_device *spi) 136static int ad8366_probe(struct spi_device *spi)
137{ 137{
138 struct iio_dev *indio_dev; 138 struct iio_dev *indio_dev;
139 struct ad8366_state *st; 139 struct ad8366_state *st;
@@ -182,7 +182,7 @@ error_put_reg:
182 return ret; 182 return ret;
183} 183}
184 184
185static int __devexit ad8366_remove(struct spi_device *spi) 185static int ad8366_remove(struct spi_device *spi)
186{ 186{
187 struct iio_dev *indio_dev = spi_get_drvdata(spi); 187 struct iio_dev *indio_dev = spi_get_drvdata(spi);
188 struct ad8366_state *st = iio_priv(indio_dev); 188 struct ad8366_state *st = iio_priv(indio_dev);
@@ -211,7 +211,7 @@ static struct spi_driver ad8366_driver = {
211 .owner = THIS_MODULE, 211 .owner = THIS_MODULE,
212 }, 212 },
213 .probe = ad8366_probe, 213 .probe = ad8366_probe,
214 .remove = __devexit_p(ad8366_remove), 214 .remove = ad8366_remove,
215 .id_table = ad8366_id, 215 .id_table = ad8366_id,
216}; 216};
217 217
diff --git a/drivers/iio/common/hid-sensors/Kconfig b/drivers/iio/common/hid-sensors/Kconfig
index ae10778da7a..1178121b55b 100644
--- a/drivers/iio/common/hid-sensors/Kconfig
+++ b/drivers/iio/common/hid-sensors/Kconfig
@@ -6,7 +6,7 @@ menu "Hid Sensor IIO Common"
6config HID_SENSOR_IIO_COMMON 6config HID_SENSOR_IIO_COMMON
7 tristate "Common modules for all HID Sensor IIO drivers" 7 tristate "Common modules for all HID Sensor IIO drivers"
8 depends on HID_SENSOR_HUB 8 depends on HID_SENSOR_HUB
9 select IIO_TRIGGER if IIO_BUFFER 9 select HID_SENSOR_IIO_TRIGGER if IIO_BUFFER
10 help 10 help
11 Say yes here to build support for HID sensor to use 11 Say yes here to build support for HID sensor to use
12 HID sensor common processing for attributes and IIO triggers. 12 HID sensor common processing for attributes and IIO triggers.
@@ -14,6 +14,17 @@ config HID_SENSOR_IIO_COMMON
14 HID sensor drivers, this module contains processing for those 14 HID sensor drivers, this module contains processing for those
15 attributes. 15 attributes.
16 16
17config HID_SENSOR_IIO_TRIGGER
18 tristate "Common module (trigger) for all HID Sensor IIO drivers"
19 depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON
20 select IIO_TRIGGER
21 help
22 Say yes here to build trigger support for HID sensors.
23 Triggers will be send if all requested attributes were read.
24
25 If this driver is compiled as a module, it will be named
26 hid-sensor-trigger.
27
17config HID_SENSOR_ENUM_BASE_QUIRKS 28config HID_SENSOR_ENUM_BASE_QUIRKS
18 bool "ENUM base quirks for HID Sensor IIO drivers" 29 bool "ENUM base quirks for HID Sensor IIO drivers"
19 depends on HID_SENSOR_IIO_COMMON 30 depends on HID_SENSOR_IIO_COMMON
diff --git a/drivers/iio/common/hid-sensors/Makefile b/drivers/iio/common/hid-sensors/Makefile
index 1f463e00c24..22e7c5a8232 100644
--- a/drivers/iio/common/hid-sensors/Makefile
+++ b/drivers/iio/common/hid-sensors/Makefile
@@ -3,4 +3,5 @@
3# 3#
4 4
5obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-iio-common.o 5obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-iio-common.o
6hid-sensor-iio-common-y := hid-sensor-attributes.o hid-sensor-trigger.o 6obj-$(CONFIG_HID_SENSOR_IIO_TRIGGER) += hid-sensor-trigger.o
7hid-sensor-iio-common-y := hid-sensor-attributes.o
diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
index eb281a2c295..2fe1d4edcb2 100644
--- a/drivers/iio/dac/ad5064.c
+++ b/drivers/iio/dac/ad5064.c
@@ -424,8 +424,8 @@ static const char * const ad5064_vref_name(struct ad5064_state *st,
424 return st->chip_info->shared_vref ? "vref" : ad5064_vref_names[vref]; 424 return st->chip_info->shared_vref ? "vref" : ad5064_vref_names[vref];
425} 425}
426 426
427static int __devinit ad5064_probe(struct device *dev, enum ad5064_type type, 427static int ad5064_probe(struct device *dev, enum ad5064_type type,
428 const char *name, ad5064_write_func write) 428 const char *name, ad5064_write_func write)
429{ 429{
430 struct iio_dev *indio_dev; 430 struct iio_dev *indio_dev;
431 struct ad5064_state *st; 431 struct ad5064_state *st;
@@ -495,7 +495,7 @@ error_free:
495 return ret; 495 return ret;
496} 496}
497 497
498static int __devexit ad5064_remove(struct device *dev) 498static int ad5064_remove(struct device *dev)
499{ 499{
500 struct iio_dev *indio_dev = dev_get_drvdata(dev); 500 struct iio_dev *indio_dev = dev_get_drvdata(dev);
501 struct ad5064_state *st = iio_priv(indio_dev); 501 struct ad5064_state *st = iio_priv(indio_dev);
@@ -523,7 +523,7 @@ static int ad5064_spi_write(struct ad5064_state *st, unsigned int cmd,
523 return spi_write(spi, &st->data.spi, sizeof(st->data.spi)); 523 return spi_write(spi, &st->data.spi, sizeof(st->data.spi));
524} 524}
525 525
526static int __devinit ad5064_spi_probe(struct spi_device *spi) 526static int ad5064_spi_probe(struct spi_device *spi)
527{ 527{
528 const struct spi_device_id *id = spi_get_device_id(spi); 528 const struct spi_device_id *id = spi_get_device_id(spi);
529 529
@@ -531,7 +531,7 @@ static int __devinit ad5064_spi_probe(struct spi_device *spi)
531 ad5064_spi_write); 531 ad5064_spi_write);
532} 532}
533 533
534static int __devexit ad5064_spi_remove(struct spi_device *spi) 534static int ad5064_spi_remove(struct spi_device *spi)
535{ 535{
536 return ad5064_remove(&spi->dev); 536 return ad5064_remove(&spi->dev);
537} 537}
@@ -563,7 +563,7 @@ static struct spi_driver ad5064_spi_driver = {
563 .owner = THIS_MODULE, 563 .owner = THIS_MODULE,
564 }, 564 },
565 .probe = ad5064_spi_probe, 565 .probe = ad5064_spi_probe,
566 .remove = __devexit_p(ad5064_spi_remove), 566 .remove = ad5064_spi_remove,
567 .id_table = ad5064_spi_ids, 567 .id_table = ad5064_spi_ids,
568}; 568};
569 569
@@ -596,14 +596,14 @@ static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd,
596 return i2c_master_send(i2c, st->data.i2c, 3); 596 return i2c_master_send(i2c, st->data.i2c, 3);
597} 597}
598 598
599static int __devinit ad5064_i2c_probe(struct i2c_client *i2c, 599static int ad5064_i2c_probe(struct i2c_client *i2c,
600 const struct i2c_device_id *id) 600 const struct i2c_device_id *id)
601{ 601{
602 return ad5064_probe(&i2c->dev, id->driver_data, id->name, 602 return ad5064_probe(&i2c->dev, id->driver_data, id->name,
603 ad5064_i2c_write); 603 ad5064_i2c_write);
604} 604}
605 605
606static int __devexit ad5064_i2c_remove(struct i2c_client *i2c) 606static int ad5064_i2c_remove(struct i2c_client *i2c)
607{ 607{
608 return ad5064_remove(&i2c->dev); 608 return ad5064_remove(&i2c->dev);
609} 609}
@@ -625,7 +625,7 @@ static struct i2c_driver ad5064_i2c_driver = {
625 .owner = THIS_MODULE, 625 .owner = THIS_MODULE,
626 }, 626 },
627 .probe = ad5064_i2c_probe, 627 .probe = ad5064_i2c_probe,
628 .remove = __devexit_p(ad5064_i2c_remove), 628 .remove = ad5064_i2c_remove,
629 .id_table = ad5064_i2c_ids, 629 .id_table = ad5064_i2c_ids,
630}; 630};
631 631
diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c
index 8fce84fe70b..54b46fd3aed 100644
--- a/drivers/iio/dac/ad5360.c
+++ b/drivers/iio/dac/ad5360.c
@@ -433,7 +433,7 @@ static const char * const ad5360_vref_name[] = {
433 "vref0", "vref1", "vref2" 433 "vref0", "vref1", "vref2"
434}; 434};
435 435
436static int __devinit ad5360_alloc_channels(struct iio_dev *indio_dev) 436static int ad5360_alloc_channels(struct iio_dev *indio_dev)
437{ 437{
438 struct ad5360_state *st = iio_priv(indio_dev); 438 struct ad5360_state *st = iio_priv(indio_dev);
439 struct iio_chan_spec *channels; 439 struct iio_chan_spec *channels;
@@ -456,7 +456,7 @@ static int __devinit ad5360_alloc_channels(struct iio_dev *indio_dev)
456 return 0; 456 return 0;
457} 457}
458 458
459static int __devinit ad5360_probe(struct spi_device *spi) 459static int ad5360_probe(struct spi_device *spi)
460{ 460{
461 enum ad5360_type type = spi_get_device_id(spi)->driver_data; 461 enum ad5360_type type = spi_get_device_id(spi)->driver_data;
462 struct iio_dev *indio_dev; 462 struct iio_dev *indio_dev;
@@ -524,7 +524,7 @@ error_free:
524 return ret; 524 return ret;
525} 525}
526 526
527static int __devexit ad5360_remove(struct spi_device *spi) 527static int ad5360_remove(struct spi_device *spi)
528{ 528{
529 struct iio_dev *indio_dev = spi_get_drvdata(spi); 529 struct iio_dev *indio_dev = spi_get_drvdata(spi);
530 struct ad5360_state *st = iio_priv(indio_dev); 530 struct ad5360_state *st = iio_priv(indio_dev);
@@ -560,7 +560,7 @@ static struct spi_driver ad5360_driver = {
560 .owner = THIS_MODULE, 560 .owner = THIS_MODULE,
561 }, 561 },
562 .probe = ad5360_probe, 562 .probe = ad5360_probe,
563 .remove = __devexit_p(ad5360_remove), 563 .remove = ad5360_remove,
564 .id_table = ad5360_ids, 564 .id_table = ad5360_ids,
565}; 565};
566module_spi_driver(ad5360_driver); 566module_spi_driver(ad5360_driver);
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
index 14991ac55f2..483fc379a2d 100644
--- a/drivers/iio/dac/ad5380.c
+++ b/drivers/iio/dac/ad5380.c
@@ -338,7 +338,7 @@ static const struct ad5380_chip_info ad5380_chip_info_tbl[] = {
338 }, 338 },
339}; 339};
340 340
341static int __devinit ad5380_alloc_channels(struct iio_dev *indio_dev) 341static int ad5380_alloc_channels(struct iio_dev *indio_dev)
342{ 342{
343 struct ad5380_state *st = iio_priv(indio_dev); 343 struct ad5380_state *st = iio_priv(indio_dev);
344 struct iio_chan_spec *channels; 344 struct iio_chan_spec *channels;
@@ -361,8 +361,8 @@ static int __devinit ad5380_alloc_channels(struct iio_dev *indio_dev)
361 return 0; 361 return 0;
362} 362}
363 363
364static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap, 364static int ad5380_probe(struct device *dev, struct regmap *regmap,
365 enum ad5380_type type, const char *name) 365 enum ad5380_type type, const char *name)
366{ 366{
367 struct iio_dev *indio_dev; 367 struct iio_dev *indio_dev;
368 struct ad5380_state *st; 368 struct ad5380_state *st;
@@ -406,7 +406,11 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
406 goto error_free_reg; 406 goto error_free_reg;
407 } 407 }
408 408
409 st->vref = regulator_get_voltage(st->vref_reg); 409 ret = regulator_get_voltage(st->vref_reg);
410 if (ret < 0)
411 goto error_disable_reg;
412
413 st->vref = ret;
410 } else { 414 } else {
411 st->vref = st->chip_info->int_vref; 415 st->vref = st->chip_info->int_vref;
412 ctrl |= AD5380_CTRL_INT_VREF_EN; 416 ctrl |= AD5380_CTRL_INT_VREF_EN;
@@ -441,7 +445,7 @@ error_out:
441 return ret; 445 return ret;
442} 446}
443 447
444static int __devexit ad5380_remove(struct device *dev) 448static int ad5380_remove(struct device *dev)
445{ 449{
446 struct iio_dev *indio_dev = dev_get_drvdata(dev); 450 struct iio_dev *indio_dev = dev_get_drvdata(dev);
447 struct ad5380_state *st = iio_priv(indio_dev); 451 struct ad5380_state *st = iio_priv(indio_dev);
@@ -478,7 +482,7 @@ static const struct regmap_config ad5380_regmap_config = {
478 482
479#if IS_ENABLED(CONFIG_SPI_MASTER) 483#if IS_ENABLED(CONFIG_SPI_MASTER)
480 484
481static int __devinit ad5380_spi_probe(struct spi_device *spi) 485static int ad5380_spi_probe(struct spi_device *spi)
482{ 486{
483 const struct spi_device_id *id = spi_get_device_id(spi); 487 const struct spi_device_id *id = spi_get_device_id(spi);
484 struct regmap *regmap; 488 struct regmap *regmap;
@@ -491,7 +495,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi)
491 return ad5380_probe(&spi->dev, regmap, id->driver_data, id->name); 495 return ad5380_probe(&spi->dev, regmap, id->driver_data, id->name);
492} 496}
493 497
494static int __devexit ad5380_spi_remove(struct spi_device *spi) 498static int ad5380_spi_remove(struct spi_device *spi)
495{ 499{
496 return ad5380_remove(&spi->dev); 500 return ad5380_remove(&spi->dev);
497} 501}
@@ -523,7 +527,7 @@ static struct spi_driver ad5380_spi_driver = {
523 .owner = THIS_MODULE, 527 .owner = THIS_MODULE,
524 }, 528 },
525 .probe = ad5380_spi_probe, 529 .probe = ad5380_spi_probe,
526 .remove = __devexit_p(ad5380_spi_remove), 530 .remove = ad5380_spi_remove,
527 .id_table = ad5380_spi_ids, 531 .id_table = ad5380_spi_ids,
528}; 532};
529 533
@@ -552,8 +556,8 @@ static inline void ad5380_spi_unregister_driver(void)
552 556
553#if IS_ENABLED(CONFIG_I2C) 557#if IS_ENABLED(CONFIG_I2C)
554 558
555static int __devinit ad5380_i2c_probe(struct i2c_client *i2c, 559static int ad5380_i2c_probe(struct i2c_client *i2c,
556 const struct i2c_device_id *id) 560 const struct i2c_device_id *id)
557{ 561{
558 struct regmap *regmap; 562 struct regmap *regmap;
559 563
@@ -565,7 +569,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c,
565 return ad5380_probe(&i2c->dev, regmap, id->driver_data, id->name); 569 return ad5380_probe(&i2c->dev, regmap, id->driver_data, id->name);
566} 570}
567 571
568static int __devexit ad5380_i2c_remove(struct i2c_client *i2c) 572static int ad5380_i2c_remove(struct i2c_client *i2c)
569{ 573{
570 return ad5380_remove(&i2c->dev); 574 return ad5380_remove(&i2c->dev);
571} 575}
@@ -597,7 +601,7 @@ static struct i2c_driver ad5380_i2c_driver = {
597 .owner = THIS_MODULE, 601 .owner = THIS_MODULE,
598 }, 602 },
599 .probe = ad5380_i2c_probe, 603 .probe = ad5380_i2c_probe,
600 .remove = __devexit_p(ad5380_i2c_remove), 604 .remove = ad5380_i2c_remove,
601 .id_table = ad5380_i2c_ids, 605 .id_table = ad5380_i2c_ids,
602}; 606};
603 607
diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c
index cdbc5bf25c3..43be948db83 100644
--- a/drivers/iio/dac/ad5421.c
+++ b/drivers/iio/dac/ad5421.c
@@ -449,7 +449,7 @@ static const struct iio_info ad5421_info = {
449 .driver_module = THIS_MODULE, 449 .driver_module = THIS_MODULE,
450}; 450};
451 451
452static int __devinit ad5421_probe(struct spi_device *spi) 452static int ad5421_probe(struct spi_device *spi)
453{ 453{
454 struct ad5421_platform_data *pdata = dev_get_platdata(&spi->dev); 454 struct ad5421_platform_data *pdata = dev_get_platdata(&spi->dev);
455 struct iio_dev *indio_dev; 455 struct iio_dev *indio_dev;
@@ -516,7 +516,7 @@ error_free:
516 return ret; 516 return ret;
517} 517}
518 518
519static int __devexit ad5421_remove(struct spi_device *spi) 519static int ad5421_remove(struct spi_device *spi)
520{ 520{
521 struct iio_dev *indio_dev = spi_get_drvdata(spi); 521 struct iio_dev *indio_dev = spi_get_drvdata(spi);
522 522
@@ -534,7 +534,7 @@ static struct spi_driver ad5421_driver = {
534 .owner = THIS_MODULE, 534 .owner = THIS_MODULE,
535 }, 535 },
536 .probe = ad5421_probe, 536 .probe = ad5421_probe,
537 .remove = __devexit_p(ad5421_remove), 537 .remove = ad5421_remove,
538}; 538};
539module_spi_driver(ad5421_driver); 539module_spi_driver(ad5421_driver);
540 540
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index 3310cbbd41e..f5583aedfb5 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -212,8 +212,8 @@ static const struct iio_info ad5446_info = {
212 .driver_module = THIS_MODULE, 212 .driver_module = THIS_MODULE,
213}; 213};
214 214
215static int __devinit ad5446_probe(struct device *dev, const char *name, 215static int ad5446_probe(struct device *dev, const char *name,
216 const struct ad5446_chip_info *chip_info) 216 const struct ad5446_chip_info *chip_info)
217{ 217{
218 struct ad5446_state *st; 218 struct ad5446_state *st;
219 struct iio_dev *indio_dev; 219 struct iio_dev *indio_dev;
@@ -226,7 +226,11 @@ static int __devinit ad5446_probe(struct device *dev, const char *name,
226 if (ret) 226 if (ret)
227 goto error_put_reg; 227 goto error_put_reg;
228 228
229 voltage_uv = regulator_get_voltage(reg); 229 ret = regulator_get_voltage(reg);
230 if (ret < 0)
231 goto error_disable_reg;
232
233 voltage_uv = ret;
230 } 234 }
231 235
232 indio_dev = iio_device_alloc(sizeof(*st)); 236 indio_dev = iio_device_alloc(sizeof(*st));
@@ -461,7 +465,7 @@ static const struct spi_device_id ad5446_spi_ids[] = {
461}; 465};
462MODULE_DEVICE_TABLE(spi, ad5446_spi_ids); 466MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);
463 467
464static int __devinit ad5446_spi_probe(struct spi_device *spi) 468static int ad5446_spi_probe(struct spi_device *spi)
465{ 469{
466 const struct spi_device_id *id = spi_get_device_id(spi); 470 const struct spi_device_id *id = spi_get_device_id(spi);
467 471
@@ -469,7 +473,7 @@ static int __devinit ad5446_spi_probe(struct spi_device *spi)
469 &ad5446_spi_chip_info[id->driver_data]); 473 &ad5446_spi_chip_info[id->driver_data]);
470} 474}
471 475
472static int __devexit ad5446_spi_remove(struct spi_device *spi) 476static int ad5446_spi_remove(struct spi_device *spi)
473{ 477{
474 return ad5446_remove(&spi->dev); 478 return ad5446_remove(&spi->dev);
475} 479}
@@ -480,7 +484,7 @@ static struct spi_driver ad5446_spi_driver = {
480 .owner = THIS_MODULE, 484 .owner = THIS_MODULE,
481 }, 485 },
482 .probe = ad5446_spi_probe, 486 .probe = ad5446_spi_probe,
483 .remove = __devexit_p(ad5446_spi_remove), 487 .remove = ad5446_spi_remove,
484 .id_table = ad5446_spi_ids, 488 .id_table = ad5446_spi_ids,
485}; 489};
486 490
@@ -539,14 +543,14 @@ static const struct ad5446_chip_info ad5446_i2c_chip_info[] = {
539 }, 543 },
540}; 544};
541 545
542static int __devinit ad5446_i2c_probe(struct i2c_client *i2c, 546static int ad5446_i2c_probe(struct i2c_client *i2c,
543 const struct i2c_device_id *id) 547 const struct i2c_device_id *id)
544{ 548{
545 return ad5446_probe(&i2c->dev, id->name, 549 return ad5446_probe(&i2c->dev, id->name,
546 &ad5446_i2c_chip_info[id->driver_data]); 550 &ad5446_i2c_chip_info[id->driver_data]);
547} 551}
548 552
549static int __devexit ad5446_i2c_remove(struct i2c_client *i2c) 553static int ad5446_i2c_remove(struct i2c_client *i2c)
550{ 554{
551 return ad5446_remove(&i2c->dev); 555 return ad5446_remove(&i2c->dev);
552} 556}
@@ -568,7 +572,7 @@ static struct i2c_driver ad5446_i2c_driver = {
568 .owner = THIS_MODULE, 572 .owner = THIS_MODULE,
569 }, 573 },
570 .probe = ad5446_i2c_probe, 574 .probe = ad5446_i2c_probe,
571 .remove = __devexit_p(ad5446_i2c_remove), 575 .remove = ad5446_i2c_remove,
572 .id_table = ad5446_i2c_ids, 576 .id_table = ad5446_i2c_ids,
573}; 577};
574 578
diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index 0ee6f8eeba8..c4731b7b577 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -266,7 +266,7 @@ static const char *ad5449_vref_name(struct ad5449 *st, int n)
266 return "VREFB"; 266 return "VREFB";
267} 267}
268 268
269static int __devinit ad5449_spi_probe(struct spi_device *spi) 269static int ad5449_spi_probe(struct spi_device *spi)
270{ 270{
271 struct ad5449_platform_data *pdata = spi->dev.platform_data; 271 struct ad5449_platform_data *pdata = spi->dev.platform_data;
272 const struct spi_device_id *id = spi_get_device_id(spi); 272 const struct spi_device_id *id = spi_get_device_id(spi);
@@ -333,7 +333,7 @@ error_free:
333 return ret; 333 return ret;
334} 334}
335 335
336static int __devexit ad5449_spi_remove(struct spi_device *spi) 336static int ad5449_spi_remove(struct spi_device *spi)
337{ 337{
338 struct iio_dev *indio_dev = spi_get_drvdata(spi); 338 struct iio_dev *indio_dev = spi_get_drvdata(spi);
339 struct ad5449 *st = iio_priv(indio_dev); 339 struct ad5449 *st = iio_priv(indio_dev);
@@ -366,7 +366,7 @@ static struct spi_driver ad5449_spi_driver = {
366 .owner = THIS_MODULE, 366 .owner = THIS_MODULE,
367 }, 367 },
368 .probe = ad5449_spi_probe, 368 .probe = ad5449_spi_probe,
369 .remove = __devexit_p(ad5449_spi_remove), 369 .remove = ad5449_spi_remove,
370 .id_table = ad5449_spi_ids, 370 .id_table = ad5449_spi_ids,
371}; 371};
372module_spi_driver(ad5449_spi_driver); 372module_spi_driver(ad5449_spi_driver);
diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
index 242bdc7d004..0661829f277 100644
--- a/drivers/iio/dac/ad5504.c
+++ b/drivers/iio/dac/ad5504.c
@@ -277,7 +277,7 @@ static const struct iio_chan_spec ad5504_channels[] = {
277 AD5504_CHANNEL(3), 277 AD5504_CHANNEL(3),
278}; 278};
279 279
280static int __devinit ad5504_probe(struct spi_device *spi) 280static int ad5504_probe(struct spi_device *spi)
281{ 281{
282 struct ad5504_platform_data *pdata = spi->dev.platform_data; 282 struct ad5504_platform_data *pdata = spi->dev.platform_data;
283 struct iio_dev *indio_dev; 283 struct iio_dev *indio_dev;
@@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)
296 if (ret) 296 if (ret)
297 goto error_put_reg; 297 goto error_put_reg;
298 298
299 voltage_uv = regulator_get_voltage(reg); 299 ret = regulator_get_voltage(reg);
300 if (ret < 0)
301 goto error_disable_reg;
302
303 voltage_uv = ret;
300 } 304 }
301 305
302 spi_set_drvdata(spi, indio_dev); 306 spi_set_drvdata(spi, indio_dev);
@@ -352,7 +356,7 @@ error_ret:
352 return ret; 356 return ret;
353} 357}
354 358
355static int __devexit ad5504_remove(struct spi_device *spi) 359static int ad5504_remove(struct spi_device *spi)
356{ 360{
357 struct iio_dev *indio_dev = spi_get_drvdata(spi); 361 struct iio_dev *indio_dev = spi_get_drvdata(spi);
358 struct ad5504_state *st = iio_priv(indio_dev); 362 struct ad5504_state *st = iio_priv(indio_dev);
@@ -383,7 +387,7 @@ static struct spi_driver ad5504_driver = {
383 .owner = THIS_MODULE, 387 .owner = THIS_MODULE,
384 }, 388 },
385 .probe = ad5504_probe, 389 .probe = ad5504_probe,
386 .remove = __devexit_p(ad5504_remove), 390 .remove = ad5504_remove,
387 .id_table = ad5504_id, 391 .id_table = ad5504_id,
388}; 392};
389module_spi_driver(ad5504_driver); 393module_spi_driver(ad5504_driver);
diff --git a/drivers/iio/dac/ad5624r_spi.c b/drivers/iio/dac/ad5624r_spi.c
index 6a7d6a48cc6..f6e116627b7 100644
--- a/drivers/iio/dac/ad5624r_spi.c
+++ b/drivers/iio/dac/ad5624r_spi.c
@@ -220,7 +220,7 @@ static const struct ad5624r_chip_info ad5624r_chip_info_tbl[] = {
220 }, 220 },
221}; 221};
222 222
223static int __devinit ad5624r_probe(struct spi_device *spi) 223static int ad5624r_probe(struct spi_device *spi)
224{ 224{
225 struct ad5624r_state *st; 225 struct ad5624r_state *st;
226 struct iio_dev *indio_dev; 226 struct iio_dev *indio_dev;
@@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)
238 if (ret) 238 if (ret)
239 goto error_put_reg; 239 goto error_put_reg;
240 240
241 voltage_uv = regulator_get_voltage(st->reg); 241 ret = regulator_get_voltage(st->reg);
242 if (ret < 0)
243 goto error_disable_reg;
244
245 voltage_uv = ret;
242 } 246 }
243 247
244 spi_set_drvdata(spi, indio_dev); 248 spi_set_drvdata(spi, indio_dev);
@@ -282,7 +286,7 @@ error_ret:
282 return ret; 286 return ret;
283} 287}
284 288
285static int __devexit ad5624r_remove(struct spi_device *spi) 289static int ad5624r_remove(struct spi_device *spi)
286{ 290{
287 struct iio_dev *indio_dev = spi_get_drvdata(spi); 291 struct iio_dev *indio_dev = spi_get_drvdata(spi);
288 struct ad5624r_state *st = iio_priv(indio_dev); 292 struct ad5624r_state *st = iio_priv(indio_dev);
@@ -314,7 +318,7 @@ static struct spi_driver ad5624r_driver = {
314 .owner = THIS_MODULE, 318 .owner = THIS_MODULE,
315 }, 319 },
316 .probe = ad5624r_probe, 320 .probe = ad5624r_probe,
317 .remove = __devexit_p(ad5624r_remove), 321 .remove = ad5624r_remove,
318 .id_table = ad5624r_id, 322 .id_table = ad5624r_id,
319}; 323};
320module_spi_driver(ad5624r_driver); 324module_spi_driver(ad5624r_driver);
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
index bc92ff9309c..ca9609d7a15 100644
--- a/drivers/iio/dac/ad5686.c
+++ b/drivers/iio/dac/ad5686.c
@@ -313,7 +313,7 @@ static const struct ad5686_chip_info ad5686_chip_info_tbl[] = {
313}; 313};
314 314
315 315
316static int __devinit ad5686_probe(struct spi_device *spi) 316static int ad5686_probe(struct spi_device *spi)
317{ 317{
318 struct ad5686_state *st; 318 struct ad5686_state *st;
319 struct iio_dev *indio_dev; 319 struct iio_dev *indio_dev;
@@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)
332 if (ret) 332 if (ret)
333 goto error_put_reg; 333 goto error_put_reg;
334 334
335 voltage_uv = regulator_get_voltage(st->reg); 335 ret = regulator_get_voltage(st->reg);
336 if (ret < 0)
337 goto error_disable_reg;
338
339 voltage_uv = ret;
336 } 340 }
337 341
338 st->chip_info = 342 st->chip_info =
@@ -379,7 +383,7 @@ error_put_reg:
379 return ret; 383 return ret;
380} 384}
381 385
382static int __devexit ad5686_remove(struct spi_device *spi) 386static int ad5686_remove(struct spi_device *spi)
383{ 387{
384 struct iio_dev *indio_dev = spi_get_drvdata(spi); 388 struct iio_dev *indio_dev = spi_get_drvdata(spi);
385 struct ad5686_state *st = iio_priv(indio_dev); 389 struct ad5686_state *st = iio_priv(indio_dev);
@@ -408,7 +412,7 @@ static struct spi_driver ad5686_driver = {
408 .owner = THIS_MODULE, 412 .owner = THIS_MODULE,
409 }, 413 },
410 .probe = ad5686_probe, 414 .probe = ad5686_probe,
411 .remove = __devexit_p(ad5686_remove), 415 .remove = ad5686_remove,
412 .id_table = ad5686_id, 416 .id_table = ad5686_id,
413}; 417};
414module_spi_driver(ad5686_driver); 418module_spi_driver(ad5686_driver);
diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index 5db3506034c..0869bbd27d3 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -447,8 +447,8 @@ static bool ad5755_is_valid_mode(struct ad5755_state *st, enum ad5755_mode mode)
447 } 447 }
448} 448}
449 449
450static int __devinit ad5755_setup_pdata(struct iio_dev *indio_dev, 450static int ad5755_setup_pdata(struct iio_dev *indio_dev,
451 const struct ad5755_platform_data *pdata) 451 const struct ad5755_platform_data *pdata)
452{ 452{
453 struct ad5755_state *st = iio_priv(indio_dev); 453 struct ad5755_state *st = iio_priv(indio_dev);
454 unsigned int val; 454 unsigned int val;
@@ -503,7 +503,7 @@ static int __devinit ad5755_setup_pdata(struct iio_dev *indio_dev,
503 return 0; 503 return 0;
504} 504}
505 505
506static bool __devinit ad5755_is_voltage_mode(enum ad5755_mode mode) 506static bool ad5755_is_voltage_mode(enum ad5755_mode mode)
507{ 507{
508 switch (mode) { 508 switch (mode) {
509 case AD5755_MODE_VOLTAGE_0V_5V: 509 case AD5755_MODE_VOLTAGE_0V_5V:
@@ -516,8 +516,8 @@ static bool __devinit ad5755_is_voltage_mode(enum ad5755_mode mode)
516 } 516 }
517} 517}
518 518
519static int __devinit ad5755_init_channels(struct iio_dev *indio_dev, 519static int ad5755_init_channels(struct iio_dev *indio_dev,
520 const struct ad5755_platform_data *pdata) 520 const struct ad5755_platform_data *pdata)
521{ 521{
522 struct ad5755_state *st = iio_priv(indio_dev); 522 struct ad5755_state *st = iio_priv(indio_dev);
523 struct iio_chan_spec *channels = st->channels; 523 struct iio_chan_spec *channels = st->channels;
@@ -562,7 +562,7 @@ static const struct ad5755_platform_data ad5755_default_pdata = {
562 }, 562 },
563}; 563};
564 564
565static int __devinit ad5755_probe(struct spi_device *spi) 565static int ad5755_probe(struct spi_device *spi)
566{ 566{
567 enum ad5755_type type = spi_get_device_id(spi)->driver_data; 567 enum ad5755_type type = spi_get_device_id(spi)->driver_data;
568 const struct ad5755_platform_data *pdata = dev_get_platdata(&spi->dev); 568 const struct ad5755_platform_data *pdata = dev_get_platdata(&spi->dev);
@@ -614,7 +614,7 @@ error_free:
614 return ret; 614 return ret;
615} 615}
616 616
617static int __devexit ad5755_remove(struct spi_device *spi) 617static int ad5755_remove(struct spi_device *spi)
618{ 618{
619 struct iio_dev *indio_dev = spi_get_drvdata(spi); 619 struct iio_dev *indio_dev = spi_get_drvdata(spi);
620 620
@@ -640,7 +640,7 @@ static struct spi_driver ad5755_driver = {
640 .owner = THIS_MODULE, 640 .owner = THIS_MODULE,
641 }, 641 },
642 .probe = ad5755_probe, 642 .probe = ad5755_probe,
643 .remove = __devexit_p(ad5755_remove), 643 .remove = ad5755_remove,
644 .id_table = ad5755_id, 644 .id_table = ad5755_id,
645}; 645};
646module_spi_driver(ad5755_driver); 646module_spi_driver(ad5755_driver);
diff --git a/drivers/iio/dac/ad5764.c b/drivers/iio/dac/ad5764.c
index ffce3044744..7f9045e6daa 100644
--- a/drivers/iio/dac/ad5764.c
+++ b/drivers/iio/dac/ad5764.c
@@ -273,7 +273,7 @@ static const struct iio_info ad5764_info = {
273 .driver_module = THIS_MODULE, 273 .driver_module = THIS_MODULE,
274}; 274};
275 275
276static int __devinit ad5764_probe(struct spi_device *spi) 276static int ad5764_probe(struct spi_device *spi)
277{ 277{
278 enum ad5764_type type = spi_get_device_id(spi)->driver_data; 278 enum ad5764_type type = spi_get_device_id(spi)->driver_data;
279 struct iio_dev *indio_dev; 279 struct iio_dev *indio_dev;
@@ -340,7 +340,7 @@ error_free:
340 return ret; 340 return ret;
341} 341}
342 342
343static int __devexit ad5764_remove(struct spi_device *spi) 343static int ad5764_remove(struct spi_device *spi)
344{ 344{
345 struct iio_dev *indio_dev = spi_get_drvdata(spi); 345 struct iio_dev *indio_dev = spi_get_drvdata(spi);
346 struct ad5764_state *st = iio_priv(indio_dev); 346 struct ad5764_state *st = iio_priv(indio_dev);
@@ -372,7 +372,7 @@ static struct spi_driver ad5764_driver = {
372 .owner = THIS_MODULE, 372 .owner = THIS_MODULE,
373 }, 373 },
374 .probe = ad5764_probe, 374 .probe = ad5764_probe,
375 .remove = __devexit_p(ad5764_remove), 375 .remove = ad5764_remove,
376 .id_table = ad5764_ids, 376 .id_table = ad5764_ids,
377}; 377};
378module_spi_driver(ad5764_driver); 378module_spi_driver(ad5764_driver);
diff --git a/drivers/iio/dac/ad5791.c b/drivers/iio/dac/ad5791.c
index 2bd2e37280f..6407b5407dd 100644
--- a/drivers/iio/dac/ad5791.c
+++ b/drivers/iio/dac/ad5791.c
@@ -346,7 +346,7 @@ static const struct iio_info ad5791_info = {
346 .driver_module = THIS_MODULE, 346 .driver_module = THIS_MODULE,
347}; 347};
348 348
349static int __devinit ad5791_probe(struct spi_device *spi) 349static int ad5791_probe(struct spi_device *spi)
350{ 350{
351 struct ad5791_platform_data *pdata = spi->dev.platform_data; 351 struct ad5791_platform_data *pdata = spi->dev.platform_data;
352 struct iio_dev *indio_dev; 352 struct iio_dev *indio_dev;
@@ -365,7 +365,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
365 if (ret) 365 if (ret)
366 goto error_put_reg_pos; 366 goto error_put_reg_pos;
367 367
368 pos_voltage_uv = regulator_get_voltage(st->reg_vdd); 368 ret = regulator_get_voltage(st->reg_vdd);
369 if (ret < 0)
370 goto error_disable_reg_pos;
371
372 pos_voltage_uv = ret;
369 } 373 }
370 374
371 st->reg_vss = regulator_get(&spi->dev, "vss"); 375 st->reg_vss = regulator_get(&spi->dev, "vss");
@@ -374,7 +378,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
374 if (ret) 378 if (ret)
375 goto error_put_reg_neg; 379 goto error_put_reg_neg;
376 380
377 neg_voltage_uv = regulator_get_voltage(st->reg_vss); 381 ret = regulator_get_voltage(st->reg_vss);
382 if (ret < 0)
383 goto error_disable_reg_neg;
384
385 neg_voltage_uv = ret;
378 } 386 }
379 387
380 st->pwr_down = true; 388 st->pwr_down = true;
@@ -428,6 +436,7 @@ error_put_reg_neg:
428 if (!IS_ERR(st->reg_vss)) 436 if (!IS_ERR(st->reg_vss))
429 regulator_put(st->reg_vss); 437 regulator_put(st->reg_vss);
430 438
439error_disable_reg_pos:
431 if (!IS_ERR(st->reg_vdd)) 440 if (!IS_ERR(st->reg_vdd))
432 regulator_disable(st->reg_vdd); 441 regulator_disable(st->reg_vdd);
433error_put_reg_pos: 442error_put_reg_pos:
@@ -439,7 +448,7 @@ error_ret:
439 return ret; 448 return ret;
440} 449}
441 450
442static int __devexit ad5791_remove(struct spi_device *spi) 451static int ad5791_remove(struct spi_device *spi)
443{ 452{
444 struct iio_dev *indio_dev = spi_get_drvdata(spi); 453 struct iio_dev *indio_dev = spi_get_drvdata(spi);
445 struct ad5791_state *st = iio_priv(indio_dev); 454 struct ad5791_state *st = iio_priv(indio_dev);
@@ -475,7 +484,7 @@ static struct spi_driver ad5791_driver = {
475 .owner = THIS_MODULE, 484 .owner = THIS_MODULE,
476 }, 485 },
477 .probe = ad5791_probe, 486 .probe = ad5791_probe,
478 .remove = __devexit_p(ad5791_remove), 487 .remove = ad5791_remove,
479 .id_table = ad5791_id, 488 .id_table = ad5791_id,
480}; 489};
481module_spi_driver(ad5791_driver); 490module_spi_driver(ad5791_driver);
diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c
index c3d748c2593..352abe2004a 100644
--- a/drivers/iio/dac/max517.c
+++ b/drivers/iio/dac/max517.c
@@ -156,7 +156,7 @@ static const struct iio_chan_spec max517_channels[] = {
156 MAX517_CHANNEL(1) 156 MAX517_CHANNEL(1)
157}; 157};
158 158
159static int __devinit max517_probe(struct i2c_client *client, 159static int max517_probe(struct i2c_client *client,
160 const struct i2c_device_id *id) 160 const struct i2c_device_id *id)
161{ 161{
162 struct max517_data *data; 162 struct max517_data *data;
@@ -210,7 +210,7 @@ exit:
210 return err; 210 return err;
211} 211}
212 212
213static int __devexit max517_remove(struct i2c_client *client) 213static int max517_remove(struct i2c_client *client)
214{ 214{
215 iio_device_unregister(i2c_get_clientdata(client)); 215 iio_device_unregister(i2c_get_clientdata(client));
216 iio_device_free(i2c_get_clientdata(client)); 216 iio_device_free(i2c_get_clientdata(client));
@@ -232,7 +232,7 @@ static struct i2c_driver max517_driver = {
232 .pm = MAX517_PM_OPS, 232 .pm = MAX517_PM_OPS,
233 }, 233 },
234 .probe = max517_probe, 234 .probe = max517_probe,
235 .remove = __devexit_p(max517_remove), 235 .remove = max517_remove,
236 .id_table = max517_id, 236 .id_table = max517_id,
237}; 237};
238module_i2c_driver(max517_driver); 238module_i2c_driver(max517_driver);
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index e0e168bd5b4..8f88cc4059a 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -141,8 +141,8 @@ static const struct iio_info mcp4725_info = {
141 .driver_module = THIS_MODULE, 141 .driver_module = THIS_MODULE,
142}; 142};
143 143
144static int __devinit mcp4725_probe(struct i2c_client *client, 144static int mcp4725_probe(struct i2c_client *client,
145 const struct i2c_device_id *id) 145 const struct i2c_device_id *id)
146{ 146{
147 struct mcp4725_data *data; 147 struct mcp4725_data *data;
148 struct iio_dev *indio_dev; 148 struct iio_dev *indio_dev;
@@ -195,7 +195,7 @@ exit:
195 return err; 195 return err;
196} 196}
197 197
198static int __devexit mcp4725_remove(struct i2c_client *client) 198static int mcp4725_remove(struct i2c_client *client)
199{ 199{
200 struct iio_dev *indio_dev = i2c_get_clientdata(client); 200 struct iio_dev *indio_dev = i2c_get_clientdata(client);
201 201
@@ -217,7 +217,7 @@ static struct i2c_driver mcp4725_driver = {
217 .pm = MCP4725_PM_OPS, 217 .pm = MCP4725_PM_OPS,
218 }, 218 },
219 .probe = mcp4725_probe, 219 .probe = mcp4725_probe,
220 .remove = __devexit_p(mcp4725_remove), 220 .remove = mcp4725_remove,
221 .id_table = mcp4725_id, 221 .id_table = mcp4725_id,
222}; 222};
223module_i2c_driver(mcp4725_driver); 223module_i2c_driver(mcp4725_driver);
diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index b737c64a402..80307473e3a 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -959,7 +959,7 @@ static int ad9523_setup(struct iio_dev *indio_dev)
959 return 0; 959 return 0;
960} 960}
961 961
962static int __devinit ad9523_probe(struct spi_device *spi) 962static int ad9523_probe(struct spi_device *spi)
963{ 963{
964 struct ad9523_platform_data *pdata = spi->dev.platform_data; 964 struct ad9523_platform_data *pdata = spi->dev.platform_data;
965 struct iio_dev *indio_dev; 965 struct iio_dev *indio_dev;
@@ -1020,7 +1020,7 @@ error_put_reg:
1020 return ret; 1020 return ret;
1021} 1021}
1022 1022
1023static int __devexit ad9523_remove(struct spi_device *spi) 1023static int ad9523_remove(struct spi_device *spi)
1024{ 1024{
1025 struct iio_dev *indio_dev = spi_get_drvdata(spi); 1025 struct iio_dev *indio_dev = spi_get_drvdata(spi);
1026 struct ad9523_state *st = iio_priv(indio_dev); 1026 struct ad9523_state *st = iio_priv(indio_dev);
@@ -1049,7 +1049,7 @@ static struct spi_driver ad9523_driver = {
1049 .owner = THIS_MODULE, 1049 .owner = THIS_MODULE,
1050 }, 1050 },
1051 .probe = ad9523_probe, 1051 .probe = ad9523_probe,
1052 .remove = __devexit_p(ad9523_remove), 1052 .remove = ad9523_remove,
1053 .id_table = ad9523_id, 1053 .id_table = ad9523_id,
1054}; 1054};
1055module_spi_driver(ad9523_driver); 1055module_spi_driver(ad9523_driver);
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index e35bb8f6fe7..a884252ac66 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -173,7 +173,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
173 } while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt); 173 } while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
174 } while (r_cnt == 0); 174 } while (r_cnt == 0);
175 175
176 tmp = freq * (u64)st->r1_mod + (st->fpfd > 1); 176 tmp = freq * (u64)st->r1_mod + (st->fpfd >> 1);
177 do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */ 177 do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
178 st->r0_fract = do_div(tmp, st->r1_mod); 178 st->r0_fract = do_div(tmp, st->r1_mod);
179 st->r0_int = tmp; 179 st->r0_int = tmp;
@@ -355,7 +355,7 @@ static const struct iio_info adf4350_info = {
355 .driver_module = THIS_MODULE, 355 .driver_module = THIS_MODULE,
356}; 356};
357 357
358static int __devinit adf4350_probe(struct spi_device *spi) 358static int adf4350_probe(struct spi_device *spi)
359{ 359{
360 struct adf4350_platform_data *pdata = spi->dev.platform_data; 360 struct adf4350_platform_data *pdata = spi->dev.platform_data;
361 struct iio_dev *indio_dev; 361 struct iio_dev *indio_dev;
@@ -440,7 +440,7 @@ error_put_reg:
440 return ret; 440 return ret;
441} 441}
442 442
443static int __devexit adf4350_remove(struct spi_device *spi) 443static int adf4350_remove(struct spi_device *spi)
444{ 444{
445 struct iio_dev *indio_dev = spi_get_drvdata(spi); 445 struct iio_dev *indio_dev = spi_get_drvdata(spi);
446 struct adf4350_state *st = iio_priv(indio_dev); 446 struct adf4350_state *st = iio_priv(indio_dev);
@@ -476,7 +476,7 @@ static struct spi_driver adf4350_driver = {
476 .owner = THIS_MODULE, 476 .owner = THIS_MODULE,
477 }, 477 },
478 .probe = adf4350_probe, 478 .probe = adf4350_probe,
479 .remove = __devexit_p(adf4350_remove), 479 .remove = adf4350_remove,
480 .id_table = adf4350_id, 480 .id_table = adf4350_id,
481}; 481};
482module_spi_driver(adf4350_driver); 482module_spi_driver(adf4350_driver);
diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig
index 48ed1483ff2..96b68f63a90 100644
--- a/drivers/iio/gyro/Kconfig
+++ b/drivers/iio/gyro/Kconfig
@@ -17,6 +17,7 @@ config HID_SENSOR_GYRO_3D
17 select IIO_BUFFER 17 select IIO_BUFFER
18 select IIO_TRIGGERED_BUFFER 18 select IIO_TRIGGERED_BUFFER
19 select HID_SENSOR_IIO_COMMON 19 select HID_SENSOR_IIO_COMMON
20 select HID_SENSOR_IIO_TRIGGER
20 tristate "HID Gyroscope 3D" 21 tristate "HID Gyroscope 3D"
21 help 22 help
22 Say yes here to build support for the HID SENSOR 23 Say yes here to build support for the HID SENSOR
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 4c8b158e40e..06e7cc35450 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -278,7 +278,7 @@ static int gyro_3d_parse_report(struct platform_device *pdev,
278} 278}
279 279
280/* Function to initialize the processing for usage id */ 280/* Function to initialize the processing for usage id */
281static int __devinit hid_gyro_3d_probe(struct platform_device *pdev) 281static int hid_gyro_3d_probe(struct platform_device *pdev)
282{ 282{
283 int ret = 0; 283 int ret = 0;
284 static const char *name = "gyro_3d"; 284 static const char *name = "gyro_3d";
@@ -375,7 +375,7 @@ error_ret:
375} 375}
376 376
377/* Function to deinitialize the processing for usage id */ 377/* Function to deinitialize the processing for usage id */
378static int __devinit hid_gyro_3d_remove(struct platform_device *pdev) 378static int hid_gyro_3d_remove(struct platform_device *pdev)
379{ 379{
380 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 380 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
381 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 381 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
index 1763c9bcb98..dbf80abc834 100644
--- a/drivers/iio/light/Kconfig
+++ b/drivers/iio/light/Kconfig
@@ -47,6 +47,7 @@ config HID_SENSOR_ALS
47 select IIO_BUFFER 47 select IIO_BUFFER
48 select IIO_TRIGGERED_BUFFER 48 select IIO_TRIGGERED_BUFFER
49 select HID_SENSOR_IIO_COMMON 49 select HID_SENSOR_IIO_COMMON
50 select HID_SENSOR_IIO_TRIGGER
50 tristate "HID ALS" 51 tristate "HID ALS"
51 help 52 help
52 Say yes here to build support for the HID SENSOR 53 Say yes here to build support for the HID SENSOR
diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c
index 36d210a06b2..d5b9d39d95b 100644
--- a/drivers/iio/light/adjd_s311.c
+++ b/drivers/iio/light/adjd_s311.c
@@ -286,8 +286,8 @@ static const struct iio_info adjd_s311_info = {
286 .driver_module = THIS_MODULE, 286 .driver_module = THIS_MODULE,
287}; 287};
288 288
289static int __devinit adjd_s311_probe(struct i2c_client *client, 289static int adjd_s311_probe(struct i2c_client *client,
290 const struct i2c_device_id *id) 290 const struct i2c_device_id *id)
291{ 291{
292 struct adjd_s311_data *data; 292 struct adjd_s311_data *data;
293 struct iio_dev *indio_dev; 293 struct iio_dev *indio_dev;
@@ -330,7 +330,7 @@ exit:
330 return err; 330 return err;
331} 331}
332 332
333static int __devexit adjd_s311_remove(struct i2c_client *client) 333static int adjd_s311_remove(struct i2c_client *client)
334{ 334{
335 struct iio_dev *indio_dev = i2c_get_clientdata(client); 335 struct iio_dev *indio_dev = i2c_get_clientdata(client);
336 struct adjd_s311_data *data = iio_priv(indio_dev); 336 struct adjd_s311_data *data = iio_priv(indio_dev);
@@ -354,7 +354,7 @@ static struct i2c_driver adjd_s311_driver = {
354 .name = ADJD_S311_DRV_NAME, 354 .name = ADJD_S311_DRV_NAME,
355 }, 355 },
356 .probe = adjd_s311_probe, 356 .probe = adjd_s311_probe,
357 .remove = __devexit_p(adjd_s311_remove), 357 .remove = adjd_s311_remove,
358 .id_table = adjd_s311_id, 358 .id_table = adjd_s311_id,
359}; 359};
360module_i2c_driver(adjd_s311_driver); 360module_i2c_driver(adjd_s311_driver);
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 23eeeef64e8..e2d042f2a54 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -245,7 +245,7 @@ static int als_parse_report(struct platform_device *pdev,
245} 245}
246 246
247/* Function to initialize the processing for usage id */ 247/* Function to initialize the processing for usage id */
248static int __devinit hid_als_probe(struct platform_device *pdev) 248static int hid_als_probe(struct platform_device *pdev)
249{ 249{
250 int ret = 0; 250 int ret = 0;
251 static const char *name = "als"; 251 static const char *name = "als";
@@ -341,7 +341,7 @@ error_ret:
341} 341}
342 342
343/* Function to deinitialize the processing for usage id */ 343/* Function to deinitialize the processing for usage id */
344static int __devinit hid_als_remove(struct platform_device *pdev) 344static int hid_als_remove(struct platform_device *pdev)
345{ 345{
346 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 346 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
347 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 347 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c
index e45712a921c..7503012ce93 100644
--- a/drivers/iio/light/lm3533-als.c
+++ b/drivers/iio/light/lm3533-als.c
@@ -718,8 +718,7 @@ static struct attribute_group lm3533_als_attribute_group = {
718 .attrs = lm3533_als_attributes 718 .attrs = lm3533_als_attributes
719}; 719};
720 720
721static int __devinit lm3533_als_set_input_mode(struct lm3533_als *als, 721static int lm3533_als_set_input_mode(struct lm3533_als *als, bool pwm_mode)
722 bool pwm_mode)
723{ 722{
724 u8 mask = LM3533_ALS_INPUT_MODE_MASK; 723 u8 mask = LM3533_ALS_INPUT_MODE_MASK;
725 u8 val; 724 u8 val;
@@ -740,7 +739,7 @@ static int __devinit lm3533_als_set_input_mode(struct lm3533_als *als,
740 return 0; 739 return 0;
741} 740}
742 741
743static int __devinit lm3533_als_set_resistor(struct lm3533_als *als, u8 val) 742static int lm3533_als_set_resistor(struct lm3533_als *als, u8 val)
744{ 743{
745 int ret; 744 int ret;
746 745
@@ -756,8 +755,8 @@ static int __devinit lm3533_als_set_resistor(struct lm3533_als *als, u8 val)
756 return 0; 755 return 0;
757} 756}
758 757
759static int __devinit lm3533_als_setup(struct lm3533_als *als, 758static int lm3533_als_setup(struct lm3533_als *als,
760 struct lm3533_als_platform_data *pdata) 759 struct lm3533_als_platform_data *pdata)
761{ 760{
762 int ret; 761 int ret;
763 762
@@ -775,7 +774,7 @@ static int __devinit lm3533_als_setup(struct lm3533_als *als,
775 return 0; 774 return 0;
776} 775}
777 776
778static int __devinit lm3533_als_setup_irq(struct lm3533_als *als, void *dev) 777static int lm3533_als_setup_irq(struct lm3533_als *als, void *dev)
779{ 778{
780 u8 mask = LM3533_ALS_INT_ENABLE_MASK; 779 u8 mask = LM3533_ALS_INT_ENABLE_MASK;
781 int ret; 780 int ret;
@@ -799,7 +798,7 @@ static int __devinit lm3533_als_setup_irq(struct lm3533_als *als, void *dev)
799 return 0; 798 return 0;
800} 799}
801 800
802static int __devinit lm3533_als_enable(struct lm3533_als *als) 801static int lm3533_als_enable(struct lm3533_als *als)
803{ 802{
804 u8 mask = LM3533_ALS_ENABLE_MASK; 803 u8 mask = LM3533_ALS_ENABLE_MASK;
805 int ret; 804 int ret;
@@ -830,7 +829,7 @@ static const struct iio_info lm3533_als_info = {
830 .read_raw = &lm3533_als_read_raw, 829 .read_raw = &lm3533_als_read_raw,
831}; 830};
832 831
833static int __devinit lm3533_als_probe(struct platform_device *pdev) 832static int lm3533_als_probe(struct platform_device *pdev)
834{ 833{
835 struct lm3533 *lm3533; 834 struct lm3533 *lm3533;
836 struct lm3533_als_platform_data *pdata; 835 struct lm3533_als_platform_data *pdata;
@@ -901,7 +900,7 @@ err_free_dev:
901 return ret; 900 return ret;
902} 901}
903 902
904static int __devexit lm3533_als_remove(struct platform_device *pdev) 903static int lm3533_als_remove(struct platform_device *pdev)
905{ 904{
906 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 905 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
907 struct lm3533_als *als = iio_priv(indio_dev); 906 struct lm3533_als *als = iio_priv(indio_dev);
@@ -922,7 +921,7 @@ static struct platform_driver lm3533_als_driver = {
922 .owner = THIS_MODULE, 921 .owner = THIS_MODULE,
923 }, 922 },
924 .probe = lm3533_als_probe, 923 .probe = lm3533_als_probe,
925 .remove = __devexit_p(lm3533_als_remove), 924 .remove = lm3533_als_remove,
926}; 925};
927module_platform_driver(lm3533_als_driver); 926module_platform_driver(lm3533_als_driver);
928 927
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index e49cb9784a6..2aa748fbdc0 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -150,8 +150,8 @@ static const struct iio_info vcnl4000_info = {
150 .driver_module = THIS_MODULE, 150 .driver_module = THIS_MODULE,
151}; 151};
152 152
153static int __devinit vcnl4000_probe(struct i2c_client *client, 153static int vcnl4000_probe(struct i2c_client *client,
154 const struct i2c_device_id *id) 154 const struct i2c_device_id *id)
155{ 155{
156 struct vcnl4000_data *data; 156 struct vcnl4000_data *data;
157 struct iio_dev *indio_dev; 157 struct iio_dev *indio_dev;
@@ -190,7 +190,7 @@ error_free_dev:
190 return ret; 190 return ret;
191} 191}
192 192
193static int __devexit vcnl4000_remove(struct i2c_client *client) 193static int vcnl4000_remove(struct i2c_client *client)
194{ 194{
195 struct iio_dev *indio_dev = i2c_get_clientdata(client); 195 struct iio_dev *indio_dev = i2c_get_clientdata(client);
196 196
@@ -206,7 +206,7 @@ static struct i2c_driver vcnl4000_driver = {
206 .owner = THIS_MODULE, 206 .owner = THIS_MODULE,
207 }, 207 },
208 .probe = vcnl4000_probe, 208 .probe = vcnl4000_probe,
209 .remove = __devexit_p(vcnl4000_remove), 209 .remove = vcnl4000_remove,
210 .id_table = vcnl4000_id, 210 .id_table = vcnl4000_id,
211}; 211};
212 212
diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig
index c1f0cdd5703..ff11d68225c 100644
--- a/drivers/iio/magnetometer/Kconfig
+++ b/drivers/iio/magnetometer/Kconfig
@@ -8,6 +8,7 @@ config HID_SENSOR_MAGNETOMETER_3D
8 select IIO_BUFFER 8 select IIO_BUFFER
9 select IIO_TRIGGERED_BUFFER 9 select IIO_TRIGGERED_BUFFER
10 select HID_SENSOR_IIO_COMMON 10 select HID_SENSOR_IIO_COMMON
11 select HID_SENSOR_IIO_TRIGGER
11 tristate "HID Magenetometer 3D" 12 tristate "HID Magenetometer 3D"
12 help 13 help
13 Say yes here to build support for the HID SENSOR 14 Say yes here to build support for the HID SENSOR
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 8e75eb76ccd..7ac2c7483ba 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -279,7 +279,7 @@ static int magn_3d_parse_report(struct platform_device *pdev,
279} 279}
280 280
281/* Function to initialize the processing for usage id */ 281/* Function to initialize the processing for usage id */
282static int __devinit hid_magn_3d_probe(struct platform_device *pdev) 282static int hid_magn_3d_probe(struct platform_device *pdev)
283{ 283{
284 int ret = 0; 284 int ret = 0;
285 static char *name = "magn_3d"; 285 static char *name = "magn_3d";
@@ -376,7 +376,7 @@ error_ret:
376} 376}
377 377
378/* Function to deinitialize the processing for usage id */ 378/* Function to deinitialize the processing for usage id */
379static int __devinit hid_magn_3d_remove(struct platform_device *pdev) 379static int hid_magn_3d_remove(struct platform_device *pdev)
380{ 380{
381 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 381 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
382 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 382 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 5ce7b9e8bff..7275e727e0f 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -920,8 +920,7 @@ static struct net_device *c2_devinit(struct c2_dev *c2dev,
920 return netdev; 920 return netdev;
921} 921}
922 922
923static int __devinit c2_probe(struct pci_dev *pcidev, 923static int c2_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
924 const struct pci_device_id *ent)
925{ 924{
926 int ret = 0, i; 925 int ret = 0, i;
927 unsigned long reg0_start, reg0_flags, reg0_len; 926 unsigned long reg0_start, reg0_flags, reg0_len;
@@ -1191,7 +1190,7 @@ static int __devinit c2_probe(struct pci_dev *pcidev,
1191 return ret; 1190 return ret;
1192} 1191}
1193 1192
1194static void __devexit c2_remove(struct pci_dev *pcidev) 1193static void c2_remove(struct pci_dev *pcidev)
1195{ 1194{
1196 struct c2_dev *c2dev = pci_get_drvdata(pcidev); 1195 struct c2_dev *c2dev = pci_get_drvdata(pcidev);
1197 struct net_device *netdev = c2dev->netdev; 1196 struct net_device *netdev = c2dev->netdev;
@@ -1236,7 +1235,7 @@ static struct pci_driver c2_pci_driver = {
1236 .name = DRV_NAME, 1235 .name = DRV_NAME,
1237 .id_table = c2_pci_table, 1236 .id_table = c2_pci_table,
1238 .probe = c2_probe, 1237 .probe = c2_probe,
1239 .remove = __devexit_p(c2_remove), 1238 .remove = c2_remove,
1240}; 1239};
1241 1240
1242static int __init c2_init_module(void) 1241static int __init c2_init_module(void)
diff --git a/drivers/infiniband/hw/amso1100/c2.h b/drivers/infiniband/hw/amso1100/c2.h
index 6ae698e6877..ba7a1208ff9 100644
--- a/drivers/infiniband/hw/amso1100/c2.h
+++ b/drivers/infiniband/hw/amso1100/c2.h
@@ -498,16 +498,16 @@ extern int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
498 struct ib_send_wr **bad_wr); 498 struct ib_send_wr **bad_wr);
499extern int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, 499extern int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
500 struct ib_recv_wr **bad_wr); 500 struct ib_recv_wr **bad_wr);
501extern void __devinit c2_init_qp_table(struct c2_dev *c2dev); 501extern void c2_init_qp_table(struct c2_dev *c2dev);
502extern void __devexit c2_cleanup_qp_table(struct c2_dev *c2dev); 502extern void c2_cleanup_qp_table(struct c2_dev *c2dev);
503extern void c2_set_qp_state(struct c2_qp *, int); 503extern void c2_set_qp_state(struct c2_qp *, int);
504extern struct c2_qp *c2_find_qpn(struct c2_dev *c2dev, int qpn); 504extern struct c2_qp *c2_find_qpn(struct c2_dev *c2dev, int qpn);
505 505
506/* PDs */ 506/* PDs */
507extern int c2_pd_alloc(struct c2_dev *c2dev, int privileged, struct c2_pd *pd); 507extern int c2_pd_alloc(struct c2_dev *c2dev, int privileged, struct c2_pd *pd);
508extern void c2_pd_free(struct c2_dev *c2dev, struct c2_pd *pd); 508extern void c2_pd_free(struct c2_dev *c2dev, struct c2_pd *pd);
509extern int __devinit c2_init_pd_table(struct c2_dev *c2dev); 509extern int c2_init_pd_table(struct c2_dev *c2dev);
510extern void __devexit c2_cleanup_pd_table(struct c2_dev *c2dev); 510extern void c2_cleanup_pd_table(struct c2_dev *c2dev);
511 511
512/* CQs */ 512/* CQs */
513extern int c2_init_cq(struct c2_dev *c2dev, int entries, 513extern int c2_init_cq(struct c2_dev *c2dev, int entries,
diff --git a/drivers/infiniband/hw/amso1100/c2_pd.c b/drivers/infiniband/hw/amso1100/c2_pd.c
index 161f2a28535..f3e81dc357b 100644
--- a/drivers/infiniband/hw/amso1100/c2_pd.c
+++ b/drivers/infiniband/hw/amso1100/c2_pd.c
@@ -70,7 +70,7 @@ void c2_pd_free(struct c2_dev *c2dev, struct c2_pd *pd)
70 spin_unlock(&c2dev->pd_table.lock); 70 spin_unlock(&c2dev->pd_table.lock);
71} 71}
72 72
73int __devinit c2_init_pd_table(struct c2_dev *c2dev) 73int c2_init_pd_table(struct c2_dev *c2dev)
74{ 74{
75 75
76 c2dev->pd_table.last = 0; 76 c2dev->pd_table.last = 0;
@@ -84,7 +84,7 @@ int __devinit c2_init_pd_table(struct c2_dev *c2dev)
84 return 0; 84 return 0;
85} 85}
86 86
87void __devexit c2_cleanup_pd_table(struct c2_dev *c2dev) 87void c2_cleanup_pd_table(struct c2_dev *c2dev)
88{ 88{
89 kfree(c2dev->pd_table.table); 89 kfree(c2dev->pd_table.table);
90} 90}
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
index 0d7b6f23caf..28cd5cb5185 100644
--- a/drivers/infiniband/hw/amso1100/c2_qp.c
+++ b/drivers/infiniband/hw/amso1100/c2_qp.c
@@ -1010,13 +1010,13 @@ out:
1010 return err; 1010 return err;
1011} 1011}
1012 1012
1013void __devinit c2_init_qp_table(struct c2_dev *c2dev) 1013void c2_init_qp_table(struct c2_dev *c2dev)
1014{ 1014{
1015 spin_lock_init(&c2dev->qp_table.lock); 1015 spin_lock_init(&c2dev->qp_table.lock);
1016 idr_init(&c2dev->qp_table.idr); 1016 idr_init(&c2dev->qp_table.idr);
1017} 1017}
1018 1018
1019void __devexit c2_cleanup_qp_table(struct c2_dev *c2dev) 1019void c2_cleanup_qp_table(struct c2_dev *c2dev)
1020{ 1020{
1021 idr_destroy(&c2dev->qp_table.idr); 1021 idr_destroy(&c2dev->qp_table.idr);
1022} 1022}
diff --git a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c
index e4a73158fc7..b7c98699005 100644
--- a/drivers/infiniband/hw/amso1100/c2_rnic.c
+++ b/drivers/infiniband/hw/amso1100/c2_rnic.c
@@ -442,7 +442,7 @@ static int c2_rnic_close(struct c2_dev *c2dev)
442 * involves initializing the various limits and resource pools that 442 * involves initializing the various limits and resource pools that
443 * comprise the RNIC instance. 443 * comprise the RNIC instance.
444 */ 444 */
445int __devinit c2_rnic_init(struct c2_dev *c2dev) 445int c2_rnic_init(struct c2_dev *c2dev)
446{ 446{
447 int err; 447 int err;
448 u32 qsize, msgsize; 448 u32 qsize, msgsize;
@@ -611,7 +611,7 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
611/* 611/*
612 * Called by c2_remove to cleanup the RNIC resources. 612 * Called by c2_remove to cleanup the RNIC resources.
613 */ 613 */
614void __devexit c2_rnic_term(struct c2_dev *c2dev) 614void c2_rnic_term(struct c2_dev *c2dev)
615{ 615{
616 616
617 /* Close the open adapter instance */ 617 /* Close the open adapter instance */
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 832e7a7d0ae..f8a62918a88 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -713,8 +713,8 @@ static struct attribute_group ehca_dev_attr_grp = {
713 .attrs = ehca_dev_attrs 713 .attrs = ehca_dev_attrs
714}; 714};
715 715
716static int __devinit ehca_probe(struct platform_device *dev, 716static int ehca_probe(struct platform_device *dev,
717 const struct of_device_id *id) 717 const struct of_device_id *id)
718{ 718{
719 struct ehca_shca *shca; 719 struct ehca_shca *shca;
720 const u64 *handle; 720 const u64 *handle;
@@ -879,7 +879,7 @@ probe1:
879 return -EINVAL; 879 return -EINVAL;
880} 880}
881 881
882static int __devexit ehca_remove(struct platform_device *dev) 882static int ehca_remove(struct platform_device *dev)
883{ 883{
884 struct ehca_shca *shca = dev_get_drvdata(&dev->dev); 884 struct ehca_shca *shca = dev_get_drvdata(&dev->dev);
885 unsigned long flags; 885 unsigned long flags;
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index bfca37b2432..7b371f545ec 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -127,9 +127,8 @@ const char *ipath_ibcstatus_str[] = {
127 "LTState1C", "LTState1D", "LTState1E", "LTState1F" 127 "LTState1C", "LTState1D", "LTState1E", "LTState1F"
128}; 128};
129 129
130static void __devexit ipath_remove_one(struct pci_dev *); 130static void ipath_remove_one(struct pci_dev *);
131static int __devinit ipath_init_one(struct pci_dev *, 131static int ipath_init_one(struct pci_dev *, const struct pci_device_id *);
132 const struct pci_device_id *);
133 132
134/* Only needed for registration, nothing else needs this info */ 133/* Only needed for registration, nothing else needs this info */
135#define PCI_VENDOR_ID_PATHSCALE 0x1fc1 134#define PCI_VENDOR_ID_PATHSCALE 0x1fc1
@@ -148,7 +147,7 @@ MODULE_DEVICE_TABLE(pci, ipath_pci_tbl);
148static struct pci_driver ipath_driver = { 147static struct pci_driver ipath_driver = {
149 .name = IPATH_DRV_NAME, 148 .name = IPATH_DRV_NAME,
150 .probe = ipath_init_one, 149 .probe = ipath_init_one,
151 .remove = __devexit_p(ipath_remove_one), 150 .remove = ipath_remove_one,
152 .id_table = ipath_pci_tbl, 151 .id_table = ipath_pci_tbl,
153 .driver = { 152 .driver = {
154 .groups = ipath_driver_attr_groups, 153 .groups = ipath_driver_attr_groups,
@@ -392,8 +391,7 @@ done:
392 391
393static void cleanup_device(struct ipath_devdata *dd); 392static void cleanup_device(struct ipath_devdata *dd);
394 393
395static int __devinit ipath_init_one(struct pci_dev *pdev, 394static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
396 const struct pci_device_id *ent)
397{ 395{
398 int ret, len, j; 396 int ret, len, j;
399 struct ipath_devdata *dd; 397 struct ipath_devdata *dd;
@@ -737,7 +735,7 @@ static void cleanup_device(struct ipath_devdata *dd)
737 kfree(tmp); 735 kfree(tmp);
738} 736}
739 737
740static void __devexit ipath_remove_one(struct pci_dev *pdev) 738static void ipath_remove_one(struct pci_dev *pdev)
741{ 739{
742 struct ipath_devdata *dd = pci_get_drvdata(pdev); 740 struct ipath_devdata *dd = pci_get_drvdata(pdev);
743 741
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index aa12a533ae9..87897b95666 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -130,7 +130,7 @@ static int log_mtts_per_seg = ilog2(MTHCA_MTT_SEG_SIZE / 8);
130module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444); 130module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444);
131MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-5)"); 131MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-5)");
132 132
133static char mthca_version[] __devinitdata = 133static char mthca_version[] =
134 DRV_NAME ": Mellanox InfiniBand HCA driver v" 134 DRV_NAME ": Mellanox InfiniBand HCA driver v"
135 DRV_VERSION " (" DRV_RELDATE ")\n"; 135 DRV_VERSION " (" DRV_RELDATE ")\n";
136 136
@@ -1139,8 +1139,7 @@ int __mthca_restart_one(struct pci_dev *pdev)
1139 return __mthca_init_one(pdev, hca_type); 1139 return __mthca_init_one(pdev, hca_type);
1140} 1140}
1141 1141
1142static int __devinit mthca_init_one(struct pci_dev *pdev, 1142static int mthca_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1143 const struct pci_device_id *id)
1144{ 1143{
1145 int ret; 1144 int ret;
1146 1145
@@ -1162,7 +1161,7 @@ static int __devinit mthca_init_one(struct pci_dev *pdev,
1162 return ret; 1161 return ret;
1163} 1162}
1164 1163
1165static void __devexit mthca_remove_one(struct pci_dev *pdev) 1164static void mthca_remove_one(struct pci_dev *pdev)
1166{ 1165{
1167 mutex_lock(&mthca_device_mutex); 1166 mutex_lock(&mthca_device_mutex);
1168 __mthca_remove_one(pdev); 1167 __mthca_remove_one(pdev);
@@ -1199,7 +1198,7 @@ static struct pci_driver mthca_driver = {
1199 .name = DRV_NAME, 1198 .name = DRV_NAME,
1200 .id_table = mthca_pci_table, 1199 .id_table = mthca_pci_table,
1201 .probe = mthca_init_one, 1200 .probe = mthca_init_one,
1202 .remove = __devexit_p(mthca_remove_one) 1201 .remove = mthca_remove_one,
1203}; 1202};
1204 1203
1205static void __init __mthca_check_profile_val(const char *name, int *pval, 1204static void __init __mthca_check_profile_val(const char *name, int *pval,
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 748db2d3e46..5b152a366df 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -444,7 +444,7 @@ static irqreturn_t nes_interrupt(int irq, void *dev_id)
444/** 444/**
445 * nes_probe - Device initialization 445 * nes_probe - Device initialization
446 */ 446 */
447static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) 447static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
448{ 448{
449 struct net_device *netdev = NULL; 449 struct net_device *netdev = NULL;
450 struct nes_device *nesdev = NULL; 450 struct nes_device *nesdev = NULL;
@@ -749,7 +749,7 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
749/** 749/**
750 * nes_remove - unload from kernel 750 * nes_remove - unload from kernel
751 */ 751 */
752static void __devexit nes_remove(struct pci_dev *pcidev) 752static void nes_remove(struct pci_dev *pcidev)
753{ 753{
754 struct nes_device *nesdev = pci_get_drvdata(pcidev); 754 struct nes_device *nesdev = pci_get_drvdata(pcidev);
755 struct net_device *netdev; 755 struct net_device *netdev;
@@ -810,7 +810,7 @@ static struct pci_driver nes_pci_driver = {
810 .name = DRV_NAME, 810 .name = DRV_NAME,
811 .id_table = nes_pci_table, 811 .id_table = nes_pci_table,
812 .probe = nes_probe, 812 .probe = nes_probe,
813 .remove = __devexit_p(nes_remove), 813 .remove = nes_remove,
814}; 814};
815 815
816static ssize_t nes_show_adapter(struct device_driver *ddp, char *buf) 816static ssize_t nes_show_adapter(struct device_driver *ddp, char *buf)
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index 4443adfcd9e..ddf066d9abb 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -1134,9 +1134,8 @@ void qib_disable_after_error(struct qib_devdata *dd)
1134 *dd->devstatusp |= QIB_STATUS_HWERROR; 1134 *dd->devstatusp |= QIB_STATUS_HWERROR;
1135} 1135}
1136 1136
1137static void __devexit qib_remove_one(struct pci_dev *); 1137static void qib_remove_one(struct pci_dev *);
1138static int __devinit qib_init_one(struct pci_dev *, 1138static int qib_init_one(struct pci_dev *, const struct pci_device_id *);
1139 const struct pci_device_id *);
1140 1139
1141#define DRIVER_LOAD_MSG "QLogic " QIB_DRV_NAME " loaded: " 1140#define DRIVER_LOAD_MSG "QLogic " QIB_DRV_NAME " loaded: "
1142#define PFX QIB_DRV_NAME ": " 1141#define PFX QIB_DRV_NAME ": "
@@ -1153,7 +1152,7 @@ MODULE_DEVICE_TABLE(pci, qib_pci_tbl);
1153struct pci_driver qib_driver = { 1152struct pci_driver qib_driver = {
1154 .name = QIB_DRV_NAME, 1153 .name = QIB_DRV_NAME,
1155 .probe = qib_init_one, 1154 .probe = qib_init_one,
1156 .remove = __devexit_p(qib_remove_one), 1155 .remove = qib_remove_one,
1157 .id_table = qib_pci_tbl, 1156 .id_table = qib_pci_tbl,
1158 .err_handler = &qib_pci_err_handler, 1157 .err_handler = &qib_pci_err_handler,
1159}; 1158};
@@ -1342,8 +1341,7 @@ static void qib_postinit_cleanup(struct qib_devdata *dd)
1342 qib_free_devdata(dd); 1341 qib_free_devdata(dd);
1343} 1342}
1344 1343
1345static int __devinit qib_init_one(struct pci_dev *pdev, 1344static int qib_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1346 const struct pci_device_id *ent)
1347{ 1345{
1348 int ret, j, pidx, initfail; 1346 int ret, j, pidx, initfail;
1349 struct qib_devdata *dd = NULL; 1347 struct qib_devdata *dd = NULL;
@@ -1448,7 +1446,7 @@ bail:
1448 return ret; 1446 return ret;
1449} 1447}
1450 1448
1451static void __devexit qib_remove_one(struct pci_dev *pdev) 1449static void qib_remove_one(struct pci_dev *pdev)
1452{ 1450{
1453 struct qib_devdata *dd = pci_get_drvdata(pdev); 1451 struct qib_devdata *dd = pci_get_drvdata(pdev);
1454 int ret; 1452 int ret;
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index d327f5a2bb0..b29ca651a39 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -602,6 +602,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
602 602
603 i = 0; 603 i = 0;
604 for_each_child_of_node(node, pp) { 604 for_each_child_of_node(node, pp) {
605 int gpio;
605 enum of_gpio_flags flags; 606 enum of_gpio_flags flags;
606 607
607 if (!of_find_property(pp, "gpios", NULL)) { 608 if (!of_find_property(pp, "gpios", NULL)) {
@@ -610,9 +611,19 @@ gpio_keys_get_devtree_pdata(struct device *dev)
610 continue; 611 continue;
611 } 612 }
612 613
614 gpio = of_get_gpio_flags(pp, 0, &flags);
615 if (gpio < 0) {
616 error = gpio;
617 if (error != -EPROBE_DEFER)
618 dev_err(dev,
619 "Failed to get gpio flags, error: %d\n",
620 error);
621 goto err_free_pdata;
622 }
623
613 button = &pdata->buttons[i++]; 624 button = &pdata->buttons[i++];
614 625
615 button->gpio = of_get_gpio_flags(pp, 0, &flags); 626 button->gpio = gpio;
616 button->active_low = flags & OF_GPIO_ACTIVE_LOW; 627 button->active_low = flags & OF_GPIO_ACTIVE_LOW;
617 628
618 if (of_property_read_u32(pp, "linux,code", &button->code)) { 629 if (of_property_read_u32(pp, "linux,code", &button->code)) {
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index f686fd97055..21147164874 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -135,6 +135,7 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct
135 135
136 i = 0; 136 i = 0;
137 for_each_child_of_node(node, pp) { 137 for_each_child_of_node(node, pp) {
138 int gpio;
138 enum of_gpio_flags flags; 139 enum of_gpio_flags flags;
139 140
140 if (!of_find_property(pp, "gpios", NULL)) { 141 if (!of_find_property(pp, "gpios", NULL)) {
@@ -143,9 +144,19 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct
143 continue; 144 continue;
144 } 145 }
145 146
147 gpio = of_get_gpio_flags(pp, 0, &flags);
148 if (gpio < 0) {
149 error = gpio;
150 if (error != -EPROBE_DEFER)
151 dev_err(dev,
152 "Failed to get gpio flags, error: %d\n",
153 error);
154 goto err_free_pdata;
155 }
156
146 button = &pdata->buttons[i++]; 157 button = &pdata->buttons[i++];
147 158
148 button->gpio = of_get_gpio_flags(pp, 0, &flags); 159 button->gpio = gpio;
149 button->active_low = flags & OF_GPIO_ACTIVE_LOW; 160 button->active_low = flags & OF_GPIO_ACTIVE_LOW;
150 161
151 if (of_property_read_u32(pp, "linux,code", &button->code)) { 162 if (of_property_read_u32(pp, "linux,code", &button->code)) {
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 50e9c5e195e..a34cc6714e5 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -384,7 +384,7 @@ static const struct i2c_device_id tca8418_id[] = {
384MODULE_DEVICE_TABLE(i2c, tca8418_id); 384MODULE_DEVICE_TABLE(i2c, tca8418_id);
385 385
386#ifdef CONFIG_OF 386#ifdef CONFIG_OF
387static const struct of_device_id tca8418_dt_ids[] __devinitconst = { 387static const struct of_device_id tca8418_dt_ids[] = {
388 { .compatible = "ti,tca8418", }, 388 { .compatible = "ti,tca8418", },
389 { } 389 { }
390}; 390};
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index e582922bacf..cc7e0d4a8f9 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -791,7 +791,7 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse)
791 fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y); 791 fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y);
792 fsp_set_slot(dev, 1, false, 0, 0); 792 fsp_set_slot(dev, 1, false, 0, 0);
793 } 793 }
794 if (fgrs > 0) { 794 if (fgrs == 1 || (fgrs == 2 && !(packet[0] & FSP_PB0_MFMC_FGR2))) {
795 input_report_abs(dev, ABS_X, abs_x); 795 input_report_abs(dev, ABS_X, abs_x);
796 input_report_abs(dev, ABS_Y, abs_y); 796 input_report_abs(dev, ABS_Y, abs_y);
797 } 797 }
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index c2c07a4a7f2..b9d09115788 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4234,7 +4234,7 @@ static struct iommu_ops intel_iommu_ops = {
4234 .pgsize_bitmap = INTEL_IOMMU_PGSIZES, 4234 .pgsize_bitmap = INTEL_IOMMU_PGSIZES,
4235}; 4235};
4236 4236
4237static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) 4237static void quirk_iommu_rwbf(struct pci_dev *dev)
4238{ 4238{
4239 /* 4239 /*
4240 * Mobile 4 Series Chipset neglects to set RWBF capability, 4240 * Mobile 4 Series Chipset neglects to set RWBF capability,
@@ -4262,7 +4262,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
4262#define GGC_MEMORY_SIZE_3M_VT (0xa << 8) 4262#define GGC_MEMORY_SIZE_3M_VT (0xa << 8)
4263#define GGC_MEMORY_SIZE_4M_VT (0xb << 8) 4263#define GGC_MEMORY_SIZE_4M_VT (0xb << 8)
4264 4264
4265static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev) 4265static void quirk_calpella_no_shadow_gtt(struct pci_dev *dev)
4266{ 4266{
4267 unsigned short ggc; 4267 unsigned short ggc;
4268 4268
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 18108c1405e..d33c980e9c2 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -934,7 +934,7 @@ static void omap_iommu_detach(struct omap_iommu *obj)
934/* 934/*
935 * OMAP Device MMU(IOMMU) detection 935 * OMAP Device MMU(IOMMU) detection
936 */ 936 */
937static int __devinit omap_iommu_probe(struct platform_device *pdev) 937static int omap_iommu_probe(struct platform_device *pdev)
938{ 938{
939 int err = -ENODEV; 939 int err = -ENODEV;
940 int irq; 940 int irq;
@@ -1003,7 +1003,7 @@ err_mem:
1003 return err; 1003 return err;
1004} 1004}
1005 1005
1006static int __devexit omap_iommu_remove(struct platform_device *pdev) 1006static int omap_iommu_remove(struct platform_device *pdev)
1007{ 1007{
1008 int irq; 1008 int irq;
1009 struct resource *res; 1009 struct resource *res;
@@ -1028,7 +1028,7 @@ static int __devexit omap_iommu_remove(struct platform_device *pdev)
1028 1028
1029static struct platform_driver omap_iommu_driver = { 1029static struct platform_driver omap_iommu_driver = {
1030 .probe = omap_iommu_probe, 1030 .probe = omap_iommu_probe,
1031 .remove = __devexit_p(omap_iommu_remove), 1031 .remove = omap_iommu_remove,
1032 .driver = { 1032 .driver = {
1033 .name = "omap-iommu", 1033 .name = "omap-iommu",
1034 }, 1034 },
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 4c9db62814f..8219f1d596e 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -431,7 +431,7 @@ const struct dev_pm_ops tegra_gart_pm_ops = {
431}; 431};
432 432
433#ifdef CONFIG_OF 433#ifdef CONFIG_OF
434static struct of_device_id tegra_gart_of_match[] __devinitdata = { 434static struct of_device_id tegra_gart_of_match[] = {
435 { .compatible = "nvidia,tegra20-gart", }, 435 { .compatible = "nvidia,tegra20-gart", },
436 { }, 436 { },
437}; 437};
@@ -449,7 +449,7 @@ static struct platform_driver tegra_gart_driver = {
449 }, 449 },
450}; 450};
451 451
452static int __devinit tegra_gart_init(void) 452static int tegra_gart_init(void)
453{ 453{
454 return platform_driver_register(&tegra_gart_driver); 454 return platform_driver_register(&tegra_gart_driver);
455} 455}
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 25c1210c083..fc178893789 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1255,7 +1255,7 @@ const struct dev_pm_ops tegra_smmu_pm_ops = {
1255}; 1255};
1256 1256
1257#ifdef CONFIG_OF 1257#ifdef CONFIG_OF
1258static struct of_device_id tegra_smmu_of_match[] __devinitdata = { 1258static struct of_device_id tegra_smmu_of_match[] = {
1259 { .compatible = "nvidia,tegra30-smmu", }, 1259 { .compatible = "nvidia,tegra30-smmu", },
1260 { }, 1260 { },
1261}; 1261};
@@ -1273,7 +1273,7 @@ static struct platform_driver tegra_smmu_driver = {
1273 }, 1273 },
1274}; 1274};
1275 1275
1276static int __devinit tegra_smmu_init(void) 1276static int tegra_smmu_init(void)
1277{ 1277{
1278 return platform_driver_register(&tegra_smmu_driver); 1278 return platform_driver_register(&tegra_smmu_driver);
1279} 1279}
diff --git a/drivers/isdn/hardware/avm/b1pci.c b/drivers/isdn/hardware/avm/b1pci.c
index b305e6b2b8e..ac4863c2ecb 100644
--- a/drivers/isdn/hardware/avm/b1pci.c
+++ b/drivers/isdn/hardware/avm/b1pci.c
@@ -299,8 +299,8 @@ static void b1pciv4_remove(struct pci_dev *pdev)
299 299
300#endif /* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */ 300#endif /* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */
301 301
302static int __devinit b1pci_pci_probe(struct pci_dev *pdev, 302static int b1pci_pci_probe(struct pci_dev *pdev,
303 const struct pci_device_id *ent) 303 const struct pci_device_id *ent)
304{ 304{
305 struct capicardparams param; 305 struct capicardparams param;
306 int retval; 306 int retval;
@@ -344,7 +344,7 @@ static int __devinit b1pci_pci_probe(struct pci_dev *pdev,
344 return retval; 344 return retval;
345} 345}
346 346
347static void __devexit b1pci_pci_remove(struct pci_dev *pdev) 347static void b1pci_pci_remove(struct pci_dev *pdev)
348{ 348{
349#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 349#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
350 avmcard *card = pci_get_drvdata(pdev); 350 avmcard *card = pci_get_drvdata(pdev);
@@ -362,7 +362,7 @@ static struct pci_driver b1pci_pci_driver = {
362 .name = "b1pci", 362 .name = "b1pci",
363 .id_table = b1pci_pci_tbl, 363 .id_table = b1pci_pci_tbl,
364 .probe = b1pci_pci_probe, 364 .probe = b1pci_pci_probe,
365 .remove = __devexit_p(b1pci_pci_remove), 365 .remove = b1pci_pci_remove,
366}; 366};
367 367
368static struct capi_driver capi_driver_b1pci = { 368static struct capi_driver capi_driver_b1pci = {
diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index 98f18812441..1d7fc44e3ee 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -1249,8 +1249,7 @@ err:
1249 1249
1250/* ------------------------------------------------------------- */ 1250/* ------------------------------------------------------------- */
1251 1251
1252static int __devinit c4_probe(struct pci_dev *dev, 1252static int c4_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1253 const struct pci_device_id *ent)
1254{ 1253{
1255 int nr = ent->driver_data; 1254 int nr = ent->driver_data;
1256 int retval = 0; 1255 int retval = 0;
diff --git a/drivers/isdn/hardware/avm/t1pci.c b/drivers/isdn/hardware/avm/t1pci.c
index cb9a30427bd..2180b168569 100644
--- a/drivers/isdn/hardware/avm/t1pci.c
+++ b/drivers/isdn/hardware/avm/t1pci.c
@@ -187,8 +187,7 @@ static char *t1pci_procinfo(struct capi_ctr *ctrl)
187 187
188/* ------------------------------------------------------------- */ 188/* ------------------------------------------------------------- */
189 189
190static int __devinit t1pci_probe(struct pci_dev *dev, 190static int t1pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
191 const struct pci_device_id *ent)
192{ 191{
193 struct capicardparams param; 192 struct capicardparams param;
194 int retval; 193 int retval;
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index ca6d276bb25..52377b4bf03 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -150,12 +150,12 @@ MODULE_DEVICE_TABLE(pci, divas_pci_tbl);
150 150
151static int divas_init_one(struct pci_dev *pdev, 151static int divas_init_one(struct pci_dev *pdev,
152 const struct pci_device_id *ent); 152 const struct pci_device_id *ent);
153static void __devexit divas_remove_one(struct pci_dev *pdev); 153static void divas_remove_one(struct pci_dev *pdev);
154 154
155static struct pci_driver diva_pci_driver = { 155static struct pci_driver diva_pci_driver = {
156 .name = "divas", 156 .name = "divas",
157 .probe = divas_init_one, 157 .probe = divas_init_one,
158 .remove = __devexit_p(divas_remove_one), 158 .remove = divas_remove_one,
159 .id_table = divas_pci_tbl, 159 .id_table = divas_pci_tbl,
160}; 160};
161 161
@@ -688,8 +688,7 @@ static int __init divas_register_chrdev(void)
688/* -------------------------------------------------------------------------- 688/* --------------------------------------------------------------------------
689 PCI driver section 689 PCI driver section
690 -------------------------------------------------------------------------- */ 690 -------------------------------------------------------------------------- */
691static int __devinit divas_init_one(struct pci_dev *pdev, 691static int divas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
692 const struct pci_device_id *ent)
693{ 692{
694 void *pdiva = NULL; 693 void *pdiva = NULL;
695 u8 pci_latency; 694 u8 pci_latency;
@@ -749,7 +748,7 @@ static int __devinit divas_init_one(struct pci_dev *pdev,
749 return (0); 748 return (0);
750} 749}
751 750
752static void __devexit divas_remove_one(struct pci_dev *pdev) 751static void divas_remove_one(struct pci_dev *pdev)
753{ 752{
754 void *pdiva = pci_get_drvdata(pdev); 753 void *pdiva = pci_get_drvdata(pdev);
755 754
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c
index dceaec821b0..292991c90c0 100644
--- a/drivers/isdn/hardware/mISDN/avmfritz.c
+++ b/drivers/isdn/hardware/mISDN/avmfritz.c
@@ -1034,7 +1034,7 @@ release_card(struct fritzcard *card)
1034 AVM_cnt--; 1034 AVM_cnt--;
1035} 1035}
1036 1036
1037static int __devinit 1037static int
1038setup_instance(struct fritzcard *card) 1038setup_instance(struct fritzcard *card)
1039{ 1039{
1040 int i, err; 1040 int i, err;
@@ -1096,7 +1096,7 @@ error:
1096 return err; 1096 return err;
1097} 1097}
1098 1098
1099static int __devinit 1099static int
1100fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1100fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1101{ 1101{
1102 int err = -ENOMEM; 1102 int err = -ENOMEM;
@@ -1130,7 +1130,7 @@ fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1130 return err; 1130 return err;
1131} 1131}
1132 1132
1133static void __devexit 1133static void
1134fritz_remove_pci(struct pci_dev *pdev) 1134fritz_remove_pci(struct pci_dev *pdev)
1135{ 1135{
1136 struct fritzcard *card = pci_get_drvdata(pdev); 1136 struct fritzcard *card = pci_get_drvdata(pdev);
@@ -1142,7 +1142,7 @@ fritz_remove_pci(struct pci_dev *pdev)
1142 pr_info("%s: drvdata already removed\n", __func__); 1142 pr_info("%s: drvdata already removed\n", __func__);
1143} 1143}
1144 1144
1145static struct pci_device_id fcpci_ids[] __devinitdata = { 1145static struct pci_device_id fcpci_ids[] = {
1146 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID, 1146 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID,
1147 0, 0, (unsigned long) "Fritz!Card PCI"}, 1147 0, 0, (unsigned long) "Fritz!Card PCI"},
1148 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID, 1148 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
@@ -1154,7 +1154,7 @@ MODULE_DEVICE_TABLE(pci, fcpci_ids);
1154static struct pci_driver fcpci_driver = { 1154static struct pci_driver fcpci_driver = {
1155 .name = "fcpci", 1155 .name = "fcpci",
1156 .probe = fritzpci_probe, 1156 .probe = fritzpci_probe,
1157 .remove = __devexit_p(fritz_remove_pci), 1157 .remove = fritz_remove_pci,
1158 .id_table = fcpci_ids, 1158 .id_table = fcpci_ids,
1159}; 1159};
1160 1160
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index f02794203bb..28543d79518 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -5274,7 +5274,7 @@ free_card:
5274 return ret_err; 5274 return ret_err;
5275} 5275}
5276 5276
5277static void __devexit hfc_remove_pci(struct pci_dev *pdev) 5277static void hfc_remove_pci(struct pci_dev *pdev)
5278{ 5278{
5279 struct hfc_multi *card = pci_get_drvdata(pdev); 5279 struct hfc_multi *card = pci_get_drvdata(pdev);
5280 u_long flags; 5280 u_long flags;
@@ -5351,7 +5351,7 @@ static const struct hm_map hfcm_map[] = {
5351 5351
5352#undef H 5352#undef H
5353#define H(x) ((unsigned long)&hfcm_map[x]) 5353#define H(x) ((unsigned long)&hfcm_map[x])
5354static struct pci_device_id hfmultipci_ids[] __devinitdata = { 5354static struct pci_device_id hfmultipci_ids[] = {
5355 5355
5356 /* Cards with HFC-4S Chip */ 5356 /* Cards with HFC-4S Chip */
5357 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD, 5357 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
@@ -5472,7 +5472,7 @@ hfcmulti_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5472static struct pci_driver hfcmultipci_driver = { 5472static struct pci_driver hfcmultipci_driver = {
5473 .name = "hfc_multi", 5473 .name = "hfc_multi",
5474 .probe = hfcmulti_probe, 5474 .probe = hfcmulti_probe,
5475 .remove = __devexit_p(hfc_remove_pci), 5475 .remove = hfc_remove_pci,
5476 .id_table = hfmultipci_ids, 5476 .id_table = hfmultipci_ids,
5477}; 5477};
5478 5478
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 6e99d73563b..a7e4939787c 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2215,7 +2215,7 @@ static struct pci_device_id hfc_ids[] =
2215 {}, 2215 {},
2216}; 2216};
2217 2217
2218static int __devinit 2218static int
2219hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 2219hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2220{ 2220{
2221 int err = -ENOMEM; 2221 int err = -ENOMEM;
@@ -2246,7 +2246,7 @@ hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2246 return err; 2246 return err;
2247} 2247}
2248 2248
2249static void __devexit 2249static void
2250hfc_remove_pci(struct pci_dev *pdev) 2250hfc_remove_pci(struct pci_dev *pdev)
2251{ 2251{
2252 struct hfc_pci *card = pci_get_drvdata(pdev); 2252 struct hfc_pci *card = pci_get_drvdata(pdev);
@@ -2263,7 +2263,7 @@ hfc_remove_pci(struct pci_dev *pdev)
2263static struct pci_driver hfc_driver = { 2263static struct pci_driver hfc_driver = {
2264 .name = "hfcpci", 2264 .name = "hfcpci",
2265 .probe = hfc_probe, 2265 .probe = hfc_probe,
2266 .remove = __devexit_p(hfc_remove_pci), 2266 .remove = hfc_remove_pci,
2267 .id_table = hfc_ids, 2267 .id_table = hfc_ids,
2268}; 2268};
2269 2269
diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
index 631eb3fa63c..c1493f4162f 100644
--- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
@@ -125,7 +125,7 @@ struct inf_hw {
125#define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53 125#define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53
126#define PCI_SUB_ID_SEDLBAUER 0x01 126#define PCI_SUB_ID_SEDLBAUER 0x01
127 127
128static struct pci_device_id infineon_ids[] __devinitdata = { 128static struct pci_device_id infineon_ids[] = {
129 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20), INF_DIVA20 }, 129 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20), INF_DIVA20 },
130 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20_U), INF_DIVA20U }, 130 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20_U), INF_DIVA20U },
131 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA201), INF_DIVA201 }, 131 { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA201), INF_DIVA201 },
@@ -603,7 +603,7 @@ inf_ctrl(struct inf_hw *hw, u32 cmd, u_long arg)
603 return ret; 603 return ret;
604} 604}
605 605
606static int __devinit 606static int
607init_irq(struct inf_hw *hw) 607init_irq(struct inf_hw *hw)
608{ 608{
609 int ret, cnt = 3; 609 int ret, cnt = 3;
@@ -662,7 +662,7 @@ release_io(struct inf_hw *hw)
662 } 662 }
663} 663}
664 664
665static int __devinit 665static int
666setup_io(struct inf_hw *hw) 666setup_io(struct inf_hw *hw)
667{ 667{
668 int err = 0; 668 int err = 0;
@@ -896,7 +896,7 @@ release_card(struct inf_hw *card) {
896 inf_cnt--; 896 inf_cnt--;
897} 897}
898 898
899static int __devinit 899static int
900setup_instance(struct inf_hw *card) 900setup_instance(struct inf_hw *card)
901{ 901{
902 int err; 902 int err;
@@ -1060,7 +1060,7 @@ static const struct inf_cinfo inf_card_info[] = {
1060 } 1060 }
1061}; 1061};
1062 1062
1063static const struct inf_cinfo * __devinit 1063static const struct inf_cinfo *
1064get_card_info(enum inf_types typ) 1064get_card_info(enum inf_types typ)
1065{ 1065{
1066 const struct inf_cinfo *ci = inf_card_info; 1066 const struct inf_cinfo *ci = inf_card_info;
@@ -1073,7 +1073,7 @@ get_card_info(enum inf_types typ)
1073 return NULL; 1073 return NULL;
1074} 1074}
1075 1075
1076static int __devinit 1076static int
1077inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1077inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1078{ 1078{
1079 int err = -ENOMEM; 1079 int err = -ENOMEM;
@@ -1135,7 +1135,7 @@ inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1135 return err; 1135 return err;
1136} 1136}
1137 1137
1138static void __devexit 1138static void
1139inf_remove(struct pci_dev *pdev) 1139inf_remove(struct pci_dev *pdev)
1140{ 1140{
1141 struct inf_hw *card = pci_get_drvdata(pdev); 1141 struct inf_hw *card = pci_get_drvdata(pdev);
@@ -1149,7 +1149,7 @@ inf_remove(struct pci_dev *pdev)
1149static struct pci_driver infineon_driver = { 1149static struct pci_driver infineon_driver = {
1150 .name = "ISDN Infineon pci", 1150 .name = "ISDN Infineon pci",
1151 .probe = inf_probe, 1151 .probe = inf_probe,
1152 .remove = __devexit_p(inf_remove), 1152 .remove = inf_remove,
1153 .id_table = infineon_ids, 1153 .id_table = infineon_ids,
1154}; 1154};
1155 1155
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c
index 9bcade59eb7..8e2944784e0 100644
--- a/drivers/isdn/hardware/mISDN/netjet.c
+++ b/drivers/isdn/hardware/mISDN/netjet.c
@@ -1008,7 +1008,7 @@ nj_setup(struct tiger_hw *card)
1008} 1008}
1009 1009
1010 1010
1011static int __devinit 1011static int
1012setup_instance(struct tiger_hw *card) 1012setup_instance(struct tiger_hw *card)
1013{ 1013{
1014 int i, err; 1014 int i, err;
@@ -1059,7 +1059,7 @@ error:
1059 return err; 1059 return err;
1060} 1060}
1061 1061
1062static int __devinit 1062static int
1063nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1063nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1064{ 1064{
1065 int err = -ENOMEM; 1065 int err = -ENOMEM;
@@ -1124,7 +1124,7 @@ nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1124} 1124}
1125 1125
1126 1126
1127static void __devexit nj_remove(struct pci_dev *pdev) 1127static void nj_remove(struct pci_dev *pdev)
1128{ 1128{
1129 struct tiger_hw *card = pci_get_drvdata(pdev); 1129 struct tiger_hw *card = pci_get_drvdata(pdev);
1130 1130
@@ -1137,7 +1137,7 @@ static void __devexit nj_remove(struct pci_dev *pdev)
1137/* We cannot select cards with PCI_SUB... IDs, since here are cards with 1137/* We cannot select cards with PCI_SUB... IDs, since here are cards with
1138 * SUB IDs set to PCI_ANY_ID, so we need to match all and reject 1138 * SUB IDs set to PCI_ANY_ID, so we need to match all and reject
1139 * known other cards which not work with this driver - see probe function */ 1139 * known other cards which not work with this driver - see probe function */
1140static struct pci_device_id nj_pci_ids[] __devinitdata = { 1140static struct pci_device_id nj_pci_ids[] = {
1141 { PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_300, 1141 { PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_300,
1142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
1143 { } 1143 { }
@@ -1147,7 +1147,7 @@ MODULE_DEVICE_TABLE(pci, nj_pci_ids);
1147static struct pci_driver nj_driver = { 1147static struct pci_driver nj_driver = {
1148 .name = "netjet", 1148 .name = "netjet",
1149 .probe = nj_probe, 1149 .probe = nj_probe,
1150 .remove = __devexit_p(nj_remove), 1150 .remove = nj_remove,
1151 .id_table = nj_pci_ids, 1151 .id_table = nj_pci_ids,
1152}; 1152};
1153 1153
diff --git a/drivers/isdn/hardware/mISDN/speedfax.c b/drivers/isdn/hardware/mISDN/speedfax.c
index 93f344d74e5..9815bb4eec9 100644
--- a/drivers/isdn/hardware/mISDN/speedfax.c
+++ b/drivers/isdn/hardware/mISDN/speedfax.c
@@ -282,7 +282,7 @@ sfax_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg)
282 return err; 282 return err;
283} 283}
284 284
285static int __devinit 285static int
286init_card(struct sfax_hw *sf) 286init_card(struct sfax_hw *sf)
287{ 287{
288 int ret, cnt = 3; 288 int ret, cnt = 3;
@@ -321,7 +321,7 @@ init_card(struct sfax_hw *sf)
321} 321}
322 322
323 323
324static int __devinit 324static int
325setup_speedfax(struct sfax_hw *sf) 325setup_speedfax(struct sfax_hw *sf)
326{ 326{
327 u_long flags; 327 u_long flags;
@@ -371,7 +371,7 @@ release_card(struct sfax_hw *card) {
371 sfax_cnt--; 371 sfax_cnt--;
372} 372}
373 373
374static int __devinit 374static int
375setup_instance(struct sfax_hw *card) 375setup_instance(struct sfax_hw *card)
376{ 376{
377 const struct firmware *firmware; 377 const struct firmware *firmware;
@@ -451,7 +451,7 @@ error_fw:
451 return err; 451 return err;
452} 452}
453 453
454static int __devinit 454static int
455sfaxpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 455sfaxpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
456{ 456{
457 int err = -ENOMEM; 457 int err = -ENOMEM;
@@ -480,7 +480,7 @@ sfaxpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
480 return err; 480 return err;
481} 481}
482 482
483static void __devexit 483static void
484sfax_remove_pci(struct pci_dev *pdev) 484sfax_remove_pci(struct pci_dev *pdev)
485{ 485{
486 struct sfax_hw *card = pci_get_drvdata(pdev); 486 struct sfax_hw *card = pci_get_drvdata(pdev);
@@ -491,7 +491,7 @@ sfax_remove_pci(struct pci_dev *pdev)
491 pr_debug("%s: drvdata already removed\n", __func__); 491 pr_debug("%s: drvdata already removed\n", __func__);
492} 492}
493 493
494static struct pci_device_id sfaxpci_ids[] __devinitdata = { 494static struct pci_device_id sfaxpci_ids[] = {
495 { PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_100, 495 { PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_100,
496 PCI_SUBVENDOR_SPEEDFAX_PYRAMID, PCI_SUB_ID_SEDLBAUER, 496 PCI_SUBVENDOR_SPEEDFAX_PYRAMID, PCI_SUB_ID_SEDLBAUER,
497 0, 0, (unsigned long) "Pyramid Speedfax + PCI" 497 0, 0, (unsigned long) "Pyramid Speedfax + PCI"
@@ -507,7 +507,7 @@ MODULE_DEVICE_TABLE(pci, sfaxpci_ids);
507static struct pci_driver sfaxpci_driver = { 507static struct pci_driver sfaxpci_driver = {
508 .name = "speedfax+ pci", 508 .name = "speedfax+ pci",
509 .probe = sfaxpci_probe, 509 .probe = sfaxpci_probe,
510 .remove = __devexit_p(sfax_remove_pci), 510 .remove = sfax_remove_pci,
511 .id_table = sfaxpci_ids, 511 .id_table = sfaxpci_ids,
512}; 512};
513 513
diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c
index 335fe645500..de69f6828c7 100644
--- a/drivers/isdn/hardware/mISDN/w6692.c
+++ b/drivers/isdn/hardware/mISDN/w6692.c
@@ -1355,7 +1355,7 @@ error_setup:
1355 return err; 1355 return err;
1356} 1356}
1357 1357
1358static int __devinit 1358static int
1359w6692_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1359w6692_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1360{ 1360{
1361 int err = -ENOMEM; 1361 int err = -ENOMEM;
@@ -1387,7 +1387,7 @@ w6692_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1387 return err; 1387 return err;
1388} 1388}
1389 1389
1390static void __devexit 1390static void
1391w6692_remove_pci(struct pci_dev *pdev) 1391w6692_remove_pci(struct pci_dev *pdev)
1392{ 1392{
1393 struct w6692_hw *card = pci_get_drvdata(pdev); 1393 struct w6692_hw *card = pci_get_drvdata(pdev);
@@ -1414,7 +1414,7 @@ MODULE_DEVICE_TABLE(pci, w6692_ids);
1414static struct pci_driver w6692_driver = { 1414static struct pci_driver w6692_driver = {
1415 .name = "w6692", 1415 .name = "w6692",
1416 .probe = w6692_probe, 1416 .probe = w6692_probe,
1417 .remove = __devexit_p(w6692_remove_pci), 1417 .remove = w6692_remove_pci,
1418 .id_table = w6692_ids, 1418 .id_table = w6692_ids,
1419}; 1419};
1420 1420
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c
index 525471e776a..1063babe1d3 100644
--- a/drivers/isdn/hisax/amd7930_fn.c
+++ b/drivers/isdn/hisax/amd7930_fn.c
@@ -786,8 +786,7 @@ void Amd7930_init(struct IsdnCardState *cs)
786 } 786 }
787} 787}
788 788
789void __devinit 789void setup_Amd7930(struct IsdnCardState *cs)
790setup_Amd7930(struct IsdnCardState *cs)
791{ 790{
792 INIT_WORK(&cs->tqueue, Amd7930_bh); 791 INIT_WORK(&cs->tqueue, Amd7930_bh);
793 cs->dbusytimer.function = (void *) dbusy_timer_handler; 792 cs->dbusytimer.function = (void *) dbusy_timer_handler;
diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c
index 2b74a40ad2a..62f9c43e237 100644
--- a/drivers/isdn/hisax/asuscom.c
+++ b/drivers/isdn/hisax/asuscom.c
@@ -295,7 +295,7 @@ Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg)
295} 295}
296 296
297#ifdef __ISAPNP__ 297#ifdef __ISAPNP__
298static struct isapnp_device_id asus_ids[] __devinitdata = { 298static struct isapnp_device_id asus_ids[] = {
299 { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), 299 { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
300 ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), 300 ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
301 (unsigned long) "Asus1688 PnP" }, 301 (unsigned long) "Asus1688 PnP" },
@@ -311,12 +311,11 @@ static struct isapnp_device_id asus_ids[] __devinitdata = {
311 { 0, } 311 { 0, }
312}; 312};
313 313
314static struct isapnp_device_id *ipid __devinitdata = &asus_ids[0]; 314static struct isapnp_device_id *ipid = &asus_ids[0];
315static struct pnp_card *pnp_c __devinitdata = NULL; 315static struct pnp_card *pnp_c = NULL;
316#endif 316#endif
317 317
318int __devinit 318int setup_asuscom(struct IsdnCard *card)
319setup_asuscom(struct IsdnCard *card)
320{ 319{
321 int bytecnt; 320 int bytecnt;
322 struct IsdnCardState *cs = card->cs; 321 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/avm_a1.c b/drivers/isdn/hisax/avm_a1.c
index 402d489cbbf..7dd74087ad7 100644
--- a/drivers/isdn/hisax/avm_a1.c
+++ b/drivers/isdn/hisax/avm_a1.c
@@ -177,8 +177,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
177 return (0); 177 return (0);
178} 178}
179 179
180int __devinit 180int setup_avm_a1(struct IsdnCard *card)
181setup_avm_a1(struct IsdnCard *card)
182{ 181{
183 u_char val; 182 u_char val;
184 struct IsdnCardState *cs = card->cs; 183 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/avm_a1p.c b/drivers/isdn/hisax/avm_a1p.c
index 39347198d64..bc52d54ff5e 100644
--- a/drivers/isdn/hisax/avm_a1p.c
+++ b/drivers/isdn/hisax/avm_a1p.c
@@ -213,7 +213,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
213 return 0; 213 return 0;
214} 214}
215 215
216int __devinit setup_avm_a1_pcmcia(struct IsdnCard *card) 216int setup_avm_a1_pcmcia(struct IsdnCard *card)
217{ 217{
218 u_char model, vers; 218 u_char model, vers;
219 struct IsdnCardState *cs = card->cs; 219 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 979492d69da..ee9b9a03cff 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -718,7 +718,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
718 return (0); 718 return (0);
719} 719}
720 720
721static int __devinit avm_setup_rest(struct IsdnCardState *cs) 721static int avm_setup_rest(struct IsdnCardState *cs)
722{ 722{
723 u_int val, ver; 723 u_int val, ver;
724 724
@@ -770,16 +770,16 @@ static int __devinit avm_setup_rest(struct IsdnCardState *cs)
770 770
771#ifndef __ISAPNP__ 771#ifndef __ISAPNP__
772 772
773static int __devinit avm_pnp_setup(struct IsdnCardState *cs) 773static int avm_pnp_setup(struct IsdnCardState *cs)
774{ 774{
775 return (1); /* no-op: success */ 775 return (1); /* no-op: success */
776} 776}
777 777
778#else 778#else
779 779
780static struct pnp_card *pnp_avm_c __devinitdata = NULL; 780static struct pnp_card *pnp_avm_c = NULL;
781 781
782static int __devinit avm_pnp_setup(struct IsdnCardState *cs) 782static int avm_pnp_setup(struct IsdnCardState *cs)
783{ 783{
784 struct pnp_dev *pnp_avm_d = NULL; 784 struct pnp_dev *pnp_avm_d = NULL;
785 785
@@ -825,16 +825,16 @@ static int __devinit avm_pnp_setup(struct IsdnCardState *cs)
825 825
826#ifndef CONFIG_PCI 826#ifndef CONFIG_PCI
827 827
828static int __devinit avm_pci_setup(struct IsdnCardState *cs) 828static int avm_pci_setup(struct IsdnCardState *cs)
829{ 829{
830 return (1); /* no-op: success */ 830 return (1); /* no-op: success */
831} 831}
832 832
833#else 833#else
834 834
835static struct pci_dev *dev_avm __devinitdata = NULL; 835static struct pci_dev *dev_avm = NULL;
836 836
837static int __devinit avm_pci_setup(struct IsdnCardState *cs) 837static int avm_pci_setup(struct IsdnCardState *cs)
838{ 838{
839 if ((dev_avm = hisax_find_pci_device(PCI_VENDOR_ID_AVM, 839 if ((dev_avm = hisax_find_pci_device(PCI_VENDOR_ID_AVM,
840 PCI_DEVICE_ID_AVM_A1, dev_avm))) { 840 PCI_DEVICE_ID_AVM_A1, dev_avm))) {
@@ -867,8 +867,7 @@ static int __devinit avm_pci_setup(struct IsdnCardState *cs)
867 867
868#endif /* CONFIG_PCI */ 868#endif /* CONFIG_PCI */
869 869
870int __devinit 870int setup_avm_pcipnp(struct IsdnCard *card)
871setup_avm_pcipnp(struct IsdnCard *card)
872{ 871{
873 struct IsdnCardState *cs = card->cs; 872 struct IsdnCardState *cs = card->cs;
874 char tmp[64]; 873 char tmp[64];
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index c644557ae61..4e676bcf850 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -38,11 +38,11 @@ module_param(isdnprot, int, 0);
38 38
39/*====================================================================*/ 39/*====================================================================*/
40 40
41static int avma1cs_config(struct pcmcia_device *link) __devinit; 41static int avma1cs_config(struct pcmcia_device *link);
42static void avma1cs_release(struct pcmcia_device *link); 42static void avma1cs_release(struct pcmcia_device *link);
43static void avma1cs_detach(struct pcmcia_device *p_dev) __devexit; 43static void avma1cs_detach(struct pcmcia_device *p_dev);
44 44
45static int __devinit avma1cs_probe(struct pcmcia_device *p_dev) 45static int avma1cs_probe(struct pcmcia_device *p_dev)
46{ 46{
47 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 47 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
48 48
@@ -54,7 +54,7 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
54 return avma1cs_config(p_dev); 54 return avma1cs_config(p_dev);
55} /* avma1cs_attach */ 55} /* avma1cs_attach */
56 56
57static void __devexit avma1cs_detach(struct pcmcia_device *link) 57static void avma1cs_detach(struct pcmcia_device *link)
58{ 58{
59 dev_dbg(&link->dev, "avma1cs_detach(0x%p)\n", link); 59 dev_dbg(&link->dev, "avma1cs_detach(0x%p)\n", link);
60 avma1cs_release(link); 60 avma1cs_release(link);
@@ -72,7 +72,7 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev, void *priv_data)
72} 72}
73 73
74 74
75static int __devinit avma1cs_config(struct pcmcia_device *link) 75static int avma1cs_config(struct pcmcia_device *link)
76{ 76{
77 int i = -1; 77 int i = -1;
78 char devname[128]; 78 char devname[128];
@@ -156,7 +156,7 @@ static struct pcmcia_driver avma1cs_driver = {
156 .owner = THIS_MODULE, 156 .owner = THIS_MODULE,
157 .name = "avma1_cs", 157 .name = "avma1_cs",
158 .probe = avma1cs_probe, 158 .probe = avma1cs_probe,
159 .remove = __devexit_p(avma1cs_detach), 159 .remove = avma1cs_detach,
160 .id_table = avma1cs_ids, 160 .id_table = avma1cs_ids,
161}; 161};
162 162
diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c
index f6bf9c68892..c360164bde1 100644
--- a/drivers/isdn/hisax/bkm_a4t.c
+++ b/drivers/isdn/hisax/bkm_a4t.c
@@ -253,10 +253,8 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
253 return (0); 253 return (0);
254} 254}
255 255
256static int __devinit a4t_pci_probe(struct pci_dev *dev_a4t, 256static int a4t_pci_probe(struct pci_dev *dev_a4t, struct IsdnCardState *cs,
257 struct IsdnCardState *cs, 257 u_int *found, u_int *pci_memaddr)
258 u_int *found,
259 u_int *pci_memaddr)
260{ 258{
261 u16 sub_sys; 259 u16 sub_sys;
262 u16 sub_vendor; 260 u16 sub_vendor;
@@ -275,9 +273,8 @@ static int __devinit a4t_pci_probe(struct pci_dev *dev_a4t,
275 return (-1); /* continue looping */ 273 return (-1); /* continue looping */
276} 274}
277 275
278static int __devinit a4t_cs_init(struct IsdnCard *card, 276static int a4t_cs_init(struct IsdnCard *card, struct IsdnCardState *cs,
279 struct IsdnCardState *cs, 277 u_int pci_memaddr)
280 u_int pci_memaddr)
281{ 278{
282 I20_REGISTER_FILE *pI20_Regs; 279 I20_REGISTER_FILE *pI20_Regs;
283 280
@@ -323,10 +320,9 @@ static int __devinit a4t_cs_init(struct IsdnCard *card,
323 return (1); 320 return (1);
324} 321}
325 322
326static struct pci_dev *dev_a4t __devinitdata = NULL; 323static struct pci_dev *dev_a4t = NULL;
327 324
328int __devinit 325int setup_bkm_a4t(struct IsdnCard *card)
329setup_bkm_a4t(struct IsdnCard *card)
330{ 326{
331 struct IsdnCardState *cs = card->cs; 327 struct IsdnCardState *cs = card->cs;
332 char tmp[64]; 328 char tmp[64];
diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c
index c9c98f071af..dd663ea57ec 100644
--- a/drivers/isdn/hisax/bkm_a8.c
+++ b/drivers/isdn/hisax/bkm_a8.c
@@ -255,8 +255,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
255 return (0); 255 return (0);
256} 256}
257 257
258static int __devinit 258static int sct_alloc_io(u_int adr, u_int len)
259sct_alloc_io(u_int adr, u_int len)
260{ 259{
261 if (!request_region(adr, len, "scitel")) { 260 if (!request_region(adr, len, "scitel")) {
262 printk(KERN_WARNING 261 printk(KERN_WARNING
@@ -267,15 +266,14 @@ sct_alloc_io(u_int adr, u_int len)
267 return (0); 266 return (0);
268} 267}
269 268
270static struct pci_dev *dev_a8 __devinitdata = NULL; 269static struct pci_dev *dev_a8 = NULL;
271static u16 sub_vendor_id __devinitdata = 0; 270static u16 sub_vendor_id = 0;
272static u16 sub_sys_id __devinitdata = 0; 271static u16 sub_sys_id = 0;
273static u_char pci_bus __devinitdata = 0; 272static u_char pci_bus = 0;
274static u_char pci_device_fn __devinitdata = 0; 273static u_char pci_device_fn = 0;
275static u_char pci_irq __devinitdata = 0; 274static u_char pci_irq = 0;
276 275
277int __devinit 276int setup_sct_quadro(struct IsdnCard *card)
278setup_sct_quadro(struct IsdnCard *card)
279{ 277{
280 struct IsdnCardState *cs = card->cs; 278 struct IsdnCardState *cs = card->cs;
281 char tmp[64]; 279 char tmp[64];
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index b5edc0eeec0..bf04d2a3cf4 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -338,11 +338,11 @@ static int io[HISAX_MAX_CARDS] = { 0, };
338#define IO0_IO1 338#define IO0_IO1
339#endif 339#endif
340#ifdef IO0_IO1 340#ifdef IO0_IO1
341static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, }; 341static int io0[HISAX_MAX_CARDS] = { 0, };
342static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, }; 342static int io1[HISAX_MAX_CARDS] = { 0, };
343#endif 343#endif
344static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, }; 344static int irq[HISAX_MAX_CARDS] = { 0, };
345static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, }; 345static int mem[HISAX_MAX_CARDS] = { 0, };
346static char *id = HiSaxID; 346static char *id = HiSaxID;
347 347
348MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards"); 348MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
@@ -852,7 +852,7 @@ static int init_card(struct IsdnCardState *cs)
852 return 3; 852 return 3;
853} 853}
854 854
855static int __devinit hisax_cs_setup_card(struct IsdnCard *card) 855static int hisax_cs_setup_card(struct IsdnCard *card)
856{ 856{
857 int ret; 857 int ret;
858 858
@@ -1171,12 +1171,8 @@ outf_cs:
1171 return 0; 1171 return 0;
1172} 1172}
1173 1173
1174/* Used from an exported function but calls __devinit functions. 1174static int checkcard(int cardnr, char *id, int *busy_flag,
1175 * Tell modpost not to warn (__ref) 1175 struct module *lockowner, hisax_setup_func_t card_setup)
1176 */
1177static int __ref checkcard(int cardnr, char *id, int *busy_flag,
1178 struct module *lockowner,
1179 hisax_setup_func_t card_setup)
1180{ 1176{
1181 int ret; 1177 int ret;
1182 struct IsdnCard *card = cards + cardnr; 1178 struct IsdnCard *card = cards + cardnr;
@@ -1547,9 +1543,7 @@ static void __exit HiSax_exit(void)
1547 printk(KERN_INFO "HiSax module removed\n"); 1543 printk(KERN_INFO "HiSax module removed\n");
1548} 1544}
1549 1545
1550#ifdef CONFIG_HOTPLUG 1546int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
1551
1552int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
1553{ 1547{
1554 u_char ids[16]; 1548 u_char ids[16];
1555 int ret = -1; 1549 int ret = -1;
@@ -1568,9 +1562,7 @@ int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *
1568error: 1562error:
1569 return ret; 1563 return ret;
1570} 1564}
1571
1572EXPORT_SYMBOL(hisax_init_pcmcia); 1565EXPORT_SYMBOL(hisax_init_pcmcia);
1573#endif
1574 1566
1575EXPORT_SYMBOL(HiSax_closecard); 1567EXPORT_SYMBOL(HiSax_closecard);
1576 1568
@@ -1917,7 +1909,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
1917#ifdef CONFIG_PCI 1909#ifdef CONFIG_PCI
1918#include <linux/pci.h> 1910#include <linux/pci.h>
1919 1911
1920static struct pci_device_id hisax_pci_tbl[] __devinitdata __used = { 1912static struct pci_device_id hisax_pci_tbl[] __used = {
1921#ifdef CONFIG_HISAX_FRITZPCI 1913#ifdef CONFIG_HISAX_FRITZPCI
1922 {PCI_VDEVICE(AVM, PCI_DEVICE_ID_AVM_A1) }, 1914 {PCI_VDEVICE(AVM, PCI_DEVICE_ID_AVM_A1) },
1923#endif 1915#endif
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 62a2945fa7f..8d0cf6e4dc0 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -904,7 +904,7 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg)
904 return (0); 904 return (0);
905} 905}
906 906
907static int __devinit setup_diva_common(struct IsdnCardState *cs) 907static int setup_diva_common(struct IsdnCardState *cs)
908{ 908{
909 int bytecnt; 909 int bytecnt;
910 u_char val; 910 u_char val;
@@ -997,7 +997,7 @@ static int __devinit setup_diva_common(struct IsdnCardState *cs)
997 997
998#ifdef CONFIG_ISA 998#ifdef CONFIG_ISA
999 999
1000static int __devinit setup_diva_isa(struct IsdnCard *card) 1000static int setup_diva_isa(struct IsdnCard *card)
1001{ 1001{
1002 struct IsdnCardState *cs = card->cs; 1002 struct IsdnCardState *cs = card->cs;
1003 u_char val; 1003 u_char val;
@@ -1033,7 +1033,7 @@ static int __devinit setup_diva_isa(struct IsdnCard *card)
1033 1033
1034#else /* if !CONFIG_ISA */ 1034#else /* if !CONFIG_ISA */
1035 1035
1036static int __devinit setup_diva_isa(struct IsdnCard *card) 1036static int setup_diva_isa(struct IsdnCard *card)
1037{ 1037{
1038 return (-1); /* card not found; continue search */ 1038 return (-1); /* card not found; continue search */
1039} 1039}
@@ -1041,7 +1041,7 @@ static int __devinit setup_diva_isa(struct IsdnCard *card)
1041#endif /* CONFIG_ISA */ 1041#endif /* CONFIG_ISA */
1042 1042
1043#ifdef __ISAPNP__ 1043#ifdef __ISAPNP__
1044static struct isapnp_device_id diva_ids[] __devinitdata = { 1044static struct isapnp_device_id diva_ids[] = {
1045 { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), 1045 { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
1046 ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), 1046 ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
1047 (unsigned long) "Diva picola" }, 1047 (unsigned long) "Diva picola" },
@@ -1063,10 +1063,10 @@ static struct isapnp_device_id diva_ids[] __devinitdata = {
1063 { 0, } 1063 { 0, }
1064}; 1064};
1065 1065
1066static struct isapnp_device_id *ipid __devinitdata = &diva_ids[0]; 1066static struct isapnp_device_id *ipid = &diva_ids[0];
1067static struct pnp_card *pnp_c __devinitdata = NULL; 1067static struct pnp_card *pnp_c = NULL;
1068 1068
1069static int __devinit setup_diva_isapnp(struct IsdnCard *card) 1069static int setup_diva_isapnp(struct IsdnCard *card)
1070{ 1070{
1071 struct IsdnCardState *cs = card->cs; 1071 struct IsdnCardState *cs = card->cs;
1072 struct pnp_dev *pnp_d; 1072 struct pnp_dev *pnp_d;
@@ -1141,7 +1141,7 @@ static int __devinit setup_diva_isapnp(struct IsdnCard *card)
1141 1141
1142#else /* if !ISAPNP */ 1142#else /* if !ISAPNP */
1143 1143
1144static int __devinit setup_diva_isapnp(struct IsdnCard *card) 1144static int setup_diva_isapnp(struct IsdnCard *card)
1145{ 1145{
1146 return (-1); /* card not found; continue search */ 1146 return (-1); /* card not found; continue search */
1147} 1147}
@@ -1149,12 +1149,12 @@ static int __devinit setup_diva_isapnp(struct IsdnCard *card)
1149#endif /* ISAPNP */ 1149#endif /* ISAPNP */
1150 1150
1151#ifdef CONFIG_PCI 1151#ifdef CONFIG_PCI
1152static struct pci_dev *dev_diva __devinitdata = NULL; 1152static struct pci_dev *dev_diva = NULL;
1153static struct pci_dev *dev_diva_u __devinitdata = NULL; 1153static struct pci_dev *dev_diva_u = NULL;
1154static struct pci_dev *dev_diva201 __devinitdata = NULL; 1154static struct pci_dev *dev_diva201 = NULL;
1155static struct pci_dev *dev_diva202 __devinitdata = NULL; 1155static struct pci_dev *dev_diva202 = NULL;
1156 1156
1157static int __devinit setup_diva_pci(struct IsdnCard *card) 1157static int setup_diva_pci(struct IsdnCard *card)
1158{ 1158{
1159 struct IsdnCardState *cs = card->cs; 1159 struct IsdnCardState *cs = card->cs;
1160 1160
@@ -1231,15 +1231,14 @@ static int __devinit setup_diva_pci(struct IsdnCard *card)
1231 1231
1232#else /* if !CONFIG_PCI */ 1232#else /* if !CONFIG_PCI */
1233 1233
1234static int __devinit setup_diva_pci(struct IsdnCard *card) 1234static int setup_diva_pci(struct IsdnCard *card)
1235{ 1235{
1236 return (-1); /* card not found; continue search */ 1236 return (-1); /* card not found; continue search */
1237} 1237}
1238 1238
1239#endif /* CONFIG_PCI */ 1239#endif /* CONFIG_PCI */
1240 1240
1241int __devinit 1241int setup_diva(struct IsdnCard *card)
1242setup_diva(struct IsdnCard *card)
1243{ 1242{
1244 int rc, have_card = 0; 1243 int rc, have_card = 0;
1245 struct IsdnCardState *cs = card->cs; 1244 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index 64ba26a4afe..1df6f9a56ca 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -831,8 +831,7 @@ probe_elsa(struct IsdnCardState *cs)
831 return (CARD_portlist[i]); 831 return (CARD_portlist[i]);
832} 832}
833 833
834static int __devinit 834static int setup_elsa_isa(struct IsdnCard *card)
835setup_elsa_isa(struct IsdnCard *card)
836{ 835{
837 struct IsdnCardState *cs = card->cs; 836 struct IsdnCardState *cs = card->cs;
838 u_char val; 837 u_char val;
@@ -902,7 +901,7 @@ setup_elsa_isa(struct IsdnCard *card)
902} 901}
903 902
904#ifdef __ISAPNP__ 903#ifdef __ISAPNP__
905static struct isapnp_device_id elsa_ids[] __devinitdata = { 904static struct isapnp_device_id elsa_ids[] = {
906 { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133), 905 { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
907 ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133), 906 ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
908 (unsigned long) "Elsa QS1000" }, 907 (unsigned long) "Elsa QS1000" },
@@ -912,12 +911,11 @@ static struct isapnp_device_id elsa_ids[] __devinitdata = {
912 { 0, } 911 { 0, }
913}; 912};
914 913
915static struct isapnp_device_id *ipid __devinitdata = &elsa_ids[0]; 914static struct isapnp_device_id *ipid = &elsa_ids[0];
916static struct pnp_card *pnp_c __devinitdata = NULL; 915static struct pnp_card *pnp_c = NULL;
917#endif /* __ISAPNP__ */ 916#endif /* __ISAPNP__ */
918 917
919static int __devinit 918static int setup_elsa_isapnp(struct IsdnCard *card)
920setup_elsa_isapnp(struct IsdnCard *card)
921{ 919{
922 struct IsdnCardState *cs = card->cs; 920 struct IsdnCardState *cs = card->cs;
923 921
@@ -994,8 +992,7 @@ setup_elsa_isapnp(struct IsdnCard *card)
994 return (1); 992 return (1);
995} 993}
996 994
997static void __devinit 995static void setup_elsa_pcmcia(struct IsdnCard *card)
998setup_elsa_pcmcia(struct IsdnCard *card)
999{ 996{
1000 struct IsdnCardState *cs = card->cs; 997 struct IsdnCardState *cs = card->cs;
1001 u_char val; 998 u_char val;
@@ -1027,11 +1024,10 @@ setup_elsa_pcmcia(struct IsdnCard *card)
1027} 1024}
1028 1025
1029#ifdef CONFIG_PCI 1026#ifdef CONFIG_PCI
1030static struct pci_dev *dev_qs1000 __devinitdata = NULL; 1027static struct pci_dev *dev_qs1000 = NULL;
1031static struct pci_dev *dev_qs3000 __devinitdata = NULL; 1028static struct pci_dev *dev_qs3000 = NULL;
1032 1029
1033static int __devinit 1030static int setup_elsa_pci(struct IsdnCard *card)
1034setup_elsa_pci(struct IsdnCard *card)
1035{ 1031{
1036 struct IsdnCardState *cs = card->cs; 1032 struct IsdnCardState *cs = card->cs;
1037 1033
@@ -1089,15 +1085,13 @@ setup_elsa_pci(struct IsdnCard *card)
1089 1085
1090#else 1086#else
1091 1087
1092static int __devinit 1088static int setup_elsa_pci(struct IsdnCard *card)
1093setup_elsa_pci(struct IsdnCard *card)
1094{ 1089{
1095 return (1); 1090 return (1);
1096} 1091}
1097#endif /* CONFIG_PCI */ 1092#endif /* CONFIG_PCI */
1098 1093
1099static int __devinit 1094static int setup_elsa_common(struct IsdnCard *card)
1100setup_elsa_common(struct IsdnCard *card)
1101{ 1095{
1102 struct IsdnCardState *cs = card->cs; 1096 struct IsdnCardState *cs = card->cs;
1103 u_char val; 1097 u_char val;
@@ -1212,8 +1206,7 @@ setup_elsa_common(struct IsdnCard *card)
1212 return (1); 1206 return (1);
1213} 1207}
1214 1208
1215int __devinit 1209int setup_elsa(struct IsdnCard *card)
1216setup_elsa(struct IsdnCard *card)
1217{ 1210{
1218 int rc; 1211 int rc;
1219 struct IsdnCardState *cs = card->cs; 1212 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index a8c4d3fc9a6..ebe56918f6f 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -62,9 +62,9 @@ MODULE_LICENSE("Dual MPL/GPL");
62static int protocol = 2; /* EURO-ISDN Default */ 62static int protocol = 2; /* EURO-ISDN Default */
63module_param(protocol, int, 0); 63module_param(protocol, int, 0);
64 64
65static int elsa_cs_config(struct pcmcia_device *link) __devinit; 65static int elsa_cs_config(struct pcmcia_device *link);
66static void elsa_cs_release(struct pcmcia_device *link); 66static void elsa_cs_release(struct pcmcia_device *link);
67static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit; 67static void elsa_cs_detach(struct pcmcia_device *p_dev);
68 68
69typedef struct local_info_t { 69typedef struct local_info_t {
70 struct pcmcia_device *p_dev; 70 struct pcmcia_device *p_dev;
@@ -72,7 +72,7 @@ typedef struct local_info_t {
72 int cardnr; 72 int cardnr;
73} local_info_t; 73} local_info_t;
74 74
75static int __devinit elsa_cs_probe(struct pcmcia_device *link) 75static int elsa_cs_probe(struct pcmcia_device *link)
76{ 76{
77 local_info_t *local; 77 local_info_t *local;
78 78
@@ -90,7 +90,7 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
90 return elsa_cs_config(link); 90 return elsa_cs_config(link);
91} /* elsa_cs_attach */ 91} /* elsa_cs_attach */
92 92
93static void __devexit elsa_cs_detach(struct pcmcia_device *link) 93static void elsa_cs_detach(struct pcmcia_device *link)
94{ 94{
95 local_info_t *info = link->priv; 95 local_info_t *info = link->priv;
96 96
@@ -126,7 +126,7 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev, void *priv_data)
126 return -ENODEV; 126 return -ENODEV;
127} 127}
128 128
129static int __devinit elsa_cs_config(struct pcmcia_device *link) 129static int elsa_cs_config(struct pcmcia_device *link)
130{ 130{
131 int i; 131 int i;
132 IsdnCard_t icard; 132 IsdnCard_t icard;
@@ -210,7 +210,7 @@ static struct pcmcia_driver elsa_cs_driver = {
210 .owner = THIS_MODULE, 210 .owner = THIS_MODULE,
211 .name = "elsa_cs", 211 .name = "elsa_cs",
212 .probe = elsa_cs_probe, 212 .probe = elsa_cs_probe,
213 .remove = __devexit_p(elsa_cs_detach), 213 .remove = elsa_cs_detach,
214 .id_table = elsa_ids, 214 .id_table = elsa_ids,
215 .suspend = elsa_suspend, 215 .suspend = elsa_suspend,
216 .resume = elsa_resume, 216 .resume = elsa_resume,
diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c
index b1e38b54eba..e8d431a8302 100644
--- a/drivers/isdn/hisax/enternow_pci.c
+++ b/drivers/isdn/hisax/enternow_pci.c
@@ -300,8 +300,7 @@ enpci_interrupt(int intno, void *dev_id)
300 return IRQ_HANDLED; 300 return IRQ_HANDLED;
301} 301}
302 302
303static int __devinit en_pci_probe(struct pci_dev *dev_netjet, 303static int en_pci_probe(struct pci_dev *dev_netjet, struct IsdnCardState *cs)
304 struct IsdnCardState *cs)
305{ 304{
306 if (pci_enable_device(dev_netjet)) 305 if (pci_enable_device(dev_netjet))
307 return (0); 306 return (0);
@@ -326,8 +325,7 @@ static int __devinit en_pci_probe(struct pci_dev *dev_netjet,
326 return (1); 325 return (1);
327} 326}
328 327
329static void __devinit en_cs_init(struct IsdnCard *card, 328static void en_cs_init(struct IsdnCard *card, struct IsdnCardState *cs)
330 struct IsdnCardState *cs)
331{ 329{
332 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA; 330 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA;
333 cs->hw.njet.isac = cs->hw.njet.base + 0xC0; // Fenster zum AMD 331 cs->hw.njet.isac = cs->hw.njet.base + 0xC0; // Fenster zum AMD
@@ -350,8 +348,7 @@ static void __devinit en_cs_init(struct IsdnCard *card,
350 outb(cs->hw.njet.auxd, cs->hw.njet.auxa); 348 outb(cs->hw.njet.auxd, cs->hw.njet.auxa);
351} 349}
352 350
353static int __devinit en_cs_init_rest(struct IsdnCard *card, 351static int en_cs_init_rest(struct IsdnCard *card, struct IsdnCardState *cs)
354 struct IsdnCardState *cs)
355{ 352{
356 const int bytecnt = 256; 353 const int bytecnt = 256;
357 354
@@ -384,11 +381,10 @@ static int __devinit en_cs_init_rest(struct IsdnCard *card,
384 return (1); 381 return (1);
385} 382}
386 383
387static struct pci_dev *dev_netjet __devinitdata = NULL; 384static struct pci_dev *dev_netjet = NULL;
388 385
389/* called by config.c */ 386/* called by config.c */
390int __devinit 387int setup_enternow_pci(struct IsdnCard *card)
391setup_enternow_pci(struct IsdnCard *card)
392{ 388{
393 int ret; 389 int ret;
394 struct IsdnCardState *cs = card->cs; 390 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c
index 4fef7756255..35c6df6534e 100644
--- a/drivers/isdn/hisax/gazel.c
+++ b/drivers/isdn/hisax/gazel.c
@@ -483,8 +483,7 @@ error:
483 return 1; 483 return 1;
484} 484}
485 485
486static int __devinit 486static int setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
487setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
488{ 487{
489 printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n"); 488 printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n");
490 // we got an irq parameter, assume it is an ISA card 489 // we got an irq parameter, assume it is an ISA card
@@ -532,10 +531,9 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
532} 531}
533 532
534#ifdef CONFIG_PCI 533#ifdef CONFIG_PCI
535static struct pci_dev *dev_tel __devinitdata = NULL; 534static struct pci_dev *dev_tel = NULL;
536 535
537static int __devinit 536static int setup_gazelpci(struct IsdnCardState *cs)
538setup_gazelpci(struct IsdnCardState *cs)
539{ 537{
540 u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0; 538 u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0;
541 u_char pci_irq = 0, found; 539 u_char pci_irq = 0, found;
@@ -622,8 +620,7 @@ setup_gazelpci(struct IsdnCardState *cs)
622} 620}
623#endif /* CONFIG_PCI */ 621#endif /* CONFIG_PCI */
624 622
625int __devinit 623int setup_gazel(struct IsdnCard *card)
626setup_gazel(struct IsdnCard *card)
627{ 624{
628 struct IsdnCardState *cs = card->cs; 625 struct IsdnCardState *cs = card->cs;
629 char tmp[64]; 626 char tmp[64];
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index dea04de8e7c..c49c294fc81 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -1497,7 +1497,7 @@ enable_pci_ports(hfc4s8s_hw *hw)
1497/* initialise the HFC-4s/8s hardware */ 1497/* initialise the HFC-4s/8s hardware */
1498/* return 0 on success. */ 1498/* return 0 on success. */
1499/*************************************/ 1499/*************************************/
1500static int __devinit 1500static int
1501setup_instance(hfc4s8s_hw *hw) 1501setup_instance(hfc4s8s_hw *hw)
1502{ 1502{
1503 int err = -EIO; 1503 int err = -EIO;
@@ -1585,7 +1585,7 @@ out:
1585/*****************************************/ 1585/*****************************************/
1586/* PCI hotplug interface: probe new card */ 1586/* PCI hotplug interface: probe new card */
1587/*****************************************/ 1587/*****************************************/
1588static int __devinit 1588static int
1589hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1589hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1590{ 1590{
1591 int err = -ENOMEM; 1591 int err = -ENOMEM;
@@ -1640,7 +1640,7 @@ out:
1640/**************************************/ 1640/**************************************/
1641/* PCI hotplug interface: remove card */ 1641/* PCI hotplug interface: remove card */
1642/**************************************/ 1642/**************************************/
1643static void __devexit 1643static void
1644hfc4s8s_remove(struct pci_dev *pdev) 1644hfc4s8s_remove(struct pci_dev *pdev)
1645{ 1645{
1646 hfc4s8s_hw *hw = pci_get_drvdata(pdev); 1646 hfc4s8s_hw *hw = pci_get_drvdata(pdev);
@@ -1662,7 +1662,7 @@ hfc4s8s_remove(struct pci_dev *pdev)
1662static struct pci_driver hfc4s8s_driver = { 1662static struct pci_driver hfc4s8s_driver = {
1663 .name = "hfc4s8s_l1", 1663 .name = "hfc4s8s_l1",
1664 .probe = hfc4s8s_probe, 1664 .probe = hfc4s8s_probe,
1665 .remove = __devexit_p(hfc4s8s_remove), 1665 .remove = hfc4s8s_remove,
1666 .id_table = hfc4s8s_ids, 1666 .id_table = hfc4s8s_ids,
1667}; 1667};
1668 1668
@@ -1688,14 +1688,6 @@ hfc4s8s_module_init(void)
1688 } 1688 }
1689 printk(KERN_INFO "HFC-4S/8S: found %d cards\n", card_cnt); 1689 printk(KERN_INFO "HFC-4S/8S: found %d cards\n", card_cnt);
1690 1690
1691#if !defined(CONFIG_HOTPLUG)
1692 if (err == 0) {
1693 err = -ENODEV;
1694 pci_unregister_driver(&hfc4s8s_driver);
1695 goto out;
1696 }
1697#endif
1698
1699 return 0; 1691 return 0;
1700out: 1692out:
1701 return (err); 1693 return (err);
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index f60d4be5894..3ccd724ff8c 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -1632,9 +1632,9 @@ hfcpci_card_msg(struct IsdnCardState *cs, int mt, void *arg)
1632 1632
1633 1633
1634/* this variable is used as card index when more than one cards are present */ 1634/* this variable is used as card index when more than one cards are present */
1635static struct pci_dev *dev_hfcpci __devinitdata = NULL; 1635static struct pci_dev *dev_hfcpci = NULL;
1636 1636
1637int __devinit 1637int
1638setup_hfcpci(struct IsdnCard *card) 1638setup_hfcpci(struct IsdnCard *card)
1639{ 1639{
1640 u_long flags; 1640 u_long flags;
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index 4ec279ce052..90f34ae2b80 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -1381,19 +1381,18 @@ hfcsx_card_msg(struct IsdnCardState *cs, int mt, void *arg)
1381} 1381}
1382 1382
1383#ifdef __ISAPNP__ 1383#ifdef __ISAPNP__
1384static struct isapnp_device_id hfc_ids[] __devinitdata = { 1384static struct isapnp_device_id hfc_ids[] = {
1385 { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620), 1385 { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
1386 ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620), 1386 ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
1387 (unsigned long) "Teles 16.3c2" }, 1387 (unsigned long) "Teles 16.3c2" },
1388 { 0, } 1388 { 0, }
1389}; 1389};
1390 1390
1391static struct isapnp_device_id *ipid __devinitdata = &hfc_ids[0]; 1391static struct isapnp_device_id *ipid = &hfc_ids[0];
1392static struct pnp_card *pnp_c __devinitdata = NULL; 1392static struct pnp_card *pnp_c = NULL;
1393#endif 1393#endif
1394 1394
1395int __devinit 1395int setup_hfcsx(struct IsdnCard *card)
1396setup_hfcsx(struct IsdnCard *card)
1397{ 1396{
1398 struct IsdnCardState *cs = card->cs; 1397 struct IsdnCardState *cs = card->cs;
1399 char tmp[64]; 1398 char tmp[64];
diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
index a5f048bd2bb..394da646e97 100644
--- a/drivers/isdn/hisax/hfcscard.c
+++ b/drivers/isdn/hisax/hfcscard.c
@@ -136,7 +136,7 @@ hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg)
136} 136}
137 137
138#ifdef __ISAPNP__ 138#ifdef __ISAPNP__
139static struct isapnp_device_id hfc_ids[] __devinitdata = { 139static struct isapnp_device_id hfc_ids[] = {
140 { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), 140 { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
141 ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), 141 ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
142 (unsigned long) "Acer P10" }, 142 (unsigned long) "Acer P10" },
@@ -161,12 +161,11 @@ static struct isapnp_device_id hfc_ids[] __devinitdata = {
161 { 0, } 161 { 0, }
162}; 162};
163 163
164static struct isapnp_device_id *ipid __devinitdata = &hfc_ids[0]; 164static struct isapnp_device_id *ipid = &hfc_ids[0];
165static struct pnp_card *pnp_c __devinitdata = NULL; 165static struct pnp_card *pnp_c = NULL;
166#endif 166#endif
167 167
168int __devinit 168int setup_hfcs(struct IsdnCard *card)
169setup_hfcs(struct IsdnCard *card)
170{ 169{
171 struct IsdnCardState *cs = card->cs; 170 struct IsdnCardState *cs = card->cs;
172 char tmp[64]; 171 char tmp[64];
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index e4f47fe3f7f..5e8a5d96716 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -70,7 +70,7 @@ static struct pci_device_id fcpci_ids[] = {
70MODULE_DEVICE_TABLE(pci, fcpci_ids); 70MODULE_DEVICE_TABLE(pci, fcpci_ids);
71 71
72#ifdef CONFIG_PNP 72#ifdef CONFIG_PNP
73static struct pnp_device_id fcpnp_ids[] __devinitdata = { 73static struct pnp_device_id fcpnp_ids[] = {
74 { 74 {
75 .id = "AVM0900", 75 .id = "AVM0900",
76 .driver_data = (unsigned long) "Fritz!Card PnP", 76 .driver_data = (unsigned long) "Fritz!Card PnP",
@@ -712,7 +712,7 @@ static inline void fcpci_init(struct fritz_adapter *adapter)
712 712
713// ---------------------------------------------------------------------- 713// ----------------------------------------------------------------------
714 714
715static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter) 715static int fcpcipnp_setup(struct fritz_adapter *adapter)
716{ 716{
717 u32 val = 0; 717 u32 val = 0;
718 int retval; 718 int retval;
@@ -825,7 +825,7 @@ err:
825 return retval; 825 return retval;
826} 826}
827 827
828static void __devexit fcpcipnp_release(struct fritz_adapter *adapter) 828static void fcpcipnp_release(struct fritz_adapter *adapter)
829{ 829{
830 DBG(1, ""); 830 DBG(1, "");
831 831
@@ -836,8 +836,7 @@ static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
836 836
837// ---------------------------------------------------------------------- 837// ----------------------------------------------------------------------
838 838
839static struct fritz_adapter * __devinit 839static struct fritz_adapter *new_adapter(void)
840new_adapter(void)
841{ 840{
842 struct fritz_adapter *adapter; 841 struct fritz_adapter *adapter;
843 struct hisax_b_if *b_if[2]; 842 struct hisax_b_if *b_if[2];
@@ -876,8 +875,7 @@ static void delete_adapter(struct fritz_adapter *adapter)
876 kfree(adapter); 875 kfree(adapter);
877} 876}
878 877
879static int __devinit fcpci_probe(struct pci_dev *pdev, 878static int fcpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
880 const struct pci_device_id *ent)
881{ 879{
882 struct fritz_adapter *adapter; 880 struct fritz_adapter *adapter;
883 int retval; 881 int retval;
@@ -917,7 +915,7 @@ err:
917} 915}
918 916
919#ifdef CONFIG_PNP 917#ifdef CONFIG_PNP
920static int __devinit fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) 918static int fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
921{ 919{
922 struct fritz_adapter *adapter; 920 struct fritz_adapter *adapter;
923 int retval; 921 int retval;
@@ -959,7 +957,7 @@ err:
959 return retval; 957 return retval;
960} 958}
961 959
962static void __devexit fcpnp_remove(struct pnp_dev *pdev) 960static void fcpnp_remove(struct pnp_dev *pdev)
963{ 961{
964 struct fritz_adapter *adapter = pnp_get_drvdata(pdev); 962 struct fritz_adapter *adapter = pnp_get_drvdata(pdev);
965 963
@@ -973,12 +971,12 @@ static void __devexit fcpnp_remove(struct pnp_dev *pdev)
973static struct pnp_driver fcpnp_driver = { 971static struct pnp_driver fcpnp_driver = {
974 .name = "fcpnp", 972 .name = "fcpnp",
975 .probe = fcpnp_probe, 973 .probe = fcpnp_probe,
976 .remove = __devexit_p(fcpnp_remove), 974 .remove = fcpnp_remove,
977 .id_table = fcpnp_ids, 975 .id_table = fcpnp_ids,
978}; 976};
979#endif 977#endif
980 978
981static void __devexit fcpci_remove(struct pci_dev *pdev) 979static void fcpci_remove(struct pci_dev *pdev)
982{ 980{
983 struct fritz_adapter *adapter = pci_get_drvdata(pdev); 981 struct fritz_adapter *adapter = pci_get_drvdata(pdev);
984 982
@@ -990,7 +988,7 @@ static void __devexit fcpci_remove(struct pci_dev *pdev)
990static struct pci_driver fcpci_driver = { 988static struct pci_driver fcpci_driver = {
991 .name = "fcpci", 989 .name = "fcpci",
992 .probe = fcpci_probe, 990 .probe = fcpci_probe,
993 .remove = __devexit_p(fcpci_remove), 991 .remove = fcpci_remove,
994 .id_table = fcpci_ids, 992 .id_table = fcpci_ids,
995}; 993};
996 994
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index 7be762b17c7..db5321f6379 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -673,8 +673,7 @@ clear_pending_icc_ints(struct IsdnCardState *cs)
673 cs->writeisac(cs, ICC_MASK, 0xFF); 673 cs->writeisac(cs, ICC_MASK, 0xFF);
674} 674}
675 675
676void __devinit 676void setup_icc(struct IsdnCardState *cs)
677setup_icc(struct IsdnCardState *cs)
678{ 677{
679 INIT_WORK(&cs->tqueue, icc_bh); 678 INIT_WORK(&cs->tqueue, icc_bh);
680 cs->dbusytimer.function = (void *) dbusy_timer_handler; 679 cs->dbusytimer.function = (void *) dbusy_timer_handler;
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index bcd70a38730..a365ccc1c99 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -24,11 +24,11 @@
24#define DBUSY_TIMER_VALUE 80 24#define DBUSY_TIMER_VALUE 80
25#define ARCOFI_USE 1 25#define ARCOFI_USE 1
26 26
27static char *ISACVer[] __devinitdata = 27static char *ISACVer[] =
28{"2086/2186 V1.1", "2085 B1", "2085 B2", 28{"2086/2186 V1.1", "2085 B1", "2085 B2",
29 "2085 V2.3"}; 29 "2085 V2.3"};
30 30
31void __devinit ISACVersion(struct IsdnCardState *cs, char *s) 31void ISACVersion(struct IsdnCardState *cs, char *s)
32{ 32{
33 int val; 33 int val;
34 34
@@ -669,8 +669,7 @@ void clear_pending_isac_ints(struct IsdnCardState *cs)
669 cs->writeisac(cs, ISAC_MASK, 0xFF); 669 cs->writeisac(cs, ISAC_MASK, 0xFF);
670} 670}
671 671
672void __devinit 672void setup_isac(struct IsdnCardState *cs)
673setup_isac(struct IsdnCardState *cs)
674{ 673{
675 INIT_WORK(&cs->tqueue, isac_bh); 674 INIT_WORK(&cs->tqueue, isac_bh);
676 cs->dbusytimer.function = (void *) dbusy_timer_handler; 675 cs->dbusytimer.function = (void *) dbusy_timer_handler;
diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index c1530fe248c..1399ddd4f6c 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -194,11 +194,10 @@ isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
194} 194}
195 195
196#ifdef __ISAPNP__ 196#ifdef __ISAPNP__
197static struct pnp_card *pnp_c __devinitdata = NULL; 197static struct pnp_card *pnp_c = NULL;
198#endif 198#endif
199 199
200int __devinit 200int setup_isurf(struct IsdnCard *card)
201setup_isurf(struct IsdnCard *card)
202{ 201{
203 int ver; 202 int ver;
204 struct IsdnCardState *cs = card->cs; 203 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/ix1_micro.c b/drivers/isdn/hisax/ix1_micro.c
index 5f299f82b80..7ae39f5e865 100644
--- a/drivers/isdn/hisax/ix1_micro.c
+++ b/drivers/isdn/hisax/ix1_micro.c
@@ -209,7 +209,7 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg)
209} 209}
210 210
211#ifdef __ISAPNP__ 211#ifdef __ISAPNP__
212static struct isapnp_device_id itk_ids[] __devinitdata = { 212static struct isapnp_device_id itk_ids[] = {
213 { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), 213 { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
214 ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), 214 ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
215 (unsigned long) "ITK micro 2" }, 215 (unsigned long) "ITK micro 2" },
@@ -219,13 +219,12 @@ static struct isapnp_device_id itk_ids[] __devinitdata = {
219 { 0, } 219 { 0, }
220}; 220};
221 221
222static struct isapnp_device_id *ipid __devinitdata = &itk_ids[0]; 222static struct isapnp_device_id *ipid = &itk_ids[0];
223static struct pnp_card *pnp_c __devinitdata = NULL; 223static struct pnp_card *pnp_c = NULL;
224#endif 224#endif
225 225
226 226
227int __devinit 227int setup_ix1micro(struct IsdnCard *card)
228setup_ix1micro(struct IsdnCard *card)
229{ 228{
230 struct IsdnCardState *cs = card->cs; 229 struct IsdnCardState *cs = card->cs;
231 char tmp[64]; 230 char tmp[64];
diff --git a/drivers/isdn/hisax/mic.c b/drivers/isdn/hisax/mic.c
index 08a6b7fb17f..93398676f78 100644
--- a/drivers/isdn/hisax/mic.c
+++ b/drivers/isdn/hisax/mic.c
@@ -187,8 +187,7 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg)
187 return (0); 187 return (0);
188} 188}
189 189
190int __devinit 190int setup_mic(struct IsdnCard *card)
191setup_mic(struct IsdnCard *card)
192{ 191{
193 int bytecnt; 192 int bytecnt;
194 struct IsdnCardState *cs = card->cs; 193 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
index 6569e0315cc..e4c33cfe3ef 100644
--- a/drivers/isdn/hisax/niccy.c
+++ b/drivers/isdn/hisax/niccy.c
@@ -223,10 +223,10 @@ static int niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
223} 223}
224 224
225#ifdef __ISAPNP__ 225#ifdef __ISAPNP__
226static struct pnp_card *pnp_c __devinitdata = NULL; 226static struct pnp_card *pnp_c = NULL;
227#endif 227#endif
228 228
229int __devinit setup_niccy(struct IsdnCard *card) 229int setup_niccy(struct IsdnCard *card)
230{ 230{
231 struct IsdnCardState *cs = card->cs; 231 struct IsdnCardState *cs = card->cs;
232 char tmp[64]; 232 char tmp[64];
@@ -298,7 +298,7 @@ int __devinit setup_niccy(struct IsdnCard *card)
298 } 298 }
299 } else { 299 } else {
300#ifdef CONFIG_PCI 300#ifdef CONFIG_PCI
301 static struct pci_dev *niccy_dev __devinitdata; 301 static struct pci_dev *niccy_dev;
302 302
303 u_int pci_ioaddr; 303 u_int pci_ioaddr;
304 cs->subtyp = 0; 304 cs->subtyp = 0;
diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c
index f36ff69c07e..32b4bbd18eb 100644
--- a/drivers/isdn/hisax/nj_s.c
+++ b/drivers/isdn/hisax/nj_s.c
@@ -148,8 +148,7 @@ NETjet_S_card_msg(struct IsdnCardState *cs, int mt, void *arg)
148 return (0); 148 return (0);
149} 149}
150 150
151static int __devinit njs_pci_probe(struct pci_dev *dev_netjet, 151static int njs_pci_probe(struct pci_dev *dev_netjet, struct IsdnCardState *cs)
152 struct IsdnCardState *cs)
153{ 152{
154 u32 cfg; 153 u32 cfg;
155 154
@@ -187,8 +186,7 @@ static int __devinit njs_pci_probe(struct pci_dev *dev_netjet,
187 return (1); 186 return (1);
188} 187}
189 188
190static int __devinit njs_cs_init(struct IsdnCard *card, 189static int njs_cs_init(struct IsdnCard *card, struct IsdnCardState *cs)
191 struct IsdnCardState *cs)
192{ 190{
193 191
194 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA; 192 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA;
@@ -225,8 +223,7 @@ static int __devinit njs_cs_init(struct IsdnCard *card,
225 return 1; /* end loop */ 223 return 1; /* end loop */
226} 224}
227 225
228static int __devinit njs_cs_init_rest(struct IsdnCard *card, 226static int njs_cs_init_rest(struct IsdnCard *card, struct IsdnCardState *cs)
229 struct IsdnCardState *cs)
230{ 227{
231 const int bytecnt = 256; 228 const int bytecnt = 256;
232 229
@@ -256,10 +253,9 @@ static int __devinit njs_cs_init_rest(struct IsdnCard *card,
256 return (1); 253 return (1);
257} 254}
258 255
259static struct pci_dev *dev_netjet __devinitdata = NULL; 256static struct pci_dev *dev_netjet = NULL;
260 257
261int __devinit 258int setup_netjet_s(struct IsdnCard *card)
262setup_netjet_s(struct IsdnCard *card)
263{ 259{
264 int ret; 260 int ret;
265 struct IsdnCardState *cs = card->cs; 261 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c
index 333484aef42..4e8adbede36 100644
--- a/drivers/isdn/hisax/nj_u.c
+++ b/drivers/isdn/hisax/nj_u.c
@@ -128,8 +128,7 @@ NETjet_U_card_msg(struct IsdnCardState *cs, int mt, void *arg)
128 return (0); 128 return (0);
129} 129}
130 130
131static int __devinit nju_pci_probe(struct pci_dev *dev_netjet, 131static int nju_pci_probe(struct pci_dev *dev_netjet, struct IsdnCardState *cs)
132 struct IsdnCardState *cs)
133{ 132{
134 if (pci_enable_device(dev_netjet)) 133 if (pci_enable_device(dev_netjet))
135 return (0); 134 return (0);
@@ -148,8 +147,7 @@ static int __devinit nju_pci_probe(struct pci_dev *dev_netjet,
148 return (1); 147 return (1);
149} 148}
150 149
151static int __devinit nju_cs_init(struct IsdnCard *card, 150static int nju_cs_init(struct IsdnCard *card, struct IsdnCardState *cs)
152 struct IsdnCardState *cs)
153{ 151{
154 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA; 152 cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA;
155 cs->hw.njet.isac = cs->hw.njet.base | NETJET_ISAC_OFF; 153 cs->hw.njet.isac = cs->hw.njet.base | NETJET_ISAC_OFF;
@@ -187,8 +185,7 @@ static int __devinit nju_cs_init(struct IsdnCard *card,
187 return 1; /* end loop */ 185 return 1; /* end loop */
188} 186}
189 187
190static int __devinit nju_cs_init_rest(struct IsdnCard *card, 188static int nju_cs_init_rest(struct IsdnCard *card, struct IsdnCardState *cs)
191 struct IsdnCardState *cs)
192{ 189{
193 const int bytecnt = 256; 190 const int bytecnt = 256;
194 191
@@ -219,10 +216,9 @@ static int __devinit nju_cs_init_rest(struct IsdnCard *card,
219 return (1); 216 return (1);
220} 217}
221 218
222static struct pci_dev *dev_netjet __devinitdata = NULL; 219static struct pci_dev *dev_netjet = NULL;
223 220
224int __devinit 221int setup_netjet_u(struct IsdnCard *card)
225setup_netjet_u(struct IsdnCard *card)
226{ 222{
227 int ret; 223 int ret;
228 struct IsdnCardState *cs = card->cs; 224 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/s0box.c b/drivers/isdn/hisax/s0box.c
index 383c4e7ce50..4e7d0aa227a 100644
--- a/drivers/isdn/hisax/s0box.c
+++ b/drivers/isdn/hisax/s0box.c
@@ -210,8 +210,7 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg)
210 return (0); 210 return (0);
211} 211}
212 212
213int __devinit 213int setup_s0box(struct IsdnCard *card)
214setup_s0box(struct IsdnCard *card)
215{ 214{
216 struct IsdnCardState *cs = card->cs; 215 struct IsdnCardState *cs = card->cs;
217 char tmp[64]; 216 char tmp[64];
diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c
index 75dcae6d36e..6b2d0eccdd5 100644
--- a/drivers/isdn/hisax/saphir.c
+++ b/drivers/isdn/hisax/saphir.c
@@ -240,8 +240,7 @@ saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg)
240} 240}
241 241
242 242
243int __devinit 243int setup_saphir(struct IsdnCard *card)
244setup_saphir(struct IsdnCard *card)
245{ 244{
246 struct IsdnCardState *cs = card->cs; 245 struct IsdnCardState *cs = card->cs;
247 char tmp[64]; 246 char tmp[64];
diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
index 1ee531b6be9..f16a47bcef4 100644
--- a/drivers/isdn/hisax/sedlbauer.c
+++ b/drivers/isdn/hisax/sedlbauer.c
@@ -517,7 +517,7 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
517} 517}
518 518
519#ifdef __ISAPNP__ 519#ifdef __ISAPNP__
520static struct isapnp_device_id sedl_ids[] __devinitdata = { 520static struct isapnp_device_id sedl_ids[] = {
521 { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01), 521 { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
522 ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01), 522 ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
523 (unsigned long) "Speed win" }, 523 (unsigned long) "Speed win" },
@@ -527,11 +527,10 @@ static struct isapnp_device_id sedl_ids[] __devinitdata = {
527 { 0, } 527 { 0, }
528}; 528};
529 529
530static struct isapnp_device_id *ipid __devinitdata = &sedl_ids[0]; 530static struct isapnp_device_id *ipid = &sedl_ids[0];
531static struct pnp_card *pnp_c __devinitdata = NULL; 531static struct pnp_card *pnp_c = NULL;
532 532
533static int __devinit 533static int setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
534setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
535{ 534{
536 struct IsdnCardState *cs = card->cs; 535 struct IsdnCardState *cs = card->cs;
537 struct pnp_dev *pnp_d; 536 struct pnp_dev *pnp_d;
@@ -591,18 +590,16 @@ setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
591} 590}
592#else 591#else
593 592
594static int __devinit 593static int setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
595setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
596{ 594{
597 return -1; 595 return -1;
598} 596}
599#endif /* __ISAPNP__ */ 597#endif /* __ISAPNP__ */
600 598
601#ifdef CONFIG_PCI 599#ifdef CONFIG_PCI
602static struct pci_dev *dev_sedl __devinitdata = NULL; 600static struct pci_dev *dev_sedl = NULL;
603 601
604static int __devinit 602static int setup_sedlbauer_pci(struct IsdnCard *card)
605setup_sedlbauer_pci(struct IsdnCard *card)
606{ 603{
607 struct IsdnCardState *cs = card->cs; 604 struct IsdnCardState *cs = card->cs;
608 u16 sub_vendor_id, sub_id; 605 u16 sub_vendor_id, sub_id;
@@ -667,16 +664,14 @@ setup_sedlbauer_pci(struct IsdnCard *card)
667 664
668#else 665#else
669 666
670static int __devinit 667static int setup_sedlbauer_pci(struct IsdnCard *card)
671setup_sedlbauer_pci(struct IsdnCard *card)
672{ 668{
673 return (1); 669 return (1);
674} 670}
675 671
676#endif /* CONFIG_PCI */ 672#endif /* CONFIG_PCI */
677 673
678int __devinit 674int setup_sedlbauer(struct IsdnCard *card)
679setup_sedlbauer(struct IsdnCard *card)
680{ 675{
681 int bytecnt = 8, ver, val, rc; 676 int bytecnt = 8, ver, val, rc;
682 struct IsdnCardState *cs = card->cs; 677 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index f0dfc0c976e..90f81291641 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -62,10 +62,10 @@ MODULE_LICENSE("Dual MPL/GPL");
62static int protocol = 2; /* EURO-ISDN Default */ 62static int protocol = 2; /* EURO-ISDN Default */
63module_param(protocol, int, 0); 63module_param(protocol, int, 0);
64 64
65static int sedlbauer_config(struct pcmcia_device *link) __devinit; 65static int sedlbauer_config(struct pcmcia_device *link);
66static void sedlbauer_release(struct pcmcia_device *link); 66static void sedlbauer_release(struct pcmcia_device *link);
67 67
68static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit; 68static void sedlbauer_detach(struct pcmcia_device *p_dev);
69 69
70typedef struct local_info_t { 70typedef struct local_info_t {
71 struct pcmcia_device *p_dev; 71 struct pcmcia_device *p_dev;
@@ -73,7 +73,7 @@ typedef struct local_info_t {
73 int cardnr; 73 int cardnr;
74} local_info_t; 74} local_info_t;
75 75
76static int __devinit sedlbauer_probe(struct pcmcia_device *link) 76static int sedlbauer_probe(struct pcmcia_device *link)
77{ 77{
78 local_info_t *local; 78 local_info_t *local;
79 79
@@ -90,7 +90,7 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
90 return sedlbauer_config(link); 90 return sedlbauer_config(link);
91} /* sedlbauer_attach */ 91} /* sedlbauer_attach */
92 92
93static void __devexit sedlbauer_detach(struct pcmcia_device *link) 93static void sedlbauer_detach(struct pcmcia_device *link)
94{ 94{
95 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link); 95 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link);
96 96
@@ -110,7 +110,7 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, void *priv_data)
110 return pcmcia_request_io(p_dev); 110 return pcmcia_request_io(p_dev);
111} 111}
112 112
113static int __devinit sedlbauer_config(struct pcmcia_device *link) 113static int sedlbauer_config(struct pcmcia_device *link)
114{ 114{
115 int ret; 115 int ret;
116 IsdnCard_t icard; 116 IsdnCard_t icard;
@@ -201,7 +201,7 @@ static struct pcmcia_driver sedlbauer_driver = {
201 .owner = THIS_MODULE, 201 .owner = THIS_MODULE,
202 .name = "sedlbauer_cs", 202 .name = "sedlbauer_cs",
203 .probe = sedlbauer_probe, 203 .probe = sedlbauer_probe,
204 .remove = __devexit_p(sedlbauer_detach), 204 .remove = sedlbauer_detach,
205 .id_table = sedlbauer_ids, 205 .id_table = sedlbauer_ids,
206 .suspend = sedlbauer_suspend, 206 .suspend = sedlbauer_suspend,
207 .resume = sedlbauer_resume, 207 .resume = sedlbauer_resume,
diff --git a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c
index 1267298ef55..18cee6360d0 100644
--- a/drivers/isdn/hisax/sportster.c
+++ b/drivers/isdn/hisax/sportster.c
@@ -183,8 +183,7 @@ Sportster_card_msg(struct IsdnCardState *cs, int mt, void *arg)
183 return (0); 183 return (0);
184} 184}
185 185
186static int __devinit 186static int get_io_range(struct IsdnCardState *cs)
187get_io_range(struct IsdnCardState *cs)
188{ 187{
189 int i, j, adr; 188 int i, j, adr;
190 189
@@ -208,8 +207,7 @@ get_io_range(struct IsdnCardState *cs)
208 } 207 }
209} 208}
210 209
211int __devinit 210int setup_sportster(struct IsdnCard *card)
212setup_sportster(struct IsdnCard *card)
213{ 211{
214 struct IsdnCardState *cs = card->cs; 212 struct IsdnCardState *cs = card->cs;
215 char tmp[64]; 213 char tmp[64];
diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c
index fa329e27cc5..bf647545c70 100644
--- a/drivers/isdn/hisax/teleint.c
+++ b/drivers/isdn/hisax/teleint.c
@@ -259,8 +259,7 @@ TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)
259 return (0); 259 return (0);
260} 260}
261 261
262int __devinit 262int setup_TeleInt(struct IsdnCard *card)
263setup_TeleInt(struct IsdnCard *card)
264{ 263{
265 struct IsdnCardState *cs = card->cs; 264 struct IsdnCardState *cs = card->cs;
266 char tmp[64]; 265 char tmp[64];
diff --git a/drivers/isdn/hisax/teles0.c b/drivers/isdn/hisax/teles0.c
index 49b4a26f91e..ce9eabdd2f6 100644
--- a/drivers/isdn/hisax/teles0.c
+++ b/drivers/isdn/hisax/teles0.c
@@ -263,8 +263,7 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
263 return (0); 263 return (0);
264} 264}
265 265
266int __devinit 266int setup_teles0(struct IsdnCard *card)
267setup_teles0(struct IsdnCard *card)
268{ 267{
269 u_char val; 268 u_char val;
270 struct IsdnCardState *cs = card->cs; 269 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c
index 220b919fafc..38fb2c1a3f0 100644
--- a/drivers/isdn/hisax/teles3.c
+++ b/drivers/isdn/hisax/teles3.c
@@ -253,7 +253,7 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
253 253
254#ifdef __ISAPNP__ 254#ifdef __ISAPNP__
255 255
256static struct isapnp_device_id teles_ids[] __devinitdata = { 256static struct isapnp_device_id teles_ids[] = {
257 { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110), 257 { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
258 ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110), 258 ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
259 (unsigned long) "Teles 16.3 PnP" }, 259 (unsigned long) "Teles 16.3 PnP" },
@@ -266,12 +266,11 @@ static struct isapnp_device_id teles_ids[] __devinitdata = {
266 { 0, } 266 { 0, }
267}; 267};
268 268
269static struct isapnp_device_id *ipid __devinitdata = &teles_ids[0]; 269static struct isapnp_device_id *ipid = &teles_ids[0];
270static struct pnp_card *pnp_c __devinitdata = NULL; 270static struct pnp_card *pnp_c = NULL;
271#endif 271#endif
272 272
273int __devinit 273int setup_teles3(struct IsdnCard *card)
274setup_teles3(struct IsdnCard *card)
275{ 274{
276 u_char val; 275 u_char val;
277 struct IsdnCardState *cs = card->cs; 276 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 4deac451807..f2476ffb04f 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -43,9 +43,9 @@ MODULE_LICENSE("GPL");
43static int protocol = 2; /* EURO-ISDN Default */ 43static int protocol = 2; /* EURO-ISDN Default */
44module_param(protocol, int, 0); 44module_param(protocol, int, 0);
45 45
46static int teles_cs_config(struct pcmcia_device *link) __devinit; 46static int teles_cs_config(struct pcmcia_device *link);
47static void teles_cs_release(struct pcmcia_device *link); 47static void teles_cs_release(struct pcmcia_device *link);
48static void teles_detach(struct pcmcia_device *p_dev) __devexit; 48static void teles_detach(struct pcmcia_device *p_dev);
49 49
50typedef struct local_info_t { 50typedef struct local_info_t {
51 struct pcmcia_device *p_dev; 51 struct pcmcia_device *p_dev;
@@ -53,7 +53,7 @@ typedef struct local_info_t {
53 int cardnr; 53 int cardnr;
54} local_info_t; 54} local_info_t;
55 55
56static int __devinit teles_probe(struct pcmcia_device *link) 56static int teles_probe(struct pcmcia_device *link)
57{ 57{
58 local_info_t *local; 58 local_info_t *local;
59 59
@@ -72,7 +72,7 @@ static int __devinit teles_probe(struct pcmcia_device *link)
72 return teles_cs_config(link); 72 return teles_cs_config(link);
73} /* teles_attach */ 73} /* teles_attach */
74 74
75static void __devexit teles_detach(struct pcmcia_device *link) 75static void teles_detach(struct pcmcia_device *link)
76{ 76{
77 local_info_t *info = link->priv; 77 local_info_t *info = link->priv;
78 78
@@ -108,7 +108,7 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev, void *priv_data)
108 return -ENODEV; 108 return -ENODEV;
109} 109}
110 110
111static int __devinit teles_cs_config(struct pcmcia_device *link) 111static int teles_cs_config(struct pcmcia_device *link)
112{ 112{
113 int i; 113 int i;
114 IsdnCard_t icard; 114 IsdnCard_t icard;
@@ -192,7 +192,7 @@ static struct pcmcia_driver teles_cs_driver = {
192 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
193 .name = "teles_cs", 193 .name = "teles_cs",
194 .probe = teles_probe, 194 .probe = teles_probe,
195 .remove = __devexit_p(teles_detach), 195 .remove = teles_detach,
196 .id_table = teles_ids, 196 .id_table = teles_ids,
197 .suspend = teles_suspend, 197 .suspend = teles_suspend,
198 .resume = teles_resume, 198 .resume = teles_resume,
diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c
index 9c002c9dc77..f6ab63aa699 100644
--- a/drivers/isdn/hisax/telespci.c
+++ b/drivers/isdn/hisax/telespci.c
@@ -283,10 +283,9 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
283 return (0); 283 return (0);
284} 284}
285 285
286static struct pci_dev *dev_tel __devinitdata = NULL; 286static struct pci_dev *dev_tel = NULL;
287 287
288int __devinit 288int setup_telespci(struct IsdnCard *card)
289setup_telespci(struct IsdnCard *card)
290{ 289{
291 struct IsdnCardState *cs = card->cs; 290 struct IsdnCardState *cs = card->cs;
292 char tmp[64]; 291 char tmp[64];
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index 0f0d094af85..d8cac693581 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -991,10 +991,9 @@ w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg)
991 991
992static int id_idx; 992static int id_idx;
993 993
994static struct pci_dev *dev_w6692 __devinitdata = NULL; 994static struct pci_dev *dev_w6692 = NULL;
995 995
996int __devinit 996int setup_w6692(struct IsdnCard *card)
997setup_w6692(struct IsdnCard *card)
998{ 997{
999 struct IsdnCardState *cs = card->cs; 998 struct IsdnCardState *cs = card->cs;
1000 char tmp[64]; 999 char tmp[64];
diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c
index b61bbb4bb52..0db2f750625 100644
--- a/drivers/isdn/hysdn/hysdn_init.c
+++ b/drivers/isdn/hysdn/hysdn_init.c
@@ -56,8 +56,8 @@ static hysdn_card *card_last = NULL; /* pointer to first card */
56/* is assumed and the module will not be kept in memory. */ 56/* is assumed and the module will not be kept in memory. */
57/****************************************************************************/ 57/****************************************************************************/
58 58
59static int __devinit hysdn_pci_init_one(struct pci_dev *akt_pcidev, 59static int hysdn_pci_init_one(struct pci_dev *akt_pcidev,
60 const struct pci_device_id *ent) 60 const struct pci_device_id *ent)
61{ 61{
62 hysdn_card *card; 62 hysdn_card *card;
63 int rc; 63 int rc;
@@ -109,7 +109,7 @@ err_out:
109 return rc; 109 return rc;
110} 110}
111 111
112static void __devexit hysdn_pci_remove_one(struct pci_dev *akt_pcidev) 112static void hysdn_pci_remove_one(struct pci_dev *akt_pcidev)
113{ 113{
114 hysdn_card *card = pci_get_drvdata(akt_pcidev); 114 hysdn_card *card = pci_get_drvdata(akt_pcidev);
115 115
@@ -147,7 +147,7 @@ static struct pci_driver hysdn_pci_driver = {
147 .name = "hysdn", 147 .name = "hysdn",
148 .id_table = hysdn_pci_tbl, 148 .id_table = hysdn_pci_tbl,
149 .probe = hysdn_pci_init_one, 149 .probe = hysdn_pci_init_one,
150 .remove = __devexit_p(hysdn_pci_remove_one), 150 .remove = hysdn_pci_remove_one,
151}; 151};
152 152
153static int hysdn_have_procfs; 153static int hysdn_have_procfs;
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index c401634c00e..3e245712bba 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -140,7 +140,6 @@ static struct device_attribute mISDN_dev_attrs[] = {
140 {} 140 {}
141}; 141};
142 142
143#ifdef CONFIG_HOTPLUG
144static int mISDN_uevent(struct device *dev, struct kobj_uevent_env *env) 143static int mISDN_uevent(struct device *dev, struct kobj_uevent_env *env)
145{ 144{
146 struct mISDNdevice *mdev = dev_to_mISDN(dev); 145 struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -153,7 +152,6 @@ static int mISDN_uevent(struct device *dev, struct kobj_uevent_env *env)
153 152
154 return 0; 153 return 0;
155} 154}
156#endif
157 155
158static void mISDN_class_release(struct class *cls) 156static void mISDN_class_release(struct class *cls)
159{ 157{
@@ -163,9 +161,7 @@ static void mISDN_class_release(struct class *cls)
163static struct class mISDN_class = { 161static struct class mISDN_class = {
164 .name = "mISDN", 162 .name = "mISDN",
165 .owner = THIS_MODULE, 163 .owner = THIS_MODULE,
166#ifdef CONFIG_HOTPLUG
167 .dev_uevent = mISDN_uevent, 164 .dev_uevent = mISDN_uevent,
168#endif
169 .dev_attrs = mISDN_dev_attrs, 165 .dev_attrs = mISDN_dev_attrs,
170 .dev_release = mISDN_dev_release, 166 .dev_release = mISDN_dev_release,
171 .class_release = mISDN_class_release, 167 .class_release = mISDN_class_release,
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index ef87310b766..ac5c8793986 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -679,7 +679,7 @@ void macio_release_resources(struct macio_dev *dev)
679 679
680#ifdef CONFIG_PCI 680#ifdef CONFIG_PCI
681 681
682static int __devinit macio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 682static int macio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
683{ 683{
684 struct device_node* np; 684 struct device_node* np;
685 struct macio_chip* chip; 685 struct macio_chip* chip;
@@ -739,7 +739,7 @@ static int __devinit macio_pci_probe(struct pci_dev *pdev, const struct pci_devi
739 return 0; 739 return 0;
740} 740}
741 741
742static void __devexit macio_pci_remove(struct pci_dev* pdev) 742static void macio_pci_remove(struct pci_dev* pdev)
743{ 743{
744 panic("removing of macio-asic not supported !\n"); 744 panic("removing of macio-asic not supported !\n");
745} 745}
@@ -748,7 +748,7 @@ static void __devexit macio_pci_remove(struct pci_dev* pdev)
748 * MacIO is matched against any Apple ID, it's probe() function 748 * MacIO is matched against any Apple ID, it's probe() function
749 * will then decide wether it applies or not 749 * will then decide wether it applies or not
750 */ 750 */
751static const struct pci_device_id __devinitconst pci_ids[] = { { 751static const struct pci_device_id pci_ids[] = { {
752 .vendor = PCI_VENDOR_ID_APPLE, 752 .vendor = PCI_VENDOR_ID_APPLE,
753 .device = PCI_ANY_ID, 753 .device = PCI_ANY_ID,
754 .subvendor = PCI_ANY_ID, 754 .subvendor = PCI_ANY_ID,
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 3f8d032f180..d98e566a8f5 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -556,7 +556,8 @@ static int media_bay_task(void *x)
556 return 0; 556 return 0;
557} 557}
558 558
559static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match) 559static int media_bay_attach(struct macio_dev *mdev,
560 const struct of_device_id *match)
560{ 561{
561 struct media_bay_info* bay; 562 struct media_bay_info* bay;
562 u32 __iomem *regbase; 563 u32 __iomem *regbase;
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 6dc26b61219..cad0e19b47a 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -253,7 +253,7 @@ static void rackmeter_do_timer(struct work_struct *work)
253 msecs_to_jiffies(CPU_SAMPLING_RATE)); 253 msecs_to_jiffies(CPU_SAMPLING_RATE));
254} 254}
255 255
256static void __devinit rackmeter_init_cpu_sniffer(struct rackmeter *rm) 256static void rackmeter_init_cpu_sniffer(struct rackmeter *rm)
257{ 257{
258 unsigned int cpu; 258 unsigned int cpu;
259 259
@@ -287,7 +287,7 @@ static void rackmeter_stop_cpu_sniffer(struct rackmeter *rm)
287 cancel_delayed_work_sync(&rm->cpu[1].sniffer); 287 cancel_delayed_work_sync(&rm->cpu[1].sniffer);
288} 288}
289 289
290static int __devinit rackmeter_setup(struct rackmeter *rm) 290static int rackmeter_setup(struct rackmeter *rm)
291{ 291{
292 pr_debug("rackmeter: setting up i2s..\n"); 292 pr_debug("rackmeter: setting up i2s..\n");
293 rackmeter_setup_i2s(rm); 293 rackmeter_setup_i2s(rm);
@@ -362,8 +362,8 @@ static irqreturn_t rackmeter_irq(int irq, void *arg)
362 return IRQ_HANDLED; 362 return IRQ_HANDLED;
363} 363}
364 364
365static int __devinit rackmeter_probe(struct macio_dev* mdev, 365static int rackmeter_probe(struct macio_dev* mdev,
366 const struct of_device_id *match) 366 const struct of_device_id *match)
367{ 367{
368 struct device_node *i2s = NULL, *np = NULL; 368 struct device_node *i2s = NULL, *np = NULL;
369 struct rackmeter *rm = NULL; 369 struct rackmeter *rm = NULL;
@@ -521,7 +521,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
521 return rc; 521 return rc;
522} 522}
523 523
524static int __devexit rackmeter_remove(struct macio_dev* mdev) 524static int rackmeter_remove(struct macio_dev* mdev)
525{ 525{
526 struct rackmeter *rm = dev_get_drvdata(&mdev->ofdev.dev); 526 struct rackmeter *rm = dev_get_drvdata(&mdev->ofdev.dev);
527 527
@@ -588,7 +588,7 @@ static struct macio_driver rackmeter_driver = {
588 .of_match_table = rackmeter_match, 588 .of_match_table = rackmeter_match,
589 }, 589 },
590 .probe = rackmeter_probe, 590 .probe = rackmeter_probe,
591 .remove = __devexit_p(rackmeter_remove), 591 .remove = rackmeter_remove,
592 .shutdown = rackmeter_shutdown, 592 .shutdown = rackmeter_shutdown,
593}; 593};
594 594
diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c b/drivers/macintosh/windfarm_ad7417_sensor.c
index ac3f243b9c5..7c28b71246c 100644
--- a/drivers/macintosh/windfarm_ad7417_sensor.c
+++ b/drivers/macintosh/windfarm_ad7417_sensor.c
@@ -177,9 +177,9 @@ static const struct wf_sensor_ops wf_ad7417_adc_ops = {
177 .owner = THIS_MODULE, 177 .owner = THIS_MODULE,
178}; 178};
179 179
180static void __devinit wf_ad7417_add_sensor(struct wf_ad7417_priv *pv, 180static void wf_ad7417_add_sensor(struct wf_ad7417_priv *pv,
181 int index, const char *name, 181 int index, const char *name,
182 const struct wf_sensor_ops *ops) 182 const struct wf_sensor_ops *ops)
183{ 183{
184 pv->sensors[index].name = kasprintf(GFP_KERNEL, "%s-%d", name, pv->cpu); 184 pv->sensors[index].name = kasprintf(GFP_KERNEL, "%s-%d", name, pv->cpu);
185 pv->sensors[index].priv = pv; 185 pv->sensors[index].priv = pv;
@@ -188,7 +188,7 @@ static void __devinit wf_ad7417_add_sensor(struct wf_ad7417_priv *pv,
188 kref_get(&pv->ref); 188 kref_get(&pv->ref);
189} 189}
190 190
191static void __devinit wf_ad7417_init_chip(struct wf_ad7417_priv *pv) 191static void wf_ad7417_init_chip(struct wf_ad7417_priv *pv)
192{ 192{
193 int rc; 193 int rc;
194 u8 buf[2]; 194 u8 buf[2];
@@ -230,8 +230,8 @@ static void __devinit wf_ad7417_init_chip(struct wf_ad7417_priv *pv)
230 pv->config = config; 230 pv->config = config;
231} 231}
232 232
233static int __devinit wf_ad7417_probe(struct i2c_client *client, 233static int wf_ad7417_probe(struct i2c_client *client,
234 const struct i2c_device_id *id) 234 const struct i2c_device_id *id)
235{ 235{
236 struct wf_ad7417_priv *pv; 236 struct wf_ad7417_priv *pv;
237 const struct mpu_data *mpu; 237 const struct mpu_data *mpu;
@@ -290,7 +290,7 @@ static int __devinit wf_ad7417_probe(struct i2c_client *client,
290 return 0; 290 return 0;
291} 291}
292 292
293static int __devexit wf_ad7417_remove(struct i2c_client *client) 293static int wf_ad7417_remove(struct i2c_client *client)
294{ 294{
295 struct wf_ad7417_priv *pv = dev_get_drvdata(&client->dev); 295 struct wf_ad7417_priv *pv = dev_get_drvdata(&client->dev);
296 int i; 296 int i;
@@ -322,7 +322,7 @@ static struct i2c_driver wf_ad7417_driver = {
322 .id_table = wf_ad7417_id, 322 .id_table = wf_ad7417_id,
323}; 323};
324 324
325static int __devinit wf_ad7417_init(void) 325static int wf_ad7417_init(void)
326{ 326{
327 /* This is only supported on these machines */ 327 /* This is only supported on these machines */
328 if (!of_machine_is_compatible("PowerMac7,2") && 328 if (!of_machine_is_compatible("PowerMac7,2") &&
@@ -333,7 +333,7 @@ static int __devinit wf_ad7417_init(void)
333 return i2c_add_driver(&wf_ad7417_driver); 333 return i2c_add_driver(&wf_ad7417_driver);
334} 334}
335 335
336static void __devexit wf_ad7417_exit(void) 336static void wf_ad7417_exit(void)
337{ 337{
338 i2c_del_driver(&wf_ad7417_driver); 338 i2c_del_driver(&wf_ad7417_driver);
339} 339}
diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c
index fd6ed15a979..0226b796a21 100644
--- a/drivers/macintosh/windfarm_fcu_controls.c
+++ b/drivers/macintosh/windfarm_fcu_controls.c
@@ -282,7 +282,7 @@ static const struct wf_control_ops wf_fcu_fan_pwm_ops = {
282 .owner = THIS_MODULE, 282 .owner = THIS_MODULE,
283}; 283};
284 284
285static void __devinit wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan) 285static void wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan)
286{ 286{
287 const struct mpu_data *mpu = wf_get_mpu(0); 287 const struct mpu_data *mpu = wf_get_mpu(0);
288 u16 pump_min = 0, pump_max = 0xffff; 288 u16 pump_min = 0, pump_max = 0xffff;
@@ -317,7 +317,7 @@ static void __devinit wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan)
317 fan->ctrl.name, pump_min, pump_max); 317 fan->ctrl.name, pump_min, pump_max);
318} 318}
319 319
320static void __devinit wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan) 320static void wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan)
321{ 321{
322 struct wf_fcu_priv *pv = fan->fcu_priv; 322 struct wf_fcu_priv *pv = fan->fcu_priv;
323 const struct mpu_data *mpu0 = wf_get_mpu(0); 323 const struct mpu_data *mpu0 = wf_get_mpu(0);
@@ -359,9 +359,8 @@ static void __devinit wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan)
359 fan->ctrl.name, fan->min, fan->max); 359 fan->ctrl.name, fan->min, fan->max);
360} 360}
361 361
362static void __devinit wf_fcu_add_fan(struct wf_fcu_priv *pv, 362static void wf_fcu_add_fan(struct wf_fcu_priv *pv, const char *name,
363 const char *name, 363 int type, int id)
364 int type, int id)
365{ 364{
366 struct wf_fcu_fan *fan; 365 struct wf_fcu_fan *fan;
367 366
@@ -399,7 +398,7 @@ static void __devinit wf_fcu_add_fan(struct wf_fcu_priv *pv,
399 kref_get(&pv->ref); 398 kref_get(&pv->ref);
400} 399}
401 400
402static void __devinit wf_fcu_lookup_fans(struct wf_fcu_priv *pv) 401static void wf_fcu_lookup_fans(struct wf_fcu_priv *pv)
403{ 402{
404 /* Translation of device-tree location properties to 403 /* Translation of device-tree location properties to
405 * windfarm fan names 404 * windfarm fan names
@@ -481,7 +480,7 @@ static void __devinit wf_fcu_lookup_fans(struct wf_fcu_priv *pv)
481 } 480 }
482} 481}
483 482
484static void __devinit wf_fcu_default_fans(struct wf_fcu_priv *pv) 483static void wf_fcu_default_fans(struct wf_fcu_priv *pv)
485{ 484{
486 /* We only support the default fans for PowerMac7,2 */ 485 /* We only support the default fans for PowerMac7,2 */
487 if (!of_machine_is_compatible("PowerMac7,2")) 486 if (!of_machine_is_compatible("PowerMac7,2"))
@@ -496,7 +495,7 @@ static void __devinit wf_fcu_default_fans(struct wf_fcu_priv *pv)
496 wf_fcu_add_fan(pv, "cpu-rear-fan-1", FCU_FAN_RPM, 6); 495 wf_fcu_add_fan(pv, "cpu-rear-fan-1", FCU_FAN_RPM, 6);
497} 496}
498 497
499static int __devinit wf_fcu_init_chip(struct wf_fcu_priv *pv) 498static int wf_fcu_init_chip(struct wf_fcu_priv *pv)
500{ 499{
501 unsigned char buf = 0xff; 500 unsigned char buf = 0xff;
502 int rc; 501 int rc;
@@ -518,8 +517,8 @@ static int __devinit wf_fcu_init_chip(struct wf_fcu_priv *pv)
518 return 0; 517 return 0;
519} 518}
520 519
521static int __devinit wf_fcu_probe(struct i2c_client *client, 520static int wf_fcu_probe(struct i2c_client *client,
522 const struct i2c_device_id *id) 521 const struct i2c_device_id *id)
523{ 522{
524 struct wf_fcu_priv *pv; 523 struct wf_fcu_priv *pv;
525 524
@@ -564,7 +563,7 @@ static int __devinit wf_fcu_probe(struct i2c_client *client,
564 return 0; 563 return 0;
565} 564}
566 565
567static int __devexit wf_fcu_remove(struct i2c_client *client) 566static int wf_fcu_remove(struct i2c_client *client)
568{ 567{
569 struct wf_fcu_priv *pv = dev_get_drvdata(&client->dev); 568 struct wf_fcu_priv *pv = dev_get_drvdata(&client->dev);
570 struct wf_fcu_fan *fan; 569 struct wf_fcu_fan *fan;
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index e0ee80700cd..35ef6e2582b 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -656,7 +656,7 @@ static int wf_pm112_probe(struct platform_device *dev)
656 return 0; 656 return 0;
657} 657}
658 658
659static int __devexit wf_pm112_remove(struct platform_device *dev) 659static int wf_pm112_remove(struct platform_device *dev)
660{ 660{
661 wf_unregister_client(&pm112_events); 661 wf_unregister_client(&pm112_events);
662 /* should release all sensors and controls */ 662 /* should release all sensors and controls */
@@ -665,7 +665,7 @@ static int __devexit wf_pm112_remove(struct platform_device *dev)
665 665
666static struct platform_driver wf_pm112_driver = { 666static struct platform_driver wf_pm112_driver = {
667 .probe = wf_pm112_probe, 667 .probe = wf_pm112_probe,
668 .remove = __devexit_p(wf_pm112_remove), 668 .remove = wf_pm112_remove,
669 .driver = { 669 .driver = {
670 .name = "windfarm", 670 .name = "windfarm",
671 .owner = THIS_MODULE, 671 .owner = THIS_MODULE,
diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c
index 04067e073aa..af605e915d4 100644
--- a/drivers/macintosh/windfarm_pm121.c
+++ b/drivers/macintosh/windfarm_pm121.c
@@ -987,7 +987,7 @@ static int pm121_probe(struct platform_device *ddev)
987 return 0; 987 return 0;
988} 988}
989 989
990static int __devexit pm121_remove(struct platform_device *ddev) 990static int pm121_remove(struct platform_device *ddev)
991{ 991{
992 wf_unregister_client(&pm121_events); 992 wf_unregister_client(&pm121_events);
993 return 0; 993 return 0;
@@ -995,7 +995,7 @@ static int __devexit pm121_remove(struct platform_device *ddev)
995 995
996static struct platform_driver pm121_driver = { 996static struct platform_driver pm121_driver = {
997 .probe = pm121_probe, 997 .probe = pm121_probe,
998 .remove = __devexit_p(pm121_remove), 998 .remove = pm121_remove,
999 .driver = { 999 .driver = {
1000 .name = "windfarm", 1000 .name = "windfarm",
1001 .bus = &platform_bus_type, 1001 .bus = &platform_bus_type,
diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c
index 84ac913d7e3..6e5585357cd 100644
--- a/drivers/macintosh/windfarm_pm72.c
+++ b/drivers/macintosh/windfarm_pm72.c
@@ -776,7 +776,7 @@ static int wf_pm72_probe(struct platform_device *dev)
776 return 0; 776 return 0;
777} 777}
778 778
779static int __devexit wf_pm72_remove(struct platform_device *dev) 779static int wf_pm72_remove(struct platform_device *dev)
780{ 780{
781 wf_unregister_client(&pm72_events); 781 wf_unregister_client(&pm72_events);
782 782
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c
index 990c87606be..f84933ff329 100644
--- a/drivers/macintosh/windfarm_pm81.c
+++ b/drivers/macintosh/windfarm_pm81.c
@@ -720,7 +720,7 @@ static int wf_smu_probe(struct platform_device *ddev)
720 return 0; 720 return 0;
721} 721}
722 722
723static int __devexit wf_smu_remove(struct platform_device *ddev) 723static int wf_smu_remove(struct platform_device *ddev)
724{ 724{
725 wf_unregister_client(&wf_smu_events); 725 wf_unregister_client(&wf_smu_events);
726 726
@@ -763,7 +763,7 @@ static int __devexit wf_smu_remove(struct platform_device *ddev)
763 763
764static struct platform_driver wf_smu_driver = { 764static struct platform_driver wf_smu_driver = {
765 .probe = wf_smu_probe, 765 .probe = wf_smu_probe,
766 .remove = __devexit_p(wf_smu_remove), 766 .remove = wf_smu_remove,
767 .driver = { 767 .driver = {
768 .name = "windfarm", 768 .name = "windfarm",
769 .owner = THIS_MODULE, 769 .owner = THIS_MODULE,
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c
index 7653603cb00..2eb484f213c 100644
--- a/drivers/macintosh/windfarm_pm91.c
+++ b/drivers/macintosh/windfarm_pm91.c
@@ -642,7 +642,7 @@ static int wf_smu_probe(struct platform_device *ddev)
642 return 0; 642 return 0;
643} 643}
644 644
645static int __devexit wf_smu_remove(struct platform_device *ddev) 645static int wf_smu_remove(struct platform_device *ddev)
646{ 646{
647 wf_unregister_client(&wf_smu_events); 647 wf_unregister_client(&wf_smu_events);
648 648
@@ -692,7 +692,7 @@ static int __devexit wf_smu_remove(struct platform_device *ddev)
692 692
693static struct platform_driver wf_smu_driver = { 693static struct platform_driver wf_smu_driver = {
694 .probe = wf_smu_probe, 694 .probe = wf_smu_probe,
695 .remove = __devexit_p(wf_smu_remove), 695 .remove = wf_smu_remove,
696 .driver = { 696 .driver = {
697 .name = "windfarm", 697 .name = "windfarm",
698 .owner = THIS_MODULE, 698 .owner = THIS_MODULE,
diff --git a/drivers/macintosh/windfarm_rm31.c b/drivers/macintosh/windfarm_rm31.c
index 3eca6d4b52f..844003fb4ef 100644
--- a/drivers/macintosh/windfarm_rm31.c
+++ b/drivers/macintosh/windfarm_rm31.c
@@ -669,7 +669,7 @@ static int wf_rm31_probe(struct platform_device *dev)
669 return 0; 669 return 0;
670} 670}
671 671
672static int __devexit wf_rm31_remove(struct platform_device *dev) 672static int wf_rm31_remove(struct platform_device *dev)
673{ 673{
674 wf_unregister_client(&rm31_events); 674 wf_unregister_client(&rm31_events);
675 675
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 45ecf8db1ea..64d71fb87a9 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -540,8 +540,8 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state)
540 return 0; 540 return 0;
541} 541}
542 542
543static __devinit int adv7180_probe(struct i2c_client *client, 543static int adv7180_probe(struct i2c_client *client,
544 const struct i2c_device_id *id) 544 const struct i2c_device_id *id)
545{ 545{
546 struct adv7180_state *state; 546 struct adv7180_state *state;
547 struct v4l2_subdev *sd; 547 struct v4l2_subdev *sd;
@@ -587,7 +587,7 @@ err:
587 return ret; 587 return ret;
588} 588}
589 589
590static __devexit int adv7180_remove(struct i2c_client *client) 590static int adv7180_remove(struct i2c_client *client)
591{ 591{
592 struct v4l2_subdev *sd = i2c_get_clientdata(client); 592 struct v4l2_subdev *sd = i2c_get_clientdata(client);
593 struct adv7180_state *state = to_state(sd); 593 struct adv7180_state *state = to_state(sd);
@@ -652,7 +652,7 @@ static struct i2c_driver adv7180_driver = {
652 .name = KBUILD_MODNAME, 652 .name = KBUILD_MODNAME,
653 }, 653 },
654 .probe = adv7180_probe, 654 .probe = adv7180_probe,
655 .remove = __devexit_p(adv7180_remove), 655 .remove = adv7180_remove,
656#ifdef CONFIG_PM 656#ifdef CONFIG_PM
657 .suspend = adv7180_suspend, 657 .suspend = adv7180_suspend,
658 .resume = adv7180_resume, 658 .resume = adv7180_resume,
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index 10c3c1db4cd..6fed5b74e74 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -677,7 +677,7 @@ static struct i2c_driver adv7183_driver = {
677 .name = "adv7183", 677 .name = "adv7183",
678 }, 678 },
679 .probe = adv7183_probe, 679 .probe = adv7183_probe,
680 .remove = __devexit_p(adv7183_remove), 680 .remove = adv7183_remove,
681 .id_table = adv7183_id, 681 .id_table = adv7183_id,
682}; 682};
683 683
diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c
index 3bfdbf9d9bf..58d523f2648 100644
--- a/drivers/media/i2c/as3645a.c
+++ b/drivers/media/i2c/as3645a.c
@@ -713,7 +713,7 @@ static int as3645a_resume(struct device *dev)
713 * The number of LEDs reported in platform data is used to compute default 713 * The number of LEDs reported in platform data is used to compute default
714 * limits. Parameters passed through platform data can override those limits. 714 * limits. Parameters passed through platform data can override those limits.
715 */ 715 */
716static int __devinit as3645a_init_controls(struct as3645a *flash) 716static int as3645a_init_controls(struct as3645a *flash)
717{ 717{
718 const struct as3645a_platform_data *pdata = flash->pdata; 718 const struct as3645a_platform_data *pdata = flash->pdata;
719 struct v4l2_ctrl *ctrl; 719 struct v4l2_ctrl *ctrl;
@@ -804,8 +804,8 @@ static int __devinit as3645a_init_controls(struct as3645a *flash)
804 return flash->ctrls.error; 804 return flash->ctrls.error;
805} 805}
806 806
807static int __devinit as3645a_probe(struct i2c_client *client, 807static int as3645a_probe(struct i2c_client *client,
808 const struct i2c_device_id *devid) 808 const struct i2c_device_id *devid)
809{ 809{
810 struct as3645a *flash; 810 struct as3645a *flash;
811 int ret; 811 int ret;
@@ -846,7 +846,7 @@ done:
846 return ret; 846 return ret;
847} 847}
848 848
849static int __devexit as3645a_remove(struct i2c_client *client) 849static int as3645a_remove(struct i2c_client *client)
850{ 850{
851 struct v4l2_subdev *subdev = i2c_get_clientdata(client); 851 struct v4l2_subdev *subdev = i2c_get_clientdata(client);
852 struct as3645a *flash = to_as3645a(subdev); 852 struct as3645a *flash = to_as3645a(subdev);
@@ -877,7 +877,7 @@ static struct i2c_driver as3645a_i2c_driver = {
877 .pm = &as3645a_pm_ops, 877 .pm = &as3645a_pm_ops,
878 }, 878 },
879 .probe = as3645a_probe, 879 .probe = as3645a_probe,
880 .remove = __devexit_p(as3645a_remove), 880 .remove = as3645a_remove,
881 .id_table = as3645a_id_table, 881 .id_table = as3645a_id_table,
882}; 882};
883 883
diff --git a/drivers/media/i2c/m5mols/m5mols_core.c b/drivers/media/i2c/m5mols/m5mols_core.c
index 8131d651de9..8a8d42fe263 100644
--- a/drivers/media/i2c/m5mols/m5mols_core.c
+++ b/drivers/media/i2c/m5mols/m5mols_core.c
@@ -926,8 +926,8 @@ static irqreturn_t m5mols_irq_handler(int irq, void *data)
926 return IRQ_HANDLED; 926 return IRQ_HANDLED;
927} 927}
928 928
929static int __devinit m5mols_probe(struct i2c_client *client, 929static int m5mols_probe(struct i2c_client *client,
930 const struct i2c_device_id *id) 930 const struct i2c_device_id *id)
931{ 931{
932 const struct m5mols_platform_data *pdata = client->dev.platform_data; 932 const struct m5mols_platform_data *pdata = client->dev.platform_data;
933 struct m5mols_info *info; 933 struct m5mols_info *info;
@@ -1018,7 +1018,7 @@ out_free:
1018 return ret; 1018 return ret;
1019} 1019}
1020 1020
1021static int __devexit m5mols_remove(struct i2c_client *client) 1021static int m5mols_remove(struct i2c_client *client)
1022{ 1022{
1023 struct v4l2_subdev *sd = i2c_get_clientdata(client); 1023 struct v4l2_subdev *sd = i2c_get_clientdata(client);
1024 struct m5mols_info *info = to_m5mols(sd); 1024 struct m5mols_info *info = to_m5mols(sd);
@@ -1045,7 +1045,7 @@ static struct i2c_driver m5mols_i2c_driver = {
1045 .name = MODULE_NAME, 1045 .name = MODULE_NAME,
1046 }, 1046 },
1047 .probe = m5mols_probe, 1047 .probe = m5mols_probe,
1048 .remove = __devexit_p(m5mols_remove), 1048 .remove = m5mols_remove,
1049 .id_table = m5mols_id, 1049 .id_table = m5mols_id,
1050}; 1050};
1051 1051
diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c
index f434a19b9bc..9ac1b8c3a83 100644
--- a/drivers/media/i2c/vs6624.c
+++ b/drivers/media/i2c/vs6624.c
@@ -788,7 +788,7 @@ static const struct v4l2_subdev_ops vs6624_ops = {
788 .video = &vs6624_video_ops, 788 .video = &vs6624_video_ops,
789}; 789};
790 790
791static int __devinit vs6624_probe(struct i2c_client *client, 791static int vs6624_probe(struct i2c_client *client,
792 const struct i2c_device_id *id) 792 const struct i2c_device_id *id)
793{ 793{
794 struct vs6624 *sensor; 794 struct vs6624 *sensor;
@@ -881,7 +881,7 @@ static int __devinit vs6624_probe(struct i2c_client *client,
881 return ret; 881 return ret;
882} 882}
883 883
884static int __devexit vs6624_remove(struct i2c_client *client) 884static int vs6624_remove(struct i2c_client *client)
885{ 885{
886 struct v4l2_subdev *sd = i2c_get_clientdata(client); 886 struct v4l2_subdev *sd = i2c_get_clientdata(client);
887 struct vs6624 *sensor = to_vs6624(sd); 887 struct vs6624 *sensor = to_vs6624(sd);
@@ -906,7 +906,7 @@ static struct i2c_driver vs6624_driver = {
906 .name = "vs6624", 906 .name = "vs6624",
907 }, 907 },
908 .probe = vs6624_probe, 908 .probe = vs6624_probe,
909 .remove = __devexit_p(vs6624_remove), 909 .remove = vs6624_remove,
910 .id_table = vs6624_id, 910 .id_table = vs6624_id,
911}; 911};
912 912
diff --git a/drivers/media/mmc/siano/smssdio.c b/drivers/media/mmc/siano/smssdio.c
index d6f3f100699..15d34935e00 100644
--- a/drivers/media/mmc/siano/smssdio.c
+++ b/drivers/media/mmc/siano/smssdio.c
@@ -50,7 +50,7 @@
50#define SMSSDIO_INT 0x04 50#define SMSSDIO_INT 0x04
51#define SMSSDIO_BLOCK_SIZE 128 51#define SMSSDIO_BLOCK_SIZE 128
52 52
53static const struct sdio_device_id smssdio_ids[] __devinitconst = { 53static const struct sdio_device_id smssdio_ids[] = {
54 {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR), 54 {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR),
55 .driver_data = SMS1XXX_BOARD_SIANO_STELLAR}, 55 .driver_data = SMS1XXX_BOARD_SIANO_STELLAR},
56 {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_NOVA_A0), 56 {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_NOVA_A0),
@@ -224,7 +224,7 @@ static void smssdio_interrupt(struct sdio_func *func)
224 smscore_onresponse(smsdev->coredev, cb); 224 smscore_onresponse(smsdev->coredev, cb);
225} 225}
226 226
227static int __devinit smssdio_probe(struct sdio_func *func, 227static int smssdio_probe(struct sdio_func *func,
228 const struct sdio_device_id *id) 228 const struct sdio_device_id *id)
229{ 229{
230 int ret; 230 int ret;
diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index b34fa95185e..66eb0baab0e 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -391,7 +391,7 @@ EXPORT_SYMBOL(bt878_device_control);
391 .driver_data = (unsigned long) name \ 391 .driver_data = (unsigned long) name \
392 } 392 }
393 393
394static struct pci_device_id bt878_pci_tbl[] __devinitdata = { 394static struct pci_device_id bt878_pci_tbl[] = {
395 BROOKTREE_878_DEVICE(0x0071, 0x0101, "Nebula Electronics DigiTV"), 395 BROOKTREE_878_DEVICE(0x0071, 0x0101, "Nebula Electronics DigiTV"),
396 BROOKTREE_878_DEVICE(0x1461, 0x0761, "AverMedia AverTV DVB-T 761"), 396 BROOKTREE_878_DEVICE(0x1461, 0x0761, "AverMedia AverTV DVB-T 761"),
397 BROOKTREE_878_DEVICE(0x11bd, 0x001c, "Pinnacle PCTV Sat"), 397 BROOKTREE_878_DEVICE(0x11bd, 0x001c, "Pinnacle PCTV Sat"),
@@ -410,7 +410,7 @@ static struct pci_device_id bt878_pci_tbl[] __devinitdata = {
410 410
411MODULE_DEVICE_TABLE(pci, bt878_pci_tbl); 411MODULE_DEVICE_TABLE(pci, bt878_pci_tbl);
412 412
413static const char * __devinit card_name(const struct pci_device_id *id) 413static const char * card_name(const struct pci_device_id *id)
414{ 414{
415 return id->driver_data ? (const char *)id->driver_data : "Unknown"; 415 return id->driver_data ? (const char *)id->driver_data : "Unknown";
416} 416}
@@ -419,8 +419,7 @@ static const char * __devinit card_name(const struct pci_device_id *id)
419/* PCI device handling */ 419/* PCI device handling */
420/***********************/ 420/***********************/
421 421
422static int __devinit bt878_probe(struct pci_dev *dev, 422static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
423 const struct pci_device_id *pci_id)
424{ 423{
425 int result = 0; 424 int result = 0;
426 unsigned char lat; 425 unsigned char lat;
@@ -529,7 +528,7 @@ static int __devinit bt878_probe(struct pci_dev *dev,
529 return result; 528 return result;
530} 529}
531 530
532static void __devexit bt878_remove(struct pci_dev *pci_dev) 531static void bt878_remove(struct pci_dev *pci_dev)
533{ 532{
534 u8 command; 533 u8 command;
535 struct bt878 *bt = pci_get_drvdata(pci_dev); 534 struct bt878 *bt = pci_get_drvdata(pci_dev);
@@ -573,7 +572,7 @@ static struct pci_driver bt878_pci_driver = {
573 .name = "bt878", 572 .name = "bt878",
574 .id_table = bt878_pci_tbl, 573 .id_table = bt878_pci_tbl,
575 .probe = bt878_probe, 574 .probe = bt878_probe,
576 .remove = __devexit_p(bt878_remove), 575 .remove = bt878_remove,
577}; 576};
578 577
579/*******************************/ 578/*******************************/
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c
index 38952faaffd..c4c59175e52 100644
--- a/drivers/media/pci/bt8xx/bttv-cards.c
+++ b/drivers/media/pci/bt8xx/bttv-cards.c
@@ -87,7 +87,7 @@ static int tea5757_read(struct bttv *btv);
87static int tea5757_write(struct bttv *btv, int value); 87static int tea5757_write(struct bttv *btv, int value);
88static void identify_by_eeprom(struct bttv *btv, 88static void identify_by_eeprom(struct bttv *btv,
89 unsigned char eeprom_data[256]); 89 unsigned char eeprom_data[256]);
90static int __devinit pvr_boot(struct bttv *btv); 90static int pvr_boot(struct bttv *btv);
91 91
92/* config variables */ 92/* config variables */
93static unsigned int triton1; 93static unsigned int triton1;
@@ -151,7 +151,7 @@ static struct CARD {
151 unsigned id; 151 unsigned id;
152 int cardnr; 152 int cardnr;
153 char *name; 153 char *name;
154} cards[] __devinitdata = { 154} cards[] = {
155 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" }, 155 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
156 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" }, 156 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
157 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" }, 157 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
@@ -2837,7 +2837,7 @@ static unsigned char eeprom_data[256];
2837/* 2837/*
2838 * identify card 2838 * identify card
2839 */ 2839 */
2840void __devinit bttv_idcard(struct bttv *btv) 2840void bttv_idcard(struct bttv *btv)
2841{ 2841{
2842 unsigned int gpiobits; 2842 unsigned int gpiobits;
2843 int i,type; 2843 int i,type;
@@ -3235,7 +3235,7 @@ static void bttv_reset_audio(struct bttv *btv)
3235} 3235}
3236 3236
3237/* initialization part one -- before registering i2c bus */ 3237/* initialization part one -- before registering i2c bus */
3238void __devinit bttv_init_card1(struct bttv *btv) 3238void bttv_init_card1(struct bttv *btv)
3239{ 3239{
3240 switch (btv->c.type) { 3240 switch (btv->c.type) {
3241 case BTTV_BOARD_HAUPPAUGE: 3241 case BTTV_BOARD_HAUPPAUGE:
@@ -3267,7 +3267,7 @@ void __devinit bttv_init_card1(struct bttv *btv)
3267} 3267}
3268 3268
3269/* initialization part two -- after registering i2c bus */ 3269/* initialization part two -- after registering i2c bus */
3270void __devinit bttv_init_card2(struct bttv *btv) 3270void bttv_init_card2(struct bttv *btv)
3271{ 3271{
3272 btv->tuner_type = UNSET; 3272 btv->tuner_type = UNSET;
3273 3273
@@ -3571,7 +3571,7 @@ no_audio:
3571 3571
3572 3572
3573/* initialize the tuner */ 3573/* initialize the tuner */
3574void __devinit bttv_init_tuner(struct bttv *btv) 3574void bttv_init_tuner(struct bttv *btv)
3575{ 3575{
3576 int addr = ADDR_UNSET; 3576 int addr = ADDR_UNSET;
3577 3577
@@ -3635,7 +3635,7 @@ static void modtec_eeprom(struct bttv *btv)
3635 } 3635 }
3636} 3636}
3637 3637
3638static void __devinit hauppauge_eeprom(struct bttv *btv) 3638static void hauppauge_eeprom(struct bttv *btv)
3639{ 3639{
3640 struct tveeprom tv; 3640 struct tveeprom tv;
3641 3641
@@ -3709,8 +3709,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv)
3709#define BTTV_ALT_DCLK 0x100000 3709#define BTTV_ALT_DCLK 0x100000
3710#define BTTV_ALT_NCONFIG 0x800000 3710#define BTTV_ALT_NCONFIG 0x800000
3711 3711
3712static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro, 3712static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen)
3713 u32 microlen)
3714{ 3713{
3715 u32 n; 3714 u32 n;
3716 u8 bits; 3715 u8 bits;
@@ -3747,7 +3746,7 @@ static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3747 return 0; 3746 return 0;
3748} 3747}
3749 3748
3750static int __devinit pvr_boot(struct bttv *btv) 3749static int pvr_boot(struct bttv *btv)
3751{ 3750{
3752 const struct firmware *fw_entry; 3751 const struct firmware *fw_entry;
3753 int rc; 3752 int rc;
@@ -3767,7 +3766,7 @@ static int __devinit pvr_boot(struct bttv *btv)
3767/* ----------------------------------------------------------------------- */ 3766/* ----------------------------------------------------------------------- */
3768/* some osprey specific stuff */ 3767/* some osprey specific stuff */
3769 3768
3770static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256]) 3769static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
3771{ 3770{
3772 int i; 3771 int i;
3773 u32 serial = 0; 3772 u32 serial = 0;
@@ -3898,7 +3897,7 @@ static int tuner_1_table[] = {
3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */ 3897 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3899 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL}; 3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3900 3899
3901static void __devinit avermedia_eeprom(struct bttv *btv) 3900static void avermedia_eeprom(struct bttv *btv)
3902{ 3901{
3903 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0; 3902 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3904 3903
@@ -3960,7 +3959,7 @@ u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
3960 * Hauppauge: pin 5 3959 * Hauppauge: pin 5
3961 * Voodoo: pin 20 3960 * Voodoo: pin 20
3962 */ 3961 */
3963static void __devinit boot_msp34xx(struct bttv *btv, int pin) 3962static void boot_msp34xx(struct bttv *btv, int pin)
3964{ 3963{
3965 int mask = (1 << pin); 3964 int mask = (1 << pin);
3966 3965
@@ -3983,11 +3982,10 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3983 * used by Alessandro Rubini in his pxc200 3982 * used by Alessandro Rubini in his pxc200
3984 * driver, but using BTTV functions */ 3983 * driver, but using BTTV functions */
3985 3984
3986static void __devinit init_PXC200(struct bttv *btv) 3985static void init_PXC200(struct bttv *btv)
3987{ 3986{
3988 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 3987 static int vals[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 0x01, 0x02,
3989 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 3988 0x03, 0x04, 0x05, 0x06, 0x00 };
3990 0x00 };
3991 unsigned int i; 3989 unsigned int i;
3992 int tmp; 3990 int tmp;
3993 u32 val; 3991 u32 val;
@@ -4851,7 +4849,7 @@ void __init bttv_check_chipset(void)
4851 } 4849 }
4852} 4850}
4853 4851
4854int __devinit bttv_handle_chipset(struct bttv *btv) 4852int bttv_handle_chipset(struct bttv *btv)
4855{ 4853{
4856 unsigned char command; 4854 unsigned char command;
4857 4855
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index de6f41f1918..45e5d0661b6 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -4199,7 +4199,7 @@ static void bttv_unregister_video(struct bttv *btv)
4199} 4199}
4200 4200
4201/* register video4linux devices */ 4201/* register video4linux devices */
4202static int __devinit bttv_register_video(struct bttv *btv) 4202static int bttv_register_video(struct bttv *btv)
4203{ 4203{
4204 if (no_overlay > 0) 4204 if (no_overlay > 0)
4205 pr_notice("Overlay support disabled\n"); 4205 pr_notice("Overlay support disabled\n");
@@ -4265,8 +4265,7 @@ static void pci_set_command(struct pci_dev *dev)
4265#endif 4265#endif
4266} 4266}
4267 4267
4268static int __devinit bttv_probe(struct pci_dev *dev, 4268static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
4269 const struct pci_device_id *pci_id)
4270{ 4269{
4271 int result; 4270 int result;
4272 unsigned char lat; 4271 unsigned char lat;
@@ -4454,7 +4453,7 @@ fail0:
4454 return result; 4453 return result;
4455} 4454}
4456 4455
4457static void __devexit bttv_remove(struct pci_dev *pci_dev) 4456static void bttv_remove(struct pci_dev *pci_dev)
4458{ 4457{
4459 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 4458 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
4460 struct bttv *btv = to_bttv(v4l2_dev); 4459 struct bttv *btv = to_bttv(v4l2_dev);
@@ -4598,7 +4597,7 @@ static struct pci_driver bttv_pci_driver = {
4598 .name = "bttv", 4597 .name = "bttv",
4599 .id_table = bttv_pci_tbl, 4598 .id_table = bttv_pci_tbl,
4600 .probe = bttv_probe, 4599 .probe = bttv_probe,
4601 .remove = __devexit_p(bttv_remove), 4600 .remove = bttv_remove,
4602#ifdef CONFIG_PM 4601#ifdef CONFIG_PM
4603 .suspend = bttv_suspend, 4602 .suspend = bttv_suspend,
4604 .resume = bttv_resume, 4603 .resume = bttv_resume,
diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c
index 580c8e68239..5039b8826e0 100644
--- a/drivers/media/pci/bt8xx/bttv-i2c.c
+++ b/drivers/media/pci/bt8xx/bttv-i2c.c
@@ -99,7 +99,7 @@ static int bttv_bit_getsda(void *data)
99 return state; 99 return state;
100} 100}
101 101
102static struct i2c_algo_bit_data __devinitdata bttv_i2c_algo_bit_template = { 102static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = {
103 .setsda = bttv_bit_setsda, 103 .setsda = bttv_bit_setsda,
104 .setscl = bttv_bit_setscl, 104 .setscl = bttv_bit_setscl,
105 .getsda = bttv_bit_getsda, 105 .getsda = bttv_bit_getsda,
@@ -312,7 +312,7 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
312} 312}
313 313
314/* read EEPROM content */ 314/* read EEPROM content */
315void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) 315void bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
316{ 316{
317 memset(eedata, 0, 256); 317 memset(eedata, 0, 256);
318 if (0 != btv->i2c_rc) 318 if (0 != btv->i2c_rc)
@@ -347,7 +347,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
347} 347}
348 348
349/* init + register i2c adapter */ 349/* init + register i2c adapter */
350int __devinit init_bttv_i2c(struct bttv *btv) 350int init_bttv_i2c(struct bttv *btv)
351{ 351{
352 strlcpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE); 352 strlcpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE);
353 353
diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c
index ef4c7cd4198..04207a79905 100644
--- a/drivers/media/pci/bt8xx/bttv-input.c
+++ b/drivers/media/pci/bt8xx/bttv-input.c
@@ -368,7 +368,7 @@ static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
368} 368}
369 369
370/* Instantiate the I2C IR receiver device, if present */ 370/* Instantiate the I2C IR receiver device, if present */
371void __devinit init_bttv_i2c_ir(struct bttv *btv) 371void init_bttv_i2c_ir(struct bttv *btv)
372{ 372{
373 const unsigned short addr_list[] = { 373 const unsigned short addr_list[] = {
374 0x1a, 0x18, 0x64, 0x30, 0x71, 374 0x1a, 0x18, 0x64, 0x30, 0x71,
@@ -411,7 +411,7 @@ void __devinit init_bttv_i2c_ir(struct bttv *btv)
411 return; 411 return;
412} 412}
413 413
414int __devexit fini_bttv_i2c(struct bttv *btv) 414int fini_bttv_i2c(struct bttv *btv)
415{ 415{
416 if (0 != btv->i2c_rc) 416 if (0 != btv->i2c_rc)
417 return 0; 417 return 0;
diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c
index 81fab9adc1c..d407244fd1b 100644
--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
@@ -118,7 +118,8 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev)
118 return 0; 118 return 0;
119} 119}
120 120
121static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) 121static struct bt878 *dvb_bt8xx_878_match(unsigned int bttv_nr,
122 struct pci_dev* bttv_pci_dev)
122{ 123{
123 unsigned int card_nr; 124 unsigned int card_nr;
124 125
@@ -720,7 +721,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
720 } 721 }
721} 722}
722 723
723static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) 724static int dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
724{ 725{
725 int result; 726 int result;
726 727
@@ -811,7 +812,7 @@ err_unregister_adaptor:
811 return result; 812 return result;
812} 813}
813 814
814static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) 815static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
815{ 816{
816 struct dvb_bt8xx_card *card; 817 struct dvb_bt8xx_card *card;
817 struct pci_dev* bttv_pci_dev; 818 struct pci_dev* bttv_pci_dev;
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 039133d692e..613e5ae7d5c 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -53,7 +53,7 @@ int (*cx18_ext_init)(struct cx18 *);
53EXPORT_SYMBOL(cx18_ext_init); 53EXPORT_SYMBOL(cx18_ext_init);
54 54
55/* add your revision and whatnot here */ 55/* add your revision and whatnot here */
56static struct pci_device_id cx18_pci_tbl[] __devinitdata = { 56static struct pci_device_id cx18_pci_tbl[] = {
57 {PCI_VENDOR_ID_CX, PCI_DEVICE_ID_CX23418, 57 {PCI_VENDOR_ID_CX, PCI_DEVICE_ID_CX23418,
58 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 58 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
59 {0,} 59 {0,}
@@ -691,7 +691,7 @@ done:
691 cx->card_i2c = cx->card->i2c; 691 cx->card_i2c = cx->card->i2c;
692} 692}
693 693
694static int __devinit cx18_create_in_workq(struct cx18 *cx) 694static int cx18_create_in_workq(struct cx18 *cx)
695{ 695{
696 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", 696 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
697 cx->v4l2_dev.name); 697 cx->v4l2_dev.name);
@@ -703,7 +703,7 @@ static int __devinit cx18_create_in_workq(struct cx18 *cx)
703 return 0; 703 return 0;
704} 704}
705 705
706static void __devinit cx18_init_in_work_orders(struct cx18 *cx) 706static void cx18_init_in_work_orders(struct cx18 *cx)
707{ 707{
708 int i; 708 int i;
709 for (i = 0; i < CX18_MAX_IN_WORK_ORDERS; i++) { 709 for (i = 0; i < CX18_MAX_IN_WORK_ORDERS; i++) {
@@ -718,7 +718,7 @@ static void __devinit cx18_init_in_work_orders(struct cx18 *cx)
718 No assumptions on the card type may be made here (see cx18_init_struct2 718 No assumptions on the card type may be made here (see cx18_init_struct2
719 for that). 719 for that).
720 */ 720 */
721static int __devinit cx18_init_struct1(struct cx18 *cx) 721static int cx18_init_struct1(struct cx18 *cx)
722{ 722{
723 int ret; 723 int ret;
724 724
@@ -775,7 +775,7 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
775 775
776/* Second initialization part. Here the card type has been 776/* Second initialization part. Here the card type has been
777 autodetected. */ 777 autodetected. */
778static void __devinit cx18_init_struct2(struct cx18 *cx) 778static void cx18_init_struct2(struct cx18 *cx)
779{ 779{
780 int i; 780 int i;
781 781
@@ -892,8 +892,8 @@ static void cx18_init_subdevs(struct cx18 *cx)
892 cx->sd_extmux = cx18_find_hw(cx, cx->card->hw_muxer); 892 cx->sd_extmux = cx18_find_hw(cx, cx->card->hw_muxer);
893} 893}
894 894
895static int __devinit cx18_probe(struct pci_dev *pci_dev, 895static int cx18_probe(struct pci_dev *pci_dev,
896 const struct pci_device_id *pci_id) 896 const struct pci_device_id *pci_id)
897{ 897{
898 int retval = 0; 898 int retval = 0;
899 int i; 899 int i;
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c
index 065ecd54bda..f0416a668b4 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -2086,8 +2086,8 @@ void cx23885_gpio_enable(struct cx23885_dev *dev, u32 mask, int asoutput)
2086 /* TODO: 23-19 */ 2086 /* TODO: 23-19 */
2087} 2087}
2088 2088
2089static int __devinit cx23885_initdev(struct pci_dev *pci_dev, 2089static int cx23885_initdev(struct pci_dev *pci_dev,
2090 const struct pci_device_id *pci_id) 2090 const struct pci_device_id *pci_id)
2091{ 2091{
2092 struct cx23885_dev *dev; 2092 struct cx23885_dev *dev;
2093 int err; 2093 int err;
@@ -2167,7 +2167,7 @@ fail_free:
2167 return err; 2167 return err;
2168} 2168}
2169 2169
2170static void __devexit cx23885_finidev(struct pci_dev *pci_dev) 2170static void cx23885_finidev(struct pci_dev *pci_dev)
2171{ 2171{
2172 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 2172 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
2173 struct cx23885_dev *dev = to_cx23885(v4l2_dev); 2173 struct cx23885_dev *dev = to_cx23885(v4l2_dev);
@@ -2210,7 +2210,7 @@ static struct pci_driver cx23885_pci_driver = {
2210 .name = "cx23885", 2210 .name = "cx23885",
2211 .id_table = cx23885_pci_tbl, 2211 .id_table = cx23885_pci_tbl,
2212 .probe = cx23885_initdev, 2212 .probe = cx23885_initdev,
2213 .remove = __devexit_p(cx23885_finidev), 2213 .remove = cx23885_finidev,
2214 /* TODO */ 2214 /* TODO */
2215 .suspend = NULL, 2215 .suspend = NULL,
2216 .resume = NULL, 2216 .resume = NULL,
diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c
index f11f6f07e91..1884e2cc35e 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1361,8 +1361,8 @@ struct cx25821_dev *cx25821_dev_get(struct pci_dev *pci)
1361} 1361}
1362EXPORT_SYMBOL(cx25821_dev_get); 1362EXPORT_SYMBOL(cx25821_dev_get);
1363 1363
1364static int __devinit cx25821_initdev(struct pci_dev *pci_dev, 1364static int cx25821_initdev(struct pci_dev *pci_dev,
1365 const struct pci_device_id *pci_id) 1365 const struct pci_device_id *pci_id)
1366{ 1366{
1367 struct cx25821_dev *dev; 1367 struct cx25821_dev *dev;
1368 int err = 0; 1368 int err = 0;
@@ -1433,7 +1433,7 @@ fail_free:
1433 return err; 1433 return err;
1434} 1434}
1435 1435
1436static void __devexit cx25821_finidev(struct pci_dev *pci_dev) 1436static void cx25821_finidev(struct pci_dev *pci_dev)
1437{ 1437{
1438 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 1438 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
1439 struct cx25821_dev *dev = get_cx25821(v4l2_dev); 1439 struct cx25821_dev *dev = get_cx25821(v4l2_dev);
@@ -1478,7 +1478,7 @@ static struct pci_driver cx25821_pci_driver = {
1478 .name = "cx25821", 1478 .name = "cx25821",
1479 .id_table = cx25821_pci_tbl, 1479 .id_table = cx25821_pci_tbl,
1480 .probe = cx25821_initdev, 1480 .probe = cx25821_initdev,
1481 .remove = __devexit_p(cx25821_finidev), 1481 .remove = cx25821_finidev,
1482 /* TODO */ 1482 /* TODO */
1483 .suspend = NULL, 1483 .suspend = NULL,
1484 .resume = NULL, 1484 .resume = NULL,
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index d2de1a913e1..27d62623274 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -540,7 +540,7 @@ static struct snd_pcm_ops snd_cx88_pcm_ops = {
540/* 540/*
541 * create a PCM device 541 * create a PCM device
542 */ 542 */
543static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, const char *name) 543static int snd_cx88_pcm(snd_cx88_card_t *chip, int device, const char *name)
544{ 544{
545 int err; 545 int err;
546 struct snd_pcm *pcm; 546 struct snd_pcm *pcm;
@@ -753,7 +753,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
753 * Only boards with eeprom and byte 1 at eeprom=1 have it 753 * Only boards with eeprom and byte 1 at eeprom=1 have it
754 */ 754 */
755 755
756static const struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = { 756static const struct pci_device_id cx88_audio_pci_tbl[] = {
757 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 757 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
758 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 758 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
759 {0, } 759 {0, }
@@ -792,10 +792,9 @@ static void snd_cx88_dev_free(struct snd_card * card)
792 */ 792 */
793 793
794static int devno; 794static int devno;
795static int __devinit snd_cx88_create(struct snd_card *card, 795static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
796 struct pci_dev *pci, 796 snd_cx88_card_t **rchip,
797 snd_cx88_card_t **rchip, 797 struct cx88_core **core_ptr)
798 struct cx88_core **core_ptr)
799{ 798{
800 snd_cx88_card_t *chip; 799 snd_cx88_card_t *chip;
801 struct cx88_core *core; 800 struct cx88_core *core;
@@ -862,8 +861,8 @@ static int __devinit snd_cx88_create(struct snd_card *card,
862 return 0; 861 return 0;
863} 862}
864 863
865static int __devinit cx88_audio_initdev(struct pci_dev *pci, 864static int cx88_audio_initdev(struct pci_dev *pci,
866 const struct pci_device_id *pci_id) 865 const struct pci_device_id *pci_id)
867{ 866{
868 struct snd_card *card; 867 struct snd_card *card;
869 snd_cx88_card_t *chip; 868 snd_cx88_card_t *chip;
@@ -931,7 +930,7 @@ error:
931/* 930/*
932 * ALSA destructor 931 * ALSA destructor
933 */ 932 */
934static void __devexit cx88_audio_finidev(struct pci_dev *pci) 933static void cx88_audio_finidev(struct pci_dev *pci)
935{ 934{
936 struct cx88_audio_dev *card = pci_get_drvdata(pci); 935 struct cx88_audio_dev *card = pci_get_drvdata(pci);
937 936
@@ -950,7 +949,7 @@ static struct pci_driver cx88_audio_pci_driver = {
950 .name = "cx88_audio", 949 .name = "cx88_audio",
951 .id_table = cx88_audio_pci_tbl, 950 .id_table = cx88_audio_pci_tbl,
952 .probe = cx88_audio_initdev, 951 .probe = cx88_audio_initdev,
953 .remove = __devexit_p(cx88_audio_finidev), 952 .remove = cx88_audio_finidev,
954}; 953};
955 954
956/**************************************************************************** 955/****************************************************************************
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c
index d46b008a46b..c9d3182f79d 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -791,8 +791,8 @@ int cx8802_unregister_driver(struct cx8802_driver *drv)
791} 791}
792 792
793/* ----------------------------------------------------------- */ 793/* ----------------------------------------------------------- */
794static int __devinit cx8802_probe(struct pci_dev *pci_dev, 794static int cx8802_probe(struct pci_dev *pci_dev,
795 const struct pci_device_id *pci_id) 795 const struct pci_device_id *pci_id)
796{ 796{
797 struct cx8802_dev *dev; 797 struct cx8802_dev *dev;
798 struct cx88_core *core; 798 struct cx88_core *core;
@@ -840,7 +840,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
840 return err; 840 return err;
841} 841}
842 842
843static void __devexit cx8802_remove(struct pci_dev *pci_dev) 843static void cx8802_remove(struct pci_dev *pci_dev)
844{ 844{
845 struct cx8802_dev *dev; 845 struct cx8802_dev *dev;
846 846
@@ -898,7 +898,7 @@ static struct pci_driver cx8802_pci_driver = {
898 .name = "cx88-mpeg driver manager", 898 .name = "cx88-mpeg driver manager",
899 .id_table = cx8802_pci_tbl, 899 .id_table = cx8802_pci_tbl,
900 .probe = cx8802_probe, 900 .probe = cx8802_probe,
901 .remove = __devexit_p(cx8802_remove), 901 .remove = cx8802_remove,
902}; 902};
903 903
904static int __init cx8802_init(void) 904static int __init cx8802_init(void)
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index 05171457bf2..bc78354262a 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1696,8 +1696,8 @@ static void cx8800_unregister_video(struct cx8800_dev *dev)
1696 } 1696 }
1697} 1697}
1698 1698
1699static int __devinit cx8800_initdev(struct pci_dev *pci_dev, 1699static int cx8800_initdev(struct pci_dev *pci_dev,
1700 const struct pci_device_id *pci_id) 1700 const struct pci_device_id *pci_id)
1701{ 1701{
1702 struct cx8800_dev *dev; 1702 struct cx8800_dev *dev;
1703 struct cx88_core *core; 1703 struct cx88_core *core;
@@ -1923,7 +1923,7 @@ fail_free:
1923 return err; 1923 return err;
1924} 1924}
1925 1925
1926static void __devexit cx8800_finidev(struct pci_dev *pci_dev) 1926static void cx8800_finidev(struct pci_dev *pci_dev)
1927{ 1927{
1928 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 1928 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
1929 struct cx88_core *core = dev->core; 1929 struct cx88_core *core = dev->core;
@@ -2052,7 +2052,7 @@ static struct pci_driver cx8800_pci_driver = {
2052 .name = "cx8800", 2052 .name = "cx8800",
2053 .id_table = cx8800_pci_tbl, 2053 .id_table = cx8800_pci_tbl,
2054 .probe = cx8800_initdev, 2054 .probe = cx8800_initdev,
2055 .remove = __devexit_p(cx8800_finidev), 2055 .remove = cx8800_finidev,
2056#ifdef CONFIG_PM 2056#ifdef CONFIG_PM
2057 .suspend = cx8800_suspend, 2057 .suspend = cx8800_suspend,
2058 .resume = cx8800_resume, 2058 .resume = cx8800_resume,
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index feff57ee5a0..36e34522b9a 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1542,7 +1542,7 @@ static void ddb_unmap(struct ddb *dev)
1542} 1542}
1543 1543
1544 1544
1545static void __devexit ddb_remove(struct pci_dev *pdev) 1545static void ddb_remove(struct pci_dev *pdev)
1546{ 1546{
1547 struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev); 1547 struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev);
1548 1548
@@ -1565,8 +1565,7 @@ static void __devexit ddb_remove(struct pci_dev *pdev)
1565} 1565}
1566 1566
1567 1567
1568static int __devinit ddb_probe(struct pci_dev *pdev, 1568static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1569 const struct pci_device_id *id)
1570{ 1569{
1571 struct ddb *dev; 1570 struct ddb *dev;
1572 int stat = 0; 1571 int stat = 0;
@@ -1679,7 +1678,7 @@ static struct ddb_info ddb_v6 = {
1679 .subvendor = _subvend, .subdevice = _subdev, \ 1678 .subvendor = _subvend, .subdevice = _subdev, \
1680 .driver_data = (unsigned long)&_driverdata } 1679 .driver_data = (unsigned long)&_driverdata }
1681 1680
1682static const struct pci_device_id ddb_id_tbl[] __devinitdata = { 1681static const struct pci_device_id ddb_id_tbl[] = {
1683 DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus), 1682 DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus),
1684 DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus), 1683 DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus),
1685 DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le), 1684 DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le),
@@ -1696,7 +1695,7 @@ static struct pci_driver ddb_pci_driver = {
1696 .name = "DDBridge", 1695 .name = "DDBridge",
1697 .id_table = ddb_id_tbl, 1696 .id_table = ddb_id_tbl,
1698 .probe = ddb_probe, 1697 .probe = ddb_probe,
1699 .remove = __devexit_p(ddb_remove), 1698 .remove = ddb_remove,
1700}; 1699};
1701 1700
1702static __init int module_init_ddbridge(void) 1701static __init int module_init_ddbridge(void)
diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c
index f288ffcc4b6..904c3ea350f 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -616,7 +616,7 @@ static void dm1105_set_dma_addr(struct dm1105_dev *dev)
616 dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr)); 616 dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr));
617} 617}
618 618
619static int __devinit dm1105_dma_map(struct dm1105_dev *dev) 619static int dm1105_dma_map(struct dm1105_dev *dev)
620{ 620{
621 dev->ts_buf = pci_alloc_consistent(dev->pdev, 621 dev->ts_buf = pci_alloc_consistent(dev->pdev,
622 6 * DM1105_DMA_BYTES, 622 6 * DM1105_DMA_BYTES,
@@ -736,7 +736,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
736 return IRQ_HANDLED; 736 return IRQ_HANDLED;
737} 737}
738 738
739static int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) 739static int dm1105_ir_init(struct dm1105_dev *dm1105)
740{ 740{
741 struct rc_dev *dev; 741 struct rc_dev *dev;
742 int err = -ENOMEM; 742 int err = -ENOMEM;
@@ -776,12 +776,12 @@ static int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
776 return 0; 776 return 0;
777} 777}
778 778
779static void __devexit dm1105_ir_exit(struct dm1105_dev *dm1105) 779static void dm1105_ir_exit(struct dm1105_dev *dm1105)
780{ 780{
781 rc_unregister_device(dm1105->ir.dev); 781 rc_unregister_device(dm1105->ir.dev);
782} 782}
783 783
784static int __devinit dm1105_hw_init(struct dm1105_dev *dev) 784static int dm1105_hw_init(struct dm1105_dev *dev)
785{ 785{
786 dm1105_disable_irqs(dev); 786 dm1105_disable_irqs(dev);
787 787
@@ -849,7 +849,7 @@ static struct ds3000_config dvbworld_ds3000_config = {
849 .demod_address = 0x68, 849 .demod_address = 0x68,
850}; 850};
851 851
852static int __devinit frontend_init(struct dm1105_dev *dev) 852static int frontend_init(struct dm1105_dev *dev)
853{ 853{
854 int ret; 854 int ret;
855 855
@@ -949,7 +949,7 @@ static int __devinit frontend_init(struct dm1105_dev *dev)
949 return 0; 949 return 0;
950} 950}
951 951
952static void __devinit dm1105_read_mac(struct dm1105_dev *dev, u8 *mac) 952static void dm1105_read_mac(struct dm1105_dev *dev, u8 *mac)
953{ 953{
954 static u8 command[1] = { 0x28 }; 954 static u8 command[1] = { 0x28 };
955 955
@@ -971,7 +971,7 @@ static void __devinit dm1105_read_mac(struct dm1105_dev *dev, u8 *mac)
971 dev_info(&dev->pdev->dev, "MAC %pM\n", mac); 971 dev_info(&dev->pdev->dev, "MAC %pM\n", mac);
972} 972}
973 973
974static int __devinit dm1105_probe(struct pci_dev *pdev, 974static int dm1105_probe(struct pci_dev *pdev,
975 const struct pci_device_id *ent) 975 const struct pci_device_id *ent)
976{ 976{
977 struct dm1105_dev *dev; 977 struct dm1105_dev *dev;
@@ -1174,7 +1174,7 @@ err_kfree:
1174 return ret; 1174 return ret;
1175} 1175}
1176 1176
1177static void __devexit dm1105_remove(struct pci_dev *pdev) 1177static void dm1105_remove(struct pci_dev *pdev)
1178{ 1178{
1179 struct dm1105_dev *dev = pci_get_drvdata(pdev); 1179 struct dm1105_dev *dev = pci_get_drvdata(pdev);
1180 struct dvb_adapter *dvb_adapter = &dev->dvb_adapter; 1180 struct dvb_adapter *dvb_adapter = &dev->dvb_adapter;
@@ -1207,7 +1207,7 @@ static void __devexit dm1105_remove(struct pci_dev *pdev)
1207 kfree(dev); 1207 kfree(dev);
1208} 1208}
1209 1209
1210static struct pci_device_id dm1105_id_table[] __devinitdata = { 1210static struct pci_device_id dm1105_id_table[] = {
1211 { 1211 {
1212 .vendor = PCI_VENDOR_ID_TRIGEM, 1212 .vendor = PCI_VENDOR_ID_TRIGEM,
1213 .device = PCI_DEVICE_ID_DM1105, 1213 .device = PCI_DEVICE_ID_DM1105,
@@ -1229,7 +1229,7 @@ static struct pci_driver dm1105_driver = {
1229 .name = DRIVER_NAME, 1229 .name = DRIVER_NAME,
1230 .id_table = dm1105_id_table, 1230 .id_table = dm1105_id_table,
1231 .probe = dm1105_probe, 1231 .probe = dm1105_probe,
1232 .remove = __devexit_p(dm1105_remove), 1232 .remove = dm1105_remove,
1233}; 1233};
1234 1234
1235static int __init dm1105_init(void) 1235static int __init dm1105_init(void)
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index 74e9a503236..df88dc4ab55 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -73,7 +73,7 @@ int (*ivtv_ext_init)(struct ivtv *);
73EXPORT_SYMBOL(ivtv_ext_init); 73EXPORT_SYMBOL(ivtv_ext_init);
74 74
75/* add your revision and whatnot here */ 75/* add your revision and whatnot here */
76static struct pci_device_id ivtv_pci_tbl[] __devinitdata = { 76static struct pci_device_id ivtv_pci_tbl[] = {
77 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV15, 77 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV15,
78 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 78 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
79 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV16, 79 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV16,
@@ -736,7 +736,7 @@ done:
736 No assumptions on the card type may be made here (see ivtv_init_struct2 736 No assumptions on the card type may be made here (see ivtv_init_struct2
737 for that). 737 for that).
738 */ 738 */
739static int __devinit ivtv_init_struct1(struct ivtv *itv) 739static int ivtv_init_struct1(struct ivtv *itv)
740{ 740{
741 struct sched_param param = { .sched_priority = 99 }; 741 struct sched_param param = { .sched_priority = 99 };
742 742
@@ -802,7 +802,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
802 802
803/* Second initialization part. Here the card type has been 803/* Second initialization part. Here the card type has been
804 autodetected. */ 804 autodetected. */
805static void __devinit ivtv_init_struct2(struct ivtv *itv) 805static void ivtv_init_struct2(struct ivtv *itv)
806{ 806{
807 int i; 807 int i;
808 808
@@ -1001,8 +1001,7 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
1001 } 1001 }
1002} 1002}
1003 1003
1004static int __devinit ivtv_probe(struct pci_dev *pdev, 1004static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
1005 const struct pci_device_id *pci_id)
1006{ 1005{
1007 int retval = 0; 1006 int retval = 0;
1008 int vbi_buf_size; 1007 int vbi_buf_size;
diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c
index cc0251e0107..6fe9fe5293d 100644
--- a/drivers/media/pci/mantis/hopper_cards.c
+++ b/drivers/media/pci/mantis/hopper_cards.c
@@ -151,7 +151,8 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id)
151 return IRQ_HANDLED; 151 return IRQ_HANDLED;
152} 152}
153 153
154static int __devinit hopper_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) 154static int hopper_pci_probe(struct pci_dev *pdev,
155 const struct pci_device_id *pci_id)
155{ 156{
156 struct mantis_pci *mantis; 157 struct mantis_pci *mantis;
157 struct mantis_hwconfig *config; 158 struct mantis_hwconfig *config;
@@ -230,7 +231,7 @@ fail0:
230 return err; 231 return err;
231} 232}
232 233
233static void __devexit hopper_pci_remove(struct pci_dev *pdev) 234static void hopper_pci_remove(struct pci_dev *pdev)
234{ 235{
235 struct mantis_pci *mantis = pci_get_drvdata(pdev); 236 struct mantis_pci *mantis = pci_get_drvdata(pdev);
236 237
@@ -259,12 +260,12 @@ static struct pci_driver hopper_pci_driver = {
259 .remove = hopper_pci_remove, 260 .remove = hopper_pci_remove,
260}; 261};
261 262
262static int __devinit hopper_init(void) 263static int hopper_init(void)
263{ 264{
264 return pci_register_driver(&hopper_pci_driver); 265 return pci_register_driver(&hopper_pci_driver);
265} 266}
266 267
267static void __devexit hopper_exit(void) 268static void hopper_exit(void)
268{ 269{
269 return pci_unregister_driver(&hopper_pci_driver); 270 return pci_unregister_driver(&hopper_pci_driver);
270} 271}
diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c
index 0207d1f064e..932a0d73a7f 100644
--- a/drivers/media/pci/mantis/mantis_cards.c
+++ b/drivers/media/pci/mantis/mantis_cards.c
@@ -159,7 +159,8 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id)
159 return IRQ_HANDLED; 159 return IRQ_HANDLED;
160} 160}
161 161
162static int __devinit mantis_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) 162static int mantis_pci_probe(struct pci_dev *pdev,
163 const struct pci_device_id *pci_id)
163{ 164{
164 struct mantis_pci *mantis; 165 struct mantis_pci *mantis;
165 struct mantis_hwconfig *config; 166 struct mantis_hwconfig *config;
@@ -249,7 +250,7 @@ fail0:
249 return err; 250 return err;
250} 251}
251 252
252static void __devexit mantis_pci_remove(struct pci_dev *pdev) 253static void mantis_pci_remove(struct pci_dev *pdev)
253{ 254{
254 struct mantis_pci *mantis = pci_get_drvdata(pdev); 255 struct mantis_pci *mantis = pci_get_drvdata(pdev);
255 256
@@ -289,12 +290,12 @@ static struct pci_driver mantis_pci_driver = {
289 .remove = mantis_pci_remove, 290 .remove = mantis_pci_remove,
290}; 291};
291 292
292static int __devinit mantis_init(void) 293static int mantis_init(void)
293{ 294{
294 return pci_register_driver(&mantis_pci_driver); 295 return pci_register_driver(&mantis_pci_driver);
295} 296}
296 297
297static void __devexit mantis_exit(void) 298static void mantis_exit(void)
298{ 299{
299 return pci_unregister_driver(&mantis_pci_driver); 300 return pci_unregister_driver(&mantis_pci_driver);
300} 301}
diff --git a/drivers/media/pci/mantis/mantis_dvb.c b/drivers/media/pci/mantis/mantis_dvb.c
index 5d15c6b74d9..5a71e1791cf 100644
--- a/drivers/media/pci/mantis/mantis_dvb.c
+++ b/drivers/media/pci/mantis/mantis_dvb.c
@@ -144,7 +144,7 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
144 return 0; 144 return 0;
145} 145}
146 146
147int __devinit mantis_dvb_init(struct mantis_pci *mantis) 147int mantis_dvb_init(struct mantis_pci *mantis)
148{ 148{
149 struct mantis_hwconfig *config = mantis->hwconfig; 149 struct mantis_hwconfig *config = mantis->hwconfig;
150 int result = -1; 150 int result = -1;
@@ -271,7 +271,7 @@ err0:
271} 271}
272EXPORT_SYMBOL_GPL(mantis_dvb_init); 272EXPORT_SYMBOL_GPL(mantis_dvb_init);
273 273
274int __devexit mantis_dvb_exit(struct mantis_pci *mantis) 274int mantis_dvb_exit(struct mantis_pci *mantis)
275{ 275{
276 int err; 276 int err;
277 277
diff --git a/drivers/media/pci/mantis/mantis_i2c.c b/drivers/media/pci/mantis/mantis_i2c.c
index e7794517fe2..937fb9d5021 100644
--- a/drivers/media/pci/mantis/mantis_i2c.c
+++ b/drivers/media/pci/mantis/mantis_i2c.c
@@ -217,7 +217,7 @@ static struct i2c_algorithm mantis_algo = {
217 .functionality = mantis_i2c_func, 217 .functionality = mantis_i2c_func,
218}; 218};
219 219
220int __devinit mantis_i2c_init(struct mantis_pci *mantis) 220int mantis_i2c_init(struct mantis_pci *mantis)
221{ 221{
222 u32 intstat, intmask; 222 u32 intstat, intmask;
223 struct i2c_adapter *i2c_adapter = &mantis->adapter; 223 struct i2c_adapter *i2c_adapter = &mantis->adapter;
diff --git a/drivers/media/pci/mantis/mantis_pci.c b/drivers/media/pci/mantis/mantis_pci.c
index 371558af2d9..a846036ea02 100644
--- a/drivers/media/pci/mantis/mantis_pci.c
+++ b/drivers/media/pci/mantis/mantis_pci.c
@@ -46,7 +46,7 @@
46 46
47#define DRIVER_NAME "Mantis Core" 47#define DRIVER_NAME "Mantis Core"
48 48
49int __devinit mantis_pci_init(struct mantis_pci *mantis) 49int mantis_pci_init(struct mantis_pci *mantis)
50{ 50{
51 u8 latency; 51 u8 latency;
52 struct mantis_hwconfig *config = mantis->hwconfig; 52 struct mantis_hwconfig *config = mantis->hwconfig;
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index ae7d32027bf..049e18667cd 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1728,8 +1728,7 @@ static int meye_resume(struct pci_dev *pdev)
1728} 1728}
1729#endif 1729#endif
1730 1730
1731static int __devinit meye_probe(struct pci_dev *pcidev, 1731static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
1732 const struct pci_device_id *ent)
1733{ 1732{
1734 struct v4l2_device *v4l2_dev = &meye.v4l2_dev; 1733 struct v4l2_device *v4l2_dev = &meye.v4l2_dev;
1735 int ret = -EBUSY; 1734 int ret = -EBUSY;
@@ -1889,7 +1888,7 @@ outnotdev:
1889 return ret; 1888 return ret;
1890} 1889}
1891 1890
1892static void __devexit meye_remove(struct pci_dev *pcidev) 1891static void meye_remove(struct pci_dev *pcidev)
1893{ 1892{
1894 video_unregister_device(meye.vdev); 1893 video_unregister_device(meye.vdev);
1895 1894
@@ -1935,7 +1934,7 @@ static struct pci_driver meye_driver = {
1935 .name = "meye", 1934 .name = "meye",
1936 .id_table = meye_pci_tbl, 1935 .id_table = meye_pci_tbl,
1937 .probe = meye_probe, 1936 .probe = meye_probe,
1938 .remove = __devexit_p(meye_remove), 1937 .remove = meye_remove,
1939#ifdef CONFIG_PM 1938#ifdef CONFIG_PM
1940 .suspend = meye_suspend, 1939 .suspend = meye_suspend,
1941 .resume = meye_resume, 1940 .resume = meye_resume,
diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c
index b38bce52956..fad21411366 100644
--- a/drivers/media/pci/ngene/ngene-cards.c
+++ b/drivers/media/pci/ngene/ngene-cards.c
@@ -743,7 +743,7 @@ static struct ngene_info ngene_info_terratec = {
743 743
744/****************************************************************************/ 744/****************************************************************************/
745 745
746static const struct pci_device_id ngene_id_tbl[] __devinitdata = { 746static const struct pci_device_id ngene_id_tbl[] = {
747 NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2), 747 NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
748 NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2), 748 NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
749 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2), 749 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),
@@ -800,7 +800,7 @@ static struct pci_driver ngene_pci_driver = {
800 .name = "ngene", 800 .name = "ngene",
801 .id_table = ngene_id_tbl, 801 .id_table = ngene_id_tbl,
802 .probe = ngene_probe, 802 .probe = ngene_probe,
803 .remove = __devexit_p(ngene_remove), 803 .remove = ngene_remove,
804 .err_handler = &ngene_errors, 804 .err_handler = &ngene_errors,
805 .shutdown = ngene_shutdown, 805 .shutdown = ngene_shutdown,
806}; 806};
diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index 8eeec4f50cc..37ebc42392a 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1636,7 +1636,7 @@ void ngene_shutdown(struct pci_dev *pdev)
1636/* device probe/remove calls ************************************************/ 1636/* device probe/remove calls ************************************************/
1637/****************************************************************************/ 1637/****************************************************************************/
1638 1638
1639void __devexit ngene_remove(struct pci_dev *pdev) 1639void ngene_remove(struct pci_dev *pdev)
1640{ 1640{
1641 struct ngene *dev = pci_get_drvdata(pdev); 1641 struct ngene *dev = pci_get_drvdata(pdev);
1642 int i; 1642 int i;
@@ -1652,8 +1652,7 @@ void __devexit ngene_remove(struct pci_dev *pdev)
1652 pci_disable_device(pdev); 1652 pci_disable_device(pdev);
1653} 1653}
1654 1654
1655int __devinit ngene_probe(struct pci_dev *pci_dev, 1655int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
1656 const struct pci_device_id *id)
1657{ 1656{
1658 struct ngene *dev; 1657 struct ngene *dev;
1659 int stat = 0; 1658 int stat = 0;
diff --git a/drivers/media/pci/ngene/ngene.h b/drivers/media/pci/ngene/ngene.h
index 5443dc0caea..22c39ff6bfa 100644
--- a/drivers/media/pci/ngene/ngene.h
+++ b/drivers/media/pci/ngene/ngene.h
@@ -887,9 +887,8 @@ struct ngene_buffer {
887 887
888 888
889/* Provided by ngene-core.c */ 889/* Provided by ngene-core.c */
890int __devinit ngene_probe(struct pci_dev *pci_dev, 890int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id);
891 const struct pci_device_id *id); 891void ngene_remove(struct pci_dev *pdev);
892void __devexit ngene_remove(struct pci_dev *pdev);
893void ngene_shutdown(struct pci_dev *pdev); 892void ngene_shutdown(struct pci_dev *pdev);
894int ngene_command(struct ngene *dev, struct ngene_command *com); 893int ngene_command(struct ngene *dev, struct ngene_command *com);
895int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level); 894int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level);
diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c
index f148b19a206..2290faee585 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -240,7 +240,7 @@ static void pluto_set_dma_addr(struct pluto *pluto)
240 pluto_writereg(pluto, REG_PCAR, pluto->dma_addr); 240 pluto_writereg(pluto, REG_PCAR, pluto->dma_addr);
241} 241}
242 242
243static int __devinit pluto_dma_map(struct pluto *pluto) 243static int pluto_dma_map(struct pluto *pluto)
244{ 244{
245 pluto->dma_addr = pci_map_single(pluto->pdev, pluto->dma_buf, 245 pluto->dma_addr = pci_map_single(pluto->pdev, pluto->dma_buf,
246 TS_DMA_BYTES, PCI_DMA_FROMDEVICE); 246 TS_DMA_BYTES, PCI_DMA_FROMDEVICE);
@@ -368,7 +368,7 @@ static irqreturn_t pluto_irq(int irq, void *dev_id)
368 return IRQ_HANDLED; 368 return IRQ_HANDLED;
369} 369}
370 370
371static void __devinit pluto_enable_irqs(struct pluto *pluto) 371static void pluto_enable_irqs(struct pluto *pluto)
372{ 372{
373 u32 val = pluto_readreg(pluto, REG_TSCR); 373 u32 val = pluto_readreg(pluto, REG_TSCR);
374 374
@@ -394,7 +394,7 @@ static void pluto_disable_irqs(struct pluto *pluto)
394 pluto_write_tscr(pluto, val); 394 pluto_write_tscr(pluto, val);
395} 395}
396 396
397static int __devinit pluto_hw_init(struct pluto *pluto) 397static int pluto_hw_init(struct pluto *pluto)
398{ 398{
399 pluto_reset_frontend(pluto, 1); 399 pluto_reset_frontend(pluto, 1);
400 400
@@ -505,7 +505,7 @@ static int pluto2_request_firmware(struct dvb_frontend *fe,
505 return request_firmware(fw, name, &pluto->pdev->dev); 505 return request_firmware(fw, name, &pluto->pdev->dev);
506} 506}
507 507
508static struct tda1004x_config pluto2_fe_config __devinitdata = { 508static struct tda1004x_config pluto2_fe_config = {
509 .demod_address = I2C_ADDR_TDA10046 >> 1, 509 .demod_address = I2C_ADDR_TDA10046 >> 1,
510 .invert = 1, 510 .invert = 1,
511 .invert_oclk = 0, 511 .invert_oclk = 0,
@@ -515,7 +515,7 @@ static struct tda1004x_config pluto2_fe_config __devinitdata = {
515 .request_firmware = pluto2_request_firmware, 515 .request_firmware = pluto2_request_firmware,
516}; 516};
517 517
518static int __devinit frontend_init(struct pluto *pluto) 518static int frontend_init(struct pluto *pluto)
519{ 519{
520 int ret; 520 int ret;
521 521
@@ -536,14 +536,14 @@ static int __devinit frontend_init(struct pluto *pluto)
536 return 0; 536 return 0;
537} 537}
538 538
539static void __devinit pluto_read_rev(struct pluto *pluto) 539static void pluto_read_rev(struct pluto *pluto)
540{ 540{
541 u32 val = pluto_readreg(pluto, REG_MISC) & MISC_DVR; 541 u32 val = pluto_readreg(pluto, REG_MISC) & MISC_DVR;
542 dev_info(&pluto->pdev->dev, "board revision %d.%d\n", 542 dev_info(&pluto->pdev->dev, "board revision %d.%d\n",
543 (val >> 12) & 0x0f, (val >> 4) & 0xff); 543 (val >> 12) & 0x0f, (val >> 4) & 0xff);
544} 544}
545 545
546static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac) 546static void pluto_read_mac(struct pluto *pluto, u8 *mac)
547{ 547{
548 u32 val = pluto_readreg(pluto, REG_MMAC); 548 u32 val = pluto_readreg(pluto, REG_MMAC);
549 mac[0] = (val >> 8) & 0xff; 549 mac[0] = (val >> 8) & 0xff;
@@ -560,7 +560,7 @@ static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac)
560 dev_info(&pluto->pdev->dev, "MAC %pM\n", mac); 560 dev_info(&pluto->pdev->dev, "MAC %pM\n", mac);
561} 561}
562 562
563static int __devinit pluto_read_serial(struct pluto *pluto) 563static int pluto_read_serial(struct pluto *pluto)
564{ 564{
565 struct pci_dev *pdev = pluto->pdev; 565 struct pci_dev *pdev = pluto->pdev;
566 unsigned int i, j; 566 unsigned int i, j;
@@ -588,8 +588,7 @@ out:
588 return 0; 588 return 0;
589} 589}
590 590
591static int __devinit pluto2_probe(struct pci_dev *pdev, 591static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
592 const struct pci_device_id *ent)
593{ 592{
594 struct pluto *pluto; 593 struct pluto *pluto;
595 struct dvb_adapter *dvb_adapter; 594 struct dvb_adapter *dvb_adapter;
@@ -742,7 +741,7 @@ err_kfree:
742 goto out; 741 goto out;
743} 742}
744 743
745static void __devexit pluto2_remove(struct pci_dev *pdev) 744static void pluto2_remove(struct pci_dev *pdev)
746{ 745{
747 struct pluto *pluto = pci_get_drvdata(pdev); 746 struct pluto *pluto = pci_get_drvdata(pdev);
748 struct dvb_adapter *dvb_adapter = &pluto->dvb_adapter; 747 struct dvb_adapter *dvb_adapter = &pluto->dvb_adapter;
@@ -777,7 +776,7 @@ static void __devexit pluto2_remove(struct pci_dev *pdev)
777#define PCI_DEVICE_ID_PLUTO2 0x0001 776#define PCI_DEVICE_ID_PLUTO2 0x0001
778#endif 777#endif
779 778
780static struct pci_device_id pluto2_id_table[] __devinitdata = { 779static struct pci_device_id pluto2_id_table[] = {
781 { 780 {
782 .vendor = PCI_VENDOR_ID_SCM, 781 .vendor = PCI_VENDOR_ID_SCM,
783 .device = PCI_DEVICE_ID_PLUTO2, 782 .device = PCI_DEVICE_ID_PLUTO2,
@@ -794,7 +793,7 @@ static struct pci_driver pluto2_driver = {
794 .name = DRIVER_NAME, 793 .name = DRIVER_NAME,
795 .id_table = pluto2_id_table, 794 .id_table = pluto2_id_table,
796 .probe = pluto2_probe, 795 .probe = pluto2_probe,
797 .remove = __devexit_p(pluto2_remove), 796 .remove = pluto2_remove,
798}; 797};
799 798
800static int __init pluto2_init(void) 799static int __init pluto2_init(void)
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 15b35c4725f..e9211086df4 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1058,7 +1058,7 @@ static void pt1_i2c_init(struct pt1 *pt1)
1058 pt1_i2c_emit(pt1, i, 0, 0, 1, 1, 0); 1058 pt1_i2c_emit(pt1, i, 0, 0, 1, 1, 0);
1059} 1059}
1060 1060
1061static void __devexit pt1_remove(struct pci_dev *pdev) 1061static void pt1_remove(struct pci_dev *pdev)
1062{ 1062{
1063 struct pt1 *pt1; 1063 struct pt1 *pt1;
1064 void __iomem *regs; 1064 void __iomem *regs;
@@ -1083,8 +1083,7 @@ static void __devexit pt1_remove(struct pci_dev *pdev)
1083 pci_disable_device(pdev); 1083 pci_disable_device(pdev);
1084} 1084}
1085 1085
1086static int __devinit 1086static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1087pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1088{ 1087{
1089 int ret; 1088 int ret;
1090 void __iomem *regs; 1089 void __iomem *regs;
@@ -1222,7 +1221,7 @@ MODULE_DEVICE_TABLE(pci, pt1_id_table);
1222static struct pci_driver pt1_driver = { 1221static struct pci_driver pt1_driver = {
1223 .name = DRIVER_NAME, 1222 .name = DRIVER_NAME,
1224 .probe = pt1_probe, 1223 .probe = pt1_probe,
1225 .remove = __devexit_p(pt1_remove), 1224 .remove = pt1_remove,
1226 .id_table = pt1_id_table, 1225 .id_table = pt1_id_table,
1227}; 1226};
1228 1227
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c
index 8976d0e6581..e359d200d69 100644
--- a/drivers/media/pci/saa7134/saa7134-core.c
+++ b/drivers/media/pci/saa7134/saa7134-core.c
@@ -754,7 +754,7 @@ static int saa7134_hwfini(struct saa7134_dev *dev)
754 return 0; 754 return 0;
755} 755}
756 756
757static void __devinit must_configure_manually(int has_eeprom) 757static void must_configure_manually(int has_eeprom)
758{ 758{
759 unsigned int i,p; 759 unsigned int i,p;
760 760
@@ -860,8 +860,8 @@ static void mpeg_ops_detach(struct saa7134_mpeg_ops *ops,
860 dev->mops = NULL; 860 dev->mops = NULL;
861} 861}
862 862
863static int __devinit saa7134_initdev(struct pci_dev *pci_dev, 863static int saa7134_initdev(struct pci_dev *pci_dev,
864 const struct pci_device_id *pci_id) 864 const struct pci_device_id *pci_id)
865{ 865{
866 struct saa7134_dev *dev; 866 struct saa7134_dev *dev;
867 struct saa7134_mpeg_ops *mops; 867 struct saa7134_mpeg_ops *mops;
@@ -1102,7 +1102,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1102 return err; 1102 return err;
1103} 1103}
1104 1104
1105static void __devexit saa7134_finidev(struct pci_dev *pci_dev) 1105static void saa7134_finidev(struct pci_dev *pci_dev)
1106{ 1106{
1107 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 1107 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
1108 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev); 1108 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev);
@@ -1322,7 +1322,7 @@ static struct pci_driver saa7134_pci_driver = {
1322 .name = "saa7134", 1322 .name = "saa7134",
1323 .id_table = saa7134_pci_tbl, 1323 .id_table = saa7134_pci_tbl,
1324 .probe = saa7134_initdev, 1324 .probe = saa7134_initdev,
1325 .remove = __devexit_p(saa7134_finidev), 1325 .remove = saa7134_finidev,
1326#ifdef CONFIG_PM 1326#ifdef CONFIG_PM
1327 .suspend = saa7134_suspend, 1327 .suspend = saa7134_suspend,
1328 .resume = saa7134_resume 1328 .resume = saa7134_resume
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h
index c24b6512bd8..075908fae4d 100644
--- a/drivers/media/pci/saa7134/saa7134.h
+++ b/drivers/media/pci/saa7134/saa7134.h
@@ -739,7 +739,7 @@ extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
739 739
740extern struct saa7134_board saa7134_boards[]; 740extern struct saa7134_board saa7134_boards[];
741extern const unsigned int saa7134_bcount; 741extern const unsigned int saa7134_bcount;
742extern struct pci_device_id __devinitdata saa7134_pci_tbl[]; 742extern struct pci_device_id saa7134_pci_tbl[];
743 743
744extern int saa7134_board_init1(struct saa7134_dev *dev); 744extern int saa7134_board_init1(struct saa7134_dev *dev);
745extern int saa7134_board_init2(struct saa7134_dev *dev); 745extern int saa7134_board_init2(struct saa7134_dev *dev);
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 063047f5676..63502e7a2a7 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1185,8 +1185,8 @@ static int saa7164_thread_function(void *data)
1185 return 0; 1185 return 0;
1186} 1186}
1187 1187
1188static int __devinit saa7164_initdev(struct pci_dev *pci_dev, 1188static int saa7164_initdev(struct pci_dev *pci_dev,
1189 const struct pci_device_id *pci_id) 1189 const struct pci_device_id *pci_id)
1190{ 1190{
1191 struct saa7164_dev *dev; 1191 struct saa7164_dev *dev;
1192 int err, i; 1192 int err, i;
@@ -1376,7 +1376,7 @@ static void saa7164_shutdown(struct saa7164_dev *dev)
1376 dprintk(1, "%s()\n", __func__); 1376 dprintk(1, "%s()\n", __func__);
1377} 1377}
1378 1378
1379static void __devexit saa7164_finidev(struct pci_dev *pci_dev) 1379static void saa7164_finidev(struct pci_dev *pci_dev)
1380{ 1380{
1381 struct saa7164_dev *dev = pci_get_drvdata(pci_dev); 1381 struct saa7164_dev *dev = pci_get_drvdata(pci_dev);
1382 1382
@@ -1459,7 +1459,7 @@ static struct pci_driver saa7164_pci_driver = {
1459 .name = "saa7164", 1459 .name = "saa7164",
1460 .id_table = saa7164_pci_tbl, 1460 .id_table = saa7164_pci_tbl,
1461 .probe = saa7164_initdev, 1461 .probe = saa7164_initdev,
1462 .remove = __devexit_p(saa7164_finidev), 1462 .remove = saa7164_finidev,
1463 /* TODO */ 1463 /* TODO */
1464 .suspend = NULL, 1464 .suspend = NULL,
1465 .resume = NULL, 1465 .resume = NULL,
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
index 4c10205264d..27ae4884265 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -1205,8 +1205,8 @@ static void vip_gpio_release(struct device *dev, int pin, const char *name)
1205 * 1205 *
1206 * -ENODEV, device could not be detected or registered 1206 * -ENODEV, device could not be detected or registered
1207 */ 1207 */
1208static int __devinit sta2x11_vip_init_one(struct pci_dev *pdev, 1208static int sta2x11_vip_init_one(struct pci_dev *pdev,
1209 const struct pci_device_id *ent) 1209 const struct pci_device_id *ent)
1210{ 1210{
1211 int ret; 1211 int ret;
1212 struct sta2x11_vip *vip; 1212 struct sta2x11_vip *vip;
@@ -1376,7 +1376,7 @@ disable:
1376 * free memory 1376 * free memory
1377 * free GPIO pins 1377 * free GPIO pins
1378 */ 1378 */
1379static void __devexit sta2x11_vip_remove_one(struct pci_dev *pdev) 1379static void sta2x11_vip_remove_one(struct pci_dev *pdev)
1380{ 1380{
1381 struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); 1381 struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);
1382 struct sta2x11_vip *vip = 1382 struct sta2x11_vip *vip =
@@ -1517,7 +1517,7 @@ static DEFINE_PCI_DEVICE_TABLE(sta2x11_vip_pci_tbl) = {
1517static struct pci_driver sta2x11_vip_driver = { 1517static struct pci_driver sta2x11_vip_driver = {
1518 .name = DRV_NAME, 1518 .name = DRV_NAME,
1519 .probe = sta2x11_vip_init_one, 1519 .probe = sta2x11_vip_init_one,
1520 .remove = __devexit_p(sta2x11_vip_remove_one), 1520 .remove = sta2x11_vip_remove_one,
1521 .id_table = sta2x11_vip_pci_tbl, 1521 .id_table = sta2x11_vip_pci_tbl,
1522#ifdef CONFIG_PM 1522#ifdef CONFIG_PM
1523 .suspend = sta2x11_vip_suspend, 1523 .suspend = sta2x11_vip_suspend,
diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c
index 4bd8bd56bef..4656d4a10af 100644
--- a/drivers/media/pci/ttpci/av7110.c
+++ b/drivers/media/pci/ttpci/av7110.c
@@ -2367,8 +2367,8 @@ static int frontend_init(struct av7110 *av7110)
2367 * The same behaviour of missing VSYNC can be duplicated on budget 2367 * The same behaviour of missing VSYNC can be duplicated on budget
2368 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. 2368 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble.
2369 */ 2369 */
2370static int __devinit av7110_attach(struct saa7146_dev* dev, 2370static int av7110_attach(struct saa7146_dev* dev,
2371 struct saa7146_pci_extension_data *pci_ext) 2371 struct saa7146_pci_extension_data *pci_ext)
2372{ 2372{
2373 const int length = TS_WIDTH * TS_HEIGHT; 2373 const int length = TS_WIDTH * TS_HEIGHT;
2374 struct pci_dev *pdev = dev->pci; 2374 struct pci_dev *pdev = dev->pci;
@@ -2761,7 +2761,7 @@ err_kfree_0:
2761 goto out; 2761 goto out;
2762} 2762}
2763 2763
2764static int __devexit av7110_detach(struct saa7146_dev* saa) 2764static int av7110_detach(struct saa7146_dev* saa)
2765{ 2765{
2766 struct av7110 *av7110 = saa->ext_priv; 2766 struct av7110 *av7110 = saa->ext_priv;
2767 dprintk(4, "%p\n", av7110); 2767 dprintk(4, "%p\n", av7110);
@@ -2910,7 +2910,7 @@ static struct saa7146_extension av7110_extension_driver = {
2910 .module = THIS_MODULE, 2910 .module = THIS_MODULE,
2911 .pci_tbl = &pci_tbl[0], 2911 .pci_tbl = &pci_tbl[0],
2912 .attach = av7110_attach, 2912 .attach = av7110_attach,
2913 .detach = __devexit_p(av7110_detach), 2913 .detach = av7110_detach,
2914 2914
2915 .irq_mask = MASK_19 | MASK_03 | MASK_10, 2915 .irq_mask = MASK_19 | MASK_03 | MASK_10,
2916 .irq_func = av7110_irq, 2916 .irq_func = av7110_irq,
diff --git a/drivers/media/pci/ttpci/av7110_ir.c b/drivers/media/pci/ttpci/av7110_ir.c
index 908f272fe26..eb822862a64 100644
--- a/drivers/media/pci/ttpci/av7110_ir.c
+++ b/drivers/media/pci/ttpci/av7110_ir.c
@@ -324,7 +324,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom)
324} 324}
325 325
326 326
327int __devinit av7110_ir_init(struct av7110 *av7110) 327int av7110_ir_init(struct av7110 *av7110)
328{ 328{
329 struct input_dev *input_dev; 329 struct input_dev *input_dev;
330 static struct proc_dir_entry *e; 330 static struct proc_dir_entry *e;
@@ -385,7 +385,7 @@ int __devinit av7110_ir_init(struct av7110 *av7110)
385} 385}
386 386
387 387
388void __devexit av7110_ir_exit(struct av7110 *av7110) 388void av7110_ir_exit(struct av7110 *av7110)
389{ 389{
390 int i; 390 int i;
391 391
diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c
index fffc54b452c..a90a3b9b09b 100644
--- a/drivers/media/pci/zoran/zoran_card.c
+++ b/drivers/media/pci/zoran/zoran_card.c
@@ -369,7 +369,7 @@ static const unsigned short bt819_addrs[] = { 0x45, I2C_CLIENT_END };
369static const unsigned short bt856_addrs[] = { 0x44, I2C_CLIENT_END }; 369static const unsigned short bt856_addrs[] = { 0x44, I2C_CLIENT_END };
370static const unsigned short bt866_addrs[] = { 0x44, I2C_CLIENT_END }; 370static const unsigned short bt866_addrs[] = { 0x44, I2C_CLIENT_END };
371 371
372static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { 372static struct card_info zoran_cards[NUM_CARDS] = {
373 { 373 {
374 .type = DC10_old, 374 .type = DC10_old,
375 .name = "DC10(old)", 375 .name = "DC10(old)",
@@ -948,8 +948,7 @@ zoran_open_init_params (struct zoran *zr)
948 zr->testing = 0; 948 zr->testing = 0;
949} 949}
950 950
951static void __devinit 951static void test_interrupts (struct zoran *zr)
952test_interrupts (struct zoran *zr)
953{ 952{
954 DEFINE_WAIT(wait); 953 DEFINE_WAIT(wait);
955 int timeout, icr; 954 int timeout, icr;
@@ -974,8 +973,7 @@ test_interrupts (struct zoran *zr)
974 btwrite(icr, ZR36057_ICR); 973 btwrite(icr, ZR36057_ICR);
975} 974}
976 975
977static int __devinit 976static int zr36057_init (struct zoran *zr)
978zr36057_init (struct zoran *zr)
979{ 977{
980 int j, err; 978 int j, err;
981 979
@@ -1083,7 +1081,7 @@ exit_free:
1083 return err; 1081 return err;
1084} 1082}
1085 1083
1086static void __devexit zoran_remove(struct pci_dev *pdev) 1084static void zoran_remove(struct pci_dev *pdev)
1087{ 1085{
1088 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev); 1086 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev);
1089 struct zoran *zr = to_zoran(v4l2_dev); 1087 struct zoran *zr = to_zoran(v4l2_dev);
@@ -1129,9 +1127,8 @@ zoran_vdev_release (struct video_device *vdev)
1129 kfree(vdev); 1127 kfree(vdev);
1130} 1128}
1131 1129
1132static struct videocodec_master * __devinit 1130static struct videocodec_master *zoran_setup_videocodec(struct zoran *zr,
1133zoran_setup_videocodec (struct zoran *zr, 1131 int type)
1134 int type)
1135{ 1132{
1136 struct videocodec_master *m = NULL; 1133 struct videocodec_master *m = NULL;
1137 1134
@@ -1192,8 +1189,7 @@ static void zoran_subdev_notify(struct v4l2_subdev *sd, unsigned int cmd, void *
1192 * Scan for a Buz card (actually for the PCI controller ZR36057), 1189 * Scan for a Buz card (actually for the PCI controller ZR36057),
1193 * request the irq and map the io memory 1190 * request the irq and map the io memory
1194 */ 1191 */
1195static int __devinit zoran_probe(struct pci_dev *pdev, 1192static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1196 const struct pci_device_id *ent)
1197{ 1193{
1198 unsigned char latency, need_latency; 1194 unsigned char latency, need_latency;
1199 struct zoran *zr; 1195 struct zoran *zr;
@@ -1459,7 +1455,7 @@ static struct pci_driver zoran_driver = {
1459 .name = "zr36067", 1455 .name = "zr36067",
1460 .id_table = zr36067_pci_tbl, 1456 .id_table = zr36067_pci_tbl,
1461 .probe = zoran_probe, 1457 .probe = zoran_probe,
1462 .remove = __devexit_p(zoran_remove), 1458 .remove = zoran_remove,
1463}; 1459};
1464 1460
1465static int __init zoran_init(void) 1461static int __init zoran_init(void)
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 53f12c7466b..e60ae41e231 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -3080,7 +3080,7 @@ static const struct v4l2_file_operations zoran_fops = {
3080 .poll = zoran_poll, 3080 .poll = zoran_poll,
3081}; 3081};
3082 3082
3083struct video_device zoran_template __devinitdata = { 3083struct video_device zoran_template = {
3084 .name = ZORAN_NAME, 3084 .name = ZORAN_NAME,
3085 .fops = &zoran_fops, 3085 .fops = &zoran_fops,
3086 .ioctl_ops = &zoran_ioctl_ops, 3086 .ioctl_ops = &zoran_ioctl_ops,
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index ec476ef5b70..1aad2a65d2f 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -862,7 +862,7 @@ static struct v4l2_file_operations bcap_fops = {
862 .poll = bcap_poll 862 .poll = bcap_poll
863}; 863};
864 864
865static int __devinit bcap_probe(struct platform_device *pdev) 865static int bcap_probe(struct platform_device *pdev)
866{ 866{
867 struct bcap_device *bcap_dev; 867 struct bcap_device *bcap_dev;
868 struct video_device *vfd; 868 struct video_device *vfd;
@@ -1026,7 +1026,7 @@ err_free_dev:
1026 return ret; 1026 return ret;
1027} 1027}
1028 1028
1029static int __devexit bcap_remove(struct platform_device *pdev) 1029static int bcap_remove(struct platform_device *pdev)
1030{ 1030{
1031 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); 1031 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
1032 struct bcap_device *bcap_dev = container_of(v4l2_dev, 1032 struct bcap_device *bcap_dev = container_of(v4l2_dev,
@@ -1048,7 +1048,7 @@ static struct platform_driver bcap_driver = {
1048 .owner = THIS_MODULE, 1048 .owner = THIS_MODULE,
1049 }, 1049 },
1050 .probe = bcap_probe, 1050 .probe = bcap_probe,
1051 .remove = __devexit_p(bcap_remove), 1051 .remove = bcap_remove,
1052}; 1052};
1053module_platform_driver(bcap_driver); 1053module_platform_driver(bcap_driver);
1054 1054
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 7b8b547f2d5..1cf8293c0fb 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -1891,7 +1891,7 @@ static const struct of_device_id coda_dt_ids[] = {
1891MODULE_DEVICE_TABLE(of, coda_dt_ids); 1891MODULE_DEVICE_TABLE(of, coda_dt_ids);
1892#endif 1892#endif
1893 1893
1894static int __devinit coda_probe(struct platform_device *pdev) 1894static int coda_probe(struct platform_device *pdev)
1895{ 1895{
1896 const struct of_device_id *of_id = 1896 const struct of_device_id *of_id =
1897 of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev); 1897 of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev);
@@ -2033,7 +2033,7 @@ static int coda_remove(struct platform_device *pdev)
2033 2033
2034static struct platform_driver coda_driver = { 2034static struct platform_driver coda_driver = {
2035 .probe = coda_probe, 2035 .probe = coda_probe,
2036 .remove = __devexit_p(coda_remove), 2036 .remove = coda_remove,
2037 .driver = { 2037 .driver = {
2038 .name = CODA_NAME, 2038 .name = CODA_NAME,
2039 .owner = THIS_MODULE, 2039 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/davinci/dm355_ccdc.c b/drivers/media/platform/davinci/dm355_ccdc.c
index 030950dcfb1..f263cabade7 100644
--- a/drivers/media/platform/davinci/dm355_ccdc.c
+++ b/drivers/media/platform/davinci/dm355_ccdc.c
@@ -965,7 +965,7 @@ static struct ccdc_hw_device ccdc_hw_dev = {
965 }, 965 },
966}; 966};
967 967
968static int __devinit dm355_ccdc_probe(struct platform_device *pdev) 968static int dm355_ccdc_probe(struct platform_device *pdev)
969{ 969{
970 void (*setup_pinmux)(void); 970 void (*setup_pinmux)(void);
971 struct resource *res; 971 struct resource *res;
@@ -1069,7 +1069,7 @@ static struct platform_driver dm355_ccdc_driver = {
1069 .name = "dm355_ccdc", 1069 .name = "dm355_ccdc",
1070 .owner = THIS_MODULE, 1070 .owner = THIS_MODULE,
1071 }, 1071 },
1072 .remove = __devexit_p(dm355_ccdc_remove), 1072 .remove = dm355_ccdc_remove,
1073 .probe = dm355_ccdc_probe, 1073 .probe = dm355_ccdc_probe,
1074}; 1074};
1075 1075
diff --git a/drivers/media/platform/davinci/dm644x_ccdc.c b/drivers/media/platform/davinci/dm644x_ccdc.c
index 0215ab6ebc9..318e8051299 100644
--- a/drivers/media/platform/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/davinci/dm644x_ccdc.c
@@ -957,7 +957,7 @@ static struct ccdc_hw_device ccdc_hw_dev = {
957 }, 957 },
958}; 958};
959 959
960static int __devinit dm644x_ccdc_probe(struct platform_device *pdev) 960static int dm644x_ccdc_probe(struct platform_device *pdev)
961{ 961{
962 struct resource *res; 962 struct resource *res;
963 int status = 0; 963 int status = 0;
@@ -1078,7 +1078,7 @@ static struct platform_driver dm644x_ccdc_driver = {
1078 .owner = THIS_MODULE, 1078 .owner = THIS_MODULE,
1079 .pm = &dm644x_ccdc_pm_ops, 1079 .pm = &dm644x_ccdc_pm_ops,
1080 }, 1080 },
1081 .remove = __devexit_p(dm644x_ccdc_remove), 1081 .remove = dm644x_ccdc_remove,
1082 .probe = dm644x_ccdc_probe, 1082 .probe = dm644x_ccdc_probe,
1083}; 1083};
1084 1084
diff --git a/drivers/media/platform/davinci/isif.c b/drivers/media/platform/davinci/isif.c
index 2c26c3e1837..5050f9265f4 100644
--- a/drivers/media/platform/davinci/isif.c
+++ b/drivers/media/platform/davinci/isif.c
@@ -1032,7 +1032,7 @@ static struct ccdc_hw_device isif_hw_dev = {
1032 }, 1032 },
1033}; 1033};
1034 1034
1035static int __devinit isif_probe(struct platform_device *pdev) 1035static int isif_probe(struct platform_device *pdev)
1036{ 1036{
1037 void (*setup_pinmux)(void); 1037 void (*setup_pinmux)(void);
1038 struct resource *res; 1038 struct resource *res;
@@ -1156,7 +1156,7 @@ static struct platform_driver isif_driver = {
1156 .name = "isif", 1156 .name = "isif",
1157 .owner = THIS_MODULE, 1157 .owner = THIS_MODULE,
1158 }, 1158 },
1159 .remove = __devexit_p(isif_remove), 1159 .remove = isif_remove,
1160 .probe = isif_probe, 1160 .probe = isif_probe,
1161}; 1161};
1162 1162
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index 7f5cf9b347b..841b91a3d25 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -807,7 +807,7 @@ static struct vpbe_device_ops vpbe_dev_ops = {
807 .set_mode = vpbe_set_mode, 807 .set_mode = vpbe_set_mode,
808}; 808};
809 809
810static __devinit int vpbe_probe(struct platform_device *pdev) 810static int vpbe_probe(struct platform_device *pdev)
811{ 811{
812 struct vpbe_device *vpbe_dev; 812 struct vpbe_device *vpbe_dev;
813 struct vpbe_config *cfg; 813 struct vpbe_config *cfg;
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index 2bfde7958fe..e707a6f2325 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -1662,8 +1662,8 @@ static int vpbe_device_get(struct device *dev, void *data)
1662 return 0; 1662 return 0;
1663} 1663}
1664 1664
1665static __devinit int init_vpbe_layer(int i, struct vpbe_display *disp_dev, 1665static int init_vpbe_layer(int i, struct vpbe_display *disp_dev,
1666 struct platform_device *pdev) 1666 struct platform_device *pdev)
1667{ 1667{
1668 struct vpbe_layer *vpbe_display_layer = NULL; 1668 struct vpbe_layer *vpbe_display_layer = NULL;
1669 struct video_device *vbd = NULL; 1669 struct video_device *vbd = NULL;
@@ -1718,9 +1718,10 @@ static __devinit int init_vpbe_layer(int i, struct vpbe_display *disp_dev,
1718 return 0; 1718 return 0;
1719} 1719}
1720 1720
1721static __devinit int register_device(struct vpbe_layer *vpbe_display_layer, 1721static int register_device(struct vpbe_layer *vpbe_display_layer,
1722 struct vpbe_display *disp_dev, 1722 struct vpbe_display *disp_dev,
1723 struct platform_device *pdev) { 1723 struct platform_device *pdev)
1724{
1724 int err; 1725 int err;
1725 1726
1726 v4l2_info(&disp_dev->vpbe_dev->v4l2_dev, 1727 v4l2_info(&disp_dev->vpbe_dev->v4l2_dev,
@@ -1752,7 +1753,7 @@ static __devinit int register_device(struct vpbe_layer *vpbe_display_layer,
1752 * This function creates device entries by register itself to the V4L2 driver 1753 * This function creates device entries by register itself to the V4L2 driver
1753 * and initializes fields of each layer objects 1754 * and initializes fields of each layer objects
1754 */ 1755 */
1755static __devinit int vpbe_display_probe(struct platform_device *pdev) 1756static int vpbe_display_probe(struct platform_device *pdev)
1756{ 1757{
1757 struct vpbe_layer *vpbe_display_layer; 1758 struct vpbe_layer *vpbe_display_layer;
1758 struct vpbe_display *disp_dev; 1759 struct vpbe_display *disp_dev;
@@ -1886,7 +1887,7 @@ static struct platform_driver vpbe_display_driver = {
1886 .bus = &platform_bus_type, 1887 .bus = &platform_bus_type,
1887 }, 1888 },
1888 .probe = vpbe_display_probe, 1889 .probe = vpbe_display_probe,
1889 .remove = __devexit_p(vpbe_display_remove), 1890 .remove = vpbe_display_remove,
1890}; 1891};
1891 1892
1892module_platform_driver(vpbe_display_driver); 1893module_platform_driver(vpbe_display_driver);
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 8be492cd8ed..be9d3e1b486 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -1831,7 +1831,7 @@ static struct vpfe_device *vpfe_initialize(void)
1831 * itself to the V4L2 driver and initializes fields of each 1831 * itself to the V4L2 driver and initializes fields of each
1832 * device objects 1832 * device objects
1833 */ 1833 */
1834static __devinit int vpfe_probe(struct platform_device *pdev) 1834static int vpfe_probe(struct platform_device *pdev)
1835{ 1835{
1836 struct vpfe_subdev_info *sdinfo; 1836 struct vpfe_subdev_info *sdinfo;
1837 struct vpfe_config *vpfe_cfg; 1837 struct vpfe_config *vpfe_cfg;
@@ -2038,7 +2038,7 @@ probe_free_dev_mem:
2038/* 2038/*
2039 * vpfe_remove : It un-register device from V4L2 driver 2039 * vpfe_remove : It un-register device from V4L2 driver
2040 */ 2040 */
2041static int __devexit vpfe_remove(struct platform_device *pdev) 2041static int vpfe_remove(struct platform_device *pdev)
2042{ 2042{
2043 struct vpfe_device *vpfe_dev = platform_get_drvdata(pdev); 2043 struct vpfe_device *vpfe_dev = platform_get_drvdata(pdev);
2044 2044
@@ -2075,7 +2075,7 @@ static struct platform_driver vpfe_driver = {
2075 .pm = &vpfe_dev_pm_ops, 2075 .pm = &vpfe_dev_pm_ops,
2076 }, 2076 },
2077 .probe = vpfe_probe, 2077 .probe = vpfe_probe,
2078 .remove = __devexit_p(vpfe_remove), 2078 .remove = vpfe_remove,
2079}; 2079};
2080 2080
2081module_platform_driver(vpfe_driver); 2081module_platform_driver(vpfe_driver);
diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
index 0d6cc8e4deb..28638a86f12 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -419,7 +419,7 @@ int vpif_channel_getfid(u8 channel_id)
419} 419}
420EXPORT_SYMBOL(vpif_channel_getfid); 420EXPORT_SYMBOL(vpif_channel_getfid);
421 421
422static int __devinit vpif_probe(struct platform_device *pdev) 422static int vpif_probe(struct platform_device *pdev)
423{ 423{
424 int status = 0; 424 int status = 0;
425 425
@@ -457,7 +457,7 @@ fail:
457 return status; 457 return status;
458} 458}
459 459
460static int __devexit vpif_remove(struct platform_device *pdev) 460static int vpif_remove(struct platform_device *pdev)
461{ 461{
462 if (vpif_clk) { 462 if (vpif_clk) {
463 clk_disable_unprepare(vpif_clk); 463 clk_disable_unprepare(vpif_clk);
@@ -498,7 +498,7 @@ static struct platform_driver vpif_driver = {
498 .owner = THIS_MODULE, 498 .owner = THIS_MODULE,
499 .pm = vpif_pm_ops, 499 .pm = vpif_pm_ops,
500 }, 500 },
501 .remove = __devexit_p(vpif_remove), 501 .remove = vpif_remove,
502 .probe = vpif_probe, 502 .probe = vpif_probe,
503}; 503};
504 504
diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
index 146e4b01ac1..cdbff88e0f1 100644
--- a/drivers/media/platform/davinci/vpss.c
+++ b/drivers/media/platform/davinci/vpss.c
@@ -357,7 +357,7 @@ void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size)
357} 357}
358EXPORT_SYMBOL(dm365_vpss_set_pg_frame_size); 358EXPORT_SYMBOL(dm365_vpss_set_pg_frame_size);
359 359
360static int __devinit vpss_probe(struct platform_device *pdev) 360static int vpss_probe(struct platform_device *pdev)
361{ 361{
362 struct resource *r1, *r2; 362 struct resource *r1, *r2;
363 char *platform_name; 363 char *platform_name;
@@ -445,7 +445,7 @@ fail1:
445 return status; 445 return status;
446} 446}
447 447
448static int __devexit vpss_remove(struct platform_device *pdev) 448static int vpss_remove(struct platform_device *pdev)
449{ 449{
450 struct resource *res; 450 struct resource *res;
451 451
@@ -465,7 +465,7 @@ static struct platform_driver vpss_driver = {
465 .name = "vpss", 465 .name = "vpss",
466 .owner = THIS_MODULE, 466 .owner = THIS_MODULE,
467 }, 467 },
468 .remove = __devexit_p(vpss_remove), 468 .remove = vpss_remove,
469 .probe = vpss_probe, 469 .probe = vpss_probe,
470}; 470};
471 471
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index cc7b218d047..2b1b9f30e1f 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1151,7 +1151,7 @@ err_clk:
1151 return ret; 1151 return ret;
1152} 1152}
1153 1153
1154static int __devexit gsc_remove(struct platform_device *pdev) 1154static int gsc_remove(struct platform_device *pdev)
1155{ 1155{
1156 struct gsc_dev *gsc = platform_get_drvdata(pdev); 1156 struct gsc_dev *gsc = platform_get_drvdata(pdev);
1157 1157
@@ -1237,7 +1237,7 @@ static const struct dev_pm_ops gsc_pm_ops = {
1237 1237
1238static struct platform_driver gsc_driver = { 1238static struct platform_driver gsc_driver = {
1239 .probe = gsc_probe, 1239 .probe = gsc_probe,
1240 .remove = __devexit_p(gsc_remove), 1240 .remove = gsc_remove,
1241 .id_table = gsc_driver_ids, 1241 .id_table = gsc_driver_ids,
1242 .driver = { 1242 .driver = {
1243 .name = GSC_MODULE_NAME, 1243 .name = GSC_MODULE_NAME,
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index a8ddb0cacab..9115a2c8d07 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -1478,7 +1478,7 @@ static struct video_device viu_template = {
1478 .current_norm = V4L2_STD_NTSC_M, 1478 .current_norm = V4L2_STD_NTSC_M,
1479}; 1479};
1480 1480
1481static int __devinit viu_of_probe(struct platform_device *op) 1481static int viu_of_probe(struct platform_device *op)
1482{ 1482{
1483 struct viu_dev *viu_dev; 1483 struct viu_dev *viu_dev;
1484 struct video_device *vdev; 1484 struct video_device *vdev;
@@ -1615,7 +1615,7 @@ err:
1615 return ret; 1615 return ret;
1616} 1616}
1617 1617
1618static int __devexit viu_of_remove(struct platform_device *op) 1618static int viu_of_remove(struct platform_device *op)
1619{ 1619{
1620 struct v4l2_device *v4l2_dev = dev_get_drvdata(&op->dev); 1620 struct v4l2_device *v4l2_dev = dev_get_drvdata(&op->dev);
1621 struct viu_dev *dev = container_of(v4l2_dev, struct viu_dev, v4l2_dev); 1621 struct viu_dev *dev = container_of(v4l2_dev, struct viu_dev, v4l2_dev);
@@ -1668,7 +1668,7 @@ MODULE_DEVICE_TABLE(of, mpc512x_viu_of_match);
1668 1668
1669static struct platform_driver viu_of_platform_driver = { 1669static struct platform_driver viu_of_platform_driver = {
1670 .probe = viu_of_probe, 1670 .probe = viu_of_probe,
1671 .remove = __devexit_p(viu_of_remove), 1671 .remove = viu_of_remove,
1672#ifdef CONFIG_PM 1672#ifdef CONFIG_PM
1673 .suspend = viu_suspend, 1673 .suspend = viu_suspend,
1674 .resume = viu_resume, 1674 .resume = viu_resume,
diff --git a/drivers/media/platform/omap24xxcam.c b/drivers/media/platform/omap24xxcam.c
index 70f45c38131..8b7ccea982e 100644
--- a/drivers/media/platform/omap24xxcam.c
+++ b/drivers/media/platform/omap24xxcam.c
@@ -1736,7 +1736,7 @@ static struct v4l2_int_device omap24xxcam = {
1736 * 1736 *
1737 */ 1737 */
1738 1738
1739static int __devinit omap24xxcam_probe(struct platform_device *pdev) 1739static int omap24xxcam_probe(struct platform_device *pdev)
1740{ 1740{
1741 struct omap24xxcam_device *cam; 1741 struct omap24xxcam_device *cam;
1742 struct resource *mem; 1742 struct resource *mem;
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 2e8c0cb79c3..e4aaee91201 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1990,7 +1990,7 @@ error_csiphy:
1990 * 1990 *
1991 * Always returns 0. 1991 * Always returns 0.
1992 */ 1992 */
1993static int __devexit isp_remove(struct platform_device *pdev) 1993static int isp_remove(struct platform_device *pdev)
1994{ 1994{
1995 struct isp_device *isp = platform_get_drvdata(pdev); 1995 struct isp_device *isp = platform_get_drvdata(pdev);
1996 int i; 1996 int i;
@@ -2071,7 +2071,7 @@ static int isp_map_mem_resource(struct platform_device *pdev,
2071 * -EINVAL if couldn't install ISR, 2071 * -EINVAL if couldn't install ISR,
2072 * or clk_get return error value. 2072 * or clk_get return error value.
2073 */ 2073 */
2074static int __devinit isp_probe(struct platform_device *pdev) 2074static int isp_probe(struct platform_device *pdev)
2075{ 2075{
2076 struct isp_platform_data *pdata = pdev->dev.platform_data; 2076 struct isp_platform_data *pdata = pdev->dev.platform_data;
2077 struct isp_device *isp; 2077 struct isp_device *isp;
@@ -2250,7 +2250,7 @@ MODULE_DEVICE_TABLE(platform, omap3isp_id_table);
2250 2250
2251static struct platform_driver omap3isp_driver = { 2251static struct platform_driver omap3isp_driver = {
2252 .probe = isp_probe, 2252 .probe = isp_probe,
2253 .remove = __devexit_p(isp_remove), 2253 .remove = isp_remove,
2254 .id_table = omap3isp_id_table, 2254 .id_table = omap3isp_id_table,
2255 .driver = { 2255 .driver = {
2256 .owner = THIS_MODULE, 2256 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c
index 0dd65376c06..e2716c35f8f 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -531,7 +531,7 @@ err_sd:
531 return ret; 531 return ret;
532} 532}
533 533
534static int __devexit s3c_camif_remove(struct platform_device *pdev) 534static int s3c_camif_remove(struct platform_device *pdev)
535{ 535{
536 struct camif_dev *camif = platform_get_drvdata(pdev); 536 struct camif_dev *camif = platform_get_drvdata(pdev);
537 struct s3c_camif_plat_data *pdata = &camif->pdata; 537 struct s3c_camif_plat_data *pdata = &camif->pdata;
@@ -645,7 +645,7 @@ static const struct dev_pm_ops s3c_camif_pm_ops = {
645 645
646static struct platform_driver s3c_camif_driver = { 646static struct platform_driver s3c_camif_driver = {
647 .probe = s3c_camif_probe, 647 .probe = s3c_camif_probe,
648 .remove = __devexit_p(s3c_camif_remove), 648 .remove = s3c_camif_remove,
649 .id_table = s3c_camif_driver_ids, 649 .id_table = s3c_camif_driver_ids,
650 .driver = { 650 .driver = {
651 .name = S3C_CAMIF_DRIVER_NAME, 651 .name = S3C_CAMIF_DRIVER_NAME,
diff --git a/drivers/media/platform/s5p-fimc/fimc-core.c b/drivers/media/platform/s5p-fimc/fimc-core.c
index 8d0d2b94a13..545b46ae12a 100644
--- a/drivers/media/platform/s5p-fimc/fimc-core.c
+++ b/drivers/media/platform/s5p-fimc/fimc-core.c
@@ -1035,7 +1035,7 @@ static int fimc_suspend(struct device *dev)
1035} 1035}
1036#endif /* CONFIG_PM_SLEEP */ 1036#endif /* CONFIG_PM_SLEEP */
1037 1037
1038static int __devexit fimc_remove(struct platform_device *pdev) 1038static int fimc_remove(struct platform_device *pdev)
1039{ 1039{
1040 struct fimc_dev *fimc = platform_get_drvdata(pdev); 1040 struct fimc_dev *fimc = platform_get_drvdata(pdev);
1041 1041
@@ -1234,7 +1234,7 @@ static const struct dev_pm_ops fimc_pm_ops = {
1234 1234
1235static struct platform_driver fimc_driver = { 1235static struct platform_driver fimc_driver = {
1236 .probe = fimc_probe, 1236 .probe = fimc_probe,
1237 .remove = __devexit_p(fimc_remove), 1237 .remove = fimc_remove,
1238 .id_table = fimc_driver_ids, 1238 .id_table = fimc_driver_ids,
1239 .driver = { 1239 .driver = {
1240 .name = FIMC_MODULE_NAME, 1240 .name = FIMC_MODULE_NAME,
diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c
index 1b309a72f09..ed67220d0a6 100644
--- a/drivers/media/platform/s5p-fimc/fimc-lite.c
+++ b/drivers/media/platform/s5p-fimc/fimc-lite.c
@@ -1406,7 +1406,7 @@ static int fimc_lite_clk_get(struct fimc_lite *fimc)
1406 return ret; 1406 return ret;
1407} 1407}
1408 1408
1409static int __devinit fimc_lite_probe(struct platform_device *pdev) 1409static int fimc_lite_probe(struct platform_device *pdev)
1410{ 1410{
1411 struct flite_drvdata *drv_data = fimc_lite_get_drvdata(pdev); 1411 struct flite_drvdata *drv_data = fimc_lite_get_drvdata(pdev);
1412 struct fimc_lite *fimc; 1412 struct fimc_lite *fimc;
@@ -1547,7 +1547,7 @@ static int fimc_lite_suspend(struct device *dev)
1547} 1547}
1548#endif /* CONFIG_PM_SLEEP */ 1548#endif /* CONFIG_PM_SLEEP */
1549 1549
1550static int __devexit fimc_lite_remove(struct platform_device *pdev) 1550static int fimc_lite_remove(struct platform_device *pdev)
1551{ 1551{
1552 struct fimc_lite *fimc = platform_get_drvdata(pdev); 1552 struct fimc_lite *fimc = platform_get_drvdata(pdev);
1553 struct device *dev = &pdev->dev; 1553 struct device *dev = &pdev->dev;
@@ -1595,7 +1595,7 @@ static const struct dev_pm_ops fimc_lite_pm_ops = {
1595 1595
1596static struct platform_driver fimc_lite_driver = { 1596static struct platform_driver fimc_lite_driver = {
1597 .probe = fimc_lite_probe, 1597 .probe = fimc_lite_probe,
1598 .remove = __devexit_p(fimc_lite_remove), 1598 .remove = fimc_lite_remove,
1599 .id_table = fimc_lite_driver_ids, 1599 .id_table = fimc_lite_driver_ids,
1600 .driver = { 1600 .driver = {
1601 .name = FIMC_LITE_DRV_NAME, 1601 .name = FIMC_LITE_DRV_NAME,
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
index 1bd5678cfeb..4ab99f3a7b0 100644
--- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
@@ -1000,7 +1000,7 @@ err_md:
1000 return ret; 1000 return ret;
1001} 1001}
1002 1002
1003static int __devexit fimc_md_remove(struct platform_device *pdev) 1003static int fimc_md_remove(struct platform_device *pdev)
1004{ 1004{
1005 struct fimc_md *fmd = platform_get_drvdata(pdev); 1005 struct fimc_md *fmd = platform_get_drvdata(pdev);
1006 1006
@@ -1015,7 +1015,7 @@ static int __devexit fimc_md_remove(struct platform_device *pdev)
1015 1015
1016static struct platform_driver fimc_md_driver = { 1016static struct platform_driver fimc_md_driver = {
1017 .probe = fimc_md_probe, 1017 .probe = fimc_md_probe,
1018 .remove = __devexit_p(fimc_md_remove), 1018 .remove = fimc_md_remove,
1019 .driver = { 1019 .driver = {
1020 .name = "s5p-fimc-md", 1020 .name = "s5p-fimc-md",
1021 .owner = THIS_MODULE, 1021 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c
index 4c961b1b68e..ec3fa7d7530 100644
--- a/drivers/media/platform/s5p-fimc/mipi-csis.c
+++ b/drivers/media/platform/s5p-fimc/mipi-csis.c
@@ -654,7 +654,7 @@ static irqreturn_t s5pcsis_irq_handler(int irq, void *dev_id)
654 return IRQ_HANDLED; 654 return IRQ_HANDLED;
655} 655}
656 656
657static int __devinit s5pcsis_probe(struct platform_device *pdev) 657static int s5pcsis_probe(struct platform_device *pdev)
658{ 658{
659 struct s5p_platform_mipi_csis *pdata; 659 struct s5p_platform_mipi_csis *pdata;
660 struct resource *mem_res; 660 struct resource *mem_res;
@@ -851,7 +851,7 @@ static int s5pcsis_runtime_resume(struct device *dev)
851} 851}
852#endif 852#endif
853 853
854static int __devexit s5pcsis_remove(struct platform_device *pdev) 854static int s5pcsis_remove(struct platform_device *pdev)
855{ 855{
856 struct v4l2_subdev *sd = platform_get_drvdata(pdev); 856 struct v4l2_subdev *sd = platform_get_drvdata(pdev);
857 struct csis_state *state = sd_to_csis_state(sd); 857 struct csis_state *state = sd_to_csis_state(sd);
@@ -876,7 +876,7 @@ static const struct dev_pm_ops s5pcsis_pm_ops = {
876 876
877static struct platform_driver s5pcsis_driver = { 877static struct platform_driver s5pcsis_driver = {
878 .probe = s5pcsis_probe, 878 .probe = s5pcsis_probe,
879 .remove = __devexit_p(s5pcsis_remove), 879 .remove = s5pcsis_remove,
880 .driver = { 880 .driver = {
881 .name = CSIS_DRIVER_NAME, 881 .name = CSIS_DRIVER_NAME,
882 .owner = THIS_MODULE, 882 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3afe879d54d..379f5743371 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1203,7 +1203,7 @@ err_res:
1203} 1203}
1204 1204
1205/* Remove the driver */ 1205/* Remove the driver */
1206static int __devexit s5p_mfc_remove(struct platform_device *pdev) 1206static int s5p_mfc_remove(struct platform_device *pdev)
1207{ 1207{
1208 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); 1208 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev);
1209 1209
@@ -1368,7 +1368,7 @@ MODULE_DEVICE_TABLE(platform, mfc_driver_ids);
1368 1368
1369static struct platform_driver s5p_mfc_driver = { 1369static struct platform_driver s5p_mfc_driver = {
1370 .probe = s5p_mfc_probe, 1370 .probe = s5p_mfc_probe,
1371 .remove = __devexit_p(s5p_mfc_remove), 1371 .remove = s5p_mfc_remove,
1372 .id_table = mfc_driver_ids, 1372 .id_table = mfc_driver_ids,
1373 .driver = { 1373 .driver = {
1374 .name = S5P_MFC_NAME, 1374 .name = S5P_MFC_NAME,
diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c
index 8a9cf43018f..7c1116c73bf 100644
--- a/drivers/media/platform/s5p-tv/hdmi_drv.c
+++ b/drivers/media/platform/s5p-tv/hdmi_drv.c
@@ -830,7 +830,7 @@ fail:
830 return -ENODEV; 830 return -ENODEV;
831} 831}
832 832
833static int __devinit hdmi_probe(struct platform_device *pdev) 833static int hdmi_probe(struct platform_device *pdev)
834{ 834{
835 struct device *dev = &pdev->dev; 835 struct device *dev = &pdev->dev;
836 struct resource *res; 836 struct resource *res;
@@ -979,7 +979,7 @@ fail:
979 return ret; 979 return ret;
980} 980}
981 981
982static int __devexit hdmi_remove(struct platform_device *pdev) 982static int hdmi_remove(struct platform_device *pdev)
983{ 983{
984 struct device *dev = &pdev->dev; 984 struct device *dev = &pdev->dev;
985 struct v4l2_subdev *sd = dev_get_drvdata(dev); 985 struct v4l2_subdev *sd = dev_get_drvdata(dev);
@@ -997,7 +997,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev)
997 997
998static struct platform_driver hdmi_driver __refdata = { 998static struct platform_driver hdmi_driver __refdata = {
999 .probe = hdmi_probe, 999 .probe = hdmi_probe,
1000 .remove = __devexit_p(hdmi_remove), 1000 .remove = hdmi_remove,
1001 .id_table = hdmi_driver_types, 1001 .id_table = hdmi_driver_types,
1002 .driver = { 1002 .driver = {
1003 .name = "s5p-hdmi", 1003 .name = "s5p-hdmi",
diff --git a/drivers/media/platform/s5p-tv/hdmiphy_drv.c b/drivers/media/platform/s5p-tv/hdmiphy_drv.c
index f67b3863180..06b5d2dbb2d 100644
--- a/drivers/media/platform/s5p-tv/hdmiphy_drv.c
+++ b/drivers/media/platform/s5p-tv/hdmiphy_drv.c
@@ -279,8 +279,8 @@ static const struct v4l2_subdev_ops hdmiphy_ops = {
279 .video = &hdmiphy_video_ops, 279 .video = &hdmiphy_video_ops,
280}; 280};
281 281
282static int __devinit hdmiphy_probe(struct i2c_client *client, 282static int hdmiphy_probe(struct i2c_client *client,
283 const struct i2c_device_id *id) 283 const struct i2c_device_id *id)
284{ 284{
285 struct hdmiphy_ctx *ctx; 285 struct hdmiphy_ctx *ctx;
286 286
@@ -295,7 +295,7 @@ static int __devinit hdmiphy_probe(struct i2c_client *client,
295 return 0; 295 return 0;
296} 296}
297 297
298static int __devexit hdmiphy_remove(struct i2c_client *client) 298static int hdmiphy_remove(struct i2c_client *client)
299{ 299{
300 struct v4l2_subdev *sd = i2c_get_clientdata(client); 300 struct v4l2_subdev *sd = i2c_get_clientdata(client);
301 struct hdmiphy_ctx *ctx = sd_to_ctx(sd); 301 struct hdmiphy_ctx *ctx = sd_to_ctx(sd);
@@ -322,7 +322,7 @@ static struct i2c_driver hdmiphy_driver = {
322 .owner = THIS_MODULE, 322 .owner = THIS_MODULE,
323 }, 323 },
324 .probe = hdmiphy_probe, 324 .probe = hdmiphy_probe,
325 .remove = __devexit_p(hdmiphy_remove), 325 .remove = hdmiphy_remove,
326 .id_table = hdmiphy_id, 326 .id_table = hdmiphy_id,
327}; 327};
328 328
diff --git a/drivers/media/platform/s5p-tv/mixer.h b/drivers/media/platform/s5p-tv/mixer.h
index ddb422e2355..b671e20e931 100644
--- a/drivers/media/platform/s5p-tv/mixer.h
+++ b/drivers/media/platform/s5p-tv/mixer.h
@@ -290,7 +290,7 @@ static inline struct v4l2_subdev *to_outsd(struct mxr_device *mdev)
290struct mxr_platform_data; 290struct mxr_platform_data;
291 291
292/** acquiring common video resources */ 292/** acquiring common video resources */
293int __devinit mxr_acquire_video(struct mxr_device *mdev, 293int mxr_acquire_video(struct mxr_device *mdev,
294 struct mxr_output_conf *output_cont, int output_count); 294 struct mxr_output_conf *output_cont, int output_count);
295 295
296/** releasing common video resources */ 296/** releasing common video resources */
diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c
index ca0f2971744..02faea03aa7 100644
--- a/drivers/media/platform/s5p-tv/mixer_drv.c
+++ b/drivers/media/platform/s5p-tv/mixer_drv.c
@@ -151,8 +151,8 @@ void mxr_power_put(struct mxr_device *mdev)
151 151
152/* --------- RESOURCE MANAGEMENT -------------*/ 152/* --------- RESOURCE MANAGEMENT -------------*/
153 153
154static int __devinit mxr_acquire_plat_resources(struct mxr_device *mdev, 154static int mxr_acquire_plat_resources(struct mxr_device *mdev,
155 struct platform_device *pdev) 155 struct platform_device *pdev)
156{ 156{
157 struct resource *res; 157 struct resource *res;
158 int ret; 158 int ret;
@@ -271,8 +271,8 @@ fail:
271 return -ENODEV; 271 return -ENODEV;
272} 272}
273 273
274static int __devinit mxr_acquire_resources(struct mxr_device *mdev, 274static int mxr_acquire_resources(struct mxr_device *mdev,
275 struct platform_device *pdev) 275 struct platform_device *pdev)
276{ 276{
277 int ret; 277 int ret;
278 ret = mxr_acquire_plat_resources(mdev, pdev); 278 ret = mxr_acquire_plat_resources(mdev, pdev);
@@ -310,8 +310,8 @@ static void mxr_release_layers(struct mxr_device *mdev)
310 mxr_layer_release(mdev->layer[i]); 310 mxr_layer_release(mdev->layer[i]);
311} 311}
312 312
313static int __devinit mxr_acquire_layers(struct mxr_device *mdev, 313static int mxr_acquire_layers(struct mxr_device *mdev,
314 struct mxr_platform_data *pdata) 314 struct mxr_platform_data *pdata)
315{ 315{
316 mdev->layer[0] = mxr_graph_layer_create(mdev, 0); 316 mdev->layer[0] = mxr_graph_layer_create(mdev, 0);
317 mdev->layer[1] = mxr_graph_layer_create(mdev, 1); 317 mdev->layer[1] = mxr_graph_layer_create(mdev, 1);
@@ -372,7 +372,7 @@ static const struct dev_pm_ops mxr_pm_ops = {
372 372
373/* --------- DRIVER INITIALIZATION ---------- */ 373/* --------- DRIVER INITIALIZATION ---------- */
374 374
375static int __devinit mxr_probe(struct platform_device *pdev) 375static int mxr_probe(struct platform_device *pdev)
376{ 376{
377 struct device *dev = &pdev->dev; 377 struct device *dev = &pdev->dev;
378 struct mxr_platform_data *pdata = dev->platform_data; 378 struct mxr_platform_data *pdata = dev->platform_data;
@@ -431,7 +431,7 @@ fail:
431 return ret; 431 return ret;
432} 432}
433 433
434static int __devexit mxr_remove(struct platform_device *pdev) 434static int mxr_remove(struct platform_device *pdev)
435{ 435{
436 struct device *dev = &pdev->dev; 436 struct device *dev = &pdev->dev;
437 struct mxr_device *mdev = to_mdev(dev); 437 struct mxr_device *mdev = to_mdev(dev);
@@ -450,7 +450,7 @@ static int __devexit mxr_remove(struct platform_device *pdev)
450 450
451static struct platform_driver mxr_driver __refdata = { 451static struct platform_driver mxr_driver __refdata = {
452 .probe = mxr_probe, 452 .probe = mxr_probe,
453 .remove = __devexit_p(mxr_remove), 453 .remove = mxr_remove,
454 .driver = { 454 .driver = {
455 .name = MXR_DRIVER_NAME, 455 .name = MXR_DRIVER_NAME,
456 .owner = THIS_MODULE, 456 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
index 7379e77bf4e..1f3b7436511 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -62,8 +62,8 @@ done:
62 return sd; 62 return sd;
63} 63}
64 64
65int __devinit mxr_acquire_video(struct mxr_device *mdev, 65int mxr_acquire_video(struct mxr_device *mdev,
66 struct mxr_output_conf *output_conf, int output_count) 66 struct mxr_output_conf *output_conf, int output_count)
67{ 67{
68 struct device *dev = mdev->dev; 68 struct device *dev = mdev->dev;
69 struct v4l2_device *v4l2_dev = &mdev->v4l2_dev; 69 struct v4l2_device *v4l2_dev = &mdev->v4l2_dev;
diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c
index ad68bbed014..91a6939a270 100644
--- a/drivers/media/platform/s5p-tv/sdo_drv.c
+++ b/drivers/media/platform/s5p-tv/sdo_drv.c
@@ -292,7 +292,7 @@ static const struct dev_pm_ops sdo_pm_ops = {
292 .runtime_resume = sdo_runtime_resume, 292 .runtime_resume = sdo_runtime_resume,
293}; 293};
294 294
295static int __devinit sdo_probe(struct platform_device *pdev) 295static int sdo_probe(struct platform_device *pdev)
296{ 296{
297 struct device *dev = &pdev->dev; 297 struct device *dev = &pdev->dev;
298 struct sdo_device *sdev; 298 struct sdo_device *sdev;
@@ -419,7 +419,7 @@ fail:
419 return ret; 419 return ret;
420} 420}
421 421
422static int __devexit sdo_remove(struct platform_device *pdev) 422static int sdo_remove(struct platform_device *pdev)
423{ 423{
424 struct v4l2_subdev *sd = dev_get_drvdata(&pdev->dev); 424 struct v4l2_subdev *sd = dev_get_drvdata(&pdev->dev);
425 struct sdo_device *sdev = sd_to_sdev(sd); 425 struct sdo_device *sdev = sd_to_sdev(sd);
@@ -437,7 +437,7 @@ static int __devexit sdo_remove(struct platform_device *pdev)
437 437
438static struct platform_driver sdo_driver __refdata = { 438static struct platform_driver sdo_driver __refdata = {
439 .probe = sdo_probe, 439 .probe = sdo_probe,
440 .remove = __devexit_p(sdo_remove), 440 .remove = sdo_remove,
441 .driver = { 441 .driver = {
442 .name = "s5p-sdo", 442 .name = "s5p-sdo",
443 .owner = THIS_MODULE, 443 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/s5p-tv/sii9234_drv.c b/drivers/media/platform/s5p-tv/sii9234_drv.c
index 716d4846f8b..49191aac963 100644
--- a/drivers/media/platform/s5p-tv/sii9234_drv.c
+++ b/drivers/media/platform/s5p-tv/sii9234_drv.c
@@ -315,8 +315,8 @@ static const struct v4l2_subdev_ops sii9234_ops = {
315 .video = &sii9234_video_ops, 315 .video = &sii9234_video_ops,
316}; 316};
317 317
318static int __devinit sii9234_probe(struct i2c_client *client, 318static int sii9234_probe(struct i2c_client *client,
319 const struct i2c_device_id *id) 319 const struct i2c_device_id *id)
320{ 320{
321 struct device *dev = &client->dev; 321 struct device *dev = &client->dev;
322 struct sii9234_platform_data *pdata = dev->platform_data; 322 struct sii9234_platform_data *pdata = dev->platform_data;
@@ -378,7 +378,7 @@ fail:
378 return ret; 378 return ret;
379} 379}
380 380
381static int __devexit sii9234_remove(struct i2c_client *client) 381static int sii9234_remove(struct i2c_client *client)
382{ 382{
383 struct device *dev = &client->dev; 383 struct device *dev = &client->dev;
384 struct v4l2_subdev *sd = i2c_get_clientdata(client); 384 struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -406,7 +406,7 @@ static struct i2c_driver sii9234_driver = {
406 .pm = &sii9234_pm_ops, 406 .pm = &sii9234_pm_ops,
407 }, 407 },
408 .probe = sii9234_probe, 408 .probe = sii9234_probe,
409 .remove = __devexit_p(sii9234_remove), 409 .remove = sii9234_remove,
410 .id_table = sii9234_id, 410 .id_table = sii9234_id,
411}; 411};
412 412
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index a1c87f0ceaa..f3c4571ac01 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -1326,7 +1326,7 @@ static const struct video_device sh_vou_video_template = {
1326 .vfl_dir = VFL_DIR_TX, 1326 .vfl_dir = VFL_DIR_TX,
1327}; 1327};
1328 1328
1329static int __devinit sh_vou_probe(struct platform_device *pdev) 1329static int sh_vou_probe(struct platform_device *pdev)
1330{ 1330{
1331 struct sh_vou_pdata *vou_pdata = pdev->dev.platform_data; 1331 struct sh_vou_pdata *vou_pdata = pdev->dev.platform_data;
1332 struct v4l2_rect *rect; 1332 struct v4l2_rect *rect;
@@ -1461,7 +1461,7 @@ ereqmemreg:
1461 return ret; 1461 return ret;
1462} 1462}
1463 1463
1464static int __devexit sh_vou_remove(struct platform_device *pdev) 1464static int sh_vou_remove(struct platform_device *pdev)
1465{ 1465{
1466 int irq = platform_get_irq(pdev, 0); 1466 int irq = platform_get_irq(pdev, 0);
1467 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); 1467 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
@@ -1487,7 +1487,7 @@ static int __devexit sh_vou_remove(struct platform_device *pdev)
1487} 1487}
1488 1488
1489static struct platform_driver __refdata sh_vou = { 1489static struct platform_driver __refdata sh_vou = {
1490 .remove = __devexit_p(sh_vou_remove), 1490 .remove = sh_vou_remove,
1491 .driver = { 1491 .driver = {
1492 .name = "sh-vou", 1492 .name = "sh-vou",
1493 .owner = THIS_MODULE, 1493 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index 6274a91c25c..d96c8c7e01d 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -897,7 +897,7 @@ static struct soc_camera_host_ops isi_soc_camera_host_ops = {
897}; 897};
898 898
899/* -----------------------------------------------------------------------*/ 899/* -----------------------------------------------------------------------*/
900static int __devexit atmel_isi_remove(struct platform_device *pdev) 900static int atmel_isi_remove(struct platform_device *pdev)
901{ 901{
902 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); 902 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
903 struct atmel_isi *isi = container_of(soc_host, 903 struct atmel_isi *isi = container_of(soc_host,
@@ -921,7 +921,7 @@ static int __devexit atmel_isi_remove(struct platform_device *pdev)
921 return 0; 921 return 0;
922} 922}
923 923
924static int __devinit atmel_isi_probe(struct platform_device *pdev) 924static int atmel_isi_probe(struct platform_device *pdev)
925{ 925{
926 unsigned int irq; 926 unsigned int irq;
927 struct atmel_isi *isi; 927 struct atmel_isi *isi;
@@ -1074,7 +1074,7 @@ err_clk_prepare_pclk:
1074 1074
1075static struct platform_driver atmel_isi_driver = { 1075static struct platform_driver atmel_isi_driver = {
1076 .probe = atmel_isi_probe, 1076 .probe = atmel_isi_probe,
1077 .remove = __devexit_p(atmel_isi_remove), 1077 .remove = atmel_isi_remove,
1078 .driver = { 1078 .driver = {
1079 .name = "atmel_isi", 1079 .name = "atmel_isi",
1080 .owner = THIS_MODULE, 1080 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 791cd1d54a7..8bda2c908ab 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -1692,7 +1692,7 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
1692 return IRQ_HANDLED; 1692 return IRQ_HANDLED;
1693} 1693}
1694 1694
1695static int __devinit mx27_camera_emma_init(struct platform_device *pdev) 1695static int mx27_camera_emma_init(struct platform_device *pdev)
1696{ 1696{
1697 struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev); 1697 struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev);
1698 struct resource *res_emma; 1698 struct resource *res_emma;
@@ -1750,7 +1750,7 @@ out:
1750 return err; 1750 return err;
1751} 1751}
1752 1752
1753static int __devinit mx2_camera_probe(struct platform_device *pdev) 1753static int mx2_camera_probe(struct platform_device *pdev)
1754{ 1754{
1755 struct mx2_camera_dev *pcdev; 1755 struct mx2_camera_dev *pcdev;
1756 struct resource *res_csi; 1756 struct resource *res_csi;
@@ -1887,7 +1887,7 @@ exit:
1887 return err; 1887 return err;
1888} 1888}
1889 1889
1890static int __devexit mx2_camera_remove(struct platform_device *pdev) 1890static int mx2_camera_remove(struct platform_device *pdev)
1891{ 1891{
1892 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); 1892 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
1893 struct mx2_camera_dev *pcdev = container_of(soc_host, 1893 struct mx2_camera_dev *pcdev = container_of(soc_host,
@@ -1912,7 +1912,7 @@ static struct platform_driver mx2_camera_driver = {
1912 .name = MX2_CAM_DRV_NAME, 1912 .name = MX2_CAM_DRV_NAME,
1913 }, 1913 },
1914 .id_table = mx2_camera_devtype, 1914 .id_table = mx2_camera_devtype,
1915 .remove = __devexit_p(mx2_camera_remove), 1915 .remove = mx2_camera_remove,
1916}; 1916};
1917 1917
1918 1918
diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c
index 06d16de7637..45aef1053a4 100644
--- a/drivers/media/platform/soc_camera/mx3_camera.c
+++ b/drivers/media/platform/soc_camera/mx3_camera.c
@@ -1143,7 +1143,7 @@ static struct soc_camera_host_ops mx3_soc_camera_host_ops = {
1143 .set_bus_param = mx3_camera_set_bus_param, 1143 .set_bus_param = mx3_camera_set_bus_param,
1144}; 1144};
1145 1145
1146static int __devinit mx3_camera_probe(struct platform_device *pdev) 1146static int mx3_camera_probe(struct platform_device *pdev)
1147{ 1147{
1148 struct mx3_camera_dev *mx3_cam; 1148 struct mx3_camera_dev *mx3_cam;
1149 struct resource *res; 1149 struct resource *res;
@@ -1246,7 +1246,7 @@ egetres:
1246 return err; 1246 return err;
1247} 1247}
1248 1248
1249static int __devexit mx3_camera_remove(struct platform_device *pdev) 1249static int mx3_camera_remove(struct platform_device *pdev)
1250{ 1250{
1251 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); 1251 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
1252 struct mx3_camera_dev *mx3_cam = container_of(soc_host, 1252 struct mx3_camera_dev *mx3_cam = container_of(soc_host,
@@ -1279,7 +1279,7 @@ static struct platform_driver mx3_camera_driver = {
1279 .name = MX3_CAM_DRV_NAME, 1279 .name = MX3_CAM_DRV_NAME,
1280 }, 1280 },
1281 .probe = mx3_camera_probe, 1281 .probe = mx3_camera_probe,
1282 .remove = __devexit_p(mx3_camera_remove), 1282 .remove = mx3_camera_remove,
1283}; 1283};
1284 1284
1285module_platform_driver(mx3_camera_driver); 1285module_platform_driver(mx3_camera_driver);
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
index 3434ffe79c6..523330d00de 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -1651,7 +1651,7 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
1651 .set_bus_param = pxa_camera_set_bus_param, 1651 .set_bus_param = pxa_camera_set_bus_param,
1652}; 1652};
1653 1653
1654static int __devinit pxa_camera_probe(struct platform_device *pdev) 1654static int pxa_camera_probe(struct platform_device *pdev)
1655{ 1655{
1656 struct pxa_camera_dev *pcdev; 1656 struct pxa_camera_dev *pcdev;
1657 struct resource *res; 1657 struct resource *res;
@@ -1801,7 +1801,7 @@ exit:
1801 return err; 1801 return err;
1802} 1802}
1803 1803
1804static int __devexit pxa_camera_remove(struct platform_device *pdev) 1804static int pxa_camera_remove(struct platform_device *pdev)
1805{ 1805{
1806 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); 1806 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
1807 struct pxa_camera_dev *pcdev = container_of(soc_host, 1807 struct pxa_camera_dev *pcdev = container_of(soc_host,
@@ -1840,7 +1840,7 @@ static struct platform_driver pxa_camera_driver = {
1840 .pm = &pxa_camera_pm, 1840 .pm = &pxa_camera_pm,
1841 }, 1841 },
1842 .probe = pxa_camera_probe, 1842 .probe = pxa_camera_probe,
1843 .remove = __devexit_p(pxa_camera_remove), 1843 .remove = pxa_camera_remove,
1844}; 1844};
1845 1845
1846module_platform_driver(pxa_camera_driver); 1846module_platform_driver(pxa_camera_driver);
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 2d8861c0e8f..ebbc126e71a 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -2071,7 +2071,7 @@ static int bus_notify(struct notifier_block *nb,
2071 return NOTIFY_DONE; 2071 return NOTIFY_DONE;
2072} 2072}
2073 2073
2074static int __devinit sh_mobile_ceu_probe(struct platform_device *pdev) 2074static int sh_mobile_ceu_probe(struct platform_device *pdev)
2075{ 2075{
2076 struct sh_mobile_ceu_dev *pcdev; 2076 struct sh_mobile_ceu_dev *pcdev;
2077 struct resource *res; 2077 struct resource *res;
@@ -2258,7 +2258,7 @@ exit:
2258 return err; 2258 return err;
2259} 2259}
2260 2260
2261static int __devexit sh_mobile_ceu_remove(struct platform_device *pdev) 2261static int sh_mobile_ceu_remove(struct platform_device *pdev)
2262{ 2262{
2263 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); 2263 struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
2264 struct sh_mobile_ceu_dev *pcdev = container_of(soc_host, 2264 struct sh_mobile_ceu_dev *pcdev = container_of(soc_host,
@@ -2307,7 +2307,7 @@ static struct platform_driver sh_mobile_ceu_driver = {
2307 .pm = &sh_mobile_ceu_dev_pm_ops, 2307 .pm = &sh_mobile_ceu_dev_pm_ops,
2308 }, 2308 },
2309 .probe = sh_mobile_ceu_probe, 2309 .probe = sh_mobile_ceu_probe,
2310 .remove = __devexit_p(sh_mobile_ceu_remove), 2310 .remove = sh_mobile_ceu_remove,
2311}; 2311};
2312 2312
2313static int __init sh_mobile_ceu_init(void) 2313static int __init sh_mobile_ceu_init(void)
diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
index 05286500b4d..a17aba9a010 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
@@ -294,7 +294,7 @@ static struct v4l2_subdev_ops sh_csi2_subdev_ops = {
294 .video = &sh_csi2_subdev_video_ops, 294 .video = &sh_csi2_subdev_video_ops,
295}; 295};
296 296
297static __devinit int sh_csi2_probe(struct platform_device *pdev) 297static int sh_csi2_probe(struct platform_device *pdev)
298{ 298{
299 struct resource *res; 299 struct resource *res;
300 unsigned int irq; 300 unsigned int irq;
@@ -366,7 +366,7 @@ ereqreg:
366 return ret; 366 return ret;
367} 367}
368 368
369static __devexit int sh_csi2_remove(struct platform_device *pdev) 369static int sh_csi2_remove(struct platform_device *pdev)
370{ 370{
371 struct sh_csi2 *priv = platform_get_drvdata(pdev); 371 struct sh_csi2 *priv = platform_get_drvdata(pdev);
372 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 372 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -382,7 +382,7 @@ static __devexit int sh_csi2_remove(struct platform_device *pdev)
382} 382}
383 383
384static struct platform_driver __refdata sh_csi2_pdrv = { 384static struct platform_driver __refdata sh_csi2_pdrv = {
385 .remove = __devexit_p(sh_csi2_remove), 385 .remove = sh_csi2_remove,
386 .probe = sh_csi2_probe, 386 .probe = sh_csi2_probe,
387 .driver = { 387 .driver = {
388 .name = "sh-mobile-csi2", 388 .name = "sh-mobile-csi2",
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 4e3735679f1..2ec90eae6ba 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1530,7 +1530,7 @@ static int soc_camera_video_start(struct soc_camera_device *icd)
1530 return 0; 1530 return 0;
1531} 1531}
1532 1532
1533static int __devinit soc_camera_pdrv_probe(struct platform_device *pdev) 1533static int soc_camera_pdrv_probe(struct platform_device *pdev)
1534{ 1534{
1535 struct soc_camera_link *icl = pdev->dev.platform_data; 1535 struct soc_camera_link *icl = pdev->dev.platform_data;
1536 struct soc_camera_device *icd; 1536 struct soc_camera_device *icd;
@@ -1558,7 +1558,7 @@ static int __devinit soc_camera_pdrv_probe(struct platform_device *pdev)
1558 * hot-pluggable. Now we know, that all our users - hosts and devices have 1558 * hot-pluggable. Now we know, that all our users - hosts and devices have
1559 * been unloaded already 1559 * been unloaded already
1560 */ 1560 */
1561static int __devexit soc_camera_pdrv_remove(struct platform_device *pdev) 1561static int soc_camera_pdrv_remove(struct platform_device *pdev)
1562{ 1562{
1563 struct soc_camera_device *icd = platform_get_drvdata(pdev); 1563 struct soc_camera_device *icd = platform_get_drvdata(pdev);
1564 1564
@@ -1572,7 +1572,7 @@ static int __devexit soc_camera_pdrv_remove(struct platform_device *pdev)
1572 1572
1573static struct platform_driver __refdata soc_camera_pdrv = { 1573static struct platform_driver __refdata soc_camera_pdrv = {
1574 .probe = soc_camera_pdrv_probe, 1574 .probe = soc_camera_pdrv_probe,
1575 .remove = __devexit_p(soc_camera_pdrv_remove), 1575 .remove = soc_camera_pdrv_remove,
1576 .driver = { 1576 .driver = {
1577 .name = "soc-camera-pdrv", 1577 .name = "soc-camera-pdrv",
1578 .owner = THIS_MODULE, 1578 .owner = THIS_MODULE,
diff --git a/drivers/media/platform/timblogiw.c b/drivers/media/platform/timblogiw.c
index 02194c056b0..d854d08a6c7 100644
--- a/drivers/media/platform/timblogiw.c
+++ b/drivers/media/platform/timblogiw.c
@@ -745,7 +745,7 @@ static int timblogiw_mmap(struct file *file, struct vm_area_struct *vma)
745 745
746/* Platform device functions */ 746/* Platform device functions */
747 747
748static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = { 748static struct v4l2_ioctl_ops timblogiw_ioctl_ops = {
749 .vidioc_querycap = timblogiw_querycap, 749 .vidioc_querycap = timblogiw_querycap,
750 .vidioc_enum_fmt_vid_cap = timblogiw_enum_fmt, 750 .vidioc_enum_fmt_vid_cap = timblogiw_enum_fmt,
751 .vidioc_g_fmt_vid_cap = timblogiw_g_fmt, 751 .vidioc_g_fmt_vid_cap = timblogiw_g_fmt,
@@ -767,7 +767,7 @@ static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = {
767 .vidioc_enum_framesizes = timblogiw_enum_framesizes, 767 .vidioc_enum_framesizes = timblogiw_enum_framesizes,
768}; 768};
769 769
770static __devinitconst struct v4l2_file_operations timblogiw_fops = { 770static struct v4l2_file_operations timblogiw_fops = {
771 .owner = THIS_MODULE, 771 .owner = THIS_MODULE,
772 .open = timblogiw_open, 772 .open = timblogiw_open,
773 .release = timblogiw_close, 773 .release = timblogiw_close,
@@ -777,7 +777,7 @@ static __devinitconst struct v4l2_file_operations timblogiw_fops = {
777 .poll = timblogiw_poll, 777 .poll = timblogiw_poll,
778}; 778};
779 779
780static __devinitconst struct video_device timblogiw_template = { 780static struct video_device timblogiw_template = {
781 .name = TIMBLOGIWIN_NAME, 781 .name = TIMBLOGIWIN_NAME,
782 .fops = &timblogiw_fops, 782 .fops = &timblogiw_fops,
783 .ioctl_ops = &timblogiw_ioctl_ops, 783 .ioctl_ops = &timblogiw_ioctl_ops,
@@ -786,7 +786,7 @@ static __devinitconst struct video_device timblogiw_template = {
786 .tvnorms = V4L2_STD_PAL | V4L2_STD_NTSC 786 .tvnorms = V4L2_STD_PAL | V4L2_STD_NTSC
787}; 787};
788 788
789static int __devinit timblogiw_probe(struct platform_device *pdev) 789static int timblogiw_probe(struct platform_device *pdev)
790{ 790{
791 int err; 791 int err;
792 struct timblogiw *lw = NULL; 792 struct timblogiw *lw = NULL;
@@ -848,7 +848,7 @@ err:
848 return err; 848 return err;
849} 849}
850 850
851static int __devexit timblogiw_remove(struct platform_device *pdev) 851static int timblogiw_remove(struct platform_device *pdev)
852{ 852{
853 struct timblogiw *lw = platform_get_drvdata(pdev); 853 struct timblogiw *lw = platform_get_drvdata(pdev);
854 854
@@ -869,7 +869,7 @@ static struct platform_driver timblogiw_platform_driver = {
869 .owner = THIS_MODULE, 869 .owner = THIS_MODULE,
870 }, 870 },
871 .probe = timblogiw_probe, 871 .probe = timblogiw_probe,
872 .remove = __devexit_p(timblogiw_remove), 872 .remove = timblogiw_remove,
873}; 873};
874 874
875module_platform_driver(timblogiw_platform_driver); 875module_platform_driver(timblogiw_platform_driver);
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index eb404c2ce27..63e8c346123 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -1324,7 +1324,7 @@ static struct video_device viacam_v4l_template = {
1324#define VIACAM_SERIAL_CREG 0x46 1324#define VIACAM_SERIAL_CREG 0x46
1325#define VIACAM_SERIAL_BIT 0x40 1325#define VIACAM_SERIAL_BIT 0x40
1326 1326
1327static __devinit bool viacam_serial_is_enabled(void) 1327static bool viacam_serial_is_enabled(void)
1328{ 1328{
1329 struct pci_bus *pbus = pci_find_bus(0, 0); 1329 struct pci_bus *pbus = pci_find_bus(0, 0);
1330 u8 cbyte; 1330 u8 cbyte;
@@ -1353,7 +1353,7 @@ static struct ov7670_config sensor_cfg = {
1353 .clock_speed = 90, 1353 .clock_speed = 90,
1354}; 1354};
1355 1355
1356static __devinit int viacam_probe(struct platform_device *pdev) 1356static int viacam_probe(struct platform_device *pdev)
1357{ 1357{
1358 int ret; 1358 int ret;
1359 struct i2c_adapter *sensor_adapter; 1359 struct i2c_adapter *sensor_adapter;
@@ -1490,7 +1490,7 @@ out_unregister:
1490 return ret; 1490 return ret;
1491} 1491}
1492 1492
1493static __devexit int viacam_remove(struct platform_device *pdev) 1493static int viacam_remove(struct platform_device *pdev)
1494{ 1494{
1495 struct via_camera *cam = via_cam_info; 1495 struct via_camera *cam = via_cam_info;
1496 struct viafb_dev *viadev = pdev->dev.platform_data; 1496 struct viafb_dev *viadev = pdev->dev.platform_data;
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index b415211d0c4..bd4d3a7cdad 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -114,7 +114,8 @@ static struct snd_tea575x_ops maxiradio_tea_ops = {
114 .set_direction = maxiradio_tea575x_set_direction, 114 .set_direction = maxiradio_tea575x_set_direction,
115}; 115};
116 116
117static int __devinit maxiradio_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 117static int maxiradio_probe(struct pci_dev *pdev,
118 const struct pci_device_id *ent)
118{ 119{
119 struct maxiradio *dev; 120 struct maxiradio *dev;
120 struct v4l2_device *v4l2_dev; 121 struct v4l2_device *v4l2_dev;
@@ -172,7 +173,7 @@ errfr:
172 return retval; 173 return retval;
173} 174}
174 175
175static void __devexit maxiradio_remove(struct pci_dev *pdev) 176static void maxiradio_remove(struct pci_dev *pdev)
176{ 177{
177 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev); 178 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev);
178 struct maxiradio *dev = to_maxiradio(v4l2_dev); 179 struct maxiradio *dev = to_maxiradio(v4l2_dev);
@@ -196,7 +197,7 @@ static struct pci_driver maxiradio_driver = {
196 .name = "radio-maxiradio", 197 .name = "radio-maxiradio",
197 .id_table = maxiradio_pci_tbl, 198 .id_table = maxiradio_pci_tbl,
198 .probe = maxiradio_probe, 199 .probe = maxiradio_probe,
199 .remove = __devexit_p(maxiradio_remove), 200 .remove = maxiradio_remove,
200}; 201};
201 202
202static int __init maxiradio_init(void) 203static int __init maxiradio_init(void)
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index c260a2a354b..637a5556495 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -265,7 +265,7 @@ static const struct v4l2_ioctl_ops fmi_ioctl_ops = {
265}; 265};
266 266
267/* ladis: this is my card. does any other types exist? */ 267/* ladis: this is my card. does any other types exist? */
268static struct isapnp_device_id id_table[] __devinitdata = { 268static struct isapnp_device_id id_table[] = {
269 /* SF16-FMI */ 269 /* SF16-FMI */
270 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, 270 { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
271 ISAPNP_VENDOR('M','F','R'), ISAPNP_FUNCTION(0xad10), 0}, 271 ISAPNP_VENDOR('M','F','R'), ISAPNP_FUNCTION(0xad10), 0},
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index 4efcbec74c5..9c0990457a7 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -197,13 +197,13 @@ static int fmr2_tea_ext_init(struct snd_tea575x *tea)
197 return 0; 197 return 0;
198} 198}
199 199
200static struct pnp_device_id fmr2_pnp_ids[] __devinitdata = { 200static struct pnp_device_id fmr2_pnp_ids[] = {
201 { .id = "MFRad13" }, /* tuner subdevice of SF16-FMD2 */ 201 { .id = "MFRad13" }, /* tuner subdevice of SF16-FMD2 */
202 { .id = "" } 202 { .id = "" }
203}; 203};
204MODULE_DEVICE_TABLE(pnp, fmr2_pnp_ids); 204MODULE_DEVICE_TABLE(pnp, fmr2_pnp_ids);
205 205
206static int __devinit fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) 206static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)
207{ 207{
208 int err, i; 208 int err, i;
209 char *card_name = fmr2->is_fmd2 ? "SF16-FMD2" : "SF16-FMR2"; 209 char *card_name = fmr2->is_fmd2 ? "SF16-FMD2" : "SF16-FMR2";
@@ -249,7 +249,7 @@ static int __devinit fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)
249 return 0; 249 return 0;
250} 250}
251 251
252static int __devinit fmr2_isa_match(struct device *pdev, unsigned int ndev) 252static int fmr2_isa_match(struct device *pdev, unsigned int ndev)
253{ 253{
254 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); 254 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL);
255 if (!fmr2) 255 if (!fmr2)
@@ -265,8 +265,7 @@ static int __devinit fmr2_isa_match(struct device *pdev, unsigned int ndev)
265 return 1; 265 return 1;
266} 266}
267 267
268static int __devinit fmr2_pnp_probe(struct pnp_dev *pdev, 268static int fmr2_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *id)
269 const struct pnp_device_id *id)
270{ 269{
271 int ret; 270 int ret;
272 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); 271 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL);
@@ -285,7 +284,7 @@ static int __devinit fmr2_pnp_probe(struct pnp_dev *pdev,
285 return 0; 284 return 0;
286} 285}
287 286
288static void __devexit fmr2_remove(struct fmr2 *fmr2) 287static void fmr2_remove(struct fmr2 *fmr2)
289{ 288{
290 snd_tea575x_exit(&fmr2->tea); 289 snd_tea575x_exit(&fmr2->tea);
291 release_region(fmr2->io, 2); 290 release_region(fmr2->io, 2);
@@ -293,7 +292,7 @@ static void __devexit fmr2_remove(struct fmr2 *fmr2)
293 kfree(fmr2); 292 kfree(fmr2);
294} 293}
295 294
296static int __devexit fmr2_isa_remove(struct device *pdev, unsigned int ndev) 295static int fmr2_isa_remove(struct device *pdev, unsigned int ndev)
297{ 296{
298 fmr2_remove(dev_get_drvdata(pdev)); 297 fmr2_remove(dev_get_drvdata(pdev));
299 dev_set_drvdata(pdev, NULL); 298 dev_set_drvdata(pdev, NULL);
@@ -301,7 +300,7 @@ static int __devexit fmr2_isa_remove(struct device *pdev, unsigned int ndev)
301 return 0; 300 return 0;
302} 301}
303 302
304static void __devexit fmr2_pnp_remove(struct pnp_dev *pdev) 303static void fmr2_pnp_remove(struct pnp_dev *pdev)
305{ 304{
306 fmr2_remove(pnp_get_drvdata(pdev)); 305 fmr2_remove(pnp_get_drvdata(pdev));
307 pnp_set_drvdata(pdev, NULL); 306 pnp_set_drvdata(pdev, NULL);
@@ -309,7 +308,7 @@ static void __devexit fmr2_pnp_remove(struct pnp_dev *pdev)
309 308
310struct isa_driver fmr2_isa_driver = { 309struct isa_driver fmr2_isa_driver = {
311 .match = fmr2_isa_match, 310 .match = fmr2_isa_match,
312 .remove = __devexit_p(fmr2_isa_remove), 311 .remove = fmr2_isa_remove,
313 .driver = { 312 .driver = {
314 .name = "radio-sf16fmr2", 313 .name = "radio-sf16fmr2",
315 }, 314 },
@@ -319,7 +318,7 @@ struct pnp_driver fmr2_pnp_driver = {
319 .name = "radio-sf16fmr2", 318 .name = "radio-sf16fmr2",
320 .id_table = fmr2_pnp_ids, 319 .id_table = fmr2_pnp_ids,
321 .probe = fmr2_pnp_probe, 320 .probe = fmr2_pnp_probe,
322 .remove = __devexit_p(fmr2_pnp_remove), 321 .remove = fmr2_pnp_remove,
323}; 322};
324 323
325static int __init fmr2_init(void) 324static int __init fmr2_init(void)
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 36aec575e0e..1978516af67 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -493,8 +493,8 @@ static struct video_device tea5764_radio_template = {
493}; 493};
494 494
495/* I2C probe: check if the device exists and register with v4l if it is */ 495/* I2C probe: check if the device exists and register with v4l if it is */
496static int __devinit tea5764_i2c_probe(struct i2c_client *client, 496static int tea5764_i2c_probe(struct i2c_client *client,
497 const struct i2c_device_id *id) 497 const struct i2c_device_id *id)
498{ 498{
499 struct tea5764_device *radio; 499 struct tea5764_device *radio;
500 struct tea5764_regs *r; 500 struct tea5764_regs *r;
@@ -552,7 +552,7 @@ errfr:
552 return ret; 552 return ret;
553} 553}
554 554
555static int __devexit tea5764_i2c_remove(struct i2c_client *client) 555static int tea5764_i2c_remove(struct i2c_client *client)
556{ 556{
557 struct tea5764_device *radio = i2c_get_clientdata(client); 557 struct tea5764_device *radio = i2c_get_clientdata(client);
558 558
@@ -578,7 +578,7 @@ static struct i2c_driver tea5764_i2c_driver = {
578 .owner = THIS_MODULE, 578 .owner = THIS_MODULE,
579 }, 579 },
580 .probe = tea5764_i2c_probe, 580 .probe = tea5764_i2c_probe,
581 .remove = __devexit_p(tea5764_i2c_remove), 581 .remove = tea5764_i2c_remove,
582 .id_table = tea5764_id, 582 .id_table = tea5764_id,
583}; 583};
584 584
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index 5cf07779f4b..b87effeb5dc 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -145,7 +145,7 @@ static const struct v4l2_file_operations timbradio_fops = {
145 .unlocked_ioctl = video_ioctl2, 145 .unlocked_ioctl = video_ioctl2,
146}; 146};
147 147
148static int __devinit timbradio_probe(struct platform_device *pdev) 148static int timbradio_probe(struct platform_device *pdev)
149{ 149{
150 struct timb_radio_platform_data *pdata = pdev->dev.platform_data; 150 struct timb_radio_platform_data *pdata = pdev->dev.platform_data;
151 struct timbradio *tr; 151 struct timbradio *tr;
@@ -201,7 +201,7 @@ err:
201 return err; 201 return err;
202} 202}
203 203
204static int __devexit timbradio_remove(struct platform_device *pdev) 204static int timbradio_remove(struct platform_device *pdev)
205{ 205{
206 struct timbradio *tr = platform_get_drvdata(pdev); 206 struct timbradio *tr = platform_get_drvdata(pdev);
207 207
@@ -219,7 +219,7 @@ static struct platform_driver timbradio_platform_driver = {
219 .owner = THIS_MODULE, 219 .owner = THIS_MODULE,
220 }, 220 },
221 .probe = timbradio_probe, 221 .probe = timbradio_probe,
222 .remove = __devexit_p(timbradio_remove), 222 .remove = timbradio_remove,
223}; 223};
224 224
225module_platform_driver(timbradio_platform_driver); 225module_platform_driver(timbradio_platform_driver);
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 9b0c9fa0beb..c48be195bba 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1990,7 +1990,7 @@ static int wl1273_fm_radio_remove(struct platform_device *pdev)
1990 return 0; 1990 return 0;
1991} 1991}
1992 1992
1993static int __devinit wl1273_fm_radio_probe(struct platform_device *pdev) 1993static int wl1273_fm_radio_probe(struct platform_device *pdev)
1994{ 1994{
1995 struct wl1273_core **core = pdev->dev.platform_data; 1995 struct wl1273_core **core = pdev->dev.platform_data;
1996 struct wl1273_device *radio; 1996 struct wl1273_device *radio;
@@ -2145,7 +2145,7 @@ pdata_err:
2145 2145
2146static struct platform_driver wl1273_fm_radio_driver = { 2146static struct platform_driver wl1273_fm_radio_driver = {
2147 .probe = wl1273_fm_radio_probe, 2147 .probe = wl1273_fm_radio_probe,
2148 .remove = __devexit_p(wl1273_fm_radio_remove), 2148 .remove = wl1273_fm_radio_remove,
2149 .driver = { 2149 .driver = {
2150 .name = "wl1273_fm_radio", 2150 .name = "wl1273_fm_radio",
2151 .owner = THIS_MODULE, 2151 .owner = THIS_MODULE,
diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c
index 54db36ccb9e..06c06cc9ff2 100644
--- a/drivers/media/radio/saa7706h.c
+++ b/drivers/media/radio/saa7706h.c
@@ -373,8 +373,8 @@ static const struct v4l2_subdev_ops saa7706h_ops = {
373 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 373 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
374 */ 374 */
375 375
376static int __devinit saa7706h_probe(struct i2c_client *client, 376static int saa7706h_probe(struct i2c_client *client,
377 const struct i2c_device_id *id) 377 const struct i2c_device_id *id)
378{ 378{
379 struct saa7706h_state *state; 379 struct saa7706h_state *state;
380 struct v4l2_subdev *sd; 380 struct v4l2_subdev *sd;
@@ -418,7 +418,7 @@ err:
418 return err; 418 return err;
419} 419}
420 420
421static int __devexit saa7706h_remove(struct i2c_client *client) 421static int saa7706h_remove(struct i2c_client *client)
422{ 422{
423 struct v4l2_subdev *sd = i2c_get_clientdata(client); 423 struct v4l2_subdev *sd = i2c_get_clientdata(client);
424 424
@@ -441,7 +441,7 @@ static struct i2c_driver saa7706h_driver = {
441 .name = DRIVER_NAME, 441 .name = DRIVER_NAME,
442 }, 442 },
443 .probe = saa7706h_probe, 443 .probe = saa7706h_probe,
444 .remove = __devexit_p(saa7706h_remove), 444 .remove = saa7706h_remove,
445 .id_table = saa7706h_id, 445 .id_table = saa7706h_id,
446}; 446};
447 447
diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c
index 4ef55ec8045..e5fc9acd0c4 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -347,8 +347,8 @@ end:
347/* 347/*
348 * si470x_i2c_probe - probe for the device 348 * si470x_i2c_probe - probe for the device
349 */ 349 */
350static int __devinit si470x_i2c_probe(struct i2c_client *client, 350static int si470x_i2c_probe(struct i2c_client *client,
351 const struct i2c_device_id *id) 351 const struct i2c_device_id *id)
352{ 352{
353 struct si470x_device *radio; 353 struct si470x_device *radio;
354 int retval = 0; 354 int retval = 0;
@@ -451,7 +451,7 @@ err_initial:
451/* 451/*
452 * si470x_i2c_remove - remove the device 452 * si470x_i2c_remove - remove the device
453 */ 453 */
454static __devexit int si470x_i2c_remove(struct i2c_client *client) 454static int si470x_i2c_remove(struct i2c_client *client)
455{ 455{
456 struct si470x_device *radio = i2c_get_clientdata(client); 456 struct si470x_device *radio = i2c_get_clientdata(client);
457 457
@@ -514,7 +514,7 @@ static struct i2c_driver si470x_i2c_driver = {
514#endif 514#endif
515 }, 515 },
516 .probe = si470x_i2c_probe, 516 .probe = si470x_i2c_probe,
517 .remove = __devexit_p(si470x_i2c_remove), 517 .remove = si470x_i2c_remove,
518 .id_table = si470x_i2c_id, 518 .id_table = si470x_i2c_id,
519}; 519};
520 520
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index 06d47e5cce9..b18c2dc268b 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -165,8 +165,8 @@ static const struct v4l2_subdev_ops tef6862_ops = {
165 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 165 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
166 */ 166 */
167 167
168static int __devinit tef6862_probe(struct i2c_client *client, 168static int tef6862_probe(struct i2c_client *client,
169 const struct i2c_device_id *id) 169 const struct i2c_device_id *id)
170{ 170{
171 struct tef6862_state *state; 171 struct tef6862_state *state;
172 struct v4l2_subdev *sd; 172 struct v4l2_subdev *sd;
@@ -189,7 +189,7 @@ static int __devinit tef6862_probe(struct i2c_client *client,
189 return 0; 189 return 0;
190} 190}
191 191
192static int __devexit tef6862_remove(struct i2c_client *client) 192static int tef6862_remove(struct i2c_client *client)
193{ 193{
194 struct v4l2_subdev *sd = i2c_get_clientdata(client); 194 struct v4l2_subdev *sd = i2c_get_clientdata(client);
195 195
@@ -211,7 +211,7 @@ static struct i2c_driver tef6862_driver = {
211 .name = DRIVER_NAME, 211 .name = DRIVER_NAME,
212 }, 212 },
213 .probe = tef6862_probe, 213 .probe = tef6862_probe,
214 .remove = __devexit_p(tef6862_remove), 214 .remove = tef6862_remove,
215 .id_table = tef6862_id, 215 .id_table = tef6862_id,
216}; 216};
217 217
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 22231dd4f62..cef04786b52 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1172,7 +1172,7 @@ static struct pnp_driver ene_driver = {
1172 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, 1172 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE,
1173 1173
1174 .probe = ene_probe, 1174 .probe = ene_probe,
1175 .remove = __devexit_p(ene_remove), 1175 .remove = ene_remove,
1176#ifdef CONFIG_PM 1176#ifdef CONFIG_PM
1177 .suspend = ene_suspend, 1177 .suspend = ene_suspend,
1178 .resume = ene_resume, 1178 .resume = ene_resume,
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index 936c3f79b62..1df410e1368 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -590,7 +590,7 @@ failure:
590 return ret; 590 return ret;
591} 591}
592 592
593static void __devexit fintek_remove(struct pnp_dev *pdev) 593static void fintek_remove(struct pnp_dev *pdev)
594{ 594{
595 struct fintek_dev *fintek = pnp_get_drvdata(pdev); 595 struct fintek_dev *fintek = pnp_get_drvdata(pdev);
596 unsigned long flags; 596 unsigned long flags;
@@ -678,7 +678,7 @@ static struct pnp_driver fintek_driver = {
678 .id_table = fintek_ids, 678 .id_table = fintek_ids,
679 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, 679 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE,
680 .probe = fintek_probe, 680 .probe = fintek_probe,
681 .remove = __devexit_p(fintek_remove), 681 .remove = fintek_remove,
682 .suspend = fintek_suspend, 682 .suspend = fintek_suspend,
683 .resume = fintek_resume, 683 .resume = fintek_resume,
684 .shutdown = fintek_shutdown, 684 .shutdown = fintek_shutdown,
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index ba1a1eb356c..4f71a7d1f01 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -58,7 +58,7 @@ err_get_value:
58 return IRQ_HANDLED; 58 return IRQ_HANDLED;
59} 59}
60 60
61static int __devinit gpio_ir_recv_probe(struct platform_device *pdev) 61static int gpio_ir_recv_probe(struct platform_device *pdev)
62{ 62{
63 struct gpio_rc_dev *gpio_dev; 63 struct gpio_rc_dev *gpio_dev;
64 struct rc_dev *rcdev; 64 struct rc_dev *rcdev;
@@ -140,7 +140,7 @@ err_allocate_device:
140 return rc; 140 return rc;
141} 141}
142 142
143static int __devexit gpio_ir_recv_remove(struct platform_device *pdev) 143static int gpio_ir_recv_remove(struct platform_device *pdev)
144{ 144{
145 struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); 145 struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
146 146
@@ -188,7 +188,7 @@ static const struct dev_pm_ops gpio_ir_recv_pm_ops = {
188 188
189static struct platform_driver gpio_ir_recv_driver = { 189static struct platform_driver gpio_ir_recv_driver = {
190 .probe = gpio_ir_recv_probe, 190 .probe = gpio_ir_recv_probe,
191 .remove = __devexit_p(gpio_ir_recv_remove), 191 .remove = gpio_ir_recv_remove,
192 .driver = { 192 .driver = {
193 .name = GPIO_IR_DRIVER_NAME, 193 .name = GPIO_IR_DRIVER_NAME,
194 .owner = THIS_MODULE, 194 .owner = THIS_MODULE,
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index 5a9163da63c..b99b096d8a8 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -425,8 +425,8 @@ static void iguanair_close(struct rc_dev *rdev)
425 mutex_unlock(&ir->lock); 425 mutex_unlock(&ir->lock);
426} 426}
427 427
428static int __devinit iguanair_probe(struct usb_interface *intf, 428static int iguanair_probe(struct usb_interface *intf,
429 const struct usb_device_id *id) 429 const struct usb_device_id *id)
430{ 430{
431 struct usb_device *udev = interface_to_usbdev(intf); 431 struct usb_device *udev = interface_to_usbdev(intf);
432 struct iguanair *ir; 432 struct iguanair *ir;
@@ -538,7 +538,7 @@ out:
538 return ret; 538 return ret;
539} 539}
540 540
541static void __devexit iguanair_disconnect(struct usb_interface *intf) 541static void iguanair_disconnect(struct usb_interface *intf)
542{ 542{
543 struct iguanair *ir = usb_get_intfdata(intf); 543 struct iguanair *ir = usb_get_intfdata(intf);
544 544
@@ -604,7 +604,7 @@ static const struct usb_device_id iguanair_table[] = {
604static struct usb_driver iguanair_driver = { 604static struct usb_driver iguanair_driver = {
605 .name = DRIVER_NAME, 605 .name = DRIVER_NAME,
606 .probe = iguanair_probe, 606 .probe = iguanair_probe,
607 .disconnect = __devexit_p(iguanair_disconnect), 607 .disconnect = iguanair_disconnect,
608 .suspend = iguanair_suspend, 608 .suspend = iguanair_suspend,
609 .resume = iguanair_resume, 609 .resume = iguanair_resume,
610 .reset_resume = iguanair_resume, 610 .reset_resume = iguanair_resume,
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 8f6a28921ed..78d109b978d 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -255,7 +255,7 @@ static struct usb_device_id imon_usb_id_table[] = {
255static struct usb_driver imon_driver = { 255static struct usb_driver imon_driver = {
256 .name = MOD_NAME, 256 .name = MOD_NAME,
257 .probe = imon_probe, 257 .probe = imon_probe,
258 .disconnect = __devexit_p(imon_disconnect), 258 .disconnect = imon_disconnect,
259 .suspend = imon_suspend, 259 .suspend = imon_suspend,
260 .resume = imon_resume, 260 .resume = imon_resume,
261 .id_table = imon_usb_id_table, 261 .id_table = imon_usb_id_table,
@@ -2288,8 +2288,8 @@ static void imon_init_display(struct imon_context *ictx,
2288/** 2288/**
2289 * Callback function for USB core API: Probe 2289 * Callback function for USB core API: Probe
2290 */ 2290 */
2291static int __devinit imon_probe(struct usb_interface *interface, 2291static int imon_probe(struct usb_interface *interface,
2292 const struct usb_device_id *id) 2292 const struct usb_device_id *id)
2293{ 2293{
2294 struct usb_device *usbdev = NULL; 2294 struct usb_device *usbdev = NULL;
2295 struct usb_host_interface *iface_desc = NULL; 2295 struct usb_host_interface *iface_desc = NULL;
@@ -2372,7 +2372,7 @@ fail:
2372/** 2372/**
2373 * Callback function for USB core API: disconnect 2373 * Callback function for USB core API: disconnect
2374 */ 2374 */
2375static void __devexit imon_disconnect(struct usb_interface *interface) 2375static void imon_disconnect(struct usb_interface *interface)
2376{ 2376{
2377 struct imon_context *ictx; 2377 struct imon_context *ictx;
2378 struct device *dev; 2378 struct device *dev;
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 9e76c7b40af..8ead492d03a 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -443,7 +443,7 @@ static int lirc_rx51_resume(struct platform_device *dev)
443 443
444#endif /* CONFIG_PM */ 444#endif /* CONFIG_PM */
445 445
446static int __devinit lirc_rx51_probe(struct platform_device *dev) 446static int lirc_rx51_probe(struct platform_device *dev)
447{ 447{
448 lirc_rx51_driver.features = LIRC_RX51_DRIVER_FEATURES; 448 lirc_rx51_driver.features = LIRC_RX51_DRIVER_FEATURES;
449 lirc_rx51.pdata = dev->dev.platform_data; 449 lirc_rx51.pdata = dev->dev.platform_data;
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 5e5a7f2b818..1b8669b6d04 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1620,7 +1620,7 @@ failure:
1620 return ret; 1620 return ret;
1621} 1621}
1622 1622
1623static void __devexit ite_remove(struct pnp_dev *pdev) 1623static void ite_remove(struct pnp_dev *pdev)
1624{ 1624{
1625 struct ite_dev *dev = pnp_get_drvdata(pdev); 1625 struct ite_dev *dev = pnp_get_drvdata(pdev);
1626 unsigned long flags; 1626 unsigned long flags;
@@ -1702,7 +1702,7 @@ static struct pnp_driver ite_driver = {
1702 .name = ITE_DRIVER_NAME, 1702 .name = ITE_DRIVER_NAME,
1703 .id_table = ite_ids, 1703 .id_table = ite_ids,
1704 .probe = ite_probe, 1704 .probe = ite_probe,
1705 .remove = __devexit_p(ite_remove), 1705 .remove = ite_remove,
1706 .suspend = ite_suspend, 1706 .suspend = ite_suspend,
1707 .resume = ite_resume, 1707 .resume = ite_resume,
1708 .shutdown = ite_shutdown, 1708 .shutdown = ite_shutdown,
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index b2146cd99fd..9afb9331217 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1229,8 +1229,8 @@ out:
1229 return NULL; 1229 return NULL;
1230} 1230}
1231 1231
1232static int __devinit mceusb_dev_probe(struct usb_interface *intf, 1232static int mceusb_dev_probe(struct usb_interface *intf,
1233 const struct usb_device_id *id) 1233 const struct usb_device_id *id)
1234{ 1234{
1235 struct usb_device *dev = interface_to_usbdev(intf); 1235 struct usb_device *dev = interface_to_usbdev(intf);
1236 struct usb_host_interface *idesc; 1236 struct usb_host_interface *idesc;
@@ -1393,7 +1393,7 @@ mem_alloc_fail:
1393} 1393}
1394 1394
1395 1395
1396static void __devexit mceusb_dev_disconnect(struct usb_interface *intf) 1396static void mceusb_dev_disconnect(struct usb_interface *intf)
1397{ 1397{
1398 struct usb_device *dev = interface_to_usbdev(intf); 1398 struct usb_device *dev = interface_to_usbdev(intf);
1399 struct mceusb_dev *ir = usb_get_intfdata(intf); 1399 struct mceusb_dev *ir = usb_get_intfdata(intf);
@@ -1432,7 +1432,7 @@ static int mceusb_dev_resume(struct usb_interface *intf)
1432static struct usb_driver mceusb_dev_driver = { 1432static struct usb_driver mceusb_dev_driver = {
1433 .name = DRIVER_NAME, 1433 .name = DRIVER_NAME,
1434 .probe = mceusb_dev_probe, 1434 .probe = mceusb_dev_probe,
1435 .disconnect = __devexit_p(mceusb_dev_disconnect), 1435 .disconnect = mceusb_dev_disconnect,
1436 .suspend = mceusb_dev_suspend, 1436 .suspend = mceusb_dev_suspend,
1437 .resume = mceusb_dev_resume, 1437 .resume = mceusb_dev_resume,
1438 .reset_resume = mceusb_dev_resume, 1438 .reset_resume = mceusb_dev_resume,
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index e4ea89a11ee..b8aa9abb31f 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1113,7 +1113,7 @@ failure:
1113 return ret; 1113 return ret;
1114} 1114}
1115 1115
1116static void __devexit nvt_remove(struct pnp_dev *pdev) 1116static void nvt_remove(struct pnp_dev *pdev)
1117{ 1117{
1118 struct nvt_dev *nvt = pnp_get_drvdata(pdev); 1118 struct nvt_dev *nvt = pnp_get_drvdata(pdev);
1119 unsigned long flags; 1119 unsigned long flags;
@@ -1211,7 +1211,7 @@ static struct pnp_driver nvt_driver = {
1211 .id_table = nvt_ids, 1211 .id_table = nvt_ids,
1212 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, 1212 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE,
1213 .probe = nvt_probe, 1213 .probe = nvt_probe,
1214 .remove = __devexit_p(nvt_remove), 1214 .remove = nvt_remove,
1215 .suspend = nvt_suspend, 1215 .suspend = nvt_suspend,
1216 .resume = nvt_resume, 1216 .resume = nvt_resume,
1217 .shutdown = nvt_shutdown, 1217 .shutdown = nvt_shutdown,
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index a8887aba9fa..1800326f93e 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -1102,8 +1102,8 @@ out:
1102 return NULL; 1102 return NULL;
1103} 1103}
1104 1104
1105static int __devinit redrat3_dev_probe(struct usb_interface *intf, 1105static int redrat3_dev_probe(struct usb_interface *intf,
1106 const struct usb_device_id *id) 1106 const struct usb_device_id *id)
1107{ 1107{
1108 struct usb_device *udev = interface_to_usbdev(intf); 1108 struct usb_device *udev = interface_to_usbdev(intf);
1109 struct device *dev = &intf->dev; 1109 struct device *dev = &intf->dev;
@@ -1241,7 +1241,7 @@ no_endpoints:
1241 return retval; 1241 return retval;
1242} 1242}
1243 1243
1244static void __devexit redrat3_dev_disconnect(struct usb_interface *intf) 1244static void redrat3_dev_disconnect(struct usb_interface *intf)
1245{ 1245{
1246 struct usb_device *udev = interface_to_usbdev(intf); 1246 struct usb_device *udev = interface_to_usbdev(intf);
1247 struct redrat3_dev *rr3 = usb_get_intfdata(intf); 1247 struct redrat3_dev *rr3 = usb_get_intfdata(intf);
@@ -1281,7 +1281,7 @@ static int redrat3_dev_resume(struct usb_interface *intf)
1281static struct usb_driver redrat3_dev_driver = { 1281static struct usb_driver redrat3_dev_driver = {
1282 .name = DRIVER_NAME, 1282 .name = DRIVER_NAME,
1283 .probe = redrat3_dev_probe, 1283 .probe = redrat3_dev_probe,
1284 .disconnect = __devexit_p(redrat3_dev_disconnect), 1284 .disconnect = redrat3_dev_disconnect,
1285 .suspend = redrat3_dev_suspend, 1285 .suspend = redrat3_dev_suspend,
1286 .resume = redrat3_dev_resume, 1286 .resume = redrat3_dev_resume,
1287 .reset_resume = redrat3_dev_resume, 1287 .reset_resume = redrat3_dev_resume,
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index c720f12f661..d7b11e6a998 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -346,8 +346,8 @@ out:
346 * On any failure the return value is the ERROR 346 * On any failure the return value is the ERROR
347 * On success return 0 347 * On success return 0
348 */ 348 */
349static int __devinit streamzap_probe(struct usb_interface *intf, 349static int streamzap_probe(struct usb_interface *intf,
350 const struct usb_device_id *id) 350 const struct usb_device_id *id)
351{ 351{
352 struct usb_device *usbdev = interface_to_usbdev(intf); 352 struct usb_device *usbdev = interface_to_usbdev(intf);
353 struct usb_host_interface *iface_host; 353 struct usb_host_interface *iface_host;
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
index f0921b5483e..78be8a91422 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -194,8 +194,8 @@ static void ttusbir_urb_complete(struct urb *urb)
194 dev_warn(tt->dev, "failed to resubmit urb: %d\n", rc); 194 dev_warn(tt->dev, "failed to resubmit urb: %d\n", rc);
195} 195}
196 196
197static int __devinit ttusbir_probe(struct usb_interface *intf, 197static int ttusbir_probe(struct usb_interface *intf,
198 const struct usb_device_id *id) 198 const struct usb_device_id *id)
199{ 199{
200 struct ttusbir *tt; 200 struct ttusbir *tt;
201 struct usb_interface_descriptor *idesc; 201 struct usb_interface_descriptor *idesc;
@@ -367,7 +367,7 @@ out:
367 return ret; 367 return ret;
368} 368}
369 369
370static void __devexit ttusbir_disconnect(struct usb_interface *intf) 370static void ttusbir_disconnect(struct usb_interface *intf)
371{ 371{
372 struct ttusbir *tt = usb_get_intfdata(intf); 372 struct ttusbir *tt = usb_get_intfdata(intf);
373 struct usb_device *udev = tt->udev; 373 struct usb_device *udev = tt->udev;
@@ -435,7 +435,7 @@ static struct usb_driver ttusbir_driver = {
435 .suspend = ttusbir_suspend, 435 .suspend = ttusbir_suspend,
436 .resume = ttusbir_resume, 436 .resume = ttusbir_resume,
437 .reset_resume = ttusbir_resume, 437 .reset_resume = ttusbir_resume,
438 .disconnect = __devexit_p(ttusbir_disconnect) 438 .disconnect = ttusbir_disconnect,
439}; 439};
440 440
441module_usb_driver(ttusbir_driver); 441module_usb_driver(ttusbir_driver);
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 7f3c476dde0..930c6149903 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1008,7 +1008,7 @@ wbcir_resume(struct pnp_dev *device)
1008 return 0; 1008 return 0;
1009} 1009}
1010 1010
1011static int __devinit 1011static int
1012wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) 1012wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1013{ 1013{
1014 struct device *dev = &device->dev; 1014 struct device *dev = &device->dev;
@@ -1155,7 +1155,7 @@ exit:
1155 return err; 1155 return err;
1156} 1156}
1157 1157
1158static void __devexit 1158static void
1159wbcir_remove(struct pnp_dev *device) 1159wbcir_remove(struct pnp_dev *device)
1160{ 1160{
1161 struct wbcir_data *data = pnp_get_drvdata(device); 1161 struct wbcir_data *data = pnp_get_drvdata(device);
@@ -1201,7 +1201,7 @@ static struct pnp_driver wbcir_driver = {
1201 .name = WBCIR_NAME, 1201 .name = WBCIR_NAME,
1202 .id_table = wbcir_ids, 1202 .id_table = wbcir_ids,
1203 .probe = wbcir_probe, 1203 .probe = wbcir_probe,
1204 .remove = __devexit_p(wbcir_remove), 1204 .remove = wbcir_remove,
1205 .suspend = wbcir_suspend, 1205 .suspend = wbcir_suspend,
1206 .resume = wbcir_resume, 1206 .resume = wbcir_resume,
1207 .shutdown = wbcir_shutdown 1207 .shutdown = wbcir_shutdown
diff --git a/drivers/media/usb/gspca/spca506.c b/drivers/media/usb/gspca/spca506.c
index bab01c86c31..bcd2c04c770 100644
--- a/drivers/media/usb/gspca/spca506.c
+++ b/drivers/media/usb/gspca/spca506.c
@@ -590,8 +590,7 @@ static const struct usb_device_id device_table[] = {
590MODULE_DEVICE_TABLE(usb, device_table); 590MODULE_DEVICE_TABLE(usb, device_table);
591 591
592/* -- device connect -- */ 592/* -- device connect -- */
593static int __devinit sd_probe(struct usb_interface *intf, 593static int sd_probe(struct usb_interface *intf, const struct usb_device_id *id)
594 const struct usb_device_id *id)
595{ 594{
596 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), 595 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
597 THIS_MODULE); 596 THIS_MODULE);
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index aac622200e9..de2c10289ee 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -389,7 +389,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
389 return rc; 389 return rc;
390} 390}
391 391
392static int __devinit smsusb_probe(struct usb_interface *intf, 392static int smsusb_probe(struct usb_interface *intf,
393 const struct usb_device_id *id) 393 const struct usb_device_id *id)
394{ 394{
395 struct usb_device *udev = interface_to_usbdev(intf); 395 struct usb_device *udev = interface_to_usbdev(intf);
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 5c36a57e659..ad7f7448072 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -1363,7 +1363,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
1363} 1363}
1364 1364
1365/* register video4linux devices */ 1365/* register video4linux devices */
1366static int __devinit usbvision_register_video(struct usb_usbvision *usbvision) 1366static int usbvision_register_video(struct usb_usbvision *usbvision)
1367{ 1367{
1368 /* Video Device: */ 1368 /* Video Device: */
1369 usbvision->vdev = usbvision_vdev_init(usbvision, 1369 usbvision->vdev = usbvision_vdev_init(usbvision,
@@ -1510,8 +1510,8 @@ static void usbvision_configure_video(struct usb_usbvision *usbvision)
1510 * if it looks like USBVISION video device 1510 * if it looks like USBVISION video device
1511 * 1511 *
1512 */ 1512 */
1513static int __devinit usbvision_probe(struct usb_interface *intf, 1513static int usbvision_probe(struct usb_interface *intf,
1514 const struct usb_device_id *devid) 1514 const struct usb_device_id *devid)
1515{ 1515{
1516 struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf)); 1516 struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf));
1517 struct usb_interface *uif; 1517 struct usb_interface *uif;
@@ -1619,7 +1619,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
1619 * with no ill consequences. 1619 * with no ill consequences.
1620 * 1620 *
1621 */ 1621 */
1622static void __devexit usbvision_disconnect(struct usb_interface *intf) 1622static void usbvision_disconnect(struct usb_interface *intf)
1623{ 1623{
1624 struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf)); 1624 struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf));
1625 1625
@@ -1664,7 +1664,7 @@ static struct usb_driver usbvision_driver = {
1664 .name = "usbvision", 1664 .name = "usbvision",
1665 .id_table = usbvision_table, 1665 .id_table = usbvision_table,
1666 .probe = usbvision_probe, 1666 .probe = usbvision_probe,
1667 .disconnect = __devexit_p(usbvision_disconnect), 1667 .disconnect = usbvision_disconnect,
1668}; 1668};
1669 1669
1670/* 1670/*
diff --git a/drivers/memory/tegra20-mc.c b/drivers/memory/tegra20-mc.c
index e6764bb41cb..186f27d9e5f 100644
--- a/drivers/memory/tegra20-mc.c
+++ b/drivers/memory/tegra20-mc.c
@@ -177,7 +177,7 @@ static void tegra20_mc_decode(struct tegra20_mc *mc, int n)
177 "carveout" : "trustzone") : ""); 177 "carveout" : "trustzone") : "");
178} 178}
179 179
180static const struct of_device_id tegra20_mc_of_match[] __devinitconst = { 180static const struct of_device_id tegra20_mc_of_match[] = {
181 { .compatible = "nvidia,tegra20-mc", }, 181 { .compatible = "nvidia,tegra20-mc", },
182 {}, 182 {},
183}; 183};
@@ -198,7 +198,7 @@ static irqreturn_t tegra20_mc_isr(int irq, void *data)
198 return IRQ_HANDLED; 198 return IRQ_HANDLED;
199} 199}
200 200
201static int __devinit tegra20_mc_probe(struct platform_device *pdev) 201static int tegra20_mc_probe(struct platform_device *pdev)
202{ 202{
203 struct resource *irq; 203 struct resource *irq;
204 struct tegra20_mc *mc; 204 struct tegra20_mc *mc;
diff --git a/drivers/memory/tegra30-mc.c b/drivers/memory/tegra30-mc.c
index 802b9ea431f..0b7ab9332a1 100644
--- a/drivers/memory/tegra30-mc.c
+++ b/drivers/memory/tegra30-mc.c
@@ -295,7 +295,7 @@ static UNIVERSAL_DEV_PM_OPS(tegra30_mc_pm,
295 tegra30_mc_suspend, 295 tegra30_mc_suspend,
296 tegra30_mc_resume, NULL); 296 tegra30_mc_resume, NULL);
297 297
298static const struct of_device_id tegra30_mc_of_match[] __devinitconst = { 298static const struct of_device_id tegra30_mc_of_match[] = {
299 { .compatible = "nvidia,tegra30-mc", }, 299 { .compatible = "nvidia,tegra30-mc", },
300 {}, 300 {},
301}; 301};
@@ -316,7 +316,7 @@ static irqreturn_t tegra30_mc_isr(int irq, void *data)
316 return IRQ_HANDLED; 316 return IRQ_HANDLED;
317} 317}
318 318
319static int __devinit tegra30_mc_probe(struct platform_device *pdev) 319static int tegra30_mc_probe(struct platform_device *pdev)
320{ 320{
321 struct resource *irq; 321 struct resource *irq;
322 struct tegra30_mc *mc; 322 struct tegra30_mc *mc;
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index d784c36707c..c13cd9bc590 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -100,7 +100,7 @@ static int mptfc_slave_alloc(struct scsi_device *sdev);
100static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); 100static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt);
101static void mptfc_target_destroy(struct scsi_target *starget); 101static void mptfc_target_destroy(struct scsi_target *starget);
102static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); 102static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
103static void __devexit mptfc_remove(struct pci_dev *pdev); 103static void mptfc_remove(struct pci_dev *pdev);
104static int mptfc_abort(struct scsi_cmnd *SCpnt); 104static int mptfc_abort(struct scsi_cmnd *SCpnt);
105static int mptfc_dev_reset(struct scsi_cmnd *SCpnt); 105static int mptfc_dev_reset(struct scsi_cmnd *SCpnt);
106static int mptfc_bus_reset(struct scsi_cmnd *SCpnt); 106static int mptfc_bus_reset(struct scsi_cmnd *SCpnt);
@@ -1360,7 +1360,7 @@ static struct pci_driver mptfc_driver = {
1360 .name = "mptfc", 1360 .name = "mptfc",
1361 .id_table = mptfc_pci_table, 1361 .id_table = mptfc_pci_table,
1362 .probe = mptfc_probe, 1362 .probe = mptfc_probe,
1363 .remove = __devexit_p(mptfc_remove), 1363 .remove = mptfc_remove,
1364 .shutdown = mptscsih_shutdown, 1364 .shutdown = mptscsih_shutdown,
1365#ifdef CONFIG_PM 1365#ifdef CONFIG_PM
1366 .suspend = mptscsih_suspend, 1366 .suspend = mptscsih_suspend,
@@ -1496,8 +1496,7 @@ mptfc_init(void)
1496 * @pdev: Pointer to pci_dev structure 1496 * @pdev: Pointer to pci_dev structure
1497 * 1497 *
1498 */ 1498 */
1499static void __devexit 1499static void mptfc_remove(struct pci_dev *pdev)
1500mptfc_remove(struct pci_dev *pdev)
1501{ 1500{
1502 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1501 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1503 struct mptfc_rport_info *p, *n; 1502 struct mptfc_rport_info *p, *n;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 551262e4b96..fa43c391c8e 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -5332,7 +5332,7 @@ mptsas_shutdown(struct pci_dev *pdev)
5332 mptsas_cleanup_fw_event_q(ioc); 5332 mptsas_cleanup_fw_event_q(ioc);
5333} 5333}
5334 5334
5335static void __devexit mptsas_remove(struct pci_dev *pdev) 5335static void mptsas_remove(struct pci_dev *pdev)
5336{ 5336{
5337 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 5337 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
5338 struct mptsas_portinfo *p, *n; 5338 struct mptsas_portinfo *p, *n;
@@ -5387,7 +5387,7 @@ static struct pci_driver mptsas_driver = {
5387 .name = "mptsas", 5387 .name = "mptsas",
5388 .id_table = mptsas_pci_table, 5388 .id_table = mptsas_pci_table,
5389 .probe = mptsas_probe, 5389 .probe = mptsas_probe,
5390 .remove = __devexit_p(mptsas_remove), 5390 .remove = mptsas_remove,
5391 .shutdown = mptsas_shutdown, 5391 .shutdown = mptsas_shutdown,
5392#ifdef CONFIG_PM 5392#ifdef CONFIG_PM
5393 .suspend = mptscsih_suspend, 5393 .suspend = mptscsih_suspend,
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 8f61ba6aac2..c3aabde2dc4 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1550,7 +1550,7 @@ static struct pci_driver mptspi_driver = {
1550 .name = "mptspi", 1550 .name = "mptspi",
1551 .id_table = mptspi_pci_table, 1551 .id_table = mptspi_pci_table,
1552 .probe = mptspi_probe, 1552 .probe = mptspi_probe,
1553 .remove = __devexit_p(mptscsih_remove), 1553 .remove = mptscsih_remove,
1554 .shutdown = mptscsih_shutdown, 1554 .shutdown = mptscsih_shutdown,
1555#ifdef CONFIG_PM 1555#ifdef CONFIG_PM
1556 .suspend = mptscsih_suspend, 1556 .suspend = mptscsih_suspend,
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 7190d5239b4..0f9f3e1a2b6 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -37,7 +37,7 @@
37#define OSM_DESCRIPTION "I2O-subsystem" 37#define OSM_DESCRIPTION "I2O-subsystem"
38 38
39/* PCI device id table for all I2O controllers */ 39/* PCI device id table for all I2O controllers */
40static struct pci_device_id __devinitdata i2o_pci_ids[] = { 40static struct pci_device_id i2o_pci_ids[] = {
41 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, 41 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)},
42 {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)}, 42 {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)},
43 {.vendor = PCI_VENDOR_ID_INTEL,.device = 0x1962, 43 {.vendor = PCI_VENDOR_ID_INTEL,.device = 0x1962,
@@ -84,7 +84,7 @@ static void i2o_pci_free(struct i2o_controller *c)
84 * 84 *
85 * Returns 0 on success or negative error code on failure. 85 * Returns 0 on success or negative error code on failure.
86 */ 86 */
87static int __devinit i2o_pci_alloc(struct i2o_controller *c) 87static int i2o_pci_alloc(struct i2o_controller *c)
88{ 88{
89 struct pci_dev *pdev = c->pdev; 89 struct pci_dev *pdev = c->pdev;
90 struct device *dev = &pdev->dev; 90 struct device *dev = &pdev->dev;
@@ -315,8 +315,7 @@ static void i2o_pci_irq_disable(struct i2o_controller *c)
315 * 315 *
316 * Returns 0 on success or negative error code on failure. 316 * Returns 0 on success or negative error code on failure.
317 */ 317 */
318static int __devinit i2o_pci_probe(struct pci_dev *pdev, 318static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
319 const struct pci_device_id *id)
320{ 319{
321 struct i2o_controller *c; 320 struct i2o_controller *c;
322 int rc; 321 int rc;
@@ -453,7 +452,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
453 * Reset the I2O controller, disable interrupts and remove all allocated 452 * Reset the I2O controller, disable interrupts and remove all allocated
454 * resources. 453 * resources.
455 */ 454 */
456static void __devexit i2o_pci_remove(struct pci_dev *pdev) 455static void i2o_pci_remove(struct pci_dev *pdev)
457{ 456{
458 struct i2o_controller *c; 457 struct i2o_controller *c;
459 c = pci_get_drvdata(pdev); 458 c = pci_get_drvdata(pdev);
@@ -474,7 +473,7 @@ static struct pci_driver i2o_pci_driver = {
474 .name = "PCI_I2O", 473 .name = "PCI_I2O",
475 .id_table = i2o_pci_ids, 474 .id_table = i2o_pci_ids,
476 .probe = i2o_pci_probe, 475 .probe = i2o_pci_probe,
477 .remove = __devexit_p(i2o_pci_remove), 476 .remove = i2o_pci_remove,
478}; 477};
479 478
480/** 479/**
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index abd5c80c7cf..14714058f2d 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -50,7 +50,7 @@ static struct mfd_cell max8997_devs[] = {
50}; 50};
51 51
52#ifdef CONFIG_OF 52#ifdef CONFIG_OF
53static struct of_device_id __devinitdata max8997_pmic_dt_match[] = { 53static struct of_device_id max8997_pmic_dt_match[] = {
54 { .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 }, 54 { .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 },
55 {}, 55 {},
56}; 56};
diff --git a/drivers/mfd/retu-mfd.c b/drivers/mfd/retu-mfd.c
index 7ff4a37ab0c..3ba048655bf 100644
--- a/drivers/mfd/retu-mfd.c
+++ b/drivers/mfd/retu-mfd.c
@@ -171,8 +171,7 @@ static struct regmap_config retu_config = {
171 .val_bits = 16, 171 .val_bits = 16,
172}; 172};
173 173
174static int __devinit retu_probe(struct i2c_client *i2c, 174static int retu_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
175 const struct i2c_device_id *id)
176{ 175{
177 struct retu_dev *rdev; 176 struct retu_dev *rdev;
178 int ret; 177 int ret;
@@ -225,7 +224,7 @@ static int __devinit retu_probe(struct i2c_client *i2c,
225 return 0; 224 return 0;
226} 225}
227 226
228static int __devexit retu_remove(struct i2c_client *i2c) 227static int retu_remove(struct i2c_client *i2c)
229{ 228{
230 struct retu_dev *rdev = i2c_get_clientdata(i2c); 229 struct retu_dev *rdev = i2c_get_clientdata(i2c);
231 230
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 3a44efa2920..7a7b0bda461 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -998,8 +998,8 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
998 return 0; 998 return 0;
999} 999}
1000 1000
1001static int __devinit rtsx_pci_probe(struct pci_dev *pcidev, 1001static int rtsx_pci_probe(struct pci_dev *pcidev,
1002 const struct pci_device_id *id) 1002 const struct pci_device_id *id)
1003{ 1003{
1004 struct rtsx_pcr *pcr; 1004 struct rtsx_pcr *pcr;
1005 struct pcr_handle *handle; 1005 struct pcr_handle *handle;
@@ -1123,7 +1123,7 @@ disable:
1123 return ret; 1123 return ret;
1124} 1124}
1125 1125
1126static void __devexit rtsx_pci_remove(struct pci_dev *pcidev) 1126static void rtsx_pci_remove(struct pci_dev *pcidev)
1127{ 1127{
1128 struct pcr_handle *handle = pci_get_drvdata(pcidev); 1128 struct pcr_handle *handle = pci_get_drvdata(pcidev);
1129 struct rtsx_pcr *pcr = handle->pcr; 1129 struct rtsx_pcr *pcr = handle->pcr;
@@ -1241,7 +1241,7 @@ static struct pci_driver rtsx_pci_driver = {
1241 .name = DRV_NAME_RTSX_PCI, 1241 .name = DRV_NAME_RTSX_PCI,
1242 .id_table = rtsx_pci_ids, 1242 .id_table = rtsx_pci_ids,
1243 .probe = rtsx_pci_probe, 1243 .probe = rtsx_pci_probe,
1244 .remove = __devexit_p(rtsx_pci_remove), 1244 .remove = rtsx_pci_remove,
1245 .suspend = rtsx_pci_suspend, 1245 .suspend = rtsx_pci_suspend,
1246 .resume = rtsx_pci_resume, 1246 .resume = rtsx_pci_resume,
1247}; 1247};
diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 1225dcbcfcf..9bd33169a11 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -510,19 +510,19 @@ enum mfd1_bar1_cells {
510 STA2X11_APB_SOC_REGS = 0, 510 STA2X11_APB_SOC_REGS = 0,
511}; 511};
512 512
513static const __devinitconst struct resource vic_resources[] = { 513static const struct resource vic_resources[] = {
514 CELL_4K(STA2X11_MFD_VIC_NAME, STA2X11_VIC), 514 CELL_4K(STA2X11_MFD_VIC_NAME, STA2X11_VIC),
515}; 515};
516 516
517static const __devinitconst struct resource apb_soc_regs_resources[] = { 517static const struct resource apb_soc_regs_resources[] = {
518 CELL_4K(STA2X11_MFD_APB_SOC_REGS_NAME, STA2X11_APB_SOC_REGS), 518 CELL_4K(STA2X11_MFD_APB_SOC_REGS_NAME, STA2X11_APB_SOC_REGS),
519}; 519};
520 520
521static __devinitdata struct mfd_cell sta2x11_mfd1_bar0[] = { 521static struct mfd_cell sta2x11_mfd1_bar0[] = {
522 DEV(STA2X11_MFD_VIC_NAME, vic_resources), 522 DEV(STA2X11_MFD_VIC_NAME, vic_resources),
523}; 523};
524 524
525static __devinitdata struct mfd_cell sta2x11_mfd1_bar1[] = { 525static struct mfd_cell sta2x11_mfd1_bar1[] = {
526 DEV(STA2X11_MFD_APB_SOC_REGS_NAME, apb_soc_regs_resources), 526 DEV(STA2X11_MFD_APB_SOC_REGS_NAME, apb_soc_regs_resources),
527}; 527};
528 528
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 5e8e6927cfc..4b11202061b 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -892,8 +892,7 @@ static struct irq_domain_ops stmpe_irq_ops = {
892 .xlate = irq_domain_xlate_twocell, 892 .xlate = irq_domain_xlate_twocell,
893}; 893};
894 894
895static int __devinit stmpe_irq_init(struct stmpe *stmpe, 895static int stmpe_irq_init(struct stmpe *stmpe, struct device_node *np)
896 struct device_node *np)
897{ 896{
898 int base = 0; 897 int base = 0;
899 int num_irqs = stmpe->variant->num_irqs; 898 int num_irqs = stmpe->variant->num_irqs;
@@ -911,7 +910,7 @@ static int __devinit stmpe_irq_init(struct stmpe *stmpe,
911 return 0; 910 return 0;
912} 911}
913 912
914static int __devinit stmpe_chip_init(struct stmpe *stmpe) 913static int stmpe_chip_init(struct stmpe *stmpe)
915{ 914{
916 unsigned int irq_trigger = stmpe->pdata->irq_trigger; 915 unsigned int irq_trigger = stmpe->pdata->irq_trigger;
917 int autosleep_timeout = stmpe->pdata->autosleep_timeout; 916 int autosleep_timeout = stmpe->pdata->autosleep_timeout;
@@ -970,14 +969,13 @@ static int __devinit stmpe_chip_init(struct stmpe *stmpe)
970 return stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_ICR_LSB], icr); 969 return stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_ICR_LSB], icr);
971} 970}
972 971
973static int __devinit stmpe_add_device(struct stmpe *stmpe, 972static int stmpe_add_device(struct stmpe *stmpe, struct mfd_cell *cell)
974 struct mfd_cell *cell)
975{ 973{
976 return mfd_add_devices(stmpe->dev, stmpe->pdata->id, cell, 1, 974 return mfd_add_devices(stmpe->dev, stmpe->pdata->id, cell, 1,
977 NULL, stmpe->irq_base, stmpe->domain); 975 NULL, stmpe->irq_base, stmpe->domain);
978} 976}
979 977
980static int __devinit stmpe_devices_init(struct stmpe *stmpe) 978static int stmpe_devices_init(struct stmpe *stmpe)
981{ 979{
982 struct stmpe_variant_info *variant = stmpe->variant; 980 struct stmpe_variant_info *variant = stmpe->variant;
983 unsigned int platform_blocks = stmpe->pdata->blocks; 981 unsigned int platform_blocks = stmpe->pdata->blocks;
@@ -1013,8 +1011,7 @@ static int __devinit stmpe_devices_init(struct stmpe *stmpe)
1013 return ret; 1011 return ret;
1014} 1012}
1015 1013
1016void __devinit stmpe_of_probe(struct stmpe_platform_data *pdata, 1014void stmpe_of_probe(struct stmpe_platform_data *pdata, struct device_node *np)
1017 struct device_node *np)
1018{ 1015{
1019 struct device_node *child; 1016 struct device_node *child;
1020 1017
@@ -1044,7 +1041,7 @@ void __devinit stmpe_of_probe(struct stmpe_platform_data *pdata,
1044} 1041}
1045 1042
1046/* Called from client specific probe routines */ 1043/* Called from client specific probe routines */
1047int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum) 1044int stmpe_probe(struct stmpe_client_info *ci, int partnum)
1048{ 1045{
1049 struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev); 1046 struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev);
1050 struct device_node *np = ci->dev->of_node; 1047 struct device_node *np = ci->dev->of_node;
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 8ca3bf023fb..e9f3fb510b4 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -58,7 +58,7 @@ static void tscadc_idle_config(struct ti_tscadc_dev *config)
58 tscadc_writel(config, REG_IDLECONFIG, idleconfig); 58 tscadc_writel(config, REG_IDLECONFIG, idleconfig);
59} 59}
60 60
61static int __devinit ti_tscadc_probe(struct platform_device *pdev) 61static int ti_tscadc_probe(struct platform_device *pdev)
62{ 62{
63 struct ti_tscadc_dev *tscadc; 63 struct ti_tscadc_dev *tscadc;
64 struct resource *res; 64 struct resource *res;
@@ -202,7 +202,7 @@ ret:
202 return err; 202 return err;
203} 203}
204 204
205static int __devexit ti_tscadc_remove(struct platform_device *pdev) 205static int ti_tscadc_remove(struct platform_device *pdev)
206{ 206{
207 struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev); 207 struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev);
208 208
@@ -263,7 +263,7 @@ static struct platform_driver ti_tscadc_driver = {
263 .pm = TSCADC_PM_OPS, 263 .pm = TSCADC_PM_OPS,
264 }, 264 },
265 .probe = ti_tscadc_probe, 265 .probe = ti_tscadc_probe,
266 .remove = __devexit_p(ti_tscadc_remove), 266 .remove = ti_tscadc_remove,
267 267
268}; 268};
269 269
diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index 10b51f7dfff..c90a2c450f5 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -269,8 +269,7 @@ static int tps80031_init_ext_control(struct tps80031 *tps80031,
269 return ret; 269 return ret;
270} 270}
271 271
272static int __devinit tps80031_irq_init(struct tps80031 *tps80031, int irq, 272static int tps80031_irq_init(struct tps80031 *tps80031, int irq, int irq_base)
273 int irq_base)
274{ 273{
275 struct device *dev = tps80031->dev; 274 struct device *dev = tps80031->dev;
276 int i, ret; 275 int i, ret;
@@ -416,8 +415,8 @@ static const struct regmap_config tps80031_regmap_configs[] = {
416 }, 415 },
417}; 416};
418 417
419static int __devinit tps80031_probe(struct i2c_client *client, 418static int tps80031_probe(struct i2c_client *client,
420 const struct i2c_device_id *id) 419 const struct i2c_device_id *id)
421{ 420{
422 struct tps80031_platform_data *pdata = client->dev.platform_data; 421 struct tps80031_platform_data *pdata = client->dev.platform_data;
423 struct tps80031 *tps80031; 422 struct tps80031 *tps80031;
@@ -519,7 +518,7 @@ fail_client_reg:
519 return ret; 518 return ret;
520} 519}
521 520
522static int __devexit tps80031_remove(struct i2c_client *client) 521static int tps80031_remove(struct i2c_client *client)
523{ 522{
524 struct tps80031 *tps80031 = i2c_get_clientdata(client); 523 struct tps80031 *tps80031 = i2c_get_clientdata(client);
525 int i; 524 int i;
@@ -553,7 +552,7 @@ static struct i2c_driver tps80031_driver = {
553 .owner = THIS_MODULE, 552 .owner = THIS_MODULE,
554 }, 553 },
555 .probe = tps80031_probe, 554 .probe = tps80031_probe,
556 .remove = __devexit_p(tps80031_remove), 555 .remove = tps80031_remove,
557 .id_table = tps80031_id_table, 556 .id_table = tps80031_id_table,
558}; 557};
559 558
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index 583be76e36a..f361bf38a0a 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -517,8 +517,8 @@ static struct regmap_irq_chip twl6040_irq_chip = {
517 .mask_base = TWL6040_REG_INTMR, 517 .mask_base = TWL6040_REG_INTMR,
518}; 518};
519 519
520static int __devinit twl6040_probe(struct i2c_client *client, 520static int twl6040_probe(struct i2c_client *client,
521 const struct i2c_device_id *id) 521 const struct i2c_device_id *id)
522{ 522{
523 struct twl6040_platform_data *pdata = client->dev.platform_data; 523 struct twl6040_platform_data *pdata = client->dev.platform_data;
524 struct device_node *node = client->dev.of_node; 524 struct device_node *node = client->dev.of_node;
@@ -699,7 +699,7 @@ err:
699 return ret; 699 return ret;
700} 700}
701 701
702static int __devexit twl6040_remove(struct i2c_client *client) 702static int twl6040_remove(struct i2c_client *client)
703{ 703{
704 struct twl6040 *twl6040 = i2c_get_clientdata(client); 704 struct twl6040 *twl6040 = i2c_get_clientdata(client);
705 705
@@ -735,7 +735,7 @@ static struct i2c_driver twl6040_driver = {
735 .owner = THIS_MODULE, 735 .owner = THIS_MODULE,
736 }, 736 },
737 .probe = twl6040_probe, 737 .probe = twl6040_probe,
738 .remove = __devexit_p(twl6040_remove), 738 .remove = twl6040_remove,
739 .id_table = twl6040_i2c_id, 739 .id_table = twl6040_i2c_id,
740}; 740};
741 741
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 733c06bd2d1..e5d8f63b252 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -414,7 +414,7 @@ static ssize_t vexpress_sysreg_sys_id_show(struct device *dev,
414 414
415DEVICE_ATTR(sys_id, S_IRUGO, vexpress_sysreg_sys_id_show, NULL); 415DEVICE_ATTR(sys_id, S_IRUGO, vexpress_sysreg_sys_id_show, NULL);
416 416
417static int __devinit vexpress_sysreg_probe(struct platform_device *pdev) 417static int vexpress_sysreg_probe(struct platform_device *pdev)
418{ 418{
419 int err; 419 int err;
420 struct resource *res = platform_get_resource(pdev, 420 struct resource *res = platform_get_resource(pdev,
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 18794aea606..e40ffd9502d 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -187,13 +187,13 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
187 wait_ret = wait_event_interruptible(dev->iamthif_cl.wait, 187 wait_ret = wait_event_interruptible(dev->iamthif_cl.wait,
188 (cb = mei_amthif_find_read_list_entry(dev, file))); 188 (cb = mei_amthif_find_read_list_entry(dev, file)));
189 189
190 /* Locking again the Mutex */
191 mutex_lock(&dev->device_lock);
192
190 if (wait_ret) 193 if (wait_ret)
191 return -ERESTARTSYS; 194 return -ERESTARTSYS;
192 195
193 dev_dbg(&dev->pdev->dev, "woke up from sleep\n"); 196 dev_dbg(&dev->pdev->dev, "woke up from sleep\n");
194
195 /* Locking again the Mutex */
196 mutex_lock(&dev->device_lock);
197 } 197 }
198 198
199 199
diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c
index 8ee0f74f937..083fcd29c9c 100644
--- a/drivers/mmc/host/dw_mmc-pci.c
+++ b/drivers/mmc/host/dw_mmc-pci.c
@@ -134,7 +134,7 @@ static struct pci_driver dw_mci_pci_driver = {
134 .name = "dw_mmc_pci", 134 .name = "dw_mmc_pci",
135 .id_table = dw_mci_pci_id, 135 .id_table = dw_mci_pci_id,
136 .probe = dw_mci_pci_probe, 136 .probe = dw_mci_pci_probe,
137 .remove = __devexit_p(dw_mci_pci_remove), 137 .remove = dw_mci_pci_remove,
138 .driver = { 138 .driver = {
139 .pm = &dw_mci_pci_pmops 139 .pm = &dw_mci_pci_pmops
140 }, 140 },
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 222036c9e05..5e1fb1d2c42 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -120,7 +120,7 @@ MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
120 120
121static struct platform_driver dw_mci_pltfm_driver = { 121static struct platform_driver dw_mci_pltfm_driver = {
122 .probe = dw_mci_pltfm_probe, 122 .probe = dw_mci_pltfm_probe,
123 .remove = __devexit_p(dw_mci_pltfm_remove), 123 .remove = dw_mci_pltfm_remove,
124 .driver = { 124 .driver = {
125 .name = "dw_mmc", 125 .name = "dw_mmc",
126 .of_match_table = of_match_ptr(dw_mci_pltfm_match), 126 .of_match_table = of_match_ptr(dw_mci_pltfm_match),
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 12b0a78497f..2592dddbd96 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -111,7 +111,7 @@ static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid)
111 return NULL; 111 return NULL;
112} 112}
113 113
114static int __devinit sdhci_acpi_probe(struct platform_device *pdev) 114static int sdhci_acpi_probe(struct platform_device *pdev)
115{ 115{
116 struct device *dev = &pdev->dev; 116 struct device *dev = &pdev->dev;
117 acpi_handle handle = ACPI_HANDLE(dev); 117 acpi_handle handle = ACPI_HANDLE(dev);
@@ -214,7 +214,7 @@ err_free:
214 return err; 214 return err;
215} 215}
216 216
217static int __devexit sdhci_acpi_remove(struct platform_device *pdev) 217static int sdhci_acpi_remove(struct platform_device *pdev)
218{ 218{
219 struct sdhci_acpi_host *c = platform_get_drvdata(pdev); 219 struct sdhci_acpi_host *c = platform_get_drvdata(pdev);
220 struct device *dev = &pdev->dev; 220 struct device *dev = &pdev->dev;
@@ -302,7 +302,7 @@ static struct platform_driver sdhci_acpi_driver = {
302 .pm = &sdhci_acpi_pm_ops, 302 .pm = &sdhci_acpi_pm_ops,
303 }, 303 },
304 .probe = sdhci_acpi_probe, 304 .probe = sdhci_acpi_probe,
305 .remove = __devexit_p(sdhci_acpi_remove), 305 .remove = sdhci_acpi_remove,
306}; 306};
307 307
308module_platform_driver(sdhci_acpi_driver); 308module_platform_driver(sdhci_acpi_driver);
diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index 5ba4605e4f8..154f0e8e931 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -766,7 +766,7 @@ static struct of_device_id wmt_mci_dt_ids[] = {
766 { /* Sentinel */ }, 766 { /* Sentinel */ },
767}; 767};
768 768
769static int __devinit wmt_mci_probe(struct platform_device *pdev) 769static int wmt_mci_probe(struct platform_device *pdev)
770{ 770{
771 struct mmc_host *mmc; 771 struct mmc_host *mmc;
772 struct wmt_mci_priv *priv; 772 struct wmt_mci_priv *priv;
@@ -892,7 +892,7 @@ fail1:
892 return ret; 892 return ret;
893} 893}
894 894
895static int __devexit wmt_mci_remove(struct platform_device *pdev) 895static int wmt_mci_remove(struct platform_device *pdev)
896{ 896{
897 struct mmc_host *mmc; 897 struct mmc_host *mmc;
898 struct wmt_mci_priv *priv; 898 struct wmt_mci_priv *priv;
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index ea7ea7b595d..945c9f76234 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -618,9 +618,8 @@ static char *otp_setup(struct mtd_info *device, char revision)
618/* 618/*
619 * Register DataFlash device with MTD subsystem. 619 * Register DataFlash device with MTD subsystem.
620 */ 620 */
621static int 621static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages,
622add_dataflash_otp(struct spi_device *spi, char *name, 622 int pagesize, int pageoffset, char revision)
623 int nr_pages, int pagesize, int pageoffset, char revision)
624{ 623{
625 struct dataflash *priv; 624 struct dataflash *priv;
626 struct mtd_info *device; 625 struct mtd_info *device;
@@ -679,9 +678,8 @@ add_dataflash_otp(struct spi_device *spi, char *name,
679 return err; 678 return err;
680} 679}
681 680
682static inline int 681static inline int add_dataflash(struct spi_device *spi, char *name,
683add_dataflash(struct spi_device *spi, char *name, 682 int nr_pages, int pagesize, int pageoffset)
684 int nr_pages, int pagesize, int pageoffset)
685{ 683{
686 return add_dataflash_otp(spi, name, nr_pages, pagesize, 684 return add_dataflash_otp(spi, name, nr_pages, pagesize,
687 pageoffset, 0); 685 pageoffset, 0);
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 2d2c2a5d4d2..2aabd96bf0f 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -757,7 +757,7 @@ err_probe:
757 757
758#ifdef CONFIG_OF 758#ifdef CONFIG_OF
759static int spear_smi_probe_config_dt(struct platform_device *pdev, 759static int spear_smi_probe_config_dt(struct platform_device *pdev,
760 struct device_node *np) 760 struct device_node *np)
761{ 761{
762 struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev); 762 struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev);
763 struct device_node *pp = NULL; 763 struct device_node *pp = NULL;
@@ -800,7 +800,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,
800} 800}
801#else 801#else
802static int spear_smi_probe_config_dt(struct platform_device *pdev, 802static int spear_smi_probe_config_dt(struct platform_device *pdev,
803 struct device_node *np) 803 struct device_node *np)
804{ 804{
805 return -ENOSYS; 805 return -ENOSYS;
806} 806}
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
index ff8681a2583..f784cf0caa1 100644
--- a/drivers/mtd/maps/esb2rom.c
+++ b/drivers/mtd/maps/esb2rom.c
@@ -145,7 +145,7 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
145} 145}
146 146
147static int esb2rom_init_one(struct pci_dev *pdev, 147static int esb2rom_init_one(struct pci_dev *pdev,
148 const struct pci_device_id *ent) 148 const struct pci_device_id *ent)
149{ 149{
150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; 150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
151 struct esb2rom_window *window = &esb2rom_window; 151 struct esb2rom_window *window = &esb2rom_window;
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c
index 3ee2ad1dcbe..b14053b2502 100644
--- a/drivers/mtd/maps/intel_vr_nor.c
+++ b/drivers/mtd/maps/intel_vr_nor.c
@@ -189,8 +189,7 @@ static void vr_nor_pci_remove(struct pci_dev *dev)
189 pci_disable_device(dev); 189 pci_disable_device(dev);
190} 190}
191 191
192static int 192static int vr_nor_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
193vr_nor_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
194{ 193{
195 struct vr_nor_mtd *p = NULL; 194 struct vr_nor_mtd *p = NULL;
196 unsigned int exp_timing_cs0; 195 unsigned int exp_timing_cs0;
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index ed82914966f..c3aebd5da5d 100644
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -253,8 +253,7 @@ static struct pci_device_id mtd_pci_ids[] = {
253 * Generic code follows. 253 * Generic code follows.
254 */ 254 */
255 255
256static int 256static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
257mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
258{ 257{
259 struct mtd_pci_info *info = (struct mtd_pci_info *)id->driver_data; 258 struct mtd_pci_info *info = (struct mtd_pci_info *)id->driver_data;
260 struct map_pci_info *map = NULL; 259 struct map_pci_info *map = NULL;
@@ -308,8 +307,7 @@ out:
308 return err; 307 return err;
309} 308}
310 309
311static void 310static void mtd_pci_remove(struct pci_dev *dev)
312mtd_pci_remove(struct pci_dev *dev)
313{ 311{
314 struct mtd_info *mtd = pci_get_drvdata(dev); 312 struct mtd_info *mtd = pci_get_drvdata(dev);
315 struct map_pci_info *map = mtd->priv; 313 struct map_pci_info *map = mtd->priv;
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 37cdc201652..67cc73c18dd 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -78,7 +78,7 @@ static int of_flash_remove(struct platform_device *dev)
78 * compatible binding, which has an extra "probe-type" property 78 * compatible binding, which has an extra "probe-type" property
79 * describing the type of flash probe necessary. */ 79 * describing the type of flash probe necessary. */
80static struct mtd_info *obsolete_probe(struct platform_device *dev, 80static struct mtd_info *obsolete_probe(struct platform_device *dev,
81 struct map_info *map) 81 struct map_info *map)
82{ 82{
83 struct device_node *dp = dev->dev.of_node; 83 struct device_node *dp = dev->dev.of_node;
84 const char *of_probe; 84 const char *of_probe;
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c
index afea93b515d..dc6df9abea0 100644
--- a/drivers/mtd/maps/pismo.c
+++ b/drivers/mtd/maps/pismo.c
@@ -66,8 +66,8 @@ static unsigned int pismo_width_to_bytes(unsigned int width)
66 return 1 << width; 66 return 1 << width;
67} 67}
68 68
69static int pismo_eeprom_read(struct i2c_client *client, void *buf, 69static int pismo_eeprom_read(struct i2c_client *client, void *buf, u8 addr,
70 u8 addr, size_t size) 70 size_t size)
71{ 71{
72 int ret; 72 int ret;
73 struct i2c_msg msg[] = { 73 struct i2c_msg msg[] = {
@@ -89,7 +89,8 @@ static int pismo_eeprom_read(struct i2c_client *client, void *buf,
89} 89}
90 90
91static int pismo_add_device(struct pismo_data *pismo, int i, 91static int pismo_add_device(struct pismo_data *pismo, int i,
92 struct pismo_mem *region, const char *name, void *pdata, size_t psize) 92 struct pismo_mem *region, const char *name,
93 void *pdata, size_t psize)
93{ 94{
94 struct platform_device *dev; 95 struct platform_device *dev;
95 struct resource res = { }; 96 struct resource res = { };
@@ -130,7 +131,7 @@ static int pismo_add_device(struct pismo_data *pismo, int i,
130} 131}
131 132
132static int pismo_add_nor(struct pismo_data *pismo, int i, 133static int pismo_add_nor(struct pismo_data *pismo, int i,
133 struct pismo_mem *region) 134 struct pismo_mem *region)
134{ 135{
135 struct physmap_flash_data data = { 136 struct physmap_flash_data data = {
136 .width = region->width, 137 .width = region->width,
@@ -144,7 +145,7 @@ static int pismo_add_nor(struct pismo_data *pismo, int i,
144} 145}
145 146
146static int pismo_add_sram(struct pismo_data *pismo, int i, 147static int pismo_add_sram(struct pismo_data *pismo, int i,
147 struct pismo_mem *region) 148 struct pismo_mem *region)
148{ 149{
149 struct platdata_mtd_ram data = { 150 struct platdata_mtd_ram data = {
150 .bankwidth = region->width, 151 .bankwidth = region->width,
@@ -155,7 +156,7 @@ static int pismo_add_sram(struct pismo_data *pismo, int i,
155} 156}
156 157
157static void pismo_add_one(struct pismo_data *pismo, int i, 158static void pismo_add_one(struct pismo_data *pismo, int i,
158 const struct pismo_cs_block *cs, phys_addr_t base) 159 const struct pismo_cs_block *cs, phys_addr_t base)
159{ 160{
160 struct device *dev = &pismo->client->dev; 161 struct device *dev = &pismo->client->dev;
161 struct pismo_mem region; 162 struct pismo_mem region;
@@ -211,7 +212,7 @@ static int pismo_remove(struct i2c_client *client)
211} 212}
212 213
213static int pismo_probe(struct i2c_client *client, 214static int pismo_probe(struct i2c_client *client,
214 const struct i2c_device_id *id) 215 const struct i2c_device_id *id)
215{ 216{
216 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 217 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
217 struct pismo_pdata *pdata = client->dev.platform_data; 218 struct pismo_pdata *pdata = client->dev.platform_data;
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c
index 71796137e97..c77b68c9412 100644
--- a/drivers/mtd/maps/scb2_flash.c
+++ b/drivers/mtd/maps/scb2_flash.c
@@ -69,8 +69,7 @@ static struct map_info scb2_map = {
69}; 69};
70static int region_fail; 70static int region_fail;
71 71
72static int 72static int scb2_fixup_mtd(struct mtd_info *mtd)
73scb2_fixup_mtd(struct mtd_info *mtd)
74{ 73{
75 int i; 74 int i;
76 int done = 0; 75 int done = 0;
@@ -133,8 +132,8 @@ scb2_fixup_mtd(struct mtd_info *mtd)
133/* CSB5's 'Function Control Register' has bits for decoding @ >= 0xffc00000 */ 132/* CSB5's 'Function Control Register' has bits for decoding @ >= 0xffc00000 */
134#define CSB5_FCR 0x41 133#define CSB5_FCR 0x41
135#define CSB5_FCR_DECODE_ALL 0x0e 134#define CSB5_FCR_DECODE_ALL 0x0e
136static int 135static int scb2_flash_probe(struct pci_dev *dev,
137scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent) 136 const struct pci_device_id *ent)
138{ 137{
139 u8 reg; 138 u8 reg;
140 139
@@ -197,8 +196,7 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
197 return 0; 196 return 0;
198} 197}
199 198
200static void 199static void scb2_flash_remove(struct pci_dev *dev)
201scb2_flash_remove(struct pci_dev *dev)
202{ 200{
203 if (!scb2_mtd) 201 if (!scb2_mtd)
204 return; 202 return;
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 90bdca61c79..c516a940808 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -338,7 +338,7 @@ static int pmecc_get_ecc_bytes(int cap, int sector_size)
338} 338}
339 339
340static void pmecc_config_ecc_layout(struct nand_ecclayout *layout, 340static void pmecc_config_ecc_layout(struct nand_ecclayout *layout,
341 int oobsize, int ecc_len) 341 int oobsize, int ecc_len)
342{ 342{
343 int i; 343 int i;
344 344
@@ -1213,7 +1213,7 @@ static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
1213 1213
1214#if defined(CONFIG_OF) 1214#if defined(CONFIG_OF)
1215static int atmel_of_init_port(struct atmel_nand_host *host, 1215static int atmel_of_init_port(struct atmel_nand_host *host,
1216 struct device_node *np) 1216 struct device_node *np)
1217{ 1217{
1218 u32 val, table_offset; 1218 u32 val, table_offset;
1219 u32 offset[2]; 1219 u32 offset[2];
@@ -1300,7 +1300,7 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
1300} 1300}
1301#else 1301#else
1302static int atmel_of_init_port(struct atmel_nand_host *host, 1302static int atmel_of_init_port(struct atmel_nand_host *host,
1303 struct device_node *np) 1303 struct device_node *np)
1304{ 1304{
1305 return -EINVAL; 1305 return -EINVAL;
1306} 1306}
diff --git a/drivers/mtd/nand/bcm47xxnflash/main.c b/drivers/mtd/nand/bcm47xxnflash/main.c
index 2b8b05bec3d..8363a9a5fa3 100644
--- a/drivers/mtd/nand/bcm47xxnflash/main.c
+++ b/drivers/mtd/nand/bcm47xxnflash/main.c
@@ -66,7 +66,7 @@ out:
66 return err; 66 return err;
67} 67}
68 68
69static int __devexit bcm47xxnflash_remove(struct platform_device *pdev) 69static int bcm47xxnflash_remove(struct platform_device *pdev)
70{ 70{
71 struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev); 71 struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev);
72 72
@@ -77,7 +77,7 @@ static int __devexit bcm47xxnflash_remove(struct platform_device *pdev)
77} 77}
78 78
79static struct platform_driver bcm47xxnflash_driver = { 79static struct platform_driver bcm47xxnflash_driver = {
80 .remove = __devexit_p(bcm47xxnflash_remove), 80 .remove = bcm47xxnflash_remove,
81 .driver = { 81 .driver = {
82 .name = "bcma_nflash", 82 .name = "bcma_nflash",
83 .owner = THIS_MODULE, 83 .owner = THIS_MODULE,
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index 5a8f5c4ce51..04e07252d74 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -153,8 +153,8 @@ static void fun_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
153} 153}
154 154
155static int fun_chip_init(struct fsl_upm_nand *fun, 155static int fun_chip_init(struct fsl_upm_nand *fun,
156 const struct device_node *upm_np, 156 const struct device_node *upm_np,
157 const struct resource *io_res) 157 const struct resource *io_res)
158{ 158{
159 int ret; 159 int ret;
160 struct device_node *flash_np; 160 struct device_node *flash_np;
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 1d7446434b0..67e62d3d495 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -865,7 +865,7 @@ static bool filter(struct dma_chan *chan, void *slave)
865 865
866#ifdef CONFIG_OF 866#ifdef CONFIG_OF
867static int fsmc_nand_probe_config_dt(struct platform_device *pdev, 867static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
868 struct device_node *np) 868 struct device_node *np)
869{ 869{
870 struct fsmc_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); 870 struct fsmc_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
871 u32 val; 871 u32 val;
@@ -887,7 +887,7 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
887} 887}
888#else 888#else
889static int fsmc_nand_probe_config_dt(struct platform_device *pdev, 889static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
890 struct device_node *np) 890 struct device_node *np)
891{ 891{
892 return -ENOSYS; 892 return -ENOSYS;
893} 893}
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 5cd141f7bfc..e9b1c47e3cf 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -319,8 +319,8 @@ int start_dma_with_bch_irq(struct gpmi_nand_data *this,
319 return 0; 319 return 0;
320} 320}
321 321
322static int 322static int acquire_register_block(struct gpmi_nand_data *this,
323acquire_register_block(struct gpmi_nand_data *this, const char *res_name) 323 const char *res_name)
324{ 324{
325 struct platform_device *pdev = this->pdev; 325 struct platform_device *pdev = this->pdev;
326 struct resources *res = &this->resources; 326 struct resources *res = &this->resources;
@@ -360,8 +360,7 @@ static void release_register_block(struct gpmi_nand_data *this)
360 res->bch_regs = NULL; 360 res->bch_regs = NULL;
361} 361}
362 362
363static int 363static int acquire_bch_irq(struct gpmi_nand_data *this, irq_handler_t irq_h)
364acquire_bch_irq(struct gpmi_nand_data *this, irq_handler_t irq_h)
365{ 364{
366 struct platform_device *pdev = this->pdev; 365 struct platform_device *pdev = this->pdev;
367 struct resources *res = &this->resources; 366 struct resources *res = &this->resources;
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index 8d415f014e1..b76460eeaf2 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -326,7 +326,8 @@ static inline void jz_nand_iounmap_resource(struct resource *res,
326static int jz_nand_detect_bank(struct platform_device *pdev, 326static int jz_nand_detect_bank(struct platform_device *pdev,
327 struct jz_nand *nand, unsigned char bank, 327 struct jz_nand *nand, unsigned char bank,
328 size_t chipnr, uint8_t *nand_maf_id, 328 size_t chipnr, uint8_t *nand_maf_id,
329 uint8_t *nand_dev_id) { 329 uint8_t *nand_dev_id)
330{
330 int ret; 331 int ret;
331 int gpio; 332 int gpio;
332 char gpio_name[9]; 333 char gpio_name[9];
diff --git a/drivers/net/ethernet/adi/Kconfig b/drivers/net/ethernet/adi/Kconfig
index e49c0eff040..a9481606bbc 100644
--- a/drivers/net/ethernet/adi/Kconfig
+++ b/drivers/net/ethernet/adi/Kconfig
@@ -61,6 +61,7 @@ config BFIN_RX_DESC_NUM
61 61
62config BFIN_MAC_USE_HWSTAMP 62config BFIN_MAC_USE_HWSTAMP
63 bool "Use IEEE 1588 hwstamp" 63 bool "Use IEEE 1588 hwstamp"
64 depends on BFIN_MAC && BF518
64 select PTP_1588_CLOCK 65 select PTP_1588_CLOCK
65 default y 66 default y
66 ---help--- 67 ---help---
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 01588b66a38..f771ddfba64 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -80,12 +80,37 @@ static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
80 new_txdata_index = new_max_eth_txqs + FCOE_TXQ_IDX_OFFSET; 80 new_txdata_index = new_max_eth_txqs + FCOE_TXQ_IDX_OFFSET;
81 } 81 }
82 82
83 memcpy(&bp->bnx2x_txq[old_txdata_index], 83 memcpy(&bp->bnx2x_txq[new_txdata_index],
84 &bp->bnx2x_txq[new_txdata_index], 84 &bp->bnx2x_txq[old_txdata_index],
85 sizeof(struct bnx2x_fp_txdata)); 85 sizeof(struct bnx2x_fp_txdata));
86 to_fp->txdata_ptr[0] = &bp->bnx2x_txq[new_txdata_index]; 86 to_fp->txdata_ptr[0] = &bp->bnx2x_txq[new_txdata_index];
87} 87}
88 88
89/**
90 * bnx2x_shrink_eth_fp - guarantees fastpath structures stay intact
91 *
92 * @bp: driver handle
93 * @delta: number of eth queues which were not allocated
94 */
95static void bnx2x_shrink_eth_fp(struct bnx2x *bp, int delta)
96{
97 int i, cos, old_eth_num = BNX2X_NUM_ETH_QUEUES(bp);
98
99 /* Queue pointer cannot be re-set on an fp-basis, as moving pointer
100 * backward along the array could cause memory to be overriden
101 */
102 for (cos = 1; cos < bp->max_cos; cos++) {
103 for (i = 0; i < old_eth_num - delta; i++) {
104 struct bnx2x_fastpath *fp = &bp->fp[i];
105 int new_idx = cos * (old_eth_num - delta) + i;
106
107 memcpy(&bp->bnx2x_txq[new_idx], fp->txdata_ptr[cos],
108 sizeof(struct bnx2x_fp_txdata));
109 fp->txdata_ptr[cos] = &bp->bnx2x_txq[new_idx];
110 }
111 }
112}
113
89int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */ 114int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */
90 115
91/* free skb in the packet ring at pos idx 116/* free skb in the packet ring at pos idx
@@ -3863,6 +3888,7 @@ int bnx2x_alloc_fp_mem(struct bnx2x *bp)
3863 int delta = BNX2X_NUM_ETH_QUEUES(bp) - i; 3888 int delta = BNX2X_NUM_ETH_QUEUES(bp) - i;
3864 3889
3865 WARN_ON(delta < 0); 3890 WARN_ON(delta < 0);
3891 bnx2x_shrink_eth_fp(bp, delta);
3866 if (CNIC_SUPPORT(bp)) 3892 if (CNIC_SUPPORT(bp))
3867 /* move non eth FPs next to last eth FP 3893 /* move non eth FPs next to last eth FP
3868 * must be done in that order 3894 * must be done in that order
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 277f17e3c8f..a427b49a886 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2777,10 +2777,10 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)
2777 } else if ((info->flow_type == UDP_V6_FLOW) && 2777 } else if ((info->flow_type == UDP_V6_FLOW) &&
2778 (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { 2778 (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) {
2779 bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested; 2779 bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested;
2780 return bnx2x_config_rss_pf(bp, &bp->rss_conf_obj, 0);
2781 DP(BNX2X_MSG_ETHTOOL, 2780 DP(BNX2X_MSG_ETHTOOL,
2782 "rss re-configured, UDP 4-tupple %s\n", 2781 "rss re-configured, UDP 4-tupple %s\n",
2783 udp_rss_requested ? "enabled" : "disabled"); 2782 udp_rss_requested ? "enabled" : "disabled");
2783 return bnx2x_config_rss_pf(bp, &bp->rss_conf_obj, 0);
2784 } else { 2784 } else {
2785 return 0; 2785 return 0;
2786 } 2786 }
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 940ef859dc6..5523da3afcd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -127,6 +127,17 @@ MODULE_PARM_DESC(debug, " Default debug msglevel");
127 127
128struct workqueue_struct *bnx2x_wq; 128struct workqueue_struct *bnx2x_wq;
129 129
130struct bnx2x_mac_vals {
131 u32 xmac_addr;
132 u32 xmac_val;
133 u32 emac_addr;
134 u32 emac_val;
135 u32 umac_addr;
136 u32 umac_val;
137 u32 bmac_addr;
138 u32 bmac_val[2];
139};
140
130enum bnx2x_board_type { 141enum bnx2x_board_type {
131 BCM57710 = 0, 142 BCM57710 = 0,
132 BCM57711, 143 BCM57711,
@@ -9420,12 +9431,19 @@ static inline void bnx2x_undi_int_disable(struct bnx2x *bp)
9420 bnx2x_undi_int_disable_e1h(bp); 9431 bnx2x_undi_int_disable_e1h(bp);
9421} 9432}
9422 9433
9423static void bnx2x_prev_unload_close_mac(struct bnx2x *bp) 9434static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
9435 struct bnx2x_mac_vals *vals)
9424{ 9436{
9425 u32 val, base_addr, offset, mask, reset_reg; 9437 u32 val, base_addr, offset, mask, reset_reg;
9426 bool mac_stopped = false; 9438 bool mac_stopped = false;
9427 u8 port = BP_PORT(bp); 9439 u8 port = BP_PORT(bp);
9428 9440
9441 /* reset addresses as they also mark which values were changed */
9442 vals->bmac_addr = 0;
9443 vals->umac_addr = 0;
9444 vals->xmac_addr = 0;
9445 vals->emac_addr = 0;
9446
9429 reset_reg = REG_RD(bp, MISC_REG_RESET_REG_2); 9447 reset_reg = REG_RD(bp, MISC_REG_RESET_REG_2);
9430 9448
9431 if (!CHIP_IS_E3(bp)) { 9449 if (!CHIP_IS_E3(bp)) {
@@ -9447,14 +9465,18 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp)
9447 */ 9465 */
9448 wb_data[0] = REG_RD(bp, base_addr + offset); 9466 wb_data[0] = REG_RD(bp, base_addr + offset);
9449 wb_data[1] = REG_RD(bp, base_addr + offset + 0x4); 9467 wb_data[1] = REG_RD(bp, base_addr + offset + 0x4);
9468 vals->bmac_addr = base_addr + offset;
9469 vals->bmac_val[0] = wb_data[0];
9470 vals->bmac_val[1] = wb_data[1];
9450 wb_data[0] &= ~BMAC_CONTROL_RX_ENABLE; 9471 wb_data[0] &= ~BMAC_CONTROL_RX_ENABLE;
9451 REG_WR(bp, base_addr + offset, wb_data[0]); 9472 REG_WR(bp, vals->bmac_addr, wb_data[0]);
9452 REG_WR(bp, base_addr + offset + 0x4, wb_data[1]); 9473 REG_WR(bp, vals->bmac_addr + 0x4, wb_data[1]);
9453 9474
9454 } 9475 }
9455 BNX2X_DEV_INFO("Disable emac Rx\n"); 9476 BNX2X_DEV_INFO("Disable emac Rx\n");
9456 REG_WR(bp, NIG_REG_NIG_EMAC0_EN + BP_PORT(bp)*4, 0); 9477 vals->emac_addr = NIG_REG_NIG_EMAC0_EN + BP_PORT(bp)*4;
9457 9478 vals->emac_val = REG_RD(bp, vals->emac_addr);
9479 REG_WR(bp, vals->emac_addr, 0);
9458 mac_stopped = true; 9480 mac_stopped = true;
9459 } else { 9481 } else {
9460 if (reset_reg & MISC_REGISTERS_RESET_REG_2_XMAC) { 9482 if (reset_reg & MISC_REGISTERS_RESET_REG_2_XMAC) {
@@ -9465,14 +9487,18 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp)
9465 val & ~(1 << 1)); 9487 val & ~(1 << 1));
9466 REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI, 9488 REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI,
9467 val | (1 << 1)); 9489 val | (1 << 1));
9468 REG_WR(bp, base_addr + XMAC_REG_CTRL, 0); 9490 vals->xmac_addr = base_addr + XMAC_REG_CTRL;
9491 vals->xmac_val = REG_RD(bp, vals->xmac_addr);
9492 REG_WR(bp, vals->xmac_addr, 0);
9469 mac_stopped = true; 9493 mac_stopped = true;
9470 } 9494 }
9471 mask = MISC_REGISTERS_RESET_REG_2_UMAC0 << port; 9495 mask = MISC_REGISTERS_RESET_REG_2_UMAC0 << port;
9472 if (mask & reset_reg) { 9496 if (mask & reset_reg) {
9473 BNX2X_DEV_INFO("Disable umac Rx\n"); 9497 BNX2X_DEV_INFO("Disable umac Rx\n");
9474 base_addr = BP_PORT(bp) ? GRCBASE_UMAC1 : GRCBASE_UMAC0; 9498 base_addr = BP_PORT(bp) ? GRCBASE_UMAC1 : GRCBASE_UMAC0;
9475 REG_WR(bp, base_addr + UMAC_REG_COMMAND_CONFIG, 0); 9499 vals->umac_addr = base_addr + UMAC_REG_COMMAND_CONFIG;
9500 vals->umac_val = REG_RD(bp, vals->umac_addr);
9501 REG_WR(bp, vals->umac_addr, 0);
9476 mac_stopped = true; 9502 mac_stopped = true;
9477 } 9503 }
9478 } 9504 }
@@ -9664,12 +9690,16 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
9664{ 9690{
9665 u32 reset_reg, tmp_reg = 0, rc; 9691 u32 reset_reg, tmp_reg = 0, rc;
9666 bool prev_undi = false; 9692 bool prev_undi = false;
9693 struct bnx2x_mac_vals mac_vals;
9694
9667 /* It is possible a previous function received 'common' answer, 9695 /* It is possible a previous function received 'common' answer,
9668 * but hasn't loaded yet, therefore creating a scenario of 9696 * but hasn't loaded yet, therefore creating a scenario of
9669 * multiple functions receiving 'common' on the same path. 9697 * multiple functions receiving 'common' on the same path.
9670 */ 9698 */
9671 BNX2X_DEV_INFO("Common unload Flow\n"); 9699 BNX2X_DEV_INFO("Common unload Flow\n");
9672 9700
9701 memset(&mac_vals, 0, sizeof(mac_vals));
9702
9673 if (bnx2x_prev_is_path_marked(bp)) 9703 if (bnx2x_prev_is_path_marked(bp))
9674 return bnx2x_prev_mcp_done(bp); 9704 return bnx2x_prev_mcp_done(bp);
9675 9705
@@ -9680,7 +9710,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
9680 u32 timer_count = 1000; 9710 u32 timer_count = 1000;
9681 9711
9682 /* Close the MAC Rx to prevent BRB from filling up */ 9712 /* Close the MAC Rx to prevent BRB from filling up */
9683 bnx2x_prev_unload_close_mac(bp); 9713 bnx2x_prev_unload_close_mac(bp, &mac_vals);
9714
9715 /* close LLH filters towards the BRB */
9716 bnx2x_set_rx_filter(&bp->link_params, 0);
9684 9717
9685 /* Check if the UNDI driver was previously loaded 9718 /* Check if the UNDI driver was previously loaded
9686 * UNDI driver initializes CID offset for normal bell to 0x7 9719 * UNDI driver initializes CID offset for normal bell to 0x7
@@ -9727,6 +9760,17 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
9727 /* No packets are in the pipeline, path is ready for reset */ 9760 /* No packets are in the pipeline, path is ready for reset */
9728 bnx2x_reset_common(bp); 9761 bnx2x_reset_common(bp);
9729 9762
9763 if (mac_vals.xmac_addr)
9764 REG_WR(bp, mac_vals.xmac_addr, mac_vals.xmac_val);
9765 if (mac_vals.umac_addr)
9766 REG_WR(bp, mac_vals.umac_addr, mac_vals.umac_val);
9767 if (mac_vals.emac_addr)
9768 REG_WR(bp, mac_vals.emac_addr, mac_vals.emac_val);
9769 if (mac_vals.bmac_addr) {
9770 REG_WR(bp, mac_vals.bmac_addr, mac_vals.bmac_val[0]);
9771 REG_WR(bp, mac_vals.bmac_addr + 4, mac_vals.bmac_val[1]);
9772 }
9773
9730 rc = bnx2x_prev_mark_path(bp, prev_undi); 9774 rc = bnx2x_prev_mark_path(bp, prev_undi);
9731 if (rc) { 9775 if (rc) {
9732 bnx2x_prev_mcp_done(bp); 9776 bnx2x_prev_mcp_done(bp);
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 3bc1912afba..4eba17b83ba 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -190,6 +190,7 @@ struct be_eq_obj {
190 190
191 u8 idx; /* array index */ 191 u8 idx; /* array index */
192 u16 tx_budget; 192 u16 tx_budget;
193 u16 spurious_intr;
193 struct napi_struct napi; 194 struct napi_struct napi;
194 struct be_adapter *adapter; 195 struct be_adapter *adapter;
195} ____cacheline_aligned_in_smp; 196} ____cacheline_aligned_in_smp;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 9dca22be812..5c995700e53 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2026,19 +2026,30 @@ static irqreturn_t be_intx(int irq, void *dev)
2026 struct be_adapter *adapter = eqo->adapter; 2026 struct be_adapter *adapter = eqo->adapter;
2027 int num_evts = 0; 2027 int num_evts = 0;
2028 2028
2029 /* On Lancer, clear-intr bit of the EQ DB does not work. 2029 /* IRQ is not expected when NAPI is scheduled as the EQ
2030 * INTx is de-asserted only on notifying num evts. 2030 * will not be armed.
2031 * But, this can happen on Lancer INTx where it takes
2032 * a while to de-assert INTx or in BE2 where occasionaly
2033 * an interrupt may be raised even when EQ is unarmed.
2034 * If NAPI is already scheduled, then counting & notifying
2035 * events will orphan them.
2031 */ 2036 */
2032 if (lancer_chip(adapter)) 2037 if (napi_schedule_prep(&eqo->napi)) {
2033 num_evts = events_get(eqo); 2038 num_evts = events_get(eqo);
2039 __napi_schedule(&eqo->napi);
2040 if (num_evts)
2041 eqo->spurious_intr = 0;
2042 }
2043 be_eq_notify(adapter, eqo->q.id, false, true, num_evts);
2034 2044
2035 /* The EQ-notify may not de-assert INTx rightaway, causing 2045 /* Return IRQ_HANDLED only for the the first spurious intr
2036 * the ISR to be invoked again. So, return HANDLED even when 2046 * after a valid intr to stop the kernel from branding
2037 * num_evts is zero. 2047 * this irq as a bad one!
2038 */ 2048 */
2039 be_eq_notify(adapter, eqo->q.id, false, true, num_evts); 2049 if (num_evts || eqo->spurious_intr++ == 0)
2040 napi_schedule(&eqo->napi); 2050 return IRQ_HANDLED;
2041 return IRQ_HANDLED; 2051 else
2052 return IRQ_NONE;
2042} 2053}
2043 2054
2044static irqreturn_t be_msix(int irq, void *dev) 2055static irqreturn_t be_msix(int irq, void *dev)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 653487dc7b5..87fa5919c45 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -1821,6 +1821,11 @@ static int nv_alloc_rx(struct net_device *dev)
1821 skb->data, 1821 skb->data,
1822 skb_tailroom(skb), 1822 skb_tailroom(skb),
1823 PCI_DMA_FROMDEVICE); 1823 PCI_DMA_FROMDEVICE);
1824 if (pci_dma_mapping_error(np->pci_dev,
1825 np->put_rx_ctx->dma)) {
1826 kfree_skb(skb);
1827 goto packet_dropped;
1828 }
1824 np->put_rx_ctx->dma_len = skb_tailroom(skb); 1829 np->put_rx_ctx->dma_len = skb_tailroom(skb);
1825 np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma); 1830 np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma);
1826 wmb(); 1831 wmb();
@@ -1830,6 +1835,7 @@ static int nv_alloc_rx(struct net_device *dev)
1830 if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx)) 1835 if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
1831 np->put_rx_ctx = np->first_rx_ctx; 1836 np->put_rx_ctx = np->first_rx_ctx;
1832 } else { 1837 } else {
1838packet_dropped:
1833 u64_stats_update_begin(&np->swstats_rx_syncp); 1839 u64_stats_update_begin(&np->swstats_rx_syncp);
1834 np->stat_rx_dropped++; 1840 np->stat_rx_dropped++;
1835 u64_stats_update_end(&np->swstats_rx_syncp); 1841 u64_stats_update_end(&np->swstats_rx_syncp);
@@ -1856,6 +1862,11 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
1856 skb->data, 1862 skb->data,
1857 skb_tailroom(skb), 1863 skb_tailroom(skb),
1858 PCI_DMA_FROMDEVICE); 1864 PCI_DMA_FROMDEVICE);
1865 if (pci_dma_mapping_error(np->pci_dev,
1866 np->put_rx_ctx->dma)) {
1867 kfree_skb(skb);
1868 goto packet_dropped;
1869 }
1859 np->put_rx_ctx->dma_len = skb_tailroom(skb); 1870 np->put_rx_ctx->dma_len = skb_tailroom(skb);
1860 np->put_rx.ex->bufhigh = cpu_to_le32(dma_high(np->put_rx_ctx->dma)); 1871 np->put_rx.ex->bufhigh = cpu_to_le32(dma_high(np->put_rx_ctx->dma));
1861 np->put_rx.ex->buflow = cpu_to_le32(dma_low(np->put_rx_ctx->dma)); 1872 np->put_rx.ex->buflow = cpu_to_le32(dma_low(np->put_rx_ctx->dma));
@@ -1866,6 +1877,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
1866 if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx)) 1877 if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
1867 np->put_rx_ctx = np->first_rx_ctx; 1878 np->put_rx_ctx = np->first_rx_ctx;
1868 } else { 1879 } else {
1880packet_dropped:
1869 u64_stats_update_begin(&np->swstats_rx_syncp); 1881 u64_stats_update_begin(&np->swstats_rx_syncp);
1870 np->stat_rx_dropped++; 1882 np->stat_rx_dropped++;
1871 u64_stats_update_end(&np->swstats_rx_syncp); 1883 u64_stats_update_end(&np->swstats_rx_syncp);
@@ -2217,6 +2229,15 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
2217 bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size; 2229 bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
2218 np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt, 2230 np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
2219 PCI_DMA_TODEVICE); 2231 PCI_DMA_TODEVICE);
2232 if (pci_dma_mapping_error(np->pci_dev,
2233 np->put_tx_ctx->dma)) {
2234 /* on DMA mapping error - drop the packet */
2235 kfree_skb(skb);
2236 u64_stats_update_begin(&np->swstats_tx_syncp);
2237 np->stat_tx_dropped++;
2238 u64_stats_update_end(&np->swstats_tx_syncp);
2239 return NETDEV_TX_OK;
2240 }
2220 np->put_tx_ctx->dma_len = bcnt; 2241 np->put_tx_ctx->dma_len = bcnt;
2221 np->put_tx_ctx->dma_single = 1; 2242 np->put_tx_ctx->dma_single = 1;
2222 put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma); 2243 put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma);
@@ -2337,6 +2358,15 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
2337 bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size; 2358 bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
2338 np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt, 2359 np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
2339 PCI_DMA_TODEVICE); 2360 PCI_DMA_TODEVICE);
2361 if (pci_dma_mapping_error(np->pci_dev,
2362 np->put_tx_ctx->dma)) {
2363 /* on DMA mapping error - drop the packet */
2364 kfree_skb(skb);
2365 u64_stats_update_begin(&np->swstats_tx_syncp);
2366 np->stat_tx_dropped++;
2367 u64_stats_update_end(&np->swstats_tx_syncp);
2368 return NETDEV_TX_OK;
2369 }
2340 np->put_tx_ctx->dma_len = bcnt; 2370 np->put_tx_ctx->dma_len = bcnt;
2341 np->put_tx_ctx->dma_single = 1; 2371 np->put_tx_ctx->dma_single = 1;
2342 put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma)); 2372 put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma));
@@ -5003,6 +5033,11 @@ static int nv_loopback_test(struct net_device *dev)
5003 test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data, 5033 test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data,
5004 skb_tailroom(tx_skb), 5034 skb_tailroom(tx_skb),
5005 PCI_DMA_FROMDEVICE); 5035 PCI_DMA_FROMDEVICE);
5036 if (pci_dma_mapping_error(np->pci_dev,
5037 test_dma_addr)) {
5038 dev_kfree_skb_any(tx_skb);
5039 goto out;
5040 }
5006 pkt_data = skb_put(tx_skb, pkt_len); 5041 pkt_data = skb_put(tx_skb, pkt_len);
5007 for (i = 0; i < pkt_len; i++) 5042 for (i = 0; i < pkt_len; i++)
5008 pkt_data[i] = (u8)(i & 0xff); 5043 pkt_data[i] = (u8)(i & 0xff);
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index f80cd975dae..3e73742024b 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -4678,7 +4678,7 @@ static int qlge_probe(struct pci_dev *pdev,
4678 qdev = netdev_priv(ndev); 4678 qdev = netdev_priv(ndev);
4679 SET_NETDEV_DEV(ndev, &pdev->dev); 4679 SET_NETDEV_DEV(ndev, &pdev->dev);
4680 ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | 4680 ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
4681 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN | 4681 NETIF_F_TSO | NETIF_F_TSO_ECN |
4682 NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM; 4682 NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM;
4683 ndev->features = ndev->hw_features | 4683 ndev->features = ndev->hw_features |
4684 NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; 4684 NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
diff --git a/drivers/net/ethernet/xilinx/Kconfig b/drivers/net/ethernet/xilinx/Kconfig
index 5778a4ae116..122d60c0481 100644
--- a/drivers/net/ethernet/xilinx/Kconfig
+++ b/drivers/net/ethernet/xilinx/Kconfig
@@ -27,7 +27,7 @@ config XILINX_EMACLITE
27 27
28config XILINX_AXI_EMAC 28config XILINX_AXI_EMAC
29 tristate "Xilinx 10/100/1000 AXI Ethernet support" 29 tristate "Xilinx 10/100/1000 AXI Ethernet support"
30 depends on (PPC32 || MICROBLAZE) 30 depends on MICROBLAZE
31 select PHYLIB 31 select PHYLIB
32 ---help--- 32 ---help---
33 This driver supports the 10/100/1000 Ethernet from Xilinx for the 33 This driver supports the 10/100/1000 Ethernet from Xilinx for the
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index d9f69b82cc4..6f47100e58d 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1590,7 +1590,7 @@ static int axienet_of_probe(struct platform_device *op)
1590 lp->rx_irq = irq_of_parse_and_map(np, 1); 1590 lp->rx_irq = irq_of_parse_and_map(np, 1);
1591 lp->tx_irq = irq_of_parse_and_map(np, 0); 1591 lp->tx_irq = irq_of_parse_and_map(np, 0);
1592 of_node_put(np); 1592 of_node_put(np);
1593 if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { 1593 if ((lp->rx_irq <= 0) || (lp->tx_irq <= 0)) {
1594 dev_err(&op->dev, "could not determine irqs\n"); 1594 dev_err(&op->dev, "could not determine irqs\n");
1595 ret = -ENOMEM; 1595 ret = -ENOMEM;
1596 goto err_iounmap_2; 1596 goto err_iounmap_2;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index fbd106edbe5..af372d0957f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -404,8 +404,8 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
404 struct tun_struct *tun; 404 struct tun_struct *tun;
405 struct net_device *dev; 405 struct net_device *dev;
406 406
407 tun = rcu_dereference_protected(tfile->tun, 407 tun = rtnl_dereference(tfile->tun);
408 lockdep_rtnl_is_held()); 408
409 if (tun) { 409 if (tun) {
410 u16 index = tfile->queue_index; 410 u16 index = tfile->queue_index;
411 BUG_ON(index >= tun->numqueues); 411 BUG_ON(index >= tun->numqueues);
@@ -414,8 +414,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
414 rcu_assign_pointer(tun->tfiles[index], 414 rcu_assign_pointer(tun->tfiles[index],
415 tun->tfiles[tun->numqueues - 1]); 415 tun->tfiles[tun->numqueues - 1]);
416 rcu_assign_pointer(tfile->tun, NULL); 416 rcu_assign_pointer(tfile->tun, NULL);
417 ntfile = rcu_dereference_protected(tun->tfiles[index], 417 ntfile = rtnl_dereference(tun->tfiles[index]);
418 lockdep_rtnl_is_held());
419 ntfile->queue_index = index; 418 ntfile->queue_index = index;
420 419
421 --tun->numqueues; 420 --tun->numqueues;
@@ -429,8 +428,10 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
429 /* Drop read queue */ 428 /* Drop read queue */
430 skb_queue_purge(&tfile->sk.sk_receive_queue); 429 skb_queue_purge(&tfile->sk.sk_receive_queue);
431 tun_set_real_num_queues(tun); 430 tun_set_real_num_queues(tun);
432 } else if (tfile->detached && clean) 431 } else if (tfile->detached && clean) {
433 tun = tun_enable_queue(tfile); 432 tun = tun_enable_queue(tfile);
433 sock_put(&tfile->sk);
434 }
434 435
435 if (clean) { 436 if (clean) {
436 if (tun && tun->numqueues == 0 && tun->numdisabled == 0 && 437 if (tun && tun->numqueues == 0 && tun->numdisabled == 0 &&
@@ -458,8 +459,7 @@ static void tun_detach_all(struct net_device *dev)
458 int i, n = tun->numqueues; 459 int i, n = tun->numqueues;
459 460
460 for (i = 0; i < n; i++) { 461 for (i = 0; i < n; i++) {
461 tfile = rcu_dereference_protected(tun->tfiles[i], 462 tfile = rtnl_dereference(tun->tfiles[i]);
462 lockdep_rtnl_is_held());
463 BUG_ON(!tfile); 463 BUG_ON(!tfile);
464 wake_up_all(&tfile->wq.wait); 464 wake_up_all(&tfile->wq.wait);
465 rcu_assign_pointer(tfile->tun, NULL); 465 rcu_assign_pointer(tfile->tun, NULL);
@@ -469,8 +469,7 @@ static void tun_detach_all(struct net_device *dev)
469 469
470 synchronize_net(); 470 synchronize_net();
471 for (i = 0; i < n; i++) { 471 for (i = 0; i < n; i++) {
472 tfile = rcu_dereference_protected(tun->tfiles[i], 472 tfile = rtnl_dereference(tun->tfiles[i]);
473 lockdep_rtnl_is_held());
474 /* Drop read queue */ 473 /* Drop read queue */
475 skb_queue_purge(&tfile->sk.sk_receive_queue); 474 skb_queue_purge(&tfile->sk.sk_receive_queue);
476 sock_put(&tfile->sk); 475 sock_put(&tfile->sk);
@@ -481,6 +480,9 @@ static void tun_detach_all(struct net_device *dev)
481 sock_put(&tfile->sk); 480 sock_put(&tfile->sk);
482 } 481 }
483 BUG_ON(tun->numdisabled != 0); 482 BUG_ON(tun->numdisabled != 0);
483
484 if (tun->flags & TUN_PERSIST)
485 module_put(THIS_MODULE);
484} 486}
485 487
486static int tun_attach(struct tun_struct *tun, struct file *file) 488static int tun_attach(struct tun_struct *tun, struct file *file)
@@ -489,7 +491,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
489 int err; 491 int err;
490 492
491 err = -EINVAL; 493 err = -EINVAL;
492 if (rcu_dereference_protected(tfile->tun, lockdep_rtnl_is_held())) 494 if (rtnl_dereference(tfile->tun))
493 goto out; 495 goto out;
494 496
495 err = -EBUSY; 497 err = -EBUSY;
@@ -1544,6 +1546,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1544 struct net_device *dev; 1546 struct net_device *dev;
1545 int err; 1547 int err;
1546 1548
1549 if (tfile->detached)
1550 return -EINVAL;
1551
1547 dev = __dev_get_by_name(net, ifr->ifr_name); 1552 dev = __dev_get_by_name(net, ifr->ifr_name);
1548 if (dev) { 1553 if (dev) {
1549 if (ifr->ifr_flags & IFF_TUN_EXCL) 1554 if (ifr->ifr_flags & IFF_TUN_EXCL)
@@ -1738,8 +1743,7 @@ static void tun_detach_filter(struct tun_struct *tun, int n)
1738 struct tun_file *tfile; 1743 struct tun_file *tfile;
1739 1744
1740 for (i = 0; i < n; i++) { 1745 for (i = 0; i < n; i++) {
1741 tfile = rcu_dereference_protected(tun->tfiles[i], 1746 tfile = rtnl_dereference(tun->tfiles[i]);
1742 lockdep_rtnl_is_held());
1743 sk_detach_filter(tfile->socket.sk); 1747 sk_detach_filter(tfile->socket.sk);
1744 } 1748 }
1745 1749
@@ -1752,8 +1756,7 @@ static int tun_attach_filter(struct tun_struct *tun)
1752 struct tun_file *tfile; 1756 struct tun_file *tfile;
1753 1757
1754 for (i = 0; i < tun->numqueues; i++) { 1758 for (i = 0; i < tun->numqueues; i++) {
1755 tfile = rcu_dereference_protected(tun->tfiles[i], 1759 tfile = rtnl_dereference(tun->tfiles[i]);
1756 lockdep_rtnl_is_held());
1757 ret = sk_attach_filter(&tun->fprog, tfile->socket.sk); 1760 ret = sk_attach_filter(&tun->fprog, tfile->socket.sk);
1758 if (ret) { 1761 if (ret) {
1759 tun_detach_filter(tun, i); 1762 tun_detach_filter(tun, i);
@@ -1771,8 +1774,7 @@ static void tun_set_sndbuf(struct tun_struct *tun)
1771 int i; 1774 int i;
1772 1775
1773 for (i = 0; i < tun->numqueues; i++) { 1776 for (i = 0; i < tun->numqueues; i++) {
1774 tfile = rcu_dereference_protected(tun->tfiles[i], 1777 tfile = rtnl_dereference(tun->tfiles[i]);
1775 lockdep_rtnl_is_held());
1776 tfile->socket.sk->sk_sndbuf = tun->sndbuf; 1778 tfile->socket.sk->sk_sndbuf = tun->sndbuf;
1777 } 1779 }
1778} 1780}
@@ -1789,13 +1791,10 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
1789 tun = tfile->detached; 1791 tun = tfile->detached;
1790 if (!tun) 1792 if (!tun)
1791 ret = -EINVAL; 1793 ret = -EINVAL;
1792 else if (tun_not_capable(tun))
1793 ret = -EPERM;
1794 else 1794 else
1795 ret = tun_attach(tun, file); 1795 ret = tun_attach(tun, file);
1796 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { 1796 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
1797 tun = rcu_dereference_protected(tfile->tun, 1797 tun = rtnl_dereference(tfile->tun);
1798 lockdep_rtnl_is_held());
1799 if (!tun || !(tun->flags & TUN_TAP_MQ)) 1798 if (!tun || !(tun->flags & TUN_TAP_MQ))
1800 ret = -EINVAL; 1799 ret = -EINVAL;
1801 else 1800 else
@@ -1880,10 +1879,11 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
1880 /* Disable/Enable persist mode. Keep an extra reference to the 1879 /* Disable/Enable persist mode. Keep an extra reference to the
1881 * module to prevent the module being unprobed. 1880 * module to prevent the module being unprobed.
1882 */ 1881 */
1883 if (arg) { 1882 if (arg && !(tun->flags & TUN_PERSIST)) {
1884 tun->flags |= TUN_PERSIST; 1883 tun->flags |= TUN_PERSIST;
1885 __module_get(THIS_MODULE); 1884 __module_get(THIS_MODULE);
1886 } else { 1885 }
1886 if (!arg && (tun->flags & TUN_PERSIST)) {
1887 tun->flags &= ~TUN_PERSIST; 1887 tun->flags &= ~TUN_PERSIST;
1888 module_put(THIS_MODULE); 1888 module_put(THIS_MODULE);
1889 } 1889 }
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 91d7cb9728e..6a1ca500e61 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -458,6 +458,7 @@ static const struct usb_device_id products[] = {
458 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ 458 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
459 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */ 459 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
460 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */ 460 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
461 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
461 462
462 /* 4. Gobi 1000 devices */ 463 /* 4. Gobi 1000 devices */
463 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 464 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 40f2cc135a4..656230e0d18 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1191,6 +1191,7 @@ static void vxlan_setup(struct net_device *dev)
1191 1191
1192 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM; 1192 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
1193 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 1193 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1194 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
1194 1195
1195 spin_lock_init(&vxlan->hash_lock); 1196 spin_lock_init(&vxlan->hash_lock);
1196 1197
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig
index 1a67a4f829f..2c02b4e8409 100644
--- a/drivers/net/wireless/ath/Kconfig
+++ b/drivers/net/wireless/ath/Kconfig
@@ -30,5 +30,6 @@ source "drivers/net/wireless/ath/ath9k/Kconfig"
30source "drivers/net/wireless/ath/carl9170/Kconfig" 30source "drivers/net/wireless/ath/carl9170/Kconfig"
31source "drivers/net/wireless/ath/ath6kl/Kconfig" 31source "drivers/net/wireless/ath/ath6kl/Kconfig"
32source "drivers/net/wireless/ath/ar5523/Kconfig" 32source "drivers/net/wireless/ath/ar5523/Kconfig"
33source "drivers/net/wireless/ath/wil6210/Kconfig"
33 34
34endif 35endif
diff --git a/drivers/net/wireless/ath/Makefile b/drivers/net/wireless/ath/Makefile
index 1e18621326d..97b964ded2b 100644
--- a/drivers/net/wireless/ath/Makefile
+++ b/drivers/net/wireless/ath/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_ATH9K_HW) += ath9k/
3obj-$(CONFIG_CARL9170) += carl9170/ 3obj-$(CONFIG_CARL9170) += carl9170/
4obj-$(CONFIG_ATH6KL) += ath6kl/ 4obj-$(CONFIG_ATH6KL) += ath6kl/
5obj-$(CONFIG_AR5523) += ar5523/ 5obj-$(CONFIG_AR5523) += ar5523/
6obj-$(CONFIG_WIL6210) += wil6210/
6 7
7obj-$(CONFIG_ATH_COMMON) += ath.o 8obj-$(CONFIG_ATH_COMMON) += ath.o
8 9
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index 5fc15bf8be0..7647ed6b73d 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -2,6 +2,7 @@ config ATH9K_HW
2 tristate 2 tristate
3config ATH9K_COMMON 3config ATH9K_COMMON
4 tristate 4 tristate
5 select ATH_COMMON
5config ATH9K_DFS_DEBUGFS 6config ATH9K_DFS_DEBUGFS
6 def_bool y 7 def_bool y
7 depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED 8 depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED
@@ -17,7 +18,6 @@ config ATH9K_BTCOEX_SUPPORT
17config ATH9K 18config ATH9K
18 tristate "Atheros 802.11n wireless cards support" 19 tristate "Atheros 802.11n wireless cards support"
19 depends on MAC80211 20 depends on MAC80211
20 select ATH_COMMON
21 select ATH9K_HW 21 select ATH9K_HW
22 select MAC80211_LEDS 22 select MAC80211_LEDS
23 select LEDS_CLASS 23 select LEDS_CLASS
@@ -56,7 +56,8 @@ config ATH9K_AHB
56 56
57config ATH9K_DEBUGFS 57config ATH9K_DEBUGFS
58 bool "Atheros ath9k debugging" 58 bool "Atheros ath9k debugging"
59 depends on ATH9K && DEBUG_FS 59 depends on ATH9K
60 select MAC80211_DEBUGFS
60 ---help--- 61 ---help---
61 Say Y, if you need access to ath9k's statistics for 62 Say Y, if you need access to ath9k's statistics for
62 interrupts, rate control, etc. 63 interrupts, rate control, etc.
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 74fd3977fee..59bf5f31e21 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -544,7 +544,7 @@ static void ar9003_rx_gain_table_mode0(struct ath_hw *ah)
544 ar9340Common_rx_gain_table_1p0); 544 ar9340Common_rx_gain_table_1p0);
545 else if (AR_SREV_9485_11(ah)) 545 else if (AR_SREV_9485_11(ah))
546 INIT_INI_ARRAY(&ah->iniModesRxGain, 546 INIT_INI_ARRAY(&ah->iniModesRxGain,
547 ar9485Common_wo_xlna_rx_gain_1_1); 547 ar9485_common_rx_gain_1_1);
548 else if (AR_SREV_9550(ah)) { 548 else if (AR_SREV_9550(ah)) {
549 INIT_INI_ARRAY(&ah->iniModesRxGain, 549 INIT_INI_ARRAY(&ah->iniModesRxGain,
550 ar955x_1p0_common_rx_gain_table); 550 ar955x_1p0_common_rx_gain_table);
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c
index aaebecd19e5..63fd9af3fd3 100644
--- a/drivers/net/wireless/ath/carl9170/fw.c
+++ b/drivers/net/wireless/ath/carl9170/fw.c
@@ -336,8 +336,12 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
336 if (SUPP(CARL9170FW_WLANTX_CAB)) { 336 if (SUPP(CARL9170FW_WLANTX_CAB)) {
337 if_comb_types |= 337 if_comb_types |=
338 BIT(NL80211_IFTYPE_AP) | 338 BIT(NL80211_IFTYPE_AP) |
339 BIT(NL80211_IFTYPE_MESH_POINT) |
340 BIT(NL80211_IFTYPE_P2P_GO); 339 BIT(NL80211_IFTYPE_P2P_GO);
340
341#ifdef CONFIG_MAC80211_MESH
342 if_comb_types |=
343 BIT(NL80211_IFTYPE_MESH_POINT);
344#endif /* CONFIG_MAC80211_MESH */
341 } 345 }
342 } 346 }
343 347
diff --git a/drivers/net/wireless/ath/wil6210/Kconfig b/drivers/net/wireless/ath/wil6210/Kconfig
new file mode 100644
index 00000000000..bac3d98a0cf
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/Kconfig
@@ -0,0 +1,29 @@
1config WIL6210
2 tristate "Wilocity 60g WiFi card wil6210 support"
3 depends on CFG80211
4 depends on PCI
5 default n
6 ---help---
7 This module adds support for wireless adapter based on
8 wil6210 chip by Wilocity. It supports operation on the
9 60 GHz band, covered by the IEEE802.11ad standard.
10
11 http://wireless.kernel.org/en/users/Drivers/wil6210
12
13 If you choose to build it as a module, it will be called
14 wil6210
15
16config WIL6210_ISR_COR
17 bool "Use Clear-On-Read mode for ISR registers for wil6210"
18 depends on WIL6210
19 default y
20 ---help---
21 ISR registers on wil6210 chip may operate in either
22 COR (Clear-On-Read) or W1C (Write-1-to-Clear) mode.
23 For production code, use COR (say y); is default since
24 it saves extra target transaction;
25 For ISR debug, use W1C (say n); is allows to monitor ISR
26 registers with debugfs. If COR were used, ISR would
27 self-clear when accessed for debug purposes, it makes
28 such monitoring impossible.
29 Say y unless you debug interrupts
diff --git a/drivers/net/wireless/ath/wil6210/Makefile b/drivers/net/wireless/ath/wil6210/Makefile
new file mode 100644
index 00000000000..9396dc9fe3c
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -0,0 +1,13 @@
1obj-$(CONFIG_WIL6210) += wil6210.o
2
3wil6210-objs := main.o
4wil6210-objs += netdev.o
5wil6210-objs += cfg80211.o
6wil6210-objs += pcie_bus.o
7wil6210-objs += debugfs.o
8wil6210-objs += wmi.o
9wil6210-objs += interrupt.o
10wil6210-objs += txrx.o
11
12subdir-ccflags-y += -Werror
13subdir-ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
new file mode 100644
index 00000000000..116f4e807ae
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -0,0 +1,573 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/kernel.h>
18#include <linux/netdevice.h>
19#include <linux/sched.h>
20#include <linux/etherdevice.h>
21#include <linux/wireless.h>
22#include <linux/ieee80211.h>
23#include <linux/slab.h>
24#include <linux/version.h>
25#include <net/cfg80211.h>
26
27#include "wil6210.h"
28#include "wmi.h"
29
30#define CHAN60G(_channel, _flags) { \
31 .band = IEEE80211_BAND_60GHZ, \
32 .center_freq = 56160 + (2160 * (_channel)), \
33 .hw_value = (_channel), \
34 .flags = (_flags), \
35 .max_antenna_gain = 0, \
36 .max_power = 40, \
37}
38
39static struct ieee80211_channel wil_60ghz_channels[] = {
40 CHAN60G(1, 0),
41 CHAN60G(2, 0),
42 CHAN60G(3, 0),
43/* channel 4 not supported yet */
44};
45
46static struct ieee80211_supported_band wil_band_60ghz = {
47 .channels = wil_60ghz_channels,
48 .n_channels = ARRAY_SIZE(wil_60ghz_channels),
49 .ht_cap = {
50 .ht_supported = true,
51 .cap = 0, /* TODO */
52 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, /* TODO */
53 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_8, /* TODO */
54 .mcs = {
55 /* MCS 1..12 - SC PHY */
56 .rx_mask = {0xfe, 0x1f}, /* 1..12 */
57 .tx_params = IEEE80211_HT_MCS_TX_DEFINED, /* TODO */
58 },
59 },
60};
61
62static const struct ieee80211_txrx_stypes
63wil_mgmt_stypes[NUM_NL80211_IFTYPES] = {
64 [NL80211_IFTYPE_STATION] = {
65 .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
66 BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
67 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
68 BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
69 },
70 [NL80211_IFTYPE_AP] = {
71 .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
72 BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
73 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
74 BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
75 },
76 [NL80211_IFTYPE_P2P_CLIENT] = {
77 .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
78 BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
79 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
80 BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
81 },
82 [NL80211_IFTYPE_P2P_GO] = {
83 .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
84 BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
85 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
86 BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
87 },
88};
89
90static const u32 wil_cipher_suites[] = {
91 WLAN_CIPHER_SUITE_GCMP,
92};
93
94int wil_iftype_nl2wmi(enum nl80211_iftype type)
95{
96 static const struct {
97 enum nl80211_iftype nl;
98 enum wmi_network_type wmi;
99 } __nl2wmi[] = {
100 {NL80211_IFTYPE_ADHOC, WMI_NETTYPE_ADHOC},
101 {NL80211_IFTYPE_STATION, WMI_NETTYPE_INFRA},
102 {NL80211_IFTYPE_AP, WMI_NETTYPE_AP},
103 {NL80211_IFTYPE_P2P_CLIENT, WMI_NETTYPE_P2P},
104 {NL80211_IFTYPE_P2P_GO, WMI_NETTYPE_P2P},
105 {NL80211_IFTYPE_MONITOR, WMI_NETTYPE_ADHOC}, /* FIXME */
106 };
107 uint i;
108
109 for (i = 0; i < ARRAY_SIZE(__nl2wmi); i++) {
110 if (__nl2wmi[i].nl == type)
111 return __nl2wmi[i].wmi;
112 }
113
114 return -EOPNOTSUPP;
115}
116
117static int wil_cfg80211_get_station(struct wiphy *wiphy,
118 struct net_device *ndev,
119 u8 *mac, struct station_info *sinfo)
120{
121 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
122 int rc;
123 struct wmi_notify_req_cmd cmd = {
124 .cid = 0,
125 .interval_usec = 0,
126 };
127
128 if (memcmp(mac, wil->dst_addr[0], ETH_ALEN))
129 return -ENOENT;
130
131 /* WMI_NOTIFY_REQ_DONE_EVENTID handler fills wil->stats.bf_mcs */
132 rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, &cmd, sizeof(cmd),
133 WMI_NOTIFY_REQ_DONE_EVENTID, NULL, 0, 20);
134 if (rc)
135 return rc;
136
137 sinfo->generation = wil->sinfo_gen;
138
139 sinfo->filled |= STATION_INFO_TX_BITRATE;
140 sinfo->txrate.flags = RATE_INFO_FLAGS_MCS | RATE_INFO_FLAGS_60G;
141 sinfo->txrate.mcs = wil->stats.bf_mcs;
142 sinfo->filled |= STATION_INFO_RX_BITRATE;
143 sinfo->rxrate.flags = RATE_INFO_FLAGS_MCS | RATE_INFO_FLAGS_60G;
144 sinfo->rxrate.mcs = wil->stats.last_mcs_rx;
145
146 if (test_bit(wil_status_fwconnected, &wil->status)) {
147 sinfo->filled |= STATION_INFO_SIGNAL;
148 sinfo->signal = 12; /* TODO: provide real value */
149 }
150
151 return 0;
152}
153
154static int wil_cfg80211_change_iface(struct wiphy *wiphy,
155 struct net_device *ndev,
156 enum nl80211_iftype type, u32 *flags,
157 struct vif_params *params)
158{
159 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
160 struct wireless_dev *wdev = wil->wdev;
161
162 switch (type) {
163 case NL80211_IFTYPE_STATION:
164 case NL80211_IFTYPE_AP:
165 case NL80211_IFTYPE_P2P_CLIENT:
166 case NL80211_IFTYPE_P2P_GO:
167 break;
168 case NL80211_IFTYPE_MONITOR:
169 if (flags)
170 wil->monitor_flags = *flags;
171 else
172 wil->monitor_flags = 0;
173
174 break;
175 default:
176 return -EOPNOTSUPP;
177 }
178
179 wdev->iftype = type;
180
181 return 0;
182}
183
184static int wil_cfg80211_scan(struct wiphy *wiphy,
185 struct cfg80211_scan_request *request)
186{
187 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
188 struct wireless_dev *wdev = wil->wdev;
189 struct {
190 struct wmi_start_scan_cmd cmd;
191 u16 chnl[4];
192 } __packed cmd;
193 uint i, n;
194
195 if (wil->scan_request) {
196 wil_err(wil, "Already scanning\n");
197 return -EAGAIN;
198 }
199
200 /* check we are client side */
201 switch (wdev->iftype) {
202 case NL80211_IFTYPE_STATION:
203 case NL80211_IFTYPE_P2P_CLIENT:
204 break;
205 default:
206 return -EOPNOTSUPP;
207
208 }
209
210 /* FW don't support scan after connection attempt */
211 if (test_bit(wil_status_dontscan, &wil->status)) {
212 wil_err(wil, "Scan after connect attempt not supported\n");
213 return -EBUSY;
214 }
215
216 wil->scan_request = request;
217
218 memset(&cmd, 0, sizeof(cmd));
219 cmd.cmd.num_channels = 0;
220 n = min(request->n_channels, 4U);
221 for (i = 0; i < n; i++) {
222 int ch = request->channels[i]->hw_value;
223 if (ch == 0) {
224 wil_err(wil,
225 "Scan requested for unknown frequency %dMhz\n",
226 request->channels[i]->center_freq);
227 continue;
228 }
229 /* 0-based channel indexes */
230 cmd.cmd.channel_list[cmd.cmd.num_channels++].channel = ch - 1;
231 wil_dbg(wil, "Scan for ch %d : %d MHz\n", ch,
232 request->channels[i]->center_freq);
233 }
234
235 return wmi_send(wil, WMI_START_SCAN_CMDID, &cmd, sizeof(cmd.cmd) +
236 cmd.cmd.num_channels * sizeof(cmd.cmd.channel_list[0]));
237}
238
239static int wil_cfg80211_connect(struct wiphy *wiphy,
240 struct net_device *ndev,
241 struct cfg80211_connect_params *sme)
242{
243 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
244 struct cfg80211_bss *bss;
245 struct wmi_connect_cmd conn;
246 const u8 *ssid_eid;
247 const u8 *rsn_eid;
248 int ch;
249 int rc = 0;
250
251 bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
252 sme->ssid, sme->ssid_len,
253 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
254 if (!bss) {
255 wil_err(wil, "Unable to find BSS\n");
256 return -ENOENT;
257 }
258
259 ssid_eid = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
260 if (!ssid_eid) {
261 wil_err(wil, "No SSID\n");
262 rc = -ENOENT;
263 goto out;
264 }
265
266 rsn_eid = sme->ie ?
267 cfg80211_find_ie(WLAN_EID_RSN, sme->ie, sme->ie_len) :
268 NULL;
269 if (rsn_eid) {
270 if (sme->ie_len > WMI_MAX_IE_LEN) {
271 rc = -ERANGE;
272 wil_err(wil, "IE too large (%td bytes)\n",
273 sme->ie_len);
274 goto out;
275 }
276 /*
277 * For secure assoc, send:
278 * (1) WMI_DELETE_CIPHER_KEY_CMD
279 * (2) WMI_SET_APPIE_CMD
280 */
281 rc = wmi_del_cipher_key(wil, 0, bss->bssid);
282 if (rc) {
283 wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD failed\n");
284 goto out;
285 }
286 /* WMI_SET_APPIE_CMD */
287 rc = wmi_set_ie(wil, WMI_FRAME_ASSOC_REQ, sme->ie_len, sme->ie);
288 if (rc) {
289 wil_err(wil, "WMI_SET_APPIE_CMD failed\n");
290 goto out;
291 }
292 }
293
294 /* WMI_CONNECT_CMD */
295 memset(&conn, 0, sizeof(conn));
296 switch (bss->capability & 0x03) {
297 case WLAN_CAPABILITY_DMG_TYPE_AP:
298 conn.network_type = WMI_NETTYPE_INFRA;
299 break;
300 case WLAN_CAPABILITY_DMG_TYPE_PBSS:
301 conn.network_type = WMI_NETTYPE_P2P;
302 break;
303 default:
304 wil_err(wil, "Unsupported BSS type, capability= 0x%04x\n",
305 bss->capability);
306 goto out;
307 }
308 if (rsn_eid) {
309 conn.dot11_auth_mode = WMI_AUTH11_SHARED;
310 conn.auth_mode = WMI_AUTH_WPA2_PSK;
311 conn.pairwise_crypto_type = WMI_CRYPT_AES_GCMP;
312 conn.pairwise_crypto_len = 16;
313 } else {
314 conn.dot11_auth_mode = WMI_AUTH11_OPEN;
315 conn.auth_mode = WMI_AUTH_NONE;
316 }
317
318 conn.ssid_len = min_t(u8, ssid_eid[1], 32);
319 memcpy(conn.ssid, ssid_eid+2, conn.ssid_len);
320
321 ch = bss->channel->hw_value;
322 if (ch == 0) {
323 wil_err(wil, "BSS at unknown frequency %dMhz\n",
324 bss->channel->center_freq);
325 rc = -EOPNOTSUPP;
326 goto out;
327 }
328 conn.channel = ch - 1;
329
330 memcpy(conn.bssid, bss->bssid, 6);
331 memcpy(conn.dst_mac, bss->bssid, 6);
332 /*
333 * FW don't support scan after connection attempt
334 */
335 set_bit(wil_status_dontscan, &wil->status);
336
337 rc = wmi_send(wil, WMI_CONNECT_CMDID, &conn, sizeof(conn));
338 if (rc == 0) {
339 /* Connect can take lots of time */
340 mod_timer(&wil->connect_timer,
341 jiffies + msecs_to_jiffies(2000));
342 }
343
344 out:
345 cfg80211_put_bss(bss);
346
347 return rc;
348}
349
350static int wil_cfg80211_disconnect(struct wiphy *wiphy,
351 struct net_device *ndev,
352 u16 reason_code)
353{
354 int rc;
355 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
356
357 rc = wmi_send(wil, WMI_DISCONNECT_CMDID, NULL, 0);
358
359 return rc;
360}
361
362static int wil_cfg80211_set_channel(struct wiphy *wiphy,
363 struct cfg80211_chan_def *chandef)
364{
365 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
366 struct wireless_dev *wdev = wil->wdev;
367
368 wdev->preset_chandef = *chandef;
369
370 return 0;
371}
372
373static int wil_cfg80211_add_key(struct wiphy *wiphy,
374 struct net_device *ndev,
375 u8 key_index, bool pairwise,
376 const u8 *mac_addr,
377 struct key_params *params)
378{
379 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
380
381 /* group key is not used */
382 if (!pairwise)
383 return 0;
384
385 return wmi_add_cipher_key(wil, key_index, mac_addr,
386 params->key_len, params->key);
387}
388
389static int wil_cfg80211_del_key(struct wiphy *wiphy,
390 struct net_device *ndev,
391 u8 key_index, bool pairwise,
392 const u8 *mac_addr)
393{
394 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
395
396 /* group key is not used */
397 if (!pairwise)
398 return 0;
399
400 return wmi_del_cipher_key(wil, key_index, mac_addr);
401}
402
403/* Need to be present or wiphy_new() will WARN */
404static int wil_cfg80211_set_default_key(struct wiphy *wiphy,
405 struct net_device *ndev,
406 u8 key_index, bool unicast,
407 bool multicast)
408{
409 return 0;
410}
411
412static int wil_cfg80211_start_ap(struct wiphy *wiphy,
413 struct net_device *ndev,
414 struct cfg80211_ap_settings *info)
415{
416 int rc = 0;
417 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
418 struct wireless_dev *wdev = ndev->ieee80211_ptr;
419 struct ieee80211_channel *channel = info->chandef.chan;
420 struct cfg80211_beacon_data *bcon = &info->beacon;
421 u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
422
423 if (!channel) {
424 wil_err(wil, "AP: No channel???\n");
425 return -EINVAL;
426 }
427
428 wil_dbg(wil, "AP on Channel %d %d MHz, %s\n", channel->hw_value,
429 channel->center_freq, info->privacy ? "secure" : "open");
430 print_hex_dump_bytes("SSID ", DUMP_PREFIX_OFFSET,
431 info->ssid, info->ssid_len);
432
433 rc = wil_reset(wil);
434 if (rc)
435 return rc;
436
437 rc = wmi_set_ssid(wil, info->ssid_len, info->ssid);
438 if (rc)
439 return rc;
440
441 rc = wmi_set_channel(wil, channel->hw_value);
442 if (rc)
443 return rc;
444
445 /* MAC address - pre-requisite for other commands */
446 wmi_set_mac_address(wil, ndev->dev_addr);
447
448 /* IE's */
449 /* bcon 'head IE's are not relevant for 60g band */
450 wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
451 bcon->beacon_ies);
452 wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, bcon->proberesp_ies_len,
453 bcon->proberesp_ies);
454 wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP, bcon->assocresp_ies_len,
455 bcon->assocresp_ies);
456
457 wil->secure_pcp = info->privacy;
458
459 rc = wmi_set_bcon(wil, info->beacon_interval, wmi_nettype);
460 if (rc)
461 return rc;
462
463 /* Rx VRING. After MAC and beacon */
464 rc = wil_rx_init(wil);
465
466 netif_carrier_on(ndev);
467
468 return rc;
469}
470
471static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
472 struct net_device *ndev)
473{
474 int rc = 0;
475 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
476 struct wireless_dev *wdev = ndev->ieee80211_ptr;
477 u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
478
479 /* To stop beaconing, set BI to 0 */
480 rc = wmi_set_bcon(wil, 0, wmi_nettype);
481
482 return rc;
483}
484
485static struct cfg80211_ops wil_cfg80211_ops = {
486 .scan = wil_cfg80211_scan,
487 .connect = wil_cfg80211_connect,
488 .disconnect = wil_cfg80211_disconnect,
489 .change_virtual_intf = wil_cfg80211_change_iface,
490 .get_station = wil_cfg80211_get_station,
491 .set_monitor_channel = wil_cfg80211_set_channel,
492 .add_key = wil_cfg80211_add_key,
493 .del_key = wil_cfg80211_del_key,
494 .set_default_key = wil_cfg80211_set_default_key,
495 /* AP mode */
496 .start_ap = wil_cfg80211_start_ap,
497 .stop_ap = wil_cfg80211_stop_ap,
498};
499
500static void wil_wiphy_init(struct wiphy *wiphy)
501{
502 /* TODO: set real value */
503 wiphy->max_scan_ssids = 10;
504 wiphy->max_num_pmkids = 0 /* TODO: */;
505 wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
506 BIT(NL80211_IFTYPE_AP) |
507 BIT(NL80211_IFTYPE_MONITOR);
508 /* TODO: enable P2P when integrated with supplicant:
509 * BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO)
510 */
511 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
512 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
513 dev_warn(wiphy_dev(wiphy), "%s : flags = 0x%08x\n",
514 __func__, wiphy->flags);
515 wiphy->probe_resp_offload =
516 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
517 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 |
518 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
519
520 wiphy->bands[IEEE80211_BAND_60GHZ] = &wil_band_60ghz;
521
522 /* TODO: figure this out */
523 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
524
525 wiphy->cipher_suites = wil_cipher_suites;
526 wiphy->n_cipher_suites = ARRAY_SIZE(wil_cipher_suites);
527 wiphy->mgmt_stypes = wil_mgmt_stypes;
528}
529
530struct wireless_dev *wil_cfg80211_init(struct device *dev)
531{
532 int rc = 0;
533 struct wireless_dev *wdev;
534
535 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
536 if (!wdev)
537 return ERR_PTR(-ENOMEM);
538
539 wdev->wiphy = wiphy_new(&wil_cfg80211_ops,
540 sizeof(struct wil6210_priv));
541 if (!wdev->wiphy) {
542 rc = -ENOMEM;
543 goto out;
544 }
545
546 set_wiphy_dev(wdev->wiphy, dev);
547 wil_wiphy_init(wdev->wiphy);
548
549 rc = wiphy_register(wdev->wiphy);
550 if (rc < 0)
551 goto out_failed_reg;
552
553 return wdev;
554
555out_failed_reg:
556 wiphy_free(wdev->wiphy);
557out:
558 kfree(wdev);
559
560 return ERR_PTR(rc);
561}
562
563void wil_wdev_free(struct wil6210_priv *wil)
564{
565 struct wireless_dev *wdev = wil_to_wdev(wil);
566
567 if (!wdev)
568 return;
569
570 wiphy_unregister(wdev->wiphy);
571 wiphy_free(wdev->wiphy);
572 kfree(wdev);
573}
diff --git a/drivers/net/wireless/ath/wil6210/dbg_hexdump.h b/drivers/net/wireless/ath/wil6210/dbg_hexdump.h
new file mode 100644
index 00000000000..6a315ba5aa7
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/dbg_hexdump.h
@@ -0,0 +1,30 @@
1#ifndef WIL_DBG_HEXDUMP_H_
2#define WIL_DBG_HEXDUMP_H_
3
4#if defined(CONFIG_DYNAMIC_DEBUG)
5#define wil_dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
6 groupsize, buf, len, ascii) \
7do { \
8 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, \
9 __builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\
10 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
11 print_hex_dump(KERN_DEBUG, prefix_str, \
12 prefix_type, rowsize, groupsize, \
13 buf, len, ascii); \
14} while (0)
15
16#define wil_print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
17 groupsize, buf, len, ascii) \
18 wil_dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
19 groupsize, buf, len, ascii)
20
21#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
22 wil_dynamic_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, true)
23#else /* defined(CONFIG_DYNAMIC_DEBUG) */
24#define wil_print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
25 groupsize, buf, len, ascii) \
26 print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
27 groupsize, buf, len, ascii)
28#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
29
30#endif /* WIL_DBG_HEXDUMP_H_ */
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
new file mode 100644
index 00000000000..65fc9683bfd
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -0,0 +1,603 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/module.h>
18#include <linux/debugfs.h>
19#include <linux/seq_file.h>
20#include <linux/pci.h>
21#include <linux/rtnetlink.h>
22
23#include "wil6210.h"
24#include "txrx.h"
25
26/* Nasty hack. Better have per device instances */
27static u32 mem_addr;
28static u32 dbg_txdesc_index;
29
30static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil,
31 const char *name, struct vring *vring)
32{
33 void __iomem *x = wmi_addr(wil, vring->hwtail);
34
35 seq_printf(s, "VRING %s = {\n", name);
36 seq_printf(s, " pa = 0x%016llx\n", (unsigned long long)vring->pa);
37 seq_printf(s, " va = 0x%p\n", vring->va);
38 seq_printf(s, " size = %d\n", vring->size);
39 seq_printf(s, " swtail = %d\n", vring->swtail);
40 seq_printf(s, " swhead = %d\n", vring->swhead);
41 seq_printf(s, " hwtail = [0x%08x] -> ", vring->hwtail);
42 if (x)
43 seq_printf(s, "0x%08x\n", ioread32(x));
44 else
45 seq_printf(s, "???\n");
46
47 if (vring->va && (vring->size < 1025)) {
48 uint i;
49 for (i = 0; i < vring->size; i++) {
50 volatile struct vring_tx_desc *d = &vring->va[i].tx;
51 if ((i % 64) == 0 && (i != 0))
52 seq_printf(s, "\n");
53 seq_printf(s, "%s", (d->dma.status & BIT(0)) ?
54 "S" : (vring->ctx[i] ? "H" : "h"));
55 }
56 seq_printf(s, "\n");
57 }
58 seq_printf(s, "}\n");
59}
60
61static int wil_vring_debugfs_show(struct seq_file *s, void *data)
62{
63 uint i;
64 struct wil6210_priv *wil = s->private;
65
66 wil_print_vring(s, wil, "rx", &wil->vring_rx);
67
68 for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++) {
69 struct vring *vring = &(wil->vring_tx[i]);
70 if (vring->va) {
71 char name[10];
72 snprintf(name, sizeof(name), "tx_%2d", i);
73 wil_print_vring(s, wil, name, vring);
74 }
75 }
76
77 return 0;
78}
79
80static int wil_vring_seq_open(struct inode *inode, struct file *file)
81{
82 return single_open(file, wil_vring_debugfs_show, inode->i_private);
83}
84
85static const struct file_operations fops_vring = {
86 .open = wil_vring_seq_open,
87 .release = single_release,
88 .read = seq_read,
89 .llseek = seq_lseek,
90};
91
92static void wil_print_ring(struct seq_file *s, const char *prefix,
93 void __iomem *off)
94{
95 struct wil6210_priv *wil = s->private;
96 struct wil6210_mbox_ring r;
97 int rsize;
98 uint i;
99
100 wil_memcpy_fromio_32(&r, off, sizeof(r));
101 wil_mbox_ring_le2cpus(&r);
102 /*
103 * we just read memory block from NIC. This memory may be
104 * garbage. Check validity before using it.
105 */
106 rsize = r.size / sizeof(struct wil6210_mbox_ring_desc);
107
108 seq_printf(s, "ring %s = {\n", prefix);
109 seq_printf(s, " base = 0x%08x\n", r.base);
110 seq_printf(s, " size = 0x%04x bytes -> %d entries\n", r.size, rsize);
111 seq_printf(s, " tail = 0x%08x\n", r.tail);
112 seq_printf(s, " head = 0x%08x\n", r.head);
113 seq_printf(s, " entry size = %d\n", r.entry_size);
114
115 if (r.size % sizeof(struct wil6210_mbox_ring_desc)) {
116 seq_printf(s, " ??? size is not multiple of %zd, garbage?\n",
117 sizeof(struct wil6210_mbox_ring_desc));
118 goto out;
119 }
120
121 if (!wmi_addr(wil, r.base) ||
122 !wmi_addr(wil, r.tail) ||
123 !wmi_addr(wil, r.head)) {
124 seq_printf(s, " ??? pointers are garbage?\n");
125 goto out;
126 }
127
128 for (i = 0; i < rsize; i++) {
129 struct wil6210_mbox_ring_desc d;
130 struct wil6210_mbox_hdr hdr;
131 size_t delta = i * sizeof(d);
132 void __iomem *x = wil->csr + HOSTADDR(r.base) + delta;
133
134 wil_memcpy_fromio_32(&d, x, sizeof(d));
135
136 seq_printf(s, " [%2x] %s %s%s 0x%08x", i,
137 d.sync ? "F" : "E",
138 (r.tail - r.base == delta) ? "t" : " ",
139 (r.head - r.base == delta) ? "h" : " ",
140 le32_to_cpu(d.addr));
141 if (0 == wmi_read_hdr(wil, d.addr, &hdr)) {
142 u16 len = le16_to_cpu(hdr.len);
143 seq_printf(s, " -> %04x %04x %04x %02x\n",
144 le16_to_cpu(hdr.seq), len,
145 le16_to_cpu(hdr.type), hdr.flags);
146 if (len <= MAX_MBOXITEM_SIZE) {
147 int n = 0;
148 unsigned char printbuf[16 * 3 + 2];
149 unsigned char databuf[MAX_MBOXITEM_SIZE];
150 void __iomem *src = wmi_buffer(wil, d.addr) +
151 sizeof(struct wil6210_mbox_hdr);
152 /*
153 * No need to check @src for validity -
154 * we already validated @d.addr while
155 * reading header
156 */
157 wil_memcpy_fromio_32(databuf, src, len);
158 while (n < len) {
159 int l = min(len - n, 16);
160 hex_dump_to_buffer(databuf + n, l,
161 16, 1, printbuf,
162 sizeof(printbuf),
163 false);
164 seq_printf(s, " : %s\n", printbuf);
165 n += l;
166 }
167 }
168 } else {
169 seq_printf(s, "\n");
170 }
171 }
172 out:
173 seq_printf(s, "}\n");
174}
175
176static int wil_mbox_debugfs_show(struct seq_file *s, void *data)
177{
178 struct wil6210_priv *wil = s->private;
179
180 wil_print_ring(s, "tx", wil->csr + HOST_MBOX +
181 offsetof(struct wil6210_mbox_ctl, tx));
182 wil_print_ring(s, "rx", wil->csr + HOST_MBOX +
183 offsetof(struct wil6210_mbox_ctl, rx));
184
185 return 0;
186}
187
188static int wil_mbox_seq_open(struct inode *inode, struct file *file)
189{
190 return single_open(file, wil_mbox_debugfs_show, inode->i_private);
191}
192
193static const struct file_operations fops_mbox = {
194 .open = wil_mbox_seq_open,
195 .release = single_release,
196 .read = seq_read,
197 .llseek = seq_lseek,
198};
199
200static int wil_debugfs_iomem_x32_set(void *data, u64 val)
201{
202 iowrite32(val, (void __iomem *)data);
203 wmb(); /* make sure write propagated to HW */
204
205 return 0;
206}
207
208static int wil_debugfs_iomem_x32_get(void *data, u64 *val)
209{
210 *val = ioread32((void __iomem *)data);
211
212 return 0;
213}
214
215DEFINE_SIMPLE_ATTRIBUTE(fops_iomem_x32, wil_debugfs_iomem_x32_get,
216 wil_debugfs_iomem_x32_set, "0x%08llx\n");
217
218static struct dentry *wil_debugfs_create_iomem_x32(const char *name,
219 mode_t mode,
220 struct dentry *parent,
221 void __iomem *value)
222{
223 return debugfs_create_file(name, mode, parent, (void * __force)value,
224 &fops_iomem_x32);
225}
226
227static int wil6210_debugfs_create_ISR(struct wil6210_priv *wil,
228 const char *name,
229 struct dentry *parent, u32 off)
230{
231 struct dentry *d = debugfs_create_dir(name, parent);
232
233 if (IS_ERR_OR_NULL(d))
234 return -ENODEV;
235
236 wil_debugfs_create_iomem_x32("ICC", S_IRUGO | S_IWUSR, d,
237 wil->csr + off);
238 wil_debugfs_create_iomem_x32("ICR", S_IRUGO | S_IWUSR, d,
239 wil->csr + off + 4);
240 wil_debugfs_create_iomem_x32("ICM", S_IRUGO | S_IWUSR, d,
241 wil->csr + off + 8);
242 wil_debugfs_create_iomem_x32("ICS", S_IWUSR, d,
243 wil->csr + off + 12);
244 wil_debugfs_create_iomem_x32("IMV", S_IRUGO | S_IWUSR, d,
245 wil->csr + off + 16);
246 wil_debugfs_create_iomem_x32("IMS", S_IWUSR, d,
247 wil->csr + off + 20);
248 wil_debugfs_create_iomem_x32("IMC", S_IWUSR, d,
249 wil->csr + off + 24);
250
251 return 0;
252}
253
254static int wil6210_debugfs_create_pseudo_ISR(struct wil6210_priv *wil,
255 struct dentry *parent)
256{
257 struct dentry *d = debugfs_create_dir("PSEUDO_ISR", parent);
258
259 if (IS_ERR_OR_NULL(d))
260 return -ENODEV;
261
262 wil_debugfs_create_iomem_x32("CAUSE", S_IRUGO, d, wil->csr +
263 HOSTADDR(RGF_DMA_PSEUDO_CAUSE));
264 wil_debugfs_create_iomem_x32("MASK_SW", S_IRUGO, d, wil->csr +
265 HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_SW));
266 wil_debugfs_create_iomem_x32("MASK_FW", S_IRUGO, d, wil->csr +
267 HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_FW));
268
269 return 0;
270}
271
272static int wil6210_debugfs_create_ITR_CNT(struct wil6210_priv *wil,
273 struct dentry *parent)
274{
275 struct dentry *d = debugfs_create_dir("ITR_CNT", parent);
276
277 if (IS_ERR_OR_NULL(d))
278 return -ENODEV;
279
280 wil_debugfs_create_iomem_x32("TRSH", S_IRUGO, d, wil->csr +
281 HOSTADDR(RGF_DMA_ITR_CNT_TRSH));
282 wil_debugfs_create_iomem_x32("DATA", S_IRUGO, d, wil->csr +
283 HOSTADDR(RGF_DMA_ITR_CNT_DATA));
284 wil_debugfs_create_iomem_x32("CTL", S_IRUGO, d, wil->csr +
285 HOSTADDR(RGF_DMA_ITR_CNT_CRL));
286
287 return 0;
288}
289
290static int wil_memread_debugfs_show(struct seq_file *s, void *data)
291{
292 struct wil6210_priv *wil = s->private;
293 void __iomem *a = wmi_buffer(wil, cpu_to_le32(mem_addr));
294
295 if (a)
296 seq_printf(s, "[0x%08x] = 0x%08x\n", mem_addr, ioread32(a));
297 else
298 seq_printf(s, "[0x%08x] = INVALID\n", mem_addr);
299
300 return 0;
301}
302
303static int wil_memread_seq_open(struct inode *inode, struct file *file)
304{
305 return single_open(file, wil_memread_debugfs_show, inode->i_private);
306}
307
308static const struct file_operations fops_memread = {
309 .open = wil_memread_seq_open,
310 .release = single_release,
311 .read = seq_read,
312 .llseek = seq_lseek,
313};
314
315static int wil_default_open(struct inode *inode, struct file *file)
316{
317 if (inode->i_private)
318 file->private_data = inode->i_private;
319
320 return 0;
321}
322
323static ssize_t wil_read_file_ioblob(struct file *file, char __user *user_buf,
324 size_t count, loff_t *ppos)
325{
326 enum { max_count = 4096 };
327 struct debugfs_blob_wrapper *blob = file->private_data;
328 loff_t pos = *ppos;
329 size_t available = blob->size;
330 void *buf;
331 size_t ret;
332
333 if (pos < 0)
334 return -EINVAL;
335
336 if (pos >= available || !count)
337 return 0;
338
339 if (count > available - pos)
340 count = available - pos;
341 if (count > max_count)
342 count = max_count;
343
344 buf = kmalloc(count, GFP_KERNEL);
345 if (!buf)
346 return -ENOMEM;
347
348 wil_memcpy_fromio_32(buf, (const volatile void __iomem *)blob->data +
349 pos, count);
350
351 ret = copy_to_user(user_buf, buf, count);
352 kfree(buf);
353 if (ret == count)
354 return -EFAULT;
355
356 count -= ret;
357 *ppos = pos + count;
358
359 return count;
360}
361
362static const struct file_operations fops_ioblob = {
363 .read = wil_read_file_ioblob,
364 .open = wil_default_open,
365 .llseek = default_llseek,
366};
367
368static
369struct dentry *wil_debugfs_create_ioblob(const char *name,
370 mode_t mode,
371 struct dentry *parent,
372 struct debugfs_blob_wrapper *blob)
373{
374 return debugfs_create_file(name, mode, parent, blob, &fops_ioblob);
375}
376/*---reset---*/
377static ssize_t wil_write_file_reset(struct file *file, const char __user *buf,
378 size_t len, loff_t *ppos)
379{
380 struct wil6210_priv *wil = file->private_data;
381 struct net_device *ndev = wil_to_ndev(wil);
382
383 /**
384 * BUG:
385 * this code does NOT sync device state with the rest of system
386 * use with care, debug only!!!
387 */
388 rtnl_lock();
389 dev_close(ndev);
390 ndev->flags &= ~IFF_UP;
391 rtnl_unlock();
392 wil_reset(wil);
393
394 return len;
395}
396
397static const struct file_operations fops_reset = {
398 .write = wil_write_file_reset,
399 .open = wil_default_open,
400};
401/*---------Tx descriptor------------*/
402
403static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
404{
405 struct wil6210_priv *wil = s->private;
406 struct vring *vring = &(wil->vring_tx[0]);
407
408 if (!vring->va) {
409 seq_printf(s, "No Tx VRING\n");
410 return 0;
411 }
412
413 if (dbg_txdesc_index < vring->size) {
414 volatile struct vring_tx_desc *d =
415 &(vring->va[dbg_txdesc_index].tx);
416 volatile u32 *u = (volatile u32 *)d;
417 struct sk_buff *skb = vring->ctx[dbg_txdesc_index];
418
419 seq_printf(s, "Tx[%3d] = {\n", dbg_txdesc_index);
420 seq_printf(s, " MAC = 0x%08x 0x%08x 0x%08x 0x%08x\n",
421 u[0], u[1], u[2], u[3]);
422 seq_printf(s, " DMA = 0x%08x 0x%08x 0x%08x 0x%08x\n",
423 u[4], u[5], u[6], u[7]);
424 seq_printf(s, " SKB = %p\n", skb);
425
426 if (skb) {
427 unsigned char printbuf[16 * 3 + 2];
428 int i = 0;
429 int len = skb_headlen(skb);
430 void *p = skb->data;
431
432 seq_printf(s, " len = %d\n", len);
433
434 while (i < len) {
435 int l = min(len - i, 16);
436 hex_dump_to_buffer(p + i, l, 16, 1, printbuf,
437 sizeof(printbuf), false);
438 seq_printf(s, " : %s\n", printbuf);
439 i += l;
440 }
441 }
442 seq_printf(s, "}\n");
443 } else {
444 seq_printf(s, "TxDesc index (%d) >= size (%d)\n",
445 dbg_txdesc_index, vring->size);
446 }
447
448 return 0;
449}
450
451static int wil_txdesc_seq_open(struct inode *inode, struct file *file)
452{
453 return single_open(file, wil_txdesc_debugfs_show, inode->i_private);
454}
455
456static const struct file_operations fops_txdesc = {
457 .open = wil_txdesc_seq_open,
458 .release = single_release,
459 .read = seq_read,
460 .llseek = seq_lseek,
461};
462
463/*---------beamforming------------*/
464static int wil_bf_debugfs_show(struct seq_file *s, void *data)
465{
466 struct wil6210_priv *wil = s->private;
467 seq_printf(s,
468 "TSF : 0x%016llx\n"
469 "TxMCS : %d\n"
470 "Sectors(rx:tx) my %2d:%2d peer %2d:%2d\n",
471 wil->stats.tsf, wil->stats.bf_mcs,
472 wil->stats.my_rx_sector, wil->stats.my_tx_sector,
473 wil->stats.peer_rx_sector, wil->stats.peer_tx_sector);
474 return 0;
475}
476
477static int wil_bf_seq_open(struct inode *inode, struct file *file)
478{
479 return single_open(file, wil_bf_debugfs_show, inode->i_private);
480}
481
482static const struct file_operations fops_bf = {
483 .open = wil_bf_seq_open,
484 .release = single_release,
485 .read = seq_read,
486 .llseek = seq_lseek,
487};
488/*---------SSID------------*/
489static ssize_t wil_read_file_ssid(struct file *file, char __user *user_buf,
490 size_t count, loff_t *ppos)
491{
492 struct wil6210_priv *wil = file->private_data;
493 struct wireless_dev *wdev = wil_to_wdev(wil);
494
495 return simple_read_from_buffer(user_buf, count, ppos,
496 wdev->ssid, wdev->ssid_len);
497}
498
499static ssize_t wil_write_file_ssid(struct file *file, const char __user *buf,
500 size_t count, loff_t *ppos)
501{
502 struct wil6210_priv *wil = file->private_data;
503 struct wireless_dev *wdev = wil_to_wdev(wil);
504 struct net_device *ndev = wil_to_ndev(wil);
505
506 if (*ppos != 0) {
507 wil_err(wil, "Unable to set SSID substring from [%d]\n",
508 (int)*ppos);
509 return -EINVAL;
510 }
511
512 if (count > sizeof(wdev->ssid)) {
513 wil_err(wil, "SSID too long, len = %d\n", (int)count);
514 return -EINVAL;
515 }
516 if (netif_running(ndev)) {
517 wil_err(wil, "Unable to change SSID on running interface\n");
518 return -EINVAL;
519 }
520
521 wdev->ssid_len = count;
522 return simple_write_to_buffer(wdev->ssid, wdev->ssid_len, ppos,
523 buf, count);
524}
525
526static const struct file_operations fops_ssid = {
527 .read = wil_read_file_ssid,
528 .write = wil_write_file_ssid,
529 .open = wil_default_open,
530};
531
532/*----------------*/
533int wil6210_debugfs_init(struct wil6210_priv *wil)
534{
535 struct dentry *dbg = wil->debug = debugfs_create_dir(WIL_NAME,
536 wil_to_wiphy(wil)->debugfsdir);
537
538 if (IS_ERR_OR_NULL(dbg))
539 return -ENODEV;
540
541 debugfs_create_file("mbox", S_IRUGO, dbg, wil, &fops_mbox);
542 debugfs_create_file("vrings", S_IRUGO, dbg, wil, &fops_vring);
543 debugfs_create_file("txdesc", S_IRUGO, dbg, wil, &fops_txdesc);
544 debugfs_create_u32("txdesc_index", S_IRUGO | S_IWUSR, dbg,
545 &dbg_txdesc_index);
546 debugfs_create_file("bf", S_IRUGO, dbg, wil, &fops_bf);
547 debugfs_create_file("ssid", S_IRUGO | S_IWUSR, dbg, wil, &fops_ssid);
548 debugfs_create_u32("secure_pcp", S_IRUGO | S_IWUSR, dbg,
549 &wil->secure_pcp);
550
551 wil6210_debugfs_create_ISR(wil, "USER_ICR", dbg,
552 HOSTADDR(RGF_USER_USER_ICR));
553 wil6210_debugfs_create_ISR(wil, "DMA_EP_TX_ICR", dbg,
554 HOSTADDR(RGF_DMA_EP_TX_ICR));
555 wil6210_debugfs_create_ISR(wil, "DMA_EP_RX_ICR", dbg,
556 HOSTADDR(RGF_DMA_EP_RX_ICR));
557 wil6210_debugfs_create_ISR(wil, "DMA_EP_MISC_ICR", dbg,
558 HOSTADDR(RGF_DMA_EP_MISC_ICR));
559 wil6210_debugfs_create_pseudo_ISR(wil, dbg);
560 wil6210_debugfs_create_ITR_CNT(wil, dbg);
561
562 debugfs_create_u32("mem_addr", S_IRUGO | S_IWUSR, dbg, &mem_addr);
563 debugfs_create_file("mem_val", S_IRUGO, dbg, wil, &fops_memread);
564
565 debugfs_create_file("reset", S_IWUSR, dbg, wil, &fops_reset);
566
567 wil->rgf_blob.data = (void * __force)wil->csr + 0;
568 wil->rgf_blob.size = 0xa000;
569 wil_debugfs_create_ioblob("blob_rgf", S_IRUGO, dbg, &wil->rgf_blob);
570
571 wil->fw_code_blob.data = (void * __force)wil->csr + 0x40000;
572 wil->fw_code_blob.size = 0x40000;
573 wil_debugfs_create_ioblob("blob_fw_code", S_IRUGO, dbg,
574 &wil->fw_code_blob);
575
576 wil->fw_data_blob.data = (void * __force)wil->csr + 0x80000;
577 wil->fw_data_blob.size = 0x8000;
578 wil_debugfs_create_ioblob("blob_fw_data", S_IRUGO, dbg,
579 &wil->fw_data_blob);
580
581 wil->fw_peri_blob.data = (void * __force)wil->csr + 0x88000;
582 wil->fw_peri_blob.size = 0x18000;
583 wil_debugfs_create_ioblob("blob_fw_peri", S_IRUGO, dbg,
584 &wil->fw_peri_blob);
585
586 wil->uc_code_blob.data = (void * __force)wil->csr + 0xa0000;
587 wil->uc_code_blob.size = 0x10000;
588 wil_debugfs_create_ioblob("blob_uc_code", S_IRUGO, dbg,
589 &wil->uc_code_blob);
590
591 wil->uc_data_blob.data = (void * __force)wil->csr + 0xb0000;
592 wil->uc_data_blob.size = 0x4000;
593 wil_debugfs_create_ioblob("blob_uc_data", S_IRUGO, dbg,
594 &wil->uc_data_blob);
595
596 return 0;
597}
598
599void wil6210_debugfs_remove(struct wil6210_priv *wil)
600{
601 debugfs_remove_recursive(wil->debug);
602 wil->debug = NULL;
603}
diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c
new file mode 100644
index 00000000000..38049da7104
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/interrupt.c
@@ -0,0 +1,471 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/interrupt.h>
18
19#include "wil6210.h"
20
21/**
22 * Theory of operation:
23 *
24 * There is ISR pseudo-cause register,
25 * dma_rgf->DMA_RGF.PSEUDO_CAUSE.PSEUDO_CAUSE
26 * Its bits represents OR'ed bits from 3 real ISR registers:
27 * TX, RX, and MISC.
28 *
29 * Registers may be configured to either "write 1 to clear" or
30 * "clear on read" mode
31 *
32 * When handling interrupt, one have to mask/unmask interrupts for the
33 * real ISR registers, or hardware may malfunction.
34 *
35 */
36
37#define WIL6210_IRQ_DISABLE (0xFFFFFFFFUL)
38#define WIL6210_IMC_RX BIT_DMA_EP_RX_ICR_RX_DONE
39#define WIL6210_IMC_TX (BIT_DMA_EP_TX_ICR_TX_DONE | \
40 BIT_DMA_EP_TX_ICR_TX_DONE_N(0))
41#define WIL6210_IMC_MISC (ISR_MISC_FW_READY | ISR_MISC_MBOX_EVT)
42
43#define WIL6210_IRQ_PSEUDO_MASK (u32)(~(BIT_DMA_PSEUDO_CAUSE_RX | \
44 BIT_DMA_PSEUDO_CAUSE_TX | \
45 BIT_DMA_PSEUDO_CAUSE_MISC))
46
47#if defined(CONFIG_WIL6210_ISR_COR)
48/* configure to Clear-On-Read mode */
49#define WIL_ICR_ICC_VALUE (0xFFFFFFFFUL)
50
51static inline void wil_icr_clear(u32 x, void __iomem *addr)
52{
53
54}
55#else /* defined(CONFIG_WIL6210_ISR_COR) */
56/* configure to Write-1-to-Clear mode */
57#define WIL_ICR_ICC_VALUE (0UL)
58
59static inline void wil_icr_clear(u32 x, void __iomem *addr)
60{
61 iowrite32(x, addr);
62}
63#endif /* defined(CONFIG_WIL6210_ISR_COR) */
64
65static inline u32 wil_ioread32_and_clear(void __iomem *addr)
66{
67 u32 x = ioread32(addr);
68
69 wil_icr_clear(x, addr);
70
71 return x;
72}
73
74static void wil6210_mask_irq_tx(struct wil6210_priv *wil)
75{
76 iowrite32(WIL6210_IRQ_DISABLE, wil->csr +
77 HOSTADDR(RGF_DMA_EP_TX_ICR) +
78 offsetof(struct RGF_ICR, IMS));
79}
80
81static void wil6210_mask_irq_rx(struct wil6210_priv *wil)
82{
83 iowrite32(WIL6210_IRQ_DISABLE, wil->csr +
84 HOSTADDR(RGF_DMA_EP_RX_ICR) +
85 offsetof(struct RGF_ICR, IMS));
86}
87
88static void wil6210_mask_irq_misc(struct wil6210_priv *wil)
89{
90 iowrite32(WIL6210_IRQ_DISABLE, wil->csr +
91 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
92 offsetof(struct RGF_ICR, IMS));
93}
94
95static void wil6210_mask_irq_pseudo(struct wil6210_priv *wil)
96{
97 wil_dbg_IRQ(wil, "%s()\n", __func__);
98
99 iowrite32(WIL6210_IRQ_DISABLE, wil->csr +
100 HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_SW));
101
102 clear_bit(wil_status_irqen, &wil->status);
103}
104
105static void wil6210_unmask_irq_tx(struct wil6210_priv *wil)
106{
107 iowrite32(WIL6210_IMC_TX, wil->csr +
108 HOSTADDR(RGF_DMA_EP_TX_ICR) +
109 offsetof(struct RGF_ICR, IMC));
110}
111
112static void wil6210_unmask_irq_rx(struct wil6210_priv *wil)
113{
114 iowrite32(WIL6210_IMC_RX, wil->csr +
115 HOSTADDR(RGF_DMA_EP_RX_ICR) +
116 offsetof(struct RGF_ICR, IMC));
117}
118
119static void wil6210_unmask_irq_misc(struct wil6210_priv *wil)
120{
121 iowrite32(WIL6210_IMC_MISC, wil->csr +
122 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
123 offsetof(struct RGF_ICR, IMC));
124}
125
126static void wil6210_unmask_irq_pseudo(struct wil6210_priv *wil)
127{
128 wil_dbg_IRQ(wil, "%s()\n", __func__);
129
130 set_bit(wil_status_irqen, &wil->status);
131
132 iowrite32(WIL6210_IRQ_PSEUDO_MASK, wil->csr +
133 HOSTADDR(RGF_DMA_PSEUDO_CAUSE_MASK_SW));
134}
135
136void wil6210_disable_irq(struct wil6210_priv *wil)
137{
138 wil_dbg_IRQ(wil, "%s()\n", __func__);
139
140 wil6210_mask_irq_tx(wil);
141 wil6210_mask_irq_rx(wil);
142 wil6210_mask_irq_misc(wil);
143 wil6210_mask_irq_pseudo(wil);
144}
145
146void wil6210_enable_irq(struct wil6210_priv *wil)
147{
148 wil_dbg_IRQ(wil, "%s()\n", __func__);
149
150 iowrite32(WIL_ICR_ICC_VALUE, wil->csr + HOSTADDR(RGF_DMA_EP_RX_ICR) +
151 offsetof(struct RGF_ICR, ICC));
152 iowrite32(WIL_ICR_ICC_VALUE, wil->csr + HOSTADDR(RGF_DMA_EP_TX_ICR) +
153 offsetof(struct RGF_ICR, ICC));
154 iowrite32(WIL_ICR_ICC_VALUE, wil->csr + HOSTADDR(RGF_DMA_EP_MISC_ICR) +
155 offsetof(struct RGF_ICR, ICC));
156
157 wil6210_unmask_irq_pseudo(wil);
158 wil6210_unmask_irq_tx(wil);
159 wil6210_unmask_irq_rx(wil);
160 wil6210_unmask_irq_misc(wil);
161}
162
163static irqreturn_t wil6210_irq_rx(int irq, void *cookie)
164{
165 struct wil6210_priv *wil = cookie;
166 u32 isr = wil_ioread32_and_clear(wil->csr +
167 HOSTADDR(RGF_DMA_EP_RX_ICR) +
168 offsetof(struct RGF_ICR, ICR));
169
170 wil_dbg_IRQ(wil, "ISR RX 0x%08x\n", isr);
171
172 if (!isr) {
173 wil_err(wil, "spurious IRQ: RX\n");
174 return IRQ_NONE;
175 }
176
177 wil6210_mask_irq_rx(wil);
178
179 if (isr & BIT_DMA_EP_RX_ICR_RX_DONE) {
180 wil_dbg_IRQ(wil, "RX done\n");
181 isr &= ~BIT_DMA_EP_RX_ICR_RX_DONE;
182 wil_rx_handle(wil);
183 }
184
185 if (isr)
186 wil_err(wil, "un-handled RX ISR bits 0x%08x\n", isr);
187
188 wil6210_unmask_irq_rx(wil);
189
190 return IRQ_HANDLED;
191}
192
193static irqreturn_t wil6210_irq_tx(int irq, void *cookie)
194{
195 struct wil6210_priv *wil = cookie;
196 u32 isr = wil_ioread32_and_clear(wil->csr +
197 HOSTADDR(RGF_DMA_EP_TX_ICR) +
198 offsetof(struct RGF_ICR, ICR));
199
200 wil_dbg_IRQ(wil, "ISR TX 0x%08x\n", isr);
201
202 if (!isr) {
203 wil_err(wil, "spurious IRQ: TX\n");
204 return IRQ_NONE;
205 }
206
207 wil6210_mask_irq_tx(wil);
208
209 if (isr & BIT_DMA_EP_TX_ICR_TX_DONE) {
210 uint i;
211 wil_dbg_IRQ(wil, "TX done\n");
212 isr &= ~BIT_DMA_EP_TX_ICR_TX_DONE;
213 for (i = 0; i < 24; i++) {
214 u32 mask = BIT_DMA_EP_TX_ICR_TX_DONE_N(i);
215 if (isr & mask) {
216 isr &= ~mask;
217 wil_dbg_IRQ(wil, "TX done(%i)\n", i);
218 wil_tx_complete(wil, i);
219 }
220 }
221 }
222
223 if (isr)
224 wil_err(wil, "un-handled TX ISR bits 0x%08x\n", isr);
225
226 wil6210_unmask_irq_tx(wil);
227
228 return IRQ_HANDLED;
229}
230
231static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
232{
233 struct wil6210_priv *wil = cookie;
234 u32 isr = wil_ioread32_and_clear(wil->csr +
235 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
236 offsetof(struct RGF_ICR, ICR));
237
238 wil_dbg_IRQ(wil, "ISR MISC 0x%08x\n", isr);
239
240 if (!isr) {
241 wil_err(wil, "spurious IRQ: MISC\n");
242 return IRQ_NONE;
243 }
244
245 wil6210_mask_irq_misc(wil);
246
247 if (isr & ISR_MISC_FW_READY) {
248 wil_dbg_IRQ(wil, "IRQ: FW ready\n");
249 /**
250 * Actual FW ready indicated by the
251 * WMI_FW_READY_EVENTID
252 */
253 isr &= ~ISR_MISC_FW_READY;
254 }
255
256 wil->isr_misc = isr;
257
258 if (isr) {
259 return IRQ_WAKE_THREAD;
260 } else {
261 wil6210_unmask_irq_misc(wil);
262 return IRQ_HANDLED;
263 }
264}
265
266static irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie)
267{
268 struct wil6210_priv *wil = cookie;
269 u32 isr = wil->isr_misc;
270
271 wil_dbg_IRQ(wil, "Thread ISR MISC 0x%08x\n", isr);
272
273 if (isr & ISR_MISC_MBOX_EVT) {
274 wil_dbg_IRQ(wil, "MBOX event\n");
275 wmi_recv_cmd(wil);
276 isr &= ~ISR_MISC_MBOX_EVT;
277 }
278
279 if (isr)
280 wil_err(wil, "un-handled MISC ISR bits 0x%08x\n", isr);
281
282 wil->isr_misc = 0;
283
284 wil6210_unmask_irq_misc(wil);
285
286 return IRQ_HANDLED;
287}
288
289/**
290 * thread IRQ handler
291 */
292static irqreturn_t wil6210_thread_irq(int irq, void *cookie)
293{
294 struct wil6210_priv *wil = cookie;
295
296 wil_dbg_IRQ(wil, "Thread IRQ\n");
297 /* Discover real IRQ cause */
298 if (wil->isr_misc)
299 wil6210_irq_misc_thread(irq, cookie);
300
301 wil6210_unmask_irq_pseudo(wil);
302
303 return IRQ_HANDLED;
304}
305
306/* DEBUG
307 * There is subtle bug in hardware that causes IRQ to raise when it should be
308 * masked. It is quite rare and hard to debug.
309 *
310 * Catch irq issue if it happens and print all I can.
311 */
312static int wil6210_debug_irq_mask(struct wil6210_priv *wil, u32 pseudo_cause)
313{
314 if (!test_bit(wil_status_irqen, &wil->status)) {
315 u32 icm_rx = wil_ioread32_and_clear(wil->csr +
316 HOSTADDR(RGF_DMA_EP_RX_ICR) +
317 offsetof(struct RGF_ICR, ICM));
318 u32 icr_rx = wil_ioread32_and_clear(wil->csr +
319 HOSTADDR(RGF_DMA_EP_RX_ICR) +
320 offsetof(struct RGF_ICR, ICR));
321 u32 imv_rx = ioread32(wil->csr +
322 HOSTADDR(RGF_DMA_EP_RX_ICR) +
323 offsetof(struct RGF_ICR, IMV));
324 u32 icm_tx = wil_ioread32_and_clear(wil->csr +
325 HOSTADDR(RGF_DMA_EP_TX_ICR) +
326 offsetof(struct RGF_ICR, ICM));
327 u32 icr_tx = wil_ioread32_and_clear(wil->csr +
328 HOSTADDR(RGF_DMA_EP_TX_ICR) +
329 offsetof(struct RGF_ICR, ICR));
330 u32 imv_tx = ioread32(wil->csr +
331 HOSTADDR(RGF_DMA_EP_TX_ICR) +
332 offsetof(struct RGF_ICR, IMV));
333 u32 icm_misc = wil_ioread32_and_clear(wil->csr +
334 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
335 offsetof(struct RGF_ICR, ICM));
336 u32 icr_misc = wil_ioread32_and_clear(wil->csr +
337 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
338 offsetof(struct RGF_ICR, ICR));
339 u32 imv_misc = ioread32(wil->csr +
340 HOSTADDR(RGF_DMA_EP_MISC_ICR) +
341 offsetof(struct RGF_ICR, IMV));
342 wil_err(wil, "IRQ when it should be masked: pseudo 0x%08x\n"
343 "Rx icm:icr:imv 0x%08x 0x%08x 0x%08x\n"
344 "Tx icm:icr:imv 0x%08x 0x%08x 0x%08x\n"
345 "Misc icm:icr:imv 0x%08x 0x%08x 0x%08x\n",
346 pseudo_cause,
347 icm_rx, icr_rx, imv_rx,
348 icm_tx, icr_tx, imv_tx,
349 icm_misc, icr_misc, imv_misc);
350
351 return -EINVAL;
352 }
353
354 return 0;
355}
356
357static irqreturn_t wil6210_hardirq(int irq, void *cookie)
358{
359 irqreturn_t rc = IRQ_HANDLED;
360 struct wil6210_priv *wil = cookie;
361 u32 pseudo_cause = ioread32(wil->csr + HOSTADDR(RGF_DMA_PSEUDO_CAUSE));
362
363 /**
364 * pseudo_cause is Clear-On-Read, no need to ACK
365 */
366 if ((pseudo_cause == 0) || ((pseudo_cause & 0xff) == 0xff))
367 return IRQ_NONE;
368
369 /* FIXME: IRQ mask debug */
370 if (wil6210_debug_irq_mask(wil, pseudo_cause))
371 return IRQ_NONE;
372
373 wil6210_mask_irq_pseudo(wil);
374
375 /* Discover real IRQ cause
376 * There are 2 possible phases for every IRQ:
377 * - hard IRQ handler called right here
378 * - threaded handler called later
379 *
380 * Hard IRQ handler reads and clears ISR.
381 *
382 * If threaded handler requested, hard IRQ handler
383 * returns IRQ_WAKE_THREAD and saves ISR register value
384 * for the threaded handler use.
385 *
386 * voting for wake thread - need at least 1 vote
387 */
388 if ((pseudo_cause & BIT_DMA_PSEUDO_CAUSE_RX) &&
389 (wil6210_irq_rx(irq, cookie) == IRQ_WAKE_THREAD))
390 rc = IRQ_WAKE_THREAD;
391
392 if ((pseudo_cause & BIT_DMA_PSEUDO_CAUSE_TX) &&
393 (wil6210_irq_tx(irq, cookie) == IRQ_WAKE_THREAD))
394 rc = IRQ_WAKE_THREAD;
395
396 if ((pseudo_cause & BIT_DMA_PSEUDO_CAUSE_MISC) &&
397 (wil6210_irq_misc(irq, cookie) == IRQ_WAKE_THREAD))
398 rc = IRQ_WAKE_THREAD;
399
400 /* if thread is requested, it will unmask IRQ */
401 if (rc != IRQ_WAKE_THREAD)
402 wil6210_unmask_irq_pseudo(wil);
403
404 wil_dbg_IRQ(wil, "Hard IRQ 0x%08x\n", pseudo_cause);
405
406 return rc;
407}
408
409static int wil6210_request_3msi(struct wil6210_priv *wil, int irq)
410{
411 int rc;
412 /*
413 * IRQ's are in the following order:
414 * - Tx
415 * - Rx
416 * - Misc
417 */
418
419 rc = request_irq(irq, wil6210_irq_tx, IRQF_SHARED,
420 WIL_NAME"_tx", wil);
421 if (rc)
422 return rc;
423
424 rc = request_irq(irq + 1, wil6210_irq_rx, IRQF_SHARED,
425 WIL_NAME"_rx", wil);
426 if (rc)
427 goto free0;
428
429 rc = request_threaded_irq(irq + 2, wil6210_irq_misc,
430 wil6210_irq_misc_thread,
431 IRQF_SHARED, WIL_NAME"_misc", wil);
432 if (rc)
433 goto free1;
434
435 return 0;
436 /* error branch */
437free1:
438 free_irq(irq + 1, wil);
439free0:
440 free_irq(irq, wil);
441
442 return rc;
443}
444
445int wil6210_init_irq(struct wil6210_priv *wil, int irq)
446{
447 int rc;
448 if (wil->n_msi == 3)
449 rc = wil6210_request_3msi(wil, irq);
450 else
451 rc = request_threaded_irq(irq, wil6210_hardirq,
452 wil6210_thread_irq,
453 wil->n_msi ? 0 : IRQF_SHARED,
454 WIL_NAME, wil);
455 if (rc)
456 return rc;
457
458 wil6210_enable_irq(wil);
459
460 return 0;
461}
462
463void wil6210_fini_irq(struct wil6210_priv *wil, int irq)
464{
465 wil6210_disable_irq(wil);
466 free_irq(irq, wil);
467 if (wil->n_msi == 3) {
468 free_irq(irq + 1, wil);
469 free_irq(irq + 2, wil);
470 }
471}
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
new file mode 100644
index 00000000000..95fcd361322
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -0,0 +1,407 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/kernel.h>
18#include <linux/netdevice.h>
19#include <linux/sched.h>
20#include <linux/ieee80211.h>
21#include <linux/wireless.h>
22#include <linux/slab.h>
23#include <linux/moduleparam.h>
24#include <linux/if_arp.h>
25
26#include "wil6210.h"
27
28/*
29 * Due to a hardware issue,
30 * one has to read/write to/from NIC in 32-bit chunks;
31 * regular memcpy_fromio and siblings will
32 * not work on 64-bit platform - it uses 64-bit transactions
33 *
34 * Force 32-bit transactions to enable NIC on 64-bit platforms
35 *
36 * To avoid byte swap on big endian host, __raw_{read|write}l
37 * should be used - {read|write}l would swap bytes to provide
38 * little endian on PCI value in host endianness.
39 */
40void wil_memcpy_fromio_32(void *dst, const volatile void __iomem *src,
41 size_t count)
42{
43 u32 *d = dst;
44 const volatile u32 __iomem *s = src;
45
46 /* size_t is unsigned, if (count%4 != 0) it will wrap */
47 for (count += 4; count > 4; count -= 4)
48 *d++ = __raw_readl(s++);
49}
50
51void wil_memcpy_toio_32(volatile void __iomem *dst, const void *src,
52 size_t count)
53{
54 volatile u32 __iomem *d = dst;
55 const u32 *s = src;
56
57 for (count += 4; count > 4; count -= 4)
58 __raw_writel(*s++, d++);
59}
60
61static void _wil6210_disconnect(struct wil6210_priv *wil, void *bssid)
62{
63 uint i;
64 struct net_device *ndev = wil_to_ndev(wil);
65 struct wireless_dev *wdev = wil->wdev;
66
67 wil_dbg(wil, "%s()\n", __func__);
68
69 wil_link_off(wil);
70 clear_bit(wil_status_fwconnected, &wil->status);
71
72 switch (wdev->sme_state) {
73 case CFG80211_SME_CONNECTED:
74 cfg80211_disconnected(ndev, WLAN_STATUS_UNSPECIFIED_FAILURE,
75 NULL, 0, GFP_KERNEL);
76 break;
77 case CFG80211_SME_CONNECTING:
78 cfg80211_connect_result(ndev, bssid, NULL, 0, NULL, 0,
79 WLAN_STATUS_UNSPECIFIED_FAILURE,
80 GFP_KERNEL);
81 break;
82 default:
83 ;
84 }
85
86 for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++)
87 wil_vring_fini_tx(wil, i);
88}
89
90static void wil_disconnect_worker(struct work_struct *work)
91{
92 struct wil6210_priv *wil = container_of(work,
93 struct wil6210_priv, disconnect_worker);
94
95 _wil6210_disconnect(wil, NULL);
96}
97
98static void wil_connect_timer_fn(ulong x)
99{
100 struct wil6210_priv *wil = (void *)x;
101
102 wil_dbg(wil, "Connect timeout\n");
103
104 /* reschedule to thread context - disconnect won't
105 * run from atomic context
106 */
107 schedule_work(&wil->disconnect_worker);
108}
109
110int wil_priv_init(struct wil6210_priv *wil)
111{
112 wil_dbg(wil, "%s()\n", __func__);
113
114 mutex_init(&wil->mutex);
115 mutex_init(&wil->wmi_mutex);
116
117 init_completion(&wil->wmi_ready);
118
119 wil->pending_connect_cid = -1;
120 setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil);
121
122 INIT_WORK(&wil->wmi_connect_worker, wmi_connect_worker);
123 INIT_WORK(&wil->disconnect_worker, wil_disconnect_worker);
124 INIT_WORK(&wil->wmi_event_worker, wmi_event_worker);
125
126 INIT_LIST_HEAD(&wil->pending_wmi_ev);
127 spin_lock_init(&wil->wmi_ev_lock);
128
129 wil->wmi_wq = create_singlethread_workqueue(WIL_NAME"_wmi");
130 if (!wil->wmi_wq)
131 return -EAGAIN;
132
133 wil->wmi_wq_conn = create_singlethread_workqueue(WIL_NAME"_connect");
134 if (!wil->wmi_wq_conn) {
135 destroy_workqueue(wil->wmi_wq);
136 return -EAGAIN;
137 }
138
139 /* make shadow copy of registers that should not change on run time */
140 wil_memcpy_fromio_32(&wil->mbox_ctl, wil->csr + HOST_MBOX,
141 sizeof(struct wil6210_mbox_ctl));
142 wil_mbox_ring_le2cpus(&wil->mbox_ctl.rx);
143 wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx);
144
145 return 0;
146}
147
148void wil6210_disconnect(struct wil6210_priv *wil, void *bssid)
149{
150 del_timer_sync(&wil->connect_timer);
151 _wil6210_disconnect(wil, bssid);
152}
153
154void wil_priv_deinit(struct wil6210_priv *wil)
155{
156 cancel_work_sync(&wil->disconnect_worker);
157 wil6210_disconnect(wil, NULL);
158 wmi_event_flush(wil);
159 destroy_workqueue(wil->wmi_wq_conn);
160 destroy_workqueue(wil->wmi_wq);
161}
162
163static void wil_target_reset(struct wil6210_priv *wil)
164{
165 wil_dbg(wil, "Resetting...\n");
166
167 /* register write */
168#define W(a, v) iowrite32(v, wil->csr + HOSTADDR(a))
169 /* register set = read, OR, write */
170#define S(a, v) iowrite32(ioread32(wil->csr + HOSTADDR(a)) | v, \
171 wil->csr + HOSTADDR(a))
172
173 /* hpal_perst_from_pad_src_n_mask */
174 S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(6));
175 /* car_perst_rst_src_n_mask */
176 S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(7));
177
178 W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */
179 W(RGF_USER_USER_CPU_0, BIT(1)); /* user_cpu_man_rst */
180
181 msleep(100);
182
183 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);
184 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F);
185 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000170);
186 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FC00);
187
188 msleep(100);
189
190 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0);
191 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0);
192 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0);
193 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
194
195 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000001);
196 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00000080);
197 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
198
199 msleep(2000);
200
201 W(RGF_USER_USER_CPU_0, BIT(0)); /* user_cpu_man_de_rst */
202
203 msleep(2000);
204
205 wil_dbg(wil, "Reset completed\n");
206
207#undef W
208#undef S
209}
210
211void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
212{
213 le32_to_cpus(&r->base);
214 le16_to_cpus(&r->entry_size);
215 le16_to_cpus(&r->size);
216 le32_to_cpus(&r->tail);
217 le32_to_cpus(&r->head);
218}
219
220static int wil_wait_for_fw_ready(struct wil6210_priv *wil)
221{
222 ulong to = msecs_to_jiffies(1000);
223 ulong left = wait_for_completion_timeout(&wil->wmi_ready, to);
224 if (0 == left) {
225 wil_err(wil, "Firmware not ready\n");
226 return -ETIME;
227 } else {
228 wil_dbg(wil, "FW ready after %d ms\n",
229 jiffies_to_msecs(to-left));
230 }
231 return 0;
232}
233
234/*
235 * We reset all the structures, and we reset the UMAC.
236 * After calling this routine, you're expected to reload
237 * the firmware.
238 */
239int wil_reset(struct wil6210_priv *wil)
240{
241 int rc;
242
243 cancel_work_sync(&wil->disconnect_worker);
244 wil6210_disconnect(wil, NULL);
245
246 wmi_event_flush(wil);
247
248 flush_workqueue(wil->wmi_wq);
249 flush_workqueue(wil->wmi_wq_conn);
250
251 wil6210_disable_irq(wil);
252 wil->status = 0;
253
254 /* TODO: put MAC in reset */
255 wil_target_reset(wil);
256
257 /* init after reset */
258 wil->pending_connect_cid = -1;
259 INIT_COMPLETION(wil->wmi_ready);
260
261 /* make shadow copy of registers that should not change on run time */
262 wil_memcpy_fromio_32(&wil->mbox_ctl, wil->csr + HOST_MBOX,
263 sizeof(struct wil6210_mbox_ctl));
264 wil_mbox_ring_le2cpus(&wil->mbox_ctl.rx);
265 wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx);
266
267 /* TODO: release MAC reset */
268 wil6210_enable_irq(wil);
269
270 /* we just started MAC, wait for FW ready */
271 rc = wil_wait_for_fw_ready(wil);
272
273 return rc;
274}
275
276
277void wil_link_on(struct wil6210_priv *wil)
278{
279 struct net_device *ndev = wil_to_ndev(wil);
280
281 wil_dbg(wil, "%s()\n", __func__);
282
283 netif_carrier_on(ndev);
284 netif_tx_wake_all_queues(ndev);
285}
286
287void wil_link_off(struct wil6210_priv *wil)
288{
289 struct net_device *ndev = wil_to_ndev(wil);
290
291 wil_dbg(wil, "%s()\n", __func__);
292
293 netif_tx_stop_all_queues(ndev);
294 netif_carrier_off(ndev);
295}
296
297static int __wil_up(struct wil6210_priv *wil)
298{
299 struct net_device *ndev = wil_to_ndev(wil);
300 struct wireless_dev *wdev = wil->wdev;
301 struct ieee80211_channel *channel = wdev->preset_chandef.chan;
302 int rc;
303 int bi;
304 u16 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
305
306 rc = wil_reset(wil);
307 if (rc)
308 return rc;
309
310 /* FIXME Firmware works now in PBSS mode(ToDS=0, FromDS=0) */
311 wmi_nettype = wil_iftype_nl2wmi(NL80211_IFTYPE_ADHOC);
312 switch (wdev->iftype) {
313 case NL80211_IFTYPE_STATION:
314 wil_dbg(wil, "type: STATION\n");
315 bi = 0;
316 ndev->type = ARPHRD_ETHER;
317 break;
318 case NL80211_IFTYPE_AP:
319 wil_dbg(wil, "type: AP\n");
320 bi = 100;
321 ndev->type = ARPHRD_ETHER;
322 break;
323 case NL80211_IFTYPE_P2P_CLIENT:
324 wil_dbg(wil, "type: P2P_CLIENT\n");
325 bi = 0;
326 ndev->type = ARPHRD_ETHER;
327 break;
328 case NL80211_IFTYPE_P2P_GO:
329 wil_dbg(wil, "type: P2P_GO\n");
330 bi = 100;
331 ndev->type = ARPHRD_ETHER;
332 break;
333 case NL80211_IFTYPE_MONITOR:
334 wil_dbg(wil, "type: Monitor\n");
335 bi = 0;
336 ndev->type = ARPHRD_IEEE80211_RADIOTAP;
337 /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_RADIOTAP ? */
338 break;
339 default:
340 return -EOPNOTSUPP;
341 }
342
343 /* Apply profile in the following order: */
344 /* SSID and channel for the AP */
345 switch (wdev->iftype) {
346 case NL80211_IFTYPE_AP:
347 case NL80211_IFTYPE_P2P_GO:
348 if (wdev->ssid_len == 0) {
349 wil_err(wil, "SSID not set\n");
350 return -EINVAL;
351 }
352 wmi_set_ssid(wil, wdev->ssid_len, wdev->ssid);
353 if (channel)
354 wmi_set_channel(wil, channel->hw_value);
355 break;
356 default:
357 ;
358 }
359
360 /* MAC address - pre-requisite for other commands */
361 wmi_set_mac_address(wil, ndev->dev_addr);
362
363 /* Set up beaconing if required. */
364 rc = wmi_set_bcon(wil, bi, wmi_nettype);
365 if (rc)
366 return rc;
367
368 /* Rx VRING. After MAC and beacon */
369 wil_rx_init(wil);
370
371 return 0;
372}
373
374int wil_up(struct wil6210_priv *wil)
375{
376 int rc;
377
378 mutex_lock(&wil->mutex);
379 rc = __wil_up(wil);
380 mutex_unlock(&wil->mutex);
381
382 return rc;
383}
384
385static int __wil_down(struct wil6210_priv *wil)
386{
387 if (wil->scan_request) {
388 cfg80211_scan_done(wil->scan_request, true);
389 wil->scan_request = NULL;
390 }
391
392 wil6210_disconnect(wil, NULL);
393 wil_rx_fini(wil);
394
395 return 0;
396}
397
398int wil_down(struct wil6210_priv *wil)
399{
400 int rc;
401
402 mutex_lock(&wil->mutex);
403 rc = __wil_down(wil);
404 mutex_unlock(&wil->mutex);
405
406 return rc;
407}
diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
new file mode 100644
index 00000000000..3068b5cb53a
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/netdev.c
@@ -0,0 +1,157 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/module.h>
18#include <linux/netdevice.h>
19#include <linux/etherdevice.h>
20#include <linux/slab.h>
21
22#include "wil6210.h"
23
24static int wil_open(struct net_device *ndev)
25{
26 struct wil6210_priv *wil = ndev_to_wil(ndev);
27
28 return wil_up(wil);
29}
30
31static int wil_stop(struct net_device *ndev)
32{
33 struct wil6210_priv *wil = ndev_to_wil(ndev);
34
35 return wil_down(wil);
36}
37
38/*
39 * AC to queue mapping
40 *
41 * AC_VO -> queue 3
42 * AC_VI -> queue 2
43 * AC_BE -> queue 1
44 * AC_BK -> queue 0
45 */
46static u16 wil_select_queue(struct net_device *ndev, struct sk_buff *skb)
47{
48 static const u16 wil_1d_to_queue[8] = { 1, 0, 0, 1, 2, 2, 3, 3 };
49 struct wil6210_priv *wil = ndev_to_wil(ndev);
50 u16 rc;
51
52 skb->priority = cfg80211_classify8021d(skb);
53
54 rc = wil_1d_to_queue[skb->priority];
55
56 wil_dbg_TXRX(wil, "%s() %d -> %d\n", __func__, (int)skb->priority,
57 (int)rc);
58
59 return rc;
60}
61
62static const struct net_device_ops wil_netdev_ops = {
63 .ndo_open = wil_open,
64 .ndo_stop = wil_stop,
65 .ndo_start_xmit = wil_start_xmit,
66 .ndo_select_queue = wil_select_queue,
67 .ndo_set_mac_address = eth_mac_addr,
68 .ndo_validate_addr = eth_validate_addr,
69};
70
71void *wil_if_alloc(struct device *dev, void __iomem *csr)
72{
73 struct net_device *ndev;
74 struct wireless_dev *wdev;
75 struct wil6210_priv *wil;
76 struct ieee80211_channel *ch;
77 int rc = 0;
78
79 wdev = wil_cfg80211_init(dev);
80 if (IS_ERR(wdev)) {
81 dev_err(dev, "wil_cfg80211_init failed\n");
82 return wdev;
83 }
84
85 wil = wdev_to_wil(wdev);
86 wil->csr = csr;
87 wil->wdev = wdev;
88
89 rc = wil_priv_init(wil);
90 if (rc) {
91 dev_err(dev, "wil_priv_init failed\n");
92 goto out_wdev;
93 }
94
95 wdev->iftype = NL80211_IFTYPE_STATION; /* TODO */
96 /* default monitor channel */
97 ch = wdev->wiphy->bands[IEEE80211_BAND_60GHZ]->channels;
98 cfg80211_chandef_create(&wdev->preset_chandef, ch, NL80211_CHAN_NO_HT);
99
100 ndev = alloc_netdev_mqs(0, "wlan%d", ether_setup, WIL6210_TX_QUEUES, 1);
101 if (!ndev) {
102 dev_err(dev, "alloc_netdev_mqs failed\n");
103 rc = -ENOMEM;
104 goto out_priv;
105 }
106
107 ndev->netdev_ops = &wil_netdev_ops;
108 ndev->ieee80211_ptr = wdev;
109 SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
110 wdev->netdev = ndev;
111
112 wil_link_off(wil);
113
114 return wil;
115
116 out_priv:
117 wil_priv_deinit(wil);
118
119 out_wdev:
120 wil_wdev_free(wil);
121
122 return ERR_PTR(rc);
123}
124
125void wil_if_free(struct wil6210_priv *wil)
126{
127 struct net_device *ndev = wil_to_ndev(wil);
128 if (!ndev)
129 return;
130
131 free_netdev(ndev);
132 wil_priv_deinit(wil);
133 wil_wdev_free(wil);
134}
135
136int wil_if_add(struct wil6210_priv *wil)
137{
138 struct net_device *ndev = wil_to_ndev(wil);
139 int rc;
140
141 rc = register_netdev(ndev);
142 if (rc < 0) {
143 dev_err(&ndev->dev, "Failed to register netdev: %d\n", rc);
144 return rc;
145 }
146
147 wil_link_off(wil);
148
149 return 0;
150}
151
152void wil_if_remove(struct wil6210_priv *wil)
153{
154 struct net_device *ndev = wil_to_ndev(wil);
155
156 unregister_netdev(ndev);
157}
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c
new file mode 100644
index 00000000000..0fc83edd6ba
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/slab.h>
20#include <linux/netdevice.h>
21#include <linux/debugfs.h>
22#include <linux/pci.h>
23#include <linux/moduleparam.h>
24
25#include "wil6210.h"
26
27static int use_msi = 1;
28module_param(use_msi, int, S_IRUGO);
29MODULE_PARM_DESC(use_msi,
30 " Use MSI interrupt: "
31 "0 - don't, 1 - (default) - single, or 3");
32
33/* Bus ops */
34static int wil_if_pcie_enable(struct wil6210_priv *wil)
35{
36 struct pci_dev *pdev = wil->pdev;
37 int rc;
38
39 pci_set_master(pdev);
40
41 /*
42 * how many MSI interrupts to request?
43 */
44 switch (use_msi) {
45 case 3:
46 case 1:
47 case 0:
48 break;
49 default:
50 wil_err(wil, "Invalid use_msi=%d, default to 1\n",
51 use_msi);
52 use_msi = 1;
53 }
54 wil->n_msi = use_msi;
55 if (wil->n_msi) {
56 wil_dbg(wil, "Setup %d MSI interrupts\n", use_msi);
57 rc = pci_enable_msi_block(pdev, wil->n_msi);
58 if (rc && (wil->n_msi == 3)) {
59 wil_err(wil, "3 MSI mode failed, try 1 MSI\n");
60 wil->n_msi = 1;
61 rc = pci_enable_msi_block(pdev, wil->n_msi);
62 }
63 if (rc) {
64 wil_err(wil, "pci_enable_msi failed, use INTx\n");
65 wil->n_msi = 0;
66 }
67 } else {
68 wil_dbg(wil, "MSI interrupts disabled, use INTx\n");
69 }
70
71 rc = wil6210_init_irq(wil, pdev->irq);
72 if (rc)
73 goto stop_master;
74
75 /* need reset here to obtain MAC */
76 rc = wil_reset(wil);
77 if (rc)
78 goto release_irq;
79
80 return 0;
81
82 release_irq:
83 wil6210_fini_irq(wil, pdev->irq);
84 /* safe to call if no MSI */
85 pci_disable_msi(pdev);
86 stop_master:
87 pci_clear_master(pdev);
88 return rc;
89}
90
91static int wil_if_pcie_disable(struct wil6210_priv *wil)
92{
93 struct pci_dev *pdev = wil->pdev;
94
95 pci_clear_master(pdev);
96 /* disable and release IRQ */
97 wil6210_fini_irq(wil, pdev->irq);
98 /* safe to call if no MSI */
99 pci_disable_msi(pdev);
100 /* TODO: disable HW */
101
102 return 0;
103}
104
105static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
106{
107 struct wil6210_priv *wil;
108 struct device *dev = &pdev->dev;
109 void __iomem *csr;
110 int rc;
111
112 /* check HW */
113 dev_info(&pdev->dev, WIL_NAME " device found [%04x:%04x] (rev %x)\n",
114 (int)pdev->vendor, (int)pdev->device, (int)pdev->revision);
115
116 if (pci_resource_len(pdev, 0) != WIL6210_MEM_SIZE) {
117 dev_err(&pdev->dev, "Not " WIL_NAME "? "
118 "BAR0 size is %lu while expecting %lu\n",
119 (ulong)pci_resource_len(pdev, 0), WIL6210_MEM_SIZE);
120 return -ENODEV;
121 }
122
123 rc = pci_enable_device(pdev);
124 if (rc) {
125 dev_err(&pdev->dev, "pci_enable_device failed\n");
126 return -ENODEV;
127 }
128 /* rollback to err_disable_pdev */
129
130 rc = pci_request_region(pdev, 0, WIL_NAME);
131 if (rc) {
132 dev_err(&pdev->dev, "pci_request_region failed\n");
133 goto err_disable_pdev;
134 }
135 /* rollback to err_release_reg */
136
137 csr = pci_ioremap_bar(pdev, 0);
138 if (!csr) {
139 dev_err(&pdev->dev, "pci_ioremap_bar failed\n");
140 rc = -ENODEV;
141 goto err_release_reg;
142 }
143 /* rollback to err_iounmap */
144 dev_info(&pdev->dev, "CSR at %pR -> %p\n", &pdev->resource[0], csr);
145
146 wil = wil_if_alloc(dev, csr);
147 if (IS_ERR(wil)) {
148 rc = (int)PTR_ERR(wil);
149 dev_err(dev, "wil_if_alloc failed: %d\n", rc);
150 goto err_iounmap;
151 }
152 /* rollback to if_free */
153
154 pci_set_drvdata(pdev, wil);
155 wil->pdev = pdev;
156
157 /* FW should raise IRQ when ready */
158 rc = wil_if_pcie_enable(wil);
159 if (rc) {
160 wil_err(wil, "Enable device failed\n");
161 goto if_free;
162 }
163 /* rollback to bus_disable */
164
165 rc = wil_if_add(wil);
166 if (rc) {
167 wil_err(wil, "wil_if_add failed: %d\n", rc);
168 goto bus_disable;
169 }
170
171 wil6210_debugfs_init(wil);
172
173 /* check FW is alive */
174 wmi_echo(wil);
175
176 return 0;
177
178 bus_disable:
179 wil_if_pcie_disable(wil);
180 if_free:
181 wil_if_free(wil);
182 err_iounmap:
183 pci_iounmap(pdev, csr);
184 err_release_reg:
185 pci_release_region(pdev, 0);
186 err_disable_pdev:
187 pci_disable_device(pdev);
188
189 return rc;
190}
191
192static void wil_pcie_remove(struct pci_dev *pdev)
193{
194 struct wil6210_priv *wil = pci_get_drvdata(pdev);
195
196 wil6210_debugfs_remove(wil);
197 wil_if_pcie_disable(wil);
198 wil_if_remove(wil);
199 wil_if_free(wil);
200 pci_iounmap(pdev, wil->csr);
201 pci_release_region(pdev, 0);
202 pci_disable_device(pdev);
203 pci_set_drvdata(pdev, NULL);
204}
205
206static DEFINE_PCI_DEVICE_TABLE(wil6210_pcie_ids) = {
207 { PCI_DEVICE(0x1ae9, 0x0301) },
208 { /* end: all zeroes */ },
209};
210MODULE_DEVICE_TABLE(pci, wil6210_pcie_ids);
211
212static struct pci_driver wil6210_driver = {
213 .probe = wil_pcie_probe,
214 .remove = wil_pcie_remove,
215 .id_table = wil6210_pcie_ids,
216 .name = WIL_NAME,
217};
218
219module_pci_driver(wil6210_driver);
220
221MODULE_LICENSE("Dual BSD/GPL");
222MODULE_AUTHOR("Qualcomm Atheros <wil6210@qca.qualcomm.com>");
223MODULE_DESCRIPTION("Driver for 60g WiFi WIL6210 card");
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
new file mode 100644
index 00000000000..f29c294413c
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -0,0 +1,871 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/kernel.h>
18#include <linux/netdevice.h>
19#include <linux/etherdevice.h>
20#include <linux/hardirq.h>
21#include <net/ieee80211_radiotap.h>
22#include <linux/if_arp.h>
23#include <linux/moduleparam.h>
24
25#include "wil6210.h"
26#include "wmi.h"
27#include "txrx.h"
28
29static bool rtap_include_phy_info;
30module_param(rtap_include_phy_info, bool, S_IRUGO);
31MODULE_PARM_DESC(rtap_include_phy_info,
32 " Include PHY info in the radiotap header, default - no");
33
34static inline int wil_vring_is_empty(struct vring *vring)
35{
36 return vring->swhead == vring->swtail;
37}
38
39static inline u32 wil_vring_next_tail(struct vring *vring)
40{
41 return (vring->swtail + 1) % vring->size;
42}
43
44static inline void wil_vring_advance_head(struct vring *vring, int n)
45{
46 vring->swhead = (vring->swhead + n) % vring->size;
47}
48
49static inline int wil_vring_is_full(struct vring *vring)
50{
51 return wil_vring_next_tail(vring) == vring->swhead;
52}
53/*
54 * Available space in Tx Vring
55 */
56static inline int wil_vring_avail_tx(struct vring *vring)
57{
58 u32 swhead = vring->swhead;
59 u32 swtail = vring->swtail;
60 int used = (vring->size + swhead - swtail) % vring->size;
61
62 return vring->size - used - 1;
63}
64
65static int wil_vring_alloc(struct wil6210_priv *wil, struct vring *vring)
66{
67 struct device *dev = wil_to_dev(wil);
68 size_t sz = vring->size * sizeof(vring->va[0]);
69 uint i;
70
71 BUILD_BUG_ON(sizeof(vring->va[0]) != 32);
72
73 vring->swhead = 0;
74 vring->swtail = 0;
75 vring->ctx = kzalloc(vring->size * sizeof(vring->ctx[0]), GFP_KERNEL);
76 if (!vring->ctx) {
77 wil_err(wil, "vring_alloc [%d] failed to alloc ctx mem\n",
78 vring->size);
79 vring->va = NULL;
80 return -ENOMEM;
81 }
82 /*
83 * vring->va should be aligned on its size rounded up to power of 2
84 * This is granted by the dma_alloc_coherent
85 */
86 vring->va = dma_alloc_coherent(dev, sz, &vring->pa, GFP_KERNEL);
87 if (!vring->va) {
88 wil_err(wil, "vring_alloc [%d] failed to alloc DMA mem\n",
89 vring->size);
90 kfree(vring->ctx);
91 vring->ctx = NULL;
92 return -ENOMEM;
93 }
94 /* initially, all descriptors are SW owned
95 * For Tx and Rx, ownership bit is at the same location, thus
96 * we can use any
97 */
98 for (i = 0; i < vring->size; i++) {
99 volatile struct vring_tx_desc *d = &(vring->va[i].tx);
100 d->dma.status = TX_DMA_STATUS_DU;
101 }
102
103 wil_dbg(wil, "vring[%d] 0x%p:0x%016llx 0x%p\n", vring->size,
104 vring->va, (unsigned long long)vring->pa, vring->ctx);
105
106 return 0;
107}
108
109static void wil_vring_free(struct wil6210_priv *wil, struct vring *vring,
110 int tx)
111{
112 struct device *dev = wil_to_dev(wil);
113 size_t sz = vring->size * sizeof(vring->va[0]);
114
115 while (!wil_vring_is_empty(vring)) {
116 if (tx) {
117 volatile struct vring_tx_desc *d =
118 &vring->va[vring->swtail].tx;
119 dma_addr_t pa = d->dma.addr_low |
120 ((u64)d->dma.addr_high << 32);
121 struct sk_buff *skb = vring->ctx[vring->swtail];
122 if (skb) {
123 dma_unmap_single(dev, pa, d->dma.length,
124 DMA_TO_DEVICE);
125 dev_kfree_skb_any(skb);
126 vring->ctx[vring->swtail] = NULL;
127 } else {
128 dma_unmap_page(dev, pa, d->dma.length,
129 DMA_TO_DEVICE);
130 }
131 vring->swtail = wil_vring_next_tail(vring);
132 } else { /* rx */
133 volatile struct vring_rx_desc *d =
134 &vring->va[vring->swtail].rx;
135 dma_addr_t pa = d->dma.addr_low |
136 ((u64)d->dma.addr_high << 32);
137 struct sk_buff *skb = vring->ctx[vring->swhead];
138 dma_unmap_single(dev, pa, d->dma.length,
139 DMA_FROM_DEVICE);
140 kfree_skb(skb);
141 wil_vring_advance_head(vring, 1);
142 }
143 }
144 dma_free_coherent(dev, sz, (void *)vring->va, vring->pa);
145 kfree(vring->ctx);
146 vring->pa = 0;
147 vring->va = NULL;
148 vring->ctx = NULL;
149}
150
151/**
152 * Allocate one skb for Rx VRING
153 *
154 * Safe to call from IRQ
155 */
156static int wil_vring_alloc_skb(struct wil6210_priv *wil, struct vring *vring,
157 u32 i, int headroom)
158{
159 struct device *dev = wil_to_dev(wil);
160 unsigned int sz = RX_BUF_LEN;
161 volatile struct vring_rx_desc *d = &(vring->va[i].rx);
162 dma_addr_t pa;
163
164 /* TODO align */
165 struct sk_buff *skb = dev_alloc_skb(sz + headroom);
166 if (unlikely(!skb))
167 return -ENOMEM;
168
169 skb_reserve(skb, headroom);
170 skb_put(skb, sz);
171
172 pa = dma_map_single(dev, skb->data, skb->len, DMA_FROM_DEVICE);
173 if (unlikely(dma_mapping_error(dev, pa))) {
174 kfree_skb(skb);
175 return -ENOMEM;
176 }
177
178 d->dma.d0 = BIT(9) | RX_DMA_D0_CMD_DMA_IT;
179 d->dma.addr_low = lower_32_bits(pa);
180 d->dma.addr_high = (u16)upper_32_bits(pa);
181 /* ip_length don't care */
182 /* b11 don't care */
183 /* error don't care */
184 d->dma.status = 0; /* BIT(0) should be 0 for HW_OWNED */
185 d->dma.length = sz;
186 vring->ctx[i] = skb;
187
188 return 0;
189}
190
191/**
192 * Adds radiotap header
193 *
194 * Any error indicated as "Bad FCS"
195 *
196 * Vendor data for 04:ce:14-1 (Wilocity-1) consists of:
197 * - Rx descriptor: 32 bytes
198 * - Phy info
199 */
200static void wil_rx_add_radiotap_header(struct wil6210_priv *wil,
201 struct sk_buff *skb,
202 volatile struct vring_rx_desc *d)
203{
204 struct wireless_dev *wdev = wil->wdev;
205 struct wil6210_rtap {
206 struct ieee80211_radiotap_header rthdr;
207 /* fields should be in the order of bits in rthdr.it_present */
208 /* flags */
209 u8 flags;
210 /* channel */
211 __le16 chnl_freq __aligned(2);
212 __le16 chnl_flags;
213 /* MCS */
214 u8 mcs_present;
215 u8 mcs_flags;
216 u8 mcs_index;
217 } __packed;
218 struct wil6210_rtap_vendor {
219 struct wil6210_rtap rtap;
220 /* vendor */
221 u8 vendor_oui[3] __aligned(2);
222 u8 vendor_ns;
223 __le16 vendor_skip;
224 u8 vendor_data[0];
225 } __packed;
226 struct wil6210_rtap_vendor *rtap_vendor;
227 int rtap_len = sizeof(struct wil6210_rtap);
228 int phy_length = 0; /* phy info header size, bytes */
229 static char phy_data[128];
230 struct ieee80211_channel *ch = wdev->preset_chandef.chan;
231
232 if (rtap_include_phy_info) {
233 rtap_len = sizeof(*rtap_vendor) + sizeof(*d);
234 /* calculate additional length */
235 if (d->dma.status & RX_DMA_STATUS_PHY_INFO) {
236 /**
237 * PHY info starts from 8-byte boundary
238 * there are 8-byte lines, last line may be partially
239 * written (HW bug), thus FW configures for last line
240 * to be excessive. Driver skips this last line.
241 */
242 int len = min_t(int, 8 + sizeof(phy_data),
243 wil_rxdesc_phy_length(d));
244 if (len > 8) {
245 void *p = skb_tail_pointer(skb);
246 void *pa = PTR_ALIGN(p, 8);
247 if (skb_tailroom(skb) >= len + (pa - p)) {
248 phy_length = len - 8;
249 memcpy(phy_data, pa, phy_length);
250 }
251 }
252 }
253 rtap_len += phy_length;
254 }
255
256 if (skb_headroom(skb) < rtap_len &&
257 pskb_expand_head(skb, rtap_len, 0, GFP_ATOMIC)) {
258 wil_err(wil, "Unable to expand headrom to %d\n", rtap_len);
259 return;
260 }
261
262 rtap_vendor = (void *)skb_push(skb, rtap_len);
263 memset(rtap_vendor, 0, rtap_len);
264
265 rtap_vendor->rtap.rthdr.it_version = PKTHDR_RADIOTAP_VERSION;
266 rtap_vendor->rtap.rthdr.it_len = cpu_to_le16(rtap_len);
267 rtap_vendor->rtap.rthdr.it_present = cpu_to_le32(
268 (1 << IEEE80211_RADIOTAP_FLAGS) |
269 (1 << IEEE80211_RADIOTAP_CHANNEL) |
270 (1 << IEEE80211_RADIOTAP_MCS));
271 if (d->dma.status & RX_DMA_STATUS_ERROR)
272 rtap_vendor->rtap.flags |= IEEE80211_RADIOTAP_F_BADFCS;
273
274 rtap_vendor->rtap.chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
275 rtap_vendor->rtap.chnl_flags = cpu_to_le16(0);
276
277 rtap_vendor->rtap.mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
278 rtap_vendor->rtap.mcs_flags = 0;
279 rtap_vendor->rtap.mcs_index = wil_rxdesc_mcs(d);
280
281 if (rtap_include_phy_info) {
282 rtap_vendor->rtap.rthdr.it_present |= cpu_to_le32(1 <<
283 IEEE80211_RADIOTAP_VENDOR_NAMESPACE);
284 /* OUI for Wilocity 04:ce:14 */
285 rtap_vendor->vendor_oui[0] = 0x04;
286 rtap_vendor->vendor_oui[1] = 0xce;
287 rtap_vendor->vendor_oui[2] = 0x14;
288 rtap_vendor->vendor_ns = 1;
289 /* Rx descriptor + PHY data */
290 rtap_vendor->vendor_skip = cpu_to_le16(sizeof(*d) +
291 phy_length);
292 memcpy(rtap_vendor->vendor_data, (void *)d, sizeof(*d));
293 memcpy(rtap_vendor->vendor_data + sizeof(*d), phy_data,
294 phy_length);
295 }
296}
297
298/*
299 * Fast swap in place between 2 registers
300 */
301static void wil_swap_u16(u16 *a, u16 *b)
302{
303 *a ^= *b;
304 *b ^= *a;
305 *a ^= *b;
306}
307
308static void wil_swap_ethaddr(void *data)
309{
310 struct ethhdr *eth = data;
311 u16 *s = (u16 *)eth->h_source;
312 u16 *d = (u16 *)eth->h_dest;
313
314 wil_swap_u16(s++, d++);
315 wil_swap_u16(s++, d++);
316 wil_swap_u16(s, d);
317}
318
319/**
320 * reap 1 frame from @swhead
321 *
322 * Safe to call from IRQ
323 */
324static struct sk_buff *wil_vring_reap_rx(struct wil6210_priv *wil,
325 struct vring *vring)
326{
327 struct device *dev = wil_to_dev(wil);
328 struct net_device *ndev = wil_to_ndev(wil);
329 volatile struct vring_rx_desc *d;
330 struct sk_buff *skb;
331 dma_addr_t pa;
332 unsigned int sz = RX_BUF_LEN;
333 u8 ftype;
334 u8 ds_bits;
335
336 if (wil_vring_is_empty(vring))
337 return NULL;
338
339 d = &(vring->va[vring->swhead].rx);
340 if (!(d->dma.status & RX_DMA_STATUS_DU)) {
341 /* it is not error, we just reached end of Rx done area */
342 return NULL;
343 }
344
345 pa = d->dma.addr_low | ((u64)d->dma.addr_high << 32);
346 skb = vring->ctx[vring->swhead];
347 dma_unmap_single(dev, pa, sz, DMA_FROM_DEVICE);
348 skb_trim(skb, d->dma.length);
349
350 wil->stats.last_mcs_rx = wil_rxdesc_mcs(d);
351
352 /* use radiotap header only if required */
353 if (ndev->type == ARPHRD_IEEE80211_RADIOTAP)
354 wil_rx_add_radiotap_header(wil, skb, d);
355
356 wil_dbg_TXRX(wil, "Rx[%3d] : %d bytes\n", vring->swhead, d->dma.length);
357 wil_hex_dump_TXRX("Rx ", DUMP_PREFIX_NONE, 32, 4,
358 (const void *)d, sizeof(*d), false);
359
360 wil_vring_advance_head(vring, 1);
361
362 /* no extra checks if in sniffer mode */
363 if (ndev->type != ARPHRD_ETHER)
364 return skb;
365 /*
366 * Non-data frames may be delivered through Rx DMA channel (ex: BAR)
367 * Driver should recognize it by frame type, that is found
368 * in Rx descriptor. If type is not data, it is 802.11 frame as is
369 */
370 ftype = wil_rxdesc_ftype(d) << 2;
371 if (ftype != IEEE80211_FTYPE_DATA) {
372 wil_dbg_TXRX(wil, "Non-data frame ftype 0x%08x\n", ftype);
373 /* TODO: process it */
374 kfree_skb(skb);
375 return NULL;
376 }
377
378 if (skb->len < ETH_HLEN) {
379 wil_err(wil, "Short frame, len = %d\n", skb->len);
380 /* TODO: process it (i.e. BAR) */
381 kfree_skb(skb);
382 return NULL;
383 }
384
385 ds_bits = wil_rxdesc_ds_bits(d);
386 if (ds_bits == 1) {
387 /*
388 * HW bug - in ToDS mode, i.e. Rx on AP side,
389 * addresses get swapped
390 */
391 wil_swap_ethaddr(skb->data);
392 }
393
394 return skb;
395}
396
397/**
398 * allocate and fill up to @count buffers in rx ring
399 * buffers posted at @swtail
400 */
401static int wil_rx_refill(struct wil6210_priv *wil, int count)
402{
403 struct net_device *ndev = wil_to_ndev(wil);
404 struct vring *v = &wil->vring_rx;
405 u32 next_tail;
406 int rc = 0;
407 int headroom = ndev->type == ARPHRD_IEEE80211_RADIOTAP ?
408 WIL6210_RTAP_SIZE : 0;
409
410 for (; next_tail = wil_vring_next_tail(v),
411 (next_tail != v->swhead) && (count-- > 0);
412 v->swtail = next_tail) {
413 rc = wil_vring_alloc_skb(wil, v, v->swtail, headroom);
414 if (rc) {
415 wil_err(wil, "Error %d in wil_rx_refill[%d]\n",
416 rc, v->swtail);
417 break;
418 }
419 }
420 iowrite32(v->swtail, wil->csr + HOSTADDR(v->hwtail));
421
422 return rc;
423}
424
425/*
426 * Pass Rx packet to the netif. Update statistics.
427 */
428static void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
429{
430 int rc;
431 unsigned int len = skb->len;
432
433 if (in_interrupt())
434 rc = netif_rx(skb);
435 else
436 rc = netif_rx_ni(skb);
437
438 if (likely(rc == NET_RX_SUCCESS)) {
439 ndev->stats.rx_packets++;
440 ndev->stats.rx_bytes += len;
441
442 } else {
443 ndev->stats.rx_dropped++;
444 }
445}
446
447/**
448 * Proceed all completed skb's from Rx VRING
449 *
450 * Safe to call from IRQ
451 */
452void wil_rx_handle(struct wil6210_priv *wil)
453{
454 struct net_device *ndev = wil_to_ndev(wil);
455 struct vring *v = &wil->vring_rx;
456 struct sk_buff *skb;
457
458 if (!v->va) {
459 wil_err(wil, "Rx IRQ while Rx not yet initialized\n");
460 return;
461 }
462 wil_dbg_TXRX(wil, "%s()\n", __func__);
463 while (NULL != (skb = wil_vring_reap_rx(wil, v))) {
464 wil_hex_dump_TXRX("Rx ", DUMP_PREFIX_OFFSET, 16, 1,
465 skb->data, skb_headlen(skb), false);
466
467 skb_orphan(skb);
468
469 if (wil->wdev->iftype == NL80211_IFTYPE_MONITOR) {
470 skb->dev = ndev;
471 skb_reset_mac_header(skb);
472 skb->ip_summed = CHECKSUM_UNNECESSARY;
473 skb->pkt_type = PACKET_OTHERHOST;
474 skb->protocol = htons(ETH_P_802_2);
475
476 } else {
477 skb->protocol = eth_type_trans(skb, ndev);
478 }
479
480 wil_netif_rx_any(skb, ndev);
481 }
482 wil_rx_refill(wil, v->size);
483}
484
485int wil_rx_init(struct wil6210_priv *wil)
486{
487 struct net_device *ndev = wil_to_ndev(wil);
488 struct wireless_dev *wdev = wil->wdev;
489 struct vring *vring = &wil->vring_rx;
490 int rc;
491 struct wmi_cfg_rx_chain_cmd cmd = {
492 .action = WMI_RX_CHAIN_ADD,
493 .rx_sw_ring = {
494 .max_mpdu_size = cpu_to_le16(RX_BUF_LEN),
495 },
496 .mid = 0, /* TODO - what is it? */
497 .decap_trans_type = WMI_DECAP_TYPE_802_3,
498 };
499 struct {
500 struct wil6210_mbox_hdr_wmi wmi;
501 struct wmi_cfg_rx_chain_done_event evt;
502 } __packed evt;
503
504 vring->size = WIL6210_RX_RING_SIZE;
505 rc = wil_vring_alloc(wil, vring);
506 if (rc)
507 return rc;
508
509 cmd.rx_sw_ring.ring_mem_base = cpu_to_le64(vring->pa);
510 cmd.rx_sw_ring.ring_size = cpu_to_le16(vring->size);
511 if (wdev->iftype == NL80211_IFTYPE_MONITOR) {
512 struct ieee80211_channel *ch = wdev->preset_chandef.chan;
513
514 cmd.sniffer_cfg.mode = cpu_to_le32(WMI_SNIFFER_ON);
515 if (ch)
516 cmd.sniffer_cfg.channel = ch->hw_value - 1;
517 cmd.sniffer_cfg.phy_info_mode =
518 cpu_to_le32(ndev->type == ARPHRD_IEEE80211_RADIOTAP);
519 cmd.sniffer_cfg.phy_support =
520 cpu_to_le32((wil->monitor_flags & MONITOR_FLAG_CONTROL)
521 ? WMI_SNIFFER_CP : WMI_SNIFFER_DP);
522 }
523 /* typical time for secure PCP is 840ms */
524 rc = wmi_call(wil, WMI_CFG_RX_CHAIN_CMDID, &cmd, sizeof(cmd),
525 WMI_CFG_RX_CHAIN_DONE_EVENTID, &evt, sizeof(evt), 2000);
526 if (rc)
527 goto err_free;
528
529 vring->hwtail = le32_to_cpu(evt.evt.rx_ring_tail_ptr);
530
531 wil_dbg(wil, "Rx init: status %d tail 0x%08x\n",
532 le32_to_cpu(evt.evt.status), vring->hwtail);
533
534 rc = wil_rx_refill(wil, vring->size);
535 if (rc)
536 goto err_free;
537
538 return 0;
539 err_free:
540 wil_vring_free(wil, vring, 0);
541
542 return rc;
543}
544
545void wil_rx_fini(struct wil6210_priv *wil)
546{
547 struct vring *vring = &wil->vring_rx;
548
549 if (vring->va) {
550 int rc;
551 struct wmi_cfg_rx_chain_cmd cmd = {
552 .action = cpu_to_le32(WMI_RX_CHAIN_DEL),
553 .rx_sw_ring = {
554 .max_mpdu_size = cpu_to_le16(RX_BUF_LEN),
555 },
556 };
557 struct {
558 struct wil6210_mbox_hdr_wmi wmi;
559 struct wmi_cfg_rx_chain_done_event cfg;
560 } __packed wmi_rx_cfg_reply;
561
562 rc = wmi_call(wil, WMI_CFG_RX_CHAIN_CMDID, &cmd, sizeof(cmd),
563 WMI_CFG_RX_CHAIN_DONE_EVENTID,
564 &wmi_rx_cfg_reply, sizeof(wmi_rx_cfg_reply),
565 100);
566 wil_vring_free(wil, vring, 0);
567 }
568}
569
570int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size,
571 int cid, int tid)
572{
573 int rc;
574 struct wmi_vring_cfg_cmd cmd = {
575 .action = cpu_to_le32(WMI_VRING_CMD_ADD),
576 .vring_cfg = {
577 .tx_sw_ring = {
578 .max_mpdu_size = cpu_to_le16(TX_BUF_LEN),
579 },
580 .ringid = id,
581 .cidxtid = (cid & 0xf) | ((tid & 0xf) << 4),
582 .encap_trans_type = WMI_VRING_ENC_TYPE_802_3,
583 .mac_ctrl = 0,
584 .to_resolution = 0,
585 .agg_max_wsize = 16,
586 .schd_params = {
587 .priority = cpu_to_le16(0),
588 .timeslot_us = cpu_to_le16(0xfff),
589 },
590 },
591 };
592 struct {
593 struct wil6210_mbox_hdr_wmi wmi;
594 struct wmi_vring_cfg_done_event cmd;
595 } __packed reply;
596 struct vring *vring = &wil->vring_tx[id];
597
598 if (vring->va) {
599 wil_err(wil, "Tx ring [%d] already allocated\n", id);
600 rc = -EINVAL;
601 goto out;
602 }
603
604 vring->size = size;
605 rc = wil_vring_alloc(wil, vring);
606 if (rc)
607 goto out;
608
609 cmd.vring_cfg.tx_sw_ring.ring_mem_base = cpu_to_le64(vring->pa);
610 cmd.vring_cfg.tx_sw_ring.ring_size = cpu_to_le16(vring->size);
611
612 rc = wmi_call(wil, WMI_VRING_CFG_CMDID, &cmd, sizeof(cmd),
613 WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply), 100);
614 if (rc)
615 goto out_free;
616
617 if (reply.cmd.status != WMI_VRING_CFG_SUCCESS) {
618 wil_err(wil, "Tx config failed, status 0x%02x\n",
619 reply.cmd.status);
620 goto out_free;
621 }
622 vring->hwtail = le32_to_cpu(reply.cmd.tx_vring_tail_ptr);
623
624 return 0;
625 out_free:
626 wil_vring_free(wil, vring, 1);
627 out:
628
629 return rc;
630}
631
632void wil_vring_fini_tx(struct wil6210_priv *wil, int id)
633{
634 struct vring *vring = &wil->vring_tx[id];
635
636 if (!vring->va)
637 return;
638
639 wil_vring_free(wil, vring, 1);
640}
641
642static struct vring *wil_find_tx_vring(struct wil6210_priv *wil,
643 struct sk_buff *skb)
644{
645 struct vring *v = &wil->vring_tx[0];
646
647 if (v->va)
648 return v;
649
650 return NULL;
651}
652
653static int wil_tx_desc_map(volatile struct vring_tx_desc *d,
654 dma_addr_t pa, u32 len)
655{
656 d->dma.addr_low = lower_32_bits(pa);
657 d->dma.addr_high = (u16)upper_32_bits(pa);
658 d->dma.ip_length = 0;
659 /* 0..6: mac_length; 7:ip_version 0-IP6 1-IP4*/
660 d->dma.b11 = 0/*14 | BIT(7)*/;
661 d->dma.error = 0;
662 d->dma.status = 0; /* BIT(0) should be 0 for HW_OWNED */
663 d->dma.length = len;
664 d->dma.d0 = 0;
665 d->mac.d[0] = 0;
666 d->mac.d[1] = 0;
667 d->mac.d[2] = 0;
668 d->mac.ucode_cmd = 0;
669 /* use dst index 0 */
670 d->mac.d[1] |= BIT(MAC_CFG_DESC_TX_1_DST_INDEX_EN_POS) |
671 (0 << MAC_CFG_DESC_TX_1_DST_INDEX_POS);
672 /* translation type: 0 - bypass; 1 - 802.3; 2 - native wifi */
673 d->mac.d[2] = BIT(MAC_CFG_DESC_TX_2_SNAP_HDR_INSERTION_EN_POS) |
674 (1 << MAC_CFG_DESC_TX_2_L2_TRANSLATION_TYPE_POS);
675
676 return 0;
677}
678
679static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
680 struct sk_buff *skb)
681{
682 struct device *dev = wil_to_dev(wil);
683 volatile struct vring_tx_desc *d;
684 u32 swhead = vring->swhead;
685 int avail = wil_vring_avail_tx(vring);
686 int nr_frags = skb_shinfo(skb)->nr_frags;
687 uint f;
688 int vring_index = vring - wil->vring_tx;
689 uint i = swhead;
690 dma_addr_t pa;
691
692 wil_dbg_TXRX(wil, "%s()\n", __func__);
693
694 if (avail < vring->size/8)
695 netif_tx_stop_all_queues(wil_to_ndev(wil));
696 if (avail < 1 + nr_frags) {
697 wil_err(wil, "Tx ring full. No space for %d fragments\n",
698 1 + nr_frags);
699 return -ENOMEM;
700 }
701 d = &(vring->va[i].tx);
702
703 /* FIXME FW can accept only unicast frames for the peer */
704 memcpy(skb->data, wil->dst_addr[vring_index], ETH_ALEN);
705
706 pa = dma_map_single(dev, skb->data,
707 skb_headlen(skb), DMA_TO_DEVICE);
708
709 wil_dbg_TXRX(wil, "Tx skb %d bytes %p -> %#08llx\n", skb_headlen(skb),
710 skb->data, (unsigned long long)pa);
711 wil_hex_dump_TXRX("Tx ", DUMP_PREFIX_OFFSET, 16, 1,
712 skb->data, skb_headlen(skb), false);
713
714 if (unlikely(dma_mapping_error(dev, pa)))
715 return -EINVAL;
716 /* 1-st segment */
717 wil_tx_desc_map(d, pa, skb_headlen(skb));
718 d->mac.d[2] |= ((nr_frags + 1) <<
719 MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
720 /* middle segments */
721 for (f = 0; f < nr_frags; f++) {
722 const struct skb_frag_struct *frag =
723 &skb_shinfo(skb)->frags[f];
724 int len = skb_frag_size(frag);
725 i = (swhead + f + 1) % vring->size;
726 d = &(vring->va[i].tx);
727 pa = skb_frag_dma_map(dev, frag, 0, skb_frag_size(frag),
728 DMA_TO_DEVICE);
729 if (unlikely(dma_mapping_error(dev, pa)))
730 goto dma_error;
731 wil_tx_desc_map(d, pa, len);
732 vring->ctx[i] = NULL;
733 }
734 /* for the last seg only */
735 d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_EOP_POS);
736 d->dma.d0 |= BIT(9); /* BUG: undocumented bit */
737 d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS);
738 d->dma.d0 |= (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
739
740 wil_hex_dump_TXRX("Tx ", DUMP_PREFIX_NONE, 32, 4,
741 (const void *)d, sizeof(*d), false);
742
743 /* advance swhead */
744 wil_vring_advance_head(vring, nr_frags + 1);
745 wil_dbg_TXRX(wil, "Tx swhead %d -> %d\n", swhead, vring->swhead);
746 iowrite32(vring->swhead, wil->csr + HOSTADDR(vring->hwtail));
747 /* hold reference to skb
748 * to prevent skb release before accounting
749 * in case of immediate "tx done"
750 */
751 vring->ctx[i] = skb_get(skb);
752
753 return 0;
754 dma_error:
755 /* unmap what we have mapped */
756 /* Note: increment @f to operate with positive index */
757 for (f++; f > 0; f--) {
758 i = (swhead + f) % vring->size;
759 d = &(vring->va[i].tx);
760 d->dma.status = TX_DMA_STATUS_DU;
761 pa = d->dma.addr_low | ((u64)d->dma.addr_high << 32);
762 if (vring->ctx[i])
763 dma_unmap_single(dev, pa, d->dma.length, DMA_TO_DEVICE);
764 else
765 dma_unmap_page(dev, pa, d->dma.length, DMA_TO_DEVICE);
766 }
767
768 return -EINVAL;
769}
770
771
772netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
773{
774 struct wil6210_priv *wil = ndev_to_wil(ndev);
775 struct vring *vring;
776 int rc;
777
778 wil_dbg_TXRX(wil, "%s()\n", __func__);
779 if (!test_bit(wil_status_fwready, &wil->status)) {
780 wil_err(wil, "FW not ready\n");
781 goto drop;
782 }
783 if (!test_bit(wil_status_fwconnected, &wil->status)) {
784 wil_err(wil, "FW not connected\n");
785 goto drop;
786 }
787 if (wil->wdev->iftype == NL80211_IFTYPE_MONITOR) {
788 wil_err(wil, "Xmit in monitor mode not supported\n");
789 goto drop;
790 }
791 if (skb->protocol == cpu_to_be16(ETH_P_PAE)) {
792 rc = wmi_tx_eapol(wil, skb);
793 } else {
794 /* find vring */
795 vring = wil_find_tx_vring(wil, skb);
796 if (!vring) {
797 wil_err(wil, "No Tx VRING available\n");
798 goto drop;
799 }
800 /* set up vring entry */
801 rc = wil_tx_vring(wil, vring, skb);
802 }
803 switch (rc) {
804 case 0:
805 ndev->stats.tx_packets++;
806 ndev->stats.tx_bytes += skb->len;
807 dev_kfree_skb_any(skb);
808 return NETDEV_TX_OK;
809 case -ENOMEM:
810 return NETDEV_TX_BUSY;
811 default:
812 ; /* goto drop; */
813 break;
814 }
815 drop:
816 netif_tx_stop_all_queues(ndev);
817 ndev->stats.tx_dropped++;
818 dev_kfree_skb_any(skb);
819
820 return NET_XMIT_DROP;
821}
822
823/**
824 * Clean up transmitted skb's from the Tx VRING
825 *
826 * Safe to call from IRQ
827 */
828void wil_tx_complete(struct wil6210_priv *wil, int ringid)
829{
830 struct device *dev = wil_to_dev(wil);
831 struct vring *vring = &wil->vring_tx[ringid];
832
833 if (!vring->va) {
834 wil_err(wil, "Tx irq[%d]: vring not initialized\n", ringid);
835 return;
836 }
837
838 wil_dbg_TXRX(wil, "%s(%d)\n", __func__, ringid);
839
840 while (!wil_vring_is_empty(vring)) {
841 volatile struct vring_tx_desc *d = &vring->va[vring->swtail].tx;
842 dma_addr_t pa;
843 struct sk_buff *skb;
844 if (!(d->dma.status & TX_DMA_STATUS_DU))
845 break;
846
847 wil_dbg_TXRX(wil,
848 "Tx[%3d] : %d bytes, status 0x%02x err 0x%02x\n",
849 vring->swtail, d->dma.length, d->dma.status,
850 d->dma.error);
851 wil_hex_dump_TXRX("TxC ", DUMP_PREFIX_NONE, 32, 4,
852 (const void *)d, sizeof(*d), false);
853
854 pa = d->dma.addr_low | ((u64)d->dma.addr_high << 32);
855 skb = vring->ctx[vring->swtail];
856 if (skb) {
857 dma_unmap_single(dev, pa, d->dma.length, DMA_TO_DEVICE);
858 dev_kfree_skb_any(skb);
859 vring->ctx[vring->swtail] = NULL;
860 } else {
861 dma_unmap_page(dev, pa, d->dma.length, DMA_TO_DEVICE);
862 }
863 d->dma.addr_low = 0;
864 d->dma.addr_high = 0;
865 d->dma.length = 0;
866 d->dma.status = TX_DMA_STATUS_DU;
867 vring->swtail = wil_vring_next_tail(vring);
868 }
869 if (wil_vring_avail_tx(vring) > vring->size/4)
870 netif_tx_wake_all_queues(wil_to_ndev(wil));
871}
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
new file mode 100644
index 00000000000..45a61f597c5
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -0,0 +1,362 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef WIL6210_TXRX_H
18#define WIL6210_TXRX_H
19
20#define BUF_SW_OWNED (1)
21#define BUF_HW_OWNED (0)
22
23/* size of max. Rx packet */
24#define RX_BUF_LEN (2048)
25#define TX_BUF_LEN (2048)
26/* how many bytes to reserve for rtap header? */
27#define WIL6210_RTAP_SIZE (128)
28
29/* Tx/Rx path */
30/*
31 * Tx descriptor - MAC part
32 * [dword 0]
33 * bit 0.. 9 : lifetime_expiry_value:10
34 * bit 10 : interrup_en:1
35 * bit 11 : status_en:1
36 * bit 12..13 : txss_override:2
37 * bit 14 : timestamp_insertion:1
38 * bit 15 : duration_preserve:1
39 * bit 16..21 : reserved0:6
40 * bit 22..26 : mcs_index:5
41 * bit 27 : mcs_en:1
42 * bit 28..29 : reserved1:2
43 * bit 30 : reserved2:1
44 * bit 31 : sn_preserved:1
45 * [dword 1]
46 * bit 0.. 3 : pkt_mode:4
47 * bit 4 : pkt_mode_en:1
48 * bit 5.. 7 : reserved0:3
49 * bit 8..13 : reserved1:6
50 * bit 14 : reserved2:1
51 * bit 15 : ack_policy_en:1
52 * bit 16..19 : dst_index:4
53 * bit 20 : dst_index_en:1
54 * bit 21..22 : ack_policy:2
55 * bit 23 : lifetime_en:1
56 * bit 24..30 : max_retry:7
57 * bit 31 : max_retry_en:1
58 * [dword 2]
59 * bit 0.. 7 : num_of_descriptors:8
60 * bit 8..17 : reserved:10
61 * bit 18..19 : l2_translation_type:2
62 * bit 20 : snap_hdr_insertion_en:1
63 * bit 21 : vlan_removal_en:1
64 * bit 22..31 : reserved0:10
65 * [dword 3]
66 * bit 0.. 31: ucode_cmd:32
67 */
68struct vring_tx_mac {
69 u32 d[3];
70 u32 ucode_cmd;
71} __packed;
72
73/* TX MAC Dword 0 */
74#define MAC_CFG_DESC_TX_0_LIFETIME_EXPIRY_VALUE_POS 0
75#define MAC_CFG_DESC_TX_0_LIFETIME_EXPIRY_VALUE_LEN 10
76#define MAC_CFG_DESC_TX_0_LIFETIME_EXPIRY_VALUE_MSK 0x3FF
77
78#define MAC_CFG_DESC_TX_0_INTERRUP_EN_POS 10
79#define MAC_CFG_DESC_TX_0_INTERRUP_EN_LEN 1
80#define MAC_CFG_DESC_TX_0_INTERRUP_EN_MSK 0x400
81
82#define MAC_CFG_DESC_TX_0_STATUS_EN_POS 11
83#define MAC_CFG_DESC_TX_0_STATUS_EN_LEN 1
84#define MAC_CFG_DESC_TX_0_STATUS_EN_MSK 0x800
85
86#define MAC_CFG_DESC_TX_0_TXSS_OVERRIDE_POS 12
87#define MAC_CFG_DESC_TX_0_TXSS_OVERRIDE_LEN 2
88#define MAC_CFG_DESC_TX_0_TXSS_OVERRIDE_MSK 0x3000
89
90#define MAC_CFG_DESC_TX_0_TIMESTAMP_INSERTION_POS 14
91#define MAC_CFG_DESC_TX_0_TIMESTAMP_INSERTION_LEN 1
92#define MAC_CFG_DESC_TX_0_TIMESTAMP_INSERTION_MSK 0x4000
93
94#define MAC_CFG_DESC_TX_0_DURATION_PRESERVE_POS 15
95#define MAC_CFG_DESC_TX_0_DURATION_PRESERVE_LEN 1
96#define MAC_CFG_DESC_TX_0_DURATION_PRESERVE_MSK 0x8000
97
98#define MAC_CFG_DESC_TX_0_MCS_INDEX_POS 22
99#define MAC_CFG_DESC_TX_0_MCS_INDEX_LEN 5
100#define MAC_CFG_DESC_TX_0_MCS_INDEX_MSK 0x7C00000
101
102#define MAC_CFG_DESC_TX_0_MCS_EN_POS 27
103#define MAC_CFG_DESC_TX_0_MCS_EN_LEN 1
104#define MAC_CFG_DESC_TX_0_MCS_EN_MSK 0x8000000
105
106#define MAC_CFG_DESC_TX_0_SN_PRESERVED_POS 31
107#define MAC_CFG_DESC_TX_0_SN_PRESERVED_LEN 1
108#define MAC_CFG_DESC_TX_0_SN_PRESERVED_MSK 0x80000000
109
110/* TX MAC Dword 1 */
111#define MAC_CFG_DESC_TX_1_PKT_MODE_POS 0
112#define MAC_CFG_DESC_TX_1_PKT_MODE_LEN 4
113#define MAC_CFG_DESC_TX_1_PKT_MODE_MSK 0xF
114
115#define MAC_CFG_DESC_TX_1_PKT_MODE_EN_POS 4
116#define MAC_CFG_DESC_TX_1_PKT_MODE_EN_LEN 1
117#define MAC_CFG_DESC_TX_1_PKT_MODE_EN_MSK 0x10
118
119#define MAC_CFG_DESC_TX_1_ACK_POLICY_EN_POS 15
120#define MAC_CFG_DESC_TX_1_ACK_POLICY_EN_LEN 1
121#define MAC_CFG_DESC_TX_1_ACK_POLICY_EN_MSK 0x8000
122
123#define MAC_CFG_DESC_TX_1_DST_INDEX_POS 16
124#define MAC_CFG_DESC_TX_1_DST_INDEX_LEN 4
125#define MAC_CFG_DESC_TX_1_DST_INDEX_MSK 0xF0000
126
127#define MAC_CFG_DESC_TX_1_DST_INDEX_EN_POS 20
128#define MAC_CFG_DESC_TX_1_DST_INDEX_EN_LEN 1
129#define MAC_CFG_DESC_TX_1_DST_INDEX_EN_MSK 0x100000
130
131#define MAC_CFG_DESC_TX_1_ACK_POLICY_POS 21
132#define MAC_CFG_DESC_TX_1_ACK_POLICY_LEN 2
133#define MAC_CFG_DESC_TX_1_ACK_POLICY_MSK 0x600000
134
135#define MAC_CFG_DESC_TX_1_LIFETIME_EN_POS 23
136#define MAC_CFG_DESC_TX_1_LIFETIME_EN_LEN 1
137#define MAC_CFG_DESC_TX_1_LIFETIME_EN_MSK 0x800000
138
139#define MAC_CFG_DESC_TX_1_MAX_RETRY_POS 24
140#define MAC_CFG_DESC_TX_1_MAX_RETRY_LEN 7
141#define MAC_CFG_DESC_TX_1_MAX_RETRY_MSK 0x7F000000
142
143#define MAC_CFG_DESC_TX_1_MAX_RETRY_EN_POS 31
144#define MAC_CFG_DESC_TX_1_MAX_RETRY_EN_LEN 1
145#define MAC_CFG_DESC_TX_1_MAX_RETRY_EN_MSK 0x80000000
146
147/* TX MAC Dword 2 */
148#define MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS 0
149#define MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_LEN 8
150#define MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_MSK 0xFF
151
152#define MAC_CFG_DESC_TX_2_RESERVED_POS 8
153#define MAC_CFG_DESC_TX_2_RESERVED_LEN 10
154#define MAC_CFG_DESC_TX_2_RESERVED_MSK 0x3FF00
155
156#define MAC_CFG_DESC_TX_2_L2_TRANSLATION_TYPE_POS 18
157#define MAC_CFG_DESC_TX_2_L2_TRANSLATION_TYPE_LEN 2
158#define MAC_CFG_DESC_TX_2_L2_TRANSLATION_TYPE_MSK 0xC0000
159
160#define MAC_CFG_DESC_TX_2_SNAP_HDR_INSERTION_EN_POS 20
161#define MAC_CFG_DESC_TX_2_SNAP_HDR_INSERTION_EN_LEN 1
162#define MAC_CFG_DESC_TX_2_SNAP_HDR_INSERTION_EN_MSK 0x100000
163
164#define MAC_CFG_DESC_TX_2_VLAN_REMOVAL_EN_POS 21
165#define MAC_CFG_DESC_TX_2_VLAN_REMOVAL_EN_LEN 1
166#define MAC_CFG_DESC_TX_2_VLAN_REMOVAL_EN_MSK 0x200000
167
168/* TX MAC Dword 3 */
169#define MAC_CFG_DESC_TX_3_UCODE_CMD_POS 0
170#define MAC_CFG_DESC_TX_3_UCODE_CMD_LEN 32
171#define MAC_CFG_DESC_TX_3_UCODE_CMD_MSK 0xFFFFFFFF
172
173/* TX DMA Dword 0 */
174#define DMA_CFG_DESC_TX_0_L4_LENGTH_POS 0
175#define DMA_CFG_DESC_TX_0_L4_LENGTH_LEN 8
176#define DMA_CFG_DESC_TX_0_L4_LENGTH_MSK 0xFF
177
178#define DMA_CFG_DESC_TX_0_CMD_EOP_POS 8
179#define DMA_CFG_DESC_TX_0_CMD_EOP_LEN 1
180#define DMA_CFG_DESC_TX_0_CMD_EOP_MSK 0x100
181
182#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS 10
183#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_LEN 1
184#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_MSK 0x400
185
186#define DMA_CFG_DESC_TX_0_SEGMENT_BUF_DETAILS_POS 11
187#define DMA_CFG_DESC_TX_0_SEGMENT_BUF_DETAILS_LEN 2
188#define DMA_CFG_DESC_TX_0_SEGMENT_BUF_DETAILS_MSK 0x1800
189
190#define DMA_CFG_DESC_TX_0_TCP_SEG_EN_POS 13
191#define DMA_CFG_DESC_TX_0_TCP_SEG_EN_LEN 1
192#define DMA_CFG_DESC_TX_0_TCP_SEG_EN_MSK 0x2000
193
194#define DMA_CFG_DESC_TX_0_IPV4_CHECKSUM_EN_POS 14
195#define DMA_CFG_DESC_TX_0_IPV4_CHECKSUM_EN_LEN 1
196#define DMA_CFG_DESC_TX_0_IPV4_CHECKSUM_EN_MSK 0x4000
197
198#define DMA_CFG_DESC_TX_0_TCP_UDP_CHECKSUM_EN_POS 15
199#define DMA_CFG_DESC_TX_0_TCP_UDP_CHECKSUM_EN_LEN 1
200#define DMA_CFG_DESC_TX_0_TCP_UDP_CHECKSUM_EN_MSK 0x8000
201
202#define DMA_CFG_DESC_TX_0_QID_POS 16
203#define DMA_CFG_DESC_TX_0_QID_LEN 5
204#define DMA_CFG_DESC_TX_0_QID_MSK 0x1F0000
205
206#define DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_POS 21
207#define DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_LEN 1
208#define DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_MSK 0x200000
209
210#define DMA_CFG_DESC_TX_0_L4_TYPE_POS 30
211#define DMA_CFG_DESC_TX_0_L4_TYPE_LEN 2
212#define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000
213
214
215#define TX_DMA_STATUS_DU BIT(0)
216
217struct vring_tx_dma {
218 u32 d0;
219 u32 addr_low;
220 u16 addr_high;
221 u8 ip_length;
222 u8 b11; /* 0..6: mac_length; 7:ip_version */
223 u8 error; /* 0..2: err; 3..7: reserved; */
224 u8 status; /* 0: used; 1..7; reserved */
225 u16 length;
226} __packed;
227
228/*
229 * Rx descriptor - MAC part
230 * [dword 0]
231 * bit 0.. 3 : tid:4 The QoS (b3-0) TID Field
232 * bit 4.. 6 : connection_id:3 :The Source index that was found during
233 * Parsing the TA. This field is used to define the source of the packet
234 * bit 7 : reserved:1
235 * bit 8.. 9 : mac_id:2 : The MAC virtual Ring number (always zero)
236 * bit 10..11 : frame_type:2 : The FC Control (b3-2) - MPDU Type
237 * (management, data, control and extension)
238 * bit 12..15 : frame_subtype:4 : The FC Control (b7-4) - Frame Subtype
239 * bit 16..27 : seq_number:12 The received Sequence number field
240 * bit 28..31 : extended:4 extended subtype
241 * [dword 1]
242 * bit 0.. 3 : reserved
243 * bit 4.. 5 : key_id:2
244 * bit 6 : decrypt_bypass:1
245 * bit 7 : security:1
246 * bit 8.. 9 : ds_bits:2
247 * bit 10 : a_msdu_present:1 from qos header
248 * bit 11 : a_msdu_type:1 from qos header
249 * bit 12 : a_mpdu:1 part of AMPDU aggregation
250 * bit 13 : broadcast:1
251 * bit 14 : mutlicast:1
252 * bit 15 : reserved:1
253 * bit 16..20 : rx_mac_qid:5 The Queue Identifier that the packet
254 * is received from
255 * bit 21..24 : mcs:4
256 * bit 25..28 : mic_icr:4
257 * bit 29..31 : reserved:3
258 * [dword 2]
259 * bit 0.. 2 : time_slot:3 The timeslot that the MPDU is received
260 * bit 3 : fc_protocol_ver:1 The FC Control (b0) - Protocol Version
261 * bit 4 : fc_order:1 The FC Control (b15) -Order
262 * bit 5.. 7 : qos_ack_policy:3 The QoS (b6-5) ack policy Field
263 * bit 8 : esop:1 The QoS (b4) ESOP field
264 * bit 9 : qos_rdg_more_ppdu:1 The QoS (b9) RDG field
265 * bit 10..14 : qos_reserved:5 The QoS (b14-10) Reserved field
266 * bit 15 : qos_ac_constraint:1
267 * bit 16..31 : pn_15_0:16 low 2 bytes of PN
268 * [dword 3]
269 * bit 0..31 : pn_47_16:32 high 4 bytes of PN
270 */
271struct vring_rx_mac {
272 u32 d0;
273 u32 d1;
274 u16 w4;
275 u16 pn_15_0;
276 u32 pn_47_16;
277} __packed;
278
279/*
280 * Rx descriptor - DMA part
281 * [dword 0]
282 * bit 0.. 7 : l4_length:8 layer 4 length
283 * bit 8.. 9 : reserved:2
284 * bit 10 : cmd_dma_it:1
285 * bit 11..15 : reserved:5
286 * bit 16..29 : phy_info_length:14
287 * bit 30..31 : l4_type:2 valid if the L4I bit is set in the status field
288 * [dword 1]
289 * bit 0..31 : addr_low:32 The payload buffer low address
290 * [dword 2]
291 * bit 0..15 : addr_high:16 The payload buffer high address
292 * bit 16..23 : ip_length:8
293 * bit 24..30 : mac_length:7
294 * bit 31 : ip_version:1
295 * [dword 3]
296 * [byte 12] error
297 * [byte 13] status
298 * bit 0 : du:1
299 * bit 1 : eop:1
300 * bit 2 : error:1
301 * bit 3 : mi:1
302 * bit 4 : l3_identified:1
303 * bit 5 : l4_identified:1
304 * bit 6 : phy_info_included:1
305 * bit 7 : reserved:1
306 * [word 7] length
307 *
308 */
309
310#define RX_DMA_D0_CMD_DMA_IT BIT(10)
311
312#define RX_DMA_STATUS_DU BIT(0)
313#define RX_DMA_STATUS_ERROR BIT(2)
314#define RX_DMA_STATUS_PHY_INFO BIT(6)
315
316struct vring_rx_dma {
317 u32 d0;
318 u32 addr_low;
319 u16 addr_high;
320 u8 ip_length;
321 u8 b11;
322 u8 error;
323 u8 status;
324 u16 length;
325} __packed;
326
327struct vring_tx_desc {
328 struct vring_tx_mac mac;
329 struct vring_tx_dma dma;
330} __packed;
331
332struct vring_rx_desc {
333 struct vring_rx_mac mac;
334 struct vring_rx_dma dma;
335} __packed;
336
337union vring_desc {
338 struct vring_tx_desc tx;
339 struct vring_rx_desc rx;
340} __packed;
341
342static inline int wil_rxdesc_phy_length(volatile struct vring_rx_desc *d)
343{
344 return WIL_GET_BITS(d->dma.d0, 16, 29);
345}
346
347static inline int wil_rxdesc_mcs(volatile struct vring_rx_desc *d)
348{
349 return WIL_GET_BITS(d->mac.d1, 21, 24);
350}
351
352static inline int wil_rxdesc_ds_bits(volatile struct vring_rx_desc *d)
353{
354 return WIL_GET_BITS(d->mac.d1, 8, 9);
355}
356
357static inline int wil_rxdesc_ftype(volatile struct vring_rx_desc *d)
358{
359 return WIL_GET_BITS(d->mac.d0, 10, 11);
360}
361
362#endif /* WIL6210_TXRX_H */
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
new file mode 100644
index 00000000000..9bcfffa4006
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -0,0 +1,363 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef __WIL6210_H__
18#define __WIL6210_H__
19
20#include <linux/netdevice.h>
21#include <linux/wireless.h>
22#include <net/cfg80211.h>
23
24#include "dbg_hexdump.h"
25
26#define WIL_NAME "wil6210"
27
28/**
29 * extract bits [@b0:@b1] (inclusive) from the value @x
30 * it should be @b0 <= @b1, or result is incorrect
31 */
32static inline u32 WIL_GET_BITS(u32 x, int b0, int b1)
33{
34 return (x >> b0) & ((1 << (b1 - b0 + 1)) - 1);
35}
36
37#define WIL6210_MEM_SIZE (2*1024*1024UL)
38
39#define WIL6210_TX_QUEUES (4)
40
41#define WIL6210_RX_RING_SIZE (128)
42#define WIL6210_TX_RING_SIZE (128)
43#define WIL6210_MAX_TX_RINGS (24)
44
45/* Hardware definitions begin */
46
47/*
48 * Mapping
49 * RGF File | Host addr | FW addr
50 * | |
51 * user_rgf | 0x000000 | 0x880000
52 * dma_rgf | 0x001000 | 0x881000
53 * pcie_rgf | 0x002000 | 0x882000
54 * | |
55 */
56
57/* Where various structures placed in host address space */
58#define WIL6210_FW_HOST_OFF (0x880000UL)
59
60#define HOSTADDR(fwaddr) (fwaddr - WIL6210_FW_HOST_OFF)
61
62/*
63 * Interrupt control registers block
64 *
65 * each interrupt controlled by the same bit in all registers
66 */
67struct RGF_ICR {
68 u32 ICC; /* Cause Control, RW: 0 - W1C, 1 - COR */
69 u32 ICR; /* Cause, W1C/COR depending on ICC */
70 u32 ICM; /* Cause masked (ICR & ~IMV), W1C/COR depending on ICC */
71 u32 ICS; /* Cause Set, WO */
72 u32 IMV; /* Mask, RW+S/C */
73 u32 IMS; /* Mask Set, write 1 to set */
74 u32 IMC; /* Mask Clear, write 1 to clear */
75} __packed;
76
77/* registers - FW addresses */
78#define RGF_USER_USER_SCRATCH_PAD (0x8802bc)
79#define RGF_USER_USER_ICR (0x880b4c) /* struct RGF_ICR */
80 #define BIT_USER_USER_ICR_SW_INT_2 BIT(18)
81#define RGF_USER_CLKS_CTL_SW_RST_MASK_0 (0x880b14)
82#define RGF_USER_MAC_CPU_0 (0x8801fc)
83#define RGF_USER_USER_CPU_0 (0x8801e0)
84#define RGF_USER_CLKS_CTL_SW_RST_VEC_0 (0x880b04)
85#define RGF_USER_CLKS_CTL_SW_RST_VEC_1 (0x880b08)
86#define RGF_USER_CLKS_CTL_SW_RST_VEC_2 (0x880b0c)
87#define RGF_USER_CLKS_CTL_SW_RST_VEC_3 (0x880b10)
88
89#define RGF_DMA_PSEUDO_CAUSE (0x881c68)
90#define RGF_DMA_PSEUDO_CAUSE_MASK_SW (0x881c6c)
91#define RGF_DMA_PSEUDO_CAUSE_MASK_FW (0x881c70)
92 #define BIT_DMA_PSEUDO_CAUSE_RX BIT(0)
93 #define BIT_DMA_PSEUDO_CAUSE_TX BIT(1)
94 #define BIT_DMA_PSEUDO_CAUSE_MISC BIT(2)
95
96#define RGF_DMA_EP_TX_ICR (0x881bb4) /* struct RGF_ICR */
97 #define BIT_DMA_EP_TX_ICR_TX_DONE BIT(0)
98 #define BIT_DMA_EP_TX_ICR_TX_DONE_N(n) BIT(n+1) /* n = [0..23] */
99#define RGF_DMA_EP_RX_ICR (0x881bd0) /* struct RGF_ICR */
100 #define BIT_DMA_EP_RX_ICR_RX_DONE BIT(0)
101#define RGF_DMA_EP_MISC_ICR (0x881bec) /* struct RGF_ICR */
102 #define BIT_DMA_EP_MISC_ICR_RX_HTRSH BIT(0)
103 #define BIT_DMA_EP_MISC_ICR_TX_NO_ACT BIT(1)
104 #define BIT_DMA_EP_MISC_ICR_FW_INT0 BIT(28)
105 #define BIT_DMA_EP_MISC_ICR_FW_INT1 BIT(29)
106
107/* Interrupt moderation control */
108#define RGF_DMA_ITR_CNT_TRSH (0x881c5c)
109#define RGF_DMA_ITR_CNT_DATA (0x881c60)
110#define RGF_DMA_ITR_CNT_CRL (0x881C64)
111 #define BIT_DMA_ITR_CNT_CRL_EN BIT(0)
112 #define BIT_DMA_ITR_CNT_CRL_EXT_TICK BIT(1)
113 #define BIT_DMA_ITR_CNT_CRL_FOREVER BIT(2)
114 #define BIT_DMA_ITR_CNT_CRL_CLR BIT(3)
115 #define BIT_DMA_ITR_CNT_CRL_REACH_TRSH BIT(4)
116
117/* popular locations */
118#define HOST_MBOX HOSTADDR(RGF_USER_USER_SCRATCH_PAD)
119#define HOST_SW_INT (HOSTADDR(RGF_USER_USER_ICR) + \
120 offsetof(struct RGF_ICR, ICS))
121#define SW_INT_MBOX BIT_USER_USER_ICR_SW_INT_2
122
123/* ISR register bits */
124#define ISR_MISC_FW_READY BIT_DMA_EP_MISC_ICR_FW_INT0
125#define ISR_MISC_MBOX_EVT BIT_DMA_EP_MISC_ICR_FW_INT1
126
127/* Hardware definitions end */
128
129struct wil6210_mbox_ring {
130 u32 base;
131 u16 entry_size; /* max. size of mbox entry, incl. all headers */
132 u16 size;
133 u32 tail;
134 u32 head;
135} __packed;
136
137struct wil6210_mbox_ring_desc {
138 __le32 sync;
139 __le32 addr;
140} __packed;
141
142/* at HOST_OFF_WIL6210_MBOX_CTL */
143struct wil6210_mbox_ctl {
144 struct wil6210_mbox_ring tx;
145 struct wil6210_mbox_ring rx;
146} __packed;
147
148struct wil6210_mbox_hdr {
149 __le16 seq;
150 __le16 len; /* payload, bytes after this header */
151 __le16 type;
152 u8 flags;
153 u8 reserved;
154} __packed;
155
156#define WIL_MBOX_HDR_TYPE_WMI (0)
157
158/* max. value for wil6210_mbox_hdr.len */
159#define MAX_MBOXITEM_SIZE (240)
160
161struct wil6210_mbox_hdr_wmi {
162 u8 reserved0[2];
163 __le16 id;
164 __le16 info1; /* bits [0..3] - device_id, rest - unused */
165 u8 reserved1[2];
166} __packed;
167
168struct pending_wmi_event {
169 struct list_head list;
170 struct {
171 struct wil6210_mbox_hdr hdr;
172 struct wil6210_mbox_hdr_wmi wmi;
173 u8 data[0];
174 } __packed event;
175};
176
177union vring_desc;
178
179struct vring {
180 dma_addr_t pa;
181 volatile union vring_desc *va; /* vring_desc[size], WriteBack by DMA */
182 u16 size; /* number of vring_desc elements */
183 u32 swtail;
184 u32 swhead;
185 u32 hwtail; /* write here to inform hw */
186 void **ctx; /* void *ctx[size] - software context */
187};
188
189enum { /* for wil6210_priv.status */
190 wil_status_fwready = 0,
191 wil_status_fwconnected,
192 wil_status_dontscan,
193 wil_status_irqen, /* FIXME: interrupts enabled - for debug */
194};
195
196struct pci_dev;
197
198struct wil6210_stats {
199 u64 tsf;
200 u32 snr;
201 u16 last_mcs_rx;
202 u16 bf_mcs; /* last BF, used for Tx */
203 u16 my_rx_sector;
204 u16 my_tx_sector;
205 u16 peer_rx_sector;
206 u16 peer_tx_sector;
207};
208
209struct wil6210_priv {
210 struct pci_dev *pdev;
211 int n_msi;
212 struct wireless_dev *wdev;
213 void __iomem *csr;
214 ulong status;
215 /* profile */
216 u32 monitor_flags;
217 u32 secure_pcp; /* create secure PCP? */
218 int sinfo_gen;
219 /* cached ISR registers */
220 u32 isr_misc;
221 /* mailbox related */
222 struct mutex wmi_mutex;
223 struct wil6210_mbox_ctl mbox_ctl;
224 struct completion wmi_ready;
225 u16 wmi_seq;
226 u16 reply_id; /**< wait for this WMI event */
227 void *reply_buf;
228 u16 reply_size;
229 struct workqueue_struct *wmi_wq; /* for deferred calls */
230 struct work_struct wmi_event_worker;
231 struct workqueue_struct *wmi_wq_conn; /* for connect worker */
232 struct work_struct wmi_connect_worker;
233 struct work_struct disconnect_worker;
234 struct timer_list connect_timer;
235 int pending_connect_cid;
236 struct list_head pending_wmi_ev;
237 /*
238 * protect pending_wmi_ev
239 * - fill in IRQ from wil6210_irq_misc,
240 * - consumed in thread by wmi_event_worker
241 */
242 spinlock_t wmi_ev_lock;
243 /* DMA related */
244 struct vring vring_rx;
245 struct vring vring_tx[WIL6210_MAX_TX_RINGS];
246 u8 dst_addr[WIL6210_MAX_TX_RINGS][ETH_ALEN];
247 /* scan */
248 struct cfg80211_scan_request *scan_request;
249
250 struct mutex mutex; /* for wil6210_priv access in wil_{up|down} */
251 /* statistics */
252 struct wil6210_stats stats;
253 /* debugfs */
254 struct dentry *debug;
255 struct debugfs_blob_wrapper fw_code_blob;
256 struct debugfs_blob_wrapper fw_data_blob;
257 struct debugfs_blob_wrapper fw_peri_blob;
258 struct debugfs_blob_wrapper uc_code_blob;
259 struct debugfs_blob_wrapper uc_data_blob;
260 struct debugfs_blob_wrapper rgf_blob;
261};
262
263#define wil_to_wiphy(i) (i->wdev->wiphy)
264#define wil_to_dev(i) (wiphy_dev(wil_to_wiphy(i)))
265#define wiphy_to_wil(w) (struct wil6210_priv *)(wiphy_priv(w))
266#define wil_to_wdev(i) (i->wdev)
267#define wdev_to_wil(w) (struct wil6210_priv *)(wdev_priv(w))
268#define wil_to_ndev(i) (wil_to_wdev(i)->netdev)
269#define ndev_to_wil(n) (wdev_to_wil(n->ieee80211_ptr))
270
271#define wil_dbg(wil, fmt, arg...) netdev_dbg(wil_to_ndev(wil), fmt, ##arg)
272#define wil_info(wil, fmt, arg...) netdev_info(wil_to_ndev(wil), fmt, ##arg)
273#define wil_err(wil, fmt, arg...) netdev_err(wil_to_ndev(wil), fmt, ##arg)
274
275#define wil_dbg_IRQ(wil, fmt, arg...) wil_dbg(wil, "DBG[ IRQ]" fmt, ##arg)
276#define wil_dbg_TXRX(wil, fmt, arg...) wil_dbg(wil, "DBG[TXRX]" fmt, ##arg)
277#define wil_dbg_WMI(wil, fmt, arg...) wil_dbg(wil, "DBG[ WMI]" fmt, ##arg)
278
279#define wil_hex_dump_TXRX(prefix_str, prefix_type, rowsize, \
280 groupsize, buf, len, ascii) \
281 wil_print_hex_dump_debug("DBG[TXRX]" prefix_str,\
282 prefix_type, rowsize, \
283 groupsize, buf, len, ascii)
284
285#define wil_hex_dump_WMI(prefix_str, prefix_type, rowsize, \
286 groupsize, buf, len, ascii) \
287 wil_print_hex_dump_debug("DBG[ WMI]" prefix_str,\
288 prefix_type, rowsize, \
289 groupsize, buf, len, ascii)
290
291void wil_memcpy_fromio_32(void *dst, const volatile void __iomem *src,
292 size_t count);
293void wil_memcpy_toio_32(volatile void __iomem *dst, const void *src,
294 size_t count);
295
296void *wil_if_alloc(struct device *dev, void __iomem *csr);
297void wil_if_free(struct wil6210_priv *wil);
298int wil_if_add(struct wil6210_priv *wil);
299void wil_if_remove(struct wil6210_priv *wil);
300int wil_priv_init(struct wil6210_priv *wil);
301void wil_priv_deinit(struct wil6210_priv *wil);
302int wil_reset(struct wil6210_priv *wil);
303void wil_link_on(struct wil6210_priv *wil);
304void wil_link_off(struct wil6210_priv *wil);
305int wil_up(struct wil6210_priv *wil);
306int wil_down(struct wil6210_priv *wil);
307void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r);
308
309void __iomem *wmi_buffer(struct wil6210_priv *wil, __le32 ptr);
310void __iomem *wmi_addr(struct wil6210_priv *wil, u32 ptr);
311int wmi_read_hdr(struct wil6210_priv *wil, __le32 ptr,
312 struct wil6210_mbox_hdr *hdr);
313int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len);
314void wmi_recv_cmd(struct wil6210_priv *wil);
315int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
316 u16 reply_id, void *reply, u8 reply_size, int to_msec);
317void wmi_connect_worker(struct work_struct *work);
318void wmi_event_worker(struct work_struct *work);
319void wmi_event_flush(struct wil6210_priv *wil);
320int wmi_set_ssid(struct wil6210_priv *wil, u8 ssid_len, const void *ssid);
321int wmi_get_ssid(struct wil6210_priv *wil, u8 *ssid_len, void *ssid);
322int wmi_set_channel(struct wil6210_priv *wil, int channel);
323int wmi_get_channel(struct wil6210_priv *wil, int *channel);
324int wmi_tx_eapol(struct wil6210_priv *wil, struct sk_buff *skb);
325int wmi_del_cipher_key(struct wil6210_priv *wil, u8 key_index,
326 const void *mac_addr);
327int wmi_add_cipher_key(struct wil6210_priv *wil, u8 key_index,
328 const void *mac_addr, int key_len, const void *key);
329int wmi_echo(struct wil6210_priv *wil);
330int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie);
331
332int wil6210_init_irq(struct wil6210_priv *wil, int irq);
333void wil6210_fini_irq(struct wil6210_priv *wil, int irq);
334void wil6210_disable_irq(struct wil6210_priv *wil);
335void wil6210_enable_irq(struct wil6210_priv *wil);
336
337int wil6210_debugfs_init(struct wil6210_priv *wil);
338void wil6210_debugfs_remove(struct wil6210_priv *wil);
339
340struct wireless_dev *wil_cfg80211_init(struct device *dev);
341void wil_wdev_free(struct wil6210_priv *wil);
342
343int wmi_set_mac_address(struct wil6210_priv *wil, void *addr);
344int wmi_set_bcon(struct wil6210_priv *wil, int bi, u8 wmi_nettype);
345void wil6210_disconnect(struct wil6210_priv *wil, void *bssid);
346
347int wil_rx_init(struct wil6210_priv *wil);
348void wil_rx_fini(struct wil6210_priv *wil);
349
350/* TX API */
351int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size,
352 int cid, int tid);
353void wil_vring_fini_tx(struct wil6210_priv *wil, int id);
354
355netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev);
356void wil_tx_complete(struct wil6210_priv *wil, int ringid);
357
358/* RX API */
359void wil_rx_handle(struct wil6210_priv *wil);
360
361int wil_iftype_nl2wmi(enum nl80211_iftype type);
362
363#endif /* __WIL6210_H__ */
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
new file mode 100644
index 00000000000..12915f6e761
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -0,0 +1,975 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include <linux/pci.h>
18#include <linux/io.h>
19#include <linux/list.h>
20#include <linux/etherdevice.h>
21
22#include "wil6210.h"
23#include "wmi.h"
24
25/**
26 * WMI event receiving - theory of operations
27 *
28 * When firmware about to report WMI event, it fills memory area
29 * in the mailbox and raises misc. IRQ. Thread interrupt handler invoked for
30 * the misc IRQ, function @wmi_recv_cmd called by thread IRQ handler.
31 *
32 * @wmi_recv_cmd reads event, allocates memory chunk and attaches it to the
33 * event list @wil->pending_wmi_ev. Then, work queue @wil->wmi_wq wakes up
34 * and handles events within the @wmi_event_worker. Every event get detached
35 * from list, processed and deleted.
36 *
37 * Purpose for this mechanism is to release IRQ thread; otherwise,
38 * if WMI event handling involves another WMI command flow, this 2-nd flow
39 * won't be completed because of blocked IRQ thread.
40 */
41
42/**
43 * Addressing - theory of operations
44 *
45 * There are several buses present on the WIL6210 card.
46 * Same memory areas are visible at different address on
47 * the different busses. There are 3 main bus masters:
48 * - MAC CPU (ucode)
49 * - User CPU (firmware)
50 * - AHB (host)
51 *
52 * On the PCI bus, there is one BAR (BAR0) of 2Mb size, exposing
53 * AHB addresses starting from 0x880000
54 *
55 * Internally, firmware uses addresses that allows faster access but
56 * are invisible from the host. To read from these addresses, alternative
57 * AHB address must be used.
58 *
59 * Memory mapping
60 * Linker address PCI/Host address
61 * 0x880000 .. 0xa80000 2Mb BAR0
62 * 0x800000 .. 0x807000 0x900000 .. 0x907000 28k DCCM
63 * 0x840000 .. 0x857000 0x908000 .. 0x91f000 92k PERIPH
64 */
65
66/**
67 * @fw_mapping provides memory remapping table
68 */
69static const struct {
70 u32 from; /* linker address - from, inclusive */
71 u32 to; /* linker address - to, exclusive */
72 u32 host; /* PCI/Host address - BAR0 + 0x880000 */
73} fw_mapping[] = {
74 {0x000000, 0x040000, 0x8c0000}, /* FW code RAM 256k */
75 {0x800000, 0x808000, 0x900000}, /* FW data RAM 32k */
76 {0x840000, 0x860000, 0x908000}, /* peripheral data RAM 128k/96k used */
77 {0x880000, 0x88a000, 0x880000}, /* various RGF */
78 {0x8c0000, 0x932000, 0x8c0000}, /* trivial mapping for upper area */
79 /*
80 * 920000..930000 ucode code RAM
81 * 930000..932000 ucode data RAM
82 */
83};
84
85/**
86 * return AHB address for given firmware/ucode internal (linker) address
87 * @x - internal address
88 * If address have no valid AHB mapping, return 0
89 */
90static u32 wmi_addr_remap(u32 x)
91{
92 uint i;
93
94 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) {
95 if ((x >= fw_mapping[i].from) && (x < fw_mapping[i].to))
96 return x + fw_mapping[i].host - fw_mapping[i].from;
97 }
98
99 return 0;
100}
101
102/**
103 * Check address validity for WMI buffer; remap if needed
104 * @ptr - internal (linker) fw/ucode address
105 *
106 * Valid buffer should be DWORD aligned
107 *
108 * return address for accessing buffer from the host;
109 * if buffer is not valid, return NULL.
110 */
111void __iomem *wmi_buffer(struct wil6210_priv *wil, __le32 ptr_)
112{
113 u32 off;
114 u32 ptr = le32_to_cpu(ptr_);
115
116 if (ptr % 4)
117 return NULL;
118
119 ptr = wmi_addr_remap(ptr);
120 if (ptr < WIL6210_FW_HOST_OFF)
121 return NULL;
122
123 off = HOSTADDR(ptr);
124 if (off > WIL6210_MEM_SIZE - 4)
125 return NULL;
126
127 return wil->csr + off;
128}
129
130/**
131 * Check address validity
132 */
133void __iomem *wmi_addr(struct wil6210_priv *wil, u32 ptr)
134{
135 u32 off;
136
137 if (ptr % 4)
138 return NULL;
139
140 if (ptr < WIL6210_FW_HOST_OFF)
141 return NULL;
142
143 off = HOSTADDR(ptr);
144 if (off > WIL6210_MEM_SIZE - 4)
145 return NULL;
146
147 return wil->csr + off;
148}
149
150int wmi_read_hdr(struct wil6210_priv *wil, __le32 ptr,
151 struct wil6210_mbox_hdr *hdr)
152{
153 void __iomem *src = wmi_buffer(wil, ptr);
154 if (!src)
155 return -EINVAL;
156
157 wil_memcpy_fromio_32(hdr, src, sizeof(*hdr));
158
159 return 0;
160}
161
162static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len)
163{
164 struct {
165 struct wil6210_mbox_hdr hdr;
166 struct wil6210_mbox_hdr_wmi wmi;
167 } __packed cmd = {
168 .hdr = {
169 .type = WIL_MBOX_HDR_TYPE_WMI,
170 .flags = 0,
171 .len = cpu_to_le16(sizeof(cmd.wmi) + len),
172 },
173 .wmi = {
174 .id = cpu_to_le16(cmdid),
175 .info1 = 0,
176 },
177 };
178 struct wil6210_mbox_ring *r = &wil->mbox_ctl.tx;
179 struct wil6210_mbox_ring_desc d_head;
180 u32 next_head;
181 void __iomem *dst;
182 void __iomem *head = wmi_addr(wil, r->head);
183 uint retry;
184
185 if (sizeof(cmd) + len > r->entry_size) {
186 wil_err(wil, "WMI size too large: %d bytes, max is %d\n",
187 (int)(sizeof(cmd) + len), r->entry_size);
188 return -ERANGE;
189
190 }
191
192 might_sleep();
193
194 if (!test_bit(wil_status_fwready, &wil->status)) {
195 wil_err(wil, "FW not ready\n");
196 return -EAGAIN;
197 }
198
199 if (!head) {
200 wil_err(wil, "WMI head is garbage: 0x%08x\n", r->head);
201 return -EINVAL;
202 }
203 /* read Tx head till it is not busy */
204 for (retry = 5; retry > 0; retry--) {
205 wil_memcpy_fromio_32(&d_head, head, sizeof(d_head));
206 if (d_head.sync == 0)
207 break;
208 msleep(20);
209 }
210 if (d_head.sync != 0) {
211 wil_err(wil, "WMI head busy\n");
212 return -EBUSY;
213 }
214 /* next head */
215 next_head = r->base + ((r->head - r->base + sizeof(d_head)) % r->size);
216 wil_dbg_WMI(wil, "Head 0x%08x -> 0x%08x\n", r->head, next_head);
217 /* wait till FW finish with previous command */
218 for (retry = 5; retry > 0; retry--) {
219 r->tail = ioread32(wil->csr + HOST_MBOX +
220 offsetof(struct wil6210_mbox_ctl, tx.tail));
221 if (next_head != r->tail)
222 break;
223 msleep(20);
224 }
225 if (next_head == r->tail) {
226 wil_err(wil, "WMI ring full\n");
227 return -EBUSY;
228 }
229 dst = wmi_buffer(wil, d_head.addr);
230 if (!dst) {
231 wil_err(wil, "invalid WMI buffer: 0x%08x\n",
232 le32_to_cpu(d_head.addr));
233 return -EINVAL;
234 }
235 cmd.hdr.seq = cpu_to_le16(++wil->wmi_seq);
236 /* set command */
237 wil_dbg_WMI(wil, "WMI command 0x%04x [%d]\n", cmdid, len);
238 wil_hex_dump_WMI("Cmd ", DUMP_PREFIX_OFFSET, 16, 1, &cmd,
239 sizeof(cmd), true);
240 wil_hex_dump_WMI("cmd ", DUMP_PREFIX_OFFSET, 16, 1, buf,
241 len, true);
242 wil_memcpy_toio_32(dst, &cmd, sizeof(cmd));
243 wil_memcpy_toio_32(dst + sizeof(cmd), buf, len);
244 /* mark entry as full */
245 iowrite32(1, wil->csr + HOSTADDR(r->head) +
246 offsetof(struct wil6210_mbox_ring_desc, sync));
247 /* advance next ptr */
248 iowrite32(r->head = next_head, wil->csr + HOST_MBOX +
249 offsetof(struct wil6210_mbox_ctl, tx.head));
250
251 /* interrupt to FW */
252 iowrite32(SW_INT_MBOX, wil->csr + HOST_SW_INT);
253
254 return 0;
255}
256
257int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len)
258{
259 int rc;
260
261 mutex_lock(&wil->wmi_mutex);
262 rc = __wmi_send(wil, cmdid, buf, len);
263 mutex_unlock(&wil->wmi_mutex);
264
265 return rc;
266}
267
268/*=== Event handlers ===*/
269static void wmi_evt_ready(struct wil6210_priv *wil, int id, void *d, int len)
270{
271 struct net_device *ndev = wil_to_ndev(wil);
272 struct wireless_dev *wdev = wil->wdev;
273 struct wmi_ready_event *evt = d;
274 u32 ver = le32_to_cpu(evt->sw_version);
275
276 wil_dbg_WMI(wil, "FW ver. %d; MAC %pM\n", ver, evt->mac);
277
278 if (!is_valid_ether_addr(ndev->dev_addr)) {
279 memcpy(ndev->dev_addr, evt->mac, ETH_ALEN);
280 memcpy(ndev->perm_addr, evt->mac, ETH_ALEN);
281 }
282 snprintf(wdev->wiphy->fw_version, sizeof(wdev->wiphy->fw_version),
283 "%d", ver);
284}
285
286static void wmi_evt_fw_ready(struct wil6210_priv *wil, int id, void *d,
287 int len)
288{
289 wil_dbg_WMI(wil, "WMI: FW ready\n");
290
291 set_bit(wil_status_fwready, &wil->status);
292 /* reuse wmi_ready for the firmware ready indication */
293 complete(&wil->wmi_ready);
294}
295
296static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
297{
298 struct wmi_rx_mgmt_packet_event *data = d;
299 struct wiphy *wiphy = wil_to_wiphy(wil);
300 struct ieee80211_mgmt *rx_mgmt_frame =
301 (struct ieee80211_mgmt *)data->payload;
302 int ch_no = data->info.channel+1;
303 u32 freq = ieee80211_channel_to_frequency(ch_no,
304 IEEE80211_BAND_60GHZ);
305 struct ieee80211_channel *channel = ieee80211_get_channel(wiphy, freq);
306 /* TODO convert LE to CPU */
307 s32 signal = 0; /* TODO */
308 __le16 fc = rx_mgmt_frame->frame_control;
309 u32 d_len = le32_to_cpu(data->info.len);
310 u16 d_status = le16_to_cpu(data->info.status);
311
312 wil_dbg_WMI(wil, "MGMT: channel %d MCS %d SNR %d\n",
313 data->info.channel, data->info.mcs, data->info.snr);
314 wil_dbg_WMI(wil, "status 0x%04x len %d stype %04x\n", d_status, d_len,
315 le16_to_cpu(data->info.stype));
316 wil_dbg_WMI(wil, "qid %d mid %d cid %d\n",
317 data->info.qid, data->info.mid, data->info.cid);
318
319 if (!channel) {
320 wil_err(wil, "Frame on unsupported channel\n");
321 return;
322 }
323
324 if (ieee80211_is_beacon(fc) || ieee80211_is_probe_resp(fc)) {
325 struct cfg80211_bss *bss;
326 u64 tsf = le64_to_cpu(rx_mgmt_frame->u.beacon.timestamp);
327 u16 cap = le16_to_cpu(rx_mgmt_frame->u.beacon.capab_info);
328 u16 bi = le16_to_cpu(rx_mgmt_frame->u.beacon.beacon_int);
329 const u8 *ie_buf = rx_mgmt_frame->u.beacon.variable;
330 size_t ie_len = d_len - offsetof(struct ieee80211_mgmt,
331 u.beacon.variable);
332 wil_dbg_WMI(wil, "Capability info : 0x%04x\n", cap);
333
334 bss = cfg80211_inform_bss(wiphy, channel, rx_mgmt_frame->bssid,
335 tsf, cap, bi, ie_buf, ie_len,
336 signal, GFP_KERNEL);
337 if (bss) {
338 wil_dbg_WMI(wil, "Added BSS %pM\n",
339 rx_mgmt_frame->bssid);
340 cfg80211_put_bss(bss);
341 } else {
342 wil_err(wil, "cfg80211_inform_bss() failed\n");
343 }
344 }
345}
346
347static void wmi_evt_scan_complete(struct wil6210_priv *wil, int id,
348 void *d, int len)
349{
350 if (wil->scan_request) {
351 struct wmi_scan_complete_event *data = d;
352 bool aborted = (data->status != 0);
353
354 wil_dbg_WMI(wil, "SCAN_COMPLETE(0x%08x)\n", data->status);
355 cfg80211_scan_done(wil->scan_request, aborted);
356 wil->scan_request = NULL;
357 } else {
358 wil_err(wil, "SCAN_COMPLETE while not scanning\n");
359 }
360}
361
362static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
363{
364 struct net_device *ndev = wil_to_ndev(wil);
365 struct wireless_dev *wdev = wil->wdev;
366 struct wmi_connect_event *evt = d;
367 int ch; /* channel number */
368 struct station_info sinfo;
369 u8 *assoc_req_ie, *assoc_resp_ie;
370 size_t assoc_req_ielen, assoc_resp_ielen;
371 /* capinfo(u16) + listen_interval(u16) + IEs */
372 const size_t assoc_req_ie_offset = sizeof(u16) * 2;
373 /* capinfo(u16) + status_code(u16) + associd(u16) + IEs */
374 const size_t assoc_resp_ie_offset = sizeof(u16) * 3;
375
376 if (len < sizeof(*evt)) {
377 wil_err(wil, "Connect event too short : %d bytes\n", len);
378 return;
379 }
380 if (len != sizeof(*evt) + evt->beacon_ie_len + evt->assoc_req_len +
381 evt->assoc_resp_len) {
382 wil_err(wil,
383 "Connect event corrupted : %d != %d + %d + %d + %d\n",
384 len, (int)sizeof(*evt), evt->beacon_ie_len,
385 evt->assoc_req_len, evt->assoc_resp_len);
386 return;
387 }
388 ch = evt->channel + 1;
389 wil_dbg_WMI(wil, "Connect %pM channel [%d] cid %d\n",
390 evt->bssid, ch, evt->cid);
391 wil_hex_dump_WMI("connect AI : ", DUMP_PREFIX_OFFSET, 16, 1,
392 evt->assoc_info, len - sizeof(*evt), true);
393
394 /* figure out IE's */
395 assoc_req_ie = &evt->assoc_info[evt->beacon_ie_len +
396 assoc_req_ie_offset];
397 assoc_req_ielen = evt->assoc_req_len - assoc_req_ie_offset;
398 if (evt->assoc_req_len <= assoc_req_ie_offset) {
399 assoc_req_ie = NULL;
400 assoc_req_ielen = 0;
401 }
402
403 assoc_resp_ie = &evt->assoc_info[evt->beacon_ie_len +
404 evt->assoc_req_len +
405 assoc_resp_ie_offset];
406 assoc_resp_ielen = evt->assoc_resp_len - assoc_resp_ie_offset;
407 if (evt->assoc_resp_len <= assoc_resp_ie_offset) {
408 assoc_resp_ie = NULL;
409 assoc_resp_ielen = 0;
410 }
411
412 if ((wdev->iftype == NL80211_IFTYPE_STATION) ||
413 (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) {
414 if (wdev->sme_state != CFG80211_SME_CONNECTING) {
415 wil_err(wil, "Not in connecting state\n");
416 return;
417 }
418 del_timer_sync(&wil->connect_timer);
419 cfg80211_connect_result(ndev, evt->bssid,
420 assoc_req_ie, assoc_req_ielen,
421 assoc_resp_ie, assoc_resp_ielen,
422 WLAN_STATUS_SUCCESS, GFP_KERNEL);
423
424 } else if ((wdev->iftype == NL80211_IFTYPE_AP) ||
425 (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
426 memset(&sinfo, 0, sizeof(sinfo));
427
428 sinfo.generation = wil->sinfo_gen++;
429
430 if (assoc_req_ie) {
431 sinfo.assoc_req_ies = assoc_req_ie;
432 sinfo.assoc_req_ies_len = assoc_req_ielen;
433 sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
434 }
435
436 cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL);
437 }
438 set_bit(wil_status_fwconnected, &wil->status);
439
440 /* FIXME FW can transmit only ucast frames to peer */
441 /* FIXME real ring_id instead of hard coded 0 */
442 memcpy(wil->dst_addr[0], evt->bssid, ETH_ALEN);
443
444 wil->pending_connect_cid = evt->cid;
445 queue_work(wil->wmi_wq_conn, &wil->wmi_connect_worker);
446}
447
448static void wmi_evt_disconnect(struct wil6210_priv *wil, int id,
449 void *d, int len)
450{
451 struct wmi_disconnect_event *evt = d;
452
453 wil_dbg_WMI(wil, "Disconnect %pM reason %d proto %d wmi\n",
454 evt->bssid,
455 evt->protocol_reason_status, evt->disconnect_reason);
456
457 wil->sinfo_gen++;
458
459 wil6210_disconnect(wil, evt->bssid);
460 clear_bit(wil_status_dontscan, &wil->status);
461}
462
463static void wmi_evt_notify(struct wil6210_priv *wil, int id, void *d, int len)
464{
465 struct wmi_notify_req_done_event *evt = d;
466
467 if (len < sizeof(*evt)) {
468 wil_err(wil, "Short NOTIFY event\n");
469 return;
470 }
471
472 wil->stats.tsf = le64_to_cpu(evt->tsf);
473 wil->stats.snr = le32_to_cpu(evt->snr_val);
474 wil->stats.bf_mcs = le16_to_cpu(evt->bf_mcs);
475 wil->stats.my_rx_sector = le16_to_cpu(evt->my_rx_sector);
476 wil->stats.my_tx_sector = le16_to_cpu(evt->my_tx_sector);
477 wil->stats.peer_rx_sector = le16_to_cpu(evt->other_rx_sector);
478 wil->stats.peer_tx_sector = le16_to_cpu(evt->other_tx_sector);
479 wil_dbg_WMI(wil, "Link status, MCS %d TSF 0x%016llx\n"
480 "BF status 0x%08x SNR 0x%08x\n"
481 "Tx Tpt %d goodput %d Rx goodput %d\n"
482 "Sectors(rx:tx) my %d:%d peer %d:%d\n",
483 wil->stats.bf_mcs, wil->stats.tsf, evt->status,
484 wil->stats.snr, le32_to_cpu(evt->tx_tpt),
485 le32_to_cpu(evt->tx_goodput), le32_to_cpu(evt->rx_goodput),
486 wil->stats.my_rx_sector, wil->stats.my_tx_sector,
487 wil->stats.peer_rx_sector, wil->stats.peer_tx_sector);
488}
489
490/*
491 * Firmware reports EAPOL frame using WME event.
492 * Reconstruct Ethernet frame and deliver it via normal Rx
493 */
494static void wmi_evt_eapol_rx(struct wil6210_priv *wil, int id,
495 void *d, int len)
496{
497 struct net_device *ndev = wil_to_ndev(wil);
498 struct wmi_eapol_rx_event *evt = d;
499 u16 eapol_len = le16_to_cpu(evt->eapol_len);
500 int sz = eapol_len + ETH_HLEN;
501 struct sk_buff *skb;
502 struct ethhdr *eth;
503
504 wil_dbg_WMI(wil, "EAPOL len %d from %pM\n", eapol_len,
505 evt->src_mac);
506
507 if (eapol_len > 196) { /* TODO: revisit size limit */
508 wil_err(wil, "EAPOL too large\n");
509 return;
510 }
511
512 skb = alloc_skb(sz, GFP_KERNEL);
513 if (!skb) {
514 wil_err(wil, "Failed to allocate skb\n");
515 return;
516 }
517 eth = (struct ethhdr *)skb_put(skb, ETH_HLEN);
518 memcpy(eth->h_dest, ndev->dev_addr, ETH_ALEN);
519 memcpy(eth->h_source, evt->src_mac, ETH_ALEN);
520 eth->h_proto = cpu_to_be16(ETH_P_PAE);
521 memcpy(skb_put(skb, eapol_len), evt->eapol, eapol_len);
522 skb->protocol = eth_type_trans(skb, ndev);
523 if (likely(netif_rx_ni(skb) == NET_RX_SUCCESS)) {
524 ndev->stats.rx_packets++;
525 ndev->stats.rx_bytes += skb->len;
526 } else {
527 ndev->stats.rx_dropped++;
528 }
529}
530
531static const struct {
532 int eventid;
533 void (*handler)(struct wil6210_priv *wil, int eventid,
534 void *data, int data_len);
535} wmi_evt_handlers[] = {
536 {WMI_READY_EVENTID, wmi_evt_ready},
537 {WMI_FW_READY_EVENTID, wmi_evt_fw_ready},
538 {WMI_RX_MGMT_PACKET_EVENTID, wmi_evt_rx_mgmt},
539 {WMI_SCAN_COMPLETE_EVENTID, wmi_evt_scan_complete},
540 {WMI_CONNECT_EVENTID, wmi_evt_connect},
541 {WMI_DISCONNECT_EVENTID, wmi_evt_disconnect},
542 {WMI_NOTIFY_REQ_DONE_EVENTID, wmi_evt_notify},
543 {WMI_EAPOL_RX_EVENTID, wmi_evt_eapol_rx},
544};
545
546/*
547 * Run in IRQ context
548 * Extract WMI command from mailbox. Queue it to the @wil->pending_wmi_ev
549 * that will be eventually handled by the @wmi_event_worker in the thread
550 * context of thread "wil6210_wmi"
551 */
552void wmi_recv_cmd(struct wil6210_priv *wil)
553{
554 struct wil6210_mbox_ring_desc d_tail;
555 struct wil6210_mbox_hdr hdr;
556 struct wil6210_mbox_ring *r = &wil->mbox_ctl.rx;
557 struct pending_wmi_event *evt;
558 u8 *cmd;
559 void __iomem *src;
560 ulong flags;
561
562 for (;;) {
563 u16 len;
564
565 r->head = ioread32(wil->csr + HOST_MBOX +
566 offsetof(struct wil6210_mbox_ctl, rx.head));
567 if (r->tail == r->head)
568 return;
569
570 /* read cmd from tail */
571 wil_memcpy_fromio_32(&d_tail, wil->csr + HOSTADDR(r->tail),
572 sizeof(struct wil6210_mbox_ring_desc));
573 if (d_tail.sync == 0) {
574 wil_err(wil, "Mbox evt not owned by FW?\n");
575 return;
576 }
577
578 if (0 != wmi_read_hdr(wil, d_tail.addr, &hdr)) {
579 wil_err(wil, "Mbox evt at 0x%08x?\n",
580 le32_to_cpu(d_tail.addr));
581 return;
582 }
583
584 len = le16_to_cpu(hdr.len);
585 src = wmi_buffer(wil, d_tail.addr) +
586 sizeof(struct wil6210_mbox_hdr);
587 evt = kmalloc(ALIGN(offsetof(struct pending_wmi_event,
588 event.wmi) + len, 4),
589 GFP_KERNEL);
590 if (!evt) {
591 wil_err(wil, "kmalloc for WMI event (%d) failed\n",
592 len);
593 return;
594 }
595 evt->event.hdr = hdr;
596 cmd = (void *)&evt->event.wmi;
597 wil_memcpy_fromio_32(cmd, src, len);
598 /* mark entry as empty */
599 iowrite32(0, wil->csr + HOSTADDR(r->tail) +
600 offsetof(struct wil6210_mbox_ring_desc, sync));
601 /* indicate */
602 wil_dbg_WMI(wil, "Mbox evt %04x %04x %04x %02x\n",
603 le16_to_cpu(hdr.seq), len, le16_to_cpu(hdr.type),
604 hdr.flags);
605 if ((hdr.type == WIL_MBOX_HDR_TYPE_WMI) &&
606 (len >= sizeof(struct wil6210_mbox_hdr_wmi))) {
607 wil_dbg_WMI(wil, "WMI event 0x%04x\n",
608 evt->event.wmi.id);
609 }
610 wil_hex_dump_WMI("evt ", DUMP_PREFIX_OFFSET, 16, 1,
611 &evt->event.hdr, sizeof(hdr) + len, true);
612
613 /* advance tail */
614 r->tail = r->base + ((r->tail - r->base +
615 sizeof(struct wil6210_mbox_ring_desc)) % r->size);
616 iowrite32(r->tail, wil->csr + HOST_MBOX +
617 offsetof(struct wil6210_mbox_ctl, rx.tail));
618
619 /* add to the pending list */
620 spin_lock_irqsave(&wil->wmi_ev_lock, flags);
621 list_add_tail(&evt->list, &wil->pending_wmi_ev);
622 spin_unlock_irqrestore(&wil->wmi_ev_lock, flags);
623 {
624 int q = queue_work(wil->wmi_wq,
625 &wil->wmi_event_worker);
626 wil_dbg_WMI(wil, "queue_work -> %d\n", q);
627 }
628 }
629}
630
631int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
632 u16 reply_id, void *reply, u8 reply_size, int to_msec)
633{
634 int rc;
635 int remain;
636
637 mutex_lock(&wil->wmi_mutex);
638
639 rc = __wmi_send(wil, cmdid, buf, len);
640 if (rc)
641 goto out;
642
643 wil->reply_id = reply_id;
644 wil->reply_buf = reply;
645 wil->reply_size = reply_size;
646 remain = wait_for_completion_timeout(&wil->wmi_ready,
647 msecs_to_jiffies(to_msec));
648 if (0 == remain) {
649 wil_err(wil, "wmi_call(0x%04x->0x%04x) timeout %d msec\n",
650 cmdid, reply_id, to_msec);
651 rc = -ETIME;
652 } else {
653 wil_dbg_WMI(wil,
654 "wmi_call(0x%04x->0x%04x) completed in %d msec\n",
655 cmdid, reply_id,
656 to_msec - jiffies_to_msecs(remain));
657 }
658 wil->reply_id = 0;
659 wil->reply_buf = NULL;
660 wil->reply_size = 0;
661 out:
662 mutex_unlock(&wil->wmi_mutex);
663
664 return rc;
665}
666
667int wmi_echo(struct wil6210_priv *wil)
668{
669 struct wmi_echo_cmd cmd = {
670 .value = cpu_to_le32(0x12345678),
671 };
672
673 return wmi_call(wil, WMI_ECHO_CMDID, &cmd, sizeof(cmd),
674 WMI_ECHO_RSP_EVENTID, NULL, 0, 20);
675}
676
677int wmi_set_mac_address(struct wil6210_priv *wil, void *addr)
678{
679 struct wmi_set_mac_address_cmd cmd;
680
681 memcpy(cmd.mac, addr, ETH_ALEN);
682
683 wil_dbg_WMI(wil, "Set MAC %pM\n", addr);
684
685 return wmi_send(wil, WMI_SET_MAC_ADDRESS_CMDID, &cmd, sizeof(cmd));
686}
687
688int wmi_set_bcon(struct wil6210_priv *wil, int bi, u8 wmi_nettype)
689{
690 struct wmi_bcon_ctrl_cmd cmd = {
691 .bcon_interval = cpu_to_le16(bi),
692 .network_type = wmi_nettype,
693 .disable_sec_offload = 1,
694 };
695
696 if (!wil->secure_pcp)
697 cmd.disable_sec = 1;
698
699 return wmi_send(wil, WMI_BCON_CTRL_CMDID, &cmd, sizeof(cmd));
700}
701
702int wmi_set_ssid(struct wil6210_priv *wil, u8 ssid_len, const void *ssid)
703{
704 struct wmi_set_ssid_cmd cmd = {
705 .ssid_len = cpu_to_le32(ssid_len),
706 };
707
708 if (ssid_len > sizeof(cmd.ssid))
709 return -EINVAL;
710
711 memcpy(cmd.ssid, ssid, ssid_len);
712
713 return wmi_send(wil, WMI_SET_SSID_CMDID, &cmd, sizeof(cmd));
714}
715
716int wmi_get_ssid(struct wil6210_priv *wil, u8 *ssid_len, void *ssid)
717{
718 int rc;
719 struct {
720 struct wil6210_mbox_hdr_wmi wmi;
721 struct wmi_set_ssid_cmd cmd;
722 } __packed reply;
723 int len; /* reply.cmd.ssid_len in CPU order */
724
725 rc = wmi_call(wil, WMI_GET_SSID_CMDID, NULL, 0, WMI_GET_SSID_EVENTID,
726 &reply, sizeof(reply), 20);
727 if (rc)
728 return rc;
729
730 len = le32_to_cpu(reply.cmd.ssid_len);
731 if (len > sizeof(reply.cmd.ssid))
732 return -EINVAL;
733
734 *ssid_len = len;
735 memcpy(ssid, reply.cmd.ssid, len);
736
737 return 0;
738}
739
740int wmi_set_channel(struct wil6210_priv *wil, int channel)
741{
742 struct wmi_set_pcp_channel_cmd cmd = {
743 .channel = channel - 1,
744 };
745
746 return wmi_send(wil, WMI_SET_PCP_CHANNEL_CMDID, &cmd, sizeof(cmd));
747}
748
749int wmi_get_channel(struct wil6210_priv *wil, int *channel)
750{
751 int rc;
752 struct {
753 struct wil6210_mbox_hdr_wmi wmi;
754 struct wmi_set_pcp_channel_cmd cmd;
755 } __packed reply;
756
757 rc = wmi_call(wil, WMI_GET_PCP_CHANNEL_CMDID, NULL, 0,
758 WMI_GET_PCP_CHANNEL_EVENTID, &reply, sizeof(reply), 20);
759 if (rc)
760 return rc;
761
762 if (reply.cmd.channel > 3)
763 return -EINVAL;
764
765 *channel = reply.cmd.channel + 1;
766
767 return 0;
768}
769
770int wmi_tx_eapol(struct wil6210_priv *wil, struct sk_buff *skb)
771{
772 struct wmi_eapol_tx_cmd *cmd;
773 struct ethhdr *eth;
774 u16 eapol_len = skb->len - ETH_HLEN;
775 void *eapol = skb->data + ETH_HLEN;
776 uint i;
777 int rc;
778
779 skb_set_mac_header(skb, 0);
780 eth = eth_hdr(skb);
781 wil_dbg_WMI(wil, "EAPOL %d bytes to %pM\n", eapol_len, eth->h_dest);
782 for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++) {
783 if (memcmp(wil->dst_addr[i], eth->h_dest, ETH_ALEN) == 0)
784 goto found_dest;
785 }
786
787 return -EINVAL;
788
789 found_dest:
790 /* find out eapol data & len */
791 cmd = kzalloc(sizeof(*cmd) + eapol_len, GFP_KERNEL);
792 if (!cmd)
793 return -EINVAL;
794
795 memcpy(cmd->dst_mac, eth->h_dest, ETH_ALEN);
796 cmd->eapol_len = cpu_to_le16(eapol_len);
797 memcpy(cmd->eapol, eapol, eapol_len);
798 rc = wmi_send(wil, WMI_EAPOL_TX_CMDID, cmd, sizeof(*cmd) + eapol_len);
799 kfree(cmd);
800
801 return rc;
802}
803
804int wmi_del_cipher_key(struct wil6210_priv *wil, u8 key_index,
805 const void *mac_addr)
806{
807 struct wmi_delete_cipher_key_cmd cmd = {
808 .key_index = key_index,
809 };
810
811 if (mac_addr)
812 memcpy(cmd.mac, mac_addr, WMI_MAC_LEN);
813
814 return wmi_send(wil, WMI_DELETE_CIPHER_KEY_CMDID, &cmd, sizeof(cmd));
815}
816
817int wmi_add_cipher_key(struct wil6210_priv *wil, u8 key_index,
818 const void *mac_addr, int key_len, const void *key)
819{
820 struct wmi_add_cipher_key_cmd cmd = {
821 .key_index = key_index,
822 .key_usage = WMI_KEY_USE_PAIRWISE,
823 .key_len = key_len,
824 };
825
826 if (!key || (key_len > sizeof(cmd.key)))
827 return -EINVAL;
828
829 memcpy(cmd.key, key, key_len);
830 if (mac_addr)
831 memcpy(cmd.mac, mac_addr, WMI_MAC_LEN);
832
833 return wmi_send(wil, WMI_ADD_CIPHER_KEY_CMDID, &cmd, sizeof(cmd));
834}
835
836int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie)
837{
838 int rc;
839 u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len;
840 struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL);
841 if (!cmd) {
842 wil_err(wil, "kmalloc(%d) failed\n", len);
843 return -ENOMEM;
844 }
845
846 cmd->mgmt_frm_type = type;
847 /* BUG: FW API define ieLen as u8. Will fix FW */
848 cmd->ie_len = cpu_to_le16(ie_len);
849 memcpy(cmd->ie_info, ie, ie_len);
850 rc = wmi_send(wil, WMI_SET_APPIE_CMDID, &cmd, len);
851 kfree(cmd);
852
853 return rc;
854}
855
856void wmi_event_flush(struct wil6210_priv *wil)
857{
858 struct pending_wmi_event *evt, *t;
859
860 wil_dbg_WMI(wil, "%s()\n", __func__);
861
862 list_for_each_entry_safe(evt, t, &wil->pending_wmi_ev, list) {
863 list_del(&evt->list);
864 kfree(evt);
865 }
866}
867
868static bool wmi_evt_call_handler(struct wil6210_priv *wil, int id,
869 void *d, int len)
870{
871 uint i;
872
873 for (i = 0; i < ARRAY_SIZE(wmi_evt_handlers); i++) {
874 if (wmi_evt_handlers[i].eventid == id) {
875 wmi_evt_handlers[i].handler(wil, id, d, len);
876 return true;
877 }
878 }
879
880 return false;
881}
882
883static void wmi_event_handle(struct wil6210_priv *wil,
884 struct wil6210_mbox_hdr *hdr)
885{
886 u16 len = le16_to_cpu(hdr->len);
887
888 if ((hdr->type == WIL_MBOX_HDR_TYPE_WMI) &&
889 (len >= sizeof(struct wil6210_mbox_hdr_wmi))) {
890 struct wil6210_mbox_hdr_wmi *wmi = (void *)(&hdr[1]);
891 void *evt_data = (void *)(&wmi[1]);
892 u16 id = le16_to_cpu(wmi->id);
893 /* check if someone waits for this event */
894 if (wil->reply_id && wil->reply_id == id) {
895 if (wil->reply_buf) {
896 memcpy(wil->reply_buf, wmi,
897 min(len, wil->reply_size));
898 } else {
899 wmi_evt_call_handler(wil, id, evt_data,
900 len - sizeof(*wmi));
901 }
902 wil_dbg_WMI(wil, "Complete WMI 0x%04x\n", id);
903 complete(&wil->wmi_ready);
904 return;
905 }
906 /* unsolicited event */
907 /* search for handler */
908 if (!wmi_evt_call_handler(wil, id, evt_data,
909 len - sizeof(*wmi))) {
910 wil_err(wil, "Unhandled event 0x%04x\n", id);
911 }
912 } else {
913 wil_err(wil, "Unknown event type\n");
914 print_hex_dump(KERN_ERR, "evt?? ", DUMP_PREFIX_OFFSET, 16, 1,
915 hdr, sizeof(*hdr) + len, true);
916 }
917}
918
919/*
920 * Retrieve next WMI event from the pending list
921 */
922static struct list_head *next_wmi_ev(struct wil6210_priv *wil)
923{
924 ulong flags;
925 struct list_head *ret = NULL;
926
927 spin_lock_irqsave(&wil->wmi_ev_lock, flags);
928
929 if (!list_empty(&wil->pending_wmi_ev)) {
930 ret = wil->pending_wmi_ev.next;
931 list_del(ret);
932 }
933
934 spin_unlock_irqrestore(&wil->wmi_ev_lock, flags);
935
936 return ret;
937}
938
939/*
940 * Handler for the WMI events
941 */
942void wmi_event_worker(struct work_struct *work)
943{
944 struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
945 wmi_event_worker);
946 struct pending_wmi_event *evt;
947 struct list_head *lh;
948
949 while ((lh = next_wmi_ev(wil)) != NULL) {
950 evt = list_entry(lh, struct pending_wmi_event, list);
951 wmi_event_handle(wil, &evt->event.hdr);
952 kfree(evt);
953 }
954}
955
956void wmi_connect_worker(struct work_struct *work)
957{
958 int rc;
959 struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
960 wmi_connect_worker);
961
962 if (wil->pending_connect_cid < 0) {
963 wil_err(wil, "No connection pending\n");
964 return;
965 }
966
967 wil_dbg_WMI(wil, "Configure for connection CID %d\n",
968 wil->pending_connect_cid);
969
970 rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE,
971 wil->pending_connect_cid, 0);
972 wil->pending_connect_cid = -1;
973 if (rc == 0)
974 wil_link_on(wil);
975}
diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
new file mode 100644
index 00000000000..3bbf87572b0
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -0,0 +1,1116 @@
1/*
2 * Copyright (c) 2012 Qualcomm Atheros, Inc.
3 * Copyright (c) 2006-2012 Wilocity .
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18/*
19 * This file contains the definitions of the WMI protocol specified in the
20 * Wireless Module Interface (WMI) for the Wilocity
21 * MARLON 60 Gigabit wireless solution.
22 * It includes definitions of all the commands and events.
23 * Commands are messages from the host to the WM.
24 * Events are messages from the WM to the host.
25 */
26
27#ifndef __WILOCITY_WMI_H__
28#define __WILOCITY_WMI_H__
29
30/* General */
31
32#define WMI_MAC_LEN (6)
33#define WMI_PROX_RANGE_NUM (3)
34
35/* List of Commands */
36enum wmi_command_id {
37 WMI_CONNECT_CMDID = 0x0001,
38 WMI_DISCONNECT_CMDID = 0x0003,
39 WMI_START_SCAN_CMDID = 0x0007,
40 WMI_SET_BSS_FILTER_CMDID = 0x0009,
41 WMI_SET_PROBED_SSID_CMDID = 0x000a,
42 WMI_SET_LISTEN_INT_CMDID = 0x000b,
43 WMI_BCON_CTRL_CMDID = 0x000f,
44 WMI_ADD_CIPHER_KEY_CMDID = 0x0016,
45 WMI_DELETE_CIPHER_KEY_CMDID = 0x0017,
46 WMI_SET_APPIE_CMDID = 0x003f,
47 WMI_GET_APPIE_CMDID = 0x0040,
48 WMI_SET_WSC_STATUS_CMDID = 0x0041,
49 WMI_PXMT_RANGE_CFG_CMDID = 0x0042,
50 WMI_PXMT_SNR2_RANGE_CFG_CMDID = 0x0043,
51 WMI_FAST_MEM_ACC_MODE_CMDID = 0x0300,
52 WMI_MEM_READ_CMDID = 0x0800,
53 WMI_MEM_WR_CMDID = 0x0801,
54 WMI_ECHO_CMDID = 0x0803,
55 WMI_DEEP_ECHO_CMDID = 0x0804,
56 WMI_CONFIG_MAC_CMDID = 0x0805,
57 WMI_CONFIG_PHY_DEBUG_CMDID = 0x0806,
58 WMI_ADD_STATION_CMDID = 0x0807,
59 WMI_ADD_DEBUG_TX_PCKT_CMDID = 0x0808,
60 WMI_PHY_GET_STATISTICS_CMDID = 0x0809,
61 WMI_FS_TUNE_CMDID = 0x080a,
62 WMI_CORR_MEASURE_CMDID = 0x080b,
63 WMI_TEMP_SENSE_CMDID = 0x080e,
64 WMI_DC_CALIB_CMDID = 0x080f,
65 WMI_SEND_TONE_CMDID = 0x0810,
66 WMI_IQ_TX_CALIB_CMDID = 0x0811,
67 WMI_IQ_RX_CALIB_CMDID = 0x0812,
68 WMI_SET_UCODE_IDLE_CMDID = 0x0813,
69 WMI_SET_WORK_MODE_CMDID = 0x0815,
70 WMI_LO_LEAKAGE_CALIB_CMDID = 0x0816,
71 WMI_MARLON_R_ACTIVATE_CMDID = 0x0817,
72 WMI_MARLON_R_READ_CMDID = 0x0818,
73 WMI_MARLON_R_WRITE_CMDID = 0x0819,
74 WMI_MARLON_R_TXRX_SEL_CMDID = 0x081a,
75 MAC_IO_STATIC_PARAMS_CMDID = 0x081b,
76 MAC_IO_DYNAMIC_PARAMS_CMDID = 0x081c,
77 WMI_SILENT_RSSI_CALIB_CMDID = 0x081d,
78 WMI_CFG_RX_CHAIN_CMDID = 0x0820,
79 WMI_VRING_CFG_CMDID = 0x0821,
80 WMI_RX_ON_CMDID = 0x0822,
81 WMI_VRING_BA_EN_CMDID = 0x0823,
82 WMI_VRING_BA_DIS_CMDID = 0x0824,
83 WMI_RCP_ADDBA_RESP_CMDID = 0x0825,
84 WMI_RCP_DELBA_CMDID = 0x0826,
85 WMI_SET_SSID_CMDID = 0x0827,
86 WMI_GET_SSID_CMDID = 0x0828,
87 WMI_SET_PCP_CHANNEL_CMDID = 0x0829,
88 WMI_GET_PCP_CHANNEL_CMDID = 0x082a,
89 WMI_SW_TX_REQ_CMDID = 0x082b,
90 WMI_RX_OFF_CMDID = 0x082c,
91 WMI_READ_MAC_RXQ_CMDID = 0x0830,
92 WMI_READ_MAC_TXQ_CMDID = 0x0831,
93 WMI_WRITE_MAC_RXQ_CMDID = 0x0832,
94 WMI_WRITE_MAC_TXQ_CMDID = 0x0833,
95 WMI_WRITE_MAC_XQ_FIELD_CMDID = 0x0834,
96 WMI_MLME_PUSH_CMDID = 0x0835,
97 WMI_BEAMFORMING_MGMT_CMDID = 0x0836,
98 WMI_BF_TXSS_MGMT_CMDID = 0x0837,
99 WMI_BF_SM_MGMT_CMDID = 0x0838,
100 WMI_BF_RXSS_MGMT_CMDID = 0x0839,
101 WMI_SET_SECTORS_CMDID = 0x0849,
102 WMI_MAINTAIN_PAUSE_CMDID = 0x0850,
103 WMI_MAINTAIN_RESUME_CMDID = 0x0851,
104 WMI_RS_MGMT_CMDID = 0x0852,
105 WMI_RF_MGMT_CMDID = 0x0853,
106 /* Performance monitoring commands */
107 WMI_BF_CTRL_CMDID = 0x0862,
108 WMI_NOTIFY_REQ_CMDID = 0x0863,
109 WMI_GET_STATUS_CMDID = 0x0864,
110 WMI_UNIT_TEST_CMDID = 0x0900,
111 WMI_HICCUP_CMDID = 0x0901,
112 WMI_FLASH_READ_CMDID = 0x0902,
113 WMI_FLASH_WRITE_CMDID = 0x0903,
114 WMI_SECURITY_UNIT_TEST_CMDID = 0x0904,
115
116 WMI_SET_MAC_ADDRESS_CMDID = 0xf003,
117 WMI_ABORT_SCAN_CMDID = 0xf007,
118 WMI_SET_PMK_CMDID = 0xf028,
119
120 WMI_SET_PROMISCUOUS_MODE_CMDID = 0xf041,
121 WMI_GET_PMK_CMDID = 0xf048,
122 WMI_SET_PASSPHRASE_CMDID = 0xf049,
123 WMI_SEND_ASSOC_RES_CMDID = 0xf04a,
124 WMI_SET_ASSOC_REQ_RELAY_CMDID = 0xf04b,
125 WMI_EAPOL_TX_CMDID = 0xf04c,
126 WMI_MAC_ADDR_REQ_CMDID = 0xf04d,
127 WMI_FW_VER_CMDID = 0xf04e,
128};
129
130/*
131 * Commands data structures
132 */
133
134/*
135 * Frame Types
136 */
137enum wmi_mgmt_frame_type {
138 WMI_FRAME_BEACON = 0,
139 WMI_FRAME_PROBE_REQ = 1,
140 WMI_FRAME_PROBE_RESP = 2,
141 WMI_FRAME_ASSOC_REQ = 3,
142 WMI_FRAME_ASSOC_RESP = 4,
143 WMI_NUM_MGMT_FRAME,
144};
145
146/*
147 * WMI_CONNECT_CMDID
148 */
149enum wmi_network_type {
150 WMI_NETTYPE_INFRA = 0x01,
151 WMI_NETTYPE_ADHOC = 0x02,
152 WMI_NETTYPE_ADHOC_CREATOR = 0x04,
153 WMI_NETTYPE_AP = 0x10,
154 WMI_NETTYPE_P2P = 0x20,
155 WMI_NETTYPE_WBE = 0x40, /* PCIE over 60g */
156};
157
158enum wmi_dot11_auth_mode {
159 WMI_AUTH11_OPEN = 0x01,
160 WMI_AUTH11_SHARED = 0x02,
161 WMI_AUTH11_LEAP = 0x04,
162 WMI_AUTH11_WSC = 0x08,
163};
164
165enum wmi_auth_mode {
166 WMI_AUTH_NONE = 0x01,
167 WMI_AUTH_WPA = 0x02,
168 WMI_AUTH_WPA2 = 0x04,
169 WMI_AUTH_WPA_PSK = 0x08,
170 WMI_AUTH_WPA2_PSK = 0x10,
171 WMI_AUTH_WPA_CCKM = 0x20,
172 WMI_AUTH_WPA2_CCKM = 0x40,
173};
174
175enum wmi_crypto_type {
176 WMI_CRYPT_NONE = 0x01,
177 WMI_CRYPT_WEP = 0x02,
178 WMI_CRYPT_TKIP = 0x04,
179 WMI_CRYPT_AES = 0x08,
180 WMI_CRYPT_AES_GCMP = 0x20,
181};
182
183
184enum wmi_connect_ctrl_flag_bits {
185 WMI_CONNECT_ASSOC_POLICY_USER = 0x0001,
186 WMI_CONNECT_SEND_REASSOC = 0x0002,
187 WMI_CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
188 WMI_CONNECT_PROFILE_MATCH_DONE = 0x0008,
189 WMI_CONNECT_IGNORE_AAC_BEACON = 0x0010,
190 WMI_CONNECT_CSA_FOLLOW_BSS = 0x0020,
191 WMI_CONNECT_DO_WPA_OFFLOAD = 0x0040,
192 WMI_CONNECT_DO_NOT_DEAUTH = 0x0080,
193};
194
195#define WMI_MAX_SSID_LEN (32)
196
197struct wmi_connect_cmd {
198 u8 network_type;
199 u8 dot11_auth_mode;
200 u8 auth_mode;
201 u8 pairwise_crypto_type;
202 u8 pairwise_crypto_len;
203 u8 group_crypto_type;
204 u8 group_crypto_len;
205 u8 ssid_len;
206 u8 ssid[WMI_MAX_SSID_LEN];
207 u8 channel;
208 u8 reserved0;
209 u8 bssid[WMI_MAC_LEN];
210 __le32 ctrl_flags;
211 u8 dst_mac[WMI_MAC_LEN];
212 u8 reserved1[2];
213} __packed;
214
215
216/*
217 * WMI_RECONNECT_CMDID
218 */
219struct wmi_reconnect_cmd {
220 u8 channel; /* hint */
221 u8 reserved;
222 u8 bssid[WMI_MAC_LEN]; /* mandatory if set */
223} __packed;
224
225
226/*
227 * WMI_SET_PMK_CMDID
228 */
229
230#define WMI_MIN_KEY_INDEX (0)
231#define WMI_MAX_KEY_INDEX (3)
232#define WMI_MAX_KEY_LEN (32)
233#define WMI_PASSPHRASE_LEN (64)
234#define WMI_PMK_LEN (32)
235
236struct wmi_set_pmk_cmd {
237 u8 pmk[WMI_PMK_LEN];
238} __packed;
239
240
241/*
242 * WMI_SET_PASSPHRASE_CMDID
243 */
244struct wmi_set_passphrase_cmd {
245 u8 ssid[WMI_MAX_SSID_LEN];
246 u8 passphrase[WMI_PASSPHRASE_LEN];
247 u8 ssid_len;
248 u8 passphrase_len;
249} __packed;
250
251/*
252 * WMI_ADD_CIPHER_KEY_CMDID
253 */
254enum wmi_key_usage {
255 WMI_KEY_USE_PAIRWISE = 0,
256 WMI_KEY_USE_GROUP = 1,
257 WMI_KEY_USE_TX = 2, /* default Tx Key - Static WEP only */
258};
259
260struct wmi_add_cipher_key_cmd {
261 u8 key_index;
262 u8 key_type;
263 u8 key_usage; /* enum wmi_key_usage */
264 u8 key_len;
265 u8 key_rsc[8]; /* key replay sequence counter */
266 u8 key[WMI_MAX_KEY_LEN];
267 u8 key_op_ctrl; /* Additional Key Control information */
268 u8 mac[WMI_MAC_LEN];
269} __packed;
270
271/*
272 * WMI_DELETE_CIPHER_KEY_CMDID
273 */
274struct wmi_delete_cipher_key_cmd {
275 u8 key_index;
276 u8 mac[WMI_MAC_LEN];
277} __packed;
278
279
280/*
281 * WMI_START_SCAN_CMDID
282 *
283 * Start L1 scan operation
284 *
285 * Returned events:
286 * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
287 * - WMI_SCAN_COMPLETE_EVENTID
288 */
289enum wmi_scan_type {
290 WMI_LONG_SCAN = 0,
291 WMI_SHORT_SCAN = 1,
292};
293
294struct wmi_start_scan_cmd {
295 u8 reserved[8];
296 __le32 home_dwell_time; /* Max duration in the home channel(ms) */
297 __le32 force_scan_interval; /* Time interval between scans (ms)*/
298 u8 scan_type; /* wmi_scan_type */
299 u8 num_channels; /* how many channels follow */
300 struct {
301 u8 channel;
302 u8 reserved;
303 } channel_list[0]; /* channels ID's */
304 /* 0 - 58320 MHz */
305 /* 1 - 60480 MHz */
306 /* 2 - 62640 MHz */
307} __packed;
308
309/*
310 * WMI_SET_PROBED_SSID_CMDID
311 */
312#define MAX_PROBED_SSID_INDEX (15)
313
314enum wmi_ssid_flag {
315 WMI_SSID_FLAG_DISABLE = 0, /* disables entry */
316 WMI_SSID_FLAG_SPECIFIC = 1, /* probes specified ssid */
317 WMI_SSID_FLAG_ANY = 2, /* probes for any ssid */
318};
319
320struct wmi_probed_ssid_cmd {
321 u8 entry_index; /* 0 to MAX_PROBED_SSID_INDEX */
322 u8 flag; /* enum wmi_ssid_flag */
323 u8 ssid_len;
324 u8 ssid[WMI_MAX_SSID_LEN];
325} __packed;
326
327/*
328 * WMI_SET_APPIE_CMDID
329 * Add Application specified IE to a management frame
330 */
331struct wmi_set_appie_cmd {
332 u8 mgmt_frm_type; /* enum wmi_mgmt_frame_type */
333 u8 reserved;
334 __le16 ie_len; /* Length of the IE to be added to MGMT frame */
335 u8 ie_info[0];
336} __packed;
337
338#define WMI_MAX_IE_LEN (1024)
339
340struct wmi_pxmt_range_cfg_cmd {
341 u8 dst_mac[WMI_MAC_LEN];
342 __le16 range;
343} __packed;
344
345struct wmi_pxmt_snr2_range_cfg_cmd {
346 s8 snr2range_arr[WMI_PROX_RANGE_NUM-1];
347} __packed;
348
349/*
350 * WMI_RF_MGMT_CMDID
351 */
352enum wmi_rf_mgmt_type {
353 WMI_RF_MGMT_W_DISABLE = 0,
354 WMI_RF_MGMT_W_ENABLE = 1,
355 WMI_RF_MGMT_GET_STATUS = 2,
356};
357
358struct wmi_rf_mgmt_cmd {
359 __le32 rf_mgmt_type;
360} __packed;
361
362/*
363 * WMI_SET_SSID_CMDID
364 */
365struct wmi_set_ssid_cmd {
366 __le32 ssid_len;
367 u8 ssid[WMI_MAX_SSID_LEN];
368} __packed;
369
370/*
371 * WMI_SET_PCP_CHANNEL_CMDID
372 */
373struct wmi_set_pcp_channel_cmd {
374 u8 channel;
375 u8 reserved[3];
376} __packed;
377
378/*
379 * WMI_BCON_CTRL_CMDID
380 */
381struct wmi_bcon_ctrl_cmd {
382 __le16 bcon_interval;
383 __le16 frag_num;
384 __le64 ss_mask;
385 u8 network_type;
386 u8 reserved;
387 u8 disable_sec_offload;
388 u8 disable_sec;
389} __packed;
390
391/*
392 * WMI_SW_TX_REQ_CMDID
393 */
394struct wmi_sw_tx_req_cmd {
395 u8 dst_mac[WMI_MAC_LEN];
396 __le16 len;
397 u8 payload[0];
398} __packed;
399
400/*
401 * WMI_VRING_CFG_CMDID
402 */
403
404struct wmi_sw_ring_cfg {
405 __le64 ring_mem_base;
406 __le16 ring_size;
407 __le16 max_mpdu_size;
408} __packed;
409
410struct wmi_vring_cfg_schd {
411 __le16 priority;
412 __le16 timeslot_us;
413} __packed;
414
415enum wmi_vring_cfg_encap_trans_type {
416 WMI_VRING_ENC_TYPE_802_3 = 0,
417 WMI_VRING_ENC_TYPE_NATIVE_WIFI = 1,
418};
419
420enum wmi_vring_cfg_ds_cfg {
421 WMI_VRING_DS_PBSS = 0,
422 WMI_VRING_DS_STATION = 1,
423 WMI_VRING_DS_AP = 2,
424 WMI_VRING_DS_ADDR4 = 3,
425};
426
427enum wmi_vring_cfg_nwifi_ds_trans_type {
428 WMI_NWIFI_TX_TRANS_MODE_NO = 0,
429 WMI_NWIFI_TX_TRANS_MODE_AP2PBSS = 1,
430 WMI_NWIFI_TX_TRANS_MODE_STA2PBSS = 2,
431};
432
433enum wmi_vring_cfg_schd_params_priority {
434 WMI_SCH_PRIO_REGULAR = 0,
435 WMI_SCH_PRIO_HIGH = 1,
436};
437
438struct wmi_vring_cfg {
439 struct wmi_sw_ring_cfg tx_sw_ring;
440 u8 ringid; /* 0-23 vrings */
441
442 #define CIDXTID_CID_POS (0)
443 #define CIDXTID_CID_LEN (4)
444 #define CIDXTID_CID_MSK (0xF)
445 #define CIDXTID_TID_POS (4)
446 #define CIDXTID_TID_LEN (4)
447 #define CIDXTID_TID_MSK (0xF0)
448 u8 cidxtid;
449
450 u8 encap_trans_type;
451 u8 ds_cfg; /* 802.3 DS cfg */
452 u8 nwifi_ds_trans_type;
453
454 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS (0)
455 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN (1)
456 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK (0x1)
457 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS (1)
458 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN (1)
459 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK (0x2)
460 u8 mac_ctrl;
461
462 #define VRING_CFG_TO_RESOLUTION_VALUE_POS (0)
463 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN (6)
464 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK (0x3F)
465 u8 to_resolution;
466 u8 agg_max_wsize;
467 struct wmi_vring_cfg_schd schd_params;
468} __packed;
469
470enum wmi_vring_cfg_cmd_action {
471 WMI_VRING_CMD_ADD = 0,
472 WMI_VRING_CMD_MODIFY = 1,
473 WMI_VRING_CMD_DELETE = 2,
474};
475
476struct wmi_vring_cfg_cmd {
477 __le32 action;
478 struct wmi_vring_cfg vring_cfg;
479} __packed;
480
481/*
482 * WMI_VRING_BA_EN_CMDID
483 */
484struct wmi_vring_ba_en_cmd {
485 u8 ringid;
486 u8 agg_max_wsize;
487 __le16 ba_timeout;
488} __packed;
489
490/*
491 * WMI_VRING_BA_DIS_CMDID
492 */
493struct wmi_vring_ba_dis_cmd {
494 u8 ringid;
495 u8 reserved;
496 __le16 reason;
497} __packed;
498
499/*
500 * WMI_NOTIFY_REQ_CMDID
501 */
502struct wmi_notify_req_cmd {
503 u8 cid;
504 u8 reserved[3];
505 __le32 interval_usec;
506} __packed;
507
508/*
509 * WMI_CFG_RX_CHAIN_CMDID
510 */
511enum wmi_sniffer_cfg_mode {
512 WMI_SNIFFER_OFF = 0,
513 WMI_SNIFFER_ON = 1,
514};
515
516enum wmi_sniffer_cfg_phy_info_mode {
517 WMI_SNIFFER_PHY_INFO_DISABLED = 0,
518 WMI_SNIFFER_PHY_INFO_ENABLED = 1,
519};
520
521enum wmi_sniffer_cfg_phy_support {
522 WMI_SNIFFER_CP = 0,
523 WMI_SNIFFER_DP = 1,
524 WMI_SNIFFER_BOTH_PHYS = 2,
525};
526
527struct wmi_sniffer_cfg {
528 __le32 mode; /* enum wmi_sniffer_cfg_mode */
529 __le32 phy_info_mode; /* enum wmi_sniffer_cfg_phy_info_mode */
530 __le32 phy_support; /* enum wmi_sniffer_cfg_phy_support */
531 u8 channel;
532 u8 reserved[3];
533} __packed;
534
535enum wmi_cfg_rx_chain_cmd_action {
536 WMI_RX_CHAIN_ADD = 0,
537 WMI_RX_CHAIN_DEL = 1,
538};
539
540enum wmi_cfg_rx_chain_cmd_decap_trans_type {
541 WMI_DECAP_TYPE_802_3 = 0,
542 WMI_DECAP_TYPE_NATIVE_WIFI = 1,
543};
544
545enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
546 WMI_NWIFI_RX_TRANS_MODE_NO = 0,
547 WMI_NWIFI_RX_TRANS_MODE_PBSS2AP = 1,
548 WMI_NWIFI_RX_TRANS_MODE_PBSS2STA = 2,
549};
550
551struct wmi_cfg_rx_chain_cmd {
552 __le32 action;
553 struct wmi_sw_ring_cfg rx_sw_ring;
554 u8 mid;
555 u8 decap_trans_type;
556
557 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS (0)
558 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN (1)
559 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK (0x1)
560 u8 l2_802_3_offload_ctrl;
561
562 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS (0)
563 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN (1)
564 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK (0x1)
565 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS (1)
566 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN (1)
567 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK (0x2)
568 u8 l2_nwifi_offload_ctrl;
569
570 u8 vlan_id;
571 u8 nwifi_ds_trans_type;
572
573 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS (0)
574 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN (1)
575 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK (0x1)
576 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS (1)
577 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN (1)
578 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK (0x2)
579 u8 l3_l4_ctrl;
580
581 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS (0)
582 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN (1)
583 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK (0x1)
584 #define RING_CTRL_OVERRIDE_WB_THRSH_POS (1)
585 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN (1)
586 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK (0x2)
587 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS (2)
588 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN (1)
589 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK (0x4)
590 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS (3)
591 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN (1)
592 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK (0x8)
593 u8 ring_ctrl;
594
595 __le16 prefetch_thrsh;
596 __le16 wb_thrsh;
597 __le32 itr_value;
598 __le16 host_thrsh;
599 u8 reserved[2];
600 struct wmi_sniffer_cfg sniffer_cfg;
601} __packed;
602
603/*
604 * WMI_RCP_ADDBA_RESP_CMDID
605 */
606struct wmi_rcp_addba_resp_cmd {
607
608 #define CIDXTID_CID_POS (0)
609 #define CIDXTID_CID_LEN (4)
610 #define CIDXTID_CID_MSK (0xF)
611 #define CIDXTID_TID_POS (4)
612 #define CIDXTID_TID_LEN (4)
613 #define CIDXTID_TID_MSK (0xF0)
614 u8 cidxtid;
615
616 u8 dialog_token;
617 __le16 status_code;
618 __le16 ba_param_set; /* ieee80211_ba_parameterset field to send */
619 __le16 ba_timeout;
620} __packed;
621
622/*
623 * WMI_RCP_DELBA_CMDID
624 */
625struct wmi_rcp_delba_cmd {
626
627 #define CIDXTID_CID_POS (0)
628 #define CIDXTID_CID_LEN (4)
629 #define CIDXTID_CID_MSK (0xF)
630 #define CIDXTID_TID_POS (4)
631 #define CIDXTID_TID_LEN (4)
632 #define CIDXTID_TID_MSK (0xF0)
633 u8 cidxtid;
634
635 u8 reserved;
636 __le16 reason;
637} __packed;
638
639/*
640 * WMI_RCP_ADDBA_REQ_CMDID
641 */
642struct wmi_rcp_addba_req_cmd {
643
644 #define CIDXTID_CID_POS (0)
645 #define CIDXTID_CID_LEN (4)
646 #define CIDXTID_CID_MSK (0xF)
647 #define CIDXTID_TID_POS (4)
648 #define CIDXTID_TID_LEN (4)
649 #define CIDXTID_TID_MSK (0xF0)
650 u8 cidxtid;
651
652 u8 dialog_token;
653 /* ieee80211_ba_parameterset field as it received */
654 __le16 ba_param_set;
655 __le16 ba_timeout;
656 /* ieee80211_ba_seqstrl field as it received */
657 __le16 ba_seq_ctrl;
658} __packed;
659
660/*
661 * WMI_SET_MAC_ADDRESS_CMDID
662 */
663struct wmi_set_mac_address_cmd {
664 u8 mac[WMI_MAC_LEN];
665 u8 reserved[2];
666} __packed;
667
668
669/*
670* WMI_EAPOL_TX_CMDID
671*/
672struct wmi_eapol_tx_cmd {
673 u8 dst_mac[WMI_MAC_LEN];
674 __le16 eapol_len;
675 u8 eapol[0];
676} __packed;
677
678/*
679 * WMI_ECHO_CMDID
680 *
681 * Check FW is alive
682 *
683 * WMI_DEEP_ECHO_CMDID
684 *
685 * Check FW and ucode are alive
686 *
687 * Returned event: WMI_ECHO_RSP_EVENTID
688 * same event for both commands
689 */
690struct wmi_echo_cmd {
691 __le32 value;
692} __packed;
693
694/*
695 * WMI Events
696 */
697
698/*
699 * List of Events (target to host)
700 */
701enum wmi_event_id {
702 WMI_IMM_RSP_EVENTID = 0x0000,
703 WMI_READY_EVENTID = 0x1001,
704 WMI_CONNECT_EVENTID = 0x1002,
705 WMI_DISCONNECT_EVENTID = 0x1003,
706 WMI_SCAN_COMPLETE_EVENTID = 0x100a,
707 WMI_REPORT_STATISTICS_EVENTID = 0x100b,
708 WMI_RD_MEM_RSP_EVENTID = 0x1800,
709 WMI_FW_READY_EVENTID = 0x1801,
710 WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID = 0x0200,
711 WMI_ECHO_RSP_EVENTID = 0x1803,
712 WMI_CONFIG_MAC_DONE_EVENTID = 0x1805,
713 WMI_CONFIG_PHY_DEBUG_DONE_EVENTID = 0x1806,
714 WMI_ADD_STATION_DONE_EVENTID = 0x1807,
715 WMI_ADD_DEBUG_TX_PCKT_DONE_EVENTID = 0x1808,
716 WMI_PHY_GET_STATISTICS_EVENTID = 0x1809,
717 WMI_FS_TUNE_DONE_EVENTID = 0x180a,
718 WMI_CORR_MEASURE_DONE_EVENTID = 0x180b,
719 WMI_TEMP_SENSE_DONE_EVENTID = 0x180e,
720 WMI_DC_CALIB_DONE_EVENTID = 0x180f,
721 WMI_IQ_TX_CALIB_DONE_EVENTID = 0x1811,
722 WMI_IQ_RX_CALIB_DONE_EVENTID = 0x1812,
723 WMI_SET_WORK_MODE_DONE_EVENTID = 0x1815,
724 WMI_LO_LEAKAGE_CALIB_DONE_EVENTID = 0x1816,
725 WMI_MARLON_R_ACTIVATE_DONE_EVENTID = 0x1817,
726 WMI_MARLON_R_READ_DONE_EVENTID = 0x1818,
727 WMI_MARLON_R_WRITE_DONE_EVENTID = 0x1819,
728 WMI_MARLON_R_TXRX_SEL_DONE_EVENTID = 0x181a,
729 WMI_SILENT_RSSI_CALIB_DONE_EVENTID = 0x181d,
730
731 WMI_CFG_RX_CHAIN_DONE_EVENTID = 0x1820,
732 WMI_VRING_CFG_DONE_EVENTID = 0x1821,
733 WMI_RX_ON_DONE_EVENTID = 0x1822,
734 WMI_BA_STATUS_EVENTID = 0x1823,
735 WMI_RCP_ADDBA_REQ_EVENTID = 0x1824,
736 WMI_ADDBA_RESP_SENT_EVENTID = 0x1825,
737 WMI_DELBA_EVENTID = 0x1826,
738 WMI_GET_SSID_EVENTID = 0x1828,
739 WMI_GET_PCP_CHANNEL_EVENTID = 0x182a,
740 WMI_SW_TX_COMPLETE_EVENTID = 0x182b,
741 WMI_RX_OFF_DONE_EVENTID = 0x182c,
742
743 WMI_READ_MAC_RXQ_EVENTID = 0x1830,
744 WMI_READ_MAC_TXQ_EVENTID = 0x1831,
745 WMI_WRITE_MAC_RXQ_EVENTID = 0x1832,
746 WMI_WRITE_MAC_TXQ_EVENTID = 0x1833,
747 WMI_WRITE_MAC_XQ_FIELD_EVENTID = 0x1834,
748
749 WMI_BEAFORMING_MGMT_DONE_EVENTID = 0x1836,
750 WMI_BF_TXSS_MGMT_DONE_EVENTID = 0x1837,
751 WMI_BF_RXSS_MGMT_DONE_EVENTID = 0x1839,
752 WMI_RS_MGMT_DONE_EVENTID = 0x1852,
753 WMI_RF_MGMT_STATUS_EVENTID = 0x1853,
754 WMI_BF_SM_MGMT_DONE_EVENTID = 0x1838,
755 WMI_RX_MGMT_PACKET_EVENTID = 0x1840,
756
757 /* Performance monitoring events */
758 WMI_DATA_PORT_OPEN_EVENTID = 0x1860,
759 WMI_WBE_LINKDOWN_EVENTID = 0x1861,
760
761 WMI_BF_CTRL_DONE_EVENTID = 0x1862,
762 WMI_NOTIFY_REQ_DONE_EVENTID = 0x1863,
763 WMI_GET_STATUS_DONE_EVENTID = 0x1864,
764
765 WMI_UNIT_TEST_EVENTID = 0x1900,
766 WMI_FLASH_READ_DONE_EVENTID = 0x1902,
767 WMI_FLASH_WRITE_DONE_EVENTID = 0x1903,
768
769 WMI_SET_CHANNEL_EVENTID = 0x9000,
770 WMI_ASSOC_REQ_EVENTID = 0x9001,
771 WMI_EAPOL_RX_EVENTID = 0x9002,
772 WMI_MAC_ADDR_RESP_EVENTID = 0x9003,
773 WMI_FW_VER_EVENTID = 0x9004,
774};
775
776/*
777 * Events data structures
778 */
779
780/*
781 * WMI_RF_MGMT_STATUS_EVENTID
782 */
783enum wmi_rf_status {
784 WMI_RF_ENABLED = 0,
785 WMI_RF_DISABLED_HW = 1,
786 WMI_RF_DISABLED_SW = 2,
787 WMI_RF_DISABLED_HW_SW = 3,
788};
789
790struct wmi_rf_mgmt_status_event {
791 __le32 rf_status;
792} __packed;
793
794/*
795 * WMI_GET_STATUS_DONE_EVENTID
796 */
797struct wmi_get_status_done_event {
798 __le32 is_associated;
799 u8 cid;
800 u8 reserved0[3];
801 u8 bssid[WMI_MAC_LEN];
802 u8 channel;
803 u8 reserved1;
804 u8 network_type;
805 u8 reserved2[3];
806 __le32 ssid_len;
807 u8 ssid[WMI_MAX_SSID_LEN];
808 __le32 rf_status;
809 __le32 is_secured;
810} __packed;
811
812/*
813 * WMI_FW_VER_EVENTID
814 */
815struct wmi_fw_ver_event {
816 u8 major;
817 u8 minor;
818 __le16 subminor;
819 __le16 build;
820} __packed;
821
822/*
823* WMI_MAC_ADDR_RESP_EVENTID
824*/
825struct wmi_mac_addr_resp_event {
826 u8 mac[WMI_MAC_LEN];
827 u8 auth_mode;
828 u8 crypt_mode;
829 __le32 offload_mode;
830} __packed;
831
832/*
833* WMI_EAPOL_RX_EVENTID
834*/
835struct wmi_eapol_rx_event {
836 u8 src_mac[WMI_MAC_LEN];
837 __le16 eapol_len;
838 u8 eapol[0];
839} __packed;
840
841/*
842* WMI_READY_EVENTID
843*/
844enum wmi_phy_capability {
845 WMI_11A_CAPABILITY = 1,
846 WMI_11G_CAPABILITY = 2,
847 WMI_11AG_CAPABILITY = 3,
848 WMI_11NA_CAPABILITY = 4,
849 WMI_11NG_CAPABILITY = 5,
850 WMI_11NAG_CAPABILITY = 6,
851 WMI_11AD_CAPABILITY = 7,
852 WMI_11N_CAPABILITY_OFFSET = WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY,
853};
854
855struct wmi_ready_event {
856 __le32 sw_version;
857 __le32 abi_version;
858 u8 mac[WMI_MAC_LEN];
859 u8 phy_capability; /* enum wmi_phy_capability */
860 u8 reserved;
861} __packed;
862
863/*
864 * WMI_NOTIFY_REQ_DONE_EVENTID
865 */
866struct wmi_notify_req_done_event {
867 __le32 status;
868 __le64 tsf;
869 __le32 snr_val;
870 __le32 tx_tpt;
871 __le32 tx_goodput;
872 __le32 rx_goodput;
873 __le16 bf_mcs;
874 __le16 my_rx_sector;
875 __le16 my_tx_sector;
876 __le16 other_rx_sector;
877 __le16 other_tx_sector;
878 __le16 range;
879} __packed;
880
881/*
882 * WMI_CONNECT_EVENTID
883 */
884struct wmi_connect_event {
885 u8 channel;
886 u8 reserved0;
887 u8 bssid[WMI_MAC_LEN];
888 __le16 listen_interval;
889 __le16 beacon_interval;
890 u8 network_type;
891 u8 reserved1[3];
892 u8 beacon_ie_len;
893 u8 assoc_req_len;
894 u8 assoc_resp_len;
895 u8 cid;
896 u8 reserved2[3];
897 u8 assoc_info[0];
898} __packed;
899
900/*
901 * WMI_DISCONNECT_EVENTID
902 */
903enum wmi_disconnect_reason {
904 WMI_DIS_REASON_NO_NETWORK_AVAIL = 1,
905 WMI_DIS_REASON_LOST_LINK = 2, /* bmiss */
906 WMI_DIS_REASON_DISCONNECT_CMD = 3,
907 WMI_DIS_REASON_BSS_DISCONNECTED = 4,
908 WMI_DIS_REASON_AUTH_FAILED = 5,
909 WMI_DIS_REASON_ASSOC_FAILED = 6,
910 WMI_DIS_REASON_NO_RESOURCES_AVAIL = 7,
911 WMI_DIS_REASON_CSERV_DISCONNECT = 8,
912 WMI_DIS_REASON_INVALID_PROFILE = 10,
913 WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH = 11,
914 WMI_DIS_REASON_PROFILE_MISMATCH = 12,
915 WMI_DIS_REASON_CONNECTION_EVICTED = 13,
916 WMI_DIS_REASON_IBSS_MERGE = 14,
917};
918
919struct wmi_disconnect_event {
920 __le16 protocol_reason_status; /* reason code, see 802.11 spec. */
921 u8 bssid[WMI_MAC_LEN]; /* set if known */
922 u8 disconnect_reason; /* see wmi_disconnect_reason_e */
923 u8 assoc_resp_len;
924 u8 assoc_info[0];
925} __packed;
926
927/*
928 * WMI_SCAN_COMPLETE_EVENTID
929 */
930struct wmi_scan_complete_event {
931 __le32 status;
932} __packed;
933
934/*
935 * WMI_BA_STATUS_EVENTID
936 */
937enum wmi_vring_ba_status {
938 WMI_BA_AGREED = 0,
939 WMI_BA_NON_AGREED = 1,
940};
941
942struct wmi_vring_ba_status_event {
943 __le16 status;
944 u8 reserved[2];
945 u8 ringid;
946 u8 agg_wsize;
947 __le16 ba_timeout;
948} __packed;
949
950/*
951 * WMI_DELBA_EVENTID
952 */
953struct wmi_delba_event {
954
955 #define CIDXTID_CID_POS (0)
956 #define CIDXTID_CID_LEN (4)
957 #define CIDXTID_CID_MSK (0xF)
958 #define CIDXTID_TID_POS (4)
959 #define CIDXTID_TID_LEN (4)
960 #define CIDXTID_TID_MSK (0xF0)
961 u8 cidxtid;
962
963 u8 from_initiator;
964 __le16 reason;
965} __packed;
966
967/*
968 * WMI_VRING_CFG_DONE_EVENTID
969 */
970enum wmi_vring_cfg_done_event_status {
971 WMI_VRING_CFG_SUCCESS = 0,
972 WMI_VRING_CFG_FAILURE = 1,
973};
974
975struct wmi_vring_cfg_done_event {
976 u8 ringid;
977 u8 status;
978 u8 reserved[2];
979 __le32 tx_vring_tail_ptr;
980} __packed;
981
982/*
983 * WMI_ADDBA_RESP_SENT_EVENTID
984 */
985enum wmi_rcp_addba_resp_sent_event_status {
986 WMI_ADDBA_SUCCESS = 0,
987 WMI_ADDBA_FAIL = 1,
988};
989
990struct wmi_rcp_addba_resp_sent_event {
991
992 #define CIDXTID_CID_POS (0)
993 #define CIDXTID_CID_LEN (4)
994 #define CIDXTID_CID_MSK (0xF)
995 #define CIDXTID_TID_POS (4)
996 #define CIDXTID_TID_LEN (4)
997 #define CIDXTID_TID_MSK (0xF0)
998 u8 cidxtid;
999
1000 u8 reserved;
1001 __le16 status;
1002} __packed;
1003
1004/*
1005 * WMI_RCP_ADDBA_REQ_EVENTID
1006 */
1007struct wmi_rcp_addba_req_event {
1008
1009 #define CIDXTID_CID_POS (0)
1010 #define CIDXTID_CID_LEN (4)
1011 #define CIDXTID_CID_MSK (0xF)
1012 #define CIDXTID_TID_POS (4)
1013 #define CIDXTID_TID_LEN (4)
1014 #define CIDXTID_TID_MSK (0xF0)
1015 u8 cidxtid;
1016
1017 u8 dialog_token;
1018 __le16 ba_param_set; /* ieee80211_ba_parameterset as it received */
1019 __le16 ba_timeout;
1020 __le16 ba_seq_ctrl; /* ieee80211_ba_seqstrl field as it received */
1021} __packed;
1022
1023/*
1024 * WMI_CFG_RX_CHAIN_DONE_EVENTID
1025 */
1026enum wmi_cfg_rx_chain_done_event_status {
1027 WMI_CFG_RX_CHAIN_SUCCESS = 1,
1028};
1029
1030struct wmi_cfg_rx_chain_done_event {
1031 __le32 rx_ring_tail_ptr; /* Rx V-Ring Tail pointer */
1032 __le32 status;
1033} __packed;
1034
1035/*
1036 * WMI_WBE_LINKDOWN_EVENTID
1037 */
1038enum wmi_wbe_link_down_event_reason {
1039 WMI_WBE_REASON_USER_REQUEST = 0,
1040 WMI_WBE_REASON_RX_DISASSOC = 1,
1041 WMI_WBE_REASON_BAD_PHY_LINK = 2,
1042};
1043
1044struct wmi_wbe_link_down_event {
1045 u8 cid;
1046 u8 reserved[3];
1047 __le32 reason;
1048} __packed;
1049
1050/*
1051 * WMI_DATA_PORT_OPEN_EVENTID
1052 */
1053struct wmi_data_port_open_event {
1054 u8 cid;
1055 u8 reserved[3];
1056} __packed;
1057
1058/*
1059 * WMI_GET_PCP_CHANNEL_EVENTID
1060 */
1061struct wmi_get_pcp_channel_event {
1062 u8 channel;
1063 u8 reserved[3];
1064} __packed;
1065
1066/*
1067 * WMI_SW_TX_COMPLETE_EVENTID
1068 */
1069enum wmi_sw_tx_status {
1070 WMI_TX_SW_STATUS_SUCCESS = 0,
1071 WMI_TX_SW_STATUS_FAILED_NO_RESOURCES = 1,
1072 WMI_TX_SW_STATUS_FAILED_TX = 2,
1073};
1074
1075struct wmi_sw_tx_complete_event {
1076 u8 status; /* enum wmi_sw_tx_status */
1077 u8 reserved[3];
1078} __packed;
1079
1080/*
1081 * WMI_GET_SSID_EVENTID
1082 */
1083struct wmi_get_ssid_event {
1084 __le32 ssid_len;
1085 u8 ssid[WMI_MAX_SSID_LEN];
1086} __packed;
1087
1088/*
1089 * WMI_RX_MGMT_PACKET_EVENTID
1090 */
1091struct wmi_rx_mgmt_info {
1092 u8 mcs;
1093 s8 snr;
1094 __le16 range;
1095 __le16 stype;
1096 __le16 status;
1097 __le32 len;
1098 u8 qid;
1099 u8 mid;
1100 u8 cid;
1101 u8 channel; /* From Radio MNGR */
1102} __packed;
1103
1104struct wmi_rx_mgmt_packet_event {
1105 struct wmi_rx_mgmt_info info;
1106 u8 payload[0];
1107} __packed;
1108
1109/*
1110 * WMI_ECHO_RSP_EVENTID
1111 */
1112struct wmi_echo_event {
1113 __le32 echoed_value;
1114} __packed;
1115
1116#endif /* __WILOCITY_WMI_H__ */
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index b298e5d68be..10e288d470e 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -7,6 +7,7 @@
7#include <linux/hw_random.h> 7#include <linux/hw_random.h>
8#include <linux/bcma/bcma.h> 8#include <linux/bcma/bcma.h>
9#include <linux/ssb/ssb.h> 9#include <linux/ssb/ssb.h>
10#include <linux/completion.h>
10#include <net/mac80211.h> 11#include <net/mac80211.h>
11 12
12#include "debugfs.h" 13#include "debugfs.h"
@@ -722,6 +723,10 @@ enum b43_firmware_file_type {
722struct b43_request_fw_context { 723struct b43_request_fw_context {
723 /* The device we are requesting the fw for. */ 724 /* The device we are requesting the fw for. */
724 struct b43_wldev *dev; 725 struct b43_wldev *dev;
726 /* a completion event structure needed if this call is asynchronous */
727 struct completion fw_load_complete;
728 /* a pointer to the firmware object */
729 const struct firmware *blob;
725 /* The type of firmware to request. */ 730 /* The type of firmware to request. */
726 enum b43_firmware_file_type req_type; 731 enum b43_firmware_file_type req_type;
727 /* Error messages for each firmware type. */ 732 /* Error messages for each firmware type. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 16ab280359b..806e34c1928 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2088,11 +2088,18 @@ static void b43_print_fw_helptext(struct b43_wl *wl, bool error)
2088 b43warn(wl, text); 2088 b43warn(wl, text);
2089} 2089}
2090 2090
2091static void b43_fw_cb(const struct firmware *firmware, void *context)
2092{
2093 struct b43_request_fw_context *ctx = context;
2094
2095 ctx->blob = firmware;
2096 complete(&ctx->fw_load_complete);
2097}
2098
2091int b43_do_request_fw(struct b43_request_fw_context *ctx, 2099int b43_do_request_fw(struct b43_request_fw_context *ctx,
2092 const char *name, 2100 const char *name,
2093 struct b43_firmware_file *fw) 2101 struct b43_firmware_file *fw, bool async)
2094{ 2102{
2095 const struct firmware *blob;
2096 struct b43_fw_header *hdr; 2103 struct b43_fw_header *hdr;
2097 u32 size; 2104 u32 size;
2098 int err; 2105 int err;
@@ -2131,11 +2138,31 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
2131 B43_WARN_ON(1); 2138 B43_WARN_ON(1);
2132 return -ENOSYS; 2139 return -ENOSYS;
2133 } 2140 }
2134 err = request_firmware(&blob, ctx->fwname, ctx->dev->dev->dev); 2141 if (async) {
2142 /* do this part asynchronously */
2143 init_completion(&ctx->fw_load_complete);
2144 err = request_firmware_nowait(THIS_MODULE, 1, ctx->fwname,
2145 ctx->dev->dev->dev, GFP_KERNEL,
2146 ctx, b43_fw_cb);
2147 if (err < 0) {
2148 pr_err("Unable to load firmware\n");
2149 return err;
2150 }
2151 /* stall here until fw ready */
2152 wait_for_completion(&ctx->fw_load_complete);
2153 if (ctx->blob)
2154 goto fw_ready;
2155 /* On some ARM systems, the async request will fail, but the next sync
2156 * request works. For this reason, we dall through here
2157 */
2158 }
2159 err = request_firmware(&ctx->blob, ctx->fwname,
2160 ctx->dev->dev->dev);
2135 if (err == -ENOENT) { 2161 if (err == -ENOENT) {
2136 snprintf(ctx->errors[ctx->req_type], 2162 snprintf(ctx->errors[ctx->req_type],
2137 sizeof(ctx->errors[ctx->req_type]), 2163 sizeof(ctx->errors[ctx->req_type]),
2138 "Firmware file \"%s\" not found\n", ctx->fwname); 2164 "Firmware file \"%s\" not found\n",
2165 ctx->fwname);
2139 return err; 2166 return err;
2140 } else if (err) { 2167 } else if (err) {
2141 snprintf(ctx->errors[ctx->req_type], 2168 snprintf(ctx->errors[ctx->req_type],
@@ -2144,14 +2171,15 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
2144 ctx->fwname, err); 2171 ctx->fwname, err);
2145 return err; 2172 return err;
2146 } 2173 }
2147 if (blob->size < sizeof(struct b43_fw_header)) 2174fw_ready:
2175 if (ctx->blob->size < sizeof(struct b43_fw_header))
2148 goto err_format; 2176 goto err_format;
2149 hdr = (struct b43_fw_header *)(blob->data); 2177 hdr = (struct b43_fw_header *)(ctx->blob->data);
2150 switch (hdr->type) { 2178 switch (hdr->type) {
2151 case B43_FW_TYPE_UCODE: 2179 case B43_FW_TYPE_UCODE:
2152 case B43_FW_TYPE_PCM: 2180 case B43_FW_TYPE_PCM:
2153 size = be32_to_cpu(hdr->size); 2181 size = be32_to_cpu(hdr->size);
2154 if (size != blob->size - sizeof(struct b43_fw_header)) 2182 if (size != ctx->blob->size - sizeof(struct b43_fw_header))
2155 goto err_format; 2183 goto err_format;
2156 /* fallthrough */ 2184 /* fallthrough */
2157 case B43_FW_TYPE_IV: 2185 case B43_FW_TYPE_IV:
@@ -2162,7 +2190,7 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
2162 goto err_format; 2190 goto err_format;
2163 } 2191 }
2164 2192
2165 fw->data = blob; 2193 fw->data = ctx->blob;
2166 fw->filename = name; 2194 fw->filename = name;
2167 fw->type = ctx->req_type; 2195 fw->type = ctx->req_type;
2168 2196
@@ -2172,7 +2200,7 @@ err_format:
2172 snprintf(ctx->errors[ctx->req_type], 2200 snprintf(ctx->errors[ctx->req_type],
2173 sizeof(ctx->errors[ctx->req_type]), 2201 sizeof(ctx->errors[ctx->req_type]),
2174 "Firmware file \"%s\" format error.\n", ctx->fwname); 2202 "Firmware file \"%s\" format error.\n", ctx->fwname);
2175 release_firmware(blob); 2203 release_firmware(ctx->blob);
2176 2204
2177 return -EPROTO; 2205 return -EPROTO;
2178} 2206}
@@ -2223,7 +2251,7 @@ static int b43_try_request_fw(struct b43_request_fw_context *ctx)
2223 goto err_no_ucode; 2251 goto err_no_ucode;
2224 } 2252 }
2225 } 2253 }
2226 err = b43_do_request_fw(ctx, filename, &fw->ucode); 2254 err = b43_do_request_fw(ctx, filename, &fw->ucode, true);
2227 if (err) 2255 if (err)
2228 goto err_load; 2256 goto err_load;
2229 2257
@@ -2235,7 +2263,7 @@ static int b43_try_request_fw(struct b43_request_fw_context *ctx)
2235 else 2263 else
2236 goto err_no_pcm; 2264 goto err_no_pcm;
2237 fw->pcm_request_failed = false; 2265 fw->pcm_request_failed = false;
2238 err = b43_do_request_fw(ctx, filename, &fw->pcm); 2266 err = b43_do_request_fw(ctx, filename, &fw->pcm, false);
2239 if (err == -ENOENT) { 2267 if (err == -ENOENT) {
2240 /* We did not find a PCM file? Not fatal, but 2268 /* We did not find a PCM file? Not fatal, but
2241 * core rev <= 10 must do without hwcrypto then. */ 2269 * core rev <= 10 must do without hwcrypto then. */
@@ -2296,7 +2324,7 @@ static int b43_try_request_fw(struct b43_request_fw_context *ctx)
2296 default: 2324 default:
2297 goto err_no_initvals; 2325 goto err_no_initvals;
2298 } 2326 }
2299 err = b43_do_request_fw(ctx, filename, &fw->initvals); 2327 err = b43_do_request_fw(ctx, filename, &fw->initvals, false);
2300 if (err) 2328 if (err)
2301 goto err_load; 2329 goto err_load;
2302 2330
@@ -2355,7 +2383,7 @@ static int b43_try_request_fw(struct b43_request_fw_context *ctx)
2355 default: 2383 default:
2356 goto err_no_initvals; 2384 goto err_no_initvals;
2357 } 2385 }
2358 err = b43_do_request_fw(ctx, filename, &fw->initvals_band); 2386 err = b43_do_request_fw(ctx, filename, &fw->initvals_band, false);
2359 if (err) 2387 if (err)
2360 goto err_load; 2388 goto err_load;
2361 2389
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 8c684cd3352..abac25ee958 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -137,9 +137,8 @@ void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on);
137 137
138 138
139struct b43_request_fw_context; 139struct b43_request_fw_context;
140int b43_do_request_fw(struct b43_request_fw_context *ctx, 140int b43_do_request_fw(struct b43_request_fw_context *ctx, const char *name,
141 const char *name, 141 struct b43_firmware_file *fw, bool async);
142 struct b43_firmware_file *fw);
143void b43_do_release_fw(struct b43_firmware_file *fw); 142void b43_do_release_fw(struct b43_firmware_file *fw);
144 143
145#endif /* B43_MAIN_H_ */ 144#endif /* B43_MAIN_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 1261a9b84e0..75464ad4fbd 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3091,10 +3091,11 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie,
3091 3091
3092 len = wpa_ie->len + TLV_HDR_LEN; 3092 len = wpa_ie->len + TLV_HDR_LEN;
3093 data = (u8 *)wpa_ie; 3093 data = (u8 *)wpa_ie;
3094 offset = 0; 3094 offset = TLV_HDR_LEN;
3095 if (!is_rsn_ie) 3095 if (!is_rsn_ie)
3096 offset += VS_IE_FIXED_HDR_LEN; 3096 offset += VS_IE_FIXED_HDR_LEN;
3097 offset += WPA_IE_VERSION_LEN; 3097 else
3098 offset += WPA_IE_VERSION_LEN;
3098 3099
3099 /* check for multicast cipher suite */ 3100 /* check for multicast cipher suite */
3100 if (offset + WPA_IE_MIN_OUI_LEN > len) { 3101 if (offset + WPA_IE_MIN_OUI_LEN > len) {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.h b/drivers/net/wireless/brcm80211/brcmsmac/debug.h
index 796836b0f46..822781cf15d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/debug.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2012 Broadcom Corporation 2 * Copyright (c) 2012 Broadcom Corporation
3 * Copyright (c) 2012 Canonical Ltd.
3 * 4 *
4 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
index 606b534347b..21a82423247 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -1343,13 +1343,13 @@ static bool wlc_lcnphy_rx_iq_cal_gain(struct brcms_phy *pi, u16 biq1_gain,
1343 1343
1344 wlc_lcnphy_rx_gain_override_enable(pi, true); 1344 wlc_lcnphy_rx_gain_override_enable(pi, true);
1345 wlc_lcnphy_start_tx_tone(pi, 2000, (40 >> 1), 0); 1345 wlc_lcnphy_start_tx_tone(pi, 2000, (40 >> 1), 0);
1346 usleep_range(500, 500); 1346 udelay(500);
1347 write_radio_reg(pi, RADIO_2064_REG112, 0); 1347 write_radio_reg(pi, RADIO_2064_REG112, 0);
1348 if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_l)) 1348 if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_l))
1349 return false; 1349 return false;
1350 1350
1351 wlc_lcnphy_start_tx_tone(pi, 2000, 40, 0); 1351 wlc_lcnphy_start_tx_tone(pi, 2000, 40, 0);
1352 usleep_range(500, 500); 1352 udelay(500);
1353 write_radio_reg(pi, RADIO_2064_REG112, 0); 1353 write_radio_reg(pi, RADIO_2064_REG112, 0);
1354 if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_h)) 1354 if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_h))
1355 return false; 1355 return false;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index d604b4036a7..3726cd6fcd7 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3273,7 +3273,7 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
3273 3273
3274 if (count) { 3274 if (count) {
3275 char *p = buffer; 3275 char *p = buffer;
3276 strncpy(buffer, buf, min(sizeof(buffer), count)); 3276 strlcpy(buffer, buf, sizeof(buffer));
3277 channel = simple_strtoul(p, NULL, 0); 3277 channel = simple_strtoul(p, NULL, 0);
3278 if (channel) 3278 if (channel)
3279 params.channel = channel; 3279 params.channel = channel;
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index da21328ca8e..a790599fe2c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -1151,13 +1151,6 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
1151 next_reclaimed = ssn; 1151 next_reclaimed = ssn;
1152 } 1152 }
1153 1153
1154 if (tid != IWL_TID_NON_QOS) {
1155 priv->tid_data[sta_id][tid].next_reclaimed =
1156 next_reclaimed;
1157 IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n",
1158 next_reclaimed);
1159 }
1160
1161 iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); 1154 iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs);
1162 1155
1163 iwlagn_check_ratid_empty(priv, sta_id, tid); 1156 iwlagn_check_ratid_empty(priv, sta_id, tid);
@@ -1208,11 +1201,28 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
1208 if (!is_agg) 1201 if (!is_agg)
1209 iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1); 1202 iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1);
1210 1203
1204 /*
1205 * W/A for FW bug - the seq_ctl isn't updated when the
1206 * queues are flushed. Fetch it from the packet itself
1207 */
1208 if (!is_agg && status == TX_STATUS_FAIL_FIFO_FLUSHED) {
1209 next_reclaimed = le16_to_cpu(hdr->seq_ctrl);
1210 next_reclaimed =
1211 SEQ_TO_SN(next_reclaimed + 0x10);
1212 }
1213
1211 is_offchannel_skb = 1214 is_offchannel_skb =
1212 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN); 1215 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN);
1213 freed++; 1216 freed++;
1214 } 1217 }
1215 1218
1219 if (tid != IWL_TID_NON_QOS) {
1220 priv->tid_data[sta_id][tid].next_reclaimed =
1221 next_reclaimed;
1222 IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n",
1223 next_reclaimed);
1224 }
1225
1216 WARN_ON(!is_agg && freed != 1); 1226 WARN_ON(!is_agg && freed != 1);
1217 1227
1218 /* 1228 /*
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index dad4c4aad91..8389cd38338 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -1166,6 +1166,7 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data)
1166 else if (test_bit(STATUS_INT_ENABLED, &trans_pcie->status) && 1166 else if (test_bit(STATUS_INT_ENABLED, &trans_pcie->status) &&
1167 !trans_pcie->inta) 1167 !trans_pcie->inta)
1168 iwl_enable_interrupts(trans); 1168 iwl_enable_interrupts(trans);
1169 return IRQ_HANDLED;
1169 1170
1170none: 1171none:
1171 /* re-enable interrupts here since we don't have anything to service. */ 1172 /* re-enable interrupts here since we don't have anything to service. */
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index a875499f894..efe525be27d 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1709,7 +1709,7 @@ static int mwifiex_set_ibss_params(struct mwifiex_private *priv,
1709 NL80211_CHAN_NO_HT) 1709 NL80211_CHAN_NO_HT)
1710 config_bands |= BAND_GN; 1710 config_bands |= BAND_GN;
1711 } else { 1711 } else {
1712 if (cfg80211_get_chandef_type(&params->chandef) != 1712 if (cfg80211_get_chandef_type(&params->chandef) ==
1713 NL80211_CHAN_NO_HT) 1713 NL80211_CHAN_NO_HT)
1714 config_bands = BAND_A; 1714 config_bands = BAND_A;
1715 else 1715 else
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index cb682561c43..60e88b58039 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -56,7 +56,6 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
56 */ 56 */
57int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) 57int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
58{ 58{
59 bool cancel_flag = false;
60 int status; 59 int status;
61 struct cmd_ctrl_node *cmd_queued; 60 struct cmd_ctrl_node *cmd_queued;
62 61
@@ -70,14 +69,11 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
70 atomic_inc(&adapter->cmd_pending); 69 atomic_inc(&adapter->cmd_pending);
71 70
72 /* Wait for completion */ 71 /* Wait for completion */
73 wait_event_interruptible(adapter->cmd_wait_q.wait, 72 status = wait_event_interruptible(adapter->cmd_wait_q.wait,
74 *(cmd_queued->condition)); 73 *(cmd_queued->condition));
75 if (!*(cmd_queued->condition)) 74 if (status) {
76 cancel_flag = true; 75 dev_err(adapter->dev, "cmd_wait_q terminated: %d\n", status);
77 76 return status;
78 if (cancel_flag) {
79 mwifiex_cancel_pending_ioctl(adapter);
80 dev_dbg(adapter->dev, "cmd cancel\n");
81 } 77 }
82 78
83 status = adapter->cmd_wait_q.status; 79 status = adapter->cmd_wait_q.status;
@@ -496,8 +492,11 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
496 return false; 492 return false;
497 } 493 }
498 494
499 wait_event_interruptible(adapter->hs_activate_wait_q, 495 if (wait_event_interruptible(adapter->hs_activate_wait_q,
500 adapter->hs_activate_wait_q_woken); 496 adapter->hs_activate_wait_q_woken)) {
497 dev_err(adapter->dev, "hs_activate_wait_q terminated\n");
498 return false;
499 }
501 500
502 return true; 501 return true;
503} 502}
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index f221b95b90b..83564d36e80 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -4250,9 +4250,11 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
4250 p->amsdu_enabled = 0; 4250 p->amsdu_enabled = 0;
4251 4251
4252 rc = mwl8k_post_cmd(hw, &cmd->header); 4252 rc = mwl8k_post_cmd(hw, &cmd->header);
4253 if (!rc)
4254 rc = p->station_id;
4253 kfree(cmd); 4255 kfree(cmd);
4254 4256
4255 return rc ? rc : p->station_id; 4257 return rc;
4256} 4258}
4257 4259
4258static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw, 4260static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index e71c702e2eb..800a16526c8 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -47,6 +47,7 @@ static struct usb_device_id p54u_table[] = {
47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ 47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ 48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
49 {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ 49 {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
50 {USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */
50 {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ 51 {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
51 {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ 52 {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
52 {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */ 53 {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */
@@ -82,6 +83,8 @@ static struct usb_device_id p54u_table[] = {
82 {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ 83 {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
83 {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ 84 {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
84 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ 85 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
86 {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
87 {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
85 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ 88 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
86 {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ 89 {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
87 {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */ 90 {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
@@ -101,6 +104,7 @@ static struct usb_device_id p54u_table[] = {
101 {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ 104 {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
102 {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ 105 {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
103 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ 106 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
107 /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */
104 {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ 108 {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
105 {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ 109 {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */
106 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ 110 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 3deacafdcd5..4261e8ecc4c 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -743,6 +743,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
743 743
744done: 744done:
745 bufferaddress = (*((dma_addr_t *)skb->cb)); 745 bufferaddress = (*((dma_addr_t *)skb->cb));
746 if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress))
747 return;
746 tmp_one = 1; 748 tmp_one = 1;
747 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, 749 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
748 HW_DESC_RXBUFF_ADDR, 750 HW_DESC_RXBUFF_ADDR,
@@ -1115,6 +1117,10 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
1115 PCI_DMA_FROMDEVICE); 1117 PCI_DMA_FROMDEVICE);
1116 1118
1117 bufferaddress = (*((dma_addr_t *)skb->cb)); 1119 bufferaddress = (*((dma_addr_t *)skb->cb));
1120 if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) {
1121 dev_kfree_skb_any(skb);
1122 return 1;
1123 }
1118 rtlpriv->cfg->ops->set_desc((u8 *)entry, false, 1124 rtlpriv->cfg->ops->set_desc((u8 *)entry, false,
1119 HW_DESC_RXBUFF_ADDR, 1125 HW_DESC_RXBUFF_ADDR,
1120 (u8 *)&bufferaddress); 1126 (u8 *)&bufferaddress);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
index 1d5d3604e3e..246e5352f2e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
@@ -692,7 +692,7 @@ u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw)
692 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { 692 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) {
693 rtl92c_phy_sw_chnl_callback(hw); 693 rtl92c_phy_sw_chnl_callback(hw);
694 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 694 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
695 "sw_chnl_inprogress false schdule workitem\n"); 695 "sw_chnl_inprogress false schedule workitem\n");
696 rtlphy->sw_chnl_inprogress = false; 696 rtlphy->sw_chnl_inprogress = false;
697 } else { 697 } else {
698 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 698 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 17342475614..c31795e379f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -611,8 +611,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
611 dma_addr_t mapping = pci_map_single(rtlpci->pdev, 611 dma_addr_t mapping = pci_map_single(rtlpci->pdev,
612 skb->data, skb->len, 612 skb->data, skb->len,
613 PCI_DMA_TODEVICE); 613 PCI_DMA_TODEVICE);
614
614 u8 bw_40 = 0; 615 u8 bw_40 = 0;
615 616
617 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
618 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
619 "DMA mapping error");
620 return;
621 }
616 rcu_read_lock(); 622 rcu_read_lock();
617 sta = get_sta(hw, mac->vif, mac->bssid); 623 sta = get_sta(hw, mac->vif, mac->bssid);
618 if (mac->opmode == NL80211_IFTYPE_STATION) { 624 if (mac->opmode == NL80211_IFTYPE_STATION) {
@@ -774,6 +780,11 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
774 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); 780 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
775 __le16 fc = hdr->frame_control; 781 __le16 fc = hdr->frame_control;
776 782
783 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
784 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
785 "DMA mapping error");
786 return;
787 }
777 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); 788 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
778 789
779 if (firstseg) 790 if (firstseg)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index f9f3861046c..a0fbf284420 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -587,6 +587,11 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
587 buf_len = skb->len; 587 buf_len = skb->len;
588 mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len, 588 mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
589 PCI_DMA_TODEVICE); 589 PCI_DMA_TODEVICE);
590 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
591 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
592 "DMA mapping error");
593 return;
594 }
590 CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92d)); 595 CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92d));
591 if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) { 596 if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) {
592 firstseg = true; 597 firstseg = true;
@@ -740,6 +745,11 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
740 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); 745 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
741 __le16 fc = hdr->frame_control; 746 __le16 fc = hdr->frame_control;
742 747
748 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
749 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
750 "DMA mapping error");
751 return;
752 }
743 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); 753 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
744 if (firstseg) 754 if (firstseg)
745 SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); 755 SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index 0e9f6ebf078..206561d7282 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -611,6 +611,11 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
611 PCI_DMA_TODEVICE); 611 PCI_DMA_TODEVICE);
612 u8 bw_40 = 0; 612 u8 bw_40 = 0;
613 613
614 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
615 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
616 "DMA mapping error");
617 return;
618 }
614 if (mac->opmode == NL80211_IFTYPE_STATION) { 619 if (mac->opmode == NL80211_IFTYPE_STATION) {
615 bw_40 = mac->bw_40; 620 bw_40 = mac->bw_40;
616 } else if (mac->opmode == NL80211_IFTYPE_AP || 621 } else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -763,6 +768,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
763void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, 768void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
764 bool firstseg, bool lastseg, struct sk_buff *skb) 769 bool firstseg, bool lastseg, struct sk_buff *skb)
765{ 770{
771 struct rtl_priv *rtlpriv = rtl_priv(hw);
766 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 772 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
767 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 773 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
768 struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb); 774 struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
@@ -770,7 +776,12 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
770 dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len, 776 dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
771 PCI_DMA_TODEVICE); 777 PCI_DMA_TODEVICE);
772 778
773 /* Clear all status */ 779 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
780 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
781 "DMA mapping error");
782 return;
783 }
784 /* Clear all status */
774 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_CMDDESC_SIZE_RTL8192S); 785 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_CMDDESC_SIZE_RTL8192S);
775 786
776 /* This bit indicate this packet is used for FW download. */ 787 /* This bit indicate this packet is used for FW download. */
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/rtlwifi/rtl8723ae/phy.c
index 39cc7938eed..3d8536bb0d2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/phy.c
@@ -1106,7 +1106,7 @@ u8 rtl8723ae_phy_sw_chnl(struct ieee80211_hw *hw)
1106 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { 1106 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) {
1107 rtl8723ae_phy_sw_chnl_callback(hw); 1107 rtl8723ae_phy_sw_chnl_callback(hw);
1108 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 1108 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
1109 "sw_chnl_inprogress false schdule workitem\n"); 1109 "sw_chnl_inprogress false schedule workitem\n");
1110 rtlphy->sw_chnl_inprogress = false; 1110 rtlphy->sw_chnl_inprogress = false;
1111 } else { 1111 } else {
1112 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 1112 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
index 87331d826d7..a313be8c21d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
@@ -387,6 +387,11 @@ void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw,
387 PCI_DMA_TODEVICE); 387 PCI_DMA_TODEVICE);
388 u8 bw_40 = 0; 388 u8 bw_40 = 0;
389 389
390 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
391 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
392 "DMA mapping error");
393 return;
394 }
390 if (mac->opmode == NL80211_IFTYPE_STATION) { 395 if (mac->opmode == NL80211_IFTYPE_STATION) {
391 bw_40 = mac->bw_40; 396 bw_40 = mac->bw_40;
392 } else if (mac->opmode == NL80211_IFTYPE_AP || 397 } else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -542,6 +547,11 @@ void rtl8723ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
542 PCI_DMA_TODEVICE); 547 PCI_DMA_TODEVICE);
543 __le16 fc = hdr->frame_control; 548 __le16 fc = hdr->frame_control;
544 549
550 if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
551 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
552 "DMA mapping error");
553 return;
554 }
545 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); 555 CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
546 556
547 if (firstseg) 557 if (firstseg)
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 29f0969e4ba..f2ecdeb3a90 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -210,17 +210,16 @@ static void _usb_writeN_sync(struct rtl_priv *rtlpriv, u32 addr, void *data,
210 u16 index = REALTEK_USB_VENQT_CMD_IDX; 210 u16 index = REALTEK_USB_VENQT_CMD_IDX;
211 int pipe = usb_sndctrlpipe(udev, 0); /* write_out */ 211 int pipe = usb_sndctrlpipe(udev, 0); /* write_out */
212 u8 *buffer; 212 u8 *buffer;
213 dma_addr_t dma_addr;
214 213
215 wvalue = (u16)(addr&0x0000ffff); 214 wvalue = (u16)(addr & 0x0000ffff);
216 buffer = usb_alloc_coherent(udev, (size_t)len, GFP_ATOMIC, &dma_addr); 215 buffer = kmalloc(len, GFP_ATOMIC);
217 if (!buffer) 216 if (!buffer)
218 return; 217 return;
219 memcpy(buffer, data, len); 218 memcpy(buffer, data, len);
220 usb_control_msg(udev, pipe, request, reqtype, wvalue, 219 usb_control_msg(udev, pipe, request, reqtype, wvalue,
221 index, buffer, len, 50); 220 index, buffer, len, 50);
222 221
223 usb_free_coherent(udev, (size_t)len, buffer, dma_addr); 222 kfree(buffer);
224} 223}
225 224
226static void _rtl_usb_io_handler_init(struct device *dev, 225static void _rtl_usb_io_handler_init(struct device *dev,
@@ -640,6 +639,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
640 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 639 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
641 "Failed to prep_rx_urb!!\n"); 640 "Failed to prep_rx_urb!!\n");
642 err = PTR_ERR(skb); 641 err = PTR_ERR(skb);
642 usb_free_urb(urb);
643 goto err_out; 643 goto err_out;
644 } 644 }
645 645
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index c26e28b4bd9..7ffa43bd7cf 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1015,29 +1015,10 @@ err:
1015 i = xennet_fill_frags(np, skb, &tmpq); 1015 i = xennet_fill_frags(np, skb, &tmpq);
1016 1016
1017 /* 1017 /*
1018 * Truesize approximates the size of true data plus 1018 * Truesize is the actual allocation size, even if the
1019 * any supervisor overheads. Adding hypervisor 1019 * allocation is only partially used.
1020 * overheads has been shown to significantly reduce 1020 */
1021 * achievable bandwidth with the default receive 1021 skb->truesize += PAGE_SIZE * skb_shinfo(skb)->nr_frags;
1022 * buffer size. It is therefore not wise to account
1023 * for it here.
1024 *
1025 * After alloc_skb(RX_COPY_THRESHOLD), truesize is set
1026 * to RX_COPY_THRESHOLD + the supervisor
1027 * overheads. Here, we add the size of the data pulled
1028 * in xennet_fill_frags().
1029 *
1030 * We also adjust for any unused space in the main
1031 * data area by subtracting (RX_COPY_THRESHOLD -
1032 * len). This is especially important with drivers
1033 * which split incoming packets into header and data,
1034 * using only 66 bytes of the main data area (see the
1035 * e1000 driver for example.) On such systems,
1036 * without this last adjustement, our achievable
1037 * receive throughout using the standard receive
1038 * buffer size was cut by 25%(!!!).
1039 */
1040 skb->truesize += skb->data_len - RX_COPY_THRESHOLD;
1041 skb->len += skb->data_len; 1022 skb->len += skb->data_len;
1042 1023
1043 if (rx->flags & XEN_NETRXF_csum_blank) 1024 if (rx->flags & XEN_NETRXF_csum_blank)
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 7da9071b68b..2a9c8d93d2e 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -361,8 +361,8 @@ static struct nfc_phy_ops i2c_phy_ops = {
361 .disable = pn544_hci_i2c_disable, 361 .disable = pn544_hci_i2c_disable,
362}; 362};
363 363
364static int __devinit pn544_hci_i2c_probe(struct i2c_client *client, 364static int pn544_hci_i2c_probe(struct i2c_client *client,
365 const struct i2c_device_id *id) 365 const struct i2c_device_id *id)
366{ 366{
367 struct pn544_i2c_phy *phy; 367 struct pn544_i2c_phy *phy;
368 struct pn544_nfc_platform_data *pdata; 368 struct pn544_nfc_platform_data *pdata;
@@ -442,7 +442,7 @@ err_phy_alloc:
442 return r; 442 return r;
443} 443}
444 444
445static __devexit int pn544_hci_i2c_remove(struct i2c_client *client) 445static int pn544_hci_i2c_remove(struct i2c_client *client)
446{ 446{
447 struct pn544_i2c_phy *phy = i2c_get_clientdata(client); 447 struct pn544_i2c_phy *phy = i2c_get_clientdata(client);
448 struct pn544_nfc_platform_data *pdata = client->dev.platform_data; 448 struct pn544_nfc_platform_data *pdata = client->dev.platform_data;
@@ -469,7 +469,7 @@ static struct i2c_driver pn544_hci_i2c_driver = {
469 }, 469 },
470 .probe = pn544_hci_i2c_probe, 470 .probe = pn544_hci_i2c_probe,
471 .id_table = pn544_hci_i2c_id_table, 471 .id_table = pn544_hci_i2c_id_table,
472 .remove = __devexit_p(pn544_hci_i2c_remove), 472 .remove = pn544_hci_i2c_remove,
473}; 473};
474 474
475static int __init pn544_hci_i2c_init(void) 475static int __init pn544_hci_i2c_init(void)
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index fb6a1fe21b9..8e4e86b7842 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -430,7 +430,7 @@ static void dino_choose_irq(struct parisc_device *dev, void *ctrl)
430 * Cirrus 6832 Cardbus reports wrong irq on RDI Tadpole PARISC Laptop (deller@gmx.de) 430 * Cirrus 6832 Cardbus reports wrong irq on RDI Tadpole PARISC Laptop (deller@gmx.de)
431 * (the irqs are off-by-one, not sure yet if this is a cirrus, dino-hardware or dino-driver problem...) 431 * (the irqs are off-by-one, not sure yet if this is a cirrus, dino-hardware or dino-driver problem...)
432 */ 432 */
433static void __devinit quirk_cirrus_cardbus(struct pci_dev *dev) 433static void quirk_cirrus_cardbus(struct pci_dev *dev)
434{ 434{
435 u8 new_irq = dev->irq - 1; 435 u8 new_irq = dev->irq - 1;
436 printk(KERN_INFO "PCI: Cirrus Cardbus IRQ fixup for %s, from %d to %d\n", 436 printk(KERN_INFO "PCI: Cirrus Cardbus IRQ fixup for %s, from %d to %d\n",
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index fdd63a6a62d..2ef7103270b 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -34,7 +34,7 @@
34#include <linux/types.h> 34#include <linux/types.h>
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37#include <linux/init.h> /* for __init and __devinit */ 37#include <linux/init.h> /* for __init */
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/ioport.h> 39#include <linux/ioport.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index 352f96180bc..050773c3682 100644
--- a/drivers/parport/parport_gsc.c
+++ b/drivers/parport/parport_gsc.c
@@ -137,7 +137,7 @@ struct parport_operations parport_gsc_ops =
137/* 137/*
138 * Checks for port existence, all ports support SPP MODE 138 * Checks for port existence, all ports support SPP MODE
139 */ 139 */
140static int __devinit parport_SPP_supported(struct parport *pb) 140static int parport_SPP_supported(struct parport *pb)
141{ 141{
142 unsigned char r, w; 142 unsigned char r, w;
143 143
@@ -201,7 +201,7 @@ static int __devinit parport_SPP_supported(struct parport *pb)
201 * be misdetected here is rather academic. 201 * be misdetected here is rather academic.
202 */ 202 */
203 203
204static int __devinit parport_PS2_supported(struct parport *pb) 204static int parport_PS2_supported(struct parport *pb)
205{ 205{
206 int ok = 0; 206 int ok = 0;
207 207
@@ -232,10 +232,9 @@ static int __devinit parport_PS2_supported(struct parport *pb)
232 232
233/* --- Initialisation code -------------------------------- */ 233/* --- Initialisation code -------------------------------- */
234 234
235struct parport *__devinit parport_gsc_probe_port (unsigned long base, 235struct parport *parport_gsc_probe_port(unsigned long base,
236 unsigned long base_hi, 236 unsigned long base_hi, int irq,
237 int irq, int dma, 237 int dma, struct pci_dev *dev)
238 struct pci_dev *dev)
239{ 238{
240 struct parport_gsc_private *priv; 239 struct parport_gsc_private *priv;
241 struct parport_operations *ops; 240 struct parport_operations *ops;
@@ -345,9 +344,9 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
345 344
346#define PARPORT_GSC_OFFSET 0x800 345#define PARPORT_GSC_OFFSET 0x800
347 346
348static int __devinitdata parport_count; 347static int parport_count;
349 348
350static int __devinit parport_init_chip(struct parisc_device *dev) 349static int parport_init_chip(struct parisc_device *dev)
351{ 350{
352 struct parport *p; 351 struct parport *p;
353 unsigned long port; 352 unsigned long port;
@@ -382,7 +381,7 @@ static int __devinit parport_init_chip(struct parisc_device *dev)
382 return 0; 381 return 0;
383} 382}
384 383
385static int __devexit parport_remove_chip(struct parisc_device *dev) 384static int parport_remove_chip(struct parisc_device *dev)
386{ 385{
387 struct parport *p = dev_get_drvdata(&dev->dev); 386 struct parport *p = dev_get_drvdata(&dev->dev);
388 if (p) { 387 if (p) {
@@ -415,15 +414,15 @@ static struct parisc_driver parport_driver = {
415 .name = "Parallel", 414 .name = "Parallel",
416 .id_table = parport_tbl, 415 .id_table = parport_tbl,
417 .probe = parport_init_chip, 416 .probe = parport_init_chip,
418 .remove = __devexit_p(parport_remove_chip), 417 .remove = parport_remove_chip,
419}; 418};
420 419
421int __devinit parport_gsc_init(void) 420int parport_gsc_init(void)
422{ 421{
423 return register_parisc_driver(&parport_driver); 422 return register_parisc_driver(&parport_driver);
424} 423}
425 424
426static void __devexit parport_gsc_exit(void) 425static void parport_gsc_exit(void)
427{ 426{
428 unregister_parisc_driver(&parport_driver); 427 unregister_parisc_driver(&parport_driver);
429} 428}
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 5abffe58a9d..903e1285fda 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -953,7 +953,7 @@ static struct superio_struct *find_free_superio(void)
953 953
954 954
955/* Super-IO chipset detection, Winbond, SMSC */ 955/* Super-IO chipset detection, Winbond, SMSC */
956static void __devinit show_parconfig_smsc37c669(int io, int key) 956static void show_parconfig_smsc37c669(int io, int key)
957{ 957{
958 int cr1, cr4, cra, cr23, cr26, cr27; 958 int cr1, cr4, cra, cr23, cr26, cr27;
959 struct superio_struct *s; 959 struct superio_struct *s;
@@ -1038,7 +1038,7 @@ static void __devinit show_parconfig_smsc37c669(int io, int key)
1038} 1038}
1039 1039
1040 1040
1041static void __devinit show_parconfig_winbond(int io, int key) 1041static void show_parconfig_winbond(int io, int key)
1042{ 1042{
1043 int cr30, cr60, cr61, cr70, cr74, crf0; 1043 int cr30, cr60, cr61, cr70, cr74, crf0;
1044 struct superio_struct *s; 1044 struct superio_struct *s;
@@ -1106,8 +1106,7 @@ static void __devinit show_parconfig_winbond(int io, int key)
1106 } 1106 }
1107} 1107}
1108 1108
1109static void __devinit decode_winbond(int efer, int key, int devid, 1109static void decode_winbond(int efer, int key, int devid, int devrev, int oldid)
1110 int devrev, int oldid)
1111{ 1110{
1112 const char *type = "unknown"; 1111 const char *type = "unknown";
1113 int id, progif = 2; 1112 int id, progif = 2;
@@ -1159,7 +1158,7 @@ static void __devinit decode_winbond(int efer, int key, int devid,
1159 show_parconfig_winbond(efer, key); 1158 show_parconfig_winbond(efer, key);
1160} 1159}
1161 1160
1162static void __devinit decode_smsc(int efer, int key, int devid, int devrev) 1161static void decode_smsc(int efer, int key, int devid, int devrev)
1163{ 1162{
1164 const char *type = "unknown"; 1163 const char *type = "unknown";
1165 void (*func)(int io, int key); 1164 void (*func)(int io, int key);
@@ -1193,7 +1192,7 @@ static void __devinit decode_smsc(int efer, int key, int devid, int devrev)
1193} 1192}
1194 1193
1195 1194
1196static void __devinit winbond_check(int io, int key) 1195static void winbond_check(int io, int key)
1197{ 1196{
1198 int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid; 1197 int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid;
1199 1198
@@ -1231,7 +1230,7 @@ out:
1231 release_region(io, 3); 1230 release_region(io, 3);
1232} 1231}
1233 1232
1234static void __devinit winbond_check2(int io, int key) 1233static void winbond_check2(int io, int key)
1235{ 1234{
1236 int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid; 1235 int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid;
1237 1236
@@ -1272,7 +1271,7 @@ out:
1272 release_region(io, 3); 1271 release_region(io, 3);
1273} 1272}
1274 1273
1275static void __devinit smsc_check(int io, int key) 1274static void smsc_check(int io, int key)
1276{ 1275{
1277 int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev; 1276 int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev;
1278 1277
@@ -1316,7 +1315,7 @@ out:
1316} 1315}
1317 1316
1318 1317
1319static void __devinit detect_and_report_winbond(void) 1318static void detect_and_report_winbond(void)
1320{ 1319{
1321 if (verbose_probing) 1320 if (verbose_probing)
1322 printk(KERN_DEBUG "Winbond Super-IO detection, now testing ports 3F0,370,250,4E,2E ...\n"); 1321 printk(KERN_DEBUG "Winbond Super-IO detection, now testing ports 3F0,370,250,4E,2E ...\n");
@@ -1329,7 +1328,7 @@ static void __devinit detect_and_report_winbond(void)
1329 winbond_check2(0x250, 0x89); 1328 winbond_check2(0x250, 0x89);
1330} 1329}
1331 1330
1332static void __devinit detect_and_report_smsc(void) 1331static void detect_and_report_smsc(void)
1333{ 1332{
1334 if (verbose_probing) 1333 if (verbose_probing)
1335 printk(KERN_DEBUG "SMSC Super-IO detection, now testing Ports 2F0, 370 ...\n"); 1334 printk(KERN_DEBUG "SMSC Super-IO detection, now testing Ports 2F0, 370 ...\n");
@@ -1339,7 +1338,7 @@ static void __devinit detect_and_report_smsc(void)
1339 smsc_check(0x370, 0x44); 1338 smsc_check(0x370, 0x44);
1340} 1339}
1341 1340
1342static void __devinit detect_and_report_it87(void) 1341static void detect_and_report_it87(void)
1343{ 1342{
1344 u16 dev; 1343 u16 dev;
1345 u8 origval, r; 1344 u8 origval, r;
@@ -1796,24 +1795,24 @@ static int parport_ECPEPP_supported(struct parport *pb)
1796#else /* No IEEE 1284 support */ 1795#else /* No IEEE 1284 support */
1797 1796
1798/* Don't bother probing for modes we know we won't use. */ 1797/* Don't bother probing for modes we know we won't use. */
1799static int __devinit parport_PS2_supported(struct parport *pb) { return 0; } 1798static int parport_PS2_supported(struct parport *pb) { return 0; }
1800#ifdef CONFIG_PARPORT_PC_FIFO 1799#ifdef CONFIG_PARPORT_PC_FIFO
1801static int parport_ECP_supported(struct parport *pb) 1800static int parport_ECP_supported(struct parport *pb)
1802{ 1801{
1803 return 0; 1802 return 0;
1804} 1803}
1805#endif 1804#endif
1806static int __devinit parport_EPP_supported(struct parport *pb) 1805static int parport_EPP_supported(struct parport *pb)
1807{ 1806{
1808 return 0; 1807 return 0;
1809} 1808}
1810 1809
1811static int __devinit parport_ECPEPP_supported(struct parport *pb) 1810static int parport_ECPEPP_supported(struct parport *pb)
1812{ 1811{
1813 return 0; 1812 return 0;
1814} 1813}
1815 1814
1816static int __devinit parport_ECPPS2_supported(struct parport *pb) 1815static int parport_ECPPS2_supported(struct parport *pb)
1817{ 1816{
1818 return 0; 1817 return 0;
1819} 1818}
@@ -2269,9 +2268,8 @@ EXPORT_SYMBOL(parport_pc_unregister_port);
2269#ifdef CONFIG_PCI 2268#ifdef CONFIG_PCI
2270 2269
2271/* ITE support maintained by Rich Liu <richliu@poorman.org> */ 2270/* ITE support maintained by Rich Liu <richliu@poorman.org> */
2272static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, 2271static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma,
2273 int autodma, 2272 const struct parport_pc_via_data *via)
2274 const struct parport_pc_via_data *via)
2275{ 2273{
2276 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 }; 2274 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 };
2277 u32 ite8872set; 2275 u32 ite8872set;
@@ -2377,10 +2375,10 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2377 2375
2378/* VIA 8231 support by Pavel Fedin <sonic_amiga@rambler.ru> 2376/* VIA 8231 support by Pavel Fedin <sonic_amiga@rambler.ru>
2379 based on VIA 686a support code by Jeff Garzik <jgarzik@pobox.com> */ 2377 based on VIA 686a support code by Jeff Garzik <jgarzik@pobox.com> */
2380static int __devinitdata parport_init_mode; 2378static int parport_init_mode;
2381 2379
2382/* Data for two known VIA chips */ 2380/* Data for two known VIA chips */
2383static struct parport_pc_via_data via_686a_data __devinitdata = { 2381static struct parport_pc_via_data via_686a_data = {
2384 0x51, 2382 0x51,
2385 0x50, 2383 0x50,
2386 0x85, 2384 0x85,
@@ -2389,7 +2387,7 @@ static struct parport_pc_via_data via_686a_data __devinitdata = {
2389 0xF0, 2387 0xF0,
2390 0xE6 2388 0xE6
2391}; 2389};
2392static struct parport_pc_via_data via_8231_data __devinitdata = { 2390static struct parport_pc_via_data via_8231_data = {
2393 0x45, 2391 0x45,
2394 0x44, 2392 0x44,
2395 0x50, 2393 0x50,
@@ -2399,9 +2397,8 @@ static struct parport_pc_via_data via_8231_data __devinitdata = {
2399 0xF6 2397 0xF6
2400}; 2398};
2401 2399
2402static int __devinit sio_via_probe(struct pci_dev *pdev, int autoirq, 2400static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma,
2403 int autodma, 2401 const struct parport_pc_via_data *via)
2404 const struct parport_pc_via_data *via)
2405{ 2402{
2406 u8 tmp, tmp2, siofunc; 2403 u8 tmp, tmp2, siofunc;
2407 u8 ppcontrol = 0; 2404 u8 ppcontrol = 0;
@@ -2575,7 +2572,7 @@ static struct parport_pc_superio {
2575 int (*probe) (struct pci_dev *pdev, int autoirq, int autodma, 2572 int (*probe) (struct pci_dev *pdev, int autoirq, int autodma,
2576 const struct parport_pc_via_data *via); 2573 const struct parport_pc_via_data *via);
2577 const struct parport_pc_via_data *via; 2574 const struct parport_pc_via_data *via;
2578} parport_pc_superio_info[] __devinitdata = { 2575} parport_pc_superio_info[] = {
2579 { sio_via_probe, &via_686a_data, }, 2576 { sio_via_probe, &via_686a_data, },
2580 { sio_via_probe, &via_8231_data, }, 2577 { sio_via_probe, &via_8231_data, },
2581 { sio_ite_8872_probe, NULL, }, 2578 { sio_ite_8872_probe, NULL, },
@@ -2860,7 +2857,7 @@ static int parport_pc_pci_probe(struct pci_dev *dev,
2860 return -ENODEV; 2857 return -ENODEV;
2861} 2858}
2862 2859
2863static void __devexit parport_pc_pci_remove(struct pci_dev *dev) 2860static void parport_pc_pci_remove(struct pci_dev *dev)
2864{ 2861{
2865 struct pci_parport_data *data = pci_get_drvdata(dev); 2862 struct pci_parport_data *data = pci_get_drvdata(dev);
2866 int i; 2863 int i;
@@ -2879,7 +2876,7 @@ static struct pci_driver parport_pc_pci_driver = {
2879 .name = "parport_pc", 2876 .name = "parport_pc",
2880 .id_table = parport_pc_pci_tbl, 2877 .id_table = parport_pc_pci_tbl,
2881 .probe = parport_pc_pci_probe, 2878 .probe = parport_pc_pci_probe,
2882 .remove = __devexit_p(parport_pc_pci_remove), 2879 .remove = parport_pc_pci_remove,
2883}; 2880};
2884 2881
2885static int __init parport_pc_init_superio(int autoirq, int autodma) 2882static int __init parport_pc_init_superio(int autoirq, int autodma)
@@ -2983,7 +2980,7 @@ static struct pnp_driver parport_pc_pnp_driver = {
2983static struct pnp_driver parport_pc_pnp_driver; 2980static struct pnp_driver parport_pc_pnp_driver;
2984#endif /* CONFIG_PNP */ 2981#endif /* CONFIG_PNP */
2985 2982
2986static int __devinit parport_pc_platform_probe(struct platform_device *pdev) 2983static int parport_pc_platform_probe(struct platform_device *pdev)
2987{ 2984{
2988 /* Always succeed, the actual probing is done in 2985 /* Always succeed, the actual probing is done in
2989 * parport_pc_probe_port(). */ 2986 * parport_pc_probe_port(). */
@@ -2999,7 +2996,7 @@ static struct platform_driver parport_pc_platform_driver = {
2999}; 2996};
3000 2997
3001/* This is called by parport_pc_find_nonpci_ports (in asm/parport.h) */ 2998/* This is called by parport_pc_find_nonpci_ports (in asm/parport.h) */
3002static int __devinit __attribute__((unused)) 2999static int __attribute__((unused))
3003parport_pc_find_isa_ports(int autoirq, int autodma) 3000parport_pc_find_isa_ports(int autoirq, int autodma)
3004{ 3001{
3005 int count = 0; 3002 int count = 0;
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 1631eeaf440..ef6169adb84 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -87,7 +87,8 @@ struct parport_pc_pci {
87 struct parport_pc_pci *card, int failed); 87 struct parport_pc_pci *card, int failed);
88}; 88};
89 89
90static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma) 90static int netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par,
91 int autoirq, int autodma)
91{ 92{
92 /* the rule described below doesn't hold for this device */ 93 /* the rule described below doesn't hold for this device */
93 if (dev->device == PCI_DEVICE_ID_NETMOS_9835 && 94 if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
@@ -111,7 +112,7 @@ static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc
111 return 0; 112 return 0;
112} 113}
113 114
114static struct parport_pc_pci cards[] __devinitdata = { 115static struct parport_pc_pci cards[] = {
115 /* titan_110l */ { 1, { { 3, -1 }, } }, 116 /* titan_110l */ { 1, { { 3, -1 }, } },
116 /* titan_210l */ { 1, { { 3, -1 }, } }, 117 /* titan_210l */ { 1, { { 3, -1 }, } },
117 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init }, 118 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init },
@@ -258,7 +259,7 @@ MODULE_DEVICE_TABLE(pci,parport_serial_pci_tbl);
258 * Cards not tested are marked n/t 259 * Cards not tested are marked n/t
259 * If you have one of these cards and it works for you, please tell me.. 260 * If you have one of these cards and it works for you, please tell me..
260 */ 261 */
261static struct pciserial_board pci_parport_serial_boards[] __devinitdata = { 262static struct pciserial_board pci_parport_serial_boards[] = {
262 [titan_110l] = { 263 [titan_110l] = {
263 .flags = FL_BASE1 | FL_BASE_BARS, 264 .flags = FL_BASE1 | FL_BASE_BARS,
264 .num_ports = 1, 265 .num_ports = 1,
@@ -479,8 +480,7 @@ struct parport_serial_private {
479}; 480};
480 481
481/* Register the serial port(s) of a PCI card. */ 482/* Register the serial port(s) of a PCI card. */
482static int __devinit serial_register (struct pci_dev *dev, 483static int serial_register(struct pci_dev *dev, const struct pci_device_id *id)
483 const struct pci_device_id *id)
484{ 484{
485 struct parport_serial_private *priv = pci_get_drvdata (dev); 485 struct parport_serial_private *priv = pci_get_drvdata (dev);
486 struct pciserial_board *board; 486 struct pciserial_board *board;
@@ -501,8 +501,7 @@ static int __devinit serial_register (struct pci_dev *dev,
501} 501}
502 502
503/* Register the parallel port(s) of a PCI card. */ 503/* Register the parallel port(s) of a PCI card. */
504static int __devinit parport_register (struct pci_dev *dev, 504static int parport_register(struct pci_dev *dev, const struct pci_device_id *id)
505 const struct pci_device_id *id)
506{ 505{
507 struct parport_pc_pci *card; 506 struct parport_pc_pci *card;
508 struct parport_serial_private *priv = pci_get_drvdata (dev); 507 struct parport_serial_private *priv = pci_get_drvdata (dev);
@@ -563,8 +562,8 @@ static int __devinit parport_register (struct pci_dev *dev,
563 return 0; 562 return 0;
564} 563}
565 564
566static int __devinit parport_serial_pci_probe (struct pci_dev *dev, 565static int parport_serial_pci_probe(struct pci_dev *dev,
567 const struct pci_device_id *id) 566 const struct pci_device_id *id)
568{ 567{
569 struct parport_serial_private *priv; 568 struct parport_serial_private *priv;
570 int err; 569 int err;
@@ -599,7 +598,7 @@ static int __devinit parport_serial_pci_probe (struct pci_dev *dev,
599 return 0; 598 return 0;
600} 599}
601 600
602static void __devexit parport_serial_pci_remove (struct pci_dev *dev) 601static void parport_serial_pci_remove(struct pci_dev *dev)
603{ 602{
604 struct parport_serial_private *priv = pci_get_drvdata (dev); 603 struct parport_serial_private *priv = pci_get_drvdata (dev);
605 int i; 604 int i;
@@ -664,7 +663,7 @@ static struct pci_driver parport_serial_pci_driver = {
664 .name = "parport_serial", 663 .name = "parport_serial",
665 .id_table = parport_serial_pci_tbl, 664 .id_table = parport_serial_pci_tbl,
666 .probe = parport_serial_pci_probe, 665 .probe = parport_serial_pci_probe,
667 .remove = __devexit_p(parport_serial_pci_remove), 666 .remove = parport_serial_pci_remove,
668#ifdef CONFIG_PM 667#ifdef CONFIG_PM
669 .suspend = parport_serial_pci_suspend, 668 .suspend = parport_serial_pci_suspend,
670 .resume = parport_serial_pci_resume, 669 .resume = parport_serial_pci_resume,
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index 983a2d2df65..5c4b6a1db6c 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -265,7 +265,7 @@ static struct parport_operations parport_sunbpp_ops =
265 .owner = THIS_MODULE, 265 .owner = THIS_MODULE,
266}; 266};
267 267
268static int __devinit bpp_probe(struct platform_device *op) 268static int bpp_probe(struct platform_device *op)
269{ 269{
270 struct parport_operations *ops; 270 struct parport_operations *ops;
271 struct bpp_regs __iomem *regs; 271 struct bpp_regs __iomem *regs;
@@ -330,7 +330,7 @@ out_unmap:
330 return err; 330 return err;
331} 331}
332 332
333static int __devexit bpp_remove(struct platform_device *op) 333static int bpp_remove(struct platform_device *op)
334{ 334{
335 struct parport *p = dev_get_drvdata(&op->dev); 335 struct parport *p = dev_get_drvdata(&op->dev);
336 struct parport_operations *ops = p->ops; 336 struct parport_operations *ops = p->ops;
@@ -367,7 +367,7 @@ static struct platform_driver bpp_sbus_driver = {
367 .of_match_table = bpp_match, 367 .of_match_table = bpp_match,
368 }, 368 },
369 .probe = bpp_probe, 369 .probe = bpp_probe,
370 .remove = __devexit_p(bpp_remove), 370 .remove = bpp_remove,
371}; 371};
372 372
373module_platform_driver(bpp_sbus_driver); 373module_platform_driver(bpp_sbus_driver);
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index bafd2bbcaf6..c18e5bf444f 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -739,7 +739,7 @@ EXPORT_SYMBOL_GPL(pci_num_vf);
739/** 739/**
740 * pci_sriov_set_totalvfs -- reduce the TotalVFs available 740 * pci_sriov_set_totalvfs -- reduce the TotalVFs available
741 * @dev: the PCI PF device 741 * @dev: the PCI PF device
742 * numvfs: number that should be used for TotalVFs supported 742 * @numvfs: number that should be used for TotalVFs supported
743 * 743 *
744 * Should be called from PF driver's probe routine with 744 * Should be called from PF driver's probe routine with
745 * device's mutex held. 745 * device's mutex held.
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 5cdee8669ea..59f5a965bdc 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -700,7 +700,7 @@ static struct pinctrl *create_pinctrl(struct device *dev)
700 } 700 }
701 } 701 }
702 702
703 /* Add the pinmux to the global list */ 703 /* Add the pinctrl handle to the global list */
704 list_add_tail(&p->node, &pinctrl_list); 704 list_add_tail(&p->node, &pinctrl_list);
705 705
706 return p; 706 return p;
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-370.c b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
index c907647de6a..48e21a22948 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-370.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
@@ -367,7 +367,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
367 367
368static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info; 368static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info;
369 369
370static struct of_device_id armada_370_pinctrl_of_match[] __devinitdata = { 370static struct of_device_id armada_370_pinctrl_of_match[] = {
371 { .compatible = "marvell,mv88f6710-pinctrl" }, 371 { .compatible = "marvell,mv88f6710-pinctrl" },
372 { }, 372 { },
373}; 373};
@@ -382,7 +382,7 @@ static struct pinctrl_gpio_range mv88f6710_mpp_gpio_ranges[] = {
382 MPP_GPIO_RANGE(2, 64, 64, 2), 382 MPP_GPIO_RANGE(2, 64, 64, 2),
383}; 383};
384 384
385static int __devinit armada_370_pinctrl_probe(struct platform_device *pdev) 385static int armada_370_pinctrl_probe(struct platform_device *pdev)
386{ 386{
387 struct mvebu_pinctrl_soc_info *soc = &armada_370_pinctrl_info; 387 struct mvebu_pinctrl_soc_info *soc = &armada_370_pinctrl_info;
388 388
@@ -399,7 +399,7 @@ static int __devinit armada_370_pinctrl_probe(struct platform_device *pdev)
399 return mvebu_pinctrl_probe(pdev); 399 return mvebu_pinctrl_probe(pdev);
400} 400}
401 401
402static int __devexit armada_370_pinctrl_remove(struct platform_device *pdev) 402static int armada_370_pinctrl_remove(struct platform_device *pdev)
403{ 403{
404 return mvebu_pinctrl_remove(pdev); 404 return mvebu_pinctrl_remove(pdev);
405} 405}
@@ -411,7 +411,7 @@ static struct platform_driver armada_370_pinctrl_driver = {
411 .of_match_table = of_match_ptr(armada_370_pinctrl_of_match), 411 .of_match_table = of_match_ptr(armada_370_pinctrl_of_match),
412 }, 412 },
413 .probe = armada_370_pinctrl_probe, 413 .probe = armada_370_pinctrl_probe,
414 .remove = __devexit_p(armada_370_pinctrl_remove), 414 .remove = armada_370_pinctrl_remove,
415}; 415};
416 416
417module_platform_driver(armada_370_pinctrl_driver); 417module_platform_driver(armada_370_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index 40bd52a46b4..ab5dc04b3e8 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -349,7 +349,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
349 349
350static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info; 350static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info;
351 351
352static struct of_device_id armada_xp_pinctrl_of_match[] __devinitdata = { 352static struct of_device_id armada_xp_pinctrl_of_match[] = {
353 { 353 {
354 .compatible = "marvell,mv78230-pinctrl", 354 .compatible = "marvell,mv78230-pinctrl",
355 .data = (void *) V_MV78230, 355 .data = (void *) V_MV78230,
@@ -394,7 +394,7 @@ static struct pinctrl_gpio_range mv78460_mpp_gpio_ranges[] = {
394 MPP_GPIO_RANGE(2, 64, 64, 3), 394 MPP_GPIO_RANGE(2, 64, 64, 3),
395}; 395};
396 396
397static int __devinit armada_xp_pinctrl_probe(struct platform_device *pdev) 397static int armada_xp_pinctrl_probe(struct platform_device *pdev)
398{ 398{
399 struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info; 399 struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info;
400 const struct of_device_id *match = 400 const struct of_device_id *match =
@@ -446,7 +446,7 @@ static int __devinit armada_xp_pinctrl_probe(struct platform_device *pdev)
446 return mvebu_pinctrl_probe(pdev); 446 return mvebu_pinctrl_probe(pdev);
447} 447}
448 448
449static int __devexit armada_xp_pinctrl_remove(struct platform_device *pdev) 449static int armada_xp_pinctrl_remove(struct platform_device *pdev)
450{ 450{
451 return mvebu_pinctrl_remove(pdev); 451 return mvebu_pinctrl_remove(pdev);
452} 452}
@@ -458,7 +458,7 @@ static struct platform_driver armada_xp_pinctrl_driver = {
458 .of_match_table = of_match_ptr(armada_xp_pinctrl_of_match), 458 .of_match_table = of_match_ptr(armada_xp_pinctrl_of_match),
459 }, 459 },
460 .probe = armada_xp_pinctrl_probe, 460 .probe = armada_xp_pinctrl_probe,
461 .remove = __devexit_p(armada_xp_pinctrl_remove), 461 .remove = armada_xp_pinctrl_remove,
462}; 462};
463 463
464module_platform_driver(armada_xp_pinctrl_driver); 464module_platform_driver(armada_xp_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index 40c9c3eecd9..69aba369728 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -579,12 +579,12 @@ static struct mvebu_pinctrl_soc_info dove_pinctrl_info = {
579 579
580static struct clk *clk; 580static struct clk *clk;
581 581
582static struct of_device_id dove_pinctrl_of_match[] __devinitdata = { 582static struct of_device_id dove_pinctrl_of_match[] = {
583 { .compatible = "marvell,dove-pinctrl", .data = &dove_pinctrl_info }, 583 { .compatible = "marvell,dove-pinctrl", .data = &dove_pinctrl_info },
584 { } 584 { }
585}; 585};
586 586
587static int __devinit dove_pinctrl_probe(struct platform_device *pdev) 587static int dove_pinctrl_probe(struct platform_device *pdev)
588{ 588{
589 const struct of_device_id *match = 589 const struct of_device_id *match =
590 of_match_device(dove_pinctrl_of_match, &pdev->dev); 590 of_match_device(dove_pinctrl_of_match, &pdev->dev);
@@ -595,13 +595,16 @@ static int __devinit dove_pinctrl_probe(struct platform_device *pdev)
595 * grab clk to make sure it is ticking. 595 * grab clk to make sure it is ticking.
596 */ 596 */
597 clk = devm_clk_get(&pdev->dev, NULL); 597 clk = devm_clk_get(&pdev->dev, NULL);
598 if (!IS_ERR(clk)) 598 if (IS_ERR(clk)) {
599 clk_prepare_enable(clk); 599 dev_err(&pdev->dev, "Unable to get pdma clock");
600 return PTR_RET(clk);
601 }
602 clk_prepare_enable(clk);
600 603
601 return mvebu_pinctrl_probe(pdev); 604 return mvebu_pinctrl_probe(pdev);
602} 605}
603 606
604static int __devexit dove_pinctrl_remove(struct platform_device *pdev) 607static int dove_pinctrl_remove(struct platform_device *pdev)
605{ 608{
606 int ret; 609 int ret;
607 610
@@ -618,7 +621,7 @@ static struct platform_driver dove_pinctrl_driver = {
618 .of_match_table = of_match_ptr(dove_pinctrl_of_match), 621 .of_match_table = of_match_ptr(dove_pinctrl_of_match),
619 }, 622 },
620 .probe = dove_pinctrl_probe, 623 .probe = dove_pinctrl_probe,
621 .remove = __devexit_p(dove_pinctrl_remove), 624 .remove = dove_pinctrl_remove,
622}; 625};
623 626
624module_platform_driver(dove_pinctrl_driver); 627module_platform_driver(dove_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
index fa6ce31c94d..f12084e1805 100644
--- a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
+++ b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
@@ -444,7 +444,7 @@ static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
444 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), 444 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
445}; 445};
446 446
447static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = { 447static struct of_device_id kirkwood_pinctrl_of_match[] = {
448 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info }, 448 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
449 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info }, 449 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
450 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info }, 450 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
@@ -454,7 +454,7 @@ static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = {
454 { } 454 { }
455}; 455};
456 456
457static int __devinit kirkwood_pinctrl_probe(struct platform_device *pdev) 457static int kirkwood_pinctrl_probe(struct platform_device *pdev)
458{ 458{
459 const struct of_device_id *match = 459 const struct of_device_id *match =
460 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); 460 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
@@ -462,7 +462,7 @@ static int __devinit kirkwood_pinctrl_probe(struct platform_device *pdev)
462 return mvebu_pinctrl_probe(pdev); 462 return mvebu_pinctrl_probe(pdev);
463} 463}
464 464
465static int __devexit kirkwood_pinctrl_remove(struct platform_device *pdev) 465static int kirkwood_pinctrl_remove(struct platform_device *pdev)
466{ 466{
467 return mvebu_pinctrl_remove(pdev); 467 return mvebu_pinctrl_remove(pdev);
468} 468}
@@ -474,7 +474,7 @@ static struct platform_driver kirkwood_pinctrl_driver = {
474 .of_match_table = of_match_ptr(kirkwood_pinctrl_of_match), 474 .of_match_table = of_match_ptr(kirkwood_pinctrl_of_match),
475 }, 475 },
476 .probe = kirkwood_pinctrl_probe, 476 .probe = kirkwood_pinctrl_probe,
477 .remove = __devexit_p(kirkwood_pinctrl_remove), 477 .remove = kirkwood_pinctrl_remove,
478}; 478};
479 479
480module_platform_driver(kirkwood_pinctrl_driver); 480module_platform_driver(kirkwood_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index 6c44b7e8964..c689c04a4f5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -478,8 +478,7 @@ static struct pinctrl_ops mvebu_pinctrl_ops = {
478 .dt_free_map = mvebu_pinctrl_dt_free_map, 478 .dt_free_map = mvebu_pinctrl_dt_free_map,
479}; 479};
480 480
481static int __devinit _add_function(struct mvebu_pinctrl_function *funcs, 481static int _add_function(struct mvebu_pinctrl_function *funcs, const char *name)
482 const char *name)
483{ 482{
484 while (funcs->num_groups) { 483 while (funcs->num_groups) {
485 /* function already there */ 484 /* function already there */
@@ -494,8 +493,8 @@ static int __devinit _add_function(struct mvebu_pinctrl_function *funcs,
494 return 0; 493 return 0;
495} 494}
496 495
497static int __devinit mvebu_pinctrl_build_functions(struct platform_device *pdev, 496static int mvebu_pinctrl_build_functions(struct platform_device *pdev,
498 struct mvebu_pinctrl *pctl) 497 struct mvebu_pinctrl *pctl)
499{ 498{
500 struct mvebu_pinctrl_function *funcs; 499 struct mvebu_pinctrl_function *funcs;
501 int num = 0; 500 int num = 0;
@@ -568,7 +567,7 @@ static int __devinit mvebu_pinctrl_build_functions(struct platform_device *pdev,
568 return 0; 567 return 0;
569} 568}
570 569
571int __devinit mvebu_pinctrl_probe(struct platform_device *pdev) 570int mvebu_pinctrl_probe(struct platform_device *pdev)
572{ 571{
573 struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev); 572 struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev);
574 struct device_node *np = pdev->dev.of_node; 573 struct device_node *np = pdev->dev.of_node;
@@ -745,7 +744,7 @@ int __devinit mvebu_pinctrl_probe(struct platform_device *pdev)
745 return 0; 744 return 0;
746} 745}
747 746
748int __devexit mvebu_pinctrl_remove(struct platform_device *pdev) 747int mvebu_pinctrl_remove(struct platform_device *pdev)
749{ 748{
750 struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev); 749 struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev);
751 pinctrl_unregister(pctl->pctldev); 750 pinctrl_unregister(pctl->pctldev);
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index c5e75715718..471c71f7f8b 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -265,7 +265,7 @@ static int at91_dt_node_to_map(struct pinctrl_dev *pctldev,
265 /* create mux map */ 265 /* create mux map */
266 parent = of_get_parent(np); 266 parent = of_get_parent(np);
267 if (!parent) { 267 if (!parent) {
268 kfree(new_map); 268 devm_kfree(pctldev->dev, new_map);
269 return -EINVAL; 269 return -EINVAL;
270 } 270 }
271 new_map[0].type = PIN_MAP_TYPE_MUX_GROUP; 271 new_map[0].type = PIN_MAP_TYPE_MUX_GROUP;
@@ -792,8 +792,8 @@ static struct pinctrl_desc at91_pinctrl_desc = {
792 792
793static const char *gpio_compat = "atmel,at91rm9200-gpio"; 793static const char *gpio_compat = "atmel,at91rm9200-gpio";
794 794
795static void __devinit at91_pinctrl_child_count(struct at91_pinctrl *info, 795static void at91_pinctrl_child_count(struct at91_pinctrl *info,
796 struct device_node *np) 796 struct device_node *np)
797{ 797{
798 struct device_node *child; 798 struct device_node *child;
799 799
@@ -807,8 +807,8 @@ static void __devinit at91_pinctrl_child_count(struct at91_pinctrl *info,
807 } 807 }
808} 808}
809 809
810static int __devinit at91_pinctrl_mux_mask(struct at91_pinctrl *info, 810static int at91_pinctrl_mux_mask(struct at91_pinctrl *info,
811 struct device_node *np) 811 struct device_node *np)
812{ 812{
813 int ret = 0; 813 int ret = 0;
814 int size; 814 int size;
@@ -840,10 +840,9 @@ static int __devinit at91_pinctrl_mux_mask(struct at91_pinctrl *info,
840 return ret; 840 return ret;
841} 841}
842 842
843static int __devinit at91_pinctrl_parse_groups(struct device_node *np, 843static int at91_pinctrl_parse_groups(struct device_node *np,
844 struct at91_pin_group *grp, 844 struct at91_pin_group *grp,
845 struct at91_pinctrl *info, 845 struct at91_pinctrl *info, u32 index)
846 u32 index)
847{ 846{
848 struct at91_pmx_pin *pin; 847 struct at91_pmx_pin *pin;
849 int size; 848 int size;
@@ -889,8 +888,8 @@ static int __devinit at91_pinctrl_parse_groups(struct device_node *np,
889 return 0; 888 return 0;
890} 889}
891 890
892static int __devinit at91_pinctrl_parse_functions(struct device_node *np, 891static int at91_pinctrl_parse_functions(struct device_node *np,
893 struct at91_pinctrl *info, u32 index) 892 struct at91_pinctrl *info, u32 index)
894{ 893{
895 struct device_node *child; 894 struct device_node *child;
896 struct at91_pmx_func *func; 895 struct at91_pmx_func *func;
@@ -926,14 +925,14 @@ static int __devinit at91_pinctrl_parse_functions(struct device_node *np,
926 return 0; 925 return 0;
927} 926}
928 927
929static struct of_device_id at91_pinctrl_of_match[] __devinitdata = { 928static struct of_device_id at91_pinctrl_of_match[] = {
930 { .compatible = "atmel,at91sam9x5-pinctrl", .data = &at91sam9x5_ops }, 929 { .compatible = "atmel,at91sam9x5-pinctrl", .data = &at91sam9x5_ops },
931 { .compatible = "atmel,at91rm9200-pinctrl", .data = &at91rm9200_ops }, 930 { .compatible = "atmel,at91rm9200-pinctrl", .data = &at91rm9200_ops },
932 { /* sentinel */ } 931 { /* sentinel */ }
933}; 932};
934 933
935static int __devinit at91_pinctrl_probe_dt(struct platform_device *pdev, 934static int at91_pinctrl_probe_dt(struct platform_device *pdev,
936 struct at91_pinctrl *info) 935 struct at91_pinctrl *info)
937{ 936{
938 int ret = 0; 937 int ret = 0;
939 int i, j; 938 int i, j;
@@ -999,7 +998,7 @@ static int __devinit at91_pinctrl_probe_dt(struct platform_device *pdev,
999 return 0; 998 return 0;
1000} 999}
1001 1000
1002static int __devinit at91_pinctrl_probe(struct platform_device *pdev) 1001static int at91_pinctrl_probe(struct platform_device *pdev)
1003{ 1002{
1004 struct at91_pinctrl *info; 1003 struct at91_pinctrl *info;
1005 struct pinctrl_pin_desc *pdesc; 1004 struct pinctrl_pin_desc *pdesc;
@@ -1063,7 +1062,7 @@ err:
1063 return ret; 1062 return ret;
1064} 1063}
1065 1064
1066static int __devexit at91_pinctrl_remove(struct platform_device *pdev) 1065static int at91_pinctrl_remove(struct platform_device *pdev)
1067{ 1066{
1068 struct at91_pinctrl *info = platform_get_drvdata(pdev); 1067 struct at91_pinctrl *info = platform_get_drvdata(pdev);
1069 1068
@@ -1443,7 +1442,7 @@ static struct gpio_chip at91_gpio_template = {
1443 .ngpio = MAX_NB_GPIO_PER_BANK, 1442 .ngpio = MAX_NB_GPIO_PER_BANK,
1444}; 1443};
1445 1444
1446static void __devinit at91_gpio_probe_fixup(void) 1445static void at91_gpio_probe_fixup(void)
1447{ 1446{
1448 unsigned i; 1447 unsigned i;
1449 struct at91_gpio_chip *at91_gpio, *last = NULL; 1448 struct at91_gpio_chip *at91_gpio, *last = NULL;
@@ -1461,13 +1460,13 @@ static void __devinit at91_gpio_probe_fixup(void)
1461 } 1460 }
1462} 1461}
1463 1462
1464static struct of_device_id at91_gpio_of_match[] __devinitdata = { 1463static struct of_device_id at91_gpio_of_match[] = {
1465 { .compatible = "atmel,at91sam9x5-gpio", .data = &at91sam9x5_ops, }, 1464 { .compatible = "atmel,at91sam9x5-gpio", .data = &at91sam9x5_ops, },
1466 { .compatible = "atmel,at91rm9200-gpio", .data = &at91rm9200_ops }, 1465 { .compatible = "atmel,at91rm9200-gpio", .data = &at91rm9200_ops },
1467 { /* sentinel */ } 1466 { /* sentinel */ }
1468}; 1467};
1469 1468
1470static int __devinit at91_gpio_probe(struct platform_device *pdev) 1469static int at91_gpio_probe(struct platform_device *pdev)
1471{ 1470{
1472 struct device_node *np = pdev->dev.of_node; 1471 struct device_node *np = pdev->dev.of_node;
1473 struct resource *res; 1472 struct resource *res;
@@ -1609,7 +1608,7 @@ static struct platform_driver at91_pinctrl_driver = {
1609 .of_match_table = of_match_ptr(at91_pinctrl_of_match), 1608 .of_match_table = of_match_ptr(at91_pinctrl_of_match),
1610 }, 1609 },
1611 .probe = at91_pinctrl_probe, 1610 .probe = at91_pinctrl_probe,
1612 .remove = __devexit_p(at91_pinctrl_remove), 1611 .remove = at91_pinctrl_remove,
1613}; 1612};
1614 1613
1615static int __init at91_pinctrl_init(void) 1614static int __init at91_pinctrl_init(void)
diff --git a/drivers/pinctrl/pinctrl-bcm2835.c b/drivers/pinctrl/pinctrl-bcm2835.c
index 0b0e9b49a1b..d347b9f2eae 100644
--- a/drivers/pinctrl/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/pinctrl-bcm2835.c
@@ -936,7 +936,7 @@ static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
936 .npins = BCM2835_NUM_GPIOS, 936 .npins = BCM2835_NUM_GPIOS,
937}; 937};
938 938
939static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev) 939static int bcm2835_pinctrl_probe(struct platform_device *pdev)
940{ 940{
941 struct device *dev = &pdev->dev; 941 struct device *dev = &pdev->dev;
942 struct device_node *np = dev->of_node; 942 struct device_node *np = dev->of_node;
diff --git a/drivers/pinctrl/pinctrl-exynos5440.c b/drivers/pinctrl/pinctrl-exynos5440.c
index 07db89528dc..de05b64f0da 100644
--- a/drivers/pinctrl/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/pinctrl-exynos5440.c
@@ -842,7 +842,7 @@ static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev,
842 return 0; 842 return 0;
843} 843}
844 844
845static int __devinit exynos5440_pinctrl_probe(struct platform_device *pdev) 845static int exynos5440_pinctrl_probe(struct platform_device *pdev)
846{ 846{
847 struct device *dev = &pdev->dev; 847 struct device *dev = &pdev->dev;
848 struct exynos5440_pinctrl_priv_data *priv; 848 struct exynos5440_pinctrl_priv_data *priv;
diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c
index 131d86d7c2a..43a6f1ffc78 100644
--- a/drivers/pinctrl/pinctrl-imx.c
+++ b/drivers/pinctrl/pinctrl-imx.c
@@ -425,10 +425,10 @@ static int imx_pinctrl_get_pin_id_and_mux(const struct imx_pinctrl_soc_info *inf
425 return 0; 425 return 0;
426} 426}
427 427
428static int __devinit imx_pinctrl_parse_groups(struct device_node *np, 428static int imx_pinctrl_parse_groups(struct device_node *np,
429 struct imx_pin_group *grp, 429 struct imx_pin_group *grp,
430 struct imx_pinctrl_soc_info *info, 430 struct imx_pinctrl_soc_info *info,
431 u32 index) 431 u32 index)
432{ 432{
433 unsigned int pin_func_id; 433 unsigned int pin_func_id;
434 int ret, size; 434 int ret, size;
@@ -482,8 +482,9 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np,
482 return 0; 482 return 0;
483} 483}
484 484
485static int __devinit imx_pinctrl_parse_functions(struct device_node *np, 485static int imx_pinctrl_parse_functions(struct device_node *np,
486 struct imx_pinctrl_soc_info *info, u32 index) 486 struct imx_pinctrl_soc_info *info,
487 u32 index)
487{ 488{
488 struct device_node *child; 489 struct device_node *child;
489 struct imx_pmx_func *func; 490 struct imx_pmx_func *func;
@@ -517,7 +518,7 @@ static int __devinit imx_pinctrl_parse_functions(struct device_node *np,
517 return 0; 518 return 0;
518} 519}
519 520
520static int __devinit imx_pinctrl_probe_dt(struct platform_device *pdev, 521static int imx_pinctrl_probe_dt(struct platform_device *pdev,
521 struct imx_pinctrl_soc_info *info) 522 struct imx_pinctrl_soc_info *info)
522{ 523{
523 struct device_node *np = pdev->dev.of_node; 524 struct device_node *np = pdev->dev.of_node;
@@ -560,8 +561,8 @@ static int __devinit imx_pinctrl_probe_dt(struct platform_device *pdev,
560 return 0; 561 return 0;
561} 562}
562 563
563int __devinit imx_pinctrl_probe(struct platform_device *pdev, 564int imx_pinctrl_probe(struct platform_device *pdev,
564 struct imx_pinctrl_soc_info *info) 565 struct imx_pinctrl_soc_info *info)
565{ 566{
566 struct imx_pinctrl *ipctl; 567 struct imx_pinctrl *ipctl;
567 struct resource *res; 568 struct resource *res;
diff --git a/drivers/pinctrl/pinctrl-imx23.c b/drivers/pinctrl/pinctrl-imx23.c
index 04364f7822b..e76d75c9d1b 100644
--- a/drivers/pinctrl/pinctrl-imx23.c
+++ b/drivers/pinctrl/pinctrl-imx23.c
@@ -267,7 +267,7 @@ static struct mxs_pinctrl_soc_data imx23_pinctrl_data = {
267 .npins = ARRAY_SIZE(imx23_pins), 267 .npins = ARRAY_SIZE(imx23_pins),
268}; 268};
269 269
270static int __devinit imx23_pinctrl_probe(struct platform_device *pdev) 270static int imx23_pinctrl_probe(struct platform_device *pdev)
271{ 271{
272 return mxs_pinctrl_probe(pdev, &imx23_pinctrl_data); 272 return mxs_pinctrl_probe(pdev, &imx23_pinctrl_data);
273} 273}
diff --git a/drivers/pinctrl/pinctrl-imx28.c b/drivers/pinctrl/pinctrl-imx28.c
index e1af2ba8900..79c9c8d296a 100644
--- a/drivers/pinctrl/pinctrl-imx28.c
+++ b/drivers/pinctrl/pinctrl-imx28.c
@@ -383,7 +383,7 @@ static struct mxs_pinctrl_soc_data imx28_pinctrl_data = {
383 .npins = ARRAY_SIZE(imx28_pins), 383 .npins = ARRAY_SIZE(imx28_pins),
384}; 384};
385 385
386static int __devinit imx28_pinctrl_probe(struct platform_device *pdev) 386static int imx28_pinctrl_probe(struct platform_device *pdev)
387{ 387{
388 return mxs_pinctrl_probe(pdev, &imx28_pinctrl_data); 388 return mxs_pinctrl_probe(pdev, &imx28_pinctrl_data);
389} 389}
diff --git a/drivers/pinctrl/pinctrl-imx35.c b/drivers/pinctrl/pinctrl-imx35.c
index 1dbf5278ace..6e214110e3d 100644
--- a/drivers/pinctrl/pinctrl-imx35.c
+++ b/drivers/pinctrl/pinctrl-imx35.c
@@ -1564,7 +1564,7 @@ static struct of_device_id imx35_pinctrl_of_match[] = {
1564 { /* sentinel */ } 1564 { /* sentinel */ }
1565}; 1565};
1566 1566
1567static int __devinit imx35_pinctrl_probe(struct platform_device *pdev) 1567static int imx35_pinctrl_probe(struct platform_device *pdev)
1568{ 1568{
1569 return imx_pinctrl_probe(pdev, &imx35_pinctrl_info); 1569 return imx_pinctrl_probe(pdev, &imx35_pinctrl_info);
1570} 1570}
diff --git a/drivers/pinctrl/pinctrl-imx51.c b/drivers/pinctrl/pinctrl-imx51.c
index 131216558a7..9a92aaad150 100644
--- a/drivers/pinctrl/pinctrl-imx51.c
+++ b/drivers/pinctrl/pinctrl-imx51.c
@@ -1291,7 +1291,7 @@ static struct of_device_id imx51_pinctrl_of_match[] = {
1291 { /* sentinel */ } 1291 { /* sentinel */ }
1292}; 1292};
1293 1293
1294static int __devinit imx51_pinctrl_probe(struct platform_device *pdev) 1294static int imx51_pinctrl_probe(struct platform_device *pdev)
1295{ 1295{
1296 return imx_pinctrl_probe(pdev, &imx51_pinctrl_info); 1296 return imx_pinctrl_probe(pdev, &imx51_pinctrl_info);
1297} 1297}
diff --git a/drivers/pinctrl/pinctrl-imx53.c b/drivers/pinctrl/pinctrl-imx53.c
index ec404869177..2c9c8e2334d 100644
--- a/drivers/pinctrl/pinctrl-imx53.c
+++ b/drivers/pinctrl/pinctrl-imx53.c
@@ -1371,7 +1371,7 @@ static struct imx_pin_reg imx53_pin_regs[] = {
1371 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 0, 0x7F8, 1), /* MX53_PAD_GPIO_8__ESAI1_TX5_RX0 */ 1371 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 0, 0x7F8, 1), /* MX53_PAD_GPIO_8__ESAI1_TX5_RX0 */
1372 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 1, 0x000, 0), /* MX53_PAD_GPIO_8__GPIO1_8 */ 1372 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 1, 0x000, 0), /* MX53_PAD_GPIO_8__GPIO1_8 */
1373 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 2, 0x000, 0), /* MX53_PAD_GPIO_8__EPIT2_EPITO */ 1373 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 2, 0x000, 0), /* MX53_PAD_GPIO_8__EPIT2_EPITO */
1374 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 3, 0x760, 3), /* MX53_PAD_GPIO_8__CAN1_RXCAN */ 1374 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 3, 0x760, 2), /* MX53_PAD_GPIO_8__CAN1_RXCAN */
1375 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 4, 0x880, 5), /* MX53_PAD_GPIO_8__UART2_RXD_MUX */ 1375 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 4, 0x880, 5), /* MX53_PAD_GPIO_8__UART2_RXD_MUX */
1376 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 5, 0x000, 0), /* MX53_PAD_GPIO_8__FIRI_TXD */ 1376 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 5, 0x000, 0), /* MX53_PAD_GPIO_8__FIRI_TXD */
1377 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 6, 0x000, 0), /* MX53_PAD_GPIO_8__SPDIF_SRCLK */ 1377 IMX_PIN_REG(MX53_PAD_GPIO_8, 0x6C8, 0x338, 6, 0x000, 0), /* MX53_PAD_GPIO_8__SPDIF_SRCLK */
@@ -1618,7 +1618,7 @@ static struct of_device_id imx53_pinctrl_of_match[] = {
1618 { /* sentinel */ } 1618 { /* sentinel */ }
1619}; 1619};
1620 1620
1621static int __devinit imx53_pinctrl_probe(struct platform_device *pdev) 1621static int imx53_pinctrl_probe(struct platform_device *pdev)
1622{ 1622{
1623 return imx_pinctrl_probe(pdev, &imx53_pinctrl_info); 1623 return imx_pinctrl_probe(pdev, &imx53_pinctrl_info);
1624} 1624}
diff --git a/drivers/pinctrl/pinctrl-imx6q.c b/drivers/pinctrl/pinctrl-imx6q.c
index 844ab13c93a..663346bb765 100644
--- a/drivers/pinctrl/pinctrl-imx6q.c
+++ b/drivers/pinctrl/pinctrl-imx6q.c
@@ -2302,7 +2302,7 @@ static struct of_device_id imx6q_pinctrl_of_match[] = {
2302 { /* sentinel */ } 2302 { /* sentinel */ }
2303}; 2303};
2304 2304
2305static int __devinit imx6q_pinctrl_probe(struct platform_device *pdev) 2305static int imx6q_pinctrl_probe(struct platform_device *pdev)
2306{ 2306{
2307 return imx_pinctrl_probe(pdev, &imx6q_pinctrl_info); 2307 return imx_pinctrl_probe(pdev, &imx6q_pinctrl_info);
2308} 2308}
diff --git a/drivers/pinctrl/pinctrl-mmp2.c b/drivers/pinctrl/pinctrl-mmp2.c
index 4fbb3db3f1c..4afa56a3a51 100644
--- a/drivers/pinctrl/pinctrl-mmp2.c
+++ b/drivers/pinctrl/pinctrl-mmp2.c
@@ -686,7 +686,7 @@ static struct pxa3xx_pinmux_info mmp2_info = {
686 .ds_shift = MMP2_DS_SHIFT, 686 .ds_shift = MMP2_DS_SHIFT,
687}; 687};
688 688
689static int __devinit mmp2_pinmux_probe(struct platform_device *pdev) 689static int mmp2_pinmux_probe(struct platform_device *pdev)
690{ 690{
691 return pxa3xx_pinctrl_register(pdev, &mmp2_info); 691 return pxa3xx_pinctrl_register(pdev, &mmp2_info);
692} 692}
diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c
index 180f16379ec..dd227d21dcf 100644
--- a/drivers/pinctrl/pinctrl-mxs.c
+++ b/drivers/pinctrl/pinctrl-mxs.c
@@ -335,9 +335,9 @@ static struct pinctrl_desc mxs_pinctrl_desc = {
335 .owner = THIS_MODULE, 335 .owner = THIS_MODULE,
336}; 336};
337 337
338static int __devinit mxs_pinctrl_parse_group(struct platform_device *pdev, 338static int mxs_pinctrl_parse_group(struct platform_device *pdev,
339 struct device_node *np, int idx, 339 struct device_node *np, int idx,
340 const char **out_name) 340 const char **out_name)
341{ 341{
342 struct mxs_pinctrl_data *d = platform_get_drvdata(pdev); 342 struct mxs_pinctrl_data *d = platform_get_drvdata(pdev);
343 struct mxs_group *g = &d->soc->groups[idx]; 343 struct mxs_group *g = &d->soc->groups[idx];
@@ -384,8 +384,8 @@ static int __devinit mxs_pinctrl_parse_group(struct platform_device *pdev,
384 return 0; 384 return 0;
385} 385}
386 386
387static int __devinit mxs_pinctrl_probe_dt(struct platform_device *pdev, 387static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
388 struct mxs_pinctrl_data *d) 388 struct mxs_pinctrl_data *d)
389{ 389{
390 struct mxs_pinctrl_soc_data *soc = d->soc; 390 struct mxs_pinctrl_soc_data *soc = d->soc;
391 struct device_node *np = pdev->dev.of_node; 391 struct device_node *np = pdev->dev.of_node;
@@ -476,8 +476,8 @@ static int __devinit mxs_pinctrl_probe_dt(struct platform_device *pdev,
476 return 0; 476 return 0;
477} 477}
478 478
479int __devinit mxs_pinctrl_probe(struct platform_device *pdev, 479int mxs_pinctrl_probe(struct platform_device *pdev,
480 struct mxs_pinctrl_soc_data *soc) 480 struct mxs_pinctrl_soc_data *soc)
481{ 481{
482 struct device_node *np = pdev->dev.of_node; 482 struct device_node *np = pdev->dev.of_node;
483 struct mxs_pinctrl_data *d; 483 struct mxs_pinctrl_data *d;
diff --git a/drivers/pinctrl/pinctrl-nomadik-db8500.c b/drivers/pinctrl/pinctrl-nomadik-db8500.c
index 7d88ae35211..30b4da91ef7 100644
--- a/drivers/pinctrl/pinctrl-nomadik-db8500.c
+++ b/drivers/pinctrl/pinctrl-nomadik-db8500.c
@@ -1251,8 +1251,7 @@ static const struct nmk_pinctrl_soc_data nmk_db8500_soc = {
1251 .prcm_gpiocr_registers = db8500_prcm_gpiocr_regs, 1251 .prcm_gpiocr_registers = db8500_prcm_gpiocr_regs,
1252}; 1252};
1253 1253
1254void __devinit 1254void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc)
1255nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc)
1256{ 1255{
1257 *soc = &nmk_db8500_soc; 1256 *soc = &nmk_db8500_soc;
1258} 1257}
diff --git a/drivers/pinctrl/pinctrl-nomadik-db8540.c b/drivers/pinctrl/pinctrl-nomadik-db8540.c
index bb6a4016322..d7ba5443bae 100644
--- a/drivers/pinctrl/pinctrl-nomadik-db8540.c
+++ b/drivers/pinctrl/pinctrl-nomadik-db8540.c
@@ -1260,8 +1260,7 @@ static const struct nmk_pinctrl_soc_data nmk_db8540_soc = {
1260 .prcm_gpiocr_registers = db8540_prcm_gpiocr_regs, 1260 .prcm_gpiocr_registers = db8540_prcm_gpiocr_regs,
1261}; 1261};
1262 1262
1263void __devinit 1263void nmk_pinctrl_db8540_init(const struct nmk_pinctrl_soc_data **soc)
1264nmk_pinctrl_db8540_init(const struct nmk_pinctrl_soc_data **soc)
1265{ 1264{
1266 *soc = &nmk_db8540_soc; 1265 *soc = &nmk_db8540_soc;
1267} 1266}
diff --git a/drivers/pinctrl/pinctrl-nomadik-stn8815.c b/drivers/pinctrl/pinctrl-nomadik-stn8815.c
index 7d432c3bc35..924a3393fa8 100644
--- a/drivers/pinctrl/pinctrl-nomadik-stn8815.c
+++ b/drivers/pinctrl/pinctrl-nomadik-stn8815.c
@@ -350,8 +350,7 @@ static const struct nmk_pinctrl_soc_data nmk_stn8815_soc = {
350 .ngroups = ARRAY_SIZE(nmk_stn8815_groups), 350 .ngroups = ARRAY_SIZE(nmk_stn8815_groups),
351}; 351};
352 352
353void __devinit 353void nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data **soc)
354nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data **soc)
355{ 354{
356 *soc = &nmk_stn8815_soc; 355 *soc = &nmk_stn8815_soc;
357} 356}
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index ef66f98e920..1bb16ffb4e4 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -259,6 +259,9 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
259 const struct prcm_gpiocr_altcx_pin_desc *pin_desc; 259 const struct prcm_gpiocr_altcx_pin_desc *pin_desc;
260 const u16 *gpiocr_regs; 260 const u16 *gpiocr_regs;
261 261
262 if (!npct->prcm_base)
263 return;
264
262 if (alt_num > PRCM_IDX_GPIOCR_ALTC_MAX) { 265 if (alt_num > PRCM_IDX_GPIOCR_ALTC_MAX) {
263 dev_err(npct->dev, "PRCM GPIOCR: alternate-C%i is invalid\n", 266 dev_err(npct->dev, "PRCM GPIOCR: alternate-C%i is invalid\n",
264 alt_num); 267 alt_num);
@@ -682,6 +685,9 @@ static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
682 const struct prcm_gpiocr_altcx_pin_desc *pin_desc; 685 const struct prcm_gpiocr_altcx_pin_desc *pin_desc;
683 const u16 *gpiocr_regs; 686 const u16 *gpiocr_regs;
684 687
688 if (!npct->prcm_base)
689 return NMK_GPIO_ALT_C;
690
685 for (i = 0; i < npct->soc->npins_altcx; i++) { 691 for (i = 0; i < npct->soc->npins_altcx; i++) {
686 if (npct->soc->altcx_pins[i].pin == gpio) 692 if (npct->soc->altcx_pins[i].pin == gpio)
687 break; 693 break;
@@ -1306,7 +1312,7 @@ const struct irq_domain_ops nmk_gpio_irq_simple_ops = {
1306 .xlate = irq_domain_xlate_twocell, 1312 .xlate = irq_domain_xlate_twocell,
1307}; 1313};
1308 1314
1309static int __devinit nmk_gpio_probe(struct platform_device *dev) 1315static int nmk_gpio_probe(struct platform_device *dev)
1310{ 1316{
1311 struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; 1317 struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
1312 struct device_node *np = dev->dev.of_node; 1318 struct device_node *np = dev->dev.of_node;
@@ -1846,7 +1852,7 @@ static const struct of_device_id nmk_pinctrl_match[] = {
1846 {}, 1852 {},
1847}; 1853};
1848 1854
1849static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) 1855static int nmk_pinctrl_probe(struct platform_device *pdev)
1850{ 1856{
1851 const struct platform_device_id *platid = platform_get_device_id(pdev); 1857 const struct platform_device_id *platid = platform_get_device_id(pdev);
1852 struct device_node *np = pdev->dev.of_node; 1858 struct device_node *np = pdev->dev.of_node;
@@ -1887,9 +1893,12 @@ static int __devinit nmk_pinctrl_probe(struct platform_device *pdev)
1887 "failed to ioremap PRCM registers\n"); 1893 "failed to ioremap PRCM registers\n");
1888 return -ENOMEM; 1894 return -ENOMEM;
1889 } 1895 }
1890 } else { 1896 } else if (version == PINCTRL_NMK_STN8815) {
1891 dev_info(&pdev->dev, 1897 dev_info(&pdev->dev,
1892 "No PRCM base, assume no ALT-Cx control is available\n"); 1898 "No PRCM base, assume no ALT-Cx control is available\n");
1899 } else {
1900 dev_err(&pdev->dev, "missing PRCM base address\n");
1901 return -EINVAL;
1893 } 1902 }
1894 1903
1895 /* 1904 /*
diff --git a/drivers/pinctrl/pinctrl-pxa168.c b/drivers/pinctrl/pinctrl-pxa168.c
index cb771e4a635..d9cd2b45748 100644
--- a/drivers/pinctrl/pinctrl-pxa168.c
+++ b/drivers/pinctrl/pinctrl-pxa168.c
@@ -615,7 +615,7 @@ static struct pxa3xx_pinmux_info pxa168_info = {
615 .ds_shift = PXA168_DS_SHIFT, 615 .ds_shift = PXA168_DS_SHIFT,
616}; 616};
617 617
618static int __devinit pxa168_pinmux_probe(struct platform_device *pdev) 618static int pxa168_pinmux_probe(struct platform_device *pdev)
619{ 619{
620 return pxa3xx_pinctrl_register(pdev, &pxa168_info); 620 return pxa3xx_pinctrl_register(pdev, &pxa168_info);
621} 621}
diff --git a/drivers/pinctrl/pinctrl-pxa910.c b/drivers/pinctrl/pinctrl-pxa910.c
index 5fecd221b83..a2f917b847f 100644
--- a/drivers/pinctrl/pinctrl-pxa910.c
+++ b/drivers/pinctrl/pinctrl-pxa910.c
@@ -971,7 +971,7 @@ static struct pxa3xx_pinmux_info pxa910_info = {
971 .ds_shift = PXA910_DS_SHIFT, 971 .ds_shift = PXA910_DS_SHIFT,
972}; 972};
973 973
974static int __devinit pxa910_pinmux_probe(struct platform_device *pdev) 974static int pxa910_pinmux_probe(struct platform_device *pdev)
975{ 975{
976 return pxa3xx_pinctrl_register(pdev, &pxa910_info); 976 return pxa3xx_pinctrl_register(pdev, &pxa910_info);
977} 977}
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 864fed822f9..fd7b24cd890 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -549,9 +549,11 @@ static int samsung_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
549 * Parse the pin names listed in the 'samsung,pins' property and convert it 549 * Parse the pin names listed in the 'samsung,pins' property and convert it
550 * into a list of gpio numbers are create a pin group from it. 550 * into a list of gpio numbers are create a pin group from it.
551 */ 551 */
552static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev, 552static int samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
553 struct device_node *cfg_np, struct pinctrl_desc *pctl, 553 struct device_node *cfg_np,
554 unsigned int **pin_list, unsigned int *npins) 554 struct pinctrl_desc *pctl,
555 unsigned int **pin_list,
556 unsigned int *npins)
555{ 557{
556 struct device *dev = &pdev->dev; 558 struct device *dev = &pdev->dev;
557 struct property *prop; 559 struct property *prop;
@@ -596,8 +598,8 @@ static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
596 * from device node of the pin-controller. A pin group is formed with all 598 * from device node of the pin-controller. A pin group is formed with all
597 * the pins listed in the "samsung,pins" property. 599 * the pins listed in the "samsung,pins" property.
598 */ 600 */
599static int __devinit samsung_pinctrl_parse_dt(struct platform_device *pdev, 601static int samsung_pinctrl_parse_dt(struct platform_device *pdev,
600 struct samsung_pinctrl_drv_data *drvdata) 602 struct samsung_pinctrl_drv_data *drvdata)
601{ 603{
602 struct device *dev = &pdev->dev; 604 struct device *dev = &pdev->dev;
603 struct device_node *dev_np = dev->of_node; 605 struct device_node *dev_np = dev->of_node;
@@ -691,8 +693,8 @@ static int __devinit samsung_pinctrl_parse_dt(struct platform_device *pdev,
691} 693}
692 694
693/* register the pinctrl interface with the pinctrl subsystem */ 695/* register the pinctrl interface with the pinctrl subsystem */
694static int __devinit samsung_pinctrl_register(struct platform_device *pdev, 696static int samsung_pinctrl_register(struct platform_device *pdev,
695 struct samsung_pinctrl_drv_data *drvdata) 697 struct samsung_pinctrl_drv_data *drvdata)
696{ 698{
697 struct pinctrl_desc *ctrldesc = &drvdata->pctl; 699 struct pinctrl_desc *ctrldesc = &drvdata->pctl;
698 struct pinctrl_pin_desc *pindesc, *pdesc; 700 struct pinctrl_pin_desc *pindesc, *pdesc;
@@ -778,8 +780,8 @@ static const struct gpio_chip samsung_gpiolib_chip = {
778}; 780};
779 781
780/* register the gpiolib interface with the gpiolib subsystem */ 782/* register the gpiolib interface with the gpiolib subsystem */
781static int __devinit samsung_gpiolib_register(struct platform_device *pdev, 783static int samsung_gpiolib_register(struct platform_device *pdev,
782 struct samsung_pinctrl_drv_data *drvdata) 784 struct samsung_pinctrl_drv_data *drvdata)
783{ 785{
784 struct samsung_pin_ctrl *ctrl = drvdata->ctrl; 786 struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
785 struct samsung_pin_bank *bank = ctrl->pin_banks; 787 struct samsung_pin_bank *bank = ctrl->pin_banks;
@@ -816,8 +818,8 @@ fail:
816} 818}
817 819
818/* unregister the gpiolib interface with the gpiolib subsystem */ 820/* unregister the gpiolib interface with the gpiolib subsystem */
819static int __devinit samsung_gpiolib_unregister(struct platform_device *pdev, 821static int samsung_gpiolib_unregister(struct platform_device *pdev,
820 struct samsung_pinctrl_drv_data *drvdata) 822 struct samsung_pinctrl_drv_data *drvdata)
821{ 823{
822 struct samsung_pin_ctrl *ctrl = drvdata->ctrl; 824 struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
823 struct samsung_pin_bank *bank = ctrl->pin_banks; 825 struct samsung_pin_bank *bank = ctrl->pin_banks;
@@ -881,7 +883,7 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_data(
881 return ctrl; 883 return ctrl;
882} 884}
883 885
884static int __devinit samsung_pinctrl_probe(struct platform_device *pdev) 886static int samsung_pinctrl_probe(struct platform_device *pdev)
885{ 887{
886 struct samsung_pinctrl_drv_data *drvdata; 888 struct samsung_pinctrl_drv_data *drvdata;
887 struct device *dev = &pdev->dev; 889 struct device *dev = &pdev->dev;
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 79642831bba..f6a360b86eb 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -493,7 +493,7 @@ static struct pinconf_ops pcs_pinconf_ops = {
493 * @pcs: pcs driver instance 493 * @pcs: pcs driver instance
494 * @offset: register offset from base 494 * @offset: register offset from base
495 */ 495 */
496static int __devinit pcs_add_pin(struct pcs_device *pcs, unsigned offset) 496static int pcs_add_pin(struct pcs_device *pcs, unsigned offset)
497{ 497{
498 struct pinctrl_pin_desc *pin; 498 struct pinctrl_pin_desc *pin;
499 struct pcs_name *pn; 499 struct pcs_name *pn;
@@ -526,7 +526,7 @@ static int __devinit pcs_add_pin(struct pcs_device *pcs, unsigned offset)
526 * If your hardware needs holes in the address space, then just set 526 * If your hardware needs holes in the address space, then just set
527 * up multiple driver instances. 527 * up multiple driver instances.
528 */ 528 */
529static int __devinit pcs_allocate_pin_table(struct pcs_device *pcs) 529static int pcs_allocate_pin_table(struct pcs_device *pcs)
530{ 530{
531 int mux_bytes, nr_pins, i; 531 int mux_bytes, nr_pins, i;
532 532
@@ -907,8 +907,7 @@ static void pcs_free_resources(struct pcs_device *pcs)
907 907
908static struct of_device_id pcs_of_match[]; 908static struct of_device_id pcs_of_match[];
909 909
910static int __devinit pcs_add_gpio_range(struct device_node *node, 910static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs)
911 struct pcs_device *pcs)
912{ 911{
913 struct pcs_gpio_range *gpio; 912 struct pcs_gpio_range *gpio;
914 struct device_node *child; 913 struct device_node *child;
@@ -951,7 +950,7 @@ static int __devinit pcs_add_gpio_range(struct device_node *node,
951 return 0; 950 return 0;
952} 951}
953 952
954static int __devinit pcs_probe(struct platform_device *pdev) 953static int pcs_probe(struct platform_device *pdev)
955{ 954{
956 struct device_node *np = pdev->dev.of_node; 955 struct device_node *np = pdev->dev.of_node;
957 const struct of_device_id *match; 956 const struct of_device_id *match;
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index a4f0c5e487d..498b2ba905d 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1246,7 +1246,7 @@ static void __iomem *sirfsoc_rsc_of_iomap(void)
1246 return of_iomap(np, 0); 1246 return of_iomap(np, 0);
1247} 1247}
1248 1248
1249static int __devinit sirfsoc_pinmux_probe(struct platform_device *pdev) 1249static int sirfsoc_pinmux_probe(struct platform_device *pdev)
1250{ 1250{
1251 int ret; 1251 int ret;
1252 struct sirfsoc_pmx *spmx; 1252 struct sirfsoc_pmx *spmx;
@@ -1663,7 +1663,45 @@ const struct irq_domain_ops sirfsoc_gpio_irq_simple_ops = {
1663 .xlate = irq_domain_xlate_twocell, 1663 .xlate = irq_domain_xlate_twocell,
1664}; 1664};
1665 1665
1666static int __devinit sirfsoc_gpio_probe(struct device_node *np) 1666static void sirfsoc_gpio_set_pullup(const u32 *pullups)
1667{
1668 int i, n;
1669 const unsigned long *p = (const unsigned long *)pullups;
1670
1671 for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
1672 n = find_first_bit(p + i, BITS_PER_LONG);
1673 while (n < BITS_PER_LONG) {
1674 u32 offset = SIRFSOC_GPIO_CTRL(i, n);
1675 u32 val = readl(sgpio_bank[i].chip.regs + offset);
1676 val |= SIRFSOC_GPIO_CTL_PULL_MASK;
1677 val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
1678 writel(val, sgpio_bank[i].chip.regs + offset);
1679
1680 n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
1681 }
1682 }
1683}
1684
1685static void sirfsoc_gpio_set_pulldown(const u32 *pulldowns)
1686{
1687 int i, n;
1688 const unsigned long *p = (const unsigned long *)pulldowns;
1689
1690 for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
1691 n = find_first_bit(p + i, BITS_PER_LONG);
1692 while (n < BITS_PER_LONG) {
1693 u32 offset = SIRFSOC_GPIO_CTRL(i, n);
1694 u32 val = readl(sgpio_bank[i].chip.regs + offset);
1695 val |= SIRFSOC_GPIO_CTL_PULL_MASK;
1696 val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
1697 writel(val, sgpio_bank[i].chip.regs + offset);
1698
1699 n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
1700 }
1701 }
1702}
1703
1704static int sirfsoc_gpio_probe(struct device_node *np)
1667{ 1705{
1668 int i, err = 0; 1706 int i, err = 0;
1669 struct sirfsoc_gpio_bank *bank; 1707 struct sirfsoc_gpio_bank *bank;
@@ -1671,6 +1709,8 @@ static int __devinit sirfsoc_gpio_probe(struct device_node *np)
1671 struct platform_device *pdev; 1709 struct platform_device *pdev;
1672 bool is_marco = false; 1710 bool is_marco = false;
1673 1711
1712 u32 pullups[SIRFSOC_GPIO_NO_OF_BANKS], pulldowns[SIRFSOC_GPIO_NO_OF_BANKS];
1713
1674 pdev = of_find_device_by_node(np); 1714 pdev = of_find_device_by_node(np);
1675 if (!pdev) 1715 if (!pdev)
1676 return -ENODEV; 1716 return -ENODEV;
@@ -1726,6 +1766,14 @@ static int __devinit sirfsoc_gpio_probe(struct device_node *np)
1726 irq_set_handler_data(bank->parent_irq, bank); 1766 irq_set_handler_data(bank->parent_irq, bank);
1727 } 1767 }
1728 1768
1769 if (!of_property_read_u32_array(np, "sirf,pullups", pullups,
1770 SIRFSOC_GPIO_NO_OF_BANKS))
1771 sirfsoc_gpio_set_pullup(pullups);
1772
1773 if (!of_property_read_u32_array(np, "sirf,pulldowns", pulldowns,
1774 SIRFSOC_GPIO_NO_OF_BANKS))
1775 sirfsoc_gpio_set_pulldown(pulldowns);
1776
1729 return 0; 1777 return 0;
1730 1778
1731out: 1779out:
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
index e356b0380fa..ae1e4bb3259 100644
--- a/drivers/pinctrl/pinctrl-tegra.c
+++ b/drivers/pinctrl/pinctrl-tegra.c
@@ -687,7 +687,7 @@ static struct pinctrl_desc tegra_pinctrl_desc = {
687 .owner = THIS_MODULE, 687 .owner = THIS_MODULE,
688}; 688};
689 689
690int __devinit tegra_pinctrl_probe(struct platform_device *pdev, 690int tegra_pinctrl_probe(struct platform_device *pdev,
691 const struct tegra_pinctrl_soc_data *soc_data) 691 const struct tegra_pinctrl_soc_data *soc_data)
692{ 692{
693 struct tegra_pmx *pmx; 693 struct tegra_pmx *pmx;
diff --git a/drivers/pinctrl/pinctrl-tegra20.c b/drivers/pinctrl/pinctrl-tegra20.c
index 1524bfd6660..e848189038f 100644
--- a/drivers/pinctrl/pinctrl-tegra20.c
+++ b/drivers/pinctrl/pinctrl-tegra20.c
@@ -2856,7 +2856,7 @@ static const struct tegra_pinctrl_soc_data tegra20_pinctrl = {
2856 .ngroups = ARRAY_SIZE(tegra20_groups), 2856 .ngroups = ARRAY_SIZE(tegra20_groups),
2857}; 2857};
2858 2858
2859static int __devinit tegra20_pinctrl_probe(struct platform_device *pdev) 2859static int tegra20_pinctrl_probe(struct platform_device *pdev)
2860{ 2860{
2861 return tegra_pinctrl_probe(pdev, &tegra20_pinctrl); 2861 return tegra_pinctrl_probe(pdev, &tegra20_pinctrl);
2862} 2862}
diff --git a/drivers/pinctrl/pinctrl-tegra30.c b/drivers/pinctrl/pinctrl-tegra30.c
index cf579ebf346..9ad87ea735d 100644
--- a/drivers/pinctrl/pinctrl-tegra30.c
+++ b/drivers/pinctrl/pinctrl-tegra30.c
@@ -3722,7 +3722,7 @@ static const struct tegra_pinctrl_soc_data tegra30_pinctrl = {
3722 .ngroups = ARRAY_SIZE(tegra30_groups), 3722 .ngroups = ARRAY_SIZE(tegra30_groups),
3723}; 3723};
3724 3724
3725static int __devinit tegra30_pinctrl_probe(struct platform_device *pdev) 3725static int tegra30_pinctrl_probe(struct platform_device *pdev)
3726{ 3726{
3727 return tegra_pinctrl_probe(pdev, &tegra30_pinctrl); 3727 return tegra_pinctrl_probe(pdev, &tegra30_pinctrl);
3728} 3728}
diff --git a/drivers/pinctrl/pinctrl-u300.c b/drivers/pinctrl/pinctrl-u300.c
index 8c039ad22ba..718ec576268 100644
--- a/drivers/pinctrl/pinctrl-u300.c
+++ b/drivers/pinctrl/pinctrl-u300.c
@@ -1062,7 +1062,7 @@ static struct pinctrl_desc u300_pmx_desc = {
1062 .owner = THIS_MODULE, 1062 .owner = THIS_MODULE,
1063}; 1063};
1064 1064
1065static int __devinit u300_pmx_probe(struct platform_device *pdev) 1065static int u300_pmx_probe(struct platform_device *pdev)
1066{ 1066{
1067 struct u300_pmx *upmx; 1067 struct u300_pmx *upmx;
1068 struct resource *res; 1068 struct resource *res;
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index ad90984ec50..5f0eb04c233 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -674,7 +674,7 @@ static const struct of_device_id xway_match[] = {
674}; 674};
675MODULE_DEVICE_TABLE(of, xway_match); 675MODULE_DEVICE_TABLE(of, xway_match);
676 676
677static int __devinit pinmux_xway_probe(struct platform_device *pdev) 677static int pinmux_xway_probe(struct platform_device *pdev)
678{ 678{
679 const struct of_device_id *match; 679 const struct of_device_id *match;
680 const struct pinctrl_xway_soc *xway_soc; 680 const struct pinctrl_xway_soc *xway_soc;
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 4c045053bbd..3cf4ecd9302 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -451,8 +451,7 @@ int spear310_o2p(int offset)
451 return offset + 2; 451 return offset + 2;
452} 452}
453 453
454static int __devinit plgpio_probe_dt(struct platform_device *pdev, 454static int plgpio_probe_dt(struct platform_device *pdev, struct plgpio *plgpio)
455 struct plgpio *plgpio)
456{ 455{
457 struct device_node *np = pdev->dev.of_node; 456 struct device_node *np = pdev->dev.of_node;
458 int ret = -EINVAL; 457 int ret = -EINVAL;
@@ -522,7 +521,7 @@ static int __devinit plgpio_probe_dt(struct platform_device *pdev,
522end: 521end:
523 return ret; 522 return ret;
524} 523}
525static int __devinit plgpio_probe(struct platform_device *pdev) 524static int plgpio_probe(struct platform_device *pdev)
526{ 525{
527 struct device_node *np = pdev->dev.of_node; 526 struct device_node *np = pdev->dev.of_node;
528 struct plgpio *plgpio; 527 struct plgpio *plgpio;
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index 922c057521a..6a7dae70db0 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -82,9 +82,8 @@ static int set_mode(struct spear_pmx *pmx, int mode)
82 return 0; 82 return 0;
83} 83}
84 84
85void __devinit 85void pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
86pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup, 86 unsigned count, u16 reg)
87 unsigned count, u16 reg)
88{ 87{
89 int i, j; 88 int i, j;
90 89
@@ -93,7 +92,7 @@ pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
93 gpio_pingroup[i].muxregs[j].reg = reg; 92 gpio_pingroup[i].muxregs[j].reg = reg;
94} 93}
95 94
96void __devinit pmx_init_addr(struct spear_pinctrl_machdata *machdata, u16 reg) 95void pmx_init_addr(struct spear_pinctrl_machdata *machdata, u16 reg)
97{ 96{
98 struct spear_pingroup *pgroup; 97 struct spear_pingroup *pgroup;
99 struct spear_modemux *modemux; 98 struct spear_modemux *modemux;
@@ -358,8 +357,8 @@ static struct pinctrl_desc spear_pinctrl_desc = {
358 .owner = THIS_MODULE, 357 .owner = THIS_MODULE,
359}; 358};
360 359
361int __devinit spear_pinctrl_probe(struct platform_device *pdev, 360int spear_pinctrl_probe(struct platform_device *pdev,
362 struct spear_pinctrl_machdata *machdata) 361 struct spear_pinctrl_machdata *machdata)
363{ 362{
364 struct device_node *np = pdev->dev.of_node; 363 struct device_node *np = pdev->dev.of_node;
365 struct resource *res; 364 struct resource *res;
diff --git a/drivers/pinctrl/spear/pinctrl-spear.h b/drivers/pinctrl/spear/pinctrl-spear.h
index 1be46ecc6d9..dc8bf85ecb2 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.h
+++ b/drivers/pinctrl/spear/pinctrl-spear.h
@@ -192,12 +192,11 @@ static inline void pmx_writel(struct spear_pmx *pmx, u32 val, u32 reg)
192 writel_relaxed(val, pmx->vbase + reg); 192 writel_relaxed(val, pmx->vbase + reg);
193} 193}
194 194
195void __devinit pmx_init_addr(struct spear_pinctrl_machdata *machdata, u16 reg); 195void pmx_init_addr(struct spear_pinctrl_machdata *machdata, u16 reg);
196void __devinit 196void pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
197pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup, 197 unsigned count, u16 reg);
198 unsigned count, u16 reg); 198int spear_pinctrl_probe(struct platform_device *pdev,
199int __devinit spear_pinctrl_probe(struct platform_device *pdev, 199 struct spear_pinctrl_machdata *machdata);
200 struct spear_pinctrl_machdata *machdata);
201int spear_pinctrl_remove(struct platform_device *pdev); 200int spear_pinctrl_remove(struct platform_device *pdev);
202 201
203#define SPEAR_PIN_0_TO_101 \ 202#define SPEAR_PIN_0_TO_101 \
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c
index e40d785a3fc..1a8bbfec60c 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1310.c
@@ -2699,7 +2699,7 @@ static struct of_device_id spear1310_pinctrl_of_match[] = {
2699 {}, 2699 {},
2700}; 2700};
2701 2701
2702static int __devinit spear1310_pinctrl_probe(struct platform_device *pdev) 2702static int spear1310_pinctrl_probe(struct platform_device *pdev)
2703{ 2703{
2704 return spear_pinctrl_probe(pdev, &spear1310_machdata); 2704 return spear_pinctrl_probe(pdev, &spear1310_machdata);
2705} 2705}
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c
index 8deaaff3156..873966e2b99 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1340.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1340.c
@@ -2015,7 +2015,7 @@ static struct of_device_id spear1340_pinctrl_of_match[] = {
2015 {}, 2015 {},
2016}; 2016};
2017 2017
2018static int __devinit spear1340_pinctrl_probe(struct platform_device *pdev) 2018static int spear1340_pinctrl_probe(struct platform_device *pdev)
2019{ 2019{
2020 return spear_pinctrl_probe(pdev, &spear1340_machdata); 2020 return spear_pinctrl_probe(pdev, &spear1340_machdata);
2021} 2021}
diff --git a/drivers/pinctrl/spear/pinctrl-spear300.c b/drivers/pinctrl/spear/pinctrl-spear300.c
index f48e466e605..4777c0d0e73 100644
--- a/drivers/pinctrl/spear/pinctrl-spear300.c
+++ b/drivers/pinctrl/spear/pinctrl-spear300.c
@@ -653,7 +653,7 @@ static struct of_device_id spear300_pinctrl_of_match[] = {
653 {}, 653 {},
654}; 654};
655 655
656static int __devinit spear300_pinctrl_probe(struct platform_device *pdev) 656static int spear300_pinctrl_probe(struct platform_device *pdev)
657{ 657{
658 int ret; 658 int ret;
659 659
diff --git a/drivers/pinctrl/spear/pinctrl-spear310.c b/drivers/pinctrl/spear/pinctrl-spear310.c
index 5b954c19a6d..06c7e6f1c7f 100644
--- a/drivers/pinctrl/spear/pinctrl-spear310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear310.c
@@ -378,7 +378,7 @@ static struct of_device_id spear310_pinctrl_of_match[] = {
378 {}, 378 {},
379}; 379};
380 380
381static int __devinit spear310_pinctrl_probe(struct platform_device *pdev) 381static int spear310_pinctrl_probe(struct platform_device *pdev)
382{ 382{
383 int ret; 383 int ret;
384 384
diff --git a/drivers/pinctrl/spear/pinctrl-spear320.c b/drivers/pinctrl/spear/pinctrl-spear320.c
index e9a5e6d3924..b8e290a8c8c 100644
--- a/drivers/pinctrl/spear/pinctrl-spear320.c
+++ b/drivers/pinctrl/spear/pinctrl-spear320.c
@@ -3417,7 +3417,7 @@ static struct of_device_id spear320_pinctrl_of_match[] = {
3417 {}, 3417 {},
3418}; 3418};
3419 3419
3420static int __devinit spear320_pinctrl_probe(struct platform_device *pdev) 3420static int spear320_pinctrl_probe(struct platform_device *pdev)
3421{ 3421{
3422 int ret; 3422 int ret;
3423 3423
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 934d861a323..afed7018a2b 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -125,8 +125,11 @@ static const struct key_entry acer_wmi_keymap[] = {
125 {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} }, 125 {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
126 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ 126 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
127 {KE_IGNORE, 0x81, {KEY_SLEEP} }, 127 {KE_IGNORE, 0x81, {KEY_SLEEP} },
128 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad On/Off */ 128 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */
129 {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} },
130 {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} },
129 {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} }, 131 {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
132 {KE_KEY, 0x85, {KEY_TOUCHPAD_TOGGLE} },
130 {KE_END, 0} 133 {KE_END, 0}
131}; 134};
132 135
@@ -147,6 +150,7 @@ struct event_return_value {
147#define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */ 150#define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */
148#define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */ 151#define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */
149#define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */ 152#define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */
153#define ACER_WMID3_GDS_TOUCHPAD (1<<1) /* Touchpad */
150 154
151struct lm_input_params { 155struct lm_input_params {
152 u8 function_num; /* Function Number */ 156 u8 function_num; /* Function Number */
@@ -335,7 +339,7 @@ static struct quirk_entry quirk_lenovo_ideapad_s205 = {
335}; 339};
336 340
337/* The Aspire One has a dummy ACPI-WMI interface - disable it */ 341/* The Aspire One has a dummy ACPI-WMI interface - disable it */
338static struct dmi_system_id __devinitdata acer_blacklist[] = { 342static struct dmi_system_id acer_blacklist[] = {
339 { 343 {
340 .ident = "Acer Aspire One (SSD)", 344 .ident = "Acer Aspire One (SSD)",
341 .matches = { 345 .matches = {
@@ -875,7 +879,7 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
875 struct acpi_buffer input = { (acpi_size) sizeof(u32), (void *)(&in) }; 879 struct acpi_buffer input = { (acpi_size) sizeof(u32), (void *)(&in) };
876 struct acpi_buffer result = { ACPI_ALLOCATE_BUFFER, NULL }; 880 struct acpi_buffer result = { ACPI_ALLOCATE_BUFFER, NULL };
877 union acpi_object *obj; 881 union acpi_object *obj;
878 u32 tmp; 882 u32 tmp = 0;
879 acpi_status status; 883 acpi_status status;
880 884
881 status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result); 885 status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result);
@@ -884,14 +888,14 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
884 return status; 888 return status;
885 889
886 obj = (union acpi_object *) result.pointer; 890 obj = (union acpi_object *) result.pointer;
887 if (obj && obj->type == ACPI_TYPE_BUFFER && 891 if (obj) {
888 (obj->buffer.length == sizeof(u32) || 892 if (obj->type == ACPI_TYPE_BUFFER &&
889 obj->buffer.length == sizeof(u64))) { 893 (obj->buffer.length == sizeof(u32) ||
890 tmp = *((u32 *) obj->buffer.pointer); 894 obj->buffer.length == sizeof(u64))) {
891 } else if (obj->type == ACPI_TYPE_INTEGER) { 895 tmp = *((u32 *) obj->buffer.pointer);
892 tmp = (u32) obj->integer.value; 896 } else if (obj->type == ACPI_TYPE_INTEGER) {
893 } else { 897 tmp = (u32) obj->integer.value;
894 tmp = 0; 898 }
895 } 899 }
896 900
897 if (out) 901 if (out)
@@ -1193,12 +1197,14 @@ static acpi_status WMID_set_capabilities(void)
1193 return status; 1197 return status;
1194 1198
1195 obj = (union acpi_object *) out.pointer; 1199 obj = (union acpi_object *) out.pointer;
1196 if (obj && obj->type == ACPI_TYPE_BUFFER && 1200 if (obj) {
1197 (obj->buffer.length == sizeof(u32) || 1201 if (obj->type == ACPI_TYPE_BUFFER &&
1198 obj->buffer.length == sizeof(u64))) { 1202 (obj->buffer.length == sizeof(u32) ||
1199 devices = *((u32 *) obj->buffer.pointer); 1203 obj->buffer.length == sizeof(u64))) {
1200 } else if (obj->type == ACPI_TYPE_INTEGER) { 1204 devices = *((u32 *) obj->buffer.pointer);
1201 devices = (u32) obj->integer.value; 1205 } else if (obj->type == ACPI_TYPE_INTEGER) {
1206 devices = (u32) obj->integer.value;
1207 }
1202 } else { 1208 } else {
1203 kfree(out.pointer); 1209 kfree(out.pointer);
1204 return AE_ERROR; 1210 return AE_ERROR;
@@ -1330,7 +1336,7 @@ static struct led_classdev mail_led = {
1330 .brightness_set = mail_led_set, 1336 .brightness_set = mail_led_set,
1331}; 1337};
1332 1338
1333static int __devinit acer_led_init(struct device *dev) 1339static int acer_led_init(struct device *dev)
1334{ 1340{
1335 return led_classdev_register(dev, &mail_led); 1341 return led_classdev_register(dev, &mail_led);
1336} 1342}
@@ -1372,7 +1378,7 @@ static const struct backlight_ops acer_bl_ops = {
1372 .update_status = update_bl_status, 1378 .update_status = update_bl_status,
1373}; 1379};
1374 1380
1375static int __devinit acer_backlight_init(struct device *dev) 1381static int acer_backlight_init(struct device *dev)
1376{ 1382{
1377 struct backlight_properties props; 1383 struct backlight_properties props;
1378 struct backlight_device *bd; 1384 struct backlight_device *bd;
@@ -1676,6 +1682,7 @@ static void acer_wmi_notify(u32 value, void *context)
1676 acpi_status status; 1682 acpi_status status;
1677 u16 device_state; 1683 u16 device_state;
1678 const struct key_entry *key; 1684 const struct key_entry *key;
1685 u32 scancode;
1679 1686
1680 status = wmi_get_event_data(value, &response); 1687 status = wmi_get_event_data(value, &response);
1681 if (status != AE_OK) { 1688 if (status != AE_OK) {
@@ -1712,6 +1719,7 @@ static void acer_wmi_notify(u32 value, void *context)
1712 pr_warn("Unknown key number - 0x%x\n", 1719 pr_warn("Unknown key number - 0x%x\n",
1713 return_value.key_num); 1720 return_value.key_num);
1714 } else { 1721 } else {
1722 scancode = return_value.key_num;
1715 switch (key->keycode) { 1723 switch (key->keycode) {
1716 case KEY_WLAN: 1724 case KEY_WLAN:
1717 case KEY_BLUETOOTH: 1725 case KEY_BLUETOOTH:
@@ -1725,9 +1733,11 @@ static void acer_wmi_notify(u32 value, void *context)
1725 rfkill_set_sw_state(bluetooth_rfkill, 1733 rfkill_set_sw_state(bluetooth_rfkill,
1726 !(device_state & ACER_WMID3_GDS_BLUETOOTH)); 1734 !(device_state & ACER_WMID3_GDS_BLUETOOTH));
1727 break; 1735 break;
1736 case KEY_TOUCHPAD_TOGGLE:
1737 scancode = (device_state & ACER_WMID3_GDS_TOUCHPAD) ?
1738 KEY_TOUCHPAD_ON : KEY_TOUCHPAD_OFF;
1728 } 1739 }
1729 sparse_keymap_report_entry(acer_wmi_input_dev, key, 1740 sparse_keymap_report_event(acer_wmi_input_dev, scancode, 1, true);
1730 1, true);
1731 } 1741 }
1732 break; 1742 break;
1733 case WMID_ACCEL_EVENT: 1743 case WMID_ACCEL_EVENT:
@@ -1946,12 +1956,14 @@ static u32 get_wmid_devices(void)
1946 return 0; 1956 return 0;
1947 1957
1948 obj = (union acpi_object *) out.pointer; 1958 obj = (union acpi_object *) out.pointer;
1949 if (obj && obj->type == ACPI_TYPE_BUFFER && 1959 if (obj) {
1950 (obj->buffer.length == sizeof(u32) || 1960 if (obj->type == ACPI_TYPE_BUFFER &&
1951 obj->buffer.length == sizeof(u64))) { 1961 (obj->buffer.length == sizeof(u32) ||
1952 devices = *((u32 *) obj->buffer.pointer); 1962 obj->buffer.length == sizeof(u64))) {
1953 } else if (obj->type == ACPI_TYPE_INTEGER) { 1963 devices = *((u32 *) obj->buffer.pointer);
1954 devices = (u32) obj->integer.value; 1964 } else if (obj->type == ACPI_TYPE_INTEGER) {
1965 devices = (u32) obj->integer.value;
1966 }
1955 } 1967 }
1956 1968
1957 kfree(out.pointer); 1969 kfree(out.pointer);
@@ -1961,7 +1973,7 @@ static u32 get_wmid_devices(void)
1961/* 1973/*
1962 * Platform device 1974 * Platform device
1963 */ 1975 */
1964static int __devinit acer_platform_probe(struct platform_device *device) 1976static int acer_platform_probe(struct platform_device *device)
1965{ 1977{
1966 int err; 1978 int err;
1967 1979
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index c2e3e63d2c1..f94467c0522 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -515,7 +515,7 @@ static int acerhdf_suspend(struct device *dev)
515 return 0; 515 return 0;
516} 516}
517 517
518static int __devinit acerhdf_probe(struct platform_device *device) 518static int acerhdf_probe(struct platform_device *device)
519{ 519{
520 return 0; 520 return 0;
521} 521}
diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c
index 1deca7f6c4e..6296f078b7b 100644
--- a/drivers/platform/x86/amilo-rfkill.c
+++ b/drivers/platform/x86/amilo-rfkill.c
@@ -74,7 +74,7 @@ static const struct rfkill_ops amilo_m7440_rfkill_ops = {
74 .set_block = amilo_m7440_rfkill_set_block 74 .set_block = amilo_m7440_rfkill_set_block
75}; 75};
76 76
77static const struct dmi_system_id __devinitconst amilo_rfkill_id_table[] = { 77static const struct dmi_system_id amilo_rfkill_id_table[] = {
78 { 78 {
79 .matches = { 79 .matches = {
80 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 80 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
@@ -95,7 +95,7 @@ static const struct dmi_system_id __devinitconst amilo_rfkill_id_table[] = {
95static struct platform_device *amilo_rfkill_pdev; 95static struct platform_device *amilo_rfkill_pdev;
96static struct rfkill *amilo_rfkill_dev; 96static struct rfkill *amilo_rfkill_dev;
97 97
98static int __devinit amilo_rfkill_probe(struct platform_device *device) 98static int amilo_rfkill_probe(struct platform_device *device)
99{ 99{
100 int rc; 100 int rc;
101 const struct dmi_system_id *system_id = 101 const struct dmi_system_id *system_id =
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index db8f63841b4..f74bfcbb7ba 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -411,8 +411,7 @@ static int gmux_resume(struct pnp_dev *pnp)
411 return 0; 411 return 0;
412} 412}
413 413
414static int __devinit gmux_probe(struct pnp_dev *pnp, 414static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
415 const struct pnp_device_id *id)
416{ 415{
417 struct apple_gmux_data *gmux_data; 416 struct apple_gmux_data *gmux_data;
418 struct resource *res; 417 struct resource *res;
@@ -577,7 +576,7 @@ err_free:
577 return ret; 576 return ret;
578} 577}
579 578
580static void __devexit gmux_remove(struct pnp_dev *pnp) 579static void gmux_remove(struct pnp_dev *pnp)
581{ 580{
582 struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); 581 struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp);
583 582
@@ -609,7 +608,7 @@ static const struct pnp_device_id gmux_device_ids[] = {
609static struct pnp_driver gmux_pnp_driver = { 608static struct pnp_driver gmux_pnp_driver = {
610 .name = "apple-gmux", 609 .name = "apple-gmux",
611 .probe = gmux_probe, 610 .probe = gmux_probe,
612 .remove = __devexit_p(gmux_remove), 611 .remove = gmux_remove,
613 .id_table = gmux_device_ids, 612 .id_table = gmux_device_ids,
614 .suspend = gmux_suspend, 613 .suspend = gmux_suspend,
615 .resume = gmux_resume 614 .resume = gmux_resume
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 4b568df5664..fcde4e52881 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -860,8 +860,10 @@ static ssize_t show_infos(struct device *dev,
860 /* 860 /*
861 * The HWRS method return informations about the hardware. 861 * The HWRS method return informations about the hardware.
862 * 0x80 bit is for WLAN, 0x100 for Bluetooth. 862 * 0x80 bit is for WLAN, 0x100 for Bluetooth.
863 * 0x40 for WWAN, 0x10 for WIMAX.
863 * The significance of others is yet to be found. 864 * The significance of others is yet to be found.
864 * If we don't find the method, we assume the device are present. 865 * We don't currently use this for device detection, and it
866 * takes several seconds to run on some systems.
865 */ 867 */
866 rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp); 868 rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp);
867 if (!ACPI_FAILURE(rv)) 869 if (!ACPI_FAILURE(rv))
@@ -1682,7 +1684,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
1682{ 1684{
1683 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 1685 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
1684 union acpi_object *model = NULL; 1686 union acpi_object *model = NULL;
1685 unsigned long long bsts_result, hwrs_result; 1687 unsigned long long bsts_result;
1686 char *string = NULL; 1688 char *string = NULL;
1687 acpi_status status; 1689 acpi_status status;
1688 1690
@@ -1741,20 +1743,9 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
1741 return -ENOMEM; 1743 return -ENOMEM;
1742 } 1744 }
1743 1745
1744 if (*string) 1746 if (string)
1745 pr_notice(" %s model detected\n", string); 1747 pr_notice(" %s model detected\n", string);
1746 1748
1747 /*
1748 * The HWRS method return informations about the hardware.
1749 * 0x80 bit is for WLAN, 0x100 for Bluetooth,
1750 * 0x40 for WWAN, 0x10 for WIMAX.
1751 * The significance of others is yet to be found.
1752 */
1753 status =
1754 acpi_evaluate_integer(asus->handle, "HWRS", NULL, &hwrs_result);
1755 if (!ACPI_FAILURE(status))
1756 pr_notice(" HWRS returned %x", (int)hwrs_result);
1757
1758 if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL)) 1749 if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL))
1759 asus->have_rsts = true; 1750 asus->have_rsts = true;
1760 1751
@@ -1763,7 +1754,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
1763 return AE_OK; 1754 return AE_OK;
1764} 1755}
1765 1756
1766static int __devinit asus_acpi_init(struct asus_laptop *asus) 1757static int asus_acpi_init(struct asus_laptop *asus)
1767{ 1758{
1768 int result = 0; 1759 int result = 0;
1769 1760
@@ -1823,7 +1814,7 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
1823 return result; 1814 return result;
1824} 1815}
1825 1816
1826static void __devinit asus_dmi_check(void) 1817static void asus_dmi_check(void)
1827{ 1818{
1828 const char *model; 1819 const char *model;
1829 1820
@@ -1839,7 +1830,7 @@ static void __devinit asus_dmi_check(void)
1839 1830
1840static bool asus_device_present; 1831static bool asus_device_present;
1841 1832
1842static int __devinit asus_acpi_add(struct acpi_device *device) 1833static int asus_acpi_add(struct acpi_device *device)
1843{ 1834{
1844 struct asus_laptop *asus; 1835 struct asus_laptop *asus;
1845 int result; 1836 int result;
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 1887e2f166a..475cc524251 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -713,15 +713,15 @@ static struct attribute_group compal_attribute_group = {
713 .attrs = compal_attributes 713 .attrs = compal_attributes
714}; 714};
715 715
716static int __devinit compal_probe(struct platform_device *); 716static int compal_probe(struct platform_device *);
717static int __devexit compal_remove(struct platform_device *); 717static int compal_remove(struct platform_device *);
718static struct platform_driver compal_driver = { 718static struct platform_driver compal_driver = {
719 .driver = { 719 .driver = {
720 .name = DRIVER_NAME, 720 .name = DRIVER_NAME,
721 .owner = THIS_MODULE, 721 .owner = THIS_MODULE,
722 }, 722 },
723 .probe = compal_probe, 723 .probe = compal_probe,
724 .remove = __devexit_p(compal_remove) 724 .remove = compal_remove,
725}; 725};
726 726
727static enum power_supply_property compal_bat_properties[] = { 727static enum power_supply_property compal_bat_properties[] = {
@@ -1015,7 +1015,7 @@ err_backlight:
1015 return ret; 1015 return ret;
1016} 1016}
1017 1017
1018static int __devinit compal_probe(struct platform_device *pdev) 1018static int compal_probe(struct platform_device *pdev)
1019{ 1019{
1020 int err; 1020 int err;
1021 struct compal_data *data; 1021 struct compal_data *data;
@@ -1067,7 +1067,7 @@ static void __exit compal_cleanup(void)
1067 pr_info("Driver unloaded\n"); 1067 pr_info("Driver unloaded\n");
1068} 1068}
1069 1069
1070static int __devexit compal_remove(struct platform_device *pdev) 1070static int compal_remove(struct platform_device *pdev)
1071{ 1071{
1072 struct compal_data *data; 1072 struct compal_data *data;
1073 1073
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 927c33af67e..fa3ee620957 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -115,7 +115,7 @@ static const struct dmi_system_id dell_device_table[] __initconst = {
115}; 115};
116MODULE_DEVICE_TABLE(dmi, dell_device_table); 116MODULE_DEVICE_TABLE(dmi, dell_device_table);
117 117
118static struct dmi_system_id __devinitdata dell_quirks[] = { 118static struct dmi_system_id dell_quirks[] = {
119 { 119 {
120 .callback = dmi_matched, 120 .callback = dmi_matched,
121 .ident = "Dell Vostro V130", 121 .ident = "Dell Vostro V130",
@@ -503,7 +503,7 @@ static struct led_classdev touchpad_led = {
503 .flags = LED_CORE_SUSPENDRESUME, 503 .flags = LED_CORE_SUSPENDRESUME,
504}; 504};
505 505
506static int __devinit touchpad_led_init(struct device *dev) 506static int touchpad_led_init(struct device *dev)
507{ 507{
508 return led_classdev_register(dev, &touchpad_led); 508 return led_classdev_register(dev, &touchpad_led);
509} 509}
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 5ca264179f4..528e9495458 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1375,7 +1375,7 @@ static void cmsg_quirks(struct eeepc_laptop *eeepc)
1375 cmsg_quirk(eeepc, CM_ASL_TPD, "TPD"); 1375 cmsg_quirk(eeepc, CM_ASL_TPD, "TPD");
1376} 1376}
1377 1377
1378static int __devinit eeepc_acpi_init(struct eeepc_laptop *eeepc) 1378static int eeepc_acpi_init(struct eeepc_laptop *eeepc)
1379{ 1379{
1380 unsigned int init_flags; 1380 unsigned int init_flags;
1381 int result; 1381 int result;
@@ -1407,7 +1407,7 @@ static int __devinit eeepc_acpi_init(struct eeepc_laptop *eeepc)
1407 return 0; 1407 return 0;
1408} 1408}
1409 1409
1410static void __devinit eeepc_enable_camera(struct eeepc_laptop *eeepc) 1410static void eeepc_enable_camera(struct eeepc_laptop *eeepc)
1411{ 1411{
1412 /* 1412 /*
1413 * If the following call to set_acpi() fails, it's because there's no 1413 * If the following call to set_acpi() fails, it's because there's no
@@ -1419,7 +1419,7 @@ static void __devinit eeepc_enable_camera(struct eeepc_laptop *eeepc)
1419 1419
1420static bool eeepc_device_present; 1420static bool eeepc_device_present;
1421 1421
1422static int __devinit eeepc_acpi_add(struct acpi_device *device) 1422static int eeepc_acpi_add(struct acpi_device *device)
1423{ 1423{
1424 struct eeepc_laptop *eeepc; 1424 struct eeepc_laptop *eeepc;
1425 int result; 1425 int result;
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index f77484528b1..174ca01c4aa 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -192,8 +192,8 @@ static void fujitsu_reset(void)
192 fujitsu_send_state(); 192 fujitsu_send_state();
193} 193}
194 194
195static int __devinit input_fujitsu_setup(struct device *parent, 195static int input_fujitsu_setup(struct device *parent, const char *name,
196 const char *name, const char *phys) 196 const char *phys)
197{ 197{
198 struct input_dev *idev; 198 struct input_dev *idev;
199 int error; 199 int error;
@@ -277,21 +277,21 @@ static irqreturn_t fujitsu_interrupt(int irq, void *dev_id)
277 return IRQ_HANDLED; 277 return IRQ_HANDLED;
278} 278}
279 279
280static void __devinit fujitsu_dmi_common(const struct dmi_system_id *dmi) 280static void fujitsu_dmi_common(const struct dmi_system_id *dmi)
281{ 281{
282 pr_info("%s\n", dmi->ident); 282 pr_info("%s\n", dmi->ident);
283 memcpy(fujitsu.config.keymap, dmi->driver_data, 283 memcpy(fujitsu.config.keymap, dmi->driver_data,
284 sizeof(fujitsu.config.keymap)); 284 sizeof(fujitsu.config.keymap));
285} 285}
286 286
287static int __devinit fujitsu_dmi_lifebook(const struct dmi_system_id *dmi) 287static int fujitsu_dmi_lifebook(const struct dmi_system_id *dmi)
288{ 288{
289 fujitsu_dmi_common(dmi); 289 fujitsu_dmi_common(dmi);
290 fujitsu.config.quirks |= INVERT_TABLET_MODE_BIT; 290 fujitsu.config.quirks |= INVERT_TABLET_MODE_BIT;
291 return 1; 291 return 1;
292} 292}
293 293
294static int __devinit fujitsu_dmi_stylistic(const struct dmi_system_id *dmi) 294static int fujitsu_dmi_stylistic(const struct dmi_system_id *dmi)
295{ 295{
296 fujitsu_dmi_common(dmi); 296 fujitsu_dmi_common(dmi);
297 fujitsu.config.quirks |= FORCE_TABLET_MODE_IF_UNDOCK; 297 fujitsu.config.quirks |= FORCE_TABLET_MODE_IF_UNDOCK;
@@ -366,8 +366,7 @@ static const struct dmi_system_id dmi_ids[] __initconst = {
366 { NULL } 366 { NULL }
367}; 367};
368 368
369static acpi_status __devinit 369static acpi_status fujitsu_walk_resources(struct acpi_resource *res, void *data)
370fujitsu_walk_resources(struct acpi_resource *res, void *data)
371{ 370{
372 switch (res->type) { 371 switch (res->type) {
373 case ACPI_RESOURCE_TYPE_IRQ: 372 case ACPI_RESOURCE_TYPE_IRQ:
@@ -390,7 +389,7 @@ fujitsu_walk_resources(struct acpi_resource *res, void *data)
390 } 389 }
391} 390}
392 391
393static int __devinit acpi_fujitsu_add(struct acpi_device *adev) 392static int acpi_fujitsu_add(struct acpi_device *adev)
394{ 393{
395 acpi_status status; 394 acpi_status status;
396 int error; 395 int error;
@@ -432,7 +431,7 @@ static int __devinit acpi_fujitsu_add(struct acpi_device *adev)
432 return 0; 431 return 0;
433} 432}
434 433
435static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type) 434static int acpi_fujitsu_remove(struct acpi_device *adev, int type)
436{ 435{
437 free_irq(fujitsu.irq, fujitsu_interrupt); 436 free_irq(fujitsu.irq, fujitsu_interrupt);
438 release_region(fujitsu.io_base, fujitsu.io_length); 437 release_region(fujitsu.io_base, fujitsu.io_length);
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 387183a2d6d..1dde7accf27 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -72,7 +72,7 @@ enum hp_wmi_event_ids {
72 HPWMI_LOCK_SWITCH = 7, 72 HPWMI_LOCK_SWITCH = 7,
73}; 73};
74 74
75static int __devinit hp_wmi_bios_setup(struct platform_device *device); 75static int hp_wmi_bios_setup(struct platform_device *device);
76static int __exit hp_wmi_bios_remove(struct platform_device *device); 76static int __exit hp_wmi_bios_remove(struct platform_device *device);
77static int hp_wmi_resume_handler(struct device *device); 77static int hp_wmi_resume_handler(struct device *device);
78 78
@@ -619,7 +619,7 @@ static void cleanup_sysfs(struct platform_device *device)
619 device_remove_file(&device->dev, &dev_attr_tablet); 619 device_remove_file(&device->dev, &dev_attr_tablet);
620} 620}
621 621
622static int __devinit hp_wmi_rfkill_setup(struct platform_device *device) 622static int hp_wmi_rfkill_setup(struct platform_device *device)
623{ 623{
624 int err; 624 int err;
625 int wireless = 0; 625 int wireless = 0;
@@ -698,7 +698,7 @@ register_wifi_error:
698 return err; 698 return err;
699} 699}
700 700
701static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) 701static int hp_wmi_rfkill2_setup(struct platform_device *device)
702{ 702{
703 int err, i; 703 int err, i;
704 struct bios_rfkill2_state state; 704 struct bios_rfkill2_state state;
@@ -778,7 +778,7 @@ fail:
778 return err; 778 return err;
779} 779}
780 780
781static int __devinit hp_wmi_bios_setup(struct platform_device *device) 781static int hp_wmi_bios_setup(struct platform_device *device)
782{ 782{
783 int err; 783 int err;
784 784
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 5ff4f2e314d..64bfb30a52e 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -298,7 +298,7 @@ static const struct file_operations debugfs_cfg_fops = {
298 .release = single_release, 298 .release = single_release,
299}; 299};
300 300
301static int __devinit ideapad_debugfs_init(struct ideapad_private *priv) 301static int ideapad_debugfs_init(struct ideapad_private *priv)
302{ 302{
303 struct dentry *node; 303 struct dentry *node;
304 304
@@ -468,8 +468,7 @@ static void ideapad_sync_rfk_state(struct ideapad_private *priv)
468 rfkill_set_hw_state(priv->rfk[i], hw_blocked); 468 rfkill_set_hw_state(priv->rfk[i], hw_blocked);
469} 469}
470 470
471static int __devinit ideapad_register_rfkill(struct acpi_device *adevice, 471static int ideapad_register_rfkill(struct acpi_device *adevice, int dev)
472 int dev)
473{ 472{
474 struct ideapad_private *priv = dev_get_drvdata(&adevice->dev); 473 struct ideapad_private *priv = dev_get_drvdata(&adevice->dev);
475 int ret; 474 int ret;
@@ -519,7 +518,7 @@ static void ideapad_unregister_rfkill(struct acpi_device *adevice, int dev)
519/* 518/*
520 * Platform device 519 * Platform device
521 */ 520 */
522static int __devinit ideapad_platform_init(struct ideapad_private *priv) 521static int ideapad_platform_init(struct ideapad_private *priv)
523{ 522{
524 int result; 523 int result;
525 524
@@ -569,7 +568,7 @@ static const struct key_entry ideapad_keymap[] = {
569 { KE_END, 0 }, 568 { KE_END, 0 },
570}; 569};
571 570
572static int __devinit ideapad_input_init(struct ideapad_private *priv) 571static int ideapad_input_init(struct ideapad_private *priv)
573{ 572{
574 struct input_dev *inputdev; 573 struct input_dev *inputdev;
575 int error; 574 int error;
@@ -776,7 +775,7 @@ static void ideapad_sync_touchpad_state(struct acpi_device *adevice)
776 } 775 }
777} 776}
778 777
779static int __devinit ideapad_acpi_add(struct acpi_device *adevice) 778static int ideapad_acpi_add(struct acpi_device *adevice)
780{ 779{
781 int ret, i; 780 int ret, i;
782 int cfg; 781 int cfg;
@@ -835,7 +834,7 @@ platform_failed:
835 return ret; 834 return ret;
836} 835}
837 836
838static int __devexit ideapad_acpi_remove(struct acpi_device *adevice, int type) 837static int ideapad_acpi_remove(struct acpi_device *adevice, int type)
839{ 838{
840 struct ideapad_private *priv = dev_get_drvdata(&adevice->dev); 839 struct ideapad_private *priv = dev_get_drvdata(&adevice->dev);
841 int i; 840 int i;
diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c
index bcbad8452a6..f59683aa13d 100644
--- a/drivers/platform/x86/intel_mid_powerbtn.c
+++ b/drivers/platform/x86/intel_mid_powerbtn.c
@@ -56,7 +56,7 @@ static irqreturn_t mfld_pb_isr(int irq, void *dev_id)
56 return IRQ_HANDLED; 56 return IRQ_HANDLED;
57} 57}
58 58
59static int __devinit mfld_pb_probe(struct platform_device *pdev) 59static int mfld_pb_probe(struct platform_device *pdev)
60{ 60{
61 struct input_dev *input; 61 struct input_dev *input;
62 int irq = platform_get_irq(pdev, 0); 62 int irq = platform_get_irq(pdev, 0);
@@ -121,7 +121,7 @@ err_free_input:
121 return error; 121 return error;
122} 122}
123 123
124static int __devexit mfld_pb_remove(struct platform_device *pdev) 124static int mfld_pb_remove(struct platform_device *pdev)
125{ 125{
126 struct input_dev *input = platform_get_drvdata(pdev); 126 struct input_dev *input = platform_get_drvdata(pdev);
127 int irq = platform_get_irq(pdev, 0); 127 int irq = platform_get_irq(pdev, 0);
@@ -139,7 +139,7 @@ static struct platform_driver mfld_pb_driver = {
139 .owner = THIS_MODULE, 139 .owner = THIS_MODULE,
140 }, 140 },
141 .probe = mfld_pb_probe, 141 .probe = mfld_pb_probe,
142 .remove = __devexit_p(mfld_pb_remove), 142 .remove = mfld_pb_remove,
143}; 143};
144 144
145module_platform_driver(mfld_pb_driver); 145module_platform_driver(mfld_pb_driver);
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c
index 93de09019d1..81c491e74b3 100644
--- a/drivers/platform/x86/intel_mid_thermal.c
+++ b/drivers/platform/x86/intel_mid_thermal.c
@@ -563,7 +563,7 @@ static struct platform_driver mid_thermal_driver = {
563 .pm = &mid_thermal_pm, 563 .pm = &mid_thermal_pm,
564 }, 564 },
565 .probe = mid_thermal_probe, 565 .probe = mid_thermal_probe,
566 .remove = __devexit_p(mid_thermal_remove), 566 .remove = mid_thermal_remove,
567 .id_table = therm_id_table, 567 .id_table = therm_id_table,
568}; 568};
569 569
diff --git a/drivers/platform/x86/intel_oaktrail.c b/drivers/platform/x86/intel_oaktrail.c
index 79a0c2f6be5..f6f18cde0f1 100644
--- a/drivers/platform/x86/intel_oaktrail.c
+++ b/drivers/platform/x86/intel_oaktrail.c
@@ -278,12 +278,12 @@ static void oaktrail_backlight_exit(void)
278 backlight_device_unregister(oaktrail_bl_device); 278 backlight_device_unregister(oaktrail_bl_device);
279} 279}
280 280
281static int __devinit oaktrail_probe(struct platform_device *pdev) 281static int oaktrail_probe(struct platform_device *pdev)
282{ 282{
283 return 0; 283 return 0;
284} 284}
285 285
286static int __devexit oaktrail_remove(struct platform_device *pdev) 286static int oaktrail_remove(struct platform_device *pdev)
287{ 287{
288 return 0; 288 return 0;
289} 289}
@@ -294,7 +294,7 @@ static struct platform_driver oaktrail_driver = {
294 .owner = THIS_MODULE, 294 .owner = THIS_MODULE,
295 }, 295 },
296 .probe = oaktrail_probe, 296 .probe = oaktrail_probe,
297 .remove = __devexit_p(oaktrail_remove) 297 .remove = oaktrail_remove,
298}; 298};
299 299
300static int dmi_check_cb(const struct dmi_system_id *id) 300static int dmi_check_cb(const struct dmi_system_id *id)
diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c
index 1686c1e07d5..6f4b7289a05 100644
--- a/drivers/platform/x86/intel_pmic_gpio.c
+++ b/drivers/platform/x86/intel_pmic_gpio.c
@@ -230,7 +230,7 @@ static irqreturn_t pmic_irq_handler(int irq, void *data)
230 return ret; 230 return ret;
231} 231}
232 232
233static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) 233static int platform_pmic_gpio_probe(struct platform_device *pdev)
234{ 234{
235 struct device *dev = &pdev->dev; 235 struct device *dev = &pdev->dev;
236 int irq = platform_get_irq(pdev, 0); 236 int irq = platform_get_irq(pdev, 0);
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index dd90d15f521..71623a2ff3e 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -1523,6 +1523,16 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = {
1523 }, 1523 },
1524 .driver_data = &samsung_broken_acpi_video, 1524 .driver_data = &samsung_broken_acpi_video,
1525 }, 1525 },
1526 {
1527 .callback = samsung_dmi_matched,
1528 .ident = "N250P",
1529 .matches = {
1530 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1531 DMI_MATCH(DMI_PRODUCT_NAME, "N250P"),
1532 DMI_MATCH(DMI_BOARD_NAME, "N250P"),
1533 },
1534 .driver_data = &samsung_broken_acpi_video,
1535 },
1526 { }, 1536 { },
1527}; 1537};
1528MODULE_DEVICE_TABLE(dmi, samsung_dmi_table); 1538MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
diff --git a/drivers/platform/x86/samsung-q10.c b/drivers/platform/x86/samsung-q10.c
index 1e54ae74274..5f770059fd4 100644
--- a/drivers/platform/x86/samsung-q10.c
+++ b/drivers/platform/x86/samsung-q10.c
@@ -77,7 +77,7 @@ static int samsungq10_resume(struct device *dev)
77static SIMPLE_DEV_PM_OPS(samsungq10_pm_ops, 77static SIMPLE_DEV_PM_OPS(samsungq10_pm_ops,
78 samsungq10_suspend, samsungq10_resume); 78 samsungq10_suspend, samsungq10_resume);
79 79
80static int __devinit samsungq10_probe(struct platform_device *pdev) 80static int samsungq10_probe(struct platform_device *pdev)
81{ 81{
82 82
83 struct backlight_properties props; 83 struct backlight_properties props;
@@ -99,7 +99,7 @@ static int __devinit samsungq10_probe(struct platform_device *pdev)
99 return 0; 99 return 0;
100} 100}
101 101
102static int __devexit samsungq10_remove(struct platform_device *pdev) 102static int samsungq10_remove(struct platform_device *pdev)
103{ 103{
104 104
105 struct backlight_device *bd = platform_get_drvdata(pdev); 105 struct backlight_device *bd = platform_get_drvdata(pdev);
@@ -119,7 +119,7 @@ static struct platform_driver samsungq10_driver = {
119 .pm = &samsungq10_pm_ops, 119 .pm = &samsungq10_pm_ops,
120 }, 120 },
121 .probe = samsungq10_probe, 121 .probe = samsungq10_probe,
122 .remove = __devexit_p(samsungq10_remove), 122 .remove = samsungq10_remove,
123}; 123};
124 124
125static struct platform_device *samsungq10_device; 125static struct platform_device *samsungq10_device;
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index daaddec68de..b8ad71f7863 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -786,28 +786,29 @@ static int sony_nc_int_call(acpi_handle handle, char *name, int *value,
786static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value, 786static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
787 void *buffer, size_t buflen) 787 void *buffer, size_t buflen)
788{ 788{
789 int ret = 0;
789 size_t len = len; 790 size_t len = len;
790 union acpi_object *object = __call_snc_method(handle, name, value); 791 union acpi_object *object = __call_snc_method(handle, name, value);
791 792
792 if (!object) 793 if (!object)
793 return -EINVAL; 794 return -EINVAL;
794 795
795 if (object->type == ACPI_TYPE_BUFFER) 796 if (object->type == ACPI_TYPE_BUFFER) {
796 len = MIN(buflen, object->buffer.length); 797 len = MIN(buflen, object->buffer.length);
798 memcpy(buffer, object->buffer.pointer, len);
797 799
798 else if (object->type == ACPI_TYPE_INTEGER) 800 } else if (object->type == ACPI_TYPE_INTEGER) {
799 len = MIN(buflen, sizeof(object->integer.value)); 801 len = MIN(buflen, sizeof(object->integer.value));
802 memcpy(buffer, &object->integer.value, len);
800 803
801 else { 804 } else {
802 pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n", 805 pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n",
803 ACPI_TYPE_BUFFER, object->type); 806 ACPI_TYPE_BUFFER, object->type);
804 kfree(object); 807 ret = -EINVAL;
805 return -EINVAL;
806 } 808 }
807 809
808 memcpy(buffer, object->buffer.pointer, len);
809 kfree(object); 810 kfree(object);
810 return 0; 811 return ret;
811} 812}
812 813
813struct sony_nc_handles { 814struct sony_nc_handles {
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
index e24f5ae475a..9b93fdb61ed 100644
--- a/drivers/platform/x86/tc1100-wmi.c
+++ b/drivers/platform/x86/tc1100-wmi.c
@@ -187,7 +187,7 @@ static int __init tc1100_probe(struct platform_device *device)
187} 187}
188 188
189 189
190static int __devexit tc1100_remove(struct platform_device *device) 190static int tc1100_remove(struct platform_device *device)
191{ 191{
192 sysfs_remove_group(&device->dev.kobj, &tc1100_attribute_group); 192 sysfs_remove_group(&device->dev.kobj, &tc1100_attribute_group);
193 193
@@ -241,7 +241,7 @@ static struct platform_driver tc1100_driver = {
241 .pm = &tc1100_pm_ops, 241 .pm = &tc1100_pm_ops,
242#endif 242#endif
243 }, 243 },
244 .remove = __devexit_p(tc1100_remove), 244 .remove = tc1100_remove,
245}; 245};
246 246
247static int __init tc1100_init(void) 247static int __init tc1100_init(void)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 75dd651664a..f946ca7cb76 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6732,7 +6732,7 @@ static int volume_alsa_mute_put(struct snd_kcontrol *kcontrol,
6732 return volume_alsa_set_mute(!ucontrol->value.integer.value[0]); 6732 return volume_alsa_set_mute(!ucontrol->value.integer.value[0]);
6733} 6733}
6734 6734
6735static struct snd_kcontrol_new volume_alsa_control_vol __devinitdata = { 6735static struct snd_kcontrol_new volume_alsa_control_vol = {
6736 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6736 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
6737 .name = "Console Playback Volume", 6737 .name = "Console Playback Volume",
6738 .index = 0, 6738 .index = 0,
@@ -6741,7 +6741,7 @@ static struct snd_kcontrol_new volume_alsa_control_vol __devinitdata = {
6741 .get = volume_alsa_vol_get, 6741 .get = volume_alsa_vol_get,
6742}; 6742};
6743 6743
6744static struct snd_kcontrol_new volume_alsa_control_mute __devinitdata = { 6744static struct snd_kcontrol_new volume_alsa_control_mute = {
6745 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6745 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
6746 .name = "Console Playback Switch", 6746 .name = "Console Playback Switch",
6747 .index = 0, 6747 .index = 0,
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 5f1256d5e93..c2727895794 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -150,7 +150,7 @@ static const struct acpi_device_id toshiba_device_ids[] = {
150}; 150};
151MODULE_DEVICE_TABLE(acpi, toshiba_device_ids); 151MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
152 152
153static const struct key_entry toshiba_acpi_keymap[] __devinitconst = { 153static const struct key_entry toshiba_acpi_keymap[] = {
154 { KE_KEY, 0x101, { KEY_MUTE } }, 154 { KE_KEY, 0x101, { KEY_MUTE } },
155 { KE_KEY, 0x102, { KEY_ZOOMOUT } }, 155 { KE_KEY, 0x102, { KEY_ZOOMOUT } },
156 { KE_KEY, 0x103, { KEY_ZOOMIN } }, 156 { KE_KEY, 0x103, { KEY_ZOOMIN } },
@@ -875,8 +875,7 @@ static const struct file_operations version_proc_fops = {
875 875
876#define PROC_TOSHIBA "toshiba" 876#define PROC_TOSHIBA "toshiba"
877 877
878static void __devinit 878static void create_toshiba_proc_entries(struct toshiba_acpi_dev *dev)
879create_toshiba_proc_entries(struct toshiba_acpi_dev *dev)
880{ 879{
881 if (dev->backlight_dev) 880 if (dev->backlight_dev)
882 proc_create_data("lcd", S_IRUGO | S_IWUSR, toshiba_proc_dir, 881 proc_create_data("lcd", S_IRUGO | S_IWUSR, toshiba_proc_dir,
@@ -979,7 +978,7 @@ static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev,
979 pr_info("Unknown key %x\n", scancode); 978 pr_info("Unknown key %x\n", scancode);
980} 979}
981 980
982static int __devinit toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) 981static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
983{ 982{
984 acpi_status status; 983 acpi_status status;
985 acpi_handle ec_handle, handle; 984 acpi_handle ec_handle, handle;
@@ -1069,7 +1068,7 @@ static int __devinit toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
1069 return error; 1068 return error;
1070} 1069}
1071 1070
1072static int __devinit toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev) 1071static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
1073{ 1072{
1074 struct backlight_properties props; 1073 struct backlight_properties props;
1075 int brightness; 1074 int brightness;
@@ -1154,7 +1153,7 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev, int type)
1154 return 0; 1153 return 0;
1155} 1154}
1156 1155
1157static const char * __devinit find_hci_method(acpi_handle handle) 1156static const char *find_hci_method(acpi_handle handle)
1158{ 1157{
1159 acpi_status status; 1158 acpi_status status;
1160 acpi_handle hci_handle; 1159 acpi_handle hci_handle;
@@ -1170,7 +1169,7 @@ static const char * __devinit find_hci_method(acpi_handle handle)
1170 return NULL; 1169 return NULL;
1171} 1170}
1172 1171
1173static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev) 1172static int toshiba_acpi_add(struct acpi_device *acpi_dev)
1174{ 1173{
1175 struct toshiba_acpi_dev *dev; 1174 struct toshiba_acpi_dev *dev;
1176 const char *hci_method; 1175 const char *hci_method;
diff --git a/drivers/platform/x86/xo1-rfkill.c b/drivers/platform/x86/xo1-rfkill.c
index 1da13ed34b0..4bd17248dfc 100644
--- a/drivers/platform/x86/xo1-rfkill.c
+++ b/drivers/platform/x86/xo1-rfkill.c
@@ -40,7 +40,7 @@ static const struct rfkill_ops rfkill_ops = {
40 .set_block = rfkill_set_block, 40 .set_block = rfkill_set_block,
41}; 41};
42 42
43static int __devinit xo1_rfkill_probe(struct platform_device *pdev) 43static int xo1_rfkill_probe(struct platform_device *pdev)
44{ 44{
45 struct rfkill *rfk; 45 struct rfkill *rfk;
46 int r; 46 int r;
@@ -60,7 +60,7 @@ static int __devinit xo1_rfkill_probe(struct platform_device *pdev)
60 return 0; 60 return 0;
61} 61}
62 62
63static int __devexit xo1_rfkill_remove(struct platform_device *pdev) 63static int xo1_rfkill_remove(struct platform_device *pdev)
64{ 64{
65 struct rfkill *rfk = platform_get_drvdata(pdev); 65 struct rfkill *rfk = platform_get_drvdata(pdev);
66 rfkill_unregister(rfk); 66 rfkill_unregister(rfk);
@@ -74,7 +74,7 @@ static struct platform_driver xo1_rfkill_driver = {
74 .owner = THIS_MODULE, 74 .owner = THIS_MODULE,
75 }, 75 },
76 .probe = xo1_rfkill_probe, 76 .probe = xo1_rfkill_probe,
77 .remove = __devexit_p(xo1_rfkill_remove), 77 .remove = xo1_rfkill_remove,
78}; 78};
79 79
80module_platform_driver(xo1_rfkill_driver); 80module_platform_driver(xo1_rfkill_driver);
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index cfaf5b73540..0c201317284 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -298,6 +298,39 @@ static ssize_t pnp_show_current_resources(struct device *dmdev,
298 return ret; 298 return ret;
299} 299}
300 300
301static char *pnp_get_resource_value(char *buf,
302 unsigned long type,
303 resource_size_t *start,
304 resource_size_t *end,
305 unsigned long *flags)
306{
307 if (start)
308 *start = 0;
309 if (end)
310 *end = 0;
311 if (flags)
312 *flags = 0;
313
314 /* TBD: allow for disabled resources */
315
316 buf = skip_spaces(buf);
317 if (start) {
318 *start = simple_strtoull(buf, &buf, 0);
319 if (end) {
320 buf = skip_spaces(buf);
321 if (*buf == '-') {
322 buf = skip_spaces(buf + 1);
323 *end = simple_strtoull(buf, &buf, 0);
324 } else
325 *end = *start;
326 }
327 }
328
329 /* TBD: allow for additional flags, e.g., IORESOURCE_WINDOW */
330
331 return buf;
332}
333
301static ssize_t pnp_set_current_resources(struct device *dmdev, 334static ssize_t pnp_set_current_resources(struct device *dmdev,
302 struct device_attribute *attr, 335 struct device_attribute *attr,
303 const char *ubuf, size_t count) 336 const char *ubuf, size_t count)
@@ -305,7 +338,6 @@ static ssize_t pnp_set_current_resources(struct device *dmdev,
305 struct pnp_dev *dev = to_pnp_dev(dmdev); 338 struct pnp_dev *dev = to_pnp_dev(dmdev);
306 char *buf = (void *)ubuf; 339 char *buf = (void *)ubuf;
307 int retval = 0; 340 int retval = 0;
308 resource_size_t start, end;
309 341
310 if (dev->status & PNP_ATTACHED) { 342 if (dev->status & PNP_ATTACHED) {
311 retval = -EBUSY; 343 retval = -EBUSY;
@@ -349,6 +381,10 @@ static ssize_t pnp_set_current_resources(struct device *dmdev,
349 goto done; 381 goto done;
350 } 382 }
351 if (!strnicmp(buf, "set", 3)) { 383 if (!strnicmp(buf, "set", 3)) {
384 resource_size_t start;
385 resource_size_t end;
386 unsigned long flags;
387
352 if (dev->active) 388 if (dev->active)
353 goto done; 389 goto done;
354 buf += 3; 390 buf += 3;
@@ -357,42 +393,37 @@ static ssize_t pnp_set_current_resources(struct device *dmdev,
357 while (1) { 393 while (1) {
358 buf = skip_spaces(buf); 394 buf = skip_spaces(buf);
359 if (!strnicmp(buf, "io", 2)) { 395 if (!strnicmp(buf, "io", 2)) {
360 buf = skip_spaces(buf + 2); 396 buf = pnp_get_resource_value(buf + 2,
361 start = simple_strtoul(buf, &buf, 0); 397 IORESOURCE_IO,
362 buf = skip_spaces(buf); 398 &start, &end,
363 if (*buf == '-') { 399 &flags);
364 buf = skip_spaces(buf + 1); 400 pnp_add_io_resource(dev, start, end, flags);
365 end = simple_strtoul(buf, &buf, 0); 401 } else if (!strnicmp(buf, "mem", 3)) {
366 } else 402 buf = pnp_get_resource_value(buf + 3,
367 end = start; 403 IORESOURCE_MEM,
368 pnp_add_io_resource(dev, start, end, 0); 404 &start, &end,
369 continue; 405 &flags);
370 } 406 pnp_add_mem_resource(dev, start, end, flags);
371 if (!strnicmp(buf, "mem", 3)) { 407 } else if (!strnicmp(buf, "irq", 3)) {
372 buf = skip_spaces(buf + 3); 408 buf = pnp_get_resource_value(buf + 3,
373 start = simple_strtoul(buf, &buf, 0); 409 IORESOURCE_IRQ,
374 buf = skip_spaces(buf); 410 &start, NULL,
375 if (*buf == '-') { 411 &flags);
376 buf = skip_spaces(buf + 1); 412 pnp_add_irq_resource(dev, start, flags);
377 end = simple_strtoul(buf, &buf, 0); 413 } else if (!strnicmp(buf, "dma", 3)) {
378 } else 414 buf = pnp_get_resource_value(buf + 3,
379 end = start; 415 IORESOURCE_DMA,
380 pnp_add_mem_resource(dev, start, end, 0); 416 &start, NULL,
381 continue; 417 &flags);
382 } 418 pnp_add_dma_resource(dev, start, flags);
383 if (!strnicmp(buf, "irq", 3)) { 419 } else if (!strnicmp(buf, "bus", 3)) {
384 buf = skip_spaces(buf + 3); 420 buf = pnp_get_resource_value(buf + 3,
385 start = simple_strtoul(buf, &buf, 0); 421 IORESOURCE_BUS,
386 pnp_add_irq_resource(dev, start, 0); 422 &start, &end,
387 continue; 423 NULL);
388 } 424 pnp_add_bus_resource(dev, start, end);
389 if (!strnicmp(buf, "dma", 3)) { 425 } else
390 buf = skip_spaces(buf + 3); 426 break;
391 start = simple_strtoul(buf, &buf, 0);
392 pnp_add_dma_resource(dev, start, 0);
393 continue;
394 }
395 break;
396 } 427 }
397 mutex_unlock(&pnp_res_mutex); 428 mutex_unlock(&pnp_res_mutex);
398 goto done; 429 goto done;
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index ed9ce507149..95cebf0185d 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -18,11 +18,27 @@
18 18
19DEFINE_MUTEX(pnp_res_mutex); 19DEFINE_MUTEX(pnp_res_mutex);
20 20
21static struct resource *pnp_find_resource(struct pnp_dev *dev,
22 unsigned char rule,
23 unsigned long type,
24 unsigned int bar)
25{
26 struct resource *res = pnp_get_resource(dev, type, bar);
27
28 /* when the resource already exists, set its resource bits from rule */
29 if (res) {
30 res->flags &= ~IORESOURCE_BITS;
31 res->flags |= rule & IORESOURCE_BITS;
32 }
33
34 return res;
35}
36
21static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) 37static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
22{ 38{
23 struct resource *res, local_res; 39 struct resource *res, local_res;
24 40
25 res = pnp_get_resource(dev, IORESOURCE_IO, idx); 41 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IO, idx);
26 if (res) { 42 if (res) {
27 pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx " 43 pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx "
28 "flags %#lx\n", idx, (unsigned long long) res->start, 44 "flags %#lx\n", idx, (unsigned long long) res->start,
@@ -65,7 +81,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
65{ 81{
66 struct resource *res, local_res; 82 struct resource *res, local_res;
67 83
68 res = pnp_get_resource(dev, IORESOURCE_MEM, idx); 84 res = pnp_find_resource(dev, rule->flags, IORESOURCE_MEM, idx);
69 if (res) { 85 if (res) {
70 pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " 86 pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx "
71 "flags %#lx\n", idx, (unsigned long long) res->start, 87 "flags %#lx\n", idx, (unsigned long long) res->start,
@@ -78,6 +94,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
78 res->start = 0; 94 res->start = 0;
79 res->end = 0; 95 res->end = 0;
80 96
97 /* ??? rule->flags restricted to 8 bits, all tests bogus ??? */
81 if (!(rule->flags & IORESOURCE_MEM_WRITEABLE)) 98 if (!(rule->flags & IORESOURCE_MEM_WRITEABLE))
82 res->flags |= IORESOURCE_READONLY; 99 res->flags |= IORESOURCE_READONLY;
83 if (rule->flags & IORESOURCE_MEM_CACHEABLE) 100 if (rule->flags & IORESOURCE_MEM_CACHEABLE)
@@ -123,7 +140,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
123 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 140 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2
124 }; 141 };
125 142
126 res = pnp_get_resource(dev, IORESOURCE_IRQ, idx); 143 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IRQ, idx);
127 if (res) { 144 if (res) {
128 pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", 145 pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n",
129 idx, (int) res->start, res->flags); 146 idx, (int) res->start, res->flags);
@@ -182,7 +199,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
182 1, 3, 5, 6, 7, 0, 2, 4 199 1, 3, 5, 6, 7, 0, 2, 4
183 }; 200 };
184 201
185 res = pnp_get_resource(dev, IORESOURCE_DMA, idx); 202 res = pnp_find_resource(dev, rule->flags, IORESOURCE_DMA, idx);
186 if (res) { 203 if (res) {
187 pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", 204 pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n",
188 idx, (int) res->start, res->flags); 205 idx, (int) res->start, res->flags);
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528425c..f034ae43e04 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -452,10 +452,8 @@ struct abx500_bm_data ab8500_bm_data = {
452 .fg_params = &fg, 452 .fg_params = &fg,
453}; 453};
454 454
455int __devinit 455int bmdevs_of_probe(struct device *dev, struct device_node *np,
456bmdevs_of_probe(struct device *dev, 456 struct abx500_bm_data **battery)
457 struct device_node *np,
458 struct abx500_bm_data **battery)
459{ 457{
460 struct abx500_battery_type *btype; 458 struct abx500_battery_type *btype;
461 struct device_node *np_bat_supply; 459 struct device_node *np_bat_supply;
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index 298c47d111b..1ec810ada5e 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -668,7 +668,7 @@ static int olpc_battery_remove(struct platform_device *pdev)
668 return 0; 668 return 0;
669} 669}
670 670
671static const struct of_device_id olpc_battery_ids[] __devinitconst = { 671static const struct of_device_id olpc_battery_ids[] = {
672 { .compatible = "olpc,xo1-battery" }, 672 { .compatible = "olpc,xo1-battery" },
673 {} 673 {}
674}; 674};
diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
index 0491e5335d0..e290d48ddd9 100644
--- a/drivers/power/reset/gpio-poweroff.c
+++ b/drivers/power/reset/gpio-poweroff.c
@@ -29,15 +29,16 @@ static int gpio_active_low;
29 29
30static void gpio_poweroff_do_poweroff(void) 30static void gpio_poweroff_do_poweroff(void)
31{ 31{
32 BUG_ON(gpio_num == -1); 32 BUG_ON(!gpio_is_valid(gpio_num));
33 33
34 /* drive it active */ 34 /* drive it active, also inactive->active edge */
35 gpio_direction_output(gpio_num, !gpio_active_low); 35 gpio_direction_output(gpio_num, !gpio_active_low);
36 mdelay(100); 36 mdelay(100);
37 /* rising edge or drive inactive */ 37 /* drive inactive, also active->inactive edge */
38 gpio_set_value(gpio_num, gpio_active_low); 38 gpio_set_value(gpio_num, gpio_active_low);
39 mdelay(100); 39 mdelay(100);
40 /* falling edge */ 40
41 /* drive it active, also inactive->active edge */
41 gpio_set_value(gpio_num, !gpio_active_low); 42 gpio_set_value(gpio_num, !gpio_active_low);
42 43
43 /* give it some time */ 44 /* give it some time */
@@ -46,7 +47,7 @@ static void gpio_poweroff_do_poweroff(void)
46 WARN_ON(1); 47 WARN_ON(1);
47} 48}
48 49
49static int __devinit gpio_poweroff_probe(struct platform_device *pdev) 50static int gpio_poweroff_probe(struct platform_device *pdev)
50{ 51{
51 enum of_gpio_flags flags; 52 enum of_gpio_flags flags;
52 bool input = false; 53 bool input = false;
@@ -60,15 +61,12 @@ static int __devinit gpio_poweroff_probe(struct platform_device *pdev)
60 } 61 }
61 62
62 gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags); 63 gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
63 if (gpio_num < 0) { 64 if (!gpio_is_valid(gpio_num))
64 pr_err("%s: Could not get GPIO configuration: %d", 65 return gpio_num;
65 __func__, gpio_num); 66
66 return -ENODEV;
67 }
68 gpio_active_low = flags & OF_GPIO_ACTIVE_LOW; 67 gpio_active_low = flags & OF_GPIO_ACTIVE_LOW;
69 68
70 if (of_get_property(pdev->dev.of_node, "input", NULL)) 69 input = of_property_read_bool(pdev->dev.of_node, "input");
71 input = true;
72 70
73 ret = gpio_request(gpio_num, "poweroff-gpio"); 71 ret = gpio_request(gpio_num, "poweroff-gpio");
74 if (ret) { 72 if (ret) {
@@ -96,10 +94,9 @@ err:
96 return -ENODEV; 94 return -ENODEV;
97} 95}
98 96
99static int __devexit gpio_poweroff_remove(struct platform_device *pdev) 97static int gpio_poweroff_remove(struct platform_device *pdev)
100{ 98{
101 if (gpio_num != -1) 99 gpio_free(gpio_num);
102 gpio_free(gpio_num);
103 if (pm_power_off == &gpio_poweroff_do_poweroff) 100 if (pm_power_off == &gpio_poweroff_do_poweroff)
104 pm_power_off = NULL; 101 pm_power_off = NULL;
105 102
@@ -113,17 +110,17 @@ static const struct of_device_id of_gpio_poweroff_match[] = {
113 110
114static struct platform_driver gpio_poweroff_driver = { 111static struct platform_driver gpio_poweroff_driver = {
115 .probe = gpio_poweroff_probe, 112 .probe = gpio_poweroff_probe,
116 .remove = __devexit_p(gpio_poweroff_remove), 113 .remove = gpio_poweroff_remove,
117 .driver = { 114 .driver = {
118 .name = "poweroff-gpio", 115 .name = "poweroff-gpio",
119 .owner = THIS_MODULE, 116 .owner = THIS_MODULE,
120 .of_match_table = of_gpio_poweroff_match, 117 .of_match_table = of_gpio_poweroff_match,
121 }, 118 },
122}; 119};
123 120
124module_platform_driver(gpio_poweroff_driver); 121module_platform_driver(gpio_poweroff_driver);
125 122
126MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>"); 123MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>");
127MODULE_DESCRIPTION("GPIO poweroff driver"); 124MODULE_DESCRIPTION("GPIO poweroff driver");
128MODULE_LICENSE("GPL"); 125MODULE_LICENSE("GPL v2");
129MODULE_ALIAS("platform:poweroff-gpio"); 126MODULE_ALIAS("platform:poweroff-gpio");
diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
index ca49d6c0ee9..8208888b844 100644
--- a/drivers/power/rx51_battery.c
+++ b/drivers/power/rx51_battery.c
@@ -197,7 +197,7 @@ static enum power_supply_property rx51_battery_props[] = {
197 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, 197 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
198}; 198};
199 199
200static int __devinit rx51_battery_probe(struct platform_device *pdev) 200static int rx51_battery_probe(struct platform_device *pdev)
201{ 201{
202 struct rx51_device_info *di; 202 struct rx51_device_info *di;
203 int ret; 203 int ret;
@@ -224,7 +224,7 @@ static int __devinit rx51_battery_probe(struct platform_device *pdev)
224 return 0; 224 return 0;
225} 225}
226 226
227static int __devexit rx51_battery_remove(struct platform_device *pdev) 227static int rx51_battery_remove(struct platform_device *pdev)
228{ 228{
229 struct rx51_device_info *di = platform_get_drvdata(pdev); 229 struct rx51_device_info *di = platform_get_drvdata(pdev);
230 230
@@ -237,7 +237,7 @@ static int __devexit rx51_battery_remove(struct platform_device *pdev)
237 237
238static struct platform_driver rx51_battery_driver = { 238static struct platform_driver rx51_battery_driver = {
239 .probe = rx51_battery_probe, 239 .probe = rx51_battery_probe,
240 .remove = __devexit_p(rx51_battery_remove), 240 .remove = rx51_battery_remove,
241 .driver = { 241 .driver = {
242 .name = "rx51-battery", 242 .name = "rx51-battery",
243 .owner = THIS_MODULE, 243 .owner = THIS_MODULE,
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 65505554547..2bf0c1b608d 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -196,7 +196,7 @@ static int pps_gpio_remove(struct platform_device *pdev)
196 196
197static struct platform_driver pps_gpio_driver = { 197static struct platform_driver pps_gpio_driver = {
198 .probe = pps_gpio_probe, 198 .probe = pps_gpio_probe,
199 .remove = __devexit_p(pps_gpio_remove), 199 .remove = pps_gpio_remove,
200 .driver = { 200 .driver = {
201 .name = PPS_GPIO_NAME, 201 .name = PPS_GPIO_NAME,
202 .owner = THIS_MODULE 202 .owner = THIS_MODULE
diff --git a/drivers/ps3/ps3-lpm.c b/drivers/ps3/ps3-lpm.c
index 643697f7139..b139b7792e9 100644
--- a/drivers/ps3/ps3-lpm.c
+++ b/drivers/ps3/ps3-lpm.c
@@ -1185,7 +1185,7 @@ int ps3_lpm_close(void)
1185} 1185}
1186EXPORT_SYMBOL_GPL(ps3_lpm_close); 1186EXPORT_SYMBOL_GPL(ps3_lpm_close);
1187 1187
1188static int __devinit ps3_lpm_probe(struct ps3_system_bus_device *dev) 1188static int ps3_lpm_probe(struct ps3_system_bus_device *dev)
1189{ 1189{
1190 dev_dbg(&dev->core, " -> %s:%u\n", __func__, __LINE__); 1190 dev_dbg(&dev->core, " -> %s:%u\n", __func__, __LINE__);
1191 1191
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c
index 1b98367110c..f2ab435954f 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -706,7 +706,7 @@ static void ps3_sys_manager_work(struct ps3_system_bus_device *dev)
706 ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN); 706 ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN);
707} 707}
708 708
709static int __devinit ps3_sys_manager_probe(struct ps3_system_bus_device *dev) 709static int ps3_sys_manager_probe(struct ps3_system_bus_device *dev)
710{ 710{
711 int result; 711 int result;
712 struct ps3_sys_manager_ops ops; 712 struct ps3_sys_manager_ops ops;
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 93d0a8b7718..437fc35beb7 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -932,7 +932,7 @@ int ps3av_audio_mute(int mute)
932} 932}
933EXPORT_SYMBOL_GPL(ps3av_audio_mute); 933EXPORT_SYMBOL_GPL(ps3av_audio_mute);
934 934
935static int __devinit ps3av_probe(struct ps3_system_bus_device *dev) 935static int ps3av_probe(struct ps3_system_bus_device *dev)
936{ 936{
937 int res; 937 int res;
938 int id; 938 int id;
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 0199eeea63b..8f39cac661d 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -188,7 +188,7 @@ static int anatop_regulator_remove(struct platform_device *pdev)
188 return 0; 188 return 0;
189} 189}
190 190
191static struct of_device_id __devinitdata of_anatop_regulator_match_tbl[] = { 191static struct of_device_id of_anatop_regulator_match_tbl[] = {
192 { .compatible = "fsl,anatop-regulator", }, 192 { .compatible = "fsl,anatop-regulator", },
193 { /* end */ } 193 { /* end */ }
194}; 194};
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 0f65b246cc0..278584302f2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1885,9 +1885,15 @@ int regulator_can_change_voltage(struct regulator *regulator)
1885 struct regulator_dev *rdev = regulator->rdev; 1885 struct regulator_dev *rdev = regulator->rdev;
1886 1886
1887 if (rdev->constraints && 1887 if (rdev->constraints &&
1888 rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE && 1888 (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
1889 (rdev->desc->n_voltages - rdev->desc->linear_min_sel) > 1) 1889 if (rdev->desc->n_voltages - rdev->desc->linear_min_sel > 1)
1890 return 1; 1890 return 1;
1891
1892 if (rdev->desc->continuous_voltage_range &&
1893 rdev->constraints->min_uV && rdev->constraints->max_uV &&
1894 rdev->constraints->min_uV != rdev->constraints->max_uV)
1895 return 1;
1896 }
1891 1897
1892 return 0; 1898 return 0;
1893} 1899}
@@ -3315,7 +3321,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
3315 * @config: runtime configuration for regulator 3321 * @config: runtime configuration for regulator
3316 * 3322 *
3317 * Called by regulator drivers to register a regulator. 3323 * Called by regulator drivers to register a regulator.
3318 * Returns 0 on success. 3324 * Returns a valid pointer to struct regulator_dev on success
3325 * or an ERR_PTR() on error.
3319 */ 3326 */
3320struct regulator_dev * 3327struct regulator_dev *
3321regulator_register(const struct regulator_desc *regulator_desc, 3328regulator_register(const struct regulator_desc *regulator_desc,
diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
index a4b9cb8c431..1a05ac66878 100644
--- a/drivers/regulator/da9055-regulator.c
+++ b/drivers/regulator/da9055-regulator.c
@@ -442,9 +442,9 @@ static struct da9055_regulator_info da9055_regulator_info[] = {
442 * GPIO can control regulator state and/or select the regulator register 442 * GPIO can control regulator state and/or select the regulator register
443 * set A/B for voltage ramping. 443 * set A/B for voltage ramping.
444 */ 444 */
445static __devinit int da9055_gpio_init(struct da9055_regulator *regulator, 445static int da9055_gpio_init(struct da9055_regulator *regulator,
446 struct regulator_config *config, 446 struct regulator_config *config,
447 struct da9055_pdata *pdata, int id) 447 struct da9055_pdata *pdata, int id)
448{ 448{
449 struct da9055_regulator_info *info = regulator->info; 449 struct da9055_regulator_info *info = regulator->info;
450 int ret = 0; 450 int ret = 0;
@@ -533,7 +533,7 @@ static inline struct da9055_regulator_info *find_regulator_info(int id)
533 return NULL; 533 return NULL;
534} 534}
535 535
536static int __devinit da9055_regulator_probe(struct platform_device *pdev) 536static int da9055_regulator_probe(struct platform_device *pdev)
537{ 537{
538 struct regulator_config config = { }; 538 struct regulator_config config = { };
539 struct da9055_regulator *regulator; 539 struct da9055_regulator *regulator;
@@ -605,7 +605,7 @@ err_regulator:
605 return ret; 605 return ret;
606} 606}
607 607
608static int __devexit da9055_regulator_remove(struct platform_device *pdev) 608static int da9055_regulator_remove(struct platform_device *pdev)
609{ 609{
610 struct da9055_regulator *regulator = platform_get_drvdata(pdev); 610 struct da9055_regulator *regulator = platform_get_drvdata(pdev);
611 611
@@ -616,7 +616,7 @@ static int __devexit da9055_regulator_remove(struct platform_device *pdev)
616 616
617static struct platform_driver da9055_regulator_driver = { 617static struct platform_driver da9055_regulator_driver = {
618 .probe = da9055_regulator_probe, 618 .probe = da9055_regulator_probe,
619 .remove = __devexit_p(da9055_regulator_remove), 619 .remove = da9055_regulator_remove,
620 .driver = { 620 .driver = {
621 .name = "da9055-regulator", 621 .name = "da9055-regulator",
622 .owner = THIS_MODULE, 622 .owner = THIS_MODULE,
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 48d5b7608b0..e5c03b534fa 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -246,7 +246,7 @@ static int reg_fixed_voltage_remove(struct platform_device *pdev)
246} 246}
247 247
248#if defined(CONFIG_OF) 248#if defined(CONFIG_OF)
249static const struct of_device_id fixed_of_match[] __devinitconst = { 249static const struct of_device_id fixed_of_match[] = {
250 { .compatible = "regulator-fixed", }, 250 { .compatible = "regulator-fixed", },
251 {}, 251 {},
252}; 252};
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 8ae288fc150..bae681ccd3e 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -365,7 +365,7 @@ static int gpio_regulator_remove(struct platform_device *pdev)
365} 365}
366 366
367#if defined(CONFIG_OF) 367#if defined(CONFIG_OF)
368static const struct of_device_id regulator_gpio_of_match[] __devinitconst = { 368static const struct of_device_id regulator_gpio_of_match[] = {
369 { .compatible = "regulator-gpio", }, 369 { .compatible = "regulator-gpio", },
370 {}, 370 {},
371}; 371};
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index 3ee26387b12..9a8ea916300 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -248,8 +248,8 @@ static struct regulator_ops max8973_dcdc_ops = {
248 .get_mode = max8973_dcdc_get_mode, 248 .get_mode = max8973_dcdc_get_mode,
249}; 249};
250 250
251static int __devinit max8973_init_dcdc(struct max8973_chip *max, 251static int max8973_init_dcdc(struct max8973_chip *max,
252 struct max8973_regulator_platform_data *pdata) 252 struct max8973_regulator_platform_data *pdata)
253{ 253{
254 int ret; 254 int ret;
255 uint8_t control1 = 0; 255 uint8_t control1 = 0;
@@ -359,8 +359,8 @@ static const struct regmap_config max8973_regmap_config = {
359 .cache_type = REGCACHE_RBTREE, 359 .cache_type = REGCACHE_RBTREE,
360}; 360};
361 361
362static int __devinit max8973_probe(struct i2c_client *client, 362static int max8973_probe(struct i2c_client *client,
363 const struct i2c_device_id *id) 363 const struct i2c_device_id *id)
364{ 364{
365 struct max8973_regulator_platform_data *pdata; 365 struct max8973_regulator_platform_data *pdata;
366 struct regulator_config config = { }; 366 struct regulator_config config = { };
@@ -463,7 +463,7 @@ static int __devinit max8973_probe(struct i2c_client *client,
463 return 0; 463 return 0;
464} 464}
465 465
466static int __devexit max8973_remove(struct i2c_client *client) 466static int max8973_remove(struct i2c_client *client)
467{ 467{
468 struct max8973_chip *max = i2c_get_clientdata(client); 468 struct max8973_chip *max = i2c_get_clientdata(client);
469 469
@@ -484,7 +484,7 @@ static struct i2c_driver max8973_i2c_driver = {
484 .owner = THIS_MODULE, 484 .owner = THIS_MODULE,
485 }, 485 },
486 .probe = max8973_probe, 486 .probe = max8973_probe,
487 .remove = __devexit_p(max8973_remove), 487 .remove = max8973_remove,
488 .id_table = max8973_id, 488 .id_table = max8973_id,
489}; 489};
490 490
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index df0eafb0dc7..02be7fcae32 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -71,26 +71,26 @@ struct voltage_map_desc {
71 int step; 71 int step;
72}; 72};
73 73
74/* Voltage maps in mV */ 74/* Voltage maps in uV */
75static const struct voltage_map_desc ldo_voltage_map_desc = { 75static const struct voltage_map_desc ldo_voltage_map_desc = {
76 .min = 800, .max = 3950, .step = 50, 76 .min = 800000, .max = 3950000, .step = 50000,
77}; /* LDO1 ~ 18, 21 all */ 77}; /* LDO1 ~ 18, 21 all */
78 78
79static const struct voltage_map_desc buck1245_voltage_map_desc = { 79static const struct voltage_map_desc buck1245_voltage_map_desc = {
80 .min = 650, .max = 2225, .step = 25, 80 .min = 650000, .max = 2225000, .step = 25000,
81}; /* Buck1, 2, 4, 5 */ 81}; /* Buck1, 2, 4, 5 */
82 82
83static const struct voltage_map_desc buck37_voltage_map_desc = { 83static const struct voltage_map_desc buck37_voltage_map_desc = {
84 .min = 750, .max = 3900, .step = 50, 84 .min = 750000, .max = 3900000, .step = 50000,
85}; /* Buck3, 7 */ 85}; /* Buck3, 7 */
86 86
87/* current map in mA */ 87/* current map in uA */
88static const struct voltage_map_desc charger_current_map_desc = { 88static const struct voltage_map_desc charger_current_map_desc = {
89 .min = 200, .max = 950, .step = 50, 89 .min = 200000, .max = 950000, .step = 50000,
90}; 90};
91 91
92static const struct voltage_map_desc topoff_current_map_desc = { 92static const struct voltage_map_desc topoff_current_map_desc = {
93 .min = 50, .max = 200, .step = 10, 93 .min = 50000, .max = 200000, .step = 10000,
94}; 94};
95 95
96static const struct voltage_map_desc *reg_voltage_map[] = { 96static const struct voltage_map_desc *reg_voltage_map[] = {
@@ -194,7 +194,7 @@ static int max8997_list_voltage(struct regulator_dev *rdev,
194 if (val > desc->max) 194 if (val > desc->max)
195 return -EINVAL; 195 return -EINVAL;
196 196
197 return val * 1000; 197 return val;
198} 198}
199 199
200static int max8997_get_enable_register(struct regulator_dev *rdev, 200static int max8997_get_enable_register(struct regulator_dev *rdev,
@@ -485,7 +485,6 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
485{ 485{
486 struct max8997_data *max8997 = rdev_get_drvdata(rdev); 486 struct max8997_data *max8997 = rdev_get_drvdata(rdev);
487 struct i2c_client *i2c = max8997->iodev->i2c; 487 struct i2c_client *i2c = max8997->iodev->i2c;
488 int min_vol = min_uV / 1000, max_vol = max_uV / 1000;
489 const struct voltage_map_desc *desc; 488 const struct voltage_map_desc *desc;
490 int rid = rdev_get_id(rdev); 489 int rid = rdev_get_id(rdev);
491 int i, reg, shift, mask, ret; 490 int i, reg, shift, mask, ret;
@@ -509,7 +508,7 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
509 508
510 desc = reg_voltage_map[rid]; 509 desc = reg_voltage_map[rid];
511 510
512 i = max8997_get_voltage_proper_val(desc, min_vol, max_vol); 511 i = max8997_get_voltage_proper_val(desc, min_uV, max_uV);
513 if (i < 0) 512 if (i < 0)
514 return i; 513 return i;
515 514
@@ -557,7 +556,7 @@ static int max8997_set_voltage_ldobuck_time_sel(struct regulator_dev *rdev,
557 case MAX8997_BUCK4: 556 case MAX8997_BUCK4:
558 case MAX8997_BUCK5: 557 case MAX8997_BUCK5:
559 return DIV_ROUND_UP(desc->step * (new_selector - old_selector), 558 return DIV_ROUND_UP(desc->step * (new_selector - old_selector),
560 max8997->ramp_delay); 559 max8997->ramp_delay * 1000);
561 } 560 }
562 561
563 return 0; 562 return 0;
@@ -656,7 +655,6 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
656 const struct voltage_map_desc *desc; 655 const struct voltage_map_desc *desc;
657 int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg; 656 int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg;
658 bool gpio_dvs_mode = false; 657 bool gpio_dvs_mode = false;
659 int min_vol = min_uV / 1000, max_vol = max_uV / 1000;
660 658
661 if (rid < MAX8997_BUCK1 || rid > MAX8997_BUCK7) 659 if (rid < MAX8997_BUCK1 || rid > MAX8997_BUCK7)
662 return -EINVAL; 660 return -EINVAL;
@@ -681,7 +679,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
681 selector); 679 selector);
682 680
683 desc = reg_voltage_map[rid]; 681 desc = reg_voltage_map[rid];
684 new_val = max8997_get_voltage_proper_val(desc, min_vol, max_vol); 682 new_val = max8997_get_voltage_proper_val(desc, min_uV, max_uV);
685 if (new_val < 0) 683 if (new_val < 0)
686 return new_val; 684 return new_val;
687 685
@@ -1123,8 +1121,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
1123 max8997->buck1_vol[i] = ret = 1121 max8997->buck1_vol[i] = ret =
1124 max8997_get_voltage_proper_val( 1122 max8997_get_voltage_proper_val(
1125 &buck1245_voltage_map_desc, 1123 &buck1245_voltage_map_desc,
1126 pdata->buck1_voltage[i] / 1000, 1124 pdata->buck1_voltage[i],
1127 pdata->buck1_voltage[i] / 1000 + 1125 pdata->buck1_voltage[i] +
1128 buck1245_voltage_map_desc.step); 1126 buck1245_voltage_map_desc.step);
1129 if (ret < 0) 1127 if (ret < 0)
1130 goto err_out; 1128 goto err_out;
@@ -1132,8 +1130,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
1132 max8997->buck2_vol[i] = ret = 1130 max8997->buck2_vol[i] = ret =
1133 max8997_get_voltage_proper_val( 1131 max8997_get_voltage_proper_val(
1134 &buck1245_voltage_map_desc, 1132 &buck1245_voltage_map_desc,
1135 pdata->buck2_voltage[i] / 1000, 1133 pdata->buck2_voltage[i],
1136 pdata->buck2_voltage[i] / 1000 + 1134 pdata->buck2_voltage[i] +
1137 buck1245_voltage_map_desc.step); 1135 buck1245_voltage_map_desc.step);
1138 if (ret < 0) 1136 if (ret < 0)
1139 goto err_out; 1137 goto err_out;
@@ -1141,8 +1139,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
1141 max8997->buck5_vol[i] = ret = 1139 max8997->buck5_vol[i] = ret =
1142 max8997_get_voltage_proper_val( 1140 max8997_get_voltage_proper_val(
1143 &buck1245_voltage_map_desc, 1141 &buck1245_voltage_map_desc,
1144 pdata->buck5_voltage[i] / 1000, 1142 pdata->buck5_voltage[i],
1145 pdata->buck5_voltage[i] / 1000 + 1143 pdata->buck5_voltage[i] +
1146 buck1245_voltage_map_desc.step); 1144 buck1245_voltage_map_desc.step);
1147 if (ret < 0) 1145 if (ret < 0)
1148 goto err_out; 1146 goto err_out;
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index b821d08eb64..1f0df4046b8 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -51,39 +51,39 @@ struct voltage_map_desc {
51 int step; 51 int step;
52}; 52};
53 53
54/* Voltage maps */ 54/* Voltage maps in uV*/
55static const struct voltage_map_desc ldo23_voltage_map_desc = { 55static const struct voltage_map_desc ldo23_voltage_map_desc = {
56 .min = 800, .step = 50, .max = 1300, 56 .min = 800000, .step = 50000, .max = 1300000,
57}; 57};
58static const struct voltage_map_desc ldo456711_voltage_map_desc = { 58static const struct voltage_map_desc ldo456711_voltage_map_desc = {
59 .min = 1600, .step = 100, .max = 3600, 59 .min = 1600000, .step = 100000, .max = 3600000,
60}; 60};
61static const struct voltage_map_desc ldo8_voltage_map_desc = { 61static const struct voltage_map_desc ldo8_voltage_map_desc = {
62 .min = 3000, .step = 100, .max = 3600, 62 .min = 3000000, .step = 100000, .max = 3600000,
63}; 63};
64static const struct voltage_map_desc ldo9_voltage_map_desc = { 64static const struct voltage_map_desc ldo9_voltage_map_desc = {
65 .min = 2800, .step = 100, .max = 3100, 65 .min = 2800000, .step = 100000, .max = 3100000,
66}; 66};
67static const struct voltage_map_desc ldo10_voltage_map_desc = { 67static const struct voltage_map_desc ldo10_voltage_map_desc = {
68 .min = 950, .step = 50, .max = 1300, 68 .min = 95000, .step = 50000, .max = 1300000,
69}; 69};
70static const struct voltage_map_desc ldo1213_voltage_map_desc = { 70static const struct voltage_map_desc ldo1213_voltage_map_desc = {
71 .min = 800, .step = 100, .max = 3300, 71 .min = 800000, .step = 100000, .max = 3300000,
72}; 72};
73static const struct voltage_map_desc ldo1415_voltage_map_desc = { 73static const struct voltage_map_desc ldo1415_voltage_map_desc = {
74 .min = 1200, .step = 100, .max = 3300, 74 .min = 1200000, .step = 100000, .max = 3300000,
75}; 75};
76static const struct voltage_map_desc ldo1617_voltage_map_desc = { 76static const struct voltage_map_desc ldo1617_voltage_map_desc = {
77 .min = 1600, .step = 100, .max = 3600, 77 .min = 1600000, .step = 100000, .max = 3600000,
78}; 78};
79static const struct voltage_map_desc buck12_voltage_map_desc = { 79static const struct voltage_map_desc buck12_voltage_map_desc = {
80 .min = 750, .step = 25, .max = 1525, 80 .min = 750000, .step = 25000, .max = 1525000,
81}; 81};
82static const struct voltage_map_desc buck3_voltage_map_desc = { 82static const struct voltage_map_desc buck3_voltage_map_desc = {
83 .min = 1600, .step = 100, .max = 3600, 83 .min = 1600000, .step = 100000, .max = 3600000,
84}; 84};
85static const struct voltage_map_desc buck4_voltage_map_desc = { 85static const struct voltage_map_desc buck4_voltage_map_desc = {
86 .min = 800, .step = 100, .max = 2300, 86 .min = 800000, .step = 100000, .max = 2300000,
87}; 87};
88 88
89static const struct voltage_map_desc *ldo_voltage_map[] = { 89static const struct voltage_map_desc *ldo_voltage_map[] = {
@@ -445,9 +445,9 @@ static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
445 if (max8998->iodev->type == TYPE_MAX8998 && !(val & MAX8998_ENRAMP)) 445 if (max8998->iodev->type == TYPE_MAX8998 && !(val & MAX8998_ENRAMP))
446 return 0; 446 return 0;
447 447
448 difference = (new_selector - old_selector) * desc->step; 448 difference = (new_selector - old_selector) * desc->step / 1000;
449 if (difference > 0) 449 if (difference > 0)
450 return difference / ((val & 0x0f) + 1); 450 return DIV_ROUND_UP(difference, (val & 0x0f) + 1);
451 451
452 return 0; 452 return 0;
453} 453}
@@ -702,7 +702,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
702 i = 0; 702 i = 0;
703 while (buck12_voltage_map_desc.min + 703 while (buck12_voltage_map_desc.min +
704 buck12_voltage_map_desc.step*i 704 buck12_voltage_map_desc.step*i
705 < (pdata->buck1_voltage1 / 1000)) 705 < pdata->buck1_voltage1)
706 i++; 706 i++;
707 max8998->buck1_vol[0] = i; 707 max8998->buck1_vol[0] = i;
708 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE1, i); 708 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE1, i);
@@ -713,7 +713,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
713 i = 0; 713 i = 0;
714 while (buck12_voltage_map_desc.min + 714 while (buck12_voltage_map_desc.min +
715 buck12_voltage_map_desc.step*i 715 buck12_voltage_map_desc.step*i
716 < (pdata->buck1_voltage2 / 1000)) 716 < pdata->buck1_voltage2)
717 i++; 717 i++;
718 718
719 max8998->buck1_vol[1] = i; 719 max8998->buck1_vol[1] = i;
@@ -725,7 +725,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
725 i = 0; 725 i = 0;
726 while (buck12_voltage_map_desc.min + 726 while (buck12_voltage_map_desc.min +
727 buck12_voltage_map_desc.step*i 727 buck12_voltage_map_desc.step*i
728 < (pdata->buck1_voltage3 / 1000)) 728 < pdata->buck1_voltage3)
729 i++; 729 i++;
730 730
731 max8998->buck1_vol[2] = i; 731 max8998->buck1_vol[2] = i;
@@ -737,7 +737,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
737 i = 0; 737 i = 0;
738 while (buck12_voltage_map_desc.min + 738 while (buck12_voltage_map_desc.min +
739 buck12_voltage_map_desc.step*i 739 buck12_voltage_map_desc.step*i
740 < (pdata->buck1_voltage4 / 1000)) 740 < pdata->buck1_voltage4)
741 i++; 741 i++;
742 742
743 max8998->buck1_vol[3] = i; 743 max8998->buck1_vol[3] = i;
@@ -763,7 +763,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
763 i = 0; 763 i = 0;
764 while (buck12_voltage_map_desc.min + 764 while (buck12_voltage_map_desc.min +
765 buck12_voltage_map_desc.step*i 765 buck12_voltage_map_desc.step*i
766 < (pdata->buck2_voltage1 / 1000)) 766 < pdata->buck2_voltage1)
767 i++; 767 i++;
768 max8998->buck2_vol[0] = i; 768 max8998->buck2_vol[0] = i;
769 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE1, i); 769 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE1, i);
@@ -774,7 +774,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
774 i = 0; 774 i = 0;
775 while (buck12_voltage_map_desc.min + 775 while (buck12_voltage_map_desc.min +
776 buck12_voltage_map_desc.step*i 776 buck12_voltage_map_desc.step*i
777 < (pdata->buck2_voltage2 / 1000)) 777 < pdata->buck2_voltage2)
778 i++; 778 i++;
779 max8998->buck2_vol[1] = i; 779 max8998->buck2_vol[1] = i;
780 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE2, i); 780 ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE2, i);
@@ -792,8 +792,8 @@ static int max8998_pmic_probe(struct platform_device *pdev)
792 int count = (desc->max - desc->min) / desc->step + 1; 792 int count = (desc->max - desc->min) / desc->step + 1;
793 793
794 regulators[index].n_voltages = count; 794 regulators[index].n_voltages = count;
795 regulators[index].min_uV = desc->min * 1000; 795 regulators[index].min_uV = desc->min;
796 regulators[index].uV_step = desc->step * 1000; 796 regulators[index].uV_step = desc->step;
797 } 797 }
798 798
799 config.dev = max8998->dev; 799 config.dev = max8998->dev;
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index e915629a25c..c9e912f583b 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -806,7 +806,7 @@ static int palmas_remove(struct platform_device *pdev)
806 return 0; 806 return 0;
807} 807}
808 808
809static struct of_device_id __devinitdata of_palmas_match_tbl[] = { 809static struct of_device_id of_palmas_match_tbl[] = {
810 { .compatible = "ti,palmas-pmic", }, 810 { .compatible = "ti,palmas-pmic", },
811 { /* end */ } 811 { /* end */ }
812}; 812};
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 9f991f2c525..33b65c9ad5d 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -214,7 +214,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev)
214 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 214 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
215 int ret, reg; 215 int ret, reg;
216 int mask = 0xc0, enable_ctrl; 216 int mask = 0xc0, enable_ctrl;
217 u8 val; 217 unsigned int val;
218 218
219 ret = s5m8767_get_register(rdev, &reg, &enable_ctrl); 219 ret = s5m8767_get_register(rdev, &reg, &enable_ctrl);
220 if (ret == -EINVAL) 220 if (ret == -EINVAL)
@@ -306,7 +306,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev *rdev)
306 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 306 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
307 int reg, mask, ret; 307 int reg, mask, ret;
308 int reg_id = rdev_get_id(rdev); 308 int reg_id = rdev_get_id(rdev);
309 u8 val; 309 unsigned int val;
310 310
311 ret = s5m8767_get_voltage_register(rdev, &reg); 311 ret = s5m8767_get_voltage_register(rdev, &reg);
312 if (ret) 312 if (ret)
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 493c8c6a241..74508cc62d6 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1064,7 +1064,7 @@ static u8 twl_get_smps_mult(void)
1064#define TWLFIXED_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLFIXED, label) 1064#define TWLFIXED_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLFIXED, label)
1065#define TWLSMPS_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLSMPS, label) 1065#define TWLSMPS_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLSMPS, label)
1066 1066
1067static const struct of_device_id twl_of_match[] __devinitconst = { 1067static const struct of_device_id twl_of_match[] = {
1068 TWL4030_OF_MATCH("ti,twl4030-vaux1", VAUX1), 1068 TWL4030_OF_MATCH("ti,twl4030-vaux1", VAUX1),
1069 TWL4030_OF_MATCH("ti,twl4030-vaux2", VAUX2_4030), 1069 TWL4030_OF_MATCH("ti,twl4030-vaux2", VAUX2_4030),
1070 TWL4030_OF_MATCH("ti,twl5030-vaux2", VAUX2), 1070 TWL4030_OF_MATCH("ti,twl5030-vaux2", VAUX2),
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index 32c289c2ba1..0e396c155b3 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -179,7 +179,7 @@ static struct rproc_ops omap_rproc_ops = {
179 .kick = omap_rproc_kick, 179 .kick = omap_rproc_kick,
180}; 180};
181 181
182static int __devinit omap_rproc_probe(struct platform_device *pdev) 182static int omap_rproc_probe(struct platform_device *pdev)
183{ 183{
184 struct omap_rproc_pdata *pdata = pdev->dev.platform_data; 184 struct omap_rproc_pdata *pdata = pdev->dev.platform_data;
185 struct omap_rproc *oproc; 185 struct omap_rproc *oproc;
@@ -213,7 +213,7 @@ free_rproc:
213 return ret; 213 return ret;
214} 214}
215 215
216static int __devexit omap_rproc_remove(struct platform_device *pdev) 216static int omap_rproc_remove(struct platform_device *pdev)
217{ 217{
218 struct rproc *rproc = platform_get_drvdata(pdev); 218 struct rproc *rproc = platform_get_drvdata(pdev);
219 219
@@ -225,7 +225,7 @@ static int __devexit omap_rproc_remove(struct platform_device *pdev)
225 225
226static struct platform_driver omap_rproc_driver = { 226static struct platform_driver omap_rproc_driver = {
227 .probe = omap_rproc_probe, 227 .probe = omap_rproc_probe,
228 .remove = __devexit_p(omap_rproc_remove), 228 .remove = omap_rproc_remove,
229 .driver = { 229 .driver = {
230 .name = "omap-rproc", 230 .name = "omap-rproc",
231 .owner = THIS_MODULE, 231 .owner = THIS_MODULE,
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 027096fe6a1..f1e323924f1 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1022,7 +1022,7 @@ static int rpmsg_remove_device(struct device *dev, void *data)
1022 return 0; 1022 return 0;
1023} 1023}
1024 1024
1025static void __devexit rpmsg_remove(struct virtio_device *vdev) 1025static void rpmsg_remove(struct virtio_device *vdev)
1026{ 1026{
1027 struct virtproc_info *vrp = vdev->priv; 1027 struct virtproc_info *vrp = vdev->priv;
1028 int ret; 1028 int ret;
@@ -1063,7 +1063,7 @@ static struct virtio_driver virtio_ipc_driver = {
1063 .driver.owner = THIS_MODULE, 1063 .driver.owner = THIS_MODULE,
1064 .id_table = id_table, 1064 .id_table = id_table,
1065 .probe = rpmsg_probe, 1065 .probe = rpmsg_probe,
1066 .remove = __devexit_p(rpmsg_remove), 1066 .remove = rpmsg_remove,
1067}; 1067};
1068 1068
1069static int __init rpmsg_init(void) 1069static int __init rpmsg_init(void)
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index d0cea02b5df..923a9da9c82 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -352,6 +352,14 @@ config RTC_DRV_TWL4030
352 This driver can also be built as a module. If so, the module 352 This driver can also be built as a module. If so, the module
353 will be called rtc-twl. 353 will be called rtc-twl.
354 354
355config RTC_DRV_TPS6586X
356 tristate "TI TPS6586X RTC driver"
357 depends on MFD_TPS6586X
358 help
359 TI Power Managment IC TPS6586X supports RTC functionality
360 along with alarm. This driver supports the RTC driver for
361 the TPS6586X RTC module.
362
355config RTC_DRV_TPS65910 363config RTC_DRV_TPS65910
356 tristate "TI TPS65910 RTC driver" 364 tristate "TI TPS65910 RTC driver"
357 depends on RTC_CLASS && MFD_TPS65910 365 depends on RTC_CLASS && MFD_TPS65910
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index c3f62c80dc0..4418ef3f9ec 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_TEGRA) += rtc-tegra.o
111obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o 111obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o
112obj-$(CONFIG_RTC_DRV_TILE) += rtc-tile.o 112obj-$(CONFIG_RTC_DRV_TILE) += rtc-tile.o
113obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl.o 113obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl.o
114obj-$(CONFIG_RTC_DRV_TPS6586X) += rtc-tps6586x.o
114obj-$(CONFIG_RTC_DRV_TPS65910) += rtc-tps65910.o 115obj-$(CONFIG_RTC_DRV_TPS65910) += rtc-tps65910.o
115obj-$(CONFIG_RTC_DRV_TX4939) += rtc-tx4939.o 116obj-$(CONFIG_RTC_DRV_TX4939) += rtc-tx4939.o
116obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o 117obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index 6367984e056..63b17ebe90e 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -248,7 +248,7 @@ static int pm80x_rtc_resume(struct device *dev)
248 248
249static SIMPLE_DEV_PM_OPS(pm80x_rtc_pm_ops, pm80x_rtc_suspend, pm80x_rtc_resume); 249static SIMPLE_DEV_PM_OPS(pm80x_rtc_pm_ops, pm80x_rtc_suspend, pm80x_rtc_resume);
250 250
251static int __devinit pm80x_rtc_probe(struct platform_device *pdev) 251static int pm80x_rtc_probe(struct platform_device *pdev)
252{ 252{
253 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); 253 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
254 struct pm80x_platform_data *pm80x_pdata; 254 struct pm80x_platform_data *pm80x_pdata;
@@ -342,7 +342,7 @@ out:
342 return ret; 342 return ret;
343} 343}
344 344
345static int __devexit pm80x_rtc_remove(struct platform_device *pdev) 345static int pm80x_rtc_remove(struct platform_device *pdev)
346{ 346{
347 struct pm80x_rtc_info *info = platform_get_drvdata(pdev); 347 struct pm80x_rtc_info *info = platform_get_drvdata(pdev);
348 platform_set_drvdata(pdev, NULL); 348 platform_set_drvdata(pdev, NULL);
@@ -358,7 +358,7 @@ static struct platform_driver pm80x_rtc_driver = {
358 .pm = &pm80x_rtc_pm_ops, 358 .pm = &pm80x_rtc_pm_ops,
359 }, 359 },
360 .probe = pm80x_rtc_probe, 360 .probe = pm80x_rtc_probe,
361 .remove = __devexit_p(pm80x_rtc_remove), 361 .remove = pm80x_rtc_remove,
362}; 362};
363 363
364module_platform_driver(pm80x_rtc_driver); 364module_platform_driver(pm80x_rtc_driver);
diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index de9e854b326..f663746f460 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -286,8 +286,8 @@ out:
286#endif 286#endif
287 287
288#ifdef CONFIG_OF 288#ifdef CONFIG_OF
289static int __devinit pm860x_rtc_dt_init(struct platform_device *pdev, 289static int pm860x_rtc_dt_init(struct platform_device *pdev,
290 struct pm860x_rtc_info *info) 290 struct pm860x_rtc_info *info)
291{ 291{
292 struct device_node *np = pdev->dev.parent->of_node; 292 struct device_node *np = pdev->dev.parent->of_node;
293 int ret; 293 int ret;
@@ -307,7 +307,7 @@ static int __devinit pm860x_rtc_dt_init(struct platform_device *pdev,
307#define pm860x_rtc_dt_init(x, y) (-1) 307#define pm860x_rtc_dt_init(x, y) (-1)
308#endif 308#endif
309 309
310static int __devinit pm860x_rtc_probe(struct platform_device *pdev) 310static int pm860x_rtc_probe(struct platform_device *pdev)
311{ 311{
312 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 312 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
313 struct pm860x_rtc_pdata *pdata = NULL; 313 struct pm860x_rtc_pdata *pdata = NULL;
@@ -412,7 +412,7 @@ out:
412 return ret; 412 return ret;
413} 413}
414 414
415static int __devexit pm860x_rtc_remove(struct platform_device *pdev) 415static int pm860x_rtc_remove(struct platform_device *pdev)
416{ 416{
417 struct pm860x_rtc_info *info = platform_get_drvdata(pdev); 417 struct pm860x_rtc_info *info = platform_get_drvdata(pdev);
418 418
@@ -459,7 +459,7 @@ static struct platform_driver pm860x_rtc_driver = {
459 .pm = &pm860x_rtc_pm_ops, 459 .pm = &pm860x_rtc_pm_ops,
460 }, 460 },
461 .probe = pm860x_rtc_probe, 461 .probe = pm860x_rtc_probe,
462 .remove = __devexit_p(pm860x_rtc_remove), 462 .remove = pm860x_rtc_remove,
463}; 463};
464 464
465module_platform_driver(pm860x_rtc_driver); 465module_platform_driver(pm860x_rtc_driver);
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 2e5970fe9ee..57cde2b061e 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -389,7 +389,7 @@ static const struct rtc_class_ops ab8500_rtc_ops = {
389 .alarm_irq_enable = ab8500_rtc_irq_enable, 389 .alarm_irq_enable = ab8500_rtc_irq_enable,
390}; 390};
391 391
392static int __devinit ab8500_rtc_probe(struct platform_device *pdev) 392static int ab8500_rtc_probe(struct platform_device *pdev)
393{ 393{
394 int err; 394 int err;
395 struct rtc_device *rtc; 395 struct rtc_device *rtc;
@@ -448,7 +448,7 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev)
448 return 0; 448 return 0;
449} 449}
450 450
451static int __devexit ab8500_rtc_remove(struct platform_device *pdev) 451static int ab8500_rtc_remove(struct platform_device *pdev)
452{ 452{
453 struct rtc_device *rtc = platform_get_drvdata(pdev); 453 struct rtc_device *rtc = platform_get_drvdata(pdev);
454 int irq = platform_get_irq_byname(pdev, "ALARM"); 454 int irq = platform_get_irq_byname(pdev, "ALARM");
@@ -468,7 +468,7 @@ static struct platform_driver ab8500_rtc_driver = {
468 .owner = THIS_MODULE, 468 .owner = THIS_MODULE,
469 }, 469 },
470 .probe = ab8500_rtc_probe, 470 .probe = ab8500_rtc_probe,
471 .remove = __devexit_p(ab8500_rtc_remove), 471 .remove = ab8500_rtc_remove,
472}; 472};
473 473
474module_platform_driver(ab8500_rtc_driver); 474module_platform_driver(ab8500_rtc_driver);
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index e981798e9a9..39cfd2ee004 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -289,7 +289,7 @@ static const struct rtc_class_ops at91_rtc_ops = {
289/* 289/*
290 * Initialize and install RTC driver 290 * Initialize and install RTC driver
291 */ 291 */
292static int __devinit at91_rtc_probe(struct platform_device *pdev) 292static int at91_rtc_probe(struct platform_device *pdev)
293{ 293{
294 struct resource *r, *r_gpbr; 294 struct resource *r, *r_gpbr;
295 struct sam9_rtc *rtc; 295 struct sam9_rtc *rtc;
@@ -387,7 +387,7 @@ fail:
387/* 387/*
388 * Disable and remove the RTC driver 388 * Disable and remove the RTC driver
389 */ 389 */
390static int __devexit at91_rtc_remove(struct platform_device *pdev) 390static int at91_rtc_remove(struct platform_device *pdev)
391{ 391{
392 struct sam9_rtc *rtc = platform_get_drvdata(pdev); 392 struct sam9_rtc *rtc = platform_get_drvdata(pdev);
393 u32 mr = rtt_readl(rtc, MR); 393 u32 mr = rtt_readl(rtc, MR);
@@ -463,7 +463,7 @@ static int at91_rtc_resume(struct platform_device *pdev)
463 463
464static struct platform_driver at91_rtc_driver = { 464static struct platform_driver at91_rtc_driver = {
465 .probe = at91_rtc_probe, 465 .probe = at91_rtc_probe,
466 .remove = __devexit_p(at91_rtc_remove), 466 .remove = at91_rtc_remove,
467 .shutdown = at91_rtc_shutdown, 467 .shutdown = at91_rtc_shutdown,
468 .suspend = at91_rtc_suspend, 468 .suspend = at91_rtc_suspend,
469 .resume = at91_rtc_resume, 469 .resume = at91_rtc_resume,
diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c
index 979ed0406ce..b309da4ec74 100644
--- a/drivers/rtc/rtc-au1xxx.c
+++ b/drivers/rtc/rtc-au1xxx.c
@@ -62,7 +62,7 @@ static struct rtc_class_ops au1xtoy_rtc_ops = {
62 .set_time = au1xtoy_rtc_set_time, 62 .set_time = au1xtoy_rtc_set_time,
63}; 63};
64 64
65static int __devinit au1xtoy_rtc_probe(struct platform_device *pdev) 65static int au1xtoy_rtc_probe(struct platform_device *pdev)
66{ 66{
67 struct rtc_device *rtcdev; 67 struct rtc_device *rtcdev;
68 unsigned long t; 68 unsigned long t;
@@ -116,7 +116,7 @@ out_err:
116 return ret; 116 return ret;
117} 117}
118 118
119static int __devexit au1xtoy_rtc_remove(struct platform_device *pdev) 119static int au1xtoy_rtc_remove(struct platform_device *pdev)
120{ 120{
121 struct rtc_device *rtcdev = platform_get_drvdata(pdev); 121 struct rtc_device *rtcdev = platform_get_drvdata(pdev);
122 122
@@ -131,7 +131,7 @@ static struct platform_driver au1xrtc_driver = {
131 .name = "rtc-au1xxx", 131 .name = "rtc-au1xxx",
132 .owner = THIS_MODULE, 132 .owner = THIS_MODULE,
133 }, 133 },
134 .remove = __devexit_p(au1xtoy_rtc_remove), 134 .remove = au1xtoy_rtc_remove,
135}; 135};
136 136
137static int __init au1xtoy_rtc_init(void) 137static int __init au1xtoy_rtc_init(void)
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index abfc1a0c07d..4ec614b0954 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -342,7 +342,7 @@ static struct rtc_class_ops bfin_rtc_ops = {
342 .alarm_irq_enable = bfin_rtc_alarm_irq_enable, 342 .alarm_irq_enable = bfin_rtc_alarm_irq_enable,
343}; 343};
344 344
345static int __devinit bfin_rtc_probe(struct platform_device *pdev) 345static int bfin_rtc_probe(struct platform_device *pdev)
346{ 346{
347 struct bfin_rtc *rtc; 347 struct bfin_rtc *rtc;
348 struct device *dev = &pdev->dev; 348 struct device *dev = &pdev->dev;
@@ -388,7 +388,7 @@ err:
388 return ret; 388 return ret;
389} 389}
390 390
391static int __devexit bfin_rtc_remove(struct platform_device *pdev) 391static int bfin_rtc_remove(struct platform_device *pdev)
392{ 392{
393 struct bfin_rtc *rtc = platform_get_drvdata(pdev); 393 struct bfin_rtc *rtc = platform_get_drvdata(pdev);
394 struct device *dev = &pdev->dev; 394 struct device *dev = &pdev->dev;
@@ -451,7 +451,7 @@ static struct platform_driver bfin_rtc_driver = {
451 .owner = THIS_MODULE, 451 .owner = THIS_MODULE,
452 }, 452 },
453 .probe = bfin_rtc_probe, 453 .probe = bfin_rtc_probe,
454 .remove = __devexit_p(bfin_rtc_remove), 454 .remove = bfin_rtc_remove,
455 .suspend = bfin_rtc_suspend, 455 .suspend = bfin_rtc_suspend,
456 .resume = bfin_rtc_resume, 456 .resume = bfin_rtc_resume,
457}; 457};
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index f090159dce4..036cb89f818 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/drivers/rtc/rtc-bq32k.c
@@ -163,7 +163,7 @@ static int bq32k_probe(struct i2c_client *client,
163 return 0; 163 return 0;
164} 164}
165 165
166static int __devexit bq32k_remove(struct i2c_client *client) 166static int bq32k_remove(struct i2c_client *client)
167{ 167{
168 struct rtc_device *rtc = i2c_get_clientdata(client); 168 struct rtc_device *rtc = i2c_get_clientdata(client);
169 169
@@ -183,7 +183,7 @@ static struct i2c_driver bq32k_driver = {
183 .owner = THIS_MODULE, 183 .owner = THIS_MODULE,
184 }, 184 },
185 .probe = bq32k_probe, 185 .probe = bq32k_probe,
186 .remove = __devexit_p(bq32k_remove), 186 .remove = bq32k_remove,
187 .id_table = bq32k_id, 187 .id_table = bq32k_id,
188}; 188};
189 189
diff --git a/drivers/rtc/rtc-bq4802.c b/drivers/rtc/rtc-bq4802.c
index bf612ef2294..693be71b5b1 100644
--- a/drivers/rtc/rtc-bq4802.c
+++ b/drivers/rtc/rtc-bq4802.c
@@ -140,7 +140,7 @@ static const struct rtc_class_ops bq4802_ops = {
140 .set_time = bq4802_set_time, 140 .set_time = bq4802_set_time,
141}; 141};
142 142
143static int __devinit bq4802_probe(struct platform_device *pdev) 143static int bq4802_probe(struct platform_device *pdev)
144{ 144{
145 struct bq4802 *p = kzalloc(sizeof(*p), GFP_KERNEL); 145 struct bq4802 *p = kzalloc(sizeof(*p), GFP_KERNEL);
146 int err = -ENOMEM; 146 int err = -ENOMEM;
@@ -191,7 +191,7 @@ out_free:
191 goto out; 191 goto out;
192} 192}
193 193
194static int __devexit bq4802_remove(struct platform_device *pdev) 194static int bq4802_remove(struct platform_device *pdev)
195{ 195{
196 struct bq4802 *p = platform_get_drvdata(pdev); 196 struct bq4802 *p = platform_get_drvdata(pdev);
197 197
@@ -215,7 +215,7 @@ static struct platform_driver bq4802_driver = {
215 .owner = THIS_MODULE, 215 .owner = THIS_MODULE,
216 }, 216 },
217 .probe = bq4802_probe, 217 .probe = bq4802_probe,
218 .remove = __devexit_p(bq4802_remove), 218 .remove = bq4802_remove,
219}; 219};
220 220
221module_platform_driver(bq4802_driver); 221module_platform_driver(bq4802_driver);
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 4267789ca99..16630aa87f4 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -947,8 +947,7 @@ static void rtc_wake_off(struct device *dev)
947 */ 947 */
948static struct cmos_rtc_board_info acpi_rtc_info; 948static struct cmos_rtc_board_info acpi_rtc_info;
949 949
950static void __devinit 950static void cmos_wake_setup(struct device *dev)
951cmos_wake_setup(struct device *dev)
952{ 951{
953 if (acpi_disabled) 952 if (acpi_disabled)
954 return; 953 return;
@@ -980,8 +979,7 @@ cmos_wake_setup(struct device *dev)
980 979
981#else 980#else
982 981
983static void __devinit 982static void cmos_wake_setup(struct device *dev)
984cmos_wake_setup(struct device *dev)
985{ 983{
986} 984}
987 985
@@ -991,8 +989,7 @@ cmos_wake_setup(struct device *dev)
991 989
992#include <linux/pnp.h> 990#include <linux/pnp.h>
993 991
994static int __devinit 992static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
995cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
996{ 993{
997 cmos_wake_setup(&pnp->dev); 994 cmos_wake_setup(&pnp->dev);
998 995
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
index 78070255bd3..60b826e520e 100644
--- a/drivers/rtc/rtc-da9052.c
+++ b/drivers/rtc/rtc-da9052.c
@@ -228,7 +228,7 @@ static const struct rtc_class_ops da9052_rtc_ops = {
228 .alarm_irq_enable = da9052_rtc_alarm_irq_enable, 228 .alarm_irq_enable = da9052_rtc_alarm_irq_enable,
229}; 229};
230 230
231static int __devinit da9052_rtc_probe(struct platform_device *pdev) 231static int da9052_rtc_probe(struct platform_device *pdev)
232{ 232{
233 struct da9052_rtc *rtc; 233 struct da9052_rtc *rtc;
234 int ret; 234 int ret;
@@ -262,7 +262,7 @@ err_free_irq:
262 return ret; 262 return ret;
263} 263}
264 264
265static int __devexit da9052_rtc_remove(struct platform_device *pdev) 265static int da9052_rtc_remove(struct platform_device *pdev)
266{ 266{
267 struct da9052_rtc *rtc = pdev->dev.platform_data; 267 struct da9052_rtc *rtc = pdev->dev.platform_data;
268 268
@@ -275,7 +275,7 @@ static int __devexit da9052_rtc_remove(struct platform_device *pdev)
275 275
276static struct platform_driver da9052_rtc_driver = { 276static struct platform_driver da9052_rtc_driver = {
277 .probe = da9052_rtc_probe, 277 .probe = da9052_rtc_probe,
278 .remove = __devexit_p(da9052_rtc_remove), 278 .remove = da9052_rtc_remove,
279 .driver = { 279 .driver = {
280 .name = "da9052-rtc", 280 .name = "da9052-rtc",
281 .owner = THIS_MODULE, 281 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-da9055.c b/drivers/rtc/rtc-da9055.c
index 96bafc5c3bf..8f0dcfedb83 100644
--- a/drivers/rtc/rtc-da9055.c
+++ b/drivers/rtc/rtc-da9055.c
@@ -227,7 +227,7 @@ static const struct rtc_class_ops da9055_rtc_ops = {
227 .alarm_irq_enable = da9055_rtc_alarm_irq_enable, 227 .alarm_irq_enable = da9055_rtc_alarm_irq_enable,
228}; 228};
229 229
230static int __init da9055_rtc_device_init(struct da9055 *da9055, 230static int da9055_rtc_device_init(struct da9055 *da9055,
231 struct da9055_pdata *pdata) 231 struct da9055_pdata *pdata)
232{ 232{
233 int ret; 233 int ret;
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index 07cd03eae60..5f7982f7c1b 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -567,7 +567,7 @@ fail2:
567 return ret; 567 return ret;
568} 568}
569 569
570static int __devexit davinci_rtc_remove(struct platform_device *pdev) 570static int davinci_rtc_remove(struct platform_device *pdev)
571{ 571{
572 struct davinci_rtc *davinci_rtc = platform_get_drvdata(pdev); 572 struct davinci_rtc *davinci_rtc = platform_get_drvdata(pdev);
573 573
@@ -589,7 +589,7 @@ static int __devexit davinci_rtc_remove(struct platform_device *pdev)
589 589
590static struct platform_driver davinci_rtc_driver = { 590static struct platform_driver davinci_rtc_driver = {
591 .probe = davinci_rtc_probe, 591 .probe = davinci_rtc_probe,
592 .remove = __devexit_p(davinci_rtc_remove), 592 .remove = davinci_rtc_remove,
593 .driver = { 593 .driver = {
594 .name = "rtc_davinci", 594 .name = "rtc_davinci",
595 .owner = THIS_MODULE, 595 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-dm355evm.c b/drivers/rtc/rtc-dm355evm.c
index d4457afcba8..b2ed2c94b08 100644
--- a/drivers/rtc/rtc-dm355evm.c
+++ b/drivers/rtc/rtc-dm355evm.c
@@ -123,7 +123,7 @@ static struct rtc_class_ops dm355evm_rtc_ops = {
123 123
124/*----------------------------------------------------------------------*/ 124/*----------------------------------------------------------------------*/
125 125
126static int __devinit dm355evm_rtc_probe(struct platform_device *pdev) 126static int dm355evm_rtc_probe(struct platform_device *pdev)
127{ 127{
128 struct rtc_device *rtc; 128 struct rtc_device *rtc;
129 129
@@ -139,7 +139,7 @@ static int __devinit dm355evm_rtc_probe(struct platform_device *pdev)
139 return 0; 139 return 0;
140} 140}
141 141
142static int __devexit dm355evm_rtc_remove(struct platform_device *pdev) 142static int dm355evm_rtc_remove(struct platform_device *pdev)
143{ 143{
144 struct rtc_device *rtc = platform_get_drvdata(pdev); 144 struct rtc_device *rtc = platform_get_drvdata(pdev);
145 145
@@ -154,7 +154,7 @@ static int __devexit dm355evm_rtc_remove(struct platform_device *pdev)
154 */ 154 */
155static struct platform_driver rtc_dm355evm_driver = { 155static struct platform_driver rtc_dm355evm_driver = {
156 .probe = dm355evm_rtc_probe, 156 .probe = dm355evm_rtc_probe,
157 .remove = __devexit_p(dm355evm_rtc_remove), 157 .remove = dm355evm_rtc_remove,
158 .driver = { 158 .driver = {
159 .owner = THIS_MODULE, 159 .owner = THIS_MODULE,
160 .name = "rtc-dm355evm", 160 .name = "rtc-dm355evm",
diff --git a/drivers/rtc/rtc-ds1286.c b/drivers/rtc/rtc-ds1286.c
index 990c3ff489b..d989412a348 100644
--- a/drivers/rtc/rtc-ds1286.c
+++ b/drivers/rtc/rtc-ds1286.c
@@ -329,7 +329,7 @@ static const struct rtc_class_ops ds1286_ops = {
329 .alarm_irq_enable = ds1286_alarm_irq_enable, 329 .alarm_irq_enable = ds1286_alarm_irq_enable,
330}; 330};
331 331
332static int __devinit ds1286_probe(struct platform_device *pdev) 332static int ds1286_probe(struct platform_device *pdev)
333{ 333{
334 struct rtc_device *rtc; 334 struct rtc_device *rtc;
335 struct resource *res; 335 struct resource *res;
@@ -376,7 +376,7 @@ out:
376 return ret; 376 return ret;
377} 377}
378 378
379static int __devexit ds1286_remove(struct platform_device *pdev) 379static int ds1286_remove(struct platform_device *pdev)
380{ 380{
381 struct ds1286_priv *priv = platform_get_drvdata(pdev); 381 struct ds1286_priv *priv = platform_get_drvdata(pdev);
382 382
@@ -393,7 +393,7 @@ static struct platform_driver ds1286_platform_driver = {
393 .owner = THIS_MODULE, 393 .owner = THIS_MODULE,
394 }, 394 },
395 .probe = ds1286_probe, 395 .probe = ds1286_probe,
396 .remove = __devexit_p(ds1286_remove), 396 .remove = ds1286_remove,
397}; 397};
398 398
399module_platform_driver(ds1286_platform_driver); 399module_platform_driver(ds1286_platform_driver);
diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c
index f0d63892264..fdbcdb289d6 100644
--- a/drivers/rtc/rtc-ds1302.c
+++ b/drivers/rtc/rtc-ds1302.c
@@ -234,7 +234,7 @@ static int __init ds1302_rtc_probe(struct platform_device *pdev)
234 return 0; 234 return 0;
235} 235}
236 236
237static int __devexit ds1302_rtc_remove(struct platform_device *pdev) 237static int ds1302_rtc_remove(struct platform_device *pdev)
238{ 238{
239 struct rtc_device *rtc = platform_get_drvdata(pdev); 239 struct rtc_device *rtc = platform_get_drvdata(pdev);
240 240
@@ -249,7 +249,7 @@ static struct platform_driver ds1302_platform_driver = {
249 .name = DRV_NAME, 249 .name = DRV_NAME,
250 .owner = THIS_MODULE, 250 .owner = THIS_MODULE,
251 }, 251 },
252 .remove = __devexit_p(ds1302_rtc_remove), 252 .remove = ds1302_rtc_remove,
253}; 253};
254 254
255static int __init ds1302_rtc_init(void) 255static int __init ds1302_rtc_init(void)
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c
index 686a865913e..d578773f5ce 100644
--- a/drivers/rtc/rtc-ds1305.c
+++ b/drivers/rtc/rtc-ds1305.c
@@ -601,7 +601,7 @@ static struct bin_attribute nvram = {
601 * Interface to SPI stack 601 * Interface to SPI stack
602 */ 602 */
603 603
604static int __devinit ds1305_probe(struct spi_device *spi) 604static int ds1305_probe(struct spi_device *spi)
605{ 605{
606 struct ds1305 *ds1305; 606 struct ds1305 *ds1305;
607 int status; 607 int status;
@@ -787,7 +787,7 @@ fail0:
787 return status; 787 return status;
788} 788}
789 789
790static int __devexit ds1305_remove(struct spi_device *spi) 790static int ds1305_remove(struct spi_device *spi)
791{ 791{
792 struct ds1305 *ds1305 = spi_get_drvdata(spi); 792 struct ds1305 *ds1305 = spi_get_drvdata(spi);
793 793
@@ -810,7 +810,7 @@ static struct spi_driver ds1305_driver = {
810 .driver.name = "rtc-ds1305", 810 .driver.name = "rtc-ds1305",
811 .driver.owner = THIS_MODULE, 811 .driver.owner = THIS_MODULE,
812 .probe = ds1305_probe, 812 .probe = ds1305_probe,
813 .remove = __devexit_p(ds1305_remove), 813 .remove = ds1305_remove,
814 /* REVISIT add suspend/resume */ 814 /* REVISIT add suspend/resume */
815}; 815};
816 816
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 836710ce750..e0d0ba4de03 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -617,8 +617,8 @@ ds1307_nvram_write(struct file *filp, struct kobject *kobj,
617 617
618/*----------------------------------------------------------------------*/ 618/*----------------------------------------------------------------------*/
619 619
620static int __devinit ds1307_probe(struct i2c_client *client, 620static int ds1307_probe(struct i2c_client *client,
621 const struct i2c_device_id *id) 621 const struct i2c_device_id *id)
622{ 622{
623 struct ds1307 *ds1307; 623 struct ds1307 *ds1307;
624 int err = -ENODEV; 624 int err = -ENODEV;
@@ -938,7 +938,7 @@ exit_free:
938 return err; 938 return err;
939} 939}
940 940
941static int __devexit ds1307_remove(struct i2c_client *client) 941static int ds1307_remove(struct i2c_client *client)
942{ 942{
943 struct ds1307 *ds1307 = i2c_get_clientdata(client); 943 struct ds1307 *ds1307 = i2c_get_clientdata(client);
944 944
@@ -963,7 +963,7 @@ static struct i2c_driver ds1307_driver = {
963 .owner = THIS_MODULE, 963 .owner = THIS_MODULE,
964 }, 964 },
965 .probe = ds1307_probe, 965 .probe = ds1307_probe,
966 .remove = __devexit_p(ds1307_remove), 966 .remove = ds1307_remove,
967 .id_table = ds1307_id, 967 .id_table = ds1307_id,
968}; 968};
969 969
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 966316088b7..fef76868aae 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -391,7 +391,7 @@ out_free:
391 return ret; 391 return ret;
392} 392}
393 393
394static int __devexit ds1374_remove(struct i2c_client *client) 394static int ds1374_remove(struct i2c_client *client)
395{ 395{
396 struct ds1374 *ds1374 = i2c_get_clientdata(client); 396 struct ds1374 *ds1374 = i2c_get_clientdata(client);
397 397
@@ -442,7 +442,7 @@ static struct i2c_driver ds1374_driver = {
442 .pm = DS1374_PM, 442 .pm = DS1374_PM,
443 }, 443 },
444 .probe = ds1374_probe, 444 .probe = ds1374_probe,
445 .remove = __devexit_p(ds1374_remove), 445 .remove = ds1374_remove,
446 .id_table = ds1374_id, 446 .id_table = ds1374_id,
447}; 447};
448 448
diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c
index b0a99e1b25b..f994257981a 100644
--- a/drivers/rtc/rtc-ds1390.c
+++ b/drivers/rtc/rtc-ds1390.c
@@ -121,7 +121,7 @@ static const struct rtc_class_ops ds1390_rtc_ops = {
121 .set_time = ds1390_set_time, 121 .set_time = ds1390_set_time,
122}; 122};
123 123
124static int __devinit ds1390_probe(struct spi_device *spi) 124static int ds1390_probe(struct spi_device *spi)
125{ 125{
126 unsigned char tmp; 126 unsigned char tmp;
127 struct ds1390 *chip; 127 struct ds1390 *chip;
@@ -156,7 +156,7 @@ static int __devinit ds1390_probe(struct spi_device *spi)
156 return res; 156 return res;
157} 157}
158 158
159static int __devexit ds1390_remove(struct spi_device *spi) 159static int ds1390_remove(struct spi_device *spi)
160{ 160{
161 struct ds1390 *chip = spi_get_drvdata(spi); 161 struct ds1390 *chip = spi_get_drvdata(spi);
162 162
@@ -172,7 +172,7 @@ static struct spi_driver ds1390_driver = {
172 .owner = THIS_MODULE, 172 .owner = THIS_MODULE,
173 }, 173 },
174 .probe = ds1390_probe, 174 .probe = ds1390_probe,
175 .remove = __devexit_p(ds1390_remove), 175 .remove = ds1390_remove,
176}; 176};
177 177
178module_spi_driver(ds1390_driver); 178module_spi_driver(ds1390_driver);
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index 1f675f5294f..6a3fcfe3b0e 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -476,8 +476,7 @@ static struct bin_attribute ds1511_nvram_attr = {
476 .write = ds1511_nvram_write, 476 .write = ds1511_nvram_write,
477}; 477};
478 478
479 static int __devinit 479static int ds1511_rtc_probe(struct platform_device *pdev)
480ds1511_rtc_probe(struct platform_device *pdev)
481{ 480{
482 struct rtc_device *rtc; 481 struct rtc_device *rtc;
483 struct resource *res; 482 struct resource *res;
@@ -551,8 +550,7 @@ ds1511_rtc_probe(struct platform_device *pdev)
551 return ret; 550 return ret;
552} 551}
553 552
554 static int __devexit 553static int ds1511_rtc_remove(struct platform_device *pdev)
555ds1511_rtc_remove(struct platform_device *pdev)
556{ 554{
557 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 555 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
558 556
@@ -573,7 +571,7 @@ MODULE_ALIAS("platform:ds1511");
573 571
574static struct platform_driver ds1511_rtc_driver = { 572static struct platform_driver ds1511_rtc_driver = {
575 .probe = ds1511_rtc_probe, 573 .probe = ds1511_rtc_probe,
576 .remove = __devexit_p(ds1511_rtc_remove), 574 .remove = ds1511_rtc_remove,
577 .driver = { 575 .driver = {
578 .name = "ds1511", 576 .name = "ds1511",
579 .owner = THIS_MODULE, 577 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index 6ccedbbf923..25ce0621ade 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -276,7 +276,7 @@ static struct bin_attribute ds1553_nvram_attr = {
276 .write = ds1553_nvram_write, 276 .write = ds1553_nvram_write,
277}; 277};
278 278
279static int __devinit ds1553_rtc_probe(struct platform_device *pdev) 279static int ds1553_rtc_probe(struct platform_device *pdev)
280{ 280{
281 struct rtc_device *rtc; 281 struct rtc_device *rtc;
282 struct resource *res; 282 struct resource *res;
@@ -338,7 +338,7 @@ static int __devinit ds1553_rtc_probe(struct platform_device *pdev)
338 return ret; 338 return ret;
339} 339}
340 340
341static int __devexit ds1553_rtc_remove(struct platform_device *pdev) 341static int ds1553_rtc_remove(struct platform_device *pdev)
342{ 342{
343 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 343 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
344 344
@@ -354,7 +354,7 @@ MODULE_ALIAS("platform:rtc-ds1553");
354 354
355static struct platform_driver ds1553_rtc_driver = { 355static struct platform_driver ds1553_rtc_driver = {
356 .probe = ds1553_rtc_probe, 356 .probe = ds1553_rtc_probe,
357 .remove = __devexit_p(ds1553_rtc_remove), 357 .remove = ds1553_rtc_remove,
358 .driver = { 358 .driver = {
359 .name = "rtc-ds1553", 359 .name = "rtc-ds1553",
360 .owner = THIS_MODULE, 360 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index 76112667c50..609c870e2cc 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -159,7 +159,7 @@ static ssize_t ds1742_nvram_write(struct file *filp, struct kobject *kobj,
159 return count; 159 return count;
160} 160}
161 161
162static int __devinit ds1742_rtc_probe(struct platform_device *pdev) 162static int ds1742_rtc_probe(struct platform_device *pdev)
163{ 163{
164 struct rtc_device *rtc; 164 struct rtc_device *rtc;
165 struct resource *res; 165 struct resource *res;
@@ -222,7 +222,7 @@ static int __devinit ds1742_rtc_probe(struct platform_device *pdev)
222 return ret; 222 return ret;
223} 223}
224 224
225static int __devexit ds1742_rtc_remove(struct platform_device *pdev) 225static int ds1742_rtc_remove(struct platform_device *pdev)
226{ 226{
227 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 227 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
228 228
@@ -233,7 +233,7 @@ static int __devexit ds1742_rtc_remove(struct platform_device *pdev)
233 233
234static struct platform_driver ds1742_rtc_driver = { 234static struct platform_driver ds1742_rtc_driver = {
235 .probe = ds1742_rtc_probe, 235 .probe = ds1742_rtc_probe,
236 .remove = __devexit_p(ds1742_rtc_remove), 236 .remove = ds1742_rtc_remove,
237 .driver = { 237 .driver = {
238 .name = "rtc-ds1742", 238 .name = "rtc-ds1742",
239 .owner = THIS_MODULE, 239 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index e1945095814..db0ca08db31 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -391,8 +391,8 @@ static const struct rtc_class_ops ds3232_rtc_ops = {
391 .alarm_irq_enable = ds3232_alarm_irq_enable, 391 .alarm_irq_enable = ds3232_alarm_irq_enable,
392}; 392};
393 393
394static int __devinit ds3232_probe(struct i2c_client *client, 394static int ds3232_probe(struct i2c_client *client,
395 const struct i2c_device_id *id) 395 const struct i2c_device_id *id)
396{ 396{
397 struct ds3232 *ds3232; 397 struct ds3232 *ds3232;
398 int ret; 398 int ret;
@@ -439,7 +439,7 @@ out_free:
439 return ret; 439 return ret;
440} 440}
441 441
442static int __devexit ds3232_remove(struct i2c_client *client) 442static int ds3232_remove(struct i2c_client *client)
443{ 443{
444 struct ds3232 *ds3232 = i2c_get_clientdata(client); 444 struct ds3232 *ds3232 = i2c_get_clientdata(client);
445 445
@@ -469,7 +469,7 @@ static struct i2c_driver ds3232_driver = {
469 .owner = THIS_MODULE, 469 .owner = THIS_MODULE,
470 }, 470 },
471 .probe = ds3232_probe, 471 .probe = ds3232_probe,
472 .remove = __devexit_p(ds3232_remove), 472 .remove = ds3232_remove,
473 .id_table = ds3232_id, 473 .id_table = ds3232_id,
474}; 474};
475 475
diff --git a/drivers/rtc/rtc-ds3234.c b/drivers/rtc/rtc-ds3234.c
index fda707926f0..7a4495ef1c3 100644
--- a/drivers/rtc/rtc-ds3234.c
+++ b/drivers/rtc/rtc-ds3234.c
@@ -105,7 +105,7 @@ static const struct rtc_class_ops ds3234_rtc_ops = {
105 .set_time = ds3234_set_time, 105 .set_time = ds3234_set_time,
106}; 106};
107 107
108static int __devinit ds3234_probe(struct spi_device *spi) 108static int ds3234_probe(struct spi_device *spi)
109{ 109{
110 struct rtc_device *rtc; 110 struct rtc_device *rtc;
111 unsigned char tmp; 111 unsigned char tmp;
@@ -156,7 +156,7 @@ static int __devinit ds3234_probe(struct spi_device *spi)
156 return 0; 156 return 0;
157} 157}
158 158
159static int __devexit ds3234_remove(struct spi_device *spi) 159static int ds3234_remove(struct spi_device *spi)
160{ 160{
161 struct rtc_device *rtc = spi_get_drvdata(spi); 161 struct rtc_device *rtc = spi_get_drvdata(spi);
162 162
@@ -170,7 +170,7 @@ static struct spi_driver ds3234_driver = {
170 .owner = THIS_MODULE, 170 .owner = THIS_MODULE,
171 }, 171 },
172 .probe = ds3234_probe, 172 .probe = ds3234_probe,
173 .remove = __devexit_p(ds3234_remove), 173 .remove = ds3234_remove,
174}; 174};
175 175
176module_spi_driver(ds3234_driver); 176module_spi_driver(ds3234_driver);
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 9602278ff98..1a4e5e4a70c 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -127,7 +127,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = {
127 .attrs = ep93xx_rtc_attrs, 127 .attrs = ep93xx_rtc_attrs,
128}; 128};
129 129
130static int __devinit ep93xx_rtc_probe(struct platform_device *pdev) 130static int ep93xx_rtc_probe(struct platform_device *pdev)
131{ 131{
132 struct ep93xx_rtc *ep93xx_rtc; 132 struct ep93xx_rtc *ep93xx_rtc;
133 struct resource *res; 133 struct resource *res;
@@ -174,7 +174,7 @@ exit:
174 return err; 174 return err;
175} 175}
176 176
177static int __devexit ep93xx_rtc_remove(struct platform_device *pdev) 177static int ep93xx_rtc_remove(struct platform_device *pdev)
178{ 178{
179 struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); 179 struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);
180 180
@@ -192,7 +192,7 @@ static struct platform_driver ep93xx_rtc_driver = {
192 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
193 }, 193 },
194 .probe = ep93xx_rtc_probe, 194 .probe = ep93xx_rtc_probe,
195 .remove = __devexit_p(ep93xx_rtc_remove), 195 .remove = ep93xx_rtc_remove,
196}; 196};
197 197
198module_platform_driver(ep93xx_rtc_driver); 198module_platform_driver(ep93xx_rtc_driver);
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c
index 86b6ecce99f..04e93c6597f 100644
--- a/drivers/rtc/rtc-fm3130.c
+++ b/drivers/rtc/rtc-fm3130.c
@@ -361,8 +361,8 @@ static const struct rtc_class_ops fm3130_rtc_ops = {
361 361
362static struct i2c_driver fm3130_driver; 362static struct i2c_driver fm3130_driver;
363 363
364static int __devinit fm3130_probe(struct i2c_client *client, 364static int fm3130_probe(struct i2c_client *client,
365 const struct i2c_device_id *id) 365 const struct i2c_device_id *id)
366{ 366{
367 struct fm3130 *fm3130; 367 struct fm3130 *fm3130;
368 int err = -ENODEV; 368 int err = -ENODEV;
@@ -546,7 +546,7 @@ exit_free:
546 return err; 546 return err;
547} 547}
548 548
549static int __devexit fm3130_remove(struct i2c_client *client) 549static int fm3130_remove(struct i2c_client *client)
550{ 550{
551 struct fm3130 *fm3130 = i2c_get_clientdata(client); 551 struct fm3130 *fm3130 = i2c_get_clientdata(client);
552 552
@@ -561,7 +561,7 @@ static struct i2c_driver fm3130_driver = {
561 .owner = THIS_MODULE, 561 .owner = THIS_MODULE,
562 }, 562 },
563 .probe = fm3130_probe, 563 .probe = fm3130_probe,
564 .remove = __devexit_p(fm3130_remove), 564 .remove = fm3130_remove,
565 .id_table = fm3130_id, 565 .id_table = fm3130_id,
566}; 566};
567 567
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c
index 8da7a5cf83c..75d307ab37f 100644
--- a/drivers/rtc/rtc-imxdi.c
+++ b/drivers/rtc/rtc-imxdi.c
@@ -480,7 +480,7 @@ err:
480 return rc; 480 return rc;
481} 481}
482 482
483static int __devexit dryice_rtc_remove(struct platform_device *pdev) 483static int dryice_rtc_remove(struct platform_device *pdev)
484{ 484{
485 struct imxdi_dev *imxdi = platform_get_drvdata(pdev); 485 struct imxdi_dev *imxdi = platform_get_drvdata(pdev);
486 486
@@ -512,7 +512,7 @@ static struct platform_driver dryice_rtc_driver = {
512 .owner = THIS_MODULE, 512 .owner = THIS_MODULE,
513 .of_match_table = of_match_ptr(dryice_dt_ids), 513 .of_match_table = of_match_ptr(dryice_dt_ids),
514 }, 514 },
515 .remove = __devexit_p(dryice_rtc_remove), 515 .remove = dryice_rtc_remove,
516}; 516};
517 517
518static int __init dryice_rtc_init(void) 518static int __init dryice_rtc_init(void)
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 1224182d3ea..1e48686ca6d 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -210,7 +210,7 @@ void jz4740_rtc_poweroff(struct device *dev)
210} 210}
211EXPORT_SYMBOL_GPL(jz4740_rtc_poweroff); 211EXPORT_SYMBOL_GPL(jz4740_rtc_poweroff);
212 212
213static int __devinit jz4740_rtc_probe(struct platform_device *pdev) 213static int jz4740_rtc_probe(struct platform_device *pdev)
214{ 214{
215 int ret; 215 int ret;
216 struct jz4740_rtc *rtc; 216 struct jz4740_rtc *rtc;
@@ -297,7 +297,7 @@ err_free:
297 return ret; 297 return ret;
298} 298}
299 299
300static int __devexit jz4740_rtc_remove(struct platform_device *pdev) 300static int jz4740_rtc_remove(struct platform_device *pdev)
301{ 301{
302 struct jz4740_rtc *rtc = platform_get_drvdata(pdev); 302 struct jz4740_rtc *rtc = platform_get_drvdata(pdev);
303 303
@@ -347,7 +347,7 @@ static const struct dev_pm_ops jz4740_pm_ops = {
347 347
348static struct platform_driver jz4740_rtc_driver = { 348static struct platform_driver jz4740_rtc_driver = {
349 .probe = jz4740_rtc_probe, 349 .probe = jz4740_rtc_probe,
350 .remove = __devexit_p(jz4740_rtc_remove), 350 .remove = jz4740_rtc_remove,
351 .driver = { 351 .driver = {
352 .name = "jz4740-rtc", 352 .name = "jz4740-rtc",
353 .owner = THIS_MODULE, 353 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c
index d5218553741..40a598332ba 100644
--- a/drivers/rtc/rtc-lpc32xx.c
+++ b/drivers/rtc/rtc-lpc32xx.c
@@ -197,7 +197,7 @@ static const struct rtc_class_ops lpc32xx_rtc_ops = {
197 .alarm_irq_enable = lpc32xx_rtc_alarm_irq_enable, 197 .alarm_irq_enable = lpc32xx_rtc_alarm_irq_enable,
198}; 198};
199 199
200static int __devinit lpc32xx_rtc_probe(struct platform_device *pdev) 200static int lpc32xx_rtc_probe(struct platform_device *pdev)
201{ 201{
202 struct resource *res; 202 struct resource *res;
203 struct lpc32xx_rtc *rtc; 203 struct lpc32xx_rtc *rtc;
@@ -299,7 +299,7 @@ static int __devinit lpc32xx_rtc_probe(struct platform_device *pdev)
299 return 0; 299 return 0;
300} 300}
301 301
302static int __devexit lpc32xx_rtc_remove(struct platform_device *pdev) 302static int lpc32xx_rtc_remove(struct platform_device *pdev)
303{ 303{
304 struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev); 304 struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
305 305
@@ -397,7 +397,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_rtc_match);
397 397
398static struct platform_driver lpc32xx_rtc_driver = { 398static struct platform_driver lpc32xx_rtc_driver = {
399 .probe = lpc32xx_rtc_probe, 399 .probe = lpc32xx_rtc_probe,
400 .remove = __devexit_p(lpc32xx_rtc_remove), 400 .remove = lpc32xx_rtc_remove,
401 .driver = { 401 .driver = {
402 .name = RTC_NAME, 402 .name = RTC_NAME,
403 .owner = THIS_MODULE, 403 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c
index 07e81c5f824..f59b6349551 100644
--- a/drivers/rtc/rtc-ls1x.c
+++ b/drivers/rtc/rtc-ls1x.c
@@ -143,7 +143,7 @@ static struct rtc_class_ops ls1x_rtc_ops = {
143 .set_time = ls1x_rtc_set_time, 143 .set_time = ls1x_rtc_set_time,
144}; 144};
145 145
146static int __devinit ls1x_rtc_probe(struct platform_device *pdev) 146static int ls1x_rtc_probe(struct platform_device *pdev)
147{ 147{
148 struct rtc_device *rtcdev; 148 struct rtc_device *rtcdev;
149 unsigned long v; 149 unsigned long v;
@@ -185,7 +185,7 @@ err:
185 return ret; 185 return ret;
186} 186}
187 187
188static int __devexit ls1x_rtc_remove(struct platform_device *pdev) 188static int ls1x_rtc_remove(struct platform_device *pdev)
189{ 189{
190 struct rtc_device *rtcdev = platform_get_drvdata(pdev); 190 struct rtc_device *rtcdev = platform_get_drvdata(pdev);
191 191
@@ -200,7 +200,7 @@ static struct platform_driver ls1x_rtc_driver = {
200 .name = "ls1x-rtc", 200 .name = "ls1x-rtc",
201 .owner = THIS_MODULE, 201 .owner = THIS_MODULE,
202 }, 202 },
203 .remove = __devexit_p(ls1x_rtc_remove), 203 .remove = ls1x_rtc_remove,
204 .probe = ls1x_rtc_probe, 204 .probe = ls1x_rtc_probe,
205}; 205};
206 206
diff --git a/drivers/rtc/rtc-m41t93.c b/drivers/rtc/rtc-m41t93.c
index efab3d48cb1..49169680786 100644
--- a/drivers/rtc/rtc-m41t93.c
+++ b/drivers/rtc/rtc-m41t93.c
@@ -170,7 +170,7 @@ static const struct rtc_class_ops m41t93_rtc_ops = {
170 170
171static struct spi_driver m41t93_driver; 171static struct spi_driver m41t93_driver;
172 172
173static int __devinit m41t93_probe(struct spi_device *spi) 173static int m41t93_probe(struct spi_device *spi)
174{ 174{
175 struct rtc_device *rtc; 175 struct rtc_device *rtc;
176 int res; 176 int res;
@@ -195,7 +195,7 @@ static int __devinit m41t93_probe(struct spi_device *spi)
195} 195}
196 196
197 197
198static int __devexit m41t93_remove(struct spi_device *spi) 198static int m41t93_remove(struct spi_device *spi)
199{ 199{
200 struct rtc_device *rtc = spi_get_drvdata(spi); 200 struct rtc_device *rtc = spi_get_drvdata(spi);
201 201
@@ -211,7 +211,7 @@ static struct spi_driver m41t93_driver = {
211 .owner = THIS_MODULE, 211 .owner = THIS_MODULE,
212 }, 212 },
213 .probe = m41t93_probe, 213 .probe = m41t93_probe,
214 .remove = __devexit_p(m41t93_remove), 214 .remove = m41t93_remove,
215}; 215};
216 216
217module_spi_driver(m41t93_driver); 217module_spi_driver(m41t93_driver);
diff --git a/drivers/rtc/rtc-m41t94.c b/drivers/rtc/rtc-m41t94.c
index 6e78193e026..89266c6764b 100644
--- a/drivers/rtc/rtc-m41t94.c
+++ b/drivers/rtc/rtc-m41t94.c
@@ -110,7 +110,7 @@ static const struct rtc_class_ops m41t94_rtc_ops = {
110 110
111static struct spi_driver m41t94_driver; 111static struct spi_driver m41t94_driver;
112 112
113static int __devinit m41t94_probe(struct spi_device *spi) 113static int m41t94_probe(struct spi_device *spi)
114{ 114{
115 struct rtc_device *rtc; 115 struct rtc_device *rtc;
116 int res; 116 int res;
@@ -134,7 +134,7 @@ static int __devinit m41t94_probe(struct spi_device *spi)
134 return 0; 134 return 0;
135} 135}
136 136
137static int __devexit m41t94_remove(struct spi_device *spi) 137static int m41t94_remove(struct spi_device *spi)
138{ 138{
139 struct rtc_device *rtc = spi_get_drvdata(spi); 139 struct rtc_device *rtc = spi_get_drvdata(spi);
140 140
@@ -150,7 +150,7 @@ static struct spi_driver m41t94_driver = {
150 .owner = THIS_MODULE, 150 .owner = THIS_MODULE,
151 }, 151 },
152 .probe = m41t94_probe, 152 .probe = m41t94_probe,
153 .remove = __devexit_p(m41t94_remove), 153 .remove = m41t94_remove,
154}; 154};
155 155
156module_spi_driver(m41t94_driver); 156module_spi_driver(m41t94_driver);
diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c
index f9e3b358373..31c9190a1fc 100644
--- a/drivers/rtc/rtc-m48t35.c
+++ b/drivers/rtc/rtc-m48t35.c
@@ -141,7 +141,7 @@ static const struct rtc_class_ops m48t35_ops = {
141 .set_time = m48t35_set_time, 141 .set_time = m48t35_set_time,
142}; 142};
143 143
144static int __devinit m48t35_probe(struct platform_device *pdev) 144static int m48t35_probe(struct platform_device *pdev)
145{ 145{
146 struct resource *res; 146 struct resource *res;
147 struct m48t35_priv *priv; 147 struct m48t35_priv *priv;
@@ -194,7 +194,7 @@ out:
194 return ret; 194 return ret;
195} 195}
196 196
197static int __devexit m48t35_remove(struct platform_device *pdev) 197static int m48t35_remove(struct platform_device *pdev)
198{ 198{
199 struct m48t35_priv *priv = platform_get_drvdata(pdev); 199 struct m48t35_priv *priv = platform_get_drvdata(pdev);
200 200
@@ -213,7 +213,7 @@ static struct platform_driver m48t35_platform_driver = {
213 .owner = THIS_MODULE, 213 .owner = THIS_MODULE,
214 }, 214 },
215 .probe = m48t35_probe, 215 .probe = m48t35_probe,
216 .remove = __devexit_p(m48t35_remove), 216 .remove = m48t35_remove,
217}; 217};
218 218
219module_platform_driver(m48t35_platform_driver); 219module_platform_driver(m48t35_platform_driver);
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index 30ebfec9fd2..130f29af386 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -383,7 +383,7 @@ static struct bin_attribute m48t59_nvram_attr = {
383 .write = m48t59_nvram_write, 383 .write = m48t59_nvram_write,
384}; 384};
385 385
386static int __devinit m48t59_rtc_probe(struct platform_device *pdev) 386static int m48t59_rtc_probe(struct platform_device *pdev)
387{ 387{
388 struct m48t59_plat_data *pdata = pdev->dev.platform_data; 388 struct m48t59_plat_data *pdata = pdev->dev.platform_data;
389 struct m48t59_private *m48t59 = NULL; 389 struct m48t59_private *m48t59 = NULL;
@@ -501,7 +501,7 @@ out:
501 return ret; 501 return ret;
502} 502}
503 503
504static int __devexit m48t59_rtc_remove(struct platform_device *pdev) 504static int m48t59_rtc_remove(struct platform_device *pdev)
505{ 505{
506 struct m48t59_private *m48t59 = platform_get_drvdata(pdev); 506 struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
507 struct m48t59_plat_data *pdata = pdev->dev.platform_data; 507 struct m48t59_plat_data *pdata = pdev->dev.platform_data;
@@ -527,7 +527,7 @@ static struct platform_driver m48t59_rtc_driver = {
527 .owner = THIS_MODULE, 527 .owner = THIS_MODULE,
528 }, 528 },
529 .probe = m48t59_rtc_probe, 529 .probe = m48t59_rtc_probe,
530 .remove = __devexit_p(m48t59_rtc_remove), 530 .remove = m48t59_rtc_remove,
531}; 531};
532 532
533module_platform_driver(m48t59_rtc_driver); 533module_platform_driver(m48t59_rtc_driver);
diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c
index 863fb3363aa..2ffbcacd243 100644
--- a/drivers/rtc/rtc-m48t86.c
+++ b/drivers/rtc/rtc-m48t86.c
@@ -144,7 +144,7 @@ static const struct rtc_class_ops m48t86_rtc_ops = {
144 .proc = m48t86_rtc_proc, 144 .proc = m48t86_rtc_proc,
145}; 145};
146 146
147static int __devinit m48t86_rtc_probe(struct platform_device *dev) 147static int m48t86_rtc_probe(struct platform_device *dev)
148{ 148{
149 unsigned char reg; 149 unsigned char reg;
150 struct m48t86_ops *ops = dev->dev.platform_data; 150 struct m48t86_ops *ops = dev->dev.platform_data;
@@ -164,7 +164,7 @@ static int __devinit m48t86_rtc_probe(struct platform_device *dev)
164 return 0; 164 return 0;
165} 165}
166 166
167static int __devexit m48t86_rtc_remove(struct platform_device *dev) 167static int m48t86_rtc_remove(struct platform_device *dev)
168{ 168{
169 struct rtc_device *rtc = platform_get_drvdata(dev); 169 struct rtc_device *rtc = platform_get_drvdata(dev);
170 170
@@ -182,7 +182,7 @@ static struct platform_driver m48t86_rtc_platform_driver = {
182 .owner = THIS_MODULE, 182 .owner = THIS_MODULE,
183 }, 183 },
184 .probe = m48t86_rtc_probe, 184 .probe = m48t86_rtc_probe,
185 .remove = __devexit_p(m48t86_rtc_remove), 185 .remove = m48t86_rtc_remove,
186}; 186};
187 187
188module_platform_driver(m48t86_rtc_platform_driver); 188module_platform_driver(m48t86_rtc_platform_driver);
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index 36c74d22e8b..7d0bf698b79 100644
--- a/drivers/rtc/rtc-max6902.c
+++ b/drivers/rtc/rtc-max6902.c
@@ -120,7 +120,7 @@ static const struct rtc_class_ops max6902_rtc_ops = {
120 .set_time = max6902_set_time, 120 .set_time = max6902_set_time,
121}; 121};
122 122
123static int __devinit max6902_probe(struct spi_device *spi) 123static int max6902_probe(struct spi_device *spi)
124{ 124{
125 struct rtc_device *rtc; 125 struct rtc_device *rtc;
126 unsigned char tmp; 126 unsigned char tmp;
@@ -143,7 +143,7 @@ static int __devinit max6902_probe(struct spi_device *spi)
143 return 0; 143 return 0;
144} 144}
145 145
146static int __devexit max6902_remove(struct spi_device *spi) 146static int max6902_remove(struct spi_device *spi)
147{ 147{
148 struct rtc_device *rtc = dev_get_drvdata(&spi->dev); 148 struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
149 149
@@ -157,7 +157,7 @@ static struct spi_driver max6902_driver = {
157 .owner = THIS_MODULE, 157 .owner = THIS_MODULE,
158 }, 158 },
159 .probe = max6902_probe, 159 .probe = max6902_probe,
160 .remove = __devexit_p(max6902_remove), 160 .remove = max6902_remove,
161}; 161};
162 162
163module_spi_driver(max6902_driver); 163module_spi_driver(max6902_driver);
diff --git a/drivers/rtc/rtc-max8907.c b/drivers/rtc/rtc-max8907.c
index e094ffa434f..1d049da16c8 100644
--- a/drivers/rtc/rtc-max8907.c
+++ b/drivers/rtc/rtc-max8907.c
@@ -176,7 +176,7 @@ static const struct rtc_class_ops max8907_rtc_ops = {
176 .set_alarm = max8907_rtc_set_alarm, 176 .set_alarm = max8907_rtc_set_alarm,
177}; 177};
178 178
179static int __devinit max8907_rtc_probe(struct platform_device *pdev) 179static int max8907_rtc_probe(struct platform_device *pdev)
180{ 180{
181 struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent); 181 struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent);
182 struct max8907_rtc *rtc; 182 struct max8907_rtc *rtc;
@@ -220,7 +220,7 @@ err_unregister:
220 return ret; 220 return ret;
221} 221}
222 222
223static int __devexit max8907_rtc_remove(struct platform_device *pdev) 223static int max8907_rtc_remove(struct platform_device *pdev)
224{ 224{
225 struct max8907_rtc *rtc = platform_get_drvdata(pdev); 225 struct max8907_rtc *rtc = platform_get_drvdata(pdev);
226 226
@@ -236,7 +236,7 @@ static struct platform_driver max8907_rtc_driver = {
236 .owner = THIS_MODULE, 236 .owner = THIS_MODULE,
237 }, 237 },
238 .probe = max8907_rtc_probe, 238 .probe = max8907_rtc_probe,
239 .remove = __devexit_p(max8907_rtc_remove), 239 .remove = max8907_rtc_remove,
240}; 240};
241module_platform_driver(max8907_rtc_driver); 241module_platform_driver(max8907_rtc_driver);
242 242
diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 34e4349611d..a0c8265646d 100644
--- a/drivers/rtc/rtc-max8925.c
+++ b/drivers/rtc/rtc-max8925.c
@@ -247,7 +247,7 @@ static const struct rtc_class_ops max8925_rtc_ops = {
247 .set_alarm = max8925_rtc_set_alarm, 247 .set_alarm = max8925_rtc_set_alarm,
248}; 248};
249 249
250static int __devinit max8925_rtc_probe(struct platform_device *pdev) 250static int max8925_rtc_probe(struct platform_device *pdev)
251{ 251{
252 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); 252 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
253 struct max8925_rtc_info *info; 253 struct max8925_rtc_info *info;
@@ -292,7 +292,7 @@ out_irq:
292 return ret; 292 return ret;
293} 293}
294 294
295static int __devexit max8925_rtc_remove(struct platform_device *pdev) 295static int max8925_rtc_remove(struct platform_device *pdev)
296{ 296{
297 struct max8925_rtc_info *info = platform_get_drvdata(pdev); 297 struct max8925_rtc_info *info = platform_get_drvdata(pdev);
298 298
@@ -334,7 +334,7 @@ static struct platform_driver max8925_rtc_driver = {
334 .pm = &max8925_rtc_pm_ops, 334 .pm = &max8925_rtc_pm_ops,
335 }, 335 },
336 .probe = max8925_rtc_probe, 336 .probe = max8925_rtc_probe,
337 .remove = __devexit_p(max8925_rtc_remove), 337 .remove = max8925_rtc_remove,
338}; 338};
339 339
340module_platform_driver(max8925_rtc_driver); 340module_platform_driver(max8925_rtc_driver);
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index 7196f438c08..8f234a075e8 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -249,7 +249,7 @@ static const struct rtc_class_ops max8998_rtc_ops = {
249 .alarm_irq_enable = max8998_rtc_alarm_irq_enable, 249 .alarm_irq_enable = max8998_rtc_alarm_irq_enable,
250}; 250};
251 251
252static int __devinit max8998_rtc_probe(struct platform_device *pdev) 252static int max8998_rtc_probe(struct platform_device *pdev)
253{ 253{
254 struct max8998_dev *max8998 = dev_get_drvdata(pdev->dev.parent); 254 struct max8998_dev *max8998 = dev_get_drvdata(pdev->dev.parent);
255 struct max8998_platform_data *pdata = dev_get_platdata(max8998->dev); 255 struct max8998_platform_data *pdata = dev_get_platdata(max8998->dev);
@@ -298,7 +298,7 @@ out_rtc:
298 return ret; 298 return ret;
299} 299}
300 300
301static int __devexit max8998_rtc_remove(struct platform_device *pdev) 301static int max8998_rtc_remove(struct platform_device *pdev)
302{ 302{
303 struct max8998_rtc_info *info = platform_get_drvdata(pdev); 303 struct max8998_rtc_info *info = platform_get_drvdata(pdev);
304 304
@@ -323,7 +323,7 @@ static struct platform_driver max8998_rtc_driver = {
323 .owner = THIS_MODULE, 323 .owner = THIS_MODULE,
324 }, 324 },
325 .probe = max8998_rtc_probe, 325 .probe = max8998_rtc_probe,
326 .remove = __devexit_p(max8998_rtc_remove), 326 .remove = max8998_rtc_remove,
327 .id_table = max8998_rtc_id, 327 .id_table = max8998_rtc_id,
328}; 328};
329 329
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 029e421baae..bec10be96f8 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -306,7 +306,7 @@ static const struct rtc_class_ops mpc5200_rtc_ops = {
306 .alarm_irq_enable = mpc5121_rtc_alarm_irq_enable, 306 .alarm_irq_enable = mpc5121_rtc_alarm_irq_enable,
307}; 307};
308 308
309static int __devinit mpc5121_rtc_probe(struct platform_device *op) 309static int mpc5121_rtc_probe(struct platform_device *op)
310{ 310{
311 struct mpc5121_rtc_data *rtc; 311 struct mpc5121_rtc_data *rtc;
312 int err = 0; 312 int err = 0;
@@ -382,7 +382,7 @@ out_free:
382 return err; 382 return err;
383} 383}
384 384
385static int __devexit mpc5121_rtc_remove(struct platform_device *op) 385static int mpc5121_rtc_remove(struct platform_device *op)
386{ 386{
387 struct mpc5121_rtc_data *rtc = dev_get_drvdata(&op->dev); 387 struct mpc5121_rtc_data *rtc = dev_get_drvdata(&op->dev);
388 struct mpc5121_rtc_regs __iomem *regs = rtc->regs; 388 struct mpc5121_rtc_regs __iomem *regs = rtc->regs;
@@ -403,7 +403,7 @@ static int __devexit mpc5121_rtc_remove(struct platform_device *op)
403 return 0; 403 return 0;
404} 404}
405 405
406static struct of_device_id mpc5121_rtc_match[] __devinitdata = { 406static struct of_device_id mpc5121_rtc_match[] = {
407 { .compatible = "fsl,mpc5121-rtc", }, 407 { .compatible = "fsl,mpc5121-rtc", },
408 { .compatible = "fsl,mpc5200-rtc", }, 408 { .compatible = "fsl,mpc5200-rtc", },
409 {}, 409 {},
@@ -416,7 +416,7 @@ static struct platform_driver mpc5121_rtc_driver = {
416 .of_match_table = mpc5121_rtc_match, 416 .of_match_table = mpc5121_rtc_match,
417 }, 417 },
418 .probe = mpc5121_rtc_probe, 418 .probe = mpc5121_rtc_probe,
419 .remove = __devexit_p(mpc5121_rtc_remove), 419 .remove = mpc5121_rtc_remove,
420}; 420};
421 421
422module_platform_driver(mpc5121_rtc_driver); 422module_platform_driver(mpc5121_rtc_driver);
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index f51719bf4a7..578baf9d972 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -322,8 +322,8 @@ static irqreturn_t mrst_rtc_irq(int irq, void *p)
322 return IRQ_NONE; 322 return IRQ_NONE;
323} 323}
324 324
325static int __devinit 325static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
326vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq) 326 int rtc_irq)
327{ 327{
328 int retval = 0; 328 int retval = 0;
329 unsigned char rtc_control; 329 unsigned char rtc_control;
@@ -394,7 +394,7 @@ static void rtc_mrst_do_shutdown(void)
394 spin_unlock_irq(&rtc_lock); 394 spin_unlock_irq(&rtc_lock);
395} 395}
396 396
397static void __devexit rtc_mrst_do_remove(struct device *dev) 397static void rtc_mrst_do_remove(struct device *dev)
398{ 398{
399 struct mrst_rtc *mrst = dev_get_drvdata(dev); 399 struct mrst_rtc *mrst = dev_get_drvdata(dev);
400 struct resource *iomem; 400 struct resource *iomem;
@@ -503,14 +503,14 @@ static inline int mrst_poweroff(struct device *dev)
503 503
504#endif 504#endif
505 505
506static int __devinit vrtc_mrst_platform_probe(struct platform_device *pdev) 506static int vrtc_mrst_platform_probe(struct platform_device *pdev)
507{ 507{
508 return vrtc_mrst_do_probe(&pdev->dev, 508 return vrtc_mrst_do_probe(&pdev->dev,
509 platform_get_resource(pdev, IORESOURCE_MEM, 0), 509 platform_get_resource(pdev, IORESOURCE_MEM, 0),
510 platform_get_irq(pdev, 0)); 510 platform_get_irq(pdev, 0));
511} 511}
512 512
513static int __devexit vrtc_mrst_platform_remove(struct platform_device *pdev) 513static int vrtc_mrst_platform_remove(struct platform_device *pdev)
514{ 514{
515 rtc_mrst_do_remove(&pdev->dev); 515 rtc_mrst_do_remove(&pdev->dev);
516 return 0; 516 return 0;
@@ -528,7 +528,7 @@ MODULE_ALIAS("platform:vrtc_mrst");
528 528
529static struct platform_driver vrtc_mrst_platform_driver = { 529static struct platform_driver vrtc_mrst_platform_driver = {
530 .probe = vrtc_mrst_platform_probe, 530 .probe = vrtc_mrst_platform_probe,
531 .remove = __devexit_p(vrtc_mrst_platform_remove), 531 .remove = vrtc_mrst_platform_remove,
532 .shutdown = vrtc_mrst_platform_shutdown, 532 .shutdown = vrtc_mrst_platform_shutdown,
533 .driver = { 533 .driver = {
534 .name = (char *) driver_name, 534 .name = (char *) driver_name,
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index ebc1649d45d..57233c88599 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -215,7 +215,7 @@ static const struct rtc_class_ops mv_rtc_alarm_ops = {
215 .alarm_irq_enable = mv_rtc_alarm_irq_enable, 215 .alarm_irq_enable = mv_rtc_alarm_irq_enable,
216}; 216};
217 217
218static int __devinit mv_rtc_probe(struct platform_device *pdev) 218static int mv_rtc_probe(struct platform_device *pdev)
219{ 219{
220 struct resource *res; 220 struct resource *res;
221 struct rtc_plat_data *pdata; 221 struct rtc_plat_data *pdata;
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 7304139934a..1c3ef728956 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -368,7 +368,7 @@ static struct rtc_class_ops mxc_rtc_ops = {
368 .alarm_irq_enable = mxc_rtc_alarm_irq_enable, 368 .alarm_irq_enable = mxc_rtc_alarm_irq_enable,
369}; 369};
370 370
371static int __devinit mxc_rtc_probe(struct platform_device *pdev) 371static int mxc_rtc_probe(struct platform_device *pdev)
372{ 372{
373 struct resource *res; 373 struct resource *res;
374 struct rtc_device *rtc; 374 struct rtc_device *rtc;
@@ -460,7 +460,7 @@ exit_free_pdata:
460 return ret; 460 return ret;
461} 461}
462 462
463static int __devexit mxc_rtc_remove(struct platform_device *pdev) 463static int mxc_rtc_remove(struct platform_device *pdev)
464{ 464{
465 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 465 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
466 466
@@ -509,7 +509,7 @@ static struct platform_driver mxc_rtc_driver = {
509 }, 509 },
510 .id_table = imx_rtc_devtype, 510 .id_table = imx_rtc_devtype,
511 .probe = mxc_rtc_probe, 511 .probe = mxc_rtc_probe,
512 .remove = __devexit_p(mxc_rtc_remove), 512 .remove = mxc_rtc_remove,
513}; 513};
514 514
515module_platform_driver(mxc_rtc_driver) 515module_platform_driver(mxc_rtc_driver)
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
index b79010987d1..a63680850fe 100644
--- a/drivers/rtc/rtc-nuc900.c
+++ b/drivers/rtc/rtc-nuc900.c
@@ -222,7 +222,7 @@ static struct rtc_class_ops nuc900_rtc_ops = {
222 .alarm_irq_enable = nuc900_alarm_irq_enable, 222 .alarm_irq_enable = nuc900_alarm_irq_enable,
223}; 223};
224 224
225static int __devinit nuc900_rtc_probe(struct platform_device *pdev) 225static int nuc900_rtc_probe(struct platform_device *pdev)
226{ 226{
227 struct resource *res; 227 struct resource *res;
228 struct nuc900_rtc *nuc900_rtc; 228 struct nuc900_rtc *nuc900_rtc;
@@ -284,7 +284,7 @@ fail1: kfree(nuc900_rtc);
284 return err; 284 return err;
285} 285}
286 286
287static int __devexit nuc900_rtc_remove(struct platform_device *pdev) 287static int nuc900_rtc_remove(struct platform_device *pdev)
288{ 288{
289 struct nuc900_rtc *nuc900_rtc = platform_get_drvdata(pdev); 289 struct nuc900_rtc *nuc900_rtc = platform_get_drvdata(pdev);
290 struct resource *res; 290 struct resource *res;
@@ -304,7 +304,7 @@ static int __devexit nuc900_rtc_remove(struct platform_device *pdev)
304} 304}
305 305
306static struct platform_driver nuc900_rtc_driver = { 306static struct platform_driver nuc900_rtc_driver = {
307 .remove = __devexit_p(nuc900_rtc_remove), 307 .remove = nuc900_rtc_remove,
308 .driver = { 308 .driver = {
309 .name = "nuc900-rtc", 309 .name = "nuc900-rtc",
310 .owner = THIS_MODULE, 310 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c
index cd4f198cc2e..e0019cd0bf7 100644
--- a/drivers/rtc/rtc-pcap.c
+++ b/drivers/rtc/rtc-pcap.c
@@ -139,7 +139,7 @@ static const struct rtc_class_ops pcap_rtc_ops = {
139 .alarm_irq_enable = pcap_rtc_alarm_irq_enable, 139 .alarm_irq_enable = pcap_rtc_alarm_irq_enable,
140}; 140};
141 141
142static int __devinit pcap_rtc_probe(struct platform_device *pdev) 142static int pcap_rtc_probe(struct platform_device *pdev)
143{ 143{
144 struct pcap_rtc *pcap_rtc; 144 struct pcap_rtc *pcap_rtc;
145 int timer_irq, alarm_irq; 145 int timer_irq, alarm_irq;
@@ -183,7 +183,7 @@ fail_rtc:
183 return err; 183 return err;
184} 184}
185 185
186static int __devexit pcap_rtc_remove(struct platform_device *pdev) 186static int pcap_rtc_remove(struct platform_device *pdev)
187{ 187{
188 struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); 188 struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
189 189
@@ -196,7 +196,7 @@ static int __devexit pcap_rtc_remove(struct platform_device *pdev)
196} 196}
197 197
198static struct platform_driver pcap_rtc_driver = { 198static struct platform_driver pcap_rtc_driver = {
199 .remove = __devexit_p(pcap_rtc_remove), 199 .remove = pcap_rtc_remove,
200 .driver = { 200 .driver = {
201 .name = "pcap-rtc", 201 .name = "pcap-rtc",
202 .owner = THIS_MODULE, 202 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c
index 13e4df63974..02b742afa76 100644
--- a/drivers/rtc/rtc-pcf2123.c
+++ b/drivers/rtc/rtc-pcf2123.c
@@ -219,7 +219,7 @@ static const struct rtc_class_ops pcf2123_rtc_ops = {
219 .set_time = pcf2123_rtc_set_time, 219 .set_time = pcf2123_rtc_set_time,
220}; 220};
221 221
222static int __devinit pcf2123_probe(struct spi_device *spi) 222static int pcf2123_probe(struct spi_device *spi)
223{ 223{
224 struct rtc_device *rtc; 224 struct rtc_device *rtc;
225 struct pcf2123_plat_data *pdata; 225 struct pcf2123_plat_data *pdata;
@@ -319,7 +319,7 @@ kfree_exit:
319 return ret; 319 return ret;
320} 320}
321 321
322static int __devexit pcf2123_remove(struct spi_device *spi) 322static int pcf2123_remove(struct spi_device *spi)
323{ 323{
324 struct pcf2123_plat_data *pdata = spi->dev.platform_data; 324 struct pcf2123_plat_data *pdata = spi->dev.platform_data;
325 int i; 325 int i;
@@ -345,7 +345,7 @@ static struct spi_driver pcf2123_driver = {
345 .owner = THIS_MODULE, 345 .owner = THIS_MODULE,
346 }, 346 },
347 .probe = pcf2123_probe, 347 .probe = pcf2123_probe,
348 .remove = __devexit_p(pcf2123_remove), 348 .remove = pcf2123_remove,
349}; 349};
350 350
351module_spi_driver(pcf2123_driver); 351module_spi_driver(pcf2123_driver);
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index a20202f9ee5..e9f3135d305 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -248,7 +248,7 @@ static void pcf50633_rtc_irq(int irq, void *data)
248 rtc->alarm_pending = 1; 248 rtc->alarm_pending = 1;
249} 249}
250 250
251static int __devinit pcf50633_rtc_probe(struct platform_device *pdev) 251static int pcf50633_rtc_probe(struct platform_device *pdev)
252{ 252{
253 struct pcf50633_rtc *rtc; 253 struct pcf50633_rtc *rtc;
254 254
@@ -272,7 +272,7 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
272 return 0; 272 return 0;
273} 273}
274 274
275static int __devexit pcf50633_rtc_remove(struct platform_device *pdev) 275static int pcf50633_rtc_remove(struct platform_device *pdev)
276{ 276{
277 struct pcf50633_rtc *rtc; 277 struct pcf50633_rtc *rtc;
278 278
@@ -291,7 +291,7 @@ static struct platform_driver pcf50633_rtc_driver = {
291 .name = "pcf50633-rtc", 291 .name = "pcf50633-rtc",
292 }, 292 },
293 .probe = pcf50633_rtc_probe, 293 .probe = pcf50633_rtc_probe,
294 .remove = __devexit_p(pcf50633_rtc_remove), 294 .remove = pcf50633_rtc_remove,
295}; 295};
296 296
297module_platform_driver(pcf50633_rtc_driver); 297module_platform_driver(pcf50633_rtc_driver);
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 98e3a2b681e..7098ee89bd2 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -296,7 +296,7 @@ static const struct i2c_device_id pcf8563_id[] = {
296MODULE_DEVICE_TABLE(i2c, pcf8563_id); 296MODULE_DEVICE_TABLE(i2c, pcf8563_id);
297 297
298#ifdef CONFIG_OF 298#ifdef CONFIG_OF
299static const struct of_device_id pcf8563_of_match[] __devinitconst = { 299static const struct of_device_id pcf8563_of_match[] = {
300 { .compatible = "nxp,pcf8563" }, 300 { .compatible = "nxp,pcf8563" },
301 {} 301 {}
302}; 302};
diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index 019ff357116..3415b8f1855 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -294,7 +294,7 @@ exit_kfree:
294 return err; 294 return err;
295} 295}
296 296
297static int __devexit pcf8583_remove(struct i2c_client *client) 297static int pcf8583_remove(struct i2c_client *client)
298{ 298{
299 struct pcf8583 *pcf8583 = i2c_get_clientdata(client); 299 struct pcf8583 *pcf8583 = i2c_get_clientdata(client);
300 300
@@ -316,7 +316,7 @@ static struct i2c_driver pcf8583_driver = {
316 .owner = THIS_MODULE, 316 .owner = THIS_MODULE,
317 }, 317 },
318 .probe = pcf8583_probe, 318 .probe = pcf8583_probe,
319 .remove = __devexit_p(pcf8583_remove), 319 .remove = pcf8583_remove,
320 .id_table = pcf8583_id, 320 .id_table = pcf8583_id,
321}; 321};
322 322
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index d00bd24342a..f1a6557261f 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -382,7 +382,7 @@ rtc_alarm_handled:
382 return IRQ_HANDLED; 382 return IRQ_HANDLED;
383} 383}
384 384
385static int __devinit pm8xxx_rtc_probe(struct platform_device *pdev) 385static int pm8xxx_rtc_probe(struct platform_device *pdev)
386{ 386{
387 int rc; 387 int rc;
388 u8 ctrl_reg; 388 u8 ctrl_reg;
@@ -485,7 +485,7 @@ fail_rtc_enable:
485 return rc; 485 return rc;
486} 486}
487 487
488static int __devexit pm8xxx_rtc_remove(struct platform_device *pdev) 488static int pm8xxx_rtc_remove(struct platform_device *pdev)
489{ 489{
490 struct pm8xxx_rtc *rtc_dd = platform_get_drvdata(pdev); 490 struct pm8xxx_rtc *rtc_dd = platform_get_drvdata(pdev);
491 491
@@ -524,7 +524,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_rtc_pm_ops, pm8xxx_rtc_suspend, pm8xxx_rtc_resum
524 524
525static struct platform_driver pm8xxx_rtc_driver = { 525static struct platform_driver pm8xxx_rtc_driver = {
526 .probe = pm8xxx_rtc_probe, 526 .probe = pm8xxx_rtc_probe,
527 .remove = __devexit_p(pm8xxx_rtc_remove), 527 .remove = pm8xxx_rtc_remove,
528 .driver = { 528 .driver = {
529 .name = PM8XXX_RTC_DEV_NAME, 529 .name = PM8XXX_RTC_DEV_NAME,
530 .owner = THIS_MODULE, 530 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-puv3.c b/drivers/rtc/rtc-puv3.c
index ab0acaeb237..0407e13d4de 100644
--- a/drivers/rtc/rtc-puv3.c
+++ b/drivers/rtc/rtc-puv3.c
@@ -220,7 +220,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en)
220 } 220 }
221} 221}
222 222
223static int __devexit puv3_rtc_remove(struct platform_device *dev) 223static int puv3_rtc_remove(struct platform_device *dev)
224{ 224{
225 struct rtc_device *rtc = platform_get_drvdata(dev); 225 struct rtc_device *rtc = platform_get_drvdata(dev);
226 226
@@ -236,7 +236,7 @@ static int __devexit puv3_rtc_remove(struct platform_device *dev)
236 return 0; 236 return 0;
237} 237}
238 238
239static int __devinit puv3_rtc_probe(struct platform_device *pdev) 239static int puv3_rtc_probe(struct platform_device *pdev)
240{ 240{
241 struct rtc_device *rtc; 241 struct rtc_device *rtc;
242 struct resource *res; 242 struct resource *res;
@@ -328,7 +328,7 @@ static int puv3_rtc_resume(struct platform_device *pdev)
328 328
329static struct platform_driver puv3_rtc_driver = { 329static struct platform_driver puv3_rtc_driver = {
330 .probe = puv3_rtc_probe, 330 .probe = puv3_rtc_probe,
331 .remove = __devexit_p(puv3_rtc_remove), 331 .remove = puv3_rtc_remove,
332 .suspend = puv3_rtc_suspend, 332 .suspend = puv3_rtc_suspend,
333 .resume = puv3_rtc_resume, 333 .resume = puv3_rtc_resume,
334 .driver = { 334 .driver = {
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index 2c183ebff71..7726f4a4f2d 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -119,7 +119,7 @@ static const struct rtc_class_ops r9701_rtc_ops = {
119 .set_time = r9701_set_datetime, 119 .set_time = r9701_set_datetime,
120}; 120};
121 121
122static int __devinit r9701_probe(struct spi_device *spi) 122static int r9701_probe(struct spi_device *spi)
123{ 123{
124 struct rtc_device *rtc; 124 struct rtc_device *rtc;
125 struct rtc_time dt; 125 struct rtc_time dt;
@@ -164,7 +164,7 @@ static int __devinit r9701_probe(struct spi_device *spi)
164 return 0; 164 return 0;
165} 165}
166 166
167static int __devexit r9701_remove(struct spi_device *spi) 167static int r9701_remove(struct spi_device *spi)
168{ 168{
169 struct rtc_device *rtc = dev_get_drvdata(&spi->dev); 169 struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
170 170
@@ -178,7 +178,7 @@ static struct spi_driver r9701_driver = {
178 .owner = THIS_MODULE, 178 .owner = THIS_MODULE,
179 }, 179 },
180 .probe = r9701_probe, 180 .probe = r9701_probe,
181 .remove = __devexit_p(r9701_remove), 181 .remove = r9701_remove,
182}; 182};
183 183
184module_spi_driver(r9701_driver); 184module_spi_driver(r9701_driver);
diff --git a/drivers/rtc/rtc-rc5t583.c b/drivers/rtc/rtc-rc5t583.c
index cdb140c29c5..eb3194d664a 100644
--- a/drivers/rtc/rtc-rc5t583.c
+++ b/drivers/rtc/rtc-rc5t583.c
@@ -211,7 +211,7 @@ static const struct rtc_class_ops rc5t583_rtc_ops = {
211 .alarm_irq_enable = rc5t583_rtc_alarm_irq_enable, 211 .alarm_irq_enable = rc5t583_rtc_alarm_irq_enable,
212}; 212};
213 213
214static int __devinit rc5t583_rtc_probe(struct platform_device *pdev) 214static int rc5t583_rtc_probe(struct platform_device *pdev)
215{ 215{
216 struct rc5t583 *rc5t583 = dev_get_drvdata(pdev->dev.parent); 216 struct rc5t583 *rc5t583 = dev_get_drvdata(pdev->dev.parent);
217 struct rc5t583_rtc *ricoh_rtc; 217 struct rc5t583_rtc *ricoh_rtc;
@@ -271,7 +271,7 @@ static int __devinit rc5t583_rtc_probe(struct platform_device *pdev)
271 * Disable rc5t583 RTC interrupts. 271 * Disable rc5t583 RTC interrupts.
272 * Sets status flag to free. 272 * Sets status flag to free.
273 */ 273 */
274static int __devexit rc5t583_rtc_remove(struct platform_device *pdev) 274static int rc5t583_rtc_remove(struct platform_device *pdev)
275{ 275{
276 struct rc5t583_rtc *rc5t583_rtc = dev_get_drvdata(&pdev->dev); 276 struct rc5t583_rtc *rc5t583_rtc = dev_get_drvdata(&pdev->dev);
277 277
@@ -317,7 +317,7 @@ static const struct dev_pm_ops rc5t583_rtc_pm_ops = {
317 317
318static struct platform_driver rc5t583_rtc_driver = { 318static struct platform_driver rc5t583_rtc_driver = {
319 .probe = rc5t583_rtc_probe, 319 .probe = rc5t583_rtc_probe,
320 .remove = __devexit_p(rc5t583_rtc_remove), 320 .remove = rc5t583_rtc_remove,
321 .driver = { 321 .driver = {
322 .owner = THIS_MODULE, 322 .owner = THIS_MODULE,
323 .name = "rtc-rc5t583", 323 .name = "rtc-rc5t583",
diff --git a/drivers/rtc/rtc-rs5c313.c b/drivers/rtc/rtc-rs5c313.c
index e3ff179b99c..d1aee793ecc 100644
--- a/drivers/rtc/rtc-rs5c313.c
+++ b/drivers/rtc/rtc-rs5c313.c
@@ -377,7 +377,7 @@ static int rs5c313_rtc_probe(struct platform_device *pdev)
377 return 0; 377 return 0;
378} 378}
379 379
380static int __devexit rs5c313_rtc_remove(struct platform_device *pdev) 380static int rs5c313_rtc_remove(struct platform_device *pdev)
381{ 381{
382 struct rtc_device *rtc = platform_get_drvdata( pdev ); 382 struct rtc_device *rtc = platform_get_drvdata( pdev );
383 383
@@ -392,7 +392,7 @@ static struct platform_driver rs5c313_rtc_platform_driver = {
392 .owner = THIS_MODULE, 392 .owner = THIS_MODULE,
393 }, 393 },
394 .probe = rs5c313_rtc_probe, 394 .probe = rs5c313_rtc_probe,
395 .remove = __devexit_p( rs5c313_rtc_remove ), 395 .remove = rs5c313_rtc_remove,
396}; 396};
397 397
398static int __init rs5c313_rtc_init(void) 398static int __init rs5c313_rtc_init(void)
diff --git a/drivers/rtc/rtc-rs5c348.c b/drivers/rtc/rtc-rs5c348.c
index fd5c7af04ae..72ef10be866 100644
--- a/drivers/rtc/rtc-rs5c348.c
+++ b/drivers/rtc/rtc-rs5c348.c
@@ -152,7 +152,7 @@ static const struct rtc_class_ops rs5c348_rtc_ops = {
152 152
153static struct spi_driver rs5c348_driver; 153static struct spi_driver rs5c348_driver;
154 154
155static int __devinit rs5c348_probe(struct spi_device *spi) 155static int rs5c348_probe(struct spi_device *spi)
156{ 156{
157 int ret; 157 int ret;
158 struct rtc_device *rtc; 158 struct rtc_device *rtc;
@@ -218,7 +218,7 @@ static int __devinit rs5c348_probe(struct spi_device *spi)
218 return ret; 218 return ret;
219} 219}
220 220
221static int __devexit rs5c348_remove(struct spi_device *spi) 221static int rs5c348_remove(struct spi_device *spi)
222{ 222{
223 struct rs5c348_plat_data *pdata = spi->dev.platform_data; 223 struct rs5c348_plat_data *pdata = spi->dev.platform_data;
224 struct rtc_device *rtc = pdata->rtc; 224 struct rtc_device *rtc = pdata->rtc;
@@ -235,7 +235,7 @@ static struct spi_driver rs5c348_driver = {
235 .owner = THIS_MODULE, 235 .owner = THIS_MODULE,
236 }, 236 },
237 .probe = rs5c348_probe, 237 .probe = rs5c348_probe,
238 .remove = __devexit_p(rs5c348_remove), 238 .remove = rs5c348_remove,
239}; 239};
240 240
241module_spi_driver(rs5c348_driver); 241module_spi_driver(rs5c348_driver);
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index 0fbe57b2f6d..f8ee8ad7825 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -385,8 +385,8 @@ static struct i2c_device_id rv3029c2_id[] = {
385}; 385};
386MODULE_DEVICE_TABLE(i2c, rv3029c2_id); 386MODULE_DEVICE_TABLE(i2c, rv3029c2_id);
387 387
388static int __devinit 388static int rv3029c2_probe(struct i2c_client *client,
389rv3029c2_probe(struct i2c_client *client, const struct i2c_device_id *id) 389 const struct i2c_device_id *id)
390{ 390{
391 struct rtc_device *rtc; 391 struct rtc_device *rtc;
392 int rc = 0; 392 int rc = 0;
@@ -418,7 +418,7 @@ exit_unregister:
418 return rc; 418 return rc;
419} 419}
420 420
421static int __devexit rv3029c2_remove(struct i2c_client *client) 421static int rv3029c2_remove(struct i2c_client *client)
422{ 422{
423 struct rtc_device *rtc = i2c_get_clientdata(client); 423 struct rtc_device *rtc = i2c_get_clientdata(client);
424 424
@@ -432,7 +432,7 @@ static struct i2c_driver rv3029c2_driver = {
432 .name = "rtc-rv3029c2", 432 .name = "rtc-rv3029c2",
433 }, 433 },
434 .probe = rv3029c2_probe, 434 .probe = rv3029c2_probe,
435 .remove = __devexit_p(rv3029c2_remove), 435 .remove = rv3029c2_remove,
436 .id_table = rv3029c2_id, 436 .id_table = rv3029c2_id,
437}; 437};
438 438
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index 0de902dc1cd..0722d36b9c9 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -534,8 +534,8 @@ static void rx8025_sysfs_unregister(struct device *dev)
534 device_remove_file(dev, &dev_attr_clock_adjust_ppb); 534 device_remove_file(dev, &dev_attr_clock_adjust_ppb);
535} 535}
536 536
537static int __devinit rx8025_probe(struct i2c_client *client, 537static int rx8025_probe(struct i2c_client *client,
538 const struct i2c_device_id *id) 538 const struct i2c_device_id *id)
539{ 539{
540 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 540 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
541 struct rx8025_data *rx8025; 541 struct rx8025_data *rx8025;
@@ -614,7 +614,7 @@ errout:
614 return err; 614 return err;
615} 615}
616 616
617static int __devexit rx8025_remove(struct i2c_client *client) 617static int rx8025_remove(struct i2c_client *client)
618{ 618{
619 struct rx8025_data *rx8025 = i2c_get_clientdata(client); 619 struct rx8025_data *rx8025 = i2c_get_clientdata(client);
620 struct mutex *lock = &rx8025->rtc->ops_lock; 620 struct mutex *lock = &rx8025->rtc->ops_lock;
@@ -640,7 +640,7 @@ static struct i2c_driver rx8025_driver = {
640 .owner = THIS_MODULE, 640 .owner = THIS_MODULE,
641 }, 641 },
642 .probe = rx8025_probe, 642 .probe = rx8025_probe,
643 .remove = __devexit_p(rx8025_remove), 643 .remove = rx8025_remove,
644 .id_table = rx8025_id, 644 .id_table = rx8025_id,
645}; 645};
646 646
diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c
index d84825124a7..b0c272658fa 100644
--- a/drivers/rtc/rtc-rx8581.c
+++ b/drivers/rtc/rtc-rx8581.c
@@ -228,8 +228,8 @@ static const struct rtc_class_ops rx8581_rtc_ops = {
228 .set_time = rx8581_rtc_set_time, 228 .set_time = rx8581_rtc_set_time,
229}; 229};
230 230
231static int __devinit rx8581_probe(struct i2c_client *client, 231static int rx8581_probe(struct i2c_client *client,
232 const struct i2c_device_id *id) 232 const struct i2c_device_id *id)
233{ 233{
234 struct rtc_device *rtc; 234 struct rtc_device *rtc;
235 235
@@ -251,7 +251,7 @@ static int __devinit rx8581_probe(struct i2c_client *client,
251 return 0; 251 return 0;
252} 252}
253 253
254static int __devexit rx8581_remove(struct i2c_client *client) 254static int rx8581_remove(struct i2c_client *client)
255{ 255{
256 struct rtc_device *rtc = i2c_get_clientdata(client); 256 struct rtc_device *rtc = i2c_get_clientdata(client);
257 257
@@ -272,7 +272,7 @@ static struct i2c_driver rx8581_driver = {
272 .owner = THIS_MODULE, 272 .owner = THIS_MODULE,
273 }, 273 },
274 .probe = rx8581_probe, 274 .probe = rx8581_probe,
275 .remove = __devexit_p(rx8581_remove), 275 .remove = rx8581_remove,
276 .id_table = rx8581_id, 276 .id_table = rx8581_id,
277}; 277};
278 278
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 4bd9414aee6..404651464d4 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -421,7 +421,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en)
421 clk_disable(rtc_clk); 421 clk_disable(rtc_clk);
422} 422}
423 423
424static int __devexit s3c_rtc_remove(struct platform_device *dev) 424static int s3c_rtc_remove(struct platform_device *dev)
425{ 425{
426 struct rtc_device *rtc = platform_get_drvdata(dev); 426 struct rtc_device *rtc = platform_get_drvdata(dev);
427 427
@@ -451,7 +451,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
451 return platform_get_device_id(pdev)->driver_data; 451 return platform_get_device_id(pdev)->driver_data;
452} 452}
453 453
454static int __devinit s3c_rtc_probe(struct platform_device *pdev) 454static int s3c_rtc_probe(struct platform_device *pdev)
455{ 455{
456 struct rtc_device *rtc; 456 struct rtc_device *rtc;
457 struct rtc_time rtc_tm; 457 struct rtc_time rtc_tm;
@@ -686,7 +686,7 @@ MODULE_DEVICE_TABLE(platform, s3c_rtc_driver_ids);
686 686
687static struct platform_driver s3c_rtc_driver = { 687static struct platform_driver s3c_rtc_driver = {
688 .probe = s3c_rtc_probe, 688 .probe = s3c_rtc_probe,
689 .remove = __devexit_p(s3c_rtc_remove), 689 .remove = s3c_rtc_remove,
690 .suspend = s3c_rtc_suspend, 690 .suspend = s3c_rtc_suspend,
691 .resume = s3c_rtc_resume, 691 .resume = s3c_rtc_resume,
692 .id_table = s3c_rtc_driver_ids, 692 .id_table = s3c_rtc_driver_ids,
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index 3c0da333f46..d5ec7854a65 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -241,7 +241,7 @@ static irqreturn_t snvs_rtc_irq_handler(int irq, void *dev_id)
241 return events ? IRQ_HANDLED : IRQ_NONE; 241 return events ? IRQ_HANDLED : IRQ_NONE;
242} 242}
243 243
244static int __devinit snvs_rtc_probe(struct platform_device *pdev) 244static int snvs_rtc_probe(struct platform_device *pdev)
245{ 245{
246 struct snvs_rtc_data *data; 246 struct snvs_rtc_data *data;
247 struct resource *res; 247 struct resource *res;
@@ -294,7 +294,7 @@ static int __devinit snvs_rtc_probe(struct platform_device *pdev)
294 return 0; 294 return 0;
295} 295}
296 296
297static int __devexit snvs_rtc_remove(struct platform_device *pdev) 297static int snvs_rtc_remove(struct platform_device *pdev)
298{ 298{
299 struct snvs_rtc_data *data = platform_get_drvdata(pdev); 299 struct snvs_rtc_data *data = platform_get_drvdata(pdev);
300 300
@@ -327,7 +327,7 @@ static int snvs_rtc_resume(struct device *dev)
327 327
328static SIMPLE_DEV_PM_OPS(snvs_rtc_pm_ops, snvs_rtc_suspend, snvs_rtc_resume); 328static SIMPLE_DEV_PM_OPS(snvs_rtc_pm_ops, snvs_rtc_suspend, snvs_rtc_resume);
329 329
330static const struct of_device_id __devinitconst snvs_dt_ids[] = { 330static const struct of_device_id snvs_dt_ids[] = {
331 { .compatible = "fsl,sec-v4.0-mon-rtc-lp", }, 331 { .compatible = "fsl,sec-v4.0-mon-rtc-lp", },
332 { /* sentinel */ } 332 { /* sentinel */ }
333}; 333};
@@ -341,7 +341,7 @@ static struct platform_driver snvs_rtc_driver = {
341 .of_match_table = snvs_dt_ids, 341 .of_match_table = snvs_dt_ids,
342 }, 342 },
343 .probe = snvs_rtc_probe, 343 .probe = snvs_rtc_probe,
344 .remove = __devexit_p(snvs_rtc_remove), 344 .remove = snvs_rtc_remove,
345}; 345};
346module_platform_driver(snvs_rtc_driver); 346module_platform_driver(snvs_rtc_driver);
347 347
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 141fc945295..c2121b5a01f 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -351,7 +351,7 @@ static struct rtc_class_ops spear_rtc_ops = {
351 .alarm_irq_enable = spear_alarm_irq_enable, 351 .alarm_irq_enable = spear_alarm_irq_enable,
352}; 352};
353 353
354static int __devinit spear_rtc_probe(struct platform_device *pdev) 354static int spear_rtc_probe(struct platform_device *pdev)
355{ 355{
356 struct resource *res; 356 struct resource *res;
357 struct spear_rtc_config *config; 357 struct spear_rtc_config *config;
@@ -425,7 +425,7 @@ err_disable_clock:
425 return status; 425 return status;
426} 426}
427 427
428static int __devexit spear_rtc_remove(struct platform_device *pdev) 428static int spear_rtc_remove(struct platform_device *pdev)
429{ 429{
430 struct spear_rtc_config *config = platform_get_drvdata(pdev); 430 struct spear_rtc_config *config = platform_get_drvdata(pdev);
431 431
@@ -499,7 +499,7 @@ MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
499 499
500static struct platform_driver spear_rtc_driver = { 500static struct platform_driver spear_rtc_driver = {
501 .probe = spear_rtc_probe, 501 .probe = spear_rtc_probe,
502 .remove = __devexit_p(spear_rtc_remove), 502 .remove = spear_rtc_remove,
503 .suspend = spear_rtc_suspend, 503 .suspend = spear_rtc_suspend,
504 .resume = spear_rtc_resume, 504 .resume = spear_rtc_resume,
505 .shutdown = spear_rtc_shutdown, 505 .shutdown = spear_rtc_shutdown,
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index 279f5cfa691..7e4a6f65cb9 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -285,7 +285,7 @@ static struct bin_attribute stk17ta8_nvram_attr = {
285 .write = stk17ta8_nvram_write, 285 .write = stk17ta8_nvram_write,
286}; 286};
287 287
288static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev) 288static int stk17ta8_rtc_probe(struct platform_device *pdev)
289{ 289{
290 struct resource *res; 290 struct resource *res;
291 unsigned int cal; 291 unsigned int cal;
@@ -347,7 +347,7 @@ static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
347 return ret; 347 return ret;
348} 348}
349 349
350static int __devexit stk17ta8_rtc_remove(struct platform_device *pdev) 350static int stk17ta8_rtc_remove(struct platform_device *pdev)
351{ 351{
352 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 352 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
353 353
@@ -363,7 +363,7 @@ MODULE_ALIAS("platform:stk17ta8");
363 363
364static struct platform_driver stk17ta8_rtc_driver = { 364static struct platform_driver stk17ta8_rtc_driver = {
365 .probe = stk17ta8_rtc_probe, 365 .probe = stk17ta8_rtc_probe,
366 .remove = __devexit_p(stk17ta8_rtc_remove), 366 .remove = stk17ta8_rtc_remove,
367 .driver = { 367 .driver = {
368 .name = "stk17ta8", 368 .name = "stk17ta8",
369 .owner = THIS_MODULE, 369 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index c006025cecc..c84ea6659f4 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -303,7 +303,13 @@ static struct rtc_class_ops tegra_rtc_ops = {
303 .alarm_irq_enable = tegra_rtc_alarm_irq_enable, 303 .alarm_irq_enable = tegra_rtc_alarm_irq_enable,
304}; 304};
305 305
306static int __devinit tegra_rtc_probe(struct platform_device *pdev) 306static const struct of_device_id tegra_rtc_dt_match[] = {
307 { .compatible = "nvidia,tegra20-rtc", },
308 {}
309};
310MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
311
312static int tegra_rtc_probe(struct platform_device *pdev)
307{ 313{
308 struct tegra_rtc_info *info; 314 struct tegra_rtc_info *info;
309 struct resource *res; 315 struct resource *res;
@@ -375,7 +381,7 @@ err_dev_unreg:
375 return ret; 381 return ret;
376} 382}
377 383
378static int __devexit tegra_rtc_remove(struct platform_device *pdev) 384static int tegra_rtc_remove(struct platform_device *pdev)
379{ 385{
380 struct tegra_rtc_info *info = platform_get_drvdata(pdev); 386 struct tegra_rtc_info *info = platform_get_drvdata(pdev);
381 387
@@ -435,11 +441,12 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)
435 441
436MODULE_ALIAS("platform:tegra_rtc"); 442MODULE_ALIAS("platform:tegra_rtc");
437static struct platform_driver tegra_rtc_driver = { 443static struct platform_driver tegra_rtc_driver = {
438 .remove = __devexit_p(tegra_rtc_remove), 444 .remove = tegra_rtc_remove,
439 .shutdown = tegra_rtc_shutdown, 445 .shutdown = tegra_rtc_shutdown,
440 .driver = { 446 .driver = {
441 .name = "tegra_rtc", 447 .name = "tegra_rtc",
442 .owner = THIS_MODULE, 448 .owner = THIS_MODULE,
449 .of_match_table = tegra_rtc_dt_match,
443 }, 450 },
444#ifdef CONFIG_PM 451#ifdef CONFIG_PM
445 .suspend = tegra_rtc_suspend, 452 .suspend = tegra_rtc_suspend,
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 974b9ae252a..b92e0f6383e 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -119,7 +119,7 @@ err:
119 return err; 119 return err;
120} 120}
121 121
122static int __devexit test_remove(struct platform_device *plat_dev) 122static int test_remove(struct platform_device *plat_dev)
123{ 123{
124 struct rtc_device *rtc = platform_get_drvdata(plat_dev); 124 struct rtc_device *rtc = platform_get_drvdata(plat_dev);
125 125
@@ -131,7 +131,7 @@ static int __devexit test_remove(struct platform_device *plat_dev)
131 131
132static struct platform_driver test_driver = { 132static struct platform_driver test_driver = {
133 .probe = test_probe, 133 .probe = test_probe,
134 .remove = __devexit_p(test_remove), 134 .remove = test_remove,
135 .driver = { 135 .driver = {
136 .name = "rtc-test", 136 .name = "rtc-test",
137 .owner = THIS_MODULE, 137 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-tile.c b/drivers/rtc/rtc-tile.c
index eb65dafee66..62db4841078 100644
--- a/drivers/rtc/rtc-tile.c
+++ b/drivers/rtc/rtc-tile.c
@@ -76,7 +76,7 @@ static const struct rtc_class_ops tile_rtc_ops = {
76/* 76/*
77 * Device probe routine. 77 * Device probe routine.
78 */ 78 */
79static int __devinit tile_rtc_probe(struct platform_device *dev) 79static int tile_rtc_probe(struct platform_device *dev)
80{ 80{
81 struct rtc_device *rtc; 81 struct rtc_device *rtc;
82 82
@@ -94,7 +94,7 @@ static int __devinit tile_rtc_probe(struct platform_device *dev)
94/* 94/*
95 * Device cleanup routine. 95 * Device cleanup routine.
96 */ 96 */
97static int __devexit tile_rtc_remove(struct platform_device *dev) 97static int tile_rtc_remove(struct platform_device *dev)
98{ 98{
99 struct rtc_device *rtc = platform_get_drvdata(dev); 99 struct rtc_device *rtc = platform_get_drvdata(dev);
100 100
@@ -112,7 +112,7 @@ static struct platform_driver tile_rtc_platform_driver = {
112 .owner = THIS_MODULE, 112 .owner = THIS_MODULE,
113 }, 113 },
114 .probe = tile_rtc_probe, 114 .probe = tile_rtc_probe,
115 .remove = __devexit_p(tile_rtc_remove), 115 .remove = tile_rtc_remove,
116}; 116};
117 117
118/* 118/*
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
new file mode 100644
index 00000000000..70f61b8e9e6
--- /dev/null
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -0,0 +1,356 @@
1/*
2 * rtc-tps6586x.c: RTC driver for TI PMIC TPS6586X
3 *
4 * Copyright (c) 2012, NVIDIA Corporation.
5 *
6 * Author: Laxman Dewangan <ldewangan@nvidia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * 02111-1307, USA
21 */
22
23#include <linux/device.h>
24#include <linux/err.h>
25#include <linux/init.h>
26#include <linux/kernel.h>
27#include <linux/mfd/tps6586x.h>
28#include <linux/module.h>
29#include <linux/platform_device.h>
30#include <linux/pm_runtime.h>
31#include <linux/rtc.h>
32#include <linux/slab.h>
33
34#define RTC_CTRL 0xc0
35#define POR_RESET_N BIT(7)
36#define OSC_SRC_SEL BIT(6)
37#define RTC_ENABLE BIT(5) /* enables alarm */
38#define RTC_BUF_ENABLE BIT(4) /* 32 KHz buffer enable */
39#define PRE_BYPASS BIT(3) /* 0=1KHz or 1=32KHz updates */
40#define CL_SEL_MASK (BIT(2)|BIT(1))
41#define CL_SEL_POS 1
42#define RTC_ALARM1_HI 0xc1
43#define RTC_COUNT4 0xc6
44
45/* start a PMU RTC access by reading the register prior to the RTC_COUNT4 */
46#define RTC_COUNT4_DUMMYREAD 0xc5
47
48/*only 14-bits width in second*/
49#define ALM1_VALID_RANGE_IN_SEC 0x3FFF
50
51#define TPS6586X_RTC_CL_SEL_1_5PF 0x0
52#define TPS6586X_RTC_CL_SEL_6_5PF 0x1
53#define TPS6586X_RTC_CL_SEL_7_5PF 0x2
54#define TPS6586X_RTC_CL_SEL_12_5PF 0x3
55
56struct tps6586x_rtc {
57 struct device *dev;
58 struct rtc_device *rtc;
59 int irq;
60 bool irq_en;
61 unsigned long long epoch_start;
62};
63
64static inline struct device *to_tps6586x_dev(struct device *dev)
65{
66 return dev->parent;
67}
68
69static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm)
70{
71 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
72 struct device *tps_dev = to_tps6586x_dev(dev);
73 unsigned long long ticks = 0;
74 unsigned long seconds;
75 u8 buff[6];
76 int ret;
77 int i;
78
79 ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD, sizeof(buff), buff);
80 if (ret < 0) {
81 dev_err(dev, "read counter failed with err %d\n", ret);
82 return ret;
83 }
84
85 for (i = 1; i < sizeof(buff); i++) {
86 ticks <<= 8;
87 ticks |= buff[i];
88 }
89
90 seconds = ticks >> 10;
91 seconds += rtc->epoch_start;
92 rtc_time_to_tm(seconds, tm);
93 return rtc_valid_tm(tm);
94}
95
96static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm)
97{
98 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
99 struct device *tps_dev = to_tps6586x_dev(dev);
100 unsigned long long ticks;
101 unsigned long seconds;
102 u8 buff[5];
103 int ret;
104
105 rtc_tm_to_time(tm, &seconds);
106 if (seconds < rtc->epoch_start) {
107 dev_err(dev, "requested time unsupported\n");
108 return -EINVAL;
109 }
110 seconds -= rtc->epoch_start;
111
112 ticks = (unsigned long long)seconds << 10;
113 buff[0] = (ticks >> 32) & 0xff;
114 buff[1] = (ticks >> 24) & 0xff;
115 buff[2] = (ticks >> 16) & 0xff;
116 buff[3] = (ticks >> 8) & 0xff;
117 buff[4] = ticks & 0xff;
118
119 /* Disable RTC before changing time */
120 ret = tps6586x_clr_bits(tps_dev, RTC_CTRL, RTC_ENABLE);
121 if (ret < 0) {
122 dev_err(dev, "failed to clear RTC_ENABLE\n");
123 return ret;
124 }
125
126 ret = tps6586x_writes(tps_dev, RTC_COUNT4, sizeof(buff), buff);
127 if (ret < 0) {
128 dev_err(dev, "failed to program new time\n");
129 return ret;
130 }
131
132 /* Enable RTC */
133 ret = tps6586x_set_bits(tps_dev, RTC_CTRL, RTC_ENABLE);
134 if (ret < 0) {
135 dev_err(dev, "failed to set RTC_ENABLE\n");
136 return ret;
137 }
138 return 0;
139}
140
141static int tps6586x_rtc_alarm_irq_enable(struct device *dev,
142 unsigned int enabled)
143{
144 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
145
146 if (enabled && !rtc->irq_en) {
147 enable_irq(rtc->irq);
148 rtc->irq_en = true;
149 } else if (!enabled && rtc->irq_en) {
150 disable_irq(rtc->irq);
151 rtc->irq_en = false;
152 }
153 return 0;
154}
155
156static int tps6586x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
157{
158 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
159 struct device *tps_dev = to_tps6586x_dev(dev);
160 unsigned long seconds;
161 unsigned long ticks;
162 unsigned long rtc_current_time;
163 unsigned long long rticks = 0;
164 u8 buff[3];
165 u8 rbuff[6];
166 int ret;
167 int i;
168
169 rtc_tm_to_time(&alrm->time, &seconds);
170
171 if (alrm->enabled && (seconds < rtc->epoch_start)) {
172 dev_err(dev, "can't set alarm to requested time\n");
173 return -EINVAL;
174 }
175
176 ret = tps6586x_rtc_alarm_irq_enable(dev, alrm->enabled);
177 if (ret < 0) {
178 dev_err(dev, "can't set alarm irq, err %d\n", ret);
179 return ret;
180 }
181
182 seconds -= rtc->epoch_start;
183 ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD,
184 sizeof(rbuff), rbuff);
185 if (ret < 0) {
186 dev_err(dev, "read counter failed with err %d\n", ret);
187 return ret;
188 }
189
190 for (i = 1; i < sizeof(rbuff); i++) {
191 rticks <<= 8;
192 rticks |= rbuff[i];
193 }
194
195 rtc_current_time = rticks >> 10;
196 if ((seconds - rtc_current_time) > ALM1_VALID_RANGE_IN_SEC)
197 seconds = rtc_current_time - 1;
198
199 ticks = (unsigned long long)seconds << 10;
200 buff[0] = (ticks >> 16) & 0xff;
201 buff[1] = (ticks >> 8) & 0xff;
202 buff[2] = ticks & 0xff;
203
204 ret = tps6586x_writes(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff);
205 if (ret)
206 dev_err(dev, "programming alarm failed with err %d\n", ret);
207
208 return ret;
209}
210
211static int tps6586x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
212{
213 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
214 struct device *tps_dev = to_tps6586x_dev(dev);
215 unsigned long ticks;
216 unsigned long seconds;
217 u8 buff[3];
218 int ret;
219
220 ret = tps6586x_reads(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff);
221 if (ret) {
222 dev_err(dev, "read RTC_ALARM1_HI failed with err %d\n", ret);
223 return ret;
224 }
225
226 ticks = (buff[0] << 16) | (buff[1] << 8) | buff[2];
227 seconds = ticks >> 10;
228 seconds += rtc->epoch_start;
229
230 rtc_time_to_tm(seconds, &alrm->time);
231 return 0;
232}
233
234static const struct rtc_class_ops tps6586x_rtc_ops = {
235 .read_time = tps6586x_rtc_read_time,
236 .set_time = tps6586x_rtc_set_time,
237 .set_alarm = tps6586x_rtc_set_alarm,
238 .read_alarm = tps6586x_rtc_read_alarm,
239 .alarm_irq_enable = tps6586x_rtc_alarm_irq_enable,
240};
241
242static irqreturn_t tps6586x_rtc_irq(int irq, void *data)
243{
244 struct tps6586x_rtc *rtc = data;
245
246 rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF);
247 return IRQ_HANDLED;
248}
249
250static int tps6586x_rtc_probe(struct platform_device *pdev)
251{
252 struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
253 struct tps6586x_rtc *rtc;
254 int ret;
255
256 rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
257 if (!rtc)
258 return -ENOMEM;
259
260 rtc->dev = &pdev->dev;
261 rtc->irq = platform_get_irq(pdev, 0);
262
263 /* Set epoch start as 00:00:00:01:01:2009 */
264 rtc->epoch_start = mktime(2009, 1, 1, 0, 0, 0);
265
266 /* 1 kHz tick mode, enable tick counting */
267 ret = tps6586x_update(tps_dev, RTC_CTRL,
268 RTC_ENABLE | OSC_SRC_SEL |
269 ((TPS6586X_RTC_CL_SEL_1_5PF << CL_SEL_POS) & CL_SEL_MASK),
270 RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
271 if (ret < 0) {
272 dev_err(&pdev->dev, "unable to start counter\n");
273 return ret;
274 }
275
276 platform_set_drvdata(pdev, rtc);
277 rtc->rtc = rtc_device_register(dev_name(&pdev->dev), &pdev->dev,
278 &tps6586x_rtc_ops, THIS_MODULE);
279 if (IS_ERR(rtc->rtc)) {
280 ret = PTR_ERR(rtc->rtc);
281 dev_err(&pdev->dev, "RTC device register: ret %d\n", ret);
282 goto fail_rtc_register;
283 }
284
285 ret = request_threaded_irq(rtc->irq, NULL, tps6586x_rtc_irq,
286 IRQF_ONESHOT | IRQF_EARLY_RESUME,
287 dev_name(&pdev->dev), rtc);
288 if (ret < 0) {
289 dev_err(&pdev->dev, "request IRQ(%d) failed with ret %d\n",
290 rtc->irq, ret);
291 goto fail_req_irq;
292 }
293 disable_irq(rtc->irq);
294 device_set_wakeup_capable(&pdev->dev, 1);
295 return 0;
296
297fail_req_irq:
298 rtc_device_unregister(rtc->rtc);
299
300fail_rtc_register:
301 tps6586x_update(tps_dev, RTC_CTRL, 0,
302 RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
303 return ret;
304};
305
306static int tps6586x_rtc_remove(struct platform_device *pdev)
307{
308 struct tps6586x_rtc *rtc = platform_get_drvdata(pdev);
309 struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
310
311 tps6586x_update(tps_dev, RTC_CTRL, 0,
312 RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
313 rtc_device_unregister(rtc->rtc);
314 free_irq(rtc->irq, rtc);
315 return 0;
316}
317
318#ifdef CONFIG_PM_SLEEP
319static int tps6586x_rtc_suspend(struct device *dev)
320{
321 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
322
323 if (device_may_wakeup(dev))
324 enable_irq_wake(rtc->irq);
325 return 0;
326}
327
328static int tps6586x_rtc_resume(struct device *dev)
329{
330 struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
331
332 if (device_may_wakeup(dev))
333 disable_irq_wake(rtc->irq);
334 return 0;
335}
336#endif
337
338static const struct dev_pm_ops tps6586x_pm_ops = {
339 SET_SYSTEM_SLEEP_PM_OPS(tps6586x_rtc_suspend, tps6586x_rtc_resume)
340};
341
342static struct platform_driver tps6586x_rtc_driver = {
343 .driver = {
344 .name = "tps6586x-rtc",
345 .owner = THIS_MODULE,
346 .pm = &tps6586x_pm_ops,
347 },
348 .probe = tps6586x_rtc_probe,
349 .remove = tps6586x_rtc_remove,
350};
351module_platform_driver(tps6586x_rtc_driver);
352
353MODULE_ALIAS("platform:rtc-tps6586x");
354MODULE_DESCRIPTION("TI TPS6586x RTC driver");
355MODULE_AUTHOR("Laxman dewangan <ldewangan@nvidia.com>");
356MODULE_LICENSE("GPL v2");
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index 22eb4ebfa1a..e5fef141a0e 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -222,7 +222,7 @@ static const struct rtc_class_ops tps65910_rtc_ops = {
222 .alarm_irq_enable = tps65910_rtc_alarm_irq_enable, 222 .alarm_irq_enable = tps65910_rtc_alarm_irq_enable,
223}; 223};
224 224
225static int __devinit tps65910_rtc_probe(struct platform_device *pdev) 225static int tps65910_rtc_probe(struct platform_device *pdev)
226{ 226{
227 struct tps65910 *tps65910 = NULL; 227 struct tps65910 *tps65910 = NULL;
228 struct tps65910_rtc *tps_rtc = NULL; 228 struct tps65910_rtc *tps_rtc = NULL;
@@ -292,7 +292,7 @@ static int __devinit tps65910_rtc_probe(struct platform_device *pdev)
292 * Disable tps65910 RTC interrupts. 292 * Disable tps65910 RTC interrupts.
293 * Sets status flag to free. 293 * Sets status flag to free.
294 */ 294 */
295static int __devexit tps65910_rtc_remove(struct platform_device *pdev) 295static int tps65910_rtc_remove(struct platform_device *pdev)
296{ 296{
297 /* leave rtc running, but disable irqs */ 297 /* leave rtc running, but disable irqs */
298 struct tps65910_rtc *tps_rtc = platform_get_drvdata(pdev); 298 struct tps65910_rtc *tps_rtc = platform_get_drvdata(pdev);
@@ -342,7 +342,7 @@ static const struct dev_pm_ops tps65910_rtc_pm_ops = {
342 342
343static struct platform_driver tps65910_rtc_driver = { 343static struct platform_driver tps65910_rtc_driver = {
344 .probe = tps65910_rtc_probe, 344 .probe = tps65910_rtc_probe,
345 .remove = __devexit_p(tps65910_rtc_remove), 345 .remove = tps65910_rtc_remove,
346 .driver = { 346 .driver = {
347 .owner = THIS_MODULE, 347 .owner = THIS_MODULE,
348 .name = "tps65910-rtc", 348 .name = "tps65910-rtc",
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 8b7464c8b5c..ccd4ad370b3 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -458,7 +458,7 @@ static struct rtc_class_ops twl_rtc_ops = {
458 458
459/*----------------------------------------------------------------------*/ 459/*----------------------------------------------------------------------*/
460 460
461static int __devinit twl_rtc_probe(struct platform_device *pdev) 461static int twl_rtc_probe(struct platform_device *pdev)
462{ 462{
463 struct rtc_device *rtc; 463 struct rtc_device *rtc;
464 int ret = -EINVAL; 464 int ret = -EINVAL;
@@ -535,7 +535,7 @@ out1:
535 * Disable all TWL RTC module interrupts. 535 * Disable all TWL RTC module interrupts.
536 * Sets status flag to free. 536 * Sets status flag to free.
537 */ 537 */
538static int __devexit twl_rtc_remove(struct platform_device *pdev) 538static int twl_rtc_remove(struct platform_device *pdev)
539{ 539{
540 /* leave rtc running, but disable irqs */ 540 /* leave rtc running, but disable irqs */
541 struct rtc_device *rtc = platform_get_drvdata(pdev); 541 struct rtc_device *rtc = platform_get_drvdata(pdev);
@@ -597,7 +597,7 @@ MODULE_ALIAS("platform:twl_rtc");
597 597
598static struct platform_driver twl4030rtc_driver = { 598static struct platform_driver twl4030rtc_driver = {
599 .probe = twl_rtc_probe, 599 .probe = twl_rtc_probe,
600 .remove = __devexit_p(twl_rtc_remove), 600 .remove = twl_rtc_remove,
601 .shutdown = twl_rtc_shutdown, 601 .shutdown = twl_rtc_shutdown,
602 .suspend = twl_rtc_suspend, 602 .suspend = twl_rtc_suspend,
603 .resume = twl_rtc_resume, 603 .resume = twl_rtc_resume,
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 5f60a7c6a15..6c3774cf5a2 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -280,7 +280,7 @@ static const struct rtc_class_ops vr41xx_rtc_ops = {
280 .set_alarm = vr41xx_rtc_set_alarm, 280 .set_alarm = vr41xx_rtc_set_alarm,
281}; 281};
282 282
283static int __devinit rtc_probe(struct platform_device *pdev) 283static int rtc_probe(struct platform_device *pdev)
284{ 284{
285 struct resource *res; 285 struct resource *res;
286 struct rtc_device *rtc; 286 struct rtc_device *rtc;
@@ -373,7 +373,7 @@ err_rtc1_iounmap:
373 return retval; 373 return retval;
374} 374}
375 375
376static int __devexit rtc_remove(struct platform_device *pdev) 376static int rtc_remove(struct platform_device *pdev)
377{ 377{
378 struct rtc_device *rtc; 378 struct rtc_device *rtc;
379 379
@@ -398,7 +398,7 @@ MODULE_ALIAS("platform:RTC");
398 398
399static struct platform_driver rtc_platform_driver = { 399static struct platform_driver rtc_platform_driver = {
400 .probe = rtc_probe, 400 .probe = rtc_probe,
401 .remove = __devexit_p(rtc_remove), 401 .remove = rtc_remove,
402 .driver = { 402 .driver = {
403 .name = rtc_name, 403 .name = rtc_name,
404 .owner = THIS_MODULE, 404 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c
index 14e2d8cfcc8..00c930f4b6f 100644
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -70,7 +70,7 @@
70 | ALARM_SEC_BIT) 70 | ALARM_SEC_BIT)
71 71
72#define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */ 72#define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */
73#define VT8500_RTC_CR_24H (1 << 1) /* 24h time format */ 73#define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */
74#define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */ 74#define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */
75#define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */ 75#define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */
76#define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */ 76#define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */
@@ -119,7 +119,7 @@ static int vt8500_rtc_read_time(struct device *dev, struct rtc_time *tm)
119 tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S); 119 tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S);
120 tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S); 120 tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S);
121 tm->tm_mday = bcd2bin(date & DATE_DAY_MASK); 121 tm->tm_mday = bcd2bin(date & DATE_DAY_MASK);
122 tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S); 122 tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1;
123 tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S) 123 tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S)
124 + ((date >> DATE_CENTURY_S) & 1 ? 200 : 100); 124 + ((date >> DATE_CENTURY_S) & 1 ? 200 : 100);
125 tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S; 125 tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S;
@@ -138,8 +138,9 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
138 } 138 }
139 139
140 writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S) 140 writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S)
141 | (bin2bcd(tm->tm_mon) << DATE_MONTH_S) 141 | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S)
142 | (bin2bcd(tm->tm_mday)), 142 | (bin2bcd(tm->tm_mday))
143 | ((tm->tm_year >= 200) << DATE_CENTURY_S),
143 vt8500_rtc->regbase + VT8500_RTC_DS); 144 vt8500_rtc->regbase + VT8500_RTC_DS);
144 writel((bin2bcd(tm->tm_wday) << TIME_DOW_S) 145 writel((bin2bcd(tm->tm_wday) << TIME_DOW_S)
145 | (bin2bcd(tm->tm_hour) << TIME_HOUR_S) 146 | (bin2bcd(tm->tm_hour) << TIME_HOUR_S)
@@ -205,7 +206,7 @@ static const struct rtc_class_ops vt8500_rtc_ops = {
205 .alarm_irq_enable = vt8500_alarm_irq_enable, 206 .alarm_irq_enable = vt8500_alarm_irq_enable,
206}; 207};
207 208
208static int __devinit vt8500_rtc_probe(struct platform_device *pdev) 209static int vt8500_rtc_probe(struct platform_device *pdev)
209{ 210{
210 struct vt8500_rtc *vt8500_rtc; 211 struct vt8500_rtc *vt8500_rtc;
211 int ret; 212 int ret;
@@ -247,7 +248,7 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
247 } 248 }
248 249
249 /* Enable RTC and set it to 24-hour mode */ 250 /* Enable RTC and set it to 24-hour mode */
250 writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H, 251 writel(VT8500_RTC_CR_ENABLE,
251 vt8500_rtc->regbase + VT8500_RTC_CR); 252 vt8500_rtc->regbase + VT8500_RTC_CR);
252 253
253 vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev, 254 vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
@@ -279,7 +280,7 @@ err_release:
279 return ret; 280 return ret;
280} 281}
281 282
282static int __devexit vt8500_rtc_remove(struct platform_device *pdev) 283static int vt8500_rtc_remove(struct platform_device *pdev)
283{ 284{
284 struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev); 285 struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev);
285 286
@@ -305,7 +306,7 @@ static const struct of_device_id wmt_dt_ids[] = {
305 306
306static struct platform_driver vt8500_rtc_driver = { 307static struct platform_driver vt8500_rtc_driver = {
307 .probe = vt8500_rtc_probe, 308 .probe = vt8500_rtc_probe,
308 .remove = __devexit_p(vt8500_rtc_remove), 309 .remove = vt8500_rtc_remove,
309 .driver = { 310 .driver = {
310 .name = "vt8500-rtc", 311 .name = "vt8500-rtc",
311 .owner = THIS_MODULE, 312 .owner = THIS_MODULE,
diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c
index ea5c6f857ca..1b0affbe265 100644
--- a/drivers/rtc/rtc-wm831x.c
+++ b/drivers/rtc/rtc-wm831x.c
@@ -459,7 +459,7 @@ err:
459 return ret; 459 return ret;
460} 460}
461 461
462static int __devexit wm831x_rtc_remove(struct platform_device *pdev) 462static int wm831x_rtc_remove(struct platform_device *pdev)
463{ 463{
464 struct wm831x_rtc *wm831x_rtc = platform_get_drvdata(pdev); 464 struct wm831x_rtc *wm831x_rtc = platform_get_drvdata(pdev);
465 int alm_irq = platform_get_irq_byname(pdev, "ALM"); 465 int alm_irq = platform_get_irq_byname(pdev, "ALM");
@@ -483,7 +483,7 @@ static const struct dev_pm_ops wm831x_rtc_pm_ops = {
483 483
484static struct platform_driver wm831x_rtc_driver = { 484static struct platform_driver wm831x_rtc_driver = {
485 .probe = wm831x_rtc_probe, 485 .probe = wm831x_rtc_probe,
486 .remove = __devexit_p(wm831x_rtc_remove), 486 .remove = wm831x_rtc_remove,
487 .driver = { 487 .driver = {
488 .name = "wm831x-rtc", 488 .name = "wm831x-rtc",
489 .pm = &wm831x_rtc_pm_ops, 489 .pm = &wm831x_rtc_pm_ops,
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index c2e52d15abb..8ad86ae0d30 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -459,7 +459,7 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
459 return 0; 459 return 0;
460} 460}
461 461
462static int __devexit wm8350_rtc_remove(struct platform_device *pdev) 462static int wm8350_rtc_remove(struct platform_device *pdev)
463{ 463{
464 struct wm8350 *wm8350 = platform_get_drvdata(pdev); 464 struct wm8350 *wm8350 = platform_get_drvdata(pdev);
465 struct wm8350_rtc *wm_rtc = &wm8350->rtc; 465 struct wm8350_rtc *wm_rtc = &wm8350->rtc;
@@ -479,7 +479,7 @@ static struct dev_pm_ops wm8350_rtc_pm_ops = {
479 479
480static struct platform_driver wm8350_rtc_driver = { 480static struct platform_driver wm8350_rtc_driver = {
481 .probe = wm8350_rtc_probe, 481 .probe = wm8350_rtc_probe,
482 .remove = __devexit_p(wm8350_rtc_remove), 482 .remove = wm8350_rtc_remove,
483 .driver = { 483 .driver = {
484 .name = "wm8350-rtc", 484 .name = "wm8350-rtc",
485 .pm = &wm8350_rtc_pm_ops, 485 .pm = &wm8350_rtc_pm_ops,
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 9bd5da36f99..704488d0f81 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -248,7 +248,7 @@ static void dasd_ext_handler(struct ext_code ext_code,
248 default: 248 default:
249 return; 249 return;
250 } 250 }
251 kstat_cpu(smp_processor_id()).irqs[EXTINT_DSD]++; 251 inc_irq_stat(IRQEXT_DSD);
252 if (!ip) { /* no intparm: unsolicited interrupt */ 252 if (!ip) { /* no intparm: unsolicited interrupt */
253 DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited " 253 DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited "
254 "interrupt"); 254 "interrupt");
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 806fe912d6e..e37bc1620d1 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -4274,7 +4274,7 @@ static struct ccw_driver dasd_eckd_driver = {
4274 .thaw = dasd_generic_restore_device, 4274 .thaw = dasd_generic_restore_device,
4275 .restore = dasd_generic_restore_device, 4275 .restore = dasd_generic_restore_device,
4276 .uc_handler = dasd_generic_uc_handler, 4276 .uc_handler = dasd_generic_uc_handler,
4277 .int_class = IOINT_DAS, 4277 .int_class = IRQIO_DAS,
4278}; 4278};
4279 4279
4280/* 4280/*
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index eb748507c7f..41469858434 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -78,7 +78,7 @@ static struct ccw_driver dasd_fba_driver = {
78 .freeze = dasd_generic_pm_freeze, 78 .freeze = dasd_generic_pm_freeze,
79 .thaw = dasd_generic_restore_device, 79 .thaw = dasd_generic_restore_device,
80 .restore = dasd_generic_restore_device, 80 .restore = dasd_generic_restore_device,
81 .int_class = IOINT_DAS, 81 .int_class = IRQIO_DAS,
82}; 82};
83 83
84static void 84static void
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 40084501c31..33b7141a182 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -44,6 +44,7 @@
44#define RAW3215_NR_CCWS 3 44#define RAW3215_NR_CCWS 3
45#define RAW3215_TIMEOUT HZ/10 /* time for delayed output */ 45#define RAW3215_TIMEOUT HZ/10 /* time for delayed output */
46 46
47#define RAW3215_FIXED 1 /* 3215 console device is not be freed */
47#define RAW3215_WORKING 4 /* set if a request is being worked on */ 48#define RAW3215_WORKING 4 /* set if a request is being worked on */
48#define RAW3215_THROTTLED 8 /* set if reading is disabled */ 49#define RAW3215_THROTTLED 8 /* set if reading is disabled */
49#define RAW3215_STOPPED 16 /* set if writing is disabled */ 50#define RAW3215_STOPPED 16 /* set if writing is disabled */
@@ -630,7 +631,8 @@ static void raw3215_shutdown(struct raw3215_info *raw)
630 DECLARE_WAITQUEUE(wait, current); 631 DECLARE_WAITQUEUE(wait, current);
631 unsigned long flags; 632 unsigned long flags;
632 633
633 if (!(raw->port.flags & ASYNC_INITIALIZED)) 634 if (!(raw->port.flags & ASYNC_INITIALIZED) ||
635 (raw->flags & RAW3215_FIXED))
634 return; 636 return;
635 /* Wait for outstanding requests, then free irq */ 637 /* Wait for outstanding requests, then free irq */
636 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 638 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
@@ -805,7 +807,7 @@ static struct ccw_driver raw3215_ccw_driver = {
805 .freeze = &raw3215_pm_stop, 807 .freeze = &raw3215_pm_stop,
806 .thaw = &raw3215_pm_start, 808 .thaw = &raw3215_pm_start,
807 .restore = &raw3215_pm_start, 809 .restore = &raw3215_pm_start,
808 .int_class = IOINT_C15, 810 .int_class = IRQIO_C15,
809}; 811};
810 812
811#ifdef CONFIG_TN3215_CONSOLE 813#ifdef CONFIG_TN3215_CONSOLE
@@ -927,6 +929,8 @@ static int __init con3215_init(void)
927 dev_set_drvdata(&cdev->dev, raw); 929 dev_set_drvdata(&cdev->dev, raw);
928 cdev->handler = raw3215_irq; 930 cdev->handler = raw3215_irq;
929 931
932 raw->flags |= RAW3215_FIXED;
933
930 /* Request the console irq */ 934 /* Request the console irq */
931 if (raw3215_startup(raw) != 0) { 935 if (raw3215_startup(raw) != 0) {
932 raw3215_free_info(raw); 936 raw3215_free_info(raw);
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index f3b8bb84faf..9a6c140c5f0 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -1396,7 +1396,7 @@ static struct ccw_driver raw3270_ccw_driver = {
1396 .freeze = &raw3270_pm_stop, 1396 .freeze = &raw3270_pm_stop,
1397 .thaw = &raw3270_pm_start, 1397 .thaw = &raw3270_pm_start,
1398 .restore = &raw3270_pm_start, 1398 .restore = &raw3270_pm_start,
1399 .int_class = IOINT_C70, 1399 .int_class = IRQIO_C70,
1400}; 1400};
1401 1401
1402static int 1402static int
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index 4fa21f7e230..12c16a65dd2 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -400,7 +400,7 @@ static void sclp_interrupt_handler(struct ext_code ext_code,
400 u32 finished_sccb; 400 u32 finished_sccb;
401 u32 evbuf_pending; 401 u32 evbuf_pending;
402 402
403 kstat_cpu(smp_processor_id()).irqs[EXTINT_SCP]++; 403 inc_irq_stat(IRQEXT_SCP);
404 spin_lock(&sclp_lock); 404 spin_lock(&sclp_lock);
405 finished_sccb = param32 & 0xfffffff8; 405 finished_sccb = param32 & 0xfffffff8;
406 evbuf_pending = param32 & 0x3; 406 evbuf_pending = param32 & 0x3;
@@ -813,7 +813,7 @@ static void sclp_check_handler(struct ext_code ext_code,
813{ 813{
814 u32 finished_sccb; 814 u32 finished_sccb;
815 815
816 kstat_cpu(smp_processor_id()).irqs[EXTINT_SCP]++; 816 inc_irq_stat(IRQEXT_SCP);
817 finished_sccb = param32 & 0xfffffff8; 817 finished_sccb = param32 & 0xfffffff8;
818 /* Is this the interrupt we are waiting for? */ 818 /* Is this the interrupt we are waiting for? */
819 if (finished_sccb == 0) 819 if (finished_sccb == 0)
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
index 6ae929c024a..9aa79702b37 100644
--- a/drivers/s390/char/tape_34xx.c
+++ b/drivers/s390/char/tape_34xx.c
@@ -1193,7 +1193,7 @@ static struct ccw_driver tape_34xx_driver = {
1193 .set_online = tape_34xx_online, 1193 .set_online = tape_34xx_online,
1194 .set_offline = tape_generic_offline, 1194 .set_offline = tape_generic_offline,
1195 .freeze = tape_generic_pm_suspend, 1195 .freeze = tape_generic_pm_suspend,
1196 .int_class = IOINT_TAP, 1196 .int_class = IRQIO_TAP,
1197}; 1197};
1198 1198
1199static int 1199static int
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
index 1b0eb49f739..327cb19ad0b 100644
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -1656,7 +1656,7 @@ static struct ccw_driver tape_3590_driver = {
1656 .set_offline = tape_generic_offline, 1656 .set_offline = tape_generic_offline,
1657 .set_online = tape_3590_online, 1657 .set_online = tape_3590_online,
1658 .freeze = tape_generic_pm_suspend, 1658 .freeze = tape_generic_pm_suspend,
1659 .int_class = IOINT_TAP, 1659 .int_class = IRQIO_TAP,
1660}; 1660};
1661 1661
1662/* 1662/*
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 73bef0bd394..483f72ba030 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -74,7 +74,7 @@ static struct ccw_driver ur_driver = {
74 .set_online = ur_set_online, 74 .set_online = ur_set_online,
75 .set_offline = ur_set_offline, 75 .set_offline = ur_set_offline,
76 .freeze = ur_pm_suspend, 76 .freeze = ur_pm_suspend,
77 .int_class = IOINT_VMR, 77 .int_class = IRQIO_VMR,
78}; 78};
79 79
80static DEFINE_MUTEX(vmur_mutex); 80static DEFINE_MUTEX(vmur_mutex);
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 8f9a1a38449..facdf809113 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -58,7 +58,7 @@ static void chsc_subchannel_irq(struct subchannel *sch)
58 58
59 CHSC_LOG(4, "irb"); 59 CHSC_LOG(4, "irb");
60 CHSC_LOG_HEX(4, irb, sizeof(*irb)); 60 CHSC_LOG_HEX(4, irb, sizeof(*irb));
61 kstat_cpu(smp_processor_id()).irqs[IOINT_CSC]++; 61 inc_irq_stat(IRQIO_CSC);
62 62
63 /* Copy irb to provided request and set done. */ 63 /* Copy irb to provided request and set done. */
64 if (!request) { 64 if (!request) {
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 8e927b9f285..c8faf6230b0 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -611,7 +611,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
611 tpi_info = (struct tpi_info *)&S390_lowcore.subchannel_id; 611 tpi_info = (struct tpi_info *)&S390_lowcore.subchannel_id;
612 irb = (struct irb *)&S390_lowcore.irb; 612 irb = (struct irb *)&S390_lowcore.irb;
613 do { 613 do {
614 kstat_cpu(smp_processor_id()).irqs[IO_INTERRUPT]++; 614 kstat_incr_irqs_this_cpu(IO_INTERRUPT, NULL);
615 if (tpi_info->adapter_IO) { 615 if (tpi_info->adapter_IO) {
616 do_adapter_IO(tpi_info->isc); 616 do_adapter_IO(tpi_info->isc);
617 continue; 617 continue;
@@ -619,7 +619,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
619 sch = (struct subchannel *)(unsigned long)tpi_info->intparm; 619 sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
620 if (!sch) { 620 if (!sch) {
621 /* Clear pending interrupt condition. */ 621 /* Clear pending interrupt condition. */
622 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 622 inc_irq_stat(IRQIO_CIO);
623 tsch(tpi_info->schid, irb); 623 tsch(tpi_info->schid, irb);
624 continue; 624 continue;
625 } 625 }
@@ -633,9 +633,9 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
633 if (sch->driver && sch->driver->irq) 633 if (sch->driver && sch->driver->irq)
634 sch->driver->irq(sch); 634 sch->driver->irq(sch);
635 else 635 else
636 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 636 inc_irq_stat(IRQIO_CIO);
637 } else 637 } else
638 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 638 inc_irq_stat(IRQIO_CIO);
639 spin_unlock(sch->lock); 639 spin_unlock(sch->lock);
640 /* 640 /*
641 * Are more interrupts pending? 641 * Are more interrupts pending?
@@ -678,7 +678,7 @@ static void cio_tsch(struct subchannel *sch)
678 if (sch->driver && sch->driver->irq) 678 if (sch->driver && sch->driver->irq)
679 sch->driver->irq(sch); 679 sch->driver->irq(sch);
680 else 680 else
681 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 681 inc_irq_stat(IRQIO_CIO);
682 if (!irq_context) { 682 if (!irq_context) {
683 irq_exit(); 683 irq_exit();
684 _local_bh_enable(); 684 _local_bh_enable();
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 6995cff4463..7cd5c6812ac 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -758,7 +758,7 @@ static int io_subchannel_initialize_dev(struct subchannel *sch,
758 struct ccw_device *cdev) 758 struct ccw_device *cdev)
759{ 759{
760 cdev->private->cdev = cdev; 760 cdev->private->cdev = cdev;
761 cdev->private->int_class = IOINT_CIO; 761 cdev->private->int_class = IRQIO_CIO;
762 atomic_set(&cdev->private->onoff, 0); 762 atomic_set(&cdev->private->onoff, 0);
763 cdev->dev.parent = &sch->dev; 763 cdev->dev.parent = &sch->dev;
764 cdev->dev.release = ccw_device_release; 764 cdev->dev.release = ccw_device_release;
@@ -1023,7 +1023,7 @@ static void io_subchannel_irq(struct subchannel *sch)
1023 if (cdev) 1023 if (cdev)
1024 dev_fsm_event(cdev, DEV_EVENT_INTERRUPT); 1024 dev_fsm_event(cdev, DEV_EVENT_INTERRUPT);
1025 else 1025 else
1026 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 1026 inc_irq_stat(IRQIO_CIO);
1027} 1027}
1028 1028
1029void io_subchannel_init_config(struct subchannel *sch) 1029void io_subchannel_init_config(struct subchannel *sch)
@@ -1634,7 +1634,7 @@ ccw_device_probe_console(void)
1634 memset(&console_private, 0, sizeof(struct ccw_device_private)); 1634 memset(&console_private, 0, sizeof(struct ccw_device_private));
1635 console_cdev.private = &console_private; 1635 console_cdev.private = &console_private;
1636 console_private.cdev = &console_cdev; 1636 console_private.cdev = &console_cdev;
1637 console_private.int_class = IOINT_CIO; 1637 console_private.int_class = IRQIO_CIO;
1638 ret = ccw_device_console_enable(&console_cdev, sch); 1638 ret = ccw_device_console_enable(&console_cdev, sch);
1639 if (ret) { 1639 if (ret) {
1640 cio_release_console(); 1640 cio_release_console();
@@ -1715,13 +1715,13 @@ ccw_device_probe (struct device *dev)
1715 if (cdrv->int_class != 0) 1715 if (cdrv->int_class != 0)
1716 cdev->private->int_class = cdrv->int_class; 1716 cdev->private->int_class = cdrv->int_class;
1717 else 1717 else
1718 cdev->private->int_class = IOINT_CIO; 1718 cdev->private->int_class = IRQIO_CIO;
1719 1719
1720 ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV; 1720 ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV;
1721 1721
1722 if (ret) { 1722 if (ret) {
1723 cdev->drv = NULL; 1723 cdev->drv = NULL;
1724 cdev->private->int_class = IOINT_CIO; 1724 cdev->private->int_class = IRQIO_CIO;
1725 return ret; 1725 return ret;
1726 } 1726 }
1727 1727
@@ -1755,7 +1755,7 @@ ccw_device_remove (struct device *dev)
1755 } 1755 }
1756 ccw_device_set_timeout(cdev, 0); 1756 ccw_device_set_timeout(cdev, 0);
1757 cdev->drv = NULL; 1757 cdev->drv = NULL;
1758 cdev->private->int_class = IOINT_CIO; 1758 cdev->private->int_class = IRQIO_CIO;
1759 return 0; 1759 return 0;
1760} 1760}
1761 1761
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h
index 2e575cff984..7d4ecb65db0 100644
--- a/drivers/s390/cio/device.h
+++ b/drivers/s390/cio/device.h
@@ -61,11 +61,10 @@ dev_fsm_event(struct ccw_device *cdev, enum dev_event dev_event)
61 61
62 if (dev_event == DEV_EVENT_INTERRUPT) { 62 if (dev_event == DEV_EVENT_INTERRUPT) {
63 if (state == DEV_STATE_ONLINE) 63 if (state == DEV_STATE_ONLINE)
64 kstat_cpu(smp_processor_id()). 64 inc_irq_stat(cdev->private->int_class);
65 irqs[cdev->private->int_class]++;
66 else if (state != DEV_STATE_CMFCHANGE && 65 else if (state != DEV_STATE_CMFCHANGE &&
67 state != DEV_STATE_CMFUPDATE) 66 state != DEV_STATE_CMFUPDATE)
68 kstat_cpu(smp_processor_id()).irqs[IOINT_CIO]++; 67 inc_irq_stat(IRQIO_CIO);
69 } 68 }
70 dev_jumptable[state][dev_event](cdev, dev_event); 69 dev_jumptable[state][dev_event](cdev, dev_event);
71} 70}
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
index 6c967340046..d9eddcba7e8 100644
--- a/drivers/s390/cio/eadm_sch.c
+++ b/drivers/s390/cio/eadm_sch.c
@@ -139,7 +139,7 @@ static void eadm_subchannel_irq(struct subchannel *sch)
139 EADM_LOG(6, "irq"); 139 EADM_LOG(6, "irq");
140 EADM_LOG_HEX(6, irb, sizeof(*irb)); 140 EADM_LOG_HEX(6, irb, sizeof(*irb));
141 141
142 kstat_cpu(smp_processor_id()).irqs[IOINT_ADM]++; 142 inc_irq_stat(IRQIO_ADM);
143 143
144 if ((scsw->stctl & (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) 144 if ((scsw->stctl & (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))
145 && scsw->eswf == 1 && irb->esw.eadm.erw.r) 145 && scsw->eswf == 1 && irb->esw.eadm.erw.r)
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index bdb394b066f..bde5255200d 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -182,7 +182,7 @@ static void tiqdio_thinint_handler(void *alsi, void *data)
182 struct qdio_q *q; 182 struct qdio_q *q;
183 183
184 last_ai_time = S390_lowcore.int_clock; 184 last_ai_time = S390_lowcore.int_clock;
185 kstat_cpu(smp_processor_id()).irqs[IOINT_QAI]++; 185 inc_irq_stat(IRQIO_QAI);
186 186
187 /* protect tiq_list entries, only changed in activate or shutdown */ 187 /* protect tiq_list entries, only changed in activate or shutdown */
188 rcu_read_lock(); 188 rcu_read_lock();
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 7b865a7300e..b8b340ac533 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1272,7 +1272,7 @@ out:
1272 1272
1273static void ap_interrupt_handler(void *unused1, void *unused2) 1273static void ap_interrupt_handler(void *unused1, void *unused2)
1274{ 1274{
1275 kstat_cpu(smp_processor_id()).irqs[IOINT_APB]++; 1275 inc_irq_stat(IRQIO_APB);
1276 tasklet_schedule(&ap_tasklet); 1276 tasklet_schedule(&ap_tasklet);
1277} 1277}
1278 1278
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
index 7dabef624da..8491111aec1 100644
--- a/drivers/s390/kvm/kvm_virtio.c
+++ b/drivers/s390/kvm/kvm_virtio.c
@@ -392,7 +392,7 @@ static void kvm_extint_handler(struct ext_code ext_code,
392 392
393 if ((ext_code.subcode & 0xff00) != VIRTIO_SUBCODE_64) 393 if ((ext_code.subcode & 0xff00) != VIRTIO_SUBCODE_64)
394 return; 394 return;
395 kstat_cpu(smp_processor_id()).irqs[EXTINT_VRT]++; 395 inc_irq_stat(IRQEXT_VRT);
396 396
397 /* The LSB might be overloaded, we have to mask it */ 397 /* The LSB might be overloaded, we have to mask it */
398 vq = (struct virtqueue *)(param64 & ~1UL); 398 vq = (struct virtqueue *)(param64 & ~1UL);
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 5c70a659957..83bc9c5fa0c 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -282,7 +282,7 @@ static struct ccw_driver claw_ccw_driver = {
282 .ids = claw_ids, 282 .ids = claw_ids,
283 .probe = ccwgroup_probe_ccwdev, 283 .probe = ccwgroup_probe_ccwdev,
284 .remove = ccwgroup_remove_ccwdev, 284 .remove = ccwgroup_remove_ccwdev,
285 .int_class = IOINT_CLW, 285 .int_class = IRQIO_CLW,
286}; 286};
287 287
288static ssize_t claw_driver_group_store(struct device_driver *ddrv, 288static ssize_t claw_driver_group_store(struct device_driver *ddrv,
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 817b68925dd..676f12049a3 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1755,7 +1755,7 @@ static struct ccw_driver ctcm_ccw_driver = {
1755 .ids = ctcm_ids, 1755 .ids = ctcm_ids,
1756 .probe = ccwgroup_probe_ccwdev, 1756 .probe = ccwgroup_probe_ccwdev,
1757 .remove = ccwgroup_remove_ccwdev, 1757 .remove = ccwgroup_remove_ccwdev,
1758 .int_class = IOINT_CTC, 1758 .int_class = IRQIO_CTC,
1759}; 1759};
1760 1760
1761static struct ccwgroup_driver ctcm_group_driver = { 1761static struct ccwgroup_driver ctcm_group_driver = {
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 2ca0f1dd7a0..c645dc9e98a 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -2384,7 +2384,7 @@ static struct ccw_driver lcs_ccw_driver = {
2384 .ids = lcs_ids, 2384 .ids = lcs_ids,
2385 .probe = ccwgroup_probe_ccwdev, 2385 .probe = ccwgroup_probe_ccwdev,
2386 .remove = ccwgroup_remove_ccwdev, 2386 .remove = ccwgroup_remove_ccwdev,
2387 .int_class = IOINT_LCS, 2387 .int_class = IRQIO_LCS,
2388}; 2388};
2389 2389
2390/** 2390/**
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index 54266829290..1a9d1e3ce64 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -355,7 +355,7 @@ fail:
355extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); 355extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
356extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); 356extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
357 357
358static int __devinit bbc_i2c_probe(struct platform_device *op) 358static int bbc_i2c_probe(struct platform_device *op)
359{ 359{
360 struct bbc_i2c_bus *bp; 360 struct bbc_i2c_bus *bp;
361 int err, index = 0; 361 int err, index = 0;
@@ -379,7 +379,7 @@ static int __devinit bbc_i2c_probe(struct platform_device *op)
379 return err; 379 return err;
380} 380}
381 381
382static int __devexit bbc_i2c_remove(struct platform_device *op) 382static int bbc_i2c_remove(struct platform_device *op)
383{ 383{
384 struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); 384 struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev);
385 385
@@ -413,7 +413,7 @@ static struct platform_driver bbc_i2c_driver = {
413 .of_match_table = bbc_i2c_match, 413 .of_match_table = bbc_i2c_match,
414 }, 414 },
415 .probe = bbc_i2c_probe, 415 .probe = bbc_i2c_probe,
416 .remove = __devexit_p(bbc_i2c_remove), 416 .remove = bbc_i2c_remove,
417}; 417};
418 418
419module_platform_driver(bbc_i2c_driver); 419module_platform_driver(bbc_i2c_driver);
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index b160073e54b..e85c803b30c 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -171,7 +171,7 @@ static struct miscdevice d7s_miscdev = {
171 .fops = &d7s_fops 171 .fops = &d7s_fops
172}; 172};
173 173
174static int __devinit d7s_probe(struct platform_device *op) 174static int d7s_probe(struct platform_device *op)
175{ 175{
176 struct device_node *opts; 176 struct device_node *opts;
177 int err = -EINVAL; 177 int err = -EINVAL;
@@ -236,7 +236,7 @@ out_free:
236 goto out; 236 goto out;
237} 237}
238 238
239static int __devexit d7s_remove(struct platform_device *op) 239static int d7s_remove(struct platform_device *op)
240{ 240{
241 struct d7s *p = dev_get_drvdata(&op->dev); 241 struct d7s *p = dev_get_drvdata(&op->dev);
242 u8 regs = readb(p->regs); 242 u8 regs = readb(p->regs);
@@ -272,7 +272,7 @@ static struct platform_driver d7s_driver = {
272 .of_match_table = d7s_match, 272 .of_match_table = d7s_match,
273 }, 273 },
274 .probe = d7s_probe, 274 .probe = d7s_probe,
275 .remove = __devexit_p(d7s_remove), 275 .remove = d7s_remove,
276}; 276};
277 277
278module_platform_driver(d7s_driver); 278module_platform_driver(d7s_driver);
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index 0bc18569f9c..ddbe5a9e713 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -1028,7 +1028,7 @@ static int kenvctrld(void *__unused)
1028 return 0; 1028 return 0;
1029} 1029}
1030 1030
1031static int __devinit envctrl_probe(struct platform_device *op) 1031static int envctrl_probe(struct platform_device *op)
1032{ 1032{
1033 struct device_node *dp; 1033 struct device_node *dp;
1034 int index, err; 1034 int index, err;
@@ -1104,7 +1104,7 @@ out_iounmap:
1104 return err; 1104 return err;
1105} 1105}
1106 1106
1107static int __devexit envctrl_remove(struct platform_device *op) 1107static int envctrl_remove(struct platform_device *op)
1108{ 1108{
1109 int index; 1109 int index;
1110 1110
@@ -1135,7 +1135,7 @@ static struct platform_driver envctrl_driver = {
1135 .of_match_table = envctrl_match, 1135 .of_match_table = envctrl_match,
1136 }, 1136 },
1137 .probe = envctrl_probe, 1137 .probe = envctrl_probe,
1138 .remove = __devexit_p(envctrl_remove), 1138 .remove = envctrl_remove,
1139}; 1139};
1140 1140
1141module_platform_driver(envctrl_driver); 1141module_platform_driver(envctrl_driver);
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 327657e2e26..d9f268f2377 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -159,7 +159,7 @@ static const struct file_operations flash_fops = {
159 159
160static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; 160static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
161 161
162static int __devinit flash_probe(struct platform_device *op) 162static int flash_probe(struct platform_device *op)
163{ 163{
164 struct device_node *dp = op->dev.of_node; 164 struct device_node *dp = op->dev.of_node;
165 struct device_node *parent; 165 struct device_node *parent;
@@ -190,7 +190,7 @@ static int __devinit flash_probe(struct platform_device *op)
190 return misc_register(&flash_dev); 190 return misc_register(&flash_dev);
191} 191}
192 192
193static int __devexit flash_remove(struct platform_device *op) 193static int flash_remove(struct platform_device *op)
194{ 194{
195 misc_deregister(&flash_dev); 195 misc_deregister(&flash_dev);
196 196
@@ -212,7 +212,7 @@ static struct platform_driver flash_driver = {
212 .of_match_table = flash_match, 212 .of_match_table = flash_match,
213 }, 213 },
214 .probe = flash_probe, 214 .probe = flash_probe,
215 .remove = __devexit_p(flash_remove), 215 .remove = flash_remove,
216}; 216};
217 217
218module_platform_driver(flash_driver); 218module_platform_driver(flash_driver);
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index a9e468cc1ca..b0aae0536d5 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -347,7 +347,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver)
347 347
348} 348}
349 349
350static int __devinit uctrl_probe(struct platform_device *op) 350static int uctrl_probe(struct platform_device *op)
351{ 351{
352 struct uctrl_driver *p; 352 struct uctrl_driver *p;
353 int err = -ENOMEM; 353 int err = -ENOMEM;
@@ -402,7 +402,7 @@ out_free:
402 goto out; 402 goto out;
403} 403}
404 404
405static int __devexit uctrl_remove(struct platform_device *op) 405static int uctrl_remove(struct platform_device *op)
406{ 406{
407 struct uctrl_driver *p = dev_get_drvdata(&op->dev); 407 struct uctrl_driver *p = dev_get_drvdata(&op->dev);
408 408
@@ -430,7 +430,7 @@ static struct platform_driver uctrl_driver = {
430 .of_match_table = uctrl_match, 430 .of_match_table = uctrl_match,
431 }, 431 },
432 .probe = uctrl_probe, 432 .probe = uctrl_probe,
433 .remove = __devexit_p(uctrl_remove), 433 .remove = uctrl_remove,
434}; 434};
435 435
436 436
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 3868ab2397c..d1f0120cdb9 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2029,7 +2029,7 @@ static struct scsi_host_template driver_template = {
2029}; 2029};
2030 2030
2031/* This function will probe and initialize a card */ 2031/* This function will probe and initialize a card */
2032static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) 2032static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
2033{ 2033{
2034 struct Scsi_Host *host = NULL; 2034 struct Scsi_Host *host = NULL;
2035 TW_Device_Extension *tw_dev; 2035 TW_Device_Extension *tw_dev;
@@ -2305,7 +2305,7 @@ out_disable_device:
2305#endif 2305#endif
2306 2306
2307/* PCI Devices supported by this driver */ 2307/* PCI Devices supported by this driver */
2308static struct pci_device_id twa_pci_tbl[] __devinitdata = { 2308static struct pci_device_id twa_pci_tbl[] = {
2309 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9000, 2309 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9000,
2310 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2310 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2311 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX, 2311 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX,
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 13e39e1fdfe..52a2f0580d9 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -1604,7 +1604,7 @@ static struct scsi_host_template driver_template = {
1604}; 1604};
1605 1605
1606/* This function will probe and initialize a card */ 1606/* This function will probe and initialize a card */
1607static int __devinit twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) 1607static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
1608{ 1608{
1609 struct Scsi_Host *host = NULL; 1609 struct Scsi_Host *host = NULL;
1610 TW_Device_Extension *tw_dev; 1610 TW_Device_Extension *tw_dev;
@@ -1893,7 +1893,7 @@ out_disable_device:
1893#endif 1893#endif
1894 1894
1895/* PCI Devices supported by this driver */ 1895/* PCI Devices supported by this driver */
1896static struct pci_device_id twl_pci_tbl[] __devinitdata = { 1896static struct pci_device_id twl_pci_tbl[] = {
1897 { PCI_VDEVICE(3WARE, PCI_DEVICE_ID_3WARE_9750) }, 1897 { PCI_VDEVICE(3WARE, PCI_DEVICE_ID_3WARE_9750) },
1898 { } 1898 { }
1899}; 1899};
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 7fe96ff60c5..62071d2fc1c 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2281,7 +2281,7 @@ static struct scsi_host_template driver_template = {
2281}; 2281};
2282 2282
2283/* This function will probe and initialize a card */ 2283/* This function will probe and initialize a card */
2284static int __devinit tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) 2284static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
2285{ 2285{
2286 struct Scsi_Host *host = NULL; 2286 struct Scsi_Host *host = NULL;
2287 TW_Device_Extension *tw_dev; 2287 TW_Device_Extension *tw_dev;
@@ -2422,7 +2422,7 @@ static void tw_remove(struct pci_dev *pdev)
2422} /* End tw_remove() */ 2422} /* End tw_remove() */
2423 2423
2424/* PCI Devices supported by this driver */ 2424/* PCI Devices supported by this driver */
2425static struct pci_device_id tw_pci_tbl[] __devinitdata = { 2425static struct pci_device_id tw_pci_tbl[] = {
2426 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_1000, 2426 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_1000,
2427 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2427 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2428 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_7000, 2428 { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_7000,
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index d4da3708763..d7ca247efa3 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -3615,7 +3615,7 @@ static void __exit BusLogic_exit(void)
3615__setup("BusLogic=", BusLogic_Setup); 3615__setup("BusLogic=", BusLogic_Setup);
3616 3616
3617#ifdef MODULE 3617#ifdef MODULE
3618static struct pci_device_id BusLogic_pci_tbl[] __devinitdata = { 3618static struct pci_device_id BusLogic_pci_tbl[] = {
3619 { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, 3619 { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
3620 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 3620 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3621 { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC, 3621 { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC,
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 165e4dd865d..450353e04dd 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -814,7 +814,7 @@ static char *lprint_opcode(int opcode, char *pos, char *buffer, int length)
814 * Locks: interrupts must be enabled when we are called 814 * Locks: interrupts must be enabled when we are called
815 */ 815 */
816 816
817static int __devinit NCR5380_init(struct Scsi_Host *instance, int flags) 817static int NCR5380_init(struct Scsi_Host *instance, int flags)
818{ 818{
819 NCR5380_local_declare(); 819 NCR5380_local_declare();
820 int i, pass; 820 int i, pass;
diff --git a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c
index 8647256ad66..b39a2409a50 100644
--- a/drivers/scsi/NCR_D700.c
+++ b/drivers/scsi/NCR_D700.c
@@ -114,7 +114,7 @@ MODULE_DESCRIPTION("NCR Dual700 SCSI Driver");
114MODULE_LICENSE("GPL"); 114MODULE_LICENSE("GPL");
115module_param(NCR_D700, charp, 0); 115module_param(NCR_D700, charp, 0);
116 116
117static __u8 __devinitdata id_array[2*(MCA_MAX_SLOT_NR + 1)] = 117static __u8 id_array[2*(MCA_MAX_SLOT_NR + 1)] =
118 { [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 }; 118 { [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 };
119 119
120#ifdef MODULE 120#ifdef MODULE
@@ -173,7 +173,7 @@ struct NCR_D700_private {
173 char pad; 173 char pad;
174}; 174};
175 175
176static int __devinit 176static int
177NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq, 177NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq,
178 int slot, u32 region, int differential) 178 int slot, u32 region, int differential)
179{ 179{
@@ -243,7 +243,7 @@ NCR_D700_intr(int irq, void *data)
243 * essentially connectecd to the MCA bus independently, it is easier 243 * essentially connectecd to the MCA bus independently, it is easier
244 * to set them up as two separate host adapters, rather than one 244 * to set them up as two separate host adapters, rather than one
245 * adapter with two channels */ 245 * adapter with two channels */
246static int __devinit 246static int
247NCR_D700_probe(struct device *dev) 247NCR_D700_probe(struct device *dev)
248{ 248{
249 struct NCR_D700_private *p; 249 struct NCR_D700_private *p;
@@ -349,7 +349,7 @@ NCR_D700_probe(struct device *dev)
349 return 0; 349 return 0;
350} 350}
351 351
352static void __devexit 352static void
353NCR_D700_remove_one(struct Scsi_Host *host) 353NCR_D700_remove_one(struct Scsi_Host *host)
354{ 354{
355 scsi_remove_host(host); 355 scsi_remove_host(host);
@@ -359,7 +359,7 @@ NCR_D700_remove_one(struct Scsi_Host *host)
359 release_region(host->base, 64); 359 release_region(host->base, 64);
360} 360}
361 361
362static int __devexit 362static int
363NCR_D700_remove(struct device *dev) 363NCR_D700_remove(struct device *dev)
364{ 364{
365 struct NCR_D700_private *p = dev_get_drvdata(dev); 365 struct NCR_D700_private *p = dev_get_drvdata(dev);
@@ -380,7 +380,7 @@ static struct mca_driver NCR_D700_driver = {
380 .name = "NCR_D700", 380 .name = "NCR_D700",
381 .bus = &mca_bus_type, 381 .bus = &mca_bus_type,
382 .probe = NCR_D700_probe, 382 .probe = NCR_D700_probe,
383 .remove = __devexit_p(NCR_D700_remove), 383 .remove = NCR_D700_remove,
384 }, 384 },
385}; 385};
386 386
diff --git a/drivers/scsi/NCR_Q720.c b/drivers/scsi/NCR_Q720.c
index afdbb9addf1..05835bf1bf9 100644
--- a/drivers/scsi/NCR_Q720.c
+++ b/drivers/scsi/NCR_Q720.c
@@ -351,7 +351,7 @@ static struct mca_driver NCR_Q720_driver = {
351 .name = "NCR_Q720", 351 .name = "NCR_Q720",
352 .bus = &mca_bus_type, 352 .bus = &mca_bus_type,
353 .probe = NCR_Q720_probe, 353 .probe = NCR_Q720_probe,
354 .remove = __devexit_p(NCR_Q720_remove), 354 .remove = NCR_Q720_remove,
355 }, 355 },
356}; 356};
357 357
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index a391090a17c..0163457c12b 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1082,8 +1082,8 @@ static struct scsi_host_template inia100_template = {
1082 .use_clustering = ENABLE_CLUSTERING, 1082 .use_clustering = ENABLE_CLUSTERING,
1083}; 1083};
1084 1084
1085static int __devinit inia100_probe_one(struct pci_dev *pdev, 1085static int inia100_probe_one(struct pci_dev *pdev,
1086 const struct pci_device_id *id) 1086 const struct pci_device_id *id)
1087{ 1087{
1088 struct Scsi_Host *shost; 1088 struct Scsi_Host *shost;
1089 struct orc_host *host; 1089 struct orc_host *host;
@@ -1197,7 +1197,7 @@ out:
1197 return error; 1197 return error;
1198} 1198}
1199 1199
1200static void __devexit inia100_remove_one(struct pci_dev *pdev) 1200static void inia100_remove_one(struct pci_dev *pdev)
1201{ 1201{
1202 struct Scsi_Host *shost = pci_get_drvdata(pdev); 1202 struct Scsi_Host *shost = pci_get_drvdata(pdev);
1203 struct orc_host *host = (struct orc_host *)shost->hostdata; 1203 struct orc_host *host = (struct orc_host *)shost->hostdata;
@@ -1224,7 +1224,7 @@ static struct pci_driver inia100_pci_driver = {
1224 .name = "inia100", 1224 .name = "inia100",
1225 .id_table = inia100_pci_tbl, 1225 .id_table = inia100_pci_tbl,
1226 .probe = inia100_probe_one, 1226 .probe = inia100_probe_one,
1227 .remove = __devexit_p(inia100_remove_one), 1227 .remove = inia100_remove_one,
1228}; 1228};
1229 1229
1230static int __init inia100_init(void) 1230static int __init inia100_init(void)
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 79a30633d4a..3e09aa21c1c 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -179,8 +179,7 @@ static struct scsi_host_template a2091_scsi_template = {
179 .use_clustering = DISABLE_CLUSTERING 179 .use_clustering = DISABLE_CLUSTERING
180}; 180};
181 181
182static int __devinit a2091_probe(struct zorro_dev *z, 182static int a2091_probe(struct zorro_dev *z, const struct zorro_device_id *ent)
183 const struct zorro_device_id *ent)
184{ 183{
185 struct Scsi_Host *instance; 184 struct Scsi_Host *instance;
186 int error; 185 int error;
@@ -239,7 +238,7 @@ fail_alloc:
239 return error; 238 return error;
240} 239}
241 240
242static void __devexit a2091_remove(struct zorro_dev *z) 241static void a2091_remove(struct zorro_dev *z)
243{ 242{
244 struct Scsi_Host *instance = zorro_get_drvdata(z); 243 struct Scsi_Host *instance = zorro_get_drvdata(z);
245 struct a2091_hostdata *hdata = shost_priv(instance); 244 struct a2091_hostdata *hdata = shost_priv(instance);
@@ -251,7 +250,7 @@ static void __devexit a2091_remove(struct zorro_dev *z)
251 release_mem_region(z->resource.start, 256); 250 release_mem_region(z->resource.start, 256);
252} 251}
253 252
254static struct zorro_device_id a2091_zorro_tbl[] __devinitdata = { 253static struct zorro_device_id a2091_zorro_tbl[] = {
255 { ZORRO_PROD_CBM_A590_A2091_1 }, 254 { ZORRO_PROD_CBM_A590_A2091_1 },
256 { ZORRO_PROD_CBM_A590_A2091_2 }, 255 { ZORRO_PROD_CBM_A590_A2091_2 },
257 { 0 } 256 { 0 }
@@ -262,7 +261,7 @@ static struct zorro_driver a2091_driver = {
262 .name = "a2091", 261 .name = "a2091",
263 .id_table = a2091_zorro_tbl, 262 .id_table = a2091_zorro_tbl,
264 .probe = a2091_probe, 263 .probe = a2091_probe,
265 .remove = __devexit_p(a2091_remove), 264 .remove = a2091_remove,
266}; 265};
267 266
268static int __init a2091_init(void) 267static int __init a2091_init(void)
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index cb7f1582a6d..408a42ef787 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -88,13 +88,7 @@ char aac_driver_version[] = AAC_DRIVER_FULL_VERSION;
88 * 88 *
89 * Note: The last field is used to index into aac_drivers below. 89 * Note: The last field is used to index into aac_drivers below.
90 */ 90 */
91#ifdef DECLARE_PCI_DEVICE_TABLE 91static const struct pci_device_id aac_pci_tbl[] = {
92static DECLARE_PCI_DEVICE_TABLE(aac_pci_tbl) = {
93#elif defined(__devinitconst)
94static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
95#else
96static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
97#endif
98 { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */ 92 { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */
99 { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */ 93 { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */
100 { 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */ 94 { 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */
@@ -1107,8 +1101,7 @@ static void __aac_shutdown(struct aac_dev * aac)
1107 pci_disable_msi(aac->pdev); 1101 pci_disable_msi(aac->pdev);
1108} 1102}
1109 1103
1110static int __devinit aac_probe_one(struct pci_dev *pdev, 1104static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1111 const struct pci_device_id *id)
1112{ 1105{
1113 unsigned index = id->driver_data; 1106 unsigned index = id->driver_data;
1114 struct Scsi_Host *shost; 1107 struct Scsi_Host *shost;
@@ -1310,7 +1303,7 @@ static void aac_shutdown(struct pci_dev *dev)
1310 __aac_shutdown((struct aac_dev *)shost->hostdata); 1303 __aac_shutdown((struct aac_dev *)shost->hostdata);
1311} 1304}
1312 1305
1313static void __devexit aac_remove_one(struct pci_dev *pdev) 1306static void aac_remove_one(struct pci_dev *pdev)
1314{ 1307{
1315 struct Scsi_Host *shost = pci_get_drvdata(pdev); 1308 struct Scsi_Host *shost = pci_get_drvdata(pdev);
1316 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; 1309 struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
@@ -1341,7 +1334,7 @@ static struct pci_driver aac_pci_driver = {
1341 .name = AAC_DRIVERNAME, 1334 .name = AAC_DRIVERNAME,
1342 .id_table = aac_pci_tbl, 1335 .id_table = aac_pci_tbl,
1343 .probe = aac_probe_one, 1336 .probe = aac_probe_one,
1344 .remove = __devexit_p(aac_remove_one), 1337 .remove = aac_remove_one,
1345 .shutdown = aac_shutdown, 1338 .shutdown = aac_shutdown,
1346}; 1339};
1347 1340
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 374c4edf4fc..dcfaee66a8b 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -9526,7 +9526,7 @@ advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *
9526 9526
9527static DEF_SCSI_QCMD(advansys_queuecommand) 9527static DEF_SCSI_QCMD(advansys_queuecommand)
9528 9528
9529static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) 9529static ushort AscGetEisaChipCfg(PortAddr iop_base)
9530{ 9530{
9531 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | 9531 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
9532 (PortAddr) (ASC_EISA_CFG_IOP_MASK); 9532 (PortAddr) (ASC_EISA_CFG_IOP_MASK);
@@ -9537,8 +9537,8 @@ static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base)
9537 * Return the BIOS address of the adapter at the specified 9537 * Return the BIOS address of the adapter at the specified
9538 * I/O port and with the specified bus type. 9538 * I/O port and with the specified bus type.
9539 */ 9539 */
9540static unsigned short __devinit 9540static unsigned short AscGetChipBiosAddress(PortAddr iop_base,
9541AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type) 9541 unsigned short bus_type)
9542{ 9542{
9543 unsigned short cfg_lsw; 9543 unsigned short cfg_lsw;
9544 unsigned short bios_addr; 9544 unsigned short bios_addr;
@@ -9569,7 +9569,7 @@ AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type)
9569 return bios_addr; 9569 return bios_addr;
9570} 9570}
9571 9571
9572static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) 9572static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id)
9573{ 9573{
9574 ushort cfg_lsw; 9574 ushort cfg_lsw;
9575 9575
@@ -9583,7 +9583,7 @@ static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id)
9583 return (AscGetChipScsiID(iop_base)); 9583 return (AscGetChipScsiID(iop_base));
9584} 9584}
9585 9585
9586static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base) 9586static unsigned char AscGetChipScsiCtrl(PortAddr iop_base)
9587{ 9587{
9588 unsigned char sc; 9588 unsigned char sc;
9589 9589
@@ -9593,8 +9593,8 @@ static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base)
9593 return sc; 9593 return sc;
9594} 9594}
9595 9595
9596static unsigned char __devinit 9596static unsigned char AscGetChipVersion(PortAddr iop_base,
9597AscGetChipVersion(PortAddr iop_base, unsigned short bus_type) 9597 unsigned short bus_type)
9598{ 9598{
9599 if (bus_type & ASC_IS_EISA) { 9599 if (bus_type & ASC_IS_EISA) {
9600 PortAddr eisa_iop; 9600 PortAddr eisa_iop;
@@ -9608,7 +9608,7 @@ AscGetChipVersion(PortAddr iop_base, unsigned short bus_type)
9608} 9608}
9609 9609
9610#ifdef CONFIG_ISA 9610#ifdef CONFIG_ISA
9611static void __devinit AscEnableIsaDma(uchar dma_channel) 9611static void AscEnableIsaDma(uchar dma_channel)
9612{ 9612{
9613 if (dma_channel < 4) { 9613 if (dma_channel < 4) {
9614 outp(0x000B, (ushort)(0xC0 | dma_channel)); 9614 outp(0x000B, (ushort)(0xC0 | dma_channel));
@@ -9638,7 +9638,7 @@ static int AscStopQueueExe(PortAddr iop_base)
9638 return (0); 9638 return (0);
9639} 9639}
9640 9640
9641static ASC_DCNT __devinit AscGetMaxDmaCount(ushort bus_type) 9641static ASC_DCNT AscGetMaxDmaCount(ushort bus_type)
9642{ 9642{
9643 if (bus_type & ASC_IS_ISA) 9643 if (bus_type & ASC_IS_ISA)
9644 return ASC_MAX_ISA_DMA_COUNT; 9644 return ASC_MAX_ISA_DMA_COUNT;
@@ -9648,7 +9648,7 @@ static ASC_DCNT __devinit AscGetMaxDmaCount(ushort bus_type)
9648} 9648}
9649 9649
9650#ifdef CONFIG_ISA 9650#ifdef CONFIG_ISA
9651static ushort __devinit AscGetIsaDmaChannel(PortAddr iop_base) 9651static ushort AscGetIsaDmaChannel(PortAddr iop_base)
9652{ 9652{
9653 ushort channel; 9653 ushort channel;
9654 9654
@@ -9660,7 +9660,7 @@ static ushort __devinit AscGetIsaDmaChannel(PortAddr iop_base)
9660 return (channel + 4); 9660 return (channel + 4);
9661} 9661}
9662 9662
9663static ushort __devinit AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel) 9663static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel)
9664{ 9664{
9665 ushort cfg_lsw; 9665 ushort cfg_lsw;
9666 uchar value; 9666 uchar value;
@@ -9678,7 +9678,7 @@ static ushort __devinit AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channe
9678 return 0; 9678 return 0;
9679} 9679}
9680 9680
9681static uchar __devinit AscGetIsaDmaSpeed(PortAddr iop_base) 9681static uchar AscGetIsaDmaSpeed(PortAddr iop_base)
9682{ 9682{
9683 uchar speed_value; 9683 uchar speed_value;
9684 9684
@@ -9689,7 +9689,7 @@ static uchar __devinit AscGetIsaDmaSpeed(PortAddr iop_base)
9689 return speed_value; 9689 return speed_value;
9690} 9690}
9691 9691
9692static uchar __devinit AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value) 9692static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value)
9693{ 9693{
9694 speed_value &= 0x07; 9694 speed_value &= 0x07;
9695 AscSetBank(iop_base, 1); 9695 AscSetBank(iop_base, 1);
@@ -9699,7 +9699,7 @@ static uchar __devinit AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value)
9699} 9699}
9700#endif /* CONFIG_ISA */ 9700#endif /* CONFIG_ISA */
9701 9701
9702static ushort __devinit AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc) 9702static ushort AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc)
9703{ 9703{
9704 int i; 9704 int i;
9705 PortAddr iop_base; 9705 PortAddr iop_base;
@@ -9786,7 +9786,7 @@ static ushort __devinit AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc)
9786 return warn_code; 9786 return warn_code;
9787} 9787}
9788 9788
9789static int __devinit AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg) 9789static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg)
9790{ 9790{
9791 int retry; 9791 int retry;
9792 9792
@@ -9801,12 +9801,12 @@ static int __devinit AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg)
9801 return 0; 9801 return 0;
9802} 9802}
9803 9803
9804static void __devinit AscWaitEEPRead(void) 9804static void AscWaitEEPRead(void)
9805{ 9805{
9806 mdelay(1); 9806 mdelay(1);
9807} 9807}
9808 9808
9809static ushort __devinit AscReadEEPWord(PortAddr iop_base, uchar addr) 9809static ushort AscReadEEPWord(PortAddr iop_base, uchar addr)
9810{ 9810{
9811 ushort read_wval; 9811 ushort read_wval;
9812 uchar cmd_reg; 9812 uchar cmd_reg;
@@ -9821,8 +9821,8 @@ static ushort __devinit AscReadEEPWord(PortAddr iop_base, uchar addr)
9821 return read_wval; 9821 return read_wval;
9822} 9822}
9823 9823
9824static ushort __devinit 9824static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
9825AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type) 9825 ushort bus_type)
9826{ 9826{
9827 ushort wval; 9827 ushort wval;
9828 ushort sum; 9828 ushort sum;
@@ -9868,7 +9868,7 @@ AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
9868 return sum; 9868 return sum;
9869} 9869}
9870 9870
9871static int __devinit AscTestExternalLram(ASC_DVC_VAR *asc_dvc) 9871static int AscTestExternalLram(ASC_DVC_VAR *asc_dvc)
9872{ 9872{
9873 PortAddr iop_base; 9873 PortAddr iop_base;
9874 ushort q_addr; 9874 ushort q_addr;
@@ -9890,12 +9890,12 @@ static int __devinit AscTestExternalLram(ASC_DVC_VAR *asc_dvc)
9890 return (sta); 9890 return (sta);
9891} 9891}
9892 9892
9893static void __devinit AscWaitEEPWrite(void) 9893static void AscWaitEEPWrite(void)
9894{ 9894{
9895 mdelay(20); 9895 mdelay(20);
9896} 9896}
9897 9897
9898static int __devinit AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg) 9898static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg)
9899{ 9899{
9900 ushort read_back; 9900 ushort read_back;
9901 int retry; 9901 int retry;
@@ -9914,8 +9914,7 @@ static int __devinit AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg)
9914 } 9914 }
9915} 9915}
9916 9916
9917static ushort __devinit 9917static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val)
9918AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val)
9919{ 9918{
9920 ushort read_wval; 9919 ushort read_wval;
9921 9920
@@ -9935,8 +9934,8 @@ AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val)
9935 return (read_wval); 9934 return (read_wval);
9936} 9935}
9937 9936
9938static int __devinit 9937static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
9939AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type) 9938 ushort bus_type)
9940{ 9939{
9941 int n_error; 9940 int n_error;
9942 ushort *wbuf; 9941 ushort *wbuf;
@@ -10031,8 +10030,8 @@ AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
10031 return n_error; 10030 return n_error;
10032} 10031}
10033 10032
10034static int __devinit 10033static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
10035AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type) 10034 ushort bus_type)
10036{ 10035{
10037 int retry; 10036 int retry;
10038 int n_error; 10037 int n_error;
@@ -10050,7 +10049,7 @@ AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
10050 return n_error; 10049 return n_error;
10051} 10050}
10052 10051
10053static ushort __devinit AscInitFromEEP(ASC_DVC_VAR *asc_dvc) 10052static ushort AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
10054{ 10053{
10055 ASCEEP_CONFIG eep_config_buf; 10054 ASCEEP_CONFIG eep_config_buf;
10056 ASCEEP_CONFIG *eep_config; 10055 ASCEEP_CONFIG *eep_config;
@@ -10215,7 +10214,7 @@ static ushort __devinit AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
10215 return (warn_code); 10214 return (warn_code);
10216} 10215}
10217 10216
10218static int __devinit AscInitGetConfig(struct Scsi_Host *shost) 10217static int AscInitGetConfig(struct Scsi_Host *shost)
10219{ 10218{
10220 struct asc_board *board = shost_priv(shost); 10219 struct asc_board *board = shost_priv(shost);
10221 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var; 10220 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
@@ -10269,7 +10268,7 @@ static int __devinit AscInitGetConfig(struct Scsi_Host *shost)
10269 return asc_dvc->err_code; 10268 return asc_dvc->err_code;
10270} 10269}
10271 10270
10272static int __devinit AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *shost) 10271static int AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
10273{ 10272{
10274 struct asc_board *board = shost_priv(shost); 10273 struct asc_board *board = shost_priv(shost);
10275 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var; 10274 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
@@ -10383,7 +10382,7 @@ static int __devinit AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *sh
10383 * on big-endian platforms so char fields read as words are actually being 10382 * on big-endian platforms so char fields read as words are actually being
10384 * unswapped on big-endian platforms. 10383 * unswapped on big-endian platforms.
10385 */ 10384 */
10386static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config __devinitdata = { 10385static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config = {
10387 ADV_EEPROM_BIOS_ENABLE, /* cfg_lsw */ 10386 ADV_EEPROM_BIOS_ENABLE, /* cfg_lsw */
10388 0x0000, /* cfg_msw */ 10387 0x0000, /* cfg_msw */
10389 0xFFFF, /* disc_enable */ 10388 0xFFFF, /* disc_enable */
@@ -10421,7 +10420,7 @@ static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config __devinitdata = {
10421 0 /* num_of_err */ 10420 0 /* num_of_err */
10422}; 10421};
10423 10422
10424static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar __devinitdata = { 10423static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar = {
10425 0, /* cfg_lsw */ 10424 0, /* cfg_lsw */
10426 0, /* cfg_msw */ 10425 0, /* cfg_msw */
10427 0, /* -disc_enable */ 10426 0, /* -disc_enable */
@@ -10459,7 +10458,7 @@ static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar __devinitdata = {
10459 0 /* num_of_err */ 10458 0 /* num_of_err */
10460}; 10459};
10461 10460
10462static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config __devinitdata = { 10461static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config = {
10463 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 10462 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */
10464 0x0000, /* 01 cfg_msw */ 10463 0x0000, /* 01 cfg_msw */
10465 0xFFFF, /* 02 disc_enable */ 10464 0xFFFF, /* 02 disc_enable */
@@ -10524,7 +10523,7 @@ static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config __devinitdata = {
10524 0 /* 63 reserved */ 10523 0 /* 63 reserved */
10525}; 10524};
10526 10525
10527static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar __devinitdata = { 10526static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar = {
10528 0, /* 00 cfg_lsw */ 10527 0, /* 00 cfg_lsw */
10529 0, /* 01 cfg_msw */ 10528 0, /* 01 cfg_msw */
10530 0, /* 02 disc_enable */ 10529 0, /* 02 disc_enable */
@@ -10589,7 +10588,7 @@ static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar __devinitdata =
10589 0 /* 63 reserved */ 10588 0 /* 63 reserved */
10590}; 10589};
10591 10590
10592static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config __devinitdata = { 10591static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config = {
10593 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 10592 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */
10594 0x0000, /* 01 cfg_msw */ 10593 0x0000, /* 01 cfg_msw */
10595 0xFFFF, /* 02 disc_enable */ 10594 0xFFFF, /* 02 disc_enable */
@@ -10654,7 +10653,7 @@ static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config __devinitdata = {
10654 0 /* 63 reserved */ 10653 0 /* 63 reserved */
10655}; 10654};
10656 10655
10657static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar __devinitdata = { 10656static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar = {
10658 0, /* 00 cfg_lsw */ 10657 0, /* 00 cfg_lsw */
10659 0, /* 01 cfg_msw */ 10658 0, /* 01 cfg_msw */
10660 0, /* 02 disc_enable */ 10659 0, /* 02 disc_enable */
@@ -10723,7 +10722,7 @@ static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar __devinitdata =
10723/* 10722/*
10724 * Wait for EEPROM command to complete 10723 * Wait for EEPROM command to complete
10725 */ 10724 */
10726static void __devinit AdvWaitEEPCmd(AdvPortAddr iop_base) 10725static void AdvWaitEEPCmd(AdvPortAddr iop_base)
10727{ 10726{
10728 int eep_delay_ms; 10727 int eep_delay_ms;
10729 10728
@@ -10742,7 +10741,7 @@ static void __devinit AdvWaitEEPCmd(AdvPortAddr iop_base)
10742/* 10741/*
10743 * Read the EEPROM from specified location 10742 * Read the EEPROM from specified location
10744 */ 10743 */
10745static ushort __devinit AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr) 10744static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
10746{ 10745{
10747 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, 10746 AdvWriteWordRegister(iop_base, IOPW_EE_CMD,
10748 ASC_EEP_CMD_READ | eep_word_addr); 10747 ASC_EEP_CMD_READ | eep_word_addr);
@@ -10753,8 +10752,8 @@ static ushort __devinit AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
10753/* 10752/*
10754 * Write the EEPROM from 'cfg_buf'. 10753 * Write the EEPROM from 'cfg_buf'.
10755 */ 10754 */
10756static void __devinit 10755static void AdvSet3550EEPConfig(AdvPortAddr iop_base,
10757AdvSet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf) 10756 ADVEEP_3550_CONFIG *cfg_buf)
10758{ 10757{
10759 ushort *wbuf; 10758 ushort *wbuf;
10760 ushort addr, chksum; 10759 ushort addr, chksum;
@@ -10820,8 +10819,8 @@ AdvSet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
10820/* 10819/*
10821 * Write the EEPROM from 'cfg_buf'. 10820 * Write the EEPROM from 'cfg_buf'.
10822 */ 10821 */
10823static void __devinit 10822static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base,
10824AdvSet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf) 10823 ADVEEP_38C0800_CONFIG *cfg_buf)
10825{ 10824{
10826 ushort *wbuf; 10825 ushort *wbuf;
10827 ushort *charfields; 10826 ushort *charfields;
@@ -10887,8 +10886,8 @@ AdvSet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf)
10887/* 10886/*
10888 * Write the EEPROM from 'cfg_buf'. 10887 * Write the EEPROM from 'cfg_buf'.
10889 */ 10888 */
10890static void __devinit 10889static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base,
10891AdvSet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf) 10890 ADVEEP_38C1600_CONFIG *cfg_buf)
10892{ 10891{
10893 ushort *wbuf; 10892 ushort *wbuf;
10894 ushort *charfields; 10893 ushort *charfields;
@@ -10956,8 +10955,8 @@ AdvSet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf)
10956 * 10955 *
10957 * Return a checksum based on the EEPROM configuration read. 10956 * Return a checksum based on the EEPROM configuration read.
10958 */ 10957 */
10959static ushort __devinit 10958static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base,
10960AdvGet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf) 10959 ADVEEP_3550_CONFIG *cfg_buf)
10961{ 10960{
10962 ushort wval, chksum; 10961 ushort wval, chksum;
10963 ushort *wbuf; 10962 ushort *wbuf;
@@ -10999,8 +10998,8 @@ AdvGet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
10999 * 10998 *
11000 * Return a checksum based on the EEPROM configuration read. 10999 * Return a checksum based on the EEPROM configuration read.
11001 */ 11000 */
11002static ushort __devinit 11001static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base,
11003AdvGet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf) 11002 ADVEEP_38C0800_CONFIG *cfg_buf)
11004{ 11003{
11005 ushort wval, chksum; 11004 ushort wval, chksum;
11006 ushort *wbuf; 11005 ushort *wbuf;
@@ -11042,8 +11041,8 @@ AdvGet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf)
11042 * 11041 *
11043 * Return a checksum based on the EEPROM configuration read. 11042 * Return a checksum based on the EEPROM configuration read.
11044 */ 11043 */
11045static ushort __devinit 11044static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base,
11046AdvGet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf) 11045 ADVEEP_38C1600_CONFIG *cfg_buf)
11047{ 11046{
11048 ushort wval, chksum; 11047 ushort wval, chksum;
11049 ushort *wbuf; 11048 ushort *wbuf;
@@ -11092,7 +11091,7 @@ AdvGet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf)
11092 * 11091 *
11093 * Note: Chip is stopped on entry. 11092 * Note: Chip is stopped on entry.
11094 */ 11093 */
11095static int __devinit AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc) 11094static int AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
11096{ 11095{
11097 AdvPortAddr iop_base; 11096 AdvPortAddr iop_base;
11098 ushort warn_code; 11097 ushort warn_code;
@@ -11242,7 +11241,7 @@ static int __devinit AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
11242 * 11241 *
11243 * Note: Chip is stopped on entry. 11242 * Note: Chip is stopped on entry.
11244 */ 11243 */
11245static int __devinit AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc) 11244static int AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
11246{ 11245{
11247 AdvPortAddr iop_base; 11246 AdvPortAddr iop_base;
11248 ushort warn_code; 11247 ushort warn_code;
@@ -11441,7 +11440,7 @@ static int __devinit AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
11441 * 11440 *
11442 * Note: Chip is stopped on entry. 11441 * Note: Chip is stopped on entry.
11443 */ 11442 */
11444static int __devinit AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc) 11443static int AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
11445{ 11444{
11446 AdvPortAddr iop_base; 11445 AdvPortAddr iop_base;
11447 ushort warn_code; 11446 ushort warn_code;
@@ -11661,8 +11660,7 @@ static int __devinit AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
11661 * For a non-fatal error return a warning code. If there are no warnings 11660 * For a non-fatal error return a warning code. If there are no warnings
11662 * then 0 is returned. 11661 * then 0 is returned.
11663 */ 11662 */
11664static int __devinit 11663static int AdvInitGetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
11665AdvInitGetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
11666{ 11664{
11667 struct asc_board *board = shost_priv(shost); 11665 struct asc_board *board = shost_priv(shost);
11668 ADV_DVC_VAR *asc_dvc = &board->dvc_var.adv_dvc_var; 11666 ADV_DVC_VAR *asc_dvc = &board->dvc_var.adv_dvc_var;
@@ -11769,7 +11767,7 @@ static struct scsi_host_template advansys_template = {
11769 .use_clustering = ENABLE_CLUSTERING, 11767 .use_clustering = ENABLE_CLUSTERING,
11770}; 11768};
11771 11769
11772static int __devinit advansys_wide_init_chip(struct Scsi_Host *shost) 11770static int advansys_wide_init_chip(struct Scsi_Host *shost)
11773{ 11771{
11774 struct asc_board *board = shost_priv(shost); 11772 struct asc_board *board = shost_priv(shost);
11775 struct adv_dvc_var *adv_dvc = &board->dvc_var.adv_dvc_var; 11773 struct adv_dvc_var *adv_dvc = &board->dvc_var.adv_dvc_var;
@@ -11882,8 +11880,8 @@ static void advansys_wide_free_mem(struct asc_board *board)
11882 } 11880 }
11883} 11881}
11884 11882
11885static int __devinit advansys_board_found(struct Scsi_Host *shost, 11883static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop,
11886 unsigned int iop, int bus_type) 11884 int bus_type)
11887{ 11885{
11888 struct pci_dev *pdev; 11886 struct pci_dev *pdev;
11889 struct asc_board *boardp = shost_priv(shost); 11887 struct asc_board *boardp = shost_priv(shost);
@@ -12428,7 +12426,7 @@ static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
12428 * 10: 12 12426 * 10: 12
12429 * 11: 15 12427 * 11: 15
12430 */ 12428 */
12431static unsigned int __devinit advansys_isa_irq_no(PortAddr iop_base) 12429static unsigned int advansys_isa_irq_no(PortAddr iop_base)
12432{ 12430{
12433 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); 12431 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base);
12434 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x03) + 10; 12432 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x03) + 10;
@@ -12437,7 +12435,7 @@ static unsigned int __devinit advansys_isa_irq_no(PortAddr iop_base)
12437 return chip_irq; 12435 return chip_irq;
12438} 12436}
12439 12437
12440static int __devinit advansys_isa_probe(struct device *dev, unsigned int id) 12438static int advansys_isa_probe(struct device *dev, unsigned int id)
12441{ 12439{
12442 int err = -ENODEV; 12440 int err = -ENODEV;
12443 PortAddr iop_base = _asc_def_iop_base[id]; 12441 PortAddr iop_base = _asc_def_iop_base[id];
@@ -12477,7 +12475,7 @@ static int __devinit advansys_isa_probe(struct device *dev, unsigned int id)
12477 return err; 12475 return err;
12478} 12476}
12479 12477
12480static int __devexit advansys_isa_remove(struct device *dev, unsigned int id) 12478static int advansys_isa_remove(struct device *dev, unsigned int id)
12481{ 12479{
12482 int ioport = _asc_def_iop_base[id]; 12480 int ioport = _asc_def_iop_base[id];
12483 advansys_release(dev_get_drvdata(dev)); 12481 advansys_release(dev_get_drvdata(dev));
@@ -12487,7 +12485,7 @@ static int __devexit advansys_isa_remove(struct device *dev, unsigned int id)
12487 12485
12488static struct isa_driver advansys_isa_driver = { 12486static struct isa_driver advansys_isa_driver = {
12489 .probe = advansys_isa_probe, 12487 .probe = advansys_isa_probe,
12490 .remove = __devexit_p(advansys_isa_remove), 12488 .remove = advansys_isa_remove,
12491 .driver = { 12489 .driver = {
12492 .owner = THIS_MODULE, 12490 .owner = THIS_MODULE,
12493 .name = DRV_NAME, 12491 .name = DRV_NAME,
@@ -12505,7 +12503,7 @@ static struct isa_driver advansys_isa_driver = {
12505 * 110: 15 12503 * 110: 15
12506 * 111: invalid 12504 * 111: invalid
12507 */ 12505 */
12508static unsigned int __devinit advansys_vlb_irq_no(PortAddr iop_base) 12506static unsigned int advansys_vlb_irq_no(PortAddr iop_base)
12509{ 12507{
12510 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); 12508 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base);
12511 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x07) + 9; 12509 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x07) + 9;
@@ -12514,7 +12512,7 @@ static unsigned int __devinit advansys_vlb_irq_no(PortAddr iop_base)
12514 return chip_irq; 12512 return chip_irq;
12515} 12513}
12516 12514
12517static int __devinit advansys_vlb_probe(struct device *dev, unsigned int id) 12515static int advansys_vlb_probe(struct device *dev, unsigned int id)
12518{ 12516{
12519 int err = -ENODEV; 12517 int err = -ENODEV;
12520 PortAddr iop_base = _asc_def_iop_base[id]; 12518 PortAddr iop_base = _asc_def_iop_base[id];
@@ -12561,14 +12559,14 @@ static int __devinit advansys_vlb_probe(struct device *dev, unsigned int id)
12561 12559
12562static struct isa_driver advansys_vlb_driver = { 12560static struct isa_driver advansys_vlb_driver = {
12563 .probe = advansys_vlb_probe, 12561 .probe = advansys_vlb_probe,
12564 .remove = __devexit_p(advansys_isa_remove), 12562 .remove = advansys_isa_remove,
12565 .driver = { 12563 .driver = {
12566 .owner = THIS_MODULE, 12564 .owner = THIS_MODULE,
12567 .name = "advansys_vlb", 12565 .name = "advansys_vlb",
12568 }, 12566 },
12569}; 12567};
12570 12568
12571static struct eisa_device_id advansys_eisa_table[] __devinitdata = { 12569static struct eisa_device_id advansys_eisa_table[] = {
12572 { "ABP7401" }, 12570 { "ABP7401" },
12573 { "ABP7501" }, 12571 { "ABP7501" },
12574 { "" } 12572 { "" }
@@ -12595,7 +12593,7 @@ struct eisa_scsi_data {
12595 * 110: invalid 12593 * 110: invalid
12596 * 111: invalid 12594 * 111: invalid
12597 */ 12595 */
12598static unsigned int __devinit advansys_eisa_irq_no(struct eisa_device *edev) 12596static unsigned int advansys_eisa_irq_no(struct eisa_device *edev)
12599{ 12597{
12600 unsigned short cfg_lsw = inw(edev->base_addr + 0xc86); 12598 unsigned short cfg_lsw = inw(edev->base_addr + 0xc86);
12601 unsigned int chip_irq = ((cfg_lsw >> 8) & 0x07) + 10; 12599 unsigned int chip_irq = ((cfg_lsw >> 8) & 0x07) + 10;
@@ -12604,7 +12602,7 @@ static unsigned int __devinit advansys_eisa_irq_no(struct eisa_device *edev)
12604 return chip_irq; 12602 return chip_irq;
12605} 12603}
12606 12604
12607static int __devinit advansys_eisa_probe(struct device *dev) 12605static int advansys_eisa_probe(struct device *dev)
12608{ 12606{
12609 int i, ioport, irq = 0; 12607 int i, ioport, irq = 0;
12610 int err; 12608 int err;
@@ -12677,7 +12675,7 @@ static int __devinit advansys_eisa_probe(struct device *dev)
12677 return err; 12675 return err;
12678} 12676}
12679 12677
12680static __devexit int advansys_eisa_remove(struct device *dev) 12678static int advansys_eisa_remove(struct device *dev)
12681{ 12679{
12682 int i; 12680 int i;
12683 struct eisa_scsi_data *data = dev_get_drvdata(dev); 12681 struct eisa_scsi_data *data = dev_get_drvdata(dev);
@@ -12701,12 +12699,12 @@ static struct eisa_driver advansys_eisa_driver = {
12701 .driver = { 12699 .driver = {
12702 .name = DRV_NAME, 12700 .name = DRV_NAME,
12703 .probe = advansys_eisa_probe, 12701 .probe = advansys_eisa_probe,
12704 .remove = __devexit_p(advansys_eisa_remove), 12702 .remove = advansys_eisa_remove,
12705 } 12703 }
12706}; 12704};
12707 12705
12708/* PCI Devices supported by this driver */ 12706/* PCI Devices supported by this driver */
12709static struct pci_device_id advansys_pci_tbl[] __devinitdata = { 12707static struct pci_device_id advansys_pci_tbl[] = {
12710 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, 12708 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A,
12711 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 12709 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
12712 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940, 12710 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940,
@@ -12724,7 +12722,7 @@ static struct pci_device_id advansys_pci_tbl[] __devinitdata = {
12724 12722
12725MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); 12723MODULE_DEVICE_TABLE(pci, advansys_pci_tbl);
12726 12724
12727static void __devinit advansys_set_latency(struct pci_dev *pdev) 12725static void advansys_set_latency(struct pci_dev *pdev)
12728{ 12726{
12729 if ((pdev->device == PCI_DEVICE_ID_ASP_1200A) || 12727 if ((pdev->device == PCI_DEVICE_ID_ASP_1200A) ||
12730 (pdev->device == PCI_DEVICE_ID_ASP_ABP940)) { 12728 (pdev->device == PCI_DEVICE_ID_ASP_ABP940)) {
@@ -12737,8 +12735,8 @@ static void __devinit advansys_set_latency(struct pci_dev *pdev)
12737 } 12735 }
12738} 12736}
12739 12737
12740static int __devinit 12738static int advansys_pci_probe(struct pci_dev *pdev,
12741advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 12739 const struct pci_device_id *ent)
12742{ 12740{
12743 int err, ioport; 12741 int err, ioport;
12744 struct Scsi_Host *shost; 12742 struct Scsi_Host *shost;
@@ -12791,7 +12789,7 @@ advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
12791 return err; 12789 return err;
12792} 12790}
12793 12791
12794static void __devexit advansys_pci_remove(struct pci_dev *pdev) 12792static void advansys_pci_remove(struct pci_dev *pdev)
12795{ 12793{
12796 advansys_release(pci_get_drvdata(pdev)); 12794 advansys_release(pci_get_drvdata(pdev));
12797 pci_release_regions(pdev); 12795 pci_release_regions(pdev);
@@ -12802,7 +12800,7 @@ static struct pci_driver advansys_pci_driver = {
12802 .name = DRV_NAME, 12800 .name = DRV_NAME,
12803 .id_table = advansys_pci_tbl, 12801 .id_table = advansys_pci_tbl,
12804 .probe = advansys_pci_probe, 12802 .probe = advansys_pci_probe,
12805 .remove = __devexit_p(advansys_pci_remove), 12803 .remove = advansys_pci_remove,
12806}; 12804};
12807 12805
12808static int __init advansys_init(void) 12806static int __init advansys_init(void)
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index dd4547bf688..a284be17699 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -420,7 +420,7 @@ MODULE_PARM_DESC(aha152x1, "parameters for second controller");
420#endif /* MODULE */ 420#endif /* MODULE */
421 421
422#ifdef __ISAPNP__ 422#ifdef __ISAPNP__
423static struct isapnp_device_id id_table[] __devinitdata = { 423static struct isapnp_device_id id_table[] = {
424 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1502), 0 }, 424 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1502), 0 },
425 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1505), 0 }, 425 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1505), 0 },
426 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1510), 0 }, 426 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1510), 0 },
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index a3e6ed35391..df775e6ba57 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -646,7 +646,7 @@ static int aha1740_probe (struct device *dev)
646 return -ENODEV; 646 return -ENODEV;
647} 647}
648 648
649static __devexit int aha1740_remove (struct device *dev) 649static int aha1740_remove (struct device *dev)
650{ 650{
651 struct Scsi_Host *shpnt = dev_get_drvdata(dev); 651 struct Scsi_Host *shpnt = dev_get_drvdata(dev);
652 struct aha1740_hostdata *host = HOSTDATA (shpnt); 652 struct aha1740_hostdata *host = HOSTDATA (shpnt);
@@ -677,7 +677,7 @@ static struct eisa_driver aha1740_driver = {
677 .driver = { 677 .driver = {
678 .name = "aha1740", 678 .name = "aha1740",
679 .probe = aha1740_probe, 679 .probe = aha1740_probe,
680 .remove = __devexit_p (aha1740_remove), 680 .remove = aha1740_remove,
681 }, 681 },
682}; 682};
683 683
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 1c4120c3db4..c56741fc4b9 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -85,7 +85,7 @@ static struct scsi_host_template aic94xx_sht = {
85 .ioctl = sas_ioctl, 85 .ioctl = sas_ioctl,
86}; 86};
87 87
88static int __devinit asd_map_memio(struct asd_ha_struct *asd_ha) 88static int asd_map_memio(struct asd_ha_struct *asd_ha)
89{ 89{
90 int err, i; 90 int err, i;
91 struct asd_ha_addrspace *io_handle; 91 struct asd_ha_addrspace *io_handle;
@@ -146,7 +146,7 @@ static void asd_unmap_memio(struct asd_ha_struct *asd_ha)
146 pci_release_region(asd_ha->pcidev, 0); 146 pci_release_region(asd_ha->pcidev, 0);
147} 147}
148 148
149static int __devinit asd_map_ioport(struct asd_ha_struct *asd_ha) 149static int asd_map_ioport(struct asd_ha_struct *asd_ha)
150{ 150{
151 int i = PCI_IOBAR_OFFSET, err; 151 int i = PCI_IOBAR_OFFSET, err;
152 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; 152 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0];
@@ -175,7 +175,7 @@ static void asd_unmap_ioport(struct asd_ha_struct *asd_ha)
175 pci_release_region(asd_ha->pcidev, PCI_IOBAR_OFFSET); 175 pci_release_region(asd_ha->pcidev, PCI_IOBAR_OFFSET);
176} 176}
177 177
178static int __devinit asd_map_ha(struct asd_ha_struct *asd_ha) 178static int asd_map_ha(struct asd_ha_struct *asd_ha)
179{ 179{
180 int err; 180 int err;
181 u16 cmd_reg; 181 u16 cmd_reg;
@@ -221,7 +221,7 @@ static const char *asd_dev_rev[30] = {
221 [8] = "B0", 221 [8] = "B0",
222}; 222};
223 223
224static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha) 224static int asd_common_setup(struct asd_ha_struct *asd_ha)
225{ 225{
226 int err, i; 226 int err, i;
227 227
@@ -257,7 +257,7 @@ Err:
257 return err; 257 return err;
258} 258}
259 259
260static int __devinit asd_aic9410_setup(struct asd_ha_struct *asd_ha) 260static int asd_aic9410_setup(struct asd_ha_struct *asd_ha)
261{ 261{
262 int err = asd_common_setup(asd_ha); 262 int err = asd_common_setup(asd_ha);
263 263
@@ -272,7 +272,7 @@ static int __devinit asd_aic9410_setup(struct asd_ha_struct *asd_ha)
272 return 0; 272 return 0;
273} 273}
274 274
275static int __devinit asd_aic9405_setup(struct asd_ha_struct *asd_ha) 275static int asd_aic9405_setup(struct asd_ha_struct *asd_ha)
276{ 276{
277 int err = asd_common_setup(asd_ha); 277 int err = asd_common_setup(asd_ha);
278 278
@@ -531,7 +531,7 @@ static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
531static const struct asd_pcidev_struct { 531static const struct asd_pcidev_struct {
532 const char * name; 532 const char * name;
533 int (*setup)(struct asd_ha_struct *asd_ha); 533 int (*setup)(struct asd_ha_struct *asd_ha);
534} asd_pcidev_data[] __devinitconst = { 534} asd_pcidev_data[] = {
535 /* Id 0 is used for dynamic ids. */ 535 /* Id 0 is used for dynamic ids. */
536 { .name = "Adaptec AIC-94xx SAS/SATA Host Adapter", 536 { .name = "Adaptec AIC-94xx SAS/SATA Host Adapter",
537 .setup = asd_aic9410_setup 537 .setup = asd_aic9410_setup
@@ -731,8 +731,7 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
731 return err; 731 return err;
732} 732}
733 733
734static int __devinit asd_pci_probe(struct pci_dev *dev, 734static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
735 const struct pci_device_id *id)
736{ 735{
737 const struct asd_pcidev_struct *asd_dev; 736 const struct asd_pcidev_struct *asd_dev;
738 unsigned asd_id = (unsigned) id->driver_data; 737 unsigned asd_id = (unsigned) id->driver_data;
@@ -924,7 +923,7 @@ static void asd_turn_off_leds(struct asd_ha_struct *asd_ha)
924 } 923 }
925} 924}
926 925
927static void __devexit asd_pci_remove(struct pci_dev *dev) 926static void asd_pci_remove(struct pci_dev *dev)
928{ 927{
929 struct asd_ha_struct *asd_ha = pci_get_drvdata(dev); 928 struct asd_ha_struct *asd_ha = pci_get_drvdata(dev);
930 929
@@ -1012,7 +1011,7 @@ static struct sas_domain_function_template aic94xx_transport_functions = {
1012 .lldd_ata_set_dmamode = asd_set_dmamode, 1011 .lldd_ata_set_dmamode = asd_set_dmamode,
1013}; 1012};
1014 1013
1015static const struct pci_device_id aic94xx_pci_table[] __devinitconst = { 1014static const struct pci_device_id aic94xx_pci_table[] = {
1016 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1}, 1015 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1},
1017 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1}, 1016 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1},
1018 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1}, 1017 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1},
@@ -1031,7 +1030,7 @@ static struct pci_driver aic94xx_pci_driver = {
1031 .name = ASD_DRIVER_NAME, 1030 .name = ASD_DRIVER_NAME,
1032 .id_table = aic94xx_pci_table, 1031 .id_table = aic94xx_pci_table,
1033 .probe = asd_pci_probe, 1032 .probe = asd_pci_probe,
1034 .remove = __devexit_p(asd_pci_remove), 1033 .remove = asd_pci_remove,
1035}; 1034};
1036 1035
1037static int __init aic94xx_init(void) 1036static int __init aic94xx_init(void)
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index b330438ac66..3e1172adb37 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -2965,8 +2965,7 @@ static struct scsi_host_template acornscsi_template = {
2965 .proc_name = "acornscsi", 2965 .proc_name = "acornscsi",
2966}; 2966};
2967 2967
2968static int __devinit 2968static int acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
2969acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
2970{ 2969{
2971 struct Scsi_Host *host; 2970 struct Scsi_Host *host;
2972 AS_Host *ashost; 2971 AS_Host *ashost;
@@ -3032,7 +3031,7 @@ acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
3032 return ret; 3031 return ret;
3033} 3032}
3034 3033
3035static void __devexit acornscsi_remove(struct expansion_card *ec) 3034static void acornscsi_remove(struct expansion_card *ec)
3036{ 3035{
3037 struct Scsi_Host *host = ecard_get_drvdata(ec); 3036 struct Scsi_Host *host = ecard_get_drvdata(ec);
3038 AS_Host *ashost = (AS_Host *)host->hostdata; 3037 AS_Host *ashost = (AS_Host *)host->hostdata;
@@ -3063,7 +3062,7 @@ static const struct ecard_id acornscsi_cids[] = {
3063 3062
3064static struct ecard_driver acornscsi_driver = { 3063static struct ecard_driver acornscsi_driver = {
3065 .probe = acornscsi_probe, 3064 .probe = acornscsi_probe,
3066 .remove = __devexit_p(acornscsi_remove), 3065 .remove = acornscsi_remove,
3067 .id_table = acornscsi_cids, 3066 .id_table = acornscsi_cids,
3068 .drv = { 3067 .drv = {
3069 .name = "acornscsi", 3068 .name = "acornscsi",
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 2a28b4ad197..9274510294a 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -276,8 +276,7 @@ static struct scsi_host_template arxescsi_template = {
276 .proc_name = "arxescsi", 276 .proc_name = "arxescsi",
277}; 277};
278 278
279static int __devinit 279static int arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
280arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
281{ 280{
282 struct Scsi_Host *host; 281 struct Scsi_Host *host;
283 struct arxescsi_info *info; 282 struct arxescsi_info *info;
@@ -340,7 +339,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
340 return ret; 339 return ret;
341} 340}
342 341
343static void __devexit arxescsi_remove(struct expansion_card *ec) 342static void arxescsi_remove(struct expansion_card *ec)
344{ 343{
345 struct Scsi_Host *host = ecard_get_drvdata(ec); 344 struct Scsi_Host *host = ecard_get_drvdata(ec);
346 345
@@ -359,7 +358,7 @@ static const struct ecard_id arxescsi_cids[] = {
359 358
360static struct ecard_driver arxescsi_driver = { 359static struct ecard_driver arxescsi_driver = {
361 .probe = arxescsi_probe, 360 .probe = arxescsi_probe,
362 .remove = __devexit_p(arxescsi_remove), 361 .remove = arxescsi_remove,
363 .id_table = arxescsi_cids, 362 .id_table = arxescsi_cids,
364 .drv = { 363 .drv = {
365 .name = "arxescsi", 364 .name = "arxescsi",
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index c3b99c93637..c93938b246d 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -225,8 +225,8 @@ static struct scsi_host_template cumanascsi_template = {
225 .proc_name = "CumanaSCSI-1", 225 .proc_name = "CumanaSCSI-1",
226}; 226};
227 227
228static int __devinit 228static int cumanascsi1_probe(struct expansion_card *ec,
229cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id) 229 const struct ecard_id *id)
230{ 230{
231 struct Scsi_Host *host; 231 struct Scsi_Host *host;
232 int ret; 232 int ret;
@@ -298,7 +298,7 @@ cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id)
298 return ret; 298 return ret;
299} 299}
300 300
301static void __devexit cumanascsi1_remove(struct expansion_card *ec) 301static void cumanascsi1_remove(struct expansion_card *ec)
302{ 302{
303 struct Scsi_Host *host = ecard_get_drvdata(ec); 303 struct Scsi_Host *host = ecard_get_drvdata(ec);
304 304
@@ -320,7 +320,7 @@ static const struct ecard_id cumanascsi1_cids[] = {
320 320
321static struct ecard_driver cumanascsi1_driver = { 321static struct ecard_driver cumanascsi1_driver = {
322 .probe = cumanascsi1_probe, 322 .probe = cumanascsi1_probe,
323 .remove = __devexit_p(cumanascsi1_remove), 323 .remove = cumanascsi1_remove,
324 .id_table = cumanascsi1_cids, 324 .id_table = cumanascsi1_cids,
325 .drv = { 325 .drv = {
326 .name = "cumanascsi1", 326 .name = "cumanascsi1",
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 547987b8638..e3bae93c3c2 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -397,8 +397,8 @@ static struct scsi_host_template cumanascsi2_template = {
397 .proc_name = "cumanascsi2", 397 .proc_name = "cumanascsi2",
398}; 398};
399 399
400static int __devinit 400static int cumanascsi2_probe(struct expansion_card *ec,
401cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) 401 const struct ecard_id *id)
402{ 402{
403 struct Scsi_Host *host; 403 struct Scsi_Host *host;
404 struct cumanascsi2_info *info; 404 struct cumanascsi2_info *info;
@@ -495,7 +495,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
495 return ret; 495 return ret;
496} 496}
497 497
498static void __devexit cumanascsi2_remove(struct expansion_card *ec) 498static void cumanascsi2_remove(struct expansion_card *ec)
499{ 499{
500 struct Scsi_Host *host = ecard_get_drvdata(ec); 500 struct Scsi_Host *host = ecard_get_drvdata(ec);
501 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 501 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
@@ -519,7 +519,7 @@ static const struct ecard_id cumanascsi2_cids[] = {
519 519
520static struct ecard_driver cumanascsi2_driver = { 520static struct ecard_driver cumanascsi2_driver = {
521 .probe = cumanascsi2_probe, 521 .probe = cumanascsi2_probe,
522 .remove = __devexit_p(cumanascsi2_remove), 522 .remove = cumanascsi2_remove,
523 .id_table = cumanascsi2_cids, 523 .id_table = cumanascsi2_cids,
524 .drv = { 524 .drv = {
525 .name = "cumanascsi2", 525 .name = "cumanascsi2",
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 968d08358d2..8e36908415e 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -515,8 +515,7 @@ static struct scsi_host_template eesox_template = {
515 .proc_name = "eesox", 515 .proc_name = "eesox",
516}; 516};
517 517
518static int __devinit 518static int eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
519eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
520{ 519{
521 struct Scsi_Host *host; 520 struct Scsi_Host *host;
522 struct eesoxscsi_info *info; 521 struct eesoxscsi_info *info;
@@ -617,7 +616,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
617 return ret; 616 return ret;
618} 617}
619 618
620static void __devexit eesoxscsi_remove(struct expansion_card *ec) 619static void eesoxscsi_remove(struct expansion_card *ec)
621{ 620{
622 struct Scsi_Host *host = ecard_get_drvdata(ec); 621 struct Scsi_Host *host = ecard_get_drvdata(ec);
623 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 622 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
@@ -643,7 +642,7 @@ static const struct ecard_id eesoxscsi_cids[] = {
643 642
644static struct ecard_driver eesoxscsi_driver = { 643static struct ecard_driver eesoxscsi_driver = {
645 .probe = eesoxscsi_probe, 644 .probe = eesoxscsi_probe,
646 .remove = __devexit_p(eesoxscsi_remove), 645 .remove = eesoxscsi_remove,
647 .id_table = eesoxscsi_cids, 646 .id_table = eesoxscsi_cids,
648 .drv = { 647 .drv = {
649 .name = "eesoxscsi", 648 .name = "eesoxscsi",
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index fc6a5aabf66..48facdc1800 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -129,8 +129,7 @@ static struct scsi_host_template oakscsi_template = {
129 .proc_name = "oakscsi", 129 .proc_name = "oakscsi",
130}; 130};
131 131
132static int __devinit 132static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
133oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
134{ 133{
135 struct Scsi_Host *host; 134 struct Scsi_Host *host;
136 int ret = -ENOMEM; 135 int ret = -ENOMEM;
@@ -182,7 +181,7 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
182 return ret; 181 return ret;
183} 182}
184 183
185static void __devexit oakscsi_remove(struct expansion_card *ec) 184static void oakscsi_remove(struct expansion_card *ec)
186{ 185{
187 struct Scsi_Host *host = ecard_get_drvdata(ec); 186 struct Scsi_Host *host = ecard_get_drvdata(ec);
188 187
@@ -202,7 +201,7 @@ static const struct ecard_id oakscsi_cids[] = {
202 201
203static struct ecard_driver oakscsi_driver = { 202static struct ecard_driver oakscsi_driver = {
204 .probe = oakscsi_probe, 203 .probe = oakscsi_probe,
205 .remove = __devexit_p(oakscsi_remove), 204 .remove = oakscsi_remove,
206 .id_table = oakscsi_cids, 205 .id_table = oakscsi_cids,
207 .drv = { 206 .drv = {
208 .name = "oakscsi", 207 .name = "oakscsi",
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 9274c0677b9..246600b9355 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -309,8 +309,8 @@ static struct scsi_host_template powertecscsi_template = {
309 .proc_name = "powertec", 309 .proc_name = "powertec",
310}; 310};
311 311
312static int __devinit 312static int powertecscsi_probe(struct expansion_card *ec,
313powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) 313 const struct ecard_id *id)
314{ 314{
315 struct Scsi_Host *host; 315 struct Scsi_Host *host;
316 struct powertec_info *info; 316 struct powertec_info *info;
@@ -409,7 +409,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
409 return ret; 409 return ret;
410} 410}
411 411
412static void __devexit powertecscsi_remove(struct expansion_card *ec) 412static void powertecscsi_remove(struct expansion_card *ec)
413{ 413{
414 struct Scsi_Host *host = ecard_get_drvdata(ec); 414 struct Scsi_Host *host = ecard_get_drvdata(ec);
415 struct powertec_info *info = (struct powertec_info *)host->hostdata; 415 struct powertec_info *info = (struct powertec_info *)host->hostdata;
@@ -435,7 +435,7 @@ static const struct ecard_id powertecscsi_cids[] = {
435 435
436static struct ecard_driver powertecscsi_driver = { 436static struct ecard_driver powertecscsi_driver = {
437 .probe = powertecscsi_probe, 437 .probe = powertecscsi_probe,
438 .remove = __devexit_p(powertecscsi_remove), 438 .remove = powertecscsi_remove,
439 .id_table = powertecscsi_cids, 439 .id_table = powertecscsi_cids,
440 .drv = { 440 .drv = {
441 .name = "powertecscsi", 441 .name = "powertecscsi",
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index a540162ac59..cfc73041f10 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -3210,7 +3210,7 @@ static struct pci_driver atp870u_driver = {
3210 .id_table = atp870u_id_table, 3210 .id_table = atp870u_id_table,
3211 .name = "atp870u", 3211 .name = "atp870u",
3212 .probe = atp870u_probe, 3212 .probe = atp870u_probe,
3213 .remove = __devexit_p(atp870u_remove), 3213 .remove = atp870u_remove,
3214}; 3214};
3215 3215
3216static int __init atp870u_init(void) 3216static int __init atp870u_init(void)
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 48d37dded8f..4e2733d2300 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4790,8 +4790,8 @@ beiscsi_hw_health_check(struct work_struct *work)
4790 msecs_to_jiffies(1000)); 4790 msecs_to_jiffies(1000));
4791} 4791}
4792 4792
4793static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, 4793static int beiscsi_dev_probe(struct pci_dev *pcidev,
4794 const struct pci_device_id *id) 4794 const struct pci_device_id *id)
4795{ 4795{
4796 struct beiscsi_hba *phba = NULL; 4796 struct beiscsi_hba *phba = NULL;
4797 struct hwi_controller *phwi_ctrlr; 4797 struct hwi_controller *phwi_ctrlr;
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 895b0e516e0..e6bf12675db 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1739,7 +1739,7 @@ static struct pci_driver bfad_pci_driver = {
1739 .name = BFAD_DRIVER_NAME, 1739 .name = BFAD_DRIVER_NAME,
1740 .id_table = bfad_id_table, 1740 .id_table = bfad_id_table,
1741 .probe = bfad_pci_probe, 1741 .probe = bfad_pci_probe,
1742 .remove = __devexit_p(bfad_pci_remove), 1742 .remove = bfad_pci_remove,
1743 .err_handler = &bfad_err_handler, 1743 .err_handler = &bfad_err_handler,
1744}; 1744};
1745 1745
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index e0558656c64..70ecd953a57 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -25,7 +25,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
25#define DRV_MODULE_RELDATE "Jun 04, 2012" 25#define DRV_MODULE_RELDATE "Jun 04, 2012"
26 26
27 27
28static char version[] __devinitdata = 28static char version[] =
29 "Broadcom NetXtreme II FCoE Driver " DRV_MODULE_NAME \ 29 "Broadcom NetXtreme II FCoE Driver " DRV_MODULE_NAME \
30 " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 30 " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
31 31
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index ee009e4ad09..50fef6963a8 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -21,7 +21,7 @@ static u32 adapter_count;
21#define DRV_MODULE_VERSION "2.7.2.2" 21#define DRV_MODULE_VERSION "2.7.2.2"
22#define DRV_MODULE_RELDATE "Apr 25, 2012" 22#define DRV_MODULE_RELDATE "Apr 25, 2012"
23 23
24static char version[] __devinitdata = 24static char version[] =
25 "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \ 25 "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \
26 " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 26 " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
27 27
diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c
index d40ea2f5be1..1e3f96adf9d 100644
--- a/drivers/scsi/bvme6000_scsi.c
+++ b/drivers/scsi/bvme6000_scsi.c
@@ -34,7 +34,7 @@ static struct scsi_host_template bvme6000_scsi_driver_template = {
34 34
35static struct platform_device *bvme6000_scsi_device; 35static struct platform_device *bvme6000_scsi_device;
36 36
37static __devinit int 37static int
38bvme6000_probe(struct platform_device *dev) 38bvme6000_probe(struct platform_device *dev)
39{ 39{
40 struct Scsi_Host *host; 40 struct Scsi_Host *host;
@@ -88,7 +88,7 @@ bvme6000_probe(struct platform_device *dev)
88 return -ENODEV; 88 return -ENODEV;
89} 89}
90 90
91static __devexit int 91static int
92bvme6000_device_remove(struct platform_device *dev) 92bvme6000_device_remove(struct platform_device *dev)
93{ 93{
94 struct Scsi_Host *host = platform_get_drvdata(dev); 94 struct Scsi_Host *host = platform_get_drvdata(dev);
@@ -108,7 +108,7 @@ static struct platform_driver bvme6000_scsi_driver = {
108 .owner = THIS_MODULE, 108 .owner = THIS_MODULE,
109 }, 109 },
110 .probe = bvme6000_probe, 110 .probe = bvme6000_probe,
111 .remove = __devexit_p(bvme6000_device_remove), 111 .remove = bvme6000_device_remove,
112}; 112};
113 113
114static int __init bvme6000_scsi_init(void) 114static int __init bvme6000_scsi_init(void)
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index fdd408ff80a..b42cbbd3d92 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -115,9 +115,8 @@ static const struct file_operations csio_mem_debugfs_fops = {
115 .llseek = default_llseek, 115 .llseek = default_llseek,
116}; 116};
117 117
118static void __devinit 118static void csio_add_debugfs_mem(struct csio_hw *hw, const char *name,
119csio_add_debugfs_mem(struct csio_hw *hw, const char *name, 119 unsigned int idx, unsigned int size_mb)
120 unsigned int idx, unsigned int size_mb)
121{ 120{
122 struct dentry *de; 121 struct dentry *de;
123 122
@@ -127,8 +126,7 @@ csio_add_debugfs_mem(struct csio_hw *hw, const char *name,
127 de->d_inode->i_size = size_mb << 20; 126 de->d_inode->i_size = size_mb << 20;
128} 127}
129 128
130static int __devinit 129static int csio_setup_debugfs(struct csio_hw *hw)
131csio_setup_debugfs(struct csio_hw *hw)
132{ 130{
133 int i; 131 int i;
134 132
@@ -531,8 +529,7 @@ csio_resource_free(struct csio_hw *hw)
531 * Allocates HW structure, DMA, memory resources, maps BARS to 529 * Allocates HW structure, DMA, memory resources, maps BARS to
532 * host memory and initializes HW module. 530 * host memory and initializes HW module.
533 */ 531 */
534static struct csio_hw * __devinit 532static struct csio_hw *csio_hw_alloc(struct pci_dev *pdev)
535csio_hw_alloc(struct pci_dev *pdev)
536{ 533{
537 struct csio_hw *hw; 534 struct csio_hw *hw;
538 535
@@ -956,8 +953,7 @@ csio_lnode_init_post(struct csio_lnode *ln)
956 * - Once hardware is ready, initiated scan of the host via 953 * - Once hardware is ready, initiated scan of the host via
957 * scsi_scan_host. 954 * scsi_scan_host.
958 */ 955 */
959static int __devinit 956static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
960csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
961{ 957{
962 int rv; 958 int rv;
963 int bars; 959 int bars;
@@ -1036,8 +1032,7 @@ err:
1036 * 1032 *
1037 * Used during hotplug operation. 1033 * Used during hotplug operation.
1038 */ 1034 */
1039static void __devexit 1035static void csio_remove_one(struct pci_dev *pdev)
1040csio_remove_one(struct pci_dev *pdev)
1041{ 1036{
1042 struct csio_hw *hw = pci_get_drvdata(pdev); 1037 struct csio_hw *hw = pci_get_drvdata(pdev);
1043 int bars = pci_select_bars(pdev, IORESOURCE_MEM); 1038 int bars = pci_select_bars(pdev, IORESOURCE_MEM);
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 13aeca3d51f..865c64fa923 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -489,7 +489,7 @@ struct ParameterData {
489 int def; /* default value */ 489 int def; /* default value */
490 int safe; /* safe value */ 490 int safe; /* safe value */
491}; 491};
492static struct ParameterData __devinitdata cfg_data[] = { 492static struct ParameterData cfg_data[] = {
493 { /* adapter id */ 493 { /* adapter id */
494 CFG_PARAM_UNSET, 494 CFG_PARAM_UNSET,
495 0, 495 0,
@@ -574,7 +574,7 @@ MODULE_PARM_DESC(reset_delay, "Reset delay in seconds. Default 1 (0-180)");
574 * set_safe_settings - if the use_safe_settings option is set then 574 * set_safe_settings - if the use_safe_settings option is set then
575 * set all values to the safe and slow values. 575 * set all values to the safe and slow values.
576 **/ 576 **/
577static void __devinit set_safe_settings(void) 577static void set_safe_settings(void)
578{ 578{
579 if (use_safe_settings) 579 if (use_safe_settings)
580 { 580 {
@@ -593,7 +593,7 @@ static void __devinit set_safe_settings(void)
593 * fix_settings - reset any boot parameters which are out of range 593 * fix_settings - reset any boot parameters which are out of range
594 * back to the default values. 594 * back to the default values.
595 **/ 595 **/
596static void __devinit fix_settings(void) 596static void fix_settings(void)
597{ 597{
598 int i; 598 int i;
599 599
@@ -620,7 +620,7 @@ static void __devinit fix_settings(void)
620 * Mapping from the eeprom delay index value (index into this array) 620 * Mapping from the eeprom delay index value (index into this array)
621 * to the number of actual seconds that the delay should be for. 621 * to the number of actual seconds that the delay should be for.
622 */ 622 */
623static char __devinitdata eeprom_index_to_delay_map[] = 623static char eeprom_index_to_delay_map[] =
624 { 1, 3, 5, 10, 16, 30, 60, 120 }; 624 { 1, 3, 5, 10, 16, 30, 60, 120 };
625 625
626 626
@@ -630,7 +630,7 @@ static char __devinitdata eeprom_index_to_delay_map[] =
630 * 630 *
631 * @eeprom: The eeprom structure in which we find the delay index to map. 631 * @eeprom: The eeprom structure in which we find the delay index to map.
632 **/ 632 **/
633static void __devinit eeprom_index_to_delay(struct NvRamType *eeprom) 633static void eeprom_index_to_delay(struct NvRamType *eeprom)
634{ 634{
635 eeprom->delay_time = eeprom_index_to_delay_map[eeprom->delay_time]; 635 eeprom->delay_time = eeprom_index_to_delay_map[eeprom->delay_time];
636} 636}
@@ -643,7 +643,7 @@ static void __devinit eeprom_index_to_delay(struct NvRamType *eeprom)
643 * 643 *
644 * @delay: The delay, in seconds, to find the eeprom index for. 644 * @delay: The delay, in seconds, to find the eeprom index for.
645 **/ 645 **/
646static int __devinit delay_to_eeprom_index(int delay) 646static int delay_to_eeprom_index(int delay)
647{ 647{
648 u8 idx = 0; 648 u8 idx = 0;
649 while (idx < 7 && eeprom_index_to_delay_map[idx] < delay) 649 while (idx < 7 && eeprom_index_to_delay_map[idx] < delay)
@@ -659,7 +659,7 @@ static int __devinit delay_to_eeprom_index(int delay)
659 * 659 *
660 * @eeprom: The eeprom data to override with command line options. 660 * @eeprom: The eeprom data to override with command line options.
661 **/ 661 **/
662static void __devinit eeprom_override(struct NvRamType *eeprom) 662static void eeprom_override(struct NvRamType *eeprom)
663{ 663{
664 u8 id; 664 u8 id;
665 665
@@ -3938,7 +3938,7 @@ static void dc395x_slave_destroy(struct scsi_device *scsi_device)
3938 * 3938 *
3939 * @io_port: base I/O address 3939 * @io_port: base I/O address
3940 **/ 3940 **/
3941static void __devinit trms1040_wait_30us(unsigned long io_port) 3941static void trms1040_wait_30us(unsigned long io_port)
3942{ 3942{
3943 /* ScsiPortStallExecution(30); wait 30 us */ 3943 /* ScsiPortStallExecution(30); wait 30 us */
3944 outb(5, io_port + TRM_S1040_GEN_TIMER); 3944 outb(5, io_port + TRM_S1040_GEN_TIMER);
@@ -3955,7 +3955,7 @@ static void __devinit trms1040_wait_30us(unsigned long io_port)
3955 * @cmd: SB + op code (command) to send 3955 * @cmd: SB + op code (command) to send
3956 * @addr: address to send 3956 * @addr: address to send
3957 **/ 3957 **/
3958static void __devinit trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr) 3958static void trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr)
3959{ 3959{
3960 int i; 3960 int i;
3961 u8 send_data; 3961 u8 send_data;
@@ -4000,7 +4000,7 @@ static void __devinit trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr)
4000 * @addr: offset into EEPROM 4000 * @addr: offset into EEPROM
4001 * @byte: bytes to write 4001 * @byte: bytes to write
4002 **/ 4002 **/
4003static void __devinit trms1040_set_data(unsigned long io_port, u8 addr, u8 byte) 4003static void trms1040_set_data(unsigned long io_port, u8 addr, u8 byte)
4004{ 4004{
4005 int i; 4005 int i;
4006 u8 send_data; 4006 u8 send_data;
@@ -4054,7 +4054,7 @@ static void __devinit trms1040_set_data(unsigned long io_port, u8 addr, u8 byte)
4054 * @eeprom: the data to write 4054 * @eeprom: the data to write
4055 * @io_port: the base io port 4055 * @io_port: the base io port
4056 **/ 4056 **/
4057static void __devinit trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port) 4057static void trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port)
4058{ 4058{
4059 u8 *b_eeprom = (u8 *)eeprom; 4059 u8 *b_eeprom = (u8 *)eeprom;
4060 u8 addr; 4060 u8 addr;
@@ -4094,7 +4094,7 @@ static void __devinit trms1040_write_all(struct NvRamType *eeprom, unsigned long
4094 * 4094 *
4095 * Returns the byte read. 4095 * Returns the byte read.
4096 **/ 4096 **/
4097static u8 __devinit trms1040_get_data(unsigned long io_port, u8 addr) 4097static u8 trms1040_get_data(unsigned long io_port, u8 addr)
4098{ 4098{
4099 int i; 4099 int i;
4100 u8 read_byte; 4100 u8 read_byte;
@@ -4132,7 +4132,7 @@ static u8 __devinit trms1040_get_data(unsigned long io_port, u8 addr)
4132 * @eeprom: where to store the data 4132 * @eeprom: where to store the data
4133 * @io_port: the base io port 4133 * @io_port: the base io port
4134 **/ 4134 **/
4135static void __devinit trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port) 4135static void trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port)
4136{ 4136{
4137 u8 *b_eeprom = (u8 *)eeprom; 4137 u8 *b_eeprom = (u8 *)eeprom;
4138 u8 addr; 4138 u8 addr;
@@ -4162,7 +4162,7 @@ static void __devinit trms1040_read_all(struct NvRamType *eeprom, unsigned long
4162 * @eeprom: caller allocated strcuture to read the eeprom data into 4162 * @eeprom: caller allocated strcuture to read the eeprom data into
4163 * @io_port: io port to read from 4163 * @io_port: io port to read from
4164 **/ 4164 **/
4165static void __devinit check_eeprom(struct NvRamType *eeprom, unsigned long io_port) 4165static void check_eeprom(struct NvRamType *eeprom, unsigned long io_port)
4166{ 4166{
4167 u16 *w_eeprom = (u16 *)eeprom; 4167 u16 *w_eeprom = (u16 *)eeprom;
4168 u16 w_addr; 4168 u16 w_addr;
@@ -4232,7 +4232,7 @@ static void __devinit check_eeprom(struct NvRamType *eeprom, unsigned long io_po
4232 * 4232 *
4233 * @eeprom: The eeprom data strucutre to show details for. 4233 * @eeprom: The eeprom data strucutre to show details for.
4234 **/ 4234 **/
4235static void __devinit print_eeprom_settings(struct NvRamType *eeprom) 4235static void print_eeprom_settings(struct NvRamType *eeprom)
4236{ 4236{
4237 dprintkl(KERN_INFO, "Used settings: AdapterID=%02i, Speed=%i(%02i.%01iMHz), dev_mode=0x%02x\n", 4237 dprintkl(KERN_INFO, "Used settings: AdapterID=%02i, Speed=%i(%02i.%01iMHz), dev_mode=0x%02x\n",
4238 eeprom->scsi_id, 4238 eeprom->scsi_id,
@@ -4260,7 +4260,7 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb)
4260/* 4260/*
4261 * Allocate SG tables; as we have to pci_map them, an SG list (struct SGentry*) 4261 * Allocate SG tables; as we have to pci_map them, an SG list (struct SGentry*)
4262 * should never cross a page boundary */ 4262 * should never cross a page boundary */
4263static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) 4263static int adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
4264{ 4264{
4265 const unsigned mem_needed = (DC395x_MAX_SRB_CNT+1) 4265 const unsigned mem_needed = (DC395x_MAX_SRB_CNT+1)
4266 *SEGMENTX_LEN; 4266 *SEGMENTX_LEN;
@@ -4306,7 +4306,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
4306 * 4306 *
4307 * @acb: The adapter to print the information for. 4307 * @acb: The adapter to print the information for.
4308 **/ 4308 **/
4309static void __devinit adapter_print_config(struct AdapterCtlBlk *acb) 4309static void adapter_print_config(struct AdapterCtlBlk *acb)
4310{ 4310{
4311 u8 bval; 4311 u8 bval;
4312 4312
@@ -4350,7 +4350,7 @@ static void __devinit adapter_print_config(struct AdapterCtlBlk *acb)
4350 * 4350 *
4351 * @acb: The adapter to initialize. 4351 * @acb: The adapter to initialize.
4352 **/ 4352 **/
4353static void __devinit adapter_init_params(struct AdapterCtlBlk *acb) 4353static void adapter_init_params(struct AdapterCtlBlk *acb)
4354{ 4354{
4355 struct NvRamType *eeprom = &acb->eeprom; 4355 struct NvRamType *eeprom = &acb->eeprom;
4356 int i; 4356 int i;
@@ -4412,7 +4412,7 @@ static void __devinit adapter_init_params(struct AdapterCtlBlk *acb)
4412 * 4412 *
4413 * @host: The scsi host instance to fill in the values for. 4413 * @host: The scsi host instance to fill in the values for.
4414 **/ 4414 **/
4415static void __devinit adapter_init_scsi_host(struct Scsi_Host *host) 4415static void adapter_init_scsi_host(struct Scsi_Host *host)
4416{ 4416{
4417 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata; 4417 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata;
4418 struct NvRamType *eeprom = &acb->eeprom; 4418 struct NvRamType *eeprom = &acb->eeprom;
@@ -4453,7 +4453,7 @@ static void __devinit adapter_init_scsi_host(struct Scsi_Host *host)
4453 * 4453 *
4454 * @acb: The adapter which we are to init. 4454 * @acb: The adapter which we are to init.
4455 **/ 4455 **/
4456static void __devinit adapter_init_chip(struct AdapterCtlBlk *acb) 4456static void adapter_init_chip(struct AdapterCtlBlk *acb)
4457{ 4457{
4458 struct NvRamType *eeprom = &acb->eeprom; 4458 struct NvRamType *eeprom = &acb->eeprom;
4459 4459
@@ -4506,8 +4506,8 @@ static void __devinit adapter_init_chip(struct AdapterCtlBlk *acb)
4506 * Returns 0 if the initialization succeeds, any other value on 4506 * Returns 0 if the initialization succeeds, any other value on
4507 * failure. 4507 * failure.
4508 **/ 4508 **/
4509static int __devinit adapter_init(struct AdapterCtlBlk *acb, 4509static int adapter_init(struct AdapterCtlBlk *acb, unsigned long io_port,
4510 unsigned long io_port, u32 io_port_len, unsigned int irq) 4510 u32 io_port_len, unsigned int irq)
4511{ 4511{
4512 if (!request_region(io_port, io_port_len, DC395X_NAME)) { 4512 if (!request_region(io_port, io_port_len, DC395X_NAME)) {
4513 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port); 4513 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port);
@@ -4794,8 +4794,7 @@ static void banner_display(void)
4794 * 4794 *
4795 * Returns 0 on success, or an error code (-ve) on failure. 4795 * Returns 0 on success, or an error code (-ve) on failure.
4796 **/ 4796 **/
4797static int __devinit dc395x_init_one(struct pci_dev *dev, 4797static int dc395x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
4798 const struct pci_device_id *id)
4799{ 4798{
4800 struct Scsi_Host *scsi_host = NULL; 4799 struct Scsi_Host *scsi_host = NULL;
4801 struct AdapterCtlBlk *acb = NULL; 4800 struct AdapterCtlBlk *acb = NULL;
@@ -4861,7 +4860,7 @@ fail:
4861 * 4860 *
4862 * @dev: The PCI device to initialize. 4861 * @dev: The PCI device to initialize.
4863 **/ 4862 **/
4864static void __devexit dc395x_remove_one(struct pci_dev *dev) 4863static void dc395x_remove_one(struct pci_dev *dev)
4865{ 4864{
4866 struct Scsi_Host *scsi_host = pci_get_drvdata(dev); 4865 struct Scsi_Host *scsi_host = pci_get_drvdata(dev);
4867 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)(scsi_host->hostdata); 4866 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)(scsi_host->hostdata);
@@ -4892,7 +4891,7 @@ static struct pci_driver dc395x_driver = {
4892 .name = DC395X_NAME, 4891 .name = DC395X_NAME,
4893 .id_table = dc395x_pci_table, 4892 .id_table = dc395x_pci_table,
4894 .probe = dc395x_init_one, 4893 .probe = dc395x_init_one,
4895 .remove = __devexit_p(dc395x_remove_one), 4894 .remove = dc395x_remove_one,
4896}; 4895};
4897 4896
4898 4897
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index 207352cc70c..4b0dd8c5670 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -68,8 +68,8 @@ static struct scsi_host_template dmx3191d_driver_template = {
68 .use_clustering = DISABLE_CLUSTERING, 68 .use_clustering = DISABLE_CLUSTERING,
69}; 69};
70 70
71static int __devinit dmx3191d_probe_one(struct pci_dev *pdev, 71static int dmx3191d_probe_one(struct pci_dev *pdev,
72 const struct pci_device_id *id) 72 const struct pci_device_id *id)
73{ 73{
74 struct Scsi_Host *shost; 74 struct Scsi_Host *shost;
75 unsigned long io; 75 unsigned long io;
@@ -123,7 +123,7 @@ static int __devinit dmx3191d_probe_one(struct pci_dev *pdev,
123 return error; 123 return error;
124} 124}
125 125
126static void __devexit dmx3191d_remove_one(struct pci_dev *pdev) 126static void dmx3191d_remove_one(struct pci_dev *pdev)
127{ 127{
128 struct Scsi_Host *shost = pci_get_drvdata(pdev); 128 struct Scsi_Host *shost = pci_get_drvdata(pdev);
129 129
@@ -150,7 +150,7 @@ static struct pci_driver dmx3191d_pci_driver = {
150 .name = DMX3191D_DRIVER_NAME, 150 .name = DMX3191D_DRIVER_NAME,
151 .id_table = dmx3191d_pci_tbl, 151 .id_table = dmx3191d_pci_tbl,
152 .probe = dmx3191d_probe_one, 152 .probe = dmx3191d_probe_one,
153 .remove = __devexit_p(dmx3191d_remove_one), 153 .remove = dmx3191d_remove_one,
154}; 154};
155 155
156static int __init dmx3191d_init(void) 156static int __init dmx3191d_init(void)
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index 1a2a1e5824e..fff682976c5 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -1771,7 +1771,7 @@ struct scsi_host_template fdomain_driver_template = {
1771#ifndef PCMCIA 1771#ifndef PCMCIA
1772#ifdef CONFIG_PCI 1772#ifdef CONFIG_PCI
1773 1773
1774static struct pci_device_id fdomain_pci_tbl[] __devinitdata = { 1774static struct pci_device_id fdomain_pci_tbl[] = {
1775 { PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, 1775 { PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
1776 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 1776 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
1777 { } 1777 { }
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index fc98eb61e76..fbf3ac6e0c5 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -399,8 +399,7 @@ static u8 *fnic_get_mac(struct fc_lport *lport)
399 return fnic->data_src_addr; 399 return fnic->data_src_addr;
400} 400}
401 401
402static int __devinit fnic_probe(struct pci_dev *pdev, 402static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
403 const struct pci_device_id *ent)
404{ 403{
405 struct Scsi_Host *host; 404 struct Scsi_Host *host;
406 struct fc_lport *lp; 405 struct fc_lport *lp;
@@ -774,7 +773,7 @@ err_out:
774 return err; 773 return err;
775} 774}
776 775
777static void __devexit fnic_remove(struct pci_dev *pdev) 776static void fnic_remove(struct pci_dev *pdev)
778{ 777{
779 struct fnic *fnic = pci_get_drvdata(pdev); 778 struct fnic *fnic = pci_get_drvdata(pdev);
780 struct fc_lport *lp = fnic->lport; 779 struct fc_lport *lp = fnic->lport;
@@ -849,7 +848,7 @@ static struct pci_driver fnic_driver = {
849 .name = DRV_NAME, 848 .name = DRV_NAME,
850 .id_table = fnic_id_table, 849 .id_table = fnic_id_table,
851 .probe = fnic_probe, 850 .probe = fnic_probe,
852 .remove = __devexit_p(fnic_remove), 851 .remove = fnic_remove,
853}; 852};
854 853
855static int __init fnic_init_module(void) 854static int __init fnic_init_module(void)
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 1a5954f0915..5041f925c19 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -939,7 +939,7 @@ module_param(dtc_3181e, int, 0);
939MODULE_LICENSE("GPL"); 939MODULE_LICENSE("GPL");
940 940
941#ifndef SCSI_G_NCR5380_MEM 941#ifndef SCSI_G_NCR5380_MEM
942static struct isapnp_device_id id_table[] __devinitdata = { 942static struct isapnp_device_id id_table[] = {
943 { 943 {
944 ISAPNP_ANY_ID, ISAPNP_ANY_ID, 944 ISAPNP_ANY_ID, ISAPNP_ANY_ID,
945 ISAPNP_VENDOR('D', 'T', 'C'), ISAPNP_FUNCTION(0x436e), 945 ISAPNP_VENDOR('D', 'T', 'C'), ISAPNP_FUNCTION(0x436e),
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 5d72274c507..599790e41a9 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -590,7 +590,7 @@ static struct pci_driver gdth_pci_driver = {
590 .remove = gdth_pci_remove_one, 590 .remove = gdth_pci_remove_one,
591}; 591};
592 592
593static void __devexit gdth_pci_remove_one(struct pci_dev *pdev) 593static void gdth_pci_remove_one(struct pci_dev *pdev)
594{ 594{
595 gdth_ha_str *ha = pci_get_drvdata(pdev); 595 gdth_ha_str *ha = pci_get_drvdata(pdev);
596 596
@@ -602,8 +602,8 @@ static void __devexit gdth_pci_remove_one(struct pci_dev *pdev)
602 pci_disable_device(pdev); 602 pci_disable_device(pdev);
603} 603}
604 604
605static int __devinit gdth_pci_init_one(struct pci_dev *pdev, 605static int gdth_pci_init_one(struct pci_dev *pdev,
606 const struct pci_device_id *ent) 606 const struct pci_device_id *ent)
607{ 607{
608 u16 vendor = pdev->vendor; 608 u16 vendor = pdev->vendor;
609 u16 device = pdev->device; 609 u16 device = pdev->device;
@@ -855,8 +855,8 @@ static int __init gdth_init_isa(u32 bios_adr,gdth_ha_str *ha)
855#endif /* CONFIG_ISA */ 855#endif /* CONFIG_ISA */
856 856
857#ifdef CONFIG_PCI 857#ifdef CONFIG_PCI
858static int __devinit gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr, 858static int gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr,
859 gdth_ha_str *ha) 859 gdth_ha_str *ha)
860{ 860{
861 register gdt6_dpram_str __iomem *dp6_ptr; 861 register gdt6_dpram_str __iomem *dp6_ptr;
862 register gdt6c_dpram_str __iomem *dp6c_ptr; 862 register gdt6c_dpram_str __iomem *dp6c_ptr;
@@ -1239,7 +1239,7 @@ static int __devinit gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr,
1239 1239
1240/* controller protocol functions */ 1240/* controller protocol functions */
1241 1241
1242static void __devinit gdth_enable_int(gdth_ha_str *ha) 1242static void gdth_enable_int(gdth_ha_str *ha)
1243{ 1243{
1244 unsigned long flags; 1244 unsigned long flags;
1245 gdt2_dpram_str __iomem *dp2_ptr; 1245 gdt2_dpram_str __iomem *dp2_ptr;
@@ -1555,7 +1555,7 @@ static int gdth_internal_cmd(gdth_ha_str *ha, u8 service, u16 opcode,
1555 1555
1556/* search for devices */ 1556/* search for devices */
1557 1557
1558static int __devinit gdth_search_drives(gdth_ha_str *ha) 1558static int gdth_search_drives(gdth_ha_str *ha)
1559{ 1559{
1560 u16 cdev_cnt, i; 1560 u16 cdev_cnt, i;
1561 int ok; 1561 int ok;
@@ -4959,8 +4959,7 @@ static int __init gdth_eisa_probe_one(u16 eisa_slot)
4959#endif /* CONFIG_EISA */ 4959#endif /* CONFIG_EISA */
4960 4960
4961#ifdef CONFIG_PCI 4961#ifdef CONFIG_PCI
4962static int __devinit gdth_pci_probe_one(gdth_pci_str *pcistr, 4962static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4963 gdth_ha_str **ha_out)
4964{ 4963{
4965 struct Scsi_Host *shp; 4964 struct Scsi_Host *shp;
4966 gdth_ha_str *ha; 4965 gdth_ha_str *ha;
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index 488fbc64865..dbe4cc6b9f8 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -204,7 +204,7 @@ static struct scsi_host_template gvp11_scsi_template = {
204 .use_clustering = DISABLE_CLUSTERING 204 .use_clustering = DISABLE_CLUSTERING
205}; 205};
206 206
207static int __devinit check_wd33c93(struct gvp11_scsiregs *regs) 207static int check_wd33c93(struct gvp11_scsiregs *regs)
208{ 208{
209#ifdef CHECK_WD33C93 209#ifdef CHECK_WD33C93
210 volatile unsigned char *sasr_3393, *scmd_3393; 210 volatile unsigned char *sasr_3393, *scmd_3393;
@@ -284,8 +284,7 @@ static int __devinit check_wd33c93(struct gvp11_scsiregs *regs)
284 return 0; 284 return 0;
285} 285}
286 286
287static int __devinit gvp11_probe(struct zorro_dev *z, 287static int gvp11_probe(struct zorro_dev *z, const struct zorro_device_id *ent)
288 const struct zorro_device_id *ent)
289{ 288{
290 struct Scsi_Host *instance; 289 struct Scsi_Host *instance;
291 unsigned long address; 290 unsigned long address;
@@ -380,7 +379,7 @@ fail_check_or_alloc:
380 return error; 379 return error;
381} 380}
382 381
383static void __devexit gvp11_remove(struct zorro_dev *z) 382static void gvp11_remove(struct zorro_dev *z)
384{ 383{
385 struct Scsi_Host *instance = zorro_get_drvdata(z); 384 struct Scsi_Host *instance = zorro_get_drvdata(z);
386 struct gvp11_hostdata *hdata = shost_priv(instance); 385 struct gvp11_hostdata *hdata = shost_priv(instance);
@@ -398,7 +397,7 @@ static void __devexit gvp11_remove(struct zorro_dev *z)
398 * SERIES I though). 397 * SERIES I though).
399 */ 398 */
400 399
401static struct zorro_device_id gvp11_zorro_tbl[] __devinitdata = { 400static struct zorro_device_id gvp11_zorro_tbl[] = {
402 { ZORRO_PROD_GVP_COMBO_030_R3_SCSI, ~0x00ffffff }, 401 { ZORRO_PROD_GVP_COMBO_030_R3_SCSI, ~0x00ffffff },
403 { ZORRO_PROD_GVP_SERIES_II, ~0x00ffffff }, 402 { ZORRO_PROD_GVP_SERIES_II, ~0x00ffffff },
404 { ZORRO_PROD_GVP_GFORCE_030_SCSI, ~0x01ffffff }, 403 { ZORRO_PROD_GVP_GFORCE_030_SCSI, ~0x01ffffff },
@@ -414,7 +413,7 @@ static struct zorro_driver gvp11_driver = {
414 .name = "gvp11", 413 .name = "gvp11",
415 .id_table = gvp11_zorro_tbl, 414 .id_table = gvp11_zorro_tbl,
416 .probe = gvp11_probe, 415 .probe = gvp11_probe,
417 .remove = __devexit_p(gvp11_remove), 416 .remove = gvp11_remove,
418}; 417};
419 418
420static int __init gvp11_init(void) 419static int __init gvp11_init(void)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 4217e49aea4..4f338061b5c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -189,16 +189,16 @@ static void check_ioctl_unit_attention(struct ctlr_info *h,
189/* performant mode helper functions */ 189/* performant mode helper functions */
190static void calc_bucket_map(int *bucket, int num_buckets, 190static void calc_bucket_map(int *bucket, int num_buckets,
191 int nsgs, int *bucket_map); 191 int nsgs, int *bucket_map);
192static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h); 192static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h);
193static inline u32 next_command(struct ctlr_info *h, u8 q); 193static inline u32 next_command(struct ctlr_info *h, u8 q);
194static int __devinit hpsa_find_cfg_addrs(struct pci_dev *pdev, 194static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
195 void __iomem *vaddr, u32 *cfg_base_addr, u64 *cfg_base_addr_index, 195 u32 *cfg_base_addr, u64 *cfg_base_addr_index,
196 u64 *cfg_offset); 196 u64 *cfg_offset);
197static int __devinit hpsa_pci_find_memory_BAR(struct pci_dev *pdev, 197static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
198 unsigned long *memory_bar); 198 unsigned long *memory_bar);
199static int __devinit hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id); 199static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id);
200static int __devinit hpsa_wait_for_board_state(struct pci_dev *pdev, 200static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr,
201 void __iomem *vaddr, int wait_for_ready); 201 int wait_for_ready);
202static inline void finish_cmd(struct CommandList *c); 202static inline void finish_cmd(struct CommandList *c);
203#define BOARD_NOT_READY 0 203#define BOARD_NOT_READY 0
204#define BOARD_READY 1 204#define BOARD_READY 1
@@ -3182,8 +3182,8 @@ static int hpsa_ioctl(struct scsi_device *dev, int cmd, void *arg)
3182 } 3182 }
3183} 3183}
3184 3184
3185static int __devinit hpsa_send_host_reset(struct ctlr_info *h, 3185static int hpsa_send_host_reset(struct ctlr_info *h, unsigned char *scsi3addr,
3186 unsigned char *scsi3addr, u8 reset_type) 3186 u8 reset_type)
3187{ 3187{
3188 struct CommandList *c; 3188 struct CommandList *c;
3189 3189
@@ -3606,8 +3606,8 @@ static irqreturn_t do_hpsa_intr_msi(int irq, void *queue)
3606 * in simple mode, not performant mode due to the tag lookup. 3606 * in simple mode, not performant mode due to the tag lookup.
3607 * We only ever use this immediately after a controller reset. 3607 * We only ever use this immediately after a controller reset.
3608 */ 3608 */
3609static __devinit int hpsa_message(struct pci_dev *pdev, unsigned char opcode, 3609static int hpsa_message(struct pci_dev *pdev, unsigned char opcode,
3610 unsigned char type) 3610 unsigned char type)
3611{ 3611{
3612 struct Command { 3612 struct Command {
3613 struct CommandListHeader CommandHeader; 3613 struct CommandListHeader CommandHeader;
@@ -3756,14 +3756,13 @@ static int hpsa_controller_hard_reset(struct pci_dev *pdev,
3756 return 0; 3756 return 0;
3757} 3757}
3758 3758
3759static __devinit void init_driver_version(char *driver_version, int len) 3759static void init_driver_version(char *driver_version, int len)
3760{ 3760{
3761 memset(driver_version, 0, len); 3761 memset(driver_version, 0, len);
3762 strncpy(driver_version, HPSA " " HPSA_DRIVER_VERSION, len - 1); 3762 strncpy(driver_version, HPSA " " HPSA_DRIVER_VERSION, len - 1);
3763} 3763}
3764 3764
3765static __devinit int write_driver_ver_to_cfgtable( 3765static int write_driver_ver_to_cfgtable(struct CfgTable __iomem *cfgtable)
3766 struct CfgTable __iomem *cfgtable)
3767{ 3766{
3768 char *driver_version; 3767 char *driver_version;
3769 int i, size = sizeof(cfgtable->driver_version); 3768 int i, size = sizeof(cfgtable->driver_version);
@@ -3779,8 +3778,8 @@ static __devinit int write_driver_ver_to_cfgtable(
3779 return 0; 3778 return 0;
3780} 3779}
3781 3780
3782static __devinit void read_driver_ver_from_cfgtable( 3781static void read_driver_ver_from_cfgtable(struct CfgTable __iomem *cfgtable,
3783 struct CfgTable __iomem *cfgtable, unsigned char *driver_ver) 3782 unsigned char *driver_ver)
3784{ 3783{
3785 int i; 3784 int i;
3786 3785
@@ -3788,8 +3787,7 @@ static __devinit void read_driver_ver_from_cfgtable(
3788 driver_ver[i] = readb(&cfgtable->driver_version[i]); 3787 driver_ver[i] = readb(&cfgtable->driver_version[i]);
3789} 3788}
3790 3789
3791static __devinit int controller_reset_failed( 3790static int controller_reset_failed(struct CfgTable __iomem *cfgtable)
3792 struct CfgTable __iomem *cfgtable)
3793{ 3791{
3794 3792
3795 char *driver_ver, *old_driver_ver; 3793 char *driver_ver, *old_driver_ver;
@@ -3812,7 +3810,7 @@ static __devinit int controller_reset_failed(
3812/* This does a hard reset of the controller using PCI power management 3810/* This does a hard reset of the controller using PCI power management
3813 * states or the using the doorbell register. 3811 * states or the using the doorbell register.
3814 */ 3812 */
3815static __devinit int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) 3813static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev)
3816{ 3814{
3817 u64 cfg_offset; 3815 u64 cfg_offset;
3818 u32 cfg_base_addr; 3816 u32 cfg_base_addr;
@@ -4029,7 +4027,7 @@ static int find_PCI_BAR_index(struct pci_dev *pdev, unsigned long pci_bar_addr)
4029 * controllers that are capable. If not, we use IO-APIC mode. 4027 * controllers that are capable. If not, we use IO-APIC mode.
4030 */ 4028 */
4031 4029
4032static void __devinit hpsa_interrupt_mode(struct ctlr_info *h) 4030static void hpsa_interrupt_mode(struct ctlr_info *h)
4033{ 4031{
4034#ifdef CONFIG_PCI_MSI 4032#ifdef CONFIG_PCI_MSI
4035 int err, i; 4033 int err, i;
@@ -4077,7 +4075,7 @@ default_int_mode:
4077 h->intr[h->intr_mode] = h->pdev->irq; 4075 h->intr[h->intr_mode] = h->pdev->irq;
4078} 4076}
4079 4077
4080static int __devinit hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id) 4078static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
4081{ 4079{
4082 int i; 4080 int i;
4083 u32 subsystem_vendor_id, subsystem_device_id; 4081 u32 subsystem_vendor_id, subsystem_device_id;
@@ -4101,8 +4099,8 @@ static int __devinit hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
4101 return ARRAY_SIZE(products) - 1; /* generic unknown smart array */ 4099 return ARRAY_SIZE(products) - 1; /* generic unknown smart array */
4102} 4100}
4103 4101
4104static int __devinit hpsa_pci_find_memory_BAR(struct pci_dev *pdev, 4102static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
4105 unsigned long *memory_bar) 4103 unsigned long *memory_bar)
4106{ 4104{
4107 int i; 4105 int i;
4108 4106
@@ -4118,8 +4116,8 @@ static int __devinit hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
4118 return -ENODEV; 4116 return -ENODEV;
4119} 4117}
4120 4118
4121static int __devinit hpsa_wait_for_board_state(struct pci_dev *pdev, 4119static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr,
4122 void __iomem *vaddr, int wait_for_ready) 4120 int wait_for_ready)
4123{ 4121{
4124 int i, iterations; 4122 int i, iterations;
4125 u32 scratchpad; 4123 u32 scratchpad;
@@ -4143,9 +4141,9 @@ static int __devinit hpsa_wait_for_board_state(struct pci_dev *pdev,
4143 return -ENODEV; 4141 return -ENODEV;
4144} 4142}
4145 4143
4146static int __devinit hpsa_find_cfg_addrs(struct pci_dev *pdev, 4144static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
4147 void __iomem *vaddr, u32 *cfg_base_addr, u64 *cfg_base_addr_index, 4145 u32 *cfg_base_addr, u64 *cfg_base_addr_index,
4148 u64 *cfg_offset) 4146 u64 *cfg_offset)
4149{ 4147{
4150 *cfg_base_addr = readl(vaddr + SA5_CTCFG_OFFSET); 4148 *cfg_base_addr = readl(vaddr + SA5_CTCFG_OFFSET);
4151 *cfg_offset = readl(vaddr + SA5_CTMEM_OFFSET); 4149 *cfg_offset = readl(vaddr + SA5_CTMEM_OFFSET);
@@ -4158,7 +4156,7 @@ static int __devinit hpsa_find_cfg_addrs(struct pci_dev *pdev,
4158 return 0; 4156 return 0;
4159} 4157}
4160 4158
4161static int __devinit hpsa_find_cfgtables(struct ctlr_info *h) 4159static int hpsa_find_cfgtables(struct ctlr_info *h)
4162{ 4160{
4163 u64 cfg_offset; 4161 u64 cfg_offset;
4164 u32 cfg_base_addr; 4162 u32 cfg_base_addr;
@@ -4187,7 +4185,7 @@ static int __devinit hpsa_find_cfgtables(struct ctlr_info *h)
4187 return 0; 4185 return 0;
4188} 4186}
4189 4187
4190static void __devinit hpsa_get_max_perf_mode_cmds(struct ctlr_info *h) 4188static void hpsa_get_max_perf_mode_cmds(struct ctlr_info *h)
4191{ 4189{
4192 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands)); 4190 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands));
4193 4191
@@ -4208,7 +4206,7 @@ static void __devinit hpsa_get_max_perf_mode_cmds(struct ctlr_info *h)
4208 * max commands, max SG elements without chaining, and with chaining, 4206 * max commands, max SG elements without chaining, and with chaining,
4209 * SG chain block size, etc. 4207 * SG chain block size, etc.
4210 */ 4208 */
4211static void __devinit hpsa_find_board_params(struct ctlr_info *h) 4209static void hpsa_find_board_params(struct ctlr_info *h)
4212{ 4210{
4213 hpsa_get_max_perf_mode_cmds(h); 4211 hpsa_get_max_perf_mode_cmds(h);
4214 h->nr_cmds = h->max_commands - 4; /* Allow room for some ioctls */ 4212 h->nr_cmds = h->max_commands - 4; /* Allow room for some ioctls */
@@ -4266,7 +4264,7 @@ static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h)
4266 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG); 4264 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
4267} 4265}
4268 4266
4269static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h) 4267static void hpsa_wait_for_mode_change_ack(struct ctlr_info *h)
4270{ 4268{
4271 int i; 4269 int i;
4272 u32 doorbell_value; 4270 u32 doorbell_value;
@@ -4287,7 +4285,7 @@ static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h)
4287 } 4285 }
4288} 4286}
4289 4287
4290static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h) 4288static int hpsa_enter_simple_mode(struct ctlr_info *h)
4291{ 4289{
4292 u32 trans_support; 4290 u32 trans_support;
4293 4291
@@ -4310,7 +4308,7 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
4310 return 0; 4308 return 0;
4311} 4309}
4312 4310
4313static int __devinit hpsa_pci_init(struct ctlr_info *h) 4311static int hpsa_pci_init(struct ctlr_info *h)
4314{ 4312{
4315 int prod_index, err; 4313 int prod_index, err;
4316 4314
@@ -4378,7 +4376,7 @@ err_out_free_res:
4378 return err; 4376 return err;
4379} 4377}
4380 4378
4381static void __devinit hpsa_hba_inquiry(struct ctlr_info *h) 4379static void hpsa_hba_inquiry(struct ctlr_info *h)
4382{ 4380{
4383 int rc; 4381 int rc;
4384 4382
@@ -4394,7 +4392,7 @@ static void __devinit hpsa_hba_inquiry(struct ctlr_info *h)
4394 } 4392 }
4395} 4393}
4396 4394
4397static __devinit int hpsa_init_reset_devices(struct pci_dev *pdev) 4395static int hpsa_init_reset_devices(struct pci_dev *pdev)
4398{ 4396{
4399 int rc, i; 4397 int rc, i;
4400 4398
@@ -4426,7 +4424,7 @@ static __devinit int hpsa_init_reset_devices(struct pci_dev *pdev)
4426 return 0; 4424 return 0;
4427} 4425}
4428 4426
4429static __devinit int hpsa_allocate_cmd_pool(struct ctlr_info *h) 4427static int hpsa_allocate_cmd_pool(struct ctlr_info *h)
4430{ 4428{
4431 h->cmd_pool_bits = kzalloc( 4429 h->cmd_pool_bits = kzalloc(
4432 DIV_ROUND_UP(h->nr_cmds, BITS_PER_LONG) * 4430 DIV_ROUND_UP(h->nr_cmds, BITS_PER_LONG) *
@@ -4499,7 +4497,7 @@ static int hpsa_request_irq(struct ctlr_info *h,
4499 return 0; 4497 return 0;
4500} 4498}
4501 4499
4502static int __devinit hpsa_kdump_soft_reset(struct ctlr_info *h) 4500static int hpsa_kdump_soft_reset(struct ctlr_info *h)
4503{ 4501{
4504 if (hpsa_send_host_reset(h, RAID_CTLR_LUNID, 4502 if (hpsa_send_host_reset(h, RAID_CTLR_LUNID,
4505 HPSA_RESET_TYPE_CONTROLLER)) { 4503 HPSA_RESET_TYPE_CONTROLLER)) {
@@ -4713,8 +4711,7 @@ static void stop_controller_lockup_detector(struct ctlr_info *h)
4713 spin_unlock_irqrestore(&lockup_detector_lock, flags); 4711 spin_unlock_irqrestore(&lockup_detector_lock, flags);
4714} 4712}
4715 4713
4716static int __devinit hpsa_init_one(struct pci_dev *pdev, 4714static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
4717 const struct pci_device_id *ent)
4718{ 4715{
4719 int dac, rc; 4716 int dac, rc;
4720 struct ctlr_info *h; 4717 struct ctlr_info *h;
@@ -4910,7 +4907,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
4910 hpsa_free_irqs_and_disable_msix(h); 4907 hpsa_free_irqs_and_disable_msix(h);
4911} 4908}
4912 4909
4913static void __devexit hpsa_free_device_info(struct ctlr_info *h) 4910static void hpsa_free_device_info(struct ctlr_info *h)
4914{ 4911{
4915 int i; 4912 int i;
4916 4913
@@ -4918,7 +4915,7 @@ static void __devexit hpsa_free_device_info(struct ctlr_info *h)
4918 kfree(h->dev[i]); 4915 kfree(h->dev[i]);
4919} 4916}
4920 4917
4921static void __devexit hpsa_remove_one(struct pci_dev *pdev) 4918static void hpsa_remove_one(struct pci_dev *pdev)
4922{ 4919{
4923 struct ctlr_info *h; 4920 struct ctlr_info *h;
4924 4921
@@ -4966,7 +4963,7 @@ static int hpsa_resume(__attribute__((unused)) struct pci_dev *pdev)
4966static struct pci_driver hpsa_pci_driver = { 4963static struct pci_driver hpsa_pci_driver = {
4967 .name = HPSA, 4964 .name = HPSA,
4968 .probe = hpsa_init_one, 4965 .probe = hpsa_init_one,
4969 .remove = __devexit_p(hpsa_remove_one), 4966 .remove = hpsa_remove_one,
4970 .id_table = hpsa_pci_device_id, /* id_table */ 4967 .id_table = hpsa_pci_device_id, /* id_table */
4971 .shutdown = hpsa_shutdown, 4968 .shutdown = hpsa_shutdown,
4972 .suspend = hpsa_suspend, 4969 .suspend = hpsa_suspend,
@@ -5010,8 +5007,7 @@ static void calc_bucket_map(int bucket[], int num_buckets,
5010 } 5007 }
5011} 5008}
5012 5009
5013static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h, 5010static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 use_short_tags)
5014 u32 use_short_tags)
5015{ 5011{
5016 int i; 5012 int i;
5017 unsigned long register_value; 5013 unsigned long register_value;
@@ -5079,7 +5075,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h,
5079 h->transMethod = CFGTBL_Trans_Performant; 5075 h->transMethod = CFGTBL_Trans_Performant;
5080} 5076}
5081 5077
5082static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) 5078static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
5083{ 5079{
5084 u32 trans_support; 5080 u32 trans_support;
5085 int i; 5081 int i;
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 138e573f37e..ee196b363d8 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -1282,8 +1282,7 @@ static int hptiop_internal_memfree_mvfrey(struct hptiop_hba *hba)
1282 return -1; 1282 return -1;
1283} 1283}
1284 1284
1285static int __devinit hptiop_probe(struct pci_dev *pcidev, 1285static int hptiop_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
1286 const struct pci_device_id *id)
1287{ 1286{
1288 struct Scsi_Host *host = NULL; 1287 struct Scsi_Host *host = NULL;
1289 struct hptiop_hba *hba; 1288 struct hptiop_hba *hba;
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 5e8d51bd03d..cc82d0f322b 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -4905,7 +4905,7 @@ static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev)
4905 return pool_dma + ((512 * 1024) * driver_template.cmd_per_lun); 4905 return pool_dma + ((512 * 1024) * driver_template.cmd_per_lun);
4906} 4906}
4907 4907
4908static struct vio_device_id ibmvfc_device_table[] __devinitdata = { 4908static struct vio_device_id ibmvfc_device_table[] = {
4909 {"fcp", "IBM,vfc-client"}, 4909 {"fcp", "IBM,vfc-client"},
4910 { "", "" } 4910 { "", "" }
4911}; 4911};
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index ef9a54c7da6..a044f593e8b 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2362,7 +2362,7 @@ static int ibmvscsi_resume(struct device *dev)
2362 * ibmvscsi_device_table: Used by vio.c to match devices in the device tree we 2362 * ibmvscsi_device_table: Used by vio.c to match devices in the device tree we
2363 * support. 2363 * support.
2364 */ 2364 */
2365static struct vio_device_id ibmvscsi_device_table[] __devinitdata = { 2365static struct vio_device_id ibmvscsi_device_table[] = {
2366 {"vscsi", "IBM,v-scsi"}, 2366 {"vscsi", "IBM,v-scsi"},
2367 { "", "" } 2367 { "", "" }
2368}; 2368};
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index aa7ed81e923..bf9eca84516 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -907,7 +907,7 @@ static int ibmvstgt_remove(struct vio_dev *dev)
907 return 0; 907 return 0;
908} 908}
909 909
910static struct vio_device_id ibmvstgt_device_table[] __devinitdata = { 910static struct vio_device_id ibmvstgt_device_table[] = {
911 {"v-scsi-host", "IBM,v-scsi-host"}, 911 {"v-scsi-host", "IBM,v-scsi-host"},
912 {"",""} 912 {"",""}
913}; 913};
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index dd741bcd6cc..280d5af113d 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2992,7 +2992,7 @@ static struct pci_driver initio_pci_driver = {
2992 .name = "initio", 2992 .name = "initio",
2993 .id_table = initio_pci_tbl, 2993 .id_table = initio_pci_tbl,
2994 .probe = initio_probe_one, 2994 .probe = initio_probe_one,
2995 .remove = __devexit_p(initio_remove_one), 2995 .remove = initio_remove_one,
2996}; 2996};
2997 2997
2998static int __init initio_init_driver(void) 2998static int __init initio_init_driver(void)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index fe6029f4df1..1d7da3f41eb 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -8296,7 +8296,7 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
8296 * Return value: 8296 * Return value:
8297 * 0 on success / -EIO on failure 8297 * 0 on success / -EIO on failure
8298 **/ 8298 **/
8299static int __devinit ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg) 8299static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
8300{ 8300{
8301 int rc = 0; 8301 int rc = 0;
8302 unsigned long host_lock_flags = 0; 8302 unsigned long host_lock_flags = 0;
@@ -8425,7 +8425,7 @@ static void ipr_free_all_resources(struct ipr_ioa_cfg *ioa_cfg)
8425 * Return value: 8425 * Return value:
8426 * 0 on success / -ENOMEM on allocation failure 8426 * 0 on success / -ENOMEM on allocation failure
8427 **/ 8427 **/
8428static int __devinit ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg) 8428static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
8429{ 8429{
8430 struct ipr_cmnd *ipr_cmd; 8430 struct ipr_cmnd *ipr_cmd;
8431 struct ipr_ioarcb *ioarcb; 8431 struct ipr_ioarcb *ioarcb;
@@ -8497,7 +8497,7 @@ static int __devinit ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
8497 * Return value: 8497 * Return value:
8498 * 0 on success / non-zero for error 8498 * 0 on success / non-zero for error
8499 **/ 8499 **/
8500static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg) 8500static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
8501{ 8501{
8502 struct pci_dev *pdev = ioa_cfg->pdev; 8502 struct pci_dev *pdev = ioa_cfg->pdev;
8503 int i, rc = -ENOMEM; 8503 int i, rc = -ENOMEM;
@@ -8601,7 +8601,7 @@ out_free_res_entries:
8601 * Return value: 8601 * Return value:
8602 * none 8602 * none
8603 **/ 8603 **/
8604static void __devinit ipr_initialize_bus_attr(struct ipr_ioa_cfg *ioa_cfg) 8604static void ipr_initialize_bus_attr(struct ipr_ioa_cfg *ioa_cfg)
8605{ 8605{
8606 int i; 8606 int i;
8607 8607
@@ -8625,8 +8625,8 @@ static void __devinit ipr_initialize_bus_attr(struct ipr_ioa_cfg *ioa_cfg)
8625 * Return value: 8625 * Return value:
8626 * none 8626 * none
8627 **/ 8627 **/
8628static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, 8628static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
8629 struct Scsi_Host *host, struct pci_dev *pdev) 8629 struct Scsi_Host *host, struct pci_dev *pdev)
8630{ 8630{
8631 const struct ipr_interrupt_offsets *p; 8631 const struct ipr_interrupt_offsets *p;
8632 struct ipr_interrupts *t; 8632 struct ipr_interrupts *t;
@@ -8712,7 +8712,7 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
8712 * Return value: 8712 * Return value:
8713 * ptr to chip information on success / NULL on failure 8713 * ptr to chip information on success / NULL on failure
8714 **/ 8714 **/
8715static const struct ipr_chip_t * __devinit 8715static const struct ipr_chip_t *
8716ipr_get_chip_info(const struct pci_device_id *dev_id) 8716ipr_get_chip_info(const struct pci_device_id *dev_id)
8717{ 8717{
8718 int i; 8718 int i;
@@ -8734,7 +8734,7 @@ ipr_get_chip_info(const struct pci_device_id *dev_id)
8734 * Return value: 8734 * Return value:
8735 * 0 on success / non-zero on failure 8735 * 0 on success / non-zero on failure
8736 **/ 8736 **/
8737static irqreturn_t __devinit ipr_test_intr(int irq, void *devp) 8737static irqreturn_t ipr_test_intr(int irq, void *devp)
8738{ 8738{
8739 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)devp; 8739 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)devp;
8740 unsigned long lock_flags = 0; 8740 unsigned long lock_flags = 0;
@@ -8761,8 +8761,7 @@ static irqreturn_t __devinit ipr_test_intr(int irq, void *devp)
8761 * Return value: 8761 * Return value:
8762 * 0 on success / non-zero on failure 8762 * 0 on success / non-zero on failure
8763 **/ 8763 **/
8764static int __devinit ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, 8764static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
8765 struct pci_dev *pdev)
8766{ 8765{
8767 int rc; 8766 int rc;
8768 volatile u32 int_reg; 8767 volatile u32 int_reg;
@@ -8815,8 +8814,8 @@ static int __devinit ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg,
8815 * Return value: 8814 * Return value:
8816 * 0 on success / non-zero on failure 8815 * 0 on success / non-zero on failure
8817 **/ 8816 **/
8818static int __devinit ipr_probe_ioa(struct pci_dev *pdev, 8817static int ipr_probe_ioa(struct pci_dev *pdev,
8819 const struct pci_device_id *dev_id) 8818 const struct pci_device_id *dev_id)
8820{ 8819{
8821 struct ipr_ioa_cfg *ioa_cfg; 8820 struct ipr_ioa_cfg *ioa_cfg;
8822 struct Scsi_Host *host; 8821 struct Scsi_Host *host;
@@ -9113,7 +9112,7 @@ static void __ipr_remove(struct pci_dev *pdev)
9113 * Return value: 9112 * Return value:
9114 * none 9113 * none
9115 **/ 9114 **/
9116static void __devexit ipr_remove(struct pci_dev *pdev) 9115static void ipr_remove(struct pci_dev *pdev)
9117{ 9116{
9118 struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev); 9117 struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev);
9119 9118
@@ -9136,8 +9135,7 @@ static void __devexit ipr_remove(struct pci_dev *pdev)
9136 * Return value: 9135 * Return value:
9137 * 0 on success / non-zero on failure 9136 * 0 on success / non-zero on failure
9138 **/ 9137 **/
9139static int __devinit ipr_probe(struct pci_dev *pdev, 9138static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
9140 const struct pci_device_id *dev_id)
9141{ 9139{
9142 struct ipr_ioa_cfg *ioa_cfg; 9140 struct ipr_ioa_cfg *ioa_cfg;
9143 int rc; 9141 int rc;
@@ -9218,7 +9216,7 @@ static void ipr_shutdown(struct pci_dev *pdev)
9218 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); 9216 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
9219} 9217}
9220 9218
9221static struct pci_device_id ipr_pci_table[] __devinitdata = { 9219static struct pci_device_id ipr_pci_table[] = {
9222 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, 9220 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE,
9223 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5702, 0, 0, 0 }, 9221 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5702, 0, 0, 0 },
9224 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, 9222 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE,
@@ -9305,7 +9303,7 @@ static struct pci_driver ipr_driver = {
9305 .name = IPR_NAME, 9303 .name = IPR_NAME,
9306 .id_table = ipr_pci_table, 9304 .id_table = ipr_pci_table,
9307 .probe = ipr_probe, 9305 .probe = ipr_probe,
9308 .remove = __devexit_p(ipr_remove), 9306 .remove = ipr_remove,
9309 .shutdown = ipr_shutdown, 9307 .shutdown = ipr_shutdown,
9310 .err_handler = &ipr_err_handler, 9308 .err_handler = &ipr_err_handler,
9311}; 9309};
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index b6d7a5c2fc9..9aa86a315a0 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -389,14 +389,14 @@ MODULE_DEVICE_TABLE( pci, ips_pci_table );
389 389
390static char ips_hot_plug_name[] = "ips"; 390static char ips_hot_plug_name[] = "ips";
391 391
392static int __devinit ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent); 392static int ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent);
393static void __devexit ips_remove_device(struct pci_dev *pci_dev); 393static void ips_remove_device(struct pci_dev *pci_dev);
394 394
395static struct pci_driver ips_pci_driver = { 395static struct pci_driver ips_pci_driver = {
396 .name = ips_hot_plug_name, 396 .name = ips_hot_plug_name,
397 .id_table = ips_pci_table, 397 .id_table = ips_pci_table,
398 .probe = ips_insert_device, 398 .probe = ips_insert_device,
399 .remove = __devexit_p(ips_remove_device), 399 .remove = ips_remove_device,
400}; 400};
401 401
402 402
@@ -6837,7 +6837,7 @@ err_out_sh:
6837/* Routine Description: */ 6837/* Routine Description: */
6838/* Remove one Adapter ( Hot Plugging ) */ 6838/* Remove one Adapter ( Hot Plugging ) */
6839/*---------------------------------------------------------------------------*/ 6839/*---------------------------------------------------------------------------*/
6840static void __devexit 6840static void
6841ips_remove_device(struct pci_dev *pci_dev) 6841ips_remove_device(struct pci_dev *pci_dev)
6842{ 6842{
6843 struct Scsi_Host *sh = pci_get_drvdata(pci_dev); 6843 struct Scsi_Host *sh = pci_get_drvdata(pci_dev);
@@ -6898,7 +6898,7 @@ module_exit(ips_module_exit);
6898/* Return Value: */ 6898/* Return Value: */
6899/* 0 if Successful, else non-zero */ 6899/* 0 if Successful, else non-zero */
6900/*---------------------------------------------------------------------------*/ 6900/*---------------------------------------------------------------------------*/
6901static int __devinit 6901static int
6902ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent) 6902ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent)
6903{ 6903{
6904 int index = -1; 6904 int index = -1;
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index b74050b95d6..d73fdcfeb45 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -282,7 +282,7 @@ static void isci_unregister(struct isci_host *isci_host)
282 scsi_host_put(shost); 282 scsi_host_put(shost);
283} 283}
284 284
285static int __devinit isci_pci_init(struct pci_dev *pdev) 285static int isci_pci_init(struct pci_dev *pdev)
286{ 286{
287 int err, bar_num, bar_mask = 0; 287 int err, bar_num, bar_mask = 0;
288 void __iomem * const *iomap; 288 void __iomem * const *iomap;
@@ -616,7 +616,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
616 return NULL; 616 return NULL;
617} 617}
618 618
619static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 619static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
620{ 620{
621 struct isci_pci_info *pci_info; 621 struct isci_pci_info *pci_info;
622 int err, i; 622 int err, i;
@@ -709,7 +709,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
709 return err; 709 return err;
710} 710}
711 711
712static void __devexit isci_pci_remove(struct pci_dev *pdev) 712static void isci_pci_remove(struct pci_dev *pdev)
713{ 713{
714 struct isci_host *ihost; 714 struct isci_host *ihost;
715 int i; 715 int i;
@@ -778,7 +778,7 @@ static struct pci_driver isci_pci_driver = {
778 .name = DRV_NAME, 778 .name = DRV_NAME,
779 .id_table = isci_id_table, 779 .id_table = isci_id_table,
780 .probe = isci_pci_probe, 780 .probe = isci_pci_probe,
781 .remove = __devexit_p(isci_pci_remove), 781 .remove = isci_pci_remove,
782#ifdef CONFIG_PM 782#ifdef CONFIG_PM
783 .driver.pm = &isci_pm_ops, 783 .driver.pm = &isci_pm_ops,
784#endif 784#endif
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 27cfb0cb186..69efbf12b29 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -129,7 +129,7 @@ static const struct esp_driver_ops jazz_esp_ops = {
129 .dma_error = jazz_esp_dma_error, 129 .dma_error = jazz_esp_dma_error,
130}; 130};
131 131
132static int __devinit esp_jazz_probe(struct platform_device *dev) 132static int esp_jazz_probe(struct platform_device *dev)
133{ 133{
134 struct scsi_host_template *tpnt = &scsi_esp_template; 134 struct scsi_host_template *tpnt = &scsi_esp_template;
135 struct Scsi_Host *host; 135 struct Scsi_Host *host;
@@ -201,7 +201,7 @@ fail:
201 return err; 201 return err;
202} 202}
203 203
204static int __devexit esp_jazz_remove(struct platform_device *dev) 204static int esp_jazz_remove(struct platform_device *dev)
205{ 205{
206 struct esp *esp = dev_get_drvdata(&dev->dev); 206 struct esp *esp = dev_get_drvdata(&dev->dev);
207 unsigned int irq = esp->host->irq; 207 unsigned int irq = esp->host->irq;
@@ -223,7 +223,7 @@ MODULE_ALIAS("platform:jazz_esp");
223 223
224static struct platform_driver esp_jazz_driver = { 224static struct platform_driver esp_jazz_driver = {
225 .probe = esp_jazz_probe, 225 .probe = esp_jazz_probe,
226 .remove = __devexit_p(esp_jazz_remove), 226 .remove = esp_jazz_remove,
227 .driver = { 227 .driver = {
228 .name = "jazz_esp", 228 .name = "jazz_esp",
229 .owner = THIS_MODULE, 229 .owner = THIS_MODULE,
diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index 23880f8fe7e..5c4ded99726 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -168,7 +168,7 @@ static struct parisc_driver lasi700_driver = {
168 .name = "lasi_scsi", 168 .name = "lasi_scsi",
169 .id_table = lasi700_ids, 169 .id_table = lasi700_ids,
170 .probe = lasi700_probe, 170 .probe = lasi700_probe,
171 .remove = __devexit_p(lasi700_driver_remove), 171 .remove = lasi700_driver_remove,
172}; 172};
173 173
174static int __init 174static int __init
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index c20eec78adc..89ad5580701 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -8813,7 +8813,7 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
8813 * 0 - driver can claim the device 8813 * 0 - driver can claim the device
8814 * negative value - driver can not claim the device 8814 * negative value - driver can not claim the device
8815 **/ 8815 **/
8816static int __devinit 8816static int
8817lpfc_pci_probe_one_s3(struct pci_dev *pdev, const struct pci_device_id *pid) 8817lpfc_pci_probe_one_s3(struct pci_dev *pdev, const struct pci_device_id *pid)
8818{ 8818{
8819 struct lpfc_hba *phba; 8819 struct lpfc_hba *phba;
@@ -8980,7 +8980,7 @@ out_free_phba:
8980 * removed from PCI bus, it performs all the necessary cleanup for the HBA 8980 * removed from PCI bus, it performs all the necessary cleanup for the HBA
8981 * device to be removed from the PCI subsystem properly. 8981 * device to be removed from the PCI subsystem properly.
8982 **/ 8982 **/
8983static void __devexit 8983static void
8984lpfc_pci_remove_one_s3(struct pci_dev *pdev) 8984lpfc_pci_remove_one_s3(struct pci_dev *pdev)
8985{ 8985{
8986 struct Scsi_Host *shost = pci_get_drvdata(pdev); 8986 struct Scsi_Host *shost = pci_get_drvdata(pdev);
@@ -9587,7 +9587,7 @@ lpfc_sli4_request_firmware_update(struct lpfc_hba *phba, uint8_t fw_upgrade)
9587 * 0 - driver can claim the device 9587 * 0 - driver can claim the device
9588 * negative value - driver can not claim the device 9588 * negative value - driver can not claim the device
9589 **/ 9589 **/
9590static int __devinit 9590static int
9591lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid) 9591lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
9592{ 9592{
9593 struct lpfc_hba *phba; 9593 struct lpfc_hba *phba;
@@ -9779,7 +9779,7 @@ out_free_phba:
9779 * removed from PCI bus, it performs all the necessary cleanup for the HBA 9779 * removed from PCI bus, it performs all the necessary cleanup for the HBA
9780 * device to be removed from the PCI subsystem properly. 9780 * device to be removed from the PCI subsystem properly.
9781 **/ 9781 **/
9782static void __devexit 9782static void
9783lpfc_pci_remove_one_s4(struct pci_dev *pdev) 9783lpfc_pci_remove_one_s4(struct pci_dev *pdev)
9784{ 9784{
9785 struct Scsi_Host *shost = pci_get_drvdata(pdev); 9785 struct Scsi_Host *shost = pci_get_drvdata(pdev);
@@ -10205,7 +10205,7 @@ lpfc_io_resume_s4(struct pci_dev *pdev)
10205 * 0 - driver can claim the device 10205 * 0 - driver can claim the device
10206 * negative value - driver can not claim the device 10206 * negative value - driver can not claim the device
10207 **/ 10207 **/
10208static int __devinit 10208static int
10209lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) 10209lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
10210{ 10210{
10211 int rc; 10211 int rc;
@@ -10233,7 +10233,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
10233 * remove routine, which will perform all the necessary cleanup for the 10233 * remove routine, which will perform all the necessary cleanup for the
10234 * device to be removed from the PCI subsystem properly. 10234 * device to be removed from the PCI subsystem properly.
10235 **/ 10235 **/
10236static void __devexit 10236static void
10237lpfc_pci_remove_one(struct pci_dev *pdev) 10237lpfc_pci_remove_one(struct pci_dev *pdev)
10238{ 10238{
10239 struct Scsi_Host *shost = pci_get_drvdata(pdev); 10239 struct Scsi_Host *shost = pci_get_drvdata(pdev);
@@ -10575,7 +10575,7 @@ static struct pci_driver lpfc_driver = {
10575 .name = LPFC_DRIVER_NAME, 10575 .name = LPFC_DRIVER_NAME,
10576 .id_table = lpfc_id_table, 10576 .id_table = lpfc_id_table,
10577 .probe = lpfc_pci_probe_one, 10577 .probe = lpfc_pci_probe_one,
10578 .remove = __devexit_p(lpfc_pci_remove_one), 10578 .remove = lpfc_pci_remove_one,
10579 .suspend = lpfc_pci_suspend_one, 10579 .suspend = lpfc_pci_suspend_one,
10580 .resume = lpfc_pci_resume_one, 10580 .resume = lpfc_pci_resume_one,
10581 .err_handler = &lpfc_err_handler, 10581 .err_handler = &lpfc_err_handler,
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index 70eb1f79b1b..994fc5caf03 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -481,7 +481,7 @@ static struct esp_driver_ops mac_esp_ops = {
481 .dma_error = mac_esp_dma_error, 481 .dma_error = mac_esp_dma_error,
482}; 482};
483 483
484static int __devinit esp_mac_probe(struct platform_device *dev) 484static int esp_mac_probe(struct platform_device *dev)
485{ 485{
486 struct scsi_host_template *tpnt = &scsi_esp_template; 486 struct scsi_host_template *tpnt = &scsi_esp_template;
487 struct Scsi_Host *host; 487 struct Scsi_Host *host;
@@ -591,7 +591,7 @@ fail:
591 return err; 591 return err;
592} 592}
593 593
594static int __devexit esp_mac_remove(struct platform_device *dev) 594static int esp_mac_remove(struct platform_device *dev)
595{ 595{
596 struct mac_esp_priv *mep = platform_get_drvdata(dev); 596 struct mac_esp_priv *mep = platform_get_drvdata(dev);
597 struct esp *esp = mep->esp; 597 struct esp *esp = mep->esp;
@@ -614,7 +614,7 @@ static int __devexit esp_mac_remove(struct platform_device *dev)
614 614
615static struct platform_driver esp_mac_driver = { 615static struct platform_driver esp_mac_driver = {
616 .probe = esp_mac_probe, 616 .probe = esp_mac_probe,
617 .remove = __devexit_p(esp_mac_remove), 617 .remove = esp_mac_remove,
618 .driver = { 618 .driver = {
619 .name = DRV_MODULE_NAME, 619 .name = DRV_MODULE_NAME,
620 .owner = THIS_MODULE, 620 .owner = THIS_MODULE,
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 76ad72d32c3..9504ec0ec68 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4522,7 +4522,7 @@ static struct scsi_host_template megaraid_template = {
4522 .eh_host_reset_handler = megaraid_reset, 4522 .eh_host_reset_handler = megaraid_reset,
4523}; 4523};
4524 4524
4525static int __devinit 4525static int
4526megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 4526megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4527{ 4527{
4528 struct Scsi_Host *host; 4528 struct Scsi_Host *host;
@@ -4914,7 +4914,7 @@ __megaraid_shutdown(adapter_t *adapter)
4914 mdelay(1000); 4914 mdelay(1000);
4915} 4915}
4916 4916
4917static void __devexit 4917static void
4918megaraid_remove_one(struct pci_dev *pdev) 4918megaraid_remove_one(struct pci_dev *pdev)
4919{ 4919{
4920 struct Scsi_Host *host = pci_get_drvdata(pdev); 4920 struct Scsi_Host *host = pci_get_drvdata(pdev);
@@ -5008,7 +5008,7 @@ static struct pci_driver megaraid_pci_driver = {
5008 .name = "megaraid_legacy", 5008 .name = "megaraid_legacy",
5009 .id_table = megaraid_pci_tbl, 5009 .id_table = megaraid_pci_tbl,
5010 .probe = megaraid_probe_one, 5010 .probe = megaraid_probe_one,
5011 .remove = __devexit_p(megaraid_remove_one), 5011 .remove = megaraid_remove_one,
5012 .shutdown = megaraid_shutdown, 5012 .shutdown = megaraid_shutdown,
5013}; 5013};
5014 5014
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 54b1c5bb310..e6a1e0b38a1 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -305,7 +305,7 @@ static struct pci_driver megaraid_pci_driver = {
305 .name = "megaraid", 305 .name = "megaraid",
306 .id_table = pci_id_table_g, 306 .id_table = pci_id_table_g,
307 .probe = megaraid_probe_one, 307 .probe = megaraid_probe_one,
308 .remove = __devexit_p(megaraid_detach_one), 308 .remove = megaraid_detach_one,
309 .shutdown = megaraid_mbox_shutdown, 309 .shutdown = megaraid_mbox_shutdown,
310}; 310};
311 311
@@ -434,7 +434,7 @@ megaraid_exit(void)
434 * This routine should be called whenever a new adapter is detected by the 434 * This routine should be called whenever a new adapter is detected by the
435 * PCI hotplug susbsystem. 435 * PCI hotplug susbsystem.
436 */ 436 */
437static int __devinit 437static int
438megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 438megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
439{ 439{
440 adapter_t *adapter; 440 adapter_t *adapter;
@@ -735,7 +735,7 @@ megaraid_io_detach(adapter_t *adapter)
735 * - Allocate memory required for all the commands 735 * - Allocate memory required for all the commands
736 * - Use internal library of FW routines, build up complete soft state 736 * - Use internal library of FW routines, build up complete soft state
737 */ 737 */
738static int __devinit 738static int
739megaraid_init_mbox(adapter_t *adapter) 739megaraid_init_mbox(adapter_t *adapter)
740{ 740{
741 struct pci_dev *pdev; 741 struct pci_dev *pdev;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index e4f2baacf1e..66a0fec0437 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3972,8 +3972,8 @@ fail_set_dma_mask:
3972 * @pdev: PCI device structure 3972 * @pdev: PCI device structure
3973 * @id: PCI ids of supported hotplugged adapter 3973 * @id: PCI ids of supported hotplugged adapter
3974 */ 3974 */
3975static int __devinit 3975static int megasas_probe_one(struct pci_dev *pdev,
3976megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 3976 const struct pci_device_id *id)
3977{ 3977{
3978 int rval, pos, i, j; 3978 int rval, pos, i, j;
3979 struct Scsi_Host *host; 3979 struct Scsi_Host *host;
@@ -4525,7 +4525,7 @@ fail_ready_state:
4525 * megasas_detach_one - PCI hot"un"plug entry point 4525 * megasas_detach_one - PCI hot"un"plug entry point
4526 * @pdev: PCI device structure 4526 * @pdev: PCI device structure
4527 */ 4527 */
4528static void __devexit megasas_detach_one(struct pci_dev *pdev) 4528static void megasas_detach_one(struct pci_dev *pdev)
4529{ 4529{
4530 int i; 4530 int i;
4531 struct Scsi_Host *host; 4531 struct Scsi_Host *host;
@@ -5119,7 +5119,7 @@ static struct pci_driver megasas_pci_driver = {
5119 .name = "megaraid_sas", 5119 .name = "megaraid_sas",
5120 .id_table = megasas_pci_table, 5120 .id_table = megasas_pci_table,
5121 .probe = megasas_probe_one, 5121 .probe = megasas_probe_one,
5122 .remove = __devexit_p(megasas_detach_one), 5122 .remove = megasas_detach_one,
5123 .suspend = megasas_suspend, 5123 .suspend = megasas_suspend,
5124 .resume = megasas_resume, 5124 .resume = megasas_resume,
5125 .shutdown = megasas_shutdown, 5125 .shutdown = megasas_shutdown,
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index af4e6c451b1..c6bdc926722 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -7686,7 +7686,7 @@ _scsih_shutdown(struct pci_dev *pdev)
7686 * Routine called when unloading the driver. 7686 * Routine called when unloading the driver.
7687 * Return nothing. 7687 * Return nothing.
7688 */ 7688 */
7689static void __devexit 7689static void
7690_scsih_remove(struct pci_dev *pdev) 7690_scsih_remove(struct pci_dev *pdev)
7691{ 7691{
7692 struct Scsi_Host *shost = pci_get_drvdata(pdev); 7692 struct Scsi_Host *shost = pci_get_drvdata(pdev);
@@ -8338,7 +8338,7 @@ static struct pci_driver scsih_driver = {
8338 .name = MPT2SAS_DRIVER_NAME, 8338 .name = MPT2SAS_DRIVER_NAME,
8339 .id_table = scsih_pci_table, 8339 .id_table = scsih_pci_table,
8340 .probe = _scsih_probe, 8340 .probe = _scsih_probe,
8341 .remove = __devexit_p(_scsih_remove), 8341 .remove = _scsih_remove,
8342 .shutdown = _scsih_shutdown, 8342 .shutdown = _scsih_shutdown,
8343 .err_handler = &_scsih_err_handler, 8343 .err_handler = &_scsih_err_handler,
8344#ifdef CONFIG_PM 8344#ifdef CONFIG_PM
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 05f80450ac7..6421a06c4ce 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -7374,8 +7374,7 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc)
7374 * Routine called when unloading the driver. 7374 * Routine called when unloading the driver.
7375 * Return nothing. 7375 * Return nothing.
7376 */ 7376 */
7377static void __devexit 7377static void _scsih_remove(struct pci_dev *pdev)
7378_scsih_remove(struct pci_dev *pdev)
7379{ 7378{
7380 struct Scsi_Host *shost = pci_get_drvdata(pdev); 7379 struct Scsi_Host *shost = pci_get_drvdata(pdev);
7381 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); 7380 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -8044,7 +8043,7 @@ static struct pci_driver scsih_driver = {
8044 .name = MPT3SAS_DRIVER_NAME, 8043 .name = MPT3SAS_DRIVER_NAME,
8045 .id_table = scsih_pci_table, 8044 .id_table = scsih_pci_table,
8046 .probe = _scsih_probe, 8045 .probe = _scsih_probe,
8047 .remove = __devexit_p(_scsih_remove), 8046 .remove = _scsih_remove,
8048 .shutdown = _scsih_shutdown, 8047 .shutdown = _scsih_shutdown,
8049 .err_handler = &_scsih_err_handler, 8048 .err_handler = &_scsih_err_handler,
8050#ifdef CONFIG_PM 8049#ifdef CONFIG_PM
diff --git a/drivers/scsi/mvme16x_scsi.c b/drivers/scsi/mvme16x_scsi.c
index 39f554f5f26..8fbb97a8bfd 100644
--- a/drivers/scsi/mvme16x_scsi.c
+++ b/drivers/scsi/mvme16x_scsi.c
@@ -34,8 +34,7 @@ static struct scsi_host_template mvme16x_scsi_driver_template = {
34 34
35static struct platform_device *mvme16x_scsi_device; 35static struct platform_device *mvme16x_scsi_device;
36 36
37static __devinit int 37static int mvme16x_probe(struct platform_device *dev)
38mvme16x_probe(struct platform_device *dev)
39{ 38{
40 struct Scsi_Host * host = NULL; 39 struct Scsi_Host * host = NULL;
41 struct NCR_700_Host_Parameters *hostdata; 40 struct NCR_700_Host_Parameters *hostdata;
@@ -103,8 +102,7 @@ mvme16x_probe(struct platform_device *dev)
103 return -ENODEV; 102 return -ENODEV;
104} 103}
105 104
106static __devexit int 105static int mvme16x_device_remove(struct platform_device *dev)
107mvme16x_device_remove(struct platform_device *dev)
108{ 106{
109 struct Scsi_Host *host = platform_get_drvdata(dev); 107 struct Scsi_Host *host = platform_get_drvdata(dev);
110 struct NCR_700_Host_Parameters *hostdata = shost_priv(host); 108 struct NCR_700_Host_Parameters *hostdata = shost_priv(host);
@@ -131,7 +129,7 @@ static struct platform_driver mvme16x_scsi_driver = {
131 .owner = THIS_MODULE, 129 .owner = THIS_MODULE,
132 }, 130 },
133 .probe = mvme16x_probe, 131 .probe = mvme16x_probe,
134 .remove = __devexit_p(mvme16x_device_remove), 132 .remove = mvme16x_device_remove,
135}; 133};
136 134
137static int __init mvme16x_scsi_init(void) 135static int __init mvme16x_scsi_init(void)
diff --git a/drivers/scsi/mvsas/mv_64xx.c b/drivers/scsi/mvsas/mv_64xx.c
index 8ba47229049..8bb06995adf 100644
--- a/drivers/scsi/mvsas/mv_64xx.c
+++ b/drivers/scsi/mvsas/mv_64xx.c
@@ -41,7 +41,7 @@ static void mvs_64xx_detect_porttype(struct mvs_info *mvi, int i)
41 phy->phy_type |= PORT_TYPE_SATA; 41 phy->phy_type |= PORT_TYPE_SATA;
42} 42}
43 43
44static void __devinit mvs_64xx_enable_xmt(struct mvs_info *mvi, int phy_id) 44static void mvs_64xx_enable_xmt(struct mvs_info *mvi, int phy_id)
45{ 45{
46 void __iomem *regs = mvi->regs; 46 void __iomem *regs = mvi->regs;
47 u32 tmp; 47 u32 tmp;
@@ -54,7 +54,7 @@ static void __devinit mvs_64xx_enable_xmt(struct mvs_info *mvi, int phy_id)
54 mw32(MVS_PCS, tmp); 54 mw32(MVS_PCS, tmp);
55} 55}
56 56
57static void __devinit mvs_64xx_phy_hacks(struct mvs_info *mvi) 57static void mvs_64xx_phy_hacks(struct mvs_info *mvi)
58{ 58{
59 void __iomem *regs = mvi->regs; 59 void __iomem *regs = mvi->regs;
60 int i; 60 int i;
@@ -156,7 +156,7 @@ void mvs_64xx_clear_srs_irq(struct mvs_info *mvi, u8 reg_set, u8 clear_all)
156 } 156 }
157} 157}
158 158
159static int __devinit mvs_64xx_chip_reset(struct mvs_info *mvi) 159static int mvs_64xx_chip_reset(struct mvs_info *mvi)
160{ 160{
161 void __iomem *regs = mvi->regs; 161 void __iomem *regs = mvi->regs;
162 u32 tmp; 162 u32 tmp;
@@ -250,7 +250,7 @@ static void mvs_64xx_phy_enable(struct mvs_info *mvi, u32 phy_id)
250 } 250 }
251} 251}
252 252
253static int __devinit mvs_64xx_init(struct mvs_info *mvi) 253static int mvs_64xx_init(struct mvs_info *mvi)
254{ 254{
255 void __iomem *regs = mvi->regs; 255 void __iomem *regs = mvi->regs;
256 int i; 256 int i;
diff --git a/drivers/scsi/mvsas/mv_94xx.c b/drivers/scsi/mvsas/mv_94xx.c
index 7e423e5ad5e..1e4479f3331 100644
--- a/drivers/scsi/mvsas/mv_94xx.c
+++ b/drivers/scsi/mvsas/mv_94xx.c
@@ -216,8 +216,7 @@ void set_phy_rate(struct mvs_info *mvi, int phy_id, u8 rate)
216 mvs_write_port_vsr_data(mvi, phy_id, phy_cfg.v); 216 mvs_write_port_vsr_data(mvi, phy_id, phy_cfg.v);
217} 217}
218 218
219static void __devinit 219static void mvs_94xx_config_reg_from_hba(struct mvs_info *mvi, int phy_id)
220mvs_94xx_config_reg_from_hba(struct mvs_info *mvi, int phy_id)
221{ 220{
222 u32 temp; 221 u32 temp;
223 temp = (u32)(*(u32 *)&mvi->hba_info_param.phy_tuning[phy_id]); 222 temp = (u32)(*(u32 *)&mvi->hba_info_param.phy_tuning[phy_id]);
@@ -258,7 +257,7 @@ mvs_94xx_config_reg_from_hba(struct mvs_info *mvi, int phy_id)
258 mvi->hba_info_param.phy_rate[phy_id]); 257 mvi->hba_info_param.phy_rate[phy_id]);
259} 258}
260 259
261static void __devinit mvs_94xx_enable_xmt(struct mvs_info *mvi, int phy_id) 260static void mvs_94xx_enable_xmt(struct mvs_info *mvi, int phy_id)
262{ 261{
263 void __iomem *regs = mvi->regs; 262 void __iomem *regs = mvi->regs;
264 u32 tmp; 263 u32 tmp;
@@ -331,7 +330,7 @@ static void mvs_94xx_phy_enable(struct mvs_info *mvi, u32 phy_id)
331 mvs_write_port_vsr_data(mvi, phy_id, tmp & 0xfd7fffff); 330 mvs_write_port_vsr_data(mvi, phy_id, tmp & 0xfd7fffff);
332} 331}
333 332
334static int __devinit mvs_94xx_init(struct mvs_info *mvi) 333static int mvs_94xx_init(struct mvs_info *mvi)
335{ 334{
336 void __iomem *regs = mvi->regs; 335 void __iomem *regs = mvi->regs;
337 int i; 336 int i;
diff --git a/drivers/scsi/mvsas/mv_chips.h b/drivers/scsi/mvsas/mv_chips.h
index bcc408042ce..8c4479ab49e 100644
--- a/drivers/scsi/mvsas/mv_chips.h
+++ b/drivers/scsi/mvsas/mv_chips.h
@@ -160,7 +160,7 @@ static inline void mvs_write_port_irq_mask(struct mvs_info *mvi,
160 MVS_P4_INT_MASK, port, val); 160 MVS_P4_INT_MASK, port, val);
161} 161}
162 162
163static inline void __devinit mvs_phy_hacks(struct mvs_info *mvi) 163static inline void mvs_phy_hacks(struct mvs_info *mvi)
164{ 164{
165 u32 tmp; 165 u32 tmp;
166 166
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index cc59dff3810..ce90d0546cd 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -96,7 +96,7 @@ static struct sas_domain_function_template mvs_transport_ops = {
96 96
97}; 97};
98 98
99static void __devinit mvs_phy_init(struct mvs_info *mvi, int phy_id) 99static void mvs_phy_init(struct mvs_info *mvi, int phy_id)
100{ 100{
101 struct mvs_phy *phy = &mvi->phy[phy_id]; 101 struct mvs_phy *phy = &mvi->phy[phy_id];
102 struct asd_sas_phy *sas_phy = &phy->sas_phy; 102 struct asd_sas_phy *sas_phy = &phy->sas_phy;
@@ -235,7 +235,7 @@ static irqreturn_t mvs_interrupt(int irq, void *opaque)
235 return IRQ_HANDLED; 235 return IRQ_HANDLED;
236} 236}
237 237
238static int __devinit mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) 238static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost)
239{ 239{
240 int i = 0, slot_nr; 240 int i = 0, slot_nr;
241 char pool_name[32]; 241 char pool_name[32];
@@ -373,7 +373,7 @@ void mvs_iounmap(void __iomem *regs)
373 iounmap(regs); 373 iounmap(regs);
374} 374}
375 375
376static struct mvs_info *__devinit mvs_pci_alloc(struct pci_dev *pdev, 376static struct mvs_info *mvs_pci_alloc(struct pci_dev *pdev,
377 const struct pci_device_id *ent, 377 const struct pci_device_id *ent,
378 struct Scsi_Host *shost, unsigned int id) 378 struct Scsi_Host *shost, unsigned int id)
379{ 379{
@@ -444,7 +444,7 @@ static int pci_go_64(struct pci_dev *pdev)
444 return rc; 444 return rc;
445} 445}
446 446
447static int __devinit mvs_prep_sas_ha_init(struct Scsi_Host *shost, 447static int mvs_prep_sas_ha_init(struct Scsi_Host *shost,
448 const struct mvs_chip_info *chip_info) 448 const struct mvs_chip_info *chip_info)
449{ 449{
450 int phy_nr, port_nr; unsigned short core_nr; 450 int phy_nr, port_nr; unsigned short core_nr;
@@ -486,7 +486,7 @@ exit_free:
486 486
487} 487}
488 488
489static void __devinit mvs_post_sas_ha_init(struct Scsi_Host *shost, 489static void mvs_post_sas_ha_init(struct Scsi_Host *shost,
490 const struct mvs_chip_info *chip_info) 490 const struct mvs_chip_info *chip_info)
491{ 491{
492 int can_queue, i = 0, j = 0; 492 int can_queue, i = 0, j = 0;
@@ -537,8 +537,7 @@ static void mvs_init_sas_add(struct mvs_info *mvi)
537 memcpy(mvi->sas_addr, &mvi->phy[0].dev_sas_addr, SAS_ADDR_SIZE); 537 memcpy(mvi->sas_addr, &mvi->phy[0].dev_sas_addr, SAS_ADDR_SIZE);
538} 538}
539 539
540static int __devinit mvs_pci_init(struct pci_dev *pdev, 540static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent)
541 const struct pci_device_id *ent)
542{ 541{
543 unsigned int rc, nhost = 0; 542 unsigned int rc, nhost = 0;
544 struct mvs_info *mvi; 543 struct mvs_info *mvi;
@@ -645,7 +644,7 @@ err_out_enable:
645 return rc; 644 return rc;
646} 645}
647 646
648static void __devexit mvs_pci_remove(struct pci_dev *pdev) 647static void mvs_pci_remove(struct pci_dev *pdev)
649{ 648{
650 unsigned short core_nr, i = 0; 649 unsigned short core_nr, i = 0;
651 struct sas_ha_struct *sha = pci_get_drvdata(pdev); 650 struct sas_ha_struct *sha = pci_get_drvdata(pdev);
@@ -677,7 +676,7 @@ static void __devexit mvs_pci_remove(struct pci_dev *pdev)
677 return; 676 return;
678} 677}
679 678
680static struct pci_device_id __devinitdata mvs_pci_table[] = { 679static struct pci_device_id mvs_pci_table[] = {
681 { PCI_VDEVICE(MARVELL, 0x6320), chip_6320 }, 680 { PCI_VDEVICE(MARVELL, 0x6320), chip_6320 },
682 { PCI_VDEVICE(MARVELL, 0x6340), chip_6440 }, 681 { PCI_VDEVICE(MARVELL, 0x6340), chip_6440 },
683 { 682 {
@@ -748,7 +747,7 @@ static struct pci_driver mvs_pci_driver = {
748 .name = DRV_NAME, 747 .name = DRV_NAME,
749 .id_table = mvs_pci_table, 748 .id_table = mvs_pci_table,
750 .probe = mvs_pci_init, 749 .probe = mvs_pci_init,
751 .remove = __devexit_p(mvs_pci_remove), 750 .remove = mvs_pci_remove,
752}; 751};
753 752
754static ssize_t 753static ssize_t
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index a3776d6ced6..078c63913b5 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -220,8 +220,8 @@ int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
220 return rc; 220 return rc;
221} 221}
222 222
223void __devinit mvs_set_sas_addr(struct mvs_info *mvi, int port_id, 223void mvs_set_sas_addr(struct mvs_info *mvi, int port_id, u32 off_lo,
224 u32 off_lo, u32 off_hi, u64 sas_addr) 224 u32 off_hi, u64 sas_addr)
225{ 225{
226 u32 lo = (u32)sas_addr; 226 u32 lo = (u32)sas_addr;
227 u32 hi = (u32)(sas_addr>>32); 227 u32 hi = (u32)(sas_addr>>32);
diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h
index da249553858..2ae77a0394b 100644
--- a/drivers/scsi/mvsas/mv_sas.h
+++ b/drivers/scsi/mvsas/mv_sas.h
@@ -456,8 +456,8 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex);
456void mvs_phys_reset(struct mvs_info *mvi, u32 phy_mask, int hard); 456void mvs_phys_reset(struct mvs_info *mvi, u32 phy_mask, int hard);
457int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, 457int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
458 void *funcdata); 458 void *funcdata);
459void __devinit mvs_set_sas_addr(struct mvs_info *mvi, int port_id, 459void mvs_set_sas_addr(struct mvs_info *mvi, int port_id, u32 off_lo,
460 u32 off_lo, u32 off_hi, u64 sas_addr); 460 u32 off_hi, u64 sas_addr);
461void mvs_scan_start(struct Scsi_Host *shost); 461void mvs_scan_start(struct Scsi_Host *shost);
462int mvs_scan_finished(struct Scsi_Host *shost, unsigned long time); 462int mvs_scan_finished(struct Scsi_Host *shost, unsigned long time);
463int mvs_queue_command(struct sas_task *task, const int num, 463int mvs_queue_command(struct sas_task *task, const int num,
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index c585a925b3c..4594ccaaf49 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2506,8 +2506,7 @@ fail_add_device:
2506 * @pdev: PCI device structure 2506 * @pdev: PCI device structure
2507 * @id: PCI ids of supported hotplugged adapter 2507 * @id: PCI ids of supported hotplugged adapter
2508 */ 2508 */
2509static int __devinit mvumi_probe_one(struct pci_dev *pdev, 2509static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2510 const struct pci_device_id *id)
2511{ 2510{
2512 struct Scsi_Host *host; 2511 struct Scsi_Host *host;
2513 struct mvumi_hba *mhba; 2512 struct mvumi_hba *mhba;
@@ -2728,7 +2727,7 @@ static struct pci_driver mvumi_pci_driver = {
2728 .name = MV_DRIVER_NAME, 2727 .name = MV_DRIVER_NAME,
2729 .id_table = mvumi_pci_table, 2728 .id_table = mvumi_pci_table,
2730 .probe = mvumi_probe_one, 2729 .probe = mvumi_probe_one,
2731 .remove = __devexit_p(mvumi_detach_one), 2730 .remove = mvumi_detach_one,
2732 .shutdown = mvumi_shutdown, 2731 .shutdown = mvumi_shutdown,
2733#ifdef CONFIG_PM 2732#ifdef CONFIG_PM
2734 .suspend = mvumi_suspend, 2733 .suspend = mvumi_suspend,
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 62b616891a3..1cc0c1c69c8 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -76,7 +76,7 @@ static const char *nsp32_release_version = "1.2";
76/**************************************************************************** 76/****************************************************************************
77 * Supported hardware 77 * Supported hardware
78 */ 78 */
79static struct pci_device_id nsp32_pci_table[] __devinitdata = { 79static struct pci_device_id nsp32_pci_table[] = {
80 { 80 {
81 .vendor = PCI_VENDOR_ID_IODATA, 81 .vendor = PCI_VENDOR_ID_IODATA,
82 .device = PCI_DEVICE_ID_NINJASCSI_32BI_CBSC_II, 82 .device = PCI_DEVICE_ID_NINJASCSI_32BI_CBSC_II,
@@ -186,10 +186,10 @@ static nsp32_sync_table nsp32_sync_table_pci[] = {
186 * function declaration 186 * function declaration
187 */ 187 */
188/* module entry point */ 188/* module entry point */
189static int __devinit nsp32_probe (struct pci_dev *, const struct pci_device_id *); 189static int nsp32_probe (struct pci_dev *, const struct pci_device_id *);
190static void __devexit nsp32_remove(struct pci_dev *); 190static void nsp32_remove(struct pci_dev *);
191static int __init init_nsp32 (void); 191static int __init init_nsp32 (void);
192static void __exit exit_nsp32 (void); 192static void __exit exit_nsp32 (void);
193 193
194/* struct struct scsi_host_template */ 194/* struct struct scsi_host_template */
195static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 195static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int);
@@ -3382,7 +3382,7 @@ static int nsp32_resume(struct pci_dev *pdev)
3382/************************************************************************ 3382/************************************************************************
3383 * PCI/Cardbus probe/remove routine 3383 * PCI/Cardbus probe/remove routine
3384 */ 3384 */
3385static int __devinit nsp32_probe(struct pci_dev *pdev, const struct pci_device_id *id) 3385static int nsp32_probe(struct pci_dev *pdev, const struct pci_device_id *id)
3386{ 3386{
3387 int ret; 3387 int ret;
3388 nsp32_hw_data *data = &nsp32_data_base; 3388 nsp32_hw_data *data = &nsp32_data_base;
@@ -3418,7 +3418,7 @@ static int __devinit nsp32_probe(struct pci_dev *pdev, const struct pci_device_i
3418 return ret; 3418 return ret;
3419} 3419}
3420 3420
3421static void __devexit nsp32_remove(struct pci_dev *pdev) 3421static void nsp32_remove(struct pci_dev *pdev)
3422{ 3422{
3423 struct Scsi_Host *host = pci_get_drvdata(pdev); 3423 struct Scsi_Host *host = pci_get_drvdata(pdev);
3424 3424
@@ -3435,7 +3435,7 @@ static struct pci_driver nsp32_driver = {
3435 .name = "nsp32", 3435 .name = "nsp32",
3436 .id_table = nsp32_pci_table, 3436 .id_table = nsp32_pci_table,
3437 .probe = nsp32_probe, 3437 .probe = nsp32_probe,
3438 .remove = __devexit_p(nsp32_remove), 3438 .remove = nsp32_remove,
3439#ifdef CONFIG_PM 3439#ifdef CONFIG_PM
3440 .suspend = nsp32_suspend, 3440 .suspend = nsp32_suspend,
3441 .resume = nsp32_resume, 3441 .resume = nsp32_resume,
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index bf54aafc2d7..b8dd05074ab 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -47,7 +47,7 @@
47 * read_main_config_table - read the configure table and save it. 47 * read_main_config_table - read the configure table and save it.
48 * @pm8001_ha: our hba card information 48 * @pm8001_ha: our hba card information
49 */ 49 */
50static void __devinit read_main_config_table(struct pm8001_hba_info *pm8001_ha) 50static void read_main_config_table(struct pm8001_hba_info *pm8001_ha)
51{ 51{
52 void __iomem *address = pm8001_ha->main_cfg_tbl_addr; 52 void __iomem *address = pm8001_ha->main_cfg_tbl_addr;
53 pm8001_ha->main_cfg_tbl.signature = pm8001_mr32(address, 0x00); 53 pm8001_ha->main_cfg_tbl.signature = pm8001_mr32(address, 0x00);
@@ -83,8 +83,7 @@ static void __devinit read_main_config_table(struct pm8001_hba_info *pm8001_ha)
83 * read_general_status_table - read the general status table and save it. 83 * read_general_status_table - read the general status table and save it.
84 * @pm8001_ha: our hba card information 84 * @pm8001_ha: our hba card information
85 */ 85 */
86static void __devinit 86static void read_general_status_table(struct pm8001_hba_info *pm8001_ha)
87read_general_status_table(struct pm8001_hba_info *pm8001_ha)
88{ 87{
89 void __iomem *address = pm8001_ha->general_stat_tbl_addr; 88 void __iomem *address = pm8001_ha->general_stat_tbl_addr;
90 pm8001_ha->gs_tbl.gst_len_mpistate = pm8001_mr32(address, 0x00); 89 pm8001_ha->gs_tbl.gst_len_mpistate = pm8001_mr32(address, 0x00);
@@ -118,8 +117,7 @@ read_general_status_table(struct pm8001_hba_info *pm8001_ha)
118 * read_inbnd_queue_table - read the inbound queue table and save it. 117 * read_inbnd_queue_table - read the inbound queue table and save it.
119 * @pm8001_ha: our hba card information 118 * @pm8001_ha: our hba card information
120 */ 119 */
121static void __devinit 120static void read_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
122read_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
123{ 121{
124 int inbQ_num = 1; 122 int inbQ_num = 1;
125 int i; 123 int i;
@@ -137,8 +135,7 @@ read_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
137 * read_outbnd_queue_table - read the outbound queue table and save it. 135 * read_outbnd_queue_table - read the outbound queue table and save it.
138 * @pm8001_ha: our hba card information 136 * @pm8001_ha: our hba card information
139 */ 137 */
140static void __devinit 138static void read_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
141read_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
142{ 139{
143 int outbQ_num = 1; 140 int outbQ_num = 1;
144 int i; 141 int i;
@@ -156,8 +153,7 @@ read_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
156 * init_default_table_values - init the default table. 153 * init_default_table_values - init the default table.
157 * @pm8001_ha: our hba card information 154 * @pm8001_ha: our hba card information
158 */ 155 */
159static void __devinit 156static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
160init_default_table_values(struct pm8001_hba_info *pm8001_ha)
161{ 157{
162 int qn = 1; 158 int qn = 1;
163 int i; 159 int i;
@@ -250,8 +246,7 @@ init_default_table_values(struct pm8001_hba_info *pm8001_ha)
250 * update_main_config_table - update the main default table to the HBA. 246 * update_main_config_table - update the main default table to the HBA.
251 * @pm8001_ha: our hba card information 247 * @pm8001_ha: our hba card information
252 */ 248 */
253static void __devinit 249static void update_main_config_table(struct pm8001_hba_info *pm8001_ha)
254update_main_config_table(struct pm8001_hba_info *pm8001_ha)
255{ 250{
256 void __iomem *address = pm8001_ha->main_cfg_tbl_addr; 251 void __iomem *address = pm8001_ha->main_cfg_tbl_addr;
257 pm8001_mw32(address, 0x24, 252 pm8001_mw32(address, 0x24,
@@ -297,8 +292,8 @@ update_main_config_table(struct pm8001_hba_info *pm8001_ha)
297 * update_inbnd_queue_table - update the inbound queue table to the HBA. 292 * update_inbnd_queue_table - update the inbound queue table to the HBA.
298 * @pm8001_ha: our hba card information 293 * @pm8001_ha: our hba card information
299 */ 294 */
300static void __devinit 295static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
301update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha, int number) 296 int number)
302{ 297{
303 void __iomem *address = pm8001_ha->inbnd_q_tbl_addr; 298 void __iomem *address = pm8001_ha->inbnd_q_tbl_addr;
304 u16 offset = number * 0x20; 299 u16 offset = number * 0x20;
@@ -318,8 +313,8 @@ update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha, int number)
318 * update_outbnd_queue_table - update the outbound queue table to the HBA. 313 * update_outbnd_queue_table - update the outbound queue table to the HBA.
319 * @pm8001_ha: our hba card information 314 * @pm8001_ha: our hba card information
320 */ 315 */
321static void __devinit 316static void update_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
322update_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha, int number) 317 int number)
323{ 318{
324 void __iomem *address = pm8001_ha->outbnd_q_tbl_addr; 319 void __iomem *address = pm8001_ha->outbnd_q_tbl_addr;
325 u16 offset = number * 0x24; 320 u16 offset = number * 0x24;
@@ -370,8 +365,8 @@ int pm8001_bar4_shift(struct pm8001_hba_info *pm8001_ha, u32 shiftValue)
370 * @pm8001_ha: our hba card information 365 * @pm8001_ha: our hba card information
371 * @SSCbit: set SSCbit to 0 to disable all phys ssc; 1 to enable all phys ssc. 366 * @SSCbit: set SSCbit to 0 to disable all phys ssc; 1 to enable all phys ssc.
372 */ 367 */
373static void __devinit 368static void mpi_set_phys_g3_with_ssc(struct pm8001_hba_info *pm8001_ha,
374mpi_set_phys_g3_with_ssc(struct pm8001_hba_info *pm8001_ha, u32 SSCbit) 369 u32 SSCbit)
375{ 370{
376 u32 value, offset, i; 371 u32 value, offset, i;
377 unsigned long flags; 372 unsigned long flags;
@@ -438,9 +433,8 @@ mpi_set_phys_g3_with_ssc(struct pm8001_hba_info *pm8001_ha, u32 SSCbit)
438 * @pm8001_ha: our hba card information 433 * @pm8001_ha: our hba card information
439 * @interval - interval time for each OPEN_REJECT (RETRY). The units are in 1us. 434 * @interval - interval time for each OPEN_REJECT (RETRY). The units are in 1us.
440 */ 435 */
441static void __devinit 436static void mpi_set_open_retry_interval_reg(struct pm8001_hba_info *pm8001_ha,
442mpi_set_open_retry_interval_reg(struct pm8001_hba_info *pm8001_ha, 437 u32 interval)
443 u32 interval)
444{ 438{
445 u32 offset; 439 u32 offset;
446 u32 value; 440 u32 value;
@@ -601,7 +595,7 @@ static void init_pci_device_addresses(struct pm8001_hba_info *pm8001_ha)
601 * pm8001_chip_init - the main init function that initialize whole PM8001 chip. 595 * pm8001_chip_init - the main init function that initialize whole PM8001 chip.
602 * @pm8001_ha: our hba card information 596 * @pm8001_ha: our hba card information
603 */ 597 */
604static int __devinit pm8001_chip_init(struct pm8001_hba_info *pm8001_ha) 598static int pm8001_chip_init(struct pm8001_hba_info *pm8001_ha)
605{ 599{
606 /* check the firmware status */ 600 /* check the firmware status */
607 if (-1 == check_fw_ready(pm8001_ha)) { 601 if (-1 == check_fw_ready(pm8001_ha)) {
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 0267c22f874..4c9fe733fe8 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -104,8 +104,7 @@ static struct sas_domain_function_template pm8001_transport_ops = {
104 *@pm8001_ha: our hba structure. 104 *@pm8001_ha: our hba structure.
105 *@phy_id: phy id. 105 *@phy_id: phy id.
106 */ 106 */
107static void __devinit pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, 107static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id)
108 int phy_id)
109{ 108{
110 struct pm8001_phy *phy = &pm8001_ha->phy[phy_id]; 109 struct pm8001_phy *phy = &pm8001_ha->phy[phy_id];
111 struct asd_sas_phy *sas_phy = &phy->sas_phy; 110 struct asd_sas_phy *sas_phy = &phy->sas_phy;
@@ -195,7 +194,7 @@ static irqreturn_t pm8001_interrupt(int irq, void *opaque)
195 * @pm8001_ha:our hba structure. 194 * @pm8001_ha:our hba structure.
196 * 195 *
197 */ 196 */
198static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha) 197static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha)
199{ 198{
200 int i; 199 int i;
201 spin_lock_init(&pm8001_ha->lock); 200 spin_lock_init(&pm8001_ha->lock);
@@ -360,8 +359,9 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
360 * @ent: ent 359 * @ent: ent
361 * @shost: scsi host struct which has been initialized before. 360 * @shost: scsi host struct which has been initialized before.
362 */ 361 */
363static struct pm8001_hba_info *__devinit 362static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev,
364pm8001_pci_alloc(struct pci_dev *pdev, u32 chip_id, struct Scsi_Host *shost) 363 u32 chip_id,
364 struct Scsi_Host *shost)
365{ 365{
366 struct pm8001_hba_info *pm8001_ha; 366 struct pm8001_hba_info *pm8001_ha;
367 struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost); 367 struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
@@ -433,8 +433,8 @@ static int pci_go_44(struct pci_dev *pdev)
433 * @shost: scsi host which has been allocated outside. 433 * @shost: scsi host which has been allocated outside.
434 * @chip_info: our ha struct. 434 * @chip_info: our ha struct.
435 */ 435 */
436static int __devinit pm8001_prep_sas_ha_init(struct Scsi_Host * shost, 436static int pm8001_prep_sas_ha_init(struct Scsi_Host *shost,
437 const struct pm8001_chip_info *chip_info) 437 const struct pm8001_chip_info *chip_info)
438{ 438{
439 int phy_nr, port_nr; 439 int phy_nr, port_nr;
440 struct asd_sas_phy **arr_phy; 440 struct asd_sas_phy **arr_phy;
@@ -479,8 +479,8 @@ exit:
479 * @shost: scsi host which has been allocated outside 479 * @shost: scsi host which has been allocated outside
480 * @chip_info: our ha struct. 480 * @chip_info: our ha struct.
481 */ 481 */
482static void __devinit pm8001_post_sas_ha_init(struct Scsi_Host *shost, 482static void pm8001_post_sas_ha_init(struct Scsi_Host *shost,
483 const struct pm8001_chip_info *chip_info) 483 const struct pm8001_chip_info *chip_info)
484{ 484{
485 int i = 0; 485 int i = 0;
486 struct pm8001_hba_info *pm8001_ha; 486 struct pm8001_hba_info *pm8001_ha;
@@ -615,8 +615,8 @@ intx:
615 * pci driver it is invoked, all struct an hardware initilization should be done 615 * pci driver it is invoked, all struct an hardware initilization should be done
616 * here, also, register interrupt 616 * here, also, register interrupt
617 */ 617 */
618static int __devinit pm8001_pci_probe(struct pci_dev *pdev, 618static int pm8001_pci_probe(struct pci_dev *pdev,
619 const struct pci_device_id *ent) 619 const struct pci_device_id *ent)
620{ 620{
621 unsigned int rc; 621 unsigned int rc;
622 u32 pci_reg; 622 u32 pci_reg;
@@ -707,7 +707,7 @@ err_out_enable:
707 return rc; 707 return rc;
708} 708}
709 709
710static void __devexit pm8001_pci_remove(struct pci_dev *pdev) 710static void pm8001_pci_remove(struct pci_dev *pdev)
711{ 711{
712 struct sas_ha_struct *sha = pci_get_drvdata(pdev); 712 struct sas_ha_struct *sha = pci_get_drvdata(pdev);
713 struct pm8001_hba_info *pm8001_ha; 713 struct pm8001_hba_info *pm8001_ha;
@@ -842,7 +842,7 @@ err_out_enable:
842 return rc; 842 return rc;
843} 843}
844 844
845static struct pci_device_id __devinitdata pm8001_pci_table[] = { 845static struct pci_device_id pm8001_pci_table[] = {
846 { 846 {
847 PCI_VDEVICE(PMC_Sierra, 0x8001), chip_8001 847 PCI_VDEVICE(PMC_Sierra, 0x8001), chip_8001
848 }, 848 },
@@ -857,7 +857,7 @@ static struct pci_driver pm8001_pci_driver = {
857 .name = DRV_NAME, 857 .name = DRV_NAME,
858 .id_table = pm8001_pci_table, 858 .id_table = pm8001_pci_table,
859 .probe = pm8001_pci_probe, 859 .probe = pm8001_pci_probe,
860 .remove = __devexit_p(pm8001_pci_remove), 860 .remove = pm8001_pci_remove,
861 .suspend = pm8001_pci_suspend, 861 .suspend = pm8001_pci_suspend,
862 .resume = pm8001_pci_resume, 862 .resume = pm8001_pci_resume,
863}; 863};
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index af763eab203..b46f5e90683 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -125,7 +125,7 @@ static struct pmcraid_chip_details pmcraid_chip_cfg[] = {
125/* 125/*
126 * PCI device ids supported by pmcraid driver 126 * PCI device ids supported by pmcraid driver
127 */ 127 */
128static struct pci_device_id pmcraid_pci_table[] __devinitdata = { 128static struct pci_device_id pmcraid_pci_table[] = {
129 { PCI_DEVICE(PCI_VENDOR_ID_PMC, PCI_DEVICE_ID_PMC_MAXRAID), 129 { PCI_DEVICE(PCI_VENDOR_ID_PMC, PCI_DEVICE_ID_PMC_MAXRAID),
130 0, 0, (kernel_ulong_t)&pmcraid_chip_cfg[0] 130 0, 0, (kernel_ulong_t)&pmcraid_chip_cfg[0]
131 }, 131 },
@@ -4818,8 +4818,7 @@ pmcraid_release_control_blocks(
4818 * Return Value 4818 * Return Value
4819 * 0 in case of success; -ENOMEM in case of failure 4819 * 0 in case of success; -ENOMEM in case of failure
4820 */ 4820 */
4821static int __devinit 4821static int pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance)
4822pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance)
4823{ 4822{
4824 int i; 4823 int i;
4825 4824
@@ -4855,8 +4854,7 @@ pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance)
4855 * Return Value 4854 * Return Value
4856 * 0 in case it can allocate all control blocks, otherwise -ENOMEM 4855 * 0 in case it can allocate all control blocks, otherwise -ENOMEM
4857 */ 4856 */
4858static int __devinit 4857static int pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance)
4859pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance)
4860{ 4858{
4861 int i; 4859 int i;
4862 4860
@@ -4922,8 +4920,7 @@ pmcraid_release_host_rrqs(struct pmcraid_instance *pinstance, int maxindex)
4922 * Return value 4920 * Return value
4923 * 0 hrrq buffers are allocated, -ENOMEM otherwise. 4921 * 0 hrrq buffers are allocated, -ENOMEM otherwise.
4924 */ 4922 */
4925static int __devinit 4923static int pmcraid_allocate_host_rrqs(struct pmcraid_instance *pinstance)
4926pmcraid_allocate_host_rrqs(struct pmcraid_instance *pinstance)
4927{ 4924{
4928 int i, buffer_size; 4925 int i, buffer_size;
4929 4926
@@ -5062,8 +5059,7 @@ static void pmcraid_release_config_buffers(struct pmcraid_instance *pinstance)
5062 * Return Value 5059 * Return Value
5063 * 0 for successful allocation, -ENOMEM for any failure 5060 * 0 for successful allocation, -ENOMEM for any failure
5064 */ 5061 */
5065static int __devinit 5062static int pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance)
5066pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance)
5067{ 5063{
5068 int i; 5064 int i;
5069 5065
@@ -5181,7 +5177,7 @@ static void pmcraid_release_buffers(struct pmcraid_instance *pinstance)
5181 * Return Value 5177 * Return Value
5182 * 0 in case all of the blocks are allocated, -ENOMEM otherwise. 5178 * 0 in case all of the blocks are allocated, -ENOMEM otherwise.
5183 */ 5179 */
5184static int __devinit pmcraid_init_buffers(struct pmcraid_instance *pinstance) 5180static int pmcraid_init_buffers(struct pmcraid_instance *pinstance)
5185{ 5181{
5186 int i; 5182 int i;
5187 5183
@@ -5281,11 +5277,8 @@ static void pmcraid_reinit_buffers(struct pmcraid_instance *pinstance)
5281 * Return Value 5277 * Return Value
5282 * 0 on success, non-zero in case of any failure 5278 * 0 on success, non-zero in case of any failure
5283 */ 5279 */
5284static int __devinit pmcraid_init_instance( 5280static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host,
5285 struct pci_dev *pdev, 5281 void __iomem *mapped_pci_addr)
5286 struct Scsi_Host *host,
5287 void __iomem *mapped_pci_addr
5288)
5289{ 5282{
5290 struct pmcraid_instance *pinstance = 5283 struct pmcraid_instance *pinstance =
5291 (struct pmcraid_instance *)host->hostdata; 5284 (struct pmcraid_instance *)host->hostdata;
@@ -5442,7 +5435,7 @@ static void pmcraid_release_chrdev(struct pmcraid_instance *pinstance)
5442 * Return value 5435 * Return value
5443 * none 5436 * none
5444 */ 5437 */
5445static void __devexit pmcraid_remove(struct pci_dev *pdev) 5438static void pmcraid_remove(struct pci_dev *pdev)
5446{ 5439{
5447 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); 5440 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev);
5448 5441
@@ -5883,10 +5876,8 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd)
5883 * returns 0 if the device is claimed and successfully configured. 5876 * returns 0 if the device is claimed and successfully configured.
5884 * returns non-zero error code in case of any failure 5877 * returns non-zero error code in case of any failure
5885 */ 5878 */
5886static int __devinit pmcraid_probe( 5879static int pmcraid_probe(struct pci_dev *pdev,
5887 struct pci_dev *pdev, 5880 const struct pci_device_id *dev_id)
5888 const struct pci_device_id *dev_id
5889)
5890{ 5881{
5891 struct pmcraid_instance *pinstance; 5882 struct pmcraid_instance *pinstance;
5892 struct Scsi_Host *host; 5883 struct Scsi_Host *host;
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index 959f10055be..e6e2a30493e 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -359,7 +359,7 @@ static struct scsi_host_template ps3rom_host_template = {
359}; 359};
360 360
361 361
362static int __devinit ps3rom_probe(struct ps3_system_bus_device *_dev) 362static int ps3rom_probe(struct ps3_system_bus_device *_dev)
363{ 363{
364 struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core); 364 struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
365 int error; 365 int error;
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 538230be5cc..5a522c5bbd4 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1438,7 +1438,7 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp)
1438 * Returns: 1438 * Returns:
1439 * 0 = success 1439 * 0 = success
1440 */ 1440 */
1441static int __devinit 1441static int
1442qla1280_initialize_adapter(struct scsi_qla_host *ha) 1442qla1280_initialize_adapter(struct scsi_qla_host *ha)
1443{ 1443{
1444 struct device_reg __iomem *reg; 1444 struct device_reg __iomem *reg;
@@ -4230,7 +4230,7 @@ static struct scsi_host_template qla1280_driver_template = {
4230}; 4230};
4231 4231
4232 4232
4233static int __devinit 4233static int
4234qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 4234qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4235{ 4235{
4236 int devnum = id->driver_data; 4236 int devnum = id->driver_data;
@@ -4399,7 +4399,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4399} 4399}
4400 4400
4401 4401
4402static void __devexit 4402static void
4403qla1280_remove_one(struct pci_dev *pdev) 4403qla1280_remove_one(struct pci_dev *pdev)
4404{ 4404{
4405 struct Scsi_Host *host = pci_get_drvdata(pdev); 4405 struct Scsi_Host *host = pci_get_drvdata(pdev);
@@ -4433,7 +4433,7 @@ static struct pci_driver qla1280_pci_driver = {
4433 .name = "qla1280", 4433 .name = "qla1280",
4434 .id_table = qla1280_pci_tbl, 4434 .id_table = qla1280_pci_tbl,
4435 .probe = qla1280_probe_one, 4435 .probe = qla1280_probe_one,
4436 .remove = __devexit_p(qla1280_remove_one), 4436 .remove = qla1280_remove_one,
4437}; 4437};
4438 4438
4439static int __init 4439static int __init
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3a1661cf8c1..10d23f8b703 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2154,7 +2154,7 @@ qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time)
2154/* 2154/*
2155 * PCI driver interface 2155 * PCI driver interface
2156 */ 2156 */
2157static int __devinit 2157static int
2158qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 2158qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2159{ 2159{
2160 int ret = -ENODEV; 2160 int ret = -ENODEV;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index fbc546e893a..4cec123a6a6 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -5124,8 +5124,8 @@ void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset)
5124 * It returns zero if successful. It also initializes all data necessary for 5124 * It returns zero if successful. It also initializes all data necessary for
5125 * the driver. 5125 * the driver.
5126 **/ 5126 **/
5127static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, 5127static int qla4xxx_probe_adapter(struct pci_dev *pdev,
5128 const struct pci_device_id *ent) 5128 const struct pci_device_id *ent)
5129{ 5129{
5130 int ret = -ENODEV, status; 5130 int ret = -ENODEV, status;
5131 struct Scsi_Host *host; 5131 struct Scsi_Host *host;
@@ -5464,7 +5464,7 @@ static void qla4xxx_destroy_fw_ddb_session(struct scsi_qla_host *ha)
5464 * qla4xxx_remove_adapter - callback function to remove adapter. 5464 * qla4xxx_remove_adapter - callback function to remove adapter.
5465 * @pci_dev: PCI device pointer 5465 * @pci_dev: PCI device pointer
5466 **/ 5466 **/
5467static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev) 5467static void qla4xxx_remove_adapter(struct pci_dev *pdev)
5468{ 5468{
5469 struct scsi_qla_host *ha; 5469 struct scsi_qla_host *ha;
5470 5470
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index 1e874f1fb5c..13d628b56ff 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -142,7 +142,7 @@ module_param_array(irq, int, NULL, 0);
142MODULE_PARM_DESC(iobase, "I/O address"); 142MODULE_PARM_DESC(iobase, "I/O address");
143MODULE_PARM_DESC(irq, "IRQ"); 143MODULE_PARM_DESC(irq, "IRQ");
144 144
145static int __devinit qlogicfas_detect(struct scsi_host_template *sht) 145static int qlogicfas_detect(struct scsi_host_template *sht)
146{ 146{
147 struct Scsi_Host *shost; 147 struct Scsi_Host *shost;
148 struct qlogicfas408_priv *priv; 148 struct qlogicfas408_priv *priv;
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 71fddbc60f1..6d48d30bed0 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -461,7 +461,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
461 461
462#define PTI_RESET_LIMIT 400 462#define PTI_RESET_LIMIT 400
463 463
464static int __devinit qlogicpti_load_firmware(struct qlogicpti *qpti) 464static int qlogicpti_load_firmware(struct qlogicpti *qpti)
465{ 465{
466 const struct firmware *fw; 466 const struct firmware *fw;
467 const char fwname[] = "qlogic/isp1000.bin"; 467 const char fwname[] = "qlogic/isp1000.bin";
@@ -670,7 +670,7 @@ static int qlogicpti_verify_tmon(struct qlogicpti *qpti)
670 670
671static irqreturn_t qpti_intr(int irq, void *dev_id); 671static irqreturn_t qpti_intr(int irq, void *dev_id);
672 672
673static void __devinit qpti_chain_add(struct qlogicpti *qpti) 673static void qpti_chain_add(struct qlogicpti *qpti)
674{ 674{
675 spin_lock_irq(&qptichain_lock); 675 spin_lock_irq(&qptichain_lock);
676 if (qptichain != NULL) { 676 if (qptichain != NULL) {
@@ -686,7 +686,7 @@ static void __devinit qpti_chain_add(struct qlogicpti *qpti)
686 spin_unlock_irq(&qptichain_lock); 686 spin_unlock_irq(&qptichain_lock);
687} 687}
688 688
689static void __devexit qpti_chain_del(struct qlogicpti *qpti) 689static void qpti_chain_del(struct qlogicpti *qpti)
690{ 690{
691 spin_lock_irq(&qptichain_lock); 691 spin_lock_irq(&qptichain_lock);
692 if (qptichain == qpti) { 692 if (qptichain == qpti) {
@@ -701,7 +701,7 @@ static void __devexit qpti_chain_del(struct qlogicpti *qpti)
701 spin_unlock_irq(&qptichain_lock); 701 spin_unlock_irq(&qptichain_lock);
702} 702}
703 703
704static int __devinit qpti_map_regs(struct qlogicpti *qpti) 704static int qpti_map_regs(struct qlogicpti *qpti)
705{ 705{
706 struct platform_device *op = qpti->op; 706 struct platform_device *op = qpti->op;
707 707
@@ -724,7 +724,7 @@ static int __devinit qpti_map_regs(struct qlogicpti *qpti)
724 return 0; 724 return 0;
725} 725}
726 726
727static int __devinit qpti_register_irq(struct qlogicpti *qpti) 727static int qpti_register_irq(struct qlogicpti *qpti)
728{ 728{
729 struct platform_device *op = qpti->op; 729 struct platform_device *op = qpti->op;
730 730
@@ -749,7 +749,7 @@ fail:
749 return -1; 749 return -1;
750} 750}
751 751
752static void __devinit qpti_get_scsi_id(struct qlogicpti *qpti) 752static void qpti_get_scsi_id(struct qlogicpti *qpti)
753{ 753{
754 struct platform_device *op = qpti->op; 754 struct platform_device *op = qpti->op;
755 struct device_node *dp; 755 struct device_node *dp;
@@ -803,7 +803,7 @@ static void qpti_get_clock(struct qlogicpti *qpti)
803/* The request and response queues must each be aligned 803/* The request and response queues must each be aligned
804 * on a page boundary. 804 * on a page boundary.
805 */ 805 */
806static int __devinit qpti_map_queues(struct qlogicpti *qpti) 806static int qpti_map_queues(struct qlogicpti *qpti)
807{ 807{
808 struct platform_device *op = qpti->op; 808 struct platform_device *op = qpti->op;
809 809
@@ -1292,7 +1292,7 @@ static struct scsi_host_template qpti_template = {
1292}; 1292};
1293 1293
1294static const struct of_device_id qpti_match[]; 1294static const struct of_device_id qpti_match[];
1295static int __devinit qpti_sbus_probe(struct platform_device *op) 1295static int qpti_sbus_probe(struct platform_device *op)
1296{ 1296{
1297 struct device_node *dp = op->dev.of_node; 1297 struct device_node *dp = op->dev.of_node;
1298 struct Scsi_Host *host; 1298 struct Scsi_Host *host;
@@ -1402,7 +1402,7 @@ fail_unlink:
1402 return -ENODEV; 1402 return -ENODEV;
1403} 1403}
1404 1404
1405static int __devexit qpti_sbus_remove(struct platform_device *op) 1405static int qpti_sbus_remove(struct platform_device *op)
1406{ 1406{
1407 struct qlogicpti *qpti = dev_get_drvdata(&op->dev); 1407 struct qlogicpti *qpti = dev_get_drvdata(&op->dev);
1408 1408
@@ -1459,7 +1459,7 @@ static struct platform_driver qpti_sbus_driver = {
1459 .of_match_table = qpti_match, 1459 .of_match_table = qpti_match,
1460 }, 1460 },
1461 .probe = qpti_sbus_probe, 1461 .probe = qpti_sbus_probe,
1462 .remove = __devexit_p(qpti_sbus_remove), 1462 .remove = qpti_sbus_remove,
1463}; 1463};
1464 1464
1465static int __init qpti_init(void) 1465static int __init qpti_init(void)
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 3a9d85ca604..a464d959f66 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -226,7 +226,7 @@ static struct scsi_host_template sgiwd93_template = {
226 .use_clustering = DISABLE_CLUSTERING, 226 .use_clustering = DISABLE_CLUSTERING,
227}; 227};
228 228
229static int __devinit sgiwd93_probe(struct platform_device *pdev) 229static int sgiwd93_probe(struct platform_device *pdev)
230{ 230{
231 struct sgiwd93_platform_data *pd = pdev->dev.platform_data; 231 struct sgiwd93_platform_data *pd = pdev->dev.platform_data;
232 unsigned char *wdregs = pd->wdregs; 232 unsigned char *wdregs = pd->wdregs;
@@ -312,7 +312,7 @@ static int __exit sgiwd93_remove(struct platform_device *pdev)
312 312
313static struct platform_driver sgiwd93_driver = { 313static struct platform_driver sgiwd93_driver = {
314 .probe = sgiwd93_probe, 314 .probe = sgiwd93_probe,
315 .remove = __devexit_p(sgiwd93_remove), 315 .remove = sgiwd93_remove,
316 .driver = { 316 .driver = {
317 .name = "sgiwd93", 317 .name = "sgiwd93",
318 .owner = THIS_MODULE, 318 .owner = THIS_MODULE,
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index a318264a4ba..3b3b56f4a83 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -94,9 +94,9 @@ static struct scsi_host_template sim710_driver_template = {
94 .module = THIS_MODULE, 94 .module = THIS_MODULE,
95}; 95};
96 96
97static __devinit int 97static int sim710_probe_common(struct device *dev, unsigned long base_addr,
98sim710_probe_common(struct device *dev, unsigned long base_addr, 98 int irq, int clock, int differential,
99 int irq, int clock, int differential, int scsi_id) 99 int scsi_id)
100{ 100{
101 struct Scsi_Host * host = NULL; 101 struct Scsi_Host * host = NULL;
102 struct NCR_700_Host_Parameters *hostdata = 102 struct NCR_700_Host_Parameters *hostdata =
@@ -153,8 +153,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr,
153 return -ENODEV; 153 return -ENODEV;
154} 154}
155 155
156static __devexit int 156static int sim710_device_remove(struct device *dev)
157sim710_device_remove(struct device *dev)
158{ 157{
159 struct Scsi_Host *host = dev_get_drvdata(dev); 158 struct Scsi_Host *host = dev_get_drvdata(dev);
160 struct NCR_700_Host_Parameters *hostdata = 159 struct NCR_700_Host_Parameters *hostdata =
@@ -221,7 +220,7 @@ static struct eisa_driver sim710_eisa_driver = {
221 .driver = { 220 .driver = {
222 .name = "sim710", 221 .name = "sim710",
223 .probe = sim710_eisa_probe, 222 .probe = sim710_eisa_probe,
224 .remove = __devexit_p(sim710_device_remove), 223 .remove = sim710_device_remove,
225 }, 224 },
226}; 225};
227#endif /* CONFIG_EISA */ 226#endif /* CONFIG_EISA */
diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index cf51432f8e7..52d54e7425d 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -65,7 +65,7 @@ static struct scsi_host_template snirm710_template = {
65 .module = THIS_MODULE, 65 .module = THIS_MODULE,
66}; 66};
67 67
68static int __devinit snirm710_probe(struct platform_device *dev) 68static int snirm710_probe(struct platform_device *dev)
69{ 69{
70 unsigned long base; 70 unsigned long base;
71 struct NCR_700_Host_Parameters *hostdata; 71 struct NCR_700_Host_Parameters *hostdata;
@@ -134,7 +134,7 @@ static int __exit snirm710_driver_remove(struct platform_device *dev)
134 134
135static struct platform_driver snirm710_driver = { 135static struct platform_driver snirm710_driver = {
136 .probe = snirm710_probe, 136 .probe = snirm710_probe,
137 .remove = __devexit_p(snirm710_driver_remove), 137 .remove = snirm710_driver_remove,
138 .driver = { 138 .driver = {
139 .name = "snirm_53c710", 139 .name = "snirm_53c710",
140 .owner = THIS_MODULE, 140 .owner = THIS_MODULE,
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 606215e54b8..325c31caa6e 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -1540,8 +1540,7 @@ static void stex_free_irq(struct st_hba *hba)
1540 pci_disable_msi(pdev); 1540 pci_disable_msi(pdev);
1541} 1541}
1542 1542
1543static int __devinit 1543static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1544stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1545{ 1544{
1546 struct st_hba *hba; 1545 struct st_hba *hba;
1547 struct Scsi_Host *host; 1546 struct Scsi_Host *host;
@@ -1815,7 +1814,7 @@ static struct pci_driver stex_pci_driver = {
1815 .name = DRV_NAME, 1814 .name = DRV_NAME,
1816 .id_table = stex_pci_tbl, 1815 .id_table = stex_pci_tbl,
1817 .probe = stex_probe, 1816 .probe = stex_probe,
1818 .remove = __devexit_p(stex_remove), 1817 .remove = stex_remove,
1819 .shutdown = stex_shutdown, 1818 .shutdown = stex_shutdown,
1820}; 1819};
1821 1820
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 0621037f027..534eb96fc3a 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -194,7 +194,7 @@ static const struct esp_driver_ops sun3x_esp_ops = {
194 .dma_error = sun3x_esp_dma_error, 194 .dma_error = sun3x_esp_dma_error,
195}; 195};
196 196
197static int __devinit esp_sun3x_probe(struct platform_device *dev) 197static int esp_sun3x_probe(struct platform_device *dev)
198{ 198{
199 struct scsi_host_template *tpnt = &scsi_esp_template; 199 struct scsi_host_template *tpnt = &scsi_esp_template;
200 struct Scsi_Host *host; 200 struct Scsi_Host *host;
@@ -268,7 +268,7 @@ fail:
268 return err; 268 return err;
269} 269}
270 270
271static int __devexit esp_sun3x_remove(struct platform_device *dev) 271static int esp_sun3x_remove(struct platform_device *dev)
272{ 272{
273 struct esp *esp = dev_get_drvdata(&dev->dev); 273 struct esp *esp = dev_get_drvdata(&dev->dev);
274 unsigned int irq = esp->host->irq; 274 unsigned int irq = esp->host->irq;
@@ -292,7 +292,7 @@ static int __devexit esp_sun3x_remove(struct platform_device *dev)
292 292
293static struct platform_driver esp_sun3x_driver = { 293static struct platform_driver esp_sun3x_driver = {
294 .probe = esp_sun3x_probe, 294 .probe = esp_sun3x_probe,
295 .remove = __devexit_p(esp_sun3x_remove), 295 .remove = esp_sun3x_remove,
296 .driver = { 296 .driver = {
297 .name = "sun3x_esp", 297 .name = "sun3x_esp",
298 .owner = THIS_MODULE, 298 .owner = THIS_MODULE,
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index 676fe9ac7f6..f2e68459f7e 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -43,8 +43,7 @@ enum dvma_rev {
43 dvmahme 43 dvmahme
44}; 44};
45 45
46static int __devinit esp_sbus_setup_dma(struct esp *esp, 46static int esp_sbus_setup_dma(struct esp *esp, struct platform_device *dma_of)
47 struct platform_device *dma_of)
48{ 47{
49 esp->dma = dma_of; 48 esp->dma = dma_of;
50 49
@@ -79,7 +78,7 @@ static int __devinit esp_sbus_setup_dma(struct esp *esp,
79 78
80} 79}
81 80
82static int __devinit esp_sbus_map_regs(struct esp *esp, int hme) 81static int esp_sbus_map_regs(struct esp *esp, int hme)
83{ 82{
84 struct platform_device *op = esp->dev; 83 struct platform_device *op = esp->dev;
85 struct resource *res; 84 struct resource *res;
@@ -99,7 +98,7 @@ static int __devinit esp_sbus_map_regs(struct esp *esp, int hme)
99 return 0; 98 return 0;
100} 99}
101 100
102static int __devinit esp_sbus_map_command_block(struct esp *esp) 101static int esp_sbus_map_command_block(struct esp *esp)
103{ 102{
104 struct platform_device *op = esp->dev; 103 struct platform_device *op = esp->dev;
105 104
@@ -111,7 +110,7 @@ static int __devinit esp_sbus_map_command_block(struct esp *esp)
111 return 0; 110 return 0;
112} 111}
113 112
114static int __devinit esp_sbus_register_irq(struct esp *esp) 113static int esp_sbus_register_irq(struct esp *esp)
115{ 114{
116 struct Scsi_Host *host = esp->host; 115 struct Scsi_Host *host = esp->host;
117 struct platform_device *op = esp->dev; 116 struct platform_device *op = esp->dev;
@@ -120,7 +119,7 @@ static int __devinit esp_sbus_register_irq(struct esp *esp)
120 return request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp); 119 return request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp);
121} 120}
122 121
123static void __devinit esp_get_scsi_id(struct esp *esp, struct platform_device *espdma) 122static void esp_get_scsi_id(struct esp *esp, struct platform_device *espdma)
124{ 123{
125 struct platform_device *op = esp->dev; 124 struct platform_device *op = esp->dev;
126 struct device_node *dp; 125 struct device_node *dp;
@@ -142,7 +141,7 @@ done:
142 esp->scsi_id_mask = (1 << esp->scsi_id); 141 esp->scsi_id_mask = (1 << esp->scsi_id);
143} 142}
144 143
145static void __devinit esp_get_differential(struct esp *esp) 144static void esp_get_differential(struct esp *esp)
146{ 145{
147 struct platform_device *op = esp->dev; 146 struct platform_device *op = esp->dev;
148 struct device_node *dp; 147 struct device_node *dp;
@@ -154,7 +153,7 @@ static void __devinit esp_get_differential(struct esp *esp)
154 esp->flags &= ~ESP_FLAG_DIFFERENTIAL; 153 esp->flags &= ~ESP_FLAG_DIFFERENTIAL;
155} 154}
156 155
157static void __devinit esp_get_clock_params(struct esp *esp) 156static void esp_get_clock_params(struct esp *esp)
158{ 157{
159 struct platform_device *op = esp->dev; 158 struct platform_device *op = esp->dev;
160 struct device_node *bus_dp, *dp; 159 struct device_node *bus_dp, *dp;
@@ -170,7 +169,7 @@ static void __devinit esp_get_clock_params(struct esp *esp)
170 esp->cfreq = fmhz; 169 esp->cfreq = fmhz;
171} 170}
172 171
173static void __devinit esp_get_bursts(struct esp *esp, struct platform_device *dma_of) 172static void esp_get_bursts(struct esp *esp, struct platform_device *dma_of)
174{ 173{
175 struct device_node *dma_dp = dma_of->dev.of_node; 174 struct device_node *dma_dp = dma_of->dev.of_node;
176 struct platform_device *op = esp->dev; 175 struct platform_device *op = esp->dev;
@@ -195,7 +194,7 @@ static void __devinit esp_get_bursts(struct esp *esp, struct platform_device *dm
195 esp->bursts = bursts; 194 esp->bursts = bursts;
196} 195}
197 196
198static void __devinit esp_sbus_get_props(struct esp *esp, struct platform_device *espdma) 197static void esp_sbus_get_props(struct esp *esp, struct platform_device *espdma)
199{ 198{
200 esp_get_scsi_id(esp, espdma); 199 esp_get_scsi_id(esp, espdma);
201 esp_get_differential(esp); 200 esp_get_differential(esp);
@@ -487,9 +486,8 @@ static const struct esp_driver_ops sbus_esp_ops = {
487 .dma_error = sbus_esp_dma_error, 486 .dma_error = sbus_esp_dma_error,
488}; 487};
489 488
490static int __devinit esp_sbus_probe_one(struct platform_device *op, 489static int esp_sbus_probe_one(struct platform_device *op,
491 struct platform_device *espdma, 490 struct platform_device *espdma, int hme)
492 int hme)
493{ 491{
494 struct scsi_host_template *tpnt = &scsi_esp_template; 492 struct scsi_host_template *tpnt = &scsi_esp_template;
495 struct Scsi_Host *host; 493 struct Scsi_Host *host;
@@ -562,7 +560,7 @@ fail:
562 return err; 560 return err;
563} 561}
564 562
565static int __devinit esp_sbus_probe(struct platform_device *op) 563static int esp_sbus_probe(struct platform_device *op)
566{ 564{
567 struct device_node *dma_node = NULL; 565 struct device_node *dma_node = NULL;
568 struct device_node *dp = op->dev.of_node; 566 struct device_node *dp = op->dev.of_node;
@@ -585,7 +583,7 @@ static int __devinit esp_sbus_probe(struct platform_device *op)
585 return esp_sbus_probe_one(op, dma_of, hme); 583 return esp_sbus_probe_one(op, dma_of, hme);
586} 584}
587 585
588static int __devexit esp_sbus_remove(struct platform_device *op) 586static int esp_sbus_remove(struct platform_device *op)
589{ 587{
590 struct esp *esp = dev_get_drvdata(&op->dev); 588 struct esp *esp = dev_get_drvdata(&op->dev);
591 struct platform_device *dma_of = esp->dma; 589 struct platform_device *dma_of = esp->dma;
@@ -639,7 +637,7 @@ static struct platform_driver esp_sbus_driver = {
639 .of_match_table = esp_match, 637 .of_match_table = esp_match,
640 }, 638 },
641 .probe = esp_sbus_probe, 639 .probe = esp_sbus_probe,
642 .remove = __devexit_p(esp_sbus_remove), 640 .remove = esp_sbus_remove,
643}; 641};
644 642
645static int __init sunesp_init(void) 643static int __init sunesp_init(void)
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index ac4eca6a532..0b7819f3e09 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -581,7 +581,7 @@ static int sym53c416_test(int base)
581} 581}
582 582
583 583
584static struct isapnp_device_id id_table[] __devinitdata = { 584static struct isapnp_device_id id_table[] = {
585 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, 585 { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
586 ISAPNP_VENDOR('S','L','I'), ISAPNP_FUNCTION(0x4161), 0 }, 586 ISAPNP_VENDOR('S','L','I'), ISAPNP_FUNCTION(0x4161), 0 },
587 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, 587 { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index e2b8e68b57e..599568299fb 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1284,8 +1284,7 @@ static int sym53c8xx_proc_info(struct Scsi_Host *shost, char *buffer,
1284 * sym_free_resources() should be used instead of this function after calling 1284 * sym_free_resources() should be used instead of this function after calling
1285 * sym_attach(). 1285 * sym_attach().
1286 */ 1286 */
1287static void __devinit 1287static void sym_iounmap_device(struct sym_device *device)
1288sym_iounmap_device(struct sym_device *device)
1289{ 1288{
1290 if (device->s.ioaddr) 1289 if (device->s.ioaddr)
1291 pci_iounmap(device->pdev, device->s.ioaddr); 1290 pci_iounmap(device->pdev, device->s.ioaddr);
@@ -1325,8 +1324,8 @@ static void sym_free_resources(struct sym_hcb *np, struct pci_dev *pdev,
1325 * If all is OK, install interrupt handling and 1324 * If all is OK, install interrupt handling and
1326 * start the timer daemon. 1325 * start the timer daemon.
1327 */ 1326 */
1328static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt, 1327static struct Scsi_Host *sym_attach(struct scsi_host_template *tpnt, int unit,
1329 int unit, struct sym_device *dev) 1328 struct sym_device *dev)
1330{ 1329{
1331 struct sym_data *sym_data; 1330 struct sym_data *sym_data;
1332 struct sym_hcb *np = NULL; 1331 struct sym_hcb *np = NULL;
@@ -1481,7 +1480,7 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
1481 * Detect and try to read SYMBIOS and TEKRAM NVRAM. 1480 * Detect and try to read SYMBIOS and TEKRAM NVRAM.
1482 */ 1481 */
1483#if SYM_CONF_NVRAM_SUPPORT 1482#if SYM_CONF_NVRAM_SUPPORT
1484static void __devinit sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp) 1483static void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)
1485{ 1484{
1486 devp->nvram = nvp; 1485 devp->nvram = nvp;
1487 nvp->type = 0; 1486 nvp->type = 0;
@@ -1494,7 +1493,7 @@ static inline void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)
1494} 1493}
1495#endif /* SYM_CONF_NVRAM_SUPPORT */ 1494#endif /* SYM_CONF_NVRAM_SUPPORT */
1496 1495
1497static int __devinit sym_check_supported(struct sym_device *device) 1496static int sym_check_supported(struct sym_device *device)
1498{ 1497{
1499 struct sym_chip *chip; 1498 struct sym_chip *chip;
1500 struct pci_dev *pdev = device->pdev; 1499 struct pci_dev *pdev = device->pdev;
@@ -1531,7 +1530,7 @@ static int __devinit sym_check_supported(struct sym_device *device)
1531 * Ignore Symbios chips controlled by various RAID controllers. 1530 * Ignore Symbios chips controlled by various RAID controllers.
1532 * These controllers set value 0x52414944 at RAM end - 16. 1531 * These controllers set value 0x52414944 at RAM end - 16.
1533 */ 1532 */
1534static int __devinit sym_check_raid(struct sym_device *device) 1533static int sym_check_raid(struct sym_device *device)
1535{ 1534{
1536 unsigned int ram_size, ram_val; 1535 unsigned int ram_size, ram_val;
1537 1536
@@ -1552,7 +1551,7 @@ static int __devinit sym_check_raid(struct sym_device *device)
1552 return -ENODEV; 1551 return -ENODEV;
1553} 1552}
1554 1553
1555static int __devinit sym_set_workarounds(struct sym_device *device) 1554static int sym_set_workarounds(struct sym_device *device)
1556{ 1555{
1557 struct sym_chip *chip = &device->chip; 1556 struct sym_chip *chip = &device->chip;
1558 struct pci_dev *pdev = device->pdev; 1557 struct pci_dev *pdev = device->pdev;
@@ -1602,8 +1601,7 @@ static int __devinit sym_set_workarounds(struct sym_device *device)
1602/* 1601/*
1603 * Map HBA registers and on-chip SRAM (if present). 1602 * Map HBA registers and on-chip SRAM (if present).
1604 */ 1603 */
1605static int __devinit 1604static int sym_iomap_device(struct sym_device *device)
1606sym_iomap_device(struct sym_device *device)
1607{ 1605{
1608 struct pci_dev *pdev = device->pdev; 1606 struct pci_dev *pdev = device->pdev;
1609 struct pci_bus_region bus_addr; 1607 struct pci_bus_region bus_addr;
@@ -1751,8 +1749,7 @@ static struct scsi_host_template sym2_template = {
1751 1749
1752static int attach_count; 1750static int attach_count;
1753 1751
1754static int __devinit sym2_probe(struct pci_dev *pdev, 1752static int sym2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1755 const struct pci_device_id *ent)
1756{ 1753{
1757 struct sym_device sym_dev; 1754 struct sym_device sym_dev;
1758 struct sym_nvram nvram; 1755 struct sym_nvram nvram;
@@ -2077,7 +2074,7 @@ static struct spi_function_template sym2_transport_functions = {
2077 .get_signalling = sym2_get_signalling, 2074 .get_signalling = sym2_get_signalling,
2078}; 2075};
2079 2076
2080static struct pci_device_id sym2_id_table[] __devinitdata = { 2077static struct pci_device_id sym2_id_table[] = {
2081 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C810, 2078 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C810,
2082 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 2079 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
2083 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C820, 2080 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C820,
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index a1baccce05f..9327f5fcec4 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -2219,7 +2219,7 @@ static struct scsi_host_template driver_template = {
2219 * 2219 *
2220 **********************************************************************/ 2220 **********************************************************************/
2221 2221
2222static void __devinit dc390_eeprom_prepare_read(struct pci_dev *pdev, u8 cmd) 2222static void dc390_eeprom_prepare_read(struct pci_dev *pdev, u8 cmd)
2223{ 2223{
2224 u8 carryFlag = 1, j = 0x80, bval; 2224 u8 carryFlag = 1, j = 0x80, bval;
2225 int i; 2225 int i;
@@ -2242,7 +2242,7 @@ static void __devinit dc390_eeprom_prepare_read(struct pci_dev *pdev, u8 cmd)
2242 } 2242 }
2243} 2243}
2244 2244
2245static u16 __devinit dc390_eeprom_get_data(struct pci_dev *pdev) 2245static u16 dc390_eeprom_get_data(struct pci_dev *pdev)
2246{ 2246{
2247 int i; 2247 int i;
2248 u16 wval = 0; 2248 u16 wval = 0;
@@ -2264,7 +2264,7 @@ static u16 __devinit dc390_eeprom_get_data(struct pci_dev *pdev)
2264 return wval; 2264 return wval;
2265} 2265}
2266 2266
2267static void __devinit dc390_read_eeprom(struct pci_dev *pdev, u16 *ptr) 2267static void dc390_read_eeprom(struct pci_dev *pdev, u16 *ptr)
2268{ 2268{
2269 u8 cmd = EEPROM_READ, i; 2269 u8 cmd = EEPROM_READ, i;
2270 2270
@@ -2282,7 +2282,7 @@ static void __devinit dc390_read_eeprom(struct pci_dev *pdev, u16 *ptr)
2282} 2282}
2283 2283
2284/* Override EEprom values with explicitly set values */ 2284/* Override EEprom values with explicitly set values */
2285static void __devinit dc390_eeprom_override(u8 index) 2285static void dc390_eeprom_override(u8 index)
2286{ 2286{
2287 u8 *ptr = (u8 *) dc390_eepromBuf[index], id; 2287 u8 *ptr = (u8 *) dc390_eepromBuf[index], id;
2288 2288
@@ -2305,7 +2305,7 @@ static void __devinit dc390_eeprom_override(u8 index)
2305 } 2305 }
2306} 2306}
2307 2307
2308static int __devinitdata tmscsim_def[] = { 2308static int tmscsim_def[] = {
2309 7, 2309 7,
2310 0 /* 10MHz */, 2310 0 /* 10MHz */,
2311 PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_ | SYNC_NEGO_ | TAG_QUEUEING_, 2311 PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_ | SYNC_NEGO_ | TAG_QUEUEING_,
@@ -2315,7 +2315,7 @@ static int __devinitdata tmscsim_def[] = {
2315}; 2315};
2316 2316
2317/* Copy defaults over set values where missing */ 2317/* Copy defaults over set values where missing */
2318static void __devinit dc390_fill_with_defaults (void) 2318static void dc390_fill_with_defaults (void)
2319{ 2319{
2320 int i; 2320 int i;
2321 2321
@@ -2335,7 +2335,7 @@ static void __devinit dc390_fill_with_defaults (void)
2335 tmscsim[5] = 180; 2335 tmscsim[5] = 180;
2336} 2336}
2337 2337
2338static void __devinit dc390_check_eeprom(struct pci_dev *pdev, u8 index) 2338static void dc390_check_eeprom(struct pci_dev *pdev, u8 index)
2339{ 2339{
2340 u8 interpd[] = {1, 3, 5, 10, 16, 30, 60, 120}; 2340 u8 interpd[] = {1, 3, 5, 10, 16, 30, 60, 120};
2341 u8 EEbuf[128]; 2341 u8 EEbuf[128];
@@ -2372,7 +2372,7 @@ static void __devinit dc390_check_eeprom(struct pci_dev *pdev, u8 index)
2372 } 2372 }
2373} 2373}
2374 2374
2375static void __devinit dc390_init_hw(struct dc390_acb *pACB, u8 index) 2375static void dc390_init_hw(struct dc390_acb *pACB, u8 index)
2376{ 2376{
2377 struct Scsi_Host *shost = pACB->pScsiHost; 2377 struct Scsi_Host *shost = pACB->pScsiHost;
2378 u8 dstate; 2378 u8 dstate;
@@ -2422,8 +2422,7 @@ static void __devinit dc390_init_hw(struct dc390_acb *pACB, u8 index)
2422 DC390_write8(DMA_Status, dstate); 2422 DC390_write8(DMA_Status, dstate);
2423} 2423}
2424 2424
2425static int __devinit dc390_probe_one(struct pci_dev *pdev, 2425static int dc390_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2426 const struct pci_device_id *id)
2427{ 2426{
2428 struct dc390_acb *pACB; 2427 struct dc390_acb *pACB;
2429 struct Scsi_Host *shost; 2428 struct Scsi_Host *shost;
@@ -2532,7 +2531,7 @@ static int __devinit dc390_probe_one(struct pci_dev *pdev,
2532 * 2531 *
2533 * @dev: The PCI device to remove. 2532 * @dev: The PCI device to remove.
2534 */ 2533 */
2535static void __devexit dc390_remove_one(struct pci_dev *dev) 2534static void dc390_remove_one(struct pci_dev *dev)
2536{ 2535{
2537 struct Scsi_Host *scsi_host = pci_get_drvdata(dev); 2536 struct Scsi_Host *scsi_host = pci_get_drvdata(dev);
2538 unsigned long iflags; 2537 unsigned long iflags;
@@ -2568,7 +2567,7 @@ static struct pci_driver dc390_driver = {
2568 .name = "tmscsim", 2567 .name = "tmscsim",
2569 .id_table = tmscsim_pci_tbl, 2568 .id_table = tmscsim_pci_tbl,
2570 .probe = dc390_probe_one, 2569 .probe = dc390_probe_one,
2571 .remove = __devexit_p(dc390_remove_one), 2570 .remove = dc390_remove_one,
2572}; 2571};
2573 2572
2574static int __init dc390_module_init(void) 2573static int __init dc390_module_init(void)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 58f4ba6fe41..91a4046ca9b 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1811,8 +1811,7 @@ static int ufshcd_set_dma_mask(struct ufs_hba *hba)
1811 * 1811 *
1812 * Returns 0 on success, non-zero value on failure 1812 * Returns 0 on success, non-zero value on failure
1813 */ 1813 */
1814static int __devinit 1814static int ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1815ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1816{ 1815{
1817 struct Scsi_Host *host; 1816 struct Scsi_Host *host;
1818 struct ufs_hba *hba; 1817 struct ufs_hba *hba;
@@ -1947,7 +1946,7 @@ static struct pci_driver ufshcd_pci_driver = {
1947 .name = UFSHCD, 1946 .name = UFSHCD,
1948 .id_table = ufshcd_pci_tbl, 1947 .id_table = ufshcd_pci_tbl,
1949 .probe = ufshcd_probe, 1948 .probe = ufshcd_probe,
1950 .remove = __devexit_p(ufshcd_remove), 1949 .remove = ufshcd_remove,
1951 .shutdown = ufshcd_shutdown, 1950 .shutdown = ufshcd_shutdown,
1952#ifdef CONFIG_PM 1951#ifdef CONFIG_PM
1953 .suspend = ufshcd_suspend, 1952 .suspend = ufshcd_suspend,
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 74ab67a169e..3449a1f8c65 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -679,7 +679,7 @@ out:
679 return err; 679 return err;
680} 680}
681 681
682static int __devinit virtscsi_probe(struct virtio_device *vdev) 682static int virtscsi_probe(struct virtio_device *vdev)
683{ 683{
684 struct Scsi_Host *shost; 684 struct Scsi_Host *shost;
685 struct virtio_scsi *vscsi; 685 struct virtio_scsi *vscsi;
@@ -733,7 +733,7 @@ virtscsi_init_failed:
733 return err; 733 return err;
734} 734}
735 735
736static void __devexit virtscsi_remove(struct virtio_device *vdev) 736static void virtscsi_remove(struct virtio_device *vdev)
737{ 737{
738 struct Scsi_Host *shost = virtio_scsi_host(vdev); 738 struct Scsi_Host *shost = virtio_scsi_host(vdev);
739 struct virtio_scsi *vscsi = shost_priv(shost); 739 struct virtio_scsi *vscsi = shost_priv(shost);
@@ -785,7 +785,7 @@ static struct virtio_driver virtio_scsi_driver = {
785 .freeze = virtscsi_freeze, 785 .freeze = virtscsi_freeze,
786 .restore = virtscsi_restore, 786 .restore = virtscsi_restore,
787#endif 787#endif
788 .remove = __devexit_p(virtscsi_remove), 788 .remove = virtscsi_remove,
789}; 789};
790 790
791static int __init init(void) 791static int __init init(void)
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 20b3a483c2c..3bfaa66fa0d 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -397,7 +397,7 @@ static void pvscsi_unmap_buffers(const struct pvscsi_adapter *adapter,
397 SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); 397 SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE);
398} 398}
399 399
400static int __devinit pvscsi_allocate_rings(struct pvscsi_adapter *adapter) 400static int pvscsi_allocate_rings(struct pvscsi_adapter *adapter)
401{ 401{
402 adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE, 402 adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE,
403 &adapter->ringStatePA); 403 &adapter->ringStatePA);
@@ -1152,7 +1152,7 @@ static void pvscsi_release_resources(struct pvscsi_adapter *adapter)
1152 * just use a statically allocated scatter list. 1152 * just use a statically allocated scatter list.
1153 * 1153 *
1154 */ 1154 */
1155static int __devinit pvscsi_allocate_sg(struct pvscsi_adapter *adapter) 1155static int pvscsi_allocate_sg(struct pvscsi_adapter *adapter)
1156{ 1156{
1157 struct pvscsi_ctx *ctx; 1157 struct pvscsi_ctx *ctx;
1158 int i; 1158 int i;
@@ -1233,8 +1233,7 @@ exit:
1233 return numPhys; 1233 return numPhys;
1234} 1234}
1235 1235
1236static int __devinit pvscsi_probe(struct pci_dev *pdev, 1236static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1237 const struct pci_device_id *id)
1238{ 1237{
1239 struct pvscsi_adapter *adapter; 1238 struct pvscsi_adapter *adapter;
1240 struct Scsi_Host *host; 1239 struct Scsi_Host *host;
@@ -1454,7 +1453,7 @@ static struct pci_driver pvscsi_pci_driver = {
1454 .name = "vmw_pvscsi", 1453 .name = "vmw_pvscsi",
1455 .id_table = pvscsi_pci_tbl, 1454 .id_table = pvscsi_pci_tbl,
1456 .probe = pvscsi_probe, 1455 .probe = pvscsi_probe,
1457 .remove = __devexit_p(pvscsi_remove), 1456 .remove = pvscsi_remove,
1458 .shutdown = pvscsi_shutdown, 1457 .shutdown = pvscsi_shutdown,
1459}; 1458};
1460 1459
diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 27e84e4b1fa..97ccb038353 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -182,7 +182,7 @@ static struct parisc_driver zalon_driver = {
182 .name = "zalon", 182 .name = "zalon",
183 .id_table = zalon_tbl, 183 .id_table = zalon_tbl,
184 .probe = zalon_probe, 184 .probe = zalon_probe,
185 .remove = __devexit_p(zalon_remove), 185 .remove = zalon_remove,
186}; 186};
187 187
188static int __init zalon7xx_init(void) 188static int __init zalon7xx_init(void)
diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c
index e17764d7147..cbf3476c68c 100644
--- a/drivers/scsi/zorro7xx.c
+++ b/drivers/scsi/zorro7xx.c
@@ -38,7 +38,7 @@ static struct zorro_driver_data {
38 const char *name; 38 const char *name;
39 unsigned long offset; 39 unsigned long offset;
40 int absolute; /* offset is absolute address */ 40 int absolute; /* offset is absolute address */
41} zorro7xx_driver_data[] __devinitdata = { 41} zorro7xx_driver_data[] = {
42 { .name = "PowerUP 603e+", .offset = 0xf40000, .absolute = 1 }, 42 { .name = "PowerUP 603e+", .offset = 0xf40000, .absolute = 1 },
43 { .name = "WarpEngine 40xx", .offset = 0x40000 }, 43 { .name = "WarpEngine 40xx", .offset = 0x40000 },
44 { .name = "A4091", .offset = 0x800000 }, 44 { .name = "A4091", .offset = 0x800000 },
@@ -46,7 +46,7 @@ static struct zorro_driver_data {
46 { 0 } 46 { 0 }
47}; 47};
48 48
49static struct zorro_device_id zorro7xx_zorro_tbl[] __devinitdata = { 49static struct zorro_device_id zorro7xx_zorro_tbl[] = {
50 { 50 {
51 .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS, 51 .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS,
52 .driver_data = (unsigned long)&zorro7xx_driver_data[0], 52 .driver_data = (unsigned long)&zorro7xx_driver_data[0],
@@ -71,8 +71,8 @@ static struct zorro_device_id zorro7xx_zorro_tbl[] __devinitdata = {
71}; 71};
72MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl); 72MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl);
73 73
74static int __devinit zorro7xx_init_one(struct zorro_dev *z, 74static int zorro7xx_init_one(struct zorro_dev *z,
75 const struct zorro_device_id *ent) 75 const struct zorro_device_id *ent)
76{ 76{
77 struct Scsi_Host *host; 77 struct Scsi_Host *host;
78 struct NCR_700_Host_Parameters *hostdata; 78 struct NCR_700_Host_Parameters *hostdata;
@@ -150,7 +150,7 @@ static int __devinit zorro7xx_init_one(struct zorro_dev *z,
150 return -ENODEV; 150 return -ENODEV;
151} 151}
152 152
153static __devexit void zorro7xx_remove_one(struct zorro_dev *z) 153static void zorro7xx_remove_one(struct zorro_dev *z)
154{ 154{
155 struct Scsi_Host *host = zorro_get_drvdata(z); 155 struct Scsi_Host *host = zorro_get_drvdata(z);
156 struct NCR_700_Host_Parameters *hostdata = shost_priv(host); 156 struct NCR_700_Host_Parameters *hostdata = shost_priv(host);
@@ -167,7 +167,7 @@ static struct zorro_driver zorro7xx_driver = {
167 .name = "zorro7xx-scsi", 167 .name = "zorro7xx-scsi",
168 .id_table = zorro7xx_zorro_tbl, 168 .id_table = zorro7xx_zorro_tbl,
169 .probe = zorro7xx_init_one, 169 .probe = zorro7xx_init_one,
170 .remove = __devexit_p(zorro7xx_remove_one), 170 .remove = zorro7xx_remove_one,
171}; 171};
172 172
173static int __init zorro7xx_scsi_init(void) 173static int __init zorro7xx_scsi_init(void)
diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c
index 038fa071382..6a24f07c201 100644
--- a/drivers/sh/pfc/gpio.c
+++ b/drivers/sh/pfc/gpio.c
@@ -165,7 +165,7 @@ static int sh_pfc_gpio_match(struct gpio_chip *gc, void *data)
165 return !!strstr(gc->label, data); 165 return !!strstr(gc->label, data);
166} 166}
167 167
168static int __devinit sh_pfc_gpio_probe(struct platform_device *pdev) 168static int sh_pfc_gpio_probe(struct platform_device *pdev)
169{ 169{
170 struct sh_pfc_chip *chip; 170 struct sh_pfc_chip *chip;
171 struct gpio_chip *gc; 171 struct gpio_chip *gc;
@@ -184,7 +184,7 @@ static int __devinit sh_pfc_gpio_probe(struct platform_device *pdev)
184 return 0; 184 return 0;
185} 185}
186 186
187static int __devexit sh_pfc_gpio_remove(struct platform_device *pdev) 187static int sh_pfc_gpio_remove(struct platform_device *pdev)
188{ 188{
189 struct sh_pfc_chip *chip = platform_get_drvdata(pdev); 189 struct sh_pfc_chip *chip = platform_get_drvdata(pdev);
190 int ret; 190 int ret;
@@ -199,7 +199,7 @@ static int __devexit sh_pfc_gpio_remove(struct platform_device *pdev)
199 199
200static struct platform_driver sh_pfc_gpio_driver = { 200static struct platform_driver sh_pfc_gpio_driver = {
201 .probe = sh_pfc_gpio_probe, 201 .probe = sh_pfc_gpio_probe,
202 .remove = __devexit_p(sh_pfc_gpio_remove), 202 .remove = sh_pfc_gpio_remove,
203 .driver = { 203 .driver = {
204 .name = KBUILD_MODNAME, 204 .name = KBUILD_MODNAME,
205 .owner = THIS_MODULE, 205 .owner = THIS_MODULE,
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c
index 0646bf6e788..4109b769eac 100644
--- a/drivers/sh/pfc/pinctrl.c
+++ b/drivers/sh/pfc/pinctrl.c
@@ -328,10 +328,10 @@ static struct pinctrl_desc sh_pfc_pinctrl_desc = {
328 .confops = &sh_pfc_pinconf_ops, 328 .confops = &sh_pfc_pinconf_ops,
329}; 329};
330 330
331static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, 331static inline void sh_pfc_map_one_gpio(struct sh_pfc *pfc,
332 struct sh_pfc_pinctrl *pmx, 332 struct sh_pfc_pinctrl *pmx,
333 struct pinmux_gpio *gpio, 333 struct pinmux_gpio *gpio,
334 unsigned offset) 334 unsigned offset)
335{ 335{
336 struct pinmux_data_reg *dummy; 336 struct pinmux_data_reg *dummy;
337 unsigned long flags; 337 unsigned long flags;
@@ -351,8 +351,7 @@ static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc,
351} 351}
352 352
353/* pinmux ranges -> pinctrl pin descs */ 353/* pinmux ranges -> pinctrl pin descs */
354static int __devinit sh_pfc_map_gpios(struct sh_pfc *pfc, 354static int sh_pfc_map_gpios(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
355 struct sh_pfc_pinctrl *pmx)
356{ 355{
357 unsigned long flags; 356 unsigned long flags;
358 int i; 357 int i;
@@ -396,8 +395,7 @@ static int __devinit sh_pfc_map_gpios(struct sh_pfc *pfc,
396 return 0; 395 return 0;
397} 396}
398 397
399static int __devinit sh_pfc_map_functions(struct sh_pfc *pfc, 398static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
400 struct sh_pfc_pinctrl *pmx)
401{ 399{
402 unsigned long flags; 400 unsigned long flags;
403 int i, fn; 401 int i, fn;
@@ -421,7 +419,7 @@ static int __devinit sh_pfc_map_functions(struct sh_pfc *pfc,
421 return 0; 419 return 0;
422} 420}
423 421
424static int __devinit sh_pfc_pinctrl_probe(struct platform_device *pdev) 422static int sh_pfc_pinctrl_probe(struct platform_device *pdev)
425{ 423{
426 struct sh_pfc *pfc; 424 struct sh_pfc *pfc;
427 int ret; 425 int ret;
@@ -465,7 +463,7 @@ free_pads:
465 return ret; 463 return ret;
466} 464}
467 465
468static int __devexit sh_pfc_pinctrl_remove(struct platform_device *pdev) 466static int sh_pfc_pinctrl_remove(struct platform_device *pdev)
469{ 467{
470 struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev); 468 struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev);
471 469
@@ -482,7 +480,7 @@ static int __devexit sh_pfc_pinctrl_remove(struct platform_device *pdev)
482 480
483static struct platform_driver sh_pfc_pinctrl_driver = { 481static struct platform_driver sh_pfc_pinctrl_driver = {
484 .probe = sh_pfc_pinctrl_probe, 482 .probe = sh_pfc_pinctrl_probe,
485 .remove = __devexit_p(sh_pfc_pinctrl_remove), 483 .remove = sh_pfc_pinctrl_remove,
486 .driver = { 484 .driver = {
487 .name = DRV_NAME, 485 .name = DRV_NAME,
488 .owner = THIS_MODULE, 486 .owner = THIS_MODULE,
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index b3b33fa26ac..fb7ea0d9a73 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -575,11 +575,10 @@ void ioc3_unregister_submodule(struct ioc3_submodule *is)
575 * Device management * 575 * Device management *
576 *********************/ 576 *********************/
577 577
578static char * __devinitdata 578static char *ioc3_class_names[] = { "unknown", "IP27 BaseIO", "IP30 system",
579ioc3_class_names[]={"unknown", "IP27 BaseIO", "IP30 system", "MENET 1/2/3", 579 "MENET 1/2/3", "MENET 4", "CADduo", "Altix Serial" };
580 "MENET 4", "CADduo", "Altix Serial"};
581 580
582static int __devinit ioc3_class(struct ioc3_driver_data *idd) 581static int ioc3_class(struct ioc3_driver_data *idd)
583{ 582{
584 int res = IOC3_CLASS_NONE; 583 int res = IOC3_CLASS_NONE;
585 /* NIC-based logic */ 584 /* NIC-based logic */
@@ -602,8 +601,7 @@ static int __devinit ioc3_class(struct ioc3_driver_data *idd)
602 return res; 601 return res;
603} 602}
604/* Adds a new instance of an IOC3 card */ 603/* Adds a new instance of an IOC3 card */
605static int __devinit 604static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
606ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
607{ 605{
608 struct ioc3_driver_data *idd; 606 struct ioc3_driver_data *idd;
609 uint32_t pcmd; 607 uint32_t pcmd;
@@ -755,7 +753,7 @@ out:
755} 753}
756 754
757/* Removes a particular instance of an IOC3 card. */ 755/* Removes a particular instance of an IOC3 card. */
758static void __devexit ioc3_remove(struct pci_dev *pdev) 756static void ioc3_remove(struct pci_dev *pdev)
759{ 757{
760 int id; 758 int id;
761 struct ioc3_driver_data *idd; 759 struct ioc3_driver_data *idd;
@@ -807,7 +805,7 @@ static struct pci_driver ioc3_driver = {
807 .name = "IOC3", 805 .name = "IOC3",
808 .id_table = ioc3_id_table, 806 .id_table = ioc3_id_table,
809 .probe = ioc3_probe, 807 .probe = ioc3_probe,
810 .remove = __devexit_p(ioc3_remove), 808 .remove = ioc3_remove,
811}; 809};
812 810
813MODULE_DEVICE_TABLE(pci, ioc3_id_table); 811MODULE_DEVICE_TABLE(pci, ioc3_id_table);
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index ff3c8a21f10..5d6f2ec1c70 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -162,8 +162,7 @@ config SSB_DRIVER_GIGE
162 162
163config SSB_DRIVER_GPIO 163config SSB_DRIVER_GPIO
164 bool "SSB GPIO driver" 164 bool "SSB GPIO driver"
165 depends on SSB 165 depends on SSB && GPIOLIB
166 select GPIOLIB
167 help 166 help
168 Driver to provide access to the GPIO pins on the bus. 167 Driver to provide access to the GPIO pins on the bus.
169 168
diff --git a/drivers/ssb/driver_gige.c b/drivers/ssb/driver_gige.c
index f30ea689933..21f71a1581f 100644
--- a/drivers/ssb/driver_gige.c
+++ b/drivers/ssb/driver_gige.c
@@ -107,9 +107,8 @@ void gige_pcicfg_write32(struct ssb_gige *dev,
107 gige_write32(dev, SSB_GIGE_PCICFG + offset, value); 107 gige_write32(dev, SSB_GIGE_PCICFG + offset, value);
108} 108}
109 109
110static int __devinit ssb_gige_pci_read_config(struct pci_bus *bus, 110static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn,
111 unsigned int devfn, int reg, 111 int reg, int size, u32 *val)
112 int size, u32 *val)
113{ 112{
114 struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops); 113 struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
115 unsigned long flags; 114 unsigned long flags;
@@ -138,9 +137,8 @@ static int __devinit ssb_gige_pci_read_config(struct pci_bus *bus,
138 return PCIBIOS_SUCCESSFUL; 137 return PCIBIOS_SUCCESSFUL;
139} 138}
140 139
141static int __devinit ssb_gige_pci_write_config(struct pci_bus *bus, 140static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn,
142 unsigned int devfn, int reg, 141 int reg, int size, u32 val)
143 int size, u32 val)
144{ 142{
145 struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops); 143 struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
146 unsigned long flags; 144 unsigned long flags;
@@ -169,8 +167,8 @@ static int __devinit ssb_gige_pci_write_config(struct pci_bus *bus,
169 return PCIBIOS_SUCCESSFUL; 167 return PCIBIOS_SUCCESSFUL;
170} 168}
171 169
172static int __devinit ssb_gige_probe(struct ssb_device *sdev, 170static int ssb_gige_probe(struct ssb_device *sdev,
173 const struct ssb_device_id *id) 171 const struct ssb_device_id *id)
174{ 172{
175 struct ssb_gige *dev; 173 struct ssb_gige *dev;
176 u32 base, tmslow, tmshigh; 174 u32 base, tmslow, tmshigh;
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 49d209173f5..59801d23d7e 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -315,7 +315,7 @@ int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
315 return ssb_mips_irq(extpci_core->dev) + 2; 315 return ssb_mips_irq(extpci_core->dev) + 2;
316} 316}
317 317
318static void __devinit ssb_pcicore_init_hostmode(struct ssb_pcicore *pc) 318static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
319{ 319{
320 u32 val; 320 u32 val;
321 321
@@ -380,7 +380,7 @@ static void __devinit ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
380 register_pci_controller(&ssb_pcicore_controller); 380 register_pci_controller(&ssb_pcicore_controller);
381} 381}
382 382
383static int __devinit pcicore_is_in_hostmode(struct ssb_pcicore *pc) 383static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
384{ 384{
385 struct ssb_bus *bus = pc->dev->bus; 385 struct ssb_bus *bus = pc->dev->bus;
386 u16 chipid_top; 386 u16 chipid_top;
@@ -413,7 +413,7 @@ static int __devinit pcicore_is_in_hostmode(struct ssb_pcicore *pc)
413 * Workarounds. 413 * Workarounds.
414 **************************************************/ 414 **************************************************/
415 415
416static void __devinit ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc) 416static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
417{ 417{
418 u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0)); 418 u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
419 if (((tmp & 0xF000) >> 12) != pc->dev->core_index) { 419 if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
@@ -515,7 +515,7 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
515 * Generic and Clientmode operation code. 515 * Generic and Clientmode operation code.
516 **************************************************/ 516 **************************************************/
517 517
518static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc) 518static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
519{ 519{
520 struct ssb_device *pdev = pc->dev; 520 struct ssb_device *pdev = pc->dev;
521 struct ssb_bus *bus = pdev->bus; 521 struct ssb_bus *bus = pdev->bus;
@@ -534,7 +534,7 @@ static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
534 } 534 }
535} 535}
536 536
537void __devinit ssb_pcicore_init(struct ssb_pcicore *pc) 537void ssb_pcicore_init(struct ssb_pcicore *pc)
538{ 538{
539 struct ssb_device *dev = pc->dev; 539 struct ssb_device *dev = pc->dev;
540 540
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index c82c5c95fe8..772ad9b5c30 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -548,7 +548,7 @@ error:
548} 548}
549 549
550/* Needs ssb_buses_lock() */ 550/* Needs ssb_buses_lock() */
551static int __devinit ssb_attach_queued_buses(void) 551static int ssb_attach_queued_buses(void)
552{ 552{
553 struct ssb_bus *bus, *n; 553 struct ssb_bus *bus, *n;
554 int err = 0; 554 int err = 0;
@@ -761,9 +761,9 @@ out:
761 return err; 761 return err;
762} 762}
763 763
764static int __devinit ssb_bus_register(struct ssb_bus *bus, 764static int ssb_bus_register(struct ssb_bus *bus,
765 ssb_invariants_func_t get_invariants, 765 ssb_invariants_func_t get_invariants,
766 unsigned long baseaddr) 766 unsigned long baseaddr)
767{ 767{
768 int err; 768 int err;
769 769
@@ -851,8 +851,7 @@ err_disable_xtal:
851} 851}
852 852
853#ifdef CONFIG_SSB_PCIHOST 853#ifdef CONFIG_SSB_PCIHOST
854int __devinit ssb_bus_pcibus_register(struct ssb_bus *bus, 854int ssb_bus_pcibus_register(struct ssb_bus *bus, struct pci_dev *host_pci)
855 struct pci_dev *host_pci)
856{ 855{
857 int err; 856 int err;
858 857
@@ -875,9 +874,9 @@ EXPORT_SYMBOL(ssb_bus_pcibus_register);
875#endif /* CONFIG_SSB_PCIHOST */ 874#endif /* CONFIG_SSB_PCIHOST */
876 875
877#ifdef CONFIG_SSB_PCMCIAHOST 876#ifdef CONFIG_SSB_PCMCIAHOST
878int __devinit ssb_bus_pcmciabus_register(struct ssb_bus *bus, 877int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
879 struct pcmcia_device *pcmcia_dev, 878 struct pcmcia_device *pcmcia_dev,
880 unsigned long baseaddr) 879 unsigned long baseaddr)
881{ 880{
882 int err; 881 int err;
883 882
@@ -897,9 +896,8 @@ EXPORT_SYMBOL(ssb_bus_pcmciabus_register);
897#endif /* CONFIG_SSB_PCMCIAHOST */ 896#endif /* CONFIG_SSB_PCMCIAHOST */
898 897
899#ifdef CONFIG_SSB_SDIOHOST 898#ifdef CONFIG_SSB_SDIOHOST
900int __devinit ssb_bus_sdiobus_register(struct ssb_bus *bus, 899int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
901 struct sdio_func *func, 900 unsigned int quirks)
902 unsigned int quirks)
903{ 901{
904 int err; 902 int err;
905 903
@@ -919,9 +917,8 @@ int __devinit ssb_bus_sdiobus_register(struct ssb_bus *bus,
919EXPORT_SYMBOL(ssb_bus_sdiobus_register); 917EXPORT_SYMBOL(ssb_bus_sdiobus_register);
920#endif /* CONFIG_SSB_PCMCIAHOST */ 918#endif /* CONFIG_SSB_PCMCIAHOST */
921 919
922int __devinit ssb_bus_ssbbus_register(struct ssb_bus *bus, 920int ssb_bus_ssbbus_register(struct ssb_bus *bus, unsigned long baseaddr,
923 unsigned long baseaddr, 921 ssb_invariants_func_t get_invariants)
924 ssb_invariants_func_t get_invariants)
925{ 922{
926 int err; 923 int err;
927 924
diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c
index af5448f5e2d..32ed1fa4a82 100644
--- a/drivers/ssb/pcihost_wrapper.c
+++ b/drivers/ssb/pcihost_wrapper.c
@@ -54,8 +54,8 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
54# define ssb_pcihost_resume NULL 54# define ssb_pcihost_resume NULL
55#endif /* CONFIG_PM */ 55#endif /* CONFIG_PM */
56 56
57static int __devinit ssb_pcihost_probe(struct pci_dev *dev, 57static int ssb_pcihost_probe(struct pci_dev *dev,
58 const struct pci_device_id *id) 58 const struct pci_device_id *id)
59{ 59{
60 struct ssb_bus *ssb; 60 struct ssb_bus *ssb;
61 int err = -ENOMEM; 61 int err = -ENOMEM;
@@ -111,7 +111,7 @@ static void ssb_pcihost_remove(struct pci_dev *dev)
111 pci_set_drvdata(dev, NULL); 111 pci_set_drvdata(dev, NULL);
112} 112}
113 113
114int __devinit ssb_pcihost_register(struct pci_driver *driver) 114int ssb_pcihost_register(struct pci_driver *driver)
115{ 115{
116 driver->probe = ssb_pcihost_probe; 116 driver->probe = ssb_pcihost_probe;
117 driver->remove = ssb_pcihost_remove; 117 driver->remove = ssb_pcihost_remove;
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index 7de2a10213b..36eec320569 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -444,6 +444,7 @@ config COMEDI_ADQ12B
444 444
445config COMEDI_NI_AT_A2150 445config COMEDI_NI_AT_A2150
446 tristate "NI AT-A2150 ISA card support" 446 tristate "NI AT-A2150 ISA card support"
447 select COMEDI_FC
447 depends on VIRT_TO_BUS 448 depends on VIRT_TO_BUS
448 ---help--- 449 ---help---
449 Enable support for National Instruments AT-A2150 cards 450 Enable support for National Instruments AT-A2150 cards
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index b7bba1790a2..9b038e4a7e7 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1549,6 +1549,9 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
1549 if (cmd == COMEDI_DEVCONFIG) { 1549 if (cmd == COMEDI_DEVCONFIG) {
1550 rc = do_devconfig_ioctl(dev, 1550 rc = do_devconfig_ioctl(dev,
1551 (struct comedi_devconfig __user *)arg); 1551 (struct comedi_devconfig __user *)arg);
1552 if (rc == 0)
1553 /* Evade comedi_auto_unconfig(). */
1554 dev_file_info->hardware_device = NULL;
1552 goto done; 1555 goto done;
1553 } 1556 }
1554 1557
diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
index fb3d09323ba..01de996239f 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -345,7 +345,7 @@ static int waveform_ai_cancel(struct comedi_device *dev,
345 struct waveform_private *devpriv = dev->private; 345 struct waveform_private *devpriv = dev->private;
346 346
347 devpriv->timer_running = 0; 347 devpriv->timer_running = 0;
348 del_timer(&devpriv->timer); 348 del_timer_sync(&devpriv->timer);
349 return 0; 349 return 0;
350} 350}
351 351
diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c
index aaac0b2cc9e..fd1662b4175 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -963,7 +963,7 @@ static const struct ni_board_struct ni_boards[] = {
963 .ao_range_table = &range_ni_M_625x_ao, 963 .ao_range_table = &range_ni_M_625x_ao,
964 .reg_type = ni_reg_625x, 964 .reg_type = ni_reg_625x,
965 .ao_unipolar = 0, 965 .ao_unipolar = 0,
966 .ao_speed = 357, 966 .ao_speed = 350,
967 .num_p0_dio_channels = 8, 967 .num_p0_dio_channels = 8,
968 .caldac = {caldac_none}, 968 .caldac = {caldac_none},
969 .has_8255 = 0, 969 .has_8255 = 0,
@@ -982,7 +982,7 @@ static const struct ni_board_struct ni_boards[] = {
982 .ao_range_table = &range_ni_M_625x_ao, 982 .ao_range_table = &range_ni_M_625x_ao,
983 .reg_type = ni_reg_625x, 983 .reg_type = ni_reg_625x,
984 .ao_unipolar = 0, 984 .ao_unipolar = 0,
985 .ao_speed = 357, 985 .ao_speed = 350,
986 .num_p0_dio_channels = 8, 986 .num_p0_dio_channels = 8,
987 .caldac = {caldac_none}, 987 .caldac = {caldac_none},
988 .has_8255 = 0, 988 .has_8255 = 0,
@@ -1001,7 +1001,7 @@ static const struct ni_board_struct ni_boards[] = {
1001 .ao_range_table = &range_ni_M_625x_ao, 1001 .ao_range_table = &range_ni_M_625x_ao,
1002 .reg_type = ni_reg_625x, 1002 .reg_type = ni_reg_625x,
1003 .ao_unipolar = 0, 1003 .ao_unipolar = 0,
1004 .ao_speed = 357, 1004 .ao_speed = 350,
1005 .num_p0_dio_channels = 8, 1005 .num_p0_dio_channels = 8,
1006 .caldac = {caldac_none}, 1006 .caldac = {caldac_none},
1007 .has_8255 = 0, 1007 .has_8255 = 0,
@@ -1037,7 +1037,7 @@ static const struct ni_board_struct ni_boards[] = {
1037 .ao_range_table = &range_ni_M_625x_ao, 1037 .ao_range_table = &range_ni_M_625x_ao,
1038 .reg_type = ni_reg_625x, 1038 .reg_type = ni_reg_625x,
1039 .ao_unipolar = 0, 1039 .ao_unipolar = 0,
1040 .ao_speed = 357, 1040 .ao_speed = 350,
1041 .num_p0_dio_channels = 32, 1041 .num_p0_dio_channels = 32,
1042 .caldac = {caldac_none}, 1042 .caldac = {caldac_none},
1043 .has_8255 = 0, 1043 .has_8255 = 0,
@@ -1056,7 +1056,7 @@ static const struct ni_board_struct ni_boards[] = {
1056 .ao_range_table = &range_ni_M_625x_ao, 1056 .ao_range_table = &range_ni_M_625x_ao,
1057 .reg_type = ni_reg_625x, 1057 .reg_type = ni_reg_625x,
1058 .ao_unipolar = 0, 1058 .ao_unipolar = 0,
1059 .ao_speed = 357, 1059 .ao_speed = 350,
1060 .num_p0_dio_channels = 32, 1060 .num_p0_dio_channels = 32,
1061 .caldac = {caldac_none}, 1061 .caldac = {caldac_none},
1062 .has_8255 = 0, 1062 .has_8255 = 0,
@@ -1092,7 +1092,7 @@ static const struct ni_board_struct ni_boards[] = {
1092 .ao_range_table = &range_ni_M_628x_ao, 1092 .ao_range_table = &range_ni_M_628x_ao,
1093 .reg_type = ni_reg_628x, 1093 .reg_type = ni_reg_628x,
1094 .ao_unipolar = 1, 1094 .ao_unipolar = 1,
1095 .ao_speed = 357, 1095 .ao_speed = 350,
1096 .num_p0_dio_channels = 8, 1096 .num_p0_dio_channels = 8,
1097 .caldac = {caldac_none}, 1097 .caldac = {caldac_none},
1098 .has_8255 = 0, 1098 .has_8255 = 0,
@@ -1111,7 +1111,7 @@ static const struct ni_board_struct ni_boards[] = {
1111 .ao_range_table = &range_ni_M_628x_ao, 1111 .ao_range_table = &range_ni_M_628x_ao,
1112 .reg_type = ni_reg_628x, 1112 .reg_type = ni_reg_628x,
1113 .ao_unipolar = 1, 1113 .ao_unipolar = 1,
1114 .ao_speed = 357, 1114 .ao_speed = 350,
1115 .num_p0_dio_channels = 8, 1115 .num_p0_dio_channels = 8,
1116 .caldac = {caldac_none}, 1116 .caldac = {caldac_none},
1117 .has_8255 = 0, 1117 .has_8255 = 0,
@@ -1147,7 +1147,7 @@ static const struct ni_board_struct ni_boards[] = {
1147 .ao_range_table = &range_ni_M_628x_ao, 1147 .ao_range_table = &range_ni_M_628x_ao,
1148 .reg_type = ni_reg_628x, 1148 .reg_type = ni_reg_628x,
1149 .ao_unipolar = 1, 1149 .ao_unipolar = 1,
1150 .ao_speed = 357, 1150 .ao_speed = 350,
1151 .num_p0_dio_channels = 32, 1151 .num_p0_dio_channels = 32,
1152 .caldac = {caldac_none}, 1152 .caldac = {caldac_none},
1153 .has_8255 = 0, 1153 .has_8255 = 0,
diff --git a/drivers/staging/fwserial/Kconfig b/drivers/staging/fwserial/Kconfig
index 580406cb180..b2f8331e4ac 100644
--- a/drivers/staging/fwserial/Kconfig
+++ b/drivers/staging/fwserial/Kconfig
@@ -3,7 +3,9 @@ config FIREWIRE_SERIAL
3 depends on FIREWIRE 3 depends on FIREWIRE
4 help 4 help
5 This enables TTY over IEEE 1394, providing high-speed serial 5 This enables TTY over IEEE 1394, providing high-speed serial
6 connectivity to cabled peers. 6 connectivity to cabled peers. This driver implements a
7 ad-hoc transport protocol and is currently limited to
8 Linux-to-Linux communication.
7 9
8 To compile this driver as a module, say M here: the module will 10 To compile this driver as a module, say M here: the module will
9 be called firewire-serial. 11 be called firewire-serial.
diff --git a/drivers/staging/fwserial/TODO b/drivers/staging/fwserial/TODO
index 726900548ea..8dae8fb2522 100644
--- a/drivers/staging/fwserial/TODO
+++ b/drivers/staging/fwserial/TODO
@@ -1,5 +1,5 @@
1TODOs 1TODOs prior to this driver moving out of staging
2----- 2------------------------------------------------
31. Implement retries for RCODE_BUSY, RCODE_NO_ACK and RCODE_SEND_ERROR 31. Implement retries for RCODE_BUSY, RCODE_NO_ACK and RCODE_SEND_ERROR
4 - I/O is handled asynchronously which presents some issues when error 4 - I/O is handled asynchronously which presents some issues when error
5 conditions occur. 5 conditions occur.
@@ -11,17 +11,9 @@ TODOs
11-- Issues with firewire stack -- 11-- Issues with firewire stack --
121. This driver uses the same unregistered vendor id that the firewire core does 121. This driver uses the same unregistered vendor id that the firewire core does
13 (0xd00d1e). Perhaps this could be exposed as a define in 13 (0xd00d1e). Perhaps this could be exposed as a define in
14 firewire-constants.h? 14 firewire.h?
152. MAX_ASYNC_PAYLOAD needs to be publicly exposed by core/ohci
16 - otherwise how will this driver know the max size of address window to
17 open for one packet write?
183. Maybe device_max_receive() and link_speed_to_max_payload() should be 153. Maybe device_max_receive() and link_speed_to_max_payload() should be
19 taken up by the firewire core? 16 taken up by the firewire core?
204. To avoid dropping rx data while still limiting the maximum buffering,
21 the size of the AR context must be known. How to expose this to drivers?
225. Explore if bigger AR context will reduce RCODE_BUSY responses
23 (or auto-grow to certain max size -- but this would require major surgery
24 as the current AR is contiguously mapped)
25 17
26-- Issues with TTY core -- 18-- Issues with TTY core --
27 1. Hack for alternate device name scheme 19 1. Hack for alternate device name scheme
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 61ee29083b2..d03a7f57e8d 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -179,7 +179,7 @@ static void dump_profile(struct seq_file *m, struct stats *stats)
179/* Returns the max receive packet size for the given card */ 179/* Returns the max receive packet size for the given card */
180static inline int device_max_receive(struct fw_device *fw_device) 180static inline int device_max_receive(struct fw_device *fw_device)
181{ 181{
182 return 1 << (clamp_t(int, fw_device->max_rec, 8U, 13U) + 1); 182 return 1 << (clamp_t(int, fw_device->max_rec, 8U, 11U) + 1);
183} 183}
184 184
185static void fwtty_log_tx_error(struct fwtty_port *port, int rcode) 185static void fwtty_log_tx_error(struct fwtty_port *port, int rcode)
diff --git a/drivers/staging/fwserial/fwserial.h b/drivers/staging/fwserial/fwserial.h
index 8b572edf956..caa1c1ea82d 100644
--- a/drivers/staging/fwserial/fwserial.h
+++ b/drivers/staging/fwserial/fwserial.h
@@ -374,10 +374,10 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
374 */ 374 */
375static inline int link_speed_to_max_payload(unsigned speed) 375static inline int link_speed_to_max_payload(unsigned speed)
376{ 376{
377 static const int max_async[] = { 307, 614, 1229, 2458, 4916, 9832, }; 377 static const int max_async[] = { 307, 614, 1229, 2458, };
378 BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_3200); 378 BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_800);
379 379
380 speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_3200); 380 speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800);
381 if (limit_bw) 381 if (limit_bw)
382 return max_async[speed]; 382 return max_async[speed];
383 else 383 else
diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/gyro/Kconfig
index ea295b25308..87979a0d03a 100644
--- a/drivers/staging/iio/gyro/Kconfig
+++ b/drivers/staging/iio/gyro/Kconfig
@@ -27,8 +27,8 @@ config ADIS16130
27config ADIS16260 27config ADIS16260
28 tristate "Analog Devices ADIS16260 Digital Gyroscope Sensor SPI driver" 28 tristate "Analog Devices ADIS16260 Digital Gyroscope Sensor SPI driver"
29 depends on SPI 29 depends on SPI
30 select IIO_TRIGGER if IIO_BUFFER 30 select IIO_ADIS_LIB
31 select IIO_SW_RING if IIO_BUFFER 31 select IIO_ADIS_LIB_BUFFER if IIO_BUFFER
32 help 32 help
33 Say yes here to build support for Analog Devices ADIS16260 ADIS16265 33 Say yes here to build support for Analog Devices ADIS16260 ADIS16265
34 ADIS16250 ADIS16255 and ADIS16251 programmable digital gyroscope sensors. 34 ADIS16250 ADIS16255 and ADIS16251 programmable digital gyroscope sensors.
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index ecf0f44bc70..cec19f1cf56 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -584,7 +584,6 @@ int imx_drm_add_encoder(struct drm_encoder *encoder,
584 584
585 ret = imx_drm_encoder_register(imx_drm_encoder); 585 ret = imx_drm_encoder_register(imx_drm_encoder);
586 if (ret) { 586 if (ret) {
587 kfree(imx_drm_encoder);
588 ret = -ENOMEM; 587 ret = -ENOMEM;
589 goto err_register; 588 goto err_register;
590 } 589 }
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
index 677e665ca86..f7059cddd7f 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
@@ -1104,7 +1104,9 @@ static int ipu_probe(struct platform_device *pdev)
1104 if (ret) 1104 if (ret)
1105 goto out_failed_irq; 1105 goto out_failed_irq;
1106 1106
1107 ipu_reset(ipu); 1107 ret = ipu_reset(ipu);
1108 if (ret)
1109 goto out_failed_reset;
1108 1110
1109 /* Set MCU_T to divide MCU access window into 2 */ 1111 /* Set MCU_T to divide MCU access window into 2 */
1110 ipu_cm_write(ipu, 0x00400000L | (IPU_MCU_T_DEFAULT << 18), 1112 ipu_cm_write(ipu, 0x00400000L | (IPU_MCU_T_DEFAULT << 18),
@@ -1129,6 +1131,7 @@ failed_add_clients:
1129 ipu_submodules_exit(ipu); 1131 ipu_submodules_exit(ipu);
1130failed_submodules_init: 1132failed_submodules_init:
1131 ipu_irq_exit(ipu); 1133 ipu_irq_exit(ipu);
1134out_failed_reset:
1132out_failed_irq: 1135out_failed_irq:
1133 clk_disable_unprepare(ipu->clk); 1136 clk_disable_unprepare(ipu->clk);
1134failed_clk_get: 1137failed_clk_get:
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
index 1892006526b..4b3a019409b 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -452,7 +452,7 @@ static int ipu_get_resources(struct ipu_crtc *ipu_crtc,
452 int ret; 452 int ret;
453 453
454 ipu_crtc->ipu_ch = ipu_idmac_get(ipu, pdata->dma[0]); 454 ipu_crtc->ipu_ch = ipu_idmac_get(ipu, pdata->dma[0]);
455 if (IS_ERR_OR_NULL(ipu_crtc->ipu_ch)) { 455 if (IS_ERR(ipu_crtc->ipu_ch)) {
456 ret = PTR_ERR(ipu_crtc->ipu_ch); 456 ret = PTR_ERR(ipu_crtc->ipu_ch);
457 goto err_out; 457 goto err_out;
458 } 458 }
@@ -472,7 +472,7 @@ static int ipu_get_resources(struct ipu_crtc *ipu_crtc,
472 if (pdata->dp >= 0) { 472 if (pdata->dp >= 0) {
473 ipu_crtc->dp = ipu_dp_get(ipu, pdata->dp); 473 ipu_crtc->dp = ipu_dp_get(ipu, pdata->dp);
474 if (IS_ERR(ipu_crtc->dp)) { 474 if (IS_ERR(ipu_crtc->dp)) {
475 ret = PTR_ERR(ipu_crtc->ipu_ch); 475 ret = PTR_ERR(ipu_crtc->dp);
476 goto err_out; 476 goto err_out;
477 } 477 }
478 } 478 }
@@ -548,6 +548,8 @@ static int ipu_drm_probe(struct platform_device *pdev)
548 ipu_crtc->dev = &pdev->dev; 548 ipu_crtc->dev = &pdev->dev;
549 549
550 ret = ipu_crtc_init(ipu_crtc, pdata); 550 ret = ipu_crtc_init(ipu_crtc, pdata);
551 if (ret)
552 return ret;
551 553
552 platform_set_drvdata(pdev, ipu_crtc); 554 platform_set_drvdata(pdev, ipu_crtc);
553 555
diff --git a/drivers/staging/omapdrm/Makefile b/drivers/staging/omapdrm/Makefile
index 1ca0e0016de..d85e058f284 100644
--- a/drivers/staging/omapdrm/Makefile
+++ b/drivers/staging/omapdrm/Makefile
@@ -5,6 +5,7 @@
5 5
6ccflags-y := -Iinclude/drm -Werror 6ccflags-y := -Iinclude/drm -Werror
7omapdrm-y := omap_drv.o \ 7omapdrm-y := omap_drv.o \
8 omap_irq.o \
8 omap_debugfs.o \ 9 omap_debugfs.o \
9 omap_crtc.o \ 10 omap_crtc.o \
10 omap_plane.o \ 11 omap_plane.o \
diff --git a/drivers/staging/omapdrm/TODO b/drivers/staging/omapdrm/TODO
index 938c7888ca3..abeeb00aaa1 100644
--- a/drivers/staging/omapdrm/TODO
+++ b/drivers/staging/omapdrm/TODO
@@ -17,9 +17,6 @@ TODO
17. Revisit GEM sync object infrastructure.. TTM has some framework for this 17. Revisit GEM sync object infrastructure.. TTM has some framework for this
18 already. Possibly this could be refactored out and made more common? 18 already. Possibly this could be refactored out and made more common?
19 There should be some way to do this with less wheel-reinvention. 19 There should be some way to do this with less wheel-reinvention.
20. Review DSS vs KMS mismatches. The omap_dss_device is sort of part encoder,
21 part connector. Which results in a bit of duct tape to fwd calls from
22 encoder to connector. Possibly this could be done a bit better.
23. Solve PM sequencing on resume. DMM/TILER must be reloaded before any 20. Solve PM sequencing on resume. DMM/TILER must be reloaded before any
24 access is made from any component in the system. Which means on suspend 21 access is made from any component in the system. Which means on suspend
25 CRTC's should be disabled, and on resume the LUT should be reprogrammed 22 CRTC's should be disabled, and on resume the LUT should be reprogrammed
diff --git a/drivers/staging/omapdrm/omap_connector.c b/drivers/staging/omapdrm/omap_connector.c
index 91edb3f9697..4cc9ee733c5 100644
--- a/drivers/staging/omapdrm/omap_connector.c
+++ b/drivers/staging/omapdrm/omap_connector.c
@@ -31,9 +31,10 @@
31struct omap_connector { 31struct omap_connector {
32 struct drm_connector base; 32 struct drm_connector base;
33 struct omap_dss_device *dssdev; 33 struct omap_dss_device *dssdev;
34 struct drm_encoder *encoder;
34}; 35};
35 36
36static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode, 37void copy_timings_omap_to_drm(struct drm_display_mode *mode,
37 struct omap_video_timings *timings) 38 struct omap_video_timings *timings)
38{ 39{
39 mode->clock = timings->pixel_clock; 40 mode->clock = timings->pixel_clock;
@@ -64,7 +65,7 @@ static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode,
64 mode->flags |= DRM_MODE_FLAG_NVSYNC; 65 mode->flags |= DRM_MODE_FLAG_NVSYNC;
65} 66}
66 67
67static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings, 68void copy_timings_drm_to_omap(struct omap_video_timings *timings,
68 struct drm_display_mode *mode) 69 struct drm_display_mode *mode)
69{ 70{
70 timings->pixel_clock = mode->clock; 71 timings->pixel_clock = mode->clock;
@@ -96,48 +97,7 @@ static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
96 timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; 97 timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
97} 98}
98 99
99static void omap_connector_dpms(struct drm_connector *connector, int mode) 100static enum drm_connector_status omap_connector_detect(
100{
101 struct omap_connector *omap_connector = to_omap_connector(connector);
102 struct omap_dss_device *dssdev = omap_connector->dssdev;
103 int old_dpms;
104
105 DBG("%s: %d", dssdev->name, mode);
106
107 old_dpms = connector->dpms;
108
109 /* from off to on, do from crtc to connector */
110 if (mode < old_dpms)
111 drm_helper_connector_dpms(connector, mode);
112
113 if (mode == DRM_MODE_DPMS_ON) {
114 /* store resume info for suspended displays */
115 switch (dssdev->state) {
116 case OMAP_DSS_DISPLAY_SUSPENDED:
117 dssdev->activate_after_resume = true;
118 break;
119 case OMAP_DSS_DISPLAY_DISABLED: {
120 int ret = dssdev->driver->enable(dssdev);
121 if (ret) {
122 DBG("%s: failed to enable: %d",
123 dssdev->name, ret);
124 dssdev->driver->disable(dssdev);
125 }
126 break;
127 }
128 default:
129 break;
130 }
131 } else {
132 /* TODO */
133 }
134
135 /* from on to off, do from connector to crtc */
136 if (mode > old_dpms)
137 drm_helper_connector_dpms(connector, mode);
138}
139
140enum drm_connector_status omap_connector_detect(
141 struct drm_connector *connector, bool force) 101 struct drm_connector *connector, bool force)
142{ 102{
143 struct omap_connector *omap_connector = to_omap_connector(connector); 103 struct omap_connector *omap_connector = to_omap_connector(connector);
@@ -164,8 +124,6 @@ static void omap_connector_destroy(struct drm_connector *connector)
164 struct omap_connector *omap_connector = to_omap_connector(connector); 124 struct omap_connector *omap_connector = to_omap_connector(connector);
165 struct omap_dss_device *dssdev = omap_connector->dssdev; 125 struct omap_dss_device *dssdev = omap_connector->dssdev;
166 126
167 dssdev->driver->disable(dssdev);
168
169 DBG("%s", omap_connector->dssdev->name); 127 DBG("%s", omap_connector->dssdev->name);
170 drm_sysfs_connector_remove(connector); 128 drm_sysfs_connector_remove(connector);
171 drm_connector_cleanup(connector); 129 drm_connector_cleanup(connector);
@@ -261,36 +219,12 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
261struct drm_encoder *omap_connector_attached_encoder( 219struct drm_encoder *omap_connector_attached_encoder(
262 struct drm_connector *connector) 220 struct drm_connector *connector)
263{ 221{
264 int i;
265 struct omap_connector *omap_connector = to_omap_connector(connector); 222 struct omap_connector *omap_connector = to_omap_connector(connector);
266 223 return omap_connector->encoder;
267 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
268 struct drm_mode_object *obj;
269
270 if (connector->encoder_ids[i] == 0)
271 break;
272
273 obj = drm_mode_object_find(connector->dev,
274 connector->encoder_ids[i],
275 DRM_MODE_OBJECT_ENCODER);
276
277 if (obj) {
278 struct drm_encoder *encoder = obj_to_encoder(obj);
279 struct omap_overlay_manager *mgr =
280 omap_encoder_get_manager(encoder);
281 DBG("%s: found %s", omap_connector->dssdev->name,
282 mgr->name);
283 return encoder;
284 }
285 }
286
287 DBG("%s: no encoder", omap_connector->dssdev->name);
288
289 return NULL;
290} 224}
291 225
292static const struct drm_connector_funcs omap_connector_funcs = { 226static const struct drm_connector_funcs omap_connector_funcs = {
293 .dpms = omap_connector_dpms, 227 .dpms = drm_helper_connector_dpms,
294 .detect = omap_connector_detect, 228 .detect = omap_connector_detect,
295 .fill_modes = drm_helper_probe_single_connector_modes, 229 .fill_modes = drm_helper_probe_single_connector_modes,
296 .destroy = omap_connector_destroy, 230 .destroy = omap_connector_destroy,
@@ -302,34 +236,6 @@ static const struct drm_connector_helper_funcs omap_connector_helper_funcs = {
302 .best_encoder = omap_connector_attached_encoder, 236 .best_encoder = omap_connector_attached_encoder,
303}; 237};
304 238
305/* called from encoder when mode is set, to propagate settings to the dssdev */
306void omap_connector_mode_set(struct drm_connector *connector,
307 struct drm_display_mode *mode)
308{
309 struct drm_device *dev = connector->dev;
310 struct omap_connector *omap_connector = to_omap_connector(connector);
311 struct omap_dss_device *dssdev = omap_connector->dssdev;
312 struct omap_dss_driver *dssdrv = dssdev->driver;
313 struct omap_video_timings timings = {0};
314
315 copy_timings_drm_to_omap(&timings, mode);
316
317 DBG("%s: set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
318 omap_connector->dssdev->name,
319 mode->base.id, mode->name, mode->vrefresh, mode->clock,
320 mode->hdisplay, mode->hsync_start,
321 mode->hsync_end, mode->htotal,
322 mode->vdisplay, mode->vsync_start,
323 mode->vsync_end, mode->vtotal, mode->type, mode->flags);
324
325 if (dssdrv->check_timings(dssdev, &timings)) {
326 dev_err(dev->dev, "could not set timings\n");
327 return;
328 }
329
330 dssdrv->set_timings(dssdev, &timings);
331}
332
333/* flush an area of the framebuffer (in case of manual update display that 239/* flush an area of the framebuffer (in case of manual update display that
334 * is not automatically flushed) 240 * is not automatically flushed)
335 */ 241 */
@@ -344,7 +250,8 @@ void omap_connector_flush(struct drm_connector *connector,
344 250
345/* initialize connector */ 251/* initialize connector */
346struct drm_connector *omap_connector_init(struct drm_device *dev, 252struct drm_connector *omap_connector_init(struct drm_device *dev,
347 int connector_type, struct omap_dss_device *dssdev) 253 int connector_type, struct omap_dss_device *dssdev,
254 struct drm_encoder *encoder)
348{ 255{
349 struct drm_connector *connector = NULL; 256 struct drm_connector *connector = NULL;
350 struct omap_connector *omap_connector; 257 struct omap_connector *omap_connector;
@@ -360,6 +267,8 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
360 } 267 }
361 268
362 omap_connector->dssdev = dssdev; 269 omap_connector->dssdev = dssdev;
270 omap_connector->encoder = encoder;
271
363 connector = &omap_connector->base; 272 connector = &omap_connector->base;
364 273
365 drm_connector_init(dev, connector, &omap_connector_funcs, 274 drm_connector_init(dev, connector, &omap_connector_funcs,
diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c
index d87bd84257b..5c6ed6040ef 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -28,19 +28,131 @@
28struct omap_crtc { 28struct omap_crtc {
29 struct drm_crtc base; 29 struct drm_crtc base;
30 struct drm_plane *plane; 30 struct drm_plane *plane;
31
31 const char *name; 32 const char *name;
32 int id; 33 int pipe;
34 enum omap_channel channel;
35 struct omap_overlay_manager_info info;
36
37 /*
38 * Temporary: eventually this will go away, but it is needed
39 * for now to keep the output's happy. (They only need
40 * mgr->id.) Eventually this will be replaced w/ something
41 * more common-panel-framework-y
42 */
43 struct omap_overlay_manager mgr;
44
45 struct omap_video_timings timings;
46 bool enabled;
47 bool full_update;
48
49 struct omap_drm_apply apply;
50
51 struct omap_drm_irq apply_irq;
52 struct omap_drm_irq error_irq;
53
54 /* list of in-progress apply's: */
55 struct list_head pending_applies;
56
57 /* list of queued apply's: */
58 struct list_head queued_applies;
59
60 /* for handling queued and in-progress applies: */
61 struct work_struct apply_work;
33 62
34 /* if there is a pending flip, these will be non-null: */ 63 /* if there is a pending flip, these will be non-null: */
35 struct drm_pending_vblank_event *event; 64 struct drm_pending_vblank_event *event;
36 struct drm_framebuffer *old_fb; 65 struct drm_framebuffer *old_fb;
66
67 /* for handling page flips without caring about what
68 * the callback is called from. Possibly we should just
69 * make omap_gem always call the cb from the worker so
70 * we don't have to care about this..
71 *
72 * XXX maybe fold into apply_work??
73 */
74 struct work_struct page_flip_work;
75};
76
77/*
78 * Manager-ops, callbacks from output when they need to configure
79 * the upstream part of the video pipe.
80 *
81 * Most of these we can ignore until we add support for command-mode
82 * panels.. for video-mode the crtc-helpers already do an adequate
83 * job of sequencing the setup of the video pipe in the proper order
84 */
85
86/* we can probably ignore these until we support command-mode panels: */
87static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
88{
89}
90
91static int omap_crtc_enable(struct omap_overlay_manager *mgr)
92{
93 return 0;
94}
95
96static void omap_crtc_disable(struct omap_overlay_manager *mgr)
97{
98}
99
100static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
101 const struct omap_video_timings *timings)
102{
103 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
104 DBG("%s", omap_crtc->name);
105 omap_crtc->timings = *timings;
106 omap_crtc->full_update = true;
107}
108
109static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
110 const struct dss_lcd_mgr_config *config)
111{
112 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
113 DBG("%s", omap_crtc->name);
114 dispc_mgr_set_lcd_config(omap_crtc->channel, config);
115}
116
117static int omap_crtc_register_framedone_handler(
118 struct omap_overlay_manager *mgr,
119 void (*handler)(void *), void *data)
120{
121 return 0;
122}
123
124static void omap_crtc_unregister_framedone_handler(
125 struct omap_overlay_manager *mgr,
126 void (*handler)(void *), void *data)
127{
128}
129
130static const struct dss_mgr_ops mgr_ops = {
131 .start_update = omap_crtc_start_update,
132 .enable = omap_crtc_enable,
133 .disable = omap_crtc_disable,
134 .set_timings = omap_crtc_set_timings,
135 .set_lcd_config = omap_crtc_set_lcd_config,
136 .register_framedone_handler = omap_crtc_register_framedone_handler,
137 .unregister_framedone_handler = omap_crtc_unregister_framedone_handler,
37}; 138};
38 139
140/*
141 * CRTC funcs:
142 */
143
39static void omap_crtc_destroy(struct drm_crtc *crtc) 144static void omap_crtc_destroy(struct drm_crtc *crtc)
40{ 145{
41 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 146 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
147
148 DBG("%s", omap_crtc->name);
149
150 WARN_ON(omap_crtc->apply_irq.registered);
151 omap_irq_unregister(crtc->dev, &omap_crtc->error_irq);
152
42 omap_crtc->plane->funcs->destroy(omap_crtc->plane); 153 omap_crtc->plane->funcs->destroy(omap_crtc->plane);
43 drm_crtc_cleanup(crtc); 154 drm_crtc_cleanup(crtc);
155
44 kfree(omap_crtc); 156 kfree(omap_crtc);
45} 157}
46 158
@@ -48,14 +160,25 @@ static void omap_crtc_dpms(struct drm_crtc *crtc, int mode)
48{ 160{
49 struct omap_drm_private *priv = crtc->dev->dev_private; 161 struct omap_drm_private *priv = crtc->dev->dev_private;
50 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 162 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
163 bool enabled = (mode == DRM_MODE_DPMS_ON);
51 int i; 164 int i;
52 165
53 WARN_ON(omap_plane_dpms(omap_crtc->plane, mode)); 166 DBG("%s: %d", omap_crtc->name, mode);
167
168 if (enabled != omap_crtc->enabled) {
169 omap_crtc->enabled = enabled;
170 omap_crtc->full_update = true;
171 omap_crtc_apply(crtc, &omap_crtc->apply);
54 172
55 for (i = 0; i < priv->num_planes; i++) { 173 /* also enable our private plane: */
56 struct drm_plane *plane = priv->planes[i]; 174 WARN_ON(omap_plane_dpms(omap_crtc->plane, mode));
57 if (plane->crtc == crtc) 175
58 WARN_ON(omap_plane_dpms(plane, mode)); 176 /* and any attached overlay planes: */
177 for (i = 0; i < priv->num_planes; i++) {
178 struct drm_plane *plane = priv->planes[i];
179 if (plane->crtc == crtc)
180 WARN_ON(omap_plane_dpms(plane, mode));
181 }
59 } 182 }
60} 183}
61 184
@@ -73,12 +196,26 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
73 struct drm_framebuffer *old_fb) 196 struct drm_framebuffer *old_fb)
74{ 197{
75 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 198 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
76 struct drm_plane *plane = omap_crtc->plane;
77 199
78 return omap_plane_mode_set(plane, crtc, crtc->fb, 200 mode = adjusted_mode;
201
202 DBG("%s: set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
203 omap_crtc->name, mode->base.id, mode->name,
204 mode->vrefresh, mode->clock,
205 mode->hdisplay, mode->hsync_start,
206 mode->hsync_end, mode->htotal,
207 mode->vdisplay, mode->vsync_start,
208 mode->vsync_end, mode->vtotal,
209 mode->type, mode->flags);
210
211 copy_timings_drm_to_omap(&omap_crtc->timings, mode);
212 omap_crtc->full_update = true;
213
214 return omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb,
79 0, 0, mode->hdisplay, mode->vdisplay, 215 0, 0, mode->hdisplay, mode->vdisplay,
80 x << 16, y << 16, 216 x << 16, y << 16,
81 mode->hdisplay << 16, mode->vdisplay << 16); 217 mode->hdisplay << 16, mode->vdisplay << 16,
218 NULL, NULL);
82} 219}
83 220
84static void omap_crtc_prepare(struct drm_crtc *crtc) 221static void omap_crtc_prepare(struct drm_crtc *crtc)
@@ -102,10 +239,11 @@ static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
102 struct drm_plane *plane = omap_crtc->plane; 239 struct drm_plane *plane = omap_crtc->plane;
103 struct drm_display_mode *mode = &crtc->mode; 240 struct drm_display_mode *mode = &crtc->mode;
104 241
105 return plane->funcs->update_plane(plane, crtc, crtc->fb, 242 return omap_plane_mode_set(plane, crtc, crtc->fb,
106 0, 0, mode->hdisplay, mode->vdisplay, 243 0, 0, mode->hdisplay, mode->vdisplay,
107 x << 16, y << 16, 244 x << 16, y << 16,
108 mode->hdisplay << 16, mode->vdisplay << 16); 245 mode->hdisplay << 16, mode->vdisplay << 16,
246 NULL, NULL);
109} 247}
110 248
111static void omap_crtc_load_lut(struct drm_crtc *crtc) 249static void omap_crtc_load_lut(struct drm_crtc *crtc)
@@ -114,63 +252,54 @@ static void omap_crtc_load_lut(struct drm_crtc *crtc)
114 252
115static void vblank_cb(void *arg) 253static void vblank_cb(void *arg)
116{ 254{
117 static uint32_t sequence;
118 struct drm_crtc *crtc = arg; 255 struct drm_crtc *crtc = arg;
119 struct drm_device *dev = crtc->dev; 256 struct drm_device *dev = crtc->dev;
120 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 257 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
121 struct drm_pending_vblank_event *event = omap_crtc->event;
122 unsigned long flags; 258 unsigned long flags;
123 struct timeval now;
124 259
125 WARN_ON(!event); 260 spin_lock_irqsave(&dev->event_lock, flags);
261
262 /* wakeup userspace */
263 if (omap_crtc->event)
264 drm_send_vblank_event(dev, omap_crtc->pipe, omap_crtc->event);
126 265
127 omap_crtc->event = NULL; 266 omap_crtc->event = NULL;
267 omap_crtc->old_fb = NULL;
128 268
129 /* wakeup userspace */ 269 spin_unlock_irqrestore(&dev->event_lock, flags);
130 if (event) {
131 do_gettimeofday(&now);
132
133 spin_lock_irqsave(&dev->event_lock, flags);
134 /* TODO: we can't yet use the vblank time accounting,
135 * because omapdss lower layer is the one that knows
136 * the irq # and registers the handler, which more or
137 * less defeats how drm_irq works.. for now just fake
138 * the sequence number and use gettimeofday..
139 *
140 event->event.sequence = drm_vblank_count_and_time(
141 dev, omap_crtc->id, &now);
142 */
143 event->event.sequence = sequence++;
144 event->event.tv_sec = now.tv_sec;
145 event->event.tv_usec = now.tv_usec;
146 list_add_tail(&event->base.link,
147 &event->base.file_priv->event_list);
148 wake_up_interruptible(&event->base.file_priv->event_wait);
149 spin_unlock_irqrestore(&dev->event_lock, flags);
150 }
151} 270}
152 271
153static void page_flip_cb(void *arg) 272static void page_flip_worker(struct work_struct *work)
154{ 273{
155 struct drm_crtc *crtc = arg; 274 struct omap_crtc *omap_crtc =
156 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 275 container_of(work, struct omap_crtc, page_flip_work);
157 struct drm_framebuffer *old_fb = omap_crtc->old_fb; 276 struct drm_crtc *crtc = &omap_crtc->base;
277 struct drm_device *dev = crtc->dev;
278 struct drm_display_mode *mode = &crtc->mode;
158 struct drm_gem_object *bo; 279 struct drm_gem_object *bo;
159 280
160 omap_crtc->old_fb = NULL; 281 mutex_lock(&dev->mode_config.mutex);
161 282 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb,
162 omap_crtc_mode_set_base(crtc, crtc->x, crtc->y, old_fb); 283 0, 0, mode->hdisplay, mode->vdisplay,
163 284 crtc->x << 16, crtc->y << 16,
164 /* really we'd like to setup the callback atomically w/ setting the 285 mode->hdisplay << 16, mode->vdisplay << 16,
165 * new scanout buffer to avoid getting stuck waiting an extra vblank 286 vblank_cb, crtc);
166 * cycle.. for now go for correctness and later figure out speed.. 287 mutex_unlock(&dev->mode_config.mutex);
167 */
168 omap_plane_on_endwin(omap_crtc->plane, vblank_cb, crtc);
169 288
170 bo = omap_framebuffer_bo(crtc->fb, 0); 289 bo = omap_framebuffer_bo(crtc->fb, 0);
171 drm_gem_object_unreference_unlocked(bo); 290 drm_gem_object_unreference_unlocked(bo);
172} 291}
173 292
293static void page_flip_cb(void *arg)
294{
295 struct drm_crtc *crtc = arg;
296 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
297 struct omap_drm_private *priv = crtc->dev->dev_private;
298
299 /* avoid assumptions about what ctxt we are called from: */
300 queue_work(priv->wq, &omap_crtc->page_flip_work);
301}
302
174static int omap_crtc_page_flip_locked(struct drm_crtc *crtc, 303static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
175 struct drm_framebuffer *fb, 304 struct drm_framebuffer *fb,
176 struct drm_pending_vblank_event *event) 305 struct drm_pending_vblank_event *event)
@@ -179,14 +308,14 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
179 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 308 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
180 struct drm_gem_object *bo; 309 struct drm_gem_object *bo;
181 310
182 DBG("%d -> %d", crtc->fb ? crtc->fb->base.id : -1, fb->base.id); 311 DBG("%d -> %d (event=%p)", crtc->fb ? crtc->fb->base.id : -1,
312 fb->base.id, event);
183 313
184 if (omap_crtc->event) { 314 if (omap_crtc->old_fb) {
185 dev_err(dev->dev, "already a pending flip\n"); 315 dev_err(dev->dev, "already a pending flip\n");
186 return -EINVAL; 316 return -EINVAL;
187 } 317 }
188 318
189 omap_crtc->old_fb = crtc->fb;
190 omap_crtc->event = event; 319 omap_crtc->event = event;
191 crtc->fb = fb; 320 crtc->fb = fb;
192 321
@@ -234,14 +363,244 @@ static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = {
234 .load_lut = omap_crtc_load_lut, 363 .load_lut = omap_crtc_load_lut,
235}; 364};
236 365
366const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc)
367{
368 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
369 return &omap_crtc->timings;
370}
371
372enum omap_channel omap_crtc_channel(struct drm_crtc *crtc)
373{
374 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
375 return omap_crtc->channel;
376}
377
378static void omap_crtc_error_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
379{
380 struct omap_crtc *omap_crtc =
381 container_of(irq, struct omap_crtc, error_irq);
382 struct drm_crtc *crtc = &omap_crtc->base;
383 DRM_ERROR("%s: errors: %08x\n", omap_crtc->name, irqstatus);
384 /* avoid getting in a flood, unregister the irq until next vblank */
385 omap_irq_unregister(crtc->dev, &omap_crtc->error_irq);
386}
387
388static void omap_crtc_apply_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
389{
390 struct omap_crtc *omap_crtc =
391 container_of(irq, struct omap_crtc, apply_irq);
392 struct drm_crtc *crtc = &omap_crtc->base;
393
394 if (!omap_crtc->error_irq.registered)
395 omap_irq_register(crtc->dev, &omap_crtc->error_irq);
396
397 if (!dispc_mgr_go_busy(omap_crtc->channel)) {
398 struct omap_drm_private *priv =
399 crtc->dev->dev_private;
400 DBG("%s: apply done", omap_crtc->name);
401 omap_irq_unregister(crtc->dev, &omap_crtc->apply_irq);
402 queue_work(priv->wq, &omap_crtc->apply_work);
403 }
404}
405
406static void apply_worker(struct work_struct *work)
407{
408 struct omap_crtc *omap_crtc =
409 container_of(work, struct omap_crtc, apply_work);
410 struct drm_crtc *crtc = &omap_crtc->base;
411 struct drm_device *dev = crtc->dev;
412 struct omap_drm_apply *apply, *n;
413 bool need_apply;
414
415 /*
416 * Synchronize everything on mode_config.mutex, to keep
417 * the callbacks and list modification all serialized
418 * with respect to modesetting ioctls from userspace.
419 */
420 mutex_lock(&dev->mode_config.mutex);
421 dispc_runtime_get();
422
423 /*
424 * If we are still pending a previous update, wait.. when the
425 * pending update completes, we get kicked again.
426 */
427 if (omap_crtc->apply_irq.registered)
428 goto out;
429
430 /* finish up previous apply's: */
431 list_for_each_entry_safe(apply, n,
432 &omap_crtc->pending_applies, pending_node) {
433 apply->post_apply(apply);
434 list_del(&apply->pending_node);
435 }
436
437 need_apply = !list_empty(&omap_crtc->queued_applies);
438
439 /* then handle the next round of of queued apply's: */
440 list_for_each_entry_safe(apply, n,
441 &omap_crtc->queued_applies, queued_node) {
442 apply->pre_apply(apply);
443 list_del(&apply->queued_node);
444 apply->queued = false;
445 list_add_tail(&apply->pending_node,
446 &omap_crtc->pending_applies);
447 }
448
449 if (need_apply) {
450 enum omap_channel channel = omap_crtc->channel;
451
452 DBG("%s: GO", omap_crtc->name);
453
454 if (dispc_mgr_is_enabled(channel)) {
455 omap_irq_register(dev, &omap_crtc->apply_irq);
456 dispc_mgr_go(channel);
457 } else {
458 struct omap_drm_private *priv = dev->dev_private;
459 queue_work(priv->wq, &omap_crtc->apply_work);
460 }
461 }
462
463out:
464 dispc_runtime_put();
465 mutex_unlock(&dev->mode_config.mutex);
466}
467
468int omap_crtc_apply(struct drm_crtc *crtc,
469 struct omap_drm_apply *apply)
470{
471 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
472 struct drm_device *dev = crtc->dev;
473
474 WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
475
476 /* no need to queue it again if it is already queued: */
477 if (apply->queued)
478 return 0;
479
480 apply->queued = true;
481 list_add_tail(&apply->queued_node, &omap_crtc->queued_applies);
482
483 /*
484 * If there are no currently pending updates, then go ahead and
485 * kick the worker immediately, otherwise it will run again when
486 * the current update finishes.
487 */
488 if (list_empty(&omap_crtc->pending_applies)) {
489 struct omap_drm_private *priv = crtc->dev->dev_private;
490 queue_work(priv->wq, &omap_crtc->apply_work);
491 }
492
493 return 0;
494}
495
496/* called only from apply */
497static void set_enabled(struct drm_crtc *crtc, bool enable)
498{
499 struct drm_device *dev = crtc->dev;
500 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
501 enum omap_channel channel = omap_crtc->channel;
502 struct omap_irq_wait *wait = NULL;
503
504 if (dispc_mgr_is_enabled(channel) == enable)
505 return;
506
507 /* ignore sync-lost irqs during enable/disable */
508 omap_irq_unregister(crtc->dev, &omap_crtc->error_irq);
509
510 if (dispc_mgr_get_framedone_irq(channel)) {
511 if (!enable) {
512 wait = omap_irq_wait_init(dev,
513 dispc_mgr_get_framedone_irq(channel), 1);
514 }
515 } else {
516 /*
517 * When we disable digit output, we need to wait until fields
518 * are done. Otherwise the DSS is still working, and turning
519 * off the clocks prevents DSS from going to OFF mode. And when
520 * enabling, we need to wait for the extra sync losts
521 */
522 wait = omap_irq_wait_init(dev,
523 dispc_mgr_get_vsync_irq(channel), 2);
524 }
525
526 dispc_mgr_enable(channel, enable);
527
528 if (wait) {
529 int ret = omap_irq_wait(dev, wait, msecs_to_jiffies(100));
530 if (ret) {
531 dev_err(dev->dev, "%s: timeout waiting for %s\n",
532 omap_crtc->name, enable ? "enable" : "disable");
533 }
534 }
535
536 omap_irq_register(crtc->dev, &omap_crtc->error_irq);
537}
538
539static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
540{
541 struct omap_crtc *omap_crtc =
542 container_of(apply, struct omap_crtc, apply);
543 struct drm_crtc *crtc = &omap_crtc->base;
544 struct drm_encoder *encoder = NULL;
545
546 DBG("%s: enabled=%d, full=%d", omap_crtc->name,
547 omap_crtc->enabled, omap_crtc->full_update);
548
549 if (omap_crtc->full_update) {
550 struct omap_drm_private *priv = crtc->dev->dev_private;
551 int i;
552 for (i = 0; i < priv->num_encoders; i++) {
553 if (priv->encoders[i]->crtc == crtc) {
554 encoder = priv->encoders[i];
555 break;
556 }
557 }
558 }
559
560 if (!omap_crtc->enabled) {
561 set_enabled(&omap_crtc->base, false);
562 if (encoder)
563 omap_encoder_set_enabled(encoder, false);
564 } else {
565 if (encoder) {
566 omap_encoder_set_enabled(encoder, false);
567 omap_encoder_update(encoder, &omap_crtc->mgr,
568 &omap_crtc->timings);
569 omap_encoder_set_enabled(encoder, true);
570 omap_crtc->full_update = false;
571 }
572
573 dispc_mgr_setup(omap_crtc->channel, &omap_crtc->info);
574 dispc_mgr_set_timings(omap_crtc->channel,
575 &omap_crtc->timings);
576 set_enabled(&omap_crtc->base, true);
577 }
578
579 omap_crtc->full_update = false;
580}
581
582static void omap_crtc_post_apply(struct omap_drm_apply *apply)
583{
584 /* nothing needed for post-apply */
585}
586
587static const char *channel_names[] = {
588 [OMAP_DSS_CHANNEL_LCD] = "lcd",
589 [OMAP_DSS_CHANNEL_DIGIT] = "tv",
590 [OMAP_DSS_CHANNEL_LCD2] = "lcd2",
591};
592
237/* initialize crtc */ 593/* initialize crtc */
238struct drm_crtc *omap_crtc_init(struct drm_device *dev, 594struct drm_crtc *omap_crtc_init(struct drm_device *dev,
239 struct omap_overlay *ovl, int id) 595 struct drm_plane *plane, enum omap_channel channel, int id)
240{ 596{
241 struct drm_crtc *crtc = NULL; 597 struct drm_crtc *crtc = NULL;
242 struct omap_crtc *omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL); 598 struct omap_crtc *omap_crtc;
599 struct omap_overlay_manager_info *info;
600
601 DBG("%s", channel_names[channel]);
243 602
244 DBG("%s", ovl->name); 603 omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL);
245 604
246 if (!omap_crtc) { 605 if (!omap_crtc) {
247 dev_err(dev->dev, "could not allocate CRTC\n"); 606 dev_err(dev->dev, "could not allocate CRTC\n");
@@ -250,10 +609,40 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
250 609
251 crtc = &omap_crtc->base; 610 crtc = &omap_crtc->base;
252 611
253 omap_crtc->plane = omap_plane_init(dev, ovl, (1 << id), true); 612 INIT_WORK(&omap_crtc->page_flip_work, page_flip_worker);
613 INIT_WORK(&omap_crtc->apply_work, apply_worker);
614
615 INIT_LIST_HEAD(&omap_crtc->pending_applies);
616 INIT_LIST_HEAD(&omap_crtc->queued_applies);
617
618 omap_crtc->apply.pre_apply = omap_crtc_pre_apply;
619 omap_crtc->apply.post_apply = omap_crtc_post_apply;
620
621 omap_crtc->apply_irq.irqmask = pipe2vbl(id);
622 omap_crtc->apply_irq.irq = omap_crtc_apply_irq;
623
624 omap_crtc->error_irq.irqmask =
625 dispc_mgr_get_sync_lost_irq(channel);
626 omap_crtc->error_irq.irq = omap_crtc_error_irq;
627 omap_irq_register(dev, &omap_crtc->error_irq);
628
629 omap_crtc->channel = channel;
630 omap_crtc->plane = plane;
254 omap_crtc->plane->crtc = crtc; 631 omap_crtc->plane->crtc = crtc;
255 omap_crtc->name = ovl->name; 632 omap_crtc->name = channel_names[channel];
256 omap_crtc->id = id; 633 omap_crtc->pipe = id;
634
635 /* temporary: */
636 omap_crtc->mgr.id = channel;
637
638 dss_install_mgr_ops(&mgr_ops);
639
640 /* TODO: fix hard-coded setup.. add properties! */
641 info = &omap_crtc->info;
642 info->default_color = 0x00000000;
643 info->trans_key = 0x00000000;
644 info->trans_key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
645 info->trans_enabled = false;
257 646
258 drm_crtc_init(dev, crtc, &omap_crtc_funcs); 647 drm_crtc_init(dev, crtc, &omap_crtc_funcs);
259 drm_crtc_helper_add(crtc, &omap_crtc_helper_funcs); 648 drm_crtc_helper_add(crtc, &omap_crtc_helper_funcs);
diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c
index 84943e5ba1d..ae5ecc2efbc 100644
--- a/drivers/staging/omapdrm/omap_drv.c
+++ b/drivers/staging/omapdrm/omap_drv.c
@@ -74,320 +74,99 @@ static int get_connector_type(struct omap_dss_device *dssdev)
74 } 74 }
75} 75}
76 76
77#if 0 /* enable when dss2 supports hotplug */ 77static int omap_modeset_init(struct drm_device *dev)
78static int omap_drm_notifier(struct notifier_block *nb,
79 unsigned long evt, void *arg)
80{
81 switch (evt) {
82 case OMAP_DSS_SIZE_CHANGE:
83 case OMAP_DSS_HOTPLUG_CONNECT:
84 case OMAP_DSS_HOTPLUG_DISCONNECT: {
85 struct drm_device *dev = drm_device;
86 DBG("hotplug event: evt=%d, dev=%p", evt, dev);
87 if (dev)
88 drm_sysfs_hotplug_event(dev);
89
90 return NOTIFY_OK;
91 }
92 default: /* don't care about other events for now */
93 return NOTIFY_DONE;
94 }
95}
96#endif
97
98static void dump_video_chains(void)
99{
100 int i;
101
102 DBG("dumping video chains: ");
103 for (i = 0; i < omap_dss_get_num_overlays(); i++) {
104 struct omap_overlay *ovl = omap_dss_get_overlay(i);
105 struct omap_overlay_manager *mgr = ovl->manager;
106 struct omap_dss_device *dssdev = mgr ?
107 mgr->get_device(mgr) : NULL;
108 if (dssdev) {
109 DBG("%d: %s -> %s -> %s", i, ovl->name, mgr->name,
110 dssdev->name);
111 } else if (mgr) {
112 DBG("%d: %s -> %s", i, ovl->name, mgr->name);
113 } else {
114 DBG("%d: %s", i, ovl->name);
115 }
116 }
117}
118
119/* create encoders for each manager */
120static int create_encoder(struct drm_device *dev,
121 struct omap_overlay_manager *mgr)
122{
123 struct omap_drm_private *priv = dev->dev_private;
124 struct drm_encoder *encoder = omap_encoder_init(dev, mgr);
125
126 if (!encoder) {
127 dev_err(dev->dev, "could not create encoder: %s\n",
128 mgr->name);
129 return -ENOMEM;
130 }
131
132 BUG_ON(priv->num_encoders >= ARRAY_SIZE(priv->encoders));
133
134 priv->encoders[priv->num_encoders++] = encoder;
135
136 return 0;
137}
138
139/* create connectors for each display device */
140static int create_connector(struct drm_device *dev,
141 struct omap_dss_device *dssdev)
142{ 78{
143 struct omap_drm_private *priv = dev->dev_private; 79 struct omap_drm_private *priv = dev->dev_private;
144 static struct notifier_block *notifier; 80 struct omap_dss_device *dssdev = NULL;
145 struct drm_connector *connector; 81 int num_ovls = dss_feat_get_num_ovls();
146 int j; 82 int id;
147
148 if (!dssdev->driver) {
149 dev_warn(dev->dev, "%s has no driver.. skipping it\n",
150 dssdev->name);
151 return 0;
152 }
153 83
154 if (!(dssdev->driver->get_timings || 84 drm_mode_config_init(dev);
155 dssdev->driver->read_edid)) {
156 dev_warn(dev->dev, "%s driver does not support "
157 "get_timings or read_edid.. skipping it!\n",
158 dssdev->name);
159 return 0;
160 }
161 85
162 connector = omap_connector_init(dev, 86 omap_drm_irq_install(dev);
163 get_connector_type(dssdev), dssdev);
164 87
165 if (!connector) { 88 /*
166 dev_err(dev->dev, "could not create connector: %s\n", 89 * Create private planes and CRTCs for the last NUM_CRTCs overlay
167 dssdev->name); 90 * plus manager:
168 return -ENOMEM; 91 */
169 } 92 for (id = 0; id < min(num_crtc, num_ovls); id++) {
170 93 struct drm_plane *plane;
171 BUG_ON(priv->num_connectors >= ARRAY_SIZE(priv->connectors)); 94 struct drm_crtc *crtc;
172 95
173 priv->connectors[priv->num_connectors++] = connector; 96 plane = omap_plane_init(dev, id, true);
97 crtc = omap_crtc_init(dev, plane, pipe2chan(id), id);
174 98
175#if 0 /* enable when dss2 supports hotplug */ 99 BUG_ON(priv->num_crtcs >= ARRAY_SIZE(priv->crtcs));
176 notifier = kzalloc(sizeof(struct notifier_block), GFP_KERNEL); 100 priv->crtcs[id] = crtc;
177 notifier->notifier_call = omap_drm_notifier; 101 priv->num_crtcs++;
178 omap_dss_add_notify(dssdev, notifier);
179#else
180 notifier = NULL;
181#endif
182 102
183 for (j = 0; j < priv->num_encoders; j++) { 103 priv->planes[id] = plane;
184 struct omap_overlay_manager *mgr = 104 priv->num_planes++;
185 omap_encoder_get_manager(priv->encoders[j]);
186 if (mgr->get_device(mgr) == dssdev) {
187 drm_mode_connector_attach_encoder(connector,
188 priv->encoders[j]);
189 }
190 } 105 }
191 106
192 return 0; 107 /*
193} 108 * Create normal planes for the remaining overlays:
194
195/* create up to max_overlays CRTCs mapping to overlays.. by default,
196 * connect the overlays to different managers/encoders, giving priority
197 * to encoders connected to connectors with a detected connection
198 */
199static int create_crtc(struct drm_device *dev, struct omap_overlay *ovl,
200 int *j, unsigned int connected_connectors)
201{
202 struct omap_drm_private *priv = dev->dev_private;
203 struct omap_overlay_manager *mgr = NULL;
204 struct drm_crtc *crtc;
205
206 /* find next best connector, ones with detected connection first
207 */ 109 */
208 while (*j < priv->num_connectors && !mgr) { 110 for (; id < num_ovls; id++) {
209 if (connected_connectors & (1 << *j)) { 111 struct drm_plane *plane = omap_plane_init(dev, id, false);
210 struct drm_encoder *encoder =
211 omap_connector_attached_encoder(
212 priv->connectors[*j]);
213 if (encoder)
214 mgr = omap_encoder_get_manager(encoder);
215 112
216 } 113 BUG_ON(priv->num_planes >= ARRAY_SIZE(priv->planes));
217 (*j)++; 114 priv->planes[priv->num_planes++] = plane;
218 } 115 }
219 116
220 /* if we couldn't find another connected connector, lets start 117 for_each_dss_dev(dssdev) {
221 * looking at the unconnected connectors: 118 struct drm_connector *connector;
222 * 119 struct drm_encoder *encoder;
223 * note: it might not be immediately apparent, but thanks to
224 * the !mgr check in both this loop and the one above, the only
225 * way to enter this loop is with *j == priv->num_connectors,
226 * so idx can never go negative.
227 */
228 while (*j < 2 * priv->num_connectors && !mgr) {
229 int idx = *j - priv->num_connectors;
230 if (!(connected_connectors & (1 << idx))) {
231 struct drm_encoder *encoder =
232 omap_connector_attached_encoder(
233 priv->connectors[idx]);
234 if (encoder)
235 mgr = omap_encoder_get_manager(encoder);
236 120
121 if (!dssdev->driver) {
122 dev_warn(dev->dev, "%s has no driver.. skipping it\n",
123 dssdev->name);
124 return 0;
237 } 125 }
238 (*j)++;
239 }
240
241 crtc = omap_crtc_init(dev, ovl, priv->num_crtcs);
242
243 if (!crtc) {
244 dev_err(dev->dev, "could not create CRTC: %s\n",
245 ovl->name);
246 return -ENOMEM;
247 }
248 126
249 BUG_ON(priv->num_crtcs >= ARRAY_SIZE(priv->crtcs)); 127 if (!(dssdev->driver->get_timings ||
250 128 dssdev->driver->read_edid)) {
251 priv->crtcs[priv->num_crtcs++] = crtc; 129 dev_warn(dev->dev, "%s driver does not support "
252 130 "get_timings or read_edid.. skipping it!\n",
253 return 0; 131 dssdev->name);
254} 132 return 0;
255
256static int create_plane(struct drm_device *dev, struct omap_overlay *ovl,
257 unsigned int possible_crtcs)
258{
259 struct omap_drm_private *priv = dev->dev_private;
260 struct drm_plane *plane =
261 omap_plane_init(dev, ovl, possible_crtcs, false);
262
263 if (!plane) {
264 dev_err(dev->dev, "could not create plane: %s\n",
265 ovl->name);
266 return -ENOMEM;
267 }
268
269 BUG_ON(priv->num_planes >= ARRAY_SIZE(priv->planes));
270
271 priv->planes[priv->num_planes++] = plane;
272
273 return 0;
274}
275
276static int match_dev_name(struct omap_dss_device *dssdev, void *data)
277{
278 return !strcmp(dssdev->name, data);
279}
280
281static unsigned int detect_connectors(struct drm_device *dev)
282{
283 struct omap_drm_private *priv = dev->dev_private;
284 unsigned int connected_connectors = 0;
285 int i;
286
287 for (i = 0; i < priv->num_connectors; i++) {
288 struct drm_connector *connector = priv->connectors[i];
289 if (omap_connector_detect(connector, true) ==
290 connector_status_connected) {
291 connected_connectors |= (1 << i);
292 } 133 }
293 }
294
295 return connected_connectors;
296}
297 134
298static int omap_modeset_init(struct drm_device *dev) 135 encoder = omap_encoder_init(dev, dssdev);
299{
300 const struct omap_drm_platform_data *pdata = dev->dev->platform_data;
301 struct omap_kms_platform_data *kms_pdata = NULL;
302 struct omap_drm_private *priv = dev->dev_private;
303 struct omap_dss_device *dssdev = NULL;
304 int i, j;
305 unsigned int connected_connectors = 0;
306 136
307 drm_mode_config_init(dev); 137 if (!encoder) {
308 138 dev_err(dev->dev, "could not create encoder: %s\n",
309 if (pdata && pdata->kms_pdata) { 139 dssdev->name);
310 kms_pdata = pdata->kms_pdata; 140 return -ENOMEM;
311
312 /* if platform data is provided by the board file, use it to
313 * control which overlays, managers, and devices we own.
314 */
315 for (i = 0; i < kms_pdata->mgr_cnt; i++) {
316 struct omap_overlay_manager *mgr =
317 omap_dss_get_overlay_manager(
318 kms_pdata->mgr_ids[i]);
319 create_encoder(dev, mgr);
320 }
321
322 for (i = 0; i < kms_pdata->dev_cnt; i++) {
323 struct omap_dss_device *dssdev =
324 omap_dss_find_device(
325 (void *)kms_pdata->dev_names[i],
326 match_dev_name);
327 if (!dssdev) {
328 dev_warn(dev->dev, "no such dssdev: %s\n",
329 kms_pdata->dev_names[i]);
330 continue;
331 }
332 create_connector(dev, dssdev);
333 } 141 }
334 142
335 connected_connectors = detect_connectors(dev); 143 connector = omap_connector_init(dev,
144 get_connector_type(dssdev), dssdev, encoder);
336 145
337 j = 0; 146 if (!connector) {
338 for (i = 0; i < kms_pdata->ovl_cnt; i++) { 147 dev_err(dev->dev, "could not create connector: %s\n",
339 struct omap_overlay *ovl = 148 dssdev->name);
340 omap_dss_get_overlay(kms_pdata->ovl_ids[i]); 149 return -ENOMEM;
341 create_crtc(dev, ovl, &j, connected_connectors);
342 } 150 }
343 151
344 for (i = 0; i < kms_pdata->pln_cnt; i++) { 152 BUG_ON(priv->num_encoders >= ARRAY_SIZE(priv->encoders));
345 struct omap_overlay *ovl = 153 BUG_ON(priv->num_connectors >= ARRAY_SIZE(priv->connectors));
346 omap_dss_get_overlay(kms_pdata->pln_ids[i]);
347 create_plane(dev, ovl, (1 << priv->num_crtcs) - 1);
348 }
349 } else {
350 /* otherwise just grab up to CONFIG_DRM_OMAP_NUM_CRTCS and try
351 * to make educated guesses about everything else
352 */
353 int max_overlays = min(omap_dss_get_num_overlays(), num_crtc);
354 154
355 for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) 155 priv->encoders[priv->num_encoders++] = encoder;
356 create_encoder(dev, omap_dss_get_overlay_manager(i)); 156 priv->connectors[priv->num_connectors++] = connector;
357
358 for_each_dss_dev(dssdev) {
359 create_connector(dev, dssdev);
360 }
361 157
362 connected_connectors = detect_connectors(dev); 158 drm_mode_connector_attach_encoder(connector, encoder);
363 159
364 j = 0; 160 /* figure out which crtc's we can connect the encoder to: */
365 for (i = 0; i < max_overlays; i++) { 161 encoder->possible_crtcs = 0;
366 create_crtc(dev, omap_dss_get_overlay(i), 162 for (id = 0; id < priv->num_crtcs; id++) {
367 &j, connected_connectors); 163 enum omap_dss_output_id supported_outputs =
368 } 164 dss_feat_get_supported_outputs(pipe2chan(id));
369 165 if (supported_outputs & dssdev->output->id)
370 /* use any remaining overlays as drm planes */ 166 encoder->possible_crtcs |= (1 << id);
371 for (; i < omap_dss_get_num_overlays(); i++) {
372 struct omap_overlay *ovl = omap_dss_get_overlay(i);
373 create_plane(dev, ovl, (1 << priv->num_crtcs) - 1);
374 } 167 }
375 } 168 }
376 169
377 /* for now keep the mapping of CRTCs and encoders static.. */
378 for (i = 0; i < priv->num_encoders; i++) {
379 struct drm_encoder *encoder = priv->encoders[i];
380 struct omap_overlay_manager *mgr =
381 omap_encoder_get_manager(encoder);
382
383 encoder->possible_crtcs = (1 << priv->num_crtcs) - 1;
384
385 DBG("%s: possible_crtcs=%08x", mgr->name,
386 encoder->possible_crtcs);
387 }
388
389 dump_video_chains();
390
391 dev->mode_config.min_width = 32; 170 dev->mode_config.min_width = 32;
392 dev->mode_config.min_height = 32; 171 dev->mode_config.min_height = 32;
393 172
@@ -450,7 +229,7 @@ static int ioctl_gem_new(struct drm_device *dev, void *data,
450 struct drm_file *file_priv) 229 struct drm_file *file_priv)
451{ 230{
452 struct drm_omap_gem_new *args = data; 231 struct drm_omap_gem_new *args = data;
453 DBG("%p:%p: size=0x%08x, flags=%08x", dev, file_priv, 232 VERB("%p:%p: size=0x%08x, flags=%08x", dev, file_priv,
454 args->size.bytes, args->flags); 233 args->size.bytes, args->flags);
455 return omap_gem_new_handle(dev, file_priv, args->size, 234 return omap_gem_new_handle(dev, file_priv, args->size,
456 args->flags, &args->handle); 235 args->flags, &args->handle);
@@ -510,7 +289,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
510 struct drm_gem_object *obj; 289 struct drm_gem_object *obj;
511 int ret = 0; 290 int ret = 0;
512 291
513 DBG("%p:%p: handle=%d", dev, file_priv, args->handle); 292 VERB("%p:%p: handle=%d", dev, file_priv, args->handle);
514 293
515 obj = drm_gem_object_lookup(dev, file_priv, args->handle); 294 obj = drm_gem_object_lookup(dev, file_priv, args->handle);
516 if (!obj) 295 if (!obj)
@@ -565,14 +344,6 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
565 344
566 dev->dev_private = priv; 345 dev->dev_private = priv;
567 346
568 ret = omapdss_compat_init();
569 if (ret) {
570 dev_err(dev->dev, "coult not init omapdss\n");
571 dev->dev_private = NULL;
572 kfree(priv);
573 return ret;
574 }
575
576 priv->wq = alloc_ordered_workqueue("omapdrm", 0); 347 priv->wq = alloc_ordered_workqueue("omapdrm", 0);
577 348
578 INIT_LIST_HEAD(&priv->obj_list); 349 INIT_LIST_HEAD(&priv->obj_list);
@@ -584,10 +355,13 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
584 dev_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret); 355 dev_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret);
585 dev->dev_private = NULL; 356 dev->dev_private = NULL;
586 kfree(priv); 357 kfree(priv);
587 omapdss_compat_uninit();
588 return ret; 358 return ret;
589 } 359 }
590 360
361 ret = drm_vblank_init(dev, priv->num_crtcs);
362 if (ret)
363 dev_warn(dev->dev, "could not init vblank\n");
364
591 priv->fbdev = omap_fbdev_init(dev); 365 priv->fbdev = omap_fbdev_init(dev);
592 if (!priv->fbdev) { 366 if (!priv->fbdev) {
593 dev_warn(dev->dev, "omap_fbdev_init failed\n"); 367 dev_warn(dev->dev, "omap_fbdev_init failed\n");
@@ -596,10 +370,6 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
596 370
597 drm_kms_helper_poll_init(dev); 371 drm_kms_helper_poll_init(dev);
598 372
599 ret = drm_vblank_init(dev, priv->num_crtcs);
600 if (ret)
601 dev_warn(dev->dev, "could not init vblank\n");
602
603 return 0; 373 return 0;
604} 374}
605 375
@@ -609,8 +379,9 @@ static int dev_unload(struct drm_device *dev)
609 379
610 DBG("unload: dev=%p", dev); 380 DBG("unload: dev=%p", dev);
611 381
612 drm_vblank_cleanup(dev);
613 drm_kms_helper_poll_fini(dev); 382 drm_kms_helper_poll_fini(dev);
383 drm_vblank_cleanup(dev);
384 omap_drm_irq_uninstall(dev);
614 385
615 omap_fbdev_free(dev); 386 omap_fbdev_free(dev);
616 omap_modeset_free(dev); 387 omap_modeset_free(dev);
@@ -619,8 +390,6 @@ static int dev_unload(struct drm_device *dev)
619 flush_workqueue(priv->wq); 390 flush_workqueue(priv->wq);
620 destroy_workqueue(priv->wq); 391 destroy_workqueue(priv->wq);
621 392
622 omapdss_compat_uninit();
623
624 kfree(dev->dev_private); 393 kfree(dev->dev_private);
625 dev->dev_private = NULL; 394 dev->dev_private = NULL;
626 395
@@ -680,7 +449,9 @@ static void dev_lastclose(struct drm_device *dev)
680 } 449 }
681 } 450 }
682 451
452 mutex_lock(&dev->mode_config.mutex);
683 ret = drm_fb_helper_restore_fbdev_mode(priv->fbdev); 453 ret = drm_fb_helper_restore_fbdev_mode(priv->fbdev);
454 mutex_unlock(&dev->mode_config.mutex);
684 if (ret) 455 if (ret)
685 DBG("failed to restore crtc mode"); 456 DBG("failed to restore crtc mode");
686} 457}
@@ -695,60 +466,6 @@ static void dev_postclose(struct drm_device *dev, struct drm_file *file)
695 DBG("postclose: dev=%p, file=%p", dev, file); 466 DBG("postclose: dev=%p, file=%p", dev, file);
696} 467}
697 468
698/**
699 * enable_vblank - enable vblank interrupt events
700 * @dev: DRM device
701 * @crtc: which irq to enable
702 *
703 * Enable vblank interrupts for @crtc. If the device doesn't have
704 * a hardware vblank counter, this routine should be a no-op, since
705 * interrupts will have to stay on to keep the count accurate.
706 *
707 * RETURNS
708 * Zero on success, appropriate errno if the given @crtc's vblank
709 * interrupt cannot be enabled.
710 */
711static int dev_enable_vblank(struct drm_device *dev, int crtc)
712{
713 DBG("enable_vblank: dev=%p, crtc=%d", dev, crtc);
714 return 0;
715}
716
717/**
718 * disable_vblank - disable vblank interrupt events
719 * @dev: DRM device
720 * @crtc: which irq to enable
721 *
722 * Disable vblank interrupts for @crtc. If the device doesn't have
723 * a hardware vblank counter, this routine should be a no-op, since
724 * interrupts will have to stay on to keep the count accurate.
725 */
726static void dev_disable_vblank(struct drm_device *dev, int crtc)
727{
728 DBG("disable_vblank: dev=%p, crtc=%d", dev, crtc);
729}
730
731static irqreturn_t dev_irq_handler(DRM_IRQ_ARGS)
732{
733 return IRQ_HANDLED;
734}
735
736static void dev_irq_preinstall(struct drm_device *dev)
737{
738 DBG("irq_preinstall: dev=%p", dev);
739}
740
741static int dev_irq_postinstall(struct drm_device *dev)
742{
743 DBG("irq_postinstall: dev=%p", dev);
744 return 0;
745}
746
747static void dev_irq_uninstall(struct drm_device *dev)
748{
749 DBG("irq_uninstall: dev=%p", dev);
750}
751
752static const struct vm_operations_struct omap_gem_vm_ops = { 469static const struct vm_operations_struct omap_gem_vm_ops = {
753 .fault = omap_gem_fault, 470 .fault = omap_gem_fault,
754 .open = drm_gem_vm_open, 471 .open = drm_gem_vm_open,
@@ -778,12 +495,12 @@ static struct drm_driver omap_drm_driver = {
778 .preclose = dev_preclose, 495 .preclose = dev_preclose,
779 .postclose = dev_postclose, 496 .postclose = dev_postclose,
780 .get_vblank_counter = drm_vblank_count, 497 .get_vblank_counter = drm_vblank_count,
781 .enable_vblank = dev_enable_vblank, 498 .enable_vblank = omap_irq_enable_vblank,
782 .disable_vblank = dev_disable_vblank, 499 .disable_vblank = omap_irq_disable_vblank,
783 .irq_preinstall = dev_irq_preinstall, 500 .irq_preinstall = omap_irq_preinstall,
784 .irq_postinstall = dev_irq_postinstall, 501 .irq_postinstall = omap_irq_postinstall,
785 .irq_uninstall = dev_irq_uninstall, 502 .irq_uninstall = omap_irq_uninstall,
786 .irq_handler = dev_irq_handler, 503 .irq_handler = omap_irq_handler,
787#ifdef CONFIG_DEBUG_FS 504#ifdef CONFIG_DEBUG_FS
788 .debugfs_init = omap_debugfs_init, 505 .debugfs_init = omap_debugfs_init,
789 .debugfs_cleanup = omap_debugfs_cleanup, 506 .debugfs_cleanup = omap_debugfs_cleanup,
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index 1d4aea53b75..cd1f22b0b12 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -28,6 +28,7 @@
28#include <linux/platform_data/omap_drm.h> 28#include <linux/platform_data/omap_drm.h>
29#include "omap_drm.h" 29#include "omap_drm.h"
30 30
31
31#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) 32#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
32#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */ 33#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
33 34
@@ -39,6 +40,51 @@
39 */ 40 */
40#define MAX_MAPPERS 2 41#define MAX_MAPPERS 2
41 42
43/* parameters which describe (unrotated) coordinates of scanout within a fb: */
44struct omap_drm_window {
45 uint32_t rotation;
46 int32_t crtc_x, crtc_y; /* signed because can be offscreen */
47 uint32_t crtc_w, crtc_h;
48 uint32_t src_x, src_y;
49 uint32_t src_w, src_h;
50};
51
52/* Once GO bit is set, we can't make further updates to shadowed registers
53 * until the GO bit is cleared. So various parts in the kms code that need
54 * to update shadowed registers queue up a pair of callbacks, pre_apply
55 * which is called before setting GO bit, and post_apply that is called
56 * after GO bit is cleared. The crtc manages the queuing, and everyone
57 * else goes thru omap_crtc_apply() using these callbacks so that the
58 * code which has to deal w/ GO bit state is centralized.
59 */
60struct omap_drm_apply {
61 struct list_head pending_node, queued_node;
62 bool queued;
63 void (*pre_apply)(struct omap_drm_apply *apply);
64 void (*post_apply)(struct omap_drm_apply *apply);
65};
66
67/* For transiently registering for different DSS irqs that various parts
68 * of the KMS code need during setup/configuration. We these are not
69 * necessarily the same as what drm_vblank_get/put() are requesting, and
70 * the hysteresis in drm_vblank_put() is not necessarily desirable for
71 * internal housekeeping related irq usage.
72 */
73struct omap_drm_irq {
74 struct list_head node;
75 uint32_t irqmask;
76 bool registered;
77 void (*irq)(struct omap_drm_irq *irq, uint32_t irqstatus);
78};
79
80/* For KMS code that needs to wait for a certain # of IRQs:
81 */
82struct omap_irq_wait;
83struct omap_irq_wait * omap_irq_wait_init(struct drm_device *dev,
84 uint32_t irqmask, int count);
85int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
86 unsigned long timeout);
87
42struct omap_drm_private { 88struct omap_drm_private {
43 uint32_t omaprev; 89 uint32_t omaprev;
44 90
@@ -58,6 +104,7 @@ struct omap_drm_private {
58 104
59 struct workqueue_struct *wq; 105 struct workqueue_struct *wq;
60 106
107 /* list of GEM objects: */
61 struct list_head obj_list; 108 struct list_head obj_list;
62 109
63 bool has_dmm; 110 bool has_dmm;
@@ -65,6 +112,11 @@ struct omap_drm_private {
65 /* properties: */ 112 /* properties: */
66 struct drm_property *rotation_prop; 113 struct drm_property *rotation_prop;
67 struct drm_property *zorder_prop; 114 struct drm_property *zorder_prop;
115
116 /* irq handling: */
117 struct list_head irq_list; /* list of omap_drm_irq */
118 uint32_t vblank_mask; /* irq bits set for userspace vblank */
119 struct omap_drm_irq error_handler;
68}; 120};
69 121
70/* this should probably be in drm-core to standardize amongst drivers */ 122/* this should probably be in drm-core to standardize amongst drivers */
@@ -75,15 +127,6 @@ struct omap_drm_private {
75#define DRM_REFLECT_X 4 127#define DRM_REFLECT_X 4
76#define DRM_REFLECT_Y 5 128#define DRM_REFLECT_Y 5
77 129
78/* parameters which describe (unrotated) coordinates of scanout within a fb: */
79struct omap_drm_window {
80 uint32_t rotation;
81 int32_t crtc_x, crtc_y; /* signed because can be offscreen */
82 uint32_t crtc_w, crtc_h;
83 uint32_t src_x, src_y;
84 uint32_t src_w, src_h;
85};
86
87#ifdef CONFIG_DEBUG_FS 130#ifdef CONFIG_DEBUG_FS
88int omap_debugfs_init(struct drm_minor *minor); 131int omap_debugfs_init(struct drm_minor *minor);
89void omap_debugfs_cleanup(struct drm_minor *minor); 132void omap_debugfs_cleanup(struct drm_minor *minor);
@@ -92,23 +135,36 @@ void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m);
92void omap_gem_describe_objects(struct list_head *list, struct seq_file *m); 135void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
93#endif 136#endif
94 137
138int omap_irq_enable_vblank(struct drm_device *dev, int crtc);
139void omap_irq_disable_vblank(struct drm_device *dev, int crtc);
140irqreturn_t omap_irq_handler(DRM_IRQ_ARGS);
141void omap_irq_preinstall(struct drm_device *dev);
142int omap_irq_postinstall(struct drm_device *dev);
143void omap_irq_uninstall(struct drm_device *dev);
144void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq);
145void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq);
146int omap_drm_irq_uninstall(struct drm_device *dev);
147int omap_drm_irq_install(struct drm_device *dev);
148
95struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev); 149struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev);
96void omap_fbdev_free(struct drm_device *dev); 150void omap_fbdev_free(struct drm_device *dev);
97 151
152const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
153enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
154int omap_crtc_apply(struct drm_crtc *crtc,
155 struct omap_drm_apply *apply);
98struct drm_crtc *omap_crtc_init(struct drm_device *dev, 156struct drm_crtc *omap_crtc_init(struct drm_device *dev,
99 struct omap_overlay *ovl, int id); 157 struct drm_plane *plane, enum omap_channel channel, int id);
100 158
101struct drm_plane *omap_plane_init(struct drm_device *dev, 159struct drm_plane *omap_plane_init(struct drm_device *dev,
102 struct omap_overlay *ovl, unsigned int possible_crtcs, 160 int plane_id, bool private_plane);
103 bool priv);
104int omap_plane_dpms(struct drm_plane *plane, int mode); 161int omap_plane_dpms(struct drm_plane *plane, int mode);
105int omap_plane_mode_set(struct drm_plane *plane, 162int omap_plane_mode_set(struct drm_plane *plane,
106 struct drm_crtc *crtc, struct drm_framebuffer *fb, 163 struct drm_crtc *crtc, struct drm_framebuffer *fb,
107 int crtc_x, int crtc_y, 164 int crtc_x, int crtc_y,
108 unsigned int crtc_w, unsigned int crtc_h, 165 unsigned int crtc_w, unsigned int crtc_h,
109 uint32_t src_x, uint32_t src_y, 166 uint32_t src_x, uint32_t src_y,
110 uint32_t src_w, uint32_t src_h); 167 uint32_t src_w, uint32_t src_h,
111void omap_plane_on_endwin(struct drm_plane *plane,
112 void (*fxn)(void *), void *arg); 168 void (*fxn)(void *), void *arg);
113void omap_plane_install_properties(struct drm_plane *plane, 169void omap_plane_install_properties(struct drm_plane *plane,
114 struct drm_mode_object *obj); 170 struct drm_mode_object *obj);
@@ -116,21 +172,25 @@ int omap_plane_set_property(struct drm_plane *plane,
116 struct drm_property *property, uint64_t val); 172 struct drm_property *property, uint64_t val);
117 173
118struct drm_encoder *omap_encoder_init(struct drm_device *dev, 174struct drm_encoder *omap_encoder_init(struct drm_device *dev,
119 struct omap_overlay_manager *mgr); 175 struct omap_dss_device *dssdev);
120struct omap_overlay_manager *omap_encoder_get_manager( 176int omap_encoder_set_enabled(struct drm_encoder *encoder, bool enabled);
177int omap_encoder_update(struct drm_encoder *encoder,
178 struct omap_overlay_manager *mgr,
179 struct omap_video_timings *timings);
180
181struct drm_connector *omap_connector_init(struct drm_device *dev,
182 int connector_type, struct omap_dss_device *dssdev,
121 struct drm_encoder *encoder); 183 struct drm_encoder *encoder);
122struct drm_encoder *omap_connector_attached_encoder( 184struct drm_encoder *omap_connector_attached_encoder(
123 struct drm_connector *connector); 185 struct drm_connector *connector);
124enum drm_connector_status omap_connector_detect(
125 struct drm_connector *connector, bool force);
126
127struct drm_connector *omap_connector_init(struct drm_device *dev,
128 int connector_type, struct omap_dss_device *dssdev);
129void omap_connector_mode_set(struct drm_connector *connector,
130 struct drm_display_mode *mode);
131void omap_connector_flush(struct drm_connector *connector, 186void omap_connector_flush(struct drm_connector *connector,
132 int x, int y, int w, int h); 187 int x, int y, int w, int h);
133 188
189void copy_timings_omap_to_drm(struct drm_display_mode *mode,
190 struct omap_video_timings *timings);
191void copy_timings_drm_to_omap(struct omap_video_timings *timings,
192 struct drm_display_mode *mode);
193
134uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats, 194uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats,
135 uint32_t max_formats, enum omap_color_mode supported_modes); 195 uint32_t max_formats, enum omap_color_mode supported_modes);
136struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, 196struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
@@ -207,6 +267,40 @@ static inline int align_pitch(int pitch, int width, int bpp)
207 return ALIGN(pitch, 8 * bytespp); 267 return ALIGN(pitch, 8 * bytespp);
208} 268}
209 269
270static inline enum omap_channel pipe2chan(int pipe)
271{
272 int num_mgrs = dss_feat_get_num_mgrs();
273
274 /*
275 * We usually don't want to create a CRTC for each manager,
276 * at least not until we have a way to expose private planes
277 * to userspace. Otherwise there would not be enough video
278 * pipes left for drm planes. The higher #'d managers tend
279 * to have more features so start in reverse order.
280 */
281 return num_mgrs - pipe - 1;
282}
283
284/* map crtc to vblank mask */
285static inline uint32_t pipe2vbl(int crtc)
286{
287 enum omap_channel channel = pipe2chan(crtc);
288 return dispc_mgr_get_vsync_irq(channel);
289}
290
291static inline int crtc2pipe(struct drm_device *dev, struct drm_crtc *crtc)
292{
293 struct omap_drm_private *priv = dev->dev_private;
294 int i;
295
296 for (i = 0; i < ARRAY_SIZE(priv->crtcs); i++)
297 if (priv->crtcs[i] == crtc)
298 return i;
299
300 BUG(); /* bogus CRTC ptr */
301 return -1;
302}
303
210/* should these be made into common util helpers? 304/* should these be made into common util helpers?
211 */ 305 */
212 306
diff --git a/drivers/staging/omapdrm/omap_encoder.c b/drivers/staging/omapdrm/omap_encoder.c
index 5341d5e3e31..e053160d2db 100644
--- a/drivers/staging/omapdrm/omap_encoder.c
+++ b/drivers/staging/omapdrm/omap_encoder.c
@@ -22,37 +22,56 @@
22#include "drm_crtc.h" 22#include "drm_crtc.h"
23#include "drm_crtc_helper.h" 23#include "drm_crtc_helper.h"
24 24
25#include <linux/list.h>
26
27
25/* 28/*
26 * encoder funcs 29 * encoder funcs
27 */ 30 */
28 31
29#define to_omap_encoder(x) container_of(x, struct omap_encoder, base) 32#define to_omap_encoder(x) container_of(x, struct omap_encoder, base)
30 33
34/* The encoder and connector both map to same dssdev.. the encoder
35 * handles the 'active' parts, ie. anything the modifies the state
36 * of the hw, and the connector handles the 'read-only' parts, like
37 * detecting connection and reading edid.
38 */
31struct omap_encoder { 39struct omap_encoder {
32 struct drm_encoder base; 40 struct drm_encoder base;
33 struct omap_overlay_manager *mgr; 41 struct omap_dss_device *dssdev;
34}; 42};
35 43
36static void omap_encoder_destroy(struct drm_encoder *encoder) 44static void omap_encoder_destroy(struct drm_encoder *encoder)
37{ 45{
38 struct omap_encoder *omap_encoder = to_omap_encoder(encoder); 46 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
39 DBG("%s", omap_encoder->mgr->name);
40 drm_encoder_cleanup(encoder); 47 drm_encoder_cleanup(encoder);
41 kfree(omap_encoder); 48 kfree(omap_encoder);
42} 49}
43 50
51static const struct drm_encoder_funcs omap_encoder_funcs = {
52 .destroy = omap_encoder_destroy,
53};
54
55/*
56 * The CRTC drm_crtc_helper_set_mode() doesn't really give us the right
57 * order.. the easiest way to work around this for now is to make all
58 * the encoder-helper's no-op's and have the omap_crtc code take care
59 * of the sequencing and call us in the right points.
60 *
61 * Eventually to handle connecting CRTCs to different encoders properly,
62 * either the CRTC helpers need to change or we need to replace
63 * drm_crtc_helper_set_mode(), but lets wait until atomic-modeset for
64 * that.
65 */
66
44static void omap_encoder_dpms(struct drm_encoder *encoder, int mode) 67static void omap_encoder_dpms(struct drm_encoder *encoder, int mode)
45{ 68{
46 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
47 DBG("%s: %d", omap_encoder->mgr->name, mode);
48} 69}
49 70
50static bool omap_encoder_mode_fixup(struct drm_encoder *encoder, 71static bool omap_encoder_mode_fixup(struct drm_encoder *encoder,
51 const struct drm_display_mode *mode, 72 const struct drm_display_mode *mode,
52 struct drm_display_mode *adjusted_mode) 73 struct drm_display_mode *adjusted_mode)
53{ 74{
54 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
55 DBG("%s", omap_encoder->mgr->name);
56 return true; 75 return true;
57} 76}
58 77
@@ -60,47 +79,16 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
60 struct drm_display_mode *mode, 79 struct drm_display_mode *mode,
61 struct drm_display_mode *adjusted_mode) 80 struct drm_display_mode *adjusted_mode)
62{ 81{
63 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
64 struct drm_device *dev = encoder->dev;
65 struct omap_drm_private *priv = dev->dev_private;
66 int i;
67
68 mode = adjusted_mode;
69
70 DBG("%s: set mode: %dx%d", omap_encoder->mgr->name,
71 mode->hdisplay, mode->vdisplay);
72
73 for (i = 0; i < priv->num_connectors; i++) {
74 struct drm_connector *connector = priv->connectors[i];
75 if (connector->encoder == encoder)
76 omap_connector_mode_set(connector, mode);
77
78 }
79} 82}
80 83
81static void omap_encoder_prepare(struct drm_encoder *encoder) 84static void omap_encoder_prepare(struct drm_encoder *encoder)
82{ 85{
83 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
84 struct drm_encoder_helper_funcs *encoder_funcs =
85 encoder->helper_private;
86 DBG("%s", omap_encoder->mgr->name);
87 encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
88} 86}
89 87
90static void omap_encoder_commit(struct drm_encoder *encoder) 88static void omap_encoder_commit(struct drm_encoder *encoder)
91{ 89{
92 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
93 struct drm_encoder_helper_funcs *encoder_funcs =
94 encoder->helper_private;
95 DBG("%s", omap_encoder->mgr->name);
96 omap_encoder->mgr->apply(omap_encoder->mgr);
97 encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
98} 90}
99 91
100static const struct drm_encoder_funcs omap_encoder_funcs = {
101 .destroy = omap_encoder_destroy,
102};
103
104static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = { 92static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
105 .dpms = omap_encoder_dpms, 93 .dpms = omap_encoder_dpms,
106 .mode_fixup = omap_encoder_mode_fixup, 94 .mode_fixup = omap_encoder_mode_fixup,
@@ -109,23 +97,54 @@ static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
109 .commit = omap_encoder_commit, 97 .commit = omap_encoder_commit,
110}; 98};
111 99
112struct omap_overlay_manager *omap_encoder_get_manager( 100/*
113 struct drm_encoder *encoder) 101 * Instead of relying on the helpers for modeset, the omap_crtc code
102 * calls these functions in the proper sequence.
103 */
104
105int omap_encoder_set_enabled(struct drm_encoder *encoder, bool enabled)
114{ 106{
115 struct omap_encoder *omap_encoder = to_omap_encoder(encoder); 107 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
116 return omap_encoder->mgr; 108 struct omap_dss_device *dssdev = omap_encoder->dssdev;
109 struct omap_dss_driver *dssdrv = dssdev->driver;
110
111 if (enabled) {
112 return dssdrv->enable(dssdev);
113 } else {
114 dssdrv->disable(dssdev);
115 return 0;
116 }
117}
118
119int omap_encoder_update(struct drm_encoder *encoder,
120 struct omap_overlay_manager *mgr,
121 struct omap_video_timings *timings)
122{
123 struct drm_device *dev = encoder->dev;
124 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
125 struct omap_dss_device *dssdev = omap_encoder->dssdev;
126 struct omap_dss_driver *dssdrv = dssdev->driver;
127 int ret;
128
129 dssdev->output->manager = mgr;
130
131 ret = dssdrv->check_timings(dssdev, timings);
132 if (ret) {
133 dev_err(dev->dev, "could not set timings: %d\n", ret);
134 return ret;
135 }
136
137 dssdrv->set_timings(dssdev, timings);
138
139 return 0;
117} 140}
118 141
119/* initialize encoder */ 142/* initialize encoder */
120struct drm_encoder *omap_encoder_init(struct drm_device *dev, 143struct drm_encoder *omap_encoder_init(struct drm_device *dev,
121 struct omap_overlay_manager *mgr) 144 struct omap_dss_device *dssdev)
122{ 145{
123 struct drm_encoder *encoder = NULL; 146 struct drm_encoder *encoder = NULL;
124 struct omap_encoder *omap_encoder; 147 struct omap_encoder *omap_encoder;
125 struct omap_overlay_manager_info info;
126 int ret;
127
128 DBG("%s", mgr->name);
129 148
130 omap_encoder = kzalloc(sizeof(*omap_encoder), GFP_KERNEL); 149 omap_encoder = kzalloc(sizeof(*omap_encoder), GFP_KERNEL);
131 if (!omap_encoder) { 150 if (!omap_encoder) {
@@ -133,33 +152,14 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev,
133 goto fail; 152 goto fail;
134 } 153 }
135 154
136 omap_encoder->mgr = mgr; 155 omap_encoder->dssdev = dssdev;
156
137 encoder = &omap_encoder->base; 157 encoder = &omap_encoder->base;
138 158
139 drm_encoder_init(dev, encoder, &omap_encoder_funcs, 159 drm_encoder_init(dev, encoder, &omap_encoder_funcs,
140 DRM_MODE_ENCODER_TMDS); 160 DRM_MODE_ENCODER_TMDS);
141 drm_encoder_helper_add(encoder, &omap_encoder_helper_funcs); 161 drm_encoder_helper_add(encoder, &omap_encoder_helper_funcs);
142 162
143 mgr->get_manager_info(mgr, &info);
144
145 /* TODO: fix hard-coded setup.. */
146 info.default_color = 0x00000000;
147 info.trans_key = 0x00000000;
148 info.trans_key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
149 info.trans_enabled = false;
150
151 ret = mgr->set_manager_info(mgr, &info);
152 if (ret) {
153 dev_err(dev->dev, "could not set manager info\n");
154 goto fail;
155 }
156
157 ret = mgr->apply(mgr);
158 if (ret) {
159 dev_err(dev->dev, "could not apply\n");
160 goto fail;
161 }
162
163 return encoder; 163 return encoder;
164 164
165fail: 165fail:
diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c
index 9a302062b03..b6c5b5c6c8c 100644
--- a/drivers/staging/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c
@@ -194,7 +194,7 @@ struct dma_buf_ops omap_dmabuf_ops = {
194struct dma_buf *omap_gem_prime_export(struct drm_device *dev, 194struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
195 struct drm_gem_object *obj, int flags) 195 struct drm_gem_object *obj, int flags)
196{ 196{
197 return dma_buf_export(obj, &omap_dmabuf_ops, obj->size, 0600); 197 return dma_buf_export(obj, &omap_dmabuf_ops, obj->size, flags);
198} 198}
199 199
200struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, 200struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
@@ -207,7 +207,12 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
207 obj = buffer->priv; 207 obj = buffer->priv;
208 /* is it from our device? */ 208 /* is it from our device? */
209 if (obj->dev == dev) { 209 if (obj->dev == dev) {
210 /*
211 * Importing dmabuf exported from out own gem increases
212 * refcount on gem itself instead of f_count of dmabuf.
213 */
210 drm_gem_object_reference(obj); 214 drm_gem_object_reference(obj);
215 dma_buf_put(buffer);
211 return obj; 216 return obj;
212 } 217 }
213 } 218 }
diff --git a/drivers/staging/omapdrm/omap_irq.c b/drivers/staging/omapdrm/omap_irq.c
new file mode 100644
index 00000000000..2629ba7be6c
--- /dev/null
+++ b/drivers/staging/omapdrm/omap_irq.c
@@ -0,0 +1,322 @@
1/*
2 * drivers/staging/omapdrm/omap_irq.c
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Rob Clark <rob.clark@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "omap_drv.h"
21
22static DEFINE_SPINLOCK(list_lock);
23
24static void omap_irq_error_handler(struct omap_drm_irq *irq,
25 uint32_t irqstatus)
26{
27 DRM_ERROR("errors: %08x\n", irqstatus);
28}
29
30/* call with list_lock and dispc runtime held */
31static void omap_irq_update(struct drm_device *dev)
32{
33 struct omap_drm_private *priv = dev->dev_private;
34 struct omap_drm_irq *irq;
35 uint32_t irqmask = priv->vblank_mask;
36
37 BUG_ON(!spin_is_locked(&list_lock));
38
39 list_for_each_entry(irq, &priv->irq_list, node)
40 irqmask |= irq->irqmask;
41
42 DBG("irqmask=%08x", irqmask);
43
44 dispc_write_irqenable(irqmask);
45 dispc_read_irqenable(); /* flush posted write */
46}
47
48void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq)
49{
50 struct omap_drm_private *priv = dev->dev_private;
51 unsigned long flags;
52
53 dispc_runtime_get();
54 spin_lock_irqsave(&list_lock, flags);
55
56 if (!WARN_ON(irq->registered)) {
57 irq->registered = true;
58 list_add(&irq->node, &priv->irq_list);
59 omap_irq_update(dev);
60 }
61
62 spin_unlock_irqrestore(&list_lock, flags);
63 dispc_runtime_put();
64}
65
66void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq)
67{
68 unsigned long flags;
69
70 dispc_runtime_get();
71 spin_lock_irqsave(&list_lock, flags);
72
73 if (!WARN_ON(!irq->registered)) {
74 irq->registered = false;
75 list_del(&irq->node);
76 omap_irq_update(dev);
77 }
78
79 spin_unlock_irqrestore(&list_lock, flags);
80 dispc_runtime_put();
81}
82
83struct omap_irq_wait {
84 struct omap_drm_irq irq;
85 int count;
86};
87
88static DECLARE_WAIT_QUEUE_HEAD(wait_event);
89
90static void wait_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
91{
92 struct omap_irq_wait *wait =
93 container_of(irq, struct omap_irq_wait, irq);
94 wait->count--;
95 wake_up_all(&wait_event);
96}
97
98struct omap_irq_wait * omap_irq_wait_init(struct drm_device *dev,
99 uint32_t irqmask, int count)
100{
101 struct omap_irq_wait *wait = kzalloc(sizeof(*wait), GFP_KERNEL);
102 wait->irq.irq = wait_irq;
103 wait->irq.irqmask = irqmask;
104 wait->count = count;
105 omap_irq_register(dev, &wait->irq);
106 return wait;
107}
108
109int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
110 unsigned long timeout)
111{
112 int ret = wait_event_timeout(wait_event, (wait->count <= 0), timeout);
113 omap_irq_unregister(dev, &wait->irq);
114 kfree(wait);
115 if (ret == 0)
116 return -1;
117 return 0;
118}
119
120/**
121 * enable_vblank - enable vblank interrupt events
122 * @dev: DRM device
123 * @crtc: which irq to enable
124 *
125 * Enable vblank interrupts for @crtc. If the device doesn't have
126 * a hardware vblank counter, this routine should be a no-op, since
127 * interrupts will have to stay on to keep the count accurate.
128 *
129 * RETURNS
130 * Zero on success, appropriate errno if the given @crtc's vblank
131 * interrupt cannot be enabled.
132 */
133int omap_irq_enable_vblank(struct drm_device *dev, int crtc)
134{
135 struct omap_drm_private *priv = dev->dev_private;
136 unsigned long flags;
137
138 DBG("dev=%p, crtc=%d", dev, crtc);
139
140 dispc_runtime_get();
141 spin_lock_irqsave(&list_lock, flags);
142 priv->vblank_mask |= pipe2vbl(crtc);
143 omap_irq_update(dev);
144 spin_unlock_irqrestore(&list_lock, flags);
145 dispc_runtime_put();
146
147 return 0;
148}
149
150/**
151 * disable_vblank - disable vblank interrupt events
152 * @dev: DRM device
153 * @crtc: which irq to enable
154 *
155 * Disable vblank interrupts for @crtc. If the device doesn't have
156 * a hardware vblank counter, this routine should be a no-op, since
157 * interrupts will have to stay on to keep the count accurate.
158 */
159void omap_irq_disable_vblank(struct drm_device *dev, int crtc)
160{
161 struct omap_drm_private *priv = dev->dev_private;
162 unsigned long flags;
163
164 DBG("dev=%p, crtc=%d", dev, crtc);
165
166 dispc_runtime_get();
167 spin_lock_irqsave(&list_lock, flags);
168 priv->vblank_mask &= ~pipe2vbl(crtc);
169 omap_irq_update(dev);
170 spin_unlock_irqrestore(&list_lock, flags);
171 dispc_runtime_put();
172}
173
174irqreturn_t omap_irq_handler(DRM_IRQ_ARGS)
175{
176 struct drm_device *dev = (struct drm_device *) arg;
177 struct omap_drm_private *priv = dev->dev_private;
178 struct omap_drm_irq *handler, *n;
179 unsigned long flags;
180 unsigned int id;
181 u32 irqstatus;
182
183 irqstatus = dispc_read_irqstatus();
184 dispc_clear_irqstatus(irqstatus);
185 dispc_read_irqstatus(); /* flush posted write */
186
187 VERB("irqs: %08x", irqstatus);
188
189 for (id = 0; id < priv->num_crtcs; id++)
190 if (irqstatus & pipe2vbl(id))
191 drm_handle_vblank(dev, id);
192
193 spin_lock_irqsave(&list_lock, flags);
194 list_for_each_entry_safe(handler, n, &priv->irq_list, node) {
195 if (handler->irqmask & irqstatus) {
196 spin_unlock_irqrestore(&list_lock, flags);
197 handler->irq(handler, handler->irqmask & irqstatus);
198 spin_lock_irqsave(&list_lock, flags);
199 }
200 }
201 spin_unlock_irqrestore(&list_lock, flags);
202
203 return IRQ_HANDLED;
204}
205
206void omap_irq_preinstall(struct drm_device *dev)
207{
208 DBG("dev=%p", dev);
209 dispc_runtime_get();
210 dispc_clear_irqstatus(0xffffffff);
211 dispc_runtime_put();
212}
213
214int omap_irq_postinstall(struct drm_device *dev)
215{
216 struct omap_drm_private *priv = dev->dev_private;
217 struct omap_drm_irq *error_handler = &priv->error_handler;
218
219 DBG("dev=%p", dev);
220
221 INIT_LIST_HEAD(&priv->irq_list);
222
223 error_handler->irq = omap_irq_error_handler;
224 error_handler->irqmask = DISPC_IRQ_OCP_ERR;
225
226 /* for now ignore DISPC_IRQ_SYNC_LOST_DIGIT.. really I think
227 * we just need to ignore it while enabling tv-out
228 */
229 error_handler->irqmask &= ~DISPC_IRQ_SYNC_LOST_DIGIT;
230
231 omap_irq_register(dev, error_handler);
232
233 return 0;
234}
235
236void omap_irq_uninstall(struct drm_device *dev)
237{
238 DBG("dev=%p", dev);
239 // TODO prolly need to call drm_irq_uninstall() somewhere too
240}
241
242/*
243 * We need a special version, instead of just using drm_irq_install(),
244 * because we need to register the irq via omapdss. Once omapdss and
245 * omapdrm are merged together we can assign the dispc hwmod data to
246 * ourselves and drop these and just use drm_irq_{install,uninstall}()
247 */
248
249int omap_drm_irq_install(struct drm_device *dev)
250{
251 int ret;
252
253 mutex_lock(&dev->struct_mutex);
254
255 if (dev->irq_enabled) {
256 mutex_unlock(&dev->struct_mutex);
257 return -EBUSY;
258 }
259 dev->irq_enabled = 1;
260 mutex_unlock(&dev->struct_mutex);
261
262 /* Before installing handler */
263 if (dev->driver->irq_preinstall)
264 dev->driver->irq_preinstall(dev);
265
266 ret = dispc_request_irq(dev->driver->irq_handler, dev);
267
268 if (ret < 0) {
269 mutex_lock(&dev->struct_mutex);
270 dev->irq_enabled = 0;
271 mutex_unlock(&dev->struct_mutex);
272 return ret;
273 }
274
275 /* After installing handler */
276 if (dev->driver->irq_postinstall)
277 ret = dev->driver->irq_postinstall(dev);
278
279 if (ret < 0) {
280 mutex_lock(&dev->struct_mutex);
281 dev->irq_enabled = 0;
282 mutex_unlock(&dev->struct_mutex);
283 dispc_free_irq(dev);
284 }
285
286 return ret;
287}
288
289int omap_drm_irq_uninstall(struct drm_device *dev)
290{
291 unsigned long irqflags;
292 int irq_enabled, i;
293
294 mutex_lock(&dev->struct_mutex);
295 irq_enabled = dev->irq_enabled;
296 dev->irq_enabled = 0;
297 mutex_unlock(&dev->struct_mutex);
298
299 /*
300 * Wake up any waiters so they don't hang.
301 */
302 if (dev->num_crtcs) {
303 spin_lock_irqsave(&dev->vbl_lock, irqflags);
304 for (i = 0; i < dev->num_crtcs; i++) {
305 DRM_WAKEUP(&dev->vbl_queue[i]);
306 dev->vblank_enabled[i] = 0;
307 dev->last_vblank[i] =
308 dev->driver->get_vblank_counter(dev, i);
309 }
310 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
311 }
312
313 if (!irq_enabled)
314 return -EINVAL;
315
316 if (dev->driver->irq_uninstall)
317 dev->driver->irq_uninstall(dev);
318
319 dispc_free_irq(dev);
320
321 return 0;
322}
diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c
index 2a8e5bab49c..bb989d7f026 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -41,12 +41,14 @@ struct callback {
41 41
42struct omap_plane { 42struct omap_plane {
43 struct drm_plane base; 43 struct drm_plane base;
44 struct omap_overlay *ovl; 44 int id; /* TODO rename omap_plane -> omap_plane_id in omapdss so I can use the enum */
45 const char *name;
45 struct omap_overlay_info info; 46 struct omap_overlay_info info;
47 struct omap_drm_apply apply;
46 48
47 /* position/orientation of scanout within the fb: */ 49 /* position/orientation of scanout within the fb: */
48 struct omap_drm_window win; 50 struct omap_drm_window win;
49 51 bool enabled;
50 52
51 /* last fb that we pinned: */ 53 /* last fb that we pinned: */
52 struct drm_framebuffer *pinned_fb; 54 struct drm_framebuffer *pinned_fb;
@@ -54,189 +56,15 @@ struct omap_plane {
54 uint32_t nformats; 56 uint32_t nformats;
55 uint32_t formats[32]; 57 uint32_t formats[32];
56 58
57 /* for synchronizing access to unpins fifo */ 59 struct omap_drm_irq error_irq;
58 struct mutex unpin_mutex;
59 60
60 /* set of bo's pending unpin until next END_WIN irq */ 61 /* set of bo's pending unpin until next post_apply() */
61 DECLARE_KFIFO_PTR(unpin_fifo, struct drm_gem_object *); 62 DECLARE_KFIFO_PTR(unpin_fifo, struct drm_gem_object *);
62 int num_unpins, pending_num_unpins;
63
64 /* for deferred unpin when we need to wait for scanout complete irq */
65 struct work_struct work;
66
67 /* callback on next endwin irq */
68 struct callback endwin;
69};
70 63
71/* map from ovl->id to the irq we are interested in for scanout-done */ 64 // XXX maybe get rid of this and handle vblank in crtc too?
72static const uint32_t id2irq[] = { 65 struct callback apply_done_cb;
73 [OMAP_DSS_GFX] = DISPC_IRQ_GFX_END_WIN,
74 [OMAP_DSS_VIDEO1] = DISPC_IRQ_VID1_END_WIN,
75 [OMAP_DSS_VIDEO2] = DISPC_IRQ_VID2_END_WIN,
76 [OMAP_DSS_VIDEO3] = DISPC_IRQ_VID3_END_WIN,
77}; 66};
78 67
79static void dispc_isr(void *arg, uint32_t mask)
80{
81 struct drm_plane *plane = arg;
82 struct omap_plane *omap_plane = to_omap_plane(plane);
83 struct omap_drm_private *priv = plane->dev->dev_private;
84
85 omap_dispc_unregister_isr(dispc_isr, plane,
86 id2irq[omap_plane->ovl->id]);
87
88 queue_work(priv->wq, &omap_plane->work);
89}
90
91static void unpin_worker(struct work_struct *work)
92{
93 struct omap_plane *omap_plane =
94 container_of(work, struct omap_plane, work);
95 struct callback endwin;
96
97 mutex_lock(&omap_plane->unpin_mutex);
98 DBG("unpinning %d of %d", omap_plane->num_unpins,
99 omap_plane->num_unpins + omap_plane->pending_num_unpins);
100 while (omap_plane->num_unpins > 0) {
101 struct drm_gem_object *bo = NULL;
102 int ret = kfifo_get(&omap_plane->unpin_fifo, &bo);
103 WARN_ON(!ret);
104 omap_gem_put_paddr(bo);
105 drm_gem_object_unreference_unlocked(bo);
106 omap_plane->num_unpins--;
107 }
108 endwin = omap_plane->endwin;
109 omap_plane->endwin.fxn = NULL;
110 mutex_unlock(&omap_plane->unpin_mutex);
111
112 if (endwin.fxn)
113 endwin.fxn(endwin.arg);
114}
115
116static void install_irq(struct drm_plane *plane)
117{
118 struct omap_plane *omap_plane = to_omap_plane(plane);
119 struct omap_overlay *ovl = omap_plane->ovl;
120 int ret;
121
122 ret = omap_dispc_register_isr(dispc_isr, plane, id2irq[ovl->id]);
123
124 /*
125 * omapdss has upper limit on # of registered irq handlers,
126 * which we shouldn't hit.. but if we do the limit should
127 * be raised or bad things happen:
128 */
129 WARN_ON(ret == -EBUSY);
130}
131
132/* push changes down to dss2 */
133static int commit(struct drm_plane *plane)
134{
135 struct drm_device *dev = plane->dev;
136 struct omap_plane *omap_plane = to_omap_plane(plane);
137 struct omap_overlay *ovl = omap_plane->ovl;
138 struct omap_overlay_info *info = &omap_plane->info;
139 int ret;
140
141 DBG("%s", ovl->name);
142 DBG("%dx%d -> %dx%d (%d)", info->width, info->height, info->out_width,
143 info->out_height, info->screen_width);
144 DBG("%d,%d %08x %08x", info->pos_x, info->pos_y,
145 info->paddr, info->p_uv_addr);
146
147 /* NOTE: do we want to do this at all here, or just wait
148 * for dpms(ON) since other CRTC's may not have their mode
149 * set yet, so fb dimensions may still change..
150 */
151 ret = ovl->set_overlay_info(ovl, info);
152 if (ret) {
153 dev_err(dev->dev, "could not set overlay info\n");
154 return ret;
155 }
156
157 mutex_lock(&omap_plane->unpin_mutex);
158 omap_plane->num_unpins += omap_plane->pending_num_unpins;
159 omap_plane->pending_num_unpins = 0;
160 mutex_unlock(&omap_plane->unpin_mutex);
161
162 /* our encoder doesn't necessarily get a commit() after this, in
163 * particular in the dpms() and mode_set_base() cases, so force the
164 * manager to update:
165 *
166 * could this be in the encoder somehow?
167 */
168 if (ovl->manager) {
169 ret = ovl->manager->apply(ovl->manager);
170 if (ret) {
171 dev_err(dev->dev, "could not apply settings\n");
172 return ret;
173 }
174
175 /*
176 * NOTE: really this should be atomic w/ mgr->apply() but
177 * omapdss does not expose such an API
178 */
179 if (omap_plane->num_unpins > 0)
180 install_irq(plane);
181
182 } else {
183 struct omap_drm_private *priv = dev->dev_private;
184 queue_work(priv->wq, &omap_plane->work);
185 }
186
187
188 if (ovl->is_enabled(ovl)) {
189 omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y,
190 info->out_width, info->out_height);
191 }
192
193 return 0;
194}
195
196/* when CRTC that we are attached to has potentially changed, this checks
197 * if we are attached to proper manager, and if necessary updates.
198 */
199static void update_manager(struct drm_plane *plane)
200{
201 struct omap_drm_private *priv = plane->dev->dev_private;
202 struct omap_plane *omap_plane = to_omap_plane(plane);
203 struct omap_overlay *ovl = omap_plane->ovl;
204 struct omap_overlay_manager *mgr = NULL;
205 int i;
206
207 if (plane->crtc) {
208 for (i = 0; i < priv->num_encoders; i++) {
209 struct drm_encoder *encoder = priv->encoders[i];
210 if (encoder->crtc == plane->crtc) {
211 mgr = omap_encoder_get_manager(encoder);
212 break;
213 }
214 }
215 }
216
217 if (ovl->manager != mgr) {
218 bool enabled = ovl->is_enabled(ovl);
219
220 /* don't switch things around with enabled overlays: */
221 if (enabled)
222 omap_plane_dpms(plane, DRM_MODE_DPMS_OFF);
223
224 if (ovl->manager) {
225 DBG("disconnecting %s from %s", ovl->name,
226 ovl->manager->name);
227 ovl->unset_manager(ovl);
228 }
229
230 if (mgr) {
231 DBG("connecting %s to %s", ovl->name, mgr->name);
232 ovl->set_manager(ovl, mgr);
233 }
234
235 if (enabled && mgr)
236 omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
237 }
238}
239
240static void unpin(void *arg, struct drm_gem_object *bo) 68static void unpin(void *arg, struct drm_gem_object *bo)
241{ 69{
242 struct drm_plane *plane = arg; 70 struct drm_plane *plane = arg;
@@ -244,7 +72,6 @@ static void unpin(void *arg, struct drm_gem_object *bo)
244 72
245 if (kfifo_put(&omap_plane->unpin_fifo, 73 if (kfifo_put(&omap_plane->unpin_fifo,
246 (const struct drm_gem_object **)&bo)) { 74 (const struct drm_gem_object **)&bo)) {
247 omap_plane->pending_num_unpins++;
248 /* also hold a ref so it isn't free'd while pinned */ 75 /* also hold a ref so it isn't free'd while pinned */
249 drm_gem_object_reference(bo); 76 drm_gem_object_reference(bo);
250 } else { 77 } else {
@@ -264,13 +91,19 @@ static int update_pin(struct drm_plane *plane, struct drm_framebuffer *fb)
264 91
265 DBG("%p -> %p", pinned_fb, fb); 92 DBG("%p -> %p", pinned_fb, fb);
266 93
267 mutex_lock(&omap_plane->unpin_mutex); 94 if (fb)
95 drm_framebuffer_reference(fb);
96
268 ret = omap_framebuffer_replace(pinned_fb, fb, plane, unpin); 97 ret = omap_framebuffer_replace(pinned_fb, fb, plane, unpin);
269 mutex_unlock(&omap_plane->unpin_mutex); 98
99 if (pinned_fb)
100 drm_framebuffer_unreference(pinned_fb);
270 101
271 if (ret) { 102 if (ret) {
272 dev_err(plane->dev->dev, "could not swap %p -> %p\n", 103 dev_err(plane->dev->dev, "could not swap %p -> %p\n",
273 omap_plane->pinned_fb, fb); 104 omap_plane->pinned_fb, fb);
105 if (fb)
106 drm_framebuffer_unreference(fb);
274 omap_plane->pinned_fb = NULL; 107 omap_plane->pinned_fb = NULL;
275 return ret; 108 return ret;
276 } 109 }
@@ -281,31 +114,90 @@ static int update_pin(struct drm_plane *plane, struct drm_framebuffer *fb)
281 return 0; 114 return 0;
282} 115}
283 116
284/* update parameters that are dependent on the framebuffer dimensions and 117static void omap_plane_pre_apply(struct omap_drm_apply *apply)
285 * position within the fb that this plane scans out from. This is called
286 * when framebuffer or x,y base may have changed.
287 */
288static void update_scanout(struct drm_plane *plane)
289{ 118{
290 struct omap_plane *omap_plane = to_omap_plane(plane); 119 struct omap_plane *omap_plane =
291 struct omap_overlay_info *info = &omap_plane->info; 120 container_of(apply, struct omap_plane, apply);
292 struct omap_drm_window *win = &omap_plane->win; 121 struct omap_drm_window *win = &omap_plane->win;
122 struct drm_plane *plane = &omap_plane->base;
123 struct drm_device *dev = plane->dev;
124 struct omap_overlay_info *info = &omap_plane->info;
125 struct drm_crtc *crtc = plane->crtc;
126 enum omap_channel channel;
127 bool enabled = omap_plane->enabled && crtc;
128 bool ilace, replication;
293 int ret; 129 int ret;
294 130
295 ret = update_pin(plane, plane->fb); 131 DBG("%s, enabled=%d", omap_plane->name, enabled);
296 if (ret) { 132
297 dev_err(plane->dev->dev, 133 /* if fb has changed, pin new fb: */
298 "could not pin fb: %d\n", ret); 134 update_pin(plane, enabled ? plane->fb : NULL);
299 omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); 135
136 if (!enabled) {
137 dispc_ovl_enable(omap_plane->id, false);
300 return; 138 return;
301 } 139 }
302 140
141 channel = omap_crtc_channel(crtc);
142
143 /* update scanout: */
303 omap_framebuffer_update_scanout(plane->fb, win, info); 144 omap_framebuffer_update_scanout(plane->fb, win, info);
304 145
305 DBG("%s: %d,%d: %08x %08x (%d)", omap_plane->ovl->name, 146 DBG("%dx%d -> %dx%d (%d)", info->width, info->height,
306 win->src_x, win->src_y, 147 info->out_width, info->out_height,
307 (u32)info->paddr, (u32)info->p_uv_addr,
308 info->screen_width); 148 info->screen_width);
149 DBG("%d,%d %08x %08x", info->pos_x, info->pos_y,
150 info->paddr, info->p_uv_addr);
151
152 /* TODO: */
153 ilace = false;
154 replication = false;
155
156 /* and finally, update omapdss: */
157 ret = dispc_ovl_setup(omap_plane->id, info,
158 replication, omap_crtc_timings(crtc), false);
159 if (ret) {
160 dev_err(dev->dev, "dispc_ovl_setup failed: %d\n", ret);
161 return;
162 }
163
164 dispc_ovl_enable(omap_plane->id, true);
165 dispc_ovl_set_channel_out(omap_plane->id, channel);
166}
167
168static void omap_plane_post_apply(struct omap_drm_apply *apply)
169{
170 struct omap_plane *omap_plane =
171 container_of(apply, struct omap_plane, apply);
172 struct drm_plane *plane = &omap_plane->base;
173 struct omap_overlay_info *info = &omap_plane->info;
174 struct drm_gem_object *bo = NULL;
175 struct callback cb;
176
177 cb = omap_plane->apply_done_cb;
178 omap_plane->apply_done_cb.fxn = NULL;
179
180 while (kfifo_get(&omap_plane->unpin_fifo, &bo)) {
181 omap_gem_put_paddr(bo);
182 drm_gem_object_unreference_unlocked(bo);
183 }
184
185 if (cb.fxn)
186 cb.fxn(cb.arg);
187
188 if (omap_plane->enabled) {
189 omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y,
190 info->out_width, info->out_height);
191 }
192}
193
194static int apply(struct drm_plane *plane)
195{
196 if (plane->crtc) {
197 struct omap_plane *omap_plane = to_omap_plane(plane);
198 return omap_crtc_apply(plane->crtc, &omap_plane->apply);
199 }
200 return 0;
309} 201}
310 202
311int omap_plane_mode_set(struct drm_plane *plane, 203int omap_plane_mode_set(struct drm_plane *plane,
@@ -313,7 +205,8 @@ int omap_plane_mode_set(struct drm_plane *plane,
313 int crtc_x, int crtc_y, 205 int crtc_x, int crtc_y,
314 unsigned int crtc_w, unsigned int crtc_h, 206 unsigned int crtc_w, unsigned int crtc_h,
315 uint32_t src_x, uint32_t src_y, 207 uint32_t src_x, uint32_t src_y,
316 uint32_t src_w, uint32_t src_h) 208 uint32_t src_w, uint32_t src_h,
209 void (*fxn)(void *), void *arg)
317{ 210{
318 struct omap_plane *omap_plane = to_omap_plane(plane); 211 struct omap_plane *omap_plane = to_omap_plane(plane);
319 struct omap_drm_window *win = &omap_plane->win; 212 struct omap_drm_window *win = &omap_plane->win;
@@ -329,17 +222,20 @@ int omap_plane_mode_set(struct drm_plane *plane,
329 win->src_w = src_w >> 16; 222 win->src_w = src_w >> 16;
330 win->src_h = src_h >> 16; 223 win->src_h = src_h >> 16;
331 224
332 /* note: this is done after this fxn returns.. but if we need 225 if (fxn) {
333 * to do a commit/update_scanout, etc before this returns we 226 /* omap_crtc should ensure that a new page flip
334 * need the current value. 227 * isn't permitted while there is one pending:
335 */ 228 */
229 BUG_ON(omap_plane->apply_done_cb.fxn);
230
231 omap_plane->apply_done_cb.fxn = fxn;
232 omap_plane->apply_done_cb.arg = arg;
233 }
234
336 plane->fb = fb; 235 plane->fb = fb;
337 plane->crtc = crtc; 236 plane->crtc = crtc;
338 237
339 update_scanout(plane); 238 return apply(plane);
340 update_manager(plane);
341
342 return 0;
343} 239}
344 240
345static int omap_plane_update(struct drm_plane *plane, 241static int omap_plane_update(struct drm_plane *plane,
@@ -349,9 +245,12 @@ static int omap_plane_update(struct drm_plane *plane,
349 uint32_t src_x, uint32_t src_y, 245 uint32_t src_x, uint32_t src_y,
350 uint32_t src_w, uint32_t src_h) 246 uint32_t src_w, uint32_t src_h)
351{ 247{
352 omap_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, 248 struct omap_plane *omap_plane = to_omap_plane(plane);
353 src_x, src_y, src_w, src_h); 249 omap_plane->enabled = true;
354 return omap_plane_dpms(plane, DRM_MODE_DPMS_ON); 250 return omap_plane_mode_set(plane, crtc, fb,
251 crtc_x, crtc_y, crtc_w, crtc_h,
252 src_x, src_y, src_w, src_h,
253 NULL, NULL);
355} 254}
356 255
357static int omap_plane_disable(struct drm_plane *plane) 256static int omap_plane_disable(struct drm_plane *plane)
@@ -364,48 +263,32 @@ static int omap_plane_disable(struct drm_plane *plane)
364static void omap_plane_destroy(struct drm_plane *plane) 263static void omap_plane_destroy(struct drm_plane *plane)
365{ 264{
366 struct omap_plane *omap_plane = to_omap_plane(plane); 265 struct omap_plane *omap_plane = to_omap_plane(plane);
367 DBG("%s", omap_plane->ovl->name); 266
267 DBG("%s", omap_plane->name);
268
269 omap_irq_unregister(plane->dev, &omap_plane->error_irq);
270
368 omap_plane_disable(plane); 271 omap_plane_disable(plane);
369 drm_plane_cleanup(plane); 272 drm_plane_cleanup(plane);
370 WARN_ON(omap_plane->pending_num_unpins + omap_plane->num_unpins > 0); 273
274 WARN_ON(!kfifo_is_empty(&omap_plane->unpin_fifo));
371 kfifo_free(&omap_plane->unpin_fifo); 275 kfifo_free(&omap_plane->unpin_fifo);
276
372 kfree(omap_plane); 277 kfree(omap_plane);
373} 278}
374 279
375int omap_plane_dpms(struct drm_plane *plane, int mode) 280int omap_plane_dpms(struct drm_plane *plane, int mode)
376{ 281{
377 struct omap_plane *omap_plane = to_omap_plane(plane); 282 struct omap_plane *omap_plane = to_omap_plane(plane);
378 struct omap_overlay *ovl = omap_plane->ovl; 283 bool enabled = (mode == DRM_MODE_DPMS_ON);
379 int r; 284 int ret = 0;
380 285
381 DBG("%s: %d", omap_plane->ovl->name, mode); 286 if (enabled != omap_plane->enabled) {
382 287 omap_plane->enabled = enabled;
383 if (mode == DRM_MODE_DPMS_ON) { 288 ret = apply(plane);
384 update_scanout(plane);
385 r = commit(plane);
386 if (!r)
387 r = ovl->enable(ovl);
388 } else {
389 struct omap_drm_private *priv = plane->dev->dev_private;
390 r = ovl->disable(ovl);
391 update_pin(plane, NULL);
392 queue_work(priv->wq, &omap_plane->work);
393 } 289 }
394 290
395 return r; 291 return ret;
396}
397
398void omap_plane_on_endwin(struct drm_plane *plane,
399 void (*fxn)(void *), void *arg)
400{
401 struct omap_plane *omap_plane = to_omap_plane(plane);
402
403 mutex_lock(&omap_plane->unpin_mutex);
404 omap_plane->endwin.fxn = fxn;
405 omap_plane->endwin.arg = arg;
406 mutex_unlock(&omap_plane->unpin_mutex);
407
408 install_irq(plane);
409} 292}
410 293
411/* helper to install properties which are common to planes and crtcs */ 294/* helper to install properties which are common to planes and crtcs */
@@ -454,25 +337,13 @@ int omap_plane_set_property(struct drm_plane *plane,
454 int ret = -EINVAL; 337 int ret = -EINVAL;
455 338
456 if (property == priv->rotation_prop) { 339 if (property == priv->rotation_prop) {
457 struct omap_overlay *ovl = omap_plane->ovl; 340 DBG("%s: rotation: %02x", omap_plane->name, (uint32_t)val);
458
459 DBG("%s: rotation: %02x", ovl->name, (uint32_t)val);
460 omap_plane->win.rotation = val; 341 omap_plane->win.rotation = val;
461 342 ret = apply(plane);
462 if (ovl->is_enabled(ovl))
463 ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
464 else
465 ret = 0;
466 } else if (property == priv->zorder_prop) { 343 } else if (property == priv->zorder_prop) {
467 struct omap_overlay *ovl = omap_plane->ovl; 344 DBG("%s: zorder: %02x", omap_plane->name, (uint32_t)val);
468
469 DBG("%s: zorder: %d", ovl->name, (uint32_t)val);
470 omap_plane->info.zorder = val; 345 omap_plane->info.zorder = val;
471 346 ret = apply(plane);
472 if (ovl->is_enabled(ovl))
473 ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
474 else
475 ret = 0;
476 } 347 }
477 348
478 return ret; 349 return ret;
@@ -485,20 +356,38 @@ static const struct drm_plane_funcs omap_plane_funcs = {
485 .set_property = omap_plane_set_property, 356 .set_property = omap_plane_set_property,
486}; 357};
487 358
359static void omap_plane_error_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
360{
361 struct omap_plane *omap_plane =
362 container_of(irq, struct omap_plane, error_irq);
363 DRM_ERROR("%s: errors: %08x\n", omap_plane->name, irqstatus);
364}
365
366static const char *plane_names[] = {
367 [OMAP_DSS_GFX] = "gfx",
368 [OMAP_DSS_VIDEO1] = "vid1",
369 [OMAP_DSS_VIDEO2] = "vid2",
370 [OMAP_DSS_VIDEO3] = "vid3",
371};
372
373static const uint32_t error_irqs[] = {
374 [OMAP_DSS_GFX] = DISPC_IRQ_GFX_FIFO_UNDERFLOW,
375 [OMAP_DSS_VIDEO1] = DISPC_IRQ_VID1_FIFO_UNDERFLOW,
376 [OMAP_DSS_VIDEO2] = DISPC_IRQ_VID2_FIFO_UNDERFLOW,
377 [OMAP_DSS_VIDEO3] = DISPC_IRQ_VID3_FIFO_UNDERFLOW,
378};
379
488/* initialize plane */ 380/* initialize plane */
489struct drm_plane *omap_plane_init(struct drm_device *dev, 381struct drm_plane *omap_plane_init(struct drm_device *dev,
490 struct omap_overlay *ovl, unsigned int possible_crtcs, 382 int id, bool private_plane)
491 bool priv)
492{ 383{
384 struct omap_drm_private *priv = dev->dev_private;
493 struct drm_plane *plane = NULL; 385 struct drm_plane *plane = NULL;
494 struct omap_plane *omap_plane; 386 struct omap_plane *omap_plane;
387 struct omap_overlay_info *info;
495 int ret; 388 int ret;
496 389
497 DBG("%s: possible_crtcs=%08x, priv=%d", ovl->name, 390 DBG("%s: priv=%d", plane_names[id], private_plane);
498 possible_crtcs, priv);
499
500 /* friendly reminder to update table for future hw: */
501 WARN_ON(ovl->id >= ARRAY_SIZE(id2irq));
502 391
503 omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL); 392 omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL);
504 if (!omap_plane) { 393 if (!omap_plane) {
@@ -506,47 +395,50 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
506 goto fail; 395 goto fail;
507 } 396 }
508 397
509 mutex_init(&omap_plane->unpin_mutex);
510
511 ret = kfifo_alloc(&omap_plane->unpin_fifo, 16, GFP_KERNEL); 398 ret = kfifo_alloc(&omap_plane->unpin_fifo, 16, GFP_KERNEL);
512 if (ret) { 399 if (ret) {
513 dev_err(dev->dev, "could not allocate unpin FIFO\n"); 400 dev_err(dev->dev, "could not allocate unpin FIFO\n");
514 goto fail; 401 goto fail;
515 } 402 }
516 403
517 INIT_WORK(&omap_plane->work, unpin_worker);
518
519 omap_plane->nformats = omap_framebuffer_get_formats( 404 omap_plane->nformats = omap_framebuffer_get_formats(
520 omap_plane->formats, ARRAY_SIZE(omap_plane->formats), 405 omap_plane->formats, ARRAY_SIZE(omap_plane->formats),
521 ovl->supported_modes); 406 dss_feat_get_supported_color_modes(id));
522 omap_plane->ovl = ovl; 407 omap_plane->id = id;
408 omap_plane->name = plane_names[id];
409
523 plane = &omap_plane->base; 410 plane = &omap_plane->base;
524 411
525 drm_plane_init(dev, plane, possible_crtcs, &omap_plane_funcs, 412 omap_plane->apply.pre_apply = omap_plane_pre_apply;
526 omap_plane->formats, omap_plane->nformats, priv); 413 omap_plane->apply.post_apply = omap_plane_post_apply;
414
415 omap_plane->error_irq.irqmask = error_irqs[id];
416 omap_plane->error_irq.irq = omap_plane_error_irq;
417 omap_irq_register(dev, &omap_plane->error_irq);
418
419 drm_plane_init(dev, plane, (1 << priv->num_crtcs) - 1, &omap_plane_funcs,
420 omap_plane->formats, omap_plane->nformats, private_plane);
527 421
528 omap_plane_install_properties(plane, &plane->base); 422 omap_plane_install_properties(plane, &plane->base);
529 423
530 /* get our starting configuration, set defaults for parameters 424 /* get our starting configuration, set defaults for parameters
531 * we don't currently use, etc: 425 * we don't currently use, etc:
532 */ 426 */
533 ovl->get_overlay_info(ovl, &omap_plane->info); 427 info = &omap_plane->info;
534 omap_plane->info.rotation_type = OMAP_DSS_ROT_DMA; 428 info->rotation_type = OMAP_DSS_ROT_DMA;
535 omap_plane->info.rotation = OMAP_DSS_ROT_0; 429 info->rotation = OMAP_DSS_ROT_0;
536 omap_plane->info.global_alpha = 0xff; 430 info->global_alpha = 0xff;
537 omap_plane->info.mirror = 0; 431 info->mirror = 0;
538 432
539 /* Set defaults depending on whether we are a CRTC or overlay 433 /* Set defaults depending on whether we are a CRTC or overlay
540 * layer. 434 * layer.
541 * TODO add ioctl to give userspace an API to change this.. this 435 * TODO add ioctl to give userspace an API to change this.. this
542 * will come in a subsequent patch. 436 * will come in a subsequent patch.
543 */ 437 */
544 if (priv) 438 if (private_plane)
545 omap_plane->info.zorder = 0; 439 omap_plane->info.zorder = 0;
546 else 440 else
547 omap_plane->info.zorder = ovl->id; 441 omap_plane->info.zorder = id;
548
549 update_manager(plane);
550 442
551 return plane; 443 return plane;
552 444
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index ae38475854b..d10d75e8a33 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -937,7 +937,8 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count)
937 937
938 dma_tmp = pci_map_single(pdev, buf, bufsize * sizeof(u8), 938 dma_tmp = pci_map_single(pdev, buf, bufsize * sizeof(u8),
939 PCI_DMA_FROMDEVICE); 939 PCI_DMA_FROMDEVICE);
940 940 if (pci_dma_mapping_error(pdev, dma_tmp))
941 return -1;
941 if (-1 == buffer_add(&(priv->rxbuffer), buf, dma_tmp, 942 if (-1 == buffer_add(&(priv->rxbuffer), buf, dma_tmp,
942 &(priv->rxbufferhead))) { 943 &(priv->rxbufferhead))) {
943 DMESGE("Unable to allocate mem RX buf"); 944 DMESGE("Unable to allocate mem RX buf");
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 808aab6fa5e..a9d78e9651c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1183,6 +1183,8 @@ void rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
1183 pTxFwInfo->TxRate, 1183 pTxFwInfo->TxRate,
1184 cb_desc); 1184 cb_desc);
1185 1185
1186 if (pci_dma_mapping_error(priv->pdev, mapping))
1187 RT_TRACE(COMP_ERR, "DMA Mapping error\n");;
1186 if (cb_desc->bAMPDUEnable) { 1188 if (cb_desc->bAMPDUEnable) {
1187 pTxFwInfo->AllowAggregation = 1; 1189 pTxFwInfo->AllowAggregation = 1;
1188 pTxFwInfo->RxMF = cb_desc->ampdu_factor; 1190 pTxFwInfo->RxMF = cb_desc->ampdu_factor;
@@ -1280,6 +1282,8 @@ void rtl8192_tx_fill_cmd_desc(struct net_device *dev,
1280 dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len, 1282 dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len,
1281 PCI_DMA_TODEVICE); 1283 PCI_DMA_TODEVICE);
1282 1284
1285 if (pci_dma_mapping_error(priv->pdev, mapping))
1286 RT_TRACE(COMP_ERR, "DMA Mapping error\n");;
1283 memset(entry, 0, 12); 1287 memset(entry, 0, 12);
1284 entry->LINIP = cb_desc->bLastIniPkt; 1288 entry->LINIP = cb_desc->bLastIniPkt;
1285 entry->FirstSeg = 1; 1289 entry->FirstSeg = 1;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 1a70f324552..4ebf99b3097 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2104,7 +2104,10 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
2104 skb_tail_pointer_rsl(skb), 2104 skb_tail_pointer_rsl(skb),
2105 priv->rxbuffersize, 2105 priv->rxbuffersize,
2106 PCI_DMA_FROMDEVICE); 2106 PCI_DMA_FROMDEVICE);
2107 2107 if (pci_dma_mapping_error(priv->pdev, *mapping)) {
2108 dev_kfree_skb_any(skb);
2109 return -1;
2110 }
2108 entry->BufferAddress = cpu_to_le32(*mapping); 2111 entry->BufferAddress = cpu_to_le32(*mapping);
2109 2112
2110 entry->Length = priv->rxbuffersize; 2113 entry->Length = priv->rxbuffersize;
@@ -2397,7 +2400,11 @@ static void rtl8192_rx_normal(struct net_device *dev)
2397 skb_tail_pointer_rsl(skb), 2400 skb_tail_pointer_rsl(skb),
2398 priv->rxbuffersize, 2401 priv->rxbuffersize,
2399 PCI_DMA_FROMDEVICE); 2402 PCI_DMA_FROMDEVICE);
2400 2403 if (pci_dma_mapping_error(priv->pdev,
2404 *((dma_addr_t *)skb->cb))) {
2405 dev_kfree_skb_any(skb);
2406 return;
2407 }
2401 } 2408 }
2402done: 2409done:
2403 pdesc->BufferAddress = cpu_to_le32(*((dma_addr_t *)skb->cb)); 2410 pdesc->BufferAddress = cpu_to_le32(*((dma_addr_t *)skb->cb));
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index 6b73843e580..a96cd06d69d 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -63,6 +63,8 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
63 {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ 63 {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */
64 /* Belkin */ 64 /* Belkin */
65 {USB_DEVICE(0x050D, 0x945A)}, 65 {USB_DEVICE(0x050D, 0x945A)},
66 /* ISY IWL - Belkin clone */
67 {USB_DEVICE(0x050D, 0x11F1)},
66 /* Corega */ 68 /* Corega */
67 {USB_DEVICE(0x07AA, 0x0047)}, 69 {USB_DEVICE(0x07AA, 0x0047)},
68 /* D-Link */ 70 /* D-Link */
diff --git a/drivers/staging/sb105x/Kconfig b/drivers/staging/sb105x/Kconfig
index ac87c5e38de..1facad62555 100644
--- a/drivers/staging/sb105x/Kconfig
+++ b/drivers/staging/sb105x/Kconfig
@@ -2,6 +2,7 @@ config SB105X
2 tristate "SystemBase PCI Multiport UART" 2 tristate "SystemBase PCI Multiport UART"
3 select SERIAL_CORE 3 select SERIAL_CORE
4 depends on PCI 4 depends on PCI
5 depends on X86
5 help 6 help
6 A driver for the SystemBase Multi-2/PCI serial card 7 A driver for the SystemBase Multi-2/PCI serial card
7 8
diff --git a/drivers/staging/sb105x/sb_pci_mp.c b/drivers/staging/sb105x/sb_pci_mp.c
index edb2a85b9d5..131afd0c460 100644
--- a/drivers/staging/sb105x/sb_pci_mp.c
+++ b/drivers/staging/sb105x/sb_pci_mp.c
@@ -3054,6 +3054,7 @@ static int init_mp_dev(struct pci_dev *pcidev, mppcibrd_t brd)
3054 sbdev->nr_ports = ((portnum_hex/16)*10) + (portnum_hex % 16); 3054 sbdev->nr_ports = ((portnum_hex/16)*10) + (portnum_hex % 16);
3055 } 3055 }
3056 break; 3056 break;
3057#ifdef CONFIG_PARPORT
3057 case PCI_DEVICE_ID_MP2S1P : 3058 case PCI_DEVICE_ID_MP2S1P :
3058 sbdev->nr_ports = 2; 3059 sbdev->nr_ports = 2;
3059 3060
@@ -3073,6 +3074,7 @@ static int init_mp_dev(struct pci_dev *pcidev, mppcibrd_t brd)
3073 /* add PC compatible parallel port */ 3074 /* add PC compatible parallel port */
3074 parport_pc_probe_port(pcidev->resource[2].start, pcidev->resource[3].start, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, &pcidev->dev, 0); 3075 parport_pc_probe_port(pcidev->resource[2].start, pcidev->resource[3].start, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, &pcidev->dev, 0);
3075 break; 3076 break;
3077#endif
3076 } 3078 }
3077 3079
3078 ret = request_region(sbdev->uart_access_addr, (8*sbdev->nr_ports), sbdev->name); 3080 ret = request_region(sbdev->uart_access_addr, (8*sbdev->nr_ports), sbdev->name);
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index df953379809..7616f058a00 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -342,7 +342,7 @@ int synth_init(char *synth_name)
342 342
343 mutex_lock(&spk_mutex); 343 mutex_lock(&spk_mutex);
344 /* First, check if we already have it loaded. */ 344 /* First, check if we already have it loaded. */
345 for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++) 345 for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
346 if (strcmp(synths[i]->name, synth_name) == 0) 346 if (strcmp(synths[i]->name, synth_name) == 0)
347 synth = synths[i]; 347 synth = synths[i];
348 348
@@ -423,7 +423,7 @@ int synth_add(struct spk_synth *in_synth)
423 int i; 423 int i;
424 int status = 0; 424 int status = 0;
425 mutex_lock(&spk_mutex); 425 mutex_lock(&spk_mutex);
426 for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++) 426 for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
427 /* synth_remove() is responsible for rotating the array down */ 427 /* synth_remove() is responsible for rotating the array down */
428 if (in_synth == synths[i]) { 428 if (in_synth == synths[i]) {
429 mutex_unlock(&spk_mutex); 429 mutex_unlock(&spk_mutex);
diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h
index 543a127c7d4..b783bfa59b1 100644
--- a/drivers/staging/tidspbridge/core/_tiomap.h
+++ b/drivers/staging/tidspbridge/core/_tiomap.h
@@ -31,7 +31,7 @@
31 * driver should read or write to PRM/CM registers directly; they 31 * driver should read or write to PRM/CM registers directly; they
32 * should rely on OMAP core code to do this. 32 * should rely on OMAP core code to do this.
33 */ 33 */
34#include <mach-omap2/cm2xxx_3xxx.h> 34#include <mach-omap2/cm3xxx.h>
35#include <mach-omap2/prm-regbits-34xx.h> 35#include <mach-omap2/prm-regbits-34xx.h>
36#include <mach-omap2/cm-regbits-34xx.h> 36#include <mach-omap2/cm-regbits-34xx.h>
37#include <dspbridge/devdefs.h> 37#include <dspbridge/devdefs.h>
diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c
index b647207928b..2f084e181d3 100644
--- a/drivers/staging/tidspbridge/core/dsp-clock.c
+++ b/drivers/staging/tidspbridge/core/dsp-clock.c
@@ -121,9 +121,13 @@ void dsp_clk_exit(void)
121 for (i = 0; i < DM_TIMER_CLOCKS; i++) 121 for (i = 0; i < DM_TIMER_CLOCKS; i++)
122 omap_dm_timer_free(timer[i]); 122 omap_dm_timer_free(timer[i]);
123 123
124 clk_unprepare(iva2_clk);
124 clk_put(iva2_clk); 125 clk_put(iva2_clk);
126 clk_unprepare(ssi.sst_fck);
125 clk_put(ssi.sst_fck); 127 clk_put(ssi.sst_fck);
128 clk_unprepare(ssi.ssr_fck);
126 clk_put(ssi.ssr_fck); 129 clk_put(ssi.ssr_fck);
130 clk_unprepare(ssi.ick);
127 clk_put(ssi.ick); 131 clk_put(ssi.ick);
128} 132}
129 133
@@ -145,14 +149,21 @@ void dsp_clk_init(void)
145 iva2_clk = clk_get(&dspbridge_device.dev, "iva2_ck"); 149 iva2_clk = clk_get(&dspbridge_device.dev, "iva2_ck");
146 if (IS_ERR(iva2_clk)) 150 if (IS_ERR(iva2_clk))
147 dev_err(bridge, "failed to get iva2 clock %p\n", iva2_clk); 151 dev_err(bridge, "failed to get iva2 clock %p\n", iva2_clk);
152 else
153 clk_prepare(iva2_clk);
148 154
149 ssi.sst_fck = clk_get(&dspbridge_device.dev, "ssi_sst_fck"); 155 ssi.sst_fck = clk_get(&dspbridge_device.dev, "ssi_sst_fck");
150 ssi.ssr_fck = clk_get(&dspbridge_device.dev, "ssi_ssr_fck"); 156 ssi.ssr_fck = clk_get(&dspbridge_device.dev, "ssi_ssr_fck");
151 ssi.ick = clk_get(&dspbridge_device.dev, "ssi_ick"); 157 ssi.ick = clk_get(&dspbridge_device.dev, "ssi_ick");
152 158
153 if (IS_ERR(ssi.sst_fck) || IS_ERR(ssi.ssr_fck) || IS_ERR(ssi.ick)) 159 if (IS_ERR(ssi.sst_fck) || IS_ERR(ssi.ssr_fck) || IS_ERR(ssi.ick)) {
154 dev_err(bridge, "failed to get ssi: sst %p, ssr %p, ick %p\n", 160 dev_err(bridge, "failed to get ssi: sst %p, ssr %p, ick %p\n",
155 ssi.sst_fck, ssi.ssr_fck, ssi.ick); 161 ssi.sst_fck, ssi.ssr_fck, ssi.ick);
162 } else {
163 clk_prepare(ssi.sst_fck);
164 clk_prepare(ssi.ssr_fck);
165 clk_prepare(ssi.ick);
166 }
156} 167}
157 168
158/** 169/**
diff --git a/drivers/staging/tidspbridge/core/wdt.c b/drivers/staging/tidspbridge/core/wdt.c
index 1dce36fb828..7ff0e6c9803 100644
--- a/drivers/staging/tidspbridge/core/wdt.c
+++ b/drivers/staging/tidspbridge/core/wdt.c
@@ -63,11 +63,15 @@ int dsp_wdt_init(void)
63 dsp_wdt.fclk = clk_get(NULL, "wdt3_fck"); 63 dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
64 64
65 if (!IS_ERR(dsp_wdt.fclk)) { 65 if (!IS_ERR(dsp_wdt.fclk)) {
66 clk_prepare(dsp_wdt.fclk);
67
66 dsp_wdt.iclk = clk_get(NULL, "wdt3_ick"); 68 dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
67 if (IS_ERR(dsp_wdt.iclk)) { 69 if (IS_ERR(dsp_wdt.iclk)) {
68 clk_put(dsp_wdt.fclk); 70 clk_put(dsp_wdt.fclk);
69 dsp_wdt.fclk = NULL; 71 dsp_wdt.fclk = NULL;
70 ret = -EFAULT; 72 ret = -EFAULT;
73 } else {
74 clk_prepare(dsp_wdt.iclk);
71 } 75 }
72 } else 76 } else
73 ret = -EFAULT; 77 ret = -EFAULT;
@@ -95,10 +99,14 @@ void dsp_wdt_exit(void)
95 free_irq(INT_34XX_WDT3_IRQ, &dsp_wdt); 99 free_irq(INT_34XX_WDT3_IRQ, &dsp_wdt);
96 tasklet_kill(&dsp_wdt.wdt3_tasklet); 100 tasklet_kill(&dsp_wdt.wdt3_tasklet);
97 101
98 if (dsp_wdt.fclk) 102 if (dsp_wdt.fclk) {
103 clk_unprepare(dsp_wdt.fclk);
99 clk_put(dsp_wdt.fclk); 104 clk_put(dsp_wdt.fclk);
100 if (dsp_wdt.iclk) 105 }
106 if (dsp_wdt.iclk) {
107 clk_unprepare(dsp_wdt.iclk);
101 clk_put(dsp_wdt.iclk); 108 clk_put(dsp_wdt.iclk);
109 }
102 110
103 dsp_wdt.fclk = NULL; 111 dsp_wdt.fclk = NULL;
104 dsp_wdt.iclk = NULL; 112 dsp_wdt.iclk = NULL;
diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 0331178ca3b..bf73ba26e88 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -162,11 +162,9 @@ static struct vme_driver pio2_driver = {
162 162
163static int __init pio2_init(void) 163static int __init pio2_init(void)
164{ 164{
165 int retval = 0;
166
167 if (bus_num == 0) { 165 if (bus_num == 0) {
168 pr_err("No cards, skipping registration\n"); 166 pr_err("No cards, skipping registration\n");
169 goto err_nocard; 167 return -ENODEV;
170 } 168 }
171 169
172 if (bus_num > PIO2_CARDS_MAX) { 170 if (bus_num > PIO2_CARDS_MAX) {
@@ -176,15 +174,7 @@ static int __init pio2_init(void)
176 } 174 }
177 175
178 /* Register the PIO2 driver */ 176 /* Register the PIO2 driver */
179 retval = vme_register_driver(&pio2_driver, bus_num); 177 return vme_register_driver(&pio2_driver, bus_num);
180 if (retval != 0)
181 goto err_reg;
182
183 return retval;
184
185err_reg:
186err_nocard:
187 return retval;
188} 178}
189 179
190static int pio2_match(struct vme_dev *vdev) 180static int pio2_match(struct vme_dev *vdev)
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 18c06a59c09..1d31eab19d1 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -638,8 +638,8 @@ int prism2_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
638} 638}
639 639
640 640
641int prism2_set_tx_power(struct wiphy *wiphy, enum nl80211_tx_power_setting type, 641int prism2_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
642 int mbm) 642 enum nl80211_tx_power_setting type, int mbm)
643{ 643{
644 struct prism2_wiphy_private *priv = wiphy_priv(wiphy); 644 struct prism2_wiphy_private *priv = wiphy_priv(wiphy);
645 wlandevice_t *wlandev = priv->wlandev; 645 wlandevice_t *wlandev = priv->wlandev;
@@ -665,7 +665,8 @@ exit:
665 return err; 665 return err;
666} 666}
667 667
668int prism2_get_tx_power(struct wiphy *wiphy, int *dbm) 668int prism2_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
669 int *dbm)
669{ 670{
670 struct prism2_wiphy_private *priv = wiphy_priv(wiphy); 671 struct prism2_wiphy_private *priv = wiphy_priv(wiphy);
671 wlandevice_t *wlandev = priv->wlandev; 672 wlandevice_t *wlandev = priv->wlandev;
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index fb4a7c94aed..f2a73bd739f 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -265,7 +265,7 @@ out_cleanup:
265static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, 265static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
266 int offset) 266 int offset)
267{ 267{
268 int ret; 268 int ret = 0;
269 size_t clen; 269 size_t clen;
270 unsigned long handle; 270 unsigned long handle;
271 struct page *page; 271 struct page *page;
@@ -286,10 +286,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
286 goto out; 286 goto out;
287 } 287 }
288 ret = zram_decompress_page(zram, uncmem, index); 288 ret = zram_decompress_page(zram, uncmem, index);
289 if (ret) { 289 if (ret)
290 kfree(uncmem);
291 goto out; 290 goto out;
292 }
293 } 291 }
294 292
295 /* 293 /*
@@ -302,16 +300,18 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
302 300
303 user_mem = kmap_atomic(page); 301 user_mem = kmap_atomic(page);
304 302
305 if (is_partial_io(bvec)) 303 if (is_partial_io(bvec)) {
306 memcpy(uncmem + offset, user_mem + bvec->bv_offset, 304 memcpy(uncmem + offset, user_mem + bvec->bv_offset,
307 bvec->bv_len); 305 bvec->bv_len);
308 else 306 kunmap_atomic(user_mem);
307 user_mem = NULL;
308 } else {
309 uncmem = user_mem; 309 uncmem = user_mem;
310 }
310 311
311 if (page_zero_filled(uncmem)) { 312 if (page_zero_filled(uncmem)) {
312 kunmap_atomic(user_mem); 313 if (!is_partial_io(bvec))
313 if (is_partial_io(bvec)) 314 kunmap_atomic(user_mem);
314 kfree(uncmem);
315 zram_stat_inc(&zram->stats.pages_zero); 315 zram_stat_inc(&zram->stats.pages_zero);
316 zram_set_flag(zram, index, ZRAM_ZERO); 316 zram_set_flag(zram, index, ZRAM_ZERO);
317 ret = 0; 317 ret = 0;
@@ -321,9 +321,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
321 ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen, 321 ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
322 zram->compress_workmem); 322 zram->compress_workmem);
323 323
324 kunmap_atomic(user_mem); 324 if (!is_partial_io(bvec)) {
325 if (is_partial_io(bvec)) 325 kunmap_atomic(user_mem);
326 kfree(uncmem); 326 user_mem = NULL;
327 uncmem = NULL;
328 }
327 329
328 if (unlikely(ret != LZO_E_OK)) { 330 if (unlikely(ret != LZO_E_OK)) {
329 pr_err("Compression failed! err=%d\n", ret); 331 pr_err("Compression failed! err=%d\n", ret);
@@ -332,8 +334,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
332 334
333 if (unlikely(clen > max_zpage_size)) { 335 if (unlikely(clen > max_zpage_size)) {
334 zram_stat_inc(&zram->stats.bad_compress); 336 zram_stat_inc(&zram->stats.bad_compress);
335 src = uncmem;
336 clen = PAGE_SIZE; 337 clen = PAGE_SIZE;
338 src = NULL;
339 if (is_partial_io(bvec))
340 src = uncmem;
337 } 341 }
338 342
339 handle = zs_malloc(zram->mem_pool, clen); 343 handle = zs_malloc(zram->mem_pool, clen);
@@ -345,7 +349,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
345 } 349 }
346 cmem = zs_map_object(zram->mem_pool, handle, ZS_MM_WO); 350 cmem = zs_map_object(zram->mem_pool, handle, ZS_MM_WO);
347 351
352 if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
353 src = kmap_atomic(page);
348 memcpy(cmem, src, clen); 354 memcpy(cmem, src, clen);
355 if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
356 kunmap_atomic(src);
349 357
350 zs_unmap_object(zram->mem_pool, handle); 358 zs_unmap_object(zram->mem_pool, handle);
351 359
@@ -358,9 +366,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
358 if (clen <= PAGE_SIZE / 2) 366 if (clen <= PAGE_SIZE / 2)
359 zram_stat_inc(&zram->stats.good_compress); 367 zram_stat_inc(&zram->stats.good_compress);
360 368
361 return 0;
362
363out: 369out:
370 if (is_partial_io(bvec))
371 kfree(uncmem);
372
364 if (ret) 373 if (ret)
365 zram_stat64_inc(zram, &zram->stats.failed_writes); 374 zram_stat64_inc(zram, &zram->stats.failed_writes);
366 return ret; 375 return ret;
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 7772d160376..224751e9f5f 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -832,7 +832,7 @@ static inline struct exynos_tmu_platform_data *exynos_get_driver_data(
832 return (struct exynos_tmu_platform_data *) 832 return (struct exynos_tmu_platform_data *)
833 platform_get_device_id(pdev)->driver_data; 833 platform_get_device_id(pdev)->driver_data;
834} 834}
835static int __devinit exynos_tmu_probe(struct platform_device *pdev) 835static int exynos_tmu_probe(struct platform_device *pdev)
836{ 836{
837 struct exynos_tmu_data *data; 837 struct exynos_tmu_data *data;
838 struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data; 838 struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data;
@@ -937,7 +937,7 @@ err_clk:
937 return ret; 937 return ret;
938} 938}
939 939
940static int __devexit exynos_tmu_remove(struct platform_device *pdev) 940static int exynos_tmu_remove(struct platform_device *pdev)
941{ 941{
942 struct exynos_tmu_data *data = platform_get_drvdata(pdev); 942 struct exynos_tmu_data *data = platform_get_drvdata(pdev);
943 943
@@ -985,7 +985,7 @@ static struct platform_driver exynos_tmu_driver = {
985 .of_match_table = exynos_tmu_match, 985 .of_match_table = exynos_tmu_match,
986 }, 986 },
987 .probe = exynos_tmu_probe, 987 .probe = exynos_tmu_probe,
988 .remove = __devexit_p(exynos_tmu_remove), 988 .remove = exynos_tmu_remove,
989 .id_table = exynos_tmu_driver_ids, 989 .id_table = exynos_tmu_driver_ids,
990}; 990};
991 991
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 4c90b510d01..640ae6c6d2d 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -37,6 +37,7 @@ config USB_ARCH_HAS_EHCI
37 default y if ARCH_W90X900 37 default y if ARCH_W90X900
38 default y if ARCH_AT91 38 default y if ARCH_AT91
39 default y if ARCH_MXC 39 default y if ARCH_MXC
40 default y if ARCH_MXS
40 default y if ARCH_OMAP3 41 default y if ARCH_OMAP3
41 default y if ARCH_CNS3XXX 42 default y if ARCH_CNS3XXX
42 default y if ARCH_VT8500 43 default y if ARCH_VT8500
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index caecad9213f..8e9d31277c4 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -70,6 +70,9 @@ static int host_start(struct ci13xxx *ci)
70 else 70 else
71 ci->hcd = hcd; 71 ci->hcd = hcd;
72 72
73 if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING)
74 hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS);
75
73 return ret; 76 return ret;
74} 77}
75 78
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 8d809a811e1..2d92cce260d 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1602,6 +1602,9 @@ static const struct usb_device_id acm_ids[] = {
1602 { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */ 1602 { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */
1603 .driver_info = NO_UNION_NORMAL, 1603 .driver_info = NO_UNION_NORMAL,
1604 }, 1604 },
1605 { USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */
1606 .driver_info = NO_UNION_NORMAL,
1607 },
1605 { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ 1608 { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */
1606 .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ 1609 .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
1607 }, 1610 },
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index a815fd2cc5e..957ed2c4148 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -877,6 +877,60 @@ static int hub_hub_status(struct usb_hub *hub,
877 return ret; 877 return ret;
878} 878}
879 879
880static int hub_set_port_link_state(struct usb_hub *hub, int port1,
881 unsigned int link_status)
882{
883 return set_port_feature(hub->hdev,
884 port1 | (link_status << 3),
885 USB_PORT_FEAT_LINK_STATE);
886}
887
888/*
889 * If USB 3.0 ports are placed into the Disabled state, they will no longer
890 * detect any device connects or disconnects. This is generally not what the
891 * USB core wants, since it expects a disabled port to produce a port status
892 * change event when a new device connects.
893 *
894 * Instead, set the link state to Disabled, wait for the link to settle into
895 * that state, clear any change bits, and then put the port into the RxDetect
896 * state.
897 */
898static int hub_usb3_port_disable(struct usb_hub *hub, int port1)
899{
900 int ret;
901 int total_time;
902 u16 portchange, portstatus;
903
904 if (!hub_is_superspeed(hub->hdev))
905 return -EINVAL;
906
907 ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED);
908 if (ret) {
909 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n",
910 port1, ret);
911 return ret;
912 }
913
914 /* Wait for the link to enter the disabled state. */
915 for (total_time = 0; ; total_time += HUB_DEBOUNCE_STEP) {
916 ret = hub_port_status(hub, port1, &portstatus, &portchange);
917 if (ret < 0)
918 return ret;
919
920 if ((portstatus & USB_PORT_STAT_LINK_STATE) ==
921 USB_SS_PORT_LS_SS_DISABLED)
922 break;
923 if (total_time >= HUB_DEBOUNCE_TIMEOUT)
924 break;
925 msleep(HUB_DEBOUNCE_STEP);
926 }
927 if (total_time >= HUB_DEBOUNCE_TIMEOUT)
928 dev_warn(hub->intfdev, "Could not disable port %d after %d ms\n",
929 port1, total_time);
930
931 return hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_RX_DETECT);
932}
933
880static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) 934static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
881{ 935{
882 struct usb_device *hdev = hub->hdev; 936 struct usb_device *hdev = hub->hdev;
@@ -885,8 +939,13 @@ static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
885 if (hub->ports[port1 - 1]->child && set_state) 939 if (hub->ports[port1 - 1]->child && set_state)
886 usb_set_device_state(hub->ports[port1 - 1]->child, 940 usb_set_device_state(hub->ports[port1 - 1]->child,
887 USB_STATE_NOTATTACHED); 941 USB_STATE_NOTATTACHED);
888 if (!hub->error && !hub_is_superspeed(hub->hdev)) 942 if (!hub->error) {
889 ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE); 943 if (hub_is_superspeed(hub->hdev))
944 ret = hub_usb3_port_disable(hub, port1);
945 else
946 ret = clear_port_feature(hdev, port1,
947 USB_PORT_FEAT_ENABLE);
948 }
890 if (ret) 949 if (ret)
891 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n", 950 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n",
892 port1, ret); 951 port1, ret);
@@ -2440,7 +2499,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
2440#define HUB_SHORT_RESET_TIME 10 2499#define HUB_SHORT_RESET_TIME 10
2441#define HUB_BH_RESET_TIME 50 2500#define HUB_BH_RESET_TIME 50
2442#define HUB_LONG_RESET_TIME 200 2501#define HUB_LONG_RESET_TIME 200
2443#define HUB_RESET_TIMEOUT 500 2502#define HUB_RESET_TIMEOUT 800
2444 2503
2445static int hub_port_reset(struct usb_hub *hub, int port1, 2504static int hub_port_reset(struct usb_hub *hub, int port1,
2446 struct usb_device *udev, unsigned int delay, bool warm); 2505 struct usb_device *udev, unsigned int delay, bool warm);
@@ -2475,6 +2534,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
2475 if (ret < 0) 2534 if (ret < 0)
2476 return ret; 2535 return ret;
2477 2536
2537 /* The port state is unknown until the reset completes. */
2538 if ((portstatus & USB_PORT_STAT_RESET))
2539 goto delay;
2540
2478 /* 2541 /*
2479 * Some buggy devices require a warm reset to be issued even 2542 * Some buggy devices require a warm reset to be issued even
2480 * when the port appears not to be connected. 2543 * when the port appears not to be connected.
@@ -2520,11 +2583,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
2520 if ((portchange & USB_PORT_STAT_C_CONNECTION)) 2583 if ((portchange & USB_PORT_STAT_C_CONNECTION))
2521 return -ENOTCONN; 2584 return -ENOTCONN;
2522 2585
2523 /* if we`ve finished resetting, then break out of 2586 if ((portstatus & USB_PORT_STAT_ENABLE)) {
2524 * the loop
2525 */
2526 if (!(portstatus & USB_PORT_STAT_RESET) &&
2527 (portstatus & USB_PORT_STAT_ENABLE)) {
2528 if (hub_is_wusb(hub)) 2587 if (hub_is_wusb(hub))
2529 udev->speed = USB_SPEED_WIRELESS; 2588 udev->speed = USB_SPEED_WIRELESS;
2530 else if (hub_is_superspeed(hub->hdev)) 2589 else if (hub_is_superspeed(hub->hdev))
@@ -2538,10 +2597,15 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
2538 return 0; 2597 return 0;
2539 } 2598 }
2540 } else { 2599 } else {
2541 if (portchange & USB_PORT_STAT_C_BH_RESET) 2600 if (!(portstatus & USB_PORT_STAT_CONNECTION) ||
2542 return 0; 2601 hub_port_warm_reset_required(hub,
2602 portstatus))
2603 return -ENOTCONN;
2604
2605 return 0;
2543 } 2606 }
2544 2607
2608delay:
2545 /* switch to the long delay after two short delay failures */ 2609 /* switch to the long delay after two short delay failures */
2546 if (delay_time >= 2 * HUB_SHORT_RESET_TIME) 2610 if (delay_time >= 2 * HUB_SHORT_RESET_TIME)
2547 delay = HUB_LONG_RESET_TIME; 2611 delay = HUB_LONG_RESET_TIME;
@@ -2565,14 +2629,11 @@ static void hub_port_finish_reset(struct usb_hub *hub, int port1,
2565 msleep(10 + 40); 2629 msleep(10 + 40);
2566 update_devnum(udev, 0); 2630 update_devnum(udev, 0);
2567 hcd = bus_to_hcd(udev->bus); 2631 hcd = bus_to_hcd(udev->bus);
2568 if (hcd->driver->reset_device) { 2632 /* The xHC may think the device is already reset,
2569 *status = hcd->driver->reset_device(hcd, udev); 2633 * so ignore the status.
2570 if (*status < 0) { 2634 */
2571 dev_err(&udev->dev, "Cannot reset " 2635 if (hcd->driver->reset_device)
2572 "HCD device state\n"); 2636 hcd->driver->reset_device(hcd, udev);
2573 break;
2574 }
2575 }
2576 } 2637 }
2577 /* FALL THROUGH */ 2638 /* FALL THROUGH */
2578 case -ENOTCONN: 2639 case -ENOTCONN:
@@ -2580,16 +2641,16 @@ static void hub_port_finish_reset(struct usb_hub *hub, int port1,
2580 clear_port_feature(hub->hdev, 2641 clear_port_feature(hub->hdev,
2581 port1, USB_PORT_FEAT_C_RESET); 2642 port1, USB_PORT_FEAT_C_RESET);
2582 /* FIXME need disconnect() for NOTATTACHED device */ 2643 /* FIXME need disconnect() for NOTATTACHED device */
2583 if (warm) { 2644 if (hub_is_superspeed(hub->hdev)) {
2584 clear_port_feature(hub->hdev, port1, 2645 clear_port_feature(hub->hdev, port1,
2585 USB_PORT_FEAT_C_BH_PORT_RESET); 2646 USB_PORT_FEAT_C_BH_PORT_RESET);
2586 clear_port_feature(hub->hdev, port1, 2647 clear_port_feature(hub->hdev, port1,
2587 USB_PORT_FEAT_C_PORT_LINK_STATE); 2648 USB_PORT_FEAT_C_PORT_LINK_STATE);
2588 } else { 2649 }
2650 if (!warm)
2589 usb_set_device_state(udev, *status 2651 usb_set_device_state(udev, *status
2590 ? USB_STATE_NOTATTACHED 2652 ? USB_STATE_NOTATTACHED
2591 : USB_STATE_DEFAULT); 2653 : USB_STATE_DEFAULT);
2592 }
2593 break; 2654 break;
2594 } 2655 }
2595} 2656}
@@ -2939,7 +3000,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2939static int finish_port_resume(struct usb_device *udev) 3000static int finish_port_resume(struct usb_device *udev)
2940{ 3001{
2941 int status = 0; 3002 int status = 0;
2942 u16 devstatus; 3003 u16 devstatus = 0;
2943 3004
2944 /* caller owns the udev device lock */ 3005 /* caller owns the udev device lock */
2945 dev_dbg(&udev->dev, "%s\n", 3006 dev_dbg(&udev->dev, "%s\n",
@@ -2984,7 +3045,13 @@ static int finish_port_resume(struct usb_device *udev)
2984 if (status) { 3045 if (status) {
2985 dev_dbg(&udev->dev, "gone after usb resume? status %d\n", 3046 dev_dbg(&udev->dev, "gone after usb resume? status %d\n",
2986 status); 3047 status);
2987 } else if (udev->actconfig) { 3048 /*
3049 * There are a few quirky devices which violate the standard
3050 * by claiming to have remote wakeup enabled after a reset,
3051 * which crash if the feature is cleared, hence check for
3052 * udev->reset_resume
3053 */
3054 } else if (udev->actconfig && !udev->reset_resume) {
2988 le16_to_cpus(&devstatus); 3055 le16_to_cpus(&devstatus);
2989 if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) { 3056 if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) {
2990 status = usb_control_msg(udev, 3057 status = usb_control_msg(udev,
@@ -4638,9 +4705,14 @@ static void hub_events(void)
4638 * SS.Inactive state. 4705 * SS.Inactive state.
4639 */ 4706 */
4640 if (hub_port_warm_reset_required(hub, portstatus)) { 4707 if (hub_port_warm_reset_required(hub, portstatus)) {
4708 int status;
4709
4641 dev_dbg(hub_dev, "warm reset port %d\n", i); 4710 dev_dbg(hub_dev, "warm reset port %d\n", i);
4642 hub_port_reset(hub, i, NULL, 4711 status = hub_port_reset(hub, i, NULL,
4643 HUB_BH_RESET_TIME, true); 4712 HUB_BH_RESET_TIME, true);
4713 if (status < 0)
4714 hub_port_disable(hub, i, 1);
4715 connect_change = 0;
4644 } 4716 }
4645 4717
4646 if (connect_change) 4718 if (connect_change)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index fdefd9c7f7a..3113c1d7144 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -43,6 +43,9 @@ static const struct usb_device_id usb_quirk_list[] = {
43 /* Creative SB Audigy 2 NX */ 43 /* Creative SB Audigy 2 NX */
44 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, 44 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
45 45
46 /* Microsoft LifeCam-VX700 v2.0 */
47 { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
48
46 /* Logitech Quickcam Fusion */ 49 /* Logitech Quickcam Fusion */
47 { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME }, 50 { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
48 51
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 92604b4f971..5945aadaa1c 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -56,7 +56,7 @@
56#define dump_register(nm) \ 56#define dump_register(nm) \
57{ \ 57{ \
58 .name = __stringify(nm), \ 58 .name = __stringify(nm), \
59 .offset = DWC3_ ##nm, \ 59 .offset = DWC3_ ##nm - DWC3_GLOBALS_REGS_START, \
60} 60}
61 61
62static const struct debugfs_reg32 dwc3_regs[] = { 62static const struct debugfs_reg32 dwc3_regs[] = {
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index fc0ec5e0d58..d9f6b937249 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -3231,7 +3231,7 @@ static int udc_pci_probe(
3231 } 3231 }
3232 3232
3233 if (!pdev->irq) { 3233 if (!pdev->irq) {
3234 dev_err(&dev->pdev->dev, "irq not set\n"); 3234 dev_err(&pdev->dev, "irq not set\n");
3235 kfree(dev); 3235 kfree(dev);
3236 dev = NULL; 3236 dev = NULL;
3237 retval = -ENODEV; 3237 retval = -ENODEV;
@@ -3250,7 +3250,7 @@ static int udc_pci_probe(
3250 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR); 3250 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
3251 3251
3252 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3252 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
3253 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3253 dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
3254 kfree(dev); 3254 kfree(dev);
3255 dev = NULL; 3255 dev = NULL;
3256 retval = -EBUSY; 3256 retval = -EBUSY;
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 95d584dbed1..8cf0c0f6fa1 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -130,10 +130,7 @@ static const char ep0name[] = "ep0";
130static const char *const ep_name[] = { 130static const char *const ep_name[] = {
131 ep0name, /* everyone has ep0 */ 131 ep0name, /* everyone has ep0 */
132 132
133 /* act like a net2280: high speed, six configurable endpoints */ 133 /* act like a pxa250: fifteen fixed function endpoints */
134 "ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f",
135
136 /* or like pxa250: fifteen fixed function endpoints */
137 "ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int", 134 "ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int",
138 "ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int", 135 "ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int",
139 "ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso", 136 "ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso",
@@ -141,6 +138,10 @@ static const char *const ep_name[] = {
141 138
142 /* or like sa1100: two fixed function endpoints */ 139 /* or like sa1100: two fixed function endpoints */
143 "ep1out-bulk", "ep2in-bulk", 140 "ep1out-bulk", "ep2in-bulk",
141
142 /* and now some generic EPs so we have enough in multi config */
143 "ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in",
144 "ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out",
144}; 145};
145#define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name) 146#define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name)
146 147
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 379aac7b82f..6e8b1272ebc 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -1012,7 +1012,7 @@ static void udc_clock_enable(struct mv_udc *udc)
1012 unsigned int i; 1012 unsigned int i;
1013 1013
1014 for (i = 0; i < udc->clknum; i++) 1014 for (i = 0; i < udc->clknum; i++)
1015 clk_enable(udc->clk[i]); 1015 clk_prepare_enable(udc->clk[i]);
1016} 1016}
1017 1017
1018static void udc_clock_disable(struct mv_udc *udc) 1018static void udc_clock_disable(struct mv_udc *udc)
@@ -1020,7 +1020,7 @@ static void udc_clock_disable(struct mv_udc *udc)
1020 unsigned int i; 1020 unsigned int i;
1021 1021
1022 for (i = 0; i < udc->clknum; i++) 1022 for (i = 0; i < udc->clknum; i++)
1023 clk_disable(udc->clk[i]); 1023 clk_disable_unprepare(udc->clk[i]);
1024} 1024}
1025 1025
1026static void udc_stop(struct mv_udc *udc) 1026static void udc_stop(struct mv_udc *udc)
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 141971d9051..439c3f972f8 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -3477,12 +3477,11 @@ static void s3c_hsotg_delete_debug(struct s3c_hsotg *hsotg)
3477/** 3477/**
3478 * s3c_hsotg_release - release callback for hsotg device 3478 * s3c_hsotg_release - release callback for hsotg device
3479 * @dev: Device to for which release is called 3479 * @dev: Device to for which release is called
3480 *
3481 * Nothing to do as the resource is allocated using devm_ API.
3480 */ 3482 */
3481static void s3c_hsotg_release(struct device *dev) 3483static void s3c_hsotg_release(struct device *dev)
3482{ 3484{
3483 struct s3c_hsotg *hsotg = dev_get_drvdata(dev);
3484
3485 kfree(hsotg);
3486} 3485}
3487 3486
3488/** 3487/**
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c
index 4f7f76f00c7..7cacd6ae818 100644
--- a/drivers/usb/gadget/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/tcm_usb_gadget.c
@@ -1794,9 +1794,10 @@ static int tcm_usbg_drop_nexus(struct usbg_tpg *tpg)
1794 tpg->tpg_nexus = NULL; 1794 tpg->tpg_nexus = NULL;
1795 1795
1796 kfree(tv_nexus); 1796 kfree(tv_nexus);
1797 ret = 0;
1797out: 1798out:
1798 mutex_unlock(&tpg->tpg_mutex); 1799 mutex_unlock(&tpg->tpg_mutex);
1799 return 0; 1800 return ret;
1800} 1801}
1801 1802
1802static ssize_t tcm_usbg_tpg_store_nexus( 1803static ssize_t tcm_usbg_tpg_store_nexus(
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index d0f95482f40..598dcc1212f 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -887,7 +887,7 @@ static void gs_close(struct tty_struct *tty, struct file *file)
887 pr_debug("gs_close: ttyGS%d (%p,%p) done!\n", 887 pr_debug("gs_close: ttyGS%d (%p,%p) done!\n",
888 port->port_num, tty, file); 888 port->port_num, tty, file);
889 889
890 wake_up_interruptible(&port->port.close_wait); 890 wake_up(&port->port.close_wait);
891exit: 891exit:
892 spin_unlock_irq(&port->port_lock); 892 spin_unlock_irq(&port->port_lock);
893} 893}
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index fd9b5424b86..d81d2fcbff1 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -230,7 +230,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
230 230
231 switch (phy_mode) { 231 switch (phy_mode) {
232 case FSL_USB2_PHY_ULPI: 232 case FSL_USB2_PHY_ULPI:
233 if (pdata->controller_ver) { 233 if (pdata->have_sysif_regs && pdata->controller_ver) {
234 /* controller version 1.6 or above */ 234 /* controller version 1.6 or above */
235 setbits32(non_ehci + FSL_SOC_USB_CTRL, 235 setbits32(non_ehci + FSL_SOC_USB_CTRL,
236 ULPI_PHY_CLK_SEL); 236 ULPI_PHY_CLK_SEL);
@@ -251,7 +251,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
251 portsc |= PORT_PTS_PTW; 251 portsc |= PORT_PTS_PTW;
252 /* fall through */ 252 /* fall through */
253 case FSL_USB2_PHY_UTMI: 253 case FSL_USB2_PHY_UTMI:
254 if (pdata->controller_ver) { 254 if (pdata->have_sysif_regs && pdata->controller_ver) {
255 /* controller version 1.6 or above */ 255 /* controller version 1.6 or above */
256 setbits32(non_ehci + FSL_SOC_USB_CTRL, UTMI_PHY_EN); 256 setbits32(non_ehci + FSL_SOC_USB_CTRL, UTMI_PHY_EN);
257 mdelay(FSL_UTMI_PHY_DLY); /* Delay for UTMI PHY CLK to 257 mdelay(FSL_UTMI_PHY_DLY); /* Delay for UTMI PHY CLK to
@@ -267,7 +267,8 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
267 break; 267 break;
268 } 268 }
269 269
270 if (pdata->controller_ver && (phy_mode == FSL_USB2_PHY_ULPI)) { 270 if (pdata->have_sysif_regs && pdata->controller_ver &&
271 (phy_mode == FSL_USB2_PHY_ULPI)) {
271 /* check PHY_CLK_VALID to get phy clk valid */ 272 /* check PHY_CLK_VALID to get phy clk valid */
272 if (!spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) & 273 if (!spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) &
273 PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0)) { 274 PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0)) {
@@ -278,7 +279,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
278 279
279 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); 280 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]);
280 281
281 if (phy_mode != FSL_USB2_PHY_ULPI) 282 if (phy_mode != FSL_USB2_PHY_ULPI && pdata->have_sysif_regs)
282 setbits32(non_ehci + FSL_SOC_USB_CTRL, USB_CTRL_USB_EN); 283 setbits32(non_ehci + FSL_SOC_USB_CTRL, USB_CTRL_USB_EN);
283 284
284 return 0; 285 return 0;
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index f7bfc0b898b..6c56297ea16 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -43,7 +43,7 @@ static void ehci_clock_enable(struct ehci_hcd_mv *ehci_mv)
43 unsigned int i; 43 unsigned int i;
44 44
45 for (i = 0; i < ehci_mv->clknum; i++) 45 for (i = 0; i < ehci_mv->clknum; i++)
46 clk_enable(ehci_mv->clk[i]); 46 clk_prepare_enable(ehci_mv->clk[i]);
47} 47}
48 48
49static void ehci_clock_disable(struct ehci_hcd_mv *ehci_mv) 49static void ehci_clock_disable(struct ehci_hcd_mv *ehci_mv)
@@ -51,7 +51,7 @@ static void ehci_clock_disable(struct ehci_hcd_mv *ehci_mv)
51 unsigned int i; 51 unsigned int i;
52 52
53 for (i = 0; i < ehci_mv->clknum; i++) 53 for (i = 0; i < ehci_mv->clknum; i++)
54 clk_disable(ehci_mv->clk[i]); 54 clk_disable_unprepare(ehci_mv->clk[i]);
55} 55}
56 56
57static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv) 57static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index a7d1f5b4c4e..914a3ecfb5d 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -325,7 +325,7 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
325 325
326MODULE_ALIAS("platform:orion-ehci"); 326MODULE_ALIAS("platform:orion-ehci");
327 327
328static const struct of_device_id ehci_orion_dt_ids[] __devinitdata = { 328static const struct of_device_id ehci_orion_dt_ids[] = {
329 { .compatible = "marvell,orion-ehci", }, 329 { .compatible = "marvell,orion-ehci", },
330 {}, 330 {},
331}; 331};
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index dabb2049482..170b9399e09 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -200,6 +200,26 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
200 break; 200 break;
201 } 201 }
202 202
203 /* optional debug port, normally in the first BAR */
204 temp = pci_find_capability(pdev, PCI_CAP_ID_DBG);
205 if (temp) {
206 pci_read_config_dword(pdev, temp, &temp);
207 temp >>= 16;
208 if (((temp >> 13) & 7) == 1) {
209 u32 hcs_params = ehci_readl(ehci,
210 &ehci->caps->hcs_params);
211
212 temp &= 0x1fff;
213 ehci->debug = hcd->regs + temp;
214 temp = ehci_readl(ehci, &ehci->debug->control);
215 ehci_info(ehci, "debug port %d%s\n",
216 HCS_DEBUG_PORT(hcs_params),
217 (temp & DBGP_ENABLED) ? " IN USE" : "");
218 if (!(temp & DBGP_ENABLED))
219 ehci->debug = NULL;
220 }
221 }
222
203 retval = ehci_setup(hcd); 223 retval = ehci_setup(hcd);
204 if (retval) 224 if (retval)
205 return retval; 225 return retval;
@@ -228,25 +248,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
228 break; 248 break;
229 } 249 }
230 250
231 /* optional debug port, normally in the first BAR */
232 temp = pci_find_capability(pdev, 0x0a);
233 if (temp) {
234 pci_read_config_dword(pdev, temp, &temp);
235 temp >>= 16;
236 if ((temp & (3 << 13)) == (1 << 13)) {
237 temp &= 0x1fff;
238 ehci->debug = hcd->regs + temp;
239 temp = ehci_readl(ehci, &ehci->debug->control);
240 ehci_info(ehci, "debug port %d%s\n",
241 HCS_DEBUG_PORT(ehci->hcs_params),
242 (temp & DBGP_ENABLED)
243 ? " IN USE"
244 : "");
245 if (!(temp & DBGP_ENABLED))
246 ehci->debug = NULL;
247 }
248 }
249
250 /* at least the Genesys GL880S needs fixup here */ 251 /* at least the Genesys GL880S needs fixup here */
251 temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params); 252 temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
252 temp &= 0x0f; 253 temp &= 0x0f;
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 5105127c1d4..11e0b79ff9d 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -142,6 +142,9 @@ static int usb_get_ver_info(struct device_node *np)
142 return ver; 142 return ver;
143 } 143 }
144 144
145 if (of_device_is_compatible(np, "fsl,mpc5121-usb2-dr"))
146 return FSL_USB_VER_OLD;
147
145 if (of_device_is_compatible(np, "fsl-usb2-mph")) { 148 if (of_device_is_compatible(np, "fsl-usb2-mph")) {
146 if (of_device_is_compatible(np, "fsl-usb2-mph-v1.6")) 149 if (of_device_is_compatible(np, "fsl-usb2-mph-v1.6"))
147 ver = FSL_USB_VER_1_6; 150 ver = FSL_USB_VER_1_6;
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
index bd6a7447ccc..f0ebe8e7c58 100644
--- a/drivers/usb/host/imx21-hcd.c
+++ b/drivers/usb/host/imx21-hcd.c
@@ -58,6 +58,7 @@
58#include <linux/usb.h> 58#include <linux/usb.h>
59#include <linux/usb/hcd.h> 59#include <linux/usb/hcd.h>
60#include <linux/dma-mapping.h> 60#include <linux/dma-mapping.h>
61#include <linux/module.h>
61 62
62#include "imx21-hcd.h" 63#include "imx21-hcd.h"
63 64
diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
index d370245a4ee..5e3a6deb62b 100644
--- a/drivers/usb/host/ohci-tmio.c
+++ b/drivers/usb/host/ohci-tmio.c
@@ -128,7 +128,8 @@ static void tmio_start_hc(struct platform_device *dev)
128 tmio_iowrite8(2, tmio->ccr + CCR_INTC); 128 tmio_iowrite8(2, tmio->ccr + CCR_INTC);
129 129
130 dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n", 130 dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n",
131 tmio_ioread8(tmio->ccr + CCR_REVID), hcd->rsrc_start, hcd->irq); 131 tmio_ioread8(tmio->ccr + CCR_REVID),
132 (u64) hcd->rsrc_start, hcd->irq);
132} 133}
133 134
134static int ohci_tmio_start(struct usb_hcd *hcd) 135static int ohci_tmio_start(struct usb_hcd *hcd)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index a686cf4905b..68914429482 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -761,12 +761,39 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
761 break; 761 break;
762 case USB_PORT_FEAT_LINK_STATE: 762 case USB_PORT_FEAT_LINK_STATE:
763 temp = xhci_readl(xhci, port_array[wIndex]); 763 temp = xhci_readl(xhci, port_array[wIndex]);
764
765 /* Disable port */
766 if (link_state == USB_SS_PORT_LS_SS_DISABLED) {
767 xhci_dbg(xhci, "Disable port %d\n", wIndex);
768 temp = xhci_port_state_to_neutral(temp);
769 /*
770 * Clear all change bits, so that we get a new
771 * connection event.
772 */
773 temp |= PORT_CSC | PORT_PEC | PORT_WRC |
774 PORT_OCC | PORT_RC | PORT_PLC |
775 PORT_CEC;
776 xhci_writel(xhci, temp | PORT_PE,
777 port_array[wIndex]);
778 temp = xhci_readl(xhci, port_array[wIndex]);
779 break;
780 }
781
782 /* Put link in RxDetect (enable port) */
783 if (link_state == USB_SS_PORT_LS_RX_DETECT) {
784 xhci_dbg(xhci, "Enable port %d\n", wIndex);
785 xhci_set_link_state(xhci, port_array, wIndex,
786 link_state);
787 temp = xhci_readl(xhci, port_array[wIndex]);
788 break;
789 }
790
764 /* Software should not attempt to set 791 /* Software should not attempt to set
765 * port link state above '5' (Rx.Detect) and the port 792 * port link state above '3' (U3) and the port
766 * must be enabled. 793 * must be enabled.
767 */ 794 */
768 if ((temp & PORT_PE) == 0 || 795 if ((temp & PORT_PE) == 0 ||
769 (link_state > USB_SS_PORT_LS_RX_DETECT)) { 796 (link_state > USB_SS_PORT_LS_U3)) {
770 xhci_warn(xhci, "Cannot set link state.\n"); 797 xhci_warn(xhci, "Cannot set link state.\n");
771 goto error; 798 goto error;
772 } 799 }
@@ -957,6 +984,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
957 int max_ports; 984 int max_ports;
958 __le32 __iomem **port_array; 985 __le32 __iomem **port_array;
959 struct xhci_bus_state *bus_state; 986 struct xhci_bus_state *bus_state;
987 bool reset_change = false;
960 988
961 max_ports = xhci_get_ports(hcd, &port_array); 989 max_ports = xhci_get_ports(hcd, &port_array);
962 bus_state = &xhci->bus_state[hcd_index(hcd)]; 990 bus_state = &xhci->bus_state[hcd_index(hcd)];
@@ -988,6 +1016,12 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
988 buf[(i + 1) / 8] |= 1 << (i + 1) % 8; 1016 buf[(i + 1) / 8] |= 1 << (i + 1) % 8;
989 status = 1; 1017 status = 1;
990 } 1018 }
1019 if ((temp & PORT_RC))
1020 reset_change = true;
1021 }
1022 if (!status && !reset_change) {
1023 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
1024 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
991 } 1025 }
992 spin_unlock_irqrestore(&xhci->lock, flags); 1026 spin_unlock_irqrestore(&xhci->lock, flags);
993 return status ? retval : 0; 1027 return status ? retval : 0;
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index fb51c7085ad..35616ffbe3a 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1250,6 +1250,8 @@ static unsigned int xhci_microframes_to_exponent(struct usb_device *udev,
1250static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, 1250static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
1251 struct usb_host_endpoint *ep) 1251 struct usb_host_endpoint *ep)
1252{ 1252{
1253 if (ep->desc.bInterval == 0)
1254 return 0;
1253 return xhci_microframes_to_exponent(udev, ep, 1255 return xhci_microframes_to_exponent(udev, ep,
1254 ep->desc.bInterval, 0, 15); 1256 ep->desc.bInterval, 0, 15);
1255} 1257}
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index cbb44b7b9d6..59fb5c677db 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1725,6 +1725,15 @@ cleanup:
1725 if (bogus_port_status) 1725 if (bogus_port_status)
1726 return; 1726 return;
1727 1727
1728 /*
1729 * xHCI port-status-change events occur when the "or" of all the
1730 * status-change bits in the portsc register changes from 0 to 1.
1731 * New status changes won't cause an event if any other change
1732 * bits are still set. When an event occurs, switch over to
1733 * polling to avoid losing status changes.
1734 */
1735 xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
1736 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
1728 spin_unlock(&xhci->lock); 1737 spin_unlock(&xhci->lock);
1729 /* Pass this up to the core */ 1738 /* Pass this up to the core */
1730 usb_hcd_poll_rh_status(hcd); 1739 usb_hcd_poll_rh_status(hcd);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5c72c431bab..f1f01a834ba 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -884,6 +884,11 @@ int xhci_suspend(struct xhci_hcd *xhci)
884 xhci->shared_hcd->state != HC_STATE_SUSPENDED) 884 xhci->shared_hcd->state != HC_STATE_SUSPENDED)
885 return -EINVAL; 885 return -EINVAL;
886 886
887 /* Don't poll the roothubs on bus suspend. */
888 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
889 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
890 del_timer_sync(&hcd->rh_timer);
891
887 spin_lock_irq(&xhci->lock); 892 spin_lock_irq(&xhci->lock);
888 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 893 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
889 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); 894 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
@@ -1069,6 +1074,11 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1069 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 1074 if (xhci->quirks & XHCI_COMP_MODE_QUIRK)
1070 compliance_mode_recovery_timer_init(xhci); 1075 compliance_mode_recovery_timer_init(xhci);
1071 1076
1077 /* Re-enable port polling. */
1078 xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
1079 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
1080 usb_hcd_poll_rh_status(hcd);
1081
1072 return retval; 1082 return retval;
1073} 1083}
1074#endif /* CONFIG_PM */ 1084#endif /* CONFIG_PM */
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 7667b12f2ff..268148de971 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -2179,7 +2179,7 @@ usbtest_ioctl(struct usb_interface *intf, unsigned int code, void *buf)
2179 if (dev->out_pipe == 0 || !param->length || param->sglen < 4) 2179 if (dev->out_pipe == 0 || !param->length || param->sglen < 4)
2180 break; 2180 break;
2181 retval = 0; 2181 retval = 0;
2182 dev_info(&intf->dev, "TEST 17: unlink from %d queues of " 2182 dev_info(&intf->dev, "TEST 24: unlink from %d queues of "
2183 "%d %d-byte writes\n", 2183 "%d %d-byte writes\n",
2184 param->iterations, param->sglen, param->length); 2184 param->iterations, param->sglen, param->length);
2185 for (i = param->iterations; retval == 0 && i > 0; --i) { 2185 for (i = param->iterations; retval == 0 && i > 0; --i) {
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f1c6c5470b9..fd3486745e6 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2298,10 +2298,7 @@ static int __init musb_init(void)
2298 if (usb_disabled()) 2298 if (usb_disabled())
2299 return 0; 2299 return 0;
2300 2300
2301 pr_info("%s: version " MUSB_VERSION ", " 2301 pr_info("%s: version " MUSB_VERSION ", ?dma?, otg (peripheral+host)\n",
2302 "?dma?"
2303 ", "
2304 "otg (peripheral+host)",
2305 musb_driver_name); 2302 musb_driver_name);
2306 return platform_driver_register(&musb_driver); 2303 return platform_driver_register(&musb_driver);
2307} 2304}
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index e6f2ae8368b..f7d764de6fd 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -134,6 +134,11 @@ static const resource_size_t dsps_control_module_phys[] = {
134 DSPS_AM33XX_CONTROL_MODULE_PHYS_1, 134 DSPS_AM33XX_CONTROL_MODULE_PHYS_1,
135}; 135};
136 136
137#define USBPHY_CM_PWRDN (1 << 0)
138#define USBPHY_OTG_PWRDN (1 << 1)
139#define USBPHY_OTGVDET_EN (1 << 19)
140#define USBPHY_OTGSESSEND_EN (1 << 20)
141
137/** 142/**
138 * musb_dsps_phy_control - phy on/off 143 * musb_dsps_phy_control - phy on/off
139 * @glue: struct dsps_glue * 144 * @glue: struct dsps_glue *
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
index 6223062d5d1..37962c99ff1 100644
--- a/drivers/usb/otg/Kconfig
+++ b/drivers/usb/otg/Kconfig
@@ -110,7 +110,7 @@ config AB8500_USB
110 110
111config FSL_USB2_OTG 111config FSL_USB2_OTG
112 bool "Freescale USB OTG Transceiver Driver" 112 bool "Freescale USB OTG Transceiver Driver"
113 depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 && USB_SUSPEND 113 depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
114 select USB_OTG 114 select USB_OTG
115 select USB_OTG_UTILS 115 select USB_OTG_UTILS
116 help 116 help
diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c
index 1dd57504186..eace975991a 100644
--- a/drivers/usb/otg/mv_otg.c
+++ b/drivers/usb/otg/mv_otg.c
@@ -240,7 +240,7 @@ static void otg_clock_enable(struct mv_otg *mvotg)
240 unsigned int i; 240 unsigned int i;
241 241
242 for (i = 0; i < mvotg->clknum; i++) 242 for (i = 0; i < mvotg->clknum; i++)
243 clk_enable(mvotg->clk[i]); 243 clk_prepare_enable(mvotg->clk[i]);
244} 244}
245 245
246static void otg_clock_disable(struct mv_otg *mvotg) 246static void otg_clock_disable(struct mv_otg *mvotg)
@@ -248,7 +248,7 @@ static void otg_clock_disable(struct mv_otg *mvotg)
248 unsigned int i; 248 unsigned int i;
249 249
250 for (i = 0; i < mvotg->clknum; i++) 250 for (i = 0; i < mvotg->clknum; i++)
251 clk_disable(mvotg->clk[i]); 251 clk_disable_unprepare(mvotg->clk[i]);
252} 252}
253 253
254static int mv_otg_enable_internal(struct mv_otg *mvotg) 254static int mv_otg_enable_internal(struct mv_otg *mvotg)
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index dd41f61893e..f2985cd8802 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -545,15 +545,6 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep)
545 return 0; 545 return 0;
546} 546}
547 547
548static void usbhsg_uep_init(struct usbhsg_gpriv *gpriv)
549{
550 int i;
551 struct usbhsg_uep *uep;
552
553 usbhsg_for_each_uep_with_dcp(uep, gpriv, i)
554 uep->pipe = NULL;
555}
556
557/* 548/*
558 * 549 *
559 * usb_ep_ops 550 * usb_ep_ops
@@ -610,7 +601,12 @@ static int usbhsg_ep_disable(struct usb_ep *ep)
610{ 601{
611 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); 602 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
612 603
613 return usbhsg_pipe_disable(uep); 604 usbhsg_pipe_disable(uep);
605
606 uep->pipe->mod_private = NULL;
607 uep->pipe = NULL;
608
609 return 0;
614} 610}
615 611
616static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep, 612static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep,
@@ -761,9 +757,8 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status)
761 usbhs_pipe_init(priv, 757 usbhs_pipe_init(priv,
762 usbhsg_dma_map_ctrl); 758 usbhsg_dma_map_ctrl);
763 usbhs_fifo_init(priv); 759 usbhs_fifo_init(priv);
764 usbhsg_uep_init(gpriv);
765 760
766 /* dcp init */ 761 /* dcp init instead of usbhsg_ep_enable() */
767 dcp->pipe = usbhs_dcp_malloc(priv); 762 dcp->pipe = usbhs_dcp_malloc(priv);
768 dcp->pipe->mod_private = dcp; 763 dcp->pipe->mod_private = dcp;
769 usbhs_pipe_config_update(dcp->pipe, 0, 0, 64); 764 usbhs_pipe_config_update(dcp->pipe, 0, 0, 64);
@@ -825,7 +820,7 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)
825 usbhs_sys_set_test_mode(priv, 0); 820 usbhs_sys_set_test_mode(priv, 0);
826 usbhs_sys_function_ctrl(priv, 0); 821 usbhs_sys_function_ctrl(priv, 0);
827 822
828 usbhsg_pipe_disable(dcp); 823 usbhsg_ep_disable(&dcp->ep);
829 824
830 dev_dbg(dev, "stop gadget\n"); 825 dev_dbg(dev, "stop gadget\n");
831 826
@@ -998,6 +993,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
998 */ 993 */
999 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) { 994 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) {
1000 uep->gpriv = gpriv; 995 uep->gpriv = gpriv;
996 uep->pipe = NULL;
1001 snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i); 997 snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i);
1002 998
1003 uep->ep.name = uep->ep_name; 999 uep->ep.name = uep->ep_name;
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
index 3d3cd6ca268..b86815421c8 100644
--- a/drivers/usb/renesas_usbhs/mod_host.c
+++ b/drivers/usb/renesas_usbhs/mod_host.c
@@ -661,9 +661,10 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
661 status = -ESHUTDOWN; 661 status = -ESHUTDOWN;
662 662
663 urb->actual_length = pkt->actual; 663 urb->actual_length = pkt->actual;
664 usbhsh_ureq_free(hpriv, ureq);
665 664
666 usbhsh_endpoint_sequence_save(hpriv, urb, pkt); 665 usbhsh_endpoint_sequence_save(hpriv, urb, pkt);
666 usbhsh_ureq_free(hpriv, ureq);
667
667 usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep)); 668 usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep));
668 669
669 usb_hcd_unlink_urb_from_ep(hcd, urb); 670 usb_hcd_unlink_urb_from_ep(hcd, urb);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 0a373b3ae96..ba68835d06a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -875,6 +875,8 @@ static struct usb_device_id id_table_combined [] = {
875 { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 875 { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID),
876 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 876 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
877 { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 877 { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) },
878 /* Crucible Devices */
879 { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) },
878 { }, /* Optional parameter entry */ 880 { }, /* Optional parameter entry */
879 { } /* Terminating entry */ 881 { } /* Terminating entry */
880}; 882};
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 049b6e715fa..fa5d5603827 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1259,3 +1259,9 @@
1259 * ATI command output: Cinterion MC55i 1259 * ATI command output: Cinterion MC55i
1260 */ 1260 */
1261#define FTDI_CINTERION_MC55I_PID 0xA951 1261#define FTDI_CINTERION_MC55I_PID 0xA951
1262
1263/*
1264 * Product: Comet Caller ID decoder
1265 * Manufacturer: Crucible Technologies
1266 */
1267#define FTDI_CT_COMET_PID 0x8e08
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index e6f87b76c71..478adcfcdf2 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -288,6 +288,7 @@ static void option_instat_callback(struct urb *urb);
288#define ALCATEL_VENDOR_ID 0x1bbb 288#define ALCATEL_VENDOR_ID 0x1bbb
289#define ALCATEL_PRODUCT_X060S_X200 0x0000 289#define ALCATEL_PRODUCT_X060S_X200 0x0000
290#define ALCATEL_PRODUCT_X220_X500D 0x0017 290#define ALCATEL_PRODUCT_X220_X500D 0x0017
291#define ALCATEL_PRODUCT_L100V 0x011e
291 292
292#define PIRELLI_VENDOR_ID 0x1266 293#define PIRELLI_VENDOR_ID 0x1266
293#define PIRELLI_PRODUCT_C100_1 0x1002 294#define PIRELLI_PRODUCT_C100_1 0x1002
@@ -429,9 +430,12 @@ static void option_instat_callback(struct urb *urb);
429#define MEDIATEK_VENDOR_ID 0x0e8d 430#define MEDIATEK_VENDOR_ID 0x0e8d
430#define MEDIATEK_PRODUCT_DC_1COM 0x00a0 431#define MEDIATEK_PRODUCT_DC_1COM 0x00a0
431#define MEDIATEK_PRODUCT_DC_4COM 0x00a5 432#define MEDIATEK_PRODUCT_DC_4COM 0x00a5
433#define MEDIATEK_PRODUCT_DC_4COM2 0x00a7
432#define MEDIATEK_PRODUCT_DC_5COM 0x00a4 434#define MEDIATEK_PRODUCT_DC_5COM 0x00a4
433#define MEDIATEK_PRODUCT_7208_1COM 0x7101 435#define MEDIATEK_PRODUCT_7208_1COM 0x7101
434#define MEDIATEK_PRODUCT_7208_2COM 0x7102 436#define MEDIATEK_PRODUCT_7208_2COM 0x7102
437#define MEDIATEK_PRODUCT_7103_2COM 0x7103
438#define MEDIATEK_PRODUCT_7106_2COM 0x7106
435#define MEDIATEK_PRODUCT_FP_1COM 0x0003 439#define MEDIATEK_PRODUCT_FP_1COM 0x0003
436#define MEDIATEK_PRODUCT_FP_2COM 0x0023 440#define MEDIATEK_PRODUCT_FP_2COM 0x0023
437#define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 441#define MEDIATEK_PRODUCT_FPDC_1COM 0x0043
@@ -441,6 +445,10 @@ static void option_instat_callback(struct urb *urb);
441#define CELLIENT_VENDOR_ID 0x2692 445#define CELLIENT_VENDOR_ID 0x2692
442#define CELLIENT_PRODUCT_MEN200 0x9005 446#define CELLIENT_PRODUCT_MEN200 0x9005
443 447
448/* Hyundai Petatel Inc. products */
449#define PETATEL_VENDOR_ID 0x1ff4
450#define PETATEL_PRODUCT_NP10T 0x600e
451
444/* some devices interfaces need special handling due to a number of reasons */ 452/* some devices interfaces need special handling due to a number of reasons */
445enum option_blacklist_reason { 453enum option_blacklist_reason {
446 OPTION_BLACKLIST_NONE = 0, 454 OPTION_BLACKLIST_NONE = 0,
@@ -923,7 +931,8 @@ static const struct usb_device_id option_ids[] = {
923 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ 931 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
924 .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 932 .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
925 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) }, 933 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
926 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) }, 934 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */
935 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
927 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) }, 936 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
928 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff), 937 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
929 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 938 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
@@ -1190,6 +1199,8 @@ static const struct usb_device_id option_ids[] = {
1190 .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist 1199 .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
1191 }, 1200 },
1192 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, 1201 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) },
1202 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V),
1203 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1193 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 1204 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
1194 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 1205 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
1195 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), 1206 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
@@ -1294,7 +1305,12 @@ static const struct usb_device_id option_ids[] = {
1294 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, 1305 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) },
1295 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, 1306 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) },
1296 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, 1307 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) },
1308 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7103_2COM, 0xff, 0x00, 0x00) },
1309 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) },
1310 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
1311 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
1297 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, 1312 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
1313 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
1298 { } /* Terminating entry */ 1314 { } /* Terminating entry */
1299}; 1315};
1300MODULE_DEVICE_TABLE(usb, option_ids); 1316MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index b303f171506..6488a7351a6 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -66,7 +66,7 @@
66 * have. Allow 1% either way on the nominal for TVs. 66 * have. Allow 1% either way on the nominal for TVs.
67 */ 67 */
68#define NR_MONTYPES 6 68#define NR_MONTYPES 6
69static struct fb_monspecs monspecs[NR_MONTYPES] __devinitdata = { 69static struct fb_monspecs monspecs[NR_MONTYPES] = {
70 { /* TV */ 70 { /* TV */
71 .hfmin = 15469, 71 .hfmin = 15469,
72 .hfmax = 15781, 72 .hfmax = 15781,
@@ -874,7 +874,7 @@ static struct fb_ops acornfb_ops = {
874/* 874/*
875 * Everything after here is initialisation!!! 875 * Everything after here is initialisation!!!
876 */ 876 */
877static struct fb_videomode modedb[] __devinitdata = { 877static struct fb_videomode modedb[] = {
878 { /* 320x256 @ 50Hz */ 878 { /* 320x256 @ 50Hz */
879 NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2, 879 NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2,
880 FB_SYNC_COMP_HIGH_ACT, 880 FB_SYNC_COMP_HIGH_ACT,
@@ -926,7 +926,7 @@ static struct fb_videomode modedb[] __devinitdata = {
926 } 926 }
927}; 927};
928 928
929static struct fb_videomode acornfb_default_mode __devinitdata = { 929static struct fb_videomode acornfb_default_mode = {
930 .name = NULL, 930 .name = NULL,
931 .refresh = 60, 931 .refresh = 60,
932 .xres = 640, 932 .xres = 640,
@@ -942,7 +942,7 @@ static struct fb_videomode acornfb_default_mode __devinitdata = {
942 .vmode = FB_VMODE_NONINTERLACED 942 .vmode = FB_VMODE_NONINTERLACED
943}; 943};
944 944
945static void __devinit acornfb_init_fbinfo(void) 945static void acornfb_init_fbinfo(void)
946{ 946{
947 static int first = 1; 947 static int first = 1;
948 948
@@ -1018,7 +1018,7 @@ static void __devinit acornfb_init_fbinfo(void)
1018 * size can optionally be followed by 'M' or 'K' for 1018 * size can optionally be followed by 'M' or 'K' for
1019 * MB or KB respectively. 1019 * MB or KB respectively.
1020 */ 1020 */
1021static void __devinit acornfb_parse_mon(char *opt) 1021static void acornfb_parse_mon(char *opt)
1022{ 1022{
1023 char *p = opt; 1023 char *p = opt;
1024 1024
@@ -1065,7 +1065,7 @@ bad:
1065 current_par.montype = -1; 1065 current_par.montype = -1;
1066} 1066}
1067 1067
1068static void __devinit acornfb_parse_montype(char *opt) 1068static void acornfb_parse_montype(char *opt)
1069{ 1069{
1070 current_par.montype = -2; 1070 current_par.montype = -2;
1071 1071
@@ -1106,7 +1106,7 @@ static void __devinit acornfb_parse_montype(char *opt)
1106 } 1106 }
1107} 1107}
1108 1108
1109static void __devinit acornfb_parse_dram(char *opt) 1109static void acornfb_parse_dram(char *opt)
1110{ 1110{
1111 unsigned int size; 1111 unsigned int size;
1112 1112
@@ -1131,14 +1131,14 @@ static void __devinit acornfb_parse_dram(char *opt)
1131static struct options { 1131static struct options {
1132 char *name; 1132 char *name;
1133 void (*parse)(char *opt); 1133 void (*parse)(char *opt);
1134} opt_table[] __devinitdata = { 1134} opt_table[] = {
1135 { "mon", acornfb_parse_mon }, 1135 { "mon", acornfb_parse_mon },
1136 { "montype", acornfb_parse_montype }, 1136 { "montype", acornfb_parse_montype },
1137 { "dram", acornfb_parse_dram }, 1137 { "dram", acornfb_parse_dram },
1138 { NULL, NULL } 1138 { NULL, NULL }
1139}; 1139};
1140 1140
1141static int __devinit acornfb_setup(char *options) 1141static int acornfb_setup(char *options)
1142{ 1142{
1143 struct options *optp; 1143 struct options *optp;
1144 char *opt; 1144 char *opt;
@@ -1175,7 +1175,7 @@ static int __devinit acornfb_setup(char *options)
1175 * Detect type of monitor connected 1175 * Detect type of monitor connected
1176 * For now, we just assume SVGA 1176 * For now, we just assume SVGA
1177 */ 1177 */
1178static int __devinit acornfb_detect_monitortype(void) 1178static int acornfb_detect_monitortype(void)
1179{ 1179{
1180 return 4; 1180 return 4;
1181} 1181}
@@ -1216,7 +1216,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
1216 printk("acornfb: freed %dK memory\n", mb_freed); 1216 printk("acornfb: freed %dK memory\n", mb_freed);
1217} 1217}
1218 1218
1219static int __devinit acornfb_probe(struct platform_device *dev) 1219static int acornfb_probe(struct platform_device *dev)
1220{ 1220{
1221 unsigned long size; 1221 unsigned long size;
1222 u_int h_sync, v_sync; 1222 u_int h_sync, v_sync;
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 4659d5da6ff..e43401afdd0 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -79,7 +79,7 @@ struct arcfb_par {
79 spinlock_t lock; 79 spinlock_t lock;
80}; 80};
81 81
82static struct fb_fix_screeninfo arcfb_fix __devinitdata = { 82static struct fb_fix_screeninfo arcfb_fix = {
83 .id = "arcfb", 83 .id = "arcfb",
84 .type = FB_TYPE_PACKED_PIXELS, 84 .type = FB_TYPE_PACKED_PIXELS,
85 .visual = FB_VISUAL_MONO01, 85 .visual = FB_VISUAL_MONO01,
@@ -89,7 +89,7 @@ static struct fb_fix_screeninfo arcfb_fix __devinitdata = {
89 .accel = FB_ACCEL_NONE, 89 .accel = FB_ACCEL_NONE,
90}; 90};
91 91
92static struct fb_var_screeninfo arcfb_var __devinitdata = { 92static struct fb_var_screeninfo arcfb_var = {
93 .xres = 128, 93 .xres = 128,
94 .yres = 64, 94 .yres = 64,
95 .xres_virtual = 128, 95 .xres_virtual = 128,
@@ -502,7 +502,7 @@ static struct fb_ops arcfb_ops = {
502 .fb_ioctl = arcfb_ioctl, 502 .fb_ioctl = arcfb_ioctl,
503}; 503};
504 504
505static int __devinit arcfb_probe(struct platform_device *dev) 505static int arcfb_probe(struct platform_device *dev)
506{ 506{
507 struct fb_info *info; 507 struct fb_info *info;
508 int retval = -ENOMEM; 508 int retval = -ENOMEM;
@@ -587,7 +587,7 @@ err:
587 return retval; 587 return retval;
588} 588}
589 589
590static int __devexit arcfb_remove(struct platform_device *dev) 590static int arcfb_remove(struct platform_device *dev)
591{ 591{
592 struct fb_info *info = platform_get_drvdata(dev); 592 struct fb_info *info = platform_get_drvdata(dev);
593 593
@@ -601,7 +601,7 @@ static int __devexit arcfb_remove(struct platform_device *dev)
601 601
602static struct platform_driver arcfb_driver = { 602static struct platform_driver arcfb_driver = {
603 .probe = arcfb_probe, 603 .probe = arcfb_probe,
604 .remove = __devexit_p(arcfb_remove), 604 .remove = arcfb_remove,
605 .driver = { 605 .driver = {
606 .name = "arcfb", 606 .name = "arcfb",
607 }, 607 },
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 555dd4c64f5..94a51f1ef90 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -100,7 +100,7 @@ static const struct svga_timing_regs ark_timing_regs = {
100 100
101/* Module parameters */ 101/* Module parameters */
102 102
103static char *mode_option __devinitdata = "640x480-8@60"; 103static char *mode_option = "640x480-8@60";
104 104
105#ifdef CONFIG_MTRR 105#ifdef CONFIG_MTRR
106static int mtrr = 1; 106static int mtrr = 1;
@@ -950,7 +950,7 @@ static struct fb_ops arkfb_ops = {
950 950
951 951
952/* PCI probe */ 952/* PCI probe */
953static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) 953static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
954{ 954{
955 struct pci_bus_region bus_reg; 955 struct pci_bus_region bus_reg;
956 struct resource vga_res; 956 struct resource vga_res;
@@ -1086,7 +1086,7 @@ err_enable_device:
1086 1086
1087/* PCI remove */ 1087/* PCI remove */
1088 1088
1089static void __devexit ark_pci_remove(struct pci_dev *dev) 1089static void ark_pci_remove(struct pci_dev *dev)
1090{ 1090{
1091 struct fb_info *info = pci_get_drvdata(dev); 1091 struct fb_info *info = pci_get_drvdata(dev);
1092 1092
@@ -1184,7 +1184,7 @@ fail:
1184 1184
1185/* List of boards that we are trying to support */ 1185/* List of boards that we are trying to support */
1186 1186
1187static struct pci_device_id ark_devices[] __devinitdata = { 1187static struct pci_device_id ark_devices[] = {
1188 {PCI_DEVICE(0xEDD8, 0xA099)}, 1188 {PCI_DEVICE(0xEDD8, 0xA099)},
1189 {0, 0, 0, 0, 0, 0, 0} 1189 {0, 0, 0, 0, 0, 0, 0}
1190}; 1190};
@@ -1196,7 +1196,7 @@ static struct pci_driver arkfb_pci_driver = {
1196 .name = "arkfb", 1196 .name = "arkfb",
1197 .id_table = ark_devices, 1197 .id_table = ark_devices,
1198 .probe = ark_pci_probe, 1198 .probe = ark_pci_probe,
1199 .remove = __devexit_p(ark_pci_remove), 1199 .remove = ark_pci_remove,
1200 .suspend = ark_pci_suspend, 1200 .suspend = ark_pci_suspend,
1201 .resume = ark_pci_resume, 1201 .resume = ark_pci_resume,
1202}; 1202};
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 8cdf88e20b4..d5a37d62847 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -451,7 +451,7 @@ static struct chips_init_reg chips_init_xr[] =
451 {0xd1, 0x01}, 451 {0xd1, 0x01},
452}; 452};
453 453
454static void __devinit chips_hw_init(struct fb_info *p) 454static void chips_hw_init(struct fb_info *p)
455{ 455{
456 int i; 456 int i;
457 457
@@ -474,7 +474,7 @@ static void __devinit chips_hw_init(struct fb_info *p)
474 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 474 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
475} 475}
476 476
477static struct fb_fix_screeninfo asiliantfb_fix __devinitdata = { 477static struct fb_fix_screeninfo asiliantfb_fix = {
478 .id = "Asiliant 69000", 478 .id = "Asiliant 69000",
479 .type = FB_TYPE_PACKED_PIXELS, 479 .type = FB_TYPE_PACKED_PIXELS,
480 .visual = FB_VISUAL_PSEUDOCOLOR, 480 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -483,7 +483,7 @@ static struct fb_fix_screeninfo asiliantfb_fix __devinitdata = {
483 .smem_len = 0x200000, /* 2MB */ 483 .smem_len = 0x200000, /* 2MB */
484}; 484};
485 485
486static struct fb_var_screeninfo asiliantfb_var __devinitdata = { 486static struct fb_var_screeninfo asiliantfb_var = {
487 .xres = 640, 487 .xres = 640,
488 .yres = 480, 488 .yres = 480,
489 .xres_virtual = 640, 489 .xres_virtual = 640,
@@ -504,7 +504,7 @@ static struct fb_var_screeninfo asiliantfb_var __devinitdata = {
504 .vsync_len = 2, 504 .vsync_len = 2,
505}; 505};
506 506
507static int __devinit init_asiliant(struct fb_info *p, unsigned long addr) 507static int init_asiliant(struct fb_info *p, unsigned long addr)
508{ 508{
509 int err; 509 int err;
510 510
@@ -535,8 +535,8 @@ static int __devinit init_asiliant(struct fb_info *p, unsigned long addr)
535 return 0; 535 return 0;
536} 536}
537 537
538static int __devinit 538static int asiliantfb_pci_init(struct pci_dev *dp,
539asiliantfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) 539 const struct pci_device_id *ent)
540{ 540{
541 unsigned long addr, size; 541 unsigned long addr, size;
542 struct fb_info *p; 542 struct fb_info *p;
@@ -581,7 +581,7 @@ asiliantfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
581 return 0; 581 return 0;
582} 582}
583 583
584static void __devexit asiliantfb_remove(struct pci_dev *dp) 584static void asiliantfb_remove(struct pci_dev *dp)
585{ 585{
586 struct fb_info *p = pci_get_drvdata(dp); 586 struct fb_info *p = pci_get_drvdata(dp);
587 587
@@ -593,7 +593,7 @@ static void __devexit asiliantfb_remove(struct pci_dev *dp)
593 framebuffer_release(p); 593 framebuffer_release(p);
594} 594}
595 595
596static struct pci_device_id asiliantfb_pci_tbl[] __devinitdata = { 596static struct pci_device_id asiliantfb_pci_tbl[] = {
597 { PCI_VENDOR_ID_CT, PCI_DEVICE_ID_CT_69000, PCI_ANY_ID, PCI_ANY_ID }, 597 { PCI_VENDOR_ID_CT, PCI_DEVICE_ID_CT_69000, PCI_ANY_ID, PCI_ANY_ID },
598 { 0 } 598 { 0 }
599}; 599};
@@ -604,7 +604,7 @@ static struct pci_driver asiliantfb_driver = {
604 .name = "asiliantfb", 604 .name = "asiliantfb",
605 .id_table = asiliantfb_pci_tbl, 605 .id_table = asiliantfb_pci_tbl,
606 .probe = asiliantfb_pci_init, 606 .probe = asiliantfb_pci_init,
607 .remove = __devexit_p(asiliantfb_remove), 607 .remove = asiliantfb_remove,
608}; 608};
609 609
610static int __init asiliantfb_init(void) 610static int __init asiliantfb_init(void)
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 0fefa84ed9a..8c55011313d 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -98,7 +98,7 @@
98 98
99#ifndef CONFIG_PPC_PMAC 99#ifndef CONFIG_PPC_PMAC
100/* default mode */ 100/* default mode */
101static struct fb_var_screeninfo default_var __devinitdata = { 101static struct fb_var_screeninfo default_var = {
102 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ 102 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
103 640, 480, 640, 480, 0, 0, 8, 0, 103 640, 480, 640, 480, 0, 0, 8, 0,
104 {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, 104 {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
@@ -121,7 +121,7 @@ static struct fb_var_screeninfo default_var = {
121 121
122/* default modedb mode */ 122/* default modedb mode */
123/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ 123/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
124static struct fb_videomode defaultmode __devinitdata = { 124static struct fb_videomode defaultmode = {
125 .refresh = 60, 125 .refresh = 60,
126 .xres = 640, 126 .xres = 640,
127 .yres = 480, 127 .yres = 480,
@@ -149,7 +149,7 @@ enum {
149}; 149};
150 150
151/* Must match above enum */ 151/* Must match above enum */
152static char * const r128_family[] __devinitconst = { 152static char * const r128_family[] = {
153 "AGP", 153 "AGP",
154 "PCI", 154 "PCI",
155 "PRO AGP", 155 "PRO AGP",
@@ -275,7 +275,7 @@ static struct pci_driver aty128fb_driver = {
275 .name = "aty128fb", 275 .name = "aty128fb",
276 .id_table = aty128_pci_tbl, 276 .id_table = aty128_pci_tbl,
277 .probe = aty128_probe, 277 .probe = aty128_probe,
278 .remove = __devexit_p(aty128_remove), 278 .remove = aty128_remove,
279 .suspend = aty128_pci_suspend, 279 .suspend = aty128_pci_suspend,
280 .resume = aty128_pci_resume, 280 .resume = aty128_pci_resume,
281}; 281};
@@ -333,7 +333,7 @@ static const struct aty128_meminfo sdr_sgram =
333static const struct aty128_meminfo ddr_sgram = 333static const struct aty128_meminfo ddr_sgram =
334 { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; 334 { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" };
335 335
336static struct fb_fix_screeninfo aty128fb_fix __devinitdata = { 336static struct fb_fix_screeninfo aty128fb_fix = {
337 .id = "ATY Rage128", 337 .id = "ATY Rage128",
338 .type = FB_TYPE_PACKED_PIXELS, 338 .type = FB_TYPE_PACKED_PIXELS,
339 .visual = FB_VISUAL_PSEUDOCOLOR, 339 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -343,24 +343,24 @@ static struct fb_fix_screeninfo aty128fb_fix __devinitdata = {
343 .accel = FB_ACCEL_ATI_RAGE128, 343 .accel = FB_ACCEL_ATI_RAGE128,
344}; 344};
345 345
346static char *mode_option __devinitdata = NULL; 346static char *mode_option = NULL;
347 347
348#ifdef CONFIG_PPC_PMAC 348#ifdef CONFIG_PPC_PMAC
349static int default_vmode __devinitdata = VMODE_1024_768_60; 349static int default_vmode = VMODE_1024_768_60;
350static int default_cmode __devinitdata = CMODE_8; 350static int default_cmode = CMODE_8;
351#endif 351#endif
352 352
353static int default_crt_on __devinitdata = 0; 353static int default_crt_on = 0;
354static int default_lcd_on __devinitdata = 1; 354static int default_lcd_on = 1;
355 355
356#ifdef CONFIG_MTRR 356#ifdef CONFIG_MTRR
357static bool mtrr = true; 357static bool mtrr = true;
358#endif 358#endif
359 359
360#ifdef CONFIG_PMAC_BACKLIGHT 360#ifdef CONFIG_PMAC_BACKLIGHT
361static int backlight __devinitdata = 1; 361static int backlight = 1;
362#else 362#else
363static int backlight __devinitdata = 0; 363static int backlight = 0;
364#endif 364#endif
365 365
366/* PLL constants */ 366/* PLL constants */
@@ -449,10 +449,9 @@ static int aty128_encode_var(struct fb_var_screeninfo *var,
449static int aty128_decode_var(struct fb_var_screeninfo *var, 449static int aty128_decode_var(struct fb_var_screeninfo *var,
450 struct aty128fb_par *par); 450 struct aty128fb_par *par);
451#if 0 451#if 0
452static void __devinit aty128_get_pllinfo(struct aty128fb_par *par, 452static void aty128_get_pllinfo(struct aty128fb_par *par, void __iomem *bios);
453 void __iomem *bios); 453static void __iomem *aty128_map_ROM(struct pci_dev *pdev,
454static void __devinit __iomem *aty128_map_ROM(struct pci_dev *pdev, 454 const struct aty128fb_par *par);
455 const struct aty128fb_par *par);
456#endif 455#endif
457static void aty128_timings(struct aty128fb_par *par); 456static void aty128_timings(struct aty128fb_par *par);
458static void aty128_init_engine(struct aty128fb_par *par); 457static void aty128_init_engine(struct aty128fb_par *par);
@@ -582,7 +581,7 @@ static void aty_pll_writeupdate(const struct aty128fb_par *par)
582 581
583 582
584/* write to the scratch register to test r/w functionality */ 583/* write to the scratch register to test r/w functionality */
585static int __devinit register_test(const struct aty128fb_par *par) 584static int register_test(const struct aty128fb_par *par)
586{ 585{
587 u32 val; 586 u32 val;
588 int flag = 0; 587 int flag = 0;
@@ -781,8 +780,8 @@ static u32 depth_to_dst(u32 depth)
781 780
782 781
783#ifndef __sparc__ 782#ifndef __sparc__
784static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par, 783static void __iomem *aty128_map_ROM(const struct aty128fb_par *par,
785 struct pci_dev *dev) 784 struct pci_dev *dev)
786{ 785{
787 u16 dptr; 786 u16 dptr;
788 u8 rom_type; 787 u8 rom_type;
@@ -868,8 +867,8 @@ static void __iomem * __devinit aty128_map_ROM(const struct aty128fb_par *par,
868 return NULL; 867 return NULL;
869} 868}
870 869
871static void __devinit aty128_get_pllinfo(struct aty128fb_par *par, 870static void aty128_get_pllinfo(struct aty128fb_par *par,
872 unsigned char __iomem *bios) 871 unsigned char __iomem *bios)
873{ 872{
874 unsigned int bios_hdr; 873 unsigned int bios_hdr;
875 unsigned int bios_pll; 874 unsigned int bios_pll;
@@ -891,7 +890,7 @@ static void __devinit aty128_get_pllinfo(struct aty128fb_par *par,
891} 890}
892 891
893#ifdef CONFIG_X86 892#ifdef CONFIG_X86
894static void __iomem * __devinit aty128_find_mem_vbios(struct aty128fb_par *par) 893static void __iomem *aty128_find_mem_vbios(struct aty128fb_par *par)
895{ 894{
896 /* I simplified this code as we used to miss the signatures in 895 /* I simplified this code as we used to miss the signatures in
897 * a lot of case. It's now closer to XFree, we just don't check 896 * a lot of case. It's now closer to XFree, we just don't check
@@ -916,7 +915,7 @@ static void __iomem * __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
916#endif /* ndef(__sparc__) */ 915#endif /* ndef(__sparc__) */
917 916
918/* fill in known card constants if pll_block is not available */ 917/* fill in known card constants if pll_block is not available */
919static void __devinit aty128_timings(struct aty128fb_par *par) 918static void aty128_timings(struct aty128fb_par *par)
920{ 919{
921#ifdef CONFIG_PPC_OF 920#ifdef CONFIG_PPC_OF
922 /* instead of a table lookup, assume OF has properly 921 /* instead of a table lookup, assume OF has properly
@@ -1658,7 +1657,7 @@ static int aty128fb_sync(struct fb_info *info)
1658} 1657}
1659 1658
1660#ifndef MODULE 1659#ifndef MODULE
1661static int __devinit aty128fb_setup(char *options) 1660static int aty128fb_setup(char *options)
1662{ 1661{
1663 char *this_opt; 1662 char *this_opt;
1664 1663
@@ -1888,8 +1887,7 @@ static void aty128_early_resume(void *data)
1888} 1887}
1889#endif /* CONFIG_PPC_PMAC */ 1888#endif /* CONFIG_PPC_PMAC */
1890 1889
1891static int __devinit aty128_init(struct pci_dev *pdev, 1890static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)
1892 const struct pci_device_id *ent)
1893{ 1891{
1894 struct fb_info *info = pci_get_drvdata(pdev); 1892 struct fb_info *info = pci_get_drvdata(pdev);
1895 struct aty128fb_par *par = info->par; 1893 struct aty128fb_par *par = info->par;
@@ -2039,8 +2037,7 @@ static int __devinit aty128_init(struct pci_dev *pdev,
2039 2037
2040#ifdef CONFIG_PCI 2038#ifdef CONFIG_PCI
2041/* register a card ++ajoshi */ 2039/* register a card ++ajoshi */
2042static int __devinit aty128_probe(struct pci_dev *pdev, 2040static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2043 const struct pci_device_id *ent)
2044{ 2041{
2045 unsigned long fb_addr, reg_addr; 2042 unsigned long fb_addr, reg_addr;
2046 struct aty128fb_par *par; 2043 struct aty128fb_par *par;
@@ -2156,7 +2153,7 @@ err_free_fb:
2156 return -ENODEV; 2153 return -ENODEV;
2157} 2154}
2158 2155
2159static void __devexit aty128_remove(struct pci_dev *pdev) 2156static void aty128_remove(struct pci_dev *pdev)
2160{ 2157{
2161 struct fb_info *info = pci_get_drvdata(pdev); 2158 struct fb_info *info = pci_get_drvdata(pdev);
2162 struct aty128fb_par *par; 2159 struct aty128fb_par *par;
@@ -2558,7 +2555,7 @@ static int aty128_pci_resume(struct pci_dev *pdev)
2558} 2555}
2559 2556
2560 2557
2561static int __devinit aty128fb_init(void) 2558static int aty128fb_init(void)
2562{ 2559{
2563#ifndef MODULE 2560#ifndef MODULE
2564 char *option = NULL; 2561 char *option = NULL;
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 868932f904e..4f27fdc58d8 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -214,7 +214,7 @@ struct pci_mmap_map {
214 unsigned long prot_mask; 214 unsigned long prot_mask;
215}; 215};
216 216
217static struct fb_fix_screeninfo atyfb_fix __devinitdata = { 217static struct fb_fix_screeninfo atyfb_fix = {
218 .id = "ATY Mach64", 218 .id = "ATY Mach64",
219 .type = FB_TYPE_PACKED_PIXELS, 219 .type = FB_TYPE_PACKED_PIXELS,
220 .visual = FB_VISUAL_PSEUDOCOLOR, 220 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -309,18 +309,18 @@ static int vram;
309static int pll; 309static int pll;
310static int mclk; 310static int mclk;
311static int xclk; 311static int xclk;
312static int comp_sync __devinitdata = -1; 312static int comp_sync = -1;
313static char *mode; 313static char *mode;
314 314
315#ifdef CONFIG_PMAC_BACKLIGHT 315#ifdef CONFIG_PMAC_BACKLIGHT
316static int backlight __devinitdata = 1; 316static int backlight = 1;
317#else 317#else
318static int backlight __devinitdata = 0; 318static int backlight = 0;
319#endif 319#endif
320 320
321#ifdef CONFIG_PPC 321#ifdef CONFIG_PPC
322static int default_vmode __devinitdata = VMODE_CHOOSE; 322static int default_vmode = VMODE_CHOOSE;
323static int default_cmode __devinitdata = CMODE_CHOOSE; 323static int default_cmode = CMODE_CHOOSE;
324 324
325module_param_named(vmode, default_vmode, int, 0); 325module_param_named(vmode, default_vmode, int, 0);
326MODULE_PARM_DESC(vmode, "int: video mode for mac"); 326MODULE_PARM_DESC(vmode, "int: video mode for mac");
@@ -329,10 +329,10 @@ MODULE_PARM_DESC(cmode, "int: color mode for mac");
329#endif 329#endif
330 330
331#ifdef CONFIG_ATARI 331#ifdef CONFIG_ATARI
332static unsigned int mach64_count __devinitdata = 0; 332static unsigned int mach64_count = 0;
333static unsigned long phys_vmembase[FB_MAX] __devinitdata = { 0, }; 333static unsigned long phys_vmembase[FB_MAX] = { 0, };
334static unsigned long phys_size[FB_MAX] __devinitdata = { 0, }; 334static unsigned long phys_size[FB_MAX] = { 0, };
335static unsigned long phys_guiregbase[FB_MAX] __devinitdata = { 0, }; 335static unsigned long phys_guiregbase[FB_MAX] = { 0, };
336#endif 336#endif
337 337
338/* top -> down is an evolution of mach64 chipset, any corrections? */ 338/* top -> down is an evolution of mach64 chipset, any corrections? */
@@ -371,7 +371,7 @@ static struct {
371 const char *name; 371 const char *name;
372 int pll, mclk, xclk, ecp_max; 372 int pll, mclk, xclk, ecp_max;
373 u32 features; 373 u32 features;
374} aty_chips[] __devinitdata = { 374} aty_chips[] = {
375#ifdef CONFIG_FB_ATY_GX 375#ifdef CONFIG_FB_ATY_GX
376 /* Mach64 GX */ 376 /* Mach64 GX */
377 { PCI_CHIP_MACH64GX, "ATI888GX00 (Mach64 GX)", 135, 50, 50, 0, ATI_CHIP_88800GX }, 377 { PCI_CHIP_MACH64GX, "ATI888GX00 (Mach64 GX)", 135, 50, 50, 0, ATI_CHIP_88800GX },
@@ -426,7 +426,7 @@ static struct {
426#endif /* CONFIG_FB_ATY_CT */ 426#endif /* CONFIG_FB_ATY_CT */
427}; 427};
428 428
429static int __devinit correct_chipset(struct atyfb_par *par) 429static int correct_chipset(struct atyfb_par *par)
430{ 430{
431 u8 rev; 431 u8 rev;
432 u16 type; 432 u16 type;
@@ -531,34 +531,34 @@ static int __devinit correct_chipset(struct atyfb_par *par)
531 return 0; 531 return 0;
532} 532}
533 533
534static char ram_dram[] __devinitdata = "DRAM"; 534static char ram_dram[] = "DRAM";
535static char ram_resv[] __devinitdata = "RESV"; 535static char ram_resv[] = "RESV";
536#ifdef CONFIG_FB_ATY_GX 536#ifdef CONFIG_FB_ATY_GX
537static char ram_vram[] __devinitdata = "VRAM"; 537static char ram_vram[] = "VRAM";
538#endif /* CONFIG_FB_ATY_GX */ 538#endif /* CONFIG_FB_ATY_GX */
539#ifdef CONFIG_FB_ATY_CT 539#ifdef CONFIG_FB_ATY_CT
540static char ram_edo[] __devinitdata = "EDO"; 540static char ram_edo[] = "EDO";
541static char ram_sdram[] __devinitdata = "SDRAM (1:1)"; 541static char ram_sdram[] = "SDRAM (1:1)";
542static char ram_sgram[] __devinitdata = "SGRAM (1:1)"; 542static char ram_sgram[] = "SGRAM (1:1)";
543static char ram_sdram32[] __devinitdata = "SDRAM (2:1) (32-bit)"; 543static char ram_sdram32[] = "SDRAM (2:1) (32-bit)";
544static char ram_wram[] __devinitdata = "WRAM"; 544static char ram_wram[] = "WRAM";
545static char ram_off[] __devinitdata = "OFF"; 545static char ram_off[] = "OFF";
546#endif /* CONFIG_FB_ATY_CT */ 546#endif /* CONFIG_FB_ATY_CT */
547 547
548 548
549#ifdef CONFIG_FB_ATY_GX 549#ifdef CONFIG_FB_ATY_GX
550static char *aty_gx_ram[8] __devinitdata = { 550static char *aty_gx_ram[8] = {
551 ram_dram, ram_vram, ram_vram, ram_dram, 551 ram_dram, ram_vram, ram_vram, ram_dram,
552 ram_dram, ram_vram, ram_vram, ram_resv 552 ram_dram, ram_vram, ram_vram, ram_resv
553}; 553};
554#endif /* CONFIG_FB_ATY_GX */ 554#endif /* CONFIG_FB_ATY_GX */
555 555
556#ifdef CONFIG_FB_ATY_CT 556#ifdef CONFIG_FB_ATY_CT
557static char *aty_ct_ram[8] __devinitdata = { 557static char *aty_ct_ram[8] = {
558 ram_off, ram_dram, ram_edo, ram_edo, 558 ram_off, ram_dram, ram_edo, ram_edo,
559 ram_sdram, ram_sgram, ram_wram, ram_resv 559 ram_sdram, ram_sgram, ram_wram, ram_resv
560}; 560};
561static char *aty_xl_ram[8] __devinitdata = { 561static char *aty_xl_ram[8] = {
562 ram_off, ram_dram, ram_edo, ram_edo, 562 ram_off, ram_dram, ram_edo, ram_edo,
563 ram_sdram, ram_sgram, ram_sdram32, ram_resv 563 ram_sdram, ram_sgram, ram_sdram32, ram_resv
564}; 564};
@@ -588,7 +588,7 @@ static u32 atyfb_get_pixclock(struct fb_var_screeninfo *var,
588 * Apple monitor sense 588 * Apple monitor sense
589 */ 589 */
590 590
591static int __devinit read_aty_sense(const struct atyfb_par *par) 591static int read_aty_sense(const struct atyfb_par *par)
592{ 592{
593 int sense, i; 593 int sense, i;
594 594
@@ -2273,7 +2273,7 @@ static void aty_bl_exit(struct backlight_device *bd)
2273 2273
2274#endif /* CONFIG_FB_ATY_BACKLIGHT */ 2274#endif /* CONFIG_FB_ATY_BACKLIGHT */
2275 2275
2276static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk) 2276static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2277{ 2277{
2278 const int ragepro_tbl[] = { 2278 const int ragepro_tbl[] = {
2279 44, 50, 55, 66, 75, 80, 100 2279 44, 50, 55, 66, 75, 80, 100
@@ -2307,8 +2307,8 @@ static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2307static struct fb_info *fb_list = NULL; 2307static struct fb_info *fb_list = NULL;
2308 2308
2309#if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) 2309#if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD)
2310static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par, 2310static int atyfb_get_timings_from_lcd(struct atyfb_par *par,
2311 struct fb_var_screeninfo *var) 2311 struct fb_var_screeninfo *var)
2312{ 2312{
2313 int ret = -EINVAL; 2313 int ret = -EINVAL;
2314 2314
@@ -2333,7 +2333,7 @@ static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
2333} 2333}
2334#endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */ 2334#endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */
2335 2335
2336static int __devinit aty_init(struct fb_info *info) 2336static int aty_init(struct fb_info *info)
2337{ 2337{
2338 struct atyfb_par *par = (struct atyfb_par *) info->par; 2338 struct atyfb_par *par = (struct atyfb_par *) info->par;
2339 const char *ramname = NULL, *xtal; 2339 const char *ramname = NULL, *xtal;
@@ -2787,7 +2787,7 @@ aty_init_exit:
2787} 2787}
2788 2788
2789#if defined(CONFIG_ATARI) && !defined(MODULE) 2789#if defined(CONFIG_ATARI) && !defined(MODULE)
2790static int __devinit store_video_par(char *video_str, unsigned char m64_num) 2790static int store_video_par(char *video_str, unsigned char m64_num)
2791{ 2791{
2792 char *p; 2792 char *p;
2793 unsigned long vmembase, size, guiregbase; 2793 unsigned long vmembase, size, guiregbase;
@@ -2961,9 +2961,8 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
2961 2961
2962#ifdef __sparc__ 2962#ifdef __sparc__
2963 2963
2964static int __devinit atyfb_setup_sparc(struct pci_dev *pdev, 2964static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
2965 struct fb_info *info, 2965 unsigned long addr)
2966 unsigned long addr)
2967{ 2966{
2968 struct atyfb_par *par = info->par; 2967 struct atyfb_par *par = info->par;
2969 struct device_node *dp; 2968 struct device_node *dp;
@@ -3161,7 +3160,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
3161 3160
3162#ifdef __i386__ 3161#ifdef __i386__
3163#ifdef CONFIG_FB_ATY_GENERIC_LCD 3162#ifdef CONFIG_FB_ATY_GENERIC_LCD
3164static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base) 3163static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
3165{ 3164{
3166 u32 driv_inf_tab, sig; 3165 u32 driv_inf_tab, sig;
3167 u16 lcd_ofs; 3166 u16 lcd_ofs;
@@ -3392,7 +3391,7 @@ static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
3392} 3391}
3393#endif /* CONFIG_FB_ATY_GENERIC_LCD */ 3392#endif /* CONFIG_FB_ATY_GENERIC_LCD */
3394 3393
3395static int __devinit init_from_bios(struct atyfb_par *par) 3394static int init_from_bios(struct atyfb_par *par)
3396{ 3395{
3397 u32 bios_base, rom_addr; 3396 u32 bios_base, rom_addr;
3398 int ret; 3397 int ret;
@@ -3445,9 +3444,8 @@ static int __devinit init_from_bios(struct atyfb_par *par)
3445} 3444}
3446#endif /* __i386__ */ 3445#endif /* __i386__ */
3447 3446
3448static int __devinit atyfb_setup_generic(struct pci_dev *pdev, 3447static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
3449 struct fb_info *info, 3448 unsigned long addr)
3450 unsigned long addr)
3451{ 3449{
3452 struct atyfb_par *par = info->par; 3450 struct atyfb_par *par = info->par;
3453 u16 tmp; 3451 u16 tmp;
@@ -3525,8 +3523,8 @@ atyfb_setup_generic_fail:
3525 3523
3526#endif /* !__sparc__ */ 3524#endif /* !__sparc__ */
3527 3525
3528static int __devinit atyfb_pci_probe(struct pci_dev *pdev, 3526static int atyfb_pci_probe(struct pci_dev *pdev,
3529 const struct pci_device_id *ent) 3527 const struct pci_device_id *ent)
3530{ 3528{
3531 unsigned long addr, res_start, res_size; 3529 unsigned long addr, res_start, res_size;
3532 struct fb_info *info; 3530 struct fb_info *info;
@@ -3714,7 +3712,7 @@ static int __init atyfb_atari_probe(void)
3714 3712
3715#ifdef CONFIG_PCI 3713#ifdef CONFIG_PCI
3716 3714
3717static void __devexit atyfb_remove(struct fb_info *info) 3715static void atyfb_remove(struct fb_info *info)
3718{ 3716{
3719 struct atyfb_par *par = (struct atyfb_par *) info->par; 3717 struct atyfb_par *par = (struct atyfb_par *) info->par;
3720 3718
@@ -3762,7 +3760,7 @@ static void __devexit atyfb_remove(struct fb_info *info)
3762} 3760}
3763 3761
3764 3762
3765static void __devexit atyfb_pci_remove(struct pci_dev *pdev) 3763static void atyfb_pci_remove(struct pci_dev *pdev)
3766{ 3764{
3767 struct fb_info *info = pci_get_drvdata(pdev); 3765 struct fb_info *info = pci_get_drvdata(pdev);
3768 3766
@@ -3834,7 +3832,7 @@ static struct pci_driver atyfb_driver = {
3834 .name = "atyfb", 3832 .name = "atyfb",
3835 .id_table = atyfb_pci_tbl, 3833 .id_table = atyfb_pci_tbl,
3836 .probe = atyfb_pci_probe, 3834 .probe = atyfb_pci_probe,
3837 .remove = __devexit_p(atyfb_pci_remove), 3835 .remove = atyfb_pci_remove,
3838#ifdef CONFIG_PM 3836#ifdef CONFIG_PM
3839 .suspend = atyfb_pci_suspend, 3837 .suspend = atyfb_pci_suspend,
3840 .resume = atyfb_pci_resume, 3838 .resume = atyfb_pci_resume,
diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c
index 2745b853948..51f29d627ce 100644
--- a/drivers/video/aty/mach64_ct.c
+++ b/drivers/video/aty/mach64_ct.c
@@ -373,8 +373,7 @@ void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
373#endif 373#endif
374} 374}
375 375
376static void __devinit aty_get_pll_ct(const struct fb_info *info, 376static void aty_get_pll_ct(const struct fb_info *info, union aty_pll *pll)
377 union aty_pll *pll)
378{ 377{
379 struct atyfb_par *par = (struct atyfb_par *) info->par; 378 struct atyfb_par *par = (struct atyfb_par *) info->par;
380 u8 tmp, clock; 379 u8 tmp, clock;
@@ -397,8 +396,7 @@ static void __devinit aty_get_pll_ct(const struct fb_info *info,
397 } 396 }
398} 397}
399 398
400static int __devinit aty_init_pll_ct(const struct fb_info *info, 399static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
401 union aty_pll *pll)
402{ 400{
403 struct atyfb_par *par = (struct atyfb_par *) info->par; 401 struct atyfb_par *par = (struct atyfb_par *) info->par;
404 u8 mpost_div, xpost_div, sclk_post_div_real; 402 u8 mpost_div, xpost_div, sclk_post_div_real;
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index 46f72ed5351..95ec042ddbf 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -183,7 +183,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
183 return 0; 183 return 0;
184} 184}
185 185
186int __devinit aty_init_cursor(struct fb_info *info) 186int aty_init_cursor(struct fb_info *info)
187{ 187{
188 unsigned long addr; 188 unsigned long addr;
189 189
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 9e279ee38da..1e30b2b3e79 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -293,7 +293,7 @@ static void radeon_unmap_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
293 pci_unmap_rom(dev, rinfo->bios_seg); 293 pci_unmap_rom(dev, rinfo->bios_seg);
294} 294}
295 295
296static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev) 296static int radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
297{ 297{
298 void __iomem *rom; 298 void __iomem *rom;
299 u16 dptr; 299 u16 dptr;
@@ -388,7 +388,7 @@ static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev
388} 388}
389 389
390#ifdef CONFIG_X86 390#ifdef CONFIG_X86
391static int __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo) 391static int radeon_find_mem_vbios(struct radeonfb_info *rinfo)
392{ 392{
393 /* I simplified this code as we used to miss the signatures in 393 /* I simplified this code as we used to miss the signatures in
394 * a lot of case. It's now closer to XFree, we just don't check 394 * a lot of case. It's now closer to XFree, we just don't check
@@ -423,7 +423,7 @@ static int __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
423 * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device 423 * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
424 * tree. Hopefully, ATI OF driver is kind enough to fill these 424 * tree. Hopefully, ATI OF driver is kind enough to fill these
425 */ 425 */
426static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo) 426static int radeon_read_xtal_OF(struct radeonfb_info *rinfo)
427{ 427{
428 struct device_node *dp = rinfo->of_node; 428 struct device_node *dp = rinfo->of_node;
429 const u32 *val; 429 const u32 *val;
@@ -453,7 +453,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
453/* 453/*
454 * Read PLL infos from chip registers 454 * Read PLL infos from chip registers
455 */ 455 */
456static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo) 456static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
457{ 457{
458 unsigned char ppll_div_sel; 458 unsigned char ppll_div_sel;
459 unsigned Ns, Nm, M; 459 unsigned Ns, Nm, M;
@@ -591,7 +591,7 @@ static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
591/* 591/*
592 * Retrieve PLL infos by different means (BIOS, Open Firmware, register probing...) 592 * Retrieve PLL infos by different means (BIOS, Open Firmware, register probing...)
593 */ 593 */
594static void __devinit radeon_get_pllinfo(struct radeonfb_info *rinfo) 594static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
595{ 595{
596 /* 596 /*
597 * In the case nothing works, these are defaults; they are mostly 597 * In the case nothing works, these are defaults; they are mostly
@@ -1868,7 +1868,7 @@ static struct fb_ops radeonfb_ops = {
1868}; 1868};
1869 1869
1870 1870
1871static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo) 1871static int radeon_set_fbinfo(struct radeonfb_info *rinfo)
1872{ 1872{
1873 struct fb_info *info = rinfo->info; 1873 struct fb_info *info = rinfo->info;
1874 1874
@@ -2143,8 +2143,8 @@ static struct bin_attribute edid2_attr = {
2143}; 2143};
2144 2144
2145 2145
2146static int __devinit radeonfb_pci_register (struct pci_dev *pdev, 2146static int radeonfb_pci_register(struct pci_dev *pdev,
2147 const struct pci_device_id *ent) 2147 const struct pci_device_id *ent)
2148{ 2148{
2149 struct fb_info *info; 2149 struct fb_info *info;
2150 struct radeonfb_info *rinfo; 2150 struct radeonfb_info *rinfo;
@@ -2407,7 +2407,7 @@ err_out:
2407 2407
2408 2408
2409 2409
2410static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev) 2410static void radeonfb_pci_unregister(struct pci_dev *pdev)
2411{ 2411{
2412 struct fb_info *info = pci_get_drvdata(pdev); 2412 struct fb_info *info = pci_get_drvdata(pdev);
2413 struct radeonfb_info *rinfo = info->par; 2413 struct radeonfb_info *rinfo = info->par;
@@ -2465,7 +2465,7 @@ static struct pci_driver radeonfb_driver = {
2465 .name = "radeonfb", 2465 .name = "radeonfb",
2466 .id_table = radeonfb_pci_table, 2466 .id_table = radeonfb_pci_table,
2467 .probe = radeonfb_pci_register, 2467 .probe = radeonfb_pci_register,
2468 .remove = __devexit_p(radeonfb_pci_unregister), 2468 .remove = radeonfb_pci_unregister,
2469#ifdef CONFIG_PM 2469#ifdef CONFIG_PM
2470 .suspend = radeonfb_pci_suspend, 2470 .suspend = radeonfb_pci_suspend,
2471 .resume = radeonfb_pci_resume, 2471 .resume = radeonfb_pci_resume,
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 5c23eac0eb9..bc078d50d8f 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -62,8 +62,8 @@ static char *radeon_get_mon_name(int type)
62 * models with broken OF probing by hard-coding known EDIDs for some Mac 62 * models with broken OF probing by hard-coding known EDIDs for some Mac
63 * laptops internal LVDS panel. (XXX: not done yet) 63 * laptops internal LVDS panel. (XXX: not done yet)
64 */ 64 */
65static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID, 65static int radeon_parse_montype_prop(struct device_node *dp, u8 **out_EDID,
66 int hdno) 66 int hdno)
67{ 67{
68 static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID", 68 static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
69 "EDID1", "EDID2", NULL }; 69 "EDID1", "EDID2", NULL };
@@ -115,8 +115,8 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
115 return mt; 115 return mt;
116} 116}
117 117
118static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no, 118static int radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
119 u8 **out_EDID) 119 u8 **out_EDID)
120{ 120{
121 struct device_node *dp; 121 struct device_node *dp;
122 122
@@ -163,7 +163,7 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
163#endif /* CONFIG_PPC_OF || CONFIG_SPARC */ 163#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
164 164
165 165
166static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo) 166static int radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
167{ 167{
168 unsigned long tmp, tmp0; 168 unsigned long tmp, tmp0;
169 char stmp[30]; 169 char stmp[30];
@@ -251,7 +251,7 @@ static int __devinit radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
251 * doesn't quite work yet, but it's output is still useful for 251 * doesn't quite work yet, but it's output is still useful for
252 * debugging 252 * debugging
253 */ 253 */
254static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo) 254static void radeon_parse_connector_info(struct radeonfb_info *rinfo)
255{ 255{
256 int offset, chips, connectors, tmp, i, conn, type; 256 int offset, chips, connectors, tmp, i, conn, type;
257 257
@@ -297,7 +297,7 @@ static void __devinit radeon_parse_connector_info(struct radeonfb_info *rinfo)
297 * as well and currently is only implemented for the CRT DAC, the 297 * as well and currently is only implemented for the CRT DAC, the
298 * code for the TVDAC is commented out in XFree as "non working" 298 * code for the TVDAC is commented out in XFree as "non working"
299 */ 299 */
300static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac) 300static int radeon_crt_is_connected(struct radeonfb_info *rinfo, int is_crt_dac)
301{ 301{
302 int connected = 0; 302 int connected = 0;
303 303
@@ -369,8 +369,8 @@ static int __devinit radeon_crt_is_connected(struct radeonfb_info *rinfo, int is
369 * Parse the "monitor_layout" string if any. This code is mostly 369 * Parse the "monitor_layout" string if any. This code is mostly
370 * copied from XFree's radeon driver 370 * copied from XFree's radeon driver
371 */ 371 */
372static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, 372static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
373 const char *monitor_layout) 373 const char *monitor_layout)
374{ 374{
375 char s1[5], s2[5]; 375 char s1[5], s2[5];
376 int i = 0, second = 0; 376 int i = 0, second = 0;
@@ -433,8 +433,8 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
433 * try to retrieve EDID. The algorithm here comes from XFree's radeon 433 * try to retrieve EDID. The algorithm here comes from XFree's radeon
434 * driver 434 * driver
435 */ 435 */
436void __devinit radeon_probe_screens(struct radeonfb_info *rinfo, 436void radeon_probe_screens(struct radeonfb_info *rinfo,
437 const char *monitor_layout, int ignore_edid) 437 const char *monitor_layout, int ignore_edid)
438{ 438{
439#ifdef CONFIG_FB_RADEON_I2C 439#ifdef CONFIG_FB_RADEON_I2C
440 int ddc_crt2_used = 0; 440 int ddc_crt2_used = 0;
@@ -753,7 +753,7 @@ static int is_powerblade(const char *model)
753 * Build the modedb for head 1 (head 2 will come later), check panel infos 753 * Build the modedb for head 1 (head 2 will come later), check panel infos
754 * from either BIOS or EDID, and pick up the default mode 754 * from either BIOS or EDID, and pick up the default mode
755 */ 755 */
756void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option) 756void radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
757{ 757{
758 struct fb_info * info = rinfo->info; 758 struct fb_info * info = rinfo->info;
759 int has_default_mode = 0; 759 int has_default_mode = 0;
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index fe3b6ec8712..ddabaa867b0 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -83,7 +83,7 @@ struct fb_bitfield rgb_bitfields[][4] =
83 { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, 83 { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
84}; 84};
85 85
86static struct fb_fix_screeninfo au1100fb_fix __devinitdata = { 86static struct fb_fix_screeninfo au1100fb_fix = {
87 .id = "AU1100 FB", 87 .id = "AU1100 FB",
88 .xpanstep = 1, 88 .xpanstep = 1,
89 .ypanstep = 1, 89 .ypanstep = 1,
@@ -91,7 +91,7 @@ static struct fb_fix_screeninfo au1100fb_fix __devinitdata = {
91 .accel = FB_ACCEL_NONE, 91 .accel = FB_ACCEL_NONE,
92}; 92};
93 93
94static struct fb_var_screeninfo au1100fb_var __devinitdata = { 94static struct fb_var_screeninfo au1100fb_var = {
95 .activate = FB_ACTIVATE_NOW, 95 .activate = FB_ACTIVATE_NOW,
96 .height = -1, 96 .height = -1,
97 .width = -1, 97 .width = -1,
@@ -469,7 +469,7 @@ static int au1100fb_setup(struct au1100fb_device *fbdev)
469 return 0; 469 return 0;
470} 470}
471 471
472static int __devinit au1100fb_drv_probe(struct platform_device *dev) 472static int au1100fb_drv_probe(struct platform_device *dev)
473{ 473{
474 struct au1100fb_device *fbdev = NULL; 474 struct au1100fb_device *fbdev = NULL;
475 struct resource *regs_res; 475 struct resource *regs_res;
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index 7ca79f02056..1b59054fc6a 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1673,7 +1673,7 @@ out:
1673} 1673}
1674 1674
1675/* AU1200 LCD controller device driver */ 1675/* AU1200 LCD controller device driver */
1676static int __devinit au1200fb_drv_probe(struct platform_device *dev) 1676static int au1200fb_drv_probe(struct platform_device *dev)
1677{ 1677{
1678 struct au1200fb_device *fbdev; 1678 struct au1200fb_device *fbdev;
1679 struct au1200fb_platdata *pd; 1679 struct au1200fb_platdata *pd;
@@ -1798,7 +1798,7 @@ failed:
1798 return ret; 1798 return ret;
1799} 1799}
1800 1800
1801static int __devexit au1200fb_drv_remove(struct platform_device *dev) 1801static int au1200fb_drv_remove(struct platform_device *dev)
1802{ 1802{
1803 struct au1200fb_platdata *pd = platform_get_drvdata(dev); 1803 struct au1200fb_platdata *pd = platform_get_drvdata(dev);
1804 struct au1200fb_device *fbdev; 1804 struct au1200fb_device *fbdev;
@@ -1876,7 +1876,7 @@ static struct platform_driver au1200fb_driver = {
1876 .pm = AU1200FB_PMOPS, 1876 .pm = AU1200FB_PMOPS,
1877 }, 1877 },
1878 .probe = au1200fb_drv_probe, 1878 .probe = au1200fb_drv_probe,
1879 .remove = __devexit_p(au1200fb_drv_remove), 1879 .remove = au1200fb_drv_remove,
1880}; 1880};
1881 1881
1882/*-------------------------------------------------------------------------*/ 1882/*-------------------------------------------------------------------------*/
diff --git a/drivers/video/auo_k1900fb.c b/drivers/video/auo_k1900fb.c
index c36cf961dcb..1a9ac6e1f4b 100644
--- a/drivers/video/auo_k1900fb.c
+++ b/drivers/video/auo_k1900fb.c
@@ -156,7 +156,7 @@ static bool auok1900fb_need_refresh(struct auok190xfb_par *par)
156 return (par->update_cnt > 10); 156 return (par->update_cnt > 10);
157} 157}
158 158
159static int __devinit auok1900fb_probe(struct platform_device *pdev) 159static int auok1900fb_probe(struct platform_device *pdev)
160{ 160{
161 struct auok190x_init_data init; 161 struct auok190x_init_data init;
162 struct auok190x_board *board; 162 struct auok190x_board *board;
@@ -177,14 +177,14 @@ static int __devinit auok1900fb_probe(struct platform_device *pdev)
177 return auok190x_common_probe(pdev, &init); 177 return auok190x_common_probe(pdev, &init);
178} 178}
179 179
180static int __devexit auok1900fb_remove(struct platform_device *pdev) 180static int auok1900fb_remove(struct platform_device *pdev)
181{ 181{
182 return auok190x_common_remove(pdev); 182 return auok190x_common_remove(pdev);
183} 183}
184 184
185static struct platform_driver auok1900fb_driver = { 185static struct platform_driver auok1900fb_driver = {
186 .probe = auok1900fb_probe, 186 .probe = auok1900fb_probe,
187 .remove = __devexit_p(auok1900fb_remove), 187 .remove = auok1900fb_remove,
188 .driver = { 188 .driver = {
189 .owner = THIS_MODULE, 189 .owner = THIS_MODULE,
190 .name = "auo_k1900fb", 190 .name = "auo_k1900fb",
diff --git a/drivers/video/auo_k1901fb.c b/drivers/video/auo_k1901fb.c
index 1c054c18616..d1db1653cd8 100644
--- a/drivers/video/auo_k1901fb.c
+++ b/drivers/video/auo_k1901fb.c
@@ -209,7 +209,7 @@ static bool auok1901fb_need_refresh(struct auok190xfb_par *par)
209 return (par->update_cnt > 10); 209 return (par->update_cnt > 10);
210} 210}
211 211
212static int __devinit auok1901fb_probe(struct platform_device *pdev) 212static int auok1901fb_probe(struct platform_device *pdev)
213{ 213{
214 struct auok190x_init_data init; 214 struct auok190x_init_data init;
215 struct auok190x_board *board; 215 struct auok190x_board *board;
@@ -230,14 +230,14 @@ static int __devinit auok1901fb_probe(struct platform_device *pdev)
230 return auok190x_common_probe(pdev, &init); 230 return auok190x_common_probe(pdev, &init);
231} 231}
232 232
233static int __devexit auok1901fb_remove(struct platform_device *pdev) 233static int auok1901fb_remove(struct platform_device *pdev)
234{ 234{
235 return auok190x_common_remove(pdev); 235 return auok190x_common_remove(pdev);
236} 236}
237 237
238static struct platform_driver auok1901fb_driver = { 238static struct platform_driver auok1901fb_driver = {
239 .probe = auok1901fb_probe, 239 .probe = auok1901fb_probe,
240 .remove = __devexit_p(auok1901fb_remove), 240 .remove = auok1901fb_remove,
241 .driver = { 241 .driver = {
242 .owner = THIS_MODULE, 242 .owner = THIS_MODULE,
243 .name = "auo_k1901fb", 243 .name = "auo_k1901fb",
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index c03ecdd31e4..97f79356141 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -773,8 +773,8 @@ EXPORT_SYMBOL_GPL(auok190x_pm);
773 * Common probe and remove code 773 * Common probe and remove code
774 */ 774 */
775 775
776int __devinit auok190x_common_probe(struct platform_device *pdev, 776int auok190x_common_probe(struct platform_device *pdev,
777 struct auok190x_init_data *init) 777 struct auok190x_init_data *init)
778{ 778{
779 struct auok190x_board *board = init->board; 779 struct auok190x_board *board = init->board;
780 struct auok190xfb_par *par; 780 struct auok190xfb_par *par;
@@ -1006,7 +1006,7 @@ err_reg:
1006} 1006}
1007EXPORT_SYMBOL_GPL(auok190x_common_probe); 1007EXPORT_SYMBOL_GPL(auok190x_common_probe);
1008 1008
1009int __devexit auok190x_common_remove(struct platform_device *pdev) 1009int auok190x_common_remove(struct platform_device *pdev)
1010{ 1010{
1011 struct fb_info *info = platform_get_drvdata(pdev); 1011 struct fb_info *info = platform_get_drvdata(pdev);
1012 struct auok190xfb_par *par = info->par; 1012 struct auok190xfb_par *par = info->par;
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
index 7347aa1e5e4..a82d2578d97 100644
--- a/drivers/video/bf537-lq035.c
+++ b/drivers/video/bf537-lq035.c
@@ -87,8 +87,8 @@ static void set_vcomm(void)
87 pr_err("i2c_smbus_write_byte_data fail: %d\n", nr); 87 pr_err("i2c_smbus_write_byte_data fail: %d\n", nr);
88} 88}
89 89
90static int __devinit ad5280_probe(struct i2c_client *client, 90static int ad5280_probe(struct i2c_client *client,
91 const struct i2c_device_id *id) 91 const struct i2c_device_id *id)
92{ 92{
93 int ret; 93 int ret;
94 if (!i2c_check_functionality(client->adapter, 94 if (!i2c_check_functionality(client->adapter,
@@ -108,7 +108,7 @@ static int __devinit ad5280_probe(struct i2c_client *client,
108 return 0; 108 return 0;
109} 109}
110 110
111static int __devexit ad5280_remove(struct i2c_client *client) 111static int ad5280_remove(struct i2c_client *client)
112{ 112{
113 ad5280_client = NULL; 113 ad5280_client = NULL;
114 return 0; 114 return 0;
@@ -126,7 +126,7 @@ static struct i2c_driver ad5280_driver = {
126 .name = "bf537-lq035-ad5280", 126 .name = "bf537-lq035-ad5280",
127 }, 127 },
128 .probe = ad5280_probe, 128 .probe = ad5280_probe,
129 .remove = __devexit_p(ad5280_remove), 129 .remove = ad5280_remove,
130 .id_table = ad5280_id, 130 .id_table = ad5280_id,
131}; 131};
132 132
@@ -360,7 +360,7 @@ static int config_dma(void)
360 return 0; 360 return 0;
361} 361}
362 362
363static int __devinit request_ports(void) 363static int request_ports(void)
364{ 364{
365 u16 tmr_req[] = TIMERS; 365 u16 tmr_req[] = TIMERS;
366 366
@@ -443,7 +443,7 @@ static struct fb_var_screeninfo bfin_lq035_fb_defined = {
443 .transp = {0, 0, 0}, 443 .transp = {0, 0, 0},
444}; 444};
445 445
446static struct fb_fix_screeninfo bfin_lq035_fb_fix __devinitdata = { 446static struct fb_fix_screeninfo bfin_lq035_fb_fix = {
447 .id = KBUILD_MODNAME, 447 .id = KBUILD_MODNAME,
448 .smem_len = ACTIVE_VIDEO_MEM_SIZE, 448 .smem_len = ACTIVE_VIDEO_MEM_SIZE,
449 .type = FB_TYPE_PACKED_PIXELS, 449 .type = FB_TYPE_PACKED_PIXELS,
@@ -686,7 +686,7 @@ static struct lcd_ops bfin_lcd_ops = {
686 686
687static struct lcd_device *lcd_dev; 687static struct lcd_device *lcd_dev;
688 688
689static int __devinit bfin_lq035_probe(struct platform_device *pdev) 689static int bfin_lq035_probe(struct platform_device *pdev)
690{ 690{
691 struct backlight_properties props; 691 struct backlight_properties props;
692 dma_addr_t dma_handle; 692 dma_addr_t dma_handle;
@@ -816,7 +816,7 @@ out_ports:
816 return ret; 816 return ret;
817} 817}
818 818
819static int __devexit bfin_lq035_remove(struct platform_device *pdev) 819static int bfin_lq035_remove(struct platform_device *pdev)
820{ 820{
821 if (fb_buffer != NULL) 821 if (fb_buffer != NULL)
822 dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); 822 dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
@@ -889,7 +889,7 @@ static int bfin_lq035_resume(struct platform_device *pdev)
889 889
890static struct platform_driver bfin_lq035_driver = { 890static struct platform_driver bfin_lq035_driver = {
891 .probe = bfin_lq035_probe, 891 .probe = bfin_lq035_probe,
892 .remove = __devexit_p(bfin_lq035_remove), 892 .remove = bfin_lq035_remove,
893 .suspend = bfin_lq035_suspend, 893 .suspend = bfin_lq035_suspend,
894 .resume = bfin_lq035_resume, 894 .resume = bfin_lq035_resume,
895 .driver = { 895 .driver = {
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index ff5663f5c64..2726a5b6674 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -497,7 +497,7 @@ static irqreturn_t bfin_bf54x_irq_error(int irq, void *dev_id)
497 return IRQ_HANDLED; 497 return IRQ_HANDLED;
498} 498}
499 499
500static int __devinit bfin_bf54x_probe(struct platform_device *pdev) 500static int bfin_bf54x_probe(struct platform_device *pdev)
501{ 501{
502#ifndef NO_BL_SUPPORT 502#ifndef NO_BL_SUPPORT
503 struct backlight_properties props; 503 struct backlight_properties props;
@@ -686,7 +686,7 @@ out1:
686 return ret; 686 return ret;
687} 687}
688 688
689static int __devexit bfin_bf54x_remove(struct platform_device *pdev) 689static int bfin_bf54x_remove(struct platform_device *pdev)
690{ 690{
691 691
692 struct fb_info *fbinfo = platform_get_drvdata(pdev); 692 struct fb_info *fbinfo = platform_get_drvdata(pdev);
@@ -754,7 +754,7 @@ static int bfin_bf54x_resume(struct platform_device *pdev)
754 754
755static struct platform_driver bfin_bf54x_driver = { 755static struct platform_driver bfin_bf54x_driver = {
756 .probe = bfin_bf54x_probe, 756 .probe = bfin_bf54x_probe,
757 .remove = __devexit_p(bfin_bf54x_remove), 757 .remove = bfin_bf54x_remove,
758 .suspend = bfin_bf54x_suspend, 758 .suspend = bfin_bf54x_suspend,
759 .resume = bfin_bf54x_resume, 759 .resume = bfin_bf54x_resume,
760 .driver = { 760 .driver = {
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index 6fbc75c2f0a..29d8c0443a1 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -137,7 +137,7 @@ static int lq035q1_control(struct spi_device *spi, unsigned char reg, unsigned s
137 return ret; 137 return ret;
138} 138}
139 139
140static int __devinit lq035q1_spidev_probe(struct spi_device *spi) 140static int lq035q1_spidev_probe(struct spi_device *spi)
141{ 141{
142 int ret; 142 int ret;
143 struct spi_control *ctl; 143 struct spi_control *ctl;
@@ -358,8 +358,8 @@ static inline void bfin_lq035q1_free_ports(unsigned ppi16)
358 gpio_free(P_IDENT(P_PPI0_FS3)); 358 gpio_free(P_IDENT(P_PPI0_FS3));
359} 359}
360 360
361static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev, 361static int bfin_lq035q1_request_ports(struct platform_device *pdev,
362 unsigned ppi16) 362 unsigned ppi16)
363{ 363{
364 int ret; 364 int ret;
365 /* ANOMALY_05000400 - PPI Does Not Start Properly In Specific Mode: 365 /* ANOMALY_05000400 - PPI Does Not Start Properly In Specific Mode:
@@ -555,7 +555,7 @@ static irqreturn_t bfin_lq035q1_irq_error(int irq, void *dev_id)
555 return IRQ_HANDLED; 555 return IRQ_HANDLED;
556} 556}
557 557
558static int __devinit bfin_lq035q1_probe(struct platform_device *pdev) 558static int bfin_lq035q1_probe(struct platform_device *pdev)
559{ 559{
560 struct bfin_lq035q1fb_info *info; 560 struct bfin_lq035q1fb_info *info;
561 struct fb_info *fbinfo; 561 struct fb_info *fbinfo;
@@ -706,7 +706,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
706 706
707 info->spidrv.driver.name = DRIVER_NAME"-spi"; 707 info->spidrv.driver.name = DRIVER_NAME"-spi";
708 info->spidrv.probe = lq035q1_spidev_probe; 708 info->spidrv.probe = lq035q1_spidev_probe;
709 info->spidrv.remove = __devexit_p(lq035q1_spidev_remove); 709 info->spidrv.remove = lq035q1_spidev_remove;
710 info->spidrv.shutdown = lq035q1_spidev_shutdown; 710 info->spidrv.shutdown = lq035q1_spidev_shutdown;
711 info->spidrv.suspend = lq035q1_spidev_suspend; 711 info->spidrv.suspend = lq035q1_spidev_suspend;
712 info->spidrv.resume = lq035q1_spidev_resume; 712 info->spidrv.resume = lq035q1_spidev_resume;
@@ -764,7 +764,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
764 return ret; 764 return ret;
765} 765}
766 766
767static int __devexit bfin_lq035q1_remove(struct platform_device *pdev) 767static int bfin_lq035q1_remove(struct platform_device *pdev)
768{ 768{
769 struct fb_info *fbinfo = platform_get_drvdata(pdev); 769 struct fb_info *fbinfo = platform_get_drvdata(pdev);
770 struct bfin_lq035q1fb_info *info = fbinfo->par; 770 struct bfin_lq035q1fb_info *info = fbinfo->par;
@@ -845,7 +845,7 @@ static struct dev_pm_ops bfin_lq035q1_dev_pm_ops = {
845 845
846static struct platform_driver bfin_lq035q1_driver = { 846static struct platform_driver bfin_lq035q1_driver = {
847 .probe = bfin_lq035q1_probe, 847 .probe = bfin_lq035q1_probe,
848 .remove = __devexit_p(bfin_lq035q1_remove), 848 .remove = bfin_lq035q1_remove,
849 .driver = { 849 .driver = {
850 .name = DRIVER_NAME, 850 .name = DRIVER_NAME,
851#ifdef CONFIG_PM 851#ifdef CONFIG_PM
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
index ae0fb24b8b4..d46da01c31a 100644
--- a/drivers/video/bfin-t350mcqb-fb.c
+++ b/drivers/video/bfin-t350mcqb-fb.c
@@ -418,7 +418,7 @@ static irqreturn_t bfin_t350mcqb_irq_error(int irq, void *dev_id)
418 return IRQ_HANDLED; 418 return IRQ_HANDLED;
419} 419}
420 420
421static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) 421static int bfin_t350mcqb_probe(struct platform_device *pdev)
422{ 422{
423#ifndef NO_BL_SUPPORT 423#ifndef NO_BL_SUPPORT
424 struct backlight_properties props; 424 struct backlight_properties props;
@@ -583,7 +583,7 @@ out1:
583 return ret; 583 return ret;
584} 584}
585 585
586static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev) 586static int bfin_t350mcqb_remove(struct platform_device *pdev)
587{ 587{
588 588
589 struct fb_info *fbinfo = platform_get_drvdata(pdev); 589 struct fb_info *fbinfo = platform_get_drvdata(pdev);
@@ -658,7 +658,7 @@ static int bfin_t350mcqb_resume(struct platform_device *pdev)
658 658
659static struct platform_driver bfin_t350mcqb_driver = { 659static struct platform_driver bfin_t350mcqb_driver = {
660 .probe = bfin_t350mcqb_probe, 660 .probe = bfin_t350mcqb_probe,
661 .remove = __devexit_p(bfin_t350mcqb_remove), 661 .remove = bfin_t350mcqb_remove,
662 .suspend = bfin_t350mcqb_suspend, 662 .suspend = bfin_t350mcqb_suspend,
663 .resume = bfin_t350mcqb_resume, 663 .resume = bfin_t350mcqb_resume,
664 .driver = { 664 .driver = {
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
index d0f121bd8b2..8d411a3c996 100644
--- a/drivers/video/bfin_adv7393fb.c
+++ b/drivers/video/bfin_adv7393fb.c
@@ -88,7 +88,7 @@ static struct fb_var_screeninfo bfin_adv7393_fb_defined = {
88 .transp = {0, 0, 0}, 88 .transp = {0, 0, 0},
89}; 89};
90 90
91static struct fb_fix_screeninfo bfin_adv7393_fb_fix __devinitdata = { 91static struct fb_fix_screeninfo bfin_adv7393_fb_fix = {
92 .id = "BFIN ADV7393", 92 .id = "BFIN ADV7393",
93 .smem_len = 720 * 480 * 2, 93 .smem_len = 720 * 480 * 2,
94 .type = FB_TYPE_PACKED_PIXELS, 94 .type = FB_TYPE_PACKED_PIXELS,
@@ -368,8 +368,8 @@ adv7393_write_proc(struct file *file, const char __user * buffer,
368 return count; 368 return count;
369} 369}
370 370
371static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client, 371static int bfin_adv7393_fb_probe(struct i2c_client *client,
372 const struct i2c_device_id *id) 372 const struct i2c_device_id *id)
373{ 373{
374 int ret = 0; 374 int ret = 0;
375 struct proc_dir_entry *entry; 375 struct proc_dir_entry *entry;
@@ -719,7 +719,7 @@ static int bfin_adv7393_fb_setcolreg(u_int regno, u_int red, u_int green,
719 return 0; 719 return 0;
720} 720}
721 721
722static int __devexit bfin_adv7393_fb_remove(struct i2c_client *client) 722static int bfin_adv7393_fb_remove(struct i2c_client *client)
723{ 723{
724 struct adv7393fb_device *fbdev = i2c_get_clientdata(client); 724 struct adv7393fb_device *fbdev = i2c_get_clientdata(client);
725 725
@@ -794,7 +794,7 @@ static struct i2c_driver bfin_adv7393_fb_driver = {
794#endif 794#endif
795 }, 795 },
796 .probe = bfin_adv7393_fb_probe, 796 .probe = bfin_adv7393_fb_probe,
797 .remove = __devexit_p(bfin_adv7393_fb_remove), 797 .remove = bfin_adv7393_fb_remove,
798 .id_table = bfin_adv7393_id, 798 .id_table = bfin_adv7393_id,
799}; 799};
800 800
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index c95b417d0d4..b09701c7943 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -91,7 +91,7 @@ static struct panel_info panel_table[] = {
91#define DPY_W 800 91#define DPY_W 800
92#define DPY_H 600 92#define DPY_H 600
93 93
94static struct fb_fix_screeninfo broadsheetfb_fix __devinitdata = { 94static struct fb_fix_screeninfo broadsheetfb_fix = {
95 .id = "broadsheetfb", 95 .id = "broadsheetfb",
96 .type = FB_TYPE_PACKED_PIXELS, 96 .type = FB_TYPE_PACKED_PIXELS,
97 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR, 97 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR,
@@ -102,7 +102,7 @@ static struct fb_fix_screeninfo broadsheetfb_fix __devinitdata = {
102 .accel = FB_ACCEL_NONE, 102 .accel = FB_ACCEL_NONE,
103}; 103};
104 104
105static struct fb_var_screeninfo broadsheetfb_var __devinitdata = { 105static struct fb_var_screeninfo broadsheetfb_var = {
106 .xres = DPY_W, 106 .xres = DPY_W,
107 .yres = DPY_H, 107 .yres = DPY_H,
108 .xres_virtual = DPY_W, 108 .xres_virtual = DPY_W,
@@ -774,7 +774,7 @@ static DEVICE_ATTR(loadstore_waveform, S_IWUSR, NULL,
774 broadsheet_loadstore_waveform); 774 broadsheet_loadstore_waveform);
775 775
776/* upper level functions that manipulate the display and other stuff */ 776/* upper level functions that manipulate the display and other stuff */
777static void __devinit broadsheet_init_display(struct broadsheetfb_par *par) 777static void broadsheet_init_display(struct broadsheetfb_par *par)
778{ 778{
779 u16 args[5]; 779 u16 args[5];
780 int xres = par->info->var.xres; 780 int xres = par->info->var.xres;
@@ -834,7 +834,7 @@ static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
834 par->board->wait_for_rdy(par); 834 par->board->wait_for_rdy(par);
835} 835}
836 836
837static void __devinit broadsheet_identify(struct broadsheetfb_par *par) 837static void broadsheet_identify(struct broadsheetfb_par *par)
838{ 838{
839 u16 rev, prc; 839 u16 rev, prc;
840 struct device *dev = par->info->device; 840 struct device *dev = par->info->device;
@@ -849,7 +849,7 @@ static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
849 dev_warn(dev, "Unrecognized Broadsheet Revision\n"); 849 dev_warn(dev, "Unrecognized Broadsheet Revision\n");
850} 850}
851 851
852static void __devinit broadsheet_init(struct broadsheetfb_par *par) 852static void broadsheet_init(struct broadsheetfb_par *par)
853{ 853{
854 broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN); 854 broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN);
855 /* the controller needs a second */ 855 /* the controller needs a second */
@@ -1058,7 +1058,7 @@ static struct fb_deferred_io broadsheetfb_defio = {
1058 .deferred_io = broadsheetfb_dpy_deferred_io, 1058 .deferred_io = broadsheetfb_dpy_deferred_io,
1059}; 1059};
1060 1060
1061static int __devinit broadsheetfb_probe(struct platform_device *dev) 1061static int broadsheetfb_probe(struct platform_device *dev)
1062{ 1062{
1063 struct fb_info *info; 1063 struct fb_info *info;
1064 struct broadsheet_board *board; 1064 struct broadsheet_board *board;
@@ -1190,7 +1190,7 @@ err:
1190 1190
1191} 1191}
1192 1192
1193static int __devexit broadsheetfb_remove(struct platform_device *dev) 1193static int broadsheetfb_remove(struct platform_device *dev)
1194{ 1194{
1195 struct fb_info *info = platform_get_drvdata(dev); 1195 struct fb_info *info = platform_get_drvdata(dev);
1196 1196
@@ -1211,7 +1211,7 @@ static int __devexit broadsheetfb_remove(struct platform_device *dev)
1211 1211
1212static struct platform_driver broadsheetfb_driver = { 1212static struct platform_driver broadsheetfb_driver = {
1213 .probe = broadsheetfb_probe, 1213 .probe = broadsheetfb_probe,
1214 .remove = __devexit_p(broadsheetfb_remove), 1214 .remove = broadsheetfb_remove,
1215 .driver = { 1215 .driver = {
1216 .owner = THIS_MODULE, 1216 .owner = THIS_MODULE,
1217 .name = "broadsheetfb", 1217 .name = "broadsheetfb",
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 6bea9a93679..60017fc634b 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -179,7 +179,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
179 * Initialisation 179 * Initialisation
180 */ 180 */
181 181
182static void __devinit bw2_init_fix(struct fb_info *info, int linebytes) 182static void bw2_init_fix(struct fb_info *info, int linebytes)
183{ 183{
184 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); 184 strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
185 185
@@ -191,44 +191,43 @@ static void __devinit bw2_init_fix(struct fb_info *info, int linebytes)
191 info->fix.accel = FB_ACCEL_SUN_BWTWO; 191 info->fix.accel = FB_ACCEL_SUN_BWTWO;
192} 192}
193 193
194static u8 bw2regs_1600[] __devinitdata = { 194static u8 bw2regs_1600[] = {
195 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, 195 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
196 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, 196 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
197 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, 197 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01,
198 0x10, 0x21, 0 198 0x10, 0x21, 0
199}; 199};
200 200
201static u8 bw2regs_ecl[] __devinitdata = { 201static u8 bw2regs_ecl[] = {
202 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, 202 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c,
203 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, 203 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23,
204 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, 204 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01,
205 0x10, 0x20, 0 205 0x10, 0x20, 0
206}; 206};
207 207
208static u8 bw2regs_analog[] __devinitdata = { 208static u8 bw2regs_analog[] = {
209 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, 209 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13,
210 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, 210 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22,
211 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 211 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
212 0x10, 0x20, 0 212 0x10, 0x20, 0
213}; 213};
214 214
215static u8 bw2regs_76hz[] __devinitdata = { 215static u8 bw2regs_76hz[] = {
216 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, 216 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
217 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, 217 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
218 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, 218 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
219 0x10, 0x24, 0 219 0x10, 0x24, 0
220}; 220};
221 221
222static u8 bw2regs_66hz[] __devinitdata = { 222static u8 bw2regs_66hz[] = {
223 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, 223 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
224 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, 224 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
225 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 225 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
226 0x10, 0x20, 0 226 0x10, 0x20, 0
227}; 227};
228 228
229static int __devinit bw2_do_default_mode(struct bw2_par *par, 229static int bw2_do_default_mode(struct bw2_par *par, struct fb_info *info,
230 struct fb_info *info, 230 int *linebytes)
231 int *linebytes)
232{ 231{
233 u8 status, mon; 232 u8 status, mon;
234 u8 *p; 233 u8 *p;
@@ -273,7 +272,7 @@ static int __devinit bw2_do_default_mode(struct bw2_par *par,
273 return 0; 272 return 0;
274} 273}
275 274
276static int __devinit bw2_probe(struct platform_device *op) 275static int bw2_probe(struct platform_device *op)
277{ 276{
278 struct device_node *dp = op->dev.of_node; 277 struct device_node *dp = op->dev.of_node;
279 struct fb_info *info; 278 struct fb_info *info;
@@ -352,7 +351,7 @@ out_err:
352 return err; 351 return err;
353} 352}
354 353
355static int __devexit bw2_remove(struct platform_device *op) 354static int bw2_remove(struct platform_device *op)
356{ 355{
357 struct fb_info *info = dev_get_drvdata(&op->dev); 356 struct fb_info *info = dev_get_drvdata(&op->dev);
358 struct bw2_par *par = info->par; 357 struct bw2_par *par = info->par;
@@ -384,7 +383,7 @@ static struct platform_driver bw2_driver = {
384 .of_match_table = bw2_match, 383 .of_match_table = bw2_match,
385 }, 384 },
386 .probe = bw2_probe, 385 .probe = bw2_probe,
387 .remove = __devexit_p(bw2_remove), 386 .remove = bw2_remove,
388}; 387};
389 388
390static int __init bw2_init(void) 389static int __init bw2_init(void)
diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index 2c76fdf23f2..153dd65b0ae 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -78,7 +78,7 @@ struct carmine_fb {
78 u32 pseudo_palette[16]; 78 u32 pseudo_palette[16];
79}; 79};
80 80
81static struct fb_fix_screeninfo carminefb_fix __devinitdata = { 81static struct fb_fix_screeninfo carminefb_fix = {
82 .id = "Carmine", 82 .id = "Carmine",
83 .type = FB_TYPE_PACKED_PIXELS, 83 .type = FB_TYPE_PACKED_PIXELS,
84 .visual = FB_VISUAL_TRUECOLOR, 84 .visual = FB_VISUAL_TRUECOLOR,
@@ -537,8 +537,9 @@ static struct fb_ops carminefb_ops = {
537 .fb_setcolreg = carmine_setcolreg, 537 .fb_setcolreg = carmine_setcolreg,
538}; 538};
539 539
540static int __devinit alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base, 540static int alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
541 int smem_offset, struct device *device, struct fb_info **rinfo) 541 int smem_offset, struct device *device,
542 struct fb_info **rinfo)
542{ 543{
543 int ret; 544 int ret;
544 struct fb_info *info; 545 struct fb_info *info;
@@ -606,8 +607,7 @@ static void cleanup_fb_device(struct fb_info *info)
606 } 607 }
607} 608}
608 609
609static int __devinit carminefb_probe(struct pci_dev *dev, 610static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
610 const struct pci_device_id *ent)
611{ 611{
612 struct carmine_hw *hw; 612 struct carmine_hw *hw;
613 struct device *device = &dev->dev; 613 struct device *device = &dev->dev;
@@ -721,7 +721,7 @@ err_enable_pci:
721 return ret; 721 return ret;
722} 722}
723 723
724static void __devexit carminefb_remove(struct pci_dev *dev) 724static void carminefb_remove(struct pci_dev *dev)
725{ 725{
726 struct carmine_hw *hw = pci_get_drvdata(dev); 726 struct carmine_hw *hw = pci_get_drvdata(dev);
727 struct fb_fix_screeninfo fix; 727 struct fb_fix_screeninfo fix;
@@ -752,7 +752,7 @@ static void __devexit carminefb_remove(struct pci_dev *dev)
752} 752}
753 753
754#define PCI_VENDOR_ID_FUJITU_LIMITED 0x10cf 754#define PCI_VENDOR_ID_FUJITU_LIMITED 0x10cf
755static struct pci_device_id carmine_devices[] __devinitdata = { 755static struct pci_device_id carmine_devices[] = {
756{ 756{
757 PCI_DEVICE(PCI_VENDOR_ID_FUJITU_LIMITED, 0x202b)}, 757 PCI_DEVICE(PCI_VENDOR_ID_FUJITU_LIMITED, 0x202b)},
758 {0, 0, 0, 0, 0, 0, 0} 758 {0, 0, 0, 0, 0, 0, 0}
@@ -764,7 +764,7 @@ static struct pci_driver carmine_pci_driver = {
764 .name = "carminefb", 764 .name = "carminefb",
765 .id_table = carmine_devices, 765 .id_table = carmine_devices,
766 .probe = carminefb_probe, 766 .probe = carminefb_probe,
767 .remove = __devexit_p(carminefb_remove), 767 .remove = carminefb_remove,
768}; 768};
769 769
770static int __init carminefb_init(void) 770static int __init carminefb_init(void)
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index f1889500662..ed3b8891e00 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -352,8 +352,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
352 * Initialisation 352 * Initialisation
353 */ 353 */
354 354
355static void __devinit cg14_init_fix(struct fb_info *info, int linebytes, 355static void cg14_init_fix(struct fb_info *info, int linebytes,
356 struct device_node *dp) 356 struct device_node *dp)
357{ 357{
358 const char *name = dp->name; 358 const char *name = dp->name;
359 359
@@ -367,7 +367,7 @@ static void __devinit cg14_init_fix(struct fb_info *info, int linebytes,
367 info->fix.accel = FB_ACCEL_SUN_CG14; 367 info->fix.accel = FB_ACCEL_SUN_CG14;
368} 368}
369 369
370static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __devinitdata = { 370static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] = {
371 { 371 {
372 .voff = CG14_REGS, 372 .voff = CG14_REGS,
373 .poff = 0x80000000, 373 .poff = 0x80000000,
@@ -463,7 +463,7 @@ static void cg14_unmap_regs(struct platform_device *op, struct fb_info *info,
463 info->screen_base, info->fix.smem_len); 463 info->screen_base, info->fix.smem_len);
464} 464}
465 465
466static int __devinit cg14_probe(struct platform_device *op) 466static int cg14_probe(struct platform_device *op)
467{ 467{
468 struct device_node *dp = op->dev.of_node; 468 struct device_node *dp = op->dev.of_node;
469 struct fb_info *info; 469 struct fb_info *info;
@@ -571,7 +571,7 @@ out_err:
571 return err; 571 return err;
572} 572}
573 573
574static int __devexit cg14_remove(struct platform_device *op) 574static int cg14_remove(struct platform_device *op)
575{ 575{
576 struct fb_info *info = dev_get_drvdata(&op->dev); 576 struct fb_info *info = dev_get_drvdata(&op->dev);
577 struct cg14_par *par = info->par; 577 struct cg14_par *par = info->par;
@@ -603,7 +603,7 @@ static struct platform_driver cg14_driver = {
603 .of_match_table = cg14_match, 603 .of_match_table = cg14_match,
604 }, 604 },
605 .probe = cg14_probe, 605 .probe = cg14_probe,
606 .remove = __devexit_p(cg14_remove), 606 .remove = cg14_remove,
607}; 607};
608 608
609static int __init cg14_init(void) 609static int __init cg14_init(void)
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index c5e7612ff87..9f63507ded3 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -243,8 +243,8 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
243 * Initialisation 243 * Initialisation
244 */ 244 */
245 245
246static void __devinit cg3_init_fix(struct fb_info *info, int linebytes, 246static void cg3_init_fix(struct fb_info *info, int linebytes,
247 struct device_node *dp) 247 struct device_node *dp)
248{ 248{
249 strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); 249 strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
250 250
@@ -256,8 +256,8 @@ static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
256 info->fix.accel = FB_ACCEL_SUN_CGTHREE; 256 info->fix.accel = FB_ACCEL_SUN_CGTHREE;
257} 257}
258 258
259static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var, 259static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
260 struct device_node *dp) 260 struct device_node *dp)
261{ 261{
262 const char *params; 262 const char *params;
263 char *p; 263 char *p;
@@ -279,36 +279,36 @@ static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
279 } 279 }
280} 280}
281 281
282static u8 cg3regvals_66hz[] __devinitdata = { /* 1152 x 900, 66 Hz */ 282static u8 cg3regvals_66hz[] = { /* 1152 x 900, 66 Hz */
283 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, 283 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
284 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, 284 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
285 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, 285 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
286 0x10, 0x20, 0 286 0x10, 0x20, 0
287}; 287};
288 288
289static u8 cg3regvals_76hz[] __devinitdata = { /* 1152 x 900, 76 Hz */ 289static u8 cg3regvals_76hz[] = { /* 1152 x 900, 76 Hz */
290 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, 290 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
291 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, 291 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
292 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, 292 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
293 0x10, 0x24, 0 293 0x10, 0x24, 0
294}; 294};
295 295
296static u8 cg3regvals_rdi[] __devinitdata = { /* 640 x 480, cgRDI */ 296static u8 cg3regvals_rdi[] = { /* 640 x 480, cgRDI */
297 0x14, 0x70, 0x15, 0x20, 0x16, 0x08, 0x17, 0x10, 297 0x14, 0x70, 0x15, 0x20, 0x16, 0x08, 0x17, 0x10,
298 0x18, 0x06, 0x19, 0x02, 0x1a, 0x31, 0x1b, 0x51, 298 0x18, 0x06, 0x19, 0x02, 0x1a, 0x31, 0x1b, 0x51,
299 0x1c, 0x06, 0x1d, 0x0c, 0x1e, 0xff, 0x1f, 0x01, 299 0x1c, 0x06, 0x1d, 0x0c, 0x1e, 0xff, 0x1f, 0x01,
300 0x10, 0x22, 0 300 0x10, 0x22, 0
301}; 301};
302 302
303static u8 *cg3_regvals[] __devinitdata = { 303static u8 *cg3_regvals[] = {
304 cg3regvals_66hz, cg3regvals_76hz, cg3regvals_rdi 304 cg3regvals_66hz, cg3regvals_76hz, cg3regvals_rdi
305}; 305};
306 306
307static u_char cg3_dacvals[] __devinitdata = { 307static u_char cg3_dacvals[] = {
308 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 308 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0
309}; 309};
310 310
311static int __devinit cg3_do_default_mode(struct cg3_par *par) 311static int cg3_do_default_mode(struct cg3_par *par)
312{ 312{
313 enum cg3_type type; 313 enum cg3_type type;
314 u8 *p; 314 u8 *p;
@@ -346,7 +346,7 @@ static int __devinit cg3_do_default_mode(struct cg3_par *par)
346 return 0; 346 return 0;
347} 347}
348 348
349static int __devinit cg3_probe(struct platform_device *op) 349static int cg3_probe(struct platform_device *op)
350{ 350{
351 struct device_node *dp = op->dev.of_node; 351 struct device_node *dp = op->dev.of_node;
352 struct fb_info *info; 352 struct fb_info *info;
@@ -433,7 +433,7 @@ out_err:
433 return err; 433 return err;
434} 434}
435 435
436static int __devexit cg3_remove(struct platform_device *op) 436static int cg3_remove(struct platform_device *op)
437{ 437{
438 struct fb_info *info = dev_get_drvdata(&op->dev); 438 struct fb_info *info = dev_get_drvdata(&op->dev);
439 struct cg3_par *par = info->par; 439 struct cg3_par *par = info->par;
@@ -469,7 +469,7 @@ static struct platform_driver cg3_driver = {
469 .of_match_table = cg3_match, 469 .of_match_table = cg3_match,
470 }, 470 },
471 .probe = cg3_probe, 471 .probe = cg3_probe,
472 .remove = __devexit_p(cg3_remove), 472 .remove = cg3_remove,
473}; 473};
474 474
475static int __init cg3_init(void) 475static int __init cg3_init(void)
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 179e96cdb32..3545decc748 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -607,7 +607,7 @@ static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
607 * Initialisation 607 * Initialisation
608 */ 608 */
609 609
610static void __devinit cg6_init_fix(struct fb_info *info, int linebytes) 610static void cg6_init_fix(struct fb_info *info, int linebytes)
611{ 611{
612 struct cg6_par *par = (struct cg6_par *)info->par; 612 struct cg6_par *par = (struct cg6_par *)info->par;
613 const char *cg6_cpu_name, *cg6_card_name; 613 const char *cg6_cpu_name, *cg6_card_name;
@@ -649,7 +649,7 @@ static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
649} 649}
650 650
651/* Initialize Brooktree DAC */ 651/* Initialize Brooktree DAC */
652static void __devinit cg6_bt_init(struct cg6_par *par) 652static void cg6_bt_init(struct cg6_par *par)
653{ 653{
654 struct bt_regs __iomem *bt = par->bt; 654 struct bt_regs __iomem *bt = par->bt;
655 655
@@ -663,7 +663,7 @@ static void __devinit cg6_bt_init(struct cg6_par *par)
663 sbus_writel(0x00 << 24, &bt->control); 663 sbus_writel(0x00 << 24, &bt->control);
664} 664}
665 665
666static void __devinit cg6_chip_init(struct fb_info *info) 666static void cg6_chip_init(struct fb_info *info)
667{ 667{
668 struct cg6_par *par = (struct cg6_par *)info->par; 668 struct cg6_par *par = (struct cg6_par *)info->par;
669 struct cg6_tec __iomem *tec = par->tec; 669 struct cg6_tec __iomem *tec = par->tec;
@@ -737,7 +737,7 @@ static void cg6_unmap_regs(struct platform_device *op, struct fb_info *info,
737 info->fix.smem_len); 737 info->fix.smem_len);
738} 738}
739 739
740static int __devinit cg6_probe(struct platform_device *op) 740static int cg6_probe(struct platform_device *op)
741{ 741{
742 struct device_node *dp = op->dev.of_node; 742 struct device_node *dp = op->dev.of_node;
743 struct fb_info *info; 743 struct fb_info *info;
@@ -827,7 +827,7 @@ out_err:
827 return err; 827 return err;
828} 828}
829 829
830static int __devexit cg6_remove(struct platform_device *op) 830static int cg6_remove(struct platform_device *op)
831{ 831{
832 struct fb_info *info = dev_get_drvdata(&op->dev); 832 struct fb_info *info = dev_get_drvdata(&op->dev);
833 struct cg6_par *par = info->par; 833 struct cg6_par *par = info->par;
@@ -862,7 +862,7 @@ static struct platform_driver cg6_driver = {
862 .of_match_table = cg6_match, 862 .of_match_table = cg6_match,
863 }, 863 },
864 .probe = cg6_probe, 864 .probe = cg6_probe,
865 .remove = __devexit_p(cg6_remove), 865 .remove = cg6_remove,
866}; 866};
867 867
868static int __init cg6_init(void) 868static int __init cg6_init(void)
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index cff742abdc5..206a66b6107 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -292,7 +292,7 @@ static void __init chips_hw_init(void)
292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
293} 293}
294 294
295static struct fb_fix_screeninfo chipsfb_fix __devinitdata = { 295static struct fb_fix_screeninfo chipsfb_fix = {
296 .id = "C&T 65550", 296 .id = "C&T 65550",
297 .type = FB_TYPE_PACKED_PIXELS, 297 .type = FB_TYPE_PACKED_PIXELS,
298 .visual = FB_VISUAL_PSEUDOCOLOR, 298 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -309,7 +309,7 @@ static struct fb_fix_screeninfo chipsfb_fix __devinitdata = {
309 .smem_len = 0x100000, /* 1MB */ 309 .smem_len = 0x100000, /* 1MB */
310}; 310};
311 311
312static struct fb_var_screeninfo chipsfb_var __devinitdata = { 312static struct fb_var_screeninfo chipsfb_var = {
313 .xres = 800, 313 .xres = 800,
314 .yres = 600, 314 .yres = 600,
315 .xres_virtual = 800, 315 .xres_virtual = 800,
@@ -330,7 +330,7 @@ static struct fb_var_screeninfo chipsfb_var __devinitdata = {
330 .vsync_len = 8, 330 .vsync_len = 8,
331}; 331};
332 332
333static void __devinit init_chips(struct fb_info *p, unsigned long addr) 333static void init_chips(struct fb_info *p, unsigned long addr)
334{ 334{
335 memset(p->screen_base, 0, 0x100000); 335 memset(p->screen_base, 0, 0x100000);
336 336
@@ -347,8 +347,7 @@ static void __devinit init_chips(struct fb_info *p, unsigned long addr)
347 chips_hw_init(); 347 chips_hw_init();
348} 348}
349 349
350static int __devinit 350static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
351chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
352{ 351{
353 struct fb_info *p; 352 struct fb_info *p;
354 unsigned long addr, size; 353 unsigned long addr, size;
@@ -438,7 +437,7 @@ chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
438 return rc; 437 return rc;
439} 438}
440 439
441static void __devexit chipsfb_remove(struct pci_dev *dp) 440static void chipsfb_remove(struct pci_dev *dp)
442{ 441{
443 struct fb_info *p = pci_get_drvdata(dp); 442 struct fb_info *p = pci_get_drvdata(dp);
444 443
@@ -495,7 +494,7 @@ static struct pci_driver chipsfb_driver = {
495 .name = "chipsfb", 494 .name = "chipsfb",
496 .id_table = chipsfb_pci_tbl, 495 .id_table = chipsfb_pci_tbl,
497 .probe = chipsfb_pci_init, 496 .probe = chipsfb_pci_init,
498 .remove = __devexit_p(chipsfb_remove), 497 .remove = chipsfb_remove,
499#ifdef CONFIG_PM 498#ifdef CONFIG_PM
500 .suspend = chipsfb_pci_suspend, 499 .suspend = chipsfb_pci_suspend,
501 .resume = chipsfb_pci_resume, 500 .resume = chipsfb_pci_resume,
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index bc67d05cad6..c3dbbe6e3ac 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -290,34 +290,34 @@ struct zorrocl {
290 zorro_id ramid2; /* Zorro ID of optional second RAM device */ 290 zorro_id ramid2; /* Zorro ID of optional second RAM device */
291}; 291};
292 292
293static const struct zorrocl zcl_sd64 __devinitconst = { 293static const struct zorrocl zcl_sd64 = {
294 .type = BT_SD64, 294 .type = BT_SD64,
295 .ramid = ZORRO_PROD_HELFRICH_SD64_RAM, 295 .ramid = ZORRO_PROD_HELFRICH_SD64_RAM,
296}; 296};
297 297
298static const struct zorrocl zcl_piccolo __devinitconst = { 298static const struct zorrocl zcl_piccolo = {
299 .type = BT_PICCOLO, 299 .type = BT_PICCOLO,
300 .ramid = ZORRO_PROD_HELFRICH_PICCOLO_RAM, 300 .ramid = ZORRO_PROD_HELFRICH_PICCOLO_RAM,
301}; 301};
302 302
303static const struct zorrocl zcl_picasso __devinitconst = { 303static const struct zorrocl zcl_picasso = {
304 .type = BT_PICASSO, 304 .type = BT_PICASSO,
305 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM, 305 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM,
306}; 306};
307 307
308static const struct zorrocl zcl_spectrum __devinitconst = { 308static const struct zorrocl zcl_spectrum = {
309 .type = BT_SPECTRUM, 309 .type = BT_SPECTRUM,
310 .ramid = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM, 310 .ramid = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM,
311}; 311};
312 312
313static const struct zorrocl zcl_picasso4_z3 __devinitconst = { 313static const struct zorrocl zcl_picasso4_z3 = {
314 .type = BT_PICASSO4, 314 .type = BT_PICASSO4,
315 .regoffset = 0x00600000, 315 .regoffset = 0x00600000,
316 .ramsize = 4 * MB_, 316 .ramsize = 4 * MB_,
317 .ramoffset = 0x01000000, /* 0x02000000 for 64 MiB boards */ 317 .ramoffset = 0x01000000, /* 0x02000000 for 64 MiB boards */
318}; 318};
319 319
320static const struct zorrocl zcl_picasso4_z2 __devinitconst = { 320static const struct zorrocl zcl_picasso4_z2 = {
321 .type = BT_PICASSO4, 321 .type = BT_PICASSO4,
322 .regoffset = 0x10000, 322 .regoffset = 0x10000,
323 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1, 323 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1,
@@ -325,7 +325,7 @@ static const struct zorrocl zcl_picasso4_z2 __devinitconst = {
325}; 325};
326 326
327 327
328static const struct zorro_device_id cirrusfb_zorro_table[] __devinitconst = { 328static const struct zorro_device_id cirrusfb_zorro_table[] = {
329 { 329 {
330 .id = ZORRO_PROD_HELFRICH_SD64_REG, 330 .id = ZORRO_PROD_HELFRICH_SD64_REG,
331 .driver_data = (unsigned long)&zcl_sd64, 331 .driver_data = (unsigned long)&zcl_sd64,
@@ -372,8 +372,8 @@ struct cirrusfb_info {
372 void (*unmap)(struct fb_info *info); 372 void (*unmap)(struct fb_info *info);
373}; 373};
374 374
375static bool noaccel __devinitdata; 375static bool noaccel;
376static char *mode_option __devinitdata = "640x480@60"; 376static char *mode_option = "640x480@60";
377 377
378/****************************************************************************/ 378/****************************************************************************/
379/**** BEGIN PROTOTYPES ******************************************************/ 379/**** BEGIN PROTOTYPES ******************************************************/
@@ -1892,8 +1892,8 @@ static int release_io_ports;
1892 * based on the DRAM bandwidth bit and DRAM bank switching bit. This 1892 * based on the DRAM bandwidth bit and DRAM bank switching bit. This
1893 * works with 1MB, 2MB and 4MB configurations (which the Motorola boards 1893 * works with 1MB, 2MB and 4MB configurations (which the Motorola boards
1894 * seem to have. */ 1894 * seem to have. */
1895static unsigned int __devinit cirrusfb_get_memsize(struct fb_info *info, 1895static unsigned int cirrusfb_get_memsize(struct fb_info *info,
1896 u8 __iomem *regbase) 1896 u8 __iomem *regbase)
1897{ 1897{
1898 unsigned long mem; 1898 unsigned long mem;
1899 struct cirrusfb_info *cinfo = info->par; 1899 struct cirrusfb_info *cinfo = info->par;
@@ -2003,7 +2003,7 @@ static struct fb_ops cirrusfb_ops = {
2003 .fb_imageblit = cirrusfb_imageblit, 2003 .fb_imageblit = cirrusfb_imageblit,
2004}; 2004};
2005 2005
2006static int __devinit cirrusfb_set_fbinfo(struct fb_info *info) 2006static int cirrusfb_set_fbinfo(struct fb_info *info)
2007{ 2007{
2008 struct cirrusfb_info *cinfo = info->par; 2008 struct cirrusfb_info *cinfo = info->par;
2009 struct fb_var_screeninfo *var = &info->var; 2009 struct fb_var_screeninfo *var = &info->var;
@@ -2052,7 +2052,7 @@ static int __devinit cirrusfb_set_fbinfo(struct fb_info *info)
2052 return 0; 2052 return 0;
2053} 2053}
2054 2054
2055static int __devinit cirrusfb_register(struct fb_info *info) 2055static int cirrusfb_register(struct fb_info *info)
2056{ 2056{
2057 struct cirrusfb_info *cinfo = info->par; 2057 struct cirrusfb_info *cinfo = info->par;
2058 int err; 2058 int err;
@@ -2096,7 +2096,7 @@ err_dealloc_cmap:
2096 return err; 2096 return err;
2097} 2097}
2098 2098
2099static void __devexit cirrusfb_cleanup(struct fb_info *info) 2099static void cirrusfb_cleanup(struct fb_info *info)
2100{ 2100{
2101 struct cirrusfb_info *cinfo = info->par; 2101 struct cirrusfb_info *cinfo = info->par;
2102 2102
@@ -2109,8 +2109,8 @@ static void __devexit cirrusfb_cleanup(struct fb_info *info)
2109} 2109}
2110 2110
2111#ifdef CONFIG_PCI 2111#ifdef CONFIG_PCI
2112static int __devinit cirrusfb_pci_register(struct pci_dev *pdev, 2112static int cirrusfb_pci_register(struct pci_dev *pdev,
2113 const struct pci_device_id *ent) 2113 const struct pci_device_id *ent)
2114{ 2114{
2115 struct cirrusfb_info *cinfo; 2115 struct cirrusfb_info *cinfo;
2116 struct fb_info *info; 2116 struct fb_info *info;
@@ -2215,7 +2215,7 @@ err_out:
2215 return ret; 2215 return ret;
2216} 2216}
2217 2217
2218static void __devexit cirrusfb_pci_unregister(struct pci_dev *pdev) 2218static void cirrusfb_pci_unregister(struct pci_dev *pdev)
2219{ 2219{
2220 struct fb_info *info = pci_get_drvdata(pdev); 2220 struct fb_info *info = pci_get_drvdata(pdev);
2221 2221
@@ -2226,7 +2226,7 @@ static struct pci_driver cirrusfb_pci_driver = {
2226 .name = "cirrusfb", 2226 .name = "cirrusfb",
2227 .id_table = cirrusfb_pci_table, 2227 .id_table = cirrusfb_pci_table,
2228 .probe = cirrusfb_pci_register, 2228 .probe = cirrusfb_pci_register,
2229 .remove = __devexit_p(cirrusfb_pci_unregister), 2229 .remove = cirrusfb_pci_unregister,
2230#ifdef CONFIG_PM 2230#ifdef CONFIG_PM
2231#if 0 2231#if 0
2232 .suspend = cirrusfb_pci_suspend, 2232 .suspend = cirrusfb_pci_suspend,
@@ -2237,8 +2237,8 @@ static struct pci_driver cirrusfb_pci_driver = {
2237#endif /* CONFIG_PCI */ 2237#endif /* CONFIG_PCI */
2238 2238
2239#ifdef CONFIG_ZORRO 2239#ifdef CONFIG_ZORRO
2240static int __devinit cirrusfb_zorro_register(struct zorro_dev *z, 2240static int cirrusfb_zorro_register(struct zorro_dev *z,
2241 const struct zorro_device_id *ent) 2241 const struct zorro_device_id *ent)
2242{ 2242{
2243 struct fb_info *info; 2243 struct fb_info *info;
2244 int error; 2244 int error;
@@ -2352,7 +2352,7 @@ err_release_fb:
2352 return error; 2352 return error;
2353} 2353}
2354 2354
2355void __devexit cirrusfb_zorro_unregister(struct zorro_dev *z) 2355void cirrusfb_zorro_unregister(struct zorro_dev *z)
2356{ 2356{
2357 struct fb_info *info = zorro_get_drvdata(z); 2357 struct fb_info *info = zorro_get_drvdata(z);
2358 2358
@@ -2364,7 +2364,7 @@ static struct zorro_driver cirrusfb_zorro_driver = {
2364 .name = "cirrusfb", 2364 .name = "cirrusfb",
2365 .id_table = cirrusfb_zorro_table, 2365 .id_table = cirrusfb_zorro_table,
2366 .probe = cirrusfb_zorro_register, 2366 .probe = cirrusfb_zorro_register,
2367 .remove = __devexit_p(cirrusfb_zorro_unregister), 2367 .remove = cirrusfb_zorro_unregister,
2368}; 2368};
2369#endif /* CONFIG_ZORRO */ 2369#endif /* CONFIG_ZORRO */
2370 2370
diff --git a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c
index 63ecdf8f7ba..5a7af0deced 100644
--- a/drivers/video/clps711xfb.c
+++ b/drivers/video/clps711xfb.c
@@ -178,7 +178,7 @@ static struct fb_ops clps7111fb_ops = {
178 .fb_imageblit = cfb_imageblit, 178 .fb_imageblit = cfb_imageblit,
179}; 179};
180 180
181static void __devinit clps711x_guess_lcd_params(struct fb_info *info) 181static void clps711x_guess_lcd_params(struct fb_info *info)
182{ 182{
183 unsigned int lcdcon, syscon, size; 183 unsigned int lcdcon, syscon, size;
184 unsigned long phys_base = PAGE_OFFSET; 184 unsigned long phys_base = PAGE_OFFSET;
@@ -266,7 +266,7 @@ static void __devinit clps711x_guess_lcd_params(struct fb_info *info)
266 info->fix.type = FB_TYPE_PACKED_PIXELS; 266 info->fix.type = FB_TYPE_PACKED_PIXELS;
267} 267}
268 268
269static int __devinit clps711x_fb_probe(struct platform_device *pdev) 269static int clps711x_fb_probe(struct platform_device *pdev)
270{ 270{
271 int err = -ENOMEM; 271 int err = -ENOMEM;
272 272
@@ -291,7 +291,7 @@ static int __devinit clps711x_fb_probe(struct platform_device *pdev)
291out: return err; 291out: return err;
292} 292}
293 293
294static int __devexit clps711x_fb_remove(struct platform_device *pdev) 294static int clps711x_fb_remove(struct platform_device *pdev)
295{ 295{
296 unregister_framebuffer(cfb); 296 unregister_framebuffer(cfb);
297 kfree(cfb); 297 kfree(cfb);
@@ -305,7 +305,7 @@ static struct platform_driver clps711x_fb_driver = {
305 .owner = THIS_MODULE, 305 .owner = THIS_MODULE,
306 }, 306 },
307 .probe = clps711x_fb_probe, 307 .probe = clps711x_fb_probe,
308 .remove = __devexit_p(clps711x_fb_remove), 308 .remove = clps711x_fb_remove,
309}; 309};
310module_platform_driver(clps711x_fb_driver); 310module_platform_driver(clps711x_fb_driver);
311 311
diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 01a4ee7cc6b..a9031498e10 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -167,7 +167,7 @@ static void lcd_clear(struct fb_info *info)
167 lcd_write_control(info, LCD_RESET); 167 lcd_write_control(info, LCD_RESET);
168} 168}
169 169
170static struct fb_fix_screeninfo cobalt_lcdfb_fix __devinitdata = { 170static struct fb_fix_screeninfo cobalt_lcdfb_fix = {
171 .id = "cobalt-lcd", 171 .id = "cobalt-lcd",
172 .type = FB_TYPE_TEXT, 172 .type = FB_TYPE_TEXT,
173 .type_aux = FB_AUX_TEXT_MDA, 173 .type_aux = FB_AUX_TEXT_MDA,
@@ -331,7 +331,7 @@ static struct fb_ops cobalt_lcd_fbops = {
331 .fb_cursor = cobalt_lcdfb_cursor, 331 .fb_cursor = cobalt_lcdfb_cursor,
332}; 332};
333 333
334static int __devinit cobalt_lcdfb_probe(struct platform_device *dev) 334static int cobalt_lcdfb_probe(struct platform_device *dev)
335{ 335{
336 struct fb_info *info; 336 struct fb_info *info;
337 struct resource *res; 337 struct resource *res;
@@ -374,7 +374,7 @@ static int __devinit cobalt_lcdfb_probe(struct platform_device *dev)
374 return 0; 374 return 0;
375} 375}
376 376
377static int __devexit cobalt_lcdfb_remove(struct platform_device *dev) 377static int cobalt_lcdfb_remove(struct platform_device *dev)
378{ 378{
379 struct fb_info *info; 379 struct fb_info *info;
380 380
@@ -389,7 +389,7 @@ static int __devexit cobalt_lcdfb_remove(struct platform_device *dev)
389 389
390static struct platform_driver cobalt_lcdfb_driver = { 390static struct platform_driver cobalt_lcdfb_driver = {
391 .probe = cobalt_lcdfb_probe, 391 .probe = cobalt_lcdfb_probe,
392 .remove = __devexit_p(cobalt_lcdfb_remove), 392 .remove = cobalt_lcdfb_remove,
393 .driver = { 393 .driver = {
394 .name = "cobalt-lcd", 394 .name = "cobalt-lcd",
395 .owner = THIS_MODULE, 395 .owner = THIS_MODULE,
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 39571f9e016..35687fd5645 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -238,8 +238,7 @@ static void sti_flush(unsigned long start, unsigned long end)
238 flush_icache_range(start, end); 238 flush_icache_range(start, end);
239} 239}
240 240
241static void __devinit sti_rom_copy(unsigned long base, unsigned long count, 241static void sti_rom_copy(unsigned long base, unsigned long count, void *dest)
242 void *dest)
243{ 242{
244 unsigned long dest_start = (unsigned long) dest; 243 unsigned long dest_start = (unsigned long) dest;
245 244
@@ -266,7 +265,7 @@ static void __devinit sti_rom_copy(unsigned long base, unsigned long count,
266static char default_sti_path[21] __read_mostly; 265static char default_sti_path[21] __read_mostly;
267 266
268#ifndef MODULE 267#ifndef MODULE
269static int __devinit sti_setup(char *str) 268static int sti_setup(char *str)
270{ 269{
271 if (str) 270 if (str)
272 strlcpy (default_sti_path, str, sizeof (default_sti_path)); 271 strlcpy (default_sti_path, str, sizeof (default_sti_path));
@@ -285,12 +284,12 @@ __setup("sti=", sti_setup);
285 284
286 285
287 286
288static char __devinitdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; 287static char *font_name[MAX_STI_ROMS] = { "VGA8x16", };
289static int __devinitdata font_index[MAX_STI_ROMS], 288static int font_index[MAX_STI_ROMS],
290 font_height[MAX_STI_ROMS], 289 font_height[MAX_STI_ROMS],
291 font_width[MAX_STI_ROMS]; 290 font_width[MAX_STI_ROMS];
292#ifndef MODULE 291#ifndef MODULE
293static int __devinit sti_font_setup(char *str) 292static int sti_font_setup(char *str)
294{ 293{
295 char *x; 294 char *x;
296 int i = 0; 295 int i = 0;
@@ -343,8 +342,8 @@ __setup("sti_font=", sti_font_setup);
343 342
344 343
345 344
346static void __devinit 345static void sti_dump_globcfg(struct sti_glob_cfg *glob_cfg,
347sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) 346 unsigned int sti_mem_request)
348{ 347{
349 struct sti_glob_cfg_ext *cfg; 348 struct sti_glob_cfg_ext *cfg;
350 349
@@ -383,8 +382,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
383 cfg->sti_mem_addr, sti_mem_request)); 382 cfg->sti_mem_addr, sti_mem_request));
384} 383}
385 384
386static void __devinit 385static void sti_dump_outptr(struct sti_struct *sti)
387sti_dump_outptr(struct sti_struct *sti)
388{ 386{
389 DPRINTK((KERN_INFO 387 DPRINTK((KERN_INFO
390 "%d bits per pixel\n" 388 "%d bits per pixel\n"
@@ -397,9 +395,8 @@ sti_dump_outptr(struct sti_struct *sti)
397 sti->outptr.attributes)); 395 sti->outptr.attributes));
398} 396}
399 397
400static int __devinit 398static int sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address,
401sti_init_glob_cfg(struct sti_struct *sti, 399 unsigned long hpa)
402 unsigned long rom_address, unsigned long hpa)
403{ 400{
404 struct sti_glob_cfg *glob_cfg; 401 struct sti_glob_cfg *glob_cfg;
405 struct sti_glob_cfg_ext *glob_cfg_ext; 402 struct sti_glob_cfg_ext *glob_cfg_ext;
@@ -479,8 +476,8 @@ sti_init_glob_cfg(struct sti_struct *sti,
479} 476}
480 477
481#ifdef CONFIG_FB 478#ifdef CONFIG_FB
482static struct sti_cooked_font __devinit 479static struct sti_cooked_font *
483*sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) 480sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
484{ 481{
485 const struct font_desc *fbfont; 482 const struct font_desc *fbfont;
486 unsigned int size, bpc; 483 unsigned int size, bpc;
@@ -535,16 +532,15 @@ static struct sti_cooked_font __devinit
535 return cooked_font; 532 return cooked_font;
536} 533}
537#else 534#else
538static struct sti_cooked_font __devinit 535static struct sti_cooked_font *
539*sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) 536sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
540{ 537{
541 return NULL; 538 return NULL;
542} 539}
543#endif 540#endif
544 541
545static struct sti_cooked_font __devinit 542static struct sti_cooked_font *sti_select_font(struct sti_cooked_rom *rom,
546*sti_select_font(struct sti_cooked_rom *rom, 543 int (*search_font_fnc)(struct sti_cooked_rom *, int, int))
547 int (*search_font_fnc)(struct sti_cooked_rom *, int, int))
548{ 544{
549 struct sti_cooked_font *font; 545 struct sti_cooked_font *font;
550 int i; 546 int i;
@@ -569,8 +565,7 @@ static struct sti_cooked_font __devinit
569} 565}
570 566
571 567
572static void __devinit 568static void sti_dump_rom(struct sti_rom *rom)
573sti_dump_rom(struct sti_rom *rom)
574{ 569{
575 printk(KERN_INFO " id %04x-%04x, conforms to spec rev. %d.%02x\n", 570 printk(KERN_INFO " id %04x-%04x, conforms to spec rev. %d.%02x\n",
576 rom->graphics_id[0], 571 rom->graphics_id[0],
@@ -587,9 +582,8 @@ sti_dump_rom(struct sti_rom *rom)
587} 582}
588 583
589 584
590static int __devinit 585static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
591sti_cook_fonts(struct sti_cooked_rom *cooked_rom, 586 struct sti_rom *raw_rom)
592 struct sti_rom *raw_rom)
593{ 587{
594 struct sti_rom_font *raw_font, *font_start; 588 struct sti_rom_font *raw_font, *font_start;
595 struct sti_cooked_font *cooked_font; 589 struct sti_cooked_font *cooked_font;
@@ -622,8 +616,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
622} 616}
623 617
624 618
625static int __devinit 619static int sti_search_font(struct sti_cooked_rom *rom, int height, int width)
626sti_search_font(struct sti_cooked_rom *rom, int height, int width)
627{ 620{
628 struct sti_cooked_font *font; 621 struct sti_cooked_font *font;
629 int i = 0; 622 int i = 0;
@@ -639,8 +632,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width)
639#define BMODE_RELOCATE(offset) offset = (offset) / 4; 632#define BMODE_RELOCATE(offset) offset = (offset) / 4;
640#define BMODE_LAST_ADDR_OFFS 0x50 633#define BMODE_LAST_ADDR_OFFS 0x50
641 634
642static void * __devinit 635static void *sti_bmode_font_raw(struct sti_cooked_font *f)
643sti_bmode_font_raw(struct sti_cooked_font *f)
644{ 636{
645 unsigned char *n, *p, *q; 637 unsigned char *n, *p, *q;
646 int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); 638 int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font);
@@ -657,8 +649,8 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
657 return n + 3; 649 return n + 3;
658} 650}
659 651
660static void __devinit 652static void sti_bmode_rom_copy(unsigned long base, unsigned long count,
661sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) 653 void *dest)
662{ 654{
663 unsigned long dest_start = (unsigned long) dest; 655 unsigned long dest_start = (unsigned long) dest;
664 656
@@ -672,8 +664,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
672 sti_flush(dest_start, (unsigned long)dest); 664 sti_flush(dest_start, (unsigned long)dest);
673} 665}
674 666
675static struct sti_rom * __devinit 667static struct sti_rom *sti_get_bmode_rom (unsigned long address)
676sti_get_bmode_rom (unsigned long address)
677{ 668{
678 struct sti_rom *raw; 669 struct sti_rom *raw;
679 u32 size; 670 u32 size;
@@ -708,7 +699,7 @@ sti_get_bmode_rom (unsigned long address)
708 return raw; 699 return raw;
709} 700}
710 701
711static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address) 702static struct sti_rom *sti_get_wmode_rom(unsigned long address)
712{ 703{
713 struct sti_rom *raw; 704 struct sti_rom *raw;
714 unsigned long size; 705 unsigned long size;
@@ -723,8 +714,8 @@ static struct sti_rom __devinit *sti_get_wmode_rom(unsigned long address)
723 return raw; 714 return raw;
724} 715}
725 716
726static int __devinit sti_read_rom(int wordmode, struct sti_struct *sti, 717static int sti_read_rom(int wordmode, struct sti_struct *sti,
727 unsigned long address) 718 unsigned long address)
728{ 719{
729 struct sti_cooked_rom *cooked; 720 struct sti_cooked_rom *cooked;
730 struct sti_rom *raw = NULL; 721 struct sti_rom *raw = NULL;
@@ -806,8 +797,9 @@ out_err:
806 return 0; 797 return 0;
807} 798}
808 799
809static struct sti_struct * __devinit 800static struct sti_struct *sti_try_rom_generic(unsigned long address,
810sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd) 801 unsigned long hpa,
802 struct pci_dev *pd)
811{ 803{
812 struct sti_struct *sti; 804 struct sti_struct *sti;
813 int ok; 805 int ok;
@@ -921,7 +913,7 @@ out_err:
921 return NULL; 913 return NULL;
922} 914}
923 915
924static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path) 916static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
925{ 917{
926 if (strcmp (path, default_sti_path) == 0) 918 if (strcmp (path, default_sti_path) == 0)
927 default_sti = sti; 919 default_sti = sti;
@@ -932,7 +924,7 @@ static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char
932 * in the additional address field addr[1] while on 924 * in the additional address field addr[1] while on
933 * older Systems the PDC stores it in page0->proc_sti 925 * older Systems the PDC stores it in page0->proc_sti
934 */ 926 */
935static int __devinit sticore_pa_init(struct parisc_device *dev) 927static int sticore_pa_init(struct parisc_device *dev)
936{ 928{
937 char pa_path[21]; 929 char pa_path[21];
938 struct sti_struct *sti = NULL; 930 struct sti_struct *sti = NULL;
@@ -953,8 +945,7 @@ static int __devinit sticore_pa_init(struct parisc_device *dev)
953} 945}
954 946
955 947
956static int __devinit sticore_pci_init(struct pci_dev *pd, 948static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
957 const struct pci_device_id *ent)
958{ 949{
959#ifdef CONFIG_PCI 950#ifdef CONFIG_PCI
960 unsigned long fb_base, rom_base; 951 unsigned long fb_base, rom_base;
@@ -1001,7 +992,7 @@ static int __devinit sticore_pci_init(struct pci_dev *pd,
1001} 992}
1002 993
1003 994
1004static void __devexit sticore_pci_remove(struct pci_dev *pd) 995static void sticore_pci_remove(struct pci_dev *pd)
1005{ 996{
1006 BUG(); 997 BUG();
1007} 998}
@@ -1043,7 +1034,7 @@ static struct parisc_driver pa_sti_driver = {
1043 1034
1044static int sticore_initialized __read_mostly; 1035static int sticore_initialized __read_mostly;
1045 1036
1046static void __devinit sti_init_roms(void) 1037static void sti_init_roms(void)
1047{ 1038{
1048 if (sticore_initialized) 1039 if (sticore_initialized)
1049 return; 1040 return;
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index e40125cb313..57886787ead 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1230,7 +1230,7 @@ static int cyber2000fb_ddc_getsda(void *data)
1230 return retval; 1230 return retval;
1231} 1231}
1232 1232
1233static int __devinit cyber2000fb_setup_ddc_bus(struct cfb_info *cfb) 1233static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
1234{ 1234{
1235 strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id, 1235 strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id,
1236 sizeof(cfb->ddc_adapter.name)); 1236 sizeof(cfb->ddc_adapter.name));
@@ -1305,7 +1305,7 @@ static int cyber2000fb_i2c_getscl(void *data)
1305 return ret; 1305 return ret;
1306} 1306}
1307 1307
1308static int __devinit cyber2000fb_i2c_register(struct cfb_info *cfb) 1308static int cyber2000fb_i2c_register(struct cfb_info *cfb)
1309{ 1309{
1310 strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id, 1310 strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id,
1311 sizeof(cfb->i2c_adapter.name)); 1311 sizeof(cfb->i2c_adapter.name));
@@ -1336,7 +1336,7 @@ static void cyber2000fb_i2c_unregister(struct cfb_info *cfb)
1336 * These parameters give 1336 * These parameters give
1337 * 640x480, hsync 31.5kHz, vsync 60Hz 1337 * 640x480, hsync 31.5kHz, vsync 60Hz
1338 */ 1338 */
1339static struct fb_videomode __devinitdata cyber2000fb_default_mode = { 1339static struct fb_videomode cyber2000fb_default_mode = {
1340 .refresh = 60, 1340 .refresh = 60,
1341 .xres = 640, 1341 .xres = 640,
1342 .yres = 480, 1342 .yres = 480,
@@ -1404,8 +1404,7 @@ static void cyberpro_init_hw(struct cfb_info *cfb)
1404 } 1404 }
1405} 1405}
1406 1406
1407static struct cfb_info __devinit *cyberpro_alloc_fb_info(unsigned int id, 1407static struct cfb_info *cyberpro_alloc_fb_info(unsigned int id, char *name)
1408 char *name)
1409{ 1408{
1410 struct cfb_info *cfb; 1409 struct cfb_info *cfb;
1411 1410
@@ -1524,7 +1523,7 @@ static int cyber2000fb_setup(char *options)
1524 * - memory mapped access to the registers 1523 * - memory mapped access to the registers
1525 * - initialised mem_ctl1 and mem_ctl2 appropriately. 1524 * - initialised mem_ctl1 and mem_ctl2 appropriately.
1526 */ 1525 */
1527static int __devinit cyberpro_common_probe(struct cfb_info *cfb) 1526static int cyberpro_common_probe(struct cfb_info *cfb)
1528{ 1527{
1529 u_long smem_size; 1528 u_long smem_size;
1530 u_int h_sync, v_sync; 1529 u_int h_sync, v_sync;
@@ -1615,7 +1614,7 @@ failed:
1615 return err; 1614 return err;
1616} 1615}
1617 1616
1618static void __devexit cyberpro_common_remove(struct cfb_info *cfb) 1617static void cyberpro_common_remove(struct cfb_info *cfb)
1619{ 1618{
1620 unregister_framebuffer(&cfb->fb); 1619 unregister_framebuffer(&cfb->fb);
1621#ifdef CONFIG_FB_CYBER2000_DDC 1620#ifdef CONFIG_FB_CYBER2000_DDC
@@ -1646,7 +1645,7 @@ static void cyberpro_common_resume(struct cfb_info *cfb)
1646 1645
1647#include <mach/framebuffer.h> 1646#include <mach/framebuffer.h>
1648 1647
1649static int __devinit cyberpro_vl_probe(void) 1648static int cyberpro_vl_probe(void)
1650{ 1649{
1651 struct cfb_info *cfb; 1650 struct cfb_info *cfb;
1652 int err = -ENOMEM; 1651 int err = -ENOMEM;
@@ -1780,8 +1779,8 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
1780 return 0; 1779 return 0;
1781} 1780}
1782 1781
1783static int __devinit 1782static int cyberpro_pci_probe(struct pci_dev *dev,
1784cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) 1783 const struct pci_device_id *id)
1785{ 1784{
1786 struct cfb_info *cfb; 1785 struct cfb_info *cfb;
1787 char name[16]; 1786 char name[16];
@@ -1863,7 +1862,7 @@ failed_release:
1863 return err; 1862 return err;
1864} 1863}
1865 1864
1866static void __devexit cyberpro_pci_remove(struct pci_dev *dev) 1865static void cyberpro_pci_remove(struct pci_dev *dev)
1867{ 1866{
1868 struct cfb_info *cfb = pci_get_drvdata(dev); 1867 struct cfb_info *cfb = pci_get_drvdata(dev);
1869 1868
@@ -1923,7 +1922,7 @@ MODULE_DEVICE_TABLE(pci, cyberpro_pci_table);
1923static struct pci_driver cyberpro_driver = { 1922static struct pci_driver cyberpro_driver = {
1924 .name = "CyberPro", 1923 .name = "CyberPro",
1925 .probe = cyberpro_pci_probe, 1924 .probe = cyberpro_pci_probe,
1926 .remove = __devexit_p(cyberpro_pci_remove), 1925 .remove = cyberpro_pci_remove,
1927 .suspend = cyberpro_pci_suspend, 1926 .suspend = cyberpro_pci_suspend,
1928 .resume = cyberpro_pci_resume, 1927 .resume = cyberpro_pci_resume,
1929 .id_table = cyberpro_pci_table 1928 .id_table = cyberpro_pci_table
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 46534e00fe0..0810939936f 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -185,7 +185,7 @@ struct da8xx_fb_par {
185}; 185};
186 186
187/* Variable Screen Information */ 187/* Variable Screen Information */
188static struct fb_var_screeninfo da8xx_fb_var __devinitdata = { 188static struct fb_var_screeninfo da8xx_fb_var = {
189 .xoffset = 0, 189 .xoffset = 0,
190 .yoffset = 0, 190 .yoffset = 0,
191 .transp = {0, 0, 0}, 191 .transp = {0, 0, 0},
@@ -202,7 +202,7 @@ static struct fb_var_screeninfo da8xx_fb_var __devinitdata = {
202 .vmode = FB_VMODE_NONINTERLACED 202 .vmode = FB_VMODE_NONINTERLACED
203}; 203};
204 204
205static struct fb_fix_screeninfo da8xx_fb_fix __devinitdata = { 205static struct fb_fix_screeninfo da8xx_fb_fix = {
206 .id = "DA8xx FB Drv", 206 .id = "DA8xx FB Drv",
207 .type = FB_TYPE_PACKED_PIXELS, 207 .type = FB_TYPE_PACKED_PIXELS,
208 .type_aux = 0, 208 .type_aux = 0,
@@ -993,7 +993,7 @@ static inline void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par)
993} 993}
994#endif 994#endif
995 995
996static int __devexit fb_remove(struct platform_device *dev) 996static int fb_remove(struct platform_device *dev)
997{ 997{
998 struct fb_info *info = dev_get_drvdata(&dev->dev); 998 struct fb_info *info = dev_get_drvdata(&dev->dev);
999 999
@@ -1211,7 +1211,7 @@ static unsigned int da8xxfb_pixel_clk_period(struct da8xx_fb_par *par)
1211 return pix_clk_period_picosec; 1211 return pix_clk_period_picosec;
1212} 1212}
1213 1213
1214static int __devinit fb_probe(struct platform_device *device) 1214static int fb_probe(struct platform_device *device)
1215{ 1215{
1216 struct da8xx_lcdc_platform_data *fb_pdata = 1216 struct da8xx_lcdc_platform_data *fb_pdata =
1217 device->dev.platform_data; 1217 device->dev.platform_data;
@@ -1580,7 +1580,7 @@ static int fb_resume(struct platform_device *dev)
1580 1580
1581static struct platform_driver da8xx_fb_driver = { 1581static struct platform_driver da8xx_fb_driver = {
1582 .probe = fb_probe, 1582 .probe = fb_probe,
1583 .remove = __devexit_p(fb_remove), 1583 .remove = fb_remove,
1584 .suspend = fb_suspend, 1584 .suspend = fb_suspend,
1585 .resume = fb_resume, 1585 .resume = fb_resume,
1586 .driver = { 1586 .driver = {
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 49e3dda1a36..3526899da61 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -115,7 +115,7 @@ static struct fb_ops dn_fb_ops = {
115 .fb_imageblit = cfb_imageblit, 115 .fb_imageblit = cfb_imageblit,
116}; 116};
117 117
118struct fb_var_screeninfo dnfb_var __devinitdata = { 118struct fb_var_screeninfo dnfb_var = {
119 .xres = 1280, 119 .xres = 1280,
120 .yres = 1024, 120 .yres = 1024,
121 .xres_virtual = 2048, 121 .xres_virtual = 2048,
@@ -126,7 +126,7 @@ struct fb_var_screeninfo dnfb_var __devinitdata = {
126 .vmode = FB_VMODE_NONINTERLACED, 126 .vmode = FB_VMODE_NONINTERLACED,
127}; 127};
128 128
129static struct fb_fix_screeninfo dnfb_fix __devinitdata = { 129static struct fb_fix_screeninfo dnfb_fix = {
130 .id = "Apollo Mono", 130 .id = "Apollo Mono",
131 .smem_start = (FRAME_BUFFER_START + IO_BASE), 131 .smem_start = (FRAME_BUFFER_START + IO_BASE),
132 .smem_len = FRAME_BUFFER_LEN, 132 .smem_len = FRAME_BUFFER_LEN,
@@ -224,7 +224,7 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
224 * Initialization 224 * Initialization
225 */ 225 */
226 226
227static int __devinit dnfb_probe(struct platform_device *dev) 227static int dnfb_probe(struct platform_device *dev)
228{ 228{
229 struct fb_info *info; 229 struct fb_info *info;
230 int err = 0; 230 int err = 0;
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 932abaa58a8..50fe668c617 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -20,7 +20,7 @@ static bool request_mem_succeeded = false;
20 20
21static struct pci_dev *default_vga; 21static struct pci_dev *default_vga;
22 22
23static struct fb_var_screeninfo efifb_defined __devinitdata = { 23static struct fb_var_screeninfo efifb_defined = {
24 .activate = FB_ACTIVATE_NOW, 24 .activate = FB_ACTIVATE_NOW,
25 .height = -1, 25 .height = -1,
26 .width = -1, 26 .width = -1,
@@ -31,7 +31,7 @@ static struct fb_var_screeninfo efifb_defined __devinitdata = {
31 .vmode = FB_VMODE_NONINTERLACED, 31 .vmode = FB_VMODE_NONINTERLACED,
32}; 32};
33 33
34static struct fb_fix_screeninfo efifb_fix __devinitdata = { 34static struct fb_fix_screeninfo efifb_fix = {
35 .id = "EFI VGA", 35 .id = "EFI VGA",
36 .type = FB_TYPE_PACKED_PIXELS, 36 .type = FB_TYPE_PACKED_PIXELS,
37 .accel = FB_ACCEL_NONE, 37 .accel = FB_ACCEL_NONE,
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c
index 755ef3e65ca..3f2519d3071 100644
--- a/drivers/video/ep93xx-fb.c
+++ b/drivers/video/ep93xx-fb.c
@@ -484,7 +484,7 @@ static void ep93xxfb_dealloc_videomem(struct fb_info *info)
484 info->screen_base, info->fix.smem_start); 484 info->screen_base, info->fix.smem_start);
485} 485}
486 486
487static int __devinit ep93xxfb_probe(struct platform_device *pdev) 487static int ep93xxfb_probe(struct platform_device *pdev)
488{ 488{
489 struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data; 489 struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
490 struct fb_info *info; 490 struct fb_info *info;
@@ -599,7 +599,7 @@ failed_cmap:
599 return err; 599 return err;
600} 600}
601 601
602static int __devexit ep93xxfb_remove(struct platform_device *pdev) 602static int ep93xxfb_remove(struct platform_device *pdev)
603{ 603{
604 struct fb_info *info = platform_get_drvdata(pdev); 604 struct fb_info *info = platform_get_drvdata(pdev);
605 struct ep93xx_fbi *fbi = info->par; 605 struct ep93xx_fbi *fbi = info->par;
@@ -620,14 +620,14 @@ static int __devexit ep93xxfb_remove(struct platform_device *pdev)
620 620
621static struct platform_driver ep93xxfb_driver = { 621static struct platform_driver ep93xxfb_driver = {
622 .probe = ep93xxfb_probe, 622 .probe = ep93xxfb_probe,
623 .remove = __devexit_p(ep93xxfb_remove), 623 .remove = ep93xxfb_remove,
624 .driver = { 624 .driver = {
625 .name = "ep93xx-fb", 625 .name = "ep93xx-fb",
626 .owner = THIS_MODULE, 626 .owner = THIS_MODULE,
627 }, 627 },
628}; 628};
629 629
630static int __devinit ep93xxfb_init(void) 630static int ep93xxfb_init(void)
631{ 631{
632 return platform_driver_register(&ep93xxfb_driver); 632 return platform_driver_register(&ep93xxfb_driver);
633} 633}
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 28fd686c6b8..4ef18e2e90c 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -1033,7 +1033,7 @@ static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
1033} 1033}
1034#endif /* CONFIG_OF */ 1034#endif /* CONFIG_OF */
1035 1035
1036static int __devinit exynos_dp_probe(struct platform_device *pdev) 1036static int exynos_dp_probe(struct platform_device *pdev)
1037{ 1037{
1038 struct resource *res; 1038 struct resource *res;
1039 struct exynos_dp_device *dp; 1039 struct exynos_dp_device *dp;
@@ -1114,7 +1114,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
1114 return 0; 1114 return 0;
1115} 1115}
1116 1116
1117static int __devexit exynos_dp_remove(struct platform_device *pdev) 1117static int exynos_dp_remove(struct platform_device *pdev)
1118{ 1118{
1119 struct exynos_dp_platdata *pdata = pdev->dev.platform_data; 1119 struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
1120 struct exynos_dp_device *dp = platform_get_drvdata(pdev); 1120 struct exynos_dp_device *dp = platform_get_drvdata(pdev);
@@ -1195,7 +1195,7 @@ MODULE_DEVICE_TABLE(of, exynos_dp_match);
1195 1195
1196static struct platform_driver exynos_dp_driver = { 1196static struct platform_driver exynos_dp_driver = {
1197 .probe = exynos_dp_probe, 1197 .probe = exynos_dp_probe,
1198 .remove = __devexit_p(exynos_dp_remove), 1198 .remove = exynos_dp_remove,
1199 .driver = { 1199 .driver = {
1200 .name = "exynos-dp", 1200 .name = "exynos-dp",
1201 .owner = THIS_MODULE, 1201 .owner = THIS_MODULE,
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index 07d70a3a628..4a17cdccef3 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -490,7 +490,7 @@ err_platform_get_irq:
490 return ret; 490 return ret;
491} 491}
492 492
493static int __devexit exynos_mipi_dsi_remove(struct platform_device *pdev) 493static int exynos_mipi_dsi_remove(struct platform_device *pdev)
494{ 494{
495 struct mipi_dsim_device *dsim = platform_get_drvdata(pdev); 495 struct mipi_dsim_device *dsim = platform_get_drvdata(pdev);
496 struct mipi_dsim_ddi *dsim_ddi, *next; 496 struct mipi_dsim_ddi *dsim_ddi, *next;
@@ -595,7 +595,7 @@ static const struct dev_pm_ops exynos_mipi_dsi_pm_ops = {
595 595
596static struct platform_driver exynos_mipi_dsi_driver = { 596static struct platform_driver exynos_mipi_dsi_driver = {
597 .probe = exynos_mipi_dsi_probe, 597 .probe = exynos_mipi_dsi_probe,
598 .remove = __devexit_p(exynos_mipi_dsi_remove), 598 .remove = exynos_mipi_dsi_remove,
599 .driver = { 599 .driver = {
600 .name = "exynos-mipi-dsim", 600 .name = "exynos-mipi-dsim",
601 .owner = THIS_MODULE, 601 .owner = THIS_MODULE,
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 14102a3f70f..6d2744794dd 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -893,7 +893,7 @@ static void ffb_init_fix(struct fb_info *info)
893 info->fix.accel = FB_ACCEL_SUN_CREATOR; 893 info->fix.accel = FB_ACCEL_SUN_CREATOR;
894} 894}
895 895
896static int __devinit ffb_probe(struct platform_device *op) 896static int ffb_probe(struct platform_device *op)
897{ 897{
898 struct device_node *dp = op->dev.of_node; 898 struct device_node *dp = op->dev.of_node;
899 struct ffb_fbc __iomem *fbc; 899 struct ffb_fbc __iomem *fbc;
@@ -1022,7 +1022,7 @@ out_err:
1022 return err; 1022 return err;
1023} 1023}
1024 1024
1025static int __devexit ffb_remove(struct platform_device *op) 1025static int ffb_remove(struct platform_device *op)
1026{ 1026{
1027 struct fb_info *info = dev_get_drvdata(&op->dev); 1027 struct fb_info *info = dev_get_drvdata(&op->dev);
1028 struct ffb_par *par = info->par; 1028 struct ffb_par *par = info->par;
@@ -1058,7 +1058,7 @@ static struct platform_driver ffb_driver = {
1058 .of_match_table = ffb_match, 1058 .of_match_table = ffb_match,
1059 }, 1059 },
1060 .probe = ffb_probe, 1060 .probe = ffb_probe,
1061 .remove = __devexit_p(ffb_remove), 1061 .remove = ffb_remove,
1062}; 1062};
1063 1063
1064static int __init ffb_init(void) 1064static int __init ffb_init(void)
diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
index d0533b7aad7..c99c9671302 100644
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -127,7 +127,7 @@
127 127
128static volatile unsigned char *fm2fb_reg; 128static volatile unsigned char *fm2fb_reg;
129 129
130static struct fb_fix_screeninfo fb_fix __devinitdata = { 130static struct fb_fix_screeninfo fb_fix = {
131 .smem_len = FRAMEMASTER_REG, 131 .smem_len = FRAMEMASTER_REG,
132 .type = FB_TYPE_PACKED_PIXELS, 132 .type = FB_TYPE_PACKED_PIXELS,
133 .visual = FB_VISUAL_TRUECOLOR, 133 .visual = FB_VISUAL_TRUECOLOR,
@@ -136,12 +136,12 @@ static struct fb_fix_screeninfo fb_fix __devinitdata = {
136 .accel = FB_ACCEL_NONE, 136 .accel = FB_ACCEL_NONE,
137}; 137};
138 138
139static int fm2fb_mode __devinitdata = -1; 139static int fm2fb_mode = -1;
140 140
141#define FM2FB_MODE_PAL 0 141#define FM2FB_MODE_PAL 0
142#define FM2FB_MODE_NTSC 1 142#define FM2FB_MODE_NTSC 1
143 143
144static struct fb_var_screeninfo fb_var_modes[] __devinitdata = { 144static struct fb_var_screeninfo fb_var_modes[] = {
145 { 145 {
146 /* 768 x 576, 32 bpp (PAL) */ 146 /* 768 x 576, 32 bpp (PAL) */
147 768, 576, 768, 576, 0, 0, 32, 0, 147 768, 576, 768, 576, 0, 0, 32, 0,
@@ -211,10 +211,9 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
211 * Initialisation 211 * Initialisation
212 */ 212 */
213 213
214static int __devinit fm2fb_probe(struct zorro_dev *z, 214static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id);
215 const struct zorro_device_id *id);
216 215
217static struct zorro_device_id fm2fb_devices[] __devinitdata = { 216static struct zorro_device_id fm2fb_devices[] = {
218 { ZORRO_PROD_BSC_FRAMEMASTER_II }, 217 { ZORRO_PROD_BSC_FRAMEMASTER_II },
219 { ZORRO_PROD_HELFRICH_RAINBOW_II }, 218 { ZORRO_PROD_HELFRICH_RAINBOW_II },
220 { 0 } 219 { 0 }
@@ -227,8 +226,7 @@ static struct zorro_driver fm2fb_driver = {
227 .probe = fm2fb_probe, 226 .probe = fm2fb_probe,
228}; 227};
229 228
230static int __devinit fm2fb_probe(struct zorro_dev *z, 229static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id)
231 const struct zorro_device_id *id)
232{ 230{
233 struct fb_info *info; 231 struct fb_info *info;
234 unsigned long *ptr; 232 unsigned long *ptr;
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index d3fc92eaee8..19cfd7a9256 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -55,7 +55,7 @@
55 * order if increasing resolution and frequency. The 320x240-60 mode is 55 * order if increasing resolution and frequency. The 320x240-60 mode is
56 * the initial AOI for the second and third planes. 56 * the initial AOI for the second and third planes.
57 */ 57 */
58static struct fb_videomode __devinitdata fsl_diu_mode_db[] = { 58static struct fb_videomode fsl_diu_mode_db[] = {
59 { 59 {
60 .refresh = 60, 60 .refresh = 60,
61 .xres = 1024, 61 .xres = 1024,
@@ -1307,7 +1307,7 @@ static struct fb_ops fsl_diu_ops = {
1307 .fb_release = fsl_diu_release, 1307 .fb_release = fsl_diu_release,
1308}; 1308};
1309 1309
1310static int __devinit install_fb(struct fb_info *info) 1310static int install_fb(struct fb_info *info)
1311{ 1311{
1312 int rc; 1312 int rc;
1313 struct mfb_info *mfbi = info->par; 1313 struct mfb_info *mfbi = info->par;
@@ -1518,7 +1518,7 @@ static ssize_t show_monitor(struct device *device,
1518 return 0; 1518 return 0;
1519} 1519}
1520 1520
1521static int __devinit fsl_diu_probe(struct platform_device *pdev) 1521static int fsl_diu_probe(struct platform_device *pdev)
1522{ 1522{
1523 struct device_node *np = pdev->dev.of_node; 1523 struct device_node *np = pdev->dev.of_node;
1524 struct mfb_info *mfbi; 1524 struct mfb_info *mfbi;
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 3dad31975db..bda5e394151 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16];
91static uint32_t gbe_cmap[256]; 91static uint32_t gbe_cmap[256];
92static int gbe_turned_on; /* 0 turned off, 1 turned on */ 92static int gbe_turned_on; /* 0 turned off, 1 turned on */
93 93
94static char *mode_option __devinitdata = NULL; 94static char *mode_option = NULL;
95 95
96/* default CRT mode */ 96/* default CRT mode */
97static struct fb_var_screeninfo default_var_CRT __devinitdata = { 97static struct fb_var_screeninfo default_var_CRT = {
98 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ 98 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
99 .xres = 640, 99 .xres = 640,
100 .yres = 480, 100 .yres = 480,
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __devinitdata = {
125}; 125};
126 126
127/* default LCD mode */ 127/* default LCD mode */
128static struct fb_var_screeninfo default_var_LCD __devinitdata = { 128static struct fb_var_screeninfo default_var_LCD = {
129 /* 1600x1024, 8 bpp */ 129 /* 1600x1024, 8 bpp */
130 .xres = 1600, 130 .xres = 1600,
131 .yres = 1024, 131 .yres = 1024,
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __devinitdata = {
157 157
158/* default modedb mode */ 158/* default modedb mode */
159/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ 159/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
160static struct fb_videomode default_mode_CRT __devinitdata = { 160static struct fb_videomode default_mode_CRT = {
161 .refresh = 60, 161 .refresh = 60,
162 .xres = 640, 162 .xres = 640,
163 .yres = 480, 163 .yres = 480,
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __devinitdata = {
172 .vmode = FB_VMODE_NONINTERLACED, 172 .vmode = FB_VMODE_NONINTERLACED,
173}; 173};
174/* 1600x1024 SGI flatpanel 1600sw */ 174/* 1600x1024 SGI flatpanel 1600sw */
175static struct fb_videomode default_mode_LCD __devinitdata = { 175static struct fb_videomode default_mode_LCD = {
176 /* 1600x1024, 8 bpp */ 176 /* 1600x1024, 8 bpp */
177 .xres = 1600, 177 .xres = 1600,
178 .yres = 1024, 178 .yres = 1024,
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __devinitdata = {
186 .vmode = FB_VMODE_NONINTERLACED, 186 .vmode = FB_VMODE_NONINTERLACED,
187}; 187};
188 188
189static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT; 189static struct fb_videomode *default_mode = &default_mode_CRT;
190static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT; 190static struct fb_var_screeninfo *default_var = &default_var_CRT;
191 191
192static int flat_panel_enabled = 0; 192static int flat_panel_enabled = 0;
193 193
@@ -1082,7 +1082,7 @@ static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *at
1082 1082
1083static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL); 1083static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL);
1084 1084
1085static void __devexit gbefb_remove_sysfs(struct device *dev) 1085static void gbefb_remove_sysfs(struct device *dev)
1086{ 1086{
1087 device_remove_file(dev, &dev_attr_size); 1087 device_remove_file(dev, &dev_attr_size);
1088 device_remove_file(dev, &dev_attr_revision); 1088 device_remove_file(dev, &dev_attr_revision);
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev)
1098 * Initialization 1098 * Initialization
1099 */ 1099 */
1100 1100
1101static int __devinit gbefb_setup(char *options) 1101static int gbefb_setup(char *options)
1102{ 1102{
1103 char *this_opt; 1103 char *this_opt;
1104 1104
@@ -1129,7 +1129,7 @@ static int __devinit gbefb_setup(char *options)
1129 return 0; 1129 return 0;
1130} 1130}
1131 1131
1132static int __devinit gbefb_probe(struct platform_device *p_dev) 1132static int gbefb_probe(struct platform_device *p_dev)
1133{ 1133{
1134 int i, ret = 0; 1134 int i, ret = 0;
1135 struct fb_info *info; 1135 struct fb_info *info;
@@ -1254,7 +1254,7 @@ out_release_framebuffer:
1254 return ret; 1254 return ret;
1255} 1255}
1256 1256
1257static int __devexit gbefb_remove(struct platform_device* p_dev) 1257static int gbefb_remove(struct platform_device* p_dev)
1258{ 1258{
1259 struct fb_info *info = platform_get_drvdata(p_dev); 1259 struct fb_info *info = platform_get_drvdata(p_dev);
1260 1260
@@ -1273,7 +1273,7 @@ static int __devexit gbefb_remove(struct platform_device* p_dev)
1273 1273
1274static struct platform_driver gbefb_driver = { 1274static struct platform_driver gbefb_driver = {
1275 .probe = gbefb_probe, 1275 .probe = gbefb_probe,
1276 .remove = __devexit_p(gbefb_remove), 1276 .remove = gbefb_remove,
1277 .driver = { 1277 .driver = {
1278 .name = "gbefb", 1278 .name = "gbefb",
1279 }, 1279 },
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index 265c5ed59ad..ebbaada7b94 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -29,7 +29,7 @@ static int crt_option = 1;
29static char panel_option[32] = ""; 29static char panel_option[32] = "";
30 30
31/* Modes relevant to the GX1 (taken from modedb.c) */ 31/* Modes relevant to the GX1 (taken from modedb.c) */
32static const struct fb_videomode __devinitconst gx1_modedb[] = { 32static const struct fb_videomode gx1_modedb[] = {
33 /* 640x480-60 VESA */ 33 /* 640x480-60 VESA */
34 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, 34 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
35 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 35 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
@@ -195,7 +195,7 @@ static int gx1fb_blank(int blank_mode, struct fb_info *info)
195 return par->vid_ops->blank_display(info, blank_mode); 195 return par->vid_ops->blank_display(info, blank_mode);
196} 196}
197 197
198static int __devinit gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev) 198static int gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
199{ 199{
200 struct geodefb_par *par = info->par; 200 struct geodefb_par *par = info->par;
201 unsigned gx_base; 201 unsigned gx_base;
@@ -268,7 +268,7 @@ static struct fb_ops gx1fb_ops = {
268 .fb_imageblit = cfb_imageblit, 268 .fb_imageblit = cfb_imageblit,
269}; 269};
270 270
271static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev) 271static struct fb_info *gx1fb_init_fbinfo(struct device *dev)
272{ 272{
273 struct geodefb_par *par; 273 struct geodefb_par *par;
274 struct fb_info *info; 274 struct fb_info *info;
@@ -318,7 +318,7 @@ static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev)
318 return info; 318 return info;
319} 319}
320 320
321static int __devinit gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id) 321static int gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
322{ 322{
323 struct geodefb_par *par; 323 struct geodefb_par *par;
324 struct fb_info *info; 324 struct fb_info *info;
@@ -382,7 +382,7 @@ static int __devinit gx1fb_probe(struct pci_dev *pdev, const struct pci_device_i
382 return ret; 382 return ret;
383} 383}
384 384
385static void __devexit gx1fb_remove(struct pci_dev *pdev) 385static void gx1fb_remove(struct pci_dev *pdev)
386{ 386{
387 struct fb_info *info = pci_get_drvdata(pdev); 387 struct fb_info *info = pci_get_drvdata(pdev);
388 struct geodefb_par *par = info->par; 388 struct geodefb_par *par = info->par;
@@ -441,7 +441,7 @@ static struct pci_driver gx1fb_driver = {
441 .name = "gx1fb", 441 .name = "gx1fb",
442 .id_table = gx1fb_id_table, 442 .id_table = gx1fb_id_table,
443 .probe = gx1fb_probe, 443 .probe = gx1fb_probe,
444 .remove = __devexit_p(gx1fb_remove), 444 .remove = gx1fb_remove,
445}; 445};
446 446
447static int __init gx1fb_init(void) 447static int __init gx1fb_init(void)
@@ -456,7 +456,7 @@ static int __init gx1fb_init(void)
456 return pci_register_driver(&gx1fb_driver); 456 return pci_register_driver(&gx1fb_driver);
457} 457}
458 458
459static void __devexit gx1fb_cleanup(void) 459static void gx1fb_cleanup(void)
460{ 460{
461 pci_unregister_driver(&gx1fb_driver); 461 pci_unregister_driver(&gx1fb_driver);
462} 462}
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index b4f19db9bb5..19f0c1add74 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -40,7 +40,7 @@ static int vram;
40static int vt_switch; 40static int vt_switch;
41 41
42/* Modes relevant to the GX (taken from modedb.c) */ 42/* Modes relevant to the GX (taken from modedb.c) */
43static struct fb_videomode gx_modedb[] __devinitdata = { 43static struct fb_videomode gx_modedb[] = {
44 /* 640x480-60 VESA */ 44 /* 640x480-60 VESA */
45 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, 45 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
46 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 46 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
@@ -110,15 +110,14 @@ static struct fb_videomode gx_modedb[] __devinitdata = {
110#ifdef CONFIG_OLPC 110#ifdef CONFIG_OLPC
111#include <asm/olpc.h> 111#include <asm/olpc.h>
112 112
113static struct fb_videomode gx_dcon_modedb[] __devinitdata = { 113static struct fb_videomode gx_dcon_modedb[] = {
114 /* The only mode the DCON has is 1200x900 */ 114 /* The only mode the DCON has is 1200x900 */
115 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, 115 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
116 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 116 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
117 FB_VMODE_NONINTERLACED, 0 } 117 FB_VMODE_NONINTERLACED, 0 }
118}; 118};
119 119
120static void __devinit get_modedb(struct fb_videomode **modedb, 120static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
121 unsigned int *size)
122{ 121{
123 if (olpc_has_dcon()) { 122 if (olpc_has_dcon()) {
124 *modedb = (struct fb_videomode *) gx_dcon_modedb; 123 *modedb = (struct fb_videomode *) gx_dcon_modedb;
@@ -130,8 +129,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
130} 129}
131 130
132#else 131#else
133static void __devinit get_modedb(struct fb_videomode **modedb, 132static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
134 unsigned int *size)
135{ 133{
136 *modedb = (struct fb_videomode *) gx_modedb; 134 *modedb = (struct fb_videomode *) gx_modedb;
137 *size = ARRAY_SIZE(gx_modedb); 135 *size = ARRAY_SIZE(gx_modedb);
@@ -228,8 +226,7 @@ static int gxfb_blank(int blank_mode, struct fb_info *info)
228 return gx_blank_display(info, blank_mode); 226 return gx_blank_display(info, blank_mode);
229} 227}
230 228
231static int __devinit gxfb_map_video_memory(struct fb_info *info, 229static int gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
232 struct pci_dev *dev)
233{ 230{
234 struct gxfb_par *par = info->par; 231 struct gxfb_par *par = info->par;
235 int ret; 232 int ret;
@@ -293,7 +290,7 @@ static struct fb_ops gxfb_ops = {
293 .fb_imageblit = cfb_imageblit, 290 .fb_imageblit = cfb_imageblit,
294}; 291};
295 292
296static struct fb_info *__devinit gxfb_init_fbinfo(struct device *dev) 293static struct fb_info *gxfb_init_fbinfo(struct device *dev)
297{ 294{
298 struct gxfb_par *par; 295 struct gxfb_par *par;
299 struct fb_info *info; 296 struct fb_info *info;
@@ -374,8 +371,7 @@ static int gxfb_resume(struct pci_dev *pdev)
374} 371}
375#endif 372#endif
376 373
377static int __devinit gxfb_probe(struct pci_dev *pdev, 374static int gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
378 const struct pci_device_id *id)
379{ 375{
380 struct gxfb_par *par; 376 struct gxfb_par *par;
381 struct fb_info *info; 377 struct fb_info *info;
@@ -455,7 +451,7 @@ static int __devinit gxfb_probe(struct pci_dev *pdev,
455 return ret; 451 return ret;
456} 452}
457 453
458static void __devexit gxfb_remove(struct pci_dev *pdev) 454static void gxfb_remove(struct pci_dev *pdev)
459{ 455{
460 struct fb_info *info = pci_get_drvdata(pdev); 456 struct fb_info *info = pci_get_drvdata(pdev);
461 struct gxfb_par *par = info->par; 457 struct gxfb_par *par = info->par;
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 416851ca875..4dd7b556696 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -35,7 +35,7 @@ static int vt_switch;
35 * we try to make it something sane - 640x480-60 is sane 35 * we try to make it something sane - 640x480-60 is sane
36 */ 36 */
37 37
38static struct fb_videomode geode_modedb[] __devinitdata = { 38static struct fb_videomode geode_modedb[] = {
39 /* 640x480-60 */ 39 /* 640x480-60 */
40 { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2, 40 { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2,
41 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 41 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
@@ -219,15 +219,14 @@ static struct fb_videomode geode_modedb[] __devinitdata = {
219#ifdef CONFIG_OLPC 219#ifdef CONFIG_OLPC
220#include <asm/olpc.h> 220#include <asm/olpc.h>
221 221
222static struct fb_videomode olpc_dcon_modedb[] __devinitdata = { 222static struct fb_videomode olpc_dcon_modedb[] = {
223 /* The only mode the DCON has is 1200x900 */ 223 /* The only mode the DCON has is 1200x900 */
224 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, 224 { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
225 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 225 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
226 FB_VMODE_NONINTERLACED, 0 } 226 FB_VMODE_NONINTERLACED, 0 }
227}; 227};
228 228
229static void __devinit get_modedb(struct fb_videomode **modedb, 229static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
230 unsigned int *size)
231{ 230{
232 if (olpc_has_dcon()) { 231 if (olpc_has_dcon()) {
233 *modedb = (struct fb_videomode *) olpc_dcon_modedb; 232 *modedb = (struct fb_videomode *) olpc_dcon_modedb;
@@ -239,8 +238,7 @@ static void __devinit get_modedb(struct fb_videomode **modedb,
239} 238}
240 239
241#else 240#else
242static void __devinit get_modedb(struct fb_videomode **modedb, 241static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
243 unsigned int *size)
244{ 242{
245 *modedb = (struct fb_videomode *) geode_modedb; 243 *modedb = (struct fb_videomode *) geode_modedb;
246 *size = ARRAY_SIZE(geode_modedb); 244 *size = ARRAY_SIZE(geode_modedb);
@@ -336,8 +334,7 @@ static int lxfb_blank(int blank_mode, struct fb_info *info)
336} 334}
337 335
338 336
339static int __devinit lxfb_map_video_memory(struct fb_info *info, 337static int lxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
340 struct pci_dev *dev)
341{ 338{
342 struct lxfb_par *par = info->par; 339 struct lxfb_par *par = info->par;
343 int ret; 340 int ret;
@@ -414,7 +411,7 @@ static struct fb_ops lxfb_ops = {
414 .fb_imageblit = cfb_imageblit, 411 .fb_imageblit = cfb_imageblit,
415}; 412};
416 413
417static struct fb_info * __devinit lxfb_init_fbinfo(struct device *dev) 414static struct fb_info *lxfb_init_fbinfo(struct device *dev)
418{ 415{
419 struct lxfb_par *par; 416 struct lxfb_par *par;
420 struct fb_info *info; 417 struct fb_info *info;
@@ -498,8 +495,7 @@ static int lxfb_resume(struct pci_dev *pdev)
498#define lxfb_resume NULL 495#define lxfb_resume NULL
499#endif 496#endif
500 497
501static int __devinit lxfb_probe(struct pci_dev *pdev, 498static int lxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
502 const struct pci_device_id *id)
503{ 499{
504 struct lxfb_par *par; 500 struct lxfb_par *par;
505 struct fb_info *info; 501 struct fb_info *info;
@@ -590,7 +586,7 @@ err:
590 return ret; 586 return ret;
591} 587}
592 588
593static void __devexit lxfb_remove(struct pci_dev *pdev) 589static void lxfb_remove(struct pci_dev *pdev)
594{ 590{
595 struct fb_info *info = pci_get_drvdata(pdev); 591 struct fb_info *info = pci_get_drvdata(pdev);
596 struct lxfb_par *par = info->par; 592 struct lxfb_par *par = info->par;
diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c
index 5245f9a7189..861109e7de1 100644
--- a/drivers/video/grvga.c
+++ b/drivers/video/grvga.c
@@ -70,7 +70,7 @@ static const struct fb_videomode grvga_modedb[] = {
70 } 70 }
71 }; 71 };
72 72
73static struct fb_fix_screeninfo grvga_fix __devinitdata = { 73static struct fb_fix_screeninfo grvga_fix = {
74 .id = "AG SVGACTRL", 74 .id = "AG SVGACTRL",
75 .type = FB_TYPE_PACKED_PIXELS, 75 .type = FB_TYPE_PACKED_PIXELS,
76 .visual = FB_VISUAL_PSEUDOCOLOR, 76 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -267,8 +267,8 @@ static struct fb_ops grvga_ops = {
267 .fb_imageblit = cfb_imageblit 267 .fb_imageblit = cfb_imageblit
268}; 268};
269 269
270static int __devinit grvga_parse_custom(char *options, 270static int grvga_parse_custom(char *options,
271 struct fb_var_screeninfo *screendata) 271 struct fb_var_screeninfo *screendata)
272{ 272{
273 char *this_opt; 273 char *this_opt;
274 int count = 0; 274 int count = 0;
@@ -329,7 +329,7 @@ static int __devinit grvga_parse_custom(char *options,
329 return 0; 329 return 0;
330} 330}
331 331
332static int __devinit grvga_probe(struct platform_device *dev) 332static int grvga_probe(struct platform_device *dev)
333{ 333{
334 struct fb_info *info; 334 struct fb_info *info;
335 int retval = -ENOMEM; 335 int retval = -ENOMEM;
@@ -512,7 +512,7 @@ free_fb:
512 return retval; 512 return retval;
513} 513}
514 514
515static int __devexit grvga_remove(struct platform_device *device) 515static int grvga_remove(struct platform_device *device)
516{ 516{
517 struct fb_info *info = dev_get_drvdata(&device->dev); 517 struct fb_info *info = dev_get_drvdata(&device->dev);
518 struct grvga_par *par = info->par; 518 struct grvga_par *par = info->par;
@@ -554,7 +554,7 @@ static struct platform_driver grvga_driver = {
554 .of_match_table = svgactrl_of_match, 554 .of_match_table = svgactrl_of_match,
555 }, 555 },
556 .probe = grvga_probe, 556 .probe = grvga_probe,
557 .remove = __devexit_p(grvga_remove), 557 .remove = grvga_remove,
558}; 558};
559 559
560 560
diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
index 4bdea6e9bd5..c35663f6a54 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -159,7 +159,7 @@ struct gxt4500_par {
159static char *mode_option; 159static char *mode_option;
160 160
161/* default mode: 1280x1024 @ 60 Hz, 8 bpp */ 161/* default mode: 1280x1024 @ 60 Hz, 8 bpp */
162static const struct fb_videomode defaultmode __devinitconst = { 162static const struct fb_videomode defaultmode = {
163 .refresh = 60, 163 .refresh = 60,
164 .xres = 1280, 164 .xres = 1280,
165 .yres = 1024, 165 .yres = 1024,
@@ -588,7 +588,7 @@ static int gxt4500_blank(int blank, struct fb_info *info)
588 return 0; 588 return 0;
589} 589}
590 590
591static const struct fb_fix_screeninfo gxt4500_fix __devinitconst = { 591static const struct fb_fix_screeninfo gxt4500_fix = {
592 .id = "IBM GXT4500P", 592 .id = "IBM GXT4500P",
593 .type = FB_TYPE_PACKED_PIXELS, 593 .type = FB_TYPE_PACKED_PIXELS,
594 .visual = FB_VISUAL_PSEUDOCOLOR, 594 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -610,8 +610,7 @@ static struct fb_ops gxt4500_ops = {
610}; 610};
611 611
612/* PCI functions */ 612/* PCI functions */
613static int __devinit gxt4500_probe(struct pci_dev *pdev, 613static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
614 const struct pci_device_id *ent)
615{ 614{
616 int err; 615 int err;
617 unsigned long reg_phys, fb_phys; 616 unsigned long reg_phys, fb_phys;
@@ -720,7 +719,7 @@ static int __devinit gxt4500_probe(struct pci_dev *pdev,
720 return -ENODEV; 719 return -ENODEV;
721} 720}
722 721
723static void __devexit gxt4500_remove(struct pci_dev *pdev) 722static void gxt4500_remove(struct pci_dev *pdev)
724{ 723{
725 struct fb_info *info = pci_get_drvdata(pdev); 724 struct fb_info *info = pci_get_drvdata(pdev);
726 struct gxt4500_par *par; 725 struct gxt4500_par *par;
@@ -758,10 +757,10 @@ static struct pci_driver gxt4500_driver = {
758 .name = "gxt4500", 757 .name = "gxt4500",
759 .id_table = gxt4500_pci_tbl, 758 .id_table = gxt4500_pci_tbl,
760 .probe = gxt4500_probe, 759 .probe = gxt4500_probe,
761 .remove = __devexit_p(gxt4500_remove), 760 .remove = gxt4500_remove,
762}; 761};
763 762
764static int __devinit gxt4500_init(void) 763static int gxt4500_init(void)
765{ 764{
766#ifndef MODULE 765#ifndef MODULE
767 if (fb_get_options("gxt4500", &mode_option)) 766 if (fb_get_options("gxt4500", &mode_option))
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 614251a9af9..59d23181fdb 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -47,7 +47,7 @@
47#define DPY_W 600 47#define DPY_W 600
48#define DPY_H 800 48#define DPY_H 800
49 49
50static struct fb_fix_screeninfo hecubafb_fix __devinitdata = { 50static struct fb_fix_screeninfo hecubafb_fix = {
51 .id = "hecubafb", 51 .id = "hecubafb",
52 .type = FB_TYPE_PACKED_PIXELS, 52 .type = FB_TYPE_PACKED_PIXELS,
53 .visual = FB_VISUAL_MONO01, 53 .visual = FB_VISUAL_MONO01,
@@ -58,7 +58,7 @@ static struct fb_fix_screeninfo hecubafb_fix __devinitdata = {
58 .accel = FB_ACCEL_NONE, 58 .accel = FB_ACCEL_NONE,
59}; 59};
60 60
61static struct fb_var_screeninfo hecubafb_var __devinitdata = { 61static struct fb_var_screeninfo hecubafb_var = {
62 .xres = DPY_W, 62 .xres = DPY_W,
63 .yres = DPY_H, 63 .yres = DPY_H,
64 .xres_virtual = DPY_W, 64 .xres_virtual = DPY_W,
@@ -211,7 +211,7 @@ static struct fb_deferred_io hecubafb_defio = {
211 .deferred_io = hecubafb_dpy_deferred_io, 211 .deferred_io = hecubafb_dpy_deferred_io,
212}; 212};
213 213
214static int __devinit hecubafb_probe(struct platform_device *dev) 214static int hecubafb_probe(struct platform_device *dev)
215{ 215{
216 struct fb_info *info; 216 struct fb_info *info;
217 struct hecuba_board *board; 217 struct hecuba_board *board;
@@ -280,7 +280,7 @@ err_videomem_alloc:
280 return retval; 280 return retval;
281} 281}
282 282
283static int __devexit hecubafb_remove(struct platform_device *dev) 283static int hecubafb_remove(struct platform_device *dev)
284{ 284{
285 struct fb_info *info = platform_get_drvdata(dev); 285 struct fb_info *info = platform_get_drvdata(dev);
286 286
@@ -299,7 +299,7 @@ static int __devexit hecubafb_remove(struct platform_device *dev)
299 299
300static struct platform_driver hecubafb_driver = { 300static struct platform_driver hecubafb_driver = {
301 .probe = hecubafb_probe, 301 .probe = hecubafb_probe,
302 .remove = __devexit_p(hecubafb_remove), 302 .remove = hecubafb_remove,
303 .driver = { 303 .driver = {
304 .owner = THIS_MODULE, 304 .owner = THIS_MODULE,
305 .name = "hecubafb", 305 .name = "hecubafb",
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index c645f928265..1e9e2d819d1 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -106,7 +106,7 @@ static DEFINE_SPINLOCK(hga_reg_lock);
106 106
107/* Framebuffer driver structures */ 107/* Framebuffer driver structures */
108 108
109static struct fb_var_screeninfo hga_default_var __devinitdata = { 109static struct fb_var_screeninfo hga_default_var = {
110 .xres = 720, 110 .xres = 720,
111 .yres = 348, 111 .yres = 348,
112 .xres_virtual = 720, 112 .xres_virtual = 720,
@@ -120,7 +120,7 @@ static struct fb_var_screeninfo hga_default_var __devinitdata = {
120 .width = -1, 120 .width = -1,
121}; 121};
122 122
123static struct fb_fix_screeninfo hga_fix __devinitdata = { 123static struct fb_fix_screeninfo hga_fix = {
124 .id = "HGA", 124 .id = "HGA",
125 .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */ 125 .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */
126 .visual = FB_VISUAL_MONO10, 126 .visual = FB_VISUAL_MONO10,
@@ -276,7 +276,7 @@ static void hga_blank(int blank_mode)
276 spin_unlock_irqrestore(&hga_reg_lock, flags); 276 spin_unlock_irqrestore(&hga_reg_lock, flags);
277} 277}
278 278
279static int __devinit hga_card_detect(void) 279static int hga_card_detect(void)
280{ 280{
281 int count = 0; 281 int count = 0;
282 void __iomem *p, *q; 282 void __iomem *p, *q;
@@ -546,7 +546,7 @@ static struct fb_ops hgafb_ops = {
546 * Initialization 546 * Initialization
547 */ 547 */
548 548
549static int __devinit hgafb_probe(struct platform_device *pdev) 549static int hgafb_probe(struct platform_device *pdev)
550{ 550{
551 struct fb_info *info; 551 struct fb_info *info;
552 552
@@ -592,7 +592,7 @@ static int __devinit hgafb_probe(struct platform_device *pdev)
592 return 0; 592 return 0;
593} 593}
594 594
595static int __devexit hgafb_remove(struct platform_device *pdev) 595static int hgafb_remove(struct platform_device *pdev)
596{ 596{
597 struct fb_info *info = platform_get_drvdata(pdev); 597 struct fb_info *info = platform_get_drvdata(pdev);
598 598
@@ -617,7 +617,7 @@ static int __devexit hgafb_remove(struct platform_device *pdev)
617 617
618static struct platform_driver hgafb_driver = { 618static struct platform_driver hgafb_driver = {
619 .probe = hgafb_probe, 619 .probe = hgafb_probe,
620 .remove = __devexit_p(hgafb_remove), 620 .remove = hgafb_remove,
621 .driver = { 621 .driver = {
622 .name = "hgafb", 622 .name = "hgafb",
623 }, 623 },
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index cfb8d645101..c2414d6ab64 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -30,14 +30,14 @@
30 30
31#define WIDTH 640 31#define WIDTH 640
32 32
33static struct fb_var_screeninfo hitfb_var __devinitdata = { 33static struct fb_var_screeninfo hitfb_var = {
34 .activate = FB_ACTIVATE_NOW, 34 .activate = FB_ACTIVATE_NOW,
35 .height = -1, 35 .height = -1,
36 .width = -1, 36 .width = -1,
37 .vmode = FB_VMODE_NONINTERLACED, 37 .vmode = FB_VMODE_NONINTERLACED,
38}; 38};
39 39
40static struct fb_fix_screeninfo hitfb_fix __devinitdata = { 40static struct fb_fix_screeninfo hitfb_fix = {
41 .id = "Hitachi HD64461", 41 .id = "Hitachi HD64461",
42 .type = FB_TYPE_PACKED_PIXELS, 42 .type = FB_TYPE_PACKED_PIXELS,
43 .accel = FB_ACCEL_NONE, 43 .accel = FB_ACCEL_NONE,
@@ -324,7 +324,7 @@ static struct fb_ops hitfb_ops = {
324 .fb_imageblit = cfb_imageblit, 324 .fb_imageblit = cfb_imageblit,
325}; 325};
326 326
327static int __devinit hitfb_probe(struct platform_device *dev) 327static int hitfb_probe(struct platform_device *dev)
328{ 328{
329 unsigned short lcdclor, ldr3, ldvndr; 329 unsigned short lcdclor, ldr3, ldvndr;
330 struct fb_info *info; 330 struct fb_info *info;
@@ -417,7 +417,7 @@ err_fb:
417 return ret; 417 return ret;
418} 418}
419 419
420static int __devexit hitfb_remove(struct platform_device *dev) 420static int hitfb_remove(struct platform_device *dev)
421{ 421{
422 struct fb_info *info = platform_get_drvdata(dev); 422 struct fb_info *info = platform_get_drvdata(dev);
423 423
@@ -462,7 +462,7 @@ static const struct dev_pm_ops hitfb_dev_pm_ops = {
462 462
463static struct platform_driver hitfb_driver = { 463static struct platform_driver hitfb_driver = {
464 .probe = hitfb_probe, 464 .probe = hitfb_probe,
465 .remove = __devexit_p(hitfb_remove), 465 .remove = hitfb_remove,
466 .driver = { 466 .driver = {
467 .name = "hitfb", 467 .name = "hitfb",
468 .owner = THIS_MODULE, 468 .owner = THIS_MODULE,
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index 7324865f965..b802f93cef5 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -206,8 +206,7 @@ static struct fb_ops hpfb_ops = {
206#define HPFB_FBOMSB 0x5d /* Frame buffer offset */ 206#define HPFB_FBOMSB 0x5d /* Frame buffer offset */
207#define HPFB_FBOLSB 0x5f 207#define HPFB_FBOLSB 0x5f
208 208
209static int __devinit hpfb_init_one(unsigned long phys_base, 209static int hpfb_init_one(unsigned long phys_base, unsigned long virt_base)
210 unsigned long virt_base)
211{ 210{
212 unsigned long fboff, fb_width, fb_height, fb_start; 211 unsigned long fboff, fb_width, fb_height, fb_start;
213 int ret; 212 int ret;
@@ -327,7 +326,7 @@ unmap_screen_base:
327/* 326/*
328 * Initialise the framebuffer 327 * Initialise the framebuffer
329 */ 328 */
330static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_id * ent) 329static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
331{ 330{
332 unsigned long paddr, vaddr; 331 unsigned long paddr, vaddr;
333 332
@@ -350,7 +349,7 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_
350 return 0; 349 return 0;
351} 350}
352 351
353static void __devexit hpfb_remove_one(struct dio_dev *d) 352static void hpfb_remove_one(struct dio_dev *d)
354{ 353{
355 unregister_framebuffer(&fb_info); 354 unregister_framebuffer(&fb_info);
356 if (d->scode >= DIOII_SCBASE) 355 if (d->scode >= DIOII_SCBASE)
@@ -373,7 +372,7 @@ static struct dio_driver hpfb_driver = {
373 .name = "hpfb", 372 .name = "hpfb",
374 .id_table = hpfb_dio_tbl, 373 .id_table = hpfb_dio_tbl,
375 .probe = hpfb_dio_probe, 374 .probe = hpfb_dio_probe,
376 .remove = __devexit_p(hpfb_remove_one), 375 .remove = hpfb_remove_one,
377}; 376};
378 377
379int __init hpfb_init(void) 378int __init hpfb_init(void)
diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
index ff3f8808e4e..cfd0c52e8f7 100644
--- a/drivers/video/i740fb.c
+++ b/drivers/video/i740fb.c
@@ -33,10 +33,10 @@
33 33
34#include "i740_reg.h" 34#include "i740_reg.h"
35 35
36static char *mode_option __devinitdata; 36static char *mode_option;
37 37
38#ifdef CONFIG_MTRR 38#ifdef CONFIG_MTRR
39static int mtrr __devinitdata = 1; 39static int mtrr = 1;
40#endif 40#endif
41 41
42struct i740fb_par { 42struct i740fb_par {
@@ -91,7 +91,7 @@ struct i740fb_par {
91#define DACSPEED24_SD 128 91#define DACSPEED24_SD 128
92#define DACSPEED32 86 92#define DACSPEED32 86
93 93
94static struct fb_fix_screeninfo i740fb_fix __devinitdata = { 94static struct fb_fix_screeninfo i740fb_fix = {
95 .id = "i740fb", 95 .id = "i740fb",
96 .type = FB_TYPE_PACKED_PIXELS, 96 .type = FB_TYPE_PACKED_PIXELS,
97 .visual = FB_VISUAL_TRUECOLOR, 97 .visual = FB_VISUAL_TRUECOLOR,
@@ -163,7 +163,7 @@ static int i740fb_ddc_getsda(void *data)
163 return !!(i740inreg(par, XRX, REG_DDC_STATE) & DDC_SDA); 163 return !!(i740inreg(par, XRX, REG_DDC_STATE) & DDC_SDA);
164} 164}
165 165
166static int __devinit i740fb_setup_ddc_bus(struct fb_info *info) 166static int i740fb_setup_ddc_bus(struct fb_info *info)
167{ 167{
168 struct i740fb_par *par = info->par; 168 struct i740fb_par *par = info->par;
169 169
@@ -1007,8 +1007,7 @@ static struct fb_ops i740fb_ops = {
1007 1007
1008/* ------------------------------------------------------------------------- */ 1008/* ------------------------------------------------------------------------- */
1009 1009
1010static int __devinit i740fb_probe(struct pci_dev *dev, 1010static int i740fb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1011 const struct pci_device_id *ent)
1012{ 1011{
1013 struct fb_info *info; 1012 struct fb_info *info;
1014 struct i740fb_par *par; 1013 struct i740fb_par *par;
@@ -1174,7 +1173,7 @@ err_enable_device:
1174 return ret; 1173 return ret;
1175} 1174}
1176 1175
1177static void __devexit i740fb_remove(struct pci_dev *dev) 1176static void i740fb_remove(struct pci_dev *dev)
1178{ 1177{
1179 struct fb_info *info = pci_get_drvdata(dev); 1178 struct fb_info *info = pci_get_drvdata(dev);
1180 1179
@@ -1275,7 +1274,7 @@ static struct pci_driver i740fb_driver = {
1275 .name = "i740fb", 1274 .name = "i740fb",
1276 .id_table = i740fb_id_table, 1275 .id_table = i740fb_id_table,
1277 .probe = i740fb_probe, 1276 .probe = i740fb_probe,
1278 .remove = __devexit_p(i740fb_remove), 1277 .remove = i740fb_remove,
1279 .suspend = i740fb_suspend, 1278 .suspend = i740fb_suspend,
1280 .resume = i740fb_resume, 1279 .resume = i740fb_resume,
1281}; 1280};
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 5c067816a81..4ce3438ade6 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -74,12 +74,12 @@
74 * 74 *
75 * Experiment with v_offset to find out which works best for you. 75 * Experiment with v_offset to find out which works best for you.
76 */ 76 */
77static u32 v_offset_default __devinitdata; /* For 32 MiB Aper size, 8 should be the default */ 77static u32 v_offset_default; /* For 32 MiB Aper size, 8 should be the default */
78static u32 voffset __devinitdata; 78static u32 voffset;
79 79
80static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor); 80static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
81static int __devinit i810fb_init_pci (struct pci_dev *dev, 81static int i810fb_init_pci(struct pci_dev *dev,
82 const struct pci_device_id *entry); 82 const struct pci_device_id *entry);
83static void __exit i810fb_remove_pci(struct pci_dev *dev); 83static void __exit i810fb_remove_pci(struct pci_dev *dev);
84static int i810fb_resume(struct pci_dev *dev); 84static int i810fb_resume(struct pci_dev *dev);
85static int i810fb_suspend(struct pci_dev *dev, pm_message_t state); 85static int i810fb_suspend(struct pci_dev *dev, pm_message_t state);
@@ -97,7 +97,7 @@ static int i810fb_blank (int blank_mode, struct fb_info *info);
97static void i810fb_release_resource (struct fb_info *info, struct i810fb_par *par); 97static void i810fb_release_resource (struct fb_info *info, struct i810fb_par *par);
98 98
99/* PCI */ 99/* PCI */
100static const char * const i810_pci_list[] __devinitconst = { 100static const char * const i810_pci_list[] = {
101 "Intel(R) 810 Framebuffer Device" , 101 "Intel(R) 810 Framebuffer Device" ,
102 "Intel(R) 810-DC100 Framebuffer Device" , 102 "Intel(R) 810-DC100 Framebuffer Device" ,
103 "Intel(R) 810E Framebuffer Device" , 103 "Intel(R) 810E Framebuffer Device" ,
@@ -132,22 +132,22 @@ static struct pci_driver i810fb_driver = {
132 .resume = i810fb_resume, 132 .resume = i810fb_resume,
133}; 133};
134 134
135static char *mode_option __devinitdata = NULL; 135static char *mode_option = NULL;
136static int vram __devinitdata = 4; 136static int vram = 4;
137static int bpp __devinitdata = 8; 137static int bpp = 8;
138static bool mtrr __devinitdata; 138static bool mtrr;
139static bool accel __devinitdata; 139static bool accel;
140static int hsync1 __devinitdata; 140static int hsync1;
141static int hsync2 __devinitdata; 141static int hsync2;
142static int vsync1 __devinitdata; 142static int vsync1;
143static int vsync2 __devinitdata; 143static int vsync2;
144static int xres __devinitdata; 144static int xres;
145static int yres; 145static int yres;
146static int vyres __devinitdata; 146static int vyres;
147static bool sync __devinitdata; 147static bool sync;
148static bool extvga __devinitdata; 148static bool extvga;
149static bool dcolor __devinitdata; 149static bool dcolor;
150static bool ddc3 __devinitdata; 150static bool ddc3;
151 151
152/*------------------------------------------------------------*/ 152/*------------------------------------------------------------*/
153 153
@@ -1541,7 +1541,7 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1541 return 0; 1541 return 0;
1542} 1542}
1543 1543
1544static struct fb_ops i810fb_ops __devinitdata = { 1544static struct fb_ops i810fb_ops = {
1545 .owner = THIS_MODULE, 1545 .owner = THIS_MODULE,
1546 .fb_open = i810fb_open, 1546 .fb_open = i810fb_open,
1547 .fb_release = i810fb_release, 1547 .fb_release = i810fb_release,
@@ -1628,7 +1628,7 @@ fail:
1628 * AGP resource allocation * 1628 * AGP resource allocation *
1629 ***********************************************************************/ 1629 ***********************************************************************/
1630 1630
1631static void __devinit i810_fix_pointers(struct i810fb_par *par) 1631static void i810_fix_pointers(struct i810fb_par *par)
1632{ 1632{
1633 par->fb.physical = par->aperture.physical+(par->fb.offset << 12); 1633 par->fb.physical = par->aperture.physical+(par->fb.offset << 12);
1634 par->fb.virtual = par->aperture.virtual+(par->fb.offset << 12); 1634 par->fb.virtual = par->aperture.virtual+(par->fb.offset << 12);
@@ -1640,7 +1640,7 @@ static void __devinit i810_fix_pointers(struct i810fb_par *par)
1640 (par->cursor_heap.offset << 12); 1640 (par->cursor_heap.offset << 12);
1641} 1641}
1642 1642
1643static void __devinit i810_fix_offsets(struct i810fb_par *par) 1643static void i810_fix_offsets(struct i810fb_par *par)
1644{ 1644{
1645 if (vram + 1 > par->aperture.size >> 20) 1645 if (vram + 1 > par->aperture.size >> 20)
1646 vram = (par->aperture.size >> 20) - 1; 1646 vram = (par->aperture.size >> 20) - 1;
@@ -1660,7 +1660,7 @@ static void __devinit i810_fix_offsets(struct i810fb_par *par)
1660 par->cursor_heap.size = 4096; 1660 par->cursor_heap.size = 4096;
1661} 1661}
1662 1662
1663static int __devinit i810_alloc_agp_mem(struct fb_info *info) 1663static int i810_alloc_agp_mem(struct fb_info *info)
1664{ 1664{
1665 struct i810fb_par *par = info->par; 1665 struct i810fb_par *par = info->par;
1666 int size; 1666 int size;
@@ -1723,7 +1723,7 @@ static int __devinit i810_alloc_agp_mem(struct fb_info *info)
1723 * Sets the user monitor's horizontal and vertical 1723 * Sets the user monitor's horizontal and vertical
1724 * frequency limits 1724 * frequency limits
1725 */ 1725 */
1726static void __devinit i810_init_monspecs(struct fb_info *info) 1726static void i810_init_monspecs(struct fb_info *info)
1727{ 1727{
1728 if (!hsync1) 1728 if (!hsync1)
1729 hsync1 = HFMIN; 1729 hsync1 = HFMIN;
@@ -1755,8 +1755,7 @@ static void __devinit i810_init_monspecs(struct fb_info *info)
1755 * @par: pointer to i810fb_par structure 1755 * @par: pointer to i810fb_par structure
1756 * @info: pointer to current fb_info structure 1756 * @info: pointer to current fb_info structure
1757 */ 1757 */
1758static void __devinit i810_init_defaults(struct i810fb_par *par, 1758static void i810_init_defaults(struct i810fb_par *par, struct fb_info *info)
1759 struct fb_info *info)
1760{ 1759{
1761 mutex_init(&par->open_lock); 1760 mutex_init(&par->open_lock);
1762 1761
@@ -1812,7 +1811,7 @@ static void __devinit i810_init_defaults(struct i810fb_par *par,
1812 * i810_init_device - initialize device 1811 * i810_init_device - initialize device
1813 * @par: pointer to i810fb_par structure 1812 * @par: pointer to i810fb_par structure
1814 */ 1813 */
1815static void __devinit i810_init_device(struct i810fb_par *par) 1814static void i810_init_device(struct i810fb_par *par)
1816{ 1815{
1817 u8 reg; 1816 u8 reg;
1818 u8 __iomem *mmio = par->mmio_start_virtual; 1817 u8 __iomem *mmio = par->mmio_start_virtual;
@@ -1833,9 +1832,8 @@ static void __devinit i810_init_device(struct i810fb_par *par)
1833 1832
1834} 1833}
1835 1834
1836static int __devinit 1835static int i810_allocate_pci_resource(struct i810fb_par *par,
1837i810_allocate_pci_resource(struct i810fb_par *par, 1836 const struct pci_device_id *entry)
1838 const struct pci_device_id *entry)
1839{ 1837{
1840 int err; 1838 int err;
1841 1839
@@ -1892,7 +1890,7 @@ i810_allocate_pci_resource(struct i810fb_par *par,
1892 return 0; 1890 return 0;
1893} 1891}
1894 1892
1895static void __devinit i810fb_find_init_mode(struct fb_info *info) 1893static void i810fb_find_init_mode(struct fb_info *info)
1896{ 1894{
1897 struct fb_videomode mode; 1895 struct fb_videomode mode;
1898 struct fb_var_screeninfo var; 1896 struct fb_var_screeninfo var;
@@ -1956,7 +1954,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
1956} 1954}
1957 1955
1958#ifndef MODULE 1956#ifndef MODULE
1959static int __devinit i810fb_setup(char *options) 1957static int i810fb_setup(char *options)
1960{ 1958{
1961 char *this_opt, *suffix = NULL; 1959 char *this_opt, *suffix = NULL;
1962 1960
@@ -2007,8 +2005,8 @@ static int __devinit i810fb_setup(char *options)
2007} 2005}
2008#endif 2006#endif
2009 2007
2010static int __devinit i810fb_init_pci (struct pci_dev *dev, 2008static int i810fb_init_pci(struct pci_dev *dev,
2011 const struct pci_device_id *entry) 2009 const struct pci_device_id *entry)
2012{ 2010{
2013 struct fb_info *info; 2011 struct fb_info *info;
2014 struct i810fb_par *par = NULL; 2012 struct i810fb_par *par = NULL;
@@ -2136,7 +2134,7 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev)
2136} 2134}
2137 2135
2138#ifndef MODULE 2136#ifndef MODULE
2139static int __devinit i810fb_init(void) 2137static int i810fb_init(void)
2140{ 2138{
2141 char *option = NULL; 2139 char *option = NULL;
2142 2140
@@ -2154,7 +2152,7 @@ static int __devinit i810fb_init(void)
2154 2152
2155#ifdef MODULE 2153#ifdef MODULE
2156 2154
2157static int __devinit i810fb_init(void) 2155static int i810fb_init(void)
2158{ 2156{
2159 hsync1 *= 1000; 2157 hsync1 *= 1000;
2160 hsync2 *= 1000; 2158 hsync2 *= 1000;
diff --git a/drivers/video/i810/i810_main.h b/drivers/video/i810/i810_main.h
index 51d4f3d4116..a25afaa534b 100644
--- a/drivers/video/i810/i810_main.h
+++ b/drivers/video/i810/i810_main.h
@@ -64,7 +64,7 @@ static inline void flush_cache(void)
64 64
65#include <asm/mtrr.h> 65#include <asm/mtrr.h>
66 66
67static inline void __devinit set_mtrr(struct i810fb_par *par) 67static inline void set_mtrr(struct i810fb_par *par)
68{ 68{
69 par->mtrr_reg = mtrr_add((u32) par->aperture.physical, 69 par->mtrr_reg = mtrr_add((u32) par->aperture.physical,
70 par->aperture.size, MTRR_TYPE_WRCOMB, 1); 70 par->aperture.size, MTRR_TYPE_WRCOMB, 1);
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c
index 2d97752f79a..79cbfa7d1a9 100644
--- a/drivers/video/igafb.c
+++ b/drivers/video/igafb.c
@@ -571,7 +571,7 @@ static int __init igafb_setup(char *options)
571 571
572module_init(igafb_init); 572module_init(igafb_init);
573MODULE_LICENSE("GPL"); 573MODULE_LICENSE("GPL");
574static struct pci_device_id igafb_pci_tbl[] __devinitdata = { 574static struct pci_device_id igafb_pci_tbl[] = {
575 { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, 575 { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
576 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 576 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
577 { } 577 { }
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 8149356471e..d5220cc90e9 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -225,7 +225,7 @@ struct initvalues {
225 __u8 addr, value; 225 __u8 addr, value;
226}; 226};
227 227
228static struct initvalues ibm_initregs[] __devinitdata = { 228static struct initvalues ibm_initregs[] = {
229 { CLKCTL, 0x21 }, 229 { CLKCTL, 0x21 },
230 { SYNCCTL, 0x00 }, 230 { SYNCCTL, 0x00 },
231 { HSYNCPOS, 0x00 }, 231 { HSYNCPOS, 0x00 },
@@ -272,7 +272,7 @@ static struct initvalues ibm_initregs[] __devinitdata = {
272 { KEYCTL, 0x00 } 272 { KEYCTL, 0x00 }
273}; 273};
274 274
275static struct initvalues tvp_initregs[] __devinitdata = { 275static struct initvalues tvp_initregs[] = {
276 { TVPIRICC, 0x00 }, 276 { TVPIRICC, 0x00 },
277 { TVPIRBRC, 0xe4 }, 277 { TVPIRBRC, 0xe4 },
278 { TVPIRLAC, 0x06 }, 278 { TVPIRLAC, 0x06 },
@@ -336,7 +336,7 @@ enum {
336static int inverse = 0; 336static int inverse = 0;
337static char fontname[40] __initdata = { 0 }; 337static char fontname[40] __initdata = { 0 };
338#if defined(CONFIG_PPC) 338#if defined(CONFIG_PPC)
339static signed char init_vmode __devinitdata = -1, init_cmode __devinitdata = -1; 339static signed char init_vmode = -1, init_cmode = -1;
340#endif 340#endif
341 341
342static struct imstt_regvals tvp_reg_init_2 = { 342static struct imstt_regvals tvp_reg_init_2 = {
@@ -1333,7 +1333,7 @@ static struct pci_driver imsttfb_pci_driver = {
1333 .name = "imsttfb", 1333 .name = "imsttfb",
1334 .id_table = imsttfb_pci_tbl, 1334 .id_table = imsttfb_pci_tbl,
1335 .probe = imsttfb_probe, 1335 .probe = imsttfb_probe,
1336 .remove = __devexit_p(imsttfb_remove), 1336 .remove = imsttfb_remove,
1337}; 1337};
1338 1338
1339static struct fb_ops imsttfb_ops = { 1339static struct fb_ops imsttfb_ops = {
@@ -1349,8 +1349,7 @@ static struct fb_ops imsttfb_ops = {
1349 .fb_ioctl = imsttfb_ioctl, 1349 .fb_ioctl = imsttfb_ioctl,
1350}; 1350};
1351 1351
1352static void __devinit 1352static void init_imstt(struct fb_info *info)
1353init_imstt(struct fb_info *info)
1354{ 1353{
1355 struct imstt_par *par = info->par; 1354 struct imstt_par *par = info->par;
1356 __u32 i, tmp, *ip, *end; 1355 __u32 i, tmp, *ip, *end;
@@ -1466,8 +1465,7 @@ init_imstt(struct fb_info *info)
1466 info->node, info->fix.id, info->fix.smem_len >> 20, tmp); 1465 info->node, info->fix.id, info->fix.smem_len >> 20, tmp);
1467} 1466}
1468 1467
1469static int __devinit 1468static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1470imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1471{ 1469{
1472 unsigned long addr, size; 1470 unsigned long addr, size;
1473 struct imstt_par *par; 1471 struct imstt_par *par;
@@ -1534,8 +1532,7 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1534 return 0; 1532 return 0;
1535} 1533}
1536 1534
1537static void __devexit 1535static void imsttfb_remove(struct pci_dev *pdev)
1538imsttfb_remove(struct pci_dev *pdev)
1539{ 1536{
1540 struct fb_info *info = pci_get_drvdata(pdev); 1537 struct fb_info *info = pci_get_drvdata(pdev);
1541 struct imstt_par *par = info->par; 1538 struct imstt_par *par = info->par;
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index e501dbc966b..12526787a7c 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -917,7 +917,7 @@ failed_init:
917 return ret; 917 return ret;
918} 918}
919 919
920static int __devexit imxfb_remove(struct platform_device *pdev) 920static int imxfb_remove(struct platform_device *pdev)
921{ 921{
922 struct imx_fb_platform_data *pdata; 922 struct imx_fb_platform_data *pdata;
923 struct fb_info *info = platform_get_drvdata(pdev); 923 struct fb_info *info = platform_get_drvdata(pdev);
@@ -959,7 +959,7 @@ void imxfb_shutdown(struct platform_device * dev)
959static struct platform_driver imxfb_driver = { 959static struct platform_driver imxfb_driver = {
960 .suspend = imxfb_suspend, 960 .suspend = imxfb_suspend,
961 .resume = imxfb_resume, 961 .resume = imxfb_resume,
962 .remove = __devexit_p(imxfb_remove), 962 .remove = imxfb_remove,
963 .shutdown = imxfb_shutdown, 963 .shutdown = imxfb_shutdown,
964 .driver = { 964 .driver = {
965 .name = DRIVER_NAME, 965 .name = DRIVER_NAME,
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index bdcbfbae277..8209e46c5d2 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -132,7 +132,7 @@
132#include "intelfbhw.h" 132#include "intelfbhw.h"
133#include "../edid.h" 133#include "../edid.h"
134 134
135static void __devinit get_initial_mode(struct intelfb_info *dinfo); 135static void get_initial_mode(struct intelfb_info *dinfo);
136static void update_dinfo(struct intelfb_info *dinfo, 136static void update_dinfo(struct intelfb_info *dinfo,
137 struct fb_var_screeninfo *var); 137 struct fb_var_screeninfo *var);
138static int intelfb_open(struct fb_info *info, int user); 138static int intelfb_open(struct fb_info *info, int user);
@@ -162,10 +162,10 @@ static int intelfb_sync(struct fb_info *info);
162static int intelfb_ioctl(struct fb_info *info, 162static int intelfb_ioctl(struct fb_info *info,
163 unsigned int cmd, unsigned long arg); 163 unsigned int cmd, unsigned long arg);
164 164
165static int __devinit intelfb_pci_register(struct pci_dev *pdev, 165static int intelfb_pci_register(struct pci_dev *pdev,
166 const struct pci_device_id *ent); 166 const struct pci_device_id *ent);
167static void __devexit intelfb_pci_unregister(struct pci_dev *pdev); 167static void intelfb_pci_unregister(struct pci_dev *pdev);
168static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo); 168static int intelfb_set_fbinfo(struct intelfb_info *dinfo);
169 169
170/* 170/*
171 * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the 171 * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the
@@ -177,7 +177,7 @@ static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo);
177#define INTELFB_CLASS_MASK 0 177#define INTELFB_CLASS_MASK 0
178#endif 178#endif
179 179
180static struct pci_device_id intelfb_pci_table[] __devinitdata = { 180static struct pci_device_id intelfb_pci_table[] = {
181 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_830M, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_830M }, 181 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_830M, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_830M },
182 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G }, 182 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G },
183 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM }, 183 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM },
@@ -219,7 +219,7 @@ static struct pci_driver intelfb_driver = {
219 .name = "intelfb", 219 .name = "intelfb",
220 .id_table = intelfb_pci_table, 220 .id_table = intelfb_pci_table,
221 .probe = intelfb_pci_register, 221 .probe = intelfb_pci_register,
222 .remove = __devexit_p(intelfb_pci_unregister) 222 .remove = intelfb_pci_unregister,
223}; 223};
224 224
225/* Module description/parameters */ 225/* Module description/parameters */
@@ -415,7 +415,7 @@ module_exit(intelfb_exit);
415 ***************************************************************/ 415 ***************************************************************/
416 416
417#ifdef CONFIG_MTRR 417#ifdef CONFIG_MTRR
418static inline void __devinit set_mtrr(struct intelfb_info *dinfo) 418static inline void set_mtrr(struct intelfb_info *dinfo)
419{ 419{
420 dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical, 420 dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical,
421 dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1); 421 dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1);
@@ -497,8 +497,8 @@ static void cleanup(struct intelfb_info *dinfo)
497} while (0) 497} while (0)
498 498
499 499
500static int __devinit intelfb_pci_register(struct pci_dev *pdev, 500static int intelfb_pci_register(struct pci_dev *pdev,
501 const struct pci_device_id *ent) 501 const struct pci_device_id *ent)
502{ 502{
503 struct fb_info *info; 503 struct fb_info *info;
504 struct intelfb_info *dinfo; 504 struct intelfb_info *dinfo;
@@ -921,8 +921,7 @@ err_out_cmap:
921 return -ENODEV; 921 return -ENODEV;
922} 922}
923 923
924static void __devexit 924static void intelfb_pci_unregister(struct pci_dev *pdev)
925intelfb_pci_unregister(struct pci_dev *pdev)
926{ 925{
927 struct intelfb_info *dinfo = pci_get_drvdata(pdev); 926 struct intelfb_info *dinfo = pci_get_drvdata(pdev);
928 927
@@ -970,7 +969,7 @@ static __inline__ int var_to_refresh(const struct fb_var_screeninfo *var)
970 * Various intialisation functions * 969 * Various intialisation functions *
971 ***************************************************************/ 970 ***************************************************************/
972 971
973static void __devinit get_initial_mode(struct intelfb_info *dinfo) 972static void get_initial_mode(struct intelfb_info *dinfo)
974{ 973{
975 struct fb_var_screeninfo *var; 974 struct fb_var_screeninfo *var;
976 int xtot, ytot; 975 int xtot, ytot;
@@ -1037,7 +1036,7 @@ static void __devinit get_initial_mode(struct intelfb_info *dinfo)
1037 } 1036 }
1038} 1037}
1039 1038
1040static int __devinit intelfb_init_var(struct intelfb_info *dinfo) 1039static int intelfb_init_var(struct intelfb_info *dinfo)
1041{ 1040{
1042 struct fb_var_screeninfo *var; 1041 struct fb_var_screeninfo *var;
1043 int msrc = 0; 1042 int msrc = 0;
@@ -1118,7 +1117,7 @@ static int __devinit intelfb_init_var(struct intelfb_info *dinfo)
1118 return 0; 1117 return 0;
1119} 1118}
1120 1119
1121static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo) 1120static int intelfb_set_fbinfo(struct intelfb_info *dinfo)
1122{ 1121{
1123 struct fb_info *info = dinfo->info; 1122 struct fb_info *info = dinfo->info;
1124 1123
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
index 4d25711b998..d999bb5e048 100644
--- a/drivers/video/jz4740_fb.c
+++ b/drivers/video/jz4740_fb.c
@@ -136,7 +136,7 @@ struct jzfb {
136 uint32_t pseudo_palette[16]; 136 uint32_t pseudo_palette[16];
137}; 137};
138 138
139static const struct fb_fix_screeninfo jzfb_fix __devinitconst = { 139static const struct fb_fix_screeninfo jzfb_fix = {
140 .id = "JZ4740 FB", 140 .id = "JZ4740 FB",
141 .type = FB_TYPE_PACKED_PIXELS, 141 .type = FB_TYPE_PACKED_PIXELS,
142 .visual = FB_VISUAL_TRUECOLOR, 142 .visual = FB_VISUAL_TRUECOLOR,
@@ -619,7 +619,7 @@ static struct fb_ops jzfb_ops = {
619 .fb_setcolreg = jzfb_setcolreg, 619 .fb_setcolreg = jzfb_setcolreg,
620}; 620};
621 621
622static int __devinit jzfb_probe(struct platform_device *pdev) 622static int jzfb_probe(struct platform_device *pdev)
623{ 623{
624 int ret; 624 int ret;
625 struct jzfb *jzfb; 625 struct jzfb *jzfb;
@@ -725,7 +725,7 @@ err_framebuffer_release:
725 return ret; 725 return ret;
726} 726}
727 727
728static int __devexit jzfb_remove(struct platform_device *pdev) 728static int jzfb_remove(struct platform_device *pdev)
729{ 729{
730 struct jzfb *jzfb = platform_get_drvdata(pdev); 730 struct jzfb *jzfb = platform_get_drvdata(pdev);
731 731
@@ -794,7 +794,7 @@ static const struct dev_pm_ops jzfb_pm_ops = {
794 794
795static struct platform_driver jzfb_driver = { 795static struct platform_driver jzfb_driver = {
796 .probe = jzfb_probe, 796 .probe = jzfb_probe,
797 .remove = __devexit_p(jzfb_remove), 797 .remove = jzfb_remove,
798 .driver = { 798 .driver = {
799 .name = "jz4740-fb", 799 .name = "jz4740-fb",
800 .pm = JZFB_PM_OPS, 800 .pm = JZFB_PM_OPS,
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index acb9370fdb1..6157f74ac60 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -40,14 +40,14 @@
40#define KHZ2PICOS(a) (1000000000UL/(a)) 40#define KHZ2PICOS(a) (1000000000UL/(a))
41 41
42/****************************************************************************/ 42/****************************************************************************/
43static struct fb_fix_screeninfo kyro_fix __devinitdata = { 43static struct fb_fix_screeninfo kyro_fix = {
44 .id = "ST Kyro", 44 .id = "ST Kyro",
45 .type = FB_TYPE_PACKED_PIXELS, 45 .type = FB_TYPE_PACKED_PIXELS,
46 .visual = FB_VISUAL_TRUECOLOR, 46 .visual = FB_VISUAL_TRUECOLOR,
47 .accel = FB_ACCEL_NONE, 47 .accel = FB_ACCEL_NONE,
48}; 48};
49 49
50static struct fb_var_screeninfo kyro_var __devinitdata = { 50static struct fb_var_screeninfo kyro_var = {
51 /* 640x480, 16bpp @ 60 Hz */ 51 /* 640x480, 16bpp @ 60 Hz */
52 .xres = 640, 52 .xres = 640,
53 .yres = 480, 53 .yres = 480,
@@ -81,18 +81,18 @@ typedef struct {
81/* global graphics card info structure (one per card) */ 81/* global graphics card info structure (one per card) */
82static device_info_t deviceInfo; 82static device_info_t deviceInfo;
83 83
84static char *mode_option __devinitdata = NULL; 84static char *mode_option = NULL;
85static int nopan __devinitdata = 0; 85static int nopan = 0;
86static int nowrap __devinitdata = 1; 86static int nowrap = 1;
87#ifdef CONFIG_MTRR 87#ifdef CONFIG_MTRR
88static int nomtrr __devinitdata = 0; 88static int nomtrr = 0;
89#endif 89#endif
90 90
91/* PCI driver prototypes */ 91/* PCI driver prototypes */
92static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent); 92static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
93static void kyrofb_remove(struct pci_dev *pdev); 93static void kyrofb_remove(struct pci_dev *pdev);
94 94
95static struct fb_videomode kyro_modedb[] __devinitdata = { 95static struct fb_videomode kyro_modedb[] = {
96 { 96 {
97 /* 640x350 @ 85Hz */ 97 /* 640x350 @ 85Hz */
98 NULL, 85, 640, 350, KHZ2PICOS(31500), 98 NULL, 85, 640, 350, KHZ2PICOS(31500),
@@ -653,7 +653,7 @@ static struct pci_driver kyrofb_pci_driver = {
653 .name = "kyrofb", 653 .name = "kyrofb",
654 .id_table = kyrofb_pci_tbl, 654 .id_table = kyrofb_pci_tbl,
655 .probe = kyrofb_probe, 655 .probe = kyrofb_probe,
656 .remove = __devexit_p(kyrofb_remove), 656 .remove = kyrofb_remove,
657}; 657};
658 658
659static struct fb_ops kyrofb_ops = { 659static struct fb_ops kyrofb_ops = {
@@ -667,8 +667,7 @@ static struct fb_ops kyrofb_ops = {
667 .fb_imageblit = cfb_imageblit, 667 .fb_imageblit = cfb_imageblit,
668}; 668};
669 669
670static int __devinit kyrofb_probe(struct pci_dev *pdev, 670static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
671 const struct pci_device_id *ent)
672{ 671{
673 struct fb_info *info; 672 struct fb_info *info;
674 struct kyrofb_info *currentpar; 673 struct kyrofb_info *currentpar;
@@ -754,7 +753,7 @@ out_unmap:
754 return -EINVAL; 753 return -EINVAL;
755} 754}
756 755
757static void __devexit kyrofb_remove(struct pci_dev *pdev) 756static void kyrofb_remove(struct pci_dev *pdev)
758{ 757{
759 struct fb_info *info = pci_get_drvdata(pdev); 758 struct fb_info *info = pci_get_drvdata(pdev);
760 struct kyrofb_info *par = info->par; 759 struct kyrofb_info *par = info->par;
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 9e946e2c1da..b17f5009a43 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -547,7 +547,7 @@ static void leo_unmap_regs(struct platform_device *op, struct fb_info *info,
547 of_iounmap(&op->resource[0], info->screen_base, 0x800000); 547 of_iounmap(&op->resource[0], info->screen_base, 0x800000);
548} 548}
549 549
550static int __devinit leo_probe(struct platform_device *op) 550static int leo_probe(struct platform_device *op)
551{ 551{
552 struct device_node *dp = op->dev.of_node; 552 struct device_node *dp = op->dev.of_node;
553 struct fb_info *info; 553 struct fb_info *info;
@@ -636,7 +636,7 @@ out_err:
636 return err; 636 return err;
637} 637}
638 638
639static int __devexit leo_remove(struct platform_device *op) 639static int leo_remove(struct platform_device *op)
640{ 640{
641 struct fb_info *info = dev_get_drvdata(&op->dev); 641 struct fb_info *info = dev_get_drvdata(&op->dev);
642 struct leo_par *par = info->par; 642 struct leo_par *par = info->par;
@@ -668,7 +668,7 @@ static struct platform_driver leo_driver = {
668 .of_match_table = leo_match, 668 .of_match_table = leo_match,
669 }, 669 },
670 .probe = leo_probe, 670 .probe = leo_probe,
671 .remove = __devexit_p(leo_remove), 671 .remove = leo_remove,
672}; 672};
673 673
674static int __init leo_init(void) 674static int __init leo_init(void)
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index d68e332aa21..91c59c9fb08 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -668,7 +668,7 @@ static int mb862xx_gdc_init(struct mb862xxfb_par *par)
668 return 0; 668 return 0;
669} 669}
670 670
671static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev) 671static int of_platform_mb862xx_probe(struct platform_device *ofdev)
672{ 672{
673 struct device_node *np = ofdev->dev.of_node; 673 struct device_node *np = ofdev->dev.of_node;
674 struct device *dev = &ofdev->dev; 674 struct device *dev = &ofdev->dev;
@@ -786,7 +786,7 @@ fbrel:
786 return ret; 786 return ret;
787} 787}
788 788
789static int __devexit of_platform_mb862xx_remove(struct platform_device *ofdev) 789static int of_platform_mb862xx_remove(struct platform_device *ofdev)
790{ 790{
791 struct fb_info *fbi = dev_get_drvdata(&ofdev->dev); 791 struct fb_info *fbi = dev_get_drvdata(&ofdev->dev);
792 struct mb862xxfb_par *par = fbi->par; 792 struct mb862xxfb_par *par = fbi->par;
@@ -823,7 +823,7 @@ static int __devexit of_platform_mb862xx_remove(struct platform_device *ofdev)
823/* 823/*
824 * common types 824 * common types
825 */ 825 */
826static struct of_device_id __devinitdata of_platform_mb862xx_tbl[] = { 826static struct of_device_id of_platform_mb862xx_tbl[] = {
827 { .compatible = "fujitsu,MB86276", }, 827 { .compatible = "fujitsu,MB86276", },
828 { .compatible = "fujitsu,lime", }, 828 { .compatible = "fujitsu,lime", },
829 { .compatible = "fujitsu,MB86277", }, 829 { .compatible = "fujitsu,MB86277", },
@@ -841,7 +841,7 @@ static struct platform_driver of_platform_mb862xxfb_driver = {
841 .of_match_table = of_platform_mb862xx_tbl, 841 .of_match_table = of_platform_mb862xx_tbl,
842 }, 842 },
843 .probe = of_platform_mb862xx_probe, 843 .probe = of_platform_mb862xx_probe,
844 .remove = __devexit_p(of_platform_mb862xx_remove), 844 .remove = of_platform_mb862xx_remove,
845}; 845};
846#endif 846#endif
847 847
@@ -984,7 +984,7 @@ static inline int mb862xx_pci_gdc_init(struct mb862xxfb_par *par)
984#define CHIP_ID(id) \ 984#define CHIP_ID(id) \
985 { PCI_DEVICE(PCI_VENDOR_ID_FUJITSU_LIMITED, id) } 985 { PCI_DEVICE(PCI_VENDOR_ID_FUJITSU_LIMITED, id) }
986 986
987static struct pci_device_id mb862xx_pci_tbl[] __devinitdata = { 987static struct pci_device_id mb862xx_pci_tbl[] = {
988 /* MB86295/MB86296 */ 988 /* MB86295/MB86296 */
989 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALP), 989 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALP),
990 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALPA), 990 CHIP_ID(PCI_DEVICE_ID_FUJITSU_CORALPA),
@@ -995,8 +995,8 @@ static struct pci_device_id mb862xx_pci_tbl[] __devinitdata = {
995 995
996MODULE_DEVICE_TABLE(pci, mb862xx_pci_tbl); 996MODULE_DEVICE_TABLE(pci, mb862xx_pci_tbl);
997 997
998static int __devinit mb862xx_pci_probe(struct pci_dev *pdev, 998static int mb862xx_pci_probe(struct pci_dev *pdev,
999 const struct pci_device_id *ent) 999 const struct pci_device_id *ent)
1000{ 1000{
1001 struct mb862xxfb_par *par; 1001 struct mb862xxfb_par *par;
1002 struct fb_info *info; 1002 struct fb_info *info;
@@ -1133,7 +1133,7 @@ out:
1133 return ret; 1133 return ret;
1134} 1134}
1135 1135
1136static void __devexit mb862xx_pci_remove(struct pci_dev *pdev) 1136static void mb862xx_pci_remove(struct pci_dev *pdev)
1137{ 1137{
1138 struct fb_info *fbi = pci_get_drvdata(pdev); 1138 struct fb_info *fbi = pci_get_drvdata(pdev);
1139 struct mb862xxfb_par *par = fbi->par; 1139 struct mb862xxfb_par *par = fbi->par;
@@ -1174,11 +1174,11 @@ static struct pci_driver mb862xxfb_pci_driver = {
1174 .name = DRV_NAME, 1174 .name = DRV_NAME,
1175 .id_table = mb862xx_pci_tbl, 1175 .id_table = mb862xx_pci_tbl,
1176 .probe = mb862xx_pci_probe, 1176 .probe = mb862xx_pci_probe,
1177 .remove = __devexit_p(mb862xx_pci_remove), 1177 .remove = mb862xx_pci_remove,
1178}; 1178};
1179#endif 1179#endif
1180 1180
1181static int __devinit mb862xxfb_init(void) 1181static int mb862xxfb_init(void)
1182{ 1182{
1183 int ret = -ENODEV; 1183 int ret = -ENODEV;
1184 1184
diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c
index 12dec7634c5..4449f249b0e 100644
--- a/drivers/video/mbx/mbxdebugfs.c
+++ b/drivers/video/mbx/mbxdebugfs.c
@@ -213,7 +213,7 @@ static const struct file_operations misc_fops = {
213 .llseek = default_llseek, 213 .llseek = default_llseek,
214}; 214};
215 215
216static void __devinit mbxfb_debugfs_init(struct fb_info *fbi) 216static void mbxfb_debugfs_init(struct fb_info *fbi)
217{ 217{
218 struct mbxfb_info *mfbi = fbi->par; 218 struct mbxfb_info *mfbi = fbi->par;
219 struct mbxfb_debugfs_data *dbg; 219 struct mbxfb_debugfs_data *dbg;
@@ -236,7 +236,7 @@ static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
236 fbi, &misc_fops); 236 fbi, &misc_fops);
237} 237}
238 238
239static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi) 239static void mbxfb_debugfs_remove(struct fb_info *fbi)
240{ 240{
241 struct mbxfb_info *mfbi = fbi->par; 241 struct mbxfb_info *mfbi = fbi->par;
242 struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data; 242 struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data;
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index 6563e50413c..0c1a874ffd2 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -79,7 +79,7 @@ struct mbxfb_info {
79 79
80}; 80};
81 81
82static struct fb_var_screeninfo mbxfb_default __devinitdata = { 82static struct fb_var_screeninfo mbxfb_default = {
83 .xres = 640, 83 .xres = 640,
84 .yres = 480, 84 .yres = 480,
85 .xres_virtual = 640, 85 .xres_virtual = 640,
@@ -102,7 +102,7 @@ static struct fb_var_screeninfo mbxfb_default __devinitdata = {
102 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 102 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
103}; 103};
104 104
105static struct fb_fix_screeninfo mbxfb_fix __devinitdata = { 105static struct fb_fix_screeninfo mbxfb_fix = {
106 .id = "MBX", 106 .id = "MBX",
107 .type = FB_TYPE_PACKED_PIXELS, 107 .type = FB_TYPE_PACKED_PIXELS,
108 .visual = FB_VISUAL_TRUECOLOR, 108 .visual = FB_VISUAL_TRUECOLOR,
@@ -687,7 +687,7 @@ static struct fb_ops mbxfb_ops = {
687 Enable external SDRAM controller. Assume that all clocks are active 687 Enable external SDRAM controller. Assume that all clocks are active
688 by now. 688 by now.
689*/ 689*/
690static void __devinit setup_memc(struct fb_info *fbi) 690static void setup_memc(struct fb_info *fbi)
691{ 691{
692 unsigned long tmp; 692 unsigned long tmp;
693 int i; 693 int i;
@@ -747,7 +747,7 @@ static void enable_clocks(struct fb_info *fbi)
747 write_reg_dly(0x00000001, PIXCLKDIV); 747 write_reg_dly(0x00000001, PIXCLKDIV);
748} 748}
749 749
750static void __devinit setup_graphics(struct fb_info *fbi) 750static void setup_graphics(struct fb_info *fbi)
751{ 751{
752 unsigned long gsctrl; 752 unsigned long gsctrl;
753 unsigned long vscadr; 753 unsigned long vscadr;
@@ -781,7 +781,7 @@ static void __devinit setup_graphics(struct fb_info *fbi)
781 write_reg_dly(vscadr, VSCADR); 781 write_reg_dly(vscadr, VSCADR);
782} 782}
783 783
784static void __devinit setup_display(struct fb_info *fbi) 784static void setup_display(struct fb_info *fbi)
785{ 785{
786 unsigned long dsctrl = 0; 786 unsigned long dsctrl = 0;
787 787
@@ -795,7 +795,7 @@ static void __devinit setup_display(struct fb_info *fbi)
795 write_reg_dly((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL); 795 write_reg_dly((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
796} 796}
797 797
798static void __devinit enable_controller(struct fb_info *fbi) 798static void enable_controller(struct fb_info *fbi)
799{ 799{
800 u32 svctrl, shctrl; 800 u32 svctrl, shctrl;
801 801
@@ -881,7 +881,7 @@ static int mbxfb_resume(struct platform_device *dev)
881 881
882#define res_size(_r) (((_r)->end - (_r)->start) + 1) 882#define res_size(_r) (((_r)->end - (_r)->start) + 1)
883 883
884static int __devinit mbxfb_probe(struct platform_device *dev) 884static int mbxfb_probe(struct platform_device *dev)
885{ 885{
886 int ret; 886 int ret;
887 struct fb_info *fbi; 887 struct fb_info *fbi;
@@ -1006,7 +1006,7 @@ err1:
1006 return ret; 1006 return ret;
1007} 1007}
1008 1008
1009static int __devexit mbxfb_remove(struct platform_device *dev) 1009static int mbxfb_remove(struct platform_device *dev)
1010{ 1010{
1011 struct fb_info *fbi = platform_get_drvdata(dev); 1011 struct fb_info *fbi = platform_get_drvdata(dev);
1012 1012
@@ -1038,7 +1038,7 @@ static int __devexit mbxfb_remove(struct platform_device *dev)
1038 1038
1039static struct platform_driver mbxfb_driver = { 1039static struct platform_driver mbxfb_driver = {
1040 .probe = mbxfb_probe, 1040 .probe = mbxfb_probe,
1041 .remove = __devexit_p(mbxfb_remove), 1041 .remove = mbxfb_remove,
1042 .suspend = mbxfb_suspend, 1042 .suspend = mbxfb_suspend,
1043 .resume = mbxfb_resume, 1043 .resume = mbxfb_resume,
1044 .driver = { 1044 .driver = {
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index 97d45e5115e..f30150d71be 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -99,7 +99,7 @@ static struct epd_frame epd_frame_table[] = {
99 }, 99 },
100}; 100};
101 101
102static struct fb_fix_screeninfo metronomefb_fix __devinitdata = { 102static struct fb_fix_screeninfo metronomefb_fix = {
103 .id = "metronomefb", 103 .id = "metronomefb",
104 .type = FB_TYPE_PACKED_PIXELS, 104 .type = FB_TYPE_PACKED_PIXELS,
105 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR, 105 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR,
@@ -110,7 +110,7 @@ static struct fb_fix_screeninfo metronomefb_fix __devinitdata = {
110 .accel = FB_ACCEL_NONE, 110 .accel = FB_ACCEL_NONE,
111}; 111};
112 112
113static struct fb_var_screeninfo metronomefb_var __devinitdata = { 113static struct fb_var_screeninfo metronomefb_var = {
114 .xres = DPY_W, 114 .xres = DPY_W,
115 .yres = DPY_H, 115 .yres = DPY_H,
116 .xres_virtual = DPY_W, 116 .xres_virtual = DPY_W,
@@ -167,8 +167,8 @@ static u16 calc_img_cksum(u16 *start, int length)
167} 167}
168 168
169/* here we decode the incoming waveform file and populate metromem */ 169/* here we decode the incoming waveform file and populate metromem */
170static int __devinit load_waveform(u8 *mem, size_t size, int m, int t, 170static int load_waveform(u8 *mem, size_t size, int m, int t,
171 struct metronomefb_par *par) 171 struct metronomefb_par *par)
172{ 172{
173 int tta; 173 int tta;
174 int wmta; 174 int wmta;
@@ -338,7 +338,7 @@ static int metronome_display_cmd(struct metronomefb_par *par)
338 return par->board->met_wait_event_intr(par); 338 return par->board->met_wait_event_intr(par);
339} 339}
340 340
341static int __devinit metronome_powerup_cmd(struct metronomefb_par *par) 341static int metronome_powerup_cmd(struct metronomefb_par *par)
342{ 342{
343 int i; 343 int i;
344 u16 cs; 344 u16 cs;
@@ -367,7 +367,7 @@ static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
367 return par->board->met_wait_event(par); 367 return par->board->met_wait_event(par);
368} 368}
369 369
370static int __devinit metronome_config_cmd(struct metronomefb_par *par) 370static int metronome_config_cmd(struct metronomefb_par *par)
371{ 371{
372 /* setup config command 372 /* setup config command
373 we can't immediately set the opcode since the controller 373 we can't immediately set the opcode since the controller
@@ -385,7 +385,7 @@ static int __devinit metronome_config_cmd(struct metronomefb_par *par)
385 return par->board->met_wait_event(par); 385 return par->board->met_wait_event(par);
386} 386}
387 387
388static int __devinit metronome_init_cmd(struct metronomefb_par *par) 388static int metronome_init_cmd(struct metronomefb_par *par)
389{ 389{
390 int i; 390 int i;
391 u16 cs; 391 u16 cs;
@@ -411,7 +411,7 @@ static int __devinit metronome_init_cmd(struct metronomefb_par *par)
411 return par->board->met_wait_event(par); 411 return par->board->met_wait_event(par);
412} 412}
413 413
414static int __devinit metronome_init_regs(struct metronomefb_par *par) 414static int metronome_init_regs(struct metronomefb_par *par)
415{ 415{
416 int res; 416 int res;
417 417
@@ -569,7 +569,7 @@ static struct fb_deferred_io metronomefb_defio = {
569 .deferred_io = metronomefb_dpy_deferred_io, 569 .deferred_io = metronomefb_dpy_deferred_io,
570}; 570};
571 571
572static int __devinit metronomefb_probe(struct platform_device *dev) 572static int metronomefb_probe(struct platform_device *dev)
573{ 573{
574 struct fb_info *info; 574 struct fb_info *info;
575 struct metronome_board *board; 575 struct metronome_board *board;
@@ -741,7 +741,7 @@ err:
741 return retval; 741 return retval;
742} 742}
743 743
744static int __devexit metronomefb_remove(struct platform_device *dev) 744static int metronomefb_remove(struct platform_device *dev)
745{ 745{
746 struct fb_info *info = platform_get_drvdata(dev); 746 struct fb_info *info = platform_get_drvdata(dev);
747 747
@@ -763,7 +763,7 @@ static int __devexit metronomefb_remove(struct platform_device *dev)
763 763
764static struct platform_driver metronomefb_driver = { 764static struct platform_driver metronomefb_driver = {
765 .probe = metronomefb_probe, 765 .probe = metronomefb_probe,
766 .remove = __devexit_p(metronomefb_remove), 766 .remove = metronomefb_remove,
767 .driver = { 767 .driver = {
768 .owner = THIS_MODULE, 768 .owner = THIS_MODULE,
769 .name = "metronomefb", 769 .name = "metronomefb",
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index 35ac9e8bee6..e0f8011a3c4 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -417,7 +417,7 @@ static void mddi_resume(struct msm_mddi_client_data *cdata)
417 mddi_set_auto_hibernate(&mddi->client_data, 1); 417 mddi_set_auto_hibernate(&mddi->client_data, 1);
418} 418}
419 419
420static int __devinit mddi_get_client_caps(struct mddi_info *mddi) 420static int mddi_get_client_caps(struct mddi_info *mddi)
421{ 421{
422 int i, j; 422 int i, j;
423 423
@@ -619,9 +619,8 @@ uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg)
619 619
620static struct mddi_info mddi_info[2]; 620static struct mddi_info mddi_info[2];
621 621
622static int __devinit mddi_clk_setup(struct platform_device *pdev, 622static int mddi_clk_setup(struct platform_device *pdev, struct mddi_info *mddi,
623 struct mddi_info *mddi, 623 unsigned long clk_rate)
624 unsigned long clk_rate)
625{ 624{
626 int ret; 625 int ret;
627 626
@@ -664,7 +663,7 @@ static int __init mddi_rev_data_setup(struct mddi_info *mddi)
664 return 0; 663 return 0;
665} 664}
666 665
667static int __devinit mddi_probe(struct platform_device *pdev) 666static int mddi_probe(struct platform_device *pdev)
668{ 667{
669 struct msm_mddi_platform_data *pdata = pdev->dev.platform_data; 668 struct msm_mddi_platform_data *pdata = pdev->dev.platform_data;
670 struct mddi_info *mddi = &mddi_info[pdev->id]; 669 struct mddi_info *mddi = &mddi_info[pdev->id];
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 49619b44150..755556ca5b2 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -369,7 +369,8 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
369 loop--; 369 loop--;
370 } 370 }
371 371
372 writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR); 372 reg = readl(host->base + LCDC_VDCTRL4);
373 writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
373 374
374 clk_disable_unprepare(host->clk); 375 clk_disable_unprepare(host->clk);
375 376
@@ -586,7 +587,7 @@ static struct fb_ops mxsfb_ops = {
586 .fb_imageblit = cfb_imageblit, 587 .fb_imageblit = cfb_imageblit,
587}; 588};
588 589
589static int __devinit mxsfb_restore_mode(struct mxsfb_info *host) 590static int mxsfb_restore_mode(struct mxsfb_info *host)
590{ 591{
591 struct fb_info *fb_info = &host->fb_info; 592 struct fb_info *fb_info = &host->fb_info;
592 unsigned line_count; 593 unsigned line_count;
@@ -677,7 +678,7 @@ static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
677 return 0; 678 return 0;
678} 679}
679 680
680static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host) 681static int mxsfb_init_fbinfo(struct mxsfb_info *host)
681{ 682{
682 struct fb_info *fb_info = &host->fb_info; 683 struct fb_info *fb_info = &host->fb_info;
683 struct fb_var_screeninfo *var = &fb_info->var; 684 struct fb_var_screeninfo *var = &fb_info->var;
@@ -739,7 +740,7 @@ static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host)
739 return 0; 740 return 0;
740} 741}
741 742
742static void __devexit mxsfb_free_videomem(struct mxsfb_info *host) 743static void mxsfb_free_videomem(struct mxsfb_info *host)
743{ 744{
744 struct fb_info *fb_info = &host->fb_info; 745 struct fb_info *fb_info = &host->fb_info;
745 746
@@ -772,7 +773,7 @@ static const struct of_device_id mxsfb_dt_ids[] = {
772}; 773};
773MODULE_DEVICE_TABLE(of, mxsfb_dt_ids); 774MODULE_DEVICE_TABLE(of, mxsfb_dt_ids);
774 775
775static int __devinit mxsfb_probe(struct platform_device *pdev) 776static int mxsfb_probe(struct platform_device *pdev)
776{ 777{
777 const struct of_device_id *of_id = 778 const struct of_device_id *of_id =
778 of_match_device(mxsfb_dt_ids, &pdev->dev); 779 of_match_device(mxsfb_dt_ids, &pdev->dev);
@@ -912,7 +913,7 @@ error_alloc_info:
912 return ret; 913 return ret;
913} 914}
914 915
915static int __devexit mxsfb_remove(struct platform_device *pdev) 916static int mxsfb_remove(struct platform_device *pdev)
916{ 917{
917 struct fb_info *fb_info = platform_get_drvdata(pdev); 918 struct fb_info *fb_info = platform_get_drvdata(pdev);
918 struct mxsfb_info *host = to_imxfb_host(fb_info); 919 struct mxsfb_info *host = to_imxfb_host(fb_info);
@@ -949,7 +950,7 @@ static void mxsfb_shutdown(struct platform_device *pdev)
949 950
950static struct platform_driver mxsfb_driver = { 951static struct platform_driver mxsfb_driver = {
951 .probe = mxsfb_probe, 952 .probe = mxsfb_probe,
952 .remove = __devexit_p(mxsfb_remove), 953 .remove = mxsfb_remove,
953 .shutdown = mxsfb_shutdown, 954 .shutdown = mxsfb_shutdown,
954 .id_table = mxsfb_devtype, 955 .id_table = mxsfb_devtype,
955 .driver = { 956 .driver = {
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index afc9521173e..7ef079c146e 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -88,7 +88,7 @@ static bool external;
88static bool libretto; 88static bool libretto;
89static bool nostretch; 89static bool nostretch;
90static bool nopciburst; 90static bool nopciburst;
91static char *mode_option __devinitdata = NULL; 91static char *mode_option = NULL;
92 92
93#ifdef MODULE 93#ifdef MODULE
94 94
@@ -1632,7 +1632,7 @@ static struct fb_ops neofb_ops = {
1632 1632
1633/* --------------------------------------------------------------------- */ 1633/* --------------------------------------------------------------------- */
1634 1634
1635static struct fb_videomode __devinitdata mode800x480 = { 1635static struct fb_videomode mode800x480 = {
1636 .xres = 800, 1636 .xres = 800,
1637 .yres = 480, 1637 .yres = 480,
1638 .pixclock = 25000, 1638 .pixclock = 25000,
@@ -1646,8 +1646,7 @@ static struct fb_videomode __devinitdata mode800x480 = {
1646 .vmode = FB_VMODE_NONINTERLACED 1646 .vmode = FB_VMODE_NONINTERLACED
1647}; 1647};
1648 1648
1649static int __devinit neo_map_mmio(struct fb_info *info, 1649static int neo_map_mmio(struct fb_info *info, struct pci_dev *dev)
1650 struct pci_dev *dev)
1651{ 1650{
1652 struct neofb_par *par = info->par; 1651 struct neofb_par *par = info->par;
1653 1652
@@ -1707,8 +1706,8 @@ static void neo_unmap_mmio(struct fb_info *info)
1707 info->fix.mmio_len); 1706 info->fix.mmio_len);
1708} 1707}
1709 1708
1710static int __devinit neo_map_video(struct fb_info *info, 1709static int neo_map_video(struct fb_info *info, struct pci_dev *dev,
1711 struct pci_dev *dev, int video_len) 1710 int video_len)
1712{ 1711{
1713 //unsigned long addr; 1712 //unsigned long addr;
1714 1713
@@ -1772,7 +1771,7 @@ static void neo_unmap_video(struct fb_info *info)
1772 info->fix.smem_len); 1771 info->fix.smem_len);
1773} 1772}
1774 1773
1775static int __devinit neo_scan_monitor(struct fb_info *info) 1774static int neo_scan_monitor(struct fb_info *info)
1776{ 1775{
1777 struct neofb_par *par = info->par; 1776 struct neofb_par *par = info->par;
1778 unsigned char type, display; 1777 unsigned char type, display;
@@ -1851,7 +1850,7 @@ static int __devinit neo_scan_monitor(struct fb_info *info)
1851 return 0; 1850 return 0;
1852} 1851}
1853 1852
1854static int __devinit neo_init_hw(struct fb_info *info) 1853static int neo_init_hw(struct fb_info *info)
1855{ 1854{
1856 struct neofb_par *par = info->par; 1855 struct neofb_par *par = info->par;
1857 int videoRam = 896; 1856 int videoRam = 896;
@@ -1939,8 +1938,8 @@ static int __devinit neo_init_hw(struct fb_info *info)
1939} 1938}
1940 1939
1941 1940
1942static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const struct 1941static struct fb_info *neo_alloc_fb_info(struct pci_dev *dev,
1943 pci_device_id *id) 1942 const struct pci_device_id *id)
1944{ 1943{
1945 struct fb_info *info; 1944 struct fb_info *info;
1946 struct neofb_par *par; 1945 struct neofb_par *par;
@@ -2038,8 +2037,7 @@ static void neo_free_fb_info(struct fb_info *info)
2038 2037
2039/* --------------------------------------------------------------------- */ 2038/* --------------------------------------------------------------------- */
2040 2039
2041static int __devinit neofb_probe(struct pci_dev *dev, 2040static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id)
2042 const struct pci_device_id *id)
2043{ 2041{
2044 struct fb_info *info; 2042 struct fb_info *info;
2045 u_int h_sync, v_sync; 2043 u_int h_sync, v_sync;
@@ -2128,7 +2126,7 @@ err_map_mmio:
2128 return err; 2126 return err;
2129} 2127}
2130 2128
2131static void __devexit neofb_remove(struct pci_dev *dev) 2129static void neofb_remove(struct pci_dev *dev)
2132{ 2130{
2133 struct fb_info *info = pci_get_drvdata(dev); 2131 struct fb_info *info = pci_get_drvdata(dev);
2134 2132
@@ -2194,7 +2192,7 @@ static struct pci_driver neofb_driver = {
2194 .name = "neofb", 2192 .name = "neofb",
2195 .id_table = neofb_devices, 2193 .id_table = neofb_devices,
2196 .probe = neofb_probe, 2194 .probe = neofb_probe,
2197 .remove = __devexit_p(neofb_remove) 2195 .remove = neofb_remove,
2198}; 2196};
2199 2197
2200/* ************************* init in-kernel code ************************** */ 2198/* ************************* init in-kernel code ************************** */
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index 475dfee82c4..32581c72ad0 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -387,7 +387,7 @@ static int nuc900fb_init_registers(struct fb_info *info)
387 * The buffer should be a non-cached, non-buffered, memory region 387 * The buffer should be a non-cached, non-buffered, memory region
388 * to allow palette and pixel writes without flushing the cache. 388 * to allow palette and pixel writes without flushing the cache.
389 */ 389 */
390static int __devinit nuc900fb_map_video_memory(struct fb_info *info) 390static int nuc900fb_map_video_memory(struct fb_info *info)
391{ 391{
392 struct nuc900fb_info *fbi = info->par; 392 struct nuc900fb_info *fbi = info->par;
393 dma_addr_t map_dma; 393 dma_addr_t map_dma;
@@ -499,7 +499,7 @@ static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *info)
499 499
500static char driver_name[] = "nuc900fb"; 500static char driver_name[] = "nuc900fb";
501 501
502static int __devinit nuc900fb_probe(struct platform_device *pdev) 502static int nuc900fb_probe(struct platform_device *pdev)
503{ 503{
504 struct nuc900fb_info *fbi; 504 struct nuc900fb_info *fbi;
505 struct nuc900fb_display *display; 505 struct nuc900fb_display *display;
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index fe13ac567d5..ff228713425 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -70,34 +70,34 @@ static struct pci_device_id nvidiafb_pci_tbl[] = {
70MODULE_DEVICE_TABLE(pci, nvidiafb_pci_tbl); 70MODULE_DEVICE_TABLE(pci, nvidiafb_pci_tbl);
71 71
72/* command line data, set in nvidiafb_setup() */ 72/* command line data, set in nvidiafb_setup() */
73static int flatpanel __devinitdata = -1; /* Autodetect later */ 73static int flatpanel = -1; /* Autodetect later */
74static int fpdither __devinitdata = -1; 74static int fpdither = -1;
75static int forceCRTC __devinitdata = -1; 75static int forceCRTC = -1;
76static int hwcur __devinitdata = 0; 76static int hwcur = 0;
77static int noaccel __devinitdata = 0; 77static int noaccel = 0;
78static int noscale __devinitdata = 0; 78static int noscale = 0;
79static int paneltweak __devinitdata = 0; 79static int paneltweak = 0;
80static int vram __devinitdata = 0; 80static int vram = 0;
81static int bpp __devinitdata = 8; 81static int bpp = 8;
82static int reverse_i2c __devinitdata; 82static int reverse_i2c;
83#ifdef CONFIG_MTRR 83#ifdef CONFIG_MTRR
84static bool nomtrr __devinitdata = false; 84static bool nomtrr = false;
85#endif 85#endif
86#ifdef CONFIG_PMAC_BACKLIGHT 86#ifdef CONFIG_PMAC_BACKLIGHT
87static int backlight __devinitdata = 1; 87static int backlight = 1;
88#else 88#else
89static int backlight __devinitdata = 0; 89static int backlight = 0;
90#endif 90#endif
91 91
92static char *mode_option __devinitdata = NULL; 92static char *mode_option = NULL;
93 93
94static struct fb_fix_screeninfo __devinitdata nvidiafb_fix = { 94static struct fb_fix_screeninfo nvidiafb_fix = {
95 .type = FB_TYPE_PACKED_PIXELS, 95 .type = FB_TYPE_PACKED_PIXELS,
96 .xpanstep = 8, 96 .xpanstep = 8,
97 .ypanstep = 1, 97 .ypanstep = 1,
98}; 98};
99 99
100static struct fb_var_screeninfo __devinitdata nvidiafb_default_var = { 100static struct fb_var_screeninfo nvidiafb_default_var = {
101 .xres = 640, 101 .xres = 640,
102 .yres = 480, 102 .yres = 480,
103 .xres_virtual = 640, 103 .xres_virtual = 640,
@@ -1105,7 +1105,7 @@ fail:
1105#define nvidiafb_resume NULL 1105#define nvidiafb_resume NULL
1106#endif 1106#endif
1107 1107
1108static int __devinit nvidia_set_fbinfo(struct fb_info *info) 1108static int nvidia_set_fbinfo(struct fb_info *info)
1109{ 1109{
1110 struct fb_monspecs *specs = &info->monspecs; 1110 struct fb_monspecs *specs = &info->monspecs;
1111 struct fb_videomode modedb; 1111 struct fb_videomode modedb;
@@ -1201,7 +1201,7 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
1201 return nvidiafb_check_var(&info->var, info); 1201 return nvidiafb_check_var(&info->var, info);
1202} 1202}
1203 1203
1204static u32 __devinit nvidia_get_chipset(struct fb_info *info) 1204static u32 nvidia_get_chipset(struct fb_info *info)
1205{ 1205{
1206 struct nvidia_par *par = info->par; 1206 struct nvidia_par *par = info->par;
1207 u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device; 1207 u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device;
@@ -1224,7 +1224,7 @@ static u32 __devinit nvidia_get_chipset(struct fb_info *info)
1224 return id; 1224 return id;
1225} 1225}
1226 1226
1227static u32 __devinit nvidia_get_arch(struct fb_info *info) 1227static u32 nvidia_get_arch(struct fb_info *info)
1228{ 1228{
1229 struct nvidia_par *par = info->par; 1229 struct nvidia_par *par = info->par;
1230 u32 arch = 0; 1230 u32 arch = 0;
@@ -1276,8 +1276,7 @@ static u32 __devinit nvidia_get_arch(struct fb_info *info)
1276 return arch; 1276 return arch;
1277} 1277}
1278 1278
1279static int __devinit nvidiafb_probe(struct pci_dev *pd, 1279static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
1280 const struct pci_device_id *ent)
1281{ 1280{
1282 struct nvidia_par *par; 1281 struct nvidia_par *par;
1283 struct fb_info *info; 1282 struct fb_info *info;
@@ -1438,7 +1437,7 @@ err_out:
1438 return -ENODEV; 1437 return -ENODEV;
1439} 1438}
1440 1439
1441static void __devexit nvidiafb_remove(struct pci_dev *pd) 1440static void nvidiafb_remove(struct pci_dev *pd)
1442{ 1441{
1443 struct fb_info *info = pci_get_drvdata(pd); 1442 struct fb_info *info = pci_get_drvdata(pd);
1444 struct nvidia_par *par = info->par; 1443 struct nvidia_par *par = info->par;
@@ -1473,7 +1472,7 @@ static void __devexit nvidiafb_remove(struct pci_dev *pd)
1473 * ------------------------------------------------------------------------- */ 1472 * ------------------------------------------------------------------------- */
1474 1473
1475#ifndef MODULE 1474#ifndef MODULE
1476static int __devinit nvidiafb_setup(char *options) 1475static int nvidiafb_setup(char *options)
1477{ 1476{
1478 char *this_opt; 1477 char *this_opt;
1479 1478
@@ -1529,7 +1528,7 @@ static struct pci_driver nvidiafb_driver = {
1529 .probe = nvidiafb_probe, 1528 .probe = nvidiafb_probe,
1530 .suspend = nvidiafb_suspend, 1529 .suspend = nvidiafb_suspend,
1531 .resume = nvidiafb_resume, 1530 .resume = nvidiafb_resume,
1532 .remove = __devexit_p(nvidiafb_remove), 1531 .remove = nvidiafb_remove,
1533}; 1532};
1534 1533
1535/* ------------------------------------------------------------------------- * 1534/* ------------------------------------------------------------------------- *
@@ -1538,7 +1537,7 @@ static struct pci_driver nvidiafb_driver = {
1538 * 1537 *
1539 * ------------------------------------------------------------------------- */ 1538 * ------------------------------------------------------------------------- */
1540 1539
1541static int __devinit nvidiafb_init(void) 1540static int nvidiafb_init(void)
1542{ 1541{
1543#ifndef MODULE 1542#ifndef MODULE
1544 char *option = NULL; 1543 char *option = NULL;
diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
index b739600c51a..803fee618d5 100644
--- a/drivers/video/omap/lcd_mipid.c
+++ b/drivers/video/omap/lcd_mipid.c
@@ -606,7 +606,7 @@ static struct spi_driver mipid_spi_driver = {
606 .owner = THIS_MODULE, 606 .owner = THIS_MODULE,
607 }, 607 },
608 .probe = mipid_spi_probe, 608 .probe = mipid_spi_probe,
609 .remove = __devexit_p(mipid_spi_remove), 609 .remove = mipid_spi_remove,
610}; 610};
611 611
612module_spi_driver(mipid_spi_driver); 612module_spi_driver(mipid_spi_driver);
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
index 65eb76c840a..72699f88c00 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -777,7 +777,7 @@ static struct spi_driver acx565akm_spi_driver = {
777 .owner = THIS_MODULE, 777 .owner = THIS_MODULE,
778 }, 778 },
779 .probe = acx565akm_spi_probe, 779 .probe = acx565akm_spi_probe,
780 .remove = __devexit_p(acx565akm_spi_remove), 780 .remove = acx565akm_spi_remove,
781}; 781};
782 782
783module_spi_driver(acx565akm_spi_driver); 783module_spi_driver(acx565akm_spi_driver);
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index ace419b801e..6e5abe8fd2d 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -216,13 +216,13 @@ static void init_lb035q02_panel(struct spi_device *spi)
216 lb035q02_write_reg(spi, 0x3b, 0x0806); 216 lb035q02_write_reg(spi, 0x3b, 0x0806);
217} 217}
218 218
219static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi) 219static int lb035q02_panel_spi_probe(struct spi_device *spi)
220{ 220{
221 init_lb035q02_panel(spi); 221 init_lb035q02_panel(spi);
222 return omap_dss_register_driver(&lb035q02_driver); 222 return omap_dss_register_driver(&lb035q02_driver);
223} 223}
224 224
225static int __devexit lb035q02_panel_spi_remove(struct spi_device *spi) 225static int lb035q02_panel_spi_remove(struct spi_device *spi)
226{ 226{
227 omap_dss_unregister_driver(&lb035q02_driver); 227 omap_dss_unregister_driver(&lb035q02_driver);
228 return 0; 228 return 0;
@@ -234,7 +234,7 @@ static struct spi_driver lb035q02_spi_driver = {
234 .owner = THIS_MODULE, 234 .owner = THIS_MODULE,
235 }, 235 },
236 .probe = lb035q02_panel_spi_probe, 236 .probe = lb035q02_panel_spi_probe,
237 .remove = __devexit_p(lb035q02_panel_spi_remove), 237 .remove = lb035q02_panel_spi_remove,
238}; 238};
239 239
240module_spi_driver(lb035q02_spi_driver); 240module_spi_driver(lb035q02_spi_driver);
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index d1cb722fcdb..dd129475080 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -680,7 +680,7 @@ static struct spi_driver mipid_spi_driver = {
680 .owner = THIS_MODULE, 680 .owner = THIS_MODULE,
681 }, 681 },
682 .probe = mipid_spi_probe, 682 .probe = mipid_spi_probe,
683 .remove = __devexit_p(mipid_spi_remove), 683 .remove = mipid_spi_remove,
684}; 684};
685module_spi_driver(mipid_spi_driver); 685module_spi_driver(mipid_spi_driver);
686 686
diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
index 2a79c283beb..c4e9c2b1b46 100644
--- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
+++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
@@ -323,7 +323,7 @@ static int nec_8048_spi_resume(struct spi_device *spi)
323 323
324static struct spi_driver nec_8048_spi_driver = { 324static struct spi_driver nec_8048_spi_driver = {
325 .probe = nec_8048_spi_probe, 325 .probe = nec_8048_spi_probe,
326 .remove = __devexit_p(nec_8048_spi_remove), 326 .remove = nec_8048_spi_remove,
327 .suspend = nec_8048_spi_suspend, 327 .suspend = nec_8048_spi_suspend,
328 .resume = nec_8048_spi_resume, 328 .resume = nec_8048_spi_resume,
329 .driver = { 329 .driver = {
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index 316b3da6d2c..6b6643911d2 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -528,7 +528,7 @@ static int tpo_td043_spi_probe(struct spi_device *spi)
528 return 0; 528 return 0;
529} 529}
530 530
531static int __devexit tpo_td043_spi_remove(struct spi_device *spi) 531static int tpo_td043_spi_remove(struct spi_device *spi)
532{ 532{
533 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&spi->dev); 533 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&spi->dev);
534 534
@@ -580,7 +580,7 @@ static struct spi_driver tpo_td043_spi_driver = {
580 .pm = &tpo_td043_spi_pm, 580 .pm = &tpo_td043_spi_pm,
581 }, 581 },
582 .probe = tpo_td043_spi_probe, 582 .probe = tpo_td043_spi_probe,
583 .remove = __devexit_p(tpo_td043_spi_remove), 583 .remove = tpo_td043_spi_remove,
584}; 584};
585 585
586module_spi_driver(tpo_td043_spi_driver); 586module_spi_driver(tpo_td043_spi_driver);
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index d57cc58c516..4b23af6e5c2 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -249,7 +249,7 @@ static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_no
249 info->fix.accel = FB_ACCEL_SUN_CGTHREE; 249 info->fix.accel = FB_ACCEL_SUN_CGTHREE;
250} 250}
251 251
252static int __devinit p9100_probe(struct platform_device *op) 252static int p9100_probe(struct platform_device *op)
253{ 253{
254 struct device_node *dp = op->dev.of_node; 254 struct device_node *dp = op->dev.of_node;
255 struct fb_info *info; 255 struct fb_info *info;
@@ -326,7 +326,7 @@ out_err:
326 return err; 326 return err;
327} 327}
328 328
329static int __devexit p9100_remove(struct platform_device *op) 329static int p9100_remove(struct platform_device *op)
330{ 330{
331 struct fb_info *info = dev_get_drvdata(&op->dev); 331 struct fb_info *info = dev_get_drvdata(&op->dev);
332 struct p9100_par *par = info->par; 332 struct p9100_par *par = info->par;
@@ -359,7 +359,7 @@ static struct platform_driver p9100_driver = {
359 .of_match_table = p9100_match, 359 .of_match_table = p9100_match,
360 }, 360 },
361 .probe = p9100_probe, 361 .probe = p9100_probe,
362 .remove = __devexit_p(p9100_remove), 362 .remove = p9100_remove,
363}; 363};
364 364
365static int __init p9100_init(void) 365static int __init p9100_init(void)
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index ae3caa6755c..3d86bac62d3 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -313,7 +313,8 @@ static void platinum_set_hardware(struct fb_info_platinum *pinfo)
313/* 313/*
314 * Set misc info vars for this driver 314 * Set misc info vars for this driver
315 */ 315 */
316static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_platinum *pinfo) 316static void platinum_init_info(struct fb_info *info,
317 struct fb_info_platinum *pinfo)
317{ 318{
318 /* Fill fb_info */ 319 /* Fill fb_info */
319 info->fbops = &platinumfb_ops; 320 info->fbops = &platinumfb_ops;
@@ -338,7 +339,7 @@ static void __devinit platinum_init_info(struct fb_info *info, struct fb_info_pl
338} 339}
339 340
340 341
341static int __devinit platinum_init_fb(struct fb_info *info) 342static int platinum_init_fb(struct fb_info *info)
342{ 343{
343 struct fb_info_platinum *pinfo = info->par; 344 struct fb_info_platinum *pinfo = info->par;
344 struct fb_var_screeninfo var; 345 struct fb_var_screeninfo var;
@@ -533,7 +534,7 @@ static int __init platinumfb_setup(char *options)
533#define invalidate_cache(addr) 534#define invalidate_cache(addr)
534#endif 535#endif
535 536
536static int __devinit platinumfb_probe(struct platform_device* odev) 537static int platinumfb_probe(struct platform_device* odev)
537{ 538{
538 struct device_node *dp = odev->dev.of_node; 539 struct device_node *dp = odev->dev.of_node;
539 struct fb_info *info; 540 struct fb_info *info;
@@ -645,7 +646,7 @@ static int __devinit platinumfb_probe(struct platform_device* odev)
645 return rc; 646 return rc;
646} 647}
647 648
648static int __devexit platinumfb_remove(struct platform_device* odev) 649static int platinumfb_remove(struct platform_device* odev)
649{ 650{
650 struct fb_info *info = dev_get_drvdata(&odev->dev); 651 struct fb_info *info = dev_get_drvdata(&odev->dev);
651 struct fb_info_platinum *pinfo = info->par; 652 struct fb_info_platinum *pinfo = info->par;
@@ -683,7 +684,7 @@ static struct platform_driver platinum_driver =
683 .of_match_table = platinumfb_match, 684 .of_match_table = platinumfb_match,
684 }, 685 },
685 .probe = platinumfb_probe, 686 .probe = platinumfb_probe,
686 .remove = __devexit_p(platinumfb_remove), 687 .remove = platinumfb_remove,
687}; 688};
688 689
689static int __init platinumfb_init(void) 690static int __init platinumfb_init(void)
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index df31a24a502..81354eeab02 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -67,7 +67,7 @@
67 * Driver data 67 * Driver data
68 */ 68 */
69static int hwcursor = 1; 69static int hwcursor = 1;
70static char *mode_option __devinitdata; 70static char *mode_option;
71 71
72/* 72/*
73 * The XFree GLINT driver will (I think to implement hardware cursor 73 * The XFree GLINT driver will (I think to implement hardware cursor
@@ -80,10 +80,10 @@ static char *mode_option __devinitdata;
80 */ 80 */
81static bool lowhsync; 81static bool lowhsync;
82static bool lowvsync; 82static bool lowvsync;
83static bool noaccel __devinitdata; 83static bool noaccel;
84/* mtrr option */ 84/* mtrr option */
85#ifdef CONFIG_MTRR 85#ifdef CONFIG_MTRR
86static bool nomtrr __devinitdata; 86static bool nomtrr;
87#endif 87#endif
88 88
89/* 89/*
@@ -107,7 +107,7 @@ struct pm2fb_par
107 * Here we define the default structs fb_fix_screeninfo and fb_var_screeninfo 107 * Here we define the default structs fb_fix_screeninfo and fb_var_screeninfo
108 * if we don't use modedb. 108 * if we don't use modedb.
109 */ 109 */
110static struct fb_fix_screeninfo pm2fb_fix __devinitdata = { 110static struct fb_fix_screeninfo pm2fb_fix = {
111 .id = "", 111 .id = "",
112 .type = FB_TYPE_PACKED_PIXELS, 112 .type = FB_TYPE_PACKED_PIXELS,
113 .visual = FB_VISUAL_PSEUDOCOLOR, 113 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -120,7 +120,7 @@ static struct fb_fix_screeninfo pm2fb_fix __devinitdata = {
120/* 120/*
121 * Default video mode. In case the modedb doesn't work. 121 * Default video mode. In case the modedb doesn't work.
122 */ 122 */
123static struct fb_var_screeninfo pm2fb_var __devinitdata = { 123static struct fb_var_screeninfo pm2fb_var = {
124 /* "640x480, 8 bpp @ 60 Hz */ 124 /* "640x480, 8 bpp @ 60 Hz */
125 .xres = 640, 125 .xres = 640,
126 .yres = 480, 126 .yres = 480,
@@ -1515,8 +1515,7 @@ static struct fb_ops pm2fb_ops = {
1515 * @param pdev PCI device. 1515 * @param pdev PCI device.
1516 * @param id PCI device ID. 1516 * @param id PCI device ID.
1517 */ 1517 */
1518static int __devinit pm2fb_probe(struct pci_dev *pdev, 1518static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1519 const struct pci_device_id *id)
1520{ 1519{
1521 struct pm2fb_par *default_par; 1520 struct pm2fb_par *default_par;
1522 struct fb_info *info; 1521 struct fb_info *info;
@@ -1727,7 +1726,7 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
1727 * 1726 *
1728 * @param pdev PCI device to clean up. 1727 * @param pdev PCI device to clean up.
1729 */ 1728 */
1730static void __devexit pm2fb_remove(struct pci_dev *pdev) 1729static void pm2fb_remove(struct pci_dev *pdev)
1731{ 1730{
1732 struct fb_info *info = pci_get_drvdata(pdev); 1731 struct fb_info *info = pci_get_drvdata(pdev);
1733 struct fb_fix_screeninfo *fix = &info->fix; 1732 struct fb_fix_screeninfo *fix = &info->fix;
@@ -1765,7 +1764,7 @@ static struct pci_driver pm2fb_driver = {
1765 .name = "pm2fb", 1764 .name = "pm2fb",
1766 .id_table = pm2fb_id_table, 1765 .id_table = pm2fb_id_table,
1767 .probe = pm2fb_probe, 1766 .probe = pm2fb_probe,
1768 .remove = __devexit_p(pm2fb_remove), 1767 .remove = pm2fb_remove,
1769}; 1768};
1770 1769
1771MODULE_DEVICE_TABLE(pci, pm2fb_id_table); 1770MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 055e527a8e4..7718faa4a73 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -56,12 +56,12 @@
56 * Driver data 56 * Driver data
57 */ 57 */
58static int hwcursor = 1; 58static int hwcursor = 1;
59static char *mode_option __devinitdata; 59static char *mode_option;
60static bool noaccel __devinitdata; 60static bool noaccel;
61 61
62/* mtrr option */ 62/* mtrr option */
63#ifdef CONFIG_MTRR 63#ifdef CONFIG_MTRR
64static bool nomtrr __devinitdata; 64static bool nomtrr;
65#endif 65#endif
66 66
67/* 67/*
@@ -84,7 +84,7 @@ struct pm3_par {
84 * if we don't use modedb. If we do use modedb see pm3fb_init how to use it 84 * if we don't use modedb. If we do use modedb see pm3fb_init how to use it
85 * to get a fb_var_screeninfo. Otherwise define a default var as well. 85 * to get a fb_var_screeninfo. Otherwise define a default var as well.
86 */ 86 */
87static struct fb_fix_screeninfo pm3fb_fix __devinitdata = { 87static struct fb_fix_screeninfo pm3fb_fix = {
88 .id = "Permedia3", 88 .id = "Permedia3",
89 .type = FB_TYPE_PACKED_PIXELS, 89 .type = FB_TYPE_PACKED_PIXELS,
90 .visual = FB_VISUAL_PSEUDOCOLOR, 90 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -1229,7 +1229,7 @@ static struct fb_ops pm3fb_ops = {
1229 1229
1230/* mmio register are already mapped when this function is called */ 1230/* mmio register are already mapped when this function is called */
1231/* the pm3fb_fix.smem_start is also set */ 1231/* the pm3fb_fix.smem_start is also set */
1232static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par) 1232static unsigned long pm3fb_size_memory(struct pm3_par *par)
1233{ 1233{
1234 unsigned long memsize = 0; 1234 unsigned long memsize = 0;
1235 unsigned long tempBypass, i, temp1, temp2; 1235 unsigned long tempBypass, i, temp1, temp2;
@@ -1314,8 +1314,7 @@ static unsigned long __devinit pm3fb_size_memory(struct pm3_par *par)
1314 return memsize; 1314 return memsize;
1315} 1315}
1316 1316
1317static int __devinit pm3fb_probe(struct pci_dev *dev, 1317static int pm3fb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1318 const struct pci_device_id *ent)
1319{ 1318{
1320 struct fb_info *info; 1319 struct fb_info *info;
1321 struct pm3_par *par; 1320 struct pm3_par *par;
@@ -1469,7 +1468,7 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
1469 /* 1468 /*
1470 * Cleanup 1469 * Cleanup
1471 */ 1470 */
1472static void __devexit pm3fb_remove(struct pci_dev *dev) 1471static void pm3fb_remove(struct pci_dev *dev)
1473{ 1472{
1474 struct fb_info *info = pci_get_drvdata(dev); 1473 struct fb_info *info = pci_get_drvdata(dev);
1475 1474
@@ -1507,7 +1506,7 @@ static struct pci_driver pm3fb_driver = {
1507 .name = "pm3fb", 1506 .name = "pm3fb",
1508 .id_table = pm3fb_id_table, 1507 .id_table = pm3fb_id_table,
1509 .probe = pm3fb_probe, 1508 .probe = pm3fb_probe,
1510 .remove = __devexit_p(pm3fb_remove), 1509 .remove = pm3fb_remove,
1511}; 1510};
1512 1511
1513MODULE_DEVICE_TABLE(pci, pm3fb_id_table); 1512MODULE_DEVICE_TABLE(pci, pm3fb_id_table);
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 9b4a60b52a4..d1e46cedb1f 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -43,7 +43,7 @@ struct pmagbafb_par {
43}; 43};
44 44
45 45
46static struct fb_var_screeninfo pmagbafb_defined __devinitdata = { 46static struct fb_var_screeninfo pmagbafb_defined = {
47 .xres = 1024, 47 .xres = 1024,
48 .yres = 864, 48 .yres = 864,
49 .xres_virtual = 1024, 49 .xres_virtual = 1024,
@@ -67,7 +67,7 @@ static struct fb_var_screeninfo pmagbafb_defined __devinitdata = {
67 .vmode = FB_VMODE_NONINTERLACED, 67 .vmode = FB_VMODE_NONINTERLACED,
68}; 68};
69 69
70static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = { 70static struct fb_fix_screeninfo pmagbafb_fix = {
71 .id = "PMAG-BA", 71 .id = "PMAG-BA",
72 .smem_len = (1024 * 1024), 72 .smem_len = (1024 * 1024),
73 .type = FB_TYPE_PACKED_PIXELS, 73 .type = FB_TYPE_PACKED_PIXELS,
@@ -141,7 +141,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info)
141} 141}
142 142
143 143
144static int __devinit pmagbafb_probe(struct device *dev) 144static int pmagbafb_probe(struct device *dev)
145{ 145{
146 struct tc_dev *tdev = to_tc_dev(dev); 146 struct tc_dev *tdev = to_tc_dev(dev);
147 resource_size_t start, len; 147 resource_size_t start, len;
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
index 4e7a9c46e11..0e131740032 100644
--- a/drivers/video/pmagb-b-fb.c
+++ b/drivers/video/pmagb-b-fb.c
@@ -44,7 +44,7 @@ struct pmagbbfb_par {
44}; 44};
45 45
46 46
47static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = { 47static struct fb_var_screeninfo pmagbbfb_defined = {
48 .bits_per_pixel = 8, 48 .bits_per_pixel = 8,
49 .red.length = 8, 49 .red.length = 8,
50 .green.length = 8, 50 .green.length = 8,
@@ -57,7 +57,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = {
57 .vmode = FB_VMODE_NONINTERLACED, 57 .vmode = FB_VMODE_NONINTERLACED,
58}; 58};
59 59
60static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = { 60static struct fb_fix_screeninfo pmagbbfb_fix = {
61 .id = "PMAGB-BA", 61 .id = "PMAGB-BA",
62 .smem_len = (2048 * 1024), 62 .smem_len = (2048 * 1024),
63 .type = FB_TYPE_PACKED_PIXELS, 63 .type = FB_TYPE_PACKED_PIXELS,
@@ -147,7 +147,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info)
147/* 147/*
148 * Set up screen parameters. 148 * Set up screen parameters.
149 */ 149 */
150static void __devinit pmagbbfb_screen_setup(struct fb_info *info) 150static void pmagbbfb_screen_setup(struct fb_info *info)
151{ 151{
152 struct pmagbbfb_par *par = info->par; 152 struct pmagbbfb_par *par = info->par;
153 153
@@ -179,9 +179,9 @@ static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
179/* 179/*
180 * Determine oscillator configuration. 180 * Determine oscillator configuration.
181 */ 181 */
182static void __devinit pmagbbfb_osc_setup(struct fb_info *info) 182static void pmagbbfb_osc_setup(struct fb_info *info)
183{ 183{
184 static unsigned int pmagbbfb_freqs[] __devinitdata = { 184 static unsigned int pmagbbfb_freqs[] = {
185 130808, 119843, 104000, 92980, 74370, 72800, 185 130808, 119843, 104000, 92980, 74370, 72800,
186 69197, 66000, 65000, 50350, 36000, 32000, 25175 186 69197, 66000, 65000, 50350, 36000, 32000, 25175
187 }; 187 };
@@ -246,7 +246,7 @@ static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
246}; 246};
247 247
248 248
249static int __devinit pmagbbfb_probe(struct device *dev) 249static int pmagbbfb_probe(struct device *dev)
250{ 250{
251 struct tc_dev *tdev = to_tc_dev(dev); 251 struct tc_dev *tdev = to_tc_dev(dev);
252 resource_size_t start, len; 252 resource_size_t start, len;
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 0b340d6ff8a..920c27bf394 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -259,7 +259,7 @@ static const struct fb_videomode ps3fb_modedb[] = {
259static int ps3fb_mode; 259static int ps3fb_mode;
260module_param(ps3fb_mode, int, 0); 260module_param(ps3fb_mode, int, 0);
261 261
262static char *mode_option __devinitdata; 262static char *mode_option;
263 263
264static int ps3fb_cmp_mode(const struct fb_videomode *vmode, 264static int ps3fb_cmp_mode(const struct fb_videomode *vmode,
265 const struct fb_var_screeninfo *var) 265 const struct fb_var_screeninfo *var)
@@ -965,7 +965,7 @@ static struct fb_fix_screeninfo ps3fb_fix __initdata = {
965 .accel = FB_ACCEL_NONE, 965 .accel = FB_ACCEL_NONE,
966}; 966};
967 967
968static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) 968static int ps3fb_probe(struct ps3_system_bus_device *dev)
969{ 969{
970 struct fb_info *info; 970 struct fb_info *info;
971 struct ps3fb_par *par; 971 struct ps3fb_par *par;
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index bcd44c32a2e..df07860563e 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -112,11 +112,11 @@ enum { VO_PAL, VO_NTSC, VO_VGA };
112enum { PAL_ARGB1555, PAL_RGB565, PAL_ARGB4444, PAL_ARGB8888 }; 112enum { PAL_ARGB1555, PAL_RGB565, PAL_ARGB4444, PAL_ARGB8888 };
113 113
114struct pvr2_params { unsigned int val; char *name; }; 114struct pvr2_params { unsigned int val; char *name; };
115static struct pvr2_params cables[] __devinitdata = { 115static struct pvr2_params cables[] = {
116 { CT_VGA, "VGA" }, { CT_RGB, "RGB" }, { CT_COMPOSITE, "COMPOSITE" }, 116 { CT_VGA, "VGA" }, { CT_RGB, "RGB" }, { CT_COMPOSITE, "COMPOSITE" },
117}; 117};
118 118
119static struct pvr2_params outputs[] __devinitdata = { 119static struct pvr2_params outputs[] = {
120 { VO_PAL, "PAL" }, { VO_NTSC, "NTSC" }, { VO_VGA, "VGA" }, 120 { VO_PAL, "PAL" }, { VO_NTSC, "NTSC" }, { VO_VGA, "VGA" },
121}; 121};
122 122
@@ -145,7 +145,7 @@ static struct pvr2fb_par {
145 145
146static struct fb_info *fb_info; 146static struct fb_info *fb_info;
147 147
148static struct fb_fix_screeninfo pvr2_fix __devinitdata = { 148static struct fb_fix_screeninfo pvr2_fix = {
149 .id = "NEC PowerVR2", 149 .id = "NEC PowerVR2",
150 .type = FB_TYPE_PACKED_PIXELS, 150 .type = FB_TYPE_PACKED_PIXELS,
151 .visual = FB_VISUAL_TRUECOLOR, 151 .visual = FB_VISUAL_TRUECOLOR,
@@ -154,7 +154,7 @@ static struct fb_fix_screeninfo pvr2_fix __devinitdata = {
154 .accel = FB_ACCEL_NONE, 154 .accel = FB_ACCEL_NONE,
155}; 155};
156 156
157static struct fb_var_screeninfo pvr2_var __devinitdata = { 157static struct fb_var_screeninfo pvr2_var = {
158 .xres = 640, 158 .xres = 640,
159 .yres = 480, 159 .yres = 480,
160 .xres_virtual = 640, 160 .xres_virtual = 640,
@@ -226,7 +226,7 @@ static struct fb_ops pvr2fb_ops = {
226 .fb_imageblit = cfb_imageblit, 226 .fb_imageblit = cfb_imageblit,
227}; 227};
228 228
229static struct fb_videomode pvr2_modedb[] __devinitdata = { 229static struct fb_videomode pvr2_modedb[] = {
230 /* 230 /*
231 * Broadcast video modes (PAL and NTSC). I'm unfamiliar with 231 * Broadcast video modes (PAL and NTSC). I'm unfamiliar with
232 * PAL-M and PAL-N, but from what I've read both modes parallel PAL and 232 * PAL-M and PAL-N, but from what I've read both modes parallel PAL and
@@ -256,7 +256,7 @@ static struct fb_videomode pvr2_modedb[] __devinitdata = {
256#define DEFMODE_VGA 2 256#define DEFMODE_VGA 2
257 257
258static int defmode = DEFMODE_NTSC; 258static int defmode = DEFMODE_NTSC;
259static char *mode_option __devinitdata = NULL; 259static char *mode_option = NULL;
260 260
261static inline void pvr2fb_set_pal_type(unsigned int type) 261static inline void pvr2fb_set_pal_type(unsigned int type)
262{ 262{
@@ -763,7 +763,7 @@ out_unmap:
763 * in for flexibility anyways. Who knows, maybe someone has tv-out on a 763 * in for flexibility anyways. Who knows, maybe someone has tv-out on a
764 * PCI-based version of these things ;-) 764 * PCI-based version of these things ;-)
765 */ 765 */
766static int __devinit pvr2fb_common_init(void) 766static int pvr2fb_common_init(void)
767{ 767{
768 struct pvr2fb_par *par = currentpar; 768 struct pvr2fb_par *par = currentpar;
769 unsigned long modememused, rev; 769 unsigned long modememused, rev;
@@ -922,8 +922,8 @@ static void __exit pvr2fb_dc_exit(void)
922#endif /* CONFIG_SH_DREAMCAST */ 922#endif /* CONFIG_SH_DREAMCAST */
923 923
924#ifdef CONFIG_PCI 924#ifdef CONFIG_PCI
925static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev, 925static int pvr2fb_pci_probe(struct pci_dev *pdev,
926 const struct pci_device_id *ent) 926 const struct pci_device_id *ent)
927{ 927{
928 int ret; 928 int ret;
929 929
@@ -953,7 +953,7 @@ static int __devinit pvr2fb_pci_probe(struct pci_dev *pdev,
953 return pvr2fb_common_init(); 953 return pvr2fb_common_init();
954} 954}
955 955
956static void __devexit pvr2fb_pci_remove(struct pci_dev *pdev) 956static void pvr2fb_pci_remove(struct pci_dev *pdev)
957{ 957{
958 if (fb_info->screen_base) { 958 if (fb_info->screen_base) {
959 iounmap(fb_info->screen_base); 959 iounmap(fb_info->screen_base);
@@ -967,7 +967,7 @@ static void __devexit pvr2fb_pci_remove(struct pci_dev *pdev)
967 pci_release_regions(pdev); 967 pci_release_regions(pdev);
968} 968}
969 969
970static struct pci_device_id pvr2fb_pci_tbl[] __devinitdata = { 970static struct pci_device_id pvr2fb_pci_tbl[] = {
971 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250, 971 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250,
972 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 972 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
973 { 0, }, 973 { 0, },
@@ -979,7 +979,7 @@ static struct pci_driver pvr2fb_pci_driver = {
979 .name = "pvr2fb", 979 .name = "pvr2fb",
980 .id_table = pvr2fb_pci_tbl, 980 .id_table = pvr2fb_pci_tbl,
981 .probe = pvr2fb_pci_probe, 981 .probe = pvr2fb_pci_probe,
982 .remove = __devexit_p(pvr2fb_pci_remove), 982 .remove = pvr2fb_pci_remove,
983}; 983};
984 984
985static int __init pvr2fb_pci_init(void) 985static int __init pvr2fb_pci_init(void)
@@ -993,8 +993,8 @@ static void __exit pvr2fb_pci_exit(void)
993} 993}
994#endif /* CONFIG_PCI */ 994#endif /* CONFIG_PCI */
995 995
996static int __devinit pvr2_get_param(const struct pvr2_params *p, const char *s, 996static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val,
997 int val, int size) 997 int size)
998{ 998{
999 int i; 999 int i;
1000 1000
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index f146089261f..aa9bd1f76d6 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -560,7 +560,7 @@ static struct fb_ops pxa168fb_ops = {
560 .fb_imageblit = cfb_imageblit, 560 .fb_imageblit = cfb_imageblit,
561}; 561};
562 562
563static int __devinit pxa168fb_init_mode(struct fb_info *info, 563static int pxa168fb_init_mode(struct fb_info *info,
564 struct pxa168fb_mach_info *mi) 564 struct pxa168fb_mach_info *mi)
565{ 565{
566 struct pxa168fb_info *fbi = info->par; 566 struct pxa168fb_info *fbi = info->par;
@@ -600,7 +600,7 @@ static int __devinit pxa168fb_init_mode(struct fb_info *info,
600 return ret; 600 return ret;
601} 601}
602 602
603static int __devinit pxa168fb_probe(struct platform_device *pdev) 603static int pxa168fb_probe(struct platform_device *pdev)
604{ 604{
605 struct pxa168fb_mach_info *mi; 605 struct pxa168fb_mach_info *mi;
606 struct fb_info *info = 0; 606 struct fb_info *info = 0;
@@ -783,7 +783,7 @@ failed_put_clk:
783 return ret; 783 return ret;
784} 784}
785 785
786static int __devexit pxa168fb_remove(struct platform_device *pdev) 786static int pxa168fb_remove(struct platform_device *pdev)
787{ 787{
788 struct pxa168fb_info *fbi = platform_get_drvdata(pdev); 788 struct pxa168fb_info *fbi = platform_get_drvdata(pdev);
789 struct fb_info *info; 789 struct fb_info *info;
@@ -826,7 +826,7 @@ static struct platform_driver pxa168fb_driver = {
826 .owner = THIS_MODULE, 826 .owner = THIS_MODULE,
827 }, 827 },
828 .probe = pxa168fb_probe, 828 .probe = pxa168fb_probe,
829 .remove = __devexit_p(pxa168fb_remove), 829 .remove = pxa168fb_remove,
830}; 830};
831 831
832module_platform_driver(pxa168fb_driver); 832module_platform_driver(pxa168fb_driver);
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index 0b4ae0cebed..6c984eacc7e 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -574,8 +574,7 @@ free_buffers(struct platform_device *dev,
574 priv->free = NULL; 574 priv->free = NULL;
575} 575}
576 576
577static int __devinit 577static int pxa3xx_gcu_probe(struct platform_device *dev)
578pxa3xx_gcu_probe(struct platform_device *dev)
579{ 578{
580 int i, ret, irq; 579 int i, ret, irq;
581 struct resource *r; 580 struct resource *r;
@@ -714,8 +713,7 @@ err_free_priv:
714 return ret; 713 return ret;
715} 714}
716 715
717static int __devexit 716static int pxa3xx_gcu_remove(struct platform_device *dev)
718pxa3xx_gcu_remove(struct platform_device *dev)
719{ 717{
720 struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev); 718 struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev);
721 struct resource *r = priv->resource_mem; 719 struct resource *r = priv->resource_mem;
@@ -737,7 +735,7 @@ pxa3xx_gcu_remove(struct platform_device *dev)
737 735
738static struct platform_driver pxa3xx_gcu_driver = { 736static struct platform_driver pxa3xx_gcu_driver = {
739 .probe = pxa3xx_gcu_probe, 737 .probe = pxa3xx_gcu_probe,
740 .remove = __devexit_p(pxa3xx_gcu_remove), 738 .remove = pxa3xx_gcu_remove,
741 .driver = { 739 .driver = {
742 .owner = THIS_MODULE, 740 .owner = THIS_MODULE,
743 .name = DRV_NAME, 741 .name = DRV_NAME,
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 4fa2ad43fd9..580f80cc586 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -869,8 +869,8 @@ static struct fb_ops overlay_fb_ops = {
869 .fb_set_par = overlayfb_set_par, 869 .fb_set_par = overlayfb_set_par,
870}; 870};
871 871
872static void __devinit init_pxafb_overlay(struct pxafb_info *fbi, 872static void init_pxafb_overlay(struct pxafb_info *fbi, struct pxafb_layer *ofb,
873 struct pxafb_layer *ofb, int id) 873 int id)
874{ 874{
875 sprintf(ofb->fb.fix.id, "overlay%d", id + 1); 875 sprintf(ofb->fb.fix.id, "overlay%d", id + 1);
876 876
@@ -903,8 +903,8 @@ static inline int pxafb_overlay_supported(void)
903 return 0; 903 return 0;
904} 904}
905 905
906static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb, 906static int pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
907 struct pxafb_layer *ofb) 907 struct pxafb_layer *ofb)
908{ 908{
909 /* We assume that user will use at most video_mem_size for overlay fb, 909 /* We assume that user will use at most video_mem_size for overlay fb,
910 * anyway, it's useless to use 16bpp main plane and 24bpp overlay 910 * anyway, it's useless to use 16bpp main plane and 24bpp overlay
@@ -927,7 +927,7 @@ static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb,
927 return 0; 927 return 0;
928} 928}
929 929
930static void __devinit pxafb_overlay_init(struct pxafb_info *fbi) 930static void pxafb_overlay_init(struct pxafb_info *fbi)
931{ 931{
932 int i, ret; 932 int i, ret;
933 933
@@ -959,7 +959,7 @@ static void __devinit pxafb_overlay_init(struct pxafb_info *fbi)
959 pr_info("PXA Overlay driver loaded successfully!\n"); 959 pr_info("PXA Overlay driver loaded successfully!\n");
960} 960}
961 961
962static void __devexit pxafb_overlay_exit(struct pxafb_info *fbi) 962static void pxafb_overlay_exit(struct pxafb_info *fbi)
963{ 963{
964 int i; 964 int i;
965 965
@@ -1706,7 +1706,7 @@ static const struct dev_pm_ops pxafb_pm_ops = {
1706}; 1706};
1707#endif 1707#endif
1708 1708
1709static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi) 1709static int pxafb_init_video_memory(struct pxafb_info *fbi)
1710{ 1710{
1711 int size = PAGE_ALIGN(fbi->video_mem_size); 1711 int size = PAGE_ALIGN(fbi->video_mem_size);
1712 1712
@@ -1789,7 +1789,7 @@ decode_mode:
1789 fbi->video_mem_size = video_mem_size; 1789 fbi->video_mem_size = video_mem_size;
1790} 1790}
1791 1791
1792static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev) 1792static struct pxafb_info *pxafb_init_fbinfo(struct device *dev)
1793{ 1793{
1794 struct pxafb_info *fbi; 1794 struct pxafb_info *fbi;
1795 void *addr; 1795 void *addr;
@@ -1853,7 +1853,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
1853} 1853}
1854 1854
1855#ifdef CONFIG_FB_PXA_PARAMETERS 1855#ifdef CONFIG_FB_PXA_PARAMETERS
1856static int __devinit parse_opt_mode(struct device *dev, const char *this_opt) 1856static int parse_opt_mode(struct device *dev, const char *this_opt)
1857{ 1857{
1858 struct pxafb_mach_info *inf = dev->platform_data; 1858 struct pxafb_mach_info *inf = dev->platform_data;
1859 1859
@@ -1912,7 +1912,7 @@ done:
1912 return 0; 1912 return 0;
1913} 1913}
1914 1914
1915static int __devinit parse_opt(struct device *dev, char *this_opt) 1915static int parse_opt(struct device *dev, char *this_opt)
1916{ 1916{
1917 struct pxafb_mach_info *inf = dev->platform_data; 1917 struct pxafb_mach_info *inf = dev->platform_data;
1918 struct pxafb_mode_info *mode = &inf->modes[0]; 1918 struct pxafb_mode_info *mode = &inf->modes[0];
@@ -2012,7 +2012,7 @@ static int __devinit parse_opt(struct device *dev, char *this_opt)
2012 return 0; 2012 return 0;
2013} 2013}
2014 2014
2015static int __devinit pxafb_parse_options(struct device *dev, char *options) 2015static int pxafb_parse_options(struct device *dev, char *options)
2016{ 2016{
2017 char *this_opt; 2017 char *this_opt;
2018 int ret; 2018 int ret;
@@ -2031,7 +2031,7 @@ static int __devinit pxafb_parse_options(struct device *dev, char *options)
2031 return 0; 2031 return 0;
2032} 2032}
2033 2033
2034static char g_options[256] __devinitdata = ""; 2034static char g_options[256] = "";
2035 2035
2036#ifndef MODULE 2036#ifndef MODULE
2037static int __init pxafb_setup_options(void) 2037static int __init pxafb_setup_options(void)
@@ -2061,8 +2061,7 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
2061#ifdef DEBUG_VAR 2061#ifdef DEBUG_VAR
2062/* Check for various illegal bit-combinations. Currently only 2062/* Check for various illegal bit-combinations. Currently only
2063 * a warning is given. */ 2063 * a warning is given. */
2064static void __devinit pxafb_check_options(struct device *dev, 2064static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf)
2065 struct pxafb_mach_info *inf)
2066{ 2065{
2067 if (inf->lcd_conn) 2066 if (inf->lcd_conn)
2068 return; 2067 return;
@@ -2094,7 +2093,7 @@ static void __devinit pxafb_check_options(struct device *dev,
2094#define pxafb_check_options(...) do {} while (0) 2093#define pxafb_check_options(...) do {} while (0)
2095#endif 2094#endif
2096 2095
2097static int __devinit pxafb_probe(struct platform_device *dev) 2096static int pxafb_probe(struct platform_device *dev)
2098{ 2097{
2099 struct pxafb_info *fbi; 2098 struct pxafb_info *fbi;
2100 struct pxafb_mach_info *inf; 2099 struct pxafb_mach_info *inf;
@@ -2263,7 +2262,7 @@ failed:
2263 return ret; 2262 return ret;
2264} 2263}
2265 2264
2266static int __devexit pxafb_remove(struct platform_device *dev) 2265static int pxafb_remove(struct platform_device *dev)
2267{ 2266{
2268 struct pxafb_info *fbi = platform_get_drvdata(dev); 2267 struct pxafb_info *fbi = platform_get_drvdata(dev);
2269 struct resource *r; 2268 struct resource *r;
@@ -2304,7 +2303,7 @@ static int __devexit pxafb_remove(struct platform_device *dev)
2304 2303
2305static struct platform_driver pxafb_driver = { 2304static struct platform_driver pxafb_driver = {
2306 .probe = pxafb_probe, 2305 .probe = pxafb_probe,
2307 .remove = __devexit_p(pxafb_remove), 2306 .remove = pxafb_remove,
2308 .driver = { 2307 .driver = {
2309 .owner = THIS_MODULE, 2308 .owner = THIS_MODULE,
2310 .name = "pxa2xx-fb", 2309 .name = "pxa2xx-fb",
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index a104e8cd2f5..d44c7351de0 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -27,7 +27,7 @@
27 27
28#define Q40_PHYS_SCREEN_ADDR 0xFE800000 28#define Q40_PHYS_SCREEN_ADDR 0xFE800000
29 29
30static struct fb_fix_screeninfo q40fb_fix __devinitdata = { 30static struct fb_fix_screeninfo q40fb_fix = {
31 .id = "Q40", 31 .id = "Q40",
32 .smem_len = 1024*1024, 32 .smem_len = 1024*1024,
33 .type = FB_TYPE_PACKED_PIXELS, 33 .type = FB_TYPE_PACKED_PIXELS,
@@ -36,7 +36,7 @@ static struct fb_fix_screeninfo q40fb_fix __devinitdata = {
36 .accel = FB_ACCEL_NONE, 36 .accel = FB_ACCEL_NONE,
37}; 37};
38 38
39static struct fb_var_screeninfo q40fb_var __devinitdata = { 39static struct fb_var_screeninfo q40fb_var = {
40 .xres = 1024, 40 .xres = 1024,
41 .yres = 512, 41 .yres = 512,
42 .xres_virtual = 1024, 42 .xres_virtual = 1024,
@@ -83,7 +83,7 @@ static struct fb_ops q40fb_ops = {
83 .fb_imageblit = cfb_imageblit, 83 .fb_imageblit = cfb_imageblit,
84}; 84};
85 85
86static int __devinit q40fb_probe(struct platform_device *dev) 86static int q40fb_probe(struct platform_device *dev)
87{ 87{
88 struct fb_info *info; 88 struct fb_info *info;
89 89
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 90df1a60bd1..9536715b5a1 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -205,28 +205,28 @@ MODULE_DEVICE_TABLE(pci, rivafb_pci_tbl);
205 * ------------------------------------------------------------------------- */ 205 * ------------------------------------------------------------------------- */
206 206
207/* command line data, set in rivafb_setup() */ 207/* command line data, set in rivafb_setup() */
208static int flatpanel __devinitdata = -1; /* Autodetect later */ 208static int flatpanel = -1; /* Autodetect later */
209static int forceCRTC __devinitdata = -1; 209static int forceCRTC = -1;
210static bool noaccel __devinitdata = 0; 210static bool noaccel = 0;
211#ifdef CONFIG_MTRR 211#ifdef CONFIG_MTRR
212static bool nomtrr __devinitdata = 0; 212static bool nomtrr = 0;
213#endif 213#endif
214#ifdef CONFIG_PMAC_BACKLIGHT 214#ifdef CONFIG_PMAC_BACKLIGHT
215static int backlight __devinitdata = 1; 215static int backlight = 1;
216#else 216#else
217static int backlight __devinitdata = 0; 217static int backlight = 0;
218#endif 218#endif
219 219
220static char *mode_option __devinitdata = NULL; 220static char *mode_option = NULL;
221static bool strictmode = 0; 221static bool strictmode = 0;
222 222
223static struct fb_fix_screeninfo __devinitdata rivafb_fix = { 223static struct fb_fix_screeninfo rivafb_fix = {
224 .type = FB_TYPE_PACKED_PIXELS, 224 .type = FB_TYPE_PACKED_PIXELS,
225 .xpanstep = 1, 225 .xpanstep = 1,
226 .ypanstep = 1, 226 .ypanstep = 1,
227}; 227};
228 228
229static struct fb_var_screeninfo __devinitdata rivafb_default_var = { 229static struct fb_var_screeninfo rivafb_default_var = {
230 .xres = 640, 230 .xres = 640,
231 .yres = 480, 231 .yres = 480,
232 .xres_virtual = 640, 232 .xres_virtual = 640,
@@ -1709,7 +1709,7 @@ static struct fb_ops riva_fb_ops = {
1709 .fb_sync = rivafb_sync, 1709 .fb_sync = rivafb_sync,
1710}; 1710};
1711 1711
1712static int __devinit riva_set_fbinfo(struct fb_info *info) 1712static int riva_set_fbinfo(struct fb_info *info)
1713{ 1713{
1714 unsigned int cmap_len; 1714 unsigned int cmap_len;
1715 struct riva_par *par = info->par; 1715 struct riva_par *par = info->par;
@@ -1747,7 +1747,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
1747} 1747}
1748 1748
1749#ifdef CONFIG_PPC_OF 1749#ifdef CONFIG_PPC_OF
1750static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd) 1750static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
1751{ 1751{
1752 struct riva_par *par = info->par; 1752 struct riva_par *par = info->par;
1753 struct device_node *dp; 1753 struct device_node *dp;
@@ -1780,7 +1780,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
1780#endif /* CONFIG_PPC_OF */ 1780#endif /* CONFIG_PPC_OF */
1781 1781
1782#if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF) 1782#if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF)
1783static int __devinit riva_get_EDID_i2c(struct fb_info *info) 1783static int riva_get_EDID_i2c(struct fb_info *info)
1784{ 1784{
1785 struct riva_par *par = info->par; 1785 struct riva_par *par = info->par;
1786 struct fb_var_screeninfo var; 1786 struct fb_var_screeninfo var;
@@ -1803,8 +1803,8 @@ static int __devinit riva_get_EDID_i2c(struct fb_info *info)
1803} 1803}
1804#endif /* CONFIG_FB_RIVA_I2C */ 1804#endif /* CONFIG_FB_RIVA_I2C */
1805 1805
1806static void __devinit riva_update_default_var(struct fb_var_screeninfo *var, 1806static void riva_update_default_var(struct fb_var_screeninfo *var,
1807 struct fb_info *info) 1807 struct fb_info *info)
1808{ 1808{
1809 struct fb_monspecs *specs = &info->monspecs; 1809 struct fb_monspecs *specs = &info->monspecs;
1810 struct fb_videomode modedb; 1810 struct fb_videomode modedb;
@@ -1836,7 +1836,7 @@ static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
1836} 1836}
1837 1837
1838 1838
1839static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev) 1839static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
1840{ 1840{
1841 NVTRACE_ENTER(); 1841 NVTRACE_ENTER();
1842#ifdef CONFIG_PPC_OF 1842#ifdef CONFIG_PPC_OF
@@ -1850,7 +1850,7 @@ static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
1850} 1850}
1851 1851
1852 1852
1853static void __devinit riva_get_edidinfo(struct fb_info *info) 1853static void riva_get_edidinfo(struct fb_info *info)
1854{ 1854{
1855 struct fb_var_screeninfo *var = &rivafb_default_var; 1855 struct fb_var_screeninfo *var = &rivafb_default_var;
1856 struct riva_par *par = info->par; 1856 struct riva_par *par = info->par;
@@ -1871,7 +1871,7 @@ static void __devinit riva_get_edidinfo(struct fb_info *info)
1871 * 1871 *
1872 * ------------------------------------------------------------------------- */ 1872 * ------------------------------------------------------------------------- */
1873 1873
1874static u32 __devinit riva_get_arch(struct pci_dev *pd) 1874static u32 riva_get_arch(struct pci_dev *pd)
1875{ 1875{
1876 u32 arch = 0; 1876 u32 arch = 0;
1877 1877
@@ -1909,8 +1909,7 @@ static u32 __devinit riva_get_arch(struct pci_dev *pd)
1909 return arch; 1909 return arch;
1910} 1910}
1911 1911
1912static int __devinit rivafb_probe(struct pci_dev *pd, 1912static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
1913 const struct pci_device_id *ent)
1914{ 1913{
1915 struct riva_par *default_par; 1914 struct riva_par *default_par;
1916 struct fb_info *info; 1915 struct fb_info *info;
@@ -2105,7 +2104,7 @@ err_ret:
2105 return ret; 2104 return ret;
2106} 2105}
2107 2106
2108static void __devexit rivafb_remove(struct pci_dev *pd) 2107static void rivafb_remove(struct pci_dev *pd)
2109{ 2108{
2110 struct fb_info *info = pci_get_drvdata(pd); 2109 struct fb_info *info = pci_get_drvdata(pd);
2111 struct riva_par *par = info->par; 2110 struct riva_par *par = info->par;
@@ -2145,7 +2144,7 @@ static void __devexit rivafb_remove(struct pci_dev *pd)
2145 * ------------------------------------------------------------------------- */ 2144 * ------------------------------------------------------------------------- */
2146 2145
2147#ifndef MODULE 2146#ifndef MODULE
2148static int __devinit rivafb_setup(char *options) 2147static int rivafb_setup(char *options)
2149{ 2148{
2150 char *this_opt; 2149 char *this_opt;
2151 2150
@@ -2186,7 +2185,7 @@ static struct pci_driver rivafb_driver = {
2186 .name = "rivafb", 2185 .name = "rivafb",
2187 .id_table = rivafb_pci_tbl, 2186 .id_table = rivafb_pci_tbl,
2188 .probe = rivafb_probe, 2187 .probe = rivafb_probe,
2189 .remove = __devexit_p(rivafb_remove), 2188 .remove = rivafb_remove,
2190}; 2189};
2191 2190
2192 2191
@@ -2197,7 +2196,7 @@ static struct pci_driver rivafb_driver = {
2197 * 2196 *
2198 * ------------------------------------------------------------------------- */ 2197 * ------------------------------------------------------------------------- */
2199 2198
2200static int __devinit rivafb_init(void) 2199static int rivafb_init(void)
2201{ 2200{
2202#ifndef MODULE 2201#ifndef MODULE
2203 char *option = NULL; 2202 char *option = NULL;
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 167400e2a18..6a183375ced 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -86,9 +86,8 @@ static int riva_gpio_getsda(void* data)
86 return val; 86 return val;
87} 87}
88 88
89static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan, 89static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name,
90 const char *name, 90 unsigned int i2c_class)
91 unsigned int i2c_class)
92{ 91{
93 int rc; 92 int rc;
94 93
@@ -124,7 +123,7 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan,
124 return rc; 123 return rc;
125} 124}
126 125
127void __devinit riva_create_i2c_busses(struct riva_par *par) 126void riva_create_i2c_busses(struct riva_par *par)
128{ 127{
129 par->chan[0].par = par; 128 par->chan[0].par = par;
130 par->chan[1].par = par; 129 par->chan[1].par = par;
@@ -150,7 +149,7 @@ void riva_delete_i2c_busses(struct riva_par *par)
150 } 149 }
151} 150}
152 151
153int __devinit riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid) 152int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
154{ 153{
155 u8 *edid = NULL; 154 u8 *edid = NULL;
156 155
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 28b1c6c3d8a..76d9053d88c 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -84,7 +84,7 @@ static const char *s1d13xxxfb_prod_names[] = {
84/* 84/*
85 * here we define the default struct fb_fix_screeninfo 85 * here we define the default struct fb_fix_screeninfo
86 */ 86 */
87static struct fb_fix_screeninfo __devinitdata s1d13xxxfb_fix = { 87static struct fb_fix_screeninfo s1d13xxxfb_fix = {
88 .id = S1D_FBID, 88 .id = S1D_FBID,
89 .type = FB_TYPE_PACKED_PIXELS, 89 .type = FB_TYPE_PACKED_PIXELS,
90 .visual = FB_VISUAL_PSEUDOCOLOR, 90 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -622,7 +622,7 @@ static struct fb_ops s1d13xxxfb_fbops = {
622 .fb_imageblit = cfb_imageblit, 622 .fb_imageblit = cfb_imageblit,
623}; 623};
624 624
625static int s1d13xxxfb_width_tab[2][4] __devinitdata = { 625static int s1d13xxxfb_width_tab[2][4] = {
626 {4, 8, 16, -1}, 626 {4, 8, 16, -1},
627 {9, 12, 18, -1}, 627 {9, 12, 18, -1},
628}; 628};
@@ -642,8 +642,7 @@ static int s1d13xxxfb_width_tab[2][4] __devinitdata = {
642 * Note: some of the hardcoded values here might need some love to 642 * Note: some of the hardcoded values here might need some love to
643 * work on various chips, and might need to no longer be hardcoded. 643 * work on various chips, and might need to no longer be hardcoded.
644 */ 644 */
645static void __devinit 645static void s1d13xxxfb_fetch_hw_state(struct fb_info *info)
646s1d13xxxfb_fetch_hw_state(struct fb_info *info)
647{ 646{
648 struct fb_var_screeninfo *var = &info->var; 647 struct fb_var_screeninfo *var = &info->var;
649 struct fb_fix_screeninfo *fix = &info->fix; 648 struct fb_fix_screeninfo *fix = &info->fix;
@@ -764,8 +763,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
764 return 0; 763 return 0;
765} 764}
766 765
767static int __devinit 766static int s1d13xxxfb_probe(struct platform_device *pdev)
768s1d13xxxfb_probe(struct platform_device *pdev)
769{ 767{
770 struct s1d13xxxfb_par *default_par; 768 struct s1d13xxxfb_par *default_par;
771 struct fb_info *info; 769 struct fb_info *info;
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 1a00ad241ed..9b57a235c9b 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1081,8 +1081,7 @@ static void s3c_fb_missing_pixclock(struct fb_videomode *mode)
1081 * 1081 *
1082 * Allocate memory for the given framebuffer. 1082 * Allocate memory for the given framebuffer.
1083 */ 1083 */
1084static int __devinit s3c_fb_alloc_memory(struct s3c_fb *sfb, 1084static int s3c_fb_alloc_memory(struct s3c_fb *sfb, struct s3c_fb_win *win)
1085 struct s3c_fb_win *win)
1086{ 1085{
1087 struct s3c_fb_pd_win *windata = win->windata; 1086 struct s3c_fb_pd_win *windata = win->windata;
1088 unsigned int real_size, virt_size, size; 1087 unsigned int real_size, virt_size, size;
@@ -1172,9 +1171,9 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win)
1172 * Allocate and do the basic initialisation for one of the hardware's graphics 1171 * Allocate and do the basic initialisation for one of the hardware's graphics
1173 * windows. 1172 * windows.
1174 */ 1173 */
1175static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no, 1174static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
1176 struct s3c_fb_win_variant *variant, 1175 struct s3c_fb_win_variant *variant,
1177 struct s3c_fb_win **res) 1176 struct s3c_fb_win **res)
1178{ 1177{
1179 struct fb_var_screeninfo *var; 1178 struct fb_var_screeninfo *var;
1180 struct fb_videomode initmode; 1179 struct fb_videomode initmode;
@@ -1360,7 +1359,7 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
1360 } 1359 }
1361} 1360}
1362 1361
1363static int __devinit s3c_fb_probe(struct platform_device *pdev) 1362static int s3c_fb_probe(struct platform_device *pdev)
1364{ 1363{
1365 const struct platform_device_id *platid; 1364 const struct platform_device_id *platid;
1366 struct s3c_fb_driverdata *fbdrv; 1365 struct s3c_fb_driverdata *fbdrv;
@@ -1521,7 +1520,7 @@ err_bus_clk:
1521 * Shutdown and then release all the resources that the driver allocated 1520 * Shutdown and then release all the resources that the driver allocated
1522 * on initialisation. 1521 * on initialisation.
1523 */ 1522 */
1524static int __devexit s3c_fb_remove(struct platform_device *pdev) 1523static int s3c_fb_remove(struct platform_device *pdev)
1525{ 1524{
1526 struct s3c_fb *sfb = platform_get_drvdata(pdev); 1525 struct s3c_fb *sfb = platform_get_drvdata(pdev);
1527 int win; 1526 int win;
@@ -2035,7 +2034,7 @@ static const struct dev_pm_ops s3cfb_pm_ops = {
2035 2034
2036static struct platform_driver s3c_fb_driver = { 2035static struct platform_driver s3c_fb_driver = {
2037 .probe = s3c_fb_probe, 2036 .probe = s3c_fb_probe,
2038 .remove = __devexit_p(s3c_fb_remove), 2037 .remove = s3c_fb_remove,
2039 .id_table = s3c_fb_driver_ids, 2038 .id_table = s3c_fb_driver_ids,
2040 .driver = { 2039 .driver = {
2041 .name = "s3c-fb", 2040 .name = "s3c-fb",
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 1083bb9469e..76a0e7fbd69 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -637,7 +637,7 @@ static struct fb_ops s3c2410fb_ops = {
637 * cache. Once this area is remapped, all virtual memory 637 * cache. Once this area is remapped, all virtual memory
638 * access to the video memory should occur at the new region. 638 * access to the video memory should occur at the new region.
639 */ 639 */
640static int __devinit s3c2410fb_map_video_memory(struct fb_info *info) 640static int s3c2410fb_map_video_memory(struct fb_info *info)
641{ 641{
642 struct s3c2410fb_info *fbi = info->par; 642 struct s3c2410fb_info *fbi = info->par;
643 dma_addr_t map_dma; 643 dma_addr_t map_dma;
@@ -819,8 +819,8 @@ static inline void s3c2410fb_cpufreq_deregister(struct s3c2410fb_info *info)
819 819
820static const char driver_name[] = "s3c2410fb"; 820static const char driver_name[] = "s3c2410fb";
821 821
822static int __devinit s3c24xxfb_probe(struct platform_device *pdev, 822static int s3c24xxfb_probe(struct platform_device *pdev,
823 enum s3c_drv_type drv_type) 823 enum s3c_drv_type drv_type)
824{ 824{
825 struct s3c2410fb_info *info; 825 struct s3c2410fb_info *info;
826 struct s3c2410fb_display *display; 826 struct s3c2410fb_display *display;
@@ -1010,12 +1010,12 @@ dealloc_fb:
1010 return ret; 1010 return ret;
1011} 1011}
1012 1012
1013static int __devinit s3c2410fb_probe(struct platform_device *pdev) 1013static int s3c2410fb_probe(struct platform_device *pdev)
1014{ 1014{
1015 return s3c24xxfb_probe(pdev, DRV_S3C2410); 1015 return s3c24xxfb_probe(pdev, DRV_S3C2410);
1016} 1016}
1017 1017
1018static int __devinit s3c2412fb_probe(struct platform_device *pdev) 1018static int s3c2412fb_probe(struct platform_device *pdev)
1019{ 1019{
1020 return s3c24xxfb_probe(pdev, DRV_S3C2412); 1020 return s3c24xxfb_probe(pdev, DRV_S3C2412);
1021} 1021}
@@ -1024,7 +1024,7 @@ static int __devinit s3c2412fb_probe(struct platform_device *pdev)
1024/* 1024/*
1025 * Cleanup 1025 * Cleanup
1026 */ 1026 */
1027static int __devexit s3c2410fb_remove(struct platform_device *pdev) 1027static int s3c2410fb_remove(struct platform_device *pdev)
1028{ 1028{
1029 struct fb_info *fbinfo = platform_get_drvdata(pdev); 1029 struct fb_info *fbinfo = platform_get_drvdata(pdev);
1030 struct s3c2410fb_info *info = fbinfo->par; 1030 struct s3c2410fb_info *info = fbinfo->par;
@@ -1101,7 +1101,7 @@ static int s3c2410fb_resume(struct platform_device *dev)
1101 1101
1102static struct platform_driver s3c2410fb_driver = { 1102static struct platform_driver s3c2410fb_driver = {
1103 .probe = s3c2410fb_probe, 1103 .probe = s3c2410fb_probe,
1104 .remove = __devexit_p(s3c2410fb_remove), 1104 .remove = s3c2410fb_remove,
1105 .suspend = s3c2410fb_suspend, 1105 .suspend = s3c2410fb_suspend,
1106 .resume = s3c2410fb_resume, 1106 .resume = s3c2410fb_resume,
1107 .driver = { 1107 .driver = {
@@ -1112,7 +1112,7 @@ static struct platform_driver s3c2410fb_driver = {
1112 1112
1113static struct platform_driver s3c2412fb_driver = { 1113static struct platform_driver s3c2412fb_driver = {
1114 .probe = s3c2412fb_probe, 1114 .probe = s3c2412fb_probe,
1115 .remove = __devexit_p(s3c2410fb_remove), 1115 .remove = s3c2410fb_remove,
1116 .suspend = s3c2410fb_suspend, 1116 .suspend = s3c2410fb_suspend,
1117 .resume = s3c2410fb_resume, 1117 .resume = s3c2410fb_resume,
1118 .driver = { 1118 .driver = {
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 1d007366b91..47ca86c5c6c 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -153,10 +153,10 @@ static const struct svga_timing_regs s3_timing_regs = {
153/* Module parameters */ 153/* Module parameters */
154 154
155 155
156static char *mode_option __devinitdata; 156static char *mode_option;
157 157
158#ifdef CONFIG_MTRR 158#ifdef CONFIG_MTRR
159static int mtrr __devinitdata = 1; 159static int mtrr = 1;
160#endif 160#endif
161 161
162static int fasttext = 1; 162static int fasttext = 1;
@@ -255,7 +255,7 @@ static int s3fb_ddc_getsda(void *data)
255 return !!(s3fb_ddc_read(par) & DDC_SDA_IN); 255 return !!(s3fb_ddc_read(par) & DDC_SDA_IN);
256} 256}
257 257
258static int __devinit s3fb_setup_ddc_bus(struct fb_info *info) 258static int s3fb_setup_ddc_bus(struct fb_info *info)
259{ 259{
260 struct s3fb_info *par = info->par; 260 struct s3fb_info *par = info->par;
261 261
@@ -1066,7 +1066,7 @@ static struct fb_ops s3fb_ops = {
1066 1066
1067/* ------------------------------------------------------------------------- */ 1067/* ------------------------------------------------------------------------- */
1068 1068
1069static int __devinit s3_identification(struct s3fb_info *par) 1069static int s3_identification(struct s3fb_info *par)
1070{ 1070{
1071 int chip = par->chip; 1071 int chip = par->chip;
1072 1072
@@ -1122,7 +1122,7 @@ static int __devinit s3_identification(struct s3fb_info *par)
1122 1122
1123/* PCI probe */ 1123/* PCI probe */
1124 1124
1125static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) 1125static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
1126{ 1126{
1127 struct pci_bus_region bus_reg; 1127 struct pci_bus_region bus_reg;
1128 struct resource vga_res; 1128 struct resource vga_res;
@@ -1403,7 +1403,7 @@ err_enable_device:
1403 1403
1404/* PCI remove */ 1404/* PCI remove */
1405 1405
1406static void __devexit s3_pci_remove(struct pci_dev *dev) 1406static void s3_pci_remove(struct pci_dev *dev)
1407{ 1407{
1408 struct fb_info *info = pci_get_drvdata(dev); 1408 struct fb_info *info = pci_get_drvdata(dev);
1409 struct s3fb_info __maybe_unused *par = info->par; 1409 struct s3fb_info __maybe_unused *par = info->par;
@@ -1509,7 +1509,7 @@ static int s3_pci_resume(struct pci_dev* dev)
1509 1509
1510/* List of boards that we are trying to support */ 1510/* List of boards that we are trying to support */
1511 1511
1512static struct pci_device_id s3_devices[] __devinitdata = { 1512static struct pci_device_id s3_devices[] = {
1513 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO}, 1513 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO},
1514 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO}, 1514 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO},
1515 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP}, 1515 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP},
@@ -1537,7 +1537,7 @@ static struct pci_driver s3fb_pci_driver = {
1537 .name = "s3fb", 1537 .name = "s3fb",
1538 .id_table = s3_devices, 1538 .id_table = s3_devices,
1539 .probe = s3_pci_probe, 1539 .probe = s3_pci_probe,
1540 .remove = __devexit_p(s3_pci_remove), 1540 .remove = s3_pci_remove,
1541 .suspend = s3_pci_suspend, 1541 .suspend = s3_pci_suspend,
1542 .resume = s3_pci_resume, 1542 .resume = s3_pci_resume,
1543}; 1543};
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index b6325848ad6..cfbde5e85cb 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1090,7 +1090,7 @@ static int sa1100fb_resume(struct platform_device *dev)
1090 * cache. Once this area is remapped, all virtual memory 1090 * cache. Once this area is remapped, all virtual memory
1091 * access to the video memory should occur at the new region. 1091 * access to the video memory should occur at the new region.
1092 */ 1092 */
1093static int __devinit sa1100fb_map_video_memory(struct sa1100fb_info *fbi) 1093static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
1094{ 1094{
1095 /* 1095 /*
1096 * We reserve one page for the palette, plus the size 1096 * We reserve one page for the palette, plus the size
@@ -1116,7 +1116,7 @@ static int __devinit sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
1116} 1116}
1117 1117
1118/* Fake monspecs to fill in fbinfo structure */ 1118/* Fake monspecs to fill in fbinfo structure */
1119static struct fb_monspecs monspecs __devinitdata = { 1119static struct fb_monspecs monspecs = {
1120 .hfmin = 30000, 1120 .hfmin = 30000,
1121 .hfmax = 70000, 1121 .hfmax = 70000,
1122 .vfmin = 50, 1122 .vfmin = 50,
@@ -1124,7 +1124,7 @@ static struct fb_monspecs monspecs __devinitdata = {
1124}; 1124};
1125 1125
1126 1126
1127static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) 1127static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
1128{ 1128{
1129 struct sa1100fb_mach_info *inf = dev->platform_data; 1129 struct sa1100fb_mach_info *inf = dev->platform_data;
1130 struct sa1100fb_info *fbi; 1130 struct sa1100fb_info *fbi;
@@ -1205,7 +1205,7 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
1205 return fbi; 1205 return fbi;
1206} 1206}
1207 1207
1208static int __devinit sa1100fb_probe(struct platform_device *pdev) 1208static int sa1100fb_probe(struct platform_device *pdev)
1209{ 1209{
1210 struct sa1100fb_info *fbi; 1210 struct sa1100fb_info *fbi;
1211 struct resource *res; 1211 struct resource *res;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index f4f53b082d0..741b2395d01 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -69,7 +69,7 @@
69/* --------------------------------------------------------------------- */ 69/* --------------------------------------------------------------------- */
70 70
71 71
72static char *mode_option __devinitdata = NULL; 72static char *mode_option = NULL;
73 73
74#ifdef MODULE 74#ifdef MODULE
75 75
@@ -1664,7 +1664,7 @@ static struct fb_ops savagefb_ops = {
1664 1664
1665/* --------------------------------------------------------------------- */ 1665/* --------------------------------------------------------------------- */
1666 1666
1667static struct fb_var_screeninfo __devinitdata savagefb_var800x600x8 = { 1667static struct fb_var_screeninfo savagefb_var800x600x8 = {
1668 .accel_flags = FB_ACCELF_TEXT, 1668 .accel_flags = FB_ACCELF_TEXT,
1669 .xres = 800, 1669 .xres = 800,
1670 .yres = 600, 1670 .yres = 600,
@@ -1715,7 +1715,7 @@ static void savage_disable_mmio(struct savagefb_par *par)
1715} 1715}
1716 1716
1717 1717
1718static int __devinit savage_map_mmio(struct fb_info *info) 1718static int savage_map_mmio(struct fb_info *info)
1719{ 1719{
1720 struct savagefb_par *par = info->par; 1720 struct savagefb_par *par = info->par;
1721 DBG("savage_map_mmio"); 1721 DBG("savage_map_mmio");
@@ -1761,8 +1761,7 @@ static void savage_unmap_mmio(struct fb_info *info)
1761 } 1761 }
1762} 1762}
1763 1763
1764static int __devinit savage_map_video(struct fb_info *info, 1764static int savage_map_video(struct fb_info *info, int video_len)
1765 int video_len)
1766{ 1765{
1767 struct savagefb_par *par = info->par; 1766 struct savagefb_par *par = info->par;
1768 int resource; 1767 int resource;
@@ -2052,9 +2051,8 @@ static int savage_init_hw(struct savagefb_par *par)
2052 return videoRambytes; 2051 return videoRambytes;
2053} 2052}
2054 2053
2055static int __devinit savage_init_fb_info(struct fb_info *info, 2054static int savage_init_fb_info(struct fb_info *info, struct pci_dev *dev,
2056 struct pci_dev *dev, 2055 const struct pci_device_id *id)
2057 const struct pci_device_id *id)
2058{ 2056{
2059 struct savagefb_par *par = info->par; 2057 struct savagefb_par *par = info->par;
2060 int err = 0; 2058 int err = 0;
@@ -2178,8 +2176,7 @@ static int __devinit savage_init_fb_info(struct fb_info *info,
2178 2176
2179/* --------------------------------------------------------------------- */ 2177/* --------------------------------------------------------------------- */
2180 2178
2181static int __devinit savagefb_probe(struct pci_dev* dev, 2179static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
2182 const struct pci_device_id* id)
2183{ 2180{
2184 struct fb_info *info; 2181 struct fb_info *info;
2185 struct savagefb_par *par; 2182 struct savagefb_par *par;
@@ -2340,7 +2337,7 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
2340 return err; 2337 return err;
2341} 2338}
2342 2339
2343static void __devexit savagefb_remove(struct pci_dev *dev) 2340static void savagefb_remove(struct pci_dev *dev)
2344{ 2341{
2345 struct fb_info *info = pci_get_drvdata(dev); 2342 struct fb_info *info = pci_get_drvdata(dev);
2346 2343
@@ -2449,7 +2446,7 @@ static int savagefb_resume(struct pci_dev* dev)
2449} 2446}
2450 2447
2451 2448
2452static struct pci_device_id savagefb_devices[] __devinitdata = { 2449static struct pci_device_id savagefb_devices[] = {
2453 {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128, 2450 {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128,
2454 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, 2451 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2455 2452
@@ -2530,7 +2527,7 @@ static struct pci_driver savagefb_driver = {
2530 .probe = savagefb_probe, 2527 .probe = savagefb_probe,
2531 .suspend = savagefb_suspend, 2528 .suspend = savagefb_suspend,
2532 .resume = savagefb_resume, 2529 .resume = savagefb_resume,
2533 .remove = __devexit_p(savagefb_remove) 2530 .remove = savagefb_remove,
2534}; 2531};
2535 2532
2536/* **************************** exit-time only **************************** */ 2533/* **************************** exit-time only **************************** */
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index 53455f29551..2331fadc272 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -47,7 +47,7 @@ static int ywrap = 0;
47 47
48static int flatpanel_id = -1; 48static int flatpanel_id = -1;
49 49
50static struct fb_fix_screeninfo sgivwfb_fix __devinitdata = { 50static struct fb_fix_screeninfo sgivwfb_fix = {
51 .id = "SGI Vis WS FB", 51 .id = "SGI Vis WS FB",
52 .type = FB_TYPE_PACKED_PIXELS, 52 .type = FB_TYPE_PACKED_PIXELS,
53 .visual = FB_VISUAL_PSEUDOCOLOR, 53 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -57,7 +57,7 @@ static struct fb_fix_screeninfo sgivwfb_fix __devinitdata = {
57 .line_length = 640, 57 .line_length = 640,
58}; 58};
59 59
60static struct fb_var_screeninfo sgivwfb_var __devinitdata = { 60static struct fb_var_screeninfo sgivwfb_var = {
61 /* 640x480, 8 bpp */ 61 /* 640x480, 8 bpp */
62 .xres = 640, 62 .xres = 640,
63 .yres = 480, 63 .yres = 480,
@@ -79,7 +79,7 @@ static struct fb_var_screeninfo sgivwfb_var __devinitdata = {
79 .vmode = FB_VMODE_NONINTERLACED 79 .vmode = FB_VMODE_NONINTERLACED
80}; 80};
81 81
82static struct fb_var_screeninfo sgivwfb_var1600sw __devinitdata = { 82static struct fb_var_screeninfo sgivwfb_var1600sw = {
83 /* 1600x1024, 8 bpp */ 83 /* 1600x1024, 8 bpp */
84 .xres = 1600, 84 .xres = 1600,
85 .yres = 1024, 85 .yres = 1024,
@@ -745,7 +745,7 @@ int __init sgivwfb_setup(char *options)
745/* 745/*
746 * Initialisation 746 * Initialisation
747 */ 747 */
748static int __devinit sgivwfb_probe(struct platform_device *dev) 748static int sgivwfb_probe(struct platform_device *dev)
749{ 749{
750 struct sgivw_par *par; 750 struct sgivw_par *par;
751 struct fb_info *info; 751 struct fb_info *info;
@@ -825,7 +825,7 @@ fail_ioremap_regs:
825 return -ENXIO; 825 return -ENXIO;
826} 826}
827 827
828static int __devexit sgivwfb_remove(struct platform_device *dev) 828static int sgivwfb_remove(struct platform_device *dev)
829{ 829{
830 struct fb_info *info = platform_get_drvdata(dev); 830 struct fb_info *info = platform_get_drvdata(dev);
831 831
@@ -845,7 +845,7 @@ static int __devexit sgivwfb_remove(struct platform_device *dev)
845 845
846static struct platform_driver sgivwfb_driver = { 846static struct platform_driver sgivwfb_driver = {
847 .probe = sgivwfb_probe, 847 .probe = sgivwfb_probe,
848 .remove = __devexit_p(sgivwfb_remove), 848 .remove = sgivwfb_remove,
849 .driver = { 849 .driver = {
850 .name = "sgivwfb", 850 .name = "sgivwfb",
851 }, 851 },
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
index 83b16e237a0..5fbb0c7ab0c 100644
--- a/drivers/video/sh7760fb.c
+++ b/drivers/video/sh7760fb.c
@@ -431,7 +431,7 @@ static int sh7760fb_alloc_mem(struct fb_info *info)
431 return 0; 431 return 0;
432} 432}
433 433
434static int __devinit sh7760fb_probe(struct platform_device *pdev) 434static int sh7760fb_probe(struct platform_device *pdev)
435{ 435{
436 struct fb_info *info; 436 struct fb_info *info;
437 struct resource *res; 437 struct resource *res;
@@ -557,7 +557,7 @@ out_fb:
557 return ret; 557 return ret;
558} 558}
559 559
560static int __devexit sh7760fb_remove(struct platform_device *dev) 560static int sh7760fb_remove(struct platform_device *dev)
561{ 561{
562 struct fb_info *info = platform_get_drvdata(dev); 562 struct fb_info *info = platform_get_drvdata(dev);
563 struct sh7760fb_par *par = info->par; 563 struct sh7760fb_par *par = info->par;
@@ -582,7 +582,7 @@ static struct platform_driver sh7760_lcdc_driver = {
582 .owner = THIS_MODULE, 582 .owner = THIS_MODULE,
583 }, 583 },
584 .probe = sh7760fb_probe, 584 .probe = sh7760fb_probe,
585 .remove = __devexit_p(sh7760fb_remove), 585 .remove = sh7760fb_remove,
586}; 586};
587 587
588module_platform_driver(sh7760_lcdc_driver); 588module_platform_driver(sh7760_lcdc_driver);
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index f4962292792..701b461cf8a 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -533,7 +533,7 @@ efindslot:
533 return ret; 533 return ret;
534} 534}
535 535
536static int __devexit sh_mipi_remove(struct platform_device *pdev) 536static int sh_mipi_remove(struct platform_device *pdev)
537{ 537{
538 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 538 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
539 struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); 539 struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -574,7 +574,7 @@ static int __devexit sh_mipi_remove(struct platform_device *pdev)
574} 574}
575 575
576static struct platform_driver sh_mipi_driver = { 576static struct platform_driver sh_mipi_driver = {
577 .remove = __devexit_p(sh_mipi_remove), 577 .remove = sh_mipi_remove,
578 .shutdown = sh_mipi_shutdown, 578 .shutdown = sh_mipi_shutdown,
579 .driver = { 579 .driver = {
580 .name = "sh-mipi-dsi", 580 .name = "sh-mipi-dsi",
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index e78fe4bc152..63203acef81 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1649,7 +1649,7 @@ sh_mobile_lcdc_overlay_fb_unregister(struct sh_mobile_lcdc_overlay *ovl)
1649 unregister_framebuffer(ovl->info); 1649 unregister_framebuffer(ovl->info);
1650} 1650}
1651 1651
1652static int __devinit 1652static int
1653sh_mobile_lcdc_overlay_fb_register(struct sh_mobile_lcdc_overlay *ovl) 1653sh_mobile_lcdc_overlay_fb_register(struct sh_mobile_lcdc_overlay *ovl)
1654{ 1654{
1655 struct sh_mobile_lcdc_priv *lcdc = ovl->channel->lcdc; 1655 struct sh_mobile_lcdc_priv *lcdc = ovl->channel->lcdc;
@@ -1688,7 +1688,7 @@ sh_mobile_lcdc_overlay_fb_cleanup(struct sh_mobile_lcdc_overlay *ovl)
1688 framebuffer_release(info); 1688 framebuffer_release(info);
1689} 1689}
1690 1690
1691static int __devinit 1691static int
1692sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl) 1692sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)
1693{ 1693{
1694 struct sh_mobile_lcdc_priv *priv = ovl->channel->lcdc; 1694 struct sh_mobile_lcdc_priv *priv = ovl->channel->lcdc;
@@ -2137,7 +2137,7 @@ sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
2137 unregister_framebuffer(ch->info); 2137 unregister_framebuffer(ch->info);
2138} 2138}
2139 2139
2140static int __devinit 2140static int
2141sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch) 2141sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
2142{ 2142{
2143 struct fb_info *info = ch->info; 2143 struct fb_info *info = ch->info;
@@ -2185,7 +2185,7 @@ sh_mobile_lcdc_channel_fb_cleanup(struct sh_mobile_lcdc_chan *ch)
2185 framebuffer_release(info); 2185 framebuffer_release(info);
2186} 2186}
2187 2187
2188static int __devinit 2188static int
2189sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch, 2189sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
2190 const struct fb_videomode *modes, 2190 const struct fb_videomode *modes,
2191 unsigned int num_modes) 2191 unsigned int num_modes)
@@ -2417,7 +2417,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
2417 * Probe/remove and driver init/exit 2417 * Probe/remove and driver init/exit
2418 */ 2418 */
2419 2419
2420static const struct fb_videomode default_720p __devinitconst = { 2420static const struct fb_videomode default_720p = {
2421 .name = "HDMI 720p", 2421 .name = "HDMI 720p",
2422 .xres = 1280, 2422 .xres = 1280,
2423 .yres = 720, 2423 .yres = 720,
@@ -2496,7 +2496,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
2496 return 0; 2496 return 0;
2497} 2497}
2498 2498
2499static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch) 2499static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
2500{ 2500{
2501 int interface_type = ch->cfg->interface_type; 2501 int interface_type = ch->cfg->interface_type;
2502 2502
@@ -2536,7 +2536,7 @@ static int __devinit sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *
2536 return 0; 2536 return 0;
2537} 2537}
2538 2538
2539static int __devinit 2539static int
2540sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_overlay *ovl) 2540sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_overlay *ovl)
2541{ 2541{
2542 const struct sh_mobile_lcdc_format_info *format; 2542 const struct sh_mobile_lcdc_format_info *format;
@@ -2591,7 +2591,7 @@ sh_mobile_lcdc_overlay_init(struct sh_mobile_lcdc_overlay *ovl)
2591 return 0; 2591 return 0;
2592} 2592}
2593 2593
2594static int __devinit 2594static int
2595sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch) 2595sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch)
2596{ 2596{
2597 const struct sh_mobile_lcdc_format_info *format; 2597 const struct sh_mobile_lcdc_format_info *format;
@@ -2695,7 +2695,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch)
2695 return sh_mobile_lcdc_channel_fb_init(ch, mode, num_modes); 2695 return sh_mobile_lcdc_channel_fb_init(ch, mode, num_modes);
2696} 2696}
2697 2697
2698static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) 2698static int sh_mobile_lcdc_probe(struct platform_device *pdev)
2699{ 2699{
2700 struct sh_mobile_lcdc_info *pdata = pdev->dev.platform_data; 2700 struct sh_mobile_lcdc_info *pdata = pdev->dev.platform_data;
2701 struct sh_mobile_lcdc_priv *priv; 2701 struct sh_mobile_lcdc_priv *priv;
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
index 7a0ba8bb3fb..e0f098562a7 100644
--- a/drivers/video/sh_mobile_meram.c
+++ b/drivers/video/sh_mobile_meram.c
@@ -620,7 +620,7 @@ static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
620 * Probe/remove and driver init/exit 620 * Probe/remove and driver init/exit
621 */ 621 */
622 622
623static int __devinit sh_mobile_meram_probe(struct platform_device *pdev) 623static int sh_mobile_meram_probe(struct platform_device *pdev)
624{ 624{
625 struct sh_mobile_meram_priv *priv; 625 struct sh_mobile_meram_priv *priv;
626 struct sh_mobile_meram_info *pdata = pdev->dev.platform_data; 626 struct sh_mobile_meram_info *pdata = pdev->dev.platform_data;
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index a7a48db64ce..977e27927a2 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -106,8 +106,7 @@ sisfb_setdefaultparms(void)
106 106
107/* ------------- Parameter parsing -------------- */ 107/* ------------- Parameter parsing -------------- */
108 108
109static void __devinit 109static void sisfb_search_vesamode(unsigned int vesamode, bool quiet)
110sisfb_search_vesamode(unsigned int vesamode, bool quiet)
111{ 110{
112 int i = 0, j = 0; 111 int i = 0, j = 0;
113 112
@@ -146,8 +145,7 @@ sisfb_search_vesamode(unsigned int vesamode, bool quiet)
146 printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode); 145 printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
147} 146}
148 147
149static void __devinit 148static void sisfb_search_mode(char *name, bool quiet)
150sisfb_search_mode(char *name, bool quiet)
151{ 149{
152 unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0; 150 unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
153 int i = 0; 151 int i = 0;
@@ -225,8 +223,7 @@ sisfb_search_mode(char *name, bool quiet)
225} 223}
226 224
227#ifndef MODULE 225#ifndef MODULE
228static void __devinit 226static void sisfb_get_vga_mode_from_kernel(void)
229sisfb_get_vga_mode_from_kernel(void)
230{ 227{
231#ifdef CONFIG_X86 228#ifdef CONFIG_X86
232 char mymode[32]; 229 char mymode[32];
@@ -345,8 +342,7 @@ sisfb_search_specialtiming(const char *name)
345 342
346/* ----------- Various detection routines ----------- */ 343/* ----------- Various detection routines ----------- */
347 344
348static void __devinit 345static void sisfb_detect_custom_timing(struct sis_video_info *ivideo)
349sisfb_detect_custom_timing(struct sis_video_info *ivideo)
350{ 346{
351 unsigned char *biosver = NULL; 347 unsigned char *biosver = NULL;
352 unsigned char *biosdate = NULL; 348 unsigned char *biosdate = NULL;
@@ -403,8 +399,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
403 } while(mycustomttable[i].chipID); 399 } while(mycustomttable[i].chipID);
404} 400}
405 401
406static bool __devinit 402static bool sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
407sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
408{ 403{
409 int i, j, xres, yres, refresh, index; 404 int i, j, xres, yres, refresh, index;
410 u32 emodes; 405 u32 emodes;
@@ -505,8 +500,8 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
505 return monitor->datavalid; 500 return monitor->datavalid;
506} 501}
507 502
508static void __devinit 503static void sisfb_handle_ddc(struct sis_video_info *ivideo,
509sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, int crtno) 504 struct sisfb_monitor *monitor, int crtno)
510{ 505{
511 unsigned short temp, i, realcrtno = crtno; 506 unsigned short temp, i, realcrtno = crtno;
512 unsigned char buffer[256]; 507 unsigned char buffer[256];
@@ -1898,8 +1893,7 @@ static struct fb_ops sisfb_ops = {
1898 1893
1899/* ---------------- Chip generation dependent routines ---------------- */ 1894/* ---------------- Chip generation dependent routines ---------------- */
1900 1895
1901static struct pci_dev * __devinit 1896static struct pci_dev *sisfb_get_northbridge(int basechipid)
1902sisfb_get_northbridge(int basechipid)
1903{ 1897{
1904 struct pci_dev *pdev = NULL; 1898 struct pci_dev *pdev = NULL;
1905 int nbridgenum, nbridgeidx, i; 1899 int nbridgenum, nbridgeidx, i;
@@ -1938,8 +1932,7 @@ sisfb_get_northbridge(int basechipid)
1938 return pdev; 1932 return pdev;
1939} 1933}
1940 1934
1941static int __devinit 1935static int sisfb_get_dram_size(struct sis_video_info *ivideo)
1942sisfb_get_dram_size(struct sis_video_info *ivideo)
1943{ 1936{
1944#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 1937#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
1945 u8 reg; 1938 u8 reg;
@@ -2038,8 +2031,7 @@ sisfb_get_dram_size(struct sis_video_info *ivideo)
2038 2031
2039/* -------------- video bridge device detection --------------- */ 2032/* -------------- video bridge device detection --------------- */
2040 2033
2041static void __devinit 2034static void sisfb_detect_VB_connect(struct sis_video_info *ivideo)
2042sisfb_detect_VB_connect(struct sis_video_info *ivideo)
2043{ 2035{
2044 u8 cr32, temp; 2036 u8 cr32, temp;
2045 2037
@@ -2164,8 +2156,7 @@ sisfb_detect_VB_connect(struct sis_video_info *ivideo)
2164 2156
2165/* ------------------ Sensing routines ------------------ */ 2157/* ------------------ Sensing routines ------------------ */
2166 2158
2167static bool __devinit 2159static bool sisfb_test_DDC1(struct sis_video_info *ivideo)
2168sisfb_test_DDC1(struct sis_video_info *ivideo)
2169{ 2160{
2170 unsigned short old; 2161 unsigned short old;
2171 int count = 48; 2162 int count = 48;
@@ -2177,8 +2168,7 @@ sisfb_test_DDC1(struct sis_video_info *ivideo)
2177 return (count != -1); 2168 return (count != -1);
2178} 2169}
2179 2170
2180static void __devinit 2171static void sisfb_sense_crt1(struct sis_video_info *ivideo)
2181sisfb_sense_crt1(struct sis_video_info *ivideo)
2182{ 2172{
2183 bool mustwait = false; 2173 bool mustwait = false;
2184 u8 sr1F, cr17; 2174 u8 sr1F, cr17;
@@ -2259,8 +2249,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
2259} 2249}
2260 2250
2261/* Determine and detect attached devices on SiS30x */ 2251/* Determine and detect attached devices on SiS30x */
2262static void __devinit 2252static void SiS_SenseLCD(struct sis_video_info *ivideo)
2263SiS_SenseLCD(struct sis_video_info *ivideo)
2264{ 2253{
2265 unsigned char buffer[256]; 2254 unsigned char buffer[256];
2266 unsigned short temp, realcrtno, i; 2255 unsigned short temp, realcrtno, i;
@@ -2347,8 +2336,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
2347 ivideo->SiS_Pr.PanelSelfDetected = true; 2336 ivideo->SiS_Pr.PanelSelfDetected = true;
2348} 2337}
2349 2338
2350static int __devinit 2339static int SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
2351SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
2352{ 2340{
2353 int temp, mytest, result, i, j; 2341 int temp, mytest, result, i, j;
2354 2342
@@ -2377,8 +2365,7 @@ SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
2377 return result; 2365 return result;
2378} 2366}
2379 2367
2380static void __devinit 2368static void SiS_Sense30x(struct sis_video_info *ivideo)
2381SiS_Sense30x(struct sis_video_info *ivideo)
2382{ 2369{
2383 u8 backupP4_0d,backupP2_00,backupP2_4d,backupSR_1e,biosflag=0; 2370 u8 backupP4_0d,backupP2_00,backupP2_4d,backupSR_1e,biosflag=0;
2384 u16 svhs=0, svhs_c=0; 2371 u16 svhs=0, svhs_c=0;
@@ -2518,8 +2505,7 @@ SiS_Sense30x(struct sis_video_info *ivideo)
2518} 2505}
2519 2506
2520/* Determine and detect attached TV's on Chrontel */ 2507/* Determine and detect attached TV's on Chrontel */
2521static void __devinit 2508static void SiS_SenseCh(struct sis_video_info *ivideo)
2522SiS_SenseCh(struct sis_video_info *ivideo)
2523{ 2509{
2524#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 2510#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
2525 u8 temp1, temp2; 2511 u8 temp1, temp2;
@@ -2643,8 +2629,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
2643 } 2629 }
2644} 2630}
2645 2631
2646static void __devinit 2632static void sisfb_get_VB_type(struct sis_video_info *ivideo)
2647sisfb_get_VB_type(struct sis_video_info *ivideo)
2648{ 2633{
2649 char stdstr[] = "sisfb: Detected"; 2634 char stdstr[] = "sisfb: Detected";
2650 char bridgestr[] = "video bridge"; 2635 char bridgestr[] = "video bridge";
@@ -2906,8 +2891,7 @@ sisfb_engine_init(struct sis_video_info *ivideo)
2906 ivideo->engineok = 1; 2891 ivideo->engineok = 1;
2907} 2892}
2908 2893
2909static void __devinit 2894static void sisfb_detect_lcd_type(struct sis_video_info *ivideo)
2910sisfb_detect_lcd_type(struct sis_video_info *ivideo)
2911{ 2895{
2912 u8 reg; 2896 u8 reg;
2913 int i; 2897 int i;
@@ -2962,8 +2946,7 @@ sisfb_detect_lcd_type(struct sis_video_info *ivideo)
2962 ivideo->lcdxres, ivideo->lcdyres); 2946 ivideo->lcdxres, ivideo->lcdyres);
2963} 2947}
2964 2948
2965static void __devinit 2949static void sisfb_save_pdc_emi(struct sis_video_info *ivideo)
2966sisfb_save_pdc_emi(struct sis_video_info *ivideo)
2967{ 2950{
2968#ifdef CONFIG_FB_SIS_300 2951#ifdef CONFIG_FB_SIS_300
2969 /* Save the current PanelDelayCompensation if the LCD is currently used */ 2952 /* Save the current PanelDelayCompensation if the LCD is currently used */
@@ -3081,8 +3064,7 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
3081 3064
3082/* -------------------- Memory manager routines ---------------------- */ 3065/* -------------------- Memory manager routines ---------------------- */
3083 3066
3084static u32 __devinit 3067static u32 sisfb_getheapstart(struct sis_video_info *ivideo)
3085sisfb_getheapstart(struct sis_video_info *ivideo)
3086{ 3068{
3087 u32 ret = ivideo->sisfb_parm_mem * 1024; 3069 u32 ret = ivideo->sisfb_parm_mem * 1024;
3088 u32 maxoffs = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize; 3070 u32 maxoffs = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize;
@@ -3128,8 +3110,7 @@ sisfb_getheapstart(struct sis_video_info *ivideo)
3128 return ret; 3110 return ret;
3129} 3111}
3130 3112
3131static u32 __devinit 3113static u32 sisfb_getheapsize(struct sis_video_info *ivideo)
3132sisfb_getheapsize(struct sis_video_info *ivideo)
3133{ 3114{
3134 u32 max = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize; 3115 u32 max = ivideo->video_size - ivideo->hwcursor_size - ivideo->cmdQueueSize;
3135 u32 ret = 0; 3116 u32 ret = 0;
@@ -3154,8 +3135,7 @@ sisfb_getheapsize(struct sis_video_info *ivideo)
3154 return ret; 3135 return ret;
3155} 3136}
3156 3137
3157static int __devinit 3138static int sisfb_heap_init(struct sis_video_info *ivideo)
3158sisfb_heap_init(struct sis_video_info *ivideo)
3159{ 3139{
3160 struct SIS_OH *poh; 3140 struct SIS_OH *poh;
3161 3141
@@ -4061,8 +4041,8 @@ static int __init sisfb_setup(char *options)
4061} 4041}
4062#endif 4042#endif
4063 4043
4064static int __devinit 4044static int sisfb_check_rom(void __iomem *rom_base,
4065sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo) 4045 struct sis_video_info *ivideo)
4066{ 4046{
4067 void __iomem *rom; 4047 void __iomem *rom;
4068 int romptr; 4048 int romptr;
@@ -4089,8 +4069,7 @@ sisfb_check_rom(void __iomem *rom_base, struct sis_video_info *ivideo)
4089 return 1; 4069 return 1;
4090} 4070}
4091 4071
4092static unsigned char * __devinit 4072static unsigned char *sisfb_find_rom(struct pci_dev *pdev)
4093sisfb_find_rom(struct pci_dev *pdev)
4094{ 4073{
4095 struct sis_video_info *ivideo = pci_get_drvdata(pdev); 4074 struct sis_video_info *ivideo = pci_get_drvdata(pdev);
4096 void __iomem *rom_base; 4075 void __iomem *rom_base;
@@ -4149,9 +4128,8 @@ sisfb_find_rom(struct pci_dev *pdev)
4149 return myrombase; 4128 return myrombase;
4150} 4129}
4151 4130
4152static void __devinit 4131static void sisfb_post_map_vram(struct sis_video_info *ivideo,
4153sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize, 4132 unsigned int *mapsize, unsigned int min)
4154 unsigned int min)
4155{ 4133{
4156 if (*mapsize < (min << 20)) 4134 if (*mapsize < (min << 20))
4157 return; 4135 return;
@@ -4176,8 +4154,7 @@ sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize,
4176} 4154}
4177 4155
4178#ifdef CONFIG_FB_SIS_300 4156#ifdef CONFIG_FB_SIS_300
4179static int __devinit 4157static int sisfb_post_300_buswidth(struct sis_video_info *ivideo)
4180sisfb_post_300_buswidth(struct sis_video_info *ivideo)
4181{ 4158{
4182 void __iomem *FBAddress = ivideo->video_vbase; 4159 void __iomem *FBAddress = ivideo->video_vbase;
4183 unsigned short temp; 4160 unsigned short temp;
@@ -4222,7 +4199,7 @@ sisfb_post_300_buswidth(struct sis_video_info *ivideo)
4222 return 1; /* 32bit */ 4199 return 1; /* 32bit */
4223} 4200}
4224 4201
4225static const unsigned short __devinitconst SiS_DRAMType[17][5] = { 4202static const unsigned short SiS_DRAMType[17][5] = {
4226 {0x0C,0x0A,0x02,0x40,0x39}, 4203 {0x0C,0x0A,0x02,0x40,0x39},
4227 {0x0D,0x0A,0x01,0x40,0x48}, 4204 {0x0D,0x0A,0x01,0x40,0x48},
4228 {0x0C,0x09,0x02,0x20,0x35}, 4205 {0x0C,0x09,0x02,0x20,0x35},
@@ -4242,10 +4219,9 @@ static const unsigned short __devinitconst SiS_DRAMType[17][5] = {
4242 {0x09,0x08,0x01,0x01,0x00} 4219 {0x09,0x08,0x01,0x01,0x00}
4243}; 4220};
4244 4221
4245static int __devinit 4222static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration,
4246sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth, 4223 int buswidth, int PseudoRankCapacity,
4247 int PseudoRankCapacity, int PseudoAdrPinCount, 4224 int PseudoAdrPinCount, unsigned int mapsize)
4248 unsigned int mapsize)
4249{ 4225{
4250 void __iomem *FBAddr = ivideo->video_vbase; 4226 void __iomem *FBAddr = ivideo->video_vbase;
4251 unsigned short sr14; 4227 unsigned short sr14;
@@ -4309,8 +4285,7 @@ sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth
4309 return 0; 4285 return 0;
4310} 4286}
4311 4287
4312static void __devinit 4288static void sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
4313sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
4314{ 4289{
4315 struct sis_video_info *ivideo = pci_get_drvdata(pdev); 4290 struct sis_video_info *ivideo = pci_get_drvdata(pdev);
4316 int i, j, buswidth; 4291 int i, j, buswidth;
@@ -4335,8 +4310,7 @@ sisfb_post_300_ramsize(struct pci_dev *pdev, unsigned int mapsize)
4335 } 4310 }
4336} 4311}
4337 4312
4338static void __devinit 4313static void sisfb_post_sis300(struct pci_dev *pdev)
4339sisfb_post_sis300(struct pci_dev *pdev)
4340{ 4314{
4341 struct sis_video_info *ivideo = pci_get_drvdata(pdev); 4315 struct sis_video_info *ivideo = pci_get_drvdata(pdev);
4342 unsigned char *bios = ivideo->SiS_Pr.VirtualRomBase; 4316 unsigned char *bios = ivideo->SiS_Pr.VirtualRomBase;
@@ -4547,8 +4521,7 @@ sisfb_post_sis300(struct pci_dev *pdev)
4547 4521
4548#ifdef CONFIG_FB_SIS_315 4522#ifdef CONFIG_FB_SIS_315
4549#if 0 4523#if 0
4550static void __devinit 4524static void sisfb_post_sis315330(struct pci_dev *pdev)
4551sisfb_post_sis315330(struct pci_dev *pdev)
4552{ 4525{
4553 /* TODO */ 4526 /* TODO */
4554} 4527}
@@ -4559,8 +4532,7 @@ static inline int sisfb_xgi_is21(struct sis_video_info *ivideo)
4559 return ivideo->chip_real_id == XGI_21; 4532 return ivideo->chip_real_id == XGI_21;
4560} 4533}
4561 4534
4562static void __devinit 4535static void sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
4563sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
4564{ 4536{
4565 unsigned int i; 4537 unsigned int i;
4566 u8 reg; 4538 u8 reg;
@@ -4571,9 +4543,9 @@ sisfb_post_xgi_delay(struct sis_video_info *ivideo, int delay)
4571 } 4543 }
4572} 4544}
4573 4545
4574static int __devinit 4546static int sisfb_find_host_bridge(struct sis_video_info *ivideo,
4575sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev, 4547 struct pci_dev *mypdev,
4576 unsigned short pcivendor) 4548 unsigned short pcivendor)
4577{ 4549{
4578 struct pci_dev *pdev = NULL; 4550 struct pci_dev *pdev = NULL;
4579 unsigned short temp; 4551 unsigned short temp;
@@ -4591,9 +4563,8 @@ sisfb_find_host_bridge(struct sis_video_info *ivideo, struct pci_dev *mypdev,
4591 return ret; 4563 return ret;
4592} 4564}
4593 4565
4594static int __devinit 4566static int sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
4595sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta, 4567 unsigned int enda, unsigned int mapsize)
4596 unsigned int enda, unsigned int mapsize)
4597{ 4568{
4598 unsigned int pos; 4569 unsigned int pos;
4599 int i; 4570 int i;
@@ -4623,8 +4594,7 @@ sisfb_post_xgi_rwtest(struct sis_video_info *ivideo, int starta,
4623 return 1; 4594 return 1;
4624} 4595}
4625 4596
4626static int __devinit 4597static int sisfb_post_xgi_ramsize(struct sis_video_info *ivideo)
4627sisfb_post_xgi_ramsize(struct sis_video_info *ivideo)
4628{ 4598{
4629 unsigned int buswidth, ranksize, channelab, mapsize; 4599 unsigned int buswidth, ranksize, channelab, mapsize;
4630 int i, j, k, l, status; 4600 int i, j, k, l, status;
@@ -4876,8 +4846,7 @@ bail_out:
4876 return status; 4846 return status;
4877} 4847}
4878 4848
4879static void __devinit 4849static void sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
4880sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
4881{ 4850{
4882 u8 v1, v2, v3; 4851 u8 v1, v2, v3;
4883 int index; 4852 int index;
@@ -4932,8 +4901,8 @@ sisfb_post_xgi_setclocks(struct sis_video_info *ivideo, u8 regb)
4932 sisfb_post_xgi_delay(ivideo, 0x43); 4901 sisfb_post_xgi_delay(ivideo, 0x43);
4933} 4902}
4934 4903
4935static void __devinit 4904static void sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo,
4936sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb) 4905 u8 regb)
4937{ 4906{
4938 unsigned char *bios = ivideo->bios_abase; 4907 unsigned char *bios = ivideo->bios_abase;
4939 u8 v1; 4908 u8 v1;
@@ -4973,8 +4942,7 @@ sisfb_post_xgi_ddr2_mrs_default(struct sis_video_info *ivideo, u8 regb)
4973 sisfb_post_xgi_delay(ivideo, 1); 4942 sisfb_post_xgi_delay(ivideo, 1);
4974} 4943}
4975 4944
4976static void __devinit 4945static void sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
4977sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
4978{ 4946{
4979 sisfb_post_xgi_setclocks(ivideo, 1); 4947 sisfb_post_xgi_setclocks(ivideo, 1);
4980 4948
@@ -5015,8 +4983,7 @@ sisfb_post_xgi_ddr2_mrs_xg21(struct sis_video_info *ivideo)
5015 sisfb_post_xgi_delay(ivideo, 1); 4983 sisfb_post_xgi_delay(ivideo, 1);
5016} 4984}
5017 4985
5018static void __devinit 4986static void sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
5019sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
5020{ 4987{
5021 unsigned char *bios = ivideo->bios_abase; 4988 unsigned char *bios = ivideo->bios_abase;
5022 static const u8 cs158[8] = { 4989 static const u8 cs158[8] = {
@@ -5061,8 +5028,7 @@ sisfb_post_xgi_ddr2(struct sis_video_info *ivideo, u8 regb)
5061 sisfb_post_xgi_ddr2_mrs_default(ivideo, regb); 5028 sisfb_post_xgi_ddr2_mrs_default(ivideo, regb);
5062} 5029}
5063 5030
5064static u8 __devinit 5031static u8 sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
5065sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
5066{ 5032{
5067 unsigned char *bios = ivideo->bios_abase; 5033 unsigned char *bios = ivideo->bios_abase;
5068 u8 ramtype; 5034 u8 ramtype;
@@ -5101,8 +5067,7 @@ sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
5101 return ramtype; 5067 return ramtype;
5102} 5068}
5103 5069
5104static int __devinit 5070static int sisfb_post_xgi(struct pci_dev *pdev)
5105sisfb_post_xgi(struct pci_dev *pdev)
5106{ 5071{
5107 struct sis_video_info *ivideo = pci_get_drvdata(pdev); 5072 struct sis_video_info *ivideo = pci_get_drvdata(pdev);
5108 unsigned char *bios = ivideo->bios_abase; 5073 unsigned char *bios = ivideo->bios_abase;
@@ -5839,8 +5804,7 @@ sisfb_post_xgi(struct pci_dev *pdev)
5839} 5804}
5840#endif 5805#endif
5841 5806
5842static int __devinit 5807static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5843sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5844{ 5808{
5845 struct sisfb_chip_info *chipinfo = &sisfb_chip_info[ent->driver_data]; 5809 struct sisfb_chip_info *chipinfo = &sisfb_chip_info[ent->driver_data];
5846 struct sis_video_info *ivideo = NULL; 5810 struct sis_video_info *ivideo = NULL;
@@ -6530,7 +6494,7 @@ error_3: vfree(ivideo->bios_abase);
6530/* PCI DEVICE HANDLING */ 6494/* PCI DEVICE HANDLING */
6531/*****************************************************/ 6495/*****************************************************/
6532 6496
6533static void __devexit sisfb_remove(struct pci_dev *pdev) 6497static void sisfb_remove(struct pci_dev *pdev)
6534{ 6498{
6535 struct sis_video_info *ivideo = pci_get_drvdata(pdev); 6499 struct sis_video_info *ivideo = pci_get_drvdata(pdev);
6536 struct fb_info *sis_fb_info = ivideo->memyselfandi; 6500 struct fb_info *sis_fb_info = ivideo->memyselfandi;
@@ -6591,7 +6555,7 @@ static struct pci_driver sisfb_driver = {
6591 .name = "sisfb", 6555 .name = "sisfb",
6592 .id_table = sisfb_pci_table, 6556 .id_table = sisfb_pci_table,
6593 .probe = sisfb_probe, 6557 .probe = sisfb_probe,
6594 .remove = __devexit_p(sisfb_remove) 6558 .remove = sisfb_remove,
6595}; 6559};
6596 6560
6597static int __init sisfb_init(void) 6561static int __init sisfb_init(void)
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
index 9540e977270..32e23c20943 100644
--- a/drivers/video/sis/sis_main.h
+++ b/drivers/video/sis/sis_main.h
@@ -98,7 +98,7 @@ static struct sisfb_chip_info {
98 int hwcursor_size; 98 int hwcursor_size;
99 int CRT2_write_enable; 99 int CRT2_write_enable;
100 const char *chip_name; 100 const char *chip_name;
101} sisfb_chip_info[] __devinitdata = { 101} sisfb_chip_info[] = {
102 { SIS_300, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" }, 102 { SIS_300, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" },
103 { SIS_540, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" }, 103 { SIS_540, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" },
104 { SIS_630, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 630" }, 104 { SIS_630, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 630" },
@@ -113,7 +113,7 @@ static struct sisfb_chip_info {
113 { XGI_40, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "XGI V3XT/V5/V8" }, 113 { XGI_40, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "XGI V3XT/V5/V8" },
114}; 114};
115 115
116static struct pci_device_id __devinitdata sisfb_pci_table[] = { 116static struct pci_device_id sisfb_pci_table[] = {
117#ifdef CONFIG_FB_SIS_300 117#ifdef CONFIG_FB_SIS_300
118 { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 118 { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
119 { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 119 { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
@@ -317,7 +317,7 @@ static struct _sis_lcd_data {
317 u16 xres; 317 u16 xres;
318 u16 yres; 318 u16 yres;
319 u8 default_mode_idx; 319 u8 default_mode_idx;
320} sis_lcd_data[] __devinitdata = { 320} sis_lcd_data[] = {
321 { LCD_640x480, 640, 480, 23 }, 321 { LCD_640x480, 640, 480, 23 },
322 { LCD_800x600, 800, 600, 43 }, 322 { LCD_800x600, 800, 600, 43 },
323 { LCD_1024x600, 1024, 600, 67 }, 323 { LCD_1024x600, 1024, 600, 67 },
@@ -339,21 +339,21 @@ static struct _sis_lcd_data {
339}; 339};
340 340
341/* CR36 evaluation */ 341/* CR36 evaluation */
342static unsigned short sis300paneltype[] __devinitdata = { 342static unsigned short sis300paneltype[] = {
343 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, 343 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
344 LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768, 344 LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768,
345 LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, 345 LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN,
346 LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN 346 LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN
347}; 347};
348 348
349static unsigned short sis310paneltype[] __devinitdata = { 349static unsigned short sis310paneltype[] = {
350 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, 350 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
351 LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, 351 LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960,
352 LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, 352 LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200,
353 LCD_320x240_2, LCD_320x240_3, LCD_UNKNOWN, LCD_UNKNOWN 353 LCD_320x240_2, LCD_320x240_3, LCD_UNKNOWN, LCD_UNKNOWN
354}; 354};
355 355
356static unsigned short sis661paneltype[] __devinitdata = { 356static unsigned short sis661paneltype[] = {
357 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, 357 LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
358 LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, 358 LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960,
359 LCD_1280x854, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, 359 LCD_1280x854, LCD_1400x1050, LCD_1280x768, LCD_1600x1200,
@@ -466,7 +466,7 @@ static struct _sisfbddcsmodes {
466 u16 h; 466 u16 h;
467 u16 v; 467 u16 v;
468 u32 d; 468 u32 d;
469} sisfb_ddcsmodes[] __devinitdata = { 469} sisfb_ddcsmodes[] = {
470 { 0x10000, 67, 75, 108000}, 470 { 0x10000, 67, 75, 108000},
471 { 0x08000, 48, 72, 50000}, 471 { 0x08000, 48, 72, 50000},
472 { 0x04000, 46, 75, 49500}, 472 { 0x04000, 46, 75, 49500},
@@ -488,7 +488,7 @@ static struct _sisfbddcfmodes {
488 u16 v; 488 u16 v;
489 u16 h; 489 u16 h;
490 u32 d; 490 u32 d;
491} sisfb_ddcfmodes[] __devinitdata = { 491} sisfb_ddcfmodes[] = {
492 { 1280, 1024, 85, 92, 157500}, 492 { 1280, 1024, 85, 92, 157500},
493 { 1600, 1200, 60, 75, 162000}, 493 { 1600, 1200, 60, 75, 162000},
494 { 1600, 1200, 65, 82, 175500}, 494 { 1600, 1200, 65, 82, 175500},
@@ -505,7 +505,7 @@ static struct _chswtable {
505 u16 subsysCard; 505 u16 subsysCard;
506 char *vendorName; 506 char *vendorName;
507 char *cardName; 507 char *cardName;
508} mychswtable[] __devinitdata = { 508} mychswtable[] = {
509 { 0x1631, 0x1002, "Mitachi", "0x1002" }, 509 { 0x1631, 0x1002, "Mitachi", "0x1002" },
510 { 0x1071, 0x7521, "Mitac" , "7521P" }, 510 { 0x1071, 0x7521, "Mitac" , "7521P" },
511 { 0, 0, "" , "" } 511 { 0, 0, "" , "" }
@@ -525,7 +525,7 @@ static struct _customttable {
525 char *cardName; 525 char *cardName;
526 u32 SpecialID; 526 u32 SpecialID;
527 char *optionName; 527 char *optionName;
528} mycustomttable[] __devinitdata = { 528} mycustomttable[] = {
529 { SIS_630, "2.00.07", "09/27/2002-13:38:25", 529 { SIS_630, "2.00.07", "09/27/2002-13:38:25",
530 0x3240A8, 530 0x3240A8,
531 { 0x220, 0x227, 0x228, 0x229, 0x0ee }, 531 { 0x220, 0x227, 0x228, 0x229, 0x0ee },
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 5b6abc6de84..2d4694c6b9e 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -63,7 +63,7 @@
63/* 63/*
64 * Driver data 64 * Driver data
65 */ 65 */
66static char *mode_option __devinitdata; 66static char *mode_option;
67 67
68/* 68/*
69 * If your driver supports multiple boards, you should make the 69 * If your driver supports multiple boards, you should make the
@@ -84,7 +84,7 @@ struct xxx_par;
84 * if we don't use modedb. If we do use modedb see xxxfb_init how to use it 84 * if we don't use modedb. If we do use modedb see xxxfb_init how to use it
85 * to get a fb_var_screeninfo. Otherwise define a default var as well. 85 * to get a fb_var_screeninfo. Otherwise define a default var as well.
86 */ 86 */
87static struct fb_fix_screeninfo xxxfb_fix __devinitdata = { 87static struct fb_fix_screeninfo xxxfb_fix = {
88 .id = "FB's name", 88 .id = "FB's name",
89 .type = FB_TYPE_PACKED_PIXELS, 89 .type = FB_TYPE_PACKED_PIXELS,
90 .visual = FB_VISUAL_PSEUDOCOLOR, 90 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -678,8 +678,7 @@ static struct fb_ops xxxfb_ops = {
678 */ 678 */
679 679
680/* static int __init xxfb_probe (struct platform_device *pdev) -- for platform devs */ 680/* static int __init xxfb_probe (struct platform_device *pdev) -- for platform devs */
681static int __devinit xxxfb_probe(struct pci_dev *dev, 681static int xxxfb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
682 const struct pci_device_id *ent)
683{ 682{
684 struct fb_info *info; 683 struct fb_info *info;
685 struct xxx_par *par; 684 struct xxx_par *par;
@@ -705,9 +704,7 @@ static int __devinit xxxfb_probe(struct pci_dev *dev,
705 */ 704 */
706 info->screen_base = framebuffer_virtual_memory; 705 info->screen_base = framebuffer_virtual_memory;
707 info->fbops = &xxxfb_ops; 706 info->fbops = &xxxfb_ops;
708 info->fix = xxxfb_fix; /* this will be the only time xxxfb_fix will be 707 info->fix = xxxfb_fix;
709 * used, so mark it as __devinitdata
710 */
711 info->pseudo_palette = pseudo_palette; /* The pseudopalette is an 708 info->pseudo_palette = pseudo_palette; /* The pseudopalette is an
712 * 16-member array 709 * 16-member array
713 */ 710 */
@@ -836,8 +833,8 @@ static int __devinit xxxfb_probe(struct pci_dev *dev,
836 /* 833 /*
837 * Cleanup 834 * Cleanup
838 */ 835 */
839/* static void __devexit xxxfb_remove(struct platform_device *pdev) */ 836/* static void xxxfb_remove(struct platform_device *pdev) */
840static void __devexit xxxfb_remove(struct pci_dev *dev) 837static void xxxfb_remove(struct pci_dev *dev)
841{ 838{
842 struct fb_info *info = pci_get_drvdata(dev); 839 struct fb_info *info = pci_get_drvdata(dev);
843 /* or platform_get_drvdata(pdev); */ 840 /* or platform_get_drvdata(pdev); */
@@ -899,7 +896,7 @@ static struct pci_driver xxxfb_driver = {
899 .name = "xxxfb", 896 .name = "xxxfb",
900 .id_table = xxxfb_id_table, 897 .id_table = xxxfb_id_table,
901 .probe = xxxfb_probe, 898 .probe = xxxfb_probe,
902 .remove = __devexit_p(xxxfb_remove), 899 .remove = xxxfb_remove,
903 .suspend = xxxfb_suspend, /* optional but recommended */ 900 .suspend = xxxfb_suspend, /* optional but recommended */
904 .resume = xxxfb_resume, /* optional but recommended */ 901 .resume = xxxfb_resume, /* optional but recommended */
905}; 902};
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 3690effbedc..1501979099d 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -46,7 +46,7 @@
46static char *fb_mode = "640x480-16@60"; 46static char *fb_mode = "640x480-16@60";
47static unsigned long default_bpp = 16; 47static unsigned long default_bpp = 16;
48 48
49static struct fb_videomode __devinitdata sm501_default_mode = { 49static struct fb_videomode sm501_default_mode = {
50 .refresh = 60, 50 .refresh = 60,
51 .xres = 640, 51 .xres = 640,
52 .yres = 480, 52 .yres = 480,
@@ -1664,8 +1664,7 @@ static void sm501fb_stop(struct sm501fb_info *info)
1664 resource_size(info->regs_res)); 1664 resource_size(info->regs_res));
1665} 1665}
1666 1666
1667static int __devinit sm501fb_init_fb(struct fb_info *fb, 1667static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head,
1668 enum sm501_controller head,
1669 const char *fbname) 1668 const char *fbname)
1670{ 1669{
1671 struct sm501_platdata_fbsub *pd; 1670 struct sm501_platdata_fbsub *pd;
@@ -1850,8 +1849,8 @@ static struct sm501_platdata_fb sm501fb_def_pdata = {
1850static char driver_name_crt[] = "sm501fb-crt"; 1849static char driver_name_crt[] = "sm501fb-crt";
1851static char driver_name_pnl[] = "sm501fb-panel"; 1850static char driver_name_pnl[] = "sm501fb-panel";
1852 1851
1853static int __devinit sm501fb_probe_one(struct sm501fb_info *info, 1852static int sm501fb_probe_one(struct sm501fb_info *info,
1854 enum sm501_controller head) 1853 enum sm501_controller head)
1855{ 1854{
1856 unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel"; 1855 unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel";
1857 struct sm501_platdata_fbsub *pd; 1856 struct sm501_platdata_fbsub *pd;
@@ -1892,9 +1891,8 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
1892 fb_dealloc_cmap(&fbi->cmap); 1891 fb_dealloc_cmap(&fbi->cmap);
1893} 1892}
1894 1893
1895static int __devinit sm501fb_start_one(struct sm501fb_info *info, 1894static int sm501fb_start_one(struct sm501fb_info *info,
1896 enum sm501_controller head, 1895 enum sm501_controller head, const char *drvname)
1897 const char *drvname)
1898{ 1896{
1899 struct fb_info *fbi = info->fb[head]; 1897 struct fb_info *fbi = info->fb[head];
1900 int ret; 1898 int ret;
@@ -1922,7 +1920,7 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
1922 return 0; 1920 return 0;
1923} 1921}
1924 1922
1925static int __devinit sm501fb_probe(struct platform_device *pdev) 1923static int sm501fb_probe(struct platform_device *pdev)
1926{ 1924{
1927 struct sm501fb_info *info; 1925 struct sm501fb_info *info;
1928 struct device *dev = &pdev->dev; 1926 struct device *dev = &pdev->dev;
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 6101f5c2f62..395cb6a8d8f 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -36,7 +36,7 @@ struct ssd1307fb_par {
36 int reset; 36 int reset;
37}; 37};
38 38
39static struct fb_fix_screeninfo ssd1307fb_fix __devinitdata = { 39static struct fb_fix_screeninfo ssd1307fb_fix = {
40 .id = "Solomon SSD1307", 40 .id = "Solomon SSD1307",
41 .type = FB_TYPE_PACKED_PIXELS, 41 .type = FB_TYPE_PACKED_PIXELS,
42 .visual = FB_VISUAL_MONO10, 42 .visual = FB_VISUAL_MONO10,
@@ -47,7 +47,7 @@ static struct fb_fix_screeninfo ssd1307fb_fix __devinitdata = {
47 .accel = FB_ACCEL_NONE, 47 .accel = FB_ACCEL_NONE,
48}; 48};
49 49
50static struct fb_var_screeninfo ssd1307fb_var __devinitdata = { 50static struct fb_var_screeninfo ssd1307fb_var = {
51 .xres = SSD1307FB_WIDTH, 51 .xres = SSD1307FB_WIDTH,
52 .yres = SSD1307FB_HEIGHT, 52 .yres = SSD1307FB_HEIGHT,
53 .xres_virtual = SSD1307FB_WIDTH, 53 .xres_virtual = SSD1307FB_WIDTH,
@@ -145,8 +145,8 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
145 u32 page_length = SSD1307FB_WIDTH * i; 145 u32 page_length = SSD1307FB_WIDTH * i;
146 u32 index = page_length + (SSD1307FB_WIDTH * k + j) / 8; 146 u32 index = page_length + (SSD1307FB_WIDTH * k + j) / 8;
147 u8 byte = *(vmem + index); 147 u8 byte = *(vmem + index);
148 u8 bit = byte & (1 << (7 - (j % 8))); 148 u8 bit = byte & (1 << (j % 8));
149 bit = bit >> (7 - (j % 8)); 149 bit = bit >> (j % 8);
150 buf |= bit << k; 150 buf |= bit << k;
151 } 151 }
152 ssd1307fb_write_data(par->client, buf); 152 ssd1307fb_write_data(par->client, buf);
@@ -227,7 +227,8 @@ static struct fb_deferred_io ssd1307fb_defio = {
227 .deferred_io = ssd1307fb_deferred_io, 227 .deferred_io = ssd1307fb_deferred_io,
228}; 228};
229 229
230static int __devinit ssd1307fb_probe(struct i2c_client *client, const struct i2c_device_id *id) 230static int ssd1307fb_probe(struct i2c_client *client,
231 const struct i2c_device_id *id)
231{ 232{
232 struct fb_info *info; 233 struct fb_info *info;
233 u32 vmem_size = SSD1307FB_WIDTH * SSD1307FB_HEIGHT / 8; 234 u32 vmem_size = SSD1307FB_WIDTH * SSD1307FB_HEIGHT / 8;
@@ -352,7 +353,7 @@ fb_alloc_error:
352 return ret; 353 return ret;
353} 354}
354 355
355static int __devexit ssd1307fb_remove(struct i2c_client *client) 356static int ssd1307fb_remove(struct i2c_client *client)
356{ 357{
357 struct fb_info *info = i2c_get_clientdata(client); 358 struct fb_info *info = i2c_get_clientdata(client);
358 struct ssd1307fb_par *par = info->par; 359 struct ssd1307fb_par *par = info->par;
@@ -380,7 +381,7 @@ MODULE_DEVICE_TABLE(of, ssd1307fb_of_match);
380 381
381static struct i2c_driver ssd1307fb_driver = { 382static struct i2c_driver ssd1307fb_driver = {
382 .probe = ssd1307fb_probe, 383 .probe = ssd1307fb_probe,
383 .remove = __devexit_p(ssd1307fb_remove), 384 .remove = ssd1307fb_remove,
384 .id_table = ssd1307fb_i2c_id, 385 .id_table = ssd1307fb_i2c_id,
385 .driver = { 386 .driver = {
386 .name = "ssd1307fb", 387 .name = "ssd1307fb",
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 111fb32e876..9c00026e3ae 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -104,7 +104,7 @@ static bool slowpci; /* slow PCI settings */
104*/ 104*/
105#define DEFAULT_VIDEO_MODE "640x480@60" 105#define DEFAULT_VIDEO_MODE "640x480@60"
106 106
107static char *mode_option __devinitdata = DEFAULT_VIDEO_MODE; 107static char *mode_option = DEFAULT_VIDEO_MODE;
108 108
109enum { 109enum {
110 ID_VOODOO1 = 0, 110 ID_VOODOO1 = 0,
@@ -113,7 +113,7 @@ enum {
113 113
114#define IS_VOODOO2(par) ((par)->type == ID_VOODOO2) 114#define IS_VOODOO2(par) ((par)->type == ID_VOODOO2)
115 115
116static struct sst_spec voodoo_spec[] __devinitdata = { 116static struct sst_spec voodoo_spec[] = {
117 { .name = "Voodoo Graphics", .default_gfx_clock = 50000, .max_gfxclk = 60 }, 117 { .name = "Voodoo Graphics", .default_gfx_clock = 50000, .max_gfxclk = 60 },
118 { .name = "Voodoo2", .default_gfx_clock = 75000, .max_gfxclk = 85 }, 118 { .name = "Voodoo2", .default_gfx_clock = 75000, .max_gfxclk = 85 },
119}; 119};
@@ -822,7 +822,7 @@ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
822/* 822/*
823 * get lfb size 823 * get lfb size
824 */ 824 */
825static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize) 825static int sst_get_memsize(struct fb_info *info, __u32 *memsize)
826{ 826{
827 u8 __iomem *fbbase_virt = info->screen_base; 827 u8 __iomem *fbbase_virt = info->screen_base;
828 828
@@ -865,7 +865,7 @@ static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)
865/* fbi should be idle, and fifo emty and mem disabled */ 865/* fbi should be idle, and fifo emty and mem disabled */
866/* supposed to detect AT&T ATT20C409 and Ti TVP3409 ramdacs */ 866/* supposed to detect AT&T ATT20C409 and Ti TVP3409 ramdacs */
867 867
868static int __devinit sst_detect_att(struct fb_info *info) 868static int sst_detect_att(struct fb_info *info)
869{ 869{
870 struct sstfb_par *par = info->par; 870 struct sstfb_par *par = info->par;
871 int i, mir, dir; 871 int i, mir, dir;
@@ -890,7 +890,7 @@ static int __devinit sst_detect_att(struct fb_info *info)
890 return 0; 890 return 0;
891} 891}
892 892
893static int __devinit sst_detect_ti(struct fb_info *info) 893static int sst_detect_ti(struct fb_info *info)
894{ 894{
895 struct sstfb_par *par = info->par; 895 struct sstfb_par *par = info->par;
896 int i, mir, dir; 896 int i, mir, dir;
@@ -926,7 +926,7 @@ static int __devinit sst_detect_ti(struct fb_info *info)
926 * touched... 926 * touched...
927 * is it really safe ? how can i reset this ramdac ? geee... 927 * is it really safe ? how can i reset this ramdac ? geee...
928 */ 928 */
929static int __devinit sst_detect_ics(struct fb_info *info) 929static int sst_detect_ics(struct fb_info *info)
930{ 930{
931 struct sstfb_par *par = info->par; 931 struct sstfb_par *par = info->par;
932 int m_clk0_1, m_clk0_7, m_clk1_b; 932 int m_clk0_1, m_clk0_7, m_clk1_b;
@@ -1105,7 +1105,7 @@ static void sst_set_vidmod_ics(struct fb_info *info, const int bpp)
1105 */ 1105 */
1106 1106
1107 1107
1108static struct dac_switch dacs[] __devinitdata = { 1108static struct dac_switch dacs[] = {
1109 { .name = "TI TVP3409", 1109 { .name = "TI TVP3409",
1110 .detect = sst_detect_ti, 1110 .detect = sst_detect_ti,
1111 .set_pll = sst_set_pll_att_ti, 1111 .set_pll = sst_set_pll_att_ti,
@@ -1121,7 +1121,7 @@ static struct dac_switch dacs[] __devinitdata = {
1121 .set_vidmod = sst_set_vidmod_ics }, 1121 .set_vidmod = sst_set_vidmod_ics },
1122}; 1122};
1123 1123
1124static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *par) 1124static int sst_detect_dactype(struct fb_info *info, struct sstfb_par *par)
1125{ 1125{
1126 int i, ret = 0; 1126 int i, ret = 0;
1127 1127
@@ -1140,7 +1140,7 @@ static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *
1140/* 1140/*
1141 * Internal Routines 1141 * Internal Routines
1142 */ 1142 */
1143static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par) 1143static int sst_init(struct fb_info *info, struct sstfb_par *par)
1144{ 1144{
1145 u32 fbiinit0, fbiinit1, fbiinit4; 1145 u32 fbiinit0, fbiinit1, fbiinit4;
1146 struct pci_dev *dev = par->dev; 1146 struct pci_dev *dev = par->dev;
@@ -1239,7 +1239,7 @@ static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par)
1239 return 1; 1239 return 1;
1240} 1240}
1241 1241
1242static void __devexit sst_shutdown(struct fb_info *info) 1242static void sst_shutdown(struct fb_info *info)
1243{ 1243{
1244 struct sstfb_par *par = info->par; 1244 struct sstfb_par *par = info->par;
1245 struct pci_dev *dev = par->dev; 1245 struct pci_dev *dev = par->dev;
@@ -1271,7 +1271,7 @@ static void __devexit sst_shutdown(struct fb_info *info)
1271/* 1271/*
1272 * Interface to the world 1272 * Interface to the world
1273 */ 1273 */
1274static int __devinit sstfb_setup(char *options) 1274static int sstfb_setup(char *options)
1275{ 1275{
1276 char *this_opt; 1276 char *this_opt;
1277 1277
@@ -1317,8 +1317,7 @@ static struct fb_ops sstfb_ops = {
1317 .fb_ioctl = sstfb_ioctl, 1317 .fb_ioctl = sstfb_ioctl,
1318}; 1318};
1319 1319
1320static int __devinit sstfb_probe(struct pci_dev *pdev, 1320static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1321 const struct pci_device_id *id)
1322{ 1321{
1323 struct fb_info *info; 1322 struct fb_info *info;
1324 struct fb_fix_screeninfo *fix; 1323 struct fb_fix_screeninfo *fix;
@@ -1458,7 +1457,7 @@ fail_mmio_mem:
1458 return -ENXIO; /* no voodoo detected */ 1457 return -ENXIO; /* no voodoo detected */
1459} 1458}
1460 1459
1461static void __devexit sstfb_remove(struct pci_dev *pdev) 1460static void sstfb_remove(struct pci_dev *pdev)
1462{ 1461{
1463 struct sstfb_par *par; 1462 struct sstfb_par *par;
1464 struct fb_info *info; 1463 struct fb_info *info;
@@ -1490,11 +1489,11 @@ static struct pci_driver sstfb_driver = {
1490 .name = "sstfb", 1489 .name = "sstfb",
1491 .id_table = sstfb_id_tbl, 1490 .id_table = sstfb_id_tbl,
1492 .probe = sstfb_probe, 1491 .probe = sstfb_probe,
1493 .remove = __devexit_p(sstfb_remove), 1492 .remove = sstfb_remove,
1494}; 1493};
1495 1494
1496 1495
1497static int __devinit sstfb_init(void) 1496static int sstfb_init(void)
1498{ 1497{
1499 char *option = NULL; 1498 char *option = NULL;
1500 1499
@@ -1505,7 +1504,7 @@ static int __devinit sstfb_init(void)
1505 return pci_register_driver(&sstfb_driver); 1504 return pci_register_driver(&sstfb_driver);
1506} 1505}
1507 1506
1508static void __devexit sstfb_exit(void) 1507static void sstfb_exit(void)
1509{ 1508{
1510 pci_unregister_driver(&sstfb_driver); 1509 pci_unregister_driver(&sstfb_driver);
1511} 1510}
diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c
index 729a50722bd..cc6f48bba36 100644
--- a/drivers/video/sunxvr1000.c
+++ b/drivers/video/sunxvr1000.c
@@ -25,7 +25,7 @@ struct gfb_info {
25 u32 pseudo_palette[16]; 25 u32 pseudo_palette[16];
26}; 26};
27 27
28static int __devinit gfb_get_props(struct gfb_info *gp) 28static int gfb_get_props(struct gfb_info *gp)
29{ 29{
30 gp->width = of_getintprop_default(gp->of_node, "width", 0); 30 gp->width = of_getintprop_default(gp->of_node, "width", 0);
31 gp->height = of_getintprop_default(gp->of_node, "height", 0); 31 gp->height = of_getintprop_default(gp->of_node, "height", 0);
@@ -66,7 +66,7 @@ static struct fb_ops gfb_ops = {
66 .fb_imageblit = cfb_imageblit, 66 .fb_imageblit = cfb_imageblit,
67}; 67};
68 68
69static int __devinit gfb_set_fbinfo(struct gfb_info *gp) 69static int gfb_set_fbinfo(struct gfb_info *gp)
70{ 70{
71 struct fb_info *info = gp->info; 71 struct fb_info *info = gp->info;
72 struct fb_var_screeninfo *var = &info->var; 72 struct fb_var_screeninfo *var = &info->var;
@@ -111,7 +111,7 @@ static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
111 return 0; 111 return 0;
112} 112}
113 113
114static int __devinit gfb_probe(struct platform_device *op) 114static int gfb_probe(struct platform_device *op)
115{ 115{
116 struct device_node *dp = op->dev.of_node; 116 struct device_node *dp = op->dev.of_node;
117 struct fb_info *info; 117 struct fb_info *info;
@@ -173,7 +173,7 @@ err_out:
173 return err; 173 return err;
174} 174}
175 175
176static int __devexit gfb_remove(struct platform_device *op) 176static int gfb_remove(struct platform_device *op)
177{ 177{
178 struct fb_info *info = dev_get_drvdata(&op->dev); 178 struct fb_info *info = dev_get_drvdata(&op->dev);
179 struct gfb_info *gp = info->par; 179 struct gfb_info *gp = info->par;
@@ -201,7 +201,7 @@ MODULE_DEVICE_TABLE(of, ffb_match);
201 201
202static struct platform_driver gfb_driver = { 202static struct platform_driver gfb_driver = {
203 .probe = gfb_probe, 203 .probe = gfb_probe,
204 .remove = __devexit_p(gfb_remove), 204 .remove = gfb_remove,
205 .driver = { 205 .driver = {
206 .name = "gfb", 206 .name = "gfb",
207 .owner = THIS_MODULE, 207 .owner = THIS_MODULE,
diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
index 7fbcba86d1a..843b6bab048 100644
--- a/drivers/video/sunxvr2500.c
+++ b/drivers/video/sunxvr2500.c
@@ -29,7 +29,7 @@ struct s3d_info {
29 u32 pseudo_palette[16]; 29 u32 pseudo_palette[16];
30}; 30};
31 31
32static int __devinit s3d_get_props(struct s3d_info *sp) 32static int s3d_get_props(struct s3d_info *sp)
33{ 33{
34 sp->width = of_getintprop_default(sp->of_node, "width", 0); 34 sp->width = of_getintprop_default(sp->of_node, "width", 0);
35 sp->height = of_getintprop_default(sp->of_node, "height", 0); 35 sp->height = of_getintprop_default(sp->of_node, "height", 0);
@@ -70,7 +70,7 @@ static struct fb_ops s3d_ops = {
70 .fb_imageblit = cfb_imageblit, 70 .fb_imageblit = cfb_imageblit,
71}; 71};
72 72
73static int __devinit s3d_set_fbinfo(struct s3d_info *sp) 73static int s3d_set_fbinfo(struct s3d_info *sp)
74{ 74{
75 struct fb_info *info = sp->info; 75 struct fb_info *info = sp->info;
76 struct fb_var_screeninfo *var = &info->var; 76 struct fb_var_screeninfo *var = &info->var;
@@ -115,8 +115,8 @@ static int __devinit s3d_set_fbinfo(struct s3d_info *sp)
115 return 0; 115 return 0;
116} 116}
117 117
118static int __devinit s3d_pci_register(struct pci_dev *pdev, 118static int s3d_pci_register(struct pci_dev *pdev,
119 const struct pci_device_id *ent) 119 const struct pci_device_id *ent)
120{ 120{
121 struct fb_info *info; 121 struct fb_info *info;
122 struct s3d_info *sp; 122 struct s3d_info *sp;
@@ -219,7 +219,7 @@ err_out:
219 return err; 219 return err;
220} 220}
221 221
222static void __devexit s3d_pci_unregister(struct pci_dev *pdev) 222static void s3d_pci_unregister(struct pci_dev *pdev)
223{ 223{
224 struct fb_info *info = pci_get_drvdata(pdev); 224 struct fb_info *info = pci_get_drvdata(pdev);
225 struct s3d_info *sp = info->par; 225 struct s3d_info *sp = info->par;
@@ -251,7 +251,7 @@ static struct pci_driver s3d_driver = {
251 .name = "s3d", 251 .name = "s3d",
252 .id_table = s3d_pci_table, 252 .id_table = s3d_pci_table,
253 .probe = s3d_pci_register, 253 .probe = s3d_pci_register,
254 .remove = __devexit_p(s3d_pci_unregister), 254 .remove = s3d_pci_unregister,
255}; 255};
256 256
257static int __init s3d_init(void) 257static int __init s3d_init(void)
diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
index 6c71b1b4447..387350d004d 100644
--- a/drivers/video/sunxvr500.c
+++ b/drivers/video/sunxvr500.c
@@ -51,7 +51,7 @@ struct e3d_info {
51 u32 pseudo_palette[16]; 51 u32 pseudo_palette[16];
52}; 52};
53 53
54static int __devinit e3d_get_props(struct e3d_info *ep) 54static int e3d_get_props(struct e3d_info *ep)
55{ 55{
56 ep->width = of_getintprop_default(ep->of_node, "width", 0); 56 ep->width = of_getintprop_default(ep->of_node, "width", 0);
57 ep->height = of_getintprop_default(ep->of_node, "height", 0); 57 ep->height = of_getintprop_default(ep->of_node, "height", 0);
@@ -193,7 +193,7 @@ static struct fb_ops e3d_ops = {
193 .fb_imageblit = e3d_imageblit, 193 .fb_imageblit = e3d_imageblit,
194}; 194};
195 195
196static int __devinit e3d_set_fbinfo(struct e3d_info *ep) 196static int e3d_set_fbinfo(struct e3d_info *ep)
197{ 197{
198 struct fb_info *info = ep->info; 198 struct fb_info *info = ep->info;
199 struct fb_var_screeninfo *var = &info->var; 199 struct fb_var_screeninfo *var = &info->var;
@@ -238,8 +238,8 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
238 return 0; 238 return 0;
239} 239}
240 240
241static int __devinit e3d_pci_register(struct pci_dev *pdev, 241static int e3d_pci_register(struct pci_dev *pdev,
242 const struct pci_device_id *ent) 242 const struct pci_device_id *ent)
243{ 243{
244 struct device_node *of_node; 244 struct device_node *of_node;
245 const char *device_type; 245 const char *device_type;
@@ -392,7 +392,7 @@ err_out:
392 return err; 392 return err;
393} 393}
394 394
395static void __devexit e3d_pci_unregister(struct pci_dev *pdev) 395static void e3d_pci_unregister(struct pci_dev *pdev)
396{ 396{
397 struct fb_info *info = pci_get_drvdata(pdev); 397 struct fb_info *info = pci_get_drvdata(pdev);
398 struct e3d_info *ep = info->par; 398 struct e3d_info *ep = info->par;
@@ -437,7 +437,7 @@ static struct pci_driver e3d_driver = {
437 .name = "e3d", 437 .name = "e3d",
438 .id_table = e3d_pci_table, 438 .id_table = e3d_pci_table,
439 .probe = e3d_pci_register, 439 .probe = e3d_pci_register,
440 .remove = __devexit_p(e3d_pci_unregister), 440 .remove = e3d_pci_unregister,
441}; 441};
442 442
443static int __init e3d_init(void) 443static int __init e3d_init(void)
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index 07c66e94663..c000852500a 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -362,7 +362,7 @@ static void tcx_unmap_regs(struct platform_device *op, struct fb_info *info,
362 info->screen_base, info->fix.smem_len); 362 info->screen_base, info->fix.smem_len);
363} 363}
364 364
365static int __devinit tcx_probe(struct platform_device *op) 365static int tcx_probe(struct platform_device *op)
366{ 366{
367 struct device_node *dp = op->dev.of_node; 367 struct device_node *dp = op->dev.of_node;
368 struct fb_info *info; 368 struct fb_info *info;
@@ -486,7 +486,7 @@ out_err:
486 return err; 486 return err;
487} 487}
488 488
489static int __devexit tcx_remove(struct platform_device *op) 489static int tcx_remove(struct platform_device *op)
490{ 490{
491 struct fb_info *info = dev_get_drvdata(&op->dev); 491 struct fb_info *info = dev_get_drvdata(&op->dev);
492 struct tcx_par *par = info->par; 492 struct tcx_par *par = info->par;
@@ -518,7 +518,7 @@ static struct platform_driver tcx_driver = {
518 .of_match_table = tcx_match, 518 .of_match_table = tcx_match,
519 }, 519 },
520 .probe = tcx_probe, 520 .probe = tcx_probe,
521 .remove = __devexit_p(tcx_remove), 521 .remove = tcx_remove,
522}; 522};
523 523
524static int __init tcx_init(void) 524static int __init tcx_init(void)
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index e026724a3a5..64bc28ba403 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -100,7 +100,7 @@ static inline int mtrr_del(int reg, unsigned long base,
100#define VOODOO3_MAX_PIXCLOCK 300000 100#define VOODOO3_MAX_PIXCLOCK 300000
101#define VOODOO5_MAX_PIXCLOCK 350000 101#define VOODOO5_MAX_PIXCLOCK 350000
102 102
103static struct fb_fix_screeninfo tdfx_fix __devinitdata = { 103static struct fb_fix_screeninfo tdfx_fix = {
104 .type = FB_TYPE_PACKED_PIXELS, 104 .type = FB_TYPE_PACKED_PIXELS,
105 .visual = FB_VISUAL_PSEUDOCOLOR, 105 .visual = FB_VISUAL_PSEUDOCOLOR,
106 .ypanstep = 1, 106 .ypanstep = 1,
@@ -108,7 +108,7 @@ static struct fb_fix_screeninfo tdfx_fix __devinitdata = {
108 .accel = FB_ACCEL_3DFX_BANSHEE 108 .accel = FB_ACCEL_3DFX_BANSHEE
109}; 109};
110 110
111static struct fb_var_screeninfo tdfx_var __devinitdata = { 111static struct fb_var_screeninfo tdfx_var = {
112 /* "640x480, 8 bpp @ 60 Hz */ 112 /* "640x480, 8 bpp @ 60 Hz */
113 .xres = 640, 113 .xres = 640,
114 .yres = 480, 114 .yres = 480,
@@ -135,9 +135,8 @@ static struct fb_var_screeninfo tdfx_var __devinitdata = {
135/* 135/*
136 * PCI driver prototypes 136 * PCI driver prototypes
137 */ 137 */
138static int __devinit tdfxfb_probe(struct pci_dev *pdev, 138static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id);
139 const struct pci_device_id *id); 139static void tdfxfb_remove(struct pci_dev *pdev);
140static void __devexit tdfxfb_remove(struct pci_dev *pdev);
141 140
142static struct pci_device_id tdfxfb_id_table[] = { 141static struct pci_device_id tdfxfb_id_table[] = {
143 { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE, 142 { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE,
@@ -156,7 +155,7 @@ static struct pci_driver tdfxfb_driver = {
156 .name = "tdfxfb", 155 .name = "tdfxfb",
157 .id_table = tdfxfb_id_table, 156 .id_table = tdfxfb_id_table,
158 .probe = tdfxfb_probe, 157 .probe = tdfxfb_probe,
159 .remove = __devexit_p(tdfxfb_remove), 158 .remove = tdfxfb_remove,
160}; 159};
161 160
162MODULE_DEVICE_TABLE(pci, tdfxfb_id_table); 161MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);
@@ -167,9 +166,9 @@ MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);
167static int nopan; 166static int nopan;
168static int nowrap = 1; /* not implemented (yet) */ 167static int nowrap = 1; /* not implemented (yet) */
169static int hwcursor = 1; 168static int hwcursor = 1;
170static char *mode_option __devinitdata; 169static char *mode_option;
171/* mtrr option */ 170/* mtrr option */
172static bool nomtrr __devinitdata; 171static bool nomtrr;
173 172
174/* ------------------------------------------------------------------------- 173/* -------------------------------------------------------------------------
175 * Hardware-specific funcions 174 * Hardware-specific funcions
@@ -1279,8 +1278,8 @@ static int tdfxfb_ddc_getsda(void *data)
1279 return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SDA_IN)); 1278 return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SDA_IN));
1280} 1279}
1281 1280
1282static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan, 1281static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan, const char *name,
1283 const char *name, struct device *dev) 1282 struct device *dev)
1284{ 1283{
1285 int rc; 1284 int rc;
1286 1285
@@ -1308,8 +1307,8 @@ static int __devinit tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan,
1308 return rc; 1307 return rc;
1309} 1308}
1310 1309
1311static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan, 1310static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan, const char *name,
1312 const char *name, struct device *dev) 1311 struct device *dev)
1313{ 1312{
1314 int rc; 1313 int rc;
1315 1314
@@ -1336,7 +1335,7 @@ static int __devinit tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan,
1336 return rc; 1335 return rc;
1337} 1336}
1338 1337
1339static void __devinit tdfxfb_create_i2c_busses(struct fb_info *info) 1338static void tdfxfb_create_i2c_busses(struct fb_info *info)
1340{ 1339{
1341 struct tdfx_par *par = info->par; 1340 struct tdfx_par *par = info->par;
1342 1341
@@ -1388,8 +1387,7 @@ static int tdfxfb_probe_i2c_connector(struct tdfx_par *par,
1388 * Initializes and allocates resources for PCI device @pdev. 1387 * Initializes and allocates resources for PCI device @pdev.
1389 * 1388 *
1390 */ 1389 */
1391static int __devinit tdfxfb_probe(struct pci_dev *pdev, 1390static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1392 const struct pci_device_id *id)
1393{ 1391{
1394 struct tdfx_par *default_par; 1392 struct tdfx_par *default_par;
1395 struct fb_info *info; 1393 struct fb_info *info;
@@ -1626,7 +1624,7 @@ static void __init tdfxfb_setup(char *options)
1626 * lifetime for the PCI device @pdev. 1624 * lifetime for the PCI device @pdev.
1627 * 1625 *
1628 */ 1626 */
1629static void __devexit tdfxfb_remove(struct pci_dev *pdev) 1627static void tdfxfb_remove(struct pci_dev *pdev)
1630{ 1628{
1631 struct fb_info *info = pci_get_drvdata(pdev); 1629 struct fb_info *info = pci_get_drvdata(pdev);
1632 struct tdfx_par *par = info->par; 1630 struct tdfx_par *par = info->par;
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index aba7686b1a3..c9c8e5a1fde 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -61,8 +61,8 @@ static void tgafb_fillrect(struct fb_info *, const struct fb_fillrect *);
61static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *); 61static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
62static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); 62static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
63 63
64static int __devinit tgafb_register(struct device *dev); 64static int tgafb_register(struct device *dev);
65static void __devexit tgafb_unregister(struct device *dev); 65static void tgafb_unregister(struct device *dev);
66 66
67static const char *mode_option; 67static const char *mode_option;
68static const char *mode_option_pci = "640x480@60"; 68static const char *mode_option_pci = "640x480@60";
@@ -93,9 +93,8 @@ static struct fb_ops tgafb_ops = {
93/* 93/*
94 * PCI registration operations 94 * PCI registration operations
95 */ 95 */
96static int __devinit tgafb_pci_register(struct pci_dev *, 96static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
97 const struct pci_device_id *); 97static void tgafb_pci_unregister(struct pci_dev *);
98static void __devexit tgafb_pci_unregister(struct pci_dev *);
99 98
100static struct pci_device_id const tgafb_pci_table[] = { 99static struct pci_device_id const tgafb_pci_table[] = {
101 { PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA) }, 100 { PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA) },
@@ -107,17 +106,16 @@ static struct pci_driver tgafb_pci_driver = {
107 .name = "tgafb", 106 .name = "tgafb",
108 .id_table = tgafb_pci_table, 107 .id_table = tgafb_pci_table,
109 .probe = tgafb_pci_register, 108 .probe = tgafb_pci_register,
110 .remove = __devexit_p(tgafb_pci_unregister), 109 .remove = tgafb_pci_unregister,
111}; 110};
112 111
113static int __devinit 112static int tgafb_pci_register(struct pci_dev *pdev,
114tgafb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) 113 const struct pci_device_id *ent)
115{ 114{
116 return tgafb_register(&pdev->dev); 115 return tgafb_register(&pdev->dev);
117} 116}
118 117
119static void __devexit 118static void tgafb_pci_unregister(struct pci_dev *pdev)
120tgafb_pci_unregister(struct pci_dev *pdev)
121{ 119{
122 tgafb_unregister(&pdev->dev); 120 tgafb_unregister(&pdev->dev);
123} 121}
@@ -127,8 +125,8 @@ tgafb_pci_unregister(struct pci_dev *pdev)
127/* 125/*
128 * TC registration operations 126 * TC registration operations
129 */ 127 */
130static int __devinit tgafb_tc_register(struct device *); 128static int tgafb_tc_register(struct device *);
131static int __devexit tgafb_tc_unregister(struct device *); 129static int tgafb_tc_unregister(struct device *);
132 130
133static struct tc_device_id const tgafb_tc_table[] = { 131static struct tc_device_id const tgafb_tc_table[] = {
134 { "DEC ", "PMAGD-AA" }, 132 { "DEC ", "PMAGD-AA" },
@@ -143,12 +141,11 @@ static struct tc_driver tgafb_tc_driver = {
143 .name = "tgafb", 141 .name = "tgafb",
144 .bus = &tc_bus_type, 142 .bus = &tc_bus_type,
145 .probe = tgafb_tc_register, 143 .probe = tgafb_tc_register,
146 .remove = __devexit_p(tgafb_tc_unregister), 144 .remove = tgafb_tc_unregister,
147 }, 145 },
148}; 146};
149 147
150static int __devinit 148static int tgafb_tc_register(struct device *dev)
151tgafb_tc_register(struct device *dev)
152{ 149{
153 int status = tgafb_register(dev); 150 int status = tgafb_register(dev);
154 if (!status) 151 if (!status)
@@ -156,8 +153,7 @@ tgafb_tc_register(struct device *dev)
156 return status; 153 return status;
157} 154}
158 155
159static int __devexit 156static int tgafb_tc_unregister(struct device *dev)
160tgafb_tc_unregister(struct device *dev)
161{ 157{
162 put_device(dev); 158 put_device(dev);
163 tgafb_unregister(dev); 159 tgafb_unregister(dev);
@@ -1546,8 +1542,7 @@ static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
1546 return 0; 1542 return 0;
1547} 1543}
1548 1544
1549static int __devinit 1545static int tgafb_register(struct device *dev)
1550tgafb_register(struct device *dev)
1551{ 1546{
1552 static const struct fb_videomode modedb_tc = { 1547 static const struct fb_videomode modedb_tc = {
1553 /* 1280x1024 @ 72 Hz, 76.8 kHz hsync */ 1548 /* 1280x1024 @ 72 Hz, 76.8 kHz hsync */
@@ -1692,8 +1687,7 @@ tgafb_register(struct device *dev)
1692 return ret; 1687 return ret;
1693} 1688}
1694 1689
1695static void __devexit 1690static void tgafb_unregister(struct device *dev)
1696tgafb_unregister(struct device *dev)
1697{ 1691{
1698 resource_size_t bar0_start = 0, bar0_len = 0; 1692 resource_size_t bar0_start = 0, bar0_len = 0;
1699 int tga_bus_pci = TGA_BUS_PCI(dev); 1693 int tga_bus_pci = TGA_BUS_PCI(dev);
@@ -1721,16 +1715,14 @@ tgafb_unregister(struct device *dev)
1721 framebuffer_release(info); 1715 framebuffer_release(info);
1722} 1716}
1723 1717
1724static void __devexit 1718static void tgafb_exit(void)
1725tgafb_exit(void)
1726{ 1719{
1727 tc_unregister_driver(&tgafb_tc_driver); 1720 tc_unregister_driver(&tgafb_tc_driver);
1728 pci_unregister_driver(&tgafb_pci_driver); 1721 pci_unregister_driver(&tgafb_pci_driver);
1729} 1722}
1730 1723
1731#ifndef MODULE 1724#ifndef MODULE
1732static int __devinit 1725static int tgafb_setup(char *arg)
1733tgafb_setup(char *arg)
1734{ 1726{
1735 char *this_opt; 1727 char *this_opt;
1736 1728
@@ -1751,8 +1743,7 @@ tgafb_setup(char *arg)
1751} 1743}
1752#endif /* !MODULE */ 1744#endif /* !MODULE */
1753 1745
1754static int __devinit 1746static int tgafb_init(void)
1755tgafb_init(void)
1756{ 1747{
1757 int status; 1748 int status;
1758#ifndef MODULE 1749#ifndef MODULE
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index b244f060f15..dc4fb862015 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -191,7 +191,7 @@
191#define LCR_VCLKHW 0x1b4 /* VCLK High Width */ 191#define LCR_VCLKHW 0x1b4 /* VCLK High Width */
192#define LCR_OC 0x1b6 /* Output Control */ 192#define LCR_OC 0x1b6 /* Output Control */
193 193
194static char *mode_option __devinitdata; 194static char *mode_option;
195 195
196struct tmiofb_par { 196struct tmiofb_par {
197 u32 pseudo_palette[16]; 197 u32 pseudo_palette[16];
@@ -675,7 +675,7 @@ static struct fb_ops tmiofb_ops = {
675 675
676/*--------------------------------------------------------------------------*/ 676/*--------------------------------------------------------------------------*/
677 677
678static int __devinit tmiofb_probe(struct platform_device *dev) 678static int tmiofb_probe(struct platform_device *dev)
679{ 679{
680 const struct mfd_cell *cell = mfd_get_cell(dev); 680 const struct mfd_cell *cell = mfd_get_cell(dev);
681 struct tmio_fb_data *data = dev->dev.platform_data; 681 struct tmio_fb_data *data = dev->dev.platform_data;
@@ -807,7 +807,7 @@ err_ioremap_ccr:
807 return retval; 807 return retval;
808} 808}
809 809
810static int __devexit tmiofb_remove(struct platform_device *dev) 810static int tmiofb_remove(struct platform_device *dev)
811{ 811{
812 const struct mfd_cell *cell = mfd_get_cell(dev); 812 const struct mfd_cell *cell = mfd_get_cell(dev);
813 struct fb_info *info = platform_get_drvdata(dev); 813 struct fb_info *info = platform_get_drvdata(dev);
@@ -1002,7 +1002,7 @@ static struct platform_driver tmiofb_driver = {
1002 .driver.name = "tmio-fb", 1002 .driver.name = "tmio-fb",
1003 .driver.owner = THIS_MODULE, 1003 .driver.owner = THIS_MODULE,
1004 .probe = tmiofb_probe, 1004 .probe = tmiofb_probe,
1005 .remove = __devexit_p(tmiofb_remove), 1005 .remove = tmiofb_remove,
1006 .suspend = tmiofb_suspend, 1006 .suspend = tmiofb_suspend,
1007 .resume = tmiofb_resume, 1007 .resume = tmiofb_resume,
1008}; 1008};
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index 34cf019bba4..ab57d387d6b 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -53,19 +53,19 @@ static struct fb_fix_screeninfo tridentfb_fix = {
53/* defaults which are normally overriden by user values */ 53/* defaults which are normally overriden by user values */
54 54
55/* video mode */ 55/* video mode */
56static char *mode_option __devinitdata = "640x480-8@60"; 56static char *mode_option = "640x480-8@60";
57static int bpp __devinitdata = 8; 57static int bpp = 8;
58 58
59static int noaccel __devinitdata; 59static int noaccel;
60 60
61static int center; 61static int center;
62static int stretch; 62static int stretch;
63 63
64static int fp __devinitdata; 64static int fp;
65static int crt __devinitdata; 65static int crt;
66 66
67static int memsize __devinitdata; 67static int memsize;
68static int memdiff __devinitdata; 68static int memdiff;
69static int nativex; 69static int nativex;
70 70
71module_param(mode_option, charp, 0); 71module_param(mode_option, charp, 0);
@@ -637,7 +637,7 @@ static inline void crtc_unlock(struct tridentfb_par *par)
637} 637}
638 638
639/* Return flat panel's maximum x resolution */ 639/* Return flat panel's maximum x resolution */
640static int __devinit get_nativex(struct tridentfb_par *par) 640static int get_nativex(struct tridentfb_par *par)
641{ 641{
642 int x, y, tmp; 642 int x, y, tmp;
643 643
@@ -771,7 +771,7 @@ static void set_number_of_lines(struct tridentfb_par *par, int lines)
771 * If we see that FP is active we assume we have one. 771 * If we see that FP is active we assume we have one.
772 * Otherwise we have a CRT display. User can override. 772 * Otherwise we have a CRT display. User can override.
773 */ 773 */
774static int __devinit is_flatpanel(struct tridentfb_par *par) 774static int is_flatpanel(struct tridentfb_par *par)
775{ 775{
776 if (fp) 776 if (fp)
777 return 1; 777 return 1;
@@ -781,7 +781,7 @@ static int __devinit is_flatpanel(struct tridentfb_par *par)
781} 781}
782 782
783/* Try detecting the video memory size */ 783/* Try detecting the video memory size */
784static unsigned int __devinit get_memsize(struct tridentfb_par *par) 784static unsigned int get_memsize(struct tridentfb_par *par)
785{ 785{
786 unsigned char tmp, tmp2; 786 unsigned char tmp, tmp2;
787 unsigned int k; 787 unsigned int k;
@@ -1331,8 +1331,8 @@ static struct fb_ops tridentfb_ops = {
1331 .fb_sync = tridentfb_sync, 1331 .fb_sync = tridentfb_sync,
1332}; 1332};
1333 1333
1334static int __devinit trident_pci_probe(struct pci_dev *dev, 1334static int trident_pci_probe(struct pci_dev *dev,
1335 const struct pci_device_id *id) 1335 const struct pci_device_id *id)
1336{ 1336{
1337 int err; 1337 int err;
1338 unsigned char revision; 1338 unsigned char revision;
@@ -1543,7 +1543,7 @@ out_unmap1:
1543 return err; 1543 return err;
1544} 1544}
1545 1545
1546static void __devexit trident_pci_remove(struct pci_dev *dev) 1546static void trident_pci_remove(struct pci_dev *dev)
1547{ 1547{
1548 struct fb_info *info = pci_get_drvdata(dev); 1548 struct fb_info *info = pci_get_drvdata(dev);
1549 struct tridentfb_par *par = info->par; 1549 struct tridentfb_par *par = info->par;
@@ -1591,7 +1591,7 @@ static struct pci_driver tridentfb_pci_driver = {
1591 .name = "tridentfb", 1591 .name = "tridentfb",
1592 .id_table = trident_devices, 1592 .id_table = trident_devices,
1593 .probe = trident_pci_probe, 1593 .probe = trident_pci_probe,
1594 .remove = __devexit_p(trident_pci_remove) 1594 .remove = trident_pci_remove,
1595}; 1595};
1596 1596
1597/* 1597/*
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 2f8f82d874a..b75db018648 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -36,26 +36,26 @@ static struct cb_id uvesafb_cn_id = {
36static char v86d_path[PATH_MAX] = "/sbin/v86d"; 36static char v86d_path[PATH_MAX] = "/sbin/v86d";
37static char v86d_started; /* has v86d been started by uvesafb? */ 37static char v86d_started; /* has v86d been started by uvesafb? */
38 38
39static struct fb_fix_screeninfo uvesafb_fix __devinitdata = { 39static struct fb_fix_screeninfo uvesafb_fix = {
40 .id = "VESA VGA", 40 .id = "VESA VGA",
41 .type = FB_TYPE_PACKED_PIXELS, 41 .type = FB_TYPE_PACKED_PIXELS,
42 .accel = FB_ACCEL_NONE, 42 .accel = FB_ACCEL_NONE,
43 .visual = FB_VISUAL_TRUECOLOR, 43 .visual = FB_VISUAL_TRUECOLOR,
44}; 44};
45 45
46static int mtrr __devinitdata = 3; /* enable mtrr by default */ 46static int mtrr = 3; /* enable mtrr by default */
47static bool blank = 1; /* enable blanking by default */ 47static bool blank = 1; /* enable blanking by default */
48static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */ 48static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */
49static bool pmi_setpal __devinitdata = true; /* use PMI for palette changes */ 49static bool pmi_setpal = true; /* use PMI for palette changes */
50static bool nocrtc __devinitdata; /* ignore CRTC settings */ 50static bool nocrtc; /* ignore CRTC settings */
51static bool noedid __devinitdata; /* don't try DDC transfers */ 51static bool noedid; /* don't try DDC transfers */
52static int vram_remap __devinitdata; /* set amt. of memory to be used */ 52static int vram_remap; /* set amt. of memory to be used */
53static int vram_total __devinitdata; /* set total amount of memory */ 53static int vram_total; /* set total amount of memory */
54static u16 maxclk __devinitdata; /* maximum pixel clock */ 54static u16 maxclk; /* maximum pixel clock */
55static u16 maxvf __devinitdata; /* maximum vertical frequency */ 55static u16 maxvf; /* maximum vertical frequency */
56static u16 maxhf __devinitdata; /* maximum horizontal frequency */ 56static u16 maxhf; /* maximum horizontal frequency */
57static u16 vbemode __devinitdata; /* force use of a specific VBE mode */ 57static u16 vbemode; /* force use of a specific VBE mode */
58static char *mode_option __devinitdata; 58static char *mode_option;
59static u8 dac_width = 6; 59static u8 dac_width = 6;
60 60
61static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX]; 61static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX];
@@ -418,8 +418,8 @@ static void uvesafb_vbe_state_restore(struct uvesafb_par *par, u8 *state_buf)
418 uvesafb_free(task); 418 uvesafb_free(task);
419} 419}
420 420
421static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task, 421static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
422 struct uvesafb_par *par) 422 struct uvesafb_par *par)
423{ 423{
424 int err; 424 int err;
425 425
@@ -477,8 +477,8 @@ static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
477 return 0; 477 return 0;
478} 478}
479 479
480static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task, 480static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
481 struct uvesafb_par *par) 481 struct uvesafb_par *par)
482{ 482{
483 int off = 0, err; 483 int off = 0, err;
484 u16 *mode; 484 u16 *mode;
@@ -556,8 +556,8 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
556 * x86 and not x86_64. 556 * x86 and not x86_64.
557 */ 557 */
558#ifdef CONFIG_X86_32 558#ifdef CONFIG_X86_32
559static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task, 559static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
560 struct uvesafb_par *par) 560 struct uvesafb_par *par)
561{ 561{
562 int i, err; 562 int i, err;
563 563
@@ -602,8 +602,8 @@ static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
602 * Check whether a video mode is supported by the Video BIOS and is 602 * Check whether a video mode is supported by the Video BIOS and is
603 * compatible with the monitor limits. 603 * compatible with the monitor limits.
604 */ 604 */
605static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode, 605static int uvesafb_is_valid_mode(struct fb_videomode *mode,
606 struct fb_info *info) 606 struct fb_info *info)
607{ 607{
608 if (info->monspecs.gtf) { 608 if (info->monspecs.gtf) {
609 fb_videomode_to_var(&info->var, mode); 609 fb_videomode_to_var(&info->var, mode);
@@ -618,8 +618,7 @@ static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
618 return 1; 618 return 1;
619} 619}
620 620
621static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task, 621static int uvesafb_vbe_getedid(struct uvesafb_ktask *task, struct fb_info *info)
622 struct fb_info *info)
623{ 622{
624 struct uvesafb_par *par = info->par; 623 struct uvesafb_par *par = info->par;
625 int err = 0; 624 int err = 0;
@@ -684,8 +683,8 @@ static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
684 return err; 683 return err;
685} 684}
686 685
687static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task, 686static void uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
688 struct fb_info *info) 687 struct fb_info *info)
689{ 688{
690 struct uvesafb_par *par = info->par; 689 struct uvesafb_par *par = info->par;
691 int i; 690 int i;
@@ -765,8 +764,8 @@ static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
765 return; 764 return;
766} 765}
767 766
768static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task, 767static void uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
769 struct uvesafb_par *par) 768 struct uvesafb_par *par)
770{ 769{
771 int err; 770 int err;
772 771
@@ -794,7 +793,7 @@ static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
794 par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff); 793 par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff);
795} 794}
796 795
797static int __devinit uvesafb_vbe_init(struct fb_info *info) 796static int uvesafb_vbe_init(struct fb_info *info)
798{ 797{
799 struct uvesafb_ktask *task = NULL; 798 struct uvesafb_ktask *task = NULL;
800 struct uvesafb_par *par = info->par; 799 struct uvesafb_par *par = info->par;
@@ -839,7 +838,7 @@ out: uvesafb_free(task);
839 return err; 838 return err;
840} 839}
841 840
842static int __devinit uvesafb_vbe_init_mode(struct fb_info *info) 841static int uvesafb_vbe_init_mode(struct fb_info *info)
843{ 842{
844 struct list_head *pos; 843 struct list_head *pos;
845 struct fb_modelist *modelist; 844 struct fb_modelist *modelist;
@@ -1444,8 +1443,7 @@ static struct fb_ops uvesafb_ops = {
1444 .fb_set_par = uvesafb_set_par, 1443 .fb_set_par = uvesafb_set_par,
1445}; 1444};
1446 1445
1447static void __devinit uvesafb_init_info(struct fb_info *info, 1446static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
1448 struct vbe_mode_ib *mode)
1449{ 1447{
1450 unsigned int size_vmode; 1448 unsigned int size_vmode;
1451 unsigned int size_remap; 1449 unsigned int size_remap;
@@ -1540,7 +1538,7 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
1540 info->fbops->fb_pan_display = NULL; 1538 info->fbops->fb_pan_display = NULL;
1541} 1539}
1542 1540
1543static void __devinit uvesafb_init_mtrr(struct fb_info *info) 1541static void uvesafb_init_mtrr(struct fb_info *info)
1544{ 1542{
1545#ifdef CONFIG_MTRR 1543#ifdef CONFIG_MTRR
1546 if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) { 1544 if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) {
@@ -1582,7 +1580,7 @@ static void __devinit uvesafb_init_mtrr(struct fb_info *info)
1582#endif /* CONFIG_MTRR */ 1580#endif /* CONFIG_MTRR */
1583} 1581}
1584 1582
1585static void __devinit uvesafb_ioremap(struct fb_info *info) 1583static void uvesafb_ioremap(struct fb_info *info)
1586{ 1584{
1587#ifdef CONFIG_X86 1585#ifdef CONFIG_X86
1588 switch (mtrr) { 1586 switch (mtrr) {
@@ -1738,7 +1736,7 @@ static struct attribute_group uvesafb_dev_attgrp = {
1738 .attrs = uvesafb_dev_attrs, 1736 .attrs = uvesafb_dev_attrs,
1739}; 1737};
1740 1738
1741static int __devinit uvesafb_probe(struct platform_device *dev) 1739static int uvesafb_probe(struct platform_device *dev)
1742{ 1740{
1743 struct fb_info *info; 1741 struct fb_info *info;
1744 struct vbe_mode_ib *mode = NULL; 1742 struct vbe_mode_ib *mode = NULL;
@@ -1882,7 +1880,7 @@ static struct platform_driver uvesafb_driver = {
1882static struct platform_device *uvesafb_device; 1880static struct platform_device *uvesafb_device;
1883 1881
1884#ifndef MODULE 1882#ifndef MODULE
1885static int __devinit uvesafb_setup(char *options) 1883static int uvesafb_setup(char *options)
1886{ 1884{
1887 char *this_opt; 1885 char *this_opt;
1888 1886
@@ -1950,7 +1948,7 @@ static ssize_t store_v86d(struct device_driver *dev, const char *buf,
1950 1948
1951static DRIVER_ATTR(v86d, S_IRUGO | S_IWUSR, show_v86d, store_v86d); 1949static DRIVER_ATTR(v86d, S_IRUGO | S_IWUSR, show_v86d, store_v86d);
1952 1950
1953static int __devinit uvesafb_init(void) 1951static int uvesafb_init(void)
1954{ 1952{
1955 int err; 1953 int err;
1956 1954
@@ -1994,7 +1992,7 @@ static int __devinit uvesafb_init(void)
1994 1992
1995module_init(uvesafb_init); 1993module_init(uvesafb_init);
1996 1994
1997static void __devexit uvesafb_exit(void) 1995static void uvesafb_exit(void)
1998{ 1996{
1999 struct uvesafb_ktask *task; 1997 struct uvesafb_ktask *task;
2000 1998
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index 4709edc3cb7..0aa516fc59c 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -393,7 +393,7 @@ static void vmlfb_release_devices(struct vml_par *par)
393 * Free up allocated resources for a device. 393 * Free up allocated resources for a device.
394 */ 394 */
395 395
396static void __devexit vml_pci_remove(struct pci_dev *dev) 396static void vml_pci_remove(struct pci_dev *dev)
397{ 397{
398 struct fb_info *info; 398 struct fb_info *info;
399 struct vml_info *vinfo; 399 struct vml_info *vinfo;
@@ -452,8 +452,7 @@ static void vmlfb_set_pref_pixel_format(struct fb_var_screeninfo *var)
452 * struct per pipe. Currently we have only one pipe. 452 * struct per pipe. Currently we have only one pipe.
453 */ 453 */
454 454
455static int __devinit vml_pci_probe(struct pci_dev *dev, 455static int vml_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
456 const struct pci_device_id *id)
457{ 456{
458 struct vml_info *vinfo; 457 struct vml_info *vinfo;
459 struct fb_info *info; 458 struct fb_info *info;
@@ -1060,7 +1059,7 @@ static struct pci_driver vmlfb_pci_driver = {
1060 .name = "vmlfb", 1059 .name = "vmlfb",
1061 .id_table = vml_ids, 1060 .id_table = vml_ids,
1062 .probe = vml_pci_probe, 1061 .probe = vml_pci_probe,
1063 .remove = __devexit_p(vml_pci_remove) 1062 .remove = vml_pci_remove,
1064}; 1063};
1065 1064
1066static void __exit vmlfb_cleanup(void) 1065static void __exit vmlfb_cleanup(void)
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index c7f692525b8..8bc1f939894 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -78,7 +78,7 @@ static void rvfree(void *mem, unsigned long size)
78 vfree(mem); 78 vfree(mem);
79} 79}
80 80
81static struct fb_var_screeninfo vfb_default __devinitdata = { 81static struct fb_var_screeninfo vfb_default = {
82 .xres = 640, 82 .xres = 640,
83 .yres = 480, 83 .yres = 480,
84 .xres_virtual = 640, 84 .xres_virtual = 640,
@@ -100,7 +100,7 @@ static struct fb_var_screeninfo vfb_default __devinitdata = {
100 .vmode = FB_VMODE_NONINTERLACED, 100 .vmode = FB_VMODE_NONINTERLACED,
101}; 101};
102 102
103static struct fb_fix_screeninfo vfb_fix __devinitdata = { 103static struct fb_fix_screeninfo vfb_fix = {
104 .id = "Virtual FB", 104 .id = "Virtual FB",
105 .type = FB_TYPE_PACKED_PIXELS, 105 .type = FB_TYPE_PACKED_PIXELS,
106 .visual = FB_VISUAL_PSEUDOCOLOR, 106 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -477,7 +477,7 @@ static int __init vfb_setup(char *options)
477 * Initialisation 477 * Initialisation
478 */ 478 */
479 479
480static int __devinit vfb_probe(struct platform_device *dev) 480static int vfb_probe(struct platform_device *dev)
481{ 481{
482 struct fb_info *info; 482 struct fb_info *info;
483 int retval = -ENOMEM; 483 int retval = -ENOMEM;
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 0267acd8dc8..545faeccdb4 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -65,7 +65,7 @@ struct vga16fb_par {
65 65
66/* --------------------------------------------------------------------- */ 66/* --------------------------------------------------------------------- */
67 67
68static struct fb_var_screeninfo vga16fb_defined __devinitdata = { 68static struct fb_var_screeninfo vga16fb_defined = {
69 .xres = 640, 69 .xres = 640,
70 .yres = 480, 70 .yres = 480,
71 .xres_virtual = 640, 71 .xres_virtual = 640,
@@ -85,7 +85,7 @@ static struct fb_var_screeninfo vga16fb_defined __devinitdata = {
85}; 85};
86 86
87/* name should not depend on EGA/VGA */ 87/* name should not depend on EGA/VGA */
88static struct fb_fix_screeninfo vga16fb_fix __devinitdata = { 88static struct fb_fix_screeninfo vga16fb_fix = {
89 .id = "VGA16 VGA", 89 .id = "VGA16 VGA",
90 .smem_start = VGA_FB_PHYS, 90 .smem_start = VGA_FB_PHYS,
91 .smem_len = VGA_FB_PHYS_LEN, 91 .smem_len = VGA_FB_PHYS_LEN,
@@ -1303,7 +1303,7 @@ static int __init vga16fb_setup(char *options)
1303} 1303}
1304#endif 1304#endif
1305 1305
1306static int __devinit vga16fb_probe(struct platform_device *dev) 1306static int vga16fb_probe(struct platform_device *dev)
1307{ 1307{
1308 struct fb_info *info; 1308 struct fb_info *info;
1309 struct vga16fb_par *par; 1309 struct vga16fb_par *par;
@@ -1395,7 +1395,7 @@ static int __devinit vga16fb_probe(struct platform_device *dev)
1395 return ret; 1395 return ret;
1396} 1396}
1397 1397
1398static int __devexit vga16fb_remove(struct platform_device *dev) 1398static int vga16fb_remove(struct platform_device *dev)
1399{ 1399{
1400 struct fb_info *info = platform_get_drvdata(dev); 1400 struct fb_info *info = platform_get_drvdata(dev);
1401 1401
@@ -1407,7 +1407,7 @@ static int __devexit vga16fb_remove(struct platform_device *dev)
1407 1407
1408static struct platform_driver vga16fb_driver = { 1408static struct platform_driver vga16fb_driver = {
1409 .probe = vga16fb_probe, 1409 .probe = vga16fb_probe,
1410 .remove = __devexit_p(vga16fb_remove), 1410 .remove = vga16fb_remove,
1411 .driver = { 1411 .driver = {
1412 .name = "vga16fb", 1412 .name = "vga16fb",
1413 }, 1413 },
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index 6be72f0ba21..7789553952d 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -25,7 +25,7 @@
25static void tmds_register_write(int index, u8 data); 25static void tmds_register_write(int index, u8 data);
26static int tmds_register_read(int index); 26static int tmds_register_read(int index);
27static int tmds_register_read_bytes(int index, u8 *buff, int buff_len); 27static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
28static void __devinit dvi_get_panel_size_from_DDCv1( 28static void dvi_get_panel_size_from_DDCv1(
29 struct tmds_chip_information *tmds_chip, 29 struct tmds_chip_information *tmds_chip,
30 struct tmds_setting_information *tmds_setting); 30 struct tmds_setting_information *tmds_setting);
31static int viafb_dvi_query_EDID(void); 31static int viafb_dvi_query_EDID(void);
@@ -35,8 +35,8 @@ static inline bool check_tmds_chip(int device_id_subaddr, int device_id)
35 return tmds_register_read(device_id_subaddr) == device_id; 35 return tmds_register_read(device_id_subaddr) == device_id;
36} 36}
37 37
38void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, 38void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
39 struct tmds_setting_information *tmds_setting) 39 struct tmds_setting_information *tmds_setting)
40{ 40{
41 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n"); 41 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
42 42
@@ -47,7 +47,7 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
47 return; 47 return;
48} 48}
49 49
50bool __devinit viafb_tmds_trasmitter_identify(void) 50bool viafb_tmds_trasmitter_identify(void)
51{ 51{
52 unsigned char sr2a = 0, sr1e = 0, sr3e = 0; 52 unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
53 53
@@ -285,7 +285,7 @@ static int viafb_dvi_query_EDID(void)
285} 285}
286 286
287/* Get Panel Size Using EDID1 Table */ 287/* Get Panel Size Using EDID1 Table */
288static void __devinit dvi_get_panel_size_from_DDCv1( 288static void dvi_get_panel_size_from_DDCv1(
289 struct tmds_chip_information *tmds_chip, 289 struct tmds_chip_information *tmds_chip,
290 struct tmds_setting_information *tmds_setting) 290 struct tmds_setting_information *tmds_setting)
291{ 291{
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index db757850c21..4c6bfba57d1 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -56,8 +56,8 @@
56int viafb_dvi_sense(void); 56int viafb_dvi_sense(void);
57void viafb_dvi_disable(void); 57void viafb_dvi_disable(void);
58void viafb_dvi_enable(void); 58void viafb_dvi_enable(void);
59bool __devinit viafb_tmds_trasmitter_identify(void); 59bool viafb_tmds_trasmitter_identify(void);
60void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip, 60void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
61 struct tmds_setting_information *tmds_setting); 61 struct tmds_setting_information *tmds_setting);
62void viafb_dvi_set_mode(const struct fb_var_screeninfo *var, 62void viafb_dvi_set_mode(const struct fb_var_screeninfo *var,
63 u16 cxres, u16 cyres, int iga); 63 u16 cxres, u16 cyres, int iga);
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 898590db5e1..80233dae358 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -465,9 +465,9 @@ static struct via_device_mapping device_mapping[] = {
465static struct via_clock clock; 465static struct via_clock clock;
466 466
467static void load_fix_bit_crtc_reg(void); 467static void load_fix_bit_crtc_reg(void);
468static void __devinit init_gfx_chip_info(int chip_type); 468static void init_gfx_chip_info(int chip_type);
469static void __devinit init_tmds_chip_info(void); 469static void init_tmds_chip_info(void);
470static void __devinit init_lvds_chip_info(void); 470static void init_lvds_chip_info(void);
471static void device_screen_off(void); 471static void device_screen_off(void);
472static void device_screen_on(void); 472static void device_screen_on(void);
473static void set_display_channel(void); 473static void set_display_channel(void);
@@ -1507,7 +1507,7 @@ void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var,
1507 viafb_set_vclock(PICOS2KHZ(var->pixclock) * 1000, iga); 1507 viafb_set_vclock(PICOS2KHZ(var->pixclock) * 1000, iga);
1508} 1508}
1509 1509
1510void __devinit viafb_init_chip_info(int chip_type) 1510void viafb_init_chip_info(int chip_type)
1511{ 1511{
1512 via_clock_init(&clock, chip_type); 1512 via_clock_init(&clock, chip_type);
1513 init_gfx_chip_info(chip_type); 1513 init_gfx_chip_info(chip_type);
@@ -1540,7 +1540,7 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
1540 } 1540 }
1541} 1541}
1542 1542
1543static void __devinit init_gfx_chip_info(int chip_type) 1543static void init_gfx_chip_info(int chip_type)
1544{ 1544{
1545 u8 tmp; 1545 u8 tmp;
1546 1546
@@ -1593,7 +1593,7 @@ static void __devinit init_gfx_chip_info(int chip_type)
1593 } 1593 }
1594} 1594}
1595 1595
1596static void __devinit init_tmds_chip_info(void) 1596static void init_tmds_chip_info(void)
1597{ 1597{
1598 viafb_tmds_trasmitter_identify(); 1598 viafb_tmds_trasmitter_identify();
1599 1599
@@ -1638,7 +1638,7 @@ static void __devinit init_tmds_chip_info(void)
1638 &viaparinfo->shared->tmds_setting_info); 1638 &viaparinfo->shared->tmds_setting_info);
1639} 1639}
1640 1640
1641static void __devinit init_lvds_chip_info(void) 1641static void init_lvds_chip_info(void)
1642{ 1642{
1643 viafb_lvds_trasmitter_identify(); 1643 viafb_lvds_trasmitter_identify();
1644 viafb_init_lcd_size(); 1644 viafb_init_lcd_size();
@@ -1672,7 +1672,7 @@ static void __devinit init_lvds_chip_info(void)
1672 viaparinfo->chip_info->lvds_chip_info.output_interface); 1672 viaparinfo->chip_info->lvds_chip_info.output_interface);
1673} 1673}
1674 1674
1675void __devinit viafb_init_dac(int set_iga) 1675void viafb_init_dac(int set_iga)
1676{ 1676{
1677 int i; 1677 int i;
1678 u8 tmp; 1678 u8 tmp;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 6be243cfc82..a8205754c73 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -663,8 +663,8 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
663int viafb_setmode(void); 663int viafb_setmode(void);
664void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, 664void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
665 const struct fb_videomode *mode); 665 const struct fb_videomode *mode);
666void __devinit viafb_init_chip_info(int chip_type); 666void viafb_init_chip_info(int chip_type);
667void __devinit viafb_init_dac(int set_iga); 667void viafb_init_dac(int set_iga);
668int viafb_get_refresh(int hres, int vres, u32 float_refresh); 668int viafb_get_refresh(int hres, int vres, u32 float_refresh);
669void viafb_update_device_setting(int hres, int vres, int bpp, int flag); 669void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
670 670
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 16503791053..980ee1b1dcf 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -49,7 +49,7 @@ static struct _lcd_scaling_factor lcd_scaling_factor_CLE = {
49}; 49};
50 50
51static bool lvds_identify_integratedlvds(void); 51static bool lvds_identify_integratedlvds(void);
52static void __devinit fp_id_to_vindex(int panel_id); 52static void fp_id_to_vindex(int panel_id);
53static int lvds_register_read(int index); 53static int lvds_register_read(int index);
54static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, 54static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
55 int panel_vres); 55 int panel_vres);
@@ -81,7 +81,7 @@ static inline bool check_lvds_chip(int device_id_subaddr, int device_id)
81 return lvds_register_read(device_id_subaddr) == device_id; 81 return lvds_register_read(device_id_subaddr) == device_id;
82} 82}
83 83
84void __devinit viafb_init_lcd_size(void) 84void viafb_init_lcd_size(void)
85{ 85{
86 DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n"); 86 DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n");
87 87
@@ -139,7 +139,7 @@ static bool lvds_identify_integratedlvds(void)
139 return true; 139 return true;
140} 140}
141 141
142bool __devinit viafb_lvds_trasmitter_identify(void) 142bool viafb_lvds_trasmitter_identify(void)
143{ 143{
144 if (viafb_lvds_identify_vt1636(VIA_PORT_31)) { 144 if (viafb_lvds_identify_vt1636(VIA_PORT_31)) {
145 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31; 145 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_PORT_31;
@@ -180,7 +180,7 @@ bool __devinit viafb_lvds_trasmitter_identify(void)
180 return false; 180 return false;
181} 181}
182 182
183static void __devinit fp_id_to_vindex(int panel_id) 183static void fp_id_to_vindex(int panel_id)
184{ 184{
185 DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n"); 185 DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n");
186 186
@@ -914,7 +914,7 @@ static void check_diport_of_integrated_lvds(
914 plvds_chip_info->output_interface); 914 plvds_chip_info->output_interface);
915} 915}
916 916
917void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information 917void viafb_init_lvds_output_interface(struct lvds_chip_information
918 *plvds_chip_info, 918 *plvds_chip_info,
919 struct lvds_setting_information 919 struct lvds_setting_information
920 *plvds_setting_info) 920 *plvds_setting_info)
diff --git a/drivers/video/via/lcd.h b/drivers/video/via/lcd.h
index 8f3e4e06156..5c988a063ad 100644
--- a/drivers/video/via/lcd.h
+++ b/drivers/video/via/lcd.h
@@ -71,15 +71,15 @@ void viafb_enable_lvds_vt1636(struct lvds_setting_information
71 struct lvds_chip_information *plvds_chip_info); 71 struct lvds_chip_information *plvds_chip_info);
72void viafb_lcd_disable(void); 72void viafb_lcd_disable(void);
73void viafb_lcd_enable(void); 73void viafb_lcd_enable(void);
74void __devinit viafb_init_lcd_size(void); 74void viafb_init_lcd_size(void);
75void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information 75void viafb_init_lvds_output_interface(struct lvds_chip_information
76 *plvds_chip_info, 76 *plvds_chip_info,
77 struct lvds_setting_information 77 struct lvds_setting_information
78 *plvds_setting_info); 78 *plvds_setting_info);
79void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres, 79void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
80 u16 cyres, struct lvds_setting_information *plvds_setting_info, 80 u16 cyres, struct lvds_setting_information *plvds_setting_info,
81 struct lvds_chip_information *plvds_chip_info); 81 struct lvds_chip_information *plvds_chip_info);
82bool __devinit viafb_lvds_trasmitter_identify(void); 82bool viafb_lvds_trasmitter_identify(void);
83void viafb_init_lvds_output_interface(struct lvds_chip_information 83void viafb_init_lvds_output_interface(struct lvds_chip_information
84 *plvds_chip_info, 84 *plvds_chip_info,
85 struct lvds_setting_information 85 struct lvds_setting_information
diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index dd58b530c0d..6e274825fb3 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -80,7 +80,7 @@ static inline int viafb_mmio_read(int reg)
80 */ 80 */
81static u32 viafb_enabled_ints; 81static u32 viafb_enabled_ints;
82 82
83static void __devinit viafb_int_init(void) 83static void viafb_int_init(void)
84{ 84{
85 viafb_enabled_ints = 0; 85 viafb_enabled_ints = 0;
86 86
@@ -475,7 +475,7 @@ static int viafb_get_fb_size_from_pci(int chip_type)
475/* 475/*
476 * Figure out and map our MMIO regions. 476 * Figure out and map our MMIO regions.
477 */ 477 */
478static int __devinit via_pci_setup_mmio(struct viafb_dev *vdev) 478static int via_pci_setup_mmio(struct viafb_dev *vdev)
479{ 479{
480 int ret; 480 int ret;
481 /* 481 /*
@@ -550,8 +550,8 @@ static struct viafb_subdev_info {
550}; 550};
551#define N_SUBDEVS ARRAY_SIZE(viafb_subdevs) 551#define N_SUBDEVS ARRAY_SIZE(viafb_subdevs)
552 552
553static int __devinit via_create_subdev(struct viafb_dev *vdev, 553static int via_create_subdev(struct viafb_dev *vdev,
554 struct viafb_subdev_info *info) 554 struct viafb_subdev_info *info)
555{ 555{
556 int ret; 556 int ret;
557 557
@@ -573,7 +573,7 @@ static int __devinit via_create_subdev(struct viafb_dev *vdev,
573 return ret; 573 return ret;
574} 574}
575 575
576static int __devinit via_setup_subdevs(struct viafb_dev *vdev) 576static int via_setup_subdevs(struct viafb_dev *vdev)
577{ 577{
578 int i; 578 int i;
579 579
@@ -671,8 +671,7 @@ static int via_resume(struct pci_dev *pdev)
671} 671}
672#endif /* CONFIG_PM */ 672#endif /* CONFIG_PM */
673 673
674static int __devinit via_pci_probe(struct pci_dev *pdev, 674static int via_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
675 const struct pci_device_id *ent)
676{ 675{
677 int ret; 676 int ret;
678 677
@@ -716,7 +715,7 @@ out_disable:
716 return ret; 715 return ret;
717} 716}
718 717
719static void __devexit via_pci_remove(struct pci_dev *pdev) 718static void via_pci_remove(struct pci_dev *pdev)
720{ 719{
721 via_teardown_subdevs(); 720 via_teardown_subdevs();
722 via_fb_pci_remove(pdev); 721 via_fb_pci_remove(pdev);
@@ -725,7 +724,7 @@ static void __devexit via_pci_remove(struct pci_dev *pdev)
725} 724}
726 725
727 726
728static struct pci_device_id via_pci_table[] __devinitdata = { 727static struct pci_device_id via_pci_table[] = {
729 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), 728 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID),
730 .driver_data = UNICHROME_CLE266 }, 729 .driver_data = UNICHROME_CLE266 },
731 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID), 730 { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID),
@@ -760,7 +759,7 @@ static struct pci_driver via_driver = {
760 .name = "viafb", 759 .name = "viafb",
761 .id_table = via_pci_table, 760 .id_table = via_pci_table,
762 .probe = via_pci_probe, 761 .probe = via_pci_probe,
763 .remove = __devexit_p(via_pci_remove), 762 .remove = via_pci_remove,
764#ifdef CONFIG_PM 763#ifdef CONFIG_PM
765 .suspend = via_suspend, 764 .suspend = via_suspend,
766 .resume = via_resume, 765 .resume = via_resume,
diff --git a/drivers/video/via/via-gpio.c b/drivers/video/via/via-gpio.c
index d69cfef7c33..e408679081a 100644
--- a/drivers/video/via/via-gpio.c
+++ b/drivers/video/via/via-gpio.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(viafb_gpio_lookup);
212/* 212/*
213 * Platform device stuff. 213 * Platform device stuff.
214 */ 214 */
215static __devinit int viafb_gpio_probe(struct platform_device *platdev) 215static int viafb_gpio_probe(struct platform_device *platdev)
216{ 216{
217 struct viafb_dev *vdev = platdev->dev.platform_data; 217 struct viafb_dev *vdev = platdev->dev.platform_data;
218 struct via_port_cfg *port_cfg = vdev->port_cfg; 218 struct via_port_cfg *port_cfg = vdev->port_cfg;
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index c80e770e180..325c43c6ff9 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1072,7 +1072,7 @@ static int __init parse_active_dev(void)
1072 return 0; 1072 return 0;
1073} 1073}
1074 1074
1075static int __devinit parse_port(char *opt_str, int *output_interface) 1075static int parse_port(char *opt_str, int *output_interface)
1076{ 1076{
1077 if (!strncmp(opt_str, "DVP0", 4)) 1077 if (!strncmp(opt_str, "DVP0", 4))
1078 *output_interface = INTERFACE_DVP0; 1078 *output_interface = INTERFACE_DVP0;
@@ -1089,7 +1089,7 @@ static int __devinit parse_port(char *opt_str, int *output_interface)
1089 return 0; 1089 return 0;
1090} 1090}
1091 1091
1092static void __devinit parse_lcd_port(void) 1092static void parse_lcd_port(void)
1093{ 1093{
1094 parse_port(viafb_lcd_port, &viaparinfo->chip_info->lvds_chip_info. 1094 parse_port(viafb_lcd_port, &viaparinfo->chip_info->lvds_chip_info.
1095 output_interface); 1095 output_interface);
@@ -1102,7 +1102,7 @@ static void __devinit parse_lcd_port(void)
1102 output_interface); 1102 output_interface);
1103} 1103}
1104 1104
1105static void __devinit parse_dvi_port(void) 1105static void parse_dvi_port(void)
1106{ 1106{
1107 parse_port(viafb_dvi_port, &viaparinfo->chip_info->tmds_chip_info. 1107 parse_port(viafb_dvi_port, &viaparinfo->chip_info->tmds_chip_info.
1108 output_interface); 1108 output_interface);
@@ -1727,7 +1727,7 @@ static struct viafb_pm_hooks viafb_fb_pm_hooks = {
1727 1727
1728#endif 1728#endif
1729 1729
1730static void __devinit i2c_bus_probe(struct viafb_shared *shared) 1730static void i2c_bus_probe(struct viafb_shared *shared)
1731{ 1731{
1732 /* should be always CRT */ 1732 /* should be always CRT */
1733 printk(KERN_INFO "viafb: Probing I2C bus 0x26\n"); 1733 printk(KERN_INFO "viafb: Probing I2C bus 0x26\n");
@@ -1753,7 +1753,7 @@ static void i2c_bus_free(struct viafb_shared *shared)
1753 via_aux_free(shared->i2c_2C); 1753 via_aux_free(shared->i2c_2C);
1754} 1754}
1755 1755
1756int __devinit via_fb_pci_probe(struct viafb_dev *vdev) 1756int via_fb_pci_probe(struct viafb_dev *vdev)
1757{ 1757{
1758 u32 default_xres, default_yres; 1758 u32 default_xres, default_yres;
1759 struct fb_var_screeninfo default_var; 1759 struct fb_var_screeninfo default_var;
@@ -1945,7 +1945,7 @@ out_fb_release:
1945 return rc; 1945 return rc;
1946} 1946}
1947 1947
1948void __devexit via_fb_pci_remove(struct pci_dev *pdev) 1948void via_fb_pci_remove(struct pci_dev *pdev)
1949{ 1949{
1950 DEBUG_MSG(KERN_INFO "via_pci_remove!\n"); 1950 DEBUG_MSG(KERN_INFO "via_pci_remove!\n");
1951 fb_dealloc_cmap(&viafbinfo->cmap); 1951 fb_dealloc_cmap(&viafbinfo->cmap);
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 9af8da70e78..aa2579c2364 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -273,7 +273,7 @@ static irqreturn_t vt8500lcd_handle_irq(int irq, void *dev_id)
273 return IRQ_HANDLED; 273 return IRQ_HANDLED;
274} 274}
275 275
276static int __devinit vt8500lcd_probe(struct platform_device *pdev) 276static int vt8500lcd_probe(struct platform_device *pdev)
277{ 277{
278 struct vt8500lcd_info *fbi; 278 struct vt8500lcd_info *fbi;
279 struct resource *res; 279 struct resource *res;
@@ -469,7 +469,7 @@ failed:
469 return ret; 469 return ret;
470} 470}
471 471
472static int __devexit vt8500lcd_remove(struct platform_device *pdev) 472static int vt8500lcd_remove(struct platform_device *pdev)
473{ 473{
474 struct vt8500lcd_info *fbi = platform_get_drvdata(pdev); 474 struct vt8500lcd_info *fbi = platform_get_drvdata(pdev);
475 struct resource *res; 475 struct resource *res;
@@ -505,7 +505,7 @@ static const struct of_device_id via_dt_ids[] = {
505 505
506static struct platform_driver vt8500lcd_driver = { 506static struct platform_driver vt8500lcd_driver = {
507 .probe = vt8500lcd_probe, 507 .probe = vt8500lcd_probe,
508 .remove = __devexit_p(vt8500lcd_remove), 508 .remove = vt8500lcd_remove,
509 .driver = { 509 .driver = {
510 .owner = THIS_MODULE, 510 .owner = THIS_MODULE,
511 .name = "vt8500-lcd", 511 .name = "vt8500-lcd",
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index 4e74d262cf3..e9557fa014e 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -660,7 +660,7 @@ static struct fb_ops vt8623fb_ops = {
660 660
661/* PCI probe */ 661/* PCI probe */
662 662
663static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) 663static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
664{ 664{
665 struct pci_bus_region bus_reg; 665 struct pci_bus_region bus_reg;
666 struct resource vga_res; 666 struct resource vga_res;
@@ -807,7 +807,7 @@ err_enable_device:
807 807
808/* PCI remove */ 808/* PCI remove */
809 809
810static void __devexit vt8623_pci_remove(struct pci_dev *dev) 810static void vt8623_pci_remove(struct pci_dev *dev)
811{ 811{
812 struct fb_info *info = pci_get_drvdata(dev); 812 struct fb_info *info = pci_get_drvdata(dev);
813 813
@@ -906,7 +906,7 @@ fail:
906 906
907/* List of boards that we are trying to support */ 907/* List of boards that we are trying to support */
908 908
909static struct pci_device_id vt8623_devices[] __devinitdata = { 909static struct pci_device_id vt8623_devices[] = {
910 {PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)}, 910 {PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)},
911 {0, 0, 0, 0, 0, 0, 0} 911 {0, 0, 0, 0, 0, 0, 0}
912}; 912};
@@ -917,7 +917,7 @@ static struct pci_driver vt8623fb_pci_driver = {
917 .name = "vt8623fb", 917 .name = "vt8623fb",
918 .id_table = vt8623_devices, 918 .id_table = vt8623_devices,
919 .probe = vt8623_pci_probe, 919 .probe = vt8623_pci_probe,
920 .remove = __devexit_p(vt8623_pci_remove), 920 .remove = vt8623_pci_remove,
921 .suspend = vt8623_pci_suspend, 921 .suspend = vt8623_pci_suspend,
922 .resume = vt8623_pci_resume, 922 .resume = vt8623_pci_resume,
923}; 923};
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 2f6b2b835f8..7a299e951f7 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -54,7 +54,7 @@ static void w100_update_enable(void);
54static void w100_update_disable(void); 54static void w100_update_disable(void);
55static void calc_hsync(struct w100fb_par *par); 55static void calc_hsync(struct w100fb_par *par);
56static void w100_init_graphic_engine(struct w100fb_par *par); 56static void w100_init_graphic_engine(struct w100fb_par *par);
57struct w100_pll_info *w100_get_xtal_table(unsigned int freq) __devinit; 57struct w100_pll_info *w100_get_xtal_table(unsigned int freq);
58 58
59/* Pseudo palette size */ 59/* Pseudo palette size */
60#define MAX_PALETTES 16 60#define MAX_PALETTES 16
@@ -630,7 +630,7 @@ static int w100fb_resume(struct platform_device *dev)
630#endif 630#endif
631 631
632 632
633int __devinit w100fb_probe(struct platform_device *pdev) 633int w100fb_probe(struct platform_device *pdev)
634{ 634{
635 int err = -EIO; 635 int err = -EIO;
636 struct w100fb_mach_info *inf; 636 struct w100fb_mach_info *inf;
@@ -783,7 +783,7 @@ out:
783} 783}
784 784
785 785
786static int __devexit w100fb_remove(struct platform_device *pdev) 786static int w100fb_remove(struct platform_device *pdev)
787{ 787{
788 struct fb_info *info = platform_get_drvdata(pdev); 788 struct fb_info *info = platform_get_drvdata(pdev);
789 struct w100fb_par *par=info->par; 789 struct w100fb_par *par=info->par;
@@ -1021,7 +1021,7 @@ static struct pll_entries {
1021 { 0 }, 1021 { 0 },
1022}; 1022};
1023 1023
1024struct w100_pll_info __devinit *w100_get_xtal_table(unsigned int freq) 1024struct w100_pll_info *w100_get_xtal_table(unsigned int freq)
1025{ 1025{
1026 struct pll_entries *pll_entry = w100_pll_tables; 1026 struct pll_entries *pll_entry = w100_pll_tables;
1027 1027
@@ -1624,7 +1624,7 @@ static void w100_vsync(void)
1624 1624
1625static struct platform_driver w100fb_driver = { 1625static struct platform_driver w100fb_driver = {
1626 .probe = w100fb_probe, 1626 .probe = w100fb_probe,
1627 .remove = __devexit_p(w100fb_remove), 1627 .remove = w100fb_remove,
1628 .suspend = w100fb_suspend, 1628 .suspend = w100fb_suspend,
1629 .resume = w100fb_resume, 1629 .resume = w100fb_resume,
1630 .driver = { 1630 .driver = {
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index 77539c1b56a..4dd0580f96f 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -260,7 +260,7 @@ static struct fb_ops wm8505fb_ops = {
260 .fb_blank = wm8505fb_blank, 260 .fb_blank = wm8505fb_blank,
261}; 261};
262 262
263static int __devinit wm8505fb_probe(struct platform_device *pdev) 263static int wm8505fb_probe(struct platform_device *pdev)
264{ 264{
265 struct wm8505fb_info *fbi; 265 struct wm8505fb_info *fbi;
266 struct resource *res; 266 struct resource *res;
@@ -431,7 +431,7 @@ failed:
431 return ret; 431 return ret;
432} 432}
433 433
434static int __devexit wm8505fb_remove(struct platform_device *pdev) 434static int wm8505fb_remove(struct platform_device *pdev)
435{ 435{
436 struct wm8505fb_info *fbi = platform_get_drvdata(pdev); 436 struct wm8505fb_info *fbi = platform_get_drvdata(pdev);
437 struct resource *res; 437 struct resource *res;
@@ -462,7 +462,7 @@ static const struct of_device_id wmt_dt_ids[] = {
462 462
463static struct platform_driver wm8505fb_driver = { 463static struct platform_driver wm8505fb_driver = {
464 .probe = wm8505fb_probe, 464 .probe = wm8505fb_probe,
465 .remove = __devexit_p(wm8505fb_remove), 465 .remove = wm8505fb_remove,
466 .driver = { 466 .driver = {
467 .owner = THIS_MODULE, 467 .owner = THIS_MODULE,
468 .name = DRIVER_NAME, 468 .name = DRIVER_NAME,
diff --git a/drivers/video/wmt_ge_rops.c b/drivers/video/wmt_ge_rops.c
index ba025b4c7d0..4aaeb18223b 100644
--- a/drivers/video/wmt_ge_rops.c
+++ b/drivers/video/wmt_ge_rops.c
@@ -124,7 +124,7 @@ int wmt_ge_sync(struct fb_info *p)
124} 124}
125EXPORT_SYMBOL_GPL(wmt_ge_sync); 125EXPORT_SYMBOL_GPL(wmt_ge_sync);
126 126
127static int __devinit wmt_ge_rops_probe(struct platform_device *pdev) 127static int wmt_ge_rops_probe(struct platform_device *pdev)
128{ 128{
129 struct resource *res; 129 struct resource *res;
130 130
@@ -152,7 +152,7 @@ static int __devinit wmt_ge_rops_probe(struct platform_device *pdev)
152 return 0; 152 return 0;
153} 153}
154 154
155static int __devexit wmt_ge_rops_remove(struct platform_device *pdev) 155static int wmt_ge_rops_remove(struct platform_device *pdev)
156{ 156{
157 iounmap(regbase); 157 iounmap(regbase);
158 return 0; 158 return 0;
@@ -165,7 +165,7 @@ static const struct of_device_id wmt_dt_ids[] = {
165 165
166static struct platform_driver wmt_ge_rops_driver = { 166static struct platform_driver wmt_ge_rops_driver = {
167 .probe = wmt_ge_rops_probe, 167 .probe = wmt_ge_rops_probe,
168 .remove = __devexit_p(wmt_ge_rops_remove), 168 .remove = wmt_ge_rops_remove,
169 .driver = { 169 .driver = {
170 .owner = THIS_MODULE, 170 .owner = THIS_MODULE,
171 .name = "wmt_ge_rops", 171 .name = "wmt_ge_rops",
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 917bb568168..cd005c227a2 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -358,8 +358,8 @@ static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
358 return IRQ_HANDLED; 358 return IRQ_HANDLED;
359} 359}
360 360
361static int __devinit xenfb_probe(struct xenbus_device *dev, 361static int xenfb_probe(struct xenbus_device *dev,
362 const struct xenbus_device_id *id) 362 const struct xenbus_device_id *id)
363{ 363{
364 struct xenfb_info *info; 364 struct xenfb_info *info;
365 struct fb_info *fb_info; 365 struct fb_info *fb_info;
@@ -487,8 +487,7 @@ error:
487 return ret; 487 return ret;
488} 488}
489 489
490static __devinit void 490static void xenfb_make_preferred_console(void)
491xenfb_make_preferred_console(void)
492{ 491{
493 struct console *c; 492 struct console *c;
494 493
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 18084525402..af0b4fdf9aa 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -403,7 +403,7 @@ static int xilinxfb_release(struct device *dev)
403 * OF bus binding 403 * OF bus binding
404 */ 404 */
405 405
406static int __devinit xilinxfb_of_probe(struct platform_device *op) 406static int xilinxfb_of_probe(struct platform_device *op)
407{ 407{
408 const u32 *prop; 408 const u32 *prop;
409 u32 *p; 409 u32 *p;
@@ -485,13 +485,13 @@ static int __devinit xilinxfb_of_probe(struct platform_device *op)
485 return -ENODEV; 485 return -ENODEV;
486} 486}
487 487
488static int __devexit xilinxfb_of_remove(struct platform_device *op) 488static int xilinxfb_of_remove(struct platform_device *op)
489{ 489{
490 return xilinxfb_release(&op->dev); 490 return xilinxfb_release(&op->dev);
491} 491}
492 492
493/* Match table for of_platform binding */ 493/* Match table for of_platform binding */
494static struct of_device_id xilinxfb_of_match[] __devinitdata = { 494static struct of_device_id xilinxfb_of_match[] = {
495 { .compatible = "xlnx,xps-tft-1.00.a", }, 495 { .compatible = "xlnx,xps-tft-1.00.a", },
496 { .compatible = "xlnx,xps-tft-2.00.a", }, 496 { .compatible = "xlnx,xps-tft-2.00.a", },
497 { .compatible = "xlnx,xps-tft-2.01.a", }, 497 { .compatible = "xlnx,xps-tft-2.01.a", },
@@ -503,7 +503,7 @@ MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
503 503
504static struct platform_driver xilinxfb_of_driver = { 504static struct platform_driver xilinxfb_of_driver = {
505 .probe = xilinxfb_of_probe, 505 .probe = xilinxfb_of_probe,
506 .remove = __devexit_p(xilinxfb_of_remove), 506 .remove = xilinxfb_of_remove,
507 .driver = { 507 .driver = {
508 .name = DRIVER_NAME, 508 .name = DRIVER_NAME,
509 .owner = THIS_MODULE, 509 .owner = THIS_MODULE,
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index d19fe3e323b..797e1c79a10 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -500,7 +500,7 @@ static void remove_common(struct virtio_balloon *vb)
500 vb->vdev->config->del_vqs(vb->vdev); 500 vb->vdev->config->del_vqs(vb->vdev);
501} 501}
502 502
503static void __devexit virtballoon_remove(struct virtio_device *vdev) 503static void virtballoon_remove(struct virtio_device *vdev)
504{ 504{
505 struct virtio_balloon *vb = vdev->priv; 505 struct virtio_balloon *vb = vdev->priv;
506 506
@@ -552,7 +552,7 @@ static struct virtio_driver virtio_balloon_driver = {
552 .driver.owner = THIS_MODULE, 552 .driver.owner = THIS_MODULE,
553 .id_table = id_table, 553 .id_table = id_table,
554 .probe = virtballoon_probe, 554 .probe = virtballoon_probe,
555 .remove = __devexit_p(virtballoon_remove), 555 .remove = virtballoon_remove,
556 .config_changed = virtballoon_changed, 556 .config_changed = virtballoon_changed,
557#ifdef CONFIG_PM 557#ifdef CONFIG_PM
558 .freeze = virtballoon_freeze, 558 .freeze = virtballoon_freeze,
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 634f80bcdbd..31f966f4d27 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -440,7 +440,7 @@ static struct virtio_config_ops virtio_mmio_config_ops = {
440 440
441/* Platform device */ 441/* Platform device */
442 442
443static int __devinit virtio_mmio_probe(struct platform_device *pdev) 443static int virtio_mmio_probe(struct platform_device *pdev)
444{ 444{
445 struct virtio_mmio_device *vm_dev; 445 struct virtio_mmio_device *vm_dev;
446 struct resource *mem; 446 struct resource *mem;
@@ -493,7 +493,7 @@ static int __devinit virtio_mmio_probe(struct platform_device *pdev)
493 return register_virtio_device(&vm_dev->vdev); 493 return register_virtio_device(&vm_dev->vdev);
494} 494}
495 495
496static int __devexit virtio_mmio_remove(struct platform_device *pdev) 496static int virtio_mmio_remove(struct platform_device *pdev)
497{ 497{
498 struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev); 498 struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev);
499 499
@@ -638,7 +638,7 @@ MODULE_DEVICE_TABLE(of, virtio_mmio_match);
638 638
639static struct platform_driver virtio_mmio_driver = { 639static struct platform_driver virtio_mmio_driver = {
640 .probe = virtio_mmio_probe, 640 .probe = virtio_mmio_probe,
641 .remove = __devexit_p(virtio_mmio_remove), 641 .remove = virtio_mmio_remove,
642 .driver = { 642 .driver = {
643 .name = "virtio-mmio", 643 .name = "virtio-mmio",
644 .owner = THIS_MODULE, 644 .owner = THIS_MODULE,
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index e3ecc94591a..0c142892c10 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -676,8 +676,8 @@ static void virtio_pci_release_dev(struct device *_d)
676} 676}
677 677
678/* the PCI probing function */ 678/* the PCI probing function */
679static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, 679static int virtio_pci_probe(struct pci_dev *pci_dev,
680 const struct pci_device_id *id) 680 const struct pci_device_id *id)
681{ 681{
682 struct virtio_pci_device *vp_dev; 682 struct virtio_pci_device *vp_dev;
683 int err; 683 int err;
@@ -751,7 +751,7 @@ out:
751 return err; 751 return err;
752} 752}
753 753
754static void __devexit virtio_pci_remove(struct pci_dev *pci_dev) 754static void virtio_pci_remove(struct pci_dev *pci_dev)
755{ 755{
756 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); 756 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
757 757
@@ -822,7 +822,7 @@ static struct pci_driver virtio_pci_driver = {
822 .name = "virtio-pci", 822 .name = "virtio-pci",
823 .id_table = virtio_pci_id_table, 823 .id_table = virtio_pci_id_table,
824 .probe = virtio_pci_probe, 824 .probe = virtio_pci_probe,
825 .remove = __devexit_p(virtio_pci_remove), 825 .remove = virtio_pci_remove,
826#ifdef CONFIG_PM 826#ifdef CONFIG_PM
827 .driver.pm = &virtio_pci_pm_ops, 827 .driver.pm = &virtio_pci_pm_ops,
828#endif 828#endif
diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c
index aa250cebecd..7b07135ab26 100644
--- a/drivers/vlynq/vlynq.c
+++ b/drivers/vlynq/vlynq.c
@@ -772,7 +772,7 @@ static int vlynq_remove(struct platform_device *pdev)
772static struct platform_driver vlynq_platform_driver = { 772static struct platform_driver vlynq_platform_driver = {
773 .driver.name = "vlynq", 773 .driver.name = "vlynq",
774 .probe = vlynq_probe, 774 .probe = vlynq_probe,
775 .remove = __devexit_p(vlynq_remove), 775 .remove = vlynq_remove,
776}; 776};
777 777
778struct bus_type vlynq_bus_type = { 778struct bus_type vlynq_bus_type = {
@@ -783,7 +783,7 @@ struct bus_type vlynq_bus_type = {
783}; 783};
784EXPORT_SYMBOL(vlynq_bus_type); 784EXPORT_SYMBOL(vlynq_bus_type);
785 785
786static int __devinit vlynq_init(void) 786static int vlynq_init(void)
787{ 787{
788 int res = 0; 788 int res = 0;
789 789
@@ -803,7 +803,7 @@ fail_bus:
803 return res; 803 return res;
804} 804}
805 805
806static void __devexit vlynq_exit(void) 806static void vlynq_exit(void)
807{ 807{
808 platform_driver_unregister(&vlynq_platform_driver); 808 platform_driver_unregister(&vlynq_platform_driver);
809 bus_unregister(&vlynq_bus_type); 809 bus_unregister(&vlynq_bus_type);
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index d338b56ea2f..708a25fc996 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -191,7 +191,7 @@ static struct platform_driver mxc_w1_driver = {
191 .name = "mxc_w1", 191 .name = "mxc_w1",
192 }, 192 },
193 .probe = mxc_w1_probe, 193 .probe = mxc_w1_probe,
194 .remove = __devexit_p(mxc_w1_remove), 194 .remove = mxc_w1_remove,
195}; 195};
196module_platform_driver(mxc_w1_driver); 196module_platform_driver(mxc_w1_driver);
197 197
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index b91f14e8316..7038de53652 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1239,7 +1239,7 @@ int gnttab_init(void)
1239} 1239}
1240EXPORT_SYMBOL_GPL(gnttab_init); 1240EXPORT_SYMBOL_GPL(gnttab_init);
1241 1241
1242static int __devinit __gnttab_init(void) 1242static int __gnttab_init(void)
1243{ 1243{
1244 /* Delay grant-table initialization in the PV on HVM case */ 1244 /* Delay grant-table initialization in the PV on HVM case */
1245 if (xen_hvm_domain()) 1245 if (xen_hvm_domain())
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 97ca359ae2b..99db9e1eb8b 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -101,8 +101,8 @@ static int platform_pci_resume(struct pci_dev *pdev)
101 return 0; 101 return 0;
102} 102}
103 103
104static int __devinit platform_pci_init(struct pci_dev *pdev, 104static int platform_pci_init(struct pci_dev *pdev,
105 const struct pci_device_id *ent) 105 const struct pci_device_id *ent)
106{ 106{
107 int i, ret; 107 int i, ret;
108 long ioaddr; 108 long ioaddr;
@@ -170,7 +170,7 @@ pci_out:
170 return ret; 170 return ret;
171} 171}
172 172
173static struct pci_device_id platform_pci_tbl[] __devinitdata = { 173static struct pci_device_id platform_pci_tbl[] = {
174 {PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM, 174 {PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM,
175 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 175 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
176 {0,} 176 {0,}
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index cd50d251998..9204126f156 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -272,8 +272,8 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
272 up_write(&pcistub_sem); 272 up_write(&pcistub_sem);
273} 273}
274 274
275static int __devinit pcistub_match_one(struct pci_dev *dev, 275static int pcistub_match_one(struct pci_dev *dev,
276 struct pcistub_device_id *pdev_id) 276 struct pcistub_device_id *pdev_id)
277{ 277{
278 /* Match the specified device by domain, bus, slot, func and also if 278 /* Match the specified device by domain, bus, slot, func and also if
279 * any of the device's parent bridges match. 279 * any of the device's parent bridges match.
@@ -292,7 +292,7 @@ static int __devinit pcistub_match_one(struct pci_dev *dev,
292 return 0; 292 return 0;
293} 293}
294 294
295static int __devinit pcistub_match(struct pci_dev *dev) 295static int pcistub_match(struct pci_dev *dev)
296{ 296{
297 struct pcistub_device_id *pdev_id; 297 struct pcistub_device_id *pdev_id;
298 unsigned long flags; 298 unsigned long flags;
@@ -310,7 +310,7 @@ static int __devinit pcistub_match(struct pci_dev *dev)
310 return found; 310 return found;
311} 311}
312 312
313static int __devinit pcistub_init_device(struct pci_dev *dev) 313static int pcistub_init_device(struct pci_dev *dev)
314{ 314{
315 struct xen_pcibk_dev_data *dev_data; 315 struct xen_pcibk_dev_data *dev_data;
316 int err = 0; 316 int err = 0;
@@ -428,7 +428,7 @@ static int __init pcistub_init_devices_late(void)
428 return 0; 428 return 0;
429} 429}
430 430
431static int __devinit pcistub_seize(struct pci_dev *dev) 431static int pcistub_seize(struct pci_dev *dev)
432{ 432{
433 struct pcistub_device *psdev; 433 struct pcistub_device *psdev;
434 unsigned long flags; 434 unsigned long flags;
@@ -463,8 +463,7 @@ static int __devinit pcistub_seize(struct pci_dev *dev)
463 return err; 463 return err;
464} 464}
465 465
466static int __devinit pcistub_probe(struct pci_dev *dev, 466static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)
467 const struct pci_device_id *id)
468{ 467{
469 int err = 0; 468 int err = 0;
470 469
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
index 229624f867d..ac1db7f1bca 100644
--- a/drivers/zorro/zorro-driver.c
+++ b/drivers/zorro/zorro-driver.c
@@ -142,7 +142,6 @@ static int zorro_bus_match(struct device *dev, struct device_driver *drv)
142 142
143static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) 143static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env)
144{ 144{
145#ifdef CONFIG_HOTPLUG
146 struct zorro_dev *z; 145 struct zorro_dev *z;
147 146
148 if (!dev) 147 if (!dev)
@@ -159,9 +158,6 @@ static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env)
159 return -ENOMEM; 158 return -ENOMEM;
160 159
161 return 0; 160 return 0;
162#else /* !CONFIG_HOTPLUG */
163 return -ENODEV;
164#endif /* !CONFIG_HOTPLUG */
165} 161}
166 162
167struct bus_type zorro_bus_type = { 163struct bus_type zorro_bus_type = {
diff --git a/fs/buffer.c b/fs/buffer.c
index c017a2dfb90..7a75c3e0fd5 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2935,6 +2935,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh)
2935 void *kaddr = kmap_atomic(bh->b_page); 2935 void *kaddr = kmap_atomic(bh->b_page);
2936 memset(kaddr + bh_offset(bh) + bytes, 0, bh->b_size - bytes); 2936 memset(kaddr + bh_offset(bh) + bytes, 0, bh->b_size - bytes);
2937 kunmap_atomic(kaddr); 2937 kunmap_atomic(kaddr);
2938 flush_dcache_page(bh->b_page);
2938 } 2939 }
2939} 2940}
2940 2941
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index f653835d067..de7f9168a11 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -228,7 +228,6 @@ cifs_alloc_inode(struct super_block *sb)
228 cifs_set_oplock_level(cifs_inode, 0); 228 cifs_set_oplock_level(cifs_inode, 0);
229 cifs_inode->delete_pending = false; 229 cifs_inode->delete_pending = false;
230 cifs_inode->invalid_mapping = false; 230 cifs_inode->invalid_mapping = false;
231 cifs_inode->leave_pages_clean = false;
232 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ 231 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
233 cifs_inode->server_eof = 0; 232 cifs_inode->server_eof = 0;
234 cifs_inode->uniqueid = 0; 233 cifs_inode->uniqueid = 0;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index aea1eec6491..e6899cea1c3 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -386,6 +386,7 @@ struct smb_version_values {
386 unsigned int cap_unix; 386 unsigned int cap_unix;
387 unsigned int cap_nt_find; 387 unsigned int cap_nt_find;
388 unsigned int cap_large_files; 388 unsigned int cap_large_files;
389 unsigned int oplock_read;
389}; 390};
390 391
391#define HEADER_SIZE(server) (server->vals->header_size) 392#define HEADER_SIZE(server) (server->vals->header_size)
@@ -1030,7 +1031,6 @@ struct cifsInodeInfo {
1030 bool clientCanCacheAll; /* read and writebehind oplock */ 1031 bool clientCanCacheAll; /* read and writebehind oplock */
1031 bool delete_pending; /* DELETE_ON_CLOSE is set */ 1032 bool delete_pending; /* DELETE_ON_CLOSE is set */
1032 bool invalid_mapping; /* pagecache is invalid */ 1033 bool invalid_mapping; /* pagecache is invalid */
1033 bool leave_pages_clean; /* protected by i_mutex, not set pages dirty */
1034 unsigned long time; /* jiffies of last update of inode */ 1034 unsigned long time; /* jiffies of last update of inode */
1035 u64 server_eof; /* current file size on server -- protected by i_lock */ 1035 u64 server_eof; /* current file size on server -- protected by i_lock */
1036 u64 uniqueid; /* server inode number */ 1036 u64 uniqueid; /* server inode number */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 0a6677ba212..8ea6ca50a66 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -238,6 +238,23 @@ out:
238 return rc; 238 return rc;
239} 239}
240 240
241static bool
242cifs_has_mand_locks(struct cifsInodeInfo *cinode)
243{
244 struct cifs_fid_locks *cur;
245 bool has_locks = false;
246
247 down_read(&cinode->lock_sem);
248 list_for_each_entry(cur, &cinode->llist, llist) {
249 if (!list_empty(&cur->locks)) {
250 has_locks = true;
251 break;
252 }
253 }
254 up_read(&cinode->lock_sem);
255 return has_locks;
256}
257
241struct cifsFileInfo * 258struct cifsFileInfo *
242cifs_new_fileinfo(struct cifs_fid *fid, struct file *file, 259cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
243 struct tcon_link *tlink, __u32 oplock) 260 struct tcon_link *tlink, __u32 oplock)
@@ -248,6 +265,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
248 struct cifsFileInfo *cfile; 265 struct cifsFileInfo *cfile;
249 struct cifs_fid_locks *fdlocks; 266 struct cifs_fid_locks *fdlocks;
250 struct cifs_tcon *tcon = tlink_tcon(tlink); 267 struct cifs_tcon *tcon = tlink_tcon(tlink);
268 struct TCP_Server_Info *server = tcon->ses->server;
251 269
252 cfile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); 270 cfile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL);
253 if (cfile == NULL) 271 if (cfile == NULL)
@@ -276,12 +294,22 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
276 INIT_WORK(&cfile->oplock_break, cifs_oplock_break); 294 INIT_WORK(&cfile->oplock_break, cifs_oplock_break);
277 mutex_init(&cfile->fh_mutex); 295 mutex_init(&cfile->fh_mutex);
278 296
297 /*
298 * If the server returned a read oplock and we have mandatory brlocks,
299 * set oplock level to None.
300 */
301 if (oplock == server->vals->oplock_read &&
302 cifs_has_mand_locks(cinode)) {
303 cFYI(1, "Reset oplock val from read to None due to mand locks");
304 oplock = 0;
305 }
306
279 spin_lock(&cifs_file_list_lock); 307 spin_lock(&cifs_file_list_lock);
280 if (fid->pending_open->oplock != CIFS_OPLOCK_NO_CHANGE) 308 if (fid->pending_open->oplock != CIFS_OPLOCK_NO_CHANGE && oplock)
281 oplock = fid->pending_open->oplock; 309 oplock = fid->pending_open->oplock;
282 list_del(&fid->pending_open->olist); 310 list_del(&fid->pending_open->olist);
283 311
284 tlink_tcon(tlink)->ses->server->ops->set_fid(cfile, fid, oplock); 312 server->ops->set_fid(cfile, fid, oplock);
285 313
286 list_add(&cfile->tlist, &tcon->openFileList); 314 list_add(&cfile->tlist, &tcon->openFileList);
287 /* if readable file instance put first in list*/ 315 /* if readable file instance put first in list*/
@@ -1422,6 +1450,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1422 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data; 1450 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
1423 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1451 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1424 struct TCP_Server_Info *server = tcon->ses->server; 1452 struct TCP_Server_Info *server = tcon->ses->server;
1453 struct inode *inode = cfile->dentry->d_inode;
1425 1454
1426 if (posix_lck) { 1455 if (posix_lck) {
1427 int posix_lock_type; 1456 int posix_lock_type;
@@ -1459,6 +1488,21 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1459 if (!rc) 1488 if (!rc)
1460 goto out; 1489 goto out;
1461 1490
1491 /*
1492 * Windows 7 server can delay breaking lease from read to None
1493 * if we set a byte-range lock on a file - break it explicitly
1494 * before sending the lock to the server to be sure the next
1495 * read won't conflict with non-overlapted locks due to
1496 * pagereading.
1497 */
1498 if (!CIFS_I(inode)->clientCanCacheAll &&
1499 CIFS_I(inode)->clientCanCacheRead) {
1500 cifs_invalidate_mapping(inode);
1501 cFYI(1, "Set no oplock for inode=%p due to mand locks",
1502 inode);
1503 CIFS_I(inode)->clientCanCacheRead = false;
1504 }
1505
1462 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, 1506 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length,
1463 type, 1, 0, wait_flag); 1507 type, 1, 0, wait_flag);
1464 if (rc) { 1508 if (rc) {
@@ -2103,15 +2147,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2103 } else { 2147 } else {
2104 rc = copied; 2148 rc = copied;
2105 pos += copied; 2149 pos += copied;
2106 /* 2150 set_page_dirty(page);
2107 * When we use strict cache mode and cifs_strict_writev was run
2108 * with level II oplock (indicated by leave_pages_clean field of
2109 * CIFS_I(inode)), we can leave pages clean - cifs_strict_writev
2110 * sent the data to the server itself.
2111 */
2112 if (!CIFS_I(inode)->leave_pages_clean ||
2113 !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO))
2114 set_page_dirty(page);
2115 } 2151 }
2116 2152
2117 if (rc > 0) { 2153 if (rc > 0) {
@@ -2462,8 +2498,8 @@ ssize_t cifs_user_writev(struct kiocb *iocb, const struct iovec *iov,
2462} 2498}
2463 2499
2464static ssize_t 2500static ssize_t
2465cifs_pagecache_writev(struct kiocb *iocb, const struct iovec *iov, 2501cifs_writev(struct kiocb *iocb, const struct iovec *iov,
2466 unsigned long nr_segs, loff_t pos, bool cache_ex) 2502 unsigned long nr_segs, loff_t pos)
2467{ 2503{
2468 struct file *file = iocb->ki_filp; 2504 struct file *file = iocb->ki_filp;
2469 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data; 2505 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
@@ -2485,12 +2521,8 @@ cifs_pagecache_writev(struct kiocb *iocb, const struct iovec *iov,
2485 server->vals->exclusive_lock_type, NULL, 2521 server->vals->exclusive_lock_type, NULL,
2486 CIFS_WRITE_OP)) { 2522 CIFS_WRITE_OP)) {
2487 mutex_lock(&inode->i_mutex); 2523 mutex_lock(&inode->i_mutex);
2488 if (!cache_ex)
2489 cinode->leave_pages_clean = true;
2490 rc = __generic_file_aio_write(iocb, iov, nr_segs, 2524 rc = __generic_file_aio_write(iocb, iov, nr_segs,
2491 &iocb->ki_pos); 2525 &iocb->ki_pos);
2492 if (!cache_ex)
2493 cinode->leave_pages_clean = false;
2494 mutex_unlock(&inode->i_mutex); 2526 mutex_unlock(&inode->i_mutex);
2495 } 2527 }
2496 2528
@@ -2517,60 +2549,32 @@ cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
2517 struct cifsFileInfo *cfile = (struct cifsFileInfo *) 2549 struct cifsFileInfo *cfile = (struct cifsFileInfo *)
2518 iocb->ki_filp->private_data; 2550 iocb->ki_filp->private_data;
2519 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 2551 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
2520 ssize_t written, written2; 2552 ssize_t written;
2521 /*
2522 * We need to store clientCanCacheAll here to prevent race
2523 * conditions - this value can be changed during an execution
2524 * of generic_file_aio_write. For CIFS it can be changed from
2525 * true to false only, but for SMB2 it can be changed both from
2526 * true to false and vice versa. So, we can end up with a data
2527 * stored in the cache, not marked dirty and not sent to the
2528 * server if this value changes its state from false to true
2529 * after cifs_write_end.
2530 */
2531 bool cache_ex = cinode->clientCanCacheAll;
2532 bool cache_read = cinode->clientCanCacheRead;
2533 int rc;
2534 loff_t saved_pos;
2535 2553
2536 if (cache_ex) { 2554 if (cinode->clientCanCacheAll) {
2537 if (cap_unix(tcon->ses) && 2555 if (cap_unix(tcon->ses) &&
2538 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0) && 2556 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability))
2539 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu( 2557 && ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0))
2540 tcon->fsUnixInfo.Capability)))
2541 return generic_file_aio_write(iocb, iov, nr_segs, pos); 2558 return generic_file_aio_write(iocb, iov, nr_segs, pos);
2542 return cifs_pagecache_writev(iocb, iov, nr_segs, pos, cache_ex); 2559 return cifs_writev(iocb, iov, nr_segs, pos);
2543 } 2560 }
2544
2545 /* 2561 /*
2546 * For files without exclusive oplock in strict cache mode we need to 2562 * For non-oplocked files in strict cache mode we need to write the data
2547 * write the data to the server exactly from the pos to pos+len-1 rather 2563 * to the server exactly from the pos to pos+len-1 rather than flush all
2548 * than flush all affected pages because it may cause a error with 2564 * affected pages because it may cause a error with mandatory locks on
2549 * mandatory locks on these pages but not on the region from pos to 2565 * these pages but not on the region from pos to ppos+len-1.
2550 * ppos+len-1.
2551 */ 2566 */
2552 written = cifs_user_writev(iocb, iov, nr_segs, pos); 2567 written = cifs_user_writev(iocb, iov, nr_segs, pos);
2553 if (!cache_read || written <= 0) 2568 if (written > 0 && cinode->clientCanCacheRead) {
2554 return written; 2569 /*
2555 2570 * Windows 7 server can delay breaking level2 oplock if a write
2556 saved_pos = iocb->ki_pos; 2571 * request comes - break it on the client to prevent reading
2557 iocb->ki_pos = pos; 2572 * an old data.
2558 /* we have a read oplock - need to store a data in the page cache */ 2573 */
2559 if (cap_unix(tcon->ses) && 2574 cifs_invalidate_mapping(inode);
2560 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0) && 2575 cFYI(1, "Set no oplock for inode=%p after a write operation",
2561 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu( 2576 inode);
2562 tcon->fsUnixInfo.Capability))) 2577 cinode->clientCanCacheRead = false;
2563 written2 = generic_file_aio_write(iocb, iov, nr_segs, pos);
2564 else
2565 written2 = cifs_pagecache_writev(iocb, iov, nr_segs, pos,
2566 cache_ex);
2567 /* errors occured during writing - invalidate the page cache */
2568 if (written2 < 0) {
2569 rc = cifs_invalidate_mapping(inode);
2570 if (rc)
2571 written = (ssize_t)rc;
2572 else
2573 iocb->ki_pos = saved_pos;
2574 } 2578 }
2575 return written; 2579 return written;
2576} 2580}
@@ -3577,6 +3581,13 @@ void cifs_oplock_break(struct work_struct *work)
3577 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 3581 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
3578 int rc = 0; 3582 int rc = 0;
3579 3583
3584 if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead &&
3585 cifs_has_mand_locks(cinode)) {
3586 cFYI(1, "Reset oplock to None for inode=%p due to mand locks",
3587 inode);
3588 cinode->clientCanCacheRead = false;
3589 }
3590
3580 if (inode && S_ISREG(inode->i_mode)) { 3591 if (inode && S_ISREG(inode->i_mode)) {
3581 if (cinode->clientCanCacheRead) 3592 if (cinode->clientCanCacheRead)
3582 break_lease(inode, O_RDONLY); 3593 break_lease(inode, O_RDONLY);
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index a5d234c8d5d..47bc5a87f94 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -53,6 +53,13 @@ send_nt_cancel(struct TCP_Server_Info *server, void *buf,
53 mutex_unlock(&server->srv_mutex); 53 mutex_unlock(&server->srv_mutex);
54 return rc; 54 return rc;
55 } 55 }
56
57 /*
58 * The response to this call was already factored into the sequence
59 * number when the call went out, so we must adjust it back downward
60 * after signing here.
61 */
62 --server->sequence_number;
56 rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); 63 rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
57 mutex_unlock(&server->srv_mutex); 64 mutex_unlock(&server->srv_mutex);
58 65
@@ -952,4 +959,5 @@ struct smb_version_values smb1_values = {
952 .cap_unix = CAP_UNIX, 959 .cap_unix = CAP_UNIX,
953 .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND, 960 .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND,
954 .cap_large_files = CAP_LARGE_FILES, 961 .cap_large_files = CAP_LARGE_FILES,
962 .oplock_read = OPLOCK_READ,
955}; 963};
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index d79de7bc443..c9c7aa7ed96 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -708,6 +708,7 @@ struct smb_version_values smb20_values = {
708 .cap_unix = 0, 708 .cap_unix = 0,
709 .cap_nt_find = SMB2_NT_FIND, 709 .cap_nt_find = SMB2_NT_FIND,
710 .cap_large_files = SMB2_LARGE_FILES, 710 .cap_large_files = SMB2_LARGE_FILES,
711 .oplock_read = SMB2_OPLOCK_LEVEL_II,
711}; 712};
712 713
713struct smb_version_values smb21_values = { 714struct smb_version_values smb21_values = {
@@ -725,6 +726,7 @@ struct smb_version_values smb21_values = {
725 .cap_unix = 0, 726 .cap_unix = 0,
726 .cap_nt_find = SMB2_NT_FIND, 727 .cap_nt_find = SMB2_NT_FIND,
727 .cap_large_files = SMB2_LARGE_FILES, 728 .cap_large_files = SMB2_LARGE_FILES,
729 .oplock_read = SMB2_OPLOCK_LEVEL_II,
728}; 730};
729 731
730struct smb_version_values smb30_values = { 732struct smb_version_values smb30_values = {
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 76d974c952f..1a528680ec5 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -144,9 +144,6 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec,
144 144
145 *sent = 0; 145 *sent = 0;
146 146
147 if (ssocket == NULL)
148 return -ENOTSOCK; /* BB eventually add reconnect code here */
149
150 smb_msg.msg_name = (struct sockaddr *) &server->dstaddr; 147 smb_msg.msg_name = (struct sockaddr *) &server->dstaddr;
151 smb_msg.msg_namelen = sizeof(struct sockaddr); 148 smb_msg.msg_namelen = sizeof(struct sockaddr);
152 smb_msg.msg_control = NULL; 149 smb_msg.msg_control = NULL;
@@ -291,6 +288,9 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
291 struct socket *ssocket = server->ssocket; 288 struct socket *ssocket = server->ssocket;
292 int val = 1; 289 int val = 1;
293 290
291 if (ssocket == NULL)
292 return -ENOTSOCK;
293
294 cFYI(1, "Sending smb: smb_len=%u", smb_buf_length); 294 cFYI(1, "Sending smb: smb_len=%u", smb_buf_length);
295 dump_smb(iov[0].iov_base, iov[0].iov_len); 295 dump_smb(iov[0].iov_base, iov[0].iov_len);
296 296
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 153bb1e42e6..a5f12b7e228 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -176,7 +176,7 @@ static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
176 opts->uid = uid; 176 opts->uid = uid;
177 break; 177 break;
178 case Opt_gid: 178 case Opt_gid:
179 if (match_octal(&args[0], &option)) 179 if (match_int(&args[0], &option))
180 return -EINVAL; 180 return -EINVAL;
181 gid = make_kgid(current_user_ns(), option); 181 gid = make_kgid(current_user_ns(), option);
182 if (!gid_valid(gid)) 182 if (!gid_valid(gid))
diff --git a/fs/exec.c b/fs/exec.c
index 18c45cac368..20df02c1cc7 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -434,8 +434,9 @@ static int count(struct user_arg_ptr argv, int max)
434 if (IS_ERR(p)) 434 if (IS_ERR(p))
435 return -EFAULT; 435 return -EFAULT;
436 436
437 if (i++ >= max) 437 if (i >= max)
438 return -E2BIG; 438 return -E2BIG;
439 ++i;
439 440
440 if (fatal_signal_pending(current)) 441 if (fatal_signal_pending(current))
441 return -ERESTARTNOHAND; 442 return -ERESTARTNOHAND;
diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig
index 0a475c88185..987358740cb 100644
--- a/fs/ext4/Kconfig
+++ b/fs/ext4/Kconfig
@@ -41,6 +41,7 @@ config EXT4_USE_FOR_EXT23
41 41
42config EXT4_FS_POSIX_ACL 42config EXT4_FS_POSIX_ACL
43 bool "Ext4 POSIX Access Control Lists" 43 bool "Ext4 POSIX Access Control Lists"
44 depends on EXT4_FS
44 select FS_POSIX_ACL 45 select FS_POSIX_ACL
45 help 46 help
46 POSIX Access Control Lists (ACLs) support permissions for users and 47 POSIX Access Control Lists (ACLs) support permissions for users and
@@ -53,6 +54,7 @@ config EXT4_FS_POSIX_ACL
53 54
54config EXT4_FS_SECURITY 55config EXT4_FS_SECURITY
55 bool "Ext4 Security Labels" 56 bool "Ext4 Security Labels"
57 depends on EXT4_FS
56 help 58 help
57 Security labels support alternative access control models 59 Security labels support alternative access control models
58 implemented by security modules like SELinux. This option 60 implemented by security modules like SELinux. This option
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 8990165346e..f9ed946a448 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -722,7 +722,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
722 ext4_warning(dir->i_sb, "Node failed checksum"); 722 ext4_warning(dir->i_sb, "Node failed checksum");
723 brelse(bh); 723 brelse(bh);
724 *err = ERR_BAD_DX_DIR; 724 *err = ERR_BAD_DX_DIR;
725 goto fail; 725 goto fail2;
726 } 726 }
727 set_buffer_verified(bh); 727 set_buffer_verified(bh);
728 728
@@ -2368,7 +2368,6 @@ static int ext4_init_new_dir(handle_t *handle, struct inode *dir,
2368 } 2368 }
2369 2369
2370 inode->i_size = EXT4_I(inode)->i_disksize = blocksize; 2370 inode->i_size = EXT4_I(inode)->i_disksize = blocksize;
2371 dir_block = ext4_bread(handle, inode, 0, 1, &err);
2372 if (!(dir_block = ext4_bread(handle, inode, 0, 1, &err))) { 2371 if (!(dir_block = ext4_bread(handle, inode, 0, 1, &err))) {
2373 if (!err) { 2372 if (!err) {
2374 err = -EIO; 2373 err = -EIO;
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 655aeabc1dd..3aa5ce7cab8 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -16,6 +16,7 @@
16#include <linux/backing-dev.h> 16#include <linux/backing-dev.h>
17#include <linux/blkdev.h> 17#include <linux/blkdev.h>
18#include <linux/bio.h> 18#include <linux/bio.h>
19#include <linux/prefetch.h>
19 20
20#include "f2fs.h" 21#include "f2fs.h"
21#include "node.h" 22#include "node.h"
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index b4e24f32b54..951ed52748f 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -11,6 +11,7 @@
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/f2fs_fs.h> 12#include <linux/f2fs_fs.h>
13#include "f2fs.h" 13#include "f2fs.h"
14#include "node.h"
14#include "acl.h" 15#include "acl.h"
15 16
16static unsigned long dir_blocks(struct inode *inode) 17static unsigned long dir_blocks(struct inode *inode)
@@ -74,7 +75,7 @@ static unsigned long dir_block_index(unsigned int level, unsigned int idx)
74 return bidx; 75 return bidx;
75} 76}
76 77
77static bool early_match_name(const char *name, int namelen, 78static bool early_match_name(const char *name, size_t namelen,
78 f2fs_hash_t namehash, struct f2fs_dir_entry *de) 79 f2fs_hash_t namehash, struct f2fs_dir_entry *de)
79{ 80{
80 if (le16_to_cpu(de->name_len) != namelen) 81 if (le16_to_cpu(de->name_len) != namelen)
@@ -87,7 +88,7 @@ static bool early_match_name(const char *name, int namelen,
87} 88}
88 89
89static struct f2fs_dir_entry *find_in_block(struct page *dentry_page, 90static struct f2fs_dir_entry *find_in_block(struct page *dentry_page,
90 const char *name, int namelen, int *max_slots, 91 const char *name, size_t namelen, int *max_slots,
91 f2fs_hash_t namehash, struct page **res_page) 92 f2fs_hash_t namehash, struct page **res_page)
92{ 93{
93 struct f2fs_dir_entry *de; 94 struct f2fs_dir_entry *de;
@@ -126,7 +127,7 @@ found:
126} 127}
127 128
128static struct f2fs_dir_entry *find_in_level(struct inode *dir, 129static struct f2fs_dir_entry *find_in_level(struct inode *dir,
129 unsigned int level, const char *name, int namelen, 130 unsigned int level, const char *name, size_t namelen,
130 f2fs_hash_t namehash, struct page **res_page) 131 f2fs_hash_t namehash, struct page **res_page)
131{ 132{
132 int s = GET_DENTRY_SLOTS(namelen); 133 int s = GET_DENTRY_SLOTS(namelen);
@@ -181,7 +182,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
181 struct qstr *child, struct page **res_page) 182 struct qstr *child, struct page **res_page)
182{ 183{
183 const char *name = child->name; 184 const char *name = child->name;
184 int namelen = child->len; 185 size_t namelen = child->len;
185 unsigned long npages = dir_blocks(dir); 186 unsigned long npages = dir_blocks(dir);
186 struct f2fs_dir_entry *de = NULL; 187 struct f2fs_dir_entry *de = NULL;
187 f2fs_hash_t name_hash; 188 f2fs_hash_t name_hash;
@@ -308,6 +309,7 @@ static int init_inode_metadata(struct inode *inode, struct dentry *dentry)
308 ipage = get_node_page(F2FS_SB(dir->i_sb), inode->i_ino); 309 ipage = get_node_page(F2FS_SB(dir->i_sb), inode->i_ino);
309 if (IS_ERR(ipage)) 310 if (IS_ERR(ipage))
310 return PTR_ERR(ipage); 311 return PTR_ERR(ipage);
312 set_cold_node(inode, ipage);
311 init_dent_inode(dentry, ipage); 313 init_dent_inode(dentry, ipage);
312 f2fs_put_page(ipage, 1); 314 f2fs_put_page(ipage, 1);
313 } 315 }
@@ -381,7 +383,7 @@ int f2fs_add_link(struct dentry *dentry, struct inode *inode)
381 struct inode *dir = dentry->d_parent->d_inode; 383 struct inode *dir = dentry->d_parent->d_inode;
382 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); 384 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
383 const char *name = dentry->d_name.name; 385 const char *name = dentry->d_name.name;
384 int namelen = dentry->d_name.len; 386 size_t namelen = dentry->d_name.len;
385 struct page *dentry_page = NULL; 387 struct page *dentry_page = NULL;
386 struct f2fs_dentry_block *dentry_blk = NULL; 388 struct f2fs_dentry_block *dentry_blk = NULL;
387 int slots = GET_DENTRY_SLOTS(namelen); 389 int slots = GET_DENTRY_SLOTS(namelen);
@@ -540,13 +542,13 @@ int f2fs_make_empty(struct inode *inode, struct inode *parent)
540 542
541 de = &dentry_blk->dentry[0]; 543 de = &dentry_blk->dentry[0];
542 de->name_len = cpu_to_le16(1); 544 de->name_len = cpu_to_le16(1);
543 de->hash_code = 0; 545 de->hash_code = f2fs_dentry_hash(".", 1);
544 de->ino = cpu_to_le32(inode->i_ino); 546 de->ino = cpu_to_le32(inode->i_ino);
545 memcpy(dentry_blk->filename[0], ".", 1); 547 memcpy(dentry_blk->filename[0], ".", 1);
546 set_de_type(de, inode); 548 set_de_type(de, inode);
547 549
548 de = &dentry_blk->dentry[1]; 550 de = &dentry_blk->dentry[1];
549 de->hash_code = 0; 551 de->hash_code = f2fs_dentry_hash("..", 2);
550 de->name_len = cpu_to_le16(2); 552 de->name_len = cpu_to_le16(2);
551 de->ino = cpu_to_le32(parent->i_ino); 553 de->ino = cpu_to_le32(parent->i_ino);
552 memcpy(dentry_blk->filename[1], "..", 2); 554 memcpy(dentry_blk->filename[1], "..", 2);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index a18d63db2fb..13c6dfbb718 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -881,7 +881,7 @@ int f2fs_sync_fs(struct super_block *, int);
881/* 881/*
882 * hash.c 882 * hash.c
883 */ 883 */
884f2fs_hash_t f2fs_dentry_hash(const char *, int); 884f2fs_hash_t f2fs_dentry_hash(const char *, size_t);
885 885
886/* 886/*
887 * node.c 887 * node.c
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index f9e085dfb1f..7f9ea9271eb 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -160,15 +160,17 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
160 if (need_to_sync_dir(sbi, inode)) 160 if (need_to_sync_dir(sbi, inode))
161 need_cp = true; 161 need_cp = true;
162 162
163 f2fs_write_inode(inode, NULL);
164
165 if (need_cp) { 163 if (need_cp) {
166 /* all the dirty node pages should be flushed for POR */ 164 /* all the dirty node pages should be flushed for POR */
167 ret = f2fs_sync_fs(inode->i_sb, 1); 165 ret = f2fs_sync_fs(inode->i_sb, 1);
168 clear_inode_flag(F2FS_I(inode), FI_NEED_CP); 166 clear_inode_flag(F2FS_I(inode), FI_NEED_CP);
169 } else { 167 } else {
170 while (sync_node_pages(sbi, inode->i_ino, &wbc) == 0) 168 /* if there is no written node page, write its inode page */
171 f2fs_write_inode(inode, NULL); 169 while (!sync_node_pages(sbi, inode->i_ino, &wbc)) {
170 ret = f2fs_write_inode(inode, NULL);
171 if (ret)
172 goto out;
173 }
172 filemap_fdatawait_range(sbi->node_inode->i_mapping, 174 filemap_fdatawait_range(sbi->node_inode->i_mapping,
173 0, LONG_MAX); 175 0, LONG_MAX);
174 } 176 }
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 644aa380827..b0ec721e984 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -390,9 +390,7 @@ next_step:
390 } 390 }
391 391
392 err = check_valid_map(sbi, segno, off); 392 err = check_valid_map(sbi, segno, off);
393 if (err == GC_ERROR) 393 if (err == GC_NEXT)
394 return err;
395 else if (err == GC_NEXT)
396 continue; 394 continue;
397 395
398 if (initial) { 396 if (initial) {
@@ -430,28 +428,22 @@ next_step:
430 */ 428 */
431block_t start_bidx_of_node(unsigned int node_ofs) 429block_t start_bidx_of_node(unsigned int node_ofs)
432{ 430{
433 block_t start_bidx; 431 unsigned int indirect_blks = 2 * NIDS_PER_BLOCK + 4;
434 unsigned int bidx, indirect_blks; 432 unsigned int bidx;
435 int dec;
436 433
437 indirect_blks = 2 * NIDS_PER_BLOCK + 4; 434 if (node_ofs == 0)
435 return 0;
438 436
439 start_bidx = 1; 437 if (node_ofs <= 2) {
440 if (node_ofs == 0) {
441 start_bidx = 0;
442 } else if (node_ofs <= 2) {
443 bidx = node_ofs - 1; 438 bidx = node_ofs - 1;
444 } else if (node_ofs <= indirect_blks) { 439 } else if (node_ofs <= indirect_blks) {
445 dec = (node_ofs - 4) / (NIDS_PER_BLOCK + 1); 440 int dec = (node_ofs - 4) / (NIDS_PER_BLOCK + 1);
446 bidx = node_ofs - 2 - dec; 441 bidx = node_ofs - 2 - dec;
447 } else { 442 } else {
448 dec = (node_ofs - indirect_blks - 3) / (NIDS_PER_BLOCK + 1); 443 int dec = (node_ofs - indirect_blks - 3) / (NIDS_PER_BLOCK + 1);
449 bidx = node_ofs - 5 - dec; 444 bidx = node_ofs - 5 - dec;
450 } 445 }
451 446 return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE;
452 if (start_bidx)
453 start_bidx = bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE;
454 return start_bidx;
455} 447}
456 448
457static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, 449static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
@@ -556,9 +548,7 @@ next_step:
556 } 548 }
557 549
558 err = check_valid_map(sbi, segno, off); 550 err = check_valid_map(sbi, segno, off);
559 if (err == GC_ERROR) 551 if (err == GC_NEXT)
560 goto stop;
561 else if (err == GC_NEXT)
562 continue; 552 continue;
563 553
564 if (phase == 0) { 554 if (phase == 0) {
@@ -568,9 +558,7 @@ next_step:
568 558
569 /* Get an inode by ino with checking validity */ 559 /* Get an inode by ino with checking validity */
570 err = check_dnode(sbi, entry, &dni, start_addr + off, &nofs); 560 err = check_dnode(sbi, entry, &dni, start_addr + off, &nofs);
571 if (err == GC_ERROR) 561 if (err == GC_NEXT)
572 goto stop;
573 else if (err == GC_NEXT)
574 continue; 562 continue;
575 563
576 if (phase == 1) { 564 if (phase == 1) {
diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c
index a60f04200f8..6eb8d269b53 100644
--- a/fs/f2fs/hash.c
+++ b/fs/f2fs/hash.c
@@ -42,7 +42,7 @@ static void TEA_transform(unsigned int buf[4], unsigned int const in[])
42 buf[1] += b1; 42 buf[1] += b1;
43} 43}
44 44
45static void str2hashbuf(const char *msg, int len, unsigned int *buf, int num) 45static void str2hashbuf(const char *msg, size_t len, unsigned int *buf, int num)
46{ 46{
47 unsigned pad, val; 47 unsigned pad, val;
48 int i; 48 int i;
@@ -69,13 +69,17 @@ static void str2hashbuf(const char *msg, int len, unsigned int *buf, int num)
69 *buf++ = pad; 69 *buf++ = pad;
70} 70}
71 71
72f2fs_hash_t f2fs_dentry_hash(const char *name, int len) 72f2fs_hash_t f2fs_dentry_hash(const char *name, size_t len)
73{ 73{
74 __u32 hash, minor_hash; 74 __u32 hash;
75 f2fs_hash_t f2fs_hash; 75 f2fs_hash_t f2fs_hash;
76 const char *p; 76 const char *p;
77 __u32 in[8], buf[4]; 77 __u32 in[8], buf[4];
78 78
79 if ((len <= 2) && (name[0] == '.') &&
80 (name[1] == '.' || name[1] == '\0'))
81 return 0;
82
79 /* Initialize the default seed for the hash checksum functions */ 83 /* Initialize the default seed for the hash checksum functions */
80 buf[0] = 0x67452301; 84 buf[0] = 0x67452301;
81 buf[1] = 0xefcdab89; 85 buf[1] = 0xefcdab89;
@@ -83,15 +87,15 @@ f2fs_hash_t f2fs_dentry_hash(const char *name, int len)
83 buf[3] = 0x10325476; 87 buf[3] = 0x10325476;
84 88
85 p = name; 89 p = name;
86 while (len > 0) { 90 while (1) {
87 str2hashbuf(p, len, in, 4); 91 str2hashbuf(p, len, in, 4);
88 TEA_transform(buf, in); 92 TEA_transform(buf, in);
89 len -= 16;
90 p += 16; 93 p += 16;
94 if (len <= 16)
95 break;
96 len -= 16;
91 } 97 }
92 hash = buf[0]; 98 hash = buf[0];
93 minor_hash = buf[1];
94
95 f2fs_hash = cpu_to_le32(hash & ~F2FS_HASH_COL_BIT); 99 f2fs_hash = cpu_to_le32(hash & ~F2FS_HASH_COL_BIT);
96 return f2fs_hash; 100 return f2fs_hash;
97} 101}
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index df5fb381ebf..bf20b4d0321 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -203,6 +203,7 @@ void update_inode(struct inode *inode, struct page *node_page)
203 ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags); 203 ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags);
204 ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino); 204 ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino);
205 ri->i_generation = cpu_to_le32(inode->i_generation); 205 ri->i_generation = cpu_to_le32(inode->i_generation);
206 set_cold_node(inode, node_page);
206 set_page_dirty(node_page); 207 set_page_dirty(node_page);
207} 208}
208 209
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 89b7675dc37..1a49b881bac 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -77,8 +77,8 @@ fail:
77 77
78static int is_multimedia_file(const unsigned char *s, const char *sub) 78static int is_multimedia_file(const unsigned char *s, const char *sub)
79{ 79{
80 int slen = strlen(s); 80 size_t slen = strlen(s);
81 int sublen = strlen(sub); 81 size_t sublen = strlen(sub);
82 int ret; 82 int ret;
83 83
84 if (sublen > slen) 84 if (sublen > slen)
@@ -123,6 +123,8 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
123 nid_t ino = 0; 123 nid_t ino = 0;
124 int err; 124 int err;
125 125
126 f2fs_balance_fs(sbi);
127
126 inode = f2fs_new_inode(dir, mode); 128 inode = f2fs_new_inode(dir, mode);
127 if (IS_ERR(inode)) 129 if (IS_ERR(inode))
128 return PTR_ERR(inode); 130 return PTR_ERR(inode);
@@ -144,8 +146,6 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
144 if (!sbi->por_doing) 146 if (!sbi->por_doing)
145 d_instantiate(dentry, inode); 147 d_instantiate(dentry, inode);
146 unlock_new_inode(inode); 148 unlock_new_inode(inode);
147
148 f2fs_balance_fs(sbi);
149 return 0; 149 return 0;
150out: 150out:
151 clear_nlink(inode); 151 clear_nlink(inode);
@@ -163,6 +163,8 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
163 struct f2fs_sb_info *sbi = F2FS_SB(sb); 163 struct f2fs_sb_info *sbi = F2FS_SB(sb);
164 int err; 164 int err;
165 165
166 f2fs_balance_fs(sbi);
167
166 inode->i_ctime = CURRENT_TIME; 168 inode->i_ctime = CURRENT_TIME;
167 atomic_inc(&inode->i_count); 169 atomic_inc(&inode->i_count);
168 170
@@ -172,8 +174,6 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
172 goto out; 174 goto out;
173 175
174 d_instantiate(dentry, inode); 176 d_instantiate(dentry, inode);
175
176 f2fs_balance_fs(sbi);
177 return 0; 177 return 0;
178out: 178out:
179 clear_inode_flag(F2FS_I(inode), FI_INC_LINK); 179 clear_inode_flag(F2FS_I(inode), FI_INC_LINK);
@@ -223,6 +223,8 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
223 struct page *page; 223 struct page *page;
224 int err = -ENOENT; 224 int err = -ENOENT;
225 225
226 f2fs_balance_fs(sbi);
227
226 de = f2fs_find_entry(dir, &dentry->d_name, &page); 228 de = f2fs_find_entry(dir, &dentry->d_name, &page);
227 if (!de) 229 if (!de)
228 goto fail; 230 goto fail;
@@ -238,7 +240,6 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
238 240
239 /* In order to evict this inode, we set it dirty */ 241 /* In order to evict this inode, we set it dirty */
240 mark_inode_dirty(inode); 242 mark_inode_dirty(inode);
241 f2fs_balance_fs(sbi);
242fail: 243fail:
243 return err; 244 return err;
244} 245}
@@ -249,9 +250,11 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
249 struct super_block *sb = dir->i_sb; 250 struct super_block *sb = dir->i_sb;
250 struct f2fs_sb_info *sbi = F2FS_SB(sb); 251 struct f2fs_sb_info *sbi = F2FS_SB(sb);
251 struct inode *inode; 252 struct inode *inode;
252 unsigned symlen = strlen(symname) + 1; 253 size_t symlen = strlen(symname) + 1;
253 int err; 254 int err;
254 255
256 f2fs_balance_fs(sbi);
257
255 inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO); 258 inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO);
256 if (IS_ERR(inode)) 259 if (IS_ERR(inode))
257 return PTR_ERR(inode); 260 return PTR_ERR(inode);
@@ -268,9 +271,6 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
268 271
269 d_instantiate(dentry, inode); 272 d_instantiate(dentry, inode);
270 unlock_new_inode(inode); 273 unlock_new_inode(inode);
271
272 f2fs_balance_fs(sbi);
273
274 return err; 274 return err;
275out: 275out:
276 clear_nlink(inode); 276 clear_nlink(inode);
@@ -286,6 +286,8 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
286 struct inode *inode; 286 struct inode *inode;
287 int err; 287 int err;
288 288
289 f2fs_balance_fs(sbi);
290
289 inode = f2fs_new_inode(dir, S_IFDIR | mode); 291 inode = f2fs_new_inode(dir, S_IFDIR | mode);
290 if (IS_ERR(inode)) 292 if (IS_ERR(inode))
291 return PTR_ERR(inode); 293 return PTR_ERR(inode);
@@ -305,7 +307,6 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
305 d_instantiate(dentry, inode); 307 d_instantiate(dentry, inode);
306 unlock_new_inode(inode); 308 unlock_new_inode(inode);
307 309
308 f2fs_balance_fs(sbi);
309 return 0; 310 return 0;
310 311
311out_fail: 312out_fail:
@@ -336,6 +337,8 @@ static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
336 if (!new_valid_dev(rdev)) 337 if (!new_valid_dev(rdev))
337 return -EINVAL; 338 return -EINVAL;
338 339
340 f2fs_balance_fs(sbi);
341
339 inode = f2fs_new_inode(dir, mode); 342 inode = f2fs_new_inode(dir, mode);
340 if (IS_ERR(inode)) 343 if (IS_ERR(inode))
341 return PTR_ERR(inode); 344 return PTR_ERR(inode);
@@ -350,9 +353,6 @@ static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
350 alloc_nid_done(sbi, inode->i_ino); 353 alloc_nid_done(sbi, inode->i_ino);
351 d_instantiate(dentry, inode); 354 d_instantiate(dentry, inode);
352 unlock_new_inode(inode); 355 unlock_new_inode(inode);
353
354 f2fs_balance_fs(sbi);
355
356 return 0; 356 return 0;
357out: 357out:
358 clear_nlink(inode); 358 clear_nlink(inode);
@@ -376,6 +376,8 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
376 struct f2fs_dir_entry *new_entry; 376 struct f2fs_dir_entry *new_entry;
377 int err = -ENOENT; 377 int err = -ENOENT;
378 378
379 f2fs_balance_fs(sbi);
380
379 old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page); 381 old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page);
380 if (!old_entry) 382 if (!old_entry)
381 goto out; 383 goto out;
@@ -441,8 +443,6 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
441 } 443 }
442 444
443 mutex_unlock_op(sbi, RENAME); 445 mutex_unlock_op(sbi, RENAME);
444
445 f2fs_balance_fs(sbi);
446 return 0; 446 return 0;
447 447
448out_dir: 448out_dir:
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 19870361497..5066bfd256c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -484,12 +484,14 @@ static void truncate_node(struct dnode_of_data *dn)
484 struct node_info ni; 484 struct node_info ni;
485 485
486 get_node_info(sbi, dn->nid, &ni); 486 get_node_info(sbi, dn->nid, &ni);
487 if (dn->inode->i_blocks == 0) {
488 BUG_ON(ni.blk_addr != NULL_ADDR);
489 goto invalidate;
490 }
487 BUG_ON(ni.blk_addr == NULL_ADDR); 491 BUG_ON(ni.blk_addr == NULL_ADDR);
488 492
489 if (ni.blk_addr != NULL_ADDR)
490 invalidate_blocks(sbi, ni.blk_addr);
491
492 /* Deallocate node address */ 493 /* Deallocate node address */
494 invalidate_blocks(sbi, ni.blk_addr);
493 dec_valid_node_count(sbi, dn->inode, 1); 495 dec_valid_node_count(sbi, dn->inode, 1);
494 set_node_addr(sbi, &ni, NULL_ADDR); 496 set_node_addr(sbi, &ni, NULL_ADDR);
495 497
@@ -499,7 +501,7 @@ static void truncate_node(struct dnode_of_data *dn)
499 } else { 501 } else {
500 sync_inode_page(dn); 502 sync_inode_page(dn);
501 } 503 }
502 504invalidate:
503 clear_node_page_dirty(dn->node_page); 505 clear_node_page_dirty(dn->node_page);
504 F2FS_SET_SB_DIRT(sbi); 506 F2FS_SET_SB_DIRT(sbi);
505 507
@@ -768,20 +770,12 @@ int remove_inode_page(struct inode *inode)
768 dn.inode_page_locked = 1; 770 dn.inode_page_locked = 1;
769 truncate_node(&dn); 771 truncate_node(&dn);
770 } 772 }
771 if (inode->i_blocks == 1) {
772 /* inernally call f2fs_put_page() */
773 set_new_dnode(&dn, inode, page, page, ino);
774 truncate_node(&dn);
775 } else if (inode->i_blocks == 0) {
776 struct node_info ni;
777 get_node_info(sbi, inode->i_ino, &ni);
778 773
779 /* called after f2fs_new_inode() is failed */ 774 /* 0 is possible, after f2fs_new_inode() is failed */
780 BUG_ON(ni.blk_addr != NULL_ADDR); 775 BUG_ON(inode->i_blocks != 0 && inode->i_blocks != 1);
781 f2fs_put_page(page, 1); 776 set_new_dnode(&dn, inode, page, page, ino);
782 } else { 777 truncate_node(&dn);
783 BUG(); 778
784 }
785 mutex_unlock_op(sbi, NODE_TRUNC); 779 mutex_unlock_op(sbi, NODE_TRUNC);
786 return 0; 780 return 0;
787} 781}
@@ -834,17 +828,18 @@ struct page *new_node_page(struct dnode_of_data *dn, unsigned int ofs)
834 goto fail; 828 goto fail;
835 } 829 }
836 set_node_addr(sbi, &new_ni, NEW_ADDR); 830 set_node_addr(sbi, &new_ni, NEW_ADDR);
831 set_cold_node(dn->inode, page);
837 832
838 dn->node_page = page; 833 dn->node_page = page;
839 sync_inode_page(dn); 834 sync_inode_page(dn);
840 set_page_dirty(page); 835 set_page_dirty(page);
841 set_cold_node(dn->inode, page);
842 if (ofs == 0) 836 if (ofs == 0)
843 inc_valid_inode_count(sbi); 837 inc_valid_inode_count(sbi);
844 838
845 return page; 839 return page;
846 840
847fail: 841fail:
842 clear_node_page_dirty(page);
848 f2fs_put_page(page, 1); 843 f2fs_put_page(page, 1);
849 return ERR_PTR(err); 844 return ERR_PTR(err);
850} 845}
@@ -1093,7 +1088,6 @@ static int f2fs_write_node_page(struct page *page,
1093{ 1088{
1094 struct f2fs_sb_info *sbi = F2FS_SB(page->mapping->host->i_sb); 1089 struct f2fs_sb_info *sbi = F2FS_SB(page->mapping->host->i_sb);
1095 nid_t nid; 1090 nid_t nid;
1096 unsigned int nofs;
1097 block_t new_addr; 1091 block_t new_addr;
1098 struct node_info ni; 1092 struct node_info ni;
1099 1093
@@ -1110,7 +1104,6 @@ static int f2fs_write_node_page(struct page *page,
1110 1104
1111 /* get old block addr of this node page */ 1105 /* get old block addr of this node page */
1112 nid = nid_of_node(page); 1106 nid = nid_of_node(page);
1113 nofs = ofs_of_node(page);
1114 BUG_ON(page->index != nid); 1107 BUG_ON(page->index != nid);
1115 1108
1116 get_node_info(sbi, nid, &ni); 1109 get_node_info(sbi, nid, &ni);
@@ -1571,7 +1564,7 @@ void flush_nat_entries(struct f2fs_sb_info *sbi)
1571 nid_t nid; 1564 nid_t nid;
1572 struct f2fs_nat_entry raw_ne; 1565 struct f2fs_nat_entry raw_ne;
1573 int offset = -1; 1566 int offset = -1;
1574 block_t old_blkaddr, new_blkaddr; 1567 block_t new_blkaddr;
1575 1568
1576 ne = list_entry(cur, struct nat_entry, list); 1569 ne = list_entry(cur, struct nat_entry, list);
1577 nid = nat_get_nid(ne); 1570 nid = nat_get_nid(ne);
@@ -1585,7 +1578,6 @@ void flush_nat_entries(struct f2fs_sb_info *sbi)
1585 offset = lookup_journal_in_cursum(sum, NAT_JOURNAL, nid, 1); 1578 offset = lookup_journal_in_cursum(sum, NAT_JOURNAL, nid, 1);
1586 if (offset >= 0) { 1579 if (offset >= 0) {
1587 raw_ne = nat_in_journal(sum, offset); 1580 raw_ne = nat_in_journal(sum, offset);
1588 old_blkaddr = le32_to_cpu(raw_ne.block_addr);
1589 goto flush_now; 1581 goto flush_now;
1590 } 1582 }
1591to_nat_page: 1583to_nat_page:
@@ -1607,7 +1599,6 @@ to_nat_page:
1607 1599
1608 BUG_ON(!nat_blk); 1600 BUG_ON(!nat_blk);
1609 raw_ne = nat_blk->entries[nid - start_nid]; 1601 raw_ne = nat_blk->entries[nid - start_nid];
1610 old_blkaddr = le32_to_cpu(raw_ne.block_addr);
1611flush_now: 1602flush_now:
1612 new_blkaddr = nat_get_blkaddr(ne); 1603 new_blkaddr = nat_get_blkaddr(ne);
1613 1604
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index b07e9b6ef37..b571fee677d 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -144,14 +144,15 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
144 goto out; 144 goto out;
145 } 145 }
146 146
147 INIT_LIST_HEAD(&entry->list);
148 list_add_tail(&entry->list, head);
149
150 entry->inode = f2fs_iget(sbi->sb, ino_of_node(page)); 147 entry->inode = f2fs_iget(sbi->sb, ino_of_node(page));
151 if (IS_ERR(entry->inode)) { 148 if (IS_ERR(entry->inode)) {
152 err = PTR_ERR(entry->inode); 149 err = PTR_ERR(entry->inode);
150 kmem_cache_free(fsync_entry_slab, entry);
153 goto out; 151 goto out;
154 } 152 }
153
154 INIT_LIST_HEAD(&entry->list);
155 list_add_tail(&entry->list, head);
155 entry->blkaddr = blkaddr; 156 entry->blkaddr = blkaddr;
156 } 157 }
157 if (IS_INODE(page)) { 158 if (IS_INODE(page)) {
@@ -228,6 +229,9 @@ static void check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
228 229
229 /* Deallocate previous index in the node page */ 230 /* Deallocate previous index in the node page */
230 inode = f2fs_iget_nowait(sbi->sb, ino); 231 inode = f2fs_iget_nowait(sbi->sb, ino);
232 if (IS_ERR(inode))
233 return;
234
231 truncate_hole(inode, bidx, bidx + 1); 235 truncate_hole(inode, bidx, bidx + 1);
232 iput(inode); 236 iput(inode);
233} 237}
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1b26e4ea101..de6240922b0 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -12,54 +12,23 @@
12#include <linux/f2fs_fs.h> 12#include <linux/f2fs_fs.h>
13#include <linux/bio.h> 13#include <linux/bio.h>
14#include <linux/blkdev.h> 14#include <linux/blkdev.h>
15#include <linux/prefetch.h>
15#include <linux/vmalloc.h> 16#include <linux/vmalloc.h>
16 17
17#include "f2fs.h" 18#include "f2fs.h"
18#include "segment.h" 19#include "segment.h"
19#include "node.h" 20#include "node.h"
20 21
21static int need_to_flush(struct f2fs_sb_info *sbi)
22{
23 unsigned int pages_per_sec = (1 << sbi->log_blocks_per_seg) *
24 sbi->segs_per_sec;
25 int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1)
26 >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
27 int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1)
28 >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
29
30 if (sbi->por_doing)
31 return 0;
32
33 if (free_sections(sbi) <= (node_secs + 2 * dent_secs +
34 reserved_sections(sbi)))
35 return 1;
36 return 0;
37}
38
39/* 22/*
40 * This function balances dirty node and dentry pages. 23 * This function balances dirty node and dentry pages.
41 * In addition, it controls garbage collection. 24 * In addition, it controls garbage collection.
42 */ 25 */
43void f2fs_balance_fs(struct f2fs_sb_info *sbi) 26void f2fs_balance_fs(struct f2fs_sb_info *sbi)
44{ 27{
45 struct writeback_control wbc = {
46 .sync_mode = WB_SYNC_ALL,
47 .nr_to_write = LONG_MAX,
48 .for_reclaim = 0,
49 };
50
51 if (sbi->por_doing)
52 return;
53
54 /* 28 /*
55 * We should do checkpoint when there are so many dirty node pages 29 * We should do GC or end up with checkpoint, if there are so many dirty
56 * with enough free segments. After then, we should do GC. 30 * dir/node pages without enough free segments.
57 */ 31 */
58 if (need_to_flush(sbi)) {
59 sync_dirty_dir_inodes(sbi);
60 sync_node_pages(sbi, 0, &wbc);
61 }
62
63 if (has_not_enough_free_secs(sbi)) { 32 if (has_not_enough_free_secs(sbi)) {
64 mutex_lock(&sbi->gc_mutex); 33 mutex_lock(&sbi->gc_mutex);
65 f2fs_gc(sbi, 1); 34 f2fs_gc(sbi, 1);
@@ -631,7 +600,6 @@ static void f2fs_end_io_write(struct bio *bio, int err)
631 if (page->mapping) 600 if (page->mapping)
632 set_bit(AS_EIO, &page->mapping->flags); 601 set_bit(AS_EIO, &page->mapping->flags);
633 set_ckpt_flags(p->sbi->ckpt, CP_ERROR_FLAG); 602 set_ckpt_flags(p->sbi->ckpt, CP_ERROR_FLAG);
634 set_page_dirty(page);
635 } 603 }
636 end_page_writeback(page); 604 end_page_writeback(page);
637 dec_page_count(p->sbi, F2FS_WRITEBACK); 605 dec_page_count(p->sbi, F2FS_WRITEBACK);
@@ -791,11 +759,10 @@ static int __get_segment_type(struct page *page, enum page_type p_type)
791 return __get_segment_type_2(page, p_type); 759 return __get_segment_type_2(page, p_type);
792 case 4: 760 case 4:
793 return __get_segment_type_4(page, p_type); 761 return __get_segment_type_4(page, p_type);
794 case 6:
795 return __get_segment_type_6(page, p_type);
796 default:
797 BUG();
798 } 762 }
763 /* NR_CURSEG_TYPE(6) logs by default */
764 BUG_ON(sbi->active_logs != NR_CURSEG_TYPE);
765 return __get_segment_type_6(page, p_type);
799} 766}
800 767
801static void do_write_page(struct f2fs_sb_info *sbi, struct page *page, 768static void do_write_page(struct f2fs_sb_info *sbi, struct page *page,
@@ -1608,7 +1575,6 @@ static int build_dirty_segmap(struct f2fs_sb_info *sbi)
1608 1575
1609 for (i = 0; i < NR_DIRTY_TYPE; i++) { 1576 for (i = 0; i < NR_DIRTY_TYPE; i++) {
1610 dirty_i->dirty_segmap[i] = kzalloc(bitmap_size, GFP_KERNEL); 1577 dirty_i->dirty_segmap[i] = kzalloc(bitmap_size, GFP_KERNEL);
1611 dirty_i->nr_dirty[i] = 0;
1612 if (!dirty_i->dirty_segmap[i]) 1578 if (!dirty_i->dirty_segmap[i])
1613 return -ENOMEM; 1579 return -ENOMEM;
1614 } 1580 }
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 0948405af6f..66a288a52fd 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -459,7 +459,20 @@ static inline int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
459 459
460static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi) 460static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi)
461{ 461{
462 return free_sections(sbi) <= reserved_sections(sbi); 462 unsigned int pages_per_sec = (1 << sbi->log_blocks_per_seg) *
463 sbi->segs_per_sec;
464 int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1)
465 >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
466 int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1)
467 >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
468
469 if (sbi->por_doing)
470 return false;
471
472 if (free_sections(sbi) <= (node_secs + 2 * dent_secs +
473 reserved_sections(sbi)))
474 return true;
475 return false;
463} 476}
464 477
465static inline int utilization(struct f2fs_sb_info *sbi) 478static inline int utilization(struct f2fs_sb_info *sbi)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 13867322cf5..08a94c814bd 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -119,7 +119,6 @@ static void f2fs_put_super(struct super_block *sb)
119int f2fs_sync_fs(struct super_block *sb, int sync) 119int f2fs_sync_fs(struct super_block *sb, int sync)
120{ 120{
121 struct f2fs_sb_info *sbi = F2FS_SB(sb); 121 struct f2fs_sb_info *sbi = F2FS_SB(sb);
122 int ret = 0;
123 122
124 if (!sbi->s_dirty && !get_pages(sbi, F2FS_DIRTY_NODES)) 123 if (!sbi->s_dirty && !get_pages(sbi, F2FS_DIRTY_NODES))
125 return 0; 124 return 0;
@@ -127,7 +126,7 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
127 if (sync) 126 if (sync)
128 write_checkpoint(sbi, false, false); 127 write_checkpoint(sbi, false, false);
129 128
130 return ret; 129 return 0;
131} 130}
132 131
133static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) 132static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -148,8 +147,8 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
148 buf->f_bfree = buf->f_blocks - valid_user_blocks(sbi) - ovp_count; 147 buf->f_bfree = buf->f_blocks - valid_user_blocks(sbi) - ovp_count;
149 buf->f_bavail = user_block_count - valid_user_blocks(sbi); 148 buf->f_bavail = user_block_count - valid_user_blocks(sbi);
150 149
151 buf->f_files = valid_inode_count(sbi); 150 buf->f_files = sbi->total_node_count;
152 buf->f_ffree = sbi->total_node_count - valid_node_count(sbi); 151 buf->f_ffree = sbi->total_node_count - valid_inode_count(sbi);
153 152
154 buf->f_namelen = F2FS_MAX_NAME_LEN; 153 buf->f_namelen = F2FS_MAX_NAME_LEN;
155 buf->f_fsid.val[0] = (u32)id; 154 buf->f_fsid.val[0] = (u32)id;
@@ -302,7 +301,7 @@ static int parse_options(struct f2fs_sb_info *sbi, char *options)
302 case Opt_active_logs: 301 case Opt_active_logs:
303 if (args->from && match_int(args, &arg)) 302 if (args->from && match_int(args, &arg))
304 return -EINVAL; 303 return -EINVAL;
305 if (arg != 2 && arg != 4 && arg != 6) 304 if (arg != 2 && arg != 4 && arg != NR_CURSEG_TYPE)
306 return -EINVAL; 305 return -EINVAL;
307 sbi->active_logs = arg; 306 sbi->active_logs = arg;
308 break; 307 break;
@@ -528,8 +527,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
528 527
529 /* if there are nt orphan nodes free them */ 528 /* if there are nt orphan nodes free them */
530 err = -EINVAL; 529 err = -EINVAL;
531 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) && 530 if (recover_orphan_inodes(sbi))
532 recover_orphan_inodes(sbi))
533 goto free_node_inode; 531 goto free_node_inode;
534 532
535 /* read root inode and dentry */ 533 /* read root inode and dentry */
@@ -548,8 +546,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
548 } 546 }
549 547
550 /* recover fsynced data */ 548 /* recover fsynced data */
551 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) && 549 if (!test_opt(sbi, DISABLE_ROLL_FORWARD))
552 !test_opt(sbi, DISABLE_ROLL_FORWARD))
553 recover_fsync_data(sbi); 550 recover_fsync_data(sbi);
554 551
555 /* After POR, we can run background GC thread */ 552 /* After POR, we can run background GC thread */
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index 7d52e8dc0c5..940136a3d3a 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -208,7 +208,7 @@ int f2fs_getxattr(struct inode *inode, int name_index, const char *name,
208 struct page *page; 208 struct page *page;
209 void *base_addr; 209 void *base_addr;
210 int error = 0, found = 0; 210 int error = 0, found = 0;
211 int value_len, name_len; 211 size_t value_len, name_len;
212 212
213 if (name == NULL) 213 if (name == NULL)
214 return -EINVAL; 214 return -EINVAL;
@@ -304,7 +304,8 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
304 struct f2fs_xattr_entry *here, *last; 304 struct f2fs_xattr_entry *here, *last;
305 struct page *page; 305 struct page *page;
306 void *base_addr; 306 void *base_addr;
307 int error, found, free, name_len, newsize; 307 int error, found, free, newsize;
308 size_t name_len;
308 char *pval; 309 char *pval;
309 310
310 if (name == NULL) 311 if (name == NULL)
diff --git a/fs/file.c b/fs/file.c
index 15cb8618e95..2b3570b7cae 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -490,7 +490,7 @@ void exit_files(struct task_struct *tsk)
490 } 490 }
491} 491}
492 492
493static void __devinit fdtable_defer_list_init(int cpu) 493static void fdtable_defer_list_init(int cpu)
494{ 494{
495 struct fdtable_defer *fddef = &per_cpu(fdtable_defer_list, cpu); 495 struct fdtable_defer *fddef = &per_cpu(fdtable_defer_list, cpu);
496 spin_lock_init(&fddef->lock); 496 spin_lock_init(&fddef->lock);
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 8dad6b09371..b906ed17a83 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -241,6 +241,7 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
241 241
242static void gfs2_reverse_hex(char *c, u64 value) 242static void gfs2_reverse_hex(char *c, u64 value)
243{ 243{
244 *c = '0';
244 while (value) { 245 while (value) {
245 *c-- = hex_asc[value & 0x0f]; 246 *c-- = hex_asc[value & 0x0f];
246 value >>= 4; 247 value >>= 4;
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 37ee061d899..b7eff078fe9 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -350,10 +350,14 @@ static u32 gfs2_free_extlen(const struct gfs2_rbm *rrbm, u32 len)
350 BUG_ON(len < chunk_size); 350 BUG_ON(len < chunk_size);
351 len -= chunk_size; 351 len -= chunk_size;
352 block = gfs2_rbm_to_block(&rbm); 352 block = gfs2_rbm_to_block(&rbm);
353 gfs2_rbm_from_block(&rbm, block + chunk_size); 353 if (gfs2_rbm_from_block(&rbm, block + chunk_size)) {
354 n_unaligned = 3; 354 n_unaligned = 0;
355 if (ptr)
356 break; 355 break;
356 }
357 if (ptr) {
358 n_unaligned = 3;
359 break;
360 }
357 n_unaligned = len & 3; 361 n_unaligned = len & 3;
358 } 362 }
359 363
@@ -557,22 +561,20 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
557 */ 561 */
558int gfs2_rs_alloc(struct gfs2_inode *ip) 562int gfs2_rs_alloc(struct gfs2_inode *ip)
559{ 563{
560 struct gfs2_blkreserv *res; 564 int error = 0;
561 565
566 down_write(&ip->i_rw_mutex);
562 if (ip->i_res) 567 if (ip->i_res)
563 return 0; 568 goto out;
564
565 res = kmem_cache_zalloc(gfs2_rsrv_cachep, GFP_NOFS);
566 if (!res)
567 return -ENOMEM;
568 569
569 RB_CLEAR_NODE(&res->rs_node); 570 ip->i_res = kmem_cache_zalloc(gfs2_rsrv_cachep, GFP_NOFS);
571 if (!ip->i_res) {
572 error = -ENOMEM;
573 goto out;
574 }
570 575
571 down_write(&ip->i_rw_mutex); 576 RB_CLEAR_NODE(&ip->i_res->rs_node);
572 if (ip->i_res) 577out:
573 kmem_cache_free(gfs2_rsrv_cachep, res);
574 else
575 ip->i_res = res;
576 up_write(&ip->i_rw_mutex); 578 up_write(&ip->i_rw_mutex);
577 return 0; 579 return 0;
578} 580}
@@ -1424,6 +1426,9 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
1424 rs->rs_free = extlen; 1426 rs->rs_free = extlen;
1425 rs->rs_inum = ip->i_no_addr; 1427 rs->rs_inum = ip->i_no_addr;
1426 rs_insert(ip); 1428 rs_insert(ip);
1429 } else {
1430 if (goal == rgd->rd_last_alloc + rgd->rd_data0)
1431 rgd->rd_last_alloc = 0;
1427 } 1432 }
1428} 1433}
1429 1434
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index c89b26bc975..264d1aa935f 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -206,7 +206,7 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
206 206
207 list_for_each_entry(lo, &server->layouts, plh_layouts) { 207 list_for_each_entry(lo, &server->layouts, plh_layouts) {
208 ino = igrab(lo->plh_inode); 208 ino = igrab(lo->plh_inode);
209 if (ino) 209 if (!ino)
210 continue; 210 continue;
211 spin_lock(&ino->i_lock); 211 spin_lock(&ino->i_lock);
212 /* Is this layout in the process of being freed? */ 212 /* Is this layout in the process of being freed? */
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 32e6c53520e..1b2d7eb9379 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2153,12 +2153,16 @@ static int nfs_open_permission_mask(int openflags)
2153{ 2153{
2154 int mask = 0; 2154 int mask = 0;
2155 2155
2156 if ((openflags & O_ACCMODE) != O_WRONLY) 2156 if (openflags & __FMODE_EXEC) {
2157 mask |= MAY_READ; 2157 /* ONLY check exec rights */
2158 if ((openflags & O_ACCMODE) != O_RDONLY) 2158 mask = MAY_EXEC;
2159 mask |= MAY_WRITE; 2159 } else {
2160 if (openflags & __FMODE_EXEC) 2160 if ((openflags & O_ACCMODE) != O_WRONLY)
2161 mask |= MAY_EXEC; 2161 mask |= MAY_READ;
2162 if ((openflags & O_ACCMODE) != O_RDONLY)
2163 mask |= MAY_WRITE;
2164 }
2165
2162 return mask; 2166 return mask;
2163} 2167}
2164 2168
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5d864fb3657..cf747ef8665 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1626,7 +1626,8 @@ static int _nfs4_recover_proc_open(struct nfs4_opendata *data)
1626 1626
1627static int nfs4_opendata_access(struct rpc_cred *cred, 1627static int nfs4_opendata_access(struct rpc_cred *cred,
1628 struct nfs4_opendata *opendata, 1628 struct nfs4_opendata *opendata,
1629 struct nfs4_state *state, fmode_t fmode) 1629 struct nfs4_state *state, fmode_t fmode,
1630 int openflags)
1630{ 1631{
1631 struct nfs_access_entry cache; 1632 struct nfs_access_entry cache;
1632 u32 mask; 1633 u32 mask;
@@ -1638,11 +1639,14 @@ static int nfs4_opendata_access(struct rpc_cred *cred,
1638 1639
1639 mask = 0; 1640 mask = 0;
1640 /* don't check MAY_WRITE - a newly created file may not have 1641 /* don't check MAY_WRITE - a newly created file may not have
1641 * write mode bits, but POSIX allows the creating process to write */ 1642 * write mode bits, but POSIX allows the creating process to write.
1642 if (fmode & FMODE_READ) 1643 * use openflags to check for exec, because fmode won't
1643 mask |= MAY_READ; 1644 * always have FMODE_EXEC set when file open for exec. */
1644 if (fmode & FMODE_EXEC) 1645 if (openflags & __FMODE_EXEC) {
1645 mask |= MAY_EXEC; 1646 /* ONLY check for exec rights */
1647 mask = MAY_EXEC;
1648 } else if (fmode & FMODE_READ)
1649 mask = MAY_READ;
1646 1650
1647 cache.cred = cred; 1651 cache.cred = cred;
1648 cache.jiffies = jiffies; 1652 cache.jiffies = jiffies;
@@ -1896,7 +1900,7 @@ static int _nfs4_do_open(struct inode *dir,
1896 if (server->caps & NFS_CAP_POSIX_LOCK) 1900 if (server->caps & NFS_CAP_POSIX_LOCK)
1897 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags); 1901 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
1898 1902
1899 status = nfs4_opendata_access(cred, opendata, state, fmode); 1903 status = nfs4_opendata_access(cred, opendata, state, fmode, flags);
1900 if (status != 0) 1904 if (status != 0)
1901 goto err_opendata_put; 1905 goto err_opendata_put;
1902 1906
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e7165d91536..d00260b0810 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -254,7 +254,7 @@ static void
254pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit) 254pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit)
255{ 255{
256 lo->plh_retry_timestamp = jiffies; 256 lo->plh_retry_timestamp = jiffies;
257 if (test_and_set_bit(fail_bit, &lo->plh_flags)) 257 if (!test_and_set_bit(fail_bit, &lo->plh_flags))
258 atomic_inc(&lo->plh_refcount); 258 atomic_inc(&lo->plh_refcount);
259} 259}
260 260
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index b6bdb18e892..a5e5d9899d5 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -91,12 +91,16 @@ void nfs_readdata_release(struct nfs_read_data *rdata)
91 put_nfs_open_context(rdata->args.context); 91 put_nfs_open_context(rdata->args.context);
92 if (rdata->pages.pagevec != rdata->pages.page_array) 92 if (rdata->pages.pagevec != rdata->pages.page_array)
93 kfree(rdata->pages.pagevec); 93 kfree(rdata->pages.pagevec);
94 if (rdata != &read_header->rpc_data) 94 if (rdata == &read_header->rpc_data) {
95 kfree(rdata);
96 else
97 rdata->header = NULL; 95 rdata->header = NULL;
96 rdata = NULL;
97 }
98 if (atomic_dec_and_test(&hdr->refcnt)) 98 if (atomic_dec_and_test(&hdr->refcnt))
99 hdr->completion_ops->completion(hdr); 99 hdr->completion_ops->completion(hdr);
100 /* Note: we only free the rpc_task after callbacks are done.
101 * See the comment in rpc_free_task() for why
102 */
103 kfree(rdata);
100} 104}
101EXPORT_SYMBOL_GPL(nfs_readdata_release); 105EXPORT_SYMBOL_GPL(nfs_readdata_release);
102 106
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index c25cadf8f8c..2e7e8c878e5 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1152,7 +1152,7 @@ static int nfs_get_option_str(substring_t args[], char **option)
1152{ 1152{
1153 kfree(*option); 1153 kfree(*option);
1154 *option = match_strdup(args); 1154 *option = match_strdup(args);
1155 return !option; 1155 return !*option;
1156} 1156}
1157 1157
1158static int nfs_get_option_ul(substring_t args[], unsigned long *option) 1158static int nfs_get_option_ul(substring_t args[], unsigned long *option)
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index b673be31590..c483cc50b82 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -126,12 +126,16 @@ void nfs_writedata_release(struct nfs_write_data *wdata)
126 put_nfs_open_context(wdata->args.context); 126 put_nfs_open_context(wdata->args.context);
127 if (wdata->pages.pagevec != wdata->pages.page_array) 127 if (wdata->pages.pagevec != wdata->pages.page_array)
128 kfree(wdata->pages.pagevec); 128 kfree(wdata->pages.pagevec);
129 if (wdata != &write_header->rpc_data) 129 if (wdata == &write_header->rpc_data) {
130 kfree(wdata);
131 else
132 wdata->header = NULL; 130 wdata->header = NULL;
131 wdata = NULL;
132 }
133 if (atomic_dec_and_test(&hdr->refcnt)) 133 if (atomic_dec_and_test(&hdr->refcnt))
134 hdr->completion_ops->completion(hdr); 134 hdr->completion_ops->completion(hdr);
135 /* Note: we only free the rpc_task after callbacks are done.
136 * See the comment in rpc_free_task() for why
137 */
138 kfree(wdata);
135} 139}
136EXPORT_SYMBOL_GPL(nfs_writedata_release); 140EXPORT_SYMBOL_GPL(nfs_writedata_release);
137 141
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index f883e7e7430..7003e5266f2 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -291,9 +291,8 @@ static void ramoops_free_przs(struct ramoops_context *cxt)
291 kfree(cxt->przs); 291 kfree(cxt->przs);
292} 292}
293 293
294static int __devinit ramoops_init_przs(struct device *dev, 294static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
295 struct ramoops_context *cxt, 295 phys_addr_t *paddr, size_t dump_mem_sz)
296 phys_addr_t *paddr, size_t dump_mem_sz)
297{ 296{
298 int err = -ENOMEM; 297 int err = -ENOMEM;
299 int i; 298 int i;
@@ -336,10 +335,9 @@ fail_prz:
336 return err; 335 return err;
337} 336}
338 337
339static int __devinit ramoops_init_prz(struct device *dev, 338static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt,
340 struct ramoops_context *cxt, 339 struct persistent_ram_zone **prz,
341 struct persistent_ram_zone **prz, 340 phys_addr_t *paddr, size_t sz, u32 sig)
342 phys_addr_t *paddr, size_t sz, u32 sig)
343{ 341{
344 if (!sz) 342 if (!sz)
345 return 0; 343 return 0;
@@ -367,7 +365,7 @@ static int __devinit ramoops_init_prz(struct device *dev,
367 return 0; 365 return 0;
368} 366}
369 367
370static int __devinit ramoops_probe(struct platform_device *pdev) 368static int ramoops_probe(struct platform_device *pdev)
371{ 369{
372 struct device *dev = &pdev->dev; 370 struct device *dev = &pdev->dev;
373 struct ramoops_platform_data *pdata = pdev->dev.platform_data; 371 struct ramoops_platform_data *pdata = pdev->dev.platform_data;
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index eecd2a8a84d..0306303be37 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -390,8 +390,8 @@ static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
390 return 0; 390 return 0;
391} 391}
392 392
393static int __devinit persistent_ram_post_init(struct persistent_ram_zone *prz, 393static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
394 u32 sig, int ecc_size) 394 int ecc_size)
395{ 395{
396 int ret; 396 int ret;
397 397
@@ -443,9 +443,8 @@ void persistent_ram_free(struct persistent_ram_zone *prz)
443 kfree(prz); 443 kfree(prz);
444} 444}
445 445
446struct persistent_ram_zone * __devinit persistent_ram_new(phys_addr_t start, 446struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
447 size_t size, u32 sig, 447 u32 sig, int ecc_size)
448 int ecc_size)
449{ 448{
450 struct persistent_ram_zone *prz; 449 struct persistent_ram_zone *prz;
451 int ret = -ENOMEM; 450 int ret = -ENOMEM;
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 9d863fb501f..f2bc3dfd0b8 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -296,7 +296,7 @@ EXPORT_SYMBOL(seq_read);
296 * seq_lseek - ->llseek() method for sequential files. 296 * seq_lseek - ->llseek() method for sequential files.
297 * @file: the file in question 297 * @file: the file in question
298 * @offset: new position 298 * @offset: new position
299 * @origin: 0 for absolute, 1 for relative position 299 * @whence: 0 for absolute, 1 for relative position
300 * 300 *
301 * Ready-made ->f_op->llseek() 301 * Ready-made ->f_op->llseek()
302 */ 302 */
diff --git a/fs/splice.c b/fs/splice.c
index 8890604e3fc..6909d89d0da 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -696,8 +696,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
696 return -EINVAL; 696 return -EINVAL;
697 697
698 more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0; 698 more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
699 if (sd->len < sd->total_len) 699
700 if (sd->len < sd->total_len && pipe->nrbufs > 1)
700 more |= MSG_SENDPAGE_NOTLAST; 701 more |= MSG_SENDPAGE_NOTLAST;
702
701 return file->f_op->sendpage(file, buf->page, buf->offset, 703 return file->f_op->sendpage(file, buf->page, buf->offset,
702 sd->len, &pos, more); 704 sd->len, &pos, more);
703} 705}
diff --git a/include/asm-generic/parport.h b/include/asm-generic/parport.h
index 40528cb977e..2c9f9d4336c 100644
--- a/include/asm-generic/parport.h
+++ b/include/asm-generic/parport.h
@@ -10,8 +10,8 @@
10 * to devices on the PCI bus. 10 * to devices on the PCI bus.
11 */ 11 */
12 12
13static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); 13static int parport_pc_find_isa_ports(int autoirq, int autodma);
14static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) 14static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
15{ 15{
16#ifdef CONFIG_ISA 16#ifdef CONFIG_ISA
17 return parport_pc_find_isa_ports(autoirq, autodma); 17 return parport_pc_find_isa_ports(autoirq, autodma);
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index ed6642ad03e..25f01d0bc14 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -78,6 +78,14 @@ struct mmu_gather_batch {
78#define MAX_GATHER_BATCH \ 78#define MAX_GATHER_BATCH \
79 ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) 79 ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *))
80 80
81/*
82 * Limit the maximum number of mmu_gather batches to reduce a risk of soft
83 * lockups for non-preemptible kernels on huge machines when a lot of memory
84 * is zapped during unmapping.
85 * 10K pages freed at once should be safe even without a preemption point.
86 */
87#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH)
88
81/* struct mmu_gather is an opaque type used by the mm code for passing around 89/* struct mmu_gather is an opaque type used by the mm code for passing around
82 * any data needed by arch specific code for tlb_remove_page. 90 * any data needed by arch specific code for tlb_remove_page.
83 */ 91 */
@@ -96,6 +104,7 @@ struct mmu_gather {
96 struct mmu_gather_batch *active; 104 struct mmu_gather_batch *active;
97 struct mmu_gather_batch local; 105 struct mmu_gather_batch local;
98 struct page *__pages[MMU_GATHER_BUNDLE]; 106 struct page *__pages[MMU_GATHER_BUNDLE];
107 unsigned int batch_count;
99}; 108};
100 109
101#define HAVE_GENERIC_MMU_GATHER 110#define HAVE_GENERIC_MMU_GATHER
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 0f4a366f6fa..3527fb3f75b 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -70,7 +70,7 @@ struct drm_mm {
70 unsigned long scan_color; 70 unsigned long scan_color;
71 unsigned long scan_size; 71 unsigned long scan_size;
72 unsigned long scan_hit_start; 72 unsigned long scan_hit_start;
73 unsigned scan_hit_size; 73 unsigned long scan_hit_end;
74 unsigned scanned_blocks; 74 unsigned scanned_blocks;
75 unsigned long scan_start; 75 unsigned long scan_start;
76 unsigned long scan_end; 76 unsigned long scan_end;
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index 808dad29607..d6aeaf3c6d6 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28#ifndef _EXYNOS_DRM_H_ 14#ifndef _EXYNOS_DRM_H_
29#define _EXYNOS_DRM_H_ 15#define _EXYNOS_DRM_H_
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index fe9989636b6..b9fde17f767 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -15,12 +15,12 @@ struct pata_platform_info {
15 unsigned int irq_flags; 15 unsigned int irq_flags;
16}; 16};
17 17
18extern int __devinit __pata_platform_probe(struct device *dev, 18extern int __pata_platform_probe(struct device *dev,
19 struct resource *io_res, 19 struct resource *io_res,
20 struct resource *ctl_res, 20 struct resource *ctl_res,
21 struct resource *irq_res, 21 struct resource *irq_res,
22 unsigned int ioport_shift, 22 unsigned int ioport_shift,
23 int __pio_mask); 23 int __pio_mask);
24 24
25/* 25/*
26 * Marvell SATA private data 26 * Marvell SATA private data
diff --git a/include/linux/audit.h b/include/linux/audit.h
index bce729afbcf..5a6d718adf3 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -24,6 +24,7 @@
24#define _LINUX_AUDIT_H_ 24#define _LINUX_AUDIT_H_
25 25
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/ptrace.h>
27#include <uapi/linux/audit.h> 28#include <uapi/linux/audit.h>
28 29
29struct audit_sig_info { 30struct audit_sig_info {
@@ -157,7 +158,8 @@ void audit_core_dumps(long signr);
157 158
158static inline void audit_seccomp(unsigned long syscall, long signr, int code) 159static inline void audit_seccomp(unsigned long syscall, long signr, int code)
159{ 160{
160 if (unlikely(!audit_dummy_context())) 161 /* Force a record to be reported if a signal was delivered. */
162 if (signr || unlikely(!audit_dummy_context()))
161 __audit_seccomp(syscall, signr, code); 163 __audit_seccomp(syscall, signr, code);
162} 164}
163 165
diff --git a/include/linux/bcma/bcma_driver_gmac_cmn.h b/include/linux/bcma/bcma_driver_gmac_cmn.h
index def894b83b0..4dd1f33e36a 100644
--- a/include/linux/bcma/bcma_driver_gmac_cmn.h
+++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
@@ -92,7 +92,7 @@ struct bcma_drv_gmac_cmn {
92#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val) 92#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
93 93
94#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN 94#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
95extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc); 95extern void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
96#else 96#else
97static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { } 97static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
98#endif 98#endif
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 41da581e161..c48d98d27b7 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -214,7 +214,7 @@ struct bcma_drv_pci {
214#define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) 214#define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val)
215#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 215#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
216 216
217extern void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc); 217extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
218extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 218extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
219 struct bcma_device *core, bool enable); 219 struct bcma_device *core, bool enable);
220extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend); 220extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 6ecb6dc2f30..cc7bddeaf55 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
22extern int fragmentation_index(struct zone *zone, unsigned int order); 22extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist, 23extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask, 24 int order, gfp_t gfp_mask, nodemask_t *mask,
25 bool sync, bool *contended, struct page **page); 25 bool sync, bool *contended);
26extern int compact_pgdat(pg_data_t *pgdat, int order); 26extern int compact_pgdat(pg_data_t *pgdat, int order);
27extern void reset_isolation_suitable(pg_data_t *pgdat); 27extern void reset_isolation_suitable(pg_data_t *pgdat);
28extern unsigned long compaction_suitable(struct zone *zone, int order); 28extern unsigned long compaction_suitable(struct zone *zone, int order);
@@ -75,7 +75,7 @@ static inline bool compaction_restarting(struct zone *zone, int order)
75#else 75#else
76static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, 76static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
77 int order, gfp_t gfp_mask, nodemask_t *nodemask, 77 int order, gfp_t gfp_mask, nodemask_t *nodemask,
78 bool sync, bool *contended, struct page **page) 78 bool sync, bool *contended)
79{ 79{
80 return COMPACT_CONTINUE; 80 return COMPACT_CONTINUE;
81} 81}
diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h
index ac3bbb5b950..1739510d899 100644
--- a/include/linux/cpu_rmap.h
+++ b/include/linux/cpu_rmap.h
@@ -13,9 +13,11 @@
13#include <linux/cpumask.h> 13#include <linux/cpumask.h>
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/kref.h>
16 17
17/** 18/**
18 * struct cpu_rmap - CPU affinity reverse-map 19 * struct cpu_rmap - CPU affinity reverse-map
20 * @refcount: kref for object
19 * @size: Number of objects to be reverse-mapped 21 * @size: Number of objects to be reverse-mapped
20 * @used: Number of objects added 22 * @used: Number of objects added
21 * @obj: Pointer to array of object pointers 23 * @obj: Pointer to array of object pointers
@@ -23,6 +25,7 @@
23 * based on affinity masks 25 * based on affinity masks
24 */ 26 */
25struct cpu_rmap { 27struct cpu_rmap {
28 struct kref refcount;
26 u16 size, used; 29 u16 size, used;
27 void **obj; 30 void **obj;
28 struct { 31 struct {
@@ -33,15 +36,7 @@ struct cpu_rmap {
33#define CPU_RMAP_DIST_INF 0xffff 36#define CPU_RMAP_DIST_INF 0xffff
34 37
35extern struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags); 38extern struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags);
36 39extern int cpu_rmap_put(struct cpu_rmap *rmap);
37/**
38 * free_cpu_rmap - free CPU affinity reverse-map
39 * @rmap: Reverse-map allocated with alloc_cpu_rmap(), or %NULL
40 */
41static inline void free_cpu_rmap(struct cpu_rmap *rmap)
42{
43 kfree(rmap);
44}
45 40
46extern int cpu_rmap_add(struct cpu_rmap *rmap, void *obj); 41extern int cpu_rmap_add(struct cpu_rmap *rmap, void *obj);
47extern int cpu_rmap_update(struct cpu_rmap *rmap, u16 index, 42extern int cpu_rmap_update(struct cpu_rmap *rmap, u16 index,
diff --git a/include/linux/cred.h b/include/linux/cred.h
index abb2cd50f6b..04421e82536 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -128,7 +128,6 @@ struct cred {
128 struct key *process_keyring; /* keyring private to this process */ 128 struct key *process_keyring; /* keyring private to this process */
129 struct key *thread_keyring; /* keyring private to this thread */ 129 struct key *thread_keyring; /* keyring private to this thread */
130 struct key *request_key_auth; /* assumed request_key authority */ 130 struct key *request_key_auth; /* assumed request_key authority */
131 struct thread_group_cred *tgcred; /* thread-group shared credentials */
132#endif 131#endif
133#ifdef CONFIG_SECURITY 132#ifdef CONFIG_SECURITY
134 void *security; /* subjective LSM security */ 133 void *security; /* subjective LSM security */
diff --git a/include/linux/init.h b/include/linux/init.h
index a799273714a..10ed4f43645 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,14 +93,6 @@
93 93
94#define __exit __section(.exit.text) __exitused __cold notrace 94#define __exit __section(.exit.text) __exitused __cold notrace
95 95
96/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
97#define __devinit
98#define __devinitdata
99#define __devinitconst
100#define __devexit
101#define __devexitdata
102#define __devexitconst
103
104/* Used for HOTPLUG_CPU */ 96/* Used for HOTPLUG_CPU */
105#define __cpuinit __section(.cpuinit.text) __cold notrace 97#define __cpuinit __section(.cpuinit.text) __cold notrace
106#define __cpuinitdata __section(.cpuinit.data) 98#define __cpuinitdata __section(.cpuinit.data)
@@ -337,18 +329,6 @@ void __init parse_early_options(char *cmdline);
337#define __INITRODATA_OR_MODULE __INITRODATA 329#define __INITRODATA_OR_MODULE __INITRODATA
338#endif /*CONFIG_MODULES*/ 330#endif /*CONFIG_MODULES*/
339 331
340/* Functions marked as __devexit may be discarded at kernel link time, depending
341 on config options. Newer versions of binutils detect references from
342 retained sections to discarded sections and flag an error. Pointers to
343 __devexit functions must use __devexit_p(function_name), the wrapper will
344 insert either the function_name or NULL, depending on the config options.
345 */
346#if defined(MODULE) || defined(CONFIG_HOTPLUG)
347#define __devexit_p(x) x
348#else
349#define __devexit_p(x) NULL
350#endif
351
352#ifdef MODULE 332#ifdef MODULE
353#define __exit_p(x) x 333#define __exit_p(x) x
354#else 334#else
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5e4e6170f43..5fa5afeeb75 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -268,11 +268,6 @@ struct irq_affinity_notify {
268extern int 268extern int
269irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); 269irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
270 270
271static inline void irq_run_affinity_notifiers(void)
272{
273 flush_scheduled_work();
274}
275
276#else /* CONFIG_SMP */ 271#else /* CONFIG_SMP */
277 272
278static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 273static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index fe771978e87..ae221a7b509 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -24,6 +24,7 @@ struct ipc_ids {
24 unsigned short seq_max; 24 unsigned short seq_max;
25 struct rw_semaphore rw_mutex; 25 struct rw_semaphore rw_mutex;
26 struct idr ipcs_idr; 26 struct idr ipcs_idr;
27 int next_id;
27}; 28};
28 29
29struct ipc_namespace { 30struct ipc_namespace {
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 00e46376e28..2bca44b0893 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -524,14 +524,17 @@ static inline void print_irqtrace_events(struct task_struct *curr)
524#ifdef CONFIG_DEBUG_LOCK_ALLOC 524#ifdef CONFIG_DEBUG_LOCK_ALLOC
525# ifdef CONFIG_PROVE_LOCKING 525# ifdef CONFIG_PROVE_LOCKING
526# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 526# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
527# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
527# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i) 528# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i)
528# else 529# else
529# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) 530# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
531# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
530# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i) 532# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i)
531# endif 533# endif
532# define rwsem_release(l, n, i) lock_release(l, n, i) 534# define rwsem_release(l, n, i) lock_release(l, n, i)
533#else 535#else
534# define rwsem_acquire(l, s, t, i) do { } while (0) 536# define rwsem_acquire(l, s, t, i) do { } while (0)
537# define rwsem_acquire_nest(l, s, t, n, i) do { } while (0)
535# define rwsem_acquire_read(l, s, t, i) do { } while (0) 538# define rwsem_acquire_read(l, s, t, i) do { } while (0)
536# define rwsem_release(l, n, i) do { } while (0) 539# define rwsem_release(l, n, i) do { } while (0)
537#endif 540#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 63204078f72..66e2f7c61e5 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -455,7 +455,6 @@ void put_pages_list(struct list_head *pages);
455 455
456void split_page(struct page *page, unsigned int order); 456void split_page(struct page *page, unsigned int order);
457int split_free_page(struct page *page); 457int split_free_page(struct page *page);
458int capture_free_page(struct page *page, int alloc_order, int migratetype);
459 458
460/* 459/*
461 * Compound pages have a destructor function. Provide a 460 * Compound pages have a destructor function. Provide a
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 4bec5be82ca..73b64a38b98 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -503,14 +503,6 @@ struct zone {
503 * rarely used fields: 503 * rarely used fields:
504 */ 504 */
505 const char *name; 505 const char *name;
506#ifdef CONFIG_MEMORY_ISOLATION
507 /*
508 * the number of MIGRATE_ISOLATE *pageblock*.
509 * We need this for free page counting. Look at zone_watermark_ok_safe.
510 * It's protected by zone->lock
511 */
512 int nr_pageblock_isolate;
513#endif
514} ____cacheline_internodealigned_in_smp; 506} ____cacheline_internodealigned_in_smp;
515 507
516typedef enum { 508typedef enum {
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 7a4b9e97d29..391af8d11cc 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -34,7 +34,9 @@ struct msg_queue {
34/* Helper routines for sys_msgsnd and sys_msgrcv */ 34/* Helper routines for sys_msgsnd and sys_msgrcv */
35extern long do_msgsnd(int msqid, long mtype, void __user *mtext, 35extern long do_msgsnd(int msqid, long mtype, void __user *mtext,
36 size_t msgsz, int msgflg); 36 size_t msgsz, int msgflg);
37extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext, 37extern long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
38 size_t msgsz, long msgtyp, int msgflg); 38 int msgflg,
39 long (*msg_fill)(void __user *, struct msg_msg *,
40 size_t));
39 41
40#endif /* _LINUX_MSG_H */ 42#endif /* _LINUX_MSG_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index e998c030061..5a5ff57ceed 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -2,6 +2,7 @@
2#define _LINUX_NAMEI_H 2#define _LINUX_NAMEI_H
3 3
4#include <linux/dcache.h> 4#include <linux/dcache.h>
5#include <linux/errno.h>
5#include <linux/linkage.h> 6#include <linux/linkage.h>
6#include <linux/path.h> 7#include <linux/path.h>
7 8
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c599e4782d4..9ef07d0868b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -60,6 +60,9 @@ struct wireless_dev;
60#define SET_ETHTOOL_OPS(netdev,ops) \ 60#define SET_ETHTOOL_OPS(netdev,ops) \
61 ( (netdev)->ethtool_ops = (ops) ) 61 ( (netdev)->ethtool_ops = (ops) )
62 62
63extern void netdev_set_default_ethtool_ops(struct net_device *dev,
64 const struct ethtool_ops *ops);
65
63/* hardware address assignment types */ 66/* hardware address assignment types */
64#define NET_ADDR_PERM 0 /* address is permanent (default) */ 67#define NET_ADDR_PERM 0 /* address is permanent (default) */
65#define NET_ADDR_RANDOM 1 /* address is generated randomly */ 68#define NET_ADDR_RANDOM 1 /* address is generated randomly */
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index 098d2a83829..cb6ab5feab6 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -46,9 +46,8 @@ struct persistent_ram_zone {
46 size_t old_log_size; 46 size_t old_log_size;
47}; 47};
48 48
49struct persistent_ram_zone * __devinit persistent_ram_new(phys_addr_t start, 49struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
50 size_t size, u32 sig, 50 u32 sig, int ecc_size);
51 int ecc_size);
52void persistent_ram_free(struct persistent_ram_zone *prz); 51void persistent_ram_free(struct persistent_ram_zone *prz);
53void persistent_ram_zap(struct persistent_ram_zone *prz); 52void persistent_ram_zap(struct persistent_ram_zone *prz);
54 53
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
index 2ac60c9cf64..fea49b5da12 100644
--- a/include/linux/rbtree_augmented.h
+++ b/include/linux/rbtree_augmented.h
@@ -123,9 +123,9 @@ __rb_change_child(struct rb_node *old, struct rb_node *new,
123extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root, 123extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root,
124 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)); 124 void (*augment_rotate)(struct rb_node *old, struct rb_node *new));
125 125
126static __always_inline void 126static __always_inline struct rb_node *
127rb_erase_augmented(struct rb_node *node, struct rb_root *root, 127__rb_erase_augmented(struct rb_node *node, struct rb_root *root,
128 const struct rb_augment_callbacks *augment) 128 const struct rb_augment_callbacks *augment)
129{ 129{
130 struct rb_node *child = node->rb_right, *tmp = node->rb_left; 130 struct rb_node *child = node->rb_right, *tmp = node->rb_left;
131 struct rb_node *parent, *rebalance; 131 struct rb_node *parent, *rebalance;
@@ -217,6 +217,14 @@ rb_erase_augmented(struct rb_node *node, struct rb_root *root,
217 } 217 }
218 218
219 augment->propagate(tmp, NULL); 219 augment->propagate(tmp, NULL);
220 return rebalance;
221}
222
223static __always_inline void
224rb_erase_augmented(struct rb_node *node, struct rb_root *root,
225 const struct rb_augment_callbacks *augment)
226{
227 struct rb_node *rebalance = __rb_erase_augmented(node, root, augment);
220 if (rebalance) 228 if (rebalance)
221 __rb_erase_color(rebalance, root, augment->rotate); 229 __rb_erase_color(rebalance, root, augment->rotate);
222} 230}
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 54bd7cd7ecb..413cc11e414 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -125,8 +125,17 @@ extern void downgrade_write(struct rw_semaphore *sem);
125 */ 125 */
126extern void down_read_nested(struct rw_semaphore *sem, int subclass); 126extern void down_read_nested(struct rw_semaphore *sem, int subclass);
127extern void down_write_nested(struct rw_semaphore *sem, int subclass); 127extern void down_write_nested(struct rw_semaphore *sem, int subclass);
128extern void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest_lock);
129
130# define down_write_nest_lock(sem, nest_lock) \
131do { \
132 typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \
133 _down_write_nest_lock(sem, &(nest_lock)->dep_map); \
134} while (0);
135
128#else 136#else
129# define down_read_nested(sem, subclass) down_read(sem) 137# define down_read_nested(sem, subclass) down_read(sem)
138# define down_write_nest_lock(sem, nest_lock) down_read(sem)
130# define down_write_nested(sem, subclass) down_write(sem) 139# define down_write_nested(sem, subclass) down_write(sem)
131#endif 140#endif
132 141
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index a1d83cc8bf8..923cb20051e 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -71,6 +71,7 @@ struct netns_ct {
71 struct hlist_head *expect_hash; 71 struct hlist_head *expect_hash;
72 struct hlist_nulls_head unconfirmed; 72 struct hlist_nulls_head unconfirmed;
73 struct hlist_nulls_head dying; 73 struct hlist_nulls_head dying;
74 struct hlist_nulls_head tmpl;
74 struct ip_conntrack_stat __percpu *stat; 75 struct ip_conntrack_stat __percpu *stat;
75 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 76 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
76 struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 77 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h
index 591db7d657a..c24060ee411 100644
--- a/include/net/netns/x_tables.h
+++ b/include/net/netns/x_tables.h
@@ -8,6 +8,7 @@ struct ebt_table;
8 8
9struct netns_xt { 9struct netns_xt {
10 struct list_head tables[NFPROTO_NUMPROTO]; 10 struct list_head tables[NFPROTO_NUMPROTO];
11 bool notrack_deprecated_warning;
11#if defined(CONFIG_BRIDGE_NF_EBTABLES) || \ 12#if defined(CONFIG_BRIDGE_NF_EBTABLES) || \
12 defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE) 13 defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE)
13 struct ebt_table *broute_table; 14 struct ebt_table *broute_table;
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
index 6d9e15ed1dc..dd8c48d14ed 100644
--- a/include/sound/cs4271.h
+++ b/include/sound/cs4271.h
@@ -19,7 +19,7 @@
19 19
20struct cs4271_platform_data { 20struct cs4271_platform_data {
21 int gpio_nreset; /* GPIO driving Reset pin, if any */ 21 int gpio_nreset; /* GPIO driving Reset pin, if any */
22 int amutec_eq_bmutec:1; /* flag to enable AMUTEC=BMUTEC */ 22 bool amutec_eq_bmutec; /* flag to enable AMUTEC=BMUTEC */
23}; 23};
24 24
25#endif /* __CS4271_H */ 25#endif /* __CS4271_H */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 769e27c774a..bc56738cb10 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -58,8 +58,9 @@
58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ 58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \
59 .put = snd_soc_put_volsw_range, \ 59 .put = snd_soc_put_volsw_range, \
60 .private_value = (unsigned long)&(struct soc_mixer_control) \ 60 .private_value = (unsigned long)&(struct soc_mixer_control) \
61 {.reg = xreg, .shift = xshift, .min = xmin,\ 61 {.reg = xreg, .rreg = xreg, .shift = xshift, \
62 .max = xmax, .platform_max = xmax, .invert = xinvert} } 62 .rshift = xshift, .min = xmin, .max = xmax, \
63 .platform_max = xmax, .invert = xinvert} }
63#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 64#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
64{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 65{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
65 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 66 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -88,8 +89,9 @@
88 .info = snd_soc_info_volsw_range, \ 89 .info = snd_soc_info_volsw_range, \
89 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ 90 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
90 .private_value = (unsigned long)&(struct soc_mixer_control) \ 91 .private_value = (unsigned long)&(struct soc_mixer_control) \
91 {.reg = xreg, .shift = xshift, .min = xmin,\ 92 {.reg = xreg, .rreg = xreg, .shift = xshift, \
92 .max = xmax, .platform_max = xmax, .invert = xinvert} } 93 .rshift = xshift, .min = xmin, .max = xmax, \
94 .platform_max = xmax, .invert = xinvert} }
93#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ 95#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
94{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 96{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
95 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 97 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index e7f52c33400..d5844122ff3 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _UAPI_EXYNOS_DRM_H_ 15#ifndef _UAPI_EXYNOS_DRM_H_
@@ -185,6 +171,8 @@ enum drm_exynos_flip {
185 EXYNOS_DRM_FLIP_NONE = (0 << 0), 171 EXYNOS_DRM_FLIP_NONE = (0 << 0),
186 EXYNOS_DRM_FLIP_VERTICAL = (1 << 0), 172 EXYNOS_DRM_FLIP_VERTICAL = (1 << 0),
187 EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1), 173 EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1),
174 EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL |
175 EXYNOS_DRM_FLIP_HORIZONTAL,
188}; 176};
189 177
190enum drm_exynos_degree { 178enum drm_exynos_degree {
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 76352ac45f2..9f096f1c090 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/elf-em.h> 28#include <linux/elf-em.h>
29#include <linux/ptrace.h>
30 29
31/* The netlink messages for the audit system is divided into blocks: 30/* The netlink messages for the audit system is divided into blocks:
32 * 1000 - 1099 are for commanding the audit system 31 * 1000 - 1099 are for commanding the audit system
@@ -106,6 +105,7 @@
106#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */ 105#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
107#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */ 106#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */
108#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */ 107#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */
108#define AUDIT_SECCOMP 1326 /* Secure Computing event */
109 109
110#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 110#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
111#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 111#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h
index 78dbd2f996a..22d95c6854e 100644
--- a/include/uapi/linux/msg.h
+++ b/include/uapi/linux/msg.h
@@ -10,6 +10,7 @@
10/* msgrcv options */ 10/* msgrcv options */
11#define MSG_NOERROR 010000 /* no error if message is too big */ 11#define MSG_NOERROR 010000 /* no error if message is too big */
12#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/ 12#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
13#define MSG_COPY 040000 /* copy (not remove) all queue messages */
13 14
14/* Obsolete, used only for backwards compatibility and libc5 compiles */ 15/* Obsolete, used only for backwards compatibility and libc5 compiles */
15struct msqid_ds { 16struct msqid_ds {
diff --git a/ipc/compat.c b/ipc/compat.c
index ad9518eb26e..2547f29dcd1 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -306,6 +306,20 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
306 return err; 306 return err;
307} 307}
308 308
309long compat_do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz)
310{
311 struct compat_msgbuf __user *msgp = dest;
312 size_t msgsz;
313
314 if (put_user(msg->m_type, &msgp->mtype))
315 return -EFAULT;
316
317 msgsz = (bufsz > msg->m_ts) ? msg->m_ts : bufsz;
318 if (store_msg(msgp->mtext, msg, msgsz))
319 return -EFAULT;
320 return msgsz;
321}
322
309#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC 323#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
310long compat_sys_semctl(int first, int second, int third, void __user *uptr) 324long compat_sys_semctl(int first, int second, int third, void __user *uptr)
311{ 325{
@@ -337,10 +351,6 @@ long compat_sys_msgsnd(int first, int second, int third, void __user *uptr)
337long compat_sys_msgrcv(int first, int second, int msgtyp, int third, 351long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
338 int version, void __user *uptr) 352 int version, void __user *uptr)
339{ 353{
340 struct compat_msgbuf __user *up;
341 long type;
342 int err;
343
344 if (first < 0) 354 if (first < 0)
345 return -EINVAL; 355 return -EINVAL;
346 if (second < 0) 356 if (second < 0)
@@ -348,23 +358,15 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
348 358
349 if (!version) { 359 if (!version) {
350 struct compat_ipc_kludge ipck; 360 struct compat_ipc_kludge ipck;
351 err = -EINVAL;
352 if (!uptr) 361 if (!uptr)
353 goto out; 362 return -EINVAL;
354 err = -EFAULT;
355 if (copy_from_user (&ipck, uptr, sizeof(ipck))) 363 if (copy_from_user (&ipck, uptr, sizeof(ipck)))
356 goto out; 364 return -EFAULT;
357 uptr = compat_ptr(ipck.msgp); 365 uptr = compat_ptr(ipck.msgp);
358 msgtyp = ipck.msgtyp; 366 msgtyp = ipck.msgtyp;
359 } 367 }
360 up = uptr; 368 return do_msgrcv(first, uptr, second, msgtyp, third,
361 err = do_msgrcv(first, &type, up->mtext, second, msgtyp, third); 369 compat_do_msg_fill);
362 if (err < 0)
363 goto out;
364 if (put_user(type, &up->mtype))
365 err = -EFAULT;
366out:
367 return err;
368} 370}
369#else 371#else
370long compat_sys_semctl(int semid, int semnum, int cmd, int arg) 372long compat_sys_semctl(int semid, int semnum, int cmd, int arg)
@@ -385,16 +387,8 @@ long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
385long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp, 387long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
386 compat_ssize_t msgsz, long msgtyp, int msgflg) 388 compat_ssize_t msgsz, long msgtyp, int msgflg)
387{ 389{
388 long err, mtype; 390 return do_msgrcv(msqid, msgp, (ssize_t)msgsz, msgtyp, msgflg,
389 391 compat_do_msg_fill);
390 err = do_msgrcv(msqid, &mtype, msgp->mtext, (ssize_t)msgsz, msgtyp, msgflg);
391 if (err < 0)
392 goto out;
393
394 if (put_user(mtype, &msgp->mtype))
395 err = -EFAULT;
396 out:
397 return err;
398} 392}
399#endif 393#endif
400 394
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 00fba2bab87..130dfece27a 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -158,6 +158,9 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
158 158
159static int zero; 159static int zero;
160static int one = 1; 160static int one = 1;
161#ifdef CONFIG_CHECKPOINT_RESTORE
162static int int_max = INT_MAX;
163#endif
161 164
162static struct ctl_table ipc_kern_table[] = { 165static struct ctl_table ipc_kern_table[] = {
163 { 166 {
@@ -227,6 +230,35 @@ static struct ctl_table ipc_kern_table[] = {
227 .extra1 = &zero, 230 .extra1 = &zero,
228 .extra2 = &one, 231 .extra2 = &one,
229 }, 232 },
233#ifdef CONFIG_CHECKPOINT_RESTORE
234 {
235 .procname = "sem_next_id",
236 .data = &init_ipc_ns.ids[IPC_SEM_IDS].next_id,
237 .maxlen = sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id),
238 .mode = 0644,
239 .proc_handler = proc_ipc_dointvec_minmax,
240 .extra1 = &zero,
241 .extra2 = &int_max,
242 },
243 {
244 .procname = "msg_next_id",
245 .data = &init_ipc_ns.ids[IPC_MSG_IDS].next_id,
246 .maxlen = sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id),
247 .mode = 0644,
248 .proc_handler = proc_ipc_dointvec_minmax,
249 .extra1 = &zero,
250 .extra2 = &int_max,
251 },
252 {
253 .procname = "shm_next_id",
254 .data = &init_ipc_ns.ids[IPC_SHM_IDS].next_id,
255 .maxlen = sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id),
256 .mode = 0644,
257 .proc_handler = proc_ipc_dointvec_minmax,
258 .extra1 = &zero,
259 .extra2 = &int_max,
260 },
261#endif
230 {} 262 {}
231}; 263};
232 264
diff --git a/ipc/msg.c b/ipc/msg.c
index a71af5a65ab..950572f9d79 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -755,26 +755,91 @@ static inline int convert_mode(long *msgtyp, int msgflg)
755 return SEARCH_EQUAL; 755 return SEARCH_EQUAL;
756} 756}
757 757
758long do_msgrcv(int msqid, long *pmtype, void __user *mtext, 758static long do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz)
759 size_t msgsz, long msgtyp, int msgflg) 759{
760 struct msgbuf __user *msgp = dest;
761 size_t msgsz;
762
763 if (put_user(msg->m_type, &msgp->mtype))
764 return -EFAULT;
765
766 msgsz = (bufsz > msg->m_ts) ? msg->m_ts : bufsz;
767 if (store_msg(msgp->mtext, msg, msgsz))
768 return -EFAULT;
769 return msgsz;
770}
771
772#ifdef CONFIG_CHECKPOINT_RESTORE
773/*
774 * This function creates new kernel message structure, large enough to store
775 * bufsz message bytes.
776 */
777static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
778 int msgflg, long *msgtyp,
779 unsigned long *copy_number)
780{
781 struct msg_msg *copy;
782
783 *copy_number = *msgtyp;
784 *msgtyp = 0;
785 /*
786 * Create dummy message to copy real message to.
787 */
788 copy = load_msg(buf, bufsz);
789 if (!IS_ERR(copy))
790 copy->m_ts = bufsz;
791 return copy;
792}
793
794static inline void free_copy(struct msg_msg *copy)
795{
796 if (copy)
797 free_msg(copy);
798}
799#else
800static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
801 int msgflg, long *msgtyp,
802 unsigned long *copy_number)
803{
804 return ERR_PTR(-ENOSYS);
805}
806
807static inline void free_copy(struct msg_msg *copy)
808{
809}
810#endif
811
812long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
813 int msgflg,
814 long (*msg_handler)(void __user *, struct msg_msg *, size_t))
760{ 815{
761 struct msg_queue *msq; 816 struct msg_queue *msq;
762 struct msg_msg *msg; 817 struct msg_msg *msg;
763 int mode; 818 int mode;
764 struct ipc_namespace *ns; 819 struct ipc_namespace *ns;
820 struct msg_msg *copy = NULL;
821 unsigned long copy_number = 0;
765 822
766 if (msqid < 0 || (long) msgsz < 0) 823 if (msqid < 0 || (long) bufsz < 0)
767 return -EINVAL; 824 return -EINVAL;
825 if (msgflg & MSG_COPY) {
826 copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, &copy_number);
827 if (IS_ERR(copy))
828 return PTR_ERR(copy);
829 }
768 mode = convert_mode(&msgtyp, msgflg); 830 mode = convert_mode(&msgtyp, msgflg);
769 ns = current->nsproxy->ipc_ns; 831 ns = current->nsproxy->ipc_ns;
770 832
771 msq = msg_lock_check(ns, msqid); 833 msq = msg_lock_check(ns, msqid);
772 if (IS_ERR(msq)) 834 if (IS_ERR(msq)) {
835 free_copy(copy);
773 return PTR_ERR(msq); 836 return PTR_ERR(msq);
837 }
774 838
775 for (;;) { 839 for (;;) {
776 struct msg_receiver msr_d; 840 struct msg_receiver msr_d;
777 struct list_head *tmp; 841 struct list_head *tmp;
842 long msg_counter = 0;
778 843
779 msg = ERR_PTR(-EACCES); 844 msg = ERR_PTR(-EACCES);
780 if (ipcperms(ns, &msq->q_perm, S_IRUGO)) 845 if (ipcperms(ns, &msq->q_perm, S_IRUGO))
@@ -793,12 +858,21 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
793 msg = walk_msg; 858 msg = walk_msg;
794 if (mode == SEARCH_LESSEQUAL && 859 if (mode == SEARCH_LESSEQUAL &&
795 walk_msg->m_type != 1) { 860 walk_msg->m_type != 1) {
796 msg = walk_msg;
797 msgtyp = walk_msg->m_type - 1; 861 msgtyp = walk_msg->m_type - 1;
798 } else { 862 } else if (msgflg & MSG_COPY) {
799 msg = walk_msg; 863 if (copy_number == msg_counter) {
864 /*
865 * Found requested message.
866 * Copy it.
867 */
868 msg = copy_msg(msg, copy);
869 if (IS_ERR(msg))
870 goto out_unlock;
871 break;
872 }
873 } else
800 break; 874 break;
801 } 875 msg_counter++;
802 } 876 }
803 tmp = tmp->next; 877 tmp = tmp->next;
804 } 878 }
@@ -807,10 +881,16 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
807 * Found a suitable message. 881 * Found a suitable message.
808 * Unlink it from the queue. 882 * Unlink it from the queue.
809 */ 883 */
810 if ((msgsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) { 884 if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
811 msg = ERR_PTR(-E2BIG); 885 msg = ERR_PTR(-E2BIG);
812 goto out_unlock; 886 goto out_unlock;
813 } 887 }
888 /*
889 * If we are copying, then do not unlink message and do
890 * not update queue parameters.
891 */
892 if (msgflg & MSG_COPY)
893 goto out_unlock;
814 list_del(&msg->m_list); 894 list_del(&msg->m_list);
815 msq->q_qnum--; 895 msq->q_qnum--;
816 msq->q_rtime = get_seconds(); 896 msq->q_rtime = get_seconds();
@@ -834,7 +914,7 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
834 if (msgflg & MSG_NOERROR) 914 if (msgflg & MSG_NOERROR)
835 msr_d.r_maxsize = INT_MAX; 915 msr_d.r_maxsize = INT_MAX;
836 else 916 else
837 msr_d.r_maxsize = msgsz; 917 msr_d.r_maxsize = bufsz;
838 msr_d.r_msg = ERR_PTR(-EAGAIN); 918 msr_d.r_msg = ERR_PTR(-EAGAIN);
839 current->state = TASK_INTERRUPTIBLE; 919 current->state = TASK_INTERRUPTIBLE;
840 msg_unlock(msq); 920 msg_unlock(msq);
@@ -894,32 +974,21 @@ out_unlock:
894 break; 974 break;
895 } 975 }
896 } 976 }
897 if (IS_ERR(msg)) 977 if (IS_ERR(msg)) {
978 free_copy(copy);
898 return PTR_ERR(msg); 979 return PTR_ERR(msg);
980 }
899 981
900 msgsz = (msgsz > msg->m_ts) ? msg->m_ts : msgsz; 982 bufsz = msg_handler(buf, msg, bufsz);
901 *pmtype = msg->m_type;
902 if (store_msg(mtext, msg, msgsz))
903 msgsz = -EFAULT;
904
905 free_msg(msg); 983 free_msg(msg);
906 984
907 return msgsz; 985 return bufsz;
908} 986}
909 987
910SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, 988SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz,
911 long, msgtyp, int, msgflg) 989 long, msgtyp, int, msgflg)
912{ 990{
913 long err, mtype; 991 return do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg, do_msg_fill);
914
915 err = do_msgrcv(msqid, &mtype, msgp->mtext, msgsz, msgtyp, msgflg);
916 if (err < 0)
917 goto out;
918
919 if (put_user(mtype, &msgp->mtype))
920 err = -EFAULT;
921out:
922 return err;
923} 992}
924 993
925#ifdef CONFIG_PROC_FS 994#ifdef CONFIG_PROC_FS
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index 6471f1bdae9..ebfcbfa8b7f 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -102,7 +102,50 @@ out_err:
102 free_msg(msg); 102 free_msg(msg);
103 return ERR_PTR(err); 103 return ERR_PTR(err);
104} 104}
105#ifdef CONFIG_CHECKPOINT_RESTORE
106struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst)
107{
108 struct msg_msgseg *dst_pseg, *src_pseg;
109 int len = src->m_ts;
110 int alen;
111
112 BUG_ON(dst == NULL);
113 if (src->m_ts > dst->m_ts)
114 return ERR_PTR(-EINVAL);
105 115
116 alen = len;
117 if (alen > DATALEN_MSG)
118 alen = DATALEN_MSG;
119
120 dst->next = NULL;
121 dst->security = NULL;
122
123 memcpy(dst + 1, src + 1, alen);
124
125 len -= alen;
126 dst_pseg = dst->next;
127 src_pseg = src->next;
128 while (len > 0) {
129 alen = len;
130 if (alen > DATALEN_SEG)
131 alen = DATALEN_SEG;
132 memcpy(dst_pseg + 1, src_pseg + 1, alen);
133 dst_pseg = dst_pseg->next;
134 len -= alen;
135 src_pseg = src_pseg->next;
136 }
137
138 dst->m_type = src->m_type;
139 dst->m_ts = src->m_ts;
140
141 return dst;
142}
143#else
144struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst)
145{
146 return ERR_PTR(-ENOSYS);
147}
148#endif
106int store_msg(void __user *dest, struct msg_msg *msg, int len) 149int store_msg(void __user *dest, struct msg_msg *msg, int len)
107{ 150{
108 int alen; 151 int alen;
diff --git a/ipc/util.c b/ipc/util.c
index 72fd0785ac9..74e1d9c7a98 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -122,6 +122,7 @@ void ipc_init_ids(struct ipc_ids *ids)
122 122
123 ids->in_use = 0; 123 ids->in_use = 0;
124 ids->seq = 0; 124 ids->seq = 0;
125 ids->next_id = -1;
125 { 126 {
126 int seq_limit = INT_MAX/SEQ_MULTIPLIER; 127 int seq_limit = INT_MAX/SEQ_MULTIPLIER;
127 if (seq_limit > USHRT_MAX) 128 if (seq_limit > USHRT_MAX)
@@ -252,6 +253,7 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
252 kuid_t euid; 253 kuid_t euid;
253 kgid_t egid; 254 kgid_t egid;
254 int id, err; 255 int id, err;
256 int next_id = ids->next_id;
255 257
256 if (size > IPCMNI) 258 if (size > IPCMNI)
257 size = IPCMNI; 259 size = IPCMNI;
@@ -264,7 +266,8 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
264 rcu_read_lock(); 266 rcu_read_lock();
265 spin_lock(&new->lock); 267 spin_lock(&new->lock);
266 268
267 err = idr_get_new(&ids->ipcs_idr, new, &id); 269 err = idr_get_new_above(&ids->ipcs_idr, new,
270 (next_id < 0) ? 0 : ipcid_to_idx(next_id), &id);
268 if (err) { 271 if (err) {
269 spin_unlock(&new->lock); 272 spin_unlock(&new->lock);
270 rcu_read_unlock(); 273 rcu_read_unlock();
@@ -277,9 +280,14 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
277 new->cuid = new->uid = euid; 280 new->cuid = new->uid = euid;
278 new->gid = new->cgid = egid; 281 new->gid = new->cgid = egid;
279 282
280 new->seq = ids->seq++; 283 if (next_id < 0) {
281 if(ids->seq > ids->seq_max) 284 new->seq = ids->seq++;
282 ids->seq = 0; 285 if (ids->seq > ids->seq_max)
286 ids->seq = 0;
287 } else {
288 new->seq = ipcid_to_seqx(next_id);
289 ids->next_id = -1;
290 }
283 291
284 new->id = ipc_buildid(id, new->seq); 292 new->id = ipc_buildid(id, new->seq);
285 return id; 293 return id;
diff --git a/ipc/util.h b/ipc/util.h
index c8fe2f7631e..eeb79a1fbd8 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -92,6 +92,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
92#define IPC_SHM_IDS 2 92#define IPC_SHM_IDS 2
93 93
94#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER) 94#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
95#define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER)
95 96
96/* must be called with ids->rw_mutex acquired for writing */ 97/* must be called with ids->rw_mutex acquired for writing */
97int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int); 98int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);
@@ -139,6 +140,7 @@ int ipc_parse_version (int *cmd);
139 140
140extern void free_msg(struct msg_msg *msg); 141extern void free_msg(struct msg_msg *msg);
141extern struct msg_msg *load_msg(const void __user *src, int len); 142extern struct msg_msg *load_msg(const void __user *src, int len);
143extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst);
142extern int store_msg(void __user *dest, struct msg_msg *msg, int len); 144extern int store_msg(void __user *dest, struct msg_msg *msg, int len);
143 145
144extern void recompute_msgmni(struct ipc_namespace *); 146extern void recompute_msgmni(struct ipc_namespace *);
diff --git a/kernel/audit.c b/kernel/audit.c
index 40414e9143d..d596e5355f1 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -272,6 +272,8 @@ static int audit_log_config_change(char *function_name, int new, int old,
272 int rc = 0; 272 int rc = 0;
273 273
274 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); 274 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
275 if (unlikely(!ab))
276 return rc;
275 audit_log_format(ab, "%s=%d old=%d auid=%u ses=%u", function_name, new, 277 audit_log_format(ab, "%s=%d old=%d auid=%u ses=%u", function_name, new,
276 old, from_kuid(&init_user_ns, loginuid), sessionid); 278 old, from_kuid(&init_user_ns, loginuid), sessionid);
277 if (sid) { 279 if (sid) {
@@ -619,6 +621,8 @@ static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type,
619 } 621 }
620 622
621 *ab = audit_log_start(NULL, GFP_KERNEL, msg_type); 623 *ab = audit_log_start(NULL, GFP_KERNEL, msg_type);
624 if (unlikely(!*ab))
625 return rc;
622 audit_log_format(*ab, "pid=%d uid=%u auid=%u ses=%u", 626 audit_log_format(*ab, "pid=%d uid=%u auid=%u ses=%u",
623 task_tgid_vnr(current), 627 task_tgid_vnr(current),
624 from_kuid(&init_user_ns, current_uid()), 628 from_kuid(&init_user_ns, current_uid()),
@@ -1097,6 +1101,23 @@ static inline void audit_get_stamp(struct audit_context *ctx,
1097 } 1101 }
1098} 1102}
1099 1103
1104/*
1105 * Wait for auditd to drain the queue a little
1106 */
1107static void wait_for_auditd(unsigned long sleep_time)
1108{
1109 DECLARE_WAITQUEUE(wait, current);
1110 set_current_state(TASK_INTERRUPTIBLE);
1111 add_wait_queue(&audit_backlog_wait, &wait);
1112
1113 if (audit_backlog_limit &&
1114 skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
1115 schedule_timeout(sleep_time);
1116
1117 __set_current_state(TASK_RUNNING);
1118 remove_wait_queue(&audit_backlog_wait, &wait);
1119}
1120
1100/* Obtain an audit buffer. This routine does locking to obtain the 1121/* Obtain an audit buffer. This routine does locking to obtain the
1101 * audit buffer, but then no locking is required for calls to 1122 * audit buffer, but then no locking is required for calls to
1102 * audit_log_*format. If the tsk is a task that is currently in a 1123 * audit_log_*format. If the tsk is a task that is currently in a
@@ -1142,20 +1163,13 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
1142 1163
1143 while (audit_backlog_limit 1164 while (audit_backlog_limit
1144 && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) { 1165 && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
1145 if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time 1166 if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time) {
1146 && time_before(jiffies, timeout_start + audit_backlog_wait_time)) { 1167 unsigned long sleep_time;
1147 1168
1148 /* Wait for auditd to drain the queue a little */ 1169 sleep_time = timeout_start + audit_backlog_wait_time -
1149 DECLARE_WAITQUEUE(wait, current); 1170 jiffies;
1150 set_current_state(TASK_INTERRUPTIBLE); 1171 if ((long)sleep_time > 0)
1151 add_wait_queue(&audit_backlog_wait, &wait); 1172 wait_for_auditd(sleep_time);
1152
1153 if (audit_backlog_limit &&
1154 skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
1155 schedule_timeout(timeout_start + audit_backlog_wait_time - jiffies);
1156
1157 __set_current_state(TASK_RUNNING);
1158 remove_wait_queue(&audit_backlog_wait, &wait);
1159 continue; 1173 continue;
1160 } 1174 }
1161 if (audit_rate_check() && printk_ratelimit()) 1175 if (audit_rate_check() && printk_ratelimit())
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index e81175ef25f..642a89c4f3d 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -449,11 +449,26 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
449 return 0; 449 return 0;
450} 450}
451 451
452static void audit_log_remove_rule(struct audit_krule *rule)
453{
454 struct audit_buffer *ab;
455
456 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
457 if (unlikely(!ab))
458 return;
459 audit_log_format(ab, "op=");
460 audit_log_string(ab, "remove rule");
461 audit_log_format(ab, " dir=");
462 audit_log_untrustedstring(ab, rule->tree->pathname);
463 audit_log_key(ab, rule->filterkey);
464 audit_log_format(ab, " list=%d res=1", rule->listnr);
465 audit_log_end(ab);
466}
467
452static void kill_rules(struct audit_tree *tree) 468static void kill_rules(struct audit_tree *tree)
453{ 469{
454 struct audit_krule *rule, *next; 470 struct audit_krule *rule, *next;
455 struct audit_entry *entry; 471 struct audit_entry *entry;
456 struct audit_buffer *ab;
457 472
458 list_for_each_entry_safe(rule, next, &tree->rules, rlist) { 473 list_for_each_entry_safe(rule, next, &tree->rules, rlist) {
459 entry = container_of(rule, struct audit_entry, rule); 474 entry = container_of(rule, struct audit_entry, rule);
@@ -461,14 +476,7 @@ static void kill_rules(struct audit_tree *tree)
461 list_del_init(&rule->rlist); 476 list_del_init(&rule->rlist);
462 if (rule->tree) { 477 if (rule->tree) {
463 /* not a half-baked one */ 478 /* not a half-baked one */
464 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); 479 audit_log_remove_rule(rule);
465 audit_log_format(ab, "op=");
466 audit_log_string(ab, "remove rule");
467 audit_log_format(ab, " dir=");
468 audit_log_untrustedstring(ab, rule->tree->pathname);
469 audit_log_key(ab, rule->filterkey);
470 audit_log_format(ab, " list=%d res=1", rule->listnr);
471 audit_log_end(ab);
472 rule->tree = NULL; 480 rule->tree = NULL;
473 list_del_rcu(&entry->list); 481 list_del_rcu(&entry->list);
474 list_del(&entry->rule.list); 482 list_del(&entry->rule.list);
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 4a599f699ad..22831c4d369 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -240,6 +240,8 @@ static void audit_watch_log_rule_change(struct audit_krule *r, struct audit_watc
240 if (audit_enabled) { 240 if (audit_enabled) {
241 struct audit_buffer *ab; 241 struct audit_buffer *ab;
242 ab = audit_log_start(NULL, GFP_NOFS, AUDIT_CONFIG_CHANGE); 242 ab = audit_log_start(NULL, GFP_NOFS, AUDIT_CONFIG_CHANGE);
243 if (unlikely(!ab))
244 return;
243 audit_log_format(ab, "auid=%u ses=%u op=", 245 audit_log_format(ab, "auid=%u ses=%u op=",
244 from_kuid(&init_user_ns, audit_get_loginuid(current)), 246 from_kuid(&init_user_ns, audit_get_loginuid(current)),
245 audit_get_sessionid(current)); 247 audit_get_sessionid(current));
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 7f19f23d38a..f9fc54bbe06 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -1144,7 +1144,6 @@ static void audit_log_rule_change(kuid_t loginuid, u32 sessionid, u32 sid,
1144 * audit_receive_filter - apply all rules to the specified message type 1144 * audit_receive_filter - apply all rules to the specified message type
1145 * @type: audit message type 1145 * @type: audit message type
1146 * @pid: target pid for netlink audit messages 1146 * @pid: target pid for netlink audit messages
1147 * @uid: target uid for netlink audit messages
1148 * @seq: netlink audit message sequence (serial) number 1147 * @seq: netlink audit message sequence (serial) number
1149 * @data: payload data 1148 * @data: payload data
1150 * @datasz: size of payload data 1149 * @datasz: size of payload data
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index e37e6a12c5e..a371f857a0a 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1464,14 +1464,14 @@ static void show_special(struct audit_context *context, int *call_panic)
1464 audit_log_end(ab); 1464 audit_log_end(ab);
1465 ab = audit_log_start(context, GFP_KERNEL, 1465 ab = audit_log_start(context, GFP_KERNEL,
1466 AUDIT_IPC_SET_PERM); 1466 AUDIT_IPC_SET_PERM);
1467 if (unlikely(!ab))
1468 return;
1467 audit_log_format(ab, 1469 audit_log_format(ab,
1468 "qbytes=%lx ouid=%u ogid=%u mode=%#ho", 1470 "qbytes=%lx ouid=%u ogid=%u mode=%#ho",
1469 context->ipc.qbytes, 1471 context->ipc.qbytes,
1470 context->ipc.perm_uid, 1472 context->ipc.perm_uid,
1471 context->ipc.perm_gid, 1473 context->ipc.perm_gid,
1472 context->ipc.perm_mode); 1474 context->ipc.perm_mode);
1473 if (!ab)
1474 return;
1475 } 1475 }
1476 break; } 1476 break; }
1477 case AUDIT_MQ_OPEN: { 1477 case AUDIT_MQ_OPEN: {
@@ -2675,7 +2675,7 @@ void __audit_mmap_fd(int fd, int flags)
2675 context->type = AUDIT_MMAP; 2675 context->type = AUDIT_MMAP;
2676} 2676}
2677 2677
2678static void audit_log_abend(struct audit_buffer *ab, char *reason, long signr) 2678static void audit_log_task(struct audit_buffer *ab)
2679{ 2679{
2680 kuid_t auid, uid; 2680 kuid_t auid, uid;
2681 kgid_t gid; 2681 kgid_t gid;
@@ -2693,6 +2693,11 @@ static void audit_log_abend(struct audit_buffer *ab, char *reason, long signr)
2693 audit_log_task_context(ab); 2693 audit_log_task_context(ab);
2694 audit_log_format(ab, " pid=%d comm=", current->pid); 2694 audit_log_format(ab, " pid=%d comm=", current->pid);
2695 audit_log_untrustedstring(ab, current->comm); 2695 audit_log_untrustedstring(ab, current->comm);
2696}
2697
2698static void audit_log_abend(struct audit_buffer *ab, char *reason, long signr)
2699{
2700 audit_log_task(ab);
2696 audit_log_format(ab, " reason="); 2701 audit_log_format(ab, " reason=");
2697 audit_log_string(ab, reason); 2702 audit_log_string(ab, reason);
2698 audit_log_format(ab, " sig=%ld", signr); 2703 audit_log_format(ab, " sig=%ld", signr);
@@ -2715,6 +2720,8 @@ void audit_core_dumps(long signr)
2715 return; 2720 return;
2716 2721
2717 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); 2722 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND);
2723 if (unlikely(!ab))
2724 return;
2718 audit_log_abend(ab, "memory violation", signr); 2725 audit_log_abend(ab, "memory violation", signr);
2719 audit_log_end(ab); 2726 audit_log_end(ab);
2720} 2727}
@@ -2723,8 +2730,11 @@ void __audit_seccomp(unsigned long syscall, long signr, int code)
2723{ 2730{
2724 struct audit_buffer *ab; 2731 struct audit_buffer *ab;
2725 2732
2726 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); 2733 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_SECCOMP);
2727 audit_log_abend(ab, "seccomp", signr); 2734 if (unlikely(!ab))
2735 return;
2736 audit_log_task(ab);
2737 audit_log_format(ab, " sig=%ld", signr);
2728 audit_log_format(ab, " syscall=%ld", syscall); 2738 audit_log_format(ab, " syscall=%ld", syscall);
2729 audit_log_format(ab, " compat=%d", is_compat_task()); 2739 audit_log_format(ab, " compat=%d", is_compat_task());
2730 audit_log_format(ab, " ip=0x%lx", KSTK_EIP(current)); 2740 audit_log_format(ab, " ip=0x%lx", KSTK_EIP(current));
diff --git a/kernel/printk.c b/kernel/printk.c
index 19c0d7bcf24..357f714ddd4 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -870,10 +870,11 @@ static size_t print_time(u64 ts, char *buf)
870 if (!printk_time) 870 if (!printk_time)
871 return 0; 871 return 0;
872 872
873 rem_nsec = do_div(ts, 1000000000);
874
873 if (!buf) 875 if (!buf)
874 return 15; 876 return snprintf(NULL, 0, "[%5lu.000000] ", (unsigned long)ts);
875 877
876 rem_nsec = do_div(ts, 1000000000);
877 return sprintf(buf, "[%5lu.%06lu] ", 878 return sprintf(buf, "[%5lu.%06lu] ",
878 (unsigned long)ts, rem_nsec / 1000); 879 (unsigned long)ts, rem_nsec / 1000);
879} 880}
diff --git a/kernel/rwsem.c b/kernel/rwsem.c
index 6850f53e02d..b3c6c3fcd84 100644
--- a/kernel/rwsem.c
+++ b/kernel/rwsem.c
@@ -116,6 +116,16 @@ void down_read_nested(struct rw_semaphore *sem, int subclass)
116 116
117EXPORT_SYMBOL(down_read_nested); 117EXPORT_SYMBOL(down_read_nested);
118 118
119void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest)
120{
121 might_sleep();
122 rwsem_acquire_nest(&sem->dep_map, 0, 0, nest, _RET_IP_);
123
124 LOCK_CONTENDED(sem, __down_write_trylock, __down_write);
125}
126
127EXPORT_SYMBOL(_down_write_nest_lock);
128
119void down_write_nested(struct rw_semaphore *sem, int subclass) 129void down_write_nested(struct rw_semaphore *sem, int subclass)
120{ 130{
121 might_sleep(); 131 might_sleep();
diff --git a/kernel/signal.c b/kernel/signal.c
index 7aaa51d8e5b..372771e948c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2528,11 +2528,8 @@ static void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset)
2528 */ 2528 */
2529void set_current_blocked(sigset_t *newset) 2529void set_current_blocked(sigset_t *newset)
2530{ 2530{
2531 struct task_struct *tsk = current;
2532 sigdelsetmask(newset, sigmask(SIGKILL) | sigmask(SIGSTOP)); 2531 sigdelsetmask(newset, sigmask(SIGKILL) | sigmask(SIGSTOP));
2533 spin_lock_irq(&tsk->sighand->siglock); 2532 __set_current_blocked(newset);
2534 __set_task_blocked(tsk, newset);
2535 spin_unlock_irq(&tsk->sighand->siglock);
2536} 2533}
2537 2534
2538void __set_current_blocked(const sigset_t *newset) 2535void __set_current_blocked(const sigset_t *newset)
@@ -3204,7 +3201,6 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
3204 if (nset) { 3201 if (nset) {
3205 if (copy_from_user(&new_set, nset, sizeof(*nset))) 3202 if (copy_from_user(&new_set, nset, sizeof(*nset)))
3206 return -EFAULT; 3203 return -EFAULT;
3207 new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
3208 3204
3209 new_blocked = current->blocked; 3205 new_blocked = current->blocked;
3210 3206
@@ -3222,7 +3218,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
3222 return -EINVAL; 3218 return -EINVAL;
3223 } 3219 }
3224 3220
3225 __set_current_blocked(&new_blocked); 3221 set_current_blocked(&new_blocked);
3226 } 3222 }
3227 3223
3228 if (oset) { 3224 if (oset) {
@@ -3286,6 +3282,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
3286 int old = current->blocked.sig[0]; 3282 int old = current->blocked.sig[0];
3287 sigset_t newset; 3283 sigset_t newset;
3288 3284
3285 siginitset(&newset, newmask);
3289 set_current_blocked(&newset); 3286 set_current_blocked(&newset);
3290 3287
3291 return old; 3288 return old;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index e5125677efa..1bbfa044650 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2899,6 +2899,8 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
2899 if (copy_from_user(&buf, ubuf, cnt)) 2899 if (copy_from_user(&buf, ubuf, cnt))
2900 return -EFAULT; 2900 return -EFAULT;
2901 2901
2902 buf[cnt] = 0;
2903
2902 trace_set_options(buf); 2904 trace_set_options(buf);
2903 2905
2904 *ppos += cnt; 2906 *ppos += cnt;
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 3a353091a90..67604e59938 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -134,7 +134,7 @@ config DEBUG_SECTION_MISMATCH
134 any use of code/data previously in these sections would 134 any use of code/data previously in these sections would
135 most likely result in an oops. 135 most likely result in an oops.
136 In the code, functions and variables are annotated with 136 In the code, functions and variables are annotated with
137 __init, __devinit, etc. (see the full list in include/linux/init.h), 137 __init, __cpuinit, etc. (see the full list in include/linux/init.h),
138 which results in the code/data being placed in specific sections. 138 which results in the code/data being placed in specific sections.
139 The section mismatch analysis is always performed after a full 139 The section mismatch analysis is always performed after a full
140 kernel build, and enabling this option causes the following 140 kernel build, and enabling this option causes the following
diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c
index 145dec5267c..5fbed5caba6 100644
--- a/lib/cpu_rmap.c
+++ b/lib/cpu_rmap.c
@@ -45,6 +45,7 @@ struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags)
45 if (!rmap) 45 if (!rmap)
46 return NULL; 46 return NULL;
47 47
48 kref_init(&rmap->refcount);
48 rmap->obj = (void **)((char *)rmap + obj_offset); 49 rmap->obj = (void **)((char *)rmap + obj_offset);
49 50
50 /* Initially assign CPUs to objects on a rota, since we have 51 /* Initially assign CPUs to objects on a rota, since we have
@@ -63,6 +64,35 @@ struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags)
63} 64}
64EXPORT_SYMBOL(alloc_cpu_rmap); 65EXPORT_SYMBOL(alloc_cpu_rmap);
65 66
67/**
68 * cpu_rmap_release - internal reclaiming helper called from kref_put
69 * @ref: kref to struct cpu_rmap
70 */
71static void cpu_rmap_release(struct kref *ref)
72{
73 struct cpu_rmap *rmap = container_of(ref, struct cpu_rmap, refcount);
74 kfree(rmap);
75}
76
77/**
78 * cpu_rmap_get - internal helper to get new ref on a cpu_rmap
79 * @rmap: reverse-map allocated with alloc_cpu_rmap()
80 */
81static inline void cpu_rmap_get(struct cpu_rmap *rmap)
82{
83 kref_get(&rmap->refcount);
84}
85
86/**
87 * cpu_rmap_put - release ref on a cpu_rmap
88 * @rmap: reverse-map allocated with alloc_cpu_rmap()
89 */
90int cpu_rmap_put(struct cpu_rmap *rmap)
91{
92 return kref_put(&rmap->refcount, cpu_rmap_release);
93}
94EXPORT_SYMBOL(cpu_rmap_put);
95
66/* Reevaluate nearest object for given CPU, comparing with the given 96/* Reevaluate nearest object for given CPU, comparing with the given
67 * neighbours at the given distance. 97 * neighbours at the given distance.
68 */ 98 */
@@ -197,8 +227,7 @@ struct irq_glue {
197 * free_irq_cpu_rmap - free a CPU affinity reverse-map used for IRQs 227 * free_irq_cpu_rmap - free a CPU affinity reverse-map used for IRQs
198 * @rmap: Reverse-map allocated with alloc_irq_cpu_map(), or %NULL 228 * @rmap: Reverse-map allocated with alloc_irq_cpu_map(), or %NULL
199 * 229 *
200 * Must be called in process context, before freeing the IRQs, and 230 * Must be called in process context, before freeing the IRQs.
201 * without holding any locks required by global workqueue items.
202 */ 231 */
203void free_irq_cpu_rmap(struct cpu_rmap *rmap) 232void free_irq_cpu_rmap(struct cpu_rmap *rmap)
204{ 233{
@@ -212,12 +241,18 @@ void free_irq_cpu_rmap(struct cpu_rmap *rmap)
212 glue = rmap->obj[index]; 241 glue = rmap->obj[index];
213 irq_set_affinity_notifier(glue->notify.irq, NULL); 242 irq_set_affinity_notifier(glue->notify.irq, NULL);
214 } 243 }
215 irq_run_affinity_notifiers();
216 244
217 kfree(rmap); 245 cpu_rmap_put(rmap);
218} 246}
219EXPORT_SYMBOL(free_irq_cpu_rmap); 247EXPORT_SYMBOL(free_irq_cpu_rmap);
220 248
249/**
250 * irq_cpu_rmap_notify - callback for IRQ subsystem when IRQ affinity updated
251 * @notify: struct irq_affinity_notify passed by irq/manage.c
252 * @mask: cpu mask for new SMP affinity
253 *
254 * This is executed in workqueue context.
255 */
221static void 256static void
222irq_cpu_rmap_notify(struct irq_affinity_notify *notify, const cpumask_t *mask) 257irq_cpu_rmap_notify(struct irq_affinity_notify *notify, const cpumask_t *mask)
223{ 258{
@@ -230,10 +265,16 @@ irq_cpu_rmap_notify(struct irq_affinity_notify *notify, const cpumask_t *mask)
230 pr_warning("irq_cpu_rmap_notify: update failed: %d\n", rc); 265 pr_warning("irq_cpu_rmap_notify: update failed: %d\n", rc);
231} 266}
232 267
268/**
269 * irq_cpu_rmap_release - reclaiming callback for IRQ subsystem
270 * @ref: kref to struct irq_affinity_notify passed by irq/manage.c
271 */
233static void irq_cpu_rmap_release(struct kref *ref) 272static void irq_cpu_rmap_release(struct kref *ref)
234{ 273{
235 struct irq_glue *glue = 274 struct irq_glue *glue =
236 container_of(ref, struct irq_glue, notify.kref); 275 container_of(ref, struct irq_glue, notify.kref);
276
277 cpu_rmap_put(glue->rmap);
237 kfree(glue); 278 kfree(glue);
238} 279}
239 280
@@ -258,10 +299,13 @@ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq)
258 glue->notify.notify = irq_cpu_rmap_notify; 299 glue->notify.notify = irq_cpu_rmap_notify;
259 glue->notify.release = irq_cpu_rmap_release; 300 glue->notify.release = irq_cpu_rmap_release;
260 glue->rmap = rmap; 301 glue->rmap = rmap;
302 cpu_rmap_get(rmap);
261 glue->index = cpu_rmap_add(rmap, glue); 303 glue->index = cpu_rmap_add(rmap, glue);
262 rc = irq_set_affinity_notifier(irq, &glue->notify); 304 rc = irq_set_affinity_notifier(irq, &glue->notify);
263 if (rc) 305 if (rc) {
306 cpu_rmap_put(glue->rmap);
264 kfree(glue); 307 kfree(glue);
308 }
265 return rc; 309 return rc;
266} 310}
267EXPORT_SYMBOL(irq_cpu_rmap_add); 311EXPORT_SYMBOL(irq_cpu_rmap_add);
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 4f56a11d67f..c0e31fe2fab 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -194,8 +194,12 @@ __rb_insert(struct rb_node *node, struct rb_root *root,
194 } 194 }
195} 195}
196 196
197__always_inline void 197/*
198__rb_erase_color(struct rb_node *parent, struct rb_root *root, 198 * Inline version for rb_erase() use - we want to be able to inline
199 * and eliminate the dummy_rotate callback there
200 */
201static __always_inline void
202____rb_erase_color(struct rb_node *parent, struct rb_root *root,
199 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) 203 void (*augment_rotate)(struct rb_node *old, struct rb_node *new))
200{ 204{
201 struct rb_node *node = NULL, *sibling, *tmp1, *tmp2; 205 struct rb_node *node = NULL, *sibling, *tmp1, *tmp2;
@@ -355,6 +359,13 @@ __rb_erase_color(struct rb_node *parent, struct rb_root *root,
355 } 359 }
356 } 360 }
357} 361}
362
363/* Non-inline version for rb_erase_augmented() use */
364void __rb_erase_color(struct rb_node *parent, struct rb_root *root,
365 void (*augment_rotate)(struct rb_node *old, struct rb_node *new))
366{
367 ____rb_erase_color(parent, root, augment_rotate);
368}
358EXPORT_SYMBOL(__rb_erase_color); 369EXPORT_SYMBOL(__rb_erase_color);
359 370
360/* 371/*
@@ -380,7 +391,10 @@ EXPORT_SYMBOL(rb_insert_color);
380 391
381void rb_erase(struct rb_node *node, struct rb_root *root) 392void rb_erase(struct rb_node *node, struct rb_root *root)
382{ 393{
383 rb_erase_augmented(node, root, &dummy_callbacks); 394 struct rb_node *rebalance;
395 rebalance = __rb_erase_augmented(node, root, &dummy_callbacks);
396 if (rebalance)
397 ____rb_erase_color(rebalance, root, dummy_rotate);
384} 398}
385EXPORT_SYMBOL(rb_erase); 399EXPORT_SYMBOL(rb_erase);
386 400
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 1324cd74fae..b93376c39b6 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -185,10 +185,23 @@ static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
185 185
186 while (start < end) { 186 while (start < end) {
187 unsigned long *map, idx, vec; 187 unsigned long *map, idx, vec;
188 unsigned shift;
188 189
189 map = bdata->node_bootmem_map; 190 map = bdata->node_bootmem_map;
190 idx = start - bdata->node_min_pfn; 191 idx = start - bdata->node_min_pfn;
192 shift = idx & (BITS_PER_LONG - 1);
193 /*
194 * vec holds at most BITS_PER_LONG map bits,
195 * bit 0 corresponds to start.
196 */
191 vec = ~map[idx / BITS_PER_LONG]; 197 vec = ~map[idx / BITS_PER_LONG];
198
199 if (shift) {
200 vec >>= shift;
201 if (end - start >= BITS_PER_LONG)
202 vec |= ~map[idx / BITS_PER_LONG + 1] <<
203 (BITS_PER_LONG - shift);
204 }
192 /* 205 /*
193 * If we have a properly aligned and fully unreserved 206 * If we have a properly aligned and fully unreserved
194 * BITS_PER_LONG block of pages in front of us, free 207 * BITS_PER_LONG block of pages in front of us, free
@@ -201,19 +214,18 @@ static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
201 count += BITS_PER_LONG; 214 count += BITS_PER_LONG;
202 start += BITS_PER_LONG; 215 start += BITS_PER_LONG;
203 } else { 216 } else {
204 unsigned long off = 0; 217 unsigned long cur = start;
205 218
206 vec >>= start & (BITS_PER_LONG - 1); 219 start = ALIGN(start + 1, BITS_PER_LONG);
207 while (vec) { 220 while (vec && cur != start) {
208 if (vec & 1) { 221 if (vec & 1) {
209 page = pfn_to_page(start + off); 222 page = pfn_to_page(cur);
210 __free_pages_bootmem(page, 0); 223 __free_pages_bootmem(page, 0);
211 count++; 224 count++;
212 } 225 }
213 vec >>= 1; 226 vec >>= 1;
214 off++; 227 ++cur;
215 } 228 }
216 start = ALIGN(start + 1, BITS_PER_LONG);
217 } 229 }
218 } 230 }
219 231
diff --git a/mm/compaction.c b/mm/compaction.c
index 6b807e46649..c62bd063d76 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -816,6 +816,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
816static int compact_finished(struct zone *zone, 816static int compact_finished(struct zone *zone,
817 struct compact_control *cc) 817 struct compact_control *cc)
818{ 818{
819 unsigned int order;
819 unsigned long watermark; 820 unsigned long watermark;
820 821
821 if (fatal_signal_pending(current)) 822 if (fatal_signal_pending(current))
@@ -850,22 +851,16 @@ static int compact_finished(struct zone *zone,
850 return COMPACT_CONTINUE; 851 return COMPACT_CONTINUE;
851 852
852 /* Direct compactor: Is a suitable page free? */ 853 /* Direct compactor: Is a suitable page free? */
853 if (cc->page) { 854 for (order = cc->order; order < MAX_ORDER; order++) {
854 /* Was a suitable page captured? */ 855 struct free_area *area = &zone->free_area[order];
855 if (*cc->page) 856
857 /* Job done if page is free of the right migratetype */
858 if (!list_empty(&area->free_list[cc->migratetype]))
859 return COMPACT_PARTIAL;
860
861 /* Job done if allocation would set block type */
862 if (cc->order >= pageblock_order && area->nr_free)
856 return COMPACT_PARTIAL; 863 return COMPACT_PARTIAL;
857 } else {
858 unsigned int order;
859 for (order = cc->order; order < MAX_ORDER; order++) {
860 struct free_area *area = &zone->free_area[cc->order];
861 /* Job done if page is free of the right migratetype */
862 if (!list_empty(&area->free_list[cc->migratetype]))
863 return COMPACT_PARTIAL;
864
865 /* Job done if allocation would set block type */
866 if (cc->order >= pageblock_order && area->nr_free)
867 return COMPACT_PARTIAL;
868 }
869 } 864 }
870 865
871 return COMPACT_CONTINUE; 866 return COMPACT_CONTINUE;
@@ -921,60 +916,6 @@ unsigned long compaction_suitable(struct zone *zone, int order)
921 return COMPACT_CONTINUE; 916 return COMPACT_CONTINUE;
922} 917}
923 918
924static void compact_capture_page(struct compact_control *cc)
925{
926 unsigned long flags;
927 int mtype, mtype_low, mtype_high;
928
929 if (!cc->page || *cc->page)
930 return;
931
932 /*
933 * For MIGRATE_MOVABLE allocations we capture a suitable page ASAP
934 * regardless of the migratetype of the freelist is is captured from.
935 * This is fine because the order for a high-order MIGRATE_MOVABLE
936 * allocation is typically at least a pageblock size and overall
937 * fragmentation is not impaired. Other allocation types must
938 * capture pages from their own migratelist because otherwise they
939 * could pollute other pageblocks like MIGRATE_MOVABLE with
940 * difficult to move pages and making fragmentation worse overall.
941 */
942 if (cc->migratetype == MIGRATE_MOVABLE) {
943 mtype_low = 0;
944 mtype_high = MIGRATE_PCPTYPES;
945 } else {
946 mtype_low = cc->migratetype;
947 mtype_high = cc->migratetype + 1;
948 }
949
950 /* Speculatively examine the free lists without zone lock */
951 for (mtype = mtype_low; mtype < mtype_high; mtype++) {
952 int order;
953 for (order = cc->order; order < MAX_ORDER; order++) {
954 struct page *page;
955 struct free_area *area;
956 area = &(cc->zone->free_area[order]);
957 if (list_empty(&area->free_list[mtype]))
958 continue;
959
960 /* Take the lock and attempt capture of the page */
961 if (!compact_trylock_irqsave(&cc->zone->lock, &flags, cc))
962 return;
963 if (!list_empty(&area->free_list[mtype])) {
964 page = list_entry(area->free_list[mtype].next,
965 struct page, lru);
966 if (capture_free_page(page, cc->order, mtype)) {
967 spin_unlock_irqrestore(&cc->zone->lock,
968 flags);
969 *cc->page = page;
970 return;
971 }
972 }
973 spin_unlock_irqrestore(&cc->zone->lock, flags);
974 }
975 }
976}
977
978static int compact_zone(struct zone *zone, struct compact_control *cc) 919static int compact_zone(struct zone *zone, struct compact_control *cc)
979{ 920{
980 int ret; 921 int ret;
@@ -1054,9 +995,6 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
1054 goto out; 995 goto out;
1055 } 996 }
1056 } 997 }
1057
1058 /* Capture a page now if it is a suitable size */
1059 compact_capture_page(cc);
1060 } 998 }
1061 999
1062out: 1000out:
@@ -1069,8 +1007,7 @@ out:
1069 1007
1070static unsigned long compact_zone_order(struct zone *zone, 1008static unsigned long compact_zone_order(struct zone *zone,
1071 int order, gfp_t gfp_mask, 1009 int order, gfp_t gfp_mask,
1072 bool sync, bool *contended, 1010 bool sync, bool *contended)
1073 struct page **page)
1074{ 1011{
1075 unsigned long ret; 1012 unsigned long ret;
1076 struct compact_control cc = { 1013 struct compact_control cc = {
@@ -1080,7 +1017,6 @@ static unsigned long compact_zone_order(struct zone *zone,
1080 .migratetype = allocflags_to_migratetype(gfp_mask), 1017 .migratetype = allocflags_to_migratetype(gfp_mask),
1081 .zone = zone, 1018 .zone = zone,
1082 .sync = sync, 1019 .sync = sync,
1083 .page = page,
1084 }; 1020 };
1085 INIT_LIST_HEAD(&cc.freepages); 1021 INIT_LIST_HEAD(&cc.freepages);
1086 INIT_LIST_HEAD(&cc.migratepages); 1022 INIT_LIST_HEAD(&cc.migratepages);
@@ -1110,7 +1046,7 @@ int sysctl_extfrag_threshold = 500;
1110 */ 1046 */
1111unsigned long try_to_compact_pages(struct zonelist *zonelist, 1047unsigned long try_to_compact_pages(struct zonelist *zonelist,
1112 int order, gfp_t gfp_mask, nodemask_t *nodemask, 1048 int order, gfp_t gfp_mask, nodemask_t *nodemask,
1113 bool sync, bool *contended, struct page **page) 1049 bool sync, bool *contended)
1114{ 1050{
1115 enum zone_type high_zoneidx = gfp_zone(gfp_mask); 1051 enum zone_type high_zoneidx = gfp_zone(gfp_mask);
1116 int may_enter_fs = gfp_mask & __GFP_FS; 1052 int may_enter_fs = gfp_mask & __GFP_FS;
@@ -1136,7 +1072,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist,
1136 int status; 1072 int status;
1137 1073
1138 status = compact_zone_order(zone, order, gfp_mask, sync, 1074 status = compact_zone_order(zone, order, gfp_mask, sync,
1139 contended, page); 1075 contended);
1140 rc = max(status, rc); 1076 rc = max(status, rc);
1141 1077
1142 /* If a normal allocation would succeed, stop compacting */ 1078 /* If a normal allocation would succeed, stop compacting */
@@ -1192,7 +1128,6 @@ int compact_pgdat(pg_data_t *pgdat, int order)
1192 struct compact_control cc = { 1128 struct compact_control cc = {
1193 .order = order, 1129 .order = order,
1194 .sync = false, 1130 .sync = false,
1195 .page = NULL,
1196 }; 1131 };
1197 1132
1198 return __compact_pgdat(pgdat, &cc); 1133 return __compact_pgdat(pgdat, &cc);
@@ -1203,14 +1138,13 @@ static int compact_node(int nid)
1203 struct compact_control cc = { 1138 struct compact_control cc = {
1204 .order = -1, 1139 .order = -1,
1205 .sync = true, 1140 .sync = true,
1206 .page = NULL,
1207 }; 1141 };
1208 1142
1209 return __compact_pgdat(NODE_DATA(nid), &cc); 1143 return __compact_pgdat(NODE_DATA(nid), &cc);
1210} 1144}
1211 1145
1212/* Compact all nodes in the system */ 1146/* Compact all nodes in the system */
1213static int compact_nodes(void) 1147static void compact_nodes(void)
1214{ 1148{
1215 int nid; 1149 int nid;
1216 1150
@@ -1219,8 +1153,6 @@ static int compact_nodes(void)
1219 1153
1220 for_each_online_node(nid) 1154 for_each_online_node(nid)
1221 compact_node(nid); 1155 compact_node(nid);
1222
1223 return COMPACT_COMPLETE;
1224} 1156}
1225 1157
1226/* The written value is actually unused, all memory is compacted */ 1158/* The written value is actually unused, all memory is compacted */
@@ -1231,7 +1163,7 @@ int sysctl_compaction_handler(struct ctl_table *table, int write,
1231 void __user *buffer, size_t *length, loff_t *ppos) 1163 void __user *buffer, size_t *length, loff_t *ppos)
1232{ 1164{
1233 if (write) 1165 if (write)
1234 return compact_nodes(); 1166 compact_nodes();
1235 1167
1236 return 0; 1168 return 0;
1237} 1169}
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9e894edc781..6001ee6347a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1819,9 +1819,19 @@ int split_huge_page(struct page *page)
1819 1819
1820 BUG_ON(is_huge_zero_pfn(page_to_pfn(page))); 1820 BUG_ON(is_huge_zero_pfn(page_to_pfn(page)));
1821 BUG_ON(!PageAnon(page)); 1821 BUG_ON(!PageAnon(page));
1822 anon_vma = page_lock_anon_vma_read(page); 1822
1823 /*
1824 * The caller does not necessarily hold an mmap_sem that would prevent
1825 * the anon_vma disappearing so we first we take a reference to it
1826 * and then lock the anon_vma for write. This is similar to
1827 * page_lock_anon_vma_read except the write lock is taken to serialise
1828 * against parallel split or collapse operations.
1829 */
1830 anon_vma = page_get_anon_vma(page);
1823 if (!anon_vma) 1831 if (!anon_vma)
1824 goto out; 1832 goto out;
1833 anon_vma_lock_write(anon_vma);
1834
1825 ret = 0; 1835 ret = 0;
1826 if (!PageCompound(page)) 1836 if (!PageCompound(page))
1827 goto out_unlock; 1837 goto out_unlock;
@@ -1832,7 +1842,8 @@ int split_huge_page(struct page *page)
1832 1842
1833 BUG_ON(PageCompound(page)); 1843 BUG_ON(PageCompound(page));
1834out_unlock: 1844out_unlock:
1835 page_unlock_anon_vma_read(anon_vma); 1845 anon_vma_unlock(anon_vma);
1846 put_anon_vma(anon_vma);
1836out: 1847out:
1837 return ret; 1848 return ret;
1838} 1849}
diff --git a/mm/internal.h b/mm/internal.h
index d597f94cc20..9ba21100ebf 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -135,7 +135,6 @@ struct compact_control {
135 int migratetype; /* MOVABLE, RECLAIMABLE etc */ 135 int migratetype; /* MOVABLE, RECLAIMABLE etc */
136 struct zone *zone; 136 struct zone *zone;
137 bool contended; /* True if a lock was contended */ 137 bool contended; /* True if a lock was contended */
138 struct page **page; /* Page captured of requested size */
139}; 138};
140 139
141unsigned long 140unsigned long
diff --git a/mm/memblock.c b/mm/memblock.c
index 625905523c2..88adc8afb61 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -314,7 +314,8 @@ static void __init_memblock memblock_merge_regions(struct memblock_type *type)
314 } 314 }
315 315
316 this->size += next->size; 316 this->size += next->size;
317 memmove(next, next + 1, (type->cnt - (i + 1)) * sizeof(*next)); 317 /* move forward from next + 1, index of which is i + 2 */
318 memmove(next, next + 1, (type->cnt - (i + 2)) * sizeof(*next));
318 type->cnt--; 319 type->cnt--;
319 } 320 }
320} 321}
diff --git a/mm/memory.c b/mm/memory.c
index e0a9b0ce4f1..bb1369f7b9b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -184,10 +184,14 @@ static int tlb_next_batch(struct mmu_gather *tlb)
184 return 1; 184 return 1;
185 } 185 }
186 186
187 if (tlb->batch_count == MAX_GATHER_BATCH_COUNT)
188 return 0;
189
187 batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); 190 batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
188 if (!batch) 191 if (!batch)
189 return 0; 192 return 0;
190 193
194 tlb->batch_count++;
191 batch->next = NULL; 195 batch->next = NULL;
192 batch->nr = 0; 196 batch->nr = 0;
193 batch->max = MAX_GATHER_BATCH; 197 batch->max = MAX_GATHER_BATCH;
@@ -216,6 +220,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm)
216 tlb->local.nr = 0; 220 tlb->local.nr = 0;
217 tlb->local.max = ARRAY_SIZE(tlb->__pages); 221 tlb->local.max = ARRAY_SIZE(tlb->__pages);
218 tlb->active = &tlb->local; 222 tlb->active = &tlb->local;
223 tlb->batch_count = 0;
219 224
220#ifdef CONFIG_HAVE_RCU_TABLE_FREE 225#ifdef CONFIG_HAVE_RCU_TABLE_FREE
221 tlb->batch = NULL; 226 tlb->batch = NULL;
@@ -3706,6 +3711,14 @@ retry:
3706 if (pmd_trans_huge(orig_pmd)) { 3711 if (pmd_trans_huge(orig_pmd)) {
3707 unsigned int dirty = flags & FAULT_FLAG_WRITE; 3712 unsigned int dirty = flags & FAULT_FLAG_WRITE;
3708 3713
3714 /*
3715 * If the pmd is splitting, return and retry the
3716 * the fault. Alternative: wait until the split
3717 * is done, and goto retry.
3718 */
3719 if (pmd_trans_splitting(orig_pmd))
3720 return 0;
3721
3709 if (pmd_numa(orig_pmd)) 3722 if (pmd_numa(orig_pmd))
3710 return do_huge_pmd_numa_page(mm, vma, address, 3723 return do_huge_pmd_numa_page(mm, vma, address,
3711 orig_pmd, pmd); 3724 orig_pmd, pmd);
diff --git a/mm/migrate.c b/mm/migrate.c
index 3b676b0c5c3..c38778610aa 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1679,9 +1679,21 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
1679 page_xchg_last_nid(new_page, page_last_nid(page)); 1679 page_xchg_last_nid(new_page, page_last_nid(page));
1680 1680
1681 isolated = numamigrate_isolate_page(pgdat, page); 1681 isolated = numamigrate_isolate_page(pgdat, page);
1682 if (!isolated) { 1682
1683 /*
1684 * Failing to isolate or a GUP pin prevents migration. The expected
1685 * page count is 2. 1 for anonymous pages without a mapping and 1
1686 * for the callers pin. If the page was isolated, the page will
1687 * need to be put back on the LRU.
1688 */
1689 if (!isolated || page_count(page) != 2) {
1683 count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR); 1690 count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR);
1684 put_page(new_page); 1691 put_page(new_page);
1692 if (isolated) {
1693 putback_lru_page(page);
1694 isolated = 0;
1695 goto out;
1696 }
1685 goto out_keep_locked; 1697 goto out_keep_locked;
1686 } 1698 }
1687 1699
diff --git a/mm/mmap.c b/mm/mmap.c
index f54b235f29a..35730ee9d51 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2886,7 +2886,7 @@ static void vm_lock_anon_vma(struct mm_struct *mm, struct anon_vma *anon_vma)
2886 * The LSB of head.next can't change from under us 2886 * The LSB of head.next can't change from under us
2887 * because we hold the mm_all_locks_mutex. 2887 * because we hold the mm_all_locks_mutex.
2888 */ 2888 */
2889 down_write(&anon_vma->root->rwsem); 2889 down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_sem);
2890 /* 2890 /*
2891 * We can safely modify head.next after taking the 2891 * We can safely modify head.next after taking the
2892 * anon_vma->root->rwsem. If some other vma in this mm shares 2892 * anon_vma->root->rwsem. If some other vma in this mm shares
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4ba5e37127f..df2022ff0c8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -221,11 +221,6 @@ EXPORT_SYMBOL(nr_online_nodes);
221 221
222int page_group_by_mobility_disabled __read_mostly; 222int page_group_by_mobility_disabled __read_mostly;
223 223
224/*
225 * NOTE:
226 * Don't use set_pageblock_migratetype(page, MIGRATE_ISOLATE) directly.
227 * Instead, use {un}set_pageblock_isolate.
228 */
229void set_pageblock_migratetype(struct page *page, int migratetype) 224void set_pageblock_migratetype(struct page *page, int migratetype)
230{ 225{
231 226
@@ -1389,14 +1384,8 @@ void split_page(struct page *page, unsigned int order)
1389 set_page_refcounted(page + i); 1384 set_page_refcounted(page + i);
1390} 1385}
1391 1386
1392/* 1387static int __isolate_free_page(struct page *page, unsigned int order)
1393 * Similar to the split_page family of functions except that the page
1394 * required at the given order and being isolated now to prevent races
1395 * with parallel allocators
1396 */
1397int capture_free_page(struct page *page, int alloc_order, int migratetype)
1398{ 1388{
1399 unsigned int order;
1400 unsigned long watermark; 1389 unsigned long watermark;
1401 struct zone *zone; 1390 struct zone *zone;
1402 int mt; 1391 int mt;
@@ -1404,7 +1393,6 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1404 BUG_ON(!PageBuddy(page)); 1393 BUG_ON(!PageBuddy(page));
1405 1394
1406 zone = page_zone(page); 1395 zone = page_zone(page);
1407 order = page_order(page);
1408 mt = get_pageblock_migratetype(page); 1396 mt = get_pageblock_migratetype(page);
1409 1397
1410 if (mt != MIGRATE_ISOLATE) { 1398 if (mt != MIGRATE_ISOLATE) {
@@ -1413,7 +1401,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1413 if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) 1401 if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
1414 return 0; 1402 return 0;
1415 1403
1416 __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt); 1404 __mod_zone_freepage_state(zone, -(1UL << order), mt);
1417 } 1405 }
1418 1406
1419 /* Remove page from free list */ 1407 /* Remove page from free list */
@@ -1421,11 +1409,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1421 zone->free_area[order].nr_free--; 1409 zone->free_area[order].nr_free--;
1422 rmv_page_order(page); 1410 rmv_page_order(page);
1423 1411
1424 if (alloc_order != order) 1412 /* Set the pageblock if the isolated page is at least a pageblock */
1425 expand(zone, page, alloc_order, order,
1426 &zone->free_area[order], migratetype);
1427
1428 /* Set the pageblock if the captured page is at least a pageblock */
1429 if (order >= pageblock_order - 1) { 1413 if (order >= pageblock_order - 1) {
1430 struct page *endpage = page + (1 << order) - 1; 1414 struct page *endpage = page + (1 << order) - 1;
1431 for (; page < endpage; page += pageblock_nr_pages) { 1415 for (; page < endpage; page += pageblock_nr_pages) {
@@ -1436,7 +1420,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1436 } 1420 }
1437 } 1421 }
1438 1422
1439 return 1UL << alloc_order; 1423 return 1UL << order;
1440} 1424}
1441 1425
1442/* 1426/*
@@ -1454,10 +1438,9 @@ int split_free_page(struct page *page)
1454 unsigned int order; 1438 unsigned int order;
1455 int nr_pages; 1439 int nr_pages;
1456 1440
1457 BUG_ON(!PageBuddy(page));
1458 order = page_order(page); 1441 order = page_order(page);
1459 1442
1460 nr_pages = capture_free_page(page, order, 0); 1443 nr_pages = __isolate_free_page(page, order);
1461 if (!nr_pages) 1444 if (!nr_pages)
1462 return 0; 1445 return 0;
1463 1446
@@ -1655,20 +1638,6 @@ static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark,
1655 return true; 1638 return true;
1656} 1639}
1657 1640
1658#ifdef CONFIG_MEMORY_ISOLATION
1659static inline unsigned long nr_zone_isolate_freepages(struct zone *zone)
1660{
1661 if (unlikely(zone->nr_pageblock_isolate))
1662 return zone->nr_pageblock_isolate * pageblock_nr_pages;
1663 return 0;
1664}
1665#else
1666static inline unsigned long nr_zone_isolate_freepages(struct zone *zone)
1667{
1668 return 0;
1669}
1670#endif
1671
1672bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, 1641bool zone_watermark_ok(struct zone *z, int order, unsigned long mark,
1673 int classzone_idx, int alloc_flags) 1642 int classzone_idx, int alloc_flags)
1674{ 1643{
@@ -1684,14 +1653,6 @@ bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark,
1684 if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark) 1653 if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark)
1685 free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES); 1654 free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES);
1686 1655
1687 /*
1688 * If the zone has MIGRATE_ISOLATE type free pages, we should consider
1689 * it. nr_zone_isolate_freepages is never accurate so kswapd might not
1690 * sleep although it could do so. But this is more desirable for memory
1691 * hotplug than sleeping which can cause a livelock in the direct
1692 * reclaim path.
1693 */
1694 free_pages -= nr_zone_isolate_freepages(z);
1695 return __zone_watermark_ok(z, order, mark, classzone_idx, alloc_flags, 1656 return __zone_watermark_ok(z, order, mark, classzone_idx, alloc_flags,
1696 free_pages); 1657 free_pages);
1697} 1658}
@@ -2163,8 +2124,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
2163 bool *contended_compaction, bool *deferred_compaction, 2124 bool *contended_compaction, bool *deferred_compaction,
2164 unsigned long *did_some_progress) 2125 unsigned long *did_some_progress)
2165{ 2126{
2166 struct page *page = NULL;
2167
2168 if (!order) 2127 if (!order)
2169 return NULL; 2128 return NULL;
2170 2129
@@ -2176,16 +2135,12 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
2176 current->flags |= PF_MEMALLOC; 2135 current->flags |= PF_MEMALLOC;
2177 *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask, 2136 *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask,
2178 nodemask, sync_migration, 2137 nodemask, sync_migration,
2179 contended_compaction, &page); 2138 contended_compaction);
2180 current->flags &= ~PF_MEMALLOC; 2139 current->flags &= ~PF_MEMALLOC;
2181 2140
2182 /* If compaction captured a page, prep and use it */
2183 if (page) {
2184 prep_new_page(page, order, gfp_mask);
2185 goto got_page;
2186 }
2187
2188 if (*did_some_progress != COMPACT_SKIPPED) { 2141 if (*did_some_progress != COMPACT_SKIPPED) {
2142 struct page *page;
2143
2189 /* Page migration frees to the PCP lists but we want merging */ 2144 /* Page migration frees to the PCP lists but we want merging */
2190 drain_pages(get_cpu()); 2145 drain_pages(get_cpu());
2191 put_cpu(); 2146 put_cpu();
@@ -2195,7 +2150,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
2195 alloc_flags & ~ALLOC_NO_WATERMARKS, 2150 alloc_flags & ~ALLOC_NO_WATERMARKS,
2196 preferred_zone, migratetype); 2151 preferred_zone, migratetype);
2197 if (page) { 2152 if (page) {
2198got_page:
2199 preferred_zone->compact_blockskip_flush = false; 2153 preferred_zone->compact_blockskip_flush = false;
2200 preferred_zone->compact_considered = 0; 2154 preferred_zone->compact_considered = 0;
2201 preferred_zone->compact_defer_shift = 0; 2155 preferred_zone->compact_defer_shift = 0;
@@ -5631,7 +5585,7 @@ static inline int pfn_to_bitidx(struct zone *zone, unsigned long pfn)
5631 pfn &= (PAGES_PER_SECTION-1); 5585 pfn &= (PAGES_PER_SECTION-1);
5632 return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS; 5586 return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
5633#else 5587#else
5634 pfn = pfn - zone->zone_start_pfn; 5588 pfn = pfn - round_down(zone->zone_start_pfn, pageblock_nr_pages);
5635 return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS; 5589 return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
5636#endif /* CONFIG_SPARSEMEM */ 5590#endif /* CONFIG_SPARSEMEM */
5637} 5591}
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 9d2264ea460..383bdbb98b0 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -8,28 +8,6 @@
8#include <linux/memory.h> 8#include <linux/memory.h>
9#include "internal.h" 9#include "internal.h"
10 10
11/* called while holding zone->lock */
12static void set_pageblock_isolate(struct page *page)
13{
14 if (get_pageblock_migratetype(page) == MIGRATE_ISOLATE)
15 return;
16
17 set_pageblock_migratetype(page, MIGRATE_ISOLATE);
18 page_zone(page)->nr_pageblock_isolate++;
19}
20
21/* called while holding zone->lock */
22static void restore_pageblock_isolate(struct page *page, int migratetype)
23{
24 struct zone *zone = page_zone(page);
25 if (WARN_ON(get_pageblock_migratetype(page) != MIGRATE_ISOLATE))
26 return;
27
28 BUG_ON(zone->nr_pageblock_isolate <= 0);
29 set_pageblock_migratetype(page, migratetype);
30 zone->nr_pageblock_isolate--;
31}
32
33int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages) 11int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages)
34{ 12{
35 struct zone *zone; 13 struct zone *zone;
@@ -80,7 +58,7 @@ out:
80 unsigned long nr_pages; 58 unsigned long nr_pages;
81 int migratetype = get_pageblock_migratetype(page); 59 int migratetype = get_pageblock_migratetype(page);
82 60
83 set_pageblock_isolate(page); 61 set_pageblock_migratetype(page, MIGRATE_ISOLATE);
84 nr_pages = move_freepages_block(zone, page, MIGRATE_ISOLATE); 62 nr_pages = move_freepages_block(zone, page, MIGRATE_ISOLATE);
85 63
86 __mod_zone_freepage_state(zone, -nr_pages, migratetype); 64 __mod_zone_freepage_state(zone, -nr_pages, migratetype);
@@ -103,7 +81,7 @@ void unset_migratetype_isolate(struct page *page, unsigned migratetype)
103 goto out; 81 goto out;
104 nr_pages = move_freepages_block(zone, page, migratetype); 82 nr_pages = move_freepages_block(zone, page, migratetype);
105 __mod_zone_freepage_state(zone, nr_pages, migratetype); 83 __mod_zone_freepage_state(zone, nr_pages, migratetype);
106 restore_pageblock_isolate(page, migratetype); 84 set_pageblock_migratetype(page, migratetype);
107out: 85out:
108 spin_unlock_irqrestore(&zone->lock, flags); 86 spin_unlock_irqrestore(&zone->lock, flags);
109} 87}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 16b42af393a..196709f5ee5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3122,8 +3122,8 @@ unsigned long shrink_all_memory(unsigned long nr_to_reclaim)
3122 not required for correctness. So if the last cpu in a node goes 3122 not required for correctness. So if the last cpu in a node goes
3123 away, we get changed to run anywhere: as the first one comes back, 3123 away, we get changed to run anywhere: as the first one comes back,
3124 restore their cpu bindings. */ 3124 restore their cpu bindings. */
3125static int __devinit cpu_callback(struct notifier_block *nfb, 3125static int cpu_callback(struct notifier_block *nfb, unsigned long action,
3126 unsigned long action, void *hcpu) 3126 void *hcpu)
3127{ 3127{
3128 int nid; 3128 int nid;
3129 3129
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 5391ca43336..6d6f26531de 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1608,7 +1608,6 @@ void br_multicast_init(struct net_bridge *br)
1608 br_multicast_querier_expired, (unsigned long)br); 1608 br_multicast_querier_expired, (unsigned long)br);
1609 setup_timer(&br->multicast_query_timer, br_multicast_query_expired, 1609 setup_timer(&br->multicast_query_timer, br_multicast_query_expired,
1610 (unsigned long)br); 1610 (unsigned long)br);
1611 br_mdb_init();
1612} 1611}
1613 1612
1614void br_multicast_open(struct net_bridge *br) 1613void br_multicast_open(struct net_bridge *br)
@@ -1633,7 +1632,6 @@ void br_multicast_stop(struct net_bridge *br)
1633 del_timer_sync(&br->multicast_querier_timer); 1632 del_timer_sync(&br->multicast_querier_timer);
1634 del_timer_sync(&br->multicast_query_timer); 1633 del_timer_sync(&br->multicast_query_timer);
1635 1634
1636 br_mdb_uninit();
1637 spin_lock_bh(&br->multicast_lock); 1635 spin_lock_bh(&br->multicast_lock);
1638 mdb = mlock_dereference(br->mdb, br); 1636 mdb = mlock_dereference(br->mdb, br);
1639 if (!mdb) 1637 if (!mdb)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 97ba0189c6f..5dc66abcc9e 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -299,10 +299,21 @@ struct rtnl_link_ops br_link_ops __read_mostly = {
299 299
300int __init br_netlink_init(void) 300int __init br_netlink_init(void)
301{ 301{
302 return rtnl_link_register(&br_link_ops); 302 int err;
303
304 br_mdb_init();
305 err = rtnl_link_register(&br_link_ops);
306 if (err)
307 goto out;
308
309 return 0;
310out:
311 br_mdb_uninit();
312 return err;
303} 313}
304 314
305void __exit br_netlink_fini(void) 315void __exit br_netlink_fini(void)
306{ 316{
317 br_mdb_uninit();
307 rtnl_link_unregister(&br_link_ops); 318 rtnl_link_unregister(&br_link_ops);
308} 319}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 8d83be5ffed..711094aed41 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -526,6 +526,12 @@ static inline bool br_multicast_is_router(struct net_bridge *br)
526{ 526{
527 return 0; 527 return 0;
528} 528}
529static inline void br_mdb_init(void)
530{
531}
532static inline void br_mdb_uninit(void)
533{
534}
529#endif 535#endif
530 536
531/* br_netfilter.c */ 537/* br_netfilter.c */
diff --git a/net/core/dev.c b/net/core/dev.c
index 515473ee52c..f64e439b4a0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6121,6 +6121,14 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
6121 6121
6122static const struct ethtool_ops default_ethtool_ops; 6122static const struct ethtool_ops default_ethtool_ops;
6123 6123
6124void netdev_set_default_ethtool_ops(struct net_device *dev,
6125 const struct ethtool_ops *ops)
6126{
6127 if (dev->ethtool_ops == &default_ethtool_ops)
6128 dev->ethtool_ops = ops;
6129}
6130EXPORT_SYMBOL_GPL(netdev_set_default_ethtool_ops);
6131
6124/** 6132/**
6125 * alloc_netdev_mqs - allocate network device 6133 * alloc_netdev_mqs - allocate network device
6126 * @sizeof_priv: size of private data to allocate space for 6134 * @sizeof_priv: size of private data to allocate space for
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index cc06a47f121..a8e4f2665d5 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
823 if (!ifa) { 823 if (!ifa) {
824 ret = -ENOBUFS; 824 ret = -ENOBUFS;
825 ifa = inet_alloc_ifa(); 825 ifa = inet_alloc_ifa();
826 INIT_HLIST_NODE(&ifa->hash);
827 if (!ifa) 826 if (!ifa)
828 break; 827 break;
828 INIT_HLIST_NODE(&ifa->hash);
829 if (colon) 829 if (colon)
830 memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ); 830 memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
831 else 831 else
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 3c9d2088028..d9c4f113d70 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -590,7 +590,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
590 case IP_TTL: 590 case IP_TTL:
591 if (optlen < 1) 591 if (optlen < 1)
592 goto e_inval; 592 goto e_inval;
593 if (val != -1 && (val < 0 || val > 255)) 593 if (val != -1 && (val < 1 || val > 255))
594 goto e_inval; 594 goto e_inval;
595 inet->uc_ttl = val; 595 inet->uc_ttl = val;
596 break; 596 break;
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index d763701cff1..a2e50ae80b5 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE; /* My IP address */
136static __be32 ic_netmask = NONE; /* Netmask for local subnet */ 136static __be32 ic_netmask = NONE; /* Netmask for local subnet */
137__be32 ic_gateway = NONE; /* Gateway IP address */ 137__be32 ic_gateway = NONE; /* Gateway IP address */
138 138
139__be32 ic_addrservaddr = NONE; /* IP Address of the IP addresses'server */
140
139__be32 ic_servaddr = NONE; /* Boot server IP address */ 141__be32 ic_servaddr = NONE; /* Boot server IP address */
140 142
141__be32 root_server_addr = NONE; /* Address of NFS server */ 143__be32 root_server_addr = NONE; /* Address of NFS server */
@@ -558,6 +560,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
558 if (ic_myaddr == NONE) 560 if (ic_myaddr == NONE)
559 ic_myaddr = tip; 561 ic_myaddr = tip;
560 ic_servaddr = sip; 562 ic_servaddr = sip;
563 ic_addrservaddr = sip;
561 ic_got_reply = IC_RARP; 564 ic_got_reply = IC_RARP;
562 565
563drop_unlock: 566drop_unlock:
@@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
1068 ic_servaddr = server_id; 1071 ic_servaddr = server_id;
1069#ifdef IPCONFIG_DEBUG 1072#ifdef IPCONFIG_DEBUG
1070 printk("DHCP: Offered address %pI4 by server %pI4\n", 1073 printk("DHCP: Offered address %pI4 by server %pI4\n",
1071 &ic_myaddr, &ic_servaddr); 1074 &ic_myaddr, &b->iph.saddr);
1072#endif 1075#endif
1073 /* The DHCP indicated server address takes 1076 /* The DHCP indicated server address takes
1074 * precedence over the bootp header one if 1077 * precedence over the bootp header one if
@@ -1113,6 +1116,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
1113 ic_dev = dev; 1116 ic_dev = dev;
1114 ic_myaddr = b->your_ip; 1117 ic_myaddr = b->your_ip;
1115 ic_servaddr = b->server_ip; 1118 ic_servaddr = b->server_ip;
1119 ic_addrservaddr = b->iph.saddr;
1116 if (ic_gateway == NONE && b->relay_ip) 1120 if (ic_gateway == NONE && b->relay_ip)
1117 ic_gateway = b->relay_ip; 1121 ic_gateway = b->relay_ip;
1118 if (ic_nameservers[0] == NONE) 1122 if (ic_nameservers[0] == NONE)
@@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void)
1268 printk("IP-Config: Got %s answer from %pI4, ", 1272 printk("IP-Config: Got %s answer from %pI4, ",
1269 ((ic_got_reply & IC_RARP) ? "RARP" 1273 ((ic_got_reply & IC_RARP) ? "RARP"
1270 : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), 1274 : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
1271 &ic_servaddr); 1275 &ic_addrservaddr);
1272 pr_cont("my address is %pI4\n", &ic_myaddr); 1276 pr_cont("my address is %pI4\n", &ic_myaddr);
1273 1277
1274 return 0; 1278 return 0;
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index 51f13f8ec72..04b18c1ac34 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -81,6 +81,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
81 niph->saddr = oiph->daddr; 81 niph->saddr = oiph->daddr;
82 niph->daddr = oiph->saddr; 82 niph->daddr = oiph->saddr;
83 83
84 skb_reset_transport_header(nskb);
84 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); 85 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
85 memset(tcph, 0, sizeof(*tcph)); 86 memset(tcph, 0, sizeof(*tcph));
86 tcph->source = oth->dest; 87 tcph->source = oth->dest;
diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c
index da2c8a368f6..eeaff7e4acb 100644
--- a/net/ipv4/netfilter/iptable_nat.c
+++ b/net/ipv4/netfilter/iptable_nat.c
@@ -124,23 +124,28 @@ nf_nat_ipv4_fn(unsigned int hooknum,
124 ret = nf_nat_rule_find(skb, hooknum, in, out, ct); 124 ret = nf_nat_rule_find(skb, hooknum, in, out, ct);
125 if (ret != NF_ACCEPT) 125 if (ret != NF_ACCEPT)
126 return ret; 126 return ret;
127 } else 127 } else {
128 pr_debug("Already setup manip %s for ct %p\n", 128 pr_debug("Already setup manip %s for ct %p\n",
129 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST", 129 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST",
130 ct); 130 ct);
131 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
132 goto oif_changed;
133 }
131 break; 134 break;
132 135
133 default: 136 default:
134 /* ESTABLISHED */ 137 /* ESTABLISHED */
135 NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED || 138 NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED ||
136 ctinfo == IP_CT_ESTABLISHED_REPLY); 139 ctinfo == IP_CT_ESTABLISHED_REPLY);
137 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) { 140 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
138 nf_ct_kill_acct(ct, ctinfo, skb); 141 goto oif_changed;
139 return NF_DROP;
140 }
141 } 142 }
142 143
143 return nf_nat_packet(ct, ctinfo, hooknum, skb); 144 return nf_nat_packet(ct, ctinfo, hooknum, skb);
145
146oif_changed:
147 nf_ct_kill_acct(ct, ctinfo, skb);
148 return NF_DROP;
144} 149}
145 150
146static unsigned int 151static unsigned int
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1ca253635f7..2aa69c8ae60 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1428,12 +1428,12 @@ static void tcp_service_net_dma(struct sock *sk, bool wait)
1428} 1428}
1429#endif 1429#endif
1430 1430
1431static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) 1431static struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off)
1432{ 1432{
1433 struct sk_buff *skb; 1433 struct sk_buff *skb;
1434 u32 offset; 1434 u32 offset;
1435 1435
1436 skb_queue_walk(&sk->sk_receive_queue, skb) { 1436 while ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) {
1437 offset = seq - TCP_SKB_CB(skb)->seq; 1437 offset = seq - TCP_SKB_CB(skb)->seq;
1438 if (tcp_hdr(skb)->syn) 1438 if (tcp_hdr(skb)->syn)
1439 offset--; 1439 offset--;
@@ -1441,6 +1441,11 @@ static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off)
1441 *off = offset; 1441 *off = offset;
1442 return skb; 1442 return skb;
1443 } 1443 }
1444 /* This looks weird, but this can happen if TCP collapsing
1445 * splitted a fat GRO packet, while we released socket lock
1446 * in skb_splice_bits()
1447 */
1448 sk_eat_skb(sk, skb, false);
1444 } 1449 }
1445 return NULL; 1450 return NULL;
1446} 1451}
@@ -1482,7 +1487,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
1482 break; 1487 break;
1483 } 1488 }
1484 used = recv_actor(desc, skb, offset, len); 1489 used = recv_actor(desc, skb, offset, len);
1485 if (used < 0) { 1490 if (used <= 0) {
1486 if (!copied) 1491 if (!copied)
1487 copied = used; 1492 copied = used;
1488 break; 1493 break;
@@ -1520,8 +1525,10 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
1520 tcp_rcv_space_adjust(sk); 1525 tcp_rcv_space_adjust(sk);
1521 1526
1522 /* Clean up data we have read: This will do ACK frames. */ 1527 /* Clean up data we have read: This will do ACK frames. */
1523 if (copied > 0) 1528 if (copied > 0) {
1529 tcp_recv_skb(sk, seq, &offset);
1524 tcp_cleanup_rbuf(sk, copied); 1530 tcp_cleanup_rbuf(sk, copied);
1531 }
1525 return copied; 1532 return copied;
1526} 1533}
1527EXPORT_SYMBOL(tcp_read_sock); 1534EXPORT_SYMBOL(tcp_read_sock);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a28e4db8a95..18f97ca76b0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5543,7 +5543,7 @@ slow_path:
5543 if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) 5543 if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb))
5544 goto csum_error; 5544 goto csum_error;
5545 5545
5546 if (!th->ack) 5546 if (!th->ack && !th->rst)
5547 goto discard; 5547 goto discard;
5548 5548
5549 /* 5549 /*
@@ -5988,7 +5988,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
5988 goto discard; 5988 goto discard;
5989 } 5989 }
5990 5990
5991 if (!th->ack) 5991 if (!th->ack && !th->rst)
5992 goto discard; 5992 goto discard;
5993 5993
5994 if (!tcp_validate_incoming(sk, skb, th, 0)) 5994 if (!tcp_validate_incoming(sk, skb, th, 0))
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 408cac4ae00..420e5632638 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -154,6 +154,11 @@ static void addrconf_type_change(struct net_device *dev,
154 unsigned long event); 154 unsigned long event);
155static int addrconf_ifdown(struct net_device *dev, int how); 155static int addrconf_ifdown(struct net_device *dev, int how);
156 156
157static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
158 int plen,
159 const struct net_device *dev,
160 u32 flags, u32 noflags);
161
157static void addrconf_dad_start(struct inet6_ifaddr *ifp); 162static void addrconf_dad_start(struct inet6_ifaddr *ifp);
158static void addrconf_dad_timer(unsigned long data); 163static void addrconf_dad_timer(unsigned long data);
159static void addrconf_dad_completed(struct inet6_ifaddr *ifp); 164static void addrconf_dad_completed(struct inet6_ifaddr *ifp);
@@ -250,12 +255,6 @@ static inline bool addrconf_qdisc_ok(const struct net_device *dev)
250 return !qdisc_tx_is_noop(dev); 255 return !qdisc_tx_is_noop(dev);
251} 256}
252 257
253/* Check if a route is valid prefix route */
254static inline int addrconf_is_prefix_route(const struct rt6_info *rt)
255{
256 return (rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0;
257}
258
259static void addrconf_del_timer(struct inet6_ifaddr *ifp) 258static void addrconf_del_timer(struct inet6_ifaddr *ifp)
260{ 259{
261 if (del_timer(&ifp->timer)) 260 if (del_timer(&ifp->timer))
@@ -941,17 +940,15 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
941 if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) { 940 if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) {
942 struct in6_addr prefix; 941 struct in6_addr prefix;
943 struct rt6_info *rt; 942 struct rt6_info *rt;
944 struct net *net = dev_net(ifp->idev->dev);
945 struct flowi6 fl6 = {};
946 943
947 ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len); 944 ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
948 fl6.flowi6_oif = ifp->idev->dev->ifindex;
949 fl6.daddr = prefix;
950 rt = (struct rt6_info *)ip6_route_lookup(net, &fl6,
951 RT6_LOOKUP_F_IFACE);
952 945
953 if (rt != net->ipv6.ip6_null_entry && 946 rt = addrconf_get_prefix_route(&prefix,
954 addrconf_is_prefix_route(rt)) { 947 ifp->prefix_len,
948 ifp->idev->dev,
949 0, RTF_GATEWAY | RTF_DEFAULT);
950
951 if (rt) {
955 if (onlink == 0) { 952 if (onlink == 0) {
956 ip6_del_rt(rt); 953 ip6_del_rt(rt);
957 rt = NULL; 954 rt = NULL;
@@ -1877,7 +1874,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
1877 continue; 1874 continue;
1878 if ((rt->rt6i_flags & flags) != flags) 1875 if ((rt->rt6i_flags & flags) != flags)
1879 continue; 1876 continue;
1880 if ((noflags != 0) && ((rt->rt6i_flags & flags) != 0)) 1877 if ((rt->rt6i_flags & noflags) != 0)
1881 continue; 1878 continue;
1882 dst_hold(&rt->dst); 1879 dst_hold(&rt->dst);
1883 break; 1880 break;
diff --git a/net/ipv6/netfilter/ip6t_NPT.c b/net/ipv6/netfilter/ip6t_NPT.c
index e9486915eff..7302b0b7b64 100644
--- a/net/ipv6/netfilter/ip6t_NPT.c
+++ b/net/ipv6/netfilter/ip6t_NPT.c
@@ -14,42 +14,23 @@
14#include <linux/netfilter_ipv6/ip6t_NPT.h> 14#include <linux/netfilter_ipv6/ip6t_NPT.h>
15#include <linux/netfilter/x_tables.h> 15#include <linux/netfilter/x_tables.h>
16 16
17static __sum16 csum16_complement(__sum16 a)
18{
19 return (__force __sum16)(0xffff - (__force u16)a);
20}
21
22static __sum16 csum16_add(__sum16 a, __sum16 b)
23{
24 u16 sum;
25
26 sum = (__force u16)a + (__force u16)b;
27 sum += (__force u16)a < (__force u16)b;
28 return (__force __sum16)sum;
29}
30
31static __sum16 csum16_sub(__sum16 a, __sum16 b)
32{
33 return csum16_add(a, csum16_complement(b));
34}
35
36static int ip6t_npt_checkentry(const struct xt_tgchk_param *par) 17static int ip6t_npt_checkentry(const struct xt_tgchk_param *par)
37{ 18{
38 struct ip6t_npt_tginfo *npt = par->targinfo; 19 struct ip6t_npt_tginfo *npt = par->targinfo;
39 __sum16 src_sum = 0, dst_sum = 0; 20 __wsum src_sum = 0, dst_sum = 0;
40 unsigned int i; 21 unsigned int i;
41 22
42 if (npt->src_pfx_len > 64 || npt->dst_pfx_len > 64) 23 if (npt->src_pfx_len > 64 || npt->dst_pfx_len > 64)
43 return -EINVAL; 24 return -EINVAL;
44 25
45 for (i = 0; i < ARRAY_SIZE(npt->src_pfx.in6.s6_addr16); i++) { 26 for (i = 0; i < ARRAY_SIZE(npt->src_pfx.in6.s6_addr16); i++) {
46 src_sum = csum16_add(src_sum, 27 src_sum = csum_add(src_sum,
47 (__force __sum16)npt->src_pfx.in6.s6_addr16[i]); 28 (__force __wsum)npt->src_pfx.in6.s6_addr16[i]);
48 dst_sum = csum16_add(dst_sum, 29 dst_sum = csum_add(dst_sum,
49 (__force __sum16)npt->dst_pfx.in6.s6_addr16[i]); 30 (__force __wsum)npt->dst_pfx.in6.s6_addr16[i]);
50 } 31 }
51 32
52 npt->adjustment = csum16_sub(src_sum, dst_sum); 33 npt->adjustment = (__force __sum16) csum_sub(src_sum, dst_sum);
53 return 0; 34 return 0;
54} 35}
55 36
@@ -85,7 +66,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
85 return false; 66 return false;
86 } 67 }
87 68
88 sum = csum16_add((__force __sum16)addr->s6_addr16[idx], 69 sum = (__force __sum16) csum_add((__force __wsum)addr->s6_addr16[idx],
89 npt->adjustment); 70 npt->adjustment);
90 if (sum == CSUM_MANGLED_0) 71 if (sum == CSUM_MANGLED_0)
91 sum = 0; 72 sum = 0;
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index fd4fb34c51c..029623dbd41 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -132,6 +132,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
132 ip6h->saddr = oip6h->daddr; 132 ip6h->saddr = oip6h->daddr;
133 ip6h->daddr = oip6h->saddr; 133 ip6h->daddr = oip6h->saddr;
134 134
135 skb_reset_transport_header(nskb);
135 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); 136 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
136 /* Truncate to length (no data) */ 137 /* Truncate to length (no data) */
137 tcph->doff = sizeof(struct tcphdr)/4; 138 tcph->doff = sizeof(struct tcphdr)/4;
diff --git a/net/ipv6/netfilter/ip6table_nat.c b/net/ipv6/netfilter/ip6table_nat.c
index 6c8ae24b85e..e0e788d25b1 100644
--- a/net/ipv6/netfilter/ip6table_nat.c
+++ b/net/ipv6/netfilter/ip6table_nat.c
@@ -127,23 +127,28 @@ nf_nat_ipv6_fn(unsigned int hooknum,
127 ret = nf_nat_rule_find(skb, hooknum, in, out, ct); 127 ret = nf_nat_rule_find(skb, hooknum, in, out, ct);
128 if (ret != NF_ACCEPT) 128 if (ret != NF_ACCEPT)
129 return ret; 129 return ret;
130 } else 130 } else {
131 pr_debug("Already setup manip %s for ct %p\n", 131 pr_debug("Already setup manip %s for ct %p\n",
132 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST", 132 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST",
133 ct); 133 ct);
134 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
135 goto oif_changed;
136 }
134 break; 137 break;
135 138
136 default: 139 default:
137 /* ESTABLISHED */ 140 /* ESTABLISHED */
138 NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED || 141 NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED ||
139 ctinfo == IP_CT_ESTABLISHED_REPLY); 142 ctinfo == IP_CT_ESTABLISHED_REPLY);
140 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) { 143 if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
141 nf_ct_kill_acct(ct, ctinfo, skb); 144 goto oif_changed;
142 return NF_DROP;
143 }
144 } 145 }
145 146
146 return nf_nat_packet(ct, ctinfo, hooknum, skb); 147 return nf_nat_packet(ct, ctinfo, hooknum, skb);
148
149oif_changed:
150 nf_ct_kill_acct(ct, ctinfo, skb);
151 return NF_DROP;
147} 152}
148 153
149static unsigned int 154static unsigned int
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 00ee17c3e89..137e245860a 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -81,8 +81,8 @@ static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff,
81 } 81 }
82 protoff = ipv6_skip_exthdr(skb, extoff, &nexthdr, &frag_off); 82 protoff = ipv6_skip_exthdr(skb, extoff, &nexthdr, &frag_off);
83 /* 83 /*
84 * (protoff == skb->len) mean that the packet doesn't have no data 84 * (protoff == skb->len) means the packet has not data, just
85 * except of IPv6 & ext headers. but it's tracked anyway. - YK 85 * IPv6 and possibly extensions headers, but it is tracked anyway
86 */ 86 */
87 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) { 87 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) {
88 pr_debug("ip6_conntrack_core: can't find proto in pkt\n"); 88 pr_debug("ip6_conntrack_core: can't find proto in pkt\n");
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 22c8ea95118..3dacecc9906 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -311,7 +311,10 @@ found:
311 else 311 else
312 fq->q.fragments = skb; 312 fq->q.fragments = skb;
313 313
314 skb->dev = NULL; 314 if (skb->dev) {
315 fq->iif = skb->dev->ifindex;
316 skb->dev = NULL;
317 }
315 fq->q.stamp = skb->tstamp; 318 fq->q.stamp = skb->tstamp;
316 fq->q.meat += skb->len; 319 fq->q.meat += skb->len;
317 if (payload_len > fq->q.max_size) 320 if (payload_len > fq->q.max_size)
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 3ad1f9db5f8..df082508362 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -1806,7 +1806,7 @@ static void iucv_external_interrupt(struct ext_code ext_code,
1806 struct iucv_irq_data *p; 1806 struct iucv_irq_data *p;
1807 struct iucv_irq_list *work; 1807 struct iucv_irq_list *work;
1808 1808
1809 kstat_cpu(smp_processor_id()).irqs[EXTINT_IUC]++; 1809 inc_irq_stat(IRQEXT_IUC);
1810 p = iucv_irq_data[smp_processor_id()]; 1810 p = iucv_irq_data[smp_processor_id()];
1811 if (p->ippathid >= iucv_max_pathid) { 1811 if (p->ippathid >= iucv_max_pathid) {
1812 WARN_ON(p->ippathid >= iucv_max_pathid); 1812 WARN_ON(p->ippathid >= iucv_max_pathid);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5c61677487c..47e0aca614b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1009,6 +1009,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
1009 if (old_probe_resp) 1009 if (old_probe_resp)
1010 kfree_rcu(old_probe_resp, rcu_head); 1010 kfree_rcu(old_probe_resp, rcu_head);
1011 1011
1012 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
1013 sta_info_flush(local, vlan);
1012 sta_info_flush(local, sdata); 1014 sta_info_flush(local, sdata);
1013 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); 1015 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
1014 1016
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 53f03120db5..80e55527504 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -4,6 +4,7 @@
4 4
5#include <linux/nl80211.h> 5#include <linux/nl80211.h>
6#include <linux/export.h> 6#include <linux/export.h>
7#include <linux/rtnetlink.h>
7#include <net/cfg80211.h> 8#include <net/cfg80211.h>
8#include "ieee80211_i.h" 9#include "ieee80211_i.h"
9#include "driver-ops.h" 10#include "driver-ops.h"
@@ -197,6 +198,15 @@ static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
197 198
198 ctx = container_of(conf, struct ieee80211_chanctx, conf); 199 ctx = container_of(conf, struct ieee80211_chanctx, conf);
199 200
201 if (sdata->vif.type == NL80211_IFTYPE_AP) {
202 struct ieee80211_sub_if_data *vlan;
203
204 /* for the VLAN list */
205 ASSERT_RTNL();
206 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
207 rcu_assign_pointer(vlan->vif.chanctx_conf, NULL);
208 }
209
200 ieee80211_unassign_vif_chanctx(sdata, ctx); 210 ieee80211_unassign_vif_chanctx(sdata, ctx);
201 if (ctx->refcount == 0) 211 if (ctx->refcount == 0)
202 ieee80211_free_chanctx(local, ctx); 212 ieee80211_free_chanctx(local, ctx);
@@ -316,6 +326,15 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
316 goto out; 326 goto out;
317 } 327 }
318 328
329 if (sdata->vif.type == NL80211_IFTYPE_AP) {
330 struct ieee80211_sub_if_data *vlan;
331
332 /* for the VLAN list */
333 ASSERT_RTNL();
334 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
335 rcu_assign_pointer(vlan->vif.chanctx_conf, &ctx->conf);
336 }
337
319 ieee80211_recalc_smps_chanctx(local, ctx); 338 ieee80211_recalc_smps_chanctx(local, ctx);
320 out: 339 out:
321 mutex_unlock(&local->chanctx_mtx); 340 mutex_unlock(&local->chanctx_mtx);
@@ -331,6 +350,25 @@ void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
331 mutex_unlock(&sdata->local->chanctx_mtx); 350 mutex_unlock(&sdata->local->chanctx_mtx);
332} 351}
333 352
353void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata)
354{
355 struct ieee80211_local *local = sdata->local;
356 struct ieee80211_sub_if_data *ap;
357 struct ieee80211_chanctx_conf *conf;
358
359 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->bss))
360 return;
361
362 ap = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
363
364 mutex_lock(&local->chanctx_mtx);
365
366 conf = rcu_dereference_protected(ap->vif.chanctx_conf,
367 lockdep_is_held(&local->chanctx_mtx));
368 rcu_assign_pointer(sdata->vif.chanctx_conf, conf);
369 mutex_unlock(&local->chanctx_mtx);
370}
371
334void ieee80211_iter_chan_contexts_atomic( 372void ieee80211_iter_chan_contexts_atomic(
335 struct ieee80211_hw *hw, 373 struct ieee80211_hw *hw,
336 void (*iter)(struct ieee80211_hw *hw, 374 void (*iter)(struct ieee80211_hw *hw,
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 8881fc77fb1..6b7644e818d 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -703,8 +703,8 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
703 sdata_info(sdata, 703 sdata_info(sdata,
704 "No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n"); 704 "No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n");
705 705
706 ieee80211_request_internal_scan(sdata, 706 ieee80211_request_ibss_scan(sdata, ifibss->ssid, ifibss->ssid_len,
707 ifibss->ssid, ifibss->ssid_len, NULL); 707 NULL);
708} 708}
709 709
710static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) 710static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
@@ -802,9 +802,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
802 IEEE80211_SCAN_INTERVAL)) { 802 IEEE80211_SCAN_INTERVAL)) {
803 sdata_info(sdata, "Trigger new scan to find an IBSS to join\n"); 803 sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
804 804
805 ieee80211_request_internal_scan(sdata, 805 ieee80211_request_ibss_scan(sdata, ifibss->ssid,
806 ifibss->ssid, ifibss->ssid_len, 806 ifibss->ssid_len, chan);
807 ifibss->fixed_channel ? ifibss->channel : NULL);
808 } else { 807 } else {
809 int interval = IEEE80211_SCAN_INTERVAL; 808 int interval = IEEE80211_SCAN_INTERVAL;
810 809
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 42d0d026773..8563b9a5cac 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -92,8 +92,6 @@ struct ieee80211_bss {
92 92
93 u32 device_ts; 93 u32 device_ts;
94 94
95 u8 dtim_period;
96
97 bool wmm_used; 95 bool wmm_used;
98 bool uapsd_supported; 96 bool uapsd_supported;
99 97
@@ -140,7 +138,6 @@ enum ieee80211_bss_corrupt_data_flags {
140 138
141/** 139/**
142 * enum ieee80211_valid_data_flags - BSS valid data flags 140 * enum ieee80211_valid_data_flags - BSS valid data flags
143 * @IEEE80211_BSS_VALID_DTIM: DTIM data was gathered from non-corrupt IE
144 * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE 141 * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
145 * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE 142 * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
146 * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE 143 * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
@@ -151,7 +148,6 @@ enum ieee80211_bss_corrupt_data_flags {
151 * beacon/probe response. 148 * beacon/probe response.
152 */ 149 */
153enum ieee80211_bss_valid_data_flags { 150enum ieee80211_bss_valid_data_flags {
154 IEEE80211_BSS_VALID_DTIM = BIT(0),
155 IEEE80211_BSS_VALID_WMM = BIT(1), 151 IEEE80211_BSS_VALID_WMM = BIT(1),
156 IEEE80211_BSS_VALID_RATES = BIT(2), 152 IEEE80211_BSS_VALID_RATES = BIT(2),
157 IEEE80211_BSS_VALID_ERP = BIT(3) 153 IEEE80211_BSS_VALID_ERP = BIT(3)
@@ -440,6 +436,7 @@ struct ieee80211_if_managed {
440 unsigned long timers_running; /* used for quiesce/restart */ 436 unsigned long timers_running; /* used for quiesce/restart */
441 bool powersave; /* powersave requested for this iface */ 437 bool powersave; /* powersave requested for this iface */
442 bool broken_ap; /* AP is broken -- turn off powersave */ 438 bool broken_ap; /* AP is broken -- turn off powersave */
439 u8 dtim_period;
443 enum ieee80211_smps_mode req_smps, /* requested smps mode */ 440 enum ieee80211_smps_mode req_smps, /* requested smps mode */
444 driver_smps_mode; /* smps mode request */ 441 driver_smps_mode; /* smps mode request */
445 442
@@ -773,6 +770,10 @@ struct ieee80211_sub_if_data {
773 u32 mntr_flags; 770 u32 mntr_flags;
774 } u; 771 } u;
775 772
773 spinlock_t cleanup_stations_lock;
774 struct list_head cleanup_stations;
775 struct work_struct cleanup_stations_wk;
776
776#ifdef CONFIG_MAC80211_DEBUGFS 777#ifdef CONFIG_MAC80211_DEBUGFS
777 struct { 778 struct {
778 struct dentry *dir; 779 struct dentry *dir;
@@ -1329,9 +1330,9 @@ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
1329 1330
1330/* scan/BSS handling */ 1331/* scan/BSS handling */
1331void ieee80211_scan_work(struct work_struct *work); 1332void ieee80211_scan_work(struct work_struct *work);
1332int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, 1333int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
1333 const u8 *ssid, u8 ssid_len, 1334 const u8 *ssid, u8 ssid_len,
1334 struct ieee80211_channel *chan); 1335 struct ieee80211_channel *chan);
1335int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, 1336int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
1336 struct cfg80211_scan_request *req); 1337 struct cfg80211_scan_request *req);
1337void ieee80211_scan_cancel(struct ieee80211_local *local); 1338void ieee80211_scan_cancel(struct ieee80211_local *local);
@@ -1628,6 +1629,7 @@ ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
1628 const struct cfg80211_chan_def *chandef, 1629 const struct cfg80211_chan_def *chandef,
1629 enum ieee80211_chanctx_mode mode); 1630 enum ieee80211_chanctx_mode mode);
1630void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata); 1631void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
1632void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
1631 1633
1632void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, 1634void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
1633 struct ieee80211_chanctx *chanctx); 1635 struct ieee80211_chanctx *chanctx);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 09a80b55cf5..8be854e86cd 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -207,17 +207,8 @@ void ieee80211_recalc_idle(struct ieee80211_local *local)
207 207
208static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) 208static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
209{ 209{
210 int meshhdrlen; 210 if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN)
211 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
212
213 meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0;
214
215 /* FIX: what would be proper limits for MTU?
216 * This interface uses 802.3 frames. */
217 if (new_mtu < 256 ||
218 new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
219 return -EINVAL; 211 return -EINVAL;
220 }
221 212
222 dev->mtu = new_mtu; 213 dev->mtu = new_mtu;
223 return 0; 214 return 0;
@@ -586,11 +577,13 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
586 577
587 switch (sdata->vif.type) { 578 switch (sdata->vif.type) {
588 case NL80211_IFTYPE_AP_VLAN: 579 case NL80211_IFTYPE_AP_VLAN:
589 /* no need to tell driver, but set carrier */ 580 /* no need to tell driver, but set carrier and chanctx */
590 if (rtnl_dereference(sdata->bss->beacon)) 581 if (rtnl_dereference(sdata->bss->beacon)) {
582 ieee80211_vif_vlan_copy_chanctx(sdata);
591 netif_carrier_on(dev); 583 netif_carrier_on(dev);
592 else 584 } else {
593 netif_carrier_off(dev); 585 netif_carrier_off(dev);
586 }
594 break; 587 break;
595 case NL80211_IFTYPE_MONITOR: 588 case NL80211_IFTYPE_MONITOR:
596 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { 589 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) {
@@ -839,6 +832,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
839 switch (sdata->vif.type) { 832 switch (sdata->vif.type) {
840 case NL80211_IFTYPE_AP_VLAN: 833 case NL80211_IFTYPE_AP_VLAN:
841 list_del(&sdata->u.vlan.list); 834 list_del(&sdata->u.vlan.list);
835 rcu_assign_pointer(sdata->vif.chanctx_conf, NULL);
842 /* no need to tell driver */ 836 /* no need to tell driver */
843 break; 837 break;
844 case NL80211_IFTYPE_MONITOR: 838 case NL80211_IFTYPE_MONITOR:
@@ -865,20 +859,11 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
865 cancel_work_sync(&sdata->work); 859 cancel_work_sync(&sdata->work);
866 /* 860 /*
867 * When we get here, the interface is marked down. 861 * When we get here, the interface is marked down.
868 * Call rcu_barrier() to wait both for the RX path 862 * Call synchronize_rcu() to wait for the RX path
869 * should it be using the interface and enqueuing 863 * should it be using the interface and enqueuing
870 * frames at this very time on another CPU, and 864 * frames at this very time on another CPU.
871 * for the sta free call_rcu callbacks.
872 */
873 rcu_barrier();
874
875 /*
876 * free_sta_rcu() enqueues a work for the actual
877 * sta cleanup, so we need to flush it while
878 * sdata is still valid.
879 */ 865 */
880 flush_workqueue(local->workqueue); 866 synchronize_rcu();
881
882 skb_queue_purge(&sdata->skb_queue); 867 skb_queue_purge(&sdata->skb_queue);
883 868
884 /* 869 /*
@@ -1498,6 +1483,15 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
1498 mutex_unlock(&local->iflist_mtx); 1483 mutex_unlock(&local->iflist_mtx);
1499} 1484}
1500 1485
1486static void ieee80211_cleanup_sdata_stas_wk(struct work_struct *wk)
1487{
1488 struct ieee80211_sub_if_data *sdata;
1489
1490 sdata = container_of(wk, struct ieee80211_sub_if_data, cleanup_stations_wk);
1491
1492 ieee80211_cleanup_sdata_stas(sdata);
1493}
1494
1501int ieee80211_if_add(struct ieee80211_local *local, const char *name, 1495int ieee80211_if_add(struct ieee80211_local *local, const char *name,
1502 struct wireless_dev **new_wdev, enum nl80211_iftype type, 1496 struct wireless_dev **new_wdev, enum nl80211_iftype type,
1503 struct vif_params *params) 1497 struct vif_params *params)
@@ -1573,6 +1567,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
1573 1567
1574 INIT_LIST_HEAD(&sdata->key_list); 1568 INIT_LIST_HEAD(&sdata->key_list);
1575 1569
1570 spin_lock_init(&sdata->cleanup_stations_lock);
1571 INIT_LIST_HEAD(&sdata->cleanup_stations);
1572 INIT_WORK(&sdata->cleanup_stations_wk, ieee80211_cleanup_sdata_stas_wk);
1573
1576 for (i = 0; i < IEEE80211_NUM_BANDS; i++) { 1574 for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
1577 struct ieee80211_supported_band *sband; 1575 struct ieee80211_supported_band *sband;
1578 sband = local->hw.wiphy->bands[i]; 1576 sband = local->hw.wiphy->bands[i];
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 1bf03f9ff3b..649ad513547 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -163,7 +163,7 @@ int mesh_rmc_init(struct ieee80211_sub_if_data *sdata)
163 return -ENOMEM; 163 return -ENOMEM;
164 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; 164 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1;
165 for (i = 0; i < RMC_BUCKETS; i++) 165 for (i = 0; i < RMC_BUCKETS; i++)
166 INIT_LIST_HEAD(&sdata->u.mesh.rmc->bucket[i].list); 166 INIT_LIST_HEAD(&sdata->u.mesh.rmc->bucket[i]);
167 return 0; 167 return 0;
168} 168}
169 169
@@ -177,7 +177,7 @@ void mesh_rmc_free(struct ieee80211_sub_if_data *sdata)
177 return; 177 return;
178 178
179 for (i = 0; i < RMC_BUCKETS; i++) 179 for (i = 0; i < RMC_BUCKETS; i++)
180 list_for_each_entry_safe(p, n, &rmc->bucket[i].list, list) { 180 list_for_each_entry_safe(p, n, &rmc->bucket[i], list) {
181 list_del(&p->list); 181 list_del(&p->list);
182 kmem_cache_free(rm_cache, p); 182 kmem_cache_free(rm_cache, p);
183 } 183 }
@@ -210,7 +210,7 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
210 /* Don't care about endianness since only match matters */ 210 /* Don't care about endianness since only match matters */
211 memcpy(&seqnum, &mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum)); 211 memcpy(&seqnum, &mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum));
212 idx = le32_to_cpu(mesh_hdr->seqnum) & rmc->idx_mask; 212 idx = le32_to_cpu(mesh_hdr->seqnum) & rmc->idx_mask;
213 list_for_each_entry_safe(p, n, &rmc->bucket[idx].list, list) { 213 list_for_each_entry_safe(p, n, &rmc->bucket[idx], list) {
214 ++entries; 214 ++entries;
215 if (time_after(jiffies, p->exp_time) || 215 if (time_after(jiffies, p->exp_time) ||
216 (entries == RMC_QUEUE_MAX_LEN)) { 216 (entries == RMC_QUEUE_MAX_LEN)) {
@@ -229,7 +229,7 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
229 p->seqnum = seqnum; 229 p->seqnum = seqnum;
230 p->exp_time = jiffies + RMC_TIMEOUT; 230 p->exp_time = jiffies + RMC_TIMEOUT;
231 memcpy(p->sa, sa, ETH_ALEN); 231 memcpy(p->sa, sa, ETH_ALEN);
232 list_add(&p->list, &rmc->bucket[idx].list); 232 list_add(&p->list, &rmc->bucket[idx]);
233 return 0; 233 return 0;
234} 234}
235 235
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 7c9215fb2ac..84c28c6101c 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -184,7 +184,7 @@ struct rmc_entry {
184}; 184};
185 185
186struct mesh_rmc { 186struct mesh_rmc {
187 struct rmc_entry bucket[RMC_BUCKETS]; 187 struct list_head bucket[RMC_BUCKETS];
188 u32 idx_mask; 188 u32 idx_mask;
189}; 189};
190 190
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7753a9ca98a..a3552929a21 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1074,12 +1074,8 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
1074 if (beaconint_us > latency) { 1074 if (beaconint_us > latency) {
1075 local->ps_sdata = NULL; 1075 local->ps_sdata = NULL;
1076 } else { 1076 } else {
1077 struct ieee80211_bss *bss;
1078 int maxslp = 1; 1077 int maxslp = 1;
1079 u8 dtimper; 1078 u8 dtimper = found->u.mgd.dtim_period;
1080
1081 bss = (void *)found->u.mgd.associated->priv;
1082 dtimper = bss->dtim_period;
1083 1079
1084 /* If the TIM IE is invalid, pretend the value is 1 */ 1080 /* If the TIM IE is invalid, pretend the value is 1 */
1085 if (!dtimper) 1081 if (!dtimper)
@@ -1410,10 +1406,17 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1410 1406
1411 ieee80211_led_assoc(local, 1); 1407 ieee80211_led_assoc(local, 1);
1412 1408
1413 if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) 1409 if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) {
1414 bss_conf->dtim_period = bss->dtim_period; 1410 /*
1415 else 1411 * If the AP is buggy we may get here with no DTIM period
1412 * known, so assume it's 1 which is the only safe assumption
1413 * in that case, although if the TIM IE is broken powersave
1414 * probably just won't work at all.
1415 */
1416 bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1;
1417 } else {
1416 bss_conf->dtim_period = 0; 1418 bss_conf->dtim_period = 0;
1419 }
1417 1420
1418 bss_conf->assoc = 1; 1421 bss_conf->assoc = 1;
1419 1422
@@ -1562,6 +1565,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1562 1565
1563 sdata->u.mgd.timers_running = 0; 1566 sdata->u.mgd.timers_running = 0;
1564 1567
1568 sdata->vif.bss_conf.dtim_period = 0;
1569
1565 ifmgd->flags = 0; 1570 ifmgd->flags = 0;
1566 ieee80211_vif_release_channel(sdata); 1571 ieee80211_vif_release_channel(sdata);
1567} 1572}
@@ -2373,11 +2378,18 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2373 struct ieee80211_channel *channel; 2378 struct ieee80211_channel *channel;
2374 bool need_ps = false; 2379 bool need_ps = false;
2375 2380
2376 if (sdata->u.mgd.associated && 2381 if ((sdata->u.mgd.associated &&
2377 ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) { 2382 ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) ||
2378 bss = (void *)sdata->u.mgd.associated->priv; 2383 (sdata->u.mgd.assoc_data &&
2384 ether_addr_equal(mgmt->bssid,
2385 sdata->u.mgd.assoc_data->bss->bssid))) {
2379 /* not previously set so we may need to recalc */ 2386 /* not previously set so we may need to recalc */
2380 need_ps = !bss->dtim_period; 2387 need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period;
2388
2389 if (elems->tim && !elems->parse_error) {
2390 struct ieee80211_tim_ie *tim_ie = elems->tim;
2391 sdata->u.mgd.dtim_period = tim_ie->dtim_period;
2392 }
2381 } 2393 }
2382 2394
2383 if (elems->ds_params && elems->ds_params_len == 1) 2395 if (elems->ds_params && elems->ds_params_len == 1)
@@ -3896,20 +3908,41 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3896 /* kick off associate process */ 3908 /* kick off associate process */
3897 3909
3898 ifmgd->assoc_data = assoc_data; 3910 ifmgd->assoc_data = assoc_data;
3911 ifmgd->dtim_period = 0;
3899 3912
3900 err = ieee80211_prep_connection(sdata, req->bss, true); 3913 err = ieee80211_prep_connection(sdata, req->bss, true);
3901 if (err) 3914 if (err)
3902 goto err_clear; 3915 goto err_clear;
3903 3916
3904 if (!bss->dtim_period && 3917 if (sdata->local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) {
3905 sdata->local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) { 3918 const struct cfg80211_bss_ies *beacon_ies;
3906 /* 3919
3907 * Wait up to one beacon interval ... 3920 rcu_read_lock();
3908 * should this be more if we miss one? 3921 beacon_ies = rcu_dereference(req->bss->beacon_ies);
3909 */ 3922 if (!beacon_ies) {
3910 sdata_info(sdata, "waiting for beacon from %pM\n", 3923 /*
3911 ifmgd->bssid); 3924 * Wait up to one beacon interval ...
3912 assoc_data->timeout = TU_TO_EXP_TIME(req->bss->beacon_interval); 3925 * should this be more if we miss one?
3926 */
3927 sdata_info(sdata, "waiting for beacon from %pM\n",
3928 ifmgd->bssid);
3929 assoc_data->timeout =
3930 TU_TO_EXP_TIME(req->bss->beacon_interval);
3931 } else {
3932 const u8 *tim_ie = cfg80211_find_ie(WLAN_EID_TIM,
3933 beacon_ies->data,
3934 beacon_ies->len);
3935 if (tim_ie && tim_ie[1] >=
3936 sizeof(struct ieee80211_tim_ie)) {
3937 const struct ieee80211_tim_ie *tim;
3938 tim = (void *)(tim_ie + 2);
3939 ifmgd->dtim_period = tim->dtim_period;
3940 }
3941 assoc_data->have_beacon = true;
3942 assoc_data->sent_assoc = false;
3943 assoc_data->timeout = jiffies;
3944 }
3945 rcu_read_unlock();
3913 } else { 3946 } else {
3914 assoc_data->have_beacon = true; 3947 assoc_data->have_beacon = true;
3915 assoc_data->sent_assoc = false; 3948 assoc_data->sent_assoc = false;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 8ed83dcc149..d59fc6818b1 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -113,18 +113,6 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
113 bss->valid_data |= IEEE80211_BSS_VALID_ERP; 113 bss->valid_data |= IEEE80211_BSS_VALID_ERP;
114 } 114 }
115 115
116 if (elems->tim && (!elems->parse_error ||
117 !(bss->valid_data & IEEE80211_BSS_VALID_DTIM))) {
118 struct ieee80211_tim_ie *tim_ie = elems->tim;
119 bss->dtim_period = tim_ie->dtim_period;
120 if (!elems->parse_error)
121 bss->valid_data |= IEEE80211_BSS_VALID_DTIM;
122 }
123
124 /* If the beacon had no TIM IE, or it was invalid, use 1 */
125 if (beacon && !bss->dtim_period)
126 bss->dtim_period = 1;
127
128 /* replace old supported rates if we get new values */ 116 /* replace old supported rates if we get new values */
129 if (!elems->parse_error || 117 if (!elems->parse_error ||
130 !(bss->valid_data & IEEE80211_BSS_VALID_RATES)) { 118 !(bss->valid_data & IEEE80211_BSS_VALID_RATES)) {
@@ -832,9 +820,9 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
832 return res; 820 return res;
833} 821}
834 822
835int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, 823int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
836 const u8 *ssid, u8 ssid_len, 824 const u8 *ssid, u8 ssid_len,
837 struct ieee80211_channel *chan) 825 struct ieee80211_channel *chan)
838{ 826{
839 struct ieee80211_local *local = sdata->local; 827 struct ieee80211_local *local = sdata->local;
840 int ret = -EBUSY; 828 int ret = -EBUSY;
@@ -848,22 +836,36 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata,
848 836
849 /* fill internal scan request */ 837 /* fill internal scan request */
850 if (!chan) { 838 if (!chan) {
851 int i, nchan = 0; 839 int i, max_n;
840 int n_ch = 0;
852 841
853 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 842 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
854 if (!local->hw.wiphy->bands[band]) 843 if (!local->hw.wiphy->bands[band])
855 continue; 844 continue;
856 for (i = 0; 845
857 i < local->hw.wiphy->bands[band]->n_channels; 846 max_n = local->hw.wiphy->bands[band]->n_channels;
858 i++) { 847 for (i = 0; i < max_n; i++) {
859 local->int_scan_req->channels[nchan] = 848 struct ieee80211_channel *tmp_ch =
860 &local->hw.wiphy->bands[band]->channels[i]; 849 &local->hw.wiphy->bands[band]->channels[i];
861 nchan++; 850
851 if (tmp_ch->flags & (IEEE80211_CHAN_NO_IBSS |
852 IEEE80211_CHAN_DISABLED))
853 continue;
854
855 local->int_scan_req->channels[n_ch] = tmp_ch;
856 n_ch++;
862 } 857 }
863 } 858 }
864 859
865 local->int_scan_req->n_channels = nchan; 860 if (WARN_ON_ONCE(n_ch == 0))
861 goto unlock;
862
863 local->int_scan_req->n_channels = n_ch;
866 } else { 864 } else {
865 if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IBSS |
866 IEEE80211_CHAN_DISABLED)))
867 goto unlock;
868
867 local->int_scan_req->channels[0] = chan; 869 local->int_scan_req->channels[0] = chan;
868 local->int_scan_req->n_channels = 1; 870 local->int_scan_req->n_channels = 1;
869 } 871 }
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f3e502502fe..ca9fde19818 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -91,9 +91,8 @@ static int sta_info_hash_del(struct ieee80211_local *local,
91 return -ENOENT; 91 return -ENOENT;
92} 92}
93 93
94static void free_sta_work(struct work_struct *wk) 94static void cleanup_single_sta(struct sta_info *sta)
95{ 95{
96 struct sta_info *sta = container_of(wk, struct sta_info, free_sta_wk);
97 int ac, i; 96 int ac, i;
98 struct tid_ampdu_tx *tid_tx; 97 struct tid_ampdu_tx *tid_tx;
99 struct ieee80211_sub_if_data *sdata = sta->sdata; 98 struct ieee80211_sub_if_data *sdata = sta->sdata;
@@ -153,11 +152,35 @@ static void free_sta_work(struct work_struct *wk)
153 sta_info_free(local, sta); 152 sta_info_free(local, sta);
154} 153}
155 154
155void ieee80211_cleanup_sdata_stas(struct ieee80211_sub_if_data *sdata)
156{
157 struct sta_info *sta;
158
159 spin_lock_bh(&sdata->cleanup_stations_lock);
160 while (!list_empty(&sdata->cleanup_stations)) {
161 sta = list_first_entry(&sdata->cleanup_stations,
162 struct sta_info, list);
163 list_del(&sta->list);
164 spin_unlock_bh(&sdata->cleanup_stations_lock);
165
166 cleanup_single_sta(sta);
167
168 spin_lock_bh(&sdata->cleanup_stations_lock);
169 }
170
171 spin_unlock_bh(&sdata->cleanup_stations_lock);
172}
173
156static void free_sta_rcu(struct rcu_head *h) 174static void free_sta_rcu(struct rcu_head *h)
157{ 175{
158 struct sta_info *sta = container_of(h, struct sta_info, rcu_head); 176 struct sta_info *sta = container_of(h, struct sta_info, rcu_head);
177 struct ieee80211_sub_if_data *sdata = sta->sdata;
159 178
160 ieee80211_queue_work(&sta->local->hw, &sta->free_sta_wk); 179 spin_lock(&sdata->cleanup_stations_lock);
180 list_add_tail(&sta->list, &sdata->cleanup_stations);
181 spin_unlock(&sdata->cleanup_stations_lock);
182
183 ieee80211_queue_work(&sdata->local->hw, &sdata->cleanup_stations_wk);
161} 184}
162 185
163/* protected by RCU */ 186/* protected by RCU */
@@ -310,7 +333,6 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
310 333
311 spin_lock_init(&sta->lock); 334 spin_lock_init(&sta->lock);
312 INIT_WORK(&sta->drv_unblock_wk, sta_unblock); 335 INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
313 INIT_WORK(&sta->free_sta_wk, free_sta_work);
314 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); 336 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
315 mutex_init(&sta->ampdu_mlme.mtx); 337 mutex_init(&sta->ampdu_mlme.mtx);
316 338
@@ -862,7 +884,7 @@ void sta_info_init(struct ieee80211_local *local)
862 884
863void sta_info_stop(struct ieee80211_local *local) 885void sta_info_stop(struct ieee80211_local *local)
864{ 886{
865 del_timer(&local->sta_cleanup); 887 del_timer_sync(&local->sta_cleanup);
866 sta_info_flush(local, NULL); 888 sta_info_flush(local, NULL);
867} 889}
868 890
@@ -891,6 +913,20 @@ int sta_info_flush(struct ieee80211_local *local,
891 } 913 }
892 mutex_unlock(&local->sta_mtx); 914 mutex_unlock(&local->sta_mtx);
893 915
916 rcu_barrier();
917
918 if (sdata) {
919 ieee80211_cleanup_sdata_stas(sdata);
920 cancel_work_sync(&sdata->cleanup_stations_wk);
921 } else {
922 mutex_lock(&local->iflist_mtx);
923 list_for_each_entry(sdata, &local->interfaces, list) {
924 ieee80211_cleanup_sdata_stas(sdata);
925 cancel_work_sync(&sdata->cleanup_stations_wk);
926 }
927 mutex_unlock(&local->iflist_mtx);
928 }
929
894 return ret; 930 return ret;
895} 931}
896 932
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 1489bca9ea9..37c1889afd3 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -299,7 +299,6 @@ struct sta_info {
299 spinlock_t lock; 299 spinlock_t lock;
300 300
301 struct work_struct drv_unblock_wk; 301 struct work_struct drv_unblock_wk;
302 struct work_struct free_sta_wk;
303 302
304 u16 listen_interval; 303 u16 listen_interval;
305 304
@@ -563,4 +562,6 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta);
563void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta); 562void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta);
564void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta); 563void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta);
565 564
565void ieee80211_cleanup_sdata_stas(struct ieee80211_sub_if_data *sdata);
566
566#endif /* STA_INFO_H */ 567#endif /* STA_INFO_H */
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index 1191039c2b1..199b92261e9 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -389,7 +389,7 @@ void mac802154_wpan_setup(struct net_device *dev)
389 389
390static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb) 390static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb)
391{ 391{
392 return netif_rx(skb); 392 return netif_rx_ni(skb);
393} 393}
394 394
395static int 395static int
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index fefa514b991..49e96df5fbc 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -680,6 +680,13 @@ config NETFILTER_XT_TARGET_NFQUEUE
680 680
681 To compile it as a module, choose M here. If unsure, say N. 681 To compile it as a module, choose M here. If unsure, say N.
682 682
683config NETFILTER_XT_TARGET_NOTRACK
684 tristate '"NOTRACK" target support (DEPRECATED)'
685 depends on NF_CONNTRACK
686 depends on IP_NF_RAW || IP6_NF_RAW
687 depends on NETFILTER_ADVANCED
688 select NETFILTER_XT_TARGET_CT
689
683config NETFILTER_XT_TARGET_RATEEST 690config NETFILTER_XT_TARGET_RATEEST
684 tristate '"RATEEST" target support' 691 tristate '"RATEEST" target support'
685 depends on NETFILTER_ADVANCED 692 depends on NETFILTER_ADVANCED
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 08cdc71d8e8..016d95ead93 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1526,6 +1526,7 @@ err_extend:
1526 */ 1526 */
1527#define UNCONFIRMED_NULLS_VAL ((1<<30)+0) 1527#define UNCONFIRMED_NULLS_VAL ((1<<30)+0)
1528#define DYING_NULLS_VAL ((1<<30)+1) 1528#define DYING_NULLS_VAL ((1<<30)+1)
1529#define TEMPLATE_NULLS_VAL ((1<<30)+2)
1529 1530
1530static int nf_conntrack_init_net(struct net *net) 1531static int nf_conntrack_init_net(struct net *net)
1531{ 1532{
@@ -1534,6 +1535,7 @@ static int nf_conntrack_init_net(struct net *net)
1534 atomic_set(&net->ct.count, 0); 1535 atomic_set(&net->ct.count, 0);
1535 INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, UNCONFIRMED_NULLS_VAL); 1536 INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, UNCONFIRMED_NULLS_VAL);
1536 INIT_HLIST_NULLS_HEAD(&net->ct.dying, DYING_NULLS_VAL); 1537 INIT_HLIST_NULLS_HEAD(&net->ct.dying, DYING_NULLS_VAL);
1538 INIT_HLIST_NULLS_HEAD(&net->ct.tmpl, TEMPLATE_NULLS_VAL);
1537 net->ct.stat = alloc_percpu(struct ip_conntrack_stat); 1539 net->ct.stat = alloc_percpu(struct ip_conntrack_stat);
1538 if (!net->ct.stat) { 1540 if (!net->ct.stat) {
1539 ret = -ENOMEM; 1541 ret = -ENOMEM;
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 4e078cd84d8..627b0e50b23 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2624,7 +2624,7 @@ ctnetlink_create_expect(struct net *net, u16 zone,
2624 if (!help) { 2624 if (!help) {
2625 if (!cda[CTA_EXPECT_TIMEOUT]) { 2625 if (!cda[CTA_EXPECT_TIMEOUT]) {
2626 err = -EINVAL; 2626 err = -EINVAL;
2627 goto out; 2627 goto err_out;
2628 } 2628 }
2629 exp->timeout.expires = 2629 exp->timeout.expires =
2630 jiffies + ntohl(nla_get_be32(cda[CTA_EXPECT_TIMEOUT])) * HZ; 2630 jiffies + ntohl(nla_get_be32(cda[CTA_EXPECT_TIMEOUT])) * HZ;
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 9f199f2e31f..92fd8eca0d3 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -13,6 +13,7 @@
13 */ 13 */
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/skbuff.h> 15#include <linux/skbuff.h>
16#include <linux/if_arp.h>
16#include <linux/init.h> 17#include <linux/init.h>
17#include <linux/ip.h> 18#include <linux/ip.h>
18#include <linux/ipv6.h> 19#include <linux/ipv6.h>
@@ -384,6 +385,7 @@ __build_packet_message(struct nfulnl_instance *inst,
384 struct nfgenmsg *nfmsg; 385 struct nfgenmsg *nfmsg;
385 sk_buff_data_t old_tail = inst->skb->tail; 386 sk_buff_data_t old_tail = inst->skb->tail;
386 struct sock *sk; 387 struct sock *sk;
388 const unsigned char *hwhdrp;
387 389
388 nlh = nlmsg_put(inst->skb, 0, 0, 390 nlh = nlmsg_put(inst->skb, 0, 0,
389 NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET, 391 NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET,
@@ -485,9 +487,17 @@ __build_packet_message(struct nfulnl_instance *inst,
485 if (indev && skb_mac_header_was_set(skb)) { 487 if (indev && skb_mac_header_was_set(skb)) {
486 if (nla_put_be16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) || 488 if (nla_put_be16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
487 nla_put_be16(inst->skb, NFULA_HWLEN, 489 nla_put_be16(inst->skb, NFULA_HWLEN,
488 htons(skb->dev->hard_header_len)) || 490 htons(skb->dev->hard_header_len)))
489 nla_put(inst->skb, NFULA_HWHEADER, skb->dev->hard_header_len, 491 goto nla_put_failure;
490 skb_mac_header(skb))) 492
493 hwhdrp = skb_mac_header(skb);
494
495 if (skb->dev->type == ARPHRD_SIT)
496 hwhdrp -= ETH_HLEN;
497
498 if (hwhdrp >= skb->head &&
499 nla_put(inst->skb, NFULA_HWHEADER,
500 skb->dev->hard_header_len, hwhdrp))
491 goto nla_put_failure; 501 goto nla_put_failure;
492 } 502 }
493 503
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index ae7f5daeee4..2a084308184 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -149,6 +149,10 @@ static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
149 149
150 __set_bit(IPS_TEMPLATE_BIT, &ct->status); 150 __set_bit(IPS_TEMPLATE_BIT, &ct->status);
151 __set_bit(IPS_CONFIRMED_BIT, &ct->status); 151 __set_bit(IPS_CONFIRMED_BIT, &ct->status);
152
153 /* Overload tuple linked list to put us in template list. */
154 hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
155 &par->net->ct.tmpl);
152out: 156out:
153 info->ct = ct; 157 info->ct = ct;
154 return 0; 158 return 0;
@@ -289,6 +293,10 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
289 293
290 __set_bit(IPS_TEMPLATE_BIT, &ct->status); 294 __set_bit(IPS_TEMPLATE_BIT, &ct->status);
291 __set_bit(IPS_CONFIRMED_BIT, &ct->status); 295 __set_bit(IPS_CONFIRMED_BIT, &ct->status);
296
297 /* Overload tuple linked list to put us in template list. */
298 hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
299 &par->net->ct.tmpl);
292out: 300out:
293 info->ct = ct; 301 info->ct = ct;
294 return 0; 302 return 0;
@@ -377,14 +385,60 @@ static struct xt_target xt_ct_tg_reg[] __read_mostly = {
377 }, 385 },
378}; 386};
379 387
388static unsigned int
389notrack_tg(struct sk_buff *skb, const struct xt_action_param *par)
390{
391 /* Previously seen (loopback)? Ignore. */
392 if (skb->nfct != NULL)
393 return XT_CONTINUE;
394
395 skb->nfct = &nf_ct_untracked_get()->ct_general;
396 skb->nfctinfo = IP_CT_NEW;
397 nf_conntrack_get(skb->nfct);
398
399 return XT_CONTINUE;
400}
401
402static int notrack_chk(const struct xt_tgchk_param *par)
403{
404 if (!par->net->xt.notrack_deprecated_warning) {
405 pr_info("netfilter: NOTRACK target is deprecated, "
406 "use CT instead or upgrade iptables\n");
407 par->net->xt.notrack_deprecated_warning = true;
408 }
409 return 0;
410}
411
412static struct xt_target notrack_tg_reg __read_mostly = {
413 .name = "NOTRACK",
414 .revision = 0,
415 .family = NFPROTO_UNSPEC,
416 .checkentry = notrack_chk,
417 .target = notrack_tg,
418 .table = "raw",
419 .me = THIS_MODULE,
420};
421
380static int __init xt_ct_tg_init(void) 422static int __init xt_ct_tg_init(void)
381{ 423{
382 return xt_register_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg)); 424 int ret;
425
426 ret = xt_register_target(&notrack_tg_reg);
427 if (ret < 0)
428 return ret;
429
430 ret = xt_register_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg));
431 if (ret < 0) {
432 xt_unregister_target(&notrack_tg_reg);
433 return ret;
434 }
435 return 0;
383} 436}
384 437
385static void __exit xt_ct_tg_exit(void) 438static void __exit xt_ct_tg_exit(void)
386{ 439{
387 xt_unregister_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg)); 440 xt_unregister_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg));
441 xt_unregister_target(&notrack_tg_reg);
388} 442}
389 443
390module_init(xt_ct_tg_init); 444module_init(xt_ct_tg_init);
@@ -394,3 +448,5 @@ MODULE_LICENSE("GPL");
394MODULE_DESCRIPTION("Xtables: connection tracking target"); 448MODULE_DESCRIPTION("Xtables: connection tracking target");
395MODULE_ALIAS("ipt_CT"); 449MODULE_ALIAS("ipt_CT");
396MODULE_ALIAS("ip6t_CT"); 450MODULE_ALIAS("ip6t_CT");
451MODULE_ALIAS("ipt_NOTRACK");
452MODULE_ALIAS("ip6t_NOTRACK");
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 26a668a84aa..a9d7af953ce 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -157,11 +157,22 @@ dsthash_find(const struct xt_hashlimit_htable *ht,
157/* allocate dsthash_ent, initialize dst, put in htable and lock it */ 157/* allocate dsthash_ent, initialize dst, put in htable and lock it */
158static struct dsthash_ent * 158static struct dsthash_ent *
159dsthash_alloc_init(struct xt_hashlimit_htable *ht, 159dsthash_alloc_init(struct xt_hashlimit_htable *ht,
160 const struct dsthash_dst *dst) 160 const struct dsthash_dst *dst, bool *race)
161{ 161{
162 struct dsthash_ent *ent; 162 struct dsthash_ent *ent;
163 163
164 spin_lock(&ht->lock); 164 spin_lock(&ht->lock);
165
166 /* Two or more packets may race to create the same entry in the
167 * hashtable, double check if this packet lost race.
168 */
169 ent = dsthash_find(ht, dst);
170 if (ent != NULL) {
171 spin_unlock(&ht->lock);
172 *race = true;
173 return ent;
174 }
175
165 /* initialize hash with random val at the time we allocate 176 /* initialize hash with random val at the time we allocate
166 * the first hashtable entry */ 177 * the first hashtable entry */
167 if (unlikely(!ht->rnd_initialized)) { 178 if (unlikely(!ht->rnd_initialized)) {
@@ -318,7 +329,10 @@ static void htable_destroy(struct xt_hashlimit_htable *hinfo)
318 parent = hashlimit_net->ipt_hashlimit; 329 parent = hashlimit_net->ipt_hashlimit;
319 else 330 else
320 parent = hashlimit_net->ip6t_hashlimit; 331 parent = hashlimit_net->ip6t_hashlimit;
321 remove_proc_entry(hinfo->pde->name, parent); 332
333 if(parent != NULL)
334 remove_proc_entry(hinfo->pde->name, parent);
335
322 htable_selective_cleanup(hinfo, select_all); 336 htable_selective_cleanup(hinfo, select_all);
323 vfree(hinfo); 337 vfree(hinfo);
324} 338}
@@ -585,6 +599,7 @@ hashlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
585 unsigned long now = jiffies; 599 unsigned long now = jiffies;
586 struct dsthash_ent *dh; 600 struct dsthash_ent *dh;
587 struct dsthash_dst dst; 601 struct dsthash_dst dst;
602 bool race = false;
588 u32 cost; 603 u32 cost;
589 604
590 if (hashlimit_init_dst(hinfo, &dst, skb, par->thoff) < 0) 605 if (hashlimit_init_dst(hinfo, &dst, skb, par->thoff) < 0)
@@ -593,13 +608,18 @@ hashlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
593 rcu_read_lock_bh(); 608 rcu_read_lock_bh();
594 dh = dsthash_find(hinfo, &dst); 609 dh = dsthash_find(hinfo, &dst);
595 if (dh == NULL) { 610 if (dh == NULL) {
596 dh = dsthash_alloc_init(hinfo, &dst); 611 dh = dsthash_alloc_init(hinfo, &dst, &race);
597 if (dh == NULL) { 612 if (dh == NULL) {
598 rcu_read_unlock_bh(); 613 rcu_read_unlock_bh();
599 goto hotdrop; 614 goto hotdrop;
615 } else if (race) {
616 /* Already got an entry, update expiration timeout */
617 dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
618 rateinfo_recalc(dh, now, hinfo->cfg.mode);
619 } else {
620 dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire);
621 rateinfo_init(dh, hinfo);
600 } 622 }
601 dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire);
602 rateinfo_init(dh, hinfo);
603 } else { 623 } else {
604 /* update expiration timeout */ 624 /* update expiration timeout */
605 dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire); 625 dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
@@ -856,6 +876,27 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
856 876
857static void __net_exit hashlimit_proc_net_exit(struct net *net) 877static void __net_exit hashlimit_proc_net_exit(struct net *net)
858{ 878{
879 struct xt_hashlimit_htable *hinfo;
880 struct hlist_node *pos;
881 struct proc_dir_entry *pde;
882 struct hashlimit_net *hashlimit_net = hashlimit_pernet(net);
883
884 /* recent_net_exit() is called before recent_mt_destroy(). Make sure
885 * that the parent xt_recent proc entry is is empty before trying to
886 * remove it.
887 */
888 mutex_lock(&hashlimit_mutex);
889 pde = hashlimit_net->ipt_hashlimit;
890 if (pde == NULL)
891 pde = hashlimit_net->ip6t_hashlimit;
892
893 hlist_for_each_entry(hinfo, pos, &hashlimit_net->htables, node)
894 remove_proc_entry(hinfo->pde->name, pde);
895
896 hashlimit_net->ipt_hashlimit = NULL;
897 hashlimit_net->ip6t_hashlimit = NULL;
898 mutex_unlock(&hashlimit_mutex);
899
859 proc_net_remove(net, "ipt_hashlimit"); 900 proc_net_remove(net, "ipt_hashlimit");
860#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 901#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
861 proc_net_remove(net, "ip6t_hashlimit"); 902 proc_net_remove(net, "ip6t_hashlimit");
@@ -872,9 +913,6 @@ static int __net_init hashlimit_net_init(struct net *net)
872 913
873static void __net_exit hashlimit_net_exit(struct net *net) 914static void __net_exit hashlimit_net_exit(struct net *net)
874{ 915{
875 struct hashlimit_net *hashlimit_net = hashlimit_pernet(net);
876
877 BUG_ON(!hlist_empty(&hashlimit_net->htables));
878 hashlimit_proc_net_exit(net); 916 hashlimit_proc_net_exit(net);
879} 917}
880 918
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 4635c9b0045..978efc9b555 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -29,6 +29,7 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/inet.h> 30#include <linux/inet.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/vmalloc.h>
32#include <net/net_namespace.h> 33#include <net/net_namespace.h>
33#include <net/netns/generic.h> 34#include <net/netns/generic.h>
34 35
@@ -310,6 +311,14 @@ out:
310 return ret; 311 return ret;
311} 312}
312 313
314static void recent_table_free(void *addr)
315{
316 if (is_vmalloc_addr(addr))
317 vfree(addr);
318 else
319 kfree(addr);
320}
321
313static int recent_mt_check(const struct xt_mtchk_param *par, 322static int recent_mt_check(const struct xt_mtchk_param *par,
314 const struct xt_recent_mtinfo_v1 *info) 323 const struct xt_recent_mtinfo_v1 *info)
315{ 324{
@@ -322,6 +331,7 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
322#endif 331#endif
323 unsigned int i; 332 unsigned int i;
324 int ret = -EINVAL; 333 int ret = -EINVAL;
334 size_t sz;
325 335
326 if (unlikely(!hash_rnd_inited)) { 336 if (unlikely(!hash_rnd_inited)) {
327 get_random_bytes(&hash_rnd, sizeof(hash_rnd)); 337 get_random_bytes(&hash_rnd, sizeof(hash_rnd));
@@ -360,8 +370,11 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
360 goto out; 370 goto out;
361 } 371 }
362 372
363 t = kzalloc(sizeof(*t) + sizeof(t->iphash[0]) * ip_list_hash_size, 373 sz = sizeof(*t) + sizeof(t->iphash[0]) * ip_list_hash_size;
364 GFP_KERNEL); 374 if (sz <= PAGE_SIZE)
375 t = kzalloc(sz, GFP_KERNEL);
376 else
377 t = vzalloc(sz);
365 if (t == NULL) { 378 if (t == NULL) {
366 ret = -ENOMEM; 379 ret = -ENOMEM;
367 goto out; 380 goto out;
@@ -377,14 +390,14 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
377 uid = make_kuid(&init_user_ns, ip_list_uid); 390 uid = make_kuid(&init_user_ns, ip_list_uid);
378 gid = make_kgid(&init_user_ns, ip_list_gid); 391 gid = make_kgid(&init_user_ns, ip_list_gid);
379 if (!uid_valid(uid) || !gid_valid(gid)) { 392 if (!uid_valid(uid) || !gid_valid(gid)) {
380 kfree(t); 393 recent_table_free(t);
381 ret = -EINVAL; 394 ret = -EINVAL;
382 goto out; 395 goto out;
383 } 396 }
384 pde = proc_create_data(t->name, ip_list_perms, recent_net->xt_recent, 397 pde = proc_create_data(t->name, ip_list_perms, recent_net->xt_recent,
385 &recent_mt_fops, t); 398 &recent_mt_fops, t);
386 if (pde == NULL) { 399 if (pde == NULL) {
387 kfree(t); 400 recent_table_free(t);
388 ret = -ENOMEM; 401 ret = -ENOMEM;
389 goto out; 402 goto out;
390 } 403 }
@@ -431,10 +444,11 @@ static void recent_mt_destroy(const struct xt_mtdtor_param *par)
431 list_del(&t->list); 444 list_del(&t->list);
432 spin_unlock_bh(&recent_lock); 445 spin_unlock_bh(&recent_lock);
433#ifdef CONFIG_PROC_FS 446#ifdef CONFIG_PROC_FS
434 remove_proc_entry(t->name, recent_net->xt_recent); 447 if (recent_net->xt_recent != NULL)
448 remove_proc_entry(t->name, recent_net->xt_recent);
435#endif 449#endif
436 recent_table_flush(t); 450 recent_table_flush(t);
437 kfree(t); 451 recent_table_free(t);
438 } 452 }
439 mutex_unlock(&recent_mutex); 453 mutex_unlock(&recent_mutex);
440} 454}
@@ -615,6 +629,20 @@ static int __net_init recent_proc_net_init(struct net *net)
615 629
616static void __net_exit recent_proc_net_exit(struct net *net) 630static void __net_exit recent_proc_net_exit(struct net *net)
617{ 631{
632 struct recent_net *recent_net = recent_pernet(net);
633 struct recent_table *t;
634
635 /* recent_net_exit() is called before recent_mt_destroy(). Make sure
636 * that the parent xt_recent proc entry is is empty before trying to
637 * remove it.
638 */
639 spin_lock_bh(&recent_lock);
640 list_for_each_entry(t, &recent_net->tables, list)
641 remove_proc_entry(t->name, recent_net->xt_recent);
642
643 recent_net->xt_recent = NULL;
644 spin_unlock_bh(&recent_lock);
645
618 proc_net_remove(net, "xt_recent"); 646 proc_net_remove(net, "xt_recent");
619} 647}
620#else 648#else
@@ -638,9 +666,6 @@ static int __net_init recent_net_init(struct net *net)
638 666
639static void __net_exit recent_net_exit(struct net *net) 667static void __net_exit recent_net_exit(struct net *net)
640{ 668{
641 struct recent_net *recent_net = recent_pernet(net);
642
643 BUG_ON(!list_empty(&recent_net->tables));
644 recent_proc_net_exit(net); 669 recent_proc_net_exit(net);
645} 670}
646 671
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index c26210618e1..7521d944c0f 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -68,7 +68,7 @@ config SCTP_DBG_OBJCNT
68 If unsure, say N 68 If unsure, say N
69choice 69choice
70 prompt "Default SCTP cookie HMAC encoding" 70 prompt "Default SCTP cookie HMAC encoding"
71 default SCTP_COOKIE_HMAC_MD5 71 default SCTP_DEFAULT_COOKIE_HMAC_MD5
72 help 72 help
73 This option sets the default sctp cookie hmac algorithm 73 This option sets the default sctp cookie hmac algorithm
74 when in doubt select 'md5' 74 when in doubt select 'md5'
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 822f020fa7f..507b5e84fbd 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -555,7 +555,7 @@ EXPORT_SYMBOL_GPL(rpc_clone_client);
555 * rpc_clone_client_set_auth - Clone an RPC client structure and set its auth 555 * rpc_clone_client_set_auth - Clone an RPC client structure and set its auth
556 * 556 *
557 * @clnt: RPC client whose parameters are copied 557 * @clnt: RPC client whose parameters are copied
558 * @auth: security flavor for new client 558 * @flavor: security flavor for new client
559 * 559 *
560 * Returns a fresh RPC client or an ERR_PTR. 560 * Returns a fresh RPC client or an ERR_PTR.
561 */ 561 */
@@ -610,11 +610,6 @@ EXPORT_SYMBOL_GPL(rpc_killall_tasks);
610 */ 610 */
611void rpc_shutdown_client(struct rpc_clnt *clnt) 611void rpc_shutdown_client(struct rpc_clnt *clnt)
612{ 612{
613 /*
614 * To avoid deadlock, never call rpc_shutdown_client from a
615 * workqueue context!
616 */
617 WARN_ON_ONCE(current->flags & PF_WQ_WORKER);
618 might_sleep(); 613 might_sleep();
619 614
620 dprintk_rcu("RPC: shutting down %s client for %s\n", 615 dprintk_rcu("RPC: shutting down %s client for %s\n",
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index d17a704aaf5..bfa31714581 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -934,16 +934,35 @@ struct rpc_task *rpc_new_task(const struct rpc_task_setup *setup_data)
934 return task; 934 return task;
935} 935}
936 936
937/*
938 * rpc_free_task - release rpc task and perform cleanups
939 *
940 * Note that we free up the rpc_task _after_ rpc_release_calldata()
941 * in order to work around a workqueue dependency issue.
942 *
943 * Tejun Heo states:
944 * "Workqueue currently considers two work items to be the same if they're
945 * on the same address and won't execute them concurrently - ie. it
946 * makes a work item which is queued again while being executed wait
947 * for the previous execution to complete.
948 *
949 * If a work function frees the work item, and then waits for an event
950 * which should be performed by another work item and *that* work item
951 * recycles the freed work item, it can create a false dependency loop.
952 * There really is no reliable way to detect this short of verifying
953 * every memory free."
954 *
955 */
937static void rpc_free_task(struct rpc_task *task) 956static void rpc_free_task(struct rpc_task *task)
938{ 957{
939 const struct rpc_call_ops *tk_ops = task->tk_ops; 958 unsigned short tk_flags = task->tk_flags;
940 void *calldata = task->tk_calldata; 959
960 rpc_release_calldata(task->tk_ops, task->tk_calldata);
941 961
942 if (task->tk_flags & RPC_TASK_DYNAMIC) { 962 if (tk_flags & RPC_TASK_DYNAMIC) {
943 dprintk("RPC: %5u freeing task\n", task->tk_pid); 963 dprintk("RPC: %5u freeing task\n", task->tk_pid);
944 mempool_free(task, rpc_task_mempool); 964 mempool_free(task, rpc_task_mempool);
945 } 965 }
946 rpc_release_calldata(tk_ops, calldata);
947} 966}
948 967
949static void rpc_async_release(struct work_struct *work) 968static void rpc_async_release(struct work_struct *work)
@@ -953,8 +972,7 @@ static void rpc_async_release(struct work_struct *work)
953 972
954static void rpc_release_resources_task(struct rpc_task *task) 973static void rpc_release_resources_task(struct rpc_task *task)
955{ 974{
956 if (task->tk_rqstp) 975 xprt_release(task);
957 xprt_release(task);
958 if (task->tk_msg.rpc_cred) { 976 if (task->tk_msg.rpc_cred) {
959 put_rpccred(task->tk_msg.rpc_cred); 977 put_rpccred(task->tk_msg.rpc_cred);
960 task->tk_msg.rpc_cred = NULL; 978 task->tk_msg.rpc_cred = NULL;
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index bd462a532ac..33811db8788 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1136,10 +1136,18 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
1136void xprt_release(struct rpc_task *task) 1136void xprt_release(struct rpc_task *task)
1137{ 1137{
1138 struct rpc_xprt *xprt; 1138 struct rpc_xprt *xprt;
1139 struct rpc_rqst *req; 1139 struct rpc_rqst *req = task->tk_rqstp;
1140 1140
1141 if (!(req = task->tk_rqstp)) 1141 if (req == NULL) {
1142 if (task->tk_client) {
1143 rcu_read_lock();
1144 xprt = rcu_dereference(task->tk_client->cl_xprt);
1145 if (xprt->snd_task == task)
1146 xprt_release_write(xprt, task);
1147 rcu_read_unlock();
1148 }
1142 return; 1149 return;
1150 }
1143 1151
1144 xprt = req->rq_xprt; 1152 xprt = req->rq_xprt;
1145 if (task->tk_ops->rpc_count_stats != NULL) 1153 if (task->tk_ops->rpc_count_stats != NULL)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 14d99040035..b677eab55b6 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -866,8 +866,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
866 /* allow mac80211 to determine the timeout */ 866 /* allow mac80211 to determine the timeout */
867 wdev->ps_timeout = -1; 867 wdev->ps_timeout = -1;
868 868
869 if (!dev->ethtool_ops) 869 netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops);
870 dev->ethtool_ops = &cfg80211_ethtool_ops;
871 870
872 if ((wdev->iftype == NL80211_IFTYPE_STATION || 871 if ((wdev->iftype == NL80211_IFTYPE_STATION ||
873 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || 872 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c
index 23ea9f2ae11..59b13440813 100644
--- a/samples/rpmsg/rpmsg_client_sample.c
+++ b/samples/rpmsg/rpmsg_client_sample.c
@@ -64,7 +64,7 @@ static int rpmsg_sample_probe(struct rpmsg_channel *rpdev)
64 return 0; 64 return 0;
65} 65}
66 66
67static void __devexit rpmsg_sample_remove(struct rpmsg_channel *rpdev) 67static void rpmsg_sample_remove(struct rpmsg_channel *rpdev)
68{ 68{
69 dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n"); 69 dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n");
70} 70}
@@ -81,7 +81,7 @@ static struct rpmsg_driver rpmsg_sample_client = {
81 .id_table = rpmsg_driver_sample_id_table, 81 .id_table = rpmsg_driver_sample_id_table,
82 .probe = rpmsg_sample_probe, 82 .probe = rpmsg_sample_probe,
83 .callback = rpmsg_sample_cb, 83 .callback = rpmsg_sample_cb,
84 .remove = __devexit_p(rpmsg_sample_remove), 84 .remove = rpmsg_sample_remove,
85}; 85};
86 86
87static int __init rpmsg_client_sample_init(void) 87static int __init rpmsg_client_sample_init(void)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 28b76156781..f565536a2be 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2079,7 +2079,6 @@ sub dump_function($$) {
2079 $prototype =~ s/^__inline +//; 2079 $prototype =~ s/^__inline +//;
2080 $prototype =~ s/^__always_inline +//; 2080 $prototype =~ s/^__always_inline +//;
2081 $prototype =~ s/^noinline +//; 2081 $prototype =~ s/^noinline +//;
2082 $prototype =~ s/__devinit +//;
2083 $prototype =~ s/__init +//; 2082 $prototype =~ s/__init +//;
2084 $prototype =~ s/__init_or_module +//; 2083 $prototype =~ s/__init_or_module +//;
2085 $prototype =~ s/__must_check +//; 2084 $prototype =~ s/__must_check +//;
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index 3b2adb794f1..079a85dc37b 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -139,6 +139,7 @@ void ima_delete_rules(void);
139/* Appraise integrity measurements */ 139/* Appraise integrity measurements */
140#define IMA_APPRAISE_ENFORCE 0x01 140#define IMA_APPRAISE_ENFORCE 0x01
141#define IMA_APPRAISE_FIX 0x02 141#define IMA_APPRAISE_FIX 0x02
142#define IMA_APPRAISE_MODULES 0x04
142 143
143#ifdef CONFIG_IMA_APPRAISE 144#ifdef CONFIG_IMA_APPRAISE
144int ima_appraise_measurement(struct integrity_iint_cache *iint, 145int ima_appraise_measurement(struct integrity_iint_cache *iint,
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 45de18e9a6f..dba965de90d 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -291,11 +291,15 @@ EXPORT_SYMBOL_GPL(ima_file_check);
291 */ 291 */
292int ima_module_check(struct file *file) 292int ima_module_check(struct file *file)
293{ 293{
294 int rc; 294 int rc = 0;
295 295
296 if (!file) 296 if (!file) {
297 rc = INTEGRITY_UNKNOWN; 297 if (ima_appraise & IMA_APPRAISE_MODULES) {
298 else 298#ifndef CONFIG_MODULE_SIG_FORCE
299 rc = -EACCES; /* INTEGRITY_UNKNOWN */
300#endif
301 }
302 } else
299 rc = process_measurement(file, file->f_dentry->d_name.name, 303 rc = process_measurement(file, file->f_dentry->d_name.name,
300 MAY_EXEC, MODULE_CHECK); 304 MAY_EXEC, MODULE_CHECK);
301 return (ima_appraise & IMA_APPRAISE_ENFORCE) ? rc : 0; 305 return (ima_appraise & IMA_APPRAISE_ENFORCE) ? rc : 0;
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index af7d182d5a4..479fca940bb 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -523,7 +523,8 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
523 } 523 }
524 if (!result && (entry->action == UNKNOWN)) 524 if (!result && (entry->action == UNKNOWN))
525 result = -EINVAL; 525 result = -EINVAL;
526 526 else if (entry->func == MODULE_CHECK)
527 ima_appraise |= IMA_APPRAISE_MODULES;
527 audit_log_format(ab, "res=%d", !result); 528 audit_log_format(ab, "res=%d", !result);
528 audit_log_end(ab); 529 audit_log_end(ab);
529 return result; 530 return result;
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 6fc0ae90e5b..fff7753e35c 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -18,6 +18,7 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/gpio.h>
21 22
22#include <sound/ac97_codec.h> 23#include <sound/ac97_codec.h>
23#include <sound/pxa2xx-lib.h> 24#include <sound/pxa2xx-lib.h>
@@ -148,6 +149,8 @@ static inline void pxa_ac97_warm_pxa27x(void)
148 149
149static inline void pxa_ac97_cold_pxa27x(void) 150static inline void pxa_ac97_cold_pxa27x(void)
150{ 151{
152 unsigned int timeout;
153
151 GCR &= GCR_COLD_RST; /* clear everything but nCRST */ 154 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
152 GCR &= ~GCR_COLD_RST; /* then assert nCRST */ 155 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
153 156
@@ -157,8 +160,10 @@ static inline void pxa_ac97_cold_pxa27x(void)
157 clk_enable(ac97conf_clk); 160 clk_enable(ac97conf_clk);
158 udelay(5); 161 udelay(5);
159 clk_disable(ac97conf_clk); 162 clk_disable(ac97conf_clk);
160 GCR = GCR_COLD_RST; 163 GCR = GCR_COLD_RST | GCR_WARM_RST;
161 udelay(50); 164 timeout = 100; /* wait for the codec-ready bit to be set */
165 while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
166 mdelay(1);
162} 167}
163#endif 168#endif
164 169
@@ -340,8 +345,21 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
340 } 345 }
341 346
342 if (cpu_is_pxa27x()) { 347 if (cpu_is_pxa27x()) {
343 /* Use GPIO 113 as AC97 Reset on Bulverde */ 348 /*
349 * This gpio is needed for a work-around to a bug in the ac97
350 * controller during warm reset. The direction and level is set
351 * here so that it is an output driven high when switching from
352 * AC97_nRESET alt function to generic gpio.
353 */
354 ret = gpio_request_one(reset_gpio, GPIOF_OUT_INIT_HIGH,
355 "pxa27x ac97 reset");
356 if (ret < 0) {
357 pr_err("%s: gpio_request_one() failed: %d\n",
358 __func__, ret);
359 goto err_conf;
360 }
344 pxa27x_assert_ac97reset(reset_gpio, 0); 361 pxa27x_assert_ac97reset(reset_gpio, 0);
362
345 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK"); 363 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
346 if (IS_ERR(ac97conf_clk)) { 364 if (IS_ERR(ac97conf_clk)) {
347 ret = PTR_ERR(ac97conf_clk); 365 ret = PTR_ERR(ac97conf_clk);
@@ -384,6 +402,8 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
384 402
385void pxa2xx_ac97_hw_remove(struct platform_device *dev) 403void pxa2xx_ac97_hw_remove(struct platform_device *dev)
386{ 404{
405 if (cpu_is_pxa27x())
406 gpio_free(reset_gpio);
387 GCR |= GCR_ACLINK_OFF; 407 GCR |= GCR_ACLINK_OFF;
388 free_irq(IRQ_AC97, NULL); 408 free_irq(IRQ_AC97, NULL);
389 if (ac97conf_clk) { 409 if (ac97conf_clk) {
diff --git a/sound/oss/pas2_card.c b/sound/oss/pas2_card.c
index dabf8a871dc..7004e24d209 100644
--- a/sound/oss/pas2_card.c
+++ b/sound/oss/pas2_card.c
@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
333 { 333 {
334 char temp[100]; 334 char temp[100];
335 335
336 if (pas_model < 0 ||
337 pas_model >= ARRAY_SIZE(pas_model_names)) {
338 printk(KERN_ERR "pas2 unrecognized model.\n");
339 return;
340 }
336 sprintf(temp, 341 sprintf(temp,
337 "%s rev %d", pas_model_names[(int) pas_model], 342 "%s rev %d", pas_model_names[(int) pas_model],
338 pas_read(0x2789)); 343 pas_read(0x2789));
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 2805e34bd41..8bef47311e4 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
58 if (en) 58 if (en)
59 temp |= (1 << (wt & 0x1f)); 59 temp |= (1 << (wt & 0x1f));
60 else 60 else
61 temp &= (1 << ~(wt & 0x1f)); 61 temp &= ~(1 << (wt & 0x1f));
62 hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp); 62 hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
63} 63}
64 64
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8353c77536a..b8fb0a5adb9 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
2531 struct snd_ctl_elem_info *uinfo) 2531 struct snd_ctl_elem_info *uinfo)
2532{ 2532{
2533 static const char * const texts[] = { 2533 static const char * const texts[] = {
2534 "Off", "On", "Follow Master" 2534 "On", "Off", "Follow Master"
2535 }; 2535 };
2536 unsigned int index; 2536 unsigned int index;
2537 2537
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index cca87277baf..0b6aebacc56 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -573,9 +573,12 @@ enum {
573#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ 573#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */
574 574
575/* quirks for Intel PCH */ 575/* quirks for Intel PCH */
576#define AZX_DCAPS_INTEL_PCH \ 576#define AZX_DCAPS_INTEL_PCH_NOPM \
577 (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \ 577 (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \
578 AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_PM_RUNTIME) 578 AZX_DCAPS_COUNT_LPIB_DELAY)
579
580#define AZX_DCAPS_INTEL_PCH \
581 (AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_PM_RUNTIME)
579 582
580/* quirks for ATI SB / AMD Hudson */ 583/* quirks for ATI SB / AMD Hudson */
581#define AZX_DCAPS_PRESET_ATI_SB \ 584#define AZX_DCAPS_PRESET_ATI_SB \
@@ -3586,13 +3589,13 @@ static void azx_remove(struct pci_dev *pci)
3586static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { 3589static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
3587 /* CPT */ 3590 /* CPT */
3588 { PCI_DEVICE(0x8086, 0x1c20), 3591 { PCI_DEVICE(0x8086, 0x1c20),
3589 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3592 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3590 /* PBG */ 3593 /* PBG */
3591 { PCI_DEVICE(0x8086, 0x1d20), 3594 { PCI_DEVICE(0x8086, 0x1d20),
3592 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3595 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3593 /* Panther Point */ 3596 /* Panther Point */
3594 { PCI_DEVICE(0x8086, 0x1e20), 3597 { PCI_DEVICE(0x8086, 0x1e20),
3595 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3598 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3596 /* Lynx Point */ 3599 /* Lynx Point */
3597 { PCI_DEVICE(0x8086, 0x8c20), 3600 { PCI_DEVICE(0x8086, 0x8c20),
3598 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3601 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 60890bfecc1..dd798c3196f 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -558,24 +558,12 @@ static int conexant_build_controls(struct hda_codec *codec)
558 return 0; 558 return 0;
559} 559}
560 560
561#ifdef CONFIG_PM
562static int conexant_suspend(struct hda_codec *codec)
563{
564 snd_hda_shutup_pins(codec);
565 return 0;
566}
567#endif
568
569static const struct hda_codec_ops conexant_patch_ops = { 561static const struct hda_codec_ops conexant_patch_ops = {
570 .build_controls = conexant_build_controls, 562 .build_controls = conexant_build_controls,
571 .build_pcms = conexant_build_pcms, 563 .build_pcms = conexant_build_pcms,
572 .init = conexant_init, 564 .init = conexant_init,
573 .free = conexant_free, 565 .free = conexant_free,
574 .set_power_state = conexant_set_power, 566 .set_power_state = conexant_set_power,
575#ifdef CONFIG_PM
576 .suspend = conexant_suspend,
577#endif
578 .reboot_notify = snd_hda_shutup_pins,
579}; 567};
580 568
581#ifdef CONFIG_SND_HDA_INPUT_BEEP 569#ifdef CONFIG_SND_HDA_INPUT_BEEP
@@ -4405,10 +4393,6 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
4405 .init = cx_auto_init, 4393 .init = cx_auto_init,
4406 .free = conexant_free, 4394 .free = conexant_free,
4407 .unsol_event = snd_hda_jack_unsol_event, 4395 .unsol_event = snd_hda_jack_unsol_event,
4408#ifdef CONFIG_PM
4409 .suspend = conexant_suspend,
4410#endif
4411 .reboot_notify = snd_hda_shutup_pins,
4412}; 4396};
4413 4397
4414/* 4398/*
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6ee34593774..f5196277b6e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5817,6 +5817,9 @@ enum {
5817 ALC269_TYPE_ALC269VB, 5817 ALC269_TYPE_ALC269VB,
5818 ALC269_TYPE_ALC269VC, 5818 ALC269_TYPE_ALC269VC,
5819 ALC269_TYPE_ALC269VD, 5819 ALC269_TYPE_ALC269VD,
5820 ALC269_TYPE_ALC280,
5821 ALC269_TYPE_ALC282,
5822 ALC269_TYPE_ALC284,
5820}; 5823};
5821 5824
5822/* 5825/*
@@ -5833,10 +5836,13 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
5833 switch (spec->codec_variant) { 5836 switch (spec->codec_variant) {
5834 case ALC269_TYPE_ALC269VA: 5837 case ALC269_TYPE_ALC269VA:
5835 case ALC269_TYPE_ALC269VC: 5838 case ALC269_TYPE_ALC269VC:
5839 case ALC269_TYPE_ALC280:
5840 case ALC269_TYPE_ALC284:
5836 ssids = alc269va_ssids; 5841 ssids = alc269va_ssids;
5837 break; 5842 break;
5838 case ALC269_TYPE_ALC269VB: 5843 case ALC269_TYPE_ALC269VB:
5839 case ALC269_TYPE_ALC269VD: 5844 case ALC269_TYPE_ALC269VD:
5845 case ALC269_TYPE_ALC282:
5840 ssids = alc269_ssids; 5846 ssids = alc269_ssids;
5841 break; 5847 break;
5842 default: 5848 default:
@@ -5992,6 +5998,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
5992 spec->automute_hook = alc269_quanta_automute; 5998 spec->automute_hook = alc269_quanta_automute;
5993} 5999}
5994 6000
6001/* update mute-LED according to the speaker mute state via mic1 VREF pin */
6002static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
6003{
6004 struct hda_codec *codec = private_data;
6005 unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
6006 AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
6007 snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
6008}
6009
6010static void alc269_fixup_mic1_mute(struct hda_codec *codec,
6011 const struct alc_fixup *fix, int action)
6012{
6013 struct alc_spec *spec = codec->spec;
6014 switch (action) {
6015 case ALC_FIXUP_ACT_BUILD:
6016 spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
6017 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
6018 /* fallthru */
6019 case ALC_FIXUP_ACT_INIT:
6020 snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
6021 break;
6022 }
6023}
6024
5995/* update mute-LED according to the speaker mute state via mic2 VREF pin */ 6025/* update mute-LED according to the speaker mute state via mic2 VREF pin */
5996static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) 6026static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
5997{ 6027{
@@ -6043,6 +6073,7 @@ enum {
6043 ALC269_FIXUP_DMIC, 6073 ALC269_FIXUP_DMIC,
6044 ALC269VB_FIXUP_AMIC, 6074 ALC269VB_FIXUP_AMIC,
6045 ALC269VB_FIXUP_DMIC, 6075 ALC269VB_FIXUP_DMIC,
6076 ALC269_FIXUP_MIC1_MUTE_LED,
6046 ALC269_FIXUP_MIC2_MUTE_LED, 6077 ALC269_FIXUP_MIC2_MUTE_LED,
6047 ALC269_FIXUP_INV_DMIC, 6078 ALC269_FIXUP_INV_DMIC,
6048 ALC269_FIXUP_LENOVO_DOCK, 6079 ALC269_FIXUP_LENOVO_DOCK,
@@ -6171,6 +6202,10 @@ static const struct alc_fixup alc269_fixups[] = {
6171 { } 6202 { }
6172 }, 6203 },
6173 }, 6204 },
6205 [ALC269_FIXUP_MIC1_MUTE_LED] = {
6206 .type = ALC_FIXUP_FUNC,
6207 .v.func = alc269_fixup_mic1_mute,
6208 },
6174 [ALC269_FIXUP_MIC2_MUTE_LED] = { 6209 [ALC269_FIXUP_MIC2_MUTE_LED] = {
6175 .type = ALC_FIXUP_FUNC, 6210 .type = ALC_FIXUP_FUNC,
6176 .v.func = alc269_fixup_mic2_mute, 6211 .v.func = alc269_fixup_mic2_mute,
@@ -6215,6 +6250,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6215 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 6250 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
6216 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 6251 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
6217 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), 6252 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
6253 SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
6218 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), 6254 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
6219 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), 6255 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
6220 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 6256 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
@@ -6370,7 +6406,8 @@ static int patch_alc269(struct hda_codec *codec)
6370 6406
6371 alc_auto_parse_customize_define(codec); 6407 alc_auto_parse_customize_define(codec);
6372 6408
6373 if (codec->vendor_id == 0x10ec0269) { 6409 switch (codec->vendor_id) {
6410 case 0x10ec0269:
6374 spec->codec_variant = ALC269_TYPE_ALC269VA; 6411 spec->codec_variant = ALC269_TYPE_ALC269VA;
6375 switch (alc_get_coef0(codec) & 0x00f0) { 6412 switch (alc_get_coef0(codec) & 0x00f0) {
6376 case 0x0010: 6413 case 0x0010:
@@ -6395,6 +6432,20 @@ static int patch_alc269(struct hda_codec *codec)
6395 goto error; 6432 goto error;
6396 spec->init_hook = alc269_fill_coef; 6433 spec->init_hook = alc269_fill_coef;
6397 alc269_fill_coef(codec); 6434 alc269_fill_coef(codec);
6435 break;
6436
6437 case 0x10ec0280:
6438 case 0x10ec0290:
6439 spec->codec_variant = ALC269_TYPE_ALC280;
6440 break;
6441 case 0x10ec0282:
6442 case 0x10ec0283:
6443 spec->codec_variant = ALC269_TYPE_ALC282;
6444 break;
6445 case 0x10ec0284:
6446 case 0x10ec0292:
6447 spec->codec_variant = ALC269_TYPE_ALC284;
6448 break;
6398 } 6449 }
6399 6450
6400 /* automatic parse from the BIOS config */ 6451 /* automatic parse from the BIOS config */
@@ -7099,6 +7150,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
7099 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, 7150 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
7100 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, 7151 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
7101 { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 }, 7152 { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
7153 { .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 },
7102 { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 }, 7154 { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
7103 { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 }, 7155 { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
7104 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 7156 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 6e02e064d7b..223c3d9cc69 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -441,6 +441,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
441*/ 441*/
442/* status */ 442/* status */
443#define HDSPM_AES32_wcLock 0x0200000 443#define HDSPM_AES32_wcLock 0x0200000
444#define HDSPM_AES32_wcSync 0x0100000
444#define HDSPM_AES32_wcFreq_bit 22 445#define HDSPM_AES32_wcFreq_bit 22
445/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function 446/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
446 HDSPM_bit2freq */ 447 HDSPM_bit2freq */
@@ -3467,10 +3468,12 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
3467 switch (hdspm->io_type) { 3468 switch (hdspm->io_type) {
3468 case AES32: 3469 case AES32:
3469 status = hdspm_read(hdspm, HDSPM_statusRegister); 3470 status = hdspm_read(hdspm, HDSPM_statusRegister);
3470 if (status & HDSPM_wcSync) 3471 if (status & HDSPM_AES32_wcLock) {
3471 return 2; 3472 if (status & HDSPM_AES32_wcSync)
3472 else if (status & HDSPM_wcLock) 3473 return 2;
3473 return 1; 3474 else
3475 return 1;
3476 }
3474 return 0; 3477 return 0;
3475 break; 3478 break;
3476 3479
@@ -4658,6 +4661,7 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry,
4658 unsigned int status; 4661 unsigned int status;
4659 unsigned int status2; 4662 unsigned int status2;
4660 unsigned int timecode; 4663 unsigned int timecode;
4664 unsigned int wcLock, wcSync;
4661 int pref_syncref; 4665 int pref_syncref;
4662 char *autosync_ref; 4666 char *autosync_ref;
4663 int x; 4667 int x;
@@ -4751,8 +4755,11 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry,
4751 4755
4752 snd_iprintf(buffer, "--- Status:\n"); 4756 snd_iprintf(buffer, "--- Status:\n");
4753 4757
4758 wcLock = status & HDSPM_AES32_wcLock;
4759 wcSync = wcLock && (status & HDSPM_AES32_wcSync);
4760
4754 snd_iprintf(buffer, "Word: %s Frequency: %d\n", 4761 snd_iprintf(buffer, "Word: %s Frequency: %d\n",
4755 (status & HDSPM_AES32_wcLock) ? "Sync " : "No Lock", 4762 (wcLock) ? (wcSync ? "Sync " : "Lock ") : "No Lock",
4756 HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF)); 4763 HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF));
4757 4764
4758 for (x = 0; x < 8; x++) { 4765 for (x = 0; x < 8; x++) {
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index adf397b9d0e..1d8bb591759 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -446,15 +446,9 @@ static int arizona_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
446 case SND_SOC_DAIFMT_DSP_A: 446 case SND_SOC_DAIFMT_DSP_A:
447 mode = 0; 447 mode = 0;
448 break; 448 break;
449 case SND_SOC_DAIFMT_DSP_B:
450 mode = 1;
451 break;
452 case SND_SOC_DAIFMT_I2S: 449 case SND_SOC_DAIFMT_I2S:
453 mode = 2; 450 mode = 2;
454 break; 451 break;
455 case SND_SOC_DAIFMT_LEFT_J:
456 mode = 3;
457 break;
458 default: 452 default:
459 arizona_aif_err(dai, "Unsupported DAI format %d\n", 453 arizona_aif_err(dai, "Unsupported DAI format %d\n",
460 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 454 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
@@ -714,7 +708,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
714 snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, 708 snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1,
715 ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val); 709 ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val);
716 snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, 710 snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL,
717 ARIZONA_AIF1_RATE_MASK, 8); 711 ARIZONA_AIF1_RATE_MASK,
712 8 << ARIZONA_AIF1_RATE_SHIFT);
718 break; 713 break;
719 default: 714 default:
720 arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk); 715 arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk);
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 41dae1ed3b7..4deebeb0717 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -34,15 +34,15 @@
34 34
35#define ARIZONA_FLL_SRC_MCLK1 0 35#define ARIZONA_FLL_SRC_MCLK1 0
36#define ARIZONA_FLL_SRC_MCLK2 1 36#define ARIZONA_FLL_SRC_MCLK2 1
37#define ARIZONA_FLL_SRC_SLIMCLK 2 37#define ARIZONA_FLL_SRC_SLIMCLK 3
38#define ARIZONA_FLL_SRC_FLL1 3 38#define ARIZONA_FLL_SRC_FLL1 4
39#define ARIZONA_FLL_SRC_FLL2 4 39#define ARIZONA_FLL_SRC_FLL2 5
40#define ARIZONA_FLL_SRC_AIF1BCLK 5 40#define ARIZONA_FLL_SRC_AIF1BCLK 8
41#define ARIZONA_FLL_SRC_AIF2BCLK 6 41#define ARIZONA_FLL_SRC_AIF2BCLK 9
42#define ARIZONA_FLL_SRC_AIF3BCLK 7 42#define ARIZONA_FLL_SRC_AIF3BCLK 10
43#define ARIZONA_FLL_SRC_AIF1LRCLK 8 43#define ARIZONA_FLL_SRC_AIF1LRCLK 12
44#define ARIZONA_FLL_SRC_AIF2LRCLK 9 44#define ARIZONA_FLL_SRC_AIF2LRCLK 13
45#define ARIZONA_FLL_SRC_AIF3LRCLK 10 45#define ARIZONA_FLL_SRC_AIF3LRCLK 14
46 46
47#define ARIZONA_MIXER_VOL_MASK 0x00FE 47#define ARIZONA_MIXER_VOL_MASK 0x00FE
48#define ARIZONA_MIXER_VOL_SHIFT 1 48#define ARIZONA_MIXER_VOL_SHIFT 1
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 4f1127935fd..ac8742a1f25 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -474,16 +474,16 @@ static int cs4271_probe(struct snd_soc_codec *codec)
474 struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; 474 struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
475 int ret; 475 int ret;
476 int gpio_nreset = -EINVAL; 476 int gpio_nreset = -EINVAL;
477 int amutec_eq_bmutec = 0; 477 bool amutec_eq_bmutec = false;
478 478
479#ifdef CONFIG_OF 479#ifdef CONFIG_OF
480 if (of_match_device(cs4271_dt_ids, codec->dev)) { 480 if (of_match_device(cs4271_dt_ids, codec->dev)) {
481 gpio_nreset = of_get_named_gpio(codec->dev->of_node, 481 gpio_nreset = of_get_named_gpio(codec->dev->of_node,
482 "reset-gpio", 0); 482 "reset-gpio", 0);
483 483
484 if (!of_get_property(codec->dev->of_node, 484 if (of_get_property(codec->dev->of_node,
485 "cirrus,amutec-eq-bmutec", NULL)) 485 "cirrus,amutec-eq-bmutec", NULL))
486 amutec_eq_bmutec = 1; 486 amutec_eq_bmutec = true;
487 } 487 }
488#endif 488#endif
489 489
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 99bb1c69499..9811a5478c8 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -737,7 +737,7 @@ static const struct cs42l52_clk_para clk_map_table[] = {
737 737
738static int cs42l52_get_clk(int mclk, int rate) 738static int cs42l52_get_clk(int mclk, int rate)
739{ 739{
740 int i, ret = 0; 740 int i, ret = -EINVAL;
741 u_int mclk1, mclk2 = 0; 741 u_int mclk1, mclk2 = 0;
742 742
743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) { 743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) {
@@ -749,8 +749,6 @@ static int cs42l52_get_clk(int mclk, int rate)
749 } 749 }
750 } 750 }
751 } 751 }
752 if (ret > ARRAY_SIZE(clk_map_table))
753 return -EINVAL;
754 return ret; 752 return ret;
755} 753}
756 754
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c
index d75257d40a4..e19490cfb3a 100644
--- a/sound/soc/codecs/lm49453.c
+++ b/sound/soc/codecs/lm49453.c
@@ -111,9 +111,9 @@ static struct reg_default lm49453_reg_defs[] = {
111 { 101, 0x00 }, 111 { 101, 0x00 },
112 { 102, 0x00 }, 112 { 102, 0x00 },
113 { 103, 0x01 }, 113 { 103, 0x01 },
114 { 105, 0x01 }, 114 { 104, 0x01 },
115 { 106, 0x00 }, 115 { 105, 0x00 },
116 { 107, 0x01 }, 116 { 106, 0x01 },
117 { 107, 0x00 }, 117 { 107, 0x00 },
118 { 108, 0x00 }, 118 { 108, 0x00 },
119 { 109, 0x00 }, 119 { 109, 0x00 },
@@ -163,56 +163,25 @@ static struct reg_default lm49453_reg_defs[] = {
163 { 184, 0x00 }, 163 { 184, 0x00 },
164 { 185, 0x00 }, 164 { 185, 0x00 },
165 { 186, 0x00 }, 165 { 186, 0x00 },
166 { 189, 0x00 }, 166 { 187, 0x00 },
167 { 188, 0x00 }, 167 { 188, 0x00 },
168 { 194, 0x00 }, 168 { 189, 0x00 },
169 { 195, 0x00 }, 169 { 208, 0x06 },
170 { 196, 0x00 },
171 { 197, 0x00 },
172 { 200, 0x00 },
173 { 201, 0x00 },
174 { 202, 0x00 },
175 { 203, 0x00 },
176 { 204, 0x00 },
177 { 205, 0x00 },
178 { 208, 0x00 },
179 { 209, 0x00 }, 170 { 209, 0x00 },
180 { 210, 0x00 }, 171 { 210, 0x08 },
181 { 211, 0x00 }, 172 { 211, 0x54 },
182 { 213, 0x00 }, 173 { 212, 0x14 },
183 { 214, 0x00 }, 174 { 213, 0x0d },
184 { 215, 0x00 }, 175 { 214, 0x0d },
185 { 216, 0x00 }, 176 { 215, 0x14 },
186 { 217, 0x00 }, 177 { 216, 0x60 },
187 { 218, 0x00 },
188 { 219, 0x00 },
189 { 221, 0x00 }, 178 { 221, 0x00 },
190 { 222, 0x00 }, 179 { 222, 0x00 },
180 { 223, 0x00 },
191 { 224, 0x00 }, 181 { 224, 0x00 },
192 { 225, 0x00 },
193 { 226, 0x00 },
194 { 227, 0x00 },
195 { 228, 0x00 },
196 { 229, 0x00 },
197 { 230, 0x13 },
198 { 231, 0x00 },
199 { 232, 0x80 },
200 { 233, 0x0C },
201 { 234, 0xDD },
202 { 235, 0x00 },
203 { 236, 0x04 },
204 { 237, 0x00 },
205 { 238, 0x00 },
206 { 239, 0x00 },
207 { 240, 0x00 },
208 { 241, 0x00 },
209 { 242, 0x00 },
210 { 243, 0x00 },
211 { 244, 0x00 },
212 { 245, 0x00 },
213 { 248, 0x00 }, 182 { 248, 0x00 },
214 { 249, 0x00 }, 183 { 249, 0x00 },
215 { 254, 0x00 }, 184 { 250, 0x00 },
216 { 255, 0x00 }, 185 { 255, 0x00 },
217}; 186};
218 187
@@ -525,36 +494,41 @@ SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0),
525}; 494};
526 495
527/* TLV Declarations */ 496/* TLV Declarations */
528static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1); 497static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1);
529static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0); 498static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1);
499static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
500static const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0);
530 501
531static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { 502static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
532/* Sidetone supports mono only */ 503/* Sidetone supports mono only */
533SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, 504SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG,
534 0, 0x3F, 0, digital_tlv), 505 0, 0x3F, 0, stn_tlv),
535SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, 506SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG,
536 0, 0x3F, 0, digital_tlv), 507 0, 0x3F, 0, stn_tlv),
537SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, 508SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG,
538 0, 0x3F, 0, digital_tlv), 509 0, 0x3F, 0, stn_tlv),
539SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, 510SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG,
540 0, 0x3F, 0, digital_tlv), 511 0, 0x3F, 0, stn_tlv),
541SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, 512SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG,
542 0, 0x3F, 0, digital_tlv), 513 0, 0x3F, 0, stn_tlv),
543SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, 514SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
544 0, 0x3F, 0, digital_tlv), 515 0, 0x3F, 0, stn_tlv),
545}; 516};
546 517
547static const struct snd_kcontrol_new lm49453_snd_controls[] = { 518static const struct snd_kcontrol_new lm49453_snd_controls[] = {
548 /* mic1 and mic2 supports mono only */ 519 /* mic1 and mic2 supports mono only */
549 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6, 520 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv),
550 0, digital_tlv), 521 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv),
551 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6, 522
552 0, digital_tlv), 523 SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63,
524 0, adc_dac_tlv),
525 SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63,
526 0, adc_dac_tlv),
553 527
554 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, 528 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
555 LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), 529 LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
556 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, 530 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG,
557 LM49453_P0_DMIC2_LEVELR_REG, 0, 6, 0, digital_tlv), 531 LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
558 532
559 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), 533 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum),
560 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), 534 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum),
@@ -569,16 +543,16 @@ static const struct snd_kcontrol_new lm49453_snd_controls[] = {
569 2, 1, 0), 543 2, 1, 0),
570 544
571 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, 545 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG,
572 LM49453_P0_DAC_HP_LEVELR_REG, 0, 6, 0, digital_tlv), 546 LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
573 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, 547 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG,
574 LM49453_P0_DAC_LO_LEVELR_REG, 0, 6, 0, digital_tlv), 548 LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
575 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, 549 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG,
576 LM49453_P0_DAC_LS_LEVELR_REG, 0, 6, 0, digital_tlv), 550 LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
577 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, 551 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG,
578 LM49453_P0_DAC_HA_LEVELR_REG, 0, 6, 0, digital_tlv), 552 LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
579 553
580 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, 554 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG,
581 0, 6, 0, digital_tlv), 555 0, 63, 0, adc_dac_tlv),
582 556
583 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 557 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
584 0, 3, 0, port_tlv), 558 0, 3, 0, port_tlv),
@@ -1218,7 +1192,7 @@ static int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1218 } 1192 }
1219 1193
1220 snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG, 1194 snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG,
1221 LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(1)|BIT(5), 1195 LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(0)|BIT(5),
1222 (aif_val | mode | clk_phase)); 1196 (aif_val | mode | clk_phase));
1223 1197
1224 snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift); 1198 snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift);
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index cb1675cd8e1..92bbfec9b10 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -401,7 +401,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = {
401 5, 1, 0), 401 5, 1, 0),
402 402
403 SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL, 403 SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL,
404 0, 4, 0, mic_gain_tlv), 404 0, 3, 0, mic_gain_tlv),
405}; 405};
406 406
407/* mute the codec used by alsa core */ 407/* mute the codec used by alsa core */
@@ -1344,7 +1344,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
1344 SGTL5000_HP_ZCD_EN | 1344 SGTL5000_HP_ZCD_EN |
1345 SGTL5000_ADC_ZCD_EN); 1345 SGTL5000_ADC_ZCD_EN);
1346 1346
1347 snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 0); 1347 snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 2);
1348 1348
1349 /* 1349 /*
1350 * disable DAP 1350 * disable DAP
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c
index ab355c4f0b2..40c07be9b58 100644
--- a/sound/soc/codecs/sta529.c
+++ b/sound/soc/codecs/sta529.c
@@ -74,9 +74,10 @@
74 SNDRV_PCM_FMTBIT_S32_LE) 74 SNDRV_PCM_FMTBIT_S32_LE)
75#define S2PC_VALUE 0x98 75#define S2PC_VALUE 0x98
76#define CLOCK_OUT 0x60 76#define CLOCK_OUT 0x60
77#define LEFT_J_DATA_FORMAT 0x10 77#define DATA_FORMAT_MSK 0x0E
78#define I2S_DATA_FORMAT 0x12 78#define LEFT_J_DATA_FORMAT 0x00
79#define RIGHT_J_DATA_FORMAT 0x14 79#define I2S_DATA_FORMAT 0x02
80#define RIGHT_J_DATA_FORMAT 0x04
80#define CODEC_MUTE_VAL 0x80 81#define CODEC_MUTE_VAL 0x80
81 82
82#define POWER_CNTLMSAK 0x40 83#define POWER_CNTLMSAK 0x40
@@ -289,7 +290,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt)
289 return -EINVAL; 290 return -EINVAL;
290 } 291 }
291 292
292 snd_soc_update_bits(codec, STA529_S2PCFG0, 0x0D, mode); 293 snd_soc_update_bits(codec, STA529_S2PCFG0, DATA_FORMAT_MSK, mode);
293 294
294 return 0; 295 return 0;
295} 296}
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 1cbe88f01d6..12bcae63a7f 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -209,9 +209,9 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue)
209 209
210 ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY); 210 ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY);
211 if (wm2000->speech_clarity) 211 if (wm2000->speech_clarity)
212 ret &= ~WM2000_SPEECH_CLARITY;
213 else
214 ret |= WM2000_SPEECH_CLARITY; 212 ret |= WM2000_SPEECH_CLARITY;
213 else
214 ret &= ~WM2000_SPEECH_CLARITY;
215 wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret); 215 wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret);
216 216
217 wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33); 217 wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33);
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c
index afcf31df77e..e6cefe1ac67 100644
--- a/sound/soc/codecs/wm2200.c
+++ b/sound/soc/codecs/wm2200.c
@@ -1566,15 +1566,9 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1566 case SND_SOC_DAIFMT_DSP_A: 1566 case SND_SOC_DAIFMT_DSP_A:
1567 fmt_val = 0; 1567 fmt_val = 0;
1568 break; 1568 break;
1569 case SND_SOC_DAIFMT_DSP_B:
1570 fmt_val = 1;
1571 break;
1572 case SND_SOC_DAIFMT_I2S: 1569 case SND_SOC_DAIFMT_I2S:
1573 fmt_val = 2; 1570 fmt_val = 2;
1574 break; 1571 break;
1575 case SND_SOC_DAIFMT_LEFT_J:
1576 fmt_val = 3;
1577 break;
1578 default: 1572 default:
1579 dev_err(codec->dev, "Unsupported DAI format %d\n", 1573 dev_err(codec->dev, "Unsupported DAI format %d\n",
1580 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 1574 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
@@ -1626,7 +1620,7 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1626 WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV, 1620 WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV,
1627 lrclk); 1621 lrclk);
1628 snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5, 1622 snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5,
1629 WM2200_AIF1_FMT_MASK << 1, fmt_val << 1); 1623 WM2200_AIF1_FMT_MASK, fmt_val);
1630 1624
1631 return 0; 1625 return 0;
1632} 1626}
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 5a5f3693623..54397a50807 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -1279,15 +1279,9 @@ static int wm5100_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1279 case SND_SOC_DAIFMT_DSP_A: 1279 case SND_SOC_DAIFMT_DSP_A:
1280 mask = 0; 1280 mask = 0;
1281 break; 1281 break;
1282 case SND_SOC_DAIFMT_DSP_B:
1283 mask = 1;
1284 break;
1285 case SND_SOC_DAIFMT_I2S: 1282 case SND_SOC_DAIFMT_I2S:
1286 mask = 2; 1283 mask = 2;
1287 break; 1284 break;
1288 case SND_SOC_DAIFMT_LEFT_J:
1289 mask = 3;
1290 break;
1291 default: 1285 default:
1292 dev_err(codec->dev, "Unsupported DAI format %d\n", 1286 dev_err(codec->dev, "Unsupported DAI format %d\n",
1293 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 1287 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 688ade08058..7a9048dad1c 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -36,6 +36,9 @@
36struct wm5102_priv { 36struct wm5102_priv {
37 struct arizona_priv core; 37 struct arizona_priv core;
38 struct arizona_fll fll[2]; 38 struct arizona_fll fll[2];
39
40 unsigned int spk_ena:2;
41 unsigned int spk_ena_pending:1;
39}; 42};
40 43
41static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); 44static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
@@ -787,6 +790,47 @@ ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
787ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), 790ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE),
788}; 791};
789 792
793static int wm5102_spk_ev(struct snd_soc_dapm_widget *w,
794 struct snd_kcontrol *kcontrol,
795 int event)
796{
797 struct snd_soc_codec *codec = w->codec;
798 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
799 struct wm5102_priv *wm5102 = snd_soc_codec_get_drvdata(codec);
800
801 if (arizona->rev < 1)
802 return 0;
803
804 switch (event) {
805 case SND_SOC_DAPM_PRE_PMU:
806 if (!wm5102->spk_ena) {
807 snd_soc_write(codec, 0x4f5, 0x25a);
808 wm5102->spk_ena_pending = true;
809 }
810 break;
811 case SND_SOC_DAPM_POST_PMU:
812 if (wm5102->spk_ena_pending) {
813 msleep(75);
814 snd_soc_write(codec, 0x4f5, 0xda);
815 wm5102->spk_ena_pending = false;
816 wm5102->spk_ena++;
817 }
818 break;
819 case SND_SOC_DAPM_PRE_PMD:
820 wm5102->spk_ena--;
821 if (!wm5102->spk_ena)
822 snd_soc_write(codec, 0x4f5, 0x25a);
823 break;
824 case SND_SOC_DAPM_POST_PMD:
825 if (!wm5102->spk_ena)
826 snd_soc_write(codec, 0x4f5, 0x0da);
827 break;
828 }
829
830 return 0;
831}
832
833
790ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); 834ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
791ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); 835ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
792ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); 836ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
@@ -1034,10 +1078,10 @@ SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
1034 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1078 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1035 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1079 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1036SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1, 1080SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1,
1037 ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1081 ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev,
1038 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1082 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1039SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1, 1083SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1,
1040 ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1084 ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev,
1041 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1085 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1042SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, 1086SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
1043 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1087 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index ffc89fab96f..7b198c38f3e 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -169,6 +169,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
169 const struct wm_adsp_region *mem; 169 const struct wm_adsp_region *mem;
170 const char *region_name; 170 const char *region_name;
171 char *file, *text; 171 char *file, *text;
172 void *buf;
172 unsigned int reg; 173 unsigned int reg;
173 int regions = 0; 174 int regions = 0;
174 int ret, offset, type, sizes; 175 int ret, offset, type, sizes;
@@ -322,8 +323,18 @@ static int wm_adsp_load(struct wm_adsp *dsp)
322 } 323 }
323 324
324 if (reg) { 325 if (reg) {
325 ret = regmap_raw_write(regmap, reg, region->data, 326 buf = kmemdup(region->data, le32_to_cpu(region->len),
327 GFP_KERNEL);
328 if (!buf) {
329 adsp_err(dsp, "Out of memory\n");
330 return -ENOMEM;
331 }
332
333 ret = regmap_raw_write(regmap, reg, buf,
326 le32_to_cpu(region->len)); 334 le32_to_cpu(region->len));
335
336 kfree(buf);
337
327 if (ret != 0) { 338 if (ret != 0) {
328 adsp_err(dsp, 339 adsp_err(dsp,
329 "%s.%d: Failed to write %d bytes at %d in %s: %d\n", 340 "%s.%d: Failed to write %d bytes at %d in %s: %d\n",
@@ -359,6 +370,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
359 const char *region_name; 370 const char *region_name;
360 int ret, pos, blocks, type, offset, reg; 371 int ret, pos, blocks, type, offset, reg;
361 char *file; 372 char *file;
373 void *buf;
362 374
363 file = kzalloc(PAGE_SIZE, GFP_KERNEL); 375 file = kzalloc(PAGE_SIZE, GFP_KERNEL);
364 if (file == NULL) 376 if (file == NULL)
@@ -426,6 +438,13 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
426 } 438 }
427 439
428 if (reg) { 440 if (reg) {
441 buf = kmemdup(blk->data, le32_to_cpu(blk->len),
442 GFP_KERNEL);
443 if (!buf) {
444 adsp_err(dsp, "Out of memory\n");
445 return -ENOMEM;
446 }
447
429 ret = regmap_raw_write(regmap, reg, blk->data, 448 ret = regmap_raw_write(regmap, reg, blk->data,
430 le32_to_cpu(blk->len)); 449 le32_to_cpu(blk->len));
431 if (ret != 0) { 450 if (ret != 0) {
@@ -433,6 +452,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
433 "%s.%d: Failed to write to %x in %s\n", 452 "%s.%d: Failed to write to %x in %s\n",
434 file, blocks, reg, region_name); 453 file, blocks, reg, region_name);
435 } 454 }
455
456 kfree(buf);
436 } 457 }
437 458
438 pos += le32_to_cpu(blk->len) + sizeof(*blk); 459 pos += le32_to_cpu(blk->len) + sizeof(*blk);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 91d592ff67b..2370063b582 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1255,6 +1255,8 @@ static int soc_post_component_init(struct snd_soc_card *card,
1255 INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients); 1255 INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients);
1256 ret = device_add(rtd->dev); 1256 ret = device_add(rtd->dev);
1257 if (ret < 0) { 1257 if (ret < 0) {
1258 /* calling put_device() here to free the rtd->dev */
1259 put_device(rtd->dev);
1258 dev_err(card->dev, 1260 dev_err(card->dev,
1259 "ASoC: failed to register runtime device: %d\n", ret); 1261 "ASoC: failed to register runtime device: %d\n", ret);
1260 return ret; 1262 return ret;
@@ -1554,7 +1556,7 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num)
1554 /* unregister the rtd device */ 1556 /* unregister the rtd device */
1555 if (rtd->dev_registered) { 1557 if (rtd->dev_registered) {
1556 device_remove_file(rtd->dev, &dev_attr_codec_reg); 1558 device_remove_file(rtd->dev, &dev_attr_codec_reg);
1557 device_del(rtd->dev); 1559 device_unregister(rtd->dev);
1558 rtd->dev_registered = 0; 1560 rtd->dev_registered = 0;
1559 } 1561 }
1560 1562
@@ -2917,7 +2919,7 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
2917 platform_max = mc->platform_max; 2919 platform_max = mc->platform_max;
2918 2920
2919 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2921 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2920 uinfo->count = 1; 2922 uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
2921 uinfo->value.integer.min = 0; 2923 uinfo->value.integer.min = 0;
2922 uinfo->value.integer.max = platform_max - min; 2924 uinfo->value.integer.max = platform_max - min;
2923 2925
@@ -2941,12 +2943,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2941 (struct soc_mixer_control *)kcontrol->private_value; 2943 (struct soc_mixer_control *)kcontrol->private_value;
2942 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2944 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
2943 unsigned int reg = mc->reg; 2945 unsigned int reg = mc->reg;
2946 unsigned int rreg = mc->rreg;
2944 unsigned int shift = mc->shift; 2947 unsigned int shift = mc->shift;
2945 int min = mc->min; 2948 int min = mc->min;
2946 int max = mc->max; 2949 int max = mc->max;
2947 unsigned int mask = (1 << fls(max)) - 1; 2950 unsigned int mask = (1 << fls(max)) - 1;
2948 unsigned int invert = mc->invert; 2951 unsigned int invert = mc->invert;
2949 unsigned int val, val_mask; 2952 unsigned int val, val_mask;
2953 int ret;
2950 2954
2951 val = ((ucontrol->value.integer.value[0] + min) & mask); 2955 val = ((ucontrol->value.integer.value[0] + min) & mask);
2952 if (invert) 2956 if (invert)
@@ -2954,7 +2958,21 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2954 val_mask = mask << shift; 2958 val_mask = mask << shift;
2955 val = val << shift; 2959 val = val << shift;
2956 2960
2957 return snd_soc_update_bits_locked(codec, reg, val_mask, val); 2961 ret = snd_soc_update_bits_locked(codec, reg, val_mask, val);
2962 if (ret != 0)
2963 return ret;
2964
2965 if (snd_soc_volsw_is_stereo(mc)) {
2966 val = ((ucontrol->value.integer.value[1] + min) & mask);
2967 if (invert)
2968 val = max - val;
2969 val_mask = mask << shift;
2970 val = val << shift;
2971
2972 ret = snd_soc_update_bits_locked(codec, rreg, val_mask, val);
2973 }
2974
2975 return ret;
2958} 2976}
2959EXPORT_SYMBOL_GPL(snd_soc_put_volsw_range); 2977EXPORT_SYMBOL_GPL(snd_soc_put_volsw_range);
2960 2978
@@ -2974,6 +2992,7 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2974 (struct soc_mixer_control *)kcontrol->private_value; 2992 (struct soc_mixer_control *)kcontrol->private_value;
2975 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2993 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
2976 unsigned int reg = mc->reg; 2994 unsigned int reg = mc->reg;
2995 unsigned int rreg = mc->rreg;
2977 unsigned int shift = mc->shift; 2996 unsigned int shift = mc->shift;
2978 int min = mc->min; 2997 int min = mc->min;
2979 int max = mc->max; 2998 int max = mc->max;
@@ -2988,6 +3007,16 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2988 ucontrol->value.integer.value[0] = 3007 ucontrol->value.integer.value[0] =
2989 ucontrol->value.integer.value[0] - min; 3008 ucontrol->value.integer.value[0] - min;
2990 3009
3010 if (snd_soc_volsw_is_stereo(mc)) {
3011 ucontrol->value.integer.value[1] =
3012 (snd_soc_read(codec, rreg) >> shift) & mask;
3013 if (invert)
3014 ucontrol->value.integer.value[1] =
3015 max - ucontrol->value.integer.value[1];
3016 ucontrol->value.integer.value[1] =
3017 ucontrol->value.integer.value[1] - min;
3018 }
3019
2991 return 0; 3020 return 0;
2992} 3021}
2993EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range); 3022EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d7711fce119..cf191e6aebb 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1243,6 +1243,7 @@ static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream)
1243 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && 1243 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
1244 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && 1244 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
1245 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && 1245 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
1246 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) &&
1246 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) 1247 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
1247 continue; 1248 continue;
1248 1249
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index c183d34842a..34b9bb7fe87 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card,
2181 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; 2181 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
2182 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 2182 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
2183 break; 2183 break;
2184 case QUIRK_MIDI_MBOX2:
2185 umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops;
2186 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
2187 break;
2188 case QUIRK_MIDI_RAW_BYTES: 2184 case QUIRK_MIDI_RAW_BYTES:
2189 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; 2185 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
2190 /* 2186 /*
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 0422b1360af..15520de1df5 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -1206,7 +1206,7 @@ static int snd_c400_create_mixer(struct usb_mixer_interface *mixer)
1206 * are valid they presents mono controls as L and R channels of 1206 * are valid they presents mono controls as L and R channels of
1207 * stereo. So we provide a good mixer here. 1207 * stereo. So we provide a good mixer here.
1208 */ 1208 */
1209struct std_mono_table ebox44_table[] = { 1209static struct std_mono_table ebox44_table[] = {
1210 { 1210 {
1211 .unitid = 4, 1211 .unitid = 4,
1212 .control = 1, 1212 .control = 1,
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index c6593101c04..d82e378d37c 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -511,6 +511,16 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs)
511 struct snd_usb_substream *sync_subs = 511 struct snd_usb_substream *sync_subs =
512 &subs->stream->substream[subs->direction ^ 1]; 512 &subs->stream->substream[subs->direction ^ 1];
513 513
514 if (subs->sync_endpoint->type != SND_USB_ENDPOINT_TYPE_DATA ||
515 !subs->stream)
516 return snd_usb_endpoint_set_params(subs->sync_endpoint,
517 subs->pcm_format,
518 subs->channels,
519 subs->period_bytes,
520 subs->cur_rate,
521 subs->cur_audiofmt,
522 NULL);
523
514 /* Try to find the best matching audioformat. */ 524 /* Try to find the best matching audioformat. */
515 list_for_each_entry(fp, &sync_subs->fmt_list, list) { 525 list_for_each_entry(fp, &sync_subs->fmt_list, list) {
516 int score = match_endpoint_audioformats(fp, subs->cur_audiofmt, 526 int score = match_endpoint_audioformats(fp, subs->cur_audiofmt,
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index cdcf6b45e8a..78e845ec65d 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -50,6 +50,28 @@
50 } 50 }
51}, 51},
52 52
53{
54 /* Creative BT-D1 */
55 USB_DEVICE(0x041e, 0x0005),
56 .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
57 .ifnum = 1,
58 .type = QUIRK_AUDIO_FIXED_ENDPOINT,
59 .data = &(const struct audioformat) {
60 .formats = SNDRV_PCM_FMTBIT_S16_LE,
61 .channels = 2,
62 .iface = 1,
63 .altsetting = 1,
64 .altset_idx = 1,
65 .endpoint = 0x03,
66 .ep_attr = USB_ENDPOINT_XFER_ISOC,
67 .attributes = 0,
68 .rates = SNDRV_PCM_RATE_CONTINUOUS,
69 .rate_min = 48000,
70 .rate_max = 48000,
71 }
72 }
73},
74
53/* Creative/Toshiba Multimedia Center SB-0500 */ 75/* Creative/Toshiba Multimedia Center SB-0500 */
54{ 76{
55 USB_DEVICE(0x041e, 0x3048), 77 USB_DEVICE(0x041e, 0x3048),
@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
2993 }, 3015 },
2994 { 3016 {
2995 .ifnum = 6, 3017 .ifnum = 6,
2996 .type = QUIRK_MIDI_MBOX2, 3018 .type = QUIRK_MIDI_MIDIMAN,
2997 .data = &(const struct snd_usb_midi_endpoint_info) { 3019 .data = &(const struct snd_usb_midi_endpoint_info) {
2998 .out_ep = 0x02, 3020 .out_ep = 0x02,
2999 .out_cables = 0x0001, 3021 .out_cables = 0x0001,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index f104c68fe1e..acc12f004c2 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, 306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, 307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, 308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
309 [QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
310 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, 309 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
311 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, 310 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
312 [QUIRK_MIDI_CME] = create_any_midi_quirk, 311 [QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
528#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ 527#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */
529#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ 528#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
530 529
531int snd_usb_mbox2_boot_quirk(struct usb_device *dev) 530static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
532{ 531{
533 struct usb_host_config *config = dev->actconfig; 532 struct usb_host_config *config = dev->actconfig;
534 int err; 533 int err;
535 u8 bootresponse; 534 u8 bootresponse[12];
536 int fwsize; 535 int fwsize;
537 int count; 536 int count;
538 537
@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
546 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); 545 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
547 546
548 count = 0; 547 count = 0;
549 bootresponse = MBOX2_BOOT_LOADING; 548 bootresponse[0] = MBOX2_BOOT_LOADING;
550 while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) { 549 while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
551 msleep(500); /* 0.5 second delay */ 550 msleep(500); /* 0.5 second delay */
552 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 551 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
553 /* Control magic - load onboard firmware */ 552 /* Control magic - load onboard firmware */
554 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); 553 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
555 if (bootresponse == MBOX2_BOOT_READY) 554 if (bootresponse[0] == MBOX2_BOOT_READY)
556 break; 555 break;
557 snd_printd("usb-audio: device not ready, resending boot sequence...\n"); 556 snd_printd("usb-audio: device not ready, resending boot sequence...\n");
558 count++; 557 count++;
559 } 558 }
560 559
561 if (bootresponse != MBOX2_BOOT_READY) { 560 if (bootresponse[0] != MBOX2_BOOT_READY) {
562 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse); 561 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
563 return -ENODEV; 562 return -ENODEV;
564 } 563 }
565 564
@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
660 return 0; /* keep this altsetting */ 659 return 0; /* keep this altsetting */
661} 660}
662 661
663
664static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, 662static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
665 int iface, int altno) 663 int iface, int altno)
666{ 664{
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index a8172c11979..1ac3fd9cc5a 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -76,7 +76,6 @@ enum quirk_type {
76 QUIRK_MIDI_YAMAHA, 76 QUIRK_MIDI_YAMAHA,
77 QUIRK_MIDI_MIDIMAN, 77 QUIRK_MIDI_MIDIMAN,
78 QUIRK_MIDI_NOVATION, 78 QUIRK_MIDI_NOVATION,
79 QUIRK_MIDI_MBOX2,
80 QUIRK_MIDI_RAW_BYTES, 79 QUIRK_MIDI_RAW_BYTES,
81 QUIRK_MIDI_EMAGIC, 80 QUIRK_MIDI_EMAGIC,
82 QUIRK_MIDI_CME, 81 QUIRK_MIDI_CME,
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
new file mode 100644
index 00000000000..5386fd7c43a
--- /dev/null
+++ b/tools/testing/selftests/ipc/Makefile
@@ -0,0 +1,25 @@
1uname_M := $(shell uname -m 2>/dev/null || echo not)
2ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
3ifeq ($(ARCH),i386)
4 ARCH := X86
5 CFLAGS := -DCONFIG_X86_32 -D__i386__
6endif
7ifeq ($(ARCH),x86_64)
8 ARCH := X86
9 CFLAGS := -DCONFIG_X86_64 -D__x86_64__
10endif
11
12CFLAGS += -I../../../../usr/include/
13
14all:
15ifeq ($(ARCH),X86)
16 gcc $(CFLAGS) msgque.c -o msgque_test
17else
18 echo "Not an x86 target, can't build msgque selftest"
19endif
20
21run_tests: all
22 ./msgque_test
23
24clean:
25 rm -fr ./msgque_test
diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
new file mode 100644
index 00000000000..d66418237d2
--- /dev/null
+++ b/tools/testing/selftests/ipc/msgque.c
@@ -0,0 +1,246 @@
1#include <stdlib.h>
2#include <stdio.h>
3#include <string.h>
4#include <errno.h>
5#include <linux/msg.h>
6#include <fcntl.h>
7
8#define MAX_MSG_SIZE 32
9
10struct msg1 {
11 int msize;
12 long mtype;
13 char mtext[MAX_MSG_SIZE];
14};
15
16#define TEST_STRING "Test sysv5 msg"
17#define MSG_TYPE 1
18
19#define ANOTHER_TEST_STRING "Yet another test sysv5 msg"
20#define ANOTHER_MSG_TYPE 26538
21
22struct msgque_data {
23 key_t key;
24 int msq_id;
25 int qbytes;
26 int qnum;
27 int mode;
28 struct msg1 *messages;
29};
30
31int restore_queue(struct msgque_data *msgque)
32{
33 int fd, ret, id, i;
34 char buf[32];
35
36 fd = open("/proc/sys/kernel/msg_next_id", O_WRONLY);
37 if (fd == -1) {
38 printf("Failed to open /proc/sys/kernel/msg_next_id\n");
39 return -errno;
40 }
41 sprintf(buf, "%d", msgque->msq_id);
42
43 ret = write(fd, buf, strlen(buf));
44 if (ret != strlen(buf)) {
45 printf("Failed to write to /proc/sys/kernel/msg_next_id\n");
46 return -errno;
47 }
48
49 id = msgget(msgque->key, msgque->mode | IPC_CREAT | IPC_EXCL);
50 if (id == -1) {
51 printf("Failed to create queue\n");
52 return -errno;
53 }
54
55 if (id != msgque->msq_id) {
56 printf("Restored queue has wrong id (%d instead of %d)\n",
57 id, msgque->msq_id);
58 ret = -EFAULT;
59 goto destroy;
60 }
61
62 for (i = 0; i < msgque->qnum; i++) {
63 if (msgsnd(msgque->msq_id, &msgque->messages[i].mtype,
64 msgque->messages[i].msize, IPC_NOWAIT) != 0) {
65 printf("msgsnd failed (%m)\n");
66 ret = -errno;
67 goto destroy;
68 };
69 }
70 return 0;
71
72destroy:
73 if (msgctl(id, IPC_RMID, 0))
74 printf("Failed to destroy queue: %d\n", -errno);
75 return ret;
76}
77
78int check_and_destroy_queue(struct msgque_data *msgque)
79{
80 struct msg1 message;
81 int cnt = 0, ret;
82
83 while (1) {
84 ret = msgrcv(msgque->msq_id, &message.mtype, MAX_MSG_SIZE,
85 0, IPC_NOWAIT);
86 if (ret < 0) {
87 if (errno == ENOMSG)
88 break;
89 printf("Failed to read IPC message: %m\n");
90 ret = -errno;
91 goto err;
92 }
93 if (ret != msgque->messages[cnt].msize) {
94 printf("Wrong message size: %d (expected %d)\n", ret,
95 msgque->messages[cnt].msize);
96 ret = -EINVAL;
97 goto err;
98 }
99 if (message.mtype != msgque->messages[cnt].mtype) {
100 printf("Wrong message type\n");
101 ret = -EINVAL;
102 goto err;
103 }
104 if (memcmp(message.mtext, msgque->messages[cnt].mtext, ret)) {
105 printf("Wrong message content\n");
106 ret = -EINVAL;
107 goto err;
108 }
109 cnt++;
110 }
111
112 if (cnt != msgque->qnum) {
113 printf("Wrong message number\n");
114 ret = -EINVAL;
115 goto err;
116 }
117
118 ret = 0;
119err:
120 if (msgctl(msgque->msq_id, IPC_RMID, 0)) {
121 printf("Failed to destroy queue: %d\n", -errno);
122 return -errno;
123 }
124 return ret;
125}
126
127int dump_queue(struct msgque_data *msgque)
128{
129 struct msqid64_ds ds;
130 int kern_id;
131 int i, ret;
132
133 for (kern_id = 0; kern_id < 256; kern_id++) {
134 ret = msgctl(kern_id, MSG_STAT, &ds);
135 if (ret < 0) {
136 if (errno == -EINVAL)
137 continue;
138 printf("Failed to get stats for IPC queue with id %d\n",
139 kern_id);
140 return -errno;
141 }
142
143 if (ret == msgque->msq_id)
144 break;
145 }
146
147 msgque->messages = malloc(sizeof(struct msg1) * ds.msg_qnum);
148 if (msgque->messages == NULL) {
149 printf("Failed to get stats for IPC queue\n");
150 return -ENOMEM;
151 }
152
153 msgque->qnum = ds.msg_qnum;
154 msgque->mode = ds.msg_perm.mode;
155 msgque->qbytes = ds.msg_qbytes;
156
157 for (i = 0; i < msgque->qnum; i++) {
158 ret = msgrcv(msgque->msq_id, &msgque->messages[i].mtype,
159 MAX_MSG_SIZE, i, IPC_NOWAIT | MSG_COPY);
160 if (ret < 0) {
161 printf("Failed to copy IPC message: %m (%d)\n", errno);
162 return -errno;
163 }
164 msgque->messages[i].msize = ret;
165 }
166 return 0;
167}
168
169int fill_msgque(struct msgque_data *msgque)
170{
171 struct msg1 msgbuf;
172
173 msgbuf.mtype = MSG_TYPE;
174 memcpy(msgbuf.mtext, TEST_STRING, sizeof(TEST_STRING));
175 if (msgsnd(msgque->msq_id, &msgbuf.mtype, sizeof(TEST_STRING),
176 IPC_NOWAIT) != 0) {
177 printf("First message send failed (%m)\n");
178 return -errno;
179 };
180
181 msgbuf.mtype = ANOTHER_MSG_TYPE;
182 memcpy(msgbuf.mtext, ANOTHER_TEST_STRING, sizeof(ANOTHER_TEST_STRING));
183 if (msgsnd(msgque->msq_id, &msgbuf.mtype, sizeof(ANOTHER_TEST_STRING),
184 IPC_NOWAIT) != 0) {
185 printf("Second message send failed (%m)\n");
186 return -errno;
187 };
188 return 0;
189}
190
191int main(int argc, char **argv)
192{
193 int msg, pid, err;
194 struct msgque_data msgque;
195
196 msgque.key = ftok(argv[0], 822155650);
197 if (msgque.key == -1) {
198 printf("Can't make key\n");
199 return -errno;
200 }
201
202 msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
203 if (msgque.msq_id == -1) {
204 printf("Can't create queue\n");
205 goto err_out;
206 }
207
208 err = fill_msgque(&msgque);
209 if (err) {
210 printf("Failed to fill queue\n");
211 goto err_destroy;
212 }
213
214 err = dump_queue(&msgque);
215 if (err) {
216 printf("Failed to dump queue\n");
217 goto err_destroy;
218 }
219
220 err = check_and_destroy_queue(&msgque);
221 if (err) {
222 printf("Failed to check and destroy queue\n");
223 goto err_out;
224 }
225
226 err = restore_queue(&msgque);
227 if (err) {
228 printf("Failed to restore queue\n");
229 goto err_destroy;
230 }
231
232 err = check_and_destroy_queue(&msgque);
233 if (err) {
234 printf("Failed to test queue\n");
235 goto err_out;
236 }
237 return 0;
238
239err_destroy:
240 if (msgctl(msgque.msq_id, IPC_RMID, 0)) {
241 printf("Failed to destroy queue: %d\n", -errno);
242 return -errno;
243 }
244err_out:
245 return err;
246}