Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5220703rwb; Mon, 8 Aug 2022 14:38:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR6iupD0dpot77FZVvOggz5gV03pnS8cZhysK99NPbKVeyyQOrPa+T5/ks0wl6lgTsjFhUJD X-Received: by 2002:a17:907:7b83:b0:730:8649:9836 with SMTP id ne3-20020a1709077b8300b0073086499836mr14919602ejc.0.1659994681313; Mon, 08 Aug 2022 14:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659994681; cv=none; d=google.com; s=arc-20160816; b=ghsC+9LsdA+ml60nrz6ZFkIOHe9kqb/mT6zXvNw4vaAPlHO9otit4aXWxj+3mutS9l pOOY2MgwFOtXBe36Kb/vC5OTXcdLBxwDZ4kQzR+ZX5Krm9/FREDjrLu9kUoSeYt2Nl0T +GQ+O60HO91Q6SqIEOaB3iP9S4hkPYZMQ7Jbpczzrz49On5jeB7SLd6cwparLsKpKx3S bOjWnr/yfH1rshuAIIYOiI8IzBA9s1B3p4EFfCZFbkYcn18XkjkwcPeU6RcpMzCBN/1I eJzI+i7PpWtgUxe5iWPF3275cKpl9iHTjepKUBiQ5rrNugyi1gbYEFu+m0mKxC/yQGkf z6sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=rS3Mx8/uZ2d+BgMGOGtvmS/CNUo6wU0+RbWwTqMfR8I=; b=V3zMWZqpm398NjrIt/7/nPyBG63NSUkW2Z2wYoGxUMyPgntC0QvBa6hiBmkG3i+SH1 zI7EJyDascLYo2VPXuFaXLRZjo/SRwRHwuTBCP/2blDmeGjlloQAW518Ed+eoygtCUJY uQMwk7PVDdAmLtQQ+EkMUR1YjCYdnMfBLKW/wWMmBkgC7+Vz/6FQ2wxay7TCSA0ZyPM4 RQH5ngWogu45CQ3cnzn0V88j+vs+NbXOfKnBy3hLQg0CdMVEo3ZKqqa/jCz/LyW6BKaC vlergNCcpsEllexK/pK0g/FOAIIjKpr0NcAyS2hRiySNcSc58g4rkrrqA+AOQUgSXw3B 3+Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WDCv75RR; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r25-20020aa7d599000000b0043bcd0ecd74si6364683edq.202.2022.08.08.14.37.33; Mon, 08 Aug 2022 14:38:01 -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=@gmail.com header.s=20210112 header.b=WDCv75RR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244487AbiHHVdY (ORCPT + 99 others); Mon, 8 Aug 2022 17:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244374AbiHHVdE (ORCPT ); Mon, 8 Aug 2022 17:33:04 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21631B792; Mon, 8 Aug 2022 14:33:03 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id g12so9174818pfb.3; Mon, 08 Aug 2022 14:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc; bh=rS3Mx8/uZ2d+BgMGOGtvmS/CNUo6wU0+RbWwTqMfR8I=; b=WDCv75RRp771BTrXoqCYUYmsK98tI5FHeD3vK8AtBlp07+b9a5FwjIo8VsSqSuRRMi 1HTbstJmbcsWr5Lk6zNA7l42qj5Mlbkp6xG6WnO+Ug0khtE/pLRXy1M11hRIkWXOSoQa Yy57MR/8S0NS9rowud+9Mg//M1aztU3rIf6HyOTIKtnjkbxl75Fj8rkpkKHhf1TZeNAF RH8rOzOo0MNU2Fx5pKzs/MfgezRGLNGa6ZM4i12CkUx4StQwYhUbfKCbxHOJvYUXAFw+ y5IO7YlIENr/PhzT398g/oWyTato2mqiXn4eIyc4dQ15C1wD0zza6q495CmE/Nx+YRoP 7/5A== 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 :sender:x-gm-message-state:from:to:cc; bh=rS3Mx8/uZ2d+BgMGOGtvmS/CNUo6wU0+RbWwTqMfR8I=; b=GI41Hfk3D7DjaAk7uC/nMuDIZHNjstjwYRq2arx5EtVGaNDKrZhyFlnDyRrOqK2LhI WtpbE4yTt1jKv49uVBqaDI7IqGyMS/FmB6sdeRHVNQ9BI3eHGdeyAmEP7Cg+quJz6b+B 3KqQTioidHC0sS/BPlwW1lWKhMW1ITgDnohL++gnSu8oRVmfyLniXJOnbOZ0V4LvUBTW qAGr4nw7WPraFsSWniRF19Yd8r1bJfQwPhwtb2igllnNNtN7SWHB+pxZPvOzSNY3A3Nr PLd+aE2YoaIsv6o2ITp4PMJW9sCJsxnAtZWWsG8oth/4UyqZ1lA9QbWAvv7cWQ+zPqGi 6HoQ== X-Gm-Message-State: ACgBeo2Omn+5R7rySSrsE+gopOttpzk52TMjYJfTJxmMAVpnESi9NUQb 7QO+r/iCnINipUTShgrobOXMTlUJFJw= X-Received: by 2002:a63:6406:0:b0:41b:f291:2cbf with SMTP id y6-20020a636406000000b0041bf2912cbfmr17518116pgb.96.1659994383453; Mon, 08 Aug 2022 14:33:03 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id q13-20020a170902eb8d00b0016eef474042sm9057529plg.262.2022.08.08.14.33.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Aug 2022 14:33:02 -0700 (PDT) Sender: Guenter Roeck Message-ID: <593294eb-aecd-2a9c-dc01-1e91b0a00075@roeck-us.net> Date: Mon, 8 Aug 2022 14:33:00 -0700 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 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Content-Language: en-US To: Daniel Lezcano , rafael@kernel.org Cc: michael@walle.cc, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui References: <20220808180915.446053-1-daniel.lezcano@linaro.org> <20220808180915.446053-2-daniel.lezcano@linaro.org> From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 8/8/22 13:31, Daniel Lezcano wrote: > On 08/08/2022 20:35, Guenter Roeck wrote: >> On 8/8/22 11:09, Daniel Lezcano wrote: >>> The previous version of the OF code was returning -ENODEV if no >>> thermal zones description was found or if the lookup of the sensor in >>> the thermal zones was not found. >>> >>> The backend drivers are expecting this return value as an information >>> about skipping the sensor initialization and considered as normal. >>> >>> Fix the return value by replacing -EINVAL by -ENODEV >>> >>> Signed-off-by: Daniel Lezcano >>> --- >>>   drivers/thermal/thermal_of.c | 4 ++-- >>>   1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c >>> index 368eb58e97cf..4210c18ef7b2 100644 >>> --- a/drivers/thermal/thermal_of.c >>> +++ b/drivers/thermal/thermal_of.c >>> @@ -329,7 +329,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int >>>       np = of_find_node_by_name(NULL, "thermal-zones"); >>>       if (!np) { >>>           pr_err("Unable to find thermal zones description\n"); >> >> I really don't like that error message: People will see it (and complain) >> whenever a sensor registers and there is no thermal zone, even though that >> is perfectly normal (see description above). >> > > I agree, I'll change the message to: > >     pr_info("No thermal zones description\n"); > > sounds good ? > I think it should be silent or at best pr_debug. Guenter >>> -        return ERR_PTR(-EINVAL); >>> +        return ERR_PTR(-ENODEV); >>>       } >>>       /* >>> @@ -368,7 +368,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int >>>               } >>>           } >>>       } >>> -    tz = ERR_PTR(-EINVAL); >>> +    tz = ERR_PTR(-ENODEV); >>>   out: >>>       of_node_put(np); >>>       return tz; >> > >