hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/pwm/pwm-sti.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * PWM device driver for ST SoCs
34 *
....@@ -5,11 +6,6 @@
56 *
67 * Author: Ajit Pal Singh <ajitpal.singh@st.com>
78 * Lee Jones <lee.jones@linaro.org>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
139 */
1410
1511 #include <linux/clk.h>
....@@ -375,11 +371,10 @@
375371 effective_ticks = clk_get_rate(pc->cpt_clk);
376372
377373 result->period = (high + low) * NSEC_PER_SEC;
378
- result->period = do_div(result->period, effective_ticks);
374
+ result->period /= effective_ticks;
379375
380376 result->duty_cycle = high * NSEC_PER_SEC;
381
- result->duty_cycle = do_div(result->duty_cycle,
382
- effective_ticks);
377
+ result->duty_cycle /= effective_ticks;
383378
384379 break;
385380
....@@ -569,10 +564,8 @@
569564 return PTR_ERR(pc->regmap);
570565
571566 irq = platform_get_irq(pdev, 0);
572
- if (irq < 0) {
573
- dev_err(&pdev->dev, "Failed to obtain IRQ\n");
567
+ if (irq < 0)
574568 return irq;
575
- }
576569
577570 ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, 0,
578571 pdev->name, pc);