From mboxrd@z Thu Jan 1 00:00:00 1970 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 46129ECAAA1 for ; Fri, 16 Sep 2022 17:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiIPRA1 (ORCPT ); Fri, 16 Sep 2022 13:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiIPRAY (ORCPT ); Fri, 16 Sep 2022 13:00:24 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A2836DF1 for ; Fri, 16 Sep 2022 10:00:23 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id n10so6364663wrw.12 for ; Fri, 16 Sep 2022 10:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=Xd2uJbGHAG4KxDTbdiFsRgEoAtDupFBZUXylnQzUv3E=; b=Jv8NMCVobfWdWvCbJEH6Tv6/1I29MBt5TM4jbf86DjaufB5kNeyoJaIAzhftTiOY96 d+slEUTACGHu/9x/QUNicfqcGKuyXTbuAUuVhHXu1EwMz+LRzIFCaby3jQaDC9dmT5Af Jgk1G8TaDA3+5szF5fsygP7eSZFfenRh/2u4x5eCnSyIFUi1ftq7WL/fPde06Do8X1Hm PZhMrT5magolSlwONTZWR7gZlvQZkDdUBw/Qdk6ev8xkompGmm54fmWZ6N10aq4Aa6VG YKwE+BGtiVoRJRu3296KBHnxXqRjbODbaaGqA7zIWwZVQ7+f27tJz/mGxBoQMhmpGpBe p+jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Xd2uJbGHAG4KxDTbdiFsRgEoAtDupFBZUXylnQzUv3E=; b=U0ft0I98mmBdXFCgApg1glsz9I/sYkb0cNUTlVDvorGFFbsB5yXNYleXLVGnOYx2Oj 9T9cBDdhYuiMMtrKbtioGdrM87GUKRUch5dXiWrkOqqPZqG/humyb77w7xeAbFsvHpxD gZFy/9wzljFg+rd0OgmlUeYkpy5KCRxazSnn16G6KQUDnbAQzBnX27VIQpNZDAZU6Rgu zbMWy9XyfYOv25Sx0Fbl0V3X8I77kahhs9CAy1O4HDPRCZgch4LRE1vss+f+YHArLNn7 2Tn6DWcrUpCfCp8+haBWbOgOqfIKBNDU8iHWFOaftfUSa5bPvSpzb3mTHiSS5mmSUS8d UkJg== X-Gm-Message-State: ACrzQf3Z0MWjzKCIjx+IuzfqzdpckT7KgNSVkudWKWRouRhAPRoNxTjE k7jlW2U7nL61elOkd02VDqwvUA== X-Google-Smtp-Source: AMsMyM7CcWZCCo1yJCD46oPuW0FRRfr8eQEUC7V1cVayE7g7It+x6iw5BeMNrIDU6ihhiVMN/C9zLQ== X-Received: by 2002:adf:fa52:0:b0:228:9675:e6f3 with SMTP id y18-20020adffa52000000b002289675e6f3mr3357936wrr.151.1663347621594; Fri, 16 Sep 2022 10:00:21 -0700 (PDT) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id f8-20020a05600c154800b003b477532e66sm8896630wmg.2.2022.09.16.10.00.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Sep 2022 10:00:21 -0700 (PDT) Message-ID: <8b260b5d-3f97-846c-c96d-c9ada57ce33f@linaro.org> Date: Fri, 16 Sep 2022 19:00:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 15/30] thermal/drivers/armada: Use generic thermal_zone_get_trip() function Content-Language: en-US To: Miquel Raynal Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , rafael@kernel.org, Zhang Rui References: <20220906164720.330701-1-daniel.lezcano@linaro.org> <20220906164720.330701-16-daniel.lezcano@linaro.org> From: Daniel Lezcano In-Reply-To: <20220906164720.330701-16-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miquel, any comment on this patch? On 06/09/2022 18:47, Daniel Lezcano wrote: > 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. > > Convert ops content logic into generic trip points and register them with the > thermal zone. > > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/armada_thermal.c | 39 ++++++++++++++++---------------- > 1 file changed, 20 insertions(+), 19 deletions(-) > > diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c > index 52d63b3997fe..9444e5a22ca0 100644 > --- a/drivers/thermal/armada_thermal.c > +++ b/drivers/thermal/armada_thermal.c > @@ -785,33 +785,34 @@ static int armada_configure_overheat_int(struct armada_thermal_priv *priv, > int sensor_id) > { > /* Retrieve the critical trip point to enable the overheat interrupt */ > - const struct thermal_trip *trips = of_thermal_get_trip_points(tz); > + struct thermal_trip trip; > int ret; > int i; > > - if (!trips) > - return -EINVAL; > - > - for (i = 0; i < of_thermal_get_ntrips(tz); i++) > - if (trips[i].type == THERMAL_TRIP_CRITICAL) > - break; > + for (i = 0; i < thermal_zone_get_num_trips(tz); i++) { > > - if (i == of_thermal_get_ntrips(tz)) > - return -EINVAL; > + ret = thermal_zone_get_trip(tz, i, &trip); > + if (ret) > + return ret; > + > + if (trip.type != THERMAL_TRIP_CRITICAL) > + continue; > > - ret = armada_select_channel(priv, sensor_id); > - if (ret) > - return ret; > + ret = armada_select_channel(priv, sensor_id); > + if (ret) > + return ret; > + > + armada_set_overheat_thresholds(priv, trip.temperature, > + trip.hysteresis); > + priv->overheat_sensor = tz; > + priv->interrupt_source = sensor_id; > > - armada_set_overheat_thresholds(priv, > - trips[i].temperature, > - trips[i].hysteresis); > - priv->overheat_sensor = tz; > - priv->interrupt_source = sensor_id; > + armada_enable_overheat_interrupt(priv); > > - armada_enable_overheat_interrupt(priv); > + return 0; > + } > > - return 0; > + return -EINVAL; > } > > static int armada_thermal_probe(struct platform_device *pdev) -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog