From patchwork Fri Jul 7 01:03:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13304320 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 EC186EB64D9 for ; Fri, 7 Jul 2023 01:04:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbjGGBEB (ORCPT ); Thu, 6 Jul 2023 21:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjGGBEA (ORCPT ); Thu, 6 Jul 2023 21:04:00 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD5D172B; Thu, 6 Jul 2023 18:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1688691815; x=1689296615; i=w_armin@gmx.de; bh=5882YwYHfG/JJxzZayJ8NZBGgsdnPI/wsZ7JwnWwUvo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=rKFY3UKreNqlHVa9m7ibtqNC4hZyCTYpmbcYEHkBBdgfcDuZvmV5pHSSYxMiLHqTvPcMzQq w050oaxBvvb431Qlba9cSX8TVc41l06we5Yl00QmSAEivuGBQLTfSflZ3FWbbfbxabhBc5e9d c2i6NE4zBUc2uAgu5qkYSzH8LRf6YiUKdOvLnlCLpl3IdAVVQDucKl7U8/Tr/iftiQWywuLsL 0kijFXMPs1W0VFsOMgk+8UcvWuYi7tGormMLiFK20qS5QlQSVQf21rGKKX9Ch06OEdTgM6oUN kclJWM04Zf4O+vn1IE6LUKm/JVbYG/mC5Hy1qPESdKTWuKexBMjg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1pppsg0TQb-0117WS; Fri, 07 Jul 2023 03:03:35 +0200 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org Cc: jdelvare@suse.com, linux@roeck-us.net, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Date: Fri, 7 Jul 2023 03:03:32 +0200 Message-Id: <20230707010333.12954-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:GciWBDV2OMvqV9LClnMebCWS3o42rBZCi9eifhwPnqwUFyXawaR jVsJB9Owq9G0gj0A6o9TerEqF4bMYPC/XIuXXxpgA2ki+XA37WBrK/VwV23RODWXrj4gLbC 73PQZW+8CusSo5Y1NZidx4XwTZ1F/dFNXHn6S12d+sXYT9D8dlvdtHliw3HDqgsJhdnnFDK Y2YHtk5VwIdg/2L0jEcQQ== UI-OutboundReport: notjunk:1;M01:P0:rL4xnUL/AgA=;5oAYG5vEAbGqd6twCiNcj2IXbhu wBCWN7evla+ZTLJW/l+5ws3RvsHvJ8TVv68aoyPWU3WS/aLEzej7WKmy7x0Aw3zG0TxO8ajI/ n/K/Nl85g8oslZkmW4uwTXyJK7+nSstwHMSAOZg4GxjtiT/tbPFvZZhSRI2ikYtuni8Wqp8s0 JgFrkWugiHgKifjyGQgZ3hyHIMK5s7II6+1hlkRoJw3kjBGwgFxvUHqFkW1FtfXjYGRh+0JGw 7fXI1lWonziK08fggqf5LCj6R2zkwXGUzX0rePZ0H4SSclA2V8kYeuhOvJw4ef+MjPI/N6jSY yiPKVDEzgoNtTqJJsgHgPFUQHREsnunziosgdIDdf7nj1sex1Xg0u0MoLxUFgJVOdg03TPy3d FbKip5j/F8qVwdFWUOgSEY3haTtvJoxycEXRA9Rvma1QpgI2hsvfgpKuUNuYbFUmTPvN9eiFN DDwR8ItD4lK6qZdcFHc71y2OJq4rIt1H29lmxQssy9zaEOAh2wgcgjzz/yQyCDnGJ11M22oPy JVOwy3C35ye9SOkNPL+Dv0mxokEmxrMwoNX1/zqrJNvVsoS/l2j0ybDpvcbu0sI/4ln1r+KxT gmcGQiLO1nQ/0C9dnoemPnPDZYVjZ4ZTbGGANIyCiRI3SIIyafmmKs4XoRQuJsHn6Ms5WGHfu Dd5FS7DV7q/kCWuG4CmIJEUda9Fj/b6BKDDAcXO21BKxnhqA/It+HCAiZQrdTiOjecqI0jcQy oIn75cwnSTYvwjBuquKuNO7qZAx7OHKwBcYSVocF3NR8mWUeGvoTzR6plo4e/g+ybXxuSAKQL iMxizB4pD5Jf4qBCk5esdiBEVb8ZHe6Who1Nf7/ER2S8bC36MbAFqrVL1vxOnVK8C3LbRS4r9 ZyKWUejeW2rNHJOeyiimmazXViEE+IF12E/hEhDbBhkkOGNxRlpo7NBOb7shjjBr0JDap/JNQ DABP8/wyoW4qFg5VFrgPA7s1aBU= Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org If for some reason a external function returns -ENODEV, no error message is being displayed because the driver assumes that -ENODEV can only be returned internally if no sensors, etc where found. Fix this by explicitly returning 0 in such a case since missing hardware is no error. Also remove the now obsolete check for -ENODEV. Signed-off-by: Armin Wolf --- drivers/platform/x86/dell/dell-wmi-ddv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c index 2750dee99c3e..db1e9240dd02 100644 --- a/drivers/platform/x86/dell/dell-wmi-ddv.c +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c @@ -616,7 +616,8 @@ static int dell_wmi_ddv_hwmon_add(struct dell_wmi_ddv_data *data) } if (index < 2) { - ret = -ENODEV; + /* Finding no available sensors is not an error */ + ret = 0; goto err_release; } @@ -841,13 +842,13 @@ static int dell_wmi_ddv_probe(struct wmi_device *wdev, const void *context) if (IS_REACHABLE(CONFIG_ACPI_BATTERY)) { ret = dell_wmi_ddv_battery_add(data); - if (ret < 0 && ret != -ENODEV) + if (ret < 0) dev_warn(&wdev->dev, "Unable to register ACPI battery hook: %d\n", ret); } if (IS_REACHABLE(CONFIG_HWMON)) { ret = dell_wmi_ddv_hwmon_add(data); - if (ret < 0 && ret != -ENODEV) + if (ret < 0) dev_warn(&wdev->dev, "Unable to register hwmon interface: %d\n", ret); } From patchwork Fri Jul 7 01:03:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13304321 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 9A4ABEB64DC for ; Fri, 7 Jul 2023 01:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbjGGBEB (ORCPT ); Thu, 6 Jul 2023 21:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjGGBEA (ORCPT ); Thu, 6 Jul 2023 21:04:00 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14ACB1BDB; Thu, 6 Jul 2023 18:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1688691817; x=1689296617; i=w_armin@gmx.de; bh=BFg18R7D45PvYc6tAEeEiB0FiEf132/g39rWra8TwlU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=mkQNklDGH6F2popgGYUoFPxvSZ2IULRaRqXxTjHOCUh0/BO5HNkYGwYpPwqxjTnULh1nb1j FV/4pXIatPb54ADUajwE4edleCcrpMvLLR1uhiuLu+AG1a1RjkBekZnwuv16sce8srLdPThHm o48/s2DSffvU7L+Jjor0FS86ySOc9I060jaI3aqcJNzD5x159k6j0hkImV/Tjq1rDDwYl/c5B uhmF6vY2mXRQqvULFKmIMYPbsg+Ty69Ub3PLBwP1BUCeFhGBXfmEMCXQgBisQCpOBGk/+ui4R Eye5sszYn+yDEsvp++XGOY2EIDt0FGE9p5MeuBhVbWXbQV0Z0cSw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBUmD-1q91h009CZ-00D1d9; Fri, 07 Jul 2023 03:03:37 +0200 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org Cc: jdelvare@suse.com, linux@roeck-us.net, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] platform/x86: dell-ddv: Fix mangled list in documentation Date: Fri, 7 Jul 2023 03:03:33 +0200 Message-Id: <20230707010333.12954-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230707010333.12954-1-W_Armin@gmx.de> References: <20230707010333.12954-1-W_Armin@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:i/hwyvylgjPU5ny4zvohfMB15j+aPvNxemuiuUhCVLAZtR66j54 utYKRqCP6rDJWr4jUreYVprQoEYj/2Fk2i70VBJdx5Xw4tvdsN8vQvhxdPGz3GARzq17Lld 6IQPFLS7oomS+UMul6adBCWRBqveJywec1aJa9BAozpokdwTACxxzsPs4Yuxpc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J124= Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Add missing empty line necessary for sphinx to recognize the list. Also reword the first entry a little bit. Signed-off-by: Armin Wolf --- Documentation/wmi/devices/dell-wmi-ddv.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/Documentation/wmi/devices/dell-wmi-ddv.rst b/Documentation/wmi/devices/dell-wmi-ddv.rst index d8aa64e9c827..bf963d91dd55 100644 --- a/Documentation/wmi/devices/dell-wmi-ddv.rst +++ b/Documentation/wmi/devices/dell-wmi-ddv.rst @@ -187,7 +187,8 @@ WMI method BatteryeRawAnalytics() Returns a buffer usually containg 12 blocks of analytics data. Those blocks contain: -- block number starting with 0 (u8) + +- a block number starting with 0 (u8) - 31 bytes of unknown data .. note::