Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126724
b: refs/heads/master
c: d72187b
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 6, 2009
1 parent eadc112 commit 933d4fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d62a12bb0fde6a70eb18e2ba25e48f6fd5eee07
refs/heads/master: d72187b7cd4bac8eb9f87cabbb8d537145dc4bad
15 changes: 4 additions & 11 deletions trunk/drivers/staging/comedi/drivers/comedi_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@
#ifndef _COMEDI_PCI_H_
#define _COMEDI_PCI_H_

#include <linux/version.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
* for pci_enable_device().
Expand All @@ -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)
{
#ifdef PCI_ENABLE_IS_REFCOUNTED
pci_disable_device(pdev);
#endif
}

/*
Expand All @@ -65,13 +58,13 @@ static inline int comedi_pci_enable(struct pci_dev *pdev, const char *res_name)
int rc;

rc = pci_enable_device(pdev);
if (rc < 0) {
if (rc < 0)
return rc;
}

rc = pci_request_regions(pdev, res_name);
if (rc < 0) {
if (rc < 0)
comedi_pci_disable_no_regions(pdev);
}

return rc;
}

Expand Down

0 comments on commit 933d4fe

Please sign in to comment.