Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp122208rdb; Thu, 21 Dec 2023 04:50:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2hppoHnauRDUmwsHfzeJPTyID7U7k4oCgR1HFzSOLFU8jtdW34gF3TxUi6z8y3FkvgNB1 X-Received: by 2002:a17:906:fa1b:b0:a23:6248:e987 with SMTP id lo27-20020a170906fa1b00b00a236248e987mr3269469ejb.42.1703163029407; Thu, 21 Dec 2023 04:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163029; cv=none; d=google.com; s=arc-20160816; b=UhT5cHSJ+mDeSI1oglJVRtnRViSalkJ3+RAS8WkKTabvQwVMXlCX/7XA5AXXbQE4Ss CpVVB0cV5fBQ9axJW5G3/hb9aJidPoJpPBu8pLVxXN9dKy04NyGH4AKH9zXC4CAyNaIH u4kfcKuo4Htfp34BENgcOf4+udsAWJsbuQOVUOjvwgwCcbkfWtF1Bh5hXlZNxEgOsmy7 JSLYwKjX+iJfhOZkjq0Xvwyv2CprY+1ihB8aqWMpy6K6XpjPYu4a0SOANVDR38HhIt8d Ht8WjcAKw7YL4ccMKYsnNXOuTZ9Nau86YfytVnLOB+onjxvl6St5K5Qmnbly0cxU7hRo kfCA== 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=tYPUMKNV5r5iwCpNyGf5z+EjApPZ6cJiGsUwoO63g/s=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=xdhe1sSrL5nAyTbIUhZEB7NAATJNPHlOOElI9xu38iP8EyEkVSn641zoM7UUhVQWIj 42DKaGtQ5KLSt2S0k9/sYU1q4jPyIxVNzNebb+ptAVPTvw4Ma32AFHFBBCcc/eKuBt0W iPZClq/cTtMzogVESnLtBtIAeMWf2Il0+FzcsCNX919sKrpg+ZEB0qsSAQaGrG8y3neF akeg46/KDv3bkBksB3scM5yB4dmflqIaGq7vDDwtDGVGqWq+rKHlyD17o1v+gOtmZTFP Gm++4e3iPLHf/3QJZa5RyYcd/Vue7Q/PaU1mpUr0TMyPCsiCecKAYlgBhBrBkn53oh7L wjSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="0rXki/i7"; spf=pass (google.com: domain of linux-kernel+bounces-8375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8375-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. [147.75.80.249]) by mx.google.com with ESMTPS id p24-20020a170906b21800b00a235ebeef93si828623ejz.797.2023.12.21.04.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:50:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="0rXki/i7"; spf=pass (google.com: domain of linux-kernel+bounces-8375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8375-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 26C1A1F25972 for ; Thu, 21 Dec 2023 12:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 315FF7762B; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="0rXki/i7" 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 1DA6876900; Thu, 21 Dec 2023 12:48:39 +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=1703162918; bh=p/EOsjlnUG8TWP5dtPJrrTSLSXOX9zk6B1BSsJtTuDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0rXki/i7WMZ5tTuOkWXzYijiL60wn+uxW5CzF708Pd9ZGIjF2XenuOGQKkCDNDz0B Efnzm5IvxZsSzj3O4Qer/vrxpTgxSV3qAHm49rVvPQaI7r6v4QK243V5fwl2Vmzx2k 80mH6QJwBqy7VQxL5b2eS6rc5REF/LcvAc/QAFRksHGudONXupFywD9jpOoXBQdOmq /w7SkHiWLU/gwytAbcZdvZmAA9xGGOaQDhCsXUD9nv4mVM6+pwDJPin3Ij/vZINJ8K go4OIZSOad9kM5Bwv+8blxAjdPdEfwENZ7ixPBxY+hFqd+xOQ25ZMMQI6Zx9iBTjkm LSQjhJhM1pwUw== 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 F11143782007; Thu, 21 Dec 2023 12:48:37 +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 08/26] thermal/drivers/st: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:07 +0100 Message-ID: <20231221124825.149141-9-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/thermal/st/st_thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 0d6249b36609..ff4fe417a99b 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -143,9 +143,9 @@ int st_thermal_register(struct platform_device *pdev, struct st_thermal_sensor *sensor; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + struct thermal_zone_device_params tzdp; const struct of_device_id *match; - int polling_delay; int ret; if (!np) { @@ -197,14 +197,17 @@ int st_thermal_register(struct platform_device *pdev, if (ret) goto sensor_off; - polling_delay = sensor->ops->register_enable_irq ? 0 : 1000; - trip.temperature = sensor->cdata->crit_temp; trip.type = THERMAL_TRIP_CRITICAL; - sensor->thermal_dev = - thermal_zone_device_register_with_trips(dev_name(dev), &trip, 1, 0, sensor, - &st_tz_ops, NULL, 0, polling_delay); + tzdp.type = dev_name(dev); + tzdp.ops = &st_tz_ops; + tzdp.devdata = sensor; + tzdp.trips = &trip; + tzdp.num_trips = 1; + tzdp.polling_delay = sensor->ops->register_enable_irq ? 0 : 1000; + + sensor->thermal_dev = thermal_zone_device_register(&tzdp); if (IS_ERR(sensor->thermal_dev)) { dev_err(dev, "failed to register thermal zone device\n"); ret = PTR_ERR(sensor->thermal_dev); -- 2.43.0