Deleted Added
full compact
ofw_gpiobus.c (302408) ofw_gpiobus.c (308333)
1/*-
2 * Copyright (c) 2009, Nathan Whitehorn <nwhitehorn@FreeBSD.org>
3 * Copyright (c) 2013, Luiz Otavio O Souza <loos@FreeBSD.org>
4 * Copyright (c) 2013 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009, Nathan Whitehorn <nwhitehorn@FreeBSD.org>
3 * Copyright (c) 2013, Luiz Otavio O Souza <loos@FreeBSD.org>
4 * Copyright (c) 2013 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: stable/11/sys/dev/gpio/ofw_gpiobus.c 301453 2016-06-05 16:20:12Z skra $");
30__FBSDID("$FreeBSD: stable/11/sys/dev/gpio/ofw_gpiobus.c 308333 2016-11-05 10:23:02Z mmel $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/malloc.h>
37#include <sys/module.h>
38

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

316 ofw_gpiobus_destroy_devinfo(bus, dinfo);
317 return (NULL);
318 }
319 for (i = 0; i < devi->npins; i++) {
320 devi->flags[i] = pins[i].flags;
321 devi->pins[i] = pins[i].pin;
322 }
323 free(pins, M_DEVBUF);
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/malloc.h>
37#include <sys/module.h>
38

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

316 ofw_gpiobus_destroy_devinfo(bus, dinfo);
317 return (NULL);
318 }
319 for (i = 0; i < devi->npins; i++) {
320 devi->flags[i] = pins[i].flags;
321 devi->pins[i] = pins[i].pin;
322 }
323 free(pins, M_DEVBUF);
324#ifndef INTRNG
325 /* Parse the interrupt resources. */
326 if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) {
327 ofw_gpiobus_destroy_devinfo(bus, dinfo);
328 return (NULL);
329 }
324 /* Parse the interrupt resources. */
325 if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) {
326 ofw_gpiobus_destroy_devinfo(bus, dinfo);
327 return (NULL);
328 }
330#endif
331 device_set_ivars(child, dinfo);
332
333 return (dinfo);
334}
335
336static void
337ofw_gpiobus_destroy_devinfo(device_t bus, struct ofw_gpiobus_devinfo *dinfo)
338{

--- 252 unchanged lines hidden ---
329 device_set_ivars(child, dinfo);
330
331 return (dinfo);
332}
333
334static void
335ofw_gpiobus_destroy_devinfo(device_t bus, struct ofw_gpiobus_devinfo *dinfo)
336{

--- 252 unchanged lines hidden ---