diff options
author | James Bottomley <James.Bottomley@SteelEye.com> | 2007-05-09 05:33:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:49 -0400 |
commit | 8813d1c00ca923c1683da625ff85959be1db9a49 (patch) | |
tree | db16312db25ccfbef05f7cb05b58a9a6423f7b54 /drivers/mca/mca-bus.c | |
parent | 809aa5048fb7e7fd3bf0aa1fb169c42db0f63b08 (diff) |
mca: add integrated device bus matching
The MCA bus has a few "integrated" functions, which are effectively virtual
slots on the bus. The problem is that these special functions don't have
dedicated pos IDs, so we have to manufacture ids for them outside the pos
space ... and these ids can't be matched by the standard matching function,
so add a special registration that requests a list of pos ids or a particular
integrated function.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mca/mca-bus.c')
-rw-r--r-- | drivers/mca/mca-bus.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/mca/mca-bus.c b/drivers/mca/mca-bus.c index a70fe00aea16..67b8e9453b19 100644 --- a/drivers/mca/mca-bus.c +++ b/drivers/mca/mca-bus.c | |||
@@ -48,18 +48,24 @@ static int mca_bus_match (struct device *dev, struct device_driver *drv) | |||
48 | struct mca_device *mca_dev = to_mca_device (dev); | 48 | struct mca_device *mca_dev = to_mca_device (dev); |
49 | struct mca_driver *mca_drv = to_mca_driver (drv); | 49 | struct mca_driver *mca_drv = to_mca_driver (drv); |
50 | const unsigned short *mca_ids = mca_drv->id_table; | 50 | const unsigned short *mca_ids = mca_drv->id_table; |
51 | int i; | 51 | int i = 0; |
52 | 52 | ||
53 | if (!mca_ids) | 53 | if (mca_ids) { |
54 | return 0; | 54 | for(i = 0; mca_ids[i]; i++) { |
55 | 55 | if (mca_ids[i] == mca_dev->pos_id) { | |
56 | for(i = 0; mca_ids[i]; i++) { | 56 | mca_dev->index = i; |
57 | if (mca_ids[i] == mca_dev->pos_id) { | 57 | return 1; |
58 | mca_dev->index = i; | 58 | } |
59 | return 1; | ||
60 | } | 59 | } |
61 | } | 60 | } |
62 | 61 | /* If the integrated id is present, treat it as though it were an | |
62 | * additional id in the id_table (it can't be because by definition, | ||
63 | * integrated id's overflow a short */ | ||
64 | if (mca_drv->integrated_id && mca_dev->pos_id == | ||
65 | mca_drv->integrated_id) { | ||
66 | mca_dev->index = i; | ||
67 | return 1; | ||
68 | } | ||
63 | return 0; | 69 | return 0; |
64 | } | 70 | } |
65 | 71 | ||