diff options
author | Jeff Mahoney <jeffm@suse.com> | 2005-07-06 15:44:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-06 15:55:20 -0400 |
commit | 5e6557722e69840506eb8bc5a1edcdb4e447a917 (patch) | |
tree | 965d19e55a56d2daaed47711c01a8c27e29e592c /drivers/net | |
parent | 159f597a8bd0f1d7650d5e580c93a2666c9c26d1 (diff) |
[PATCH] openfirmware: generate device table for userspace
This converts the usage of struct of_match to struct of_device_id,
similar to pci_device_id. This allows a device table to be generated,
which can be parsed by depmod(8) to generate a map file for module
loading.
In order for hotplug to work with macio devices, patches to
module-init-tools and hotplug must be applied. Those patches are
available at:
ftp://ftp.suse.com/pub/people/jeffm/linux/macio-hotplug/
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bmac.c | 7 | ||||
-rw-r--r-- | drivers/net/mace.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/airport.c | 8 |
3 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 00e5257b176f..8dc657fc8afb 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -1261,7 +1261,7 @@ static void bmac_reset_and_enable(struct net_device *dev) | |||
1261 | spin_unlock_irqrestore(&bp->lock, flags); | 1261 | spin_unlock_irqrestore(&bp->lock, flags); |
1262 | } | 1262 | } |
1263 | 1263 | ||
1264 | static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *match) | 1264 | static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_id *match) |
1265 | { | 1265 | { |
1266 | int j, rev, ret; | 1266 | int j, rev, ret; |
1267 | struct bmac_data *bp; | 1267 | struct bmac_data *bp; |
@@ -1645,16 +1645,13 @@ static int __devexit bmac_remove(struct macio_dev *mdev) | |||
1645 | return 0; | 1645 | return 0; |
1646 | } | 1646 | } |
1647 | 1647 | ||
1648 | static struct of_match bmac_match[] = | 1648 | static struct of_device_id bmac_match[] = |
1649 | { | 1649 | { |
1650 | { | 1650 | { |
1651 | .name = "bmac", | 1651 | .name = "bmac", |
1652 | .type = OF_ANY_MATCH, | ||
1653 | .compatible = OF_ANY_MATCH, | ||
1654 | .data = (void *)0, | 1652 | .data = (void *)0, |
1655 | }, | 1653 | }, |
1656 | { | 1654 | { |
1657 | .name = OF_ANY_MATCH, | ||
1658 | .type = "network", | 1655 | .type = "network", |
1659 | .compatible = "bmac+", | 1656 | .compatible = "bmac+", |
1660 | .data = (void *)1, | 1657 | .data = (void *)1, |
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 6ed2d7dbd44c..81d0a26e4f41 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -109,7 +109,7 @@ bitrev(int b) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | static int __devinit mace_probe(struct macio_dev *mdev, const struct of_match *match) | 112 | static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match) |
113 | { | 113 | { |
114 | struct device_node *mace = macio_get_of_node(mdev); | 114 | struct device_node *mace = macio_get_of_node(mdev); |
115 | struct net_device *dev; | 115 | struct net_device *dev; |
@@ -1009,12 +1009,10 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
1009 | return IRQ_HANDLED; | 1009 | return IRQ_HANDLED; |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | static struct of_match mace_match[] = | 1012 | static struct of_device_id mace_match[] = |
1013 | { | 1013 | { |
1014 | { | 1014 | { |
1015 | .name = "mace", | 1015 | .name = "mace", |
1016 | .type = OF_ANY_MATCH, | ||
1017 | .compatible = OF_ANY_MATCH | ||
1018 | }, | 1016 | }, |
1019 | {}, | 1017 | {}, |
1020 | }; | 1018 | }; |
diff --git a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c index b4f4bd7956a2..9d496703c465 100644 --- a/drivers/net/wireless/airport.c +++ b/drivers/net/wireless/airport.c | |||
@@ -184,7 +184,7 @@ static int airport_hard_reset(struct orinoco_private *priv) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | static int | 186 | static int |
187 | airport_attach(struct macio_dev *mdev, const struct of_match *match) | 187 | airport_attach(struct macio_dev *mdev, const struct of_device_id *match) |
188 | { | 188 | { |
189 | struct orinoco_private *priv; | 189 | struct orinoco_private *priv; |
190 | struct net_device *dev; | 190 | struct net_device *dev; |
@@ -266,16 +266,16 @@ MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); | |||
266 | MODULE_DESCRIPTION("Driver for the Apple Airport wireless card."); | 266 | MODULE_DESCRIPTION("Driver for the Apple Airport wireless card."); |
267 | MODULE_LICENSE("Dual MPL/GPL"); | 267 | MODULE_LICENSE("Dual MPL/GPL"); |
268 | 268 | ||
269 | static struct of_match airport_match[] = | 269 | static struct of_device_id airport_match[] = |
270 | { | 270 | { |
271 | { | 271 | { |
272 | .name = "radio", | 272 | .name = "radio", |
273 | .type = OF_ANY_MATCH, | ||
274 | .compatible = OF_ANY_MATCH | ||
275 | }, | 273 | }, |
276 | {}, | 274 | {}, |
277 | }; | 275 | }; |
278 | 276 | ||
277 | MODULE_DEVICE_TABLE (of, airport_match); | ||
278 | |||
279 | static struct macio_driver airport_driver = | 279 | static struct macio_driver airport_driver = |
280 | { | 280 | { |
281 | .name = DRIVER_NAME, | 281 | .name = DRIVER_NAME, |