Message ID | 20230707010333.12954-1-W_Armin@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2945013vqx; Thu, 6 Jul 2023 18:22:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGC6Vlh21NETI93gzGj/FFvrowPsXHRtqrKUqcm/F6wzytuV8id6rv5vEW4ObidR/nnjeUJ X-Received: by 2002:a67:fb8c:0:b0:443:86be:f326 with SMTP id n12-20020a67fb8c000000b0044386bef326mr2255772vsr.18.1688692927888; Thu, 06 Jul 2023 18:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688692927; cv=none; d=google.com; s=arc-20160816; b=zr1/Q+jAxE5wuHn90grLvuHtfu2Is5Vrb3WOE6VONjtrVV7+RHuVNkzWT+4MdAZcDm pcmtJWIVFNqUe7D7ezdJF0Fm6xFmUlKI3e2goaAFOHXNb3loEuwe7ElnYCaGOwOqo3PL ihD6YqRsO1pZvRg3srFNsMnHL4VKlU582mLym5i+7MfG9EtEL7rM/9V2e5JbhUnCeW/i h7ethDd/C9h/DvZq9gjQbH5TeZhGuWVr1Lr1L9EoPwl/NaJwE1331gaIOSTyWdCE3Mhu DMJFXw0QlmAskv48CsYGBC9ozvvERPpCZQ3PgrY+a15dlYC/vR2+fONm9kkqx+8Qgcj/ rZAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=+oIOaPOZd61ihL8ZxQmhSfjnRBTsUWZckmfdcMAXRn4=; fh=Rz7QEXhtT5OjqFeVqEYK1yDWdLE6knQ0pKDdjl9qJnw=; b=Ee2oDyHepNckDMV82L4aP/I523Bf2HbPu4oi6LHgDaYWTj1qXuM5lJishFK3bWyEtY 9fhAhe2kYZAHEz1CX+qtw1VhIQi+P5grV9j1WHa5doclX+vPyn6uHqYNaoorwWlw8Tj1 BWCkn/BCPTIL6DqTCbmMtdShLArenNiF/XTR3+aTaK+GrPpDGnB43ox7sCTjplwFxWUo vbkjLwawAtjDDog3XPA5TD7BQD67AlBPGs0qzP7USudYbxxTmr7znwnznm1TADUODMF2 xpNNWCgbMXmyW31Sx7a+50GqkjF4abyRrldDQA+nEO01ELhdpzTmlpP/bshsEYcj13Qc DjVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=rKFY3UKr; 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=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z33-20020a631921000000b0053fbe7c8d3dsi2664621pgl.632.2023.07.06.18.21.51; Thu, 06 Jul 2023 18:22:07 -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.de header.s=s31663417 header.b=rKFY3UKr; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbjGGBEC (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Thu, 6 Jul 2023 21:04:02 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <W_Armin@gmx.de> 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 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03: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GvoTzR6plo4e/g+ybXxuSAKQL iMxizB4pD5Jf4qBCk5esdiBEVb8ZHe6Who1Nf7/ER2S8bC36MbAFqrVL1vxOnVK8C3LbRS4r9 ZyKWUejeW2rNHJOeyiimmazXViEE+IF12E/hEhDbBhkkOGNxRlpo7NBOb7shjjBr0JDap/JNQ DABP8/wyoW4qFg5VFrgPA7s1aBU= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770722875321913621?= X-GMAIL-MSGID: =?utf-8?q?1770722875321913621?= |
Series |
[1/2] platform/x86: dell-ddv: Improve error handling
|
|
Commit Message
Armin Wolf
July 7, 2023, 1:03 a.m. UTC
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 <W_Armin@gmx.de>
---
drivers/platform/x86/dell/dell-wmi-ddv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--
2.30.2
Comments
Hi, On 7/7/23 03:03, Armin Wolf wrote: > 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 <W_Armin@gmx.de> Thank you for your series, I've applied this series to my fixes branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes I will include this series in my next fixes pull-req to Linus for the current kernel development cycle. Regards, Hans > --- > drivers/platform/x86/dell/dell-wmi-ddv.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > 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); > } > > -- > 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); }