Some of modules have no MODULE_DEVICE_TABLE(...) and do not export hardware ("pnp") aliases, but have all required data to do this. I found it after ioatdma module (currently fixed in tree). This information may be useful to hardware/modules detection. But, I think, some of vendors|developers have other reasons to not publish this info (for example, on Linbits exists reports about data loss statistics for dma engine, but now fixed anymore). But I simplifyed think, all hardware must be detected by default. There are patch script attached to scan & add MODULE_DEVICE_TABLE() into this modules (usage: "./modulesfix <path_to_kernel>"). This script may be used in any way, related to maintainers' look. This is list of fixes for 2.6.35-r1: === Fixing: OF: (amd7930_match) sound/sparc/amd7930.c Fixing: platform: (fsi_id_table) sound/soc/sh/fsi.c Fixing: I2C: (lm4857_i2c_id) sound/soc/s3c24xx/neo1973_wm8753.c Fixing: I2C: (tlv320dac33_i2c_id) sound/soc/codecs/tlv320dac33.c Fixing: I2C: (tas_i2c_id) sound/aoa/codecs/tas.c Fixing: I2C: (onyx_i2c_id) sound/aoa/codecs/onyx.c Fixing: HID: (hidp_table) net/bluetooth/hidp/core.c Fixing: PNP: (scl200wdt_pnp_devices) drivers/watchdog/sc1200wdt.c Fixing: OF: (gef_wdt_ids) drivers/watchdog/gef_wdt.c Fixing: I2C: (ds2482_id) drivers/w1/masters/ds2482.c Fixing: xenbus: (xenfb_ids) drivers/video/xen-fbfront.c Fixing: PCI: (vml_ids) drivers/video/vermilion/vermilion.c Fixing: PCI: (e3d_pci_table) drivers/video/sunxvr500.c Fixing: PCI: (s3d_pci_table) drivers/video/sunxvr2500.c Fixing: PCI: (sstfb_id_tbl) drivers/video/sstfb.c Fixing: OF: (platinumfb_match) drivers/video/platinumfb.c Fixing: PCI: (i810fb_pci_tbl) drivers/video/i810/i810_main.c Fixing: DIO: (hpfb_dio_tbl) drivers/video/hpfb.c Fixing: I2C: (tosa_bl_id) drivers/video/backlight/tosa_bl.c Fixing: USB: (xusbatm_usb_ids) drivers/usb/atm/xusbatm.c Fixing: PCI: (sercos3_pci_ids) drivers/uio/uio_sercos3.c Fixing: PCI: (tsi148_ids) drivers/staging/vme/bridges/vme_tsi148.c Fixing: PCI: (ca91cx42_ids) drivers/staging/vme/bridges/vme_ca91cx42.c Fixing: PCI: (vmic_ids) drivers/staging/vme/boards/vme_vmivme7805.c Fixing: USB: (tm6000_id_table) drivers/staging/tm6000/tm6000-cards.c Fixing: PCI: (smtcfb_pci_table) drivers/staging/sm7xx/smtcfb.c Fixing: I2C: (hmdi_sii_id) drivers/staging/msm/lcdc_st15.c Fixing: I2C: (hmdi_sii_id) drivers/staging/msm/hdmi_sii9022.c Fixing: SPI: (adis16350_id) drivers/staging/iio/imu/adis16350_core.c Fixing: I2C: (wis_uda1342_id) drivers/staging/go7007/wis-uda1342.c Fixing: I2C: (wis_tw9903_id) drivers/staging/go7007/wis-tw9903.c Fixing: I2C: (wis_tw2804_id) drivers/staging/go7007/wis-tw2804.c Fixing: I2C: (wis_sony_tuner_id) drivers/staging/go7007/wis-sony-tuner.c Fixing: I2C: (wis_saa7115_id) drivers/staging/go7007/wis-saa7115.c Fixing: I2C: (wis_saa7113_id) drivers/staging/go7007/wis-saa7113.c Fixing: I2C: (wis_ov7640_id) drivers/staging/go7007/wis-ov7640.c Fixing: I2C: (synaptics_ts_id) drivers/staging/dream/synaptics_i2c_rmi.c Fixing: I2C: (s5k3e2fx_i2c_id) drivers/staging/dream/camera/s5k3e2fx.c Fixing: I2C: (mt9t013_i2c_id) drivers/staging/dream/camera/mt9t013.c Fixing: I2C: (mt9p012_i2c_id) drivers/staging/dream/camera/mt9p012_fox.c Fixing: I2C: (mt9d112_i2c_id) drivers/staging/dream/camera/mt9d112.c Fixing: PCI: (pci_ids) drivers/spi/dw_spi_pci.c Fixing: OF: (__devinitdataof_platform_serial_table) drivers/serial/of_serial.c Fixing: OF: (cpm_uart_match) drivers/serial/cpm_uart/cpm_uart_core.c Fixing: OF: (__initdataapbuart_match) drivers/serial/apbuart.c Fixing: DIO: (hpdca_dio_tbl) drivers/serial/8250_hp300.c Fixing: CCW: (raw3270_id) drivers/s390/char/raw3270.c Fixing: CCW: (raw3215_id) drivers/s390/char/con3215.c Fixing: OF: (mpc5121_rtc_match) drivers/rtc/rtc-mpc5121.c Fixing: I2C: (max6900_id) drivers/rtc/rtc-max6900.c Fixing: I2C: (ds1672_id) drivers/rtc/rtc-ds1672.c Fixing: I2C: (z2_batt_id) drivers/power/z2_battery.c Fixing: I2C: (ds278x_id) drivers/power/ds2782_battery.c Fixing: I2C: (bq27x00_id) drivers/power/bq27x00_battery.c Fixing: ACPI: (intel_menlow_memory_ids) drivers/platform/x86/intel_menlow.c Fixing: PCI: (ioapic_devices) drivers/pci/ioapic.c Fixing: PCI: (superio_tbl) drivers/parisc/superio.c Fixing: xenbus: (netfront_ids) drivers/net/xen-netfront.c Fixing: RIO: (rionet_id_table) drivers/net/rionet.c Fixing: DIO: (hplance_dio_tbl) drivers/net/hplance.c Fixing: OF: (__devinitdatampc52xx_cdm_ids) drivers/net/can/mscan/mpc5xxx_can.c Fixing: OF: (mpc5121_nfc_match) drivers/mtd/nand/mpc5121_nfc.c Fixing: OF: (fsl_elbc_match) drivers/mtd/nand/fsl_elbc_nand.c Fixing: I2C: (max6875_id) drivers/misc/eeprom/max6875.c Fixing: I2C: (eeprom_id) drivers/misc/eeprom/eeprom.c Fixing: PCI: (stradis_pci_tbl) drivers/media/video/stradis.c Fixing: I2C: (ir_kbd_id) drivers/media/video/ir-kbd-i2c.c Fixing: PCI: (pci_tbl) drivers/media/dvb/ttpci/budget-patch.c Fixing: PCI: (mantis_pci_table) drivers/media/dvb/mantis/mantis_cards.c Fixing: PCI: (hopper_pci_table) drivers/media/dvb/mantis/hopper_cards.c Fixing: I2C: (wf_sat_id) drivers/macintosh/windfarm_smu_sat.c Fixing: I2C: (wf_max6690_id) drivers/macintosh/windfarm_max6690_sensor.c Fixing: I2C: (wf_lm75_id) drivers/macintosh/windfarm_lm75_sensor.c Fixing: I2C: (therm_windtunnel_id) drivers/macintosh/therm_windtunnel.c Fixing: I2C: (therm_pm72_id) drivers/macintosh/therm_pm72.c Fixing: I2C: (therm_adt746x_id) drivers/macintosh/therm_adt746x.c Fixing: OF: (rackmeter_match) drivers/macintosh/rack-meter.c Fixing: OF: (of_gpio_leds_match) drivers/leds/leds-gpio.c Fixing: xenbus: (xenkbd_ids) drivers/input/xen-kbdfront.c Fixing: SERIO: (hil_mlc_serio_id) drivers/input/serio/hil_mlc.c Fixing: OF: (bbc_beep_match) drivers/input/misc/sparcspkr.c Fixing: SERIO: (hil_dev_ids) drivers/input/keyboard/hil_kbd.c Fixing: PNP: (idepnp_devices) drivers/ide/ide-pnp.c BROKEN: pci: drivers/i2c/busses/scx200_acb.c Fixing: OF: (ibm_iic_match) drivers/i2c/busses/i2c-ibm_iic.c Fixing: I2C: (adt7411_id) drivers/hwmon/adt7411.c Fixing: I2C: (ad7414_id) drivers/hwmon/ad7414.c Fixing: HID: (hid_hiddev_list) drivers/hid/hid-core.c Fixing: PCI: (vmw_pci_id_list) drivers/gpu/drm/vmwgfx/vmwgfx_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/via/via_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/tdfx/tdfx_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/sis/sis_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/savage/savage_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/r128/r128_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/mga/mga_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/i830/i830_drv.c Fixing: PCI: (pciidlist) drivers/gpu/drm/i810/i810_drv.c Fixing: OF: (ppc4xx_edac_match) drivers/edac/ppc4xx_edac.c Fixing: OF: (mpc_dma_match) drivers/dma/mpc512x_dma.c Fixing: OF: (crypto4xx_match) drivers/crypto/amcc/crypto4xx_core.c Fixing: INPUT: (sysrq_ids) drivers/char/sysrq.c Fixing: ACPI: (sonypi_device_ids) drivers/char/sonypi.c Fixing: OF: (rng_match) drivers/char/hw_random/pasemi-rng.c Fixing: xenbus: (blkfront_ids) drivers/block/xen-blkfront.c Fixing: OF: (swim3_match) drivers/block/swim3.c Fixing: PCI: (gx_chipset_tbl) arch/x86/kernel/cpu/cpufreq/gx-suspmod.c Fixing: OF: (axon_ram_device_id) arch/powerpc/sysdev/axonram.c Fixing: OF: (pmc_match) arch/powerpc/platforms/83xx/suspend.c Fixing: OF: (mpc52xx_lpbfifo_match) arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c Fixing: ACPI: (aml_nfw_ids) arch/ia64/hp/common/aml_nfw.c === This is cleaned (forced) version (IMHO better), but if you think this verifications is too aggressive - original may be found here: http://raw.googlecode.com/svn/trunk/sys-kernel/genpnprd/files/modulesfix May be suggested other behaviours (like new CONFIG_ variable for this modules, etc). -- WBR, Dzianis Kahanovich AKA Denis Kaganovich, http://mahatma.bspu.unibel.by/
#!/bin/bash ## (c) Denis Kaganovich ## v4 ## grep-pcre required #BUS="pci" BUS="\w+" STR="^(?:static\s+)?(?:const\s+)?struct\s+" fnd(){ grep -Prhl "${STR}${BUS}_device_id\s+" $1 --include="*.c" | while read i ; do local bus=`grep -Prho "${STR}${BUS}_device_id.*\s+" $i` bus="${bus#*struct }" local n="${bus%%[*}" n="${n%%=*}" n="${n##*device_id }" n="${n// }" bus="${bus%%_device_id*}" grep -Pq "^module_init\s*\(" $i || continue grep -q "MODULE_DEVICE_TABLE" $i && continue local ii="${i#$1}" ii="${ii#/}" case $ii in */scx200_acb.c|*/mdio-gpio.c) echo "BROKEN: $bus: $ii" continue ;; esac bus="${bus%%_*}" local BU case "$bus" in sdio)BU=MMC;; *)BU="${bus^^}";; esac if grep -Prq "^\s*(?:menu)?config\s+$BU(?:\s.*)?$" $1 --include="Kconfig*"; then echo "Fixing: $BU: ($n) $ii" sed -i -e 's/^\(module_init.*\)$/\n#ifdef CONFIG_'"$BU"'\nMODULE_DEVICE_TABLE('"$bus, $n"');\n#endif\n\n\1/' $i else echo "Fixing: $bus: ($n) $ii" sed -i -e 's/^\(module_init.*\)$/\nMODULE_DEVICE_TABLE('"$bus, $n"');\n\n\1/' $i fi done } [[ -z "$1" ]] && echo "$0 <path_to_kernel>" && exit 1 fnd $*