From patchwork Tue Jan 31 12:05:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92959 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1896240qgi; Tue, 31 Jan 2017 04:17:29 -0800 (PST) X-Received: by 10.84.218.77 with SMTP id f13mr39605090plm.141.1485865049471; Tue, 31 Jan 2017 04:17:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si15735748pfg.106.2017.01.31.04.17.29; Tue, 31 Jan 2017 04:17:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbdAaMR2 (ORCPT + 4 others); Tue, 31 Jan 2017 07:17:28 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:62353 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbdAaMR1 (ORCPT ); Tue, 31 Jan 2017 07:17:27 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKN00FY68A06140@mailout3.w1.samsung.com>; Tue, 31 Jan 2017 12:06:00 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170131120559eucas1p2c36a2d77fa803b15e8ec9bdcd9c4ff6a~e2cNFfsKZ1265212652eucas1p2Q; Tue, 31 Jan 2017 12:05:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 58.A5.09557.7AD70985; Tue, 31 Jan 2017 12:05:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170131120559eucas1p171eea15496e67cce34f964484065a714~e2cMWvGXe1547615476eucas1p1m; Tue, 31 Jan 2017 12:05:59 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-70-58907da7a5bc Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 22.88.06687.BED70985; Tue, 31 Jan 2017 12:07:07 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKN005VQ89VJE10@eusync2.samsung.com>; Tue, 31 Jan 2017 12:05:58 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski Subject: [PATCH] media: exynos4-is: add flags to dummy Exynos IS i2c adapter Date: Tue, 31 Jan 2017 13:05:53 +0100 Message-id: <1485864353-9205-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsWy7djPc7rLaydEGCyerGBx/vwGdoueDVtZ LWac38dksfbIXXaLw2/aWR1YPTat6mTz6NuyitHj8ya5AOYoLpuU1JzMstQifbsErowlsxYy FzyVqpiw/QpbA+NH8S5GTg4JAROJ1k2b2SFsMYkL99azgdhCAksZJdb9joKwPzNK3PjpCVPf 1TiJtYuRCyi+jFFi26EtTBBOA5PEv1UXwbrZBAwlut52gdkiAk4SC2f9ZQcpYhZoZZRo+b6W ESQhLOAjcWXqDaBuDg4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RsYWFuZGRkrivCUfroQLCaQnlqRmp6YWpBbB9DFxcEo1MCoJivs+ +NbbUhnekHj04vKp5R0ypWybFb/cfGxalfDwVf7vIy/+OF6cc10mPV8h89DFHU2WOyf9uBeh o7z3upPmjc1qESI80w1SNl8oX73lf6MPy8FrcWWKd196hRf5xrtfYTlh89NrcpvlGSkH+fyp dbNjdnev/f9JZVcBw/VDBrMjZodVOiuxFGckGmoxFxUnAgDlrlT8UAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170131120559eucas1p171eea15496e67cce34f964484065a714 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170131120559eucas1p171eea15496e67cce34f964484065a714 X-RootMTR: 20170131120559eucas1p171eea15496e67cce34f964484065a714 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add simple 'functionality' member to dummy Exynos IS i2c adapter to make i2c core happy and get rid of NULL pointer dereference during Exynos4 IS probe since v4.10-rc1: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 80000005 [#1] PREEMPT SMP ARM Modules linked in: CPU: 1 PID: 100 Comm: kworker/1:2 Not tainted 4.10.0-rc6-next-20170131-00054-g39e6e4233de6 #1921 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) Workqueue: events deferred_probe_work_func task: ef2e0000 task.stack: ef2ec000 PC is at 0x0 LR is at i2c_register_adapter+0x98/0x5cc ... [] (i2c_register_adapter) from [] (fimc_is_i2c_probe+0x84/0xe4) [] (fimc_is_i2c_probe) from [] (platform_drv_probe+0x50/0xb0) [] (platform_drv_probe) from [] (driver_probe_device+0x234/0x2dc) [] (driver_probe_device) from [] (bus_for_each_drv+0x44/0x8c) [] (bus_for_each_drv) from [] (__device_attach+0x9c/0x100) [] (__device_attach) from [] (bus_probe_device+0x84/0x8c) [] (bus_probe_device) from [] (device_add+0x380/0x528) [] (device_add) from [] (of_platform_device_create_pdata+0x70/0xa4) [] (of_platform_device_create_pdata) from [] (of_platform_bus_create+0xec/0x320) [] (of_platform_bus_create) from [] (of_platform_populate+0x5c/0xac) [] (of_platform_populate) from [] (fimc_is_probe+0x1c0/0x4cc) [] (fimc_is_probe) from [] (platform_drv_probe+0x50/0xb0) [] (platform_drv_probe) from [] (driver_probe_device+0x234/0x2dc) [] (driver_probe_device) from [] (bus_for_each_drv+0x44/0x8c) [] (bus_for_each_drv) from [] (__device_attach+0x9c/0x100) [] (__device_attach) from [] (bus_probe_device+0x84/0x8c) [] (bus_probe_device) from [] (deferred_probe_work_func+0x60/0x8c) [] (deferred_probe_work_func) from [] (process_one_work+0x120/0x31c) [] (process_one_work) from [] (process_scheduled_works+0x28/0x38) [] (process_scheduled_works) from [] (worker_thread+0x204/0x4ac) [] (worker_thread) from [] (kthread+0xfc/0x134) [] (kthread) from [] (ret_from_fork+0x14/0x3c) Signed-off-by: Marek Szyprowski --- drivers/media/platform/exynos4-is/fimc-is-i2c.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/exynos4-is/fimc-is-i2c.c index 6bba4ca022be..2f559663e51e 100644 --- a/drivers/media/platform/exynos4-is/fimc-is-i2c.c +++ b/drivers/media/platform/exynos4-is/fimc-is-i2c.c @@ -28,7 +28,14 @@ struct fimc_is_i2c { * is implemented in the FIMC-IS subsystem firmware and the host CPU * doesn't access the I2C bus controller. */ -static const struct i2c_algorithm fimc_is_i2c_algorithm; +static u32 is_i2c_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C; +} + +static const struct i2c_algorithm fimc_is_i2c_algorithm = { + .functionality = is_i2c_func, +}; static int fimc_is_i2c_probe(struct platform_device *pdev) {