Re: [PATCH v2 1/3] drivers/of: recognize status property of dt memory nodes

From: Reza Arbab
Date: Thu Sep 15 2016 - 10:32:47 EST

On Thu, Sep 15, 2016 at 08:43:08AM -0500, Rob Herring wrote:
On Wed, Sep 14, 2016 at 3:06 PM, Reza Arbab <arbab@xxxxxxxxxxxxxxxxxx> wrote:
+ status = of_get_flat_dt_prop(node, "status", NULL);
+ add_memory = !status || !strcmp(status, "okay");

Move this into it's own function to mirror the unflattened version
(of_device_is_available). Also, make sure the logic is the same. IIRC,
"ok" is also allowed.

Will do.
@@ -1057,6 +1062,9 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
pr_debug(" - %llx , %llx\n", (unsigned long long)base,
(unsigned long long)size);

+ if (!add_memory)
+ continue;

There's no point in checking this in the loop. status applies to the
whole node. Just return up above.

I was trying to preserve that pr_debug output for these nodes, but I'm also fine with skipping it.

Thanks for your feedback! I'll spin a v3 of this patchset soon.

Reza Arbab