From: Marek Szyprowski Date: Wed, 9 Nov 2016 14:24:01 +0000 (-0200) Subject: [media] exynos-gsc: Use of_device_get_match_data() helper X-Git-Tag: v5.15~10718^2~1189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa7929f5954ce7232bdd9a5fe01d7458f95d104b;p=platform%2Fkernel%2Flinux-starfive.git [media] exynos-gsc: Use of_device_get_match_data() helper Replace open-coded driver data extraction code with generic helper. Signed-off-by: Marek Szyprowski Tested-by: Javier Martinez Canillas Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index c7693c6..f0d8e24 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "gsc-core.h" @@ -988,24 +989,12 @@ static const struct of_device_id exynos_gsc_match[] = { }; 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; - - match = of_match_node(exynos_gsc_match, pdev->dev.of_node); - if (match) - driver_data = (struct gsc_driverdata *)match->data; - - return driver_data; -} - static int gsc_probe(struct platform_device *pdev) { struct gsc_dev *gsc; struct resource *res; - struct gsc_driverdata *drv_data = gsc_get_drv_data(pdev); struct device *dev = &pdev->dev; + const struct gsc_driverdata *drv_data = of_device_get_match_data(dev); int ret; gsc = devm_kzalloc(dev, sizeof(struct gsc_dev), GFP_KERNEL);