Deleted Added
full compact
ofw_gpiobus.c (279621) ofw_gpiobus.c (279622)
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: head/sys/dev/gpio/ofw_gpiobus.c 279621 2015-03-05 02:54:30Z loos $");
30__FBSDID("$FreeBSD: head/sys/dev/gpio/ofw_gpiobus.c 279622 2015-03-05 03:11:47Z loos $");
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

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

277 /* Get the GPIO pin number and flags. */
278 if (gpio_map_gpios((*pins)[j].dev, cnode, gpio, gpiocells,
279 &gpios[i + 1], &(*pins)[j].pin, &(*pins)[j].flags) != 0) {
280 device_printf(consumer,
281 "cannot map the gpios specifier.\n");
282 goto fail;
283 }
284 /* Reserve the GPIO pin. */
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

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

277 /* Get the GPIO pin number and flags. */
278 if (gpio_map_gpios((*pins)[j].dev, cnode, gpio, gpiocells,
279 &gpios[i + 1], &(*pins)[j].pin, &(*pins)[j].flags) != 0) {
280 device_printf(consumer,
281 "cannot map the gpios specifier.\n");
282 goto fail;
283 }
284 /* Reserve the GPIO pin. */
285 if (gpiobus_map_pin(bussc->sc_busdev, consumer,
286 (*pins)[j].pin) != 0)
285 if (gpiobus_map_pin(bussc->sc_busdev, (*pins)[j].pin) != 0)
287 goto fail;
288 j++;
289 i += gpiocells + 1;
290 }
291 free(gpios, M_OFWPROP);
292
293 return (npins);
294

--- 110 unchanged lines hidden ---
286 goto fail;
287 j++;
288 i += gpiocells + 1;
289 }
290 free(gpios, M_OFWPROP);
291
292 return (npins);
293

--- 110 unchanged lines hidden ---