[PATCH 3/9] staging: comedi: das08: Use passed in driver name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The das08_common_attach() function requests resources with the name
"das08".  Since this function is exported, the comedi devices it
registers resources for may belong to a different comedi driver.
Request resources using the passed in comedi device's driver name
instead.  This is (or should be) available in
(dev)->driver->driver_name, where dev is the passed in pointer to struct
comedi_device.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/das08.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 829e532..71463b2 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -885,7 +885,8 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
 	case pc104:
 		/*  allocate ioports for ISA (and PC/104) boards */
 		printk(KERN_INFO " iobase 0x%lx\n", iobase);
-		if (!request_region(iobase, thisboard->iosize, DRV_NAME)) {
+		if (!request_region(iobase, thisboard->iosize,
+				    dev->driver->driver_name)) {
 			printk(KERN_ERR " I/O port conflict\n");
 			return -EIO;
 		}
@@ -1054,7 +1055,7 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		}
 		devpriv->pdev = pdev;
 		/*  enable PCI device and reserve I/O spaces */
-		if (comedi_pci_enable(pdev, DRV_NAME)) {
+		if (comedi_pci_enable(pdev, dev->driver->driver_name)) {
 			printk(KERN_ERR " Error enabling PCI device and "
 						"requesting regions\n");
 			return -EIO;
-- 
1.7.8.6

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux