Use aprint*() instead of printf() in the attach function.

KNF.
This commit is contained in:
msaitoh 2016-07-14 04:12:08 +00:00
parent 663ec00239
commit 1e88b6113d

View File

@ -1,4 +1,4 @@
/* $NetBSD: iop_pci.c,v 1.28 2014/03/29 19:28:25 christos Exp $ */ /* $NetBSD: iop_pci.c,v 1.29 2016/07/14 04:12:08 msaitoh Exp $ */
/*- /*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc. * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iop_pci.c,v 1.28 2014/03/29 19:28:25 christos Exp $"); __KERNEL_RCSID(0, "$NetBSD: iop_pci.c,v 1.29 2016/07/14 04:12:08 msaitoh Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -134,7 +134,7 @@ iop_pci_attach(device_t parent, device_t self, void *aux)
} }
} }
if (i == PCI_MAPREG_END) { if (i == PCI_MAPREG_END) {
printf("can't find mapping\n"); aprint_error("can't find mapping\n");
return; return;
} }
@ -150,7 +150,7 @@ iop_pci_attach(device_t parent, device_t self, void *aux)
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DPT_RAID_2005S) { PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DPT_RAID_2005S) {
i += 4; /* next BAR */ i += 4; /* next BAR */
if (i == PCI_MAPREG_END) { if (i == PCI_MAPREG_END) {
printf("can't find mapping\n"); aprint_error("can't find mapping\n");
return; return;
} }
@ -161,7 +161,8 @@ iop_pci_attach(device_t parent, device_t self, void *aux)
#endif #endif
if (pci_mapreg_map(pa, i, PCI_MAPREG_TYPE_MEM, 0, if (pci_mapreg_map(pa, i, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_msg_iot, &sc->sc_msg_ioh, NULL, NULL)) { &sc->sc_msg_iot, &sc->sc_msg_ioh, NULL, NULL)) {
aprint_error_dev(self, "can't map 2nd register window\n"); aprint_error_dev(self,
"can't map 2nd register window\n");
return; return;
} }
} else { } else {
@ -183,16 +184,16 @@ iop_pci_attach(device_t parent, device_t self, void *aux)
/* Map and establish the interrupt.. */ /* Map and establish the interrupt.. */
if (pci_intr_map(pa, &ih)) { if (pci_intr_map(pa, &ih)) {
printf("can't map interrupt\n"); aprint_error("can't map interrupt\n");
return; return;
} }
intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf)); intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, iop_intr, sc); sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, iop_intr, sc);
if (sc->sc_ih == NULL) { if (sc->sc_ih == NULL) {
printf("can't establish interrupt"); aprint_error("can't establish interrupt");
if (intrstr != NULL) if (intrstr != NULL)
printf(" at %s", intrstr); aprint_error(" at %s", intrstr);
printf("\n"); aprint_error("\n");
return; return;
} }