From patchwork Thu Apr 10 07:32:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3960261 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 14DA3BFF02 for ; Thu, 10 Apr 2014 07:32:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AAAC20630 for ; Thu, 10 Apr 2014 07:32:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CA2F20629 for ; Thu, 10 Apr 2014 07:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168AbaDJHck (ORCPT ); Thu, 10 Apr 2014 03:32:40 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:44301 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965197AbaDJHcg (ORCPT ); Thu, 10 Apr 2014 03:32:36 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3T00CAT0Y7UK10@mailout4.samsung.com> for linux-media@vger.kernel.org; Thu, 10 Apr 2014 16:32:31 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-a4-5346490f1346 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A2.D3.29263.F0946435; Thu, 10 Apr 2014 16:32:31 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3T005990XW0YD0@mmp2.samsung.com>; Thu, 10 Apr 2014 16:32:31 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, Jacek Anaszewski , Kyungmin Park Subject: [PATCH v2 4/8] s5p-jpeg: Fix build break when CONFIG_OF is undefined Date: Thu, 10 Apr 2014 09:32:14 +0200 Message-id: <1397115138-1095-4-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1397115138-1095-1-git-send-email-j.anaszewski@samsung.com> References: <1397115138-1095-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t9jQV1+T7dggx07hC16rz5ntDjb9Ibd omfDVlaLw2/aWR1YPPq2rGL0+LxJLoApissmJTUnsyy1SN8ugSvj9brrLAXfhCvuTJ7M0sD4 QKCLkZNDQsBE4sn9FhYIW0ziwr31bF2MXBxCAtMZJaa9b2eCcNqZJB58OswGUsUmYCjx88Vr JhBbREBe4knvDaA4BwezQInEofWKIGFhAV+J/v3zGEFsFgFVieaV18FsXgF3iZNrlrKAlEsI KEjMmWQDEuYU8JD4sWc9M4gtBFSycfJ15gmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn 525iBIfFM6kdjCsbLA4xCnAwKvHwHljmGizEmlhWXJl7iFGCg1lJhFdByC1YiDclsbIqtSg/ vqg0J7X4EKM0B4uSOO+BVutAIYH0xJLU7NTUgtQimCwTB6dUA6PpHr+l/s5fExLPbtztdMD7 TviDrndPvXsYJh64njz3jwe32aYFZ9c0ySW+2DWhWv2AmtC6GbPbm9/sMVu6f42S7fRFlw8x 5b3d6KL8/uNR29kRC0RClPaX/ZvA5X1u6cxZvSver1finP3OJlL6Fvt/nuYpBWmRml1pBUcU ihLDHJ1m919/82CuEktxRqKhFnNRcSIAEhQ48QcCAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes build break occurring when there is no support for Device Tree turned on in the kernel configuration. In such a case only the driver variant for S5PC210 SoC will be available. Signed-off-by: Jacek Anaszewski Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 18 ++++++++---------- 1 file 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 1b69b69..04260c2 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1840,7 +1840,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); /* * ============================================================================ @@ -1854,15 +1854,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); @@ -2091,7 +2088,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, @@ -2122,19 +2118,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,