From: Gerard Snitselaar <dev@snitselaar.org>
To: devel@driverdev.osuosl.org
Cc: abbotti@mev.co.uk, fmhess@users.sourceforge.net,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: comedi: resolve section mismatch in s626
Date: Sun, 18 Mar 2012 19:25:21 -0700 [thread overview]
Message-ID: <1332123921-14347-1-git-send-email-dev@snitselaar.org> (raw)
s626_attach is referencing s626_pci_table which is annotated
__devinitconst. Put pci vendor/device ids in the s626_board struct and
use s626_boards instead similar to what is done in gsc_hpdi.
Signed-off-by: Gerard Snitselaar <dev@snitselaar.org>
---
drivers/staging/comedi/drivers/s626.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 23fc64b..6c017a3 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -85,6 +85,10 @@ MODULE_LICENSE("GPL");
struct s626_board {
const char *name;
+ int vendor_id;
+ int device_id;
+ int subvendor_id;
+ int subdevice_id;
int ai_chans;
int ai_bits;
int ao_chans;
@@ -97,6 +101,10 @@ struct s626_board {
static const struct s626_board s626_boards[] = {
{
.name = "s626",
+ .vendor_id = PCI_VENDOR_ID_S626,
+ .device_id = PCI_DEVICE_ID_S626,
+ .subvendor_id = PCI_SUBVENDOR_ID_S626,
+ .subdevice_id = PCI_SUBDEVICE_ID_S626,
.ai_chans = S626_ADC_CHANNELS,
.ai_bits = 14,
.ao_chans = S626_DAC_CHANNELS,
@@ -110,6 +118,8 @@ static const struct s626_board s626_boards[] = {
#define thisboard ((const struct s626_board *)dev->board_ptr)
#define PCI_VENDOR_ID_S626 0x1131
#define PCI_DEVICE_ID_S626 0x7146
+#define PCI_SUBVENDOR_ID_S626 0x6000
+#define PCI_SUBDEVICE_ID_S626 0x0272
/*
* For devices with vendor:device id == 0x1131:0x7146 you must specify
@@ -117,7 +127,7 @@ static const struct s626_board s626_boards[] = {
* Philips SAA7146 media/dvb based cards.
*/
static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = {
- {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, 0x6000, 0x0272, 0, 0, 0},
+ {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, PCI_SUBVENDOR_ID_S626, PCI_SUBDEVICE_ID_S626, 0, 0, 0},
{0}
};
@@ -554,17 +564,17 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
resource_size_t resourceStart;
dma_addr_t appdma;
struct comedi_subdevice *s;
- const struct pci_device_id *ids;
struct pci_dev *pdev = NULL;
if (alloc_private(dev, sizeof(struct s626_private)) < 0)
return -ENOMEM;
- for (i = 0; i < (ARRAY_SIZE(s626_pci_table) - 1) && !pdev; i++) {
- ids = &s626_pci_table[i];
+ for (i = 0; i < ARRAY_SIZE(s626_boards) && !pdev; i++) {
do {
- pdev = pci_get_subsys(ids->vendor, ids->device,
- ids->subvendor, ids->subdevice,
+ pdev = pci_get_subsys(s626_boards[i].vendor_id,
+ s626_boards[i].device_id,
+ s626_boards[i].subvendor_id,
+ s626_boards[i].subdevice_id,
pdev);
if ((it->options[0] || it->options[1]) && pdev) {
--
1.7.7.6
next reply other threads:[~2012-03-19 2:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 2:25 Gerard Snitselaar [this message]
2012-03-19 3:09 ` [PATCH v2] " Gerard Snitselaar
2012-03-19 16:31 ` Greg KH
2012-03-19 16:43 ` Gerard Snitselaar
2012-03-19 22:46 ` Gerard Snitselaar
2012-03-19 23:26 ` Greg KH
2012-04-02 10:48 ` Ian Abbott
2012-04-10 18:24 ` Greg KH
2012-04-10 19:24 ` Gerard Snitselaar
2012-04-12 13:03 ` Ian Abbott
2012-04-18 23:28 ` Greg KH
2012-04-20 1:34 ` Gerard Snitselaar
2012-04-20 15:33 ` Greg KH
2012-04-24 1:30 ` [PATCH v2 resend] " Gerard Snitselaar
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=1332123921-14347-1-git-send-email-dev@snitselaar.org \
--to=dev@snitselaar.org \
--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
all inboxes | Powered by JetHome®