Commit 17ac76e0 authored by Cai Huoqing's avatar Cai Huoqing Committed by Inki Dae

drm/exynos: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 6880fa6c
...@@ -793,7 +793,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev) ...@@ -793,7 +793,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct decon_context *ctx; struct decon_context *ctx;
struct resource *res;
int ret; int ret;
int i; int i;
...@@ -818,8 +817,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) ...@@ -818,8 +817,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
ctx->clks[i] = clk; ctx->clks[i] = clk;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctx->addr = devm_platform_ioremap_resource(pdev, 0);
ctx->addr = devm_ioremap_resource(dev, res);
if (IS_ERR(ctx->addr)) if (IS_ERR(ctx->addr))
return PTR_ERR(ctx->addr); return PTR_ERR(ctx->addr);
......
...@@ -1738,7 +1738,6 @@ static const struct component_ops exynos_dsi_component_ops = { ...@@ -1738,7 +1738,6 @@ static const struct component_ops exynos_dsi_component_ops = {
static int exynos_dsi_probe(struct platform_device *pdev) static int exynos_dsi_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *res;
struct exynos_dsi *dsi; struct exynos_dsi *dsi;
int ret, i; int ret, i;
...@@ -1789,8 +1788,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) ...@@ -1789,8 +1788,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
} }
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dsi->reg_base = devm_platform_ioremap_resource(pdev, 0);
dsi->reg_base = devm_ioremap_resource(dev, res);
if (IS_ERR(dsi->reg_base)) if (IS_ERR(dsi->reg_base))
return PTR_ERR(dsi->reg_base); return PTR_ERR(dsi->reg_base);
......
...@@ -85,7 +85,6 @@ struct fimc_scaler { ...@@ -85,7 +85,6 @@ struct fimc_scaler {
/* /*
* A structure of fimc context. * A structure of fimc context.
* *
* @regs_res: register resources.
* @regs: memory mapped io registers. * @regs: memory mapped io registers.
* @lock: locking of operations. * @lock: locking of operations.
* @clocks: fimc clocks. * @clocks: fimc clocks.
...@@ -103,7 +102,6 @@ struct fimc_context { ...@@ -103,7 +102,6 @@ struct fimc_context {
struct exynos_drm_ipp_formats *formats; struct exynos_drm_ipp_formats *formats;
unsigned int num_formats; unsigned int num_formats;
struct resource *regs_res;
void __iomem *regs; void __iomem *regs;
spinlock_t lock; spinlock_t lock;
struct clk *clocks[FIMC_CLKS_MAX]; struct clk *clocks[FIMC_CLKS_MAX];
...@@ -1327,8 +1325,7 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -1327,8 +1325,7 @@ static int fimc_probe(struct platform_device *pdev)
ctx->num_formats = num_formats; ctx->num_formats = num_formats;
/* resource memory */ /* resource memory */
ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctx->regs = devm_platform_ioremap_resource(pdev, 0);
ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
if (IS_ERR(ctx->regs)) if (IS_ERR(ctx->regs))
return PTR_ERR(ctx->regs); return PTR_ERR(ctx->regs);
......
...@@ -1202,9 +1202,7 @@ static int fimd_probe(struct platform_device *pdev) ...@@ -1202,9 +1202,7 @@ static int fimd_probe(struct platform_device *pdev)
return PTR_ERR(ctx->lcd_clk); return PTR_ERR(ctx->lcd_clk);
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctx->regs = devm_platform_ioremap_resource(pdev, 0);
ctx->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(ctx->regs)) if (IS_ERR(ctx->regs))
return PTR_ERR(ctx->regs); return PTR_ERR(ctx->regs);
......
...@@ -1449,7 +1449,6 @@ static const struct component_ops g2d_component_ops = { ...@@ -1449,7 +1449,6 @@ static const struct component_ops g2d_component_ops = {
static int g2d_probe(struct platform_device *pdev) static int g2d_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *res;
struct g2d_data *g2d; struct g2d_data *g2d;
int ret; int ret;
...@@ -1491,9 +1490,7 @@ static int g2d_probe(struct platform_device *pdev) ...@@ -1491,9 +1490,7 @@ static int g2d_probe(struct platform_device *pdev)
clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags); clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags); clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); g2d->regs = devm_platform_ioremap_resource(pdev, 0);
g2d->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(g2d->regs)) { if (IS_ERR(g2d->regs)) {
ret = PTR_ERR(g2d->regs); ret = PTR_ERR(g2d->regs);
goto err_put_clk; goto err_put_clk;
......
...@@ -86,7 +86,6 @@ struct gsc_scaler { ...@@ -86,7 +86,6 @@ struct gsc_scaler {
/* /*
* A structure of gsc context. * A structure of gsc context.
* *
* @regs_res: register resources.
* @regs: memory mapped io registers. * @regs: memory mapped io registers.
* @gsc_clk: gsc gate clock. * @gsc_clk: gsc gate clock.
* @sc: scaler infomations. * @sc: scaler infomations.
...@@ -103,7 +102,6 @@ struct gsc_context { ...@@ -103,7 +102,6 @@ struct gsc_context {
struct exynos_drm_ipp_formats *formats; struct exynos_drm_ipp_formats *formats;
unsigned int num_formats; unsigned int num_formats;
struct resource *regs_res;
void __iomem *regs; void __iomem *regs;
const char **clk_names; const char **clk_names;
struct clk *clocks[GSC_MAX_CLOCKS]; struct clk *clocks[GSC_MAX_CLOCKS];
...@@ -1272,9 +1270,7 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1272,9 +1270,7 @@ static int gsc_probe(struct platform_device *pdev)
} }
} }
/* resource memory */ ctx->regs = devm_platform_ioremap_resource(pdev, 0);
ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
if (IS_ERR(ctx->regs)) if (IS_ERR(ctx->regs))
return PTR_ERR(ctx->regs); return PTR_ERR(ctx->regs);
......
...@@ -278,7 +278,6 @@ static const struct component_ops rotator_component_ops = { ...@@ -278,7 +278,6 @@ static const struct component_ops rotator_component_ops = {
static int rotator_probe(struct platform_device *pdev) static int rotator_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *regs_res;
struct rot_context *rot; struct rot_context *rot;
const struct rot_variant *variant; const struct rot_variant *variant;
int irq; int irq;
...@@ -292,8 +291,7 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -292,8 +291,7 @@ static int rotator_probe(struct platform_device *pdev)
rot->formats = variant->formats; rot->formats = variant->formats;
rot->num_formats = variant->num_formats; rot->num_formats = variant->num_formats;
rot->dev = dev; rot->dev = dev;
regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); rot->regs = devm_platform_ioremap_resource(pdev, 0);
rot->regs = devm_ioremap_resource(dev, regs_res);
if (IS_ERR(rot->regs)) if (IS_ERR(rot->regs))
return PTR_ERR(rot->regs); return PTR_ERR(rot->regs);
......
...@@ -485,7 +485,6 @@ static const struct component_ops scaler_component_ops = { ...@@ -485,7 +485,6 @@ static const struct component_ops scaler_component_ops = {
static int scaler_probe(struct platform_device *pdev) static int scaler_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *regs_res;
struct scaler_context *scaler; struct scaler_context *scaler;
int irq; int irq;
int ret, i; int ret, i;
...@@ -498,8 +497,7 @@ static int scaler_probe(struct platform_device *pdev) ...@@ -498,8 +497,7 @@ static int scaler_probe(struct platform_device *pdev)
(struct scaler_data *)of_device_get_match_data(dev); (struct scaler_data *)of_device_get_match_data(dev);
scaler->dev = dev; scaler->dev = dev;
regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); scaler->regs = devm_platform_ioremap_resource(pdev, 0);
scaler->regs = devm_ioremap_resource(dev, regs_res);
if (IS_ERR(scaler->regs)) if (IS_ERR(scaler->regs))
return PTR_ERR(scaler->regs); return PTR_ERR(scaler->regs);
......
...@@ -1957,7 +1957,6 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -1957,7 +1957,6 @@ static int hdmi_probe(struct platform_device *pdev)
struct hdmi_audio_infoframe *audio_infoframe; struct hdmi_audio_infoframe *audio_infoframe;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct hdmi_context *hdata; struct hdmi_context *hdata;
struct resource *res;
int ret; int ret;
hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL); hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
...@@ -1979,8 +1978,7 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -1979,8 +1978,7 @@ static int hdmi_probe(struct platform_device *pdev)
return ret; return ret;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hdata->regs = devm_platform_ioremap_resource(pdev, 0);
hdata->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(hdata->regs)) { if (IS_ERR(hdata->regs)) {
ret = PTR_ERR(hdata->regs); ret = PTR_ERR(hdata->regs);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment