Commit a550d6ae authored by Jiapeng Chong's avatar Jiapeng Chong Committed by Uwe Kleine-König

pwm: lp3943: Fix an incorrect type in lp3943_pwm_parse_dt()

The return value from the call to of_property_count_u32_elems() is int.
However, the return value is being assigned to an u32 variable
'num_outputs', so making 'num_outputs' an int.

./drivers/pwm/pwm-lp3943.c:238:6-17: WARNING: Unsigned expression compared with zero: num_outputs <= 0.
Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9710Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fixes: 75f0cb33 ("pwm: lp3943: Use of_property_count_u32_elems() to get property length")
Link: https://lore.kernel.org/r/20240809080523.32717-1-jiapeng.chong@linux.alibaba.comSigned-off-by: default avatarUwe Kleine-König <ukleinek@kernel.org>
parent d6a80079
......@@ -218,8 +218,7 @@ static int lp3943_pwm_parse_dt(struct device *dev,
struct lp3943_platform_data *pdata;
struct lp3943_pwm_map *pwm_map;
enum lp3943_pwm_output *output;
int i, err, count = 0;
u32 num_outputs;
int i, err, num_outputs, count = 0;
if (!node)
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment