hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/pwm/pwm-img.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Imagination Technologies Pulse Width Modulator driver
34 *
45 * Copyright (c) 2014-2015, Imagination Technologies
56 *
67 * Based on drivers/pwm/pwm-tegra.c, Copyright (c) 2010, NVIDIA Corporation
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 as published by
10
- * the Free Software Foundation; either version 2 of the License.
118 */
129
1310 #include <linux/clk.h>
....@@ -123,7 +120,7 @@
123120 } else if (mul <= max_timebase * 512) {
124121 div = PWM_CTRL_CFG_SUB_DIV0_DIV1;
125122 timebase = DIV_ROUND_UP(mul, 512);
126
- } else if (mul > max_timebase * 512) {
123
+ } else {
127124 dev_err(chip->dev,
128125 "failed to configure timebase steps/divider value\n");
129126 return -EINVAL;
....@@ -159,7 +156,7 @@
159156 struct img_pwm_chip *pwm_chip = to_img_pwm_chip(chip);
160157 int ret;
161158
162
- ret = pm_runtime_get_sync(chip->dev);
159
+ ret = pm_runtime_resume_and_get(chip->dev);
163160 if (ret < 0)
164161 return ret;
165162