diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2013-12-04 11:49:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-18 03:24:41 -0500 |
commit | fd8308b42c11ff21cedfb08a73f1d7ff73d72e4c (patch) | |
tree | 0e175b5dfb3efabd0e4b29c0f78142d925372771 | |
parent | f8e2ff262142ba79d1d9f601684a5b9e2f75f397 (diff) |
[media] omap3isp: Use devm_ioremap_resource()
Replace devm_request_mem_region() and devm_ioremap_nocache() with
devm_ioremap_resource(). The behaviour remains the same and the code is
simplified.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/platform/omap3isp/isp.c | 25 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/isp.h | 2 |
2 files changed, 5 insertions, 22 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index fdbdeae3900d..bb4e0a7c7b5e 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c | |||
@@ -2130,28 +2130,13 @@ static int isp_map_mem_resource(struct platform_device *pdev, | |||
2130 | /* request the mem region for the camera registers */ | 2130 | /* request the mem region for the camera registers */ |
2131 | 2131 | ||
2132 | mem = platform_get_resource(pdev, IORESOURCE_MEM, res); | 2132 | mem = platform_get_resource(pdev, IORESOURCE_MEM, res); |
2133 | if (!mem) { | ||
2134 | dev_err(isp->dev, "no mem resource?\n"); | ||
2135 | return -ENODEV; | ||
2136 | } | ||
2137 | |||
2138 | if (!devm_request_mem_region(isp->dev, mem->start, resource_size(mem), | ||
2139 | pdev->name)) { | ||
2140 | dev_err(isp->dev, | ||
2141 | "cannot reserve camera register I/O region\n"); | ||
2142 | return -ENODEV; | ||
2143 | } | ||
2144 | isp->mmio_base_phys[res] = mem->start; | ||
2145 | isp->mmio_size[res] = resource_size(mem); | ||
2146 | 2133 | ||
2147 | /* map the region */ | 2134 | /* map the region */ |
2148 | isp->mmio_base[res] = devm_ioremap_nocache(isp->dev, | 2135 | isp->mmio_base[res] = devm_ioremap_resource(isp->dev, mem); |
2149 | isp->mmio_base_phys[res], | 2136 | if (IS_ERR(isp->mmio_base[res])) |
2150 | isp->mmio_size[res]); | 2137 | return PTR_ERR(isp->mmio_base[res]); |
2151 | if (!isp->mmio_base[res]) { | 2138 | |
2152 | dev_err(isp->dev, "cannot map camera register I/O region\n"); | 2139 | isp->mmio_base_phys[res] = mem->start; |
2153 | return -ENODEV; | ||
2154 | } | ||
2155 | 2140 | ||
2156 | return 0; | 2141 | return 0; |
2157 | } | 2142 | } |
diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h index d1e857e41731..72685ad0fc1e 100644 --- a/drivers/media/platform/omap3isp/isp.h +++ b/drivers/media/platform/omap3isp/isp.h | |||
@@ -152,7 +152,6 @@ struct isp_xclk { | |||
152 | * regions. | 152 | * regions. |
153 | * @mmio_base_phys: Array with physical L4 bus addresses for ISP register | 153 | * @mmio_base_phys: Array with physical L4 bus addresses for ISP register |
154 | * regions. | 154 | * regions. |
155 | * @mmio_size: Array with ISP register regions size in bytes. | ||
156 | * @stat_lock: Spinlock for handling statistics | 155 | * @stat_lock: Spinlock for handling statistics |
157 | * @isp_mutex: Mutex for serializing requests to ISP. | 156 | * @isp_mutex: Mutex for serializing requests to ISP. |
158 | * @crashed: Bitmask of crashed entities (indexed by entity ID) | 157 | * @crashed: Bitmask of crashed entities (indexed by entity ID) |
@@ -188,7 +187,6 @@ struct isp_device { | |||
188 | 187 | ||
189 | void __iomem *mmio_base[OMAP3_ISP_IOMEM_LAST]; | 188 | void __iomem *mmio_base[OMAP3_ISP_IOMEM_LAST]; |
190 | unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST]; | 189 | unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST]; |
191 | resource_size_t mmio_size[OMAP3_ISP_IOMEM_LAST]; | ||
192 | 190 | ||
193 | /* ISP Obj */ | 191 | /* ISP Obj */ |
194 | spinlock_t stat_lock; /* common lock for statistic drivers */ | 192 | spinlock_t stat_lock; /* common lock for statistic drivers */ |