software node: get rid of property_set_pointer()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 23 Oct 2019 20:02:24 +0000 (13:02 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Nov 2019 22:18:10 +0000 (23:18 +0100)
commit1f74d70ff21249670eb68c1344e0687aa909861d
treec2dd779cadf563c5e90d1b6102ec51fc6c651cd7
parent75dd63c968d8e91707d74845ccb96bda3664cdaa
software node: get rid of property_set_pointer()

Instead of explicitly setting values of integer types when copying
property entries lets just copy entire value union when processing
non-array values.

For value arrays we no longer use union of pointers, but rather a single
void pointer, which allows us to remove property_set_pointer().

In property_get_pointer() we do not need to handle each data type
separately, we can simply return either the pointer or pointer to values
union.

We are not losing anything from removing typed pointer union because the
upper layers do their accesses through void pointers anyway, and we
trust the "type" of the property when interpret the data. We rely on
users of property entries on using PROPERTY_ENTRY_XXX() macros to
properly initialize entries instead of poking in the instances directly.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/swnode.c
include/linux/property.h