media: camss: Use managed memory allocations
Use managed memory allocations for structs which are used until the driver is removed. Signed-off-by: Todor Tomov <todor.tomov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
44a9ffd4eb
commit
55b5189989
|
@ -1076,8 +1076,8 @@ int msm_ispif_subdev_init(struct ispif_device *ispif,
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ispif->line = kcalloc(ispif->line_num, sizeof(*ispif->line),
|
ispif->line = devm_kcalloc(dev, ispif->line_num, sizeof(*ispif->line),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!ispif->line)
|
if (!ispif->line)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
|
@ -848,17 +848,18 @@ static int camss_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
camss->csiphy = kcalloc(camss->csiphy_num, sizeof(*camss->csiphy),
|
camss->csiphy = devm_kcalloc(dev, camss->csiphy_num,
|
||||||
GFP_KERNEL);
|
sizeof(*camss->csiphy), GFP_KERNEL);
|
||||||
if (!camss->csiphy)
|
if (!camss->csiphy)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
camss->csid = kcalloc(camss->csid_num, sizeof(*camss->csid),
|
camss->csid = devm_kcalloc(dev, camss->csid_num, sizeof(*camss->csid),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!camss->csid)
|
if (!camss->csid)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
camss->vfe = kcalloc(camss->vfe_num, sizeof(*camss->vfe), GFP_KERNEL);
|
camss->vfe = devm_kcalloc(dev, camss->vfe_num, sizeof(*camss->vfe),
|
||||||
|
GFP_KERNEL);
|
||||||
if (!camss->vfe)
|
if (!camss->vfe)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue