| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2013 Linaro Ltd. |
|---|
| 3 | 4 | * Copyright (c) 2013 Hisilicon Limited. |
|---|
| 4 | 5 | * Based on arch/arm/mach-vexpress/platsmp.c, Copyright (C) 2002 ARM Ltd. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 8 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #include <linux/smp.h> |
|---|
| 11 | 8 | #include <linux/io.h> |
|---|
| .. | .. |
|---|
| 70 | 67 | } |
|---|
| 71 | 68 | ctrl_base = of_iomap(np, 0); |
|---|
| 72 | 69 | if (!ctrl_base) { |
|---|
| 70 | + of_node_put(np); |
|---|
| 73 | 71 | pr_err("failed to map address\n"); |
|---|
| 74 | 72 | return; |
|---|
| 75 | 73 | } |
|---|
| 76 | 74 | if (of_property_read_u32(np, "smp-offset", &offset) < 0) { |
|---|
| 75 | + of_node_put(np); |
|---|
| 77 | 76 | pr_err("failed to find smp-offset property\n"); |
|---|
| 78 | 77 | return; |
|---|
| 79 | 78 | } |
|---|
| 80 | 79 | ctrl_base += offset; |
|---|
| 80 | + of_node_put(np); |
|---|
| 81 | 81 | } |
|---|
| 82 | 82 | } |
|---|
| 83 | 83 | |
|---|
| .. | .. |
|---|
| 163 | 163 | if (WARN_ON(!node)) |
|---|
| 164 | 164 | return -1; |
|---|
| 165 | 165 | ctrl_base = of_iomap(node, 0); |
|---|
| 166 | + of_node_put(node); |
|---|
| 166 | 167 | |
|---|
| 167 | 168 | /* set the secondary core boot from DDR */ |
|---|
| 168 | 169 | remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL); |
|---|