aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2013-05-22 08:14:14 -0400
committerInki Dae <inki.dae@samsung.com>2013-05-23 06:48:34 -0400
commitd873ab99acd23dcd6860d8e605bc3146a4d4d9a2 (patch)
treed6f19e2d8c1f107ef471e57a2dbd95f0377776f4 /drivers
parent20cd2640a295cab46bcd08f4788984ca236fc148 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimc.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c10
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gsc.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c14
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c14
9 files changed, 29 insertions, 29 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 773f583fa964..754d76082eb3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -1884,7 +1884,7 @@ static int fimc_probe(struct platform_device *pdev)
1884 goto err_pm_dis; 1884 goto err_pm_dis;
1885 } 1885 }
1886 1886
1887 dev_info(&pdev->dev, "drm fimc registered successfully.\n"); 1887 dev_info(dev, "drm fimc registered successfully.\n");
1888 1888
1889 return 0; 1889 return 0;
1890 1890
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 746b282b343a..97c61dbffd82 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev)
885 885
886 DRM_DEBUG_KMS("%s\n", __FILE__); 886 DRM_DEBUG_KMS("%s\n", __FILE__);
887 887
888 if (pdev->dev.of_node) { 888 if (dev->of_node) {
889 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); 889 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
890 if (!pdata) { 890 if (!pdata) {
891 DRM_ERROR("memory allocation for pdata failed\n"); 891 DRM_ERROR("memory allocation for pdata failed\n");
@@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev)
899 return ret; 899 return ret;
900 } 900 }
901 } else { 901 } else {
902 pdata = pdev->dev.platform_data; 902 pdata = dev->platform_data;
903 if (!pdata) { 903 if (!pdata) {
904 DRM_ERROR("no platform data specified\n"); 904 DRM_ERROR("no platform data specified\n");
905 return -EINVAL; 905 return -EINVAL;
@@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev)
912 return -EINVAL; 912 return -EINVAL;
913 } 913 }
914 914
915 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 915 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
916 if (!ctx) 916 if (!ctx)
917 return -ENOMEM; 917 return -ENOMEM;
918 918
@@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev)
930 930
931 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 931 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
932 932
933 ctx->regs = devm_ioremap_resource(&pdev->dev, res); 933 ctx->regs = devm_ioremap_resource(dev, res);
934 if (IS_ERR(ctx->regs)) 934 if (IS_ERR(ctx->regs))
935 return PTR_ERR(ctx->regs); 935 return PTR_ERR(ctx->regs);
936 936
@@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev)
942 942
943 ctx->irq = res->start; 943 ctx->irq = res->start;
944 944
945 ret = devm_request_irq(&pdev->dev, ctx->irq, fimd_irq_handler, 945 ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler,
946 0, "drm_fimd", ctx); 946 0, "drm_fimd", ctx);
947 if (ret) { 947 if (ret) {
948 dev_err(dev, "irq request failed.\n"); 948 dev_err(dev, "irq request failed.\n");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 47a493c8a71f..af75434ee4d7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev)
1379 struct exynos_drm_subdrv *subdrv; 1379 struct exynos_drm_subdrv *subdrv;
1380 int ret; 1380 int ret;
1381 1381
1382 g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL); 1382 g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL);
1383 if (!g2d) { 1383 if (!g2d) {
1384 dev_err(dev, "failed to allocate driver data\n"); 1384 dev_err(dev, "failed to allocate driver data\n");
1385 return -ENOMEM; 1385 return -ENOMEM;
@@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev)
1417 1417
1418 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1418 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1419 1419
1420 g2d->regs = devm_ioremap_resource(&pdev->dev, res); 1420 g2d->regs = devm_ioremap_resource(dev, res);
1421 if (IS_ERR(g2d->regs)) { 1421 if (IS_ERR(g2d->regs)) {
1422 ret = PTR_ERR(g2d->regs); 1422 ret = PTR_ERR(g2d->regs);
1423 goto err_put_clk; 1423 goto err_put_clk;
@@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev)
1430 goto err_put_clk; 1430 goto err_put_clk;
1431 } 1431 }
1432 1432
1433 ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0, 1433 ret = devm_request_irq(dev, g2d->irq, g2d_irq_handler, 0,
1434 "drm_g2d", g2d); 1434 "drm_g2d", g2d);
1435 if (ret < 0) { 1435 if (ret < 0) {
1436 dev_err(dev, "irq request failed\n"); 1436 dev_err(dev, "irq request failed\n");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 7841c3b8a20e..487595ac51a8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -1743,7 +1743,7 @@ static int gsc_probe(struct platform_device *pdev)
1743 goto err_ippdrv_register; 1743 goto err_ippdrv_register;
1744 } 1744 }
1745 1745
1746 dev_info(&pdev->dev, "drm gsc registered successfully.\n"); 1746 dev_info(dev, "drm gsc registered successfully.\n");
1747 1747
1748 return 0; 1748 return 0;
1749 1749
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index ba2f0f1aa05f..437fb947e46d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)
442 442
443 DRM_DEBUG_KMS("%s\n", __FILE__); 443 DRM_DEBUG_KMS("%s\n", __FILE__);
444 444
445 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 445 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
446 if (!ctx) { 446 if (!ctx) {
447 DRM_LOG_KMS("failed to alloc common hdmi context.\n"); 447 DRM_LOG_KMS("failed to alloc common hdmi context.\n");
448 return -ENOMEM; 448 return -ENOMEM;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 5c4764af7cb9..be1e88463466 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev)
1909 struct exynos_drm_subdrv *subdrv; 1909 struct exynos_drm_subdrv *subdrv;
1910 int ret; 1910 int ret;
1911 1911
1912 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 1912 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
1913 if (!ctx) 1913 if (!ctx)
1914 return -ENOMEM; 1914 return -ENOMEM;
1915 1915
@@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev)
1963 goto err_cmd_workq; 1963 goto err_cmd_workq;
1964 } 1964 }
1965 1965
1966 dev_info(&pdev->dev, "drm ipp registered successfully.\n"); 1966 dev_info(dev, "drm ipp registered successfully.\n");
1967 1967
1968 return 0; 1968 return 0;
1969 1969
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 9504b0cd825a..24376c194a5e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -594,7 +594,7 @@ static int vidi_probe(struct platform_device *pdev)
594 594
595 DRM_DEBUG_KMS("%s\n", __FILE__); 595 DRM_DEBUG_KMS("%s\n", __FILE__);
596 596
597 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 597 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
598 if (!ctx) 598 if (!ctx)
599 return -ENOMEM; 599 return -ENOMEM;
600 600
@@ -612,7 +612,7 @@ static int vidi_probe(struct platform_device *pdev)
612 612
613 platform_set_drvdata(pdev, ctx); 613 platform_set_drvdata(pdev, ctx);
614 614
615 ret = device_create_file(&pdev->dev, &dev_attr_connection); 615 ret = device_create_file(dev, &dev_attr_connection);
616 if (ret < 0) 616 if (ret < 0)
617 DRM_INFO("failed to create connection sysfs.\n"); 617 DRM_INFO("failed to create connection sysfs.\n");
618 618
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 7e99853f1e18..8d5dcd15e150 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1946,14 +1946,14 @@ static int hdmi_probe(struct platform_device *pdev)
1946 1946
1947 DRM_DEBUG_KMS("[%d]\n", __LINE__); 1947 DRM_DEBUG_KMS("[%d]\n", __LINE__);
1948 1948
1949 if (pdev->dev.of_node) { 1949 if (dev->of_node) {
1950 pdata = drm_hdmi_dt_parse_pdata(dev); 1950 pdata = drm_hdmi_dt_parse_pdata(dev);
1951 if (IS_ERR(pdata)) { 1951 if (IS_ERR(pdata)) {
1952 DRM_ERROR("failed to parse dt\n"); 1952 DRM_ERROR("failed to parse dt\n");
1953 return PTR_ERR(pdata); 1953 return PTR_ERR(pdata);
1954 } 1954 }
1955 } else { 1955 } else {
1956 pdata = pdev->dev.platform_data; 1956 pdata = dev->platform_data;
1957 } 1957 }
1958 1958
1959 if (!pdata) { 1959 if (!pdata) {
@@ -1961,14 +1961,14 @@ static int hdmi_probe(struct platform_device *pdev)
1961 return -EINVAL; 1961 return -EINVAL;
1962 } 1962 }
1963 1963
1964 drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), 1964 drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
1965 GFP_KERNEL); 1965 GFP_KERNEL);
1966 if (!drm_hdmi_ctx) { 1966 if (!drm_hdmi_ctx) {
1967 DRM_ERROR("failed to allocate common hdmi context.\n"); 1967 DRM_ERROR("failed to allocate common hdmi context.\n");
1968 return -ENOMEM; 1968 return -ENOMEM;
1969 } 1969 }
1970 1970
1971 hdata = devm_kzalloc(&pdev->dev, sizeof(struct hdmi_context), 1971 hdata = devm_kzalloc(dev, sizeof(struct hdmi_context),
1972 GFP_KERNEL); 1972 GFP_KERNEL);
1973 if (!hdata) { 1973 if (!hdata) {
1974 DRM_ERROR("out of memory\n"); 1974 DRM_ERROR("out of memory\n");
@@ -1985,7 +1985,7 @@ static int hdmi_probe(struct platform_device *pdev)
1985 if (dev->of_node) { 1985 if (dev->of_node) {
1986 const struct of_device_id *match; 1986 const struct of_device_id *match;
1987 match = of_match_node(of_match_ptr(hdmi_match_types), 1987 match = of_match_node(of_match_ptr(hdmi_match_types),
1988 pdev->dev.of_node); 1988 dev->of_node);
1989 if (match == NULL) 1989 if (match == NULL)
1990 return -ENODEV; 1990 return -ENODEV;
1991 hdata->type = (enum hdmi_type)match->data; 1991 hdata->type = (enum hdmi_type)match->data;
@@ -2010,11 +2010,11 @@ static int hdmi_probe(struct platform_device *pdev)
2010 return -ENOENT; 2010 return -ENOENT;
2011 } 2011 }
2012 2012
2013 hdata->regs = devm_ioremap_resource(&pdev->dev, res); 2013 hdata->regs = devm_ioremap_resource(dev, res);
2014 if (IS_ERR(hdata->regs)) 2014 if (IS_ERR(hdata->regs))
2015 return PTR_ERR(hdata->regs); 2015 return PTR_ERR(hdata->regs);
2016 2016
2017 ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); 2017 ret = devm_gpio_request(dev, hdata->hpd_gpio, "HPD");
2018 if (ret) { 2018 if (ret) {
2019 DRM_ERROR("failed to request HPD gpio\n"); 2019 DRM_ERROR("failed to request HPD gpio\n");
2020 return ret; 2020 return ret;
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ec3e376b7e01..7c197d3820c5 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1061,7 +1061,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
1061 return -ENXIO; 1061 return -ENXIO;
1062 } 1062 }
1063 1063
1064 mixer_res->mixer_regs = devm_ioremap(&pdev->dev, res->start, 1064 mixer_res->mixer_regs = devm_ioremap(dev, res->start,
1065 resource_size(res)); 1065 resource_size(res));
1066 if (mixer_res->mixer_regs == NULL) { 1066 if (mixer_res->mixer_regs == NULL) {
1067 dev_err(dev, "register mapping failed.\n"); 1067 dev_err(dev, "register mapping failed.\n");
@@ -1074,7 +1074,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
1074 return -ENXIO; 1074 return -ENXIO;
1075 } 1075 }
1076 1076
1077 ret = devm_request_irq(&pdev->dev, res->start, mixer_irq_handler, 1077 ret = devm_request_irq(dev, res->start, mixer_irq_handler,
1078 0, "drm_mixer", ctx); 1078 0, "drm_mixer", ctx);
1079 if (ret) { 1079 if (ret) {
1080 dev_err(dev, "request interrupt failed.\n"); 1080 dev_err(dev, "request interrupt failed.\n");
@@ -1118,7 +1118,7 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
1118 return -ENXIO; 1118 return -ENXIO;
1119 } 1119 }
1120 1120
1121 mixer_res->vp_regs = devm_ioremap(&pdev->dev, res->start, 1121 mixer_res->vp_regs = devm_ioremap(dev, res->start,
1122 resource_size(res)); 1122 resource_size(res));
1123 if (mixer_res->vp_regs == NULL) { 1123 if (mixer_res->vp_regs == NULL) {
1124 dev_err(dev, "register mapping failed.\n"); 1124 dev_err(dev, "register mapping failed.\n");
@@ -1169,14 +1169,14 @@ static int mixer_probe(struct platform_device *pdev)
1169 1169
1170 dev_info(dev, "probe start\n"); 1170 dev_info(dev, "probe start\n");
1171 1171
1172 drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), 1172 drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
1173 GFP_KERNEL); 1173 GFP_KERNEL);
1174 if (!drm_hdmi_ctx) { 1174 if (!drm_hdmi_ctx) {
1175 DRM_ERROR("failed to allocate common hdmi context.\n"); 1175 DRM_ERROR("failed to allocate common hdmi context.\n");
1176 return -ENOMEM; 1176 return -ENOMEM;
1177 } 1177 }
1178 1178
1179 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 1179 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
1180 if (!ctx) { 1180 if (!ctx) {
1181 DRM_ERROR("failed to alloc mixer context.\n"); 1181 DRM_ERROR("failed to alloc mixer context.\n");
1182 return -ENOMEM; 1182 return -ENOMEM;
@@ -1187,14 +1187,14 @@ static int mixer_probe(struct platform_device *pdev)
1187 if (dev->of_node) { 1187 if (dev->of_node) {
1188 const struct of_device_id *match; 1188 const struct of_device_id *match;
1189 match = of_match_node(of_match_ptr(mixer_match_types), 1189 match = of_match_node(of_match_ptr(mixer_match_types),
1190 pdev->dev.of_node); 1190 dev->of_node);
1191 drv = (struct mixer_drv_data *)match->data; 1191 drv = (struct mixer_drv_data *)match->data;
1192 } else { 1192 } else {
1193 drv = (struct mixer_drv_data *) 1193 drv = (struct mixer_drv_data *)
1194 platform_get_device_id(pdev)->driver_data; 1194 platform_get_device_id(pdev)->driver_data;
1195 } 1195 }
1196 1196
1197 ctx->dev = &pdev->dev; 1197 ctx->dev = dev;
1198 ctx->parent_ctx = (void *)drm_hdmi_ctx; 1198 ctx->parent_ctx = (void *)drm_hdmi_ctx;
1199 drm_hdmi_ctx->ctx = (void *)ctx; 1199 drm_hdmi_ctx->ctx = (void *)ctx;
1200 ctx->vp_enabled = drv->is_vp_enabled; 1200 ctx->vp_enabled = drv->is_vp_enabled;