Deleted Added
full compact
simplebus.c (266160) simplebus.c (266196)
1/*-
2 * Copyright (c) 2013 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2013 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/10/sys/dev/fdt/simplebus.c 266160 2014-05-15 17:30:16Z ian $");
28__FBSDID("$FreeBSD: stable/10/sys/dev/fdt/simplebus.c 266196 2014-05-15 21:21:47Z ian $");
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/rman.h>
36

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

396 rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx");
397 rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld");
398 return (rv);
399}
400
401static void
402simplebus_probe_nomatch(device_t bus, device_t child)
403{
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/rman.h>
36

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

396 rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx");
397 rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld");
398 return (rv);
399}
400
401static void
402simplebus_probe_nomatch(device_t bus, device_t child)
403{
404 const char *name, *type;
404 const char *name, *type, *compat;
405
406 if (!bootverbose)
407 return;
408
409 name = ofw_bus_get_name(child);
410 type = ofw_bus_get_type(child);
405
406 if (!bootverbose)
407 return;
408
409 name = ofw_bus_get_name(child);
410 type = ofw_bus_get_type(child);
411 compat = ofw_bus_get_compat(child);
411
412 device_printf(bus, "<%s>", name != NULL ? name : "unknown");
413 simplebus_print_res(device_get_ivars(child));
412
413 device_printf(bus, "<%s>", name != NULL ? name : "unknown");
414 simplebus_print_res(device_get_ivars(child));
414 printf(" type %s (no driver attached)\n",
415 type != NULL ? type : "unknown");
415 if (!ofw_bus_status_okay(child))
416 printf(" disabled");
417 if (type)
418 printf(" type %s", type);
419 if (compat)
420 printf(" compat %s", compat);
421 printf(" (no driver attached)\n");
416}
417
418static int
419simplebus_print_child(device_t bus, device_t child)
420{
421 int rv;
422
423 rv = bus_print_child_header(bus, child);
424 rv += simplebus_print_res(device_get_ivars(child));
422}
423
424static int
425simplebus_print_child(device_t bus, device_t child)
426{
427 int rv;
428
429 rv = bus_print_child_header(bus, child);
430 rv += simplebus_print_res(device_get_ivars(child));
431 if (!ofw_bus_status_okay(child))
432 rv += printf(" disabled");
425 rv += bus_print_child_footer(bus, child);
426 return (rv);
427}
433 rv += bus_print_child_footer(bus, child);
434 return (rv);
435}
428