From patchwork Mon Jan 19 11:44:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5658211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 8208EC058D for ; Mon, 19 Jan 2015 11:44:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4BF3202C8 for ; Mon, 19 Jan 2015 11:44:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D09C20361 for ; Mon, 19 Jan 2015 11:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751904AbbASLo1 (ORCPT ); Mon, 19 Jan 2015 06:44:27 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:32418 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751901AbbASLo0 (ORCPT ); Mon, 19 Jan 2015 06:44:26 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIF004H49Y0EX50@mailout1.samsung.com>; Mon, 19 Jan 2015 20:44:25 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-cb-54bcee18b546 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 66.EB.09430.81EECB45; Mon, 19 Jan 2015 20:44:24 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NIF000BO9XINH80@mmp1.samsung.com>; Mon, 19 Jan 2015 20:44:24 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Zhang Rui , Kukjin Kim , Kukjin Kim Cc: Linux PM list , "linux-samsung-soc@vger.kernel.org" , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Amit Daniel Kachhap , Abhilash Kesavan , Abhilash Kesavan , Kyungmin Park , Chanwoo Choi , Lukasz Majewski Subject: [PATCH 1/2] thermal: exynos: Reorder exynos_map_dt_data() function Date: Mon, 19 Jan 2015 12:44:03 +0100 Message-id: <1421667844-13627-2-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1421667844-13627-1-git-send-email-l.majewski@samsung.com> References: <1421667844-13627-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsVy+t9jAV2Jd3tCDPobLS0er1nMZNFwNcRi 44z1rBbXvzxntZh/5RqrxZq/Sha9C66yWfQ/fs1scbbpDbvFm0fcFm8ebma0+Nx7hNFixvl9 TBZPHvaxOfB57Jx1l91j8Z6XTB6bVnWyeayb9pbZo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0S uDJm3dnEXPCQq2Lrup3MDYxNnF2MnBwSAiYS266eZ4ewxSQu3FvP1sXIxSEksIhRYkPHH7CE kEAXk0THXV0Qm01AT+Lz3adMILaIwARGif+rokEamAWeMUvs+bqduYuRg0NYwFvi5618kBoW AVWJI6v/s4LYvAJuEncuLWKBWKYo0f1sAhuIzSngLtEy4ysTxC43iR1fbzNNYORdwMiwilE0 tSC5oDgpPddIrzgxt7g0L10vOT93EyM4PJ9J72Bc1WBxiFGAg1GJh3eD754QIdbEsuLK3EOM EhzMSiK8jBeAQrwpiZVVqUX58UWlOanFhxilOViUxHmV7NtChATSE0tSs1NTC1KLYLJMHJxS DYwzpKXMd9VOfJYgxN6WunipEc/HBhGzjQez4vZMvWMnMqVhv0j6A+FtLUzt8tGTu0q3Hl2y 5L1cgvABbXHH2zaiHZNMtJ4FFCc6MV4/56tju2zbB70Xi9qrPgVImzRPlbVb7Sx4umrpwr8v tCZNUmt8bvpxW2ul+c+jrErVXTf3KU3dKr+4w0eJpTgj0VCLuag4EQAXw9J4SwIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 The exynos_map_dt_data() function must be called before thermal_zone_of_sensor_register(), and hence provide tmu_read() function, before it is needed. This change is driven by adding support for enabling thermal_zoneX when it is properly initialized. One can read the mode of operation at /sys/class/thermal/thermal_zone0/mode Such functionality was missing in the of-thermal.c code. Reported-by: Abhilash Kesavan Signed-off-by: Lukasz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 9d2d685..5d946ab 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -975,15 +975,16 @@ static int exynos_tmu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data); mutex_init(&data->lock); + ret = exynos_map_dt_data(pdev); + if (ret) + goto err_sensor; + data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, data, &exynos_sensor_ops); if (IS_ERR(data->tzd)) { pr_err("thermal: tz: %p ERROR\n", data->tzd); return PTR_ERR(data->tzd); } - ret = exynos_map_dt_data(pdev); - if (ret) - goto err_sensor; pdata = data->pdata;