summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-03-04 15:17:05 +0000
committermarius <marius@FreeBSD.org>2005-03-04 15:17:05 +0000
commitef7b3cc47d9891ce900fa96ee45a96de86c71af6 (patch)
treeb88d7c9c12b8c01e96f20760f441874e48d2c40e
parentdd4d0b565925ad128efe7afe165f0f76c701b702 (diff)
downloadFreeBSD-src-ef7b3cc47d9891ce900fa96ee45a96de86c71af6.zip
FreeBSD-src-ef7b3cc47d9891ce900fa96ee45a96de86c71af6.tar.gz
Minor changes:
- Use FBSDID. - Remove an unused include. - Use auto-generated typedefs for the prototypes of the device interface functions. - Terminate the output of device_printf(9) with a newline char. - Honour the return value of malloc(3). MFC after: 1 month
-rw-r--r--sys/sparc64/central/central.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/sparc64/central/central.c b/sys/sparc64/central/central.c
index d26f9af..3b04704 100644
--- a/sys/sparc64/central/central.c
+++ b/sys/sparc64/central/central.c
@@ -22,10 +22,11 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -44,7 +45,6 @@
#include <sys/rman.h>
#include <sparc64/sbus/ofw_sbus.h>
-#include <sparc64/sbus/sbusreg.h>
struct central_devinfo {
char *cdi_compat;
@@ -60,12 +60,10 @@ struct central_softc {
struct sbus_ranges *sc_ranges;
};
-static int central_probe(device_t dev);
-static int central_attach(device_t dev);
-
-static void central_probe_nomatch(device_t dev, device_t child);
-static struct resource *central_alloc_resource(device_t, device_t, int, int *,
- u_long, u_long, u_long, u_int);
+static device_probe_t central_probe;
+static device_attach_t central_attach;
+static bus_probe_nomatch_t central_probe_nomatch;
+static bus_alloc_resource_t central_alloc_resource;
static ofw_bus_get_compat_t central_get_compat;
static ofw_bus_get_model_t central_get_model;
static ofw_bus_get_name_t central_get_name;
@@ -135,7 +133,7 @@ central_attach(device_t dev)
sc->sc_nrange = OF_getprop_alloc(node, "ranges",
sizeof(*sc->sc_ranges), (void **)&sc->sc_ranges);
if (sc->sc_nrange == -1) {
- device_printf(dev, "can't get ranges");
+ device_printf(dev, "can't get ranges\n");
return (ENXIO);
}
@@ -144,8 +142,9 @@ central_attach(device_t dev)
continue;
cdev = device_add_child(dev, NULL, -1);
if (cdev != NULL) {
- cdi = malloc(sizeof(*cdi), M_DEVBUF,
- M_WAITOK | M_ZERO);
+ cdi = malloc(sizeof(*cdi), M_DEVBUF, M_WAITOK | M_ZERO);
+ if (cdi == NULL)
+ continue;
cdi->cdi_name = name;
cdi->cdi_node = child;
OF_getprop_alloc(child, "compatible", 1,
OpenPOWER on IntegriCloud