From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <abbotti@mev.co.uk>,
<gregkh@linuxfoundation.org>
Subject: [PATCH 6/7] staging: comedi: dnya_pci10xx: remove unneeded boardinfo code
Date: Tue, 14 Aug 2012 18:25:36 -0700 [thread overview]
Message-ID: <201208141825.36510.hartleys@visionengravers.com> (raw)
The boardinfo code is not needed by this driver. Only one board
type is supported.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/comedi/drivers/dyna_pci10xx.c | 38 ++-------------------------
1 file changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index a23969e..56fb35b 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -54,20 +54,6 @@ static const struct comedi_lrange range_pci1050_ai = { 3, {
static const char range_codes_pci1050_ai[] = { 0x00, 0x10, 0x30 };
-struct boardtype {
- const char *name;
- int device_id;
-};
-
-static const struct boardtype boardtypes[] = {
- {
- .name = "dyna_pci1050",
- .device_id = 0x1050,
- },
- /* dummy entry corresponding to driver name */
- {.name = DRV_NAME},
-};
-
struct dyna_pci10xx_private {
struct mutex mutex;
unsigned long BADR3;
@@ -194,35 +180,16 @@ static int dyna_pci10xx_do_insn_bits(struct comedi_device *dev,
return insn->n;
}
-static const void *dyna_pci10xx_find_boardinfo(struct comedi_device *dev,
- struct pci_dev *pcidev)
-{
- const struct boardtype *thisboard;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
- thisboard = &boardtypes[i];
- if (pcidev->device != thisboard->device_id)
- return thisboard;
- }
- return NULL;
-}
-
static int dyna_pci10xx_attach_pci(struct comedi_device *dev,
struct pci_dev *pcidev)
{
- const struct boardtype *thisboard;
struct dyna_pci10xx_private *devpriv;
struct comedi_subdevice *s;
int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
- thisboard = dyna_pci10xx_find_boardinfo(dev, pcidev);
- if (!thisboard)
- return -ENODEV;
- dev->board_ptr = thisboard;
- dev->board_name = thisboard->name;
+ dev->board_name = dev->driver->driver_name;
ret = alloc_private(dev, sizeof(*devpriv));
if (ret)
@@ -282,8 +249,7 @@ static int dyna_pci10xx_attach_pci(struct comedi_device *dev,
s->state = 0;
s->insn_bits = dyna_pci10xx_do_insn_bits;
- dev_info(dev->class_dev, "%s: %s attached\n",
- dev->driver->driver_name, dev->board_name);
+ dev_info(dev->class_dev, "%s attached\n", dev->board_name);
return 0;
}
--
1.7.11
reply other threads:[~2012-08-15 1:25 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=201208141825.36510.hartleys@visionengravers.com \
--to=hartleys@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--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
Powered by JetHome