aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/Kconfig4
-rw-r--r--drivers/acpi/processor_driver.c6
-rw-r--r--drivers/acpi/processor_thermal.c1
-rw-r--r--drivers/base/Makefile4
-rw-r--r--drivers/base/base.h12
-rw-r--r--drivers/base/bus.c293
-rw-r--r--drivers/base/class.c14
-rw-r--r--drivers/base/core.c85
-rw-r--r--drivers/base/cpu.c150
-rw-r--r--drivers/base/devtmpfs.c3
-rw-r--r--drivers/base/firmware_class.c14
-rw-r--r--drivers/base/init.c1
-rw-r--r--drivers/base/memory.c160
-rw-r--r--drivers/base/node.c154
-rw-r--r--drivers/base/platform.c2
-rw-r--r--drivers/base/sys.c10
-rw-r--r--drivers/base/topology.c51
-rw-r--r--drivers/bluetooth/ath3k.c14
-rw-r--r--drivers/bluetooth/bcm203x.c21
-rw-r--r--drivers/bluetooth/bfusb.c21
-rw-r--r--drivers/bluetooth/bpa10x.c15
-rw-r--r--drivers/bluetooth/btusb.c15
-rw-r--r--drivers/cpufreq/cpufreq.c79
-rw-r--r--drivers/cpufreq/cpufreq_stats.c1
-rw-r--r--drivers/cpuidle/cpuidle.c12
-rw-r--r--drivers/cpuidle/cpuidle.h10
-rw-r--r--drivers/cpuidle/sysfs.c74
-rw-r--r--drivers/edac/edac_core.h7
-rw-r--r--drivers/edac/edac_device.c1
-rw-r--r--drivers/edac/edac_device_sysfs.c20
-rw-r--r--drivers/edac/edac_mc.c1
-rw-r--r--drivers/edac/edac_mc_sysfs.c16
-rw-r--r--drivers/edac/edac_module.h2
-rw-r--r--drivers/edac/edac_pci.c1
-rw-r--r--drivers/edac/edac_pci_sysfs.c16
-rw-r--r--drivers/edac/edac_stub.c27
-rw-r--r--drivers/edac/mce_amd_inj.c13
-rw-r--r--drivers/firmware/google/gsmi.c3
-rw-r--r--drivers/gpio/gpio-samsung.c2
-rw-r--r--drivers/hid/usbhid/usbkbd.c17
-rw-r--r--drivers/hid/usbhid/usbmouse.c17
-rw-r--r--drivers/hv/Kconfig4
-rw-r--r--drivers/hv/channel_mgmt.c12
-rw-r--r--drivers/hv/hv.c8
-rw-r--r--drivers/hv/hyperv_vmbus.h1
-rw-r--r--drivers/hv/vmbus_drv.c30
-rw-r--r--drivers/i2c/busses/i2c-diolan-u2c.c15
-rw-r--r--drivers/i2c/busses/i2c-tiny-usb.c15
-rw-r--r--drivers/input/joystick/xpad.c13
-rw-r--r--drivers/input/misc/ati_remote2.c21
-rw-r--r--drivers/input/misc/keyspan_remote.c21
-rw-r--r--drivers/input/misc/powermate.c13
-rw-r--r--drivers/input/misc/yealink.c17
-rw-r--r--drivers/input/mouse/appletouch.c13
-rw-r--r--drivers/input/mouse/bcm5974.c14
-rw-r--r--drivers/input/tablet/acecad.c17
-rw-r--r--drivers/input/tablet/aiptek.c19
-rw-r--r--drivers/input/tablet/gtco.c28
-rw-r--r--drivers/input/tablet/hanwang.c13
-rw-r--r--drivers/input/tablet/kbtab.c20
-rw-r--r--drivers/input/tablet/wacom_sys.c19
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c13
-rw-r--r--drivers/isdn/hardware/mISDN/hfcsusb.c28
-rw-r--r--drivers/leds/led-class.c1
-rw-r--r--drivers/leds/led-triggers.c1
-rw-r--r--drivers/macintosh/smu.c4
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c20
-rw-r--r--drivers/media/dvb/dvb-usb/a800.c21
-rw-r--r--drivers/media/dvb/dvb-usb/af9015.c20
-rw-r--r--drivers/media/dvb/dvb-usb/anysee.c21
-rw-r--r--drivers/media/dvb/dvb-usb/au6610.c21
-rw-r--r--drivers/media/dvb/dvb-usb/az6027.c23
-rw-r--r--drivers/media/dvb/dvb-usb/ce6230.c22
-rw-r--r--drivers/media/dvb/dvb-usb/cinergyT2-core.c20
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c21
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_core.c22
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mb.c21
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mc.c21
-rw-r--r--drivers/media/dvb/dvb-usb/digitv.c21
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u.c21
-rw-r--r--drivers/media/dvb/dvb-usb/dtv5100.c21
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.c17
-rw-r--r--drivers/media/dvb/dvb-usb/ec168.c22
-rw-r--r--drivers/media/dvb/dvb-usb/friio.c23
-rw-r--r--drivers/media/dvb/dvb-usb/gl861.c21
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk.c21
-rw-r--r--drivers/media/dvb/dvb-usb/it913x.c21
-rw-r--r--drivers/media/dvb/dvb-usb/lmedm04.c21
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.c22
-rw-r--r--drivers/media/dvb/dvb-usb/mxl111sf.c19
-rw-r--r--drivers/media/dvb/dvb-usb/nova-t-usb2.c21
-rw-r--r--drivers/media/dvb/dvb-usb/opera1.c17
-rw-r--r--drivers/media/dvb/dvb-usb/pctv452e.c17
-rw-r--r--drivers/media/dvb/dvb-usb/technisat-usb2.c20
-rw-r--r--drivers/media/dvb/dvb-usb/ttusb2.c21
-rw-r--r--drivers/media/dvb/dvb-usb/umt-010.c21
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x.c21
-rw-r--r--drivers/media/dvb/dvb-usb/vp7045.c21
-rw-r--r--drivers/media/dvb/siano/smsusb.c21
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c21
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c21
-rw-r--r--drivers/media/radio/dsbr100.c16
-rw-r--r--drivers/media/radio/radio-mr800.c23
-rw-r--r--drivers/media/radio/si470x/radio-si470x-usb.c28
-rw-r--r--drivers/media/rc/ati_remote.c33
-rw-r--r--drivers/media/rc/imon.c21
-rw-r--r--drivers/media/rc/mceusb.c20
-rw-r--r--drivers/media/rc/redrat3.c20
-rw-r--r--drivers/media/rc/streamzap.c28
-rw-r--r--drivers/media/video/cx231xx/cx231xx-cards.c24
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c24
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c25
-rw-r--r--drivers/media/video/gspca/benq.c13
-rw-r--r--drivers/media/video/gspca/conex.c13
-rw-r--r--drivers/media/video/gspca/cpia1.c13
-rw-r--r--drivers/media/video/gspca/etoms.c14
-rw-r--r--drivers/media/video/gspca/finepix.c14
-rw-r--r--drivers/media/video/gspca/gl860/gl860.c17
-rw-r--r--drivers/media/video/gspca/jeilinj.c14
-rw-r--r--drivers/media/video/gspca/kinect.c14
-rw-r--r--drivers/media/video/gspca/konica.c13
-rw-r--r--drivers/media/video/gspca/m5602/m5602_core.c14
-rw-r--r--drivers/media/video/gspca/mars.c13
-rw-r--r--drivers/media/video/gspca/mr97310a.c13
-rw-r--r--drivers/media/video/gspca/nw80x.c13
-rw-r--r--drivers/media/video/gspca/ov519.c13
-rw-r--r--drivers/media/video/gspca/ov534.c14
-rw-r--r--drivers/media/video/gspca/ov534_9.c14
-rw-r--r--drivers/media/video/gspca/pac207.c13
-rw-r--r--drivers/media/video/gspca/pac7302.c13
-rw-r--r--drivers/media/video/gspca/pac7311.c13
-rw-r--r--drivers/media/video/gspca/se401.c13
-rw-r--r--drivers/media/video/gspca/sn9c2028.c14
-rw-r--r--drivers/media/video/gspca/sn9c20x.c13
-rw-r--r--drivers/media/video/gspca/sonixb.c13
-rw-r--r--drivers/media/video/gspca/sonixj.c13
-rw-r--r--drivers/media/video/gspca/spca1528.c13
-rw-r--r--drivers/media/video/gspca/spca500.c13
-rw-r--r--drivers/media/video/gspca/spca501.c13
-rw-r--r--drivers/media/video/gspca/spca505.c13
-rw-r--r--drivers/media/video/gspca/spca506.c19
-rw-r--r--drivers/media/video/gspca/spca508.c13
-rw-r--r--drivers/media/video/gspca/spca561.c13
-rw-r--r--drivers/media/video/gspca/sq905.c14
-rw-r--r--drivers/media/video/gspca/sq905c.c14
-rw-r--r--drivers/media/video/gspca/sq930x.c13
-rw-r--r--drivers/media/video/gspca/stk014.c13
-rw-r--r--drivers/media/video/gspca/stv0680.c13
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx.c13
-rw-r--r--drivers/media/video/gspca/sunplus.c13
-rw-r--r--drivers/media/video/gspca/t613.c13
-rw-r--r--drivers/media/video/gspca/topro.c13
-rw-r--r--drivers/media/video/gspca/tv8532.c14
-rw-r--r--drivers/media/video/gspca/vc032x.c13
-rw-r--r--drivers/media/video/gspca/vicam.c14
-rw-r--r--drivers/media/video/gspca/xirlink_cit.c13
-rw-r--r--drivers/media/video/gspca/zc3xx.c13
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c21
-rw-r--r--drivers/media/video/s2255drv.c20
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c25
-rw-r--r--drivers/media/video/stk-webcam.c23
-rw-r--r--drivers/media/video/tm6000/tm6000-cards.c26
-rw-r--r--drivers/media/video/zr364xx.c23
-rw-r--r--drivers/mmc/host/ushc.c12
-rw-r--r--drivers/mtd/nand/alauda.c13
-rw-r--r--drivers/net/bonding/bond_sysfs.c1
-rw-r--r--drivers/net/can/usb/ems_usb.c26
-rw-r--r--drivers/net/can/usb/esd_usb2.c23
-rw-r--r--drivers/net/irda/irda-usb.c35
-rw-r--r--drivers/net/irda/kingsun-sir.c19
-rw-r--r--drivers/net/irda/ks959-sir.c21
-rw-r--r--drivers/net/irda/ksdazzle-sir.c21
-rw-r--r--drivers/net/irda/mcs7780.c23
-rw-r--r--drivers/net/irda/stir4200.c19
-rw-r--r--drivers/net/usb/asix.c12
-rw-r--r--drivers/net/usb/catc.c17
-rw-r--r--drivers/net/usb/cdc-phonet.c13
-rw-r--r--drivers/net/usb/cdc_eem.c13
-rw-r--r--drivers/net/usb/cdc_ether.c19
-rw-r--r--drivers/net/usb/cdc_ncm.c15
-rw-r--r--drivers/net/usb/cdc_subset.c12
-rw-r--r--drivers/net/usb/cx82310_eth.c12
-rw-r--r--drivers/net/usb/dm9601.c13
-rw-r--r--drivers/net/usb/gl620a.c12
-rw-r--r--drivers/net/usb/int51x1.c12
-rw-r--r--drivers/net/usb/ipheth.c20
-rw-r--r--drivers/net/usb/kalmia.c12
-rw-r--r--drivers/net/usb/kaweth.c30
-rw-r--r--drivers/net/usb/lg-vl600.c12
-rw-r--r--drivers/net/usb/mcs7830.c12
-rw-r--r--drivers/net/usb/net1080.c12
-rw-r--r--drivers/net/usb/plusb.c12
-rw-r--r--drivers/net/usb/rndis_host.c12
-rw-r--r--drivers/net/usb/rtl8150.c15
-rw-r--r--drivers/net/usb/sierra_net.c19
-rw-r--r--drivers/net/usb/smsc75xx.c12
-rw-r--r--drivers/net/usb/smsc95xx.c12
-rw-r--r--drivers/net/usb/zaurus.c12
-rw-r--r--drivers/net/wireless/ath/carl9170/usb.c13
-rw-r--r--drivers/net/wireless/libertas/if_usb.c24
-rw-r--r--drivers/net/wireless/libertas_tf/if_usb.c22
-rw-r--r--drivers/net/wireless/orinoco/orinoco_usb.c27
-rw-r--r--drivers/net/wireless/p54/p54usb.c13
-rw-r--r--drivers/net/wireless/rndis_wlan.c12
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c13
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c13
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c13
-rw-r--r--drivers/net/wireless/zd1201.c13
-rw-r--r--drivers/nfc/pn533.c19
-rw-r--r--drivers/platform/x86/ibm_rtl.c34
-rw-r--r--drivers/platform/x86/intel_scu_ipc.c2
-rw-r--r--drivers/s390/block/xpram.c2
-rw-r--r--drivers/s390/char/sclp_config.c8
-rw-r--r--drivers/sh/intc/core.c29
-rw-r--r--drivers/sh/intc/internals.h6
-rw-r--r--drivers/sh/intc/userimask.c16
-rw-r--r--drivers/staging/frontier/alphatrack.c28
-rw-r--r--drivers/staging/frontier/tranzport.c27
-rw-r--r--drivers/staging/ft1000/ft1000-usb/ft1000_usb.c22
-rw-r--r--drivers/staging/iio/accel/adis16201_core.c13
-rw-r--r--drivers/staging/iio/accel/adis16203_core.c13
-rw-r--r--drivers/staging/iio/accel/adis16204_core.c13
-rw-r--r--drivers/staging/iio/accel/adis16209_core.c13
-rw-r--r--drivers/staging/iio/accel/adis16220_core.c13
-rw-r--r--drivers/staging/iio/accel/adis16240_core.c13
-rw-r--r--drivers/staging/iio/accel/kxsd9.c13
-rw-r--r--drivers/staging/iio/accel/lis3l02dq_core.c13
-rw-r--r--drivers/staging/iio/accel/sca3000_core.c13
-rw-r--r--drivers/staging/iio/adc/ad7192.c13
-rw-r--r--drivers/staging/iio/adc/ad7280a.c13
-rw-r--r--drivers/staging/iio/adc/ad7291.c14
-rw-r--r--drivers/staging/iio/adc/ad7298_core.c13
-rw-r--r--drivers/staging/iio/adc/ad7476_core.c13
-rw-r--r--drivers/staging/iio/adc/ad7606_spi.c13
-rw-r--r--drivers/staging/iio/adc/ad7780.c13
-rw-r--r--drivers/staging/iio/adc/ad7793.c13
-rw-r--r--drivers/staging/iio/adc/ad7816.c14
-rw-r--r--drivers/staging/iio/adc/ad7887_core.c13
-rw-r--r--drivers/staging/iio/adc/ad799x_core.c14
-rw-r--r--drivers/staging/iio/adc/adt7310.c14
-rw-r--r--drivers/staging/iio/adc/adt7410.c14
-rw-r--r--drivers/staging/iio/adc/max1363_core.c14
-rw-r--r--drivers/staging/iio/addac/adt7316-i2c.c14
-rw-r--r--drivers/staging/iio/addac/adt7316-spi.c14
-rw-r--r--drivers/staging/iio/cdc/ad7150.c14
-rw-r--r--drivers/staging/iio/cdc/ad7152.c14
-rw-r--r--drivers/staging/iio/cdc/ad7746.c14
-rw-r--r--drivers/staging/iio/dac/ad5064.c13
-rw-r--r--drivers/staging/iio/dac/ad5360.c13
-rw-r--r--drivers/staging/iio/dac/ad5446.c13
-rw-r--r--drivers/staging/iio/dac/ad5504.c13
-rw-r--r--drivers/staging/iio/dac/ad5624r_spi.c13
-rw-r--r--drivers/staging/iio/dac/ad5686.c13
-rw-r--r--drivers/staging/iio/dac/ad5791.c13
-rw-r--r--drivers/staging/iio/dac/max517.c14
-rw-r--r--drivers/staging/iio/dds/ad5930.c13
-rw-r--r--drivers/staging/iio/dds/ad9832.c13
-rw-r--r--drivers/staging/iio/dds/ad9834.c13
-rw-r--r--drivers/staging/iio/dds/ad9850.c13
-rw-r--r--drivers/staging/iio/dds/ad9852.c13
-rw-r--r--drivers/staging/iio/dds/ad9910.c13
-rw-r--r--drivers/staging/iio/dds/ad9951.c13
-rw-r--r--drivers/staging/iio/gyro/adis16080_core.c13
-rw-r--r--drivers/staging/iio/gyro/adis16130_core.c13
-rw-r--r--drivers/staging/iio/gyro/adis16260_core.c13
-rw-r--r--drivers/staging/iio/gyro/adxrs450_core.c13
-rw-r--r--drivers/staging/iio/impedance-analyzer/ad5933.c13
-rw-r--r--drivers/staging/iio/imu/adis16400_core.c13
-rw-r--r--drivers/staging/iio/light/isl29018.c14
-rw-r--r--drivers/staging/iio/light/tsl2563.c14
-rw-r--r--drivers/staging/iio/light/tsl2583.c14
-rw-r--r--drivers/staging/iio/magnetometer/ak8975.c14
-rw-r--r--drivers/staging/iio/magnetometer/hmc5843.c14
-rw-r--r--drivers/staging/iio/meter/ade7753.c13
-rw-r--r--drivers/staging/iio/meter/ade7754.c13
-rw-r--r--drivers/staging/iio/meter/ade7758_core.c13
-rw-r--r--drivers/staging/iio/meter/ade7759.c13
-rw-r--r--drivers/staging/iio/meter/ade7854-i2c.c14
-rw-r--r--drivers/staging/iio/meter/ade7854-spi.c13
-rw-r--r--drivers/staging/iio/resolver/ad2s1200.c13
-rw-r--r--drivers/staging/iio/resolver/ad2s1210.c13
-rw-r--r--drivers/staging/iio/resolver/ad2s90.c13
-rw-r--r--drivers/staging/keucr/usb.c24
-rw-r--r--drivers/staging/media/go7007/go7007-usb.c15
-rw-r--r--drivers/staging/media/lirc/lirc_igorplugusb.c21
-rw-r--r--drivers/staging/media/lirc/lirc_imon.c24
-rw-r--r--drivers/staging/media/lirc/lirc_sasem.c25
-rw-r--r--drivers/staging/media/lirc/lirc_ttusbir.c22
-rw-r--r--drivers/staging/rts5139/rts51x.c32
-rw-r--r--drivers/staging/vt6656/main_usb.c14
-rw-r--r--drivers/staging/winbond/wbusb.c13
-rw-r--r--drivers/staging/wlan-ng/prism2usb.c14
-rw-r--r--drivers/uio/uio_pdrv.c12
-rw-r--r--drivers/uio/uio_pdrv_genirq.c13
-rw-r--r--drivers/uio/uio_pruss.c14
-rw-r--r--drivers/usb/atm/cxacru.c13
-rw-r--r--drivers/usb/atm/speedtch.c17
-rw-r--r--drivers/usb/atm/ueagle-atm.c31
-rw-r--r--drivers/usb/class/cdc-wdm.c19
-rw-r--r--drivers/usb/class/usblp.c13
-rw-r--r--drivers/usb/class/usbtmc.c17
-rw-r--r--drivers/usb/dwc3/debugfs.c16
-rw-r--r--drivers/usb/host/hwa-hc.c13
-rw-r--r--drivers/usb/image/microtek.c14
-rw-r--r--drivers/usb/misc/adutux.c35
-rw-r--r--drivers/usb/misc/cypress_cy7c63.c22
-rw-r--r--drivers/usb/misc/cytherm.c26
-rw-r--r--drivers/usb/misc/emi26.c13
-rw-r--r--drivers/usb/misc/emi62.c17
-rw-r--r--drivers/usb/misc/idmouse.c24
-rw-r--r--drivers/usb/misc/iowarrior.c13
-rw-r--r--drivers/usb/misc/isight_firmware.c13
-rw-r--r--drivers/usb/misc/ldusb.c27
-rw-r--r--drivers/usb/misc/legousbtower.c46
-rw-r--r--drivers/usb/misc/rio500.c28
-rw-r--r--drivers/usb/misc/trancevibrator.c21
-rw-r--r--drivers/usb/misc/usblcd.c20
-rw-r--r--drivers/usb/misc/usbled.c18
-rw-r--r--drivers/usb/misc/usbsevseg.c18
-rw-r--r--drivers/usb/misc/yurex.c22
-rw-r--r--drivers/usb/storage/alauda.c13
-rw-r--r--drivers/usb/storage/cypress_atacb.c13
-rw-r--r--drivers/usb/storage/datafab.c13
-rw-r--r--drivers/usb/storage/ene_ub6250.c13
-rw-r--r--drivers/usb/storage/freecom.c13
-rw-r--r--drivers/usb/storage/isd200.c13
-rw-r--r--drivers/usb/storage/jumpshot.c13
-rw-r--r--drivers/usb/storage/karma.c13
-rw-r--r--drivers/usb/storage/onetouch.c13
-rw-r--r--drivers/usb/storage/realtek_cr.c13
-rw-r--r--drivers/usb/storage/sddr09.c13
-rw-r--r--drivers/usb/storage/sddr55.c13
-rw-r--r--drivers/usb/storage/shuttle_usbat.c13
-rw-r--r--drivers/usb/storage/uas.c13
-rw-r--r--drivers/usb/usb-skeleton.c21
-rw-r--r--drivers/usb/wusbcore/cbaf.c12
-rw-r--r--drivers/uwb/hwa-rc.c12
-rw-r--r--drivers/uwb/i1480/dfu/usb.c20
-rw-r--r--drivers/video/smscufx.c19
-rw-r--r--drivers/video/udlfb.c19
-rw-r--r--drivers/w1/masters/ds2490.c21
-rw-r--r--drivers/w1/slaves/w1_therm.c36
-rw-r--r--drivers/w1/w1.c10
-rw-r--r--drivers/watchdog/pcwd_usb.c35
-rw-r--r--drivers/xen/xen-balloon.c86
-rw-r--r--drivers/xen/xen-selfballoon.c76
348 files changed, 1280 insertions, 5263 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig
index b5e6f243f749..5afe5d1f199b 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -116,6 +116,8 @@ source "drivers/vlynq/Kconfig"
116 116
117source "drivers/virtio/Kconfig" 117source "drivers/virtio/Kconfig"
118 118
119source "drivers/hv/Kconfig"
120
119source "drivers/xen/Kconfig" 121source "drivers/xen/Kconfig"
120 122
121source "drivers/staging/Kconfig" 123source "drivers/staging/Kconfig"
@@ -132,8 +134,6 @@ source "drivers/iommu/Kconfig"
132 134
133source "drivers/virt/Kconfig" 135source "drivers/virt/Kconfig"
134 136
135source "drivers/hv/Kconfig"
136
137source "drivers/devfreq/Kconfig" 137source "drivers/devfreq/Kconfig"
138 138
139endmenu 139endmenu
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 9d7bc9f6b6cc..20a68ca386de 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -446,7 +446,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
446{ 446{
447 struct acpi_processor *pr = NULL; 447 struct acpi_processor *pr = NULL;
448 int result = 0; 448 int result = 0;
449 struct sys_device *sysdev; 449 struct device *dev;
450 450
451 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); 451 pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
452 if (!pr) 452 if (!pr)
@@ -491,8 +491,8 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
491 491
492 per_cpu(processors, pr->id) = pr; 492 per_cpu(processors, pr->id) = pr;
493 493
494 sysdev = get_cpu_sysdev(pr->id); 494 dev = get_cpu_device(pr->id);
495 if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { 495 if (sysfs_create_link(&device->dev.kobj, &dev->kobj, "sysdev")) {
496 result = -EFAULT; 496 result = -EFAULT;
497 goto err_free_cpumask; 497 goto err_free_cpumask;
498 } 498 }
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index 870550d6a4bf..3b599abf2b40 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/cpufreq.h> 32#include <linux/cpufreq.h>
33#include <linux/sysdev.h>
34 33
35#include <asm/uaccess.h> 34#include <asm/uaccess.h>
36 35
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 99a375ad2cc9..1334d893b560 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -3,7 +3,8 @@
3obj-y := core.o sys.o bus.o dd.o syscore.o \ 3obj-y := core.o sys.o bus.o dd.o syscore.o \
4 driver.o class.o platform.o \ 4 driver.o class.o platform.o \
5 cpu.o firmware.o init.o map.o devres.o \ 5 cpu.o firmware.o init.o map.o devres.o \
6 attribute_container.o transport_class.o 6 attribute_container.o transport_class.o \
7 topology.o
7obj-$(CONFIG_DEVTMPFS) += devtmpfs.o 8obj-$(CONFIG_DEVTMPFS) += devtmpfs.o
8obj-y += power/ 9obj-y += power/
9obj-$(CONFIG_HAS_DMA) += dma-mapping.o 10obj-$(CONFIG_HAS_DMA) += dma-mapping.o
@@ -12,7 +13,6 @@ obj-$(CONFIG_ISA) += isa.o
12obj-$(CONFIG_FW_LOADER) += firmware_class.o 13obj-$(CONFIG_FW_LOADER) += firmware_class.o
13obj-$(CONFIG_NUMA) += node.o 14obj-$(CONFIG_NUMA) += node.o
14obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o 15obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
15obj-$(CONFIG_SMP) += topology.o
16ifeq ($(CONFIG_SYSFS),y) 16ifeq ($(CONFIG_SYSFS),y)
17obj-$(CONFIG_MODULES) += module.o 17obj-$(CONFIG_MODULES) += module.o
18endif 18endif
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 21c1b96c34c6..7a6ae4228761 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -4,7 +4,9 @@
4 * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure. 4 * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure.
5 * 5 *
6 * @subsys - the struct kset that defines this subsystem 6 * @subsys - the struct kset that defines this subsystem
7 * @devices_kset - the list of devices associated 7 * @devices_kset - the subsystem's 'devices' directory
8 * @interfaces - list of subsystem interfaces associated
9 * @mutex - protect the devices, and interfaces lists.
8 * 10 *
9 * @drivers_kset - the list of drivers associated 11 * @drivers_kset - the list of drivers associated
10 * @klist_devices - the klist to iterate over the @devices_kset 12 * @klist_devices - the klist to iterate over the @devices_kset
@@ -14,10 +16,8 @@
14 * @bus - pointer back to the struct bus_type that this structure is associated 16 * @bus - pointer back to the struct bus_type that this structure is associated
15 * with. 17 * with.
16 * 18 *
17 * @class_interfaces - list of class_interfaces associated
18 * @glue_dirs - "glue" directory to put in-between the parent device to 19 * @glue_dirs - "glue" directory to put in-between the parent device to
19 * avoid namespace conflicts 20 * avoid namespace conflicts
20 * @class_mutex - mutex to protect the children, devices, and interfaces lists.
21 * @class - pointer back to the struct class that this structure is associated 21 * @class - pointer back to the struct class that this structure is associated
22 * with. 22 * with.
23 * 23 *
@@ -28,6 +28,8 @@
28struct subsys_private { 28struct subsys_private {
29 struct kset subsys; 29 struct kset subsys;
30 struct kset *devices_kset; 30 struct kset *devices_kset;
31 struct list_head interfaces;
32 struct mutex mutex;
31 33
32 struct kset *drivers_kset; 34 struct kset *drivers_kset;
33 struct klist klist_devices; 35 struct klist klist_devices;
@@ -36,9 +38,7 @@ struct subsys_private {
36 unsigned int drivers_autoprobe:1; 38 unsigned int drivers_autoprobe:1;
37 struct bus_type *bus; 39 struct bus_type *bus;
38 40
39 struct list_head class_interfaces;
40 struct kset glue_dirs; 41 struct kset glue_dirs;
41 struct mutex class_mutex;
42 struct class *class; 42 struct class *class;
43}; 43};
44#define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj) 44#define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj)
@@ -94,7 +94,6 @@ extern int hypervisor_init(void);
94static inline int hypervisor_init(void) { return 0; } 94static inline int hypervisor_init(void) { return 0; }
95#endif 95#endif
96extern int platform_bus_init(void); 96extern int platform_bus_init(void);
97extern int system_bus_init(void);
98extern int cpu_dev_init(void); 97extern int cpu_dev_init(void);
99 98
100extern int bus_add_device(struct device *dev); 99extern int bus_add_device(struct device *dev);
@@ -116,6 +115,7 @@ extern char *make_class_name(const char *name, struct kobject *kobj);
116 115
117extern int devres_release_all(struct device *dev); 116extern int devres_release_all(struct device *dev);
118 117
118/* /sys/devices directory */
119extern struct kset *devices_kset; 119extern struct kset *devices_kset;
120 120
121#if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS) 121#if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 000e7b2006f8..99dc5921e1dd 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -16,9 +16,14 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mutex.h>
19#include "base.h" 20#include "base.h"
20#include "power/power.h" 21#include "power/power.h"
21 22
23/* /sys/devices/system */
24/* FIXME: make static after drivers/base/sys.c is deleted */
25struct kset *system_kset;
26
22#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) 27#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr)
23 28
24/* 29/*
@@ -360,6 +365,47 @@ struct device *bus_find_device_by_name(struct bus_type *bus,
360} 365}
361EXPORT_SYMBOL_GPL(bus_find_device_by_name); 366EXPORT_SYMBOL_GPL(bus_find_device_by_name);
362 367
368/**
369 * subsys_find_device_by_id - find a device with a specific enumeration number
370 * @subsys: subsystem
371 * @id: index 'id' in struct device
372 * @hint: device to check first
373 *
374 * Check the hint's next object and if it is a match return it directly,
375 * otherwise, fall back to a full list search. Either way a reference for
376 * the returned object is taken.
377 */
378struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id,
379 struct device *hint)
380{
381 struct klist_iter i;
382 struct device *dev;
383
384 if (!subsys)
385 return NULL;
386
387 if (hint) {
388 klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus);
389 dev = next_device(&i);
390 if (dev && dev->id == id && get_device(dev)) {
391 klist_iter_exit(&i);
392 return dev;
393 }
394 klist_iter_exit(&i);
395 }
396
397 klist_iter_init_node(&subsys->p->klist_devices, &i, NULL);
398 while ((dev = next_device(&i))) {
399 if (dev->id == id && get_device(dev)) {
400 klist_iter_exit(&i);
401 return dev;
402 }
403 }
404 klist_iter_exit(&i);
405 return NULL;
406}
407EXPORT_SYMBOL_GPL(subsys_find_device_by_id);
408
363static struct device_driver *next_driver(struct klist_iter *i) 409static struct device_driver *next_driver(struct klist_iter *i)
364{ 410{
365 struct klist_node *n = klist_next(i); 411 struct klist_node *n = klist_next(i);
@@ -487,38 +533,59 @@ out_put:
487void bus_probe_device(struct device *dev) 533void bus_probe_device(struct device *dev)
488{ 534{
489 struct bus_type *bus = dev->bus; 535 struct bus_type *bus = dev->bus;
536 struct subsys_interface *sif;
490 int ret; 537 int ret;
491 538
492 if (bus && bus->p->drivers_autoprobe) { 539 if (!bus)
540 return;
541
542 if (bus->p->drivers_autoprobe) {
493 ret = device_attach(dev); 543 ret = device_attach(dev);
494 WARN_ON(ret < 0); 544 WARN_ON(ret < 0);
495 } 545 }
546
547 mutex_lock(&bus->p->mutex);
548 list_for_each_entry(sif, &bus->p->interfaces, node)
549 if (sif->add_dev)
550 sif->add_dev(dev, sif);
551 mutex_unlock(&bus->p->mutex);
496} 552}
497 553
498/** 554/**
499 * bus_remove_device - remove device from bus 555 * bus_remove_device - remove device from bus
500 * @dev: device to be removed 556 * @dev: device to be removed
501 * 557 *
502 * - Remove symlink from bus's directory. 558 * - Remove device from all interfaces.
559 * - Remove symlink from bus' directory.
503 * - Delete device from bus's list. 560 * - Delete device from bus's list.
504 * - Detach from its driver. 561 * - Detach from its driver.
505 * - Drop reference taken in bus_add_device(). 562 * - Drop reference taken in bus_add_device().
506 */ 563 */
507void bus_remove_device(struct device *dev) 564void bus_remove_device(struct device *dev)
508{ 565{
509 if (dev->bus) { 566 struct bus_type *bus = dev->bus;
510 sysfs_remove_link(&dev->kobj, "subsystem"); 567 struct subsys_interface *sif;
511 sysfs_remove_link(&dev->bus->p->devices_kset->kobj, 568
512 dev_name(dev)); 569 if (!bus)
513 device_remove_attrs(dev->bus, dev); 570 return;
514 if (klist_node_attached(&dev->p->knode_bus)) 571
515 klist_del(&dev->p->knode_bus); 572 mutex_lock(&bus->p->mutex);
516 573 list_for_each_entry(sif, &bus->p->interfaces, node)
517 pr_debug("bus: '%s': remove device %s\n", 574 if (sif->remove_dev)
518 dev->bus->name, dev_name(dev)); 575 sif->remove_dev(dev, sif);
519 device_release_driver(dev); 576 mutex_unlock(&bus->p->mutex);
520 bus_put(dev->bus); 577
521 } 578 sysfs_remove_link(&dev->kobj, "subsystem");
579 sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
580 dev_name(dev));
581 device_remove_attrs(dev->bus, dev);
582 if (klist_node_attached(&dev->p->knode_bus))
583 klist_del(&dev->p->knode_bus);
584
585 pr_debug("bus: '%s': remove device %s\n",
586 dev->bus->name, dev_name(dev));
587 device_release_driver(dev);
588 bus_put(dev->bus);
522} 589}
523 590
524static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv) 591static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv)
@@ -847,14 +914,14 @@ static ssize_t bus_uevent_store(struct bus_type *bus,
847static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store); 914static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store);
848 915
849/** 916/**
850 * bus_register - register a bus with the system. 917 * __bus_register - register a driver-core subsystem
851 * @bus: bus. 918 * @bus: bus.
852 * 919 *
853 * Once we have that, we registered the bus with the kobject 920 * Once we have that, we registered the bus with the kobject
854 * infrastructure, then register the children subsystems it has: 921 * infrastructure, then register the children subsystems it has:
855 * the devices and drivers that belong to the bus. 922 * the devices and drivers that belong to the subsystem.
856 */ 923 */
857int bus_register(struct bus_type *bus) 924int __bus_register(struct bus_type *bus, struct lock_class_key *key)
858{ 925{
859 int retval; 926 int retval;
860 struct subsys_private *priv; 927 struct subsys_private *priv;
@@ -898,6 +965,8 @@ int bus_register(struct bus_type *bus)
898 goto bus_drivers_fail; 965 goto bus_drivers_fail;
899 } 966 }
900 967
968 INIT_LIST_HEAD(&priv->interfaces);
969 __mutex_init(&priv->mutex, "subsys mutex", key);
901 klist_init(&priv->klist_devices, klist_devices_get, klist_devices_put); 970 klist_init(&priv->klist_devices, klist_devices_get, klist_devices_put);
902 klist_init(&priv->klist_drivers, NULL, NULL); 971 klist_init(&priv->klist_drivers, NULL, NULL);
903 972
@@ -927,7 +996,7 @@ out:
927 bus->p = NULL; 996 bus->p = NULL;
928 return retval; 997 return retval;
929} 998}
930EXPORT_SYMBOL_GPL(bus_register); 999EXPORT_SYMBOL_GPL(__bus_register);
931 1000
932/** 1001/**
933 * bus_unregister - remove a bus from the system 1002 * bus_unregister - remove a bus from the system
@@ -939,6 +1008,8 @@ EXPORT_SYMBOL_GPL(bus_register);
939void bus_unregister(struct bus_type *bus) 1008void bus_unregister(struct bus_type *bus)
940{ 1009{
941 pr_debug("bus: '%s': unregistering\n", bus->name); 1010 pr_debug("bus: '%s': unregistering\n", bus->name);
1011 if (bus->dev_root)
1012 device_unregister(bus->dev_root);
942 bus_remove_attrs(bus); 1013 bus_remove_attrs(bus);
943 remove_probe_files(bus); 1014 remove_probe_files(bus);
944 kset_unregister(bus->p->drivers_kset); 1015 kset_unregister(bus->p->drivers_kset);
@@ -1028,10 +1099,194 @@ void bus_sort_breadthfirst(struct bus_type *bus,
1028} 1099}
1029EXPORT_SYMBOL_GPL(bus_sort_breadthfirst); 1100EXPORT_SYMBOL_GPL(bus_sort_breadthfirst);
1030 1101
1102/**
1103 * subsys_dev_iter_init - initialize subsys device iterator
1104 * @iter: subsys iterator to initialize
1105 * @subsys: the subsys we wanna iterate over
1106 * @start: the device to start iterating from, if any
1107 * @type: device_type of the devices to iterate over, NULL for all
1108 *
1109 * Initialize subsys iterator @iter such that it iterates over devices
1110 * of @subsys. If @start is set, the list iteration will start there,
1111 * otherwise if it is NULL, the iteration starts at the beginning of
1112 * the list.
1113 */
1114void subsys_dev_iter_init(struct subsys_dev_iter *iter, struct bus_type *subsys,
1115 struct device *start, const struct device_type *type)
1116{
1117 struct klist_node *start_knode = NULL;
1118
1119 if (start)
1120 start_knode = &start->p->knode_bus;
1121 klist_iter_init_node(&subsys->p->klist_devices, &iter->ki, start_knode);
1122 iter->type = type;
1123}
1124EXPORT_SYMBOL_GPL(subsys_dev_iter_init);
1125
1126/**
1127 * subsys_dev_iter_next - iterate to the next device
1128 * @iter: subsys iterator to proceed
1129 *
1130 * Proceed @iter to the next device and return it. Returns NULL if
1131 * iteration is complete.
1132 *
1133 * The returned device is referenced and won't be released till
1134 * iterator is proceed to the next device or exited. The caller is
1135 * free to do whatever it wants to do with the device including
1136 * calling back into subsys code.
1137 */
1138struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
1139{
1140 struct klist_node *knode;
1141 struct device *dev;
1142
1143 for (;;) {
1144 knode = klist_next(&iter->ki);
1145 if (!knode)
1146 return NULL;
1147 dev = container_of(knode, struct device_private, knode_bus)->device;
1148 if (!iter->type || iter->type == dev->type)
1149 return dev;
1150 }
1151}
1152EXPORT_SYMBOL_GPL(subsys_dev_iter_next);
1153
1154/**
1155 * subsys_dev_iter_exit - finish iteration
1156 * @iter: subsys iterator to finish
1157 *
1158 * Finish an iteration. Always call this function after iteration is
1159 * complete whether the iteration ran till the end or not.
1160 */
1161void subsys_dev_iter_exit(struct subsys_dev_iter *iter)
1162{
1163 klist_iter_exit(&iter->ki);
1164}
1165EXPORT_SYMBOL_GPL(subsys_dev_iter_exit);
1166
1167int subsys_interface_register(struct subsys_interface *sif)
1168{
1169 struct bus_type *subsys;
1170 struct subsys_dev_iter iter;
1171 struct device *dev;
1172
1173 if (!sif || !sif->subsys)
1174 return -ENODEV;
1175
1176 subsys = bus_get(sif->subsys);
1177 if (!subsys)
1178 return -EINVAL;
1179
1180 mutex_lock(&subsys->p->mutex);
1181 list_add_tail(&sif->node, &subsys->p->interfaces);
1182 if (sif->add_dev) {
1183 subsys_dev_iter_init(&iter, subsys, NULL, NULL);
1184 while ((dev = subsys_dev_iter_next(&iter)))
1185 sif->add_dev(dev, sif);
1186 subsys_dev_iter_exit(&iter);
1187 }
1188 mutex_unlock(&subsys->p->mutex);
1189
1190 return 0;
1191}
1192EXPORT_SYMBOL_GPL(subsys_interface_register);
1193
1194void subsys_interface_unregister(struct subsys_interface *sif)
1195{
1196 struct bus_type *subsys = sif->subsys;
1197 struct subsys_dev_iter iter;
1198 struct device *dev;
1199
1200 if (!sif)
1201 return;
1202
1203 mutex_lock(&subsys->p->mutex);
1204 list_del_init(&sif->node);
1205 if (sif->remove_dev) {
1206 subsys_dev_iter_init(&iter, subsys, NULL, NULL);
1207 while ((dev = subsys_dev_iter_next(&iter)))
1208 sif->remove_dev(dev, sif);
1209 subsys_dev_iter_exit(&iter);
1210 }
1211 mutex_unlock(&subsys->p->mutex);
1212
1213 bus_put(subsys);
1214}
1215EXPORT_SYMBOL_GPL(subsys_interface_unregister);
1216
1217static void system_root_device_release(struct device *dev)
1218{
1219 kfree(dev);
1220}
1221/**
1222 * subsys_system_register - register a subsystem at /sys/devices/system/
1223 * @subsys - system subsystem
1224 * @groups - default attributes for the root device
1225 *
1226 * All 'system' subsystems have a /sys/devices/system/<name> root device
1227 * with the name of the subsystem. The root device can carry subsystem-
1228 * wide attributes. All registered devices are below this single root
1229 * device and are named after the subsystem with a simple enumeration
1230 * number appended. The registered devices are not explicitely named;
1231 * only 'id' in the device needs to be set.
1232 *
1233 * Do not use this interface for anything new, it exists for compatibility
1234 * with bad ideas only. New subsystems should use plain subsystems; and
1235 * add the subsystem-wide attributes should be added to the subsystem
1236 * directory itself and not some create fake root-device placed in
1237 * /sys/devices/system/<name>.
1238 */
1239int subsys_system_register(struct bus_type *subsys,
1240 const struct attribute_group **groups)
1241{
1242 struct device *dev;
1243 int err;
1244
1245 err = bus_register(subsys);
1246 if (err < 0)
1247 return err;
1248
1249 dev = kzalloc(sizeof(struct device), GFP_KERNEL);
1250 if (!dev) {
1251 err = -ENOMEM;
1252 goto err_dev;
1253 }
1254
1255 err = dev_set_name(dev, "%s", subsys->name);
1256 if (err < 0)
1257 goto err_name;
1258
1259 dev->kobj.parent = &system_kset->kobj;
1260 dev->groups = groups;
1261 dev->release = system_root_device_release;
1262
1263 err = device_register(dev);
1264 if (err < 0)
1265 goto err_dev_reg;
1266
1267 subsys->dev_root = dev;
1268 return 0;
1269
1270err_dev_reg:
1271 put_device(dev);
1272 dev = NULL;
1273err_name:
1274 kfree(dev);
1275err_dev:
1276 bus_unregister(subsys);
1277 return err;
1278}
1279EXPORT_SYMBOL_GPL(subsys_system_register);
1280
1031int __init buses_init(void) 1281int __init buses_init(void)
1032{ 1282{
1033 bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL); 1283 bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL);
1034 if (!bus_kset) 1284 if (!bus_kset)
1035 return -ENOMEM; 1285 return -ENOMEM;
1286
1287 system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
1288 if (!system_kset)
1289 return -ENOMEM;
1290
1036 return 0; 1291 return 0;
1037} 1292}
diff --git a/drivers/base/class.c b/drivers/base/class.c
index b80d91cc8c3a..03243d4002fd 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -184,9 +184,9 @@ int __class_register(struct class *cls, struct lock_class_key *key)
184 if (!cp) 184 if (!cp)
185 return -ENOMEM; 185 return -ENOMEM;
186 klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); 186 klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put);
187 INIT_LIST_HEAD(&cp->class_interfaces); 187 INIT_LIST_HEAD(&cp->interfaces);
188 kset_init(&cp->glue_dirs); 188 kset_init(&cp->glue_dirs);
189 __mutex_init(&cp->class_mutex, "struct class mutex", key); 189 __mutex_init(&cp->mutex, "subsys mutex", key);
190 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name); 190 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
191 if (error) { 191 if (error) {
192 kfree(cp); 192 kfree(cp);
@@ -460,15 +460,15 @@ int class_interface_register(struct class_interface *class_intf)
460 if (!parent) 460 if (!parent)
461 return -EINVAL; 461 return -EINVAL;
462 462
463 mutex_lock(&parent->p->class_mutex); 463 mutex_lock(&parent->p->mutex);
464 list_add_tail(&class_intf->node, &parent->p->class_interfaces); 464 list_add_tail(&class_intf->node, &parent->p->interfaces);
465 if (class_intf->add_dev) { 465 if (class_intf->add_dev) {
466 class_dev_iter_init(&iter, parent, NULL, NULL); 466 class_dev_iter_init(&iter, parent, NULL, NULL);
467 while ((dev = class_dev_iter_next(&iter))) 467 while ((dev = class_dev_iter_next(&iter)))
468 class_intf->add_dev(dev, class_intf); 468 class_intf->add_dev(dev, class_intf);
469 class_dev_iter_exit(&iter); 469 class_dev_iter_exit(&iter);
470 } 470 }
471 mutex_unlock(&parent->p->class_mutex); 471 mutex_unlock(&parent->p->mutex);
472 472
473 return 0; 473 return 0;
474} 474}
@@ -482,7 +482,7 @@ void class_interface_unregister(struct class_interface *class_intf)
482 if (!parent) 482 if (!parent)
483 return; 483 return;
484 484
485 mutex_lock(&parent->p->class_mutex); 485 mutex_lock(&parent->p->mutex);
486 list_del_init(&class_intf->node); 486 list_del_init(&class_intf->node);
487 if (class_intf->remove_dev) { 487 if (class_intf->remove_dev) {
488 class_dev_iter_init(&iter, parent, NULL, NULL); 488 class_dev_iter_init(&iter, parent, NULL, NULL);
@@ -490,7 +490,7 @@ void class_interface_unregister(struct class_interface *class_intf)
490 class_intf->remove_dev(dev, class_intf); 490 class_intf->remove_dev(dev, class_intf);
491 class_dev_iter_exit(&iter); 491 class_dev_iter_exit(&iter);
492 } 492 }
493 mutex_unlock(&parent->p->class_mutex); 493 mutex_unlock(&parent->p->mutex);
494 494
495 class_put(parent); 495 class_put(parent);
496} 496}
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 919daa7cd5b1..4dac58aa4a0a 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -118,6 +118,56 @@ static const struct sysfs_ops dev_sysfs_ops = {
118 .store = dev_attr_store, 118 .store = dev_attr_store,
119}; 119};
120 120
121#define to_ext_attr(x) container_of(x, struct dev_ext_attribute, attr)
122
123ssize_t device_store_ulong(struct device *dev,
124 struct device_attribute *attr,
125 const char *buf, size_t size)
126{
127 struct dev_ext_attribute *ea = to_ext_attr(attr);
128 char *end;
129 unsigned long new = simple_strtoul(buf, &end, 0);
130 if (end == buf)
131 return -EINVAL;
132 *(unsigned long *)(ea->var) = new;
133 /* Always return full write size even if we didn't consume all */
134 return size;
135}
136EXPORT_SYMBOL_GPL(device_store_ulong);
137
138ssize_t device_show_ulong(struct device *dev,
139 struct device_attribute *attr,
140 char *buf)
141{
142 struct dev_ext_attribute *ea = to_ext_attr(attr);
143 return snprintf(buf, PAGE_SIZE, "%lx\n", *(unsigned long *)(ea->var));
144}
145EXPORT_SYMBOL_GPL(device_show_ulong);
146
147ssize_t device_store_int(struct device *dev,
148 struct device_attribute *attr,
149 const char *buf, size_t size)
150{
151 struct dev_ext_attribute *ea = to_ext_attr(attr);
152 char *end;
153 long new = simple_strtol(buf, &end, 0);
154 if (end == buf || new > INT_MAX || new < INT_MIN)
155 return -EINVAL;
156 *(int *)(ea->var) = new;
157 /* Always return full write size even if we didn't consume all */
158 return size;
159}
160EXPORT_SYMBOL_GPL(device_store_int);
161
162ssize_t device_show_int(struct device *dev,
163 struct device_attribute *attr,
164 char *buf)
165{
166 struct dev_ext_attribute *ea = to_ext_attr(attr);
167
168 return snprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var));
169}
170EXPORT_SYMBOL_GPL(device_show_int);
121 171
122/** 172/**
123 * device_release - free device structure. 173 * device_release - free device structure.
@@ -464,7 +514,7 @@ static ssize_t show_dev(struct device *dev, struct device_attribute *attr,
464static struct device_attribute devt_attr = 514static struct device_attribute devt_attr =
465 __ATTR(dev, S_IRUGO, show_dev, NULL); 515 __ATTR(dev, S_IRUGO, show_dev, NULL);
466 516
467/* kset to create /sys/devices/ */ 517/* /sys/devices/ */
468struct kset *devices_kset; 518struct kset *devices_kset;
469 519
470/** 520/**
@@ -711,6 +761,10 @@ static struct kobject *get_device_parent(struct device *dev,
711 return k; 761 return k;
712 } 762 }
713 763
764 /* subsystems can specify a default root directory for their devices */
765 if (!parent && dev->bus && dev->bus->dev_root)
766 return &dev->bus->dev_root->kobj;
767
714 if (parent) 768 if (parent)
715 return &parent->kobj; 769 return &parent->kobj;
716 return NULL; 770 return NULL;
@@ -731,14 +785,6 @@ static void cleanup_device_parent(struct device *dev)
731 cleanup_glue_dir(dev, dev->kobj.parent); 785 cleanup_glue_dir(dev, dev->kobj.parent);
732} 786}
733 787
734static void setup_parent(struct device *dev, struct device *parent)
735{
736 struct kobject *kobj;
737 kobj = get_device_parent(dev, parent);
738 if (kobj)
739 dev->kobj.parent = kobj;
740}
741
742static int device_add_class_symlinks(struct device *dev) 788static int device_add_class_symlinks(struct device *dev)
743{ 789{
744 int error; 790 int error;
@@ -891,6 +937,7 @@ int device_private_init(struct device *dev)
891int device_add(struct device *dev) 937int device_add(struct device *dev)
892{ 938{
893 struct device *parent = NULL; 939 struct device *parent = NULL;
940 struct kobject *kobj;
894 struct class_interface *class_intf; 941 struct class_interface *class_intf;
895 int error = -EINVAL; 942 int error = -EINVAL;
896 943
@@ -914,6 +961,10 @@ int device_add(struct device *dev)
914 dev->init_name = NULL; 961 dev->init_name = NULL;
915 } 962 }
916 963
964 /* subsystems can specify simple device enumeration */
965 if (!dev_name(dev) && dev->bus && dev->bus->dev_name)
966 dev_set_name(dev, "%s%u", dev->bus->dev_name, dev->id);
967
917 if (!dev_name(dev)) { 968 if (!dev_name(dev)) {
918 error = -EINVAL; 969 error = -EINVAL;
919 goto name_error; 970 goto name_error;
@@ -922,7 +973,9 @@ int device_add(struct device *dev)
922 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 973 pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
923 974
924 parent = get_device(dev->parent); 975 parent = get_device(dev->parent);
925 setup_parent(dev, parent); 976 kobj = get_device_parent(dev, parent);
977 if (kobj)
978 dev->kobj.parent = kobj;
926 979
927 /* use parent numa_node */ 980 /* use parent numa_node */
928 if (parent) 981 if (parent)
@@ -982,17 +1035,17 @@ int device_add(struct device *dev)
982 &parent->p->klist_children); 1035 &parent->p->klist_children);
983 1036
984 if (dev->class) { 1037 if (dev->class) {
985 mutex_lock(&dev->class->p->class_mutex); 1038 mutex_lock(&dev->class->p->mutex);
986 /* tie the class to the device */ 1039 /* tie the class to the device */
987 klist_add_tail(&dev->knode_class, 1040 klist_add_tail(&dev->knode_class,
988 &dev->class->p->klist_devices); 1041 &dev->class->p->klist_devices);
989 1042
990 /* notify any interfaces that the device is here */ 1043 /* notify any interfaces that the device is here */
991 list_for_each_entry(class_intf, 1044 list_for_each_entry(class_intf,
992 &dev->class->p->class_interfaces, node) 1045 &dev->class->p->interfaces, node)
993 if (class_intf->add_dev) 1046 if (class_intf->add_dev)
994 class_intf->add_dev(dev, class_intf); 1047 class_intf->add_dev(dev, class_intf);
995 mutex_unlock(&dev->class->p->class_mutex); 1048 mutex_unlock(&dev->class->p->mutex);
996 } 1049 }
997done: 1050done:
998 put_device(dev); 1051 put_device(dev);
@@ -1107,15 +1160,15 @@ void device_del(struct device *dev)
1107 if (dev->class) { 1160 if (dev->class) {
1108 device_remove_class_symlinks(dev); 1161 device_remove_class_symlinks(dev);
1109 1162
1110 mutex_lock(&dev->class->p->class_mutex); 1163 mutex_lock(&dev->class->p->mutex);
1111 /* notify any interfaces that the device is now gone */ 1164 /* notify any interfaces that the device is now gone */
1112 list_for_each_entry(class_intf, 1165 list_for_each_entry(class_intf,
1113 &dev->class->p->class_interfaces, node) 1166 &dev->class->p->interfaces, node)
1114 if (class_intf->remove_dev) 1167 if (class_intf->remove_dev)
1115 class_intf->remove_dev(dev, class_intf); 1168 class_intf->remove_dev(dev, class_intf);
1116 /* remove the device from the class list */ 1169 /* remove the device from the class list */
1117 klist_del(&dev->knode_class); 1170 klist_del(&dev->knode_class);
1118 mutex_unlock(&dev->class->p->class_mutex); 1171 mutex_unlock(&dev->class->p->mutex);
1119 } 1172 }
1120 device_remove_file(dev, &uevent_attr); 1173 device_remove_file(dev, &uevent_attr);
1121 device_remove_attrs(dev); 1174 device_remove_attrs(dev);
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 3991502b21e5..9a5578efbc93 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -1,8 +1,7 @@
1/* 1/*
2 * drivers/base/cpu.c - basic CPU class support 2 * CPU subsystem support
3 */ 3 */
4 4
5#include <linux/sysdev.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/init.h> 6#include <linux/init.h>
8#include <linux/sched.h> 7#include <linux/sched.h>
@@ -14,40 +13,40 @@
14 13
15#include "base.h" 14#include "base.h"
16 15
17static struct sysdev_class_attribute *cpu_sysdev_class_attrs[]; 16struct bus_type cpu_subsys = {
18
19struct sysdev_class cpu_sysdev_class = {
20 .name = "cpu", 17 .name = "cpu",
21 .attrs = cpu_sysdev_class_attrs, 18 .dev_name = "cpu",
22}; 19};
23EXPORT_SYMBOL(cpu_sysdev_class); 20EXPORT_SYMBOL_GPL(cpu_subsys);
24 21
25static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices); 22static DEFINE_PER_CPU(struct device *, cpu_sys_devices);
26 23
27#ifdef CONFIG_HOTPLUG_CPU 24#ifdef CONFIG_HOTPLUG_CPU
28static ssize_t show_online(struct sys_device *dev, struct sysdev_attribute *attr, 25static ssize_t show_online(struct device *dev,
26 struct device_attribute *attr,
29 char *buf) 27 char *buf)
30{ 28{
31 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 29 struct cpu *cpu = container_of(dev, struct cpu, dev);
32 30
33 return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id)); 31 return sprintf(buf, "%u\n", !!cpu_online(cpu->dev.id));
34} 32}
35 33
36static ssize_t __ref store_online(struct sys_device *dev, struct sysdev_attribute *attr, 34static ssize_t __ref store_online(struct device *dev,
37 const char *buf, size_t count) 35 struct device_attribute *attr,
36 const char *buf, size_t count)
38{ 37{
39 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 38 struct cpu *cpu = container_of(dev, struct cpu, dev);
40 ssize_t ret; 39 ssize_t ret;
41 40
42 cpu_hotplug_driver_lock(); 41 cpu_hotplug_driver_lock();
43 switch (buf[0]) { 42 switch (buf[0]) {
44 case '0': 43 case '0':
45 ret = cpu_down(cpu->sysdev.id); 44 ret = cpu_down(cpu->dev.id);
46 if (!ret) 45 if (!ret)
47 kobject_uevent(&dev->kobj, KOBJ_OFFLINE); 46 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
48 break; 47 break;
49 case '1': 48 case '1':
50 ret = cpu_up(cpu->sysdev.id); 49 ret = cpu_up(cpu->dev.id);
51 if (!ret) 50 if (!ret)
52 kobject_uevent(&dev->kobj, KOBJ_ONLINE); 51 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
53 break; 52 break;
@@ -60,44 +59,44 @@ static ssize_t __ref store_online(struct sys_device *dev, struct sysdev_attribut
60 ret = count; 59 ret = count;
61 return ret; 60 return ret;
62} 61}
63static SYSDEV_ATTR(online, 0644, show_online, store_online); 62static DEVICE_ATTR(online, 0644, show_online, store_online);
64 63
65static void __cpuinit register_cpu_control(struct cpu *cpu) 64static void __cpuinit register_cpu_control(struct cpu *cpu)
66{ 65{
67 sysdev_create_file(&cpu->sysdev, &attr_online); 66 device_create_file(&cpu->dev, &dev_attr_online);
68} 67}
69void unregister_cpu(struct cpu *cpu) 68void unregister_cpu(struct cpu *cpu)
70{ 69{
71 int logical_cpu = cpu->sysdev.id; 70 int logical_cpu = cpu->dev.id;
72 71
73 unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu)); 72 unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu));
74 73
75 sysdev_remove_file(&cpu->sysdev, &attr_online); 74 device_remove_file(&cpu->dev, &dev_attr_online);
76 75
77 sysdev_unregister(&cpu->sysdev); 76 device_unregister(&cpu->dev);
78 per_cpu(cpu_sys_devices, logical_cpu) = NULL; 77 per_cpu(cpu_sys_devices, logical_cpu) = NULL;
79 return; 78 return;
80} 79}
81 80
82#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE 81#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
83static ssize_t cpu_probe_store(struct sysdev_class *class, 82static ssize_t cpu_probe_store(struct device *dev,
84 struct sysdev_class_attribute *attr, 83 struct device_attribute *attr,
85 const char *buf, 84 const char *buf,
86 size_t count) 85 size_t count)
87{ 86{
88 return arch_cpu_probe(buf, count); 87 return arch_cpu_probe(buf, count);
89} 88}
90 89
91static ssize_t cpu_release_store(struct sysdev_class *class, 90static ssize_t cpu_release_store(struct device *dev,
92 struct sysdev_class_attribute *attr, 91 struct device_attribute *attr,
93 const char *buf, 92 const char *buf,
94 size_t count) 93 size_t count)
95{ 94{
96 return arch_cpu_release(buf, count); 95 return arch_cpu_release(buf, count);
97} 96}
98 97
99static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); 98static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
100static SYSDEV_CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); 99static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store);
101#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ 100#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
102 101
103#else /* ... !CONFIG_HOTPLUG_CPU */ 102#else /* ... !CONFIG_HOTPLUG_CPU */
@@ -109,15 +108,15 @@ static inline void register_cpu_control(struct cpu *cpu)
109#ifdef CONFIG_KEXEC 108#ifdef CONFIG_KEXEC
110#include <linux/kexec.h> 109#include <linux/kexec.h>
111 110
112static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute *attr, 111static ssize_t show_crash_notes(struct device *dev, struct device_attribute *attr,
113 char *buf) 112 char *buf)
114{ 113{
115 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 114 struct cpu *cpu = container_of(dev, struct cpu, dev);
116 ssize_t rc; 115 ssize_t rc;
117 unsigned long long addr; 116 unsigned long long addr;
118 int cpunum; 117 int cpunum;
119 118
120 cpunum = cpu->sysdev.id; 119 cpunum = cpu->dev.id;
121 120
122 /* 121 /*
123 * Might be reading other cpu's data based on which cpu read thread 122 * Might be reading other cpu's data based on which cpu read thread
@@ -129,7 +128,7 @@ static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute
129 rc = sprintf(buf, "%Lx\n", addr); 128 rc = sprintf(buf, "%Lx\n", addr);
130 return rc; 129 return rc;
131} 130}
132static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL); 131static DEVICE_ATTR(crash_notes, 0400, show_crash_notes, NULL);
133#endif 132#endif
134 133
135/* 134/*
@@ -137,12 +136,12 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
137 */ 136 */
138 137
139struct cpu_attr { 138struct cpu_attr {
140 struct sysdev_class_attribute attr; 139 struct device_attribute attr;
141 const struct cpumask *const * const map; 140 const struct cpumask *const * const map;
142}; 141};
143 142
144static ssize_t show_cpus_attr(struct sysdev_class *class, 143static ssize_t show_cpus_attr(struct device *dev,
145 struct sysdev_class_attribute *attr, 144 struct device_attribute *attr,
146 char *buf) 145 char *buf)
147{ 146{
148 struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); 147 struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr);
@@ -153,10 +152,10 @@ static ssize_t show_cpus_attr(struct sysdev_class *class,
153 return n; 152 return n;
154} 153}
155 154
156#define _CPU_ATTR(name, map) \ 155#define _CPU_ATTR(name, map) \
157 { _SYSDEV_CLASS_ATTR(name, 0444, show_cpus_attr, NULL), map } 156 { __ATTR(name, 0444, show_cpus_attr, NULL), map }
158 157
159/* Keep in sync with cpu_sysdev_class_attrs */ 158/* Keep in sync with cpu_subsys_attrs */
160static struct cpu_attr cpu_attrs[] = { 159static struct cpu_attr cpu_attrs[] = {
161 _CPU_ATTR(online, &cpu_online_mask), 160 _CPU_ATTR(online, &cpu_online_mask),
162 _CPU_ATTR(possible, &cpu_possible_mask), 161 _CPU_ATTR(possible, &cpu_possible_mask),
@@ -166,19 +165,19 @@ static struct cpu_attr cpu_attrs[] = {
166/* 165/*
167 * Print values for NR_CPUS and offlined cpus 166 * Print values for NR_CPUS and offlined cpus
168 */ 167 */
169static ssize_t print_cpus_kernel_max(struct sysdev_class *class, 168static ssize_t print_cpus_kernel_max(struct device *dev,
170 struct sysdev_class_attribute *attr, char *buf) 169 struct device_attribute *attr, char *buf)
171{ 170{
172 int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1); 171 int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1);
173 return n; 172 return n;
174} 173}
175static SYSDEV_CLASS_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL); 174static DEVICE_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL);
176 175
177/* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */ 176/* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */
178unsigned int total_cpus; 177unsigned int total_cpus;
179 178
180static ssize_t print_cpus_offline(struct sysdev_class *class, 179static ssize_t print_cpus_offline(struct device *dev,
181 struct sysdev_class_attribute *attr, char *buf) 180 struct device_attribute *attr, char *buf)
182{ 181{
183 int n = 0, len = PAGE_SIZE-2; 182 int n = 0, len = PAGE_SIZE-2;
184 cpumask_var_t offline; 183 cpumask_var_t offline;
@@ -205,7 +204,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class,
205 n += snprintf(&buf[n], len - n, "\n"); 204 n += snprintf(&buf[n], len - n, "\n");
206 return n; 205 return n;
207} 206}
208static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL); 207static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL);
209 208
210/* 209/*
211 * register_cpu - Setup a sysfs device for a CPU. 210 * register_cpu - Setup a sysfs device for a CPU.
@@ -218,39 +217,60 @@ static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL);
218int __cpuinit register_cpu(struct cpu *cpu, int num) 217int __cpuinit register_cpu(struct cpu *cpu, int num)
219{ 218{
220 int error; 219 int error;
221 cpu->node_id = cpu_to_node(num);
222 cpu->sysdev.id = num;
223 cpu->sysdev.cls = &cpu_sysdev_class;
224
225 error = sysdev_register(&cpu->sysdev);
226 220
221 cpu->node_id = cpu_to_node(num);
222 cpu->dev.id = num;
223 cpu->dev.bus = &cpu_subsys;
224 error = device_register(&cpu->dev);
227 if (!error && cpu->hotpluggable) 225 if (!error && cpu->hotpluggable)
228 register_cpu_control(cpu); 226 register_cpu_control(cpu);
229 if (!error) 227 if (!error)
230 per_cpu(cpu_sys_devices, num) = &cpu->sysdev; 228 per_cpu(cpu_sys_devices, num) = &cpu->dev;
231 if (!error) 229 if (!error)
232 register_cpu_under_node(num, cpu_to_node(num)); 230 register_cpu_under_node(num, cpu_to_node(num));
233 231
234#ifdef CONFIG_KEXEC 232#ifdef CONFIG_KEXEC
235 if (!error) 233 if (!error)
236 error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes); 234 error = device_create_file(&cpu->dev, &dev_attr_crash_notes);
237#endif 235#endif
238 return error; 236 return error;
239} 237}
240 238
241struct sys_device *get_cpu_sysdev(unsigned cpu) 239struct device *get_cpu_device(unsigned cpu)
242{ 240{
243 if (cpu < nr_cpu_ids && cpu_possible(cpu)) 241 if (cpu < nr_cpu_ids && cpu_possible(cpu))
244 return per_cpu(cpu_sys_devices, cpu); 242 return per_cpu(cpu_sys_devices, cpu);
245 else 243 else
246 return NULL; 244 return NULL;
247} 245}
248EXPORT_SYMBOL_GPL(get_cpu_sysdev); 246EXPORT_SYMBOL_GPL(get_cpu_device);
247
248static struct attribute *cpu_root_attrs[] = {
249#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
250 &dev_attr_probe.attr,
251 &dev_attr_release.attr,
252#endif
253 &cpu_attrs[0].attr.attr,
254 &cpu_attrs[1].attr.attr,
255 &cpu_attrs[2].attr.attr,
256 &dev_attr_kernel_max.attr,
257 &dev_attr_offline.attr,
258 NULL
259};
260
261static struct attribute_group cpu_root_attr_group = {
262 .attrs = cpu_root_attrs,
263};
264
265static const struct attribute_group *cpu_root_attr_groups[] = {
266 &cpu_root_attr_group,
267 NULL,
268};
249 269
250bool cpu_is_hotpluggable(unsigned cpu) 270bool cpu_is_hotpluggable(unsigned cpu)
251{ 271{
252 struct sys_device *dev = get_cpu_sysdev(cpu); 272 struct device *dev = get_cpu_device(cpu);
253 return dev && container_of(dev, struct cpu, sysdev)->hotpluggable; 273 return dev && container_of(dev, struct cpu, dev)->hotpluggable;
254} 274}
255EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); 275EXPORT_SYMBOL_GPL(cpu_is_hotpluggable);
256 276
@@ -258,24 +278,12 @@ int __init cpu_dev_init(void)
258{ 278{
259 int err; 279 int err;
260 280
261 err = sysdev_class_register(&cpu_sysdev_class); 281 err = subsys_system_register(&cpu_subsys, cpu_root_attr_groups);
282 if (err)
283 return err;
284
262#if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) 285#if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
263 if (!err) 286 err = sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root);
264 err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class);
265#endif 287#endif
266
267 return err; 288 return err;
268} 289}
269
270static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = {
271#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
272 &attr_probe,
273 &attr_release,
274#endif
275 &cpu_attrs[0].attr,
276 &cpu_attrs[1].attr,
277 &cpu_attrs[2].attr,
278 &attr_kernel_max,
279 &attr_offline,
280 NULL
281};
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index a4760e095ff5..2bb4bff3af7d 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -413,10 +413,9 @@ static int devtmpfsd(void *p)
413 } 413 }
414 spin_lock(&req_lock); 414 spin_lock(&req_lock);
415 } 415 }
416 set_current_state(TASK_INTERRUPTIBLE); 416 __set_current_state(TASK_INTERRUPTIBLE);
417 spin_unlock(&req_lock); 417 spin_unlock(&req_lock);
418 schedule(); 418 schedule();
419 __set_current_state(TASK_RUNNING);
420 } 419 }
421 return 0; 420 return 0;
422out: 421out:
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 06ed6b4e7df5..3719c94be19c 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -226,13 +226,13 @@ static ssize_t firmware_loading_store(struct device *dev,
226 int loading = simple_strtol(buf, NULL, 10); 226 int loading = simple_strtol(buf, NULL, 10);
227 int i; 227 int i;
228 228
229 mutex_lock(&fw_lock);
230
231 if (!fw_priv->fw)
232 goto out;
233
229 switch (loading) { 234 switch (loading) {
230 case 1: 235 case 1:
231 mutex_lock(&fw_lock);
232 if (!fw_priv->fw) {
233 mutex_unlock(&fw_lock);
234 break;
235 }
236 firmware_free_data(fw_priv->fw); 236 firmware_free_data(fw_priv->fw);
237 memset(fw_priv->fw, 0, sizeof(struct firmware)); 237 memset(fw_priv->fw, 0, sizeof(struct firmware));
238 /* If the pages are not owned by 'struct firmware' */ 238 /* If the pages are not owned by 'struct firmware' */
@@ -243,7 +243,6 @@ static ssize_t firmware_loading_store(struct device *dev,
243 fw_priv->page_array_size = 0; 243 fw_priv->page_array_size = 0;
244 fw_priv->nr_pages = 0; 244 fw_priv->nr_pages = 0;
245 set_bit(FW_STATUS_LOADING, &fw_priv->status); 245 set_bit(FW_STATUS_LOADING, &fw_priv->status);
246 mutex_unlock(&fw_lock);
247 break; 246 break;
248 case 0: 247 case 0:
249 if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) { 248 if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
@@ -274,7 +273,8 @@ static ssize_t firmware_loading_store(struct device *dev,
274 fw_load_abort(fw_priv); 273 fw_load_abort(fw_priv);
275 break; 274 break;
276 } 275 }
277 276out:
277 mutex_unlock(&fw_lock);
278 return count; 278 return count;
279} 279}
280 280
diff --git a/drivers/base/init.c b/drivers/base/init.c
index c8a934e79421..c16f0b808a17 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -31,7 +31,6 @@ void __init driver_init(void)
31 * core core pieces. 31 * core core pieces.
32 */ 32 */
33 platform_bus_init(); 33 platform_bus_init();
34 system_bus_init();
35 cpu_dev_init(); 34 cpu_dev_init();
36 memory_dev_init(); 35 memory_dev_init();
37} 36}
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 8272d92d22c0..f17e3ea041c0 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * drivers/base/memory.c - basic Memory class support 2 * Memory subsystem support
3 * 3 *
4 * Written by Matt Tolentino <matthew.e.tolentino@intel.com> 4 * Written by Matt Tolentino <matthew.e.tolentino@intel.com>
5 * Dave Hansen <haveblue@us.ibm.com> 5 * Dave Hansen <haveblue@us.ibm.com>
@@ -10,7 +10,6 @@
10 * SPARSEMEM should be contained here, or in mm/memory_hotplug.c. 10 * SPARSEMEM should be contained here, or in mm/memory_hotplug.c.
11 */ 11 */
12 12
13#include <linux/sysdev.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/topology.h> 15#include <linux/topology.h>
@@ -38,26 +37,9 @@ static inline int base_memory_block_id(int section_nr)
38 return section_nr / sections_per_block; 37 return section_nr / sections_per_block;
39} 38}
40 39
41static struct sysdev_class memory_sysdev_class = { 40static struct bus_type memory_subsys = {
42 .name = MEMORY_CLASS_NAME, 41 .name = MEMORY_CLASS_NAME,
43}; 42 .dev_name = MEMORY_CLASS_NAME,
44
45static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
46{
47 return MEMORY_CLASS_NAME;
48}
49
50static int memory_uevent(struct kset *kset, struct kobject *obj,
51 struct kobj_uevent_env *env)
52{
53 int retval = 0;
54
55 return retval;
56}
57
58static const struct kset_uevent_ops memory_uevent_ops = {
59 .name = memory_uevent_name,
60 .uevent = memory_uevent,
61}; 43};
62 44
63static BLOCKING_NOTIFIER_HEAD(memory_chain); 45static BLOCKING_NOTIFIER_HEAD(memory_chain);
@@ -96,21 +78,21 @@ int register_memory(struct memory_block *memory)
96{ 78{
97 int error; 79 int error;
98 80
99 memory->sysdev.cls = &memory_sysdev_class; 81 memory->dev.bus = &memory_subsys;
100 memory->sysdev.id = memory->start_section_nr / sections_per_block; 82 memory->dev.id = memory->start_section_nr / sections_per_block;
101 83
102 error = sysdev_register(&memory->sysdev); 84 error = device_register(&memory->dev);
103 return error; 85 return error;
104} 86}
105 87
106static void 88static void
107unregister_memory(struct memory_block *memory) 89unregister_memory(struct memory_block *memory)
108{ 90{
109 BUG_ON(memory->sysdev.cls != &memory_sysdev_class); 91 BUG_ON(memory->dev.bus != &memory_subsys);
110 92
111 /* drop the ref. we got in remove_memory_block() */ 93 /* drop the ref. we got in remove_memory_block() */
112 kobject_put(&memory->sysdev.kobj); 94 kobject_put(&memory->dev.kobj);
113 sysdev_unregister(&memory->sysdev); 95 device_unregister(&memory->dev);
114} 96}
115 97
116unsigned long __weak memory_block_size_bytes(void) 98unsigned long __weak memory_block_size_bytes(void)
@@ -138,22 +120,22 @@ static unsigned long get_memory_block_size(void)
138 * uses. 120 * uses.
139 */ 121 */
140 122
141static ssize_t show_mem_start_phys_index(struct sys_device *dev, 123static ssize_t show_mem_start_phys_index(struct device *dev,
142 struct sysdev_attribute *attr, char *buf) 124 struct device_attribute *attr, char *buf)
143{ 125{
144 struct memory_block *mem = 126 struct memory_block *mem =
145 container_of(dev, struct memory_block, sysdev); 127 container_of(dev, struct memory_block, dev);
146 unsigned long phys_index; 128 unsigned long phys_index;
147 129
148 phys_index = mem->start_section_nr / sections_per_block; 130 phys_index = mem->start_section_nr / sections_per_block;
149 return sprintf(buf, "%08lx\n", phys_index); 131 return sprintf(buf, "%08lx\n", phys_index);
150} 132}
151 133
152static ssize_t show_mem_end_phys_index(struct sys_device *dev, 134static ssize_t show_mem_end_phys_index(struct device *dev,
153 struct sysdev_attribute *attr, char *buf) 135 struct device_attribute *attr, char *buf)
154{ 136{
155 struct memory_block *mem = 137 struct memory_block *mem =
156 container_of(dev, struct memory_block, sysdev); 138 container_of(dev, struct memory_block, dev);
157 unsigned long phys_index; 139 unsigned long phys_index;
158 140
159 phys_index = mem->end_section_nr / sections_per_block; 141 phys_index = mem->end_section_nr / sections_per_block;
@@ -163,13 +145,13 @@ static ssize_t show_mem_end_phys_index(struct sys_device *dev,
163/* 145/*
164 * Show whether the section of memory is likely to be hot-removable 146 * Show whether the section of memory is likely to be hot-removable
165 */ 147 */
166static ssize_t show_mem_removable(struct sys_device *dev, 148static ssize_t show_mem_removable(struct device *dev,
167 struct sysdev_attribute *attr, char *buf) 149 struct device_attribute *attr, char *buf)
168{ 150{
169 unsigned long i, pfn; 151 unsigned long i, pfn;
170 int ret = 1; 152 int ret = 1;
171 struct memory_block *mem = 153 struct memory_block *mem =
172 container_of(dev, struct memory_block, sysdev); 154 container_of(dev, struct memory_block, dev);
173 155
174 for (i = 0; i < sections_per_block; i++) { 156 for (i = 0; i < sections_per_block; i++) {
175 pfn = section_nr_to_pfn(mem->start_section_nr + i); 157 pfn = section_nr_to_pfn(mem->start_section_nr + i);
@@ -182,11 +164,11 @@ static ssize_t show_mem_removable(struct sys_device *dev,
182/* 164/*
183 * online, offline, going offline, etc. 165 * online, offline, going offline, etc.
184 */ 166 */
185static ssize_t show_mem_state(struct sys_device *dev, 167static ssize_t show_mem_state(struct device *dev,
186 struct sysdev_attribute *attr, char *buf) 168 struct device_attribute *attr, char *buf)
187{ 169{
188 struct memory_block *mem = 170 struct memory_block *mem =
189 container_of(dev, struct memory_block, sysdev); 171 container_of(dev, struct memory_block, dev);
190 ssize_t len = 0; 172 ssize_t len = 0;
191 173
192 /* 174 /*
@@ -324,13 +306,13 @@ out:
324} 306}
325 307
326static ssize_t 308static ssize_t
327store_mem_state(struct sys_device *dev, 309store_mem_state(struct device *dev,
328 struct sysdev_attribute *attr, const char *buf, size_t count) 310 struct device_attribute *attr, const char *buf, size_t count)
329{ 311{
330 struct memory_block *mem; 312 struct memory_block *mem;
331 int ret = -EINVAL; 313 int ret = -EINVAL;
332 314
333 mem = container_of(dev, struct memory_block, sysdev); 315 mem = container_of(dev, struct memory_block, dev);
334 316
335 if (!strncmp(buf, "online", min((int)count, 6))) 317 if (!strncmp(buf, "online", min((int)count, 6)))
336 ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE); 318 ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
@@ -351,41 +333,41 @@ store_mem_state(struct sys_device *dev,
351 * s.t. if I offline all of these sections I can then 333 * s.t. if I offline all of these sections I can then
352 * remove the physical device? 334 * remove the physical device?
353 */ 335 */
354static ssize_t show_phys_device(struct sys_device *dev, 336static ssize_t show_phys_device(struct device *dev,
355 struct sysdev_attribute *attr, char *buf) 337 struct device_attribute *attr, char *buf)
356{ 338{
357 struct memory_block *mem = 339 struct memory_block *mem =
358 container_of(dev, struct memory_block, sysdev); 340 container_of(dev, struct memory_block, dev);
359 return sprintf(buf, "%d\n", mem->phys_device); 341 return sprintf(buf, "%d\n", mem->phys_device);
360} 342}
361 343
362static SYSDEV_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL); 344static DEVICE_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL);
363static SYSDEV_ATTR(end_phys_index, 0444, show_mem_end_phys_index, NULL); 345static DEVICE_ATTR(end_phys_index, 0444, show_mem_end_phys_index, NULL);
364static SYSDEV_ATTR(state, 0644, show_mem_state, store_mem_state); 346static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state);
365static SYSDEV_ATTR(phys_device, 0444, show_phys_device, NULL); 347static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL);
366static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL); 348static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL);
367 349
368#define mem_create_simple_file(mem, attr_name) \ 350#define mem_create_simple_file(mem, attr_name) \
369 sysdev_create_file(&mem->sysdev, &attr_##attr_name) 351 device_create_file(&mem->dev, &dev_attr_##attr_name)
370#define mem_remove_simple_file(mem, attr_name) \ 352#define mem_remove_simple_file(mem, attr_name) \
371 sysdev_remove_file(&mem->sysdev, &attr_##attr_name) 353 device_remove_file(&mem->dev, &dev_attr_##attr_name)
372 354
373/* 355/*
374 * Block size attribute stuff 356 * Block size attribute stuff
375 */ 357 */
376static ssize_t 358static ssize_t
377print_block_size(struct sysdev_class *class, struct sysdev_class_attribute *attr, 359print_block_size(struct device *dev, struct device_attribute *attr,
378 char *buf) 360 char *buf)
379{ 361{
380 return sprintf(buf, "%lx\n", get_memory_block_size()); 362 return sprintf(buf, "%lx\n", get_memory_block_size());
381} 363}
382 364
383static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); 365static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL);
384 366
385static int block_size_init(void) 367static int block_size_init(void)
386{ 368{
387 return sysfs_create_file(&memory_sysdev_class.kset.kobj, 369 return device_create_file(memory_subsys.dev_root,
388 &attr_block_size_bytes.attr); 370 &dev_attr_block_size_bytes);
389} 371}
390 372
391/* 373/*
@@ -396,7 +378,7 @@ static int block_size_init(void)
396 */ 378 */
397#ifdef CONFIG_ARCH_MEMORY_PROBE 379#ifdef CONFIG_ARCH_MEMORY_PROBE
398static ssize_t 380static ssize_t
399memory_probe_store(struct class *class, struct class_attribute *attr, 381memory_probe_store(struct device *dev, struct device_attribute *attr,
400 const char *buf, size_t count) 382 const char *buf, size_t count)
401{ 383{
402 u64 phys_addr; 384 u64 phys_addr;
@@ -423,12 +405,11 @@ memory_probe_store(struct class *class, struct class_attribute *attr,
423out: 405out:
424 return ret; 406 return ret;
425} 407}
426static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); 408static DEVICE_ATTR(probe, S_IWUSR, NULL, memory_probe_store);
427 409
428static int memory_probe_init(void) 410static int memory_probe_init(void)
429{ 411{
430 return sysfs_create_file(&memory_sysdev_class.kset.kobj, 412 return device_create_file(memory_subsys.dev_root, &dev_attr_probe);
431 &class_attr_probe.attr);
432} 413}
433#else 414#else
434static inline int memory_probe_init(void) 415static inline int memory_probe_init(void)
@@ -444,8 +425,8 @@ static inline int memory_probe_init(void)
444 425
445/* Soft offline a page */ 426/* Soft offline a page */
446static ssize_t 427static ssize_t
447store_soft_offline_page(struct class *class, 428store_soft_offline_page(struct device *dev,
448 struct class_attribute *attr, 429 struct device_attribute *attr,
449 const char *buf, size_t count) 430 const char *buf, size_t count)
450{ 431{
451 int ret; 432 int ret;
@@ -463,8 +444,8 @@ store_soft_offline_page(struct class *class,
463 444
464/* Forcibly offline a page, including killing processes. */ 445/* Forcibly offline a page, including killing processes. */
465static ssize_t 446static ssize_t
466store_hard_offline_page(struct class *class, 447store_hard_offline_page(struct device *dev,
467 struct class_attribute *attr, 448 struct device_attribute *attr,
468 const char *buf, size_t count) 449 const char *buf, size_t count)
469{ 450{
470 int ret; 451 int ret;
@@ -478,18 +459,18 @@ store_hard_offline_page(struct class *class,
478 return ret ? ret : count; 459 return ret ? ret : count;
479} 460}
480 461
481static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); 462static DEVICE_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
482static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); 463static DEVICE_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);
483 464
484static __init int memory_fail_init(void) 465static __init int memory_fail_init(void)
485{ 466{
486 int err; 467 int err;
487 468
488 err = sysfs_create_file(&memory_sysdev_class.kset.kobj, 469 err = device_create_file(memory_subsys.dev_root,
489 &class_attr_soft_offline_page.attr); 470 &dev_attr_soft_offline_page);
490 if (!err) 471 if (!err)
491 err = sysfs_create_file(&memory_sysdev_class.kset.kobj, 472 err = device_create_file(memory_subsys.dev_root,
492 &class_attr_hard_offline_page.attr); 473 &dev_attr_hard_offline_page);
493 return err; 474 return err;
494} 475}
495#else 476#else
@@ -509,31 +490,23 @@ int __weak arch_get_memory_phys_device(unsigned long start_pfn)
509 return 0; 490 return 0;
510} 491}
511 492
493/*
494 * A reference for the returned object is held and the reference for the
495 * hinted object is released.
496 */
512struct memory_block *find_memory_block_hinted(struct mem_section *section, 497struct memory_block *find_memory_block_hinted(struct mem_section *section,
513 struct memory_block *hint) 498 struct memory_block *hint)
514{ 499{
515 struct kobject *kobj;
516 struct sys_device *sysdev;
517 struct memory_block *mem;
518 char name[sizeof(MEMORY_CLASS_NAME) + 9 + 1];
519 int block_id = base_memory_block_id(__section_nr(section)); 500 int block_id = base_memory_block_id(__section_nr(section));
501 struct device *hintdev = hint ? &hint->dev : NULL;
502 struct device *dev;
520 503
521 kobj = hint ? &hint->sysdev.kobj : NULL; 504 dev = subsys_find_device_by_id(&memory_subsys, block_id, hintdev);
522 505 if (hint)
523 /* 506 put_device(&hint->dev);
524 * This only works because we know that section == sysdev->id 507 if (!dev)
525 * slightly redundant with sysdev_register()
526 */
527 sprintf(&name[0], "%s%d", MEMORY_CLASS_NAME, block_id);
528
529 kobj = kset_find_obj_hinted(&memory_sysdev_class.kset, name, kobj);
530 if (!kobj)
531 return NULL; 508 return NULL;
532 509 return container_of(dev, struct memory_block, dev);
533 sysdev = container_of(kobj, struct sys_device, kobj);
534 mem = container_of(sysdev, struct memory_block, sysdev);
535
536 return mem;
537} 510}
538 511
539/* 512/*
@@ -542,7 +515,7 @@ struct memory_block *find_memory_block_hinted(struct mem_section *section,
542 * this gets to be a real problem, we can always use a radix 515 * this gets to be a real problem, we can always use a radix
543 * tree or something here. 516 * tree or something here.
544 * 517 *
545 * This could be made generic for all sysdev classes. 518 * This could be made generic for all device subsystems.
546 */ 519 */
547struct memory_block *find_memory_block(struct mem_section *section) 520struct memory_block *find_memory_block(struct mem_section *section)
548{ 521{
@@ -598,7 +571,7 @@ static int add_memory_section(int nid, struct mem_section *section,
598 mem = find_memory_block(section); 571 mem = find_memory_block(section);
599 if (mem) { 572 if (mem) {
600 mem->section_count++; 573 mem->section_count++;
601 kobject_put(&mem->sysdev.kobj); 574 kobject_put(&mem->dev.kobj);
602 } else 575 } else
603 ret = init_memory_block(&mem, section, state); 576 ret = init_memory_block(&mem, section, state);
604 577
@@ -631,7 +604,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
631 unregister_memory(mem); 604 unregister_memory(mem);
632 kfree(mem); 605 kfree(mem);
633 } else 606 } else
634 kobject_put(&mem->sysdev.kobj); 607 kobject_put(&mem->dev.kobj);
635 608
636 mutex_unlock(&mem_sysfs_mutex); 609 mutex_unlock(&mem_sysfs_mutex);
637 return 0; 610 return 0;
@@ -664,8 +637,7 @@ int __init memory_dev_init(void)
664 int err; 637 int err;
665 unsigned long block_sz; 638 unsigned long block_sz;
666 639
667 memory_sysdev_class.kset.uevent_ops = &memory_uevent_ops; 640 ret = subsys_system_register(&memory_subsys, NULL);
668 ret = sysdev_class_register(&memory_sysdev_class);
669 if (ret) 641 if (ret)
670 goto out; 642 goto out;
671 643
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 5693ecee9a40..44f427a66117 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -1,8 +1,7 @@
1/* 1/*
2 * drivers/base/node.c - basic Node class support 2 * Basic Node interface support
3 */ 3 */
4 4
5#include <linux/sysdev.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/init.h> 6#include <linux/init.h>
8#include <linux/mm.h> 7#include <linux/mm.h>
@@ -19,18 +18,16 @@
19#include <linux/swap.h> 18#include <linux/swap.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21 20
22static struct sysdev_class_attribute *node_state_attrs[]; 21static struct bus_type node_subsys = {
23
24static struct sysdev_class node_class = {
25 .name = "node", 22 .name = "node",
26 .attrs = node_state_attrs, 23 .dev_name = "node",
27}; 24};
28 25
29 26
30static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf) 27static ssize_t node_read_cpumap(struct device *dev, int type, char *buf)
31{ 28{
32 struct node *node_dev = to_node(dev); 29 struct node *node_dev = to_node(dev);
33 const struct cpumask *mask = cpumask_of_node(node_dev->sysdev.id); 30 const struct cpumask *mask = cpumask_of_node(node_dev->dev.id);
34 int len; 31 int len;
35 32
36 /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */ 33 /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */
@@ -44,23 +41,23 @@ static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf)
44 return len; 41 return len;
45} 42}
46 43
47static inline ssize_t node_read_cpumask(struct sys_device *dev, 44static inline ssize_t node_read_cpumask(struct device *dev,
48 struct sysdev_attribute *attr, char *buf) 45 struct device_attribute *attr, char *buf)
49{ 46{
50 return node_read_cpumap(dev, 0, buf); 47 return node_read_cpumap(dev, 0, buf);
51} 48}
52static inline ssize_t node_read_cpulist(struct sys_device *dev, 49static inline ssize_t node_read_cpulist(struct device *dev,
53 struct sysdev_attribute *attr, char *buf) 50 struct device_attribute *attr, char *buf)
54{ 51{
55 return node_read_cpumap(dev, 1, buf); 52 return node_read_cpumap(dev, 1, buf);
56} 53}
57 54
58static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL); 55static DEVICE_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL);
59static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL); 56static DEVICE_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL);
60 57
61#define K(x) ((x) << (PAGE_SHIFT - 10)) 58#define K(x) ((x) << (PAGE_SHIFT - 10))
62static ssize_t node_read_meminfo(struct sys_device * dev, 59static ssize_t node_read_meminfo(struct device *dev,
63 struct sysdev_attribute *attr, char * buf) 60 struct device_attribute *attr, char *buf)
64{ 61{
65 int n; 62 int n;
66 int nid = dev->id; 63 int nid = dev->id;
@@ -157,10 +154,10 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
157} 154}
158 155
159#undef K 156#undef K
160static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); 157static DEVICE_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL);
161 158
162static ssize_t node_read_numastat(struct sys_device * dev, 159static ssize_t node_read_numastat(struct device *dev,
163 struct sysdev_attribute *attr, char * buf) 160 struct device_attribute *attr, char *buf)
164{ 161{
165 return sprintf(buf, 162 return sprintf(buf,
166 "numa_hit %lu\n" 163 "numa_hit %lu\n"
@@ -176,10 +173,10 @@ static ssize_t node_read_numastat(struct sys_device * dev,
176 node_page_state(dev->id, NUMA_LOCAL), 173 node_page_state(dev->id, NUMA_LOCAL),
177 node_page_state(dev->id, NUMA_OTHER)); 174 node_page_state(dev->id, NUMA_OTHER));
178} 175}
179static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); 176static DEVICE_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
180 177
181static ssize_t node_read_vmstat(struct sys_device *dev, 178static ssize_t node_read_vmstat(struct device *dev,
182 struct sysdev_attribute *attr, char *buf) 179 struct device_attribute *attr, char *buf)
183{ 180{
184 int nid = dev->id; 181 int nid = dev->id;
185 int i; 182 int i;
@@ -191,10 +188,10 @@ static ssize_t node_read_vmstat(struct sys_device *dev,
191 188
192 return n; 189 return n;
193} 190}
194static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL); 191static DEVICE_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL);
195 192
196static ssize_t node_read_distance(struct sys_device * dev, 193static ssize_t node_read_distance(struct device *dev,
197 struct sysdev_attribute *attr, char * buf) 194 struct device_attribute *attr, char * buf)
198{ 195{
199 int nid = dev->id; 196 int nid = dev->id;
200 int len = 0; 197 int len = 0;
@@ -212,7 +209,7 @@ static ssize_t node_read_distance(struct sys_device * dev,
212 len += sprintf(buf + len, "\n"); 209 len += sprintf(buf + len, "\n");
213 return len; 210 return len;
214} 211}
215static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL); 212static DEVICE_ATTR(distance, S_IRUGO, node_read_distance, NULL);
216 213
217#ifdef CONFIG_HUGETLBFS 214#ifdef CONFIG_HUGETLBFS
218/* 215/*
@@ -230,7 +227,7 @@ static node_registration_func_t __hugetlb_unregister_node;
230static inline bool hugetlb_register_node(struct node *node) 227static inline bool hugetlb_register_node(struct node *node)
231{ 228{
232 if (__hugetlb_register_node && 229 if (__hugetlb_register_node &&
233 node_state(node->sysdev.id, N_HIGH_MEMORY)) { 230 node_state(node->dev.id, N_HIGH_MEMORY)) {
234 __hugetlb_register_node(node); 231 __hugetlb_register_node(node);
235 return true; 232 return true;
236 } 233 }
@@ -266,17 +263,17 @@ int register_node(struct node *node, int num, struct node *parent)
266{ 263{
267 int error; 264 int error;
268 265
269 node->sysdev.id = num; 266 node->dev.id = num;
270 node->sysdev.cls = &node_class; 267 node->dev.bus = &node_subsys;
271 error = sysdev_register(&node->sysdev); 268 error = device_register(&node->dev);
272 269
273 if (!error){ 270 if (!error){
274 sysdev_create_file(&node->sysdev, &attr_cpumap); 271 device_create_file(&node->dev, &dev_attr_cpumap);
275 sysdev_create_file(&node->sysdev, &attr_cpulist); 272 device_create_file(&node->dev, &dev_attr_cpulist);
276 sysdev_create_file(&node->sysdev, &attr_meminfo); 273 device_create_file(&node->dev, &dev_attr_meminfo);
277 sysdev_create_file(&node->sysdev, &attr_numastat); 274 device_create_file(&node->dev, &dev_attr_numastat);
278 sysdev_create_file(&node->sysdev, &attr_distance); 275 device_create_file(&node->dev, &dev_attr_distance);
279 sysdev_create_file(&node->sysdev, &attr_vmstat); 276 device_create_file(&node->dev, &dev_attr_vmstat);
280 277
281 scan_unevictable_register_node(node); 278 scan_unevictable_register_node(node);
282 279
@@ -296,17 +293,17 @@ int register_node(struct node *node, int num, struct node *parent)
296 */ 293 */
297void unregister_node(struct node *node) 294void unregister_node(struct node *node)
298{ 295{
299 sysdev_remove_file(&node->sysdev, &attr_cpumap); 296 device_remove_file(&node->dev, &dev_attr_cpumap);
300 sysdev_remove_file(&node->sysdev, &attr_cpulist); 297 device_remove_file(&node->dev, &dev_attr_cpulist);
301 sysdev_remove_file(&node->sysdev, &attr_meminfo); 298 device_remove_file(&node->dev, &dev_attr_meminfo);
302 sysdev_remove_file(&node->sysdev, &attr_numastat); 299 device_remove_file(&node->dev, &dev_attr_numastat);
303 sysdev_remove_file(&node->sysdev, &attr_distance); 300 device_remove_file(&node->dev, &dev_attr_distance);
304 sysdev_remove_file(&node->sysdev, &attr_vmstat); 301 device_remove_file(&node->dev, &dev_attr_vmstat);
305 302
306 scan_unevictable_unregister_node(node); 303 scan_unevictable_unregister_node(node);
307 hugetlb_unregister_node(node); /* no-op, if memoryless node */ 304 hugetlb_unregister_node(node); /* no-op, if memoryless node */
308 305
309 sysdev_unregister(&node->sysdev); 306 device_unregister(&node->dev);
310} 307}
311 308
312struct node node_devices[MAX_NUMNODES]; 309struct node node_devices[MAX_NUMNODES];
@@ -317,41 +314,41 @@ struct node node_devices[MAX_NUMNODES];
317int register_cpu_under_node(unsigned int cpu, unsigned int nid) 314int register_cpu_under_node(unsigned int cpu, unsigned int nid)
318{ 315{
319 int ret; 316 int ret;
320 struct sys_device *obj; 317 struct device *obj;
321 318
322 if (!node_online(nid)) 319 if (!node_online(nid))
323 return 0; 320 return 0;
324 321
325 obj = get_cpu_sysdev(cpu); 322 obj = get_cpu_device(cpu);
326 if (!obj) 323 if (!obj)
327 return 0; 324 return 0;
328 325
329 ret = sysfs_create_link(&node_devices[nid].sysdev.kobj, 326 ret = sysfs_create_link(&node_devices[nid].dev.kobj,
330 &obj->kobj, 327 &obj->kobj,
331 kobject_name(&obj->kobj)); 328 kobject_name(&obj->kobj));
332 if (ret) 329 if (ret)
333 return ret; 330 return ret;
334 331
335 return sysfs_create_link(&obj->kobj, 332 return sysfs_create_link(&obj->kobj,
336 &node_devices[nid].sysdev.kobj, 333 &node_devices[nid].dev.kobj,
337 kobject_name(&node_devices[nid].sysdev.kobj)); 334 kobject_name(&node_devices[nid].dev.kobj));
338} 335}
339 336
340int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) 337int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
341{ 338{
342 struct sys_device *obj; 339 struct device *obj;
343 340
344 if (!node_online(nid)) 341 if (!node_online(nid))
345 return 0; 342 return 0;
346 343
347 obj = get_cpu_sysdev(cpu); 344 obj = get_cpu_device(cpu);
348 if (!obj) 345 if (!obj)
349 return 0; 346 return 0;
350 347
351 sysfs_remove_link(&node_devices[nid].sysdev.kobj, 348 sysfs_remove_link(&node_devices[nid].dev.kobj,
352 kobject_name(&obj->kobj)); 349 kobject_name(&obj->kobj));
353 sysfs_remove_link(&obj->kobj, 350 sysfs_remove_link(&obj->kobj,
354 kobject_name(&node_devices[nid].sysdev.kobj)); 351 kobject_name(&node_devices[nid].dev.kobj));
355 352
356 return 0; 353 return 0;
357} 354}
@@ -393,15 +390,15 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
393 continue; 390 continue;
394 if (page_nid != nid) 391 if (page_nid != nid)
395 continue; 392 continue;
396 ret = sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj, 393 ret = sysfs_create_link_nowarn(&node_devices[nid].dev.kobj,
397 &mem_blk->sysdev.kobj, 394 &mem_blk->dev.kobj,
398 kobject_name(&mem_blk->sysdev.kobj)); 395 kobject_name(&mem_blk->dev.kobj));
399 if (ret) 396 if (ret)
400 return ret; 397 return ret;
401 398
402 return sysfs_create_link_nowarn(&mem_blk->sysdev.kobj, 399 return sysfs_create_link_nowarn(&mem_blk->dev.kobj,
403 &node_devices[nid].sysdev.kobj, 400 &node_devices[nid].dev.kobj,
404 kobject_name(&node_devices[nid].sysdev.kobj)); 401 kobject_name(&node_devices[nid].dev.kobj));
405 } 402 }
406 /* mem section does not span the specified node */ 403 /* mem section does not span the specified node */
407 return 0; 404 return 0;
@@ -434,10 +431,10 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
434 continue; 431 continue;
435 if (node_test_and_set(nid, *unlinked_nodes)) 432 if (node_test_and_set(nid, *unlinked_nodes))
436 continue; 433 continue;
437 sysfs_remove_link(&node_devices[nid].sysdev.kobj, 434 sysfs_remove_link(&node_devices[nid].dev.kobj,
438 kobject_name(&mem_blk->sysdev.kobj)); 435 kobject_name(&mem_blk->dev.kobj));
439 sysfs_remove_link(&mem_blk->sysdev.kobj, 436 sysfs_remove_link(&mem_blk->dev.kobj,
440 kobject_name(&node_devices[nid].sysdev.kobj)); 437 kobject_name(&node_devices[nid].dev.kobj));
441 } 438 }
442 NODEMASK_FREE(unlinked_nodes); 439 NODEMASK_FREE(unlinked_nodes);
443 return 0; 440 return 0;
@@ -468,7 +465,7 @@ static int link_mem_sections(int nid)
468 } 465 }
469 466
470 if (mem_blk) 467 if (mem_blk)
471 kobject_put(&mem_blk->sysdev.kobj); 468 kobject_put(&mem_blk->dev.kobj);
472 return err; 469 return err;
473} 470}
474 471
@@ -596,19 +593,19 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
596} 593}
597 594
598struct node_attr { 595struct node_attr {
599 struct sysdev_class_attribute attr; 596 struct device_attribute attr;
600 enum node_states state; 597 enum node_states state;
601}; 598};
602 599
603static ssize_t show_node_state(struct sysdev_class *class, 600static ssize_t show_node_state(struct device *dev,
604 struct sysdev_class_attribute *attr, char *buf) 601 struct device_attribute *attr, char *buf)
605{ 602{
606 struct node_attr *na = container_of(attr, struct node_attr, attr); 603 struct node_attr *na = container_of(attr, struct node_attr, attr);
607 return print_nodes_state(na->state, buf); 604 return print_nodes_state(na->state, buf);
608} 605}
609 606
610#define _NODE_ATTR(name, state) \ 607#define _NODE_ATTR(name, state) \
611 { _SYSDEV_CLASS_ATTR(name, 0444, show_node_state, NULL), state } 608 { __ATTR(name, 0444, show_node_state, NULL), state }
612 609
613static struct node_attr node_state_attr[] = { 610static struct node_attr node_state_attr[] = {
614 _NODE_ATTR(possible, N_POSSIBLE), 611 _NODE_ATTR(possible, N_POSSIBLE),
@@ -620,17 +617,26 @@ static struct node_attr node_state_attr[] = {
620#endif 617#endif
621}; 618};
622 619
623static struct sysdev_class_attribute *node_state_attrs[] = { 620static struct attribute *node_state_attrs[] = {
624 &node_state_attr[0].attr, 621 &node_state_attr[0].attr.attr,
625 &node_state_attr[1].attr, 622 &node_state_attr[1].attr.attr,
626 &node_state_attr[2].attr, 623 &node_state_attr[2].attr.attr,
627 &node_state_attr[3].attr, 624 &node_state_attr[3].attr.attr,
628#ifdef CONFIG_HIGHMEM 625#ifdef CONFIG_HIGHMEM
629 &node_state_attr[4].attr, 626 &node_state_attr[4].attr.attr,
630#endif 627#endif
631 NULL 628 NULL
632}; 629};
633 630
631static struct attribute_group memory_root_attr_group = {
632 .attrs = node_state_attrs,
633};
634
635static const struct attribute_group *cpu_root_attr_groups[] = {
636 &memory_root_attr_group,
637 NULL,
638};
639
634#define NODE_CALLBACK_PRI 2 /* lower than SLAB */ 640#define NODE_CALLBACK_PRI 2 /* lower than SLAB */
635static int __init register_node_type(void) 641static int __init register_node_type(void)
636{ 642{
@@ -639,7 +645,7 @@ static int __init register_node_type(void)
639 BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES); 645 BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES);
640 BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES); 646 BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES);
641 647
642 ret = sysdev_class_register(&node_class); 648 ret = subsys_system_register(&node_subsys, cpu_root_attr_groups);
643 if (!ret) { 649 if (!ret) {
644 hotplug_memory_notifier(node_memory_callback, 650 hotplug_memory_notifier(node_memory_callback,
645 NODE_CALLBACK_PRI); 651 NODE_CALLBACK_PRI);
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 7a24895543e7..a7c06374062e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -383,7 +383,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
383 * Returns &struct platform_device pointer on success, or ERR_PTR() on error. 383 * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
384 */ 384 */
385struct platform_device *platform_device_register_full( 385struct platform_device *platform_device_register_full(
386 struct platform_device_info *pdevinfo) 386 const struct platform_device_info *pdevinfo)
387{ 387{
388 int ret = -ENOMEM; 388 int ret = -ENOMEM;
389 struct platform_device *pdev; 389 struct platform_device *pdev;
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 9dff77bfe1e3..409f5ce78829 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -126,7 +126,7 @@ void sysdev_class_remove_file(struct sysdev_class *c,
126} 126}
127EXPORT_SYMBOL_GPL(sysdev_class_remove_file); 127EXPORT_SYMBOL_GPL(sysdev_class_remove_file);
128 128
129static struct kset *system_kset; 129extern struct kset *system_kset;
130 130
131int sysdev_class_register(struct sysdev_class *cls) 131int sysdev_class_register(struct sysdev_class *cls)
132{ 132{
@@ -331,14 +331,6 @@ void sysdev_unregister(struct sys_device *sysdev)
331EXPORT_SYMBOL_GPL(sysdev_register); 331EXPORT_SYMBOL_GPL(sysdev_register);
332EXPORT_SYMBOL_GPL(sysdev_unregister); 332EXPORT_SYMBOL_GPL(sysdev_unregister);
333 333
334int __init system_bus_init(void)
335{
336 system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
337 if (!system_kset)
338 return -ENOMEM;
339 return 0;
340}
341
342#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr) 334#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr)
343 335
344ssize_t sysdev_store_ulong(struct sys_device *sysdev, 336ssize_t sysdev_store_ulong(struct sys_device *sysdev,
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index f6f37a05a0c3..ae989c57cd5e 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.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/sysdev.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/cpu.h> 28#include <linux/cpu.h>
@@ -32,14 +31,14 @@
32#include <linux/topology.h> 31#include <linux/topology.h>
33 32
34#define define_one_ro_named(_name, _func) \ 33#define define_one_ro_named(_name, _func) \
35static SYSDEV_ATTR(_name, 0444, _func, NULL) 34 static DEVICE_ATTR(_name, 0444, _func, NULL)
36 35
37#define define_one_ro(_name) \ 36#define define_one_ro(_name) \
38static SYSDEV_ATTR(_name, 0444, show_##_name, NULL) 37 static DEVICE_ATTR(_name, 0444, show_##_name, NULL)
39 38
40#define define_id_show_func(name) \ 39#define define_id_show_func(name) \
41static ssize_t show_##name(struct sys_device *dev, \ 40static ssize_t show_##name(struct device *dev, \
42 struct sysdev_attribute *attr, char *buf) \ 41 struct device_attribute *attr, char *buf) \
43{ \ 42{ \
44 unsigned int cpu = dev->id; \ 43 unsigned int cpu = dev->id; \
45 return sprintf(buf, "%d\n", topology_##name(cpu)); \ 44 return sprintf(buf, "%d\n", topology_##name(cpu)); \
@@ -65,16 +64,16 @@ static ssize_t show_cpumap(int type, const struct cpumask *mask, char *buf)
65 64
66#ifdef arch_provides_topology_pointers 65#ifdef arch_provides_topology_pointers
67#define define_siblings_show_map(name) \ 66#define define_siblings_show_map(name) \
68static ssize_t show_##name(struct sys_device *dev, \ 67static ssize_t show_##name(struct device *dev, \
69 struct sysdev_attribute *attr, char *buf) \ 68 struct device_attribute *attr, char *buf) \
70{ \ 69{ \
71 unsigned int cpu = dev->id; \ 70 unsigned int cpu = dev->id; \
72 return show_cpumap(0, topology_##name(cpu), buf); \ 71 return show_cpumap(0, topology_##name(cpu), buf); \
73} 72}
74 73
75#define define_siblings_show_list(name) \ 74#define define_siblings_show_list(name) \
76static ssize_t show_##name##_list(struct sys_device *dev, \ 75static ssize_t show_##name##_list(struct device *dev, \
77 struct sysdev_attribute *attr, \ 76 struct device_attribute *attr, \
78 char *buf) \ 77 char *buf) \
79{ \ 78{ \
80 unsigned int cpu = dev->id; \ 79 unsigned int cpu = dev->id; \
@@ -83,15 +82,15 @@ static ssize_t show_##name##_list(struct sys_device *dev, \
83 82
84#else 83#else
85#define define_siblings_show_map(name) \ 84#define define_siblings_show_map(name) \
86static ssize_t show_##name(struct sys_device *dev, \ 85static ssize_t show_##name(struct device *dev, \
87 struct sysdev_attribute *attr, char *buf) \ 86 struct device_attribute *attr, char *buf) \
88{ \ 87{ \
89 return show_cpumap(0, topology_##name(dev->id), buf); \ 88 return show_cpumap(0, topology_##name(dev->id), buf); \
90} 89}
91 90
92#define define_siblings_show_list(name) \ 91#define define_siblings_show_list(name) \
93static ssize_t show_##name##_list(struct sys_device *dev, \ 92static ssize_t show_##name##_list(struct device *dev, \
94 struct sysdev_attribute *attr, \ 93 struct device_attribute *attr, \
95 char *buf) \ 94 char *buf) \
96{ \ 95{ \
97 return show_cpumap(1, topology_##name(dev->id), buf); \ 96 return show_cpumap(1, topology_##name(dev->id), buf); \
@@ -124,16 +123,16 @@ define_one_ro_named(book_siblings_list, show_book_cpumask_list);
124#endif 123#endif
125 124
126static struct attribute *default_attrs[] = { 125static struct attribute *default_attrs[] = {
127 &attr_physical_package_id.attr, 126 &dev_attr_physical_package_id.attr,
128 &attr_core_id.attr, 127 &dev_attr_core_id.attr,
129 &attr_thread_siblings.attr, 128 &dev_attr_thread_siblings.attr,
130 &attr_thread_siblings_list.attr, 129 &dev_attr_thread_siblings_list.attr,
131 &attr_core_siblings.attr, 130 &dev_attr_core_siblings.attr,
132 &attr_core_siblings_list.attr, 131 &dev_attr_core_siblings_list.attr,
133#ifdef CONFIG_SCHED_BOOK 132#ifdef CONFIG_SCHED_BOOK
134 &attr_book_id.attr, 133 &dev_attr_book_id.attr,
135 &attr_book_siblings.attr, 134 &dev_attr_book_siblings.attr,
136 &attr_book_siblings_list.attr, 135 &dev_attr_book_siblings_list.attr,
137#endif 136#endif
138 NULL 137 NULL
139}; 138};
@@ -146,16 +145,16 @@ static struct attribute_group topology_attr_group = {
146/* Add/Remove cpu_topology interface for CPU device */ 145/* Add/Remove cpu_topology interface for CPU device */
147static int __cpuinit topology_add_dev(unsigned int cpu) 146static int __cpuinit topology_add_dev(unsigned int cpu)
148{ 147{
149 struct sys_device *sys_dev = get_cpu_sysdev(cpu); 148 struct device *dev = get_cpu_device(cpu);
150 149
151 return sysfs_create_group(&sys_dev->kobj, &topology_attr_group); 150 return sysfs_create_group(&dev->kobj, &topology_attr_group);
152} 151}
153 152
154static void __cpuinit topology_remove_dev(unsigned int cpu) 153static void __cpuinit topology_remove_dev(unsigned int cpu)
155{ 154{
156 struct sys_device *sys_dev = get_cpu_sysdev(cpu); 155 struct device *dev = get_cpu_device(cpu);
157 156
158 sysfs_remove_group(&sys_dev->kobj, &topology_attr_group); 157 sysfs_remove_group(&dev->kobj, &topology_attr_group);
159} 158}
160 159
161static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, 160static int __cpuinit topology_cpu_callback(struct notifier_block *nfb,
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 1622772f802d..07f14d10ea49 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -430,19 +430,7 @@ static struct usb_driver ath3k_driver = {
430 .id_table = ath3k_table, 430 .id_table = ath3k_table,
431}; 431};
432 432
433static int __init ath3k_init(void) 433module_usb_driver(ath3k_driver);
434{
435 BT_INFO("Atheros AR30xx firmware driver ver %s", VERSION);
436 return usb_register(&ath3k_driver);
437}
438
439static void __exit ath3k_exit(void)
440{
441 usb_deregister(&ath3k_driver);
442}
443
444module_init(ath3k_init);
445module_exit(ath3k_exit);
446 434
447MODULE_AUTHOR("Atheros Communications"); 435MODULE_AUTHOR("Atheros Communications");
448MODULE_DESCRIPTION("Atheros AR30xx firmware driver"); 436MODULE_DESCRIPTION("Atheros AR30xx firmware driver");
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 54952ab800b8..1e742a50e2cd 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -281,26 +281,7 @@ static struct usb_driver bcm203x_driver = {
281 .id_table = bcm203x_table, 281 .id_table = bcm203x_table,
282}; 282};
283 283
284static int __init bcm203x_init(void) 284module_usb_driver(bcm203x_driver);
285{
286 int err;
287
288 BT_INFO("Broadcom Blutonium firmware driver ver %s", VERSION);
289
290 err = usb_register(&bcm203x_driver);
291 if (err < 0)
292 BT_ERR("Failed to register USB driver");
293
294 return err;
295}
296
297static void __exit bcm203x_exit(void)
298{
299 usb_deregister(&bcm203x_driver);
300}
301
302module_init(bcm203x_init);
303module_exit(bcm203x_exit);
304 285
305MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); 286MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
306MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); 287MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index a936763b8c3d..a323baee51b0 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -762,26 +762,7 @@ static struct usb_driver bfusb_driver = {
762 .id_table = bfusb_table, 762 .id_table = bfusb_table,
763}; 763};
764 764
765static int __init bfusb_init(void) 765module_usb_driver(bfusb_driver);
766{
767 int err;
768
769 BT_INFO("BlueFRITZ! USB driver ver %s", VERSION);
770
771 err = usb_register(&bfusb_driver);
772 if (err < 0)
773 BT_ERR("Failed to register BlueFRITZ! USB driver");
774
775 return err;
776}
777
778static void __exit bfusb_exit(void)
779{
780 usb_deregister(&bfusb_driver);
781}
782
783module_init(bfusb_init);
784module_exit(bfusb_exit);
785 766
786MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); 767MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
787MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); 768MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION);
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 751b338d904a..62831603de5e 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -521,20 +521,7 @@ static struct usb_driver bpa10x_driver = {
521 .id_table = bpa10x_table, 521 .id_table = bpa10x_table,
522}; 522};
523 523
524static int __init bpa10x_init(void) 524module_usb_driver(bpa10x_driver);
525{
526 BT_INFO("Digianswer Bluetooth USB driver ver %s", VERSION);
527
528 return usb_register(&bpa10x_driver);
529}
530
531static void __exit bpa10x_exit(void)
532{
533 usb_deregister(&bpa10x_driver);
534}
535
536module_init(bpa10x_init);
537module_exit(bpa10x_exit);
538 525
539MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); 526MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
540MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION); 527MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION);
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index fbfba802a3d7..55ac349695c4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1226,20 +1226,7 @@ static struct usb_driver btusb_driver = {
1226 .supports_autosuspend = 1, 1226 .supports_autosuspend = 1,
1227}; 1227};
1228 1228
1229static int __init btusb_init(void) 1229module_usb_driver(btusb_driver);
1230{
1231 BT_INFO("Generic Bluetooth USB driver ver %s", VERSION);
1232
1233 return usb_register(&btusb_driver);
1234}
1235
1236static void __exit btusb_exit(void)
1237{
1238 usb_deregister(&btusb_driver);
1239}
1240
1241module_init(btusb_init);
1242module_exit(btusb_exit);
1243 1230
1244module_param(ignore_dga, bool, 0644); 1231module_param(ignore_dga, bool, 0644);
1245MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001"); 1232MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001");
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 987a165ede26..8c2df3499da7 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -679,7 +679,7 @@ static struct kobj_type ktype_cpufreq = {
679 */ 679 */
680static int cpufreq_add_dev_policy(unsigned int cpu, 680static int cpufreq_add_dev_policy(unsigned int cpu,
681 struct cpufreq_policy *policy, 681 struct cpufreq_policy *policy,
682 struct sys_device *sys_dev) 682 struct device *dev)
683{ 683{
684 int ret = 0; 684 int ret = 0;
685#ifdef CONFIG_SMP 685#ifdef CONFIG_SMP
@@ -728,7 +728,7 @@ static int cpufreq_add_dev_policy(unsigned int cpu,
728 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 728 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
729 729
730 pr_debug("CPU already managed, adding link\n"); 730 pr_debug("CPU already managed, adding link\n");
731 ret = sysfs_create_link(&sys_dev->kobj, 731 ret = sysfs_create_link(&dev->kobj,
732 &managed_policy->kobj, 732 &managed_policy->kobj,
733 "cpufreq"); 733 "cpufreq");
734 if (ret) 734 if (ret)
@@ -761,7 +761,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
761 761
762 for_each_cpu(j, policy->cpus) { 762 for_each_cpu(j, policy->cpus) {
763 struct cpufreq_policy *managed_policy; 763 struct cpufreq_policy *managed_policy;
764 struct sys_device *cpu_sys_dev; 764 struct device *cpu_dev;
765 765
766 if (j == cpu) 766 if (j == cpu)
767 continue; 767 continue;
@@ -770,8 +770,8 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
770 770
771 pr_debug("CPU %u already managed, adding link\n", j); 771 pr_debug("CPU %u already managed, adding link\n", j);
772 managed_policy = cpufreq_cpu_get(cpu); 772 managed_policy = cpufreq_cpu_get(cpu);
773 cpu_sys_dev = get_cpu_sysdev(j); 773 cpu_dev = get_cpu_device(j);
774 ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, 774 ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj,
775 "cpufreq"); 775 "cpufreq");
776 if (ret) { 776 if (ret) {
777 cpufreq_cpu_put(managed_policy); 777 cpufreq_cpu_put(managed_policy);
@@ -783,7 +783,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
783 783
784static int cpufreq_add_dev_interface(unsigned int cpu, 784static int cpufreq_add_dev_interface(unsigned int cpu,
785 struct cpufreq_policy *policy, 785 struct cpufreq_policy *policy,
786 struct sys_device *sys_dev) 786 struct device *dev)
787{ 787{
788 struct cpufreq_policy new_policy; 788 struct cpufreq_policy new_policy;
789 struct freq_attr **drv_attr; 789 struct freq_attr **drv_attr;
@@ -793,7 +793,7 @@ static int cpufreq_add_dev_interface(unsigned int cpu,
793 793
794 /* prepare interface data */ 794 /* prepare interface data */
795 ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, 795 ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq,
796 &sys_dev->kobj, "cpufreq"); 796 &dev->kobj, "cpufreq");
797 if (ret) 797 if (ret)
798 return ret; 798 return ret;
799 799
@@ -866,9 +866,9 @@ err_out_kobj_put:
866 * with with cpu hotplugging and all hell will break loose. Tried to clean this 866 * with with cpu hotplugging and all hell will break loose. Tried to clean this
867 * mess up, but more thorough testing is needed. - Mathieu 867 * mess up, but more thorough testing is needed. - Mathieu
868 */ 868 */
869static int cpufreq_add_dev(struct sys_device *sys_dev) 869static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
870{ 870{
871 unsigned int cpu = sys_dev->id; 871 unsigned int cpu = dev->id;
872 int ret = 0, found = 0; 872 int ret = 0, found = 0;
873 struct cpufreq_policy *policy; 873 struct cpufreq_policy *policy;
874 unsigned long flags; 874 unsigned long flags;
@@ -947,7 +947,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
947 blocking_notifier_call_chain(&cpufreq_policy_notifier_list, 947 blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
948 CPUFREQ_START, policy); 948 CPUFREQ_START, policy);
949 949
950 ret = cpufreq_add_dev_policy(cpu, policy, sys_dev); 950 ret = cpufreq_add_dev_policy(cpu, policy, dev);
951 if (ret) { 951 if (ret) {
952 if (ret > 0) 952 if (ret > 0)
953 /* This is a managed cpu, symlink created, 953 /* This is a managed cpu, symlink created,
@@ -956,7 +956,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
956 goto err_unlock_policy; 956 goto err_unlock_policy;
957 } 957 }
958 958
959 ret = cpufreq_add_dev_interface(cpu, policy, sys_dev); 959 ret = cpufreq_add_dev_interface(cpu, policy, dev);
960 if (ret) 960 if (ret)
961 goto err_out_unregister; 961 goto err_out_unregister;
962 962
@@ -999,15 +999,15 @@ module_out:
999 * Caller should already have policy_rwsem in write mode for this CPU. 999 * Caller should already have policy_rwsem in write mode for this CPU.
1000 * This routine frees the rwsem before returning. 1000 * This routine frees the rwsem before returning.
1001 */ 1001 */
1002static int __cpufreq_remove_dev(struct sys_device *sys_dev) 1002static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
1003{ 1003{
1004 unsigned int cpu = sys_dev->id; 1004 unsigned int cpu = dev->id;
1005 unsigned long flags; 1005 unsigned long flags;
1006 struct cpufreq_policy *data; 1006 struct cpufreq_policy *data;
1007 struct kobject *kobj; 1007 struct kobject *kobj;
1008 struct completion *cmp; 1008 struct completion *cmp;
1009#ifdef CONFIG_SMP 1009#ifdef CONFIG_SMP
1010 struct sys_device *cpu_sys_dev; 1010 struct device *cpu_dev;
1011 unsigned int j; 1011 unsigned int j;
1012#endif 1012#endif
1013 1013
@@ -1032,7 +1032,7 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1032 pr_debug("removing link\n"); 1032 pr_debug("removing link\n");
1033 cpumask_clear_cpu(cpu, data->cpus); 1033 cpumask_clear_cpu(cpu, data->cpus);
1034 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1034 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1035 kobj = &sys_dev->kobj; 1035 kobj = &dev->kobj;
1036 cpufreq_cpu_put(data); 1036 cpufreq_cpu_put(data);
1037 unlock_policy_rwsem_write(cpu); 1037 unlock_policy_rwsem_write(cpu);
1038 sysfs_remove_link(kobj, "cpufreq"); 1038 sysfs_remove_link(kobj, "cpufreq");
@@ -1071,8 +1071,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1071 strncpy(per_cpu(cpufreq_cpu_governor, j), 1071 strncpy(per_cpu(cpufreq_cpu_governor, j),
1072 data->governor->name, CPUFREQ_NAME_LEN); 1072 data->governor->name, CPUFREQ_NAME_LEN);
1073#endif 1073#endif
1074 cpu_sys_dev = get_cpu_sysdev(j); 1074 cpu_dev = get_cpu_device(j);
1075 kobj = &cpu_sys_dev->kobj; 1075 kobj = &cpu_dev->kobj;
1076 unlock_policy_rwsem_write(cpu); 1076 unlock_policy_rwsem_write(cpu);
1077 sysfs_remove_link(kobj, "cpufreq"); 1077 sysfs_remove_link(kobj, "cpufreq");
1078 lock_policy_rwsem_write(cpu); 1078 lock_policy_rwsem_write(cpu);
@@ -1112,11 +1112,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1112 if (unlikely(cpumask_weight(data->cpus) > 1)) { 1112 if (unlikely(cpumask_weight(data->cpus) > 1)) {
1113 /* first sibling now owns the new sysfs dir */ 1113 /* first sibling now owns the new sysfs dir */
1114 cpumask_clear_cpu(cpu, data->cpus); 1114 cpumask_clear_cpu(cpu, data->cpus);
1115 cpufreq_add_dev(get_cpu_sysdev(cpumask_first(data->cpus))); 1115 cpufreq_add_dev(get_cpu_device(cpumask_first(data->cpus)), NULL);
1116 1116
1117 /* finally remove our own symlink */ 1117 /* finally remove our own symlink */
1118 lock_policy_rwsem_write(cpu); 1118 lock_policy_rwsem_write(cpu);
1119 __cpufreq_remove_dev(sys_dev); 1119 __cpufreq_remove_dev(dev, sif);
1120 } 1120 }
1121#endif 1121#endif
1122 1122
@@ -1128,9 +1128,9 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1128} 1128}
1129 1129
1130 1130
1131static int cpufreq_remove_dev(struct sys_device *sys_dev) 1131static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
1132{ 1132{
1133 unsigned int cpu = sys_dev->id; 1133 unsigned int cpu = dev->id;
1134 int retval; 1134 int retval;
1135 1135
1136 if (cpu_is_offline(cpu)) 1136 if (cpu_is_offline(cpu))
@@ -1139,7 +1139,7 @@ static int cpufreq_remove_dev(struct sys_device *sys_dev)
1139 if (unlikely(lock_policy_rwsem_write(cpu))) 1139 if (unlikely(lock_policy_rwsem_write(cpu)))
1140 BUG(); 1140 BUG();
1141 1141
1142 retval = __cpufreq_remove_dev(sys_dev); 1142 retval = __cpufreq_remove_dev(dev, sif);
1143 return retval; 1143 return retval;
1144} 1144}
1145 1145
@@ -1271,9 +1271,11 @@ out:
1271} 1271}
1272EXPORT_SYMBOL(cpufreq_get); 1272EXPORT_SYMBOL(cpufreq_get);
1273 1273
1274static struct sysdev_driver cpufreq_sysdev_driver = { 1274static struct subsys_interface cpufreq_interface = {
1275 .add = cpufreq_add_dev, 1275 .name = "cpufreq",
1276 .remove = cpufreq_remove_dev, 1276 .subsys = &cpu_subsys,
1277 .add_dev = cpufreq_add_dev,
1278 .remove_dev = cpufreq_remove_dev,
1277}; 1279};
1278 1280
1279 1281
@@ -1765,25 +1767,25 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
1765 unsigned long action, void *hcpu) 1767 unsigned long action, void *hcpu)
1766{ 1768{
1767 unsigned int cpu = (unsigned long)hcpu; 1769 unsigned int cpu = (unsigned long)hcpu;
1768 struct sys_device *sys_dev; 1770 struct device *dev;
1769 1771
1770 sys_dev = get_cpu_sysdev(cpu); 1772 dev = get_cpu_device(cpu);
1771 if (sys_dev) { 1773 if (dev) {
1772 switch (action) { 1774 switch (action) {
1773 case CPU_ONLINE: 1775 case CPU_ONLINE:
1774 case CPU_ONLINE_FROZEN: 1776 case CPU_ONLINE_FROZEN:
1775 cpufreq_add_dev(sys_dev); 1777 cpufreq_add_dev(dev, NULL);
1776 break; 1778 break;
1777 case CPU_DOWN_PREPARE: 1779 case CPU_DOWN_PREPARE:
1778 case CPU_DOWN_PREPARE_FROZEN: 1780 case CPU_DOWN_PREPARE_FROZEN:
1779 if (unlikely(lock_policy_rwsem_write(cpu))) 1781 if (unlikely(lock_policy_rwsem_write(cpu)))
1780 BUG(); 1782 BUG();
1781 1783
1782 __cpufreq_remove_dev(sys_dev); 1784 __cpufreq_remove_dev(dev, NULL);
1783 break; 1785 break;
1784 case CPU_DOWN_FAILED: 1786 case CPU_DOWN_FAILED:
1785 case CPU_DOWN_FAILED_FROZEN: 1787 case CPU_DOWN_FAILED_FROZEN:
1786 cpufreq_add_dev(sys_dev); 1788 cpufreq_add_dev(dev, NULL);
1787 break; 1789 break;
1788 } 1790 }
1789 } 1791 }
@@ -1830,8 +1832,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1830 cpufreq_driver = driver_data; 1832 cpufreq_driver = driver_data;
1831 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1833 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1832 1834
1833 ret = sysdev_driver_register(&cpu_sysdev_class, 1835 ret = subsys_interface_register(&cpufreq_interface);
1834 &cpufreq_sysdev_driver);
1835 if (ret) 1836 if (ret)
1836 goto err_null_driver; 1837 goto err_null_driver;
1837 1838
@@ -1850,7 +1851,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1850 if (ret) { 1851 if (ret) {
1851 pr_debug("no CPU initialized for driver %s\n", 1852 pr_debug("no CPU initialized for driver %s\n",
1852 driver_data->name); 1853 driver_data->name);
1853 goto err_sysdev_unreg; 1854 goto err_if_unreg;
1854 } 1855 }
1855 } 1856 }
1856 1857
@@ -1858,9 +1859,8 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1858 pr_debug("driver %s up and running\n", driver_data->name); 1859 pr_debug("driver %s up and running\n", driver_data->name);
1859 1860
1860 return 0; 1861 return 0;
1861err_sysdev_unreg: 1862err_if_unreg:
1862 sysdev_driver_unregister(&cpu_sysdev_class, 1863 subsys_interface_unregister(&cpufreq_interface);
1863 &cpufreq_sysdev_driver);
1864err_null_driver: 1864err_null_driver:
1865 spin_lock_irqsave(&cpufreq_driver_lock, flags); 1865 spin_lock_irqsave(&cpufreq_driver_lock, flags);
1866 cpufreq_driver = NULL; 1866 cpufreq_driver = NULL;
@@ -1887,7 +1887,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
1887 1887
1888 pr_debug("unregistering driver %s\n", driver->name); 1888 pr_debug("unregistering driver %s\n", driver->name);
1889 1889
1890 sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver); 1890 subsys_interface_unregister(&cpufreq_interface);
1891 unregister_hotcpu_notifier(&cpufreq_cpu_notifier); 1891 unregister_hotcpu_notifier(&cpufreq_cpu_notifier);
1892 1892
1893 spin_lock_irqsave(&cpufreq_driver_lock, flags); 1893 spin_lock_irqsave(&cpufreq_driver_lock, flags);
@@ -1907,8 +1907,7 @@ static int __init cpufreq_core_init(void)
1907 init_rwsem(&per_cpu(cpu_policy_rwsem, cpu)); 1907 init_rwsem(&per_cpu(cpu_policy_rwsem, cpu));
1908 } 1908 }
1909 1909
1910 cpufreq_global_kobject = kobject_create_and_add("cpufreq", 1910 cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
1911 &cpu_sysdev_class.kset.kobj);
1912 BUG_ON(!cpufreq_global_kobject); 1911 BUG_ON(!cpufreq_global_kobject);
1913 register_syscore_ops(&cpufreq_syscore_ops); 1912 register_syscore_ops(&cpufreq_syscore_ops);
1914 1913
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 2a508edd768b..b40ee1403be9 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/sysdev.h>
15#include <linux/cpu.h> 14#include <linux/cpu.h>
16#include <linux/sysfs.h> 15#include <linux/sysfs.h>
17#include <linux/cpufreq.h> 16#include <linux/cpufreq.h>
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 06ce2680d00d..59f4261c753a 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -291,10 +291,10 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device);
291static int __cpuidle_register_device(struct cpuidle_device *dev) 291static int __cpuidle_register_device(struct cpuidle_device *dev)
292{ 292{
293 int ret; 293 int ret;
294 struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); 294 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
295 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 295 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
296 296
297 if (!sys_dev) 297 if (!dev)
298 return -EINVAL; 298 return -EINVAL;
299 if (!try_module_get(cpuidle_driver->owner)) 299 if (!try_module_get(cpuidle_driver->owner))
300 return -EINVAL; 300 return -EINVAL;
@@ -303,7 +303,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
303 303
304 per_cpu(cpuidle_devices, dev->cpu) = dev; 304 per_cpu(cpuidle_devices, dev->cpu) = dev;
305 list_add(&dev->device_list, &cpuidle_detected_devices); 305 list_add(&dev->device_list, &cpuidle_detected_devices);
306 if ((ret = cpuidle_add_sysfs(sys_dev))) { 306 if ((ret = cpuidle_add_sysfs(cpu_dev))) {
307 module_put(cpuidle_driver->owner); 307 module_put(cpuidle_driver->owner);
308 return ret; 308 return ret;
309 } 309 }
@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device);
344 */ 344 */
345void cpuidle_unregister_device(struct cpuidle_device *dev) 345void cpuidle_unregister_device(struct cpuidle_device *dev)
346{ 346{
347 struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); 347 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
348 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); 348 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
349 349
350 if (dev->registered == 0) 350 if (dev->registered == 0)
@@ -354,7 +354,7 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)
354 354
355 cpuidle_disable_device(dev); 355 cpuidle_disable_device(dev);
356 356
357 cpuidle_remove_sysfs(sys_dev); 357 cpuidle_remove_sysfs(cpu_dev);
358 list_del(&dev->device_list); 358 list_del(&dev->device_list);
359 wait_for_completion(&dev->kobj_unregister); 359 wait_for_completion(&dev->kobj_unregister);
360 per_cpu(cpuidle_devices, dev->cpu) = NULL; 360 per_cpu(cpuidle_devices, dev->cpu) = NULL;
@@ -411,7 +411,7 @@ static int __init cpuidle_init(void)
411 if (cpuidle_disabled()) 411 if (cpuidle_disabled())
412 return -ENODEV; 412 return -ENODEV;
413 413
414 ret = cpuidle_add_class_sysfs(&cpu_sysdev_class); 414 ret = cpuidle_add_interface(cpu_subsys.dev_root);
415 if (ret) 415 if (ret)
416 return ret; 416 return ret;
417 417
diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h
index 38c3fd8b9d76..7db186685c27 100644
--- a/drivers/cpuidle/cpuidle.h
+++ b/drivers/cpuidle/cpuidle.h
@@ -5,7 +5,7 @@
5#ifndef __DRIVER_CPUIDLE_H 5#ifndef __DRIVER_CPUIDLE_H
6#define __DRIVER_CPUIDLE_H 6#define __DRIVER_CPUIDLE_H
7 7
8#include <linux/sysdev.h> 8#include <linux/device.h>
9 9
10/* For internal use only */ 10/* For internal use only */
11extern struct cpuidle_governor *cpuidle_curr_governor; 11extern struct cpuidle_governor *cpuidle_curr_governor;
@@ -23,11 +23,11 @@ extern void cpuidle_uninstall_idle_handler(void);
23extern int cpuidle_switch_governor(struct cpuidle_governor *gov); 23extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
24 24
25/* sysfs */ 25/* sysfs */
26extern int cpuidle_add_class_sysfs(struct sysdev_class *cls); 26extern int cpuidle_add_interface(struct device *dev);
27extern void cpuidle_remove_class_sysfs(struct sysdev_class *cls); 27extern void cpuidle_remove_interface(struct device *dev);
28extern int cpuidle_add_state_sysfs(struct cpuidle_device *device); 28extern int cpuidle_add_state_sysfs(struct cpuidle_device *device);
29extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); 29extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device);
30extern int cpuidle_add_sysfs(struct sys_device *sysdev); 30extern int cpuidle_add_sysfs(struct device *dev);
31extern void cpuidle_remove_sysfs(struct sys_device *sysdev); 31extern void cpuidle_remove_sysfs(struct device *dev);
32 32
33#endif /* __DRIVER_CPUIDLE_H */ 33#endif /* __DRIVER_CPUIDLE_H */
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 1e756e160dca..3fe41fe4851a 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -22,8 +22,8 @@ static int __init cpuidle_sysfs_setup(char *unused)
22} 22}
23__setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); 23__setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);
24 24
25static ssize_t show_available_governors(struct sysdev_class *class, 25static ssize_t show_available_governors(struct device *dev,
26 struct sysdev_class_attribute *attr, 26 struct device_attribute *attr,
27 char *buf) 27 char *buf)
28{ 28{
29 ssize_t i = 0; 29 ssize_t i = 0;
@@ -42,8 +42,8 @@ out:
42 return i; 42 return i;
43} 43}
44 44
45static ssize_t show_current_driver(struct sysdev_class *class, 45static ssize_t show_current_driver(struct device *dev,
46 struct sysdev_class_attribute *attr, 46 struct device_attribute *attr,
47 char *buf) 47 char *buf)
48{ 48{
49 ssize_t ret; 49 ssize_t ret;
@@ -59,8 +59,8 @@ static ssize_t show_current_driver(struct sysdev_class *class,
59 return ret; 59 return ret;
60} 60}
61 61
62static ssize_t show_current_governor(struct sysdev_class *class, 62static ssize_t show_current_governor(struct device *dev,
63 struct sysdev_class_attribute *attr, 63 struct device_attribute *attr,
64 char *buf) 64 char *buf)
65{ 65{
66 ssize_t ret; 66 ssize_t ret;
@@ -75,8 +75,8 @@ static ssize_t show_current_governor(struct sysdev_class *class,
75 return ret; 75 return ret;
76} 76}
77 77
78static ssize_t store_current_governor(struct sysdev_class *class, 78static ssize_t store_current_governor(struct device *dev,
79 struct sysdev_class_attribute *attr, 79 struct device_attribute *attr,
80 const char *buf, size_t count) 80 const char *buf, size_t count)
81{ 81{
82 char gov_name[CPUIDLE_NAME_LEN]; 82 char gov_name[CPUIDLE_NAME_LEN];
@@ -109,50 +109,48 @@ static ssize_t store_current_governor(struct sysdev_class *class,
109 return count; 109 return count;
110} 110}
111 111
112static SYSDEV_CLASS_ATTR(current_driver, 0444, show_current_driver, NULL); 112static DEVICE_ATTR(current_driver, 0444, show_current_driver, NULL);
113static SYSDEV_CLASS_ATTR(current_governor_ro, 0444, show_current_governor, 113static DEVICE_ATTR(current_governor_ro, 0444, show_current_governor, NULL);
114 NULL);
115 114
116static struct attribute *cpuclass_default_attrs[] = { 115static struct attribute *cpuidle_default_attrs[] = {
117 &attr_current_driver.attr, 116 &dev_attr_current_driver.attr,
118 &attr_current_governor_ro.attr, 117 &dev_attr_current_governor_ro.attr,
119 NULL 118 NULL
120}; 119};
121 120
122static SYSDEV_CLASS_ATTR(available_governors, 0444, show_available_governors, 121static DEVICE_ATTR(available_governors, 0444, show_available_governors, NULL);
123 NULL); 122static DEVICE_ATTR(current_governor, 0644, show_current_governor,
124static SYSDEV_CLASS_ATTR(current_governor, 0644, show_current_governor, 123 store_current_governor);
125 store_current_governor);
126 124
127static struct attribute *cpuclass_switch_attrs[] = { 125static struct attribute *cpuidle_switch_attrs[] = {
128 &attr_available_governors.attr, 126 &dev_attr_available_governors.attr,
129 &attr_current_driver.attr, 127 &dev_attr_current_driver.attr,
130 &attr_current_governor.attr, 128 &dev_attr_current_governor.attr,
131 NULL 129 NULL
132}; 130};
133 131
134static struct attribute_group cpuclass_attr_group = { 132static struct attribute_group cpuidle_attr_group = {
135 .attrs = cpuclass_default_attrs, 133 .attrs = cpuidle_default_attrs,
136 .name = "cpuidle", 134 .name = "cpuidle",
137}; 135};
138 136
139/** 137/**
140 * cpuidle_add_class_sysfs - add CPU global sysfs attributes 138 * cpuidle_add_interface - add CPU global sysfs attributes
141 */ 139 */
142int cpuidle_add_class_sysfs(struct sysdev_class *cls) 140int cpuidle_add_interface(struct device *dev)
143{ 141{
144 if (sysfs_switch) 142 if (sysfs_switch)
145 cpuclass_attr_group.attrs = cpuclass_switch_attrs; 143 cpuidle_attr_group.attrs = cpuidle_switch_attrs;
146 144
147 return sysfs_create_group(&cls->kset.kobj, &cpuclass_attr_group); 145 return sysfs_create_group(&dev->kobj, &cpuidle_attr_group);
148} 146}
149 147
150/** 148/**
151 * cpuidle_remove_class_sysfs - remove CPU global sysfs attributes 149 * cpuidle_remove_interface - remove CPU global sysfs attributes
152 */ 150 */
153void cpuidle_remove_class_sysfs(struct sysdev_class *cls) 151void cpuidle_remove_interface(struct device *dev)
154{ 152{
155 sysfs_remove_group(&cls->kset.kobj, &cpuclass_attr_group); 153 sysfs_remove_group(&dev->kobj, &cpuidle_attr_group);
156} 154}
157 155
158struct cpuidle_attr { 156struct cpuidle_attr {
@@ -365,16 +363,16 @@ void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
365 363
366/** 364/**
367 * cpuidle_add_sysfs - creates a sysfs instance for the target device 365 * cpuidle_add_sysfs - creates a sysfs instance for the target device
368 * @sysdev: the target device 366 * @dev: the target device
369 */ 367 */
370int cpuidle_add_sysfs(struct sys_device *sysdev) 368int cpuidle_add_sysfs(struct device *cpu_dev)
371{ 369{
372 int cpu = sysdev->id; 370 int cpu = cpu_dev->id;
373 struct cpuidle_device *dev; 371 struct cpuidle_device *dev;
374 int error; 372 int error;
375 373
376 dev = per_cpu(cpuidle_devices, cpu); 374 dev = per_cpu(cpuidle_devices, cpu);
377 error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &sysdev->kobj, 375 error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj,
378 "cpuidle"); 376 "cpuidle");
379 if (!error) 377 if (!error)
380 kobject_uevent(&dev->kobj, KOBJ_ADD); 378 kobject_uevent(&dev->kobj, KOBJ_ADD);
@@ -383,11 +381,11 @@ int cpuidle_add_sysfs(struct sys_device *sysdev)
383 381
384/** 382/**
385 * cpuidle_remove_sysfs - deletes a sysfs instance on the target device 383 * cpuidle_remove_sysfs - deletes a sysfs instance on the target device
386 * @sysdev: the target device 384 * @dev: the target device
387 */ 385 */
388void cpuidle_remove_sysfs(struct sys_device *sysdev) 386void cpuidle_remove_sysfs(struct device *cpu_dev)
389{ 387{
390 int cpu = sysdev->id; 388 int cpu = cpu_dev->id;
391 struct cpuidle_device *dev; 389 struct cpuidle_device *dev;
392 390
393 dev = per_cpu(cpuidle_devices, cpu); 391 dev = per_cpu(cpuidle_devices, cpu);
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index fe90cd4a7ebc..e48ab3108ad8 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -32,7 +32,6 @@
32#include <linux/completion.h> 32#include <linux/completion.h>
33#include <linux/kobject.h> 33#include <linux/kobject.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/sysdev.h>
36#include <linux/workqueue.h> 35#include <linux/workqueue.h>
37#include <linux/edac.h> 36#include <linux/edac.h>
38 37
@@ -243,8 +242,8 @@ struct edac_device_ctl_info {
243 */ 242 */
244 struct edac_dev_sysfs_attribute *sysfs_attributes; 243 struct edac_dev_sysfs_attribute *sysfs_attributes;
245 244
246 /* pointer to main 'edac' class in sysfs */ 245 /* pointer to main 'edac' subsys in sysfs */
247 struct sysdev_class *edac_class; 246 struct bus_type *edac_subsys;
248 247
249 /* the internal state of this controller instance */ 248 /* the internal state of this controller instance */
250 int op_state; 249 int op_state;
@@ -342,7 +341,7 @@ struct edac_pci_ctl_info {
342 341
343 int pci_idx; 342 int pci_idx;
344 343
345 struct sysdev_class *edac_class; /* pointer to class */ 344 struct bus_type *edac_subsys; /* pointer to subsystem */
346 345
347 /* the internal state of this controller instance */ 346 /* the internal state of this controller instance */
348 int op_state; 347 int op_state;
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index c3f67437afb6..4b154593343a 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -23,7 +23,6 @@
23#include <linux/jiffies.h> 23#include <linux/jiffies.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/list.h> 25#include <linux/list.h>
26#include <linux/sysdev.h>
27#include <linux/ctype.h> 26#include <linux/ctype.h>
28#include <linux/workqueue.h> 27#include <linux/workqueue.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 86649df00285..b4ea185ccebf 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * file for managing the edac_device class of devices for EDAC 2 * file for managing the edac_device subsystem of devices for EDAC
3 * 3 *
4 * (C) 2007 SoftwareBitMaker 4 * (C) 2007 SoftwareBitMaker
5 * 5 *
@@ -230,21 +230,21 @@ static struct kobj_type ktype_device_ctrl = {
230 */ 230 */
231int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev) 231int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
232{ 232{
233 struct sysdev_class *edac_class; 233 struct bus_type *edac_subsys;
234 int err; 234 int err;
235 235
236 debugf1("%s()\n", __func__); 236 debugf1("%s()\n", __func__);
237 237
238 /* get the /sys/devices/system/edac reference */ 238 /* get the /sys/devices/system/edac reference */
239 edac_class = edac_get_sysfs_class(); 239 edac_subsys = edac_get_sysfs_subsys();
240 if (edac_class == NULL) { 240 if (edac_subsys == NULL) {
241 debugf1("%s() no edac_class error\n", __func__); 241 debugf1("%s() no edac_subsys error\n", __func__);
242 err = -ENODEV; 242 err = -ENODEV;
243 goto err_out; 243 goto err_out;
244 } 244 }
245 245
246 /* Point to the 'edac_class' this instance 'reports' to */ 246 /* Point to the 'edac_subsys' this instance 'reports' to */
247 edac_dev->edac_class = edac_class; 247 edac_dev->edac_subsys = edac_subsys;
248 248
249 /* Init the devices's kobject */ 249 /* Init the devices's kobject */
250 memset(&edac_dev->kobj, 0, sizeof(struct kobject)); 250 memset(&edac_dev->kobj, 0, sizeof(struct kobject));
@@ -261,7 +261,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
261 261
262 /* register */ 262 /* register */
263 err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl, 263 err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl,
264 &edac_class->kset.kobj, 264 &edac_subsys->dev_root->kobj,
265 "%s", edac_dev->name); 265 "%s", edac_dev->name);
266 if (err) { 266 if (err) {
267 debugf1("%s()Failed to register '.../edac/%s'\n", 267 debugf1("%s()Failed to register '.../edac/%s'\n",
@@ -284,7 +284,7 @@ err_kobj_reg:
284 module_put(edac_dev->owner); 284 module_put(edac_dev->owner);
285 285
286err_mod_get: 286err_mod_get:
287 edac_put_sysfs_class(); 287 edac_put_sysfs_subsys();
288 288
289err_out: 289err_out:
290 return err; 290 return err;
@@ -308,7 +308,7 @@ void edac_device_unregister_sysfs_main_kobj(struct edac_device_ctl_info *dev)
308 * b) 'kfree' the memory 308 * b) 'kfree' the memory
309 */ 309 */
310 kobject_put(&dev->kobj); 310 kobject_put(&dev->kobj);
311 edac_put_sysfs_class(); 311 edac_put_sysfs_subsys();
312} 312}
313 313
314/* edac_dev -> instance information */ 314/* edac_dev -> instance information */
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index d69144a09043..ca6c04d350ee 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -25,7 +25,6 @@
25#include <linux/jiffies.h> 25#include <linux/jiffies.h>
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/sysdev.h>
29#include <linux/ctype.h> 28#include <linux/ctype.h>
30#include <linux/edac.h> 29#include <linux/edac.h>
31#include <asm/uaccess.h> 30#include <asm/uaccess.h>
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 29ffa350bfbe..d56e63477d5c 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -1021,19 +1021,19 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1021int edac_sysfs_setup_mc_kset(void) 1021int edac_sysfs_setup_mc_kset(void)
1022{ 1022{
1023 int err = -EINVAL; 1023 int err = -EINVAL;
1024 struct sysdev_class *edac_class; 1024 struct bus_type *edac_subsys;
1025 1025
1026 debugf1("%s()\n", __func__); 1026 debugf1("%s()\n", __func__);
1027 1027
1028 /* get the /sys/devices/system/edac class reference */ 1028 /* get the /sys/devices/system/edac subsys reference */
1029 edac_class = edac_get_sysfs_class(); 1029 edac_subsys = edac_get_sysfs_subsys();
1030 if (edac_class == NULL) { 1030 if (edac_subsys == NULL) {
1031 debugf1("%s() no edac_class error=%d\n", __func__, err); 1031 debugf1("%s() no edac_subsys error=%d\n", __func__, err);
1032 goto fail_out; 1032 goto fail_out;
1033 } 1033 }
1034 1034
1035 /* Init the MC's kobject */ 1035 /* Init the MC's kobject */
1036 mc_kset = kset_create_and_add("mc", NULL, &edac_class->kset.kobj); 1036 mc_kset = kset_create_and_add("mc", NULL, &edac_subsys->dev_root->kobj);
1037 if (!mc_kset) { 1037 if (!mc_kset) {
1038 err = -ENOMEM; 1038 err = -ENOMEM;
1039 debugf1("%s() Failed to register '.../edac/mc'\n", __func__); 1039 debugf1("%s() Failed to register '.../edac/mc'\n", __func__);
@@ -1045,7 +1045,7 @@ int edac_sysfs_setup_mc_kset(void)
1045 return 0; 1045 return 0;
1046 1046
1047fail_kset: 1047fail_kset:
1048 edac_put_sysfs_class(); 1048 edac_put_sysfs_subsys();
1049 1049
1050fail_out: 1050fail_out:
1051 return err; 1051 return err;
@@ -1059,6 +1059,6 @@ fail_out:
1059void edac_sysfs_teardown_mc_kset(void) 1059void edac_sysfs_teardown_mc_kset(void)
1060{ 1060{
1061 kset_unregister(mc_kset); 1061 kset_unregister(mc_kset);
1062 edac_put_sysfs_class(); 1062 edac_put_sysfs_subsys();
1063} 1063}
1064 1064
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h
index 17aabb7b90ec..00f81b47a51f 100644
--- a/drivers/edac/edac_module.h
+++ b/drivers/edac/edac_module.h
@@ -10,8 +10,6 @@
10#ifndef __EDAC_MODULE_H__ 10#ifndef __EDAC_MODULE_H__
11#define __EDAC_MODULE_H__ 11#define __EDAC_MODULE_H__
12 12
13#include <linux/sysdev.h>
14
15#include "edac_core.h" 13#include "edac_core.h"
16 14
17/* 15/*
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 2b378207d571..63af1c5673d1 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -19,7 +19,6 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/sysdev.h>
23#include <linux/ctype.h> 22#include <linux/ctype.h>
24#include <linux/workqueue.h> 23#include <linux/workqueue.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 495198ad059c..97f5064e3992 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -338,12 +338,12 @@ static struct kobj_type ktype_edac_pci_main_kobj = {
338 * edac_pci_main_kobj_setup() 338 * edac_pci_main_kobj_setup()
339 * 339 *
340 * setup the sysfs for EDAC PCI attributes 340 * setup the sysfs for EDAC PCI attributes
341 * assumes edac_class has already been initialized 341 * assumes edac_subsys has already been initialized
342 */ 342 */
343static int edac_pci_main_kobj_setup(void) 343static int edac_pci_main_kobj_setup(void)
344{ 344{
345 int err; 345 int err;
346 struct sysdev_class *edac_class; 346 struct bus_type *edac_subsys;
347 347
348 debugf0("%s()\n", __func__); 348 debugf0("%s()\n", __func__);
349 349
@@ -354,9 +354,9 @@ static int edac_pci_main_kobj_setup(void)
354 /* First time, so create the main kobject and its 354 /* First time, so create the main kobject and its
355 * controls and attributes 355 * controls and attributes
356 */ 356 */
357 edac_class = edac_get_sysfs_class(); 357 edac_subsys = edac_get_sysfs_subsys();
358 if (edac_class == NULL) { 358 if (edac_subsys == NULL) {
359 debugf1("%s() no edac_class\n", __func__); 359 debugf1("%s() no edac_subsys\n", __func__);
360 err = -ENODEV; 360 err = -ENODEV;
361 goto decrement_count_fail; 361 goto decrement_count_fail;
362 } 362 }
@@ -381,7 +381,7 @@ static int edac_pci_main_kobj_setup(void)
381 /* Instanstiate the pci object */ 381 /* Instanstiate the pci object */
382 err = kobject_init_and_add(edac_pci_top_main_kobj, 382 err = kobject_init_and_add(edac_pci_top_main_kobj,
383 &ktype_edac_pci_main_kobj, 383 &ktype_edac_pci_main_kobj,
384 &edac_class->kset.kobj, "pci"); 384 &edac_subsys->dev_root->kobj, "pci");
385 if (err) { 385 if (err) {
386 debugf1("Failed to register '.../edac/pci'\n"); 386 debugf1("Failed to register '.../edac/pci'\n");
387 goto kobject_init_and_add_fail; 387 goto kobject_init_and_add_fail;
@@ -404,7 +404,7 @@ kzalloc_fail:
404 module_put(THIS_MODULE); 404 module_put(THIS_MODULE);
405 405
406mod_get_fail: 406mod_get_fail:
407 edac_put_sysfs_class(); 407 edac_put_sysfs_subsys();
408 408
409decrement_count_fail: 409decrement_count_fail:
410 /* if are on this error exit, nothing to tear down */ 410 /* if are on this error exit, nothing to tear down */
@@ -432,7 +432,7 @@ static void edac_pci_main_kobj_teardown(void)
432 __func__); 432 __func__);
433 kobject_put(edac_pci_top_main_kobj); 433 kobject_put(edac_pci_top_main_kobj);
434 } 434 }
435 edac_put_sysfs_class(); 435 edac_put_sysfs_subsys();
436} 436}
437 437
438/* 438/*
diff --git a/drivers/edac/edac_stub.c b/drivers/edac/edac_stub.c
index 86ad2eee1201..670c4481453b 100644
--- a/drivers/edac/edac_stub.c
+++ b/drivers/edac/edac_stub.c
@@ -26,7 +26,7 @@ EXPORT_SYMBOL_GPL(edac_handlers);
26int edac_err_assert = 0; 26int edac_err_assert = 0;
27EXPORT_SYMBOL_GPL(edac_err_assert); 27EXPORT_SYMBOL_GPL(edac_err_assert);
28 28
29static atomic_t edac_class_valid = ATOMIC_INIT(0); 29static atomic_t edac_subsys_valid = ATOMIC_INIT(0);
30 30
31/* 31/*
32 * called to determine if there is an EDAC driver interested in 32 * called to determine if there is an EDAC driver interested in
@@ -54,36 +54,37 @@ EXPORT_SYMBOL_GPL(edac_atomic_assert_error);
54 * sysfs object: /sys/devices/system/edac 54 * sysfs object: /sys/devices/system/edac
55 * need to export to other files 55 * need to export to other files
56 */ 56 */
57struct sysdev_class edac_class = { 57struct bus_type edac_subsys = {
58 .name = "edac", 58 .name = "edac",
59 .dev_name = "edac",
59}; 60};
60EXPORT_SYMBOL_GPL(edac_class); 61EXPORT_SYMBOL_GPL(edac_subsys);
61 62
62/* return pointer to the 'edac' node in sysfs */ 63/* return pointer to the 'edac' node in sysfs */
63struct sysdev_class *edac_get_sysfs_class(void) 64struct bus_type *edac_get_sysfs_subsys(void)
64{ 65{
65 int err = 0; 66 int err = 0;
66 67
67 if (atomic_read(&edac_class_valid)) 68 if (atomic_read(&edac_subsys_valid))
68 goto out; 69 goto out;
69 70
70 /* create the /sys/devices/system/edac directory */ 71 /* create the /sys/devices/system/edac directory */
71 err = sysdev_class_register(&edac_class); 72 err = subsys_system_register(&edac_subsys, NULL);
72 if (err) { 73 if (err) {
73 printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n"); 74 printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n");
74 return NULL; 75 return NULL;
75 } 76 }
76 77
77out: 78out:
78 atomic_inc(&edac_class_valid); 79 atomic_inc(&edac_subsys_valid);
79 return &edac_class; 80 return &edac_subsys;
80} 81}
81EXPORT_SYMBOL_GPL(edac_get_sysfs_class); 82EXPORT_SYMBOL_GPL(edac_get_sysfs_subsys);
82 83
83void edac_put_sysfs_class(void) 84void edac_put_sysfs_subsys(void)
84{ 85{
85 /* last user unregisters it */ 86 /* last user unregisters it */
86 if (atomic_dec_and_test(&edac_class_valid)) 87 if (atomic_dec_and_test(&edac_subsys_valid))
87 sysdev_class_unregister(&edac_class); 88 bus_unregister(&edac_subsys);
88} 89}
89EXPORT_SYMBOL_GPL(edac_put_sysfs_class); 90EXPORT_SYMBOL_GPL(edac_put_sysfs_subsys);
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
index 73c3e26a0bce..885e8ad8fdcf 100644
--- a/drivers/edac/mce_amd_inj.c
+++ b/drivers/edac/mce_amd_inj.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/kobject.h> 13#include <linux/kobject.h>
14#include <linux/sysdev.h>
15#include <linux/edac.h> 14#include <linux/edac.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <asm/mce.h> 16#include <asm/mce.h>
@@ -116,14 +115,14 @@ static struct edac_mce_attr *sysfs_attrs[] = { &mce_attr_status, &mce_attr_misc,
116 115
117static int __init edac_init_mce_inject(void) 116static int __init edac_init_mce_inject(void)
118{ 117{
119 struct sysdev_class *edac_class = NULL; 118 struct bus_type *edac_subsys = NULL;
120 int i, err = 0; 119 int i, err = 0;
121 120
122 edac_class = edac_get_sysfs_class(); 121 edac_subsys = edac_get_sysfs_subsys();
123 if (!edac_class) 122 if (!edac_subsys)
124 return -EINVAL; 123 return -EINVAL;
125 124
126 mce_kobj = kobject_create_and_add("mce", &edac_class->kset.kobj); 125 mce_kobj = kobject_create_and_add("mce", &edac_subsys->dev_root->kobj);
127 if (!mce_kobj) { 126 if (!mce_kobj) {
128 printk(KERN_ERR "Error creating a mce kset.\n"); 127 printk(KERN_ERR "Error creating a mce kset.\n");
129 err = -ENOMEM; 128 err = -ENOMEM;
@@ -147,7 +146,7 @@ err_sysfs_create:
147 kobject_del(mce_kobj); 146 kobject_del(mce_kobj);
148 147
149err_mce_kobj: 148err_mce_kobj:
150 edac_put_sysfs_class(); 149 edac_put_sysfs_subsys();
151 150
152 return err; 151 return err;
153} 152}
@@ -161,7 +160,7 @@ static void __exit edac_exit_mce_inject(void)
161 160
162 kobject_del(mce_kobj); 161 kobject_del(mce_kobj);
163 162
164 edac_put_sysfs_class(); 163 edac_put_sysfs_subsys();
165} 164}
166 165
167module_init(edac_init_mce_inject); 166module_init(edac_init_mce_inject);
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index c4e7c59d1c63..91ddf0f7a1b9 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -345,7 +345,8 @@ static efi_status_t gsmi_get_variable(efi_char16_t *name,
345 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param)); 345 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param));
346 346
347 /* The size reported is the min of all of our buffers */ 347 /* The size reported is the min of all of our buffers */
348 *data_size = min(*data_size, gsmi_dev.data_buf->length); 348 *data_size = min_t(unsigned long, *data_size,
349 gsmi_dev.data_buf->length);
349 *data_size = min_t(unsigned long, *data_size, param.data_len); 350 *data_size = min_t(unsigned long, *data_size, param.data_len);
350 351
351 /* Copy data back to return buffer. */ 352 /* Copy data back to return buffer. */
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index 866251852719..dcbe4541fe49 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -22,7 +22,7 @@
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index 065817329f03..bc445d7e3bf5 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -354,19 +354,4 @@ static struct usb_driver usb_kbd_driver = {
354 .id_table = usb_kbd_id_table, 354 .id_table = usb_kbd_id_table,
355}; 355};
356 356
357static int __init usb_kbd_init(void) 357module_usb_driver(usb_kbd_driver);
358{
359 int result = usb_register(&usb_kbd_driver);
360 if (result == 0)
361 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
362 DRIVER_DESC "\n");
363 return result;
364}
365
366static void __exit usb_kbd_exit(void)
367{
368 usb_deregister(&usb_kbd_driver);
369}
370
371module_init(usb_kbd_init);
372module_exit(usb_kbd_exit);
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
index 79b2bf81a059..0f6be45d43d5 100644
--- a/drivers/hid/usbhid/usbmouse.c
+++ b/drivers/hid/usbhid/usbmouse.c
@@ -241,19 +241,4 @@ static struct usb_driver usb_mouse_driver = {
241 .id_table = usb_mouse_id_table, 241 .id_table = usb_mouse_id_table,
242}; 242};
243 243
244static int __init usb_mouse_init(void) 244module_usb_driver(usb_mouse_driver);
245{
246 int retval = usb_register(&usb_mouse_driver);
247 if (retval == 0)
248 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
249 DRIVER_DESC "\n");
250 return retval;
251}
252
253static void __exit usb_mouse_exit(void)
254{
255 usb_deregister(&usb_mouse_driver);
256}
257
258module_init(usb_mouse_init);
259module_exit(usb_mouse_exit);
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 9fa09ac000ad..70f5dde1cc52 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -1,3 +1,5 @@
1menu "Microsoft Hyper-V guest support"
2
1config HYPERV 3config HYPERV
2 tristate "Microsoft Hyper-V client drivers" 4 tristate "Microsoft Hyper-V client drivers"
3 depends on X86 && ACPI && PCI 5 depends on X86 && ACPI && PCI
@@ -11,4 +13,4 @@ config HYPERV_UTILS
11 help 13 help
12 Select this option to enable the Hyper-V Utilities. 14 Select this option to enable the Hyper-V Utilities.
13 15
14 16endmenu
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 12b85ff957fd..36484db36baf 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -223,6 +223,17 @@ static void vmbus_process_rescind_offer(struct work_struct *work)
223 vmbus_device_unregister(channel->device_obj); 223 vmbus_device_unregister(channel->device_obj);
224} 224}
225 225
226void vmbus_free_channels(void)
227{
228 struct vmbus_channel *channel;
229
230 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
231 vmbus_device_unregister(channel->device_obj);
232 kfree(channel->device_obj);
233 free_channel(channel);
234 }
235}
236
226/* 237/*
227 * vmbus_process_offer - Process the offer by creating a channel/device 238 * vmbus_process_offer - Process the offer by creating a channel/device
228 * associated with this offer 239 * associated with this offer
@@ -287,6 +298,7 @@ static void vmbus_process_offer(struct work_struct *work)
287 spin_lock_irqsave(&vmbus_connection.channel_lock, flags); 298 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
288 list_del(&newchannel->listentry); 299 list_del(&newchannel->listentry);
289 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); 300 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
301 kfree(newchannel->device_obj);
290 302
291 free_channel(newchannel); 303 free_channel(newchannel);
292 } else { 304 } else {
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 0fb100ed91a3..12aa97f31f93 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -164,11 +164,6 @@ int hv_init(void)
164 164
165 max_leaf = query_hypervisor_info(); 165 max_leaf = query_hypervisor_info();
166 166
167 rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);
168
169 if (hv_context.guestid != 0)
170 goto cleanup;
171
172 /* Write our OS info */ 167 /* Write our OS info */
173 wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); 168 wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID);
174 hv_context.guestid = HV_LINUX_GUEST_ID; 169 hv_context.guestid = HV_LINUX_GUEST_ID;
@@ -237,6 +232,9 @@ void hv_cleanup(void)
237{ 232{
238 union hv_x64_msr_hypercall_contents hypercall_msr; 233 union hv_x64_msr_hypercall_contents hypercall_msr;
239 234
235 /* Reset our OS id */
236 wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
237
240 kfree(hv_context.signal_event_buffer); 238 kfree(hv_context.signal_event_buffer);
241 hv_context.signal_event_buffer = NULL; 239 hv_context.signal_event_buffer = NULL;
242 hv_context.signal_event_param = NULL; 240 hv_context.signal_event_param = NULL;
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 0aee1122734c..6d7d286d5440 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -611,6 +611,7 @@ void vmbus_device_unregister(struct hv_device *device_obj);
611 611
612struct vmbus_channel *relid2channel(u32 relid); 612struct vmbus_channel *relid2channel(u32 relid);
613 613
614void vmbus_free_channels(void);
614 615
615/* Connection interface */ 616/* Connection interface */
616 617
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 0c048dd8013f..a220e5746d67 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -62,6 +62,14 @@ struct hv_device_info {
62 struct hv_dev_port_info outbound; 62 struct hv_dev_port_info outbound;
63}; 63};
64 64
65static int vmbus_exists(void)
66{
67 if (hv_acpi_dev == NULL)
68 return -ENODEV;
69
70 return 0;
71}
72
65 73
66static void get_channel_info(struct hv_device *device, 74static void get_channel_info(struct hv_device *device,
67 struct hv_device_info *info) 75 struct hv_device_info *info)
@@ -590,6 +598,10 @@ int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, c
590 598
591 pr_info("registering driver %s\n", hv_driver->name); 599 pr_info("registering driver %s\n", hv_driver->name);
592 600
601 ret = vmbus_exists();
602 if (ret < 0)
603 return ret;
604
593 hv_driver->driver.name = hv_driver->name; 605 hv_driver->driver.name = hv_driver->name;
594 hv_driver->driver.owner = owner; 606 hv_driver->driver.owner = owner;
595 hv_driver->driver.mod_name = mod_name; 607 hv_driver->driver.mod_name = mod_name;
@@ -614,8 +626,8 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver)
614{ 626{
615 pr_info("unregistering driver %s\n", hv_driver->name); 627 pr_info("unregistering driver %s\n", hv_driver->name);
616 628
617 driver_unregister(&hv_driver->driver); 629 if (!vmbus_exists())
618 630 driver_unregister(&hv_driver->driver);
619} 631}
620EXPORT_SYMBOL_GPL(vmbus_driver_unregister); 632EXPORT_SYMBOL_GPL(vmbus_driver_unregister);
621 633
@@ -776,11 +788,23 @@ static int __init hv_acpi_init(void)
776 788
777cleanup: 789cleanup:
778 acpi_bus_unregister_driver(&vmbus_acpi_driver); 790 acpi_bus_unregister_driver(&vmbus_acpi_driver);
791 hv_acpi_dev = NULL;
779 return ret; 792 return ret;
780} 793}
781 794
795static void __exit vmbus_exit(void)
796{
797
798 free_irq(irq, hv_acpi_dev);
799 vmbus_free_channels();
800 bus_unregister(&hv_bus);
801 hv_cleanup();
802 acpi_bus_unregister_driver(&vmbus_acpi_driver);
803}
804
782 805
783MODULE_LICENSE("GPL"); 806MODULE_LICENSE("GPL");
784MODULE_VERSION(HV_DRV_VERSION); 807MODULE_VERSION(HV_DRV_VERSION);
785 808
786module_init(hv_acpi_init); 809subsys_initcall(hv_acpi_init);
810module_exit(vmbus_exit);
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c
index 76366716a854..7eb19a5222f2 100644
--- a/drivers/i2c/busses/i2c-diolan-u2c.c
+++ b/drivers/i2c/busses/i2c-diolan-u2c.c
@@ -515,20 +515,7 @@ static struct usb_driver diolan_u2c_driver = {
515 .id_table = diolan_u2c_table, 515 .id_table = diolan_u2c_table,
516}; 516};
517 517
518static int __init diolan_u2c_init(void) 518module_usb_driver(diolan_u2c_driver);
519{
520 /* register this driver with the USB subsystem */
521 return usb_register(&diolan_u2c_driver);
522}
523
524static void __exit diolan_u2c_exit(void)
525{
526 /* deregister this driver with the USB subsystem */
527 usb_deregister(&diolan_u2c_driver);
528}
529
530module_init(diolan_u2c_init);
531module_exit(diolan_u2c_exit);
532 519
533MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 520MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>");
534MODULE_DESCRIPTION(DRIVER_NAME " driver"); 521MODULE_DESCRIPTION(DRIVER_NAME " driver");
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index d03b04002f0d..f07307ff360d 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -262,20 +262,7 @@ static struct usb_driver i2c_tiny_usb_driver = {
262 .id_table = i2c_tiny_usb_table, 262 .id_table = i2c_tiny_usb_table,
263}; 263};
264 264
265static int __init usb_i2c_tiny_usb_init(void) 265module_usb_driver(i2c_tiny_usb_driver);
266{
267 /* register this driver with the USB subsystem */
268 return usb_register(&i2c_tiny_usb_driver);
269}
270
271static void __exit usb_i2c_tiny_usb_exit(void)
272{
273 /* deregister this driver with the USB subsystem */
274 usb_deregister(&i2c_tiny_usb_driver);
275}
276
277module_init(usb_i2c_tiny_usb_init);
278module_exit(usb_i2c_tiny_usb_exit);
279 266
280/* ----- end of usb layer ------------------------------------------------ */ 267/* ----- end of usb layer ------------------------------------------------ */
281 268
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index d72887585a14..32bbd4c77b7c 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1041,18 +1041,7 @@ static struct usb_driver xpad_driver = {
1041 .id_table = xpad_table, 1041 .id_table = xpad_table,
1042}; 1042};
1043 1043
1044static int __init usb_xpad_init(void) 1044module_usb_driver(xpad_driver);
1045{
1046 return usb_register(&xpad_driver);
1047}
1048
1049static void __exit usb_xpad_exit(void)
1050{
1051 usb_deregister(&xpad_driver);
1052}
1053
1054module_init(usb_xpad_init);
1055module_exit(usb_xpad_exit);
1056 1045
1057MODULE_AUTHOR(DRIVER_AUTHOR); 1046MODULE_AUTHOR(DRIVER_AUTHOR);
1058MODULE_DESCRIPTION(DRIVER_DESC); 1047MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 8d345e87075e..874a51c2fbb2 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -1010,23 +1010,4 @@ static int ati_remote2_post_reset(struct usb_interface *interface)
1010 return r; 1010 return r;
1011} 1011}
1012 1012
1013static int __init ati_remote2_init(void) 1013module_usb_driver(ati_remote2_driver);
1014{
1015 int r;
1016
1017 r = usb_register(&ati_remote2_driver);
1018 if (r)
1019 printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r);
1020 else
1021 printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n");
1022
1023 return r;
1024}
1025
1026static void __exit ati_remote2_exit(void)
1027{
1028 usb_deregister(&ati_remote2_driver);
1029}
1030
1031module_init(ati_remote2_init);
1032module_exit(ati_remote2_exit);
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index fc62256c963f..d99151a8bf10 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -580,26 +580,7 @@ static struct usb_driver keyspan_driver =
580 .id_table = keyspan_table 580 .id_table = keyspan_table
581}; 581};
582 582
583static int __init usb_keyspan_init(void) 583module_usb_driver(keyspan_driver);
584{
585 int result;
586
587 /* register this driver with the USB subsystem */
588 result = usb_register(&keyspan_driver);
589 if (result)
590 err("usb_register failed. Error number %d\n", result);
591
592 return result;
593}
594
595static void __exit usb_keyspan_exit(void)
596{
597 /* deregister this driver with the USB subsystem */
598 usb_deregister(&keyspan_driver);
599}
600
601module_init(usb_keyspan_init);
602module_exit(usb_keyspan_exit);
603 584
604MODULE_DEVICE_TABLE(usb, keyspan_table); 585MODULE_DEVICE_TABLE(usb, keyspan_table);
605MODULE_AUTHOR(DRIVER_AUTHOR); 586MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index f45947190e4f..538f7049ec64 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -441,18 +441,7 @@ static struct usb_driver powermate_driver = {
441 .id_table = powermate_devices, 441 .id_table = powermate_devices,
442}; 442};
443 443
444static int __init powermate_init(void) 444module_usb_driver(powermate_driver);
445{
446 return usb_register(&powermate_driver);
447}
448
449static void __exit powermate_cleanup(void)
450{
451 usb_deregister(&powermate_driver);
452}
453
454module_init(powermate_init);
455module_exit(powermate_cleanup);
456 445
457MODULE_AUTHOR( "William R Sowerbutts" ); 446MODULE_AUTHOR( "William R Sowerbutts" );
458MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" ); 447MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" );
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 41201c6b5e68..f4776e7f8c15 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -988,22 +988,7 @@ static struct usb_driver yealink_driver = {
988 .id_table = usb_table, 988 .id_table = usb_table,
989}; 989};
990 990
991static int __init yealink_dev_init(void) 991module_usb_driver(yealink_driver);
992{
993 int ret = usb_register(&yealink_driver);
994 if (ret == 0)
995 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
996 DRIVER_DESC "\n");
997 return ret;
998}
999
1000static void __exit yealink_dev_exit(void)
1001{
1002 usb_deregister(&yealink_driver);
1003}
1004
1005module_init(yealink_dev_init);
1006module_exit(yealink_dev_exit);
1007 992
1008MODULE_DEVICE_TABLE (usb, usb_table); 993MODULE_DEVICE_TABLE (usb, usb_table);
1009 994
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index b77f9991278e..0acbc7d50d05 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -938,15 +938,4 @@ static struct usb_driver atp_driver = {
938 .id_table = atp_table, 938 .id_table = atp_table,
939}; 939};
940 940
941static int __init atp_init(void) 941module_usb_driver(atp_driver);
942{
943 return usb_register(&atp_driver);
944}
945
946static void __exit atp_exit(void)
947{
948 usb_deregister(&atp_driver);
949}
950
951module_init(atp_init);
952module_exit(atp_exit);
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 5ec617e28f7e..cf87f8b18e34 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -940,16 +940,4 @@ static struct usb_driver bcm5974_driver = {
940 .supports_autosuspend = 1, 940 .supports_autosuspend = 1,
941}; 941};
942 942
943static int __init bcm5974_init(void) 943module_usb_driver(bcm5974_driver);
944{
945 return usb_register(&bcm5974_driver);
946}
947
948static void __exit bcm5974_exit(void)
949{
950 usb_deregister(&bcm5974_driver);
951}
952
953module_init(bcm5974_init);
954module_exit(bcm5974_exit);
955
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index d94f7e9aa997..f8b0b1df9138 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -269,19 +269,4 @@ static struct usb_driver usb_acecad_driver = {
269 .id_table = usb_acecad_id_table, 269 .id_table = usb_acecad_id_table,
270}; 270};
271 271
272static int __init usb_acecad_init(void) 272module_usb_driver(usb_acecad_driver);
273{
274 int result = usb_register(&usb_acecad_driver);
275 if (result == 0)
276 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
277 DRIVER_DESC "\n");
278 return result;
279}
280
281static void __exit usb_acecad_exit(void)
282{
283 usb_deregister(&usb_acecad_driver);
284}
285
286module_init(usb_acecad_init);
287module_exit(usb_acecad_exit);
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 6d89fd1842c3..d5ef3debd045 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1919,21 +1919,7 @@ static struct usb_driver aiptek_driver = {
1919 .id_table = aiptek_ids, 1919 .id_table = aiptek_ids,
1920}; 1920};
1921 1921
1922static int __init aiptek_init(void) 1922module_usb_driver(aiptek_driver);
1923{
1924 int result = usb_register(&aiptek_driver);
1925 if (result == 0) {
1926 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1927 DRIVER_DESC "\n");
1928 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_AUTHOR "\n");
1929 }
1930 return result;
1931}
1932
1933static void __exit aiptek_exit(void)
1934{
1935 usb_deregister(&aiptek_driver);
1936}
1937 1923
1938MODULE_AUTHOR(DRIVER_AUTHOR); 1924MODULE_AUTHOR(DRIVER_AUTHOR);
1939MODULE_DESCRIPTION(DRIVER_DESC); 1925MODULE_DESCRIPTION(DRIVER_DESC);
@@ -1943,6 +1929,3 @@ module_param(programmableDelay, int, 0);
1943MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming"); 1929MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming");
1944module_param(jitterDelay, int, 0); 1930module_param(jitterDelay, int, 0);
1945MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay"); 1931MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay");
1946
1947module_init(aiptek_init);
1948module_exit(aiptek_exit);
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 8ea6afe2e992..89a297801dce 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -1022,33 +1022,7 @@ static struct usb_driver gtco_driverinfo_table = {
1022 .disconnect = gtco_disconnect, 1022 .disconnect = gtco_disconnect,
1023}; 1023};
1024 1024
1025/* 1025module_usb_driver(gtco_driverinfo_table);
1026 * Register this module with the USB subsystem
1027 */
1028static int __init gtco_init(void)
1029{
1030 int error;
1031
1032 error = usb_register(&gtco_driverinfo_table);
1033 if (error) {
1034 err("usb_register() failed rc=0x%x", error);
1035 return error;
1036 }
1037
1038 printk("GTCO usb driver version: %s", GTCO_VERSION);
1039 return 0;
1040}
1041
1042/*
1043 * Deregister this module with the USB subsystem
1044 */
1045static void __exit gtco_exit(void)
1046{
1047 usb_deregister(&gtco_driverinfo_table);
1048}
1049
1050module_init(gtco_init);
1051module_exit(gtco_exit);
1052 1026
1053MODULE_DESCRIPTION("GTCO digitizer USB driver"); 1027MODULE_DESCRIPTION("GTCO digitizer USB driver");
1054MODULE_LICENSE("GPL"); 1028MODULE_LICENSE("GPL");
diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c
index 6504b627b234..b2db3cfe3084 100644
--- a/drivers/input/tablet/hanwang.c
+++ b/drivers/input/tablet/hanwang.c
@@ -432,15 +432,4 @@ static struct usb_driver hanwang_driver = {
432 .id_table = hanwang_ids, 432 .id_table = hanwang_ids,
433}; 433};
434 434
435static int __init hanwang_init(void) 435module_usb_driver(hanwang_driver);
436{
437 return usb_register(&hanwang_driver);
438}
439
440static void __exit hanwang_exit(void)
441{
442 usb_deregister(&hanwang_driver);
443}
444
445module_init(hanwang_init);
446module_exit(hanwang_exit);
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 290f4e57b589..85a5b40333ac 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -198,22 +198,4 @@ static struct usb_driver kbtab_driver = {
198 .id_table = kbtab_ids, 198 .id_table = kbtab_ids,
199}; 199};
200 200
201static int __init kbtab_init(void) 201module_usb_driver(kbtab_driver);
202{
203 int retval;
204 retval = usb_register(&kbtab_driver);
205 if (retval)
206 goto out;
207 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
208 DRIVER_DESC "\n");
209out:
210 return retval;
211}
212
213static void __exit kbtab_exit(void)
214{
215 usb_deregister(&kbtab_driver);
216}
217
218module_init(kbtab_init);
219module_exit(kbtab_exit);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 1c1b7b43cf92..8f9cde3e0ec2 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -919,21 +919,4 @@ static struct usb_driver wacom_driver = {
919 .supports_autosuspend = 1, 919 .supports_autosuspend = 1,
920}; 920};
921 921
922static int __init wacom_init(void) 922module_usb_driver(wacom_driver);
923{
924 int result;
925
926 result = usb_register(&wacom_driver);
927 if (result == 0)
928 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
929 DRIVER_DESC "\n");
930 return result;
931}
932
933static void __exit wacom_exit(void)
934{
935 usb_deregister(&wacom_driver);
936}
937
938module_init(wacom_init);
939module_exit(wacom_exit);
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 73fd6642b681..e539d92cc626 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1580,18 +1580,7 @@ static struct usb_driver usbtouch_driver = {
1580 .supports_autosuspend = 1, 1580 .supports_autosuspend = 1,
1581}; 1581};
1582 1582
1583static int __init usbtouch_init(void) 1583module_usb_driver(usbtouch_driver);
1584{
1585 return usb_register(&usbtouch_driver);
1586}
1587
1588static void __exit usbtouch_cleanup(void)
1589{
1590 usb_deregister(&usbtouch_driver);
1591}
1592
1593module_init(usbtouch_init);
1594module_exit(usbtouch_cleanup);
1595 1584
1596MODULE_AUTHOR(DRIVER_AUTHOR); 1585MODULE_AUTHOR(DRIVER_AUTHOR);
1597MODULE_DESCRIPTION(DRIVER_DESC); 1586MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index 71a8eb6ef71e..0e1f4d5b9774 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -2154,30 +2154,4 @@ static struct usb_driver hfcsusb_drv = {
2154 .disconnect = hfcsusb_disconnect, 2154 .disconnect = hfcsusb_disconnect,
2155}; 2155};
2156 2156
2157static int __init 2157module_usb_driver(hfcsusb_drv);
2158hfcsusb_init(void)
2159{
2160 printk(KERN_INFO DRIVER_NAME " driver Rev. %s debug(0x%x) poll(%i)\n",
2161 hfcsusb_rev, debug, poll);
2162
2163 if (usb_register(&hfcsusb_drv)) {
2164 printk(KERN_INFO DRIVER_NAME
2165 ": Unable to register hfcsusb module at usb stack\n");
2166 return -ENODEV;
2167 }
2168
2169 return 0;
2170}
2171
2172static void __exit
2173hfcsusb_cleanup(void)
2174{
2175 if (debug & DBG_HFC_CALL_TRACE)
2176 printk(KERN_INFO DRIVER_NAME ": %s\n", __func__);
2177
2178 /* unregister Hardware */
2179 usb_deregister(&hfcsusb_drv); /* release our driver */
2180}
2181
2182module_init(hfcsusb_init);
2183module_exit(hfcsusb_cleanup);
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 6d5628bb0601..0c8739c448b1 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -15,7 +15,6 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/sysdev.h>
19#include <linux/timer.h> 18#include <linux/timer.h>
20#include <linux/err.h> 19#include <linux/err.h>
21#include <linux/ctype.h> 20#include <linux/ctype.h>
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 6f1ff93d7cec..46b4c766335d 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -17,7 +17,6 @@
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/sysdev.h>
21#include <linux/timer.h> 20#include <linux/timer.h>
22#include <linux/rwsem.h> 21#include <linux/rwsem.h>
23#include <linux/leds.h> 22#include <linux/leds.h>
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 116a49ce74b2..54ac7ffacb40 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -32,7 +32,6 @@
32#include <linux/completion.h> 32#include <linux/completion.h>
33#include <linux/miscdevice.h> 33#include <linux/miscdevice.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/sysdev.h>
36#include <linux/poll.h> 35#include <linux/poll.h>
37#include <linux/mutex.h> 36#include <linux/mutex.h>
38#include <linux/of_device.h> 37#include <linux/of_device.h>
@@ -681,9 +680,6 @@ static struct platform_driver smu_of_platform_driver =
681static int __init smu_init_sysfs(void) 680static int __init smu_init_sysfs(void)
682{ 681{
683 /* 682 /*
684 * Due to sysfs bogosity, a sysdev is not a real device, so
685 * we should in fact create both if we want sysdev semantics
686 * for power management.
687 * For now, we don't power manage machines with an SMU chip, 683 * For now, we don't power manage machines with an SMU chip,
688 * I'm a bit too far from figuring out how that works with those 684 * I'm a bit too far from figuring out how that works with those
689 * new chipsets, but that will come back and bite us 685 * new chipsets, but that will come back and bite us
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index bedcfb671624..26c666dd3514 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -583,25 +583,7 @@ static struct usb_driver flexcop_usb_driver = {
583 .id_table = flexcop_usb_table, 583 .id_table = flexcop_usb_table,
584}; 584};
585 585
586/* module stuff */ 586module_usb_driver(flexcop_usb_driver);
587static int __init flexcop_usb_module_init(void)
588{
589 int result;
590 if ((result = usb_register(&flexcop_usb_driver))) {
591 err("usb_register failed. (%d)", result);
592 return result;
593 }
594 return 0;
595}
596
597static void __exit flexcop_usb_module_exit(void)
598{
599 /* deregister this driver from the USB subsystem */
600 usb_deregister(&flexcop_usb_driver);
601}
602
603module_init(flexcop_usb_module_init);
604module_exit(flexcop_usb_module_exit);
605 587
606MODULE_AUTHOR(DRIVER_AUTHOR); 588MODULE_AUTHOR(DRIVER_AUTHOR);
607MODULE_DESCRIPTION(DRIVER_NAME); 589MODULE_DESCRIPTION(DRIVER_NAME);
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c
index 2aef3c89e9fa..8d7fef84afd8 100644
--- a/drivers/media/dvb/dvb-usb/a800.c
+++ b/drivers/media/dvb/dvb-usb/a800.c
@@ -183,26 +183,7 @@ static struct usb_driver a800_driver = {
183 .id_table = a800_table, 183 .id_table = a800_table,
184}; 184};
185 185
186/* module stuff */ 186module_usb_driver(a800_driver);
187static int __init a800_module_init(void)
188{
189 int result;
190 if ((result = usb_register(&a800_driver))) {
191 err("usb_register failed. Error number %d",result);
192 return result;
193 }
194
195 return 0;
196}
197
198static void __exit a800_module_exit(void)
199{
200 /* deregister this driver from the USB subsystem */
201 usb_deregister(&a800_driver);
202}
203
204module_init (a800_module_init);
205module_exit (a800_module_exit);
206 187
207MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 188MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
208MODULE_DESCRIPTION("AVerMedia AverTV DVB-T USB 2.0 (A800)"); 189MODULE_DESCRIPTION("AVerMedia AverTV DVB-T USB 2.0 (A800)");
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index c6c275bac08e..56cbd3636c31 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -1713,25 +1713,7 @@ static struct usb_driver af9015_usb_driver = {
1713 .id_table = af9015_usb_table, 1713 .id_table = af9015_usb_table,
1714}; 1714};
1715 1715
1716/* module stuff */ 1716module_usb_driver(af9015_usb_driver);
1717static int __init af9015_usb_module_init(void)
1718{
1719 int ret;
1720 ret = usb_register(&af9015_usb_driver);
1721 if (ret)
1722 err("module init failed:%d", ret);
1723
1724 return ret;
1725}
1726
1727static void __exit af9015_usb_module_exit(void)
1728{
1729 /* deregister this driver from the USB subsystem */
1730 usb_deregister(&af9015_usb_driver);
1731}
1732
1733module_init(af9015_usb_module_init);
1734module_exit(af9015_usb_module_exit);
1735 1717
1736MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 1718MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
1737MODULE_DESCRIPTION("Driver for Afatech AF9015 DVB-T"); 1719MODULE_DESCRIPTION("Driver for Afatech AF9015 DVB-T");
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c
index 5f2278b73ee9..b39f14f85e71 100644
--- a/drivers/media/dvb/dvb-usb/anysee.c
+++ b/drivers/media/dvb/dvb-usb/anysee.c
@@ -1091,26 +1091,7 @@ static struct usb_driver anysee_driver = {
1091 .id_table = anysee_table, 1091 .id_table = anysee_table,
1092}; 1092};
1093 1093
1094/* module stuff */ 1094module_usb_driver(anysee_driver);
1095static int __init anysee_module_init(void)
1096{
1097 int ret;
1098
1099 ret = usb_register(&anysee_driver);
1100 if (ret)
1101 err("%s: usb_register failed. Error number %d", __func__, ret);
1102
1103 return ret;
1104}
1105
1106static void __exit anysee_module_exit(void)
1107{
1108 /* deregister this driver from the USB subsystem */
1109 usb_deregister(&anysee_driver);
1110}
1111
1112module_init(anysee_module_init);
1113module_exit(anysee_module_exit);
1114 1095
1115MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 1096MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
1116MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0"); 1097MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/au6610.c b/drivers/media/dvb/dvb-usb/au6610.c
index b77994967b9b..16210c060302 100644
--- a/drivers/media/dvb/dvb-usb/au6610.c
+++ b/drivers/media/dvb/dvb-usb/au6610.c
@@ -244,26 +244,7 @@ static struct usb_driver au6610_driver = {
244 .id_table = au6610_table, 244 .id_table = au6610_table,
245}; 245};
246 246
247/* module stuff */ 247module_usb_driver(au6610_driver);
248static int __init au6610_module_init(void)
249{
250 int ret;
251
252 ret = usb_register(&au6610_driver);
253 if (ret)
254 err("usb_register failed. Error number %d", ret);
255
256 return ret;
257}
258
259static void __exit au6610_module_exit(void)
260{
261 /* deregister this driver from the USB subsystem */
262 usb_deregister(&au6610_driver);
263}
264
265module_init(au6610_module_init);
266module_exit(au6610_module_exit);
267 248
268MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 249MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
269MODULE_DESCRIPTION("Driver for Alcor Micro AU6610 DVB-T USB2.0"); 250MODULE_DESCRIPTION("Driver for Alcor Micro AU6610 DVB-T USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c
index bf67b4dfd82b..5e45ae605427 100644
--- a/drivers/media/dvb/dvb-usb/az6027.c
+++ b/drivers/media/dvb/dvb-usb/az6027.c
@@ -1174,28 +1174,7 @@ static struct usb_driver az6027_usb_driver = {
1174 .id_table = az6027_usb_table, 1174 .id_table = az6027_usb_table,
1175}; 1175};
1176 1176
1177/* module stuff */ 1177module_usb_driver(az6027_usb_driver);
1178static int __init az6027_usb_module_init(void)
1179{
1180 int result;
1181
1182 result = usb_register(&az6027_usb_driver);
1183 if (result) {
1184 err("usb_register failed. (%d)", result);
1185 return result;
1186 }
1187
1188 return 0;
1189}
1190
1191static void __exit az6027_usb_module_exit(void)
1192{
1193 /* deregister this driver from the USB subsystem */
1194 usb_deregister(&az6027_usb_driver);
1195}
1196
1197module_init(az6027_usb_module_init);
1198module_exit(az6027_usb_module_exit);
1199 1178
1200MODULE_AUTHOR("Adams Xu <Adams.xu@azwave.com.cn>"); 1179MODULE_AUTHOR("Adams Xu <Adams.xu@azwave.com.cn>");
1201MODULE_DESCRIPTION("Driver for AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)"); 1180MODULE_DESCRIPTION("Driver for AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)");
diff --git a/drivers/media/dvb/dvb-usb/ce6230.c b/drivers/media/dvb/dvb-usb/ce6230.c
index 57afb5a9157e..fa637255729c 100644
--- a/drivers/media/dvb/dvb-usb/ce6230.c
+++ b/drivers/media/dvb/dvb-usb/ce6230.c
@@ -317,27 +317,7 @@ static struct usb_driver ce6230_driver = {
317 .id_table = ce6230_table, 317 .id_table = ce6230_table,
318}; 318};
319 319
320/* module stuff */ 320module_usb_driver(ce6230_driver);
321static int __init ce6230_module_init(void)
322{
323 int ret;
324 deb_info("%s:\n", __func__);
325 ret = usb_register(&ce6230_driver);
326 if (ret)
327 err("usb_register failed with error:%d", ret);
328
329 return ret;
330}
331
332static void __exit ce6230_module_exit(void)
333{
334 deb_info("%s:\n", __func__);
335 /* deregister this driver from the USB subsystem */
336 usb_deregister(&ce6230_driver);
337}
338
339module_init(ce6230_module_init);
340module_exit(ce6230_module_exit);
341 321
342MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 322MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
343MODULE_DESCRIPTION("Driver for Intel CE6230 DVB-T USB2.0"); 323MODULE_DESCRIPTION("Driver for Intel CE6230 DVB-T USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c
index f9d905002ec9..0a98548ecd17 100644
--- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c
+++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c
@@ -247,25 +247,7 @@ static struct usb_driver cinergyt2_driver = {
247 .id_table = cinergyt2_usb_table 247 .id_table = cinergyt2_usb_table
248}; 248};
249 249
250static int __init cinergyt2_usb_init(void) 250module_usb_driver(cinergyt2_driver);
251{
252 int err;
253
254 err = usb_register(&cinergyt2_driver);
255 if (err) {
256 err("usb_register() failed! (err %i)\n", err);
257 return err;
258 }
259 return 0;
260}
261
262static void __exit cinergyt2_usb_exit(void)
263{
264 usb_deregister(&cinergyt2_driver);
265}
266
267module_init(cinergyt2_usb_init);
268module_exit(cinergyt2_usb_exit);
269 251
270MODULE_DESCRIPTION("Terratec Cinergy T2 DVB-T driver"); 252MODULE_DESCRIPTION("Terratec Cinergy T2 DVB-T driver");
271MODULE_LICENSE("GPL"); 253MODULE_LICENSE("GPL");
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 9f2a02c48377..949ea1bc0aae 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -2034,26 +2034,7 @@ static struct usb_driver cxusb_driver = {
2034 .id_table = cxusb_table, 2034 .id_table = cxusb_table,
2035}; 2035};
2036 2036
2037/* module stuff */ 2037module_usb_driver(cxusb_driver);
2038static int __init cxusb_module_init(void)
2039{
2040 int result;
2041 if ((result = usb_register(&cxusb_driver))) {
2042 err("usb_register failed. Error number %d",result);
2043 return result;
2044 }
2045
2046 return 0;
2047}
2048
2049static void __exit cxusb_module_exit(void)
2050{
2051 /* deregister this driver from the USB subsystem */
2052 usb_deregister(&cxusb_driver);
2053}
2054
2055module_init (cxusb_module_init);
2056module_exit (cxusb_module_exit);
2057 2038
2058MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 2039MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
2059MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); 2040MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index 156cbfc9c79d..206999476f02 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -832,27 +832,7 @@ static struct usb_driver dib0700_driver = {
832 .id_table = dib0700_usb_id_table, 832 .id_table = dib0700_usb_id_table,
833}; 833};
834 834
835/* module stuff */ 835module_usb_driver(dib0700_driver);
836static int __init dib0700_module_init(void)
837{
838 int result;
839 info("loaded with support for %d different device-types", dib0700_device_count);
840 if ((result = usb_register(&dib0700_driver))) {
841 err("usb_register failed. Error number %d",result);
842 return result;
843 }
844
845 return 0;
846}
847
848static void __exit dib0700_module_exit(void)
849{
850 /* deregister this driver from the USB subsystem */
851 usb_deregister(&dib0700_driver);
852}
853
854module_init (dib0700_module_init);
855module_exit (dib0700_module_exit);
856 836
857MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>"); 837MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>");
858MODULE_DESCRIPTION("Driver for devices based on DiBcom DiB0700 - USB bridge"); 838MODULE_DESCRIPTION("Driver for devices based on DiBcom DiB0700 - USB bridge");
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index 7270791f8340..a4ac37e0e98b 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -463,26 +463,7 @@ static struct usb_driver dibusb_driver = {
463 .id_table = dibusb_dib3000mb_table, 463 .id_table = dibusb_dib3000mb_table,
464}; 464};
465 465
466/* module stuff */ 466module_usb_driver(dibusb_driver);
467static int __init dibusb_module_init(void)
468{
469 int result;
470 if ((result = usb_register(&dibusb_driver))) {
471 err("usb_register failed. Error number %d",result);
472 return result;
473 }
474
475 return 0;
476}
477
478static void __exit dibusb_module_exit(void)
479{
480 /* deregister this driver from the USB subsystem */
481 usb_deregister(&dibusb_driver);
482}
483
484module_init (dibusb_module_init);
485module_exit (dibusb_module_exit);
486 467
487MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 468MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
488MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)"); 469MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c
index 9c165e2569d4..9d1a59d09c52 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -141,26 +141,7 @@ static struct usb_driver dibusb_mc_driver = {
141 .id_table = dibusb_dib3000mc_table, 141 .id_table = dibusb_dib3000mc_table,
142}; 142};
143 143
144/* module stuff */ 144module_usb_driver(dibusb_mc_driver);
145static int __init dibusb_mc_module_init(void)
146{
147 int result;
148 if ((result = usb_register(&dibusb_mc_driver))) {
149 err("usb_register failed. Error number %d",result);
150 return result;
151 }
152
153 return 0;
154}
155
156static void __exit dibusb_mc_module_exit(void)
157{
158 /* deregister this driver from the USB subsystem */
159 usb_deregister(&dibusb_mc_driver);
160}
161
162module_init (dibusb_mc_module_init);
163module_exit (dibusb_mc_module_exit);
164 145
165MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 146MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
166MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices"); 147MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c
index f7184111aa64..0a9a79820f26 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -346,26 +346,7 @@ static struct usb_driver digitv_driver = {
346 .id_table = digitv_table, 346 .id_table = digitv_table,
347}; 347};
348 348
349/* module stuff */ 349module_usb_driver(digitv_driver);
350static int __init digitv_module_init(void)
351{
352 int result;
353 if ((result = usb_register(&digitv_driver))) {
354 err("usb_register failed. Error number %d",result);
355 return result;
356 }
357
358 return 0;
359}
360
361static void __exit digitv_module_exit(void)
362{
363 /* deregister this driver from the USB subsystem */
364 usb_deregister(&digitv_driver);
365}
366
367module_init (digitv_module_init);
368module_exit (digitv_module_exit);
369 350
370MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 351MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
371MODULE_DESCRIPTION("Driver for Nebula Electronics uDigiTV DVB-T USB2.0"); 352MODULE_DESCRIPTION("Driver for Nebula Electronics uDigiTV DVB-T USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c
index 106dfd55ff9c..66f205c112b2 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -360,26 +360,7 @@ static struct usb_driver dtt200u_usb_driver = {
360 .id_table = dtt200u_usb_table, 360 .id_table = dtt200u_usb_table,
361}; 361};
362 362
363/* module stuff */ 363module_usb_driver(dtt200u_usb_driver);
364static int __init dtt200u_usb_module_init(void)
365{
366 int result;
367 if ((result = usb_register(&dtt200u_usb_driver))) {
368 err("usb_register failed. (%d)",result);
369 return result;
370 }
371
372 return 0;
373}
374
375static void __exit dtt200u_usb_module_exit(void)
376{
377 /* deregister this driver from the USB subsystem */
378 usb_deregister(&dtt200u_usb_driver);
379}
380
381module_init(dtt200u_usb_module_init);
382module_exit(dtt200u_usb_module_exit);
383 364
384MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 365MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
385MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D/Miglia DVB-T USB2.0 devices"); 366MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D/Miglia DVB-T USB2.0 devices");
diff --git a/drivers/media/dvb/dvb-usb/dtv5100.c b/drivers/media/dvb/dvb-usb/dtv5100.c
index 7373132163d2..3d11df41cac0 100644
--- a/drivers/media/dvb/dvb-usb/dtv5100.c
+++ b/drivers/media/dvb/dvb-usb/dtv5100.c
@@ -217,26 +217,7 @@ static struct usb_driver dtv5100_driver = {
217 .id_table = dtv5100_table, 217 .id_table = dtv5100_table,
218}; 218};
219 219
220/* module stuff */ 220module_usb_driver(dtv5100_driver);
221static int __init dtv5100_module_init(void)
222{
223 int ret;
224
225 ret = usb_register(&dtv5100_driver);
226 if (ret)
227 err("usb_register failed. Error number %d", ret);
228
229 return ret;
230}
231
232static void __exit dtv5100_module_exit(void)
233{
234 /* deregister this driver from the USB subsystem */
235 usb_deregister(&dtv5100_driver);
236}
237
238module_init(dtv5100_module_init);
239module_exit(dtv5100_module_exit);
240 221
241MODULE_AUTHOR(DRIVER_AUTHOR); 222MODULE_AUTHOR(DRIVER_AUTHOR);
242MODULE_DESCRIPTION(DRIVER_DESC); 223MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
index f103ec1fe82e..ff941d20e6b7 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -1928,22 +1928,7 @@ static struct usb_driver dw2102_driver = {
1928 .id_table = dw2102_table, 1928 .id_table = dw2102_table,
1929}; 1929};
1930 1930
1931static int __init dw2102_module_init(void) 1931module_usb_driver(dw2102_driver);
1932{
1933 int ret = usb_register(&dw2102_driver);
1934 if (ret)
1935 err("usb_register failed. Error number %d", ret);
1936
1937 return ret;
1938}
1939
1940static void __exit dw2102_module_exit(void)
1941{
1942 usb_deregister(&dw2102_driver);
1943}
1944
1945module_init(dw2102_module_init);
1946module_exit(dw2102_module_exit);
1947 1932
1948MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); 1933MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
1949MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," 1934MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
diff --git a/drivers/media/dvb/dvb-usb/ec168.c b/drivers/media/dvb/dvb-usb/ec168.c
index 78442fe4aa5e..b4989ba8897d 100644
--- a/drivers/media/dvb/dvb-usb/ec168.c
+++ b/drivers/media/dvb/dvb-usb/ec168.c
@@ -428,27 +428,7 @@ static struct usb_driver ec168_driver = {
428 .id_table = ec168_id, 428 .id_table = ec168_id,
429}; 429};
430 430
431/* module stuff */ 431module_usb_driver(ec168_driver);
432static int __init ec168_module_init(void)
433{
434 int ret;
435 deb_info("%s:\n", __func__);
436 ret = usb_register(&ec168_driver);
437 if (ret)
438 err("module init failed:%d", ret);
439
440 return ret;
441}
442
443static void __exit ec168_module_exit(void)
444{
445 deb_info("%s:\n", __func__);
446 /* deregister this driver from the USB subsystem */
447 usb_deregister(&ec168_driver);
448}
449
450module_init(ec168_module_init);
451module_exit(ec168_module_exit);
452 432
453MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 433MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
454MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver"); 434MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver");
diff --git a/drivers/media/dvb/dvb-usb/friio.c b/drivers/media/dvb/dvb-usb/friio.c
index b092dc2137cd..474a17e4db0c 100644
--- a/drivers/media/dvb/dvb-usb/friio.c
+++ b/drivers/media/dvb/dvb-usb/friio.c
@@ -514,28 +514,7 @@ static struct usb_driver friio_driver = {
514 .id_table = friio_table, 514 .id_table = friio_table,
515}; 515};
516 516
517 517module_usb_driver(friio_driver);
518/* module stuff */
519static int __init friio_module_init(void)
520{
521 int ret;
522
523 ret = usb_register(&friio_driver);
524 if (ret)
525 err("usb_register failed. Error number %d", ret);
526
527 return ret;
528}
529
530
531static void __exit friio_module_exit(void)
532{
533 /* deregister this driver from the USB subsystem */
534 usb_deregister(&friio_driver);
535}
536
537module_init(friio_module_init);
538module_exit(friio_module_exit);
539 518
540MODULE_AUTHOR("Akihiro Tsukada <tskd2@yahoo.co.jp>"); 519MODULE_AUTHOR("Akihiro Tsukada <tskd2@yahoo.co.jp>");
541MODULE_DESCRIPTION("Driver for Friio ISDB-T USB2.0 Receiver"); 520MODULE_DESCRIPTION("Driver for Friio ISDB-T USB2.0 Receiver");
diff --git a/drivers/media/dvb/dvb-usb/gl861.c b/drivers/media/dvb/dvb-usb/gl861.c
index 63681df244c4..c1f5582e1cdf 100644
--- a/drivers/media/dvb/dvb-usb/gl861.c
+++ b/drivers/media/dvb/dvb-usb/gl861.c
@@ -209,26 +209,7 @@ static struct usb_driver gl861_driver = {
209 .id_table = gl861_table, 209 .id_table = gl861_table,
210}; 210};
211 211
212/* module stuff */ 212module_usb_driver(gl861_driver);
213static int __init gl861_module_init(void)
214{
215 int ret;
216
217 ret = usb_register(&gl861_driver);
218 if (ret)
219 err("usb_register failed. Error number %d", ret);
220
221 return ret;
222}
223
224static void __exit gl861_module_exit(void)
225{
226 /* deregister this driver from the USB subsystem */
227 usb_deregister(&gl861_driver);
228}
229
230module_init(gl861_module_init);
231module_exit(gl861_module_exit);
232 213
233MODULE_AUTHOR("Carl Lundqvist <comabug@gmail.com>"); 214MODULE_AUTHOR("Carl Lundqvist <comabug@gmail.com>");
234MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / GL861"); 215MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / GL861");
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
index 5f71284703d0..5d0384dd45b5 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -320,26 +320,7 @@ static struct usb_driver gp8psk_usb_driver = {
320 .id_table = gp8psk_usb_table, 320 .id_table = gp8psk_usb_table,
321}; 321};
322 322
323/* module stuff */ 323module_usb_driver(gp8psk_usb_driver);
324static int __init gp8psk_usb_module_init(void)
325{
326 int result;
327 if ((result = usb_register(&gp8psk_usb_driver))) {
328 err("usb_register failed. (%d)",result);
329 return result;
330 }
331
332 return 0;
333}
334
335static void __exit gp8psk_usb_module_exit(void)
336{
337 /* deregister this driver from the USB subsystem */
338 usb_deregister(&gp8psk_usb_driver);
339}
340
341module_init(gp8psk_usb_module_init);
342module_exit(gp8psk_usb_module_exit);
343 324
344MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>"); 325MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>");
345MODULE_DESCRIPTION("Driver for Genpix DVB-S"); 326MODULE_DESCRIPTION("Driver for Genpix DVB-S");
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c
index c46226187143..67094b879bb4 100644
--- a/drivers/media/dvb/dvb-usb/it913x.c
+++ b/drivers/media/dvb/dvb-usb/it913x.c
@@ -675,26 +675,7 @@ static struct usb_driver it913x_driver = {
675 .id_table = it913x_table, 675 .id_table = it913x_table,
676}; 676};
677 677
678/* module stuff */ 678module_usb_driver(it913x_driver);
679static int __init it913x_module_init(void)
680{
681 int result = usb_register(&it913x_driver);
682 if (result) {
683 err("usb_register failed. Error number %d", result);
684 return result;
685 }
686
687 return 0;
688}
689
690static void __exit it913x_module_exit(void)
691{
692 /* deregister this driver from the USB subsystem */
693 usb_deregister(&it913x_driver);
694}
695
696module_init(it913x_module_init);
697module_exit(it913x_module_exit);
698 679
699MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); 680MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
700MODULE_DESCRIPTION("it913x USB 2 Driver"); 681MODULE_DESCRIPTION("it913x USB 2 Driver");
diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
index b9228240f5ce..1a876a65ed56 100644
--- a/drivers/media/dvb/dvb-usb/lmedm04.c
+++ b/drivers/media/dvb/dvb-usb/lmedm04.c
@@ -1289,26 +1289,7 @@ static struct usb_driver lme2510_driver = {
1289 .id_table = lme2510_table, 1289 .id_table = lme2510_table,
1290}; 1290};
1291 1291
1292/* module stuff */ 1292module_usb_driver(lme2510_driver);
1293static int __init lme2510_module_init(void)
1294{
1295 int result = usb_register(&lme2510_driver);
1296 if (result) {
1297 err("usb_register failed. Error number %d", result);
1298 return result;
1299 }
1300
1301 return 0;
1302}
1303
1304static void __exit lme2510_module_exit(void)
1305{
1306 /* deregister this driver from the USB subsystem */
1307 usb_deregister(&lme2510_driver);
1308}
1309
1310module_init(lme2510_module_init);
1311module_exit(lme2510_module_exit);
1312 1293
1313MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); 1294MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
1314MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); 1295MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c
index a1e1287c949e..288af29a8bb7 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -1086,27 +1086,7 @@ static struct usb_driver m920x_driver = {
1086 .id_table = m920x_table, 1086 .id_table = m920x_table,
1087}; 1087};
1088 1088
1089/* module stuff */ 1089module_usb_driver(m920x_driver);
1090static int __init m920x_module_init(void)
1091{
1092 int ret;
1093
1094 if ((ret = usb_register(&m920x_driver))) {
1095 err("usb_register failed. Error number %d", ret);
1096 return ret;
1097 }
1098
1099 return 0;
1100}
1101
1102static void __exit m920x_module_exit(void)
1103{
1104 /* deregister this driver from the USB subsystem */
1105 usb_deregister(&m920x_driver);
1106}
1107
1108module_init (m920x_module_init);
1109module_exit (m920x_module_exit);
1110 1090
1111MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>"); 1091MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
1112MODULE_DESCRIPTION("DVB Driver for ULI M920x"); 1092MODULE_DESCRIPTION("DVB Driver for ULI M920x");
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf.c b/drivers/media/dvb/dvb-usb/mxl111sf.c
index b5c98da5d9e2..825a8b242e09 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf.c
@@ -1055,24 +1055,7 @@ static struct usb_driver mxl111sf_driver = {
1055 .id_table = mxl111sf_table, 1055 .id_table = mxl111sf_table,
1056}; 1056};
1057 1057
1058static int __init mxl111sf_module_init(void) 1058module_usb_driver(mxl111sf_driver);
1059{
1060 int result = usb_register(&mxl111sf_driver);
1061 if (result) {
1062 err("usb_register failed. Error number %d", result);
1063 return result;
1064 }
1065
1066 return 0;
1067}
1068
1069static void __exit mxl111sf_module_exit(void)
1070{
1071 usb_deregister(&mxl111sf_driver);
1072}
1073
1074module_init(mxl111sf_module_init);
1075module_exit(mxl111sf_module_exit);
1076 1059
1077MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); 1060MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>");
1078MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); 1061MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF");
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
index 21384da6570e..6c55384e2fca 100644
--- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -225,26 +225,7 @@ static struct usb_driver nova_t_driver = {
225 .id_table = nova_t_table, 225 .id_table = nova_t_table,
226}; 226};
227 227
228/* module stuff */ 228module_usb_driver(nova_t_driver);
229static int __init nova_t_module_init(void)
230{
231 int result;
232 if ((result = usb_register(&nova_t_driver))) {
233 err("usb_register failed. Error number %d",result);
234 return result;
235 }
236
237 return 0;
238}
239
240static void __exit nova_t_module_exit(void)
241{
242 /* deregister this driver from the USB subsystem */
243 usb_deregister(&nova_t_driver);
244}
245
246module_init (nova_t_module_init);
247module_exit (nova_t_module_exit);
248 229
249MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 230MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
250MODULE_DESCRIPTION("Hauppauge WinTV-NOVA-T usb2"); 231MODULE_DESCRIPTION("Hauppauge WinTV-NOVA-T usb2");
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c
index 98fd9a6092b7..c8a95042dfbc 100644
--- a/drivers/media/dvb/dvb-usb/opera1.c
+++ b/drivers/media/dvb/dvb-usb/opera1.c
@@ -574,22 +574,7 @@ static struct usb_driver opera1_driver = {
574 .id_table = opera1_table, 574 .id_table = opera1_table,
575}; 575};
576 576
577static int __init opera1_module_init(void) 577module_usb_driver(opera1_driver);
578{
579 int result = 0;
580 if ((result = usb_register(&opera1_driver))) {
581 err("usb_register failed. Error number %d", result);
582 }
583 return result;
584}
585
586static void __exit opera1_module_exit(void)
587{
588 usb_deregister(&opera1_driver);
589}
590
591module_init(opera1_module_init);
592module_exit(opera1_module_exit);
593 578
594MODULE_AUTHOR("Mario Hlawitschka (c) dh1pa@amsat.org"); 579MODULE_AUTHOR("Mario Hlawitschka (c) dh1pa@amsat.org");
595MODULE_AUTHOR("Marco Gittler (c) g.marco@freenet.de"); 580MODULE_AUTHOR("Marco Gittler (c) g.marco@freenet.de");
diff --git a/drivers/media/dvb/dvb-usb/pctv452e.c b/drivers/media/dvb/dvb-usb/pctv452e.c
index f9aec5cb6e77..f526eb05cc7a 100644
--- a/drivers/media/dvb/dvb-usb/pctv452e.c
+++ b/drivers/media/dvb/dvb-usb/pctv452e.c
@@ -1055,22 +1055,7 @@ static struct usb_driver pctv452e_usb_driver = {
1055 .id_table = pctv452e_usb_table, 1055 .id_table = pctv452e_usb_table,
1056}; 1056};
1057 1057
1058static int __init pctv452e_usb_init(void) 1058module_usb_driver(pctv452e_usb_driver);
1059{
1060 int ret = usb_register(&pctv452e_usb_driver);
1061 if (ret)
1062 err("%s: usb_register failed! Error %d", __FILE__, ret);
1063
1064 return ret;
1065}
1066
1067static void __exit pctv452e_usb_exit(void)
1068{
1069 usb_deregister(&pctv452e_usb_driver);
1070}
1071
1072module_init(pctv452e_usb_init);
1073module_exit(pctv452e_usb_exit);
1074 1059
1075MODULE_AUTHOR("Dominik Kuhlen <dkuhlen@gmx.net>"); 1060MODULE_AUTHOR("Dominik Kuhlen <dkuhlen@gmx.net>");
1076MODULE_AUTHOR("Andre Weidemann <Andre.Weidemann@web.de>"); 1061MODULE_AUTHOR("Andre Weidemann <Andre.Weidemann@web.de>");
diff --git a/drivers/media/dvb/dvb-usb/technisat-usb2.c b/drivers/media/dvb/dvb-usb/technisat-usb2.c
index 0998fe961950..acefaa89cc53 100644
--- a/drivers/media/dvb/dvb-usb/technisat-usb2.c
+++ b/drivers/media/dvb/dvb-usb/technisat-usb2.c
@@ -781,25 +781,7 @@ static struct usb_driver technisat_usb2_driver = {
781 .id_table = technisat_usb2_id_table, 781 .id_table = technisat_usb2_id_table,
782}; 782};
783 783
784/* module stuff */ 784module_usb_driver(technisat_usb2_driver);
785static int __init technisat_usb2_module_init(void)
786{
787 int result = usb_register(&technisat_usb2_driver);
788 if (result) {
789 err("usb_register failed. Code %d", result);
790 return result;
791 }
792
793 return 0;
794}
795
796static void __exit technisat_usb2_module_exit(void)
797{
798 usb_deregister(&technisat_usb2_driver);
799}
800
801module_init(technisat_usb2_module_init);
802module_exit(technisat_usb2_module_exit);
803 785
804MODULE_AUTHOR("Patrick Boettcher <pboettcher@kernellabs.com>"); 786MODULE_AUTHOR("Patrick Boettcher <pboettcher@kernellabs.com>");
805MODULE_DESCRIPTION("Driver for Technisat DVB-S/S2 USB 2.0 device"); 787MODULE_DESCRIPTION("Driver for Technisat DVB-S/S2 USB 2.0 device");
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c
index ea4eab8b3965..56acf8e55d50 100644
--- a/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -799,26 +799,7 @@ static struct usb_driver ttusb2_driver = {
799 .id_table = ttusb2_table, 799 .id_table = ttusb2_table,
800}; 800};
801 801
802/* module stuff */ 802module_usb_driver(ttusb2_driver);
803static int __init ttusb2_module_init(void)
804{
805 int result;
806 if ((result = usb_register(&ttusb2_driver))) {
807 err("usb_register failed. Error number %d",result);
808 return result;
809 }
810
811 return 0;
812}
813
814static void __exit ttusb2_module_exit(void)
815{
816 /* deregister this driver from the USB subsystem */
817 usb_deregister(&ttusb2_driver);
818}
819
820module_init (ttusb2_module_init);
821module_exit (ttusb2_module_exit);
822 803
823MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 804MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
824MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0"); 805MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0");
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c b/drivers/media/dvb/dvb-usb/umt-010.c
index 463673a5c2b2..9b042292e788 100644
--- a/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/drivers/media/dvb/dvb-usb/umt-010.c
@@ -143,26 +143,7 @@ static struct usb_driver umt_driver = {
143 .id_table = umt_table, 143 .id_table = umt_table,
144}; 144};
145 145
146/* module stuff */ 146module_usb_driver(umt_driver);
147static int __init umt_module_init(void)
148{
149 int result;
150 if ((result = usb_register(&umt_driver))) {
151 err("usb_register failed. Error number %d",result);
152 return result;
153 }
154
155 return 0;
156}
157
158static void __exit umt_module_exit(void)
159{
160 /* deregister this driver from the USB subsystem */
161 usb_deregister(&umt_driver);
162}
163
164module_init (umt_module_init);
165module_exit (umt_module_exit);
166 147
167MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 148MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
168MODULE_DESCRIPTION("Driver for HanfTek UMT 010 USB2.0 DVB-T device"); 149MODULE_DESCRIPTION("Driver for HanfTek UMT 010 USB2.0 DVB-T device");
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c
index 45e31f224814..07c673a6e764 100644
--- a/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/drivers/media/dvb/dvb-usb/vp702x.c
@@ -436,26 +436,7 @@ static struct usb_driver vp702x_usb_driver = {
436 .id_table = vp702x_usb_table, 436 .id_table = vp702x_usb_table,
437}; 437};
438 438
439/* module stuff */ 439module_usb_driver(vp702x_usb_driver);
440static int __init vp702x_usb_module_init(void)
441{
442 int result;
443 if ((result = usb_register(&vp702x_usb_driver))) {
444 err("usb_register failed. (%d)",result);
445 return result;
446 }
447
448 return 0;
449}
450
451static void __exit vp702x_usb_module_exit(void)
452{
453 /* deregister this driver from the USB subsystem */
454 usb_deregister(&vp702x_usb_driver);
455}
456
457module_init(vp702x_usb_module_init);
458module_exit(vp702x_usb_module_exit);
459 440
460MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 441MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
461MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones"); 442MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones");
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c
index 90873af5682e..d750724132ee 100644
--- a/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/drivers/media/dvb/dvb-usb/vp7045.c
@@ -294,26 +294,7 @@ static struct usb_driver vp7045_usb_driver = {
294 .id_table = vp7045_usb_table, 294 .id_table = vp7045_usb_table,
295}; 295};
296 296
297/* module stuff */ 297module_usb_driver(vp7045_usb_driver);
298static int __init vp7045_usb_module_init(void)
299{
300 int result;
301 if ((result = usb_register(&vp7045_usb_driver))) {
302 err("usb_register failed. (%d)",result);
303 return result;
304 }
305
306 return 0;
307}
308
309static void __exit vp7045_usb_module_exit(void)
310{
311 /* deregister this driver from the USB subsystem */
312 usb_deregister(&vp7045_usb_driver);
313}
314
315module_init(vp7045_usb_module_init);
316module_exit(vp7045_usb_module_exit);
317 298
318MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 299MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
319MODULE_DESCRIPTION("Driver for Twinhan MagicBox/Alpha and DNTV tinyUSB2 DVB-T USB2.0"); 300MODULE_DESCRIPTION("Driver for Twinhan MagicBox/Alpha and DNTV tinyUSB2 DVB-T USB2.0");
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 51c7121b321a..b1fe5137df09 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -557,26 +557,7 @@ static struct usb_driver smsusb_driver = {
557 .resume = smsusb_resume, 557 .resume = smsusb_resume,
558}; 558};
559 559
560static int __init smsusb_module_init(void) 560module_usb_driver(smsusb_driver);
561{
562 int rc = usb_register(&smsusb_driver);
563 if (rc)
564 sms_err("usb_register failed. Error number %d", rc);
565
566 sms_debug("");
567
568 return rc;
569}
570
571static void __exit smsusb_module_exit(void)
572{
573 /* Regular USB Cleanup */
574 usb_deregister(&smsusb_driver);
575 sms_info("end");
576}
577
578module_init(smsusb_module_init);
579module_exit(smsusb_module_exit);
580 561
581MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle"); 562MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle");
582MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)"); 563MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)");
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 420bb42d5233..e90192fdde11 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1794,26 +1794,7 @@ static struct usb_driver ttusb_driver = {
1794 .id_table = ttusb_table, 1794 .id_table = ttusb_table,
1795}; 1795};
1796 1796
1797static int __init ttusb_init(void) 1797module_usb_driver(ttusb_driver);
1798{
1799 int err;
1800
1801 if ((err = usb_register(&ttusb_driver)) < 0) {
1802 printk("%s: usb_register failed! Error number %d",
1803 __FILE__, err);
1804 return err;
1805 }
1806
1807 return 0;
1808}
1809
1810static void __exit ttusb_exit(void)
1811{
1812 usb_deregister(&ttusb_driver);
1813}
1814
1815module_init(ttusb_init);
1816module_exit(ttusb_exit);
1817 1798
1818MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); 1799MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>");
1819MODULE_DESCRIPTION("TTUSB DVB Driver"); 1800MODULE_DESCRIPTION("TTUSB DVB Driver");
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index f893bffa08a3..504c81230339 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1756,26 +1756,7 @@ static struct usb_driver ttusb_dec_driver = {
1756 .id_table = ttusb_dec_table, 1756 .id_table = ttusb_dec_table,
1757}; 1757};
1758 1758
1759static int __init ttusb_dec_init(void) 1759module_usb_driver(ttusb_dec_driver);
1760{
1761 int result;
1762
1763 if ((result = usb_register(&ttusb_dec_driver)) < 0) {
1764 printk("%s: initialisation failed: error %d.\n", __func__,
1765 result);
1766 return result;
1767 }
1768
1769 return 0;
1770}
1771
1772static void __exit ttusb_dec_exit(void)
1773{
1774 usb_deregister(&ttusb_dec_driver);
1775}
1776
1777module_init(ttusb_dec_init);
1778module_exit(ttusb_dec_exit);
1779 1760
1780MODULE_AUTHOR("Alex Woods <linux-dvb@giblets.org>"); 1761MODULE_AUTHOR("Alex Woods <linux-dvb@giblets.org>");
1781MODULE_DESCRIPTION(DRIVER_NAME); 1762MODULE_DESCRIPTION(DRIVER_NAME);
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 25e58cbf35f0..f36905b63645 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -624,21 +624,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
624 return 0; 624 return 0;
625} 625}
626 626
627static int __init dsbr100_init(void) 627module_usb_driver(usb_dsbr100_driver);
628{
629 int retval = usb_register(&usb_dsbr100_driver);
630 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
631 DRIVER_DESC "\n");
632 return retval;
633}
634
635static void __exit dsbr100_exit(void)
636{
637 usb_deregister(&usb_dsbr100_driver);
638}
639
640module_init (dsbr100_init);
641module_exit (dsbr100_exit);
642 628
643MODULE_AUTHOR( DRIVER_AUTHOR ); 629MODULE_AUTHOR( DRIVER_AUTHOR );
644MODULE_DESCRIPTION( DRIVER_DESC ); 630MODULE_DESCRIPTION( DRIVER_DESC );
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 1742bd8110bd..a860a72a58ec 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -659,25 +659,4 @@ err:
659 return retval; 659 return retval;
660} 660}
661 661
662static int __init amradio_init(void) 662module_usb_driver(usb_amradio_driver);
663{
664 int retval = usb_register(&usb_amradio_driver);
665
666 pr_info(KBUILD_MODNAME
667 ": version " DRIVER_VERSION " " DRIVER_DESC "\n");
668
669 if (retval)
670 pr_err(KBUILD_MODNAME
671 ": usb_register failed. Error number %d\n", retval);
672
673 return retval;
674}
675
676static void __exit amradio_exit(void)
677{
678 usb_deregister(&usb_amradio_driver);
679}
680
681module_init(amradio_init);
682module_exit(amradio_exit);
683
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index a6ad707fae96..b7debb67932a 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -861,33 +861,7 @@ static struct usb_driver si470x_usb_driver = {
861 .supports_autosuspend = 1, 861 .supports_autosuspend = 1,
862}; 862};
863 863
864 864module_usb_driver(si470x_usb_driver);
865
866/**************************************************************************
867 * Module Interface
868 **************************************************************************/
869
870/*
871 * si470x_module_init - module init
872 */
873static int __init si470x_module_init(void)
874{
875 printk(KERN_INFO DRIVER_DESC ", Version " DRIVER_VERSION "\n");
876 return usb_register(&si470x_usb_driver);
877}
878
879
880/*
881 * si470x_module_exit - module exit
882 */
883static void __exit si470x_module_exit(void)
884{
885 usb_deregister(&si470x_usb_driver);
886}
887
888
889module_init(si470x_module_init);
890module_exit(si470x_module_exit);
891 865
892MODULE_LICENSE("GPL"); 866MODULE_LICENSE("GPL");
893MODULE_AUTHOR(DRIVER_AUTHOR); 867MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 01bb8daf4b09..baf907b3ce76 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -899,38 +899,7 @@ static void ati_remote_disconnect(struct usb_interface *interface)
899 kfree(ati_remote); 899 kfree(ati_remote);
900} 900}
901 901
902/* 902module_usb_driver(ati_remote_driver);
903 * ati_remote_init
904 */
905static int __init ati_remote_init(void)
906{
907 int result;
908
909 result = usb_register(&ati_remote_driver);
910 if (result)
911 printk(KERN_ERR KBUILD_MODNAME
912 ": usb_register error #%d\n", result);
913 else
914 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
915 DRIVER_DESC "\n");
916
917 return result;
918}
919
920/*
921 * ati_remote_exit
922 */
923static void __exit ati_remote_exit(void)
924{
925 usb_deregister(&ati_remote_driver);
926}
927
928/*
929 * module specification
930 */
931
932module_init(ati_remote_init);
933module_exit(ati_remote_exit);
934 903
935MODULE_AUTHOR(DRIVER_AUTHOR); 904MODULE_AUTHOR(DRIVER_AUTHOR);
936MODULE_DESCRIPTION(DRIVER_DESC); 905MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 6ed96465137a..3aeb29a7ce11 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -2458,23 +2458,4 @@ static int imon_resume(struct usb_interface *intf)
2458 return rc; 2458 return rc;
2459} 2459}
2460 2460
2461static int __init imon_init(void) 2461module_usb_driver(imon_driver);
2462{
2463 int rc;
2464
2465 rc = usb_register(&imon_driver);
2466 if (rc) {
2467 pr_err("usb register failed(%d)\n", rc);
2468 rc = -ENODEV;
2469 }
2470
2471 return rc;
2472}
2473
2474static void __exit imon_exit(void)
2475{
2476 usb_deregister(&imon_driver);
2477}
2478
2479module_init(imon_init);
2480module_exit(imon_exit);
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 60d3c1e09712..20bb12d6fbbe 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1448,25 +1448,7 @@ static struct usb_driver mceusb_dev_driver = {
1448 .id_table = mceusb_dev_table 1448 .id_table = mceusb_dev_table
1449}; 1449};
1450 1450
1451static int __init mceusb_dev_init(void) 1451module_usb_driver(mceusb_dev_driver);
1452{
1453 int ret;
1454
1455 ret = usb_register(&mceusb_dev_driver);
1456 if (ret < 0)
1457 printk(KERN_ERR DRIVER_NAME
1458 ": usb register failed, result = %d\n", ret);
1459
1460 return ret;
1461}
1462
1463static void __exit mceusb_dev_exit(void)
1464{
1465 usb_deregister(&mceusb_dev_driver);
1466}
1467
1468module_init(mceusb_dev_init);
1469module_exit(mceusb_dev_exit);
1470 1452
1471MODULE_DESCRIPTION(DRIVER_DESC); 1453MODULE_DESCRIPTION(DRIVER_DESC);
1472MODULE_AUTHOR(DRIVER_AUTHOR); 1454MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 61287fcca61a..07322fb75eff 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -1300,25 +1300,7 @@ static struct usb_driver redrat3_dev_driver = {
1300 .id_table = redrat3_dev_table 1300 .id_table = redrat3_dev_table
1301}; 1301};
1302 1302
1303static int __init redrat3_dev_init(void) 1303module_usb_driver(redrat3_dev_driver);
1304{
1305 int ret;
1306
1307 ret = usb_register(&redrat3_dev_driver);
1308 if (ret < 0)
1309 pr_err(DRIVER_NAME
1310 ": usb register failed, result = %d\n", ret);
1311
1312 return ret;
1313}
1314
1315static void __exit redrat3_dev_exit(void)
1316{
1317 usb_deregister(&redrat3_dev_driver);
1318}
1319
1320module_init(redrat3_dev_init);
1321module_exit(redrat3_dev_exit);
1322 1304
1323MODULE_DESCRIPTION(DRIVER_DESC); 1305MODULE_DESCRIPTION(DRIVER_DESC);
1324MODULE_AUTHOR(DRIVER_AUTHOR); 1306MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index e435d94c0776..b1d29d09eeae 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -523,33 +523,7 @@ static int streamzap_resume(struct usb_interface *intf)
523 return 0; 523 return 0;
524} 524}
525 525
526/** 526module_usb_driver(streamzap_driver);
527 * streamzap_init
528 */
529static int __init streamzap_init(void)
530{
531 int ret;
532
533 /* register this driver with the USB subsystem */
534 ret = usb_register(&streamzap_driver);
535 if (ret < 0)
536 printk(KERN_ERR DRIVER_NAME ": usb register failed, "
537 "result = %d\n", ret);
538
539 return ret;
540}
541
542/**
543 * streamzap_exit
544 */
545static void __exit streamzap_exit(void)
546{
547 usb_deregister(&streamzap_driver);
548}
549
550
551module_init(streamzap_init);
552module_exit(streamzap_exit);
553 527
554MODULE_AUTHOR("Jarod Wilson <jarod@wilsonet.com>"); 528MODULE_AUTHOR("Jarod Wilson <jarod@wilsonet.com>");
555MODULE_DESCRIPTION(DRIVER_DESC); 529MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 53dae2a8272d..60b021e79864 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -1385,26 +1385,4 @@ static struct usb_driver cx231xx_usb_driver = {
1385 .id_table = cx231xx_id_table, 1385 .id_table = cx231xx_id_table,
1386}; 1386};
1387 1387
1388static int __init cx231xx_module_init(void) 1388module_usb_driver(cx231xx_usb_driver);
1389{
1390 int result;
1391
1392 printk(KERN_INFO DRIVER_NAME " v4l2 driver loaded.\n");
1393
1394 /* register this driver with the USB subsystem */
1395 result = usb_register(&cx231xx_usb_driver);
1396 if (result)
1397 cx231xx_err(DRIVER_NAME
1398 " usb_register failed. Error number %d.\n", result);
1399
1400 return result;
1401}
1402
1403static void __exit cx231xx_module_exit(void)
1404{
1405 /* deregister this driver with the USB subsystem */
1406 usb_deregister(&cx231xx_usb_driver);
1407}
1408
1409module_init(cx231xx_module_init);
1410module_exit(cx231xx_module_exit);
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 9b747c266afa..93807dcf944e 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -3325,26 +3325,4 @@ static struct usb_driver em28xx_usb_driver = {
3325 .id_table = em28xx_id_table, 3325 .id_table = em28xx_id_table,
3326}; 3326};
3327 3327
3328static int __init em28xx_module_init(void) 3328module_usb_driver(em28xx_usb_driver);
3329{
3330 int result;
3331
3332 /* register this driver with the USB subsystem */
3333 result = usb_register(&em28xx_usb_driver);
3334 if (result)
3335 em28xx_err(DRIVER_NAME
3336 " usb_register failed. Error number %d.\n", result);
3337
3338 printk(KERN_INFO DRIVER_NAME " driver loaded\n");
3339
3340 return result;
3341}
3342
3343static void __exit em28xx_module_exit(void)
3344{
3345 /* deregister this driver with the USB subsystem */
3346 usb_deregister(&em28xx_usb_driver);
3347}
3348
3349module_init(em28xx_module_init);
3350module_exit(em28xx_module_exit);
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index d3777c86e1de..40f214ab924f 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -2680,27 +2680,4 @@ static struct usb_driver et61x251_usb_driver = {
2680 .disconnect = et61x251_usb_disconnect, 2680 .disconnect = et61x251_usb_disconnect,
2681}; 2681};
2682 2682
2683/*****************************************************************************/ 2683module_usb_driver(et61x251_usb_driver);
2684
2685static int __init et61x251_module_init(void)
2686{
2687 int err = 0;
2688
2689 KDBG(2, ET61X251_MODULE_NAME " v" ET61X251_MODULE_VERSION);
2690 KDBG(3, ET61X251_MODULE_AUTHOR);
2691
2692 if ((err = usb_register(&et61x251_usb_driver)))
2693 KDBG(1, "usb_register() failed");
2694
2695 return err;
2696}
2697
2698
2699static void __exit et61x251_module_exit(void)
2700{
2701 usb_deregister(&et61x251_usb_driver);
2702}
2703
2704
2705module_init(et61x251_module_init);
2706module_exit(et61x251_module_exit);
diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
index 6ae26160b81f..636627b57dc9 100644
--- a/drivers/media/video/gspca/benq.c
+++ b/drivers/media/video/gspca/benq.c
@@ -288,15 +288,4 @@ static struct usb_driver sd_driver = {
288#endif 288#endif
289}; 289};
290 290
291/* -- module insert / remove -- */ 291module_usb_driver(sd_driver);
292static int __init sd_mod_init(void)
293{
294 return usb_register(&sd_driver);
295}
296static void __exit sd_mod_exit(void)
297{
298 usb_deregister(&sd_driver);
299}
300
301module_init(sd_mod_init);
302module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
index 4c56dbef6d92..ea17b5d94ea4 100644
--- a/drivers/media/video/gspca/conex.c
+++ b/drivers/media/video/gspca/conex.c
@@ -1067,15 +1067,4 @@ static struct usb_driver sd_driver = {
1067#endif 1067#endif
1068}; 1068};
1069 1069
1070/* -- module insert / remove -- */ 1070module_usb_driver(sd_driver);
1071static int __init sd_mod_init(void)
1072{
1073 return usb_register(&sd_driver);
1074}
1075static void __exit sd_mod_exit(void)
1076{
1077 usb_deregister(&sd_driver);
1078}
1079
1080module_init(sd_mod_init);
1081module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/cpia1.c b/drivers/media/video/gspca/cpia1.c
index f9b86b2484b0..8f33bbd091ad 100644
--- a/drivers/media/video/gspca/cpia1.c
+++ b/drivers/media/video/gspca/cpia1.c
@@ -2132,15 +2132,4 @@ static struct usb_driver sd_driver = {
2132#endif 2132#endif
2133}; 2133};
2134 2134
2135/* -- module insert / remove -- */ 2135module_usb_driver(sd_driver);
2136static int __init sd_mod_init(void)
2137{
2138 return usb_register(&sd_driver);
2139}
2140static void __exit sd_mod_exit(void)
2141{
2142 usb_deregister(&sd_driver);
2143}
2144
2145module_init(sd_mod_init);
2146module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c
index 0357d6d461d1..81a4adbd9f7c 100644
--- a/drivers/media/video/gspca/etoms.c
+++ b/drivers/media/video/gspca/etoms.c
@@ -895,16 +895,4 @@ static struct usb_driver sd_driver = {
895#endif 895#endif
896}; 896};
897 897
898/* -- module insert / remove -- */ 898module_usb_driver(sd_driver);
899static int __init sd_mod_init(void)
900{
901 return usb_register(&sd_driver);
902}
903
904static void __exit sd_mod_exit(void)
905{
906 usb_deregister(&sd_driver);
907}
908
909module_init(sd_mod_init);
910module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c
index ea48200fd3a0..0107513cd728 100644
--- a/drivers/media/video/gspca/finepix.c
+++ b/drivers/media/video/gspca/finepix.c
@@ -290,16 +290,4 @@ static struct usb_driver sd_driver = {
290#endif 290#endif
291}; 291};
292 292
293/* -- module insert / remove -- */ 293module_usb_driver(sd_driver);
294static int __init sd_mod_init(void)
295{
296 return usb_register(&sd_driver);
297}
298
299static void __exit sd_mod_exit(void)
300{
301 usb_deregister(&sd_driver);
302}
303
304module_init(sd_mod_init);
305module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/gl860/gl860.c b/drivers/media/video/gspca/gl860/gl860.c
index 2ced3b73994f..a8f54c20e585 100644
--- a/drivers/media/video/gspca/gl860/gl860.c
+++ b/drivers/media/video/gspca/gl860/gl860.c
@@ -524,22 +524,7 @@ static struct usb_driver sd_driver = {
524 524
525/*====================== Init and Exit module functions ====================*/ 525/*====================== Init and Exit module functions ====================*/
526 526
527static int __init sd_mod_init(void) 527module_usb_driver(sd_driver);
528{
529 PDEBUG(D_PROBE, "driver startup - version %s", DRIVER_VERSION);
530
531 if (usb_register(&sd_driver) < 0)
532 return -1;
533 return 0;
534}
535
536static void __exit sd_mod_exit(void)
537{
538 usb_deregister(&sd_driver);
539}
540
541module_init(sd_mod_init);
542module_exit(sd_mod_exit);
543 528
544/*==========================================================================*/ 529/*==========================================================================*/
545 530
diff --git a/drivers/media/video/gspca/jeilinj.c b/drivers/media/video/gspca/jeilinj.c
index 8e3dabe30077..5ab3f7e12760 100644
--- a/drivers/media/video/gspca/jeilinj.c
+++ b/drivers/media/video/gspca/jeilinj.c
@@ -582,16 +582,4 @@ static struct usb_driver sd_driver = {
582#endif 582#endif
583}; 583};
584 584
585/* -- module insert / remove -- */ 585module_usb_driver(sd_driver);
586static int __init sd_mod_init(void)
587{
588 return usb_register(&sd_driver);
589}
590
591static void __exit sd_mod_exit(void)
592{
593 usb_deregister(&sd_driver);
594}
595
596module_init(sd_mod_init);
597module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/kinect.c b/drivers/media/video/gspca/kinect.c
index 4fe51fda80f3..e8e8f2fe9166 100644
--- a/drivers/media/video/gspca/kinect.c
+++ b/drivers/media/video/gspca/kinect.c
@@ -413,16 +413,4 @@ static struct usb_driver sd_driver = {
413#endif 413#endif
414}; 414};
415 415
416/* -- module insert / remove -- */ 416module_usb_driver(sd_driver);
417static int __init sd_mod_init(void)
418{
419 return usb_register(&sd_driver);
420}
421
422static void __exit sd_mod_exit(void)
423{
424 usb_deregister(&sd_driver);
425}
426
427module_init(sd_mod_init);
428module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/konica.c b/drivers/media/video/gspca/konica.c
index f3f7fe0ec4b7..b1da7f4096c8 100644
--- a/drivers/media/video/gspca/konica.c
+++ b/drivers/media/video/gspca/konica.c
@@ -634,15 +634,4 @@ static struct usb_driver sd_driver = {
634#endif 634#endif
635}; 635};
636 636
637/* -- module insert / remove -- */ 637module_usb_driver(sd_driver);
638static int __init sd_mod_init(void)
639{
640 return usb_register(&sd_driver);
641}
642static void __exit sd_mod_exit(void)
643{
644 usb_deregister(&sd_driver);
645}
646
647module_init(sd_mod_init);
648module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c
index 67533e5582a6..9fe3816b2aa0 100644
--- a/drivers/media/video/gspca/m5602/m5602_core.c
+++ b/drivers/media/video/gspca/m5602/m5602_core.c
@@ -404,19 +404,7 @@ static struct usb_driver sd_driver = {
404 .disconnect = m5602_disconnect 404 .disconnect = m5602_disconnect
405}; 405};
406 406
407/* -- module insert / remove -- */ 407module_usb_driver(sd_driver);
408static int __init mod_m5602_init(void)
409{
410 return usb_register(&sd_driver);
411}
412
413static void __exit mod_m5602_exit(void)
414{
415 usb_deregister(&sd_driver);
416}
417
418module_init(mod_m5602_init);
419module_exit(mod_m5602_exit);
420 408
421MODULE_AUTHOR(DRIVER_AUTHOR); 409MODULE_AUTHOR(DRIVER_AUTHOR);
422MODULE_DESCRIPTION(DRIVER_DESC); 410MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index ef45fa575752..5c2ea05c46b4 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -517,15 +517,4 @@ static struct usb_driver sd_driver = {
517#endif 517#endif
518}; 518};
519 519
520/* -- module insert / remove -- */ 520module_usb_driver(sd_driver);
521static int __init sd_mod_init(void)
522{
523 return usb_register(&sd_driver);
524}
525static void __exit sd_mod_exit(void)
526{
527 usb_deregister(&sd_driver);
528}
529
530module_init(sd_mod_init);
531module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
index 473e813b680e..d73e5bd3dbf7 100644
--- a/drivers/media/video/gspca/mr97310a.c
+++ b/drivers/media/video/gspca/mr97310a.c
@@ -1259,15 +1259,4 @@ static struct usb_driver sd_driver = {
1259#endif 1259#endif
1260}; 1260};
1261 1261
1262/* -- module insert / remove -- */ 1262module_usb_driver(sd_driver);
1263static int __init sd_mod_init(void)
1264{
1265 return usb_register(&sd_driver);
1266}
1267static void __exit sd_mod_exit(void)
1268{
1269 usb_deregister(&sd_driver);
1270}
1271
1272module_init(sd_mod_init);
1273module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/nw80x.c b/drivers/media/video/gspca/nw80x.c
index 7681814e594f..d4bec9321771 100644
--- a/drivers/media/video/gspca/nw80x.c
+++ b/drivers/media/video/gspca/nw80x.c
@@ -2118,18 +2118,7 @@ static struct usb_driver sd_driver = {
2118#endif 2118#endif
2119}; 2119};
2120 2120
2121/* -- module insert / remove -- */ 2121module_usb_driver(sd_driver);
2122static int __init sd_mod_init(void)
2123{
2124 return usb_register(&sd_driver);
2125}
2126static void __exit sd_mod_exit(void)
2127{
2128 usb_deregister(&sd_driver);
2129}
2130
2131module_init(sd_mod_init);
2132module_exit(sd_mod_exit);
2133 2122
2134module_param(webcam, int, 0644); 2123module_param(webcam, int, 0644);
2135MODULE_PARM_DESC(webcam, 2124MODULE_PARM_DESC(webcam,
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 6a01b35a9478..08b8ce1dee18 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -5056,18 +5056,7 @@ static struct usb_driver sd_driver = {
5056#endif 5056#endif
5057}; 5057};
5058 5058
5059/* -- module insert / remove -- */ 5059module_usb_driver(sd_driver);
5060static int __init sd_mod_init(void)
5061{
5062 return usb_register(&sd_driver);
5063}
5064static void __exit sd_mod_exit(void)
5065{
5066 usb_deregister(&sd_driver);
5067}
5068
5069module_init(sd_mod_init);
5070module_exit(sd_mod_exit);
5071 5060
5072module_param(frame_rate, int, 0644); 5061module_param(frame_rate, int, 0644);
5073MODULE_PARM_DESC(frame_rate, "Frame rate (5, 10, 15, 20 or 30 fps)"); 5062MODULE_PARM_DESC(frame_rate, "Frame rate (5, 10, 15, 20 or 30 fps)");
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c
index 76907eced4a1..04753391de3e 100644
--- a/drivers/media/video/gspca/ov534.c
+++ b/drivers/media/video/gspca/ov534.c
@@ -1533,16 +1533,4 @@ static struct usb_driver sd_driver = {
1533#endif 1533#endif
1534}; 1534};
1535 1535
1536/* -- module insert / remove -- */ 1536module_usb_driver(sd_driver);
1537static int __init sd_mod_init(void)
1538{
1539 return usb_register(&sd_driver);
1540}
1541
1542static void __exit sd_mod_exit(void)
1543{
1544 usb_deregister(&sd_driver);
1545}
1546
1547module_init(sd_mod_init);
1548module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/ov534_9.c b/drivers/media/video/gspca/ov534_9.c
index b3b1ea60a841..f30060d50633 100644
--- a/drivers/media/video/gspca/ov534_9.c
+++ b/drivers/media/video/gspca/ov534_9.c
@@ -1432,16 +1432,4 @@ static struct usb_driver sd_driver = {
1432#endif 1432#endif
1433}; 1433};
1434 1434
1435/* -- module insert / remove -- */ 1435module_usb_driver(sd_driver);
1436static int __init sd_mod_init(void)
1437{
1438 return usb_register(&sd_driver);
1439}
1440
1441static void __exit sd_mod_exit(void)
1442{
1443 usb_deregister(&sd_driver);
1444}
1445
1446module_init(sd_mod_init);
1447module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index 1600df152fd6..ece8b1e82a13 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -569,15 +569,4 @@ static struct usb_driver sd_driver = {
569#endif 569#endif
570}; 570};
571 571
572/* -- module insert / remove -- */ 572module_usb_driver(sd_driver);
573static int __init sd_mod_init(void)
574{
575 return usb_register(&sd_driver);
576}
577static void __exit sd_mod_exit(void)
578{
579 usb_deregister(&sd_driver);
580}
581
582module_init(sd_mod_init);
583module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/pac7302.c b/drivers/media/video/gspca/pac7302.c
index 1c44f78ff9e2..2811195258c4 100644
--- a/drivers/media/video/gspca/pac7302.c
+++ b/drivers/media/video/gspca/pac7302.c
@@ -1220,15 +1220,4 @@ static struct usb_driver sd_driver = {
1220#endif 1220#endif
1221}; 1221};
1222 1222
1223/* -- module insert / remove -- */ 1223module_usb_driver(sd_driver);
1224static int __init sd_mod_init(void)
1225{
1226 return usb_register(&sd_driver);
1227}
1228static void __exit sd_mod_exit(void)
1229{
1230 usb_deregister(&sd_driver);
1231}
1232
1233module_init(sd_mod_init);
1234module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 7509d05dc065..1ac111176ffa 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -868,15 +868,4 @@ static struct usb_driver sd_driver = {
868#endif 868#endif
869}; 869};
870 870
871/* -- module insert / remove -- */ 871module_usb_driver(sd_driver);
872static int __init sd_mod_init(void)
873{
874 return usb_register(&sd_driver);
875}
876static void __exit sd_mod_exit(void)
877{
878 usb_deregister(&sd_driver);
879}
880
881module_init(sd_mod_init);
882module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/se401.c b/drivers/media/video/gspca/se401.c
index 3b71bbcd977a..1494e1829d36 100644
--- a/drivers/media/video/gspca/se401.c
+++ b/drivers/media/video/gspca/se401.c
@@ -766,15 +766,4 @@ static struct usb_driver sd_driver = {
766 .post_reset = sd_post_reset, 766 .post_reset = sd_post_reset,
767}; 767};
768 768
769/* -- module insert / remove -- */ 769module_usb_driver(sd_driver);
770static int __init sd_mod_init(void)
771{
772 return usb_register(&sd_driver);
773}
774static void __exit sd_mod_exit(void)
775{
776 usb_deregister(&sd_driver);
777}
778
779module_init(sd_mod_init);
780module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sn9c2028.c b/drivers/media/video/gspca/sn9c2028.c
index 48aae3926a33..478533cb1152 100644
--- a/drivers/media/video/gspca/sn9c2028.c
+++ b/drivers/media/video/gspca/sn9c2028.c
@@ -737,16 +737,4 @@ static struct usb_driver sd_driver = {
737#endif 737#endif
738}; 738};
739 739
740/* -- module insert / remove -- */ 740module_usb_driver(sd_driver);
741static int __init sd_mod_init(void)
742{
743 return usb_register(&sd_driver);
744}
745
746static void __exit sd_mod_exit(void)
747{
748 usb_deregister(&sd_driver);
749}
750
751module_init(sd_mod_init);
752module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index 86e07a139a16..33cabc342dcf 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -2554,15 +2554,4 @@ static struct usb_driver sd_driver = {
2554#endif 2554#endif
2555}; 2555};
2556 2556
2557/* -- module insert / remove -- */ 2557module_usb_driver(sd_driver);
2558static int __init sd_mod_init(void)
2559{
2560 return usb_register(&sd_driver);
2561}
2562static void __exit sd_mod_exit(void)
2563{
2564 usb_deregister(&sd_driver);
2565}
2566
2567module_init(sd_mod_init);
2568module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 146b459b08d5..ddb392dc4f2d 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -1527,15 +1527,4 @@ static struct usb_driver sd_driver = {
1527#endif 1527#endif
1528}; 1528};
1529 1529
1530/* -- module insert / remove -- */ 1530module_usb_driver(sd_driver);
1531static int __init sd_mod_init(void)
1532{
1533 return usb_register(&sd_driver);
1534}
1535static void __exit sd_mod_exit(void)
1536{
1537 usb_deregister(&sd_driver);
1538}
1539
1540module_init(sd_mod_init);
1541module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index c746bf19ca14..afa3186b8038 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -3104,15 +3104,4 @@ static struct usb_driver sd_driver = {
3104#endif 3104#endif
3105}; 3105};
3106 3106
3107/* -- module insert / remove -- */ 3107module_usb_driver(sd_driver);
3108static int __init sd_mod_init(void)
3109{
3110 return usb_register(&sd_driver);
3111}
3112static void __exit sd_mod_exit(void)
3113{
3114 usb_deregister(&sd_driver);
3115}
3116
3117module_init(sd_mod_init);
3118module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca1528.c b/drivers/media/video/gspca/spca1528.c
index 695673106e76..070b9c33b517 100644
--- a/drivers/media/video/gspca/spca1528.c
+++ b/drivers/media/video/gspca/spca1528.c
@@ -590,15 +590,4 @@ static struct usb_driver sd_driver = {
590#endif 590#endif
591}; 591};
592 592
593/* -- module insert / remove -- */ 593module_usb_driver(sd_driver);
594static int __init sd_mod_init(void)
595{
596 return usb_register(&sd_driver);
597}
598static void __exit sd_mod_exit(void)
599{
600 usb_deregister(&sd_driver);
601}
602
603module_init(sd_mod_init);
604module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c
index bb82c94ece14..103984708c77 100644
--- a/drivers/media/video/gspca/spca500.c
+++ b/drivers/media/video/gspca/spca500.c
@@ -1092,15 +1092,4 @@ static struct usb_driver sd_driver = {
1092#endif 1092#endif
1093}; 1093};
1094 1094
1095/* -- module insert / remove -- */ 1095module_usb_driver(sd_driver);
1096static int __init sd_mod_init(void)
1097{
1098 return usb_register(&sd_driver);
1099}
1100static void __exit sd_mod_exit(void)
1101{
1102 usb_deregister(&sd_driver);
1103}
1104
1105module_init(sd_mod_init);
1106module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c
index 7aaac72aee91..9c16821addd4 100644
--- a/drivers/media/video/gspca/spca501.c
+++ b/drivers/media/video/gspca/spca501.c
@@ -2188,15 +2188,4 @@ static struct usb_driver sd_driver = {
2188#endif 2188#endif
2189}; 2189};
2190 2190
2191/* -- module insert / remove -- */ 2191module_usb_driver(sd_driver);
2192static int __init sd_mod_init(void)
2193{
2194 return usb_register(&sd_driver);
2195}
2196static void __exit sd_mod_exit(void)
2197{
2198 usb_deregister(&sd_driver);
2199}
2200
2201module_init(sd_mod_init);
2202module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c
index 16722dc60394..1320f35e39f2 100644
--- a/drivers/media/video/gspca/spca505.c
+++ b/drivers/media/video/gspca/spca505.c
@@ -815,15 +815,4 @@ static struct usb_driver sd_driver = {
815#endif 815#endif
816}; 816};
817 817
818/* -- module insert / remove -- */ 818module_usb_driver(sd_driver);
819static int __init sd_mod_init(void)
820{
821 return usb_register(&sd_driver);
822}
823static void __exit sd_mod_exit(void)
824{
825 usb_deregister(&sd_driver);
826}
827
828module_init(sd_mod_init);
829module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c
index 89fec4c500af..54eed87672d2 100644
--- a/drivers/media/video/gspca/spca506.c
+++ b/drivers/media/video/gspca/spca506.c
@@ -714,21 +714,4 @@ static struct usb_driver sd_driver = {
714#endif 714#endif
715}; 715};
716 716
717/* -- module insert / remove -- */ 717module_usb_driver(sd_driver);
718static int __init sd_mod_init(void)
719{
720 int ret;
721 ret = usb_register(&sd_driver);
722 if (ret < 0)
723 return ret;
724 PDEBUG(D_PROBE, "registered");
725 return 0;
726}
727static void __exit sd_mod_exit(void)
728{
729 usb_deregister(&sd_driver);
730 PDEBUG(D_PROBE, "deregistered");
731}
732
733module_init(sd_mod_init);
734module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c
index a44fe3d25965..df4e16996461 100644
--- a/drivers/media/video/gspca/spca508.c
+++ b/drivers/media/video/gspca/spca508.c
@@ -1544,15 +1544,4 @@ static struct usb_driver sd_driver = {
1544#endif 1544#endif
1545}; 1545};
1546 1546
1547/* -- module insert / remove -- */ 1547module_usb_driver(sd_driver);
1548static int __init sd_mod_init(void)
1549{
1550 return usb_register(&sd_driver);
1551}
1552static void __exit sd_mod_exit(void)
1553{
1554 usb_deregister(&sd_driver);
1555}
1556
1557module_init(sd_mod_init);
1558module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c
index c82fd53cef95..259a0c73c664 100644
--- a/drivers/media/video/gspca/spca561.c
+++ b/drivers/media/video/gspca/spca561.c
@@ -1106,15 +1106,4 @@ static struct usb_driver sd_driver = {
1106#endif 1106#endif
1107}; 1107};
1108 1108
1109/* -- module insert / remove -- */ 1109module_usb_driver(sd_driver);
1110static int __init sd_mod_init(void)
1111{
1112 return usb_register(&sd_driver);
1113}
1114static void __exit sd_mod_exit(void)
1115{
1116 usb_deregister(&sd_driver);
1117}
1118
1119module_init(sd_mod_init);
1120module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sq905.c b/drivers/media/video/gspca/sq905.c
index df805f798282..2fe3c29bd6b7 100644
--- a/drivers/media/video/gspca/sq905.c
+++ b/drivers/media/video/gspca/sq905.c
@@ -432,16 +432,4 @@ static struct usb_driver sd_driver = {
432#endif 432#endif
433}; 433};
434 434
435/* -- module insert / remove -- */ 435module_usb_driver(sd_driver);
436static int __init sd_mod_init(void)
437{
438 return usb_register(&sd_driver);
439}
440
441static void __exit sd_mod_exit(void)
442{
443 usb_deregister(&sd_driver);
444}
445
446module_init(sd_mod_init);
447module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sq905c.c b/drivers/media/video/gspca/sq905c.c
index c2c056056e08..ae783634712f 100644
--- a/drivers/media/video/gspca/sq905c.c
+++ b/drivers/media/video/gspca/sq905c.c
@@ -339,16 +339,4 @@ static struct usb_driver sd_driver = {
339#endif 339#endif
340}; 340};
341 341
342/* -- module insert / remove -- */ 342module_usb_driver(sd_driver);
343static int __init sd_mod_init(void)
344{
345 return usb_register(&sd_driver);
346}
347
348static void __exit sd_mod_exit(void)
349{
350 usb_deregister(&sd_driver);
351}
352
353module_init(sd_mod_init);
354module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c
index e4255b4905e7..1a8ba9b3550a 100644
--- a/drivers/media/video/gspca/sq930x.c
+++ b/drivers/media/video/gspca/sq930x.c
@@ -1197,15 +1197,4 @@ static struct usb_driver sd_driver = {
1197#endif 1197#endif
1198}; 1198};
1199 1199
1200/* -- module insert / remove -- */ 1200module_usb_driver(sd_driver);
1201static int __init sd_mod_init(void)
1202{
1203 return usb_register(&sd_driver);
1204}
1205static void __exit sd_mod_exit(void)
1206{
1207 usb_deregister(&sd_driver);
1208}
1209
1210module_init(sd_mod_init);
1211module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c
index 42a7a28a6c8b..4ae7cc8f463a 100644
--- a/drivers/media/video/gspca/stk014.c
+++ b/drivers/media/video/gspca/stk014.c
@@ -519,15 +519,4 @@ static struct usb_driver sd_driver = {
519#endif 519#endif
520}; 520};
521 521
522/* -- module insert / remove -- */ 522module_usb_driver(sd_driver);
523static int __init sd_mod_init(void)
524{
525 return usb_register(&sd_driver);
526}
527static void __exit sd_mod_exit(void)
528{
529 usb_deregister(&sd_driver);
530}
531
532module_init(sd_mod_init);
533module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/stv0680.c b/drivers/media/video/gspca/stv0680.c
index 4dcc7e37f9fd..461ed645f309 100644
--- a/drivers/media/video/gspca/stv0680.c
+++ b/drivers/media/video/gspca/stv0680.c
@@ -355,15 +355,4 @@ static struct usb_driver sd_driver = {
355#endif 355#endif
356}; 356};
357 357
358/* -- module insert / remove -- */ 358module_usb_driver(sd_driver);
359static int __init sd_mod_init(void)
360{
361 return usb_register(&sd_driver);
362}
363static void __exit sd_mod_exit(void)
364{
365 usb_deregister(&sd_driver);
366}
367
368module_init(sd_mod_init);
369module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c
index b1fca7db1015..0ab425fbea9a 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx.c
@@ -612,18 +612,7 @@ static struct usb_driver sd_driver = {
612#endif 612#endif
613}; 613};
614 614
615/* -- module insert / remove -- */ 615module_usb_driver(sd_driver);
616static int __init sd_mod_init(void)
617{
618 return usb_register(&sd_driver);
619}
620static void __exit sd_mod_exit(void)
621{
622 usb_deregister(&sd_driver);
623}
624
625module_init(sd_mod_init);
626module_exit(sd_mod_exit);
627 616
628module_param(dump_bridge, bool, S_IRUGO | S_IWUSR); 617module_param(dump_bridge, bool, S_IRUGO | S_IWUSR);
629MODULE_PARM_DESC(dump_bridge, "Dumps all usb bridge registers at startup"); 618MODULE_PARM_DESC(dump_bridge, "Dumps all usb bridge registers at startup");
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c
index c8909772435a..c80f0c0c75b6 100644
--- a/drivers/media/video/gspca/sunplus.c
+++ b/drivers/media/video/gspca/sunplus.c
@@ -1211,15 +1211,4 @@ static struct usb_driver sd_driver = {
1211#endif 1211#endif
1212}; 1212};
1213 1213
1214/* -- module insert / remove -- */ 1214module_usb_driver(sd_driver);
1215static int __init sd_mod_init(void)
1216{
1217 return usb_register(&sd_driver);
1218}
1219static void __exit sd_mod_exit(void)
1220{
1221 usb_deregister(&sd_driver);
1222}
1223
1224module_init(sd_mod_init);
1225module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index 90f0877eb599..ea44deb66af4 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -1438,15 +1438,4 @@ static struct usb_driver sd_driver = {
1438#endif 1438#endif
1439}; 1439};
1440 1440
1441/* -- module insert / remove -- */ 1441module_usb_driver(sd_driver);
1442static int __init sd_mod_init(void)
1443{
1444 return usb_register(&sd_driver);
1445}
1446static void __exit sd_mod_exit(void)
1447{
1448 usb_deregister(&sd_driver);
1449}
1450
1451module_init(sd_mod_init);
1452module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/topro.c b/drivers/media/video/gspca/topro.c
index 29596c59837f..b2695b1dc603 100644
--- a/drivers/media/video/gspca/topro.c
+++ b/drivers/media/video/gspca/topro.c
@@ -4971,18 +4971,7 @@ static struct usb_driver sd_driver = {
4971#endif 4971#endif
4972}; 4972};
4973 4973
4974/* -- module insert / remove -- */ 4974module_usb_driver(sd_driver);
4975static int __init sd_mod_init(void)
4976{
4977 return usb_register(&sd_driver);
4978}
4979static void __exit sd_mod_exit(void)
4980{
4981 usb_deregister(&sd_driver);
4982}
4983
4984module_init(sd_mod_init);
4985module_exit(sd_mod_exit);
4986 4975
4987module_param(force_sensor, int, 0644); 4976module_param(force_sensor, int, 0644);
4988MODULE_PARM_DESC(force_sensor, 4977MODULE_PARM_DESC(force_sensor,
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c
index 933ef2ca658c..c8922c5ffbf5 100644
--- a/drivers/media/video/gspca/tv8532.c
+++ b/drivers/media/video/gspca/tv8532.c
@@ -418,16 +418,4 @@ static struct usb_driver sd_driver = {
418#endif 418#endif
419}; 419};
420 420
421/* -- module insert / remove -- */ 421module_usb_driver(sd_driver);
422static int __init sd_mod_init(void)
423{
424 return usb_register(&sd_driver);
425}
426
427static void __exit sd_mod_exit(void)
428{
429 usb_deregister(&sd_driver);
430}
431
432module_init(sd_mod_init);
433module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 7ee2c8271dcc..208f6b2d512a 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -4230,15 +4230,4 @@ static struct usb_driver sd_driver = {
4230#endif 4230#endif
4231}; 4231};
4232 4232
4233/* -- module insert / remove -- */ 4233module_usb_driver(sd_driver);
4234static int __init sd_mod_init(void)
4235{
4236 return usb_register(&sd_driver);
4237}
4238static void __exit sd_mod_exit(void)
4239{
4240 usb_deregister(&sd_driver);
4241}
4242
4243module_init(sd_mod_init);
4244module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/vicam.c b/drivers/media/video/gspca/vicam.c
index 81dd4c99d025..d12ea1518ace 100644
--- a/drivers/media/video/gspca/vicam.c
+++ b/drivers/media/video/gspca/vicam.c
@@ -368,16 +368,4 @@ static struct usb_driver sd_driver = {
368#endif 368#endif
369}; 369};
370 370
371/* -- module insert / remove -- */ 371module_usb_driver(sd_driver);
372static int __init sd_mod_init(void)
373{
374 return usb_register(&sd_driver);
375}
376
377static void __exit sd_mod_exit(void)
378{
379 usb_deregister(&sd_driver);
380}
381
382module_init(sd_mod_init);
383module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/xirlink_cit.c b/drivers/media/video/gspca/xirlink_cit.c
index 3aed42acdb5a..fbb6ed25ec31 100644
--- a/drivers/media/video/gspca/xirlink_cit.c
+++ b/drivers/media/video/gspca/xirlink_cit.c
@@ -3325,15 +3325,4 @@ static struct usb_driver sd_driver = {
3325#endif 3325#endif
3326}; 3326};
3327 3327
3328/* -- module insert / remove -- */ 3328module_usb_driver(sd_driver);
3329static int __init sd_mod_init(void)
3330{
3331 return usb_register(&sd_driver);
3332}
3333static void __exit sd_mod_exit(void)
3334{
3335 usb_deregister(&sd_driver);
3336}
3337
3338module_init(sd_mod_init);
3339module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 30ea1e479492..0202fead6b97 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -7050,18 +7050,7 @@ static struct usb_driver sd_driver = {
7050#endif 7050#endif
7051}; 7051};
7052 7052
7053static int __init sd_mod_init(void) 7053module_usb_driver(sd_driver);
7054{
7055 return usb_register(&sd_driver);
7056}
7057
7058static void __exit sd_mod_exit(void)
7059{
7060 usb_deregister(&sd_driver);
7061}
7062
7063module_init(sd_mod_init);
7064module_exit(sd_mod_exit);
7065 7054
7066module_param(force_sensor, int, 0644); 7055module_param(force_sensor, int, 0644);
7067MODULE_PARM_DESC(force_sensor, 7056MODULE_PARM_DESC(force_sensor,
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 441dacf642bb..3f1a5b1beeba 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -452,26 +452,7 @@ static struct usb_driver hdpvr_usb_driver = {
452 .id_table = hdpvr_table, 452 .id_table = hdpvr_table,
453}; 453};
454 454
455static int __init hdpvr_init(void) 455module_usb_driver(hdpvr_usb_driver);
456{
457 int result;
458
459 /* register this driver with the USB subsystem */
460 result = usb_register(&hdpvr_usb_driver);
461 if (result)
462 err("usb_register failed. Error number %d", result);
463
464 return result;
465}
466
467static void __exit hdpvr_exit(void)
468{
469 /* deregister this driver with the USB subsystem */
470 usb_deregister(&hdpvr_usb_driver);
471}
472
473module_init(hdpvr_init);
474module_exit(hdpvr_exit);
475 456
476MODULE_LICENSE("GPL"); 457MODULE_LICENSE("GPL");
477MODULE_VERSION("0.2.1"); 458MODULE_VERSION("0.2.1");
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 803c9c82e496..c1bef6187661 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -2682,25 +2682,7 @@ static struct usb_driver s2255_driver = {
2682 .id_table = s2255_table, 2682 .id_table = s2255_table,
2683}; 2683};
2684 2684
2685static int __init usb_s2255_init(void) 2685module_usb_driver(s2255_driver);
2686{
2687 int result;
2688 /* register this driver with the USB subsystem */
2689 result = usb_register(&s2255_driver);
2690 if (result)
2691 pr_err(KBUILD_MODNAME
2692 ": usb_register failed. Error number %d\n", result);
2693 dprintk(2, "%s\n", __func__);
2694 return result;
2695}
2696
2697static void __exit usb_s2255_exit(void)
2698{
2699 usb_deregister(&s2255_driver);
2700}
2701
2702module_init(usb_s2255_init);
2703module_exit(usb_s2255_exit);
2704 2686
2705MODULE_DESCRIPTION("Sensoray 2255 Video for Linux driver"); 2687MODULE_DESCRIPTION("Sensoray 2255 Video for Linux driver");
2706MODULE_AUTHOR("Dean Anderson (Sensoray Company Inc.)"); 2688MODULE_AUTHOR("Dean Anderson (Sensoray Company Inc.)");
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 16cb07c5c27b..7025be129286 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -3420,27 +3420,4 @@ static struct usb_driver sn9c102_usb_driver = {
3420 .disconnect = sn9c102_usb_disconnect, 3420 .disconnect = sn9c102_usb_disconnect,
3421}; 3421};
3422 3422
3423/*****************************************************************************/ 3423module_usb_driver(sn9c102_usb_driver);
3424
3425static int __init sn9c102_module_init(void)
3426{
3427 int err = 0;
3428
3429 KDBG(2, SN9C102_MODULE_NAME " v" SN9C102_MODULE_VERSION);
3430 KDBG(3, SN9C102_MODULE_AUTHOR);
3431
3432 if ((err = usb_register(&sn9c102_usb_driver)))
3433 KDBG(1, "usb_register() failed");
3434
3435 return err;
3436}
3437
3438
3439static void __exit sn9c102_module_exit(void)
3440{
3441 usb_deregister(&sn9c102_usb_driver);
3442}
3443
3444
3445module_init(sn9c102_module_init);
3446module_exit(sn9c102_module_exit);
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index cbc105f975de..b7fb5a5cad7e 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -1377,25 +1377,4 @@ static struct usb_driver stk_camera_driver = {
1377#endif 1377#endif
1378}; 1378};
1379 1379
1380 1380module_usb_driver(stk_camera_driver);
1381static int __init stk_camera_init(void)
1382{
1383 int result;
1384
1385 result = usb_register(&stk_camera_driver);
1386 if (result)
1387 STK_ERROR("usb_register failed ! Error number %d\n", result);
1388
1389
1390 return result;
1391}
1392
1393static void __exit stk_camera_exit(void)
1394{
1395 usb_deregister(&stk_camera_driver);
1396}
1397
1398module_init(stk_camera_init);
1399module_exit(stk_camera_exit);
1400
1401
diff --git a/drivers/media/video/tm6000/tm6000-cards.c b/drivers/media/video/tm6000/tm6000-cards.c
index ec2578a0fdf7..ff939bc0e0b9 100644
--- a/drivers/media/video/tm6000/tm6000-cards.c
+++ b/drivers/media/video/tm6000/tm6000-cards.c
@@ -1371,31 +1371,7 @@ static struct usb_driver tm6000_usb_driver = {
1371 .id_table = tm6000_id_table, 1371 .id_table = tm6000_id_table,
1372}; 1372};
1373 1373
1374static int __init tm6000_module_init(void) 1374module_usb_driver(tm6000_usb_driver);
1375{
1376 int result;
1377
1378 printk(KERN_INFO "tm6000" " v4l2 driver version %d.%d.%d loaded\n",
1379 (TM6000_VERSION >> 16) & 0xff,
1380 (TM6000_VERSION >> 8) & 0xff, TM6000_VERSION & 0xff);
1381
1382 /* register this driver with the USB subsystem */
1383 result = usb_register(&tm6000_usb_driver);
1384 if (result)
1385 printk(KERN_ERR "tm6000"
1386 " usb_register failed. Error number %d.\n", result);
1387
1388 return result;
1389}
1390
1391static void __exit tm6000_module_exit(void)
1392{
1393 /* deregister at USB subsystem */
1394 usb_deregister(&tm6000_usb_driver);
1395}
1396
1397module_init(tm6000_module_init);
1398module_exit(tm6000_module_exit);
1399 1375
1400MODULE_DESCRIPTION("Trident TVMaster TM5600/TM6000/TM6010 USB2 adapter"); 1376MODULE_DESCRIPTION("Trident TVMaster TM5600/TM6000/TM6010 USB2 adapter");
1401MODULE_AUTHOR("Mauro Carvalho Chehab"); 1377MODULE_AUTHOR("Mauro Carvalho Chehab");
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index e78cf94f491e..cd2e39fc4bf0 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -1695,28 +1695,7 @@ static struct usb_driver zr364xx_driver = {
1695 .id_table = device_table 1695 .id_table = device_table
1696}; 1696};
1697 1697
1698 1698module_usb_driver(zr364xx_driver);
1699static int __init zr364xx_init(void)
1700{
1701 int retval;
1702 retval = usb_register(&zr364xx_driver);
1703 if (retval)
1704 printk(KERN_ERR KBUILD_MODNAME ": usb_register failed!\n");
1705 else
1706 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
1707 return retval;
1708}
1709
1710
1711static void __exit zr364xx_exit(void)
1712{
1713 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC " module unloaded\n");
1714 usb_deregister(&zr364xx_driver);
1715}
1716
1717
1718module_init(zr364xx_init);
1719module_exit(zr364xx_exit);
1720 1699
1721MODULE_AUTHOR(DRIVER_AUTHOR); 1700MODULE_AUTHOR(DRIVER_AUTHOR);
1722MODULE_DESCRIPTION(DRIVER_DESC); 1701MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c
index f08f944ac53c..c0105a2e269a 100644
--- a/drivers/mmc/host/ushc.c
+++ b/drivers/mmc/host/ushc.c
@@ -562,17 +562,7 @@ static struct usb_driver ushc_driver = {
562 .disconnect = ushc_disconnect, 562 .disconnect = ushc_disconnect,
563}; 563};
564 564
565static int __init ushc_init(void) 565module_usb_driver(ushc_driver);
566{
567 return usb_register(&ushc_driver);
568}
569module_init(ushc_init);
570
571static void __exit ushc_exit(void)
572{
573 usb_deregister(&ushc_driver);
574}
575module_exit(ushc_exit);
576 566
577MODULE_DESCRIPTION("USB SD Host Controller driver"); 567MODULE_DESCRIPTION("USB SD Host Controller driver");
578MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>"); 568MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>");
diff --git a/drivers/mtd/nand/alauda.c b/drivers/mtd/nand/alauda.c
index eb40ea829ab2..6a5ff64a139e 100644
--- a/drivers/mtd/nand/alauda.c
+++ b/drivers/mtd/nand/alauda.c
@@ -717,17 +717,6 @@ static struct usb_driver alauda_driver = {
717 .id_table = alauda_table, 717 .id_table = alauda_table,
718}; 718};
719 719
720static int __init alauda_init(void) 720module_usb_driver(alauda_driver);
721{
722 return usb_register(&alauda_driver);
723}
724
725static void __exit alauda_exit(void)
726{
727 usb_deregister(&alauda_driver);
728}
729
730module_init(alauda_init);
731module_exit(alauda_exit);
732 721
733MODULE_LICENSE("GPL"); 722MODULE_LICENSE("GPL");
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 4ef7e2fd9fe6..aef42f045320 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -26,7 +26,6 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/sched.h> 28#include <linux/sched.h>
29#include <linux/sysdev.h>
30#include <linux/fs.h> 29#include <linux/fs.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/string.h> 31#include <linux/string.h>
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index a72c7bfb4090..9697c14b8dc6 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -1115,28 +1115,4 @@ static struct usb_driver ems_usb_driver = {
1115 .id_table = ems_usb_table, 1115 .id_table = ems_usb_table,
1116}; 1116};
1117 1117
1118static int __init ems_usb_init(void) 1118module_usb_driver(ems_usb_driver);
1119{
1120 int err;
1121
1122 printk(KERN_INFO "CPC-USB kernel driver loaded\n");
1123
1124 /* register this driver with the USB subsystem */
1125 err = usb_register(&ems_usb_driver);
1126
1127 if (err) {
1128 err("usb_register failed. Error number %d\n", err);
1129 return err;
1130 }
1131
1132 return 0;
1133}
1134
1135static void __exit ems_usb_exit(void)
1136{
1137 /* deregister this driver with the USB subsystem */
1138 usb_deregister(&ems_usb_driver);
1139}
1140
1141module_init(ems_usb_init);
1142module_exit(ems_usb_exit);
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index eb8b0e600282..92774637aad8 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -1108,25 +1108,4 @@ static struct usb_driver esd_usb2_driver = {
1108 .id_table = esd_usb2_table, 1108 .id_table = esd_usb2_table,
1109}; 1109};
1110 1110
1111static int __init esd_usb2_init(void) 1111module_usb_driver(esd_usb2_driver);
1112{
1113 int err;
1114
1115 /* register this driver with the USB subsystem */
1116 err = usb_register(&esd_usb2_driver);
1117
1118 if (err) {
1119 err("usb_register failed. Error number %d\n", err);
1120 return err;
1121 }
1122
1123 return 0;
1124}
1125module_init(esd_usb2_init);
1126
1127static void __exit esd_usb2_exit(void)
1128{
1129 /* deregister this driver with the USB subsystem */
1130 usb_deregister(&esd_usb2_driver);
1131}
1132module_exit(esd_usb2_exit);
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index d9267cb98a23..72f687b40d66 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1914,41 +1914,8 @@ static struct usb_driver irda_driver = {
1914#endif 1914#endif
1915}; 1915};
1916 1916
1917/************************* MODULE CALLBACKS *************************/ 1917module_usb_driver(irda_driver);
1918/*
1919 * Deal with module insertion/removal
1920 * Mostly tell USB about our existence
1921 */
1922
1923/*------------------------------------------------------------------*/
1924/*
1925 * Module insertion
1926 */
1927static int __init usb_irda_init(void)
1928{
1929 int ret;
1930
1931 ret = usb_register(&irda_driver);
1932 if (ret < 0)
1933 return ret;
1934
1935 IRDA_MESSAGE("USB IrDA support registered\n");
1936 return 0;
1937}
1938module_init(usb_irda_init);
1939 1918
1940/*------------------------------------------------------------------*/
1941/*
1942 * Module removal
1943 */
1944static void __exit usb_irda_cleanup(void)
1945{
1946 /* Deregister the driver and remove all pending instances */
1947 usb_deregister(&irda_driver);
1948}
1949module_exit(usb_irda_cleanup);
1950
1951/*------------------------------------------------------------------*/
1952/* 1919/*
1953 * Module parameters 1920 * Module parameters
1954 */ 1921 */
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c
index cb90d640007a..79aebeee928c 100644
--- a/drivers/net/irda/kingsun-sir.c
+++ b/drivers/net/irda/kingsun-sir.c
@@ -621,24 +621,7 @@ static struct usb_driver irda_driver = {
621#endif 621#endif
622}; 622};
623 623
624/* 624module_usb_driver(irda_driver);
625 * Module insertion
626 */
627static int __init kingsun_init(void)
628{
629 return usb_register(&irda_driver);
630}
631module_init(kingsun_init);
632
633/*
634 * Module removal
635 */
636static void __exit kingsun_cleanup(void)
637{
638 /* Deregister the driver and remove all pending instances */
639 usb_deregister(&irda_driver);
640}
641module_exit(kingsun_cleanup);
642 625
643MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); 626MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
644MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); 627MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine");
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c
index 1046014dd6c2..abe689dffc72 100644
--- a/drivers/net/irda/ks959-sir.c
+++ b/drivers/net/irda/ks959-sir.c
@@ -901,26 +901,7 @@ static struct usb_driver irda_driver = {
901#endif 901#endif
902}; 902};
903 903
904/* 904module_usb_driver(irda_driver);
905 * Module insertion
906 */
907static int __init ks959_init(void)
908{
909 return usb_register(&irda_driver);
910}
911
912module_init(ks959_init);
913
914/*
915 * Module removal
916 */
917static void __exit ks959_cleanup(void)
918{
919 /* Deregister the driver and remove all pending instances */
920 usb_deregister(&irda_driver);
921}
922
923module_exit(ks959_cleanup);
924 905
925MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); 906MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
926MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); 907MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959");
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index 9cc142fcc712..f8c01088eeb7 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
@@ -796,26 +796,7 @@ static struct usb_driver irda_driver = {
796#endif 796#endif
797}; 797};
798 798
799/* 799module_usb_driver(irda_driver);
800 * Module insertion
801 */
802static int __init ksdazzle_init(void)
803{
804 return usb_register(&irda_driver);
805}
806
807module_init(ksdazzle_init);
808
809/*
810 * Module removal
811 */
812static void __exit ksdazzle_cleanup(void)
813{
814 /* Deregister the driver and remove all pending instances */
815 usb_deregister(&irda_driver);
816}
817
818module_exit(ksdazzle_cleanup);
819 800
820MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); 801MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
821MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); 802MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle");
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index be52bfed66a9..1a00b5990cb8 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -968,25 +968,4 @@ static void mcs_disconnect(struct usb_interface *intf)
968 IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); 968 IRDA_DEBUG(0, "MCS7780 now disconnected.\n");
969} 969}
970 970
971/* Module insertion */ 971module_usb_driver(mcs_driver);
972static int __init mcs_init(void)
973{
974 int result;
975
976 /* register this driver with the USB subsystem */
977 result = usb_register(&mcs_driver);
978 if (result)
979 IRDA_ERROR("usb_register failed. Error number %d\n", result);
980
981 return result;
982}
983module_init(mcs_init);
984
985/* Module removal */
986static void __exit mcs_exit(void)
987{
988 /* deregister this driver with the USB subsystem */
989 usb_deregister(&mcs_driver);
990}
991module_exit(mcs_exit);
992
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index 41c96b3d8152..212868eb6f5f 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -1133,21 +1133,4 @@ static struct usb_driver irda_driver = {
1133#endif 1133#endif
1134}; 1134};
1135 1135
1136/* 1136module_usb_driver(irda_driver);
1137 * Module insertion
1138 */
1139static int __init stir_init(void)
1140{
1141 return usb_register(&irda_driver);
1142}
1143module_init(stir_init);
1144
1145/*
1146 * Module removal
1147 */
1148static void __exit stir_cleanup(void)
1149{
1150 /* Deregister the driver and remove all pending instances */
1151 usb_deregister(&irda_driver);
1152}
1153module_exit(stir_cleanup);
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index dbdca225b846..1ff7163bc348 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1678,17 +1678,7 @@ static struct usb_driver asix_driver = {
1678 .supports_autosuspend = 1, 1678 .supports_autosuspend = 1,
1679}; 1679};
1680 1680
1681static int __init asix_init(void) 1681module_usb_driver(asix_driver);
1682{
1683 return usb_register(&asix_driver);
1684}
1685module_init(asix_init);
1686
1687static void __exit asix_exit(void)
1688{
1689 usb_deregister(&asix_driver);
1690}
1691module_exit(asix_exit);
1692 1682
1693MODULE_AUTHOR("David Hollis"); 1683MODULE_AUTHOR("David Hollis");
1694MODULE_VERSION(DRIVER_VERSION); 1684MODULE_VERSION(DRIVER_VERSION);
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index a68272c93381..182cfb4aeb1d 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -949,19 +949,4 @@ static struct usb_driver catc_driver = {
949 .id_table = catc_id_table, 949 .id_table = catc_id_table,
950}; 950};
951 951
952static int __init catc_init(void) 952module_usb_driver(catc_driver);
953{
954 int result = usb_register(&catc_driver);
955 if (result == 0)
956 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
957 DRIVER_DESC "\n");
958 return result;
959}
960
961static void __exit catc_exit(void)
962{
963 usb_deregister(&catc_driver);
964}
965
966module_init(catc_init);
967module_exit(catc_exit);
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 331e44056f5a..790cbdea7392 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -457,18 +457,7 @@ static struct usb_driver usbpn_driver = {
457 .id_table = usbpn_ids, 457 .id_table = usbpn_ids,
458}; 458};
459 459
460static int __init usbpn_init(void) 460module_usb_driver(usbpn_driver);
461{
462 return usb_register(&usbpn_driver);
463}
464
465static void __exit usbpn_exit(void)
466{
467 usb_deregister(&usbpn_driver);
468}
469
470module_init(usbpn_init);
471module_exit(usbpn_exit);
472 461
473MODULE_AUTHOR("Remi Denis-Courmont"); 462MODULE_AUTHOR("Remi Denis-Courmont");
474MODULE_DESCRIPTION("USB CDC Phonet host interface"); 463MODULE_DESCRIPTION("USB CDC Phonet host interface");
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 882f53f708df..439690be519f 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -369,18 +369,7 @@ static struct usb_driver eem_driver = {
369 .resume = usbnet_resume, 369 .resume = usbnet_resume,
370}; 370};
371 371
372 372module_usb_driver(eem_driver);
373static int __init eem_init(void)
374{
375 return usb_register(&eem_driver);
376}
377module_init(eem_init);
378
379static void __exit eem_exit(void)
380{
381 usb_deregister(&eem_driver);
382}
383module_exit(eem_exit);
384 373
385MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>"); 374MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>");
386MODULE_DESCRIPTION("USB CDC EEM"); 375MODULE_DESCRIPTION("USB CDC EEM");
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 99ed6eb4dfaf..41a61efc331e 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -425,6 +425,9 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
425 int status; 425 int status;
426 struct cdc_state *info = (void *) &dev->data; 426 struct cdc_state *info = (void *) &dev->data;
427 427
428 BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
429 < sizeof(struct cdc_state)));
430
428 status = usbnet_generic_cdc_bind(dev, intf); 431 status = usbnet_generic_cdc_bind(dev, intf);
429 if (status < 0) 432 if (status < 0)
430 return status; 433 return status;
@@ -615,21 +618,7 @@ static struct usb_driver cdc_driver = {
615 .supports_autosuspend = 1, 618 .supports_autosuspend = 1,
616}; 619};
617 620
618 621module_usb_driver(cdc_driver);
619static int __init cdc_init(void)
620{
621 BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
622 < sizeof(struct cdc_state)));
623
624 return usb_register(&cdc_driver);
625}
626module_init(cdc_init);
627
628static void __exit cdc_exit(void)
629{
630 usb_deregister(&cdc_driver);
631}
632module_exit(cdc_exit);
633 622
634MODULE_AUTHOR("David Brownell"); 623MODULE_AUTHOR("David Brownell");
635MODULE_DESCRIPTION("USB CDC Ethernet devices"); 624MODULE_DESCRIPTION("USB CDC Ethernet devices");
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 009dd0f18535..cb8e595c5021 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1230,20 +1230,7 @@ static struct ethtool_ops cdc_ncm_ethtool_ops = {
1230 .nway_reset = usbnet_nway_reset, 1230 .nway_reset = usbnet_nway_reset,
1231}; 1231};
1232 1232
1233static int __init cdc_ncm_init(void) 1233module_usb_driver(cdc_ncm_driver);
1234{
1235 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION "\n");
1236 return usb_register(&cdc_ncm_driver);
1237}
1238
1239module_init(cdc_ncm_init);
1240
1241static void __exit cdc_ncm_exit(void)
1242{
1243 usb_deregister(&cdc_ncm_driver);
1244}
1245
1246module_exit(cdc_ncm_exit);
1247 1234
1248MODULE_AUTHOR("Hans Petter Selasky"); 1235MODULE_AUTHOR("Hans Petter Selasky");
1249MODULE_DESCRIPTION("USB CDC NCM host driver"); 1236MODULE_DESCRIPTION("USB CDC NCM host driver");
diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c
index fc5f13d47ad9..b403d934e4e3 100644
--- a/drivers/net/usb/cdc_subset.c
+++ b/drivers/net/usb/cdc_subset.c
@@ -338,17 +338,7 @@ static struct usb_driver cdc_subset_driver = {
338 .id_table = products, 338 .id_table = products,
339}; 339};
340 340
341static int __init cdc_subset_init(void) 341module_usb_driver(cdc_subset_driver);
342{
343 return usb_register(&cdc_subset_driver);
344}
345module_init(cdc_subset_init);
346
347static void __exit cdc_subset_exit(void)
348{
349 usb_deregister(&cdc_subset_driver);
350}
351module_exit(cdc_subset_exit);
352 342
353MODULE_AUTHOR("David Brownell"); 343MODULE_AUTHOR("David Brownell");
354MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links"); 344MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links");
diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c
index 8969f124c18c..0e0531356e62 100644
--- a/drivers/net/usb/cx82310_eth.c
+++ b/drivers/net/usb/cx82310_eth.c
@@ -329,17 +329,7 @@ static struct usb_driver cx82310_driver = {
329 .resume = usbnet_resume, 329 .resume = usbnet_resume,
330}; 330};
331 331
332static int __init cx82310_init(void) 332module_usb_driver(cx82310_driver);
333{
334 return usb_register(&cx82310_driver);
335}
336module_init(cx82310_init);
337
338static void __exit cx82310_exit(void)
339{
340 usb_deregister(&cx82310_driver);
341}
342module_exit(cx82310_exit);
343 333
344MODULE_AUTHOR("Ondrej Zary"); 334MODULE_AUTHOR("Ondrej Zary");
345MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver"); 335MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver");
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index fbc0e4def767..b97226318ea5 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -672,18 +672,7 @@ static struct usb_driver dm9601_driver = {
672 .resume = usbnet_resume, 672 .resume = usbnet_resume,
673}; 673};
674 674
675static int __init dm9601_init(void) 675module_usb_driver(dm9601_driver);
676{
677 return usb_register(&dm9601_driver);
678}
679
680static void __exit dm9601_exit(void)
681{
682 usb_deregister(&dm9601_driver);
683}
684
685module_init(dm9601_init);
686module_exit(dm9601_exit);
687 676
688MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); 677MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
689MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices"); 678MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices");
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c
index c4cfd1dea881..38266bdae26b 100644
--- a/drivers/net/usb/gl620a.c
+++ b/drivers/net/usb/gl620a.c
@@ -227,17 +227,7 @@ static struct usb_driver gl620a_driver = {
227 .resume = usbnet_resume, 227 .resume = usbnet_resume,
228}; 228};
229 229
230static int __init usbnet_init(void) 230module_usb_driver(gl620a_driver);
231{
232 return usb_register(&gl620a_driver);
233}
234module_init(usbnet_init);
235
236static void __exit usbnet_exit(void)
237{
238 usb_deregister(&gl620a_driver);
239}
240module_exit(usbnet_exit);
241 231
242MODULE_AUTHOR("Jiun-Jie Huang"); 232MODULE_AUTHOR("Jiun-Jie Huang");
243MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables"); 233MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables");
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c
index 131ac6c172f6..12a22a453ff1 100644
--- a/drivers/net/usb/int51x1.c
+++ b/drivers/net/usb/int51x1.c
@@ -238,17 +238,7 @@ static struct usb_driver int51x1_driver = {
238 .resume = usbnet_resume, 238 .resume = usbnet_resume,
239}; 239};
240 240
241static int __init int51x1_init(void) 241module_usb_driver(int51x1_driver);
242{
243 return usb_register(&int51x1_driver);
244}
245module_init(int51x1_init);
246
247static void __exit int51x1_exit(void)
248{
249 usb_deregister(&int51x1_driver);
250}
251module_exit(int51x1_exit);
252 242
253MODULE_AUTHOR("Peter Holik"); 243MODULE_AUTHOR("Peter Holik");
254MODULE_DESCRIPTION("Intellon usb powerline adapter"); 244MODULE_DESCRIPTION("Intellon usb powerline adapter");
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 13c1f044b40d..08a4df238796 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -543,25 +543,7 @@ static struct usb_driver ipheth_driver = {
543 .id_table = ipheth_table, 543 .id_table = ipheth_table,
544}; 544};
545 545
546static int __init ipheth_init(void) 546module_usb_driver(ipheth_driver);
547{
548 int retval;
549
550 retval = usb_register(&ipheth_driver);
551 if (retval) {
552 err("usb_register failed: %d", retval);
553 return retval;
554 }
555 return 0;
556}
557
558static void __exit ipheth_exit(void)
559{
560 usb_deregister(&ipheth_driver);
561}
562
563module_init(ipheth_init);
564module_exit(ipheth_exit);
565 547
566MODULE_AUTHOR("Diego Giagio <diego@giagio.com>"); 548MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
567MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver"); 549MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
index 5a6d0f88f43b..7562649b3d6b 100644
--- a/drivers/net/usb/kalmia.c
+++ b/drivers/net/usb/kalmia.c
@@ -375,17 +375,7 @@ static struct usb_driver kalmia_driver = {
375 .resume = usbnet_resume 375 .resume = usbnet_resume
376}; 376};
377 377
378static int __init kalmia_init(void) 378module_usb_driver(kalmia_driver);
379{
380 return usb_register(&kalmia_driver);
381}
382module_init( kalmia_init);
383
384static void __exit kalmia_exit(void)
385{
386 usb_deregister(&kalmia_driver);
387}
388module_exit( kalmia_exit);
389 379
390MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>"); 380MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>");
391MODULE_DESCRIPTION("Samsung Kalmia USB network driver"); 381MODULE_DESCRIPTION("Samsung Kalmia USB network driver");
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 582ca2dfa5f9..d034d9c42548 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1324,32 +1324,4 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
1324 } 1324 }
1325} 1325}
1326 1326
1327 1327module_usb_driver(kaweth_driver);
1328/****************************************************************
1329 * kaweth_init
1330 ****************************************************************/
1331static int __init kaweth_init(void)
1332{
1333 dbg("Driver loading");
1334 return usb_register(&kaweth_driver);
1335}
1336
1337/****************************************************************
1338 * kaweth_exit
1339 ****************************************************************/
1340static void __exit kaweth_exit(void)
1341{
1342 usb_deregister(&kaweth_driver);
1343}
1344
1345module_init(kaweth_init);
1346module_exit(kaweth_exit);
1347
1348
1349
1350
1351
1352
1353
1354
1355
diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c
index 9c26c6390d69..45a981fde43f 100644
--- a/drivers/net/usb/lg-vl600.c
+++ b/drivers/net/usb/lg-vl600.c
@@ -346,17 +346,7 @@ static struct usb_driver lg_vl600_driver = {
346 .resume = usbnet_resume, 346 .resume = usbnet_resume,
347}; 347};
348 348
349static int __init vl600_init(void) 349module_usb_driver(lg_vl600_driver);
350{
351 return usb_register(&lg_vl600_driver);
352}
353module_init(vl600_init);
354
355static void __exit vl600_exit(void)
356{
357 usb_deregister(&lg_vl600_driver);
358}
359module_exit(vl600_exit);
360 350
361MODULE_AUTHOR("Anrzej Zaborowski"); 351MODULE_AUTHOR("Anrzej Zaborowski");
362MODULE_DESCRIPTION("LG-VL600 modem's ethernet link"); 352MODULE_DESCRIPTION("LG-VL600 modem's ethernet link");
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index db2cb74bf854..a29aa9cf9f6e 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -692,17 +692,7 @@ static struct usb_driver mcs7830_driver = {
692 .reset_resume = mcs7830_reset_resume, 692 .reset_resume = mcs7830_reset_resume,
693}; 693};
694 694
695static int __init mcs7830_init(void) 695module_usb_driver(mcs7830_driver);
696{
697 return usb_register(&mcs7830_driver);
698}
699module_init(mcs7830_init);
700
701static void __exit mcs7830_exit(void)
702{
703 usb_deregister(&mcs7830_driver);
704}
705module_exit(mcs7830_exit);
706 696
707MODULE_DESCRIPTION("USB to network adapter MCS7830)"); 697MODULE_DESCRIPTION("USB to network adapter MCS7830)");
708MODULE_LICENSE("GPL"); 698MODULE_LICENSE("GPL");
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index 01db4602a39e..83f965cb69e7 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -589,17 +589,7 @@ static struct usb_driver net1080_driver = {
589 .resume = usbnet_resume, 589 .resume = usbnet_resume,
590}; 590};
591 591
592static int __init net1080_init(void) 592module_usb_driver(net1080_driver);
593{
594 return usb_register(&net1080_driver);
595}
596module_init(net1080_init);
597
598static void __exit net1080_exit(void)
599{
600 usb_deregister(&net1080_driver);
601}
602module_exit(net1080_exit);
603 593
604MODULE_AUTHOR("David Brownell"); 594MODULE_AUTHOR("David Brownell");
605MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links"); 595MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links");
diff --git a/drivers/net/usb/plusb.c b/drivers/net/usb/plusb.c
index 217aec8a768f..b2b035e29978 100644
--- a/drivers/net/usb/plusb.c
+++ b/drivers/net/usb/plusb.c
@@ -154,17 +154,7 @@ static struct usb_driver plusb_driver = {
154 .resume = usbnet_resume, 154 .resume = usbnet_resume,
155}; 155};
156 156
157static int __init plusb_init(void) 157module_usb_driver(plusb_driver);
158{
159 return usb_register(&plusb_driver);
160}
161module_init(plusb_init);
162
163static void __exit plusb_exit(void)
164{
165 usb_deregister(&plusb_driver);
166}
167module_exit(plusb_exit);
168 158
169MODULE_AUTHOR("David Brownell"); 159MODULE_AUTHOR("David Brownell");
170MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver"); 160MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver");
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 255d6a424a6b..c8f1b5b3aff3 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -635,17 +635,7 @@ static struct usb_driver rndis_driver = {
635 .resume = usbnet_resume, 635 .resume = usbnet_resume,
636}; 636};
637 637
638static int __init rndis_init(void) 638module_usb_driver(rndis_driver);
639{
640 return usb_register(&rndis_driver);
641}
642module_init(rndis_init);
643
644static void __exit rndis_exit(void)
645{
646 usb_deregister(&rndis_driver);
647}
648module_exit(rndis_exit);
649 639
650MODULE_AUTHOR("David Brownell"); 640MODULE_AUTHOR("David Brownell");
651MODULE_DESCRIPTION("USB Host side RNDIS driver"); 641MODULE_DESCRIPTION("USB Host side RNDIS driver");
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index bf8c84d0adf2..0710b4ca9252 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -978,20 +978,7 @@ static struct usb_driver rtl8150_driver = {
978 .resume = rtl8150_resume 978 .resume = rtl8150_resume
979}; 979};
980 980
981static int __init usb_rtl8150_init(void) 981module_usb_driver(rtl8150_driver);
982{
983 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
984 DRIVER_DESC "\n");
985 return usb_register(&rtl8150_driver);
986}
987
988static void __exit usb_rtl8150_exit(void)
989{
990 usb_deregister(&rtl8150_driver);
991}
992
993module_init(usb_rtl8150_init);
994module_exit(usb_rtl8150_exit);
995 982
996MODULE_AUTHOR(DRIVER_AUTHOR); 983MODULE_AUTHOR(DRIVER_AUTHOR);
997MODULE_DESCRIPTION(DRIVER_DESC); 984MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index ed1b43210584..e45dfdcb8718 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -900,6 +900,9 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
900 u16 len; 900 u16 len;
901 bool need_tail; 901 bool need_tail;
902 902
903 BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
904 < sizeof(struct cdc_state));
905
903 dev_dbg(&dev->udev->dev, "%s", __func__); 906 dev_dbg(&dev->udev->dev, "%s", __func__);
904 if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) { 907 if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) {
905 /* enough head room as is? */ 908 /* enough head room as is? */
@@ -981,21 +984,7 @@ static struct usb_driver sierra_net_driver = {
981 .no_dynamic_id = 1, 984 .no_dynamic_id = 1,
982}; 985};
983 986
984static int __init sierra_net_init(void) 987module_usb_driver(sierra_net_driver);
985{
986 BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
987 < sizeof(struct cdc_state));
988
989 return usb_register(&sierra_net_driver);
990}
991
992static void __exit sierra_net_exit(void)
993{
994 usb_deregister(&sierra_net_driver);
995}
996
997module_exit(sierra_net_exit);
998module_init(sierra_net_init);
999 988
1000MODULE_AUTHOR(DRIVER_AUTHOR); 989MODULE_AUTHOR(DRIVER_AUTHOR);
1001MODULE_DESCRIPTION(DRIVER_DESC); 990MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 0d5da82f0ff7..3b017bbd2a22 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -1238,17 +1238,7 @@ static struct usb_driver smsc75xx_driver = {
1238 .disconnect = usbnet_disconnect, 1238 .disconnect = usbnet_disconnect,
1239}; 1239};
1240 1240
1241static int __init smsc75xx_init(void) 1241module_usb_driver(smsc75xx_driver);
1242{
1243 return usb_register(&smsc75xx_driver);
1244}
1245module_init(smsc75xx_init);
1246
1247static void __exit smsc75xx_exit(void)
1248{
1249 usb_deregister(&smsc75xx_driver);
1250}
1251module_exit(smsc75xx_exit);
1252 1242
1253MODULE_AUTHOR("Nancy Lin"); 1243MODULE_AUTHOR("Nancy Lin");
1254MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); 1244MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index db217ad66f26..d45520e6dd48 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1298,17 +1298,7 @@ static struct usb_driver smsc95xx_driver = {
1298 .disconnect = usbnet_disconnect, 1298 .disconnect = usbnet_disconnect,
1299}; 1299};
1300 1300
1301static int __init smsc95xx_init(void) 1301module_usb_driver(smsc95xx_driver);
1302{
1303 return usb_register(&smsc95xx_driver);
1304}
1305module_init(smsc95xx_init);
1306
1307static void __exit smsc95xx_exit(void)
1308{
1309 usb_deregister(&smsc95xx_driver);
1310}
1311module_exit(smsc95xx_exit);
1312 1302
1313MODULE_AUTHOR("Nancy Lin"); 1303MODULE_AUTHOR("Nancy Lin");
1314MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); 1304MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
index 1a2234c20514..f701d4127087 100644
--- a/drivers/net/usb/zaurus.c
+++ b/drivers/net/usb/zaurus.c
@@ -362,17 +362,7 @@ static struct usb_driver zaurus_driver = {
362 .resume = usbnet_resume, 362 .resume = usbnet_resume,
363}; 363};
364 364
365static int __init zaurus_init(void) 365module_usb_driver(zaurus_driver);
366{
367 return usb_register(&zaurus_driver);
368}
369module_init(zaurus_init);
370
371static void __exit zaurus_exit(void)
372{
373 usb_deregister(&zaurus_driver);
374}
375module_exit(zaurus_exit);
376 366
377MODULE_AUTHOR("Pavel Machek, David Brownell"); 367MODULE_AUTHOR("Pavel Machek, David Brownell");
378MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products"); 368MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products");
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index 333b69ef2ae2..89821e4835c7 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -1161,15 +1161,4 @@ static struct usb_driver carl9170_driver = {
1161#endif /* CONFIG_PM */ 1161#endif /* CONFIG_PM */
1162}; 1162};
1163 1163
1164static int __init carl9170_usb_init(void) 1164module_usb_driver(carl9170_driver);
1165{
1166 return usb_register(&carl9170_driver);
1167}
1168
1169static void __exit carl9170_usb_exit(void)
1170{
1171 usb_deregister(&carl9170_driver);
1172}
1173
1174module_init(carl9170_usb_init);
1175module_exit(carl9170_usb_exit);
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index db879c364ebf..b5fbbc7947df 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1184,29 +1184,7 @@ static struct usb_driver if_usb_driver = {
1184 .reset_resume = if_usb_resume, 1184 .reset_resume = if_usb_resume,
1185}; 1185};
1186 1186
1187static int __init if_usb_init_module(void) 1187module_usb_driver(if_usb_driver);
1188{
1189 int ret = 0;
1190
1191 lbs_deb_enter(LBS_DEB_MAIN);
1192
1193 ret = usb_register(&if_usb_driver);
1194
1195 lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
1196 return ret;
1197}
1198
1199static void __exit if_usb_exit_module(void)
1200{
1201 lbs_deb_enter(LBS_DEB_MAIN);
1202
1203 usb_deregister(&if_usb_driver);
1204
1205 lbs_deb_leave(LBS_DEB_MAIN);
1206}
1207
1208module_init(if_usb_init_module);
1209module_exit(if_usb_exit_module);
1210 1188
1211MODULE_DESCRIPTION("8388 USB WLAN Driver"); 1189MODULE_DESCRIPTION("8388 USB WLAN Driver");
1212MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc."); 1190MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc.");
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c
index 68202e63873a..aff8b5743af0 100644
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -924,27 +924,7 @@ static struct usb_driver if_usb_driver = {
924 .resume = if_usb_resume, 924 .resume = if_usb_resume,
925}; 925};
926 926
927static int __init if_usb_init_module(void) 927module_usb_driver(if_usb_driver);
928{
929 int ret = 0;
930
931 lbtf_deb_enter(LBTF_DEB_MAIN);
932
933 ret = usb_register(&if_usb_driver);
934
935 lbtf_deb_leave_args(LBTF_DEB_MAIN, "ret %d", ret);
936 return ret;
937}
938
939static void __exit if_usb_exit_module(void)
940{
941 lbtf_deb_enter(LBTF_DEB_MAIN);
942 usb_deregister(&if_usb_driver);
943 lbtf_deb_leave(LBTF_DEB_MAIN);
944}
945
946module_init(if_usb_init_module);
947module_exit(if_usb_exit_module);
948 928
949MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver"); 929MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver");
950MODULE_AUTHOR("Cozybit Inc."); 930MODULE_AUTHOR("Cozybit Inc.");
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index 0793e4265b43..ae8ce56670b6 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -1759,32 +1759,7 @@ static struct usb_driver orinoco_driver = {
1759static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION 1759static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
1760 " (Manuel Estrada Sainz)"; 1760 " (Manuel Estrada Sainz)";
1761 1761
1762static int __init ezusb_module_init(void) 1762module_usb_driver(orinoco_driver);
1763{
1764 int err;
1765
1766 printk(KERN_DEBUG "%s\n", version);
1767
1768 /* register this driver with the USB subsystem */
1769 err = usb_register(&orinoco_driver);
1770 if (err < 0) {
1771 printk(KERN_ERR PFX "usb_register failed, error %d\n",
1772 err);
1773 return err;
1774 }
1775
1776 return 0;
1777}
1778
1779static void __exit ezusb_module_exit(void)
1780{
1781 /* deregister this driver with the USB subsystem */
1782 usb_deregister(&orinoco_driver);
1783}
1784
1785
1786module_init(ezusb_module_init);
1787module_exit(ezusb_module_exit);
1788 1763
1789MODULE_AUTHOR("Manuel Estrada Sainz"); 1764MODULE_AUTHOR("Manuel Estrada Sainz");
1790MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge"); 1765MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge");
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 9b6096866427..f4d28c39aac7 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -1083,15 +1083,4 @@ static struct usb_driver p54u_driver = {
1083 .soft_unbind = 1, 1083 .soft_unbind = 1,
1084}; 1084};
1085 1085
1086static int __init p54u_init(void) 1086module_usb_driver(p54u_driver);
1087{
1088 return usb_register(&p54u_driver);
1089}
1090
1091static void __exit p54u_exit(void)
1092{
1093 usb_deregister(&p54u_driver);
1094}
1095
1096module_init(p54u_init);
1097module_exit(p54u_exit);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 3802c31fefcd..a330c69583d6 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -3771,17 +3771,7 @@ static struct usb_driver rndis_wlan_driver = {
3771 .resume = usbnet_resume, 3771 .resume = usbnet_resume,
3772}; 3772};
3773 3773
3774static int __init rndis_wlan_init(void) 3774module_usb_driver(rndis_wlan_driver);
3775{
3776 return usb_register(&rndis_wlan_driver);
3777}
3778module_init(rndis_wlan_init);
3779
3780static void __exit rndis_wlan_exit(void)
3781{
3782 usb_deregister(&rndis_wlan_driver);
3783}
3784module_exit(rndis_wlan_exit);
3785 3775
3786MODULE_AUTHOR("Bjorge Dijkstra"); 3776MODULE_AUTHOR("Bjorge Dijkstra");
3787MODULE_AUTHOR("Jussi Kivilinna"); 3777MODULE_AUTHOR("Jussi Kivilinna");
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index de7d41f21a69..1de9c752c88b 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1982,15 +1982,4 @@ static struct usb_driver rt2500usb_driver = {
1982 .resume = rt2x00usb_resume, 1982 .resume = rt2x00usb_resume,
1983}; 1983};
1984 1984
1985static int __init rt2500usb_init(void) 1985module_usb_driver(rt2500usb_driver);
1986{
1987 return usb_register(&rt2500usb_driver);
1988}
1989
1990static void __exit rt2500usb_exit(void)
1991{
1992 usb_deregister(&rt2500usb_driver);
1993}
1994
1995module_init(rt2500usb_init);
1996module_exit(rt2500usb_exit);
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index f8eb49f5ac29..262ee9eefb6f 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1217,15 +1217,4 @@ static struct usb_driver rt2800usb_driver = {
1217 .resume = rt2x00usb_resume, 1217 .resume = rt2x00usb_resume,
1218}; 1218};
1219 1219
1220static int __init rt2800usb_init(void) 1220module_usb_driver(rt2800usb_driver);
1221{
1222 return usb_register(&rt2800usb_driver);
1223}
1224
1225static void __exit rt2800usb_exit(void)
1226{
1227 usb_deregister(&rt2800usb_driver);
1228}
1229
1230module_init(rt2800usb_init);
1231module_exit(rt2800usb_exit);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 1c69c737086d..e477a964081d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2528,15 +2528,4 @@ static struct usb_driver rt73usb_driver = {
2528 .resume = rt2x00usb_resume, 2528 .resume = rt2x00usb_resume,
2529}; 2529};
2530 2530
2531static int __init rt73usb_init(void) 2531module_usb_driver(rt73usb_driver);
2532{
2533 return usb_register(&rt73usb_driver);
2534}
2535
2536static void __exit rt73usb_exit(void)
2537{
2538 usb_deregister(&rt73usb_driver);
2539}
2540
2541module_init(rt73usb_init);
2542module_exit(rt73usb_exit);
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 4a78f9e39dfa..638fbef693e6 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -1592,15 +1592,4 @@ static struct usb_driver rtl8187_driver = {
1592 .disconnect = __devexit_p(rtl8187_disconnect), 1592 .disconnect = __devexit_p(rtl8187_disconnect),
1593}; 1593};
1594 1594
1595static int __init rtl8187_init(void) 1595module_usb_driver(rtl8187_driver);
1596{
1597 return usb_register(&rtl8187_driver);
1598}
1599
1600static void __exit rtl8187_exit(void)
1601{
1602 usb_deregister(&rtl8187_driver);
1603}
1604
1605module_init(rtl8187_init);
1606module_exit(rtl8187_exit);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 3527c7957b45..6d2ca773bbc7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -384,15 +384,4 @@ static struct usb_driver rtl8192cu_driver = {
384#endif 384#endif
385}; 385};
386 386
387static int __init rtl8192cu_init(void) 387module_usb_driver(rtl8192cu_driver);
388{
389 return usb_register(&rtl8192cu_driver);
390}
391
392static void __exit rtl8192cu_exit(void)
393{
394 usb_deregister(&rtl8192cu_driver);
395}
396
397module_init(rtl8192cu_init);
398module_exit(rtl8192cu_exit);
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 8efa2f2d9579..a66b93b7ff9a 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -1907,15 +1907,4 @@ static struct usb_driver zd1201_usb = {
1907 .resume = zd1201_resume, 1907 .resume = zd1201_resume,
1908}; 1908};
1909 1909
1910static int __init zd1201_init(void) 1910module_usb_driver(zd1201_usb);
1911{
1912 return usb_register(&zd1201_usb);
1913}
1914
1915static void __exit zd1201_cleanup(void)
1916{
1917 usb_deregister(&zd1201_usb);
1918}
1919
1920module_init(zd1201_init);
1921module_exit(zd1201_cleanup);
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index b8b6c2abbd4a..1a1500bc8452 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1761,24 +1761,7 @@ static struct usb_driver pn533_driver = {
1761 .id_table = pn533_table, 1761 .id_table = pn533_table,
1762}; 1762};
1763 1763
1764static int __init pn533_init(void) 1764module_usb_driver(pn533_driver);
1765{
1766 int rc;
1767
1768 rc = usb_register(&pn533_driver);
1769 if (rc)
1770 err("usb_register failed. Error number %d", rc);
1771
1772 return rc;
1773}
1774
1775static void __exit pn533_exit(void)
1776{
1777 usb_deregister(&pn533_driver);
1778}
1779
1780module_init(pn533_init);
1781module_exit(pn533_exit);
1782 1765
1783MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>," 1766MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>,"
1784 " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>"); 1767 " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>");
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 811d436cd677..42a7d603c870 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -28,7 +28,6 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/sysdev.h>
32#include <linux/dmi.h> 31#include <linux/dmi.h>
33#include <linux/efi.h> 32#include <linux/efi.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
@@ -165,22 +164,22 @@ static int ibm_rtl_write(u8 value)
165 return ret; 164 return ret;
166} 165}
167 166
168static ssize_t rtl_show_version(struct sysdev_class * dev, 167static ssize_t rtl_show_version(struct device *dev,
169 struct sysdev_class_attribute *attr, 168 struct device_attribute *attr,
170 char *buf) 169 char *buf)
171{ 170{
172 return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version)); 171 return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version));
173} 172}
174 173
175static ssize_t rtl_show_state(struct sysdev_class *dev, 174static ssize_t rtl_show_state(struct device *dev,
176 struct sysdev_class_attribute *attr, 175 struct device_attribute *attr,
177 char *buf) 176 char *buf)
178{ 177{
179 return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status)); 178 return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status));
180} 179}
181 180
182static ssize_t rtl_set_state(struct sysdev_class *dev, 181static ssize_t rtl_set_state(struct device *dev,
183 struct sysdev_class_attribute *attr, 182 struct device_attribute *attr,
184 const char *buf, 183 const char *buf,
185 size_t count) 184 size_t count)
186{ 185{
@@ -205,27 +204,28 @@ static ssize_t rtl_set_state(struct sysdev_class *dev,
205 return ret; 204 return ret;
206} 205}
207 206
208static struct sysdev_class class_rtl = { 207static struct bus_type rtl_subsys = {
209 .name = "ibm_rtl", 208 .name = "ibm_rtl",
209 .dev_name = "ibm_rtl",
210}; 210};
211 211
212static SYSDEV_CLASS_ATTR(version, S_IRUGO, rtl_show_version, NULL); 212static DEVICE_ATTR(version, S_IRUGO, rtl_show_version, NULL);
213static SYSDEV_CLASS_ATTR(state, 0600, rtl_show_state, rtl_set_state); 213static DEVICE_ATTR(state, 0600, rtl_show_state, rtl_set_state);
214 214
215static struct sysdev_class_attribute *rtl_attributes[] = { 215static struct device_attribute *rtl_attributes[] = {
216 &attr_version, 216 &dev_attr_version,
217 &attr_state, 217 &dev_attr_state,
218 NULL 218 NULL
219}; 219};
220 220
221 221
222static int rtl_setup_sysfs(void) { 222static int rtl_setup_sysfs(void) {
223 int ret, i; 223 int ret, i;
224 ret = sysdev_class_register(&class_rtl);
225 224
225 ret = subsys_system_register(&rtl_subsys, NULL);
226 if (!ret) { 226 if (!ret) {
227 for (i = 0; rtl_attributes[i]; i ++) 227 for (i = 0; rtl_attributes[i]; i ++)
228 sysdev_class_create_file(&class_rtl, rtl_attributes[i]); 228 device_create_file(rtl_subsys.dev_root, rtl_attributes[i]);
229 } 229 }
230 return ret; 230 return ret;
231} 231}
@@ -233,8 +233,8 @@ static int rtl_setup_sysfs(void) {
233static void rtl_teardown_sysfs(void) { 233static void rtl_teardown_sysfs(void) {
234 int i; 234 int i;
235 for (i = 0; rtl_attributes[i]; i ++) 235 for (i = 0; rtl_attributes[i]; i ++)
236 sysdev_class_remove_file(&class_rtl, rtl_attributes[i]); 236 device_remove_file(rtl_subsys.dev_root, rtl_attributes[i]);
237 sysdev_class_unregister(&class_rtl); 237 bus_unregister(&rtl_subsys);
238} 238}
239 239
240 240
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 48870e504231..f00d0d1e0653 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -19,7 +19,7 @@
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/pm.h> 23#include <linux/pm.h>
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 98f3e4ade924..690c3338a8ae 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -36,7 +36,7 @@
36#include <linux/blkdev.h> 36#include <linux/blkdev.h>
37#include <linux/blkpg.h> 37#include <linux/blkpg.h>
38#include <linux/hdreg.h> /* HDIO_GETGEO */ 38#include <linux/hdreg.h> /* HDIO_GETGEO */
39#include <linux/sysdev.h> 39#include <linux/device.h>
40#include <linux/bio.h> 40#include <linux/bio.h>
41#include <linux/suspend.h> 41#include <linux/suspend.h>
42#include <linux/platform_device.h> 42#include <linux/platform_device.h>
diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c
index 95b909ac2b73..3c03c1060be6 100644
--- a/drivers/s390/char/sclp_config.c
+++ b/drivers/s390/char/sclp_config.c
@@ -11,7 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/cpu.h> 13#include <linux/cpu.h>
14#include <linux/sysdev.h> 14#include <linux/device.h>
15#include <linux/workqueue.h> 15#include <linux/workqueue.h>
16#include <asm/smp.h> 16#include <asm/smp.h>
17 17
@@ -31,14 +31,14 @@ static struct work_struct sclp_cpu_change_work;
31static void sclp_cpu_capability_notify(struct work_struct *work) 31static void sclp_cpu_capability_notify(struct work_struct *work)
32{ 32{
33 int cpu; 33 int cpu;
34 struct sys_device *sysdev; 34 struct device *dev;
35 35
36 s390_adjust_jiffies(); 36 s390_adjust_jiffies();
37 pr_warning("cpu capability changed.\n"); 37 pr_warning("cpu capability changed.\n");
38 get_online_cpus(); 38 get_online_cpus();
39 for_each_online_cpu(cpu) { 39 for_each_online_cpu(cpu) {
40 sysdev = get_cpu_sysdev(cpu); 40 dev = get_cpu_device(cpu);
41 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 41 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
42 } 42 }
43 put_online_cpus(); 43 put_online_cpus();
44} 44}
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
index 8b7a141ff35e..e85512dd9c72 100644
--- a/drivers/sh/intc/core.c
+++ b/drivers/sh/intc/core.c
@@ -25,7 +25,7 @@
25#include <linux/stat.h> 25#include <linux/stat.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/sh_intc.h> 27#include <linux/sh_intc.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/syscore_ops.h> 29#include <linux/syscore_ops.h>
30#include <linux/list.h> 30#include <linux/list.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
@@ -434,46 +434,47 @@ struct syscore_ops intc_syscore_ops = {
434 .resume = intc_resume, 434 .resume = intc_resume,
435}; 435};
436 436
437struct sysdev_class intc_sysdev_class = { 437struct bus_type intc_subsys = {
438 .name = "intc", 438 .name = "intc",
439 .dev_name = "intc",
439}; 440};
440 441
441static ssize_t 442static ssize_t
442show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) 443show_intc_name(struct device *dev, struct device_attribute *attr, char *buf)
443{ 444{
444 struct intc_desc_int *d; 445 struct intc_desc_int *d;
445 446
446 d = container_of(dev, struct intc_desc_int, sysdev); 447 d = container_of(dev, struct intc_desc_int, dev);
447 448
448 return sprintf(buf, "%s\n", d->chip.name); 449 return sprintf(buf, "%s\n", d->chip.name);
449} 450}
450 451
451static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); 452static DEVICE_ATTR(name, S_IRUGO, show_intc_name, NULL);
452 453
453static int __init register_intc_sysdevs(void) 454static int __init register_intc_devs(void)
454{ 455{
455 struct intc_desc_int *d; 456 struct intc_desc_int *d;
456 int error; 457 int error;
457 458
458 register_syscore_ops(&intc_syscore_ops); 459 register_syscore_ops(&intc_syscore_ops);
459 460
460 error = sysdev_class_register(&intc_sysdev_class); 461 error = subsys_system_register(&intc_subsys, NULL);
461 if (!error) { 462 if (!error) {
462 list_for_each_entry(d, &intc_list, list) { 463 list_for_each_entry(d, &intc_list, list) {
463 d->sysdev.id = d->index; 464 d->dev.id = d->index;
464 d->sysdev.cls = &intc_sysdev_class; 465 d->dev.bus = &intc_subsys;
465 error = sysdev_register(&d->sysdev); 466 error = device_register(&d->dev);
466 if (error == 0) 467 if (error == 0)
467 error = sysdev_create_file(&d->sysdev, 468 error = device_create_file(&d->dev,
468 &attr_name); 469 &dev_attr_name);
469 if (error) 470 if (error)
470 break; 471 break;
471 } 472 }
472 } 473 }
473 474
474 if (error) 475 if (error)
475 pr_err("sysdev registration error\n"); 476 pr_err("device registration error\n");
476 477
477 return error; 478 return error;
478} 479}
479device_initcall(register_intc_sysdevs); 480device_initcall(register_intc_devs);
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
index 5b934851efa8..1c2722e5af3f 100644
--- a/drivers/sh/intc/internals.h
+++ b/drivers/sh/intc/internals.h
@@ -4,7 +4,7 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/radix-tree.h> 6#include <linux/radix-tree.h>
7#include <linux/sysdev.h> 7#include <linux/device.h>
8 8
9#define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ 9#define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \
10 ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ 10 ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \
@@ -51,7 +51,7 @@ struct intc_subgroup_entry {
51 51
52struct intc_desc_int { 52struct intc_desc_int {
53 struct list_head list; 53 struct list_head list;
54 struct sys_device sysdev; 54 struct device dev;
55 struct radix_tree_root tree; 55 struct radix_tree_root tree;
56 raw_spinlock_t lock; 56 raw_spinlock_t lock;
57 unsigned int index; 57 unsigned int index;
@@ -157,7 +157,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle);
157extern struct list_head intc_list; 157extern struct list_head intc_list;
158extern raw_spinlock_t intc_big_lock; 158extern raw_spinlock_t intc_big_lock;
159extern unsigned int nr_intc_controllers; 159extern unsigned int nr_intc_controllers;
160extern struct sysdev_class intc_sysdev_class; 160extern struct bus_type intc_subsys;
161 161
162unsigned int intc_get_dfl_prio_level(void); 162unsigned int intc_get_dfl_prio_level(void);
163unsigned int intc_get_prio_level(unsigned int irq); 163unsigned int intc_get_prio_level(unsigned int irq);
diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
index 56bf9336b92b..e649ceaaa410 100644
--- a/drivers/sh/intc/userimask.c
+++ b/drivers/sh/intc/userimask.c
@@ -10,7 +10,7 @@
10#define pr_fmt(fmt) "intc: " fmt 10#define pr_fmt(fmt) "intc: " fmt
11 11
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/stat.h> 16#include <linux/stat.h>
@@ -20,15 +20,15 @@
20static void __iomem *uimask; 20static void __iomem *uimask;
21 21
22static ssize_t 22static ssize_t
23show_intc_userimask(struct sysdev_class *cls, 23show_intc_userimask(struct device *dev,
24 struct sysdev_class_attribute *attr, char *buf) 24 struct device_attribute *attr, char *buf)
25{ 25{
26 return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); 26 return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf);
27} 27}
28 28
29static ssize_t 29static ssize_t
30store_intc_userimask(struct sysdev_class *cls, 30store_intc_userimask(struct device *dev,
31 struct sysdev_class_attribute *attr, 31 struct device_attribute *attr,
32 const char *buf, size_t count) 32 const char *buf, size_t count)
33{ 33{
34 unsigned long level; 34 unsigned long level;
@@ -55,8 +55,8 @@ store_intc_userimask(struct sysdev_class *cls,
55 return count; 55 return count;
56} 56}
57 57
58static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR, 58static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR,
59 show_intc_userimask, store_intc_userimask); 59 show_intc_userimask, store_intc_userimask);
60 60
61 61
62static int __init userimask_sysdev_init(void) 62static int __init userimask_sysdev_init(void)
@@ -64,7 +64,7 @@ static int __init userimask_sysdev_init(void)
64 if (unlikely(!uimask)) 64 if (unlikely(!uimask))
65 return -ENXIO; 65 return -ENXIO;
66 66
67 return sysdev_class_create_file(&intc_sysdev_class, &attr_userimask); 67 return device_create_file(intc_subsys.dev_root, &dev_attr_userimask);
68} 68}
69late_initcall(userimask_sysdev_init); 69late_initcall(userimask_sysdev_init);
70 70
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
index 2babb034a254..d8efed657440 100644
--- a/drivers/staging/frontier/alphatrack.c
+++ b/drivers/staging/frontier/alphatrack.c
@@ -867,30 +867,4 @@ static struct usb_driver usb_alphatrack_driver = {
867 .id_table = usb_alphatrack_table, 867 .id_table = usb_alphatrack_table,
868}; 868};
869 869
870/** 870module_usb_driver(usb_alphatrack_driver);
871 * usb_alphatrack_init
872 */
873static int __init usb_alphatrack_init(void)
874{
875 int retval;
876
877 /* register this driver with the USB subsystem */
878 retval = usb_register(&usb_alphatrack_driver);
879 if (retval)
880 err("usb_register failed for the " __FILE__
881 " driver. Error number %d\n", retval);
882
883 return retval;
884}
885
886/**
887 * usb_alphatrack_exit
888 */
889static void __exit usb_alphatrack_exit(void)
890{
891 /* deregister this driver with the USB subsystem */
892 usb_deregister(&usb_alphatrack_driver);
893}
894
895module_init(usb_alphatrack_init);
896module_exit(usb_alphatrack_exit);
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c
index 8894ab14f167..c263284ddc0e 100644
--- a/drivers/staging/frontier/tranzport.c
+++ b/drivers/staging/frontier/tranzport.c
@@ -971,29 +971,4 @@ static struct usb_driver usb_tranzport_driver = {
971 .id_table = usb_tranzport_table, 971 .id_table = usb_tranzport_table,
972}; 972};
973 973
974/** 974module_usb_driver(usb_tranzport_driver);
975 * usb_tranzport_init
976 */
977static int __init usb_tranzport_init(void)
978{
979 int retval;
980
981 /* register this driver with the USB subsystem */
982 retval = usb_register(&usb_tranzport_driver);
983 if (retval)
984 err("usb_register failed for the " __FILE__
985 " driver. Error number %d\n", retval);
986 return retval;
987}
988/**
989 * usb_tranzport_exit
990 */
991
992static void __exit usb_tranzport_exit(void)
993{
994 /* deregister this driver with the USB subsystem */
995 usb_deregister(&usb_tranzport_driver);
996}
997
998module_init(usb_tranzport_init);
999module_exit(usb_tranzport_exit);
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index 79482ac1c489..84c38d5c9397 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -263,24 +263,4 @@ static struct usb_driver ft1000_usb_driver = {
263 .id_table = id_table, 263 .id_table = id_table,
264}; 264};
265 265
266static int __init usb_ft1000_init(void) 266module_usb_driver(ft1000_usb_driver);
267{
268 int ret = 0;
269
270 DEBUG("Initialize and register the driver\n");
271
272 ret = usb_register(&ft1000_usb_driver);
273 if (ret)
274 err("usb_register failed. Error number %d", ret);
275
276 return ret;
277}
278
279static void __exit usb_ft1000_exit(void)
280{
281 DEBUG("Deregister the driver\n");
282 usb_deregister(&ft1000_usb_driver);
283}
284
285module_init(usb_ft1000_init);
286module_exit(usb_ft1000_exit);
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c
index 1c5dad537844..97f747eac647 100644
--- a/drivers/staging/iio/accel/adis16201_core.c
+++ b/drivers/staging/iio/accel/adis16201_core.c
@@ -549,18 +549,7 @@ static struct spi_driver adis16201_driver = {
549 .probe = adis16201_probe, 549 .probe = adis16201_probe,
550 .remove = __devexit_p(adis16201_remove), 550 .remove = __devexit_p(adis16201_remove),
551}; 551};
552 552module_spi_driver(adis16201_driver);
553static __init int adis16201_init(void)
554{
555 return spi_register_driver(&adis16201_driver);
556}
557module_init(adis16201_init);
558
559static __exit void adis16201_exit(void)
560{
561 spi_unregister_driver(&adis16201_driver);
562}
563module_exit(adis16201_exit);
564 553
565MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 554MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
566MODULE_DESCRIPTION("Analog Devices ADIS16201 Programmable Digital Vibration Sensor driver"); 555MODULE_DESCRIPTION("Analog Devices ADIS16201 Programmable Digital Vibration Sensor driver");
diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c
index 8a3337442afd..a6d6d27f3c97 100644
--- a/drivers/staging/iio/accel/adis16203_core.c
+++ b/drivers/staging/iio/accel/adis16203_core.c
@@ -504,18 +504,7 @@ static struct spi_driver adis16203_driver = {
504 .probe = adis16203_probe, 504 .probe = adis16203_probe,
505 .remove = __devexit_p(adis16203_remove), 505 .remove = __devexit_p(adis16203_remove),
506}; 506};
507 507module_spi_driver(adis16203_driver);
508static __init int adis16203_init(void)
509{
510 return spi_register_driver(&adis16203_driver);
511}
512module_init(adis16203_init);
513
514static __exit void adis16203_exit(void)
515{
516 spi_unregister_driver(&adis16203_driver);
517}
518module_exit(adis16203_exit);
519 508
520MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 509MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
521MODULE_DESCRIPTION("Analog Devices ADIS16203 Programmable Digital Vibration Sensor driver"); 510MODULE_DESCRIPTION("Analog Devices ADIS16203 Programmable Digital Vibration Sensor driver");
diff --git a/drivers/staging/iio/accel/adis16204_core.c b/drivers/staging/iio/accel/adis16204_core.c
index 644ac8e4d2aa..7ac5b4c533d8 100644
--- a/drivers/staging/iio/accel/adis16204_core.c
+++ b/drivers/staging/iio/accel/adis16204_core.c
@@ -577,18 +577,7 @@ static struct spi_driver adis16204_driver = {
577 .probe = adis16204_probe, 577 .probe = adis16204_probe,
578 .remove = __devexit_p(adis16204_remove), 578 .remove = __devexit_p(adis16204_remove),
579}; 579};
580 580module_spi_driver(adis16204_driver);
581static __init int adis16204_init(void)
582{
583 return spi_register_driver(&adis16204_driver);
584}
585module_init(adis16204_init);
586
587static __exit void adis16204_exit(void)
588{
589 spi_unregister_driver(&adis16204_driver);
590}
591module_exit(adis16204_exit);
592 581
593MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 582MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
594MODULE_DESCRIPTION("ADIS16204 High-g Digital Impact Sensor and Recorder"); 583MODULE_DESCRIPTION("ADIS16204 High-g Digital Impact Sensor and Recorder");
diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c
index 0a8571b18b39..c03afbf5bbdc 100644
--- a/drivers/staging/iio/accel/adis16209_core.c
+++ b/drivers/staging/iio/accel/adis16209_core.c
@@ -553,18 +553,7 @@ static struct spi_driver adis16209_driver = {
553 .probe = adis16209_probe, 553 .probe = adis16209_probe,
554 .remove = __devexit_p(adis16209_remove), 554 .remove = __devexit_p(adis16209_remove),
555}; 555};
556 556module_spi_driver(adis16209_driver);
557static __init int adis16209_init(void)
558{
559 return spi_register_driver(&adis16209_driver);
560}
561module_init(adis16209_init);
562
563static __exit void adis16209_exit(void)
564{
565 spi_unregister_driver(&adis16209_driver);
566}
567module_exit(adis16209_exit);
568 557
569MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 558MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
570MODULE_DESCRIPTION("Analog Devices ADIS16209 Digital Vibration Sensor driver"); 559MODULE_DESCRIPTION("Analog Devices ADIS16209 Digital Vibration Sensor driver");
diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c
index 6d4503de192d..73298e7849e6 100644
--- a/drivers/staging/iio/accel/adis16220_core.c
+++ b/drivers/staging/iio/accel/adis16220_core.c
@@ -708,18 +708,7 @@ static struct spi_driver adis16220_driver = {
708 .probe = adis16220_probe, 708 .probe = adis16220_probe,
709 .remove = __devexit_p(adis16220_remove), 709 .remove = __devexit_p(adis16220_remove),
710}; 710};
711 711module_spi_driver(adis16220_driver);
712static __init int adis16220_init(void)
713{
714 return spi_register_driver(&adis16220_driver);
715}
716module_init(adis16220_init);
717
718static __exit void adis16220_exit(void)
719{
720 spi_unregister_driver(&adis16220_driver);
721}
722module_exit(adis16220_exit);
723 712
724MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 713MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
725MODULE_DESCRIPTION("Analog Devices ADIS16220 Digital Vibration Sensor"); 714MODULE_DESCRIPTION("Analog Devices ADIS16220 Digital Vibration Sensor");
diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c
index b8be2925d61c..88881b9919ef 100644
--- a/drivers/staging/iio/accel/adis16240_core.c
+++ b/drivers/staging/iio/accel/adis16240_core.c
@@ -606,18 +606,7 @@ static struct spi_driver adis16240_driver = {
606 .probe = adis16240_probe, 606 .probe = adis16240_probe,
607 .remove = __devexit_p(adis16240_remove), 607 .remove = __devexit_p(adis16240_remove),
608}; 608};
609 609module_spi_driver(adis16240_driver);
610static __init int adis16240_init(void)
611{
612 return spi_register_driver(&adis16240_driver);
613}
614module_init(adis16240_init);
615
616static __exit void adis16240_exit(void)
617{
618 spi_unregister_driver(&adis16240_driver);
619}
620module_exit(adis16240_exit);
621 610
622MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 611MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
623MODULE_DESCRIPTION("Analog Devices Programmable Impact Sensor and Recorder"); 612MODULE_DESCRIPTION("Analog Devices Programmable Impact Sensor and Recorder");
diff --git a/drivers/staging/iio/accel/kxsd9.c b/drivers/staging/iio/accel/kxsd9.c
index 5238503f6805..cfce21c2eddc 100644
--- a/drivers/staging/iio/accel/kxsd9.c
+++ b/drivers/staging/iio/accel/kxsd9.c
@@ -280,18 +280,7 @@ static struct spi_driver kxsd9_driver = {
280 .remove = __devexit_p(kxsd9_remove), 280 .remove = __devexit_p(kxsd9_remove),
281 .id_table = kxsd9_id, 281 .id_table = kxsd9_id,
282}; 282};
283 283module_spi_driver(kxsd9_driver);
284static __init int kxsd9_spi_init(void)
285{
286 return spi_register_driver(&kxsd9_driver);
287}
288module_init(kxsd9_spi_init);
289
290static __exit void kxsd9_spi_exit(void)
291{
292 spi_unregister_driver(&kxsd9_driver);
293}
294module_exit(kxsd9_spi_exit);
295 284
296MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); 285MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>");
297MODULE_DESCRIPTION("Kionix KXSD9 SPI driver"); 286MODULE_DESCRIPTION("Kionix KXSD9 SPI driver");
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index 559545a42333..6877521ec173 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -804,18 +804,7 @@ static struct spi_driver lis3l02dq_driver = {
804 .probe = lis3l02dq_probe, 804 .probe = lis3l02dq_probe,
805 .remove = __devexit_p(lis3l02dq_remove), 805 .remove = __devexit_p(lis3l02dq_remove),
806}; 806};
807 807module_spi_driver(lis3l02dq_driver);
808static __init int lis3l02dq_init(void)
809{
810 return spi_register_driver(&lis3l02dq_driver);
811}
812module_init(lis3l02dq_init);
813
814static __exit void lis3l02dq_exit(void)
815{
816 spi_unregister_driver(&lis3l02dq_driver);
817}
818module_exit(lis3l02dq_exit);
819 808
820MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); 809MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>");
821MODULE_DESCRIPTION("ST LIS3L02DQ Accelerometer SPI driver"); 810MODULE_DESCRIPTION("ST LIS3L02DQ Accelerometer SPI driver");
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index a44a70589db9..6c359074a06d 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -1250,18 +1250,7 @@ static struct spi_driver sca3000_driver = {
1250 .remove = __devexit_p(sca3000_remove), 1250 .remove = __devexit_p(sca3000_remove),
1251 .id_table = sca3000_id, 1251 .id_table = sca3000_id,
1252}; 1252};
1253 1253module_spi_driver(sca3000_driver);
1254static __init int sca3000_init(void)
1255{
1256 return spi_register_driver(&sca3000_driver);
1257}
1258module_init(sca3000_init);
1259
1260static __exit void sca3000_exit(void)
1261{
1262 spi_unregister_driver(&sca3000_driver);
1263}
1264module_exit(sca3000_exit);
1265 1254
1266MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); 1255MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>");
1267MODULE_DESCRIPTION("VTI SCA3000 Series Accelerometers SPI driver"); 1256MODULE_DESCRIPTION("VTI SCA3000 Series Accelerometers SPI driver");
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 31c376b9d5eb..a6a4a4e1f183 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -1161,18 +1161,7 @@ static struct spi_driver ad7192_driver = {
1161 .remove = __devexit_p(ad7192_remove), 1161 .remove = __devexit_p(ad7192_remove),
1162 .id_table = ad7192_id, 1162 .id_table = ad7192_id,
1163}; 1163};
1164 1164module_spi_driver(ad7192_driver);
1165static int __init ad7192_init(void)
1166{
1167 return spi_register_driver(&ad7192_driver);
1168}
1169module_init(ad7192_init);
1170
1171static void __exit ad7192_exit(void)
1172{
1173 spi_unregister_driver(&ad7192_driver);
1174}
1175module_exit(ad7192_exit);
1176 1165
1177MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 1166MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
1178MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7195 ADC"); 1167MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7195 ADC");
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 372d059042f9..dbaeae81e873 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -979,18 +979,7 @@ static struct spi_driver ad7280_driver = {
979 .remove = __devexit_p(ad7280_remove), 979 .remove = __devexit_p(ad7280_remove),
980 .id_table = ad7280_id, 980 .id_table = ad7280_id,
981}; 981};
982 982module_spi_driver(ad7280_driver);
983static int __init ad7280_init(void)
984{
985 return spi_register_driver(&ad7280_driver);
986}
987module_init(ad7280_init);
988
989static void __exit ad7280_exit(void)
990{
991 spi_unregister_driver(&ad7280_driver);
992}
993module_exit(ad7280_exit);
994 983
995MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 984MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
996MODULE_DESCRIPTION("Analog Devices AD7280A"); 985MODULE_DESCRIPTION("Analog Devices AD7280A");
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c
index 10e79e8ee64d..aa44a52a7adb 100644
--- a/drivers/staging/iio/adc/ad7291.c
+++ b/drivers/staging/iio/adc/ad7291.c
@@ -700,20 +700,8 @@ static struct i2c_driver ad7291_driver = {
700 .remove = __devexit_p(ad7291_remove), 700 .remove = __devexit_p(ad7291_remove),
701 .id_table = ad7291_id, 701 .id_table = ad7291_id,
702}; 702};
703 703module_i2c_driver(ad7291_driver);
704static __init int ad7291_init(void)
705{
706 return i2c_add_driver(&ad7291_driver);
707}
708
709static __exit void ad7291_exit(void)
710{
711 i2c_del_driver(&ad7291_driver);
712}
713 704
714MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 705MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
715MODULE_DESCRIPTION("Analog Devices AD7291 ADC driver"); 706MODULE_DESCRIPTION("Analog Devices AD7291 ADC driver");
716MODULE_LICENSE("GPL v2"); 707MODULE_LICENSE("GPL v2");
717
718module_init(ad7291_init);
719module_exit(ad7291_exit);
diff --git a/drivers/staging/iio/adc/ad7298_core.c b/drivers/staging/iio/adc/ad7298_core.c
index c1de73a1ca91..a799bd1922dc 100644
--- a/drivers/staging/iio/adc/ad7298_core.c
+++ b/drivers/staging/iio/adc/ad7298_core.c
@@ -276,18 +276,7 @@ static struct spi_driver ad7298_driver = {
276 .remove = __devexit_p(ad7298_remove), 276 .remove = __devexit_p(ad7298_remove),
277 .id_table = ad7298_id, 277 .id_table = ad7298_id,
278}; 278};
279 279module_spi_driver(ad7298_driver);
280static int __init ad7298_init(void)
281{
282 return spi_register_driver(&ad7298_driver);
283}
284module_init(ad7298_init);
285
286static void __exit ad7298_exit(void)
287{
288 spi_unregister_driver(&ad7298_driver);
289}
290module_exit(ad7298_exit);
291 280
292MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 281MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
293MODULE_DESCRIPTION("Analog Devices AD7298 ADC"); 282MODULE_DESCRIPTION("Analog Devices AD7298 ADC");
diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c
index fd79facc6cae..0b5852030ab6 100644
--- a/drivers/staging/iio/adc/ad7476_core.c
+++ b/drivers/staging/iio/adc/ad7476_core.c
@@ -248,18 +248,7 @@ static struct spi_driver ad7476_driver = {
248 .remove = __devexit_p(ad7476_remove), 248 .remove = __devexit_p(ad7476_remove),
249 .id_table = ad7476_id, 249 .id_table = ad7476_id,
250}; 250};
251 251module_spi_driver(ad7476_driver);
252static int __init ad7476_init(void)
253{
254 return spi_register_driver(&ad7476_driver);
255}
256module_init(ad7476_init);
257
258static void __exit ad7476_exit(void)
259{
260 spi_unregister_driver(&ad7476_driver);
261}
262module_exit(ad7476_exit);
263 252
264MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 253MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
265MODULE_DESCRIPTION("Analog Devices AD7475/6/7/8(A) AD7466/7/8 ADC"); 254MODULE_DESCRIPTION("Analog Devices AD7475/6/7/8(A) AD7466/7/8 ADC");
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
index aede1ba5e041..b984bd2048b6 100644
--- a/drivers/staging/iio/adc/ad7606_spi.c
+++ b/drivers/staging/iio/adc/ad7606_spi.c
@@ -109,18 +109,7 @@ static struct spi_driver ad7606_driver = {
109 .remove = __devexit_p(ad7606_spi_remove), 109 .remove = __devexit_p(ad7606_spi_remove),
110 .id_table = ad7606_id, 110 .id_table = ad7606_id,
111}; 111};
112 112module_spi_driver(ad7606_driver);
113static int __init ad7606_spi_init(void)
114{
115 return spi_register_driver(&ad7606_driver);
116}
117module_init(ad7606_spi_init);
118
119static void __exit ad7606_spi_exit(void)
120{
121 spi_unregister_driver(&ad7606_driver);
122}
123module_exit(ad7606_spi_exit);
124 113
125MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 114MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
126MODULE_DESCRIPTION("Analog Devices AD7606 ADC"); 115MODULE_DESCRIPTION("Analog Devices AD7606 ADC");
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index 7a579a1fd696..ec90261cbc3c 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -283,18 +283,7 @@ static struct spi_driver ad7780_driver = {
283 .remove = __devexit_p(ad7780_remove), 283 .remove = __devexit_p(ad7780_remove),
284 .id_table = ad7780_id, 284 .id_table = ad7780_id,
285}; 285};
286 286module_spi_driver(ad7780_driver);
287static int __init ad7780_init(void)
288{
289 return spi_register_driver(&ad7780_driver);
290}
291module_init(ad7780_init);
292
293static void __exit ad7780_exit(void)
294{
295 spi_unregister_driver(&ad7780_driver);
296}
297module_exit(ad7780_exit);
298 287
299MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 288MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
300MODULE_DESCRIPTION("Analog Devices AD7780/1 ADC"); 289MODULE_DESCRIPTION("Analog Devices AD7780/1 ADC");
diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c
index 999f8f746cff..1c5588e88cdf 100644
--- a/drivers/staging/iio/adc/ad7793.c
+++ b/drivers/staging/iio/adc/ad7793.c
@@ -1045,18 +1045,7 @@ static struct spi_driver ad7793_driver = {
1045 .remove = __devexit_p(ad7793_remove), 1045 .remove = __devexit_p(ad7793_remove),
1046 .id_table = ad7793_id, 1046 .id_table = ad7793_id,
1047}; 1047};
1048 1048module_spi_driver(ad7793_driver);
1049static int __init ad7793_init(void)
1050{
1051 return spi_register_driver(&ad7793_driver);
1052}
1053module_init(ad7793_init);
1054
1055static void __exit ad7793_exit(void)
1056{
1057 spi_unregister_driver(&ad7793_driver);
1058}
1059module_exit(ad7793_exit);
1060 1049
1061MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 1050MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
1062MODULE_DESCRIPTION("Analog Devices AD7792/3 ADC"); 1051MODULE_DESCRIPTION("Analog Devices AD7792/3 ADC");
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index bdb90492b8a5..acbf9363132b 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -466,21 +466,9 @@ static struct spi_driver ad7816_driver = {
466 .remove = __devexit_p(ad7816_remove), 466 .remove = __devexit_p(ad7816_remove),
467 .id_table = ad7816_id, 467 .id_table = ad7816_id,
468}; 468};
469 469module_spi_driver(ad7816_driver);
470static __init int ad7816_init(void)
471{
472 return spi_register_driver(&ad7816_driver);
473}
474
475static __exit void ad7816_exit(void)
476{
477 spi_unregister_driver(&ad7816_driver);
478}
479 470
480MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 471MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
481MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital" 472MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital"
482 " temperature sensor driver"); 473 " temperature sensor driver");
483MODULE_LICENSE("GPL v2"); 474MODULE_LICENSE("GPL v2");
484
485module_init(ad7816_init);
486module_exit(ad7816_exit);
diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c
index 609dcd5f2ddc..91b8fb09d92b 100644
--- a/drivers/staging/iio/adc/ad7887_core.c
+++ b/drivers/staging/iio/adc/ad7887_core.c
@@ -257,18 +257,7 @@ static struct spi_driver ad7887_driver = {
257 .remove = __devexit_p(ad7887_remove), 257 .remove = __devexit_p(ad7887_remove),
258 .id_table = ad7887_id, 258 .id_table = ad7887_id,
259}; 259};
260 260module_spi_driver(ad7887_driver);
261static int __init ad7887_init(void)
262{
263 return spi_register_driver(&ad7887_driver);
264}
265module_init(ad7887_init);
266
267static void __exit ad7887_exit(void)
268{
269 spi_unregister_driver(&ad7887_driver);
270}
271module_exit(ad7887_exit);
272 261
273MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 262MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
274MODULE_DESCRIPTION("Analog Devices AD7887 ADC"); 263MODULE_DESCRIPTION("Analog Devices AD7887 ADC");
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index ee6cd792bec8..c0d2f886ea2c 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -929,21 +929,9 @@ static struct i2c_driver ad799x_driver = {
929 .remove = __devexit_p(ad799x_remove), 929 .remove = __devexit_p(ad799x_remove),
930 .id_table = ad799x_id, 930 .id_table = ad799x_id,
931}; 931};
932 932module_i2c_driver(ad799x_driver);
933static __init int ad799x_init(void)
934{
935 return i2c_add_driver(&ad799x_driver);
936}
937
938static __exit void ad799x_exit(void)
939{
940 i2c_del_driver(&ad799x_driver);
941}
942 933
943MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 934MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
944MODULE_DESCRIPTION("Analog Devices AD799x ADC"); 935MODULE_DESCRIPTION("Analog Devices AD799x ADC");
945MODULE_LICENSE("GPL v2"); 936MODULE_LICENSE("GPL v2");
946MODULE_ALIAS("i2c:ad799x"); 937MODULE_ALIAS("i2c:ad799x");
947
948module_init(ad799x_init);
949module_exit(ad799x_exit);
diff --git a/drivers/staging/iio/adc/adt7310.c b/drivers/staging/iio/adc/adt7310.c
index c9e0be3b1cf3..bc307f3b024e 100644
--- a/drivers/staging/iio/adc/adt7310.c
+++ b/drivers/staging/iio/adc/adt7310.c
@@ -884,21 +884,9 @@ static struct spi_driver adt7310_driver = {
884 .remove = __devexit_p(adt7310_remove), 884 .remove = __devexit_p(adt7310_remove),
885 .id_table = adt7310_id, 885 .id_table = adt7310_id,
886}; 886};
887 887module_spi_driver(adt7310_driver);
888static __init int adt7310_init(void)
889{
890 return spi_register_driver(&adt7310_driver);
891}
892
893static __exit void adt7310_exit(void)
894{
895 spi_unregister_driver(&adt7310_driver);
896}
897 888
898MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 889MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
899MODULE_DESCRIPTION("Analog Devices ADT7310 digital" 890MODULE_DESCRIPTION("Analog Devices ADT7310 digital"
900 " temperature sensor driver"); 891 " temperature sensor driver");
901MODULE_LICENSE("GPL v2"); 892MODULE_LICENSE("GPL v2");
902
903module_init(adt7310_init);
904module_exit(adt7310_exit);
diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
index a289e429dc41..3481cf6f7574 100644
--- a/drivers/staging/iio/adc/adt7410.c
+++ b/drivers/staging/iio/adc/adt7410.c
@@ -844,21 +844,9 @@ static struct i2c_driver adt7410_driver = {
844 .remove = __devexit_p(adt7410_remove), 844 .remove = __devexit_p(adt7410_remove),
845 .id_table = adt7410_id, 845 .id_table = adt7410_id,
846}; 846};
847 847module_i2c_driver(adt7410_driver);
848static __init int adt7410_init(void)
849{
850 return i2c_add_driver(&adt7410_driver);
851}
852
853static __exit void adt7410_exit(void)
854{
855 i2c_del_driver(&adt7410_driver);
856}
857 848
858MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 849MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
859MODULE_DESCRIPTION("Analog Devices ADT7410 digital" 850MODULE_DESCRIPTION("Analog Devices ADT7410 digital"
860 " temperature sensor driver"); 851 " temperature sensor driver");
861MODULE_LICENSE("GPL v2"); 852MODULE_LICENSE("GPL v2");
862
863module_init(adt7410_init);
864module_exit(adt7410_exit);
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index eb699ade34b0..3f28f1ab52a2 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -1410,20 +1410,8 @@ static struct i2c_driver max1363_driver = {
1410 .remove = max1363_remove, 1410 .remove = max1363_remove,
1411 .id_table = max1363_id, 1411 .id_table = max1363_id,
1412}; 1412};
1413 1413module_i2c_driver(max1363_driver);
1414static __init int max1363_init(void)
1415{
1416 return i2c_add_driver(&max1363_driver);
1417}
1418
1419static __exit void max1363_exit(void)
1420{
1421 i2c_del_driver(&max1363_driver);
1422}
1423 1414
1424MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); 1415MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>");
1425MODULE_DESCRIPTION("Maxim 1363 ADC"); 1416MODULE_DESCRIPTION("Maxim 1363 ADC");
1426MODULE_LICENSE("GPL v2"); 1417MODULE_LICENSE("GPL v2");
1427
1428module_init(max1363_init);
1429module_exit(max1363_exit);
diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c
index 07d718e8fb4d..2c03a39220e8 100644
--- a/drivers/staging/iio/addac/adt7316-i2c.c
+++ b/drivers/staging/iio/addac/adt7316-i2c.c
@@ -151,21 +151,9 @@ static struct i2c_driver adt7316_driver = {
151 .resume = adt7316_i2c_resume, 151 .resume = adt7316_i2c_resume,
152 .id_table = adt7316_i2c_id, 152 .id_table = adt7316_i2c_id,
153}; 153};
154 154module_i2c_driver(adt7316_driver);
155static __init int adt7316_i2c_init(void)
156{
157 return i2c_add_driver(&adt7316_driver);
158}
159
160static __exit void adt7316_i2c_exit(void)
161{
162 i2c_del_driver(&adt7316_driver);
163}
164 155
165MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 156MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
166MODULE_DESCRIPTION("I2C bus driver for Analog Devices ADT7316/7/9 and" 157MODULE_DESCRIPTION("I2C bus driver for Analog Devices ADT7316/7/9 and"
167 "ADT7516/7/8 digital temperature sensor, ADC and DAC"); 158 "ADT7516/7/8 digital temperature sensor, ADC and DAC");
168MODULE_LICENSE("GPL v2"); 159MODULE_LICENSE("GPL v2");
169
170module_init(adt7316_i2c_init);
171module_exit(adt7316_i2c_exit);
diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c
index 369d4d01ed97..1e93c7b7aed9 100644
--- a/drivers/staging/iio/addac/adt7316-spi.c
+++ b/drivers/staging/iio/addac/adt7316-spi.c
@@ -160,21 +160,9 @@ static struct spi_driver adt7316_driver = {
160 .resume = adt7316_spi_resume, 160 .resume = adt7316_spi_resume,
161 .id_table = adt7316_spi_id, 161 .id_table = adt7316_spi_id,
162}; 162};
163 163module_spi_driver(adt7316_driver);
164static __init int adt7316_spi_init(void)
165{
166 return spi_register_driver(&adt7316_driver);
167}
168
169static __exit void adt7316_spi_exit(void)
170{
171 spi_unregister_driver(&adt7316_driver);
172}
173 164
174MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); 165MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
175MODULE_DESCRIPTION("SPI bus driver for Analog Devices ADT7316/7/8 and" 166MODULE_DESCRIPTION("SPI bus driver for Analog Devices ADT7316/7/8 and"
176 "ADT7516/7/9 digital temperature sensor, ADC and DAC"); 167 "ADT7516/7/9 digital temperature sensor, ADC and DAC");
177MODULE_LICENSE("GPL v2"); 168MODULE_LICENSE("GPL v2");
178
179module_init(adt7316_spi_init);
180module_exit(adt7316_spi_exit);
diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
index a761ca94a17e..47181875e113 100644
--- a/drivers/staging/iio/cdc/ad7150.c
+++ b/drivers/staging/iio/cdc/ad7150.c
@@ -657,20 +657,8 @@ static struct i2c_driver ad7150_driver = {
657 .remove = __devexit_p(ad7150_remove), 657 .remove = __devexit_p(ad7150_remove),
658 .id_table = ad7150_id, 658 .id_table = ad7150_id,
659}; 659};
660 660module_i2c_driver(ad7150_driver);
661static __init int ad7150_init(void)
662{
663 return i2c_add_driver(&ad7150_driver);
664}
665
666static __exit void ad7150_exit(void)
667{
668 i2c_del_driver(&ad7150_driver);
669}
670 661
671MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 662MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
672MODULE_DESCRIPTION("Analog Devices AD7150/1/6 capacitive sensor driver"); 663MODULE_DESCRIPTION("Analog Devices AD7150/1/6 capacitive sensor driver");
673MODULE_LICENSE("GPL v2"); 664MODULE_LICENSE("GPL v2");
674
675module_init(ad7150_init);
676module_exit(ad7150_exit);
diff --git a/drivers/staging/iio/cdc/ad7152.c b/drivers/staging/iio/cdc/ad7152.c
index 662584d72a74..152d3be6d97d 100644
--- a/drivers/staging/iio/cdc/ad7152.c
+++ b/drivers/staging/iio/cdc/ad7152.c
@@ -540,20 +540,8 @@ static struct i2c_driver ad7152_driver = {
540 .remove = __devexit_p(ad7152_remove), 540 .remove = __devexit_p(ad7152_remove),
541 .id_table = ad7152_id, 541 .id_table = ad7152_id,
542}; 542};
543 543module_i2c_driver(ad7152_driver);
544static __init int ad7152_init(void)
545{
546 return i2c_add_driver(&ad7152_driver);
547}
548
549static __exit void ad7152_exit(void)
550{
551 i2c_del_driver(&ad7152_driver);
552}
553 544
554MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 545MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
555MODULE_DESCRIPTION("Analog Devices AD7152/3 capacitive sensor driver"); 546MODULE_DESCRIPTION("Analog Devices AD7152/3 capacitive sensor driver");
556MODULE_LICENSE("GPL v2"); 547MODULE_LICENSE("GPL v2");
557
558module_init(ad7152_init);
559module_exit(ad7152_exit);
diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
index 2867943309cc..9df590891a69 100644
--- a/drivers/staging/iio/cdc/ad7746.c
+++ b/drivers/staging/iio/cdc/ad7746.c
@@ -788,20 +788,8 @@ static struct i2c_driver ad7746_driver = {
788 .remove = __devexit_p(ad7746_remove), 788 .remove = __devexit_p(ad7746_remove),
789 .id_table = ad7746_id, 789 .id_table = ad7746_id,
790}; 790};
791 791module_i2c_driver(ad7746_driver);
792static __init int ad7746_init(void)
793{
794 return i2c_add_driver(&ad7746_driver);
795}
796
797static __exit void ad7746_exit(void)
798{
799 i2c_del_driver(&ad7746_driver);
800}
801 792
802MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 793MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
803MODULE_DESCRIPTION("Analog Devices AD7746/5/7 capacitive sensor driver"); 794MODULE_DESCRIPTION("Analog Devices AD7746/5/7 capacitive sensor driver");
804MODULE_LICENSE("GPL v2"); 795MODULE_LICENSE("GPL v2");
805
806module_init(ad7746_init);
807module_exit(ad7746_exit);
diff --git a/drivers/staging/iio/dac/ad5064.c b/drivers/staging/iio/dac/ad5064.c
index 24279f2ae41f..39cfe6cb02a2 100644
--- a/drivers/staging/iio/dac/ad5064.c
+++ b/drivers/staging/iio/dac/ad5064.c
@@ -445,18 +445,7 @@ static struct spi_driver ad5064_driver = {
445 .remove = __devexit_p(ad5064_remove), 445 .remove = __devexit_p(ad5064_remove),
446 .id_table = ad5064_id, 446 .id_table = ad5064_id,
447}; 447};
448 448module_spi_driver(ad5064_driver);
449static __init int ad5064_spi_init(void)
450{
451 return spi_register_driver(&ad5064_driver);
452}
453module_init(ad5064_spi_init);
454
455static __exit void ad5064_spi_exit(void)
456{
457 spi_unregister_driver(&ad5064_driver);
458}
459module_exit(ad5064_spi_exit);
460 449
461MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 450MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
462MODULE_DESCRIPTION("Analog Devices AD5064/64-1/44/24 DAC"); 451MODULE_DESCRIPTION("Analog Devices AD5064/64-1/44/24 DAC");
diff --git a/drivers/staging/iio/dac/ad5360.c b/drivers/staging/iio/dac/ad5360.c
index 72d0f3f0d6ae..bc0459e32d04 100644
--- a/drivers/staging/iio/dac/ad5360.c
+++ b/drivers/staging/iio/dac/ad5360.c
@@ -563,18 +563,7 @@ static struct spi_driver ad5360_driver = {
563 .remove = __devexit_p(ad5360_remove), 563 .remove = __devexit_p(ad5360_remove),
564 .id_table = ad5360_ids, 564 .id_table = ad5360_ids,
565}; 565};
566 566module_spi_driver(ad5360_driver);
567static __init int ad5360_spi_init(void)
568{
569 return spi_register_driver(&ad5360_driver);
570}
571module_init(ad5360_spi_init);
572
573static __exit void ad5360_spi_exit(void)
574{
575 spi_unregister_driver(&ad5360_driver);
576}
577module_exit(ad5360_spi_exit);
578 567
579MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 568MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
580MODULE_DESCRIPTION("Analog Devices AD5360/61/62/63/70/71/72/73 DAC"); 569MODULE_DESCRIPTION("Analog Devices AD5360/61/62/63/70/71/72/73 DAC");
diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c
index e1c204d51d8c..ac3bc5f52dcc 100644
--- a/drivers/staging/iio/dac/ad5446.c
+++ b/drivers/staging/iio/dac/ad5446.c
@@ -465,18 +465,7 @@ static struct spi_driver ad5446_driver = {
465 .remove = __devexit_p(ad5446_remove), 465 .remove = __devexit_p(ad5446_remove),
466 .id_table = ad5446_id, 466 .id_table = ad5446_id,
467}; 467};
468 468module_spi_driver(ad5446_driver);
469static int __init ad5446_init(void)
470{
471 return spi_register_driver(&ad5446_driver);
472}
473module_init(ad5446_init);
474
475static void __exit ad5446_exit(void)
476{
477 spi_unregister_driver(&ad5446_driver);
478}
479module_exit(ad5446_exit);
480 469
481MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 470MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
482MODULE_DESCRIPTION("Analog Devices AD5444/AD5446 DAC"); 471MODULE_DESCRIPTION("Analog Devices AD5444/AD5446 DAC");
diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c
index 60dd6404d689..57539ce8e6cf 100644
--- a/drivers/staging/iio/dac/ad5504.c
+++ b/drivers/staging/iio/dac/ad5504.c
@@ -377,18 +377,7 @@ static struct spi_driver ad5504_driver = {
377 .remove = __devexit_p(ad5504_remove), 377 .remove = __devexit_p(ad5504_remove),
378 .id_table = ad5504_id, 378 .id_table = ad5504_id,
379}; 379};
380 380module_spi_driver(ad5504_driver);
381static __init int ad5504_spi_init(void)
382{
383 return spi_register_driver(&ad5504_driver);
384}
385module_init(ad5504_spi_init);
386
387static __exit void ad5504_spi_exit(void)
388{
389 spi_unregister_driver(&ad5504_driver);
390}
391module_exit(ad5504_spi_exit);
392 381
393MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 382MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
394MODULE_DESCRIPTION("Analog Devices AD5501/AD5501 DAC"); 383MODULE_DESCRIPTION("Analog Devices AD5501/AD5501 DAC");
diff --git a/drivers/staging/iio/dac/ad5624r_spi.c b/drivers/staging/iio/dac/ad5624r_spi.c
index 284d87900362..6e05f0dbae0b 100644
--- a/drivers/staging/iio/dac/ad5624r_spi.c
+++ b/drivers/staging/iio/dac/ad5624r_spi.c
@@ -317,18 +317,7 @@ static struct spi_driver ad5624r_driver = {
317 .remove = __devexit_p(ad5624r_remove), 317 .remove = __devexit_p(ad5624r_remove),
318 .id_table = ad5624r_id, 318 .id_table = ad5624r_id,
319}; 319};
320 320module_spi_driver(ad5624r_driver);
321static __init int ad5624r_spi_init(void)
322{
323 return spi_register_driver(&ad5624r_driver);
324}
325module_init(ad5624r_spi_init);
326
327static __exit void ad5624r_spi_exit(void)
328{
329 spi_unregister_driver(&ad5624r_driver);
330}
331module_exit(ad5624r_spi_exit);
332 321
333MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 322MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
334MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver"); 323MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver");
diff --git a/drivers/staging/iio/dac/ad5686.c b/drivers/staging/iio/dac/ad5686.c
index 974c6f5b60c4..e72db2fbfedf 100644
--- a/drivers/staging/iio/dac/ad5686.c
+++ b/drivers/staging/iio/dac/ad5686.c
@@ -447,18 +447,7 @@ static struct spi_driver ad5686_driver = {
447 .remove = __devexit_p(ad5686_remove), 447 .remove = __devexit_p(ad5686_remove),
448 .id_table = ad5686_id, 448 .id_table = ad5686_id,
449}; 449};
450 450module_spi_driver(ad5686_driver);
451static __init int ad5686_spi_init(void)
452{
453 return spi_register_driver(&ad5686_driver);
454}
455module_init(ad5686_spi_init);
456
457static __exit void ad5686_spi_exit(void)
458{
459 spi_unregister_driver(&ad5686_driver);
460}
461module_exit(ad5686_spi_exit);
462 451
463MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 452MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
464MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC"); 453MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC");
diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c
index 6fbca8d96153..4a80fd822231 100644
--- a/drivers/staging/iio/dac/ad5791.c
+++ b/drivers/staging/iio/dac/ad5791.c
@@ -410,18 +410,7 @@ static struct spi_driver ad5791_driver = {
410 .remove = __devexit_p(ad5791_remove), 410 .remove = __devexit_p(ad5791_remove),
411 .id_table = ad5791_id, 411 .id_table = ad5791_id,
412}; 412};
413 413module_spi_driver(ad5791_driver);
414static __init int ad5791_spi_init(void)
415{
416 return spi_register_driver(&ad5791_driver);
417}
418module_init(ad5791_spi_init);
419
420static __exit void ad5791_spi_exit(void)
421{
422 spi_unregister_driver(&ad5791_driver);
423}
424module_exit(ad5791_spi_exit);
425 414
426MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 415MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
427MODULE_DESCRIPTION("Analog Devices AD5760/AD5780/AD5781/AD5791 DAC"); 416MODULE_DESCRIPTION("Analog Devices AD5760/AD5780/AD5781/AD5791 DAC");
diff --git a/drivers/staging/iio/dac/max517.c b/drivers/staging/iio/dac/max517.c
index adfbd20f8988..a4df6d7443c1 100644
--- a/drivers/staging/iio/dac/max517.c
+++ b/drivers/staging/iio/dac/max517.c
@@ -280,20 +280,8 @@ static struct i2c_driver max517_driver = {
280 .resume = max517_resume, 280 .resume = max517_resume,
281 .id_table = max517_id, 281 .id_table = max517_id,
282}; 282};
283 283module_i2c_driver(max517_driver);
284static int __init max517_init(void)
285{
286 return i2c_add_driver(&max517_driver);
287}
288
289static void __exit max517_exit(void)
290{
291 i2c_del_driver(&max517_driver);
292}
293 284
294MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>"); 285MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>");
295MODULE_DESCRIPTION("MAX517/MAX518/MAX519 8-bit DAC"); 286MODULE_DESCRIPTION("MAX517/MAX518/MAX519 8-bit DAC");
296MODULE_LICENSE("GPL"); 287MODULE_LICENSE("GPL");
297
298module_init(max517_init);
299module_exit(max517_exit);
diff --git a/drivers/staging/iio/dds/ad5930.c b/drivers/staging/iio/dds/ad5930.c
index f5e368b56650..4a360d044a36 100644
--- a/drivers/staging/iio/dds/ad5930.c
+++ b/drivers/staging/iio/dds/ad5930.c
@@ -143,18 +143,7 @@ static struct spi_driver ad5930_driver = {
143 .probe = ad5930_probe, 143 .probe = ad5930_probe,
144 .remove = __devexit_p(ad5930_remove), 144 .remove = __devexit_p(ad5930_remove),
145}; 145};
146 146module_spi_driver(ad5930_driver);
147static __init int ad5930_spi_init(void)
148{
149 return spi_register_driver(&ad5930_driver);
150}
151module_init(ad5930_spi_init);
152
153static __exit void ad5930_spi_exit(void)
154{
155 spi_unregister_driver(&ad5930_driver);
156}
157module_exit(ad5930_spi_exit);
158 147
159MODULE_AUTHOR("Cliff Cai"); 148MODULE_AUTHOR("Cliff Cai");
160MODULE_DESCRIPTION("Analog Devices ad5930 driver"); 149MODULE_DESCRIPTION("Analog Devices ad5930 driver");
diff --git a/drivers/staging/iio/dds/ad9832.c b/drivers/staging/iio/dds/ad9832.c
index 9b4ff6065359..cc32fd65b8b3 100644
--- a/drivers/staging/iio/dds/ad9832.c
+++ b/drivers/staging/iio/dds/ad9832.c
@@ -355,18 +355,7 @@ static struct spi_driver ad9832_driver = {
355 .remove = __devexit_p(ad9832_remove), 355 .remove = __devexit_p(ad9832_remove),
356 .id_table = ad9832_id, 356 .id_table = ad9832_id,
357}; 357};
358 358module_spi_driver(ad9832_driver);
359static int __init ad9832_init(void)
360{
361 return spi_register_driver(&ad9832_driver);
362}
363module_init(ad9832_init);
364
365static void __exit ad9832_exit(void)
366{
367 spi_unregister_driver(&ad9832_driver);
368}
369module_exit(ad9832_exit);
370 359
371MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 360MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
372MODULE_DESCRIPTION("Analog Devices AD9832/AD9835 DDS"); 361MODULE_DESCRIPTION("Analog Devices AD9832/AD9835 DDS");
diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c
index c468f696fe25..2b31e3524826 100644
--- a/drivers/staging/iio/dds/ad9834.c
+++ b/drivers/staging/iio/dds/ad9834.c
@@ -446,18 +446,7 @@ static struct spi_driver ad9834_driver = {
446 .remove = __devexit_p(ad9834_remove), 446 .remove = __devexit_p(ad9834_remove),
447 .id_table = ad9834_id, 447 .id_table = ad9834_id,
448}; 448};
449 449module_spi_driver(ad9834_driver);
450static int __init ad9834_init(void)
451{
452 return spi_register_driver(&ad9834_driver);
453}
454module_init(ad9834_init);
455
456static void __exit ad9834_exit(void)
457{
458 spi_unregister_driver(&ad9834_driver);
459}
460module_exit(ad9834_exit);
461 450
462MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 451MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
463MODULE_DESCRIPTION("Analog Devices AD9833/AD9834/AD9837/AD9838 DDS"); 452MODULE_DESCRIPTION("Analog Devices AD9833/AD9834/AD9837/AD9838 DDS");
diff --git a/drivers/staging/iio/dds/ad9850.c b/drivers/staging/iio/dds/ad9850.c
index a14771b24c50..f9c96afcb996 100644
--- a/drivers/staging/iio/dds/ad9850.c
+++ b/drivers/staging/iio/dds/ad9850.c
@@ -129,18 +129,7 @@ static struct spi_driver ad9850_driver = {
129 .probe = ad9850_probe, 129 .probe = ad9850_probe,
130 .remove = __devexit_p(ad9850_remove), 130 .remove = __devexit_p(ad9850_remove),
131}; 131};
132 132module_spi_driver(ad9850_driver);
133static __init int ad9850_spi_init(void)
134{
135 return spi_register_driver(&ad9850_driver);
136}
137module_init(ad9850_spi_init);
138
139static __exit void ad9850_spi_exit(void)
140{
141 spi_unregister_driver(&ad9850_driver);
142}
143module_exit(ad9850_spi_exit);
144 133
145MODULE_AUTHOR("Cliff Cai"); 134MODULE_AUTHOR("Cliff Cai");
146MODULE_DESCRIPTION("Analog Devices ad9850 driver"); 135MODULE_DESCRIPTION("Analog Devices ad9850 driver");
diff --git a/drivers/staging/iio/dds/ad9852.c b/drivers/staging/iio/dds/ad9852.c
index cfceaa64a53a..9fc73fdc9c3b 100644
--- a/drivers/staging/iio/dds/ad9852.c
+++ b/drivers/staging/iio/dds/ad9852.c
@@ -280,18 +280,7 @@ static struct spi_driver ad9852_driver = {
280 .probe = ad9852_probe, 280 .probe = ad9852_probe,
281 .remove = __devexit_p(ad9852_remove), 281 .remove = __devexit_p(ad9852_remove),
282}; 282};
283 283module_spi_driver(ad9852_driver);
284static __init int ad9852_spi_init(void)
285{
286 return spi_register_driver(&ad9852_driver);
287}
288module_init(ad9852_spi_init);
289
290static __exit void ad9852_spi_exit(void)
291{
292 spi_unregister_driver(&ad9852_driver);
293}
294module_exit(ad9852_spi_exit);
295 284
296MODULE_AUTHOR("Cliff Cai"); 285MODULE_AUTHOR("Cliff Cai");
297MODULE_DESCRIPTION("Analog Devices ad9852 driver"); 286MODULE_DESCRIPTION("Analog Devices ad9852 driver");
diff --git a/drivers/staging/iio/dds/ad9910.c b/drivers/staging/iio/dds/ad9910.c
index da83d2b88c4a..57046b03121f 100644
--- a/drivers/staging/iio/dds/ad9910.c
+++ b/drivers/staging/iio/dds/ad9910.c
@@ -413,18 +413,7 @@ static struct spi_driver ad9910_driver = {
413 .probe = ad9910_probe, 413 .probe = ad9910_probe,
414 .remove = __devexit_p(ad9910_remove), 414 .remove = __devexit_p(ad9910_remove),
415}; 415};
416 416module_spi_driver(ad9910_driver);
417static __init int ad9910_spi_init(void)
418{
419 return spi_register_driver(&ad9910_driver);
420}
421module_init(ad9910_spi_init);
422
423static __exit void ad9910_spi_exit(void)
424{
425 spi_unregister_driver(&ad9910_driver);
426}
427module_exit(ad9910_spi_exit);
428 417
429MODULE_AUTHOR("Cliff Cai"); 418MODULE_AUTHOR("Cliff Cai");
430MODULE_DESCRIPTION("Analog Devices ad9910 driver"); 419MODULE_DESCRIPTION("Analog Devices ad9910 driver");
diff --git a/drivers/staging/iio/dds/ad9951.c b/drivers/staging/iio/dds/ad9951.c
index 20c182576def..d29130e9acdf 100644
--- a/drivers/staging/iio/dds/ad9951.c
+++ b/drivers/staging/iio/dds/ad9951.c
@@ -224,18 +224,7 @@ static struct spi_driver ad9951_driver = {
224 .probe = ad9951_probe, 224 .probe = ad9951_probe,
225 .remove = __devexit_p(ad9951_remove), 225 .remove = __devexit_p(ad9951_remove),
226}; 226};
227 227module_spi_driver(ad9951_driver);
228static __init int ad9951_spi_init(void)
229{
230 return spi_register_driver(&ad9951_driver);
231}
232module_init(ad9951_spi_init);
233
234static __exit void ad9951_spi_exit(void)
235{
236 spi_unregister_driver(&ad9951_driver);
237}
238module_exit(ad9951_spi_exit);
239 228
240MODULE_AUTHOR("Cliff Cai"); 229MODULE_AUTHOR("Cliff Cai");
241MODULE_DESCRIPTION("Analog Devices ad9951 driver"); 230MODULE_DESCRIPTION("Analog Devices ad9951 driver");
diff --git a/drivers/staging/iio/gyro/adis16080_core.c b/drivers/staging/iio/gyro/adis16080_core.c
index 5d7a906fec78..9405f2d368ee 100644
--- a/drivers/staging/iio/gyro/adis16080_core.c
+++ b/drivers/staging/iio/gyro/adis16080_core.c
@@ -189,18 +189,7 @@ static struct spi_driver adis16080_driver = {
189 .probe = adis16080_probe, 189 .probe = adis16080_probe,
190 .remove = __devexit_p(adis16080_remove), 190 .remove = __devexit_p(adis16080_remove),
191}; 191};
192 192module_spi_driver(adis16080_driver);
193static __init int adis16080_init(void)
194{
195 return spi_register_driver(&adis16080_driver);
196}
197module_init(adis16080_init);
198
199static __exit void adis16080_exit(void)
200{
201 spi_unregister_driver(&adis16080_driver);
202}
203module_exit(adis16080_exit);
204 193
205MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 194MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
206MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope Driver"); 195MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope Driver");
diff --git a/drivers/staging/iio/gyro/adis16130_core.c b/drivers/staging/iio/gyro/adis16130_core.c
index 749240d0d8cb..c9aaca9631f4 100644
--- a/drivers/staging/iio/gyro/adis16130_core.c
+++ b/drivers/staging/iio/gyro/adis16130_core.c
@@ -168,18 +168,7 @@ static struct spi_driver adis16130_driver = {
168 .probe = adis16130_probe, 168 .probe = adis16130_probe,
169 .remove = __devexit_p(adis16130_remove), 169 .remove = __devexit_p(adis16130_remove),
170}; 170};
171 171module_spi_driver(adis16130_driver);
172static __init int adis16130_init(void)
173{
174 return spi_register_driver(&adis16130_driver);
175}
176module_init(adis16130_init);
177
178static __exit void adis16130_exit(void)
179{
180 spi_unregister_driver(&adis16130_driver);
181}
182module_exit(adis16130_exit);
183 172
184MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 173MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
185MODULE_DESCRIPTION("Analog Devices ADIS16130 High Precision Angular Rate"); 174MODULE_DESCRIPTION("Analog Devices ADIS16130 High Precision Angular Rate");
diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c
index aaa3967f8c03..886dddf867ef 100644
--- a/drivers/staging/iio/gyro/adis16260_core.c
+++ b/drivers/staging/iio/gyro/adis16260_core.c
@@ -711,18 +711,7 @@ static struct spi_driver adis16260_driver = {
711 .remove = __devexit_p(adis16260_remove), 711 .remove = __devexit_p(adis16260_remove),
712 .id_table = adis16260_id, 712 .id_table = adis16260_id,
713}; 713};
714 714module_spi_driver(adis16260_driver);
715static __init int adis16260_init(void)
716{
717 return spi_register_driver(&adis16260_driver);
718}
719module_init(adis16260_init);
720
721static __exit void adis16260_exit(void)
722{
723 spi_unregister_driver(&adis16260_driver);
724}
725module_exit(adis16260_exit);
726 715
727MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 716MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
728MODULE_DESCRIPTION("Analog Devices ADIS16260/5 Digital Gyroscope Sensor"); 717MODULE_DESCRIPTION("Analog Devices ADIS16260/5 Digital Gyroscope Sensor");
diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c
index 3c3ef796d48e..70fd468b6850 100644
--- a/drivers/staging/iio/gyro/adxrs450_core.c
+++ b/drivers/staging/iio/gyro/adxrs450_core.c
@@ -381,18 +381,7 @@ static struct spi_driver adxrs450_driver = {
381 .probe = adxrs450_probe, 381 .probe = adxrs450_probe,
382 .remove = __devexit_p(adxrs450_remove), 382 .remove = __devexit_p(adxrs450_remove),
383}; 383};
384 384module_spi_driver(adxrs450_driver);
385static __init int adxrs450_init(void)
386{
387 return spi_register_driver(&adxrs450_driver);
388}
389module_init(adxrs450_init);
390
391static __exit void adxrs450_exit(void)
392{
393 spi_unregister_driver(&adxrs450_driver);
394}
395module_exit(adxrs450_exit);
396 385
397MODULE_AUTHOR("Cliff Cai <cliff.cai@xxxxxxxxxx>"); 386MODULE_AUTHOR("Cliff Cai <cliff.cai@xxxxxxxxxx>");
398MODULE_DESCRIPTION("Analog Devices ADXRS450 Gyroscope SPI driver"); 387MODULE_DESCRIPTION("Analog Devices ADXRS450 Gyroscope SPI driver");
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 1086e0befc28..454d131455de 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -796,18 +796,7 @@ static struct i2c_driver ad5933_driver = {
796 .remove = __devexit_p(ad5933_remove), 796 .remove = __devexit_p(ad5933_remove),
797 .id_table = ad5933_id, 797 .id_table = ad5933_id,
798}; 798};
799 799module_i2c_driver(ad5933_driver);
800static __init int ad5933_init(void)
801{
802 return i2c_add_driver(&ad5933_driver);
803}
804module_init(ad5933_init);
805
806static __exit void ad5933_exit(void)
807{
808 i2c_del_driver(&ad5933_driver);
809}
810module_exit(ad5933_exit);
811 800
812MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 801MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
813MODULE_DESCRIPTION("Analog Devices AD5933 Impedance Conv. Network Analyzer"); 802MODULE_DESCRIPTION("Analog Devices AD5933 Impedance Conv. Network Analyzer");
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c
index d082a37c4fb7..efc0f6529008 100644
--- a/drivers/staging/iio/imu/adis16400_core.c
+++ b/drivers/staging/iio/imu/adis16400_core.c
@@ -1128,18 +1128,7 @@ static struct spi_driver adis16400_driver = {
1128 .probe = adis16400_probe, 1128 .probe = adis16400_probe,
1129 .remove = __devexit_p(adis16400_remove), 1129 .remove = __devexit_p(adis16400_remove),
1130}; 1130};
1131 1131module_spi_driver(adis16400_driver);
1132static __init int adis16400_init(void)
1133{
1134 return spi_register_driver(&adis16400_driver);
1135}
1136module_init(adis16400_init);
1137
1138static __exit void adis16400_exit(void)
1139{
1140 spi_unregister_driver(&adis16400_driver);
1141}
1142module_exit(adis16400_exit);
1143 1132
1144MODULE_AUTHOR("Manuel Stahl <manuel.stahl@iis.fraunhofer.de>"); 1133MODULE_AUTHOR("Manuel Stahl <manuel.stahl@iis.fraunhofer.de>");
1145MODULE_DESCRIPTION("Analog Devices ADIS16400/5 IMU SPI driver"); 1134MODULE_DESCRIPTION("Analog Devices ADIS16400/5 IMU SPI driver");
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 9dc9e6358394..47638362224b 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -603,19 +603,7 @@ static struct i2c_driver isl29018_driver = {
603 .remove = __devexit_p(isl29018_remove), 603 .remove = __devexit_p(isl29018_remove),
604 .id_table = isl29018_id, 604 .id_table = isl29018_id,
605}; 605};
606 606module_i2c_driver(isl29018_driver);
607static int __init isl29018_init(void)
608{
609 return i2c_add_driver(&isl29018_driver);
610}
611
612static void __exit isl29018_exit(void)
613{
614 i2c_del_driver(&isl29018_driver);
615}
616
617module_init(isl29018_init);
618module_exit(isl29018_exit);
619 607
620MODULE_DESCRIPTION("ISL29018 Ambient Light Sensor driver"); 608MODULE_DESCRIPTION("ISL29018 Ambient Light Sensor driver");
621MODULE_LICENSE("GPL"); 609MODULE_LICENSE("GPL");
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
index 7e984bcf8d7e..1942db13b03b 100644
--- a/drivers/staging/iio/light/tsl2563.c
+++ b/drivers/staging/iio/light/tsl2563.c
@@ -866,20 +866,8 @@ static struct i2c_driver tsl2563_i2c_driver = {
866 .remove = __devexit_p(tsl2563_remove), 866 .remove = __devexit_p(tsl2563_remove),
867 .id_table = tsl2563_id, 867 .id_table = tsl2563_id,
868}; 868};
869 869module_i2c_driver(tsl2563_i2c_driver);
870static int __init tsl2563_init(void)
871{
872 return i2c_add_driver(&tsl2563_i2c_driver);
873}
874
875static void __exit tsl2563_exit(void)
876{
877 i2c_del_driver(&tsl2563_i2c_driver);
878}
879 870
880MODULE_AUTHOR("Nokia Corporation"); 871MODULE_AUTHOR("Nokia Corporation");
881MODULE_DESCRIPTION("tsl2563 light sensor driver"); 872MODULE_DESCRIPTION("tsl2563 light sensor driver");
882MODULE_LICENSE("GPL"); 873MODULE_LICENSE("GPL");
883
884module_init(tsl2563_init);
885module_exit(tsl2563_exit);
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 80f77cf8e9c2..3836f73a5296 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -933,19 +933,7 @@ static struct i2c_driver taos_driver = {
933 .probe = taos_probe, 933 .probe = taos_probe,
934 .remove = __devexit_p(taos_remove), 934 .remove = __devexit_p(taos_remove),
935}; 935};
936 936module_i2c_driver(taos_driver);
937static int __init taos_init(void)
938{
939 return i2c_add_driver(&taos_driver);
940}
941
942static void __exit taos_exit(void)
943{
944 i2c_del_driver(&taos_driver);
945}
946
947module_init(taos_init);
948module_exit(taos_exit);
949 937
950MODULE_AUTHOR("J. August Brenner<jbrenner@taosinc.com>"); 938MODULE_AUTHOR("J. August Brenner<jbrenner@taosinc.com>");
951MODULE_DESCRIPTION("TAOS tsl2583 ambient light sensor driver"); 939MODULE_DESCRIPTION("TAOS tsl2583 ambient light sensor driver");
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
index 8b017127fd4d..db31d6d0e5b6 100644
--- a/drivers/staging/iio/magnetometer/ak8975.c
+++ b/drivers/staging/iio/magnetometer/ak8975.c
@@ -572,19 +572,7 @@ static struct i2c_driver ak8975_driver = {
572 .remove = __devexit_p(ak8975_remove), 572 .remove = __devexit_p(ak8975_remove),
573 .id_table = ak8975_id, 573 .id_table = ak8975_id,
574}; 574};
575 575module_i2c_driver(ak8975_driver);
576static int __init ak8975_init(void)
577{
578 return i2c_add_driver(&ak8975_driver);
579}
580
581static void __exit ak8975_exit(void)
582{
583 i2c_del_driver(&ak8975_driver);
584}
585
586module_init(ak8975_init);
587module_exit(ak8975_exit);
588 576
589MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 577MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
590MODULE_DESCRIPTION("AK8975 magnetometer driver"); 578MODULE_DESCRIPTION("AK8975 magnetometer driver");
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
index fc9ee970888d..7bb1bc605136 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843.c
@@ -618,20 +618,8 @@ static struct i2c_driver hmc5843_driver = {
618 .suspend = hmc5843_suspend, 618 .suspend = hmc5843_suspend,
619 .resume = hmc5843_resume, 619 .resume = hmc5843_resume,
620}; 620};
621 621module_i2c_driver(hmc5843_driver);
622static int __init hmc5843_init(void)
623{
624 return i2c_add_driver(&hmc5843_driver);
625}
626
627static void __exit hmc5843_exit(void)
628{
629 i2c_del_driver(&hmc5843_driver);
630}
631 622
632MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com"); 623MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com");
633MODULE_DESCRIPTION("HMC5843 driver"); 624MODULE_DESCRIPTION("HMC5843 driver");
634MODULE_LICENSE("GPL"); 625MODULE_LICENSE("GPL");
635
636module_init(hmc5843_init);
637module_exit(hmc5843_exit);
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index 940fef602b18..4c7b0cbf49fa 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -577,18 +577,7 @@ static struct spi_driver ade7753_driver = {
577 .probe = ade7753_probe, 577 .probe = ade7753_probe,
578 .remove = __devexit_p(ade7753_remove), 578 .remove = __devexit_p(ade7753_remove),
579}; 579};
580 580module_spi_driver(ade7753_driver);
581static __init int ade7753_init(void)
582{
583 return spi_register_driver(&ade7753_driver);
584}
585module_init(ade7753_init);
586
587static __exit void ade7753_exit(void)
588{
589 spi_unregister_driver(&ade7753_driver);
590}
591module_exit(ade7753_exit);
592 581
593MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 582MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
594MODULE_DESCRIPTION("Analog Devices ADE7753/6 Single-Phase Multifunction Meter"); 583MODULE_DESCRIPTION("Analog Devices ADE7753/6 Single-Phase Multifunction Meter");
diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
index 33f0d327c9fa..15c98cde76d1 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -600,18 +600,7 @@ static struct spi_driver ade7754_driver = {
600 .probe = ade7754_probe, 600 .probe = ade7754_probe,
601 .remove = __devexit_p(ade7754_remove), 601 .remove = __devexit_p(ade7754_remove),
602}; 602};
603 603module_spi_driver(ade7754_driver);
604static __init int ade7754_init(void)
605{
606 return spi_register_driver(&ade7754_driver);
607}
608module_init(ade7754_init);
609
610static __exit void ade7754_exit(void)
611{
612 spi_unregister_driver(&ade7754_driver);
613}
614module_exit(ade7754_exit);
615 604
616MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 605MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
617MODULE_DESCRIPTION("Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver"); 606MODULE_DESCRIPTION("Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver");
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index c5dafbdf3bda..39338bcb1872 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -853,18 +853,7 @@ static struct spi_driver ade7758_driver = {
853 .remove = __devexit_p(ade7758_remove), 853 .remove = __devexit_p(ade7758_remove),
854 .id_table = ade7758_id, 854 .id_table = ade7758_id,
855}; 855};
856 856module_spi_driver(ade7758_driver);
857static __init int ade7758_init(void)
858{
859 return spi_register_driver(&ade7758_driver);
860}
861module_init(ade7758_init);
862
863static __exit void ade7758_exit(void)
864{
865 spi_unregister_driver(&ade7758_driver);
866}
867module_exit(ade7758_exit);
868 857
869MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 858MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
870MODULE_DESCRIPTION("Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC Driver"); 859MODULE_DESCRIPTION("Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC Driver");
diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index b691f10ce988..cfa2a5eff122 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -521,18 +521,7 @@ static struct spi_driver ade7759_driver = {
521 .probe = ade7759_probe, 521 .probe = ade7759_probe,
522 .remove = __devexit_p(ade7759_remove), 522 .remove = __devexit_p(ade7759_remove),
523}; 523};
524 524module_spi_driver(ade7759_driver);
525static __init int ade7759_init(void)
526{
527 return spi_register_driver(&ade7759_driver);
528}
529module_init(ade7759_init);
530
531static __exit void ade7759_exit(void)
532{
533 spi_unregister_driver(&ade7759_driver);
534}
535module_exit(ade7759_exit);
536 525
537MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 526MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
538MODULE_DESCRIPTION("Analog Devices ADE7759 Active Energy Metering IC Driver"); 527MODULE_DESCRIPTION("Analog Devices ADE7759 Active Energy Metering IC Driver");
diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c
index cbca3fd8fcd6..1e1faa0479d3 100644
--- a/drivers/staging/iio/meter/ade7854-i2c.c
+++ b/drivers/staging/iio/meter/ade7854-i2c.c
@@ -253,19 +253,7 @@ static struct i2c_driver ade7854_i2c_driver = {
253 .remove = __devexit_p(ade7854_i2c_remove), 253 .remove = __devexit_p(ade7854_i2c_remove),
254 .id_table = ade7854_id, 254 .id_table = ade7854_id,
255}; 255};
256 256module_i2c_driver(ade7854_i2c_driver);
257static __init int ade7854_i2c_init(void)
258{
259 return i2c_add_driver(&ade7854_i2c_driver);
260}
261module_init(ade7854_i2c_init);
262
263static __exit void ade7854_i2c_exit(void)
264{
265 i2c_del_driver(&ade7854_i2c_driver);
266}
267module_exit(ade7854_i2c_exit);
268
269 257
270MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 258MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
271MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC I2C Driver"); 259MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC I2C Driver");
diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c
index cfa23ba30efe..c485a79aeec3 100644
--- a/drivers/staging/iio/meter/ade7854-spi.c
+++ b/drivers/staging/iio/meter/ade7854-spi.c
@@ -353,18 +353,7 @@ static struct spi_driver ade7854_driver = {
353 .remove = __devexit_p(ade7854_spi_remove), 353 .remove = __devexit_p(ade7854_spi_remove),
354 .id_table = ade7854_id, 354 .id_table = ade7854_id,
355}; 355};
356 356module_spi_driver(ade7854_driver);
357static __init int ade7854_init(void)
358{
359 return spi_register_driver(&ade7854_driver);
360}
361module_init(ade7854_init);
362
363static __exit void ade7854_exit(void)
364{
365 spi_unregister_driver(&ade7854_driver);
366}
367module_exit(ade7854_exit);
368 357
369MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 358MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
370MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 SPI Driver"); 359MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 SPI Driver");
diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c
index d7ad46aed0ff..1c6a02bfd45d 100644
--- a/drivers/staging/iio/resolver/ad2s1200.c
+++ b/drivers/staging/iio/resolver/ad2s1200.c
@@ -170,18 +170,7 @@ static struct spi_driver ad2s1200_driver = {
170 .remove = __devexit_p(ad2s1200_remove), 170 .remove = __devexit_p(ad2s1200_remove),
171 .id_table = ad2s1200_id, 171 .id_table = ad2s1200_id,
172}; 172};
173 173module_spi_driver(ad2s1200_driver);
174static __init int ad2s1200_spi_init(void)
175{
176 return spi_register_driver(&ad2s1200_driver);
177}
178module_init(ad2s1200_spi_init);
179
180static __exit void ad2s1200_spi_exit(void)
181{
182 spi_unregister_driver(&ad2s1200_driver);
183}
184module_exit(ad2s1200_spi_exit);
185 174
186MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); 175MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>");
187MODULE_DESCRIPTION("Analog Devices AD2S1200/1205 Resolver to Digital SPI driver"); 176MODULE_DESCRIPTION("Analog Devices AD2S1200/1205 Resolver to Digital SPI driver");
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 6401a6273625..ff1b3316d016 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -759,18 +759,7 @@ static struct spi_driver ad2s1210_driver = {
759 .remove = __devexit_p(ad2s1210_remove), 759 .remove = __devexit_p(ad2s1210_remove),
760 .id_table = ad2s1210_id, 760 .id_table = ad2s1210_id,
761}; 761};
762 762module_spi_driver(ad2s1210_driver);
763static __init int ad2s1210_spi_init(void)
764{
765 return spi_register_driver(&ad2s1210_driver);
766}
767module_init(ad2s1210_spi_init);
768
769static __exit void ad2s1210_spi_exit(void)
770{
771 spi_unregister_driver(&ad2s1210_driver);
772}
773module_exit(ad2s1210_spi_exit);
774 763
775MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); 764MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>");
776MODULE_DESCRIPTION("Analog Devices AD2S1210 Resolver to Digital SPI driver"); 765MODULE_DESCRIPTION("Analog Devices AD2S1210 Resolver to Digital SPI driver");
diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index a9200d949dcd..6d0794389e74 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -119,18 +119,7 @@ static struct spi_driver ad2s90_driver = {
119 .remove = __devexit_p(ad2s90_remove), 119 .remove = __devexit_p(ad2s90_remove),
120 .id_table = ad2s90_id, 120 .id_table = ad2s90_id,
121}; 121};
122 122module_spi_driver(ad2s90_driver);
123static __init int ad2s90_spi_init(void)
124{
125 return spi_register_driver(&ad2s90_driver);
126}
127module_init(ad2s90_spi_init);
128
129static __exit void ad2s90_spi_exit(void)
130{
131 spi_unregister_driver(&ad2s90_driver);
132}
133module_exit(ad2s90_spi_exit);
134 123
135MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); 124MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>");
136MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver"); 125MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver");
diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
index 66aad3a0d1fd..483303402735 100644
--- a/drivers/staging/keucr/usb.c
+++ b/drivers/staging/keucr/usb.c
@@ -701,26 +701,4 @@ static struct usb_driver usb_storage_driver = {
701 .soft_unbind = 1, 701 .soft_unbind = 1,
702}; 702};
703 703
704//----- usb_stor_init() --------------------- 704module_usb_driver(usb_storage_driver);
705static int __init usb_stor_init(void)
706{
707 int retval;
708 pr_info("usb --- usb_stor_init start\n");
709
710 retval = usb_register(&usb_storage_driver);
711 if (retval == 0)
712 pr_info("ENE USB Mass Storage support registered.\n");
713
714 return retval;
715}
716
717//----- usb_stor_exit() ---------------------
718static void __exit usb_stor_exit(void)
719{
720 pr_info("usb --- usb_stor_exit\n");
721
722 usb_deregister(&usb_storage_driver) ;
723}
724
725module_init(usb_stor_init);
726module_exit(usb_stor_exit);
diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
index 3db3b0a91cc1..b7175fe1b15f 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1272,17 +1272,4 @@ static struct usb_driver go7007_usb_driver = {
1272 .id_table = go7007_usb_id_table, 1272 .id_table = go7007_usb_id_table,
1273}; 1273};
1274 1274
1275static int __init go7007_usb_init(void) 1275module_usb_driver(go7007_usb_driver);
1276{
1277 return usb_register(&go7007_usb_driver);
1278}
1279
1280static void __exit go7007_usb_cleanup(void)
1281{
1282 usb_deregister(&go7007_usb_driver);
1283}
1284
1285module_init(go7007_usb_init);
1286module_exit(go7007_usb_cleanup);
1287
1288MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c b/drivers/staging/media/lirc/lirc_igorplugusb.c
index 0dc2c2b22c2b..6cd4cd67a1dd 100644
--- a/drivers/staging/media/lirc/lirc_igorplugusb.c
+++ b/drivers/staging/media/lirc/lirc_igorplugusb.c
@@ -541,26 +541,7 @@ static struct usb_driver igorplugusb_remote_driver = {
541 .id_table = igorplugusb_remote_id_table 541 .id_table = igorplugusb_remote_id_table
542}; 542};
543 543
544static int __init igorplugusb_remote_init(void) 544module_usb_driver(igorplugusb_remote_driver);
545{
546 int ret = 0;
547
548 dprintk(DRIVER_NAME ": loaded, debug mode enabled\n");
549
550 ret = usb_register(&igorplugusb_remote_driver);
551 if (ret)
552 printk(KERN_ERR DRIVER_NAME ": usb register failed!\n");
553
554 return ret;
555}
556
557static void __exit igorplugusb_remote_exit(void)
558{
559 usb_deregister(&igorplugusb_remote_driver);
560}
561
562module_init(igorplugusb_remote_init);
563module_exit(igorplugusb_remote_exit);
564 545
565#include <linux/vermagic.h> 546#include <linux/vermagic.h>
566MODULE_INFO(vermagic, VERMAGIC_STRING); 547MODULE_INFO(vermagic, VERMAGIC_STRING);
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c
index f5308d5929c6..f68218012f23 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -1025,26 +1025,4 @@ static int imon_resume(struct usb_interface *intf)
1025 return rc; 1025 return rc;
1026} 1026}
1027 1027
1028static int __init imon_init(void) 1028module_usb_driver(imon_driver);
1029{
1030 int rc;
1031
1032 printk(KERN_INFO MOD_NAME ": " MOD_DESC ", v" MOD_VERSION "\n");
1033
1034 rc = usb_register(&imon_driver);
1035 if (rc) {
1036 err("%s: usb register failed(%d)", __func__, rc);
1037 return -ENODEV;
1038 }
1039
1040 return 0;
1041}
1042
1043static void __exit imon_exit(void)
1044{
1045 usb_deregister(&imon_driver);
1046 printk(KERN_INFO MOD_NAME ": module removed. Goodbye!\n");
1047}
1048
1049module_init(imon_init);
1050module_exit(imon_exit);
diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c
index a2d18b0aa048..7855baa18e75 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -913,27 +913,4 @@ static void sasem_disconnect(struct usb_interface *interface)
913 mutex_unlock(&disconnect_lock); 913 mutex_unlock(&disconnect_lock);
914} 914}
915 915
916static int __init sasem_init(void) 916module_usb_driver(sasem_driver);
917{
918 int rc;
919
920 printk(KERN_INFO MOD_DESC ", v" MOD_VERSION "\n");
921 printk(KERN_INFO MOD_AUTHOR "\n");
922
923 rc = usb_register(&sasem_driver);
924 if (rc < 0) {
925 err("%s: usb register failed (%d)", __func__, rc);
926 return -ENODEV;
927 }
928 return 0;
929}
930
931static void __exit sasem_exit(void)
932{
933 usb_deregister(&sasem_driver);
934 printk(KERN_INFO "module removed. Goodbye!\n");
935}
936
937
938module_init(sasem_init);
939module_exit(sasem_exit);
diff --git a/drivers/staging/media/lirc/lirc_ttusbir.c b/drivers/staging/media/lirc/lirc_ttusbir.c
index e4b329b8cafd..7950887ff113 100644
--- a/drivers/staging/media/lirc/lirc_ttusbir.c
+++ b/drivers/staging/media/lirc/lirc_ttusbir.c
@@ -372,24 +372,4 @@ static void disconnect(struct usb_interface *intf)
372 kfree(ttusbir); 372 kfree(ttusbir);
373} 373}
374 374
375static int ttusbir_init_module(void) 375module_usb_driver(usb_driver);
376{
377 int result;
378
379 DPRINTK(KERN_DEBUG "Module ttusbir init\n");
380
381 /* register this driver with the USB subsystem */
382 result = usb_register(&usb_driver);
383 if (result)
384 err("usb_register failed. Error number %d", result);
385 return result;
386}
387
388static void ttusbir_exit_module(void)
389{
390 printk(KERN_DEBUG "Module ttusbir exit\n");
391 usb_deregister(&usb_driver);
392}
393
394module_init(ttusbir_init_module);
395module_exit(ttusbir_exit_module);
diff --git a/drivers/staging/rts5139/rts51x.c b/drivers/staging/rts5139/rts51x.c
index d9cee6d0b124..2b9f785954df 100644
--- a/drivers/staging/rts5139/rts51x.c
+++ b/drivers/staging/rts5139/rts51x.c
@@ -934,34 +934,4 @@ struct usb_driver rts51x_driver = {
934 .soft_unbind = 1, 934 .soft_unbind = 1,
935}; 935};
936 936
937static int __init rts51x_init(void) 937module_usb_driver(rts51x_driver);
938{
939 int retval;
940
941 printk(KERN_INFO "Initializing %s USB card reader driver...\n",
942 RTS51X_NAME);
943
944 /* register the driver, return usb_register return code if error */
945 retval = usb_register(&rts51x_driver);
946 if (retval == 0) {
947 printk(KERN_INFO
948 "Realtek %s USB card reader support registered.\n",
949 RTS51X_NAME);
950 }
951 return retval;
952}
953
954static void __exit rts51x_exit(void)
955{
956 RTS51X_DEBUGP("rts51x_exit() called\n");
957
958 /* Deregister the driver
959 * This will cause disconnect() to be called for each
960 * attached unit
961 */
962 RTS51X_DEBUGP("-- calling usb_deregister()\n");
963 usb_deregister(&rts51x_driver);
964}
965
966module_init(rts51x_init);
967module_exit(rts51x_exit);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 27521b69ce08..541f9aa8ef6d 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -2103,16 +2103,4 @@ static struct usb_driver vt6656_driver = {
2103#endif /* CONFIG_PM */ 2103#endif /* CONFIG_PM */
2104}; 2104};
2105 2105
2106static int __init vt6656_init_module(void) 2106module_usb_driver(vt6656_driver);
2107{
2108 printk(KERN_NOTICE DEVICE_FULL_DRV_NAM " " DEVICE_VERSION);
2109 return usb_register(&vt6656_driver);
2110}
2111
2112static void __exit vt6656_cleanup_module(void)
2113{
2114 usb_deregister(&vt6656_driver);
2115}
2116
2117module_init(vt6656_init_module);
2118module_exit(vt6656_cleanup_module);
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index f958eb4f0d81..c3751a718384 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -865,15 +865,4 @@ static struct usb_driver wb35_driver = {
865 .disconnect = wb35_disconnect, 865 .disconnect = wb35_disconnect,
866}; 866};
867 867
868static int __init wb35_init(void) 868module_usb_driver(wb35_driver);
869{
870 return usb_register(&wb35_driver);
871}
872
873static void __exit wb35_exit(void)
874{
875 usb_deregister(&wb35_driver);
876}
877
878module_init(wb35_init);
879module_exit(wb35_exit);
diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c
index 4efa027a81e4..b1aed1f1f749 100644
--- a/drivers/staging/wlan-ng/prism2usb.c
+++ b/drivers/staging/wlan-ng/prism2usb.c
@@ -358,16 +358,4 @@ static struct usb_driver prism2_usb_driver = {
358 /* fops, minor? */ 358 /* fops, minor? */
359}; 359};
360 360
361static int __init prism2usb_init(void) 361module_usb_driver(prism2_usb_driver);
362{
363 /* This call will result in calls to prism2sta_probe_usb. */
364 return usb_register(&prism2_usb_driver);
365};
366
367static void __exit prism2usb_cleanup(void)
368{
369 usb_deregister(&prism2_usb_driver);
370};
371
372module_init(prism2usb_init);
373module_exit(prism2usb_cleanup);
diff --git a/drivers/uio/uio_pdrv.c b/drivers/uio/uio_pdrv.c
index ff5059517351..72d3646c7365 100644
--- a/drivers/uio/uio_pdrv.c
+++ b/drivers/uio/uio_pdrv.c
@@ -104,17 +104,7 @@ static struct platform_driver uio_pdrv = {
104 }, 104 },
105}; 105};
106 106
107static int __init uio_pdrv_init(void) 107module_platform_driver(uio_pdrv);
108{
109 return platform_driver_register(&uio_pdrv);
110}
111
112static void __exit uio_pdrv_exit(void)
113{
114 platform_driver_unregister(&uio_pdrv);
115}
116module_init(uio_pdrv_init);
117module_exit(uio_pdrv_exit);
118 108
119MODULE_AUTHOR("Uwe Kleine-Koenig"); 109MODULE_AUTHOR("Uwe Kleine-Koenig");
120MODULE_DESCRIPTION("Userspace I/O platform driver"); 110MODULE_DESCRIPTION("Userspace I/O platform driver");
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 25de302009a1..b98371d93a92 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -273,18 +273,7 @@ static struct platform_driver uio_pdrv_genirq = {
273 }, 273 },
274}; 274};
275 275
276static int __init uio_pdrv_genirq_init(void) 276module_platform_driver(uio_pdrv_genirq);
277{
278 return platform_driver_register(&uio_pdrv_genirq);
279}
280
281static void __exit uio_pdrv_genirq_exit(void)
282{
283 platform_driver_unregister(&uio_pdrv_genirq);
284}
285
286module_init(uio_pdrv_genirq_init);
287module_exit(uio_pdrv_genirq_exit);
288 277
289MODULE_AUTHOR("Magnus Damm"); 278MODULE_AUTHOR("Magnus Damm");
290MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling"); 279MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling");
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index e67b566e7aa3..33a7a273b453 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -227,19 +227,7 @@ static struct platform_driver pruss_driver = {
227 }, 227 },
228}; 228};
229 229
230static int __init pruss_init_module(void) 230module_platform_driver(pruss_driver);
231{
232 return platform_driver_register(&pruss_driver);
233}
234
235module_init(pruss_init_module);
236
237static void __exit pruss_exit_module(void)
238{
239 platform_driver_unregister(&pruss_driver);
240}
241
242module_exit(pruss_exit_module);
243 231
244MODULE_LICENSE("GPL v2"); 232MODULE_LICENSE("GPL v2");
245MODULE_VERSION(DRV_VERSION); 233MODULE_VERSION(DRV_VERSION);
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index a845f8b8382f..98b89fe19867 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -1372,18 +1372,7 @@ static struct usb_driver cxacru_usb_driver = {
1372 .id_table = cxacru_usb_ids 1372 .id_table = cxacru_usb_ids
1373}; 1373};
1374 1374
1375static int __init cxacru_init(void) 1375module_usb_driver(cxacru_usb_driver);
1376{
1377 return usb_register(&cxacru_usb_driver);
1378}
1379
1380static void __exit cxacru_cleanup(void)
1381{
1382 usb_deregister(&cxacru_usb_driver);
1383}
1384
1385module_init(cxacru_init);
1386module_exit(cxacru_cleanup);
1387 1376
1388MODULE_AUTHOR(DRIVER_AUTHOR); 1377MODULE_AUTHOR(DRIVER_AUTHOR);
1389MODULE_DESCRIPTION(DRIVER_DESC); 1378MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 0842cfbf60cf..b42092e1f164 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -953,22 +953,7 @@ static int speedtch_usb_probe(struct usb_interface *intf, const struct usb_devic
953 return usbatm_usb_probe(intf, id, &speedtch_usbatm_driver); 953 return usbatm_usb_probe(intf, id, &speedtch_usbatm_driver);
954} 954}
955 955
956static int __init speedtch_usb_init(void) 956module_usb_driver(speedtch_usb_driver);
957{
958 dbg("%s: driver version %s", __func__, DRIVER_VERSION);
959
960 return usb_register(&speedtch_usb_driver);
961}
962
963static void __exit speedtch_usb_cleanup(void)
964{
965 dbg("%s", __func__);
966
967 usb_deregister(&speedtch_usb_driver);
968}
969
970module_init(speedtch_usb_init);
971module_exit(speedtch_usb_cleanup);
972 957
973MODULE_AUTHOR(DRIVER_AUTHOR); 958MODULE_AUTHOR(DRIVER_AUTHOR);
974MODULE_DESCRIPTION(DRIVER_DESC); 959MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 428f36801e06..00f171a7a8a0 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -2753,36 +2753,7 @@ static struct usb_driver uea_driver = {
2753 2753
2754MODULE_DEVICE_TABLE(usb, uea_ids); 2754MODULE_DEVICE_TABLE(usb, uea_ids);
2755 2755
2756/** 2756module_usb_driver(uea_driver);
2757 * uea_init - Initialize the module.
2758 * Register to USB subsystem
2759 */
2760static int __init uea_init(void)
2761{
2762 printk(KERN_INFO "[ueagle-atm] driver " EAGLEUSBVERSION " loaded\n");
2763
2764 usb_register(&uea_driver);
2765
2766 return 0;
2767}
2768
2769module_init(uea_init);
2770
2771/**
2772 * uea_exit - Destroy module
2773 * Deregister with USB subsystem
2774 */
2775static void __exit uea_exit(void)
2776{
2777 /*
2778 * This calls automatically the uea_disconnect method if necessary:
2779 */
2780 usb_deregister(&uea_driver);
2781
2782 printk(KERN_INFO "[ueagle-atm] driver unloaded\n");
2783}
2784
2785module_exit(uea_exit);
2786 2757
2787MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka"); 2758MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka");
2788MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver"); 2759MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver");
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index efe684908c1f..1c50baff7725 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -895,24 +895,7 @@ static struct usb_driver wdm_driver = {
895 .supports_autosuspend = 1, 895 .supports_autosuspend = 1,
896}; 896};
897 897
898/* --- low level module stuff --- */ 898module_usb_driver(wdm_driver);
899
900static int __init wdm_init(void)
901{
902 int rv;
903
904 rv = usb_register(&wdm_driver);
905
906 return rv;
907}
908
909static void __exit wdm_exit(void)
910{
911 usb_deregister(&wdm_driver);
912}
913
914module_init(wdm_init);
915module_exit(wdm_exit);
916 899
917MODULE_AUTHOR(DRIVER_AUTHOR); 900MODULE_AUTHOR(DRIVER_AUTHOR);
918MODULE_DESCRIPTION(DRIVER_DESC); 901MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index cb3a93243a05..81ef2e207a8d 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1412,18 +1412,7 @@ static struct usb_driver usblp_driver = {
1412 .supports_autosuspend = 1, 1412 .supports_autosuspend = 1,
1413}; 1413};
1414 1414
1415static int __init usblp_init(void) 1415module_usb_driver(usblp_driver);
1416{
1417 return usb_register(&usblp_driver);
1418}
1419
1420static void __exit usblp_exit(void)
1421{
1422 usb_deregister(&usblp_driver);
1423}
1424
1425module_init(usblp_init);
1426module_exit(usblp_exit);
1427 1416
1428MODULE_AUTHOR(DRIVER_AUTHOR); 1417MODULE_AUTHOR(DRIVER_AUTHOR);
1429MODULE_DESCRIPTION(DRIVER_DESC); 1418MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 12cf5e7395a8..70d69d06054f 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1116,21 +1116,6 @@ static struct usb_driver usbtmc_driver = {
1116 .resume = usbtmc_resume, 1116 .resume = usbtmc_resume,
1117}; 1117};
1118 1118
1119static int __init usbtmc_init(void) 1119module_usb_driver(usbtmc_driver);
1120{
1121 int retcode;
1122
1123 retcode = usb_register(&usbtmc_driver);
1124 if (retcode)
1125 printk(KERN_ERR KBUILD_MODNAME": Unable to register driver\n");
1126 return retcode;
1127}
1128module_init(usbtmc_init);
1129
1130static void __exit usbtmc_exit(void)
1131{
1132 usb_deregister(&usbtmc_driver);
1133}
1134module_exit(usbtmc_exit);
1135 1120
1136MODULE_LICENSE("GPL"); 1121MODULE_LICENSE("GPL");
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index da1ad77d8d51..fcfa91517ea1 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -51,18 +51,13 @@
51#include "gadget.h" 51#include "gadget.h"
52#include "io.h" 52#include "io.h"
53 53
54struct dwc3_register {
55 const char *name;
56 u32 offset;
57};
58
59#define dump_register(nm) \ 54#define dump_register(nm) \
60{ \ 55{ \
61 .name = __stringify(nm), \ 56 .name = __stringify(nm), \
62 .offset = DWC3_ ##nm, \ 57 .offset = DWC3_ ##nm, \
63} 58}
64 59
65static const struct dwc3_register dwc3_regs[] = { 60static const struct debugfs_reg32 dwc3_regs[] = {
66 dump_register(GSBUSCFG0), 61 dump_register(GSBUSCFG0),
67 dump_register(GSBUSCFG1), 62 dump_register(GSBUSCFG1),
68 dump_register(GTXTHRCFG), 63 dump_register(GTXTHRCFG),
@@ -382,15 +377,10 @@ static const struct dwc3_register dwc3_regs[] = {
382static int dwc3_regdump_show(struct seq_file *s, void *unused) 377static int dwc3_regdump_show(struct seq_file *s, void *unused)
383{ 378{
384 struct dwc3 *dwc = s->private; 379 struct dwc3 *dwc = s->private;
385 int i;
386 380
387 seq_printf(s, "DesignWare USB3 Core Register Dump\n"); 381 seq_printf(s, "DesignWare USB3 Core Register Dump\n");
388 382 debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs),
389 for (i = 0; i < ARRAY_SIZE(dwc3_regs); i++) { 383 dwc->regs, "");
390 seq_printf(s, "%-20s : %08x\n", dwc3_regs[i].name,
391 dwc3_readl(dwc->regs, dwc3_regs[i].offset));
392 }
393
394 return 0; 384 return 0;
395} 385}
396 386
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
index 9bfac657572e..056fb2d37c88 100644
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -837,18 +837,7 @@ static struct usb_driver hwahc_driver = {
837 .id_table = hwahc_id_table, 837 .id_table = hwahc_id_table,
838}; 838};
839 839
840static int __init hwahc_driver_init(void) 840module_usb_driver(hwahc_driver);
841{
842 return usb_register(&hwahc_driver);
843}
844module_init(hwahc_driver_init);
845
846static void __exit hwahc_driver_exit(void)
847{
848 usb_deregister(&hwahc_driver);
849}
850module_exit(hwahc_driver_exit);
851
852 841
853MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 842MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
854MODULE_DESCRIPTION("Host Wired Adapter USB Host Control Driver"); 843MODULE_DESCRIPTION("Host Wired Adapter USB Host Control Driver");
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 27e209a7222f..9c0f8caba3be 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -809,19 +809,7 @@ static void mts_usb_disconnect (struct usb_interface *intf)
809 kfree(desc); 809 kfree(desc);
810} 810}
811 811
812 812module_usb_driver(mts_usb_driver);
813static int __init microtek_drv_init(void)
814{
815 return usb_register(&mts_usb_driver);
816}
817
818static void __exit microtek_drv_exit(void)
819{
820 usb_deregister(&mts_usb_driver);
821}
822
823module_init(microtek_drv_init);
824module_exit(microtek_drv_exit);
825 813
826MODULE_AUTHOR( DRIVER_AUTHOR ); 814MODULE_AUTHOR( DRIVER_AUTHOR );
827MODULE_DESCRIPTION( DRIVER_DESC ); 815MODULE_DESCRIPTION( DRIVER_DESC );
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index fe858711651c..284b85461410 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -885,40 +885,7 @@ static struct usb_driver adu_driver = {
885 .id_table = device_table, 885 .id_table = device_table,
886}; 886};
887 887
888static int __init adu_init(void) 888module_usb_driver(adu_driver);
889{
890 int result;
891
892 dbg(2," %s : enter", __func__);
893
894 /* register this driver with the USB subsystem */
895 result = usb_register(&adu_driver);
896 if (result < 0) {
897 printk(KERN_ERR "usb_register failed for the "__FILE__
898 " driver. Error number %d\n", result);
899 goto exit;
900 }
901
902 printk(KERN_INFO "adutux " DRIVER_DESC " " DRIVER_VERSION "\n");
903 printk(KERN_INFO "adutux is an experimental driver. "
904 "Use at your own risk\n");
905
906exit:
907 dbg(2," %s : leave, return value %d", __func__, result);
908
909 return result;
910}
911
912static void __exit adu_exit(void)
913{
914 dbg(2," %s : enter", __func__);
915 /* deregister this driver with the USB subsystem */
916 usb_deregister(&adu_driver);
917 dbg(2," %s : leave", __func__);
918}
919
920module_init(adu_init);
921module_exit(adu_exit);
922 889
923MODULE_AUTHOR(DRIVER_AUTHOR); 890MODULE_AUTHOR(DRIVER_AUTHOR);
924MODULE_DESCRIPTION(DRIVER_DESC); 891MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c
index 9251773ecef4..3f7c1a92579f 100644
--- a/drivers/usb/misc/cypress_cy7c63.c
+++ b/drivers/usb/misc/cypress_cy7c63.c
@@ -271,27 +271,7 @@ static struct usb_driver cypress_driver = {
271 .id_table = cypress_table, 271 .id_table = cypress_table,
272}; 272};
273 273
274static int __init cypress_init(void) 274module_usb_driver(cypress_driver);
275{
276 int result;
277
278 /* register this driver with the USB subsystem */
279 result = usb_register(&cypress_driver);
280 if (result)
281 printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! "
282 "Error number: %d\n", result);
283
284 return result;
285}
286
287static void __exit cypress_exit(void)
288{
289 /* deregister this driver with the USB subsystem */
290 usb_deregister(&cypress_driver);
291}
292
293module_init(cypress_init);
294module_exit(cypress_exit);
295 275
296MODULE_AUTHOR(DRIVER_AUTHOR); 276MODULE_AUTHOR(DRIVER_AUTHOR);
297MODULE_DESCRIPTION(DRIVER_DESC); 277MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index 1d7251bc1b5f..5b9831b95d97 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -417,31 +417,7 @@ static void cytherm_disconnect(struct usb_interface *interface)
417 dev_info(&interface->dev, "Cypress thermometer now disconnected\n"); 417 dev_info(&interface->dev, "Cypress thermometer now disconnected\n");
418} 418}
419 419
420 420module_usb_driver(cytherm_driver);
421static int __init usb_cytherm_init(void)
422{
423 int result;
424
425 result = usb_register(&cytherm_driver);
426 if (result) {
427 printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! "
428 "Error number: %d\n", result);
429 return result;
430 }
431
432 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
433 DRIVER_DESC "\n");
434 return 0;
435}
436
437static void __exit usb_cytherm_exit(void)
438{
439 usb_deregister(&cytherm_driver);
440}
441
442
443module_init (usb_cytherm_init);
444module_exit (usb_cytherm_exit);
445 421
446MODULE_AUTHOR(DRIVER_AUTHOR); 422MODULE_AUTHOR(DRIVER_AUTHOR);
447MODULE_DESCRIPTION(DRIVER_DESC); 423MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index a6521c95f683..d9b6a0355443 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -276,18 +276,7 @@ static struct usb_driver emi26_driver = {
276 .id_table = id_table, 276 .id_table = id_table,
277}; 277};
278 278
279static int __init emi26_init (void) 279module_usb_driver(emi26_driver);
280{
281 return usb_register(&emi26_driver);
282}
283
284static void __exit emi26_exit (void)
285{
286 usb_deregister (&emi26_driver);
287}
288
289module_init(emi26_init);
290module_exit(emi26_exit);
291 280
292MODULE_AUTHOR("Tapio Laxström"); 281MODULE_AUTHOR("Tapio Laxström");
293MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader."); 282MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader.");
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index fc15ad4c3139..9f39062ebb08 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -290,22 +290,7 @@ static struct usb_driver emi62_driver = {
290 .id_table = id_table, 290 .id_table = id_table,
291}; 291};
292 292
293static int __init emi62_init (void) 293module_usb_driver(emi62_driver);
294{
295 int retval;
296 retval = usb_register (&emi62_driver);
297 if (retval)
298 printk(KERN_ERR "adi-emi: registration failed\n");
299 return retval;
300}
301
302static void __exit emi62_exit (void)
303{
304 usb_deregister (&emi62_driver);
305}
306
307module_init(emi62_init);
308module_exit(emi62_exit);
309 294
310MODULE_AUTHOR("Tapio Laxström"); 295MODULE_AUTHOR("Tapio Laxström");
311MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader."); 296MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader.");
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 515b67fffab1..0dee24698504 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -428,29 +428,7 @@ static void idmouse_disconnect(struct usb_interface *interface)
428 dev_info(&interface->dev, "disconnected\n"); 428 dev_info(&interface->dev, "disconnected\n");
429} 429}
430 430
431static int __init usb_idmouse_init(void) 431module_usb_driver(idmouse_driver);
432{
433 int result;
434
435 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
436 DRIVER_DESC "\n");
437
438 /* register this driver with the USB subsystem */
439 result = usb_register(&idmouse_driver);
440 if (result)
441 err("Unable to register device (error %d).", result);
442
443 return result;
444}
445
446static void __exit usb_idmouse_exit(void)
447{
448 /* deregister this driver with the USB subsystem */
449 usb_deregister(&idmouse_driver);
450}
451
452module_init(usb_idmouse_init);
453module_exit(usb_idmouse_exit);
454 432
455MODULE_AUTHOR(DRIVER_AUTHOR); 433MODULE_AUTHOR(DRIVER_AUTHOR);
456MODULE_DESCRIPTION(DRIVER_DESC); 434MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 81457904d6ba..7676b5b7e171 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -927,15 +927,4 @@ static struct usb_driver iowarrior_driver = {
927 .id_table = iowarrior_ids, 927 .id_table = iowarrior_ids,
928}; 928};
929 929
930static int __init iowarrior_init(void) 930module_usb_driver(iowarrior_driver);
931{
932 return usb_register(&iowarrior_driver);
933}
934
935static void __exit iowarrior_exit(void)
936{
937 usb_deregister(&iowarrior_driver);
938}
939
940module_init(iowarrior_init);
941module_exit(iowarrior_exit);
diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c
index fe1d44319d0a..1dc7e9581cc6 100644
--- a/drivers/usb/misc/isight_firmware.c
+++ b/drivers/usb/misc/isight_firmware.c
@@ -126,18 +126,7 @@ static struct usb_driver isight_firmware_driver = {
126 .id_table = id_table, 126 .id_table = id_table,
127}; 127};
128 128
129static int __init isight_firmware_init(void) 129module_usb_driver(isight_firmware_driver);
130{
131 return usb_register(&isight_firmware_driver);
132}
133
134static void __exit isight_firmware_exit(void)
135{
136 usb_deregister(&isight_firmware_driver);
137}
138
139module_init(isight_firmware_init);
140module_exit(isight_firmware_exit);
141 130
142MODULE_LICENSE("GPL"); 131MODULE_LICENSE("GPL");
143MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>"); 132MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 48c166f0d764..5db4ab52061e 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -821,30 +821,5 @@ static struct usb_driver ld_usb_driver = {
821 .id_table = ld_usb_table, 821 .id_table = ld_usb_table,
822}; 822};
823 823
824/** 824module_usb_driver(ld_usb_driver);
825 * ld_usb_init
826 */
827static int __init ld_usb_init(void)
828{
829 int retval;
830
831 /* register this driver with the USB subsystem */
832 retval = usb_register(&ld_usb_driver);
833 if (retval)
834 err("usb_register failed for the %s driver. Error number %d\n", __FILE__, retval);
835
836 return retval;
837}
838
839/**
840 * ld_usb_exit
841 */
842static void __exit ld_usb_exit(void)
843{
844 /* deregister this driver with the USB subsystem */
845 usb_deregister(&ld_usb_driver);
846}
847
848module_init(ld_usb_init);
849module_exit(ld_usb_exit);
850 825
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index a989356f693e..16937da31cd8 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -1043,51 +1043,7 @@ static void tower_disconnect (struct usb_interface *interface)
1043 dbg(2, "%s: leave", __func__); 1043 dbg(2, "%s: leave", __func__);
1044} 1044}
1045 1045
1046 1046module_usb_driver(tower_driver);
1047
1048/**
1049 * lego_usb_tower_init
1050 */
1051static int __init lego_usb_tower_init(void)
1052{
1053 int result;
1054 int retval = 0;
1055
1056 dbg(2, "%s: enter", __func__);
1057
1058 /* register this driver with the USB subsystem */
1059 result = usb_register(&tower_driver);
1060 if (result < 0) {
1061 err("usb_register failed for the %s driver. Error number %d", __FILE__, result);
1062 retval = -1;
1063 goto exit;
1064 }
1065
1066 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1067 DRIVER_DESC "\n");
1068
1069exit:
1070 dbg(2, "%s: leave, return value %d", __func__, retval);
1071
1072 return retval;
1073}
1074
1075
1076/**
1077 * lego_usb_tower_exit
1078 */
1079static void __exit lego_usb_tower_exit(void)
1080{
1081 dbg(2, "%s: enter", __func__);
1082
1083 /* deregister this driver with the USB subsystem */
1084 usb_deregister (&tower_driver);
1085
1086 dbg(2, "%s: leave", __func__);
1087}
1088
1089module_init (lego_usb_tower_init);
1090module_exit (lego_usb_tower_exit);
1091 1047
1092MODULE_AUTHOR(DRIVER_AUTHOR); 1048MODULE_AUTHOR(DRIVER_AUTHOR);
1093MODULE_DESCRIPTION(DRIVER_DESC); 1049MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 4e23d3841b43..487a8ce0775e 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -531,33 +531,7 @@ static struct usb_driver rio_driver = {
531 .id_table = rio_table, 531 .id_table = rio_table,
532}; 532};
533 533
534static int __init usb_rio_init(void) 534module_usb_driver(rio_driver);
535{
536 int retval;
537 retval = usb_register(&rio_driver);
538 if (retval)
539 goto out;
540
541 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
542 DRIVER_DESC "\n");
543
544out:
545 return retval;
546}
547
548
549static void __exit usb_rio_cleanup(void)
550{
551 struct rio_usb_data *rio = &rio_instance;
552
553 rio->present = 0;
554 usb_deregister(&rio_driver);
555
556
557}
558
559module_init(usb_rio_init);
560module_exit(usb_rio_cleanup);
561 535
562MODULE_AUTHOR( DRIVER_AUTHOR ); 536MODULE_AUTHOR( DRIVER_AUTHOR );
563MODULE_DESCRIPTION( DRIVER_DESC ); 537MODULE_DESCRIPTION( DRIVER_DESC );
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c
index f63776a48e2a..741efed4a236 100644
--- a/drivers/usb/misc/trancevibrator.c
+++ b/drivers/usb/misc/trancevibrator.c
@@ -137,26 +137,7 @@ static struct usb_driver tv_driver = {
137 .id_table = id_table, 137 .id_table = id_table,
138}; 138};
139 139
140static int __init tv_init(void) 140module_usb_driver(tv_driver);
141{
142 int retval = usb_register(&tv_driver);
143 if (retval) {
144 err("usb_register failed. Error number %d", retval);
145 return retval;
146 }
147
148 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
149 DRIVER_DESC "\n");
150 return 0;
151}
152
153static void __exit tv_exit(void)
154{
155 usb_deregister(&tv_driver);
156}
157
158module_init (tv_init);
159module_exit (tv_exit);
160 141
161MODULE_AUTHOR(DRIVER_AUTHOR); 142MODULE_AUTHOR(DRIVER_AUTHOR);
162MODULE_DESCRIPTION(DRIVER_DESC); 143MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 1871cdf10da3..e2b4bd31c2b6 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -450,25 +450,7 @@ static struct usb_driver lcd_driver = {
450 .supports_autosuspend = 1, 450 .supports_autosuspend = 1,
451}; 451};
452 452
453static int __init usb_lcd_init(void) 453module_usb_driver(lcd_driver);
454{
455 int result;
456
457 result = usb_register(&lcd_driver);
458 if (result)
459 err("usb_register failed. Error number %d", result);
460
461 return result;
462}
463
464
465static void __exit usb_lcd_exit(void)
466{
467 usb_deregister(&lcd_driver);
468}
469
470module_init(usb_lcd_init);
471module_exit(usb_lcd_exit);
472 454
473MODULE_AUTHOR("Georges Toth <g.toth@e-biz.lu>"); 455MODULE_AUTHOR("Georges Toth <g.toth@e-biz.lu>");
474MODULE_DESCRIPTION(DRIVER_VERSION); 456MODULE_DESCRIPTION(DRIVER_VERSION);
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c
index 43f84e50d514..4af56fbc3c06 100644
--- a/drivers/usb/misc/usbled.c
+++ b/drivers/usb/misc/usbled.c
@@ -231,23 +231,7 @@ static struct usb_driver led_driver = {
231 .id_table = id_table, 231 .id_table = id_table,
232}; 232};
233 233
234static int __init usb_led_init(void) 234module_usb_driver(led_driver);
235{
236 int retval = 0;
237
238 retval = usb_register(&led_driver);
239 if (retval)
240 err("usb_register failed. Error number %d", retval);
241 return retval;
242}
243
244static void __exit usb_led_exit(void)
245{
246 usb_deregister(&led_driver);
247}
248
249module_init(usb_led_init);
250module_exit(usb_led_exit);
251 235
252MODULE_AUTHOR(DRIVER_AUTHOR); 236MODULE_AUTHOR(DRIVER_AUTHOR);
253MODULE_DESCRIPTION(DRIVER_DESC); 237MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c
index 417b8f207e8b..107bf13b1cf1 100644
--- a/drivers/usb/misc/usbsevseg.c
+++ b/drivers/usb/misc/usbsevseg.c
@@ -437,23 +437,7 @@ static struct usb_driver sevseg_driver = {
437 .supports_autosuspend = 1, 437 .supports_autosuspend = 1,
438}; 438};
439 439
440static int __init usb_sevseg_init(void) 440module_usb_driver(sevseg_driver);
441{
442 int rc = 0;
443
444 rc = usb_register(&sevseg_driver);
445 if (rc)
446 err("usb_register failed. Error number %d", rc);
447 return rc;
448}
449
450static void __exit usb_sevseg_exit(void)
451{
452 usb_deregister(&sevseg_driver);
453}
454
455module_init(usb_sevseg_init);
456module_exit(usb_sevseg_exit);
457 441
458MODULE_AUTHOR(DRIVER_AUTHOR); 442MODULE_AUTHOR(DRIVER_AUTHOR);
459MODULE_DESCRIPTION(DRIVER_DESC); 443MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index ac5bfd619e62..897edda42270 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -539,26 +539,6 @@ static const struct file_operations yurex_fops = {
539 .llseek = default_llseek, 539 .llseek = default_llseek,
540}; 540};
541 541
542 542module_usb_driver(yurex_driver);
543static int __init usb_yurex_init(void)
544{
545 int result;
546
547 /* register this driver with the USB subsystem */
548 result = usb_register(&yurex_driver);
549 if (result)
550 err("usb_register failed. Error number %d", result);
551
552 return result;
553}
554
555static void __exit usb_yurex_exit(void)
556{
557 /* deregister this driver with the USB subsystem */
558 usb_deregister(&yurex_driver);
559}
560
561module_init(usb_yurex_init);
562module_exit(usb_yurex_exit);
563 543
564MODULE_LICENSE("GPL"); 544MODULE_LICENSE("GPL");
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index 42d0eaed4a01..3ca87a823342 100644
--- a/drivers/usb/storage/alauda.c
+++ b/drivers/usb/storage/alauda.c
@@ -1278,15 +1278,4 @@ static struct usb_driver alauda_driver = {
1278 .soft_unbind = 1, 1278 .soft_unbind = 1,
1279}; 1279};
1280 1280
1281static int __init alauda_init(void) 1281module_usb_driver(alauda_driver);
1282{
1283 return usb_register(&alauda_driver);
1284}
1285
1286static void __exit alauda_exit(void)
1287{
1288 usb_deregister(&alauda_driver);
1289}
1290
1291module_init(alauda_init);
1292module_exit(alauda_exit);
diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c
index c84471821183..c7909dfa2434 100644
--- a/drivers/usb/storage/cypress_atacb.c
+++ b/drivers/usb/storage/cypress_atacb.c
@@ -274,15 +274,4 @@ static struct usb_driver cypress_driver = {
274 .soft_unbind = 1, 274 .soft_unbind = 1,
275}; 275};
276 276
277static int __init cypress_init(void) 277module_usb_driver(cypress_driver);
278{
279 return usb_register(&cypress_driver);
280}
281
282static void __exit cypress_exit(void)
283{
284 usb_deregister(&cypress_driver);
285}
286
287module_init(cypress_init);
288module_exit(cypress_exit);
diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
index ded836b02d7b..a99be857b794 100644
--- a/drivers/usb/storage/datafab.c
+++ b/drivers/usb/storage/datafab.c
@@ -753,15 +753,4 @@ static struct usb_driver datafab_driver = {
753 .soft_unbind = 1, 753 .soft_unbind = 1,
754}; 754};
755 755
756static int __init datafab_init(void) 756module_usb_driver(datafab_driver);
757{
758 return usb_register(&datafab_driver);
759}
760
761static void __exit datafab_exit(void)
762{
763 usb_deregister(&datafab_driver);
764}
765
766module_init(datafab_init);
767module_exit(datafab_exit);
diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
index 9fbe742343c6..b0a1687ca942 100644
--- a/drivers/usb/storage/ene_ub6250.c
+++ b/drivers/usb/storage/ene_ub6250.c
@@ -2409,15 +2409,4 @@ static struct usb_driver ene_ub6250_driver = {
2409 .soft_unbind = 1, 2409 .soft_unbind = 1,
2410}; 2410};
2411 2411
2412static int __init ene_ub6250_init(void) 2412module_usb_driver(ene_ub6250_driver);
2413{
2414 return usb_register(&ene_ub6250_driver);
2415}
2416
2417static void __exit ene_ub6250_exit(void)
2418{
2419 usb_deregister(&ene_ub6250_driver);
2420}
2421
2422module_init(ene_ub6250_init);
2423module_exit(ene_ub6250_exit);
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 6542ca40d505..03d4a873748c 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -555,15 +555,4 @@ static struct usb_driver freecom_driver = {
555 .soft_unbind = 1, 555 .soft_unbind = 1,
556}; 556};
557 557
558static int __init freecom_init(void) 558module_usb_driver(freecom_driver);
559{
560 return usb_register(&freecom_driver);
561}
562
563static void __exit freecom_exit(void)
564{
565 usb_deregister(&freecom_driver);
566}
567
568module_init(freecom_init);
569module_exit(freecom_exit);
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index ffc4193e9505..6d6923317f10 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -1568,15 +1568,4 @@ static struct usb_driver isd200_driver = {
1568 .soft_unbind = 1, 1568 .soft_unbind = 1,
1569}; 1569};
1570 1570
1571static int __init isd200_init(void) 1571module_usb_driver(isd200_driver);
1572{
1573 return usb_register(&isd200_driver);
1574}
1575
1576static void __exit isd200_exit(void)
1577{
1578 usb_deregister(&isd200_driver);
1579}
1580
1581module_init(isd200_init);
1582module_exit(isd200_exit);
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index 6168596c5ac6..54b71650b69c 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -679,15 +679,4 @@ static struct usb_driver jumpshot_driver = {
679 .soft_unbind = 1, 679 .soft_unbind = 1,
680}; 680};
681 681
682static int __init jumpshot_init(void) 682module_usb_driver(jumpshot_driver);
683{
684 return usb_register(&jumpshot_driver);
685}
686
687static void __exit jumpshot_exit(void)
688{
689 usb_deregister(&jumpshot_driver);
690}
691
692module_init(jumpshot_init);
693module_exit(jumpshot_exit);
diff --git a/drivers/usb/storage/karma.c b/drivers/usb/storage/karma.c
index ba1b78906880..35181e29124d 100644
--- a/drivers/usb/storage/karma.c
+++ b/drivers/usb/storage/karma.c
@@ -232,15 +232,4 @@ static struct usb_driver karma_driver = {
232 .soft_unbind = 1, 232 .soft_unbind = 1,
233}; 233};
234 234
235static int __init karma_init(void) 235module_usb_driver(karma_driver);
236{
237 return usb_register(&karma_driver);
238}
239
240static void __exit karma_exit(void)
241{
242 usb_deregister(&karma_driver);
243}
244
245module_init(karma_init);
246module_exit(karma_exit);
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 1943be5a2914..721c8c587305 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -314,15 +314,4 @@ static struct usb_driver onetouch_driver = {
314 .soft_unbind = 1, 314 .soft_unbind = 1,
315}; 315};
316 316
317static int __init onetouch_init(void) 317module_usb_driver(onetouch_driver);
318{
319 return usb_register(&onetouch_driver);
320}
321
322static void __exit onetouch_exit(void)
323{
324 usb_deregister(&onetouch_driver);
325}
326
327module_init(onetouch_init);
328module_exit(onetouch_exit);
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
index 0ce5f79197e7..c41cd30d2c01 100644
--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -1104,15 +1104,4 @@ static struct usb_driver realtek_cr_driver = {
1104 .supports_autosuspend = 1, 1104 .supports_autosuspend = 1,
1105}; 1105};
1106 1106
1107static int __init realtek_cr_init(void) 1107module_usb_driver(realtek_cr_driver);
1108{
1109 return usb_register(&realtek_cr_driver);
1110}
1111
1112static void __exit realtek_cr_exit(void)
1113{
1114 usb_deregister(&realtek_cr_driver);
1115}
1116
1117module_init(realtek_cr_init);
1118module_exit(realtek_cr_exit);
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index bcb9a709d349..83ee49e737bd 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -1789,15 +1789,4 @@ static struct usb_driver sddr09_driver = {
1789 .soft_unbind = 1, 1789 .soft_unbind = 1,
1790}; 1790};
1791 1791
1792static int __init sddr09_init(void) 1792module_usb_driver(sddr09_driver);
1793{
1794 return usb_register(&sddr09_driver);
1795}
1796
1797static void __exit sddr09_exit(void)
1798{
1799 usb_deregister(&sddr09_driver);
1800}
1801
1802module_init(sddr09_init);
1803module_exit(sddr09_exit);
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
index 44dfed7754ed..8983ec2ffb5a 100644
--- a/drivers/usb/storage/sddr55.c
+++ b/drivers/usb/storage/sddr55.c
@@ -1008,15 +1008,4 @@ static struct usb_driver sddr55_driver = {
1008 .soft_unbind = 1, 1008 .soft_unbind = 1,
1009}; 1009};
1010 1010
1011static int __init sddr55_init(void) 1011module_usb_driver(sddr55_driver);
1012{
1013 return usb_register(&sddr55_driver);
1014}
1015
1016static void __exit sddr55_exit(void)
1017{
1018 usb_deregister(&sddr55_driver);
1019}
1020
1021module_init(sddr55_init);
1022module_exit(sddr55_exit);
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
index 0b00091d2ae9..a4c02751af4e 100644
--- a/drivers/usb/storage/shuttle_usbat.c
+++ b/drivers/usb/storage/shuttle_usbat.c
@@ -1865,15 +1865,4 @@ static struct usb_driver usbat_driver = {
1865 .soft_unbind = 1, 1865 .soft_unbind = 1,
1866}; 1866};
1867 1867
1868static int __init usbat_init(void) 1868module_usb_driver(usbat_driver);
1869{
1870 return usb_register(&usbat_driver);
1871}
1872
1873static void __exit usbat_exit(void)
1874{
1875 usb_deregister(&usbat_driver);
1876}
1877
1878module_init(usbat_init);
1879module_exit(usbat_exit);
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 1d10d5b8204c..a33ead5dce20 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -760,18 +760,7 @@ static struct usb_driver uas_driver = {
760 .id_table = uas_usb_ids, 760 .id_table = uas_usb_ids,
761}; 761};
762 762
763static int uas_init(void) 763module_usb_driver(uas_driver);
764{
765 return usb_register(&uas_driver);
766}
767
768static void uas_exit(void)
769{
770 usb_deregister(&uas_driver);
771}
772
773module_init(uas_init);
774module_exit(uas_exit);
775 764
776MODULE_LICENSE("GPL"); 765MODULE_LICENSE("GPL");
777MODULE_AUTHOR("Matthew Wilcox and Sarah Sharp"); 766MODULE_AUTHOR("Matthew Wilcox and Sarah Sharp");
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 32d6fc953904..5c6c1bdbd455 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -688,25 +688,6 @@ static struct usb_driver skel_driver = {
688 .supports_autosuspend = 1, 688 .supports_autosuspend = 1,
689}; 689};
690 690
691static int __init usb_skel_init(void) 691module_usb_driver(skel_driver);
692{
693 int result;
694
695 /* register this driver with the USB subsystem */
696 result = usb_register(&skel_driver);
697 if (result)
698 err("usb_register failed. Error number %d", result);
699
700 return result;
701}
702
703static void __exit usb_skel_exit(void)
704{
705 /* deregister this driver with the USB subsystem */
706 usb_deregister(&skel_driver);
707}
708
709module_init(usb_skel_init);
710module_exit(usb_skel_exit);
711 692
712MODULE_LICENSE("GPL"); 693MODULE_LICENSE("GPL");
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c
index 200fd7c6c7d5..7f78f300f8fb 100644
--- a/drivers/usb/wusbcore/cbaf.c
+++ b/drivers/usb/wusbcore/cbaf.c
@@ -655,17 +655,7 @@ static struct usb_driver cbaf_driver = {
655 .disconnect = cbaf_disconnect, 655 .disconnect = cbaf_disconnect,
656}; 656};
657 657
658static int __init cbaf_driver_init(void) 658module_usb_driver(cbaf_driver);
659{
660 return usb_register(&cbaf_driver);
661}
662module_init(cbaf_driver_init);
663
664static void __exit cbaf_driver_exit(void)
665{
666 usb_deregister(&cbaf_driver);
667}
668module_exit(cbaf_driver_exit);
669 659
670MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 660MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
671MODULE_DESCRIPTION("Wireless USB Cable Based Association"); 661MODULE_DESCRIPTION("Wireless USB Cable Based Association");
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 2babcd4fbfc1..66797e9c5010 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -914,17 +914,7 @@ static struct usb_driver hwarc_driver = {
914 .post_reset = hwarc_post_reset, 914 .post_reset = hwarc_post_reset,
915}; 915};
916 916
917static int __init hwarc_driver_init(void) 917module_usb_driver(hwarc_driver);
918{
919 return usb_register(&hwarc_driver);
920}
921module_init(hwarc_driver_init);
922
923static void __exit hwarc_driver_exit(void)
924{
925 usb_deregister(&hwarc_driver);
926}
927module_exit(hwarc_driver_exit);
928 918
929MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 919MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
930MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver"); 920MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver");
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index ba8664328afa..c8f684833d58 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -451,25 +451,7 @@ static struct usb_driver i1480_dfu_driver = {
451 .disconnect = NULL, 451 .disconnect = NULL,
452}; 452};
453 453
454 454module_usb_driver(i1480_dfu_driver);
455/*
456 * Initialize the i1480 DFU driver.
457 *
458 * We also need to register our function for guessing event sizes.
459 */
460static int __init i1480_dfu_driver_init(void)
461{
462 return usb_register(&i1480_dfu_driver);
463}
464module_init(i1480_dfu_driver_init);
465
466
467static void __exit i1480_dfu_driver_exit(void)
468{
469 usb_deregister(&i1480_dfu_driver);
470}
471module_exit(i1480_dfu_driver_exit);
472
473 455
474MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 456MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
475MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB"); 457MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB");
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
index aaccffac67ab..3c22994ea31a 100644
--- a/drivers/video/smscufx.c
+++ b/drivers/video/smscufx.c
@@ -1792,24 +1792,7 @@ static struct usb_driver ufx_driver = {
1792 .id_table = id_table, 1792 .id_table = id_table,
1793}; 1793};
1794 1794
1795static int __init ufx_module_init(void) 1795module_usb_driver(ufx_driver);
1796{
1797 int res;
1798
1799 res = usb_register(&ufx_driver);
1800 if (res)
1801 err("usb_register failed. Error number %d", res);
1802
1803 return res;
1804}
1805
1806static void __exit ufx_module_exit(void)
1807{
1808 usb_deregister(&ufx_driver);
1809}
1810
1811module_init(ufx_module_init);
1812module_exit(ufx_module_exit);
1813 1796
1814static void ufx_urb_completion(struct urb *urb) 1797static void ufx_urb_completion(struct urb *urb)
1815{ 1798{
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 3473e75ce785..1f868d0187a2 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1761,24 +1761,7 @@ static struct usb_driver dlfb_driver = {
1761 .id_table = id_table, 1761 .id_table = id_table,
1762}; 1762};
1763 1763
1764static int __init dlfb_module_init(void) 1764module_usb_driver(dlfb_driver);
1765{
1766 int res;
1767
1768 res = usb_register(&dlfb_driver);
1769 if (res)
1770 err("usb_register failed. Error number %d", res);
1771
1772 return res;
1773}
1774
1775static void __exit dlfb_module_exit(void)
1776{
1777 usb_deregister(&dlfb_driver);
1778}
1779
1780module_init(dlfb_module_init);
1781module_exit(dlfb_module_exit);
1782 1765
1783static void dlfb_urb_completion(struct urb *urb) 1766static void dlfb_urb_completion(struct urb *urb)
1784{ 1767{
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index b5abaae38e97..4f7e1d770f81 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -1002,26 +1002,7 @@ static void ds_disconnect(struct usb_interface *intf)
1002 kfree(dev); 1002 kfree(dev);
1003} 1003}
1004 1004
1005static int ds_init(void) 1005module_usb_driver(ds_driver);
1006{
1007 int err;
1008
1009 err = usb_register(&ds_driver);
1010 if (err) {
1011 printk(KERN_INFO "Failed to register DS9490R USB device: err=%d.\n", err);
1012 return err;
1013 }
1014
1015 return 0;
1016}
1017
1018static void ds_fini(void)
1019{
1020 usb_deregister(&ds_driver);
1021}
1022
1023module_init(ds_init);
1024module_exit(ds_fini);
1025 1006
1026MODULE_LICENSE("GPL"); 1007MODULE_LICENSE("GPL");
1027MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 1008MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index a1ef9b5b38cf..ff29ae747ee8 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -175,11 +175,13 @@ static ssize_t w1_therm_read(struct device *device,
175{ 175{
176 struct w1_slave *sl = dev_to_w1_slave(device); 176 struct w1_slave *sl = dev_to_w1_slave(device);
177 struct w1_master *dev = sl->master; 177 struct w1_master *dev = sl->master;
178 u8 rom[9], crc, verdict; 178 u8 rom[9], crc, verdict, external_power;
179 int i, max_trying = 10; 179 int i, max_trying = 10;
180 ssize_t c = PAGE_SIZE; 180 ssize_t c = PAGE_SIZE;
181 181
182 mutex_lock(&dev->mutex); 182 i = mutex_lock_interruptible(&dev->mutex);
183 if (i != 0)
184 return i;
183 185
184 memset(rom, 0, sizeof(rom)); 186 memset(rom, 0, sizeof(rom));
185 187
@@ -190,13 +192,37 @@ static ssize_t w1_therm_read(struct device *device,
190 if (!w1_reset_select_slave(sl)) { 192 if (!w1_reset_select_slave(sl)) {
191 int count = 0; 193 int count = 0;
192 unsigned int tm = 750; 194 unsigned int tm = 750;
195 unsigned long sleep_rem;
196
197 w1_write_8(dev, W1_READ_PSUPPLY);
198 external_power = w1_read_8(dev);
199
200 if (w1_reset_select_slave(sl))
201 continue;
193 202
194 /* 750ms strong pullup (or delay) after the convert */ 203 /* 750ms strong pullup (or delay) after the convert */
195 if (w1_strong_pullup) 204 if (!external_power && w1_strong_pullup)
196 w1_next_pullup(dev, tm); 205 w1_next_pullup(dev, tm);
206
197 w1_write_8(dev, W1_CONVERT_TEMP); 207 w1_write_8(dev, W1_CONVERT_TEMP);
198 if (!w1_strong_pullup) 208
199 msleep(tm); 209 if (external_power) {
210 mutex_unlock(&dev->mutex);
211
212 sleep_rem = msleep_interruptible(tm);
213 if (sleep_rem != 0)
214 return -EINTR;
215
216 i = mutex_lock_interruptible(&dev->mutex);
217 if (i != 0)
218 return i;
219 } else if (!w1_strong_pullup) {
220 sleep_rem = msleep_interruptible(tm);
221 if (sleep_rem != 0) {
222 mutex_unlock(&dev->mutex);
223 return -EINTR;
224 }
225 }
200 226
201 if (!w1_reset_select_slave(sl)) { 227 if (!w1_reset_select_slave(sl)) {
202 228
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index c37497823851..9761950697b4 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -892,6 +892,16 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
892 break; 892 break;
893 } 893 }
894 894
895 /* Do fast search on single slave bus */
896 if (dev->max_slave_count == 1) {
897 w1_write_8(dev, W1_READ_ROM);
898
899 if (w1_read_block(dev, (u8 *)&rn, 8) == 8 && rn)
900 cb(dev, rn);
901
902 break;
903 }
904
895 /* Start the search */ 905 /* Start the search */
896 w1_write_8(dev, search_type); 906 w1_write_8(dev, search_type);
897 for (i = 0; i < 64; ++i) { 907 for (i = 0; i < 64; ++i) {
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 748a74bd85e7..d8de1ddd176a 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -827,37 +827,4 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
827 printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); 827 printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
828} 828}
829 829
830 830module_usb_driver(usb_pcwd_driver);
831
832/**
833 * usb_pcwd_init
834 */
835static int __init usb_pcwd_init(void)
836{
837 int result;
838
839 /* register this driver with the USB subsystem */
840 result = usb_register(&usb_pcwd_driver);
841 if (result) {
842 printk(KERN_ERR PFX "usb_register failed. Error number %d\n",
843 result);
844 return result;
845 }
846
847 printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION "\n");
848 return 0;
849}
850
851
852/**
853 * usb_pcwd_exit
854 */
855static void __exit usb_pcwd_exit(void)
856{
857 /* deregister this driver with the USB subsystem */
858 usb_deregister(&usb_pcwd_driver);
859}
860
861
862module_init(usb_pcwd_init);
863module_exit(usb_pcwd_exit);
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
index 9cc2259c9992..3832e303c33a 100644
--- a/drivers/xen/xen-balloon.c
+++ b/drivers/xen/xen-balloon.c
@@ -32,7 +32,6 @@
32 32
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/sysdev.h>
36#include <linux/capability.h> 35#include <linux/capability.h>
37 36
38#include <xen/xen.h> 37#include <xen/xen.h>
@@ -46,9 +45,9 @@
46 45
47#define BALLOON_CLASS_NAME "xen_memory" 46#define BALLOON_CLASS_NAME "xen_memory"
48 47
49static struct sys_device balloon_sysdev; 48static struct device balloon_dev;
50 49
51static int register_balloon(struct sys_device *sysdev); 50static int register_balloon(struct device *dev);
52 51
53/* React to a change in the target key */ 52/* React to a change in the target key */
54static void watch_target(struct xenbus_watch *watch, 53static void watch_target(struct xenbus_watch *watch,
@@ -98,9 +97,9 @@ static int __init balloon_init(void)
98 97
99 pr_info("xen-balloon: Initialising balloon driver.\n"); 98 pr_info("xen-balloon: Initialising balloon driver.\n");
100 99
101 register_balloon(&balloon_sysdev); 100 register_balloon(&balloon_dev);
102 101
103 register_xen_selfballooning(&balloon_sysdev); 102 register_xen_selfballooning(&balloon_dev);
104 103
105 register_xenstore_notifier(&xenstore_notifier); 104 register_xenstore_notifier(&xenstore_notifier);
106 105
@@ -117,31 +116,31 @@ static void balloon_exit(void)
117module_exit(balloon_exit); 116module_exit(balloon_exit);
118 117
119#define BALLOON_SHOW(name, format, args...) \ 118#define BALLOON_SHOW(name, format, args...) \
120 static ssize_t show_##name(struct sys_device *dev, \ 119 static ssize_t show_##name(struct device *dev, \
121 struct sysdev_attribute *attr, \ 120 struct device_attribute *attr, \
122 char *buf) \ 121 char *buf) \
123 { \ 122 { \
124 return sprintf(buf, format, ##args); \ 123 return sprintf(buf, format, ##args); \
125 } \ 124 } \
126 static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) 125 static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
127 126
128BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); 127BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
129BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); 128BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
130BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high)); 129BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high));
131 130
132static SYSDEV_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay); 131static DEVICE_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay);
133static SYSDEV_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay); 132static DEVICE_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay);
134static SYSDEV_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count); 133static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count);
135static SYSDEV_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count); 134static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count);
136 135
137static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr, 136static ssize_t show_target_kb(struct device *dev, struct device_attribute *attr,
138 char *buf) 137 char *buf)
139{ 138{
140 return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages)); 139 return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
141} 140}
142 141
143static ssize_t store_target_kb(struct sys_device *dev, 142static ssize_t store_target_kb(struct device *dev,
144 struct sysdev_attribute *attr, 143 struct device_attribute *attr,
145 const char *buf, 144 const char *buf,
146 size_t count) 145 size_t count)
147{ 146{
@@ -158,11 +157,11 @@ static ssize_t store_target_kb(struct sys_device *dev,
158 return count; 157 return count;
159} 158}
160 159
161static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR, 160static DEVICE_ATTR(target_kb, S_IRUGO | S_IWUSR,
162 show_target_kb, store_target_kb); 161 show_target_kb, store_target_kb);
163 162
164 163
165static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr, 164static ssize_t show_target(struct device *dev, struct device_attribute *attr,
166 char *buf) 165 char *buf)
167{ 166{
168 return sprintf(buf, "%llu\n", 167 return sprintf(buf, "%llu\n",
@@ -170,8 +169,8 @@ static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr
170 << PAGE_SHIFT); 169 << PAGE_SHIFT);
171} 170}
172 171
173static ssize_t store_target(struct sys_device *dev, 172static ssize_t store_target(struct device *dev,
174 struct sysdev_attribute *attr, 173 struct device_attribute *attr,
175 const char *buf, 174 const char *buf,
176 size_t count) 175 size_t count)
177{ 176{
@@ -188,23 +187,23 @@ static ssize_t store_target(struct sys_device *dev,
188 return count; 187 return count;
189} 188}
190 189
191static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR, 190static DEVICE_ATTR(target, S_IRUGO | S_IWUSR,
192 show_target, store_target); 191 show_target, store_target);
193 192
194 193
195static struct sysdev_attribute *balloon_attrs[] = { 194static struct device_attribute *balloon_attrs[] = {
196 &attr_target_kb, 195 &dev_attr_target_kb,
197 &attr_target, 196 &dev_attr_target,
198 &attr_schedule_delay.attr, 197 &dev_attr_schedule_delay.attr,
199 &attr_max_schedule_delay.attr, 198 &dev_attr_max_schedule_delay.attr,
200 &attr_retry_count.attr, 199 &dev_attr_retry_count.attr,
201 &attr_max_retry_count.attr 200 &dev_attr_max_retry_count.attr
202}; 201};
203 202
204static struct attribute *balloon_info_attrs[] = { 203static struct attribute *balloon_info_attrs[] = {
205 &attr_current_kb.attr, 204 &dev_attr_current_kb.attr,
206 &attr_low_kb.attr, 205 &dev_attr_low_kb.attr,
207 &attr_high_kb.attr, 206 &dev_attr_high_kb.attr,
208 NULL 207 NULL
209}; 208};
210 209
@@ -213,34 +212,35 @@ static struct attribute_group balloon_info_group = {
213 .attrs = balloon_info_attrs 212 .attrs = balloon_info_attrs
214}; 213};
215 214
216static struct sysdev_class balloon_sysdev_class = { 215static struct bus_type balloon_subsys = {
217 .name = BALLOON_CLASS_NAME 216 .name = BALLOON_CLASS_NAME,
217 .dev_name = BALLOON_CLASS_NAME,
218}; 218};
219 219
220static int register_balloon(struct sys_device *sysdev) 220static int register_balloon(struct device *dev)
221{ 221{
222 int i, error; 222 int i, error;
223 223
224 error = sysdev_class_register(&balloon_sysdev_class); 224 error = bus_register(&balloon_subsys);
225 if (error) 225 if (error)
226 return error; 226 return error;
227 227
228 sysdev->id = 0; 228 dev->id = 0;
229 sysdev->cls = &balloon_sysdev_class; 229 dev->bus = &balloon_subsys;
230 230
231 error = sysdev_register(sysdev); 231 error = device_register(dev);
232 if (error) { 232 if (error) {
233 sysdev_class_unregister(&balloon_sysdev_class); 233 bus_unregister(&balloon_subsys);
234 return error; 234 return error;
235 } 235 }
236 236
237 for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) { 237 for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) {
238 error = sysdev_create_file(sysdev, balloon_attrs[i]); 238 error = device_create_file(dev, balloon_attrs[i]);
239 if (error) 239 if (error)
240 goto fail; 240 goto fail;
241 } 241 }
242 242
243 error = sysfs_create_group(&sysdev->kobj, &balloon_info_group); 243 error = sysfs_create_group(&dev->kobj, &balloon_info_group);
244 if (error) 244 if (error)
245 goto fail; 245 goto fail;
246 246
@@ -248,9 +248,9 @@ static int register_balloon(struct sys_device *sysdev)
248 248
249 fail: 249 fail:
250 while (--i >= 0) 250 while (--i >= 0)
251 sysdev_remove_file(sysdev, balloon_attrs[i]); 251 device_remove_file(dev, balloon_attrs[i]);
252 sysdev_unregister(sysdev); 252 device_unregister(dev);
253 sysdev_class_unregister(&balloon_sysdev_class); 253 bus_unregister(&balloon_subsys);
254 return error; 254 return error;
255} 255}
256 256
diff --git a/drivers/xen/xen-selfballoon.c b/drivers/xen/xen-selfballoon.c
index d93c70857e03..767ff656d5a7 100644
--- a/drivers/xen/xen-selfballoon.c
+++ b/drivers/xen/xen-selfballoon.c
@@ -74,6 +74,7 @@
74#include <linux/mman.h> 74#include <linux/mman.h>
75#include <linux/module.h> 75#include <linux/module.h>
76#include <linux/workqueue.h> 76#include <linux/workqueue.h>
77#include <linux/device.h>
77#include <xen/balloon.h> 78#include <xen/balloon.h>
78#include <xen/tmem.h> 79#include <xen/tmem.h>
79#include <xen/xen.h> 80#include <xen/xen.h>
@@ -266,21 +267,20 @@ static void selfballoon_process(struct work_struct *work)
266 267
267#ifdef CONFIG_SYSFS 268#ifdef CONFIG_SYSFS
268 269
269#include <linux/sysdev.h>
270#include <linux/capability.h> 270#include <linux/capability.h>
271 271
272#define SELFBALLOON_SHOW(name, format, args...) \ 272#define SELFBALLOON_SHOW(name, format, args...) \
273 static ssize_t show_##name(struct sys_device *dev, \ 273 static ssize_t show_##name(struct device *dev, \
274 struct sysdev_attribute *attr, \ 274 struct device_attribute *attr, \
275 char *buf) \ 275 char *buf) \
276 { \ 276 { \
277 return sprintf(buf, format, ##args); \ 277 return sprintf(buf, format, ##args); \
278 } 278 }
279 279
280SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled); 280SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled);
281 281
282static ssize_t store_selfballooning(struct sys_device *dev, 282static ssize_t store_selfballooning(struct device *dev,
283 struct sysdev_attribute *attr, 283 struct device_attribute *attr,
284 const char *buf, 284 const char *buf,
285 size_t count) 285 size_t count)
286{ 286{
@@ -303,13 +303,13 @@ static ssize_t store_selfballooning(struct sys_device *dev,
303 return count; 303 return count;
304} 304}
305 305
306static SYSDEV_ATTR(selfballooning, S_IRUGO | S_IWUSR, 306static DEVICE_ATTR(selfballooning, S_IRUGO | S_IWUSR,
307 show_selfballooning, store_selfballooning); 307 show_selfballooning, store_selfballooning);
308 308
309SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval); 309SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval);
310 310
311static ssize_t store_selfballoon_interval(struct sys_device *dev, 311static ssize_t store_selfballoon_interval(struct device *dev,
312 struct sysdev_attribute *attr, 312 struct device_attribute *attr,
313 const char *buf, 313 const char *buf,
314 size_t count) 314 size_t count)
315{ 315{
@@ -325,13 +325,13 @@ static ssize_t store_selfballoon_interval(struct sys_device *dev,
325 return count; 325 return count;
326} 326}
327 327
328static SYSDEV_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR, 328static DEVICE_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR,
329 show_selfballoon_interval, store_selfballoon_interval); 329 show_selfballoon_interval, store_selfballoon_interval);
330 330
331SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis); 331SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis);
332 332
333static ssize_t store_selfballoon_downhys(struct sys_device *dev, 333static ssize_t store_selfballoon_downhys(struct device *dev,
334 struct sysdev_attribute *attr, 334 struct device_attribute *attr,
335 const char *buf, 335 const char *buf,
336 size_t count) 336 size_t count)
337{ 337{
@@ -347,14 +347,14 @@ static ssize_t store_selfballoon_downhys(struct sys_device *dev,
347 return count; 347 return count;
348} 348}
349 349
350static SYSDEV_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR, 350static DEVICE_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR,
351 show_selfballoon_downhys, store_selfballoon_downhys); 351 show_selfballoon_downhys, store_selfballoon_downhys);
352 352
353 353
354SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis); 354SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis);
355 355
356static ssize_t store_selfballoon_uphys(struct sys_device *dev, 356static ssize_t store_selfballoon_uphys(struct device *dev,
357 struct sysdev_attribute *attr, 357 struct device_attribute *attr,
358 const char *buf, 358 const char *buf,
359 size_t count) 359 size_t count)
360{ 360{
@@ -370,14 +370,14 @@ static ssize_t store_selfballoon_uphys(struct sys_device *dev,
370 return count; 370 return count;
371} 371}
372 372
373static SYSDEV_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR, 373static DEVICE_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR,
374 show_selfballoon_uphys, store_selfballoon_uphys); 374 show_selfballoon_uphys, store_selfballoon_uphys);
375 375
376SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n", 376SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n",
377 selfballoon_min_usable_mb); 377 selfballoon_min_usable_mb);
378 378
379static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev, 379static ssize_t store_selfballoon_min_usable_mb(struct device *dev,
380 struct sysdev_attribute *attr, 380 struct device_attribute *attr,
381 const char *buf, 381 const char *buf,
382 size_t count) 382 size_t count)
383{ 383{
@@ -393,7 +393,7 @@ static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev,
393 return count; 393 return count;
394} 394}
395 395
396static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR, 396static DEVICE_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR,
397 show_selfballoon_min_usable_mb, 397 show_selfballoon_min_usable_mb,
398 store_selfballoon_min_usable_mb); 398 store_selfballoon_min_usable_mb);
399 399
@@ -401,8 +401,8 @@ static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR,
401#ifdef CONFIG_FRONTSWAP 401#ifdef CONFIG_FRONTSWAP
402SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking); 402SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking);
403 403
404static ssize_t store_frontswap_selfshrinking(struct sys_device *dev, 404static ssize_t store_frontswap_selfshrinking(struct device *dev,
405 struct sysdev_attribute *attr, 405 struct device_attribute *attr,
406 const char *buf, 406 const char *buf,
407 size_t count) 407 size_t count)
408{ 408{
@@ -424,13 +424,13 @@ static ssize_t store_frontswap_selfshrinking(struct sys_device *dev,
424 return count; 424 return count;
425} 425}
426 426
427static SYSDEV_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR, 427static DEVICE_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR,
428 show_frontswap_selfshrinking, store_frontswap_selfshrinking); 428 show_frontswap_selfshrinking, store_frontswap_selfshrinking);
429 429
430SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia); 430SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia);
431 431
432static ssize_t store_frontswap_inertia(struct sys_device *dev, 432static ssize_t store_frontswap_inertia(struct device *dev,
433 struct sysdev_attribute *attr, 433 struct device_attribute *attr,
434 const char *buf, 434 const char *buf,
435 size_t count) 435 size_t count)
436{ 436{
@@ -447,13 +447,13 @@ static ssize_t store_frontswap_inertia(struct sys_device *dev,
447 return count; 447 return count;
448} 448}
449 449
450static SYSDEV_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR, 450static DEVICE_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR,
451 show_frontswap_inertia, store_frontswap_inertia); 451 show_frontswap_inertia, store_frontswap_inertia);
452 452
453SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis); 453SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis);
454 454
455static ssize_t store_frontswap_hysteresis(struct sys_device *dev, 455static ssize_t store_frontswap_hysteresis(struct device *dev,
456 struct sysdev_attribute *attr, 456 struct device_attribute *attr,
457 const char *buf, 457 const char *buf,
458 size_t count) 458 size_t count)
459{ 459{
@@ -469,21 +469,21 @@ static ssize_t store_frontswap_hysteresis(struct sys_device *dev,
469 return count; 469 return count;
470} 470}
471 471
472static SYSDEV_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR, 472static DEVICE_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR,
473 show_frontswap_hysteresis, store_frontswap_hysteresis); 473 show_frontswap_hysteresis, store_frontswap_hysteresis);
474 474
475#endif /* CONFIG_FRONTSWAP */ 475#endif /* CONFIG_FRONTSWAP */
476 476
477static struct attribute *selfballoon_attrs[] = { 477static struct attribute *selfballoon_attrs[] = {
478 &attr_selfballooning.attr, 478 &dev_attr_selfballooning.attr,
479 &attr_selfballoon_interval.attr, 479 &dev_attr_selfballoon_interval.attr,
480 &attr_selfballoon_downhysteresis.attr, 480 &dev_attr_selfballoon_downhysteresis.attr,
481 &attr_selfballoon_uphysteresis.attr, 481 &dev_attr_selfballoon_uphysteresis.attr,
482 &attr_selfballoon_min_usable_mb.attr, 482 &dev_attr_selfballoon_min_usable_mb.attr,
483#ifdef CONFIG_FRONTSWAP 483#ifdef CONFIG_FRONTSWAP
484 &attr_frontswap_selfshrinking.attr, 484 &dev_attr_frontswap_selfshrinking.attr,
485 &attr_frontswap_hysteresis.attr, 485 &dev_attr_frontswap_hysteresis.attr,
486 &attr_frontswap_inertia.attr, 486 &dev_attr_frontswap_inertia.attr,
487#endif 487#endif
488 NULL 488 NULL
489}; 489};
@@ -494,12 +494,12 @@ static struct attribute_group selfballoon_group = {
494}; 494};
495#endif 495#endif
496 496
497int register_xen_selfballooning(struct sys_device *sysdev) 497int register_xen_selfballooning(struct device *dev)
498{ 498{
499 int error = -1; 499 int error = -1;
500 500
501#ifdef CONFIG_SYSFS 501#ifdef CONFIG_SYSFS
502 error = sysfs_create_group(&sysdev->kobj, &selfballoon_group); 502 error = sysfs_create_group(&dev->kobj, &selfballoon_group);
503#endif 503#endif
504 return error; 504 return error;
505} 505}