Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363445
b: refs/heads/master
c: 7f072f5
h: refs/heads/master
i:
  363443: abff0d8
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Mar 14, 2013
1 parent 5e55435 commit 101b240
Show file tree
Hide file tree
Showing 54 changed files with 83 additions and 277 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: 433121c6ef516e4a55d0dbc4c90d75f7a3084c55
refs/heads/master: 7f072f54ae5dc9965cbe450419b1389d13e2b849
14 changes: 8 additions & 6 deletions trunk/drivers/staging/comedi/comedi_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ EXPORT_SYMBOL_GPL(comedi_pci_enable);

/**
* comedi_pci_disable() - Release the regions and disable the PCI device.
* @pcidev: pci_dev struct
*
* This must be matched with a previous successful call to comedi_pci_enable().
* @dev: comedi_device struct
*/
void comedi_pci_disable(struct pci_dev *pcidev)
void comedi_pci_disable(struct comedi_device *dev)
{
pci_release_regions(pcidev);
pci_disable_device(pcidev);
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev && dev->iobase) {
pci_release_regions(pcidev);
pci_disable_device(pcidev);
}
}
EXPORT_SYMBOL_GPL(comedi_pci_disable);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ struct pci_driver;
struct pci_dev *comedi_to_pci_dev(struct comedi_device *);

int comedi_pci_enable(struct pci_dev *, const char *);
void comedi_pci_disable(struct pci_dev *);
void comedi_pci_disable(struct comedi_device *);

int comedi_pci_auto_config(struct pci_dev *, struct comedi_driver *,
unsigned long context);
Expand Down Expand Up @@ -426,7 +426,7 @@ static inline int comedi_pci_enable(struct pci_dev *dev, const char *name)
return -ENOSYS;
}

static inline void comedi_pci_disable(struct pci_dev *dev)
static inline void comedi_pci_disable(struct comedi_device *dev)
{
}

Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/staging/comedi/drivers/8255_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ static int pci_8255_auto_attach(struct comedi_device *dev,

static void pci_8255_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct pci_8255_boardinfo *board = comedi_board(dev);
struct pci_8255_private *devpriv = dev->private;
struct comedi_subdevice *s;
Expand All @@ -261,12 +260,9 @@ static void pci_8255_detach(struct comedi_device *dev)
subdev_8255_cleanup(dev, s);
}
}
if (pcidev) {
if (devpriv->mmio_base)
iounmap(devpriv->mmio_base);
if (dev->iobase)
comedi_pci_disable(pcidev);
}
if (devpriv->mmio_base)
iounmap(devpriv->mmio_base);
comedi_pci_disable(dev);
}

static struct comedi_driver pci_8255_driver = {
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/staging/comedi/drivers/addi-data/addi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ static int addi_auto_attach(struct comedi_device *dev,

static void i_ADDI_Detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
struct addi_private *devpriv = dev->private;

if (devpriv) {
Expand All @@ -328,8 +327,5 @@ static void i_ADDI_Detach(struct comedi_device *dev)
if (devpriv->dw_AiBase)
iounmap(devpriv->dw_AiBase);
}
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_1032.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,11 @@ static int apci1032_auto_attach(struct comedi_device *dev,

static void apci1032_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
apci1032_reset(dev);
if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci1032_driver = {
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/staging/comedi/drivers/addi_apci_1516.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,11 @@ static int apci1516_auto_attach(struct comedi_device *dev,

static void apci1516_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
apci1516_reset(dev);
if (dev->subdevices)
addi_watchdog_cleanup(&dev->subdevices[2]);
if (dev->iobase)
comedi_pci_disable(pcidev);
comedi_pci_disable(dev);
}

static struct comedi_driver apci1516_driver = {
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/staging/comedi/drivers/addi_apci_16xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,11 @@ static int apci16xx_auto_attach(struct comedi_device *dev,
return 0;
}

static void apci16xx_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
}

static struct comedi_driver apci16xx_driver = {
.driver_name = "addi_apci_16xx",
.module = THIS_MODULE,
.auto_attach = apci16xx_auto_attach,
.detach = apci16xx_detach,
.detach = comedi_pci_disable,
};

static int apci16xx_pci_probe(struct pci_dev *dev,
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,11 @@ static int apci1710_auto_attach(struct comedi_device *dev,

static void apci1710_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
i_APCI1710_Reset(dev);
if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci1710_driver = {
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_2032.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ static int apci2032_auto_attach(struct comedi_device *dev,

static void apci2032_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
apci2032_reset(dev);
if (dev->irq)
Expand All @@ -360,10 +358,7 @@ static void apci2032_detach(struct comedi_device *dev)
kfree(dev->read_subdev->private);
if (dev->subdevices)
addi_watchdog_cleanup(&dev->subdevices[1]);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci2032_driver = {
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,11 @@ static int apci2200_auto_attach(struct comedi_device *dev,

static void apci2200_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
apci2200_reset(dev);
if (dev->subdevices)
addi_watchdog_cleanup(&dev->subdevices[2]);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci2200_driver = {
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/staging/comedi/drivers/addi_apci_3120.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ static int apci3120_auto_attach(struct comedi_device *dev,

static void apci3120_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
struct addi_private *devpriv = dev->private;

if (devpriv) {
Expand All @@ -222,10 +221,7 @@ static void apci3120_detach(struct comedi_device *dev)
devpriv->ui_DmaBufferPages[1]);
}
}
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci3120_driver = {
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,11 @@ static int apci3501_auto_attach(struct comedi_device *dev,

static void apci3501_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
apci3501_reset(dev);
if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver apci3501_driver = {
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/staging/comedi/drivers/adl_pci6208.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,11 @@ static int pci6208_auto_attach(struct comedi_device *dev,
return 0;
}

static void pci6208_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
}

static struct comedi_driver adl_pci6208_driver = {
.driver_name = "adl_pci6208",
.module = THIS_MODULE,
.auto_attach = pci6208_auto_attach,
.detach = pci6208_detach,
.detach = comedi_pci_disable,
};

static int adl_pci6208_pci_probe(struct pci_dev *dev,
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/staging/comedi/drivers/adl_pci7x3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,11 @@ static int adl_pci7x3x_auto_attach(struct comedi_device *dev,
return 0;
}

static void adl_pci7x3x_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
}

static struct comedi_driver adl_pci7x3x_driver = {
.driver_name = "adl_pci7x3x",
.module = THIS_MODULE,
.auto_attach = adl_pci7x3x_auto_attach,
.detach = adl_pci7x3x_detach,
.detach = comedi_pci_disable,
};

static int adl_pci7x3x_pci_probe(struct pci_dev *dev,
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/staging/comedi/drivers/adl_pci8164.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,11 @@ static int adl_pci8164_auto_attach(struct comedi_device *dev,
return 0;
}

static void adl_pci8164_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
}

static struct comedi_driver adl_pci8164_driver = {
.driver_name = "adl_pci8164",
.module = THIS_MODULE,
.auto_attach = adl_pci8164_auto_attach,
.detach = adl_pci8164_detach,
.detach = comedi_pci_disable,
};

static int adl_pci8164_pci_probe(struct pci_dev *dev,
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,16 +939,11 @@ static int pci9111_auto_attach(struct comedi_device *dev,

static void pci9111_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
pci9111_reset(dev);
if (dev->irq != 0)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver adl_pci9111_driver = {
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/staging/comedi/drivers/adl_pci9118.c
Original file line number Diff line number Diff line change
Expand Up @@ -2202,12 +2202,9 @@ static void pci9118_detach(struct comedi_device *dev)
free_pages((unsigned long)devpriv->dmabuf_virt[1],
devpriv->dmabuf_pages[1]);
}
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);

comedi_pci_disable(dev);
if (pcidev)
pci_dev_put(pcidev);
}
}

static struct comedi_driver adl_pci9118_driver = {
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,16 +1372,11 @@ static int pci1710_auto_attach(struct comedi_device *dev,

static void pci1710_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->iobase)
pci1710_reset(dev);
if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
}
comedi_pci_disable(dev);
}

static struct comedi_driver adv_pci1710_driver = {
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/staging/comedi/drivers/adv_pci1723.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,9 @@ static int pci1723_auto_attach(struct comedi_device *dev,

static void pci1723_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase) {
pci1723_reset(dev);
comedi_pci_disable(pcidev);
}
}
if (dev->iobase)
pci1723_reset(dev);
comedi_pci_disable(dev);
}

static struct comedi_driver adv_pci1723_driver = {
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/staging/comedi/drivers/adv_pci1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,11 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev,
return 0;
}

static void adv_pci1724_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev && dev->iobase) {
comedi_pci_disable(pcidev);
dev_info(dev->class_dev, "detached\n");
}
}

static struct comedi_driver adv_pci1724_driver = {
.driver_name = "adv_pci1724",
.module = THIS_MODULE,
.auto_attach = adv_pci1724_auto_attach,
.detach = adv_pci1724_detach,
.detach = comedi_pci_disable,
};

static int adv_pci1724_pci_probe(struct pci_dev *dev,
Expand Down
Loading

0 comments on commit 101b240

Please sign in to comment.