From patchwork Thu Oct 19 17:05:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10017855 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 AA89B602C8 for ; Thu, 19 Oct 2017 17:10:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94FC528CF0 for ; Thu, 19 Oct 2017 17:10:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89E7928D55; Thu, 19 Oct 2017 17:10:49 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 1693028CF0 for ; Thu, 19 Oct 2017 17:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbdJSRKr (ORCPT ); Thu, 19 Oct 2017 13:10:47 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:44244 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755085AbdJSRIr (ORCPT ); Thu, 19 Oct 2017 13:08:47 -0400 Received: by mail-wm0-f68.google.com with SMTP id 196so16741140wma.1 for ; Thu, 19 Oct 2017 10:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j2AvcOC6gLlpWKKQ1Dwm4/DyfkF2hZ8nsXzPlyo+nV0=; b=eqUksaPrWQszDuGXRMdnmKXC+BW1knQK6uouht7YIakf2v3tJ7mvtepSqlc4uYMmmP flCfXBajIjOnV4GMBEbG79+uWyQHejvGXouf1EpdHLrKLxUoiezX/VhBsVpRqdhen3Ui EQjm28ewrRtaApJjsT/CvUazATJBvT7nWUemE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j2AvcOC6gLlpWKKQ1Dwm4/DyfkF2hZ8nsXzPlyo+nV0=; b=RHsNMN+LNMBu/OfjFrCC6uFN8J/DUOA1M3+8ki5l54JwbFXmq7wyDoglKHAassRKmi b9UvcZqobxCKKu5qmpyymifj6utIzAHRMhNzn92PXGNEYr9LTUqHq0cmlSy4cp/9u8l6 W5rfreiM5hqfVG6sZoT8ZUWeZdPqac5/aEBZPP3z/hX0nAuRGu6tpiRfrAKgC5mBVXBK T4gyGdFPZZyr5hADtJ3ju8GIt58I6PCm4JGAPRMUBk5nAVDNViTTWVsBOQ8QVnFmtOT1 Xrro9xrbu0SMU+3zBvXUfqUgmS4X0zEEDdwWJ2xJoBJhHrdR2yUjlNoIM9LiFHFo9M52 miag== X-Gm-Message-State: AMCzsaUl3T4kkzuup+zyDn4w2qIkoRqP6n4CmQDt04jN7pvqvWU/oyX2 8lfl5vYG/rA1XdqUBizRL6/fkg== X-Google-Smtp-Source: ABhQp+RRmF6J209oDb5psjXKLFc1nCePF0ptJr6RUo4EKmnWbTMzTXKGSvPNjuPqw9mFUPAFn6XwOw== X-Received: by 10.28.146.18 with SMTP id u18mr2315796wmd.28.1508432926535; Thu, 19 Oct 2017 10:08:46 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:51c7:d9b7:e14b:6840]) by smtp.gmail.com with ESMTPSA id g16sm14277394wrd.72.2017.10.19.10.08.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Oct 2017 10:08:46 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/18] thermal/drivers/hisi: Remove thermal data back pointer Date: Thu, 19 Oct 2017 19:05:54 +0200 Message-Id: <1508432760-17847-12-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508432760-17847-1-git-send-email-daniel.lezcano@linaro.org> References: <6ac48f08-7fe6-92e9-0801-6ed3bcd05ff1@linaro.org> <1508432760-17847-1-git-send-email-daniel.lezcano@linaro.org> 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 The presence of the thermal data pointer in the sensor structure has the unique purpose of accessing the thermal data in the interrupt handler. The sensor pointer is passed when registering the interrupt handler, replace the cookie by the thermal data pointer, so the back pointer is no longer needed. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 5382073..b77ca19 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -47,7 +47,6 @@ #define HISI_DEFAULT_SENSOR 2 struct hisi_thermal_sensor { - struct hisi_thermal_data *thermal; struct thermal_zone_device *tzd; uint32_t id; uint32_t thres_temp; @@ -211,10 +210,10 @@ static void hisi_thermal_disable_sensor(struct hisi_thermal_data *data) mutex_unlock(&data->thermal_lock); } -static int hisi_thermal_get_temp(void *_sensor, int *temp) +static int hisi_thermal_get_temp(void *__data, int *temp) { - struct hisi_thermal_sensor *sensor = _sensor; - struct hisi_thermal_data *data = sensor->thermal; + struct hisi_thermal_data *data = __data; + struct hisi_thermal_sensor *sensor = &data->sensor; *temp = hisi_thermal_get_temperature(data->regs); @@ -262,10 +261,10 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, const struct thermal_trip *trip; sensor->id = index; - sensor->thermal = data; sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, - sensor->id, sensor, &hisi_of_thermal_ops); + sensor->id, data, + &hisi_of_thermal_ops); if (IS_ERR(sensor->tzd)) { ret = PTR_ERR(sensor->tzd); sensor->tzd = NULL;