From c536dbe4d0d53f991ab163199dc1632f22afd422 Mon Sep 17 00:00:00 2001 From: Ard van Breemen Date: Wed, 22 Mar 2017 16:21:21 +0100 Subject: [PATCH] Revert "Replace custom code with generic helper to retrieve driver data." This reverts commit 87541760bed4b9f80ce40196701adaab7593f3f3. --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 +++++++++++++++-- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index f59a2ca6c0fb..ce71d68fca9c 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include "s5p_mfc_common.h" @@ -1158,6 +1157,8 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) device_unregister(mfc_dev->mem_dev_r); } +static void *mfc_get_drv_data(struct platform_device *pdev); + /* MFC probe function */ static int s5p_mfc_probe(struct platform_device *pdev) { @@ -1181,7 +1182,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) return -ENODEV; } - dev->variant = of_device_get_match_data(&pdev->dev); + dev->variant = mfc_get_drv_data(pdev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dev->regs_base = devm_ioremap_resource(&pdev->dev, res); @@ -1540,6 +1541,18 @@ static const struct of_device_id exynos_mfc_match[] = { }; MODULE_DEVICE_TABLE(of, exynos_mfc_match); +static void *mfc_get_drv_data(struct platform_device *pdev) +{ + struct s5p_mfc_variant *driver_data = NULL; + const struct of_device_id *match; + + match = of_match_node(exynos_mfc_match, pdev->dev.of_node); + if (match) + driver_data = (struct s5p_mfc_variant *)match->data; + + return driver_data; +} + static struct platform_driver s5p_mfc_driver = { .probe = s5p_mfc_probe, .remove = s5p_mfc_remove, diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 388d23dd4098..0048eaf14445 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -192,7 +192,7 @@ struct s5p_mfc_buf { */ struct s5p_mfc_pm { struct clk *clock_gate; - const char * const *clk_names; + const char **clk_names; struct clk *clocks[MFC_MAX_CLOCKS]; int num_clocks; bool use_clock_gating; @@ -304,7 +304,7 @@ struct s5p_mfc_dev { struct v4l2_ctrl_handler dec_ctrl_handler; struct v4l2_ctrl_handler enc_ctrl_handler; struct s5p_mfc_pm pm; - const struct s5p_mfc_variant *variant; + struct s5p_mfc_variant *variant; int num_inst; spinlock_t irqlock; /* lock when operating on context */ spinlock_t condlock; /* lock when changing/checking if a context is