Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp123315rdb; Thu, 21 Dec 2023 04:52:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxFzRQd5c0JqNTE1Odb+wXvTTaj/GxW0qMjYHHaJj02/xD4ZGIOlWs1G/hOCfLLPHvTi9w X-Received: by 2002:a17:907:601f:b0:a23:4dc0:97e2 with SMTP id fs31-20020a170907601f00b00a234dc097e2mr1894232ejc.17.1703163171868; Thu, 21 Dec 2023 04:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163171; cv=none; d=google.com; s=arc-20160816; b=l1mp/7ZReWKqT414kIJmME42J5ZLiaaFgpaXmyHHTV0wkVAH8dxJljbZ52sMY5sR50 nUKWj7m+LJy8eyvYDlVvWPX6Nmu06rGaz1Nz7QQN79B0TTW+0eWRUoKHcDpEDVyWeVhN S0PiqbcxOWQYafWWje45fGN2sr5zZ4EwGFV0rBKdeMxa+G+kmanefJrP3/zd8wG6HB8u tLcKrgeW0x3EH5CWaTmQAYYptPgKfhshaVGuJwjWQ/ddZ/ZUGTk6pGM3X0OqkqwLobL5 CG0REEJIMah03ydEPMImQck1xD6bO+iBfihreQoqM0PRm2vZ/Yl3Ex9Xwd7u7j9CeRUK qOnQ== 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=/66MTpL18FcTcPXqnzLzdx3ruB6BwtIA2z3Ql9YQdMo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=QdbSrj5P1W7bxG6/tkBfGeVjRwguBVF8CX5Ze8xVC+zFavIRGwiD1XfQIGOLtfu79i AhqQJs5qiknPWrYjMc9qdQvyPLTePSeVyJwuQljkR0mzX4YJic5d/ryDMBDo9Y021QJS mznE8weqf/K4ixGhZhLhdZW6rpHe0lkVCLVKDhdaTyy1QRfiiwu4UiJj/DR+7S/mBVnM SVfYGIfRMgL6+5BC+ztRJBlvDDBcr1G35j3YjKAqKGAcL3BNaW1kWxVnI4U+/PrTzSQV XtaEOEb8Vyt26mkCP2td0oifPFWUZQJuWCps6LowyChNoJoso0dFSZmEieeU6+LSWT0r bBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QicB7AJB; spf=pass (google.com: domain of linux-kernel+bounces-8384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8384-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lh26-20020a170906f8da00b00a2331ce1f32si833867ejb.722.2023.12.21.04.52.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:52:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8384-linux.lists.archive=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=QicB7AJB; spf=pass (google.com: domain of linux-kernel+bounces-8384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8384-linux.lists.archive=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 9DE8D1F260D9 for ; Thu, 21 Dec 2023 12:52:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FA4673195; Thu, 21 Dec 2023 12:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QicB7AJB" 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 8937F78E91; Thu, 21 Dec 2023 12:48:45 +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=1703162924; bh=VcggBe2EeLqiQDA9strzfLU3yta4SiXSv2ot71tu2xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QicB7AJBvJbAbnQ8IX/E4WBw6nkBbaAxDgxJIHc8Li/4XOq1epT9EBbL4M4wvloeg MkPxtwMcjO5rxdNpYFFTZ/04Mi+c35VpvKOXrk5jEdVXqiuQ+pIbfQg3Pz9GciRKYQ 9Lt0QysUjcngt2jfNX+z/LsR8rIwQPkzweqiHgKdB0zNQk3ZwHuH68Ljunq1VFwDA5 Hb5GF6nFWO43TOZl7m2fSRy58CvA/C+NOV6CPDf3/sEDpt1paAhfsqp6GbuS3lTA6+ hvNlWFYeN+58RnnTzguYtbNsoxUoNVlJM2a35sBT18UNfKbthwmmhx2+CHUTW22rXy 9/I5oKmGi9QPg== 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 6135B3782021; Thu, 21 Dec 2023 12:48:43 +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 15/26] power: supply: core: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:14 +0100 Message-ID: <20231221124825.149141-16-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 Content-Transfer-Encoding: 8bit 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 --- drivers/power/supply/power_supply_core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 73265001dd4b..d656a2e39157 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1297,6 +1297,12 @@ static struct thermal_zone_device_ops psy_tzd_ops = { static int psy_register_thermal(struct power_supply *psy) { + struct thermal_zone_device_params tzdp = { + /* Prefer our hwmon device and avoid duplicates */ + .tzp = { .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON) }, + .ops = &psy_tzd_ops, + .devdata = psy + }; int ret; if (psy->desc->no_thermal) @@ -1304,12 +1310,8 @@ static int psy_register_thermal(struct power_supply *psy) /* Register battery zone device psy reports temperature */ if (psy_has_property(psy->desc, POWER_SUPPLY_PROP_TEMP)) { - /* Prefer our hwmon device and avoid duplicates */ - struct thermal_zone_params tzp = { - .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON) - }; - psy->tzd = thermal_tripless_zone_device_register(psy->desc->name, - psy, &psy_tzd_ops, &tzp); + tzdp.name = psy->desc->name; + psy->tzd = thermal_zone_device_register(&tzdp); if (IS_ERR(psy->tzd)) return PTR_ERR(psy->tzd); ret = thermal_zone_device_enable(psy->tzd); -- 2.43.0