hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/arizona-core.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Arizona core driver
34 *
45 * Copyright 2012 Wolfson Microelectronics plc
56 *
67 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/clk.h>
....@@ -48,7 +45,7 @@
4845 if (arizona->clk32k_ref == 1) {
4946 switch (arizona->pdata.clk32k_src) {
5047 case ARIZONA_32KZ_MCLK1:
51
- ret = pm_runtime_get_sync(arizona->dev);
48
+ ret = pm_runtime_resume_and_get(arizona->dev);
5249 if (ret != 0)
5350 goto err_ref;
5451 ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);
....@@ -83,7 +80,7 @@
8380 {
8481 mutex_lock(&arizona->clk_lock);
8582
86
- BUG_ON(arizona->clk32k_ref <= 0);
83
+ WARN_ON(arizona->clk32k_ref <= 0);
8784
8885 arizona->clk32k_ref--;
8986
....@@ -817,11 +814,7 @@
817814 int ret, i;
818815
819816 /* Handle old non-standard DT binding */
820
- pdata->reset = devm_gpiod_get_from_of_node(arizona->dev,
821
- arizona->dev->of_node,
822
- "wlf,reset", 0,
823
- GPIOD_OUT_LOW,
824
- "arizona /RESET");
817
+ pdata->reset = devm_gpiod_get(arizona->dev, "wlf,reset", GPIOD_OUT_LOW);
825818 if (IS_ERR(pdata->reset)) {
826819 ret = PTR_ERR(pdata->reset);
827820
....@@ -990,7 +983,7 @@
990983
991984 int arizona_dev_init(struct arizona *arizona)
992985 {
993
- const char * const mclk_name[] = { "mclk1", "mclk2" };
986
+ static const char * const mclk_name[] = { "mclk1", "mclk2" };
994987 struct device *dev = arizona->dev;
995988 const char *type_name = NULL;
996989 unsigned int reg, val;