mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 07:24:39 +08:00
media: nxp: Use devm_kmemdup to replace devm_kmalloc + memcpy
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> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
57a3afc5d5
commit
d27bb0246e
@ -406,12 +406,10 @@ static int mxc_isi_clk_get(struct mxc_isi_dev *isi)
|
||||
* sizeof(*isi->clks);
|
||||
int ret;
|
||||
|
||||
isi->clks = devm_kmalloc(isi->dev, size, GFP_KERNEL);
|
||||
isi->clks = devm_kmemdup(isi->dev, isi->pdata->clks, size, GFP_KERNEL);
|
||||
if (!isi->clks)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(isi->clks, isi->pdata->clks, size);
|
||||
|
||||
ret = devm_clk_bulk_get(isi->dev, isi->pdata->num_clks,
|
||||
isi->clks);
|
||||
if (ret < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user