From patchwork Mon Mar 20 10:56:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95508 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882256qgd; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) X-Received: by 10.98.68.199 with SMTP id m68mr32914667pfi.31.1490007632262; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si17049412pge.228.2017.03.20.04.00.32; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) 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 S1753651AbdCTLA0 (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:26 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30564 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644AbdCTK5O (ORCPT ); Mon, 20 Mar 2017 06:57:14 -0400 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 <0ON400DIN12QV920@mailout3.w1.samsung.com>; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105650eucas1p1dba5c2e07f67748420baa391389b2105~tkdhyCgM_0044100441eucas1p1n; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 0B.7B.17477.275BFC85; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa~tkdg8rE1l2242222422eucas1p2I; Mon, 20 Mar 2017 10:56:49 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-75-58cfb572f668 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.DA.10233.085BFC85; Mon, 20 Mar 2017 10:57:04 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:49 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 02/16] media: s5p-mfc: Use generic of_device_get_match_data helper Date: Mon, 20 Mar 2017 11:56:28 +0100 Message-id: <1490007402-30265-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7djPc7pFW89HGGxcIWBxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+P13HmMBRckKhpWXWVsYGwT7WLk5JAQMJFYPXEzK4QtJnHh3nq2LkYuDiGB pYwSrx/tYIFwPjNKrL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rPk9kmsDIu4CRYRWjSGppcW56brGRXnFi bnFpXrpecn7uJkZg+G479nPLDsaud8GHGAU4GJV4eA2unosQYk0sK67MPcQowcGsJML7ce75 CCHelMTKqtSi/Pii0pzU4kOMpkBHTWSWEk3OB8ZWXkm8oYmhuaWhkbGFhbmRkZI479QPV8KF BNITS1KzU1MLUotg+pg4OKUaGLcsPGgVonj6zytGl3/PvPY7X7lmKvzp7LlrhjZnp3HOM8ry 0Q/+zst7N/X74kePJj+o0Xx+6MWJho2PePseHszi/td9cb10p6Vw0QQZu8NTeSKtMta3/jB6 fXJzrOraHUd494v+vSmWYn7czq5Cs8pt51bF/++WyL1M68iWMhCpv/bom6i4wlclluKMREMt 5qLiRABH9aNQdQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 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: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa X-RootMTR: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa References: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Replace custom code with generic helper to retrieve driver data. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy Reviewed-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 ++--------------- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) -- 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/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 4e9f349c1be3..af223b0a41a3 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "s5p_mfc_common.h" @@ -1152,8 +1153,6 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) device_unregister(mfc_dev->mem_dev_r); } -static void *mfc_get_drv_data(struct platform_device *pdev); - /* MFC probe function */ static int s5p_mfc_probe(struct platform_device *pdev) { @@ -1177,7 +1176,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) return -ENODEV; } - dev->variant = mfc_get_drv_data(pdev); + dev->variant = of_device_get_match_data(&pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dev->regs_base = devm_ioremap_resource(&pdev->dev, res); @@ -1536,18 +1535,6 @@ static int s5p_mfc_resume(struct device *dev) }; MODULE_DEVICE_TABLE(of, exynos_mfc_match); -static void *mfc_get_drv_data(struct platform_device *pdev) -{ - struct s5p_mfc_variant *driver_data = NULL; - const struct of_device_id *match; - - match = of_match_node(exynos_mfc_match, pdev->dev.of_node); - if (match) - driver_data = (struct s5p_mfc_variant *)match->data; - - return driver_data; -} - static struct platform_driver s5p_mfc_driver = { .probe = s5p_mfc_probe, .remove = s5p_mfc_remove, diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 3e0e8eaf8bfe..2f1387a4c386 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -192,7 +192,7 @@ struct s5p_mfc_buf { */ struct s5p_mfc_pm { struct clk *clock_gate; - const char **clk_names; + const char * const *clk_names; struct clk *clocks[MFC_MAX_CLOCKS]; int num_clocks; bool use_clock_gating; @@ -304,7 +304,7 @@ struct s5p_mfc_dev { struct v4l2_ctrl_handler dec_ctrl_handler; struct v4l2_ctrl_handler enc_ctrl_handler; struct s5p_mfc_pm pm; - struct s5p_mfc_variant *variant; + const struct s5p_mfc_variant *variant; int num_inst; spinlock_t irqlock; /* lock when operating on context */ spinlock_t condlock; /* lock when changing/checking if a context is