From linas@austin.ibm.com Tue Dec 12 14:56:11 2006 From: Linas Vepstas Date: Tue, 12 Dec 2006 16:55:59 -0600 To: gregkh@suse.de, akpm@osdl.org Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz Subject: PCI: define inline for test of channel error state Message-ID: <20061212225559.GL4329@austin.ibm.com> MIME-Version: 1.0 From: Linas Vepstas Add very simple routine to indicate the pci channel error state. Signed-off-by: Linas Vepstas Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 5 +++++ 1 file changed, 5 insertions(+) --- gregkh-2.6.orig/include/linux/pci.h +++ gregkh-2.6/include/linux/pci.h @@ -181,6 +181,11 @@ struct pci_dev { #define to_pci_dev(n) container_of(n, struct pci_dev, dev) #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) +static inline int pci_channel_offline(struct pci_dev *pdev) +{ + return (pdev->error_state != pci_channel_io_normal); +} + static inline struct pci_cap_saved_state *pci_find_saved_cap( struct pci_dev *pci_dev,char cap) {