Message ID | DB7PR04MB52433D93A8536DC7F71E169AFC1A0@DB7PR04MB5243.eurprd04.prod.outlook.com |
---|---|
State | Changes Requested, archived |
Headers | show |
Series | AW: [PATCH v2] of: __of_update_property_sysfs only call __of_sysfs_remove_bin_file if of_node_is_attached | expand |
On Thu, Sep 13, 2018 at 03:21:27PM +0000, Andre Kalb wrote: > Hi Rob, > > I have used an other hardware to check the patch. I hope it doesn’t matter. I added few lines at the untitest.c. All existing unittest use an attached sysfs, therefore the bug isn't detectable. Okay, can you resend both patches in one series rather than pasted in here. Rob
On 09/26/18 14:05, Rob Herring wrote: > On Thu, Sep 13, 2018 at 03:21:27PM +0000, Andre Kalb wrote: >> Hi Rob, >> >> I have used an other hardware to check the patch. I hope it doesn’t matter. I added few lines at the untitest.c. All existing unittest use an attached sysfs, therefore the bug isn't detectable. > > Okay, can you resend both patches in one series rather than pasted in > here. > > Rob I don't understand the need for the patch to __of_update_property_sysfs() in the context of the current mainline Linux kernel. As far as I know, there are no callers of of_update_property() against a tree that is detached. As such, the patch is adding complexity without adding any functionality. -Frank
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 2a547ca3d443..17f6cacb4fae 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -923,6 +923,24 @@ static int __init unittest_data_add(void) return -EINVAL; } + { + struct property *prop; + + prop = kzalloc(sizeof(*prop), GFP_KERNEL); + if (!prop) { + unittest(0, "kzalloc() failed\n"); + return -ENOMEM; + } + + np = of_find_node_with_property(unittest_data_node, "prop-update"); + unittest(np, "find prop-update"); + + prop->name = "prop-update"; + prop->value = "new-property-data"; + prop->length = strlen(prop->value) + 1; + unittest(of_update_property(np, prop) == 0, "Update a existing property failed\n"); + } + if (!of_root) { of_root = unittest_data_node; for_each_of_allnodes(np)