From patchwork Mon Sep 4 19:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 111611 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1936162qge; Mon, 4 Sep 2017 12:59:00 -0700 (PDT) X-Received: by 10.99.126.23 with SMTP id z23mr1550759pgc.156.1504555140687; Mon, 04 Sep 2017 12:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504555140; cv=none; d=google.com; s=arc-20160816; b=RSlWX6x1NW7rdM7gAGaLNmFVK7cMiRJZn8t1ErmXKwNAx0NFCX57xHOIgFpEETcTgY 8zM+nny2EELMOAw+iU0zkNHBqkhzU7o2A78x97d6aF0z3Ejd/aI/44yC7uspfik3YdJl ukiD1UO54PnBHeB0zgAcqnD9aQlgWG23NE8Zv9AyIKegEtrjBkZ24EZx9V9Fch0+HJFX uuixeueux9DBYwtMlaDkE3HkCauYSi5zpEzpgGrK2hJDYRWFiNkEUJ77iimTk4iJC0Kk Fa1FpYORRtEQMK9Zi8HD2itGgKOO2uJp2HZ8PWiQOX4xb/wBimqoGmU2Pn5AKRhpGwCj YVQw== 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=BgU7k5JhkwEGgJ0Igb2l4oOFDtZp6E8NfnBvjszbATA=; b=yGacrVjAs7GIp1Qfnoz0DkBdr5tddX/2GhDg8h8KoQFsPg3G1ky9ZM/QlDIO0mEw84 hahavRdVoLb09kqOJr+vrekPhJqTFuJL+STSubQ3JckY8+t/xSqPrcxuuW+QY9w+24zO Nv8cXRkhMk0RgAcNX1hBv3Fo2h+oxQqU27FCO7QeUE+vOntN7o/Ki07wTP1/LIHoi7ER b0dtBJPIwphLFraPKXeFcvdnRQTJHPGf5rrAHXTFF/Ni7WetN/9hIB2oaf81ZxqJChHp pdQ9NjJ+xx74T1qQOgYcMN4u6zJf2+AU6mS6XVaPlHWD/KiT119AcWTLMl5wdinOi/9i YrXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xihbyi5U; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si1694582pln.127.2017.09.04.12.59.00; Mon, 04 Sep 2017 12:59:00 -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=@linaro.org header.s=google header.b=Xihbyi5U; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149AbdIDT66 (ORCPT + 26 others); Mon, 4 Sep 2017 15:58:58 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35256 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754054AbdIDT5w (ORCPT ); Mon, 4 Sep 2017 15:57:52 -0400 Received: by mail-wm0-f42.google.com with SMTP id v2so9984823wmf.0 for ; Mon, 04 Sep 2017 12:57:52 -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=BgU7k5JhkwEGgJ0Igb2l4oOFDtZp6E8NfnBvjszbATA=; b=Xihbyi5UkKd2UU/DdIX8gdOeRetY10XZZe0P++Hi5BIo7jVFlKxZeCWR/gJgkuEBdv 4uxIt5gcvD4SBwlqTCH7PJxmV9RWCuYG7aevHBjpmR1yznM8hlFr5RaGalNJUq4Qk9NE lKrAz9XkDbfrl/fN0iLvuNbnf2mi8QOEwOzJg= 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=BgU7k5JhkwEGgJ0Igb2l4oOFDtZp6E8NfnBvjszbATA=; b=OleivEBV31iXcsZEFKErr0s0QZ9XrnjPHMGj5dWd8UTpLfvUsuaw9PRI5p7aNI9JC+ Rw7AvLapJZ/MTCR2d/Dd7I3SUlfeVvWpGRZxgXvHA9NCUuxwn26hAPD2B99T1iMgGT8U fI1DMxv0sKJhg+mVCLitn8kWDpZx5Zi5BGe+uB7i8qDR8qHG5y0FR3G02W37OY7ZIj1d jUiRXjcHXmXrJzbjnagOpEJKLKRlCejBynRQuBA3KNDGI4JmLqGjlCKeFoCzix5oAyRG lwrRdC0h/zFFMYigCPcWW6vP3r0u0OHkWK3n7ikuY9OTPNV5WQCCNQt3Ncl4Dtaes4h7 nA3Q== X-Gm-Message-State: AHPjjUhP6Et/EYbeuNewvNTpl0c4FnNSQ7XqojoA86MKpsNzSSSKeCfu wctCFTksPmembiOv X-Google-Smtp-Source: ADKCNb56lpnQTEnvqtt+wlKLvXbAdGGGhq+PuwTcNNdOTBC1tuUVpPrsKIhuvcuOpTHyJQJI1T2HfQ== X-Received: by 10.28.105.200 with SMTP id z69mr862215wmh.20.1504555071641; Mon, 04 Sep 2017 12:57:51 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:f567:7c41:be9d:9286]) by smtp.gmail.com with ESMTPSA id 23sm10798976wrt.44.2017.09.04.12.57.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Sep 2017 12:57:51 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, kevin.wangtao@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 12/13] thermal/drivers/hisi: Remove thermal data back pointer Date: Mon, 4 Sep 2017 21:56:11 +0200 Message-Id: <1504554972-2624-12-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504554972-2624-1-git-send-email-daniel.lezcano@linaro.org> References: <1504554972-2624-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 0c06d14..cce3d10 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;