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: 115426 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4039120qgn; Tue, 10 Oct 2017 11:05:13 -0700 (PDT) X-Received: by 10.84.130.47 with SMTP id 44mr12844034plc.171.1507658713358; Tue, 10 Oct 2017 11:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507658713; cv=none; d=google.com; s=arc-20160816; b=xidUtbATccmI3FGtZixQPxkPSwVQXwSofi6P1s3B5Vo5Zn9bZz8hBGrqP6RfpD9CaQ vie/bvXYSu21aPJJN2iBwDJZTqIPDa12rvfYgJhuLKOTRJMe2LTeFZp4kviOCxdqMrQ7 S0kbr0bfOD8SZaGhHJk2ymp61Frv2O4A5giRzyfLVFyDmYfsqrm9ALRfxbSGevOVXi1R kC1f34ESaRG+d3h1rOK1KWCOsUYzvlPb8ncXquM2u+DIBhKhKUXRfBC+WdHneXWRNbrN dzyFIdOBJqk84+II5GqjCbv27j1n7+r7JmWKrvt6eYYdvXAPe0Yn3N/TGyIKKy8BAIMn XnkQ== 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=gFJxPc9l2WI4+7dIfqBX+gvWPWfHAR1c3l6eVz+yowE=; b=FyaWtgnbh6Y9K7uMax/YEmanz2ObTWYDOWMey1BflBmfZWn/p2ximgZ+/UBxJJ6fds P61a5MxgRgwQEZ7OCg4huY2KKJnZzYfIMrF1+VXkZSKB+C60BY44CnDwbCaf41PuG88/ qHyx2lkgXVkTpm5JDvbCMyfp4kSBfC1ffs8Zg4S6x9RCqv6o/OhLM/5roYlsP5Vunx5e AaZ97m8T7znsRLLprranxpLaYTQjO7BqVDDNYQqcYyI2aQ66qZLFUddSXYYa1gsvqq+g yQ3oYA/kY1sUarpQjG9cigXx9TgyLAmp27WSr7hYFRyUL1fH1qAFgpdQpmTv0Nz3m+tB NwsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aQPr6rC1; 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 s4si8828206plp.584.2017.10.10.11.05.13; Tue, 10 Oct 2017 11:05:13 -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=aQPr6rC1; 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 S932610AbdJJSFK (ORCPT + 26 others); Tue, 10 Oct 2017 14:05:10 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:47320 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932584AbdJJSFH (ORCPT ); Tue, 10 Oct 2017 14:05:07 -0400 Received: by mail-wm0-f48.google.com with SMTP id t69so7541612wmt.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=L1aVFjC6ipUfxAbDQRwLSj8m/u81ehpWL0HnjsVBr+CbC1PSdlpsFUfpSLPcsdW7S7 L3QLwCbYe4pxl/TxABDvNlefeLejcsbk2CLzXNrzdEq3caWy3p2SvHWHxDUQpmKYS7JQ L8g7oVDIuGWUSXEwGD1/JE0sV49P6ZZ/qKhnQ2QulWlxcO1EhnxzCvyBghYNjp3fhDLS OeHLPzcsxc0jwlPLx9XhJV2ILXhVQji5anWccLwEChKksSBukpbn6umSFnctXLjUixVu UbmNuYDtno/6ZEGibmgWMZNEv1c/w1tZ6Lv3TKzrWPpJMcyAgLkMbtpg6te6Fb2t1X57 ZUEg== X-Gm-Message-State: AMCzsaXFFjWSuvyYn/Dbjl4oKBYpJWX1C24tZ8OuwVwKkpuJ+VVBdTdS JpV3ee4pzVg/QtPAON9NQBRXsQ== 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-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 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;