Received: by 10.192.165.148 with SMTP id m20csp1973288imm; Thu, 26 Apr 2018 04:54:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx498WnNa7afODOSrkvDrrc7sMfao08YNyoLWpA3qy6FBhhU6mpIYvkR9AWhp+323T0vDd0AS X-Received: by 10.99.142.66 with SMTP id k63mr27069388pge.278.1524743680707; Thu, 26 Apr 2018 04:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524743680; cv=none; d=google.com; s=arc-20160816; b=GrHguLSSTGFyZHfrUnsp3cbhexx3UfKnL5XoawOP1bv6YfIW9QZA5p16TvKFU/cad4 KeAw8dpjlXXkGx0R/KD23FtIfl+b1V351bwrZRLpLSdDKyyAC8DNen1wdWD5YmydHClJ LZJBvmL17h8d10meDg4YHzJZBlmpiQx+nEExnFhlwnuuS+7FerIrzRxFk8uMpVFR6qXF S1E5E6FMBAK2pzYvWCSsKpmYLJWG55vREWELkDpDCEL3dsw/2pvpvec7o3mymrTCGg+R K3We1QNsmeb3gP5EgHnq/JzpiUWHPPj5V9gZM2qXGW2YhhyvJA/WXrcMMf2FdUOgHJu8 ozHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=lOJqpKa6hfiyZqklT5r0dWWKG7GGIQCBLf+FdrxnXtY=; b=gQSyN8s0QcpsKhUuLeJdosj7Ficl5uYtigqmke22bC7U5bZ+lUC3fxSKRgnvqzqHIq jNa1fdz1aNBuBd/1zyIXgMZmNJWAIQl3A7vMh5VUm6JS8oiL9Va4GedZZOXfI4NTAgGb qIKhFnxnVDlh/1ANpBEXHwvzeMBd2FNWa2r1SAD/T5XfHp/70oH8huPiiCfTrbPk6amU rwWAQzo9A1lwtEE+0w2XBL5OtmlBGf/o+iFZYTH240AU9wb/Ll2eb9ypk1VAmWJQnDKu WDgze5cBIknPI7OhgcQwicQo/H1tRsOOj03kj35pL7E3Zca5Y4zSbH5P7j/rudQVt0uz Nt5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BjN4KFhh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si15342365pgq.329.2018.04.26.04.54.26; Thu, 26 Apr 2018 04:54:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BjN4KFhh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756180AbeDZLwv (ORCPT + 99 others); Thu, 26 Apr 2018 07:52:51 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:48415 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755834AbeDZLwd (ORCPT ); Thu, 26 Apr 2018 07:52:33 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180426115230epoutp01743e72d2f6b9aaeab754bb7e3f879bc9~o_i5OObJi0232602326epoutp01c; Thu, 26 Apr 2018 11:52:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180426115230epoutp01743e72d2f6b9aaeab754bb7e3f879bc9~o_i5OObJi0232602326epoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524743550; bh=lOJqpKa6hfiyZqklT5r0dWWKG7GGIQCBLf+FdrxnXtY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=BjN4KFhheY4HZaqLPF0BACcWLr5H3vdQs98yD6EZS7SgENPIwR03HoG0cFqUT+uD/ /FVbPP5l0CXdYX5nXNSqvi7DA+4X8Xu/Dxr7ueyzl3a/ihzhHQ+D09g1pC4TDMI+OG bnFHIcJGlYhttIexNKrDO0Fo0+zlA3q1bvECXFhA= Received: from epsmges1p3.samsung.com (unknown [182.195.42.55]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180426115230epcas1p17a514d0d129352292fdd35d8fb2d1a76~o_i5B8piD2977329773epcas1p1V; Thu, 26 Apr 2018 11:52:30 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.CA.04144.E7DB1EA5; Thu, 26 Apr 2018 20:52:30 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180426115229epcas1p42ebcc547531485a4f30284dd3be7e43a~o_i36ycrG2714427144epcas1p4X; Thu, 26 Apr 2018 11:52:29 +0000 (GMT) X-AuditID: b6c32a37-4f9ff70000001030-ba-5ae1bd7e8e89 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5A.8C.03822.D7DB1EA5; Thu, 26 Apr 2018 20:52:29 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P7S00GD7JMBQG00@mmp2.samsung.com>; Thu, 26 Apr 2018 20:52:29 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin Cc: Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 12/18] thermal: exynos: do not use trips structure directly in ->tmu_initialize Date: Thu, 26 Apr 2018 13:51:27 +0200 Message-id: <1524743493-28113-13-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsWy7bCmvm7d3odRBnteiVtsnLGe1WL+lWus Fpd3zWGz+Nx7hNFixvl9TBZPHvaxObB57Jx1l91j8Z6XTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CVMWXfVdaCD4IVh9+/YGpgfMvXxcjBISFgItF736yLkYtDSGAHo8TS2dsYIZzvjBIb lzSywBS9/VLXxcgJFN/AKLFzcS5EzS9Gia2TFrOBJNgErCQmtq9iBLFFBLQkTlzazgRSxCww h1FiVsNuFpCEsECixOz395lBbBYBVYkFf16C2bwCnhIb5mwEa5YQkJM4eWwyK4jNCRS/cKSJ BWSQhEAjm8SyrWuYIYpcJNac3csCYQtLvDq+hR3iUmmJS0dtIeqbGSW+7dgDVT+BUWLPeiEI 21ri8PGLYAuYBfgk3n3tYYXo5ZXoaIMq8ZD4enkzK4TtKDFv+SY2iI+Bnlm6YDvLBEapBYwM qxjFUguKc9NTiw0LjPWKE3OLS/PS9ZLzczcxguNPy3wH44ZzPocYBTgYlXh4AxY+iBJiTSwr rsw9xCjBwawkwhvf+jBKiDclsbIqtSg/vqg0J7X4EKM0B4uSOO9TnzNRQgLpiSWp2ampBalF MFkmDk6pBkY/e96YDwpMP5R429/4iqqd3XSr8uCl9u/9XZrcP0NzJn2xOfTW6/e7CNbjOZI8 3TpXGPpPPvne/umwQsHMZbevVspNWsQgrlDrGSnn+fdCm+c+aSfByGP/jBkjNhh/OXhZX1Bc 1jin0enadXcpc84Sjcs3lNxzF99zvrFx7+GtJ7Y5pO/8aqHEUpyRaKjFXFScCAB3f9PKuwIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e+xoG7t3odRBu82cllsnLGe1WL+lWus Fpd3zWGz+Nx7hNFixvl9TBZPHvaxObB57Jx1l91j8Z6XTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CVMWXfVdaCD4IVh9+/YGpgfMvXxcjBISFgIvH2S10XIxeHkMA6RoknP1ewQzi/GCU2 H3nP3MXIycEmYCUxsX0VI4gtIqAlceLSdiaQImaBOYwSz1fMYQKZJCyQKNFxuAykhkVAVWLB n5dgvbwCnhIb5mwE65UQkJM4eWwyK4jNCRS/cKSJBcQWEvCQuN/3nm0CI88CRoZVjJKpBcW5 6bnFRgWGeanlesWJucWleel6yfm5mxiBAbPtsFbfDsb7S+IPMQpwMCrx8AYsfBAlxJpYVlyZ e4hRgoNZSYQ3vvVhlBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe23nHIoUE0hNLUrNTUwtSi2Cy TBycUg2MeYU8cx8sO6W++7fee8WGixMTzwfzbDiucz/J+0bFtrbYehXemJOWzVWTlaOO7K0w f/Bqm1y5+LMj9zqXJc27sFRUbzGrfcvHM60ZvKsLxJMMRQ+9C3Bd5Nwa6mfXJBT7aguD/NFE 5Qm7tgbM++hm6a7bnr8oWGX6puDy/2fst/7YeV5zv+RhJZbijERDLeai4kQAtDBklhQCAAA= X-CMS-MailID: 20180426115229epcas1p42ebcc547531485a4f30284dd3be7e43a X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180426115229epcas1p42ebcc547531485a4f30284dd3be7e43a X-RootMTR: 20180426115229epcas1p42ebcc547531485a4f30284dd3be7e43a References: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ->get_trip_[temp,hyst] methods instead of using trips structure directly in all ->tmu_initialize method implementations. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 80265d2..12b60e2 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -409,15 +409,13 @@ static void exynos4210_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tz = data->tzd; - const struct thermal_trip * const trips = - of_thermal_get_trip_points(tz); - unsigned long temp; - int i; + int i, temp; sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO)); for (i = 0; i < of_thermal_get_ntrips(tz); i++) { - temp = trips[i].temperature / MCELSIUS; + tz->ops->get_trip_temp(tz, i, &temp); + temp /= MCELSIUS; exynos4210_tmu_set_trip_temp(data, i, temp); } } @@ -455,11 +453,9 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tz = data->tzd; - const struct thermal_trip * const trips = - of_thermal_get_trip_points(tz); - unsigned long temp, hyst; unsigned int trim_info, ctrl; int i, ntrips = min_t(int, of_thermal_get_ntrips(tz), data->ntrip); + int temp, hyst; if (data->soc == SOC_ARCH_EXYNOS3250 || data->soc == SOC_ARCH_EXYNOS4412 || @@ -484,10 +480,12 @@ static void exynos4412_tmu_initialize(struct platform_device *pdev) /* Write temperature code for rising and falling threshold */ for (i = 0; i < ntrips; i++) { - temp = trips[i].temperature / MCELSIUS; + tz->ops->get_trip_temp(tz, i, &temp); + temp /= MCELSIUS; exynos4412_tmu_set_trip_temp(data, i, temp); - hyst = trips[i].hysteresis / MCELSIUS; + tz->ops->get_trip_hyst(tz, i, &hyst); + hyst /= MCELSIUS; exynos4412_tmu_set_trip_hyst(data, i, temp, hyst); } } -- 1.9.1