drm/exynos: cleanup device pointer usages
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>
This commit is contained in:
Родитель
20cd2640a2
Коммит
d873ab99ac
|
@ -1884,7 +1884,7 @@ static int fimc_probe(struct platform_device *pdev)
|
||||||
goto err_pm_dis;
|
goto err_pm_dis;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_info(&pdev->dev, "drm fimc registered successfully.\n");
|
dev_info(dev, "drm fimc registered successfully.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||||
|
|
||||||
if (pdev->dev.of_node) {
|
if (dev->of_node) {
|
||||||
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
DRM_ERROR("memory allocation for pdata failed\n");
|
DRM_ERROR("memory allocation for pdata failed\n");
|
||||||
|
@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pdata = pdev->dev.platform_data;
|
pdata = dev->platform_data;
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
DRM_ERROR("no platform data specified\n");
|
DRM_ERROR("no platform data specified\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
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))
|
if (IS_ERR(ctx->regs))
|
||||||
return PTR_ERR(ctx->regs);
|
return PTR_ERR(ctx->regs);
|
||||||
|
|
||||||
|
@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ctx->irq = res->start;
|
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);
|
0, "drm_fimd", ctx);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "irq request failed.\n");
|
dev_err(dev, "irq request failed.\n");
|
||||||
|
|
|
@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev)
|
||||||
struct exynos_drm_subdrv *subdrv;
|
struct exynos_drm_subdrv *subdrv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL);
|
g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL);
|
||||||
if (!g2d) {
|
if (!g2d) {
|
||||||
dev_err(dev, "failed to allocate driver data\n");
|
dev_err(dev, "failed to allocate driver data\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
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)) {
|
if (IS_ERR(g2d->regs)) {
|
||||||
ret = PTR_ERR(g2d->regs);
|
ret = PTR_ERR(g2d->regs);
|
||||||
goto err_put_clk;
|
goto err_put_clk;
|
||||||
|
@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev)
|
||||||
goto err_put_clk;
|
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);
|
"drm_g2d", g2d);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev, "irq request failed\n");
|
dev_err(dev, "irq request failed\n");
|
||||||
|
|
|
@ -1743,7 +1743,7 @@ static int gsc_probe(struct platform_device *pdev)
|
||||||
goto err_ippdrv_register;
|
goto err_ippdrv_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_info(&pdev->dev, "drm gsc registered successfully.\n");
|
dev_info(dev, "drm gsc registered successfully.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
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) {
|
if (!ctx) {
|
||||||
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
|
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev)
|
||||||
struct exynos_drm_subdrv *subdrv;
|
struct exynos_drm_subdrv *subdrv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev)
|
||||||
goto err_cmd_workq;
|
goto err_cmd_workq;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_info(&pdev->dev, "drm ipp registered successfully.\n");
|
dev_info(dev, "drm ipp registered successfully.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -594,7 +594,7 @@ static int vidi_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
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)
|
if (!ctx)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -612,7 +612,7 @@ static int vidi_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
platform_set_drvdata(pdev, ctx);
|
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)
|
if (ret < 0)
|
||||||
DRM_INFO("failed to create connection sysfs.\n");
|
DRM_INFO("failed to create connection sysfs.\n");
|
||||||
|
|
||||||
|
|
|
@ -1946,14 +1946,14 @@ static int hdmi_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
DRM_DEBUG_KMS("[%d]\n", __LINE__);
|
DRM_DEBUG_KMS("[%d]\n", __LINE__);
|
||||||
|
|
||||||
if (pdev->dev.of_node) {
|
if (dev->of_node) {
|
||||||
pdata = drm_hdmi_dt_parse_pdata(dev);
|
pdata = drm_hdmi_dt_parse_pdata(dev);
|
||||||
if (IS_ERR(pdata)) {
|
if (IS_ERR(pdata)) {
|
||||||
DRM_ERROR("failed to parse dt\n");
|
DRM_ERROR("failed to parse dt\n");
|
||||||
return PTR_ERR(pdata);
|
return PTR_ERR(pdata);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pdata = pdev->dev.platform_data;
|
pdata = dev->platform_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
|
@ -1961,14 +1961,14 @@ static int hdmi_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
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);
|
GFP_KERNEL);
|
||||||
if (!drm_hdmi_ctx) {
|
if (!drm_hdmi_ctx) {
|
||||||
DRM_ERROR("failed to allocate common hdmi context.\n");
|
DRM_ERROR("failed to allocate common hdmi context.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
hdata = devm_kzalloc(&pdev->dev, sizeof(struct hdmi_context),
|
hdata = devm_kzalloc(dev, sizeof(struct hdmi_context),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!hdata) {
|
if (!hdata) {
|
||||||
DRM_ERROR("out of memory\n");
|
DRM_ERROR("out of memory\n");
|
||||||
|
@ -1985,7 +1985,7 @@ static int hdmi_probe(struct platform_device *pdev)
|
||||||
if (dev->of_node) {
|
if (dev->of_node) {
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
match = of_match_node(of_match_ptr(hdmi_match_types),
|
match = of_match_node(of_match_ptr(hdmi_match_types),
|
||||||
pdev->dev.of_node);
|
dev->of_node);
|
||||||
if (match == NULL)
|
if (match == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
hdata->type = (enum hdmi_type)match->data;
|
hdata->type = (enum hdmi_type)match->data;
|
||||||
|
@ -2010,11 +2010,11 @@ static int hdmi_probe(struct platform_device *pdev)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
hdata->regs = devm_ioremap_resource(&pdev->dev, res);
|
hdata->regs = devm_ioremap_resource(dev, res);
|
||||||
if (IS_ERR(hdata->regs))
|
if (IS_ERR(hdata->regs))
|
||||||
return PTR_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) {
|
if (ret) {
|
||||||
DRM_ERROR("failed to request HPD gpio\n");
|
DRM_ERROR("failed to request HPD gpio\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -1061,7 +1061,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
mixer_res->mixer_regs = devm_ioremap(&pdev->dev, res->start,
|
mixer_res->mixer_regs = devm_ioremap(dev, res->start,
|
||||||
resource_size(res));
|
resource_size(res));
|
||||||
if (mixer_res->mixer_regs == NULL) {
|
if (mixer_res->mixer_regs == NULL) {
|
||||||
dev_err(dev, "register mapping failed.\n");
|
dev_err(dev, "register mapping failed.\n");
|
||||||
|
@ -1074,7 +1074,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
|
||||||
return -ENXIO;
|
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);
|
0, "drm_mixer", ctx);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "request interrupt failed.\n");
|
dev_err(dev, "request interrupt failed.\n");
|
||||||
|
@ -1118,7 +1118,7 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
mixer_res->vp_regs = devm_ioremap(&pdev->dev, res->start,
|
mixer_res->vp_regs = devm_ioremap(dev, res->start,
|
||||||
resource_size(res));
|
resource_size(res));
|
||||||
if (mixer_res->vp_regs == NULL) {
|
if (mixer_res->vp_regs == NULL) {
|
||||||
dev_err(dev, "register mapping failed.\n");
|
dev_err(dev, "register mapping failed.\n");
|
||||||
|
@ -1169,14 +1169,14 @@ static int mixer_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
dev_info(dev, "probe start\n");
|
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);
|
GFP_KERNEL);
|
||||||
if (!drm_hdmi_ctx) {
|
if (!drm_hdmi_ctx) {
|
||||||
DRM_ERROR("failed to allocate common hdmi context.\n");
|
DRM_ERROR("failed to allocate common hdmi context.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
DRM_ERROR("failed to alloc mixer context.\n");
|
DRM_ERROR("failed to alloc mixer context.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1187,14 +1187,14 @@ static int mixer_probe(struct platform_device *pdev)
|
||||||
if (dev->of_node) {
|
if (dev->of_node) {
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
match = of_match_node(of_match_ptr(mixer_match_types),
|
match = of_match_node(of_match_ptr(mixer_match_types),
|
||||||
pdev->dev.of_node);
|
dev->of_node);
|
||||||
drv = (struct mixer_drv_data *)match->data;
|
drv = (struct mixer_drv_data *)match->data;
|
||||||
} else {
|
} else {
|
||||||
drv = (struct mixer_drv_data *)
|
drv = (struct mixer_drv_data *)
|
||||||
platform_get_device_id(pdev)->driver_data;
|
platform_get_device_id(pdev)->driver_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->dev = &pdev->dev;
|
ctx->dev = dev;
|
||||||
ctx->parent_ctx = (void *)drm_hdmi_ctx;
|
ctx->parent_ctx = (void *)drm_hdmi_ctx;
|
||||||
drm_hdmi_ctx->ctx = (void *)ctx;
|
drm_hdmi_ctx->ctx = (void *)ctx;
|
||||||
ctx->vp_enabled = drv->is_vp_enabled;
|
ctx->vp_enabled = drv->is_vp_enabled;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче