From 6a9c41990da91566733e559b6af8286a902a16e0 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 14 Oct 2014 10:44:17 -0700 Subject: [PATCH] staging: comedi: addi_common.c: remove i_ADDI_Detach() The addi_apci_035 and addi_apci_1500 are the only drivers left that use this function in addi_common.c. Remove the function an add a private comedi_driver (*detach) function to those drivers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi-data/addi_common.c | 7 ------- drivers/staging/comedi/drivers/addi_apci_035.c | 9 ++++++++- drivers/staging/comedi/drivers/addi_apci_1500.c | 9 ++++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/addi_common.c b/drivers/staging/comedi/drivers/addi-data/addi_common.c index 2e7fb218340f..51574a8d027a 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_common.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_common.c @@ -265,10 +265,3 @@ static int addi_auto_attach(struct comedi_device *dev, i_ADDI_Reset(dev); return 0; } - -static void i_ADDI_Detach(struct comedi_device *dev) -{ - if (dev->iobase) - i_ADDI_Reset(dev); - comedi_pci_detach(dev); -} diff --git a/drivers/staging/comedi/drivers/addi_apci_035.c b/drivers/staging/comedi/drivers/addi_apci_035.c index af70c8401880..b06fde1d6c39 100644 --- a/drivers/staging/comedi/drivers/addi_apci_035.c +++ b/drivers/staging/comedi/drivers/addi_apci_035.c @@ -45,11 +45,18 @@ static int apci035_auto_attach(struct comedi_device *dev, return addi_auto_attach(dev, context); } +static void apci035_detach(struct comedi_device *dev) +{ + if (dev->iobase) + i_ADDI_Reset(dev); + comedi_pci_detach(dev); +} + static struct comedi_driver apci035_driver = { .driver_name = "addi_apci_035", .module = THIS_MODULE, .auto_attach = apci035_auto_attach, - .detach = i_ADDI_Detach, + .detach = apci035_detach, }; static int apci035_pci_probe(struct pci_dev *dev, diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index b7a284ac6649..50a147fc38bf 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -44,11 +44,18 @@ static int apci1500_auto_attach(struct comedi_device *dev, return addi_auto_attach(dev, context); } +static void apci1500_detach(struct comedi_device *dev) +{ + if (dev->iobase) + i_ADDI_Reset(dev); + comedi_pci_detach(dev); +} + static struct comedi_driver apci1500_driver = { .driver_name = "addi_apci_1500", .module = THIS_MODULE, .auto_attach = apci1500_auto_attach, - .detach = i_ADDI_Detach, + .detach = apci1500_detach, }; static int apci1500_pci_probe(struct pci_dev *dev, -- 2.30.2