mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chase Southwood <chase.southwood@gmail.com>
To: gregkh@linuxfoundation.org
Cc: abbotti@mev.co.uk, hsweeten@visionengravers.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Chase Southwood <chase.southwood@gmail.com>
Subject: [PATCH 6/6 v2] staging: comedi: addi_apci_1564: remove use of devpriv->s_EeParameters
Date: Tue, 29 Apr 2014 03:38:20 -0500	[thread overview]
Message-ID: <1398760700-19397-1-git-send-email-chase.southwood@gmail.com> (raw)
In-Reply-To: <1398562711-6313-1-git-send-email-chase.southwood@gmail.com>

This driver no longer reads the eeprom to find the board specific data,
all the necessary data is in the boardinfo. Use the boardinfo directly
instead of passing through devpriv->s_EeParameters.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
2: Incorrect patch title fixed.

Ian and Hartley,

The auto_attach() function is starting to look much better now.  My next patchset
will be geared towards only allocating subdevices which are actually used.

Thanks,
Chase

 drivers/staging/comedi/drivers/addi_apci_1564.c | 27 +++++--------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index d5be8d3..b34ae34 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -65,22 +65,6 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 	dev->iobase = pci_resource_start(pcidev, 2);
 	devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 1);
 
-	/* Initialize parameters that can be overridden in EEPROM */
-	devpriv->s_EeParameters.i_NbrAiChannel = this_board->i_NbrAiChannel;
-	devpriv->s_EeParameters.i_NbrAoChannel = this_board->i_NbrAoChannel;
-	devpriv->s_EeParameters.i_AiMaxdata = this_board->i_AiMaxdata;
-	devpriv->s_EeParameters.i_AoMaxdata = this_board->i_AoMaxdata;
-	devpriv->s_EeParameters.i_NbrDiChannel = this_board->i_NbrDiChannel;
-	devpriv->s_EeParameters.i_NbrDoChannel = this_board->i_NbrDoChannel;
-	devpriv->s_EeParameters.i_DoMaxdata = this_board->i_DoMaxdata;
-	devpriv->s_EeParameters.i_Timer = this_board->i_Timer;
-	devpriv->s_EeParameters.ui_MinAcquisitiontimeNs =
-		this_board->ui_MinAcquisitiontimeNs;
-	devpriv->s_EeParameters.ui_MinDelaytimeNs =
-		this_board->ui_MinDelaytimeNs;
-
-	/* ## */
-
 	if (pcidev->irq > 0) {
 		ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
 				  dev->board_name, dev);
@@ -114,14 +98,13 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
 	/*  Allocate and Initialise DO Subdevice Structures */
 	s = &dev->subdevices[3];
-	if (devpriv->s_EeParameters.i_NbrDoChannel) {
+	if (this_board->i_NbrDoChannel) {
 		s->type = COMEDI_SUBD_DO;
 		s->subdev_flags =
 			SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-		s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel;
-		s->maxdata = devpriv->s_EeParameters.i_DoMaxdata;
-		s->len_chanlist =
-			devpriv->s_EeParameters.i_NbrDoChannel;
+		s->n_chan = this_board->i_NbrDoChannel;
+		s->maxdata = this_board->i_DoMaxdata;
+		s->len_chanlist = this_board->i_NbrDoChannel;
 		s->range_table = &range_digital;
 
 		/* insn_config - for digital output memory */
@@ -135,7 +118,7 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
 	/*  Allocate and Initialise Timer Subdevice Structures */
 	s = &dev->subdevices[4];
-	if (devpriv->s_EeParameters.i_Timer) {
+	if (this_board->i_Timer) {
 		s->type = COMEDI_SUBD_TIMER;
 		s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
 		s->n_chan = 1;
-- 
1.9.0


  parent reply	other threads:[~2014-04-29  8:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27  1:35 [PATCH 1/6] staging: comedi: addi_apci_1564: remove eeprom support code Chase Southwood
2014-04-27  1:36 ` [PATCH 2/6] staging: comedi: addi_apci_1564: remove unnecessary include Chase Southwood
2014-04-27  1:37 ` [PATCH 3/6] staging: comedi: addi_apci_1032: board has 32 digital inputs Chase Southwood
     [not found]   ` <DC148C5AA1CEBA4E87973D432B1C2D8825E1F7F8@P3PWEX4MB008.ex4.secureserver.net>
2014-04-28 21:57     ` Ian Abbott
2014-04-29  8:34   ` [PATCH 3/6 v2] staging: comedi: addi_apci_1564: " Chase Southwood
2014-04-29 13:15     ` Ian Abbott
2014-04-27  1:37 ` [PATCH 4/6] staging: comedi: addi_apci_1564: simplify the PCI bar reading and don't read the unused bars Chase Southwood
2014-04-28 10:19   ` Ian Abbott
2014-04-28 11:10     ` Ian Abbott
     [not found]   ` <DC148C5AA1CEBA4E87973D432B1C2D8825E1F7CD@P3PWEX4MB008.ex4.secureserver.net>
2014-04-29  8:22     ` Chase Southwood
2014-04-29  8:35   ` [PATCH 4/6 v2] " Chase Southwood
2014-04-29 13:19     ` Ian Abbott
2014-04-30  7:57   ` [PATCH 4/6 v3] " Chase Southwood
2014-04-30  8:47     ` Ian Abbott
2014-04-27  1:38 ` [PATCH 5/6] staging: comedi: addi_apci_2032: remove unnecessary info from boardinfo Chase Southwood
2014-04-29  8:37   ` [PATCH 5/6 v2] staging: comedi: addi_apci_1564: " Chase Southwood
2014-04-29 13:17     ` Ian Abbott
2014-04-27  1:38 ` [PATCH 6/6] staging: comedi: addi_apci_2032: remove use of devpriv->s_EeParameters Chase Southwood
     [not found]   ` <DC148C5AA1CEBA4E87973D432B1C2D8825E1F6C5@P3PWEX4MB008.ex4.secureserver.net>
2014-04-29  8:16     ` Chase Southwood
2014-04-29  8:38   ` Chase Southwood [this message]
2014-04-29 13:20     ` [PATCH 6/6 v2] staging: comedi: addi_apci_1564: " Ian Abbott
2014-04-29 20:33     ` Hartley Sweeten
2014-04-30  7:52       ` Chase Southwood
2014-04-30 16:58         ` Hartley Sweeten
2014-05-01  3:32           ` Chase Southwood
2014-05-03  7:49     ` [PATCH 6/6 v3] " Chase Southwood
2014-04-28  9:40 ` [PATCH 1/6] staging: comedi: addi_apci_1564: remove eeprom support code Dan Carpenter
2014-05-03 23:52   ` Greg KH
2014-05-04 19:48     ` Chase Southwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398760700-19397-1-git-send-email-chase.southwood@gmail.com \
    --to=chase.southwood@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®