From patchwork Fri Feb 24 13:36:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9590409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C4D8601AE for ; Fri, 24 Feb 2017 13:38:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 413F9287A4 for ; Fri, 24 Feb 2017 13:38:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35F91287A6; Fri, 24 Feb 2017 13:38:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2713A287A4 for ; Fri, 24 Feb 2017 13:38:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751125AbdBXNhS (ORCPT ); Fri, 24 Feb 2017 08:37:18 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:22044 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbdBXNgt (ORCPT ); Fri, 24 Feb 2017 08:36:49 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OLV00BPGSG7MV10@mailout1.w1.samsung.com>; Fri, 24 Feb 2017 13:36:07 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170224133606eucas1p2f37e4a73d2041c16a44bea508411a78c~mPJvQlJ0a0130601306eucas1p2o; Fri, 24 Feb 2017 13:36:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 5D.77.30614.6C630B85; Fri, 24 Feb 2017 13:36:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f~mPJuh3NER2926329263eucas1p2w; Fri, 24 Feb 2017 13:36:06 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-55-58b036c61fcb Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 05.0C.06687.D1730B85; Fri, 24 Feb 2017 13:37:33 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OLV00HZWSG2XP00@eusync4.samsung.com>; Fri, 24 Feb 2017 13:36:05 +0000 (GMT) From: Andrzej Hajda To: Wolfram Sang , Krzysztof Kozlowski , Javier Martinez Canillas , linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH] i2c: exynos5: use core helper to get driver data Date: Fri, 24 Feb 2017 14:36:00 +0100 Message-id: <1487943360-6421-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWy7djPc7rHzDZEGMzbqGhxa905VouNM9az Wrx5u4bJ4vz5DewWHX+/MFrMOL+PyWLtkbvsFitPzGJ24PDYtKqTzWNL/112j74tqxg9Tp56 wuLxeZNcAGs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7D6yKWaCPUaLx7yo2kCph AUeJ3ot3WUBsFgFViaOtt9lBbF4BJ4n5ix6yQ+yTk7h5rpN5AiP3AkaGVYwiqaXFuem5xYZ6 xYm5xaV56XrJ+bmbGIGhuu3Yz807GC9tDD7EKMDBqMTDa/BsXYQQa2JZcWXuIUYJDmYlEd7z ShsihHhTEiurUovy44tKc1KLDzGaAi2fyCwlmpwPjKO8knhDE0NzS0MjYwsLcyMjJXHekg9X woUE0hNLUrNTUwtSi2D6mDg4pRoYpx5yPtWRYzT3zsSq+bL9myXtQ0wVC1m2Vc+w1553PLsi f4M358tzGxmt9vMz7fLaaHssbrX5k9Nc568vK8i1zj/Oq2i2wqd+986md4syfKr4V+aXhszY 55ai3JiXfLk7Q+n4V4Mjl0Us71Umrynlkq7erLsmV3XFD2mljwe+dljuaYu+mT5fiaU4I9FQ i7moOBEAZBCAm2sCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f X-RootMTR: 20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Driver core provides of_device_get_match_data which can be used to get driver data instead of custom helper. Signed-off-by: Andrzej Hajda Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas --- drivers/i2c/busses/i2c-exynos5.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index bc2b5db..de3b6af 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -201,7 +202,7 @@ struct exynos5_i2c { unsigned int op_clock; /* Version of HS-I2C Hardware */ - struct exynos_hsi2c_variant *variant; + const struct exynos_hsi2c_variant *variant; }; /** @@ -247,15 +248,6 @@ static const struct of_device_id exynos5_i2c_match[] = { }; MODULE_DEVICE_TABLE(of, exynos5_i2c_match); -static inline struct exynos_hsi2c_variant *exynos5_i2c_get_variant - (struct platform_device *pdev) -{ - const struct of_device_id *match; - - match = of_match_node(exynos5_i2c_match, pdev->dev.of_node); - return (struct exynos_hsi2c_variant *)match->data; -} - static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c) { writel(readl(i2c->regs + HSI2C_INT_STATUS), @@ -773,8 +765,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev) goto err_clk; } - /* Need to check the variant before setting up. */ - i2c->variant = exynos5_i2c_get_variant(pdev); + i2c->variant = of_device_get_match_data(&pdev->dev); ret = exynos5_hsi2c_clock_setup(i2c); if (ret)