kcalloc() should be preferred for allocations of arrays over kzalloc()
with multiplication.
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit
2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc)
Change-Id: Ifa4619bcd5c0869e516ae7765bab7515b299c533
Signed-off-by: David Wu <david.wu@rock-chips.com>
if (ret < 0)
goto out;
- chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL);
+ chip->pwms = kcalloc(chip->npwm, sizeof(*pwm), GFP_KERNEL);
if (!chip->pwms) {
ret = -ENOMEM;
goto out;