summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2014-04-10 07:32:14 (GMT)
committerChanho Park <chanho61.park@samsung.com>2014-11-18 03:01:12 (GMT)
commit9e9ab7cdd5d3c2f7ae8905e0331e699a58ffaefe (patch)
tree03bef6b00b2f888338d88655583b33dbdac298ca
parent54a6c7a64236e7f3034db97a3033ae906b4a5780 (diff)
downloadlinux-3.10-9e9ab7cdd5d3c2f7ae8905e0331e699a58ffaefe.zip
linux-3.10-9e9ab7cdd5d3c2f7ae8905e0331e699a58ffaefe.tar.gz
linux-3.10-9e9ab7cdd5d3c2f7ae8905e0331e699a58ffaefe.tar.bz2
[media] s5p-jpeg: Fix build break when CONFIG_OF is undefined
This patch fixes build break occurring when there is no support for Device Tree turned on in the kernel configuration. In such case only the driver variant for S5PC210 SoC will be available. Change-Id: Ic747bc56bbc5c624e9c21c9e68b62be806a18f60 Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 6da2c62..a4afa6a 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1896,7 +1896,7 @@ static irqreturn_t exynos4_jpeg_irq(int irq, void *priv)
return IRQ_HANDLED;
}
-static void *jpeg_get_drv_data(struct platform_device *pdev);
+static void *jpeg_get_drv_data(struct device *dev);
/*
* ============================================================================
@@ -1910,15 +1910,12 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
struct resource *res;
int ret;
- if (!pdev->dev.of_node)
- return -ENODEV;
-
/* JPEG IP abstraction struct */
jpeg = devm_kzalloc(&pdev->dev, sizeof(struct s5p_jpeg), GFP_KERNEL);
if (!jpeg)
return -ENOMEM;
- jpeg->variant = jpeg_get_drv_data(pdev);
+ jpeg->variant = jpeg_get_drv_data(&pdev->dev);
mutex_init(&jpeg->lock);
spin_lock_init(&jpeg->slock);
@@ -2147,7 +2144,6 @@ static const struct dev_pm_ops s5p_jpeg_pm_ops = {
SET_RUNTIME_PM_OPS(s5p_jpeg_runtime_suspend, s5p_jpeg_runtime_resume, NULL)
};
-#ifdef CONFIG_OF
static struct s5p_jpeg_variant s5p_jpeg_drvdata = {
.version = SJPEG_S5P,
.jpeg_irq = s5p_jpeg_irq,
@@ -2178,19 +2174,21 @@ static const struct of_device_id samsung_jpeg_match[] = {
MODULE_DEVICE_TABLE(of, samsung_jpeg_match);
-static void *jpeg_get_drv_data(struct platform_device *pdev)
+static void *jpeg_get_drv_data(struct device *dev)
{
struct s5p_jpeg_variant *driver_data = NULL;
const struct of_device_id *match;
- match = of_match_node(of_match_ptr(samsung_jpeg_match),
- pdev->dev.of_node);
+ if (!IS_ENABLED(CONFIG_OF) || !dev->of_node)
+ return &s5p_jpeg_drvdata;
+
+ match = of_match_node(samsung_jpeg_match, dev->of_node);
+
if (match)
driver_data = (struct s5p_jpeg_variant *)match->data;
return driver_data;
}
-#endif
static struct platform_driver s5p_jpeg_driver = {
.probe = s5p_jpeg_probe,