summaryrefslogtreecommitdiffstats
path: root/drivers/base/property.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-01-22 15:21:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-25 13:40:40 +0100
commitd5f962fa269e817d5aea99e9b020b44b64de2fef (patch)
treed47987558cacc4902e56001cb5ad9732d0905202 /drivers/base/property.c
parentfirmware: Fix up docs referring to FIRMWARE_IN_KERNEL (diff)
downloadlinux-d5f962fa269e817d5aea99e9b020b44b64de2fef.tar.xz
linux-d5f962fa269e817d5aea99e9b020b44b64de2fef.zip
device property: Move property_entry_free_data() upper
It's just a preparatory patch to use property_entry_free_data() later on. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/property.c')
-rw-r--r--drivers/base/property.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 1ddf769ab8f7..39393b4806d1 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -695,6 +695,23 @@ int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
}
EXPORT_SYMBOL_GPL(fwnode_property_get_reference_args);
+static void property_entry_free_data(const struct property_entry *p)
+{
+ size_t i, nval;
+
+ if (p->is_array) {
+ if (p->is_string && p->pointer.str) {
+ nval = p->length / sizeof(const char *);
+ for (i = 0; i < nval; i++)
+ kfree(p->pointer.str[i]);
+ }
+ kfree(p->pointer.raw_data);
+ } else if (p->is_string) {
+ kfree(p->value.str);
+ }
+ kfree(p->name);
+}
+
static int property_copy_string_array(struct property_entry *dst,
const struct property_entry *src)
{
@@ -768,23 +785,6 @@ out_free_name:
return error;
}
-static void property_entry_free_data(const struct property_entry *p)
-{
- size_t i, nval;
-
- if (p->is_array) {
- if (p->is_string && p->pointer.str) {
- nval = p->length / sizeof(const char *);
- for (i = 0; i < nval; i++)
- kfree(p->pointer.str[i]);
- }
- kfree(p->pointer.raw_data);
- } else if (p->is_string) {
- kfree(p->value.str);
- }
- kfree(p->name);
-}
-
/**
* property_entries_dup - duplicate array of properties
* @properties: array of properties to copy