Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1151332rwb; Wed, 28 Sep 2022 14:04:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mN5a8tb2e6mQRsXeM05Z7lqMgWLaG3tXmMhDdTK60ati3gYKu5QFJASVGh2Bdv/sjxLFB X-Received: by 2002:a17:902:bb89:b0:178:a406:72ab with SMTP id m9-20020a170902bb8900b00178a40672abmr1601996pls.165.1664399040957; Wed, 28 Sep 2022 14:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664399040; cv=none; d=google.com; s=arc-20160816; b=zyip1EpJF8n1ufQ1cqBpnvtUWESI0dQ6K6Fku5wa2oxs5vz0K5SoJRtB+5P2X+I4DV N5rBdeBu/38sa7loberGCPQ1m+PkH/8ZzIlmSlR9ylseCoJ9F3Dr3WaHAd+zsnFs4lA1 Q7mZZuLaN/W2dtpVqV01iT/Gw6DmlRfhaQkeHexTe/QkjD3gxbiq5+P+IEDytgmtZuX6 2H0O8CXCbl3s/f/VlsRHxxGyvtuSGGs/nlIxbwCqKI7K7abnDxqgdJZcsYjpVyWA3nbC BlOgjqp3SNRjMKO2ZnJ48Hdpd0+zMXfFp9WBeLCk5xGOMIUjByGITElG/2XsOnGSbgtr cbUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NVPF6vnmjrMx5FQU0j+pKHlND8VmvL5OT3fQ9b1KMis=; b=TWMIf8YfLC1yK4PFCu/UTKhd4pAHK0OV+fatxQC/ykkUbKrB09xhOmFEVpFWLcoNPG 9X1bgljBvr6kwCZZPCK6v83MKgtnlUgMNZPnWb7Ae3zY64MOLQK0SnMMGiNKnVqBX/rG A8yZLIQ+8dnhdHsyHANy/4qba4Uqy8AGkY4lVsR7HUmy/0CVDwvaQ6XHN3rwcfmUY7Bx FerBTrb5hMxjZwAvZ4k32e0FlO4iIFq2Ct99GLTVi88suHKfRdmdw6f6fZ0G9pLanVIQ hcAUiTQMP+LTWJvUnPsOm2Ui/1NCWM+mkimlVz4/P3r+hg8ewHCQUAHReuqw1tNale1Q lB4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y91pXYbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020a63fc10000000b0043a1c0a0ab2si6342247pgi.505.2022.09.28.14.03.45; Wed, 28 Sep 2022 14:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y91pXYbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233533AbiI1VCc (ORCPT + 99 others); Wed, 28 Sep 2022 17:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233247AbiI1VCL (ORCPT ); Wed, 28 Sep 2022 17:02:11 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA09976467 for ; Wed, 28 Sep 2022 14:01:28 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id s14so21692197wro.0 for ; Wed, 28 Sep 2022 14:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=NVPF6vnmjrMx5FQU0j+pKHlND8VmvL5OT3fQ9b1KMis=; b=y91pXYbUpK2HeCz3FlOiGm40VtzN2VVMAyOaWFZvwoahV4LXieJTOPvOGePh7/zAaX cthCOOl23gTB3T3ejVyVqw7jdJffzWvtv1XoeiqrFdy/LA0PakL7PIUOvys5zksYTzS2 AmO8ciXlwvoc6NYSe71zSA1GMbeb1jsfzDIQ+6Uy/Fl3WegqRehm0S1RohFgKEk7S+BW 2OLuTQiteV/PXHV4cMbhiG+1tpi8Ev6q+8MzbYI7kBcOJxI8uf2o/iGhAtLXz/P5FGEt vvSUm2fMBWC1gKcv3UADXoUUB2+s+pVKb9+KEXS/bbeFZQEZtvHy5XgGMAloJsGTccjm B3nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=NVPF6vnmjrMx5FQU0j+pKHlND8VmvL5OT3fQ9b1KMis=; b=zl1AZGPoqsQ3a9GyV5lOwLE317gLL9zNTTL94GQJYHEr3blfFH3QiPyHhX1yS1yR1m rPfFsEvsTqhCMX65MzVr4Cf91ER2/u02Xue5VRMJI/+3clMTM33cS5Zo4N6sAWwb9eT1 YNkNuPh+YFDx0a7x2dWYnha3ezB1veMLJ6h++CcXzUCsVFkyl7zPHAE6SniHAKA2Zzyb dEXDaT58cdAH5qIdS3Deh1XUdciNaWzM9lwDGoSi6LY2/MRWzRHzVDrpTn9UgbRcokJe afXN1+CsrFtZcMjleJXlF21C74TnfV9qiciHZJzrJtgapsvwtn08/GVeP3lyvV5erCc2 SuOA== X-Gm-Message-State: ACrzQf2C+xU2SGI4xdl71pbxKS3Sl3lwvqbx5ff9VuSd06I0Bx74f2bD a/CIfa4AeXOGiQI48Hadjpj7nQ== X-Received: by 2002:adf:d209:0:b0:228:6298:f288 with SMTP id j9-20020adfd209000000b002286298f288mr21425020wrh.386.1664398886655; Wed, 28 Sep 2022 14:01:26 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:48a2:39eb:9d1b:8b8d]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003b4931eb435sm2874300wmq.26.2022.09.28.14.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 14:01:26 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Raju Rangoju , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Peter Kaestle , Hans de Goede , Mark Gross , Miquel Raynal , Amit Kucheria , Nicolas Saenz Julienne , Broadcom Kernel Team , Florian Fainelli , Ray Jui , Scott Branden , Support Opensource , Lukasz Luba , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thara Gopinath , Andy Gross , Bjorn Andersson , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , Eduardo Valentin , Keerthy , Kunihiko Hayashi , Masami Hiramatsu , Antoine Tenart , Srinivas Pandruvada , Dmitry Osipenko , netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v7 05/29] thermal/of: Use generic thermal_zone_get_trip() function Date: Wed, 28 Sep 2022 23:00:35 +0200 Message-Id: <20220928210059.891387-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220928210059.891387-1-daniel.lezcano@linaro.org> References: <20220928210059.891387-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The thermal framework gives the possibility to register the trip points with the thermal zone. When that is done, no get_trip_* ops are needed and they can be removed. The thermal OF code uses the thermal_zone_device_register_with_trips() function. It builds the trips array and pass it to the register function. That means the get_trip_* ops are duplicated with what does already the core code. Remove them. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_of.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index d4b6335ace15..5cce83639085 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -71,39 +71,6 @@ of_thermal_get_trip_points(struct thermal_zone_device *tz) } EXPORT_SYMBOL_GPL(of_thermal_get_trip_points); -static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, - enum thermal_trip_type *type) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *type = tz->trips[trip].type; - - return 0; -} - -static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip, - int *temp) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *temp = tz->trips[trip].temperature; - - return 0; -} - -static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip, - int *hyst) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *hyst = tz->trips[trip].hysteresis; - - return 0; -} - static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip, int hyst) { @@ -626,9 +593,6 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, goto out_kfree_trips; } - of_ops->get_trip_type = of_ops->get_trip_type ? : of_thermal_get_trip_type; - of_ops->get_trip_temp = of_ops->get_trip_temp ? : of_thermal_get_trip_temp; - of_ops->get_trip_hyst = of_ops->get_trip_hyst ? : of_thermal_get_trip_hyst; of_ops->set_trip_hyst = of_ops->set_trip_hyst ? : of_thermal_set_trip_hyst; of_ops->get_crit_temp = of_ops->get_crit_temp ? : of_thermal_get_crit_temp; of_ops->bind = thermal_of_bind; -- 2.34.1