Commit 4a5ab64c authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Mauro Carvalho Chehab

[media] s5p-mfc: Use generic of_device_get_match_data helper

Replace custom code with generic helper to retrieve driver data.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: default avatarSmitha T Murthy <smitha.t@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 9f05df83
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_reserved_mem.h> #include <linux/of_reserved_mem.h>
#include <media/videobuf2-v4l2.h> #include <media/videobuf2-v4l2.h>
#include "s5p_mfc_common.h" #include "s5p_mfc_common.h"
...@@ -1152,8 +1153,6 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) ...@@ -1152,8 +1153,6 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev)
device_unregister(mfc_dev->mem_dev_r); device_unregister(mfc_dev->mem_dev_r);
} }
static void *mfc_get_drv_data(struct platform_device *pdev);
/* MFC probe function */ /* MFC probe function */
static int s5p_mfc_probe(struct platform_device *pdev) static int s5p_mfc_probe(struct platform_device *pdev)
{ {
...@@ -1177,7 +1176,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) ...@@ -1177,7 +1176,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
dev->variant = mfc_get_drv_data(pdev); dev->variant = of_device_get_match_data(&pdev->dev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->regs_base = devm_ioremap_resource(&pdev->dev, res); dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
...@@ -1536,18 +1535,6 @@ static const struct of_device_id exynos_mfc_match[] = { ...@@ -1536,18 +1535,6 @@ static const struct of_device_id exynos_mfc_match[] = {
}; };
MODULE_DEVICE_TABLE(of, 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 = { static struct platform_driver s5p_mfc_driver = {
.probe = s5p_mfc_probe, .probe = s5p_mfc_probe,
.remove = s5p_mfc_remove, .remove = s5p_mfc_remove,
......
...@@ -192,7 +192,7 @@ struct s5p_mfc_buf { ...@@ -192,7 +192,7 @@ struct s5p_mfc_buf {
*/ */
struct s5p_mfc_pm { struct s5p_mfc_pm {
struct clk *clock_gate; struct clk *clock_gate;
const char **clk_names; const char * const *clk_names;
struct clk *clocks[MFC_MAX_CLOCKS]; struct clk *clocks[MFC_MAX_CLOCKS];
int num_clocks; int num_clocks;
bool use_clock_gating; bool use_clock_gating;
...@@ -304,7 +304,7 @@ struct s5p_mfc_dev { ...@@ -304,7 +304,7 @@ struct s5p_mfc_dev {
struct v4l2_ctrl_handler dec_ctrl_handler; struct v4l2_ctrl_handler dec_ctrl_handler;
struct v4l2_ctrl_handler enc_ctrl_handler; struct v4l2_ctrl_handler enc_ctrl_handler;
struct s5p_mfc_pm pm; struct s5p_mfc_pm pm;
struct s5p_mfc_variant *variant; const struct s5p_mfc_variant *variant;
int num_inst; int num_inst;
spinlock_t irqlock; /* lock when operating on context */ spinlock_t irqlock; /* lock when operating on context */
spinlock_t condlock; /* lock when changing/checking if a context is spinlock_t condlock; /* lock when changing/checking if a context is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment