diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-01-31 06:25:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-03 07:26:09 -0500 |
commit | 237c5e8ee2328c31a130d35e32f7a2260c4512aa (patch) | |
tree | 40bb25b5e8359d46162da197670c1ba8fbccf1c6 | |
parent | 06c3fd6ad546f7e6e996ca1fc2cddd9c7aee8176 (diff) |
NET: AX88796 use dev_dbg() instead of printk()
Change to using dev_dbg() and the other dev_xxx()
macros instead of printk, and update to use the
print_mac() helper.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ax88796.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 7495a9ee8f4b..194949afacd0 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c | |||
@@ -137,11 +137,12 @@ static int ax_initial_check(struct net_device *dev) | |||
137 | static void ax_reset_8390(struct net_device *dev) | 137 | static void ax_reset_8390(struct net_device *dev) |
138 | { | 138 | { |
139 | struct ei_device *ei_local = netdev_priv(dev); | 139 | struct ei_device *ei_local = netdev_priv(dev); |
140 | struct ax_device *ax = to_ax_dev(dev); | ||
140 | unsigned long reset_start_time = jiffies; | 141 | unsigned long reset_start_time = jiffies; |
141 | void __iomem *addr = (void __iomem *)dev->base_addr; | 142 | void __iomem *addr = (void __iomem *)dev->base_addr; |
142 | 143 | ||
143 | if (ei_debug > 1) | 144 | if (ei_debug > 1) |
144 | printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies); | 145 | dev_dbg(&ax->dev->dev, "resetting the 8390 t=%ld\n", jiffies); |
145 | 146 | ||
146 | ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET); | 147 | ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET); |
147 | 148 | ||
@@ -151,7 +152,7 @@ static void ax_reset_8390(struct net_device *dev) | |||
151 | /* This check _should_not_ be necessary, omit eventually. */ | 152 | /* This check _should_not_ be necessary, omit eventually. */ |
152 | while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) { | 153 | while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) { |
153 | if (jiffies - reset_start_time > 2*HZ/100) { | 154 | if (jiffies - reset_start_time > 2*HZ/100) { |
154 | printk(KERN_WARNING "%s: %s did not complete.\n", | 155 | dev_warn(&ax->dev->dev, "%s: %s did not complete.\n", |
155 | __FUNCTION__, dev->name); | 156 | __FUNCTION__, dev->name); |
156 | break; | 157 | break; |
157 | } | 158 | } |
@@ -165,13 +166,15 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, | |||
165 | int ring_page) | 166 | int ring_page) |
166 | { | 167 | { |
167 | struct ei_device *ei_local = netdev_priv(dev); | 168 | struct ei_device *ei_local = netdev_priv(dev); |
169 | struct ax_device *ax = to_ax_dev(dev); | ||
168 | void __iomem *nic_base = ei_local->mem; | 170 | void __iomem *nic_base = ei_local->mem; |
169 | 171 | ||
170 | /* This *shouldn't* happen. If it does, it's the last thing you'll see */ | 172 | /* This *shouldn't* happen. If it does, it's the last thing you'll see */ |
171 | if (ei_status.dmaing) { | 173 | if (ei_status.dmaing) { |
172 | printk(KERN_EMERG "%s: DMAing conflict in %s [DMAstat:%d][irqlock:%d].\n", | 174 | dev_err(&ax->dev->dev, "%s: DMAing conflict in %s " |
175 | "[DMAstat:%d][irqlock:%d].\n", | ||
173 | dev->name, __FUNCTION__, | 176 | dev->name, __FUNCTION__, |
174 | ei_status.dmaing, ei_status.irqlock); | 177 | ei_status.dmaing, ei_status.irqlock); |
175 | return; | 178 | return; |
176 | } | 179 | } |
177 | 180 | ||
@@ -204,13 +207,16 @@ static void ax_block_input(struct net_device *dev, int count, | |||
204 | struct sk_buff *skb, int ring_offset) | 207 | struct sk_buff *skb, int ring_offset) |
205 | { | 208 | { |
206 | struct ei_device *ei_local = netdev_priv(dev); | 209 | struct ei_device *ei_local = netdev_priv(dev); |
210 | struct ax_device *ax = to_ax_dev(dev); | ||
207 | void __iomem *nic_base = ei_local->mem; | 211 | void __iomem *nic_base = ei_local->mem; |
208 | char *buf = skb->data; | 212 | char *buf = skb->data; |
209 | 213 | ||
210 | if (ei_status.dmaing) { | 214 | if (ei_status.dmaing) { |
211 | printk(KERN_EMERG "%s: DMAing conflict in ax_block_input " | 215 | dev_err(&ax->dev->dev, |
216 | "%s: DMAing conflict in %s " | ||
212 | "[DMAstat:%d][irqlock:%d].\n", | 217 | "[DMAstat:%d][irqlock:%d].\n", |
213 | dev->name, ei_status.dmaing, ei_status.irqlock); | 218 | dev->name, __FUNCTION__, |
219 | ei_status.dmaing, ei_status.irqlock); | ||
214 | return; | 220 | return; |
215 | } | 221 | } |
216 | 222 | ||
@@ -239,6 +245,7 @@ static void ax_block_output(struct net_device *dev, int count, | |||
239 | const unsigned char *buf, const int start_page) | 245 | const unsigned char *buf, const int start_page) |
240 | { | 246 | { |
241 | struct ei_device *ei_local = netdev_priv(dev); | 247 | struct ei_device *ei_local = netdev_priv(dev); |
248 | struct ax_device *ax = to_ax_dev(dev); | ||
242 | void __iomem *nic_base = ei_local->mem; | 249 | void __iomem *nic_base = ei_local->mem; |
243 | unsigned long dma_start; | 250 | unsigned long dma_start; |
244 | 251 | ||
@@ -251,7 +258,7 @@ static void ax_block_output(struct net_device *dev, int count, | |||
251 | 258 | ||
252 | /* This *shouldn't* happen. If it does, it's the last thing you'll see */ | 259 | /* This *shouldn't* happen. If it does, it's the last thing you'll see */ |
253 | if (ei_status.dmaing) { | 260 | if (ei_status.dmaing) { |
254 | printk(KERN_EMERG "%s: DMAing conflict in %s." | 261 | dev_err(&ax->dev->dev, "%s: DMAing conflict in %s." |
255 | "[DMAstat:%d][irqlock:%d]\n", | 262 | "[DMAstat:%d][irqlock:%d]\n", |
256 | dev->name, __FUNCTION__, | 263 | dev->name, __FUNCTION__, |
257 | ei_status.dmaing, ei_status.irqlock); | 264 | ei_status.dmaing, ei_status.irqlock); |
@@ -281,7 +288,8 @@ static void ax_block_output(struct net_device *dev, int count, | |||
281 | 288 | ||
282 | while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) { | 289 | while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) { |
283 | if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ | 290 | if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ |
284 | printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); | 291 | dev_warn(&ax->dev->dev, |
292 | "%s: timeout waiting for Tx RDC.\n", dev->name); | ||
285 | ax_reset_8390(dev); | 293 | ax_reset_8390(dev); |
286 | ax_NS8390_init(dev,1); | 294 | ax_NS8390_init(dev,1); |
287 | break; | 295 | break; |
@@ -424,10 +432,11 @@ static void | |||
424 | ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value) | 432 | ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value) |
425 | { | 433 | { |
426 | struct ei_device *ei = (struct ei_device *) netdev_priv(dev); | 434 | struct ei_device *ei = (struct ei_device *) netdev_priv(dev); |
435 | struct ax_device *ax = to_ax_dev(dev); | ||
427 | unsigned long flags; | 436 | unsigned long flags; |
428 | 437 | ||
429 | printk(KERN_DEBUG "%s: %p, %04x, %04x %04x\n", | 438 | dev_dbg(&ax->dev->dev, "%s: %p, %04x, %04x %04x\n", |
430 | __FUNCTION__, dev, phy_addr, reg, value); | 439 | __FUNCTION__, dev, phy_addr, reg, value); |
431 | 440 | ||
432 | spin_lock_irqsave(&ei->page_lock, flags); | 441 | spin_lock_irqsave(&ei->page_lock, flags); |
433 | 442 | ||
@@ -750,14 +759,11 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
750 | ax_NS8390_init(dev, 0); | 759 | ax_NS8390_init(dev, 0); |
751 | 760 | ||
752 | if (first_init) { | 761 | if (first_init) { |
753 | printk("AX88796: %dbit, irq %d, %lx, MAC: ", | 762 | DECLARE_MAC_BUF(mac); |
754 | ei_status.word16 ? 16:8, dev->irq, dev->base_addr); | ||
755 | |||
756 | for (i = 0; i < ETHER_ADDR_LEN; i++) | ||
757 | printk("%2.2x%c", dev->dev_addr[i], | ||
758 | (i < (ETHER_ADDR_LEN-1) ? ':' : ' ')); | ||
759 | 763 | ||
760 | printk("\n"); | 764 | dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %s\n", |
765 | ei_status.word16 ? 16:8, dev->irq, dev->base_addr, | ||
766 | print_mac(mac, dev->dev_addr)); | ||
761 | } | 767 | } |
762 | 768 | ||
763 | ret = register_netdev(dev); | 769 | ret = register_netdev(dev); |