Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5055112rwb; Mon, 8 Aug 2022 11:18:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR4umzq2Q7chvFqBU1ApNvO5khqxF8cCt2Df3Oa/uX4mo0fS88btr2iXF+gD6+Ypq38s+UJ0 X-Received: by 2002:a17:907:6d18:b0:731:219a:49a0 with SMTP id sa24-20020a1709076d1800b00731219a49a0mr8530944ejc.406.1659982723313; Mon, 08 Aug 2022 11:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659982723; cv=none; d=google.com; s=arc-20160816; b=0JCFFHiatVBeIrir77aNHPA9TpPIzkMTGmAVB3SO4RQKvag9oM2chqTy8cAe8uZw4J 0+HT80hm9O/yDRJPrPFNxCqSSnBW/k0rsXiSNNovZHBp9VI70yaecFVS4yBkVHvs/II1 pRJFO2In04ThyvvRBu3lEow70nG0DE17laMa/FH5VJA2jvpwHrYESTLTclsFj0vufnjv Oo7ESgglumF2M9aJJK7NXUWwjFKSRBX7rAhluS0ITi4jyyyrAGdX1ryMtqPqUdZkPozZ 4SfoZ7MW1jeJd7Pl0d1upXnxQJMbqP6Imt65pBdAcEhgADswlpcYP3YIWAXXR6uhQK50 3Qzg== 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=uQc495y1/n7wZ6jO9fLLJ/vKRB7PCtus+u7rmKliZco=; b=B9WxjChAB6G7FjgY7o6ssT+qLKpqM7+xTplCXDxlJNaAA9NuaCyQfRQ9nHjDaLtawl Zil6n34z8Vk08Yfden1/YAJp1pT+uL5FmQnlBRzU6paUg8x/BGsb04QvDN/KFLjwAuLQ iagDoaY+YawvhFNHQSSOGeXjjU+S35Xqapg9iNApJeL+m9+m+WLIwibs/lvURWPgqWCb 6FVm4dEXbWaAZK0T3UrbBLylwD8YRQLwEci+Ej6NToWfLRUO+Hcc8MME72CQgUigjyK1 j6VdXv8DRRQECPr+xAXbIRO0+Cuhdbk4a3/igKUSprAmyuEfqqz56WkNx6xU3CpxTtY9 nvmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xd8tHtBu; 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 qa16-20020a170907869000b0073045f4792dsi253738ejc.491.2022.08.08.11.18.16; Mon, 08 Aug 2022 11:18:43 -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=xd8tHtBu; 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 S244144AbiHHSJi (ORCPT + 99 others); Mon, 8 Aug 2022 14:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243950AbiHHSJg (ORCPT ); Mon, 8 Aug 2022 14:09:36 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A1AA6154 for ; Mon, 8 Aug 2022 11:09:35 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id a18-20020a05600c349200b003a30de68697so6229296wmq.0 for ; Mon, 08 Aug 2022 11:09:35 -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; bh=uQc495y1/n7wZ6jO9fLLJ/vKRB7PCtus+u7rmKliZco=; b=xd8tHtBu57N9gyW+8dkc3DzhvLWSm4tNmCZuS/wD2wvS7tsJnNk748CrilQOsAcamf m+vt8etF//ZLeZLTpRexXdvsj0urf4hwcdcCzIvdKLCTFRIRQ3jpGYxllnH2Nk6sqB/H WuT3pgpuUiyUO4omg2ka+TerTetnnj4aZ1hQRb4StwDjaVy9lxKGj7nVs0j2TB/foHaP CCUCJTxHUS4YNKlQ1A8ZoskTuZmCHYe6Y1Fy4RMxvpZLWM/XOv0dOBeifGStCwwfTJpq 9wTjjJTUGwqctohL7JNV35PyE/ybPOVTXzIN18O/LbqguwgZ0NhBtOof0HN31SIrH7Rg ieUg== 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; bh=uQc495y1/n7wZ6jO9fLLJ/vKRB7PCtus+u7rmKliZco=; b=fsh+sryZcwOid97SHfH0FmvggaeSmHI7YPqXg4hstCuDJFaz3vsBN4hjipMqR+kUNL b4H0r1WhsrSJ3q88IUSMnxQTJbfVQpyXHDLI94w5ePJVOMavMn3JF1qwFF/NVVuosPWZ JOLa3tiIgDKh+nN3mtt9J0IHze72ysVEr/uI/N3Ipdmn1WfqoKBqSfbAEDQSBVhRABB1 YhmdoemGPtgoANTduAb0CaZv07IPQFlZQ95TW/49wfzh+Yhe068v2HlJKcBWGa3n7Qu+ 83Py+8Za5ggdiQD6wqnJu/BMtf/m1y/krYX+rt8e5GlJ962T42xYu6nGg6lPXmyCvO+r iPfQ== X-Gm-Message-State: ACgBeo14kan3rvPgtBn5PFoJhS9U2HKYVuoFK/BosSKBDqIYO/O9/Z5N KZ5zgJaWbijSUzd/MkvTO5XkBQ== X-Received: by 2002:a05:600c:2650:b0:3a5:4402:bc2a with SMTP id 16-20020a05600c265000b003a54402bc2amr2838141wmy.108.1659982173974; Mon, 08 Aug 2022 11:09:33 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id c5-20020a5d4f05000000b002205a5de337sm11937309wru.102.2022.08.08.11.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 11:09:33 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: michael@walle.cc, dan.carpenter@oracle.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Date: Mon, 8 Aug 2022 20:09:13 +0200 Message-Id: <20220808180915.446053-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220808180915.446053-1-daniel.lezcano@linaro.org> References: <20220808180915.446053-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 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,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 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"); - 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; -- 2.34.1