From 863981e96738983919de841ec669e157e6bdaeb0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 11 Sep 2016 04:34:46 -0300 Subject: Linux-libre 4.7.1-gnu --- drivers/media/platform/exynos-gsc/gsc-core.c | 35 +++++++--------------------- drivers/media/platform/exynos-gsc/gsc-core.h | 1 - 2 files changed, 9 insertions(+), 27 deletions(-) (limited to 'drivers/media/platform/exynos-gsc') diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 9b9e423e4..c04973669 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -967,15 +967,6 @@ static struct gsc_driverdata gsc_v_100_drvdata = { .lclk_frequency = 266000000UL, }; -static const struct platform_device_id gsc_driver_ids[] = { - { - .name = "exynos-gsc", - .driver_data = (unsigned long)&gsc_v_100_drvdata, - }, - {}, -}; -MODULE_DEVICE_TABLE(platform, gsc_driver_ids); - static const struct of_device_id exynos_gsc_match[] = { { .compatible = "samsung,exynos5-gsc", @@ -988,17 +979,11 @@ MODULE_DEVICE_TABLE(of, exynos_gsc_match); static void *gsc_get_drv_data(struct platform_device *pdev) { struct gsc_driverdata *driver_data = NULL; + const struct of_device_id *match; - if (pdev->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(exynos_gsc_match, - pdev->dev.of_node); - if (match) - driver_data = (struct gsc_driverdata *)match->data; - } else { - driver_data = (struct gsc_driverdata *) - platform_get_device_id(pdev)->driver_data; - } + match = of_match_node(exynos_gsc_match, pdev->dev.of_node); + if (match) + driver_data = (struct gsc_driverdata *)match->data; return driver_data; } @@ -1078,17 +1063,17 @@ static int gsc_probe(struct platform_device *pdev) struct resource *res; struct gsc_driverdata *drv_data = gsc_get_drv_data(pdev); struct device *dev = &pdev->dev; - int ret = 0; + int ret; gsc = devm_kzalloc(dev, sizeof(struct gsc_dev), GFP_KERNEL); if (!gsc) return -ENOMEM; - if (dev->of_node) - gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc"); - else - gsc->id = pdev->id; + ret = of_alias_get_id(pdev->dev.of_node, "gsc"); + if (ret < 0) + return ret; + gsc->id = ret; if (gsc->id >= drv_data->num_entities) { dev_err(dev, "Invalid platform device id: %d\n", gsc->id); return -EINVAL; @@ -1096,7 +1081,6 @@ static int gsc_probe(struct platform_device *pdev) gsc->variant = drv_data->variant[gsc->id]; gsc->pdev = pdev; - gsc->pdata = dev->platform_data; init_waitqueue_head(&gsc->irq_queue); spin_lock_init(&gsc->slock); @@ -1253,7 +1237,6 @@ static const struct dev_pm_ops gsc_pm_ops = { static struct platform_driver gsc_driver = { .probe = gsc_probe, .remove = gsc_remove, - .id_table = gsc_driver_ids, .driver = { .name = GSC_MODULE_NAME, .pm = &gsc_pm_ops, diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h index e93a2336c..ec4000c72 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/exynos-gsc/gsc-core.h @@ -340,7 +340,6 @@ struct gsc_dev { void __iomem *regs; wait_queue_head_t irq_queue; struct gsc_m2m_device m2m; - struct exynos_platform_gscaler *pdata; unsigned long state; struct vb2_alloc_ctx *alloc_ctx; struct video_device vdev; -- cgit v1.2.3-54-g00ecf