Device properties framework updates for 5.5-rc1
Add support for printing fwnode names using a new conversion specifier "%pfw" (Sakari Ailus), clean up the software node and efi/apple-properties code in preparation for improved software node reference properties handling (Dmitry Torokhov) and fix the struct fwnode_operations description (Heikki Krogerus). -----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl3dHU0SHHJqd0Byand5 c29ja2kubmV0AAoJEILEb/54YlRx1JkP/j/YkE6VsMlXqL+3kMABXfVlAIZtkZ71 YB13wtGHdz0hewvCFJDLZuJ3+axbR5Lk60tqX+lfG6GvWMtudZ+URkZ0KIUBhDXM uwVniqcWvlItMGo+cU7FLW1rKkRDCQ75x4GlKD1MivCG+PZXYqkH/ESQZgi3TdwD 0rYGzUx4nBKzS9yJ6ZnBhSOGRq9sGGHgOr20LjYlAplcOMhE6PP+SQNCfKVk8DE8 ZolavWpmD+nsV97qWGLpJOKWJXplCv+lWX8cQICvONRSWPHq6ehQ4HONnLDtPai3 EcyGQ3LbuVMYKOWUVRYs2X+wvgmAz461Y+Du8FO1QzYuNMYzArRx2naD1LIIUT6Q UE8RRkN2YyqvVmSLlAYAJPH7GCP8mRZV2gHfmS7fF16jUpTOiDHKiZFjOgvSc/lp 31DhBpWr64NgSOSpqi/bX6fSYVv9YGPOd0J8dPNsaGZbHZxJJ2cmZ092u6Rrx6VG x1qO2j2c2xC6Y+pEMCBCqjDUmhFD5P6O7qVky/9kyZv9AWyBlEpni7tdu8J6DqVG RUB0zq5jujfBoTtBFFpVxDiQYvctTs/T9te48DQkdCli0J/bUEEyNw5nX6HKnjZM jyrh93Th512W0JwbPWpJXn1JJMdxkNitwlLRwnhCSSTdcLZiHzDoYdf7taSemvX5 ZJZYhPG5T6i5 =VcCH -----END PGP SIGNATURE----- Merge tag 'devprop-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework updates from Rafael Wysocki: "Add support for printing fwnode names using a new conversion specifier "%pfw" (Sakari Ailus), clean up the software node and efi/apple-properties code in preparation for improved software node reference properties handling (Dmitry Torokhov) and fix the struct fwnode_operations description (Heikki Krogerus)" * tag 'devprop-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits) software node: simplify property_entry_read_string_array() software node: unify PROPERTY_ENTRY_XXX macros software node: remove property_entry_read_uNN_array functions software node: get rid of property_set_pointer() software node: clean up property_copy_string_array() software node: mark internal macros with double underscores efi/apple-properties: use PROPERTY_ENTRY_U8_ARRAY_LEN software node: introduce PROPERTY_ENTRY_XXX_ARRAY_LEN() software node: remove DEV_PROP_MAX device property: Fix the description of struct fwnode_operations lib/test_printf: Add tests for %pfw printk modifier lib/vsprintf: Add %pfw conversion specifier for printing fwnode names lib/vsprintf: OF nodes are first and foremost, struct device_nodes lib/vsprintf: Make use of fwnode API to obtain node names and separators lib/vsprintf: Add a note on re-using %pf or %pF lib/vsprintf: Remove support for %pF and %pf in favour of %pS and %ps device property: Add a function to obtain a node's prefix device property: Add fwnode_get_name for returning the name of a node device property: Add functions for accessing node's parents device property: Move fwnode_get_parent() up ...
This commit is contained in:
commit
361b0d286a
11 changed files with 413 additions and 292 deletions
|
|
@ -22,6 +22,8 @@
|
|||
#include <linux/gfp.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
#include <linux/property.h>
|
||||
|
||||
#include "../tools/testing/selftests/kselftest_module.h"
|
||||
|
||||
#define BUF_SIZE 256
|
||||
|
|
@ -593,6 +595,35 @@ flags(void)
|
|||
kfree(cmp_buffer);
|
||||
}
|
||||
|
||||
static void __init fwnode_pointer(void)
|
||||
{
|
||||
const struct software_node softnodes[] = {
|
||||
{ .name = "first", },
|
||||
{ .name = "second", .parent = &softnodes[0], },
|
||||
{ .name = "third", .parent = &softnodes[1], },
|
||||
{ NULL /* Guardian */ }
|
||||
};
|
||||
const char * const full_name = "first/second/third";
|
||||
const char * const full_name_second = "first/second";
|
||||
const char * const second_name = "second";
|
||||
const char * const third_name = "third";
|
||||
int rval;
|
||||
|
||||
rval = software_node_register_nodes(softnodes);
|
||||
if (rval) {
|
||||
pr_warn("cannot register softnodes; rval %d\n", rval);
|
||||
return;
|
||||
}
|
||||
|
||||
test(full_name_second, "%pfw", software_node_fwnode(&softnodes[1]));
|
||||
test(full_name, "%pfw", software_node_fwnode(&softnodes[2]));
|
||||
test(full_name, "%pfwf", software_node_fwnode(&softnodes[2]));
|
||||
test(second_name, "%pfwP", software_node_fwnode(&softnodes[1]));
|
||||
test(third_name, "%pfwP", software_node_fwnode(&softnodes[2]));
|
||||
|
||||
software_node_unregister_nodes(softnodes);
|
||||
}
|
||||
|
||||
static void __init
|
||||
errptr(void)
|
||||
{
|
||||
|
|
@ -636,6 +667,7 @@ test_pointer(void)
|
|||
netdev_features();
|
||||
flags();
|
||||
errptr();
|
||||
fwnode_pointer();
|
||||
}
|
||||
|
||||
static void __init selftest(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue