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: 116425 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp723832qgn; Thu, 19 Oct 2017 10:10:49 -0700 (PDT) X-Received: by 10.84.211.3 with SMTP id b3mr1981432pli.292.1508433049356; Thu, 19 Oct 2017 10:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508433049; cv=none; d=google.com; s=arc-20160816; b=twIzCa/KL3Qtdx0cmOGN0AfjjevXSzdr3U5FZx1pssX8+za6s+JeEGw1EDOcg3N+fL wbZcnFh/v9tp82sgFnhOWaqYNV1SSaWlr38mLWaDmgI9s2Sp8ttLrRfCpe0LMlHqeIIH HOh79StxTwlxhSs/1kXxsKTdBIiVtltxPZ4LO/CUsqIqV/xt+lYSt5yfgVC2C9r8g/pj gCRJ1xZHIJc1PinWeSHNDPVROxzX8HLg/7+TiOwZvcEPpjFDsYg4Z+a89oN6q560ecAJ qZLBDyrIUZwqzdD4aTNAUJRVohsRcrdDsaUAmBXhLaT3BEJNyeVss/yoQlJMS5rtiUKn aV6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=j2AvcOC6gLlpWKKQ1Dwm4/DyfkF2hZ8nsXzPlyo+nV0=; b=j+D0gYylJBvcM5emO6P9rqwmCQoSBTfB7GtnXgnSFv2hvConslJFFXOxKGDz4mpyjl Px+BJXKa8zUr3WA8OjBZyhABT192E/yuQV0lMDUz2FTEWlIAfcUe79XwHugm+180O2zu rr6HpVeEuiOLwTwKi9I/yso1OUyahnmK5xERw6PgtleaJTCyzu1i+3XXUA0l5WVCivwD oPgOolct85w13/B50M1yYVOoXSSo1EX4UHxGrAV0wVbbzcptg1Y4xYuFNMsUt7POca+G iUtOtobK3m6LDvUk0GgGuvQO9lTRsa6/sZbrJ3WHXjVNZv0olNtOOCjyabBILER6HL/b RlUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqUksaPr; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e191si8848778pgc.788.2017.10.19.10.10.49; Thu, 19 Oct 2017 10:10:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=@linaro.org header.s=google header.b=eqUksaPr; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbdJSRKr (ORCPT + 12 others); 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 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(-) -- 2.7.4 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;