Deleted Added
full compact
ofwbus.c (273675) ofwbus.c (283332)
1/*-
2 * Copyright 1998 Massachusetts Institute of Technology
3 * Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>.
4 * Copyright 2006 by Marius Strobl <marius@FreeBSD.org>.
5 * All rights reserved.
6 *
7 * Permission to use, copy, modify, and distribute this software and
8 * its documentation for any purpose and without fee is hereby

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

28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright 1998 Massachusetts Institute of Technology
3 * Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>.
4 * Copyright 2006 by Marius Strobl <marius@FreeBSD.org>.
5 * All rights reserved.
6 *
7 * Permission to use, copy, modify, and distribute this software and
8 * its documentation for any purpose and without fee is hereby

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

28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: stable/10/sys/dev/ofw/ofwbus.c 273675 2014-10-26 04:01:57Z ian $");
36__FBSDID("$FreeBSD: stable/10/sys/dev/ofw/ofwbus.c 283332 2015-05-23 22:33:06Z ian $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bus.h>
41#include <sys/kernel.h>
42#include <sys/malloc.h>
43#include <sys/module.h>
44#include <sys/pcpu.h>

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

394 if (rm == NULL)
395 return (ENXIO);
396 if (rman_is_region_manager(r, rm) == 0)
397 return (EINVAL);
398 return (rman_adjust_resource(r, start, end));
399}
400
401static int
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bus.h>
41#include <sys/kernel.h>
42#include <sys/malloc.h>
43#include <sys/module.h>
44#include <sys/pcpu.h>

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

394 if (rm == NULL)
395 return (ENXIO);
396 if (rman_is_region_manager(r, rm) == 0)
397 return (EINVAL);
398 return (rman_adjust_resource(r, start, end));
399}
400
401static int
402ofwbus_release_resource(device_t bus __unused, device_t child, int type,
402ofwbus_release_resource(device_t bus, device_t child, int type,
403 int rid, struct resource *r)
404{
403 int rid, struct resource *r)
404{
405 struct resource_list_entry *rle;
405 int error;
406
406 int error;
407
408 /* Clean resource list entry */
409 rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid);
410 if (rle != NULL)
411 rle->res = NULL;
412
407 if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
408 error = bus_deactivate_resource(child, type, rid, r);
409 if (error)
410 return (error);
411 }
412 return (rman_release_resource(r));
413}
414

--- 98 unchanged lines hidden ---
413 if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
414 error = bus_deactivate_resource(child, type, rid, r);
415 if (error)
416 return (error);
417 }
418 return (rman_release_resource(r));
419}
420

--- 98 unchanged lines hidden ---