Re: [PATCH] staging: comedi: ni_labpc: fix legacy driver build

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

 



On 2013-04-23 19:05, H Hartley Sweeten wrote:
CONFIG_COMEDI_NI_LABPC_ISA is a tristate option. #if IS_ENABLED()
needs to be used instead of #ifdef in order to build the legacy
specific code in this driver.

The local variable 'board' is not used in labpc_attach(). Remove it.

The labpc_detach() function is only referenced in this file. Make
it static.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/comedi/drivers/ni_labpc.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c
index bb68d8f..3d978f3 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.c
+++ b/drivers/staging/comedi/drivers/ni_labpc.c
@@ -234,7 +234,7 @@ static inline void labpc_writeb(unsigned int byte, unsigned long address)
  	writeb(byte, (void __iomem *)address);
  }

-#ifdef CONFIG_COMEDI_NI_LABPC_ISA
+#if IS_ENABLED(CONFIG_COMEDI_NI_LABPC_ISA)
  static const struct labpc_boardinfo labpc_boards[] = {
  	{
  		.name			= "lab-pc-1200",
@@ -1710,10 +1710,9 @@ void labpc_common_detach(struct comedi_device *dev)
  }
  EXPORT_SYMBOL_GPL(labpc_common_detach);

-#ifdef CONFIG_COMEDI_NI_LABPC_ISA
+#if IS_ENABLED(CONFIG_COMEDI_NI_LABPC_ISA)
  static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  {
-	const struct labpc_boardinfo *board = comedi_board(dev);
  	struct labpc_private *devpriv;
  	unsigned int irq = it->options[1];
  	unsigned int dma_chan = it->options[2];
@@ -1756,7 +1755,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  	return 0;
  }

-void labpc_detach(struct comedi_device *dev)
+static void labpc_detach(struct comedi_device *dev)
  {
  	struct labpc_private *devpriv = dev->private;



Yup.

Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>


--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
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