hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/clk/clk-max77686.c
....@@ -1,24 +1,9 @@
1
-/*
2
- * clk-max77686.c - Clock driver for Maxim 77686/MAX77802
3
- *
4
- * Copyright (C) 2012 Samsung Electornics
5
- * Jonghwa Lee <jonghwa3.lee@samsung.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of the GNU General Public License as published by the
9
- * Free Software Foundation; either version 2 of the License, or (at your
10
- * option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
- *
21
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// clk-max77686.c - Clock driver for Maxim 77686/MAX77802
4
+//
5
+// Copyright (C) 2012 Samsung Electornics
6
+// Jonghwa Lee <jonghwa3.lee@samsung.com>
227
238 #include <linux/kernel.h>
249 #include <linux/slab.h>
....@@ -152,7 +137,7 @@
152137 return 32768;
153138 }
154139
155
-static struct clk_ops max77686_clk_ops = {
140
+static const struct clk_ops max77686_clk_ops = {
156141 .prepare = max77686_clk_prepare,
157142 .unprepare = max77686_clk_unprepare,
158143 .is_prepared = max77686_clk_is_prepared,
....@@ -250,8 +235,9 @@
250235 return ret;
251236 }
252237
253
- ret = clk_hw_register_clkdev(&max_clk_data->hw,
254
- max_clk_data->clk_idata.name, NULL);
238
+ ret = devm_clk_hw_register_clkdev(dev, &max_clk_data->hw,
239
+ max_clk_data->clk_idata.name,
240
+ NULL);
255241 if (ret < 0) {
256242 dev_err(dev, "Failed to clkdev register: %d\n", ret);
257243 return ret;
....@@ -259,8 +245,8 @@
259245 }
260246
261247 if (parent->of_node) {
262
- ret = of_clk_add_hw_provider(parent->of_node, of_clk_max77686_get,
263
- drv_data);
248
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_max77686_get,
249
+ drv_data);
264250
265251 if (ret < 0) {
266252 dev_err(dev, "Failed to register OF clock provider: %d\n",
....@@ -276,25 +262,9 @@
276262 1 << MAX77802_CLOCK_LOW_JITTER_SHIFT);
277263 if (ret < 0) {
278264 dev_err(dev, "Failed to config low-jitter: %d\n", ret);
279
- goto remove_of_clk_provider;
265
+ return ret;
280266 }
281267 }
282
-
283
- return 0;
284
-
285
-remove_of_clk_provider:
286
- if (parent->of_node)
287
- of_clk_del_provider(parent->of_node);
288
-
289
- return ret;
290
-}
291
-
292
-static int max77686_clk_remove(struct platform_device *pdev)
293
-{
294
- struct device *parent = pdev->dev.parent;
295
-
296
- if (parent->of_node)
297
- of_clk_del_provider(parent->of_node);
298268
299269 return 0;
300270 }
....@@ -312,7 +282,6 @@
312282 .name = "max77686-clk",
313283 },
314284 .probe = max77686_clk_probe,
315
- .remove = max77686_clk_remove,
316285 .id_table = max77686_clk_id,
317286 };
318287