Deleted Added
full compact
ofwbus.c (103601) ofwbus.c (109623)
1/*
2 * Copyright 1998 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 38 unchanged lines hidden (view full) ---

47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
54 *
1/*
2 * Copyright 1998 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 38 unchanged lines hidden (view full) ---

47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
54 *
55 * $FreeBSD: head/sys/powerpc/aim/nexus.c 103601 2002-09-19 04:31:04Z grehan $
55 * $FreeBSD: head/sys/powerpc/aim/nexus.c 109623 2003-01-21 08:56:16Z alfred $
56 */
57#include "opt_psim.h"
58
59#include <sys/param.h>
60#include <sys/systm.h>
61#include <sys/bus.h>
62#include <sys/cons.h>
63#include <sys/kernel.h>

--- 323 unchanged lines hidden (view full) ---

387 struct nexus_devinfo *dinfo;
388 char *name, *type, *compatible;
389
390 OF_getprop_alloc(node, "name", 1, (void **)&name);
391 OF_getprop_alloc(node, "device_type", 1, (void **)&type);
392 OF_getprop_alloc(node, "compatible", 1, (void **)&compatible);
393 cdev = device_add_child(parent, NULL, -1);
394 if (cdev != NULL) {
56 */
57#include "opt_psim.h"
58
59#include <sys/param.h>
60#include <sys/systm.h>
61#include <sys/bus.h>
62#include <sys/cons.h>
63#include <sys/kernel.h>

--- 323 unchanged lines hidden (view full) ---

387 struct nexus_devinfo *dinfo;
388 char *name, *type, *compatible;
389
390 OF_getprop_alloc(node, "name", 1, (void **)&name);
391 OF_getprop_alloc(node, "device_type", 1, (void **)&type);
392 OF_getprop_alloc(node, "compatible", 1, (void **)&compatible);
393 cdev = device_add_child(parent, NULL, -1);
394 if (cdev != NULL) {
395 dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK);
395 dinfo = malloc(sizeof(*dinfo), M_NEXUS, 0);
396 dinfo->ndi_node = node;
397 dinfo->ndi_name = name;
398 dinfo->ndi_device_type = type;
399 dinfo->ndi_compatible = compatible;
400 device_set_ivars(cdev, dinfo);
401 } else
402 free(name, M_OFWPROP);
403
404 return (cdev);
405}
396 dinfo->ndi_node = node;
397 dinfo->ndi_name = name;
398 dinfo->ndi_device_type = type;
399 dinfo->ndi_compatible = compatible;
400 device_set_ivars(cdev, dinfo);
401 } else
402 free(name, M_OFWPROP);
403
404 return (cdev);
405}