[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180122142138.42434-1-andriy.shevchenko@linux.intel.com>
Date: Mon, 22 Jan 2018 16:21:37 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
mika.westerberg@...ux.intel.com
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/2] 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@...ux.intel.com>
---
drivers/base/property.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 851b1b6596a4..f369c4c612f8 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -698,6 +698,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)
{
@@ -771,23 +788,6 @@ static int property_entry_copy_data(struct property_entry *dst,
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
--
2.15.1
Powered by blists - more mailing lists