projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85cc1ee
)
ASoC: tas5805m: Use devm_kmemdup to replace devm_kmalloc + memcpy
author
Li Zetao
<lizetao1@huawei.com>
Thu, 10 Aug 2023 11:47:37 +0000
(19:47 +0800)
committer
Mark Brown
<broonie@kernel.org>
Mon, 14 Aug 2023 18:44:38 +0000
(19:44 +0100)
Use the helper function devm_kmemdup() rather than duplicating its
implementation, which helps to enhance code readability.
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link:
https://lore.kernel.org/r/20230810114738.2103792-2-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas5805m.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/tas5805m.c
b/sound/soc/codecs/tas5805m.c
index aca3756ffab63d99723eb1f06108a78200bfc01d..3b53eba38a0b1d064f5584099cafb6edead89cd4 100644
(file)
--- a/
sound/soc/codecs/tas5805m.c
+++ b/
sound/soc/codecs/tas5805m.c
@@
-520,12
+520,11
@@
static int tas5805m_i2c_probe(struct i2c_client *i2c)
}
tas5805m->dsp_cfg_len = fw->size;
- tas5805m->dsp_cfg_data = devm_km
alloc(dev
, fw->size, GFP_KERNEL);
+ tas5805m->dsp_cfg_data = devm_km
emdup(dev, fw->data
, fw->size, GFP_KERNEL);
if (!tas5805m->dsp_cfg_data) {
release_firmware(fw);
return -ENOMEM;
}
- memcpy(tas5805m->dsp_cfg_data, fw->data, fw->size);
release_firmware(fw);