summaryrefslogtreecommitdiff
path: root/drivers/iommu/tegra-gart.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-12-12 23:39:03 +0300
committerJoerg Roedel <jroedel@suse.de>2019-01-16 15:54:14 +0300
commit167d67d550b9e94207578679c3a6feef78449f38 (patch)
tree05f2b3e8fe0b659ab10db147b67f7bfb2a019994 /drivers/iommu/tegra-gart.c
parent7d849b7b40b9b3f574f50bbf44503b38e319fca5 (diff)
downloadlinux-167d67d550b9e94207578679c3a6feef78449f38.tar.xz
iommu/tegra: gart: Don't use managed resources
GART is a part of the Memory Controller driver that is always built-in, hence there is no benefit from the use of managed resources. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/tegra-gart.c')
-rw-r--r--drivers/iommu/tegra-gart.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 71ff22be9560..2e0e6aff8f70 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -173,7 +173,7 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain,
struct gart_client *client, *c;
int err = 0;
- client = devm_kzalloc(gart->dev, sizeof(*c), GFP_KERNEL);
+ client = kzalloc(sizeof(*c), GFP_KERNEL);
if (!client)
return -ENOMEM;
client->dev = dev;
@@ -199,7 +199,7 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain,
return 0;
fail:
- devm_kfree(gart->dev, client);
+ kfree(client);
spin_unlock(&gart->client_lock);
return err;
}
@@ -214,7 +214,7 @@ static void __gart_iommu_detach_dev(struct iommu_domain *domain,
list_for_each_entry(c, &gart->client, list) {
if (c->dev == dev) {
list_del(&c->list);
- devm_kfree(gart->dev, c);
+ kfree(c);
if (list_empty(&gart->client))
gart->active_domain = NULL;
dev_dbg(gart->dev, "Detached %s\n", dev_name(dev));
@@ -455,7 +455,7 @@ struct gart_device *tegra_gart_probe(struct device *dev, struct tegra_mc *mc)
return ERR_PTR(-ENXIO);
}
- gart = devm_kzalloc(dev, sizeof(*gart), GFP_KERNEL);
+ gart = kzalloc(sizeof(*gart), GFP_KERNEL);
if (!gart) {
dev_err(dev, "failed to allocate gart_device\n");
return ERR_PTR(-ENOMEM);
@@ -464,7 +464,7 @@ struct gart_device *tegra_gart_probe(struct device *dev, struct tegra_mc *mc)
ret = iommu_device_sysfs_add(&gart->iommu, dev, NULL, "gart");
if (ret) {
dev_err(dev, "Failed to register IOMMU in sysfs\n");
- return ERR_PTR(ret);
+ goto free_gart;
}
iommu_device_set_ops(&gart->iommu, &gart_iommu_ops);
@@ -502,6 +502,8 @@ unregister_iommu:
iommu_device_unregister(&gart->iommu);
remove_sysfs:
iommu_device_sysfs_remove(&gart->iommu);
+free_gart:
+ kfree(gart);
return ERR_PTR(ret);
}