Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5180429rwb; Mon, 8 Aug 2022 13:46:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jYF722oqoShw+jpnIg6FZ8ppStF1cyE04H0Bj6usEXNa/Kkl7dd9RFhI4Ol5mEvxUcx4W X-Received: by 2002:a63:9042:0:b0:41c:cdd4:ae66 with SMTP id a63-20020a639042000000b0041ccdd4ae66mr16703970pge.47.1659991559869; Mon, 08 Aug 2022 13:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659991559; cv=none; d=google.com; s=arc-20160816; b=NsL7unlFnrtbAHs/mLHCSn+qVahd4x5c1xvWr7zudYhUp/c/fGJ9rYI7MnomDiF4/A 6Kal9W3IFh7SwmOjUOZXYeEG5CdLIVnlnsBJRWDv4tEbb6MAg0IzEm38Xh0tiGe2bvyf XqQIxyacDQG4sruPoB0/Iegr/+Y7RW6EvT5K7eS6FP78xtm6RpJQkTMOY6DnPJ41Brqc MJxq3+rToZsUlYzy6u/4d7E2nIYlwJ93ruN8kxB4tPGBXYwHkVIl3gYyVF6D6mzDxQOl BpblKNGGxAr3Gwun18dosCAX4yHAuMUc9qniXTq25LLxE1vD8C6fNDPWiXg1e+p2e/Px +5ag== 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:dkim-signature; bh=MubSuBJ55Yor4lGrHEqbMJ79aaqMV5qcbEpjGX8/hEg=; b=Gqp7UKH2rdPSg3/M/dgkvG+ZyTZVeQzaeLWMbaXHsxSIE6xVsYLOemiLzzxbHgqKOx qDB0NgG/KVSIxPYVsCarGC527SYynKYucrACUl3P7bkSBYnPmb0hdDyQfC9fb/fTp7xA R0ruCSvBrFzxx7jKdfhf/d+ePG7qf/APQmsod4c428o78pezeSOa9PfCq/caq8V4cVM2 NoJZC0n8XLZiDaTF33Mcy2KfopB7BbBYaZySf4shh4H4d9wssHAjiQ0O2RoEcbvPqfZJ jYrpkXJDJ4BlZ8QWgbMPWGzpxW8XqwwIoEUaNcW8sJhgN8YsmvF9FVgcyUigOWJW5Rgl Zl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o5NvaAIl; 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 b10-20020a170903228a00b0016d981e3322si237208plh.370.2022.08.08.13.45.45; Mon, 08 Aug 2022 13:45:59 -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=o5NvaAIl; 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 S244337AbiHHUbY (ORCPT + 99 others); Mon, 8 Aug 2022 16:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235732AbiHHUbW (ORCPT ); Mon, 8 Aug 2022 16:31:22 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8E2101CF for ; Mon, 8 Aug 2022 13:31:21 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id a11so5332021wmq.3 for ; Mon, 08 Aug 2022 13:31:21 -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; bh=MubSuBJ55Yor4lGrHEqbMJ79aaqMV5qcbEpjGX8/hEg=; b=o5NvaAIlqMRDnCT7EydZylzFd6imx21dOgzQpWut83+uDBbcaWKujB0WWLNa48Hsza Hhm2SYBpbSdXx00g5K7J5oOwfuKX7CeYf1I/j3irJzBJluNNPu9fml+recqWh9YDBUsD r+beYwBV6Z5vxuh2o1IvGl+Sp1OzoOnd81njbUlNVck3vJ77Ij9Ioct6Q2gzwed0Q67f h+1l5+9RPmBGA/BUMRFbKBQ6F/KRK2VhQO/0nOSLXgq41ItYtMDd7GLQtd5tra7A+W4x haky8V7B1rbLz/FrnwJh9lLvI5fND5ge2dI9WVORhF9zntlNciJQWhaBDlluv7Aubq6u Qr9Q== 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; bh=MubSuBJ55Yor4lGrHEqbMJ79aaqMV5qcbEpjGX8/hEg=; b=IAPGcGsmaU3PbpNeLL5BJP9hSIO7kLSLIw1pLSK2UDMnbfff8Lz7YNgN0h0pf0U99m ZaMP9A0LBuKS64LOPkL9b3fJb/8PxhrWi/LXL5VubGHif4uuemmJPnl2u8mM/O2dIn2u ZOyC5znNd3QYAnGhuq5e7oncyjp1eTdF7yrRtj6GqXYG1iIC1MutQW1tfmG1wxB7PPD0 qZ/lW2riKmDgDuS/m+e2TdWpax1R7uey4ykUvnZAg0eiJV3slC4DRuaZKo7uGX/LDgIG SFJKHxpeQNXMVHykjAYbcGT1loUAuOKpBUKzIQJGgoxb2tYBRY8HmofkbiwAQdyPpALN EkdA== X-Gm-Message-State: ACgBeo3xDC4lp9a5ZMFLs4bt8r9mkQQL51cL8O/PUUODKzNRPY2C/0XO gD2IrTknTG/hEnM07YvMpfQTHw== X-Received: by 2002:a05:600c:3b02:b0:3a5:2460:f059 with SMTP id m2-20020a05600c3b0200b003a52460f059mr8907497wms.129.1659990680315; Mon, 08 Aug 2022 13:31:20 -0700 (PDT) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id q21-20020a1cf315000000b003a317ee3036sm14262576wmq.2.2022.08.08.13.31.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Aug 2022 13:31:19 -0700 (PDT) Message-ID: Date: Mon, 8 Aug 2022 22:31:17 +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 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Content-Language: en-US To: Guenter Roeck , 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: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 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 ? >> -        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; > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog