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-clps711x.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/kernel/drivers/pwm/pwm-clps711x.c b/kernel/drivers/pwm/pwm-clps711x.c index f5be116..ba9500a 100644 --- a/kernel/drivers/pwm/pwm-clps711x.c +++ b/kernel/drivers/pwm/pwm-clps711x.c @@ -1,12 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Cirrus Logic CLPS711X PWM driver - * - * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> - * - * 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. + * Author: Alexander Shiyan <shc_work@mail.ru> */ #include <linux/clk.h> @@ -48,9 +43,7 @@ static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v) { /* Duty cycle 0..15 max */ - /* DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period) with u64 divisor */ - unsigned long long tmp = (v * 0xf) + do_div(pwm->args.period, 2); - return div64_u64(tmp, pwm->args.period); + return DIV64_U64_ROUND_CLOSEST(v * 0xf, pwm->args.period); } static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) -- Gitblit v1.6.2