use aprint_*_dev and device_xname trunk
authorcegger <cegger@NetBSD.org>
Sat, 05 Apr 2008 13:49:36 +0000
branchtrunk
changeset 168572 85f7b30e27c8
parent 168571 19219700a2cb
child 168573 e8d9e34bee56
use aprint_*_dev and device_xname
sys/net/if_etherip.c
sys/nfs/nfs_boot.c
--- a/sys/net/if_etherip.c	Sat Apr 05 13:40:05 2008 +0000
+++ b/sys/net/if_etherip.c	Sat Apr 05 13:49:36 2008 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_etherip.c,v 1.17 2008/02/20 17:05:53 matt Exp $        */
+/*      $NetBSD: if_etherip.c,v 1.18 2008/04/05 13:53:07 cegger Exp $        */
 
 /*
  *  Copyright (c) 2006, Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.17 2008/02/20 17:05:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.18 2008/04/05 13:53:07 cegger Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -221,7 +221,7 @@
 	ui = (tv.tv_sec ^ tv.tv_usec) & 0xffffff;
 	memcpy(enaddr+3, (uint8_t *)&ui, 3);
 	
-	aprint_verbose("%s: Ethernet address %s\n", sc->sc_dev.dv_xname,
+	aprint_verbose_dev(&sc->sc_dev, "Ethernet address %s\n",
 		       ether_snprintf(enaddrstr, sizeof(enaddrstr), enaddr));
 
 	/*
@@ -246,7 +246,7 @@
 	 * to support IPv6.
 	 */
 	ifp = &sc->sc_ec.ec_if;
-	strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
+	strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ);
 	ifp->if_softc = sc;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = etherip_ioctl;
@@ -273,13 +273,13 @@
 	 * etherip_sysctl_handler for details.
 	 */
 	error = sysctl_createv(NULL, 0, NULL, &node, CTLFLAG_READWRITE, 
-			       CTLTYPE_STRING, sc->sc_dev.dv_xname, NULL,
+			       CTLTYPE_STRING, device_xname(&sc->sc_dev), NULL,
 			       etherip_sysctl_handler, 0, sc, 18, CTL_NET,
 			       AF_LINK, etherip_node, device_unit(&sc->sc_dev),
 			       CTL_EOL);
 	if (error)
-		aprint_error("%s: sysctl_createv returned %d, ignoring\n",
-			     sc->sc_dev.dv_xname, error);
+		aprint_error_dev(&sc->sc_dev, "sysctl_createv returned %d, ignoring\n",
+			     error);
 
 	/* insert into etherip_softc_list */
 	LIST_INSERT_HEAD(&etherip_softc_list, sc, etherip_list);
@@ -309,8 +309,8 @@
 	error = sysctl_destroyv(NULL, CTL_NET, AF_LINK, etherip_node,
 				device_unit(&sc->sc_dev), CTL_EOL);
 	if (error)
-		aprint_error("%s: sysctl_destroyv returned %d, ignoring\n",
-			     sc->sc_dev.dv_xname, error);
+		aprint_error_dev(&sc->sc_dev, "sysctl_destroyv returned %d, ignoring\n",
+			     error);
 
 	LIST_REMOVE(sc, etherip_list);
 	etherip_delete_tunnel(ifp);
@@ -625,8 +625,7 @@
 	int error;
 
 	if ((error = config_detach(dev, 0)) != 0)
-		aprint_error("%s: unable to detach instance\n",
-			     dev->dv_xname);
+		aprint_error_dev(dev, "unable to detach instance\n");
 	FREE(cf, M_DEVBUF);
 
 	return error;
--- a/sys/nfs/nfs_boot.c	Sat Apr 05 13:40:05 2008 +0000
+++ b/sys/nfs/nfs_boot.c	Sat Apr 05 13:49:36 2008 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_boot.c,v 1.69 2007/08/31 22:02:58 dyoung Exp $	*/
+/*	$NetBSD: nfs_boot.c,v 1.70 2008/04/05 13:49:36 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.69 2007/08/31 22:02:58 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.70 2008/04/05 13:49:36 cegger Exp $");
 
 #include "opt_nfs.h"
 #include "opt_tftproot.h"
@@ -119,10 +119,10 @@
 	/*
 	 * Find the network interface.
 	 */
-	ifp = ifunit(root_device->dv_xname);
+	ifp = ifunit(device_xname(root_device));
 	if (ifp == NULL) {
 		printf("nfs_boot: '%s' not found\n",
-		       root_device->dv_xname);
+		       device_xname(root_device));
 		return (ENXIO);
 	}
 	nd->nd_ifp = ifp;