From patchwork Mon Apr 7 13:16:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3945421 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4ACE9F391 for ; Mon, 7 Apr 2014 13:16:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0417C201F7 for ; Mon, 7 Apr 2014 13:16:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F41D52022F for ; Mon, 7 Apr 2014 13:16:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755347AbaDGNQq (ORCPT ); Mon, 7 Apr 2014 09:16:46 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:34040 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755338AbaDGNQp (ORCPT ); Mon, 7 Apr 2014 09:16:45 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3N00DDYWVW03C0@mailout1.samsung.com> for linux-media@vger.kernel.org; Mon, 07 Apr 2014 22:16:44 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-41-5342a53c416c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F9.59.29263.C35A2435; Mon, 07 Apr 2014 22:16:44 +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 <0N3N00MSNWV2V030@mmp2.samsung.com>; Mon, 07 Apr 2014 22:16:44 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, Jacek Anaszewski , Kyungmin Park Subject: [PATCH 4/8] [media] s5p-jpeg: Fix build break when CONFIG_OF is undefined Date: Mon, 07 Apr 2014 15:16:09 +0200 Message-id: <1396876573-15811-4-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1396876573-15811-1-git-send-email-j.anaszewski@samsung.com> References: <1396876573-15811-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t9jQV2bpU7BBrsnyFj0Xn3OaHG26Q27 Rc+GrawWh9+0szqwePRtWcXo8XmTXABTFJdNSmpOZllqkb5dAldG3wf3govCFVuWXGNqYNwp 0MXIySEhYCIxZ/NEFghbTOLCvfVsXYxcHEIC0xklLvzYzwThtDNJNF1czQZSxSZgKPHzxWsm EFtEQF7iSe8NoDgHB7NAicSh9YogYWGBEIl5G2eADWURUJVo+rEFzOYV8JBoWtDHClIuIaAg MWeSDUiYU8BTYtrKTYwgthBQyaOXr9knMPIuYGRYxSiaWpBcUJyUnmuoV5yYW1yal66XnJ+7 iREcFM+kdjCubLA4xCjAwajEwxtwwDFYiDWxrLgy9xCjBAezkgivYZdTsBBvSmJlVWpRfnxR aU5q8SFGaQ4WJXHeA63WgUIC6YklqdmpqQWpRTBZJg5OqQbGmOl/nYWd3LITxbnnvf6adlBz uXaVoazpJ9NtH2K/yXgXNM08Hvfg7KoDFvfk9koyZXv6PnnYzS16ddeu7GxHHdYOU9FOo9Us Ae+dFn3y2PgjU3SKEYuaYtWD1Aa2da53DOwuTStYEH3f6s4eHh23dxMXxrl9L2ntvL47+fqy aXpH6ubvi7mkxFKckWioxVxUnAgA/SztPwYCAAA= 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.2 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 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 4f4dc81..913a027 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1837,7 +1837,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); /* * ============================================================================ @@ -1851,15 +1851,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); @@ -2088,7 +2085,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, @@ -2119,19 +2115,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; + if (!IS_ENABLED(CONFIG_OF) || dev->of_node == NULL) + return &s5p_jpeg_drvdata; + match = of_match_node(of_match_ptr(samsung_jpeg_match), - pdev->dev.of_node); + 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,