aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/shmobile-ipmmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/shmobile-ipmmu.c')
-rw-r--r--drivers/iommu/shmobile-ipmmu.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/iommu/shmobile-ipmmu.c b/drivers/iommu/shmobile-ipmmu.c
index e3bc2e19b6dd..bd97adecb1fd 100644
--- a/drivers/iommu/shmobile-ipmmu.c
+++ b/drivers/iommu/shmobile-ipmmu.c
@@ -94,11 +94,6 @@ static int ipmmu_probe(struct platform_device *pdev)
94 struct resource *res; 94 struct resource *res;
95 struct shmobile_ipmmu_platform_data *pdata = pdev->dev.platform_data; 95 struct shmobile_ipmmu_platform_data *pdata = pdev->dev.platform_data;
96 96
97 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
98 if (!res) {
99 dev_err(&pdev->dev, "cannot get platform resources\n");
100 return -ENOENT;
101 }
102 ipmmu = devm_kzalloc(&pdev->dev, sizeof(*ipmmu), GFP_KERNEL); 97 ipmmu = devm_kzalloc(&pdev->dev, sizeof(*ipmmu), GFP_KERNEL);
103 if (!ipmmu) { 98 if (!ipmmu) {
104 dev_err(&pdev->dev, "cannot allocate device data\n"); 99 dev_err(&pdev->dev, "cannot allocate device data\n");
@@ -106,19 +101,18 @@ static int ipmmu_probe(struct platform_device *pdev)
106 } 101 }
107 spin_lock_init(&ipmmu->flush_lock); 102 spin_lock_init(&ipmmu->flush_lock);
108 ipmmu->dev = &pdev->dev; 103 ipmmu->dev = &pdev->dev;
109 ipmmu->ipmmu_base = devm_ioremap_nocache(&pdev->dev, res->start, 104
110 resource_size(res)); 105 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
111 if (!ipmmu->ipmmu_base) { 106 ipmmu->ipmmu_base = devm_ioremap_resource(&pdev->dev, res);
112 dev_err(&pdev->dev, "ioremap_nocache failed\n"); 107 if (IS_ERR(ipmmu->ipmmu_base))
113 return -ENOMEM; 108 return PTR_ERR(ipmmu->ipmmu_base);
114 } 109
115 ipmmu->dev_names = pdata->dev_names; 110 ipmmu->dev_names = pdata->dev_names;
116 ipmmu->num_dev_names = pdata->num_dev_names; 111 ipmmu->num_dev_names = pdata->num_dev_names;
117 platform_set_drvdata(pdev, ipmmu); 112 platform_set_drvdata(pdev, ipmmu);
118 ipmmu_reg_write(ipmmu, IMCTR1, 0x0); /* disable TLB */ 113 ipmmu_reg_write(ipmmu, IMCTR1, 0x0); /* disable TLB */
119 ipmmu_reg_write(ipmmu, IMCTR2, 0x0); /* disable PMB */ 114 ipmmu_reg_write(ipmmu, IMCTR2, 0x0); /* disable PMB */
120 ipmmu_iommu_init(ipmmu); 115 return ipmmu_iommu_init(ipmmu);
121 return 0;
122} 116}
123 117
124static struct platform_driver ipmmu_driver = { 118static struct platform_driver ipmmu_driver = {