public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs
@ 2014-04-25  8:17 Chase Southwood
  2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chase Southwood @ 2014-04-25  8:17 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood

This board does not have analog inputs.  Remove the subdevice init for
them.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
Compile tested only.  To be applied on top of
[PATCH] staging: comedi: addi_apci_1564: separate from addi_common.c

 drivers/staging/comedi/drivers/addi_apci_1564.c | 31 +------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 792916d..eee10cc 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -144,36 +144,7 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
 	/*  Allocate and Initialise AI Subdevice Structures */
 	s = &dev->subdevices[0];
-	if ((devpriv->s_EeParameters.i_NbrAiChannel)
-		|| (this_board->i_NbrAiChannelDiff)) {
-		dev->read_subdev = s;
-		s->type = COMEDI_SUBD_AI;
-		s->subdev_flags =
-			SDF_READABLE | SDF_COMMON | SDF_GROUND
-			| SDF_DIFF;
-		if (devpriv->s_EeParameters.i_NbrAiChannel) {
-			s->n_chan =
-				devpriv->s_EeParameters.i_NbrAiChannel;
-			devpriv->b_SingelDiff = 0;
-		} else {
-			s->n_chan = this_board->i_NbrAiChannelDiff;
-			devpriv->b_SingelDiff = 1;
-		}
-		s->maxdata = devpriv->s_EeParameters.i_AiMaxdata;
-		s->len_chanlist = this_board->i_AiChannelList;
-		s->range_table = this_board->pr_AiRangelist;
-
-		s->insn_config = this_board->ai_config;
-		s->insn_read = this_board->ai_read;
-		s->insn_write = this_board->ai_write;
-		s->insn_bits = this_board->ai_bits;
-		s->do_cmdtest = this_board->ai_cmdtest;
-		s->do_cmd = this_board->ai_cmd;
-		s->cancel = this_board->ai_cancel;
-
-	} else {
-		s->type = COMEDI_SUBD_UNUSED;
-	}
+	s->type = COMEDI_SUBD_UNUSED;
 
 	/*  Allocate and Initialise AO Subdevice Structures */
 	s = &dev->subdevices[1];
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs
  2014-04-25  8:17 [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Chase Southwood
@ 2014-04-25  8:18 ` Chase Southwood
  2014-04-25 10:20   ` Ian Abbott
  2014-04-25 16:08   ` Hartley Sweeten
  2014-04-25 10:18 ` [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Ian Abbott
  2014-04-25 16:07 ` Hartley Sweeten
  2 siblings, 2 replies; 6+ messages in thread
From: Chase Southwood @ 2014-04-25  8:18 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood

The board supported by this driver does not have analog outputs.  Remove
the subdevice init for it.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
Compile tested only.

 drivers/staging/comedi/drivers/addi_apci_1564.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index eee10cc..5f6d3b5 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -148,17 +148,8 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
 	/*  Allocate and Initialise AO Subdevice Structures */
 	s = &dev->subdevices[1];
-	if (devpriv->s_EeParameters.i_NbrAoChannel) {
-		s->type = COMEDI_SUBD_AO;
-		s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-		s->n_chan = devpriv->s_EeParameters.i_NbrAoChannel;
-		s->maxdata = devpriv->s_EeParameters.i_AoMaxdata;
-		s->len_chanlist =
-			devpriv->s_EeParameters.i_NbrAoChannel;
-		s->insn_write = this_board->ao_write;
-	} else {
-		s->type = COMEDI_SUBD_UNUSED;
-	}
+	s->type = COMEDI_SUBD_UNUSED;
+
 	/*  Allocate and Initialise DI Subdevice Structures */
 	s = &dev->subdevices[2];
 	if (devpriv->s_EeParameters.i_NbrDiChannel) {
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs
  2014-04-25  8:17 [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Chase Southwood
  2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
@ 2014-04-25 10:18 ` Ian Abbott
  2014-04-25 16:07 ` Hartley Sweeten
  2 siblings, 0 replies; 6+ messages in thread
From: Ian Abbott @ 2014-04-25 10:18 UTC (permalink / raw)
  To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-04-25 09:17, Chase Southwood wrote:
> This board does not have analog inputs.  Remove the subdevice init for
> them.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> ---
> Compile tested only.  To be applied on top of
> [PATCH] staging: comedi: addi_apci_1564: separate from addi_common.c

Looks good.  May want to get rid of the unused subdevices at some point 
during the cleanup.

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs
  2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
@ 2014-04-25 10:20   ` Ian Abbott
  2014-04-25 16:08   ` Hartley Sweeten
  1 sibling, 0 replies; 6+ messages in thread
From: Ian Abbott @ 2014-04-25 10:20 UTC (permalink / raw)
  To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-04-25 09:18, Chase Southwood wrote:
> The board supported by this driver does not have analog outputs.  Remove
> the subdevice init for it.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> ---
> Compile tested only.

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs
  2014-04-25  8:17 [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Chase Southwood
  2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
  2014-04-25 10:18 ` [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Ian Abbott
@ 2014-04-25 16:07 ` Hartley Sweeten
  2 siblings, 0 replies; 6+ messages in thread
From: Hartley Sweeten @ 2014-04-25 16:07 UTC (permalink / raw)
  To: Chase Southwood, gregkh@linuxfoundation.org
  Cc: abbotti@mev.co.uk, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org

On Friday, April 25, 2014 1:17 AM, Chase Southwood wrote:
> This board does not have analog inputs.  Remove the subdevice init for
> them.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>

Looks good.

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

As Ian mentioned, after you have removed the init for all the non-existent
subdevices you should just get rid of them and only allocate the used ones.

Thanks,
Hartley


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs
  2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
  2014-04-25 10:20   ` Ian Abbott
@ 2014-04-25 16:08   ` Hartley Sweeten
  1 sibling, 0 replies; 6+ messages in thread
From: Hartley Sweeten @ 2014-04-25 16:08 UTC (permalink / raw)
  To: Chase Southwood, gregkh@linuxfoundation.org
  Cc: abbotti@mev.co.uk, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org

On Friday, April 25, 2014 1:18 AM, Chase Southwood wrote:
> The board supported by this driver does not have analog outputs.  Remove
> the subdevice init for it.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>

Looks good.

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-25 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25  8:17 [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Chase Southwood
2014-04-25  8:18 ` [PATCH 2/2] staging: comedi: addi_apci_1564: board does not have analog outputs Chase Southwood
2014-04-25 10:20   ` Ian Abbott
2014-04-25 16:08   ` Hartley Sweeten
2014-04-25 10:18 ` [PATCH 1/2] staging: comedi: addi_apci_1564: board does not have analog inputs Ian Abbott
2014-04-25 16:07 ` Hartley Sweeten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox