aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-02-24 18:27:25 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-26 14:40:02 -0500
commitbbc2f23a8f32cb403136d20cbed5fd056c1f6a7b (patch)
tree237581e6a40a7f2e421a76808f31eb883afdacfe
parent3d16bada58b2bdd15a840be09c04f49b40641838 (diff)
net/sonic: Clean up and modernize log messages
Add missing printk severity levels by adopting pr_foo() calls for the platform_driver and dev_foo() calls for the nubus_driver. Avoid KERN_CONT usage as per advice from checkpatch. Avoid #ifdef around printk calls. Don't log driver probe messages after calling register_netdev(). Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Chris Zankel <chris@zankel.net> Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/natsemi/jazzsonic.c13
-rw-r--r--drivers/net/ethernet/natsemi/macsonic.c49
-rw-r--r--drivers/net/ethernet/natsemi/xtsonic.c11
3 files changed, 33 insertions, 40 deletions
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index d5b28884e21e..58495316d318 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -142,17 +142,14 @@ static int sonic_probe1(struct net_device *dev)
142 i++; 142 i++;
143 143
144 if (known_revisions[i] == 0xffff) { 144 if (known_revisions[i] == 0xffff) {
145 printk("SONIC ethernet controller not found (0x%4x)\n", 145 pr_info("SONIC ethernet controller not found (0x%4x)\n",
146 silicon_revision); 146 silicon_revision);
147 goto out; 147 goto out;
148 } 148 }
149 149
150 if (sonic_debug && version_printed++ == 0) 150 if (sonic_debug && version_printed++ == 0)
151 printk(version); 151 printk(version);
152 152
153 printk(KERN_INFO "%s: Sonic ethernet found at 0x%08lx, ",
154 dev_name(lp->device), dev->base_addr);
155
156 /* 153 /*
157 * Put the sonic into software reset, then 154 * Put the sonic into software reset, then
158 * retrieve and print the ethernet address. 155 * retrieve and print the ethernet address.
@@ -245,12 +242,14 @@ static int jazz_sonic_probe(struct platform_device *pdev)
245 err = sonic_probe1(dev); 242 err = sonic_probe1(dev);
246 if (err) 243 if (err)
247 goto out; 244 goto out;
245
246 pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
247 dev->base_addr, dev->dev_addr, dev->irq);
248
248 err = register_netdev(dev); 249 err = register_netdev(dev);
249 if (err) 250 if (err)
250 goto out1; 251 goto out1;
251 252
252 printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
253
254 return 0; 253 return 0;
255 254
256out1: 255out1:
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index f6745a893c82..dc690f287a6d 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -311,8 +311,6 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
311 int sr; 311 int sr;
312 bool commslot = macintosh_config->expansion_type == MAC_EXP_PDS_COMM; 312 bool commslot = macintosh_config->expansion_type == MAC_EXP_PDS_COMM;
313 313
314 printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
315
316 /* Bogus probing, on the models which may or may not have 314 /* Bogus probing, on the models which may or may not have
317 Ethernet (BTW, the Ethernet *is* always at the same 315 Ethernet (BTW, the Ethernet *is* always at the same
318 address, and nothing else lives there, at least if Apple's 316 address, and nothing else lives there, at least if Apple's
@@ -322,13 +320,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
322 320
323 card_present = hwreg_present((void*)ONBOARD_SONIC_REGISTERS); 321 card_present = hwreg_present((void*)ONBOARD_SONIC_REGISTERS);
324 if (!card_present) { 322 if (!card_present) {
325 printk("none.\n"); 323 pr_info("Onboard/comm-slot SONIC not found\n");
326 return -ENODEV; 324 return -ENODEV;
327 } 325 }
328 } 326 }
329 327
330 printk("yes\n");
331
332 /* Danger! My arms are flailing wildly! You *must* set lp->reg_offset 328 /* Danger! My arms are flailing wildly! You *must* set lp->reg_offset
333 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */ 329 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
334 dev->base_addr = ONBOARD_SONIC_REGISTERS; 330 dev->base_addr = ONBOARD_SONIC_REGISTERS;
@@ -341,14 +337,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
341 printk(KERN_INFO "%s", version); 337 printk(KERN_INFO "%s", version);
342 sonic_version_printed = 1; 338 sonic_version_printed = 1;
343 } 339 }
344 printk(KERN_INFO "%s: onboard / comm-slot SONIC at 0x%08lx\n",
345 dev_name(lp->device), dev->base_addr);
346 340
347 /* The PowerBook's SONIC is 16 bit always. */ 341 /* The PowerBook's SONIC is 16 bit always. */
348 if (macintosh_config->ident == MAC_MODEL_PB520) { 342 if (macintosh_config->ident == MAC_MODEL_PB520) {
349 lp->reg_offset = 0; 343 lp->reg_offset = 0;
350 lp->dma_bitmode = SONIC_BITMODE16; 344 lp->dma_bitmode = SONIC_BITMODE16;
351 sr = SONIC_READ(SONIC_SR);
352 } else if (commslot) { 345 } else if (commslot) {
353 /* Some of the comm-slot cards are 16 bit. But some 346 /* Some of the comm-slot cards are 16 bit. But some
354 of them are not. The 32-bit cards use offset 2 and 347 of them are not. The 32-bit cards use offset 2 and
@@ -365,22 +358,21 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
365 else { 358 else {
366 lp->dma_bitmode = SONIC_BITMODE16; 359 lp->dma_bitmode = SONIC_BITMODE16;
367 lp->reg_offset = 0; 360 lp->reg_offset = 0;
368 sr = SONIC_READ(SONIC_SR);
369 } 361 }
370 } else { 362 } else {
371 /* All onboard cards are at offset 2 with 32 bit DMA. */ 363 /* All onboard cards are at offset 2 with 32 bit DMA. */
372 lp->reg_offset = 2; 364 lp->reg_offset = 2;
373 lp->dma_bitmode = SONIC_BITMODE32; 365 lp->dma_bitmode = SONIC_BITMODE32;
374 sr = SONIC_READ(SONIC_SR);
375 } 366 }
376 printk(KERN_INFO
377 "%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
378 dev_name(lp->device), sr, lp->dma_bitmode?32:16, lp->reg_offset);
379 367
380#if 0 /* This is sometimes useful to find out how MacOS configured the card. */ 368 pr_info("Onboard/comm-slot SONIC, revision 0x%04x, %d bit DMA, register offset %d\n",
381 printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", dev_name(lp->device), 369 SONIC_READ(SONIC_SR), lp->dma_bitmode ? 32 : 16,
382 SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff); 370 lp->reg_offset);
383#endif 371
372 /* This is sometimes useful to find out how MacOS configured the card */
373 pr_debug("%s: DCR=0x%04x, DCR2=0x%04x\n", __func__,
374 SONIC_READ(SONIC_DCR) & 0xffff,
375 SONIC_READ(SONIC_DCR2) & 0xffff);
384 376
385 /* Software reset, then initialize control registers. */ 377 /* Software reset, then initialize control registers. */
386 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); 378 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
@@ -401,6 +393,9 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
401 /* Now look for the MAC address. */ 393 /* Now look for the MAC address. */
402 mac_onboard_sonic_ethernet_addr(dev); 394 mac_onboard_sonic_ethernet_addr(dev);
403 395
396 pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
397 dev->base_addr, dev->dev_addr, dev->irq);
398
404 /* Shared init code */ 399 /* Shared init code */
405 return macsonic_init(dev); 400 return macsonic_init(dev);
406} 401}
@@ -508,15 +503,15 @@ static int mac_sonic_nubus_probe_board(struct nubus_board *board, int id,
508 printk(KERN_INFO "%s", version); 503 printk(KERN_INFO "%s", version);
509 sonic_version_printed = 1; 504 sonic_version_printed = 1;
510 } 505 }
511 printk(KERN_INFO "%s: %s in slot %X\n", 506
512 dev_name(lp->device), board->name, board->slot); 507 dev_info(&board->dev, "%s, revision 0x%04x, %d bit DMA, register offset %d\n",
513 printk(KERN_INFO "%s: revision 0x%04x, using %d bit DMA and register offset %d\n", 508 board->name, SONIC_READ(SONIC_SR),
514 dev_name(lp->device), SONIC_READ(SONIC_SR), dma_bitmode?32:16, reg_offset); 509 lp->dma_bitmode ? 32 : 16, lp->reg_offset);
515 510
516#if 0 /* This is sometimes useful to find out how MacOS configured the card. */ 511 /* This is sometimes useful to find out how MacOS configured the card */
517 printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", dev_name(lp->device), 512 dev_dbg(&board->dev, "%s: DCR=0x%04x, DCR2=0x%04x\n", __func__,
518 SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff); 513 SONIC_READ(SONIC_DCR) & 0xffff,
519#endif 514 SONIC_READ(SONIC_DCR2) & 0xffff);
520 515
521 /* Software reset, then initialize control registers. */ 516 /* Software reset, then initialize control registers. */
522 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); 517 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
@@ -564,8 +559,6 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
564 if (err) 559 if (err)
565 goto out; 560 goto out;
566 561
567 printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
568
569 return 0; 562 return 0;
570 563
571out: 564out:
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index 1817deea98a4..d1659c75cce8 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -155,8 +155,8 @@ static int __init sonic_probe1(struct net_device *dev)
155 i++; 155 i++;
156 156
157 if (known_revisions[i] == 0xffff) { 157 if (known_revisions[i] == 0xffff) {
158 printk("SONIC ethernet controller not found (0x%4x)\n", 158 pr_info("SONIC ethernet controller not found (0x%4x)\n",
159 silicon_revision); 159 silicon_revision);
160 return -ENODEV; 160 return -ENODEV;
161 } 161 }
162 162
@@ -273,12 +273,13 @@ int xtsonic_probe(struct platform_device *pdev)
273 273
274 if ((err = sonic_probe1(dev))) 274 if ((err = sonic_probe1(dev)))
275 goto out; 275 goto out;
276
277 pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
278 dev->base_addr, dev->dev_addr, dev->irq);
279
276 if ((err = register_netdev(dev))) 280 if ((err = register_netdev(dev)))
277 goto out1; 281 goto out1;
278 282
279 printk("%s: SONIC ethernet @%08lx, MAC %pM, IRQ %d\n", dev->name,
280 dev->base_addr, dev->dev_addr, dev->irq);
281
282 return 0; 283 return 0;
283 284
284out1: 285out1: