hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pwm/pwm-lp3943.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * TI/National Semiconductor LP3943 PWM driver
34 *
45 * Copyright 2013 Texas Instruments
56 *
67 * Author: Milo Kim <milo.kim@ti.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 as published by
10
- * the Free Software Foundation; version 2.
118 */
129
1310 #include <linux/err.h>
....@@ -128,6 +125,7 @@
128125 if (err)
129126 return err;
130127
128
+ duty_ns = min(duty_ns, period_ns);
131129 val = (u8)(duty_ns * LP3943_MAX_DUTY / period_ns);
132130
133131 return lp3943_write_byte(lp3943, reg_duty, val);