@@ -116,16 +116,16 @@ static int ipmmu_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "cannot get platform resources\n");
return -ENOENT;
}
- priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(&pdev->dev, "cannot allocate device data\n");
return -ENOMEM;
}
mutex_init(&priv->flush_lock);
- priv->ipmmu_base = ioremap_nocache(res->start, resource_size(res));
+ priv->ipmmu_base = devm_ioremap_nocache(&pdev->dev, res->start,
+ resource_size(res));
if (!priv->ipmmu_base) {
dev_err(&pdev->dev, "ioremap_nocache failed\n");
- kfree(priv);
return -ENOMEM;
}
platform_set_drvdata(pdev, priv);
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- drivers/iommu/shmobile-ipmmu.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)