From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <abbotti@mev.co.uk>,
<fmhess@users.sourceforge.net>, <gregkh@linuxfoundation.org>
Subject: [PATCH 15/19] staging: comedi: adl_pci6208: fix the ao_readback variable size
Date: Wed, 27 Jun 2012 15:04:47 -0700 [thread overview]
Message-ID: <201206271504.48007.hartleys@visionengravers.com> (raw)
The 'ao_readback' variable in the private data struct is used to
cache the last value written to the analog output DAC channels.
The PCI-6208 has 8 analog output channels but the variable only
allowed space to cache 2 values.
Since the PCI-6216 board could be supported by this driver and
it has 16 analog outputs, create a define for the maximum number
of channels and use that to set the size of 'ao_readback'.
For now, set the max to 8 to save space since the PCI-6216 is
not currently supported.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/comedi/drivers/adl_pci6208.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c
index dcaebfc..d15f0cb 100644
--- a/drivers/staging/comedi/drivers/adl_pci6208.c
+++ b/drivers/staging/comedi/drivers/adl_pci6208.c
@@ -56,6 +56,8 @@ References:
#define PCI6208_DIO_DI_MASK (0xf0)
#define PCI6208_DIO_DI_SHIFT (4)
+#define PCI6208_MAX_AO_CHANNELS 8
+
struct pci6208_board {
const char *name;
unsigned short dev_id;
@@ -72,7 +74,7 @@ static const struct pci6208_board pci6208_boards[] = {
struct pci6208_private {
struct pci_dev *pci_dev;
- unsigned int ao_readback[2];
+ unsigned int ao_readback[PCI6208_MAX_AO_CHANNELS];
};
static int pci6208_ao_winsn(struct comedi_device *dev,
--
1.7.11
reply other threads:[~2012-06-27 22:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201206271504.48007.hartleys@visionengravers.com \
--to=hartleys@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=fmhess@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--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