summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/omap-iommu.c
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-02-28 21:42:34 +0100
committerJoerg Roedel <joro@8bytes.org>2014-03-04 17:01:44 +0100
commit90e569c4ca727b59ba8f82a9cd5e2f43462bbc3b (patch)
tree3979ca093ad5a4e95a6a7e57443565ddb669590d /drivers/iommu/omap-iommu.c
parentiommu/omap: Fix error return paths in omap_iommu_attach() (diff)
downloadlinux-90e569c4ca727b59ba8f82a9cd5e2f43462bbc3b.tar.xz
linux-90e569c4ca727b59ba8f82a9cd5e2f43462bbc3b.zip
iommu/omap: Allow enable/disable even without pdata
When booting with a devicetree, no platform data is provided. Do not prematurely exit iommu_enable() and iommu_disable() in such a case. Note: As OMAP do not yet has a proper reset controller driver, IOMMUs requiring a reset signal should use pdata-quirks as a transitional solution. Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Suman Anna <s-anna@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r--drivers/iommu/omap-iommu.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 647e4ba0df95..217952b993e1 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -146,13 +146,10 @@ static int iommu_enable(struct omap_iommu *obj)
struct platform_device *pdev = to_platform_device(obj->dev);
struct iommu_platform_data *pdata = pdev->dev.platform_data;
- if (!pdata)
- return -EINVAL;
-
if (!arch_iommu)
return -ENODEV;
- if (pdata->deassert_reset) {
+ if (pdata && pdata->deassert_reset) {
err = pdata->deassert_reset(pdev, pdata->reset_name);
if (err) {
dev_err(obj->dev, "deassert_reset failed: %d\n", err);
@@ -172,14 +169,11 @@ static void iommu_disable(struct omap_iommu *obj)
struct platform_device *pdev = to_platform_device(obj->dev);
struct iommu_platform_data *pdata = pdev->dev.platform_data;
- if (!pdata)
- return;
-
arch_iommu->disable(obj);
pm_runtime_put_sync(obj->dev);
- if (pdata->assert_reset)
+ if (pdata && pdata->assert_reset)
pdata->assert_reset(pdev, pdata->reset_name);
}