diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2005-12-01 10:15:21 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-01-28 21:42:15 -0500 |
commit | b43de2d8db7655d1c520bf6eac7071d8f6d0b864 (patch) | |
tree | 72de2f56444a6a167fa61dff14946d1aa90b3bc8 /drivers/net/ibm_emac | |
parent | d0f6ecad39266f87913539c52dc624f75cc4b914 (diff) |
[PATCH] ibm_emac sparse annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/net/ibm_emac')
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_core.c | 40 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_core.h | 2 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_debug.c | 2 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_rgmii.h | 2 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_zmii.c | 7 | ||||
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac_zmii.h | 2 |
6 files changed, 26 insertions, 29 deletions
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 591c5864ffb..7e49522b8b3 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c | |||
@@ -204,7 +204,7 @@ static inline int emac_phy_gpcs(int phy_mode) | |||
204 | 204 | ||
205 | static inline void emac_tx_enable(struct ocp_enet_private *dev) | 205 | static inline void emac_tx_enable(struct ocp_enet_private *dev) |
206 | { | 206 | { |
207 | struct emac_regs *p = dev->emacp; | 207 | struct emac_regs __iomem *p = dev->emacp; |
208 | unsigned long flags; | 208 | unsigned long flags; |
209 | u32 r; | 209 | u32 r; |
210 | 210 | ||
@@ -220,7 +220,7 @@ static inline void emac_tx_enable(struct ocp_enet_private *dev) | |||
220 | 220 | ||
221 | static void emac_tx_disable(struct ocp_enet_private *dev) | 221 | static void emac_tx_disable(struct ocp_enet_private *dev) |
222 | { | 222 | { |
223 | struct emac_regs *p = dev->emacp; | 223 | struct emac_regs __iomem *p = dev->emacp; |
224 | unsigned long flags; | 224 | unsigned long flags; |
225 | u32 r; | 225 | u32 r; |
226 | 226 | ||
@@ -244,7 +244,7 @@ static void emac_tx_disable(struct ocp_enet_private *dev) | |||
244 | 244 | ||
245 | static void emac_rx_enable(struct ocp_enet_private *dev) | 245 | static void emac_rx_enable(struct ocp_enet_private *dev) |
246 | { | 246 | { |
247 | struct emac_regs *p = dev->emacp; | 247 | struct emac_regs __iomem *p = dev->emacp; |
248 | unsigned long flags; | 248 | unsigned long flags; |
249 | u32 r; | 249 | u32 r; |
250 | 250 | ||
@@ -275,7 +275,7 @@ static void emac_rx_enable(struct ocp_enet_private *dev) | |||
275 | 275 | ||
276 | static void emac_rx_disable(struct ocp_enet_private *dev) | 276 | static void emac_rx_disable(struct ocp_enet_private *dev) |
277 | { | 277 | { |
278 | struct emac_regs *p = dev->emacp; | 278 | struct emac_regs __iomem *p = dev->emacp; |
279 | unsigned long flags; | 279 | unsigned long flags; |
280 | u32 r; | 280 | u32 r; |
281 | 281 | ||
@@ -299,7 +299,7 @@ static void emac_rx_disable(struct ocp_enet_private *dev) | |||
299 | 299 | ||
300 | static inline void emac_rx_disable_async(struct ocp_enet_private *dev) | 300 | static inline void emac_rx_disable_async(struct ocp_enet_private *dev) |
301 | { | 301 | { |
302 | struct emac_regs *p = dev->emacp; | 302 | struct emac_regs __iomem *p = dev->emacp; |
303 | unsigned long flags; | 303 | unsigned long flags; |
304 | u32 r; | 304 | u32 r; |
305 | 305 | ||
@@ -315,7 +315,7 @@ static inline void emac_rx_disable_async(struct ocp_enet_private *dev) | |||
315 | 315 | ||
316 | static int emac_reset(struct ocp_enet_private *dev) | 316 | static int emac_reset(struct ocp_enet_private *dev) |
317 | { | 317 | { |
318 | struct emac_regs *p = dev->emacp; | 318 | struct emac_regs __iomem *p = dev->emacp; |
319 | unsigned long flags; | 319 | unsigned long flags; |
320 | int n = 20; | 320 | int n = 20; |
321 | 321 | ||
@@ -348,7 +348,7 @@ static int emac_reset(struct ocp_enet_private *dev) | |||
348 | 348 | ||
349 | static void emac_hash_mc(struct ocp_enet_private *dev) | 349 | static void emac_hash_mc(struct ocp_enet_private *dev) |
350 | { | 350 | { |
351 | struct emac_regs *p = dev->emacp; | 351 | struct emac_regs __iomem *p = dev->emacp; |
352 | u16 gaht[4] = { 0 }; | 352 | u16 gaht[4] = { 0 }; |
353 | struct dev_mc_list *dmi; | 353 | struct dev_mc_list *dmi; |
354 | 354 | ||
@@ -393,7 +393,7 @@ static inline int emac_opb_mhz(void) | |||
393 | /* BHs disabled */ | 393 | /* BHs disabled */ |
394 | static int emac_configure(struct ocp_enet_private *dev) | 394 | static int emac_configure(struct ocp_enet_private *dev) |
395 | { | 395 | { |
396 | struct emac_regs *p = dev->emacp; | 396 | struct emac_regs __iomem *p = dev->emacp; |
397 | struct net_device *ndev = dev->ndev; | 397 | struct net_device *ndev = dev->ndev; |
398 | int gige; | 398 | int gige; |
399 | u32 r; | 399 | u32 r; |
@@ -555,7 +555,7 @@ static void emac_full_tx_reset(struct net_device *ndev) | |||
555 | 555 | ||
556 | static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg) | 556 | static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg) |
557 | { | 557 | { |
558 | struct emac_regs *p = dev->emacp; | 558 | struct emac_regs __iomem *p = dev->emacp; |
559 | u32 r; | 559 | u32 r; |
560 | int n; | 560 | int n; |
561 | 561 | ||
@@ -604,7 +604,7 @@ static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg) | |||
604 | static void __emac_mdio_write(struct ocp_enet_private *dev, u8 id, u8 reg, | 604 | static void __emac_mdio_write(struct ocp_enet_private *dev, u8 id, u8 reg, |
605 | u16 val) | 605 | u16 val) |
606 | { | 606 | { |
607 | struct emac_regs *p = dev->emacp; | 607 | struct emac_regs __iomem *p = dev->emacp; |
608 | int n; | 608 | int n; |
609 | 609 | ||
610 | DBG2("%d: mdio_write(%02x,%02x,%04x)" NL, dev->def->index, id, reg, | 610 | DBG2("%d: mdio_write(%02x,%02x,%04x)" NL, dev->def->index, id, reg, |
@@ -666,7 +666,7 @@ static void emac_mdio_write(struct net_device *ndev, int id, int reg, int val) | |||
666 | static void emac_set_multicast_list(struct net_device *ndev) | 666 | static void emac_set_multicast_list(struct net_device *ndev) |
667 | { | 667 | { |
668 | struct ocp_enet_private *dev = ndev->priv; | 668 | struct ocp_enet_private *dev = ndev->priv; |
669 | struct emac_regs *p = dev->emacp; | 669 | struct emac_regs __iomem *p = dev->emacp; |
670 | u32 rmr = emac_iff2rmr(ndev); | 670 | u32 rmr = emac_iff2rmr(ndev); |
671 | 671 | ||
672 | DBG("%d: multicast %08x" NL, dev->def->index, rmr); | 672 | DBG("%d: multicast %08x" NL, dev->def->index, rmr); |
@@ -825,7 +825,7 @@ static void emac_clean_rx_ring(struct ocp_enet_private *dev) | |||
825 | } | 825 | } |
826 | 826 | ||
827 | static inline int emac_alloc_rx_skb(struct ocp_enet_private *dev, int slot, | 827 | static inline int emac_alloc_rx_skb(struct ocp_enet_private *dev, int slot, |
828 | int flags) | 828 | gfp_t flags) |
829 | { | 829 | { |
830 | struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags); | 830 | struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags); |
831 | if (unlikely(!skb)) | 831 | if (unlikely(!skb)) |
@@ -1047,7 +1047,7 @@ static inline u16 emac_tx_csum(struct ocp_enet_private *dev, | |||
1047 | 1047 | ||
1048 | static inline int emac_xmit_finish(struct ocp_enet_private *dev, int len) | 1048 | static inline int emac_xmit_finish(struct ocp_enet_private *dev, int len) |
1049 | { | 1049 | { |
1050 | struct emac_regs *p = dev->emacp; | 1050 | struct emac_regs __iomem *p = dev->emacp; |
1051 | struct net_device *ndev = dev->ndev; | 1051 | struct net_device *ndev = dev->ndev; |
1052 | 1052 | ||
1053 | /* Send the packet out */ | 1053 | /* Send the packet out */ |
@@ -1519,7 +1519,7 @@ static void emac_rxde(void *param) | |||
1519 | static irqreturn_t emac_irq(int irq, void *dev_instance, struct pt_regs *regs) | 1519 | static irqreturn_t emac_irq(int irq, void *dev_instance, struct pt_regs *regs) |
1520 | { | 1520 | { |
1521 | struct ocp_enet_private *dev = dev_instance; | 1521 | struct ocp_enet_private *dev = dev_instance; |
1522 | struct emac_regs *p = dev->emacp; | 1522 | struct emac_regs __iomem *p = dev->emacp; |
1523 | struct ibm_emac_error_stats *st = &dev->estats; | 1523 | struct ibm_emac_error_stats *st = &dev->estats; |
1524 | 1524 | ||
1525 | u32 isr = in_be32(&p->isr); | 1525 | u32 isr = in_be32(&p->isr); |
@@ -1619,17 +1619,17 @@ static void emac_remove(struct ocp_device *ocpdev) | |||
1619 | 1619 | ||
1620 | DBG("%d: remove" NL, dev->def->index); | 1620 | DBG("%d: remove" NL, dev->def->index); |
1621 | 1621 | ||
1622 | ocp_set_drvdata(ocpdev, 0); | 1622 | ocp_set_drvdata(ocpdev, NULL); |
1623 | unregister_netdev(dev->ndev); | 1623 | unregister_netdev(dev->ndev); |
1624 | 1624 | ||
1625 | tah_fini(dev->tah_dev); | 1625 | tah_fini(dev->tah_dev); |
1626 | rgmii_fini(dev->rgmii_dev, dev->rgmii_input); | 1626 | rgmii_fini(dev->rgmii_dev, dev->rgmii_input); |
1627 | zmii_fini(dev->zmii_dev, dev->zmii_input); | 1627 | zmii_fini(dev->zmii_dev, dev->zmii_input); |
1628 | 1628 | ||
1629 | emac_dbg_register(dev->def->index, 0); | 1629 | emac_dbg_register(dev->def->index, NULL); |
1630 | 1630 | ||
1631 | mal_unregister_commac(dev->mal, &dev->commac); | 1631 | mal_unregister_commac(dev->mal, &dev->commac); |
1632 | iounmap((void *)dev->emacp); | 1632 | iounmap(dev->emacp); |
1633 | kfree(dev->ndev); | 1633 | kfree(dev->ndev); |
1634 | } | 1634 | } |
1635 | 1635 | ||
@@ -2048,9 +2048,7 @@ static int __init emac_probe(struct ocp_device *ocpdev) | |||
2048 | goto out4; | 2048 | goto out4; |
2049 | 2049 | ||
2050 | /* Map EMAC regs */ | 2050 | /* Map EMAC regs */ |
2051 | dev->emacp = | 2051 | dev->emacp = ioremap(dev->def->paddr, sizeof(struct emac_regs)); |
2052 | (struct emac_regs *)ioremap(dev->def->paddr, | ||
2053 | sizeof(struct emac_regs)); | ||
2054 | if (!dev->emacp) { | 2052 | if (!dev->emacp) { |
2055 | printk(KERN_ERR "emac%d: could not ioremap device registers!\n", | 2053 | printk(KERN_ERR "emac%d: could not ioremap device registers!\n", |
2056 | dev->def->index); | 2054 | dev->def->index); |
@@ -2210,7 +2208,7 @@ static int __init emac_probe(struct ocp_device *ocpdev) | |||
2210 | 2208 | ||
2211 | return 0; | 2209 | return 0; |
2212 | out6: | 2210 | out6: |
2213 | iounmap((void *)dev->emacp); | 2211 | iounmap(dev->emacp); |
2214 | out5: | 2212 | out5: |
2215 | tah_fini(dev->tah_dev); | 2213 | tah_fini(dev->tah_dev); |
2216 | out4: | 2214 | out4: |
diff --git a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h index 911abbaf471..f61273b2e94 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.h +++ b/drivers/net/ibm_emac/ibm_emac_core.h | |||
@@ -155,7 +155,7 @@ struct ibm_emac_error_stats { | |||
155 | 155 | ||
156 | struct ocp_enet_private { | 156 | struct ocp_enet_private { |
157 | struct net_device *ndev; /* 0 */ | 157 | struct net_device *ndev; /* 0 */ |
158 | struct emac_regs *emacp; | 158 | struct emac_regs __iomem *emacp; |
159 | 159 | ||
160 | struct mal_descriptor *tx_desc; | 160 | struct mal_descriptor *tx_desc; |
161 | int tx_cnt; | 161 | int tx_cnt; |
diff --git a/drivers/net/ibm_emac/ibm_emac_debug.c b/drivers/net/ibm_emac/ibm_emac_debug.c index 75d3b863904..c7e1ecfa08f 100644 --- a/drivers/net/ibm_emac/ibm_emac_debug.c +++ b/drivers/net/ibm_emac/ibm_emac_debug.c | |||
@@ -58,7 +58,7 @@ static void emac_desc_dump(int idx, struct ocp_enet_private *p) | |||
58 | 58 | ||
59 | static void emac_mac_dump(int idx, struct ocp_enet_private *dev) | 59 | static void emac_mac_dump(int idx, struct ocp_enet_private *dev) |
60 | { | 60 | { |
61 | struct emac_regs *p = dev->emacp; | 61 | struct emac_regs __iomem *p = dev->emacp; |
62 | 62 | ||
63 | printk("** EMAC%d registers **\n" | 63 | printk("** EMAC%d registers **\n" |
64 | "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n" | 64 | "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n" |
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h index a1ffb8a44ff..7f03d536c9a 100644 --- a/drivers/net/ibm_emac/ibm_emac_rgmii.h +++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h | |||
@@ -31,7 +31,7 @@ struct rgmii_regs { | |||
31 | 31 | ||
32 | /* RGMII device */ | 32 | /* RGMII device */ |
33 | struct ibm_ocp_rgmii { | 33 | struct ibm_ocp_rgmii { |
34 | struct rgmii_regs *base; | 34 | struct rgmii_regs __iomem *base; |
35 | int users; /* number of EMACs using this RGMII bridge */ | 35 | int users; /* number of EMACs using this RGMII bridge */ |
36 | }; | 36 | }; |
37 | 37 | ||
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c index 35c1185079e..e129e0aaa04 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.c +++ b/drivers/net/ibm_emac/ibm_emac_zmii.c | |||
@@ -80,7 +80,7 @@ static inline u32 zmii_mode_mask(int mode, int input) | |||
80 | static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode) | 80 | static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode) |
81 | { | 81 | { |
82 | struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); | 82 | struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); |
83 | struct zmii_regs *p; | 83 | struct zmii_regs __iomem *p; |
84 | 84 | ||
85 | ZMII_DBG("%d: init(%d, %d)" NL, ocpdev->def->index, input, *mode); | 85 | ZMII_DBG("%d: init(%d, %d)" NL, ocpdev->def->index, input, *mode); |
86 | 86 | ||
@@ -94,8 +94,7 @@ static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode) | |||
94 | } | 94 | } |
95 | dev->mode = PHY_MODE_NA; | 95 | dev->mode = PHY_MODE_NA; |
96 | 96 | ||
97 | p = (struct zmii_regs *)ioremap(ocpdev->def->paddr, | 97 | p = ioremap(ocpdev->def->paddr, sizeof(struct zmii_regs)); |
98 | sizeof(struct zmii_regs)); | ||
99 | if (!p) { | 98 | if (!p) { |
100 | printk(KERN_ERR | 99 | printk(KERN_ERR |
101 | "zmii%d: could not ioremap device registers!\n", | 100 | "zmii%d: could not ioremap device registers!\n", |
@@ -231,7 +230,7 @@ void __exit __zmii_fini(struct ocp_device *ocpdev, int input) | |||
231 | if (!--dev->users) { | 230 | if (!--dev->users) { |
232 | /* Free everything if this is the last user */ | 231 | /* Free everything if this is the last user */ |
233 | ocp_set_drvdata(ocpdev, NULL); | 232 | ocp_set_drvdata(ocpdev, NULL); |
234 | iounmap((void *)dev->base); | 233 | iounmap(dev->base); |
235 | kfree(dev); | 234 | kfree(dev); |
236 | } | 235 | } |
237 | } | 236 | } |
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h index 0bb26062c0a..92c85441075 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.h +++ b/drivers/net/ibm_emac/ibm_emac_zmii.h | |||
@@ -32,7 +32,7 @@ struct zmii_regs { | |||
32 | 32 | ||
33 | /* ZMII device */ | 33 | /* ZMII device */ |
34 | struct ibm_ocp_zmii { | 34 | struct ibm_ocp_zmii { |
35 | struct zmii_regs *base; | 35 | struct zmii_regs __iomem *base; |
36 | int mode; /* subset of PHY_MODE_XXXX */ | 36 | int mode; /* subset of PHY_MODE_XXXX */ |
37 | int users; /* number of EMACs using this ZMII bridge */ | 37 | int users; /* number of EMACs using this ZMII bridge */ |
38 | u32 fer_save; /* FER value left by firmware */ | 38 | u32 fer_save; /* FER value left by firmware */ |