From patchwork Fri Apr 8 16:52:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 8784861 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C1EAC0553 for ; Fri, 8 Apr 2016 16:55:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DB58202EB for ; Fri, 8 Apr 2016 16:55:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5ABCA2014A for ; Fri, 8 Apr 2016 16:55:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6DB472666A3; Fri, 8 Apr 2016 18:55:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BE0F92666DF; Fri, 8 Apr 2016 18:54:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 537862666F3; Fri, 8 Apr 2016 18:54:50 +0200 (CEST) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id D4468266719 for ; Fri, 8 Apr 2016 18:53:57 +0200 (CEST) Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O5B015S9QXW0C00@mailout2.samsung.com> for alsa-devel@alsa-project.org; Sat, 09 Apr 2016 01:53:56 +0900 (KST) X-AuditID: cbfee61b-f792f6d000001a2b-ea-5707e224badb Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 7D.A7.06699.422E7075; Sat, 9 Apr 2016 01:53:56 +0900 (KST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O5B002U6QWFP890@mmp2.samsung.com>; Sat, 09 Apr 2016 01:53:56 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Fri, 08 Apr 2016 18:52:45 +0200 Message-id: <1460134365-31500-3-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1460134365-31500-1-git-send-email-s.nawrocki@samsung.com> References: <1460134365-31500-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e+xoK7KI/Zwg4U35C2uXDzEZDH14RM2 ixnn9zFZHH7TzurA4rHhcxObx6ZVnWwefVtWMXp83iQXwBLFZZOSmpNZllqkb5fAlXFy9Xq2 goX8Fbs3nmdtYHzE08XIwSEhYCKx+19tFyMnkCkmceHeerYuRi4OIYFZjBLvm6YxQji/GCUW bp/EDFLFJmAo0Xu0jxHEFgHquD2nEyzOLFAoserKJzBbWMBT4sndeawgNouAqkTzw5NsIDav gJvE7fMPWCG2yUmcPDYZzOYUcJdo+XqUCcQWAqqZd34R0wRG3gWMDKsYJVILkguKk9JzjfJS y/WKE3OLS/PS9ZLzczcxgkPmmfQOxsO73A8xCnAwKvHwXnjPFi7EmlhWXJl7iFGCg1lJhLfo Lnu4EG9KYmVValF+fFFpTmrxIUZpDhYlcd7H/9eFCQmkJ5akZqemFqQWwWSZODilGhi7eA79 4lkbeydL9r/DyXvC0++077/Pb7GG6bjepo6LkqtU3dtzf6htzpU/Kznr4fF9N3c9dw9dlMgf 9WXlPcaf92/WSb1+0G5orsP83uRR10lJIUGHc13rdv3IUlpw4C+v4Sf9da8CXp928NFYJNQh dHLZnriimDKXLyWpaxkqji+YcnLSrvNqSizFGYmGWsxFxYkAKZhj+BUCAAA= Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [alsa-devel] [PATCH 3/3] ASoC: samsung: Use of_device_get_match_data() helper X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify the code a little by using a standard function for getting the match data. Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/i2s.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 7ea030e..27ca116 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1106,21 +1107,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) return i2s; } -static const struct of_device_id exynos_i2s_match[]; - -static inline const struct samsung_i2s_dai_data *samsung_i2s_get_driver_data( - struct platform_device *pdev) -{ - if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(exynos_i2s_match, pdev->dev.of_node); - return match ? match->data : NULL; - } else { - return (struct samsung_i2s_dai_data *) - platform_get_device_id(pdev)->driver_data; - } -} - #ifdef CONFIG_PM static int i2s_runtime_suspend(struct device *dev) { @@ -1233,9 +1219,13 @@ static int samsung_i2s_probe(struct platform_device *pdev) const struct samsung_i2s_dai_data *i2s_dai_data; int ret; - /* Call during Seconday interface registration */ - i2s_dai_data = samsung_i2s_get_driver_data(pdev); + if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) + i2s_dai_data = of_device_get_match_data(&pdev->dev); + else + i2s_dai_data = (struct samsung_i2s_dai_data *) + platform_get_device_id(pdev)->driver_data; + /* Call during the secondary interface registration */ if (i2s_dai_data->dai_type == TYPE_SEC) { sec_dai = dev_get_drvdata(&pdev->dev); if (!sec_dai) {