From patchwork Thu Dec 21 12:48:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385313dyi; Thu, 21 Dec 2023 04:52:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcZlt0Ogge6PVeyGOVqzENiotKJHMeHDQXc0OOJi/HGsplihb45WsJ4NS4ECz75FlFvRzA X-Received: by 2002:a05:651c:514:b0:2cc:1def:18aa with SMTP id o20-20020a05651c051400b002cc1def18aamr10227353ljp.96.1703163151633; Thu, 21 Dec 2023 04:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163151; cv=none; d=google.com; s=arc-20160816; b=bKpP4lB6JfYOv5piopZkuuEtVbOL69AglPVOhaSTwzZjvPoC1ES4Gu3Hn2WKksU/mL /TkegN2Pvy4aJp2D5sSqN+RuDkGK4TMbWMOAIXGS7xfzro/8GH8J0JtjAc33Loag930H fXK80WzGiexUT4Va2qCpCb+c9pNwqDvR9hfM0MYWZwZ6meGfHPQYKRJoczm1TCXYIEDw R6xNdaHrJdCDleLm1/kxWurZ3yiRUqwD2MRmnHIDV7aCBjnxkp3wwOdYcwH6kKH8JemS H61eTINSo/o18MnfZo8rTVLQbp4K9CfCNTt9bTu1jGZKYWegKdZzS6X6g69QVGqk0fpV wJ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Wg02Ka/IIgjxeHAJlbocUELK+p/TZXOhiTWsP+bzg5E=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=TFecUS6bcG34xhUDklZ+ywQObbGaBmkGopo4SDIObLx1vuwVe6QWDLTJWxzPAv8Vc4 yAyYUmVKeivskDwrHJJxqnOHlAf/AXY5XZ+ZI1Pu4FCwNePCb2AZjPLsUjU6oaPXdgyo mZaWpKdyYYerPg9VOQcbV6T4/TiXcBRt4mK8PHuzH6cpKMXGio/SyHHg3wXLupdNueb/ CQvwTdujn7arLZqyC8HrCHnIngloPgUSqYLgjIRoWrQvX17cZc/DHEqfWY7ral4qvhLK 4LW1Kte76gWlFr9bkQS9waLnVECZgovaS9polk5s2duYcmILygM9SzAVWkg04v5HmN9X eBDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tAR+vkKM; spf=pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id eh19-20020a0564020f9300b0054cc8d2c0d9si823527edb.565.2023.12.21.04.52.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:52:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tAR+vkKM; spf=pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3C9361F25D25 for ; Thu, 21 Dec 2023 12:52:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E496579951; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="tAR+vkKM" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0D0F77650; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162921; bh=amWRBEfS8645R/5+LBfYIOcKFJwKDzDQq6B0ItRjNNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tAR+vkKMQ1u39cVeSDh2DBCkh9XH9qAL22s3UcNkoWfrbVuDHBMY60t4Tor+DLFp6 4geaYoSj0SqKLFS7j+RfsM69lJ8xwkEpMmnwY6S2zIhrjNYLUh0vYTwErGLCwXwjvO foC0mdYFf3hBx2cxqI1Hi8vepM/0RsIUOEEXIhRuzqp5KVjGTqAyLGKWUVnd/754EG xmwNloeo32TNFu9rHHBephIMgTaY1p4dszg/9hoK6hcEpwjbDfPvy0vz9w/5IFjtMH 1YSBUjj/vQibIgSVVuY3zf+nBHGrbEdmcZSY8q20devOG0gsMTigtorTVaqv1dcVEq oQGe1++PdpW/w== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 161803782016; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 12/26] thermal: intel: int340x: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:11 +0100 Message-ID: <20231221124825.149141-13-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896004752012019 X-GMAIL-MSGID: 1785896004752012019 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../int340x_thermal/int340x_thermal_zone.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index a03b67579dd9..431f09ef65e6 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -118,19 +118,19 @@ static int int340x_thermal_read_trips(struct acpi_device *zone_adev, return trip_cnt; } -static struct thermal_zone_params int340x_thermal_params = { - .governor_name = "user_space", - .no_hwmon = true, -}; - struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, int (*get_temp) (struct thermal_zone_device *, int *)) { + struct thermal_zone_device_params tzdp = { + .tzp = { + .governor_name = "user_space", + .no_hwmon = true, + } + }; struct int34x_thermal_zone *int34x_zone; struct thermal_trip *zone_trips; unsigned long long trip_cnt = 0; unsigned long long hyst; - int trip_mask = 0; acpi_status status; int i, ret; @@ -153,7 +153,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt); if (ACPI_SUCCESS(status)) { int34x_zone->aux_trip_nr = trip_cnt; - trip_mask = BIT(trip_cnt) - 1; + tzdp.mask = BIT(trip_cnt) - 1; } zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT), @@ -183,13 +183,13 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, int34x_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle); - int34x_zone->zone = thermal_zone_device_register_with_trips( - acpi_device_bid(adev), - zone_trips, trip_cnt, - trip_mask, int34x_zone, - int34x_zone->ops, - &int340x_thermal_params, - 0, 0); + tzdp.type = acpi_device_bid(adev); + tzdp.ops = int34x_zone->ops; + tzdp.devdata = int34x_zone; + tzdp.trips = zone_trips; + tzdp.num_trips = trip_cnt; + + int34x_zone->zone = thermal_zone_device_register(&tzdp); if (IS_ERR(int34x_zone->zone)) { ret = PTR_ERR(int34x_zone->zone); goto err_thermal_zone;