aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/eisa
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-04-15 16:33:42 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-15 16:33:42 -0400
commit4cf9f24db3954ac5802de24c826b7ebed27760c4 (patch)
tree4b5c10c284a548c53d5ab6d646fed951fdc3469d /drivers/eisa
parentf6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff)
EISA: Use dev_printk() when possible
Use dev_printk() when possible to make messages more useful. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/eisa')
-rw-r--r--drivers/eisa/eisa-bus.c63
-rw-r--r--drivers/eisa/pci_eisa.c5
2 files changed, 30 insertions, 38 deletions
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 806c77bfd434..0b06df44ed54 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -314,22 +314,22 @@ static int __init eisa_probe(struct eisa_root_device *root)
314{ 314{
315 int i, c; 315 int i, c;
316 struct eisa_device *edev; 316 struct eisa_device *edev;
317 char *enabled_str;
317 318
318 printk(KERN_INFO "EISA: Probing bus %d at %s\n", 319 dev_info(root->dev, "Probing EISA bus %d\n", root->bus_nr);
319 root->bus_nr, dev_name(root->dev));
320 320
321 /* First try to get hold of slot 0. If there is no device 321 /* First try to get hold of slot 0. If there is no device
322 * here, simply fail, unless root->force_probe is set. */ 322 * here, simply fail, unless root->force_probe is set. */
323 323
324 edev = kzalloc(sizeof(*edev), GFP_KERNEL); 324 edev = kzalloc(sizeof(*edev), GFP_KERNEL);
325 if (!edev) { 325 if (!edev) {
326 printk(KERN_ERR "EISA: Couldn't allocate mainboard slot\n"); 326 dev_err(root->dev, "EISA: Couldn't allocate mainboard slot\n");
327 return -ENOMEM; 327 return -ENOMEM;
328 } 328 }
329 329
330 if (eisa_request_resources(root, edev, 0)) { 330 if (eisa_request_resources(root, edev, 0)) {
331 printk(KERN_WARNING \ 331 dev_warn(root->dev,
332 "EISA: Cannot allocate resource for mainboard\n"); 332 "EISA: Cannot allocate resource for mainboard\n");
333 kfree(edev); 333 kfree(edev);
334 if (!root->force_probe) 334 if (!root->force_probe)
335 return -EBUSY; 335 return -EBUSY;
@@ -344,11 +344,11 @@ static int __init eisa_probe(struct eisa_root_device *root)
344 goto force_probe; 344 goto force_probe;
345 } 345 }
346 346
347 printk(KERN_INFO "EISA: Mainboard %s detected.\n", edev->id.sig); 347 dev_info(&edev->dev, "EISA: Mainboard %s detected\n", edev->id.sig);
348 348
349 if (eisa_register_device(edev)) { 349 if (eisa_register_device(edev)) {
350 printk(KERN_ERR "EISA: Failed to register %s\n", 350 dev_err(&edev->dev, "EISA: Failed to register %s\n",
351 edev->id.sig); 351 edev->id.sig);
352 eisa_release_resources(edev); 352 eisa_release_resources(edev);
353 kfree(edev); 353 kfree(edev);
354 } 354 }
@@ -358,14 +358,15 @@ static int __init eisa_probe(struct eisa_root_device *root)
358 for (c = 0, i = 1; i <= root->slots; i++) { 358 for (c = 0, i = 1; i <= root->slots; i++) {
359 edev = kzalloc(sizeof(*edev), GFP_KERNEL); 359 edev = kzalloc(sizeof(*edev), GFP_KERNEL);
360 if (!edev) { 360 if (!edev) {
361 printk(KERN_ERR "EISA: Out of memory for slot %d\n", i); 361 dev_err(root->dev, "EISA: Out of memory for slot %d\n",
362 i);
362 continue; 363 continue;
363 } 364 }
364 365
365 if (eisa_request_resources(root, edev, i)) { 366 if (eisa_request_resources(root, edev, i)) {
366 printk(KERN_WARNING \ 367 dev_warn(root->dev,
367 "Cannot allocate resource for EISA slot %d\n", 368 "Cannot allocate resource for EISA slot %d\n",
368 i); 369 i);
369 kfree(edev); 370 kfree(edev);
370 continue; 371 continue;
371 } 372 }
@@ -375,38 +376,30 @@ static int __init eisa_probe(struct eisa_root_device *root)
375 kfree(edev); 376 kfree(edev);
376 continue; 377 continue;
377 } 378 }
378 379
379 printk(KERN_INFO "EISA: slot %d : %s detected", 380 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
380 i, edev->id.sig); 381 enabled_str = " (forced enabled)";
381 382 else if (edev->state == EISA_CONFIG_FORCED)
382 switch (edev->state) { 383 enabled_str = " (forced disabled)";
383 case EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED: 384 else if (edev->state == 0)
384 printk(" (forced enabled)"); 385 enabled_str = " (disabled)";
385 break; 386 else
386 387 enabled_str = "";
387 case EISA_CONFIG_FORCED: 388
388 printk(" (forced disabled)"); 389 dev_info(&edev->dev, "EISA: slot %d: %s detected%s\n", i,
389 break; 390 edev->id.sig, enabled_str);
390
391 case 0:
392 printk(" (disabled)");
393 break;
394 }
395
396 printk (".\n");
397 391
398 c++; 392 c++;
399 393
400 if (eisa_register_device(edev)) { 394 if (eisa_register_device(edev)) {
401 printk(KERN_ERR "EISA: Failed to register %s\n", 395 dev_err(&edev->dev, "EISA: Failed to register %s\n",
402 edev->id.sig); 396 edev->id.sig);
403 eisa_release_resources(edev); 397 eisa_release_resources(edev);
404 kfree(edev); 398 kfree(edev);
405 } 399 }
406 } 400 }
407 401
408 printk(KERN_INFO "EISA: Detected %d card%s.\n", c, c == 1 ? "" : "s"); 402 dev_info(root->dev, "EISA: Detected %d card%s\n", c, c == 1 ? "" : "s");
409
410 return 0; 403 return 0;
411} 404}
412 405
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c
index cdae207028a7..0d42ea791060 100644
--- a/drivers/eisa/pci_eisa.c
+++ b/drivers/eisa/pci_eisa.c
@@ -25,8 +25,7 @@ static int __init pci_eisa_init(struct pci_dev *pdev,
25 int rc; 25 int rc;
26 26
27 if ((rc = pci_enable_device (pdev))) { 27 if ((rc = pci_enable_device (pdev))) {
28 printk (KERN_ERR "pci_eisa : Could not enable device %s\n", 28 dev_err(&pdev->dev, "Could not enable device\n");
29 pci_name(pdev));
30 return rc; 29 return rc;
31 } 30 }
32 31
@@ -38,7 +37,7 @@ static int __init pci_eisa_init(struct pci_dev *pdev,
38 dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); 37 dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
39 38
40 if (eisa_root_register (&pci_eisa_root)) { 39 if (eisa_root_register (&pci_eisa_root)) {
41 printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); 40 dev_err(&pdev->dev, "Could not register EISA root\n");
42 return -1; 41 return -1;
43 } 42 }
44 43