Author: emaste
Date: Thu Sep 16 23:33:24 2010
New Revision: 212773
URL: http://svn.freebsd.org/changeset/base/212773

Log:
  Use device_printf where possible, and otherwise at least include the
  driver name in printf strings.
  
  Reported by:  Mark Johnston

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aac/aac_cam.c
  head/sys/dev/aac/aac_disk.c

Modified: head/sys/dev/aac/aac.c
==============================================================================
--- head/sys/dev/aac/aac.c      Thu Sep 16 22:54:56 2010        (r212772)
+++ head/sys/dev/aac/aac.c      Thu Sep 16 23:33:24 2010        (r212773)
@@ -391,7 +391,7 @@ aac_get_container_info(struct aac_softc 
 
        if (aac_sync_fib(sc, ContainerCommand, 0, fib,
                         sizeof(struct aac_mntinfo))) {
-               printf("Error probing container %d\n", cid);
+               device_printf(sc->aac_dev, "Error probing container %d\n", cid);
                return (NULL);
        }
 

Modified: head/sys/dev/aac/aac_cam.c
==============================================================================
--- head/sys/dev/aac/aac_cam.c  Thu Sep 16 22:54:56 2010        (r212772)
+++ head/sys/dev/aac/aac_cam.c  Thu Sep 16 23:33:24 2010        (r212773)
@@ -569,7 +569,7 @@ aac_cam_reset_bus(struct cam_sim *sim, u
        sc = camsc->inf->aac_sc;
 
        if (sc == NULL) {
-               printf("Null sc?\n");
+               printf("aac: Null sc?\n");
                return (CAM_REQ_ABORTED);
        }
 

Modified: head/sys/dev/aac/aac_disk.c
==============================================================================
--- head/sys/dev/aac/aac_disk.c Thu Sep 16 22:54:56 2010        (r212772)
+++ head/sys/dev/aac/aac_disk.c Thu Sep 16 23:33:24 2010        (r212773)
@@ -106,8 +106,9 @@ aac_disk_open(struct disk *dp)
 
        /* check that the controller is up and running */
        if (sc->ad_controller->aac_state & AAC_STATE_SUSPEND) {
-               printf("Controller Suspended controller state = 0x%x\n",
-                      sc->ad_controller->aac_state);
+               device_printf(sc->ad_controller->aac_dev,
+                   "Controller Suspended controller state = 0x%x\n",
+                   sc->ad_controller->aac_state);
                return(ENXIO);
        }
 
@@ -252,7 +253,8 @@ aac_disk_dump(void *arg, void *virtual, 
        if (!first) {
                first = 1;
                if (bus_dmamap_create(sc->aac_buffer_dmat, 0, &dump_datamap)) {
-                       printf("bus_dmamap_create failed\n");
+                       device_printf(sc->aac_dev,
+                           "bus_dmamap_create failed\n");
                        return (ENOMEM);
                }
        }
@@ -305,8 +307,9 @@ aac_disk_dump(void *arg, void *virtual, 
                size += fib->Header.Size;
 
                if (aac_sync_fib(sc, command, 0, fib, size)) {
-                       printf("Error dumping block 0x%jx\n",
-                              (uintmax_t)physical);
+                       device_printf(sc->aac_dev,
+                            "Error dumping block 0x%jx\n",
+                            (uintmax_t)physical);
                        return (EIO);
                }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to