ASoC: tlv320dac33: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-4-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Raag Jadav 2025-02-28 11:58:09 +05:30 committed by Mark Brown
parent 3e706be02b
commit 69aaab0e65
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1477,10 +1477,8 @@ static int dac33_i2c_probe(struct i2c_client *client)
if (dac33 == NULL)
return -ENOMEM;
dac33->reg_cache = devm_kmemdup(&client->dev,
dac33_reg,
ARRAY_SIZE(dac33_reg) * sizeof(u8),
GFP_KERNEL);
dac33->reg_cache = devm_kmemdup_array(&client->dev, dac33_reg, ARRAY_SIZE(dac33_reg),
sizeof(dac33_reg[0]), GFP_KERNEL);
if (!dac33->reg_cache)
return -ENOMEM;