From patchwork Tue Oct 10 18:02:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 9996943 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 504A460216 for ; Tue, 10 Oct 2017 18:09:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4714C28706 for ; Tue, 10 Oct 2017 18:09:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C36B28708; Tue, 10 Oct 2017 18:09:45 +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=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 CAD0328701 for ; Tue, 10 Oct 2017 18:09:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595AbdJJSFJ (ORCPT ); Tue, 10 Oct 2017 14:05:09 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:47320 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932583AbdJJSFH (ORCPT ); Tue, 10 Oct 2017 14:05:07 -0400 Received: by mail-wm0-f47.google.com with SMTP id t69so7541611wmt.2 for ; Tue, 10 Oct 2017 11:05:06 -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=gFJxPc9l2WI4+7dIfqBX+gvWPWfHAR1c3l6eVz+yowE=; b=aQPr6rC1h+eLW+PkO/gr1++qhE4oyvFx8/mBkH9GhV3eN3YhAA/hgpWu6oufvJ2NU1 YS+qbooYblUdaCGD518bQbAfnxCe02Fp8+jUFPnH5YPgNg9f7ILF58iwS2lzodAs/XNN GtkDXJbasOcvbuNYPb04UizTdZ4g05zDh8AdM= 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=gFJxPc9l2WI4+7dIfqBX+gvWPWfHAR1c3l6eVz+yowE=; b=mUQMX6o8LpfY0/gQwkdFpYlQCueekWrSQLJ410WUZyXeKfyctSn6ooHGLDr7Qt6756 Q8jWngYDsYlX9+L/Llil2qosBXr9wHvaKC3KZcRiZ7D320li+wofcqdCpHu3tXq1hnFn vd8llHyC5l30Q9PkgN8rGf+4bNiCb/uv+380PUpzTARBjoNai8poAgQJfbZSkbkDSzX7 pGIyCARmeqUzRxPlFUM9a24uR+3G1GPaVHsxYFV++zE29orimE1dAXeovqO4pADO5Ar7 cQOSluYPt2VXxV8vIcuwS9dUAiMfKYq92A5ctVXCKEFvljiV/jgi/0C2lR0Yw8Muqlwp 7Vkg== X-Gm-Message-State: AMCzsaUPGWQy0jS4rUBZxO/bDFPwrp3YV8M+q7dAUHNAXgT6ynvOUhj6 7fGYPSNsycYnRFr5vIoRibfnLg== X-Google-Smtp-Source: AOwi7QBsKMkm8lemrCNRXHnmDTL2B+mWjpWswkxxSy0vu1XrpQOvjesAPe/X6Zwwzgh3B85oxfRe5Q== X-Received: by 10.28.14.138 with SMTP id 132mr10955319wmo.7.1507658706212; Tue, 10 Oct 2017 11:05:06 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:4f9:3ae1:43d2:31ae]) by smtp.gmail.com with ESMTPSA id l73sm12513428wmd.47.2017.10.10.11.05.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 11:05:05 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kevin.wangtao@linaro.org Subject: [PATCH 12/25] thermal/drivers/hisi: Remove thermal data back pointer Date: Tue, 10 Oct 2017 20:02:37 +0200 Message-Id: <1507658570-32675-12-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507658570-32675-1-git-send-email-daniel.lezcano@linaro.org> References: <79a5f10c-0fb7-3e4f-caac-c1625904b137@linaro.org> <1507658570-32675-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 dabe9a8..5b0b5be 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;