gpio_alloc_intr_resource: Pass rid by value
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53407
This commit is contained in:
@@ -167,7 +167,7 @@ gpio_aei_enumerate(ACPI_RESOURCE * res, void * context)
|
||||
|
||||
ctx->intr_rid = 0;
|
||||
ctx->intr_res = gpio_alloc_intr_resource(sc->dev,
|
||||
&ctx->intr_rid, RF_ACTIVE, ctx->gpio,
|
||||
ctx->intr_rid, RF_ACTIVE, ctx->gpio,
|
||||
flags & GPIO_INTR_MASK);
|
||||
if (ctx->intr_res == NULL) {
|
||||
device_printf(sc->dev,
|
||||
|
||||
@@ -92,7 +92,7 @@ static int gpiobus_pin_toggle(device_t, device_t, uint32_t);
|
||||
#ifdef INTRNG
|
||||
|
||||
struct resource *
|
||||
gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
|
||||
gpio_alloc_intr_resource(device_t consumer_dev, int rid, u_int alloc_flags,
|
||||
gpio_pin_t pin, uint32_t intr_mode)
|
||||
{
|
||||
u_int irq;
|
||||
@@ -116,7 +116,7 @@ gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
|
||||
}
|
||||
#else
|
||||
struct resource *
|
||||
gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
|
||||
gpio_alloc_intr_resource(device_t consumer_dev, int rid, u_int alloc_flags,
|
||||
gpio_pin_t pin, uint32_t intr_mode)
|
||||
{
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ int gpio_pin_getcaps(gpio_pin_t pin, uint32_t *caps);
|
||||
int gpio_pin_is_active(gpio_pin_t pin, bool *active);
|
||||
int gpio_pin_set_active(gpio_pin_t pin, bool active);
|
||||
int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags);
|
||||
struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid,
|
||||
struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int rid,
|
||||
u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode);
|
||||
|
||||
int gpio_check_flags(uint32_t, uint32_t);
|
||||
|
||||
@@ -208,7 +208,7 @@ gpioc_allocate_pin_intr(struct gpioc_softc *sc,
|
||||
goto error_exit;
|
||||
|
||||
intr_conf->intr_res = gpio_alloc_intr_resource(sc->sc_dev,
|
||||
&intr_conf->intr_rid, RF_ACTIVE, intr_conf->pin, flags);
|
||||
intr_conf->intr_rid, RF_ACTIVE, intr_conf->pin, flags);
|
||||
if (intr_conf->intr_res == NULL) {
|
||||
err = ENXIO;
|
||||
goto error_pin;
|
||||
|
||||
@@ -334,7 +334,7 @@ gpiokeys_attach_key(struct gpiokeys_softc *sc, phandle_t node,
|
||||
return;
|
||||
}
|
||||
|
||||
key->irq_res = gpio_alloc_intr_resource(sc->sc_dev, &key->irq_rid,
|
||||
key->irq_res = gpio_alloc_intr_resource(sc->sc_dev, key->irq_rid,
|
||||
RF_ACTIVE, key->pin, GPIO_INTR_EDGE_BOTH);
|
||||
if (!key->irq_res) {
|
||||
device_printf(sc->sc_dev, "<%s> cannot allocate interrupt\n", key_name);
|
||||
|
||||
@@ -218,7 +218,7 @@ gpiopps_fdt_attach(device_t dev)
|
||||
* Transform our 'gpios' property into an interrupt resource and set up
|
||||
* the interrupt.
|
||||
*/
|
||||
if ((sc->ires = gpio_alloc_intr_resource(dev, &sc->irid, RF_ACTIVE,
|
||||
if ((sc->ires = gpio_alloc_intr_resource(dev, sc->irid, RF_ACTIVE,
|
||||
sc->gpin, edge)) == NULL) {
|
||||
device_printf(dev, "Cannot allocate an IRQ for the GPIO\n");
|
||||
gpiopps_detach(dev);
|
||||
|
||||
@@ -212,7 +212,7 @@ cd_setup(struct mmc_helper *helper, phandle_t node)
|
||||
/*
|
||||
* Create an interrupt resource from the pin and set up the interrupt.
|
||||
*/
|
||||
if ((helper->cd_ires = gpio_alloc_intr_resource(dev, &helper->cd_irid,
|
||||
if ((helper->cd_ires = gpio_alloc_intr_resource(dev, helper->cd_irid,
|
||||
RF_ACTIVE, helper->cd_pin, GPIO_INTR_EDGE_BOTH)) == NULL) {
|
||||
if (bootverbose)
|
||||
device_printf(dev, "Cannot allocate an IRQ for card "
|
||||
|
||||
@@ -128,7 +128,7 @@ cd_setup(struct sdhci_fdt_gpio *gpio, phandle_t node)
|
||||
/*
|
||||
* Create an interrupt resource from the pin and set up the interrupt.
|
||||
*/
|
||||
if ((gpio->cd_ires = gpio_alloc_intr_resource(dev, &gpio->cd_irid,
|
||||
if ((gpio->cd_ires = gpio_alloc_intr_resource(dev, gpio->cd_irid,
|
||||
RF_ACTIVE, gpio->cd_pin, GPIO_INTR_EDGE_BOTH)) == NULL) {
|
||||
if (bootverbose)
|
||||
device_printf(dev, "Cannot allocate an IRQ for card "
|
||||
|
||||
Reference in New Issue
Block a user