Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2558270rwb; Mon, 3 Oct 2022 02:32:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6oz0Q1p2NjQj0aYDkctJDOWGtajnTxCrNh6/i47fwv1YSWEOUOFCtDHvZOEEz0N5nCgnCe X-Received: by 2002:a17:907:2e19:b0:78c:29e0:536a with SMTP id ig25-20020a1709072e1900b0078c29e0536amr1453240ejc.506.1664789530345; Mon, 03 Oct 2022 02:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664789530; cv=none; d=google.com; s=arc-20160816; b=Ei53PUrhOgZXaNLBhxRWJgkCViz9i/7f7Xhp1ozHz6U1c+Lm54eSr3FElFtkVR+VZT 1sBky0RArWq2uX/2q5FlsZaYEgFn7IVV9RJ7Qh0VsMlGp/9xzrM9qNT5iuuyYj5p58Ip KdGMja3AQAjgaOWYppilo0kuvrFqSmiIoJTX24tqLIxFcXLictdnSxqVFF6KN6XLOdz/ QPpgK79mzpNihg4uC302zUs+uz+x7XnLoRJAlbKt2wfz0Z53sYkXbi++iOFhxw9cZusV ehz4jOFE/JUzGIo644UVD3pm75RqSJXz+GPdhDiC++olKjCkTrti4RL6igLgJPwEEzmO /jPw== 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=Pm7kk2uDzLbzYdjOk0KKZ9dTfEVOLZLs0BDfmvqoGuu4gIIs2J/2QYWN6jK2R0N2GU g/F5kUThlMtLe4c45b0CIXi0b1GcrYhpwWaYNgIcs0h4LWYenN3GMfvAafXv2FnOytw6 S/IogMFcO9DBr2uVPL+q8xGl0bL4jvqMPorN3VGJqmQUj2vzvq6pn9jx5FmzoOzWVnmt 3jimoDQGdQ3NBQ87ONfLWemn8YBlwZ1ReNkn/lzceC4deAx8z4y7YIESjGnR8FVCfr/C 08sAo2XzP05IRSYksrrByNB8jhHj3Qo6kZiY5CPIXVuVWx10QTOHOCB77c4QVMolLkms ncfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xWTt0lqJ; 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 hz5-20020a1709072ce500b0073d8f141e76si7572139ejc.130.2022.10.03.02.31.42; Mon, 03 Oct 2022 02:32:10 -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=xWTt0lqJ; 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 S231613AbiJCJ2N (ORCPT + 99 others); Mon, 3 Oct 2022 05:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiJCJ06 (ORCPT ); Mon, 3 Oct 2022 05:26:58 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D01E333E0B for ; Mon, 3 Oct 2022 02:26:40 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id j7so10420270wrr.3 for ; Mon, 03 Oct 2022 02:26:40 -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=xWTt0lqJoORJvB5MR0Chd3V/34kV2SaDfPxWsVfgxGmEyKtT0GKQUSRv6GIMzXiPhj SmtpOe7+z0hyvG3nyOTLVzNAw3LAhEMO98/I7FEl0zTpeRvqxSCSBEgYIdtDHf/OLdh0 BWI2zCyLMK81hPY/3b/PMyirla8YQQ7MvnDxEHxsFQd1/lpoZmAJxALW9tH10U5OgkDu JC4UtgYbltmLIj9MbqqAbyZJsDvbbbqNfoNijUultn1u3nTFNudafrw/sauy3hIZpPu8 TDZ9FibSUKJkGxe2IbL2D6aZMqT81W2lZzzMr4THC91RM9pRuaW3ZoEgmMWP30Mq0JfG BGUg== 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=G7pt/8Qp9J9WAFAq4dii5+R1X3n5YAT1FrOsIXNYbVfnbuZP8At+7y9K06fv6XwG0z XFalIKZjBS/8kmqAx+T6Wi4UJTPFZNhJ/w5XhrsSkN2LQR0AwEXIoCGXT+sRRb6i6Zcl BCmsxA4WnRUtHSWf7gg1QqqNaFy9y52Gr56S6hVZxkJVkLjUJJMvgqoqDctlJ6VyGaYw 2pzTk9zJWNJuZ4jD/5OieCKnQjmMbnTs0lmJ/IMQX9Lwm07iH+OHg6dDqQxhGpGeV8OU 74yImyi5eRTy8t2xmXgjTlnUmWNxW8fU6X5qalndhsEtSUSuJOLmCeP7MLO+nq/bpToq cHTw== X-Gm-Message-State: ACrzQf2BcjSI+wO2RPZhEoaUfz60DjkJbdxtnJpTnxyVdGgMmNUph9c9 r6JuXK/BTjMJraXPB2uxVUgNVA== X-Received: by 2002:adf:f48f:0:b0:22e:4244:970e with SMTP id l15-20020adff48f000000b0022e4244970emr1124859wro.140.1664789190591; Mon, 03 Oct 2022 02:26:30 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:f3a:9f5e:1605:a75a]) by smtp.gmail.com with ESMTPSA id ay3-20020a5d6f03000000b0022cc157bf26sm9707520wrb.85.2022.10.03.02.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 02:26:29 -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 v8 05/29] thermal/of: Use generic thermal_zone_get_trip() function Date: Mon, 3 Oct 2022 11:25:38 +0200 Message-Id: <20221003092602.1323944-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221003092602.1323944-1-daniel.lezcano@linaro.org> References: <20221003092602.1323944-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=ham 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