Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1446916rwa; Sun, 21 Aug 2022 08:35:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5B2zwpMT7NAoPqrE7JKS9K5IjnDZzSEbA031ilcJ6/Go4NmGniyUZIGUcKaOIIQ592078X X-Received: by 2002:a17:90b:33ce:b0:1fb:1aec:ffac with SMTP id lk14-20020a17090b33ce00b001fb1aecffacmr3824452pjb.137.1661096153697; Sun, 21 Aug 2022 08:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661096153; cv=none; d=google.com; s=arc-20160816; b=ngkAzSo552ye0shc3uxoOdfeVgBCuNGXQyOx9xOdqUM8cn0xtp5UGZnqHZXu72e/Pm X16tHrxlNr5+4SJCnYOqLH4sNGWZH5Sw4aNffmT9YyPcVOLhlCloVIMzJdlVcwfZcP7i LEF8TyWV4swlnHjBoyg1u+JcTck2F0DCmLM7z33gzCmxw2uWbRZBoEAKV8yIK3TcPwpx sljY/cpzALkCXIEcXzG8tZOlCBvbgcBqynM3dwoD39uK/mOltWdxiVV0oJYN/iCgXXTl icJ/czgjWq42ROoRocm6vqTlJ69/abTkwgC0xAl4RmyTB2MPPXuwVuwZ/cLzjki27LYg 9+nQ== 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=ArNwZSTkdQelMNA9zfPUn5nX1C72Gk0ffZCm2rUoaNs=; b=Bfe1w1Bf1sRCaQ/lRn4IpU7ungPfBB1hcNQUMAGTzhyd9Iwetuo+d7opyBjR+03gY5 IB+N/2cCiBn2Dx/tuIx0F0pQhYNkMOf1pBOm2y4F3ysXthQ5KfhHvCCWY9lqX5Hw//dW r4hXdHxL2cXXKl4JPSo1xIPMyh752eKce9UhxXXB+PyMjMwY6Ib2UPNLAyFpqV+7lQkV yHR3L+ZOJy4EYRb9cZjlWofU48aI7Vks4iwCh5+9l9zrv9Qb7GPHqqkqed2BxCn8iGr1 dpPHfH1jy3cicLOJBOQEv4PhlWHEwF4xdCF/9+QN2X9w+/MlFt/UOiLYsmNAExniKpig CZuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=fyGN4ZUn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a1709026b0600b0016a3102f8dbsi9992164plk.0.2022.08.21.08.35.43; Sun, 21 Aug 2022 08:35:53 -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=@gmx.net header.s=badeba3b8450 header.b=fyGN4ZUn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231432AbiHUPRw (ORCPT + 99 others); Sun, 21 Aug 2022 11:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbiHUPRo (ORCPT ); Sun, 21 Aug 2022 11:17:44 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6816C22BE5; Sun, 21 Aug 2022 08:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661095041; bh=en7w682FC7Y6FJWxYUFaDykyxS5US63bp0vKvCbq3Rs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=fyGN4ZUn4WV+7elwTy/v5IHqACeQuX5dUVMEpAGv2m6ChEcVTorGAQL5rNt/bb5kS PkFVw3ym6IBjNAIjLw/0b6uQi07lXAQ0icCtBcLtJjdI6x7x8q86bezLlXTdXisb6m ZUDsbsUAGHakAX9PdSKzV/2G2M9jfs7gfKizUtvo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McH5a-1p2PF63tz2-00cjxc; Sun, 21 Aug 2022 17:17:21 +0200 From: Armin Wolf To: pali@kernel.org Cc: jdelvare@suse.com, linux@roeck-us.net, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails Date: Sun, 21 Aug 2022 17:17:11 +0200 Message-Id: <20220821151713.11198-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220821151713.11198-1-W_Armin@gmx.de> References: <20220821151713.11198-1-W_Armin@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SRoUDshao4ff5gMfwaYqJmJd4r9daDJMSgAIDGFWLOCyPfO+pMl HTUPIAVA1/b4YiayzHyY+mT2ceOID7D+ZZYR1KaVW0FE/yRrmvNDu850hxliZzemiPL59kZ HCr2p1PcLeGLjyYEzHqxzjbj8AiincD0f5HnirST8H+bts+D4fPGjP7faYixDjjKDlUcQU4 EExn0dRhIMwSCZIXzMjqQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:42C14LqFIMY=:JmdXi8kACUkI5kxNxDvC+m zqDz3dSEW7RTiEZDYwnPCELoAe++r+OmSAJpnk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0bjq6xAjs6uoaN1OPhgwlmtvsKFLgNoAW/ttEg== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Previously, it was thought that failing to register a cooling device would not be critical, so the probing was not aborted in such a case. This however would lead to userspace being unable to rely on those cooling devices, since they might not represent all fans being present. Fix that by failing probing when cooling device registration fails. Tested on a Dell Inspiron 3505. Fixes: e0d3f7cb2606 ("hwmon: (dell-smm) Add cooling device support") Signed-off-by: Armin Wolf =2D-- drivers/hwmon/dell-smm-hwmon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon= .c index 7f8d95dd2717..1dab7591576a 100644 =2D-- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -1013,12 +1013,10 @@ static int __init dell_smm_init_hwmon(struct devic= e *dev) data->fan[i] =3D true; - /* the cooling device is not critical, ignore failures */ if (IS_REACHABLE(CONFIG_THERMAL)) { err =3D dell_smm_init_cdev(dev, i); if (err < 0) - dev_warn(dev, "Failed to register cooling device for fan %u\n", - i + 1); + return err; } data->fan_nominal_speed[i] =3D devm_kmalloc_array(dev, data->i8k_fan_ma= x + 1, =2D- 2.30.2