diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-09-14 19:03:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-09-14 19:03:17 -0400 |
commit | 090b75bcba62e8e0e43c8acdbc230d26c5b731dc (patch) | |
tree | 3c2a82aa0a0312e1545011de2862aefd335ead6f | |
parent | d7c0268090e23f3517c7b7555d3f4f9d73580f96 (diff) | |
parent | e54192b48da75f025ae4b277925eaf6aca1d13bd (diff) |
Merge tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree fix from Rob Herring:
"One regression for a 20 year old PowerMac:
- Fix a regression on systems having a DT without any phandles which
happens on a PowerMac G3"
* tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: fix phandle cache creation for DTs with no phandles
-rw-r--r-- | drivers/of/base.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 9095b8290150..74eaedd5b860 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -140,6 +140,9 @@ void of_populate_phandle_cache(void) | |||
140 | if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) | 140 | if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) |
141 | phandles++; | 141 | phandles++; |
142 | 142 | ||
143 | if (!phandles) | ||
144 | goto out; | ||
145 | |||
143 | cache_entries = roundup_pow_of_two(phandles); | 146 | cache_entries = roundup_pow_of_two(phandles); |
144 | phandle_cache_mask = cache_entries - 1; | 147 | phandle_cache_mask = cache_entries - 1; |
145 | 148 | ||