.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2010 Broadcom |
---|
3 | 4 | * Copyright (C) 2012 Stephen Warren |
---|
4 | 5 | * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> |
---|
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 | | - * |
---|
10 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
11 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
12 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
13 | | - * more details. |
---|
14 | | - * |
---|
15 | | - * You should have received a copy of the GNU General Public License |
---|
16 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | #include <linux/clk-provider.h> |
---|
.. | .. |
---|
218 | 207 | |
---|
219 | 208 | static int oxnas_stdclk_probe(struct platform_device *pdev) |
---|
220 | 209 | { |
---|
221 | | - struct device_node *np = pdev->dev.of_node; |
---|
| 210 | + struct device_node *np = pdev->dev.of_node, *parent_np; |
---|
222 | 211 | const struct oxnas_stdclk_data *data; |
---|
223 | 212 | const struct of_device_id *id; |
---|
224 | 213 | struct regmap *regmap; |
---|
.. | .. |
---|
230 | 219 | return -ENODEV; |
---|
231 | 220 | data = id->data; |
---|
232 | 221 | |
---|
233 | | - regmap = syscon_node_to_regmap(of_get_parent(np)); |
---|
| 222 | + parent_np = of_get_parent(np); |
---|
| 223 | + regmap = syscon_node_to_regmap(parent_np); |
---|
| 224 | + of_node_put(parent_np); |
---|
234 | 225 | if (IS_ERR(regmap)) { |
---|
235 | 226 | dev_err(&pdev->dev, "failed to have parent regmap\n"); |
---|
236 | 227 | return PTR_ERR(regmap); |
---|