diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
commit | a7ca10f263d7e673c74d8e0946d6b9993405cc9c (patch) | |
tree | 7c50f0e728ca1a426235356acba1115c45dfe809 /drivers/of/of_reserved_mem.c | |
parent | d506aa68c23db708ad45ca8c17f0d7f5d7029a37 (diff) | |
parent | 4d88e6f7d5ffc84e6094a47925870f4a130555c2 (diff) |
Merge branch 'akpm' (incoming from Andrew Morton)
Merge misc fixes from Andrew Morton:
"21 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
mm/balloon_compaction: fix deflation when compaction is disabled
sh: fix sh770x SCIF memory regions
zram: avoid NULL pointer access in concurrent situation
mm/slab_common: don't check for duplicate cache names
ocfs2: fix d_splice_alias() return code checking
mm: rmap: split out page_remove_file_rmap()
mm: memcontrol: fix missed end-writeback page accounting
mm: page-writeback: inline account_page_dirtied() into single caller
lib/bitmap.c: fix undefined shift in __bitmap_shift_{left|right}()
drivers/rtc/rtc-bq32k.c: fix register value
memory-hotplug: clear pgdat which is allocated by bootmem in try_offline_node()
drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source clock
kernel/kmod: fix use-after-free of the sub_info structure
drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc
mm, thp: fix collapsing of hugepages on madvise
drivers: of: add return value to of_reserved_mem_device_init()
mm: free compound page with correct order
gcov: add ARM64 to GCOV_PROFILE_ALL
fsnotify: next_i is freed during fsnotify_unmount_inodes.
mm/compaction.c: avoid premature range skip in isolate_migratepages_range
...
Diffstat (limited to 'drivers/of/of_reserved_mem.c')
-rw-r--r-- | drivers/of/of_reserved_mem.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 59fb12e84e6b..dc566b38645f 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c | |||
@@ -243,23 +243,27 @@ static inline struct reserved_mem *__find_rmem(struct device_node *node) | |||
243 | * This function assign memory region pointed by "memory-region" device tree | 243 | * This function assign memory region pointed by "memory-region" device tree |
244 | * property to the given device. | 244 | * property to the given device. |
245 | */ | 245 | */ |
246 | void of_reserved_mem_device_init(struct device *dev) | 246 | int of_reserved_mem_device_init(struct device *dev) |
247 | { | 247 | { |
248 | struct reserved_mem *rmem; | 248 | struct reserved_mem *rmem; |
249 | struct device_node *np; | 249 | struct device_node *np; |
250 | int ret; | ||
250 | 251 | ||
251 | np = of_parse_phandle(dev->of_node, "memory-region", 0); | 252 | np = of_parse_phandle(dev->of_node, "memory-region", 0); |
252 | if (!np) | 253 | if (!np) |
253 | return; | 254 | return -ENODEV; |
254 | 255 | ||
255 | rmem = __find_rmem(np); | 256 | rmem = __find_rmem(np); |
256 | of_node_put(np); | 257 | of_node_put(np); |
257 | 258 | ||
258 | if (!rmem || !rmem->ops || !rmem->ops->device_init) | 259 | if (!rmem || !rmem->ops || !rmem->ops->device_init) |
259 | return; | 260 | return -EINVAL; |
261 | |||
262 | ret = rmem->ops->device_init(rmem, dev); | ||
263 | if (ret == 0) | ||
264 | dev_info(dev, "assigned reserved memory node %s\n", rmem->name); | ||
260 | 265 | ||
261 | rmem->ops->device_init(rmem, dev); | 266 | return ret; |
262 | dev_info(dev, "assigned reserved memory node %s\n", rmem->name); | ||
263 | } | 267 | } |
264 | 268 | ||
265 | /** | 269 | /** |