From 39a997283f48db9c7eb11d513600f5dd32474ad7 Mon Sep 17 00:00:00 2001
From: Oleksandr Tymoshenko <gonzo@FreeBSD.org>
Date: Fri, 13 May 2016 22:28:02 +0000
Subject: [PATCH] Use OF_prop_free instead of direct call to free(9)

Approved by:	jmcneill
---
 sys/arm/allwinner/a10_gpio.c      | 4 ++--
 sys/arm/allwinner/clk/aw_cpuclk.c | 6 +++---
 sys/arm/allwinner/clk/aw_lcdclk.c | 4 ++--
 sys/arm/allwinner/clk/aw_oscclk.c | 4 ++--
 sys/arm/allwinner/clk/aw_pll.c    | 2 +-
 sys/arm/allwinner/if_awg.c        | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sys/arm/allwinner/a10_gpio.c b/sys/arm/allwinner/a10_gpio.c
index c327098d56f9..d088152df796 100644
--- a/sys/arm/allwinner/a10_gpio.c
+++ b/sys/arm/allwinner/a10_gpio.c
@@ -536,8 +536,8 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref)
 	}
 
  out:
-	free(pinlist, M_OFWPROP);
-	free(pin_function, M_OFWPROP);
+	OF_prop_free(pinlist);
+	OF_prop_free(pin_function);
 	return (ret);
 }
 
diff --git a/sys/arm/allwinner/clk/aw_cpuclk.c b/sys/arm/allwinner/clk/aw_cpuclk.c
index 045751b1d6d6..7beffcd17bf0 100644
--- a/sys/arm/allwinner/clk/aw_cpuclk.c
+++ b/sys/arm/allwinner/clk/aw_cpuclk.c
@@ -128,8 +128,8 @@ aw_cpuclk_attach(device_t dev)
 		goto fail;
 	}
 
-	free(__DECONST(char *, def.clkdef.parent_names), M_OFWPROP);
-	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
+	OF_prop_free(__DECONST(char *, def.clkdef.parent_names));
+	OF_prop_free(__DECONST(char *, def.clkdef.name));
 
 	if (bootverbose)
 		clkdom_dump(clkdom);
@@ -137,7 +137,7 @@ aw_cpuclk_attach(device_t dev)
 	return (0);
 
 fail:
-	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
+	OF_prop_free(__DECONST(char *, def.clkdef.name));
 	return (error);
 }
 
diff --git a/sys/arm/allwinner/clk/aw_lcdclk.c b/sys/arm/allwinner/clk/aw_lcdclk.c
index 1de6a493b814..0cadabf05e51 100644
--- a/sys/arm/allwinner/clk/aw_lcdclk.c
+++ b/sys/arm/allwinner/clk/aw_lcdclk.c
@@ -529,11 +529,11 @@ aw_lcdclk_attach(device_t dev)
 	if (sc->type == AW_LCD_CH0)
 		hwreset_register_ofw_provider(dev);
 
-	free(parent_names, M_OFWPROP);
+	OF_prop_free(parent_names);
 	return (0);
 
 fail:
-	free(parent_names, M_OFWPROP);
+	OF_prop_free(parent_names);
 	return (error);
 }
 
diff --git a/sys/arm/allwinner/clk/aw_oscclk.c b/sys/arm/allwinner/clk/aw_oscclk.c
index 313111fa6519..c72fe0d15d1e 100644
--- a/sys/arm/allwinner/clk/aw_oscclk.c
+++ b/sys/arm/allwinner/clk/aw_oscclk.c
@@ -103,12 +103,12 @@ aw_oscclk_attach(device_t dev)
 	if (bootverbose)
 		clkdom_dump(clkdom);
 
-	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
+	OF_prop_free(__DECONST(char *, def.clkdef.name));
 
 	return (0);
 
 fail:
-	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
+	OF_prop_free(__DECONST(char *, def.clkdef.name));
 	return (error);
 }
 
diff --git a/sys/arm/allwinner/clk/aw_pll.c b/sys/arm/allwinner/clk/aw_pll.c
index 709515686bfa..d4fc6b0e65c3 100644
--- a/sys/arm/allwinner/clk/aw_pll.c
+++ b/sys/arm/allwinner/clk/aw_pll.c
@@ -723,7 +723,7 @@ aw_pll_create(device_t dev, bus_addr_t paddr, struct clkdom *clkdom,
 
 	clknode_register(clkdom, clk);
 
-	free(__DECONST(char *, clkdef.parent_names), M_OFWPROP);
+	OF_prop_free(__DECONST(char *, clkdef.parent_names));
 
 	return (0);
 }
diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c
index 87606c397fa6..6428fbdb312e 100644
--- a/sys/arm/allwinner/if_awg.c
+++ b/sys/arm/allwinner/if_awg.c
@@ -951,7 +951,7 @@ awg_setup_extres(device_t dev)
 			tx_parent_name = "emac_int_tx";
 		else
 			tx_parent_name = "mii_phy_tx";
-		free(phy_type, M_OFWPROP);
+		OF_prop_free(phy_type);
 
 		/* Get the TX clock */
 		error = clk_get_by_ofw_name(dev, "tx", &clk_tx);
@@ -1034,7 +1034,7 @@ awg_setup_extres(device_t dev)
 	return (0);
 
 fail:
-	free(phy_type, M_OFWPROP);
+	OF_prop_free(phy_type);
 
 	if (reg != NULL)
 		regulator_release(reg);