From patchwork Thu Dec 21 12:48:21 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: 182204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386785dyi; Thu, 21 Dec 2023 04:55:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmtkr5DsCztaXgfWadyrxGIrSJZZ5PLV8lHAEnA05JO+lDUSMNJ/CWlKqW5TeclJBS5HgA X-Received: by 2002:a50:9519:0:b0:553:739e:bfa0 with SMTP id u25-20020a509519000000b00553739ebfa0mr2331646eda.34.1703163333493; Thu, 21 Dec 2023 04:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163333; cv=none; d=google.com; s=arc-20160816; b=UzEV5zm5avdY6QIUD/SB4kjuzhSisibmrJ5A8iokiCuB9JP60Zob/lLO7/mGFakUwr 5Jgx/Q1BK9Lwx5AbV6TCUwfOFFHLEHwN9FeE/V5wAwNvsLjstyjr11sozxIovcX7mnlH hX7FWYHbplx0ca+ozBMqjJhljncNNGD3MOqe7Ug/DjLSmg1we0pisamIjEC1Q6lUrVhq Mc0bWPoo6XoTEtRFW9twubyV6M9l7MbzlolwY/X++NjPBZCe+gp5f6h+QlPLFgcsIHV0 K8e1QQL+kjv+PHcspl/GJWDu1ue0Mq6XrSBfzrdLIEnsojuApxwa3t83FLPfDpHecckv YzsA== 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=1feJ4cDSQb1wtIeBlIUgbQ3Am9S73gIQoPNBcu4wk7k=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=z4laaBpRsD3RqMElPtiDWS1jI+4ydNXXPaB3hgSpuQRaqRGNjO8jxs0vLQ2vKF9lWF mMX6IJnzFuIO0vce6IpD8gUlhOOrM/wvLyykNymUUoD5qesasUqAaGgpWvFeNK88V4h3 hQXs4M1W3de3ZfCGcDAwepNGrV+5Ijoxddbdo2LnpYx/svDjithSs3EwWbAtRJvrDFeX /PxC6hyZyUHRSKMdPB24LWZ7h70qKidR/RkV+WTs4jJAztHASE6ER4SS01sxuBtxyLHR sl0CzihKFK6Eb4KU9USzHP6FIq0H6GjtZtd6pfL7ix5OoOp9MmRJ+nABlMhwupgBxo96 x0ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZMitHe2c; spf=pass (google.com: domain of linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8391-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 z8-20020a056402274800b005541f5ef014si525293edd.430.2023.12.21.04.55.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8391-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=ZMitHe2c; spf=pass (google.com: domain of linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8391-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 E2BE01F26678 for ; Thu, 21 Dec 2023 12:55:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F5497CD1D; Thu, 21 Dec 2023 12:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZMitHe2c" 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 7EC257BEEE; Thu, 21 Dec 2023 12:48:51 +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=1703162929; bh=ssMjukwPYr5YFlWiAdM91Hji1S8UHvaa/NNDxIiec6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZMitHe2cFQXc5iZcG2E859bVs3QezJ9Heebe5o2HM+KroJkJxidtsnLxxrNI8YAfO 7AtQ3f2OB0PNRp65286MIAcIWq7KDMab7oFCpimORGlzJ7CpLe6pWhL8HARYRrHsde qy8CfDcCdHx16BPNFvDRS5XrUhLbnwB9X3AQ2HAyyNTbMTskmpccCVsFnST/4VlfLq XIjXCF4LS0Bmi7MqkJtwnRDOkPR8XpMwEEOwFUIiiTO61Zpea36GvsxfbU/1WgGux3 5SLvjx9Mtq7WIB7fBrU9mwhClmIjCiN+8Wst/diu+bzoZnVFhAM9QnLKI89yTMKEmR iSlt5UdgZWzRw== 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 B34403782013; Thu, 21 Dec 2023 12:48:48 +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 22/26] cxgb4: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:21 +0100 Message-ID: <20231221124825.149141-23-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: 1785896195469878469 X-GMAIL-MSGID: 1785896195469878469 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 --- .../net/ethernet/chelsio/cxgb4/cxgb4_thermal.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c index dea9d2907666..0192dba14a84 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c @@ -37,12 +37,21 @@ static struct thermal_trip trip = { .type = THERMAL_TRIP_CRITICAL } ; int cxgb4_thermal_init(struct adapter *adap) { + struct thermal_zone_device_params tzdp = { + .ops = &cxgb4_thermal_ops, + .devdata = adap, + .trips = &trip, + .num_trips = num_trip, + }; struct ch_thermal *ch_thermal = &adap->ch_thermal; - char ch_tz_name[THERMAL_NAME_LENGTH]; int num_trip = CXGB4_NUM_TRIPS; u32 param, val; int ret; + tzdp.type = kasprintf("cxgb4_%s", adap->name); + if (!tzdp.type) + return -ENOMEM; + /* on older firmwares we may not get the trip temperature, * set the num of trips to 0. */ @@ -58,11 +67,8 @@ int cxgb4_thermal_init(struct adapter *adap) trip.temperature = val * 1000; } - snprintf(ch_tz_name, sizeof(ch_tz_name), "cxgb4_%s", adap->name); - ch_thermal->tzdev = thermal_zone_device_register_with_trips(ch_tz_name, &trip, num_trip, - 0, adap, - &cxgb4_thermal_ops, - NULL, 0, 0); + ch_thermal->tzdev = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); if (IS_ERR(ch_thermal->tzdev)) { ret = PTR_ERR(ch_thermal->tzdev); dev_err(adap->pdev_dev, "Failed to register thermal zone\n");