Skip to content

Commit d5f962f

Browse files
andy-shevgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c508c46 commit d5f962f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

drivers/base/property.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,23 @@ int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
695695
}
696696
EXPORT_SYMBOL_GPL(fwnode_property_get_reference_args);
697697

698+
static void property_entry_free_data(const struct property_entry *p)
699+
{
700+
size_t i, nval;
701+
702+
if (p->is_array) {
703+
if (p->is_string && p->pointer.str) {
704+
nval = p->length / sizeof(const char *);
705+
for (i = 0; i < nval; i++)
706+
kfree(p->pointer.str[i]);
707+
}
708+
kfree(p->pointer.raw_data);
709+
} else if (p->is_string) {
710+
kfree(p->value.str);
711+
}
712+
kfree(p->name);
713+
}
714+
698715
static int property_copy_string_array(struct property_entry *dst,
699716
const struct property_entry *src)
700717
{
@@ -768,23 +785,6 @@ static int property_entry_copy_data(struct property_entry *dst,
768785
return error;
769786
}
770787

771-
static void property_entry_free_data(const struct property_entry *p)
772-
{
773-
size_t i, nval;
774-
775-
if (p->is_array) {
776-
if (p->is_string && p->pointer.str) {
777-
nval = p->length / sizeof(const char *);
778-
for (i = 0; i < nval; i++)
779-
kfree(p->pointer.str[i]);
780-
}
781-
kfree(p->pointer.raw_data);
782-
} else if (p->is_string) {
783-
kfree(p->value.str);
784-
}
785-
kfree(p->name);
786-
}
787-
788788
/**
789789
* property_entries_dup - duplicate array of properties
790790
* @properties: array of properties to copy

0 commit comments

Comments
 (0)