From patchwork Mon May 14 11:42:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10398089 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 6403E60216 for ; Mon, 14 May 2018 11:45:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 519982910D for ; Mon, 14 May 2018 11:45:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45F9E29116; Mon, 14 May 2018 11:45: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 B1F702910D for ; Mon, 14 May 2018 11:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752739AbeENLnf (ORCPT ); Mon, 14 May 2018 07:43:35 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:60303 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752659AbeENLn3 (ORCPT ); Mon, 14 May 2018 07:43:29 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180514114327epoutp03781ad74c88d1bdd11608138c6e1198c7~ugCIeJ_cu1739517395epoutp03c; Mon, 14 May 2018 11:43:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180514114327epoutp03781ad74c88d1bdd11608138c6e1198c7~ugCIeJ_cu1739517395epoutp03c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1526298207; bh=tmJLF1phu8Zh2pO+VR+ynsJmIGcJW0NM21JxxvPjStI=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=QMjglWBKc9gnMRxkASFxpIC/TGPSbGbTiaTlHbw/o2rvGKD6YnXD8dDUhKIKmIZnR kyZcBI51Oymu98zA0b8+4a0QtGvUydVoDg047LJPZ/enuJpzMmCW9PdnHe7Rr03gXZ RLmMarWQ7EPEib6UWK4sASDUpmaEXBFB2dIxtnAU= Received: from epsmges2p2.samsung.com (unknown [182.195.42.70]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180514114326epcas2p37ae73a6f92ee1a04cb57d155d11c3c94~ugCHQiU0p1711717117epcas2p3R; Mon, 14 May 2018 11:43:26 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 48.4D.04132.E5679FA5; Mon, 14 May 2018 20:43:26 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8~ugCG3gtue1201512015epcas2p2P; Mon, 14 May 2018 11:43:26 +0000 (GMT) X-AuditID: b6c32a46-145ff70000001024-6e-5af9765edca1 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E2.DA.03817.D5679FA5; Mon, 14 May 2018 20:43:25 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P8P00KHHV793330@mmp1.samsung.com>; Mon, 14 May 2018 20:43:25 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin , Keerthy Cc: Zhang Rui , linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 05/14] thermal: ti-soc-thermal: remove redundant methods from struct ti_bandgap_data Date: Mon, 14 May 2018 13:42:12 +0200 Message-id: <1526298141-14045-6-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1526298141-14045-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsWy7bCmmW5c2c8ogz8nJS02zljPajH/yjVW i1Pbm5gsLu+aw2Yxe0k/i8Xn3iOMFk8e9rE5sHvsnHWX3WPxnpdMHn1bVjF6HL+xncnj8ya5 ANYoLpuU1JzMstQifbsEroxdLfsYC07bVPzc8pW9gXGrcRcjJ4eEgIlE7+9TTF2MXBxCAjsY JTZ09EI53xkl9n26xtzFyAFWNXWnOER8N6PE4w23GUG6hQR+MUocvOANYrMJWElMbF8FFhcR cJOYteQPmM0sMJVRYtOEehBbWCBNYuO8acwgNouAqsSa9Z/AbF4BD4n+FWvYIC6Skzh5bDIr iM0p4Cmxof0lG8hiCYEpbBIHNi5jhihykbj7p5kFwhaWeHV8CzuELS3xbNVGRoiGZkaJbzv2 QDVMYJTYs14IwraWOHz8IivEdXwSHYf/skN8ySvR0QZV4iFx/9IKJgjbUWLRlNMsEN/PAXpm exv7BEapBYwMqxjFUguKc9NTi40KjPSKE3OLS/PS9ZLzczcxgqNSy20H45JzPocYBTgYlXh4 A5b/iBJiTSwrrsw9xCjBwawkwrvb6GeUEG9KYmVValF+fFFpTmrxIUZpDhYlcd41Sl+jhATS E0tSs1NTC1KLYLJMHJxSDYzHGlOf5dzgOM7Idm9nuvj+B+UTevzMd4gemXRTc07kspaes9bX fwt5C296POWl8AmHB21qnlNnXPGSs3X+ITz5cqqA/IY3oapLDmx0fbKg4qFph86KMC8d8a92 X5gzftzYOf/fKb/K0AnS+3V/lHBLlzrwLUjI1J2Wc2X2tszUtMd3LlziY7ujxFKckWioxVxU nAgA8OAAxcYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e+xgG5s2c8og1l3zC02zljPajH/yjVW i1Pbm5gsLu+aw2Yxe0k/i8Xn3iOMFk8e9rE5sHvsnHWX3WPxnpdMHn1bVjF6HL+xncnj8ya5 ANYoLpuU1JzMstQifbsEroxdLfsYC07bVPzc8pW9gXGrcRcjB4eEgInE1J3iXYycHEICOxkl br0o6WLkArJ/MUpsaNrABJJgE7CSmNi+ihHEFhFwk5i15A8jSBGzwFRGicmfTrGBJIQF0iTe TfvHDmKzCKhKrFn/iRnE5hXwkOhfsQasRkJATuLkscmsIDangKfEhvaXbBCbPSRu/25hm8DI s4CRYRWjZGpBcW56brFRgVFearlecWJucWleul5yfu4mRmAQbTus1b+D8fGS+EOMAhyMSjy8 Act/RAmxJpYVV+YeYpTgYFYS4d1t9DNKiDclsbIqtSg/vqg0J7X4EKM0B4uSOC9//rFIIYH0 xJLU7NTUgtQimCwTB6dUAyO7eUP7kbMbtyZ5hnSd9d15+VaGGf+T6x96tH7LTWm6ffFUZIpF x33tm86Zl3jn3Q3eVWGy2KHzy6L7+jsOShkoRhpKJz4+2/zs/oyYNTvvaPf3brZSkHy9fFvR +enyFw/5PT61X4SrNeP6jIvJuc9Dbvdv0Z4VvfpLts7pZ1/XRszxz3eW/vJOiaU4I9FQi7mo OBEAynWKMx4CAAA= X-CMS-MailID: 20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8 X-RootMTR: 20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8 References: <1526298141-14045-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Include ti-thermal.h header in ti-bandgap.c. * ->expose_sensor and ->remove_sensor methods are always defined and set to ti_thermal_[expose,remove]_sensor() so we can use these functions directly (dummy functions will be provided in case of CONFIG_TI_THERMAL=n). * ->report_temperature is defined only when TALERT feature is supported so it also redundant - it is only used when TALERT feature is enabled and the method is always defined to ti_thermal_report_sensor_temperature() (dummy function will be provided in case of CONFIG_TI_THERMAL=n). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 3 --- drivers/thermal/ti-soc-thermal/omap3-thermal-data.c | 6 ------ drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 8 -------- drivers/thermal/ti-soc-thermal/omap5-thermal-data.c | 3 --- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 20 ++++++++------------ drivers/thermal/ti-soc-thermal/ti-bandgap.h | 6 ------ 6 files changed, 8 insertions(+), 38 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c index e8ab7e5..c854642 100644 --- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c +++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c @@ -336,9 +336,6 @@ .conv_table = dra752_adc_to_temp, .adc_start_val = DRA752_ADC_START_VALUE, .adc_end_val = DRA752_ADC_END_VALUE, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .report_temperature = ti_thermal_report_sensor_temperature, .sensors = { { .registers = &dra752_mpu_temp_sensor_registers, diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c index f536680..cc6498e 100644 --- a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c @@ -80,9 +80,6 @@ .conv_table = omap34xx_adc_to_temp, .adc_start_val = 0, .adc_end_val = 127, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .sensors = { { .registers = &omap34xx_mpu_temp_sensor_registers, @@ -148,9 +145,6 @@ .conv_table = omap36xx_adc_to_temp, .adc_start_val = 0, .adc_end_val = 127, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .sensors = { { .registers = &omap36xx_mpu_temp_sensor_registers, diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c index 85ba9dc..14d9fe2 100644 --- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c +++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c @@ -72,8 +72,6 @@ .conv_table = omap4430_adc_to_temp, .adc_start_val = OMAP4430_ADC_START_VALUE, .adc_end_val = OMAP4430_ADC_END_VALUE, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, .sensors = { { .registers = &omap4430_mpu_temp_sensor_registers, @@ -202,9 +200,6 @@ .conv_table = omap4460_adc_to_temp, .adc_start_val = OMAP4460_ADC_START_VALUE, .adc_end_val = OMAP4460_ADC_END_VALUE, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .report_temperature = ti_thermal_report_sensor_temperature, .sensors = { { .registers = &omap4460_mpu_temp_sensor_registers, @@ -233,9 +228,6 @@ .conv_table = omap4460_adc_to_temp, .adc_start_val = OMAP4460_ADC_START_VALUE, .adc_end_val = OMAP4460_ADC_END_VALUE, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .report_temperature = ti_thermal_report_sensor_temperature, .sensors = { { .registers = &omap4460_mpu_temp_sensor_registers, diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c index e384be1..843faa7 100644 --- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c +++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c @@ -273,9 +273,6 @@ .conv_table = omap5430_adc_to_temp, .adc_start_val = OMAP5430_ADC_START_VALUE, .adc_end_val = OMAP5430_ADC_END_VALUE, - .expose_sensor = ti_thermal_expose_sensor, - .remove_sensor = ti_thermal_remove_sensor, - .report_temperature = ti_thermal_report_sensor_temperature, .sensors = { { .registers = &omap5430_mpu_temp_sensor_registers, diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 097328d..3ac74fe 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -42,6 +42,7 @@ #include #include "ti-bandgap.h" +#include "ti-thermal.h" static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id); @@ -248,8 +249,7 @@ static irqreturn_t ti_bandgap_talert_irq_handler(int irq, void *data) t_hot, t_cold); /* report temperature to whom may concern */ - if (bgp->conf->report_temperature) - bgp->conf->report_temperature(bgp, i); + ti_thermal_report_sensor_temperature(bgp, i); } spin_unlock(&bgp->lock); @@ -1017,12 +1017,10 @@ int ti_bandgap_probe(struct platform_device *pdev) goto remove_sensors; } - if (bgp->conf->expose_sensor) { - domain = bgp->conf->sensors[i].domain; - ret = bgp->conf->expose_sensor(bgp, i, domain); - if (ret) - goto remove_last_cooling; - } + domain = bgp->conf->sensors[i].domain; + ret = ti_thermal_expose_sensor(bgp, i, domain); + if (ret) + goto remove_last_cooling; } /* @@ -1048,8 +1046,7 @@ int ti_bandgap_probe(struct platform_device *pdev) for (i--; i >= 0; i--) { if (bgp->conf->sensors[i].unregister_cooling) bgp->conf->sensors[i].unregister_cooling(bgp, i); - if (bgp->conf->remove_sensor) - bgp->conf->remove_sensor(bgp, i); + ti_thermal_remove_sensor(bgp, i); } ti_bandgap_power(bgp, false); disable_clk: @@ -1079,8 +1076,7 @@ int ti_bandgap_remove(struct platform_device *pdev) if (bgp->conf->sensors[i].unregister_cooling) bgp->conf->sensors[i].unregister_cooling(bgp, i); - if (bgp->conf->remove_sensor) - bgp->conf->remove_sensor(bgp, i); + ti_thermal_remove_sensor(bgp, i); } ti_bandgap_power(bgp, false); diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h index 68d39ad..809dbdc 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h @@ -313,9 +313,6 @@ struct ti_temp_sensor { * @fclock_name: clock name of the functional clock * @div_ck_name: clock name of the clock divisor * @sensor_count: count of temperature sensor within this bandgap device - * @report_temperature: callback to report thermal alert to thermal API - * @expose_sensor: callback to export sensor to thermal API - * @remove_sensor: callback to destroy sensor from thermal API * @sensors: array of sensors present in this bandgap instance * * This is a data structure which should hold most of the static configuration @@ -332,9 +329,6 @@ struct ti_bandgap_data { char *fclock_name; char *div_ck_name; int sensor_count; - int (*report_temperature)(struct ti_bandgap *bgp, int id); - int (*expose_sensor)(struct ti_bandgap *bgp, int id, char *domain); - int (*remove_sensor)(struct ti_bandgap *bgp, int id); /* this needs to be at the end */ struct ti_temp_sensor sensors[];