Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4640286rwb; Tue, 6 Sep 2022 10:15:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5B1ERw20pDl2Y3srvPA5vnSz7rgQ8WIR3lmIUKUMc+5biHT6Z+i0iigX0Ut2FCqtWKxZ/Q X-Received: by 2002:a17:907:c05:b0:73d:6e0a:8d22 with SMTP id ga5-20020a1709070c0500b0073d6e0a8d22mr39821091ejc.646.1662484510865; Tue, 06 Sep 2022 10:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662484510; cv=none; d=google.com; s=arc-20160816; b=FrNyyKCqsLzvcJ6+6nBNTipRPqkT64zLHru26wQsLfM675xJFqG4S/jG1R8Emy88QX 8JRUgI1TxPmK7mp+fWi+ddMRlpfadZfcnWw1Cw1gYb7/hTT5sMEQtQXVa1mCdqL1bJ5A zPPzbRJb2j2k7DqgEUJ55cFmxdCaFWH/SU0OWDQq4dsYTKqkLTfdI/bTQ6hC95Bjfyrg NrQgIW/bAns+nObp0YVfouNlDRYLNo2JprJ96rXH2dH1mx1c94g6ts1gfQKQUJAVReAV LyHfSBSlj3spkHntga5vSx+U0VFKfzK8Fab/qRAeZJpPwAKIRc/LyPo3oKSewNXMdsLR VwmQ== 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=qIG8CQuv87L9GDIagUy8LnMD8IhMuLMmrWkuQCuawuwo+3ZvJDZcA2/7jtoAvGNC3a 4IrnOoFWSffjQf+1xRqzayB5yyFWEOYi+bXsjd62ZIKDYVVpdcAywrBkj0W6SvKnUIQO TXf0Xs17BUBQVKJYnvf23e2ht5U47NaI8esACKhvZopQJtYT0gIPsawO2J3cgeZA0HG/ sss6EAac9+UMQGTcOOwlyIVDxoAopNcl0v3Pp34QT/YFQUNsq3WE2FRCkEKzcUUFasI3 j5mazFNOLPIQlQxrrRwdol6T0BHLgXgzGM9i9LL0fCUYfwKKx4DDECrKhYRppLfobc/Z UWVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vonoxkcx; 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 eb10-20020a0564020d0a00b004479eacc9acsi2144663edb.222.2022.09.06.10.14.43; Tue, 06 Sep 2022 10:15: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=Vonoxkcx; 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 S237863AbiIFRB2 (ORCPT + 99 others); Tue, 6 Sep 2022 13:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234573AbiIFRAC (ORCPT ); Tue, 6 Sep 2022 13:00:02 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5882B1AD98 for ; Tue, 6 Sep 2022 09:47:46 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id bd26-20020a05600c1f1a00b003a5e82a6474so7804196wmb.4 for ; Tue, 06 Sep 2022 09:47:46 -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=VonoxkcxIL2unigQaZGkuIci+dOBagh1r3V28iduu70oMma3G18boGx+QtwykPWQtk hbbdVfFoeX5JumIQxIalywTLJoFC3QH/9bfZ9ibIlsVXDGMlxL3f9KbtYOT8PCFcLMHm xoziLjJdzpVGmd6ud3cYyCcj/SXI9guiSU6PdNUk3JIT8S7O8lES4usvY++yD5EqF/kc YZMK+CnL9rUyLOGYYI2uXSF+yarh143ol3U+jqJWULGcWlDJuaVgDEfMpEi0tSu7NAeO YvyijtUitgtU9Tkn2EMCxurP2MvgPKJmxqOC2QHxrZ0sRMuuOtI2vQOZb3zOX90I00zO n9/w== 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=JViwAwnKd+/6NS/hKFjM2Vf7vD6CwEb0tlkV2LcpS3LIaOnD+gYyd7FCawp9oJn4qA 0l2MR/yBGVyTttXtcI1OMzNvVYj8K4DwwlUAN1tMXaRR4l2uv1xtVVHAxtMPwt6IQhE8 Zy+nB0q4DPk4Lt7MpgmpWFRF2dcVKOBWUtpj4nGbmp3traUFJOu1vSk0MV1y1pY2HUS+ VpN8RR/ZsCnv3eDAaaB8NC2o+NjFhUJCuARLq52CYpStKbYvitjAKBvt8zbajLJ3TN2Y 6ZjVRQFvyiLoXfZBE8/U9JQWHp36PzkeyloK5M1gGWTQ0cg63rK4gcCaNAFjOdC/Dt0B pVeg== X-Gm-Message-State: ACgBeo0Cmt5PD9DIhnzpIsGu4iRHS32Op4I1xijk/+Vcd7tm2ZADAk0T Ya9QhRsyqOK8UhApaO9lIJ5LqA== X-Received: by 2002:a05:600c:3556:b0:3a6:220e:6242 with SMTP id i22-20020a05600c355600b003a6220e6242mr13849422wmq.145.1662482864680; Tue, 06 Sep 2022 09:47:44 -0700 (PDT) Received: from localhost.localdomain (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id e27-20020adf9bdb000000b0021f0ff1bc6csm7426600wrc.41.2022.09.06.09.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 09:47:44 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH v3 06/30] thermal/of: Use generic thermal_zone_get_trip() function Date: Tue, 6 Sep 2022 18:46:56 +0200 Message-Id: <20220906164720.330701-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906164720.330701-1-daniel.lezcano@linaro.org> References: <20220906164720.330701-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,T_SCC_BODY_TEXT_LINE 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