Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5107138rwb; Wed, 21 Sep 2022 03:20:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UHAxIUPFGbO+orhJqM4f7yZnlc41DAaC6rNVU6XrlRRZWbOD16CqL245ycaOzvj353c9C X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr23696323edz.71.1663755609257; Wed, 21 Sep 2022 03:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663755609; cv=none; d=google.com; s=arc-20160816; b=K14zIpP+/2+I8Tn/bPsxEvXgSf/JUj4RSwzj/a+hCoV5e/ZGTM54oXoImm6jtzaoum GZrEk7eWYQwoAkEWN7K4s31KZbbxqDW8UVFIbQu6uIknr0VRRfLCG2iJNYB5umQyxFg/ pSRi9l05iVTAjJIwwqS6XpM1Z9hfaK3HG/tJ1rEOSu+oGoE2xEp4jJh8F791je43cXu+ ODtk0/ONg+60Smg105+e7XYxjg2XoCHncOaSe3RVh63wklCIKZ0Bu1ryICjdTkQrE4CR 3HDJ9ihHc6k400x41Xodm1ZtV6XWX+2aFbYPXqx+G69OMjnxbYrn0sNr9wDIlPRiFeQ1 71Xw== 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=xkPHXuBzv0wmjVLyne0NdML0Bcs5EeGOnpx9KPrqlChrsHKbvwlZ3rwA/ysS5HBJeB Pv/Ld3Z7Rbsn6yGgZyiEnCbzIT/opSm/Hly4bMoYlc/tujolIm11HXgFlrtlG7tIJ8s1 gmx+kBEiOkbKXyMvTuXTpFSJYbzQ6/RAPLnTlu4UqncwPNoKHGU78LHHUsoGRSfa80aM XV3SewH0gEBNi+K3YfOIM/hqzpbb4QoGPoUwLez0jD6dLfzpFy2VUJxsIanpV7faMAic X0q6e0gpgAf77bG1p3eK6GbIDW/SmnBHMCUzlf4Ua5MJy1Z6yFdU5mh8uS0PmJ9m/5x3 b7tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zsrvb3mh; 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 b20-20020a056402279400b0043be6506057si2322866ede.182.2022.09.21.03.19.43; Wed, 21 Sep 2022 03:20:09 -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=Zsrvb3mh; 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 S231920AbiIUJq2 (ORCPT + 99 others); Wed, 21 Sep 2022 05:46:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbiIUJnj (ORCPT ); Wed, 21 Sep 2022 05:43:39 -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 D0E9592F6C for ; Wed, 21 Sep 2022 02:43:28 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id t7so8855143wrm.10 for ; Wed, 21 Sep 2022 02:43: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=Zsrvb3mh+DU+uq04wshQdZ/fl6vUAZ6Rn+tYDUa9JYYGCFrCHQ94KJXrfUMzknkMoo 1smMNmbkcAm3Ynlzpj6C7E2InZ749X67xqnIMG66QCrPVgEKUGPWyN2koqGQkSM/nHVz /g5BsZdUV6yl9tQfoKTDpLMeTtkS+uoDJBVOK/c0285ZckytjP3ytTHrg+YzqA4tfQuB LaGjRGHS+/tBB+rIybB8J1kt4+ru3Z4f/cSAeAa3SpKLInIiW5JEMscKVKA+WLBk5uMO sR9oPOevvrF6E5dhJYkO+u0L30vYSPv7qkjcW6DGo/FQpeTk2xSvEknXD8qfv2PIl12j Xfww== 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=aBwqEBiNMxl/d7dNYtmahf3j7hKgMkW41Vn+6ezX4EFdCFnkj/OzZD7MTGn1762JGb 52b4qquIFkF5fn25+GjyaAf63xs3dMOudmo3HjWXc7DS3E+wDFHExwKbH88ADRubRODo KN6qqIHYSnwGlF0XN2K51nGCMpJVQMJ/VrjDi2FqWZNNcEvZIrVVnmS+yK4Dsdc0JVOd ejXsOPMZ56VC4gB8jbsYYUBBhjaVGVB1LpfB+JWNaNQHBvO1mDQR5h/uwRNtjECGnT6q tFKaZSSi1oZz+Eyjz3f5ST7SU02K5TpykcXIhoA4K87v4O5+KOXs0oi/rsZiB+JQJ/cL Hq/Q== X-Gm-Message-State: ACrzQf22DhBZP9xyzBpiZHrXhQ4M+Cy4aabQ8/Zwk0mHMcc9NEdmVZzZ 4TisRomzuiZaTyC5L6StDHZYBw== X-Received: by 2002:a05:6000:38e:b0:22a:e302:28e6 with SMTP id u14-20020a056000038e00b0022ae30228e6mr15168907wrf.595.1663753407844; Wed, 21 Sep 2022 02:43:27 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id r123-20020a1c2b81000000b003a62052053csm2763917wmr.18.2022.09.21.02.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 02:43:27 -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 v4 06/30] thermal/of: Use generic thermal_zone_get_trip() function Date: Wed, 21 Sep 2022 11:42:19 +0200 Message-Id: <20220921094244.606948-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921094244.606948-1-daniel.lezcano@linaro.org> References: <20220921094244.606948-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