summaryrefslogtreecommitdiffstats
path: root/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2016-05-11 18:20:02 +0000
committergonzo <gonzo@FreeBSD.org>2016-05-11 18:20:02 +0000
commit23a2d5f59362b8a60462708280c89083bb8d1b27 (patch)
tree3563d72b1347b885dce8a7a9c1acc2cd41747fe8 /sys/arm/broadcom/bcm2835/bcm2835_gpio.c
parent8093b741c766ae4c82afcd7999ff372061614b25 (diff)
downloadFreeBSD-src-23a2d5f59362b8a60462708280c89083bb8d1b27.zip
FreeBSD-src-23a2d5f59362b8a60462708280c89083bb8d1b27.tar.gz
Add OF_prop_free function as a counterpart for OF_*prop_alloc
- Introduce new OF API function OF_prop_free to free memory allocated by OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9) with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc functions' internals and leads to unneccessary code coupling - Convert some of the free(..., M_OFWPROP) instances to OF_prop_free Files affected by this commit are the ones I was able to test on real hardware. The rest of free(..., M_OFWPROP) instances will be handled with idividual maintainers Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D6315
Diffstat (limited to 'sys/arm/broadcom/bcm2835/bcm2835_gpio.c')
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_gpio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
index 9619503..cab3116 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
@@ -632,7 +632,7 @@ bcm_gpio_get_ro_pins(struct bcm_gpio_softc *sc, phandle_t node,
if (npins < 0)
return (-1);
if (npins == 0) {
- free(pins, M_OFWPROP);
+ OF_prop_free(pins);
return (0);
}
for (i = 0; i < npins; i++)
@@ -660,7 +660,7 @@ bcm_gpio_get_ro_pins(struct bcm_gpio_softc *sc, phandle_t node,
printf("%d-%d.\n", range_start, range_stop);
else
printf("%d.\n", range_start);
- free(pins, M_OFWPROP);
+ OF_prop_free(pins);
return (0);
}
@@ -686,7 +686,7 @@ bcm_gpio_get_reserved_pins(struct bcm_gpio_softc *sc)
return (-1);
if (strcmp(name, "reserved") == 0)
reserved = node;
- free(name, M_OFWPROP);
+ OF_prop_free(name);
node = OF_peer(node);
}
if (reserved == 0)
OpenPOWER on IntegriCloud