From 102a0743326a03cd1a1202ceda21e175b7d3575c Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Tue, 20 Feb 2024 01:20:52 +0000 Subject: [PATCH] add new system file --- kernel/drivers/pwm/pwm-sti.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/kernel/drivers/pwm/pwm-sti.c b/kernel/drivers/pwm/pwm-sti.c index ca67401..1508616 100644 --- a/kernel/drivers/pwm/pwm-sti.c +++ b/kernel/drivers/pwm/pwm-sti.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * PWM device driver for ST SoCs * @@ -5,11 +6,6 @@ * * Author: Ajit Pal Singh <ajitpal.singh@st.com> * Lee Jones <lee.jones@linaro.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include <linux/clk.h> @@ -375,11 +371,10 @@ effective_ticks = clk_get_rate(pc->cpt_clk); result->period = (high + low) * NSEC_PER_SEC; - result->period = do_div(result->period, effective_ticks); + result->period /= effective_ticks; result->duty_cycle = high * NSEC_PER_SEC; - result->duty_cycle = do_div(result->duty_cycle, - effective_ticks); + result->duty_cycle /= effective_ticks; break; @@ -569,10 +564,8 @@ return PTR_ERR(pc->regmap); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "Failed to obtain IRQ\n"); + if (irq < 0) return irq; - } ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, 0, pdev->name, pc); -- Gitblit v1.6.2