mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
- Use the rman_get_* functions instead of reaching into struct resource.
- Remove __RMAN_RESORUCE_VISIBLE again. It's no longer required either because of the above change or because struct rman is no longer hidden. Reviewed by: grehan Tested by: cross-compile on i386
This commit is contained in:
parent
0f54f48225
commit
a4954466bd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133521
@ -27,7 +27,6 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
|
@ -39,7 +39,6 @@
|
||||
* prior to this are activated.
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
@ -224,11 +223,13 @@ hrowpic_setup_intr(device_t picdev, device_t child, struct resource *res,
|
||||
int flags, driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
struct hrowpic_softc *sc;
|
||||
u_long start;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(picdev);
|
||||
start = rman_get_start(res);
|
||||
|
||||
if ((res->r_flags & RF_SHAREABLE) == 0)
|
||||
if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
|
||||
flags |= INTR_EXCL;
|
||||
|
||||
/*
|
||||
@ -238,16 +239,16 @@ hrowpic_setup_intr(device_t picdev, device_t child, struct resource *res,
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
error = inthand_add(device_get_nameunit(child), res->r_start, intr,
|
||||
arg, flags, cookiep);
|
||||
error = inthand_add(device_get_nameunit(child), start, intr, arg,
|
||||
flags, cookiep);
|
||||
|
||||
if (!error) {
|
||||
/*
|
||||
* Record irq request, and enable if h/w has been probed
|
||||
*/
|
||||
sc->sc_irq[res->r_start] = 1;
|
||||
sc->sc_irq[start] = 1;
|
||||
if (sc->sc_memr) {
|
||||
hrowpic_toggle_irq(sc, res->r_start, 1);
|
||||
hrowpic_toggle_irq(sc, start, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,7 +265,7 @@ hrowpic_teardown_intr(device_t picdev, device_t child, struct resource *res,
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
error = inthand_remove(res->r_start, ih);
|
||||
error = inthand_remove(rman_get_start(res), ih);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
* Driver for KeyLargo/Pangea, the MacPPC south bridge ASIC.
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
|
@ -25,7 +25,6 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
|
@ -25,7 +25,6 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
@ -232,9 +231,11 @@ openpic_setup_intr(device_t dev, device_t child, struct resource *res,
|
||||
int flags, driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
struct openpic_softc *sc;
|
||||
u_long start;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
start = rman_get_start(res);
|
||||
|
||||
if (res == NULL) {
|
||||
device_printf(dev, "null interrupt resource from %s\n",
|
||||
@ -242,7 +243,7 @@ openpic_setup_intr(device_t dev, device_t child, struct resource *res,
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if ((res->r_flags & RF_SHAREABLE) == 0)
|
||||
if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
|
||||
flags |= INTR_EXCL;
|
||||
|
||||
/*
|
||||
@ -252,13 +253,13 @@ openpic_setup_intr(device_t dev, device_t child, struct resource *res,
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
error = inthand_add(device_get_nameunit(child), res->r_start, intr,
|
||||
arg, flags, cookiep);
|
||||
error = inthand_add(device_get_nameunit(child), start, intr, arg,
|
||||
flags, cookiep);
|
||||
|
||||
if (sc->sc_hwprobed)
|
||||
openpic_enable_irq(sc, res->r_start, IST_LEVEL);
|
||||
openpic_enable_irq(sc, start, IST_LEVEL);
|
||||
else
|
||||
sc->sc_irqrsv[res->r_start] = 1;
|
||||
sc->sc_irqrsv[start] = 1;
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -273,7 +274,7 @@ openpic_teardown_intr(device_t dev, device_t child, struct resource *res,
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
error = inthand_remove(res->r_start, ih);
|
||||
error = inthand_remove(rman_get_start(res), ih);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
* Code borrowed from various nexus.c and uninorth.c :-)
|
||||
*/
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
|
Loading…
Reference in New Issue
Block a user