mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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:
parent
3e706be02b
commit
69aaab0e65
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user