mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
leds: ns2: Slightly simplify a memory allocation
Use devm_kcalloc() instead of devm_kzalloc()+array_size(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/560b8f140c19a7da40f5e9540c3ef312969b0dc4.1690057595.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
3192f14124
commit
c8a0394365
@ -247,7 +247,7 @@ static int ns2_led_probe(struct platform_device *pdev)
|
||||
if (!count)
|
||||
return -ENODEV;
|
||||
|
||||
leds = devm_kzalloc(dev, array_size(sizeof(*leds), count), GFP_KERNEL);
|
||||
leds = devm_kcalloc(dev, count, sizeof(*leds), GFP_KERNEL);
|
||||
if (!leds)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user