From patchwork Tue Sep 27 14:32:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 609965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA007C6FA83 for ; Tue, 27 Sep 2022 14:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232841AbiI0Odc (ORCPT ); Tue, 27 Sep 2022 10:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232418AbiI0OdD (ORCPT ); Tue, 27 Sep 2022 10:33:03 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054FF54CBF for ; Tue, 27 Sep 2022 07:32:58 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id iv17so6657736wmb.4 for ; Tue, 27 Sep 2022 07:32:58 -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=rfouTixis30rRYkQFrk+ln930d6uzUs4TAsgPAC9POztjI8fDu4i6dkxv4fKye3XJp 1In6G6k8VYxRw01yZ4fIInflEGmvMEOzKwjR4hSlhfgds7381dE2NwPcMkJc0eIZBY10 rjLm0gj3supa43X9HUXvlAIcjKSEFksE317TCdr5lDhvMLYoZgzgXg/p6vAz1MxAo3XQ Agv2zxAH/OZvY6uKoHaj3ZWBFvqGFZtfMREXbKHW3XX0z1u117C5NdX+zUNSYhbZ0jfm j4J247hNCwXhxwoIBc0t/1oEcrYb1RpN46w7QmkOEluQkTvoNjbspilZMADJrYGaNP97 L/8w== 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=tbVBqI0BO5mtqNbMIfwwQaoGh1DsRDeNIDwYKBA6+7nFkz0tEDYYSPu4SJ6jRI1diP FKN4y+l/NLJVQ33oX0tM7fy/l40ZkLQ+l9OK4MZRSFn+upq64D8akwDAUuEj6STJ2w1S x2QhmSaY22Q1F/+V8SJbSOlDEkk/fjenb8txRhTfIDqyFC/xRHjHBWSL+MQg9yu2mVZM hrhEW0D5mjKnv/I32MGco2w4iJchNGxmk+TZtiwK/Di9hMhKTL8xgKQ0AsUw8V8HuLGz IcLKeEQx1D/zJf3b2jhX5pmBt8qLlm6n+NYHnNIDXKuT6Hn02JV5vIipmpE7PNFlHPHJ t3Ug== X-Gm-Message-State: ACrzQf16QOTk6qXFK6S9gdxRz8heTpf5j/368jp5WSEv1Wxi6ubIT9WU sU03wTE1asw4hQtZ0/m1dffQCA== X-Google-Smtp-Source: AMsMyM60IWXw4nzGjnK2BFNDz8nbH8qalr1HEM2XyAQHtAygKWucxxtwnWOQMV18NKyeYC7Z/b2Nkw== X-Received: by 2002:a05:600c:4211:b0:3b4:6334:9940 with SMTP id x17-20020a05600c421100b003b463349940mr3020567wmh.166.1664289177231; Tue, 27 Sep 2022 07:32:57 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id l6-20020a05600c4f0600b003b4924493bfsm17518371wmq.9.2022.09.27.07.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 07:32:56 -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, Amit Kucheria Subject: [PATCH v6 05/29] thermal/of: Use generic thermal_zone_get_trip() function Date: Tue, 27 Sep 2022 16:32:15 +0200 Message-Id: <20220927143239.376737-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220927143239.376737-1-daniel.lezcano@linaro.org> References: <20220927143239.376737-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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;