diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-11-17 12:09:10 -0600 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-04-15 14:21:13 -0500 |
commit | b3c86b81ae638d90ee27a821e962e297ab85cbe4 (patch) | |
tree | c70e2c6b0e74c5bc3a20e6c597df1f9fbc7ca891 /drivers/dahdi/pciradio.c | |
parent | 9c8aa9db7eca1c91bd37bd5b55add0cee40d7cd9 (diff) |
dahdi: register/unregister devices as opposed to individual spans.
Increasingly, spans are implemented by devices that support more than a
single span. Introduce a 'struct dahdi_device' object which explicitly
contains multiple spans. This will also allow a cleaner representation
of spans and devices in sysfs since order of arrival will not determine
the layout of the devices. This also gives the core of dahdi a way to
know the relationship between spans.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Diffstat (limited to 'drivers/dahdi/pciradio.c')
-rw-r--r-- | drivers/dahdi/pciradio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c index e6ff52e..0384908 100644 --- a/drivers/dahdi/pciradio.c +++ b/drivers/dahdi/pciradio.c @@ -146,6 +146,7 @@ struct encdec struct pciradio { struct pci_dev *dev; + struct dahdi_device *ddev; struct dahdi_span span; unsigned char ios; int usecount; @@ -1488,7 +1489,7 @@ static int pciradio_initialize(struct pciradio *rad) rad->span.flags = DAHDI_FLAG_RBS; rad->span.ops = &pciradio_span_ops; - if (dahdi_register(&rad->span, 0)) { + if (dahdi_register_device(rad->ddev, &rad->dev->dev)) { printk(KERN_NOTICE "Unable to register span with DAHDI\n"); return -1; } @@ -1777,7 +1778,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de release_region(rad->ioaddr, 0xff); pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma); pci_set_drvdata(pdev, NULL); - dahdi_unregister(&rad->span); + dahdi_free_device(rad->ddev); kfree(rad); return -EIO; @@ -1810,7 +1811,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de static void pciradio_release(struct pciradio *rad) { - dahdi_unregister(&rad->span); + dahdi_unregister_device(rad->ddev); if (rad->freeregion) release_region(rad->ioaddr, 0xff); kfree(rad); |