Skip to content

Commit

Permalink
drm/exynos: cleanup device pointer usages
Browse files Browse the repository at this point in the history
Struct device pointer got from platform device pointer is already
alsigned as variable, but some functions do not use device pointer.
So this patch replaces thoes usages.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Seung-Woo Kim authored and Inki Dae committed May 23, 2013
1 parent 20cd264 commit d873ab9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ static int fimc_probe(struct platform_device *pdev)
goto err_pm_dis;
}

dev_info(&pdev->dev, "drm fimc registered successfully.\n");
dev_info(dev, "drm fimc registered successfully.\n");

return 0;

Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev)

DRM_DEBUG_KMS("%s\n", __FILE__);

if (pdev->dev.of_node) {
if (dev->of_node) {
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
DRM_ERROR("memory allocation for pdata failed\n");
Expand All @@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev)
return ret;
}
} else {
pdata = pdev->dev.platform_data;
pdata = dev->platform_data;
if (!pdata) {
DRM_ERROR("no platform data specified\n");
return -EINVAL;
Expand All @@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev)
return -EINVAL;
}

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand All @@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

ctx->regs = devm_ioremap_resource(&pdev->dev, res);
ctx->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(ctx->regs))
return PTR_ERR(ctx->regs);

Expand All @@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev)

ctx->irq = res->start;

ret = devm_request_irq(&pdev->dev, ctx->irq, fimd_irq_handler,
ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler,
0, "drm_fimd", ctx);
if (ret) {
dev_err(dev, "irq request failed.\n");
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
int ret;

g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL);
g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL);
if (!g2d) {
dev_err(dev, "failed to allocate driver data\n");
return -ENOMEM;
Expand Down Expand Up @@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

g2d->regs = devm_ioremap_resource(&pdev->dev, res);
g2d->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(g2d->regs)) {
ret = PTR_ERR(g2d->regs);
goto err_put_clk;
Expand All @@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev)
goto err_put_clk;
}

ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0,
ret = devm_request_irq(dev, g2d->irq, g2d_irq_handler, 0,
"drm_g2d", g2d);
if (ret < 0) {
dev_err(dev, "irq request failed\n");
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ static int gsc_probe(struct platform_device *pdev)
goto err_ippdrv_register;
}

dev_info(&pdev->dev, "drm gsc registered successfully.\n");
dev_info(dev, "drm gsc registered successfully.\n");

return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)

DRM_DEBUG_KMS("%s\n", __FILE__);

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) {
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
int ret;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand Down Expand Up @@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev)
goto err_cmd_workq;
}

dev_info(&pdev->dev, "drm ipp registered successfully.\n");
dev_info(dev, "drm ipp registered successfully.\n");

return 0;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_vidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static int vidi_probe(struct platform_device *pdev)

DRM_DEBUG_KMS("%s\n", __FILE__);

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand All @@ -612,7 +612,7 @@ static int vidi_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ctx);

ret = device_create_file(&pdev->dev, &dev_attr_connection);
ret = device_create_file(dev, &dev_attr_connection);
if (ret < 0)
DRM_INFO("failed to create connection sysfs.\n");

Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1946,29 +1946,29 @@ static int hdmi_probe(struct platform_device *pdev)

DRM_DEBUG_KMS("[%d]\n", __LINE__);

if (pdev->dev.of_node) {
if (dev->of_node) {
pdata = drm_hdmi_dt_parse_pdata(dev);
if (IS_ERR(pdata)) {
DRM_ERROR("failed to parse dt\n");
return PTR_ERR(pdata);
}
} else {
pdata = pdev->dev.platform_data;
pdata = dev->platform_data;
}

if (!pdata) {
DRM_ERROR("no platform data specified\n");
return -EINVAL;
}

drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx),
drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
GFP_KERNEL);
if (!drm_hdmi_ctx) {
DRM_ERROR("failed to allocate common hdmi context.\n");
return -ENOMEM;
}

hdata = devm_kzalloc(&pdev->dev, sizeof(struct hdmi_context),
hdata = devm_kzalloc(dev, sizeof(struct hdmi_context),
GFP_KERNEL);
if (!hdata) {
DRM_ERROR("out of memory\n");
Expand All @@ -1985,7 +1985,7 @@ static int hdmi_probe(struct platform_device *pdev)
if (dev->of_node) {
const struct of_device_id *match;
match = of_match_node(of_match_ptr(hdmi_match_types),
pdev->dev.of_node);
dev->of_node);
if (match == NULL)
return -ENODEV;
hdata->type = (enum hdmi_type)match->data;
Expand All @@ -2010,11 +2010,11 @@ static int hdmi_probe(struct platform_device *pdev)
return -ENOENT;
}

hdata->regs = devm_ioremap_resource(&pdev->dev, res);
hdata->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(hdata->regs))
return PTR_ERR(hdata->regs);

ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD");
ret = devm_gpio_request(dev, hdata->hpd_gpio, "HPD");
if (ret) {
DRM_ERROR("failed to request HPD gpio\n");
return ret;
Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/exynos/exynos_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
return -ENXIO;
}

mixer_res->mixer_regs = devm_ioremap(&pdev->dev, res->start,
mixer_res->mixer_regs = devm_ioremap(dev, res->start,
resource_size(res));
if (mixer_res->mixer_regs == NULL) {
dev_err(dev, "register mapping failed.\n");
Expand All @@ -1074,7 +1074,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
return -ENXIO;
}

ret = devm_request_irq(&pdev->dev, res->start, mixer_irq_handler,
ret = devm_request_irq(dev, res->start, mixer_irq_handler,
0, "drm_mixer", ctx);
if (ret) {
dev_err(dev, "request interrupt failed.\n");
Expand Down Expand Up @@ -1118,7 +1118,7 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
return -ENXIO;
}

mixer_res->vp_regs = devm_ioremap(&pdev->dev, res->start,
mixer_res->vp_regs = devm_ioremap(dev, res->start,
resource_size(res));
if (mixer_res->vp_regs == NULL) {
dev_err(dev, "register mapping failed.\n");
Expand Down Expand Up @@ -1169,14 +1169,14 @@ static int mixer_probe(struct platform_device *pdev)

dev_info(dev, "probe start\n");

drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx),
drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
GFP_KERNEL);
if (!drm_hdmi_ctx) {
DRM_ERROR("failed to allocate common hdmi context.\n");
return -ENOMEM;
}

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) {
DRM_ERROR("failed to alloc mixer context.\n");
return -ENOMEM;
Expand All @@ -1187,14 +1187,14 @@ static int mixer_probe(struct platform_device *pdev)
if (dev->of_node) {
const struct of_device_id *match;
match = of_match_node(of_match_ptr(mixer_match_types),
pdev->dev.of_node);
dev->of_node);
drv = (struct mixer_drv_data *)match->data;
} else {
drv = (struct mixer_drv_data *)
platform_get_device_id(pdev)->driver_data;
}

ctx->dev = &pdev->dev;
ctx->dev = dev;
ctx->parent_ctx = (void *)drm_hdmi_ctx;
drm_hdmi_ctx->ctx = (void *)ctx;
ctx->vp_enabled = drv->is_vp_enabled;
Expand Down

0 comments on commit d873ab9

Please sign in to comment.