Deleted Added
full compact
gpiobus.c (286845) gpiobus.c (286909)
1/*-
2 * Copyright (c) 2009 Oleksandr Tymoshenko <gonzo@freebsd.org>
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) 2009 Oleksandr Tymoshenko <gonzo@freebsd.org>
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: head/sys/dev/gpio/gpiobus.c 286845 2015-08-17 16:51:37Z loos $");
28__FBSDID("$FreeBSD: head/sys/dev/gpio/gpiobus.c 286909 2015-08-18 21:37:14Z loos $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/gpio.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/module.h>

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

381gpiobus_probe_nomatch(device_t dev, device_t child)
382{
383 char pins[128];
384 struct gpiobus_ivar *devi;
385
386 devi = GPIOBUS_IVAR(child);
387 memset(pins, 0, sizeof(pins));
388 gpiobus_print_pins(devi, pins, sizeof(pins));
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/gpio.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/module.h>

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

381gpiobus_probe_nomatch(device_t dev, device_t child)
382{
383 char pins[128];
384 struct gpiobus_ivar *devi;
385
386 devi = GPIOBUS_IVAR(child);
387 memset(pins, 0, sizeof(pins));
388 gpiobus_print_pins(devi, pins, sizeof(pins));
389 device_printf(dev, "<unknown device> at pin(s) %s", pins);
389 if (devi->npins > 1)
390 device_printf(dev, "<unknown device> at pins %s", pins);
391 else
392 device_printf(dev, "<unknown device> at pin %s", pins);
390 resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld");
391 printf("\n");
392}
393
394static int
395gpiobus_print_child(device_t dev, device_t child)
396{
397 char pins[128];

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

417
418static int
419gpiobus_child_location_str(device_t bus, device_t child, char *buf,
420 size_t buflen)
421{
422 struct gpiobus_ivar *devi;
423
424 devi = GPIOBUS_IVAR(child);
393 resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld");
394 printf("\n");
395}
396
397static int
398gpiobus_print_child(device_t dev, device_t child)
399{
400 char pins[128];

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

420
421static int
422gpiobus_child_location_str(device_t bus, device_t child, char *buf,
423 size_t buflen)
424{
425 struct gpiobus_ivar *devi;
426
427 devi = GPIOBUS_IVAR(child);
425 strlcpy(buf, "pin(s)=", buflen);
428 if (devi->npins > 1)
429 strlcpy(buf, "pins=", buflen);
430 else
431 strlcpy(buf, "pin=", buflen);
426 gpiobus_print_pins(devi, buf, buflen);
427
428 return (0);
429}
430
431static int
432gpiobus_child_pnpinfo_str(device_t bus, device_t child, char *buf,
433 size_t buflen)

--- 352 unchanged lines hidden ---
432 gpiobus_print_pins(devi, buf, buflen);
433
434 return (0);
435}
436
437static int
438gpiobus_child_pnpinfo_str(device_t bus, device_t child, char *buf,
439 size_t buflen)

--- 352 unchanged lines hidden ---