hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/clk/clk-conf.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (C) 2014 Samsung Electronics Co., Ltd.
34 * Sylwester Nawrocki <s.nawrocki@samsung.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 */
96
107 #include <linux/clk.h>
....@@ -13,7 +10,6 @@
1310 #include <linux/device.h>
1411 #include <linux/of.h>
1512 #include <linux/printk.h>
16
-#include "clk.h"
1713
1814 static int __set_clk_parents(struct device_node *node, bool clk_supplier)
1915 {
....@@ -37,9 +33,12 @@
3733 else
3834 return rc;
3935 }
40
- if (clkspec.np == node && !clk_supplier)
36
+ if (clkspec.np == node && !clk_supplier) {
37
+ of_node_put(clkspec.np);
4138 return 0;
42
- pclk = of_clk_get_from_provider_with_orphans(&clkspec);
39
+ }
40
+ pclk = of_clk_get_from_provider(&clkspec);
41
+ of_node_put(clkspec.np);
4342 if (IS_ERR(pclk)) {
4443 if (PTR_ERR(pclk) != -EPROBE_DEFER)
4544 pr_warn("clk: couldn't get parent clock %d for %pOF\n",
....@@ -52,10 +51,12 @@
5251 if (rc < 0)
5352 goto err;
5453 if (clkspec.np == node && !clk_supplier) {
54
+ of_node_put(clkspec.np);
5555 rc = 0;
5656 goto err;
5757 }
58
- clk = of_clk_get_from_provider_with_orphans(&clkspec);
58
+ clk = of_clk_get_from_provider(&clkspec);
59
+ of_node_put(clkspec.np);
5960 if (IS_ERR(clk)) {
6061 if (PTR_ERR(clk) != -EPROBE_DEFER)
6162 pr_warn("clk: couldn't get assigned clock %d for %pOF\n",
....@@ -97,10 +98,13 @@
9798 else
9899 return rc;
99100 }
100
- if (clkspec.np == node && !clk_supplier)
101
+ if (clkspec.np == node && !clk_supplier) {
102
+ of_node_put(clkspec.np);
101103 return 0;
104
+ }
102105
103106 clk = of_clk_get_from_provider(&clkspec);
107
+ of_node_put(clkspec.np);
104108 if (IS_ERR(clk)) {
105109 if (PTR_ERR(clk) != -EPROBE_DEFER)
106110 pr_warn("clk: couldn't get clock %d for %pOF\n",