drivercore: revert addition of of_match to struct device
authorGrant Likely <grant.likely@secretlab.ca>
Wed, 18 May 2011 17:19:24 +0000 (11:19 -0600)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 18 May 2011 18:32:23 +0000 (12:32 -0600)
commitb1608d69cb804e414d0887140ba08a9398e4e638
tree8999cd827e7fb4138ff83f7829d8fdcf44ee653d
parent01294d82622d6d9d64bde8e4530c7e2c6dbb6ee6
drivercore: revert addition of of_match to struct device

Commit b826291c, "drivercore/dt: add a match table pointer to struct
device" added an of_match pointer to struct device to cache the
of_match_table entry discovered at driver match time.  This was unsafe
because matching is not an atomic operation with probing a driver.  If
two or more drivers are attempted to be matched to a driver at the
same time, then the cached matching entry pointer could get
overwritten.

This patch reverts the of_match cache pointer and reworks all users to
call of_match_device() directly instead.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
22 files changed:
arch/powerpc/platforms/83xx/suspend.c
arch/powerpc/sysdev/fsl_msi.c
arch/sparc/kernel/pci_sabre.c
arch/sparc/kernel/pci_schizo.c
drivers/atm/fore200e.c
drivers/char/hw_random/n2-drv.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/xilinx_hwicap/xilinx_hwicap.c
drivers/edac/ppc4xx_edac.c
drivers/i2c/busses/i2c-mpc.c
drivers/mmc/host/sdhci-of-core.c
drivers/mtd/maps/physmap_of.c
drivers/net/can/mscan/mpc5xxx_can.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mii-fec.c
drivers/net/sunhme.c
drivers/scsi/qlogicpti.c
drivers/tty/serial/of_serial.c
drivers/usb/gadget/fsl_qe_udc.c
drivers/watchdog/mpc8xxx_wdt.c
include/linux/device.h
include/linux/of_device.h