aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acorn/block/mfmhd.c1
-rw-r--r--drivers/acpi/Kconfig7
-rw-r--r--drivers/acpi/Makefile1
-rw-r--r--drivers/acpi/ac.c63
-rw-r--r--drivers/acpi/acpi_memhotplug.c137
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/battery.c122
-rw-r--r--drivers/acpi/bus.c128
-rw-r--r--drivers/acpi/button.c72
-rw-r--r--drivers/acpi/container.c36
-rw-r--r--drivers/acpi/debug.c19
-rw-r--r--drivers/acpi/dispatcher/dsinit.c30
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c330
-rw-r--r--drivers/acpi/dispatcher/dswexec.c4
-rw-r--r--drivers/acpi/dispatcher/dswload.c49
-rw-r--r--drivers/acpi/dock.c739
-rw-r--r--drivers/acpi/ec.c168
-rw-r--r--drivers/acpi/event.c19
-rw-r--r--drivers/acpi/events/evgpe.c14
-rw-r--r--drivers/acpi/events/evxface.c47
-rw-r--r--drivers/acpi/executer/exconfig.c8
-rw-r--r--drivers/acpi/executer/excreate.c27
-rw-r--r--drivers/acpi/executer/exdump.c8
-rw-r--r--drivers/acpi/executer/exfldio.c71
-rw-r--r--drivers/acpi/executer/exmutex.c12
-rw-r--r--drivers/acpi/executer/exsystem.c82
-rw-r--r--drivers/acpi/fan.c51
-rw-r--r--drivers/acpi/hardware/hwregs.c77
-rw-r--r--drivers/acpi/hotkey.c132
-rw-r--r--drivers/acpi/motherboard.c5
-rw-r--r--drivers/acpi/namespace/nsaccess.c27
-rw-r--r--drivers/acpi/numa.c1
-rw-r--r--drivers/acpi/osl.c73
-rw-r--r--drivers/acpi/parser/psparse.c18
-rw-r--r--drivers/acpi/pci_bind.c87
-rw-r--r--drivers/acpi/pci_irq.c92
-rw-r--r--drivers/acpi/pci_link.c189
-rw-r--r--drivers/acpi/pci_root.c39
-rw-r--r--drivers/acpi/power.c145
-rw-r--r--drivers/acpi/processor_core.c161
-rw-r--r--drivers/acpi/processor_idle.c129
-rw-r--r--drivers/acpi/processor_perflib.c132
-rw-r--r--drivers/acpi/processor_thermal.c48
-rw-r--r--drivers/acpi/processor_throttling.c45
-rw-r--r--drivers/acpi/scan.c109
-rw-r--r--drivers/acpi/system.c21
-rw-r--r--drivers/acpi/tables.c1
-rw-r--r--drivers/acpi/thermal.c218
-rw-r--r--drivers/acpi/utilities/utdelete.c36
-rw-r--r--drivers/acpi/utilities/utglobal.c1
-rw-r--r--drivers/acpi/utilities/utmisc.c3
-rw-r--r--drivers/acpi/utilities/utmutex.c39
-rw-r--r--drivers/acpi/utils.c104
-rw-r--r--drivers/acpi/video.c270
-rw-r--r--drivers/atm/adummy.c1
-rw-r--r--drivers/atm/ambassador.h1
-rw-r--r--drivers/atm/eni.c1
-rw-r--r--drivers/atm/fore200e.c1
-rw-r--r--drivers/atm/fore200e.h1
-rw-r--r--drivers/atm/he.c1
-rw-r--r--drivers/atm/horizon.h1
-rw-r--r--drivers/atm/idt77252.c1
-rw-r--r--drivers/atm/iphase.h1
-rw-r--r--drivers/atm/nicstar.c1
-rw-r--r--drivers/atm/zatm.c1
-rw-r--r--drivers/atm/zatm.h1
-rw-r--r--drivers/base/bus.c1
-rw-r--r--drivers/base/class.c1
-rw-r--r--drivers/base/core.c1
-rw-r--r--drivers/base/driver.c1
-rw-r--r--drivers/base/power/main.c1
-rw-r--r--drivers/base/power/shutdown.c1
-rw-r--r--drivers/base/sys.c1
-rw-r--r--drivers/block/acsi.c1
-rw-r--r--drivers/block/loop.c1
-rw-r--r--drivers/block/paride/paride.c1
-rw-r--r--drivers/block/pktcdvd.c1
-rw-r--r--drivers/block/ps2esdi.c1
-rw-r--r--drivers/block/rd.c1
-rw-r--r--drivers/block/swim3.c1
-rw-r--r--drivers/block/umem.c1
-rw-r--r--drivers/bluetooth/bcm203x.c1
-rw-r--r--drivers/bluetooth/bfusb.c1
-rw-r--r--drivers/bluetooth/bluecard_cs.c1
-rw-r--r--drivers/bluetooth/bpa10x.c1
-rw-r--r--drivers/bluetooth/bt3c_cs.c1
-rw-r--r--drivers/bluetooth/btuart_cs.c1
-rw-r--r--drivers/bluetooth/dtl1_cs.c1
-rw-r--r--drivers/bluetooth/hci_bcsp.c1
-rw-r--r--drivers/bluetooth/hci_h4.c1
-rw-r--r--drivers/bluetooth/hci_ldisc.c1
-rw-r--r--drivers/bluetooth/hci_usb.c1
-rw-r--r--drivers/bluetooth/hci_vhci.c1
-rw-r--r--drivers/cdrom/cdrom.c1
-rw-r--r--drivers/cdrom/sbpcd.c1
-rw-r--r--drivers/char/agp/amd64-agp.c1
-rw-r--r--drivers/char/agp/generic.c1
-rw-r--r--drivers/char/amiserial.c1
-rw-r--r--drivers/char/consolemap.c1
-rw-r--r--drivers/char/cyclades.c1
-rw-r--r--drivers/char/decserial.c1
-rw-r--r--drivers/char/drm/drm.h1
-rw-r--r--drivers/char/drm/drmP.h1
-rw-r--r--drivers/char/drm/drm_memory.c1
-rw-r--r--drivers/char/drm/drm_memory.h1
-rw-r--r--drivers/char/drm/drm_memory_debug.h1
-rw-r--r--drivers/char/drm/drm_scatter.c1
-rw-r--r--drivers/char/drm/drm_sysfs.c1
-rw-r--r--drivers/char/drm/ffb_drv.c1
-rw-r--r--drivers/char/drm/i810_drv.c1
-rw-r--r--drivers/char/drm/i830_drv.c1
-rw-r--r--drivers/char/drm/mga_drv.c1
-rw-r--r--drivers/char/drm/r128_drv.c1
-rw-r--r--drivers/char/drm/radeon_drv.c1
-rw-r--r--drivers/char/drm/savage_drv.c1
-rw-r--r--drivers/char/drm/sis_drv.c1
-rw-r--r--drivers/char/drm/tdfx_drv.c1
-rw-r--r--drivers/char/drm/via_drv.c1
-rw-r--r--drivers/char/ds1302.c1
-rw-r--r--drivers/char/ds1620.c1
-rw-r--r--drivers/char/ec3104_keyb.c1
-rw-r--r--drivers/char/epca.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-calibr.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-ctl.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-init.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-proc.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-setup.c1
-rw-r--r--drivers/char/ftape/lowlevel/ftape-tracing.h1
-rw-r--r--drivers/char/ftape/lowlevel/ftape_syms.c1
-rw-r--r--drivers/char/ftape/zftape/zftape-ctl.c1
-rw-r--r--drivers/char/ftape/zftape/zftape-ctl.h1
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c1
-rw-r--r--drivers/char/genrtc.c1
-rw-r--r--drivers/char/hpet.c1
-rw-r--r--drivers/char/hvc_console.c1
-rw-r--r--drivers/char/ip2/i2ellis.h1
-rw-r--r--drivers/char/ip2/ip2main.c1
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c1
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c1
-rw-r--r--drivers/char/ipmi/ipmi_poweroff.c1
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c1
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c1
-rw-r--r--drivers/char/isicom.c4
-rw-r--r--drivers/char/istallion.c1
-rw-r--r--drivers/char/keyboard.c1
-rw-r--r--drivers/char/lcd.c1
-rw-r--r--drivers/char/lp.c1
-rw-r--r--drivers/char/mbcs.c1
-rw-r--r--drivers/char/mem.c1
-rw-r--r--drivers/char/misc.c1
-rw-r--r--drivers/char/moxa.c1
-rw-r--r--drivers/char/mwave/3780i.c1
-rw-r--r--drivers/char/mxser.c1
-rw-r--r--drivers/char/n_hdlc.c1
-rw-r--r--drivers/char/nvram.c1
-rw-r--r--drivers/char/nwbutton.c1
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c7
-rw-r--r--drivers/char/pty.c1
-rw-r--r--drivers/char/qtronix.c1
-rw-r--r--drivers/char/random.c1
-rw-r--r--drivers/char/rio/rio_linux.c1
-rw-r--r--drivers/char/rio/rio_linux.h1
-rw-r--r--drivers/char/rio/rioinit.c1
-rw-r--r--drivers/char/rtc.c1
-rw-r--r--drivers/char/serial167.c1
-rw-r--r--drivers/char/sonypi.c1
-rw-r--r--drivers/char/specialix.c1
-rw-r--r--drivers/char/stallion.c1
-rw-r--r--drivers/char/synclink_gt.c1
-rw-r--r--drivers/char/synclinkmp.c1
-rw-r--r--drivers/char/sysrq.c1
-rw-r--r--drivers/char/tipar.c1
-rw-r--r--drivers/char/tlclk.c1
-rw-r--r--drivers/char/tty_io.c1
-rw-r--r--drivers/char/vc_screen.c1
-rw-r--r--drivers/char/viocons.c1
-rw-r--r--drivers/char/viotape.c1
-rw-r--r--drivers/char/vme_scc.c1
-rw-r--r--drivers/char/vt.c1
-rw-r--r--drivers/char/vt_ioctl.c1
-rw-r--r--drivers/char/watchdog/at91_wdt.c1
-rw-r--r--drivers/char/watchdog/booke_wdt.c1
-rw-r--r--drivers/char/watchdog/eurotechwdt.c1
-rw-r--r--drivers/char/watchdog/ib700wdt.c1
-rw-r--r--drivers/char/watchdog/ibmasr.c1
-rw-r--r--drivers/char/watchdog/indydog.c1
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c1
-rw-r--r--drivers/char/watchdog/ixp4xx_wdt.c1
-rw-r--r--drivers/char/watchdog/machzwd.c1
-rw-r--r--drivers/char/watchdog/mixcomwd.c1
-rw-r--r--drivers/char/watchdog/mpc83xx_wdt.c1
-rw-r--r--drivers/char/watchdog/mpc8xx_wdt.c1
-rw-r--r--drivers/char/watchdog/mpcore_wdt.c1
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c1
-rw-r--r--drivers/char/watchdog/pcwd_usb.c1
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c1
-rw-r--r--drivers/char/watchdog/sa1100_wdt.c1
-rw-r--r--drivers/char/watchdog/sbc8360.c1
-rw-r--r--drivers/char/watchdog/sbc_epx_c3.c1
-rw-r--r--drivers/char/watchdog/sc1200wdt.c1
-rw-r--r--drivers/char/watchdog/scx200_wdt.c1
-rw-r--r--drivers/char/watchdog/shwdt.c1
-rw-r--r--drivers/char/watchdog/softdog.c1
-rw-r--r--drivers/char/watchdog/w83977f_wdt.c1
-rw-r--r--drivers/char/watchdog/wd501p.h1
-rw-r--r--drivers/char/watchdog/wdrtas.c1
-rw-r--r--drivers/char/watchdog/wdt.c1
-rw-r--r--drivers/char/watchdog/wdt977.c1
-rw-r--r--drivers/char/watchdog/wdt_pci.c1
-rw-r--r--drivers/cpufreq/cpufreq.c1
-rw-r--r--drivers/cpufreq/cpufreq_stats.c1
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c1
-rw-r--r--drivers/edac/amd76x_edac.c1
-rw-r--r--drivers/edac/e752x_edac.c1
-rw-r--r--drivers/edac/e7xxx_edac.c1
-rw-r--r--drivers/edac/edac_mc.c1
-rw-r--r--drivers/edac/edac_mc.h1
-rw-r--r--drivers/edac/i82860_edac.c1
-rw-r--r--drivers/edac/i82875p_edac.c1
-rw-r--r--drivers/edac/r82600_edac.c1
-rw-r--r--drivers/eisa/virtual_root.c1
-rw-r--r--drivers/fc4/fc_syms.c1
-rw-r--r--drivers/firmware/dell_rbu.c1
-rw-r--r--drivers/firmware/efivars.c1
-rw-r--r--drivers/firmware/pcdp.c1
-rw-r--r--drivers/hwmon/hwmon-vid.c1
-rw-r--r--drivers/hwmon/w83792d.c1
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c1
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c1
-rw-r--r--drivers/i2c/busses/i2c-mpc.c1
-rw-r--r--drivers/i2c/busses/i2c-powermac.c1
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c1
-rw-r--r--drivers/i2c/busses/scx200_i2c.c1
-rw-r--r--drivers/i2c/chips/isp1301_omap.c1
-rw-r--r--drivers/i2c/chips/tps65010.c1
-rw-r--r--drivers/ide/arm/icside.c1
-rw-r--r--drivers/ide/cris/ide-cris.c1
-rw-r--r--drivers/ide/h8300/ide-h8300.c1
-rw-r--r--drivers/ide/ide-cd.c1
-rw-r--r--drivers/ide/ide-disk.c1
-rw-r--r--drivers/ide/ide-dma.c1
-rw-r--r--drivers/ide/ide-floppy.c1
-rw-r--r--drivers/ide/ide-io.c1
-rw-r--r--drivers/ide/ide-iops.c1
-rw-r--r--drivers/ide/ide-lib.c1
-rw-r--r--drivers/ide/ide-probe.c1
-rw-r--r--drivers/ide/ide-proc.c1
-rw-r--r--drivers/ide/ide-tape.c1
-rw-r--r--drivers/ide/ide-taskfile.c1
-rw-r--r--drivers/ide/ide.c1
-rw-r--r--drivers/ide/legacy/ali14xx.c1
-rw-r--r--drivers/ide/legacy/dtc2278.c1
-rw-r--r--drivers/ide/legacy/gayle.c1
-rw-r--r--drivers/ide/legacy/ht6560b.c1
-rw-r--r--drivers/ide/legacy/ide-cs.c81
-rw-r--r--drivers/ide/legacy/macide.c1
-rw-r--r--drivers/ide/legacy/qd65xx.c1
-rw-r--r--drivers/ide/legacy/umc8672.c1
-rw-r--r--drivers/ide/pci/aec62xx.c1
-rw-r--r--drivers/ide/pci/alim15x3.c1
-rw-r--r--drivers/ide/pci/amd74xx.c1
-rw-r--r--drivers/ide/pci/atiixp.c1
-rw-r--r--drivers/ide/pci/cmd640.c1
-rw-r--r--drivers/ide/pci/cmd64x.c1
-rw-r--r--drivers/ide/pci/cs5520.c1
-rw-r--r--drivers/ide/pci/cs5530.c1
-rw-r--r--drivers/ide/pci/cs5535.c1
-rw-r--r--drivers/ide/pci/cy82c693.c1
-rw-r--r--drivers/ide/pci/hpt34x.c1
-rw-r--r--drivers/ide/pci/hpt366.c1
-rw-r--r--drivers/ide/pci/it8172.c1
-rw-r--r--drivers/ide/pci/it821x.c1
-rw-r--r--drivers/ide/pci/ns87415.c1
-rw-r--r--drivers/ide/pci/pdc202xx_new.c1
-rw-r--r--drivers/ide/pci/pdc202xx_old.c1
-rw-r--r--drivers/ide/pci/piix.c1
-rw-r--r--drivers/ide/pci/sc1200.c1
-rw-r--r--drivers/ide/pci/serverworks.c1
-rw-r--r--drivers/ide/pci/siimage.c1
-rw-r--r--drivers/ide/pci/sis5513.c1
-rw-r--r--drivers/ide/pci/sl82c105.c1
-rw-r--r--drivers/ide/pci/slc90e66.c1
-rw-r--r--drivers/ide/pci/triflex.c1
-rw-r--r--drivers/ide/pci/trm290.c1
-rw-r--r--drivers/ide/pci/via82cxxx.c1
-rw-r--r--drivers/ide/ppc/mpc8xx.c1
-rw-r--r--drivers/ide/ppc/pmac.c1
-rw-r--r--drivers/ide/setup-pci.c1
-rw-r--r--drivers/ieee1394/config_roms.c1
-rw-r--r--drivers/ieee1394/dv1394.c1
-rw-r--r--drivers/ieee1394/highlevel.c1
-rw-r--r--drivers/ieee1394/hosts.c1
-rw-r--r--drivers/ieee1394/ieee1394_core.c1
-rw-r--r--drivers/ieee1394/nodemgr.c1
-rw-r--r--drivers/ieee1394/ohci1394.c1
-rw-r--r--drivers/ieee1394/oui2c.sh1
-rw-r--r--drivers/ieee1394/pcilynx.c1
-rw-r--r--drivers/ieee1394/pcilynx.h1
-rw-r--r--drivers/ieee1394/sbp2.c1
-rw-r--r--drivers/ieee1394/video1394.c1
-rw-r--r--drivers/infiniband/core/cm.c1
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c1
-rw-r--r--drivers/infiniband/hw/ipath/ipath_intr.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_reset.c1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h1
-rw-r--r--drivers/input/gameport/emu10k1-gp.c1
-rw-r--r--drivers/input/gameport/ns558.c1
-rw-r--r--drivers/input/joystick/analog.c1
-rw-r--r--drivers/input/joystick/iforce/iforce.h1
-rw-r--r--drivers/input/keyboard/hilkbd.c1
-rw-r--r--drivers/input/keyboard/locomokbd.c1
-rw-r--r--drivers/input/misc/sparcspkr.c1
-rw-r--r--drivers/input/mouse/inport.c1
-rw-r--r--drivers/input/mouse/sermouse.c1
-rw-r--r--drivers/input/mouse/vsxxxaa.c1
-rw-r--r--drivers/input/mousedev.c1
-rw-r--r--drivers/input/power.c1
-rw-r--r--drivers/input/serio/ct82c710.c1
-rw-r--r--drivers/input/serio/gscps2.c1
-rw-r--r--drivers/input/serio/i8042-sparcio.h1
-rw-r--r--drivers/input/serio/i8042.c1
-rw-r--r--drivers/input/serio/i8042.h1
-rw-r--r--drivers/input/tsdev.c1
-rw-r--r--drivers/isdn/capi/capi.c1
-rw-r--r--drivers/isdn/capi/capiutil.c1
-rw-r--r--drivers/isdn/divert/divert_procfs.c1
-rw-r--r--drivers/isdn/gigaset/gigaset.h1
-rw-r--r--drivers/isdn/hardware/avm/b1dma.c1
-rw-r--r--drivers/isdn/hardware/avm/b1pci.c1
-rw-r--r--drivers/isdn/hardware/avm/c4.c1
-rw-r--r--drivers/isdn/hardware/avm/t1pci.c1
-rw-r--r--drivers/isdn/hardware/eicon/capimain.c1
-rw-r--r--drivers/isdn/hardware/eicon/diva_didd.c1
-rw-r--r--drivers/isdn/hardware/eicon/divamnt.c1
-rw-r--r--drivers/isdn/hardware/eicon/divasi.c1
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c1
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c1
-rw-r--r--drivers/isdn/hardware/eicon/platform.h1
-rw-r--r--drivers/isdn/hisax/avm_pci.c1
-rw-r--r--drivers/isdn/hisax/bkm_a4t.c1
-rw-r--r--drivers/isdn/hisax/bkm_a8.c1
-rw-r--r--drivers/isdn/hisax/config.c1
-rw-r--r--drivers/isdn/hisax/diva.c1
-rw-r--r--drivers/isdn/hisax/elsa.c1
-rw-r--r--drivers/isdn/hisax/elsa_ser.c1
-rw-r--r--drivers/isdn/hisax/enternow_pci.c1
-rw-r--r--drivers/isdn/hisax/gazel.c1
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c1
-rw-r--r--drivers/isdn/hisax/hfc_pci.c1
-rw-r--r--drivers/isdn/hisax/hfc_usb.c1
-rw-r--r--drivers/isdn/hisax/hisax.h1
-rw-r--r--drivers/isdn/hisax/hisax_debug.h1
-rw-r--r--drivers/isdn/hisax/ipacx.c1
-rw-r--r--drivers/isdn/hisax/isdnl3.c1
-rw-r--r--drivers/isdn/hisax/l3dss1.c1
-rw-r--r--drivers/isdn/hisax/niccy.c1
-rw-r--r--drivers/isdn/hisax/nj_s.c1
-rw-r--r--drivers/isdn/hisax/nj_u.c1
-rw-r--r--drivers/isdn/hisax/sedlbauer.c1
-rw-r--r--drivers/isdn/hisax/st5481.h1
-rw-r--r--drivers/isdn/hisax/st5481_init.c1
-rw-r--r--drivers/isdn/hisax/telespci.c1
-rw-r--r--drivers/isdn/hisax/w6692.c1
-rw-r--r--drivers/isdn/hysdn/boardergo.c1
-rw-r--r--drivers/isdn/hysdn/hysdn_defs.h1
-rw-r--r--drivers/isdn/hysdn/hysdn_init.c1
-rw-r--r--drivers/isdn/hysdn/hysdn_sched.c1
-rw-r--r--drivers/isdn/i4l/isdn_common.c1
-rw-r--r--drivers/isdn/i4l/isdn_net.c1
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.h1
-rw-r--r--drivers/isdn/isdnloop/isdnloop.c1
-rw-r--r--drivers/leds/led-class.c1
-rw-r--r--drivers/leds/led-triggers.c1
-rw-r--r--drivers/leds/leds-corgi.c1
-rw-r--r--drivers/leds/leds-ixp4xx-gpio.c1
-rw-r--r--drivers/leds/leds-locomo.c1
-rw-r--r--drivers/leds/leds-s3c24xx.c1
-rw-r--r--drivers/leds/leds-spitz.c1
-rw-r--r--drivers/leds/leds-tosa.c1
-rw-r--r--drivers/leds/ledtrig-timer.c1
-rw-r--r--drivers/macintosh/adb.c1
-rw-r--r--drivers/macintosh/adbhid.c1
-rw-r--r--drivers/macintosh/apm_emu.c1
-rw-r--r--drivers/macintosh/mac_hid.c1
-rw-r--r--drivers/macintosh/macio_asic.c1
-rw-r--r--drivers/macintosh/macio_sysfs.c1
-rw-r--r--drivers/macintosh/mediabay.c1
-rw-r--r--drivers/macintosh/smu.c1
-rw-r--r--drivers/macintosh/therm_adt746x.c1
-rw-r--r--drivers/macintosh/therm_pm72.c1
-rw-r--r--drivers/macintosh/therm_pm72.h2
-rw-r--r--drivers/macintosh/therm_windtunnel.c1
-rw-r--r--drivers/macintosh/via-cuda.c1
-rw-r--r--drivers/macintosh/via-pmu.c1
-rw-r--r--drivers/macintosh/windfarm_cpufreq_clamp.c1
-rw-r--r--drivers/md/bitmap.c1
-rw-r--r--drivers/md/dm-snap.c1
-rw-r--r--drivers/md/kcopyd.c1
-rw-r--r--drivers/md/md.c1
-rw-r--r--drivers/md/raid5.c1
-rw-r--r--drivers/media/common/saa7146_hlp.c2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-common.h1
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c1
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c4
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h1
-rw-r--r--drivers/media/dvb/frontends/cx22700.c1
-rw-r--r--drivers/media/dvb/frontends/cx24123.c4
-rw-r--r--drivers/media/dvb/frontends/dib3000mb.c1
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c1
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.c2
-rw-r--r--drivers/media/dvb/frontends/tda10021.c1
-rw-r--r--drivers/media/dvb/frontends/ves1820.c1
-rw-r--r--drivers/media/dvb/ttpci/av7110.c1
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c15
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/radio/radio-gemtek-pci.c1
-rw-r--r--drivers/media/video/arv.c1
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c6
-rw-r--r--drivers/media/video/bt8xx/bttvp.h2
-rw-r--r--drivers/media/video/compat_ioctl32.c1
-rw-r--r--drivers/media/video/cpia.c1
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c1
-rw-r--r--drivers/media/video/cpia_pp.c1
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c43
-rw-r--r--drivers/media/video/cx88/cx88-cards.c19
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c28
-rw-r--r--drivers/media/video/cx88/cx88-video.c61
-rw-r--r--drivers/media/video/cx88/cx88.h3
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/meye.c1
-rw-r--r--drivers/media/video/meye.h1
-rw-r--r--drivers/media/video/msp3400-driver.h4
-rw-r--r--drivers/media/video/ov511.c1
-rw-r--r--drivers/media/video/pvrusb2/Makefile2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-audio.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-context.c14
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ctrl.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-debugifc.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-demod.c126
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-demod.h38
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-eeprom.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-encoder.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h17
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c172
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.h32
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-core.c34
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-core.h3
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.c57
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.h13
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.c34
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.h1
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-main.c10
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-std.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c14
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-tuner.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c42
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-video-v4l.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-wm8775.c2
-rw-r--r--drivers/media/video/pwc/pwc-uncompress.h1
-rw-r--r--drivers/media/video/pwc/pwc.h1
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c3
-rw-r--r--drivers/media/video/se401.c1
-rw-r--r--drivers/media/video/stv680.c1
-rw-r--r--drivers/media/video/tda9887.c4
-rw-r--r--drivers/media/video/tuner-core.c12
-rw-r--r--drivers/media/video/tuner-simple.c74
-rw-r--r--drivers/media/video/tuner-types.c38
-rw-r--r--drivers/media/video/tvaudio.c1
-rw-r--r--drivers/media/video/tveeprom.c18
-rw-r--r--drivers/media/video/usbvideo/usbvideo.h1
-rw-r--r--drivers/media/video/v4l1-compat.c1
-rw-r--r--drivers/media/video/v4l2-common.c1
-rw-r--r--drivers/media/video/videocodec.c1
-rw-r--r--drivers/media/video/videocodec.h16
-rw-r--r--drivers/media/video/w9968cf.h1
-rw-r--r--drivers/media/video/zoran_card.c1
-rw-r--r--drivers/media/video/zoran_device.c1
-rw-r--r--drivers/media/video/zoran_driver.c1
-rw-r--r--drivers/media/video/zoran_procfs.c1
-rw-r--r--drivers/media/video/zr36120_mem.c1
-rw-r--r--drivers/message/fusion/mptbase.c3
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/i2o/debug.c1
-rw-r--r--drivers/mfd/ucb1x00-core.c1
-rw-r--r--drivers/mfd/ucb1x00-ts.c1
-rw-r--r--drivers/misc/ibmasm/ibmasm.h1
-rw-r--r--drivers/mmc/at91_mci.c1
-rw-r--r--drivers/mmc/au1xmmc.c1
-rw-r--r--drivers/mmc/imxmmc.c1
-rw-r--r--drivers/mmc/mmc.c1
-rw-r--r--drivers/mmc/mmci.c1
-rw-r--r--drivers/mmc/omap.c1
-rw-r--r--drivers/mmc/pxamci.c1
-rw-r--r--drivers/mmc/wbsd.c1
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c1
-rw-r--r--drivers/mtd/chips/cfi_probe.c1
-rw-r--r--drivers/mtd/chips/chipreg.c1
-rw-r--r--drivers/mtd/chips/jedec_probe.c1
-rw-r--r--drivers/mtd/devices/block2mtd.c1
-rw-r--r--drivers/mtd/devices/docprobe.c1
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c1
-rw-r--r--drivers/mtd/devices/mtdram.c1
-rw-r--r--drivers/mtd/devices/pmc551.c1
-rw-r--r--drivers/mtd/inftlcore.c1
-rw-r--r--drivers/mtd/maps/alchemy-flash.c1
-rw-r--r--drivers/mtd/maps/amd76xrom.c1
-rw-r--r--drivers/mtd/maps/ceiva.c1
-rw-r--r--drivers/mtd/maps/cstm_mips_ixx.c1
-rw-r--r--drivers/mtd/maps/dbox2-flash.c1
-rw-r--r--drivers/mtd/maps/dc21285.c1
-rw-r--r--drivers/mtd/maps/dilnetpc.c1
-rw-r--r--drivers/mtd/maps/dmv182.c1
-rw-r--r--drivers/mtd/maps/ebony.c1
-rw-r--r--drivers/mtd/maps/edb7312.c1
-rw-r--r--drivers/mtd/maps/h720x-flash.c1
-rw-r--r--drivers/mtd/maps/ichxrom.c1
-rw-r--r--drivers/mtd/maps/impa7.c1
-rw-r--r--drivers/mtd/maps/integrator-flash.c1
-rw-r--r--drivers/mtd/maps/ipaq-flash.c1
-rw-r--r--drivers/mtd/maps/l440gx.c1
-rw-r--r--drivers/mtd/maps/lasat.c1
-rw-r--r--drivers/mtd/maps/mpc1211.c1
-rw-r--r--drivers/mtd/maps/mtx-1_flash.c1
-rw-r--r--drivers/mtd/maps/ocotea.c1
-rw-r--r--drivers/mtd/maps/omap-toto-flash.c1
-rw-r--r--drivers/mtd/maps/physmap.c1
-rw-r--r--drivers/mtd/maps/redwood.c1
-rw-r--r--drivers/mtd/maps/sa1100-flash.c1
-rw-r--r--drivers/mtd/maps/sbc8240.c1
-rw-r--r--drivers/mtd/maps/sc520cdp.c1
-rw-r--r--drivers/mtd/maps/scb2_flash.c1
-rw-r--r--drivers/mtd/maps/scx200_docflash.c1
-rw-r--r--drivers/mtd/maps/solutionengine.c1
-rw-r--r--drivers/mtd/maps/tqm834x.c1
-rw-r--r--drivers/mtd/maps/tqm8xxl.c1
-rw-r--r--drivers/mtd/maps/ts5500_flash.c1
-rw-r--r--drivers/mtd/maps/uclinux.c1
-rw-r--r--drivers/mtd/maps/walnut.c1
-rw-r--r--drivers/mtd/maps/wr_sbc82xx_flash.c1
-rw-r--r--drivers/mtd/mtdblock.c1
-rw-r--r--drivers/mtd/mtdchar.c1
-rw-r--r--drivers/mtd/mtdcore.c1
-rw-r--r--drivers/mtd/mtdpart.c1
-rw-r--r--drivers/mtd/nand/nandsim.c1
-rw-r--r--drivers/mtd/nftlcore.c1
-rw-r--r--drivers/net/3c509.c1
-rw-r--r--drivers/net/3c515.c1
-rw-r--r--drivers/net/3c59x.c1
-rw-r--r--drivers/net/8139cp.c1
-rw-r--r--drivers/net/8139too.c1
-rw-r--r--drivers/net/82596.c1
-rw-r--r--drivers/net/8390.h1
-rw-r--r--drivers/net/Space.c1
-rw-r--r--drivers/net/a2065.c1
-rw-r--r--drivers/net/acenic.c1
-rw-r--r--drivers/net/acenic.h1
-rw-r--r--drivers/net/acenic_firmware.h1
-rw-r--r--drivers/net/amd8111e.c1
-rw-r--r--drivers/net/appletalk/cops.c1
-rw-r--r--drivers/net/appletalk/cops_ffdrv.h1
-rw-r--r--drivers/net/appletalk/cops_ltdrv.h1
-rw-r--r--drivers/net/appletalk/ipddp.c1
-rw-r--r--drivers/net/arcnet/arcnet.c1
-rw-r--r--drivers/net/arm/at91_ether.c1
-rw-r--r--drivers/net/at1700.c1
-rw-r--r--drivers/net/au1000_eth.c1
-rw-r--r--drivers/net/bmac.c1
-rw-r--r--drivers/net/bnx2.c1
-rw-r--r--drivers/net/bonding/bond_main.c1
-rw-r--r--drivers/net/bonding/bond_sysfs.c1
-rw-r--r--drivers/net/cassini.c1
-rw-r--r--drivers/net/chelsio/common.h1
-rw-r--r--drivers/net/chelsio/cxgb2.c1
-rw-r--r--drivers/net/chelsio/sge.c1
-rw-r--r--drivers/net/cris/eth_v10.c1
-rw-r--r--drivers/net/cs89x0.c1
-rw-r--r--drivers/net/cs89x0.h1
-rw-r--r--drivers/net/declance.c1
-rw-r--r--drivers/net/depca.c1
-rw-r--r--drivers/net/dl2k.c2
-rw-r--r--drivers/net/dummy.c1
-rw-r--r--drivers/net/e100.c1
-rw-r--r--drivers/net/e1000/e1000.h1
-rw-r--r--drivers/net/eepro100.c1
-rw-r--r--drivers/net/eexpress.c1
-rw-r--r--drivers/net/epic100.c1
-rw-r--r--drivers/net/fec.c1
-rw-r--r--drivers/net/fec_8xx/fec_8xx-netta.c1
-rw-r--r--drivers/net/fec_8xx/fec_main.c1
-rw-r--r--drivers/net/fec_8xx/fec_mii.c1
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c1
-rw-r--r--drivers/net/fs_enet/fs_enet-mii.c1
-rw-r--r--drivers/net/fs_enet/mac-fcc.c1
-rw-r--r--drivers/net/fs_enet/mac-fec.c1
-rw-r--r--drivers/net/fs_enet/mac-scc.c1
-rw-r--r--drivers/net/fs_enet/mii-bitbang.c1
-rw-r--r--drivers/net/fs_enet/mii-fixed.c1
-rw-r--r--drivers/net/gianfar.c1
-rw-r--r--drivers/net/gianfar.h1
-rw-r--r--drivers/net/gianfar_ethtool.c1
-rw-r--r--drivers/net/gianfar_mii.c1
-rw-r--r--drivers/net/gianfar_sysfs.c1
-rw-r--r--drivers/net/gt96100eth.h1
-rw-r--r--drivers/net/hamradio/6pack.c1
-rw-r--r--drivers/net/hamradio/bpqether.c1
-rw-r--r--drivers/net/hamradio/mkiss.c1
-rw-r--r--drivers/net/hamradio/scc.c1
-rw-r--r--drivers/net/hamradio/yam.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_debug.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_debug.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_mal.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_mal.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_phy.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_rgmii.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_rgmii.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_tah.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_tah.h1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.c1
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.h1
-rw-r--r--drivers/net/ibmveth.c1
-rw-r--r--drivers/net/ifb.c1
-rw-r--r--drivers/net/ioc3-eth.c1
-rw-r--r--drivers/net/irda/au1k_ir.c1
-rw-r--r--drivers/net/irda/pxaficp_ir.c1
-rw-r--r--drivers/net/irda/sa1100_ir.c1
-rw-r--r--drivers/net/irda/vlsi_ir.c1
-rw-r--r--drivers/net/iseries_veth.c1
-rw-r--r--drivers/net/ixgb/ixgb.h1
-rw-r--r--drivers/net/ixp2000/caleb.c1
-rw-r--r--drivers/net/ixp2000/enp2611.c1
-rw-r--r--drivers/net/ixp2000/ixp2400-msf.c1
-rw-r--r--drivers/net/ixp2000/ixpdev.c1
-rw-r--r--drivers/net/ixp2000/pm3386.c1
-rw-r--r--drivers/net/mace.c1
-rw-r--r--drivers/net/mv643xx_eth.h2
-rw-r--r--drivers/net/myri_sbus.c1
-rw-r--r--drivers/net/natsemi.c1
-rw-r--r--drivers/net/ns83820.c1
-rw-r--r--drivers/net/pci-skeleton.c1
-rw-r--r--drivers/net/pcmcia/com20020_cs.c5
-rw-r--r--drivers/net/phy/cicada.c1
-rw-r--r--drivers/net/phy/davicom.c1
-rw-r--r--drivers/net/phy/lxt.c1
-rw-r--r--drivers/net/phy/marvell.c1
-rw-r--r--drivers/net/phy/mdio_bus.c1
-rw-r--r--drivers/net/phy/phy.c1
-rw-r--r--drivers/net/phy/phy_device.c1
-rw-r--r--drivers/net/phy/qsemi.c1
-rw-r--r--drivers/net/ppp_generic.c1
-rw-r--r--drivers/net/ppp_mppe.c1
-rw-r--r--drivers/net/rrunner.c1
-rw-r--r--drivers/net/rrunner.h1
-rw-r--r--drivers/net/s2io.c16
-rw-r--r--drivers/net/s2io.h2
-rw-r--r--drivers/net/sb1250-mac.c1
-rw-r--r--drivers/net/shaper.c1
-rw-r--r--drivers/net/sk98lin/skvpd.c2
-rw-r--r--drivers/net/skfp/h/sba.h2
-rw-r--r--drivers/net/skge.c1
-rw-r--r--drivers/net/sky2.c1
-rw-r--r--drivers/net/slhc.c1
-rw-r--r--drivers/net/slip.c1
-rw-r--r--drivers/net/slip.h1
-rw-r--r--drivers/net/smc-ultra.c1
-rw-r--r--drivers/net/smc91x.c1
-rw-r--r--drivers/net/sonic.h1
-rw-r--r--drivers/net/spider_net.c1
-rw-r--r--drivers/net/starfire.c1
-rw-r--r--drivers/net/stnic.c1
-rw-r--r--drivers/net/sungem_phy.c1
-rw-r--r--drivers/net/sunhme.c1
-rw-r--r--drivers/net/sunhme.h1
-rw-r--r--drivers/net/sunlance.c1
-rw-r--r--drivers/net/tg3.c108
-rw-r--r--drivers/net/tg3.h5
-rw-r--r--drivers/net/tokenring/3c359.c1
-rw-r--r--drivers/net/tokenring/lanstreamer.c1
-rw-r--r--drivers/net/tokenring/olympic.c1
-rw-r--r--drivers/net/tokenring/smctr.c1
-rw-r--r--drivers/net/tokenring/smctr_firmware.h1
-rw-r--r--drivers/net/tulip/de2104x.c1
-rw-r--r--drivers/net/tulip/de4x5.c1
-rw-r--r--drivers/net/tulip/interrupt.c1
-rw-r--r--drivers/net/tulip/tulip.h1
-rw-r--r--drivers/net/tulip/tulip_core.c1
-rw-r--r--drivers/net/tulip/xircom_tulip_cb.c1
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/via-velocity.c2
-rw-r--r--drivers/net/wan/cosa.c1
-rw-r--r--drivers/net/wan/hdlc_generic.c1
-rw-r--r--drivers/net/wan/lmc/lmc_media.c1
-rw-r--r--drivers/net/wan/sbni.c1
-rw-r--r--drivers/net/wan/syncppp.c1
-rw-r--r--drivers/net/wireless/airo.c1
-rw-r--r--drivers/net/wireless/airo_cs.c1
-rw-r--r--drivers/net/wireless/airport.c1
-rw-r--r--drivers/net/wireless/arlan-main.c1
-rw-r--r--drivers/net/wireless/arlan-proc.c1
-rw-r--r--drivers/net/wireless/arlan.h1
-rw-r--r--drivers/net/wireless/atmel.c1
-rw-r--r--drivers/net/wireless/atmel_cs.c1
-rw-r--r--drivers/net/wireless/atmel_pci.c1
-rw-r--r--drivers/net/wireless/hermes.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c3
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_pci.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_plx.c1
-rw-r--r--drivers/net/wireless/ipw2100.c3
-rw-r--r--drivers/net/wireless/ipw2200.h1
-rw-r--r--drivers/net/wireless/netwave_cs.c1
-rw-r--r--drivers/net/wireless/orinoco.c1
-rw-r--r--drivers/net/wireless/orinoco_cs.c1
-rw-r--r--drivers/net/wireless/orinoco_nortel.c1
-rw-r--r--drivers/net/wireless/orinoco_pci.c1
-rw-r--r--drivers/net/wireless/orinoco_plx.c1
-rw-r--r--drivers/net/wireless/orinoco_tmd.c1
-rw-r--r--drivers/net/wireless/prism54/islpci_mgt.c1
-rw-r--r--drivers/net/wireless/prism54/prismcompat.h1
-rw-r--r--drivers/net/wireless/ray_cs.c1
-rw-r--r--drivers/net/wireless/spectrum_cs.c1
-rw-r--r--drivers/net/wireless/strip.c1
-rw-r--r--drivers/net/wireless/wavelan_cs.p.h1
-rw-r--r--drivers/net/wireless/wl3501_cs.c1
-rw-r--r--drivers/net/znet.c1
-rw-r--r--drivers/nubus/nubus.c1
-rw-r--r--drivers/nubus/nubus_syms.c1
-rw-r--r--drivers/parisc/ccio-dma.c1
-rw-r--r--drivers/parisc/dino.c1
-rw-r--r--drivers/parisc/gsc.c1
-rw-r--r--drivers/parisc/led.c1
-rw-r--r--drivers/parisc/power.c1
-rw-r--r--drivers/parisc/sba_iommu.c1
-rw-r--r--drivers/parport/ieee1284.c1
-rw-r--r--drivers/parport/ieee1284_ops.c1
-rw-r--r--drivers/parport/parport_pc.c1
-rw-r--r--drivers/parport/procfs.c1
-rw-r--r--drivers/parport/share.c1
-rw-r--r--drivers/pci/hotplug/Makefile3
-rw-r--r--drivers/pci/hotplug/acpiphp.h36
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c19
-rw-r--r--drivers/pci/hotplug/acpiphp_dock.c438
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c123
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c1
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c1
-rw-r--r--drivers/pci/hotplug/cpcihp_generic.c1
-rw-r--r--drivers/pci/hotplug/cpcihp_zt5550.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_nvram.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_pci.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c1
-rw-r--r--drivers/pci/hotplug/fakephp.c1
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c1
-rw-r--r--drivers/pci/hotplug/pcihp_skeleton.c1
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c1
-rw-r--r--drivers/pci/msi.c1
-rw-r--r--drivers/pci/pci-sysfs.c1
-rw-r--r--drivers/pci/quirks.c1
-rw-r--r--drivers/pci/rom.c1
-rw-r--r--drivers/pcmcia/at91_cf.c75
-rw-r--r--drivers/pcmcia/au1000_db1x00.c3
-rw-r--r--drivers/pcmcia/au1000_generic.c1
-rw-r--r--drivers/pcmcia/au1000_generic.h1
-rw-r--r--drivers/pcmcia/au1000_pb1x00.c1
-rw-r--r--drivers/pcmcia/cs.c29
-rw-r--r--drivers/pcmcia/m32r_cfc.c1
-rw-r--r--drivers/pcmcia/m32r_pcc.c1
-rw-r--r--drivers/pcmcia/pcmcia_resource.c27
-rw-r--r--drivers/pcmcia/pxa2xx_base.c1
-rw-r--r--drivers/pcmcia/sa1100_generic.c1
-rw-r--r--drivers/pcmcia/sa1111_generic.c1
-rw-r--r--drivers/pcmcia/sa11xx_base.c1
-rw-r--r--drivers/pcmcia/soc_common.c1
-rw-r--r--drivers/pcmcia/ti113x.h1
-rw-r--r--drivers/pcmcia/yenta_socket.c83
-rw-r--r--drivers/pnp/card.c1
-rw-r--r--drivers/pnp/driver.c1
-rw-r--r--drivers/pnp/isapnp/compat.c1
-rw-r--r--drivers/pnp/isapnp/core.c1
-rw-r--r--drivers/pnp/isapnp/proc.c1
-rw-r--r--drivers/pnp/manager.c1
-rw-r--r--drivers/pnp/pnpacpi/core.c1
-rw-r--r--drivers/pnp/pnpbios/rsparser.c1
-rw-r--r--drivers/pnp/quirks.c1
-rw-r--r--drivers/pnp/resource.c1
-rw-r--r--drivers/pnp/support.c1
-rw-r--r--drivers/rapidio/rio-scan.c1
-rw-r--r--drivers/rapidio/rio-sysfs.c1
-rw-r--r--drivers/rapidio/rio.c1
-rw-r--r--drivers/rtc/Kconfig2
-rw-r--r--drivers/s390/block/dasd.c1
-rw-r--r--drivers/s390/block/dasd_devmap.c1
-rw-r--r--drivers/s390/block/dasd_diag.c1
-rw-r--r--drivers/s390/block/dasd_eckd.c1
-rw-r--r--drivers/s390/block/dasd_erp.c1
-rw-r--r--drivers/s390/block/dasd_fba.c1
-rw-r--r--drivers/s390/block/dasd_genhd.c1
-rw-r--r--drivers/s390/block/dasd_ioctl.c1
-rw-r--r--drivers/s390/block/dasd_proc.c1
-rw-r--r--drivers/s390/char/con3215.c1
-rw-r--r--drivers/s390/char/con3270.c1
-rw-r--r--drivers/s390/char/ctrlchar.c1
-rw-r--r--drivers/s390/char/fs3270.c1
-rw-r--r--drivers/s390/char/keyboard.c1
-rw-r--r--drivers/s390/char/raw3270.c1
-rw-r--r--drivers/s390/char/sclp_con.c1
-rw-r--r--drivers/s390/char/sclp_cpi.c1
-rw-r--r--drivers/s390/char/sclp_quiesce.c1
-rw-r--r--drivers/s390/char/sclp_rw.c1
-rw-r--r--drivers/s390/char/sclp_tty.c1
-rw-r--r--drivers/s390/char/sclp_vt220.c1
-rw-r--r--drivers/s390/char/tape.h1
-rw-r--r--drivers/s390/char/tape_34xx.c1
-rw-r--r--drivers/s390/char/tape_3590.c1
-rw-r--r--drivers/s390/char/tape_block.c1
-rw-r--r--drivers/s390/char/tape_char.c1
-rw-r--r--drivers/s390/char/tape_core.c1
-rw-r--r--drivers/s390/char/tape_proc.c1
-rw-r--r--drivers/s390/char/tape_std.c1
-rw-r--r--drivers/s390/char/tty3270.c1
-rw-r--r--drivers/s390/cio/blacklist.c1
-rw-r--r--drivers/s390/cio/chsc.c1
-rw-r--r--drivers/s390/cio/cio.c1
-rw-r--r--drivers/s390/cio/device.c1
-rw-r--r--drivers/s390/cio/device_fsm.c1
-rw-r--r--drivers/s390/cio/device_id.c1
-rw-r--r--drivers/s390/cio/device_ops.c1
-rw-r--r--drivers/s390/cio/device_pgid.c1
-rw-r--r--drivers/s390/cio/device_status.c1
-rw-r--r--drivers/s390/cio/qdio.c1
-rw-r--r--drivers/s390/net/fsm.c1
-rw-r--r--drivers/s390/net/iucv.c1
-rw-r--r--drivers/s390/net/qeth_eddp.c1
-rw-r--r--drivers/s390/net/qeth_main.c1
-rw-r--r--drivers/s390/s390mach.c1
-rw-r--r--drivers/s390/sysinfo.c1
-rw-r--r--drivers/sbus/char/envctrl.c1
-rw-r--r--drivers/sbus/char/flash.c1
-rw-r--r--drivers/sbus/char/openprom.c1
-rw-r--r--drivers/sbus/dvma.c1
-rw-r--r--drivers/sbus/sbus.c1
-rw-r--r--drivers/scsi/53c700.c1
-rw-r--r--drivers/scsi/53c7xx.c1
-rw-r--r--drivers/scsi/BusLogic.c1
-rw-r--r--drivers/scsi/BusLogic.h1
-rw-r--r--drivers/scsi/FlashPoint.c1
-rw-r--r--drivers/scsi/NCR53C9x.c1
-rw-r--r--drivers/scsi/NCR53C9x.h1
-rw-r--r--drivers/scsi/advansys.c1
-rw-r--r--drivers/scsi/aha1542.c1
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h1
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h1
-rw-r--r--drivers/scsi/aic7xxx_old/aic7xxx_proc.c1
-rw-r--r--drivers/scsi/amiga7xx.c1
-rw-r--r--drivers/scsi/arm/acornscsi.c1
-rw-r--r--drivers/scsi/atari_NCR5380.c1
-rw-r--r--drivers/scsi/atari_scsi.c1
-rw-r--r--drivers/scsi/ch.c1
-rw-r--r--drivers/scsi/constants.c1
-rw-r--r--drivers/scsi/dpt/dpti_i2o.h1
-rw-r--r--drivers/scsi/eata.c1
-rw-r--r--drivers/scsi/eata_pio.c1
-rw-r--r--drivers/scsi/esp.c1
-rw-r--r--drivers/scsi/fcal.c1
-rw-r--r--drivers/scsi/fdomain.c1
-rw-r--r--drivers/scsi/g_NCR5380.c1
-rw-r--r--drivers/scsi/g_NCR5380.h1
-rw-r--r--drivers/scsi/ibmmca.c1
-rw-r--r--drivers/scsi/ide-scsi.c1
-rw-r--r--drivers/scsi/imm.c1
-rw-r--r--drivers/scsi/initio.c1
-rw-r--r--drivers/scsi/initio.h13
-rw-r--r--drivers/scsi/ipr.c1
-rw-r--r--drivers/scsi/ips.c1
-rw-r--r--drivers/scsi/libata-bmdma.c1
-rw-r--r--drivers/scsi/libata-core.c1
-rw-r--r--drivers/scsi/mesh.c1
-rw-r--r--drivers/scsi/ncr53c8xx.h2
-rw-r--r--drivers/scsi/oktagon_esp.c1
-rw-r--r--drivers/scsi/oktagon_io.S1
-rw-r--r--drivers/scsi/osst.h1
-rw-r--r--drivers/scsi/pluto.c1
-rw-r--r--drivers/scsi/ppa.c1
-rw-r--r--drivers/scsi/qla1280.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h2
-rw-r--r--drivers/scsi/sata_nv.c1
-rw-r--r--drivers/scsi/sata_sis.c1
-rw-r--r--drivers/scsi/sata_svw.c1
-rw-r--r--drivers/scsi/sata_uli.c1
-rw-r--r--drivers/scsi/scsi_debug.c1
-rw-r--r--drivers/scsi/scsi_logging.h1
-rw-r--r--drivers/scsi/scsi_priv.h1
-rw-r--r--drivers/scsi/scsi_scan.c1
-rw-r--r--drivers/scsi/scsi_sysfs.c1
-rw-r--r--drivers/scsi/scsi_transport_spi.c1
-rw-r--r--drivers/scsi/sd.c1
-rw-r--r--drivers/scsi/sg.c1
-rw-r--r--drivers/scsi/sim710.c1
-rw-r--r--drivers/scsi/sr_vendor.c1
-rw-r--r--drivers/scsi/sun3_NCR5380.c1
-rw-r--r--drivers/scsi/sym53c8xx_2/sym53c8xx.h1
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.h1
-rw-r--r--drivers/scsi/tmscsim.c1
-rw-r--r--drivers/scsi/tmscsim.h1
-rw-r--r--drivers/scsi/u14-34f.c1
-rw-r--r--drivers/scsi/wd33c93.c1
-rw-r--r--drivers/scsi/wd33c93.h1
-rw-r--r--drivers/serial/21285.c1
-rw-r--r--drivers/serial/68328serial.c1
-rw-r--r--drivers/serial/68328serial.h1
-rw-r--r--drivers/serial/68360serial.c1
-rw-r--r--drivers/serial/8250.c1
-rw-r--r--drivers/serial/8250.h1
-rw-r--r--drivers/serial/8250_mca.c1
-rw-r--r--drivers/serial/amba-pl010.c1
-rw-r--r--drivers/serial/amba-pl011.c1
-rw-r--r--drivers/serial/at91_serial.c1
-rw-r--r--drivers/serial/clps711x.c1
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c1
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c1
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c1
-rw-r--r--drivers/serial/crisv10.c1
-rw-r--r--drivers/serial/crisv10.h1
-rw-r--r--drivers/serial/dz.c1
-rw-r--r--drivers/serial/icom.c1
-rw-r--r--drivers/serial/imx.c1
-rw-r--r--drivers/serial/ip22zilog.c1
-rw-r--r--drivers/serial/m32r_sio.c1
-rw-r--r--drivers/serial/m32r_sio.h1
-rw-r--r--drivers/serial/m32r_sio_reg.h1
-rw-r--r--drivers/serial/mcfserial.h1
-rw-r--r--drivers/serial/mpc52xx_uart.c1
-rw-r--r--drivers/serial/mpsc.c1
-rw-r--r--drivers/serial/mux.c1
-rw-r--r--drivers/serial/pmac_zilog.c1
-rw-r--r--drivers/serial/pxa.c3
-rw-r--r--drivers/serial/s3c2410.c1
-rw-r--r--drivers/serial/sa1100.c1
-rw-r--r--drivers/serial/serial_core.c1
-rw-r--r--drivers/serial/serial_cs.c1
-rw-r--r--drivers/serial/serial_lh7a40x.c1
-rw-r--r--drivers/serial/serial_txx9.c1
-rw-r--r--drivers/serial/sh-sci.c1
-rw-r--r--drivers/serial/sh-sci.h1
-rw-r--r--drivers/serial/sn_console.c1
-rw-r--r--drivers/serial/suncore.c1
-rw-r--r--drivers/serial/sunsab.c1
-rw-r--r--drivers/serial/sunsu.c1
-rw-r--r--drivers/serial/sunzilog.c1
-rw-r--r--drivers/serial/vr41xx_siu.c1
-rw-r--r--drivers/sn/ioc3.c1
-rw-r--r--drivers/spi/spi_bitbang.c1
-rw-r--r--drivers/spi/spi_butterfly.c1
-rw-r--r--drivers/tc/lk201.c1
-rw-r--r--drivers/tc/zs.c1
-rw-r--r--drivers/usb/core/buffer.c1
-rw-r--r--drivers/usb/core/config.c1
-rw-r--r--drivers/usb/core/driver.c1
-rw-r--r--drivers/usb/core/file.c1
-rw-r--r--drivers/usb/core/hcd-pci.c1
-rw-r--r--drivers/usb/core/hcd.c1
-rw-r--r--drivers/usb/core/hub.c1
-rw-r--r--drivers/usb/core/inode.c1
-rw-r--r--drivers/usb/core/message.c1
-rw-r--r--drivers/usb/core/notify.c1
-rw-r--r--drivers/usb/core/sysfs.c1
-rw-r--r--drivers/usb/core/urb.c1
-rw-r--r--drivers/usb/core/usb.c1
-rw-r--r--drivers/usb/gadget/at91_udc.c1
-rw-r--r--drivers/usb/gadget/dummy_hcd.c1
-rw-r--r--drivers/usb/gadget/ether.c1
-rw-r--r--drivers/usb/gadget/file_storage.c1
-rw-r--r--drivers/usb/gadget/goku_udc.c1
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.h1
-rw-r--r--drivers/usb/gadget/net2280.c1
-rw-r--r--drivers/usb/gadget/omap_udc.c1
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c1
-rw-r--r--drivers/usb/gadget/rndis.c1
-rw-r--r--drivers/usb/gadget/serial.c1
-rw-r--r--drivers/usb/gadget/zero.c1
-rw-r--r--drivers/usb/host/ehci-hcd.c1
-rw-r--r--drivers/usb/host/hc_crisv10.c1
-rw-r--r--drivers/usb/host/ohci-hcd.c1
-rw-r--r--drivers/usb/host/pci-quirks.c1
-rw-r--r--drivers/usb/host/sl811-hcd.c1
-rw-r--r--drivers/usb/host/uhci-debug.c1
-rw-r--r--drivers/usb/host/uhci-hcd.c1
-rw-r--r--drivers/usb/input/appletouch.c1
-rw-r--r--drivers/usb/input/ati_remote.c1
-rw-r--r--drivers/usb/input/hiddev.c1
-rw-r--r--drivers/usb/input/itmtouch.c1
-rw-r--r--drivers/usb/input/keyspan_remote.c1
-rw-r--r--drivers/usb/input/mtouchusb.c1
-rw-r--r--drivers/usb/input/touchkitusb.c1
-rw-r--r--drivers/usb/input/xpad.c1
-rw-r--r--drivers/usb/input/yealink.c1
-rw-r--r--drivers/usb/misc/cytherm.c1
-rw-r--r--drivers/usb/misc/idmouse.c1
-rw-r--r--drivers/usb/misc/ldusb.c1
-rw-r--r--drivers/usb/misc/legousbtower.c1
-rw-r--r--drivers/usb/misc/phidgetkit.c1
-rw-r--r--drivers/usb/misc/phidgetservo.c1
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_init.c1
-rw-r--r--drivers/usb/misc/usbled.c1
-rw-r--r--drivers/usb/misc/usbtest.c1
-rw-r--r--drivers/usb/net/asix.c1
-rw-r--r--drivers/usb/net/cdc_ether.c1
-rw-r--r--drivers/usb/net/cdc_subset.c1
-rw-r--r--drivers/usb/net/gl620a.c1
-rw-r--r--drivers/usb/net/net1080.c1
-rw-r--r--drivers/usb/net/plusb.c1
-rw-r--r--drivers/usb/net/rndis_host.c1
-rw-r--r--drivers/usb/net/rtl8150.c1
-rw-r--r--drivers/usb/net/usbnet.c1
-rw-r--r--drivers/usb/net/zaurus.c1
-rw-r--r--drivers/usb/serial/belkin_sa.c1
-rw-r--r--drivers/usb/serial/bus.c1
-rw-r--r--drivers/usb/serial/console.c1
-rw-r--r--drivers/usb/serial/cp2101.c1
-rw-r--r--drivers/usb/serial/cyberjack.c1
-rw-r--r--drivers/usb/serial/cypress_m8.c1
-rw-r--r--drivers/usb/serial/digi_acceleport.c1
-rw-r--r--drivers/usb/serial/empeg.c1
-rw-r--r--drivers/usb/serial/ezusb.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.c1
-rw-r--r--drivers/usb/serial/garmin_gps.c1
-rw-r--r--drivers/usb/serial/generic.c1
-rw-r--r--drivers/usb/serial/hp4x.c1
-rw-r--r--drivers/usb/serial/io_edgeport.c1
-rw-r--r--drivers/usb/serial/io_ti.c1
-rw-r--r--drivers/usb/serial/ipaq.c1
-rw-r--r--drivers/usb/serial/ir-usb.c1
-rw-r--r--drivers/usb/serial/keyspan.c1
-rw-r--r--drivers/usb/serial/keyspan_pda.c1
-rw-r--r--drivers/usb/serial/kl5kusb105.c1
-rw-r--r--drivers/usb/serial/kobil_sct.c1
-rw-r--r--drivers/usb/serial/mct_u232.c1
-rw-r--r--drivers/usb/serial/omninet.c1
-rw-r--r--drivers/usb/serial/option.c1
-rw-r--r--drivers/usb/serial/pl2303.c1
-rw-r--r--drivers/usb/serial/safe_serial.c1
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c1
-rw-r--r--drivers/usb/serial/usb-serial.c1
-rw-r--r--drivers/usb/serial/usb-serial.h1
-rw-r--r--drivers/usb/serial/visor.c1
-rw-r--r--drivers/usb/serial/whiteheat.c1
-rw-r--r--drivers/usb/storage/debug.h1
-rw-r--r--drivers/usb/storage/dpcm.c1
-rw-r--r--drivers/usb/storage/freecom.c1
-rw-r--r--drivers/usb/storage/initializers.h1
-rw-r--r--drivers/usb/storage/onetouch.c1
-rw-r--r--drivers/usb/storage/transport.c1
-rw-r--r--drivers/usb/storage/unusual_devs.h1
-rw-r--r--drivers/usb/storage/usb.c1
-rw-r--r--drivers/usb/usb-skeleton.c1
-rw-r--r--drivers/video/S3triofb.c1
-rw-r--r--drivers/video/acornfb.c1
-rw-r--r--drivers/video/amifb.c1
-rw-r--r--drivers/video/asiliantfb.c1
-rw-r--r--drivers/video/aty/aty128fb.c1
-rw-r--r--drivers/video/aty/atyfb.h1
-rw-r--r--drivers/video/aty/atyfb_base.c1
-rw-r--r--drivers/video/aty/radeon_base.c1
-rw-r--r--drivers/video/aty/radeon_i2c.c1
-rw-r--r--drivers/video/aty/radeonfb.h3
-rw-r--r--drivers/video/au1100fb.c1
-rw-r--r--drivers/video/backlight/locomolcd.c1
-rw-r--r--drivers/video/cfbcopyarea.c1
-rw-r--r--drivers/video/cfbfillrect.c1
-rw-r--r--drivers/video/cfbimgblt.c1
-rw-r--r--drivers/video/chipsfb.c1
-rw-r--r--drivers/video/cirrusfb.c1
-rw-r--r--drivers/video/console/bitblit.c1
-rw-r--r--drivers/video/console/dummycon.c1
-rw-r--r--drivers/video/console/fbcon.c1
-rw-r--r--drivers/video/console/fbcon.h1
-rw-r--r--drivers/video/console/fbcon_ccw.c1
-rw-r--r--drivers/video/console/fbcon_cw.c1
-rw-r--r--drivers/video/console/fbcon_rotate.c1
-rw-r--r--drivers/video/console/fbcon_ud.c1
-rw-r--r--drivers/video/console/font_acorn_8x8.c1
-rw-r--r--drivers/video/console/fonts.c1
-rw-r--r--drivers/video/console/promcon.c1
-rw-r--r--drivers/video/console/sticore.c1
-rw-r--r--drivers/video/console/tileblit.c1
-rw-r--r--drivers/video/console/vgacon.c1
-rw-r--r--drivers/video/controlfb.c1
-rw-r--r--drivers/video/cyber2000fb.c1
-rw-r--r--drivers/video/cyber2000fb.h1
-rw-r--r--drivers/video/cyblafb.c1
-rw-r--r--drivers/video/fbmem.c1
-rw-r--r--drivers/video/gbefb.c1
-rw-r--r--drivers/video/hitfb.c1
-rw-r--r--drivers/video/i810/i810-i2c.c1
-rw-r--r--drivers/video/i810/i810_main.c1
-rw-r--r--drivers/video/imsttfb.c1
-rw-r--r--drivers/video/imxfb.c1
-rw-r--r--drivers/video/intelfb/intelfbdrv.c1
-rw-r--r--drivers/video/intelfb/intelfbhw.c1
-rw-r--r--drivers/video/kyro/fbdev.c1
-rw-r--r--drivers/video/logo/logo.c1
-rw-r--r--drivers/video/macmodes.c1
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.c1
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.h1
-rw-r--r--drivers/video/matrox/matroxfb_Ti3026.c1
-rw-r--r--drivers/video/matrox/matroxfb_Ti3026.h1
-rw-r--r--drivers/video/matrox/matroxfb_base.c1
-rw-r--r--drivers/video/matrox/matroxfb_base.h1
-rw-r--r--drivers/video/matrox/matroxfb_misc.c1
-rw-r--r--drivers/video/neofb.c1
-rw-r--r--drivers/video/nvidia/nv_i2c.c1
-rw-r--r--drivers/video/nvidia/nv_of.c1
-rw-r--r--drivers/video/nvidia/nvidia.c1
-rw-r--r--drivers/video/offb.c1
-rw-r--r--drivers/video/platinumfb.c1
-rw-r--r--drivers/video/pm2fb.c1
-rw-r--r--drivers/video/pm3fb.c1
-rw-r--r--drivers/video/pvr2fb.c1
-rw-r--r--drivers/video/pxafb.c1
-rw-r--r--drivers/video/riva/fbdev.c1
-rw-r--r--drivers/video/riva/rivafb-i2c.c1
-rw-r--r--drivers/video/riva/rivafb.h1
-rw-r--r--drivers/video/s1d13xxxfb.c1
-rw-r--r--drivers/video/sa1100fb.c1
-rw-r--r--drivers/video/savage/savagefb-i2c.c1
-rw-r--r--drivers/video/savage/savagefb_driver.c1
-rw-r--r--drivers/video/sgivwfb.c1
-rw-r--r--drivers/video/sis/init.h1
-rw-r--r--drivers/video/sis/init301.c4
-rw-r--r--drivers/video/sis/init301.h1
-rw-r--r--drivers/video/sis/initextlfb.c1
-rw-r--r--drivers/video/sis/osdef.h1
-rw-r--r--drivers/video/sis/sis.h1
-rw-r--r--drivers/video/sis/sis_accel.c1
-rw-r--r--drivers/video/sis/sis_main.c1
-rw-r--r--drivers/video/sstfb.c1
-rw-r--r--drivers/video/stifb.c1
-rw-r--r--drivers/video/sun3fb.c1
-rw-r--r--drivers/video/tdfxfb.c1
-rw-r--r--drivers/video/tridentfb.c1
-rw-r--r--drivers/video/valkyriefb.c1
-rw-r--r--drivers/video/vgastate.c1
-rw-r--r--drivers/zorro/names.c1
1154 files changed, 3345 insertions, 4261 deletions
diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c
index ce074f6f3369..d9c9a35961b3 100644
--- a/drivers/acorn/block/mfmhd.c
+++ b/drivers/acorn/block/mfmhd.c
@@ -99,7 +99,6 @@
99 */ 99 */
100 100
101#include <linux/module.h> 101#include <linux/module.h>
102#include <linux/config.h>
103#include <linux/sched.h> 102#include <linux/sched.h>
104#include <linux/fs.h> 103#include <linux/fs.h>
105#include <linux/interrupt.h> 104#include <linux/interrupt.h>
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 610d2cc02cf8..bc2652d72fdc 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -133,6 +133,13 @@ config ACPI_FAN
133 This driver adds support for ACPI fan devices, allowing user-mode 133 This driver adds support for ACPI fan devices, allowing user-mode
134 applications to perform basic fan control (on, off, status). 134 applications to perform basic fan control (on, off, status).
135 135
136config ACPI_DOCK
137 tristate "Dock"
138 depends on !ACPI_IBM_DOCK
139 default y
140 help
141 This driver adds support for ACPI controlled docking stations
142
136config ACPI_PROCESSOR 143config ACPI_PROCESSOR
137 tristate "Processor" 144 tristate "Processor"
138 default y 145 default y
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 5984b4f6715a..f0a68ecf1e57 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
42obj-$(CONFIG_ACPI_BUTTON) += button.o 42obj-$(CONFIG_ACPI_BUTTON) += button.o
43obj-$(CONFIG_ACPI_EC) += ec.o 43obj-$(CONFIG_ACPI_EC) += ec.o
44obj-$(CONFIG_ACPI_FAN) += fan.o 44obj-$(CONFIG_ACPI_FAN) += fan.o
45obj-$(CONFIG_ACPI_DOCK) += dock.o
45obj-$(CONFIG_ACPI_VIDEO) += video.o 46obj-$(CONFIG_ACPI_VIDEO) += video.o
46obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o 47obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o
47obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o 48obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 7839b831df94..36ca365bcead 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -84,20 +84,18 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
84{ 84{
85 acpi_status status = AE_OK; 85 acpi_status status = AE_OK;
86 86
87 ACPI_FUNCTION_TRACE("acpi_ac_get_state");
88 87
89 if (!ac) 88 if (!ac)
90 return_VALUE(-EINVAL); 89 return -EINVAL;
91 90
92 status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); 91 status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
93 if (ACPI_FAILURE(status)) { 92 if (ACPI_FAILURE(status)) {
94 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 93 ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
95 "Error reading AC Adapter state\n"));
96 ac->state = ACPI_AC_STATUS_UNKNOWN; 94 ac->state = ACPI_AC_STATUS_UNKNOWN;
97 return_VALUE(-ENODEV); 95 return -ENODEV;
98 } 96 }
99 97
100 return_VALUE(0); 98 return 0;
101} 99}
102 100
103/* -------------------------------------------------------------------------- 101/* --------------------------------------------------------------------------
@@ -110,14 +108,13 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
110{ 108{
111 struct acpi_ac *ac = (struct acpi_ac *)seq->private; 109 struct acpi_ac *ac = (struct acpi_ac *)seq->private;
112 110
113 ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
114 111
115 if (!ac) 112 if (!ac)
116 return_VALUE(0); 113 return 0;
117 114
118 if (acpi_ac_get_state(ac)) { 115 if (acpi_ac_get_state(ac)) {
119 seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); 116 seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
120 return_VALUE(0); 117 return 0;
121 } 118 }
122 119
123 seq_puts(seq, "state: "); 120 seq_puts(seq, "state: ");
@@ -133,7 +130,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
133 break; 130 break;
134 } 131 }
135 132
136 return_VALUE(0); 133 return 0;
137} 134}
138 135
139static int acpi_ac_open_fs(struct inode *inode, struct file *file) 136static int acpi_ac_open_fs(struct inode *inode, struct file *file)
@@ -145,13 +142,12 @@ static int acpi_ac_add_fs(struct acpi_device *device)
145{ 142{
146 struct proc_dir_entry *entry = NULL; 143 struct proc_dir_entry *entry = NULL;
147 144
148 ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
149 145
150 if (!acpi_device_dir(device)) { 146 if (!acpi_device_dir(device)) {
151 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 147 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
152 acpi_ac_dir); 148 acpi_ac_dir);
153 if (!acpi_device_dir(device)) 149 if (!acpi_device_dir(device))
154 return_VALUE(-ENODEV); 150 return -ENODEV;
155 acpi_device_dir(device)->owner = THIS_MODULE; 151 acpi_device_dir(device)->owner = THIS_MODULE;
156 } 152 }
157 153
@@ -159,21 +155,18 @@ static int acpi_ac_add_fs(struct acpi_device *device)
159 entry = create_proc_entry(ACPI_AC_FILE_STATE, 155 entry = create_proc_entry(ACPI_AC_FILE_STATE,
160 S_IRUGO, acpi_device_dir(device)); 156 S_IRUGO, acpi_device_dir(device));
161 if (!entry) 157 if (!entry)
162 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 158 return -ENODEV;
163 "Unable to create '%s' fs entry\n",
164 ACPI_AC_FILE_STATE));
165 else { 159 else {
166 entry->proc_fops = &acpi_ac_fops; 160 entry->proc_fops = &acpi_ac_fops;
167 entry->data = acpi_driver_data(device); 161 entry->data = acpi_driver_data(device);
168 entry->owner = THIS_MODULE; 162 entry->owner = THIS_MODULE;
169 } 163 }
170 164
171 return_VALUE(0); 165 return 0;
172} 166}
173 167
174static int acpi_ac_remove_fs(struct acpi_device *device) 168static int acpi_ac_remove_fs(struct acpi_device *device)
175{ 169{
176 ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
177 170
178 if (acpi_device_dir(device)) { 171 if (acpi_device_dir(device)) {
179 remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device)); 172 remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
@@ -182,7 +175,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
182 acpi_device_dir(device) = NULL; 175 acpi_device_dir(device) = NULL;
183 } 176 }
184 177
185 return_VALUE(0); 178 return 0;
186} 179}
187 180
188/* -------------------------------------------------------------------------- 181/* --------------------------------------------------------------------------
@@ -194,13 +187,12 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
194 struct acpi_ac *ac = (struct acpi_ac *)data; 187 struct acpi_ac *ac = (struct acpi_ac *)data;
195 struct acpi_device *device = NULL; 188 struct acpi_device *device = NULL;
196 189
197 ACPI_FUNCTION_TRACE("acpi_ac_notify");
198 190
199 if (!ac) 191 if (!ac)
200 return_VOID; 192 return;
201 193
202 if (acpi_bus_get_device(ac->handle, &device)) 194 if (acpi_bus_get_device(ac->handle, &device))
203 return_VOID; 195 return;
204 196
205 switch (event) { 197 switch (event) {
206 case ACPI_AC_NOTIFY_STATUS: 198 case ACPI_AC_NOTIFY_STATUS:
@@ -213,7 +205,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
213 break; 205 break;
214 } 206 }
215 207
216 return_VOID; 208 return;
217} 209}
218 210
219static int acpi_ac_add(struct acpi_device *device) 211static int acpi_ac_add(struct acpi_device *device)
@@ -222,14 +214,13 @@ static int acpi_ac_add(struct acpi_device *device)
222 acpi_status status = AE_OK; 214 acpi_status status = AE_OK;
223 struct acpi_ac *ac = NULL; 215 struct acpi_ac *ac = NULL;
224 216
225 ACPI_FUNCTION_TRACE("acpi_ac_add");
226 217
227 if (!device) 218 if (!device)
228 return_VALUE(-EINVAL); 219 return -EINVAL;
229 220
230 ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL); 221 ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
231 if (!ac) 222 if (!ac)
232 return_VALUE(-ENOMEM); 223 return -ENOMEM;
233 memset(ac, 0, sizeof(struct acpi_ac)); 224 memset(ac, 0, sizeof(struct acpi_ac));
234 225
235 ac->handle = device->handle; 226 ac->handle = device->handle;
@@ -249,8 +240,6 @@ static int acpi_ac_add(struct acpi_device *device)
249 ACPI_DEVICE_NOTIFY, acpi_ac_notify, 240 ACPI_DEVICE_NOTIFY, acpi_ac_notify,
250 ac); 241 ac);
251 if (ACPI_FAILURE(status)) { 242 if (ACPI_FAILURE(status)) {
252 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
253 "Error installing notify handler\n"));
254 result = -ENODEV; 243 result = -ENODEV;
255 goto end; 244 goto end;
256 } 245 }
@@ -265,7 +254,7 @@ static int acpi_ac_add(struct acpi_device *device)
265 kfree(ac); 254 kfree(ac);
266 } 255 }
267 256
268 return_VALUE(result); 257 return result;
269} 258}
270 259
271static int acpi_ac_remove(struct acpi_device *device, int type) 260static int acpi_ac_remove(struct acpi_device *device, int type)
@@ -273,55 +262,49 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
273 acpi_status status = AE_OK; 262 acpi_status status = AE_OK;
274 struct acpi_ac *ac = NULL; 263 struct acpi_ac *ac = NULL;
275 264
276 ACPI_FUNCTION_TRACE("acpi_ac_remove");
277 265
278 if (!device || !acpi_driver_data(device)) 266 if (!device || !acpi_driver_data(device))
279 return_VALUE(-EINVAL); 267 return -EINVAL;
280 268
281 ac = (struct acpi_ac *)acpi_driver_data(device); 269 ac = (struct acpi_ac *)acpi_driver_data(device);
282 270
283 status = acpi_remove_notify_handler(ac->handle, 271 status = acpi_remove_notify_handler(ac->handle,
284 ACPI_DEVICE_NOTIFY, acpi_ac_notify); 272 ACPI_DEVICE_NOTIFY, acpi_ac_notify);
285 if (ACPI_FAILURE(status))
286 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
287 "Error removing notify handler\n"));
288 273
289 acpi_ac_remove_fs(device); 274 acpi_ac_remove_fs(device);
290 275
291 kfree(ac); 276 kfree(ac);
292 277
293 return_VALUE(0); 278 return 0;
294} 279}
295 280
296static int __init acpi_ac_init(void) 281static int __init acpi_ac_init(void)
297{ 282{
298 int result = 0; 283 int result = 0;
299 284
300 ACPI_FUNCTION_TRACE("acpi_ac_init");
301 285
302 acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); 286 acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
303 if (!acpi_ac_dir) 287 if (!acpi_ac_dir)
304 return_VALUE(-ENODEV); 288 return -ENODEV;
305 acpi_ac_dir->owner = THIS_MODULE; 289 acpi_ac_dir->owner = THIS_MODULE;
306 290
307 result = acpi_bus_register_driver(&acpi_ac_driver); 291 result = acpi_bus_register_driver(&acpi_ac_driver);
308 if (result < 0) { 292 if (result < 0) {
309 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); 293 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
310 return_VALUE(-ENODEV); 294 return -ENODEV;
311 } 295 }
312 296
313 return_VALUE(0); 297 return 0;
314} 298}
315 299
316static void __exit acpi_ac_exit(void) 300static void __exit acpi_ac_exit(void)
317{ 301{
318 ACPI_FUNCTION_TRACE("acpi_ac_exit");
319 302
320 acpi_bus_unregister_driver(&acpi_ac_driver); 303 acpi_bus_unregister_driver(&acpi_ac_driver);
321 304
322 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); 305 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
323 306
324 return_VOID; 307 return;
325} 308}
326 309
327module_init(acpi_ac_init); 310module_init(acpi_ac_init);
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 1012284ff4f7..cd57372a6729 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -128,7 +128,6 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
128 acpi_status status; 128 acpi_status status;
129 struct acpi_memory_info *info, *n; 129 struct acpi_memory_info *info, *n;
130 130
131 ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
132 131
133 status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, 132 status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,
134 acpi_memory_get_resource, mem_device); 133 acpi_memory_get_resource, mem_device);
@@ -150,23 +149,21 @@ acpi_memory_get_device(acpi_handle handle,
150 struct acpi_device *device = NULL; 149 struct acpi_device *device = NULL;
151 struct acpi_device *pdevice = NULL; 150 struct acpi_device *pdevice = NULL;
152 151
153 ACPI_FUNCTION_TRACE("acpi_memory_get_device");
154 152
155 if (!acpi_bus_get_device(handle, &device) && device) 153 if (!acpi_bus_get_device(handle, &device) && device)
156 goto end; 154 goto end;
157 155
158 status = acpi_get_parent(handle, &phandle); 156 status = acpi_get_parent(handle, &phandle);
159 if (ACPI_FAILURE(status)) { 157 if (ACPI_FAILURE(status)) {
160 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n")); 158 ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
161 return_VALUE(-EINVAL); 159 return -EINVAL;
162 } 160 }
163 161
164 /* Get the parent device */ 162 /* Get the parent device */
165 status = acpi_bus_get_device(phandle, &pdevice); 163 status = acpi_bus_get_device(phandle, &pdevice);
166 if (ACPI_FAILURE(status)) { 164 if (ACPI_FAILURE(status)) {
167 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 165 ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
168 "Error in acpi_bus_get_device\n")); 166 return -EINVAL;
169 return_VALUE(-EINVAL);
170 } 167 }
171 168
172 /* 169 /*
@@ -175,30 +172,29 @@ acpi_memory_get_device(acpi_handle handle,
175 */ 172 */
176 status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); 173 status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
177 if (ACPI_FAILURE(status)) { 174 if (ACPI_FAILURE(status)) {
178 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n")); 175 ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus"));
179 return_VALUE(-EINVAL); 176 return -EINVAL;
180 } 177 }
181 178
182 end: 179 end:
183 *mem_device = acpi_driver_data(device); 180 *mem_device = acpi_driver_data(device);
184 if (!(*mem_device)) { 181 if (!(*mem_device)) {
185 printk(KERN_ERR "\n driver data not found"); 182 printk(KERN_ERR "\n driver data not found");
186 return_VALUE(-ENODEV); 183 return -ENODEV;
187 } 184 }
188 185
189 return_VALUE(0); 186 return 0;
190} 187}
191 188
192static int acpi_memory_check_device(struct acpi_memory_device *mem_device) 189static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
193{ 190{
194 unsigned long current_status; 191 unsigned long current_status;
195 192
196 ACPI_FUNCTION_TRACE("acpi_memory_check_device");
197 193
198 /* Get device present/absent information from the _STA */ 194 /* Get device present/absent information from the _STA */
199 if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", 195 if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
200 NULL, &current_status))) 196 NULL, &current_status)))
201 return_VALUE(-ENODEV); 197 return -ENODEV;
202 /* 198 /*
203 * Check for device status. Device should be 199 * Check for device status. Device should be
204 * present/enabled/functioning. 200 * present/enabled/functioning.
@@ -206,9 +202,9 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
206 if (!((current_status & ACPI_MEMORY_STA_PRESENT) 202 if (!((current_status & ACPI_MEMORY_STA_PRESENT)
207 && (current_status & ACPI_MEMORY_STA_ENABLED) 203 && (current_status & ACPI_MEMORY_STA_ENABLED)
208 && (current_status & ACPI_MEMORY_STA_FUNCTIONAL))) 204 && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
209 return_VALUE(-ENODEV); 205 return -ENODEV;
210 206
211 return_VALUE(0); 207 return 0;
212} 208}
213 209
214static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) 210static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
@@ -217,13 +213,11 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
217 struct acpi_memory_info *info; 213 struct acpi_memory_info *info;
218 int node; 214 int node;
219 215
220 ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
221 216
222 /* Get the range from the _CRS */ 217 /* Get the range from the _CRS */
223 result = acpi_memory_get_device_resources(mem_device); 218 result = acpi_memory_get_device_resources(mem_device);
224 if (result) { 219 if (result) {
225 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 220 printk(KERN_ERR PREFIX "get_device_resources failed\n");
226 "\nget_device_resources failed\n"));
227 mem_device->state = MEMORY_INVALID_STATE; 221 mem_device->state = MEMORY_INVALID_STATE;
228 return result; 222 return result;
229 } 223 }
@@ -254,7 +248,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
254 num_enabled++; 248 num_enabled++;
255 } 249 }
256 if (!num_enabled) { 250 if (!num_enabled) {
257 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); 251 printk(KERN_ERR PREFIX "add_memory failed\n");
258 mem_device->state = MEMORY_INVALID_STATE; 252 mem_device->state = MEMORY_INVALID_STATE;
259 return -EINVAL; 253 return -EINVAL;
260 } 254 }
@@ -269,7 +263,6 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
269 union acpi_object arg; 263 union acpi_object arg;
270 unsigned long current_status; 264 unsigned long current_status;
271 265
272 ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device");
273 266
274 /* Issue the _EJ0 command */ 267 /* Issue the _EJ0 command */
275 arg_list.count = 1; 268 arg_list.count = 1;
@@ -280,21 +273,21 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
280 "_EJ0", &arg_list, NULL); 273 "_EJ0", &arg_list, NULL);
281 /* Return on _EJ0 failure */ 274 /* Return on _EJ0 failure */
282 if (ACPI_FAILURE(status)) { 275 if (ACPI_FAILURE(status)) {
283 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n")); 276 ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
284 return_VALUE(-ENODEV); 277 return -ENODEV;
285 } 278 }
286 279
287 /* Evalute _STA to check if the device is disabled */ 280 /* Evalute _STA to check if the device is disabled */
288 status = acpi_evaluate_integer(mem_device->handle, "_STA", 281 status = acpi_evaluate_integer(mem_device->handle, "_STA",
289 NULL, &current_status); 282 NULL, &current_status);
290 if (ACPI_FAILURE(status)) 283 if (ACPI_FAILURE(status))
291 return_VALUE(-ENODEV); 284 return -ENODEV;
292 285
293 /* Check for device status. Device should be disabled */ 286 /* Check for device status. Device should be disabled */
294 if (current_status & ACPI_MEMORY_STA_ENABLED) 287 if (current_status & ACPI_MEMORY_STA_ENABLED)
295 return_VALUE(-EINVAL); 288 return -EINVAL;
296 289
297 return_VALUE(0); 290 return 0;
298} 291}
299 292
300static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) 293static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
@@ -302,7 +295,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
302 int result; 295 int result;
303 struct acpi_memory_info *info, *n; 296 struct acpi_memory_info *info, *n;
304 297
305 ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
306 298
307 /* 299 /*
308 * Ask the VM to offline this memory range. 300 * Ask the VM to offline this memory range.
@@ -320,8 +312,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
320 /* Power-off and eject the device */ 312 /* Power-off and eject the device */
321 result = acpi_memory_powerdown_device(mem_device); 313 result = acpi_memory_powerdown_device(mem_device);
322 if (result) { 314 if (result) {
323 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
324 "Device Power Down failed.\n"));
325 /* Set the status of the device to invalid */ 315 /* Set the status of the device to invalid */
326 mem_device->state = MEMORY_INVALID_STATE; 316 mem_device->state = MEMORY_INVALID_STATE;
327 return result; 317 return result;
@@ -336,7 +326,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
336 struct acpi_memory_device *mem_device; 326 struct acpi_memory_device *mem_device;
337 struct acpi_device *device; 327 struct acpi_device *device;
338 328
339 ACPI_FUNCTION_TRACE("acpi_memory_device_notify");
340 329
341 switch (event) { 330 switch (event) {
342 case ACPI_NOTIFY_BUS_CHECK: 331 case ACPI_NOTIFY_BUS_CHECK:
@@ -348,15 +337,14 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
348 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 337 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
349 "\nReceived DEVICE CHECK notification for device\n")); 338 "\nReceived DEVICE CHECK notification for device\n"));
350 if (acpi_memory_get_device(handle, &mem_device)) { 339 if (acpi_memory_get_device(handle, &mem_device)) {
351 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 340 printk(KERN_ERR PREFIX "Cannot find driver data\n");
352 "Error in finding driver data\n")); 341 return;
353 return_VOID;
354 } 342 }
355 343
356 if (!acpi_memory_check_device(mem_device)) { 344 if (!acpi_memory_check_device(mem_device)) {
357 if (acpi_memory_enable_device(mem_device)) 345 if (acpi_memory_enable_device(mem_device))
358 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 346 printk(KERN_ERR PREFIX
359 "Error in acpi_memory_enable_device\n")); 347 "Cannot enable memory device\n");
360 } 348 }
361 break; 349 break;
362 case ACPI_NOTIFY_EJECT_REQUEST: 350 case ACPI_NOTIFY_EJECT_REQUEST:
@@ -364,14 +352,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
364 "\nReceived EJECT REQUEST notification for device\n")); 352 "\nReceived EJECT REQUEST notification for device\n"));
365 353
366 if (acpi_bus_get_device(handle, &device)) { 354 if (acpi_bus_get_device(handle, &device)) {
367 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 355 printk(KERN_ERR PREFIX "Device doesn't exist\n");
368 "Device doesn't exist\n"));
369 break; 356 break;
370 } 357 }
371 mem_device = acpi_driver_data(device); 358 mem_device = acpi_driver_data(device);
372 if (!mem_device) { 359 if (!mem_device) {
373 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 360 printk(KERN_ERR PREFIX "Driver Data is NULL\n");
374 "Driver Data is NULL\n"));
375 break; 361 break;
376 } 362 }
377 363
@@ -382,8 +368,8 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
382 * with generic sysfs driver 368 * with generic sysfs driver
383 */ 369 */
384 if (acpi_memory_disable_device(mem_device)) 370 if (acpi_memory_disable_device(mem_device))
385 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 371 printk(KERN_ERR PREFIX
386 "Error in acpi_memory_disable_device\n")); 372 "Disable memory device\n");
387 /* 373 /*
388 * TBD: Invoke acpi_bus_remove to cleanup data structures 374 * TBD: Invoke acpi_bus_remove to cleanup data structures
389 */ 375 */
@@ -394,7 +380,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
394 break; 380 break;
395 } 381 }
396 382
397 return_VOID; 383 return;
398} 384}
399 385
400static int acpi_memory_device_add(struct acpi_device *device) 386static int acpi_memory_device_add(struct acpi_device *device)
@@ -402,14 +388,13 @@ static int acpi_memory_device_add(struct acpi_device *device)
402 int result; 388 int result;
403 struct acpi_memory_device *mem_device = NULL; 389 struct acpi_memory_device *mem_device = NULL;
404 390
405 ACPI_FUNCTION_TRACE("acpi_memory_device_add");
406 391
407 if (!device) 392 if (!device)
408 return_VALUE(-EINVAL); 393 return -EINVAL;
409 394
410 mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); 395 mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
411 if (!mem_device) 396 if (!mem_device)
412 return_VALUE(-ENOMEM); 397 return -ENOMEM;
413 memset(mem_device, 0, sizeof(struct acpi_memory_device)); 398 memset(mem_device, 0, sizeof(struct acpi_memory_device));
414 399
415 INIT_LIST_HEAD(&mem_device->res_list); 400 INIT_LIST_HEAD(&mem_device->res_list);
@@ -422,7 +407,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
422 result = acpi_memory_get_device_resources(mem_device); 407 result = acpi_memory_get_device_resources(mem_device);
423 if (result) { 408 if (result) {
424 kfree(mem_device); 409 kfree(mem_device);
425 return_VALUE(result); 410 return result;
426 } 411 }
427 412
428 /* Set the device state */ 413 /* Set the device state */
@@ -430,22 +415,21 @@ static int acpi_memory_device_add(struct acpi_device *device)
430 415
431 printk(KERN_INFO "%s \n", acpi_device_name(device)); 416 printk(KERN_INFO "%s \n", acpi_device_name(device));
432 417
433 return_VALUE(result); 418 return result;
434} 419}
435 420
436static int acpi_memory_device_remove(struct acpi_device *device, int type) 421static int acpi_memory_device_remove(struct acpi_device *device, int type)
437{ 422{
438 struct acpi_memory_device *mem_device = NULL; 423 struct acpi_memory_device *mem_device = NULL;
439 424
440 ACPI_FUNCTION_TRACE("acpi_memory_device_remove");
441 425
442 if (!device || !acpi_driver_data(device)) 426 if (!device || !acpi_driver_data(device))
443 return_VALUE(-EINVAL); 427 return -EINVAL;
444 428
445 mem_device = (struct acpi_memory_device *)acpi_driver_data(device); 429 mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
446 kfree(mem_device); 430 kfree(mem_device);
447 431
448 return_VALUE(0); 432 return 0;
449} 433}
450 434
451static int acpi_memory_device_start (struct acpi_device *device) 435static int acpi_memory_device_start (struct acpi_device *device)
@@ -453,8 +437,6 @@ static int acpi_memory_device_start (struct acpi_device *device)
453 struct acpi_memory_device *mem_device; 437 struct acpi_memory_device *mem_device;
454 int result = 0; 438 int result = 0;
455 439
456 ACPI_FUNCTION_TRACE("acpi_memory_device_start");
457
458 mem_device = acpi_driver_data(device); 440 mem_device = acpi_driver_data(device);
459 441
460 if (!acpi_memory_check_device(mem_device)) { 442 if (!acpi_memory_check_device(mem_device)) {
@@ -464,7 +446,7 @@ static int acpi_memory_device_start (struct acpi_device *device)
464 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 446 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
465 "Error in acpi_memory_enable_device\n")); 447 "Error in acpi_memory_enable_device\n"));
466 } 448 }
467 return_VALUE(result); 449 return result;
468} 450}
469 451
470/* 452/*
@@ -477,16 +459,15 @@ static acpi_status is_memory_device(acpi_handle handle)
477 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 459 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
478 struct acpi_device_info *info; 460 struct acpi_device_info *info;
479 461
480 ACPI_FUNCTION_TRACE("is_memory_device");
481 462
482 status = acpi_get_object_info(handle, &buffer); 463 status = acpi_get_object_info(handle, &buffer);
483 if (ACPI_FAILURE(status)) 464 if (ACPI_FAILURE(status))
484 return_ACPI_STATUS(AE_ERROR); 465 return status;
485 466
486 info = buffer.pointer; 467 info = buffer.pointer;
487 if (!(info->valid & ACPI_VALID_HID)) { 468 if (!(info->valid & ACPI_VALID_HID)) {
488 acpi_os_free(buffer.pointer); 469 acpi_os_free(buffer.pointer);
489 return_ACPI_STATUS(AE_ERROR); 470 return AE_ERROR;
490 } 471 }
491 472
492 hardware_id = info->hardware_id.value; 473 hardware_id = info->hardware_id.value;
@@ -495,7 +476,7 @@ static acpi_status is_memory_device(acpi_handle handle)
495 status = AE_ERROR; 476 status = AE_ERROR;
496 477
497 acpi_os_free(buffer.pointer); 478 acpi_os_free(buffer.pointer);
498 return_ACPI_STATUS(status); 479 return status;
499} 480}
500 481
501static acpi_status 482static acpi_status
@@ -504,21 +485,17 @@ acpi_memory_register_notify_handler(acpi_handle handle,
504{ 485{
505 acpi_status status; 486 acpi_status status;
506 487
507 ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
508 488
509 status = is_memory_device(handle); 489 status = is_memory_device(handle);
510 if (ACPI_FAILURE(status)) 490 if (ACPI_FAILURE(status)){
511 return_ACPI_STATUS(AE_OK); /* continue */ 491 ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
492 return AE_OK; /* continue */
493 }
512 494
513 status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, 495 status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
514 acpi_memory_device_notify, NULL); 496 acpi_memory_device_notify, NULL);
515 if (ACPI_FAILURE(status)) { 497 /* continue */
516 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 498 return AE_OK;
517 "Error installing notify handler\n"));
518 return_ACPI_STATUS(AE_OK); /* continue */
519 }
520
521 return_ACPI_STATUS(status);
522} 499}
523 500
524static acpi_status 501static acpi_status
@@ -527,22 +504,18 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
527{ 504{
528 acpi_status status; 505 acpi_status status;
529 506
530 ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
531 507
532 status = is_memory_device(handle); 508 status = is_memory_device(handle);
533 if (ACPI_FAILURE(status)) 509 if (ACPI_FAILURE(status)){
534 return_ACPI_STATUS(AE_OK); /* continue */ 510 ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
511 return AE_OK; /* continue */
512 }
535 513
536 status = acpi_remove_notify_handler(handle, 514 status = acpi_remove_notify_handler(handle,
537 ACPI_SYSTEM_NOTIFY, 515 ACPI_SYSTEM_NOTIFY,
538 acpi_memory_device_notify); 516 acpi_memory_device_notify);
539 if (ACPI_FAILURE(status)) {
540 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
541 "Error removing notify handler\n"));
542 return_ACPI_STATUS(AE_OK); /* continue */
543 }
544 517
545 return_ACPI_STATUS(status); 518 return AE_OK; /* continue */
546} 519}
547 520
548static int __init acpi_memory_device_init(void) 521static int __init acpi_memory_device_init(void)
@@ -550,12 +523,11 @@ static int __init acpi_memory_device_init(void)
550 int result; 523 int result;
551 acpi_status status; 524 acpi_status status;
552 525
553 ACPI_FUNCTION_TRACE("acpi_memory_device_init");
554 526
555 result = acpi_bus_register_driver(&acpi_memory_device_driver); 527 result = acpi_bus_register_driver(&acpi_memory_device_driver);
556 528
557 if (result < 0) 529 if (result < 0)
558 return_VALUE(-ENODEV); 530 return -ENODEV;
559 531
560 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 532 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
561 ACPI_UINT32_MAX, 533 ACPI_UINT32_MAX,
@@ -563,19 +535,18 @@ static int __init acpi_memory_device_init(void)
563 NULL, NULL); 535 NULL, NULL);
564 536
565 if (ACPI_FAILURE(status)) { 537 if (ACPI_FAILURE(status)) {
566 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n")); 538 ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
567 acpi_bus_unregister_driver(&acpi_memory_device_driver); 539 acpi_bus_unregister_driver(&acpi_memory_device_driver);
568 return_VALUE(-ENODEV); 540 return -ENODEV;
569 } 541 }
570 542
571 return_VALUE(0); 543 return 0;
572} 544}
573 545
574static void __exit acpi_memory_device_exit(void) 546static void __exit acpi_memory_device_exit(void)
575{ 547{
576 acpi_status status; 548 acpi_status status;
577 549
578 ACPI_FUNCTION_TRACE("acpi_memory_device_exit");
579 550
580 /* 551 /*
581 * Adding this to un-install notification handlers for all the device 552 * Adding this to un-install notification handlers for all the device
@@ -587,11 +558,11 @@ static void __exit acpi_memory_device_exit(void)
587 NULL, NULL); 558 NULL, NULL);
588 559
589 if (ACPI_FAILURE(status)) 560 if (ACPI_FAILURE(status))
590 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n")); 561 ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
591 562
592 acpi_bus_unregister_driver(&acpi_memory_device_driver); 563 acpi_bus_unregister_driver(&acpi_memory_device_driver);
593 564
594 return_VOID; 565 return;
595} 566}
596 567
597module_init(acpi_memory_device_init); 568module_init(acpi_memory_device_init);
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index 839f423d738d..055cfd5c8766 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1232,7 +1232,7 @@ static int __init asus_acpi_init(void)
1232 result = acpi_bus_register_driver(&asus_hotk_driver); 1232 result = acpi_bus_register_driver(&asus_hotk_driver);
1233 if (result < 0) { 1233 if (result < 0) {
1234 remove_proc_entry(PROC_ASUS, acpi_root_dir); 1234 remove_proc_entry(PROC_ASUS, acpi_root_dir);
1235 return -ENODEV; 1235 return result;
1236 } 1236 }
1237 1237
1238 /* 1238 /*
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 702e857e98c5..00b0728efe82 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,17 +132,16 @@ acpi_battery_get_info(struct acpi_battery *battery,
132 struct acpi_buffer data = { 0, NULL }; 132 struct acpi_buffer data = { 0, NULL };
133 union acpi_object *package = NULL; 133 union acpi_object *package = NULL;
134 134
135 ACPI_FUNCTION_TRACE("acpi_battery_get_info");
136 135
137 if (!battery || !bif) 136 if (!battery || !bif)
138 return_VALUE(-EINVAL); 137 return -EINVAL;
139 138
140 /* Evalute _BIF */ 139 /* Evalute _BIF */
141 140
142 status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); 141 status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
143 if (ACPI_FAILURE(status)) { 142 if (ACPI_FAILURE(status)) {
144 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n")); 143 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
145 return_VALUE(-ENODEV); 144 return -ENODEV;
146 } 145 }
147 146
148 package = (union acpi_object *)buffer.pointer; 147 package = (union acpi_object *)buffer.pointer;
@@ -151,7 +150,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
151 150
152 status = acpi_extract_package(package, &format, &data); 151 status = acpi_extract_package(package, &format, &data);
153 if (status != AE_BUFFER_OVERFLOW) { 152 if (status != AE_BUFFER_OVERFLOW) {
154 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); 153 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
155 result = -ENODEV; 154 result = -ENODEV;
156 goto end; 155 goto end;
157 } 156 }
@@ -165,7 +164,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
165 164
166 status = acpi_extract_package(package, &format, &data); 165 status = acpi_extract_package(package, &format, &data);
167 if (ACPI_FAILURE(status)) { 166 if (ACPI_FAILURE(status)) {
168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); 167 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
169 kfree(data.pointer); 168 kfree(data.pointer);
170 result = -ENODEV; 169 result = -ENODEV;
171 goto end; 170 goto end;
@@ -177,7 +176,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
177 if (!result) 176 if (!result)
178 (*bif) = (struct acpi_battery_info *)data.pointer; 177 (*bif) = (struct acpi_battery_info *)data.pointer;
179 178
180 return_VALUE(result); 179 return result;
181} 180}
182 181
183static int 182static int
@@ -193,17 +192,16 @@ acpi_battery_get_status(struct acpi_battery *battery,
193 struct acpi_buffer data = { 0, NULL }; 192 struct acpi_buffer data = { 0, NULL };
194 union acpi_object *package = NULL; 193 union acpi_object *package = NULL;
195 194
196 ACPI_FUNCTION_TRACE("acpi_battery_get_status");
197 195
198 if (!battery || !bst) 196 if (!battery || !bst)
199 return_VALUE(-EINVAL); 197 return -EINVAL;
200 198
201 /* Evalute _BST */ 199 /* Evalute _BST */
202 200
203 status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); 201 status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
204 if (ACPI_FAILURE(status)) { 202 if (ACPI_FAILURE(status)) {
205 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n")); 203 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
206 return_VALUE(-ENODEV); 204 return -ENODEV;
207 } 205 }
208 206
209 package = (union acpi_object *)buffer.pointer; 207 package = (union acpi_object *)buffer.pointer;
@@ -212,7 +210,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
212 210
213 status = acpi_extract_package(package, &format, &data); 211 status = acpi_extract_package(package, &format, &data);
214 if (status != AE_BUFFER_OVERFLOW) { 212 if (status != AE_BUFFER_OVERFLOW) {
215 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); 213 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
216 result = -ENODEV; 214 result = -ENODEV;
217 goto end; 215 goto end;
218 } 216 }
@@ -226,7 +224,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
226 224
227 status = acpi_extract_package(package, &format, &data); 225 status = acpi_extract_package(package, &format, &data);
228 if (ACPI_FAILURE(status)) { 226 if (ACPI_FAILURE(status)) {
229 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); 227 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
230 kfree(data.pointer); 228 kfree(data.pointer);
231 result = -ENODEV; 229 result = -ENODEV;
232 goto end; 230 goto end;
@@ -238,7 +236,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
238 if (!result) 236 if (!result)
239 (*bst) = (struct acpi_battery_status *)data.pointer; 237 (*bst) = (struct acpi_battery_status *)data.pointer;
240 238
241 return_VALUE(result); 239 return result;
242} 240}
243 241
244static int 242static int
@@ -248,25 +246,24 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm)
248 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 246 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
249 struct acpi_object_list arg_list = { 1, &arg0 }; 247 struct acpi_object_list arg_list = { 1, &arg0 };
250 248
251 ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
252 249
253 if (!battery) 250 if (!battery)
254 return_VALUE(-EINVAL); 251 return -EINVAL;
255 252
256 if (!battery->flags.alarm) 253 if (!battery->flags.alarm)
257 return_VALUE(-ENODEV); 254 return -ENODEV;
258 255
259 arg0.integer.value = alarm; 256 arg0.integer.value = alarm;
260 257
261 status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); 258 status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);
262 if (ACPI_FAILURE(status)) 259 if (ACPI_FAILURE(status))
263 return_VALUE(-ENODEV); 260 return -ENODEV;
264 261
265 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm)); 262 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm));
266 263
267 battery->alarm = alarm; 264 battery->alarm = alarm;
268 265
269 return_VALUE(0); 266 return 0;
270} 267}
271 268
272static int acpi_battery_check(struct acpi_battery *battery) 269static int acpi_battery_check(struct acpi_battery *battery)
@@ -277,18 +274,17 @@ static int acpi_battery_check(struct acpi_battery *battery)
277 struct acpi_device *device = NULL; 274 struct acpi_device *device = NULL;
278 struct acpi_battery_info *bif = NULL; 275 struct acpi_battery_info *bif = NULL;
279 276
280 ACPI_FUNCTION_TRACE("acpi_battery_check");
281 277
282 if (!battery) 278 if (!battery)
283 return_VALUE(-EINVAL); 279 return -EINVAL;
284 280
285 result = acpi_bus_get_device(battery->handle, &device); 281 result = acpi_bus_get_device(battery->handle, &device);
286 if (result) 282 if (result)
287 return_VALUE(result); 283 return result;
288 284
289 result = acpi_bus_get_status(device); 285 result = acpi_bus_get_status(device);
290 if (result) 286 if (result)
291 return_VALUE(result); 287 return result;
292 288
293 /* Insertion? */ 289 /* Insertion? */
294 290
@@ -300,7 +296,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
300 296
301 result = acpi_battery_get_info(battery, &bif); 297 result = acpi_battery_get_info(battery, &bif);
302 if (result) 298 if (result)
303 return_VALUE(result); 299 return result;
304 300
305 battery->flags.power_unit = bif->power_unit; 301 battery->flags.power_unit = bif->power_unit;
306 battery->trips.warning = bif->design_capacity_warning; 302 battery->trips.warning = bif->design_capacity_warning;
@@ -324,7 +320,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
324 320
325 battery->flags.present = device->status.battery_present; 321 battery->flags.present = device->status.battery_present;
326 322
327 return_VALUE(result); 323 return result;
328} 324}
329 325
330/* -------------------------------------------------------------------------- 326/* --------------------------------------------------------------------------
@@ -339,7 +335,6 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
339 struct acpi_battery_info *bif = NULL; 335 struct acpi_battery_info *bif = NULL;
340 char *units = "?"; 336 char *units = "?";
341 337
342 ACPI_FUNCTION_TRACE("acpi_battery_read_info");
343 338
344 if (!battery) 339 if (!battery)
345 goto end; 340 goto end;
@@ -409,7 +404,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
409 end: 404 end:
410 kfree(bif); 405 kfree(bif);
411 406
412 return_VALUE(0); 407 return 0;
413} 408}
414 409
415static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) 410static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
@@ -424,7 +419,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
424 struct acpi_battery_status *bst = NULL; 419 struct acpi_battery_status *bst = NULL;
425 char *units = "?"; 420 char *units = "?";
426 421
427 ACPI_FUNCTION_TRACE("acpi_battery_read_state");
428 422
429 if (!battery) 423 if (!battery)
430 goto end; 424 goto end;
@@ -458,8 +452,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
458 if ((bst->state & 0x01) && (bst->state & 0x02)) { 452 if ((bst->state & 0x01) && (bst->state & 0x02)) {
459 seq_printf(seq, 453 seq_printf(seq,
460 "charging state: charging/discharging\n"); 454 "charging state: charging/discharging\n");
461 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
462 "Battery Charging and Discharging?\n"));
463 } else if (bst->state & 0x01) 455 } else if (bst->state & 0x01)
464 seq_printf(seq, "charging state: discharging\n"); 456 seq_printf(seq, "charging state: discharging\n");
465 else if (bst->state & 0x02) 457 else if (bst->state & 0x02)
@@ -489,7 +481,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
489 end: 481 end:
490 kfree(bst); 482 kfree(bst);
491 483
492 return_VALUE(0); 484 return 0;
493} 485}
494 486
495static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) 487static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
@@ -502,7 +494,6 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
502 struct acpi_battery *battery = (struct acpi_battery *)seq->private; 494 struct acpi_battery *battery = (struct acpi_battery *)seq->private;
503 char *units = "?"; 495 char *units = "?";
504 496
505 ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
506 497
507 if (!battery) 498 if (!battery)
508 goto end; 499 goto end;
@@ -527,7 +518,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
527 seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units); 518 seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);
528 519
529 end: 520 end:
530 return_VALUE(0); 521 return 0;
531} 522}
532 523
533static ssize_t 524static ssize_t
@@ -540,25 +531,24 @@ acpi_battery_write_alarm(struct file *file,
540 struct seq_file *m = (struct seq_file *)file->private_data; 531 struct seq_file *m = (struct seq_file *)file->private_data;
541 struct acpi_battery *battery = (struct acpi_battery *)m->private; 532 struct acpi_battery *battery = (struct acpi_battery *)m->private;
542 533
543 ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
544 534
545 if (!battery || (count > sizeof(alarm_string) - 1)) 535 if (!battery || (count > sizeof(alarm_string) - 1))
546 return_VALUE(-EINVAL); 536 return -EINVAL;
547 537
548 if (!battery->flags.present) 538 if (!battery->flags.present)
549 return_VALUE(-ENODEV); 539 return -ENODEV;
550 540
551 if (copy_from_user(alarm_string, buffer, count)) 541 if (copy_from_user(alarm_string, buffer, count))
552 return_VALUE(-EFAULT); 542 return -EFAULT;
553 543
554 alarm_string[count] = '\0'; 544 alarm_string[count] = '\0';
555 545
556 result = acpi_battery_set_alarm(battery, 546 result = acpi_battery_set_alarm(battery,
557 simple_strtoul(alarm_string, NULL, 0)); 547 simple_strtoul(alarm_string, NULL, 0));
558 if (result) 548 if (result)
559 return_VALUE(result); 549 return result;
560 550
561 return_VALUE(count); 551 return count;
562} 552}
563 553
564static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) 554static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
@@ -595,13 +585,12 @@ static int acpi_battery_add_fs(struct acpi_device *device)
595{ 585{
596 struct proc_dir_entry *entry = NULL; 586 struct proc_dir_entry *entry = NULL;
597 587
598 ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
599 588
600 if (!acpi_device_dir(device)) { 589 if (!acpi_device_dir(device)) {
601 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 590 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
602 acpi_battery_dir); 591 acpi_battery_dir);
603 if (!acpi_device_dir(device)) 592 if (!acpi_device_dir(device))
604 return_VALUE(-ENODEV); 593 return -ENODEV;
605 acpi_device_dir(device)->owner = THIS_MODULE; 594 acpi_device_dir(device)->owner = THIS_MODULE;
606 } 595 }
607 596
@@ -609,9 +598,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
609 entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, 598 entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
610 S_IRUGO, acpi_device_dir(device)); 599 S_IRUGO, acpi_device_dir(device));
611 if (!entry) 600 if (!entry)
612 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 601 return -ENODEV;
613 "Unable to create '%s' fs entry\n",
614 ACPI_BATTERY_FILE_INFO));
615 else { 602 else {
616 entry->proc_fops = &acpi_battery_info_ops; 603 entry->proc_fops = &acpi_battery_info_ops;
617 entry->data = acpi_driver_data(device); 604 entry->data = acpi_driver_data(device);
@@ -622,9 +609,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
622 entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, 609 entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
623 S_IRUGO, acpi_device_dir(device)); 610 S_IRUGO, acpi_device_dir(device));
624 if (!entry) 611 if (!entry)
625 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 612 return -ENODEV;
626 "Unable to create '%s' fs entry\n",
627 ACPI_BATTERY_FILE_STATUS));
628 else { 613 else {
629 entry->proc_fops = &acpi_battery_state_ops; 614 entry->proc_fops = &acpi_battery_state_ops;
630 entry->data = acpi_driver_data(device); 615 entry->data = acpi_driver_data(device);
@@ -636,21 +621,18 @@ static int acpi_battery_add_fs(struct acpi_device *device)
636 S_IFREG | S_IRUGO | S_IWUSR, 621 S_IFREG | S_IRUGO | S_IWUSR,
637 acpi_device_dir(device)); 622 acpi_device_dir(device));
638 if (!entry) 623 if (!entry)
639 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 624 return -ENODEV;
640 "Unable to create '%s' fs entry\n",
641 ACPI_BATTERY_FILE_ALARM));
642 else { 625 else {
643 entry->proc_fops = &acpi_battery_alarm_ops; 626 entry->proc_fops = &acpi_battery_alarm_ops;
644 entry->data = acpi_driver_data(device); 627 entry->data = acpi_driver_data(device);
645 entry->owner = THIS_MODULE; 628 entry->owner = THIS_MODULE;
646 } 629 }
647 630
648 return_VALUE(0); 631 return 0;
649} 632}
650 633
651static int acpi_battery_remove_fs(struct acpi_device *device) 634static int acpi_battery_remove_fs(struct acpi_device *device)
652{ 635{
653 ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
654 636
655 if (acpi_device_dir(device)) { 637 if (acpi_device_dir(device)) {
656 remove_proc_entry(ACPI_BATTERY_FILE_ALARM, 638 remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
@@ -664,7 +646,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device)
664 acpi_device_dir(device) = NULL; 646 acpi_device_dir(device) = NULL;
665 } 647 }
666 648
667 return_VALUE(0); 649 return 0;
668} 650}
669 651
670/* -------------------------------------------------------------------------- 652/* --------------------------------------------------------------------------
@@ -676,13 +658,12 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
676 struct acpi_battery *battery = (struct acpi_battery *)data; 658 struct acpi_battery *battery = (struct acpi_battery *)data;
677 struct acpi_device *device = NULL; 659 struct acpi_device *device = NULL;
678 660
679 ACPI_FUNCTION_TRACE("acpi_battery_notify");
680 661
681 if (!battery) 662 if (!battery)
682 return_VOID; 663 return;
683 664
684 if (acpi_bus_get_device(handle, &device)) 665 if (acpi_bus_get_device(handle, &device))
685 return_VOID; 666 return;
686 667
687 switch (event) { 668 switch (event) {
688 case ACPI_BATTERY_NOTIFY_STATUS: 669 case ACPI_BATTERY_NOTIFY_STATUS:
@@ -696,7 +677,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
696 break; 677 break;
697 } 678 }
698 679
699 return_VOID; 680 return;
700} 681}
701 682
702static int acpi_battery_add(struct acpi_device *device) 683static int acpi_battery_add(struct acpi_device *device)
@@ -705,14 +686,13 @@ static int acpi_battery_add(struct acpi_device *device)
705 acpi_status status = 0; 686 acpi_status status = 0;
706 struct acpi_battery *battery = NULL; 687 struct acpi_battery *battery = NULL;
707 688
708 ACPI_FUNCTION_TRACE("acpi_battery_add");
709 689
710 if (!device) 690 if (!device)
711 return_VALUE(-EINVAL); 691 return -EINVAL;
712 692
713 battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL); 693 battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
714 if (!battery) 694 if (!battery)
715 return_VALUE(-ENOMEM); 695 return -ENOMEM;
716 memset(battery, 0, sizeof(struct acpi_battery)); 696 memset(battery, 0, sizeof(struct acpi_battery));
717 697
718 battery->handle = device->handle; 698 battery->handle = device->handle;
@@ -732,8 +712,6 @@ static int acpi_battery_add(struct acpi_device *device)
732 ACPI_DEVICE_NOTIFY, 712 ACPI_DEVICE_NOTIFY,
733 acpi_battery_notify, battery); 713 acpi_battery_notify, battery);
734 if (ACPI_FAILURE(status)) { 714 if (ACPI_FAILURE(status)) {
735 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
736 "Error installing notify handler\n"));
737 result = -ENODEV; 715 result = -ENODEV;
738 goto end; 716 goto end;
739 } 717 }
@@ -748,7 +726,7 @@ static int acpi_battery_add(struct acpi_device *device)
748 kfree(battery); 726 kfree(battery);
749 } 727 }
750 728
751 return_VALUE(result); 729 return result;
752} 730}
753 731
754static int acpi_battery_remove(struct acpi_device *device, int type) 732static int acpi_battery_remove(struct acpi_device *device, int type)
@@ -756,56 +734,50 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
756 acpi_status status = 0; 734 acpi_status status = 0;
757 struct acpi_battery *battery = NULL; 735 struct acpi_battery *battery = NULL;
758 736
759 ACPI_FUNCTION_TRACE("acpi_battery_remove");
760 737
761 if (!device || !acpi_driver_data(device)) 738 if (!device || !acpi_driver_data(device))
762 return_VALUE(-EINVAL); 739 return -EINVAL;
763 740
764 battery = (struct acpi_battery *)acpi_driver_data(device); 741 battery = (struct acpi_battery *)acpi_driver_data(device);
765 742
766 status = acpi_remove_notify_handler(battery->handle, 743 status = acpi_remove_notify_handler(battery->handle,
767 ACPI_DEVICE_NOTIFY, 744 ACPI_DEVICE_NOTIFY,
768 acpi_battery_notify); 745 acpi_battery_notify);
769 if (ACPI_FAILURE(status))
770 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
771 "Error removing notify handler\n"));
772 746
773 acpi_battery_remove_fs(device); 747 acpi_battery_remove_fs(device);
774 748
775 kfree(battery); 749 kfree(battery);
776 750
777 return_VALUE(0); 751 return 0;
778} 752}
779 753
780static int __init acpi_battery_init(void) 754static int __init acpi_battery_init(void)
781{ 755{
782 int result = 0; 756 int result = 0;
783 757
784 ACPI_FUNCTION_TRACE("acpi_battery_init");
785 758
786 acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); 759 acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
787 if (!acpi_battery_dir) 760 if (!acpi_battery_dir)
788 return_VALUE(-ENODEV); 761 return -ENODEV;
789 acpi_battery_dir->owner = THIS_MODULE; 762 acpi_battery_dir->owner = THIS_MODULE;
790 763
791 result = acpi_bus_register_driver(&acpi_battery_driver); 764 result = acpi_bus_register_driver(&acpi_battery_driver);
792 if (result < 0) { 765 if (result < 0) {
793 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); 766 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
794 return_VALUE(-ENODEV); 767 return -ENODEV;
795 } 768 }
796 769
797 return_VALUE(0); 770 return 0;
798} 771}
799 772
800static void __exit acpi_battery_exit(void) 773static void __exit acpi_battery_exit(void)
801{ 774{
802 ACPI_FUNCTION_TRACE("acpi_battery_exit");
803 775
804 acpi_bus_unregister_driver(&acpi_battery_driver); 776 acpi_bus_unregister_driver(&acpi_battery_driver);
805 777
806 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); 778 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
807 779
808 return_VOID; 780 return;
809} 781}
810 782
811module_init(acpi_battery_init); 783module_init(acpi_battery_init);
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index dd3983cece92..dec044c04273 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -60,21 +60,19 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
60{ 60{
61 acpi_status status = AE_OK; 61 acpi_status status = AE_OK;
62 62
63 ACPI_FUNCTION_TRACE("acpi_bus_get_device");
64 63
65 if (!device) 64 if (!device)
66 return_VALUE(-EINVAL); 65 return -EINVAL;
67 66
68 /* TBD: Support fixed-feature devices */ 67 /* TBD: Support fixed-feature devices */
69 68
70 status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device); 69 status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
71 if (ACPI_FAILURE(status) || !*device) { 70 if (ACPI_FAILURE(status) || !*device) {
72 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n", 71 ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
73 handle)); 72 return -ENODEV;
74 return_VALUE(-ENODEV);
75 } 73 }
76 74
77 return_VALUE(0); 75 return 0;
78} 76}
79 77
80EXPORT_SYMBOL(acpi_bus_get_device); 78EXPORT_SYMBOL(acpi_bus_get_device);
@@ -84,10 +82,9 @@ int acpi_bus_get_status(struct acpi_device *device)
84 acpi_status status = AE_OK; 82 acpi_status status = AE_OK;
85 unsigned long sta = 0; 83 unsigned long sta = 0;
86 84
87 ACPI_FUNCTION_TRACE("acpi_bus_get_status");
88 85
89 if (!device) 86 if (!device)
90 return_VALUE(-EINVAL); 87 return -EINVAL;
91 88
92 /* 89 /*
93 * Evaluate _STA if present. 90 * Evaluate _STA if present.
@@ -96,7 +93,7 @@ int acpi_bus_get_status(struct acpi_device *device)
96 status = 93 status =
97 acpi_evaluate_integer(device->handle, "_STA", NULL, &sta); 94 acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
98 if (ACPI_FAILURE(status)) 95 if (ACPI_FAILURE(status))
99 return_VALUE(-ENODEV); 96 return -ENODEV;
100 STRUCT_TO_INT(device->status) = (int)sta; 97 STRUCT_TO_INT(device->status) = (int)sta;
101 } 98 }
102 99
@@ -120,7 +117,7 @@ int acpi_bus_get_status(struct acpi_device *device)
120 device->pnp.bus_id, 117 device->pnp.bus_id,
121 (u32) STRUCT_TO_INT(device->status))); 118 (u32) STRUCT_TO_INT(device->status)));
122 119
123 return_VALUE(0); 120 return 0;
124} 121}
125 122
126EXPORT_SYMBOL(acpi_bus_get_status); 123EXPORT_SYMBOL(acpi_bus_get_status);
@@ -136,11 +133,10 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
136 struct acpi_device *device = NULL; 133 struct acpi_device *device = NULL;
137 unsigned long psc = 0; 134 unsigned long psc = 0;
138 135
139 ACPI_FUNCTION_TRACE("acpi_bus_get_power");
140 136
141 result = acpi_bus_get_device(handle, &device); 137 result = acpi_bus_get_device(handle, &device);
142 if (result) 138 if (result)
143 return_VALUE(result); 139 return result;
144 140
145 *state = ACPI_STATE_UNKNOWN; 141 *state = ACPI_STATE_UNKNOWN;
146 142
@@ -159,12 +155,12 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
159 status = acpi_evaluate_integer(device->handle, "_PSC", 155 status = acpi_evaluate_integer(device->handle, "_PSC",
160 NULL, &psc); 156 NULL, &psc);
161 if (ACPI_FAILURE(status)) 157 if (ACPI_FAILURE(status))
162 return_VALUE(-ENODEV); 158 return -ENODEV;
163 device->power.state = (int)psc; 159 device->power.state = (int)psc;
164 } else if (device->power.flags.power_resources) { 160 } else if (device->power.flags.power_resources) {
165 result = acpi_power_get_inferred_state(device); 161 result = acpi_power_get_inferred_state(device);
166 if (result) 162 if (result)
167 return_VALUE(result); 163 return result;
168 } 164 }
169 165
170 *state = device->power.state; 166 *state = device->power.state;
@@ -173,7 +169,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
173 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n", 169 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n",
174 device->pnp.bus_id, device->power.state)); 170 device->pnp.bus_id, device->power.state));
175 171
176 return_VALUE(0); 172 return 0;
177} 173}
178 174
179EXPORT_SYMBOL(acpi_bus_get_power); 175EXPORT_SYMBOL(acpi_bus_get_power);
@@ -185,21 +181,20 @@ int acpi_bus_set_power(acpi_handle handle, int state)
185 struct acpi_device *device = NULL; 181 struct acpi_device *device = NULL;
186 char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' }; 182 char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
187 183
188 ACPI_FUNCTION_TRACE("acpi_bus_set_power");
189 184
190 result = acpi_bus_get_device(handle, &device); 185 result = acpi_bus_get_device(handle, &device);
191 if (result) 186 if (result)
192 return_VALUE(result); 187 return result;
193 188
194 if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) 189 if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
195 return_VALUE(-EINVAL); 190 return -EINVAL;
196 191
197 /* Make sure this is a valid target state */ 192 /* Make sure this is a valid target state */
198 193
199 if (!device->flags.power_manageable) { 194 if (!device->flags.power_manageable) {
200 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 195 printk(KERN_DEBUG "Device `[%s]is not power manageable",
201 "Device is not power manageable\n")); 196 device->kobj.name);
202 return_VALUE(-ENODEV); 197 return -ENODEV;
203 } 198 }
204 /* 199 /*
205 * Get device's current power state if it's unknown 200 * Get device's current power state if it's unknown
@@ -211,18 +206,18 @@ int acpi_bus_set_power(acpi_handle handle, int state)
211 if (state == device->power.state) { 206 if (state == device->power.state) {
212 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", 207 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
213 state)); 208 state));
214 return_VALUE(0); 209 return 0;
215 } 210 }
216 } 211 }
217 if (!device->power.states[state].flags.valid) { 212 if (!device->power.states[state].flags.valid) {
218 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n", 213 printk(KERN_WARNING PREFIX "Device does not support D%d\n", state);
219 state)); 214 return -ENODEV;
220 return_VALUE(-ENODEV);
221 } 215 }
222 if (device->parent && (state < device->parent->power.state)) { 216 if (device->parent && (state < device->parent->power.state)) {
223 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 217 printk(KERN_WARNING PREFIX
224 "Cannot set device to a higher-powered state than parent\n")); 218 "Cannot set device to a higher-powered"
225 return_VALUE(-ENODEV); 219 " state than parent\n");
220 return -ENODEV;
226 } 221 }
227 222
228 /* 223 /*
@@ -264,15 +259,15 @@ int acpi_bus_set_power(acpi_handle handle, int state)
264 259
265 end: 260 end:
266 if (result) 261 if (result)
267 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 262 printk(KERN_WARNING PREFIX
268 "Error transitioning device [%s] to D%d\n", 263 "Transitioning device [%s] to D%d\n",
269 device->pnp.bus_id, state)); 264 device->pnp.bus_id, state);
270 else 265 else
271 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 266 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
272 "Device [%s] transitioned to D%d\n", 267 "Device [%s] transitioned to D%d\n",
273 device->pnp.bus_id, state)); 268 device->pnp.bus_id, state));
274 269
275 return_VALUE(result); 270 return result;
276} 271}
277 272
278EXPORT_SYMBOL(acpi_bus_set_power); 273EXPORT_SYMBOL(acpi_bus_set_power);
@@ -293,18 +288,17 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
293 struct acpi_bus_event *event = NULL; 288 struct acpi_bus_event *event = NULL;
294 unsigned long flags = 0; 289 unsigned long flags = 0;
295 290
296 ACPI_FUNCTION_TRACE("acpi_bus_generate_event");
297 291
298 if (!device) 292 if (!device)
299 return_VALUE(-EINVAL); 293 return -EINVAL;
300 294
301 /* drop event on the floor if no one's listening */ 295 /* drop event on the floor if no one's listening */
302 if (!event_is_open) 296 if (!event_is_open)
303 return_VALUE(0); 297 return 0;
304 298
305 event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC); 299 event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
306 if (!event) 300 if (!event)
307 return_VALUE(-ENOMEM); 301 return -ENOMEM;
308 302
309 strcpy(event->device_class, device->pnp.device_class); 303 strcpy(event->device_class, device->pnp.device_class);
310 strcpy(event->bus_id, device->pnp.bus_id); 304 strcpy(event->bus_id, device->pnp.bus_id);
@@ -317,7 +311,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
317 311
318 wake_up_interruptible(&acpi_bus_event_queue); 312 wake_up_interruptible(&acpi_bus_event_queue);
319 313
320 return_VALUE(0); 314 return 0;
321} 315}
322 316
323EXPORT_SYMBOL(acpi_bus_generate_event); 317EXPORT_SYMBOL(acpi_bus_generate_event);
@@ -329,10 +323,9 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
329 323
330 DECLARE_WAITQUEUE(wait, current); 324 DECLARE_WAITQUEUE(wait, current);
331 325
332 ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
333 326
334 if (!event) 327 if (!event)
335 return_VALUE(-EINVAL); 328 return -EINVAL;
336 329
337 if (list_empty(&acpi_bus_event_list)) { 330 if (list_empty(&acpi_bus_event_list)) {
338 331
@@ -346,7 +339,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
346 set_current_state(TASK_RUNNING); 339 set_current_state(TASK_RUNNING);
347 340
348 if (signal_pending(current)) 341 if (signal_pending(current))
349 return_VALUE(-ERESTARTSYS); 342 return -ERESTARTSYS;
350 } 343 }
351 344
352 spin_lock_irqsave(&acpi_bus_event_lock, flags); 345 spin_lock_irqsave(&acpi_bus_event_lock, flags);
@@ -357,13 +350,13 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
357 spin_unlock_irqrestore(&acpi_bus_event_lock, flags); 350 spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
358 351
359 if (!entry) 352 if (!entry)
360 return_VALUE(-ENODEV); 353 return -ENODEV;
361 354
362 memcpy(event, entry, sizeof(struct acpi_bus_event)); 355 memcpy(event, entry, sizeof(struct acpi_bus_event));
363 356
364 kfree(entry); 357 kfree(entry);
365 358
366 return_VALUE(0); 359 return 0;
367} 360}
368 361
369EXPORT_SYMBOL(acpi_bus_receive_event); 362EXPORT_SYMBOL(acpi_bus_receive_event);
@@ -378,10 +371,9 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
378 acpi_status status = 0; 371 acpi_status status = 0;
379 struct acpi_device_status old_status; 372 struct acpi_device_status old_status;
380 373
381 ACPI_FUNCTION_TRACE("acpi_bus_check_device");
382 374
383 if (!device) 375 if (!device)
384 return_VALUE(-EINVAL); 376 return -EINVAL;
385 377
386 if (status_changed) 378 if (status_changed)
387 *status_changed = 0; 379 *status_changed = 0;
@@ -398,15 +390,15 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
398 if (status_changed) 390 if (status_changed)
399 *status_changed = 1; 391 *status_changed = 1;
400 } 392 }
401 return_VALUE(0); 393 return 0;
402 } 394 }
403 395
404 status = acpi_bus_get_status(device); 396 status = acpi_bus_get_status(device);
405 if (ACPI_FAILURE(status)) 397 if (ACPI_FAILURE(status))
406 return_VALUE(-ENODEV); 398 return -ENODEV;
407 399
408 if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status)) 400 if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status))
409 return_VALUE(0); 401 return 0;
410 402
411 if (status_changed) 403 if (status_changed)
412 *status_changed = 1; 404 *status_changed = 1;
@@ -422,7 +414,7 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed)
422 /* TBD: Handle device removal */ 414 /* TBD: Handle device removal */
423 } 415 }
424 416
425 return_VALUE(0); 417 return 0;
426} 418}
427 419
428static int acpi_bus_check_scope(struct acpi_device *device) 420static int acpi_bus_check_scope(struct acpi_device *device)
@@ -430,25 +422,24 @@ static int acpi_bus_check_scope(struct acpi_device *device)
430 int result = 0; 422 int result = 0;
431 int status_changed = 0; 423 int status_changed = 0;
432 424
433 ACPI_FUNCTION_TRACE("acpi_bus_check_scope");
434 425
435 if (!device) 426 if (!device)
436 return_VALUE(-EINVAL); 427 return -EINVAL;
437 428
438 /* Status Change? */ 429 /* Status Change? */
439 result = acpi_bus_check_device(device, &status_changed); 430 result = acpi_bus_check_device(device, &status_changed);
440 if (result) 431 if (result)
441 return_VALUE(result); 432 return result;
442 433
443 if (!status_changed) 434 if (!status_changed)
444 return_VALUE(0); 435 return 0;
445 436
446 /* 437 /*
447 * TBD: Enumerate child devices within this device's scope and 438 * TBD: Enumerate child devices within this device's scope and
448 * run acpi_bus_check_device()'s on them. 439 * run acpi_bus_check_device()'s on them.
449 */ 440 */
450 441
451 return_VALUE(0); 442 return 0;
452} 443}
453 444
454/** 445/**
@@ -461,10 +452,9 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
461 int result = 0; 452 int result = 0;
462 struct acpi_device *device = NULL; 453 struct acpi_device *device = NULL;
463 454
464 ACPI_FUNCTION_TRACE("acpi_bus_notify");
465 455
466 if (acpi_bus_get_device(handle, &device)) 456 if (acpi_bus_get_device(handle, &device))
467 return_VOID; 457 return;
468 458
469 switch (type) { 459 switch (type) {
470 460
@@ -539,7 +529,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
539 break; 529 break;
540 } 530 }
541 531
542 return_VOID; 532 return;
543} 533}
544 534
545/* -------------------------------------------------------------------------- 535/* --------------------------------------------------------------------------
@@ -553,7 +543,6 @@ static int __init acpi_bus_init_irq(void)
553 struct acpi_object_list arg_list = { 1, &arg }; 543 struct acpi_object_list arg_list = { 1, &arg };
554 char *message = NULL; 544 char *message = NULL;
555 545
556 ACPI_FUNCTION_TRACE("acpi_bus_init_irq");
557 546
558 /* 547 /*
559 * Let the system know what interrupt model we are using by 548 * Let the system know what interrupt model we are using by
@@ -572,7 +561,7 @@ static int __init acpi_bus_init_irq(void)
572 break; 561 break;
573 default: 562 default:
574 printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n"); 563 printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
575 return_VALUE(-ENODEV); 564 return -ENODEV;
576 } 565 }
577 566
578 printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message); 567 printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
@@ -581,11 +570,11 @@ static int __init acpi_bus_init_irq(void)
581 570
582 status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL); 571 status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
583 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { 572 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
584 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n")); 573 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
585 return_VALUE(-ENODEV); 574 return -ENODEV;
586 } 575 }
587 576
588 return_VALUE(0); 577 return 0;
589} 578}
590 579
591void __init acpi_early_init(void) 580void __init acpi_early_init(void)
@@ -593,10 +582,9 @@ void __init acpi_early_init(void)
593 acpi_status status = AE_OK; 582 acpi_status status = AE_OK;
594 struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt }; 583 struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt };
595 584
596 ACPI_FUNCTION_TRACE("acpi_early_init");
597 585
598 if (acpi_disabled) 586 if (acpi_disabled)
599 return_VOID; 587 return;
600 588
601 printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); 589 printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
602 590
@@ -656,11 +644,11 @@ void __init acpi_early_init(void)
656 goto error0; 644 goto error0;
657 } 645 }
658 646
659 return_VOID; 647 return;
660 648
661 error0: 649 error0:
662 disable_acpi(); 650 disable_acpi();
663 return_VOID; 651 return;
664} 652}
665 653
666static int __init acpi_bus_init(void) 654static int __init acpi_bus_init(void)
@@ -669,7 +657,6 @@ static int __init acpi_bus_init(void)
669 acpi_status status = AE_OK; 657 acpi_status status = AE_OK;
670 extern acpi_status acpi_os_initialize1(void); 658 extern acpi_status acpi_os_initialize1(void);
671 659
672 ACPI_FUNCTION_TRACE("acpi_bus_init");
673 660
674 status = acpi_os_initialize1(); 661 status = acpi_os_initialize1();
675 662
@@ -731,12 +718,12 @@ static int __init acpi_bus_init(void)
731 */ 718 */
732 acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL); 719 acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
733 720
734 return_VALUE(0); 721 return 0;
735 722
736 /* Mimic structured exception handling */ 723 /* Mimic structured exception handling */
737 error1: 724 error1:
738 acpi_terminate(); 725 acpi_terminate();
739 return_VALUE(-ENODEV); 726 return -ENODEV;
740} 727}
741 728
742decl_subsys(acpi, NULL, NULL); 729decl_subsys(acpi, NULL, NULL);
@@ -745,11 +732,10 @@ static int __init acpi_init(void)
745{ 732{
746 int result = 0; 733 int result = 0;
747 734
748 ACPI_FUNCTION_TRACE("acpi_init");
749 735
750 if (acpi_disabled) { 736 if (acpi_disabled) {
751 printk(KERN_INFO PREFIX "Interpreter disabled.\n"); 737 printk(KERN_INFO PREFIX "Interpreter disabled.\n");
752 return_VALUE(-ENODEV); 738 return -ENODEV;
753 } 739 }
754 740
755 firmware_register(&acpi_subsys); 741 firmware_register(&acpi_subsys);
@@ -770,7 +756,7 @@ static int __init acpi_init(void)
770 } else 756 } else
771 disable_acpi(); 757 disable_acpi();
772 758
773 return_VALUE(result); 759 return result;
774} 760}
775 761
776subsys_initcall(acpi_init); 762subsys_initcall(acpi_init);
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 4b6d9f0096a1..02594639c4d9 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -112,15 +112,14 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
112{ 112{
113 struct acpi_button *button = (struct acpi_button *)seq->private; 113 struct acpi_button *button = (struct acpi_button *)seq->private;
114 114
115 ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
116 115
117 if (!button || !button->device) 116 if (!button || !button->device)
118 return_VALUE(0); 117 return 0;
119 118
120 seq_printf(seq, "type: %s\n", 119 seq_printf(seq, "type: %s\n",
121 acpi_device_name(button->device)); 120 acpi_device_name(button->device));
122 121
123 return_VALUE(0); 122 return 0;
124} 123}
125 124
126static int acpi_button_info_open_fs(struct inode *inode, struct file *file) 125static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
@@ -134,10 +133,9 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
134 acpi_status status; 133 acpi_status status;
135 unsigned long state; 134 unsigned long state;
136 135
137 ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
138 136
139 if (!button || !button->device) 137 if (!button || !button->device)
140 return_VALUE(0); 138 return 0;
141 139
142 status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); 140 status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
143 if (ACPI_FAILURE(status)) { 141 if (ACPI_FAILURE(status)) {
@@ -147,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
147 (state ? "open" : "closed")); 145 (state ? "open" : "closed"));
148 } 146 }
149 147
150 return_VALUE(0); 148 return 0;
151} 149}
152 150
153static int acpi_button_state_open_fs(struct inode *inode, struct file *file) 151static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
@@ -164,10 +162,9 @@ static int acpi_button_add_fs(struct acpi_device *device)
164 struct proc_dir_entry *entry = NULL; 162 struct proc_dir_entry *entry = NULL;
165 struct acpi_button *button = NULL; 163 struct acpi_button *button = NULL;
166 164
167 ACPI_FUNCTION_TRACE("acpi_button_add_fs");
168 165
169 if (!device || !acpi_driver_data(device)) 166 if (!device || !acpi_driver_data(device))
170 return_VALUE(-EINVAL); 167 return -EINVAL;
171 168
172 button = acpi_driver_data(device); 169 button = acpi_driver_data(device);
173 170
@@ -195,21 +192,19 @@ static int acpi_button_add_fs(struct acpi_device *device)
195 } 192 }
196 193
197 if (!entry) 194 if (!entry)
198 return_VALUE(-ENODEV); 195 return -ENODEV;
199 entry->owner = THIS_MODULE; 196 entry->owner = THIS_MODULE;
200 197
201 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); 198 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
202 if (!acpi_device_dir(device)) 199 if (!acpi_device_dir(device))
203 return_VALUE(-ENODEV); 200 return -ENODEV;
204 acpi_device_dir(device)->owner = THIS_MODULE; 201 acpi_device_dir(device)->owner = THIS_MODULE;
205 202
206 /* 'info' [R] */ 203 /* 'info' [R] */
207 entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, 204 entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
208 S_IRUGO, acpi_device_dir(device)); 205 S_IRUGO, acpi_device_dir(device));
209 if (!entry) 206 if (!entry)
210 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 207 return -ENODEV;
211 "Unable to create '%s' fs entry\n",
212 ACPI_BUTTON_FILE_INFO));
213 else { 208 else {
214 entry->proc_fops = &acpi_button_info_fops; 209 entry->proc_fops = &acpi_button_info_fops;
215 entry->data = acpi_driver_data(device); 210 entry->data = acpi_driver_data(device);
@@ -221,9 +216,7 @@ static int acpi_button_add_fs(struct acpi_device *device)
221 entry = create_proc_entry(ACPI_BUTTON_FILE_STATE, 216 entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
222 S_IRUGO, acpi_device_dir(device)); 217 S_IRUGO, acpi_device_dir(device));
223 if (!entry) 218 if (!entry)
224 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 219 return -ENODEV;
225 "Unable to create '%s' fs entry\n",
226 ACPI_BUTTON_FILE_INFO));
227 else { 220 else {
228 entry->proc_fops = &acpi_button_state_fops; 221 entry->proc_fops = &acpi_button_state_fops;
229 entry->data = acpi_driver_data(device); 222 entry->data = acpi_driver_data(device);
@@ -231,14 +224,13 @@ static int acpi_button_add_fs(struct acpi_device *device)
231 } 224 }
232 } 225 }
233 226
234 return_VALUE(0); 227 return 0;
235} 228}
236 229
237static int acpi_button_remove_fs(struct acpi_device *device) 230static int acpi_button_remove_fs(struct acpi_device *device)
238{ 231{
239 struct acpi_button *button = NULL; 232 struct acpi_button *button = NULL;
240 233
241 ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
242 234
243 button = acpi_driver_data(device); 235 button = acpi_driver_data(device);
244 if (acpi_device_dir(device)) { 236 if (acpi_device_dir(device)) {
@@ -253,7 +245,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
253 acpi_device_dir(device) = NULL; 245 acpi_device_dir(device) = NULL;
254 } 246 }
255 247
256 return_VALUE(0); 248 return 0;
257} 249}
258 250
259/* -------------------------------------------------------------------------- 251/* --------------------------------------------------------------------------
@@ -264,10 +256,9 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
264{ 256{
265 struct acpi_button *button = (struct acpi_button *)data; 257 struct acpi_button *button = (struct acpi_button *)data;
266 258
267 ACPI_FUNCTION_TRACE("acpi_button_notify");
268 259
269 if (!button || !button->device) 260 if (!button || !button->device)
270 return_VOID; 261 return;
271 262
272 switch (event) { 263 switch (event) {
273 case ACPI_BUTTON_NOTIFY_STATUS: 264 case ACPI_BUTTON_NOTIFY_STATUS:
@@ -280,21 +271,20 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
280 break; 271 break;
281 } 272 }
282 273
283 return_VOID; 274 return;
284} 275}
285 276
286static acpi_status acpi_button_notify_fixed(void *data) 277static acpi_status acpi_button_notify_fixed(void *data)
287{ 278{
288 struct acpi_button *button = (struct acpi_button *)data; 279 struct acpi_button *button = (struct acpi_button *)data;
289 280
290 ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
291 281
292 if (!button) 282 if (!button)
293 return_ACPI_STATUS(AE_BAD_PARAMETER); 283 return AE_BAD_PARAMETER;
294 284
295 acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); 285 acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
296 286
297 return_ACPI_STATUS(AE_OK); 287 return AE_OK;
298} 288}
299 289
300static int acpi_button_add(struct acpi_device *device) 290static int acpi_button_add(struct acpi_device *device)
@@ -303,14 +293,13 @@ static int acpi_button_add(struct acpi_device *device)
303 acpi_status status = AE_OK; 293 acpi_status status = AE_OK;
304 struct acpi_button *button = NULL; 294 struct acpi_button *button = NULL;
305 295
306 ACPI_FUNCTION_TRACE("acpi_button_add");
307 296
308 if (!device) 297 if (!device)
309 return_VALUE(-EINVAL); 298 return -EINVAL;
310 299
311 button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL); 300 button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL);
312 if (!button) 301 if (!button)
313 return_VALUE(-ENOMEM); 302 return -ENOMEM;
314 memset(button, 0, sizeof(struct acpi_button)); 303 memset(button, 0, sizeof(struct acpi_button));
315 304
316 button->device = device; 305 button->device = device;
@@ -349,8 +338,8 @@ static int acpi_button_add(struct acpi_device *device)
349 sprintf(acpi_device_class(device), "%s/%s", 338 sprintf(acpi_device_class(device), "%s/%s",
350 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); 339 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
351 } else { 340 } else {
352 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n", 341 printk(KERN_ERR PREFIX "Unsupported hid [%s]\n",
353 acpi_device_hid(device))); 342 acpi_device_hid(device));
354 result = -ENODEV; 343 result = -ENODEV;
355 goto end; 344 goto end;
356 } 345 }
@@ -381,8 +370,6 @@ static int acpi_button_add(struct acpi_device *device)
381 } 370 }
382 371
383 if (ACPI_FAILURE(status)) { 372 if (ACPI_FAILURE(status)) {
384 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
385 "Error installing notify handler\n"));
386 result = -ENODEV; 373 result = -ENODEV;
387 goto end; 374 goto end;
388 } 375 }
@@ -406,7 +393,7 @@ static int acpi_button_add(struct acpi_device *device)
406 kfree(button); 393 kfree(button);
407 } 394 }
408 395
409 return_VALUE(result); 396 return result;
410} 397}
411 398
412static int acpi_button_remove(struct acpi_device *device, int type) 399static int acpi_button_remove(struct acpi_device *device, int type)
@@ -414,10 +401,9 @@ static int acpi_button_remove(struct acpi_device *device, int type)
414 acpi_status status = 0; 401 acpi_status status = 0;
415 struct acpi_button *button = NULL; 402 struct acpi_button *button = NULL;
416 403
417 ACPI_FUNCTION_TRACE("acpi_button_remove");
418 404
419 if (!device || !acpi_driver_data(device)) 405 if (!device || !acpi_driver_data(device))
420 return_VALUE(-EINVAL); 406 return -EINVAL;
421 407
422 button = acpi_driver_data(device); 408 button = acpi_driver_data(device);
423 409
@@ -440,39 +426,33 @@ static int acpi_button_remove(struct acpi_device *device, int type)
440 break; 426 break;
441 } 427 }
442 428
443 if (ACPI_FAILURE(status))
444 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
445 "Error removing notify handler\n"));
446
447 acpi_button_remove_fs(device); 429 acpi_button_remove_fs(device);
448 430
449 kfree(button); 431 kfree(button);
450 432
451 return_VALUE(0); 433 return 0;
452} 434}
453 435
454static int __init acpi_button_init(void) 436static int __init acpi_button_init(void)
455{ 437{
456 int result = 0; 438 int result = 0;
457 439
458 ACPI_FUNCTION_TRACE("acpi_button_init");
459 440
460 acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); 441 acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
461 if (!acpi_button_dir) 442 if (!acpi_button_dir)
462 return_VALUE(-ENODEV); 443 return -ENODEV;
463 acpi_button_dir->owner = THIS_MODULE; 444 acpi_button_dir->owner = THIS_MODULE;
464 result = acpi_bus_register_driver(&acpi_button_driver); 445 result = acpi_bus_register_driver(&acpi_button_driver);
465 if (result < 0) { 446 if (result < 0) {
466 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); 447 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
467 return_VALUE(-ENODEV); 448 return -ENODEV;
468 } 449 }
469 450
470 return_VALUE(0); 451 return 0;
471} 452}
472 453
473static void __exit acpi_button_exit(void) 454static void __exit acpi_button_exit(void)
474{ 455{
475 ACPI_FUNCTION_TRACE("acpi_button_exit");
476 456
477 acpi_bus_unregister_driver(&acpi_button_driver); 457 acpi_bus_unregister_driver(&acpi_button_driver);
478 458
@@ -484,7 +464,7 @@ static void __exit acpi_button_exit(void)
484 remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir); 464 remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
485 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); 465 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
486 466
487 return_VOID; 467 return;
488} 468}
489 469
490module_init(acpi_button_init); 470module_init(acpi_button_init);
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index b69a8cad82b7..7f7e41d40a3b 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -73,17 +73,16 @@ static int is_device_present(acpi_handle handle)
73 acpi_status status; 73 acpi_status status;
74 unsigned long sta; 74 unsigned long sta;
75 75
76 ACPI_FUNCTION_TRACE("is_device_present");
77 76
78 status = acpi_get_handle(handle, "_STA", &temp); 77 status = acpi_get_handle(handle, "_STA", &temp);
79 if (ACPI_FAILURE(status)) 78 if (ACPI_FAILURE(status))
80 return_VALUE(1); /* _STA not found, assmue device present */ 79 return 1; /* _STA not found, assmue device present */
81 80
82 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 81 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
83 if (ACPI_FAILURE(status)) 82 if (ACPI_FAILURE(status))
84 return_VALUE(0); /* Firmware error */ 83 return 0; /* Firmware error */
85 84
86 return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); 85 return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
87} 86}
88 87
89/*******************************************************************/ 88/*******************************************************************/
@@ -91,16 +90,15 @@ static int acpi_container_add(struct acpi_device *device)
91{ 90{
92 struct acpi_container *container; 91 struct acpi_container *container;
93 92
94 ACPI_FUNCTION_TRACE("acpi_container_add");
95 93
96 if (!device) { 94 if (!device) {
97 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n")); 95 printk(KERN_ERR PREFIX "device is NULL\n");
98 return_VALUE(-EINVAL); 96 return -EINVAL;
99 } 97 }
100 98
101 container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL); 99 container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
102 if (!container) 100 if (!container)
103 return_VALUE(-ENOMEM); 101 return -ENOMEM;
104 102
105 memset(container, 0, sizeof(struct acpi_container)); 103 memset(container, 0, sizeof(struct acpi_container));
106 container->handle = device->handle; 104 container->handle = device->handle;
@@ -111,7 +109,7 @@ static int acpi_container_add(struct acpi_device *device)
111 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", 109 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
112 acpi_device_name(device), acpi_device_bid(device))); 110 acpi_device_name(device), acpi_device_bid(device)));
113 111
114 return_VALUE(0); 112 return 0;
115} 113}
116 114
117static int acpi_container_remove(struct acpi_device *device, int type) 115static int acpi_container_remove(struct acpi_device *device, int type)
@@ -130,23 +128,22 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle)
130 struct acpi_device *pdev; 128 struct acpi_device *pdev;
131 int result; 129 int result;
132 130
133 ACPI_FUNCTION_TRACE("container_device_add");
134 131
135 if (acpi_get_parent(handle, &phandle)) { 132 if (acpi_get_parent(handle, &phandle)) {
136 return_VALUE(-ENODEV); 133 return -ENODEV;
137 } 134 }
138 135
139 if (acpi_bus_get_device(phandle, &pdev)) { 136 if (acpi_bus_get_device(phandle, &pdev)) {
140 return_VALUE(-ENODEV); 137 return -ENODEV;
141 } 138 }
142 139
143 if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) { 140 if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
144 return_VALUE(-ENODEV); 141 return -ENODEV;
145 } 142 }
146 143
147 result = acpi_bus_start(*device); 144 result = acpi_bus_start(*device);
148 145
149 return_VALUE(result); 146 return result;
150} 147}
151 148
152static void container_notify_cb(acpi_handle handle, u32 type, void *context) 149static void container_notify_cb(acpi_handle handle, u32 type, void *context)
@@ -156,7 +153,6 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
156 int present; 153 int present;
157 acpi_status status; 154 acpi_status status;
158 155
159 ACPI_FUNCTION_TRACE("container_notify_cb");
160 156
161 present = is_device_present(handle); 157 present = is_device_present(handle);
162 158
@@ -192,7 +188,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
192 default: 188 default:
193 break; 189 break;
194 } 190 }
195 return_VOID; 191 return;
196} 192}
197 193
198static acpi_status 194static acpi_status
@@ -205,11 +201,10 @@ container_walk_namespace_cb(acpi_handle handle,
205 acpi_status status; 201 acpi_status status;
206 int *action = context; 202 int *action = context;
207 203
208 ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
209 204
210 status = acpi_get_object_info(handle, &buffer); 205 status = acpi_get_object_info(handle, &buffer);
211 if (ACPI_FAILURE(status) || !buffer.pointer) { 206 if (ACPI_FAILURE(status) || !buffer.pointer) {
212 return_ACPI_STATUS(AE_OK); 207 return AE_OK;
213 } 208 }
214 209
215 info = buffer.pointer; 210 info = buffer.pointer;
@@ -243,7 +238,7 @@ container_walk_namespace_cb(acpi_handle handle,
243 end: 238 end:
244 acpi_os_free(buffer.pointer); 239 acpi_os_free(buffer.pointer);
245 240
246 return_ACPI_STATUS(AE_OK); 241 return AE_OK;
247} 242}
248 243
249static int __init acpi_container_init(void) 244static int __init acpi_container_init(void)
@@ -269,7 +264,6 @@ static void __exit acpi_container_exit(void)
269{ 264{
270 int action = UNINSTALL_NOTIFY_HANDLER; 265 int action = UNINSTALL_NOTIFY_HANDLER;
271 266
272 ACPI_FUNCTION_TRACE("acpi_container_exit");
273 267
274 acpi_walk_namespace(ACPI_TYPE_DEVICE, 268 acpi_walk_namespace(ACPI_TYPE_DEVICE,
275 ACPI_ROOT_OBJECT, 269 ACPI_ROOT_OBJECT,
@@ -278,7 +272,7 @@ static void __exit acpi_container_exit(void)
278 272
279 acpi_bus_unregister_driver(&acpi_container_driver); 273 acpi_bus_unregister_driver(&acpi_container_driver);
280 274
281 return_VOID; 275 return;
282} 276}
283 277
284module_init(acpi_container_init); 278module_init(acpi_container_init);
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index 263322b7d113..35c6af8a83cd 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -155,13 +155,12 @@ acpi_system_write_debug(struct file *file,
155{ 155{
156 char debug_string[12] = { '\0' }; 156 char debug_string[12] = { '\0' };
157 157
158 ACPI_FUNCTION_TRACE("acpi_system_write_debug");
159 158
160 if (count > sizeof(debug_string) - 1) 159 if (count > sizeof(debug_string) - 1)
161 return_VALUE(-EINVAL); 160 return -EINVAL;
162 161
163 if (copy_from_user(debug_string, buffer, count)) 162 if (copy_from_user(debug_string, buffer, count))
164 return_VALUE(-EFAULT); 163 return -EFAULT;
165 164
166 debug_string[count] = '\0'; 165 debug_string[count] = '\0';
167 166
@@ -173,10 +172,10 @@ acpi_system_write_debug(struct file *file,
173 acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); 172 acpi_dbg_level = simple_strtoul(debug_string, NULL, 0);
174 break; 173 break;
175 default: 174 default:
176 return_VALUE(-EINVAL); 175 return -EINVAL;
177 } 176 }
178 177
179 return_VALUE(count); 178 return count;
180} 179}
181 180
182static int __init acpi_debug_init(void) 181static int __init acpi_debug_init(void)
@@ -185,10 +184,9 @@ static int __init acpi_debug_init(void)
185 int error = 0; 184 int error = 0;
186 char *name; 185 char *name;
187 186
188 ACPI_FUNCTION_TRACE("acpi_debug_init");
189 187
190 if (acpi_disabled) 188 if (acpi_disabled)
191 return_VALUE(0); 189 return 0;
192 190
193 /* 'debug_layer' [R/W] */ 191 /* 'debug_layer' [R/W] */
194 name = ACPI_SYSTEM_FILE_DEBUG_LAYER; 192 name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
@@ -213,15 +211,12 @@ static int __init acpi_debug_init(void)
213 goto Error; 211 goto Error;
214 212
215 Done: 213 Done:
216 return_VALUE(error); 214 return error;
217 215
218 Error: 216 Error:
219 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
220 "Unable to create '%s' proc fs entry\n", name));
221
222 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); 217 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
223 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); 218 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
224 error = -EFAULT; 219 error = -ENODEV;
225 goto Done; 220 goto Done;
226} 221}
227 222
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index bbdf990e9f65..daf51b5b5875 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -125,37 +125,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
125 if (info->table_desc->pointer->revision == 1) { 125 if (info->table_desc->pointer->revision == 1) {
126 node->flags |= ANOBJ_DATA_WIDTH_32; 126 node->flags |= ANOBJ_DATA_WIDTH_32;
127 } 127 }
128#ifdef ACPI_INIT_PARSE_METHODS
129 /*
130 * Note 11/2005: Removed this code to parse all methods during table
131 * load because it causes problems if there are any errors during the
132 * parse. Also, it seems like overkill and we probably don't want to
133 * abort a table load because of an issue with a single method.
134 */
135
136 /*
137 * Print a dot for each method unless we are going to print
138 * the entire pathname
139 */
140 if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
141 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
142 }
143 128
144 /*
145 * Always parse methods to detect errors, we will delete
146 * the parse tree below
147 */
148 status = acpi_ds_parse_method(obj_handle);
149 if (ACPI_FAILURE(status)) {
150 ACPI_ERROR((AE_INFO,
151 "Method %p [%4.4s] - parse failure, %s",
152 obj_handle,
153 acpi_ut_get_node_name(obj_handle),
154 acpi_format_exception(status)));
155
156 /* This parse failed, but we will continue parsing more methods */
157 }
158#endif
159 info->method_count++; 129 info->method_count++;
160 break; 130 break;
161 131
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index bc9aca4e7401..a39a33f4847a 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -52,6 +52,10 @@
52#define _COMPONENT ACPI_DISPATCHER 52#define _COMPONENT ACPI_DISPATCHER
53ACPI_MODULE_NAME("dsmethod") 53ACPI_MODULE_NAME("dsmethod")
54 54
55/* Local prototypes */
56static acpi_status
57acpi_ds_create_method_mutex(union acpi_operand_object *method_desc);
58
55/******************************************************************************* 59/*******************************************************************************
56 * 60 *
57 * FUNCTION: acpi_ds_method_error 61 * FUNCTION: acpi_ds_method_error
@@ -67,6 +71,7 @@ ACPI_MODULE_NAME("dsmethod")
67 * Note: Allows the exception handler to change the status code 71 * Note: Allows the exception handler to change the status code
68 * 72 *
69 ******************************************************************************/ 73 ******************************************************************************/
74
70acpi_status 75acpi_status
71acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) 76acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
72{ 77{
@@ -113,11 +118,51 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
113 118
114/******************************************************************************* 119/*******************************************************************************
115 * 120 *
121 * FUNCTION: acpi_ds_create_method_mutex
122 *
123 * PARAMETERS: obj_desc - The method object
124 *
125 * RETURN: Status
126 *
127 * DESCRIPTION: Create a mutex object for a serialized control method
128 *
129 ******************************************************************************/
130
131static acpi_status
132acpi_ds_create_method_mutex(union acpi_operand_object *method_desc)
133{
134 union acpi_operand_object *mutex_desc;
135 acpi_status status;
136
137 ACPI_FUNCTION_NAME(ds_create_method_mutex);
138
139 /* Create the new mutex object */
140
141 mutex_desc = acpi_ut_create_internal_object(ACPI_TYPE_MUTEX);
142 if (!mutex_desc) {
143 return_ACPI_STATUS(AE_NO_MEMORY);
144 }
145
146 /* Create the actual OS Mutex */
147
148 status = acpi_os_create_mutex(&mutex_desc->mutex.os_mutex);
149 if (ACPI_FAILURE(status)) {
150 return_ACPI_STATUS(status);
151 }
152
153 mutex_desc->mutex.sync_level = method_desc->method.sync_level;
154 method_desc->method.mutex = mutex_desc;
155 return_ACPI_STATUS(AE_OK);
156}
157
158/*******************************************************************************
159 *
116 * FUNCTION: acpi_ds_begin_method_execution 160 * FUNCTION: acpi_ds_begin_method_execution
117 * 161 *
118 * PARAMETERS: method_node - Node of the method 162 * PARAMETERS: method_node - Node of the method
119 * obj_desc - The method object 163 * obj_desc - The method object
120 * calling_method_node - Caller of this method (if non-null) 164 * walk_state - current state, NULL if not yet executing
165 * a method.
121 * 166 *
122 * RETURN: Status 167 * RETURN: Status
123 * 168 *
@@ -128,9 +173,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
128 ******************************************************************************/ 173 ******************************************************************************/
129 174
130acpi_status 175acpi_status
131acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node, 176acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
132 union acpi_operand_object * obj_desc, 177 union acpi_operand_object *obj_desc,
133 struct acpi_namespace_node * calling_method_node) 178 struct acpi_walk_state *walk_state)
134{ 179{
135 acpi_status status = AE_OK; 180 acpi_status status = AE_OK;
136 181
@@ -149,35 +194,80 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
149 } 194 }
150 195
151 /* 196 /*
152 * If there is a concurrency limit on this method, we need to 197 * If this method is serialized, we need to acquire the method mutex.
153 * obtain a unit from the method semaphore.
154 */ 198 */
155 if (obj_desc->method.semaphore) { 199 if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) {
156 /* 200 /*
157 * Allow recursive method calls, up to the reentrancy/concurrency 201 * Create a mutex for the method if it is defined to be Serialized
158 * limit imposed by the SERIALIZED rule and the sync_level method 202 * and a mutex has not already been created. We defer the mutex creation
159 * parameter. 203 * until a method is actually executed, to minimize the object count
160 *
161 * The point of this code is to avoid permanently blocking a
162 * thread that is making recursive method calls.
163 */ 204 */
164 if (method_node == calling_method_node) { 205 if (!obj_desc->method.mutex) {
165 if (obj_desc->method.thread_count >= 206 status = acpi_ds_create_method_mutex(obj_desc);
166 obj_desc->method.concurrency) { 207 if (ACPI_FAILURE(status)) {
167 return_ACPI_STATUS(AE_AML_METHOD_LIMIT); 208 return_ACPI_STATUS(status);
168 } 209 }
169 } 210 }
170 211
171 /* 212 /*
172 * Get a unit from the method semaphore. This releases the 213 * The current_sync_level (per-thread) must be less than or equal to
173 * interpreter if we block (then reacquires it) 214 * the sync level of the method. This mechanism provides some
215 * deadlock prevention
216 *
217 * Top-level method invocation has no walk state at this point
174 */ 218 */
175 status = 219 if (walk_state &&
176 acpi_ex_system_wait_semaphore(obj_desc->method.semaphore, 220 (walk_state->thread->current_sync_level >
177 ACPI_WAIT_FOREVER); 221 obj_desc->method.mutex->mutex.sync_level)) {
178 if (ACPI_FAILURE(status)) { 222 ACPI_ERROR((AE_INFO,
179 return_ACPI_STATUS(status); 223 "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%d)",
224 acpi_ut_get_node_name(method_node),
225 walk_state->thread->current_sync_level));
226
227 return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
180 } 228 }
229
230 /*
231 * Obtain the method mutex if necessary. Do not acquire mutex for a
232 * recursive call.
233 */
234 if (!walk_state ||
235 !obj_desc->method.mutex->mutex.owner_thread ||
236 (walk_state->thread !=
237 obj_desc->method.mutex->mutex.owner_thread)) {
238 /*
239 * Acquire the method mutex. This releases the interpreter if we
240 * block (and reacquires it before it returns)
241 */
242 status =
243 acpi_ex_system_wait_mutex(obj_desc->method.mutex->
244 mutex.os_mutex,
245 ACPI_WAIT_FOREVER);
246 if (ACPI_FAILURE(status)) {
247 return_ACPI_STATUS(status);
248 }
249
250 /* Update the mutex and walk info and save the original sync_level */
251
252 if (walk_state) {
253 obj_desc->method.mutex->mutex.
254 original_sync_level =
255 walk_state->thread->current_sync_level;
256
257 obj_desc->method.mutex->mutex.owner_thread =
258 walk_state->thread;
259 walk_state->thread->current_sync_level =
260 obj_desc->method.sync_level;
261 } else {
262 obj_desc->method.mutex->mutex.
263 original_sync_level =
264 obj_desc->method.mutex->mutex.sync_level;
265 }
266 }
267
268 /* Always increase acquisition depth */
269
270 obj_desc->method.mutex->mutex.acquisition_depth++;
181 } 271 }
182 272
183 /* 273 /*
@@ -200,10 +290,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
200 return_ACPI_STATUS(status); 290 return_ACPI_STATUS(status);
201 291
202 cleanup: 292 cleanup:
203 /* On error, must signal the method semaphore if present */ 293 /* On error, must release the method mutex (if present) */
204 294
205 if (obj_desc->method.semaphore) { 295 if (obj_desc->method.mutex) {
206 (void)acpi_os_signal_semaphore(obj_desc->method.semaphore, 1); 296 acpi_os_release_mutex(obj_desc->method.mutex->mutex.os_mutex);
207 } 297 }
208 return_ACPI_STATUS(status); 298 return_ACPI_STATUS(status);
209} 299}
@@ -253,10 +343,10 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
253 return_ACPI_STATUS(AE_NULL_OBJECT); 343 return_ACPI_STATUS(AE_NULL_OBJECT);
254 } 344 }
255 345
256 /* Init for new method, possibly wait on concurrency semaphore */ 346 /* Init for new method, possibly wait on method mutex */
257 347
258 status = acpi_ds_begin_method_execution(method_node, obj_desc, 348 status = acpi_ds_begin_method_execution(method_node, obj_desc,
259 this_walk_state->method_node); 349 this_walk_state);
260 if (ACPI_FAILURE(status)) { 350 if (ACPI_FAILURE(status)) {
261 return_ACPI_STATUS(status); 351 return_ACPI_STATUS(status);
262 } 352 }
@@ -478,6 +568,8 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
478 * created, delete all locals and arguments, and delete the parse 568 * created, delete all locals and arguments, and delete the parse
479 * tree if requested. 569 * tree if requested.
480 * 570 *
571 * MUTEX: Interpreter is locked
572 *
481 ******************************************************************************/ 573 ******************************************************************************/
482 574
483void 575void
@@ -503,26 +595,21 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
503 } 595 }
504 596
505 /* 597 /*
506 * Lock the parser while we terminate this method. 598 * If method is serialized, release the mutex and restore the
507 * If this is the last thread executing the method, 599 * current sync level for this thread
508 * we have additional cleanup to perform
509 */ 600 */
510 status = acpi_ut_acquire_mutex(ACPI_MTX_CONTROL_METHOD); 601 if (method_desc->method.mutex) {
511 if (ACPI_FAILURE(status)) {
512 return_VOID;
513 }
514 602
515 /* Signal completion of the execution of this method if necessary */ 603 /* Acquisition Depth handles recursive calls */
516 604
517 if (method_desc->method.semaphore) { 605 method_desc->method.mutex->mutex.acquisition_depth--;
518 status = 606 if (!method_desc->method.mutex->mutex.acquisition_depth) {
519 acpi_os_signal_semaphore(method_desc->method.semaphore, 1); 607 walk_state->thread->current_sync_level =
520 if (ACPI_FAILURE(status)) { 608 method_desc->method.mutex->mutex.
521 609 original_sync_level;
522 /* Ignore error and continue */
523 610
524 ACPI_EXCEPTION((AE_INFO, status, 611 acpi_os_release_mutex(method_desc->method.mutex->mutex.
525 "Could not signal method semaphore")); 612 os_mutex);
526 } 613 }
527 } 614 }
528 615
@@ -537,7 +624,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
537 624
538 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 625 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
539 if (ACPI_FAILURE(status)) { 626 if (ACPI_FAILURE(status)) {
540 goto exit; 627 return_VOID;
541 } 628 }
542 629
543 /* 630 /*
@@ -580,18 +667,16 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
580 /* 667 /*
581 * Support to dynamically change a method from not_serialized to 668 * Support to dynamically change a method from not_serialized to
582 * Serialized if it appears that the method is incorrectly written and 669 * Serialized if it appears that the method is incorrectly written and
583 * does not support multiple thread execution. The best example of this 670 * does not support multiple thread execution. The best example of this
584 * is if such a method creates namespace objects and blocks. A second 671 * is if such a method creates namespace objects and blocks. A second
585 * thread will fail with an AE_ALREADY_EXISTS exception 672 * thread will fail with an AE_ALREADY_EXISTS exception
586 * 673 *
587 * This code is here because we must wait until the last thread exits 674 * This code is here because we must wait until the last thread exits
588 * before creating the synchronization semaphore. 675 * before creating the synchronization semaphore.
589 */ 676 */
590 if ((method_desc->method.concurrency == 1) && 677 if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED)
591 (!method_desc->method.semaphore)) { 678 && (!method_desc->method.mutex)) {
592 status = acpi_os_create_semaphore(1, 1, 679 status = acpi_ds_create_method_mutex(method_desc);
593 &method_desc->method.
594 semaphore);
595 } 680 }
596 681
597 /* No more threads, we can free the owner_id */ 682 /* No more threads, we can free the owner_id */
@@ -599,144 +684,5 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
599 acpi_ut_release_owner_id(&method_desc->method.owner_id); 684 acpi_ut_release_owner_id(&method_desc->method.owner_id);
600 } 685 }
601 686
602 exit:
603 (void)acpi_ut_release_mutex(ACPI_MTX_CONTROL_METHOD);
604 return_VOID; 687 return_VOID;
605} 688}
606
607#ifdef ACPI_INIT_PARSE_METHODS
608 /*
609 * Note 11/2005: Removed this code to parse all methods during table
610 * load because it causes problems if there are any errors during the
611 * parse. Also, it seems like overkill and we probably don't want to
612 * abort a table load because of an issue with a single method.
613 */
614
615/*******************************************************************************
616 *
617 * FUNCTION: acpi_ds_parse_method
618 *
619 * PARAMETERS: Node - Method node
620 *
621 * RETURN: Status
622 *
623 * DESCRIPTION: Parse the AML that is associated with the method.
624 *
625 * MUTEX: Assumes parser is locked
626 *
627 ******************************************************************************/
628
629acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node)
630{
631 acpi_status status;
632 union acpi_operand_object *obj_desc;
633 union acpi_parse_object *op;
634 struct acpi_walk_state *walk_state;
635
636 ACPI_FUNCTION_TRACE_PTR(ds_parse_method, node);
637
638 /* Parameter Validation */
639
640 if (!node) {
641 return_ACPI_STATUS(AE_NULL_ENTRY);
642 }
643
644 ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
645 "**** Parsing [%4.4s] **** NamedObj=%p\n",
646 acpi_ut_get_node_name(node), node));
647
648 /* Extract the method object from the method Node */
649
650 obj_desc = acpi_ns_get_attached_object(node);
651 if (!obj_desc) {
652 return_ACPI_STATUS(AE_NULL_OBJECT);
653 }
654
655 /* Create a mutex for the method if there is a concurrency limit */
656
657 if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) &&
658 (!obj_desc->method.semaphore)) {
659 status = acpi_os_create_semaphore(obj_desc->method.concurrency,
660 obj_desc->method.concurrency,
661 &obj_desc->method.semaphore);
662 if (ACPI_FAILURE(status)) {
663 return_ACPI_STATUS(status);
664 }
665 }
666
667 /*
668 * Allocate a new parser op to be the root of the parsed
669 * method tree
670 */
671 op = acpi_ps_alloc_op(AML_METHOD_OP);
672 if (!op) {
673 return_ACPI_STATUS(AE_NO_MEMORY);
674 }
675
676 /* Init new op with the method name and pointer back to the Node */
677
678 acpi_ps_set_name(op, node->name.integer);
679 op->common.node = node;
680
681 /*
682 * Get a new owner_id for objects created by this method. Namespace
683 * objects (such as Operation Regions) can be created during the
684 * first pass parse.
685 */
686 status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
687 if (ACPI_FAILURE(status)) {
688 goto cleanup;
689 }
690
691 /* Create and initialize a new walk state */
692
693 walk_state =
694 acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, NULL,
695 NULL);
696 if (!walk_state) {
697 status = AE_NO_MEMORY;
698 goto cleanup2;
699 }
700
701 status = acpi_ds_init_aml_walk(walk_state, op, node,
702 obj_desc->method.aml_start,
703 obj_desc->method.aml_length, NULL, 1);
704 if (ACPI_FAILURE(status)) {
705 acpi_ds_delete_walk_state(walk_state);
706 goto cleanup2;
707 }
708
709 /*
710 * Parse the method, first pass
711 *
712 * The first pass load is where newly declared named objects are added into
713 * the namespace. Actual evaluation of the named objects (what would be
714 * called a "second pass") happens during the actual execution of the
715 * method so that operands to the named objects can take on dynamic
716 * run-time values.
717 */
718 status = acpi_ps_parse_aml(walk_state);
719 if (ACPI_FAILURE(status)) {
720 goto cleanup2;
721 }
722
723 ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
724 "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
725 acpi_ut_get_node_name(node), node, op));
726
727 /*
728 * Delete the parse tree. We simply re-parse the method for every
729 * execution since there isn't much overhead (compared to keeping lots
730 * of parse trees around)
731 */
732 acpi_ns_delete_namespace_subtree(node);
733 acpi_ns_delete_namespace_by_owner(obj_desc->method.owner_id);
734
735 cleanup2:
736 acpi_ut_release_owner_id(&obj_desc->method.owner_id);
737
738 cleanup:
739 acpi_ps_delete_parse_tree(op);
740 return_ACPI_STATUS(status);
741}
742#endif
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 3acbd9145d72..b1ded62d0df1 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -472,7 +472,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
472 acpi_ds_result_push(walk_state->result_obj, 472 acpi_ds_result_push(walk_state->result_obj,
473 walk_state); 473 walk_state);
474 } 474 }
475
476 break; 475 break;
477 476
478 default: 477 default:
@@ -510,6 +509,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
510 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 509 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
511 "Method Reference in a Package, Op=%p\n", 510 "Method Reference in a Package, Op=%p\n",
512 op)); 511 op));
512
513 op->common.node = 513 op->common.node =
514 (struct acpi_namespace_node *)op->asl.value. 514 (struct acpi_namespace_node *)op->asl.value.
515 arg->asl.node->object; 515 arg->asl.node->object;
@@ -670,7 +670,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
670 670
671 status = acpi_ds_result_stack_pop(walk_state); 671 status = acpi_ds_result_stack_pop(walk_state);
672 } 672 }
673
674 break; 673 break;
675 674
676 case AML_TYPE_UNDEFINED: 675 case AML_TYPE_UNDEFINED:
@@ -708,7 +707,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
708 * Check if we just completed the evaluation of a 707 * Check if we just completed the evaluation of a
709 * conditional predicate 708 * conditional predicate
710 */ 709 */
711
712 if ((ACPI_SUCCESS(status)) && 710 if ((ACPI_SUCCESS(status)) &&
713 (walk_state->control_state) && 711 (walk_state->control_state) &&
714 (walk_state->control_state->common.state == 712 (walk_state->control_state->common.state ==
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index 35074399c617..e3ca7f6539c1 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -175,7 +175,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
175 if (status == AE_NOT_FOUND) { 175 if (status == AE_NOT_FOUND) {
176 /* 176 /*
177 * Table disassembly: 177 * Table disassembly:
178 * Target of Scope() not found. Generate an External for it, and 178 * Target of Scope() not found. Generate an External for it, and
179 * insert the name into the namespace. 179 * insert the name into the namespace.
180 */ 180 */
181 acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0); 181 acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0);
@@ -210,16 +210,15 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
210 case ACPI_TYPE_BUFFER: 210 case ACPI_TYPE_BUFFER:
211 211
212 /* 212 /*
213 * These types we will allow, but we will change the type. This 213 * These types we will allow, but we will change the type. This
214 * enables some existing code of the form: 214 * enables some existing code of the form:
215 * 215 *
216 * Name (DEB, 0) 216 * Name (DEB, 0)
217 * Scope (DEB) { ... } 217 * Scope (DEB) { ... }
218 * 218 *
219 * Note: silently change the type here. On the second pass, we will report 219 * Note: silently change the type here. On the second pass, we will report
220 * a warning 220 * a warning
221 */ 221 */
222
223 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 222 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
224 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", 223 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
225 path, 224 path,
@@ -242,7 +241,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
242 break; 241 break;
243 242
244 default: 243 default:
245
246 /* 244 /*
247 * For all other named opcodes, we will enter the name into 245 * For all other named opcodes, we will enter the name into
248 * the namespace. 246 * the namespace.
@@ -259,7 +257,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
259 * buffer_field, or Package), the name of the object is already 257 * buffer_field, or Package), the name of the object is already
260 * in the namespace. 258 * in the namespace.
261 */ 259 */
262
263 if (walk_state->deferred_node) { 260 if (walk_state->deferred_node) {
264 261
265 /* This name is already in the namespace, get the node */ 262 /* This name is already in the namespace, get the node */
@@ -293,8 +290,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
293 } 290 }
294 291
295 /* 292 /*
296 * Enter the named type into the internal namespace. We enter the name 293 * Enter the named type into the internal namespace. We enter the name
297 * as we go downward in the parse tree. Any necessary subobjects that 294 * as we go downward in the parse tree. Any necessary subobjects that
298 * involve arguments to the opcode must be created as we go back up the 295 * involve arguments to the opcode must be created as we go back up the
299 * parse tree later. 296 * parse tree later.
300 */ 297 */
@@ -327,12 +324,12 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
327 (status); 324 (status);
328 } 325 }
329 } 326 }
327
330 status = AE_OK; 328 status = AE_OK;
331 } 329 }
332 } 330 }
333 331
334 if (ACPI_FAILURE(status)) { 332 if (ACPI_FAILURE(status)) {
335
336 ACPI_ERROR_NAMESPACE(path, status); 333 ACPI_ERROR_NAMESPACE(path, status);
337 return_ACPI_STATUS(status); 334 return_ACPI_STATUS(status);
338 } 335 }
@@ -434,9 +431,13 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
434 status = 431 status =
435 acpi_ex_create_region(op->named.data, 432 acpi_ex_create_region(op->named.data,
436 op->named.length, 433 op->named.length,
437 (acpi_adr_space_type) 434 (acpi_adr_space_type) ((op->
438 ((op->common.value.arg)-> 435 common.
439 common.value.integer), 436 value.
437 arg)->
438 common.
439 value.
440 integer),
440 walk_state); 441 walk_state);
441 if (ACPI_FAILURE(status)) { 442 if (ACPI_FAILURE(status)) {
442 return_ACPI_STATUS(status); 443 return_ACPI_STATUS(status);
@@ -474,7 +475,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
474 * method_op pkg_length name_string method_flags term_list 475 * method_op pkg_length name_string method_flags term_list
475 * 476 *
476 * Note: We must create the method node/object pair as soon as we 477 * Note: We must create the method node/object pair as soon as we
477 * see the method declaration. This allows later pass1 parsing 478 * see the method declaration. This allows later pass1 parsing
478 * of invocations of the method (need to know the number of 479 * of invocations of the method (need to know the number of
479 * arguments.) 480 * arguments.)
480 */ 481 */
@@ -499,6 +500,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
499 length, 500 length,
500 walk_state); 501 walk_state);
501 } 502 }
503
502 walk_state->operands[0] = NULL; 504 walk_state->operands[0] = NULL;
503 walk_state->num_operands = 0; 505 walk_state->num_operands = 0;
504 506
@@ -570,7 +572,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
570#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE 572#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
571 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || 573 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
572 (walk_state->op_info->class == AML_CLASS_CONTROL)) { 574 (walk_state->op_info->class == AML_CLASS_CONTROL)) {
573
574 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 575 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
575 "Begin/EXEC: %s (fl %8.8X)\n", 576 "Begin/EXEC: %s (fl %8.8X)\n",
576 walk_state->op_info->name, 577 walk_state->op_info->name,
@@ -602,7 +603,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
602 } else { 603 } else {
603 /* Get name from the op */ 604 /* Get name from the op */
604 605
605 buffer_ptr = (char *)&op->named.name; 606 buffer_ptr = ACPI_CAST_PTR(char, &op->named.name);
606 } 607 }
607 } else { 608 } else {
608 /* Get the namestring from the raw AML */ 609 /* Get the namestring from the raw AML */
@@ -629,7 +630,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
629 break; 630 break;
630 631
631 case AML_INT_NAMEPATH_OP: 632 case AML_INT_NAMEPATH_OP:
632
633 /* 633 /*
634 * The name_path is an object reference to an existing object. 634 * The name_path is an object reference to an existing object.
635 * Don't enter the name into the namespace, but look it up 635 * Don't enter the name into the namespace, but look it up
@@ -642,7 +642,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
642 break; 642 break;
643 643
644 case AML_SCOPE_OP: 644 case AML_SCOPE_OP:
645
646 /* 645 /*
647 * The Path is an object reference to an existing object. 646 * The Path is an object reference to an existing object.
648 * Don't enter the name into the namespace, but look it up 647 * Don't enter the name into the namespace, but look it up
@@ -664,6 +663,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
664#endif 663#endif
665 return_ACPI_STATUS(status); 664 return_ACPI_STATUS(status);
666 } 665 }
666
667 /* 667 /*
668 * We must check to make sure that the target is 668 * We must check to make sure that the target is
669 * one of the opcodes that actually opens a scope 669 * one of the opcodes that actually opens a scope
@@ -683,13 +683,12 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
683 case ACPI_TYPE_BUFFER: 683 case ACPI_TYPE_BUFFER:
684 684
685 /* 685 /*
686 * These types we will allow, but we will change the type. This 686 * These types we will allow, but we will change the type. This
687 * enables some existing code of the form: 687 * enables some existing code of the form:
688 * 688 *
689 * Name (DEB, 0) 689 * Name (DEB, 0)
690 * Scope (DEB) { ... } 690 * Scope (DEB) { ... }
691 */ 691 */
692
693 ACPI_WARNING((AE_INFO, 692 ACPI_WARNING((AE_INFO,
694 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", 693 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)",
695 buffer_ptr, 694 buffer_ptr,
@@ -729,14 +728,14 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
729 if (ACPI_FAILURE(status)) { 728 if (ACPI_FAILURE(status)) {
730 return_ACPI_STATUS(status); 729 return_ACPI_STATUS(status);
731 } 730 }
732
733 } 731 }
732
734 return_ACPI_STATUS(AE_OK); 733 return_ACPI_STATUS(AE_OK);
735 } 734 }
736 735
737 /* 736 /*
738 * Enter the named type into the internal namespace. We enter the name 737 * Enter the named type into the internal namespace. We enter the name
739 * as we go downward in the parse tree. Any necessary subobjects that 738 * as we go downward in the parse tree. Any necessary subobjects that
740 * involve arguments to the opcode must be created as we go back up the 739 * involve arguments to the opcode must be created as we go back up the
741 * parse tree later. 740 * parse tree later.
742 * 741 *
@@ -787,7 +786,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
787 * can get it again quickly when this scope is closed 786 * can get it again quickly when this scope is closed
788 */ 787 */
789 op->common.node = node; 788 op->common.node = node;
790
791 return_ACPI_STATUS(status); 789 return_ACPI_STATUS(status);
792} 790}
793 791
@@ -922,7 +920,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
922#ifndef ACPI_NO_METHOD_EXECUTION 920#ifndef ACPI_NO_METHOD_EXECUTION
923 921
924 case AML_TYPE_CREATE_FIELD: 922 case AML_TYPE_CREATE_FIELD:
925
926 /* 923 /*
927 * Create the field object, but the field buffer and index must 924 * Create the field object, but the field buffer and index must
928 * be evaluated later during the execution phase 925 * be evaluated later during the execution phase
@@ -931,7 +928,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
931 break; 928 break;
932 929
933 case AML_TYPE_NAMED_FIELD: 930 case AML_TYPE_NAMED_FIELD:
934
935 /* 931 /*
936 * If we are executing a method, initialize the field 932 * If we are executing a method, initialize the field
937 */ 933 */
@@ -1051,6 +1047,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1051 * argument is the space_id. (We must save the address of the 1047 * argument is the space_id. (We must save the address of the
1052 * AML of the address and length operands) 1048 * AML of the address and length operands)
1053 */ 1049 */
1050
1054 /* 1051 /*
1055 * If we have a valid region, initialize it 1052 * If we have a valid region, initialize it
1056 * Namespace is NOT locked at this point. 1053 * Namespace is NOT locked at this point.
@@ -1080,7 +1077,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1080 * method_op pkg_length name_string method_flags term_list 1077 * method_op pkg_length name_string method_flags term_list
1081 * 1078 *
1082 * Note: We must create the method node/object pair as soon as we 1079 * Note: We must create the method node/object pair as soon as we
1083 * see the method declaration. This allows later pass1 parsing 1080 * see the method declaration. This allows later pass1 parsing
1084 * of invocations of the method (need to know the number of 1081 * of invocations of the method (need to know the number of
1085 * arguments.) 1082 * arguments.)
1086 */ 1083 */
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
new file mode 100644
index 000000000000..510a94524298
--- /dev/null
+++ b/drivers/acpi/dock.c
@@ -0,0 +1,739 @@
1/*
2 * dock.c - ACPI dock station driver
3 *
4 * Copyright (C) 2006 Kristen Carlson Accardi <kristen.c.accardi@intel.com>
5 *
6 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */
24
25#include <linux/kernel.h>
26#include <linux/module.h>
27#include <linux/init.h>
28#include <linux/types.h>
29#include <linux/notifier.h>
30#include <acpi/acpi_bus.h>
31#include <acpi/acpi_drivers.h>
32
33#define ACPI_DOCK_DRIVER_NAME "ACPI Dock Station Driver"
34
35ACPI_MODULE_NAME("dock")
36MODULE_AUTHOR("Kristen Carlson Accardi");
37MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_NAME);
38MODULE_LICENSE("GPL");
39
40static struct atomic_notifier_head dock_notifier_list;
41
42struct dock_station {
43 acpi_handle handle;
44 unsigned long last_dock_time;
45 u32 flags;
46 spinlock_t dd_lock;
47 spinlock_t hp_lock;
48 struct list_head dependent_devices;
49 struct list_head hotplug_devices;
50};
51
52struct dock_dependent_device {
53 struct list_head list;
54 struct list_head hotplug_list;
55 acpi_handle handle;
56 acpi_notify_handler handler;
57 void *context;
58};
59
60#define DOCK_DOCKING 0x00000001
61#define DOCK_EVENT KOBJ_DOCK
62#define UNDOCK_EVENT KOBJ_UNDOCK
63
64static struct dock_station *dock_station;
65
66/*****************************************************************************
67 * Dock Dependent device functions *
68 *****************************************************************************/
69/**
70 * alloc_dock_dependent_device - allocate and init a dependent device
71 * @handle: the acpi_handle of the dependent device
72 *
73 * Allocate memory for a dependent device structure for a device referenced
74 * by the acpi handle
75 */
76static struct dock_dependent_device *
77alloc_dock_dependent_device(acpi_handle handle)
78{
79 struct dock_dependent_device *dd;
80
81 dd = kzalloc(sizeof(*dd), GFP_KERNEL);
82 if (dd) {
83 dd->handle = handle;
84 INIT_LIST_HEAD(&dd->list);
85 INIT_LIST_HEAD(&dd->hotplug_list);
86 }
87 return dd;
88}
89
90/**
91 * add_dock_dependent_device - associate a device with the dock station
92 * @ds: The dock station
93 * @dd: The dependent device
94 *
95 * Add the dependent device to the dock's dependent device list.
96 */
97static void
98add_dock_dependent_device(struct dock_station *ds,
99 struct dock_dependent_device *dd)
100{
101 spin_lock(&ds->dd_lock);
102 list_add_tail(&dd->list, &ds->dependent_devices);
103 spin_unlock(&ds->dd_lock);
104}
105
106/**
107 * dock_add_hotplug_device - associate a hotplug handler with the dock station
108 * @ds: The dock station
109 * @dd: The dependent device struct
110 *
111 * Add the dependent device to the dock's hotplug device list
112 */
113static void
114dock_add_hotplug_device(struct dock_station *ds,
115 struct dock_dependent_device *dd)
116{
117 spin_lock(&ds->hp_lock);
118 list_add_tail(&dd->hotplug_list, &ds->hotplug_devices);
119 spin_unlock(&ds->hp_lock);
120}
121
122/**
123 * dock_del_hotplug_device - remove a hotplug handler from the dock station
124 * @ds: The dock station
125 * @dd: the dependent device struct
126 *
127 * Delete the dependent device from the dock's hotplug device list
128 */
129static void
130dock_del_hotplug_device(struct dock_station *ds,
131 struct dock_dependent_device *dd)
132{
133 spin_lock(&ds->hp_lock);
134 list_del(&dd->hotplug_list);
135 spin_unlock(&ds->hp_lock);
136}
137
138/**
139 * find_dock_dependent_device - get a device dependent on this dock
140 * @ds: the dock station
141 * @handle: the acpi_handle of the device we want
142 *
143 * iterate over the dependent device list for this dock. If the
144 * dependent device matches the handle, return.
145 */
146static struct dock_dependent_device *
147find_dock_dependent_device(struct dock_station *ds, acpi_handle handle)
148{
149 struct dock_dependent_device *dd;
150
151 spin_lock(&ds->dd_lock);
152 list_for_each_entry(dd, &ds->dependent_devices, list) {
153 if (handle == dd->handle) {
154 spin_unlock(&ds->dd_lock);
155 return dd;
156 }
157 }
158 spin_unlock(&ds->dd_lock);
159 return NULL;
160}
161
162/*****************************************************************************
163 * Dock functions *
164 *****************************************************************************/
165/**
166 * is_dock - see if a device is a dock station
167 * @handle: acpi handle of the device
168 *
169 * If an acpi object has a _DCK method, then it is by definition a dock
170 * station, so return true.
171 */
172static int is_dock(acpi_handle handle)
173{
174 acpi_status status;
175 acpi_handle tmp;
176
177 status = acpi_get_handle(handle, "_DCK", &tmp);
178 if (ACPI_FAILURE(status))
179 return 0;
180 return 1;
181}
182
183/**
184 * is_dock_device - see if a device is on a dock station
185 * @handle: acpi handle of the device
186 *
187 * If this device is either the dock station itself,
188 * or is a device dependent on the dock station, then it
189 * is a dock device
190 */
191int is_dock_device(acpi_handle handle)
192{
193 if (!dock_station)
194 return 0;
195
196 if (is_dock(handle) || find_dock_dependent_device(dock_station, handle))
197 return 1;
198
199 return 0;
200}
201
202EXPORT_SYMBOL_GPL(is_dock_device);
203
204/**
205 * dock_present - see if the dock station is present.
206 * @ds: the dock station
207 *
208 * execute the _STA method. note that present does not
209 * imply that we are docked.
210 */
211static int dock_present(struct dock_station *ds)
212{
213 unsigned long sta;
214 acpi_status status;
215
216 if (ds) {
217 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
218 if (ACPI_SUCCESS(status) && sta)
219 return 1;
220 }
221 return 0;
222}
223
224
225
226/**
227 * dock_create_acpi_device - add new devices to acpi
228 * @handle - handle of the device to add
229 *
230 * This function will create a new acpi_device for the given
231 * handle if one does not exist already. This should cause
232 * acpi to scan for drivers for the given devices, and call
233 * matching driver's add routine.
234 *
235 * Returns a pointer to the acpi_device corresponding to the handle.
236 */
237static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
238{
239 struct acpi_device *device = NULL;
240 struct acpi_device *parent_device;
241 acpi_handle parent;
242 int ret;
243
244 if (acpi_bus_get_device(handle, &device)) {
245 /*
246 * no device created for this object,
247 * so we should create one.
248 */
249 acpi_get_parent(handle, &parent);
250 if (acpi_bus_get_device(parent, &parent_device))
251 parent_device = NULL;
252
253 ret = acpi_bus_add(&device, parent_device, handle,
254 ACPI_BUS_TYPE_DEVICE);
255 if (ret) {
256 pr_debug("error adding bus, %x\n",
257 -ret);
258 return NULL;
259 }
260 }
261 return device;
262}
263
264/**
265 * dock_remove_acpi_device - remove the acpi_device struct from acpi
266 * @handle - the handle of the device to remove
267 *
268 * Tell acpi to remove the acpi_device. This should cause any loaded
269 * driver to have it's remove routine called.
270 */
271static void dock_remove_acpi_device(acpi_handle handle)
272{
273 struct acpi_device *device;
274 int ret;
275
276 if (!acpi_bus_get_device(handle, &device)) {
277 ret = acpi_bus_trim(device, 1);
278 if (ret)
279 pr_debug("error removing bus, %x\n", -ret);
280 }
281}
282
283
284/**
285 * hotplug_dock_devices - insert or remove devices on the dock station
286 * @ds: the dock station
287 * @event: either bus check or eject request
288 *
289 * Some devices on the dock station need to have drivers called
290 * to perform hotplug operations after a dock event has occurred.
291 * Traverse the list of dock devices that have registered a
292 * hotplug handler, and call the handler.
293 */
294static void hotplug_dock_devices(struct dock_station *ds, u32 event)
295{
296 struct dock_dependent_device *dd;
297
298 spin_lock(&ds->hp_lock);
299
300 /*
301 * First call driver specific hotplug functions
302 */
303 list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list) {
304 if (dd->handler)
305 dd->handler(dd->handle, event, dd->context);
306 }
307
308 /*
309 * Now make sure that an acpi_device is created for each
310 * dependent device, or removed if this is an eject request.
311 * This will cause acpi_drivers to be stopped/started if they
312 * exist
313 */
314 list_for_each_entry(dd, &ds->dependent_devices, list) {
315 if (event == ACPI_NOTIFY_EJECT_REQUEST)
316 dock_remove_acpi_device(dd->handle);
317 else
318 dock_create_acpi_device(dd->handle);
319 }
320 spin_unlock(&ds->hp_lock);
321}
322
323static void dock_event(struct dock_station *ds, u32 event, int num)
324{
325 struct acpi_device *device;
326
327 device = dock_create_acpi_device(ds->handle);
328 if (device)
329 kobject_uevent(&device->kobj, num);
330}
331
332/**
333 * eject_dock - respond to a dock eject request
334 * @ds: the dock station
335 *
336 * This is called after _DCK is called, to execute the dock station's
337 * _EJ0 method.
338 */
339static void eject_dock(struct dock_station *ds)
340{
341 struct acpi_object_list arg_list;
342 union acpi_object arg;
343 acpi_status status;
344 acpi_handle tmp;
345
346 /* all dock devices should have _EJ0, but check anyway */
347 status = acpi_get_handle(ds->handle, "_EJ0", &tmp);
348 if (ACPI_FAILURE(status)) {
349 pr_debug("No _EJ0 support for dock device\n");
350 return;
351 }
352
353 arg_list.count = 1;
354 arg_list.pointer = &arg;
355 arg.type = ACPI_TYPE_INTEGER;
356 arg.integer.value = 1;
357
358 if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0",
359 &arg_list, NULL)))
360 pr_debug("Failed to evaluate _EJ0!\n");
361}
362
363/**
364 * handle_dock - handle a dock event
365 * @ds: the dock station
366 * @dock: to dock, or undock - that is the question
367 *
368 * Execute the _DCK method in response to an acpi event
369 */
370static void handle_dock(struct dock_station *ds, int dock)
371{
372 acpi_status status;
373 struct acpi_object_list arg_list;
374 union acpi_object arg;
375 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
376 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
377 union acpi_object *obj;
378
379 acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer);
380 obj = name_buffer.pointer;
381
382 printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking");
383
384 /* _DCK method has one argument */
385 arg_list.count = 1;
386 arg_list.pointer = &arg;
387 arg.type = ACPI_TYPE_INTEGER;
388 arg.integer.value = dock;
389 status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
390 if (ACPI_FAILURE(status))
391 pr_debug("%s: failed to execute _DCK\n", obj->string.pointer);
392 kfree(buffer.pointer);
393 kfree(name_buffer.pointer);
394}
395
396static inline void dock(struct dock_station *ds)
397{
398 handle_dock(ds, 1);
399}
400
401static inline void undock(struct dock_station *ds)
402{
403 handle_dock(ds, 0);
404}
405
406static inline void begin_dock(struct dock_station *ds)
407{
408 ds->flags |= DOCK_DOCKING;
409}
410
411static inline void complete_dock(struct dock_station *ds)
412{
413 ds->flags &= ~(DOCK_DOCKING);
414 ds->last_dock_time = jiffies;
415}
416
417/**
418 * dock_in_progress - see if we are in the middle of handling a dock event
419 * @ds: the dock station
420 *
421 * Sometimes while docking, false dock events can be sent to the driver
422 * because good connections aren't made or some other reason. Ignore these
423 * if we are in the middle of doing something.
424 */
425static int dock_in_progress(struct dock_station *ds)
426{
427 if ((ds->flags & DOCK_DOCKING) ||
428 time_before(jiffies, (ds->last_dock_time + HZ)))
429 return 1;
430 return 0;
431}
432
433/**
434 * register_dock_notifier - add yourself to the dock notifier list
435 * @nb: the callers notifier block
436 *
437 * If a driver wishes to be notified about dock events, they can
438 * use this function to put a notifier block on the dock notifier list.
439 * this notifier call chain will be called after a dock event, but
440 * before hotplugging any new devices.
441 */
442int register_dock_notifier(struct notifier_block *nb)
443{
444 return atomic_notifier_chain_register(&dock_notifier_list, nb);
445}
446
447EXPORT_SYMBOL_GPL(register_dock_notifier);
448
449/**
450 * unregister_dock_notifier - remove yourself from the dock notifier list
451 * @nb: the callers notifier block
452 */
453void unregister_dock_notifier(struct notifier_block *nb)
454{
455 atomic_notifier_chain_unregister(&dock_notifier_list, nb);
456}
457
458EXPORT_SYMBOL_GPL(unregister_dock_notifier);
459
460/**
461 * register_hotplug_dock_device - register a hotplug function
462 * @handle: the handle of the device
463 * @handler: the acpi_notifier_handler to call after docking
464 * @context: device specific data
465 *
466 * If a driver would like to perform a hotplug operation after a dock
467 * event, they can register an acpi_notifiy_handler to be called by
468 * the dock driver after _DCK is executed.
469 */
470int
471register_hotplug_dock_device(acpi_handle handle, acpi_notify_handler handler,
472 void *context)
473{
474 struct dock_dependent_device *dd;
475
476 if (!dock_station)
477 return -ENODEV;
478
479 /*
480 * make sure this handle is for a device dependent on the dock,
481 * this would include the dock station itself
482 */
483 dd = find_dock_dependent_device(dock_station, handle);
484 if (dd) {
485 dd->handler = handler;
486 dd->context = context;
487 dock_add_hotplug_device(dock_station, dd);
488 return 0;
489 }
490
491 return -EINVAL;
492}
493
494EXPORT_SYMBOL_GPL(register_hotplug_dock_device);
495
496/**
497 * unregister_hotplug_dock_device - remove yourself from the hotplug list
498 * @handle: the acpi handle of the device
499 */
500void unregister_hotplug_dock_device(acpi_handle handle)
501{
502 struct dock_dependent_device *dd;
503
504 if (!dock_station)
505 return;
506
507 dd = find_dock_dependent_device(dock_station, handle);
508 if (dd)
509 dock_del_hotplug_device(dock_station, dd);
510}
511
512EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
513
514/**
515 * dock_notify - act upon an acpi dock notification
516 * @handle: the dock station handle
517 * @event: the acpi event
518 * @data: our driver data struct
519 *
520 * If we are notified to dock, then check to see if the dock is
521 * present and then dock. Notify all drivers of the dock event,
522 * and then hotplug and devices that may need hotplugging. For undock
523 * check to make sure the dock device is still present, then undock
524 * and hotremove all the devices that may need removing.
525 */
526static void dock_notify(acpi_handle handle, u32 event, void *data)
527{
528 struct dock_station *ds = (struct dock_station *)data;
529
530 switch (event) {
531 case ACPI_NOTIFY_BUS_CHECK:
532 if (!dock_in_progress(ds) && dock_present(ds)) {
533 begin_dock(ds);
534 dock(ds);
535 if (!dock_present(ds)) {
536 printk(KERN_ERR PREFIX "Unable to dock!\n");
537 break;
538 }
539 atomic_notifier_call_chain(&dock_notifier_list,
540 event, NULL);
541 hotplug_dock_devices(ds, event);
542 complete_dock(ds);
543 dock_event(ds, event, DOCK_EVENT);
544 }
545 break;
546 case ACPI_NOTIFY_DEVICE_CHECK:
547 /*
548 * According to acpi spec 3.0a, if a DEVICE_CHECK notification
549 * is sent and _DCK is present, it is assumed to mean an
550 * undock request. This notify routine will only be called
551 * for objects defining _DCK, so we will fall through to eject
552 * request here. However, we will pass an eject request through
553 * to the driver who wish to hotplug.
554 */
555 case ACPI_NOTIFY_EJECT_REQUEST:
556 if (!dock_in_progress(ds) && dock_present(ds)) {
557 /*
558 * here we need to generate the undock
559 * event prior to actually doing the undock
560 * so that the device struct still exists.
561 */
562 dock_event(ds, event, UNDOCK_EVENT);
563 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
564 undock(ds);
565 eject_dock(ds);
566 if (dock_present(ds))
567 printk(KERN_ERR PREFIX "Unable to undock!\n");
568 }
569 break;
570 default:
571 printk(KERN_ERR PREFIX "Unknown dock event %d\n", event);
572 }
573}
574
575/**
576 * find_dock_devices - find devices on the dock station
577 * @handle: the handle of the device we are examining
578 * @lvl: unused
579 * @context: the dock station private data
580 * @rv: unused
581 *
582 * This function is called by acpi_walk_namespace. It will
583 * check to see if an object has an _EJD method. If it does, then it
584 * will see if it is dependent on the dock station.
585 */
586static acpi_status
587find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv)
588{
589 acpi_status status;
590 acpi_handle tmp;
591 struct dock_station *ds = (struct dock_station *)context;
592 struct dock_dependent_device *dd;
593
594 status = acpi_bus_get_ejd(handle, &tmp);
595 if (ACPI_FAILURE(status))
596 return AE_OK;
597
598 if (tmp == ds->handle) {
599 dd = alloc_dock_dependent_device(handle);
600 if (dd)
601 add_dock_dependent_device(ds, dd);
602 }
603
604 return AE_OK;
605}
606
607/**
608 * dock_add - add a new dock station
609 * @handle: the dock station handle
610 *
611 * allocated and initialize a new dock station device. Find all devices
612 * that are on the dock station, and register for dock event notifications.
613 */
614static int dock_add(acpi_handle handle)
615{
616 int ret;
617 acpi_status status;
618 struct dock_dependent_device *dd;
619
620 /* allocate & initialize the dock_station private data */
621 dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL);
622 if (!dock_station)
623 return -ENOMEM;
624 dock_station->handle = handle;
625 dock_station->last_dock_time = jiffies - HZ;
626 INIT_LIST_HEAD(&dock_station->dependent_devices);
627 INIT_LIST_HEAD(&dock_station->hotplug_devices);
628 spin_lock_init(&dock_station->dd_lock);
629 spin_lock_init(&dock_station->hp_lock);
630
631 /* Find dependent devices */
632 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
633 ACPI_UINT32_MAX, find_dock_devices, dock_station,
634 NULL);
635
636 /* add the dock station as a device dependent on itself */
637 dd = alloc_dock_dependent_device(handle);
638 if (!dd) {
639 kfree(dock_station);
640 return -ENOMEM;
641 }
642 add_dock_dependent_device(dock_station, dd);
643
644 /* register for dock events */
645 status = acpi_install_notify_handler(dock_station->handle,
646 ACPI_SYSTEM_NOTIFY,
647 dock_notify, dock_station);
648
649 if (ACPI_FAILURE(status)) {
650 printk(KERN_ERR PREFIX "Error installing notify handler\n");
651 ret = -ENODEV;
652 goto dock_add_err;
653 }
654
655 printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_NAME);
656
657 return 0;
658
659dock_add_err:
660 kfree(dock_station);
661 kfree(dd);
662 return ret;
663}
664
665/**
666 * dock_remove - free up resources related to the dock station
667 */
668static int dock_remove(void)
669{
670 struct dock_dependent_device *dd, *tmp;
671 acpi_status status;
672
673 if (!dock_station)
674 return 0;
675
676 /* remove dependent devices */
677 list_for_each_entry_safe(dd, tmp, &dock_station->dependent_devices,
678 list)
679 kfree(dd);
680
681 /* remove dock notify handler */
682 status = acpi_remove_notify_handler(dock_station->handle,
683 ACPI_SYSTEM_NOTIFY,
684 dock_notify);
685 if (ACPI_FAILURE(status))
686 printk(KERN_ERR "Error removing notify handler\n");
687
688 /* free dock station memory */
689 kfree(dock_station);
690 return 0;
691}
692
693/**
694 * find_dock - look for a dock station
695 * @handle: acpi handle of a device
696 * @lvl: unused
697 * @context: counter of dock stations found
698 * @rv: unused
699 *
700 * This is called by acpi_walk_namespace to look for dock stations.
701 */
702static acpi_status
703find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
704{
705 int *count = (int *)context;
706 acpi_status status = AE_OK;
707
708 if (is_dock(handle)) {
709 if (dock_add(handle) >= 0) {
710 (*count)++;
711 status = AE_CTRL_TERMINATE;
712 }
713 }
714 return status;
715}
716
717static int __init dock_init(void)
718{
719 int num = 0;
720
721 dock_station = NULL;
722
723 /* look for a dock station */
724 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
725 ACPI_UINT32_MAX, find_dock, &num, NULL);
726
727 if (!num)
728 return -ENODEV;
729
730 return 0;
731}
732
733static void __exit dock_exit(void)
734{
735 dock_remove();
736}
737
738postcore_initcall(dock_init);
739module_exit(dock_exit);
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 18b3ea9dace2..8c5d7df7d343 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -207,16 +207,15 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
207{ 207{
208 int result = 0; 208 int result = 0;
209 209
210 ACPI_FUNCTION_TRACE("acpi_ec_wait");
211 210
212 ec->intr.expect_event = event; 211 ec->intr.expect_event = event;
213 smp_mb(); 212 smp_mb();
214 213
215 switch (event) { 214 switch (event) {
216 case ACPI_EC_EVENT_IBE: 215 case ACPI_EC_EVENT_IBE:
217 if (~acpi_ec_read_status(ec) & event) { 216 if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) {
218 ec->intr.expect_event = 0; 217 ec->intr.expect_event = 0;
219 return_VALUE(0); 218 return 0;
220 } 219 }
221 break; 220 break;
222 default: 221 default:
@@ -238,16 +237,16 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
238 switch (event) { 237 switch (event) {
239 case ACPI_EC_EVENT_OBF: 238 case ACPI_EC_EVENT_OBF:
240 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF) 239 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
241 return_VALUE(0); 240 return 0;
242 break; 241 break;
243 242
244 case ACPI_EC_EVENT_IBE: 243 case ACPI_EC_EVENT_IBE:
245 if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) 244 if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
246 return_VALUE(0); 245 return 0;
247 break; 246 break;
248 } 247 }
249 248
250 return_VALUE(-ETIME); 249 return -ETIME;
251} 250}
252 251
253#ifdef ACPI_FUTURE_USAGE 252#ifdef ACPI_FUTURE_USAGE
@@ -260,7 +259,6 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
260 u32 tmp = 0; 259 u32 tmp = 0;
261 int status = 0; 260 int status = 0;
262 261
263 ACPI_FUNCTION_TRACE("acpi_ec_enter_burst_mode");
264 262
265 status = acpi_ec_read_status(ec); 263 status = acpi_ec_read_status(ec);
266 if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) { 264 if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) {
@@ -272,22 +270,21 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
272 status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); 270 status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
273 acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr); 271 acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
274 if (tmp != 0x90) { /* Burst ACK byte */ 272 if (tmp != 0x90) { /* Burst ACK byte */
275 return_VALUE(-EINVAL); 273 return -EINVAL;
276 } 274 }
277 } 275 }
278 276
279 atomic_set(&ec->intr.leaving_burst, 0); 277 atomic_set(&ec->intr.leaving_burst, 0);
280 return_VALUE(0); 278 return 0;
281 end: 279 end:
282 printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n"); 280 ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
283 return_VALUE(-1); 281 return -1;
284} 282}
285 283
286int acpi_ec_leave_burst_mode(union acpi_ec *ec) 284int acpi_ec_leave_burst_mode(union acpi_ec *ec)
287{ 285{
288 int status = 0; 286 int status = 0;
289 287
290 ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode");
291 288
292 status = acpi_ec_read_status(ec); 289 status = acpi_ec_read_status(ec);
293 if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){ 290 if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
@@ -298,10 +295,10 @@ int acpi_ec_leave_burst_mode(union acpi_ec *ec)
298 acpi_ec_wait(ec, ACPI_EC_FLAG_IBF); 295 acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
299 } 296 }
300 atomic_set(&ec->intr.leaving_burst, 1); 297 atomic_set(&ec->intr.leaving_burst, 1);
301 return_VALUE(0); 298 return 0;
302end: 299end:
303 printk(KERN_WARNING PREFIX "leave burst_mode:error\n"); 300 ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
304 return_VALUE(-1); 301 return -1;
305} 302}
306#endif /* ACPI_FUTURE_USAGE */ 303#endif /* ACPI_FUTURE_USAGE */
307 304
@@ -325,17 +322,16 @@ static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
325 int result = 0; 322 int result = 0;
326 u32 glk = 0; 323 u32 glk = 0;
327 324
328 ACPI_FUNCTION_TRACE("acpi_ec_read");
329 325
330 if (!ec || !data) 326 if (!ec || !data)
331 return_VALUE(-EINVAL); 327 return -EINVAL;
332 328
333 *data = 0; 329 *data = 0;
334 330
335 if (ec->common.global_lock) { 331 if (ec->common.global_lock) {
336 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 332 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
337 if (ACPI_FAILURE(status)) 333 if (ACPI_FAILURE(status))
338 return_VALUE(-ENODEV); 334 return -ENODEV;
339 } 335 }
340 336
341 if (down_interruptible(&ec->poll.sem)) { 337 if (down_interruptible(&ec->poll.sem)) {
@@ -365,7 +361,7 @@ end_nosem:
365 if (ec->common.global_lock) 361 if (ec->common.global_lock)
366 acpi_release_global_lock(glk); 362 acpi_release_global_lock(glk);
367 363
368 return_VALUE(result); 364 return result;
369} 365}
370 366
371static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data) 367static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
@@ -374,15 +370,14 @@ static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
374 acpi_status status = AE_OK; 370 acpi_status status = AE_OK;
375 u32 glk = 0; 371 u32 glk = 0;
376 372
377 ACPI_FUNCTION_TRACE("acpi_ec_write");
378 373
379 if (!ec) 374 if (!ec)
380 return_VALUE(-EINVAL); 375 return -EINVAL;
381 376
382 if (ec->common.global_lock) { 377 if (ec->common.global_lock) {
383 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 378 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
384 if (ACPI_FAILURE(status)) 379 if (ACPI_FAILURE(status))
385 return_VALUE(-ENODEV); 380 return -ENODEV;
386 } 381 }
387 382
388 if (down_interruptible(&ec->poll.sem)) { 383 if (down_interruptible(&ec->poll.sem)) {
@@ -415,7 +410,7 @@ end_nosem:
415 if (ec->common.global_lock) 410 if (ec->common.global_lock)
416 acpi_release_global_lock(glk); 411 acpi_release_global_lock(glk);
417 412
418 return_VALUE(result); 413 return result;
419} 414}
420 415
421static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data) 416static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
@@ -423,17 +418,16 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
423 int status = 0; 418 int status = 0;
424 u32 glk; 419 u32 glk;
425 420
426 ACPI_FUNCTION_TRACE("acpi_ec_read");
427 421
428 if (!ec || !data) 422 if (!ec || !data)
429 return_VALUE(-EINVAL); 423 return -EINVAL;
430 424
431 *data = 0; 425 *data = 0;
432 426
433 if (ec->common.global_lock) { 427 if (ec->common.global_lock) {
434 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 428 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
435 if (ACPI_FAILURE(status)) 429 if (ACPI_FAILURE(status))
436 return_VALUE(-ENODEV); 430 return -ENODEV;
437 } 431 }
438 432
439 WARN_ON(in_interrupt()); 433 WARN_ON(in_interrupt());
@@ -467,7 +461,7 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
467 if (ec->common.global_lock) 461 if (ec->common.global_lock)
468 acpi_release_global_lock(glk); 462 acpi_release_global_lock(glk);
469 463
470 return_VALUE(status); 464 return status;
471} 465}
472 466
473static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data) 467static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
@@ -475,15 +469,14 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
475 int status = 0; 469 int status = 0;
476 u32 glk; 470 u32 glk;
477 471
478 ACPI_FUNCTION_TRACE("acpi_ec_write");
479 472
480 if (!ec) 473 if (!ec)
481 return_VALUE(-EINVAL); 474 return -EINVAL;
482 475
483 if (ec->common.global_lock) { 476 if (ec->common.global_lock) {
484 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 477 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
485 if (ACPI_FAILURE(status)) 478 if (ACPI_FAILURE(status))
486 return_VALUE(-ENODEV); 479 return -ENODEV;
487 } 480 }
488 481
489 WARN_ON(in_interrupt()); 482 WARN_ON(in_interrupt());
@@ -516,7 +509,7 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
516 if (ec->common.global_lock) 509 if (ec->common.global_lock)
517 acpi_release_global_lock(glk); 510 acpi_release_global_lock(glk);
518 511
519 return_VALUE(status); 512 return status;
520} 513}
521 514
522/* 515/*
@@ -574,17 +567,16 @@ static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data)
574 acpi_status status = AE_OK; 567 acpi_status status = AE_OK;
575 u32 glk = 0; 568 u32 glk = 0;
576 569
577 ACPI_FUNCTION_TRACE("acpi_ec_query");
578 570
579 if (!ec || !data) 571 if (!ec || !data)
580 return_VALUE(-EINVAL); 572 return -EINVAL;
581 573
582 *data = 0; 574 *data = 0;
583 575
584 if (ec->common.global_lock) { 576 if (ec->common.global_lock) {
585 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 577 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
586 if (ACPI_FAILURE(status)) 578 if (ACPI_FAILURE(status))
587 return_VALUE(-ENODEV); 579 return -ENODEV;
588 } 580 }
589 581
590 /* 582 /*
@@ -613,23 +605,22 @@ end_nosem:
613 if (ec->common.global_lock) 605 if (ec->common.global_lock)
614 acpi_release_global_lock(glk); 606 acpi_release_global_lock(glk);
615 607
616 return_VALUE(result); 608 return result;
617} 609}
618static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data) 610static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
619{ 611{
620 int status = 0; 612 int status = 0;
621 u32 glk; 613 u32 glk;
622 614
623 ACPI_FUNCTION_TRACE("acpi_ec_query");
624 615
625 if (!ec || !data) 616 if (!ec || !data)
626 return_VALUE(-EINVAL); 617 return -EINVAL;
627 *data = 0; 618 *data = 0;
628 619
629 if (ec->common.global_lock) { 620 if (ec->common.global_lock) {
630 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 621 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
631 if (ACPI_FAILURE(status)) 622 if (ACPI_FAILURE(status))
632 return_VALUE(-ENODEV); 623 return -ENODEV;
633 } 624 }
634 625
635 down(&ec->intr.sem); 626 down(&ec->intr.sem);
@@ -662,7 +653,7 @@ static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
662 if (ec->common.global_lock) 653 if (ec->common.global_lock)
663 acpi_release_global_lock(glk); 654 acpi_release_global_lock(glk);
664 655
665 return_VALUE(status); 656 return status;
666} 657}
667 658
668/* -------------------------------------------------------------------------- 659/* --------------------------------------------------------------------------
@@ -691,13 +682,12 @@ static void acpi_ec_gpe_poll_query(void *ec_cxt)
691 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 682 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
692 }; 683 };
693 684
694 ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
695 685
696 if (!ec_cxt) 686 if (!ec_cxt)
697 goto end; 687 goto end;
698 688
699 if (down_interruptible (&ec->poll.sem)) { 689 if (down_interruptible (&ec->poll.sem)) {
700 return_VOID; 690 return;
701 } 691 }
702 acpi_hw_low_level_read(8, &value, &ec->common.command_addr); 692 acpi_hw_low_level_read(8, &value, &ec->common.command_addr);
703 up(&ec->poll.sem); 693 up(&ec->poll.sem);
@@ -734,7 +724,6 @@ static void acpi_ec_gpe_intr_query(void *ec_cxt)
734 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 724 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
735 }; 725 };
736 726
737 ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
738 727
739 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI) 728 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI)
740 result = acpi_ec_query(ec, &value); 729 result = acpi_ec_query(ec, &value);
@@ -793,12 +782,15 @@ static u32 acpi_ec_gpe_intr_handler(void *data)
793 case ACPI_EC_EVENT_OBF: 782 case ACPI_EC_EVENT_OBF:
794 if (!(value & ACPI_EC_FLAG_OBF)) 783 if (!(value & ACPI_EC_FLAG_OBF))
795 break; 784 break;
785 ec->intr.expect_event = 0;
786 wake_up(&ec->intr.wait);
787 break;
796 case ACPI_EC_EVENT_IBE: 788 case ACPI_EC_EVENT_IBE:
797 if ((value & ACPI_EC_FLAG_IBF)) 789 if ((value & ACPI_EC_FLAG_IBF))
798 break; 790 break;
799 ec->intr.expect_event = 0; 791 ec->intr.expect_event = 0;
800 wake_up(&ec->intr.wait); 792 wake_up(&ec->intr.wait);
801 return ACPI_INTERRUPT_HANDLED; 793 break;
802 default: 794 default:
803 break; 795 break;
804 } 796 }
@@ -846,15 +838,14 @@ acpi_ec_space_handler(u32 function,
846 acpi_integer f_v = 0; 838 acpi_integer f_v = 0;
847 int i = 0; 839 int i = 0;
848 840
849 ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
850 841
851 if ((address > 0xFF) || !value || !handler_context) 842 if ((address > 0xFF) || !value || !handler_context)
852 return_VALUE(AE_BAD_PARAMETER); 843 return AE_BAD_PARAMETER;
853 844
854 if (bit_width != 8 && acpi_strict) { 845 if (bit_width != 8 && acpi_strict) {
855 printk(KERN_WARNING PREFIX 846 printk(KERN_WARNING PREFIX
856 "acpi_ec_space_handler: bit_width should be 8\n"); 847 "acpi_ec_space_handler: bit_width should be 8\n");
857 return_VALUE(AE_BAD_PARAMETER); 848 return AE_BAD_PARAMETER;
858 } 849 }
859 850
860 ec = (union acpi_ec *)handler_context; 851 ec = (union acpi_ec *)handler_context;
@@ -893,16 +884,16 @@ acpi_ec_space_handler(u32 function,
893 out: 884 out:
894 switch (result) { 885 switch (result) {
895 case -EINVAL: 886 case -EINVAL:
896 return_VALUE(AE_BAD_PARAMETER); 887 return AE_BAD_PARAMETER;
897 break; 888 break;
898 case -ENODEV: 889 case -ENODEV:
899 return_VALUE(AE_NOT_FOUND); 890 return AE_NOT_FOUND;
900 break; 891 break;
901 case -ETIME: 892 case -ETIME:
902 return_VALUE(AE_TIME); 893 return AE_TIME;
903 break; 894 break;
904 default: 895 default:
905 return_VALUE(AE_OK); 896 return AE_OK;
906 } 897 }
907} 898}
908 899
@@ -916,7 +907,6 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset)
916{ 907{
917 union acpi_ec *ec = (union acpi_ec *)seq->private; 908 union acpi_ec *ec = (union acpi_ec *)seq->private;
918 909
919 ACPI_FUNCTION_TRACE("acpi_ec_read_info");
920 910
921 if (!ec) 911 if (!ec)
922 goto end; 912 goto end;
@@ -931,7 +921,7 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset)
931 acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); 921 acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
932 922
933 end: 923 end:
934 return_VALUE(0); 924 return 0;
935} 925}
936 926
937static int acpi_ec_info_open_fs(struct inode *inode, struct file *file) 927static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
@@ -951,33 +941,29 @@ static int acpi_ec_add_fs(struct acpi_device *device)
951{ 941{
952 struct proc_dir_entry *entry = NULL; 942 struct proc_dir_entry *entry = NULL;
953 943
954 ACPI_FUNCTION_TRACE("acpi_ec_add_fs");
955 944
956 if (!acpi_device_dir(device)) { 945 if (!acpi_device_dir(device)) {
957 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 946 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
958 acpi_ec_dir); 947 acpi_ec_dir);
959 if (!acpi_device_dir(device)) 948 if (!acpi_device_dir(device))
960 return_VALUE(-ENODEV); 949 return -ENODEV;
961 } 950 }
962 951
963 entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO, 952 entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
964 acpi_device_dir(device)); 953 acpi_device_dir(device));
965 if (!entry) 954 if (!entry)
966 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 955 return -ENODEV;
967 "Unable to create '%s' fs entry\n",
968 ACPI_EC_FILE_INFO));
969 else { 956 else {
970 entry->proc_fops = &acpi_ec_info_ops; 957 entry->proc_fops = &acpi_ec_info_ops;
971 entry->data = acpi_driver_data(device); 958 entry->data = acpi_driver_data(device);
972 entry->owner = THIS_MODULE; 959 entry->owner = THIS_MODULE;
973 } 960 }
974 961
975 return_VALUE(0); 962 return 0;
976} 963}
977 964
978static int acpi_ec_remove_fs(struct acpi_device *device) 965static int acpi_ec_remove_fs(struct acpi_device *device)
979{ 966{
980 ACPI_FUNCTION_TRACE("acpi_ec_remove_fs");
981 967
982 if (acpi_device_dir(device)) { 968 if (acpi_device_dir(device)) {
983 remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device)); 969 remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
@@ -985,7 +971,7 @@ static int acpi_ec_remove_fs(struct acpi_device *device)
985 acpi_device_dir(device) = NULL; 971 acpi_device_dir(device) = NULL;
986 } 972 }
987 973
988 return_VALUE(0); 974 return 0;
989} 975}
990 976
991/* -------------------------------------------------------------------------- 977/* --------------------------------------------------------------------------
@@ -998,14 +984,13 @@ static int acpi_ec_poll_add(struct acpi_device *device)
998 acpi_status status = AE_OK; 984 acpi_status status = AE_OK;
999 union acpi_ec *ec = NULL; 985 union acpi_ec *ec = NULL;
1000 986
1001 ACPI_FUNCTION_TRACE("acpi_ec_add");
1002 987
1003 if (!device) 988 if (!device)
1004 return_VALUE(-EINVAL); 989 return -EINVAL;
1005 990
1006 ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); 991 ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
1007 if (!ec) 992 if (!ec)
1008 return_VALUE(-ENOMEM); 993 return -ENOMEM;
1009 memset(ec, 0, sizeof(union acpi_ec)); 994 memset(ec, 0, sizeof(union acpi_ec));
1010 995
1011 ec->common.handle = device->handle; 996 ec->common.handle = device->handle;
@@ -1038,8 +1023,7 @@ static int acpi_ec_poll_add(struct acpi_device *device)
1038 acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, 1023 acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
1039 &ec->common.gpe_bit); 1024 &ec->common.gpe_bit);
1040 if (ACPI_FAILURE(status)) { 1025 if (ACPI_FAILURE(status)) {
1041 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1026 ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit"));
1042 "Error obtaining GPE bit assignment\n"));
1043 result = -ENODEV; 1027 result = -ENODEV;
1044 goto end; 1028 goto end;
1045 } 1029 }
@@ -1059,7 +1043,7 @@ static int acpi_ec_poll_add(struct acpi_device *device)
1059 if (result) 1043 if (result)
1060 kfree(ec); 1044 kfree(ec);
1061 1045
1062 return_VALUE(result); 1046 return result;
1063} 1047}
1064static int acpi_ec_intr_add(struct acpi_device *device) 1048static int acpi_ec_intr_add(struct acpi_device *device)
1065{ 1049{
@@ -1067,14 +1051,13 @@ static int acpi_ec_intr_add(struct acpi_device *device)
1067 acpi_status status = AE_OK; 1051 acpi_status status = AE_OK;
1068 union acpi_ec *ec = NULL; 1052 union acpi_ec *ec = NULL;
1069 1053
1070 ACPI_FUNCTION_TRACE("acpi_ec_add");
1071 1054
1072 if (!device) 1055 if (!device)
1073 return_VALUE(-EINVAL); 1056 return -EINVAL;
1074 1057
1075 ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); 1058 ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
1076 if (!ec) 1059 if (!ec)
1077 return_VALUE(-ENOMEM); 1060 return -ENOMEM;
1078 memset(ec, 0, sizeof(union acpi_ec)); 1061 memset(ec, 0, sizeof(union acpi_ec));
1079 1062
1080 ec->common.handle = device->handle; 1063 ec->common.handle = device->handle;
@@ -1110,8 +1093,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
1110 acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, 1093 acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
1111 &ec->common.gpe_bit); 1094 &ec->common.gpe_bit);
1112 if (ACPI_FAILURE(status)) { 1095 if (ACPI_FAILURE(status)) {
1113 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1096 printk(KERN_ERR PREFIX "Obtaining GPE bit assignment\n");
1114 "Error obtaining GPE bit assignment\n"));
1115 result = -ENODEV; 1097 result = -ENODEV;
1116 goto end; 1098 goto end;
1117 } 1099 }
@@ -1131,17 +1113,16 @@ static int acpi_ec_intr_add(struct acpi_device *device)
1131 if (result) 1113 if (result)
1132 kfree(ec); 1114 kfree(ec);
1133 1115
1134 return_VALUE(result); 1116 return result;
1135} 1117}
1136 1118
1137static int acpi_ec_remove(struct acpi_device *device, int type) 1119static int acpi_ec_remove(struct acpi_device *device, int type)
1138{ 1120{
1139 union acpi_ec *ec = NULL; 1121 union acpi_ec *ec = NULL;
1140 1122
1141 ACPI_FUNCTION_TRACE("acpi_ec_remove");
1142 1123
1143 if (!device) 1124 if (!device)
1144 return_VALUE(-EINVAL); 1125 return -EINVAL;
1145 1126
1146 ec = acpi_driver_data(device); 1127 ec = acpi_driver_data(device);
1147 1128
@@ -1149,7 +1130,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
1149 1130
1150 kfree(ec); 1131 kfree(ec);
1151 1132
1152 return_VALUE(0); 1133 return 0;
1153} 1134}
1154 1135
1155static acpi_status 1136static acpi_status
@@ -1188,15 +1169,14 @@ static int acpi_ec_start(struct acpi_device *device)
1188 acpi_status status = AE_OK; 1169 acpi_status status = AE_OK;
1189 union acpi_ec *ec = NULL; 1170 union acpi_ec *ec = NULL;
1190 1171
1191 ACPI_FUNCTION_TRACE("acpi_ec_start");
1192 1172
1193 if (!device) 1173 if (!device)
1194 return_VALUE(-EINVAL); 1174 return -EINVAL;
1195 1175
1196 ec = acpi_driver_data(device); 1176 ec = acpi_driver_data(device);
1197 1177
1198 if (!ec) 1178 if (!ec)
1199 return_VALUE(-EINVAL); 1179 return -EINVAL;
1200 1180
1201 /* 1181 /*
1202 * Get I/O port addresses. Convert to GAS format. 1182 * Get I/O port addresses. Convert to GAS format.
@@ -1205,9 +1185,8 @@ static int acpi_ec_start(struct acpi_device *device)
1205 acpi_ec_io_ports, ec); 1185 acpi_ec_io_ports, ec);
1206 if (ACPI_FAILURE(status) 1186 if (ACPI_FAILURE(status)
1207 || ec->common.command_addr.register_bit_width == 0) { 1187 || ec->common.command_addr.register_bit_width == 0) {
1208 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1188 printk(KERN_ERR PREFIX "Error getting I/O port addresses\n");
1209 "Error getting I/O port addresses")); 1189 return -ENODEV;
1210 return_VALUE(-ENODEV);
1211 } 1190 }
1212 1191
1213 ec->common.status_addr = ec->common.command_addr; 1192 ec->common.status_addr = ec->common.command_addr;
@@ -1224,7 +1203,7 @@ static int acpi_ec_start(struct acpi_device *device)
1224 ACPI_GPE_EDGE_TRIGGERED, 1203 ACPI_GPE_EDGE_TRIGGERED,
1225 &acpi_ec_gpe_handler, ec); 1204 &acpi_ec_gpe_handler, ec);
1226 if (ACPI_FAILURE(status)) { 1205 if (ACPI_FAILURE(status)) {
1227 return_VALUE(-ENODEV); 1206 return -ENODEV;
1228 } 1207 }
1229 acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME); 1208 acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME);
1230 acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); 1209 acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
@@ -1236,10 +1215,10 @@ static int acpi_ec_start(struct acpi_device *device)
1236 if (ACPI_FAILURE(status)) { 1215 if (ACPI_FAILURE(status)) {
1237 acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, 1216 acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
1238 &acpi_ec_gpe_handler); 1217 &acpi_ec_gpe_handler);
1239 return_VALUE(-ENODEV); 1218 return -ENODEV;
1240 } 1219 }
1241 1220
1242 return_VALUE(AE_OK); 1221 return AE_OK;
1243} 1222}
1244 1223
1245static int acpi_ec_stop(struct acpi_device *device, int type) 1224static int acpi_ec_stop(struct acpi_device *device, int type)
@@ -1247,10 +1226,9 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
1247 acpi_status status = AE_OK; 1226 acpi_status status = AE_OK;
1248 union acpi_ec *ec = NULL; 1227 union acpi_ec *ec = NULL;
1249 1228
1250 ACPI_FUNCTION_TRACE("acpi_ec_stop");
1251 1229
1252 if (!device) 1230 if (!device)
1253 return_VALUE(-EINVAL); 1231 return -EINVAL;
1254 1232
1255 ec = acpi_driver_data(device); 1233 ec = acpi_driver_data(device);
1256 1234
@@ -1258,15 +1236,15 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
1258 ACPI_ADR_SPACE_EC, 1236 ACPI_ADR_SPACE_EC,
1259 &acpi_ec_space_handler); 1237 &acpi_ec_space_handler);
1260 if (ACPI_FAILURE(status)) 1238 if (ACPI_FAILURE(status))
1261 return_VALUE(-ENODEV); 1239 return -ENODEV;
1262 1240
1263 status = 1241 status =
1264 acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, 1242 acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
1265 &acpi_ec_gpe_handler); 1243 &acpi_ec_gpe_handler);
1266 if (ACPI_FAILURE(status)) 1244 if (ACPI_FAILURE(status))
1267 return_VALUE(-ENODEV); 1245 return -ENODEV;
1268 1246
1269 return_VALUE(0); 1247 return 0;
1270} 1248}
1271 1249
1272static acpi_status __init 1250static acpi_status __init
@@ -1536,23 +1514,22 @@ static int __init acpi_ec_init(void)
1536{ 1514{
1537 int result = 0; 1515 int result = 0;
1538 1516
1539 ACPI_FUNCTION_TRACE("acpi_ec_init");
1540 1517
1541 if (acpi_disabled) 1518 if (acpi_disabled)
1542 return_VALUE(0); 1519 return 0;
1543 1520
1544 acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir); 1521 acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
1545 if (!acpi_ec_dir) 1522 if (!acpi_ec_dir)
1546 return_VALUE(-ENODEV); 1523 return -ENODEV;
1547 1524
1548 /* Now register the driver for the EC */ 1525 /* Now register the driver for the EC */
1549 result = acpi_bus_register_driver(&acpi_ec_driver); 1526 result = acpi_bus_register_driver(&acpi_ec_driver);
1550 if (result < 0) { 1527 if (result < 0) {
1551 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); 1528 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
1552 return_VALUE(-ENODEV); 1529 return -ENODEV;
1553 } 1530 }
1554 1531
1555 return_VALUE(result); 1532 return result;
1556} 1533}
1557 1534
1558subsys_initcall(acpi_ec_init); 1535subsys_initcall(acpi_ec_init);
@@ -1561,13 +1538,12 @@ subsys_initcall(acpi_ec_init);
1561#if 0 1538#if 0
1562static void __exit acpi_ec_exit(void) 1539static void __exit acpi_ec_exit(void)
1563{ 1540{
1564 ACPI_FUNCTION_TRACE("acpi_ec_exit");
1565 1541
1566 acpi_bus_unregister_driver(&acpi_ec_driver); 1542 acpi_bus_unregister_driver(&acpi_ec_driver);
1567 1543
1568 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); 1544 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
1569 1545
1570 return_VOID; 1546 return;
1571} 1547}
1572#endif /* 0 */ 1548#endif /* 0 */
1573 1549
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 2dbb1b0f11d5..a901b23e95e7 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -48,18 +48,17 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
48 static int chars_remaining = 0; 48 static int chars_remaining = 0;
49 static char *ptr; 49 static char *ptr;
50 50
51 ACPI_FUNCTION_TRACE("acpi_system_read_event");
52 51
53 if (!chars_remaining) { 52 if (!chars_remaining) {
54 memset(&event, 0, sizeof(struct acpi_bus_event)); 53 memset(&event, 0, sizeof(struct acpi_bus_event));
55 54
56 if ((file->f_flags & O_NONBLOCK) 55 if ((file->f_flags & O_NONBLOCK)
57 && (list_empty(&acpi_bus_event_list))) 56 && (list_empty(&acpi_bus_event_list)))
58 return_VALUE(-EAGAIN); 57 return -EAGAIN;
59 58
60 result = acpi_bus_receive_event(&event); 59 result = acpi_bus_receive_event(&event);
61 if (result) 60 if (result)
62 return_VALUE(result); 61 return result;
63 62
64 chars_remaining = sprintf(str, "%s %s %08x %08x\n", 63 chars_remaining = sprintf(str, "%s %s %08x %08x\n",
65 event.device_class ? event. 64 event.device_class ? event.
@@ -75,13 +74,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
75 } 74 }
76 75
77 if (copy_to_user(buffer, ptr, count)) 76 if (copy_to_user(buffer, ptr, count))
78 return_VALUE(-EFAULT); 77 return -EFAULT;
79 78
80 *ppos += count; 79 *ppos += count;
81 chars_remaining -= count; 80 chars_remaining -= count;
82 ptr += count; 81 ptr += count;
83 82
84 return_VALUE(count); 83 return count;
85} 84}
86 85
87static int acpi_system_close_event(struct inode *inode, struct file *file) 86static int acpi_system_close_event(struct inode *inode, struct file *file)
@@ -112,22 +111,18 @@ static int __init acpi_event_init(void)
112 struct proc_dir_entry *entry; 111 struct proc_dir_entry *entry;
113 int error = 0; 112 int error = 0;
114 113
115 ACPI_FUNCTION_TRACE("acpi_event_init");
116 114
117 if (acpi_disabled) 115 if (acpi_disabled)
118 return_VALUE(0); 116 return 0;
119 117
120 /* 'event' [R] */ 118 /* 'event' [R] */
121 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); 119 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
122 if (entry) 120 if (entry)
123 entry->proc_fops = &acpi_system_event_ops; 121 entry->proc_fops = &acpi_system_event_ops;
124 else { 122 else {
125 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 123 error = -ENODEV;
126 "Unable to create '%s' proc fs entry\n",
127 "event"));
128 error = -EFAULT;
129 } 124 }
130 return_VALUE(error); 125 return error;
131} 126}
132 127
133subsys_initcall(acpi_event_init); 128subsys_initcall(acpi_event_init);
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index f01d339407f8..c76c0583ca6a 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -382,7 +382,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
382 u32 status_reg; 382 u32 status_reg;
383 u32 enable_reg; 383 u32 enable_reg;
384 acpi_cpu_flags flags; 384 acpi_cpu_flags flags;
385 acpi_cpu_flags hw_flags;
386 acpi_native_uint i; 385 acpi_native_uint i;
387 acpi_native_uint j; 386 acpi_native_uint j;
388 387
@@ -394,8 +393,11 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
394 return (int_status); 393 return (int_status);
395 } 394 }
396 395
397 /* We need to hold the GPE lock now, hardware lock in the loop */ 396 /*
398 397 * We need to obtain the GPE lock for both the data structs and registers
398 * Note: Not necessary to obtain the hardware lock, since the GPE registers
399 * are owned by the gpe_lock.
400 */
399 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 401 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
400 402
401 /* Examine all GPE blocks attached to this interrupt level */ 403 /* Examine all GPE blocks attached to this interrupt level */
@@ -413,8 +415,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
413 415
414 gpe_register_info = &gpe_block->register_info[i]; 416 gpe_register_info = &gpe_block->register_info[i];
415 417
416 hw_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
417
418 /* Read the Status Register */ 418 /* Read the Status Register */
419 419
420 status = 420 status =
@@ -423,8 +423,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
423 &gpe_register_info-> 423 &gpe_register_info->
424 status_address); 424 status_address);
425 if (ACPI_FAILURE(status)) { 425 if (ACPI_FAILURE(status)) {
426 acpi_os_release_lock(acpi_gbl_hardware_lock,
427 hw_flags);
428 goto unlock_and_exit; 426 goto unlock_and_exit;
429 } 427 }
430 428
@@ -435,8 +433,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
435 &enable_reg, 433 &enable_reg,
436 &gpe_register_info-> 434 &gpe_register_info->
437 enable_address); 435 enable_address);
438 acpi_os_release_lock(acpi_gbl_hardware_lock, hw_flags);
439
440 if (ACPI_FAILURE(status)) { 436 if (ACPI_FAILURE(status)) {
441 goto unlock_and_exit; 437 goto unlock_and_exit;
442 } 438 }
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 76c34a66e0e0..4f948df17ab9 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -414,12 +414,13 @@ acpi_remove_notify_handler(acpi_handle device,
414 414
415 if ((!device) || 415 if ((!device) ||
416 (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { 416 (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
417 return_ACPI_STATUS(AE_BAD_PARAMETER); 417 status = AE_BAD_PARAMETER;
418 goto exit;
418 } 419 }
419 420
420 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 421 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
421 if (ACPI_FAILURE(status)) { 422 if (ACPI_FAILURE(status)) {
422 return_ACPI_STATUS(status); 423 goto exit;
423 } 424 }
424 425
425 /* Convert and validate the device handle */ 426 /* Convert and validate the device handle */
@@ -427,7 +428,7 @@ acpi_remove_notify_handler(acpi_handle device,
427 node = acpi_ns_map_handle_to_node(device); 428 node = acpi_ns_map_handle_to_node(device);
428 if (!node) { 429 if (!node) {
429 status = AE_BAD_PARAMETER; 430 status = AE_BAD_PARAMETER;
430 goto unlock_and_exit; 431 goto unlock;
431 } 432 }
432 433
433 /* Root Object */ 434 /* Root Object */
@@ -441,7 +442,7 @@ acpi_remove_notify_handler(acpi_handle device,
441 ((handler_type & ACPI_DEVICE_NOTIFY) && 442 ((handler_type & ACPI_DEVICE_NOTIFY) &&
442 !acpi_gbl_device_notify.handler)) { 443 !acpi_gbl_device_notify.handler)) {
443 status = AE_NOT_EXIST; 444 status = AE_NOT_EXIST;
444 goto unlock_and_exit; 445 goto unlock;
445 } 446 }
446 447
447 /* Make sure all deferred tasks are completed */ 448 /* Make sure all deferred tasks are completed */
@@ -450,7 +451,7 @@ acpi_remove_notify_handler(acpi_handle device,
450 acpi_os_wait_events_complete(NULL); 451 acpi_os_wait_events_complete(NULL);
451 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 452 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
452 if (ACPI_FAILURE(status)) { 453 if (ACPI_FAILURE(status)) {
453 return_ACPI_STATUS(status); 454 goto exit;
454 } 455 }
455 456
456 if (handler_type & ACPI_SYSTEM_NOTIFY) { 457 if (handler_type & ACPI_SYSTEM_NOTIFY) {
@@ -473,7 +474,7 @@ acpi_remove_notify_handler(acpi_handle device,
473 474
474 if (!acpi_ev_is_notify_object(node)) { 475 if (!acpi_ev_is_notify_object(node)) {
475 status = AE_TYPE; 476 status = AE_TYPE;
476 goto unlock_and_exit; 477 goto unlock;
477 } 478 }
478 479
479 /* Check for an existing internal object */ 480 /* Check for an existing internal object */
@@ -481,7 +482,7 @@ acpi_remove_notify_handler(acpi_handle device,
481 obj_desc = acpi_ns_get_attached_object(node); 482 obj_desc = acpi_ns_get_attached_object(node);
482 if (!obj_desc) { 483 if (!obj_desc) {
483 status = AE_NOT_EXIST; 484 status = AE_NOT_EXIST;
484 goto unlock_and_exit; 485 goto unlock;
485 } 486 }
486 487
487 /* Object exists - make sure there's an existing handler */ 488 /* Object exists - make sure there's an existing handler */
@@ -491,7 +492,7 @@ acpi_remove_notify_handler(acpi_handle device,
491 if ((!notify_obj) || 492 if ((!notify_obj) ||
492 (notify_obj->notify.handler != handler)) { 493 (notify_obj->notify.handler != handler)) {
493 status = AE_BAD_PARAMETER; 494 status = AE_BAD_PARAMETER;
494 goto unlock_and_exit; 495 goto unlock;
495 } 496 }
496 /* Make sure all deferred tasks are completed */ 497 /* Make sure all deferred tasks are completed */
497 498
@@ -499,7 +500,7 @@ acpi_remove_notify_handler(acpi_handle device,
499 acpi_os_wait_events_complete(NULL); 500 acpi_os_wait_events_complete(NULL);
500 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 501 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
501 if (ACPI_FAILURE(status)) { 502 if (ACPI_FAILURE(status)) {
502 return_ACPI_STATUS(status); 503 goto exit;
503 } 504 }
504 505
505 /* Remove the handler */ 506 /* Remove the handler */
@@ -512,7 +513,7 @@ acpi_remove_notify_handler(acpi_handle device,
512 if ((!notify_obj) || 513 if ((!notify_obj) ||
513 (notify_obj->notify.handler != handler)) { 514 (notify_obj->notify.handler != handler)) {
514 status = AE_BAD_PARAMETER; 515 status = AE_BAD_PARAMETER;
515 goto unlock_and_exit; 516 goto unlock;
516 } 517 }
517 /* Make sure all deferred tasks are completed */ 518 /* Make sure all deferred tasks are completed */
518 519
@@ -520,7 +521,7 @@ acpi_remove_notify_handler(acpi_handle device,
520 acpi_os_wait_events_complete(NULL); 521 acpi_os_wait_events_complete(NULL);
521 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 522 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
522 if (ACPI_FAILURE(status)) { 523 if (ACPI_FAILURE(status)) {
523 return_ACPI_STATUS(status); 524 goto exit;
524 } 525 }
525 526
526 /* Remove the handler */ 527 /* Remove the handler */
@@ -529,8 +530,11 @@ acpi_remove_notify_handler(acpi_handle device,
529 } 530 }
530 } 531 }
531 532
532 unlock_and_exit: 533unlock:
533 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 534 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
535exit:
536 if (ACPI_FAILURE(status))
537 ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler"));
534 return_ACPI_STATUS(status); 538 return_ACPI_STATUS(status);
535} 539}
536 540
@@ -568,12 +572,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
568 /* Parameter validation */ 572 /* Parameter validation */
569 573
570 if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) { 574 if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) {
571 return_ACPI_STATUS(AE_BAD_PARAMETER); 575 status = AE_BAD_PARAMETER;
576 goto exit;
572 } 577 }
573 578
574 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 579 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
575 if (ACPI_FAILURE(status)) { 580 if (ACPI_FAILURE(status)) {
576 return_ACPI_STATUS(status); 581 goto exit;
577 } 582 }
578 583
579 /* Ensure that we have a valid GPE number */ 584 /* Ensure that we have a valid GPE number */
@@ -581,7 +586,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
581 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 586 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
582 if (!gpe_event_info) { 587 if (!gpe_event_info) {
583 status = AE_BAD_PARAMETER; 588 status = AE_BAD_PARAMETER;
584 goto unlock_and_exit; 589 goto unlock;
585 } 590 }
586 591
587 /* Make sure that there isn't a handler there already */ 592 /* Make sure that there isn't a handler there already */
@@ -589,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
589 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 594 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
590 ACPI_GPE_DISPATCH_HANDLER) { 595 ACPI_GPE_DISPATCH_HANDLER) {
591 status = AE_ALREADY_EXISTS; 596 status = AE_ALREADY_EXISTS;
592 goto unlock_and_exit; 597 goto unlock;
593 } 598 }
594 599
595 /* Allocate and init handler object */ 600 /* Allocate and init handler object */
@@ -597,7 +602,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
597 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info)); 602 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info));
598 if (!handler) { 603 if (!handler) {
599 status = AE_NO_MEMORY; 604 status = AE_NO_MEMORY;
600 goto unlock_and_exit; 605 goto unlock;
601 } 606 }
602 607
603 handler->address = address; 608 handler->address = address;
@@ -608,7 +613,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
608 613
609 status = acpi_ev_disable_gpe(gpe_event_info); 614 status = acpi_ev_disable_gpe(gpe_event_info);
610 if (ACPI_FAILURE(status)) { 615 if (ACPI_FAILURE(status)) {
611 goto unlock_and_exit; 616 goto unlock;
612 } 617 }
613 618
614 /* Install the handler */ 619 /* Install the handler */
@@ -623,8 +628,12 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
623 628
624 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 629 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
625 630
626 unlock_and_exit: 631unlock:
627 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 632 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
633exit:
634 if (ACPI_FAILURE(status))
635 ACPI_EXCEPTION((AE_INFO, status,
636 "Installing notify handler failed"));
628 return_ACPI_STATUS(status); 637 return_ACPI_STATUS(status);
629} 638}
630 639
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 823352435e08..83fed079a276 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -266,6 +266,10 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
266 } 266 }
267 } 267 }
268 268
269 ACPI_INFO((AE_INFO,
270 "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]",
271 table->signature, table->oem_id, table->oem_table_id));
272
269 *return_desc = ddb_handle; 273 *return_desc = ddb_handle;
270 return_ACPI_STATUS(status); 274 return_ACPI_STATUS(status);
271} 275}
@@ -446,6 +450,10 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
446 return_ACPI_STATUS(status); 450 return_ACPI_STATUS(status);
447 } 451 }
448 452
453 ACPI_INFO((AE_INFO,
454 "Dynamic SSDT Load - OemId [%6.6s] OemTableId [%8.8s]",
455 table_ptr->oem_id, table_ptr->oem_table_id));
456
449 cleanup: 457 cleanup:
450 if (ACPI_FAILURE(status)) { 458 if (ACPI_FAILURE(status)) {
451 ACPI_FREE(table_ptr); 459 ACPI_FREE(table_ptr);
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index 106dc7219df7..34eec82c1b1e 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -177,7 +177,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
177 * that the event is created in an unsignalled state 177 * that the event is created in an unsignalled state
178 */ 178 */
179 status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, 179 status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0,
180 &obj_desc->event.semaphore); 180 &obj_desc->event.os_semaphore);
181 if (ACPI_FAILURE(status)) { 181 if (ACPI_FAILURE(status)) {
182 goto cleanup; 182 goto cleanup;
183 } 183 }
@@ -226,12 +226,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
226 goto cleanup; 226 goto cleanup;
227 } 227 }
228 228
229 /* 229 /* Create the actual OS Mutex */
230 * Create the actual OS semaphore. 230
231 * One unit max to make it a mutex, with one initial unit to allow 231 status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex);
232 * the mutex to be acquired.
233 */
234 status = acpi_os_create_semaphore(1, 1, &obj_desc->mutex.semaphore);
235 if (ACPI_FAILURE(status)) { 232 if (ACPI_FAILURE(status)) {
236 goto cleanup; 233 goto cleanup;
237 } 234 }
@@ -565,7 +562,7 @@ acpi_ex_create_method(u8 * aml_start,
565 obj_desc->method.aml_length = aml_length; 562 obj_desc->method.aml_length = aml_length;
566 563
567 /* 564 /*
568 * Disassemble the method flags. Split off the Arg Count 565 * Disassemble the method flags. Split off the Arg Count
569 * for efficiency 566 * for efficiency
570 */ 567 */
571 method_flags = (u8) operand[1]->integer.value; 568 method_flags = (u8) operand[1]->integer.value;
@@ -576,21 +573,19 @@ acpi_ex_create_method(u8 * aml_start,
576 (u8) (method_flags & AML_METHOD_ARG_COUNT); 573 (u8) (method_flags & AML_METHOD_ARG_COUNT);
577 574
578 /* 575 /*
579 * Get the concurrency count. If required, a semaphore will be 576 * Get the sync_level. If method is serialized, a mutex will be
580 * created for this method when it is parsed. 577 * created for this method when it is parsed.
581 */ 578 */
582 if (acpi_gbl_all_methods_serialized) { 579 if (acpi_gbl_all_methods_serialized) {
583 obj_desc->method.concurrency = 1; 580 obj_desc->method.sync_level = 0;
584 obj_desc->method.method_flags |= AML_METHOD_SERIALIZED; 581 obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
585 } else if (method_flags & AML_METHOD_SERIALIZED) { 582 } else if (method_flags & AML_METHOD_SERIALIZED) {
586 /* 583 /*
587 * ACPI 1.0: Concurrency = 1 584 * ACPI 1.0: sync_level = 0
588 * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1) 585 * ACPI 2.0: sync_level = sync_level in method declaration
589 */ 586 */
590 obj_desc->method.concurrency = (u8) 587 obj_desc->method.sync_level = (u8)
591 (((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4) + 1); 588 ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4);
592 } else {
593 obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY;
594 } 589 }
595 590
596 /* Attach the new object to the method Node */ 591 /* Attach the new object to the method Node */
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 7b9718e976bf..2450943add33 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -118,14 +118,14 @@ static struct acpi_exdump_info acpi_ex_dump_device[4] = {
118 118
119static struct acpi_exdump_info acpi_ex_dump_event[2] = { 119static struct acpi_exdump_info acpi_ex_dump_event[2] = {
120 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL}, 120 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
121 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"} 121 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
122}; 122};
123 123
124static struct acpi_exdump_info acpi_ex_dump_method[8] = { 124static struct acpi_exdump_info acpi_ex_dump_method[8] = {
125 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, 125 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
126 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"}, 126 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"},
127 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"}, 127 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
128 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"}, 128 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
129 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"}, 129 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
130 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"}, 130 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
131 {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"}, 131 {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
@@ -138,7 +138,7 @@ static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
138 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"}, 138 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
139 {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth), 139 {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
140 "Acquire Depth"}, 140 "Acquire Depth"},
141 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"} 141 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
142}; 142};
143 143
144static struct acpi_exdump_info acpi_ex_dump_region[7] = { 144static struct acpi_exdump_info acpi_ex_dump_region[7] = {
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index 051053f7cccb..40f0bee6faa5 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -727,11 +727,23 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
727 return_ACPI_STATUS(status); 727 return_ACPI_STATUS(status);
728 } 728 }
729 729
730 /* Merge with previous datum if necessary */ 730 /*
731 731 * Merge with previous datum if necessary.
732 merged_datum |= raw_datum << 732 *
733 (obj_desc->common_field.access_bit_width - 733 * Note: Before the shift, check if the shift value will be larger than
734 obj_desc->common_field.start_field_bit_offset); 734 * the integer size. If so, there is no need to perform the operation.
735 * This avoids the differences in behavior between different compilers
736 * concerning shift values larger than the target data width.
737 */
738 if ((obj_desc->common_field.access_bit_width -
739 obj_desc->common_field.start_field_bit_offset) <
740 ACPI_INTEGER_BIT_SIZE) {
741 merged_datum |=
742 raw_datum << (obj_desc->common_field.
743 access_bit_width -
744 obj_desc->common_field.
745 start_field_bit_offset);
746 }
735 747
736 if (i == datum_count) { 748 if (i == datum_count) {
737 break; 749 break;
@@ -808,13 +820,23 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
808 return_ACPI_STATUS(AE_BUFFER_OVERFLOW); 820 return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
809 } 821 }
810 822
811 /* Compute the number of datums (access width data items) */ 823 /*
824 * Create the bitmasks used for bit insertion.
825 * Note: This if/else is used to bypass compiler differences with the
826 * shift operator
827 */
828 if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) {
829 width_mask = ACPI_INTEGER_MAX;
830 } else {
831 width_mask =
832 ACPI_MASK_BITS_ABOVE(obj_desc->common_field.
833 access_bit_width);
834 }
812 835
813 width_mask = 836 mask = width_mask &
814 ACPI_MASK_BITS_ABOVE(obj_desc->common_field.access_bit_width); 837 ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset);
815 mask = 838
816 width_mask & ACPI_MASK_BITS_BELOW(obj_desc->common_field. 839 /* Compute the number of datums (access width data items) */
817 start_field_bit_offset);
818 840
819 datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, 841 datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length,
820 obj_desc->common_field.access_bit_width); 842 obj_desc->common_field.access_bit_width);
@@ -848,12 +870,29 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
848 return_ACPI_STATUS(status); 870 return_ACPI_STATUS(status);
849 } 871 }
850 872
851 /* Start new output datum by merging with previous input datum */
852
853 field_offset += obj_desc->common_field.access_byte_width; 873 field_offset += obj_desc->common_field.access_byte_width;
854 merged_datum = raw_datum >> 874
855 (obj_desc->common_field.access_bit_width - 875 /*
856 obj_desc->common_field.start_field_bit_offset); 876 * Start new output datum by merging with previous input datum
877 * if necessary.
878 *
879 * Note: Before the shift, check if the shift value will be larger than
880 * the integer size. If so, there is no need to perform the operation.
881 * This avoids the differences in behavior between different compilers
882 * concerning shift values larger than the target data width.
883 */
884 if ((obj_desc->common_field.access_bit_width -
885 obj_desc->common_field.start_field_bit_offset) <
886 ACPI_INTEGER_BIT_SIZE) {
887 merged_datum =
888 raw_datum >> (obj_desc->common_field.
889 access_bit_width -
890 obj_desc->common_field.
891 start_field_bit_offset);
892 } else {
893 merged_datum = 0;
894 }
895
857 mask = width_mask; 896 mask = width_mask;
858 897
859 if (i == datum_count) { 898 if (i == datum_count) {
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 93098d68cadf..d8ac2877cf05 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -161,12 +161,13 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
161 161
162 /* 162 /*
163 * Current Sync must be less than or equal to the sync level of the 163 * Current Sync must be less than or equal to the sync level of the
164 * mutex. This mechanism provides some deadlock prevention 164 * mutex. This mechanism provides some deadlock prevention
165 */ 165 */
166 if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { 166 if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
167 ACPI_ERROR((AE_INFO, 167 ACPI_ERROR((AE_INFO,
168 "Cannot acquire Mutex [%4.4s], incorrect SyncLevel", 168 "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)",
169 acpi_ut_get_node_name(obj_desc->mutex.node))); 169 acpi_ut_get_node_name(obj_desc->mutex.node),
170 walk_state->thread->current_sync_level));
170 return_ACPI_STATUS(AE_AML_MUTEX_ORDER); 171 return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
171 } 172 }
172 173
@@ -178,8 +179,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
178 179
179 if ((obj_desc->mutex.owner_thread->thread_id == 180 if ((obj_desc->mutex.owner_thread->thread_id ==
180 walk_state->thread->thread_id) || 181 walk_state->thread->thread_id) ||
181 (obj_desc->mutex.semaphore == 182 (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) {
182 acpi_gbl_global_lock_semaphore)) {
183 /* 183 /*
184 * The mutex is already owned by this thread, 184 * The mutex is already owned by this thread,
185 * just increment the acquisition depth 185 * just increment the acquisition depth
@@ -264,7 +264,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
264 */ 264 */
265 if ((obj_desc->mutex.owner_thread->thread_id != 265 if ((obj_desc->mutex.owner_thread->thread_id !=
266 walk_state->thread->thread_id) 266 walk_state->thread->thread_id)
267 && (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) { 267 && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
268 ACPI_ERROR((AE_INFO, 268 ACPI_ERROR((AE_INFO,
269 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", 269 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
270 walk_state->thread->thread_id, 270 walk_state->thread->thread_id,
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 52beee3674a0..6b5d1e6ce94b 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -63,14 +63,14 @@ ACPI_MODULE_NAME("exsystem")
63 * interpreter is released. 63 * interpreter is released.
64 * 64 *
65 ******************************************************************************/ 65 ******************************************************************************/
66acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout) 66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
67{ 67{
68 acpi_status status; 68 acpi_status status;
69 acpi_status status2; 69 acpi_status status2;
70 70
71 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); 71 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
72 72
73 status = acpi_os_wait_semaphore(semaphore, 1, 0); 73 status = acpi_os_wait_semaphore(semaphore, 1, ACPI_DO_NOT_WAIT);
74 if (ACPI_SUCCESS(status)) { 74 if (ACPI_SUCCESS(status)) {
75 return_ACPI_STATUS(status); 75 return_ACPI_STATUS(status);
76 } 76 }
@@ -103,6 +103,59 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
103 103
104/******************************************************************************* 104/*******************************************************************************
105 * 105 *
106 * FUNCTION: acpi_ex_system_wait_mutex
107 *
108 * PARAMETERS: Mutex - Mutex to wait on
109 * Timeout - Max time to wait
110 *
111 * RETURN: Status
112 *
113 * DESCRIPTION: Implements a semaphore wait with a check to see if the
114 * semaphore is available immediately. If it is not, the
115 * interpreter is released.
116 *
117 ******************************************************************************/
118
119acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
120{
121 acpi_status status;
122 acpi_status status2;
123
124 ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
125
126 status = acpi_os_acquire_mutex(mutex, ACPI_DO_NOT_WAIT);
127 if (ACPI_SUCCESS(status)) {
128 return_ACPI_STATUS(status);
129 }
130
131 if (status == AE_TIME) {
132
133 /* We must wait, so unlock the interpreter */
134
135 acpi_ex_exit_interpreter();
136
137 status = acpi_os_acquire_mutex(mutex, timeout);
138
139 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
140 "*** Thread awake after blocking, %s\n",
141 acpi_format_exception(status)));
142
143 /* Reacquire the interpreter */
144
145 status2 = acpi_ex_enter_interpreter();
146 if (ACPI_FAILURE(status2)) {
147
148 /* Report fatal error, could not acquire interpreter */
149
150 return_ACPI_STATUS(status2);
151 }
152 }
153
154 return_ACPI_STATUS(status);
155}
156
157/*******************************************************************************
158 *
106 * FUNCTION: acpi_ex_system_do_stall 159 * FUNCTION: acpi_ex_system_do_stall
107 * 160 *
108 * PARAMETERS: how_long - The amount of time to stall, 161 * PARAMETERS: how_long - The amount of time to stall,
@@ -176,7 +229,7 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
176 * 229 *
177 * FUNCTION: acpi_ex_system_acquire_mutex 230 * FUNCTION: acpi_ex_system_acquire_mutex
178 * 231 *
179 * PARAMETERS: time_desc - The 'time to delay' object descriptor 232 * PARAMETERS: time_desc - Maximum time to wait for the mutex
180 * obj_desc - The object descriptor for this op 233 * obj_desc - The object descriptor for this op
181 * 234 *
182 * RETURN: Status 235 * RETURN: Status
@@ -201,14 +254,14 @@ acpi_ex_system_acquire_mutex(union acpi_operand_object * time_desc,
201 254
202 /* Support for the _GL_ Mutex object -- go get the global lock */ 255 /* Support for the _GL_ Mutex object -- go get the global lock */
203 256
204 if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { 257 if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
205 status = 258 status =
206 acpi_ev_acquire_global_lock((u16) time_desc->integer.value); 259 acpi_ev_acquire_global_lock((u16) time_desc->integer.value);
207 return_ACPI_STATUS(status); 260 return_ACPI_STATUS(status);
208 } 261 }
209 262
210 status = acpi_ex_system_wait_semaphore(obj_desc->mutex.semaphore, 263 status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
211 (u16) time_desc->integer.value); 264 (u16) time_desc->integer.value);
212 return_ACPI_STATUS(status); 265 return_ACPI_STATUS(status);
213} 266}
214 267
@@ -239,13 +292,13 @@ acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc)
239 292
240 /* Support for the _GL_ Mutex object -- release the global lock */ 293 /* Support for the _GL_ Mutex object -- release the global lock */
241 294
242 if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { 295 if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) {
243 status = acpi_ev_release_global_lock(); 296 status = acpi_ev_release_global_lock();
244 return_ACPI_STATUS(status); 297 return_ACPI_STATUS(status);
245 } 298 }
246 299
247 status = acpi_os_signal_semaphore(obj_desc->mutex.semaphore, 1); 300 acpi_os_release_mutex(obj_desc->mutex.os_mutex);
248 return_ACPI_STATUS(status); 301 return_ACPI_STATUS(AE_OK);
249} 302}
250 303
251/******************************************************************************* 304/*******************************************************************************
@@ -268,7 +321,8 @@ acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc)
268 ACPI_FUNCTION_TRACE(ex_system_signal_event); 321 ACPI_FUNCTION_TRACE(ex_system_signal_event);
269 322
270 if (obj_desc) { 323 if (obj_desc) {
271 status = acpi_os_signal_semaphore(obj_desc->event.semaphore, 1); 324 status =
325 acpi_os_signal_semaphore(obj_desc->event.os_semaphore, 1);
272 } 326 }
273 327
274 return_ACPI_STATUS(status); 328 return_ACPI_STATUS(status);
@@ -299,7 +353,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc,
299 353
300 if (obj_desc) { 354 if (obj_desc) {
301 status = 355 status =
302 acpi_ex_system_wait_semaphore(obj_desc->event.semaphore, 356 acpi_ex_system_wait_semaphore(obj_desc->event.os_semaphore,
303 (u16) time_desc->integer. 357 (u16) time_desc->integer.
304 value); 358 value);
305 } 359 }
@@ -322,7 +376,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc,
322acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) 376acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc)
323{ 377{
324 acpi_status status = AE_OK; 378 acpi_status status = AE_OK;
325 void *temp_semaphore; 379 acpi_semaphore temp_semaphore;
326 380
327 ACPI_FUNCTION_ENTRY(); 381 ACPI_FUNCTION_ENTRY();
328 382
@@ -333,8 +387,8 @@ acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc)
333 status = 387 status =
334 acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore); 388 acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore);
335 if (ACPI_SUCCESS(status)) { 389 if (ACPI_SUCCESS(status)) {
336 (void)acpi_os_delete_semaphore(obj_desc->event.semaphore); 390 (void)acpi_os_delete_semaphore(obj_desc->event.os_semaphore);
337 obj_desc->event.semaphore = temp_semaphore; 391 obj_desc->event.os_semaphore = temp_semaphore;
338 } 392 }
339 393
340 return (status); 394 return (status);
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 1cd25784b7a4..38acc69b21bc 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -78,7 +78,6 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset)
78 struct acpi_fan *fan = seq->private; 78 struct acpi_fan *fan = seq->private;
79 int state = 0; 79 int state = 0;
80 80
81 ACPI_FUNCTION_TRACE("acpi_fan_read_state");
82 81
83 if (fan) { 82 if (fan) {
84 if (acpi_bus_get_power(fan->handle, &state)) 83 if (acpi_bus_get_power(fan->handle, &state))
@@ -87,7 +86,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset)
87 seq_printf(seq, "status: %s\n", 86 seq_printf(seq, "status: %s\n",
88 !state ? "on" : "off"); 87 !state ? "on" : "off");
89 } 88 }
90 return_VALUE(0); 89 return 0;
91} 90}
92 91
93static int acpi_fan_state_open_fs(struct inode *inode, struct file *file) 92static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
@@ -104,22 +103,21 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
104 struct acpi_fan *fan = (struct acpi_fan *)m->private; 103 struct acpi_fan *fan = (struct acpi_fan *)m->private;
105 char state_string[12] = { '\0' }; 104 char state_string[12] = { '\0' };
106 105
107 ACPI_FUNCTION_TRACE("acpi_fan_write_state");
108 106
109 if (!fan || (count > sizeof(state_string) - 1)) 107 if (!fan || (count > sizeof(state_string) - 1))
110 return_VALUE(-EINVAL); 108 return -EINVAL;
111 109
112 if (copy_from_user(state_string, buffer, count)) 110 if (copy_from_user(state_string, buffer, count))
113 return_VALUE(-EFAULT); 111 return -EFAULT;
114 112
115 state_string[count] = '\0'; 113 state_string[count] = '\0';
116 114
117 result = acpi_bus_set_power(fan->handle, 115 result = acpi_bus_set_power(fan->handle,
118 simple_strtoul(state_string, NULL, 0)); 116 simple_strtoul(state_string, NULL, 0));
119 if (result) 117 if (result)
120 return_VALUE(result); 118 return result;
121 119
122 return_VALUE(count); 120 return count;
123} 121}
124 122
125static struct file_operations acpi_fan_state_ops = { 123static struct file_operations acpi_fan_state_ops = {
@@ -135,16 +133,15 @@ static int acpi_fan_add_fs(struct acpi_device *device)
135{ 133{
136 struct proc_dir_entry *entry = NULL; 134 struct proc_dir_entry *entry = NULL;
137 135
138 ACPI_FUNCTION_TRACE("acpi_fan_add_fs");
139 136
140 if (!device) 137 if (!device)
141 return_VALUE(-EINVAL); 138 return -EINVAL;
142 139
143 if (!acpi_device_dir(device)) { 140 if (!acpi_device_dir(device)) {
144 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 141 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
145 acpi_fan_dir); 142 acpi_fan_dir);
146 if (!acpi_device_dir(device)) 143 if (!acpi_device_dir(device))
147 return_VALUE(-ENODEV); 144 return -ENODEV;
148 acpi_device_dir(device)->owner = THIS_MODULE; 145 acpi_device_dir(device)->owner = THIS_MODULE;
149 } 146 }
150 147
@@ -153,21 +150,18 @@ static int acpi_fan_add_fs(struct acpi_device *device)
153 S_IFREG | S_IRUGO | S_IWUSR, 150 S_IFREG | S_IRUGO | S_IWUSR,
154 acpi_device_dir(device)); 151 acpi_device_dir(device));
155 if (!entry) 152 if (!entry)
156 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 153 return -ENODEV;
157 "Unable to create '%s' fs entry\n",
158 ACPI_FAN_FILE_STATE));
159 else { 154 else {
160 entry->proc_fops = &acpi_fan_state_ops; 155 entry->proc_fops = &acpi_fan_state_ops;
161 entry->data = acpi_driver_data(device); 156 entry->data = acpi_driver_data(device);
162 entry->owner = THIS_MODULE; 157 entry->owner = THIS_MODULE;
163 } 158 }
164 159
165 return_VALUE(0); 160 return 0;
166} 161}
167 162
168static int acpi_fan_remove_fs(struct acpi_device *device) 163static int acpi_fan_remove_fs(struct acpi_device *device)
169{ 164{
170 ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
171 165
172 if (acpi_device_dir(device)) { 166 if (acpi_device_dir(device)) {
173 remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device)); 167 remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device));
@@ -175,7 +169,7 @@ static int acpi_fan_remove_fs(struct acpi_device *device)
175 acpi_device_dir(device) = NULL; 169 acpi_device_dir(device) = NULL;
176 } 170 }
177 171
178 return_VALUE(0); 172 return 0;
179} 173}
180 174
181/* -------------------------------------------------------------------------- 175/* --------------------------------------------------------------------------
@@ -188,14 +182,13 @@ static int acpi_fan_add(struct acpi_device *device)
188 struct acpi_fan *fan = NULL; 182 struct acpi_fan *fan = NULL;
189 int state = 0; 183 int state = 0;
190 184
191 ACPI_FUNCTION_TRACE("acpi_fan_add");
192 185
193 if (!device) 186 if (!device)
194 return_VALUE(-EINVAL); 187 return -EINVAL;
195 188
196 fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL); 189 fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL);
197 if (!fan) 190 if (!fan)
198 return_VALUE(-ENOMEM); 191 return -ENOMEM;
199 memset(fan, 0, sizeof(struct acpi_fan)); 192 memset(fan, 0, sizeof(struct acpi_fan));
200 193
201 fan->handle = device->handle; 194 fan->handle = device->handle;
@@ -205,8 +198,7 @@ static int acpi_fan_add(struct acpi_device *device)
205 198
206 result = acpi_bus_get_power(fan->handle, &state); 199 result = acpi_bus_get_power(fan->handle, &state);
207 if (result) { 200 if (result) {
208 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 201 printk(KERN_ERR PREFIX "Reading power state\n");
209 "Error reading power state\n"));
210 goto end; 202 goto end;
211 } 203 }
212 204
@@ -226,17 +218,16 @@ static int acpi_fan_add(struct acpi_device *device)
226 if (result) 218 if (result)
227 kfree(fan); 219 kfree(fan);
228 220
229 return_VALUE(result); 221 return result;
230} 222}
231 223
232static int acpi_fan_remove(struct acpi_device *device, int type) 224static int acpi_fan_remove(struct acpi_device *device, int type)
233{ 225{
234 struct acpi_fan *fan = NULL; 226 struct acpi_fan *fan = NULL;
235 227
236 ACPI_FUNCTION_TRACE("acpi_fan_remove");
237 228
238 if (!device || !acpi_driver_data(device)) 229 if (!device || !acpi_driver_data(device))
239 return_VALUE(-EINVAL); 230 return -EINVAL;
240 231
241 fan = (struct acpi_fan *)acpi_driver_data(device); 232 fan = (struct acpi_fan *)acpi_driver_data(device);
242 233
@@ -244,7 +235,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
244 235
245 kfree(fan); 236 kfree(fan);
246 237
247 return_VALUE(0); 238 return 0;
248} 239}
249 240
250static int acpi_fan_suspend(struct acpi_device *device, int state) 241static int acpi_fan_suspend(struct acpi_device *device, int state)
@@ -283,31 +274,29 @@ static int __init acpi_fan_init(void)
283{ 274{
284 int result = 0; 275 int result = 0;
285 276
286 ACPI_FUNCTION_TRACE("acpi_fan_init");
287 277
288 acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); 278 acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
289 if (!acpi_fan_dir) 279 if (!acpi_fan_dir)
290 return_VALUE(-ENODEV); 280 return -ENODEV;
291 acpi_fan_dir->owner = THIS_MODULE; 281 acpi_fan_dir->owner = THIS_MODULE;
292 282
293 result = acpi_bus_register_driver(&acpi_fan_driver); 283 result = acpi_bus_register_driver(&acpi_fan_driver);
294 if (result < 0) { 284 if (result < 0) {
295 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); 285 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
296 return_VALUE(-ENODEV); 286 return -ENODEV;
297 } 287 }
298 288
299 return_VALUE(0); 289 return 0;
300} 290}
301 291
302static void __exit acpi_fan_exit(void) 292static void __exit acpi_fan_exit(void)
303{ 293{
304 ACPI_FUNCTION_TRACE("acpi_fan_exit");
305 294
306 acpi_bus_unregister_driver(&acpi_fan_driver); 295 acpi_bus_unregister_driver(&acpi_fan_driver);
307 296
308 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); 297 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
309 298
310 return_VOID; 299 return;
311} 300}
312 301
313module_init(acpi_fan_init); 302module_init(acpi_fan_init);
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index ae142de19507..3143f36fcec9 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -172,9 +172,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
172 } 172 }
173 173
174 /* 174 /*
175 * The package must have at least two elements. NOTE (March 2005): This 175 * The package must have at least two elements. NOTE (March 2005): This
176 * goes against the current ACPI spec which defines this object as a 176 * goes against the current ACPI spec which defines this object as a
177 * package with one encoded DWORD element. However, existing practice 177 * package with one encoded DWORD element. However, existing practice
178 * by BIOS vendors seems to be to have 2 or more elements, at least 178 * by BIOS vendors seems to be to have 2 or more elements, at least
179 * one per sleep type (A/B). 179 * one per sleep type (A/B).
180 */ 180 */
@@ -255,7 +255,7 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
255 * return_value - Value that was read from the register 255 * return_value - Value that was read from the register
256 * Flags - Lock the hardware or not 256 * Flags - Lock the hardware or not
257 * 257 *
258 * RETURN: Status and the value read from specified Register. Value 258 * RETURN: Status and the value read from specified Register. Value
259 * returned is normalized to bit0 (is shifted all the way right) 259 * returned is normalized to bit0 (is shifted all the way right)
260 * 260 *
261 * DESCRIPTION: ACPI bit_register read function. 261 * DESCRIPTION: ACPI bit_register read function.
@@ -361,8 +361,8 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags)
361 case ACPI_REGISTER_PM1_STATUS: 361 case ACPI_REGISTER_PM1_STATUS:
362 362
363 /* 363 /*
364 * Status Registers are different from the rest. Clear by 364 * Status Registers are different from the rest. Clear by
365 * writing 1, and writing 0 has no effect. So, the only relevant 365 * writing 1, and writing 0 has no effect. So, the only relevant
366 * information is the single bit we're interested in, all others should 366 * information is the single bit we're interested in, all others should
367 * be written as 0 so they will be left unchanged. 367 * be written as 0 so they will be left unchanged.
368 */ 368 */
@@ -467,14 +467,13 @@ ACPI_EXPORT_SYMBOL(acpi_set_register)
467 * 467 *
468 * FUNCTION: acpi_hw_register_read 468 * FUNCTION: acpi_hw_register_read
469 * 469 *
470 * PARAMETERS: use_lock - Mutex hw access 470 * PARAMETERS: use_lock - Lock hardware? True/False
471 * register_id - register_iD + Offset 471 * register_id - ACPI Register ID
472 * return_value - Where the register value is returned 472 * return_value - Where the register value is returned
473 * 473 *
474 * RETURN: Status and the value read. 474 * RETURN: Status and the value read.
475 * 475 *
476 * DESCRIPTION: Acpi register read function. Registers are read at the 476 * DESCRIPTION: Read from the specified ACPI register
477 * given offset.
478 * 477 *
479 ******************************************************************************/ 478 ******************************************************************************/
480acpi_status 479acpi_status
@@ -580,14 +579,26 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value)
580 * 579 *
581 * FUNCTION: acpi_hw_register_write 580 * FUNCTION: acpi_hw_register_write
582 * 581 *
583 * PARAMETERS: use_lock - Mutex hw access 582 * PARAMETERS: use_lock - Lock hardware? True/False
584 * register_id - register_iD + Offset 583 * register_id - ACPI Register ID
585 * Value - The value to write 584 * Value - The value to write
586 * 585 *
587 * RETURN: Status 586 * RETURN: Status
588 * 587 *
589 * DESCRIPTION: Acpi register Write function. Registers are written at the 588 * DESCRIPTION: Write to the specified ACPI register
590 * given offset. 589 *
590 * NOTE: In accordance with the ACPI specification, this function automatically
591 * preserves the value of the following bits, meaning that these bits cannot be
592 * changed via this interface:
593 *
594 * PM1_CONTROL[0] = SCI_EN
595 * PM1_CONTROL[9]
596 * PM1_STATUS[11]
597 *
598 * ACPI References:
599 * 1) Hardware Ignored Bits: When software writes to a register with ignored
600 * bit fields, it preserves the ignored bit fields
601 * 2) SCI_EN: OSPM always preserves this bit position
591 * 602 *
592 ******************************************************************************/ 603 ******************************************************************************/
593 604
@@ -595,6 +606,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
595{ 606{
596 acpi_status status; 607 acpi_status status;
597 acpi_cpu_flags lock_flags = 0; 608 acpi_cpu_flags lock_flags = 0;
609 u32 read_value;
598 610
599 ACPI_FUNCTION_TRACE(hw_register_write); 611 ACPI_FUNCTION_TRACE(hw_register_write);
600 612
@@ -605,6 +617,22 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
605 switch (register_id) { 617 switch (register_id) {
606 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ 618 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
607 619
620 /* Perform a read first to preserve certain bits (per ACPI spec) */
621
622 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
623 ACPI_REGISTER_PM1_STATUS,
624 &read_value);
625 if (ACPI_FAILURE(status)) {
626 goto unlock_and_exit;
627 }
628
629 /* Insert the bits to be preserved */
630
631 ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
632 read_value);
633
634 /* Now we can write the data */
635
608 status = 636 status =
609 acpi_hw_low_level_write(16, value, 637 acpi_hw_low_level_write(16, value,
610 &acpi_gbl_FADT->xpm1a_evt_blk); 638 &acpi_gbl_FADT->xpm1a_evt_blk);
@@ -635,6 +663,25 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
635 663
636 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ 664 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
637 665
666 /*
667 * Perform a read first to preserve certain bits (per ACPI spec)
668 *
669 * Note: This includes SCI_EN, we never want to change this bit
670 */
671 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
672 ACPI_REGISTER_PM1_CONTROL,
673 &read_value);
674 if (ACPI_FAILURE(status)) {
675 goto unlock_and_exit;
676 }
677
678 /* Insert the bits to be preserved */
679
680 ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
681 read_value);
682
683 /* Now we can write the data */
684
638 status = 685 status =
639 acpi_hw_low_level_write(16, value, 686 acpi_hw_low_level_write(16, value,
640 &acpi_gbl_FADT->xpm1a_cnt_blk); 687 &acpi_gbl_FADT->xpm1a_cnt_blk);
@@ -726,7 +773,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
726 return (AE_OK); 773 return (AE_OK);
727 } 774 }
728 775
729 /* Get a local copy of the address. Handles possible alignment issues */ 776 /* Get a local copy of the address. Handles possible alignment issues */
730 777
731 ACPI_MOVE_64_TO_64(&address, &reg->address); 778 ACPI_MOVE_64_TO_64(&address, &reg->address);
732 if (!address) { 779 if (!address) {
@@ -798,7 +845,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
798 return (AE_OK); 845 return (AE_OK);
799 } 846 }
800 847
801 /* Get a local copy of the address. Handles possible alignment issues */ 848 /* Get a local copy of the address. Handles possible alignment issues */
802 849
803 ACPI_MOVE_64_TO_64(&address, &reg->address); 850 ACPI_MOVE_64_TO_64(&address, &reg->address);
804 if (!address) { 851 if (!address) {
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
index c25b2b92edcf..fd81a0f5222f 100644
--- a/drivers/acpi/hotkey.c
+++ b/drivers/acpi/hotkey.c
@@ -231,11 +231,10 @@ struct list_head hotkey_entries; /* head of the list of hotkey_list */
231 231
232static int hotkey_info_seq_show(struct seq_file *seq, void *offset) 232static int hotkey_info_seq_show(struct seq_file *seq, void *offset)
233{ 233{
234 ACPI_FUNCTION_TRACE("hotkey_info_seq_show");
235 234
236 seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION); 235 seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION);
237 236
238 return_VALUE(0); 237 return 0;
239} 238}
240 239
241static int hotkey_info_open_fs(struct inode *inode, struct file *file) 240static int hotkey_info_open_fs(struct inode *inode, struct file *file)
@@ -266,7 +265,6 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
266 (struct acpi_polling_hotkey *)seq->private; 265 (struct acpi_polling_hotkey *)seq->private;
267 char *buf; 266 char *buf;
268 267
269 ACPI_FUNCTION_TRACE("hotkey_polling_seq_show");
270 268
271 if (poll_hotkey->poll_result) { 269 if (poll_hotkey->poll_result) {
272 buf = format_result(poll_hotkey->poll_result); 270 buf = format_result(poll_hotkey->poll_result);
@@ -274,7 +272,7 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
274 seq_printf(seq, "%s", buf); 272 seq_printf(seq, "%s", buf);
275 kfree(buf); 273 kfree(buf);
276 } 274 }
277 return_VALUE(0); 275 return 0;
278} 276}
279 277
280static int hotkey_polling_open_fs(struct inode *inode, struct file *file) 278static int hotkey_polling_open_fs(struct inode *inode, struct file *file)
@@ -293,7 +291,6 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list)
293 struct list_head *entries; 291 struct list_head *entries;
294 int val = -1; 292 int val = -1;
295 293
296 ACPI_FUNCTION_TRACE("hotkey_get_internal_event");
297 294
298 list_for_each(entries, list->entries) { 295 list_for_each(entries, list->entries) {
299 union acpi_hotkey *key = 296 union acpi_hotkey *key =
@@ -305,7 +302,7 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list)
305 } 302 }
306 } 303 }
307 304
308 return_VALUE(val); 305 return val;
309} 306}
310 307
311static void 308static void
@@ -314,15 +311,14 @@ acpi_hotkey_notify_handler(acpi_handle handle, u32 event, void *data)
314 struct acpi_device *device = NULL; 311 struct acpi_device *device = NULL;
315 u32 internal_event; 312 u32 internal_event;
316 313
317 ACPI_FUNCTION_TRACE("acpi_hotkey_notify_handler");
318 314
319 if (acpi_bus_get_device(handle, &device)) 315 if (acpi_bus_get_device(handle, &device))
320 return_VOID; 316 return;
321 317
322 internal_event = hotkey_get_internal_event(event, &global_hotkey_list); 318 internal_event = hotkey_get_internal_event(event, &global_hotkey_list);
323 acpi_bus_generate_event(device, internal_event, 0); 319 acpi_bus_generate_event(device, internal_event, 0);
324 320
325 return_VOID; 321 return;
326} 322}
327 323
328/* Need to invent automatically hotkey add method */ 324/* Need to invent automatically hotkey add method */
@@ -346,7 +342,6 @@ static int create_polling_proc(union acpi_hotkey *device)
346 char proc_name[80]; 342 char proc_name[80];
347 mode_t mode; 343 mode_t mode;
348 344
349 ACPI_FUNCTION_TRACE("create_polling_proc");
350 mode = S_IFREG | S_IRUGO | S_IWUGO; 345 mode = S_IFREG | S_IRUGO | S_IWUGO;
351 346
352 sprintf(proc_name, "%d", device->link.hotkey_standard_num); 347 sprintf(proc_name, "%d", device->link.hotkey_standard_num);
@@ -356,10 +351,7 @@ static int create_polling_proc(union acpi_hotkey *device)
356 proc = create_proc_entry(proc_name, mode, hotkey_proc_dir); 351 proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
357 352
358 if (!proc) { 353 if (!proc) {
359 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 354 return -ENODEV;
360 "Hotkey: Unable to create %s entry\n",
361 device->poll_hotkey.poll_method));
362 return_VALUE(-ENODEV);
363 } else { 355 } else {
364 proc->proc_fops = &hotkey_polling_fops; 356 proc->proc_fops = &hotkey_polling_fops;
365 proc->owner = THIS_MODULE; 357 proc->owner = THIS_MODULE;
@@ -368,7 +360,7 @@ static int create_polling_proc(union acpi_hotkey *device)
368 proc->gid = 0; 360 proc->gid = 0;
369 device->poll_hotkey.proc = proc; 361 device->poll_hotkey.proc = proc;
370 } 362 }
371 return_VALUE(0); 363 return 0;
372} 364}
373 365
374static int hotkey_add(union acpi_hotkey *device) 366static int hotkey_add(union acpi_hotkey *device)
@@ -376,7 +368,6 @@ static int hotkey_add(union acpi_hotkey *device)
376 int status = 0; 368 int status = 0;
377 struct acpi_device *dev = NULL; 369 struct acpi_device *dev = NULL;
378 370
379 ACPI_FUNCTION_TRACE("hotkey_add");
380 371
381 if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) { 372 if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) {
382 acpi_bus_get_device(device->event_hotkey.bus_handle, &dev); 373 acpi_bus_get_device(device->event_hotkey.bus_handle, &dev);
@@ -391,14 +382,13 @@ static int hotkey_add(union acpi_hotkey *device)
391 382
392 list_add_tail(&device->link.entries, global_hotkey_list.entries); 383 list_add_tail(&device->link.entries, global_hotkey_list.entries);
393 384
394 return_VALUE(status); 385 return status;
395} 386}
396 387
397static int hotkey_remove(union acpi_hotkey *device) 388static int hotkey_remove(union acpi_hotkey *device)
398{ 389{
399 struct list_head *entries, *next; 390 struct list_head *entries, *next;
400 391
401 ACPI_FUNCTION_TRACE("hotkey_remove");
402 392
403 list_for_each_safe(entries, next, global_hotkey_list.entries) { 393 list_for_each_safe(entries, next, global_hotkey_list.entries) {
404 union acpi_hotkey *key = 394 union acpi_hotkey *key =
@@ -412,14 +402,13 @@ static int hotkey_remove(union acpi_hotkey *device)
412 } 402 }
413 } 403 }
414 kfree(device); 404 kfree(device);
415 return_VALUE(0); 405 return 0;
416} 406}
417 407
418static int hotkey_update(union acpi_hotkey *key) 408static int hotkey_update(union acpi_hotkey *key)
419{ 409{
420 struct list_head *entries; 410 struct list_head *entries;
421 411
422 ACPI_FUNCTION_TRACE("hotkey_update");
423 412
424 list_for_each(entries, global_hotkey_list.entries) { 413 list_for_each(entries, global_hotkey_list.entries) {
425 union acpi_hotkey *tmp = 414 union acpi_hotkey *tmp =
@@ -461,19 +450,18 @@ static int hotkey_update(union acpi_hotkey *key)
461 */ 450 */
462 kfree(key); 451 kfree(key);
463 } 452 }
464 return_VALUE(0); 453 return 0;
465 break; 454 break;
466 } 455 }
467 } 456 }
468 457
469 return_VALUE(-ENODEV); 458 return -ENODEV;
470} 459}
471 460
472static void free_hotkey_device(union acpi_hotkey *key) 461static void free_hotkey_device(union acpi_hotkey *key)
473{ 462{
474 struct acpi_device *dev; 463 struct acpi_device *dev;
475 464
476 ACPI_FUNCTION_TRACE("free_hotkey_device");
477 465
478 if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { 466 if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) {
479 acpi_bus_get_device(key->event_hotkey.bus_handle, &dev); 467 acpi_bus_get_device(key->event_hotkey.bus_handle, &dev);
@@ -493,7 +481,7 @@ static void free_hotkey_device(union acpi_hotkey *key)
493 free_poll_hotkey_buffer(key); 481 free_poll_hotkey_buffer(key);
494 } 482 }
495 kfree(key); 483 kfree(key);
496 return_VOID; 484 return;
497} 485}
498 486
499static void free_hotkey_buffer(union acpi_hotkey *key) 487static void free_hotkey_buffer(union acpi_hotkey *key)
@@ -514,7 +502,6 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str,
514 acpi_handle tmp_handle; 502 acpi_handle tmp_handle;
515 acpi_status status = AE_OK; 503 acpi_status status = AE_OK;
516 504
517 ACPI_FUNCTION_TRACE("init_hotkey_device");
518 505
519 if (std_num < 0 || IS_POLL(std_num) || !key) 506 if (std_num < 0 || IS_POLL(std_num) || !key)
520 goto do_fail; 507 goto do_fail;
@@ -541,9 +528,9 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str,
541 method, &tmp_handle); 528 method, &tmp_handle);
542 if (ACPI_FAILURE(status)) 529 if (ACPI_FAILURE(status))
543 goto do_fail; 530 goto do_fail;
544 return_VALUE(AE_OK); 531 return AE_OK;
545 do_fail: 532 do_fail:
546 return_VALUE(-ENODEV); 533 return -ENODEV;
547} 534}
548 535
549static int 536static int
@@ -555,7 +542,6 @@ init_poll_hotkey_device(union acpi_hotkey *key,
555 acpi_status status = AE_OK; 542 acpi_status status = AE_OK;
556 acpi_handle tmp_handle; 543 acpi_handle tmp_handle;
557 544
558 ACPI_FUNCTION_TRACE("init_poll_hotkey_device");
559 545
560 if (std_num < 0 || IS_EVENT(std_num) || !key) 546 if (std_num < 0 || IS_EVENT(std_num) || !key)
561 goto do_fail; 547 goto do_fail;
@@ -590,22 +576,20 @@ init_poll_hotkey_device(union acpi_hotkey *key,
590 (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); 576 (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL);
591 if (!key->poll_hotkey.poll_result) 577 if (!key->poll_hotkey.poll_result)
592 goto do_fail; 578 goto do_fail;
593 return_VALUE(AE_OK); 579 return AE_OK;
594 do_fail: 580 do_fail:
595 return_VALUE(-ENODEV); 581 return -ENODEV;
596} 582}
597 583
598static int hotkey_open_config(struct inode *inode, struct file *file) 584static int hotkey_open_config(struct inode *inode, struct file *file)
599{ 585{
600 ACPI_FUNCTION_TRACE("hotkey_open_config"); 586 return (single_open
601 return_VALUE(single_open
602 (file, hotkey_config_seq_show, PDE(inode)->data)); 587 (file, hotkey_config_seq_show, PDE(inode)->data));
603} 588}
604 589
605static int hotkey_poll_open_config(struct inode *inode, struct file *file) 590static int hotkey_poll_open_config(struct inode *inode, struct file *file)
606{ 591{
607 ACPI_FUNCTION_TRACE("hotkey_poll_open_config"); 592 return (single_open
608 return_VALUE(single_open
609 (file, hotkey_poll_config_seq_show, PDE(inode)->data)); 593 (file, hotkey_poll_config_seq_show, PDE(inode)->data));
610} 594}
611 595
@@ -618,7 +602,6 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
618 struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; 602 struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
619 struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name }; 603 struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
620 604
621 ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
622 605
623 list_for_each(entries, hotkey_list->entries) { 606 list_for_each(entries, hotkey_list->entries) {
624 union acpi_hotkey *key = 607 union acpi_hotkey *key =
@@ -636,7 +619,7 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset)
636 } 619 }
637 } 620 }
638 seq_puts(seq, "\n"); 621 seq_puts(seq, "\n");
639 return_VALUE(0); 622 return 0;
640} 623}
641 624
642static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset) 625static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
@@ -648,7 +631,6 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
648 struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; 631 struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name };
649 struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name }; 632 struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name };
650 633
651 ACPI_FUNCTION_TRACE(("hotkey_config_seq_show"));
652 634
653 list_for_each(entries, hotkey_list->entries) { 635 list_for_each(entries, hotkey_list->entries) {
654 union acpi_hotkey *key = 636 union acpi_hotkey *key =
@@ -666,7 +648,7 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset)
666 } 648 }
667 } 649 }
668 seq_puts(seq, "\n"); 650 seq_puts(seq, "\n");
669 return_VALUE(0); 651 return 0;
670} 652}
671 653
672static int 654static int
@@ -678,7 +660,6 @@ get_parms(char *config_record,
678 char **method, int *internal_event_num, int *external_event_num) 660 char **method, int *internal_event_num, int *external_event_num)
679{ 661{
680 char *tmp, *tmp1, count; 662 char *tmp, *tmp1, count;
681 ACPI_FUNCTION_TRACE(("get_parms"));
682 663
683 sscanf(config_record, "%d", cmd); 664 sscanf(config_record, "%d", cmd);
684 665
@@ -744,9 +725,9 @@ get_parms(char *config_record,
744 0) 725 0)
745 goto do_fail; 726 goto do_fail;
746 727
747 return_VALUE(6); 728 return 6;
748 do_fail: 729 do_fail:
749 return_VALUE(-1); 730 return -1;
750} 731}
751 732
752/* count is length for one input record */ 733/* count is length for one input record */
@@ -763,16 +744,15 @@ static ssize_t hotkey_write_config(struct file *file,
763 int ret = 0; 744 int ret = 0;
764 union acpi_hotkey *key = NULL; 745 union acpi_hotkey *key = NULL;
765 746
766 ACPI_FUNCTION_TRACE(("hotkey_write_config"));
767 747
768 config_record = (char *)kmalloc(count + 1, GFP_KERNEL); 748 config_record = (char *)kmalloc(count + 1, GFP_KERNEL);
769 if (!config_record) 749 if (!config_record)
770 return_VALUE(-ENOMEM); 750 return -ENOMEM;
771 751
772 if (copy_from_user(config_record, buffer, count)) { 752 if (copy_from_user(config_record, buffer, count)) {
773 kfree(config_record); 753 kfree(config_record);
774 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n")); 754 printk(KERN_ERR PREFIX "Invalid data\n");
775 return_VALUE(-EINVAL); 755 return -EINVAL;
776 } 756 }
777 config_record[count] = 0; 757 config_record[count] = 0;
778 758
@@ -792,9 +772,8 @@ static ssize_t hotkey_write_config(struct file *file,
792 kfree(bus_method); 772 kfree(bus_method);
793 kfree(action_handle); 773 kfree(action_handle);
794 kfree(method); 774 kfree(method);
795 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 775 printk(KERN_ERR PREFIX "Invalid data format ret=%d\n", ret);
796 "Invalid data format ret=%d\n", ret)); 776 return -EINVAL;
797 return_VALUE(-EINVAL);
798 } 777 }
799 778
800 key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL); 779 key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL);
@@ -806,7 +785,7 @@ static ssize_t hotkey_write_config(struct file *file,
806 tmp = get_hotkey_by_event(&global_hotkey_list, 785 tmp = get_hotkey_by_event(&global_hotkey_list,
807 internal_event_num); 786 internal_event_num);
808 if (!tmp) 787 if (!tmp)
809 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key")); 788 printk(KERN_ERR PREFIX "Invalid key\n");
810 else 789 else
811 memcpy(key, tmp, sizeof(union acpi_hotkey)); 790 memcpy(key, tmp, sizeof(union acpi_hotkey));
812 goto cont_cmd; 791 goto cont_cmd;
@@ -828,8 +807,8 @@ static ssize_t hotkey_write_config(struct file *file,
828 else 807 else
829 free_poll_hotkey_buffer(key); 808 free_poll_hotkey_buffer(key);
830 kfree(key); 809 kfree(key);
831 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n")); 810 printk(KERN_ERR PREFIX "Invalid hotkey\n");
832 return_VALUE(-EINVAL); 811 return -EINVAL;
833 } 812 }
834 813
835 cont_cmd: 814 cont_cmd:
@@ -855,15 +834,15 @@ static ssize_t hotkey_write_config(struct file *file,
855 goto fail_out; 834 goto fail_out;
856 break; 835 break;
857 } 836 }
858 return_VALUE(count); 837 return count;
859 fail_out: 838 fail_out:
860 if (IS_EVENT(internal_event_num)) 839 if (IS_EVENT(internal_event_num))
861 free_hotkey_buffer(key); 840 free_hotkey_buffer(key);
862 else 841 else
863 free_poll_hotkey_buffer(key); 842 free_poll_hotkey_buffer(key);
864 kfree(key); 843 kfree(key);
865 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n")); 844 printk(KERN_ERR PREFIX "invalid key\n");
866 return_VALUE(-EINVAL); 845 return -EINVAL;
867} 846}
868 847
869/* 848/*
@@ -880,7 +859,6 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
880 union acpi_object in_obj; /* the only param we use */ 859 union acpi_object in_obj; /* the only param we use */
881 acpi_status status; 860 acpi_status status;
882 861
883 ACPI_FUNCTION_TRACE("write_acpi_int");
884 params.count = 1; 862 params.count = 1;
885 params.pointer = &in_obj; 863 params.pointer = &in_obj;
886 in_obj.type = ACPI_TYPE_INTEGER; 864 in_obj.type = ACPI_TYPE_INTEGER;
@@ -888,7 +866,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
888 866
889 status = acpi_evaluate_object(handle, (char *)method, &params, output); 867 status = acpi_evaluate_object(handle, (char *)method, &params, output);
890 868
891 return_VALUE(status == AE_OK); 869 return (status == AE_OK);
892} 870}
893 871
894static int read_acpi_int(acpi_handle handle, const char *method, 872static int read_acpi_int(acpi_handle handle, const char *method,
@@ -898,7 +876,6 @@ static int read_acpi_int(acpi_handle handle, const char *method,
898 union acpi_object out_obj; 876 union acpi_object out_obj;
899 acpi_status status; 877 acpi_status status;
900 878
901 ACPI_FUNCTION_TRACE("read_acpi_int");
902 output.length = sizeof(out_obj); 879 output.length = sizeof(out_obj);
903 output.pointer = &out_obj; 880 output.pointer = &out_obj;
904 881
@@ -907,8 +884,8 @@ static int read_acpi_int(acpi_handle handle, const char *method,
907 val->integer.value = out_obj.integer.value; 884 val->integer.value = out_obj.integer.value;
908 val->type = out_obj.type; 885 val->type = out_obj.type;
909 } else 886 } else
910 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer")); 887 printk(KERN_ERR PREFIX "null val pointer\n");
911 return_VALUE((status == AE_OK) 888 return ((status == AE_OK)
912 && (out_obj.type == ACPI_TYPE_INTEGER)); 889 && (out_obj.type == ACPI_TYPE_INTEGER));
913} 890}
914 891
@@ -945,24 +922,23 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
945 int event, method_type, type, value; 922 int event, method_type, type, value;
946 union acpi_hotkey *key; 923 union acpi_hotkey *key;
947 924
948 ACPI_FUNCTION_TRACE("hotkey_execte_aml_method");
949 925
950 arg = (char *)kmalloc(count + 1, GFP_KERNEL); 926 arg = (char *)kmalloc(count + 1, GFP_KERNEL);
951 if (!arg) 927 if (!arg)
952 return_VALUE(-ENOMEM); 928 return -ENOMEM;
953 arg[count] = 0; 929 arg[count] = 0;
954 930
955 if (copy_from_user(arg, buffer, count)) { 931 if (copy_from_user(arg, buffer, count)) {
956 kfree(arg); 932 kfree(arg);
957 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2")); 933 printk(KERN_ERR PREFIX "Invalid argument 2\n");
958 return_VALUE(-EINVAL); 934 return -EINVAL;
959 } 935 }
960 936
961 if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) != 937 if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
962 4) { 938 4) {
963 kfree(arg); 939 kfree(arg);
964 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3")); 940 printk(KERN_ERR PREFIX "Invalid argument 3\n");
965 return_VALUE(-EINVAL); 941 return -EINVAL;
966 } 942 }
967 kfree(arg); 943 kfree(arg);
968 if (type == ACPI_TYPE_INTEGER) { 944 if (type == ACPI_TYPE_INTEGER) {
@@ -987,12 +963,12 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
987 963
988 } 964 }
989 } else { 965 } else {
990 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported")); 966 printk(KERN_WARNING "Not supported\n");
991 return_VALUE(-EINVAL); 967 return -EINVAL;
992 } 968 }
993 return_VALUE(count); 969 return count;
994 do_fail: 970 do_fail:
995 return_VALUE(-EINVAL); 971 return -EINVAL;
996 972
997} 973}
998 974
@@ -1001,7 +977,6 @@ static int __init hotkey_init(void)
1001 int result; 977 int result;
1002 mode_t mode = S_IFREG | S_IRUGO | S_IWUGO; 978 mode_t mode = S_IFREG | S_IRUGO | S_IWUGO;
1003 979
1004 ACPI_FUNCTION_TRACE("hotkey_init");
1005 980
1006 if (acpi_disabled) 981 if (acpi_disabled)
1007 return -ENODEV; 982 return -ENODEV;
@@ -1013,9 +988,6 @@ static int __init hotkey_init(void)
1013 988
1014 hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir); 989 hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
1015 if (!hotkey_proc_dir) { 990 if (!hotkey_proc_dir) {
1016 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1017 "Hotkey: Unable to create %s entry\n",
1018 HOTKEY_PROC));
1019 return (-ENODEV); 991 return (-ENODEV);
1020 } 992 }
1021 hotkey_proc_dir->owner = THIS_MODULE; 993 hotkey_proc_dir->owner = THIS_MODULE;
@@ -1023,9 +995,6 @@ static int __init hotkey_init(void)
1023 hotkey_config = 995 hotkey_config =
1024 create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir); 996 create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
1025 if (!hotkey_config) { 997 if (!hotkey_config) {
1026 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1027 "Hotkey: Unable to create %s entry\n",
1028 HOTKEY_EV_CONFIG));
1029 goto do_fail1; 998 goto do_fail1;
1030 } else { 999 } else {
1031 hotkey_config->proc_fops = &hotkey_config_fops; 1000 hotkey_config->proc_fops = &hotkey_config_fops;
@@ -1038,10 +1007,6 @@ static int __init hotkey_init(void)
1038 hotkey_poll_config = 1007 hotkey_poll_config =
1039 create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir); 1008 create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
1040 if (!hotkey_poll_config) { 1009 if (!hotkey_poll_config) {
1041 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1042 "Hotkey: Unable to create %s entry\n",
1043 HOTKEY_EV_CONFIG));
1044
1045 goto do_fail2; 1010 goto do_fail2;
1046 } else { 1011 } else {
1047 hotkey_poll_config->proc_fops = &hotkey_poll_config_fops; 1012 hotkey_poll_config->proc_fops = &hotkey_poll_config_fops;
@@ -1053,9 +1018,6 @@ static int __init hotkey_init(void)
1053 1018
1054 hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir); 1019 hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir);
1055 if (!hotkey_action) { 1020 if (!hotkey_action) {
1056 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1057 "Hotkey: Unable to create %s entry\n",
1058 HOTKEY_ACTION));
1059 goto do_fail3; 1021 goto do_fail3;
1060 } else { 1022 } else {
1061 hotkey_action->proc_fops = &hotkey_action_fops; 1023 hotkey_action->proc_fops = &hotkey_action_fops;
@@ -1066,9 +1028,6 @@ static int __init hotkey_init(void)
1066 1028
1067 hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir); 1029 hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir);
1068 if (!hotkey_info) { 1030 if (!hotkey_info) {
1069 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1070 "Hotkey: Unable to create %s entry\n",
1071 HOTKEY_INFO));
1072 goto do_fail4; 1031 goto do_fail4;
1073 } else { 1032 } else {
1074 hotkey_info->proc_fops = &hotkey_info_fops; 1033 hotkey_info->proc_fops = &hotkey_info_fops;
@@ -1104,7 +1063,6 @@ static void __exit hotkey_exit(void)
1104{ 1063{
1105 struct list_head *entries, *next; 1064 struct list_head *entries, *next;
1106 1065
1107 ACPI_FUNCTION_TRACE("hotkey_exit");
1108 1066
1109 list_for_each_safe(entries, next, global_hotkey_list.entries) { 1067 list_for_each_safe(entries, next, global_hotkey_list.entries) {
1110 union acpi_hotkey *key = 1068 union acpi_hotkey *key =
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c
index d51d68f5dd8d..ec6b7f9ede34 100644
--- a/drivers/acpi/motherboard.c
+++ b/drivers/acpi/motherboard.c
@@ -52,13 +52,12 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
52{ 52{
53 struct resource *requested_res = NULL; 53 struct resource *requested_res = NULL;
54 54
55 ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
56 55
57 if (res->type == ACPI_RESOURCE_TYPE_IO) { 56 if (res->type == ACPI_RESOURCE_TYPE_IO) {
58 struct acpi_resource_io *io_res = &res->data.io; 57 struct acpi_resource_io *io_res = &res->data.io;
59 58
60 if (io_res->minimum != io_res->maximum) 59 if (io_res->minimum != io_res->maximum)
61 return_VALUE(AE_OK); 60 return AE_OK;
62 if (IS_RESERVED_ADDR 61 if (IS_RESERVED_ADDR
63 (io_res->minimum, io_res->address_length)) { 62 (io_res->minimum, io_res->address_length)) {
64 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 63 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -92,7 +91,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
92 91
93 if (requested_res) 92 if (requested_res)
94 requested_res->flags &= ~IORESOURCE_BUSY; 93 requested_res->flags &= ~IORESOURCE_BUSY;
95 return_VALUE(AE_OK); 94 return AE_OK;
96} 95}
97 96
98static int acpi_motherboard_add(struct acpi_device *device) 97static int acpi_motherboard_add(struct acpi_device *device)
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index 48fadade52e2..c1c6c236df9a 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -196,33 +196,30 @@ acpi_status acpi_ns_root_initialize(void)
196 (u8) (ACPI_TO_INTEGER(val) - 1); 196 (u8) (ACPI_TO_INTEGER(val) - 1);
197 197
198 if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { 198 if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
199 /* 199
200 * Create a counting semaphore for the 200 /* Create a counting semaphore for the global lock */
201 * global lock 201
202 */
203 status = 202 status =
204 acpi_os_create_semaphore 203 acpi_os_create_semaphore
205 (ACPI_NO_UNIT_LIMIT, 1, 204 (ACPI_NO_UNIT_LIMIT, 1,
206 &obj_desc->mutex.semaphore); 205 &acpi_gbl_global_lock_semaphore);
207 if (ACPI_FAILURE(status)) { 206 if (ACPI_FAILURE(status)) {
208 acpi_ut_remove_reference 207 acpi_ut_remove_reference
209 (obj_desc); 208 (obj_desc);
210 goto unlock_and_exit; 209 goto unlock_and_exit;
211 } 210 }
212 211
213 /* 212 /* Mark this mutex as very special */
214 * We just created the mutex for the 213
215 * global lock, save it 214 obj_desc->mutex.os_mutex =
216 */ 215 ACPI_GLOBAL_LOCK;
217 acpi_gbl_global_lock_semaphore =
218 obj_desc->mutex.semaphore;
219 } else { 216 } else {
220 /* Create a mutex */ 217 /* Create a mutex */
221 218
222 status = acpi_os_create_semaphore(1, 1, 219 status =
223 &obj_desc-> 220 acpi_os_create_mutex(&obj_desc->
224 mutex. 221 mutex.
225 semaphore); 222 os_mutex);
226 if (ACPI_FAILURE(status)) { 223 if (ACPI_FAILURE(status)) {
227 acpi_ut_remove_reference 224 acpi_ut_remove_reference
228 (obj_desc); 225 (obj_desc);
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 13d6d5bdea26..4d622981f61a 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/config.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/types.h> 28#include <linux/types.h>
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 1bb558adee66..5dd2ed11a387 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -25,7 +25,6 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
@@ -137,6 +136,7 @@ void acpi_os_vprintf(const char *fmt, va_list args)
137#endif 136#endif
138} 137}
139 138
139
140extern int acpi_in_resume; 140extern int acpi_in_resume;
141void *acpi_os_allocate(acpi_size size) 141void *acpi_os_allocate(acpi_size size)
142{ 142{
@@ -586,19 +586,18 @@ static void acpi_os_execute_deferred(void *context)
586{ 586{
587 struct acpi_os_dpc *dpc = NULL; 587 struct acpi_os_dpc *dpc = NULL;
588 588
589 ACPI_FUNCTION_TRACE("os_execute_deferred");
590 589
591 dpc = (struct acpi_os_dpc *)context; 590 dpc = (struct acpi_os_dpc *)context;
592 if (!dpc) { 591 if (!dpc) {
593 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); 592 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
594 return_VOID; 593 return;
595 } 594 }
596 595
597 dpc->function(dpc->context); 596 dpc->function(dpc->context);
598 597
599 kfree(dpc); 598 kfree(dpc);
600 599
601 return_VOID; 600 return;
602} 601}
603 602
604static int acpi_os_execute_thread(void *context) 603static int acpi_os_execute_thread(void *context)
@@ -688,35 +687,19 @@ EXPORT_SYMBOL(acpi_os_wait_events_complete);
688/* 687/*
689 * Allocate the memory for a spinlock and initialize it. 688 * Allocate the memory for a spinlock and initialize it.
690 */ 689 */
691acpi_status acpi_os_create_lock(acpi_handle * out_handle) 690acpi_status acpi_os_create_lock(acpi_spinlock * handle)
692{ 691{
693 spinlock_t *lock_ptr; 692 spin_lock_init(*handle);
694
695 ACPI_FUNCTION_TRACE("os_create_lock");
696
697 lock_ptr = acpi_os_allocate(sizeof(spinlock_t));
698
699 spin_lock_init(lock_ptr);
700
701 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating spinlock[%p].\n", lock_ptr));
702 693
703 *out_handle = lock_ptr; 694 return AE_OK;
704
705 return_ACPI_STATUS(AE_OK);
706} 695}
707 696
708/* 697/*
709 * Deallocate the memory for a spinlock. 698 * Deallocate the memory for a spinlock.
710 */ 699 */
711void acpi_os_delete_lock(acpi_handle handle) 700void acpi_os_delete_lock(acpi_spinlock handle)
712{ 701{
713 ACPI_FUNCTION_TRACE("os_create_lock"); 702 return;
714
715 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting spinlock[%p].\n", handle));
716
717 acpi_os_free(handle);
718
719 return_VOID;
720} 703}
721 704
722acpi_status 705acpi_status
@@ -724,11 +707,10 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
724{ 707{
725 struct semaphore *sem = NULL; 708 struct semaphore *sem = NULL;
726 709
727 ACPI_FUNCTION_TRACE("os_create_semaphore");
728 710
729 sem = acpi_os_allocate(sizeof(struct semaphore)); 711 sem = acpi_os_allocate(sizeof(struct semaphore));
730 if (!sem) 712 if (!sem)
731 return_ACPI_STATUS(AE_NO_MEMORY); 713 return AE_NO_MEMORY;
732 memset(sem, 0, sizeof(struct semaphore)); 714 memset(sem, 0, sizeof(struct semaphore));
733 715
734 sema_init(sem, initial_units); 716 sema_init(sem, initial_units);
@@ -738,7 +720,7 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
738 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n", 720 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n",
739 *handle, initial_units)); 721 *handle, initial_units));
740 722
741 return_ACPI_STATUS(AE_OK); 723 return AE_OK;
742} 724}
743 725
744EXPORT_SYMBOL(acpi_os_create_semaphore); 726EXPORT_SYMBOL(acpi_os_create_semaphore);
@@ -754,17 +736,16 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
754{ 736{
755 struct semaphore *sem = (struct semaphore *)handle; 737 struct semaphore *sem = (struct semaphore *)handle;
756 738
757 ACPI_FUNCTION_TRACE("os_delete_semaphore");
758 739
759 if (!sem) 740 if (!sem)
760 return_ACPI_STATUS(AE_BAD_PARAMETER); 741 return AE_BAD_PARAMETER;
761 742
762 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle)); 743 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));
763 744
764 acpi_os_free(sem); 745 acpi_os_free(sem);
765 sem = NULL; 746 sem = NULL;
766 747
767 return_ACPI_STATUS(AE_OK); 748 return AE_OK;
768} 749}
769 750
770EXPORT_SYMBOL(acpi_os_delete_semaphore); 751EXPORT_SYMBOL(acpi_os_delete_semaphore);
@@ -784,13 +765,12 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
784 struct semaphore *sem = (struct semaphore *)handle; 765 struct semaphore *sem = (struct semaphore *)handle;
785 int ret = 0; 766 int ret = 0;
786 767
787 ACPI_FUNCTION_TRACE("os_wait_semaphore");
788 768
789 if (!sem || (units < 1)) 769 if (!sem || (units < 1))
790 return_ACPI_STATUS(AE_BAD_PARAMETER); 770 return AE_BAD_PARAMETER;
791 771
792 if (units > 1) 772 if (units > 1)
793 return_ACPI_STATUS(AE_SUPPORT); 773 return AE_SUPPORT;
794 774
795 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n", 775 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
796 handle, units, timeout)); 776 handle, units, timeout));
@@ -839,17 +819,17 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
839 } 819 }
840 820
841 if (ACPI_FAILURE(status)) { 821 if (ACPI_FAILURE(status)) {
842 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 822 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
843 "Failed to acquire semaphore[%p|%d|%d], %s\n", 823 "Failed to acquire semaphore[%p|%d|%d], %s",
844 handle, units, timeout, 824 handle, units, timeout,
845 acpi_format_exception(status))); 825 acpi_format_exception(status)));
846 } else { 826 } else {
847 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 827 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
848 "Acquired semaphore[%p|%d|%d]\n", handle, 828 "Acquired semaphore[%p|%d|%d]", handle,
849 units, timeout)); 829 units, timeout));
850 } 830 }
851 831
852 return_ACPI_STATUS(status); 832 return status;
853} 833}
854 834
855EXPORT_SYMBOL(acpi_os_wait_semaphore); 835EXPORT_SYMBOL(acpi_os_wait_semaphore);
@@ -861,20 +841,19 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
861{ 841{
862 struct semaphore *sem = (struct semaphore *)handle; 842 struct semaphore *sem = (struct semaphore *)handle;
863 843
864 ACPI_FUNCTION_TRACE("os_signal_semaphore");
865 844
866 if (!sem || (units < 1)) 845 if (!sem || (units < 1))
867 return_ACPI_STATUS(AE_BAD_PARAMETER); 846 return AE_BAD_PARAMETER;
868 847
869 if (units > 1) 848 if (units > 1)
870 return_ACPI_STATUS(AE_SUPPORT); 849 return AE_SUPPORT;
871 850
872 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle, 851 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
873 units)); 852 units));
874 853
875 up(sem); 854 up(sem);
876 855
877 return_ACPI_STATUS(AE_OK); 856 return AE_OK;
878} 857}
879 858
880EXPORT_SYMBOL(acpi_os_signal_semaphore); 859EXPORT_SYMBOL(acpi_os_signal_semaphore);
@@ -1043,10 +1022,10 @@ EXPORT_SYMBOL(max_cstate);
1043 * handle is a pointer to the spinlock_t. 1022 * handle is a pointer to the spinlock_t.
1044 */ 1023 */
1045 1024
1046acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle) 1025acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
1047{ 1026{
1048 acpi_cpu_flags flags; 1027 acpi_cpu_flags flags;
1049 spin_lock_irqsave((spinlock_t *) handle, flags); 1028 spin_lock_irqsave(lockp, flags);
1050 return flags; 1029 return flags;
1051} 1030}
1052 1031
@@ -1054,9 +1033,9 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle)
1054 * Release a spinlock. See above. 1033 * Release a spinlock. See above.
1055 */ 1034 */
1056 1035
1057void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags) 1036void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
1058{ 1037{
1059 spin_unlock_irqrestore((spinlock_t *) handle, flags); 1038 spin_unlock_irqrestore(lockp, flags);
1060} 1039}
1061 1040
1062#ifndef ACPI_USE_LOCAL_CACHE 1041#ifndef ACPI_USE_LOCAL_CACHE
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index 7ee2f2e77525..a02aa62fe1e5 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -469,6 +469,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
469 } 469 }
470 470
471 walk_state->thread = thread; 471 walk_state->thread = thread;
472
473 /*
474 * If executing a method, the starting sync_level is this method's
475 * sync_level
476 */
477 if (walk_state->method_desc) {
478 walk_state->thread->current_sync_level =
479 walk_state->method_desc->method.sync_level;
480 }
481
472 acpi_ds_push_walk_state(walk_state, thread); 482 acpi_ds_push_walk_state(walk_state, thread);
473 483
474 /* 484 /*
@@ -505,6 +515,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
505 status = 515 status =
506 acpi_ds_call_control_method(thread, walk_state, 516 acpi_ds_call_control_method(thread, walk_state,
507 NULL); 517 NULL);
518 if (ACPI_FAILURE(status)) {
519 status =
520 acpi_ds_method_error(status, walk_state);
521 }
508 522
509 /* 523 /*
510 * If the transfer to the new method method call worked, a new walk 524 * If the transfer to the new method method call worked, a new walk
@@ -525,7 +539,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
525 /* Check for possible multi-thread reentrancy problem */ 539 /* Check for possible multi-thread reentrancy problem */
526 540
527 if ((status == AE_ALREADY_EXISTS) && 541 if ((status == AE_ALREADY_EXISTS) &&
528 (!walk_state->method_desc->method.semaphore)) { 542 (!walk_state->method_desc->method.mutex)) {
529 /* 543 /*
530 * Method tried to create an object twice. The probable cause is 544 * Method tried to create an object twice. The probable cause is
531 * that the method cannot handle reentrancy. 545 * that the method cannot handle reentrancy.
@@ -537,7 +551,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
537 */ 551 */
538 walk_state->method_desc->method.method_flags |= 552 walk_state->method_desc->method.method_flags |=
539 AML_METHOD_SERIALIZED; 553 AML_METHOD_SERIALIZED;
540 walk_state->method_desc->method.concurrency = 1; 554 walk_state->method_desc->method.sync_level = 0;
541 } 555 }
542 } 556 }
543 557
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 2a718df769b5..1e2ae6e7a7e4 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -47,11 +47,10 @@ struct acpi_pci_data {
47static void acpi_pci_data_handler(acpi_handle handle, u32 function, 47static void acpi_pci_data_handler(acpi_handle handle, u32 function,
48 void *context) 48 void *context)
49{ 49{
50 ACPI_FUNCTION_TRACE("acpi_pci_data_handler");
51 50
52 /* TBD: Anything we need to do here? */ 51 /* TBD: Anything we need to do here? */
53 52
54 return_VOID; 53 return;
55} 54}
56 55
57/** 56/**
@@ -68,25 +67,24 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
68 struct acpi_device *device = NULL; 67 struct acpi_device *device = NULL;
69 struct acpi_pci_data *data = NULL; 68 struct acpi_pci_data *data = NULL;
70 69
71 ACPI_FUNCTION_TRACE("acpi_get_pci_id");
72 70
73 if (!id) 71 if (!id)
74 return_ACPI_STATUS(AE_BAD_PARAMETER); 72 return AE_BAD_PARAMETER;
75 73
76 result = acpi_bus_get_device(handle, &device); 74 result = acpi_bus_get_device(handle, &device);
77 if (result) { 75 if (result) {
78 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 76 printk(KERN_ERR PREFIX
79 "Invalid ACPI Bus context for device %s\n", 77 "Invalid ACPI Bus context for device %s\n",
80 acpi_device_bid(device))); 78 acpi_device_bid(device));
81 return_ACPI_STATUS(AE_NOT_EXIST); 79 return AE_NOT_EXIST;
82 } 80 }
83 81
84 status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data); 82 status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
85 if (ACPI_FAILURE(status) || !data) { 83 if (ACPI_FAILURE(status) || !data) {
86 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 84 ACPI_EXCEPTION((AE_INFO, status,
87 "Invalid ACPI-PCI context for device %s\n", 85 "Invalid ACPI-PCI context for device %s",
88 acpi_device_bid(device))); 86 acpi_device_bid(device)));
89 return_ACPI_STATUS(status); 87 return status;
90 } 88 }
91 89
92 *id = data->id; 90 *id = data->id;
@@ -103,7 +101,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
103 acpi_device_bid(device), id->segment, id->bus, 101 acpi_device_bid(device), id->segment, id->bus,
104 id->device, id->function)); 102 id->device, id->function));
105 103
106 return_ACPI_STATUS(AE_OK); 104 return AE_OK;
107} 105}
108 106
109EXPORT_SYMBOL(acpi_get_pci_id); 107EXPORT_SYMBOL(acpi_get_pci_id);
@@ -120,14 +118,13 @@ int acpi_pci_bind(struct acpi_device *device)
120 struct pci_dev *dev; 118 struct pci_dev *dev;
121 struct pci_bus *bus; 119 struct pci_bus *bus;
122 120
123 ACPI_FUNCTION_TRACE("acpi_pci_bind");
124 121
125 if (!device || !device->parent) 122 if (!device || !device->parent)
126 return_VALUE(-EINVAL); 123 return -EINVAL;
127 124
128 pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 125 pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
129 if (!pathname) 126 if (!pathname)
130 return_VALUE(-ENOMEM); 127 return -ENOMEM;
131 memset(pathname, 0, ACPI_PATHNAME_MAX); 128 memset(pathname, 0, ACPI_PATHNAME_MAX);
132 buffer.length = ACPI_PATHNAME_MAX; 129 buffer.length = ACPI_PATHNAME_MAX;
133 buffer.pointer = pathname; 130 buffer.pointer = pathname;
@@ -135,7 +132,7 @@ int acpi_pci_bind(struct acpi_device *device)
135 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); 132 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
136 if (!data) { 133 if (!data) {
137 kfree(pathname); 134 kfree(pathname);
138 return_VALUE(-ENOMEM); 135 return -ENOMEM;
139 } 136 }
140 memset(data, 0, sizeof(struct acpi_pci_data)); 137 memset(data, 0, sizeof(struct acpi_pci_data));
141 138
@@ -151,9 +148,9 @@ int acpi_pci_bind(struct acpi_device *device)
151 status = acpi_get_data(device->parent->handle, acpi_pci_data_handler, 148 status = acpi_get_data(device->parent->handle, acpi_pci_data_handler,
152 (void **)&pdata); 149 (void **)&pdata);
153 if (ACPI_FAILURE(status) || !pdata || !pdata->bus) { 150 if (ACPI_FAILURE(status) || !pdata || !pdata->bus) {
154 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 151 ACPI_EXCEPTION((AE_INFO, status,
155 "Invalid ACPI-PCI context for parent device %s\n", 152 "Invalid ACPI-PCI context for parent device %s",
156 acpi_device_bid(device->parent))); 153 acpi_device_bid(device->parent)));
157 result = -ENODEV; 154 result = -ENODEV;
158 goto end; 155 goto end;
159 } 156 }
@@ -206,10 +203,10 @@ int acpi_pci_bind(struct acpi_device *device)
206 goto end; 203 goto end;
207 } 204 }
208 if (!data->dev->bus) { 205 if (!data->dev->bus) {
209 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 206 printk(KERN_ERR PREFIX
210 "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n", 207 "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n",
211 data->id.segment, data->id.bus, 208 data->id.segment, data->id.bus,
212 data->id.device, data->id.function)); 209 data->id.device, data->id.function);
213 result = -ENODEV; 210 result = -ENODEV;
214 goto end; 211 goto end;
215 } 212 }
@@ -237,9 +234,9 @@ int acpi_pci_bind(struct acpi_device *device)
237 */ 234 */
238 status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); 235 status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
239 if (ACPI_FAILURE(status)) { 236 if (ACPI_FAILURE(status)) {
240 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 237 ACPI_EXCEPTION((AE_INFO, status,
241 "Unable to attach ACPI-PCI context to device %s\n", 238 "Unable to attach ACPI-PCI context to device %s",
242 acpi_device_bid(device))); 239 acpi_device_bid(device)));
243 result = -ENODEV; 240 result = -ENODEV;
244 goto end; 241 goto end;
245 } 242 }
@@ -269,7 +266,7 @@ int acpi_pci_bind(struct acpi_device *device)
269 if (result) 266 if (result)
270 kfree(data); 267 kfree(data);
271 268
272 return_VALUE(result); 269 return result;
273} 270}
274 271
275int acpi_pci_unbind(struct acpi_device *device) 272int acpi_pci_unbind(struct acpi_device *device)
@@ -280,14 +277,13 @@ int acpi_pci_unbind(struct acpi_device *device)
280 char *pathname = NULL; 277 char *pathname = NULL;
281 struct acpi_buffer buffer = { 0, NULL }; 278 struct acpi_buffer buffer = { 0, NULL };
282 279
283 ACPI_FUNCTION_TRACE("acpi_pci_unbind");
284 280
285 if (!device || !device->parent) 281 if (!device || !device->parent)
286 return_VALUE(-EINVAL); 282 return -EINVAL;
287 283
288 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 284 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
289 if (!pathname) 285 if (!pathname)
290 return_VALUE(-ENOMEM); 286 return -ENOMEM;
291 memset(pathname, 0, ACPI_PATHNAME_MAX); 287 memset(pathname, 0, ACPI_PATHNAME_MAX);
292 288
293 buffer.length = ACPI_PATHNAME_MAX; 289 buffer.length = ACPI_PATHNAME_MAX;
@@ -301,18 +297,18 @@ int acpi_pci_unbind(struct acpi_device *device)
301 acpi_get_data(device->handle, acpi_pci_data_handler, 297 acpi_get_data(device->handle, acpi_pci_data_handler,
302 (void **)&data); 298 (void **)&data);
303 if (ACPI_FAILURE(status)) { 299 if (ACPI_FAILURE(status)) {
304 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 300 ACPI_EXCEPTION((AE_INFO, status,
305 "Unable to get data from device %s\n", 301 "Unable to get data from device %s",
306 acpi_device_bid(device))); 302 acpi_device_bid(device)));
307 result = -ENODEV; 303 result = -ENODEV;
308 goto end; 304 goto end;
309 } 305 }
310 306
311 status = acpi_detach_data(device->handle, acpi_pci_data_handler); 307 status = acpi_detach_data(device->handle, acpi_pci_data_handler);
312 if (ACPI_FAILURE(status)) { 308 if (ACPI_FAILURE(status)) {
313 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 309 ACPI_EXCEPTION((AE_INFO, status,
314 "Unable to detach data from device %s\n", 310 "Unable to detach data from device %s",
315 acpi_device_bid(device))); 311 acpi_device_bid(device)));
316 result = -ENODEV; 312 result = -ENODEV;
317 goto end; 313 goto end;
318 } 314 }
@@ -322,7 +318,7 @@ int acpi_pci_unbind(struct acpi_device *device)
322 kfree(data); 318 kfree(data);
323 319
324 end: 320 end:
325 return_VALUE(result); 321 return result;
326} 322}
327 323
328int 324int
@@ -335,11 +331,10 @@ acpi_pci_bind_root(struct acpi_device *device,
335 char *pathname = NULL; 331 char *pathname = NULL;
336 struct acpi_buffer buffer = { 0, NULL }; 332 struct acpi_buffer buffer = { 0, NULL };
337 333
338 ACPI_FUNCTION_TRACE("acpi_pci_bind_root");
339 334
340 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 335 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
341 if (!pathname) 336 if (!pathname)
342 return_VALUE(-ENOMEM); 337 return -ENOMEM;
343 memset(pathname, 0, ACPI_PATHNAME_MAX); 338 memset(pathname, 0, ACPI_PATHNAME_MAX);
344 339
345 buffer.length = ACPI_PATHNAME_MAX; 340 buffer.length = ACPI_PATHNAME_MAX;
@@ -347,13 +342,13 @@ acpi_pci_bind_root(struct acpi_device *device,
347 342
348 if (!device || !id || !bus) { 343 if (!device || !id || !bus) {
349 kfree(pathname); 344 kfree(pathname);
350 return_VALUE(-EINVAL); 345 return -EINVAL;
351 } 346 }
352 347
353 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); 348 data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
354 if (!data) { 349 if (!data) {
355 kfree(pathname); 350 kfree(pathname);
356 return_VALUE(-ENOMEM); 351 return -ENOMEM;
357 } 352 }
358 memset(data, 0, sizeof(struct acpi_pci_data)); 353 memset(data, 0, sizeof(struct acpi_pci_data));
359 354
@@ -369,9 +364,9 @@ acpi_pci_bind_root(struct acpi_device *device,
369 364
370 status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); 365 status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
371 if (ACPI_FAILURE(status)) { 366 if (ACPI_FAILURE(status)) {
372 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 367 ACPI_EXCEPTION((AE_INFO, status,
373 "Unable to attach ACPI-PCI context to device %s\n", 368 "Unable to attach ACPI-PCI context to device %s",
374 pathname)); 369 pathname));
375 result = -ENODEV; 370 result = -ENODEV;
376 goto end; 371 goto end;
377 } 372 }
@@ -381,5 +376,5 @@ acpi_pci_bind_root(struct acpi_device *device,
381 if (result != 0) 376 if (result != 0)
382 kfree(data); 377 kfree(data);
383 378
384 return_VALUE(result); 379 return result;
385} 380}
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 65aee79b3971..feda0341f5a7 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -24,7 +24,6 @@
24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25 */ 25 */
26 26
27#include <linux/config.h>
28 27
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/module.h> 29#include <linux/module.h>
@@ -55,10 +54,9 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
55 struct list_head *node = NULL; 54 struct list_head *node = NULL;
56 struct acpi_prt_entry *entry = NULL; 55 struct acpi_prt_entry *entry = NULL;
57 56
58 ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry");
59 57
60 if (!acpi_prt.count) 58 if (!acpi_prt.count)
61 return_PTR(NULL); 59 return NULL;
62 60
63 /* 61 /*
64 * Parse through all PRT entries looking for a match on the specified 62 * Parse through all PRT entries looking for a match on the specified
@@ -73,12 +71,12 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
73 && (device == entry->id.device) 71 && (device == entry->id.device)
74 && (pin == entry->pin)) { 72 && (pin == entry->pin)) {
75 spin_unlock(&acpi_prt_lock); 73 spin_unlock(&acpi_prt_lock);
76 return_PTR(entry); 74 return entry;
77 } 75 }
78 } 76 }
79 77
80 spin_unlock(&acpi_prt_lock); 78 spin_unlock(&acpi_prt_lock);
81 return_PTR(NULL); 79 return NULL;
82} 80}
83 81
84static int 82static int
@@ -87,14 +85,13 @@ acpi_pci_irq_add_entry(acpi_handle handle,
87{ 85{
88 struct acpi_prt_entry *entry = NULL; 86 struct acpi_prt_entry *entry = NULL;
89 87
90 ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry");
91 88
92 if (!prt) 89 if (!prt)
93 return_VALUE(-EINVAL); 90 return -EINVAL;
94 91
95 entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); 92 entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
96 if (!entry) 93 if (!entry)
97 return_VALUE(-ENOMEM); 94 return -ENOMEM;
98 memset(entry, 0, sizeof(struct acpi_prt_entry)); 95 memset(entry, 0, sizeof(struct acpi_prt_entry));
99 96
100 entry->id.segment = segment; 97 entry->id.segment = segment;
@@ -141,7 +138,7 @@ acpi_pci_irq_add_entry(acpi_handle handle,
141 acpi_prt.count++; 138 acpi_prt.count++;
142 spin_unlock(&acpi_prt_lock); 139 spin_unlock(&acpi_prt_lock);
143 140
144 return_VALUE(0); 141 return 0;
145} 142}
146 143
147static void 144static void
@@ -163,11 +160,10 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
163 struct acpi_pci_routing_table *entry = NULL; 160 struct acpi_pci_routing_table *entry = NULL;
164 static int first_time = 1; 161 static int first_time = 1;
165 162
166 ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");
167 163
168 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 164 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
169 if (!pathname) 165 if (!pathname)
170 return_VALUE(-ENOMEM); 166 return -ENOMEM;
171 memset(pathname, 0, ACPI_PATHNAME_MAX); 167 memset(pathname, 0, ACPI_PATHNAME_MAX);
172 168
173 if (first_time) { 169 if (first_time) {
@@ -197,24 +193,24 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
197 kfree(pathname); 193 kfree(pathname);
198 status = acpi_get_irq_routing_table(handle, &buffer); 194 status = acpi_get_irq_routing_table(handle, &buffer);
199 if (status != AE_BUFFER_OVERFLOW) { 195 if (status != AE_BUFFER_OVERFLOW) {
200 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", 196 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
201 acpi_format_exception(status))); 197 acpi_format_exception(status)));
202 return_VALUE(-ENODEV); 198 return -ENODEV;
203 } 199 }
204 200
205 prt = kmalloc(buffer.length, GFP_KERNEL); 201 prt = kmalloc(buffer.length, GFP_KERNEL);
206 if (!prt) { 202 if (!prt) {
207 return_VALUE(-ENOMEM); 203 return -ENOMEM;
208 } 204 }
209 memset(prt, 0, buffer.length); 205 memset(prt, 0, buffer.length);
210 buffer.pointer = prt; 206 buffer.pointer = prt;
211 207
212 status = acpi_get_irq_routing_table(handle, &buffer); 208 status = acpi_get_irq_routing_table(handle, &buffer);
213 if (ACPI_FAILURE(status)) { 209 if (ACPI_FAILURE(status)) {
214 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", 210 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
215 acpi_format_exception(status))); 211 acpi_format_exception(status)));
216 kfree(buffer.pointer); 212 kfree(buffer.pointer);
217 return_VALUE(-ENODEV); 213 return -ENODEV;
218 } 214 }
219 215
220 entry = prt; 216 entry = prt;
@@ -227,7 +223,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
227 223
228 kfree(prt); 224 kfree(prt);
229 225
230 return_VALUE(0); 226 return 0;
231} 227}
232 228
233void acpi_pci_irq_del_prt(int segment, int bus) 229void acpi_pci_irq_del_prt(int segment, int bus)
@@ -262,16 +258,15 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
262{ 258{
263 int irq; 259 int irq;
264 260
265 ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");
266 261
267 if (entry->link.handle) { 262 if (entry->link.handle) {
268 irq = acpi_pci_link_allocate_irq(entry->link.handle, 263 irq = acpi_pci_link_allocate_irq(entry->link.handle,
269 entry->link.index, triggering, 264 entry->link.index, triggering,
270 polarity, link); 265 polarity, link);
271 if (irq < 0) { 266 if (irq < 0) {
272 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 267 printk(KERN_WARNING PREFIX
273 "Invalid IRQ link routing entry\n")); 268 "Invalid IRQ link routing entry\n");
274 return_VALUE(-1); 269 return -1;
275 } 270 }
276 } else { 271 } else {
277 irq = entry->link.index; 272 irq = entry->link.index;
@@ -280,7 +275,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
280 } 275 }
281 276
282 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); 277 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
283 return_VALUE(irq); 278 return irq;
284} 279}
285 280
286static int 281static int
@@ -289,13 +284,12 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,
289{ 284{
290 int irq; 285 int irq;
291 286
292 ACPI_FUNCTION_TRACE("acpi_pci_free_irq");
293 if (entry->link.handle) { 287 if (entry->link.handle) {
294 irq = acpi_pci_link_free_irq(entry->link.handle); 288 irq = acpi_pci_link_free_irq(entry->link.handle);
295 } else { 289 } else {
296 irq = entry->link.index; 290 irq = entry->link.index;
297 } 291 }
298 return_VALUE(irq); 292 return irq;
299} 293}
300 294
301/* 295/*
@@ -315,7 +309,6 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
315 int bus_nr = bus->number; 309 int bus_nr = bus->number;
316 int ret; 310 int ret;
317 311
318 ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
319 312
320 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 313 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
321 "Searching for PRT entry for %02x:%02x:%02x[%c]\n", 314 "Searching for PRT entry for %02x:%02x:%02x[%c]\n",
@@ -324,11 +317,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
324 entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin); 317 entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin);
325 if (!entry) { 318 if (!entry) {
326 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); 319 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
327 return_VALUE(-1); 320 return -1;
328 } 321 }
329 322
330 ret = func(entry, triggering, polarity, link); 323 ret = func(entry, triggering, polarity, link);
331 return_VALUE(ret); 324 return ret;
332} 325}
333 326
334/* 327/*
@@ -346,10 +339,9 @@ acpi_pci_irq_derive(struct pci_dev *dev,
346 int irq = -1; 339 int irq = -1;
347 u8 bridge_pin = 0; 340 u8 bridge_pin = 0;
348 341
349 ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");
350 342
351 if (!dev) 343 if (!dev)
352 return_VALUE(-EINVAL); 344 return -EINVAL;
353 345
354 /* 346 /*
355 * Attempt to derive an IRQ for this device from a parent bridge's 347 * Attempt to derive an IRQ for this device from a parent bridge's
@@ -366,7 +358,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
366 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 358 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
367 "No interrupt pin configured for device %s\n", 359 "No interrupt pin configured for device %s\n",
368 pci_name(bridge))); 360 pci_name(bridge)));
369 return_VALUE(-1); 361 return -1;
370 } 362 }
371 /* Pin is from 0 to 3 */ 363 /* Pin is from 0 to 3 */
372 bridge_pin--; 364 bridge_pin--;
@@ -379,16 +371,15 @@ acpi_pci_irq_derive(struct pci_dev *dev,
379 } 371 }
380 372
381 if (irq < 0) { 373 if (irq < 0) {
382 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 374 printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n",
383 "Unable to derive IRQ for device %s\n", 375 pci_name(dev));
384 pci_name(dev))); 376 return -1;
385 return_VALUE(-1);
386 } 377 }
387 378
388 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n", 379 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",
389 irq, pci_name(dev), pci_name(bridge))); 380 irq, pci_name(dev), pci_name(bridge)));
390 381
391 return_VALUE(irq); 382 return irq;
392} 383}
393 384
394/* 385/*
@@ -406,24 +397,22 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
406 char *link = NULL; 397 char *link = NULL;
407 int rc; 398 int rc;
408 399
409 ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
410 400
411 if (!dev) 401 if (!dev)
412 return_VALUE(-EINVAL); 402 return -EINVAL;
413 403
414 pin = dev->pin; 404 pin = dev->pin;
415 if (!pin) { 405 if (!pin) {
416 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 406 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
417 "No interrupt pin configured for device %s\n", 407 "No interrupt pin configured for device %s\n",
418 pci_name(dev))); 408 pci_name(dev)));
419 return_VALUE(0); 409 return 0;
420 } 410 }
421 pin--; 411 pin--;
422 412
423 if (!dev->bus) { 413 if (!dev->bus) {
424 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 414 printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n");
425 "Invalid (NULL) 'bus' field\n")); 415 return -ENODEV;
426 return_VALUE(-ENODEV);
427 } 416 }
428 417
429 /* 418 /*
@@ -455,10 +444,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
455 printk(" - using IRQ %d\n", dev->irq); 444 printk(" - using IRQ %d\n", dev->irq);
456 acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, 445 acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE,
457 ACPI_ACTIVE_LOW); 446 ACPI_ACTIVE_LOW);
458 return_VALUE(0); 447 return 0;
459 } else { 448 } else {
460 printk("\n"); 449 printk("\n");
461 return_VALUE(0); 450 return 0;
462 } 451 }
463 } 452 }
464 453
@@ -466,7 +455,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
466 if (rc < 0) { 455 if (rc < 0) {
467 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed " 456 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
468 "to register GSI\n", pci_name(dev), ('A' + pin)); 457 "to register GSI\n", pci_name(dev), ('A' + pin));
469 return_VALUE(rc); 458 return rc;
470 } 459 }
471 dev->irq = rc; 460 dev->irq = rc;
472 461
@@ -480,7 +469,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
480 (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge", 469 (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
481 (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq); 470 (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
482 471
483 return_VALUE(0); 472 return 0;
484} 473}
485 474
486EXPORT_SYMBOL(acpi_pci_irq_enable); 475EXPORT_SYMBOL(acpi_pci_irq_enable);
@@ -497,14 +486,13 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
497 int triggering = ACPI_LEVEL_SENSITIVE; 486 int triggering = ACPI_LEVEL_SENSITIVE;
498 int polarity = ACPI_ACTIVE_LOW; 487 int polarity = ACPI_ACTIVE_LOW;
499 488
500 ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
501 489
502 if (!dev || !dev->bus) 490 if (!dev || !dev->bus)
503 return_VOID; 491 return;
504 492
505 pin = dev->pin; 493 pin = dev->pin;
506 if (!pin) 494 if (!pin)
507 return_VOID; 495 return;
508 pin--; 496 pin--;
509 497
510 /* 498 /*
@@ -522,7 +510,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
522 &triggering, &polarity, NULL, 510 &triggering, &polarity, NULL,
523 acpi_pci_free_irq); 511 acpi_pci_free_irq);
524 if (gsi < 0) 512 if (gsi < 0)
525 return_VOID; 513 return;
526 514
527 /* 515 /*
528 * TBD: It might be worth clearing dev->irq by magic constant 516 * TBD: It might be worth clearing dev->irq by magic constant
@@ -534,5 +522,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
534 522
535 acpi_unregister_gsi(gsi); 523 acpi_unregister_gsi(gsi);
536 524
537 return_VOID; 525 return;
538} 526}
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 228bdb626502..1badce27a83f 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -107,26 +107,23 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
107 struct acpi_pci_link *link = (struct acpi_pci_link *)context; 107 struct acpi_pci_link *link = (struct acpi_pci_link *)context;
108 u32 i = 0; 108 u32 i = 0;
109 109
110 ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
111 110
112 switch (resource->type) { 111 switch (resource->type) {
113 case ACPI_RESOURCE_TYPE_START_DEPENDENT: 112 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
114 return_ACPI_STATUS(AE_OK); 113 return AE_OK;
115 case ACPI_RESOURCE_TYPE_IRQ: 114 case ACPI_RESOURCE_TYPE_IRQ:
116 { 115 {
117 struct acpi_resource_irq *p = &resource->data.irq; 116 struct acpi_resource_irq *p = &resource->data.irq;
118 if (!p || !p->interrupt_count) { 117 if (!p || !p->interrupt_count) {
119 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 118 printk(KERN_WARNING PREFIX "Blank IRQ resource\n");
120 "Blank IRQ resource\n")); 119 return AE_OK;
121 return_ACPI_STATUS(AE_OK);
122 } 120 }
123 for (i = 0; 121 for (i = 0;
124 (i < p->interrupt_count 122 (i < p->interrupt_count
125 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { 123 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
126 if (!p->interrupts[i]) { 124 if (!p->interrupts[i]) {
127 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 125 printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
128 "Invalid IRQ %d\n", 126 p->interrupts[i]);
129 p->interrupts[i]));
130 continue; 127 continue;
131 } 128 }
132 link->irq.possible[i] = p->interrupts[i]; 129 link->irq.possible[i] = p->interrupts[i];
@@ -142,17 +139,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
142 struct acpi_resource_extended_irq *p = 139 struct acpi_resource_extended_irq *p =
143 &resource->data.extended_irq; 140 &resource->data.extended_irq;
144 if (!p || !p->interrupt_count) { 141 if (!p || !p->interrupt_count) {
145 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 142 printk(KERN_WARNING PREFIX
146 "Blank EXT IRQ resource\n")); 143 "Blank EXT IRQ resource\n");
147 return_ACPI_STATUS(AE_OK); 144 return AE_OK;
148 } 145 }
149 for (i = 0; 146 for (i = 0;
150 (i < p->interrupt_count 147 (i < p->interrupt_count
151 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { 148 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
152 if (!p->interrupts[i]) { 149 if (!p->interrupts[i]) {
153 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 150 printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
154 "Invalid IRQ %d\n", 151 p->interrupts[i]);
155 p->interrupts[i]));
156 continue; 152 continue;
157 } 153 }
158 link->irq.possible[i] = p->interrupts[i]; 154 link->irq.possible[i] = p->interrupts[i];
@@ -164,35 +160,33 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
164 break; 160 break;
165 } 161 }
166 default: 162 default:
167 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 163 printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n");
168 "Resource is not an IRQ entry\n")); 164 return AE_OK;
169 return_ACPI_STATUS(AE_OK);
170 } 165 }
171 166
172 return_ACPI_STATUS(AE_CTRL_TERMINATE); 167 return AE_CTRL_TERMINATE;
173} 168}
174 169
175static int acpi_pci_link_get_possible(struct acpi_pci_link *link) 170static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
176{ 171{
177 acpi_status status; 172 acpi_status status;
178 173
179 ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible");
180 174
181 if (!link) 175 if (!link)
182 return_VALUE(-EINVAL); 176 return -EINVAL;
183 177
184 status = acpi_walk_resources(link->handle, METHOD_NAME__PRS, 178 status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,
185 acpi_pci_link_check_possible, link); 179 acpi_pci_link_check_possible, link);
186 if (ACPI_FAILURE(status)) { 180 if (ACPI_FAILURE(status)) {
187 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n")); 181 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
188 return_VALUE(-ENODEV); 182 return -ENODEV;
189 } 183 }
190 184
191 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 185 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
192 "Found %d possible IRQs\n", 186 "Found %d possible IRQs\n",
193 link->irq.possible_count)); 187 link->irq.possible_count));
194 188
195 return_VALUE(0); 189 return 0;
196} 190}
197 191
198static acpi_status 192static acpi_status
@@ -200,7 +194,6 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
200{ 194{
201 int *irq = (int *)context; 195 int *irq = (int *)context;
202 196
203 ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
204 197
205 switch (resource->type) { 198 switch (resource->type) {
206 case ACPI_RESOURCE_TYPE_IRQ: 199 case ACPI_RESOURCE_TYPE_IRQ:
@@ -213,7 +206,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
213 */ 206 */
214 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 207 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
215 "Blank IRQ resource\n")); 208 "Blank IRQ resource\n"));
216 return_ACPI_STATUS(AE_OK); 209 return AE_OK;
217 } 210 }
218 *irq = p->interrupts[0]; 211 *irq = p->interrupts[0];
219 break; 212 break;
@@ -227,20 +220,20 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
227 * extended IRQ descriptors must 220 * extended IRQ descriptors must
228 * return at least 1 IRQ 221 * return at least 1 IRQ
229 */ 222 */
230 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 223 printk(KERN_WARNING PREFIX
231 "Blank EXT IRQ resource\n")); 224 "Blank EXT IRQ resource\n");
232 return_ACPI_STATUS(AE_OK); 225 return AE_OK;
233 } 226 }
234 *irq = p->interrupts[0]; 227 *irq = p->interrupts[0];
235 break; 228 break;
236 } 229 }
237 break; 230 break;
238 default: 231 default:
239 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource %d isn't an IRQ\n", resource->type)); 232 printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type);
240 case ACPI_RESOURCE_TYPE_END_TAG: 233 case ACPI_RESOURCE_TYPE_END_TAG:
241 return_ACPI_STATUS(AE_OK); 234 return AE_OK;
242 } 235 }
243 return_ACPI_STATUS(AE_CTRL_TERMINATE); 236 return AE_CTRL_TERMINATE;
244} 237}
245 238
246/* 239/*
@@ -256,10 +249,9 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
256 acpi_status status = AE_OK; 249 acpi_status status = AE_OK;
257 int irq = 0; 250 int irq = 0;
258 251
259 ACPI_FUNCTION_TRACE("acpi_pci_link_get_current");
260 252
261 if (!link || !link->handle) 253 if (!link || !link->handle)
262 return_VALUE(-EINVAL); 254 return -EINVAL;
263 255
264 link->irq.active = 0; 256 link->irq.active = 0;
265 257
@@ -268,14 +260,13 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
268 /* Query _STA, set link->device->status */ 260 /* Query _STA, set link->device->status */
269 result = acpi_bus_get_status(link->device); 261 result = acpi_bus_get_status(link->device);
270 if (result) { 262 if (result) {
271 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 263 printk(KERN_ERR PREFIX "Unable to read status\n");
272 "Unable to read status\n"));
273 goto end; 264 goto end;
274 } 265 }
275 266
276 if (!link->device->status.enabled) { 267 if (!link->device->status.enabled) {
277 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); 268 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
278 return_VALUE(0); 269 return 0;
279 } 270 }
280 } 271 }
281 272
@@ -286,13 +277,13 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
286 status = acpi_walk_resources(link->handle, METHOD_NAME__CRS, 277 status = acpi_walk_resources(link->handle, METHOD_NAME__CRS,
287 acpi_pci_link_check_current, &irq); 278 acpi_pci_link_check_current, &irq);
288 if (ACPI_FAILURE(status)) { 279 if (ACPI_FAILURE(status)) {
289 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n")); 280 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
290 result = -ENODEV; 281 result = -ENODEV;
291 goto end; 282 goto end;
292 } 283 }
293 284
294 if (acpi_strict && !irq) { 285 if (acpi_strict && !irq) {
295 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n")); 286 printk(KERN_ERR PREFIX "_CRS returned 0\n");
296 result = -ENODEV; 287 result = -ENODEV;
297 } 288 }
298 289
@@ -301,7 +292,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
301 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); 292 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));
302 293
303 end: 294 end:
304 return_VALUE(result); 295 return result;
305} 296}
306 297
307static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) 298static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
@@ -314,14 +305,13 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
314 } *resource; 305 } *resource;
315 struct acpi_buffer buffer = { 0, NULL }; 306 struct acpi_buffer buffer = { 0, NULL };
316 307
317 ACPI_FUNCTION_TRACE("acpi_pci_link_set");
318 308
319 if (!link || !irq) 309 if (!link || !irq)
320 return_VALUE(-EINVAL); 310 return -EINVAL;
321 311
322 resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC); 312 resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
323 if (!resource) 313 if (!resource)
324 return_VALUE(-ENOMEM); 314 return -ENOMEM;
325 315
326 memset(resource, 0, sizeof(*resource) + 1); 316 memset(resource, 0, sizeof(*resource) + 1);
327 buffer.length = sizeof(*resource) + 1; 317 buffer.length = sizeof(*resource) + 1;
@@ -362,7 +352,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
362 /* ignore resource_source, it's optional */ 352 /* ignore resource_source, it's optional */
363 break; 353 break;
364 default: 354 default:
365 printk("ACPI BUG: resource_type %d\n", link->irq.resource_type); 355 printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type);
366 result = -EINVAL; 356 result = -EINVAL;
367 goto end; 357 goto end;
368 358
@@ -374,7 +364,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
374 364
375 /* check for total failure */ 365 /* check for total failure */
376 if (ACPI_FAILURE(status)) { 366 if (ACPI_FAILURE(status)) {
377 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); 367 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS"));
378 result = -ENODEV; 368 result = -ENODEV;
379 goto end; 369 goto end;
380 } 370 }
@@ -382,14 +372,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
382 /* Query _STA, set device->status */ 372 /* Query _STA, set device->status */
383 result = acpi_bus_get_status(link->device); 373 result = acpi_bus_get_status(link->device);
384 if (result) { 374 if (result) {
385 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); 375 printk(KERN_ERR PREFIX "Unable to read status\n");
386 goto end; 376 goto end;
387 } 377 }
388 if (!link->device->status.enabled) { 378 if (!link->device->status.enabled) {
389 printk(KERN_WARNING PREFIX 379 printk(KERN_WARNING PREFIX
390 "%s [%s] disabled and referenced, BIOS bug.\n", 380 "%s [%s] disabled and referenced, BIOS bug\n",
391 acpi_device_name(link->device), 381 acpi_device_name(link->device),
392 acpi_device_bid(link->device)); 382 acpi_device_bid(link->device));
393 } 383 }
394 384
395 /* Query _CRS, set link->irq.active */ 385 /* Query _CRS, set link->irq.active */
@@ -408,9 +398,9 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
408 * assume _SRS worked and override _CRS value. 398 * assume _SRS worked and override _CRS value.
409 */ 399 */
410 printk(KERN_WARNING PREFIX 400 printk(KERN_WARNING PREFIX
411 "%s [%s] BIOS reported IRQ %d, using IRQ %d\n", 401 "%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
412 acpi_device_name(link->device), 402 acpi_device_name(link->device),
413 acpi_device_bid(link->device), link->irq.active, irq); 403 acpi_device_bid(link->device), link->irq.active, irq);
414 link->irq.active = irq; 404 link->irq.active = irq;
415 } 405 }
416 406
@@ -418,7 +408,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
418 408
419 end: 409 end:
420 kfree(resource); 410 kfree(resource);
421 return_VALUE(result); 411 return result;
422} 412}
423 413
424/* -------------------------------------------------------------------------- 414/* --------------------------------------------------------------------------
@@ -492,7 +482,6 @@ int __init acpi_irq_penalty_init(void)
492 struct acpi_pci_link *link = NULL; 482 struct acpi_pci_link *link = NULL;
493 int i = 0; 483 int i = 0;
494 484
495 ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");
496 485
497 /* 486 /*
498 * Update penalties to facilitate IRQ balancing. 487 * Update penalties to facilitate IRQ balancing.
@@ -501,8 +490,7 @@ int __init acpi_irq_penalty_init(void)
501 490
502 link = list_entry(node, struct acpi_pci_link, node); 491 link = list_entry(node, struct acpi_pci_link, node);
503 if (!link) { 492 if (!link) {
504 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 493 printk(KERN_ERR PREFIX "Invalid link context\n");
505 "Invalid link context\n"));
506 continue; 494 continue;
507 } 495 }
508 496
@@ -530,7 +518,7 @@ int __init acpi_irq_penalty_init(void)
530 /* Add a penalty for the SCI */ 518 /* Add a penalty for the SCI */
531 acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING; 519 acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;
532 520
533 return_VALUE(0); 521 return 0;
534} 522}
535 523
536static int acpi_irq_balance; /* 0: static, 1: balance */ 524static int acpi_irq_balance; /* 0: static, 1: balance */
@@ -540,13 +528,12 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
540 int irq; 528 int irq;
541 int i; 529 int i;
542 530
543 ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
544 531
545 if (link->irq.initialized) { 532 if (link->irq.initialized) {
546 if (link->refcnt == 0) 533 if (link->refcnt == 0)
547 /* This means the link is disabled but initialized */ 534 /* This means the link is disabled but initialized */
548 acpi_pci_link_set(link, link->irq.active); 535 acpi_pci_link_set(link, link->irq.active);
549 return_VALUE(0); 536 return 0;
550 } 537 }
551 538
552 /* 539 /*
@@ -562,7 +549,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
562 if (i == link->irq.possible_count) { 549 if (i == link->irq.possible_count) {
563 if (acpi_strict) 550 if (acpi_strict)
564 printk(KERN_WARNING PREFIX "_CRS %d not found" 551 printk(KERN_WARNING PREFIX "_CRS %d not found"
565 " in _PRS\n", link->irq.active); 552 " in _PRS\n", link->irq.active);
566 link->irq.active = 0; 553 link->irq.active = 0;
567 } 554 }
568 555
@@ -589,12 +576,11 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
589 576
590 /* Attempt to enable the link device at this IRQ. */ 577 /* Attempt to enable the link device at this IRQ. */
591 if (acpi_pci_link_set(link, irq)) { 578 if (acpi_pci_link_set(link, irq)) {
592 printk(PREFIX 579 printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. "
593 "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n" 580 "Try pci=noacpi or acpi=off\n",
594 "Try pci=noacpi or acpi=off\n", 581 acpi_device_name(link->device),
595 acpi_device_name(link->device), 582 acpi_device_bid(link->device));
596 acpi_device_bid(link->device)); 583 return -ENODEV;
597 return_VALUE(-ENODEV);
598 } else { 584 } else {
599 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING; 585 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
600 printk(PREFIX "%s [%s] enabled at IRQ %d\n", 586 printk(PREFIX "%s [%s] enabled at IRQ %d\n",
@@ -604,7 +590,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
604 590
605 link->irq.initialized = 1; 591 link->irq.initialized = 1;
606 592
607 return_VALUE(0); 593 return 0;
608} 594}
609 595
610/* 596/*
@@ -622,36 +608,35 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
622 struct acpi_device *device = NULL; 608 struct acpi_device *device = NULL;
623 struct acpi_pci_link *link = NULL; 609 struct acpi_pci_link *link = NULL;
624 610
625 ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq");
626 611
627 result = acpi_bus_get_device(handle, &device); 612 result = acpi_bus_get_device(handle, &device);
628 if (result) { 613 if (result) {
629 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); 614 printk(KERN_ERR PREFIX "Invalid link device\n");
630 return_VALUE(-1); 615 return -1;
631 } 616 }
632 617
633 link = (struct acpi_pci_link *)acpi_driver_data(device); 618 link = (struct acpi_pci_link *)acpi_driver_data(device);
634 if (!link) { 619 if (!link) {
635 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); 620 printk(KERN_ERR PREFIX "Invalid link context\n");
636 return_VALUE(-1); 621 return -1;
637 } 622 }
638 623
639 /* TBD: Support multiple index (IRQ) entries per Link Device */ 624 /* TBD: Support multiple index (IRQ) entries per Link Device */
640 if (index) { 625 if (index) {
641 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index)); 626 printk(KERN_ERR PREFIX "Invalid index %d\n", index);
642 return_VALUE(-1); 627 return -1;
643 } 628 }
644 629
645 mutex_lock(&acpi_link_lock); 630 mutex_lock(&acpi_link_lock);
646 if (acpi_pci_link_allocate(link)) { 631 if (acpi_pci_link_allocate(link)) {
647 mutex_unlock(&acpi_link_lock); 632 mutex_unlock(&acpi_link_lock);
648 return_VALUE(-1); 633 return -1;
649 } 634 }
650 635
651 if (!link->irq.active) { 636 if (!link->irq.active) {
652 mutex_unlock(&acpi_link_lock); 637 mutex_unlock(&acpi_link_lock);
653 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); 638 printk(KERN_ERR PREFIX "Link active IRQ is 0!\n");
654 return_VALUE(-1); 639 return -1;
655 } 640 }
656 link->refcnt++; 641 link->refcnt++;
657 mutex_unlock(&acpi_link_lock); 642 mutex_unlock(&acpi_link_lock);
@@ -665,7 +650,7 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
665 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 650 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
666 "Link %s is referenced\n", 651 "Link %s is referenced\n",
667 acpi_device_bid(link->device))); 652 acpi_device_bid(link->device)));
668 return_VALUE(link->irq.active); 653 return (link->irq.active);
669} 654}
670 655
671/* 656/*
@@ -678,25 +663,24 @@ int acpi_pci_link_free_irq(acpi_handle handle)
678 struct acpi_pci_link *link = NULL; 663 struct acpi_pci_link *link = NULL;
679 acpi_status result; 664 acpi_status result;
680 665
681 ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq");
682 666
683 result = acpi_bus_get_device(handle, &device); 667 result = acpi_bus_get_device(handle, &device);
684 if (result) { 668 if (result) {
685 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); 669 printk(KERN_ERR PREFIX "Invalid link device\n");
686 return_VALUE(-1); 670 return -1;
687 } 671 }
688 672
689 link = (struct acpi_pci_link *)acpi_driver_data(device); 673 link = (struct acpi_pci_link *)acpi_driver_data(device);
690 if (!link) { 674 if (!link) {
691 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); 675 printk(KERN_ERR PREFIX "Invalid link context\n");
692 return_VALUE(-1); 676 return -1;
693 } 677 }
694 678
695 mutex_lock(&acpi_link_lock); 679 mutex_lock(&acpi_link_lock);
696 if (!link->irq.initialized) { 680 if (!link->irq.initialized) {
697 mutex_unlock(&acpi_link_lock); 681 mutex_unlock(&acpi_link_lock);
698 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n")); 682 printk(KERN_ERR PREFIX "Link isn't initialized\n");
699 return_VALUE(-1); 683 return -1;
700 } 684 }
701#ifdef FUTURE_USE 685#ifdef FUTURE_USE
702 /* 686 /*
@@ -718,7 +702,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
718 acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); 702 acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
719 } 703 }
720 mutex_unlock(&acpi_link_lock); 704 mutex_unlock(&acpi_link_lock);
721 return_VALUE(link->irq.active); 705 return (link->irq.active);
722} 706}
723 707
724/* -------------------------------------------------------------------------- 708/* --------------------------------------------------------------------------
@@ -732,14 +716,13 @@ static int acpi_pci_link_add(struct acpi_device *device)
732 int i = 0; 716 int i = 0;
733 int found = 0; 717 int found = 0;
734 718
735 ACPI_FUNCTION_TRACE("acpi_pci_link_add");
736 719
737 if (!device) 720 if (!device)
738 return_VALUE(-EINVAL); 721 return -EINVAL;
739 722
740 link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); 723 link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
741 if (!link) 724 if (!link)
742 return_VALUE(-ENOMEM); 725 return -ENOMEM;
743 memset(link, 0, sizeof(struct acpi_pci_link)); 726 memset(link, 0, sizeof(struct acpi_pci_link));
744 727
745 link->device = device; 728 link->device = device;
@@ -788,17 +771,16 @@ static int acpi_pci_link_add(struct acpi_device *device)
788 if (result) 771 if (result)
789 kfree(link); 772 kfree(link);
790 773
791 return_VALUE(result); 774 return result;
792} 775}
793 776
794static int acpi_pci_link_resume(struct acpi_pci_link *link) 777static int acpi_pci_link_resume(struct acpi_pci_link *link)
795{ 778{
796 ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
797 779
798 if (link->refcnt && link->irq.active && link->irq.initialized) 780 if (link->refcnt && link->irq.active && link->irq.initialized)
799 return_VALUE(acpi_pci_link_set(link, link->irq.active)); 781 return (acpi_pci_link_set(link, link->irq.active));
800 else 782 else
801 return_VALUE(0); 783 return 0;
802} 784}
803 785
804/* 786/*
@@ -811,7 +793,6 @@ static int irqrouter_resume(struct sys_device *dev)
811 struct list_head *node = NULL; 793 struct list_head *node = NULL;
812 struct acpi_pci_link *link = NULL; 794 struct acpi_pci_link *link = NULL;
813 795
814 ACPI_FUNCTION_TRACE("irqrouter_resume");
815 796
816 /* Make sure SCI is enabled again (Apple firmware bug?) */ 797 /* Make sure SCI is enabled again (Apple firmware bug?) */
817 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); 798 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);
@@ -820,24 +801,22 @@ static int irqrouter_resume(struct sys_device *dev)
820 list_for_each(node, &acpi_link.entries) { 801 list_for_each(node, &acpi_link.entries) {
821 link = list_entry(node, struct acpi_pci_link, node); 802 link = list_entry(node, struct acpi_pci_link, node);
822 if (!link) { 803 if (!link) {
823 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 804 printk(KERN_ERR PREFIX "Invalid link context\n");
824 "Invalid link context\n"));
825 continue; 805 continue;
826 } 806 }
827 acpi_pci_link_resume(link); 807 acpi_pci_link_resume(link);
828 } 808 }
829 acpi_in_resume = 0; 809 acpi_in_resume = 0;
830 return_VALUE(0); 810 return 0;
831} 811}
832 812
833static int acpi_pci_link_remove(struct acpi_device *device, int type) 813static int acpi_pci_link_remove(struct acpi_device *device, int type)
834{ 814{
835 struct acpi_pci_link *link = NULL; 815 struct acpi_pci_link *link = NULL;
836 816
837 ACPI_FUNCTION_TRACE("acpi_pci_link_remove");
838 817
839 if (!device || !acpi_driver_data(device)) 818 if (!device || !acpi_driver_data(device))
840 return_VALUE(-EINVAL); 819 return -EINVAL;
841 820
842 link = (struct acpi_pci_link *)acpi_driver_data(device); 821 link = (struct acpi_pci_link *)acpi_driver_data(device);
843 822
@@ -847,7 +826,7 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
847 826
848 kfree(link); 827 kfree(link);
849 828
850 return_VALUE(0); 829 return 0;
851} 830}
852 831
853/* 832/*
@@ -953,34 +932,32 @@ static int __init irqrouter_init_sysfs(void)
953{ 932{
954 int error; 933 int error;
955 934
956 ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");
957 935
958 if (acpi_disabled || acpi_noirq) 936 if (acpi_disabled || acpi_noirq)
959 return_VALUE(0); 937 return 0;
960 938
961 error = sysdev_class_register(&irqrouter_sysdev_class); 939 error = sysdev_class_register(&irqrouter_sysdev_class);
962 if (!error) 940 if (!error)
963 error = sysdev_register(&device_irqrouter); 941 error = sysdev_register(&device_irqrouter);
964 942
965 return_VALUE(error); 943 return error;
966} 944}
967 945
968device_initcall(irqrouter_init_sysfs); 946device_initcall(irqrouter_init_sysfs);
969 947
970static int __init acpi_pci_link_init(void) 948static int __init acpi_pci_link_init(void)
971{ 949{
972 ACPI_FUNCTION_TRACE("acpi_pci_link_init");
973 950
974 if (acpi_noirq) 951 if (acpi_noirq)
975 return_VALUE(0); 952 return 0;
976 953
977 acpi_link.count = 0; 954 acpi_link.count = 0;
978 INIT_LIST_HEAD(&acpi_link.entries); 955 INIT_LIST_HEAD(&acpi_link.entries);
979 956
980 if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0) 957 if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)
981 return_VALUE(-ENODEV); 958 return -ENODEV;
982 959
983 return_VALUE(0); 960 return 0;
984} 961}
985 962
986subsys_initcall(acpi_pci_link_init); 963subsys_initcall(acpi_pci_link_init);
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 4c313eab6313..8f10442119f0 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -160,14 +160,13 @@ static int acpi_pci_root_add(struct acpi_device *device)
160 unsigned long value = 0; 160 unsigned long value = 0;
161 acpi_handle handle = NULL; 161 acpi_handle handle = NULL;
162 162
163 ACPI_FUNCTION_TRACE("acpi_pci_root_add");
164 163
165 if (!device) 164 if (!device)
166 return_VALUE(-EINVAL); 165 return -EINVAL;
167 166
168 root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); 167 root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
169 if (!root) 168 if (!root)
170 return_VALUE(-ENOMEM); 169 return -ENOMEM;
171 memset(root, 0, sizeof(struct acpi_pci_root)); 170 memset(root, 0, sizeof(struct acpi_pci_root));
172 INIT_LIST_HEAD(&root->node); 171 INIT_LIST_HEAD(&root->node);
173 172
@@ -198,7 +197,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
198 root->id.segment = 0; 197 root->id.segment = 0;
199 break; 198 break;
200 default: 199 default:
201 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n")); 200 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG"));
202 result = -ENODEV; 201 result = -ENODEV;
203 goto end; 202 goto end;
204 } 203 }
@@ -219,7 +218,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
219 root->id.bus = 0; 218 root->id.bus = 0;
220 break; 219 break;
221 default: 220 default:
222 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n")); 221 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN"));
223 result = -ENODEV; 222 result = -ENODEV;
224 goto end; 223 goto end;
225 } 224 }
@@ -231,8 +230,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
231 int bus = 0; 230 int bus = 0;
232 acpi_status status; 231 acpi_status status;
233 232
234 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 233 printk(KERN_ERR PREFIX
235 "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); 234 "Wrong _BBN value, reboot"
235 " and use option 'pci=noacpi'\n");
236 236
237 status = try_get_root_bridge_busnr(root->handle, &bus); 237 status = try_get_root_bridge_busnr(root->handle, &bus);
238 if (ACPI_FAILURE(status)) 238 if (ACPI_FAILURE(status))
@@ -273,9 +273,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
273 */ 273 */
274 root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus); 274 root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
275 if (!root->bus) { 275 if (!root->bus) {
276 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 276 printk(KERN_ERR PREFIX
277 "Bus %04x:%02x not present in PCI namespace\n", 277 "Bus %04x:%02x not present in PCI namespace\n",
278 root->id.segment, root->id.bus)); 278 root->id.segment, root->id.bus);
279 result = -ENODEV; 279 result = -ENODEV;
280 goto end; 280 goto end;
281 } 281 }
@@ -306,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device)
306 kfree(root); 306 kfree(root);
307 } 307 }
308 308
309 return_VALUE(result); 309 return result;
310} 310}
311 311
312static int acpi_pci_root_start(struct acpi_device *device) 312static int acpi_pci_root_start(struct acpi_device *device)
313{ 313{
314 struct acpi_pci_root *root; 314 struct acpi_pci_root *root;
315 315
316 ACPI_FUNCTION_TRACE("acpi_pci_root_start");
317 316
318 list_for_each_entry(root, &acpi_pci_roots, node) { 317 list_for_each_entry(root, &acpi_pci_roots, node) {
319 if (root->handle == device->handle) { 318 if (root->handle == device->handle) {
320 pci_bus_add_devices(root->bus); 319 pci_bus_add_devices(root->bus);
321 return_VALUE(0); 320 return 0;
322 } 321 }
323 } 322 }
324 return_VALUE(-ENODEV); 323 return -ENODEV;
325} 324}
326 325
327static int acpi_pci_root_remove(struct acpi_device *device, int type) 326static int acpi_pci_root_remove(struct acpi_device *device, int type)
328{ 327{
329 struct acpi_pci_root *root = NULL; 328 struct acpi_pci_root *root = NULL;
330 329
331 ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
332 330
333 if (!device || !acpi_driver_data(device)) 331 if (!device || !acpi_driver_data(device))
334 return_VALUE(-EINVAL); 332 return -EINVAL;
335 333
336 root = (struct acpi_pci_root *)acpi_driver_data(device); 334 root = (struct acpi_pci_root *)acpi_driver_data(device);
337 335
338 kfree(root); 336 kfree(root);
339 337
340 return_VALUE(0); 338 return 0;
341} 339}
342 340
343static int __init acpi_pci_root_init(void) 341static int __init acpi_pci_root_init(void)
344{ 342{
345 ACPI_FUNCTION_TRACE("acpi_pci_root_init");
346 343
347 if (acpi_pci_disabled) 344 if (acpi_pci_disabled)
348 return_VALUE(0); 345 return 0;
349 346
350 /* DEBUG: 347 /* DEBUG:
351 acpi_dbg_layer = ACPI_PCI_COMPONENT; 348 acpi_dbg_layer = ACPI_PCI_COMPONENT;
@@ -353,9 +350,9 @@ static int __init acpi_pci_root_init(void)
353 */ 350 */
354 351
355 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) 352 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
356 return_VALUE(-ENODEV); 353 return -ENODEV;
357 354
358 return_VALUE(0); 355 return 0;
359} 356}
360 357
361subsys_initcall(acpi_pci_root_init); 358subsys_initcall(acpi_pci_root_init);
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 62a5595ed8bc..224f729f700e 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -98,23 +98,21 @@ acpi_power_get_context(acpi_handle handle,
98 int result = 0; 98 int result = 0;
99 struct acpi_device *device = NULL; 99 struct acpi_device *device = NULL;
100 100
101 ACPI_FUNCTION_TRACE("acpi_power_get_context");
102 101
103 if (!resource) 102 if (!resource)
104 return_VALUE(-ENODEV); 103 return -ENODEV;
105 104
106 result = acpi_bus_get_device(handle, &device); 105 result = acpi_bus_get_device(handle, &device);
107 if (result) { 106 if (result) {
108 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n", 107 printk(KERN_WARNING PREFIX "Getting context [%p]\n", handle);
109 handle)); 108 return result;
110 return_VALUE(result);
111 } 109 }
112 110
113 *resource = (struct acpi_power_resource *)acpi_driver_data(device); 111 *resource = (struct acpi_power_resource *)acpi_driver_data(device);
114 if (!resource) 112 if (!resource)
115 return_VALUE(-ENODEV); 113 return -ENODEV;
116 114
117 return_VALUE(0); 115 return 0;
118} 116}
119 117
120static int acpi_power_get_state(struct acpi_power_resource *resource) 118static int acpi_power_get_state(struct acpi_power_resource *resource)
@@ -122,14 +120,13 @@ static int acpi_power_get_state(struct acpi_power_resource *resource)
122 acpi_status status = AE_OK; 120 acpi_status status = AE_OK;
123 unsigned long sta = 0; 121 unsigned long sta = 0;
124 122
125 ACPI_FUNCTION_TRACE("acpi_power_get_state");
126 123
127 if (!resource) 124 if (!resource)
128 return_VALUE(-EINVAL); 125 return -EINVAL;
129 126
130 status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta); 127 status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta);
131 if (ACPI_FAILURE(status)) 128 if (ACPI_FAILURE(status))
132 return_VALUE(-ENODEV); 129 return -ENODEV;
133 130
134 if (sta & 0x01) 131 if (sta & 0x01)
135 resource->state = ACPI_POWER_RESOURCE_STATE_ON; 132 resource->state = ACPI_POWER_RESOURCE_STATE_ON;
@@ -139,7 +136,7 @@ static int acpi_power_get_state(struct acpi_power_resource *resource)
139 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", 136 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
140 resource->name, resource->state ? "on" : "off")); 137 resource->name, resource->state ? "on" : "off"));
141 138
142 return_VALUE(0); 139 return 0;
143} 140}
144 141
145static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state) 142static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
@@ -148,20 +145,19 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
148 struct acpi_power_resource *resource = NULL; 145 struct acpi_power_resource *resource = NULL;
149 u32 i = 0; 146 u32 i = 0;
150 147
151 ACPI_FUNCTION_TRACE("acpi_power_get_list_state");
152 148
153 if (!list || !state) 149 if (!list || !state)
154 return_VALUE(-EINVAL); 150 return -EINVAL;
155 151
156 /* The state of the list is 'on' IFF all resources are 'on'. */ 152 /* The state of the list is 'on' IFF all resources are 'on'. */
157 153
158 for (i = 0; i < list->count; i++) { 154 for (i = 0; i < list->count; i++) {
159 result = acpi_power_get_context(list->handles[i], &resource); 155 result = acpi_power_get_context(list->handles[i], &resource);
160 if (result) 156 if (result)
161 return_VALUE(result); 157 return result;
162 result = acpi_power_get_state(resource); 158 result = acpi_power_get_state(resource);
163 if (result) 159 if (result)
164 return_VALUE(result); 160 return result;
165 161
166 *state = resource->state; 162 *state = resource->state;
167 163
@@ -172,7 +168,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
172 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n", 168 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
173 *state ? "on" : "off")); 169 *state ? "on" : "off"));
174 170
175 return_VALUE(result); 171 return result;
176} 172}
177 173
178static int acpi_power_on(acpi_handle handle) 174static int acpi_power_on(acpi_handle handle)
@@ -182,11 +178,10 @@ static int acpi_power_on(acpi_handle handle)
182 struct acpi_device *device = NULL; 178 struct acpi_device *device = NULL;
183 struct acpi_power_resource *resource = NULL; 179 struct acpi_power_resource *resource = NULL;
184 180
185 ACPI_FUNCTION_TRACE("acpi_power_on");
186 181
187 result = acpi_power_get_context(handle, &resource); 182 result = acpi_power_get_context(handle, &resource);
188 if (result) 183 if (result)
189 return_VALUE(result); 184 return result;
190 185
191 resource->references++; 186 resource->references++;
192 187
@@ -194,29 +189,29 @@ static int acpi_power_on(acpi_handle handle)
194 || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) { 189 || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) {
195 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n", 190 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",
196 resource->name)); 191 resource->name));
197 return_VALUE(0); 192 return 0;
198 } 193 }
199 194
200 status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL); 195 status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL);
201 if (ACPI_FAILURE(status)) 196 if (ACPI_FAILURE(status))
202 return_VALUE(-ENODEV); 197 return -ENODEV;
203 198
204 result = acpi_power_get_state(resource); 199 result = acpi_power_get_state(resource);
205 if (result) 200 if (result)
206 return_VALUE(result); 201 return result;
207 if (resource->state != ACPI_POWER_RESOURCE_STATE_ON) 202 if (resource->state != ACPI_POWER_RESOURCE_STATE_ON)
208 return_VALUE(-ENOEXEC); 203 return -ENOEXEC;
209 204
210 /* Update the power resource's _device_ power state */ 205 /* Update the power resource's _device_ power state */
211 result = acpi_bus_get_device(resource->handle, &device); 206 result = acpi_bus_get_device(resource->handle, &device);
212 if (result) 207 if (result)
213 return_VALUE(result); 208 return result;
214 device->power.state = ACPI_STATE_D0; 209 device->power.state = ACPI_STATE_D0;
215 210
216 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n", 211 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",
217 resource->name)); 212 resource->name));
218 213
219 return_VALUE(0); 214 return 0;
220} 215}
221 216
222static int acpi_power_off_device(acpi_handle handle) 217static int acpi_power_off_device(acpi_handle handle)
@@ -226,11 +221,10 @@ static int acpi_power_off_device(acpi_handle handle)
226 struct acpi_device *device = NULL; 221 struct acpi_device *device = NULL;
227 struct acpi_power_resource *resource = NULL; 222 struct acpi_power_resource *resource = NULL;
228 223
229 ACPI_FUNCTION_TRACE("acpi_power_off_device");
230 224
231 result = acpi_power_get_context(handle, &resource); 225 result = acpi_power_get_context(handle, &resource);
232 if (result) 226 if (result)
233 return_VALUE(result); 227 return result;
234 228
235 if (resource->references) 229 if (resource->references)
236 resource->references--; 230 resource->references--;
@@ -239,35 +233,35 @@ static int acpi_power_off_device(acpi_handle handle)
239 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 233 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
240 "Resource [%s] is still in use, dereferencing\n", 234 "Resource [%s] is still in use, dereferencing\n",
241 device->pnp.bus_id)); 235 device->pnp.bus_id));
242 return_VALUE(0); 236 return 0;
243 } 237 }
244 238
245 if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) { 239 if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
246 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n", 240 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
247 device->pnp.bus_id)); 241 device->pnp.bus_id));
248 return_VALUE(0); 242 return 0;
249 } 243 }
250 244
251 status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL); 245 status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL);
252 if (ACPI_FAILURE(status)) 246 if (ACPI_FAILURE(status))
253 return_VALUE(-ENODEV); 247 return -ENODEV;
254 248
255 result = acpi_power_get_state(resource); 249 result = acpi_power_get_state(resource);
256 if (result) 250 if (result)
257 return_VALUE(result); 251 return result;
258 if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF) 252 if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF)
259 return_VALUE(-ENOEXEC); 253 return -ENOEXEC;
260 254
261 /* Update the power resource's _device_ power state */ 255 /* Update the power resource's _device_ power state */
262 result = acpi_bus_get_device(resource->handle, &device); 256 result = acpi_bus_get_device(resource->handle, &device);
263 if (result) 257 if (result)
264 return_VALUE(result); 258 return result;
265 device->power.state = ACPI_STATE_D3; 259 device->power.state = ACPI_STATE_D3;
266 260
267 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n", 261 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",
268 resource->name)); 262 resource->name));
269 263
270 return_VALUE(0); 264 return 0;
271} 265}
272 266
273/* 267/*
@@ -283,31 +277,29 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
283 int i; 277 int i;
284 int ret = 0; 278 int ret = 0;
285 279
286 ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power");
287 if (!dev || !dev->wakeup.flags.valid) 280 if (!dev || !dev->wakeup.flags.valid)
288 return_VALUE(-1); 281 return -1;
289 282
290 arg.integer.value = 1; 283 arg.integer.value = 1;
291 /* Open power resource */ 284 /* Open power resource */
292 for (i = 0; i < dev->wakeup.resources.count; i++) { 285 for (i = 0; i < dev->wakeup.resources.count; i++) {
293 ret = acpi_power_on(dev->wakeup.resources.handles[i]); 286 ret = acpi_power_on(dev->wakeup.resources.handles[i]);
294 if (ret) { 287 if (ret) {
295 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 288 printk(KERN_ERR PREFIX "Transition power state\n");
296 "Error transition power state\n"));
297 dev->wakeup.flags.valid = 0; 289 dev->wakeup.flags.valid = 0;
298 return_VALUE(-1); 290 return -1;
299 } 291 }
300 } 292 }
301 293
302 /* Execute PSW */ 294 /* Execute PSW */
303 status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL); 295 status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
304 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { 296 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
305 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n")); 297 printk(KERN_ERR PREFIX "Evaluate _PSW\n");
306 dev->wakeup.flags.valid = 0; 298 dev->wakeup.flags.valid = 0;
307 ret = -1; 299 ret = -1;
308 } 300 }
309 301
310 return_VALUE(ret); 302 return ret;
311} 303}
312 304
313/* 305/*
@@ -323,32 +315,30 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
323 int i; 315 int i;
324 int ret = 0; 316 int ret = 0;
325 317
326 ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power");
327 318
328 if (!dev || !dev->wakeup.flags.valid) 319 if (!dev || !dev->wakeup.flags.valid)
329 return_VALUE(-1); 320 return -1;
330 321
331 arg.integer.value = 0; 322 arg.integer.value = 0;
332 /* Execute PSW */ 323 /* Execute PSW */
333 status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL); 324 status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
334 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { 325 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
335 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n")); 326 printk(KERN_ERR PREFIX "Evaluate _PSW\n");
336 dev->wakeup.flags.valid = 0; 327 dev->wakeup.flags.valid = 0;
337 return_VALUE(-1); 328 return -1;
338 } 329 }
339 330
340 /* Close power resource */ 331 /* Close power resource */
341 for (i = 0; i < dev->wakeup.resources.count; i++) { 332 for (i = 0; i < dev->wakeup.resources.count; i++) {
342 ret = acpi_power_off_device(dev->wakeup.resources.handles[i]); 333 ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
343 if (ret) { 334 if (ret) {
344 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 335 printk(KERN_ERR PREFIX "Transition power state\n");
345 "Error transition power state\n"));
346 dev->wakeup.flags.valid = 0; 336 dev->wakeup.flags.valid = 0;
347 return_VALUE(-1); 337 return -1;
348 } 338 }
349 } 339 }
350 340
351 return_VALUE(ret); 341 return ret;
352} 342}
353 343
354/* -------------------------------------------------------------------------- 344/* --------------------------------------------------------------------------
@@ -362,10 +352,9 @@ int acpi_power_get_inferred_state(struct acpi_device *device)
362 int list_state = 0; 352 int list_state = 0;
363 int i = 0; 353 int i = 0;
364 354
365 ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state");
366 355
367 if (!device) 356 if (!device)
368 return_VALUE(-EINVAL); 357 return -EINVAL;
369 358
370 device->power.state = ACPI_STATE_UNKNOWN; 359 device->power.state = ACPI_STATE_UNKNOWN;
371 360
@@ -380,17 +369,17 @@ int acpi_power_get_inferred_state(struct acpi_device *device)
380 369
381 result = acpi_power_get_list_state(list, &list_state); 370 result = acpi_power_get_list_state(list, &list_state);
382 if (result) 371 if (result)
383 return_VALUE(result); 372 return result;
384 373
385 if (list_state == ACPI_POWER_RESOURCE_STATE_ON) { 374 if (list_state == ACPI_POWER_RESOURCE_STATE_ON) {
386 device->power.state = i; 375 device->power.state = i;
387 return_VALUE(0); 376 return 0;
388 } 377 }
389 } 378 }
390 379
391 device->power.state = ACPI_STATE_D3; 380 device->power.state = ACPI_STATE_D3;
392 381
393 return_VALUE(0); 382 return 0;
394} 383}
395 384
396int acpi_power_transition(struct acpi_device *device, int state) 385int acpi_power_transition(struct acpi_device *device, int state)
@@ -400,14 +389,13 @@ int acpi_power_transition(struct acpi_device *device, int state)
400 struct acpi_handle_list *tl = NULL; /* Target Resources */ 389 struct acpi_handle_list *tl = NULL; /* Target Resources */
401 int i = 0; 390 int i = 0;
402 391
403 ACPI_FUNCTION_TRACE("acpi_power_transition");
404 392
405 if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) 393 if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
406 return_VALUE(-EINVAL); 394 return -EINVAL;
407 395
408 if ((device->power.state < ACPI_STATE_D0) 396 if ((device->power.state < ACPI_STATE_D0)
409 || (device->power.state > ACPI_STATE_D3)) 397 || (device->power.state > ACPI_STATE_D3))
410 return_VALUE(-ENODEV); 398 return -ENODEV;
411 399
412 cl = &device->power.states[device->power.state].resources; 400 cl = &device->power.states[device->power.state].resources;
413 tl = &device->power.states[state].resources; 401 tl = &device->power.states[state].resources;
@@ -444,11 +432,10 @@ int acpi_power_transition(struct acpi_device *device, int state)
444 device->power.state = state; 432 device->power.state = state;
445 end: 433 end:
446 if (result) 434 if (result)
447 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 435 printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n",
448 "Error transitioning device [%s] to D%d\n", 436 device->pnp.bus_id, state);
449 device->pnp.bus_id, state));
450 437
451 return_VALUE(result); 438 return result;
452} 439}
453 440
454/* -------------------------------------------------------------------------- 441/* --------------------------------------------------------------------------
@@ -461,7 +448,6 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
461{ 448{
462 struct acpi_power_resource *resource = NULL; 449 struct acpi_power_resource *resource = NULL;
463 450
464 ACPI_FUNCTION_TRACE("acpi_power_seq_show");
465 451
466 resource = (struct acpi_power_resource *)seq->private; 452 resource = (struct acpi_power_resource *)seq->private;
467 453
@@ -488,7 +474,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
488 resource->order, resource->references); 474 resource->order, resource->references);
489 475
490 end: 476 end:
491 return_VALUE(0); 477 return 0;
492} 478}
493 479
494static int acpi_power_open_fs(struct inode *inode, struct file *file) 480static int acpi_power_open_fs(struct inode *inode, struct file *file)
@@ -500,36 +486,32 @@ static int acpi_power_add_fs(struct acpi_device *device)
500{ 486{
501 struct proc_dir_entry *entry = NULL; 487 struct proc_dir_entry *entry = NULL;
502 488
503 ACPI_FUNCTION_TRACE("acpi_power_add_fs");
504 489
505 if (!device) 490 if (!device)
506 return_VALUE(-EINVAL); 491 return -EINVAL;
507 492
508 if (!acpi_device_dir(device)) { 493 if (!acpi_device_dir(device)) {
509 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 494 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
510 acpi_power_dir); 495 acpi_power_dir);
511 if (!acpi_device_dir(device)) 496 if (!acpi_device_dir(device))
512 return_VALUE(-ENODEV); 497 return -ENODEV;
513 } 498 }
514 499
515 /* 'status' [R] */ 500 /* 'status' [R] */
516 entry = create_proc_entry(ACPI_POWER_FILE_STATUS, 501 entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
517 S_IRUGO, acpi_device_dir(device)); 502 S_IRUGO, acpi_device_dir(device));
518 if (!entry) 503 if (!entry)
519 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 504 return -EIO;
520 "Unable to create '%s' fs entry\n",
521 ACPI_POWER_FILE_STATUS));
522 else { 505 else {
523 entry->proc_fops = &acpi_power_fops; 506 entry->proc_fops = &acpi_power_fops;
524 entry->data = acpi_driver_data(device); 507 entry->data = acpi_driver_data(device);
525 } 508 }
526 509
527 return_VALUE(0); 510 return 0;
528} 511}
529 512
530static int acpi_power_remove_fs(struct acpi_device *device) 513static int acpi_power_remove_fs(struct acpi_device *device)
531{ 514{
532 ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
533 515
534 if (acpi_device_dir(device)) { 516 if (acpi_device_dir(device)) {
535 remove_proc_entry(ACPI_POWER_FILE_STATUS, 517 remove_proc_entry(ACPI_POWER_FILE_STATUS,
@@ -538,7 +520,7 @@ static int acpi_power_remove_fs(struct acpi_device *device)
538 acpi_device_dir(device) = NULL; 520 acpi_device_dir(device) = NULL;
539 } 521 }
540 522
541 return_VALUE(0); 523 return 0;
542} 524}
543 525
544/* -------------------------------------------------------------------------- 526/* --------------------------------------------------------------------------
@@ -553,14 +535,13 @@ static int acpi_power_add(struct acpi_device *device)
553 union acpi_object acpi_object; 535 union acpi_object acpi_object;
554 struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object }; 536 struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };
555 537
556 ACPI_FUNCTION_TRACE("acpi_power_add");
557 538
558 if (!device) 539 if (!device)
559 return_VALUE(-EINVAL); 540 return -EINVAL;
560 541
561 resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL); 542 resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL);
562 if (!resource) 543 if (!resource)
563 return_VALUE(-ENOMEM); 544 return -ENOMEM;
564 memset(resource, 0, sizeof(struct acpi_power_resource)); 545 memset(resource, 0, sizeof(struct acpi_power_resource));
565 546
566 resource->handle = device->handle; 547 resource->handle = device->handle;
@@ -605,17 +586,16 @@ static int acpi_power_add(struct acpi_device *device)
605 if (result) 586 if (result)
606 kfree(resource); 587 kfree(resource);
607 588
608 return_VALUE(result); 589 return result;
609} 590}
610 591
611static int acpi_power_remove(struct acpi_device *device, int type) 592static int acpi_power_remove(struct acpi_device *device, int type)
612{ 593{
613 struct acpi_power_resource *resource = NULL; 594 struct acpi_power_resource *resource = NULL;
614 595
615 ACPI_FUNCTION_TRACE("acpi_power_remove");
616 596
617 if (!device || !acpi_driver_data(device)) 597 if (!device || !acpi_driver_data(device))
618 return_VALUE(-EINVAL); 598 return -EINVAL;
619 599
620 resource = (struct acpi_power_resource *)acpi_driver_data(device); 600 resource = (struct acpi_power_resource *)acpi_driver_data(device);
621 601
@@ -623,31 +603,30 @@ static int acpi_power_remove(struct acpi_device *device, int type)
623 603
624 kfree(resource); 604 kfree(resource);
625 605
626 return_VALUE(0); 606 return 0;
627} 607}
628 608
629static int __init acpi_power_init(void) 609static int __init acpi_power_init(void)
630{ 610{
631 int result = 0; 611 int result = 0;
632 612
633 ACPI_FUNCTION_TRACE("acpi_power_init");
634 613
635 if (acpi_disabled) 614 if (acpi_disabled)
636 return_VALUE(0); 615 return 0;
637 616
638 INIT_LIST_HEAD(&acpi_power_resource_list); 617 INIT_LIST_HEAD(&acpi_power_resource_list);
639 618
640 acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir); 619 acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
641 if (!acpi_power_dir) 620 if (!acpi_power_dir)
642 return_VALUE(-ENODEV); 621 return -ENODEV;
643 622
644 result = acpi_bus_register_driver(&acpi_power_driver); 623 result = acpi_bus_register_driver(&acpi_power_driver);
645 if (result < 0) { 624 if (result < 0) {
646 remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir); 625 remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
647 return_VALUE(-ENODEV); 626 return -ENODEV;
648 } 627 }
649 628
650 return_VALUE(0); 629 return 0;
651} 630}
652 631
653subsys_initcall(acpi_power_init); 632subsys_initcall(acpi_power_init);
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index decaebb4cbe9..52674323b14d 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -122,10 +122,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
122 u8 value1 = 0; 122 u8 value1 = 0;
123 u8 value2 = 0; 123 u8 value2 = 0;
124 124
125 ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4");
126 125
127 if (!dev) 126 if (!dev)
128 return_VALUE(-EINVAL); 127 return -EINVAL;
129 128
130 /* 129 /*
131 * Note that 'dev' references the PIIX4 ACPI Controller. 130 * Note that 'dev' references the PIIX4 ACPI Controller.
@@ -218,7 +217,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
218 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 217 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
219 "Type-F DMA livelock erratum (C3 disabled)\n")); 218 "Type-F DMA livelock erratum (C3 disabled)\n"));
220 219
221 return_VALUE(0); 220 return 0;
222} 221}
223 222
224static int acpi_processor_errata(struct acpi_processor *pr) 223static int acpi_processor_errata(struct acpi_processor *pr)
@@ -226,10 +225,9 @@ static int acpi_processor_errata(struct acpi_processor *pr)
226 int result = 0; 225 int result = 0;
227 struct pci_dev *dev = NULL; 226 struct pci_dev *dev = NULL;
228 227
229 ACPI_FUNCTION_TRACE("acpi_processor_errata");
230 228
231 if (!pr) 229 if (!pr)
232 return_VALUE(-EINVAL); 230 return -EINVAL;
233 231
234 /* 232 /*
235 * PIIX4 233 * PIIX4
@@ -242,7 +240,7 @@ static int acpi_processor_errata(struct acpi_processor *pr)
242 pci_dev_put(dev); 240 pci_dev_put(dev);
243 } 241 }
244 242
245 return_VALUE(result); 243 return result;
246} 244}
247 245
248/* -------------------------------------------------------------------------- 246/* --------------------------------------------------------------------------
@@ -258,10 +256,9 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr)
258 struct acpi_object_list *pdc_in = pr->pdc; 256 struct acpi_object_list *pdc_in = pr->pdc;
259 acpi_status status = AE_OK; 257 acpi_status status = AE_OK;
260 258
261 ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
262 259
263 if (!pdc_in) 260 if (!pdc_in)
264 return_VALUE(status); 261 return status;
265 262
266 status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL); 263 status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
267 264
@@ -269,7 +266,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr)
269 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 266 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
270 "Could not evaluate _PDC, using legacy perf. control...\n")); 267 "Could not evaluate _PDC, using legacy perf. control...\n"));
271 268
272 return_VALUE(status); 269 return status;
273} 270}
274 271
275/* -------------------------------------------------------------------------- 272/* --------------------------------------------------------------------------
@@ -282,7 +279,6 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
282{ 279{
283 struct acpi_processor *pr = (struct acpi_processor *)seq->private; 280 struct acpi_processor *pr = (struct acpi_processor *)seq->private;
284 281
285 ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show");
286 282
287 if (!pr) 283 if (!pr)
288 goto end; 284 goto end;
@@ -301,7 +297,7 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
301 pr->flags.limit ? "yes" : "no"); 297 pr->flags.limit ? "yes" : "no");
302 298
303 end: 299 end:
304 return_VALUE(0); 300 return 0;
305} 301}
306 302
307static int acpi_processor_info_open_fs(struct inode *inode, struct file *file) 303static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
@@ -314,13 +310,12 @@ static int acpi_processor_add_fs(struct acpi_device *device)
314{ 310{
315 struct proc_dir_entry *entry = NULL; 311 struct proc_dir_entry *entry = NULL;
316 312
317 ACPI_FUNCTION_TRACE("acpi_processor_add_fs");
318 313
319 if (!acpi_device_dir(device)) { 314 if (!acpi_device_dir(device)) {
320 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 315 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
321 acpi_processor_dir); 316 acpi_processor_dir);
322 if (!acpi_device_dir(device)) 317 if (!acpi_device_dir(device))
323 return_VALUE(-ENODEV); 318 return -ENODEV;
324 } 319 }
325 acpi_device_dir(device)->owner = THIS_MODULE; 320 acpi_device_dir(device)->owner = THIS_MODULE;
326 321
@@ -328,9 +323,7 @@ static int acpi_processor_add_fs(struct acpi_device *device)
328 entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO, 323 entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,
329 S_IRUGO, acpi_device_dir(device)); 324 S_IRUGO, acpi_device_dir(device));
330 if (!entry) 325 if (!entry)
331 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 326 return -EIO;
332 "Unable to create '%s' fs entry\n",
333 ACPI_PROCESSOR_FILE_INFO));
334 else { 327 else {
335 entry->proc_fops = &acpi_processor_info_fops; 328 entry->proc_fops = &acpi_processor_info_fops;
336 entry->data = acpi_driver_data(device); 329 entry->data = acpi_driver_data(device);
@@ -342,9 +335,7 @@ static int acpi_processor_add_fs(struct acpi_device *device)
342 S_IFREG | S_IRUGO | S_IWUSR, 335 S_IFREG | S_IRUGO | S_IWUSR,
343 acpi_device_dir(device)); 336 acpi_device_dir(device));
344 if (!entry) 337 if (!entry)
345 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 338 return -EIO;
346 "Unable to create '%s' fs entry\n",
347 ACPI_PROCESSOR_FILE_THROTTLING));
348 else { 339 else {
349 entry->proc_fops = &acpi_processor_throttling_fops; 340 entry->proc_fops = &acpi_processor_throttling_fops;
350 entry->data = acpi_driver_data(device); 341 entry->data = acpi_driver_data(device);
@@ -356,21 +347,18 @@ static int acpi_processor_add_fs(struct acpi_device *device)
356 S_IFREG | S_IRUGO | S_IWUSR, 347 S_IFREG | S_IRUGO | S_IWUSR,
357 acpi_device_dir(device)); 348 acpi_device_dir(device));
358 if (!entry) 349 if (!entry)
359 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 350 return -EIO;
360 "Unable to create '%s' fs entry\n",
361 ACPI_PROCESSOR_FILE_LIMIT));
362 else { 351 else {
363 entry->proc_fops = &acpi_processor_limit_fops; 352 entry->proc_fops = &acpi_processor_limit_fops;
364 entry->data = acpi_driver_data(device); 353 entry->data = acpi_driver_data(device);
365 entry->owner = THIS_MODULE; 354 entry->owner = THIS_MODULE;
366 } 355 }
367 356
368 return_VALUE(0); 357 return 0;
369} 358}
370 359
371static int acpi_processor_remove_fs(struct acpi_device *device) 360static int acpi_processor_remove_fs(struct acpi_device *device)
372{ 361{
373 ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");
374 362
375 if (acpi_device_dir(device)) { 363 if (acpi_device_dir(device)) {
376 remove_proc_entry(ACPI_PROCESSOR_FILE_INFO, 364 remove_proc_entry(ACPI_PROCESSOR_FILE_INFO,
@@ -383,7 +371,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
383 acpi_device_dir(device) = NULL; 371 acpi_device_dir(device) = NULL;
384 } 372 }
385 373
386 return_VALUE(0); 374 return 0;
387} 375}
388 376
389/* Use the acpiid in MADT to map cpus in case of SMP */ 377/* Use the acpiid in MADT to map cpus in case of SMP */
@@ -430,10 +418,9 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
430 int cpu_index; 418 int cpu_index;
431 static int cpu0_initialized; 419 static int cpu0_initialized;
432 420
433 ACPI_FUNCTION_TRACE("acpi_processor_get_info");
434 421
435 if (!pr) 422 if (!pr)
436 return_VALUE(-EINVAL); 423 return -EINVAL;
437 424
438 if (num_online_cpus() > 1) 425 if (num_online_cpus() > 1)
439 errata.smp = TRUE; 426 errata.smp = TRUE;
@@ -459,9 +446,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
459 */ 446 */
460 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); 447 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
461 if (ACPI_FAILURE(status)) { 448 if (ACPI_FAILURE(status)) {
462 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 449 printk(KERN_ERR PREFIX "Evaluating processor object\n");
463 "Error evaluating processor object\n")); 450 return -ENODEV;
464 return_VALUE(-ENODEV);
465 } 451 }
466 452
467 /* 453 /*
@@ -490,10 +476,10 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
490 if (cpu_index == -1) { 476 if (cpu_index == -1) {
491 if (ACPI_FAILURE 477 if (ACPI_FAILURE
492 (acpi_processor_hotadd_init(pr->handle, &pr->id))) { 478 (acpi_processor_hotadd_init(pr->handle, &pr->id))) {
493 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 479 printk(KERN_ERR PREFIX
494 "Error getting cpuindex for acpiid 0x%x\n", 480 "Getting cpuindex for acpiid 0x%x\n",
495 pr->acpi_id)); 481 pr->acpi_id);
496 return_VALUE(-ENODEV); 482 return -ENODEV;
497 } 483 }
498 } 484 }
499 485
@@ -503,8 +489,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
503 if (!object.processor.pblk_address) 489 if (!object.processor.pblk_address)
504 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); 490 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
505 else if (object.processor.pblk_length != 6) 491 else if (object.processor.pblk_length != 6)
506 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n", 492 printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n",
507 object.processor.pblk_length)); 493 object.processor.pblk_length);
508 else { 494 else {
509 pr->throttling.address = object.processor.pblk_address; 495 pr->throttling.address = object.processor.pblk_address;
510 pr->throttling.duty_offset = acpi_fadt.duty_offset; 496 pr->throttling.duty_offset = acpi_fadt.duty_offset;
@@ -528,7 +514,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
528 acpi_processor_get_throttling_info(pr); 514 acpi_processor_get_throttling_info(pr);
529 acpi_processor_get_limit_info(pr); 515 acpi_processor_get_limit_info(pr);
530 516
531 return_VALUE(0); 517 return 0;
532} 518}
533 519
534static void *processor_device_array[NR_CPUS]; 520static void *processor_device_array[NR_CPUS];
@@ -539,14 +525,13 @@ static int acpi_processor_start(struct acpi_device *device)
539 acpi_status status = AE_OK; 525 acpi_status status = AE_OK;
540 struct acpi_processor *pr; 526 struct acpi_processor *pr;
541 527
542 ACPI_FUNCTION_TRACE("acpi_processor_start");
543 528
544 pr = acpi_driver_data(device); 529 pr = acpi_driver_data(device);
545 530
546 result = acpi_processor_get_info(pr); 531 result = acpi_processor_get_info(pr);
547 if (result) { 532 if (result) {
548 /* Processor is physically not present */ 533 /* Processor is physically not present */
549 return_VALUE(0); 534 return 0;
550 } 535 }
551 536
552 BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0)); 537 BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
@@ -560,7 +545,7 @@ static int acpi_processor_start(struct acpi_device *device)
560 processor_device_array[pr->id] != (void *)device) { 545 processor_device_array[pr->id] != (void *)device) {
561 printk(KERN_WARNING "BIOS reported wrong ACPI id" 546 printk(KERN_WARNING "BIOS reported wrong ACPI id"
562 "for the processor\n"); 547 "for the processor\n");
563 return_VALUE(-ENODEV); 548 return -ENODEV;
564 } 549 }
565 processor_device_array[pr->id] = (void *)device; 550 processor_device_array[pr->id] = (void *)device;
566 551
@@ -572,10 +557,6 @@ static int acpi_processor_start(struct acpi_device *device)
572 557
573 status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, 558 status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
574 acpi_processor_notify, pr); 559 acpi_processor_notify, pr);
575 if (ACPI_FAILURE(status)) {
576 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
577 "Error installing device notify handler\n"));
578 }
579 560
580 /* _PDC call should be done before doing anything else (if reqd.). */ 561 /* _PDC call should be done before doing anything else (if reqd.). */
581 arch_acpi_processor_init_pdc(pr); 562 arch_acpi_processor_init_pdc(pr);
@@ -592,7 +573,7 @@ static int acpi_processor_start(struct acpi_device *device)
592 573
593 end: 574 end:
594 575
595 return_VALUE(result); 576 return result;
596} 577}
597 578
598static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) 579static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
@@ -600,13 +581,12 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
600 struct acpi_processor *pr = (struct acpi_processor *)data; 581 struct acpi_processor *pr = (struct acpi_processor *)data;
601 struct acpi_device *device = NULL; 582 struct acpi_device *device = NULL;
602 583
603 ACPI_FUNCTION_TRACE("acpi_processor_notify");
604 584
605 if (!pr) 585 if (!pr)
606 return_VOID; 586 return;
607 587
608 if (acpi_bus_get_device(pr->handle, &device)) 588 if (acpi_bus_get_device(pr->handle, &device))
609 return_VOID; 589 return;
610 590
611 switch (event) { 591 switch (event) {
612 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: 592 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
@@ -624,21 +604,20 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
624 break; 604 break;
625 } 605 }
626 606
627 return_VOID; 607 return;
628} 608}
629 609
630static int acpi_processor_add(struct acpi_device *device) 610static int acpi_processor_add(struct acpi_device *device)
631{ 611{
632 struct acpi_processor *pr = NULL; 612 struct acpi_processor *pr = NULL;
633 613
634 ACPI_FUNCTION_TRACE("acpi_processor_add");
635 614
636 if (!device) 615 if (!device)
637 return_VALUE(-EINVAL); 616 return -EINVAL;
638 617
639 pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL); 618 pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL);
640 if (!pr) 619 if (!pr)
641 return_VALUE(-ENOMEM); 620 return -ENOMEM;
642 memset(pr, 0, sizeof(struct acpi_processor)); 621 memset(pr, 0, sizeof(struct acpi_processor));
643 622
644 pr->handle = device->handle; 623 pr->handle = device->handle;
@@ -646,7 +625,7 @@ static int acpi_processor_add(struct acpi_device *device)
646 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); 625 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
647 acpi_driver_data(device) = pr; 626 acpi_driver_data(device) = pr;
648 627
649 return_VALUE(0); 628 return 0;
650} 629}
651 630
652static int acpi_processor_remove(struct acpi_device *device, int type) 631static int acpi_processor_remove(struct acpi_device *device, int type)
@@ -654,31 +633,26 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
654 acpi_status status = AE_OK; 633 acpi_status status = AE_OK;
655 struct acpi_processor *pr = NULL; 634 struct acpi_processor *pr = NULL;
656 635
657 ACPI_FUNCTION_TRACE("acpi_processor_remove");
658 636
659 if (!device || !acpi_driver_data(device)) 637 if (!device || !acpi_driver_data(device))
660 return_VALUE(-EINVAL); 638 return -EINVAL;
661 639
662 pr = (struct acpi_processor *)acpi_driver_data(device); 640 pr = (struct acpi_processor *)acpi_driver_data(device);
663 641
664 if (pr->id >= NR_CPUS) { 642 if (pr->id >= NR_CPUS) {
665 kfree(pr); 643 kfree(pr);
666 return_VALUE(0); 644 return 0;
667 } 645 }
668 646
669 if (type == ACPI_BUS_REMOVAL_EJECT) { 647 if (type == ACPI_BUS_REMOVAL_EJECT) {
670 if (acpi_processor_handle_eject(pr)) 648 if (acpi_processor_handle_eject(pr))
671 return_VALUE(-EINVAL); 649 return -EINVAL;
672 } 650 }
673 651
674 acpi_processor_power_exit(pr, device); 652 acpi_processor_power_exit(pr, device);
675 653
676 status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, 654 status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
677 acpi_processor_notify); 655 acpi_processor_notify);
678 if (ACPI_FAILURE(status)) {
679 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
680 "Error removing notify handler\n"));
681 }
682 656
683 acpi_processor_remove_fs(device); 657 acpi_processor_remove_fs(device);
684 658
@@ -686,7 +660,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
686 660
687 kfree(pr); 661 kfree(pr);
688 662
689 return_VALUE(0); 663 return 0;
690} 664}
691 665
692#ifdef CONFIG_ACPI_HOTPLUG_CPU 666#ifdef CONFIG_ACPI_HOTPLUG_CPU
@@ -701,15 +675,13 @@ static int is_processor_present(acpi_handle handle)
701 acpi_status status; 675 acpi_status status;
702 unsigned long sta = 0; 676 unsigned long sta = 0;
703 677
704 ACPI_FUNCTION_TRACE("is_processor_present");
705 678
706 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 679 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
707 if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) { 680 if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
708 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 681 ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
709 "Processor Device is not present\n")); 682 return 0;
710 return_VALUE(0);
711 } 683 }
712 return_VALUE(1); 684 return 1;
713} 685}
714 686
715static 687static
@@ -719,30 +691,29 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
719 struct acpi_device *pdev; 691 struct acpi_device *pdev;
720 struct acpi_processor *pr; 692 struct acpi_processor *pr;
721 693
722 ACPI_FUNCTION_TRACE("acpi_processor_device_add");
723 694
724 if (acpi_get_parent(handle, &phandle)) { 695 if (acpi_get_parent(handle, &phandle)) {
725 return_VALUE(-ENODEV); 696 return -ENODEV;
726 } 697 }
727 698
728 if (acpi_bus_get_device(phandle, &pdev)) { 699 if (acpi_bus_get_device(phandle, &pdev)) {
729 return_VALUE(-ENODEV); 700 return -ENODEV;
730 } 701 }
731 702
732 if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) { 703 if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) {
733 return_VALUE(-ENODEV); 704 return -ENODEV;
734 } 705 }
735 706
736 acpi_bus_start(*device); 707 acpi_bus_start(*device);
737 708
738 pr = acpi_driver_data(*device); 709 pr = acpi_driver_data(*device);
739 if (!pr) 710 if (!pr)
740 return_VALUE(-ENODEV); 711 return -ENODEV;
741 712
742 if ((pr->id >= 0) && (pr->id < NR_CPUS)) { 713 if ((pr->id >= 0) && (pr->id < NR_CPUS)) {
743 kobject_uevent(&(*device)->kobj, KOBJ_ONLINE); 714 kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);
744 } 715 }
745 return_VALUE(0); 716 return 0;
746} 717}
747 718
748static void 719static void
@@ -752,7 +723,6 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
752 struct acpi_device *device = NULL; 723 struct acpi_device *device = NULL;
753 int result; 724 int result;
754 725
755 ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify");
756 726
757 switch (event) { 727 switch (event) {
758 case ACPI_NOTIFY_BUS_CHECK: 728 case ACPI_NOTIFY_BUS_CHECK:
@@ -767,15 +737,14 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
767 if (acpi_bus_get_device(handle, &device)) { 737 if (acpi_bus_get_device(handle, &device)) {
768 result = acpi_processor_device_add(handle, &device); 738 result = acpi_processor_device_add(handle, &device);
769 if (result) 739 if (result)
770 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 740 printk(KERN_ERR PREFIX
771 "Unable to add the device\n")); 741 "Unable to add the device\n");
772 break; 742 break;
773 } 743 }
774 744
775 pr = acpi_driver_data(device); 745 pr = acpi_driver_data(device);
776 if (!pr) { 746 if (!pr) {
777 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 747 printk(KERN_ERR PREFIX "Driver data is NULL\n");
778 "Driver data is NULL\n"));
779 break; 748 break;
780 } 749 }
781 750
@@ -788,9 +757,8 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
788 if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) { 757 if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
789 kobject_uevent(&device->kobj, KOBJ_ONLINE); 758 kobject_uevent(&device->kobj, KOBJ_ONLINE);
790 } else { 759 } else {
791 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 760 printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
792 "Device [%s] failed to start\n", 761 acpi_device_bid(device));
793 acpi_device_bid(device)));
794 } 762 }
795 break; 763 break;
796 case ACPI_NOTIFY_EJECT_REQUEST: 764 case ACPI_NOTIFY_EJECT_REQUEST:
@@ -798,15 +766,15 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
798 "received ACPI_NOTIFY_EJECT_REQUEST\n")); 766 "received ACPI_NOTIFY_EJECT_REQUEST\n"));
799 767
800 if (acpi_bus_get_device(handle, &device)) { 768 if (acpi_bus_get_device(handle, &device)) {
801 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 769 printk(KERN_ERR PREFIX
802 "Device don't exist, dropping EJECT\n")); 770 "Device don't exist, dropping EJECT\n");
803 break; 771 break;
804 } 772 }
805 pr = acpi_driver_data(device); 773 pr = acpi_driver_data(device);
806 if (!pr) { 774 if (!pr) {
807 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 775 printk(KERN_ERR PREFIX
808 "Driver data is NULL, dropping EJECT\n")); 776 "Driver data is NULL, dropping EJECT\n");
809 return_VOID; 777 return;
810 } 778 }
811 779
812 if ((pr->id < NR_CPUS) && (cpu_present(pr->id))) 780 if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
@@ -818,7 +786,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
818 break; 786 break;
819 } 787 }
820 788
821 return_VOID; 789 return;
822} 790}
823 791
824static acpi_status 792static acpi_status
@@ -857,21 +825,20 @@ processor_walk_namespace_cb(acpi_handle handle,
857 825
858static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu) 826static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu)
859{ 827{
860 ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init");
861 828
862 if (!is_processor_present(handle)) { 829 if (!is_processor_present(handle)) {
863 return_VALUE(AE_ERROR); 830 return AE_ERROR;
864 } 831 }
865 832
866 if (acpi_map_lsapic(handle, p_cpu)) 833 if (acpi_map_lsapic(handle, p_cpu))
867 return_VALUE(AE_ERROR); 834 return AE_ERROR;
868 835
869 if (arch_register_cpu(*p_cpu)) { 836 if (arch_register_cpu(*p_cpu)) {
870 acpi_unmap_lsapic(*p_cpu); 837 acpi_unmap_lsapic(*p_cpu);
871 return_VALUE(AE_ERROR); 838 return AE_ERROR;
872 } 839 }
873 840
874 return_VALUE(AE_OK); 841 return AE_OK;
875} 842}
876 843
877static int acpi_processor_handle_eject(struct acpi_processor *pr) 844static int acpi_processor_handle_eject(struct acpi_processor *pr)
@@ -928,20 +895,19 @@ static int __init acpi_processor_init(void)
928{ 895{
929 int result = 0; 896 int result = 0;
930 897
931 ACPI_FUNCTION_TRACE("acpi_processor_init");
932 898
933 memset(&processors, 0, sizeof(processors)); 899 memset(&processors, 0, sizeof(processors));
934 memset(&errata, 0, sizeof(errata)); 900 memset(&errata, 0, sizeof(errata));
935 901
936 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 902 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
937 if (!acpi_processor_dir) 903 if (!acpi_processor_dir)
938 return_VALUE(0); 904 return 0;
939 acpi_processor_dir->owner = THIS_MODULE; 905 acpi_processor_dir->owner = THIS_MODULE;
940 906
941 result = acpi_bus_register_driver(&acpi_processor_driver); 907 result = acpi_bus_register_driver(&acpi_processor_driver);
942 if (result < 0) { 908 if (result < 0) {
943 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 909 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
944 return_VALUE(0); 910 return 0;
945 } 911 }
946 912
947 acpi_processor_install_hotplug_notify(); 913 acpi_processor_install_hotplug_notify();
@@ -950,12 +916,11 @@ static int __init acpi_processor_init(void)
950 916
951 acpi_processor_ppc_init(); 917 acpi_processor_ppc_init();
952 918
953 return_VALUE(0); 919 return 0;
954} 920}
955 921
956static void __exit acpi_processor_exit(void) 922static void __exit acpi_processor_exit(void)
957{ 923{
958 ACPI_FUNCTION_TRACE("acpi_processor_exit");
959 924
960 acpi_processor_ppc_exit(); 925 acpi_processor_ppc_exit();
961 926
@@ -967,7 +932,7 @@ static void __exit acpi_processor_exit(void)
967 932
968 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 933 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
969 934
970 return_VOID; 935 return;
971} 936}
972 937
973module_init(acpi_processor_init); 938module_init(acpi_processor_init);
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 8a74bf3efd8e..e439eb77d283 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> 4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
6 * Copyright (C) 2004 Dominik Brodowski <linux@brodo.de> 6 * Copyright (C) 2004, 2005 Dominik Brodowski <linux@brodo.de>
7 * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> 7 * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
8 * - Added processor hotplug support 8 * - Added processor hotplug support
9 * Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 9 * Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
@@ -99,6 +99,9 @@ static int set_max_cstate(struct dmi_system_id *id)
99static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { 99static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
100 { set_max_cstate, "IBM ThinkPad R40e", { 100 { set_max_cstate, "IBM ThinkPad R40e", {
101 DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), 101 DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
102 DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1},
103 { set_max_cstate, "IBM ThinkPad R40e", {
104 DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
102 DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1}, 105 DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1},
103 { set_max_cstate, "IBM ThinkPad R40e", { 106 { set_max_cstate, "IBM ThinkPad R40e", {
104 DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), 107 DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
@@ -261,21 +264,15 @@ static void acpi_processor_idle(void)
261 u32 bm_status = 0; 264 u32 bm_status = 0;
262 unsigned long diff = jiffies - pr->power.bm_check_timestamp; 265 unsigned long diff = jiffies - pr->power.bm_check_timestamp;
263 266
264 if (diff > 32) 267 if (diff > 31)
265 diff = 32; 268 diff = 31;
266 269
267 while (diff) { 270 pr->power.bm_activity <<= diff;
268 /* if we didn't get called, assume there was busmaster activity */
269 diff--;
270 if (diff)
271 pr->power.bm_activity |= 0x1;
272 pr->power.bm_activity <<= 1;
273 }
274 271
275 acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, 272 acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS,
276 &bm_status, ACPI_MTX_DO_NOT_LOCK); 273 &bm_status, ACPI_MTX_DO_NOT_LOCK);
277 if (bm_status) { 274 if (bm_status) {
278 pr->power.bm_activity++; 275 pr->power.bm_activity |= 0x1;
279 acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 276 acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS,
280 1, ACPI_MTX_DO_NOT_LOCK); 277 1, ACPI_MTX_DO_NOT_LOCK);
281 } 278 }
@@ -287,16 +284,16 @@ static void acpi_processor_idle(void)
287 else if (errata.piix4.bmisx) { 284 else if (errata.piix4.bmisx) {
288 if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) 285 if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01)
289 || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) 286 || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
290 pr->power.bm_activity++; 287 pr->power.bm_activity |= 0x1;
291 } 288 }
292 289
293 pr->power.bm_check_timestamp = jiffies; 290 pr->power.bm_check_timestamp = jiffies;
294 291
295 /* 292 /*
296 * Apply bus mastering demotion policy. Automatically demote 293 * If bus mastering is or was active this jiffy, demote
297 * to avoid a faulty transition. Note that the processor 294 * to avoid a faulty transition. Note that the processor
298 * won't enter a low-power state during this call (to this 295 * won't enter a low-power state during this call (to this
299 * funciton) but should upon the next. 296 * function) but should upon the next.
300 * 297 *
301 * TBD: A better policy might be to fallback to the demotion 298 * TBD: A better policy might be to fallback to the demotion
302 * state (use it for this quantum only) istead of 299 * state (use it for this quantum only) istead of
@@ -304,7 +301,8 @@ static void acpi_processor_idle(void)
304 * qualification. This may, however, introduce DMA 301 * qualification. This may, however, introduce DMA
305 * issues (e.g. floppy DMA transfer overrun/underrun). 302 * issues (e.g. floppy DMA transfer overrun/underrun).
306 */ 303 */
307 if (pr->power.bm_activity & cx->demotion.threshold.bm) { 304 if ((pr->power.bm_activity & 0x1) &&
305 cx->demotion.threshold.bm) {
308 local_irq_enable(); 306 local_irq_enable();
309 next_state = cx->demotion.state; 307 next_state = cx->demotion.state;
310 goto end; 308 goto end;
@@ -322,8 +320,6 @@ static void acpi_processor_idle(void)
322 cx = &pr->power.states[ACPI_STATE_C1]; 320 cx = &pr->power.states[ACPI_STATE_C1];
323#endif 321#endif
324 322
325 cx->usage++;
326
327 /* 323 /*
328 * Sleep: 324 * Sleep:
329 * ------ 325 * ------
@@ -365,7 +361,9 @@ static void acpi_processor_idle(void)
365 t1 = inl(acpi_fadt.xpm_tmr_blk.address); 361 t1 = inl(acpi_fadt.xpm_tmr_blk.address);
366 /* Invoke C2 */ 362 /* Invoke C2 */
367 inb(cx->address); 363 inb(cx->address);
368 /* Dummy op - must do something useless after P_LVL2 read */ 364 /* Dummy wait op - must do something useless after P_LVL2 read
365 because chipsets cannot guarantee that STPCLK# signal
366 gets asserted in time to freeze execution properly. */
369 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 367 t2 = inl(acpi_fadt.xpm_tmr_blk.address);
370 /* Get end time (ticks) */ 368 /* Get end time (ticks) */
371 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 369 t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -403,7 +401,7 @@ static void acpi_processor_idle(void)
403 t1 = inl(acpi_fadt.xpm_tmr_blk.address); 401 t1 = inl(acpi_fadt.xpm_tmr_blk.address);
404 /* Invoke C3 */ 402 /* Invoke C3 */
405 inb(cx->address); 403 inb(cx->address);
406 /* Dummy op - must do something useless after P_LVL3 read */ 404 /* Dummy wait op (see above) */
407 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 405 t2 = inl(acpi_fadt.xpm_tmr_blk.address);
408 /* Get end time (ticks) */ 406 /* Get end time (ticks) */
409 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 407 t2 = inl(acpi_fadt.xpm_tmr_blk.address);
@@ -430,6 +428,9 @@ static void acpi_processor_idle(void)
430 local_irq_enable(); 428 local_irq_enable();
431 return; 429 return;
432 } 430 }
431 cx->usage++;
432 if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0))
433 cx->time += sleep_ticks;
433 434
434 next_state = pr->power.state; 435 next_state = pr->power.state;
435 436
@@ -517,10 +518,9 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
517 struct acpi_processor_cx *higher = NULL; 518 struct acpi_processor_cx *higher = NULL;
518 struct acpi_processor_cx *cx; 519 struct acpi_processor_cx *cx;
519 520
520 ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy");
521 521
522 if (!pr) 522 if (!pr)
523 return_VALUE(-EINVAL); 523 return -EINVAL;
524 524
525 /* 525 /*
526 * This function sets the default Cx state policy (OS idle handler). 526 * This function sets the default Cx state policy (OS idle handler).
@@ -544,7 +544,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
544 } 544 }
545 545
546 if (!state_is_set) 546 if (!state_is_set)
547 return_VALUE(-ENODEV); 547 return -ENODEV;
548 548
549 /* demotion */ 549 /* demotion */
550 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { 550 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
@@ -583,18 +583,17 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
583 higher = cx; 583 higher = cx;
584 } 584 }
585 585
586 return_VALUE(0); 586 return 0;
587} 587}
588 588
589static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) 589static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
590{ 590{
591 ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt");
592 591
593 if (!pr) 592 if (!pr)
594 return_VALUE(-EINVAL); 593 return -EINVAL;
595 594
596 if (!pr->pblk) 595 if (!pr->pblk)
597 return_VALUE(-ENODEV); 596 return -ENODEV;
598 597
599 /* if info is obtained from pblk/fadt, type equals state */ 598 /* if info is obtained from pblk/fadt, type equals state */
600 pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2; 599 pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
@@ -606,7 +605,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
606 * an SMP system. 605 * an SMP system.
607 */ 606 */
608 if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) 607 if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
609 return_VALUE(-ENODEV); 608 return -ENODEV;
610#endif 609#endif
611 610
612 /* determine C2 and C3 address from pblk */ 611 /* determine C2 and C3 address from pblk */
@@ -622,12 +621,11 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
622 pr->power.states[ACPI_STATE_C2].address, 621 pr->power.states[ACPI_STATE_C2].address,
623 pr->power.states[ACPI_STATE_C3].address)); 622 pr->power.states[ACPI_STATE_C3].address));
624 623
625 return_VALUE(0); 624 return 0;
626} 625}
627 626
628static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) 627static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
629{ 628{
630 ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
631 629
632 /* Zero initialize all the C-states info. */ 630 /* Zero initialize all the C-states info. */
633 memset(pr->power.states, 0, sizeof(pr->power.states)); 631 memset(pr->power.states, 0, sizeof(pr->power.states));
@@ -640,7 +638,7 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
640 pr->power.states[ACPI_STATE_C0].valid = 1; 638 pr->power.states[ACPI_STATE_C0].valid = 1;
641 pr->power.states[ACPI_STATE_C1].valid = 1; 639 pr->power.states[ACPI_STATE_C1].valid = 1;
642 640
643 return_VALUE(0); 641 return 0;
644} 642}
645 643
646static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) 644static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
@@ -652,10 +650,9 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
652 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 650 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
653 union acpi_object *cst; 651 union acpi_object *cst;
654 652
655 ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst");
656 653
657 if (nocst) 654 if (nocst)
658 return_VALUE(-ENODEV); 655 return -ENODEV;
659 656
660 current_count = 1; 657 current_count = 1;
661 658
@@ -667,15 +664,14 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
667 status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer); 664 status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
668 if (ACPI_FAILURE(status)) { 665 if (ACPI_FAILURE(status)) {
669 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n")); 666 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n"));
670 return_VALUE(-ENODEV); 667 return -ENODEV;
671 } 668 }
672 669
673 cst = (union acpi_object *)buffer.pointer; 670 cst = (union acpi_object *)buffer.pointer;
674 671
675 /* There must be at least 2 elements */ 672 /* There must be at least 2 elements */
676 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) { 673 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
677 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 674 printk(KERN_ERR PREFIX "not enough elements in _CST\n");
678 "not enough elements in _CST\n"));
679 status = -EFAULT; 675 status = -EFAULT;
680 goto end; 676 goto end;
681 } 677 }
@@ -684,8 +680,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
684 680
685 /* Validate number of power states. */ 681 /* Validate number of power states. */
686 if (count < 1 || count != cst->package.count - 1) { 682 if (count < 1 || count != cst->package.count - 1) {
687 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 683 printk(KERN_ERR PREFIX "count given by _CST is not valid\n");
688 "count given by _CST is not valid\n"));
689 status = -EFAULT; 684 status = -EFAULT;
690 goto end; 685 goto end;
691 } 686 }
@@ -775,15 +770,14 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
775 end: 770 end:
776 acpi_os_free(buffer.pointer); 771 acpi_os_free(buffer.pointer);
777 772
778 return_VALUE(status); 773 return status;
779} 774}
780 775
781static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) 776static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
782{ 777{
783 ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2");
784 778
785 if (!cx->address) 779 if (!cx->address)
786 return_VOID; 780 return;
787 781
788 /* 782 /*
789 * C2 latency must be less than or equal to 100 783 * C2 latency must be less than or equal to 100
@@ -792,7 +786,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
792 else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { 786 else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
793 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 787 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
794 "latency too large [%d]\n", cx->latency)); 788 "latency too large [%d]\n", cx->latency));
795 return_VOID; 789 return;
796 } 790 }
797 791
798 /* 792 /*
@@ -802,7 +796,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
802 cx->valid = 1; 796 cx->valid = 1;
803 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); 797 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
804 798
805 return_VOID; 799 return;
806} 800}
807 801
808static void acpi_processor_power_verify_c3(struct acpi_processor *pr, 802static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
@@ -810,10 +804,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
810{ 804{
811 static int bm_check_flag; 805 static int bm_check_flag;
812 806
813 ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3");
814 807
815 if (!cx->address) 808 if (!cx->address)
816 return_VOID; 809 return;
817 810
818 /* 811 /*
819 * C3 latency must be less than or equal to 1000 812 * C3 latency must be less than or equal to 1000
@@ -822,7 +815,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
822 else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { 815 else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
823 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 816 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
824 "latency too large [%d]\n", cx->latency)); 817 "latency too large [%d]\n", cx->latency));
825 return_VOID; 818 return;
826 } 819 }
827 820
828 /* 821 /*
@@ -835,7 +828,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
835 else if (errata.piix4.fdma) { 828 else if (errata.piix4.fdma) {
836 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 829 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
837 "C3 not supported on PIIX4 with Type-F DMA\n")); 830 "C3 not supported on PIIX4 with Type-F DMA\n"));
838 return_VOID; 831 return;
839 } 832 }
840 833
841 /* All the logic here assumes flags.bm_check is same across all CPUs */ 834 /* All the logic here assumes flags.bm_check is same across all CPUs */
@@ -852,7 +845,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
852 if (!pr->flags.bm_control) { 845 if (!pr->flags.bm_control) {
853 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 846 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
854 "C3 support requires bus mastering control\n")); 847 "C3 support requires bus mastering control\n"));
855 return_VOID; 848 return;
856 } 849 }
857 } else { 850 } else {
858 /* 851 /*
@@ -863,7 +856,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
863 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 856 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
864 "Cache invalidation should work properly" 857 "Cache invalidation should work properly"
865 " for C3 to be enabled on SMP systems\n")); 858 " for C3 to be enabled on SMP systems\n"));
866 return_VOID; 859 return;
867 } 860 }
868 acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 861 acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,
869 0, ACPI_MTX_DO_NOT_LOCK); 862 0, ACPI_MTX_DO_NOT_LOCK);
@@ -878,7 +871,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
878 cx->valid = 1; 871 cx->valid = 1;
879 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); 872 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
880 873
881 return_VOID; 874 return;
882} 875}
883 876
884static int acpi_processor_power_verify(struct acpi_processor *pr) 877static int acpi_processor_power_verify(struct acpi_processor *pr)
@@ -937,7 +930,6 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
937 unsigned int i; 930 unsigned int i;
938 int result; 931 int result;
939 932
940 ACPI_FUNCTION_TRACE("acpi_processor_get_power_info");
941 933
942 /* NOTE: the idle thread may not be running while calling 934 /* NOTE: the idle thread may not be running while calling
943 * this function */ 935 * this function */
@@ -960,7 +952,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
960 */ 952 */
961 result = acpi_processor_set_power_policy(pr); 953 result = acpi_processor_set_power_policy(pr);
962 if (result) 954 if (result)
963 return_VALUE(result); 955 return result;
964 956
965 /* 957 /*
966 * if one state of type C2 or C3 is available, mark this 958 * if one state of type C2 or C3 is available, mark this
@@ -974,24 +966,23 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
974 } 966 }
975 } 967 }
976 968
977 return_VALUE(0); 969 return 0;
978} 970}
979 971
980int acpi_processor_cst_has_changed(struct acpi_processor *pr) 972int acpi_processor_cst_has_changed(struct acpi_processor *pr)
981{ 973{
982 int result = 0; 974 int result = 0;
983 975
984 ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed");
985 976
986 if (!pr) 977 if (!pr)
987 return_VALUE(-EINVAL); 978 return -EINVAL;
988 979
989 if (nocst) { 980 if (nocst) {
990 return_VALUE(-ENODEV); 981 return -ENODEV;
991 } 982 }
992 983
993 if (!pr->flags.power_setup_done) 984 if (!pr->flags.power_setup_done)
994 return_VALUE(-ENODEV); 985 return -ENODEV;
995 986
996 /* Fall back to the default idle loop */ 987 /* Fall back to the default idle loop */
997 pm_idle = pm_idle_save; 988 pm_idle = pm_idle_save;
@@ -1002,7 +993,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1002 if ((pr->flags.power == 1) && (pr->flags.power_setup_done)) 993 if ((pr->flags.power == 1) && (pr->flags.power_setup_done))
1003 pm_idle = acpi_processor_idle; 994 pm_idle = acpi_processor_idle;
1004 995
1005 return_VALUE(result); 996 return result;
1006} 997}
1007 998
1008/* proc interface */ 999/* proc interface */
@@ -1012,7 +1003,6 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
1012 struct acpi_processor *pr = (struct acpi_processor *)seq->private; 1003 struct acpi_processor *pr = (struct acpi_processor *)seq->private;
1013 unsigned int i; 1004 unsigned int i;
1014 1005
1015 ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");
1016 1006
1017 if (!pr) 1007 if (!pr)
1018 goto end; 1008 goto end;
@@ -1064,13 +1054,14 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
1064 else 1054 else
1065 seq_puts(seq, "demotion[--] "); 1055 seq_puts(seq, "demotion[--] ");
1066 1056
1067 seq_printf(seq, "latency[%03d] usage[%08d]\n", 1057 seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
1068 pr->power.states[i].latency, 1058 pr->power.states[i].latency,
1069 pr->power.states[i].usage); 1059 pr->power.states[i].usage,
1060 pr->power.states[i].time);
1070 } 1061 }
1071 1062
1072 end: 1063 end:
1073 return_VALUE(0); 1064 return 0;
1074} 1065}
1075 1066
1076static int acpi_processor_power_open_fs(struct inode *inode, struct file *file) 1067static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
@@ -1094,7 +1085,6 @@ int acpi_processor_power_init(struct acpi_processor *pr,
1094 struct proc_dir_entry *entry = NULL; 1085 struct proc_dir_entry *entry = NULL;
1095 unsigned int i; 1086 unsigned int i;
1096 1087
1097 ACPI_FUNCTION_TRACE("acpi_processor_power_init");
1098 1088
1099 if (!first_run) { 1089 if (!first_run) {
1100 dmi_check_system(processor_power_dmi_table); 1090 dmi_check_system(processor_power_dmi_table);
@@ -1106,14 +1096,14 @@ int acpi_processor_power_init(struct acpi_processor *pr,
1106 } 1096 }
1107 1097
1108 if (!pr) 1098 if (!pr)
1109 return_VALUE(-EINVAL); 1099 return -EINVAL;
1110 1100
1111 if (acpi_fadt.cst_cnt && !nocst) { 1101 if (acpi_fadt.cst_cnt && !nocst) {
1112 status = 1102 status =
1113 acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8); 1103 acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8);
1114 if (ACPI_FAILURE(status)) { 1104 if (ACPI_FAILURE(status)) {
1115 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1105 ACPI_EXCEPTION((AE_INFO, status,
1116 "Notifying BIOS of _CST ability failed\n")); 1106 "Notifying BIOS of _CST ability failed"));
1117 } 1107 }
1118 } 1108 }
1119 1109
@@ -1142,9 +1132,7 @@ int acpi_processor_power_init(struct acpi_processor *pr,
1142 entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER, 1132 entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
1143 S_IRUGO, acpi_device_dir(device)); 1133 S_IRUGO, acpi_device_dir(device));
1144 if (!entry) 1134 if (!entry)
1145 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1135 return -EIO;
1146 "Unable to create '%s' fs entry\n",
1147 ACPI_PROCESSOR_FILE_POWER));
1148 else { 1136 else {
1149 entry->proc_fops = &acpi_processor_power_fops; 1137 entry->proc_fops = &acpi_processor_power_fops;
1150 entry->data = acpi_driver_data(device); 1138 entry->data = acpi_driver_data(device);
@@ -1153,13 +1141,12 @@ int acpi_processor_power_init(struct acpi_processor *pr,
1153 1141
1154 pr->flags.power_setup_done = 1; 1142 pr->flags.power_setup_done = 1;
1155 1143
1156 return_VALUE(0); 1144 return 0;
1157} 1145}
1158 1146
1159int acpi_processor_power_exit(struct acpi_processor *pr, 1147int acpi_processor_power_exit(struct acpi_processor *pr,
1160 struct acpi_device *device) 1148 struct acpi_device *device)
1161{ 1149{
1162 ACPI_FUNCTION_TRACE("acpi_processor_power_exit");
1163 1150
1164 pr->flags.power_setup_done = 0; 1151 pr->flags.power_setup_done = 0;
1165 1152
@@ -1179,5 +1166,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
1179 cpu_idle_wait(); 1166 cpu_idle_wait();
1180 } 1167 }
1181 1168
1182 return_VALUE(0); 1169 return 0;
1183} 1170}
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 41aaaba74b19..14a00e5a8f6a 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -108,10 +108,9 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
108 acpi_status status = 0; 108 acpi_status status = 0;
109 unsigned long ppc = 0; 109 unsigned long ppc = 0;
110 110
111 ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit");
112 111
113 if (!pr) 112 if (!pr)
114 return_VALUE(-EINVAL); 113 return -EINVAL;
115 114
116 /* 115 /*
117 * _PPC indicates the maximum state currently supported by the platform 116 * _PPC indicates the maximum state currently supported by the platform
@@ -123,13 +122,13 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
123 acpi_processor_ppc_status |= PPC_IN_USE; 122 acpi_processor_ppc_status |= PPC_IN_USE;
124 123
125 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { 124 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
126 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PPC\n")); 125 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
127 return_VALUE(-ENODEV); 126 return -ENODEV;
128 } 127 }
129 128
130 pr->performance_platform_limit = (int)ppc; 129 pr->performance_platform_limit = (int)ppc;
131 130
132 return_VALUE(0); 131 return 0;
133} 132}
134 133
135int acpi_processor_ppc_has_changed(struct acpi_processor *pr) 134int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
@@ -168,18 +167,17 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
168 union acpi_object *pct = NULL; 167 union acpi_object *pct = NULL;
169 union acpi_object obj = { 0 }; 168 union acpi_object obj = { 0 };
170 169
171 ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");
172 170
173 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); 171 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
174 if (ACPI_FAILURE(status)) { 172 if (ACPI_FAILURE(status)) {
175 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n")); 173 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
176 return_VALUE(-ENODEV); 174 return -ENODEV;
177 } 175 }
178 176
179 pct = (union acpi_object *)buffer.pointer; 177 pct = (union acpi_object *)buffer.pointer;
180 if (!pct || (pct->type != ACPI_TYPE_PACKAGE) 178 if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
181 || (pct->package.count != 2)) { 179 || (pct->package.count != 2)) {
182 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n")); 180 printk(KERN_ERR PREFIX "Invalid _PCT data\n");
183 result = -EFAULT; 181 result = -EFAULT;
184 goto end; 182 goto end;
185 } 183 }
@@ -193,8 +191,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
193 if ((obj.type != ACPI_TYPE_BUFFER) 191 if ((obj.type != ACPI_TYPE_BUFFER)
194 || (obj.buffer.length < sizeof(struct acpi_pct_register)) 192 || (obj.buffer.length < sizeof(struct acpi_pct_register))
195 || (obj.buffer.pointer == NULL)) { 193 || (obj.buffer.pointer == NULL)) {
196 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 194 printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n");
197 "Invalid _PCT data (control_register)\n"));
198 result = -EFAULT; 195 result = -EFAULT;
199 goto end; 196 goto end;
200 } 197 }
@@ -210,8 +207,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
210 if ((obj.type != ACPI_TYPE_BUFFER) 207 if ((obj.type != ACPI_TYPE_BUFFER)
211 || (obj.buffer.length < sizeof(struct acpi_pct_register)) 208 || (obj.buffer.length < sizeof(struct acpi_pct_register))
212 || (obj.buffer.pointer == NULL)) { 209 || (obj.buffer.pointer == NULL)) {
213 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 210 printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n");
214 "Invalid _PCT data (status_register)\n"));
215 result = -EFAULT; 211 result = -EFAULT;
216 goto end; 212 goto end;
217 } 213 }
@@ -222,7 +218,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
222 end: 218 end:
223 acpi_os_free(buffer.pointer); 219 acpi_os_free(buffer.pointer);
224 220
225 return_VALUE(result); 221 return result;
226} 222}
227 223
228static int acpi_processor_get_performance_states(struct acpi_processor *pr) 224static int acpi_processor_get_performance_states(struct acpi_processor *pr)
@@ -235,17 +231,16 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
235 union acpi_object *pss = NULL; 231 union acpi_object *pss = NULL;
236 int i; 232 int i;
237 233
238 ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");
239 234
240 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); 235 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
241 if (ACPI_FAILURE(status)) { 236 if (ACPI_FAILURE(status)) {
242 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n")); 237 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
243 return_VALUE(-ENODEV); 238 return -ENODEV;
244 } 239 }
245 240
246 pss = (union acpi_object *)buffer.pointer; 241 pss = (union acpi_object *)buffer.pointer;
247 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { 242 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
248 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); 243 printk(KERN_ERR PREFIX "Invalid _PSS data\n");
249 result = -EFAULT; 244 result = -EFAULT;
250 goto end; 245 goto end;
251 } 246 }
@@ -274,8 +269,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
274 status = acpi_extract_package(&(pss->package.elements[i]), 269 status = acpi_extract_package(&(pss->package.elements[i]),
275 &format, &state); 270 &format, &state);
276 if (ACPI_FAILURE(status)) { 271 if (ACPI_FAILURE(status)) {
277 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 272 ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
278 "Invalid _PSS data\n"));
279 result = -EFAULT; 273 result = -EFAULT;
280 kfree(pr->performance->states); 274 kfree(pr->performance->states);
281 goto end; 275 goto end;
@@ -291,8 +285,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
291 (u32) px->control, (u32) px->status)); 285 (u32) px->control, (u32) px->status));
292 286
293 if (!px->core_frequency) { 287 if (!px->core_frequency) {
294 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 288 printk(KERN_ERR PREFIX
295 "Invalid _PSS data: freq is zero\n")); 289 "Invalid _PSS data: freq is zero\n");
296 result = -EFAULT; 290 result = -EFAULT;
297 kfree(pr->performance->states); 291 kfree(pr->performance->states);
298 goto end; 292 goto end;
@@ -302,7 +296,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
302 end: 296 end:
303 acpi_os_free(buffer.pointer); 297 acpi_os_free(buffer.pointer);
304 298
305 return_VALUE(result); 299 return result;
306} 300}
307 301
308static int acpi_processor_get_performance_info(struct acpi_processor *pr) 302static int acpi_processor_get_performance_info(struct acpi_processor *pr)
@@ -311,31 +305,30 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
311 acpi_status status = AE_OK; 305 acpi_status status = AE_OK;
312 acpi_handle handle = NULL; 306 acpi_handle handle = NULL;
313 307
314 ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");
315 308
316 if (!pr || !pr->performance || !pr->handle) 309 if (!pr || !pr->performance || !pr->handle)
317 return_VALUE(-EINVAL); 310 return -EINVAL;
318 311
319 status = acpi_get_handle(pr->handle, "_PCT", &handle); 312 status = acpi_get_handle(pr->handle, "_PCT", &handle);
320 if (ACPI_FAILURE(status)) { 313 if (ACPI_FAILURE(status)) {
321 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 314 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
322 "ACPI-based processor performance control unavailable\n")); 315 "ACPI-based processor performance control unavailable\n"));
323 return_VALUE(-ENODEV); 316 return -ENODEV;
324 } 317 }
325 318
326 result = acpi_processor_get_performance_control(pr); 319 result = acpi_processor_get_performance_control(pr);
327 if (result) 320 if (result)
328 return_VALUE(result); 321 return result;
329 322
330 result = acpi_processor_get_performance_states(pr); 323 result = acpi_processor_get_performance_states(pr);
331 if (result) 324 if (result)
332 return_VALUE(result); 325 return result;
333 326
334 result = acpi_processor_get_platform_limit(pr); 327 result = acpi_processor_get_platform_limit(pr);
335 if (result) 328 if (result)
336 return_VALUE(result); 329 return result;
337 330
338 return_VALUE(0); 331 return 0;
339} 332}
340 333
341int acpi_processor_notify_smm(struct module *calling_module) 334int acpi_processor_notify_smm(struct module *calling_module)
@@ -343,13 +336,12 @@ int acpi_processor_notify_smm(struct module *calling_module)
343 acpi_status status; 336 acpi_status status;
344 static int is_done = 0; 337 static int is_done = 0;
345 338
346 ACPI_FUNCTION_TRACE("acpi_processor_notify_smm");
347 339
348 if (!(acpi_processor_ppc_status & PPC_REGISTERED)) 340 if (!(acpi_processor_ppc_status & PPC_REGISTERED))
349 return_VALUE(-EBUSY); 341 return -EBUSY;
350 342
351 if (!try_module_get(calling_module)) 343 if (!try_module_get(calling_module))
352 return_VALUE(-EINVAL); 344 return -EINVAL;
353 345
354 /* is_done is set to negative if an error occured, 346 /* is_done is set to negative if an error occured,
355 * and to postitive if _no_ error occured, but SMM 347 * and to postitive if _no_ error occured, but SMM
@@ -358,10 +350,10 @@ int acpi_processor_notify_smm(struct module *calling_module)
358 */ 350 */
359 if (is_done > 0) { 351 if (is_done > 0) {
360 module_put(calling_module); 352 module_put(calling_module);
361 return_VALUE(0); 353 return 0;
362 } else if (is_done < 0) { 354 } else if (is_done < 0) {
363 module_put(calling_module); 355 module_put(calling_module);
364 return_VALUE(is_done); 356 return is_done;
365 } 357 }
366 358
367 is_done = -EIO; 359 is_done = -EIO;
@@ -370,7 +362,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
370 if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) { 362 if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {
371 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n")); 363 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n"));
372 module_put(calling_module); 364 module_put(calling_module);
373 return_VALUE(0); 365 return 0;
374 } 366 }
375 367
376 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 368 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -387,12 +379,12 @@ int acpi_processor_notify_smm(struct module *calling_module)
387 status = acpi_os_write_port(acpi_fadt.smi_cmd, 379 status = acpi_os_write_port(acpi_fadt.smi_cmd,
388 (u32) acpi_fadt.pstate_cnt, 8); 380 (u32) acpi_fadt.pstate_cnt, 8);
389 if (ACPI_FAILURE(status)) { 381 if (ACPI_FAILURE(status)) {
390 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 382 ACPI_EXCEPTION((AE_INFO, status,
391 "Failed to write pstate_cnt [0x%x] to " 383 "Failed to write pstate_cnt [0x%x] to "
392 "smi_cmd [0x%x]\n", acpi_fadt.pstate_cnt, 384 "smi_cmd [0x%x]", acpi_fadt.pstate_cnt,
393 acpi_fadt.smi_cmd)); 385 acpi_fadt.smi_cmd));
394 module_put(calling_module); 386 module_put(calling_module);
395 return_VALUE(status); 387 return status;
396 } 388 }
397 389
398 /* Success. If there's no _PPC, we need to fear nothing, so 390 /* Success. If there's no _PPC, we need to fear nothing, so
@@ -402,7 +394,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
402 if (!(acpi_processor_ppc_status & PPC_IN_USE)) 394 if (!(acpi_processor_ppc_status & PPC_IN_USE))
403 module_put(calling_module); 395 module_put(calling_module);
404 396
405 return_VALUE(0); 397 return 0;
406} 398}
407 399
408EXPORT_SYMBOL(acpi_processor_notify_smm); 400EXPORT_SYMBOL(acpi_processor_notify_smm);
@@ -423,7 +415,6 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
423 struct acpi_processor *pr = (struct acpi_processor *)seq->private; 415 struct acpi_processor *pr = (struct acpi_processor *)seq->private;
424 int i; 416 int i;
425 417
426 ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
427 418
428 if (!pr) 419 if (!pr)
429 goto end; 420 goto end;
@@ -447,7 +438,7 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
447 (u32) pr->performance->states[i].transition_latency); 438 (u32) pr->performance->states[i].transition_latency);
448 439
449 end: 440 end:
450 return_VALUE(0); 441 return 0;
451} 442}
452 443
453static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file) 444static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
@@ -469,23 +460,22 @@ acpi_processor_write_performance(struct file *file,
469 unsigned int new_state = 0; 460 unsigned int new_state = 0;
470 struct cpufreq_policy policy; 461 struct cpufreq_policy policy;
471 462
472 ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
473 463
474 if (!pr || (count > sizeof(state_string) - 1)) 464 if (!pr || (count > sizeof(state_string) - 1))
475 return_VALUE(-EINVAL); 465 return -EINVAL;
476 466
477 perf = pr->performance; 467 perf = pr->performance;
478 if (!perf) 468 if (!perf)
479 return_VALUE(-EINVAL); 469 return -EINVAL;
480 470
481 if (copy_from_user(state_string, buffer, count)) 471 if (copy_from_user(state_string, buffer, count))
482 return_VALUE(-EFAULT); 472 return -EFAULT;
483 473
484 state_string[count] = '\0'; 474 state_string[count] = '\0';
485 new_state = simple_strtoul(state_string, NULL, 0); 475 new_state = simple_strtoul(state_string, NULL, 0);
486 476
487 if (new_state >= perf->state_count) 477 if (new_state >= perf->state_count)
488 return_VALUE(-EINVAL); 478 return -EINVAL;
489 479
490 cpufreq_get_policy(&policy, pr->id); 480 cpufreq_get_policy(&policy, pr->id);
491 481
@@ -495,9 +485,9 @@ acpi_processor_write_performance(struct file *file,
495 485
496 result = cpufreq_set_policy(&policy); 486 result = cpufreq_set_policy(&policy);
497 if (result) 487 if (result)
498 return_VALUE(result); 488 return result;
499 489
500 return_VALUE(count); 490 return count;
501} 491}
502 492
503static void acpi_cpufreq_add_file(struct acpi_processor *pr) 493static void acpi_cpufreq_add_file(struct acpi_processor *pr)
@@ -505,42 +495,36 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
505 struct proc_dir_entry *entry = NULL; 495 struct proc_dir_entry *entry = NULL;
506 struct acpi_device *device = NULL; 496 struct acpi_device *device = NULL;
507 497
508 ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
509 498
510 if (acpi_bus_get_device(pr->handle, &device)) 499 if (acpi_bus_get_device(pr->handle, &device))
511 return_VOID; 500 return;
512 501
513 /* add file 'performance' [R/W] */ 502 /* add file 'performance' [R/W] */
514 entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, 503 entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
515 S_IFREG | S_IRUGO | S_IWUSR, 504 S_IFREG | S_IRUGO | S_IWUSR,
516 acpi_device_dir(device)); 505 acpi_device_dir(device));
517 if (!entry) 506 if (entry){
518 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
519 "Unable to create '%s' fs entry\n",
520 ACPI_PROCESSOR_FILE_PERFORMANCE));
521 else {
522 acpi_processor_perf_fops.write = acpi_processor_write_performance; 507 acpi_processor_perf_fops.write = acpi_processor_write_performance;
523 entry->proc_fops = &acpi_processor_perf_fops; 508 entry->proc_fops = &acpi_processor_perf_fops;
524 entry->data = acpi_driver_data(device); 509 entry->data = acpi_driver_data(device);
525 entry->owner = THIS_MODULE; 510 entry->owner = THIS_MODULE;
526 } 511 }
527 return_VOID; 512 return;
528} 513}
529 514
530static void acpi_cpufreq_remove_file(struct acpi_processor *pr) 515static void acpi_cpufreq_remove_file(struct acpi_processor *pr)
531{ 516{
532 struct acpi_device *device = NULL; 517 struct acpi_device *device = NULL;
533 518
534 ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");
535 519
536 if (acpi_bus_get_device(pr->handle, &device)) 520 if (acpi_bus_get_device(pr->handle, &device))
537 return_VOID; 521 return;
538 522
539 /* remove file 'performance' */ 523 /* remove file 'performance' */
540 remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, 524 remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
541 acpi_device_dir(device)); 525 acpi_device_dir(device));
542 526
543 return_VOID; 527 return;
544} 528}
545 529
546#else 530#else
@@ -698,12 +682,12 @@ int acpi_processor_preregister_performance(
698 /* Validate the Domain info */ 682 /* Validate the Domain info */
699 count_target = pdomain->num_processors; 683 count_target = pdomain->num_processors;
700 count = 1; 684 count = 1;
701 if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL || 685 if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
702 pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL) {
703 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; 686 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL;
704 } else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY) { 687 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
688 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW;
689 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
705 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; 690 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY;
706 }
707 691
708 for_each_possible_cpu(j) { 692 for_each_possible_cpu(j) {
709 if (i == j) 693 if (i == j)
@@ -784,22 +768,21 @@ acpi_processor_register_performance(struct acpi_processor_performance
784{ 768{
785 struct acpi_processor *pr; 769 struct acpi_processor *pr;
786 770
787 ACPI_FUNCTION_TRACE("acpi_processor_register_performance");
788 771
789 if (!(acpi_processor_ppc_status & PPC_REGISTERED)) 772 if (!(acpi_processor_ppc_status & PPC_REGISTERED))
790 return_VALUE(-EINVAL); 773 return -EINVAL;
791 774
792 mutex_lock(&performance_mutex); 775 mutex_lock(&performance_mutex);
793 776
794 pr = processors[cpu]; 777 pr = processors[cpu];
795 if (!pr) { 778 if (!pr) {
796 mutex_unlock(&performance_mutex); 779 mutex_unlock(&performance_mutex);
797 return_VALUE(-ENODEV); 780 return -ENODEV;
798 } 781 }
799 782
800 if (pr->performance) { 783 if (pr->performance) {
801 mutex_unlock(&performance_mutex); 784 mutex_unlock(&performance_mutex);
802 return_VALUE(-EBUSY); 785 return -EBUSY;
803 } 786 }
804 787
805 WARN_ON(!performance); 788 WARN_ON(!performance);
@@ -809,13 +792,13 @@ acpi_processor_register_performance(struct acpi_processor_performance
809 if (acpi_processor_get_performance_info(pr)) { 792 if (acpi_processor_get_performance_info(pr)) {
810 pr->performance = NULL; 793 pr->performance = NULL;
811 mutex_unlock(&performance_mutex); 794 mutex_unlock(&performance_mutex);
812 return_VALUE(-EIO); 795 return -EIO;
813 } 796 }
814 797
815 acpi_cpufreq_add_file(pr); 798 acpi_cpufreq_add_file(pr);
816 799
817 mutex_unlock(&performance_mutex); 800 mutex_unlock(&performance_mutex);
818 return_VALUE(0); 801 return 0;
819} 802}
820 803
821EXPORT_SYMBOL(acpi_processor_register_performance); 804EXPORT_SYMBOL(acpi_processor_register_performance);
@@ -826,14 +809,13 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
826{ 809{
827 struct acpi_processor *pr; 810 struct acpi_processor *pr;
828 811
829 ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance");
830 812
831 mutex_lock(&performance_mutex); 813 mutex_lock(&performance_mutex);
832 814
833 pr = processors[cpu]; 815 pr = processors[cpu];
834 if (!pr) { 816 if (!pr) {
835 mutex_unlock(&performance_mutex); 817 mutex_unlock(&performance_mutex);
836 return_VOID; 818 return;
837 } 819 }
838 820
839 if (pr->performance) 821 if (pr->performance)
@@ -844,7 +826,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
844 826
845 mutex_unlock(&performance_mutex); 827 mutex_unlock(&performance_mutex);
846 828
847 return_VOID; 829 return;
848} 830}
849 831
850EXPORT_SYMBOL(acpi_processor_unregister_performance); 832EXPORT_SYMBOL(acpi_processor_unregister_performance);
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index f99ad05cd6a2..ef5e0f6efdba 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -54,13 +54,12 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
54 u16 px = 0; 54 u16 px = 0;
55 u16 tx = 0; 55 u16 tx = 0;
56 56
57 ACPI_FUNCTION_TRACE("acpi_processor_apply_limit");
58 57
59 if (!pr) 58 if (!pr)
60 return_VALUE(-EINVAL); 59 return -EINVAL;
61 60
62 if (!pr->flags.limit) 61 if (!pr->flags.limit)
63 return_VALUE(-ENODEV); 62 return -ENODEV;
64 63
65 if (pr->flags.throttling) { 64 if (pr->flags.throttling) {
66 if (pr->limit.user.tx > tx) 65 if (pr->limit.user.tx > tx)
@@ -82,9 +81,9 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
82 81
83 end: 82 end:
84 if (result) 83 if (result)
85 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n")); 84 printk(KERN_ERR PREFIX "Unable to set limit\n");
86 85
87 return_VALUE(result); 86 return result;
88} 87}
89 88
90#ifdef CONFIG_CPU_FREQ 89#ifdef CONFIG_CPU_FREQ
@@ -200,19 +199,18 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
200 struct acpi_device *device = NULL; 199 struct acpi_device *device = NULL;
201 int tx = 0, max_tx_px = 0; 200 int tx = 0, max_tx_px = 0;
202 201
203 ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");
204 202
205 if ((type < ACPI_PROCESSOR_LIMIT_NONE) 203 if ((type < ACPI_PROCESSOR_LIMIT_NONE)
206 || (type > ACPI_PROCESSOR_LIMIT_DECREMENT)) 204 || (type > ACPI_PROCESSOR_LIMIT_DECREMENT))
207 return_VALUE(-EINVAL); 205 return -EINVAL;
208 206
209 result = acpi_bus_get_device(handle, &device); 207 result = acpi_bus_get_device(handle, &device);
210 if (result) 208 if (result)
211 return_VALUE(result); 209 return result;
212 210
213 pr = (struct acpi_processor *)acpi_driver_data(device); 211 pr = (struct acpi_processor *)acpi_driver_data(device);
214 if (!pr) 212 if (!pr)
215 return_VALUE(-ENODEV); 213 return -ENODEV;
216 214
217 /* Thermal limits are always relative to the current Px/Tx state. */ 215 /* Thermal limits are always relative to the current Px/Tx state. */
218 if (pr->flags.throttling) 216 if (pr->flags.throttling)
@@ -289,30 +287,28 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
289 287
290 result = acpi_processor_apply_limit(pr); 288 result = acpi_processor_apply_limit(pr);
291 if (result) 289 if (result)
292 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 290 printk(KERN_ERR PREFIX "Unable to set thermal limit\n");
293 "Unable to set thermal limit\n"));
294 291
295 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", 292 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
296 pr->limit.thermal.px, pr->limit.thermal.tx)); 293 pr->limit.thermal.px, pr->limit.thermal.tx));
297 } else 294 } else
298 result = 0; 295 result = 0;
299 if (max_tx_px) 296 if (max_tx_px)
300 return_VALUE(1); 297 return 1;
301 else 298 else
302 return_VALUE(result); 299 return result;
303} 300}
304 301
305int acpi_processor_get_limit_info(struct acpi_processor *pr) 302int acpi_processor_get_limit_info(struct acpi_processor *pr)
306{ 303{
307 ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info");
308 304
309 if (!pr) 305 if (!pr)
310 return_VALUE(-EINVAL); 306 return -EINVAL;
311 307
312 if (pr->flags.throttling) 308 if (pr->flags.throttling)
313 pr->flags.limit = 1; 309 pr->flags.limit = 1;
314 310
315 return_VALUE(0); 311 return 0;
316} 312}
317 313
318/* /proc interface */ 314/* /proc interface */
@@ -321,7 +317,6 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
321{ 317{
322 struct acpi_processor *pr = (struct acpi_processor *)seq->private; 318 struct acpi_processor *pr = (struct acpi_processor *)seq->private;
323 319
324 ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show");
325 320
326 if (!pr) 321 if (!pr)
327 goto end; 322 goto end;
@@ -339,7 +334,7 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
339 pr->limit.thermal.px, pr->limit.thermal.tx); 334 pr->limit.thermal.px, pr->limit.thermal.tx);
340 335
341 end: 336 end:
342 return_VALUE(0); 337 return 0;
343} 338}
344 339
345static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file) 340static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
@@ -359,36 +354,33 @@ static ssize_t acpi_processor_write_limit(struct file * file,
359 int px = 0; 354 int px = 0;
360 int tx = 0; 355 int tx = 0;
361 356
362 ACPI_FUNCTION_TRACE("acpi_processor_write_limit");
363 357
364 if (!pr || (count > sizeof(limit_string) - 1)) { 358 if (!pr || (count > sizeof(limit_string) - 1)) {
365 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); 359 return -EINVAL;
366 return_VALUE(-EINVAL);
367 } 360 }
368 361
369 if (copy_from_user(limit_string, buffer, count)) { 362 if (copy_from_user(limit_string, buffer, count)) {
370 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n")); 363 return -EFAULT;
371 return_VALUE(-EFAULT);
372 } 364 }
373 365
374 limit_string[count] = '\0'; 366 limit_string[count] = '\0';
375 367
376 if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) { 368 if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
377 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); 369 printk(KERN_ERR PREFIX "Invalid data format\n");
378 return_VALUE(-EINVAL); 370 return -EINVAL;
379 } 371 }
380 372
381 if (pr->flags.throttling) { 373 if (pr->flags.throttling) {
382 if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) { 374 if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
383 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n")); 375 printk(KERN_ERR PREFIX "Invalid tx\n");
384 return_VALUE(-EINVAL); 376 return -EINVAL;
385 } 377 }
386 pr->limit.user.tx = tx; 378 pr->limit.user.tx = tx;
387 } 379 }
388 380
389 result = acpi_processor_apply_limit(pr); 381 result = acpi_processor_apply_limit(pr);
390 382
391 return_VALUE(count); 383 return count;
392} 384}
393 385
394struct file_operations acpi_processor_limit_fops = { 386struct file_operations acpi_processor_limit_fops = {
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index b966549ec000..d044ec519db0 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -55,13 +55,12 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
55 u32 duty_mask = 0; 55 u32 duty_mask = 0;
56 u32 duty_value = 0; 56 u32 duty_value = 0;
57 57
58 ACPI_FUNCTION_TRACE("acpi_processor_get_throttling");
59 58
60 if (!pr) 59 if (!pr)
61 return_VALUE(-EINVAL); 60 return -EINVAL;
62 61
63 if (!pr->flags.throttling) 62 if (!pr->flags.throttling)
64 return_VALUE(-ENODEV); 63 return -ENODEV;
65 64
66 pr->throttling.state = 0; 65 pr->throttling.state = 0;
67 66
@@ -93,7 +92,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
93 "Throttling state is T%d (%d%% throttling applied)\n", 92 "Throttling state is T%d (%d%% throttling applied)\n",
94 state, pr->throttling.states[state].performance)); 93 state, pr->throttling.states[state].performance));
95 94
96 return_VALUE(0); 95 return 0;
97} 96}
98 97
99int acpi_processor_set_throttling(struct acpi_processor *pr, int state) 98int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
@@ -102,19 +101,18 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
102 u32 duty_mask = 0; 101 u32 duty_mask = 0;
103 u32 duty_value = 0; 102 u32 duty_value = 0;
104 103
105 ACPI_FUNCTION_TRACE("acpi_processor_set_throttling");
106 104
107 if (!pr) 105 if (!pr)
108 return_VALUE(-EINVAL); 106 return -EINVAL;
109 107
110 if ((state < 0) || (state > (pr->throttling.state_count - 1))) 108 if ((state < 0) || (state > (pr->throttling.state_count - 1)))
111 return_VALUE(-EINVAL); 109 return -EINVAL;
112 110
113 if (!pr->flags.throttling) 111 if (!pr->flags.throttling)
114 return_VALUE(-ENODEV); 112 return -ENODEV;
115 113
116 if (state == pr->throttling.state) 114 if (state == pr->throttling.state)
117 return_VALUE(0); 115 return 0;
118 116
119 /* 117 /*
120 * Calculate the duty_value and duty_mask. 118 * Calculate the duty_value and duty_mask.
@@ -165,7 +163,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
165 (pr->throttling.states[state].performance ? pr-> 163 (pr->throttling.states[state].performance ? pr->
166 throttling.states[state].performance / 10 : 0))); 164 throttling.states[state].performance / 10 : 0)));
167 165
168 return_VALUE(0); 166 return 0;
169} 167}
170 168
171int acpi_processor_get_throttling_info(struct acpi_processor *pr) 169int acpi_processor_get_throttling_info(struct acpi_processor *pr)
@@ -174,7 +172,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
174 int step = 0; 172 int step = 0;
175 int i = 0; 173 int i = 0;
176 174
177 ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info");
178 175
179 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 176 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
180 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", 177 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
@@ -183,21 +180,21 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
183 pr->throttling.duty_width)); 180 pr->throttling.duty_width));
184 181
185 if (!pr) 182 if (!pr)
186 return_VALUE(-EINVAL); 183 return -EINVAL;
187 184
188 /* TBD: Support ACPI 2.0 objects */ 185 /* TBD: Support ACPI 2.0 objects */
189 186
190 if (!pr->throttling.address) { 187 if (!pr->throttling.address) {
191 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); 188 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
192 return_VALUE(0); 189 return 0;
193 } else if (!pr->throttling.duty_width) { 190 } else if (!pr->throttling.duty_width) {
194 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n")); 191 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
195 return_VALUE(0); 192 return 0;
196 } 193 }
197 /* TBD: Support duty_cycle values that span bit 4. */ 194 /* TBD: Support duty_cycle values that span bit 4. */
198 else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) { 195 else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
199 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n")); 196 printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");
200 return_VALUE(0); 197 return 0;
201 } 198 }
202 199
203 /* 200 /*
@@ -208,7 +205,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
208 if (errata.piix4.throttle) { 205 if (errata.piix4.throttle) {
209 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 206 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
210 "Throttling not supported on PIIX4 A- or B-step\n")); 207 "Throttling not supported on PIIX4 A- or B-step\n"));
211 return_VALUE(0); 208 return 0;
212 } 209 }
213 210
214 pr->throttling.state_count = 1 << acpi_fadt.duty_width; 211 pr->throttling.state_count = 1 << acpi_fadt.duty_width;
@@ -254,7 +251,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
254 if (result) 251 if (result)
255 pr->flags.throttling = 0; 252 pr->flags.throttling = 0;
256 253
257 return_VALUE(result); 254 return result;
258} 255}
259 256
260/* proc interface */ 257/* proc interface */
@@ -266,7 +263,6 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
266 int i = 0; 263 int i = 0;
267 int result = 0; 264 int result = 0;
268 265
269 ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");
270 266
271 if (!pr) 267 if (!pr)
272 goto end; 268 goto end;
@@ -296,7 +292,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
296 throttling.states[i].performance / 10 : 0)); 292 throttling.states[i].performance / 10 : 0));
297 293
298 end: 294 end:
299 return_VALUE(0); 295 return 0;
300} 296}
301 297
302static int acpi_processor_throttling_open_fs(struct inode *inode, 298static int acpi_processor_throttling_open_fs(struct inode *inode,
@@ -315,13 +311,12 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
315 struct acpi_processor *pr = (struct acpi_processor *)m->private; 311 struct acpi_processor *pr = (struct acpi_processor *)m->private;
316 char state_string[12] = { '\0' }; 312 char state_string[12] = { '\0' };
317 313
318 ACPI_FUNCTION_TRACE("acpi_processor_write_throttling");
319 314
320 if (!pr || (count > sizeof(state_string) - 1)) 315 if (!pr || (count > sizeof(state_string) - 1))
321 return_VALUE(-EINVAL); 316 return -EINVAL;
322 317
323 if (copy_from_user(state_string, buffer, count)) 318 if (copy_from_user(state_string, buffer, count))
324 return_VALUE(-EFAULT); 319 return -EFAULT;
325 320
326 state_string[count] = '\0'; 321 state_string[count] = '\0';
327 322
@@ -329,9 +324,9 @@ static ssize_t acpi_processor_write_throttling(struct file * file,
329 simple_strtoul(state_string, 324 simple_strtoul(state_string,
330 NULL, 0)); 325 NULL, 0));
331 if (result) 326 if (result)
332 return_VALUE(result); 327 return result;
333 328
334 return_VALUE(count); 329 return count;
335} 330}
336 331
337struct file_operations acpi_processor_throttling_fops = { 332struct file_operations acpi_processor_throttling_fops = {
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index f8316a05ede7..861ac378ce42 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -162,11 +162,10 @@ static void acpi_device_unregister(struct acpi_device *device, int type)
162 162
163void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) 163void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)
164{ 164{
165 ACPI_FUNCTION_TRACE("acpi_bus_data_handler");
166 165
167 /* TBD */ 166 /* TBD */
168 167
169 return_VOID; 168 return;
170} 169}
171 170
172static int acpi_bus_get_power_flags(struct acpi_device *device) 171static int acpi_bus_get_power_flags(struct acpi_device *device)
@@ -175,7 +174,6 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
175 acpi_handle handle = NULL; 174 acpi_handle handle = NULL;
176 u32 i = 0; 175 u32 i = 0;
177 176
178 ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags");
179 177
180 /* 178 /*
181 * Power Management Flags 179 * Power Management Flags
@@ -228,7 +226,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
228 226
229 device->power.state = ACPI_STATE_UNKNOWN; 227 device->power.state = ACPI_STATE_UNKNOWN;
230 228
231 return_VALUE(0); 229 return 0;
232} 230}
233 231
234int acpi_match_ids(struct acpi_device *device, char *ids) 232int acpi_match_ids(struct acpi_device *device, char *ids)
@@ -306,20 +304,18 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
306 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 304 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
307 union acpi_object *package = NULL; 305 union acpi_object *package = NULL;
308 306
309 ACPI_FUNCTION_TRACE("acpi_bus_get_wakeup_flags");
310 307
311 /* _PRW */ 308 /* _PRW */
312 status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); 309 status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
313 if (ACPI_FAILURE(status)) { 310 if (ACPI_FAILURE(status)) {
314 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRW\n")); 311 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
315 goto end; 312 goto end;
316 } 313 }
317 314
318 package = (union acpi_object *)buffer.pointer; 315 package = (union acpi_object *)buffer.pointer;
319 status = acpi_bus_extract_wakeup_device_power_package(device, package); 316 status = acpi_bus_extract_wakeup_device_power_package(device, package);
320 if (ACPI_FAILURE(status)) { 317 if (ACPI_FAILURE(status)) {
321 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 318 ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
322 "Error extracting _PRW package\n"));
323 goto end; 319 goto end;
324 } 320 }
325 321
@@ -333,7 +329,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
333 end: 329 end:
334 if (ACPI_FAILURE(status)) 330 if (ACPI_FAILURE(status))
335 device->flags.wake_capable = 0; 331 device->flags.wake_capable = 0;
336 return_VALUE(0); 332 return 0;
337} 333}
338 334
339/* -------------------------------------------------------------------------- 335/* --------------------------------------------------------------------------
@@ -489,19 +485,18 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
489{ 485{
490 int result = 0; 486 int result = 0;
491 487
492 ACPI_FUNCTION_TRACE("acpi_bus_driver_init");
493 488
494 if (!device || !driver) 489 if (!device || !driver)
495 return_VALUE(-EINVAL); 490 return -EINVAL;
496 491
497 if (!driver->ops.add) 492 if (!driver->ops.add)
498 return_VALUE(-ENOSYS); 493 return -ENOSYS;
499 494
500 result = driver->ops.add(device); 495 result = driver->ops.add(device);
501 if (result) { 496 if (result) {
502 device->driver = NULL; 497 device->driver = NULL;
503 acpi_driver_data(device) = NULL; 498 acpi_driver_data(device) = NULL;
504 return_VALUE(result); 499 return result;
505 } 500 }
506 501
507 device->driver = driver; 502 device->driver = driver;
@@ -513,7 +508,7 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
513 508
514 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 509 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
515 "Driver successfully bound to device\n")); 510 "Driver successfully bound to device\n"));
516 return_VALUE(0); 511 return 0;
517} 512}
518 513
519static int acpi_start_single_object(struct acpi_device *device) 514static int acpi_start_single_object(struct acpi_device *device)
@@ -521,10 +516,9 @@ static int acpi_start_single_object(struct acpi_device *device)
521 int result = 0; 516 int result = 0;
522 struct acpi_driver *driver; 517 struct acpi_driver *driver;
523 518
524 ACPI_FUNCTION_TRACE("acpi_start_single_object");
525 519
526 if (!(driver = device->driver)) 520 if (!(driver = device->driver))
527 return_VALUE(0); 521 return 0;
528 522
529 if (driver->ops.start) { 523 if (driver->ops.start) {
530 result = driver->ops.start(device); 524 result = driver->ops.start(device);
@@ -532,14 +526,13 @@ static int acpi_start_single_object(struct acpi_device *device)
532 driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL); 526 driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
533 } 527 }
534 528
535 return_VALUE(result); 529 return result;
536} 530}
537 531
538static void acpi_driver_attach(struct acpi_driver *drv) 532static void acpi_driver_attach(struct acpi_driver *drv)
539{ 533{
540 struct list_head *node, *next; 534 struct list_head *node, *next;
541 535
542 ACPI_FUNCTION_TRACE("acpi_driver_attach");
543 536
544 spin_lock(&acpi_device_lock); 537 spin_lock(&acpi_device_lock);
545 list_for_each_safe(node, next, &acpi_device_list) { 538 list_for_each_safe(node, next, &acpi_device_list) {
@@ -568,7 +561,6 @@ static void acpi_driver_detach(struct acpi_driver *drv)
568{ 561{
569 struct list_head *node, *next; 562 struct list_head *node, *next;
570 563
571 ACPI_FUNCTION_TRACE("acpi_driver_detach");
572 564
573 spin_lock(&acpi_device_lock); 565 spin_lock(&acpi_device_lock);
574 list_for_each_safe(node, next, &acpi_device_list) { 566 list_for_each_safe(node, next, &acpi_device_list) {
@@ -598,17 +590,16 @@ static void acpi_driver_detach(struct acpi_driver *drv)
598 */ 590 */
599int acpi_bus_register_driver(struct acpi_driver *driver) 591int acpi_bus_register_driver(struct acpi_driver *driver)
600{ 592{
601 ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
602 593
603 if (acpi_disabled) 594 if (acpi_disabled)
604 return_VALUE(-ENODEV); 595 return -ENODEV;
605 596
606 spin_lock(&acpi_device_lock); 597 spin_lock(&acpi_device_lock);
607 list_add_tail(&driver->node, &acpi_bus_drivers); 598 list_add_tail(&driver->node, &acpi_bus_drivers);
608 spin_unlock(&acpi_device_lock); 599 spin_unlock(&acpi_device_lock);
609 acpi_driver_attach(driver); 600 acpi_driver_attach(driver);
610 601
611 return_VALUE(0); 602 return 0;
612} 603}
613 604
614EXPORT_SYMBOL(acpi_bus_register_driver); 605EXPORT_SYMBOL(acpi_bus_register_driver);
@@ -646,7 +637,6 @@ static int acpi_bus_find_driver(struct acpi_device *device)
646 int result = 0; 637 int result = 0;
647 struct list_head *node, *next; 638 struct list_head *node, *next;
648 639
649 ACPI_FUNCTION_TRACE("acpi_bus_find_driver");
650 640
651 spin_lock(&acpi_device_lock); 641 spin_lock(&acpi_device_lock);
652 list_for_each_safe(node, next, &acpi_bus_drivers) { 642 list_for_each_safe(node, next, &acpi_bus_drivers) {
@@ -666,19 +656,41 @@ static int acpi_bus_find_driver(struct acpi_device *device)
666 spin_unlock(&acpi_device_lock); 656 spin_unlock(&acpi_device_lock);
667 657
668 Done: 658 Done:
669 return_VALUE(result); 659 return result;
670} 660}
671 661
672/* -------------------------------------------------------------------------- 662/* --------------------------------------------------------------------------
673 Device Enumeration 663 Device Enumeration
674 -------------------------------------------------------------------------- */ 664 -------------------------------------------------------------------------- */
675 665
666acpi_status
667acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
668{
669 acpi_status status;
670 acpi_handle tmp;
671 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
672 union acpi_object *obj;
673
674 status = acpi_get_handle(handle, "_EJD", &tmp);
675 if (ACPI_FAILURE(status))
676 return status;
677
678 status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
679 if (ACPI_SUCCESS(status)) {
680 obj = buffer.pointer;
681 status = acpi_get_handle(NULL, obj->string.pointer, ejd);
682 kfree(buffer.pointer);
683 }
684 return status;
685}
686EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
687
688
676static int acpi_bus_get_flags(struct acpi_device *device) 689static int acpi_bus_get_flags(struct acpi_device *device)
677{ 690{
678 acpi_status status = AE_OK; 691 acpi_status status = AE_OK;
679 acpi_handle temp = NULL; 692 acpi_handle temp = NULL;
680 693
681 ACPI_FUNCTION_TRACE("acpi_bus_get_flags");
682 694
683 /* Presence of _STA indicates 'dynamic_status' */ 695 /* Presence of _STA indicates 'dynamic_status' */
684 status = acpi_get_handle(device->handle, "_STA", &temp); 696 status = acpi_get_handle(device->handle, "_STA", &temp);
@@ -724,7 +736,7 @@ static int acpi_bus_get_flags(struct acpi_device *device)
724 736
725 /* TBD: Peformance management */ 737 /* TBD: Peformance management */
726 738
727 return_VALUE(0); 739 return 0;
728} 740}
729 741
730static void acpi_device_get_busid(struct acpi_device *device, 742static void acpi_device_get_busid(struct acpi_device *device,
@@ -918,10 +930,9 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
918 int result = 0; 930 int result = 0;
919 struct acpi_driver *driver; 931 struct acpi_driver *driver;
920 932
921 ACPI_FUNCTION_TRACE("acpi_bus_remove");
922 933
923 if (!dev) 934 if (!dev)
924 return_VALUE(-EINVAL); 935 return -EINVAL;
925 936
926 driver = dev->driver; 937 driver = dev->driver;
927 938
@@ -930,12 +941,12 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
930 if (driver->ops.stop) { 941 if (driver->ops.stop) {
931 result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT); 942 result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT);
932 if (result) 943 if (result)
933 return_VALUE(result); 944 return result;
934 } 945 }
935 946
936 result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT); 947 result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT);
937 if (result) { 948 if (result) {
938 return_VALUE(result); 949 return result;
939 } 950 }
940 951
941 atomic_dec(&dev->driver->references); 952 atomic_dec(&dev->driver->references);
@@ -944,7 +955,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
944 } 955 }
945 956
946 if (!rmdevice) 957 if (!rmdevice)
947 return_VALUE(0); 958 return 0;
948 959
949 if (dev->flags.bus_address) { 960 if (dev->flags.bus_address) {
950 if ((dev->parent) && (dev->parent->ops.unbind)) 961 if ((dev->parent) && (dev->parent->ops.unbind))
@@ -953,7 +964,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
953 964
954 acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT); 965 acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT);
955 966
956 return_VALUE(0); 967 return 0;
957} 968}
958 969
959static int 970static int
@@ -963,15 +974,14 @@ acpi_add_single_object(struct acpi_device **child,
963 int result = 0; 974 int result = 0;
964 struct acpi_device *device = NULL; 975 struct acpi_device *device = NULL;
965 976
966 ACPI_FUNCTION_TRACE("acpi_add_single_object");
967 977
968 if (!child) 978 if (!child)
969 return_VALUE(-EINVAL); 979 return -EINVAL;
970 980
971 device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL); 981 device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
972 if (!device) { 982 if (!device) {
973 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); 983 printk(KERN_ERR PREFIX "Memory allocation error\n");
974 return_VALUE(-ENOMEM); 984 return -ENOMEM;
975 } 985 }
976 memset(device, 0, sizeof(struct acpi_device)); 986 memset(device, 0, sizeof(struct acpi_device));
977 987
@@ -1096,7 +1106,7 @@ acpi_add_single_object(struct acpi_device **child,
1096 kfree(device); 1106 kfree(device);
1097 } 1107 }
1098 1108
1099 return_VALUE(result); 1109 return result;
1100} 1110}
1101 1111
1102static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops) 1112static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
@@ -1109,10 +1119,9 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
1109 acpi_object_type type = 0; 1119 acpi_object_type type = 0;
1110 u32 level = 1; 1120 u32 level = 1;
1111 1121
1112 ACPI_FUNCTION_TRACE("acpi_bus_scan");
1113 1122
1114 if (!start) 1123 if (!start)
1115 return_VALUE(-EINVAL); 1124 return -EINVAL;
1116 1125
1117 parent = start; 1126 parent = start;
1118 phandle = start->handle; 1127 phandle = start->handle;
@@ -1209,7 +1218,7 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
1209 } 1218 }
1210 } 1219 }
1211 1220
1212 return_VALUE(0); 1221 return 0;
1213} 1222}
1214 1223
1215int 1224int
@@ -1219,7 +1228,6 @@ acpi_bus_add(struct acpi_device **child,
1219 int result; 1228 int result;
1220 struct acpi_bus_ops ops; 1229 struct acpi_bus_ops ops;
1221 1230
1222 ACPI_FUNCTION_TRACE("acpi_bus_add");
1223 1231
1224 result = acpi_add_single_object(child, parent, handle, type); 1232 result = acpi_add_single_object(child, parent, handle, type);
1225 if (!result) { 1233 if (!result) {
@@ -1227,7 +1235,7 @@ acpi_bus_add(struct acpi_device **child,
1227 ops.acpi_op_add = 1; 1235 ops.acpi_op_add = 1;
1228 result = acpi_bus_scan(*child, &ops); 1236 result = acpi_bus_scan(*child, &ops);
1229 } 1237 }
1230 return_VALUE(result); 1238 return result;
1231} 1239}
1232 1240
1233EXPORT_SYMBOL(acpi_bus_add); 1241EXPORT_SYMBOL(acpi_bus_add);
@@ -1237,10 +1245,9 @@ int acpi_bus_start(struct acpi_device *device)
1237 int result; 1245 int result;
1238 struct acpi_bus_ops ops; 1246 struct acpi_bus_ops ops;
1239 1247
1240 ACPI_FUNCTION_TRACE("acpi_bus_start");
1241 1248
1242 if (!device) 1249 if (!device)
1243 return_VALUE(-EINVAL); 1250 return -EINVAL;
1244 1251
1245 result = acpi_start_single_object(device); 1252 result = acpi_start_single_object(device);
1246 if (!result) { 1253 if (!result) {
@@ -1248,7 +1255,7 @@ int acpi_bus_start(struct acpi_device *device)
1248 ops.acpi_op_start = 1; 1255 ops.acpi_op_start = 1;
1249 result = acpi_bus_scan(device, &ops); 1256 result = acpi_bus_scan(device, &ops);
1250 } 1257 }
1251 return_VALUE(result); 1258 return result;
1252} 1259}
1253 1260
1254EXPORT_SYMBOL(acpi_bus_start); 1261EXPORT_SYMBOL(acpi_bus_start);
@@ -1314,10 +1321,9 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
1314 int result = 0; 1321 int result = 0;
1315 struct acpi_device *device = NULL; 1322 struct acpi_device *device = NULL;
1316 1323
1317 ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
1318 1324
1319 if (!root) 1325 if (!root)
1320 return_VALUE(-ENODEV); 1326 return -ENODEV;
1321 1327
1322 /* 1328 /*
1323 * Enumerate all fixed-feature devices. 1329 * Enumerate all fixed-feature devices.
@@ -1338,7 +1344,7 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
1338 result = acpi_start_single_object(device); 1344 result = acpi_start_single_object(device);
1339 } 1345 }
1340 1346
1341 return_VALUE(result); 1347 return result;
1342} 1348}
1343 1349
1344 1350
@@ -1427,7 +1433,7 @@ static int acpi_device_resume(struct device * dev)
1427} 1433}
1428 1434
1429 1435
1430struct bus_type acpi_bus_type = { 1436static struct bus_type acpi_bus_type = {
1431 .name = "acpi", 1437 .name = "acpi",
1432 .suspend = acpi_device_suspend, 1438 .suspend = acpi_device_suspend,
1433 .resume = acpi_device_resume, 1439 .resume = acpi_device_resume,
@@ -1440,10 +1446,9 @@ static int __init acpi_scan_init(void)
1440 int result; 1446 int result;
1441 struct acpi_bus_ops ops; 1447 struct acpi_bus_ops ops;
1442 1448
1443 ACPI_FUNCTION_TRACE("acpi_scan_init");
1444 1449
1445 if (acpi_disabled) 1450 if (acpi_disabled)
1446 return_VALUE(0); 1451 return 0;
1447 1452
1448 kset_register(&acpi_namespace_kset); 1453 kset_register(&acpi_namespace_kset);
1449 1454
@@ -1488,7 +1493,7 @@ static int __init acpi_scan_init(void)
1488 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL); 1493 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
1489 1494
1490 Done: 1495 Done:
1491 return_VALUE(result); 1496 return result;
1492} 1497}
1493 1498
1494subsys_initcall(acpi_scan_init); 1499subsys_initcall(acpi_scan_init);
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index a934ac42178d..c90bd2f70b3f 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -47,10 +47,9 @@ extern struct fadt_descriptor acpi_fadt;
47 47
48static int acpi_system_read_info(struct seq_file *seq, void *offset) 48static int acpi_system_read_info(struct seq_file *seq, void *offset)
49{ 49{
50 ACPI_FUNCTION_TRACE("acpi_system_read_info");
51 50
52 seq_printf(seq, "version: %x\n", ACPI_CA_VERSION); 51 seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
53 return_VALUE(0); 52 return 0;
54} 53}
55 54
56static int acpi_system_info_open_fs(struct inode *inode, struct file *file) 55static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
@@ -80,17 +79,16 @@ acpi_system_read_dsdt(struct file *file,
80 struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; 79 struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
81 ssize_t res; 80 ssize_t res;
82 81
83 ACPI_FUNCTION_TRACE("acpi_system_read_dsdt");
84 82
85 status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt); 83 status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt);
86 if (ACPI_FAILURE(status)) 84 if (ACPI_FAILURE(status))
87 return_VALUE(-ENODEV); 85 return -ENODEV;
88 86
89 res = simple_read_from_buffer(buffer, count, ppos, 87 res = simple_read_from_buffer(buffer, count, ppos,
90 dsdt.pointer, dsdt.length); 88 dsdt.pointer, dsdt.length);
91 acpi_os_free(dsdt.pointer); 89 acpi_os_free(dsdt.pointer);
92 90
93 return_VALUE(res); 91 return res;
94} 92}
95 93
96static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t, 94static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
@@ -108,17 +106,16 @@ acpi_system_read_fadt(struct file *file,
108 struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL }; 106 struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL };
109 ssize_t res; 107 ssize_t res;
110 108
111 ACPI_FUNCTION_TRACE("acpi_system_read_fadt");
112 109
113 status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt); 110 status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt);
114 if (ACPI_FAILURE(status)) 111 if (ACPI_FAILURE(status))
115 return_VALUE(-ENODEV); 112 return -ENODEV;
116 113
117 res = simple_read_from_buffer(buffer, count, ppos, 114 res = simple_read_from_buffer(buffer, count, ppos,
118 fadt.pointer, fadt.length); 115 fadt.pointer, fadt.length);
119 acpi_os_free(fadt.pointer); 116 acpi_os_free(fadt.pointer);
120 117
121 return_VALUE(res); 118 return res;
122} 119}
123 120
124static int __init acpi_system_init(void) 121static int __init acpi_system_init(void)
@@ -127,10 +124,9 @@ static int __init acpi_system_init(void)
127 int error = 0; 124 int error = 0;
128 char *name; 125 char *name;
129 126
130 ACPI_FUNCTION_TRACE("acpi_system_init");
131 127
132 if (acpi_disabled) 128 if (acpi_disabled)
133 return_VALUE(0); 129 return 0;
134 130
135 /* 'info' [R] */ 131 /* 'info' [R] */
136 name = ACPI_SYSTEM_FILE_INFO; 132 name = ACPI_SYSTEM_FILE_INFO;
@@ -158,12 +154,9 @@ static int __init acpi_system_init(void)
158 goto Error; 154 goto Error;
159 155
160 Done: 156 Done:
161 return_VALUE(error); 157 return error;
162 158
163 Error: 159 Error:
164 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
165 "Unable to create '%s' proc fs entry\n", name));
166
167 remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir); 160 remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
168 remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir); 161 remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
169 remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir); 162 remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index ed5e8816d83d..bfb3bfcf9e91 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/sched.h> 28#include <linux/sched.h>
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index e7fe3a14fdaf..c855f4446b5f 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -222,51 +222,48 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
222{ 222{
223 acpi_status status = AE_OK; 223 acpi_status status = AE_OK;
224 224
225 ACPI_FUNCTION_TRACE("acpi_thermal_get_temperature");
226 225
227 if (!tz) 226 if (!tz)
228 return_VALUE(-EINVAL); 227 return -EINVAL;
229 228
230 tz->last_temperature = tz->temperature; 229 tz->last_temperature = tz->temperature;
231 230
232 status = 231 status =
233 acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature); 232 acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature);
234 if (ACPI_FAILURE(status)) 233 if (ACPI_FAILURE(status))
235 return_VALUE(-ENODEV); 234 return -ENODEV;
236 235
237 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", 236 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
238 tz->temperature)); 237 tz->temperature));
239 238
240 return_VALUE(0); 239 return 0;
241} 240}
242 241
243static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) 242static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
244{ 243{
245 acpi_status status = AE_OK; 244 acpi_status status = AE_OK;
246 245
247 ACPI_FUNCTION_TRACE("acpi_thermal_get_polling_frequency");
248 246
249 if (!tz) 247 if (!tz)
250 return_VALUE(-EINVAL); 248 return -EINVAL;
251 249
252 status = 250 status =
253 acpi_evaluate_integer(tz->handle, "_TZP", NULL, 251 acpi_evaluate_integer(tz->handle, "_TZP", NULL,
254 &tz->polling_frequency); 252 &tz->polling_frequency);
255 if (ACPI_FAILURE(status)) 253 if (ACPI_FAILURE(status))
256 return_VALUE(-ENODEV); 254 return -ENODEV;
257 255
258 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", 256 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
259 tz->polling_frequency)); 257 tz->polling_frequency));
260 258
261 return_VALUE(0); 259 return 0;
262} 260}
263 261
264static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds) 262static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
265{ 263{
266 ACPI_FUNCTION_TRACE("acpi_thermal_set_polling");
267 264
268 if (!tz) 265 if (!tz)
269 return_VALUE(-EINVAL); 266 return -EINVAL;
270 267
271 tz->polling_frequency = seconds * 10; /* Convert value to deci-seconds */ 268 tz->polling_frequency = seconds * 10; /* Convert value to deci-seconds */
272 269
@@ -274,7 +271,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds)
274 "Polling frequency set to %lu seconds\n", 271 "Polling frequency set to %lu seconds\n",
275 tz->polling_frequency)); 272 tz->polling_frequency));
276 273
277 return_VALUE(0); 274 return 0;
278} 275}
279 276
280static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode) 277static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
@@ -284,29 +281,28 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
284 struct acpi_object_list arg_list = { 1, &arg0 }; 281 struct acpi_object_list arg_list = { 1, &arg0 };
285 acpi_handle handle = NULL; 282 acpi_handle handle = NULL;
286 283
287 ACPI_FUNCTION_TRACE("acpi_thermal_set_cooling_mode");
288 284
289 if (!tz) 285 if (!tz)
290 return_VALUE(-EINVAL); 286 return -EINVAL;
291 287
292 status = acpi_get_handle(tz->handle, "_SCP", &handle); 288 status = acpi_get_handle(tz->handle, "_SCP", &handle);
293 if (ACPI_FAILURE(status)) { 289 if (ACPI_FAILURE(status)) {
294 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); 290 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
295 return_VALUE(-ENODEV); 291 return -ENODEV;
296 } 292 }
297 293
298 arg0.integer.value = mode; 294 arg0.integer.value = mode;
299 295
300 status = acpi_evaluate_object(handle, NULL, &arg_list, NULL); 296 status = acpi_evaluate_object(handle, NULL, &arg_list, NULL);
301 if (ACPI_FAILURE(status)) 297 if (ACPI_FAILURE(status))
302 return_VALUE(-ENODEV); 298 return -ENODEV;
303 299
304 tz->cooling_mode = mode; 300 tz->cooling_mode = mode;
305 301
306 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n", 302 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n",
307 mode ? "passive" : "active")); 303 mode ? "passive" : "active"));
308 304
309 return_VALUE(0); 305 return 0;
310} 306}
311 307
312static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) 308static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
@@ -314,10 +310,9 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
314 acpi_status status = AE_OK; 310 acpi_status status = AE_OK;
315 int i = 0; 311 int i = 0;
316 312
317 ACPI_FUNCTION_TRACE("acpi_thermal_get_trip_points");
318 313
319 if (!tz) 314 if (!tz)
320 return_VALUE(-EINVAL); 315 return -EINVAL;
321 316
322 /* Critical Shutdown (required) */ 317 /* Critical Shutdown (required) */
323 318
@@ -325,8 +320,8 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
325 &tz->trips.critical.temperature); 320 &tz->trips.critical.temperature);
326 if (ACPI_FAILURE(status)) { 321 if (ACPI_FAILURE(status)) {
327 tz->trips.critical.flags.valid = 0; 322 tz->trips.critical.flags.valid = 0;
328 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n")); 323 ACPI_EXCEPTION((AE_INFO, status, "No critical threshold"));
329 return_VALUE(-ENODEV); 324 return -ENODEV;
330 } else { 325 } else {
331 tz->trips.critical.flags.valid = 1; 326 tz->trips.critical.flags.valid = 1;
332 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 327 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -384,8 +379,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
384 tz->trips.passive.flags.valid = 0; 379 tz->trips.passive.flags.valid = 0;
385 380
386 if (!tz->trips.passive.flags.valid) 381 if (!tz->trips.passive.flags.valid)
387 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 382 printk(KERN_WARNING PREFIX "Invalid passive threshold\n");
388 "Invalid passive threshold\n"));
389 else 383 else
390 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 384 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
391 "Found passive threshold [%lu]\n", 385 "Found passive threshold [%lu]\n",
@@ -414,29 +408,27 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
414 "Found active threshold [%d]:[%lu]\n", 408 "Found active threshold [%d]:[%lu]\n",
415 i, tz->trips.active[i].temperature)); 409 i, tz->trips.active[i].temperature));
416 } else 410 } else
417 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 411 ACPI_EXCEPTION((AE_INFO, status,
418 "Invalid active threshold [%d]\n", 412 "Invalid active threshold [%d]", i));
419 i));
420 } 413 }
421 414
422 return_VALUE(0); 415 return 0;
423} 416}
424 417
425static int acpi_thermal_get_devices(struct acpi_thermal *tz) 418static int acpi_thermal_get_devices(struct acpi_thermal *tz)
426{ 419{
427 acpi_status status = AE_OK; 420 acpi_status status = AE_OK;
428 421
429 ACPI_FUNCTION_TRACE("acpi_thermal_get_devices");
430 422
431 if (!tz) 423 if (!tz)
432 return_VALUE(-EINVAL); 424 return -EINVAL;
433 425
434 status = 426 status =
435 acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices); 427 acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices);
436 if (ACPI_FAILURE(status)) 428 if (ACPI_FAILURE(status))
437 return_VALUE(-ENODEV); 429 return -ENODEV;
438 430
439 return_VALUE(0); 431 return 0;
440} 432}
441 433
442static int acpi_thermal_call_usermode(char *path) 434static int acpi_thermal_call_usermode(char *path)
@@ -444,10 +436,9 @@ static int acpi_thermal_call_usermode(char *path)
444 char *argv[2] = { NULL, NULL }; 436 char *argv[2] = { NULL, NULL };
445 char *envp[3] = { NULL, NULL, NULL }; 437 char *envp[3] = { NULL, NULL, NULL };
446 438
447 ACPI_FUNCTION_TRACE("acpi_thermal_call_usermode");
448 439
449 if (!path) 440 if (!path)
450 return_VALUE(-EINVAL); 441 return -EINVAL;
451 442
452 argv[0] = path; 443 argv[0] = path;
453 444
@@ -457,7 +448,7 @@ static int acpi_thermal_call_usermode(char *path)
457 448
458 call_usermodehelper(argv[0], argv, envp, 0); 449 call_usermodehelper(argv[0], argv, envp, 0);
459 450
460 return_VALUE(0); 451 return 0;
461} 452}
462 453
463static int acpi_thermal_critical(struct acpi_thermal *tz) 454static int acpi_thermal_critical(struct acpi_thermal *tz)
@@ -465,20 +456,19 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
465 int result = 0; 456 int result = 0;
466 struct acpi_device *device = NULL; 457 struct acpi_device *device = NULL;
467 458
468 ACPI_FUNCTION_TRACE("acpi_thermal_critical");
469 459
470 if (!tz || !tz->trips.critical.flags.valid) 460 if (!tz || !tz->trips.critical.flags.valid)
471 return_VALUE(-EINVAL); 461 return -EINVAL;
472 462
473 if (tz->temperature >= tz->trips.critical.temperature) { 463 if (tz->temperature >= tz->trips.critical.temperature) {
474 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n")); 464 printk(KERN_WARNING PREFIX "Critical trip point\n");
475 tz->trips.critical.flags.enabled = 1; 465 tz->trips.critical.flags.enabled = 1;
476 } else if (tz->trips.critical.flags.enabled) 466 } else if (tz->trips.critical.flags.enabled)
477 tz->trips.critical.flags.enabled = 0; 467 tz->trips.critical.flags.enabled = 0;
478 468
479 result = acpi_bus_get_device(tz->handle, &device); 469 result = acpi_bus_get_device(tz->handle, &device);
480 if (result) 470 if (result)
481 return_VALUE(result); 471 return result;
482 472
483 printk(KERN_EMERG 473 printk(KERN_EMERG
484 "Critical temperature reached (%ld C), shutting down.\n", 474 "Critical temperature reached (%ld C), shutting down.\n",
@@ -488,7 +478,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
488 478
489 acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); 479 acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
490 480
491 return_VALUE(0); 481 return 0;
492} 482}
493 483
494static int acpi_thermal_hot(struct acpi_thermal *tz) 484static int acpi_thermal_hot(struct acpi_thermal *tz)
@@ -496,27 +486,26 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
496 int result = 0; 486 int result = 0;
497 struct acpi_device *device = NULL; 487 struct acpi_device *device = NULL;
498 488
499 ACPI_FUNCTION_TRACE("acpi_thermal_hot");
500 489
501 if (!tz || !tz->trips.hot.flags.valid) 490 if (!tz || !tz->trips.hot.flags.valid)
502 return_VALUE(-EINVAL); 491 return -EINVAL;
503 492
504 if (tz->temperature >= tz->trips.hot.temperature) { 493 if (tz->temperature >= tz->trips.hot.temperature) {
505 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Hot trip point\n")); 494 printk(KERN_WARNING PREFIX "Hot trip point\n");
506 tz->trips.hot.flags.enabled = 1; 495 tz->trips.hot.flags.enabled = 1;
507 } else if (tz->trips.hot.flags.enabled) 496 } else if (tz->trips.hot.flags.enabled)
508 tz->trips.hot.flags.enabled = 0; 497 tz->trips.hot.flags.enabled = 0;
509 498
510 result = acpi_bus_get_device(tz->handle, &device); 499 result = acpi_bus_get_device(tz->handle, &device);
511 if (result) 500 if (result)
512 return_VALUE(result); 501 return result;
513 502
514 acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT, 503 acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT,
515 tz->trips.hot.flags.enabled); 504 tz->trips.hot.flags.enabled);
516 505
517 /* TBD: Call user-mode "sleep(S4)" function */ 506 /* TBD: Call user-mode "sleep(S4)" function */
518 507
519 return_VALUE(0); 508 return 0;
520} 509}
521 510
522static void acpi_thermal_passive(struct acpi_thermal *tz) 511static void acpi_thermal_passive(struct acpi_thermal *tz)
@@ -526,7 +515,6 @@ static void acpi_thermal_passive(struct acpi_thermal *tz)
526 int trend = 0; 515 int trend = 0;
527 int i = 0; 516 int i = 0;
528 517
529 ACPI_FUNCTION_TRACE("acpi_thermal_passive");
530 518
531 if (!tz || !tz->trips.passive.flags.valid) 519 if (!tz || !tz->trips.passive.flags.valid)
532 return; 520 return;
@@ -615,7 +603,6 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
615 int j = 0; 603 int j = 0;
616 unsigned long maxtemp = 0; 604 unsigned long maxtemp = 0;
617 605
618 ACPI_FUNCTION_TRACE("acpi_thermal_active");
619 606
620 if (!tz) 607 if (!tz)
621 return; 608 return;
@@ -642,10 +629,10 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
642 handles[j], 629 handles[j],
643 ACPI_STATE_D0); 630 ACPI_STATE_D0);
644 if (result) { 631 if (result) {
645 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 632 printk(KERN_WARNING PREFIX
646 "Unable to turn cooling device [%p] 'on'\n", 633 "Unable to turn cooling device [%p] 'on'\n",
647 active->devices. 634 active->devices.
648 handles[j])); 635 handles[j]);
649 continue; 636 continue;
650 } 637 }
651 active->flags.enabled = 1; 638 active->flags.enabled = 1;
@@ -667,9 +654,9 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
667 result = acpi_bus_set_power(active->devices.handles[j], 654 result = acpi_bus_set_power(active->devices.handles[j],
668 ACPI_STATE_D3); 655 ACPI_STATE_D3);
669 if (result) { 656 if (result) {
670 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 657 printk(KERN_WARNING PREFIX
671 "Unable to turn cooling device [%p] 'off'\n", 658 "Unable to turn cooling device [%p] 'off'\n",
672 active->devices.handles[j])); 659 active->devices.handles[j]);
673 continue; 660 continue;
674 } 661 }
675 active->flags.enabled = 0; 662 active->flags.enabled = 0;
@@ -697,18 +684,17 @@ static void acpi_thermal_check(void *data)
697 int i = 0; 684 int i = 0;
698 struct acpi_thermal_state state; 685 struct acpi_thermal_state state;
699 686
700 ACPI_FUNCTION_TRACE("acpi_thermal_check");
701 687
702 if (!tz) { 688 if (!tz) {
703 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); 689 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
704 return_VOID; 690 return;
705 } 691 }
706 692
707 state = tz->state; 693 state = tz->state;
708 694
709 result = acpi_thermal_get_temperature(tz); 695 result = acpi_thermal_get_temperature(tz);
710 if (result) 696 if (result)
711 return_VOID; 697 return;
712 698
713 memset(&tz->state, 0, sizeof(tz->state)); 699 memset(&tz->state, 0, sizeof(tz->state));
714 700
@@ -797,7 +783,7 @@ static void acpi_thermal_check(void *data)
797 } 783 }
798 } 784 }
799 785
800 return_VOID; 786 return;
801} 787}
802 788
803/* -------------------------------------------------------------------------- 789/* --------------------------------------------------------------------------
@@ -810,7 +796,6 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
810{ 796{
811 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 797 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
812 798
813 ACPI_FUNCTION_TRACE("acpi_thermal_state_seq_show");
814 799
815 if (!tz) 800 if (!tz)
816 goto end; 801 goto end;
@@ -833,7 +818,7 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
833 } 818 }
834 819
835 end: 820 end:
836 return_VALUE(0); 821 return 0;
837} 822}
838 823
839static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file) 824static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file)
@@ -846,7 +831,6 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)
846 int result = 0; 831 int result = 0;
847 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 832 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
848 833
849 ACPI_FUNCTION_TRACE("acpi_thermal_temp_seq_show");
850 834
851 if (!tz) 835 if (!tz)
852 goto end; 836 goto end;
@@ -859,7 +843,7 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)
859 KELVIN_TO_CELSIUS(tz->temperature)); 843 KELVIN_TO_CELSIUS(tz->temperature));
860 844
861 end: 845 end:
862 return_VALUE(0); 846 return 0;
863} 847}
864 848
865static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file) 849static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
@@ -873,7 +857,6 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
873 int i = 0; 857 int i = 0;
874 int j = 0; 858 int j = 0;
875 859
876 ACPI_FUNCTION_TRACE("acpi_thermal_trip_seq_show");
877 860
878 if (!tz) 861 if (!tz)
879 goto end; 862 goto end;
@@ -913,7 +896,7 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
913 } 896 }
914 897
915 end: 898 end:
916 return_VALUE(0); 899 return 0;
917} 900}
918 901
919static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file) 902static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file)
@@ -934,28 +917,25 @@ acpi_thermal_write_trip_points(struct file *file,
934 int *active; 917 int *active;
935 int i = 0; 918 int i = 0;
936 919
937 ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
938 920
939 limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL); 921 limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL);
940 if (!limit_string) 922 if (!limit_string)
941 return_VALUE(-ENOMEM); 923 return -ENOMEM;
942 924
943 memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); 925 memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
944 926
945 active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL); 927 active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
946 if (!active) { 928 if (!active) {
947 kfree(limit_string); 929 kfree(limit_string);
948 return_VALUE(-ENOMEM); 930 return -ENOMEM;
949 } 931 }
950 932
951 if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { 933 if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
952 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
953 count = -EINVAL; 934 count = -EINVAL;
954 goto end; 935 goto end;
955 } 936 }
956 937
957 if (copy_from_user(limit_string, buffer, count)) { 938 if (copy_from_user(limit_string, buffer, count)) {
958 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
959 count = -EFAULT; 939 count = -EFAULT;
960 goto end; 940 goto end;
961 } 941 }
@@ -968,7 +948,6 @@ acpi_thermal_write_trip_points(struct file *file,
968 &active[5], &active[6], &active[7], &active[8], 948 &active[5], &active[6], &active[7], &active[8],
969 &active[9]); 949 &active[9]);
970 if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) { 950 if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
971 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
972 count = -EINVAL; 951 count = -EINVAL;
973 goto end; 952 goto end;
974 } 953 }
@@ -985,14 +964,13 @@ acpi_thermal_write_trip_points(struct file *file,
985 end: 964 end:
986 kfree(active); 965 kfree(active);
987 kfree(limit_string); 966 kfree(limit_string);
988 return_VALUE(count); 967 return count;
989} 968}
990 969
991static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) 970static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
992{ 971{
993 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 972 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
994 973
995 ACPI_FUNCTION_TRACE("acpi_thermal_cooling_seq_show");
996 974
997 if (!tz) 975 if (!tz)
998 goto end; 976 goto end;
@@ -1008,7 +986,7 @@ static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
1008 tz->cooling_mode ? "passive" : "active"); 986 tz->cooling_mode ? "passive" : "active");
1009 987
1010 end: 988 end:
1011 return_VALUE(0); 989 return 0;
1012} 990}
1013 991
1014static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file) 992static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file)
@@ -1027,16 +1005,15 @@ acpi_thermal_write_cooling_mode(struct file *file,
1027 int result = 0; 1005 int result = 0;
1028 char mode_string[12] = { '\0' }; 1006 char mode_string[12] = { '\0' };
1029 1007
1030 ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode");
1031 1008
1032 if (!tz || (count > sizeof(mode_string) - 1)) 1009 if (!tz || (count > sizeof(mode_string) - 1))
1033 return_VALUE(-EINVAL); 1010 return -EINVAL;
1034 1011
1035 if (!tz->flags.cooling_mode) 1012 if (!tz->flags.cooling_mode)
1036 return_VALUE(-ENODEV); 1013 return -ENODEV;
1037 1014
1038 if (copy_from_user(mode_string, buffer, count)) 1015 if (copy_from_user(mode_string, buffer, count))
1039 return_VALUE(-EFAULT); 1016 return -EFAULT;
1040 1017
1041 mode_string[count] = '\0'; 1018 mode_string[count] = '\0';
1042 1019
@@ -1044,18 +1021,17 @@ acpi_thermal_write_cooling_mode(struct file *file,
1044 simple_strtoul(mode_string, NULL, 1021 simple_strtoul(mode_string, NULL,
1045 0)); 1022 0));
1046 if (result) 1023 if (result)
1047 return_VALUE(result); 1024 return result;
1048 1025
1049 acpi_thermal_check(tz); 1026 acpi_thermal_check(tz);
1050 1027
1051 return_VALUE(count); 1028 return count;
1052} 1029}
1053 1030
1054static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) 1031static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
1055{ 1032{
1056 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 1033 struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
1057 1034
1058 ACPI_FUNCTION_TRACE("acpi_thermal_polling_seq_show");
1059 1035
1060 if (!tz) 1036 if (!tz)
1061 goto end; 1037 goto end;
@@ -1069,7 +1045,7 @@ static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
1069 (tz->polling_frequency / 10)); 1045 (tz->polling_frequency / 10));
1070 1046
1071 end: 1047 end:
1072 return_VALUE(0); 1048 return 0;
1073} 1049}
1074 1050
1075static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file) 1051static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file)
@@ -1089,13 +1065,12 @@ acpi_thermal_write_polling(struct file *file,
1089 char polling_string[12] = { '\0' }; 1065 char polling_string[12] = { '\0' };
1090 int seconds = 0; 1066 int seconds = 0;
1091 1067
1092 ACPI_FUNCTION_TRACE("acpi_thermal_write_polling");
1093 1068
1094 if (!tz || (count > sizeof(polling_string) - 1)) 1069 if (!tz || (count > sizeof(polling_string) - 1))
1095 return_VALUE(-EINVAL); 1070 return -EINVAL;
1096 1071
1097 if (copy_from_user(polling_string, buffer, count)) 1072 if (copy_from_user(polling_string, buffer, count))
1098 return_VALUE(-EFAULT); 1073 return -EFAULT;
1099 1074
1100 polling_string[count] = '\0'; 1075 polling_string[count] = '\0';
1101 1076
@@ -1103,24 +1078,23 @@ acpi_thermal_write_polling(struct file *file,
1103 1078
1104 result = acpi_thermal_set_polling(tz, seconds); 1079 result = acpi_thermal_set_polling(tz, seconds);
1105 if (result) 1080 if (result)
1106 return_VALUE(result); 1081 return result;
1107 1082
1108 acpi_thermal_check(tz); 1083 acpi_thermal_check(tz);
1109 1084
1110 return_VALUE(count); 1085 return count;
1111} 1086}
1112 1087
1113static int acpi_thermal_add_fs(struct acpi_device *device) 1088static int acpi_thermal_add_fs(struct acpi_device *device)
1114{ 1089{
1115 struct proc_dir_entry *entry = NULL; 1090 struct proc_dir_entry *entry = NULL;
1116 1091
1117 ACPI_FUNCTION_TRACE("acpi_thermal_add_fs");
1118 1092
1119 if (!acpi_device_dir(device)) { 1093 if (!acpi_device_dir(device)) {
1120 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 1094 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
1121 acpi_thermal_dir); 1095 acpi_thermal_dir);
1122 if (!acpi_device_dir(device)) 1096 if (!acpi_device_dir(device))
1123 return_VALUE(-ENODEV); 1097 return -ENODEV;
1124 acpi_device_dir(device)->owner = THIS_MODULE; 1098 acpi_device_dir(device)->owner = THIS_MODULE;
1125 } 1099 }
1126 1100
@@ -1128,9 +1102,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1128 entry = create_proc_entry(ACPI_THERMAL_FILE_STATE, 1102 entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
1129 S_IRUGO, acpi_device_dir(device)); 1103 S_IRUGO, acpi_device_dir(device));
1130 if (!entry) 1104 if (!entry)
1131 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1105 return -ENODEV;
1132 "Unable to create '%s' fs entry\n",
1133 ACPI_THERMAL_FILE_STATE));
1134 else { 1106 else {
1135 entry->proc_fops = &acpi_thermal_state_fops; 1107 entry->proc_fops = &acpi_thermal_state_fops;
1136 entry->data = acpi_driver_data(device); 1108 entry->data = acpi_driver_data(device);
@@ -1141,9 +1113,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1141 entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE, 1113 entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
1142 S_IRUGO, acpi_device_dir(device)); 1114 S_IRUGO, acpi_device_dir(device));
1143 if (!entry) 1115 if (!entry)
1144 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1116 return -ENODEV;
1145 "Unable to create '%s' fs entry\n",
1146 ACPI_THERMAL_FILE_TEMPERATURE));
1147 else { 1117 else {
1148 entry->proc_fops = &acpi_thermal_temp_fops; 1118 entry->proc_fops = &acpi_thermal_temp_fops;
1149 entry->data = acpi_driver_data(device); 1119 entry->data = acpi_driver_data(device);
@@ -1155,9 +1125,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1155 S_IFREG | S_IRUGO | S_IWUSR, 1125 S_IFREG | S_IRUGO | S_IWUSR,
1156 acpi_device_dir(device)); 1126 acpi_device_dir(device));
1157 if (!entry) 1127 if (!entry)
1158 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1128 return -ENODEV;
1159 "Unable to create '%s' fs entry\n",
1160 ACPI_THERMAL_FILE_TRIP_POINTS));
1161 else { 1129 else {
1162 entry->proc_fops = &acpi_thermal_trip_fops; 1130 entry->proc_fops = &acpi_thermal_trip_fops;
1163 entry->data = acpi_driver_data(device); 1131 entry->data = acpi_driver_data(device);
@@ -1169,9 +1137,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1169 S_IFREG | S_IRUGO | S_IWUSR, 1137 S_IFREG | S_IRUGO | S_IWUSR,
1170 acpi_device_dir(device)); 1138 acpi_device_dir(device));
1171 if (!entry) 1139 if (!entry)
1172 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1140 return -ENODEV;
1173 "Unable to create '%s' fs entry\n",
1174 ACPI_THERMAL_FILE_COOLING_MODE));
1175 else { 1141 else {
1176 entry->proc_fops = &acpi_thermal_cooling_fops; 1142 entry->proc_fops = &acpi_thermal_cooling_fops;
1177 entry->data = acpi_driver_data(device); 1143 entry->data = acpi_driver_data(device);
@@ -1183,21 +1149,18 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1183 S_IFREG | S_IRUGO | S_IWUSR, 1149 S_IFREG | S_IRUGO | S_IWUSR,
1184 acpi_device_dir(device)); 1150 acpi_device_dir(device));
1185 if (!entry) 1151 if (!entry)
1186 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1152 return -ENODEV;
1187 "Unable to create '%s' fs entry\n",
1188 ACPI_THERMAL_FILE_POLLING_FREQ));
1189 else { 1153 else {
1190 entry->proc_fops = &acpi_thermal_polling_fops; 1154 entry->proc_fops = &acpi_thermal_polling_fops;
1191 entry->data = acpi_driver_data(device); 1155 entry->data = acpi_driver_data(device);
1192 entry->owner = THIS_MODULE; 1156 entry->owner = THIS_MODULE;
1193 } 1157 }
1194 1158
1195 return_VALUE(0); 1159 return 0;
1196} 1160}
1197 1161
1198static int acpi_thermal_remove_fs(struct acpi_device *device) 1162static int acpi_thermal_remove_fs(struct acpi_device *device)
1199{ 1163{
1200 ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
1201 1164
1202 if (acpi_device_dir(device)) { 1165 if (acpi_device_dir(device)) {
1203 remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ, 1166 remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ,
@@ -1214,7 +1177,7 @@ static int acpi_thermal_remove_fs(struct acpi_device *device)
1214 acpi_device_dir(device) = NULL; 1177 acpi_device_dir(device) = NULL;
1215 } 1178 }
1216 1179
1217 return_VALUE(0); 1180 return 0;
1218} 1181}
1219 1182
1220/* -------------------------------------------------------------------------- 1183/* --------------------------------------------------------------------------
@@ -1226,13 +1189,12 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1226 struct acpi_thermal *tz = (struct acpi_thermal *)data; 1189 struct acpi_thermal *tz = (struct acpi_thermal *)data;
1227 struct acpi_device *device = NULL; 1190 struct acpi_device *device = NULL;
1228 1191
1229 ACPI_FUNCTION_TRACE("acpi_thermal_notify");
1230 1192
1231 if (!tz) 1193 if (!tz)
1232 return_VOID; 1194 return;
1233 1195
1234 if (acpi_bus_get_device(tz->handle, &device)) 1196 if (acpi_bus_get_device(tz->handle, &device))
1235 return_VOID; 1197 return;
1236 1198
1237 switch (event) { 1199 switch (event) {
1238 case ACPI_THERMAL_NOTIFY_TEMPERATURE: 1200 case ACPI_THERMAL_NOTIFY_TEMPERATURE:
@@ -1254,27 +1216,26 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1254 break; 1216 break;
1255 } 1217 }
1256 1218
1257 return_VOID; 1219 return;
1258} 1220}
1259 1221
1260static int acpi_thermal_get_info(struct acpi_thermal *tz) 1222static int acpi_thermal_get_info(struct acpi_thermal *tz)
1261{ 1223{
1262 int result = 0; 1224 int result = 0;
1263 1225
1264 ACPI_FUNCTION_TRACE("acpi_thermal_get_info");
1265 1226
1266 if (!tz) 1227 if (!tz)
1267 return_VALUE(-EINVAL); 1228 return -EINVAL;
1268 1229
1269 /* Get temperature [_TMP] (required) */ 1230 /* Get temperature [_TMP] (required) */
1270 result = acpi_thermal_get_temperature(tz); 1231 result = acpi_thermal_get_temperature(tz);
1271 if (result) 1232 if (result)
1272 return_VALUE(result); 1233 return result;
1273 1234
1274 /* Get trip points [_CRT, _PSV, etc.] (required) */ 1235 /* Get trip points [_CRT, _PSV, etc.] (required) */
1275 result = acpi_thermal_get_trip_points(tz); 1236 result = acpi_thermal_get_trip_points(tz);
1276 if (result) 1237 if (result)
1277 return_VALUE(result); 1238 return result;
1278 1239
1279 /* Set the cooling mode [_SCP] to active cooling (default) */ 1240 /* Set the cooling mode [_SCP] to active cooling (default) */
1280 result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); 1241 result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
@@ -1314,7 +1275,7 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
1314 if (!result) 1275 if (!result)
1315 tz->flags.devices = 1; 1276 tz->flags.devices = 1;
1316 1277
1317 return_VALUE(0); 1278 return 0;
1318} 1279}
1319 1280
1320static int acpi_thermal_add(struct acpi_device *device) 1281static int acpi_thermal_add(struct acpi_device *device)
@@ -1323,14 +1284,13 @@ static int acpi_thermal_add(struct acpi_device *device)
1323 acpi_status status = AE_OK; 1284 acpi_status status = AE_OK;
1324 struct acpi_thermal *tz = NULL; 1285 struct acpi_thermal *tz = NULL;
1325 1286
1326 ACPI_FUNCTION_TRACE("acpi_thermal_add");
1327 1287
1328 if (!device) 1288 if (!device)
1329 return_VALUE(-EINVAL); 1289 return -EINVAL;
1330 1290
1331 tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL); 1291 tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL);
1332 if (!tz) 1292 if (!tz)
1333 return_VALUE(-ENOMEM); 1293 return -ENOMEM;
1334 memset(tz, 0, sizeof(struct acpi_thermal)); 1294 memset(tz, 0, sizeof(struct acpi_thermal));
1335 1295
1336 tz->handle = device->handle; 1296 tz->handle = device->handle;
@@ -1355,8 +1315,6 @@ static int acpi_thermal_add(struct acpi_device *device)
1355 ACPI_DEVICE_NOTIFY, 1315 ACPI_DEVICE_NOTIFY,
1356 acpi_thermal_notify, tz); 1316 acpi_thermal_notify, tz);
1357 if (ACPI_FAILURE(status)) { 1317 if (ACPI_FAILURE(status)) {
1358 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1359 "Error installing notify handler\n"));
1360 result = -ENODEV; 1318 result = -ENODEV;
1361 goto end; 1319 goto end;
1362 } 1320 }
@@ -1371,7 +1329,7 @@ static int acpi_thermal_add(struct acpi_device *device)
1371 kfree(tz); 1329 kfree(tz);
1372 } 1330 }
1373 1331
1374 return_VALUE(result); 1332 return result;
1375} 1333}
1376 1334
1377static int acpi_thermal_remove(struct acpi_device *device, int type) 1335static int acpi_thermal_remove(struct acpi_device *device, int type)
@@ -1379,10 +1337,9 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1379 acpi_status status = AE_OK; 1337 acpi_status status = AE_OK;
1380 struct acpi_thermal *tz = NULL; 1338 struct acpi_thermal *tz = NULL;
1381 1339
1382 ACPI_FUNCTION_TRACE("acpi_thermal_remove");
1383 1340
1384 if (!device || !acpi_driver_data(device)) 1341 if (!device || !acpi_driver_data(device))
1385 return_VALUE(-EINVAL); 1342 return -EINVAL;
1386 1343
1387 tz = (struct acpi_thermal *)acpi_driver_data(device); 1344 tz = (struct acpi_thermal *)acpi_driver_data(device);
1388 1345
@@ -1398,9 +1355,6 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1398 status = acpi_remove_notify_handler(tz->handle, 1355 status = acpi_remove_notify_handler(tz->handle,
1399 ACPI_DEVICE_NOTIFY, 1356 ACPI_DEVICE_NOTIFY,
1400 acpi_thermal_notify); 1357 acpi_thermal_notify);
1401 if (ACPI_FAILURE(status))
1402 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1403 "Error removing notify handler\n"));
1404 1358
1405 /* Terminate policy */ 1359 /* Terminate policy */
1406 if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) { 1360 if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) {
@@ -1416,7 +1370,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1416 acpi_thermal_remove_fs(device); 1370 acpi_thermal_remove_fs(device);
1417 1371
1418 kfree(tz); 1372 kfree(tz);
1419 return_VALUE(0); 1373 return 0;
1420} 1374}
1421 1375
1422static int acpi_thermal_resume(struct acpi_device *device, int state) 1376static int acpi_thermal_resume(struct acpi_device *device, int state)
@@ -1424,7 +1378,7 @@ static int acpi_thermal_resume(struct acpi_device *device, int state)
1424 struct acpi_thermal *tz = NULL; 1378 struct acpi_thermal *tz = NULL;
1425 1379
1426 if (!device || !acpi_driver_data(device)) 1380 if (!device || !acpi_driver_data(device))
1427 return_VALUE(-EINVAL); 1381 return -EINVAL;
1428 1382
1429 tz = (struct acpi_thermal *)acpi_driver_data(device); 1383 tz = (struct acpi_thermal *)acpi_driver_data(device);
1430 1384
@@ -1437,31 +1391,29 @@ static int __init acpi_thermal_init(void)
1437{ 1391{
1438 int result = 0; 1392 int result = 0;
1439 1393
1440 ACPI_FUNCTION_TRACE("acpi_thermal_init");
1441 1394
1442 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); 1395 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
1443 if (!acpi_thermal_dir) 1396 if (!acpi_thermal_dir)
1444 return_VALUE(-ENODEV); 1397 return -ENODEV;
1445 acpi_thermal_dir->owner = THIS_MODULE; 1398 acpi_thermal_dir->owner = THIS_MODULE;
1446 1399
1447 result = acpi_bus_register_driver(&acpi_thermal_driver); 1400 result = acpi_bus_register_driver(&acpi_thermal_driver);
1448 if (result < 0) { 1401 if (result < 0) {
1449 remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir); 1402 remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
1450 return_VALUE(-ENODEV); 1403 return -ENODEV;
1451 } 1404 }
1452 1405
1453 return_VALUE(0); 1406 return 0;
1454} 1407}
1455 1408
1456static void __exit acpi_thermal_exit(void) 1409static void __exit acpi_thermal_exit(void)
1457{ 1410{
1458 ACPI_FUNCTION_TRACE("acpi_thermal_exit");
1459 1411
1460 acpi_bus_unregister_driver(&acpi_thermal_driver); 1412 acpi_bus_unregister_driver(&acpi_thermal_driver);
1461 1413
1462 remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir); 1414 remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
1463 1415
1464 return_VOID; 1416 return;
1465} 1417}
1466 1418
1467module_init(acpi_thermal_init); 1419module_init(acpi_thermal_init);
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 67b9f325c6fa..38ebe1c54330 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -155,21 +155,30 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
155 case ACPI_TYPE_MUTEX: 155 case ACPI_TYPE_MUTEX:
156 156
157 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 157 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
158 "***** Mutex %p, Semaphore %p\n", 158 "***** Mutex %p, OS Mutex %p\n",
159 object, object->mutex.semaphore)); 159 object, object->mutex.os_mutex));
160 160
161 acpi_ex_unlink_mutex(object); 161 if (object->mutex.os_mutex != ACPI_GLOBAL_LOCK) {
162 (void)acpi_os_delete_semaphore(object->mutex.semaphore); 162 acpi_ex_unlink_mutex(object);
163 acpi_os_delete_mutex(object->mutex.os_mutex);
164 } else {
165 /* Global Lock "mutex" is actually a counting semaphore */
166
167 (void)
168 acpi_os_delete_semaphore
169 (acpi_gbl_global_lock_semaphore);
170 acpi_gbl_global_lock_semaphore = NULL;
171 }
163 break; 172 break;
164 173
165 case ACPI_TYPE_EVENT: 174 case ACPI_TYPE_EVENT:
166 175
167 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 176 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
168 "***** Event %p, Semaphore %p\n", 177 "***** Event %p, OS Semaphore %p\n",
169 object, object->event.semaphore)); 178 object, object->event.os_semaphore));
170 179
171 (void)acpi_os_delete_semaphore(object->event.semaphore); 180 (void)acpi_os_delete_semaphore(object->event.os_semaphore);
172 object->event.semaphore = NULL; 181 object->event.os_semaphore = NULL;
173 break; 182 break;
174 183
175 case ACPI_TYPE_METHOD: 184 case ACPI_TYPE_METHOD:
@@ -177,12 +186,13 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
177 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 186 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
178 "***** Method %p\n", object)); 187 "***** Method %p\n", object));
179 188
180 /* Delete the method semaphore if it exists */ 189 /* Delete the method mutex if it exists */
181 190
182 if (object->method.semaphore) { 191 if (object->method.mutex) {
183 (void)acpi_os_delete_semaphore(object->method. 192 acpi_os_delete_mutex(object->method.mutex->mutex.
184 semaphore); 193 os_mutex);
185 object->method.semaphore = NULL; 194 acpi_ut_delete_object_desc(object->method.mutex);
195 object->method.mutex = NULL;
186 } 196 }
187 break; 197 break;
188 198
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index e5999c65c0b8..014030af8b50 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -794,6 +794,7 @@ void acpi_ut_init_globals(void)
794 794
795 /* Global Lock support */ 795 /* Global Lock support */
796 796
797 acpi_gbl_global_lock_semaphore = NULL;
797 acpi_gbl_global_lock_acquired = FALSE; 798 acpi_gbl_global_lock_acquired = FALSE;
798 acpi_gbl_global_lock_thread_count = 0; 799 acpi_gbl_global_lock_thread_count = 0;
799 acpi_gbl_global_lock_handle = 0; 800 acpi_gbl_global_lock_handle = 0;
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 5c75d35ad1cd..33268310c738 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -41,6 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/module.h>
45
44#include <acpi/acpi.h> 46#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
46 48
@@ -962,6 +964,7 @@ acpi_ut_exception(char *module_name,
962 acpi_os_vprintf(format, args); 964 acpi_os_vprintf(format, args);
963 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); 965 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
964} 966}
967EXPORT_SYMBOL(acpi_ut_exception);
965 968
966void ACPI_INTERNAL_VAR_XFACE 969void ACPI_INTERNAL_VAR_XFACE
967acpi_ut_warning(char *module_name, u32 line_number, char *format, ...) 970acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index 25eb34369afa..dfc8f30ca892 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -82,12 +82,9 @@ acpi_status acpi_ut_mutex_initialize(void)
82 82
83 /* Create the spinlocks for use at interrupt level */ 83 /* Create the spinlocks for use at interrupt level */
84 84
85 status = acpi_os_create_lock(&acpi_gbl_gpe_lock); 85 spin_lock_init(acpi_gbl_gpe_lock);
86 if (ACPI_FAILURE(status)) { 86 spin_lock_init(acpi_gbl_hardware_lock);
87 return_ACPI_STATUS(status);
88 }
89 87
90 status = acpi_os_create_lock(&acpi_gbl_hardware_lock);
91 return_ACPI_STATUS(status); 88 return_ACPI_STATUS(status);
92} 89}
93 90
@@ -146,9 +143,8 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
146 } 143 }
147 144
148 if (!acpi_gbl_mutex_info[mutex_id].mutex) { 145 if (!acpi_gbl_mutex_info[mutex_id].mutex) {
149 status = acpi_os_create_semaphore(1, 1, 146 status =
150 &acpi_gbl_mutex_info 147 acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex);
151 [mutex_id].mutex);
152 acpi_gbl_mutex_info[mutex_id].thread_id = 148 acpi_gbl_mutex_info[mutex_id].thread_id =
153 ACPI_MUTEX_NOT_ACQUIRED; 149 ACPI_MUTEX_NOT_ACQUIRED;
154 acpi_gbl_mutex_info[mutex_id].use_count = 0; 150 acpi_gbl_mutex_info[mutex_id].use_count = 0;
@@ -171,7 +167,6 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
171 167
172static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) 168static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
173{ 169{
174 acpi_status status;
175 170
176 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); 171 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id);
177 172
@@ -179,12 +174,12 @@ static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
179 return_ACPI_STATUS(AE_BAD_PARAMETER); 174 return_ACPI_STATUS(AE_BAD_PARAMETER);
180 } 175 }
181 176
182 status = acpi_os_delete_semaphore(acpi_gbl_mutex_info[mutex_id].mutex); 177 acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex);
183 178
184 acpi_gbl_mutex_info[mutex_id].mutex = NULL; 179 acpi_gbl_mutex_info[mutex_id].mutex = NULL;
185 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; 180 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
186 181
187 return_ACPI_STATUS(status); 182 return_ACPI_STATUS(AE_OK);
188} 183}
189 184
190/******************************************************************************* 185/*******************************************************************************
@@ -251,8 +246,8 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
251 "Thread %X attempting to acquire Mutex [%s]\n", 246 "Thread %X attempting to acquire Mutex [%s]\n",
252 this_thread_id, acpi_ut_get_mutex_name(mutex_id))); 247 this_thread_id, acpi_ut_get_mutex_name(mutex_id)));
253 248
254 status = acpi_os_wait_semaphore(acpi_gbl_mutex_info[mutex_id].mutex, 249 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
255 1, ACPI_WAIT_FOREVER); 250 ACPI_WAIT_FOREVER);
256 if (ACPI_SUCCESS(status)) { 251 if (ACPI_SUCCESS(status)) {
257 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 252 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
258 "Thread %X acquired Mutex [%s]\n", 253 "Thread %X acquired Mutex [%s]\n",
@@ -284,7 +279,6 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
284 279
285acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) 280acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
286{ 281{
287 acpi_status status;
288 acpi_thread_id this_thread_id; 282 acpi_thread_id this_thread_id;
289 283
290 ACPI_FUNCTION_NAME(ut_release_mutex); 284 ACPI_FUNCTION_NAME(ut_release_mutex);
@@ -340,19 +334,6 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
340 334
341 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; 335 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
342 336
343 status = 337 acpi_os_release_mutex(acpi_gbl_mutex_info[mutex_id].mutex);
344 acpi_os_signal_semaphore(acpi_gbl_mutex_info[mutex_id].mutex, 1); 338 return (AE_OK);
345
346 if (ACPI_FAILURE(status)) {
347 ACPI_EXCEPTION((AE_INFO, status,
348 "Thread %X could not release Mutex [%X]",
349 this_thread_id, mutex_id));
350 } else {
351 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
352 "Thread %X released Mutex [%s]\n",
353 this_thread_id,
354 acpi_ut_get_mutex_name(mutex_id)));
355 }
356
357 return (status);
358} 339}
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 6b516852ac12..1930e1a75b22 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -58,31 +58,29 @@ acpi_extract_package(union acpi_object *package,
58 u8 *head = NULL; 58 u8 *head = NULL;
59 u8 *tail = NULL; 59 u8 *tail = NULL;
60 60
61 ACPI_FUNCTION_TRACE("acpi_extract_package");
62 61
63 if (!package || (package->type != ACPI_TYPE_PACKAGE) 62 if (!package || (package->type != ACPI_TYPE_PACKAGE)
64 || (package->package.count < 1)) { 63 || (package->package.count < 1)) {
65 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 64 printk(KERN_WARNING PREFIX "Invalid package argument\n");
66 "Invalid 'package' argument\n")); 65 return AE_BAD_PARAMETER;
67 return_ACPI_STATUS(AE_BAD_PARAMETER);
68 } 66 }
69 67
70 if (!format || !format->pointer || (format->length < 1)) { 68 if (!format || !format->pointer || (format->length < 1)) {
71 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n")); 69 printk(KERN_WARNING PREFIX "Invalid format argument\n");
72 return_ACPI_STATUS(AE_BAD_PARAMETER); 70 return AE_BAD_PARAMETER;
73 } 71 }
74 72
75 if (!buffer) { 73 if (!buffer) {
76 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n")); 74 printk(KERN_WARNING PREFIX "Invalid buffer argument\n");
77 return_ACPI_STATUS(AE_BAD_PARAMETER); 75 return AE_BAD_PARAMETER;
78 } 76 }
79 77
80 format_count = (format->length / sizeof(char)) - 1; 78 format_count = (format->length / sizeof(char)) - 1;
81 if (format_count > package->package.count) { 79 if (format_count > package->package.count) {
82 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 80 printk(KERN_WARNING PREFIX "Format specifies more objects [%d]"
83 "Format specifies more objects [%d] than exist in package [%d].", 81 " than exist in package [%d].\n",
84 format_count, package->package.count)); 82 format_count, package->package.count);
85 return_ACPI_STATUS(AE_BAD_DATA); 83 return AE_BAD_DATA;
86 } 84 }
87 85
88 format_string = (char *)format->pointer; 86 format_string = (char *)format->pointer;
@@ -95,7 +93,7 @@ acpi_extract_package(union acpi_object *package,
95 union acpi_object *element = &(package->package.elements[i]); 93 union acpi_object *element = &(package->package.elements[i]);
96 94
97 if (!element) { 95 if (!element) {
98 return_ACPI_STATUS(AE_BAD_DATA); 96 return AE_BAD_DATA;
99 } 97 }
100 98
101 switch (element->type) { 99 switch (element->type) {
@@ -113,10 +111,11 @@ acpi_extract_package(union acpi_object *package,
113 tail_offset += sizeof(char *); 111 tail_offset += sizeof(char *);
114 break; 112 break;
115 default: 113 default:
116 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 114 printk(KERN_WARNING PREFIX "Invalid package element"
117 "Invalid package element [%d]: got number, expecing [%c].\n", 115 " [%d]: got number, expecing"
118 i, format_string[i])); 116 " [%c]\n",
119 return_ACPI_STATUS(AE_BAD_DATA); 117 i, format_string[i]);
118 return AE_BAD_DATA;
120 break; 119 break;
121 } 120 }
122 break; 121 break;
@@ -138,10 +137,11 @@ acpi_extract_package(union acpi_object *package,
138 tail_offset += sizeof(u8 *); 137 tail_offset += sizeof(u8 *);
139 break; 138 break;
140 default: 139 default:
141 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 140 printk(KERN_WARNING PREFIX "Invalid package element"
142 "Invalid package element [%d] got string/buffer, expecing [%c].\n", 141 " [%d] got string/buffer,"
143 i, format_string[i])); 142 " expecing [%c]\n",
144 return_ACPI_STATUS(AE_BAD_DATA); 143 i, format_string[i]);
144 return AE_BAD_DATA;
145 break; 145 break;
146 } 146 }
147 break; 147 break;
@@ -152,7 +152,7 @@ acpi_extract_package(union acpi_object *package,
152 "Found unsupported element at index=%d\n", 152 "Found unsupported element at index=%d\n",
153 i)); 153 i));
154 /* TBD: handle nested packages... */ 154 /* TBD: handle nested packages... */
155 return_ACPI_STATUS(AE_SUPPORT); 155 return AE_SUPPORT;
156 break; 156 break;
157 } 157 }
158 } 158 }
@@ -162,9 +162,9 @@ acpi_extract_package(union acpi_object *package,
162 */ 162 */
163 if (buffer->length < size_required) { 163 if (buffer->length < size_required) {
164 buffer->length = size_required; 164 buffer->length = size_required;
165 return_ACPI_STATUS(AE_BUFFER_OVERFLOW); 165 return AE_BUFFER_OVERFLOW;
166 } else if (buffer->length != size_required || !buffer->pointer) { 166 } else if (buffer->length != size_required || !buffer->pointer) {
167 return_ACPI_STATUS(AE_BAD_PARAMETER); 167 return AE_BAD_PARAMETER;
168 } 168 }
169 169
170 head = buffer->pointer; 170 head = buffer->pointer;
@@ -179,7 +179,7 @@ acpi_extract_package(union acpi_object *package,
179 union acpi_object *element = &(package->package.elements[i]); 179 union acpi_object *element = &(package->package.elements[i]);
180 180
181 if (!element) { 181 if (!element) {
182 return_ACPI_STATUS(AE_BAD_DATA); 182 return AE_BAD_DATA;
183 } 183 }
184 184
185 switch (element->type) { 185 switch (element->type) {
@@ -244,7 +244,7 @@ acpi_extract_package(union acpi_object *package,
244 } 244 }
245 } 245 }
246 246
247 return_ACPI_STATUS(AE_OK); 247 return AE_OK;
248} 248}
249 249
250EXPORT_SYMBOL(acpi_extract_package); 250EXPORT_SYMBOL(acpi_extract_package);
@@ -258,14 +258,13 @@ acpi_evaluate_integer(acpi_handle handle,
258 union acpi_object *element; 258 union acpi_object *element;
259 struct acpi_buffer buffer = { 0, NULL }; 259 struct acpi_buffer buffer = { 0, NULL };
260 260
261 ACPI_FUNCTION_TRACE("acpi_evaluate_integer");
262 261
263 if (!data) 262 if (!data)
264 return_ACPI_STATUS(AE_BAD_PARAMETER); 263 return AE_BAD_PARAMETER;
265 264
266 element = kmalloc(sizeof(union acpi_object), GFP_KERNEL); 265 element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
267 if (!element) 266 if (!element)
268 return_ACPI_STATUS(AE_NO_MEMORY); 267 return AE_NO_MEMORY;
269 268
270 memset(element, 0, sizeof(union acpi_object)); 269 memset(element, 0, sizeof(union acpi_object));
271 buffer.length = sizeof(union acpi_object); 270 buffer.length = sizeof(union acpi_object);
@@ -274,13 +273,13 @@ acpi_evaluate_integer(acpi_handle handle,
274 if (ACPI_FAILURE(status)) { 273 if (ACPI_FAILURE(status)) {
275 acpi_util_eval_error(handle, pathname, status); 274 acpi_util_eval_error(handle, pathname, status);
276 kfree(element); 275 kfree(element);
277 return_ACPI_STATUS(status); 276 return status;
278 } 277 }
279 278
280 if (element->type != ACPI_TYPE_INTEGER) { 279 if (element->type != ACPI_TYPE_INTEGER) {
281 acpi_util_eval_error(handle, pathname, AE_BAD_DATA); 280 acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
282 kfree(element); 281 kfree(element);
283 return_ACPI_STATUS(AE_BAD_DATA); 282 return AE_BAD_DATA;
284 } 283 }
285 284
286 *data = element->integer.value; 285 *data = element->integer.value;
@@ -288,7 +287,7 @@ acpi_evaluate_integer(acpi_handle handle,
288 287
289 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); 288 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data));
290 289
291 return_ACPI_STATUS(AE_OK); 290 return AE_OK;
292} 291}
293 292
294EXPORT_SYMBOL(acpi_evaluate_integer); 293EXPORT_SYMBOL(acpi_evaluate_integer);
@@ -303,15 +302,14 @@ acpi_evaluate_string(acpi_handle handle,
303 acpi_object *element = NULL; 302 acpi_object *element = NULL;
304 acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 303 acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
305 304
306 ACPI_FUNCTION_TRACE("acpi_evaluate_string");
307 305
308 if (!data) 306 if (!data)
309 return_ACPI_STATUS(AE_BAD_PARAMETER); 307 return AE_BAD_PARAMETER;
310 308
311 status = acpi_evaluate_object(handle, pathname, arguments, &buffer); 309 status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
312 if (ACPI_FAILURE(status)) { 310 if (ACPI_FAILURE(status)) {
313 acpi_util_eval_error(handle, pathname, status); 311 acpi_util_eval_error(handle, pathname, status);
314 return_ACPI_STATUS(status); 312 return status;
315 } 313 }
316 314
317 element = (acpi_object *) buffer.pointer; 315 element = (acpi_object *) buffer.pointer;
@@ -320,13 +318,13 @@ acpi_evaluate_string(acpi_handle handle,
320 || (element->type != ACPI_TYPE_BUFFER) 318 || (element->type != ACPI_TYPE_BUFFER)
321 || !element->string.length) { 319 || !element->string.length) {
322 acpi_util_eval_error(handle, pathname, AE_BAD_DATA); 320 acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
323 return_ACPI_STATUS(AE_BAD_DATA); 321 return AE_BAD_DATA;
324 } 322 }
325 323
326 *data = kmalloc(element->string.length + 1, GFP_KERNEL); 324 *data = kmalloc(element->string.length + 1, GFP_KERNEL);
327 if (!data) { 325 if (!data) {
328 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); 326 printk(KERN_ERR PREFIX "Memory allocation\n");
329 return_VALUE(-ENOMEM); 327 return -ENOMEM;
330 } 328 }
331 memset(*data, 0, element->string.length + 1); 329 memset(*data, 0, element->string.length + 1);
332 330
@@ -336,7 +334,7 @@ acpi_evaluate_string(acpi_handle handle,
336 334
337 acpi_os_free(buffer.pointer); 335 acpi_os_free(buffer.pointer);
338 336
339 return_ACPI_STATUS(AE_OK); 337 return AE_OK;
340} 338}
341#endif 339#endif
342 340
@@ -352,10 +350,9 @@ acpi_evaluate_reference(acpi_handle handle,
352 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 350 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
353 u32 i = 0; 351 u32 i = 0;
354 352
355 ACPI_FUNCTION_TRACE("acpi_evaluate_reference");
356 353
357 if (!list) { 354 if (!list) {
358 return_ACPI_STATUS(AE_BAD_PARAMETER); 355 return AE_BAD_PARAMETER;
359 } 356 }
360 357
361 /* Evaluate object. */ 358 /* Evaluate object. */
@@ -367,32 +364,29 @@ acpi_evaluate_reference(acpi_handle handle,
367 package = (union acpi_object *)buffer.pointer; 364 package = (union acpi_object *)buffer.pointer;
368 365
369 if ((buffer.length == 0) || !package) { 366 if ((buffer.length == 0) || !package) {
370 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 367 printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
371 "No return object (len %X ptr %p)\n", 368 (unsigned)buffer.length, package);
372 (unsigned)buffer.length, package));
373 status = AE_BAD_DATA; 369 status = AE_BAD_DATA;
374 acpi_util_eval_error(handle, pathname, status); 370 acpi_util_eval_error(handle, pathname, status);
375 goto end; 371 goto end;
376 } 372 }
377 if (package->type != ACPI_TYPE_PACKAGE) { 373 if (package->type != ACPI_TYPE_PACKAGE) {
378 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 374 printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n",
379 "Expecting a [Package], found type %X\n", 375 package->type);
380 package->type));
381 status = AE_BAD_DATA; 376 status = AE_BAD_DATA;
382 acpi_util_eval_error(handle, pathname, status); 377 acpi_util_eval_error(handle, pathname, status);
383 goto end; 378 goto end;
384 } 379 }
385 if (!package->package.count) { 380 if (!package->package.count) {
386 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 381 printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n",
387 "[Package] has zero elements (%p)\n", 382 package);
388 package));
389 status = AE_BAD_DATA; 383 status = AE_BAD_DATA;
390 acpi_util_eval_error(handle, pathname, status); 384 acpi_util_eval_error(handle, pathname, status);
391 goto end; 385 goto end;
392 } 386 }
393 387
394 if (package->package.count > ACPI_MAX_HANDLES) { 388 if (package->package.count > ACPI_MAX_HANDLES) {
395 return_ACPI_STATUS(AE_NO_MEMORY); 389 return AE_NO_MEMORY;
396 } 390 }
397 list->count = package->package.count; 391 list->count = package->package.count;
398 392
@@ -404,9 +398,9 @@ acpi_evaluate_reference(acpi_handle handle,
404 398
405 if (element->type != ACPI_TYPE_ANY) { 399 if (element->type != ACPI_TYPE_ANY) {
406 status = AE_BAD_DATA; 400 status = AE_BAD_DATA;
407 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 401 printk(KERN_ERR PREFIX
408 "Expecting a [Reference] package element, found type %X\n", 402 "Expecting a [Reference] package element, found type %X\n",
409 element->type)); 403 element->type);
410 acpi_util_eval_error(handle, pathname, status); 404 acpi_util_eval_error(handle, pathname, status);
411 break; 405 break;
412 } 406 }
@@ -426,7 +420,7 @@ acpi_evaluate_reference(acpi_handle handle,
426 420
427 acpi_os_free(buffer.pointer); 421 acpi_os_free(buffer.pointer);
428 422
429 return_ACPI_STATUS(status); 423 return status;
430} 424}
431 425
432EXPORT_SYMBOL(acpi_evaluate_reference); 426EXPORT_SYMBOL(acpi_evaluate_reference);
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index e7e9a693953a..9feb633087a9 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -272,10 +272,9 @@ static int
272acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) 272acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
273{ 273{
274 int status; 274 int status;
275 ACPI_FUNCTION_TRACE("acpi_video_device_query");
276 status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); 275 status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state);
277 276
278 return_VALUE(status); 277 return status;
279} 278}
280 279
281static int 280static int
@@ -284,11 +283,10 @@ acpi_video_device_get_state(struct acpi_video_device *device,
284{ 283{
285 int status; 284 int status;
286 285
287 ACPI_FUNCTION_TRACE("acpi_video_device_get_state");
288 286
289 status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state); 287 status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state);
290 288
291 return_VALUE(status); 289 return status;
292} 290}
293 291
294static int 292static int
@@ -299,12 +297,11 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state)
299 struct acpi_object_list args = { 1, &arg0 }; 297 struct acpi_object_list args = { 1, &arg0 };
300 unsigned long ret; 298 unsigned long ret;
301 299
302 ACPI_FUNCTION_TRACE("acpi_video_device_set_state");
303 300
304 arg0.integer.value = state; 301 arg0.integer.value = state;
305 status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); 302 status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret);
306 303
307 return_VALUE(status); 304 return status;
308} 305}
309 306
310static int 307static int
@@ -315,28 +312,27 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
315 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 312 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
316 union acpi_object *obj; 313 union acpi_object *obj;
317 314
318 ACPI_FUNCTION_TRACE("acpi_video_device_lcd_query_levels");
319 315
320 *levels = NULL; 316 *levels = NULL;
321 317
322 status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); 318 status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer);
323 if (!ACPI_SUCCESS(status)) 319 if (!ACPI_SUCCESS(status))
324 return_VALUE(status); 320 return status;
325 obj = (union acpi_object *)buffer.pointer; 321 obj = (union acpi_object *)buffer.pointer;
326 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { 322 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
327 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n")); 323 printk(KERN_ERR PREFIX "Invalid _BCL data\n");
328 status = -EFAULT; 324 status = -EFAULT;
329 goto err; 325 goto err;
330 } 326 }
331 327
332 *levels = obj; 328 *levels = obj;
333 329
334 return_VALUE(0); 330 return 0;
335 331
336 err: 332 err:
337 kfree(buffer.pointer); 333 kfree(buffer.pointer);
338 334
339 return_VALUE(status); 335 return status;
340} 336}
341 337
342static int 338static int
@@ -346,13 +342,12 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
346 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 342 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
347 struct acpi_object_list args = { 1, &arg0 }; 343 struct acpi_object_list args = { 1, &arg0 };
348 344
349 ACPI_FUNCTION_TRACE("acpi_video_device_lcd_set_level");
350 345
351 arg0.integer.value = level; 346 arg0.integer.value = level;
352 status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); 347 status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL);
353 348
354 printk(KERN_DEBUG "set_level status: %x\n", status); 349 printk(KERN_DEBUG "set_level status: %x\n", status);
355 return_VALUE(status); 350 return status;
356} 351}
357 352
358static int 353static int
@@ -360,11 +355,10 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
360 unsigned long *level) 355 unsigned long *level)
361{ 356{
362 int status; 357 int status;
363 ACPI_FUNCTION_TRACE("acpi_video_device_lcd_get_level_current");
364 358
365 status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); 359 status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level);
366 360
367 return_VALUE(status); 361 return status;
368} 362}
369 363
370static int 364static int
@@ -377,34 +371,33 @@ acpi_video_device_EDID(struct acpi_video_device *device,
377 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 371 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
378 struct acpi_object_list args = { 1, &arg0 }; 372 struct acpi_object_list args = { 1, &arg0 };
379 373
380 ACPI_FUNCTION_TRACE("acpi_video_device_get_EDID");
381 374
382 *edid = NULL; 375 *edid = NULL;
383 376
384 if (!device) 377 if (!device)
385 return_VALUE(-ENODEV); 378 return -ENODEV;
386 if (length == 128) 379 if (length == 128)
387 arg0.integer.value = 1; 380 arg0.integer.value = 1;
388 else if (length == 256) 381 else if (length == 256)
389 arg0.integer.value = 2; 382 arg0.integer.value = 2;
390 else 383 else
391 return_VALUE(-EINVAL); 384 return -EINVAL;
392 385
393 status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); 386 status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer);
394 if (ACPI_FAILURE(status)) 387 if (ACPI_FAILURE(status))
395 return_VALUE(-ENODEV); 388 return -ENODEV;
396 389
397 obj = (union acpi_object *)buffer.pointer; 390 obj = (union acpi_object *)buffer.pointer;
398 391
399 if (obj && obj->type == ACPI_TYPE_BUFFER) 392 if (obj && obj->type == ACPI_TYPE_BUFFER)
400 *edid = obj; 393 *edid = obj;
401 else { 394 else {
402 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DDC data\n")); 395 printk(KERN_ERR PREFIX "Invalid _DDC data\n");
403 status = -EFAULT; 396 status = -EFAULT;
404 kfree(obj); 397 kfree(obj);
405 } 398 }
406 399
407 return_VALUE(status); 400 return status;
408} 401}
409 402
410/* bus */ 403/* bus */
@@ -417,7 +410,6 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
417 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 410 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
418 struct acpi_object_list args = { 1, &arg0 }; 411 struct acpi_object_list args = { 1, &arg0 };
419 412
420 ACPI_FUNCTION_TRACE("acpi_video_bus_set_POST");
421 413
422 arg0.integer.value = option; 414 arg0.integer.value = option;
423 415
@@ -425,7 +417,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
425 if (ACPI_SUCCESS(status)) 417 if (ACPI_SUCCESS(status))
426 status = tmp ? (-EINVAL) : (AE_OK); 418 status = tmp ? (-EINVAL) : (AE_OK);
427 419
428 return_VALUE(status); 420 return status;
429} 421}
430 422
431static int 423static int
@@ -433,11 +425,10 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
433{ 425{
434 int status; 426 int status;
435 427
436 ACPI_FUNCTION_TRACE("acpi_video_bus_get_POST");
437 428
438 status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id); 429 status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id);
439 430
440 return_VALUE(status); 431 return status;
441} 432}
442 433
443static int 434static int
@@ -445,12 +436,11 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video,
445 unsigned long *options) 436 unsigned long *options)
446{ 437{
447 int status; 438 int status;
448 ACPI_FUNCTION_TRACE("acpi_video_bus_POST_options");
449 439
450 status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); 440 status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options);
451 *options &= 3; 441 *options &= 3;
452 442
453 return_VALUE(status); 443 return status;
454} 444}
455 445
456/* 446/*
@@ -481,7 +471,6 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
481 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 471 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
482 struct acpi_object_list args = { 1, &arg0 }; 472 struct acpi_object_list args = { 1, &arg0 };
483 473
484 ACPI_FUNCTION_TRACE("acpi_video_bus_DOS");
485 474
486 if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) { 475 if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) {
487 status = -1; 476 status = -1;
@@ -492,7 +481,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
492 acpi_evaluate_object(video->handle, "_DOS", &args, NULL); 481 acpi_evaluate_object(video->handle, "_DOS", &args, NULL);
493 482
494 Failed: 483 Failed:
495 return_VALUE(status); 484 return status;
496} 485}
497 486
498/* 487/*
@@ -514,7 +503,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
514 union acpi_object *obj = NULL; 503 union acpi_object *obj = NULL;
515 struct acpi_video_device_brightness *br = NULL; 504 struct acpi_video_device_brightness *br = NULL;
516 505
517 ACPI_FUNCTION_TRACE("acpi_video_device_find_cap");
518 506
519 memset(&device->cap, 0, 4); 507 memset(&device->cap, 0, 4);
520 508
@@ -560,8 +548,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
560 o = (union acpi_object *)&obj->package. 548 o = (union acpi_object *)&obj->package.
561 elements[i]; 549 elements[i];
562 if (o->type != ACPI_TYPE_INTEGER) { 550 if (o->type != ACPI_TYPE_INTEGER) {
563 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 551 printk(KERN_ERR PREFIX "Invalid data\n");
564 "Invalid data\n"));
565 continue; 552 continue;
566 } 553 }
567 br->levels[count] = (u32) o->integer.value; 554 br->levels[count] = (u32) o->integer.value;
@@ -583,7 +570,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
583 570
584 kfree(obj); 571 kfree(obj);
585 572
586 return_VOID; 573 return;
587} 574}
588 575
589/* 576/*
@@ -630,10 +617,9 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
630{ 617{
631 acpi_status status = -ENOENT; 618 acpi_status status = -ENOENT;
632 619
633 ACPI_FUNCTION_TRACE("acpi_video_bus_check");
634 620
635 if (!video) 621 if (!video)
636 return_VALUE(-EINVAL); 622 return -EINVAL;
637 623
638 /* Since there is no HID, CID and so on for VGA driver, we have 624 /* Since there is no HID, CID and so on for VGA driver, we have
639 * to check well known required nodes. 625 * to check well known required nodes.
@@ -657,7 +643,7 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
657 status = 0; 643 status = 0;
658 } 644 }
659 645
660 return_VALUE(status); 646 return status;
661} 647}
662 648
663/* -------------------------------------------------------------------------- 649/* --------------------------------------------------------------------------
@@ -673,7 +659,6 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
673 struct acpi_video_device *dev = 659 struct acpi_video_device *dev =
674 (struct acpi_video_device *)seq->private; 660 (struct acpi_video_device *)seq->private;
675 661
676 ACPI_FUNCTION_TRACE("acpi_video_device_info_seq_show");
677 662
678 if (!dev) 663 if (!dev)
679 goto end; 664 goto end;
@@ -692,7 +677,7 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
692 seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no"); 677 seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no");
693 678
694 end: 679 end:
695 return_VALUE(0); 680 return 0;
696} 681}
697 682
698static int 683static int
@@ -709,7 +694,6 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
709 (struct acpi_video_device *)seq->private; 694 (struct acpi_video_device *)seq->private;
710 unsigned long state; 695 unsigned long state;
711 696
712 ACPI_FUNCTION_TRACE("acpi_video_device_state_seq_show");
713 697
714 if (!dev) 698 if (!dev)
715 goto end; 699 goto end;
@@ -729,7 +713,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
729 seq_printf(seq, "<not supported>\n"); 713 seq_printf(seq, "<not supported>\n");
730 714
731 end: 715 end:
732 return_VALUE(0); 716 return 0;
733} 717}
734 718
735static int 719static int
@@ -750,13 +734,12 @@ acpi_video_device_write_state(struct file *file,
750 char str[12] = { 0 }; 734 char str[12] = { 0 };
751 u32 state = 0; 735 u32 state = 0;
752 736
753 ACPI_FUNCTION_TRACE("acpi_video_device_write_state");
754 737
755 if (!dev || count + 1 > sizeof str) 738 if (!dev || count + 1 > sizeof str)
756 return_VALUE(-EINVAL); 739 return -EINVAL;
757 740
758 if (copy_from_user(str, buffer, count)) 741 if (copy_from_user(str, buffer, count))
759 return_VALUE(-EFAULT); 742 return -EFAULT;
760 743
761 str[count] = 0; 744 str[count] = 0;
762 state = simple_strtoul(str, NULL, 0); 745 state = simple_strtoul(str, NULL, 0);
@@ -765,9 +748,9 @@ acpi_video_device_write_state(struct file *file,
765 status = acpi_video_device_set_state(dev, state); 748 status = acpi_video_device_set_state(dev, state);
766 749
767 if (status) 750 if (status)
768 return_VALUE(-EFAULT); 751 return -EFAULT;
769 752
770 return_VALUE(count); 753 return count;
771} 754}
772 755
773static int 756static int
@@ -777,11 +760,10 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset)
777 (struct acpi_video_device *)seq->private; 760 (struct acpi_video_device *)seq->private;
778 int i; 761 int i;
779 762
780 ACPI_FUNCTION_TRACE("acpi_video_device_brightness_seq_show");
781 763
782 if (!dev || !dev->brightness) { 764 if (!dev || !dev->brightness) {
783 seq_printf(seq, "<not supported>\n"); 765 seq_printf(seq, "<not supported>\n");
784 return_VALUE(0); 766 return 0;
785 } 767 }
786 768
787 seq_printf(seq, "levels: "); 769 seq_printf(seq, "levels: ");
@@ -789,7 +771,7 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset)
789 seq_printf(seq, " %d", dev->brightness->levels[i]); 771 seq_printf(seq, " %d", dev->brightness->levels[i]);
790 seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr); 772 seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr);
791 773
792 return_VALUE(0); 774 return 0;
793} 775}
794 776
795static int 777static int
@@ -810,19 +792,18 @@ acpi_video_device_write_brightness(struct file *file,
810 unsigned int level = 0; 792 unsigned int level = 0;
811 int i; 793 int i;
812 794
813 ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness");
814 795
815 if (!dev || !dev->brightness || count + 1 > sizeof str) 796 if (!dev || !dev->brightness || count + 1 > sizeof str)
816 return_VALUE(-EINVAL); 797 return -EINVAL;
817 798
818 if (copy_from_user(str, buffer, count)) 799 if (copy_from_user(str, buffer, count))
819 return_VALUE(-EFAULT); 800 return -EFAULT;
820 801
821 str[count] = 0; 802 str[count] = 0;
822 level = simple_strtoul(str, NULL, 0); 803 level = simple_strtoul(str, NULL, 0);
823 804
824 if (level > 100) 805 if (level > 100)
825 return_VALUE(-EFAULT); 806 return -EFAULT;
826 807
827 /* validate though the list of available levels */ 808 /* validate though the list of available levels */
828 for (i = 0; i < dev->brightness->count; i++) 809 for (i = 0; i < dev->brightness->count; i++)
@@ -833,7 +814,7 @@ acpi_video_device_write_brightness(struct file *file,
833 break; 814 break;
834 } 815 }
835 816
836 return_VALUE(count); 817 return count;
837} 818}
838 819
839static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) 820static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
@@ -844,7 +825,6 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
844 int i; 825 int i;
845 union acpi_object *edid = NULL; 826 union acpi_object *edid = NULL;
846 827
847 ACPI_FUNCTION_TRACE("acpi_video_device_EDID_seq_show");
848 828
849 if (!dev) 829 if (!dev)
850 goto out; 830 goto out;
@@ -869,7 +849,7 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset)
869 else 849 else
870 kfree(edid); 850 kfree(edid);
871 851
872 return_VALUE(0); 852 return 0;
873} 853}
874 854
875static int 855static int
@@ -884,28 +864,26 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
884 struct proc_dir_entry *entry = NULL; 864 struct proc_dir_entry *entry = NULL;
885 struct acpi_video_device *vid_dev; 865 struct acpi_video_device *vid_dev;
886 866
887 ACPI_FUNCTION_TRACE("acpi_video_device_add_fs");
888 867
889 if (!device) 868 if (!device)
890 return_VALUE(-ENODEV); 869 return -ENODEV;
891 870
892 vid_dev = (struct acpi_video_device *)acpi_driver_data(device); 871 vid_dev = (struct acpi_video_device *)acpi_driver_data(device);
893 if (!vid_dev) 872 if (!vid_dev)
894 return_VALUE(-ENODEV); 873 return -ENODEV;
895 874
896 if (!acpi_device_dir(device)) { 875 if (!acpi_device_dir(device)) {
897 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 876 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
898 vid_dev->video->dir); 877 vid_dev->video->dir);
899 if (!acpi_device_dir(device)) 878 if (!acpi_device_dir(device))
900 return_VALUE(-ENODEV); 879 return -ENODEV;
901 acpi_device_dir(device)->owner = THIS_MODULE; 880 acpi_device_dir(device)->owner = THIS_MODULE;
902 } 881 }
903 882
904 /* 'info' [R] */ 883 /* 'info' [R] */
905 entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); 884 entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
906 if (!entry) 885 if (!entry)
907 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 886 return -ENODEV;
908 "Unable to create 'info' fs entry\n"));
909 else { 887 else {
910 entry->proc_fops = &acpi_video_device_info_fops; 888 entry->proc_fops = &acpi_video_device_info_fops;
911 entry->data = acpi_driver_data(device); 889 entry->data = acpi_driver_data(device);
@@ -917,8 +895,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
917 create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR, 895 create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR,
918 acpi_device_dir(device)); 896 acpi_device_dir(device));
919 if (!entry) 897 if (!entry)
920 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 898 return -ENODEV;
921 "Unable to create 'state' fs entry\n"));
922 else { 899 else {
923 acpi_video_device_state_fops.write = acpi_video_device_write_state; 900 acpi_video_device_state_fops.write = acpi_video_device_write_state;
924 entry->proc_fops = &acpi_video_device_state_fops; 901 entry->proc_fops = &acpi_video_device_state_fops;
@@ -931,8 +908,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
931 create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR, 908 create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR,
932 acpi_device_dir(device)); 909 acpi_device_dir(device));
933 if (!entry) 910 if (!entry)
934 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 911 return -ENODEV;
935 "Unable to create 'brightness' fs entry\n"));
936 else { 912 else {
937 acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness; 913 acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness;
938 entry->proc_fops = &acpi_video_device_brightness_fops; 914 entry->proc_fops = &acpi_video_device_brightness_fops;
@@ -943,25 +919,23 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
943 /* 'EDID' [R] */ 919 /* 'EDID' [R] */
944 entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device)); 920 entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device));
945 if (!entry) 921 if (!entry)
946 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 922 return -ENODEV;
947 "Unable to create 'brightness' fs entry\n"));
948 else { 923 else {
949 entry->proc_fops = &acpi_video_device_EDID_fops; 924 entry->proc_fops = &acpi_video_device_EDID_fops;
950 entry->data = acpi_driver_data(device); 925 entry->data = acpi_driver_data(device);
951 entry->owner = THIS_MODULE; 926 entry->owner = THIS_MODULE;
952 } 927 }
953 928
954 return_VALUE(0); 929 return 0;
955} 930}
956 931
957static int acpi_video_device_remove_fs(struct acpi_device *device) 932static int acpi_video_device_remove_fs(struct acpi_device *device)
958{ 933{
959 struct acpi_video_device *vid_dev; 934 struct acpi_video_device *vid_dev;
960 ACPI_FUNCTION_TRACE("acpi_video_device_remove_fs");
961 935
962 vid_dev = (struct acpi_video_device *)acpi_driver_data(device); 936 vid_dev = (struct acpi_video_device *)acpi_driver_data(device);
963 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) 937 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir)
964 return_VALUE(-ENODEV); 938 return -ENODEV;
965 939
966 if (acpi_device_dir(device)) { 940 if (acpi_device_dir(device)) {
967 remove_proc_entry("info", acpi_device_dir(device)); 941 remove_proc_entry("info", acpi_device_dir(device));
@@ -972,7 +946,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device)
972 acpi_device_dir(device) = NULL; 946 acpi_device_dir(device) = NULL;
973 } 947 }
974 948
975 return_VALUE(0); 949 return 0;
976} 950}
977 951
978/* video bus */ 952/* video bus */
@@ -980,7 +954,6 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset)
980{ 954{
981 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 955 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
982 956
983 ACPI_FUNCTION_TRACE("acpi_video_bus_info_seq_show");
984 957
985 if (!video) 958 if (!video)
986 goto end; 959 goto end;
@@ -993,7 +966,7 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset)
993 video->flags.post ? "yes" : "no"); 966 video->flags.post ? "yes" : "no");
994 967
995 end: 968 end:
996 return_VALUE(0); 969 return 0;
997} 970}
998 971
999static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file) 972static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file)
@@ -1006,7 +979,6 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
1006{ 979{
1007 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 980 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
1008 981
1009 ACPI_FUNCTION_TRACE("acpi_video_bus_ROM_seq_show");
1010 982
1011 if (!video) 983 if (!video)
1012 goto end; 984 goto end;
@@ -1015,7 +987,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
1015 seq_printf(seq, "<TODO>\n"); 987 seq_printf(seq, "<TODO>\n");
1016 988
1017 end: 989 end:
1018 return_VALUE(0); 990 return 0;
1019} 991}
1020 992
1021static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file) 993static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file)
@@ -1029,7 +1001,6 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1029 unsigned long options; 1001 unsigned long options;
1030 int status; 1002 int status;
1031 1003
1032 ACPI_FUNCTION_TRACE("acpi_video_bus_POST_info_seq_show");
1033 1004
1034 if (!video) 1005 if (!video)
1035 goto end; 1006 goto end;
@@ -1052,7 +1023,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1052 } else 1023 } else
1053 seq_printf(seq, "<not supported>\n"); 1024 seq_printf(seq, "<not supported>\n");
1054 end: 1025 end:
1055 return_VALUE(0); 1026 return 0;
1056} 1027}
1057 1028
1058static int 1029static int
@@ -1068,7 +1039,6 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
1068 int status; 1039 int status;
1069 unsigned long id; 1040 unsigned long id;
1070 1041
1071 ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show");
1072 1042
1073 if (!video) 1043 if (!video)
1074 goto end; 1044 goto end;
@@ -1081,18 +1051,17 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
1081 seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); 1051 seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]);
1082 1052
1083 end: 1053 end:
1084 return_VALUE(0); 1054 return 0;
1085} 1055}
1086 1056
1087static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) 1057static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset)
1088{ 1058{
1089 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 1059 struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private;
1090 1060
1091 ACPI_FUNCTION_TRACE("acpi_video_bus_DOS_seq_show");
1092 1061
1093 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); 1062 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting);
1094 1063
1095 return_VALUE(0); 1064 return 0;
1096} 1065}
1097 1066
1098static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file) 1067static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file)
@@ -1117,22 +1086,21 @@ acpi_video_bus_write_POST(struct file *file,
1117 char str[12] = { 0 }; 1086 char str[12] = { 0 };
1118 unsigned long opt, options; 1087 unsigned long opt, options;
1119 1088
1120 ACPI_FUNCTION_TRACE("acpi_video_bus_write_POST");
1121 1089
1122 if (!video || count + 1 > sizeof str) 1090 if (!video || count + 1 > sizeof str)
1123 return_VALUE(-EINVAL); 1091 return -EINVAL;
1124 1092
1125 status = acpi_video_bus_POST_options(video, &options); 1093 status = acpi_video_bus_POST_options(video, &options);
1126 if (!ACPI_SUCCESS(status)) 1094 if (!ACPI_SUCCESS(status))
1127 return_VALUE(-EINVAL); 1095 return -EINVAL;
1128 1096
1129 if (copy_from_user(str, buffer, count)) 1097 if (copy_from_user(str, buffer, count))
1130 return_VALUE(-EFAULT); 1098 return -EFAULT;
1131 1099
1132 str[count] = 0; 1100 str[count] = 0;
1133 opt = strtoul(str, NULL, 0); 1101 opt = strtoul(str, NULL, 0);
1134 if (opt > 3) 1102 if (opt > 3)
1135 return_VALUE(-EFAULT); 1103 return -EFAULT;
1136 1104
1137 /* just in case an OEM 'forget' the motherboard... */ 1105 /* just in case an OEM 'forget' the motherboard... */
1138 options |= 1; 1106 options |= 1;
@@ -1140,11 +1108,11 @@ acpi_video_bus_write_POST(struct file *file,
1140 if (options & (1ul << opt)) { 1108 if (options & (1ul << opt)) {
1141 status = acpi_video_bus_set_POST(video, opt); 1109 status = acpi_video_bus_set_POST(video, opt);
1142 if (!ACPI_SUCCESS(status)) 1110 if (!ACPI_SUCCESS(status))
1143 return_VALUE(-EFAULT); 1111 return -EFAULT;
1144 1112
1145 } 1113 }
1146 1114
1147 return_VALUE(count); 1115 return count;
1148} 1116}
1149 1117
1150static ssize_t 1118static ssize_t
@@ -1158,25 +1126,24 @@ acpi_video_bus_write_DOS(struct file *file,
1158 char str[12] = { 0 }; 1126 char str[12] = { 0 };
1159 unsigned long opt; 1127 unsigned long opt;
1160 1128
1161 ACPI_FUNCTION_TRACE("acpi_video_bus_write_DOS");
1162 1129
1163 if (!video || count + 1 > sizeof str) 1130 if (!video || count + 1 > sizeof str)
1164 return_VALUE(-EINVAL); 1131 return -EINVAL;
1165 1132
1166 if (copy_from_user(str, buffer, count)) 1133 if (copy_from_user(str, buffer, count))
1167 return_VALUE(-EFAULT); 1134 return -EFAULT;
1168 1135
1169 str[count] = 0; 1136 str[count] = 0;
1170 opt = strtoul(str, NULL, 0); 1137 opt = strtoul(str, NULL, 0);
1171 if (opt > 7) 1138 if (opt > 7)
1172 return_VALUE(-EFAULT); 1139 return -EFAULT;
1173 1140
1174 status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2); 1141 status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2);
1175 1142
1176 if (!ACPI_SUCCESS(status)) 1143 if (!ACPI_SUCCESS(status))
1177 return_VALUE(-EFAULT); 1144 return -EFAULT;
1178 1145
1179 return_VALUE(count); 1146 return count;
1180} 1147}
1181 1148
1182static int acpi_video_bus_add_fs(struct acpi_device *device) 1149static int acpi_video_bus_add_fs(struct acpi_device *device)
@@ -1184,7 +1151,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1184 struct proc_dir_entry *entry = NULL; 1151 struct proc_dir_entry *entry = NULL;
1185 struct acpi_video_bus *video; 1152 struct acpi_video_bus *video;
1186 1153
1187 ACPI_FUNCTION_TRACE("acpi_video_bus_add_fs");
1188 1154
1189 video = (struct acpi_video_bus *)acpi_driver_data(device); 1155 video = (struct acpi_video_bus *)acpi_driver_data(device);
1190 1156
@@ -1192,7 +1158,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1192 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 1158 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
1193 acpi_video_dir); 1159 acpi_video_dir);
1194 if (!acpi_device_dir(device)) 1160 if (!acpi_device_dir(device))
1195 return_VALUE(-ENODEV); 1161 return -ENODEV;
1196 video->dir = acpi_device_dir(device); 1162 video->dir = acpi_device_dir(device);
1197 acpi_device_dir(device)->owner = THIS_MODULE; 1163 acpi_device_dir(device)->owner = THIS_MODULE;
1198 } 1164 }
@@ -1200,8 +1166,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1200 /* 'info' [R] */ 1166 /* 'info' [R] */
1201 entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); 1167 entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
1202 if (!entry) 1168 if (!entry)
1203 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1169 return -ENODEV;
1204 "Unable to create 'info' fs entry\n"));
1205 else { 1170 else {
1206 entry->proc_fops = &acpi_video_bus_info_fops; 1171 entry->proc_fops = &acpi_video_bus_info_fops;
1207 entry->data = acpi_driver_data(device); 1172 entry->data = acpi_driver_data(device);
@@ -1211,8 +1176,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1211 /* 'ROM' [R] */ 1176 /* 'ROM' [R] */
1212 entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device)); 1177 entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
1213 if (!entry) 1178 if (!entry)
1214 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1179 return -ENODEV;
1215 "Unable to create 'ROM' fs entry\n"));
1216 else { 1180 else {
1217 entry->proc_fops = &acpi_video_bus_ROM_fops; 1181 entry->proc_fops = &acpi_video_bus_ROM_fops;
1218 entry->data = acpi_driver_data(device); 1182 entry->data = acpi_driver_data(device);
@@ -1223,8 +1187,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1223 entry = 1187 entry =
1224 create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device)); 1188 create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
1225 if (!entry) 1189 if (!entry)
1226 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1190 return -ENODEV;
1227 "Unable to create 'POST_info' fs entry\n"));
1228 else { 1191 else {
1229 entry->proc_fops = &acpi_video_bus_POST_info_fops; 1192 entry->proc_fops = &acpi_video_bus_POST_info_fops;
1230 entry->data = acpi_driver_data(device); 1193 entry->data = acpi_driver_data(device);
@@ -1236,8 +1199,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1236 create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR, 1199 create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR,
1237 acpi_device_dir(device)); 1200 acpi_device_dir(device));
1238 if (!entry) 1201 if (!entry)
1239 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1202 return -ENODEV;
1240 "Unable to create 'POST' fs entry\n"));
1241 else { 1203 else {
1242 acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; 1204 acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
1243 entry->proc_fops = &acpi_video_bus_POST_fops; 1205 entry->proc_fops = &acpi_video_bus_POST_fops;
@@ -1250,8 +1212,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1250 create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR, 1212 create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR,
1251 acpi_device_dir(device)); 1213 acpi_device_dir(device));
1252 if (!entry) 1214 if (!entry)
1253 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1215 return -ENODEV;
1254 "Unable to create 'DOS' fs entry\n"));
1255 else { 1216 else {
1256 acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; 1217 acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
1257 entry->proc_fops = &acpi_video_bus_DOS_fops; 1218 entry->proc_fops = &acpi_video_bus_DOS_fops;
@@ -1259,14 +1220,13 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1259 entry->owner = THIS_MODULE; 1220 entry->owner = THIS_MODULE;
1260 } 1221 }
1261 1222
1262 return_VALUE(0); 1223 return 0;
1263} 1224}
1264 1225
1265static int acpi_video_bus_remove_fs(struct acpi_device *device) 1226static int acpi_video_bus_remove_fs(struct acpi_device *device)
1266{ 1227{
1267 struct acpi_video_bus *video; 1228 struct acpi_video_bus *video;
1268 1229
1269 ACPI_FUNCTION_TRACE("acpi_video_bus_remove_fs");
1270 1230
1271 video = (struct acpi_video_bus *)acpi_driver_data(device); 1231 video = (struct acpi_video_bus *)acpi_driver_data(device);
1272 1232
@@ -1280,7 +1240,7 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device)
1280 acpi_device_dir(device) = NULL; 1240 acpi_device_dir(device) = NULL;
1281 } 1241 }
1282 1242
1283 return_VALUE(0); 1243 return 0;
1284} 1244}
1285 1245
1286/* -------------------------------------------------------------------------- 1246/* --------------------------------------------------------------------------
@@ -1297,10 +1257,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1297 int status; 1257 int status;
1298 struct acpi_video_device *data; 1258 struct acpi_video_device *data;
1299 1259
1300 ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device");
1301 1260
1302 if (!device || !video) 1261 if (!device || !video)
1303 return_VALUE(-EINVAL); 1262 return -EINVAL;
1304 1263
1305 status = 1264 status =
1306 acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); 1265 acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
@@ -1308,7 +1267,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1308 1267
1309 data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); 1268 data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
1310 if (!data) 1269 if (!data)
1311 return_VALUE(-ENOMEM); 1270 return -ENOMEM;
1312 1271
1313 memset(data, 0, sizeof(struct acpi_video_device)); 1272 memset(data, 0, sizeof(struct acpi_video_device));
1314 1273
@@ -1359,10 +1318,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1359 1318
1360 acpi_video_device_add_fs(device); 1319 acpi_video_device_add_fs(device);
1361 1320
1362 return_VALUE(0); 1321 return 0;
1363 } 1322 }
1364 1323
1365 return_VALUE(-ENOENT); 1324 return -ENOENT;
1366} 1325}
1367 1326
1368/* 1327/*
@@ -1405,7 +1364,6 @@ acpi_video_device_bind(struct acpi_video_bus *video,
1405 struct acpi_video_device *device) 1364 struct acpi_video_device *device)
1406{ 1365{
1407 int i; 1366 int i;
1408 ACPI_FUNCTION_TRACE("acpi_video_device_bind");
1409 1367
1410#define IDS_VAL(i) video->attached_array[i].value.int_val 1368#define IDS_VAL(i) video->attached_array[i].value.int_val
1411#define IDS_BIND(i) video->attached_array[i].bind_info 1369#define IDS_BIND(i) video->attached_array[i].bind_info
@@ -1442,17 +1400,16 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1442 union acpi_object *dod = NULL; 1400 union acpi_object *dod = NULL;
1443 union acpi_object *obj; 1401 union acpi_object *obj;
1444 1402
1445 ACPI_FUNCTION_TRACE("acpi_video_device_enumerate");
1446 1403
1447 status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer); 1404 status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);
1448 if (!ACPI_SUCCESS(status)) { 1405 if (!ACPI_SUCCESS(status)) {
1449 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _DOD\n")); 1406 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));
1450 return_VALUE(status); 1407 return status;
1451 } 1408 }
1452 1409
1453 dod = (union acpi_object *)buffer.pointer; 1410 dod = (union acpi_object *)buffer.pointer;
1454 if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { 1411 if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) {
1455 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DOD data\n")); 1412 ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data"));
1456 status = -EFAULT; 1413 status = -EFAULT;
1457 goto out; 1414 goto out;
1458 } 1415 }
@@ -1476,8 +1433,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1476 obj = (union acpi_object *)&dod->package.elements[i]; 1433 obj = (union acpi_object *)&dod->package.elements[i];
1477 1434
1478 if (obj->type != ACPI_TYPE_INTEGER) { 1435 if (obj->type != ACPI_TYPE_INTEGER) {
1479 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1436 printk(KERN_ERR PREFIX "Invalid _DOD data\n");
1480 "Invalid _DOD data\n"));
1481 active_device_list[i].value.int_val = 1437 active_device_list[i].value.int_val =
1482 ACPI_VIDEO_HEAD_INVALID; 1438 ACPI_VIDEO_HEAD_INVALID;
1483 } 1439 }
@@ -1495,7 +1451,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1495 video->attached_count = count; 1451 video->attached_count = count;
1496 out: 1452 out:
1497 acpi_os_free(buffer.pointer); 1453 acpi_os_free(buffer.pointer);
1498 return_VALUE(status); 1454 return status;
1499} 1455}
1500 1456
1501/* 1457/*
@@ -1520,7 +1476,6 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
1520 unsigned long state; 1476 unsigned long state;
1521 int status = 0; 1477 int status = 0;
1522 1478
1523 ACPI_FUNCTION_TRACE("acpi_video_switch_output");
1524 1479
1525 list_for_each_safe(node, next, &video->video_device_list) { 1480 list_for_each_safe(node, next, &video->video_device_list) {
1526 dev = container_of(node, struct acpi_video_device, entry); 1481 dev = container_of(node, struct acpi_video_device, entry);
@@ -1551,7 +1506,7 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
1551 break; 1506 break;
1552 } 1507 }
1553 1508
1554 return_VALUE(status); 1509 return status;
1555} 1510}
1556 1511
1557static int 1512static int
@@ -1578,7 +1533,6 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
1578 int status = 0; 1533 int status = 0;
1579 struct list_head *node, *next; 1534 struct list_head *node, *next;
1580 1535
1581 ACPI_FUNCTION_TRACE("acpi_video_get_devices");
1582 1536
1583 acpi_video_device_enumerate(video); 1537 acpi_video_device_enumerate(video);
1584 1538
@@ -1591,13 +1545,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
1591 1545
1592 status = acpi_video_bus_get_one_device(dev, video); 1546 status = acpi_video_bus_get_one_device(dev, video);
1593 if (ACPI_FAILURE(status)) { 1547 if (ACPI_FAILURE(status)) {
1594 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1548 ACPI_EXCEPTION((AE_INFO, status, "Cant attach device"));
1595 "Cant attach device\n"));
1596 continue; 1549 continue;
1597 } 1550 }
1598 1551
1599 } 1552 }
1600 return_VALUE(status); 1553 return status;
1601} 1554}
1602 1555
1603static int acpi_video_bus_put_one_device(struct acpi_video_device *device) 1556static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
@@ -1605,10 +1558,9 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
1605 acpi_status status; 1558 acpi_status status;
1606 struct acpi_video_bus *video; 1559 struct acpi_video_bus *video;
1607 1560
1608 ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device");
1609 1561
1610 if (!device || !device->video) 1562 if (!device || !device->video)
1611 return_VALUE(-ENOENT); 1563 return -ENOENT;
1612 1564
1613 video = device->video; 1565 video = device->video;
1614 1566
@@ -1620,11 +1572,8 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
1620 status = acpi_remove_notify_handler(device->handle, 1572 status = acpi_remove_notify_handler(device->handle,
1621 ACPI_DEVICE_NOTIFY, 1573 ACPI_DEVICE_NOTIFY,
1622 acpi_video_device_notify); 1574 acpi_video_device_notify);
1623 if (ACPI_FAILURE(status))
1624 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1625 "Error removing notify handler\n"));
1626 1575
1627 return_VALUE(0); 1576 return 0;
1628} 1577}
1629 1578
1630static int acpi_video_bus_put_devices(struct acpi_video_bus *video) 1579static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
@@ -1632,7 +1581,6 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
1632 int status; 1581 int status;
1633 struct list_head *node, *next; 1582 struct list_head *node, *next;
1634 1583
1635 ACPI_FUNCTION_TRACE("acpi_video_bus_put_devices");
1636 1584
1637 list_for_each_safe(node, next, &video->video_device_list) { 1585 list_for_each_safe(node, next, &video->video_device_list) {
1638 struct acpi_video_device *data = 1586 struct acpi_video_device *data =
@@ -1651,7 +1599,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
1651 kfree(data); 1599 kfree(data);
1652 } 1600 }
1653 1601
1654 return_VALUE(0); 1602 return 0;
1655} 1603}
1656 1604
1657/* acpi_video interface */ 1605/* acpi_video interface */
@@ -1671,14 +1619,13 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1671 struct acpi_video_bus *video = (struct acpi_video_bus *)data; 1619 struct acpi_video_bus *video = (struct acpi_video_bus *)data;
1672 struct acpi_device *device = NULL; 1620 struct acpi_device *device = NULL;
1673 1621
1674 ACPI_FUNCTION_TRACE("acpi_video_bus_notify");
1675 printk("video bus notify\n"); 1622 printk("video bus notify\n");
1676 1623
1677 if (!video) 1624 if (!video)
1678 return_VOID; 1625 return;
1679 1626
1680 if (acpi_bus_get_device(handle, &device)) 1627 if (acpi_bus_get_device(handle, &device))
1681 return_VOID; 1628 return;
1682 1629
1683 switch (event) { 1630 switch (event) {
1684 case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, 1631 case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur,
@@ -1707,7 +1654,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1707 break; 1654 break;
1708 } 1655 }
1709 1656
1710 return_VOID; 1657 return;
1711} 1658}
1712 1659
1713static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) 1660static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
@@ -1716,14 +1663,13 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1716 (struct acpi_video_device *)data; 1663 (struct acpi_video_device *)data;
1717 struct acpi_device *device = NULL; 1664 struct acpi_device *device = NULL;
1718 1665
1719 ACPI_FUNCTION_TRACE("acpi_video_device_notify");
1720 1666
1721 printk("video device notify\n"); 1667 printk("video device notify\n");
1722 if (!video_device) 1668 if (!video_device)
1723 return_VOID; 1669 return;
1724 1670
1725 if (acpi_bus_get_device(handle, &device)) 1671 if (acpi_bus_get_device(handle, &device))
1726 return_VOID; 1672 return;
1727 1673
1728 switch (event) { 1674 switch (event) {
1729 case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ 1675 case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */
@@ -1743,7 +1689,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1743 "Unsupported event [0x%x]\n", event)); 1689 "Unsupported event [0x%x]\n", event));
1744 break; 1690 break;
1745 } 1691 }
1746 return_VOID; 1692 return;
1747} 1693}
1748 1694
1749static int acpi_video_bus_add(struct acpi_device *device) 1695static int acpi_video_bus_add(struct acpi_device *device)
@@ -1752,14 +1698,13 @@ static int acpi_video_bus_add(struct acpi_device *device)
1752 acpi_status status = 0; 1698 acpi_status status = 0;
1753 struct acpi_video_bus *video = NULL; 1699 struct acpi_video_bus *video = NULL;
1754 1700
1755 ACPI_FUNCTION_TRACE("acpi_video_bus_add");
1756 1701
1757 if (!device) 1702 if (!device)
1758 return_VALUE(-EINVAL); 1703 return -EINVAL;
1759 1704
1760 video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); 1705 video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
1761 if (!video) 1706 if (!video)
1762 return_VALUE(-ENOMEM); 1707 return -ENOMEM;
1763 memset(video, 0, sizeof(struct acpi_video_bus)); 1708 memset(video, 0, sizeof(struct acpi_video_bus));
1764 1709
1765 video->handle = device->handle; 1710 video->handle = device->handle;
@@ -1806,7 +1751,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
1806 if (result) 1751 if (result)
1807 kfree(video); 1752 kfree(video);
1808 1753
1809 return_VALUE(result); 1754 return result;
1810} 1755}
1811 1756
1812static int acpi_video_bus_remove(struct acpi_device *device, int type) 1757static int acpi_video_bus_remove(struct acpi_device *device, int type)
@@ -1814,10 +1759,9 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
1814 acpi_status status = 0; 1759 acpi_status status = 0;
1815 struct acpi_video_bus *video = NULL; 1760 struct acpi_video_bus *video = NULL;
1816 1761
1817 ACPI_FUNCTION_TRACE("acpi_video_bus_remove");
1818 1762
1819 if (!device || !acpi_driver_data(device)) 1763 if (!device || !acpi_driver_data(device))
1820 return_VALUE(-EINVAL); 1764 return -EINVAL;
1821 1765
1822 video = (struct acpi_video_bus *)acpi_driver_data(device); 1766 video = (struct acpi_video_bus *)acpi_driver_data(device);
1823 1767
@@ -1826,9 +1770,6 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
1826 status = acpi_remove_notify_handler(video->handle, 1770 status = acpi_remove_notify_handler(video->handle,
1827 ACPI_DEVICE_NOTIFY, 1771 ACPI_DEVICE_NOTIFY,
1828 acpi_video_bus_notify); 1772 acpi_video_bus_notify);
1829 if (ACPI_FAILURE(status))
1830 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1831 "Error removing notify handler\n"));
1832 1773
1833 acpi_video_bus_put_devices(video); 1774 acpi_video_bus_put_devices(video);
1834 acpi_video_bus_remove_fs(device); 1775 acpi_video_bus_remove_fs(device);
@@ -1836,7 +1777,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
1836 kfree(video->attached_array); 1777 kfree(video->attached_array);
1837 kfree(video); 1778 kfree(video);
1838 1779
1839 return_VALUE(0); 1780 return 0;
1840} 1781}
1841 1782
1842static int 1783static int
@@ -1846,10 +1787,9 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver)
1846 acpi_handle h_dummy2; 1787 acpi_handle h_dummy2;
1847 acpi_handle h_dummy3; 1788 acpi_handle h_dummy3;
1848 1789
1849 ACPI_FUNCTION_TRACE("acpi_video_bus_match");
1850 1790
1851 if (!device || !driver) 1791 if (!device || !driver)
1852 return_VALUE(-EINVAL); 1792 return -EINVAL;
1853 1793
1854 /* Since there is no HID, CID for ACPI Video drivers, we have 1794 /* Since there is no HID, CID for ACPI Video drivers, we have
1855 * to check well known required nodes for each feature we support. 1795 * to check well known required nodes for each feature we support.
@@ -1858,26 +1798,25 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver)
1858 /* Does this device able to support video switching ? */ 1798 /* Does this device able to support video switching ? */
1859 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) && 1799 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) &&
1860 ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) 1800 ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2)))
1861 return_VALUE(0); 1801 return 0;
1862 1802
1863 /* Does this device able to retrieve a video ROM ? */ 1803 /* Does this device able to retrieve a video ROM ? */
1864 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) 1804 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1)))
1865 return_VALUE(0); 1805 return 0;
1866 1806
1867 /* Does this device able to configure which video head to be POSTed ? */ 1807 /* Does this device able to configure which video head to be POSTed ? */
1868 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) && 1808 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) &&
1869 ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) && 1809 ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) &&
1870 ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) 1810 ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3)))
1871 return_VALUE(0); 1811 return 0;
1872 1812
1873 return_VALUE(-ENODEV); 1813 return -ENODEV;
1874} 1814}
1875 1815
1876static int __init acpi_video_init(void) 1816static int __init acpi_video_init(void)
1877{ 1817{
1878 int result = 0; 1818 int result = 0;
1879 1819
1880 ACPI_FUNCTION_TRACE("acpi_video_init");
1881 1820
1882 /* 1821 /*
1883 acpi_dbg_level = 0xFFFFFFFF; 1822 acpi_dbg_level = 0xFFFFFFFF;
@@ -1886,27 +1825,26 @@ static int __init acpi_video_init(void)
1886 1825
1887 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); 1826 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
1888 if (!acpi_video_dir) 1827 if (!acpi_video_dir)
1889 return_VALUE(-ENODEV); 1828 return -ENODEV;
1890 acpi_video_dir->owner = THIS_MODULE; 1829 acpi_video_dir->owner = THIS_MODULE;
1891 1830
1892 result = acpi_bus_register_driver(&acpi_video_bus); 1831 result = acpi_bus_register_driver(&acpi_video_bus);
1893 if (result < 0) { 1832 if (result < 0) {
1894 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); 1833 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
1895 return_VALUE(-ENODEV); 1834 return -ENODEV;
1896 } 1835 }
1897 1836
1898 return_VALUE(0); 1837 return 0;
1899} 1838}
1900 1839
1901static void __exit acpi_video_exit(void) 1840static void __exit acpi_video_exit(void)
1902{ 1841{
1903 ACPI_FUNCTION_TRACE("acpi_video_exit");
1904 1842
1905 acpi_bus_unregister_driver(&acpi_video_bus); 1843 acpi_bus_unregister_driver(&acpi_video_bus);
1906 1844
1907 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); 1845 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
1908 1846
1909 return_VOID; 1847 return;
1910} 1848}
1911 1849
1912module_init(acpi_video_init); 1850module_init(acpi_video_init);
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index d1387cfe2d30..6cc93de0b71d 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -2,7 +2,6 @@
2 * adummy.c: a dummy ATM driver 2 * adummy.c: a dummy ATM driver
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/version.h> 6#include <linux/version.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
diff --git a/drivers/atm/ambassador.h b/drivers/atm/ambassador.h
index 84a93063cfe1..8296420ceaef 100644
--- a/drivers/atm/ambassador.h
+++ b/drivers/atm/ambassador.h
@@ -23,7 +23,6 @@
23#ifndef AMBASSADOR_H 23#ifndef AMBASSADOR_H
24#define AMBASSADOR_H 24#define AMBASSADOR_H
25 25
26#include <linux/config.h>
27 26
28#ifdef CONFIG_ATM_AMBASSADOR_DEBUG 27#ifdef CONFIG_ATM_AMBASSADOR_DEBUG
29#define DEBUG_AMBASSADOR 28#define DEBUG_AMBASSADOR
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index c13c4d736ef5..976ced1f019e 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -4,7 +4,6 @@
4 4
5 5
6#include <linux/module.h> 6#include <linux/module.h>
7#include <linux/config.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/mm.h> 8#include <linux/mm.h>
10#include <linux/pci.h> 9#include <linux/pci.h>
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 92923bf27233..9be9a4055199 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -25,7 +25,6 @@
25*/ 25*/
26 26
27 27
28#include <linux/config.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/init.h> 30#include <linux/init.h>
diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
index 2558eb853235..f9abfdac33e4 100644
--- a/drivers/atm/fore200e.h
+++ b/drivers/atm/fore200e.h
@@ -3,7 +3,6 @@
3#define _FORE200E_H 3#define _FORE200E_H
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6#include <linux/config.h>
7 6
8/* rx buffer sizes */ 7/* rx buffer sizes */
9 8
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index a486eb1f1640..a5cbd3d6e50f 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -55,7 +55,6 @@
55 55
56 */ 56 */
57 57
58#include <linux/config.h>
59#include <linux/module.h> 58#include <linux/module.h>
60#include <linux/kernel.h> 59#include <linux/kernel.h>
61#include <linux/skbuff.h> 60#include <linux/skbuff.h>
diff --git a/drivers/atm/horizon.h b/drivers/atm/horizon.h
index e2cc7020fa3b..4461229f56a5 100644
--- a/drivers/atm/horizon.h
+++ b/drivers/atm/horizon.h
@@ -30,7 +30,6 @@
30#ifndef DRIVER_ATM_HORIZON_H 30#ifndef DRIVER_ATM_HORIZON_H
31#define DRIVER_ATM_HORIZON_H 31#define DRIVER_ATM_HORIZON_H
32 32
33#include <linux/config.h>
34 33
35#ifdef CONFIG_ATM_HORIZON_DEBUG 34#ifdef CONFIG_ATM_HORIZON_DEBUG
36#define DEBUG_HORIZON 35#define DEBUG_HORIZON
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b4a76cade646..8fdb30116f99 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -34,7 +34,6 @@ static char const rcsid[] =
34 34
35 35
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/config.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
39#include <linux/skbuff.h> 38#include <linux/skbuff.h>
40#include <linux/kernel.h> 39#include <linux/kernel.h>
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h
index b8d0bd4d6c30..133eefcc0475 100644
--- a/drivers/atm/iphase.h
+++ b/drivers/atm/iphase.h
@@ -43,7 +43,6 @@
43#ifndef IPHASE_H 43#ifndef IPHASE_H
44#define IPHASE_H 44#define IPHASE_H
45 45
46#include <linux/config.h>
47 46
48/************************ IADBG DEFINE *********************************/ 47/************************ IADBG DEFINE *********************************/
49/* IADebugFlag Bit Map */ 48/* IADebugFlag Bit Map */
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 074abc81ec3d..b78612d3fa46 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -36,7 +36,6 @@
36/* Header files ***************************************************************/ 36/* Header files ***************************************************************/
37 37
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/config.h>
40#include <linux/kernel.h> 39#include <linux/kernel.h>
41#include <linux/skbuff.h> 40#include <linux/skbuff.h>
42#include <linux/atmdev.h> 41#include <linux/atmdev.h>
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index f484747f255e..1699c934bad0 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -3,7 +3,6 @@
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5 5
6#include <linux/config.h>
7#include <linux/module.h> 6#include <linux/module.h>
8#include <linux/sched.h> 7#include <linux/sched.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
diff --git a/drivers/atm/zatm.h b/drivers/atm/zatm.h
index 416fe0fda60c..ae9165ce15a0 100644
--- a/drivers/atm/zatm.h
+++ b/drivers/atm/zatm.h
@@ -6,7 +6,6 @@
6#ifndef DRIVER_ATM_ZATM_H 6#ifndef DRIVER_ATM_ZATM_H
7#define DRIVER_ATM_ZATM_H 7#define DRIVER_ATM_ZATM_H
8 8
9#include <linux/config.h>
10#include <linux/skbuff.h> 9#include <linux/skbuff.h>
11#include <linux/atm.h> 10#include <linux/atm.h>
12#include <linux/atmdev.h> 11#include <linux/atmdev.h>
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 050d86d0b872..83fa8b291a59 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/device.h> 11#include <linux/device.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 9aa127460262..de8908320f23 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/device.h> 13#include <linux/device.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 27c2176895de..b21f864c9ce8 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/device.h> 11#include <linux/device.h>
13#include <linux/err.h> 12#include <linux/err.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index b400314e1c62..562600dd540a 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/device.h> 11#include <linux/device.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 0d2e101e4f15..fdfa3d0cf6af 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -19,7 +19,6 @@
19 * ancestral dependencies that the subsystem list maintains. 19 * ancestral dependencies that the subsystem list maintains.
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/device.h> 22#include <linux/device.h>
24#include "power.h" 23#include "power.h"
25 24
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index 8826a5b6673e..3483ae4d57f5 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/device.h> 11#include <linux/device.h>
13#include <asm/semaphore.h> 12#include <asm/semaphore.h>
14 13
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 6858178b3aff..04e5db445c74 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -12,7 +12,6 @@
12 * add themselves as children of the system bus. 12 * add themselves as children of the system bus.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/sysdev.h> 15#include <linux/sysdev.h>
17#include <linux/err.h> 16#include <linux/err.h>
18#include <linux/module.h> 17#include <linux/module.h>
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index a317e4303952..0b80fbb8dbfd 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -43,7 +43,6 @@
43 * 43 *
44 */ 44 */
45 45
46#include <linux/config.h>
47#include <linux/module.h> 46#include <linux/module.h>
48#include <linux/errno.h> 47#include <linux/errno.h>
49#include <linux/signal.h> 48#include <linux/signal.h>
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 013c5daddb0b..7b3b94ddddcc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -50,7 +50,6 @@
50 * 50 *
51 */ 51 */
52 52
53#include <linux/config.h>
54#include <linux/module.h> 53#include <linux/module.h>
55#include <linux/moduleparam.h> 54#include <linux/moduleparam.h>
56#include <linux/sched.h> 55#include <linux/sched.h>
diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c
index ce94aa11f6a7..4b258f7836f3 100644
--- a/drivers/block/paride/paride.c
+++ b/drivers/block/paride/paride.c
@@ -21,7 +21,6 @@
21#define PI_VERSION "1.06" 21#define PI_VERSION "1.06"
22 22
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/config.h>
25#include <linux/kmod.h> 24#include <linux/kmod.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 3e4cce5e4736..bde2c64b6346 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -44,7 +44,6 @@
44 *************************************************************************/ 44 *************************************************************************/
45 45
46#include <linux/pktcdvd.h> 46#include <linux/pktcdvd.h>
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index a729013a3973..aef5a0ccabc9 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -29,7 +29,6 @@
29 29
30#define DEVICE_NAME "PS/2 ESDI" 30#define DEVICE_NAME "PS/2 ESDI"
31 31
32#include <linux/config.h>
33#include <linux/major.h> 32#include <linux/major.h>
34#include <linux/errno.h> 33#include <linux/errno.h>
35#include <linux/wait.h> 34#include <linux/wait.h>
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index a9e1c2524c2a..3cf246abb5ec 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -42,7 +42,6 @@
42 * and set blk_size for -ENOSPC, Werner Fink <werner@suse.de>, Apr '99 42 * and set blk_size for -ENOSPC, Werner Fink <werner@suse.de>, Apr '99
43 */ 43 */
44 44
45#include <linux/config.h>
46#include <linux/string.h> 45#include <linux/string.h>
47#include <linux/slab.h> 46#include <linux/slab.h>
48#include <asm/atomic.h> 47#include <asm/atomic.h>
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 628877945f9b..3721e12135d9 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -16,7 +16,6 @@
16 * handle GCR disks 16 * handle GCR disks
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/stddef.h> 19#include <linux/stddef.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/sched.h> 21#include <linux/sched.h>
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 585197b95af7..f675f97f2a78 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -35,7 +35,6 @@
35 */ 35 */
36 36
37//#define DEBUG /* uncomment if you want debugging info (pr_debug) */ 37//#define DEBUG /* uncomment if you want debugging info (pr_debug) */
38#include <linux/config.h>
39#include <linux/sched.h> 38#include <linux/sched.h>
40#include <linux/fs.h> 39#include <linux/fs.h>
41#include <linux/bio.h> 40#include <linux/bio.h>
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 3e7a067cc087..6f67141f4de0 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27 26
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 8947c8837dac..23f96213f4ac 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 473a13b22b29..2830f58d6f77 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -20,7 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/kernel.h> 25#include <linux/kernel.h>
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 9446960ac742..e0231dc2cb1a 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index b94ac2f9f7ba..c9dba5565cac 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 9ce4c93467e5..c889bf8109a1 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -20,7 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/kernel.h> 25#include <linux/kernel.h>
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index ed8dca84ff69..be6eed175aa3 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -20,7 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/kernel.h> 25#include <linux/kernel.h>
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 7bd4ef904115..d0cface535fb 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27 26
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 4804d474dc87..ad62abbbb739 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28 27
29#include <linux/kernel.h> 28#include <linux/kernel.h>
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 613673b12fa6..1994270c16e1 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28 27
29#include <linux/kernel.h> 28#include <linux/kernel.h>
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 92382e823285..a7d9d7e99e72 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -31,7 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36 35
37#include <linux/kernel.h> 36#include <linux/kernel.h>
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 85738223ff0c..ea589007fa26 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28 27
29#include <linux/kernel.h> 28#include <linux/kernel.h>
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 3170eaa25087..ca27ee89240b 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -263,7 +263,6 @@
263/* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */ 263/* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */
264/* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */ 264/* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */
265 265
266#include <linux/config.h>
267#include <linux/module.h> 266#include <linux/module.h>
268#include <linux/fs.h> 267#include <linux/fs.h>
269#include <linux/buffer_head.h> 268#include <linux/buffer_head.h>
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index 2fc966c65a0e..ba50e5a712f2 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -381,7 +381,6 @@
381#include <asm/io.h> 381#include <asm/io.h>
382#include <asm/uaccess.h> 382#include <asm/uaccess.h>
383#include <stdarg.h> 383#include <stdarg.h>
384#include <linux/config.h>
385#include "sbpcd.h" 384#include "sbpcd.h"
386 385
387#define MAJOR_NR MATSUSHITA_CDROM_MAJOR 386#define MAJOR_NR MATSUSHITA_CDROM_MAJOR
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index f74eeeb8e377..8cd52984cda5 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -8,7 +8,6 @@
8 * work is done in the northbridge(s). 8 * work is done in the northbridge(s).
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/pci.h> 12#include <linux/pci.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index a92ab53a1370..cc5ea347a8a7 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -27,7 +27,6 @@
27 * TODO: 27 * TODO:
28 * - Allocate more than order 0 pages to avoid too much linear map splitting. 28 * - Allocate more than order 0 pages to avoid too much linear map splitting.
29 */ 29 */
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/pci.h> 31#include <linux/pci.h>
33#include <linux/init.h> 32#include <linux/init.h>
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 6602b3156df5..3e7dc7cbd740 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -31,7 +31,6 @@
31 * ever possible. 31 * ever possible.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36 35
37#undef SERIAL_PARANOIA_CHECK 36#undef SERIAL_PARANOIA_CHECK
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c
index c85a4fa60da7..04a12027a740 100644
--- a/drivers/char/consolemap.c
+++ b/drivers/char/consolemap.c
@@ -11,7 +11,6 @@
11 * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998 11 * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kd.h> 15#include <linux/kd.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 2657eeba7da6..1f61a6744a26 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -633,7 +633,6 @@ static char rcsid[] =
633/* 633/*
634 * Include section 634 * Include section
635 */ 635 */
636#include <linux/config.h>
637#include <linux/module.h> 636#include <linux/module.h>
638#include <linux/errno.h> 637#include <linux/errno.h>
639#include <linux/signal.h> 638#include <linux/signal.h>
diff --git a/drivers/char/decserial.c b/drivers/char/decserial.c
index aa1440934e95..85f404e25c73 100644
--- a/drivers/char/decserial.c
+++ b/drivers/char/decserial.c
@@ -16,7 +16,6 @@
16 * console device I strongly recommend to use only one. 16 * console device I strongly recommend to use only one.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/init.h> 19#include <linux/init.h>
21#include <asm/dec/machtype.h> 20#include <asm/dec/machtype.h>
22 21
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 9da0ddb892b5..5642ac43e0f5 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -38,7 +38,6 @@
38 38
39#if defined(__linux__) 39#if defined(__linux__)
40#if defined(__KERNEL__) 40#if defined(__KERNEL__)
41#include <linux/config.h>
42#endif 41#endif
43#include <asm/ioctl.h> /* For _IO* macros */ 42#include <asm/ioctl.h> /* For _IO* macros */
44#define DRM_IOCTL_NR(n) _IOC_NR(n) 43#define DRM_IOCTL_NR(n) _IOC_NR(n)
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index cb76e5ca9a23..d2a56182bc35 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -44,7 +44,6 @@
44 * can build the DRM (part of PI DRI). 4/21/2000 S + B */ 44 * can build the DRM (part of PI DRI). 4/21/2000 S + B */
45#include <asm/current.h> 45#include <asm/current.h>
46#endif /* __alpha__ */ 46#endif /* __alpha__ */
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/kernel.h> 48#include <linux/kernel.h>
50#include <linux/miscdevice.h> 49#include <linux/miscdevice.h>
diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c
index 7e3318e1d1c6..5681cae1d404 100644
--- a/drivers/char/drm/drm_memory.c
+++ b/drivers/char/drm/drm_memory.c
@@ -33,7 +33,6 @@
33 * OTHER DEALINGS IN THE SOFTWARE. 33 * OTHER DEALINGS IN THE SOFTWARE.
34 */ 34 */
35 35
36#include <linux/config.h>
37#include <linux/highmem.h> 36#include <linux/highmem.h>
38#include "drmP.h" 37#include "drmP.h"
39 38
diff --git a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h
index 714d9aedcff5..f1b97aff10cf 100644
--- a/drivers/char/drm/drm_memory.h
+++ b/drivers/char/drm/drm_memory.h
@@ -33,7 +33,6 @@
33 * OTHER DEALINGS IN THE SOFTWARE. 33 * OTHER DEALINGS IN THE SOFTWARE.
34 */ 34 */
35 35
36#include <linux/config.h>
37#include <linux/highmem.h> 36#include <linux/highmem.h>
38#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
39#include "drmP.h" 38#include "drmP.h"
diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h
index d117cc997192..74581af806e1 100644
--- a/drivers/char/drm/drm_memory_debug.h
+++ b/drivers/char/drm/drm_memory_debug.h
@@ -31,7 +31,6 @@
31 * OTHER DEALINGS IN THE SOFTWARE. 31 * OTHER DEALINGS IN THE SOFTWARE.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include "drmP.h" 34#include "drmP.h"
36 35
37typedef struct drm_mem_stats { 36typedef struct drm_mem_stats {
diff --git a/drivers/char/drm/drm_scatter.c b/drivers/char/drm/drm_scatter.c
index ce81bf248200..06ef7ddbe67d 100644
--- a/drivers/char/drm/drm_scatter.c
+++ b/drivers/char/drm/drm_scatter.c
@@ -31,7 +31,6 @@
31 * DEALINGS IN THE SOFTWARE. 31 * DEALINGS IN THE SOFTWARE.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/vmalloc.h> 34#include <linux/vmalloc.h>
36#include "drmP.h" 35#include "drmP.h"
37 36
diff --git a/drivers/char/drm/drm_sysfs.c b/drivers/char/drm/drm_sysfs.c
index 0b9f98a7eb10..51ad98c685c3 100644
--- a/drivers/char/drm/drm_sysfs.c
+++ b/drivers/char/drm/drm_sysfs.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/device.h> 15#include <linux/device.h>
17#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
18#include <linux/err.h> 17#include <linux/err.h>
diff --git a/drivers/char/drm/ffb_drv.c b/drivers/char/drm/ffb_drv.c
index c13f9abb41e9..dd45111a4854 100644
--- a/drivers/char/drm/ffb_drv.c
+++ b/drivers/char/drm/ffb_drv.c
@@ -4,7 +4,6 @@
4 * Copyright (C) 2000 David S. Miller (davem@redhat.com) 4 * Copyright (C) 2000 David S. Miller (davem@redhat.com)
5 */ 5 */
6 6
7#include <linux/config.h>
8#include "ffb.h" 7#include "ffb.h"
9#include "drmP.h" 8#include "drmP.h"
10 9
diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c
index dfe6ad2b6a6e..fabb9a817966 100644
--- a/drivers/char/drm/i810_drv.c
+++ b/drivers/char/drm/i810_drv.c
@@ -30,7 +30,6 @@
30 * Gareth Hughes <gareth@valinux.com> 30 * Gareth Hughes <gareth@valinux.com>
31 */ 31 */
32 32
33#include <linux/config.h>
34#include "drmP.h" 33#include "drmP.h"
35#include "drm.h" 34#include "drm.h"
36#include "i810_drm.h" 35#include "i810_drm.h"
diff --git a/drivers/char/drm/i830_drv.c b/drivers/char/drm/i830_drv.c
index 722658188f5f..389597e4a623 100644
--- a/drivers/char/drm/i830_drv.c
+++ b/drivers/char/drm/i830_drv.c
@@ -32,7 +32,6 @@
32 * Keith Whitwell <keith@tungstengraphics.com> 32 * Keith Whitwell <keith@tungstengraphics.com>
33 */ 33 */
34 34
35#include <linux/config.h>
36#include "drmP.h" 35#include "drmP.h"
37#include "drm.h" 36#include "drm.h"
38#include "i830_drm.h" 37#include "i830_drm.h"
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
index 9f7ed0e0351b..e30f556b79f1 100644
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -29,7 +29,6 @@
29 * Gareth Hughes <gareth@valinux.com> 29 * Gareth Hughes <gareth@valinux.com>
30 */ 30 */
31 31
32#include <linux/config.h>
33#include "drmP.h" 32#include "drmP.h"
34#include "drm.h" 33#include "drm.h"
35#include "mga_drm.h" 34#include "mga_drm.h"
diff --git a/drivers/char/drm/r128_drv.c b/drivers/char/drm/r128_drv.c
index e20450ae220e..6108e7587e12 100644
--- a/drivers/char/drm/r128_drv.c
+++ b/drivers/char/drm/r128_drv.c
@@ -29,7 +29,6 @@
29 * Gareth Hughes <gareth@valinux.com> 29 * Gareth Hughes <gareth@valinux.com>
30 */ 30 */
31 31
32#include <linux/config.h>
33#include "drmP.h" 32#include "drmP.h"
34#include "drm.h" 33#include "drm.h"
35#include "r128_drm.h" 34#include "r128_drm.h"
diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c
index b04ed1b562b9..eb985c2a31e9 100644
--- a/drivers/char/drm/radeon_drv.c
+++ b/drivers/char/drm/radeon_drv.c
@@ -29,7 +29,6 @@
29 * OTHER DEALINGS IN THE SOFTWARE. 29 * OTHER DEALINGS IN THE SOFTWARE.
30 */ 30 */
31 31
32#include <linux/config.h>
33#include "drmP.h" 32#include "drmP.h"
34#include "drm.h" 33#include "drm.h"
35#include "radeon_drm.h" 34#include "radeon_drm.h"
diff --git a/drivers/char/drm/savage_drv.c b/drivers/char/drm/savage_drv.c
index aa6c0d1a82f8..eee52aa92a7c 100644
--- a/drivers/char/drm/savage_drv.c
+++ b/drivers/char/drm/savage_drv.c
@@ -23,7 +23,6 @@
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */ 24 */
25 25
26#include <linux/config.h>
27#include "drmP.h" 26#include "drmP.h"
28#include "savage_drm.h" 27#include "savage_drm.h"
29#include "savage_drv.h" 28#include "savage_drv.h"
diff --git a/drivers/char/drm/sis_drv.c b/drivers/char/drm/sis_drv.c
index 6f6d7d613ede..5e9dc86f2956 100644
--- a/drivers/char/drm/sis_drv.c
+++ b/drivers/char/drm/sis_drv.c
@@ -25,7 +25,6 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/config.h>
29#include "drmP.h" 28#include "drmP.h"
30#include "sis_drm.h" 29#include "sis_drm.h"
31#include "sis_drv.h" 30#include "sis_drv.h"
diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/char/drm/tdfx_drv.c
index baa4416032a8..012ff2e356b2 100644
--- a/drivers/char/drm/tdfx_drv.c
+++ b/drivers/char/drm/tdfx_drv.c
@@ -30,7 +30,6 @@
30 * Gareth Hughes <gareth@valinux.com> 30 * Gareth Hughes <gareth@valinux.com>
31 */ 31 */
32 32
33#include <linux/config.h>
34#include "drmP.h" 33#include "drmP.h"
35#include "tdfx_drv.h" 34#include "tdfx_drv.h"
36 35
diff --git a/drivers/char/drm/via_drv.c b/drivers/char/drm/via_drv.c
index 3f012255d315..b3d364d793d7 100644
--- a/drivers/char/drm/via_drv.c
+++ b/drivers/char/drm/via_drv.c
@@ -22,7 +22,6 @@
22 * DEALINGS IN THE SOFTWARE. 22 * DEALINGS IN THE SOFTWARE.
23 */ 23 */
24 24
25#include <linux/config.h>
26#include "drmP.h" 25#include "drmP.h"
27#include "via_drm.h" 26#include "via_drm.h"
28#include "via_drv.h" 27#include "via_drv.h"
diff --git a/drivers/char/ds1302.c b/drivers/char/ds1302.c
index a75e8609be01..625e8b517005 100644
--- a/drivers/char/ds1302.c
+++ b/drivers/char/ds1302.c
@@ -12,7 +12,6 @@
12*! 12*!
13*!***************************************************************************/ 13*!***************************************************************************/
14 14
15#include <linux/config.h>
16 15
17#include <linux/fs.h> 16#include <linux/fs.h>
18#include <linux/init.h> 17#include <linux/init.h>
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c
index 62cda25724e3..953e670dcd09 100644
--- a/drivers/char/ds1620.c
+++ b/drivers/char/ds1620.c
@@ -2,7 +2,6 @@
2 * linux/drivers/char/ds1620.c: Dallas Semiconductors DS1620 2 * linux/drivers/char/ds1620.c: Dallas Semiconductors DS1620
3 * thermometer driver (as used in the Rebel.com NetWinder) 3 * thermometer driver (as used in the Rebel.com NetWinder)
4 */ 4 */
5#include <linux/config.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/sched.h> 6#include <linux/sched.h>
8#include <linux/miscdevice.h> 7#include <linux/miscdevice.h>
diff --git a/drivers/char/ec3104_keyb.c b/drivers/char/ec3104_keyb.c
index 4aed66968821..abac18b1871c 100644
--- a/drivers/char/ec3104_keyb.c
+++ b/drivers/char/ec3104_keyb.c
@@ -26,7 +26,6 @@
26 * (prumpf@tux.org). 26 * (prumpf@tux.org).
27 */ 27 */
28 28
29#include <linux/config.h>
30 29
31#include <linux/spinlock.h> 30#include <linux/spinlock.h>
32#include <linux/sched.h> 31#include <linux/sched.h>
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index d0b3890d9302..86d290e9f307 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -30,7 +30,6 @@
30/* See README.epca for change history --DAT*/ 30/* See README.epca for change history --DAT*/
31 31
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/types.h> 35#include <linux/types.h>
diff --git a/drivers/char/ftape/lowlevel/ftape-calibr.c b/drivers/char/ftape/lowlevel/ftape-calibr.c
index 956b2586e138..8e50bfd35a52 100644
--- a/drivers/char/ftape/lowlevel/ftape-calibr.c
+++ b/drivers/char/ftape/lowlevel/ftape-calibr.c
@@ -24,7 +24,6 @@
24 * functions. 24 * functions.
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/jiffies.h> 28#include <linux/jiffies.h>
30#include <asm/system.h> 29#include <asm/system.h>
diff --git a/drivers/char/ftape/lowlevel/ftape-ctl.c b/drivers/char/ftape/lowlevel/ftape-ctl.c
index 32e043911790..5d7c1ce92d59 100644
--- a/drivers/char/ftape/lowlevel/ftape-ctl.c
+++ b/drivers/char/ftape/lowlevel/ftape-ctl.c
@@ -25,7 +25,6 @@
25 * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. 25 * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
30#include <linux/mm.h> 29#include <linux/mm.h>
31#include <linux/mman.h> 30#include <linux/mman.h>
diff --git a/drivers/char/ftape/lowlevel/ftape-init.c b/drivers/char/ftape/lowlevel/ftape-init.c
index b54260d457c2..4998132a81d1 100644
--- a/drivers/char/ftape/lowlevel/ftape-init.c
+++ b/drivers/char/ftape/lowlevel/ftape-init.c
@@ -21,7 +21,6 @@
21 * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. 21 * for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/fs.h> 26#include <linux/fs.h>
diff --git a/drivers/char/ftape/lowlevel/ftape-proc.c b/drivers/char/ftape/lowlevel/ftape-proc.c
index c66251e997ed..e805b15e0a12 100644
--- a/drivers/char/ftape/lowlevel/ftape-proc.c
+++ b/drivers/char/ftape/lowlevel/ftape-proc.c
@@ -26,7 +26,6 @@
26 * Old code removed, switched to dynamic proc entry. 26 * Old code removed, switched to dynamic proc entry.
27 */ 27 */
28 28
29#include <linux/config.h>
30 29
31#if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS) 30#if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS)
32 31
diff --git a/drivers/char/ftape/lowlevel/ftape-setup.c b/drivers/char/ftape/lowlevel/ftape-setup.c
index 280a1a55d87e..678340acd0b7 100644
--- a/drivers/char/ftape/lowlevel/ftape-setup.c
+++ b/drivers/char/ftape/lowlevel/ftape-setup.c
@@ -25,7 +25,6 @@
25 * "ftape" for Linux. 25 * "ftape" for Linux.
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/string.h> 28#include <linux/string.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/mm.h> 30#include <linux/mm.h>
diff --git a/drivers/char/ftape/lowlevel/ftape-tracing.h b/drivers/char/ftape/lowlevel/ftape-tracing.h
index fa7cd20ee66c..2950810c7085 100644
--- a/drivers/char/ftape/lowlevel/ftape-tracing.h
+++ b/drivers/char/ftape/lowlevel/ftape-tracing.h
@@ -28,7 +28,6 @@
28 * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. 28 * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33 32
34/* 33/*
diff --git a/drivers/char/ftape/lowlevel/ftape_syms.c b/drivers/char/ftape/lowlevel/ftape_syms.c
index 5dc3a380c9bf..8e0dc4a07ca6 100644
--- a/drivers/char/ftape/lowlevel/ftape_syms.c
+++ b/drivers/char/ftape/lowlevel/ftape_syms.c
@@ -25,7 +25,6 @@
25 * exports to its high level clients 25 * exports to its high level clients
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30 29
31#include <linux/ftape.h> 30#include <linux/ftape.h>
diff --git a/drivers/char/ftape/zftape/zftape-ctl.c b/drivers/char/ftape/zftape/zftape-ctl.c
index 6c7874e5c199..22ba0f5d00cf 100644
--- a/drivers/char/ftape/zftape/zftape-ctl.c
+++ b/drivers/char/ftape/zftape/zftape-ctl.c
@@ -24,7 +24,6 @@
24 * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. 24 * for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/module.h> 29#include <linux/module.h>
diff --git a/drivers/char/ftape/zftape/zftape-ctl.h b/drivers/char/ftape/zftape/zftape-ctl.h
index 414159891990..8e6f2d7ac74e 100644
--- a/drivers/char/ftape/zftape/zftape-ctl.h
+++ b/drivers/char/ftape/zftape/zftape-ctl.h
@@ -27,7 +27,6 @@
27 * for the QIC-40/80 floppy-tape driver for Linux. 27 * for the QIC-40/80 floppy-tape driver for Linux.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/ioctl.h> 30#include <linux/ioctl.h>
32#include <linux/mtio.h> 31#include <linux/mtio.h>
33 32
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index 3eeb869a9a11..55272566b740 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -20,7 +20,6 @@
20 * to the ftape floppy tape driver for Linux 20 * to the ftape floppy tape driver for Linux
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/fs.h> 25#include <linux/fs.h>
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index 588fca542a98..bebd7e34f792 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -43,7 +43,6 @@
43#define RTC_VERSION "1.07" 43#define RTC_VERSION "1.07"
44 44
45#include <linux/module.h> 45#include <linux/module.h>
46#include <linux/config.h>
47#include <linux/errno.h> 46#include <linux/errno.h>
48#include <linux/miscdevice.h> 47#include <linux/miscdevice.h>
49#include <linux/fcntl.h> 48#include <linux/fcntl.h>
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 07473cd84121..8b6c76f8ef0e 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/interrupt.h> 14#include <linux/interrupt.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 6e380aecea6a..859e5005c785 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -22,7 +22,6 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/console.h> 25#include <linux/console.h>
27#include <linux/cpumask.h> 26#include <linux/cpumask.h>
28#include <linux/init.h> 27#include <linux/init.h>
diff --git a/drivers/char/ip2/i2ellis.h b/drivers/char/ip2/i2ellis.h
index 510b026d7d26..5eabe47b0bc8 100644
--- a/drivers/char/ip2/i2ellis.h
+++ b/drivers/char/ip2/i2ellis.h
@@ -47,7 +47,6 @@
47//---------------------- 47//----------------------
48// Mandatory Includes: 48// Mandatory Includes:
49//---------------------- 49//----------------------
50#include <linux/config.h>
51#include "ip2types.h" 50#include "ip2types.h"
52#include "i2hw.h" // The hardware definitions 51#include "i2hw.h" // The hardware definitions
53 52
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 8619542766cb..f9aa53c76f99 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -82,7 +82,6 @@
82/************/ 82/************/
83/* Includes */ 83/* Includes */
84/************/ 84/************/
85#include <linux/config.h>
86 85
87#include <linux/ctype.h> 86#include <linux/ctype.h>
88#include <linux/string.h> 87#include <linux/string.h>
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index da637adbbfaa..2fc894fef1cb 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -31,7 +31,6 @@
31 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37#include <linux/errno.h> 36#include <linux/errno.h>
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index ad26f4b997c5..0aa5d608fe6f 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -31,7 +31,6 @@
31 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/errno.h> 35#include <linux/errno.h>
37#include <asm/system.h> 36#include <asm/system.h>
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
index d0b5c08e7b4e..8d941db83457 100644
--- a/drivers/char/ipmi/ipmi_poweroff.c
+++ b/drivers/char/ipmi/ipmi_poweroff.c
@@ -31,7 +31,6 @@
31 * with this program; if not, write to the Free Software Foundation, Inc., 31 * with this program; if not, write to the Free Software Foundation, Inc.,
32 * 675 Mass Ave, Cambridge, MA 02139, USA. 32 * 675 Mass Ave, Cambridge, MA 02139, USA.
33 */ 33 */
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37#include <linux/proc_fs.h> 36#include <linux/proc_fs.h>
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index bd4f2248b758..c7f3e5c80666 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -38,7 +38,6 @@
38 * and drives the real SMI state machine. 38 * and drives the real SMI state machine.
39 */ 39 */
40 40
41#include <linux/config.h>
42#include <linux/module.h> 41#include <linux/module.h>
43#include <linux/moduleparam.h> 42#include <linux/moduleparam.h>
44#include <asm/system.h> 43#include <asm/system.h>
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 1a0a19c53605..74a889c58333 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -31,7 +31,6 @@
31 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37#include <linux/ipmi.h> 36#include <linux/ipmi.h>
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 478bf4d7d065..c105b9540ad8 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -245,7 +245,7 @@ static int lock_card(struct isi_board *card)
245 printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", 245 printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n",
246 card->base); 246 card->base);
247 247
248 return 0; /* Failed to aquire the card! */ 248 return 0; /* Failed to acquire the card! */
249} 249}
250 250
251static int lock_card_at_interrupt(struct isi_board *card) 251static int lock_card_at_interrupt(struct isi_board *card)
@@ -262,7 +262,7 @@ static int lock_card_at_interrupt(struct isi_board *card)
262 spin_unlock_irqrestore(&card->card_lock, card->flags); 262 spin_unlock_irqrestore(&card->card_lock, card->flags);
263 } 263 }
264 /* Failing in interrupt is an acceptable event */ 264 /* Failing in interrupt is an acceptable event */
265 return 0; /* Failed to aquire the card! */ 265 return 0; /* Failed to acquire the card! */
266} 266}
267 267
268static void unlock_card(struct isi_board *card) 268static void unlock_card(struct isi_board *card)
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 18c0dcf894cd..fbce2f0669d6 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -26,7 +26,6 @@
26 26
27/*****************************************************************************/ 27/*****************************************************************************/
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 4bb3d2272604..056ebe84b81d 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -24,7 +24,6 @@
24 * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik) 24 * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik)
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/sched.h> 28#include <linux/sched.h>
30#include <linux/tty.h> 29#include <linux/tty.h>
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c
index 29963d8be667..7d49b241de56 100644
--- a/drivers/char/lcd.c
+++ b/drivers/char/lcd.c
@@ -14,7 +14,6 @@
14 14
15#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ 15#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */
16 16
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index b11a390581ba..582cdbdb0c42 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -114,7 +114,6 @@
114#include <linux/module.h> 114#include <linux/module.h>
115#include <linux/init.h> 115#include <linux/init.h>
116 116
117#include <linux/config.h>
118#include <linux/errno.h> 117#include <linux/errno.h>
119#include <linux/kernel.h> 118#include <linux/kernel.h>
120#include <linux/major.h> 119#include <linux/major.h>
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index c268ee04b2aa..bb07c2766b27 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -10,7 +10,6 @@
10 * MOATB Core Services driver. 10 * MOATB Core Services driver.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 6fe7b6c6c462..70f3954d6dfd 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -8,7 +8,6 @@
8 * Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> 8 * Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/mm.h> 11#include <linux/mm.h>
13#include <linux/miscdevice.h> 12#include <linux/miscdevice.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index dfe1cede3916..d5fa19da330b 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -34,7 +34,6 @@
34 */ 34 */
35 35
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/config.h>
38 37
39#include <linux/fs.h> 38#include <linux/fs.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 52ef61f54ba0..4ea7bd5f4f56 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -29,7 +29,6 @@
29 * version : 5.1 29 * version : 5.1
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/types.h> 33#include <linux/types.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
diff --git a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c
index d1fe05e83882..4e4865e90e50 100644
--- a/drivers/char/mwave/3780i.c
+++ b/drivers/char/mwave/3780i.c
@@ -46,7 +46,6 @@
46* First release to the public 46* First release to the public
47*/ 47*/
48 48
49#include <linux/config.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
51#include <linux/unistd.h> 50#include <linux/unistd.h>
52#include <linux/delay.h> 51#include <linux/delay.h>
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 72cfd09091e0..eb1559fcb81a 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -36,7 +36,6 @@
36 */ 36 */
37 37
38 38
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/autoconf.h> 40#include <linux/autoconf.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 9f54733f1623..337a87f86a3b 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -81,7 +81,6 @@
81#define HDLC_MAGIC 0x239e 81#define HDLC_MAGIC 0x239e
82#define HDLC_VERSION "$Revision: 4.8 $" 82#define HDLC_VERSION "$Revision: 4.8 $"
83 83
84#include <linux/config.h>
85#include <linux/module.h> 84#include <linux/module.h>
86#include <linux/init.h> 85#include <linux/init.h>
87#include <linux/kernel.h> 86#include <linux/kernel.h>
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 3556ccd77570..8c5f102622b6 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -37,7 +37,6 @@
37#define NVRAM_VERSION "1.2" 37#define NVRAM_VERSION "1.2"
38 38
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/config.h>
41#include <linux/sched.h> 40#include <linux/sched.h>
42#include <linux/smp_lock.h> 41#include <linux/smp_lock.h>
43#include <linux/nvram.h> 42#include <linux/nvram.h>
diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
index 4083b781adbf..94845dd12ca9 100644
--- a/drivers/char/nwbutton.c
+++ b/drivers/char/nwbutton.c
@@ -4,7 +4,6 @@
4 * 4 *
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index eab5394da666..31c8a21f9d87 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -149,12 +149,7 @@ struct cm4000_dev {
149#define ZERO_DEV(dev) \ 149#define ZERO_DEV(dev) \
150 memset(&dev->atr_csum,0, \ 150 memset(&dev->atr_csum,0, \
151 sizeof(struct cm4000_dev) - \ 151 sizeof(struct cm4000_dev) - \
152 /*link*/ sizeof(struct pcmcia_device *) - \ 152 offsetof(struct cm4000_dev, atr_csum))
153 /*node*/ sizeof(dev_node_t) - \
154 /*atr*/ MAX_ATR*sizeof(char) - \
155 /*rbuf*/ 512*sizeof(char) - \
156 /*sbuf*/ 512*sizeof(char) - \
157 /*queue*/ 4*sizeof(wait_queue_head_t))
158 153
159static struct pcmcia_device *dev_table[CM4000_MAX_DEV]; 154static struct pcmcia_device *dev_table[CM4000_MAX_DEV];
160static struct class *cmm_class; 155static struct class *cmm_class;
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 9491e4307566..34dd4c38110e 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> /* For EXPORT_SYMBOL */ 14#include <linux/module.h> /* For EXPORT_SYMBOL */
16 15
17#include <linux/errno.h> 16#include <linux/errno.h>
diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c
index 601d09baf9d7..1087530e5854 100644
--- a/drivers/char/qtronix.c
+++ b/drivers/char/qtronix.c
@@ -33,7 +33,6 @@
33 * 675 Mass Ave, Cambridge, MA 02139, USA. 33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */ 34 */
35 35
36#include <linux/config.h>
37 36
38/* 37/*
39 * NOTE: 38 * NOTE:
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 58f3512c52e1..164bddae047f 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -224,7 +224,6 @@
224 */ 224 */
225 225
226#include <linux/utsname.h> 226#include <linux/utsname.h>
227#include <linux/config.h>
228#include <linux/module.h> 227#include <linux/module.h>
229#include <linux/kernel.h> 228#include <linux/kernel.h>
230#include <linux/major.h> 229#include <linux/major.h>
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index aa43436d5d1b..5332d1d4b0e4 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -33,7 +33,6 @@
33 * */ 33 * */
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/config.h>
37#include <linux/kdev_t.h> 36#include <linux/kdev_t.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
diff --git a/drivers/char/rio/rio_linux.h b/drivers/char/rio/rio_linux.h
index 55b9c97e8477..dc3f005614a3 100644
--- a/drivers/char/rio/rio_linux.h
+++ b/drivers/char/rio/rio_linux.h
@@ -23,7 +23,6 @@
23 * Version 1.0 -- July, 1999. 23 * Version 1.0 -- July, 1999.
24 * 24 *
25 */ 25 */
26#include <linux/config.h>
27 26
28#define RIO_NBOARDS 4 27#define RIO_NBOARDS 4
29#define RIO_PORTSPERBOARD 128 28#define RIO_PORTSPERBOARD 128
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c
index 12e34bc3f7ce..99f3df02b61c 100644
--- a/drivers/char/rio/rioinit.c
+++ b/drivers/char/rio/rioinit.c
@@ -33,7 +33,6 @@
33static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; 33static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
34#endif 34#endif
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
39#include <linux/errno.h> 38#include <linux/errno.h>
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 0897b0c8d528..37dc2edd8d75 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -61,7 +61,6 @@
61 * this driver.) 61 * this driver.)
62 */ 62 */
63 63
64#include <linux/config.h>
65#include <linux/interrupt.h> 64#include <linux/interrupt.h>
66#include <linux/module.h> 65#include <linux/module.h>
67#include <linux/kernel.h> 66#include <linux/kernel.h>
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index c851eeaa4069..21a710cb4bba 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -44,7 +44,6 @@
44 * - replace bottom half handler with task queue handler 44 * - replace bottom half handler with task queue handler
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/errno.h> 47#include <linux/errno.h>
49#include <linux/signal.h> 48#include <linux/signal.h>
50#include <linux/sched.h> 49#include <linux/sched.h>
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 43dfd8689dce..e19d4856e9fc 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -33,7 +33,6 @@
33 * 33 *
34 */ 34 */
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/input.h> 37#include <linux/input.h>
39#include <linux/pci.h> 38#include <linux/pci.h>
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index d2d6b01dcd05..d4243fb80815 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -75,7 +75,6 @@
75 * Documentation/specialix.txt 75 * Documentation/specialix.txt
76 */ 76 */
77 77
78#include <linux/config.h>
79#include <linux/module.h> 78#include <linux/module.h>
80 79
81#include <asm/io.h> 80#include <asm/io.h>
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 0f7a542d9041..f15df0e423e0 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -26,7 +26,6 @@
26 26
27/*****************************************************************************/ 27/*****************************************************************************/
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 4e35d4181224..03edccc8a823 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -46,7 +46,6 @@
46//#define DBGRBUF(info) dump_rbufs(info) 46//#define DBGRBUF(info) dump_rbufs(info)
47 47
48 48
49#include <linux/config.h>
50#include <linux/module.h> 49#include <linux/module.h>
51#include <linux/version.h> 50#include <linux/version.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 21bf15ad9980..ba54df3cf60a 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -34,7 +34,6 @@
34 34
35#define MAX_DEVICES 12 35#define MAX_DEVICES 12
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/errno.h> 38#include <linux/errno.h>
40#include <linux/signal.h> 39#include <linux/signal.h>
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 35082dc12eae..a064ee9181c0 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -12,7 +12,6 @@
12 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies 12 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
18#include <linux/mm.h> 17#include <linux/mm.h>
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index f7802e5bd7ca..e0633a119d29 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -42,7 +42,6 @@
42 */ 42 */
43#undef DEBUG /* change to #define to get debugging 43#undef DEBUG /* change to #define to get debugging
44 * output - for pr_debug() */ 44 * output - for pr_debug() */
45#include <linux/config.h>
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/types.h> 46#include <linux/types.h>
48#include <linux/errno.h> 47#include <linux/errno.h>
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index ef68d152d3e4..dfc4437afefb 100644
--- a/drivers/char/tlclk.c
+++ b/drivers/char/tlclk.c
@@ -27,7 +27,6 @@
27 * MPCBL0010 ATCA computer. 27 * MPCBL0010 ATCA computer.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/init.h> 31#include <linux/init.h>
33#include <linux/sched.h> 32#include <linux/sched.h>
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index a1143238feca..615e934da05f 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -65,7 +65,6 @@
65 * alloc_tty_struct() always uses kmalloc() -- Andrew Morton <andrewm@uow.edu.eu> 17Mar01 65 * alloc_tty_struct() always uses kmalloc() -- Andrew Morton <andrewm@uow.edu.eu> 17Mar01
66 */ 66 */
67 67
68#include <linux/config.h>
69#include <linux/types.h> 68#include <linux/types.h>
70#include <linux/major.h> 69#include <linux/major.h>
71#include <linux/errno.h> 70#include <linux/errno.h>
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 234d7f3fb114..45e9bd81bc0e 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -21,7 +21,6 @@
21 * - making it shorter - scr_readw are macros which expand in PRETTY long code 21 * - making it shorter - scr_readw are macros which expand in PRETTY long code
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/major.h> 25#include <linux/major.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c
index 07f5ce4b28e3..766f7864c6c6 100644
--- a/drivers/char/viocons.c
+++ b/drivers/char/viocons.c
@@ -25,7 +25,6 @@
25 * along with this program; if not, write to the Free Software Foundation, 25 * along with this program; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */ 27 */
28#include <linux/config.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
31#include <linux/errno.h> 30#include <linux/errno.h>
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index 198f1505ae23..7d42c8ec8dbc 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -31,7 +31,6 @@
31 * the OS/400 partition. The format of the messages is defined in 31 * the OS/400 partition. The format of the messages is defined in
32 * iseries/vio.h 32 * iseries/vio.h
33 */ 33 */
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/errno.h> 36#include <linux/errno.h>
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index fe99fc1aba45..b17a6e2bbca8 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/config.h>
18#include <linux/kdev_t.h> 17#include <linux/kdev_t.h>
19#include <asm/io.h> 18#include <asm/io.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d6f65032649a..3ef823d7d255 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -86,7 +86,6 @@
86#include <linux/consolemap.h> 86#include <linux/consolemap.h>
87#include <linux/timer.h> 87#include <linux/timer.h>
88#include <linux/interrupt.h> 88#include <linux/interrupt.h>
89#include <linux/config.h>
90#include <linux/workqueue.h> 89#include <linux/workqueue.h>
91#include <linux/bootmem.h> 90#include <linux/bootmem.h>
92#include <linux/pm.h> 91#include <linux/pm.h>
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 24011e7c81ff..eccffaf26faa 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -10,7 +10,6 @@
10 * Check put/get_user, cleanups - acme@conectiva.com.br - Jun 2001 10 * Check put/get_user, cleanups - acme@conectiva.com.br - Jun 2001
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
diff --git a/drivers/char/watchdog/at91_wdt.c b/drivers/char/watchdog/at91_wdt.c
index 00080655533d..f61dedc3c96c 100644
--- a/drivers/char/watchdog/at91_wdt.c
+++ b/drivers/char/watchdog/at91_wdt.c
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
14#include <linux/fs.h> 13#include <linux/fs.h>
15#include <linux/init.h> 14#include <linux/init.h>
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c
index b6640606b44d..537f5c6729bf 100644
--- a/drivers/char/watchdog/booke_wdt.c
+++ b/drivers/char/watchdog/booke_wdt.c
@@ -14,7 +14,6 @@
14 * option) any later version. 14 * option) any later version.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/fs.h> 18#include <linux/fs.h>
20#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
index 25c2f2575611..e89cda010b49 100644
--- a/drivers/char/watchdog/eurotechwdt.c
+++ b/drivers/char/watchdog/eurotechwdt.c
@@ -40,7 +40,6 @@
40 * Added Matt Domsch's nowayout module option. 40 * Added Matt Domsch's nowayout module option.
41 */ 41 */
42 42
43#include <linux/config.h>
44#include <linux/interrupt.h> 43#include <linux/interrupt.h>
45#include <linux/module.h> 44#include <linux/module.h>
46#include <linux/moduleparam.h> 45#include <linux/moduleparam.h>
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
index cf60329eec85..a2e53c715b36 100644
--- a/drivers/char/watchdog/ib700wdt.c
+++ b/drivers/char/watchdog/ib700wdt.c
@@ -31,7 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/types.h> 35#include <linux/types.h>
37#include <linux/miscdevice.h> 36#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/ibmasr.c b/drivers/char/watchdog/ibmasr.c
index 294c474ae485..b0741cbdc139 100644
--- a/drivers/char/watchdog/ibmasr.c
+++ b/drivers/char/watchdog/ibmasr.c
@@ -10,7 +10,6 @@
10 * of the GNU Public License, incorporated herein by reference. 10 * of the GNU Public License, incorporated herein by reference.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/fs.h> 13#include <linux/fs.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
index b4b94daba67e..d387979b2434 100644
--- a/drivers/char/watchdog/indydog.c
+++ b/drivers/char/watchdog/indydog.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/fs.h> 18#include <linux/fs.h>
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index 0cfb9b9c4a4b..aa29a7d68759 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -16,7 +16,6 @@
16 * warranty of any kind, whether express or implied. 16 * warranty of any kind, whether express or implied.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/moduleparam.h> 20#include <linux/moduleparam.h>
22#include <linux/types.h> 21#include <linux/types.h>
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
index 3800835ca8f3..e6a3fe83fa01 100644
--- a/drivers/char/watchdog/ixp4xx_wdt.c
+++ b/drivers/char/watchdog/ixp4xx_wdt.c
@@ -13,7 +13,6 @@
13 * warranty of any kind, whether express or implied. 13 * warranty of any kind, whether express or implied.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
19#include <linux/types.h> 18#include <linux/types.h>
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index a9a20aad61e7..b67b4878ae0f 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -28,7 +28,6 @@
28 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT 28 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
34#include <linux/types.h> 33#include <linux/types.h>
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
index d8dede575402..433c27f98159 100644
--- a/drivers/char/watchdog/mixcomwd.c
+++ b/drivers/char/watchdog/mixcomwd.c
@@ -37,7 +37,6 @@
37 37
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/moduleparam.h> 39#include <linux/moduleparam.h>
40#include <linux/config.h>
41#include <linux/types.h> 40#include <linux/types.h>
42#include <linux/miscdevice.h> 41#include <linux/miscdevice.h>
43#include <linux/ioport.h> 42#include <linux/ioport.h>
diff --git a/drivers/char/watchdog/mpc83xx_wdt.c b/drivers/char/watchdog/mpc83xx_wdt.c
index 5d6f5061603a..dac1381af364 100644
--- a/drivers/char/watchdog/mpc83xx_wdt.c
+++ b/drivers/char/watchdog/mpc83xx_wdt.c
@@ -15,7 +15,6 @@
15 * option) any later version. 15 * option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/fs.h> 18#include <linux/fs.h>
20#include <linux/init.h> 19#include <linux/init.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
diff --git a/drivers/char/watchdog/mpc8xx_wdt.c b/drivers/char/watchdog/mpc8xx_wdt.c
index b2fc71e20850..11f0ccd4c4d4 100644
--- a/drivers/char/watchdog/mpc8xx_wdt.c
+++ b/drivers/char/watchdog/mpc8xx_wdt.c
@@ -9,7 +9,6 @@
9 * or implied. 9 * or implied.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c
index 2c2c51773200..9c11d920add5 100644
--- a/drivers/char/watchdog/mpcore_wdt.c
+++ b/drivers/char/watchdog/mpcore_wdt.c
@@ -21,7 +21,6 @@
21 */ 21 */
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/moduleparam.h> 23#include <linux/moduleparam.h>
24#include <linux/config.h>
25#include <linux/types.h> 24#include <linux/types.h>
26#include <linux/miscdevice.h> 25#include <linux/miscdevice.h>
27#include <linux/watchdog.h> 26#include <linux/watchdog.h>
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index f1b9cf89f153..20a6cbb0fbb8 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -15,7 +15,6 @@
15 * or implied. 15 * or implied.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/fs.h> 18#include <linux/fs.h>
20#include <linux/init.h> 19#include <linux/init.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index 0d072bed501d..92bf8c1a0f0d 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -24,7 +24,6 @@
24 * http://www.berkprod.com/ or http://www.pcwatchdog.com/ 24 * http://www.berkprod.com/ or http://www.pcwatchdog.com/
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
30#include <linux/init.h> 29#include <linux/init.h>
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 1ea04e9b2b0b..f267dad26071 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -37,7 +37,6 @@
37 37
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/moduleparam.h> 39#include <linux/moduleparam.h>
40#include <linux/config.h>
41#include <linux/types.h> 40#include <linux/types.h>
42#include <linux/timer.h> 41#include <linux/timer.h>
43#include <linux/miscdevice.h> 42#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
index 522a9370db94..b22e95c5470c 100644
--- a/drivers/char/watchdog/sa1100_wdt.c
+++ b/drivers/char/watchdog/sa1100_wdt.c
@@ -17,7 +17,6 @@
17 * 17 *
18 * 27/11/2000 Initial release 18 * 27/11/2000 Initial release
19 */ 19 */
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
23#include <linux/types.h> 22#include <linux/types.h>
diff --git a/drivers/char/watchdog/sbc8360.c b/drivers/char/watchdog/sbc8360.c
index c6cbf808d8c2..6562aa910ace 100644
--- a/drivers/char/watchdog/sbc8360.c
+++ b/drivers/char/watchdog/sbc8360.c
@@ -36,7 +36,6 @@
36 * 36 *
37 */ 37 */
38 38
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/types.h> 40#include <linux/types.h>
42#include <linux/miscdevice.h> 41#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/sbc_epx_c3.c b/drivers/char/watchdog/sbc_epx_c3.c
index 837b1ec3ffe3..09867fadc720 100644
--- a/drivers/char/watchdog/sbc_epx_c3.c
+++ b/drivers/char/watchdog/sbc_epx_c3.c
@@ -15,7 +15,6 @@
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/fs.h> 20#include <linux/fs.h>
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
index 20b88f9b7be2..78ef6333c181 100644
--- a/drivers/char/watchdog/sc1200wdt.c
+++ b/drivers/char/watchdog/sc1200wdt.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
33#include <linux/miscdevice.h> 32#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
index b4a102a2d7e3..c0b4754e8de0 100644
--- a/drivers/char/watchdog/scx200_wdt.c
+++ b/drivers/char/watchdog/scx200_wdt.c
@@ -17,7 +17,6 @@
17 of any nature resulting due to the use of this software. This 17 of any nature resulting due to the use of this software. This
18 software is provided AS-IS with no warranties. */ 18 software is provided AS-IS with no warranties. */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
23#include <linux/init.h> 22#include <linux/init.h>
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
index 1f4cab55b2ef..803701b675c0 100644
--- a/drivers/char/watchdog/shwdt.c
+++ b/drivers/char/watchdog/shwdt.c
@@ -17,7 +17,6 @@
17 * Added expect close support, made emulated timeout runtime changeable 17 * Added expect close support, made emulated timeout runtime changeable
18 * general cleanups, add some ioctls 18 * general cleanups, add some ioctls
19 */ 19 */
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
23#include <linux/init.h> 22#include <linux/init.h>
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
index a91edaf3a350..79ce5c655428 100644
--- a/drivers/char/watchdog/softdog.c
+++ b/drivers/char/watchdog/softdog.c
@@ -38,7 +38,6 @@
38 38
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/moduleparam.h> 40#include <linux/moduleparam.h>
41#include <linux/config.h>
42#include <linux/types.h> 41#include <linux/types.h>
43#include <linux/timer.h> 42#include <linux/timer.h>
44#include <linux/miscdevice.h> 43#include <linux/miscdevice.h>
diff --git a/drivers/char/watchdog/w83977f_wdt.c b/drivers/char/watchdog/w83977f_wdt.c
index a7ff64c8921f..c31849e4c5c2 100644
--- a/drivers/char/watchdog/w83977f_wdt.c
+++ b/drivers/char/watchdog/w83977f_wdt.c
@@ -17,7 +17,6 @@
17 17
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/moduleparam.h> 19#include <linux/moduleparam.h>
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/fs.h> 22#include <linux/fs.h>
diff --git a/drivers/char/watchdog/wd501p.h b/drivers/char/watchdog/wd501p.h
index 84e60eb74337..a4504f40394d 100644
--- a/drivers/char/watchdog/wd501p.h
+++ b/drivers/char/watchdog/wd501p.h
@@ -19,7 +19,6 @@
19 * 19 *
20 */ 20 */
21 21
22#include <linux/config.h>
23 22
24#define WDT_COUNT0 (io+0) 23#define WDT_COUNT0 (io+0)
25#define WDT_COUNT1 (io+1) 24#define WDT_COUNT1 (io+1)
diff --git a/drivers/char/watchdog/wdrtas.c b/drivers/char/watchdog/wdrtas.c
index dacfe31caccf..3a462c34b92a 100644
--- a/drivers/char/watchdog/wdrtas.c
+++ b/drivers/char/watchdog/wdrtas.c
@@ -26,7 +26,6 @@
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/fs.h> 29#include <linux/fs.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
index ec7e401228ee..2586e9e858e2 100644
--- a/drivers/char/watchdog/wdt.c
+++ b/drivers/char/watchdog/wdt.c
@@ -31,7 +31,6 @@
31 * Matt Domsch : Added nowayout module option 31 * Matt Domsch : Added nowayout module option
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/interrupt.h> 34#include <linux/interrupt.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/moduleparam.h> 36#include <linux/moduleparam.h>
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
index 3843900e94c4..3cde2b9bb763 100644
--- a/drivers/char/watchdog/wdt977.c
+++ b/drivers/char/watchdog/wdt977.c
@@ -24,7 +24,6 @@
24 24
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
27#include <linux/config.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/fs.h> 29#include <linux/fs.h>
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
index 4b3311993d48..c79cc9543d96 100644
--- a/drivers/char/watchdog/wdt_pci.c
+++ b/drivers/char/watchdog/wdt_pci.c
@@ -35,7 +35,6 @@
35 * Matt Domsch : nowayout module option 35 * Matt Domsch : nowayout module option
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/interrupt.h> 38#include <linux/interrupt.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/moduleparam.h> 40#include <linux/moduleparam.h>
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 35e0b9ceecf7..1ba4039777e8 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -15,7 +15,6 @@
15 * 15 *
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/init.h> 20#include <linux/init.h>
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 145061b8472a..25eee5394201 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -9,7 +9,6 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/sysdev.h> 13#include <linux/sysdev.h>
15#include <linux/cpu.h> 14#include <linux/cpu.h>
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 071ee4f1bbf2..44ae5e5b94cf 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/smp.h> 16#include <linux/smp.h>
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index 702141c5501b..d75864e35fef 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/pci.h> 17#include <linux/pci.h>
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 5351a76739e5..815c3eb783de 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index 9878379b4993..5a5ecd5a0409 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/pci.h> 27#include <linux/pci.h>
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 357c95f30fc6..3a7cfe88b169 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h
index 342979677d2f..1be4947e28af 100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
@@ -18,7 +18,6 @@
18#ifndef _EDAC_MC_H_ 18#ifndef _EDAC_MC_H_
19#define _EDAC_MC_H_ 19#define _EDAC_MC_H_
20 20
21#include <linux/config.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/module.h> 23#include <linux/module.h>
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index d196dcc850a8..e30a4a2eaf38 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -9,7 +9,6 @@
9 * by Thayne Harbaugh of Linux Networx. (http://lnxi.com) 9 * by Thayne Harbaugh of Linux Networx. (http://lnxi.com)
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/pci.h> 14#include <linux/pci.h>
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 6787403463a1..9423ee5e7edd 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -13,7 +13,6 @@
13 * Note: E7210 appears same as D82875P - zhenyu.z.wang at intel.com 13 * Note: E7210 appears same as D82875P - zhenyu.z.wang at intel.com
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/pci.h> 18#include <linux/pci.h>
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index fecdb2c9ee28..a0e248d11ed9 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -15,7 +15,6 @@
15 * references to this document given in [] 15 * references to this document given in []
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/init.h> 19#include <linux/init.h>
21#include <linux/pci.h> 20#include <linux/pci.h>
diff --git a/drivers/eisa/virtual_root.c b/drivers/eisa/virtual_root.c
index 0f97a0cb0ff4..9b4fcac03ad5 100644
--- a/drivers/eisa/virtual_root.c
+++ b/drivers/eisa/virtual_root.c
@@ -7,7 +7,6 @@
7 * This code is released under the GPL version 2. 7 * This code is released under the GPL version 2.
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12#include <linux/platform_device.h> 11#include <linux/platform_device.h>
13#include <linux/eisa.h> 12#include <linux/eisa.h>
diff --git a/drivers/fc4/fc_syms.c b/drivers/fc4/fc_syms.c
index ed85dfcef69a..8700a8076d04 100644
--- a/drivers/fc4/fc_syms.c
+++ b/drivers/fc4/fc_syms.c
@@ -2,7 +2,6 @@
2 * We should not even be trying to compile this if we are not doing 2 * We should not even be trying to compile this if we are not doing
3 * a module. 3 * a module.
4 */ 4 */
5#include <linux/config.h>
6#include <linux/module.h> 5#include <linux/module.h>
7 6
8#ifdef CONFIG_MODULES 7#ifdef CONFIG_MODULES
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index fdb8b042e64d..23b086685453 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -34,7 +34,6 @@
34 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 34 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 * GNU General Public License for more details. 35 * GNU General Public License for more details.
36 */ 36 */
37#include <linux/config.h>
38#include <linux/init.h> 37#include <linux/init.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/string.h> 39#include <linux/string.h>
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 9b7e4d52ffd4..8ebce1c03ad7 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -66,7 +66,6 @@
66 */ 66 */
67 67
68#include <linux/capability.h> 68#include <linux/capability.h>
69#include <linux/config.h>
70#include <linux/types.h> 69#include <linux/types.h>
71#include <linux/errno.h> 70#include <linux/errno.h>
72#include <linux/init.h> 71#include <linux/init.h>
diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c
index c37baf9448bc..c2ad72fefd9d 100644
--- a/drivers/firmware/pcdp.c
+++ b/drivers/firmware/pcdp.c
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/acpi.h> 14#include <linux/acpi.h>
16#include <linux/console.h> 15#include <linux/console.h>
17#include <linux/efi.h> 16#include <linux/efi.h>
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index a6764ff00803..9d67320e6840 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -22,7 +22,6 @@
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23*/ 23*/
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/hwmon-vid.h> 27#include <linux/hwmon-vid.h>
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index e407c74bda35..7576ec9426a3 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -35,7 +35,6 @@
35 w83792d 9 7 7 3 0x7a 0x5ca3 yes no 35 w83792d 9 7 7 3 0x7a 0x5ca3 yes no
36*/ 36*/
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/init.h> 39#include <linux/init.h>
41#include <linux/slab.h> 40#include <linux/slab.h>
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 87fae937e666..0599bbd65d93 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -28,7 +28,6 @@
28 * 28 *
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/ioport.h> 33#include <linux/ioport.h>
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index d00a02fc23e4..aca7e1668605 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -26,7 +26,6 @@
26 * the Free Software Foundation, version 2. 26 * the Free Software Foundation, version 2.
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/module.h> 31#include <linux/module.h>
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 2721e4c8184a..de93601de178 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -13,7 +13,6 @@
13 * warranty of any kind, whether express or implied. 13 * warranty of any kind, whether express or implied.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index df786eb55295..2a0b3be7cdd0 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -20,7 +20,6 @@
20 20
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index f7d40f8e5f5c..512b8791c328 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -20,7 +20,6 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
diff --git a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c
index 27fbfecc414f..cb3ef5ac99fd 100644
--- a/drivers/i2c/busses/scx200_i2c.c
+++ b/drivers/i2c/busses/scx200_i2c.c
@@ -21,7 +21,6 @@
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*/ 22*/
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c
index e6f1ab7b913c..b638ac6e59f4 100644
--- a/drivers/i2c/chips/isp1301_omap.c
+++ b/drivers/i2c/chips/isp1301_omap.c
@@ -21,7 +21,6 @@
21#undef DEBUG 21#undef DEBUG
22#undef VERBOSE 22#undef VERBOSE
23 23
24#include <linux/config.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/init.h> 26#include <linux/init.h>
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c
index 179b1e022d80..e27ee12245d3 100644
--- a/drivers/i2c/chips/tps65010.c
+++ b/drivers/i2c/chips/tps65010.c
@@ -19,7 +19,6 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/init.h> 24#include <linux/init.h>
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 308897e57e4d..8a1c27f28692 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -6,7 +6,6 @@
6 * Please note that this platform does not support 32-bit IDE IO. 6 * Please note that this platform does not support 32-bit IDE IO.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/string.h> 9#include <linux/string.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/ioport.h> 11#include <linux/ioport.h>
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index cd15e6260510..5797e0b5a132 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -19,7 +19,6 @@
19 19
20#undef REALLY_SLOW_IO /* most systems can safely undef this */ 20#undef REALLY_SLOW_IO /* most systems can safely undef this */
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/timer.h> 24#include <linux/timer.h>
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index fb91cb8bf2d2..15955996a1f3 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -5,7 +5,6 @@
5 5
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/ide.h> 7#include <linux/ide.h>
8#include <linux/config.h>
9 8
10#include <asm/io.h> 9#include <asm/io.h>
11#include <asm/irq.h> 10#include <asm/irq.h>
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index bfafd4846a08..654d4cd09847 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -301,7 +301,6 @@
301 301
302#define IDECD_VERSION "4.61" 302#define IDECD_VERSION "4.61"
303 303
304#include <linux/config.h>
305#include <linux/module.h> 304#include <linux/module.h>
306#include <linux/types.h> 305#include <linux/types.h>
307#include <linux/kernel.h> 306#include <linux/kernel.h>
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index d0227c39ced1..f712e4cfd9dc 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -47,7 +47,6 @@
47 47
48//#define DEBUG 48//#define DEBUG
49 49
50#include <linux/config.h>
51#include <linux/module.h> 50#include <linux/module.h>
52#include <linux/types.h> 51#include <linux/types.h>
53#include <linux/string.h> 52#include <linux/string.h>
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 783a2475ee8b..98918fb6b2ce 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -74,7 +74,6 @@
74 * 74 *
75 */ 75 */
76 76
77#include <linux/config.h>
78#include <linux/module.h> 77#include <linux/module.h>
79#include <linux/types.h> 78#include <linux/types.h>
80#include <linux/kernel.h> 79#include <linux/kernel.h>
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 68628327c0f5..6ca3476d02c7 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -82,7 +82,6 @@
82 82
83#define IDEFLOPPY_VERSION "0.99.newide" 83#define IDEFLOPPY_VERSION "0.99.newide"
84 84
85#include <linux/config.h>
86#include <linux/module.h> 85#include <linux/module.h>
87#include <linux/types.h> 86#include <linux/types.h>
88#include <linux/string.h> 87#include <linux/string.h>
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 26ceab1e90bb..7dba9992ad30 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -24,7 +24,6 @@
24 */ 24 */
25 25
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/string.h> 29#include <linux/string.h>
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 32117f0ec5c0..657165297dc7 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/string.h> 11#include <linux/string.h>
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 7ddb11828731..1feff23487d4 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <linux/types.h> 2#include <linux/types.h>
4#include <linux/string.h> 3#include <linux/string.h>
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 0d5038a28560..c5f71ac28d14 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -33,7 +33,6 @@
33 33
34#undef REALLY_SLOW_IO /* most systems can safely undef this */ 34#undef REALLY_SLOW_IO /* most systems can safely undef this */
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/string.h> 38#include <linux/string.h>
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index 84665e2ba3c8..c12f1b71e934 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27 26
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 4b91101e12b7..7067ab997927 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -424,7 +424,6 @@
424 424
425#define IDETAPE_VERSION "1.19" 425#define IDETAPE_VERSION "1.19"
426 426
427#include <linux/config.h>
428#include <linux/module.h> 427#include <linux/module.h>
429#include <linux/types.h> 428#include <linux/types.h>
430#include <linux/string.h> 429#include <linux/string.h>
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index a839b2a8f6f4..04547eb0833f 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -27,7 +27,6 @@
27 * request. 27 * request.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/string.h> 32#include <linux/string.h>
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 1cdf44205162..05fbd9298db7 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -130,7 +130,6 @@
130 130
131#define _IDE_C /* Tell ide.h it's really us */ 131#define _IDE_C /* Tell ide.h it's really us */
132 132
133#include <linux/config.h>
134#include <linux/module.h> 133#include <linux/module.h>
135#include <linux/types.h> 134#include <linux/types.h>
136#include <linux/string.h> 135#include <linux/string.h>
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index fb88711812e6..9c544467cb74 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -40,7 +40,6 @@
40#undef REALLY_SLOW_IO /* most systems can safely undef this */ 40#undef REALLY_SLOW_IO /* most systems can safely undef this */
41 41
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/config.h>
44#include <linux/types.h> 43#include <linux/types.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 20eb5b872ca9..3b1d33baaa2f 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -7,7 +7,6 @@
7#undef REALLY_SLOW_IO /* most systems can safely undef this */ 7#undef REALLY_SLOW_IO /* most systems can safely undef this */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/config.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/delay.h> 12#include <linux/delay.h>
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 3fac3e9ec47d..64d42619ab06 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/mm.h> 12#include <linux/mm.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index a77fb249d5cf..c48e87e512d3 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -39,7 +39,6 @@
39#undef REALLY_SLOW_IO /* most systems can safely undef this */ 39#undef REALLY_SLOW_IO /* most systems can safely undef this */
40 40
41#include <linux/module.h> 41#include <linux/module.h>
42#include <linux/config.h>
43#include <linux/types.h> 42#include <linux/types.h>
44#include <linux/kernel.h> 43#include <linux/kernel.h>
45#include <linux/delay.h> 44#include <linux/delay.h>
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 602797a44208..b7e459e4f284 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link)
146 kfree(link->priv); 146 kfree(link->priv);
147} /* ide_detach */ 147} /* ide_detach */
148 148
149static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) 149static void idecs_mmio_fixup(ide_hwif_t *hwif)
150{
151 default_hwif_mmiops(hwif);
152 hwif->mmio = 2;
153
154 ide_undecoded_slave(hwif);
155}
156
157static int idecs_register(unsigned long io, unsigned long ctl,
158 unsigned long irq, struct pcmcia_device *handle, int is_mmio)
150{ 159{
151 hw_regs_t hw; 160 hw_regs_t hw;
152 memset(&hw, 0, sizeof(hw)); 161 memset(&hw, 0, sizeof(hw));
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
154 hw.irq = irq; 163 hw.irq = irq;
155 hw.chipset = ide_pci; 164 hw.chipset = ide_pci;
156 hw.dev = &handle->dev; 165 hw.dev = &handle->dev;
157 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); 166
167 if(is_mmio)
168 return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
169 else
170 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
171}
172
173void outb_io(unsigned char value, unsigned long port) {
174 outb(value, port);
175}
176
177void outb_mem(unsigned char value, unsigned long port) {
178 writeb(value, (void __iomem *) port);
158} 179}
159 180
160/*====================================================================== 181/*======================================================================
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link)
180 } *stk = NULL; 201 } *stk = NULL;
181 cistpl_cftable_entry_t *cfg; 202 cistpl_cftable_entry_t *cfg;
182 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; 203 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
183 unsigned long io_base, ctl_base; 204 unsigned long io_base, ctl_base, is_mmio, try_slave;
205 void (*my_outb)(unsigned char, unsigned long);
184 206
185 DEBUG(0, "ide_config(0x%p)\n", link); 207 DEBUG(0, "ide_config(0x%p)\n", link);
186 208
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link)
210 /* Not sure if this is right... look up the current Vcc */ 232 /* Not sure if this is right... look up the current Vcc */
211 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); 233 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
212 234
213 pass = io_base = ctl_base = 0; 235 pass = io_base = ctl_base = is_mmio = try_slave = 0;
214 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
215 tuple.Attributes = 0; 237 tuple.Attributes = 0;
216 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 238 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link)
258 goto next_entry; 280 goto next_entry;
259 io_base = link->io.BasePort1; 281 io_base = link->io.BasePort1;
260 ctl_base = link->io.BasePort1 + 0x0e; 282 ctl_base = link->io.BasePort1 + 0x0e;
283
284 if (io->win[0].len >= 0x20)
285 try_slave = 1;
286
261 } else goto next_entry; 287 } else goto next_entry;
262 /* If we've got this far, we're done */ 288 /* If we've got this far, we're done */
263 break; 289 break;
264 } 290 }
265 291
292 if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
293 win_req_t req;
294 memreq_t map;
295 cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
296
297 if (mem->win[0].len < 16)
298 goto next_entry;
299
300 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
301 req.Attributes |= WIN_ENABLE;
302 req.Base = mem->win[0].host_addr;
303 req.Size = 0;
304
305 req.AccessSpeed = 0;
306 if (pcmcia_request_window(&link, &req, &link->win) != 0)
307 goto next_entry;
308 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
309 if (pcmcia_map_mem_page(link->win, &map) != 0)
310 goto next_entry;
311
312 io_base = (unsigned long) ioremap(req.Base, req.Size);
313 ctl_base = io_base + 0x0e;
314 is_mmio = 1;
315
316 if (mem->win[0].len >= 0x20)
317 try_slave = 1;
318
319 break;
320 }
321
266 next_entry: 322 next_entry:
267 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 323 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
268 memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); 324 memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link)
278 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 334 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
279 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 335 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
280 336
337 if(is_mmio)
338 my_outb = outb_mem;
339 else
340 my_outb = outb_io;
341
281 /* disable drive interrupts during IDE probe */ 342 /* disable drive interrupts during IDE probe */
282 outb(0x02, ctl_base); 343 my_outb(0x02, ctl_base);
283 344
284 /* special setup for KXLC005 card */ 345 /* special setup for KXLC005 card */
285 if (is_kme) 346 if (is_kme)
286 outb(0x81, ctl_base+1); 347 my_outb(0x81, ctl_base+1);
287 348
288 /* retry registration in case device is still spinning up */ 349 /* retry registration in case device is still spinning up */
289 for (hd = -1, i = 0; i < 10; i++) { 350 for (hd = -1, i = 0; i < 10; i++) {
290 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); 351 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
291 if (hd >= 0) break; 352 if (hd >= 0) break;
292 if (link->io.NumPorts1 == 0x20) { 353 if (try_slave) {
293 outb(0x02, ctl_base + 0x10); 354 my_outb(0x02, ctl_base + 0x10);
294 hd = idecs_register(io_base + 0x10, ctl_base + 0x10, 355 hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
295 link->irq.AssignedIRQ, link); 356 link->irq.AssignedIRQ, link, is_mmio);
296 if (hd >= 0) { 357 if (hd >= 0) {
297 io_base += 0x10; 358 io_base += 0x10;
298 ctl_base += 0x10; 359 ctl_base += 0x10;
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 90cac609d9cf..d655da749144 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -11,7 +11,6 @@
11 * more details. 11 * more details.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 563fab0098be..d3c3bc2640e7 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -28,7 +28,6 @@
28#undef REALLY_SLOW_IO /* most systems can safely undef this */ 28#undef REALLY_SLOW_IO /* most systems can safely undef this */
29 29
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/config.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index cdbdb2ff9f15..6e2c58c5f6a2 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -40,7 +40,6 @@
40#define REALLY_SLOW_IO /* some systems can safely undef this */ 40#define REALLY_SLOW_IO /* some systems can safely undef this */
41 41
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/config.h>
44#include <linux/types.h> 43#include <linux/types.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 3edd7060510f..a7c725f8bf64 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -6,7 +6,6 @@
6 */ 6 */
7 7
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/config.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/pci.h> 10#include <linux/pci.h>
12#include <linux/delay.h> 11#include <linux/delay.h>
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 8b24b4f2a839..351dab2fcacf 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 85007cb12c52..2b0ea8b6608d 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -16,7 +16,6 @@
16 * the Free Software Foundation. 16 * the Free Software Foundation.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/ioport.h> 21#include <linux/ioport.h>
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 900efd1da587..a574de5f0835 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 11d035f1983d..61b5f9c0b2f4 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -103,7 +103,6 @@
103 103
104//#define CMD640_DUMP_REGS 104//#define CMD640_DUMP_REGS
105 105
106#include <linux/config.h>
107#include <linux/types.h> 106#include <linux/types.h>
108#include <linux/kernel.h> 107#include <linux/kernel.h>
109#include <linux/delay.h> 108#include <linux/delay.h>
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 92b7b1549b16..20c32716bbc4 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -14,7 +14,6 @@
14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/pci.h> 19#include <linux/pci.h>
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index ea3c52cc8ac1..079f7c86726b 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -32,7 +32,6 @@
32 * 32 *
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/types.h> 36#include <linux/types.h>
38#include <linux/kernel.h> 37#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 09269e574b3e..380bb28c7c54 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -14,7 +14,6 @@
14 * CS5530 documentation available from National Semiconductor. 14 * CS5530 documentation available from National Semiconductor.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 6eb305197f3c..5c5aec28e671 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -23,7 +23,6 @@
23 * CS5535 documentation available from AMD 23 * CS5535 documentation available from AMD
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/pci.h> 27#include <linux/pci.h>
29#include <linux/ide.h> 28#include <linux/ide.h>
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 9f41ecd56338..120929fbe7a3 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -44,7 +44,6 @@
44 * 44 *
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
50#include <linux/pci.h> 49#include <linux/pci.h>
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 7da550281cf2..b46cb042290a 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -24,7 +24,6 @@
24 * Non-bootable card or HPT343 :: pcicmd == 0x05 24 * Non-bootable card or HPT343 :: pcicmd == 0x05
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 940bdd4c5784..e993a51f250e 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -55,7 +55,6 @@
55 */ 55 */
56 56
57 57
58#include <linux/config.h>
59#include <linux/types.h> 58#include <linux/types.h>
60#include <linux/module.h> 59#include <linux/module.h>
61#include <linux/kernel.h> 60#include <linux/kernel.h>
diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c
index 93462926b9d5..0fc89fafad65 100644
--- a/drivers/ide/pci/it8172.c
+++ b/drivers/ide/pci/it8172.c
@@ -28,7 +28,6 @@
28 * 675 Mass Ave, Cambridge, MA 02139, USA. 28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 38f41b377ff6..7fb3635683dc 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -62,7 +62,6 @@
62 * - Move to libata once it grows up 62 * - Move to libata once it grows up
63 */ 63 */
64 64
65#include <linux/config.h>
66#include <linux/types.h> 65#include <linux/types.h>
67#include <linux/module.h> 66#include <linux/module.h>
68#include <linux/pci.h> 67#include <linux/pci.h>
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index fcd5142f5cfe..d95714bcee4e 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -9,7 +9,6 @@
9 * Inspired by an earlier effort from David S. Miller <davem@redhat.com> 9 * Inspired by an earlier effort from David S. Miller <davem@redhat.com>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 5a8334d134fb..6c097e80b4df 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -14,7 +14,6 @@
14 * Released under terms of General Public License 14 * Released under terms of General Public License
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 1e209d8f9437..b46022a11bef 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -28,7 +28,6 @@
28 * Released under terms of General Public License 28 * Released under terms of General Public License
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 7fac6f57b5d6..50332ddd5ddb 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -90,7 +90,6 @@
90 * ICH3 errata #18 - Don't use native mode 90 * ICH3 errata #18 - Don't use native mode
91 */ 91 */
92 92
93#include <linux/config.h>
94#include <linux/types.h> 93#include <linux/types.h>
95#include <linux/module.h> 94#include <linux/module.h>
96#include <linux/kernel.h> 95#include <linux/kernel.h>
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 778b82ae964d..fc2b5496b6d2 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -11,7 +11,6 @@
11 * Available from National Semiconductor 11 * Available from National Semiconductor
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 5100b827a935..03677bff0d72 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -29,7 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 72dade14c725..25ceb4a39ed2 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -27,7 +27,6 @@
27 * if neccessary 27 * if neccessary
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/pci.h> 32#include <linux/pci.h>
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 8e9d87701ce2..8a6c23ac8cc1 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -44,7 +44,6 @@
44 * 962/963. 44 * 962/963.
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/types.h> 47#include <linux/types.h>
49#include <linux/module.h> 48#include <linux/module.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 900301e43818..0b4b60498515 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -13,7 +13,6 @@
13 * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org 13 * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 0968f6bc669a..4a1853af3bbb 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index f96b56838f33..56d84931d6de 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -27,7 +27,6 @@
27 * Not publically available. 27 * Not publically available.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index fe80295974e1..2a282529bfc1 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -128,7 +128,6 @@
128 * 128 *
129 */ 129 */
130 130
131#include <linux/config.h>
132#include <linux/types.h> 131#include <linux/types.h>
133#include <linux/module.h> 132#include <linux/module.h>
134#include <linux/kernel.h> 133#include <linux/kernel.h>
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 3e677c4f8c28..afdaee3c15c9 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -26,7 +26,6 @@
26 * the Free Software Foundation. 26 * the Free Software Foundation.
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/ioport.h> 31#include <linux/ioport.h>
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index b80c6135ae93..0ac9da3a7378 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -11,7 +11,6 @@
11 * by Mathew Locke <mattl@mvista.com> 11 * by Mathew Locke <mattl@mvista.com>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index e8ef3455ec35..ebf961f1718d 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -22,7 +22,6 @@
22 * big table 22 * big table
23 * 23 *
24 */ 24 */
25#include <linux/config.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/sched.h> 27#include <linux/sched.h>
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index c11e3b2e67a6..eb0945284acc 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -18,7 +18,6 @@
18 * configuration of all PCI IDE interfaces present in a system. 18 * configuration of all PCI IDE interfaces present in a system.
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c
index 1017fd717248..e2de6fa0c9fe 100644
--- a/drivers/ieee1394/config_roms.c
+++ b/drivers/ieee1394/config_roms.c
@@ -9,7 +9,6 @@
9 * directory of the kernel sources for details. 9 * directory of the kernel sources for details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14 13
15#include "csr1212.h" 14#include "csr1212.h"
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 85c2d4ca0def..87532dd43374 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -83,7 +83,6 @@
83 83
84*/ 84*/
85 85
86#include <linux/config.h>
87#include <linux/kernel.h> 86#include <linux/kernel.h>
88#include <linux/list.h> 87#include <linux/list.h>
89#include <linux/slab.h> 88#include <linux/slab.h>
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
index 25b22609e793..694da82d820b 100644
--- a/drivers/ieee1394/highlevel.c
+++ b/drivers/ieee1394/highlevel.c
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/list.h> 21#include <linux/list.h>
23#include <linux/bitops.h> 22#include <linux/bitops.h>
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index ad49c040b674..2c669287f5bd 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -10,7 +10,6 @@
10 * directory of the kernel sources for details. 10 * directory of the kernel sources for details.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/list.h> 15#include <linux/list.h>
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index 49354de9fb8a..f43739c5cab2 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -20,7 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/list.h> 24#include <linux/list.h>
26#include <linux/string.h> 25#include <linux/string.h>
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 50c71e17de73..d541b508a159 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -10,7 +10,6 @@
10 10
11#include <linux/bitmap.h> 11#include <linux/bitmap.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/config.h>
14#include <linux/list.h> 13#include <linux/list.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
16#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 800c8d518430..8de81ecd3ba6 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -82,7 +82,6 @@
82 * 82 *
83 */ 83 */
84 84
85#include <linux/config.h>
86#include <linux/kernel.h> 85#include <linux/kernel.h>
87#include <linux/list.h> 86#include <linux/list.h>
88#include <linux/slab.h> 87#include <linux/slab.h>
diff --git a/drivers/ieee1394/oui2c.sh b/drivers/ieee1394/oui2c.sh
index d50dc7a2d087..b9d0e8f10abb 100644
--- a/drivers/ieee1394/oui2c.sh
+++ b/drivers/ieee1394/oui2c.sh
@@ -3,7 +3,6 @@
3cat <<EOF 3cat <<EOF
4/* Generated file for OUI database */ 4/* Generated file for OUI database */
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_IEEE1394_OUI_DB 7#ifdef CONFIG_IEEE1394_OUI_DB
9struct oui_list_struct { 8struct oui_list_struct {
diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
index e29dfd280bee..5b48f6ac5c7f 100644
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -30,7 +30,6 @@
30 * Enhancements in async and iso send code 30 * Enhancements in async and iso send code
31 */ 31 */
32 32
33#include <linux/config.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/slab.h> 34#include <linux/slab.h>
36#include <linux/interrupt.h> 35#include <linux/interrupt.h>
diff --git a/drivers/ieee1394/pcilynx.h b/drivers/ieee1394/pcilynx.h
index d631aa8383ad..ec27321f6724 100644
--- a/drivers/ieee1394/pcilynx.h
+++ b/drivers/ieee1394/pcilynx.h
@@ -1,7 +1,6 @@
1#ifndef __PCILYNX_H__ 1#ifndef __PCILYNX_H__
2#define __PCILYNX_H__ 2#define __PCILYNX_H__
3 3
4#include <linux/config.h>
5 4
6#define PCILYNX_DRIVER_NAME "pcilynx" 5#define PCILYNX_DRIVER_NAME "pcilynx"
7#define PCILYNX_MAJOR 177 6#define PCILYNX_MAJOR 177
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 1d5ceb7ecc83..aaa74f293aaf 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -38,7 +38,6 @@
38 * but the code needs additional debugging. 38 * but the code needs additional debugging.
39 */ 39 */
40 40
41#include <linux/config.h>
42#include <linux/kernel.h> 41#include <linux/kernel.h>
43#include <linux/list.h> 42#include <linux/list.h>
44#include <linux/string.h> 43#include <linux/string.h>
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index 295d0f8c3d06..c6e3f02bc6d7 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -28,7 +28,6 @@
28 * ENOTTY for unsupported ioctl request 28 * ENOTTY for unsupported ioctl request
29 * 29 *
30 */ 30 */
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/list.h> 32#include <linux/list.h>
34#include <linux/slab.h> 33#include <linux/slab.h>
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 450adfe0a4f1..3f6705f3083a 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3152,6 +3152,7 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv,
3152 } 3152 }
3153 if (cm_id_priv->alt_av.ah_attr.dlid) { 3153 if (cm_id_priv->alt_av.ah_attr.dlid) {
3154 *qp_attr_mask |= IB_QP_ALT_PATH; 3154 *qp_attr_mask |= IB_QP_ALT_PATH;
3155 qp_attr->alt_port_num = cm_id_priv->alt_av.port->port_num;
3155 qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr; 3156 qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr;
3156 } 3157 }
3157 ret = 0; 3158 ret = 0;
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index a908a7bdcd7f..bdf5d5098190 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1963,7 +1963,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
1963 if (!obj) 1963 if (!obj)
1964 return -ENOMEM; 1964 return -ENOMEM;
1965 1965
1966 init_uobj(&obj->uobject, 0, file->ucontext); 1966 init_uobj(&obj->uobject, cmd.user_handle, file->ucontext);
1967 down_write(&obj->uobject.mutex); 1967 down_write(&obj->uobject.mutex);
1968 1968
1969 pd = idr_read_pd(cmd.pd_handle, file->ucontext); 1969 pd = idr_read_pd(cmd.pd_handle, file->ucontext);
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index 63de3046aff3..97f142c5be13 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -31,7 +31,6 @@
31 */ 31 */
32 32
33#include <linux/version.h> 33#include <linux/version.h>
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/fs.h> 35#include <linux/fs.h>
37#include <linux/mount.h> 36#include <linux/mount.h>
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c
index 3e72a1fe3d73..5e31d0de849b 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -397,7 +397,7 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
397 if ((dd->ipath_maskederrs & ~dd->ipath_ignorederrs) & 397 if ((dd->ipath_maskederrs & ~dd->ipath_ignorederrs) &
398 ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL)) 398 ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL))
399 ipath_dev_err(dd, "Disabling error(s) %llx because " 399 ipath_dev_err(dd, "Disabling error(s) %llx because "
400 "occuring too frequently (%s)\n", 400 "occurring too frequently (%s)\n",
401 (unsigned long long) 401 (unsigned long long)
402 (dd->ipath_maskederrs & 402 (dd->ipath_maskederrs &
403 ~dd->ipath_ignorederrs), msg); 403 ~dd->ipath_ignorederrs), msg);
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 465fd220569c..557cde3a4563 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -34,7 +34,6 @@
34 * $Id: mthca_main.c 1396 2004-12-28 04:10:27Z roland $ 34 * $Id: mthca_main.c 1396 2004-12-28 04:10:27Z roland $
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/init.h> 38#include <linux/init.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
index f4fddd5327f5..91934f2d9dba 100644
--- a/drivers/infiniband/hw/mthca/mthca_reset.c
+++ b/drivers/infiniband/hw/mthca/mthca_reset.c
@@ -32,7 +32,6 @@
32 * $Id: mthca_reset.c 1349 2004-12-16 21:09:43Z roland $ 32 * $Id: mthca_reset.c 1349 2004-12-16 21:09:43Z roland $
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/errno.h> 36#include <linux/errno.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 491d2afaf5b4..3f89f5e19036 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -42,7 +42,6 @@
42#include <linux/netdevice.h> 42#include <linux/netdevice.h>
43#include <linux/workqueue.h> 43#include <linux/workqueue.h>
44#include <linux/pci.h> 44#include <linux/pci.h>
45#include <linux/config.h>
46#include <linux/kref.h> 45#include <linux/kref.h>
47#include <linux/if_infiniband.h> 46#include <linux/if_infiniband.h>
48#include <linux/mutex.h> 47#include <linux/mutex.h>
diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c
index 462f8d300aae..9793ac36d17f 100644
--- a/drivers/input/gameport/emu10k1-gp.c
+++ b/drivers/input/gameport/emu10k1-gp.c
@@ -32,7 +32,6 @@
32 32
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/ioport.h> 34#include <linux/ioport.h>
35#include <linux/config.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/gameport.h> 36#include <linux/gameport.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
index 3e2d28f263e9..f68dbe6f7f04 100644
--- a/drivers/input/gameport/ns558.c
+++ b/drivers/input/gameport/ns558.c
@@ -33,7 +33,6 @@
33 33
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/ioport.h> 35#include <linux/ioport.h>
36#include <linux/config.h>
37#include <linux/init.h> 36#include <linux/init.h>
38#include <linux/delay.h> 37#include <linux/delay.h>
39#include <linux/gameport.h> 38#include <linux/gameport.h>
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 01dc0b195d59..e9a02db36ecc 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -28,7 +28,6 @@
28 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic 28 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/delay.h> 31#include <linux/delay.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/module.h> 33#include <linux/module.h>
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index 668f24535ba0..e9924d6f01b3 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -35,7 +35,6 @@
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <linux/usb.h> 36#include <linux/usb.h>
37#include <linux/serio.h> 37#include <linux/serio.h>
38#include <linux/config.h>
39#include <linux/circ_buf.h> 38#include <linux/circ_buf.h>
40#include <linux/mutex.h> 39#include <linux/mutex.h>
41 40
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
index 33edd030aa75..d22c7c624296 100644
--- a/drivers/input/keyboard/hilkbd.c
+++ b/drivers/input/keyboard/hilkbd.c
@@ -18,7 +18,6 @@
18#include <linux/pci_ids.h> 18#include <linux/pci_ids.h>
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/config.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
23#include <linux/input.h> 22#include <linux/input.h>
24#include <linux/init.h> 23#include <linux/init.h>
diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
index 2c510881874a..83906f80ba21 100644
--- a/drivers/input/keyboard/locomokbd.c
+++ b/drivers/input/keyboard/locomokbd.c
@@ -25,7 +25,6 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/init.h> 30#include <linux/init.h>
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 42c11fbf3c79..106c94f33b93 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -4,7 +4,6 @@
4 * Copyright (c) 2002 Vojtech Pavlik 4 * Copyright (c) 2002 Vojtech Pavlik
5 * Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net) 5 * Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net)
6 */ 6 */
7#include <linux/config.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
index afc66f56df43..50f1fed10be4 100644
--- a/drivers/input/mouse/inport.c
+++ b/drivers/input/mouse/inport.c
@@ -36,7 +36,6 @@
36 36
37#include <linux/module.h> 37#include <linux/module.h>
38#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
39#include <linux/config.h>
40#include <linux/ioport.h> 39#include <linux/ioport.h>
41#include <linux/init.h> 40#include <linux/init.h>
42#include <linux/interrupt.h> 41#include <linux/interrupt.h>
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
index a89742431717..0023501a5b63 100644
--- a/drivers/input/mouse/sermouse.c
+++ b/drivers/input/mouse/sermouse.c
@@ -33,7 +33,6 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/input.h> 35#include <linux/input.h>
36#include <linux/config.h>
37#include <linux/serio.h> 36#include <linux/serio.h>
38#include <linux/init.h> 37#include <linux/init.h>
39 38
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index 7b85bc21ae4a..47edcfd022ba 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -81,7 +81,6 @@
81#include <linux/slab.h> 81#include <linux/slab.h>
82#include <linux/interrupt.h> 82#include <linux/interrupt.h>
83#include <linux/input.h> 83#include <linux/input.h>
84#include <linux/config.h>
85#include <linux/serio.h> 84#include <linux/serio.h>
86#include <linux/init.h> 85#include <linux/init.h>
87 86
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index eb721b11ff37..1f851acab30d 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -19,7 +19,6 @@
19#include <linux/moduleparam.h> 19#include <linux/moduleparam.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/config.h>
23#include <linux/smp_lock.h> 22#include <linux/smp_lock.h>
24#include <linux/random.h> 23#include <linux/random.h>
25#include <linux/major.h> 24#include <linux/major.h>
diff --git a/drivers/input/power.c b/drivers/input/power.c
index 526e6070600c..51a519e24b6d 100644
--- a/drivers/input/power.c
+++ b/drivers/input/power.c
@@ -28,7 +28,6 @@
28 */ 28 */
29 29
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/config.h>
32#include <linux/input.h> 31#include <linux/input.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/init.h> 33#include <linux/init.h>
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index 1ac739ef2ffa..bc6e87add093 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -31,7 +31,6 @@
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/ioport.h> 33#include <linux/ioport.h>
34#include <linux/config.h>
35#include <linux/init.h> 34#include <linux/init.h>
36#include <linux/interrupt.h> 35#include <linux/interrupt.h>
37#include <linux/serio.h> 36#include <linux/serio.h>
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index c0b1e4becad3..22d02d53eb16 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -22,7 +22,6 @@
22 * was usable/enabled ?) 22 * was usable/enabled ?)
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/serio.h> 27#include <linux/serio.h>
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index 9cad197a4e68..7d9fafea9615 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -1,7 +1,6 @@
1#ifndef _I8042_SPARCIO_H 1#ifndef _I8042_SPARCIO_H
2#define _I8042_SPARCIO_H 2#define _I8042_SPARCIO_H
3 3
4#include <linux/config.h>
5#include <asm/io.h> 4#include <asm/io.h>
6#include <asm/oplib.h> 5#include <asm/oplib.h>
7#include <asm/prom.h> 6#include <asm/prom.h>
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index a7d91d5356a5..7fa4bc222583 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -15,7 +15,6 @@
15#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/config.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/serio.h> 19#include <linux/serio.h>
21#include <linux/err.h> 20#include <linux/err.h>
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index cbbf3842da5b..af526ab9ec04 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -1,7 +1,6 @@
1#ifndef _I8042_H 1#ifndef _I8042_H
2#define _I8042_H 2#define _I8042_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Copyright (c) 1999-2002 Vojtech Pavlik 6 * Copyright (c) 1999-2002 Vojtech Pavlik
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 5f9ecad2ca75..00e3929c6288 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -48,7 +48,6 @@
48#include <linux/init.h> 48#include <linux/init.h>
49#include <linux/input.h> 49#include <linux/input.h>
50#include <linux/major.h> 50#include <linux/major.h>
51#include <linux/config.h>
52#include <linux/smp_lock.h> 51#include <linux/smp_lock.h>
53#include <linux/random.h> 52#include <linux/random.h>
54#include <linux/time.h> 53#include <linux/time.h>
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index a518ec531021..669f76393b5a 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c
index e7cf6bc286a6..c1b21552fc03 100644
--- a/drivers/isdn/capi/capiutil.c
+++ b/drivers/isdn/capi/capiutil.c
@@ -17,7 +17,6 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/config.h>
21#include <linux/isdn/capiutil.h> 20#include <linux/isdn/capiutil.h>
22 21
23/* from CAPI2.0 DDK AVM Berlin GmbH */ 22/* from CAPI2.0 DDK AVM Berlin GmbH */
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 1b37d86d5ee1..399b316111f7 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/poll.h> 13#include <linux/poll.h>
15#include <linux/smp_lock.h> 14#include <linux/smp_lock.h>
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 1ca3bfdef51d..884bd72c1bf4 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -16,7 +16,6 @@
16#ifndef GIGASET_H 16#ifndef GIGASET_H
17#define GIGASET_H 17#define GIGASET_H
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/compiler.h> 20#include <linux/compiler.h>
22#include <linux/types.h> 21#include <linux/types.h>
diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c
index 4d64e5cbcdbf..a4beeb46c859 100644
--- a/drivers/isdn/hardware/avm/b1dma.c
+++ b/drivers/isdn/hardware/avm/b1dma.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/drivers/isdn/hardware/avm/b1pci.c b/drivers/isdn/hardware/avm/b1pci.c
index 5435a6cfb5e7..7edf19b32299 100644
--- a/drivers/isdn/hardware/avm/b1pci.c
+++ b/drivers/isdn/hardware/avm/b1pci.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index f7253b2136ea..e7924a545d49 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/drivers/isdn/hardware/avm/t1pci.c b/drivers/isdn/hardware/avm/t1pci.c
index 2ceec8e8419f..af85511600d0 100644
--- a/drivers/isdn/hardware/avm/t1pci.c
+++ b/drivers/isdn/hardware/avm/t1pci.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c
index 8fe4f3f09353..7a74ed35b1bf 100644
--- a/drivers/isdn/hardware/eicon/capimain.c
+++ b/drivers/isdn/hardware/eicon/capimain.c
@@ -10,7 +10,6 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <asm/uaccess.h> 15#include <asm/uaccess.h>
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c
index 27204f4b111a..14298b8c835f 100644
--- a/drivers/isdn/hardware/eicon/diva_didd.c
+++ b/drivers/isdn/hardware/eicon/diva_didd.c
@@ -11,7 +11,6 @@
11 * of the GNU General Public License, incorporated herein by reference. 11 * of the GNU General Public License, incorporated herein by reference.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index b163c5909182..77155d9f399b 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -10,7 +10,6 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index 6e7d89a31c1d..fff0d89c806b 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -10,7 +10,6 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index 9dee6a39104c..b05e35f7ccb1 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -9,7 +9,6 @@
9 * of the GNU General Public License, incorporated herein by reference. 9 * of the GNU General Public License, incorporated herein by reference.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index c12efa6f8429..6a4373a4f1e8 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -10,7 +10,6 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/poll.h> 15#include <linux/poll.h>
diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
index 12b8ff29e976..a66836cf756c 100644
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -18,7 +18,6 @@
18#define DIVA_BUILD "local" 18#define DIVA_BUILD "local"
19#endif 19#endif
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 4abe5ff10e72..93f3a5343a74 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include "hisax.h" 16#include "hisax.h"
18#include "isac.h" 17#include "isac.h"
diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c
index dcb308aeb50c..de28cb54817d 100644
--- a/drivers/isdn/hisax/bkm_a4t.c
+++ b/drivers/isdn/hisax/bkm_a4t.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13 13
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include "hisax.h" 15#include "hisax.h"
17#include "isac.h" 16#include "isac.h"
diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c
index 5f21b82c8c8d..9d1abfb93dde 100644
--- a/drivers/isdn/hisax/bkm_a8.c
+++ b/drivers/isdn/hisax/bkm_a8.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13 13
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include "hisax.h" 15#include "hisax.h"
17#include "isac.h" 16#include "isac.h"
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index 27332506f9f7..5333be5d2c47 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -17,7 +17,6 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include "hisax.h" 21#include "hisax.h"
23#include <linux/module.h> 22#include <linux/module.h>
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index b0ff1cc97d7c..fbb9d02e3e29 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/config.h>
20#include "hisax.h" 19#include "hisax.h"
21#include "isac.h" 20#include "isac.h"
22#include "hscx.h" 21#include "hscx.h"
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index f8ca4b323331..7a5cdb1dee1e 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/config.h>
23#include "hisax.h" 22#include "hisax.h"
24#include "arcofi.h" 23#include "arcofi.h"
25#include "isac.h" 24#include "isac.h"
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index 898ec0916195..0279fb323cb1 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -7,7 +7,6 @@
7 * 7 *
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/serial.h> 10#include <linux/serial.h>
12#include <linux/serial_reg.h> 11#include <linux/serial_reg.h>
13 12
diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c
index 3341cf155531..5f4876184691 100644
--- a/drivers/isdn/hisax/enternow_pci.c
+++ b/drivers/isdn/hisax/enternow_pci.c
@@ -60,7 +60,6 @@
60 */ 60 */
61 61
62 62
63#include <linux/config.h>
64#include "hisax.h" 63#include "hisax.h"
65#include "isac.h" 64#include "isac.h"
66#include "isdnl1.h" 65#include "isdnl1.h"
diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c
index 60b04c6d9e7d..82a1d2e86cee 100644
--- a/drivers/isdn/hisax/gazel.c
+++ b/drivers/isdn/hisax/gazel.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include "hisax.h" 15#include "hisax.h"
17#include "isac.h" 16#include "isac.h"
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index e3866b0a97fd..913fd27a1f55 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -22,7 +22,6 @@
22 22
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/config.h>
26#include <linux/pci.h> 25#include <linux/pci.h>
27#include <linux/interrupt.h> 26#include <linux/interrupt.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 3622720f0505..fa9615747e26 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/config.h>
20#include "hisax.h" 19#include "hisax.h"
21#include "hfc_pci.h" 20#include "hfc_pci.h"
22#include "isdnl1.h" 21#include "isdnl1.h"
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 262c44127419..b5e571a52694 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -32,7 +32,6 @@
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/stddef.h> 33#include <linux/stddef.h>
34#include <linux/timer.h> 34#include <linux/timer.h>
35#include <linux/config.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/kernel_stat.h> 37#include <linux/kernel_stat.h>
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 11fe537e2f6f..75920aa0a3c5 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -6,7 +6,6 @@
6 * of the GNU General Public License, incorporated herein by reference. 6 * of the GNU General Public License, incorporated herein by reference.
7 * 7 *
8 */ 8 */
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <linux/fs.h> 10#include <linux/fs.h>
12#include <linux/major.h> 11#include <linux/major.h>
diff --git a/drivers/isdn/hisax/hisax_debug.h b/drivers/isdn/hisax/hisax_debug.h
index ba518a7a7fb7..ceafecdb1037 100644
--- a/drivers/isdn/hisax/hisax_debug.h
+++ b/drivers/isdn/hisax/hisax_debug.h
@@ -22,7 +22,6 @@
22#ifndef __HISAX_DEBUG_H__ 22#ifndef __HISAX_DEBUG_H__
23#define __HISAX_DEBUG_H__ 23#define __HISAX_DEBUG_H__
24 24
25#include <linux/config.h>
26 25
27#ifdef CONFIG_HISAX_DEBUG 26#ifdef CONFIG_HISAX_DEBUG
28 27
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index 2e9afae1254a..df5fc92a89b2 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include "hisax_if.h" 14#include "hisax_if.h"
16#include "hisax.h" 15#include "hisax.h"
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index c9917cd2132b..281fa27d9f00 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -18,7 +18,6 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include "hisax.h" 19#include "hisax.h"
20#include "isdnl3.h" 20#include "isdnl3.h"
21#include <linux/config.h>
22 21
23const char *l3_revision = "$Revision: 2.22.2.3 $"; 22const char *l3_revision = "$Revision: 2.22.2.3 $";
24 23
diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c
index e96845cdd4f6..99feae8b9210 100644
--- a/drivers/isdn/hisax/l3dss1.c
+++ b/drivers/isdn/hisax/l3dss1.c
@@ -23,7 +23,6 @@
23#include "isdnl3.h" 23#include "isdnl3.h"
24#include "l3dss1.h" 24#include "l3dss1.h"
25#include <linux/ctype.h> 25#include <linux/ctype.h>
26#include <linux/config.h>
27 26
28extern char *HiSax_getrev(const char *revision); 27extern char *HiSax_getrev(const char *revision);
29static const char *dss1_revision = "$Revision: 2.32.2.3 $"; 28static const char *dss1_revision = "$Revision: 2.32.2.3 $";
diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
index 68a2159cbd11..868762cf76c6 100644
--- a/drivers/isdn/hisax/niccy.c
+++ b/drivers/isdn/hisax/niccy.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16 16
17#include <linux/config.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include "hisax.h" 18#include "hisax.h"
20#include "isac.h" 19#include "isac.h"
diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c
index a7d3cd3f36fd..1b3ac46df52c 100644
--- a/drivers/isdn/hisax/nj_s.c
+++ b/drivers/isdn/hisax/nj_s.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include "hisax.h" 9#include "hisax.h"
11#include "isac.h" 10#include "isac.h"
diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c
index 1ae7cac98a87..7a6010eac60d 100644
--- a/drivers/isdn/hisax/nj_u.c
+++ b/drivers/isdn/hisax/nj_u.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include "hisax.h" 9#include "hisax.h"
11#include "icc.h" 10#include "icc.h"
diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
index 8c044a6a7fe3..11ea456626b6 100644
--- a/drivers/isdn/hisax/sedlbauer.c
+++ b/drivers/isdn/hisax/sedlbauer.c
@@ -39,7 +39,6 @@
39*/ 39*/
40 40
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/config.h>
43#include "hisax.h" 42#include "hisax.h"
44#include "isac.h" 43#include "isac.h"
45#include "ipac.h" 44#include "ipac.h"
diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h
index 9ffaae7c657a..04416bad611d 100644
--- a/drivers/isdn/hisax/st5481.h
+++ b/drivers/isdn/hisax/st5481.h
@@ -13,7 +13,6 @@
13#ifndef _ST5481_H_ 13#ifndef _ST5481_H_
14#define _ST5481_H_ 14#define _ST5481_H_
15 15
16#include <linux/config.h>
17 16
18// USB IDs, the Product Id is in the range 0x4810-0x481F 17// USB IDs, the Product Id is in the range 0x4810-0x481F
19 18
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c
index 99cb0f3d59a1..2716aa5c60f7 100644
--- a/drivers/isdn/hisax/st5481_init.c
+++ b/drivers/isdn/hisax/st5481_init.c
@@ -24,7 +24,6 @@
24 * clean up debug 24 * clean up debug
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/init.h> 28#include <linux/init.h>
30#include <linux/usb.h> 29#include <linux/usb.h>
diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c
index e82ab2251b82..a1bb73e28841 100644
--- a/drivers/isdn/hisax/telespci.c
+++ b/drivers/isdn/hisax/telespci.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/config.h>
17#include "hisax.h" 16#include "hisax.h"
18#include "isac.h" 17#include "isac.h"
19#include "hscx.h" 18#include "hscx.h"
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index 0352ee5f706c..00e4fa2aef51 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include "hisax.h" 14#include "hisax.h"
16#include "w6692.h" 15#include "w6692.h"
diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c
index 48d134be9908..89fd531fbce6 100644
--- a/drivers/isdn/hysdn/boardergo.c
+++ b/drivers/isdn/hysdn/boardergo.c
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/signal.h> 18#include <linux/signal.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h
index 3a9b29b38bc4..461e831592dd 100644
--- a/drivers/isdn/hysdn/hysdn_defs.h
+++ b/drivers/isdn/hysdn/hysdn_defs.h
@@ -14,7 +14,6 @@
14#ifndef HYSDN_DEFS_H 14#ifndef HYSDN_DEFS_H
15#define HYSDN_DEFS_H 15#define HYSDN_DEFS_H
16 16
17#include <linux/config.h>
18#include <linux/hysdn_if.h> 17#include <linux/hysdn_if.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/workqueue.h> 19#include <linux/workqueue.h>
diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c
index b75ac5af236a..b702ed27252b 100644
--- a/drivers/isdn/hysdn/hysdn_init.c
+++ b/drivers/isdn/hysdn/hysdn_init.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/poll.h> 15#include <linux/poll.h>
diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c
index 133032920ff8..1c0d54ac12ab 100644
--- a/drivers/isdn/hysdn/hysdn_sched.c
+++ b/drivers/isdn/hysdn/hysdn_sched.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/sched.h> 14#include <linux/sched.h>
16#include <linux/signal.h> 15#include <linux/signal.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index eb21063e6f63..9f6c6375ff75 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/poll.h> 16#include <linux/poll.h>
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 96c115e13389..43da8ae1b2ad 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -22,7 +22,6 @@
22 * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt 22 * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/isdn.h> 25#include <linux/isdn.h>
27#include <net/arp.h> 26#include <net/arp.h>
28#include <net/dst.h> 27#include <net/dst.h>
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 918742271c79..29e7667ec962 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/isdn.h> 12#include <linux/isdn.h>
14#include <linux/poll.h> 13#include <linux/poll.h>
15#include <linux/ppp-comp.h> 14#include <linux/ppp-comp.h>
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 0a53a990c100..9ab66e8960d5 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -11,7 +11,6 @@
11 */ 11 */
12#undef ISDN_TTY_STAT_DEBUG 12#undef ISDN_TTY_STAT_DEBUG
13 13
14#include <linux/config.h>
15#include <linux/isdn.h> 14#include <linux/isdn.h>
16#include <linux/delay.h> 15#include <linux/delay.h>
17#include "isdn_common.h" 16#include "isdn_common.h"
diff --git a/drivers/isdn/i4l/isdn_tty.h b/drivers/isdn/i4l/isdn_tty.h
index 9f0fa9501f4d..692c74d6b749 100644
--- a/drivers/isdn/i4l/isdn_tty.h
+++ b/drivers/isdn/i4l/isdn_tty.h
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14 13
15#define DLE 0x10 14#define DLE 0x10
16#define ETX 0x03 15#define ETX 0x03
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index a67d31af797a..fabbd461603e 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
15#include <linux/init.h> 14#include <linux/init.h>
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index c75d0ef1609c..d424b4452028 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -9,7 +9,6 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/init.h> 14#include <linux/init.h>
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 1b1ce6523960..47f0ff196328 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/init.h> 16#include <linux/init.h>
diff --git a/drivers/leds/leds-corgi.c b/drivers/leds/leds-corgi.c
index bb7d84df0121..cf1dcd719a28 100644
--- a/drivers/leds/leds-corgi.c
+++ b/drivers/leds/leds-corgi.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
diff --git a/drivers/leds/leds-ixp4xx-gpio.c b/drivers/leds/leds-ixp4xx-gpio.c
index 30ced150e4cf..7dcf0b92c460 100644
--- a/drivers/leds/leds-ixp4xx-gpio.c
+++ b/drivers/leds/leds-ixp4xx-gpio.c
@@ -31,7 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/platform_device.h> 36#include <linux/platform_device.h>
diff --git a/drivers/leds/leds-locomo.c b/drivers/leds/leds-locomo.c
index 8419e29b71f4..3b87951aa555 100644
--- a/drivers/leds/leds-locomo.c
+++ b/drivers/leds/leds-locomo.c
@@ -8,7 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/device.h> 13#include <linux/device.h>
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index 650cf72dc675..fb1edc1c9edb 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
diff --git a/drivers/leds/leds-spitz.c b/drivers/leds/leds-spitz.c
index 65bbef4a5e09..126d09cc96ec 100644
--- a/drivers/leds/leds-spitz.c
+++ b/drivers/leds/leds-spitz.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
diff --git a/drivers/leds/leds-tosa.c b/drivers/leds/leds-tosa.c
index c9e8cc1ec481..fb2416a38303 100644
--- a/drivers/leds/leds-tosa.c
+++ b/drivers/leds/leds-tosa.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/platform_device.h> 17#include <linux/platform_device.h>
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
index fbf141ef46ec..179c2876b541 100644
--- a/drivers/leds/ledtrig-timer.c
+++ b/drivers/leds/ledtrig-timer.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/init.h> 16#include <linux/init.h>
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 9f1a049dc226..360f93f6fcdb 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -16,7 +16,6 @@
16 * - move bus probe to a kernel thread 16 * - move bus probe to a kernel thread
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/types.h> 19#include <linux/types.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index cbfbbe2b150a..545be1ed6927 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -34,7 +34,6 @@
34 * Move to syfs 34 * Move to syfs
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/slab.h> 38#include <linux/slab.h>
40#include <linux/init.h> 39#include <linux/init.h>
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c
index e5a2bbf99399..1293876a2ebd 100644
--- a/drivers/macintosh/apm_emu.c
+++ b/drivers/macintosh/apm_emu.c
@@ -18,7 +18,6 @@
18 * 18 *
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23 22
24#include <linux/poll.h> 23#include <linux/poll.h>
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index a66636116f0b..6b129eef7987 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -8,7 +8,6 @@
8 * This file will soon be removed in favor of an uinput userspace tool. 8 * This file will soon be removed in favor of an uinput userspace tool.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
14#include <linux/sysctl.h> 13#include <linux/sysctl.h>
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index c687ac703941..d832e109b1b1 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -17,7 +17,6 @@
17 * sub-devices. 17 * sub-devices.
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 7f7d4eaca870..cae24a13526a 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/kernel.h> 1#include <linux/kernel.h>
3#include <linux/stat.h> 2#include <linux/stat.h>
4#include <asm/macio.h> 3#include <asm/macio.h>
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 53c1c7909413..0acf2f7fd9d7 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -10,7 +10,6 @@
10 * as published by the Free Software Foundation; either version 10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index f4516ca7aa3a..030130570e0a 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -19,7 +19,6 @@
19 * the userland interface 19 * the userland interface
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/device.h> 24#include <linux/device.h>
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 5282fec17075..7f86478bdd36 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 231146f439dd..c1fe0b368f76 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -97,7 +97,6 @@
97 * 97 *
98 */ 98 */
99 99
100#include <linux/config.h>
101#include <linux/types.h> 100#include <linux/types.h>
102#include <linux/module.h> 101#include <linux/module.h>
103#include <linux/errno.h> 102#include <linux/errno.h>
diff --git a/drivers/macintosh/therm_pm72.h b/drivers/macintosh/therm_pm72.h
index c17e61f9c418..fc7e9b7ecaf2 100644
--- a/drivers/macintosh/therm_pm72.h
+++ b/drivers/macintosh/therm_pm72.h
@@ -93,7 +93,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp";
93 * 0. This appear to be safe enough for this first version 93 * 0. This appear to be safe enough for this first version
94 * of the driver, though I would accept any clean patch 94 * of the driver, though I would accept any clean patch
95 * doing a better use of the device-tree without turning the 95 * doing a better use of the device-tree without turning the
96 * while i2c registration mecanism into a racy mess 96 * while i2c registration mechanism into a racy mess
97 * 97 *
98 * Note: Xserve changed this. We have some bits on the K2 bus, 98 * Note: Xserve changed this. We have some bits on the K2 bus,
99 * which I arbitrarily set to 0x200. Ultimately, we really want 99 * which I arbitrarily set to 0x200. Ultimately, we really want
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index 3d9dd2e166aa..c7d1c290cb0c 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index 2d9d79150403..6501db50fb83 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -9,7 +9,6 @@
9 * Copyright (C) 1996 Paul Mackerras. 9 * Copyright (C) 1996 Paul Mackerras.
10 */ 10 */
11#include <stdarg.h> 11#include <stdarg.h>
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 1ab4f16c08b9..c1193d34ec9e 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23#include <stdarg.h> 23#include <stdarg.h>
24#include <linux/config.h>
25#include <linux/types.h> 24#include <linux/types.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c
index 81337cd16e80..900aade06198 100644
--- a/drivers/macintosh/windfarm_cpufreq_clamp.c
+++ b/drivers/macintosh/windfarm_cpufreq_clamp.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/types.h> 1#include <linux/types.h>
3#include <linux/errno.h> 2#include <linux/errno.h>
4#include <linux/kernel.h> 3#include <linux/kernel.h>
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ebbd2d856256..ecc56765d949 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -20,7 +20,6 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/config.h>
24#include <linux/timer.h> 23#include <linux/timer.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/list.h> 25#include <linux/list.h>
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 8eea0ddbf5ec..1d0fafda0f76 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/blkdev.h> 9#include <linux/blkdev.h>
10#include <linux/config.h>
11#include <linux/ctype.h> 10#include <linux/ctype.h>
12#include <linux/device-mapper.h> 11#include <linux/device-mapper.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 73ab875fb158..f1db6eff4857 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -12,7 +12,6 @@
12#include <asm/atomic.h> 12#include <asm/atomic.h>
13 13
14#include <linux/blkdev.h> 14#include <linux/blkdev.h>
15#include <linux/config.h>
16#include <linux/fs.h> 15#include <linux/fs.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/list.h> 17#include <linux/list.h>
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2ec1b3520a0b..2fe32c261922 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -33,7 +33,6 @@
33*/ 33*/
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/config.h>
37#include <linux/kthread.h> 36#include <linux/kthread.h>
38#include <linux/linkage.h> 37#include <linux/linkage.h>
39#include <linux/raid/md.h> 38#include <linux/raid/md.h>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 837ec4eb3d60..7433871f4b3a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <linux/highmem.h> 24#include <linux/highmem.h>
diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
index 2092e6c33dd2..d2905720eb74 100644
--- a/drivers/media/common/saa7146_hlp.c
+++ b/drivers/media/common/saa7146_hlp.c
@@ -158,7 +158,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev,
158 } 158 }
159 159
160 /* the horizontal scaling increment controls the UV filter 160 /* the horizontal scaling increment controls the UV filter
161 to reduce the bandwith to improve the display quality, 161 to reduce the bandwidth to improve the display quality,
162 so set it ... */ 162 so set it ... */
163 if ( xsci == 0x400) 163 if ( xsci == 0x400)
164 pfuv = 0x00; 164 pfuv = 0x00;
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h
index b3dd0603cd92..5a6c4fe249e7 100644
--- a/drivers/media/dvb/b2c2/flexcop-common.h
+++ b/drivers/media/dvb/b2c2/flexcop-common.h
@@ -8,7 +8,6 @@
8#ifndef __FLEXCOP_COMMON_H__ 8#ifndef __FLEXCOP_COMMON_H__
9#define __FLEXCOP_COMMON_H__ 9#define __FLEXCOP_COMMON_H__
10 10
11#include <linux/config.h>
12#include <linux/pci.h> 11#include <linux/pci.h>
13#include <linux/mutex.h> 12#include <linux/mutex.h>
14 13
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 1b8953600425..001c71b6be61 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 5e8bb41a088b..59ac35ddd51e 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -570,7 +570,8 @@ static int dvb_frontend_thread(void *data)
570 dvb_frontend_add_event(fe, s); 570 dvb_frontend_add_event(fe, s);
571 fepriv->status = s; 571 fepriv->status = s;
572 } 572 }
573 } 573 } else
574 dvb_frontend_swzigzag(fe);
574 } else 575 } else
575 dvb_frontend_swzigzag(fe); 576 dvb_frontend_swzigzag(fe);
576 } 577 }
@@ -975,6 +976,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
975 976
976 case FE_SET_FRONTEND_TUNE_MODE: 977 case FE_SET_FRONTEND_TUNE_MODE:
977 fepriv->tune_mode_flags = (unsigned long) parg; 978 fepriv->tune_mode_flags = (unsigned long) parg;
979 err = 0;
978 break; 980 break;
979 }; 981 };
980 982
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 4cf9f89c51bf..97f8ea962438 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -8,7 +8,6 @@
8#ifndef __DVB_USB_H__ 8#ifndef __DVB_USB_H__
9#define __DVB_USB_H__ 9#define __DVB_USB_H__
10 10
11#include <linux/config.h>
12#include <linux/input.h> 11#include <linux/input.h>
13#include <linux/usb.h> 12#include <linux/usb.h>
14#include <linux/firmware.h> 13#include <linux/firmware.h>
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c
index 3c7c09a362b2..13ad1bfae663 100644
--- a/drivers/media/dvb/frontends/cx22700.c
+++ b/drivers/media/dvb/frontends/cx22700.c
@@ -134,6 +134,7 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet
134 return -EINVAL; 134 return -EINVAL;
135 135
136 if (p->code_rate_LP < FEC_1_2 || p->code_rate_LP > FEC_7_8) 136 if (p->code_rate_LP < FEC_1_2 || p->code_rate_LP > FEC_7_8)
137 return -EINVAL;
137 138
138 if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5) 139 if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5)
139 return -EINVAL; 140 return -EINVAL;
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index f2f795cba56a..274a87b7a5d5 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -670,10 +670,10 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage
670 switch (voltage) { 670 switch (voltage) {
671 case SEC_VOLTAGE_13: 671 case SEC_VOLTAGE_13:
672 dprintk("%s: setting voltage 13V\n", __FUNCTION__); 672 dprintk("%s: setting voltage 13V\n", __FUNCTION__);
673 return cx24123_writereg(state, 0x29, val | 0x80); 673 return cx24123_writereg(state, 0x29, val & 0x7f);
674 case SEC_VOLTAGE_18: 674 case SEC_VOLTAGE_18:
675 dprintk("%s: setting voltage 18V\n", __FUNCTION__); 675 dprintk("%s: setting voltage 18V\n", __FUNCTION__);
676 return cx24123_writereg(state, 0x29, val & 0x7f); 676 return cx24123_writereg(state, 0x29, val | 0x80);
677 default: 677 default:
678 return -EINVAL; 678 return -EINVAL;
679 }; 679 };
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index 7c6dc7e30900..5302e11883a2 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 6c3be2529980..98673474a140 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -20,7 +20,6 @@
20 * see Documentation/dvb/README.dibusb for more information 20 * see Documentation/dvb/README.dibusb for more information
21 * 21 *
22 */ 22 */
23#include <linux/config.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/moduleparam.h> 25#include <linux/moduleparam.h>
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c
index 6e8ad176e1a1..9a354708bd20 100644
--- a/drivers/media/dvb/frontends/lgdt330x.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -216,7 +216,7 @@ static int lgdt330x_init(struct dvb_frontend* fe)
216 AGC_DELAY0, 0x07, 216 AGC_DELAY0, 0x07,
217 AGC_DELAY2, 0xfe, 217 AGC_DELAY2, 0xfe,
218 /* Change the value of IAGCBW[15:8] 218 /* Change the value of IAGCBW[15:8]
219 of inner AGC loop filter bandwith */ 219 of inner AGC loop filter bandwidth */
220 AGC_LOOP_BANDWIDTH0, 0x08, 220 AGC_LOOP_BANDWIDTH0, 0x08,
221 AGC_LOOP_BANDWIDTH1, 0x9a 221 AGC_LOOP_BANDWIDTH1, 0x9a
222 }; 222 };
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c
index e83ff2104c9b..9cbd164aa281 100644
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@ -21,7 +21,6 @@
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*/ 22*/
23 23
24#include <linux/config.h>
25#include <linux/delay.h> 24#include <linux/delay.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/init.h> 26#include <linux/init.h>
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index 6bffe85c161c..9b57576bfeb4 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -18,7 +18,6 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#include <linux/config.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/init.h> 23#include <linux/init.h>
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 7a5c99c200e8..500f15c10aaf 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -30,7 +30,6 @@
30 */ 30 */
31 31
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kmod.h> 34#include <linux/kmod.h>
36#include <linux/delay.h> 35#include <linux/delay.h>
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 6163cb03b8f4..5f111d407730 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1141,6 +1141,15 @@ static void frontend_init(struct budget_av *budget_av)
1141 break; 1141 break;
1142 1142
1143 case SUBID_DVBC_KNC1: 1143 case SUBID_DVBC_KNC1:
1144 budget_av->reinitialise_demod = 1;
1145 fe = tda10021_attach(&philips_cu1216_config,
1146 &budget_av->budget.i2c_adap,
1147 read_pwm(budget_av));
1148 if (fe) {
1149 fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
1150 }
1151 break;
1152
1144 case SUBID_DVBC_KNC1_PLUS: 1153 case SUBID_DVBC_KNC1_PLUS:
1145 case SUBID_DVBC_CINERGY1200: 1154 case SUBID_DVBC_CINERGY1200:
1146 budget_av->reinitialise_demod = 1; 1155 budget_av->reinitialise_demod = 1;
@@ -1293,11 +1302,7 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1293 1302
1294 budget_av->budget.dvb_adapter.priv = budget_av; 1303 budget_av->budget.dvb_adapter.priv = budget_av;
1295 frontend_init(budget_av); 1304 frontend_init(budget_av);
1296 1305 ciintf_init(budget_av);
1297 if (!budget_av->has_saa7113) {
1298 ciintf_init(budget_av);
1299 }
1300
1301 return 0; 1306 return 0;
1302} 1307}
1303 1308
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 336b2fe1a5f2..04cef3023457 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -43,7 +43,7 @@
43 is a bit braindead (no matching channel masks or no matching filter mask), 43 is a bit braindead (no matching channel masks or no matching filter mask),
44 we won't support this - yet. it doesn't event support negative filters, 44 we won't support this - yet. it doesn't event support negative filters,
45 so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just 45 so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just
46 parse TS data. USB bandwith will be a problem when having large 46 parse TS data. USB bandwidth will be a problem when having large
47 datastreams, especially for dvb-net, but hey, that's not my problem. 47 datastreams, especially for dvb-net, but hey, that's not my problem.
48 48
49 TTUSB_DISEQC, TTUSB_TONE: 49 TTUSB_DISEQC, TTUSB_TONE:
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index 9f249e7e60c9..4c82956390c1 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -37,7 +37,6 @@
37 *************************************************************************** 37 ***************************************************************************
38 */ 38 */
39 39
40#include <linux/config.h>
41#include <linux/types.h> 40#include <linux/types.h>
42#include <linux/list.h> 41#include <linux/list.h>
43#include <linux/module.h> 42#include <linux/module.h>
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index ae14f5f32039..5c5e682a3004 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -18,7 +18,6 @@
18 * 2003-09-01: Support w3cam by Takeo Takahashi 18 * 2003-09-01: Support w3cam by Takeo Takahashi
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index e68a6d2fff24..de14818d5cc4 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -25,7 +25,6 @@
25 25
26*/ 26*/
27 27
28#include <linux/config.h>
29#include <linux/delay.h> 28#include <linux/delay.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
@@ -3548,11 +3547,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
3548 /* Hybrid DVB card, DOES have a tda9887 */ 3547 /* Hybrid DVB card, DOES have a tda9887 */
3549 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE) 3548 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3550 tda9887 = 1; 3549 tda9887 = 1;
3551 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3552 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3553 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3554 tda9887)
3555 request_module("tda9887");
3556 if (btv->tuner_type != UNSET) 3550 if (btv->tuner_type != UNSET)
3557 request_module("tuner"); 3551 request_module("tuner");
3558} 3552}
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index d2956010f763..311c4c541e01 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -360,7 +360,7 @@ struct bttv {
360 int mbox_csel; 360 int mbox_csel;
361 361
362 /* risc memory management data 362 /* risc memory management data
363 - must aquire s_lock before changing these 363 - must acquire s_lock before changing these
364 - only the irq handler is supported to touch top + bottom + vcurr */ 364 - only the irq handler is supported to touch top + bottom + vcurr */
365 struct btcx_riscmem main; 365 struct btcx_riscmem main;
366 struct bttv_buffer *screen; /* overlay */ 366 struct bttv_buffer *screen; /* overlay */
diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c
index 840fe0177121..353d02b67c33 100644
--- a/drivers/media/video/compat_ioctl32.c
+++ b/drivers/media/video/compat_ioctl32.c
@@ -12,7 +12,6 @@
12 * ioctls. 12 * ioctls.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/compat.h> 15#include <linux/compat.h>
17#include <linux/videodev.h> 16#include <linux/videodev.h>
18#include <linux/videodev2.h> 17#include <linux/videodev2.h>
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 95c5aceecc5b..3b31a0dd2f0c 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -26,7 +26,6 @@
26/* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ 26/* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
27/* #define _CPIA_DEBUG_ 1 */ 27/* #define _CPIA_DEBUG_ 1 */
28 28
29#include <linux/config.h>
30 29
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index d129db57fcd4..d09f49950f2a 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -31,7 +31,6 @@
31 31
32#include <linux/version.h> 32#include <linux/version.h>
33 33
34#include <linux/config.h>
35 34
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/time.h> 36#include <linux/time.h>
diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c
index 4c89bd395d3e..41f4b8d17559 100644
--- a/drivers/media/video/cpia_pp.c
+++ b/drivers/media/video/cpia_pp.c
@@ -25,7 +25,6 @@
25/* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ 25/* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
26/* #define _CPIA_DEBUG_ 1 */ 26/* #define _CPIA_DEBUG_ 1 */
27 27
28#include <linux/config.h>
29 28
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/init.h> 30#include <linux/init.h>
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 4ff81582ec56..349632b48e93 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -686,6 +686,39 @@ static struct videobuf_queue_ops blackbird_qops = {
686 686
687/* ------------------------------------------------------------------ */ 687/* ------------------------------------------------------------------ */
688 688
689static const u32 *ctrl_classes[] = {
690 cx88_user_ctrls,
691 cx2341x_mpeg_ctrls,
692 NULL
693};
694
695static int blackbird_queryctrl(struct cx8802_dev *dev, struct v4l2_queryctrl *qctrl)
696{
697 qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
698 if (qctrl->id == 0)
699 return -EINVAL;
700
701 /* Standard V4L2 controls */
702 if (cx8800_ctrl_query(qctrl) == 0)
703 return 0;
704
705 /* MPEG V4L2 controls */
706 if (cx2341x_ctrl_query(&dev->params, qctrl))
707 qctrl->flags |= V4L2_CTRL_FLAG_DISABLED;
708 return 0;
709}
710
711static int blackbird_querymenu(struct cx8802_dev *dev, struct v4l2_querymenu *qmenu)
712{
713 struct v4l2_queryctrl qctrl;
714
715 qctrl.id = qmenu->id;
716 blackbird_queryctrl(dev, &qctrl);
717 return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
718}
719
720/* ------------------------------------------------------------------ */
721
689static int mpeg_do_ioctl(struct inode *inode, struct file *file, 722static int mpeg_do_ioctl(struct inode *inode, struct file *file,
690 unsigned int cmd, void *arg) 723 unsigned int cmd, void *arg)
691{ 724{
@@ -866,6 +899,16 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
866 core->name); 899 core->name);
867 return 0; 900 return 0;
868 } 901 }
902 case VIDIOC_QUERYMENU:
903 return blackbird_querymenu(dev, arg);
904 case VIDIOC_QUERYCTRL:
905 {
906 struct v4l2_queryctrl *c = arg;
907
908 if (blackbird_queryctrl(dev, c) == 0)
909 return 0;
910 return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl);
911 }
869 912
870 default: 913 default:
871 return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl); 914 return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl);
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index f9d68f20dc88..14bd4863d157 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1194,6 +1194,21 @@ struct cx88_board cx88_boards[] = {
1194 }}, 1194 }},
1195 .dvb = 1, 1195 .dvb = 1,
1196 }, 1196 },
1197 [CX88_BOARD_GENIATECH_DVBS] = {
1198 .name = "Geniatech DVB-S",
1199 .tuner_type = TUNER_ABSENT,
1200 .radio_type = UNSET,
1201 .tuner_addr = ADDR_UNSET,
1202 .radio_addr = ADDR_UNSET,
1203 .input = {{
1204 .type = CX88_VMUX_DVB,
1205 .vmux = 0,
1206 },{
1207 .type = CX88_VMUX_COMPOSITE1,
1208 .vmux = 1,
1209 }},
1210 .dvb = 1,
1211 },
1197}; 1212};
1198const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 1213const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
1199 1214
@@ -1439,6 +1454,10 @@ struct cx88_subid cx88_subids[] = {
1439 .subvendor = 0x18ac, 1454 .subvendor = 0x18ac,
1440 .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */ 1455 .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
1441 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q, 1456 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
1457 },{
1458 .subvendor = 0x14f1,
1459 .subdevice = 0x0084,
1460 .card = CX88_BOARD_GENIATECH_DVBS,
1442 }, 1461 },
1443}; 1462};
1444const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 1463const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index dce1feddd55d..afde3789d702 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -496,6 +496,26 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t
496 return 0; 496 return 0;
497} 497}
498 498
499static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
500{
501 struct cx8802_dev *dev= fe->dvb->priv;
502 struct cx88_core *core = dev->core;
503
504 if (voltage == SEC_VOLTAGE_OFF) {
505 dprintk(1,"LNB Voltage OFF\n");
506 cx_write(MO_GP0_IO, 0x0000efff);
507 }
508
509 if (core->prev_set_voltage)
510 return core->prev_set_voltage(fe, voltage);
511 return 0;
512}
513
514static struct cx24123_config geniatech_dvbs_config = {
515 .demod_address = 0x55,
516 .set_ts_params = cx24123_set_ts_param,
517};
518
499static struct cx24123_config hauppauge_novas_config = { 519static struct cx24123_config hauppauge_novas_config = {
500 .demod_address = 0x55, 520 .demod_address = 0x55,
501 .set_ts_params = cx24123_set_ts_param, 521 .set_ts_params = cx24123_set_ts_param,
@@ -760,6 +780,14 @@ static int dvb_register(struct cx8802_dev *dev)
760 dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; 780 dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
761 } 781 }
762 break; 782 break;
783 case CX88_BOARD_GENIATECH_DVBS:
784 dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config,
785 &dev->core->i2c_adap);
786 if (dev->dvb.frontend) {
787 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
788 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
789 }
790 break;
763#endif 791#endif
764 default: 792 default:
765 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", 793 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 8d5cf474b68e..c538d99ec9f6 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -327,6 +327,51 @@ static struct cx88_ctrl cx8800_ctls[] = {
327}; 327};
328static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); 328static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls);
329 329
330const u32 cx88_user_ctrls[] = {
331 V4L2_CID_USER_CLASS,
332 V4L2_CID_BRIGHTNESS,
333 V4L2_CID_CONTRAST,
334 V4L2_CID_SATURATION,
335 V4L2_CID_HUE,
336 V4L2_CID_AUDIO_VOLUME,
337 V4L2_CID_AUDIO_BALANCE,
338 V4L2_CID_AUDIO_MUTE,
339 0
340};
341EXPORT_SYMBOL(cx88_user_ctrls);
342
343static const u32 *ctrl_classes[] = {
344 cx88_user_ctrls,
345 NULL
346};
347
348int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl)
349{
350 int i;
351
352 if (qctrl->id < V4L2_CID_BASE ||
353 qctrl->id >= V4L2_CID_LASTP1)
354 return -EINVAL;
355 for (i = 0; i < CX8800_CTLS; i++)
356 if (cx8800_ctls[i].v.id == qctrl->id)
357 break;
358 if (i == CX8800_CTLS) {
359 *qctrl = no_ctl;
360 return 0;
361 }
362 *qctrl = cx8800_ctls[i].v;
363 return 0;
364}
365EXPORT_SYMBOL(cx8800_ctrl_query);
366
367static int cx88_queryctrl(struct v4l2_queryctrl *qctrl)
368{
369 qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
370 if (qctrl->id == 0)
371 return -EINVAL;
372 return cx8800_ctrl_query(qctrl);
373}
374
330/* ------------------------------------------------------------------- */ 375/* ------------------------------------------------------------------- */
331/* resource management */ 376/* resource management */
332 377
@@ -1362,20 +1407,8 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1362 case VIDIOC_QUERYCTRL: 1407 case VIDIOC_QUERYCTRL:
1363 { 1408 {
1364 struct v4l2_queryctrl *c = arg; 1409 struct v4l2_queryctrl *c = arg;
1365 int i;
1366 1410
1367 if (c->id < V4L2_CID_BASE || 1411 return cx88_queryctrl(c);
1368 c->id >= V4L2_CID_LASTP1)
1369 return -EINVAL;
1370 for (i = 0; i < CX8800_CTLS; i++)
1371 if (cx8800_ctls[i].v.id == c->id)
1372 break;
1373 if (i == CX8800_CTLS) {
1374 *c = no_ctl;
1375 return 0;
1376 }
1377 *c = cx8800_ctls[i].v;
1378 return 0;
1379 } 1412 }
1380 case VIDIOC_G_CTRL: 1413 case VIDIOC_G_CTRL:
1381 return get_control(core,arg); 1414 return get_control(core,arg);
@@ -1893,8 +1926,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1893 /* load and configure helper modules */ 1926 /* load and configure helper modules */
1894 if (TUNER_ABSENT != core->tuner_type) 1927 if (TUNER_ABSENT != core->tuner_type)
1895 request_module("tuner"); 1928 request_module("tuner");
1896 if (core->tda9887_conf)
1897 request_module("tda9887");
1898 1929
1899 /* register v4l devices */ 1930 /* register v4l devices */
1900 dev->video_dev = cx88_vdev_init(core,dev->pci, 1931 dev->video_dev = cx88_vdev_init(core,dev->pci,
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 9a9a0fc7a41a..e7810955dd4f 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -196,6 +196,7 @@ extern struct sram_channel cx88_sram_channels[];
196#define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49 196#define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49
197#define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50 197#define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50
198#define CX88_BOARD_WINFAST_DTV2000H 51 198#define CX88_BOARD_WINFAST_DTV2000H 51
199#define CX88_BOARD_GENIATECH_DVBS 52
199 200
200enum cx88_itype { 201enum cx88_itype {
201 CX88_VMUX_COMPOSITE1 = 1, 202 CX88_VMUX_COMPOSITE1 = 1,
@@ -590,6 +591,8 @@ int cx8802_resume_common(struct pci_dev *pci_dev);
590extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, 591extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
591 struct cx88_core *core, unsigned int cmd, 592 struct cx88_core *core, unsigned int cmd,
592 void *arg, v4l2_kioctl driver_ioctl); 593 void *arg, v4l2_kioctl driver_ioctl);
594extern const u32 cx88_user_ctrls[];
595extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl);
593 596
594/* 597/*
595 * Local variables: 598 * Local variables:
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 9286090817cd..2a461dde480c 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1574,8 +1574,6 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1574 request_module("tvp5150"); 1574 request_module("tvp5150");
1575 if (dev->has_tuner) 1575 if (dev->has_tuner)
1576 request_module("tuner"); 1576 request_module("tuner");
1577 if (dev->tda9887_conf)
1578 request_module("tda9887");
1579#endif 1577#endif
1580 errCode = em28xx_config(dev); 1578 errCode = em28xx_config(dev);
1581 if (errCode) { 1579 if (errCode) {
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index f68ca7d9f531..ddd62214bee5 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -26,7 +26,6 @@
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/pci.h> 30#include <linux/pci.h>
32#include <linux/sched.h> 31#include <linux/sched.h>
diff --git a/drivers/media/video/meye.h b/drivers/media/video/meye.h
index 0d09a0e3803c..ea107cb5c845 100644
--- a/drivers/media/video/meye.h
+++ b/drivers/media/video/meye.h
@@ -36,7 +36,6 @@
36#define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \ 36#define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \
37 __stringify(MEYE_DRIVER_MINORVERSION) 37 __stringify(MEYE_DRIVER_MINORVERSION)
38 38
39#include <linux/config.h>
40#include <linux/types.h> 39#include <linux/types.h>
41#include <linux/pci.h> 40#include <linux/pci.h>
42#include <linux/kfifo.h> 41#include <linux/kfifo.h>
diff --git a/drivers/media/video/msp3400-driver.h b/drivers/media/video/msp3400-driver.h
index 4e451049013d..545e4ac094f2 100644
--- a/drivers/media/video/msp3400-driver.h
+++ b/drivers/media/video/msp3400-driver.h
@@ -90,8 +90,8 @@ struct msp_state {
90 /* thread */ 90 /* thread */
91 struct task_struct *kthread; 91 struct task_struct *kthread;
92 wait_queue_head_t wq; 92 wait_queue_head_t wq;
93 int restart:1; 93 unsigned int restart:1;
94 int watch_stereo:1; 94 unsigned int watch_stereo:1;
95}; 95};
96 96
97/* msp3400-driver.c */ 97/* msp3400-driver.c */
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index a988df226aab..1b07a61c2ebb 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -35,7 +35,6 @@
35 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 35 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/init.h> 39#include <linux/init.h>
41#include <linux/vmalloc.h> 40#include <linux/vmalloc.h>
diff --git a/drivers/media/video/pvrusb2/Makefile b/drivers/media/video/pvrusb2/Makefile
index fed603ad0a67..02e414210dac 100644
--- a/drivers/media/video/pvrusb2/Makefile
+++ b/drivers/media/video/pvrusb2/Makefile
@@ -8,7 +8,7 @@ obj-pvrusb2-24xxx-$(CONFIG_VIDEO_PVRUSB2_24XXX) := \
8pvrusb2-objs := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \ 8pvrusb2-objs := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \
9 pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \ 9 pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \
10 pvrusb2-encoder.o pvrusb2-video-v4l.o \ 10 pvrusb2-encoder.o pvrusb2-video-v4l.o \
11 pvrusb2-eeprom.o pvrusb2-tuner.o pvrusb2-demod.o \ 11 pvrusb2-eeprom.o pvrusb2-tuner.o \
12 pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \ 12 pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \
13 pvrusb2-ctrl.o pvrusb2-std.o \ 13 pvrusb2-ctrl.o pvrusb2-std.o \
14 pvrusb2-context.o pvrusb2-io.o pvrusb2-ioread.o \ 14 pvrusb2-context.o pvrusb2-io.o pvrusb2-ioread.o \
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c
index 313d2dcf9e4b..9846c464ec80 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-audio.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c
@@ -145,8 +145,8 @@ static int get_audio_status(struct pvr2_msp3400_handler *ctxt)
145 145
146static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt) 146static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt)
147{ 147{
148 ctxt->client->handler = 0; 148 ctxt->client->handler = NULL;
149 ctxt->hdw->audio_stat = 0; 149 ctxt->hdw->audio_stat = NULL;
150 kfree(ctxt); 150 kfree(ctxt);
151} 151}
152 152
diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.c b/drivers/media/video/pvrusb2/pvrusb2-context.c
index 40dc59871a45..f129f316d20e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-context.c
@@ -77,7 +77,7 @@ struct pvr2_context *pvr2_context_create(
77 const struct usb_device_id *devid, 77 const struct usb_device_id *devid,
78 void (*setup_func)(struct pvr2_context *)) 78 void (*setup_func)(struct pvr2_context *))
79{ 79{
80 struct pvr2_context *mp = 0; 80 struct pvr2_context *mp = NULL;
81 mp = kmalloc(sizeof(*mp),GFP_KERNEL); 81 mp = kmalloc(sizeof(*mp),GFP_KERNEL);
82 if (!mp) goto done; 82 if (!mp) goto done;
83 memset(mp,0,sizeof(*mp)); 83 memset(mp,0,sizeof(*mp));
@@ -87,7 +87,7 @@ struct pvr2_context *pvr2_context_create(
87 mp->hdw = pvr2_hdw_create(intf,devid); 87 mp->hdw = pvr2_hdw_create(intf,devid);
88 if (!mp->hdw) { 88 if (!mp->hdw) {
89 pvr2_context_destroy(mp); 89 pvr2_context_destroy(mp);
90 mp = 0; 90 mp = NULL;
91 goto done; 91 goto done;
92 } 92 }
93 93
@@ -145,7 +145,7 @@ void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp)
145{ 145{
146 cp->hdw = mp->hdw; 146 cp->hdw = mp->hdw;
147 cp->mc_head = mp; 147 cp->mc_head = mp;
148 cp->mc_next = 0; 148 cp->mc_next = NULL;
149 cp->mc_prev = mp->mc_last; 149 cp->mc_prev = mp->mc_last;
150 if (mp->mc_last) { 150 if (mp->mc_last) {
151 mp->mc_last->mc_next = cp; 151 mp->mc_last->mc_next = cp;
@@ -160,8 +160,8 @@ static void pvr2_channel_disclaim_stream(struct pvr2_channel *cp)
160{ 160{
161 if (!cp->stream) return; 161 if (!cp->stream) return;
162 pvr2_stream_kill(cp->stream->stream); 162 pvr2_stream_kill(cp->stream->stream);
163 cp->stream->user = 0; 163 cp->stream->user = NULL;
164 cp->stream = 0; 164 cp->stream = NULL;
165} 165}
166 166
167 167
@@ -179,7 +179,7 @@ void pvr2_channel_done(struct pvr2_channel *cp)
179 } else { 179 } else {
180 mp->mc_first = cp->mc_next; 180 mp->mc_first = cp->mc_next;
181 } 181 }
182 cp->hdw = 0; 182 cp->hdw = NULL;
183} 183}
184 184
185 185
@@ -212,7 +212,7 @@ struct pvr2_ioread *pvr2_channel_create_mpeg_stream(
212{ 212{
213 struct pvr2_ioread *cp; 213 struct pvr2_ioread *cp;
214 cp = pvr2_ioread_create(); 214 cp = pvr2_ioread_create();
215 if (!cp) return 0; 215 if (!cp) return NULL;
216 pvr2_ioread_setup(cp,sp->stream); 216 pvr2_ioread_setup(cp,sp->stream);
217 pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key)); 217 pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key));
218 return cp; 218 return cp;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
index d5df9fbeba2f..fb6198f1df98 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
@@ -158,7 +158,7 @@ int pvr2_ctrl_get_mask(struct pvr2_ctrl *cptr)
158/* Retrieve the control's name */ 158/* Retrieve the control's name */
159const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) 159const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr)
160{ 160{
161 if (!cptr) return 0; 161 if (!cptr) return NULL;
162 return cptr->info->name; 162 return cptr->info->name;
163} 163}
164 164
@@ -166,7 +166,7 @@ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr)
166/* Retrieve the control's desc */ 166/* Retrieve the control's desc */
167const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr) 167const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr)
168{ 168{
169 if (!cptr) return 0; 169 if (!cptr) return NULL;
170 return cptr->info->desc; 170 return cptr->info->desc;
171} 171}
172 172
@@ -488,7 +488,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr,
488 488
489 LOCK_TAKE(cptr->hdw->big_lock); do { 489 LOCK_TAKE(cptr->hdw->big_lock); do {
490 if (cptr->info->type == pvr2_ctl_int) { 490 if (cptr->info->type == pvr2_ctl_int) {
491 ret = parse_token(ptr,len,valptr,0,0); 491 ret = parse_token(ptr,len,valptr,NULL,0);
492 if ((ret >= 0) && 492 if ((ret >= 0) &&
493 ((*valptr < cptr->info->def.type_int.min_value) || 493 ((*valptr < cptr->info->def.type_int.min_value) ||
494 (*valptr > cptr->info->def.type_int.max_value))) { 494 (*valptr > cptr->info->def.type_int.max_value))) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
index 27eadaff75a0..c80c26be6e4d 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
@@ -139,8 +139,8 @@ static const struct pvr2_v4l_cx2584x_ops decoder_ops[] = {
139 139
140static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt) 140static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt)
141{ 141{
142 ctxt->client->handler = 0; 142 ctxt->client->handler = NULL;
143 ctxt->hdw->decoder_ctrl = 0; 143 ctxt->hdw->decoder_ctrl = NULL;
144 kfree(ctxt); 144 kfree(ctxt);
145} 145}
146 146
@@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt,
221static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt) 221static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt)
222{ 222{
223 int ret; 223 int ret;
224 ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0); 224 ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL);
225 pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret); 225 pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret);
226} 226}
227 227
diff --git a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
index 586900e365ff..f985f00d885a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
@@ -82,7 +82,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count,
82 unsigned int wlen; 82 unsigned int wlen;
83 unsigned int scnt; 83 unsigned int scnt;
84 84
85 wptr = 0; 85 wptr = NULL;
86 wlen = 0; 86 wlen = 0;
87 scnt = debugifc_count_whitespace(buf,count); 87 scnt = debugifc_count_whitespace(buf,count);
88 consume_cnt += scnt; count -= scnt; buf += scnt; 88 consume_cnt += scnt; count -= scnt; buf += scnt;
@@ -337,8 +337,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw,
337} 337}
338 338
339 339
340int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, 340static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
341 unsigned int count) 341 unsigned int count)
342{ 342{
343 const char *wptr; 343 const char *wptr;
344 unsigned int wlen; 344 unsigned int wlen;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.c b/drivers/media/video/pvrusb2/pvrusb2-demod.c
deleted file mode 100644
index 9686569a11f6..000000000000
--- a/drivers/media/video/pvrusb2/pvrusb2-demod.c
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 *
3 * $Id$
4 *
5 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
6 * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU 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 02111-1307 USA
20 *
21 */
22
23#include "pvrusb2.h"
24#include "pvrusb2-util.h"
25#include "pvrusb2-demod.h"
26#include "pvrusb2-hdw-internal.h"
27#include "pvrusb2-debug.h"
28#include <linux/videodev2.h>
29#include <media/tuner.h>
30#include <media/v4l2-common.h>
31
32
33struct pvr2_demod_handler {
34 struct pvr2_hdw *hdw;
35 struct pvr2_i2c_client *client;
36 struct pvr2_i2c_handler i2c_handler;
37 int type_update_fl;
38};
39
40
41static void set_config(struct pvr2_demod_handler *ctxt)
42{
43 struct pvr2_hdw *hdw = ctxt->hdw;
44 int cfg = 0;
45
46 switch (hdw->tuner_type) {
47 case TUNER_PHILIPS_FM1216ME_MK3:
48 case TUNER_PHILIPS_FM1236_MK3:
49 cfg = TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE;
50 break;
51 default:
52 break;
53 }
54 pvr2_trace(PVR2_TRACE_CHIPS,"i2c demod set_config(0x%x)",cfg);
55 pvr2_i2c_client_cmd(ctxt->client,TDA9887_SET_CONFIG,&cfg);
56 ctxt->type_update_fl = 0;
57}
58
59
60static int demod_check(struct pvr2_demod_handler *ctxt)
61{
62 struct pvr2_hdw *hdw = ctxt->hdw;
63 if (hdw->tuner_updated) ctxt->type_update_fl = !0;
64 return ctxt->type_update_fl != 0;
65}
66
67
68static void demod_update(struct pvr2_demod_handler *ctxt)
69{
70 if (ctxt->type_update_fl) set_config(ctxt);
71}
72
73
74static void demod_detach(struct pvr2_demod_handler *ctxt)
75{
76 ctxt->client->handler = 0;
77 kfree(ctxt);
78}
79
80
81static unsigned int demod_describe(struct pvr2_demod_handler *ctxt,char *buf,unsigned int cnt)
82{
83 return scnprintf(buf,cnt,"handler: pvrusb2-demod");
84}
85
86
87const static struct pvr2_i2c_handler_functions tuner_funcs = {
88 .detach = (void (*)(void *))demod_detach,
89 .check = (int (*)(void *))demod_check,
90 .update = (void (*)(void *))demod_update,
91 .describe = (unsigned int (*)(void *,char *,unsigned int))demod_describe,
92};
93
94
95int pvr2_i2c_demod_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
96{
97 struct pvr2_demod_handler *ctxt;
98 if (cp->handler) return 0;
99
100 ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL);
101 if (!ctxt) return 0;
102 memset(ctxt,0,sizeof(*ctxt));
103
104 ctxt->i2c_handler.func_data = ctxt;
105 ctxt->i2c_handler.func_table = &tuner_funcs;
106 ctxt->type_update_fl = !0;
107 ctxt->client = cp;
108 ctxt->hdw = hdw;
109 cp->handler = &ctxt->i2c_handler;
110 pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x tda9887 V4L2 handler set up",
111 cp->client->addr);
112 return !0;
113}
114
115
116
117
118/*
119 Stuff for Emacs to see, in order to encourage consistent editing style:
120 *** Local Variables: ***
121 *** mode: c ***
122 *** fill-column: 70 ***
123 *** tab-width: 8 ***
124 *** c-basic-offset: 8 ***
125 *** End: ***
126 */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.h b/drivers/media/video/pvrusb2/pvrusb2-demod.h
deleted file mode 100644
index 4c4e40ffbf03..000000000000
--- a/drivers/media/video/pvrusb2/pvrusb2-demod.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 *
3 * $Id$
4 *
5 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21#ifndef __PVRUSB2_DEMOD_H
22#define __PVRUSB2_DEMOD_H
23
24#include "pvrusb2-i2c-core.h"
25
26int pvr2_i2c_demod_setup(struct pvr2_hdw *,struct pvr2_i2c_client *);
27
28#endif /* __PVRUSB2_DEMOD_H */
29
30/*
31 Stuff for Emacs to see, in order to encourage consistent editing style:
32 *** Local Variables: ***
33 *** mode: c ***
34 *** fill-column: 70 ***
35 *** tab-width: 8 ***
36 *** c-basic-offset: 8 ***
37 *** End: ***
38 */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
index 94d383ff9889..6cff8e75f426 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
@@ -58,7 +58,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw)
58 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 58 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
59 "Failed to allocate memory" 59 "Failed to allocate memory"
60 " required to read eeprom"); 60 " required to read eeprom");
61 return 0; 61 return NULL;
62 } 62 }
63 63
64 trace_eeprom("Value for eeprom addr from controller was 0x%x", 64 trace_eeprom("Value for eeprom addr from controller was 0x%x",
@@ -108,7 +108,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw)
108 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 108 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
109 "eeprom fetch set offs err=%d",ret); 109 "eeprom fetch set offs err=%d",ret);
110 kfree(eeprom); 110 kfree(eeprom);
111 return 0; 111 return NULL;
112 } 112 }
113 } 113 }
114 return eeprom; 114 return eeprom;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index 2cc31695b435..18a7073501c6 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -65,7 +65,7 @@ static int pvr2_encoder_write_words(struct pvr2_hdw *hdw,
65 } 65 }
66 ret = pvr2_send_request(hdw, 66 ret = pvr2_send_request(hdw,
67 hdw->cmd_buffer,1+(chunkCnt*7), 67 hdw->cmd_buffer,1+(chunkCnt*7),
68 0,0); 68 NULL,0);
69 if (ret) return ret; 69 if (ret) return ret;
70 data += chunkCnt; 70 data += chunkCnt;
71 dlen -= chunkCnt; 71 dlen -= chunkCnt;
@@ -322,7 +322,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw)
322 } 322 }
323 323
324 ret = cx2341x_update(hdw,pvr2_encoder_cmd, 324 ret = cx2341x_update(hdw,pvr2_encoder_cmd,
325 (hdw->enc_cur_valid ? &hdw->enc_cur_state : 0), 325 (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL),
326 &hdw->enc_ctl_state); 326 &hdw->enc_ctl_state);
327 if (ret) { 327 if (ret) {
328 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 328 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index ba2afbfe32c5..0d6dc33ca320 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -354,23 +354,6 @@ struct pvr2_hdw {
354 unsigned int control_cnt; 354 unsigned int control_cnt;
355}; 355};
356 356
357int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw);
358
359unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *);
360
361void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
362 unsigned long msk,unsigned long val);
363void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
364 unsigned long msk,
365 unsigned long val);
366
367void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw);
368void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw);
369
370int pvr2_i2c_basic_op(struct pvr2_hdw *,u8 i2c_addr,
371 u8 *wdata,u16 wlen,
372 u8 *rdata,u16 rlen);
373
374#endif /* __PVRUSB2_HDW_INTERNAL_H */ 357#endif /* __PVRUSB2_HDW_INTERNAL_H */
375 358
376/* 359/*
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 643c471375da..9b48abcf6089 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -63,7 +63,6 @@ struct pvr2_string_table {
63static const char *pvr2_client_24xxx[] = { 63static const char *pvr2_client_24xxx[] = {
64 "cx25840", 64 "cx25840",
65 "tuner", 65 "tuner",
66 "tda9887",
67 "wm8775", 66 "wm8775",
68}; 67};
69#endif 68#endif
@@ -73,7 +72,6 @@ static const char *pvr2_client_29xxx[] = {
73 "msp3400", 72 "msp3400",
74 "saa7115", 73 "saa7115",
75 "tuner", 74 "tuner",
76 "tda9887",
77}; 75};
78 76
79static struct pvr2_string_table pvr2_client_lists[] = { 77static struct pvr2_string_table pvr2_client_lists[] = {
@@ -89,8 +87,8 @@ static struct pvr2_string_table pvr2_client_lists[] = {
89#endif 87#endif
90}; 88};
91 89
92static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; 90static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
93DECLARE_MUTEX(pvr2_unit_sem); 91static DECLARE_MUTEX(pvr2_unit_sem);
94 92
95static int ctlchg = 0; 93static int ctlchg = 0;
96static int initusbreset = 1; 94static int initusbreset = 1;
@@ -263,6 +261,25 @@ static const char *control_values_subsystem[] = {
263 [PVR2_SUBSYS_B_ENC_RUN] = "enc_run", 261 [PVR2_SUBSYS_B_ENC_RUN] = "enc_run",
264}; 262};
265 263
264static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
265static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw);
266static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw);
267static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw);
268static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw);
269static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw);
270static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw);
271static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
272 unsigned long msk,
273 unsigned long val);
274static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
275 unsigned long msk,
276 unsigned long val);
277static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
278 unsigned int timeout,int probe_fl,
279 void *write_data,unsigned int write_len,
280 void *read_data,unsigned int read_len);
281static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res);
282static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res);
266 283
267static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) 284static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp)
268{ 285{
@@ -405,7 +422,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr)
405 info = (struct pvr2_ctl_info *)(cptr->info); 422 info = (struct pvr2_ctl_info *)(cptr->info);
406 if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { 423 if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) {
407 if (info->set_value) { 424 if (info->set_value) {
408 info->set_value = 0; 425 info->set_value = NULL;
409 } 426 }
410 } else { 427 } else {
411 if (!(info->set_value)) { 428 if (!(info->set_value)) {
@@ -836,14 +853,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw)
836} 853}
837 854
838 855
839struct pvr2_hdw *pvr2_hdw_find(int unit_number)
840{
841 if (unit_number < 0) return 0;
842 if (unit_number >= PVR_NUM) return 0;
843 return unit_pointers[unit_number];
844}
845
846
847int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) 856int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)
848{ 857{
849 return hdw->unit_number; 858 return hdw->unit_number;
@@ -917,9 +926,9 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw,
917 * is not suitable for an usb transaction. 926 * is not suitable for an usb transaction.
918 * 927 *
919 */ 928 */
920int pvr2_upload_firmware1(struct pvr2_hdw *hdw) 929static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
921{ 930{
922 const struct firmware *fw_entry = 0; 931 const struct firmware *fw_entry = NULL;
923 void *fw_ptr; 932 void *fw_ptr;
924 unsigned int pipe; 933 unsigned int pipe;
925 int ret; 934 int ret;
@@ -1015,7 +1024,7 @@ int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1015 1024
1016int pvr2_upload_firmware2(struct pvr2_hdw *hdw) 1025int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1017{ 1026{
1018 const struct firmware *fw_entry = 0; 1027 const struct firmware *fw_entry = NULL;
1019 void *fw_ptr; 1028 void *fw_ptr;
1020 unsigned int pipe, fw_len, fw_done; 1029 unsigned int pipe, fw_len, fw_done;
1021 int actual_length; 1030 int actual_length;
@@ -1166,8 +1175,9 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1166 reconfigure and start over. 1175 reconfigure and start over.
1167 1176
1168*/ 1177*/
1169void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, 1178static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
1170 unsigned long msk,unsigned long val) 1179 unsigned long msk,
1180 unsigned long val)
1171{ 1181{
1172 unsigned long nmsk; 1182 unsigned long nmsk;
1173 unsigned long vmsk; 1183 unsigned long vmsk;
@@ -1318,18 +1328,6 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw,
1318} 1328}
1319 1329
1320 1330
1321void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk)
1322{
1323 pvr2_hdw_subsys_bit_chg(hdw,msk,msk);
1324}
1325
1326
1327void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk)
1328{
1329 pvr2_hdw_subsys_bit_chg(hdw,msk,0);
1330}
1331
1332
1333unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw) 1331unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw)
1334{ 1332{
1335 return hdw->subsys_enabled_mask; 1333 return hdw->subsys_enabled_mask;
@@ -1342,9 +1340,9 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw)
1342} 1340}
1343 1341
1344 1342
1345void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, 1343static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw,
1346 unsigned long msk, 1344 unsigned long msk,
1347 unsigned long val) 1345 unsigned long val)
1348{ 1346{
1349 unsigned long val2; 1347 unsigned long val2;
1350 msk &= PVR2_SUBSYS_ALL; 1348 msk &= PVR2_SUBSYS_ALL;
@@ -1366,7 +1364,7 @@ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw,
1366} 1364}
1367 1365
1368 1366
1369int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) 1367static int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl)
1370{ 1368{
1371 if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0; 1369 if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0;
1372 if (enableFl) { 1370 if (enableFl) {
@@ -1400,8 +1398,8 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag)
1400} 1398}
1401 1399
1402 1400
1403int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, 1401static int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw,
1404 enum pvr2_config config) 1402 enum pvr2_config config)
1405{ 1403{
1406 unsigned long sm = hdw->subsys_enabled_mask; 1404 unsigned long sm = hdw->subsys_enabled_mask;
1407 if (!hdw->flag_ok) return -EIO; 1405 if (!hdw->flag_ok) return -EIO;
@@ -1741,7 +1739,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
1741 sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { 1739 sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) {
1742 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1740 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1743 "Bogus device type of %u reported",hdw_type); 1741 "Bogus device type of %u reported",hdw_type);
1744 return 0; 1742 return NULL;
1745 } 1743 }
1746 1744
1747 hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); 1745 hdw = kmalloc(sizeof(*hdw),GFP_KERNEL);
@@ -1922,38 +1920,38 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
1922 if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); 1920 if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info);
1923 kfree(hdw); 1921 kfree(hdw);
1924 } 1922 }
1925 return 0; 1923 return NULL;
1926} 1924}
1927 1925
1928 1926
1929/* Remove _all_ associations between this driver and the underlying USB 1927/* Remove _all_ associations between this driver and the underlying USB
1930 layer. */ 1928 layer. */
1931void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) 1929static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw)
1932{ 1930{
1933 if (hdw->flag_disconnected) return; 1931 if (hdw->flag_disconnected) return;
1934 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw); 1932 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw);
1935 if (hdw->ctl_read_urb) { 1933 if (hdw->ctl_read_urb) {
1936 usb_kill_urb(hdw->ctl_read_urb); 1934 usb_kill_urb(hdw->ctl_read_urb);
1937 usb_free_urb(hdw->ctl_read_urb); 1935 usb_free_urb(hdw->ctl_read_urb);
1938 hdw->ctl_read_urb = 0; 1936 hdw->ctl_read_urb = NULL;
1939 } 1937 }
1940 if (hdw->ctl_write_urb) { 1938 if (hdw->ctl_write_urb) {
1941 usb_kill_urb(hdw->ctl_write_urb); 1939 usb_kill_urb(hdw->ctl_write_urb);
1942 usb_free_urb(hdw->ctl_write_urb); 1940 usb_free_urb(hdw->ctl_write_urb);
1943 hdw->ctl_write_urb = 0; 1941 hdw->ctl_write_urb = NULL;
1944 } 1942 }
1945 if (hdw->ctl_read_buffer) { 1943 if (hdw->ctl_read_buffer) {
1946 kfree(hdw->ctl_read_buffer); 1944 kfree(hdw->ctl_read_buffer);
1947 hdw->ctl_read_buffer = 0; 1945 hdw->ctl_read_buffer = NULL;
1948 } 1946 }
1949 if (hdw->ctl_write_buffer) { 1947 if (hdw->ctl_write_buffer) {
1950 kfree(hdw->ctl_write_buffer); 1948 kfree(hdw->ctl_write_buffer);
1951 hdw->ctl_write_buffer = 0; 1949 hdw->ctl_write_buffer = NULL;
1952 } 1950 }
1953 pvr2_hdw_render_useless_unlocked(hdw); 1951 pvr2_hdw_render_useless_unlocked(hdw);
1954 hdw->flag_disconnected = !0; 1952 hdw->flag_disconnected = !0;
1955 hdw->usb_dev = 0; 1953 hdw->usb_dev = NULL;
1956 hdw->usb_intf = 0; 1954 hdw->usb_intf = NULL;
1957} 1955}
1958 1956
1959 1957
@@ -1963,11 +1961,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
1963 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); 1961 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw);
1964 if (hdw->fw_buffer) { 1962 if (hdw->fw_buffer) {
1965 kfree(hdw->fw_buffer); 1963 kfree(hdw->fw_buffer);
1966 hdw->fw_buffer = 0; 1964 hdw->fw_buffer = NULL;
1967 } 1965 }
1968 if (hdw->vid_stream) { 1966 if (hdw->vid_stream) {
1969 pvr2_stream_destroy(hdw->vid_stream); 1967 pvr2_stream_destroy(hdw->vid_stream);
1970 hdw->vid_stream = 0; 1968 hdw->vid_stream = NULL;
1971 } 1969 }
1972 if (hdw->audio_stat) { 1970 if (hdw->audio_stat) {
1973 hdw->audio_stat->detach(hdw->audio_stat->ctxt); 1971 hdw->audio_stat->detach(hdw->audio_stat->ctxt);
@@ -1981,7 +1979,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
1981 if ((hdw->unit_number >= 0) && 1979 if ((hdw->unit_number >= 0) &&
1982 (hdw->unit_number < PVR_NUM) && 1980 (hdw->unit_number < PVR_NUM) &&
1983 (unit_pointers[hdw->unit_number] == hdw)) { 1981 (unit_pointers[hdw->unit_number] == hdw)) {
1984 unit_pointers[hdw->unit_number] = 0; 1982 unit_pointers[hdw->unit_number] = NULL;
1985 } 1983 }
1986 } while (0); up(&pvr2_unit_sem); 1984 } while (0); up(&pvr2_unit_sem);
1987 if (hdw->controls) kfree(hdw->controls); 1985 if (hdw->controls) kfree(hdw->controls);
@@ -2018,7 +2016,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw)
2018 2016
2019// Attempt to autoselect an appropriate value for std_enum_cur given 2017// Attempt to autoselect an appropriate value for std_enum_cur given
2020// whatever is currently in std_mask_cur 2018// whatever is currently in std_mask_cur
2021void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) 2019static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw)
2022{ 2020{
2023 unsigned int idx; 2021 unsigned int idx;
2024 for (idx = 1; idx < hdw->std_enum_cnt; idx++) { 2022 for (idx = 1; idx < hdw->std_enum_cnt; idx++) {
@@ -2033,7 +2031,7 @@ void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw)
2033 2031
2034// Calculate correct set of enumerated standards based on currently known 2032// Calculate correct set of enumerated standards based on currently known
2035// set of available standards bits. 2033// set of available standards bits.
2036void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) 2034static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
2037{ 2035{
2038 struct v4l2_standard *newstd; 2036 struct v4l2_standard *newstd;
2039 unsigned int std_cnt; 2037 unsigned int std_cnt;
@@ -2043,12 +2041,12 @@ void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw)
2043 2041
2044 if (hdw->std_defs) { 2042 if (hdw->std_defs) {
2045 kfree(hdw->std_defs); 2043 kfree(hdw->std_defs);
2046 hdw->std_defs = 0; 2044 hdw->std_defs = NULL;
2047 } 2045 }
2048 hdw->std_enum_cnt = 0; 2046 hdw->std_enum_cnt = 0;
2049 if (hdw->std_enum_names) { 2047 if (hdw->std_enum_names) {
2050 kfree(hdw->std_enum_names); 2048 kfree(hdw->std_enum_names);
2051 hdw->std_enum_names = 0; 2049 hdw->std_enum_names = NULL;
2052 } 2050 }
2053 2051
2054 if (!std_cnt) { 2052 if (!std_cnt) {
@@ -2099,7 +2097,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw)
2099struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, 2097struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw,
2100 unsigned int idx) 2098 unsigned int idx)
2101{ 2099{
2102 if (idx >= hdw->control_cnt) return 0; 2100 if (idx >= hdw->control_cnt) return NULL;
2103 return hdw->controls + idx; 2101 return hdw->controls + idx;
2104} 2102}
2105 2103
@@ -2118,7 +2116,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw,
2118 i = cptr->info->internal_id; 2116 i = cptr->info->internal_id;
2119 if (i && (i == ctl_id)) return cptr; 2117 if (i && (i == ctl_id)) return cptr;
2120 } 2118 }
2121 return 0; 2119 return NULL;
2122} 2120}
2123 2121
2124 2122
@@ -2135,7 +2133,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id
2135 i = cptr->info->v4l_id; 2133 i = cptr->info->v4l_id;
2136 if (i && (i == ctl_id)) return cptr; 2134 if (i && (i == ctl_id)) return cptr;
2137 } 2135 }
2138 return 0; 2136 return NULL;
2139} 2137}
2140 2138
2141 2139
@@ -2149,7 +2147,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw,
2149 int i; 2147 int i;
2150 2148
2151 /* This could be made a lot more efficient, but for now... */ 2149 /* This could be made a lot more efficient, but for now... */
2152 cp2 = 0; 2150 cp2 = NULL;
2153 for (idx = 0; idx < hdw->control_cnt; idx++) { 2151 for (idx = 0; idx < hdw->control_cnt; idx++) {
2154 cptr = hdw->controls + idx; 2152 cptr = hdw->controls + idx;
2155 i = cptr->info->v4l_id; 2153 i = cptr->info->v4l_id;
@@ -2159,7 +2157,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw,
2159 cp2 = cptr; 2157 cp2 = cptr;
2160 } 2158 }
2161 return cp2; 2159 return cp2;
2162 return 0; 2160 return NULL;
2163} 2161}
2164 2162
2165 2163
@@ -2182,7 +2180,7 @@ static const char *get_ctrl_typename(enum pvr2_ctl_type tp)
2182 state(s) back to their previous value before this function was called. 2180 state(s) back to their previous value before this function was called.
2183 Thus we can automatically reconfigure affected pieces of the driver as 2181 Thus we can automatically reconfigure affected pieces of the driver as
2184 controls are changed. */ 2182 controls are changed. */
2185int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) 2183static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw)
2186{ 2184{
2187 unsigned long saved_subsys_mask = hdw->subsys_enabled_mask; 2185 unsigned long saved_subsys_mask = hdw->subsys_enabled_mask;
2188 unsigned long stale_subsys_mask = 0; 2186 unsigned long stale_subsys_mask = 0;
@@ -2321,14 +2319,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw)
2321} 2319}
2322 2320
2323 2321
2324void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw)
2325{
2326 LOCK_TAKE(hdw->big_lock); do {
2327 pvr2_hdw_poll_trigger_unlocked(hdw);
2328 } while (0); LOCK_GIVE(hdw->big_lock);
2329}
2330
2331
2332/* Return name for this driver instance */ 2322/* Return name for this driver instance */
2333const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) 2323const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
2334{ 2324{
@@ -2337,7 +2327,7 @@ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
2337 2327
2338 2328
2339/* Return bit mask indicating signal status */ 2329/* Return bit mask indicating signal status */
2340unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) 2330static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw)
2341{ 2331{
2342 unsigned int msk = 0; 2332 unsigned int msk = 0;
2343 switch (hdw->input_val) { 2333 switch (hdw->input_val) {
@@ -2424,7 +2414,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag)
2424 pvr2_trace(PVR2_TRACE_FIRMWARE, 2414 pvr2_trace(PVR2_TRACE_FIRMWARE,
2425 "Cleaning up after CPU firmware fetch"); 2415 "Cleaning up after CPU firmware fetch");
2426 kfree(hdw->fw_buffer); 2416 kfree(hdw->fw_buffer);
2427 hdw->fw_buffer = 0; 2417 hdw->fw_buffer = NULL;
2428 hdw->fw_size = 0; 2418 hdw->fw_size = 0;
2429 /* Now release the CPU. It will disconnect and 2419 /* Now release the CPU. It will disconnect and
2430 reconnect later. */ 2420 reconnect later. */
@@ -2519,22 +2509,6 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v)
2519} 2509}
2520 2510
2521 2511
2522void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw)
2523{
2524 if (!hdw->usb_dev) return;
2525 usb_settoggle(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0xf,
2526 !(PVR2_CTL_WRITE_ENDPOINT & USB_DIR_IN), 0);
2527 usb_settoggle(hdw->usb_dev, PVR2_CTL_READ_ENDPOINT & 0xf,
2528 !(PVR2_CTL_READ_ENDPOINT & USB_DIR_IN), 0);
2529 usb_clear_halt(hdw->usb_dev,
2530 usb_rcvbulkpipe(hdw->usb_dev,
2531 PVR2_CTL_READ_ENDPOINT & 0x7f));
2532 usb_clear_halt(hdw->usb_dev,
2533 usb_sndbulkpipe(hdw->usb_dev,
2534 PVR2_CTL_WRITE_ENDPOINT & 0x7f));
2535}
2536
2537
2538static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) 2512static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs)
2539{ 2513{
2540 struct pvr2_hdw *hdw = urb->context; 2514 struct pvr2_hdw *hdw = urb->context;
@@ -2568,10 +2542,10 @@ static void pvr2_ctl_timeout(unsigned long data)
2568} 2542}
2569 2543
2570 2544
2571int pvr2_send_request_ex(struct pvr2_hdw *hdw, 2545static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
2572 unsigned int timeout,int probe_fl, 2546 unsigned int timeout,int probe_fl,
2573 void *write_data,unsigned int write_len, 2547 void *write_data,unsigned int write_len,
2574 void *read_data,unsigned int read_len) 2548 void *read_data,unsigned int read_len)
2575{ 2549{
2576 unsigned int idx; 2550 unsigned int idx;
2577 int status = 0; 2551 int status = 0;
@@ -2826,7 +2800,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data)
2826} 2800}
2827 2801
2828 2802
2829int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) 2803static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data)
2830{ 2804{
2831 int ret = 0; 2805 int ret = 0;
2832 2806
@@ -2850,7 +2824,7 @@ int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data)
2850} 2824}
2851 2825
2852 2826
2853int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) 2827static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res)
2854{ 2828{
2855 int ret; 2829 int ret;
2856 2830
@@ -2867,7 +2841,7 @@ int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res)
2867} 2841}
2868 2842
2869 2843
2870int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) 2844static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res)
2871{ 2845{
2872 int ret; 2846 int ret;
2873 2847
@@ -2883,13 +2857,13 @@ int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res)
2883} 2857}
2884 2858
2885 2859
2886void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) 2860static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw)
2887{ 2861{
2888 if (!hdw->flag_ok) return; 2862 if (!hdw->flag_ok) return;
2889 pvr2_trace(PVR2_TRACE_INIT,"render_useless"); 2863 pvr2_trace(PVR2_TRACE_INIT,"render_useless");
2890 hdw->flag_ok = 0; 2864 hdw->flag_ok = 0;
2891 if (hdw->vid_stream) { 2865 if (hdw->vid_stream) {
2892 pvr2_stream_setup(hdw->vid_stream,0,0,0); 2866 pvr2_stream_setup(hdw->vid_stream,NULL,0,0);
2893 } 2867 }
2894 hdw->flag_streaming_enabled = 0; 2868 hdw->flag_streaming_enabled = 0;
2895 hdw->subsys_enabled_mask = 0; 2869 hdw->subsys_enabled_mask = 0;
@@ -2908,7 +2882,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw)
2908{ 2882{
2909 int ret; 2883 int ret;
2910 pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); 2884 pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset...");
2911 ret = usb_lock_device_for_reset(hdw->usb_dev,0); 2885 ret = usb_lock_device_for_reset(hdw->usb_dev,NULL);
2912 if (ret == 1) { 2886 if (ret == 1) {
2913 ret = usb_reset_device(hdw->usb_dev); 2887 ret = usb_reset_device(hdw->usb_dev);
2914 usb_unlock_device(hdw->usb_dev); 2888 usb_unlock_device(hdw->usb_dev);
@@ -2957,7 +2931,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw)
2957 pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); 2931 pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset");
2958 hdw->flag_ok = !0; 2932 hdw->flag_ok = !0;
2959 hdw->cmd_buffer[0] = 0xdd; 2933 hdw->cmd_buffer[0] = 0xdd;
2960 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); 2934 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
2961 } while (0); LOCK_GIVE(hdw->ctl_lock); 2935 } while (0); LOCK_GIVE(hdw->ctl_lock);
2962 return status; 2936 return status;
2963} 2937}
@@ -2969,7 +2943,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw)
2969 LOCK_TAKE(hdw->ctl_lock); do { 2943 LOCK_TAKE(hdw->ctl_lock); do {
2970 pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); 2944 pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup");
2971 hdw->cmd_buffer[0] = 0xde; 2945 hdw->cmd_buffer[0] = 0xde;
2972 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); 2946 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
2973 } while (0); LOCK_GIVE(hdw->ctl_lock); 2947 } while (0); LOCK_GIVE(hdw->ctl_lock);
2974 return status; 2948 return status;
2975} 2949}
@@ -2996,12 +2970,12 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
2996} 2970}
2997 2971
2998 2972
2999int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) 2973static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
3000{ 2974{
3001 int status; 2975 int status;
3002 LOCK_TAKE(hdw->ctl_lock); do { 2976 LOCK_TAKE(hdw->ctl_lock); do {
3003 hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); 2977 hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37);
3004 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); 2978 status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0);
3005 } while (0); LOCK_GIVE(hdw->ctl_lock); 2979 } while (0); LOCK_GIVE(hdw->ctl_lock);
3006 if (!status) { 2980 if (!status) {
3007 hdw->subsys_enabled_mask = 2981 hdw->subsys_enabled_mask =
@@ -3094,7 +3068,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
3094} 3068}
3095 3069
3096 3070
3097int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) 3071static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
3098{ 3072{
3099 int result; 3073 int result;
3100 LOCK_TAKE(hdw->ctl_lock); do { 3074 LOCK_TAKE(hdw->ctl_lock); do {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index 63f529154431..fd931b5da490 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -91,7 +91,6 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
91void pvr2_hdw_poll(struct pvr2_hdw *); 91void pvr2_hdw_poll(struct pvr2_hdw *);
92 92
93/* Trigger a poll to take place later at a convenient time */ 93/* Trigger a poll to take place later at a convenient time */
94void pvr2_hdw_poll_trigger(struct pvr2_hdw *);
95void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *); 94void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *);
96 95
97/* Register a callback used to trigger a future poll */ 96/* Register a callback used to trigger a future poll */
@@ -99,9 +98,6 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *,
99 void (*func)(void *), 98 void (*func)(void *),
100 void *data); 99 void *data);
101 100
102/* Get pointer to structure given unit number */
103struct pvr2_hdw *pvr2_hdw_find(int unit_number);
104
105/* Destroy hardware interaction structure */ 101/* Destroy hardware interaction structure */
106void pvr2_hdw_destroy(struct pvr2_hdw *); 102void pvr2_hdw_destroy(struct pvr2_hdw *);
107 103
@@ -180,12 +176,6 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
180void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, 176void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw,
181 unsigned long msk,unsigned long val); 177 unsigned long msk,unsigned long val);
182 178
183/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */
184void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk);
185
186/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */
187void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk);
188
189/* Retrieve mask indicating which pieces of hardware are currently enabled 179/* Retrieve mask indicating which pieces of hardware are currently enabled
190 / configured. */ 180 / configured. */
191unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *); 181unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *);
@@ -225,34 +215,18 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,int);
225/* The following entry points are all lower level things you normally don't 215/* The following entry points are all lower level things you normally don't
226 want to worry about. */ 216 want to worry about. */
227 217
228/* Attempt to recover from a USB foul-up (in practice I find that if you
229 have to do this, then it's already too late). */
230void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw);
231
232/* Issue a command and get a response from the device. LOTS of higher 218/* Issue a command and get a response from the device. LOTS of higher
233 level stuff is built on this. */ 219 level stuff is built on this. */
234int pvr2_send_request(struct pvr2_hdw *, 220int pvr2_send_request(struct pvr2_hdw *,
235 void *write_ptr,unsigned int write_len, 221 void *write_ptr,unsigned int write_len,
236 void *read_ptr,unsigned int read_len); 222 void *read_ptr,unsigned int read_len);
237 223
238/* Issue a command and get a response from the device. This extended
239 version includes a probe flag (which if set means that device errors
240 should not be logged or treated as fatal) and a timeout in jiffies.
241 This can be used to non-lethally probe the health of endpoint 1. */
242int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl,
243 void *write_ptr,unsigned int write_len,
244 void *read_ptr,unsigned int read_len);
245
246/* Slightly higher level device communication functions. */ 224/* Slightly higher level device communication functions. */
247int pvr2_write_register(struct pvr2_hdw *, u16, u32); 225int pvr2_write_register(struct pvr2_hdw *, u16, u32);
248int pvr2_read_register(struct pvr2_hdw *, u16, u32 *);
249int pvr2_write_u16(struct pvr2_hdw *, u16, int);
250int pvr2_write_u8(struct pvr2_hdw *, u8, int);
251 226
252/* Call if for any reason we can't talk to the hardware anymore - this will 227/* Call if for any reason we can't talk to the hardware anymore - this will
253 cause the driver to stop flailing on the device. */ 228 cause the driver to stop flailing on the device. */
254void pvr2_hdw_render_useless(struct pvr2_hdw *); 229void pvr2_hdw_render_useless(struct pvr2_hdw *);
255void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *);
256 230
257/* Set / clear 8051's reset bit */ 231/* Set / clear 8051's reset bit */
258void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int); 232void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int);
@@ -271,12 +245,6 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *);
271/* Order decoder to reset */ 245/* Order decoder to reset */
272int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); 246int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *);
273 247
274/* Stop / start video stream transport */
275int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
276
277/* Find I2C address of eeprom */
278int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *);
279
280/* Direct manipulation of GPIO bits */ 248/* Direct manipulation of GPIO bits */
281int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *); 249int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *);
282int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *); 250int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
index 1dd4f6249b99..fbe6039aeb6a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
@@ -25,7 +25,6 @@
25#include "pvrusb2-i2c-cmd-v4l2.h" 25#include "pvrusb2-i2c-cmd-v4l2.h"
26#include "pvrusb2-audio.h" 26#include "pvrusb2-audio.h"
27#include "pvrusb2-tuner.h" 27#include "pvrusb2-tuner.h"
28#include "pvrusb2-demod.h"
29#include "pvrusb2-video-v4l.h" 28#include "pvrusb2-video-v4l.h"
30#ifdef CONFIG_VIDEO_PVRUSB2_24XXX 29#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
31#include "pvrusb2-cx2584x-v4l.h" 30#include "pvrusb2-cx2584x-v4l.h"
@@ -89,11 +88,6 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
89 return; 88 return;
90 } 89 }
91 } 90 }
92 if (id == I2C_DRIVERID_TDA9887) {
93 if (pvr2_i2c_demod_setup(hdw,cp)) {
94 return;
95 }
96 }
97} 91}
98 92
99 93
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 9f81aff2b38a..8a9933dec912 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -196,7 +196,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = {
196static void do_log(struct pvr2_hdw *hdw) 196static void do_log(struct pvr2_hdw *hdw)
197{ 197{
198 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()"); 198 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()");
199 pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0); 199 pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,NULL);
200 200
201} 201}
202 202
@@ -217,7 +217,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = {
217void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) 217void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl)
218{ 218{
219 pvr2_i2c_client_cmd(cp, 219 pvr2_i2c_client_cmd(cp,
220 (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),0); 220 (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL);
221} 221}
222 222
223 223
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index c8d0bdee3ff1..7fca47982277 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -37,6 +37,10 @@ static unsigned int i2c_scan = 0;
37module_param(i2c_scan, int, S_IRUGO|S_IWUSR); 37module_param(i2c_scan, int, S_IRUGO|S_IWUSR);
38MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); 38MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
39 39
40static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp,
41 unsigned int detail,
42 char *buf,unsigned int maxlen);
43
40static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ 44static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
41 u8 i2c_addr, /* I2C address we're talking to */ 45 u8 i2c_addr, /* I2C address we're talking to */
42 u8 *data, /* Data to write */ 46 u8 *data, /* Data to write */
@@ -165,12 +169,12 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */
165 169
166/* This is the common low level entry point for doing I2C operations to the 170/* This is the common low level entry point for doing I2C operations to the
167 hardware. */ 171 hardware. */
168int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, 172static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw,
169 u8 i2c_addr, 173 u8 i2c_addr,
170 u8 *wdata, 174 u8 *wdata,
171 u16 wlen, 175 u16 wlen,
172 u8 *rdata, 176 u8 *rdata,
173 u16 rlen) 177 u16 rlen)
174{ 178{
175 if (!rdata) rlen = 0; 179 if (!rdata) rlen = 0;
176 if (!wdata) wlen = 0; 180 if (!wdata) wlen = 0;
@@ -267,7 +271,7 @@ static int i2c_hack_cx25840(struct pvr2_hdw *hdw,
267 "WARNING: Disabling further access to the device" 271 "WARNING: Disabling further access to the device"
268 " to prevent other foul-ups."); 272 " to prevent other foul-ups.");
269 // This blocks all further communication with the part. 273 // This blocks all further communication with the part.
270 hdw->i2c_func[0x44] = 0; 274 hdw->i2c_func[0x44] = NULL;
271 pvr2_hdw_render_useless(hdw); 275 pvr2_hdw_render_useless(hdw);
272 goto fail; 276 goto fail;
273 } 277 }
@@ -294,7 +298,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
294 int num) 298 int num)
295{ 299{
296 int ret = -ENOTSUPP; 300 int ret = -ENOTSUPP;
297 pvr2_i2c_func funcp = 0; 301 pvr2_i2c_func funcp = NULL;
298 struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data); 302 struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data);
299 303
300 if (!num) { 304 if (!num) {
@@ -319,7 +323,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
319 u16 tcnt,bcnt,offs; 323 u16 tcnt,bcnt,offs;
320 if (!msgs[0].len) { 324 if (!msgs[0].len) {
321 /* Length == 0 read. This is a probe. */ 325 /* Length == 0 read. This is a probe. */
322 if (funcp(hdw,msgs[0].addr,0,0,0,0)) { 326 if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) {
323 ret = -EIO; 327 ret = -EIO;
324 goto done; 328 goto done;
325 } 329 }
@@ -336,7 +340,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
336 if (bcnt > sizeof(hdw->cmd_buffer)-1) { 340 if (bcnt > sizeof(hdw->cmd_buffer)-1) {
337 bcnt = sizeof(hdw->cmd_buffer)-1; 341 bcnt = sizeof(hdw->cmd_buffer)-1;
338 } 342 }
339 if (funcp(hdw,msgs[0].addr,0,0, 343 if (funcp(hdw,msgs[0].addr,NULL,0,
340 msgs[0].buf+offs,bcnt)) { 344 msgs[0].buf+offs,bcnt)) {
341 ret = -EIO; 345 ret = -EIO;
342 goto done; 346 goto done;
@@ -350,7 +354,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
350 /* Simple write */ 354 /* Simple write */
351 ret = 1; 355 ret = 1;
352 if (funcp(hdw,msgs[0].addr, 356 if (funcp(hdw,msgs[0].addr,
353 msgs[0].buf,msgs[0].len,0,0)) { 357 msgs[0].buf,msgs[0].len,NULL,0)) {
354 ret = -EIO; 358 ret = -EIO;
355 } 359 }
356 goto done; 360 goto done;
@@ -705,9 +709,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw)
705 return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0; 709 return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0;
706} 710}
707 711
708unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, 712static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp,
709 unsigned int detail, 713 unsigned int detail,
710 char *buf,unsigned int maxlen) 714 char *buf,unsigned int maxlen)
711{ 715{
712 unsigned int ccnt,bcnt; 716 unsigned int ccnt,bcnt;
713 int spcfl = 0; 717 int spcfl = 0;
@@ -871,7 +875,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw)
871 msg[0].addr = 0; 875 msg[0].addr = 0;
872 msg[0].flags = I2C_M_RD; 876 msg[0].flags = I2C_M_RD;
873 msg[0].len = 0; 877 msg[0].len = 0;
874 msg[0].buf = 0; 878 msg[0].buf = NULL;
875 printk("%s: i2c scan beginning\n",hdw->name); 879 printk("%s: i2c scan beginning\n",hdw->name);
876 for (i = 0; i < 128; i++) { 880 for (i = 0; i < 128; i++) {
877 msg[0].addr = i; 881 msg[0].addr = i;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h
index e8af5b0ed3ce..6d7e25247576 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h
@@ -75,9 +75,6 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *,char *buf,unsigned int maxlen);
75 PVR2_I2C_DETAIL_DEBUG |\ 75 PVR2_I2C_DETAIL_DEBUG |\
76 PVR2_I2C_DETAIL_HANDLER |\ 76 PVR2_I2C_DETAIL_HANDLER |\
77 PVR2_I2C_DETAIL_CTLMASK) 77 PVR2_I2C_DETAIL_CTLMASK)
78unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *,
79 unsigned int detail_mask,
80 char *buf,unsigned int maxlen);
81 78
82void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *); 79void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *);
83const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx); 80const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c
index a984c91f571c..681f79c8064e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.c
@@ -93,7 +93,7 @@ struct pvr2_buffer {
93 struct urb *purb; 93 struct urb *purb;
94}; 94};
95 95
96const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) 96static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st)
97{ 97{
98 switch (st) { 98 switch (st) {
99 case pvr2_buffer_state_none: return "none"; 99 case pvr2_buffer_state_none: return "none";
@@ -104,7 +104,8 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st)
104 return "unknown"; 104 return "unknown";
105} 105}
106 106
107void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) 107#ifdef SANITY_CHECK_BUFFERS
108static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg)
108{ 109{
109 pvr2_trace(PVR2_TRACE_INFO, 110 pvr2_trace(PVR2_TRACE_INFO,
110 "buffer%s%s %p state=%s id=%d status=%d" 111 "buffer%s%s %p state=%s id=%d status=%d"
@@ -115,10 +116,11 @@ void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg)
115 (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"), 116 (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"),
116 (bp ? bp->id : 0), 117 (bp ? bp->id : 0),
117 (bp ? bp->status : 0), 118 (bp ? bp->status : 0),
118 (bp ? bp->stream : 0), 119 (bp ? bp->stream : NULL),
119 (bp ? bp->purb : 0), 120 (bp ? bp->purb : NULL),
120 (bp ? bp->signature : 0)); 121 (bp ? bp->signature : 0));
121} 122}
123#endif /* SANITY_CHECK_BUFFERS */
122 124
123static void pvr2_buffer_remove(struct pvr2_buffer *bp) 125static void pvr2_buffer_remove(struct pvr2_buffer *bp)
124{ 126{
@@ -284,7 +286,7 @@ static void pvr2_buffer_done(struct pvr2_buffer *bp)
284 pvr2_buffer_wipe(bp); 286 pvr2_buffer_wipe(bp);
285 pvr2_buffer_set_none(bp); 287 pvr2_buffer_set_none(bp);
286 bp->signature = 0; 288 bp->signature = 0;
287 bp->stream = 0; 289 bp->stream = NULL;
288 if (bp->purb) usb_free_urb(bp->purb); 290 if (bp->purb) usb_free_urb(bp->purb);
289 pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/" 291 pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/"
290 " bufferDone %p",bp); 292 " bufferDone %p",bp);
@@ -339,13 +341,13 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
339 struct pvr2_buffer *bp; 341 struct pvr2_buffer *bp;
340 bp = sp->buffers[sp->buffer_total_count - 1]; 342 bp = sp->buffers[sp->buffer_total_count - 1];
341 /* Paranoia */ 343 /* Paranoia */
342 sp->buffers[sp->buffer_total_count - 1] = 0; 344 sp->buffers[sp->buffer_total_count - 1] = NULL;
343 (sp->buffer_total_count)--; 345 (sp->buffer_total_count)--;
344 pvr2_buffer_done(bp); 346 pvr2_buffer_done(bp);
345 kfree(bp); 347 kfree(bp);
346 } 348 }
347 if (scnt < sp->buffer_slot_count) { 349 if (scnt < sp->buffer_slot_count) {
348 struct pvr2_buffer **nb = 0; 350 struct pvr2_buffer **nb = NULL;
349 if (scnt) { 351 if (scnt) {
350 nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL); 352 nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL);
351 if (!nb) return -ENOMEM; 353 if (!nb) return -ENOMEM;
@@ -513,10 +515,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp,
513} 515}
514 516
515/* Query / set the nominal buffer count */ 517/* Query / set the nominal buffer count */
516int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)
517{
518 return sp->buffer_target_count;
519}
520 518
521int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) 519int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
522{ 520{
@@ -532,21 +530,21 @@ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
532struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp) 530struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp)
533{ 531{
534 struct list_head *lp = sp->idle_list.next; 532 struct list_head *lp = sp->idle_list.next;
535 if (lp == &sp->idle_list) return 0; 533 if (lp == &sp->idle_list) return NULL;
536 return list_entry(lp,struct pvr2_buffer,list_overhead); 534 return list_entry(lp,struct pvr2_buffer,list_overhead);
537} 535}
538 536
539struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp) 537struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp)
540{ 538{
541 struct list_head *lp = sp->ready_list.next; 539 struct list_head *lp = sp->ready_list.next;
542 if (lp == &sp->ready_list) return 0; 540 if (lp == &sp->ready_list) return NULL;
543 return list_entry(lp,struct pvr2_buffer,list_overhead); 541 return list_entry(lp,struct pvr2_buffer,list_overhead);
544} 542}
545 543
546struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id) 544struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id)
547{ 545{
548 if (id < 0) return 0; 546 if (id < 0) return NULL;
549 if (id >= sp->buffer_total_count) return 0; 547 if (id >= sp->buffer_total_count) return NULL;
550 return sp->buffers[id]; 548 return sp->buffers[id];
551} 549}
552 550
@@ -555,17 +553,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp)
555 return sp->r_count; 553 return sp->r_count;
556} 554}
557 555
558int pvr2_stream_get_idle_count(struct pvr2_stream *sp)
559{
560 return sp->i_count;
561}
562
563void pvr2_stream_flush(struct pvr2_stream *sp)
564{
565 mutex_lock(&sp->mutex); do {
566 pvr2_stream_internal_flush(sp);
567 } while(0); mutex_unlock(&sp->mutex);
568}
569 556
570void pvr2_stream_kill(struct pvr2_stream *sp) 557void pvr2_stream_kill(struct pvr2_stream *sp)
571{ 558{
@@ -620,20 +607,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp)
620 return ret; 607 return ret;
621} 608}
622 609
623int pvr2_buffer_idle(struct pvr2_buffer *bp)
624{
625 struct pvr2_stream *sp;
626 if (!bp) return -EINVAL;
627 sp = bp->stream;
628 mutex_lock(&sp->mutex); do {
629 pvr2_buffer_wipe(bp);
630 pvr2_buffer_set_idle(bp);
631 if (sp->buffer_total_count != sp->buffer_target_count) {
632 pvr2_stream_achieve_buffer_count(sp);
633 }
634 } while(0); mutex_unlock(&sp->mutex);
635 return 0;
636}
637 610
638int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) 611int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)
639{ 612{
@@ -673,10 +646,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp)
673 return bp->status; 646 return bp->status;
674} 647}
675 648
676enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp)
677{
678 return bp->state;
679}
680 649
681int pvr2_buffer_get_id(struct pvr2_buffer *bp) 650int pvr2_buffer_get_id(struct pvr2_buffer *bp)
682{ 651{
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.h b/drivers/media/video/pvrusb2/pvrusb2-io.h
index 65e11385b2b3..96285ad234a6 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.h
@@ -36,8 +36,6 @@ enum pvr2_buffer_state {
36struct pvr2_stream; 36struct pvr2_stream;
37struct pvr2_buffer; 37struct pvr2_buffer;
38 38
39const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);
40
41/* Initialize / tear down stream structure */ 39/* Initialize / tear down stream structure */
42struct pvr2_stream *pvr2_stream_create(void); 40struct pvr2_stream *pvr2_stream_create(void);
43void pvr2_stream_destroy(struct pvr2_stream *); 41void pvr2_stream_destroy(struct pvr2_stream *);
@@ -49,7 +47,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *,
49 void *data); 47 void *data);
50 48
51/* Query / set the nominal buffer count */ 49/* Query / set the nominal buffer count */
52int pvr2_stream_get_buffer_count(struct pvr2_stream *);
53int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int); 50int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);
54 51
55/* Get a pointer to a buffer that is either idle, ready, or is specified 52/* Get a pointer to a buffer that is either idle, ready, or is specified
@@ -59,12 +56,8 @@ struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *);
59struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id); 56struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
60 57
61/* Find out how many buffers are idle or ready */ 58/* Find out how many buffers are idle or ready */
62int pvr2_stream_get_idle_count(struct pvr2_stream *);
63int pvr2_stream_get_ready_count(struct pvr2_stream *); 59int pvr2_stream_get_ready_count(struct pvr2_stream *);
64 60
65/* Kill all pending operations */
66void pvr2_stream_flush(struct pvr2_stream *);
67
68/* Kill all pending buffers and throw away any ready buffers as well */ 61/* Kill all pending buffers and throw away any ready buffers as well */
69void pvr2_stream_kill(struct pvr2_stream *); 62void pvr2_stream_kill(struct pvr2_stream *);
70 63
@@ -77,18 +70,12 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *);
77/* Retrieve completion code for given ready buffer */ 70/* Retrieve completion code for given ready buffer */
78int pvr2_buffer_get_status(struct pvr2_buffer *); 71int pvr2_buffer_get_status(struct pvr2_buffer *);
79 72
80/* Retrieve state of given buffer */
81enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *);
82
83/* Retrieve ID of given buffer */ 73/* Retrieve ID of given buffer */
84int pvr2_buffer_get_id(struct pvr2_buffer *); 74int pvr2_buffer_get_id(struct pvr2_buffer *);
85 75
86/* Start reading into given buffer (kill it if needed) */ 76/* Start reading into given buffer (kill it if needed) */
87int pvr2_buffer_queue(struct pvr2_buffer *); 77int pvr2_buffer_queue(struct pvr2_buffer *);
88 78
89/* Move buffer back to idle pool (kill it if needed) */
90int pvr2_buffer_idle(struct pvr2_buffer *);
91
92#endif /* __PVRUSB2_IO_H */ 79#endif /* __PVRUSB2_IO_H */
93 80
94/* 81/*
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
index 49da062e3271..f7a2e225a002 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
@@ -54,7 +54,7 @@ static int pvr2_ioread_init(struct pvr2_ioread *cp)
54{ 54{
55 unsigned int idx; 55 unsigned int idx;
56 56
57 cp->stream = 0; 57 cp->stream = NULL;
58 mutex_init(&cp->mutex); 58 mutex_init(&cp->mutex);
59 59
60 for (idx = 0; idx < BUFFER_COUNT; idx++) { 60 for (idx = 0; idx < BUFFER_COUNT; idx++) {
@@ -77,7 +77,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp)
77{ 77{
78 unsigned int idx; 78 unsigned int idx;
79 79
80 pvr2_ioread_setup(cp,0); 80 pvr2_ioread_setup(cp,NULL);
81 for (idx = 0; idx < BUFFER_COUNT; idx++) { 81 for (idx = 0; idx < BUFFER_COUNT; idx++) {
82 if (!(cp->buffer_storage[idx])) continue; 82 if (!(cp->buffer_storage[idx])) continue;
83 kfree(cp->buffer_storage[idx]); 83 kfree(cp->buffer_storage[idx]);
@@ -88,12 +88,12 @@ struct pvr2_ioread *pvr2_ioread_create(void)
88{ 88{
89 struct pvr2_ioread *cp; 89 struct pvr2_ioread *cp;
90 cp = kmalloc(sizeof(*cp),GFP_KERNEL); 90 cp = kmalloc(sizeof(*cp),GFP_KERNEL);
91 if (!cp) return 0; 91 if (!cp) return NULL;
92 pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); 92 pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp);
93 memset(cp,0,sizeof(*cp)); 93 memset(cp,0,sizeof(*cp));
94 if (pvr2_ioread_init(cp) < 0) { 94 if (pvr2_ioread_init(cp) < 0) {
95 kfree(cp); 95 kfree(cp);
96 return 0; 96 return NULL;
97 } 97 }
98 return cp; 98 return cp;
99} 99}
@@ -105,7 +105,7 @@ void pvr2_ioread_destroy(struct pvr2_ioread *cp)
105 pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp); 105 pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp);
106 if (cp->sync_key_ptr) { 106 if (cp->sync_key_ptr) {
107 kfree(cp->sync_key_ptr); 107 kfree(cp->sync_key_ptr);
108 cp->sync_key_ptr = 0; 108 cp->sync_key_ptr = NULL;
109 } 109 }
110 kfree(cp); 110 kfree(cp);
111} 111}
@@ -124,7 +124,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *cp,
124 if (sync_key_len != cp->sync_key_len) { 124 if (sync_key_len != cp->sync_key_len) {
125 if (cp->sync_key_ptr) { 125 if (cp->sync_key_ptr) {
126 kfree(cp->sync_key_ptr); 126 kfree(cp->sync_key_ptr);
127 cp->sync_key_ptr = 0; 127 cp->sync_key_ptr = NULL;
128 } 128 }
129 cp->sync_key_len = 0; 129 cp->sync_key_len = 0;
130 if (sync_key_len) { 130 if (sync_key_len) {
@@ -144,8 +144,8 @@ static void pvr2_ioread_stop(struct pvr2_ioread *cp)
144 pvr2_trace(PVR2_TRACE_START_STOP, 144 pvr2_trace(PVR2_TRACE_START_STOP,
145 "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp); 145 "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp);
146 pvr2_stream_kill(cp->stream); 146 pvr2_stream_kill(cp->stream);
147 cp->c_buf = 0; 147 cp->c_buf = NULL;
148 cp->c_data_ptr = 0; 148 cp->c_data_ptr = NULL;
149 cp->c_data_len = 0; 149 cp->c_data_len = 0;
150 cp->c_data_offs = 0; 150 cp->c_data_offs = 0;
151 cp->enabled = 0; 151 cp->enabled = 0;
@@ -179,8 +179,8 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
179 } 179 }
180 } 180 }
181 cp->enabled = !0; 181 cp->enabled = !0;
182 cp->c_buf = 0; 182 cp->c_buf = NULL;
183 cp->c_data_ptr = 0; 183 cp->c_data_ptr = NULL;
184 cp->c_data_len = 0; 184 cp->c_data_len = 0;
185 cp->c_data_offs = 0; 185 cp->c_data_offs = 0;
186 cp->stream_running = 0; 186 cp->stream_running = 0;
@@ -214,7 +214,7 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
214 pvr2_ioread_stop(cp); 214 pvr2_ioread_stop(cp);
215 pvr2_stream_kill(cp->stream); 215 pvr2_stream_kill(cp->stream);
216 pvr2_stream_set_buffer_count(cp->stream,0); 216 pvr2_stream_set_buffer_count(cp->stream,0);
217 cp->stream = 0; 217 cp->stream = NULL;
218 } 218 }
219 if (sp) { 219 if (sp) {
220 pvr2_trace(PVR2_TRACE_START_STOP, 220 pvr2_trace(PVR2_TRACE_START_STOP,
@@ -251,12 +251,8 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
251 return ret; 251 return ret;
252} 252}
253 253
254int pvr2_ioread_get_enabled(struct pvr2_ioread *cp)
255{
256 return cp->enabled != 0;
257}
258 254
259int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) 255static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
260{ 256{
261 int stat; 257 int stat;
262 258
@@ -274,8 +270,8 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
274 pvr2_ioread_stop(cp); 270 pvr2_ioread_stop(cp);
275 return 0; 271 return 0;
276 } 272 }
277 cp->c_buf = 0; 273 cp->c_buf = NULL;
278 cp->c_data_ptr = 0; 274 cp->c_data_ptr = NULL;
279 cp->c_data_len = 0; 275 cp->c_data_len = 0;
280 cp->c_data_offs = 0; 276 cp->c_data_offs = 0;
281 } 277 }
@@ -307,7 +303,7 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
307 return !0; 303 return !0;
308} 304}
309 305
310void pvr2_ioread_filter(struct pvr2_ioread *cp) 306static void pvr2_ioread_filter(struct pvr2_ioread *cp)
311{ 307{
312 unsigned int idx; 308 unsigned int idx;
313 if (!cp->enabled) return; 309 if (!cp->enabled) return;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.h b/drivers/media/video/pvrusb2/pvrusb2-ioread.h
index 6b002597f5de..1d362f833588 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.h
@@ -33,7 +33,6 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *,
33 const char *sync_key_ptr, 33 const char *sync_key_ptr,
34 unsigned int sync_key_len); 34 unsigned int sync_key_len);
35int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl); 35int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl);
36int pvr2_ioread_get_enabled(struct pvr2_ioread *);
37int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt); 36int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt);
38int pvr2_ioread_avail(struct pvr2_ioread *); 37int pvr2_ioread_avail(struct pvr2_ioread *);
39 38
diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c
index b95248274ed0..8f1a5afdd34e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-main.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-main.c
@@ -54,7 +54,7 @@ module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR);
54MODULE_PARM_DESC(debug, "Debug trace mask"); 54MODULE_PARM_DESC(debug, "Debug trace mask");
55 55
56#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS 56#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
57static struct pvr2_sysfs_class *class_ptr = 0; 57static struct pvr2_sysfs_class *class_ptr = NULL;
58#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ 58#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
59 59
60static void pvr_setup_attach(struct pvr2_context *pvr) 60static void pvr_setup_attach(struct pvr2_context *pvr)
@@ -104,10 +104,10 @@ static void pvr_disconnect(struct usb_interface *intf)
104} 104}
105 105
106static struct usb_driver pvr_driver = { 106static struct usb_driver pvr_driver = {
107 name: "pvrusb2", 107 .name = "pvrusb2",
108 id_table: pvr2_device_table, 108 .id_table = pvr2_device_table,
109 probe: pvr_probe, 109 .probe = pvr_probe,
110 disconnect: pvr_disconnect 110 .disconnect = pvr_disconnect
111}; 111};
112 112
113/* 113/*
diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c
index 134063693643..f95c598ff627 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-std.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-std.c
@@ -121,7 +121,7 @@ static const struct std_name *find_std_name(const struct std_name *arrPtr,
121 if (strlen(p->name) != bufSize) continue; 121 if (strlen(p->name) != bufSize) continue;
122 if (!memcmp(bufPtr,p->name,bufSize)) return p; 122 if (!memcmp(bufPtr,p->name,bufSize)) return p;
123 } 123 }
124 return 0; 124 return NULL;
125} 125}
126 126
127 127
@@ -289,7 +289,7 @@ static struct v4l2_standard *match_std(v4l2_std_id id)
289 return generic_standards + idx; 289 return generic_standards + idx;
290 } 290 }
291 } 291 }
292 return 0; 292 return NULL;
293} 293}
294 294
295static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id) 295static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id)
@@ -364,7 +364,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
364 364
365 pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)", 365 pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)",
366 std_cnt); 366 std_cnt);
367 if (!std_cnt) return 0; // paranoia 367 if (!std_cnt) return NULL; // paranoia
368 368
369 stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt, 369 stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt,
370 GFP_KERNEL); 370 GFP_KERNEL);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index c6e6523d74b4..6af55a8b6f05 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -504,7 +504,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
504 cip->cptr = cptr; 504 cip->cptr = cptr;
505 505
506 cip->chptr = sfp; 506 cip->chptr = sfp;
507 cip->item_next = 0; 507 cip->item_next = NULL;
508 if (sfp->item_last) { 508 if (sfp->item_last) {
509 sfp->item_last->item_next = cip; 509 sfp->item_last->item_next = cip;
510 } else { 510 } else {
@@ -625,7 +625,7 @@ static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp)
625 &sfp->debugifc->attr_debuginfo); 625 &sfp->debugifc->attr_debuginfo);
626 class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); 626 class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd);
627 kfree(sfp->debugifc); 627 kfree(sfp->debugifc);
628 sfp->debugifc = 0; 628 sfp->debugifc = NULL;
629} 629}
630#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ 630#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
631 631
@@ -678,9 +678,9 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp)
678 class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 678 class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
679 class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); 679 class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number);
680 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); 680 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
681 sfp->class_dev->class_data = 0; 681 sfp->class_dev->class_data = NULL;
682 class_device_unregister(sfp->class_dev); 682 class_device_unregister(sfp->class_dev);
683 sfp->class_dev = 0; 683 sfp->class_dev = NULL;
684} 684}
685 685
686 686
@@ -739,13 +739,13 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
739 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; 739 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
740 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; 740 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
741 sfp->attr_v4l_minor_number.show = v4l_minor_number_show; 741 sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
742 sfp->attr_v4l_minor_number.store = 0; 742 sfp->attr_v4l_minor_number.store = NULL;
743 class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 743 class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number);
744 sfp->attr_unit_number.attr.owner = THIS_MODULE; 744 sfp->attr_unit_number.attr.owner = THIS_MODULE;
745 sfp->attr_unit_number.attr.name = "unit_number"; 745 sfp->attr_unit_number.attr.name = "unit_number";
746 sfp->attr_unit_number.attr.mode = S_IRUGO; 746 sfp->attr_unit_number.attr.mode = S_IRUGO;
747 sfp->attr_unit_number.show = unit_number_show; 747 sfp->attr_unit_number.show = unit_number_show;
748 sfp->attr_unit_number.store = 0; 748 sfp->attr_unit_number.store = NULL;
749 class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); 749 class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
750 750
751 pvr2_sysfs_add_controls(sfp); 751 pvr2_sysfs_add_controls(sfp);
@@ -806,7 +806,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
806 pvr2_sysfs_trace( 806 pvr2_sysfs_trace(
807 "Registration failed for pvr2_sysfs_class id=%p",clp); 807 "Registration failed for pvr2_sysfs_class id=%p",clp);
808 kfree(clp); 808 kfree(clp);
809 clp = 0; 809 clp = NULL;
810 } 810 }
811 return clp; 811 return clp;
812} 812}
diff --git a/drivers/media/video/pvrusb2/pvrusb2-tuner.c b/drivers/media/video/pvrusb2/pvrusb2-tuner.c
index f4aba8144ce0..af9f246f8d3f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-tuner.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-tuner.c
@@ -69,7 +69,7 @@ static void tuner_update(struct pvr2_tuner_handler *ctxt)
69 69
70static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt) 70static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt)
71{ 71{
72 ctxt->client->handler = 0; 72 ctxt->client->handler = NULL;
73 kfree(ctxt); 73 kfree(ctxt);
74} 74}
75 75
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 961951010c27..0caf70b8c0de 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -81,7 +81,7 @@ static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
81module_param_array(video_nr, int, NULL, 0444); 81module_param_array(video_nr, int, NULL, 0444);
82MODULE_PARM_DESC(video_nr, "Offset for device's minor"); 82MODULE_PARM_DESC(video_nr, "Offset for device's minor");
83 83
84struct v4l2_capability pvr_capability ={ 84static struct v4l2_capability pvr_capability ={
85 .driver = "pvrusb2", 85 .driver = "pvrusb2",
86 .card = "Hauppauge WinTV pvr-usb2", 86 .card = "Hauppauge WinTV pvr-usb2",
87 .bus_info = "usb", 87 .bus_info = "usb",
@@ -111,7 +111,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= {
111 } 111 }
112}; 112};
113 113
114struct v4l2_fmtdesc pvr_fmtdesc [] = { 114static struct v4l2_fmtdesc pvr_fmtdesc [] = {
115 { 115 {
116 .index = 0, 116 .index = 0,
117 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 117 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
@@ -127,7 +127,7 @@ struct v4l2_fmtdesc pvr_fmtdesc [] = {
127#define PVR_FORMAT_PIX 0 127#define PVR_FORMAT_PIX 0
128#define PVR_FORMAT_VBI 1 128#define PVR_FORMAT_VBI 1
129 129
130struct v4l2_format pvr_format [] = { 130static struct v4l2_format pvr_format [] = {
131 [PVR_FORMAT_PIX] = { 131 [PVR_FORMAT_PIX] = {
132 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 132 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
133 .fmt = { 133 .fmt = {
@@ -701,9 +701,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
701 701
702static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) 702static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
703{ 703{
704 pvr2_trace(PVR2_TRACE_INIT, 704 printk(KERN_INFO "pvrusb2: unregistering device video%d [%s]\n",
705 "unregistering device video%d [%s]", 705 dip->vdev->minor,pvr2_config_get_name(dip->config));
706 dip->vdev->minor,pvr2_config_get_name(dip->config));
707 if (dip->ctxt_idx >= 0) { 706 if (dip->ctxt_idx >= 0) {
708 mutex_lock(&device_lock); 707 mutex_lock(&device_lock);
709 devices[dip->ctxt_idx] = NULL; 708 devices[dip->ctxt_idx] = NULL;
@@ -725,7 +724,7 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp)
725} 724}
726 725
727 726
728void pvr2_v4l2_internal_check(struct pvr2_channel *chp) 727static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
729{ 728{
730 struct pvr2_v4l2 *vp; 729 struct pvr2_v4l2 *vp;
731 vp = container_of(chp,struct pvr2_v4l2,channel); 730 vp = container_of(chp,struct pvr2_v4l2,channel);
@@ -735,8 +734,8 @@ void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
735} 734}
736 735
737 736
738int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, 737static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
739 unsigned int cmd, unsigned long arg) 738 unsigned int cmd, unsigned long arg)
740{ 739{
741 740
742/* Temporary hack : use ivtv api until a v4l2 one is available. */ 741/* Temporary hack : use ivtv api until a v4l2 one is available. */
@@ -747,7 +746,7 @@ int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
747} 746}
748 747
749 748
750int pvr2_v4l2_release(struct inode *inode, struct file *file) 749static int pvr2_v4l2_release(struct inode *inode, struct file *file)
751{ 750{
752 struct pvr2_v4l2_fh *fhp = file->private_data; 751 struct pvr2_v4l2_fh *fhp = file->private_data;
753 struct pvr2_v4l2 *vp = fhp->vhead; 752 struct pvr2_v4l2 *vp = fhp->vhead;
@@ -761,9 +760,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
761 hdw = fhp->channel.mc_head->hdw; 760 hdw = fhp->channel.mc_head->hdw;
762 pvr2_hdw_set_streaming(hdw,0); 761 pvr2_hdw_set_streaming(hdw,0);
763 sp = pvr2_ioread_get_stream(fhp->rhp); 762 sp = pvr2_ioread_get_stream(fhp->rhp);
764 if (sp) pvr2_stream_set_callback(sp,0,0); 763 if (sp) pvr2_stream_set_callback(sp,NULL,NULL);
765 pvr2_ioread_destroy(fhp->rhp); 764 pvr2_ioread_destroy(fhp->rhp);
766 fhp->rhp = 0; 765 fhp->rhp = NULL;
767 } 766 }
768 v4l2_prio_close(&vp->prio, &fhp->prio); 767 v4l2_prio_close(&vp->prio, &fhp->prio);
769 file->private_data = NULL; 768 file->private_data = NULL;
@@ -779,9 +778,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
779 } else { 778 } else {
780 vp->vfirst = fhp->vnext; 779 vp->vfirst = fhp->vnext;
781 } 780 }
782 fhp->vnext = 0; 781 fhp->vnext = NULL;
783 fhp->vprev = 0; 782 fhp->vprev = NULL;
784 fhp->vhead = 0; 783 fhp->vhead = NULL;
785 pvr2_channel_done(&fhp->channel); 784 pvr2_channel_done(&fhp->channel);
786 pvr2_trace(PVR2_TRACE_STRUCT, 785 pvr2_trace(PVR2_TRACE_STRUCT,
787 "Destroying pvr_v4l2_fh id=%p",fhp); 786 "Destroying pvr_v4l2_fh id=%p",fhp);
@@ -794,9 +793,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file)
794} 793}
795 794
796 795
797int pvr2_v4l2_open(struct inode *inode, struct file *file) 796static int pvr2_v4l2_open(struct inode *inode, struct file *file)
798{ 797{
799 struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */ 798 struct pvr2_v4l2_dev *dip = NULL; /* Our own context pointer */
800 struct pvr2_v4l2_fh *fhp; 799 struct pvr2_v4l2_fh *fhp;
801 struct pvr2_v4l2 *vp; 800 struct pvr2_v4l2 *vp;
802 struct pvr2_hdw *hdw; 801 struct pvr2_hdw *hdw;
@@ -854,7 +853,7 @@ int pvr2_v4l2_open(struct inode *inode, struct file *file)
854 pvr2_context_enter(vp->channel.mc_head); do { 853 pvr2_context_enter(vp->channel.mc_head); do {
855 pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp); 854 pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp);
856 pvr2_channel_init(&fhp->channel,vp->channel.mc_head); 855 pvr2_channel_init(&fhp->channel,vp->channel.mc_head);
857 fhp->vnext = 0; 856 fhp->vnext = NULL;
858 fhp->vprev = vp->vlast; 857 fhp->vprev = vp->vlast;
859 if (vp->vlast) { 858 if (vp->vlast) {
860 vp->vlast->vnext = fhp; 859 vp->vlast->vnext = fhp;
@@ -897,7 +896,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
897 896
898 fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream); 897 fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream);
899 if (!fh->rhp) { 898 if (!fh->rhp) {
900 pvr2_channel_claim_stream(&fh->channel,0); 899 pvr2_channel_claim_stream(&fh->channel,NULL);
901 return -ENOMEM; 900 return -ENOMEM;
902 } 901 }
903 902
@@ -1078,9 +1077,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1078 (video_register_device(dip->vdev, v4l_type, -1) < 0)) { 1077 (video_register_device(dip->vdev, v4l_type, -1) < 0)) {
1079 err("Failed to register pvrusb2 v4l video device"); 1078 err("Failed to register pvrusb2 v4l video device");
1080 } else { 1079 } else {
1081 pvr2_trace(PVR2_TRACE_INIT, 1080 printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n",
1082 "registered device video%d [%s]", 1081 dip->vdev->minor,pvr2_config_get_name(dip->config));
1083 dip->vdev->minor,pvr2_config_get_name(dip->config));
1084 } 1082 }
1085 1083
1086 if ((dip->vdev->minor < sizeof(devices)/sizeof(devices[0])) && 1084 if ((dip->vdev->minor < sizeof(devices)/sizeof(devices[0])) &&
diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
index e4ec7f25194c..05f2cddeb47b 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
@@ -126,8 +126,8 @@ static const struct pvr2_v4l_decoder_ops decoder_ops[] = {
126 126
127static void decoder_detach(struct pvr2_v4l_decoder *ctxt) 127static void decoder_detach(struct pvr2_v4l_decoder *ctxt)
128{ 128{
129 ctxt->client->handler = 0; 129 ctxt->client->handler = NULL;
130 ctxt->hdw->decoder_ctrl = 0; 130 ctxt->hdw->decoder_ctrl = NULL;
131 kfree(ctxt); 131 kfree(ctxt);
132} 132}
133 133
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
index fcad346e3955..2413e5198e16 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
@@ -89,7 +89,7 @@ static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt,
89 89
90static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt) 90static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt)
91{ 91{
92 ctxt->client->handler = 0; 92 ctxt->client->handler = NULL;
93 kfree(ctxt); 93 kfree(ctxt);
94} 94}
95 95
diff --git a/drivers/media/video/pwc/pwc-uncompress.h b/drivers/media/video/pwc/pwc-uncompress.h
index 041227f65246..43028e74e9e0 100644
--- a/drivers/media/video/pwc/pwc-uncompress.h
+++ b/drivers/media/video/pwc/pwc-uncompress.h
@@ -30,7 +30,6 @@
30#ifndef PWC_UNCOMPRESS_H 30#ifndef PWC_UNCOMPRESS_H
31#define PWC_UNCOMPRESS_H 31#define PWC_UNCOMPRESS_H
32 32
33#include <linux/config.h>
34 33
35#include <media/pwc-ioctl.h> 34#include <media/pwc-ioctl.h>
36 35
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index 629f79e44fb6..7e9c4237d1e8 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -25,7 +25,6 @@
25#ifndef PWC_H 25#ifndef PWC_H
26#define PWC_H 26#define PWC_H
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/usb.h> 29#include <linux/usb.h>
31#include <linux/spinlock.h> 30#include <linux/spinlock.h>
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index da3007d2f411..535172f643b9 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -20,7 +20,6 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/list.h> 24#include <linux/list.h>
26#include <linux/module.h> 25#include <linux/module.h>
@@ -942,8 +941,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
942 /* load i2c helpers */ 941 /* load i2c helpers */
943 if (TUNER_ABSENT != dev->tuner_type) 942 if (TUNER_ABSENT != dev->tuner_type)
944 request_module("tuner"); 943 request_module("tuner");
945 if (dev->tda9887_conf)
946 request_module("tda9887");
947 if (card_is_empress(dev)) { 944 if (card_is_empress(dev)) {
948 request_module("saa6752hs"); 945 request_module("saa6752hs");
949 request_module_depend("saa7134-empress",&need_empress); 946 request_module_depend("saa7134-empress",&need_empress);
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index a846ebc78cd7..67987baee77a 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -27,7 +27,6 @@
27 27
28static const char version[] = "0.24"; 28static const char version[] = "0.24";
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/init.h> 31#include <linux/init.h>
33#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 351b182d921f..2ba2991a214f 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -58,7 +58,6 @@
58 * Fixed proc entry removal bug. 58 * Fixed proc entry removal bug.
59 */ 59 */
60 60
61#include <linux/config.h>
62#include <linux/module.h> 61#include <linux/module.h>
63#include <linux/init.h> 62#include <linux/init.h>
64#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 2fadabf99688..8dab481d384a 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -590,8 +590,8 @@ int tda9887_tuner_init(struct i2c_client *c)
590 t->set_tv_freq = tda9887_set_freq; 590 t->set_tv_freq = tda9887_set_freq;
591 t->set_radio_freq = tda9887_set_freq; 591 t->set_radio_freq = tda9887_set_freq;
592 t->standby = tda9887_standby; 592 t->standby = tda9887_standby;
593 t->tuner_status=tda9887_tuner_status; 593 t->tuner_status = tda9887_tuner_status;
594 t->get_afc=tda9887_get_afc; 594 t->get_afc = tda9887_get_afc;
595 595
596 return 0; 596 return 0;
597} 597}
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 011413cf34a8..f7eb402d5f2b 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -416,7 +416,7 @@ static void tuner_status(struct i2c_client *client)
416 416
417/* ---------------------------------------------------------------------- */ 417/* ---------------------------------------------------------------------- */
418 418
419/* static var Used only in tuner_attach and tuner_probe */ 419/* static vars: used only in tuner_attach and tuner_probe */
420static unsigned default_mode_mask; 420static unsigned default_mode_mask;
421 421
422/* During client attach, set_type is called by adapter's attach_inform callback. 422/* During client attach, set_type is called by adapter's attach_inform callback.
@@ -608,13 +608,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
608 tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 608 tuner_dbg("VIDIOCSAUDIO not implemented.\n");
609 break; 609 break;
610 case TDA9887_SET_CONFIG: 610 case TDA9887_SET_CONFIG:
611 { 611 if (t->type == TUNER_TDA9887) {
612 int *i = arg; 612 int *i = arg;
613 613
614 t->tda9887_config = *i; 614 t->tda9887_config = *i;
615 set_freq(client, t->tv_freq); 615 set_freq(client, t->tv_freq);
616 }
616 break; 617 break;
617 }
618 /* --- v4l ioctls --- */ 618 /* --- v4l ioctls --- */
619 /* take care: bttv does userspace copying, we'll get a 619 /* take care: bttv does userspace copying, we'll get a
620 kernel pointer here... */ 620 kernel pointer here... */
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 6da6f82b8c88..d071c5cbf013 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -7,6 +7,7 @@
7#include <linux/i2c.h> 7#include <linux/i2c.h>
8#include <linux/videodev.h> 8#include <linux/videodev.h>
9#include <media/tuner.h> 9#include <media/tuner.h>
10#include <media/v4l2-common.h>
10 11
11static int offset = 0; 12static int offset = 0;
12module_param(offset, int, 0666); 13module_param(offset, int, 0666);
@@ -128,6 +129,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
128 u8 buffer[4]; 129 u8 buffer[4];
129 int rc, IFPCoff, i, j; 130 int rc, IFPCoff, i, j;
130 enum param_type desired_type; 131 enum param_type desired_type;
132 struct tuner_params *params;
131 133
132 tun = &tuners[t->type]; 134 tun = &tuners[t->type];
133 135
@@ -169,19 +171,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
169 IFPCoff,t->type); 171 IFPCoff,t->type);
170 j = 0; 172 j = 0;
171 } 173 }
174 params = &tun->params[j];
172 175
173 for (i = 0; i < tun->params[j].count; i++) { 176 for (i = 0; i < params->count; i++) {
174 if (freq > tun->params[j].ranges[i].limit) 177 if (freq > params->ranges[i].limit)
175 continue; 178 continue;
176 break; 179 break;
177 } 180 }
178 if (i == tun->params[j].count) { 181 if (i == params->count) {
179 tuner_dbg("TV frequency out of range (%d > %d)", 182 tuner_dbg("TV frequency out of range (%d > %d)",
180 freq, tun->params[j].ranges[i - 1].limit); 183 freq, params->ranges[i - 1].limit);
181 freq = tun->params[j].ranges[--i].limit; 184 freq = params->ranges[--i].limit;
182 } 185 }
183 config = tun->params[j].ranges[i].config; 186 config = params->ranges[i].config;
184 cb = tun->params[j].ranges[i].cb; 187 cb = params->ranges[i].cb;
185 /* i == 0 -> VHF_LO 188 /* i == 0 -> VHF_LO
186 * i == 1 -> VHF_HI 189 * i == 1 -> VHF_HI
187 * i == 2 -> UHF */ 190 * i == 2 -> UHF */
@@ -281,7 +284,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
281 break; 284 break;
282 } 285 }
283 286
284 if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { 287 if (params->cb_first_if_lower_freq && div < t->last_div) {
285 buffer[0] = config; 288 buffer[0] = config;
286 buffer[1] = cb; 289 buffer[1] = cb;
287 buffer[2] = (div>>8) & 0x7f; 290 buffer[2] = (div>>8) & 0x7f;
@@ -293,6 +296,43 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
293 buffer[3] = cb; 296 buffer[3] = cb;
294 } 297 }
295 t->last_div = div; 298 t->last_div = div;
299 if (params->has_tda9887) {
300 int config = 0;
301 int is_secam_l = (t->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) &&
302 !(t->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC));
303
304 if (t->std == V4L2_STD_SECAM_LC) {
305 if (params->port1_active ^ params->port1_invert_for_secam_lc)
306 config |= TDA9887_PORT1_ACTIVE;
307 if (params->port2_active ^ params->port2_invert_for_secam_lc)
308 config |= TDA9887_PORT2_ACTIVE;
309 }
310 else {
311 if (params->port1_active)
312 config |= TDA9887_PORT1_ACTIVE;
313 if (params->port2_active)
314 config |= TDA9887_PORT2_ACTIVE;
315 }
316 if (params->intercarrier_mode)
317 config |= TDA9887_INTERCARRIER;
318 if (is_secam_l) {
319 if (i == 0 && params->default_top_secam_low)
320 config |= TDA9887_TOP(params->default_top_secam_low);
321 else if (i == 1 && params->default_top_secam_mid)
322 config |= TDA9887_TOP(params->default_top_secam_mid);
323 else if (params->default_top_secam_high)
324 config |= TDA9887_TOP(params->default_top_secam_high);
325 }
326 else {
327 if (i == 0 && params->default_top_low)
328 config |= TDA9887_TOP(params->default_top_low);
329 else if (i == 1 && params->default_top_mid)
330 config |= TDA9887_TOP(params->default_top_mid);
331 else if (params->default_top_high)
332 config |= TDA9887_TOP(params->default_top_high);
333 }
334 i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config);
335 }
296 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 336 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
297 buffer[0],buffer[1],buffer[2],buffer[3]); 337 buffer[0],buffer[1],buffer[2],buffer[3]);
298 338
@@ -339,6 +379,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
339 u16 div; 379 u16 div;
340 int rc, j; 380 int rc, j;
341 enum param_type desired_type = TUNER_PARAM_TYPE_RADIO; 381 enum param_type desired_type = TUNER_PARAM_TYPE_RADIO;
382 struct tuner_params *params;
342 383
343 tun = &tuners[t->type]; 384 tun = &tuners[t->type];
344 385
@@ -352,7 +393,8 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
352 j = 0; 393 j = 0;
353 394
354 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ 395 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
355 buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ 396 params = &tun->params[j];
397 buffer[2] = (params->ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
356 398
357 switch (t->type) { 399 switch (t->type) {
358 case TUNER_TENA_9533_DI: 400 case TUNER_TENA_9533_DI:
@@ -384,7 +426,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
384 } 426 }
385 buffer[0] = (div>>8) & 0x7f; 427 buffer[0] = (div>>8) & 0x7f;
386 buffer[1] = div & 0xff; 428 buffer[1] = div & 0xff;
387 if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { 429 if (params->cb_first_if_lower_freq && div < t->last_div) {
388 buffer[0] = buffer[2]; 430 buffer[0] = buffer[2];
389 buffer[1] = buffer[3]; 431 buffer[1] = buffer[3];
390 buffer[2] = (div>>8) & 0x7f; 432 buffer[2] = (div>>8) & 0x7f;
@@ -398,6 +440,18 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
398 buffer[0],buffer[1],buffer[2],buffer[3]); 440 buffer[0],buffer[1],buffer[2],buffer[3]);
399 t->last_div = div; 441 t->last_div = div;
400 442
443 if (params->has_tda9887) {
444 int config = 0;
445 if (params->port1_active && !params->port1_fm_high_sensitivity)
446 config |= TDA9887_PORT1_ACTIVE;
447 if (params->port2_active && !params->port2_fm_high_sensitivity)
448 config |= TDA9887_PORT2_ACTIVE;
449 if (params->intercarrier_mode)
450 config |= TDA9887_INTERCARRIER;
451/* if (params->port1_set_for_fm_mono)
452 config &= ~TDA9887_PORT1_ACTIVE;*/
453 i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config);
454 }
401 if (4 != (rc = i2c_master_send(c,buffer,4))) 455 if (4 != (rc = i2c_master_send(c,buffer,4)))
402 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 456 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
403} 457}
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index 9d9226cb6393..a167e17c6dcd 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -380,6 +380,10 @@ static struct tuner_params tuner_philips_fq1216me_params[] = {
380 .type = TUNER_PARAM_TYPE_PAL, 380 .type = TUNER_PARAM_TYPE_PAL,
381 .ranges = tuner_lg_pal_ranges, 381 .ranges = tuner_lg_pal_ranges,
382 .count = ARRAY_SIZE(tuner_lg_pal_ranges), 382 .count = ARRAY_SIZE(tuner_lg_pal_ranges),
383 .has_tda9887 = 1,
384 .port1_active = 1,
385 .port2_active = 1,
386 .port2_invert_for_secam_lc = 1,
383 }, 387 },
384}; 388};
385 389
@@ -542,6 +546,14 @@ static struct tuner_params tuner_fm1216me_mk3_params[] = {
542 .ranges = tuner_fm1216me_mk3_pal_ranges, 546 .ranges = tuner_fm1216me_mk3_pal_ranges,
543 .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges), 547 .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges),
544 .cb_first_if_lower_freq = 1, 548 .cb_first_if_lower_freq = 1,
549 .has_tda9887 = 1,
550 .port1_active = 1,
551 .port2_active = 1,
552 .port2_invert_for_secam_lc = 1,
553 .port1_fm_high_sensitivity = 1,
554 .default_top_mid = -2,
555 .default_top_secam_mid = -2,
556 .default_top_secam_high = -2,
545 }, 557 },
546}; 558};
547 559
@@ -612,6 +624,10 @@ static struct tuner_params tuner_fm1236_mk3_params[] = {
612 .ranges = tuner_fm1236_mk3_ntsc_ranges, 624 .ranges = tuner_fm1236_mk3_ntsc_ranges,
613 .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), 625 .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges),
614 .cb_first_if_lower_freq = 1, 626 .cb_first_if_lower_freq = 1,
627 .has_tda9887 = 1,
628 .port1_active = 1,
629 .port2_active = 1,
630 .port1_fm_high_sensitivity = 1,
615 }, 631 },
616}; 632};
617 633
@@ -632,6 +648,8 @@ static struct tuner_params tuner_microtune_4049_fm5_params[] = {
632 .type = TUNER_PARAM_TYPE_PAL, 648 .type = TUNER_PARAM_TYPE_PAL,
633 .ranges = tuner_temic_4009f_5_pal_ranges, 649 .ranges = tuner_temic_4009f_5_pal_ranges,
634 .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), 650 .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
651 .has_tda9887 = 1,
652 .port1_invert_for_secam_lc = 1,
635 }, 653 },
636}; 654};
637 655
@@ -648,6 +666,8 @@ static struct tuner_params tuner_panasonic_vp27_params[] = {
648 .type = TUNER_PARAM_TYPE_NTSC, 666 .type = TUNER_PARAM_TYPE_NTSC,
649 .ranges = tuner_panasonic_vp27_ntsc_ranges, 667 .ranges = tuner_panasonic_vp27_ntsc_ranges,
650 .count = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges), 668 .count = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges),
669 .has_tda9887 = 1,
670 .intercarrier_mode = 1,
651 }, 671 },
652}; 672};
653 673
@@ -782,6 +802,13 @@ static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = {
782 .type = TUNER_PARAM_TYPE_PAL, 802 .type = TUNER_PARAM_TYPE_PAL,
783 .ranges = tuner_philips_fq12_6a___mk4_pal_ranges, 803 .ranges = tuner_philips_fq12_6a___mk4_pal_ranges,
784 .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_pal_ranges), 804 .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_pal_ranges),
805 .has_tda9887 = 1,
806 .port1_active = 1,
807 .port2_invert_for_secam_lc = 1,
808 .default_top_mid = -2,
809 .default_top_secam_low = -2,
810 .default_top_secam_mid = -2,
811 .default_top_secam_high = -2,
785 }, 812 },
786}; 813};
787 814
@@ -870,6 +897,12 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = {
870 .type = TUNER_PARAM_TYPE_PAL, 897 .type = TUNER_PARAM_TYPE_PAL,
871 .ranges = tuner_philips_fmd1216me_mk3_pal_ranges, 898 .ranges = tuner_philips_fmd1216me_mk3_pal_ranges,
872 .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges), 899 .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges),
900 .has_tda9887 = 1,
901 .port1_active = 1,
902 .port2_active = 1,
903 .port2_fm_high_sensitivity = 1,
904 .port2_invert_for_secam_lc = 1,
905 .port1_set_for_fm_mono = 1,
873 }, 906 },
874}; 907};
875 908
@@ -1005,6 +1038,7 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
1005 .type = TUNER_PARAM_TYPE_NTSC, 1038 .type = TUNER_PARAM_TYPE_NTSC,
1006 .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, 1039 .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges,
1007 .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges), 1040 .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges),
1041 .has_tda9887 = 1,
1008 }, 1042 },
1009}; 1043};
1010 1044
@@ -1037,6 +1071,10 @@ static struct tuner_params tuner_samsung_tcpg_6121p30a_params[] = {
1037 .type = TUNER_PARAM_TYPE_PAL, 1071 .type = TUNER_PARAM_TYPE_PAL,
1038 .ranges = tuner_samsung_tcpg_6121p30a_pal_ranges, 1072 .ranges = tuner_samsung_tcpg_6121p30a_pal_ranges,
1039 .count = ARRAY_SIZE(tuner_samsung_tcpg_6121p30a_pal_ranges), 1073 .count = ARRAY_SIZE(tuner_samsung_tcpg_6121p30a_pal_ranges),
1074 .has_tda9887 = 1,
1075 .port1_active = 1,
1076 .port2_active = 1,
1077 .port2_invert_for_secam_lc = 1,
1040 }, 1078 },
1041}; 1079};
1042 1080
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index c2b756107548..936e3f746fba 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/moduleparam.h> 18#include <linux/moduleparam.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index 30f8d80ddcaa..d95529e8e513 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -73,14 +73,14 @@ static struct HAUPPAUGE_TUNER_FMT
73} 73}
74hauppauge_tuner_fmt[] = 74hauppauge_tuner_fmt[] =
75{ 75{
76 { V4L2_STD_UNKNOWN," UNKNOWN" }, 76 { V4L2_STD_UNKNOWN, " UNKNOWN" },
77 { V4L2_STD_UNKNOWN," FM" }, 77 { V4L2_STD_UNKNOWN, " FM" },
78 { V4L2_STD_PAL_BG, " PAL(B/G)" }, 78 { V4L2_STD_B|V4L2_STD_GH, " PAL(B/G)" },
79 { V4L2_STD_NTSC_M, " NTSC(M)" }, 79 { V4L2_STD_MN, " NTSC(M)" },
80 { V4L2_STD_PAL_I, " PAL(I)" }, 80 { V4L2_STD_PAL_I, " PAL(I)" },
81 { V4L2_STD_SECAM_L," SECAM(L/L')" }, 81 { V4L2_STD_SECAM_L|V4L2_STD_SECAM_LC, " SECAM(L/L')" },
82 { V4L2_STD_PAL_DK, " PAL(D/D1/K)" }, 82 { V4L2_STD_DK, " PAL(D/D1/K)" },
83 { V4L2_STD_ATSC, " ATSC/DVB Digital" }, 83 { V4L2_STD_ATSC, " ATSC/DVB Digital" },
84}; 84};
85 85
86/* This is the full list of possible tuners. Many thanks to Hauppauge for 86/* This is the full list of possible tuners. Many thanks to Hauppauge for
@@ -219,7 +219,7 @@ hauppauge_tuner[] =
219 { TUNER_ABSENT, "Thompson DTT75105"}, 219 { TUNER_ABSENT, "Thompson DTT75105"},
220 { TUNER_ABSENT, "Conexant_CX24109"}, 220 { TUNER_ABSENT, "Conexant_CX24109"},
221 { TUNER_TCL_2002N, "TCL M2523_5N_E"}, 221 { TUNER_TCL_2002N, "TCL M2523_5N_E"},
222 { TUNER_ABSENT, "TCL M2523_3DB_E"}, 222 { TUNER_TCL_2002MB, "TCL M2523_3DB_E"},
223 { TUNER_ABSENT, "Philips 8275A"}, 223 { TUNER_ABSENT, "Philips 8275A"},
224 { TUNER_ABSENT, "Microtune MT2060"}, 224 { TUNER_ABSENT, "Microtune MT2060"},
225 { TUNER_ABSENT, "Philips FM1236 MK5"}, 225 { TUNER_ABSENT, "Philips FM1236 MK5"},
diff --git a/drivers/media/video/usbvideo/usbvideo.h b/drivers/media/video/usbvideo/usbvideo.h
index 49dbee5f5628..051775d4c726 100644
--- a/drivers/media/video/usbvideo/usbvideo.h
+++ b/drivers/media/video/usbvideo/usbvideo.h
@@ -16,7 +16,6 @@
16#ifndef usbvideo_h 16#ifndef usbvideo_h
17#define usbvideo_h 17#define usbvideo_h
18 18
19#include <linux/config.h>
20#include <linux/videodev.h> 19#include <linux/videodev.h>
21#include <media/v4l2-common.h> 20#include <media/v4l2-common.h>
22#include <linux/usb.h> 21#include <linux/usb.h>
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 19d3c20dc7ef..d83a2c84d233 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -16,7 +16,6 @@
16 * 16 *
17 */ 17 */
18 18
19#include <linux/config.h>
20 19
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/module.h> 21#include <linux/module.h>
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 97f946db8597..f06dc19e504a 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -44,7 +44,6 @@
44 * Added Gerd Knorrs v4l1 enhancements (Justin Schoeman) 44 * Added Gerd Knorrs v4l1 enhancements (Justin Schoeman)
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c
index 8f271de57fd6..2ae3fb250630 100644
--- a/drivers/media/video/videocodec.c
+++ b/drivers/media/video/videocodec.c
@@ -36,7 +36,6 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37 37
38// kernel config is here (procfs flag) 38// kernel config is here (procfs flag)
39#include <linux/config.h>
40 39
41#ifdef CONFIG_PROC_FS 40#ifdef CONFIG_PROC_FS
42#include <linux/proc_fs.h> 41#include <linux/proc_fs.h>
diff --git a/drivers/media/video/videocodec.h b/drivers/media/video/videocodec.h
index 8c233720b6a5..97a3bbeda505 100644
--- a/drivers/media/video/videocodec.h
+++ b/drivers/media/video/videocodec.h
@@ -222,14 +222,14 @@ M zr36055[1] 0001 0000c001 00000000 (zr36050[1])
222/* ========================= */ 222/* ========================= */
223 223
224struct vfe_polarity { 224struct vfe_polarity {
225 int vsync_pol:1; 225 unsigned int vsync_pol:1;
226 int hsync_pol:1; 226 unsigned int hsync_pol:1;
227 int field_pol:1; 227 unsigned int field_pol:1;
228 int blank_pol:1; 228 unsigned int blank_pol:1;
229 int subimg_pol:1; 229 unsigned int subimg_pol:1;
230 int poe_pol:1; 230 unsigned int poe_pol:1;
231 int pvalid_pol:1; 231 unsigned int pvalid_pol:1;
232 int vclk_pol:1; 232 unsigned int vclk_pol:1;
233}; 233};
234 234
235struct vfe_settings { 235struct vfe_settings {
diff --git a/drivers/media/video/w9968cf.h b/drivers/media/video/w9968cf.h
index 2836b45ec206..ec7696e8f1fa 100644
--- a/drivers/media/video/w9968cf.h
+++ b/drivers/media/video/w9968cf.h
@@ -28,7 +28,6 @@
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/wait.h> 30#include <linux/wait.h>
31#include <linux/config.h>
32#include <linux/param.h> 31#include <linux/param.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/rwsem.h> 33#include <linux/rwsem.h>
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c
index 958c1e6fc852..33b32f3cf84e 100644
--- a/drivers/media/video/zoran_card.c
+++ b/drivers/media/video/zoran_card.c
@@ -29,7 +29,6 @@
29 29
30#include <linux/delay.h> 30#include <linux/delay.h>
31 31
32#include <linux/config.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/module.h> 34#include <linux/module.h>
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index 02168d9c2187..3cbac2e8aed3 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -27,7 +27,6 @@
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/module.h> 32#include <linux/module.h>
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index 9711f6248ef7..d9a5876eb386 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -44,7 +44,6 @@
44 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 44 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/version.h> 47#include <linux/version.h>
49#include <linux/init.h> 48#include <linux/init.h>
50#include <linux/module.h> 49#include <linux/module.h>
diff --git a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c
index f4ffe79bdc5b..c7f6f6488360 100644
--- a/drivers/media/video/zoran_procfs.c
+++ b/drivers/media/video/zoran_procfs.c
@@ -27,7 +27,6 @@
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/module.h> 32#include <linux/module.h>
diff --git a/drivers/media/video/zr36120_mem.c b/drivers/media/video/zr36120_mem.c
index c87113d6cc60..416eaa93b8a4 100644
--- a/drivers/media/video/zr36120_mem.c
+++ b/drivers/media/video/zr36120_mem.c
@@ -18,7 +18,6 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#include <linux/config.h>
22#include <linux/mm.h> 21#include <linux/mm.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 12dd8d493ee2..2544fc7af0f6 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -46,7 +46,6 @@
46*/ 46*/
47/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 47/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
48 48
49#include <linux/config.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
51#include <linux/module.h> 50#include <linux/module.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
@@ -5592,7 +5591,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
5592 5591
5593 /* The SCSI driver needs to adjust timeouts on all current 5592 /* The SCSI driver needs to adjust timeouts on all current
5594 * commands prior to the diagnostic reset being issued. 5593 * commands prior to the diagnostic reset being issued.
5595 * Prevents timeouts occuring during a diagnostic reset...very bad. 5594 * Prevents timeouts occurring during a diagnostic reset...very bad.
5596 * For all other protocol drivers, this is a no-op. 5595 * For all other protocol drivers, this is a no-op.
5597 */ 5596 */
5598 { 5597 {
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 4720f9ae86aa..32ae4d664545 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -49,7 +49,6 @@
49#define MPTBASE_H_INCLUDED 49#define MPTBASE_H_INCLUDED
50/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 50/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
51 51
52#include <linux/config.h>
53#include <linux/kernel.h> 52#include <linux/kernel.h>
54#include <linux/pci.h> 53#include <linux/pci.h>
55 54
diff --git a/drivers/message/i2o/debug.c b/drivers/message/i2o/debug.c
index 5a6cca8e8c45..8abe45e49ad7 100644
--- a/drivers/message/i2o/debug.c
+++ b/drivers/message/i2o/debug.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <linux/kernel.h> 2#include <linux/kernel.h>
4#include <linux/pci.h> 3#include <linux/pci.h>
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index c8426a9bf273..6fe2ff5a63db 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -16,7 +16,6 @@
16 * Note that all locks are private to this file. Nothing else may 16 * Note that all locks are private to this file. Nothing else may
17 * touch them. 17 * touch them.
18 */ 18 */
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/slab.h> 21#include <linux/slab.h>
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 79fd062ccb34..02776814443e 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -17,7 +17,6 @@
17 * pin should provide pulses even when the LCD is blanked, otherwise 17 * pin should provide pulses even when the LCD is blanked, otherwise
18 * a pen touch needed to unblank the LCD will never be read. 18 * a pen touch needed to unblank the LCD will never be read.
19 */ 19 */
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
23#include <linux/init.h> 22#include <linux/init.h>
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 6aba41954448..634d538ccd14 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -29,7 +29,6 @@
29#include <linux/wait.h> 29#include <linux/wait.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/interrupt.h> 33#include <linux/interrupt.h>
35#include <linux/device.h> 34#include <linux/device.h>
diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c
index 3228516b7d19..075a2a07924e 100644
--- a/drivers/mmc/at91_mci.c
+++ b/drivers/mmc/at91_mci.c
@@ -53,7 +53,6 @@
53 Gets the status of the write protect pin, if available. 53 Gets the status of the write protect pin, if available.
54*/ 54*/
55 55
56#include <linux/config.h>
57#include <linux/module.h> 56#include <linux/module.h>
58#include <linux/moduleparam.h> 57#include <linux/moduleparam.h>
59#include <linux/init.h> 58#include <linux/init.h>
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c
index 5dc4bee7abeb..41069908f4a7 100644
--- a/drivers/mmc/au1xmmc.c
+++ b/drivers/mmc/au1xmmc.c
@@ -34,7 +34,6 @@
34 * So we use the timer to check the status manually. 34 * So we use the timer to check the status manually.
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/init.h> 38#include <linux/init.h>
40#include <linux/platform_device.h> 39#include <linux/platform_device.h>
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c
index 5c62f4e6ad06..7ca9e95bdf89 100644
--- a/drivers/mmc/imxmmc.c
+++ b/drivers/mmc/imxmmc.c
@@ -25,7 +25,6 @@
25 * deficiencies 25 * deficiencies
26 * 26 *
27 */ 27 */
28#include <linux/config.h>
29 28
30#ifdef CONFIG_MMC_DEBUG 29#ifdef CONFIG_MMC_DEBUG
31#define DEBUG 30#define DEBUG
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 6201f3086a02..247ff2f23ac9 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -9,7 +9,6 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/interrupt.h> 14#include <linux/interrupt.h>
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index 8576a65ca1c3..9dfb34a857e3 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -7,7 +7,6 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/moduleparam.h> 11#include <linux/moduleparam.h>
13#include <linux/init.h> 12#include <linux/init.h>
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index c25244b3657b..7a4840ec53b7 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
17#include <linux/init.h> 16#include <linux/init.h>
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index b49368fd96b8..ef350908478c 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -16,7 +16,6 @@
16 * 1 and 3 byte data transfers not supported 16 * 1 and 3 byte data transfers not supported
17 * max block length up to 1023 17 * max block length up to 1023
18 */ 18 */
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/ioport.h> 21#include <linux/ioport.h>
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index 8167332d4013..3fcd86c08ebd 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -21,7 +21,6 @@
21 * - On APIC systems the FIFO empty interrupt is sometimes lost. 21 * - On APIC systems the FIFO empty interrupt is sometimes lost.
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/moduleparam.h> 25#include <linux/moduleparam.h>
27#include <linux/init.h> 26#include <linux/init.h>
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 1e01ad38b26e..9885726a16e4 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
index 4bf9f8cac0dd..60e11a0ada97 100644
--- a/drivers/mtd/chips/cfi_probe.c
+++ b/drivers/mtd/chips/cfi_probe.c
@@ -4,7 +4,6 @@
4 $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ 4 $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $
5*/ 5*/
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
diff --git a/drivers/mtd/chips/chipreg.c b/drivers/mtd/chips/chipreg.c
index c2127840a183..2174c97549f0 100644
--- a/drivers/mtd/chips/chipreg.c
+++ b/drivers/mtd/chips/chipreg.c
@@ -6,7 +6,6 @@
6 */ 6 */
7 7
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/kmod.h> 10#include <linux/kmod.h>
12#include <linux/spinlock.h> 11#include <linux/spinlock.h>
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 517ea33e7260..8f39d0a31438 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -8,7 +8,6 @@
8 Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com 8 Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
9*/ 9*/
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/types.h> 13#include <linux/types.h>
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index be3f1c136d02..ede3561be870 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -8,7 +8,6 @@
8 * 8 *
9 * Licence: GPL 9 * Licence: GPL
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
14#include <linux/blkdev.h> 13#include <linux/blkdev.h>
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index 593bb033a3fa..78872c3f3760 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -40,7 +40,6 @@
40*/ 40*/
41#define DOC_SINGLE_DRIVER 41#define DOC_SINGLE_DRIVER
42 42
43#include <linux/config.h>
44#include <linux/kernel.h> 43#include <linux/kernel.h>
45#include <linux/module.h> 44#include <linux/module.h>
46#include <asm/errno.h> 45#include <asm/errno.h>
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 04271d02b6b6..5db716045927 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -9,7 +9,6 @@
9 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11*/ 11*/
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index b4438eacfd80..e427c82d5f4c 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
16#include <linux/ioport.h> 15#include <linux/ioport.h>
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index 30f07b473ae2..6f9bbf6fee4d 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -82,7 +82,6 @@
82 * * Comb the init routine. It's still a bit cludgy on a few things. 82 * * Comb the init routine. It's still a bit cludgy on a few things.
83 */ 83 */
84 84
85#include <linux/config.h>
86#include <linux/kernel.h> 85#include <linux/kernel.h>
87#include <linux/module.h> 86#include <linux/module.h>
88#include <asm/uaccess.h> 87#include <asm/uaccess.h>
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 1e21a2c3dd29..4116535805f1 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -24,7 +24,6 @@
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/delay.h> 29#include <linux/delay.h>
diff --git a/drivers/mtd/maps/alchemy-flash.c b/drivers/mtd/maps/alchemy-flash.c
index b933a2a27b18..7fc8097e41d2 100644
--- a/drivers/mtd/maps/alchemy-flash.c
+++ b/drivers/mtd/maps/alchemy-flash.c
@@ -7,7 +7,6 @@
7 * 7 *
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/init.h> 10#include <linux/init.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c
index a50587005263..447955be18af 100644
--- a/drivers/mtd/maps/amd76xrom.c
+++ b/drivers/mtd/maps/amd76xrom.c
@@ -14,7 +14,6 @@
14#include <linux/mtd/map.h> 14#include <linux/mtd/map.h>
15#include <linux/mtd/cfi.h> 15#include <linux/mtd/cfi.h>
16#include <linux/mtd/flashchip.h> 16#include <linux/mtd/flashchip.h>
17#include <linux/config.h>
18#include <linux/pci.h> 17#include <linux/pci.h>
19#include <linux/pci_ids.h> 18#include <linux/pci_ids.h>
20#include <linux/list.h> 19#include <linux/list.h>
diff --git a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c
index 5a95ab370a97..0402c21e291d 100644
--- a/drivers/mtd/maps/ceiva.c
+++ b/drivers/mtd/maps/ceiva.c
@@ -14,7 +14,6 @@
14 * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $ 14 * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/ioport.h> 19#include <linux/ioport.h>
diff --git a/drivers/mtd/maps/cstm_mips_ixx.c b/drivers/mtd/maps/cstm_mips_ixx.c
index a370953c1513..aa56defb94c8 100644
--- a/drivers/mtd/maps/cstm_mips_ixx.c
+++ b/drivers/mtd/maps/cstm_mips_ixx.c
@@ -38,7 +38,6 @@
38#include <linux/mtd/mtd.h> 38#include <linux/mtd/mtd.h>
39#include <linux/mtd/map.h> 39#include <linux/mtd/map.h>
40#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
41#include <linux/config.h>
42#include <linux/delay.h> 41#include <linux/delay.h>
43 42
44#if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR) 43#if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR)
diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c
index 85c2a9e22b1e..92a9c7fac993 100644
--- a/drivers/mtd/maps/dbox2-flash.c
+++ b/drivers/mtd/maps/dbox2-flash.c
@@ -12,7 +12,6 @@
12#include <linux/mtd/mtd.h> 12#include <linux/mtd/mtd.h>
13#include <linux/mtd/map.h> 13#include <linux/mtd/map.h>
14#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
15#include <linux/config.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17 16
18/* partition_info gives details on the logical partitions that the split the 17/* partition_info gives details on the logical partitions that the split the
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index 8b3784e2de89..b32bb9347d71 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -7,7 +7,6 @@
7 * 7 *
8 * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $ 8 * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $
9 */ 9 */
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c
index c299d10b33e6..b1104fe1f207 100644
--- a/drivers/mtd/maps/dilnetpc.c
+++ b/drivers/mtd/maps/dilnetpc.c
@@ -25,7 +25,6 @@
25 * and http://www.ssv-embedded.de/ssv/pc104/p170.htm 25 * and http://www.ssv-embedded.de/ssv/pc104/p170.htm
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/types.h> 29#include <linux/types.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/dmv182.c b/drivers/mtd/maps/dmv182.c
index 2bb3c0f0f970..a43c49905cac 100644
--- a/drivers/mtd/maps/dmv182.c
+++ b/drivers/mtd/maps/dmv182.c
@@ -16,7 +16,6 @@
16 * option) any later version. 16 * option) any later version.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/types.h> 21#include <linux/types.h>
diff --git a/drivers/mtd/maps/ebony.c b/drivers/mtd/maps/ebony.c
index 60a6e51d662f..641e1dd8479e 100644
--- a/drivers/mtd/maps/ebony.c
+++ b/drivers/mtd/maps/ebony.c
@@ -20,7 +20,6 @@
20#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
21#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
22#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
23#include <linux/config.h>
24#include <asm/io.h> 23#include <asm/io.h>
25#include <asm/ibm44x.h> 24#include <asm/ibm44x.h>
26#include <platforms/4xx/ebony.h> 25#include <platforms/4xx/ebony.h>
diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c
index b48a3473ffc1..1c5b97c89685 100644
--- a/drivers/mtd/maps/edb7312.c
+++ b/drivers/mtd/maps/edb7312.c
@@ -17,7 +17,6 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
20#include <linux/config.h>
21 20
22#ifdef CONFIG_MTD_PARTITIONS 21#ifdef CONFIG_MTD_PARTITIONS
23#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c
index 0667101ccbe1..6dde3182d64a 100644
--- a/drivers/mtd/maps/h720x-flash.c
+++ b/drivers/mtd/maps/h720x-flash.c
@@ -8,7 +8,6 @@
8 * 2003 Thomas Gleixner <tglx@linutronix.de> 8 * 2003 Thomas Gleixner <tglx@linutronix.de>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c
index 16732794edf3..db4b570d874a 100644
--- a/drivers/mtd/maps/ichxrom.c
+++ b/drivers/mtd/maps/ichxrom.c
@@ -14,7 +14,6 @@
14#include <linux/mtd/map.h> 14#include <linux/mtd/map.h>
15#include <linux/mtd/cfi.h> 15#include <linux/mtd/cfi.h>
16#include <linux/mtd/flashchip.h> 16#include <linux/mtd/flashchip.h>
17#include <linux/config.h>
18#include <linux/pci.h> 17#include <linux/pci.h>
19#include <linux/pci_ids.h> 18#include <linux/pci_ids.h>
20#include <linux/list.h> 19#include <linux/list.h>
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
index ba7f40311a7e..a0b4dc7155dc 100644
--- a/drivers/mtd/maps/impa7.c
+++ b/drivers/mtd/maps/impa7.c
@@ -17,7 +17,6 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
20#include <linux/config.h>
21 20
22#ifdef CONFIG_MTD_PARTITIONS 21#ifdef CONFIG_MTD_PARTITIONS
23#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
index a3ba52fbd868..c8db01b3e45f 100644
--- a/drivers/mtd/maps/integrator-flash.c
+++ b/drivers/mtd/maps/integrator-flash.c
@@ -26,7 +26,6 @@
26 26
27======================================================================*/ 27======================================================================*/
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/ipaq-flash.c b/drivers/mtd/maps/ipaq-flash.c
index b8ccb0a95789..f27c132794c3 100644
--- a/drivers/mtd/maps/ipaq-flash.c
+++ b/drivers/mtd/maps/ipaq-flash.c
@@ -8,7 +8,6 @@
8 * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ 8 * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c
index 851bf9576052..6b784ef5ee70 100644
--- a/drivers/mtd/maps/l440gx.c
+++ b/drivers/mtd/maps/l440gx.c
@@ -13,7 +13,6 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <linux/mtd/mtd.h> 14#include <linux/mtd/mtd.h>
15#include <linux/mtd/map.h> 15#include <linux/mtd/map.h>
16#include <linux/config.h>
17 16
18#define PIIXE_IOBASE_RESOURCE 11 17#define PIIXE_IOBASE_RESOURCE 11
19 18
diff --git a/drivers/mtd/maps/lasat.c b/drivers/mtd/maps/lasat.c
index c658d4045ef2..1c13d2dc0cdf 100644
--- a/drivers/mtd/maps/lasat.c
+++ b/drivers/mtd/maps/lasat.c
@@ -19,7 +19,6 @@
19#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
20#include <linux/mtd/map.h> 20#include <linux/mtd/map.h>
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
22#include <linux/config.h>
23#include <asm/lasat/lasat.h> 22#include <asm/lasat/lasat.h>
24 23
25static struct mtd_info *lasat_mtd; 24static struct mtd_info *lasat_mtd;
diff --git a/drivers/mtd/maps/mpc1211.c b/drivers/mtd/maps/mpc1211.c
index 4685e8e13460..45a00fac88ac 100644
--- a/drivers/mtd/maps/mpc1211.c
+++ b/drivers/mtd/maps/mpc1211.c
@@ -15,7 +15,6 @@
15#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
16#include <linux/mtd/map.h> 16#include <linux/mtd/map.h>
17#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
18#include <linux/config.h>
19 18
20static struct mtd_info *flash_mtd; 19static struct mtd_info *flash_mtd;
21static struct mtd_partition *parsed_parts; 20static struct mtd_partition *parsed_parts;
diff --git a/drivers/mtd/maps/mtx-1_flash.c b/drivers/mtd/maps/mtx-1_flash.c
index 5c25d4e552c6..d884f2be28f6 100644
--- a/drivers/mtd/maps/mtx-1_flash.c
+++ b/drivers/mtd/maps/mtx-1_flash.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/mtd/maps/ocotea.c b/drivers/mtd/maps/ocotea.c
index a21fcd195ab4..2f07602ba940 100644
--- a/drivers/mtd/maps/ocotea.c
+++ b/drivers/mtd/maps/ocotea.c
@@ -18,7 +18,6 @@
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/config.h>
22#include <asm/io.h> 21#include <asm/io.h>
23#include <asm/ibm44x.h> 22#include <asm/ibm44x.h>
24#include <platforms/4xx/ocotea.h> 23#include <platforms/4xx/ocotea.h>
diff --git a/drivers/mtd/maps/omap-toto-flash.c b/drivers/mtd/maps/omap-toto-flash.c
index dc3765270057..e6e391efbeb6 100644
--- a/drivers/mtd/maps/omap-toto-flash.c
+++ b/drivers/mtd/maps/omap-toto-flash.c
@@ -8,7 +8,6 @@
8 * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ 8 * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index d6301f08906d..7799a25a7f2a 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -18,7 +18,6 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
20#include <linux/mtd/map.h> 20#include <linux/mtd/map.h>
21#include <linux/config.h>
22#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
23#include <linux/mtd/physmap.h> 22#include <linux/mtd/physmap.h>
24#include <asm/io.h> 23#include <asm/io.h>
diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c
index 50b14033613f..ec8fdae1dd99 100644
--- a/drivers/mtd/maps/redwood.c
+++ b/drivers/mtd/maps/redwood.c
@@ -13,7 +13,6 @@
13 * or implied. 13 * or implied.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index 5cefb015633c..950bf1c57841 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -5,7 +5,6 @@
5 * 5 *
6 * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $ 6 * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $
7 */ 7 */
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/ioport.h> 10#include <linux/ioport.h>
diff --git a/drivers/mtd/maps/sbc8240.c b/drivers/mtd/maps/sbc8240.c
index 350286dc1d2e..7d0fcf8f4f33 100644
--- a/drivers/mtd/maps/sbc8240.c
+++ b/drivers/mtd/maps/sbc8240.c
@@ -18,7 +18,6 @@
18 * Both parts are JEDEC compatible. 18 * Both parts are JEDEC compatible.
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c
index e8c130e1efd3..9b50cfc355b1 100644
--- a/drivers/mtd/maps/sc520cdp.c
+++ b/drivers/mtd/maps/sc520cdp.c
@@ -25,7 +25,6 @@
25 * For details see http://www.amd.com/products/epd/desiging/evalboards/18.elansc520/520_cdp_brief/index.html 25 * For details see http://www.amd.com/products/epd/desiging/evalboards/18.elansc520/520_cdp_brief/index.html
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/types.h> 29#include <linux/types.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c
index 97a8dfd69258..dcfb85840d1e 100644
--- a/drivers/mtd/maps/scb2_flash.c
+++ b/drivers/mtd/maps/scb2_flash.c
@@ -53,7 +53,6 @@
53#include <linux/mtd/mtd.h> 53#include <linux/mtd/mtd.h>
54#include <linux/mtd/map.h> 54#include <linux/mtd/map.h>
55#include <linux/mtd/cfi.h> 55#include <linux/mtd/cfi.h>
56#include <linux/config.h>
57#include <linux/pci.h> 56#include <linux/pci.h>
58#include <linux/pci_ids.h> 57#include <linux/pci_ids.h>
59 58
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c
index 331a15859d71..7391fd544e86 100644
--- a/drivers/mtd/maps/scx200_docflash.c
+++ b/drivers/mtd/maps/scx200_docflash.c
@@ -8,7 +8,6 @@
8*/ 8*/
9 9
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c
index c53c2c369c9d..d76ceef453ce 100644
--- a/drivers/mtd/maps/solutionengine.c
+++ b/drivers/mtd/maps/solutionengine.c
@@ -16,7 +16,6 @@
16#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
17#include <linux/mtd/map.h> 17#include <linux/mtd/map.h>
18#include <linux/mtd/partitions.h> 18#include <linux/mtd/partitions.h>
19#include <linux/config.h>
20#include <linux/errno.h> 19#include <linux/errno.h>
21 20
22static struct mtd_info *flash_mtd; 21static struct mtd_info *flash_mtd;
diff --git a/drivers/mtd/maps/tqm834x.c b/drivers/mtd/maps/tqm834x.c
index c7ae9a515c1a..58e5912bd381 100644
--- a/drivers/mtd/maps/tqm834x.c
+++ b/drivers/mtd/maps/tqm834x.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/types.h> 16#include <linux/types.h>
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c
index a43517053e7c..19578ba84ee8 100644
--- a/drivers/mtd/maps/tqm8xxl.c
+++ b/drivers/mtd/maps/tqm8xxl.c
@@ -22,7 +22,6 @@
22 * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at 22 * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at
23 * kernel configuration. 23 * kernel configuration.
24 */ 24 */
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/types.h> 26#include <linux/types.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c
index a7422c200567..b47270e850bc 100644
--- a/drivers/mtd/maps/ts5500_flash.c
+++ b/drivers/mtd/maps/ts5500_flash.c
@@ -26,7 +26,6 @@
26 * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $ 26 * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/init.h> 29#include <linux/init.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index f7264dc2ac9b..389fea28b9a6 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -10,7 +10,6 @@
10 10
11/****************************************************************************/ 11/****************************************************************************/
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/init.h> 15#include <linux/init.h>
diff --git a/drivers/mtd/maps/walnut.c b/drivers/mtd/maps/walnut.c
index f46bec66150f..ec80eec376bf 100644
--- a/drivers/mtd/maps/walnut.c
+++ b/drivers/mtd/maps/walnut.c
@@ -20,7 +20,6 @@
20#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
21#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
22#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
23#include <linux/config.h>
24#include <asm/io.h> 23#include <asm/io.h>
25#include <asm/ibm4xx.h> 24#include <asm/ibm4xx.h>
26#include <platforms/4xx/walnut.h> 25#include <platforms/4xx/walnut.h>
diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c
index 60c197ec455b..ac5b8105b6ef 100644
--- a/drivers/mtd/maps/wr_sbc82xx_flash.c
+++ b/drivers/mtd/maps/wr_sbc82xx_flash.c
@@ -17,7 +17,6 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
20#include <linux/config.h>
21#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
22 21
23#include <asm/immap_cpm2.h> 22#include <asm/immap_cpm2.h>
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index e5c78463ebfd..04ed34694b14 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -7,7 +7,6 @@
7 * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> 7 * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/fs.h> 10#include <linux/fs.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 9a4b59d92525..fb8b4f7e48d3 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/device.h> 8#include <linux/device.h>
10#include <linux/fs.h> 9#include <linux/fs.h>
11#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 16a952dd486a..168d3ba063c3 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12#include <linux/sched.h> 11#include <linux/sched.h>
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 77a7123a5c56..06a930372b7a 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -16,7 +16,6 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/config.h>
20#include <linux/kmod.h> 19#include <linux/kmod.h>
21#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index ebd64abc8be8..545ff252d81e 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -25,7 +25,6 @@
25 * $Id: nandsim.c,v 1.8 2005/03/19 15:33:56 dedekind Exp $ 25 * $Id: nandsim.c,v 1.8 2005/03/19 15:33:56 dedekind Exp $
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/init.h> 28#include <linux/init.h>
30#include <linux/types.h> 29#include <linux/types.h>
31#include <linux/module.h> 30#include <linux/module.h>
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index dc7573501d8c..dd5cea8b4a7a 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -11,7 +11,6 @@
11 11
12#define PRERELEASE 12#define PRERELEASE
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <asm/errno.h> 16#include <asm/errno.h>
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index dc845f36fe49..cbdae54f715f 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -68,7 +68,6 @@
68/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ 68/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
69static int max_interrupt_work = 10; 69static int max_interrupt_work = 10;
70 70
71#include <linux/config.h>
72#include <linux/module.h> 71#include <linux/module.h>
73#ifdef CONFIG_MCA 72#ifdef CONFIG_MCA
74#include <linux/mca.h> 73#include <linux/mca.h>
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 91d1c4c24d9b..ac60f3f62db8 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -57,7 +57,6 @@ static int max_interrupt_work = 20;
57#define RX_RING_SIZE 16 57#define RX_RING_SIZE 16
58#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ 58#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */
59 59
60#include <linux/config.h>
61#include <linux/module.h> 60#include <linux/module.h>
62#include <linux/isapnp.h> 61#include <linux/isapnp.h>
63#include <linux/kernel.h> 62#include <linux/kernel.h>
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index d2f808979a2b..45125db44177 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -236,7 +236,6 @@ static int vortex_debug = VORTEX_DEBUG;
236static int vortex_debug = 1; 236static int vortex_debug = 1;
237#endif 237#endif
238 238
239#include <linux/config.h>
240#include <linux/module.h> 239#include <linux/module.h>
241#include <linux/kernel.h> 240#include <linux/kernel.h>
242#include <linux/string.h> 241#include <linux/string.h>
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index d26dd6a7062d..1d7af760c2b1 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -52,7 +52,6 @@
52#define DRV_RELDATE "Mar 22, 2004" 52#define DRV_RELDATE "Mar 22, 2004"
53 53
54 54
55#include <linux/config.h>
56#include <linux/module.h> 55#include <linux/module.h>
57#include <linux/moduleparam.h> 56#include <linux/moduleparam.h>
58#include <linux/kernel.h> 57#include <linux/kernel.h>
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index ed2e3c03bc88..d21e98f5adbc 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -93,7 +93,6 @@
93#define DRV_VERSION "0.9.27" 93#define DRV_VERSION "0.9.27"
94 94
95 95
96#include <linux/config.h>
97#include <linux/module.h> 96#include <linux/module.h>
98#include <linux/kernel.h> 97#include <linux/kernel.h>
99#include <linux/compiler.h> 98#include <linux/compiler.h>
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index 8a9f7d61b9b1..7e2ca9571467 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -40,7 +40,6 @@
40 40
41 */ 41 */
42 42
43#include <linux/config.h>
44#include <linux/module.h> 43#include <linux/module.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/string.h> 45#include <linux/string.h>
diff --git a/drivers/net/8390.h b/drivers/net/8390.h
index 51e39dcd0603..a9a58f518f45 100644
--- a/drivers/net/8390.h
+++ b/drivers/net/8390.h
@@ -7,7 +7,6 @@
7#ifndef _8390_h 7#ifndef _8390_h
8#define _8390_h 8#define _8390_h
9 9
10#include <linux/config.h>
11#include <linux/if_ether.h> 10#include <linux/if_ether.h>
12#include <linux/ioport.h> 11#include <linux/ioport.h>
13#include <linux/skbuff.h> 12#include <linux/skbuff.h>
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index 60304f7e7e5b..a8c245a82261 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -27,7 +27,6 @@
27 * as published by the Free Software Foundation; either version 27 * as published by the Free Software Foundation; either version
28 * 2 of the License, or (at your option) any later version. 28 * 2 of the License, or (at your option) any later version.
29 */ 29 */
30#include <linux/config.h>
31#include <linux/netdevice.h> 30#include <linux/netdevice.h>
32#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
33#include <linux/trdevice.h> 32#include <linux/trdevice.h>
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index 71165ac0257a..519390c033c3 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -48,7 +48,6 @@
48#include <linux/skbuff.h> 48#include <linux/skbuff.h>
49#include <linux/slab.h> 49#include <linux/slab.h>
50#include <linux/string.h> 50#include <linux/string.h>
51#include <linux/config.h>
52#include <linux/init.h> 51#include <linux/init.h>
53#include <linux/crc32.h> 52#include <linux/crc32.h>
54#include <linux/zorro.h> 53#include <linux/zorro.h>
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 23ff22ba5d31..c290b5ae63b2 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -50,7 +50,6 @@
50 * Grant Grundler <grundler@cup.hp.com>: PCI write posting fixes. 50 * Grant Grundler <grundler@cup.hp.com>: PCI write posting fixes.
51 */ 51 */
52 52
53#include <linux/config.h>
54#include <linux/module.h> 53#include <linux/module.h>
55#include <linux/moduleparam.h> 54#include <linux/moduleparam.h>
56#include <linux/version.h> 55#include <linux/version.h>
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h
index a97107023495..62ec8ceee698 100644
--- a/drivers/net/acenic.h
+++ b/drivers/net/acenic.h
@@ -1,7 +1,6 @@
1#ifndef _ACENIC_H_ 1#ifndef _ACENIC_H_
2#define _ACENIC_H_ 2#define _ACENIC_H_
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Generate TX index update each time, when TX ring is closed. 6 * Generate TX index update each time, when TX ring is closed.
diff --git a/drivers/net/acenic_firmware.h b/drivers/net/acenic_firmware.h
index d7882dd783c8..ec146f60d77b 100644
--- a/drivers/net/acenic_firmware.h
+++ b/drivers/net/acenic_firmware.h
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2/* 1/*
3 * Declare these here even if Tigon I support is disabled to avoid 2 * Declare these here even if Tigon I support is disabled to avoid
4 * the compiler complaining about undefined symbols. 3 * the compiler complaining about undefined symbols.
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index d9ba8be72af8..c017c4f6b3b5 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -69,7 +69,6 @@ Revision History:
69*/ 69*/
70 70
71 71
72#include <linux/config.h>
73#include <linux/module.h> 72#include <linux/module.h>
74#include <linux/kernel.h> 73#include <linux/kernel.h>
75#include <linux/types.h> 74#include <linux/types.h>
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 9edaa183227a..1d01ac0000e4 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -48,7 +48,6 @@ static const char *version =
48 * the driver figure it out. 48 * the driver figure it out.
49 */ 49 */
50 50
51#include <linux/config.h>
52#include <linux/module.h> 51#include <linux/module.h>
53#include <linux/kernel.h> 52#include <linux/kernel.h>
54#include <linux/types.h> 53#include <linux/types.h>
diff --git a/drivers/net/appletalk/cops_ffdrv.h b/drivers/net/appletalk/cops_ffdrv.h
index 31cf8c9c947f..b02005087c1b 100644
--- a/drivers/net/appletalk/cops_ffdrv.h
+++ b/drivers/net/appletalk/cops_ffdrv.h
@@ -24,7 +24,6 @@
24 * - Jay Schulist <jschlst@samba.org> 24 * - Jay Schulist <jschlst@samba.org>
25 */ 25 */
26 26
27#include <linux/config.h>
28 27
29#ifdef CONFIG_COPS_DAYNA 28#ifdef CONFIG_COPS_DAYNA
30 29
diff --git a/drivers/net/appletalk/cops_ltdrv.h b/drivers/net/appletalk/cops_ltdrv.h
index 4afb8e18ba65..c699b1ad31da 100644
--- a/drivers/net/appletalk/cops_ltdrv.h
+++ b/drivers/net/appletalk/cops_ltdrv.h
@@ -23,7 +23,6 @@
23 * - Jay Schulist <jschlst@samba.org> 23 * - Jay Schulist <jschlst@samba.org>
24 */ 24 */
25 25
26#include <linux/config.h>
27 26
28#ifdef CONFIG_COPS_TANGENT 27#ifdef CONFIG_COPS_TANGENT
29 28
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index 1a44a79ed064..7f7dd450226a 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -23,7 +23,6 @@
23 * of the GNU General Public License, incorporated herein by reference. 23 * of the GNU General Public License, incorporated herein by reference.
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/init.h> 28#include <linux/init.h>
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index fabc0607b0f1..5a95005253fa 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -44,7 +44,6 @@
44#define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n" 44#define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n"
45 45
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/config.h>
48#include <linux/types.h> 47#include <linux/types.h>
49#include <linux/delay.h> 48#include <linux/delay.h>
50#include <linux/netdevice.h> 49#include <linux/netdevice.h>
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 613005a0285d..85493b7b924f 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -19,7 +19,6 @@
19 19
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/config.h>
23#include <linux/mii.h> 22#include <linux/mii.h>
24#include <linux/netdevice.h> 23#include <linux/netdevice.h>
25#include <linux/etherdevice.h> 24#include <linux/etherdevice.h>
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index e613cc289749..5d7929c79bce 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -35,7 +35,6 @@
35 response to inb()s from other device probes! 35 response to inb()s from other device probes!
36*/ 36*/
37 37
38#include <linux/config.h>
39#include <linux/errno.h> 38#include <linux/errno.h>
40#include <linux/netdevice.h> 39#include <linux/netdevice.h>
41#include <linux/etherdevice.h> 40#include <linux/etherdevice.h>
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 038d5fcb15e6..55f6e3f65b53 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -35,7 +35,6 @@
35 * 35 *
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/kernel.h> 39#include <linux/kernel.h>
41#include <linux/sched.h> 40#include <linux/sched.h>
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index bbca8ae8018c..6fad83f24c4f 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -7,7 +7,6 @@
7 * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to 7 * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to
8 * dynamic procfs inode. 8 * dynamic procfs inode.
9 */ 9 */
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/netdevice.h> 12#include <linux/netdevice.h>
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d55b0f7939a6..7e32d4ea71e2 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -9,7 +9,6 @@
9 * Written by: Michael Chan (mchan@broadcom.com) 9 * Written by: Michael Chan (mchan@broadcom.com)
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8171cae06688..8b951238f3a2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -33,7 +33,6 @@
33 33
34//#define BONDING_DEBUG 1 34//#define BONDING_DEBUG 1
35 35
36#include <linux/config.h>
37#include <linux/kernel.h> 36#include <linux/kernel.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/sched.h> 38#include <linux/sched.h>
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 5a9bd95884be..cfe4dc3a93a3 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -20,7 +20,6 @@
20 * file called LICENSE. 20 * file called LICENSE.
21 * 21 *
22 */ 22 */
23#include <linux/config.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/sched.h> 25#include <linux/sched.h>
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 565a54f1d06a..b89c7bb2c591 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -66,7 +66,6 @@
66 * by default, the selective clear mask is set up to process rx packets. 66 * by default, the selective clear mask is set up to process rx packets.
67 */ 67 */
68 68
69#include <linux/config.h>
70 69
71#include <linux/module.h> 70#include <linux/module.h>
72#include <linux/kernel.h> 71#include <linux/kernel.h>
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index bf3e7b6a7a18..5d9dd14427c5 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -39,7 +39,6 @@
39#ifndef _CXGB_COMMON_H_ 39#ifndef _CXGB_COMMON_H_
40#define _CXGB_COMMON_H_ 40#define _CXGB_COMMON_H_
41 41
42#include <linux/config.h>
43#include <linux/module.h> 42#include <linux/module.h>
44#include <linux/netdevice.h> 43#include <linux/netdevice.h>
45#include <linux/types.h> 44#include <linux/types.h>
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 7fe2638ae06d..c490a862e79c 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -37,7 +37,6 @@
37 ****************************************************************************/ 37 ****************************************************************************/
38 38
39#include "common.h" 39#include "common.h"
40#include <linux/config.h>
41#include <linux/module.h> 40#include <linux/module.h>
42#include <linux/init.h> 41#include <linux/init.h>
43#include <linux/pci.h> 42#include <linux/pci.h>
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 53efff6da784..87f94d939ff8 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -39,7 +39,6 @@
39 39
40#include "common.h" 40#include "common.h"
41 41
42#include <linux/config.h>
43#include <linux/types.h> 42#include <linux/types.h>
44#include <linux/errno.h> 43#include <linux/errno.h>
45#include <linux/pci.h> 44#include <linux/pci.h>
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 64105e4eaf31..d3654fd71604 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -218,7 +218,6 @@
218 * 218 *
219 */ 219 */
220 220
221#include <linux/config.h>
222 221
223#include <linux/module.h> 222#include <linux/module.h>
224 223
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index ef54ebeb29b8..47eecce35fa4 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -100,7 +100,6 @@
100 100
101/* Always include 'config.h' first in case the user wants to turn on 101/* Always include 'config.h' first in case the user wants to turn on
102 or override something. */ 102 or override something. */
103#include <linux/config.h>
104#include <linux/module.h> 103#include <linux/module.h>
105 104
106/* 105/*
diff --git a/drivers/net/cs89x0.h b/drivers/net/cs89x0.h
index bd954aaa636f..968fe11a0bf0 100644
--- a/drivers/net/cs89x0.h
+++ b/drivers/net/cs89x0.h
@@ -14,7 +14,6 @@
14 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 14 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 */ 15 */
16 16
17#include <linux/config.h>
18 17
19#define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */ 18#define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */
20 /* offset 2h -> Model/Product Number */ 19 /* offset 2h -> Model/Product Number */
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index d3d958e7ac56..2038ca7e49ce 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -42,7 +42,6 @@
42 * bits. macro 42 * bits. macro
43 */ 43 */
44 44
45#include <linux/config.h>
46#include <linux/crc32.h> 45#include <linux/crc32.h>
47#include <linux/delay.h> 46#include <linux/delay.h>
48#include <linux/errno.h> 47#include <linux/errno.h>
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index e946c43d3b10..b1cbe99249c1 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -235,7 +235,6 @@
235 ========================================================================= 235 =========================================================================
236*/ 236*/
237 237
238#include <linux/config.h>
239#include <linux/module.h> 238#include <linux/module.h>
240#include <linux/kernel.h> 239#include <linux/kernel.h>
241#include <linux/string.h> 240#include <linux/string.h>
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 038447fb5c5e..29778055223b 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -390,7 +390,7 @@ parse_eeprom (struct net_device *dev)
390 for (i = 0; i < 6; i++) 390 for (i = 0; i < 6; i++)
391 dev->dev_addr[i] = psrom->mac_addr[i]; 391 dev->dev_addr[i] = psrom->mac_addr[i];
392 392
393 /* Parse Software Infomation Block */ 393 /* Parse Software Information Block */
394 i = 0x30; 394 i = 0x30;
395 psib = (u8 *) sromdata; 395 psib = (u8 *) sromdata;
396 do { 396 do {
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index dd8c15ac5c77..36d511729f71 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -28,7 +28,6 @@
28 Alan Cox, 30th May 1994 28 Alan Cox, 30th May 1994
29*/ 29*/
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/netdevice.h> 33#include <linux/netdevice.h>
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 93a286570923..a1d676a0df7c 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -138,7 +138,6 @@
138 * - Stratus87247: protect MDI control register manipulations 138 * - Stratus87247: protect MDI control register manipulations
139 */ 139 */
140 140
141#include <linux/config.h>
142#include <linux/module.h> 141#include <linux/module.h>
143#include <linux/moduleparam.h> 142#include <linux/moduleparam.h>
144#include <linux/kernel.h> 143#include <linux/kernel.h>
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 2bc34fbfa69c..3042d33e2d4d 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -34,7 +34,6 @@
34#define _E1000_H_ 34#define _E1000_H_
35 35
36#include <linux/stddef.h> 36#include <linux/stddef.h>
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/types.h> 38#include <linux/types.h>
40#include <asm/byteorder.h> 39#include <asm/byteorder.h>
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index ecf5ad85a684..1e2fbbbb966e 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -87,7 +87,6 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
87/* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/ 87/* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/
88#define PKT_BUF_SZ 1536 88#define PKT_BUF_SZ 1536
89 89
90#include <linux/config.h>
91#include <linux/module.h> 90#include <linux/module.h>
92 91
93#include <linux/kernel.h> 92#include <linux/kernel.h>
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index a74b20715755..33291bcf6d4c 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -97,7 +97,6 @@
97#define LOCKUP16 0 97#define LOCKUP16 0
98#endif 98#endif
99 99
100#include <linux/config.h>
101#include <linux/module.h> 100#include <linux/module.h>
102#include <linux/kernel.h> 101#include <linux/kernel.h>
103#include <linux/types.h> 102#include <linux/types.h>
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index ee34a16eb4e2..b160abed8dd7 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -114,7 +114,6 @@ static int rx_copybreak;
114#define TX_FIFO_THRESH 256 114#define TX_FIFO_THRESH 256
115#define RX_FIFO_THRESH 1 /* 0-3, 0==32, 64,96, or 3==128 bytes */ 115#define RX_FIFO_THRESH 1 /* 0-3, 0==32, 64,96, or 3==128 bytes */
116 116
117#include <linux/config.h>
118#include <linux/module.h> 117#include <linux/module.h>
119#include <linux/kernel.h> 118#include <linux/kernel.h>
120#include <linux/string.h> 119#include <linux/string.h>
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index db694c832989..9b4030031744 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -25,7 +25,6 @@
25 * Copyright (c) 2004-2006 Macq Electronique SA. 25 * Copyright (c) 2004-2006 Macq Electronique SA.
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/string.h> 30#include <linux/string.h>
diff --git a/drivers/net/fec_8xx/fec_8xx-netta.c b/drivers/net/fec_8xx/fec_8xx-netta.c
index 29c275e1d566..790d9dbe42dd 100644
--- a/drivers/net/fec_8xx/fec_8xx-netta.c
+++ b/drivers/net/fec_8xx/fec_8xx-netta.c
@@ -2,7 +2,6 @@
2 * FEC instantatiation file for NETTA 2 * FEC instantatiation file for NETTA
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/types.h> 6#include <linux/types.h>
8#include <linux/sched.h> 7#include <linux/sched.h>
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 7e4338097139..282b1452c39a 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -10,7 +10,6 @@
10 * Released under the GPL 10 * Released under the GPL
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/types.h> 15#include <linux/types.h>
diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c
index 3b44ac1a7bfe..d3c16b85d9a4 100644
--- a/drivers/net/fec_8xx/fec_mii.c
+++ b/drivers/net/fec_8xx/fec_mii.c
@@ -10,7 +10,6 @@
10 * Released under the GPL 10 * Released under the GPL
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 196298f33db8..e96a93c94941 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -15,7 +15,6 @@
15 * kind, whether express or implied. 15 * kind, whether express or implied.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/types.h> 20#include <linux/types.h>
diff --git a/drivers/net/fs_enet/fs_enet-mii.c b/drivers/net/fs_enet/fs_enet-mii.c
index 0cd07150bf4a..b7e6e21725cb 100644
--- a/drivers/net/fs_enet/fs_enet-mii.c
+++ b/drivers/net/fs_enet/fs_enet-mii.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 95e2bb8dd7b4..64e20982c1fe 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -12,7 +12,6 @@
12 * kind, whether express or implied. 12 * kind, whether express or implied.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 3dad69dfdb2c..e09547077529 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -12,7 +12,6 @@
12 * kind, whether express or implied. 12 * kind, whether express or implied.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index a772b286f96d..eaa24fab645f 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -12,7 +12,6 @@
12 * kind, whether express or implied. 12 * kind, whether express or implied.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index 24a5e2e23d18..48f9cf83ab6f 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/net/fs_enet/mii-fixed.c b/drivers/net/fs_enet/mii-fixed.c
index b3e192d612e5..ae4a9c3bb393 100644
--- a/drivers/net/fs_enet/mii-fixed.c
+++ b/drivers/net/fs_enet/mii-fixed.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 218d31764c52..ebbbd6ca6204 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -64,7 +64,6 @@
64 * The driver then cleans up the buffer. 64 * The driver then cleans up the buffer.
65 */ 65 */
66 66
67#include <linux/config.h>
68#include <linux/kernel.h> 67#include <linux/kernel.h>
69#include <linux/sched.h> 68#include <linux/sched.h>
70#include <linux/string.h> 69#include <linux/string.h>
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 127c98cf3336..f87bbc408dae 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -22,7 +22,6 @@
22#ifndef __GIANFAR_H 22#ifndef __GIANFAR_H
23#define __GIANFAR_H 23#define __GIANFAR_H
24 24
25#include <linux/config.h>
26#include <linux/kernel.h> 25#include <linux/kernel.h>
27#include <linux/sched.h> 26#include <linux/sched.h>
28#include <linux/string.h> 27#include <linux/string.h>
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index d69698c695ef..e0f505285e50 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -15,7 +15,6 @@
15 * by reference. 15 * by reference.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/sched.h> 19#include <linux/sched.h>
21#include <linux/string.h> 20#include <linux/string.h>
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index c6b725529af5..c92e65984fd0 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -16,7 +16,6 @@
16 * 16 *
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
22#include <linux/string.h> 21#include <linux/string.h>
diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index a6d5c43199cb..e8a18f18d08c 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -19,7 +19,6 @@
19 * Sysfs file creation and management 19 * Sysfs file creation and management
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/sched.h> 23#include <linux/sched.h>
25#include <linux/string.h> 24#include <linux/string.h>
diff --git a/drivers/net/gt96100eth.h b/drivers/net/gt96100eth.h
index 395869c5ed3e..2a8331938b84 100644
--- a/drivers/net/gt96100eth.h
+++ b/drivers/net/gt96100eth.h
@@ -27,7 +27,6 @@
27#ifndef _GT96100ETH_H 27#ifndef _GT96100ETH_H
28#define _GT96100ETH_H 28#define _GT96100ETH_H
29 29
30#include <linux/config.h>
31#include <asm/galileo-boards/gt96100.h> 30#include <asm/galileo-boards/gt96100.h>
32 31
33#define dbg(lvl, format, arg...) \ 32#define dbg(lvl, format, arg...) \
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index d12605f0ac7c..86b3bb9bec2d 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -12,7 +12,6 @@
12 * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 12 * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <asm/system.h> 16#include <asm/system.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index cb43a9d28774..0641f54fc638 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -54,7 +54,6 @@
54 * BPQ 004 Joerg(DL1BKE) Fixed to not lock up on ifconfig. 54 * BPQ 004 Joerg(DL1BKE) Fixed to not lock up on ifconfig.
55 */ 55 */
56 56
57#include <linux/config.h>
58#include <linux/errno.h> 57#include <linux/errno.h>
59#include <linux/types.h> 58#include <linux/types.h>
60#include <linux/socket.h> 59#include <linux/socket.h>
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 3ebbbe56b6e9..d8715b200c17 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -16,7 +16,6 @@
16 * Copyright (C) 2004, 05 Ralf Baechle DL5RB <ralf@linux-mips.org> 16 * Copyright (C) 2004, 05 Ralf Baechle DL5RB <ralf@linux-mips.org>
17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de> 17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de>
18 */ 18 */
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <asm/system.h> 20#include <asm/system.h>
22#include <linux/bitops.h> 21#include <linux/bitops.h>
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 5927784df3f9..b9b10caa031c 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -148,7 +148,6 @@
148 148
149/* ----------------------------------------------------------------------- */ 149/* ----------------------------------------------------------------------- */
150 150
151#include <linux/config.h>
152#include <linux/module.h> 151#include <linux/module.h>
153#include <linux/errno.h> 152#include <linux/errno.h>
154#include <linux/signal.h> 153#include <linux/signal.h>
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index b49884048caa..dd2f11c98530 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -42,7 +42,6 @@
42 42
43/*****************************************************************************/ 43/*****************************************************************************/
44 44
45#include <linux/config.h>
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/types.h> 46#include <linux/types.h>
48#include <linux/net.h> 47#include <linux/net.h>
diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h
index c2dae6092c4c..97ed22bb4320 100644
--- a/drivers/net/ibm_emac/ibm_emac.h
+++ b/drivers/net/ibm_emac/ibm_emac.h
@@ -20,7 +20,6 @@
20#ifndef __IBM_EMAC_H_ 20#ifndef __IBM_EMAC_H_
21#define __IBM_EMAC_H_ 21#define __IBM_EMAC_H_
22 22
23#include <linux/config.h>
24#include <linux/types.h> 23#include <linux/types.h>
25 24
26/* This is a simple check to prevent use of this driver on non-tested SoCs */ 25/* This is a simple check to prevent use of this driver on non-tested SoCs */
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 7e49522b8b3c..82468e2dc799 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -19,7 +19,6 @@
19 * 19 *
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h
index f61273b2e94f..dabb94afeb98 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.h
+++ b/drivers/net/ibm_emac/ibm_emac_core.h
@@ -20,7 +20,6 @@
20#ifndef __IBM_EMAC_CORE_H_ 20#ifndef __IBM_EMAC_CORE_H_
21#define __IBM_EMAC_CORE_H_ 21#define __IBM_EMAC_CORE_H_
22 22
23#include <linux/config.h>
24#include <linux/netdevice.h> 23#include <linux/netdevice.h>
25#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
26#include <asm/ocp.h> 25#include <asm/ocp.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_debug.c b/drivers/net/ibm_emac/ibm_emac_debug.c
index c7e1ecfa08fe..c3645908034d 100644
--- a/drivers/net/ibm_emac/ibm_emac_debug.c
+++ b/drivers/net/ibm_emac/ibm_emac_debug.c
@@ -12,7 +12,6 @@
12 * option) any later version. 12 * option) any later version.
13 * 13 *
14 */ 14 */
15#include <linux/config.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_debug.h b/drivers/net/ibm_emac/ibm_emac_debug.h
index e85fbe0a8da9..5761389495d0 100644
--- a/drivers/net/ibm_emac/ibm_emac_debug.h
+++ b/drivers/net/ibm_emac/ibm_emac_debug.h
@@ -15,7 +15,6 @@
15#ifndef __IBM_EMAC_DEBUG_H_ 15#ifndef __IBM_EMAC_DEBUG_H_
16#define __IBM_EMAC_DEBUG_H_ 16#define __IBM_EMAC_DEBUG_H_
17 17
18#include <linux/config.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include "ibm_emac_core.h" 19#include "ibm_emac_core.h"
21#include "ibm_emac_mal.h" 20#include "ibm_emac_mal.h"
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.c b/drivers/net/ibm_emac/ibm_emac_mal.c
index da88d43081cc..af50e7b2e0d7 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.c
+++ b/drivers/net/ibm_emac/ibm_emac_mal.c
@@ -19,7 +19,6 @@
19 * option) any later version. 19 * option) any later version.
20 * 20 *
21 */ 21 */
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h
index 2a2d3b24b037..f73f10a0a562 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.h
+++ b/drivers/net/ibm_emac/ibm_emac_mal.h
@@ -19,7 +19,6 @@
19#ifndef __IBM_EMAC_MAL_H_ 19#ifndef __IBM_EMAC_MAL_H_
20#define __IBM_EMAC_MAL_H_ 20#define __IBM_EMAC_MAL_H_
21 21
22#include <linux/config.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/list.h> 23#include <linux/list.h>
25#include <linux/netdevice.h> 24#include <linux/netdevice.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c
index 67935dd33a65..4a97024061e5 100644
--- a/drivers/net/ibm_emac/ibm_emac_phy.c
+++ b/drivers/net/ibm_emac/ibm_emac_phy.c
@@ -12,7 +12,6 @@
12 * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net> 12 * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net>
13 * 13 *
14 */ 14 */
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.c b/drivers/net/ibm_emac/ibm_emac_rgmii.c
index f0b1ffb2dbbf..53d281cb9a16 100644
--- a/drivers/net/ibm_emac/ibm_emac_rgmii.c
+++ b/drivers/net/ibm_emac/ibm_emac_rgmii.c
@@ -16,7 +16,6 @@
16 * option) any later version. 16 * option) any later version.
17 * 17 *
18 */ 18 */
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/ethtool.h> 20#include <linux/ethtool.h>
22#include <asm/io.h> 21#include <asm/io.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h
index 7f03d536c9a3..94abde55e2e9 100644
--- a/drivers/net/ibm_emac/ibm_emac_rgmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h
@@ -21,7 +21,6 @@
21#ifndef _IBM_EMAC_RGMII_H_ 21#ifndef _IBM_EMAC_RGMII_H_
22#define _IBM_EMAC_RGMII_H_ 22#define _IBM_EMAC_RGMII_H_
23 23
24#include <linux/config.h>
25 24
26/* RGMII bridge */ 25/* RGMII bridge */
27struct rgmii_regs { 26struct rgmii_regs {
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.c b/drivers/net/ibm_emac/ibm_emac_tah.c
index af08afc22f9f..e287b451bb44 100644
--- a/drivers/net/ibm_emac/ibm_emac_tah.c
+++ b/drivers/net/ibm_emac/ibm_emac_tah.c
@@ -13,7 +13,6 @@
13 * Free Software Foundation; either version 2 of the License, or (at your 13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version. 14 * option) any later version.
15 */ 15 */
16#include <linux/config.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
19#include "ibm_emac_core.h" 18#include "ibm_emac_core.h"
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.h b/drivers/net/ibm_emac/ibm_emac_tah.h
index 9299b5dd7eb1..38153945a240 100644
--- a/drivers/net/ibm_emac/ibm_emac_tah.h
+++ b/drivers/net/ibm_emac/ibm_emac_tah.h
@@ -17,7 +17,6 @@
17#ifndef _IBM_EMAC_TAH_H 17#ifndef _IBM_EMAC_TAH_H
18#define _IBM_EMAC_TAH_H 18#define _IBM_EMAC_TAH_H
19 19
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <asm/ocp.h> 21#include <asm/ocp.h>
23 22
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c
index e129e0aaa045..37dc8f342868 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.c
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.c
@@ -16,7 +16,6 @@
16 * option) any later version. 16 * option) any later version.
17 * 17 *
18 */ 18 */
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/ethtool.h> 20#include <linux/ethtool.h>
22#include <asm/io.h> 21#include <asm/io.h>
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h
index 92c854410753..972e3a44a09f 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.h
@@ -19,7 +19,6 @@
19#ifndef _IBM_EMAC_ZMII_H_ 19#ifndef _IBM_EMAC_ZMII_H_
20#define _IBM_EMAC_ZMII_H_ 20#define _IBM_EMAC_ZMII_H_
21 21
22#include <linux/config.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <asm/ocp.h> 23#include <asm/ocp.h>
25 24
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 4c2e7279ba34..0464e78f733a 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -33,7 +33,6 @@
33 - possibly remove procfs support 33 - possibly remove procfs support
34*/ 34*/
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/errno.h> 38#include <linux/errno.h>
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 2e222ef91e22..3a42afab5036 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -27,7 +27,6 @@
27*/ 27*/
28 28
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/netdevice.h> 32#include <linux/netdevice.h>
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index e76e6e7be0b1..dbf67750d899 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -30,7 +30,6 @@
30#define IOC3_NAME "ioc3-eth" 30#define IOC3_NAME "ioc3-eth"
31#define IOC3_VERSION "2.6.3-3" 31#define IOC3_VERSION "2.6.3-3"
32 32
33#include <linux/config.h>
34#include <linux/init.h> 33#include <linux/init.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index e6b1985767c2..7b2b4135bb23 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -18,7 +18,6 @@
18 * with this program; if not, write to the Free Software Foundation, Inc., 18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */ 20 */
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/init.h> 23#include <linux/init.h>
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index e1aa9910503b..afb19e8d95c8 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -12,7 +12,6 @@
12 * Infra-red driver (SIR/FIR) for the PXA2xx embedded microprocessor 12 * Infra-red driver (SIR/FIR) for the PXA2xx embedded microprocessor
13 * 13 *
14 */ 14 */
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/init.h> 17#include <linux/init.h>
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index f530686bd09f..8d5a288d7976 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -18,7 +18,6 @@
18 * power_leve:level - set the transmitter power level 18 * power_leve:level - set the transmitter power level
19 * tx_lpm:0|1 - set transmit low power mode 19 * tx_lpm:0|1 - set transmit low power mode
20 */ 20 */
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
24#include <linux/types.h> 23#include <linux/types.h>
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index d70b9e8d6e60..b9f28b14b3ae 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -21,7 +21,6 @@
21 * 21 *
22 ********************************************************************/ 22 ********************************************************************/
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
27#define DRIVER_NAME "vlsi_ir" 26#define DRIVER_NAME "vlsi_ir"
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 93394d76587a..cdc14401cdbe 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -56,7 +56,6 @@
56 * number of packets outstanding to a remote partition at a time. 56 * number of packets outstanding to a remote partition at a time.
57 */ 57 */
58 58
59#include <linux/config.h>
60#include <linux/module.h> 59#include <linux/module.h>
61#include <linux/types.h> 60#include <linux/types.h>
62#include <linux/errno.h> 61#include <linux/errno.h>
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index a83ef28dadb0..82b67af54c94 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -30,7 +30,6 @@
30#define _IXGB_H_ 30#define _IXGB_H_
31 31
32#include <linux/stddef.h> 32#include <linux/stddef.h>
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/types.h> 34#include <linux/types.h>
36#include <asm/byteorder.h> 35#include <asm/byteorder.h>
diff --git a/drivers/net/ixp2000/caleb.c b/drivers/net/ixp2000/caleb.c
index 3595e107df22..7dea5b95012c 100644
--- a/drivers/net/ixp2000/caleb.c
+++ b/drivers/net/ixp2000/caleb.c
@@ -9,7 +9,6 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/delay.h> 13#include <linux/delay.h>
15#include <asm/io.h> 14#include <asm/io.h>
diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c
index b67f586d7392..d3f4235c585d 100644
--- a/drivers/net/ixp2000/enp2611.c
+++ b/drivers/net/ixp2000/enp2611.c
@@ -9,7 +9,6 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/netdevice.h> 14#include <linux/netdevice.h>
diff --git a/drivers/net/ixp2000/ixp2400-msf.c b/drivers/net/ixp2000/ixp2400-msf.c
index 48a3a891d3a4..9ec38eebfb56 100644
--- a/drivers/net/ixp2000/ixp2400-msf.c
+++ b/drivers/net/ixp2000/ixp2400-msf.c
@@ -11,7 +11,6 @@
11 * License, or (at your option) any later version. 11 * License, or (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <asm/hardware.h> 16#include <asm/hardware.h>
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c
index fbc2d21020f4..99229a0456d9 100644
--- a/drivers/net/ixp2000/ixpdev.c
+++ b/drivers/net/ixp2000/ixpdev.c
@@ -9,7 +9,6 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/netdevice.h> 14#include <linux/netdevice.h>
diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c
index 5224651c9aac..e08d3f9863b8 100644
--- a/drivers/net/ixp2000/pm3386.c
+++ b/drivers/net/ixp2000/pm3386.c
@@ -9,7 +9,6 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/delay.h> 13#include <linux/delay.h>
15#include <linux/netdevice.h> 14#include <linux/netdevice.h>
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 77792b286027..f2c0bf89f0c7 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -5,7 +5,6 @@
5 * Copyright (C) 1996 Paul Mackerras. 5 * Copyright (C) 1996 Paul Mackerras.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/netdevice.h> 10#include <linux/netdevice.h>
diff --git a/drivers/net/mv643xx_eth.h b/drivers/net/mv643xx_eth.h
index 4262c1da6d4a..33c5fafdbbd3 100644
--- a/drivers/net/mv643xx_eth.h
+++ b/drivers/net/mv643xx_eth.h
@@ -258,7 +258,7 @@ struct pkt_info {
258 struct sk_buff *return_info; /* User resource return information */ 258 struct sk_buff *return_info; /* User resource return information */
259}; 259};
260 260
261/* Ethernet port specific infomation */ 261/* Ethernet port specific information */
262 262
263struct mv643xx_mib_counters { 263struct mv643xx_mib_counters {
264 u64 good_octets_received; 264 u64 good_octets_received;
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index d9f616fea3d9..19981065efb4 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -7,7 +7,6 @@ static char version[] =
7 "myri_sbus.c:v2.0 June 23, 2006 David S. Miller (davem@davemloft.net)\n"; 7 "myri_sbus.c:v2.0 June 23, 2006 David S. Miller (davem@davemloft.net)\n";
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/config.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/types.h> 12#include <linux/types.h>
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 5657049c2160..438c63f940b9 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -138,7 +138,6 @@
138 * big endian support with CFG:BEM instead of cpu_to_le32 138 * big endian support with CFG:BEM instead of cpu_to_le32
139*/ 139*/
140 140
141#include <linux/config.h>
142#include <linux/module.h> 141#include <linux/module.h>
143#include <linux/kernel.h> 142#include <linux/kernel.h>
144#include <linux/string.h> 143#include <linux/string.h>
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 706aed7d717f..deedd7b2af5d 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -96,7 +96,6 @@
96//#define dprintk printk 96//#define dprintk printk
97#define dprintk(x...) do { } while (0) 97#define dprintk(x...) do { } while (0)
98 98
99#include <linux/config.h>
100#include <linux/module.h> 99#include <linux/module.h>
101#include <linux/moduleparam.h> 100#include <linux/moduleparam.h>
102#include <linux/types.h> 101#include <linux/types.h>
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index a7bb54df75a8..978b95afc721 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -85,7 +85,6 @@ IVc. Errata
85 85
86*/ 86*/
87 87
88#include <linux/config.h>
89#include <linux/module.h> 88#include <linux/module.h>
90#include <linux/kernel.h> 89#include <linux/kernel.h>
91#include <linux/pci.h> 90#include <linux/pci.h>
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 441de824ab6b..48434d7924eb 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -387,7 +387,10 @@ static int com20020_resume(struct pcmcia_device *link)
387} 387}
388 388
389static struct pcmcia_device_id com20020_ids[] = { 389static struct pcmcia_device_id com20020_ids[] = {
390 PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf), 390 PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.",
391 "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
392 PCMCIA_DEVICE_PROD_ID12("SoHard AG",
393 "SH ARC PCMCIA", 0xf8991729, 0x69dff0c7),
391 PCMCIA_DEVICE_NULL 394 PCMCIA_DEVICE_NULL
392}; 395};
393MODULE_DEVICE_TABLE(pcmcia, com20020_ids); 396MODULE_DEVICE_TABLE(pcmcia, com20020_ids);
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
index 7d8d534255c0..3efb715c28dc 100644
--- a/drivers/net/phy/cicada.c
+++ b/drivers/net/phy/cicada.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 5e9002e444c5..aa7983f55838 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index 3f702c503afe..69d2325f848c 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index a2d6386d13bc..0ad253282d0d 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 1b236bdf6b92..1dde390c164d 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 33cec2dab942..44bcd3eb2b83 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -14,7 +14,6 @@
14 * option) any later version. 14 * option) any later version.
15 * 15 *
16 */ 16 */
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 7da0e3dd5fe3..1bc1e032c5d6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -14,7 +14,6 @@
14 * option) any later version. 14 * option) any later version.
15 * 15 *
16 */ 16 */
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
diff --git a/drivers/net/phy/qsemi.c b/drivers/net/phy/qsemi.c
index 65d995b02b25..2b50e1739aa5 100644
--- a/drivers/net/phy/qsemi.c
+++ b/drivers/net/phy/qsemi.c
@@ -13,7 +13,6 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 425ff5b117f1..0ec6e9d57b94 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -22,7 +22,6 @@
22 * ==FILEVERSION 20041108== 22 * ==FILEVERSION 20041108==
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/kmod.h> 27#include <linux/kmod.h>
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c
index 1985d1b57c45..51ff9a9d1bb5 100644
--- a/drivers/net/ppp_mppe.c
+++ b/drivers/net/ppp_mppe.c
@@ -43,7 +43,6 @@
43 * deprecated in 2.6 43 * deprecated in 2.6
44 */ 44 */
45 45
46#include <linux/config.h>
47#include <linux/module.h> 46#include <linux/module.h>
48#include <linux/kernel.h> 47#include <linux/kernel.h>
49#include <linux/version.h> 48#include <linux/version.h>
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index 19c2df9c86fe..757c542ac40a 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -28,7 +28,6 @@
28#define RX_DMA_SKBUFF 1 28#define RX_DMA_SKBUFF 1
29#define PKT_COPY_THRESHOLD 512 29#define PKT_COPY_THRESHOLD 512
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/errno.h> 33#include <linux/errno.h>
diff --git a/drivers/net/rrunner.h b/drivers/net/rrunner.h
index 10baae55953a..2c3c91ebd99f 100644
--- a/drivers/net/rrunner.h
+++ b/drivers/net/rrunner.h
@@ -1,7 +1,6 @@
1#ifndef _RRUNNER_H_ 1#ifndef _RRUNNER_H_
2#define _RRUNNER_H_ 2#define _RRUNNER_H_
3 3
4#include <linux/config.h>
5#include <linux/interrupt.h> 4#include <linux/interrupt.h>
6 5
7#if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64)) 6#if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64))
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 3defe5d4f7d3..001344c0763e 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -44,7 +44,6 @@
44 * aggregated as a single large packet 44 * aggregated as a single large packet
45 ************************************************************************/ 45 ************************************************************************/
46 46
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
50#include <linux/errno.h> 49#include <linux/errno.h>
@@ -3960,7 +3959,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3960 txdp->Control_2 = 0; 3959 txdp->Control_2 = 0;
3961#ifdef NETIF_F_TSO 3960#ifdef NETIF_F_TSO
3962 mss = skb_shinfo(skb)->gso_size; 3961 mss = skb_shinfo(skb)->gso_size;
3963 if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) { 3962 if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
3964 txdp->Control_1 |= TXD_TCP_LSO_EN; 3963 txdp->Control_1 |= TXD_TCP_LSO_EN;
3965 txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); 3964 txdp->Control_1 |= TXD_TCP_LSO_MSS(mss);
3966 } 3965 }
@@ -3980,7 +3979,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3980 } 3979 }
3981 3980
3982 frg_len = skb->len - skb->data_len; 3981 frg_len = skb->len - skb->data_len;
3983 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) { 3982 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) {
3984 int ufo_size; 3983 int ufo_size;
3985 3984
3986 ufo_size = skb_shinfo(skb)->gso_size; 3985 ufo_size = skb_shinfo(skb)->gso_size;
@@ -4009,7 +4008,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4009 txdp->Host_Control = (unsigned long) skb; 4008 txdp->Host_Control = (unsigned long) skb;
4010 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); 4009 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
4011 4010
4012 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) 4011 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4013 txdp->Control_1 |= TXD_UFO_EN; 4012 txdp->Control_1 |= TXD_UFO_EN;
4014 4013
4015 frg_cnt = skb_shinfo(skb)->nr_frags; 4014 frg_cnt = skb_shinfo(skb)->nr_frags;
@@ -4024,12 +4023,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4024 (sp->pdev, frag->page, frag->page_offset, 4023 (sp->pdev, frag->page, frag->page_offset,
4025 frag->size, PCI_DMA_TODEVICE); 4024 frag->size, PCI_DMA_TODEVICE);
4026 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); 4025 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
4027 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) 4026 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4028 txdp->Control_1 |= TXD_UFO_EN; 4027 txdp->Control_1 |= TXD_UFO_EN;
4029 } 4028 }
4030 txdp->Control_1 |= TXD_GATHER_CODE_LAST; 4029 txdp->Control_1 |= TXD_GATHER_CODE_LAST;
4031 4030
4032 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) 4031 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4033 frg_cnt++; /* as Txd0 was used for inband header */ 4032 frg_cnt++; /* as Txd0 was used for inband header */
4034 4033
4035 tx_fifo = mac_control->tx_FIFO_start[queue]; 4034 tx_fifo = mac_control->tx_FIFO_start[queue];
@@ -4043,7 +4042,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4043 if (mss) 4042 if (mss)
4044 val64 |= TX_FIFO_SPECIAL_FUNC; 4043 val64 |= TX_FIFO_SPECIAL_FUNC;
4045#endif 4044#endif
4046 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) 4045 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4047 val64 |= TX_FIFO_SPECIAL_FUNC; 4046 val64 |= TX_FIFO_SPECIAL_FUNC;
4048 writeq(val64, &tx_fifo->List_Control); 4047 writeq(val64, &tx_fifo->List_Control);
4049 4048
@@ -7021,6 +7020,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7021#ifdef NETIF_F_TSO 7020#ifdef NETIF_F_TSO
7022 dev->features |= NETIF_F_TSO; 7021 dev->features |= NETIF_F_TSO;
7023#endif 7022#endif
7023#ifdef NETIF_F_TSO6
7024 dev->features |= NETIF_F_TSO6;
7025#endif
7024 if (sp->device_type & XFRAME_II_DEVICE) { 7026 if (sp->device_type & XFRAME_II_DEVICE) {
7025 dev->features |= NETIF_F_UFO; 7027 dev->features |= NETIF_F_UFO;
7026 dev->features |= NETIF_F_HW_CSUM; 7028 dev->features |= NETIF_F_HW_CSUM;
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 3203732a668d..c43f52179708 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -652,7 +652,7 @@ typedef struct fifo_info {
652 nic_t *nic; 652 nic_t *nic;
653}fifo_info_t; 653}fifo_info_t;
654 654
655/* Infomation related to the Tx and Rx FIFOs and Rings of Xena 655/* Information related to the Tx and Rx FIFOs and Rings of Xena
656 * is maintained in this structure. 656 * is maintained in this structure.
657 */ 657 */
658typedef struct mac_info { 658typedef struct mac_info {
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index f2be9f83f091..c7b5f0004e54 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -31,7 +31,6 @@
31#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
32#include <linux/skbuff.h> 32#include <linux/skbuff.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/config.h>
35#include <linux/bitops.h> 34#include <linux/bitops.h>
36#include <asm/processor.h> /* Processor type for cache alignment. */ 35#include <asm/processor.h> /* Processor type for cache alignment. */
37#include <asm/io.h> 36#include <asm/io.h>
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
index 88e212043a43..c7832e69f177 100644
--- a/drivers/net/shaper.c
+++ b/drivers/net/shaper.c
@@ -69,7 +69,6 @@
69 * 2000/03 Andi Kleen 69 * 2000/03 Andi Kleen
70 */ 70 */
71 71
72#include <linux/config.h>
73#include <linux/module.h> 72#include <linux/module.h>
74#include <linux/kernel.h> 73#include <linux/kernel.h>
75#include <linux/fcntl.h> 74#include <linux/fcntl.h>
diff --git a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c
index 17786056c66a..1e662aaebf84 100644
--- a/drivers/net/sk98lin/skvpd.c
+++ b/drivers/net/sk98lin/skvpd.c
@@ -22,7 +22,7 @@
22 ******************************************************************************/ 22 ******************************************************************************/
23 23
24/* 24/*
25 Please refer skvpd.txt for infomation how to include this module 25 Please refer skvpd.txt for information how to include this module
26 */ 26 */
27static const char SysKonnectFileId[] = 27static const char SysKonnectFileId[] =
28 "@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK"; 28 "@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK";
diff --git a/drivers/net/skfp/h/sba.h b/drivers/net/skfp/h/sba.h
index df716cd5784a..638cf0283bc4 100644
--- a/drivers/net/skfp/h/sba.h
+++ b/drivers/net/skfp/h/sba.h
@@ -13,7 +13,7 @@
13 ******************************************************************************/ 13 ******************************************************************************/
14 14
15/* 15/*
16 * Synchronous Bandwith Allocation (SBA) structs 16 * Synchronous Bandwidth Allocation (SBA) structs
17 */ 17 */
18 18
19#ifndef _SBA_ 19#ifndef _SBA_
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 1608efab4e3d..82df13be3d40 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -24,7 +24,6 @@
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/in.h> 27#include <linux/in.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/module.h> 29#include <linux/module.h>
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index e122007e16da..3f1b0fef13e7 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/crc32.h> 26#include <linux/crc32.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/version.h> 28#include <linux/version.h>
diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c
index c6fbb1ede0ed..3a1b7131681c 100644
--- a/drivers/net/slhc.c
+++ b/drivers/net/slhc.c
@@ -50,7 +50,6 @@
50 * driver code belonging close to PPP and SLIP 50 * driver code belonging close to PPP and SLIP
51 */ 51 */
52 52
53#include <linux/config.h>
54#include <linux/module.h> 53#include <linux/module.h>
55#include <linux/types.h> 54#include <linux/types.h>
56#include <linux/string.h> 55#include <linux/string.h>
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index b2e18d28850d..1588cb7f6c83 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -55,7 +55,6 @@
55 */ 55 */
56 56
57#define SL_CHECK_TRANSMIT 57#define SL_CHECK_TRANSMIT
58#include <linux/config.h>
59#include <linux/module.h> 58#include <linux/module.h>
60#include <linux/moduleparam.h> 59#include <linux/moduleparam.h>
61 60
diff --git a/drivers/net/slip.h b/drivers/net/slip.h
index ab3efe66a642..29d87dd45a24 100644
--- a/drivers/net/slip.h
+++ b/drivers/net/slip.h
@@ -22,7 +22,6 @@
22#ifndef _LINUX_SLIP_H 22#ifndef _LINUX_SLIP_H
23#define _LINUX_SLIP_H 23#define _LINUX_SLIP_H
24 24
25#include <linux/config.h>
26 25
27#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED) 26#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
28# define SL_INCLUDE_CSLIP 27# define SL_INCLUDE_CSLIP
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c
index 5b4e8529d4ab..45449353a958 100644
--- a/drivers/net/smc-ultra.c
+++ b/drivers/net/smc-ultra.c
@@ -57,7 +57,6 @@
57static const char version[] = 57static const char version[] =
58 "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n"; 58 "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
59 59
60#include <linux/config.h>
61#include <linux/module.h> 60#include <linux/module.h>
62#include <linux/kernel.h> 61#include <linux/kernel.h>
63#include <linux/errno.h> 62#include <linux/errno.h>
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 0e9833adf9fe..3d8dcb6c8758 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -66,7 +66,6 @@ static const char version[] =
66#endif 66#endif
67 67
68 68
69#include <linux/config.h>
70#include <linux/init.h> 69#include <linux/init.h>
71#include <linux/module.h> 70#include <linux/module.h>
72#include <linux/kernel.h> 71#include <linux/kernel.h>
diff --git a/drivers/net/sonic.h b/drivers/net/sonic.h
index cede969a8baa..7f5c4ebcc17a 100644
--- a/drivers/net/sonic.h
+++ b/drivers/net/sonic.h
@@ -22,7 +22,6 @@
22#ifndef SONIC_H 22#ifndef SONIC_H
23#define SONIC_H 23#define SONIC_H
24 24
25#include <linux/config.h>
26 25
27/* 26/*
28 * SONIC register offsets 27 * SONIC register offsets
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 394339d5e87c..e0b72676922c 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -21,7 +21,6 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/compiler.h> 24#include <linux/compiler.h>
26#include <linux/crc32.h> 25#include <linux/crc32.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index c158eedc7813..f91be95356a4 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -146,7 +146,6 @@ TODO: - fix forced speed/duplexing code (broken a long time ago, when
146#define DRV_VERSION "1.03+LK1.4.2.1" 146#define DRV_VERSION "1.03+LK1.4.2.1"
147#define DRV_RELDATE "October 3, 2005" 147#define DRV_RELDATE "October 3, 2005"
148 148
149#include <linux/config.h>
150#include <linux/module.h> 149#include <linux/module.h>
151#include <linux/kernel.h> 150#include <linux/kernel.h>
152#include <linux/pci.h> 151#include <linux/pci.h>
diff --git a/drivers/net/stnic.c b/drivers/net/stnic.c
index b6dfdf8f44da..74228348995d 100644
--- a/drivers/net/stnic.c
+++ b/drivers/net/stnic.c
@@ -7,7 +7,6 @@
7 * Copyright (C) 1999 kaz Kojima 7 * Copyright (C) 1999 kaz Kojima
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index 9282b4b0c022..278c7cb22216 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -19,7 +19,6 @@
19 * of darwin, still need to reverse engineer that 19 * of darwin, still need to reverse engineer that
20 */ 20 */
21 21
22#include <linux/config.h>
23 22
24#include <linux/module.h> 23#include <linux/module.h>
25 24
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 9b246e44f756..d85b83204f6b 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -13,7 +13,6 @@
13 * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50 13 * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/types.h> 18#include <linux/types.h>
diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h
index 9b7ccaeeee89..90f446db9ba2 100644
--- a/drivers/net/sunhme.h
+++ b/drivers/net/sunhme.h
@@ -8,7 +8,6 @@
8#ifndef _SUNHME_H 8#ifndef _SUNHME_H
9#define _SUNHME_H 9#define _SUNHME_H
10 10
11#include <linux/config.h>
12#include <linux/pci.h> 11#include <linux/pci.h>
13 12
14/* Happy Meal global registers. */ 13/* Happy Meal global registers. */
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 2c239ab63a80..5b0b60f4d20e 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -71,7 +71,6 @@
71 71
72static char lancestr[] = "LANCE"; 72static char lancestr[] = "LANCE";
73 73
74#include <linux/config.h>
75#include <linux/module.h> 74#include <linux/module.h>
76#include <linux/kernel.h> 75#include <linux/kernel.h>
77#include <linux/types.h> 76#include <linux/types.h>
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 35f931638750..953255e92633 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -15,7 +15,6 @@
15 * notice is accompanying it. 15 * notice is accompanying it.
16 */ 16 */
17 17
18#include <linux/config.h>
19 18
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/moduleparam.h> 20#include <linux/moduleparam.h>
@@ -69,8 +68,8 @@
69 68
70#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
71#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
72#define DRV_MODULE_VERSION "3.60" 71#define DRV_MODULE_VERSION "3.61"
73#define DRV_MODULE_RELDATE "June 17, 2006" 72#define DRV_MODULE_RELDATE "June 29, 2006"
74 73
75#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
76#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -3195,7 +3194,7 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag)
3195 */ 3194 */
3196static int tg3_rx(struct tg3 *tp, int budget) 3195static int tg3_rx(struct tg3 *tp, int budget)
3197{ 3196{
3198 u32 work_mask; 3197 u32 work_mask, rx_std_posted = 0;
3199 u32 sw_idx = tp->rx_rcb_ptr; 3198 u32 sw_idx = tp->rx_rcb_ptr;
3200 u16 hw_idx; 3199 u16 hw_idx;
3201 int received; 3200 int received;
@@ -3222,6 +3221,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
3222 mapping); 3221 mapping);
3223 skb = tp->rx_std_buffers[desc_idx].skb; 3222 skb = tp->rx_std_buffers[desc_idx].skb;
3224 post_ptr = &tp->rx_std_ptr; 3223 post_ptr = &tp->rx_std_ptr;
3224 rx_std_posted++;
3225 } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) { 3225 } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) {
3226 dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx], 3226 dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx],
3227 mapping); 3227 mapping);
@@ -3309,6 +3309,15 @@ static int tg3_rx(struct tg3 *tp, int budget)
3309 3309
3310next_pkt: 3310next_pkt:
3311 (*post_ptr)++; 3311 (*post_ptr)++;
3312
3313 if (unlikely(rx_std_posted >= tp->rx_std_max_post)) {
3314 u32 idx = *post_ptr % TG3_RX_RING_SIZE;
3315
3316 tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX +
3317 TG3_64BIT_REG_LOW, idx);
3318 work_mask &= ~RXD_OPAQUE_RING_STD;
3319 rx_std_posted = 0;
3320 }
3312next_pkt_nopost: 3321next_pkt_nopost:
3313 sw_idx++; 3322 sw_idx++;
3314 sw_idx %= TG3_RX_RCB_RING_SIZE(tp); 3323 sw_idx %= TG3_RX_RCB_RING_SIZE(tp);
@@ -3870,6 +3879,40 @@ out_unlock:
3870 return NETDEV_TX_OK; 3879 return NETDEV_TX_OK;
3871} 3880}
3872 3881
3882#if TG3_TSO_SUPPORT != 0
3883static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *);
3884
3885/* Use GSO to workaround a rare TSO bug that may be triggered when the
3886 * TSO header is greater than 80 bytes.
3887 */
3888static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
3889{
3890 struct sk_buff *segs, *nskb;
3891
3892 /* Estimate the number of fragments in the worst case */
3893 if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->gso_segs * 3))) {
3894 netif_stop_queue(tp->dev);
3895 return NETDEV_TX_BUSY;
3896 }
3897
3898 segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO);
3899 if (unlikely(IS_ERR(segs)))
3900 goto tg3_tso_bug_end;
3901
3902 do {
3903 nskb = segs;
3904 segs = segs->next;
3905 nskb->next = NULL;
3906 tg3_start_xmit_dma_bug(nskb, tp->dev);
3907 } while (segs);
3908
3909tg3_tso_bug_end:
3910 dev_kfree_skb(skb);
3911
3912 return NETDEV_TX_OK;
3913}
3914#endif
3915
3873/* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and 3916/* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and
3874 * support TG3_FLG2_HW_TSO_1 or firmware TSO only. 3917 * support TG3_FLG2_HW_TSO_1 or firmware TSO only.
3875 */ 3918 */
@@ -3906,7 +3949,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
3906 mss = 0; 3949 mss = 0;
3907 if (skb->len > (tp->dev->mtu + ETH_HLEN) && 3950 if (skb->len > (tp->dev->mtu + ETH_HLEN) &&
3908 (mss = skb_shinfo(skb)->gso_size) != 0) { 3951 (mss = skb_shinfo(skb)->gso_size) != 0) {
3909 int tcp_opt_len, ip_tcp_len; 3952 int tcp_opt_len, ip_tcp_len, hdr_len;
3910 3953
3911 if (skb_header_cloned(skb) && 3954 if (skb_header_cloned(skb) &&
3912 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { 3955 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -3917,11 +3960,16 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
3917 tcp_opt_len = ((skb->h.th->doff - 5) * 4); 3960 tcp_opt_len = ((skb->h.th->doff - 5) * 4);
3918 ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); 3961 ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);
3919 3962
3963 hdr_len = ip_tcp_len + tcp_opt_len;
3964 if (unlikely((ETH_HLEN + hdr_len) > 80) &&
3965 (tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG))
3966 return (tg3_tso_bug(tp, skb));
3967
3920 base_flags |= (TXD_FLAG_CPU_PRE_DMA | 3968 base_flags |= (TXD_FLAG_CPU_PRE_DMA |
3921 TXD_FLAG_CPU_POST_DMA); 3969 TXD_FLAG_CPU_POST_DMA);
3922 3970
3923 skb->nh.iph->check = 0; 3971 skb->nh.iph->check = 0;
3924 skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); 3972 skb->nh.iph->tot_len = htons(mss + hdr_len);
3925 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { 3973 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
3926 skb->h.th->check = 0; 3974 skb->h.th->check = 0;
3927 base_flags &= ~TXD_FLAG_TCPUDP_CSUM; 3975 base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
@@ -5981,7 +6029,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
5981 } 6029 }
5982 6030
5983 /* Setup replenish threshold. */ 6031 /* Setup replenish threshold. */
5984 tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8); 6032 val = tp->rx_pending / 8;
6033 if (val == 0)
6034 val = 1;
6035 else if (val > tp->rx_std_max_post)
6036 val = tp->rx_std_max_post;
6037
6038 tw32(RCVBDI_STD_THRESH, val);
5985 6039
5986 /* Initialize TG3_BDINFO's at: 6040 /* Initialize TG3_BDINFO's at:
5987 * RCVDBDI_STD_BD: standard eth size rx ring 6041 * RCVDBDI_STD_BD: standard eth size rx ring
@@ -6141,8 +6195,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6141#endif 6195#endif
6142 6196
6143 /* Receive/send statistics. */ 6197 /* Receive/send statistics. */
6144 if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && 6198 if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
6145 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { 6199 val = tr32(RCVLPC_STATS_ENABLE);
6200 val &= ~RCVLPC_STATSENAB_DACK_FIX;
6201 tw32(RCVLPC_STATS_ENABLE, val);
6202 } else if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) &&
6203 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
6146 val = tr32(RCVLPC_STATS_ENABLE); 6204 val = tr32(RCVLPC_STATS_ENABLE);
6147 val &= ~RCVLPC_STATSENAB_LNGBRST_RFIX; 6205 val &= ~RCVLPC_STATSENAB_LNGBRST_RFIX;
6148 tw32(RCVLPC_STATS_ENABLE, val); 6206 tw32(RCVLPC_STATS_ENABLE, val);
@@ -8738,6 +8796,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
8738{ 8796{
8739 struct tg3 *tp = netdev_priv(dev); 8797 struct tg3 *tp = netdev_priv(dev);
8740 8798
8799 if (netif_running(dev))
8800 tg3_netif_stop(tp);
8801
8741 tg3_full_lock(tp, 0); 8802 tg3_full_lock(tp, 0);
8742 8803
8743 tp->vlgrp = grp; 8804 tp->vlgrp = grp;
@@ -8746,16 +8807,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
8746 __tg3_set_rx_mode(dev); 8807 __tg3_set_rx_mode(dev);
8747 8808
8748 tg3_full_unlock(tp); 8809 tg3_full_unlock(tp);
8810
8811 if (netif_running(dev))
8812 tg3_netif_start(tp);
8749} 8813}
8750 8814
8751static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 8815static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
8752{ 8816{
8753 struct tg3 *tp = netdev_priv(dev); 8817 struct tg3 *tp = netdev_priv(dev);
8754 8818
8819 if (netif_running(dev))
8820 tg3_netif_stop(tp);
8821
8755 tg3_full_lock(tp, 0); 8822 tg3_full_lock(tp, 0);
8756 if (tp->vlgrp) 8823 if (tp->vlgrp)
8757 tp->vlgrp->vlan_devices[vid] = NULL; 8824 tp->vlgrp->vlan_devices[vid] = NULL;
8758 tg3_full_unlock(tp); 8825 tg3_full_unlock(tp);
8826
8827 if (netif_running(dev))
8828 tg3_netif_start(tp);
8759} 8829}
8760#endif 8830#endif
8761 8831
@@ -10160,8 +10230,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10160 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { 10230 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
10161 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; 10231 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
10162 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; 10232 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
10163 } else 10233 } else {
10164 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1; 10234 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 |
10235 TG3_FLG2_HW_TSO_1_BUG;
10236 if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
10237 ASIC_REV_5750 &&
10238 tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
10239 tp->tg3_flags2 &= ~TG3_FLG2_HW_TSO_1_BUG;
10240 }
10165 } 10241 }
10166 10242
10167 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 && 10243 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
@@ -10533,6 +10609,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10533 (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) 10609 (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0)
10534 tp->rx_offset = 0; 10610 tp->rx_offset = 0;
10535 10611
10612 tp->rx_std_max_post = TG3_RX_RING_SIZE;
10613
10614 /* Increment the rx prod index on the rx std ring by at most
10615 * 8 for these chips to workaround hw errata.
10616 */
10617 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
10618 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
10619 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
10620 tp->rx_std_max_post = 8;
10621
10536 /* By default, disable wake-on-lan. User can change this 10622 /* By default, disable wake-on-lan. User can change this
10537 * using ETHTOOL_SWOL. 10623 * using ETHTOOL_SWOL.
10538 */ 10624 */
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 8209da5dd15f..ba2c98711c88 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -125,6 +125,7 @@
125#define CHIPREV_ID_5750_A0 0x4000 125#define CHIPREV_ID_5750_A0 0x4000
126#define CHIPREV_ID_5750_A1 0x4001 126#define CHIPREV_ID_5750_A1 0x4001
127#define CHIPREV_ID_5750_A3 0x4003 127#define CHIPREV_ID_5750_A3 0x4003
128#define CHIPREV_ID_5750_C2 0x4202
128#define CHIPREV_ID_5752_A0_HW 0x5000 129#define CHIPREV_ID_5752_A0_HW 0x5000
129#define CHIPREV_ID_5752_A0 0x6000 130#define CHIPREV_ID_5752_A0 0x6000
130#define CHIPREV_ID_5752_A1 0x6001 131#define CHIPREV_ID_5752_A1 0x6001
@@ -760,6 +761,7 @@
760#define RCVLPC_STATSCTRL_ENABLE 0x00000001 761#define RCVLPC_STATSCTRL_ENABLE 0x00000001
761#define RCVLPC_STATSCTRL_FASTUPD 0x00000002 762#define RCVLPC_STATSCTRL_FASTUPD 0x00000002
762#define RCVLPC_STATS_ENABLE 0x00002018 763#define RCVLPC_STATS_ENABLE 0x00002018
764#define RCVLPC_STATSENAB_DACK_FIX 0x00040000
763#define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000 765#define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000
764#define RCVLPC_STATS_INCMASK 0x0000201c 766#define RCVLPC_STATS_INCMASK 0x0000201c
765/* 0x2020 --> 0x2100 unused */ 767/* 0x2020 --> 0x2100 unused */
@@ -2137,6 +2139,7 @@ struct tg3 {
2137 struct tg3_rx_buffer_desc *rx_std; 2139 struct tg3_rx_buffer_desc *rx_std;
2138 struct ring_info *rx_std_buffers; 2140 struct ring_info *rx_std_buffers;
2139 dma_addr_t rx_std_mapping; 2141 dma_addr_t rx_std_mapping;
2142 u32 rx_std_max_post;
2140 2143
2141 struct tg3_rx_buffer_desc *rx_jumbo; 2144 struct tg3_rx_buffer_desc *rx_jumbo;
2142 struct ring_info *rx_jumbo_buffers; 2145 struct ring_info *rx_jumbo_buffers;
@@ -2191,7 +2194,7 @@ struct tg3 {
2191#define TG3_FLAG_INIT_COMPLETE 0x80000000 2194#define TG3_FLAG_INIT_COMPLETE 0x80000000
2192 u32 tg3_flags2; 2195 u32 tg3_flags2;
2193#define TG3_FLG2_RESTART_TIMER 0x00000001 2196#define TG3_FLG2_RESTART_TIMER 0x00000001
2194/* 0x00000002 available */ 2197#define TG3_FLG2_HW_TSO_1_BUG 0x00000002
2195#define TG3_FLG2_NO_ETH_WIRE_SPEED 0x00000004 2198#define TG3_FLG2_NO_ETH_WIRE_SPEED 0x00000004
2196#define TG3_FLG2_IS_5788 0x00000008 2199#define TG3_FLG2_IS_5788 0x00000008
2197#define TG3_FLG2_MAX_RXPEND_64 0x00000010 2200#define TG3_FLG2_MAX_RXPEND_64 0x00000010
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 41e0cd8f4786..77bb298129d7 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -42,7 +42,6 @@
42 42
43#define XL_DEBUG 0 43#define XL_DEBUG 0
44 44
45#include <linux/config.h>
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/kernel.h> 46#include <linux/kernel.h>
48#include <linux/errno.h> 47#include <linux/errno.h>
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index c58a4c31d0dd..30dcdaebf41a 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -100,7 +100,6 @@
100 100
101#define STREAMER_IOCTL 0 101#define STREAMER_IOCTL 0
102 102
103#include <linux/config.h>
104#include <linux/module.h> 103#include <linux/module.h>
105#include <linux/kernel.h> 104#include <linux/kernel.h>
106#include <linux/errno.h> 105#include <linux/errno.h>
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index c3cb8d26cfe3..d7a30d99ae8f 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -80,7 +80,6 @@
80#define OLYMPIC_DEBUG 0 80#define OLYMPIC_DEBUG 0
81 81
82 82
83#include <linux/config.h>
84#include <linux/module.h> 83#include <linux/module.h>
85#include <linux/kernel.h> 84#include <linux/kernel.h>
86#include <linux/errno.h> 85#include <linux/errno.h>
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 67d2b596ce22..f2807ab5a2be 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -29,7 +29,6 @@
29 */ 29 */
30 30
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/config.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/types.h> 33#include <linux/types.h>
35#include <linux/fcntl.h> 34#include <linux/fcntl.h>
diff --git a/drivers/net/tokenring/smctr_firmware.h b/drivers/net/tokenring/smctr_firmware.h
index 48994b043b7c..292e50ddf01a 100644
--- a/drivers/net/tokenring/smctr_firmware.h
+++ b/drivers/net/tokenring/smctr_firmware.h
@@ -17,7 +17,6 @@
17 * - Jay Schulist <jschlst@samba.org> 17 * - Jay Schulist <jschlst@samba.org>
18 */ 18 */
19 19
20#include <linux/config.h>
21 20
22#if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE) 21#if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE)
23 22
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index fc2468ecce0b..354294c6271e 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -31,7 +31,6 @@
31#define DRV_VERSION "0.7" 31#define DRV_VERSION "0.7"
32#define DRV_RELDATE "Mar 17, 2004" 32#define DRV_RELDATE "Mar 17, 2004"
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/netdevice.h> 36#include <linux/netdevice.h>
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index da8bd0d62a3f..2647a5bc5211 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -443,7 +443,6 @@
443 ========================================================================= 443 =========================================================================
444*/ 444*/
445 445
446#include <linux/config.h>
447#include <linux/module.h> 446#include <linux/module.h>
448#include <linux/kernel.h> 447#include <linux/kernel.h>
449#include <linux/string.h> 448#include <linux/string.h>
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index da4f7593c50f..99ccf2ebb342 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -16,7 +16,6 @@
16 16
17#include <linux/pci.h> 17#include <linux/pci.h>
18#include "tulip.h" 18#include "tulip.h"
19#include <linux/config.h>
20#include <linux/etherdevice.h> 19#include <linux/etherdevice.h>
21 20
22int tulip_rx_copybreak; 21int tulip_rx_copybreak;
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index d25020da6798..3bcfbf3d23ed 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -16,7 +16,6 @@
16#ifndef __NET_TULIP_H__ 16#ifndef __NET_TULIP_H__
17#define __NET_TULIP_H__ 17#define __NET_TULIP_H__
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/spinlock.h> 21#include <linux/spinlock.h>
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 53fd9b56d0bd..8f4f4840fc12 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -14,7 +14,6 @@
14 14
15*/ 15*/
16 16
17#include <linux/config.h>
18 17
19#define DRV_NAME "tulip" 18#define DRV_NAME "tulip"
20#ifdef CONFIG_TULIP_NAPI 19#ifdef CONFIG_TULIP_NAPI
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
index 887d7245fe7b..aecafdabbc91 100644
--- a/drivers/net/tulip/xircom_tulip_cb.c
+++ b/drivers/net/tulip/xircom_tulip_cb.c
@@ -98,7 +98,6 @@ static int csr0 = 0x00A00000 | 0x4800;
98/* PCI registers */ 98/* PCI registers */
99#define PCI_POWERMGMT 0x40 99#define PCI_POWERMGMT 0x40
100 100
101#include <linux/config.h>
102#include <linux/module.h> 101#include <linux/module.h>
103#include <linux/moduleparam.h> 102#include <linux/moduleparam.h>
104#include <linux/kernel.h> 103#include <linux/kernel.h>
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 732c5edec2e5..329d9feb9b89 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -39,7 +39,6 @@
39#define DRV_DESCRIPTION "Universal TUN/TAP device driver" 39#define DRV_DESCRIPTION "Universal TUN/TAP device driver"
40#define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>" 40#define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>"
41 41
42#include <linux/config.h>
43#include <linux/module.h> 42#include <linux/module.h>
44#include <linux/errno.h> 43#include <linux/errno.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 09e05fe40c38..857d71c3c017 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -47,7 +47,6 @@
47 47
48#include <linux/module.h> 48#include <linux/module.h>
49#include <linux/types.h> 49#include <linux/types.h>
50#include <linux/config.h>
51#include <linux/init.h> 50#include <linux/init.h>
52#include <linux/mm.h> 51#include <linux/mm.h>
53#include <linux/errno.h> 52#include <linux/errno.h>
@@ -65,7 +64,6 @@
65#include <linux/wait.h> 64#include <linux/wait.h>
66#include <asm/io.h> 65#include <asm/io.h>
67#include <linux/if.h> 66#include <linux/if.h>
68#include <linux/config.h>
69#include <asm/uaccess.h> 67#include <asm/uaccess.h>
70#include <linux/proc_fs.h> 68#include <linux/proc_fs.h>
71#include <linux/inetdevice.h> 69#include <linux/inetdevice.h>
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index be5e33814cb1..1f95b4864ea1 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -79,7 +79,6 @@
79 79
80/* ---------- Headers, macros, data structures ---------- */ 80/* ---------- Headers, macros, data structures ---------- */
81 81
82#include <linux/config.h>
83#include <linux/module.h> 82#include <linux/module.h>
84#include <linux/kernel.h> 83#include <linux/kernel.h>
85#include <linux/slab.h> 84#include <linux/slab.h>
diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c
index 57f9538b8fb5..b7da55140fbd 100644
--- a/drivers/net/wan/hdlc_generic.c
+++ b/drivers/net/wan/hdlc_generic.c
@@ -22,7 +22,6 @@
22 * - proto.start() and stop() are called with spin_lock_irq held. 22 * - proto.start() and stop() are called with spin_lock_irq held.
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
index af8b55fdd9d9..ae01555d24cf 100644
--- a/drivers/net/wan/lmc/lmc_media.c
+++ b/drivers/net/wan/lmc/lmc_media.c
@@ -1,6 +1,5 @@
1/* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ 1/* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */
2 2
3#include <linux/config.h>
4#include <linux/kernel.h> 3#include <linux/kernel.h>
5#include <linux/string.h> 4#include <linux/string.h>
6#include <linux/timer.h> 5#include <linux/timer.h>
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 175ba13bce41..f2d071272cee 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -37,7 +37,6 @@
37 * Known problem: this driver wasn't tested on multiprocessor machine. 37 * Known problem: this driver wasn't tested on multiprocessor machine.
38 */ 38 */
39 39
40#include <linux/config.h>
41#include <linux/module.h> 40#include <linux/module.h>
42#include <linux/kernel.h> 41#include <linux/kernel.h>
43#include <linux/ptrace.h> 42#include <linux/ptrace.h>
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
index 2d1bba06a085..c13b459a0137 100644
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -37,7 +37,6 @@
37 */ 37 */
38#undef DEBUG 38#undef DEBUG
39 39
40#include <linux/config.h>
41#include <linux/module.h> 40#include <linux/module.h>
42#include <linux/kernel.h> 41#include <linux/kernel.h>
43#include <linux/errno.h> 42#include <linux/errno.h>
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 4069b79d8259..89328d119efa 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -19,7 +19,6 @@
19 19
20======================================================================*/ 20======================================================================*/
21 21
22#include <linux/config.h>
23#include <linux/init.h> 22#include <linux/init.h>
24 23
25#include <linux/kernel.h> 24#include <linux/kernel.h>
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index af0cbb6c5c0c..ac9437d497f0 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -20,7 +20,6 @@
20 20
21======================================================================*/ 21======================================================================*/
22 22
23#include <linux/config.h>
24#ifdef __IN_PCMCIA_PACKAGE__ 23#ifdef __IN_PCMCIA_PACKAGE__
25#include <pcmcia/k_compat.h> 24#include <pcmcia/k_compat.h>
26#endif 25#endif
diff --git a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c
index 7b321f7cf358..38fac3bbcd82 100644
--- a/drivers/net/wireless/airport.c
+++ b/drivers/net/wireless/airport.c
@@ -14,7 +14,6 @@
14#define DRIVER_NAME "airport" 14#define DRIVER_NAME "airport"
15#define PFX DRIVER_NAME ": " 15#define PFX DRIVER_NAME ": "
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/init.h> 19#include <linux/init.h>
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c
index bed6823d9809..bb6bea4f3233 100644
--- a/drivers/net/wireless/arlan-main.c
+++ b/drivers/net/wireless/arlan-main.c
@@ -5,7 +5,6 @@
5 * This module provides support for the Arlan 655 card made by Aironet 5 * This module provides support for the Arlan 655 card made by Aironet
6 */ 6 */
7 7
8#include <linux/config.h>
9#include "arlan.h" 8#include "arlan.h"
10 9
11#if BITS_PER_LONG != 32 10#if BITS_PER_LONG != 32
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c
index a2cca521f444..5fa985435ffa 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/net/wireless/arlan-proc.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include "arlan.h" 1#include "arlan.h"
3 2
4#include <linux/sysctl.h> 3#include <linux/sysctl.h>
diff --git a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h
index 70a6d7b83c4a..3ed1df75900f 100644
--- a/drivers/net/wireless/arlan.h
+++ b/drivers/net/wireless/arlan.h
@@ -5,7 +5,6 @@
5 */ 5 */
6 6
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/config.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/skbuff.h> 10#include <linux/skbuff.h>
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 8606c88886fc..54e31fa2d402 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -39,7 +39,6 @@
39 39
40******************************************************************************/ 40******************************************************************************/
41 41
42#include <linux/config.h>
43#include <linux/init.h> 42#include <linux/init.h>
44 43
45#include <linux/kernel.h> 44#include <linux/kernel.h>
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 26bf1127524d..785664090bb4 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -29,7 +29,6 @@
29 29
30******************************************************************************/ 30******************************************************************************/
31 31
32#include <linux/config.h>
33#ifdef __IN_PCMCIA_PACKAGE__ 32#ifdef __IN_PCMCIA_PACKAGE__
34#include <pcmcia/k_compat.h> 33#include <pcmcia/k_compat.h>
35#endif 34#endif
diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
index a61b3bc6cccf..d425c3cefded 100644
--- a/drivers/net/wireless/atmel_pci.c
+++ b/drivers/net/wireless/atmel_pci.c
@@ -19,7 +19,6 @@
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 20
21******************************************************************************/ 21******************************************************************************/
22#include <linux/config.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/module.h> 24#include <linux/module.h>
diff --git a/drivers/net/wireless/hermes.c b/drivers/net/wireless/hermes.c
index 2aa2f389c0d5..29d39105f5b8 100644
--- a/drivers/net/wireless/hermes.c
+++ b/drivers/net/wireless/hermes.c
@@ -38,7 +38,6 @@
38 * under either the MPL or the GPL. 38 * under either the MPL or the GPL.
39 */ 39 */
40 40
41#include <linux/config.h>
42#include <linux/module.h> 41#include <linux/module.h>
43#include <linux/kernel.h> 42#include <linux/kernel.h>
44#include <linux/init.h> 43#include <linux/init.h>
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index db03dc2646df..52e6df5c1a92 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -1,6 +1,5 @@
1#define PRISM2_PCCARD 1#define PRISM2_PCCARD
2 2
3#include <linux/config.h>
4#include <linux/module.h> 3#include <linux/module.h>
5#include <linux/init.h> 4#include <linux/init.h>
6#include <linux/if.h> 5#include <linux/if.h>
@@ -844,7 +843,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
844 PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), 843 PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001),
845 PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001), 844 PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001),
846 PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), 845 PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
847 PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), 846/* PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), conflict with pcnet_cs */
848 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), 847 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
849 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), 848 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
850 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), 849 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 328e9a1d13b5..b764cfda6e84 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -30,7 +30,6 @@
30 */ 30 */
31 31
32 32
33#include <linux/config.h>
34 33
35#include <asm/delay.h> 34#include <asm/delay.h>
36#include <asm/uaccess.h> 35#include <asm/uaccess.h>
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 93786f4218f0..53374fcba77e 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -12,7 +12,6 @@
12 * more details. 12 * more details.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 194f07097581..5ea8ac835857 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -4,7 +4,6 @@
4 * driver patches from Reyk Floeter <reyk@vantronix.net> and 4 * driver patches from Reyk Floeter <reyk@vantronix.net> and
5 * Andy Warner <andyw@pobox.com> */ 5 * Andy Warner <andyw@pobox.com> */
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include <linux/if.h> 9#include <linux/if.h>
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
index edaaa943eb8f..4ee6abbc65ec 100644
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/if.h> 12#include <linux/if.h>
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 94aeb23a7729..27f744e43095 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -134,7 +134,6 @@ that only one external action is invoked at a time.
134*/ 134*/
135 135
136#include <linux/compiler.h> 136#include <linux/compiler.h>
137#include <linux/config.h>
138#include <linux/errno.h> 137#include <linux/errno.h>
139#include <linux/if_arp.h> 138#include <linux/if_arp.h>
140#include <linux/in6.h> 139#include <linux/in6.h>
@@ -5358,7 +5357,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
5358 idx, keylen, len); 5357 idx, keylen, len);
5359 5358
5360 /* NOTE: We don't check cached values in case the firmware was reset 5359 /* NOTE: We don't check cached values in case the firmware was reset
5361 * or some other problem is occuring. If the user is setting the key, 5360 * or some other problem is occurring. If the user is setting the key,
5362 * then we push the change */ 5361 * then we push the change */
5363 5362
5364 wep_key->idx = idx; 5363 wep_key->idx = idx;
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index ea12ad66b8e8..8b1cd7c749a4 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -31,7 +31,6 @@
31 31
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
34#include <linux/config.h>
35#include <linux/init.h> 34#include <linux/init.h>
36#include <linux/mutex.h> 35#include <linux/mutex.h>
37 36
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 9343d970537b..36b5e004305e 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -37,7 +37,6 @@
37/* To have statistics (just packets sent) define this */ 37/* To have statistics (just packets sent) define this */
38#undef NETWAVE_STATS 38#undef NETWAVE_STATS
39 39
40#include <linux/config.h>
41#include <linux/module.h> 40#include <linux/module.h>
42#include <linux/kernel.h> 41#include <linux/kernel.h>
43#include <linux/init.h> 42#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 8a31b591a901..d6ed5781b93a 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -76,7 +76,6 @@
76 76
77#define DRIVER_NAME "orinoco" 77#define DRIVER_NAME "orinoco"
78 78
79#include <linux/config.h>
80#include <linux/module.h> 79#include <linux/module.h>
81#include <linux/kernel.h> 80#include <linux/kernel.h>
82#include <linux/init.h> 81#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index b2aec4d9fbb1..bc14689cbf24 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -13,7 +13,6 @@
13#define DRIVER_NAME "orinoco_cs" 13#define DRIVER_NAME "orinoco_cs"
14#define PFX DRIVER_NAME ": " 14#define PFX DRIVER_NAME ": "
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/init.h> 18#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c
index 74b9d5b2ba9e..4597fe1d1979 100644
--- a/drivers/net/wireless/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco_nortel.c
@@ -40,7 +40,6 @@
40#define DRIVER_NAME "orinoco_nortel" 40#define DRIVER_NAME "orinoco_nortel"
41#define PFX DRIVER_NAME ": " 41#define PFX DRIVER_NAME ": "
42 42
43#include <linux/config.h>
44#include <linux/module.h> 43#include <linux/module.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/init.h> 45#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index 1c105f40f8d5..de3eae082a0d 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -44,7 +44,6 @@
44#define DRIVER_NAME "orinoco_pci" 44#define DRIVER_NAME "orinoco_pci"
45#define PFX DRIVER_NAME ": " 45#define PFX DRIVER_NAME ": "
46 46
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/kernel.h> 48#include <linux/kernel.h>
50#include <linux/init.h> 49#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c
index 84f696c77551..3f928b8939f0 100644
--- a/drivers/net/wireless/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco_plx.c
@@ -86,7 +86,6 @@
86#define DRIVER_NAME "orinoco_plx" 86#define DRIVER_NAME "orinoco_plx"
87#define PFX DRIVER_NAME ": " 87#define PFX DRIVER_NAME ": "
88 88
89#include <linux/config.h>
90#include <linux/module.h> 89#include <linux/module.h>
91#include <linux/kernel.h> 90#include <linux/kernel.h>
92#include <linux/init.h> 91#include <linux/init.h>
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c
index d2b4decb7a7d..160a642185f0 100644
--- a/drivers/net/wireless/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco_tmd.c
@@ -40,7 +40,6 @@
40#define DRIVER_NAME "orinoco_tmd" 40#define DRIVER_NAME "orinoco_tmd"
41#define PFX DRIVER_NAME ": " 41#define PFX DRIVER_NAME ": "
42 42
43#include <linux/config.h>
44#include <linux/module.h> 43#include <linux/module.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/init.h> 45#include <linux/init.h>
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
index 6a60c5970cb5..2e061a80b294 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/prism54/islpci_mgt.c
@@ -18,7 +18,6 @@
18 * 18 *
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/netdevice.h> 21#include <linux/netdevice.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/pci.h> 23#include <linux/pci.h>
diff --git a/drivers/net/wireless/prism54/prismcompat.h b/drivers/net/wireless/prism54/prismcompat.h
index 55541c01752e..d71eca55a302 100644
--- a/drivers/net/wireless/prism54/prismcompat.h
+++ b/drivers/net/wireless/prism54/prismcompat.h
@@ -29,7 +29,6 @@
29 29
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/firmware.h> 31#include <linux/firmware.h>
32#include <linux/config.h>
33#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
34#include <linux/workqueue.h> 33#include <linux/workqueue.h>
35#include <linux/compiler.h> 34#include <linux/compiler.h>
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index a915fe6c6aa5..61b83a5e737a 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -30,7 +30,6 @@
30 * 30 *
31=============================================================================*/ 31=============================================================================*/
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index 7f9aa139c347..15465278c789 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -21,7 +21,6 @@
21#define DRIVER_NAME "spectrum_cs" 21#define DRIVER_NAME "spectrum_cs"
22#define PFX DRIVER_NAME ": " 22#define PFX DRIVER_NAME ": "
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/kernel.h> 25#include <linux/kernel.h>
27#include <linux/init.h> 26#include <linux/init.h>
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 18a44580b53b..fd31885c6844 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -81,7 +81,6 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
81/************************************************************************/ 81/************************************************************************/
82/* Header files */ 82/* Header files */
83 83
84#include <linux/config.h>
85#include <linux/kernel.h> 84#include <linux/kernel.h>
86#include <linux/module.h> 85#include <linux/module.h>
87#include <linux/init.h> 86#include <linux/init.h>
diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h
index c65fe7a391ec..f34a36b0c7b0 100644
--- a/drivers/net/wireless/wavelan_cs.p.h
+++ b/drivers/net/wireless/wavelan_cs.p.h
@@ -411,7 +411,6 @@
411/***************************** INCLUDES *****************************/ 411/***************************** INCLUDES *****************************/
412 412
413/* Linux headers that we need */ 413/* Linux headers that we need */
414#include <linux/config.h>
415#include <linux/module.h> 414#include <linux/module.h>
416#include <linux/kernel.h> 415#include <linux/kernel.h>
417#include <linux/init.h> 416#include <linux/init.h>
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index e52a650f6737..c03e400facee 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -28,7 +28,6 @@
28 */ 28 */
29#undef REALLY_SLOW_IO /* most systems can safely undef this */ 29#undef REALLY_SLOW_IO /* most systems can safely undef this */
30 30
31#include <linux/config.h>
32#include <linux/delay.h> 31#include <linux/delay.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/ethtool.h> 33#include <linux/ethtool.h>
diff --git a/drivers/net/znet.c b/drivers/net/znet.c
index a7c089df66e6..9f0291f35290 100644
--- a/drivers/net/znet.c
+++ b/drivers/net/znet.c
@@ -85,7 +85,6 @@
85 - Understand why some traffic patterns add a 1s latency... 85 - Understand why some traffic patterns add a 1s latency...
86 */ 86 */
87 87
88#include <linux/config.h>
89#include <linux/module.h> 88#include <linux/module.h>
90#include <linux/kernel.h> 89#include <linux/kernel.h>
91#include <linux/string.h> 90#include <linux/string.h>
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 14cbe34eb897..3a0a3a734933 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -7,7 +7,6 @@
7 * and others. 7 * and others.
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/string.h> 12#include <linux/string.h>
diff --git a/drivers/nubus/nubus_syms.c b/drivers/nubus/nubus_syms.c
index 22c1dc9f87b3..9204f04fbf0b 100644
--- a/drivers/nubus/nubus_syms.c
+++ b/drivers/nubus/nubus_syms.c
@@ -2,7 +2,6 @@
2 2
3 (c) 1999 David Huggins-Daines <dhd@debian.org> */ 3 (c) 1999 David Huggins-Daines <dhd@debian.org> */
4 4
5#include <linux/config.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/types.h> 6#include <linux/types.h>
8#include <linux/nubus.h> 7#include <linux/nubus.h>
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index a5d826237b26..68cb3a080050 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -31,7 +31,6 @@
31** the coherency design originally worked out. Only PCX-W does. 31** the coherency design originally worked out. Only PCX-W does.
32*/ 32*/
33 33
34#include <linux/config.h>
35#include <linux/types.h> 34#include <linux/types.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/mm.h> 36#include <linux/mm.h>
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index ce0a6ebcff15..0d96c50ffe9c 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -43,7 +43,6 @@
43** for PCI drivers devices which implement/use MMIO registers. 43** for PCI drivers devices which implement/use MMIO registers.
44*/ 44*/
45 45
46#include <linux/config.h>
47#include <linux/delay.h> 46#include <linux/delay.h>
48#include <linux/types.h> 47#include <linux/types.h>
49#include <linux/kernel.h> 48#include <linux/kernel.h>
diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c
index 5476ba7709b3..b45aa5c675a0 100644
--- a/drivers/parisc/gsc.c
+++ b/drivers/parisc/gsc.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/config.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index d7024c7483bd..bf00fa2537bb 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -23,7 +23,6 @@
23 * David Pye <dmp@davidmpye.dyndns.org> 23 * David Pye <dmp@davidmpye.dyndns.org>
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/stddef.h> /* for offsetof() */ 27#include <linux/stddef.h> /* for offsetof() */
29#include <linux/init.h> 28#include <linux/init.h>
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index 0bcab83b4080..fad5a33bf0fa 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -35,7 +35,6 @@
35 * runtime through the "/proc/sys/kernel/power" procfs entry. 35 * runtime through the "/proc/sys/kernel/power" procfs entry.
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/init.h> 39#include <linux/init.h>
41#include <linux/kernel.h> 40#include <linux/kernel.h>
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index d09e39e39c60..8b4732815511 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -19,7 +19,6 @@
19** FIXME: add DMA hint support programming in both sba and lba modules. 19** FIXME: add DMA hint support programming in both sba and lba modules.
20*/ 20*/
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/spinlock.h> 24#include <linux/spinlock.h>
diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c
index 690b239ad3a7..7ff09f0f858f 100644
--- a/drivers/parport/ieee1284.c
+++ b/drivers/parport/ieee1284.c
@@ -16,7 +16,6 @@
16 * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000 16 * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/threads.h> 20#include <linux/threads.h>
22#include <linux/parport.h> 21#include <linux/parport.h>
diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c
index d6c77658231e..525312f2fe9c 100644
--- a/drivers/parport/ieee1284_ops.c
+++ b/drivers/parport/ieee1284_ops.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/parport.h> 18#include <linux/parport.h>
20#include <linux/delay.h> 19#include <linux/delay.h>
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 7318e4a9e436..fe800dc0be9f 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -42,7 +42,6 @@
42 * but rather will start at port->base_hi. 42 * but rather will start at port->base_hi.
43 */ 43 */
44 44
45#include <linux/config.h>
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/init.h> 46#include <linux/init.h>
48#include <linux/sched.h> 47#include <linux/sched.h>
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 8610ae88b92d..2e744a274517 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/config.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 2cb22c8d3357..94dc506b83d1 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -17,7 +17,6 @@
17 17
18#undef PARPORT_DEBUG_SHARING /* undef for production */ 18#undef PARPORT_DEBUG_SHARING /* undef for production */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/string.h> 21#include <linux/string.h>
23#include <linux/threads.h> 22#include <linux/threads.h>
diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index 421cfffb1756..34a1891191fd 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -40,8 +40,7 @@ ibmphp-objs := ibmphp_core.o \
40 ibmphp_hpc.o 40 ibmphp_hpc.o
41 41
42acpiphp-objs := acpiphp_core.o \ 42acpiphp-objs := acpiphp_core.o \
43 acpiphp_glue.o \ 43 acpiphp_glue.o
44 acpiphp_dock.o
45 44
46rpaphp-objs := rpaphp_core.o \ 45rpaphp-objs := rpaphp_core.o \
47 rpaphp_pci.o \ 46 rpaphp_pci.o \
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 17a93f890dba..be104eced34c 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -130,7 +130,7 @@ struct acpiphp_func {
130 130
131 struct list_head sibling; 131 struct list_head sibling;
132 struct pci_dev *pci_dev; 132 struct pci_dev *pci_dev;
133 133 struct notifier_block nb;
134 acpi_handle handle; 134 acpi_handle handle;
135 135
136 u8 function; /* pci function# */ 136 u8 function; /* pci function# */
@@ -151,24 +151,6 @@ struct acpiphp_attention_info
151}; 151};
152 152
153 153
154struct dependent_device {
155 struct list_head device_list;
156 struct list_head pci_list;
157 acpi_handle handle;
158 struct acpiphp_func *func;
159};
160
161
162struct acpiphp_dock_station {
163 acpi_handle handle;
164 u32 last_dock_time;
165 u32 flags;
166 struct acpiphp_func *dock_bridge;
167 struct list_head dependent_devices;
168 struct list_head pci_dependent_devices;
169};
170
171
172/* PCI bus bridge HID */ 154/* PCI bus bridge HID */
173#define ACPI_PCI_HOST_HID "PNP0A03" 155#define ACPI_PCI_HOST_HID "PNP0A03"
174 156
@@ -207,11 +189,6 @@ struct acpiphp_dock_station {
207#define FUNC_HAS_PS2 (0x00000040) 189#define FUNC_HAS_PS2 (0x00000040)
208#define FUNC_HAS_PS3 (0x00000080) 190#define FUNC_HAS_PS3 (0x00000080)
209#define FUNC_HAS_DCK (0x00000100) 191#define FUNC_HAS_DCK (0x00000100)
210#define FUNC_IS_DD (0x00000200)
211
212/* dock station flags */
213#define DOCK_DOCKING (0x00000001)
214#define DOCK_HAS_BRIDGE (0x00000002)
215 192
216/* function prototypes */ 193/* function prototypes */
217 194
@@ -226,7 +203,6 @@ extern int acpiphp_glue_init (void);
226extern void acpiphp_glue_exit (void); 203extern void acpiphp_glue_exit (void);
227extern int acpiphp_get_num_slots (void); 204extern int acpiphp_get_num_slots (void);
228typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); 205typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
229void handle_hotplug_event_func(acpi_handle, u32, void*);
230 206
231extern int acpiphp_enable_slot (struct acpiphp_slot *slot); 207extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
232extern int acpiphp_disable_slot (struct acpiphp_slot *slot); 208extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
@@ -236,16 +212,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
236extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); 212extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
237extern u32 acpiphp_get_address (struct acpiphp_slot *slot); 213extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
238 214
239/* acpiphp_dock.c */
240extern int find_dock_station(void);
241extern void remove_dock_station(void);
242extern void add_dependent_device(struct dependent_device *new_dd);
243extern void add_pci_dependent_device(struct dependent_device *new_dd);
244extern struct dependent_device *get_dependent_device(acpi_handle handle);
245extern int is_dependent_device(acpi_handle handle);
246extern int detect_dependent_devices(acpi_handle *bridge_handle);
247extern struct dependent_device *alloc_dependent_device(acpi_handle handle);
248
249/* variables */ 215/* variables */
250extern int acpiphp_debug; 216extern int acpiphp_debug;
251 217
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 4f1b0da8e47e..34de5697983d 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -416,27 +416,12 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
416 416
417static int __init acpiphp_init(void) 417static int __init acpiphp_init(void)
418{ 418{
419 int retval;
420 int docking_station;
421
422 info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); 419 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
423 420
424 acpiphp_debug = debug; 421 acpiphp_debug = debug;
425 422
426 docking_station = find_dock_station();
427
428 /* read all the ACPI info from the system */ 423 /* read all the ACPI info from the system */
429 retval = init_acpi(); 424 return init_acpi();
430
431 /* if we have found a docking station, we should
432 * go ahead and load even if init_acpi has found
433 * no slots. This handles the case when the _DCK
434 * method not defined under the actual dock bridge
435 */
436 if (docking_station)
437 return 0;
438 else
439 return retval;
440} 425}
441 426
442 427
@@ -444,8 +429,6 @@ static void __exit acpiphp_exit(void)
444{ 429{
445 /* deallocate internal data structures etc. */ 430 /* deallocate internal data structures etc. */
446 acpiphp_glue_exit(); 431 acpiphp_glue_exit();
447
448 remove_dock_station();
449} 432}
450 433
451module_init(acpiphp_init); 434module_init(acpiphp_init);
diff --git a/drivers/pci/hotplug/acpiphp_dock.c b/drivers/pci/hotplug/acpiphp_dock.c
deleted file mode 100644
index 4f1aaf128312..000000000000
--- a/drivers/pci/hotplug/acpiphp_dock.c
+++ /dev/null
@@ -1,438 +0,0 @@
1/*
2 * ACPI PCI HotPlug dock functions to ACPI CA subsystem
3 *
4 * Copyright (C) 2006 Kristen Carlson Accardi (kristen.c.accardi@intel.com)
5 * Copyright (C) 2006 Intel Corporation
6 *
7 * All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
17 * NON INFRINGEMENT. See the GNU General Public License for more
18 * details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * Send feedback to <kristen.c.accardi@intel.com>
25 *
26 */
27#include <linux/init.h>
28#include <linux/module.h>
29
30#include <linux/kernel.h>
31#include <linux/pci.h>
32#include <linux/smp_lock.h>
33#include <linux/mutex.h>
34
35#include "../pci.h"
36#include "pci_hotplug.h"
37#include "acpiphp.h"
38
39static struct acpiphp_dock_station *ds;
40#define MY_NAME "acpiphp_dock"
41
42
43int is_dependent_device(acpi_handle handle)
44{
45 return (get_dependent_device(handle) ? 1 : 0);
46}
47
48
49static acpi_status
50find_dependent_device(acpi_handle handle, u32 lvl, void *context, void **rv)
51{
52 int *count = (int *)context;
53
54 if (is_dependent_device(handle)) {
55 (*count)++;
56 return AE_CTRL_TERMINATE;
57 } else {
58 return AE_OK;
59 }
60}
61
62
63
64
65void add_dependent_device(struct dependent_device *new_dd)
66{
67 list_add_tail(&new_dd->device_list, &ds->dependent_devices);
68}
69
70
71void add_pci_dependent_device(struct dependent_device *new_dd)
72{
73 list_add_tail(&new_dd->pci_list, &ds->pci_dependent_devices);
74}
75
76
77
78struct dependent_device * get_dependent_device(acpi_handle handle)
79{
80 struct dependent_device *dd;
81
82 if (!ds)
83 return NULL;
84
85 list_for_each_entry(dd, &ds->dependent_devices, device_list) {
86 if (handle == dd->handle)
87 return dd;
88 }
89 return NULL;
90}
91
92
93
94struct dependent_device *alloc_dependent_device(acpi_handle handle)
95{
96 struct dependent_device *dd;
97
98 dd = kzalloc(sizeof(*dd), GFP_KERNEL);
99 if (dd) {
100 INIT_LIST_HEAD(&dd->pci_list);
101 INIT_LIST_HEAD(&dd->device_list);
102 dd->handle = handle;
103 }
104 return dd;
105}
106
107
108
109static int is_dock(acpi_handle handle)
110{
111 acpi_status status;
112 acpi_handle tmp;
113
114 status = acpi_get_handle(handle, "_DCK", &tmp);
115 if (ACPI_FAILURE(status)) {
116 return 0;
117 }
118 return 1;
119}
120
121
122
123static int dock_present(void)
124{
125 unsigned long sta;
126 acpi_status status;
127
128 if (ds) {
129 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
130 if (ACPI_SUCCESS(status) && sta)
131 return 1;
132 }
133 return 0;
134}
135
136
137
138static void eject_dock(void)
139{
140 struct acpi_object_list arg_list;
141 union acpi_object arg;
142
143 arg_list.count = 1;
144 arg_list.pointer = &arg;
145 arg.type = ACPI_TYPE_INTEGER;
146 arg.integer.value = 1;
147
148 if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0",
149 &arg_list, NULL)) || dock_present())
150 warn("%s: failed to eject dock!\n", __FUNCTION__);
151
152 return;
153}
154
155
156
157
158static acpi_status handle_dock(int dock)
159{
160 acpi_status status;
161 struct acpi_object_list arg_list;
162 union acpi_object arg;
163 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
164
165 dbg("%s: %s\n", __FUNCTION__, dock ? "docking" : "undocking");
166
167 /* _DCK method has one argument */
168 arg_list.count = 1;
169 arg_list.pointer = &arg;
170 arg.type = ACPI_TYPE_INTEGER;
171 arg.integer.value = dock;
172 status = acpi_evaluate_object(ds->handle, "_DCK",
173 &arg_list, &buffer);
174 if (ACPI_FAILURE(status))
175 err("%s: failed to execute _DCK\n", __FUNCTION__);
176 acpi_os_free(buffer.pointer);
177
178 return status;
179}
180
181
182
183static inline void dock(void)
184{
185 handle_dock(1);
186}
187
188
189
190static inline void undock(void)
191{
192 handle_dock(0);
193}
194
195
196
197/*
198 * the _DCK method can do funny things... and sometimes not
199 * hah-hah funny.
200 *
201 * TBD - figure out a way to only call fixups for
202 * systems that require them.
203 */
204static void post_dock_fixups(void)
205{
206 struct pci_bus *bus;
207 u32 buses;
208 struct dependent_device *dd;
209
210 list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list) {
211 bus = dd->func->slot->bridge->pci_bus;
212
213 /* fixup bad _DCK function that rewrites
214 * secondary bridge on slot
215 */
216 pci_read_config_dword(bus->self,
217 PCI_PRIMARY_BUS,
218 &buses);
219
220 if (((buses >> 8) & 0xff) != bus->secondary) {
221 buses = (buses & 0xff000000)
222 | ((unsigned int)(bus->primary) << 0)
223 | ((unsigned int)(bus->secondary) << 8)
224 | ((unsigned int)(bus->subordinate) << 16);
225 pci_write_config_dword(bus->self,
226 PCI_PRIMARY_BUS,
227 buses);
228 }
229 }
230}
231
232
233
234static void hotplug_pci(u32 type)
235{
236 struct dependent_device *dd;
237
238 list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list)
239 handle_hotplug_event_func(dd->handle, type, dd->func);
240}
241
242
243
244static inline void begin_dock(void)
245{
246 ds->flags |= DOCK_DOCKING;
247}
248
249
250static inline void complete_dock(void)
251{
252 ds->flags &= ~(DOCK_DOCKING);
253 ds->last_dock_time = jiffies;
254}
255
256
257static int dock_in_progress(void)
258{
259 if (ds->flags & DOCK_DOCKING ||
260 ds->last_dock_time == jiffies) {
261 dbg("dock in progress\n");
262 return 1;
263 }
264 return 0;
265}
266
267
268
269static void
270handle_hotplug_event_dock(acpi_handle handle, u32 type, void *context)
271{
272 dbg("%s: enter\n", __FUNCTION__);
273
274 switch (type) {
275 case ACPI_NOTIFY_BUS_CHECK:
276 dbg("BUS Check\n");
277 if (!dock_in_progress() && dock_present()) {
278 begin_dock();
279 dock();
280 if (!dock_present()) {
281 err("Unable to dock!\n");
282 break;
283 }
284 post_dock_fixups();
285 hotplug_pci(type);
286 complete_dock();
287 }
288 break;
289 case ACPI_NOTIFY_EJECT_REQUEST:
290 dbg("EJECT request\n");
291 if (!dock_in_progress() && dock_present()) {
292 hotplug_pci(type);
293 undock();
294 eject_dock();
295 if (dock_present())
296 err("Unable to undock!\n");
297 }
298 break;
299 }
300}
301
302
303
304
305static acpi_status
306find_dock_ejd(acpi_handle handle, u32 lvl, void *context, void **rv)
307{
308 acpi_status status;
309 acpi_handle tmp;
310 acpi_handle dck_handle = (acpi_handle) context;
311 char objname[64];
312 struct acpi_buffer buffer = { .length = sizeof(objname),
313 .pointer = objname };
314 struct acpi_buffer ejd_buffer = {ACPI_ALLOCATE_BUFFER, NULL};
315 union acpi_object *ejd_obj;
316
317 status = acpi_get_handle(handle, "_EJD", &tmp);
318 if (ACPI_FAILURE(status))
319 return AE_OK;
320
321 /* make sure we are dependent on the dock device,
322 * by executing the _EJD method, then getting a handle
323 * to the device referenced by that name. If that
324 * device handle is the same handle as the dock station
325 * handle, then we are a device dependent on the dock station
326 */
327 acpi_get_name(dck_handle, ACPI_FULL_PATHNAME, &buffer);
328 status = acpi_evaluate_object(handle, "_EJD", NULL, &ejd_buffer);
329 if (ACPI_FAILURE(status)) {
330 err("Unable to execute _EJD!\n");
331 goto find_ejd_out;
332 }
333 ejd_obj = ejd_buffer.pointer;
334 status = acpi_get_handle(NULL, ejd_obj->string.pointer, &tmp);
335 if (ACPI_FAILURE(status))
336 goto find_ejd_out;
337
338 if (tmp == dck_handle) {
339 struct dependent_device *dd;
340 dbg("%s: found device dependent on dock\n", __FUNCTION__);
341 dd = alloc_dependent_device(handle);
342 if (!dd) {
343 err("Can't allocate memory for dependent device!\n");
344 goto find_ejd_out;
345 }
346 add_dependent_device(dd);
347 }
348
349find_ejd_out:
350 acpi_os_free(ejd_buffer.pointer);
351 return AE_OK;
352}
353
354
355
356int detect_dependent_devices(acpi_handle *bridge_handle)
357{
358 acpi_status status;
359 int count;
360
361 count = 0;
362
363 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle,
364 (u32)1, find_dependent_device,
365 (void *)&count, NULL);
366
367 return count;
368}
369
370
371
372
373
374static acpi_status
375find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
376{
377 int *count = (int *)context;
378
379 if (is_dock(handle)) {
380 dbg("%s: found dock\n", __FUNCTION__);
381 ds = kzalloc(sizeof(*ds), GFP_KERNEL);
382 ds->handle = handle;
383 INIT_LIST_HEAD(&ds->dependent_devices);
384 INIT_LIST_HEAD(&ds->pci_dependent_devices);
385
386 /* look for devices dependent on dock station */
387 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
388 ACPI_UINT32_MAX, find_dock_ejd, handle, NULL);
389
390 acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
391 handle_hotplug_event_dock, ds);
392 (*count)++;
393 }
394
395 return AE_OK;
396}
397
398
399
400
401int find_dock_station(void)
402{
403 int num = 0;
404
405 ds = NULL;
406
407 /* start from the root object, because some laptops define
408 * _DCK methods outside the scope of PCI (IBM x-series laptop)
409 */
410 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
411 ACPI_UINT32_MAX, find_dock, &num, NULL);
412
413 return num;
414}
415
416
417
418void remove_dock_station(void)
419{
420 struct dependent_device *dd, *tmp;
421 if (ds) {
422 if (ACPI_FAILURE(acpi_remove_notify_handler(ds->handle,
423 ACPI_SYSTEM_NOTIFY, handle_hotplug_event_dock)))
424 err("failed to remove dock notify handler\n");
425
426 /* free all dependent devices */
427 list_for_each_entry_safe(dd, tmp, &ds->dependent_devices,
428 device_list)
429 kfree(dd);
430
431 /* no need to touch the pci_dependent_device list,
432 * cause all memory was freed above
433 */
434 kfree(ds);
435 }
436}
437
438
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index d370f999782e..ef95d12fb32c 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -59,6 +59,7 @@ static LIST_HEAD(bridge_list);
59static void handle_hotplug_event_bridge (acpi_handle, u32, void *); 59static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
60static void acpiphp_sanitize_bus(struct pci_bus *bus); 60static void acpiphp_sanitize_bus(struct pci_bus *bus);
61static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus); 61static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
62static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context);
62 63
63 64
64/* 65/*
@@ -116,6 +117,59 @@ is_ejectable_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
116 } 117 }
117} 118}
118 119
120/* callback routine to check for the existance of a pci dock device */
121static acpi_status
122is_pci_dock_device(acpi_handle handle, u32 lvl, void *context, void **rv)
123{
124 int *count = (int *)context;
125
126 if (is_dock_device(handle)) {
127 (*count)++;
128 return AE_CTRL_TERMINATE;
129 } else {
130 return AE_OK;
131 }
132}
133
134
135
136
137/*
138 * the _DCK method can do funny things... and sometimes not
139 * hah-hah funny.
140 *
141 * TBD - figure out a way to only call fixups for
142 * systems that require them.
143 */
144static int post_dock_fixups(struct notifier_block *nb, unsigned long val,
145 void *v)
146{
147 struct acpiphp_func *func = container_of(nb, struct acpiphp_func, nb);
148 struct pci_bus *bus = func->slot->bridge->pci_bus;
149 u32 buses;
150
151 if (!bus->self)
152 return NOTIFY_OK;
153
154 /* fixup bad _DCK function that rewrites
155 * secondary bridge on slot
156 */
157 pci_read_config_dword(bus->self,
158 PCI_PRIMARY_BUS,
159 &buses);
160
161 if (((buses >> 8) & 0xff) != bus->secondary) {
162 buses = (buses & 0xff000000)
163 | ((unsigned int)(bus->primary) << 0)
164 | ((unsigned int)(bus->secondary) << 8)
165 | ((unsigned int)(bus->subordinate) << 16);
166 pci_write_config_dword(bus->self, PCI_PRIMARY_BUS, buses);
167 }
168 return NOTIFY_OK;
169}
170
171
172
119 173
120/* callback routine to register each ACPI PCI slot object */ 174/* callback routine to register each ACPI PCI slot object */
121static acpi_status 175static acpi_status
@@ -124,7 +178,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
124 struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context; 178 struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context;
125 struct acpiphp_slot *slot; 179 struct acpiphp_slot *slot;
126 struct acpiphp_func *newfunc; 180 struct acpiphp_func *newfunc;
127 struct dependent_device *dd;
128 acpi_handle tmp; 181 acpi_handle tmp;
129 acpi_status status = AE_OK; 182 acpi_status status = AE_OK;
130 unsigned long adr, sun; 183 unsigned long adr, sun;
@@ -137,7 +190,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
137 190
138 status = acpi_get_handle(handle, "_EJ0", &tmp); 191 status = acpi_get_handle(handle, "_EJ0", &tmp);
139 192
140 if (ACPI_FAILURE(status) && !(is_dependent_device(handle))) 193 if (ACPI_FAILURE(status) && !(is_dock_device(handle)))
141 return AE_OK; 194 return AE_OK;
142 195
143 device = (adr >> 16) & 0xffff; 196 device = (adr >> 16) & 0xffff;
@@ -162,22 +215,17 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
162 if (ACPI_SUCCESS(acpi_get_handle(handle, "_PS3", &tmp))) 215 if (ACPI_SUCCESS(acpi_get_handle(handle, "_PS3", &tmp)))
163 newfunc->flags |= FUNC_HAS_PS3; 216 newfunc->flags |= FUNC_HAS_PS3;
164 217
165 if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp))) { 218 if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp)))
166 newfunc->flags |= FUNC_HAS_DCK; 219 newfunc->flags |= FUNC_HAS_DCK;
167 /* add to devices dependent on dock station,
168 * because this may actually be the dock bridge
169 */
170 dd = alloc_dependent_device(handle);
171 if (!dd)
172 err("Can't allocate memory for "
173 "new dependent device!\n");
174 else
175 add_dependent_device(dd);
176 }
177 220
178 status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun); 221 status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun);
179 if (ACPI_FAILURE(status)) 222 if (ACPI_FAILURE(status)) {
180 sun = -1; 223 /*
224 * use the count of the number of slots we've found
225 * for the number of the slot
226 */
227 sun = bridge->nr_slots+1;
228 }
181 229
182 /* search for objects that share the same slot */ 230 /* search for objects that share the same slot */
183 for (slot = bridge->slots; slot; slot = slot->next) 231 for (slot = bridge->slots; slot; slot = slot->next)
@@ -225,20 +273,23 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
225 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); 273 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
226 } 274 }
227 275
228 /* if this is a device dependent on a dock station, 276 if (is_dock_device(handle)) {
229 * associate the acpiphp_func to the dependent_device 277 /* we don't want to call this device's _EJ0
230 * struct. 278 * because we want the dock notify handler
231 */ 279 * to call it after it calls _DCK
232 if ((dd = get_dependent_device(handle))) {
233 newfunc->flags |= FUNC_IS_DD;
234 /*
235 * we don't want any devices which is dependent
236 * on the dock to have it's _EJ0 method executed.
237 * because we need to run _DCK first.
238 */ 280 */
239 newfunc->flags &= ~FUNC_HAS_EJ0; 281 newfunc->flags &= ~FUNC_HAS_EJ0;
240 dd->func = newfunc; 282 if (register_hotplug_dock_device(handle,
241 add_pci_dependent_device(dd); 283 handle_hotplug_event_func, newfunc))
284 dbg("failed to register dock device\n");
285
286 /* we need to be notified when dock events happen
287 * outside of the hotplug operation, since we may
288 * need to do fixups before we can hotplug.
289 */
290 newfunc->nb.notifier_call = post_dock_fixups;
291 if (register_dock_notifier(&newfunc->nb))
292 dbg("failed to register a dock notifier");
242 } 293 }
243 294
244 /* install notify handler */ 295 /* install notify handler */
@@ -277,6 +328,15 @@ static int detect_ejectable_slots(acpi_handle *bridge_handle)
277 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1, 328 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1,
278 is_ejectable_slot, (void *)&count, NULL); 329 is_ejectable_slot, (void *)&count, NULL);
279 330
331 /*
332 * we also need to add this bridge if there is a dock bridge or
333 * other pci device on a dock station (removable)
334 */
335 if (!count)
336 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle,
337 (u32)1, is_pci_dock_device, (void *)&count,
338 NULL);
339
280 return count; 340 return count;
281} 341}
282 342
@@ -487,8 +547,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
487 goto out; 547 goto out;
488 548
489 /* check if this bridge has ejectable slots */ 549 /* check if this bridge has ejectable slots */
490 if ((detect_ejectable_slots(handle) > 0) || 550 if ((detect_ejectable_slots(handle) > 0)) {
491 (detect_dependent_devices(handle) > 0)) {
492 dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev)); 551 dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev));
493 add_p2p_bridge(handle, dev); 552 add_p2p_bridge(handle, dev);
494 } 553 }
@@ -605,6 +664,10 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
605 list_for_each_safe (list, tmp, &slot->funcs) { 664 list_for_each_safe (list, tmp, &slot->funcs) {
606 struct acpiphp_func *func; 665 struct acpiphp_func *func;
607 func = list_entry(list, struct acpiphp_func, sibling); 666 func = list_entry(list, struct acpiphp_func, sibling);
667 if (is_dock_device(func->handle)) {
668 unregister_hotplug_dock_device(func->handle);
669 unregister_dock_notifier(&func->nb);
670 }
608 if (!(func->flags & FUNC_HAS_DCK)) { 671 if (!(func->flags & FUNC_HAS_DCK)) {
609 status = acpi_remove_notify_handler(func->handle, 672 status = acpi_remove_notify_handler(func->handle,
610 ACPI_SYSTEM_NOTIFY, 673 ACPI_SYSTEM_NOTIFY,
@@ -1440,7 +1503,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont
1440 * handles ACPI event notification on slots 1503 * handles ACPI event notification on slots
1441 * 1504 *
1442 */ 1505 */
1443void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context) 1506static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context)
1444{ 1507{
1445 struct acpiphp_func *func; 1508 struct acpiphp_func *func;
1446 char objname[64]; 1509 char objname[64];
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 037ce4c91687..30d87143b5d9 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -25,7 +25,6 @@
25 * Send feedback to <scottm@somanetworks.com> 25 * Send feedback to <scottm@somanetworks.com>
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 225b5e551dd6..02be74caa89f 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -23,7 +23,6 @@
23 * Send feedback to <scottm@somanetworks.com> 23 * Send feedback to <scottm@somanetworks.com>
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/pci.h> 28#include <linux/pci.h>
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index 2d4639d6841f..e847f0d6c7fe 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -34,7 +34,6 @@
34 * Send feedback to <scottm@somanetworks.com> 34 * Send feedback to <scottm@somanetworks.com>
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/init.h> 38#include <linux/init.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c
index 1ec165df8522..584f8538da13 100644
--- a/drivers/pci/hotplug/cpcihp_zt5550.c
+++ b/drivers/pci/hotplug/cpcihp_zt5550.c
@@ -30,7 +30,6 @@
30 * Send feedback to <scottm@somanetworks.com> 30 * Send feedback to <scottm@somanetworks.com>
31 */ 31 */
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
36#include <linux/init.h> 35#include <linux/init.h>
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index f8658d63f077..e6e171f77c34 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -29,7 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 55d2dc7e39ca..ae2dd36efef2 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/types.h> 31#include <linux/types.h>
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c
index ac98a11bd1eb..cf0878917537 100644
--- a/drivers/pci/hotplug/cpqphp_nvram.c
+++ b/drivers/pci/hotplug/cpqphp_nvram.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/types.h> 31#include <linux/types.h>
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index 00b81a7bdd26..0d9688952f4a 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/types.h> 31#include <linux/types.h>
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index bbfeed767ff1..8b3da007e859 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/types.h> 31#include <linux/types.h>
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 71b80c23e8ce..dd2b762777c4 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -32,7 +32,6 @@
32 * Enabling PCI devices is left as an exercise for the reader... 32 * Enabling PCI devices is left as an exercise for the reader...
33 * 33 *
34 */ 34 */
35#include <linux/config.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index c4282902cb52..b7b378df89e3 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
index 0a46f549676a..8ad446605f75 100644
--- a/drivers/pci/hotplug/pcihp_skeleton.c
+++ b/drivers/pci/hotplug/pcihp_skeleton.c
@@ -28,7 +28,6 @@
28 * 28 *
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 638004546700..076bd6dcafae 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -22,7 +22,6 @@
22 * Send feedback to <lxie@us.ibm.com> 22 * Send feedback to <lxie@us.ibm.com>
23 * 23 *
24 */ 24 */
25#include <linux/config.h>
26#include <linux/kernel.h> 25#include <linux/kernel.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/moduleparam.h> 27#include <linux/moduleparam.h>
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 76d023d8a33b..36bc7c415af7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -10,7 +10,6 @@
10#include <linux/irq.h> 10#include <linux/irq.h>
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/config.h>
14#include <linux/ioport.h> 13#include <linux/ioport.h>
15#include <linux/smp_lock.h> 14#include <linux/smp_lock.h>
16#include <linux/pci.h> 15#include <linux/pci.h>
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 606f9b6f70eb..fdefa7dcd156 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -15,7 +15,6 @@
15 */ 15 */
16 16
17 17
18#include <linux/config.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/pci.h> 19#include <linux/pci.h>
21#include <linux/stat.h> 20#include <linux/stat.h>
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 4364d793f73b..d1d7333bb71b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -15,7 +15,6 @@
15 * use the PowerTweak utility (see http://powertweak.sourceforge.net). 15 * use the PowerTweak utility (see http://powertweak.sourceforge.net).
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/pci.h> 20#include <linux/pci.h>
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index cbb69cf41311..f5ee7ce16fa6 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * PCI ROM access routines 7 * PCI ROM access routines
8 */ 8 */
9#include <linux/config.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/pci.h> 10#include <linux/pci.h>
12#include <linux/slab.h> 11#include <linux/slab.h>
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index a4d50940ebeb..5256342e8532 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -214,11 +214,10 @@ static struct pccard_operations at91_cf_ops = {
214 214
215/*--------------------------------------------------------------------------*/ 215/*--------------------------------------------------------------------------*/
216 216
217static int __init at91_cf_probe(struct device *dev) 217static int __init at91_cf_probe(struct platform_device *pdev)
218{ 218{
219 struct at91_cf_socket *cf; 219 struct at91_cf_socket *cf;
220 struct at91_cf_data *board = dev->platform_data; 220 struct at91_cf_data *board = pdev->dev.platform_data;
221 struct platform_device *pdev = to_platform_device(dev);
222 struct resource *io; 221 struct resource *io;
223 unsigned int csa; 222 unsigned int csa;
224 int status; 223 int status;
@@ -236,7 +235,7 @@ static int __init at91_cf_probe(struct device *dev)
236 235
237 cf->board = board; 236 cf->board = board;
238 cf->pdev = pdev; 237 cf->pdev = pdev;
239 dev_set_drvdata(dev, cf); 238 platform_set_drvdata(pdev, cf);
240 239
241 /* CF takes over CS4, CS5, CS6 */ 240 /* CF takes over CS4, CS5, CS6 */
242 csa = at91_sys_read(AT91_EBI_CSA); 241 csa = at91_sys_read(AT91_EBI_CSA);
@@ -271,6 +270,7 @@ static int __init at91_cf_probe(struct device *dev)
271 SA_SAMPLE_RANDOM, driver_name, cf); 270 SA_SAMPLE_RANDOM, driver_name, cf);
272 if (status < 0) 271 if (status < 0)
273 goto fail0; 272 goto fail0;
273 device_init_wakeup(&pdev->dev, 1);
274 274
275 /* 275 /*
276 * The card driver will request this irq later as needed. 276 * The card driver will request this irq later as needed.
@@ -301,7 +301,7 @@ static int __init at91_cf_probe(struct device *dev)
301 board->det_pin, board->irq_pin); 301 board->det_pin, board->irq_pin);
302 302
303 cf->socket.owner = THIS_MODULE; 303 cf->socket.owner = THIS_MODULE;
304 cf->socket.dev.dev = dev; 304 cf->socket.dev.dev = &pdev->dev;
305 cf->socket.ops = &at91_cf_ops; 305 cf->socket.ops = &at91_cf_ops;
306 cf->socket.resource_ops = &pccard_static_ops; 306 cf->socket.resource_ops = &pccard_static_ops;
307 cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP 307 cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
@@ -323,21 +323,25 @@ fail1:
323 free_irq(board->irq_pin, cf); 323 free_irq(board->irq_pin, cf);
324fail0a: 324fail0a:
325 free_irq(board->det_pin, cf); 325 free_irq(board->det_pin, cf);
326 device_init_wakeup(&pdev->dev, 0);
326fail0: 327fail0:
327 at91_sys_write(AT91_EBI_CSA, csa); 328 at91_sys_write(AT91_EBI_CSA, csa);
328 kfree(cf); 329 kfree(cf);
329 return status; 330 return status;
330} 331}
331 332
332static int __exit at91_cf_remove(struct device *dev) 333static int __exit at91_cf_remove(struct platform_device *pdev)
333{ 334{
334 struct at91_cf_socket *cf = dev_get_drvdata(dev); 335 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
336 struct at91_cf_data *board = cf->board;
335 struct resource *io = cf->socket.io[0].res; 337 struct resource *io = cf->socket.io[0].res;
336 unsigned int csa; 338 unsigned int csa;
337 339
338 pcmcia_unregister_socket(&cf->socket); 340 pcmcia_unregister_socket(&cf->socket);
339 free_irq(cf->board->irq_pin, cf); 341 if (board->irq_pin)
340 free_irq(cf->board->det_pin, cf); 342 free_irq(board->irq_pin, cf);
343 free_irq(board->det_pin, cf);
344 device_init_wakeup(&pdev->dev, 0);
341 iounmap((void __iomem *) cf->socket.io_offset); 345 iounmap((void __iomem *) cf->socket.io_offset);
342 release_mem_region(io->start, io->end + 1 - io->start); 346 release_mem_region(io->start, io->end + 1 - io->start);
343 347
@@ -348,26 +352,65 @@ static int __exit at91_cf_remove(struct device *dev)
348 return 0; 352 return 0;
349} 353}
350 354
351static struct device_driver at91_cf_driver = { 355#ifdef CONFIG_PM
352 .name = (char *) driver_name, 356
353 .bus = &platform_bus_type, 357static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
358{
359 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
360 struct at91_cf_data *board = cf->board;
361
362 pcmcia_socket_dev_suspend(&pdev->dev, mesg);
363 if (device_may_wakeup(&pdev->dev))
364 enable_irq_wake(board->det_pin);
365 else {
366 disable_irq_wake(board->det_pin);
367 disable_irq(board->det_pin);
368 }
369 if (board->irq_pin)
370 disable_irq(board->irq_pin);
371 return 0;
372}
373
374static int at91_cf_resume(struct platform_device *pdev)
375{
376 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
377 struct at91_cf_data *board = cf->board;
378
379 if (board->irq_pin)
380 enable_irq(board->irq_pin);
381 if (!device_may_wakeup(&pdev->dev))
382 enable_irq(board->det_pin);
383 pcmcia_socket_dev_resume(&pdev->dev);
384 return 0;
385}
386
387#else
388#define at91_cf_suspend NULL
389#define at91_cf_resume NULL
390#endif
391
392static struct platform_driver at91_cf_driver = {
393 .driver = {
394 .name = (char *) driver_name,
395 .owner = THIS_MODULE,
396 },
354 .probe = at91_cf_probe, 397 .probe = at91_cf_probe,
355 .remove = __exit_p(at91_cf_remove), 398 .remove = __exit_p(at91_cf_remove),
356 .suspend = pcmcia_socket_dev_suspend, 399 .suspend = at91_cf_suspend,
357 .resume = pcmcia_socket_dev_resume, 400 .resume = at91_cf_resume,
358}; 401};
359 402
360/*--------------------------------------------------------------------------*/ 403/*--------------------------------------------------------------------------*/
361 404
362static int __init at91_cf_init(void) 405static int __init at91_cf_init(void)
363{ 406{
364 return driver_register(&at91_cf_driver); 407 return platform_driver_register(&at91_cf_driver);
365} 408}
366module_init(at91_cf_init); 409module_init(at91_cf_init);
367 410
368static void __exit at91_cf_exit(void) 411static void __exit at91_cf_exit(void)
369{ 412{
370 driver_unregister(&at91_cf_driver); 413 platform_driver_unregister(&at91_cf_driver);
371} 414}
372module_exit(at91_cf_exit); 415module_exit(at91_cf_exit);
373 416
diff --git a/drivers/pcmcia/au1000_db1x00.c b/drivers/pcmcia/au1000_db1x00.c
index abc13f28ba3f..74e051535d6c 100644
--- a/drivers/pcmcia/au1000_db1x00.c
+++ b/drivers/pcmcia/au1000_db1x00.c
@@ -30,7 +30,6 @@
30 * 30 *
31 */ 31 */
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/errno.h> 35#include <linux/errno.h>
@@ -296,7 +295,7 @@ struct pcmcia_low_level db1x00_pcmcia_ops = {
296 .socket_suspend = db1x00_socket_suspend 295 .socket_suspend = db1x00_socket_suspend
297}; 296};
298 297
299int __init au1x_board_init(struct device *dev) 298int au1x_board_init(struct device *dev)
300{ 299{
301 int ret = -ENODEV; 300 int ret = -ENODEV;
302 bcsr->pcmcia = 0; /* turn off power, if it's not already off */ 301 bcsr->pcmcia = 0; /* turn off power, if it's not already off */
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 971a35281649..d5dd0ce65536 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -33,7 +33,6 @@
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/config.h>
37#include <linux/cpufreq.h> 36#include <linux/cpufreq.h>
38#include <linux/ioport.h> 37#include <linux/ioport.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h
index f2c970b5f4ff..1e467bb54077 100644
--- a/drivers/pcmcia/au1000_generic.h
+++ b/drivers/pcmcia/au1000_generic.h
@@ -22,7 +22,6 @@
22#define __ASM_AU1000_PCMCIA_H 22#define __ASM_AU1000_PCMCIA_H
23 23
24/* include the world */ 24/* include the world */
25#include <linux/config.h>
26 25
27#include <pcmcia/cs_types.h> 26#include <pcmcia/cs_types.h>
28#include <pcmcia/cs.h> 27#include <pcmcia/cs.h>
diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c
index fd5522ede867..86c0808d6a05 100644
--- a/drivers/pcmcia/au1000_pb1x00.c
+++ b/drivers/pcmcia/au1000_pb1x00.c
@@ -21,7 +21,6 @@
21 * with this program; if not, write to the Free Software Foundation, Inc., 21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 22 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 */ 23 */
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 3162998579c1..f9cd831a3f31 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -28,6 +28,7 @@
28#include <linux/pm.h> 28#include <linux/pm.h>
29#include <linux/pci.h> 29#include <linux/pci.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/kthread.h>
31#include <asm/system.h> 32#include <asm/system.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33 34
@@ -176,6 +177,7 @@ static int pccardd(void *__skt);
176 */ 177 */
177int pcmcia_register_socket(struct pcmcia_socket *socket) 178int pcmcia_register_socket(struct pcmcia_socket *socket)
178{ 179{
180 struct task_struct *tsk;
179 int ret; 181 int ret;
180 182
181 if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops) 183 if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops)
@@ -239,15 +241,18 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
239 mutex_init(&socket->skt_mutex); 241 mutex_init(&socket->skt_mutex);
240 spin_lock_init(&socket->thread_lock); 242 spin_lock_init(&socket->thread_lock);
241 243
242 ret = kernel_thread(pccardd, socket, CLONE_KERNEL); 244 tsk = kthread_run(pccardd, socket, "pccardd");
243 if (ret < 0) 245 if (IS_ERR(tsk)) {
246 ret = PTR_ERR(tsk);
244 goto err; 247 goto err;
248 }
245 249
246 wait_for_completion(&socket->thread_done); 250 wait_for_completion(&socket->thread_done);
247 if(!socket->thread) { 251 if (!socket->thread) {
248 printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket); 252 printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket);
249 return -EIO; 253 return -EIO;
250 } 254 }
255
251 pcmcia_parse_events(socket, SS_DETECT); 256 pcmcia_parse_events(socket, SS_DETECT);
252 257
253 return 0; 258 return 0;
@@ -272,10 +277,8 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
272 cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops); 277 cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
273 278
274 if (socket->thread) { 279 if (socket->thread) {
275 init_completion(&socket->thread_done);
276 socket->thread = NULL;
277 wake_up(&socket->thread_wait); 280 wake_up(&socket->thread_wait);
278 wait_for_completion(&socket->thread_done); 281 kthread_stop(socket->thread);
279 } 282 }
280 release_cis_mem(socket); 283 release_cis_mem(socket);
281 284
@@ -630,8 +633,6 @@ static int pccardd(void *__skt)
630 DECLARE_WAITQUEUE(wait, current); 633 DECLARE_WAITQUEUE(wait, current);
631 int ret; 634 int ret;
632 635
633 daemonize("pccardd");
634
635 skt->thread = current; 636 skt->thread = current;
636 skt->socket = dead_socket; 637 skt->socket = dead_socket;
637 skt->ops->init(skt); 638 skt->ops->init(skt);
@@ -643,7 +644,8 @@ static int pccardd(void *__skt)
643 printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n", 644 printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n",
644 skt); 645 skt);
645 skt->thread = NULL; 646 skt->thread = NULL;
646 complete_and_exit(&skt->thread_done, 0); 647 complete(&skt->thread_done);
648 return 0;
647 } 649 }
648 650
649 add_wait_queue(&skt->thread_wait, &wait); 651 add_wait_queue(&skt->thread_wait, &wait);
@@ -674,7 +676,7 @@ static int pccardd(void *__skt)
674 continue; 676 continue;
675 } 677 }
676 678
677 if (!skt->thread) 679 if (kthread_should_stop())
678 break; 680 break;
679 681
680 schedule(); 682 schedule();
@@ -688,7 +690,7 @@ static int pccardd(void *__skt)
688 /* remove from the device core */ 690 /* remove from the device core */
689 class_device_unregister(&skt->dev); 691 class_device_unregister(&skt->dev);
690 692
691 complete_and_exit(&skt->thread_done, 0); 693 return 0;
692} 694}
693 695
694/* 696/*
@@ -697,11 +699,12 @@ static int pccardd(void *__skt)
697 */ 699 */
698void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) 700void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
699{ 701{
702 unsigned long flags;
700 cs_dbg(s, 4, "parse_events: events %08x\n", events); 703 cs_dbg(s, 4, "parse_events: events %08x\n", events);
701 if (s->thread) { 704 if (s->thread) {
702 spin_lock(&s->thread_lock); 705 spin_lock_irqsave(&s->thread_lock, flags);
703 s->thread_events |= events; 706 s->thread_events |= events;
704 spin_unlock(&s->thread_lock); 707 spin_unlock_irqrestore(&s->thread_lock, flags);
705 708
706 wake_up(&s->thread_wait); 709 wake_up(&s->thread_wait);
707 } 710 }
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 071cf485e1a3..9e768eaef17a 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -10,7 +10,6 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/moduleparam.h> 11#include <linux/moduleparam.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/fcntl.h> 14#include <linux/fcntl.h>
16#include <linux/string.h> 15#include <linux/string.h>
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 70d5f0748d55..61d50b5620dd 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -10,7 +10,6 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/moduleparam.h> 11#include <linux/moduleparam.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/fcntl.h> 14#include <linux/fcntl.h>
16#include <linux/string.h> 15#include <linux/string.h>
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 3131bb0a0095..3281e519e714 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -788,6 +788,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
788 struct pcmcia_socket *s = p_dev->socket; 788 struct pcmcia_socket *s = p_dev->socket;
789 config_t *c; 789 config_t *c;
790 int ret = CS_IN_USE, irq = 0; 790 int ret = CS_IN_USE, irq = 0;
791 int type;
791 792
792 if (!(s->state & SOCKET_PRESENT)) 793 if (!(s->state & SOCKET_PRESENT))
793 return CS_NO_CARD; 794 return CS_NO_CARD;
@@ -797,6 +798,13 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
797 if (c->state & CONFIG_IRQ_REQ) 798 if (c->state & CONFIG_IRQ_REQ)
798 return CS_IN_USE; 799 return CS_IN_USE;
799 800
801 /* Decide what type of interrupt we are registering */
802 type = 0;
803 if (s->functions > 1) /* All of this ought to be handled higher up */
804 type = SA_SHIRQ;
805 if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
806 type = SA_SHIRQ;
807
800#ifdef CONFIG_PCMCIA_PROBE 808#ifdef CONFIG_PCMCIA_PROBE
801 if (s->irq.AssignedIRQ != 0) { 809 if (s->irq.AssignedIRQ != 0) {
802 /* If the interrupt is already assigned, it must be the same */ 810 /* If the interrupt is already assigned, it must be the same */
@@ -822,9 +830,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
822 * marked as used by the kernel resource management core */ 830 * marked as used by the kernel resource management core */
823 ret = request_irq(irq, 831 ret = request_irq(irq,
824 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action, 832 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action,
825 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || 833 type,
826 (s->functions > 1) ||
827 (irq == s->pci_irq)) ? SA_SHIRQ : 0,
828 p_dev->devname, 834 p_dev->devname,
829 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); 835 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data);
830 if (!ret) { 836 if (!ret) {
@@ -839,18 +845,21 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
839 if (ret && !s->irq.AssignedIRQ) { 845 if (ret && !s->irq.AssignedIRQ) {
840 if (!s->pci_irq) 846 if (!s->pci_irq)
841 return ret; 847 return ret;
848 type = SA_SHIRQ;
842 irq = s->pci_irq; 849 irq = s->pci_irq;
843 } 850 }
844 851
845 if (ret && req->Attributes & IRQ_HANDLE_PRESENT) { 852 if (ret && (req->Attributes & IRQ_HANDLE_PRESENT)) {
846 if (request_irq(irq, req->Handler, 853 if (request_irq(irq, req->Handler, type, p_dev->devname, req->Instance))
847 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
848 (s->functions > 1) ||
849 (irq == s->pci_irq)) ? SA_SHIRQ : 0,
850 p_dev->devname, req->Instance))
851 return CS_IN_USE; 854 return CS_IN_USE;
852 } 855 }
853 856
857 /* Make sure the fact the request type was overridden is passed back */
858 if (type == SA_SHIRQ && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
859 req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
860 printk(KERN_WARNING "pcmcia: request for exclusive IRQ could not be fulfilled.\n");
861 printk(KERN_WARNING "pcmcia: the driver needs updating to supported shared IRQ lines.\n");
862 }
854 c->irq.Attributes = req->Attributes; 863 c->irq.Attributes = req->Attributes;
855 s->irq.AssignedIRQ = req->AssignedIRQ = irq; 864 s->irq.AssignedIRQ = req->AssignedIRQ = irq;
856 s->irq.Config++; 865 s->irq.Config++;
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 7fa18fb814bc..b3518131ea0d 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/config.h>
22#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
23#include <linux/ioport.h> 22#include <linux/ioport.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 6d441ec75c6a..c5b2a44b4c37 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -32,7 +32,6 @@
32 32
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/config.h>
36#include <linux/platform_device.h> 35#include <linux/platform_device.h>
37 36
38#include <pcmcia/cs_types.h> 37#include <pcmcia/cs_types.h>
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 81ded52c8959..658cddfbcf29 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -5,7 +5,6 @@
5 * basically means we handle everything except controlling the 5 * basically means we handle everything except controlling the
6 * power. Power is machine specific... 6 * power. Power is machine specific...
7 */ 7 */
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/ioport.h> 10#include <linux/ioport.h>
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index 59c5d968e9f6..31a7abc55b23 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -32,7 +32,6 @@
32 32
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/config.h>
36#include <linux/cpufreq.h> 35#include <linux/cpufreq.h>
37#include <linux/ioport.h> 36#include <linux/ioport.h>
38#include <linux/kernel.h> 37#include <linux/kernel.h>
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index ea7d9ca160b2..ecf65d4c4e95 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -31,7 +31,6 @@
31======================================================================*/ 31======================================================================*/
32 32
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37#include <linux/init.h> 36#include <linux/init.h>
diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
index 7a3d1b8e16b9..62e9ebf967f9 100644
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -647,6 +647,7 @@ static int ti12xx_2nd_slot_empty(struct yenta_socket *socket)
647 */ 647 */
648 break; 648 break;
649 649
650 case PCI_DEVICE_ID_TI_XX12:
650 case PCI_DEVICE_ID_TI_X515: 651 case PCI_DEVICE_ID_TI_X515:
651 case PCI_DEVICE_ID_TI_X420: 652 case PCI_DEVICE_ID_TI_X420:
652 case PCI_DEVICE_ID_TI_X620: 653 case PCI_DEVICE_ID_TI_X620:
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 4145eb83b9b6..47e57602d5ea 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -287,7 +287,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
287 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); 287 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
288 u16 bridge; 288 u16 bridge;
289 289
290 yenta_set_power(socket, state); 290 /* if powering down: do it immediately */
291 if (state->Vcc == 0)
292 yenta_set_power(socket, state);
293
291 socket->io_irq = state->io_irq; 294 socket->io_irq = state->io_irq;
292 bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR); 295 bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR);
293 if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) { 296 if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) {
@@ -339,6 +342,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
339 /* Socket event mask: get card insert/remove events.. */ 342 /* Socket event mask: get card insert/remove events.. */
340 cb_writel(socket, CB_SOCKET_EVENT, -1); 343 cb_writel(socket, CB_SOCKET_EVENT, -1);
341 cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK); 344 cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
345
346 /* if powering up: do it as the last step when the socket is configured */
347 if (state->Vcc != 0)
348 yenta_set_power(socket, state);
342 return 0; 349 return 0;
343} 350}
344 351
@@ -998,6 +1005,77 @@ static void yenta_config_init(struct yenta_socket *socket)
998 config_writew(socket, CB_BRIDGE_CONTROL, bridge); 1005 config_writew(socket, CB_BRIDGE_CONTROL, bridge);
999} 1006}
1000 1007
1008/**
1009 * yenta_fixup_parent_bridge - Fix subordinate bus# of the parent bridge
1010 * @cardbus_bridge: The PCI bus which the CardBus bridge bridges to
1011 *
1012 * Checks if devices on the bus which the CardBus bridge bridges to would be
1013 * invisible during PCI scans because of a misconfigured subordinate number
1014 * of the parent brige - some BIOSes seem to be too lazy to set it right.
1015 * Does the fixup carefully by checking how far it can go without conflicts.
1016 * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information.
1017 */
1018static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
1019{
1020 struct list_head *tmp;
1021 unsigned char upper_limit;
1022 /*
1023 * We only check and fix the parent bridge: All systems which need
1024 * this fixup that have been reviewed are laptops and the only bridge
1025 * which needed fixing was the parent bridge of the CardBus bridge:
1026 */
1027 struct pci_bus *bridge_to_fix = cardbus_bridge->parent;
1028
1029 /* Check bus numbers are already set up correctly: */
1030 if (bridge_to_fix->subordinate >= cardbus_bridge->subordinate)
1031 return; /* The subordinate number is ok, nothing to do */
1032
1033 if (!bridge_to_fix->parent)
1034 return; /* Root bridges are ok */
1035
1036 /* stay within the limits of the bus range of the parent: */
1037 upper_limit = bridge_to_fix->parent->subordinate;
1038
1039 /* check the bus ranges of all silbling bridges to prevent overlap */
1040 list_for_each(tmp, &bridge_to_fix->parent->children) {
1041 struct pci_bus * silbling = pci_bus_b(tmp);
1042 /*
1043 * If the silbling has a higher secondary bus number
1044 * and it's secondary is equal or smaller than our
1045 * current upper limit, set the new upper limit to
1046 * the bus number below the silbling's range:
1047 */
1048 if (silbling->secondary > bridge_to_fix->subordinate
1049 && silbling->secondary <= upper_limit)
1050 upper_limit = silbling->secondary - 1;
1051 }
1052
1053 /* Show that the wanted subordinate number is not possible: */
1054 if (cardbus_bridge->subordinate > upper_limit)
1055 printk(KERN_WARNING "Yenta: Upper limit for fixing this "
1056 "bridge's parent bridge: #%02x\n", upper_limit);
1057
1058 /* If we have room to increase the bridge's subordinate number, */
1059 if (bridge_to_fix->subordinate < upper_limit) {
1060
1061 /* use the highest number of the hidden bus, within limits */
1062 unsigned char subordinate_to_assign =
1063 min(cardbus_bridge->subordinate, upper_limit);
1064
1065 printk(KERN_INFO "Yenta: Raising subordinate bus# of parent "
1066 "bus (#%02x) from #%02x to #%02x\n",
1067 bridge_to_fix->number,
1068 bridge_to_fix->subordinate, subordinate_to_assign);
1069
1070 /* Save the new subordinate in the bus struct of the bridge */
1071 bridge_to_fix->subordinate = subordinate_to_assign;
1072
1073 /* and update the PCI config space with the new subordinate */
1074 pci_write_config_byte(bridge_to_fix->self,
1075 PCI_SUBORDINATE_BUS, bridge_to_fix->subordinate);
1076 }
1077}
1078
1001/* 1079/*
1002 * Initialize a cardbus controller. Make sure we have a usable 1080 * Initialize a cardbus controller. Make sure we have a usable
1003 * interrupt, and that we can map the cardbus area. Fill in the 1081 * interrupt, and that we can map the cardbus area. Fill in the
@@ -1113,6 +1191,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
1113 yenta_get_socket_capabilities(socket, isa_interrupts); 1191 yenta_get_socket_capabilities(socket, isa_interrupts);
1114 printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); 1192 printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
1115 1193
1194 yenta_fixup_parent_bridge(dev->subordinate);
1195
1116 /* Register it with the pcmcia layer.. */ 1196 /* Register it with the pcmcia layer.. */
1117 ret = pcmcia_register_socket(&socket->socket); 1197 ret = pcmcia_register_socket(&socket->socket);
1118 if (ret == 0) { 1198 if (ret == 0) {
@@ -1232,6 +1312,7 @@ static struct pci_device_id yenta_table [] = {
1232 1312
1233 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11, TI12XX), 1313 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11, TI12XX),
1234 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X515, TI12XX), 1314 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X515, TI12XX),
1315 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12, TI12XX),
1235 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X420, TI12XX), 1316 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X420, TI12XX),
1236 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X620, TI12XX), 1317 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X620, TI12XX),
1237 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7410, TI12XX), 1318 CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7410, TI12XX),
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 0b4adcb60df4..227600cd6360 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/slab.h> 9#include <linux/slab.h>
11#include <linux/pnp.h> 10#include <linux/pnp.h>
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index e54c15383193..e161423b4300 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/string.h> 8#include <linux/string.h>
10#include <linux/list.h> 9#include <linux/list.h>
11#include <linux/module.h> 10#include <linux/module.h>
diff --git a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c
index 3ff7e76b33bd..0697ab88a9ac 100644
--- a/drivers/pnp/isapnp/compat.c
+++ b/drivers/pnp/isapnp/compat.c
@@ -8,7 +8,6 @@
8 8
9/* TODO: see if more isapnp functions are needed here */ 9/* TODO: see if more isapnp functions are needed here */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/isapnp.h> 12#include <linux/isapnp.h>
14#include <linux/string.h> 13#include <linux/string.h>
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index ac7c2bb6c69e..f2e0179962e2 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -34,7 +34,6 @@
34 * 2003-08-11 Resource Management Updates - Adam Belay <ambx1@neo.rr.com> 34 * 2003-08-11 Resource Management Updates - Adam Belay <ambx1@neo.rr.com>
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index cf54b0a3628e..958c11bedd0d 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -19,7 +19,6 @@
19 * 19 *
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/isapnp.h> 23#include <linux/isapnp.h>
25#include <linux/proc_fs.h> 24#include <linux/proc_fs.h>
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 1d7a5b87f4cb..5026b345cb30 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/init.h> 11#include <linux/init.h>
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index f104577f73e0..6cf34a63c790 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -19,7 +19,6 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/acpi.h> 22#include <linux/acpi.h>
24#include <linux/pnp.h> 23#include <linux/pnp.h>
25#include <acpi/acpi_bus.h> 24#include <acpi/acpi_bus.h>
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index c89c98a2cca8..ef508a4de557 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -3,7 +3,6 @@
3 * 3 *
4 */ 4 */
5 5
6#include <linux/config.h>
7#include <linux/ctype.h> 6#include <linux/ctype.h>
8#include <linux/pnp.h> 7#include <linux/pnp.h>
9#include <linux/pnpbios.h> 8#include <linux/pnpbios.h>
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 8936b0cb2ec3..e97ecefe8584 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -11,7 +11,6 @@
11 * Copyright (c) 1999 Martin Mares <mj@ucw.cz> 11 * Copyright (c) 1999 Martin Mares <mj@ucw.cz>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/string.h> 16#include <linux/string.h>
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 7bb892f58cc0..e7cf6bec737e 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
12#include <linux/interrupt.h> 11#include <linux/interrupt.h>
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c
index 61fe998944bd..946a0dcd627d 100644
--- a/drivers/pnp/support.c
+++ b/drivers/pnp/support.c
@@ -5,7 +5,6 @@
5 * 5 *
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/ctype.h> 9#include <linux/ctype.h>
11#include <linux/pnp.h> 10#include <linux/pnp.h>
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 94e30fe4b8f3..7bf7b2c88245 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -10,7 +10,6 @@
10 * option) any later version. 10 * option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16 15
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index bef9316e95df..5687b8fcbf93 100644
--- a/drivers/rapidio/rio-sysfs.c
+++ b/drivers/rapidio/rio-sysfs.c
@@ -10,7 +10,6 @@
10 * option) any later version. 10 * option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/rio.h> 14#include <linux/rio.h>
16#include <linux/rio_drv.h> 15#include <linux/rio_drv.h>
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 5e382470faa2..f644807da2f9 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -11,7 +11,6 @@
11 * option) any later version. 11 * option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17 16
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index f2fc81a9074d..d51afbe014e5 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -15,7 +15,7 @@ config RTC_CLASS
15 help 15 help
16 Generic RTC class support. If you say yes here, you will 16 Generic RTC class support. If you say yes here, you will
17 be allowed to plug one or more RTCs to your system. You will 17 be allowed to plug one or more RTCs to your system. You will
18 probably want to enable one of more of the interfaces below. 18 probably want to enable one or more of the interfaces below.
19 19
20 This driver can also be built as a module. If so, the module 20 This driver can also be built as a module. If so, the module
21 will be called rtc-class. 21 will be called rtc-class.
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 2dc179b14ce6..4bf03fb67f8d 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kmod.h> 12#include <linux/kmod.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/interrupt.h> 14#include <linux/interrupt.h>
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 9e9ae7179602..d7295386821c 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/ctype.h> 16#include <linux/ctype.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/module.h> 18#include <linux/module.h>
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 4002f6c1c1b3..23fa0b289173 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/stddef.h> 11#include <linux/stddef.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 0dfab30e8089..2e655f466743 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/stddef.h> 12#include <linux/stddef.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c
index 4108d96f6a5a..58a65097922b 100644
--- a/drivers/s390/block/dasd_erp.c
+++ b/drivers/s390/block/dasd_erp.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/ctype.h> 12#include <linux/ctype.h>
14#include <linux/init.h> 13#include <linux/init.h>
15 14
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index bb7755b9b19d..808434d38526 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/stddef.h> 9#include <linux/stddef.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12#include <asm/debug.h> 11#include <asm/debug.h>
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 61ffde718a7a..12c7d296eaa8 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/interrupt.h> 14#include <linux/interrupt.h>
16#include <linux/fs.h> 15#include <linux/fs.h>
17#include <linux/blkpg.h> 16#include <linux/blkpg.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 302bcd0f28be..e97f5316ad2d 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -9,7 +9,6 @@
9 * 9 *
10 * i/o controls for the dasd driver. 10 * i/o controls for the dasd driver.
11 */ 11 */
12#include <linux/config.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
14#include <linux/major.h> 13#include <linux/major.h>
15#include <linux/fs.h> 14#include <linux/fs.h>
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index ad23aede356c..bfa010f6dab2 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/ctype.h> 14#include <linux/ctype.h>
16#include <linux/seq_file.h> 15#include <linux/seq_file.h>
17#include <linux/vmalloc.h> 16#include <linux/vmalloc.h>
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 606f6ad285a0..f25c6d116f6f 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -11,7 +11,6 @@
11 * Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu) 11 * Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu)
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index ef607a1de55a..7566be890688 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -8,7 +8,6 @@
8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/bootmem.h> 11#include <linux/bootmem.h>
13#include <linux/console.h> 12#include <linux/console.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c
index be463242cf0f..0ea6f36a2527 100644
--- a/drivers/s390/char/ctrlchar.c
+++ b/drivers/s390/char/ctrlchar.c
@@ -7,7 +7,6 @@
7 * 7 *
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/stddef.h> 10#include <linux/stddef.h>
12#include <asm/errno.h> 11#include <asm/errno.h>
13#include <linux/sysrq.h> 12#include <linux/sysrq.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index a6415377bc73..6099c14de429 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -8,7 +8,6 @@
8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/bootmem.h> 11#include <linux/bootmem.h>
13#include <linux/console.h> 12#include <linux/console.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index d4d2ff0a9da2..547ef906ae2c 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -7,7 +7,6 @@
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/sched.h> 11#include <linux/sched.h>
13#include <linux/sysrq.h> 12#include <linux/sysrq.h>
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 3c1314b7391b..e95b56f810db 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -8,7 +8,6 @@
8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/bootmem.h> 11#include <linux/bootmem.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/err.h> 13#include <linux/err.h>
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
index 10ef22f13541..86864f641716 100644
--- a/drivers/s390/char/sclp_con.c
+++ b/drivers/s390/char/sclp_con.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kmod.h> 11#include <linux/kmod.h>
13#include <linux/console.h> 12#include <linux/console.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c
index 80f7f31310e6..732dfbdb85c4 100644
--- a/drivers/s390/char/sclp_cpi.c
+++ b/drivers/s390/char/sclp_cpi.c
@@ -5,7 +5,6 @@
5 * SCLP Control-Program Identification. 5 * SCLP Control-Program Identification.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/version.h> 8#include <linux/version.h>
10#include <linux/kmod.h> 9#include <linux/kmod.h>
11#include <linux/module.h> 10#include <linux/module.h>
diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c
index a4c53c172db6..32004aae95c1 100644
--- a/drivers/s390/char/sclp_quiesce.c
+++ b/drivers/s390/char/sclp_quiesce.c
@@ -7,7 +7,6 @@
7 * Peter Oberparleiter <peter.oberparleiter@de.ibm.com> 7 * Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/cpumask.h> 12#include <linux/cpumask.h>
diff --git a/drivers/s390/char/sclp_rw.c b/drivers/s390/char/sclp_rw.c
index 91e93c78f57a..0c92d3909cca 100644
--- a/drivers/s390/char/sclp_rw.c
+++ b/drivers/s390/char/sclp_rw.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kmod.h> 11#include <linux/kmod.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/err.h> 13#include <linux/err.h>
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 6cbf067f1a8f..f6cf9023039e 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/kmod.h> 12#include <linux/kmod.h>
14#include <linux/tty.h> 13#include <linux/tty.h>
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 9e02625c82cf..54fba6f17188 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -7,7 +7,6 @@
7 * Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com> 7 * Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/spinlock.h> 11#include <linux/spinlock.h>
13#include <linux/list.h> 12#include <linux/list.h>
diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h
index cd51ace8b610..1f4c89967be4 100644
--- a/drivers/s390/char/tape.h
+++ b/drivers/s390/char/tape.h
@@ -16,7 +16,6 @@
16#include <asm/ccwdev.h> 16#include <asm/ccwdev.h>
17#include <asm/debug.h> 17#include <asm/debug.h>
18#include <asm/idals.h> 18#include <asm/idals.h>
19#include <linux/config.h>
20#include <linux/blkdev.h> 19#include <linux/blkdev.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/module.h> 21#include <linux/module.h>
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
index d4f2da738078..48b4d30a7256 100644
--- a/drivers/s390/char/tape_34xx.c
+++ b/drivers/s390/char/tape_34xx.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/bio.h> 13#include <linux/bio.h>
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
index d71ef1adea59..928cbefc49d5 100644
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky <schwidefsky@de.ibm.com> 8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/bio.h> 13#include <linux/bio.h>
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index b70d92690242..3225fcd1dcb4 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/blkdev.h> 15#include <linux/blkdev.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 5ce7ca38ace0..97f75237bed6 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -10,7 +10,6 @@
10 * Martin Schwidefsky <schwidefsky@de.ibm.com> 10 * Martin Schwidefsky <schwidefsky@de.ibm.com>
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index e6e4086d3224..122b4d8965c3 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -11,7 +11,6 @@
11 * Stefan Bader <shbader@de.ibm.com> 11 * Stefan Bader <shbader@de.ibm.com>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> // for kernel parameters 15#include <linux/init.h> // for kernel parameters
17#include <linux/kmod.h> // for requesting modules 16#include <linux/kmod.h> // for requesting modules
diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c
index 5fec0a10cc3d..655d375ab22b 100644
--- a/drivers/s390/char/tape_proc.c
+++ b/drivers/s390/char/tape_proc.c
@@ -11,7 +11,6 @@
11 * PROCFS Functions 11 * PROCFS Functions
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
17#include <linux/seq_file.h> 16#include <linux/seq_file.h>
diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c
index 99cf881f41db..7a76ec413a3a 100644
--- a/drivers/s390/char/tape_std.c
+++ b/drivers/s390/char/tape_std.c
@@ -11,7 +11,6 @@
11 * Stefan Bader <shbader@de.ibm.com> 11 * Stefan Bader <shbader@de.ibm.com>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/stddef.h> 14#include <linux/stddef.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/bio.h> 16#include <linux/bio.h>
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 7d26a3e4cb80..f496f236b9c0 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -8,7 +8,6 @@
8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/kdev_t.h> 13#include <linux/kdev_t.h>
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 15b895496a45..12c2d6b746e6 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -9,7 +9,6 @@
9 * Arnd Bergmann (arndb@de.ibm.com) 9 * Arnd Bergmann (arndb@de.ibm.com)
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index b00f3ed051a0..a01f3bba4a7b 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/config.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/device.h> 15#include <linux/device.h>
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 5b20d8c9c025..a3423267467f 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
17#include <linux/device.h> 16#include <linux/device.h>
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index eafde43e8410..67f0de6aed33 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -8,7 +8,6 @@
8 * Cornelia Huck (cornelia.huck@de.ibm.com) 8 * Cornelia Huck (cornelia.huck@de.ibm.com)
9 * Martin Schwidefsky (schwidefsky@de.ibm.com) 9 * Martin Schwidefsky (schwidefsky@de.ibm.com)
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/spinlock.h> 13#include <linux/spinlock.h>
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 7d0dd72635eb..cb1af0b6f033 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/config.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/jiffies.h> 13#include <linux/jiffies.h>
15#include <linux/string.h> 14#include <linux/string.h>
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
index e60b2d8103b8..438db483035d 100644
--- a/drivers/s390/cio/device_id.c
+++ b/drivers/s390/cio/device_id.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15 14
16#include <asm/ccwdev.h> 15#include <asm/ccwdev.h>
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index b266ad8e14ff..a60124264bee 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -6,7 +6,6 @@
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7 * Cornelia Huck (cornelia.huck@de.ibm.com) 7 * Cornelia Huck (cornelia.huck@de.ibm.com)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/init.h> 10#include <linux/init.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
index 85b1020a1fcc..54cb64ed0786 100644
--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -9,7 +9,6 @@
9 * Path Group ID functions. 9 * Path Group ID functions.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15 14
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
index 6c762b43f921..14bef2c179bf 100644
--- a/drivers/s390/cio/device_status.c
+++ b/drivers/s390/cio/device_status.c
@@ -9,7 +9,6 @@
9 * Status accumulation and basic sense functions. 9 * Status accumulation and basic sense functions.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15 14
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 96f519281d92..b70039af70d6 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -30,7 +30,6 @@
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 */ 31 */
32 32
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/init.h> 34#include <linux/init.h>
36 35
diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c
index 7145e2134cf0..2c1db8036b7c 100644
--- a/drivers/s390/net/fsm.c
+++ b/drivers/s390/net/fsm.c
@@ -4,7 +4,6 @@
4 */ 4 */
5 5
6#include "fsm.h" 6#include "fsm.h"
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/timer.h> 8#include <linux/timer.h>
10 9
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index e0c7deb98831..189a49275433 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -33,7 +33,6 @@
33 33
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
36#include <linux/config.h>
37 36
38#include <linux/spinlock.h> 37#include <linux/spinlock.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 38aad8321456..8491598f9149 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -8,7 +8,6 @@
8 * Author(s): Thomas Spatzier <tspat@de.ibm.com> 8 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
9 * 9 *
10 */ 10 */
11#include <linux/config.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
13#include <linux/ip.h> 12#include <linux/ip.h>
14#include <linux/inetdevice.h> 13#include <linux/inetdevice.h>
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 56009d768326..36733b9823c6 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -27,7 +27,6 @@
27 */ 27 */
28 28
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
33#include <linux/string.h> 32#include <linux/string.h>
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
index 8dc75002acbe..432136f96e64 100644
--- a/drivers/s390/s390mach.c
+++ b/drivers/s390/s390mach.c
@@ -8,7 +8,6 @@
8 * Martin Schwidefsky (schwidefsky@de.ibm.com) 8 * Martin Schwidefsky (schwidefsky@de.ibm.com)
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c
index 66da840c9316..d1c1e75bfd60 100644
--- a/drivers/s390/sysinfo.c
+++ b/drivers/s390/sysinfo.c
@@ -5,7 +5,6 @@
5 * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) 5 * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com)
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11#include <linux/proc_fs.h> 10#include <linux/proc_fs.h>
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index cf97e9efe9b6..063e676a3ac0 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -22,7 +22,6 @@
22#define __KERNEL_SYSCALLS__ 22#define __KERNEL_SYSCALLS__
23static int errno; 23static int errno;
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/sched.h> 26#include <linux/sched.h>
28#include <linux/kthread.h> 27#include <linux/kthread.h>
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 31b8a5f6116f..fa2418f7ad39 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -4,7 +4,6 @@
4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index d7e4bb41bd79..293bb2fdb1d5 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -29,7 +29,6 @@
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/sched.h> 34#include <linux/sched.h>
diff --git a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c
index 378a1d68024d..57e1526746a2 100644
--- a/drivers/sbus/dvma.c
+++ b/drivers/sbus/dvma.c
@@ -3,7 +3,6 @@
3 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
4 */ 4 */
5 5
6#include <linux/config.h>
7#include <linux/string.h> 6#include <linux/string.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/slab.h> 8#include <linux/slab.h>
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 387a6aa8c020..16b59773c0bb 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -5,7 +5,6 @@
5 5
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/slab.h> 7#include <linux/slab.h>
8#include <linux/config.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include <linux/pci.h> 9#include <linux/pci.h>
11 10
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 3c683dc23541..eb7a6a4ded75 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -114,7 +114,6 @@
114 * */ 114 * */
115#define NCR_700_VERSION "2.8" 115#define NCR_700_VERSION "2.8"
116 116
117#include <linux/config.h>
118#include <linux/kernel.h> 117#include <linux/kernel.h>
119#include <linux/types.h> 118#include <linux/types.h>
120#include <linux/string.h> 119#include <linux/string.h>
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 765769a629e4..c9bd0335995d 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -232,7 +232,6 @@
232 232
233#include <linux/module.h> 233#include <linux/module.h>
234 234
235#include <linux/config.h>
236 235
237#include <linux/types.h> 236#include <linux/types.h>
238#include <asm/setup.h> 237#include <asm/setup.h>
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index bde3d5834ade..259b47ec4f54 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -29,7 +29,6 @@
29#define BusLogic_DriverVersion "2.1.16" 29#define BusLogic_DriverVersion "2.1.16"
30#define BusLogic_DriverDate "18 July 2002" 30#define BusLogic_DriverDate "18 July 2002"
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/init.h> 33#include <linux/init.h>
35#include <linux/interrupt.h> 34#include <linux/interrupt.h>
diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h
index 1aaa6569edac..9792e5af5252 100644
--- a/drivers/scsi/BusLogic.h
+++ b/drivers/scsi/BusLogic.h
@@ -28,7 +28,6 @@
28#ifndef _BUSLOGIC_H 28#ifndef _BUSLOGIC_H
29#define _BUSLOGIC_H 29#define _BUSLOGIC_H
30 30
31#include <linux/config.h>
32 31
33#ifndef PACKED 32#ifndef PACKED
34#define PACKED __attribute__((packed)) 33#define PACKED __attribute__((packed))
diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index 8e3d949b7118..7c0068049586 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -15,7 +15,6 @@
15 15
16*/ 16*/
17 17
18#include <linux/config.h>
19 18
20#ifndef CONFIG_SCSI_OMIT_FLASHPOINT 19#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
21 20
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index c7dd0154d012..8a4659e94105 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -23,7 +23,6 @@
23 23
24#include <linux/module.h> 24#include <linux/module.h>
25 25
26#include <linux/config.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
29#include <linux/types.h> 28#include <linux/types.h>
diff --git a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h
index 65a9b377a410..481653c977cf 100644
--- a/drivers/scsi/NCR53C9x.h
+++ b/drivers/scsi/NCR53C9x.h
@@ -13,7 +13,6 @@
13#ifndef NCR53C9X_H 13#ifndef NCR53C9X_H
14#define NCR53C9X_H 14#define NCR53C9X_H
15 15
16#include <linux/config.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
18 17
19/* djweis for mac driver */ 18/* djweis for mac driver */
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index dd9fb3d91000..537136457ea0 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -754,7 +754,6 @@
754 * --- Linux Include Files 754 * --- Linux Include Files
755 */ 755 */
756 756
757#include <linux/config.h>
758#include <linux/module.h> 757#include <linux/module.h>
759 758
760#if defined(CONFIG_X86) && !defined(CONFIG_ISA) 759#if defined(CONFIG_X86) && !defined(CONFIG_ISA)
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 86c6bd234591..24f0f5461792 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -25,7 +25,6 @@
25 * Added proper detection of the AHA-1640 (MCA version of AHA-1540) 25 * Added proper detection of the AHA-1640 (MCA version of AHA-1540)
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 2b8331649eeb..92c6154575e7 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -42,7 +42,6 @@
42#ifndef _AIC79XX_LINUX_H_ 42#ifndef _AIC79XX_LINUX_H_
43#define _AIC79XX_LINUX_H_ 43#define _AIC79XX_LINUX_H_
44 44
45#include <linux/config.h>
46#include <linux/types.h> 45#include <linux/types.h>
47#include <linux/blkdev.h> 46#include <linux/blkdev.h>
48#include <linux/delay.h> 47#include <linux/delay.h>
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index a20b08c9ff15..d42a71ee076d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -59,7 +59,6 @@
59#ifndef _AIC7XXX_LINUX_H_ 59#ifndef _AIC7XXX_LINUX_H_
60#define _AIC7XXX_LINUX_H_ 60#define _AIC7XXX_LINUX_H_
61 61
62#include <linux/config.h>
63#include <linux/types.h> 62#include <linux/types.h>
64#include <linux/blkdev.h> 63#include <linux/blkdev.h>
65#include <linux/delay.h> 64#include <linux/delay.h>
diff --git a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
index 3bf334931a8a..b07e4f04fd00 100644
--- a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
+++ b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
@@ -29,7 +29,6 @@
29 * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $ 29 * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $
30 *-M*************************************************************************/ 30 *-M*************************************************************************/
31 31
32#include <linux/config.h>
33 32
34#define BLS (&aic7xxx_buffer[size]) 33#define BLS (&aic7xxx_buffer[size])
35#define HDRB \ 34#define HDRB \
diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c
index c0844fa32c5d..9099d531d5a4 100644
--- a/drivers/scsi/amiga7xx.c
+++ b/drivers/scsi/amiga7xx.c
@@ -11,7 +11,6 @@
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/config.h>
15#include <linux/zorro.h> 14#include <linux/zorro.h>
16#include <linux/stat.h> 15#include <linux/stat.h>
17 16
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index dda5a5f79c53..1b9900b58956 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -129,7 +129,6 @@
129#define STRx(x) STRINGIFY(x) 129#define STRx(x) STRINGIFY(x)
130#define NO_WRITE_STR STRx(NO_WRITE) 130#define NO_WRITE_STR STRx(NO_WRITE)
131 131
132#include <linux/config.h>
133#include <linux/module.h> 132#include <linux/module.h>
134#include <linux/kernel.h> 133#include <linux/kernel.h>
135#include <linux/sched.h> 134#include <linux/sched.h>
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 57295bcea3e7..007a14e5c3fd 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -524,7 +524,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
524 } 524 }
525} 525}
526 526
527#include <linux/config.h>
528#include <linux/delay.h> 527#include <linux/delay.h>
529 528
530#if NDEBUG 529#if NDEBUG
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index f677c5a32a68..e1be4a4387cd 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -65,7 +65,6 @@
65 65
66 66
67 67
68#include <linux/config.h>
69#include <linux/module.h> 68#include <linux/module.h>
70 69
71#define NDEBUG (0) 70#define NDEBUG (0)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index d9abd1645d15..f6caa4307768 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -7,7 +7,6 @@
7 7
8#define VERSION "0.25" 8#define VERSION "0.25"
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index d92d5040a9fe..dddd2acce76f 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -7,7 +7,6 @@
7 * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025 7 * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/blkdev.h> 10#include <linux/blkdev.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
diff --git a/drivers/scsi/dpt/dpti_i2o.h b/drivers/scsi/dpt/dpti_i2o.h
index a9585f5235d9..d84a281ad944 100644
--- a/drivers/scsi/dpt/dpti_i2o.h
+++ b/drivers/scsi/dpt/dpti_i2o.h
@@ -23,7 +23,6 @@
23 23
24#include <asm/semaphore.h> /* Needed for MUTEX init macros */ 24#include <asm/semaphore.h> /* Needed for MUTEX init macros */
25#include <linux/version.h> 25#include <linux/version.h>
26#include <linux/config.h>
27#include <linux/notifier.h> 26#include <linux/notifier.h>
28#include <asm/atomic.h> 27#include <asm/atomic.h>
29 28
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 059eeee4b554..67c419402d8a 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -477,7 +477,6 @@
477 * the driver sets host->wish_block = 1 for all ISA boards. 477 * the driver sets host->wish_block = 1 for all ISA boards.
478 */ 478 */
479 479
480#include <linux/config.h>
481#include <linux/string.h> 480#include <linux/string.h>
482#include <linux/kernel.h> 481#include <linux/kernel.h>
483#include <linux/ioport.h> 482#include <linux/ioport.h>
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
index 23beb48c79c5..d8c9ec21e0ef 100644
--- a/drivers/scsi/eata_pio.c
+++ b/drivers/scsi/eata_pio.c
@@ -46,7 +46,6 @@
46 * last change: 2002/11/02 OS: Linux 2.5.45 * 46 * last change: 2002/11/02 OS: Linux 2.5.45 *
47 ************************************************************/ 47 ************************************************************/
48 48
49#include <linux/config.h>
50#include <linux/module.h> 49#include <linux/module.h>
51#include <linux/kernel.h> 50#include <linux/kernel.h>
52#include <linux/sched.h> 51#include <linux/sched.h>
diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c
index ddb512463b45..36c50b61f94d 100644
--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -12,7 +12,6 @@
12 * 3) Add tagged queueing. 12 * 3) Add tagged queueing.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
index 03416548f20c..7f891023aa15 100644
--- a/drivers/scsi/fcal.c
+++ b/drivers/scsi/fcal.c
@@ -13,7 +13,6 @@
13#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
14#include <linux/stat.h> 14#include <linux/stat.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/config.h>
17#ifdef CONFIG_KMOD 16#ifdef CONFIG_KMOD
18#include <linux/kmod.h> 17#include <linux/kmod.h>
19#endif 18#endif
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index e16013f0ad6e..03356887202d 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -266,7 +266,6 @@
266 266
267 **************************************************************************/ 267 **************************************************************************/
268 268
269#include <linux/config.h>
270#include <linux/module.h> 269#include <linux/module.h>
271#include <linux/init.h> 270#include <linux/init.h>
272#include <linux/interrupt.h> 271#include <linux/interrupt.h>
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 5f313c93b7a9..fbc8e16c8d15 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -91,7 +91,6 @@
91#define AUTOPROBE_IRQ 91#define AUTOPROBE_IRQ
92#define AUTOSENSE 92#define AUTOSENSE
93 93
94#include <linux/config.h>
95 94
96#ifdef CONFIG_SCSI_GENERIC_NCR53C400 95#ifdef CONFIG_SCSI_GENERIC_NCR53C400
97#define NCR53C400_PSEUDO_DMA 1 96#define NCR53C400_PSEUDO_DMA 1
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index d60a89cb8052..df0b3f69ef63 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -32,7 +32,6 @@
32#ifndef GENERIC_NCR5380_H 32#ifndef GENERIC_NCR5380_H
33#define GENERIC_NCR5380_H 33#define GENERIC_NCR5380_H
34 34
35#include <linux/config.h>
36 35
37#define GENERIC_NCR5380_PUBLIC_RELEASE 1 36#define GENERIC_NCR5380_PUBLIC_RELEASE 1
38 37
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 497f6642b2dc..1cbc94842cc6 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -17,7 +17,6 @@
17 17
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/types.h> 22#include <linux/types.h>
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 988e6f7af01a..f7b5d7372d26 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -34,7 +34,6 @@
34#define IDESCSI_VERSION "0.92" 34#define IDESCSI_VERSION "0.92"
35 35
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/config.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/string.h> 38#include <linux/string.h>
40#include <linux/kernel.h> 39#include <linux/kernel.h>
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 681bd18493f3..2d95ac9c32c1 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -8,7 +8,6 @@
8 * future expansion to five letters. 8 * future expansion to five letters.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/module.h> 13#include <linux/module.h>
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 913ba95f85bd..43acb1fe90b4 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -118,7 +118,6 @@
118#include <linux/blkdev.h> 118#include <linux/blkdev.h>
119#include <linux/spinlock.h> 119#include <linux/spinlock.h>
120#include <linux/stat.h> 120#include <linux/stat.h>
121#include <linux/config.h>
122#include <linux/kernel.h> 121#include <linux/kernel.h>
123#include <linux/proc_fs.h> 122#include <linux/proc_fs.h>
124#include <linux/string.h> 123#include <linux/string.h>
diff --git a/drivers/scsi/initio.h b/drivers/scsi/initio.h
index 3efb1184fc39..acb67a4af2cc 100644
--- a/drivers/scsi/initio.h
+++ b/drivers/scsi/initio.h
@@ -54,7 +54,6 @@
54 **************************************************************************/ 54 **************************************************************************/
55 55
56 56
57#include <linux/config.h>
58#include <linux/types.h> 57#include <linux/types.h>
59 58
60#define ULONG unsigned long 59#define ULONG unsigned long
@@ -193,13 +192,13 @@ typedef struct {
193#define TSC_SEL_ATN_DIRECT_OUT 0x15 /* Select With ATN Sequence */ 192#define TSC_SEL_ATN_DIRECT_OUT 0x15 /* Select With ATN Sequence */
194#define TSC_SEL_ATN3_DIRECT_IN 0xB5 /* Select With ATN3 Sequence */ 193#define TSC_SEL_ATN3_DIRECT_IN 0xB5 /* Select With ATN3 Sequence */
195#define TSC_SEL_ATN3_DIRECT_OUT 0x35 /* Select With ATN3 Sequence */ 194#define TSC_SEL_ATN3_DIRECT_OUT 0x35 /* Select With ATN3 Sequence */
196#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Infomation out */ 195#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Information out */
197#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Infomation in */ 196#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Information in */
198 197
199#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Infomation out */ 198#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Information out */
200#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Infomation in */ 199#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Information in */
201#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Infomation out */ 200#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Information out */
202#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Infomation in */ 201#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Information in */
203 202
204#define TSC_MSG_ACCEPT 0x0F /* Message Accept */ 203#define TSC_MSG_ACCEPT 0x0F /* Message Accept */
205 204
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 96b65b307dd0..e19bf690cdf1 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -54,7 +54,6 @@
54 * 54 *
55 */ 55 */
56 56
57#include <linux/config.h>
58#include <linux/fs.h> 57#include <linux/fs.h>
59#include <linux/init.h> 58#include <linux/init.h>
60#include <linux/types.h> 59#include <linux/types.h>
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 78f2ff736c3e..7436793c3ad3 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -196,7 +196,6 @@
196#include <linux/module.h> 196#include <linux/module.h>
197 197
198#include <linux/stat.h> 198#include <linux/stat.h>
199#include <linux/config.h>
200 199
201#include <linux/spinlock.h> 200#include <linux/spinlock.h>
202#include <linux/init.h> 201#include <linux/init.h>
diff --git a/drivers/scsi/libata-bmdma.c b/drivers/scsi/libata-bmdma.c
index 004e1a0d8b71..38bfebf4fe8f 100644
--- a/drivers/scsi/libata-bmdma.c
+++ b/drivers/scsi/libata-bmdma.c
@@ -32,7 +32,6 @@
32 * 32 *
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/pci.h> 36#include <linux/pci.h>
38#include <linux/libata.h> 37#include <linux/libata.h>
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index d1c1c30d123f..82caba464291 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -32,7 +32,6 @@
32 * 32 *
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index f852421002ef..c88717727be8 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -18,7 +18,6 @@
18 * - retry arbitration if lost (unless higher levels do this for us) 18 * - retry arbitration if lost (unless higher levels do this for us)
19 * - power down the chip when no device is detected 19 * - power down the chip when no device is detected
20 */ 20 */
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
diff --git a/drivers/scsi/ncr53c8xx.h b/drivers/scsi/ncr53c8xx.h
index 0e4e46a01336..78818b6684f8 100644
--- a/drivers/scsi/ncr53c8xx.h
+++ b/drivers/scsi/ncr53c8xx.h
@@ -53,10 +53,8 @@
53#ifndef NCR53C8XX_H 53#ifndef NCR53C8XX_H
54#define NCR53C8XX_H 54#define NCR53C8XX_H
55 55
56#include <linux/config.h>
57#include <scsi/scsi_host.h> 56#include <scsi/scsi_host.h>
58 57
59#include <linux/config.h>
60 58
61/* 59/*
62** If you want a driver as small as possible, donnot define the 60** If you want a driver as small as possible, donnot define the
diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index dee426f8c07b..d7a0bcc6c670 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -6,7 +6,6 @@
6 * Based on cyber_esp.c 6 * Based on cyber_esp.c
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#if defined(CONFIG_AMIGA) || defined(CONFIG_APUS) 10#if defined(CONFIG_AMIGA) || defined(CONFIG_APUS)
12#define USE_BOTTOM_HALF 11#define USE_BOTTOM_HALF
diff --git a/drivers/scsi/oktagon_io.S b/drivers/scsi/oktagon_io.S
index 08ce8d80d8f5..8a7340b02707 100644
--- a/drivers/scsi/oktagon_io.S
+++ b/drivers/scsi/oktagon_io.S
@@ -23,7 +23,6 @@ int oktag_from_io(long *addr,long *paddr,long len)
23 * is moved to/from the IO register. 23 * is moved to/from the IO register.
24 */ 24 */
25 25
26#include <linux/config.h>
27 26
28#ifdef CONFIG_APUS 27#ifdef CONFIG_APUS
29 28
diff --git a/drivers/scsi/osst.h b/drivers/scsi/osst.h
index 011d4d6ca9f9..1e426f5d0ed8 100644
--- a/drivers/scsi/osst.h
+++ b/drivers/scsi/osst.h
@@ -3,7 +3,6 @@
3 */ 3 */
4 4
5#include <asm/byteorder.h> 5#include <asm/byteorder.h>
6#include <linux/config.h>
7#include <linux/completion.h> 6#include <linux/completion.h>
8 7
9/* FIXME - rename and use the following two types or delete them! 8/* FIXME - rename and use the following two types or delete them!
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index 83a671799934..7abf64d1bfc9 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -13,7 +13,6 @@
13#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
14#include <linux/stat.h> 14#include <linux/stat.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/config.h>
17#ifdef CONFIG_KMOD 16#ifdef CONFIG_KMOD
18#include <linux/kmod.h> 17#include <linux/kmod.h>
19#endif 18#endif
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index d58ac5ad509d..b0eba39f208a 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/module.h> 13#include <linux/module.h>
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 680f6063954b..a7e4183462b8 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -331,7 +331,6 @@
331*****************************************************************************/ 331*****************************************************************************/
332 332
333 333
334#include <linux/config.h>
335#include <linux/module.h> 334#include <linux/module.h>
336 335
337#include <linux/version.h> 336#include <linux/version.h>
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index d6f6579cfd27..6734453ea28a 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2134,7 +2134,7 @@ typedef struct scsi_qla_host {
2134 mempool_t *srb_mempool; 2134 mempool_t *srb_mempool;
2135 2135
2136 /* This spinlock is used to protect "io transactions", you must 2136 /* This spinlock is used to protect "io transactions", you must
2137 * aquire it before doing any IO to the card, eg with RD_REG*() and 2137 * acquire it before doing any IO to the card, eg with RD_REG*() and
2138 * WRT_REG*() for the duration of your entire commandtransaction. 2138 * WRT_REG*() for the duration of your entire commandtransaction.
2139 * 2139 *
2140 * This spinlock is of lower priority than the io request lock. 2140 * This spinlock is of lower priority than the io request lock.
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 5cc42c6054eb..56da25581f31 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -31,7 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/pci.h> 36#include <linux/pci.h>
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 809d337ed641..ee6b5df41d30 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -30,7 +30,6 @@
30 * 30 *
31 */ 31 */
32 32
33#include <linux/config.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/pci.h> 35#include <linux/pci.h>
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 7566c2cabaf7..a958b45e597c 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -36,7 +36,6 @@
36 * 36 *
37 */ 37 */
38 38
39#include <linux/config.h>
40#include <linux/kernel.h> 39#include <linux/kernel.h>
41#include <linux/module.h> 40#include <linux/module.h>
42#include <linux/pci.h> 41#include <linux/pci.h>
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c
index 64f3c1aeed21..33cdb4867ef1 100644
--- a/drivers/scsi/sata_uli.c
+++ b/drivers/scsi/sata_uli.c
@@ -24,7 +24,6 @@
24 * 24 *
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/pci.h> 29#include <linux/pci.h>
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 5a5d2af8ee43..e1168860045c 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -24,7 +24,6 @@
24 * module options to "modprobe scsi_debug num_tgts=2" [20021221] 24 * module options to "modprobe scsi_debug num_tgts=2" [20021221]
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/kernel.h> 29#include <linux/kernel.h>
diff --git a/drivers/scsi/scsi_logging.h b/drivers/scsi/scsi_logging.h
index a3e2af6a846c..1f65139e14f8 100644
--- a/drivers/scsi/scsi_logging.h
+++ b/drivers/scsi/scsi_logging.h
@@ -1,7 +1,6 @@
1#ifndef _SCSI_LOGGING_H 1#ifndef _SCSI_LOGGING_H
2#define _SCSI_LOGGING_H 2#define _SCSI_LOGGING_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * This defines the scsi logging feature. It is a means by which the user 6 * This defines the scsi logging feature. It is a means by which the user
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index a1727a0e1bdd..015c90cf3abc 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -1,7 +1,6 @@
1#ifndef _SCSI_PRIV_H 1#ifndef _SCSI_PRIV_H
2#define _SCSI_PRIV_H 2#define _SCSI_PRIV_H
3 3
4#include <linux/config.h>
5#include <linux/device.h> 4#include <linux/device.h>
6 5
7struct request_queue; 6struct request_queue;
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0f7e6f94d66b..1341608e9e3b 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -25,7 +25,6 @@
25 * or a LUN is seen that cannot have a device attached to it. 25 * or a LUN is seen that cannot have a device attached to it.
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
31#include <linux/init.h> 30#include <linux/init.h>
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 5ec7a4fb0145..e7fe565b96de 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -6,7 +6,6 @@
6 * Created to pull SCSI mid layer sysfs routines into one file. 6 * Created to pull SCSI mid layer sysfs routines into one file.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/init.h> 10#include <linux/init.h>
12#include <linux/blkdev.h> 11#include <linux/blkdev.h>
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index ace49d5bd9c4..29a9a53cdd1a 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -18,7 +18,6 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#include <linux/config.h>
22#include <linux/ctype.h> 21#include <linux/ctype.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/module.h> 23#include <linux/module.h>
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 354199011246..ea38757d12e5 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -32,7 +32,6 @@
32 * than the level indicated above to trigger output. 32 * than the level indicated above to trigger output.
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/fs.h> 36#include <linux/fs.h>
38#include <linux/kernel.h> 37#include <linux/kernel.h>
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 98b9312ba8da..4e607d3065bc 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -28,7 +28,6 @@ static int sg_version_num = 30533; /* 2 digits for each component */
28 * (otherwise the macros compile to empty statements). 28 * (otherwise the macros compile to empty statements).
29 * 29 *
30 */ 30 */
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33 32
34#include <linux/fs.h> 33#include <linux/fs.h>
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 255886a9ac55..2b2789345c13 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31 30
32#include <linux/blkdev.h> 31#include <linux/blkdev.h>
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c
index 9dde8df2f5c9..a3e9d0f2eb5b 100644
--- a/drivers/scsi/sr_vendor.c
+++ b/drivers/scsi/sr_vendor.c
@@ -34,7 +34,6 @@
34 * HP 6020 writers now supported. 34 * HP 6020 writers now supported.
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/cdrom.h> 37#include <linux/cdrom.h>
39#include <linux/errno.h> 38#include <linux/errno.h>
40#include <linux/string.h> 39#include <linux/string.h>
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 25cced91c8a6..2ebe0d663899 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -535,7 +535,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
535 535
536} 536}
537 537
538#include <linux/config.h>
539#include <linux/delay.h> 538#include <linux/delay.h>
540 539
541#if 1 540#if 1
diff --git a/drivers/scsi/sym53c8xx_2/sym53c8xx.h b/drivers/scsi/sym53c8xx_2/sym53c8xx.h
index 481103769729..7519728dfc38 100644
--- a/drivers/scsi/sym53c8xx_2/sym53c8xx.h
+++ b/drivers/scsi/sym53c8xx_2/sym53c8xx.h
@@ -40,7 +40,6 @@
40#ifndef SYM53C8XX_H 40#ifndef SYM53C8XX_H
41#define SYM53C8XX_H 41#define SYM53C8XX_H
42 42
43#include <linux/config.h>
44 43
45/* 44/*
46 * DMA addressing mode. 45 * DMA addressing mode.
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h
index a446cda3f64c..e022d3c71b59 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.h
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.h
@@ -40,7 +40,6 @@
40#ifndef SYM_GLUE_H 40#ifndef SYM_GLUE_H
41#define SYM_GLUE_H 41#define SYM_GLUE_H
42 42
43#include <linux/config.h>
44#include <linux/delay.h> 43#include <linux/delay.h>
45#include <linux/ioport.h> 44#include <linux/ioport.h>
46#include <linux/pci.h> 45#include <linux/pci.h>
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index 91322aff241d..7540f6a7529f 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -218,7 +218,6 @@
218#endif 218#endif
219#define DCBDEBUG1(x) C_NOP 219#define DCBDEBUG1(x) C_NOP
220 220
221#include <linux/config.h>
222#include <linux/module.h> 221#include <linux/module.h>
223#include <linux/delay.h> 222#include <linux/delay.h>
224#include <linux/signal.h> 223#include <linux/signal.h>
diff --git a/drivers/scsi/tmscsim.h b/drivers/scsi/tmscsim.h
index d4495272fb40..9b66fa8d38d9 100644
--- a/drivers/scsi/tmscsim.h
+++ b/drivers/scsi/tmscsim.h
@@ -9,7 +9,6 @@
9#define _TMSCSIM_H 9#define _TMSCSIM_H
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/config.h>
13 12
14#define SCSI_IRQ_NONE 255 13#define SCSI_IRQ_NONE 255
15 14
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 33cd90fc657b..35c043e38ed4 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -405,7 +405,6 @@
405 * the driver sets host->wish_block = TRUE for all ISA boards. 405 * the driver sets host->wish_block = TRUE for all ISA boards.
406 */ 406 */
407 407
408#include <linux/config.h>
409#include <linux/string.h> 408#include <linux/string.h>
410#include <linux/kernel.h> 409#include <linux/kernel.h>
411#include <linux/ioport.h> 410#include <linux/ioport.h>
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index 27307fe5a4c8..680f38ab60d8 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -71,7 +71,6 @@
71 * Richard Hirst <richard@sleepie.demon.co.uk> August 2000 71 * Richard Hirst <richard@sleepie.demon.co.uk> August 2000
72 */ 72 */
73 73
74#include <linux/config.h>
75#include <linux/module.h> 74#include <linux/module.h>
76 75
77#include <linux/sched.h> 76#include <linux/sched.h>
diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h
index 193ec517d252..edcb0365cf0c 100644
--- a/drivers/scsi/wd33c93.h
+++ b/drivers/scsi/wd33c93.h
@@ -22,7 +22,6 @@
22#ifndef WD33C93_H 22#ifndef WD33C93_H
23#define WD33C93_H 23#define WD33C93_H
24 24
25#include <linux/config.h>
26 25
27#define PROC_INTERFACE /* add code for /proc/scsi/wd33c93/xxx interface */ 26#define PROC_INTERFACE /* add code for /proc/scsi/wd33c93/xxx interface */
28#ifdef PROC_INTERFACE 27#ifdef PROC_INTERFACE
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c
index 9fd0de4b7afd..57438326b07f 100644
--- a/drivers/serial/21285.c
+++ b/drivers/serial/21285.c
@@ -7,7 +7,6 @@
7 * 7 *
8 * $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $ 8 * $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $
9 */ 9 */
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/tty.h> 11#include <linux/tty.h>
13#include <linux/ioport.h> 12#include <linux/ioport.h>
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index bff94541991c..993a702422ec 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -23,7 +23,6 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/tty.h> 24#include <linux/tty.h>
25#include <linux/tty_flip.h> 25#include <linux/tty_flip.h>
26#include <linux/config.h>
27#include <linux/major.h> 26#include <linux/major.h>
28#include <linux/string.h> 27#include <linux/string.h>
29#include <linux/fcntl.h> 28#include <linux/fcntl.h>
diff --git a/drivers/serial/68328serial.h b/drivers/serial/68328serial.h
index 978f8a609f3d..58aa2154655b 100644
--- a/drivers/serial/68328serial.h
+++ b/drivers/serial/68328serial.h
@@ -11,7 +11,6 @@
11#ifndef _MC683XX_SERIAL_H 11#ifndef _MC683XX_SERIAL_H
12#define _MC683XX_SERIAL_H 12#define _MC683XX_SERIAL_H
13 13
14#include <linux/config.h>
15 14
16struct serial_struct { 15struct serial_struct {
17 int type; 16 int type;
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 9843ae3d420e..e80e70e9b126 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -20,7 +20,6 @@
20 * int rs_360_init(void); 20 * int rs_360_init(void);
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/signal.h> 25#include <linux/signal.h>
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index f361b356bd1d..9c5d36f50140 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -19,7 +19,6 @@
19 * mapbase is the physical address of the IO port. 19 * mapbase is the physical address of the IO port.
20 * membase is an 'ioremapped' cookie. 20 * membase is an 'ioremapped' cookie.
21 */ 21 */
22#include <linux/config.h>
23 22
24#if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 23#if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
25#define SUPPORT_SYSRQ 24#define SUPPORT_SYSRQ
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h
index 490606b87095..91bd28f2bb47 100644
--- a/drivers/serial/8250.h
+++ b/drivers/serial/8250.h
@@ -15,7 +15,6 @@
15 * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $ 15 * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/serial_8250.h> 18#include <linux/serial_8250.h>
20 19
21struct old_serial_port { 20struct old_serial_port {
diff --git a/drivers/serial/8250_mca.c b/drivers/serial/8250_mca.c
index ac205256d5f3..d10be944ad44 100644
--- a/drivers/serial/8250_mca.c
+++ b/drivers/serial/8250_mca.c
@@ -8,7 +8,6 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/mca.h> 13#include <linux/mca.h>
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index e920d196d0b1..7311d8487c96 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -31,7 +31,6 @@
31 * required, these have to be supplied via some other means (eg, GPIO) 31 * required, these have to be supplied via some other means (eg, GPIO)
32 * and hooked into this driver. 32 * and hooked into this driver.
33 */ 33 */
34#include <linux/config.h>
35 34
36#if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 35#if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
37#define SUPPORT_SYSRQ 36#define SUPPORT_SYSRQ
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 3d966cfc9a38..a8d7124e84a1 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -31,7 +31,6 @@
31 * required, these have to be supplied via some other means (eg, GPIO) 31 * required, these have to be supplied via some other means (eg, GPIO)
32 * and hooked into this driver. 32 * and hooked into this driver.
33 */ 33 */
34#include <linux/config.h>
35 34
36#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 35#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
37#define SUPPORT_SYSRQ 36#define SUPPORT_SYSRQ
diff --git a/drivers/serial/at91_serial.c b/drivers/serial/at91_serial.c
index df9500bdaded..7b3b3f3d5101 100644
--- a/drivers/serial/at91_serial.c
+++ b/drivers/serial/at91_serial.c
@@ -22,7 +22,6 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 23 *
24 */ 24 */
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/tty.h> 26#include <linux/tty.h>
28#include <linux/ioport.h> 27#include <linux/ioport.h>
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index 2691112c84ad..f27d852ce50d 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -25,7 +25,6 @@
25 * $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $ 25 * $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $
26 * 26 *
27 */ 27 */
28#include <linux/config.h>
29 28
30#if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 29#if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
31#define SUPPORT_SYSRQ 30#define SUPPORT_SYSRQ
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 5cba59ad7dc5..90ff96e3339b 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -31,7 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/tty.h> 35#include <linux/tty.h>
37#include <linux/ioport.h> 36#include <linux/ioport.h>
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 17406a05ce1f..95afc37297a8 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/tty.h> 31#include <linux/tty.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index cdba128250a9..ef3bb476c432 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/tty.h> 31#include <linux/tty.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index b84137cdeb2b..901be3483455 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -425,7 +425,6 @@
425 425
426static char *serial_version = "$Revision: 1.25 $"; 426static char *serial_version = "$Revision: 1.25 $";
427 427
428#include <linux/config.h>
429#include <linux/types.h> 428#include <linux/types.h>
430#include <linux/errno.h> 429#include <linux/errno.h>
431#include <linux/signal.h> 430#include <linux/signal.h>
diff --git a/drivers/serial/crisv10.h b/drivers/serial/crisv10.h
index 1800c0e7531a..f30b93d6ef79 100644
--- a/drivers/serial/crisv10.h
+++ b/drivers/serial/crisv10.h
@@ -7,7 +7,6 @@
7#ifndef _ETRAX_SERIAL_H 7#ifndef _ETRAX_SERIAL_H
8#define _ETRAX_SERIAL_H 8#define _ETRAX_SERIAL_H
9 9
10#include <linux/config.h>
11#include <linux/circ_buf.h> 10#include <linux/circ_buf.h>
12#include <asm/termios.h> 11#include <asm/termios.h>
13 12
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index 466d06cc7d37..ecf824bd2d4e 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -26,7 +26,6 @@
26 26
27#undef DEBUG_DZ 27#undef DEBUG_DZ
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/interrupt.h> 30#include <linux/interrupt.h>
32#include <linux/init.h> 31#include <linux/init.h>
diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c
index 144a7a352b28..ad1e753cbc53 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -24,7 +24,6 @@
24 */ 24 */
25#define SERIAL_DO_RESTART 25#define SERIAL_DO_RESTART
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
30#include <linux/signal.h> 29#include <linux/signal.h>
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index da85bafa0942..0b5f39d038b9 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -25,7 +25,6 @@
25 * [29-Mar-2005] Mike Lee 25 * [29-Mar-2005] Mike Lee
26 * Added hardware handshake 26 * Added hardware handshake
27 */ 27 */
28#include <linux/config.h>
29 28
30#if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 29#if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
31#define SUPPORT_SYSRQ 30#define SUPPORT_SYSRQ
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 56b093ecd779..342042889f6e 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -12,7 +12,6 @@
12 * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org) 12 * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org)
13 * Copyright (C) 2002 David S. Miller (davem@redhat.com) 13 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
14 */ 14 */
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index 6a2a25d9b596..fbaae96f4c93 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -25,7 +25,6 @@
25 * membase is an 'ioremapped' cookie. This is compatible with the old 25 * membase is an 'ioremapped' cookie. This is compatible with the old
26 * serial.c driver, and is currently the preferred form. 26 * serial.c driver, and is currently the preferred form.
27 */ 27 */
28#include <linux/config.h>
29 28
30#if defined(CONFIG_SERIAL_M32R_SIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 29#if defined(CONFIG_SERIAL_M32R_SIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
31#define SUPPORT_SYSRQ 30#define SUPPORT_SYSRQ
diff --git a/drivers/serial/m32r_sio.h b/drivers/serial/m32r_sio.h
index 7c3ec24f7e50..849f1b2c2531 100644
--- a/drivers/serial/m32r_sio.h
+++ b/drivers/serial/m32r_sio.h
@@ -15,7 +15,6 @@
15 * (at your option) any later version. 15 * (at your option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19 18
20struct m32r_sio_probe { 19struct m32r_sio_probe {
21 struct module *owner; 20 struct module *owner;
diff --git a/drivers/serial/m32r_sio_reg.h b/drivers/serial/m32r_sio_reg.h
index 9c864529451b..4671473793e3 100644
--- a/drivers/serial/m32r_sio_reg.h
+++ b/drivers/serial/m32r_sio_reg.h
@@ -15,7 +15,6 @@
15#ifndef _M32R_SIO_REG_H 15#ifndef _M32R_SIO_REG_H
16#define _M32R_SIO_REG_H 16#define _M32R_SIO_REG_H
17 17
18#include <linux/config.h>
19 18
20#ifdef CONFIG_SERIAL_M32R_PLDSIO 19#ifdef CONFIG_SERIAL_M32R_PLDSIO
21 20
diff --git a/drivers/serial/mcfserial.h b/drivers/serial/mcfserial.h
index a2b28e8629f9..56420e2cb110 100644
--- a/drivers/serial/mcfserial.h
+++ b/drivers/serial/mcfserial.h
@@ -14,7 +14,6 @@
14#ifndef _MCF_SERIAL_H 14#ifndef _MCF_SERIAL_H
15#define _MCF_SERIAL_H 15#define _MCF_SERIAL_H
16 16
17#include <linux/config.h>
18#include <linux/serial.h> 17#include <linux/serial.h>
19 18
20#ifdef __KERNEL__ 19#ifdef __KERNEL__
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 1aa34844218c..1b8e554f674f 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -44,7 +44,6 @@
44 * will be mapped to. 44 * will be mapped to.
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/platform_device.h> 47#include <linux/platform_device.h>
49#include <linux/module.h> 48#include <linux/module.h>
50#include <linux/tty.h> 49#include <linux/tty.h>
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 1cd102f84bfa..8c498f785e21 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -50,7 +50,6 @@
50 * 4) AFAICT, hardware flow control isn't supported by the controller --MAG. 50 * 4) AFAICT, hardware flow control isn't supported by the controller --MAG.
51 */ 51 */
52 52
53#include <linux/config.h>
54 53
55#if defined(CONFIG_SERIAL_MPSC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 54#if defined(CONFIG_SERIAL_MPSC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
56#define SUPPORT_SYSRQ 55#define SUPPORT_SYSRQ
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c
index 64c0e89124c9..4a1c9983f38f 100644
--- a/drivers/serial/mux.c
+++ b/drivers/serial/mux.c
@@ -16,7 +16,6 @@
16** 16**
17*/ 17*/
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/tty.h> 20#include <linux/tty.h>
22#include <linux/ioport.h> 21#include <linux/ioport.h>
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index e3ba7e17a240..4d9435451f4a 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -42,7 +42,6 @@
42#undef DEBUG_HARD 42#undef DEBUG_HARD
43#undef USE_CTRL_O_SYSRQ 43#undef USE_CTRL_O_SYSRQ
44 44
45#include <linux/config.h>
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/tty.h> 46#include <linux/tty.h>
48 47
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 0fa0ccc9ed27..a720953a404e 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -24,7 +24,6 @@
24 * with the serial core maintainer satisfaction to appear soon. 24 * with the serial core maintainer satisfaction to appear soon.
25 */ 25 */
26 26
27#include <linux/config.h>
28 27
29#if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 28#if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
30#define SUPPORT_SYSRQ 29#define SUPPORT_SYSRQ
@@ -390,7 +389,7 @@ static int serial_pxa_startup(struct uart_port *port)
390 389
391 /* 390 /*
392 * Finally, enable interrupts. Note: Modem status interrupts 391 * Finally, enable interrupts. Note: Modem status interrupts
393 * are set via set_termios(), which will be occuring imminently 392 * are set via set_termios(), which will be occurring imminently
394 * anyway, so we don't enable them here. 393 * anyway, so we don't enable them here.
395 */ 394 */
396 up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE; 395 up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE;
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 4c62ab949ecc..392bffcf96e8 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -55,7 +55,6 @@
55 * BJD, 04-Nov-2004 55 * BJD, 04-Nov-2004
56*/ 56*/
57 57
58#include <linux/config.h>
59 58
60#if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 59#if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
61#define SUPPORT_SYSRQ 60#define SUPPORT_SYSRQ
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index 8bbd8567669c..db3486d33870 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -24,7 +24,6 @@
24 * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $ 24 * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $
25 * 25 *
26 */ 26 */
27#include <linux/config.h>
28 27
29#if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 28#if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
30#define SUPPORT_SYSRQ 29#define SUPPORT_SYSRQ
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 7dc1e67b6851..c54af8774393 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -22,7 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/tty.h> 26#include <linux/tty.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 2c70773543e0..cbf260bc225d 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -786,6 +786,7 @@ static struct pcmcia_device_id serial_ids[] = {
786 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), 786 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"),
787 PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), 787 PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"),
788 PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"), 788 PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"),
789 PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"),
789 /* too generic */ 790 /* too generic */
790 /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */ 791 /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */
791 /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */ 792 /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index 776d4ff06084..23ddedbaec08 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31 30
32#if defined(CONFIG_SERIAL_LH7A40X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 31#if defined(CONFIG_SERIAL_LH7A40X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
33#define SUPPORT_SYSRQ 32#define SUPPORT_SYSRQ
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index a901a7e446f3..28c1881a6691 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -38,7 +38,6 @@
38 * Fix some spin_locks. 38 * Fix some spin_locks.
39 * Do not call uart_add_one_port for absent ports. 39 * Do not call uart_add_one_port for absent ports.
40 */ 40 */
41#include <linux/config.h>
42 41
43#if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 42#if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
44#define SUPPORT_SYSRQ 43#define SUPPORT_SYSRQ
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index d97f3ca6cc29..2509c3237e87 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -20,7 +20,6 @@
20 20
21#undef DEBUG 21#undef DEBUG
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/signal.h> 25#include <linux/signal.h>
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index 1f14bb4382f6..ab320fa3237c 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -10,7 +10,6 @@
10 * Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003). 10 * Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003).
11 * Modified to support H8/300 Series Yoshinori Sato (Feb 2004). 11 * Modified to support H8/300 Series Yoshinori Sato (Feb 2004).
12 */ 12 */
13#include <linux/config.h>
14#include <linux/serial_core.h> 13#include <linux/serial_core.h>
15 14
16#if defined(__H8300H__) || defined(__H8300S__) 15#if defined(__H8300H__) || defined(__H8300S__)
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 60ea4a3f0713..4b0afc8f12b9 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -37,7 +37,6 @@
37 * http://oss.sgi.com/projects/GenInfo/NoticeExplan 37 * http://oss.sgi.com/projects/GenInfo/NoticeExplan
38 */ 38 */
39 39
40#include <linux/config.h>
41#include <linux/interrupt.h> 40#include <linux/interrupt.h>
42#include <linux/tty.h> 41#include <linux/tty.h>
43#include <linux/serial.h> 42#include <linux/serial.h>
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index fa4ae94243c2..e35d9ab359f1 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -10,7 +10,6 @@
10 * Copyright (C) 2002 David S. Miller (davem@redhat.com) 10 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/console.h> 15#include <linux/console.h>
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 141fedbefbc4..20a48697727c 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -15,7 +15,6 @@
15 * David S. Miller <davem@davemloft.net> 15 * David S. Miller <davem@davemloft.net>
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 5442792c6c72..eabf477fee95 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -15,7 +15,6 @@
15 * David S. Miller (davem@davemloft.net), 2002-Jul-29 15 * David S. Miller (davem@davemloft.net), 2002-Jul-29
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 1caa286a6be6..9ee7f3af9ae2 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -12,7 +12,6 @@
12 * Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net) 12 * Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net)
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index 017571ffa19c..e93d0edc2e08 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -19,7 +19,6 @@
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22#include <linux/config.h>
23 22
24#if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 23#if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
25#define SUPPORT_SYSRQ 24#define SUPPORT_SYSRQ
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index ed946311d3a4..0040f10c9e39 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -7,7 +7,6 @@
7 * Pat Gefre <pfg@sgi.com> - IOC3 serial port IRQ demuxer 7 * Pat Gefre <pfg@sgi.com> - IOC3 serial port IRQ demuxer
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/pci.h> 12#include <linux/pci.h>
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index dd2f950b21a7..a23862ef72b2 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -16,7 +16,6 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/init.h> 19#include <linux/init.h>
21#include <linux/spinlock.h> 20#include <linux/spinlock.h>
22#include <linux/workqueue.h> 21#include <linux/workqueue.h>
diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c
index a006a1ee27ac..39d9b20f2038 100644
--- a/drivers/spi/spi_butterfly.c
+++ b/drivers/spi/spi_butterfly.c
@@ -17,7 +17,6 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20#include <linux/config.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/delay.h> 22#include <linux/delay.h>
diff --git a/drivers/tc/lk201.c b/drivers/tc/lk201.c
index cf10d5cdfb93..757dec9c7ee9 100644
--- a/drivers/tc/lk201.c
+++ b/drivers/tc/lk201.c
@@ -8,7 +8,6 @@
8 * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki 8 * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki
9 */ 9 */
10 10
11#include <linux/config.h>
12 11
13#include <linux/errno.h> 12#include <linux/errno.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 7f27b356eaf7..93bc90b8ff92 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -39,7 +39,6 @@
39 * is shared with DSRS(DTE) at pin 23. 39 * is shared with DSRS(DTE) at pin 23.
40 */ 40 */
41 41
42#include <linux/config.h>
43#include <linux/errno.h> 42#include <linux/errno.h>
44#include <linux/signal.h> 43#include <linux/signal.h>
45#include <linux/sched.h> 44#include <linux/sched.h>
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index ad742cec94fa..f4f4ef0f377a 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -5,7 +5,6 @@
5 * and should work with all USB controllers, regardles of bus type. 5 * and should work with all USB controllers, regardles of bus type.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/slab.h> 10#include <linux/slab.h>
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index a9d89c78cc20..4c9e63e665b6 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/usb.h> 1#include <linux/usb.h>
3#include <linux/module.h> 2#include <linux/module.h>
4#include <linux/init.h> 3#include <linux/init.h>
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index c196f3845305..ec8906501415 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/device.h> 24#include <linux/device.h>
26#include <linux/usb.h> 25#include <linux/usb.h>
27#include "hcd.h" 26#include "hcd.h"
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index f65b193cde3d..abee0f5b6a66 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -15,7 +15,6 @@
15 * 15 *
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/spinlock.h> 19#include <linux/spinlock.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 66b78404ab34..9d16716d166e 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -16,7 +16,6 @@
16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/pci.h> 21#include <linux/pci.h>
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 4bf914d00a14..fb4d058bbde0 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -22,7 +22,6 @@
22 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/version.h> 26#include <linux/version.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index e1731ff8af4d..875596e98e42 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
14#include <linux/module.h> 13#include <linux/module.h>
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index d0a208de32cf..e47e3a8ed6e4 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -27,7 +27,6 @@
27 27
28/*****************************************************************************/ 28/*****************************************************************************/
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/fs.h> 31#include <linux/fs.h>
33#include <linux/mount.h> 32#include <linux/mount.h>
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 8569600f3130..4cc8d3e67db7 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -2,7 +2,6 @@
2 * message.c - synchronous message handling 2 * message.c - synchronous message handling
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/pci.h> /* for scatterlist macros */ 5#include <linux/pci.h> /* for scatterlist macros */
7#include <linux/usb.h> 6#include <linux/usb.h>
8#include <linux/module.h> 7#include <linux/module.h>
diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c
index fe0ed54fa0ae..b042676af0a5 100644
--- a/drivers/usb/core/notify.c
+++ b/drivers/usb/core/notify.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/notifier.h> 13#include <linux/notifier.h>
15#include <linux/usb.h> 14#include <linux/usb.h>
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 3f49bf51cff7..dec973affb0f 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12 12
13#include <linux/config.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/usb.h> 14#include <linux/usb.h>
16#include "usb.h" 15#include "usb.h"
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index dad4d8fd8180..9864988377c7 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <linux/string.h> 2#include <linux/string.h>
4#include <linux/bitops.h> 3#include <linux/bitops.h>
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index fb488c8a860c..184c24660a4c 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -21,7 +21,6 @@
21 * are evil. 21 * are evil.
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/string.h> 25#include <linux/string.h>
27#include <linux/bitops.h> 26#include <linux/bitops.h>
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index b8d0b7825bf3..acb3c3d2e888 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -25,7 +25,6 @@
25#undef VERBOSE 25#undef VERBOSE
26#undef PACKET_TRACE 26#undef PACKET_TRACE
27 27
28#include <linux/config.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/platform_device.h> 30#include <linux/platform_device.h>
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 42ce41d71b7f..4be47195bd38 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -36,7 +36,6 @@
36 36
37#define DEBUG 37#define DEBUG
38 38
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/delay.h> 41#include <linux/delay.h>
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 078daa026718..8320fcef0425 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -23,7 +23,6 @@
23// #define DEBUG 1 23// #define DEBUG 1
24// #define VERBOSE 24// #define VERBOSE
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/delay.h> 28#include <linux/delay.h>
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index a43dc908ac59..b1a9cf06f3e6 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -221,7 +221,6 @@
221#undef VERBOSE 221#undef VERBOSE
222#undef DUMP_MSGS 222#undef DUMP_MSGS
223 223
224#include <linux/config.h>
225 224
226#include <asm/system.h> 225#include <asm/system.h>
227#include <asm/uaccess.h> 226#include <asm/uaccess.h>
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 5378c1757292..3f827ded8cdf 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -24,7 +24,6 @@
24// #define VERBOSE /* extra debug messages (success too) */ 24// #define VERBOSE /* extra debug messages (success too) */
25// #define USB_TRACE /* packet-level success messages */ 25// #define USB_TRACE /* packet-level success messages */
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/pci.h> 29#include <linux/pci.h>
diff --git a/drivers/usb/gadget/lh7a40x_udc.h b/drivers/usb/gadget/lh7a40x_udc.h
index 9b2e6f7cbb8b..e3bb78524c88 100644
--- a/drivers/usb/gadget/lh7a40x_udc.h
+++ b/drivers/usb/gadget/lh7a40x_udc.h
@@ -24,7 +24,6 @@
24#ifndef __LH7A40X_H_ 24#ifndef __LH7A40X_H_
25#define __LH7A40X_H_ 25#define __LH7A40X_H_
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/ioport.h> 29#include <linux/ioport.h>
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 1facdea56a8a..570996d7eb34 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -46,7 +46,6 @@
46#undef DEBUG /* messages on error and most fault paths */ 46#undef DEBUG /* messages on error and most fault paths */
47#undef VERBOSE /* extra debug messages (success too) */ 47#undef VERBOSE /* extra debug messages (success too) */
48 48
49#include <linux/config.h>
50#include <linux/module.h> 49#include <linux/module.h>
51#include <linux/pci.h> 50#include <linux/pci.h>
52#include <linux/dma-mapping.h> 51#include <linux/dma-mapping.h>
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index fbea51448909..0d642ac70055 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -22,7 +22,6 @@
22#undef DEBUG 22#undef DEBUG
23#undef VERBOSE 23#undef VERBOSE
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/ioport.h> 27#include <linux/ioport.h>
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 735e9dbd39fd..c88650dffdeb 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -27,7 +27,6 @@
27#undef DEBUG 27#undef DEBUG
28// #define VERBOSE DBG_VERBOSE 28// #define VERBOSE DBG_VERBOSE
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 3ff6db7828a0..354670d12308 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -23,7 +23,6 @@
23 * updates to merge with Linux 2.6, better match RNDIS spec 23 * updates to merge with Linux 2.6, better match RNDIS spec
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/moduleparam.h> 27#include <linux/moduleparam.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 416acac879df..30d7664d449d 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/delay.h> 22#include <linux/delay.h>
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 68e3d8f5da89..3a08a7ab4ce0 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -62,7 +62,6 @@
62#define DEBUG 1 62#define DEBUG 1
63// #define VERBOSE 63// #define VERBOSE
64 64
65#include <linux/config.h>
66#include <linux/module.h> 65#include <linux/module.h>
67#include <linux/kernel.h> 66#include <linux/kernel.h>
68#include <linux/delay.h> 67#include <linux/delay.h>
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 9b37e508ada3..cee6f538de0a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -16,7 +16,6 @@
16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/pci.h> 20#include <linux/pci.h>
22#include <linux/dmapool.h> 21#include <linux/dmapool.h>
diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c
index 4a22909518f5..61e571782cf7 100644
--- a/drivers/usb/host/hc_crisv10.c
+++ b/drivers/usb/host/hc_crisv10.c
@@ -4,7 +4,6 @@
4 * Copyright (c) 2002, 2003 Axis Communications AB. 4 * Copyright (c) 2002, 2003 Axis Communications AB.
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/delay.h> 8#include <linux/delay.h>
10#include <linux/ioport.h> 9#include <linux/ioport.h>
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 73f5a379d9b3..8fb842ed5f6e 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -74,7 +74,6 @@
74 * This file is licenced under the GPL. 74 * This file is licenced under the GPL.
75 */ 75 */
76 76
77#include <linux/config.h>
78#include <linux/module.h> 77#include <linux/module.h>
79#include <linux/moduleparam.h> 78#include <linux/moduleparam.h>
80#include <linux/pci.h> 79#include <linux/pci.h>
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 1045f846fbe2..dff60568b4a1 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -8,7 +8,6 @@
8 * (and others) 8 * (and others)
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/pci.h> 13#include <linux/pci.h>
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 89bcda5a3298..c327168255cd 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -31,7 +31,6 @@
31#undef VERBOSE 31#undef VERBOSE
32#undef PACKET_TRACE 32#undef PACKET_TRACE
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37#include <linux/kernel.h> 36#include <linux/kernel.h>
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 6637a0e49978..dc286a48cafd 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -9,7 +9,6 @@
9 * (C) Copyright 1999-2001 Johannes Erdfelt 9 * (C) Copyright 1999-2001 Johannes Erdfelt
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/debugfs.h> 13#include <linux/debugfs.h>
15#include <linux/smp_lock.h> 14#include <linux/smp_lock.h>
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 7b48567622ef..4151f618602d 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/pci.h> 26#include <linux/pci.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/usb/input/appletouch.c b/drivers/usb/input/appletouch.c
index 36855062eacc..9e3f13903371 100644
--- a/drivers/usb/input/appletouch.c
+++ b/drivers/usb/input/appletouch.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/init.h> 32#include <linux/init.h>
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index 07c8c0e665dd..05d2d6012eb2 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -85,7 +85,6 @@
85 * 85 *
86 */ 86 */
87 87
88#include <linux/config.h>
89#include <linux/kernel.h> 88#include <linux/kernel.h>
90#include <linux/errno.h> 89#include <linux/errno.h>
91#include <linux/init.h> 90#include <linux/init.h>
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index c4670e1d4654..70477f02cc29 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -25,7 +25,6 @@
25 * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net> 25 * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net>
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/poll.h> 28#include <linux/poll.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/module.h> 30#include <linux/module.h>
diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c
index 5c570cc703f3..86acb5f1907a 100644
--- a/drivers/usb/input/itmtouch.c
+++ b/drivers/usb/input/itmtouch.c
@@ -39,7 +39,6 @@
39 * 39 *
40 *****************************************************************************/ 40 *****************************************************************************/
41 41
42#include <linux/config.h>
43#include <linux/kernel.h> 42#include <linux/kernel.h>
44#include <linux/slab.h> 43#include <linux/slab.h>
45#include <linux/module.h> 44#include <linux/module.h>
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c
index 70af985b5db9..4723b310f277 100644
--- a/drivers/usb/input/keyspan_remote.c
+++ b/drivers/usb/input/keyspan_remote.c
@@ -11,7 +11,6 @@
11 * and Keyspan, Inc the manufacturers of the Keyspan USB DMR product. 11 * and Keyspan, Inc the manufacturers of the Keyspan USB DMR product.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17#include <linux/init.h> 16#include <linux/init.h>
diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c
index 4fdee4db0729..a9ccda8810e0 100644
--- a/drivers/usb/input/mtouchusb.c
+++ b/drivers/usb/input/mtouchusb.c
@@ -39,7 +39,6 @@
39 * 39 *
40 *****************************************************************************/ 40 *****************************************************************************/
41 41
42#include <linux/config.h>
43#include <linux/kernel.h> 42#include <linux/kernel.h>
44#include <linux/slab.h> 43#include <linux/slab.h>
45#include <linux/module.h> 44#include <linux/module.h>
diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c
index da7b0bf51aff..0149043ffb97 100644
--- a/drivers/usb/input/touchkitusb.c
+++ b/drivers/usb/input/touchkitusb.c
@@ -24,7 +24,6 @@
24 24
25//#define DEBUG 25//#define DEBUG
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
30#include <linux/module.h> 29#include <linux/module.h>
diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c
index cfd4a4e04334..9889b1cda05b 100644
--- a/drivers/usb/input/xpad.c
+++ b/drivers/usb/input/xpad.c
@@ -54,7 +54,6 @@
54 * 2002-07-17 - 0.0.5 : simplified d-pad handling 54 * 2002-07-17 - 0.0.5 : simplified d-pad handling
55 */ 55 */
56 56
57#include <linux/config.h>
58#include <linux/kernel.h> 57#include <linux/kernel.h>
59#include <linux/init.h> 58#include <linux/init.h>
60#include <linux/slab.h> 59#include <linux/slab.h>
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index 24aedbb20f03..575a4e672e96 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -46,7 +46,6 @@
46 * 20050816 henk Merge 2.6.13-rc6 46 * 20050816 henk Merge 2.6.13-rc6
47 */ 47 */
48 48
49#include <linux/config.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
51#include <linux/init.h> 50#include <linux/init.h>
52#include <linux/slab.h> 51#include <linux/slab.h>
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index a04204292aa3..b20bec445552 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16 16
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/init.h> 19#include <linux/init.h>
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index d0b167256699..fcd69c52aea9 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -16,7 +16,6 @@
16 16
17*/ 17*/
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 966acb474f67..f30ab1fbb3c8 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -27,7 +27,6 @@
27 * V0.13 (mh) Added support for LD X-Ray and Machine Test System 27 * V0.13 (mh) Added support for LD X-Ray and Machine Test System
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/init.h> 32#include <linux/init.h>
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 779bcf0373ad..7699d970e680 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -75,7 +75,6 @@
75 * - move reset into open to clean out spurious data 75 * - move reset into open to clean out spurious data
76 */ 76 */
77 77
78#include <linux/config.h>
79#include <linux/kernel.h> 78#include <linux/kernel.h>
80#include <linux/errno.h> 79#include <linux/errno.h>
81#include <linux/init.h> 80#include <linux/init.h>
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c
index 13aeea2026cc..bfbbbfbb92bc 100644
--- a/drivers/usb/misc/phidgetkit.c
+++ b/drivers/usb/misc/phidgetkit.c
@@ -13,7 +13,6 @@
13 * This is a driver for the USB PhidgetInterfaceKit. 13 * This is a driver for the USB PhidgetInterfaceKit.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/init.h> 18#include <linux/init.h>
diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c
index 5a040c205eed..c0df79c96538 100644
--- a/drivers/usb/misc/phidgetservo.c
+++ b/drivers/usb/misc/phidgetservo.c
@@ -25,7 +25,6 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/init.h> 30#include <linux/init.h>
diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c
index 968f0d38cff7..9b30f8962814 100644
--- a/drivers/usb/misc/sisusbvga/sisusb_init.c
+++ b/drivers/usb/misc/sisusbvga/sisusb_init.c
@@ -36,7 +36,6 @@
36 * 36 *
37 */ 37 */
38 38
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c
index f441964132c0..0c5ee0ad6bb9 100644
--- a/drivers/usb/misc/usbled.c
+++ b/drivers/usb/misc/usbled.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/init.h> 14#include <linux/init.h>
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 81ba14c73dc7..786e1dbe88ec 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/kernel.h> 1#include <linux/kernel.h>
3#include <linux/errno.h> 2#include <linux/errno.h>
4#include <linux/init.h> 3#include <linux/init.h>
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index 37111acec875..2e2bbc003e93 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -22,7 +22,6 @@
22// #define DEBUG // error path messages, extra info 22// #define DEBUG // error path messages, extra info
23// #define VERBOSE // more; success messages 23// #define VERBOSE // more; success messages
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/kmod.h> 26#include <linux/kmod.h>
28#include <linux/sched.h> 27#include <linux/sched.h>
diff --git a/drivers/usb/net/cdc_ether.c b/drivers/usb/net/cdc_ether.c
index efd195b5912c..82ce0358d9a3 100644
--- a/drivers/usb/net/cdc_ether.c
+++ b/drivers/usb/net/cdc_ether.c
@@ -20,7 +20,6 @@
20// #define DEBUG // error path messages, extra info 20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages 21// #define VERBOSE // more; success messages
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/init.h> 25#include <linux/init.h>
diff --git a/drivers/usb/net/cdc_subset.c b/drivers/usb/net/cdc_subset.c
index ec801e8bb1bb..e2fae85851a3 100644
--- a/drivers/usb/net/cdc_subset.c
+++ b/drivers/usb/net/cdc_subset.c
@@ -17,7 +17,6 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kmod.h> 21#include <linux/kmod.h>
23#include <linux/sched.h> 22#include <linux/sched.h>
diff --git a/drivers/usb/net/gl620a.c b/drivers/usb/net/gl620a.c
index faf1e86be687..3155f25f1d48 100644
--- a/drivers/usb/net/gl620a.c
+++ b/drivers/usb/net/gl620a.c
@@ -21,7 +21,6 @@
21// #define DEBUG // error path messages, extra info 21// #define DEBUG // error path messages, extra info
22// #define VERBOSE // more; success messages 22// #define VERBOSE // more; success messages
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/sched.h> 25#include <linux/sched.h>
27#include <linux/init.h> 26#include <linux/init.h>
diff --git a/drivers/usb/net/net1080.c b/drivers/usb/net/net1080.c
index 78e6a43b1087..a9b6eeac3e3f 100644
--- a/drivers/usb/net/net1080.c
+++ b/drivers/usb/net/net1080.c
@@ -20,7 +20,6 @@
20// #define DEBUG // error path messages, extra info 20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages 21// #define VERBOSE // more; success messages
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/init.h> 25#include <linux/init.h>
diff --git a/drivers/usb/net/plusb.c b/drivers/usb/net/plusb.c
index 4fe863389cb7..5d17cdfc7bab 100644
--- a/drivers/usb/net/plusb.c
+++ b/drivers/usb/net/plusb.c
@@ -20,7 +20,6 @@
20// #define DEBUG // error path messages, extra info 20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages 21// #define VERBOSE // more; success messages
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/init.h> 25#include <linux/init.h>
diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c
index f551546d7521..c2a28d88ef3c 100644
--- a/drivers/usb/net/rndis_host.c
+++ b/drivers/usb/net/rndis_host.c
@@ -20,7 +20,6 @@
20// #define DEBUG // error path messages, extra info 20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages 21// #define VERBOSE // more; success messages
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/init.h> 25#include <linux/init.h>
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index 1bbbae283c0b..718f8e2b552b 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -6,7 +6,6 @@
6 * version 2 as published by the Free Software Foundation. 6 * version 2 as published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
11#include <linux/init.h> 10#include <linux/init.h>
12#include <linux/signal.h> 11#include <linux/signal.h>
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 362d6907c9bb..54183e173a6d 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -33,7 +33,6 @@
33// #define DEBUG // error path messages, extra info 33// #define DEBUG // error path messages, extra info
34// #define VERBOSE // more; success messages 34// #define VERBOSE // more; success messages
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/sched.h> 37#include <linux/sched.h>
39#include <linux/init.h> 38#include <linux/init.h>
diff --git a/drivers/usb/net/zaurus.c b/drivers/usb/net/zaurus.c
index 813e470d0600..144566bda583 100644
--- a/drivers/usb/net/zaurus.c
+++ b/drivers/usb/net/zaurus.c
@@ -20,7 +20,6 @@
20// #define DEBUG // error path messages, extra info 20// #define DEBUG // error path messages, extra info
21// #define VERBOSE // more; success messages 21// #define VERBOSE // more; success messages
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/init.h> 25#include <linux/init.h>
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 4144777ea18b..3faa7aa0111a 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -63,7 +63,6 @@
63 * UsbSnoop on Windows2000 and from examining the other USB drivers. 63 * UsbSnoop on Windows2000 and from examining the other USB drivers.
64 */ 64 */
65 65
66#include <linux/config.h>
67#include <linux/kernel.h> 66#include <linux/kernel.h>
68#include <linux/errno.h> 67#include <linux/errno.h>
69#include <linux/init.h> 68#include <linux/init.h>
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index e9f9f4bafa17..f2d993b70c18 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -8,7 +8,6 @@
8 * 2 as published by the Free Software Foundation. 8 * 2 as published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
14#include <linux/tty.h> 13#include <linux/tty.h>
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index f3404e10afb4..3d456b32c316 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/slab.h> 16#include <linux/slab.h>
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index f8c0cb287736..df0a4f98b4ae 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
23#include <linux/slab.h> 22#include <linux/slab.h>
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 1fd5c5a9f2ef..49b51ab0d4cb 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -28,7 +28,6 @@
28 */ 28 */
29 29
30 30
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
34#include <linux/init.h> 33#include <linux/init.h>
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 5de76efe1b37..4ff2dfb299bd 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -48,7 +48,6 @@
48/* Code originates and was built up from ftdi_sio, belkin, pl2303 and others. */ 48/* Code originates and was built up from ftdi_sio, belkin, pl2303 and others. */
49 49
50 50
51#include <linux/config.h>
52#include <linux/kernel.h> 51#include <linux/kernel.h>
53#include <linux/errno.h> 52#include <linux/errno.h>
54#include <linux/init.h> 53#include <linux/init.h>
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index b3f776a90c93..6953d3ef5738 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -233,7 +233,6 @@
233* $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $ 233* $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $
234*/ 234*/
235 235
236#include <linux/config.h>
237#include <linux/kernel.h> 236#include <linux/kernel.h>
238#include <linux/errno.h> 237#include <linux/errno.h>
239#include <linux/init.h> 238#include <linux/init.h>
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index afca1eae5fb5..1e2b31eeb497 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -51,7 +51,6 @@
51 * 51 *
52 */ 52 */
53 53
54#include <linux/config.h>
55#include <linux/kernel.h> 54#include <linux/kernel.h>
56#include <linux/errno.h> 55#include <linux/errno.h>
57#include <linux/init.h> 56#include <linux/init.h>
diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c
index 1e419c8d7392..debc3b0f9662 100644
--- a/drivers/usb/serial/ezusb.c
+++ b/drivers/usb/serial/ezusb.c
@@ -8,7 +8,6 @@
8 * 2 as published by the Free Software Foundation. 8 * 2 as published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index b2bfea7c815a..8a74b19f1283 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -245,7 +245,6 @@
245/* to talk to the device */ 245/* to talk to the device */
246/* Thanx to gkh and the rest of the usb dev group for all code I have assimilated :-) */ 246/* Thanx to gkh and the rest of the usb dev group for all code I have assimilated :-) */
247 247
248#include <linux/config.h>
249#include <linux/kernel.h> 248#include <linux/kernel.h>
250#include <linux/errno.h> 249#include <linux/errno.h>
251#include <linux/init.h> 250#include <linux/init.h>
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 04767759cf8a..1f5d1620baa1 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA 23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/init.h> 28#include <linux/init.h>
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 07a478c59fb2..945b8bb38c92 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c
index e9719da2aca1..7e06358b0310 100644
--- a/drivers/usb/serial/hp4x.c
+++ b/drivers/usb/serial/hp4x.c
@@ -12,7 +12,6 @@
12 * See Documentation/usb/usb-serial.txt for more information on using this driver 12 * See Documentation/usb/usb-serial.txt for more information on using this driver
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/tty.h> 17#include <linux/tty.h>
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index b85d2156dfdc..bd2c05dac2a9 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -29,7 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/jiffies.h> 33#include <linux/jiffies.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 8e1e2253748b..723a12ae87b5 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -24,7 +24,6 @@
24 * 24 *
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/jiffies.h> 28#include <linux/jiffies.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 9da6d2a8f2b0..dbcfe172a5cc 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -44,7 +44,6 @@
44 * Thanks to info from Heath Robinson and Arieh Davidoff. 44 * Thanks to info from Heath Robinson and Arieh Davidoff.
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/kernel.h> 47#include <linux/kernel.h>
49#include <linux/errno.h> 48#include <linux/errno.h>
50#include <linux/init.h> 49#include <linux/init.h>
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index d7f3f736a692..2cf1fed3de43 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -46,7 +46,6 @@
46 * initial version released. 46 * initial version released.
47 */ 47 */
48 48
49#include <linux/config.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
51#include <linux/errno.h> 50#include <linux/errno.h>
52#include <linux/init.h> 51#include <linux/init.h>
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 2cf6ade704e4..d7c58f1bc960 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -95,7 +95,6 @@
95*/ 95*/
96 96
97 97
98#include <linux/config.h>
99#include <linux/kernel.h> 98#include <linux/kernel.h>
100#include <linux/jiffies.h> 99#include <linux/jiffies.h>
101#include <linux/errno.h> 100#include <linux/errno.h>
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index b0441c35f98f..03ab3c0f3cce 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -66,7 +66,6 @@
66 */ 66 */
67 67
68 68
69#include <linux/config.h>
70#include <linux/kernel.h> 69#include <linux/kernel.h>
71#include <linux/errno.h> 70#include <linux/errno.h>
72#include <linux/init.h> 71#include <linux/init.h>
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 65d79f630fa4..b45ff3e7ab40 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -45,7 +45,6 @@
45 */ 45 */
46 46
47 47
48#include <linux/config.h>
49#include <linux/kernel.h> 48#include <linux/kernel.h>
50#include <linux/errno.h> 49#include <linux/errno.h>
51#include <linux/init.h> 50#include <linux/init.h>
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 87dfcd89ffab..457733374772 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -35,7 +35,6 @@
35 */ 35 */
36 36
37 37
38#include <linux/config.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
41#include <linux/init.h> 40#include <linux/init.h>
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 35bd29b6c408..ca05d3275f3e 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -64,7 +64,6 @@
64 * (via linux-usb-devel). 64 * (via linux-usb-devel).
65 */ 65 */
66 66
67#include <linux/config.h>
68#include <linux/kernel.h> 67#include <linux/kernel.h>
69#include <linux/errno.h> 68#include <linux/errno.h>
70#include <linux/init.h> 69#include <linux/init.h>
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 6dcdb5f598b8..cfb711a21a45 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -35,7 +35,6 @@
35 * 35 *
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
41#include <linux/init.h> 40#include <linux/init.h>
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index b0861b61bba7..78ad4b3126a6 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -57,7 +57,6 @@
57#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" 57#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
58#define DRIVER_DESC "USB Driver for GSM modems" 58#define DRIVER_DESC "USB Driver for GSM modems"
59 59
60#include <linux/config.h>
61#include <linux/kernel.h> 60#include <linux/kernel.h>
62#include <linux/jiffies.h> 61#include <linux/jiffies.h>
63#include <linux/errno.h> 62#include <linux/errno.h>
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index d88704387202..de93a2b909e7 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/init.h> 19#include <linux/init.h>
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index f0215f850d2d..897d8447252b 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -60,7 +60,6 @@
60 */ 60 */
61 61
62 62
63#include <linux/config.h>
64#include <linux/kernel.h> 63#include <linux/kernel.h>
65#include <linux/errno.h> 64#include <linux/errno.h>
66#include <linux/init.h> 65#include <linux/init.h>
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index c3a2071b802d..a9afff31a921 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -68,7 +68,6 @@
68 * fi 68 * fi
69 */ 69 */
70 70
71#include <linux/config.h>
72#include <linux/kernel.h> 71#include <linux/kernel.h>
73#include <linux/errno.h> 72#include <linux/errno.h>
74#include <linux/init.h> 73#include <linux/init.h>
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index f466f89eeb6d..b59a0536ea5c 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -16,7 +16,6 @@
16 * 16 *
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/init.h> 21#include <linux/init.h>
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index d53ea9b11e81..0f2802a60194 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -14,7 +14,6 @@
14#ifndef __LINUX_USB_SERIAL_H 14#ifndef __LINUX_USB_SERIAL_H
15#define __LINUX_USB_SERIAL_H 15#define __LINUX_USB_SERIAL_H
16 16
17#include <linux/config.h>
18#include <linux/kref.h> 17#include <linux/kref.h>
19#include <linux/mutex.h> 18#include <linux/mutex.h>
20 19
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 9e89b8d54f72..95a2936e902e 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/init.h> 18#include <linux/init.h>
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 56ffc81302fc..540438c3f381 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -65,7 +65,6 @@
65 * 65 *
66 */ 66 */
67 67
68#include <linux/config.h>
69#include <linux/kernel.h> 68#include <linux/kernel.h>
70#include <linux/errno.h> 69#include <linux/errno.h>
71#include <linux/init.h> 70#include <linux/init.h>
diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index cd2096acc723..77e244a8c376 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -44,7 +44,6 @@
44#ifndef _DEBUG_H_ 44#ifndef _DEBUG_H_
45#define _DEBUG_H_ 45#define _DEBUG_H_
46 46
47#include <linux/config.h>
48#include <linux/kernel.h> 47#include <linux/kernel.h>
49 48
50#define USB_STORAGE "usb-storage: " 49#define USB_STORAGE "usb-storage: "
diff --git a/drivers/usb/storage/dpcm.c b/drivers/usb/storage/dpcm.c
index 92b69e4c8047..1628cb258562 100644
--- a/drivers/usb/storage/dpcm.c
+++ b/drivers/usb/storage/dpcm.c
@@ -29,7 +29,6 @@
29 * 675 Mass Ave, Cambridge, MA 02139, USA. 29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <scsi/scsi.h> 32#include <scsi/scsi.h>
34#include <scsi/scsi_cmnd.h> 33#include <scsi/scsi_cmnd.h>
35#include <scsi/scsi_device.h> 34#include <scsi/scsi_device.h>
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 30e96050fe0c..88aa59ab7563 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -28,7 +28,6 @@
28 * (http://www.freecom.de/) 28 * (http://www.freecom.de/)
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/hdreg.h> 31#include <linux/hdreg.h>
33 32
34#include <scsi/scsi.h> 33#include <scsi/scsi.h>
diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h
index f9907a5cf129..927f7781080f 100644
--- a/drivers/usb/storage/initializers.h
+++ b/drivers/usb/storage/initializers.h
@@ -37,7 +37,6 @@
37 * 675 Mass Ave, Cambridge, MA 02139, USA. 37 * 675 Mass Ave, Cambridge, MA 02139, USA.
38 */ 38 */
39 39
40#include <linux/config.h>
41#include "usb.h" 40#include "usb.h"
42#include "transport.h" 41#include "transport.h"
43 42
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 026a587eb8dd..313920d980c9 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -28,7 +28,6 @@
28 * 28 *
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/input.h> 32#include <linux/input.h>
34#include <linux/init.h> 33#include <linux/init.h>
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 19b25c5cafd4..eb7188b3565c 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -45,7 +45,6 @@
45 * 675 Mass Ave, Cambridge, MA 02139, USA. 45 * 675 Mass Ave, Cambridge, MA 02139, USA.
46 */ 46 */
47 47
48#include <linux/config.h>
49#include <linux/sched.h> 48#include <linux/sched.h>
50#include <linux/errno.h> 49#include <linux/errno.h>
51#include <linux/slab.h> 50#include <linux/slab.h>
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 543244d421c1..c7e84e653df9 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -31,7 +31,6 @@
31 * the following thing for it to work: 31 * the following thing for it to work:
32 * The macro UNUSUAL_DEV() must be defined before this file is included 32 * The macro UNUSUAL_DEV() must be defined before this file is included
33 */ 33 */
34#include <linux/config.h>
35 34
36/* If you edit this file, please try to keep it sorted first by VendorID, 35/* If you edit this file, please try to keep it sorted first by VendorID,
37 * then by ProductID. 36 * then by ProductID.
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index e232c7c89909..1185acac4b21 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -47,7 +47,6 @@
47 * 675 Mass Ave, Cambridge, MA 02139, USA. 47 * 675 Mass Ave, Cambridge, MA 02139, USA.
48 */ 48 */
49 49
50#include <linux/config.h>
51#include <linux/sched.h> 50#include <linux/sched.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
53#include <linux/suspend.h> 52#include <linux/suspend.h>
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 4de9fb56ebfc..b362039792b3 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/init.h> 18#include <linux/init.h>
diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c
index 455fda990ff7..e714e8449c1d 100644
--- a/drivers/video/S3triofb.c
+++ b/drivers/video/S3triofb.c
@@ -23,7 +23,6 @@
23 23
24*/ 24*/
25 25
26#include <linux/config.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 98baecccb3fd..61a8bf159cb0 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -17,7 +17,6 @@
17 * - Blanking 8bpp displays with VIDC 17 * - Blanking 8bpp displays with VIDC
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index 3033c72dea20..f9bc9f777e75 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -48,7 +48,6 @@
48#include <linux/tty.h> 48#include <linux/tty.h>
49#include <linux/slab.h> 49#include <linux/slab.h>
50#include <linux/delay.h> 50#include <linux/delay.h>
51#include <linux/config.h>
52#include <linux/interrupt.h> 51#include <linux/interrupt.h>
53#include <linux/fb.h> 52#include <linux/fb.h>
54#include <linux/init.h> 53#include <linux/init.h>
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 29f9f0dfe3b4..eaeaf4d1a094 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -29,7 +29,6 @@
29 * more details. 29 * more details.
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 11cf7fcb1d55..72c589109471 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -46,7 +46,6 @@
46 */ 46 */
47 47
48 48
49#include <linux/config.h>
50#include <linux/module.h> 49#include <linux/module.h>
51#include <linux/moduleparam.h> 50#include <linux/moduleparam.h>
52#include <linux/kernel.h> 51#include <linux/kernel.h>
diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h
index 43d2cb58af87..55fb8b04489b 100644
--- a/drivers/video/aty/atyfb.h
+++ b/drivers/video/aty/atyfb.h
@@ -2,7 +2,6 @@
2 * ATI Frame Buffer Device Driver Core Definitions 2 * ATI Frame Buffer Device Driver Core Definitions
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <linux/wait.h> 6#include <linux/wait.h>
8 /* 7 /*
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 22e720611bf6..85fcd22e6ed5 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -49,7 +49,6 @@
49******************************************************************************/ 49******************************************************************************/
50 50
51 51
52#include <linux/config.h>
53#include <linux/module.h> 52#include <linux/module.h>
54#include <linux/moduleparam.h> 53#include <linux/moduleparam.h>
55#include <linux/kernel.h> 54#include <linux/kernel.h>
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 68b15645b893..51b78f8de949 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -52,7 +52,6 @@
52 52
53#define RADEON_VERSION "0.2.0" 53#define RADEON_VERSION "0.2.0"
54 54
55#include <linux/config.h>
56#include <linux/module.h> 55#include <linux/module.h>
57#include <linux/moduleparam.h> 56#include <linux/moduleparam.h>
58#include <linux/kernel.h> 57#include <linux/kernel.h>
diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c
index a9d0414e4655..9aaca58c074a 100644
--- a/drivers/video/aty/radeon_i2c.c
+++ b/drivers/video/aty/radeon_i2c.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <linux/kernel.h> 2#include <linux/kernel.h>
4#include <linux/sched.h> 3#include <linux/sched.h>
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index 1645943b1123..38657b2d10eb 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -1,7 +1,6 @@
1#ifndef __RADEONFB_H__ 1#ifndef __RADEONFB_H__
2#define __RADEONFB_H__ 2#define __RADEONFB_H__
3 3
4#include <linux/config.h>
5#include <linux/module.h> 4#include <linux/module.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/sched.h> 6#include <linux/sched.h>
@@ -382,7 +381,7 @@ struct radeonfb_info {
382/* Note about this function: we have some rare cases where we must not schedule, 381/* Note about this function: we have some rare cases where we must not schedule,
383 * this typically happen with our special "wake up early" hook which allows us to 382 * this typically happen with our special "wake up early" hook which allows us to
384 * wake up the graphic chip (and thus get the console back) before everything else 383 * wake up the graphic chip (and thus get the console back) before everything else
385 * on some machines that support that mecanism. At this point, interrupts are off 384 * on some machines that support that mechanism. At this point, interrupts are off
386 * and scheduling is not permitted 385 * and scheduling is not permitted
387 */ 386 */
388static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms) 387static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms)
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 9ef68cd83bb4..a92a91fef16f 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -40,7 +40,6 @@
40 * with this program; if not, write to the Free Software Foundation, Inc., 40 * with this program; if not, write to the Free Software Foundation, Inc.,
41 * 675 Mass Ave, Cambridge, MA 02139, USA. 41 * 675 Mass Ave, Cambridge, MA 02139, USA.
42 */ 42 */
43#include <linux/config.h>
44#include <linux/module.h> 43#include <linux/module.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/errno.h> 45#include <linux/errno.h>
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index bd879b7ec119..caf1eca199b0 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13/* LCD power functions */ 13/* LCD power functions */
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c
index 74415325b016..6faea4034e3d 100644
--- a/drivers/video/cfbcopyarea.c
+++ b/drivers/video/cfbcopyarea.c
@@ -24,7 +24,6 @@
24 24
25 25
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30#include <linux/string.h> 29#include <linux/string.h>
diff --git a/drivers/video/cfbfillrect.c b/drivers/video/cfbfillrect.c
index e5ff62e9cfb8..f00b50aab606 100644
--- a/drivers/video/cfbfillrect.c
+++ b/drivers/video/cfbfillrect.c
@@ -17,7 +17,6 @@
17 * the native cpu endians. I also need to deal with MSB position in the word. 17 * the native cpu endians. I also need to deal with MSB position in the word.
18 * 18 *
19 */ 19 */
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/string.h> 21#include <linux/string.h>
23#include <linux/fb.h> 22#include <linux/fb.h>
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index ad8a89bf8eae..51d35386a945 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -29,7 +29,6 @@
29 * Also need to add code to deal with cards endians that are different than 29 * Also need to add code to deal with cards endians that are different than
30 * the native cpu endians. I also need to deal with MSB position in the word. 30 * the native cpu endians. I also need to deal with MSB position in the word.
31 */ 31 */
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/string.h> 33#include <linux/string.h>
35#include <linux/fb.h> 34#include <linux/fb.h>
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index d76bbfac92cc..0e465c80ef24 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -14,7 +14,6 @@
14 * more details. 14 * more details.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/errno.h> 19#include <linux/errno.h>
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index dda240eb7360..7355da09c721 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -36,7 +36,6 @@
36 36
37#define CIRRUSFB_VERSION "2.0-pre2" 37#define CIRRUSFB_VERSION "2.0-pre2"
38 38
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
index eea422eb1ab5..308850df16fe 100644
--- a/drivers/video/console/bitblit.c
+++ b/drivers/video/console/bitblit.c
@@ -10,7 +10,6 @@
10 * more details. 10 * more details.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/string.h> 14#include <linux/string.h>
16#include <linux/fb.h> 15#include <linux/fb.h>
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index 1ecda91e5a9c..878707a04398 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -22,7 +22,6 @@
22#define DUMMY_ROWS ORIG_VIDEO_LINES 22#define DUMMY_ROWS ORIG_VIDEO_LINES
23#elif defined(__hppa__) 23#elif defined(__hppa__)
24/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ 24/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
25#include <linux/config.h>
26#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS 25#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
27#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS 26#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
28#else 27#else
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 5dc4083552d8..94e9f7069bef 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -58,7 +58,6 @@
58 58
59#undef FBCONDEBUG 59#undef FBCONDEBUG
60 60
61#include <linux/config.h>
62#include <linux/module.h> 61#include <linux/module.h>
63#include <linux/types.h> 62#include <linux/types.h>
64#include <linux/sched.h> 63#include <linux/sched.h>
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 3487a636370a..f244ad066d68 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -11,7 +11,6 @@
11#ifndef _VIDEO_FBCON_H 11#ifndef _VIDEO_FBCON_H
12#define _VIDEO_FBCON_H 12#define _VIDEO_FBCON_H
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/vt_buffer.h> 15#include <linux/vt_buffer.h>
17#include <linux/vt_kern.h> 16#include <linux/vt_kern.h>
diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c
index 990289a69b78..4481c80b8b2a 100644
--- a/drivers/video/console/fbcon_ccw.c
+++ b/drivers/video/console/fbcon_ccw.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c
index d44c5fa515fb..7f92c06afea7 100644
--- a/drivers/video/console/fbcon_cw.c
+++ b/drivers/video/console/fbcon_cw.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
diff --git a/drivers/video/console/fbcon_rotate.c b/drivers/video/console/fbcon_rotate.c
index 2dc091fbd5c9..00884e013f0f 100644
--- a/drivers/video/console/fbcon_rotate.c
+++ b/drivers/video/console/fbcon_rotate.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c
index f56ed068a5bc..ab91005e64dc 100644
--- a/drivers/video/console/fbcon_ud.c
+++ b/drivers/video/console/fbcon_ud.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
diff --git a/drivers/video/console/font_acorn_8x8.c b/drivers/video/console/font_acorn_8x8.c
index 2d2e39632e2d..40f3d4eeb198 100644
--- a/drivers/video/console/font_acorn_8x8.c
+++ b/drivers/video/console/font_acorn_8x8.c
@@ -1,6 +1,5 @@
1/* Acorn-like font definition, with PC graphics characters */ 1/* Acorn-like font definition, with PC graphics characters */
2 2
3#include <linux/config.h>
4#include <linux/font.h> 3#include <linux/font.h>
5 4
6static const unsigned char acorndata_8x8[] = { 5static const unsigned char acorndata_8x8[] = {
diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c
index 0cc1bfda76a6..c960728b7e82 100644
--- a/drivers/video/console/fonts.c
+++ b/drivers/video/console/fonts.c
@@ -12,7 +12,6 @@
12 * for more details. 12 * for more details.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/string.h> 17#include <linux/string.h>
diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c
index d6e6ad537f9f..5cd5e114d1e6 100644
--- a/drivers/video/console/promcon.c
+++ b/drivers/video/console/promcon.c
@@ -5,7 +5,6 @@
5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 74ac2acaf72c..88e7038eab88 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/video/console/tileblit.c b/drivers/video/console/tileblit.c
index 153352ca9461..d981fe4d86c6 100644
--- a/drivers/video/console/tileblit.c
+++ b/drivers/video/console/tileblit.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 01401cd63ac0..05735ff4e9c5 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -33,7 +33,6 @@
33 * more details. 33 * more details.
34 */ 34 */
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/sched.h> 38#include <linux/sched.h>
diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c
index 655301a8671c..acdd6a103dbb 100644
--- a/drivers/video/controlfb.c
+++ b/drivers/video/controlfb.c
@@ -31,7 +31,6 @@
31 * more details. 31 * more details.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/kernel.h> 35#include <linux/kernel.h>
37#include <linux/errno.h> 36#include <linux/errno.h>
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index 55a3514157ed..2e2924957d8f 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -36,7 +36,6 @@
36 * (which, incidentally, is about the same saving as a 2.5in hard disk 36 * (which, incidentally, is about the same saving as a 2.5in hard disk
37 * entering standby mode.) 37 * entering standby mode.)
38 */ 38 */
39#include <linux/config.h>
40#include <linux/module.h> 39#include <linux/module.h>
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
diff --git a/drivers/video/cyber2000fb.h b/drivers/video/cyber2000fb.h
index bd7e1c040781..de4fc43e51c1 100644
--- a/drivers/video/cyber2000fb.h
+++ b/drivers/video/cyber2000fb.h
@@ -9,7 +9,6 @@
9 * 9 *
10 * Integraphics Cyber2000 frame buffer device 10 * Integraphics Cyber2000 frame buffer device
11 */ 11 */
12#include <linux/config.h>
13 12
14/* 13/*
15 * Internal CyberPro sizes and offsets. 14 * Internal CyberPro sizes and offsets.
diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c
index 0ae0a97b0fed..94a66c2d2cf5 100644
--- a/drivers/video/cyblafb.c
+++ b/drivers/video/cyblafb.c
@@ -14,7 +14,6 @@
14 14
15#define CYBLAFB_PIXMAPSIZE 8192 15#define CYBLAFB_PIXMAPSIZE 8192
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/fb.h> 19#include <linux/fb.h>
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index a171daab0ad0..33034f81114d 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -11,7 +11,6 @@
11 * for more details. 11 * for more details.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16 15
17#include <linux/compat.h> 16#include <linux/compat.h>
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 5e25b9860196..bf0e60b5a3b6 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -9,7 +9,6 @@
9 * more details. 9 * more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/delay.h> 12#include <linux/delay.h>
14#include <linux/platform_device.h> 13#include <linux/platform_device.h>
15#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index f04ca721f94c..01864767450d 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -11,7 +11,6 @@
11 * more details. 11 * more details.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c
index 3fe3ae1aff12..c1f7b49975dd 100644
--- a/drivers/video/i810/i810-i2c.c
+++ b/drivers/video/i810/i810-i2c.c
@@ -8,7 +8,6 @@
8 * License. See the file COPYING in the main directory of this archive for 8 * License. See the file COPYING in the main directory of this archive for
9 * more details. 9 * more details.
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index a1f7d80f0ac1..fbe8a2c4b04c 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -29,7 +29,6 @@
29 */ 29 */
30 30
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/config.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/errno.h> 33#include <linux/errno.h>
35#include <linux/string.h> 34#include <linux/string.h>
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index f73c642b50c2..5f393d985b11 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -16,7 +16,6 @@
16 * more details. 16 * more details.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 1718baaeed2a..0f9b2fdc28b1 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -18,7 +18,6 @@
18 18
19//#define DEBUG 1 19//#define DEBUG 1
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/sched.h> 23#include <linux/sched.h>
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 0a0a8b199ecc..3f39d84015f1 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -108,7 +108,6 @@
108 * 108 *
109 */ 109 */
110 110
111#include <linux/config.h>
112#include <linux/module.h> 111#include <linux/module.h>
113#include <linux/kernel.h> 112#include <linux/kernel.h>
114#include <linux/errno.h> 113#include <linux/errno.h>
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 7533b3dd08ac..3b78a57924f0 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -19,7 +19,6 @@
19 19
20/* $DHD: intelfb/intelfbhw.c,v 1.9 2003/06/27 15:06:25 dawes Exp $ */ 20/* $DHD: intelfb/intelfbhw.c,v 1.9 2003/06/27 15:06:25 dawes Exp $ */
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 477ad297de4e..2fdbe9b2b04b 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -9,7 +9,6 @@
9 * for more details. 9 * for more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index 788fa812c871..80c03618eb53 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -9,7 +9,6 @@
9 * Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org> 9 * Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/linux_logo.h> 12#include <linux/linux_logo.h>
14#include <linux/stddef.h> 13#include <linux/stddef.h>
15#include <linux/module.h> 14#include <linux/module.h>
diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c
index d21321ca7c39..ab2149531a04 100644
--- a/drivers/video/macmodes.c
+++ b/drivers/video/macmodes.c
@@ -15,7 +15,6 @@
15 * more details. 15 * more details.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/fb.h> 19#include <linux/fb.h>
21#include <linux/string.h> 20#include <linux/string.h>
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c
index a456e67a5b00..c4b570b4a4df 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.c
+++ b/drivers/video/matrox/matroxfb_DAC1064.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16 15
17#include "matroxfb_DAC1064.h" 16#include "matroxfb_DAC1064.h"
18#include "matroxfb_misc.h" 17#include "matroxfb_misc.h"
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h
index 56513a5d220b..df39c3193735 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.h
+++ b/drivers/video/matrox/matroxfb_DAC1064.h
@@ -1,7 +1,6 @@
1#ifndef __MATROXFB_DAC1064_H__ 1#ifndef __MATROXFB_DAC1064_H__
2#define __MATROXFB_DAC1064_H__ 2#define __MATROXFB_DAC1064_H__
3 3
4#include <linux/config.h>
5 4
6#include "matroxfb_base.h" 5#include "matroxfb_base.h"
7 6
diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c
index 23ebad0a12d8..a5690a5f29d5 100644
--- a/drivers/video/matrox/matroxfb_Ti3026.c
+++ b/drivers/video/matrox/matroxfb_Ti3026.c
@@ -78,7 +78,6 @@
78 * 78 *
79 */ 79 */
80 80
81#include <linux/config.h>
82 81
83#include "matroxfb_Ti3026.h" 82#include "matroxfb_Ti3026.h"
84#include "matroxfb_misc.h" 83#include "matroxfb_misc.h"
diff --git a/drivers/video/matrox/matroxfb_Ti3026.h b/drivers/video/matrox/matroxfb_Ti3026.h
index 536e5f69de9f..27872aaa0a17 100644
--- a/drivers/video/matrox/matroxfb_Ti3026.h
+++ b/drivers/video/matrox/matroxfb_Ti3026.h
@@ -1,7 +1,6 @@
1#ifndef __MATROXFB_TI3026_H__ 1#ifndef __MATROXFB_TI3026_H__
2#define __MATROXFB_TI3026_H__ 2#define __MATROXFB_TI3026_H__
3 3
4#include <linux/config.h>
5 4
6#include "matroxfb_base.h" 5#include "matroxfb_base.h"
7 6
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index f4ddd3431f17..8b5bf7972ee3 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -99,7 +99,6 @@
99 * 99 *
100 */ 100 */
101 101
102#include <linux/config.h>
103#include <linux/version.h> 102#include <linux/version.h>
104 103
105#define __OLD_VIDIOC_ 104#define __OLD_VIDIOC_
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index b71737178d0d..b95779b57c06 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -25,7 +25,6 @@
25/* Guard accelerator accesses with spin_lock_irqsave... */ 25/* Guard accelerator accesses with spin_lock_irqsave... */
26#undef MATROXFB_USE_SPINLOCKS 26#undef MATROXFB_USE_SPINLOCKS
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/errno.h> 30#include <linux/errno.h>
diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c
index 263d801ef78f..18886b629cb1 100644
--- a/drivers/video/matrox/matroxfb_misc.c
+++ b/drivers/video/matrox/matroxfb_misc.c
@@ -84,7 +84,6 @@
84 * 84 *
85 */ 85 */
86 86
87#include <linux/config.h>
88 87
89#include "matroxfb_misc.h" 88#include "matroxfb_misc.h"
90#include <linux/interrupt.h> 89#include <linux/interrupt.h>
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 2f156b724d1c..773855a311e8 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -54,7 +54,6 @@
54 * 54 *
55 */ 55 */
56 56
57#include <linux/config.h>
58#include <linux/module.h> 57#include <linux/module.h>
59#include <linux/kernel.h> 58#include <linux/kernel.h>
60#include <linux/errno.h> 59#include <linux/errno.h>
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index 1edb1c432b75..19eef3a09023 100644
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -10,7 +10,6 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c
index 7a03d040b1a3..8209106e26ee 100644
--- a/drivers/video/nvidia/nv_of.c
+++ b/drivers/video/nvidia/nv_of.c
@@ -10,7 +10,6 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index 7b5cffb27851..b02d6033cc0c 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index ad1434e3f227..bfeb11bd4712 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -12,7 +12,6 @@
12 * more details. 12 * more details.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 335e37465559..450e802e0aa8 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -17,7 +17,6 @@
17 * more details. 17 * more details.
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 4e963930b50a..49a203e1591c 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 52c18a35fb41..0e0f977b05ee 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -52,7 +52,6 @@
52 * Wed Feb 21 14:47:06 CET 2001, v 1.0.0: First working version 52 * Wed Feb 21 14:47:06 CET 2001, v 1.0.0: First working version
53 */ 53 */
54 54
55#include <linux/config.h>
56#include <linux/module.h> 55#include <linux/module.h>
57#include <linux/kernel.h> 56#include <linux/kernel.h>
58#include <linux/errno.h> 57#include <linux/errno.h>
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index ec4bacf9dd2e..4a1e0e856920 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -56,7 +56,6 @@
56#include <linux/tty.h> 56#include <linux/tty.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/delay.h> 58#include <linux/delay.h>
59#include <linux/config.h>
60#include <linux/interrupt.h> 59#include <linux/interrupt.h>
61#include <linux/fb.h> 60#include <linux/fb.h>
62#include <linux/init.h> 61#include <linux/init.h>
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 809fc5eefc15..54663a9baf43 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 12af58c5cf1f..2788655e6e7d 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -29,7 +29,6 @@
29 * doublescan modes are broken 29 * doublescan modes are broken
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 8b1967fc116a..9751c37c0bfd 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -12,7 +12,6 @@
12 * for more details. 12 * for more details.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
diff --git a/drivers/video/riva/rivafb.h b/drivers/video/riva/rivafb.h
index 440ff445689b..7fa13fc9c413 100644
--- a/drivers/video/riva/rivafb.h
+++ b/drivers/video/riva/rivafb.h
@@ -1,7 +1,6 @@
1#ifndef __RIVAFB_H 1#ifndef __RIVAFB_H
2#define __RIVAFB_H 2#define __RIVAFB_H
3 3
4#include <linux/config.h>
5#include <linux/fb.h> 4#include <linux/fb.h>
6#include <video/vga.h> 5#include <video/vga.h>
7#include <linux/i2c.h> 6#include <linux/i2c.h>
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index feec47bdd479..a5333c190789 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -28,7 +28,6 @@
28 * more details. 28 * more details.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/platform_device.h> 32#include <linux/platform_device.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index d9831fd42341..553fd84af44f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -160,7 +160,6 @@
160 * - Add patch 681/1 and clean up stork definitions. 160 * - Add patch 681/1 and clean up stork definitions.
161 */ 161 */
162 162
163#include <linux/config.h>
164#include <linux/module.h> 163#include <linux/module.h>
165#include <linux/kernel.h> 164#include <linux/kernel.h>
166#include <linux/sched.h> 165#include <linux/sched.h>
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index 21debed863ac..e83befd16d63 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -10,7 +10,6 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 78883cf66a4d..4729af477fbf 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -41,7 +41,6 @@
41 * 41 *
42 */ 42 */
43 43
44#include <linux/config.h>
45#include <linux/module.h> 44#include <linux/module.h>
46#include <linux/kernel.h> 45#include <linux/kernel.h>
47#include <linux/errno.h> 46#include <linux/errno.h>
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index c0cc5e3ba7b5..ebb6756aea08 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -9,7 +9,6 @@
9 * more details. 9 * more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/mm.h> 14#include <linux/mm.h>
diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h
index 634c0a9d219b..7ecab87cef02 100644
--- a/drivers/video/sis/init.h
+++ b/drivers/video/sis/init.h
@@ -73,7 +73,6 @@
73#ifdef SIS_CP 73#ifdef SIS_CP
74#undef SIS_CP 74#undef SIS_CP
75#endif 75#endif
76#include <linux/config.h>
77#include <linux/version.h> 76#include <linux/version.h>
78#include <linux/types.h> 77#include <linux/types.h>
79#include <asm/io.h> 78#include <asm/io.h>
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index c3e070a6effd..f13faddc6181 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -8043,8 +8043,8 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
8043 SiS_SetCH700x(SiS_Pr,0x01,0x28); 8043 SiS_SetCH700x(SiS_Pr,0x01,0x28);
8044 8044
8045 /* Set video bandwidth 8045 /* Set video bandwidth
8046 High bandwith Luma composite video filter(S0=1) 8046 High bandwidth Luma composite video filter(S0=1)
8047 low bandwith Luma S-video filter (S2-1=00) 8047 low bandwidth Luma S-video filter (S2-1=00)
8048 disable peak filter in S-video channel (S3=0) 8048 disable peak filter in S-video channel (S3=0)
8049 high bandwidth Chroma Filter (S5-4=11) 8049 high bandwidth Chroma Filter (S5-4=11)
8050 =00110001=0x31 8050 =00110001=0x31
diff --git a/drivers/video/sis/init301.h b/drivers/video/sis/init301.h
index f475b21a85cf..bc321dc57e92 100644
--- a/drivers/video/sis/init301.h
+++ b/drivers/video/sis/init301.h
@@ -67,7 +67,6 @@
67#ifdef SIS_CP 67#ifdef SIS_CP
68#undef SIS_CP 68#undef SIS_CP
69#endif 69#endif
70#include <linux/config.h>
71#include <linux/version.h> 70#include <linux/version.h>
72#include <linux/types.h> 71#include <linux/types.h>
73#include <asm/io.h> 72#include <asm/io.h>
diff --git a/drivers/video/sis/initextlfb.c b/drivers/video/sis/initextlfb.c
index cc856d90903c..09f5d758b6c0 100644
--- a/drivers/video/sis/initextlfb.c
+++ b/drivers/video/sis/initextlfb.c
@@ -30,7 +30,6 @@
30#include "vgatypes.h" 30#include "vgatypes.h"
31#include "vstruct.h" 31#include "vstruct.h"
32 32
33#include <linux/config.h>
34#include <linux/version.h> 33#include <linux/version.h>
35#include <linux/types.h> 34#include <linux/types.h>
36#include <linux/fb.h> 35#include <linux/fb.h>
diff --git a/drivers/video/sis/osdef.h b/drivers/video/sis/osdef.h
index 841ca3190cd4..f59568020eb2 100644
--- a/drivers/video/sis/osdef.h
+++ b/drivers/video/sis/osdef.h
@@ -90,7 +90,6 @@
90/**********************************************************************/ 90/**********************************************************************/
91 91
92#ifdef SIS_LINUX_KERNEL 92#ifdef SIS_LINUX_KERNEL
93#include <linux/config.h>
94#include <linux/version.h> 93#include <linux/version.h>
95 94
96#ifdef CONFIG_FB_SIS_300 95#ifdef CONFIG_FB_SIS_300
diff --git a/drivers/video/sis/sis.h b/drivers/video/sis/sis.h
index 0b6e625d7331..a259446ca7fe 100644
--- a/drivers/video/sis/sis.h
+++ b/drivers/video/sis/sis.h
@@ -24,7 +24,6 @@
24#ifndef _SIS_H_ 24#ifndef _SIS_H_
25#define _SIS_H_ 25#define _SIS_H_
26 26
27#include <linux/config.h>
28#include <linux/version.h> 27#include <linux/version.h>
29 28
30#include "osdef.h" 29#include "osdef.h"
diff --git a/drivers/video/sis/sis_accel.c b/drivers/video/sis/sis_accel.c
index bab933e6c6a6..3b7ce032e2ed 100644
--- a/drivers/video/sis/sis_accel.c
+++ b/drivers/video/sis/sis_accel.c
@@ -28,7 +28,6 @@
28 * for more information and updates) 28 * for more information and updates)
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/version.h> 31#include <linux/version.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index c63c0e721b82..b848ca7db7f9 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -33,7 +33,6 @@
33 * 33 *
34 */ 34 */
35 35
36#include <linux/config.h>
37#include <linux/version.h> 36#include <linux/version.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 38#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index c44de90ca12e..dad54e73147b 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -82,7 +82,6 @@
82 * Includes 82 * Includes
83 */ 83 */
84 84
85#include <linux/config.h>
86#include <linux/string.h> 85#include <linux/string.h>
87#include <linux/kernel.h> 86#include <linux/kernel.h>
88#include <linux/module.h> 87#include <linux/module.h>
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index 4a292aae6eb2..3e16e2d9d55d 100644
--- a/drivers/video/stifb.c
+++ b/drivers/video/stifb.c
@@ -54,7 +54,6 @@
54#undef DEBUG_STIFB_REGS /* debug sti register accesses */ 54#undef DEBUG_STIFB_REGS /* debug sti register accesses */
55 55
56 56
57#include <linux/config.h>
58#include <linux/module.h> 57#include <linux/module.h>
59#include <linux/kernel.h> 58#include <linux/kernel.h>
60#include <linux/errno.h> 59#include <linux/errno.h>
diff --git a/drivers/video/sun3fb.c b/drivers/video/sun3fb.c
index 9b36b9df535f..e046e20f02b9 100644
--- a/drivers/video/sun3fb.c
+++ b/drivers/video/sun3fb.c
@@ -25,7 +25,6 @@
25 * more details. 25 * more details.
26 */ 26 */
27 27
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/errno.h> 30#include <linux/errno.h>
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 5e5328d682db..239b1496874b 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -58,7 +58,6 @@
58 * 58 *
59 */ 59 */
60 60
61#include <linux/config.h>
62#include <linux/module.h> 61#include <linux/module.h>
63#include <linux/kernel.h> 62#include <linux/kernel.h>
64#include <linux/errno.h> 63#include <linux/errno.h>
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index 41f8c2d93892..14175cdb9c9c 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -15,7 +15,6 @@
15 * TGUI acceleration 15 * TGUI acceleration
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/fb.h> 19#include <linux/fb.h>
21#include <linux/init.h> 20#include <linux/init.h>
diff --git a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c
index 2bdeb4baa952..1d76c035050e 100644
--- a/drivers/video/valkyriefb.c
+++ b/drivers/video/valkyriefb.c
@@ -39,7 +39,6 @@
39 * more details. 39 * more details.
40 */ 40 */
41 41
42#include <linux/config.h>
43#include <linux/module.h> 42#include <linux/module.h>
44#include <linux/kernel.h> 43#include <linux/kernel.h>
45#include <linux/errno.h> 44#include <linux/errno.h>
diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c
index 15179ec62339..d94efafc77b5 100644
--- a/drivers/video/vgastate.c
+++ b/drivers/video/vgastate.c
@@ -13,7 +13,6 @@
13 * archive for more details. 13 * archive for more details.
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/fb.h> 18#include <linux/fb.h>
diff --git a/drivers/zorro/names.c b/drivers/zorro/names.c
index 0dd532d3a5d6..e8517c3d8e82 100644
--- a/drivers/zorro/names.c
+++ b/drivers/zorro/names.c
@@ -9,7 +9,6 @@
9 * David Mosberger-Tang, Martin Mares 9 * David Mosberger-Tang, Martin Mares
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/types.h> 14#include <linux/types.h>