Commit d72187b7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: comedi: fix comedi_pci.h checkpatch.pl issues.

This resolves all the resolvable checkpatch.pl issues in the
comedi_pci.h file.

Cc: David Schleef <ds@schleef.org>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6d62a12b
...@@ -26,13 +26,8 @@ ...@@ -26,13 +26,8 @@
#ifndef _COMEDI_PCI_H_ #ifndef _COMEDI_PCI_H_
#define _COMEDI_PCI_H_ #define _COMEDI_PCI_H_
#include <linux/version.h>
#include <linux/pci.h> #include <linux/pci.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
#define PCI_ENABLE_IS_REFCOUNTED
#endif
/* /*
* Enables PCI device without requesting regions. Just a simple wrapper * Enables PCI device without requesting regions. Just a simple wrapper
* for pci_enable_device(). * for pci_enable_device().
...@@ -52,9 +47,7 @@ static inline int comedi_pci_enable_no_regions(struct pci_dev *pdev) ...@@ -52,9 +47,7 @@ static inline int comedi_pci_enable_no_regions(struct pci_dev *pdev)
*/ */
static inline void comedi_pci_disable_no_regions(struct pci_dev *pdev) static inline void comedi_pci_disable_no_regions(struct pci_dev *pdev)
{ {
#ifdef PCI_ENABLE_IS_REFCOUNTED
pci_disable_device(pdev); pci_disable_device(pdev);
#endif
} }
/* /*
...@@ -65,13 +58,13 @@ static inline int comedi_pci_enable(struct pci_dev *pdev, const char *res_name) ...@@ -65,13 +58,13 @@ static inline int comedi_pci_enable(struct pci_dev *pdev, const char *res_name)
int rc; int rc;
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc < 0) { if (rc < 0)
return rc; return rc;
}
rc = pci_request_regions(pdev, res_name); rc = pci_request_regions(pdev, res_name);
if (rc < 0) { if (rc < 0)
comedi_pci_disable_no_regions(pdev); comedi_pci_disable_no_regions(pdev);
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment