From 5a109d3adab4147df7932454ed8c097885e640f3 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 9 Nov 2021 01:13:47 +0000 Subject: [PATCH 2/3] device property: Check fwnode->secondary when finding properties fwnode_property_get_reference_args() searches for named properties against a fwnode_handle, but these could instead be against the fwnode's secondary. If the property isn't found against the primary, check the secondary to see if it's there instead. Signed-off-by: Daniel Scally --- drivers/base/property.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index 453918eb7390..054e62a4e710 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -479,8 +479,16 @@ int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, unsigned int nargs, unsigned int index, struct fwnode_reference_args *args) { - return fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop, - nargs, index, args); + int ret; + + ret = fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop, + nargs, index, args); + + if (ret < 0 && !IS_ERR_OR_NULL(fwnode->secondary)) + ret = fwnode_call_int_op(fwnode->secondary, get_reference_args, + prop, nargs_prop, nargs, index, args); + + return ret; } EXPORT_SYMBOL_GPL(fwnode_property_get_reference_args); -- 2.25.1