From: Ian Abbott Date: Fri, 15 Mar 2013 13:39:52 +0000 (+0000) Subject: staging: comedi: ni_labpc: fix common detach X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~137^2~584 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a14592896023adcab12307774c89284ce0744ce2;p=pandora-kernel.git staging: comedi: ni_labpc: fix common detach `labpc_common_detach()` calls `comedi_pci_disable()` unconditionally. That's okay for PCI devices and harmless for ISA devices (as the `hw_dev` member will be NULL so `comedi_to_pci_dev()` will return NULL and `comedi_pci_disable()` checks for that), but it is disastrous for PCMCIA devices. Those are managed by the "ni_labpc_cs" module but it calls this `labpc_common_detach()` and the `hw_dev` member will be pointing to the `struct device` embedded in a `struct pcmcia_device` in that case. That's enough to confuse `comedi_pci_disable()` into thinking it's a valid PCI device to be disabled. Use the private board information (`thisboard`) to make sure it is a PCI device before calling `comedi_pci_disable()`. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed